 root.JetRetain = JetRetain
 root.JetInsert = JetInsert
 root.JetDelta = JetDelta
-root.JetSync = JetSync+root.JetSync = JetSync

          indexes.doc += lookAhead
          decomposed = decomposed.concat(new JetRetain(indexes.doc, indexes.doc + commonPrefixLength, decomposeAttributes(elemA, elemC)))
          indexes.doc += commonPrefixLength
          advance(elemA, indexes, commonPrefixLength, "A")
          advance(elemC, indexes, commonPrefixLength, "C")
        else
          take = elemC.length - (deltaA.endLength - indexes.doc)
          if take <= 0 then take = elemC.length
          decomposed = decomposed.concat(new JetInsert(elemC.text.substr(0, take), decomposeAttributes(elemA, elemC)))
          advance(elemC, indexes, take, "C")

    indexes =
      doc:   0 # Index into document after deltaA was applied
      elemA: 0 # Index into the elemA deltas list
      elemC: 0 # Index into the elemC deltas list
    while indexes.elemC < deltaC.deltas.length and indexes.elemA < deltaA.deltas.length
      elemA = deltaA.deltas[indexes.elemA]
      elemC = deltaC.deltas[indexes.elemC]
