@docx-editor.dev/core 2.31.0 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/README.md +24 -0
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +16 -16
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +17 -15
  7. package/dist/binding.js +1 -1
  8. package/dist/{chrome-print-BWvaVEhD.d.ts → chrome-print-CznJ0ucN.d.ts} +58 -23
  9. package/dist/chunk-25EXMBV2.cjs +5 -0
  10. package/dist/chunk-2CWQY27B.cjs +1 -0
  11. package/dist/chunk-3IEXDEFH.cjs +7 -0
  12. package/dist/chunk-65XBN67F.cjs +2 -0
  13. package/dist/{chunk-5JPIEN54.cjs → chunk-6NVZNB7O.cjs} +2 -2
  14. package/dist/chunk-6UDJUI3W.cjs +2 -0
  15. package/dist/chunk-ACLR4DMK.js +1 -0
  16. package/dist/{chunk-2E2RPEKX.js → chunk-B2BEELUE.js} +1 -1
  17. package/dist/chunk-DDFHKQFU.js +30 -0
  18. package/dist/{chunk-MOYYRVFV.cjs → chunk-E4IAO4CY.cjs} +1 -1
  19. package/dist/chunk-ETDZFNMI.js +2 -0
  20. package/dist/chunk-FDSL5OJU.cjs +30 -0
  21. package/dist/chunk-FS7CMYLT.js +4 -0
  22. package/dist/chunk-GDS24SZN.js +30 -0
  23. package/dist/chunk-GIY6NT2X.js +5 -0
  24. package/dist/chunk-GWM3AKUD.js +18 -0
  25. package/dist/chunk-HDOXACHP.js +2 -0
  26. package/dist/chunk-IILEENID.js +1 -0
  27. package/dist/chunk-L5TYBFDB.js +1 -0
  28. package/dist/chunk-MNF2K7NN.cjs +30 -0
  29. package/dist/chunk-O324RB6R.cjs +1 -0
  30. package/dist/chunk-OKMEMSKB.cjs +1 -0
  31. package/dist/chunk-QXJKYNYZ.js +1 -0
  32. package/dist/chunk-RALTVLB6.js +2 -0
  33. package/dist/chunk-SRVKFUFI.js +3 -0
  34. package/dist/chunk-TELQ52LG.cjs +1 -0
  35. package/dist/chunk-TJHE5EET.cjs +1 -0
  36. package/dist/chunk-UMMRURPE.js +7 -0
  37. package/dist/chunk-WN7ICTA5.js +1 -0
  38. package/dist/{chunk-XSTGE3NI.cjs → chunk-XJYZVGQR.cjs} +1 -1
  39. package/dist/chunk-ZGTIE3QJ.cjs +4 -0
  40. package/dist/chunk-ZOZI27AW.cjs +18 -0
  41. package/dist/collaboration/replication.cjs +1 -1
  42. package/dist/collaboration/replication.d.ts +20 -4
  43. package/dist/collaboration/replication.js +1 -1
  44. package/dist/collaboration.cjs +1 -1
  45. package/dist/collaboration.d.ts +5 -5
  46. package/dist/collaboration.js +1 -1
  47. package/dist/contracts/document.d.ts +3 -3
  48. package/dist/contracts/editor.d.ts +13 -9
  49. package/dist/contracts/interaction.d.ts +2 -2
  50. package/dist/contracts/modules.d.ts +15 -12
  51. package/dist/contracts/types.d.ts +135 -2
  52. package/dist/{custom-node-writes-TeUvMP13.d.ts → custom-node-writes-CLJKGD9t.d.ts} +7 -2
  53. package/dist/{diagnostic-context-DJ0P1uZE.d.ts → diagnostic-context-BtDUY3v2.d.ts} +1 -1
  54. package/dist/{diagnostic-hints-C9JlLz1L.d.ts → diagnostic-hints-DK8-V0fk.d.ts} +2 -2
  55. package/dist/{document-protection-C8x3P2J6.d.ts → document-protection-NaniLHWF.d.ts} +1 -1
  56. package/dist/{editor-B2ShlO23.d.ts → editor-DZwOTmlR.d.ts} +104 -239
  57. package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
  58. package/dist/{editor-scope-C7ke1KJG.d.ts → editor-scope-B3L-1ALc.d.ts} +1 -1
  59. package/dist/editor.cjs +1 -1
  60. package/dist/editor.css +2 -2
  61. package/dist/editor.d.ts +74 -30
  62. package/dist/editor.js +1 -1
  63. package/dist/export.cjs +2 -2
  64. package/dist/export.d.ts +9 -15
  65. package/dist/export.js +1 -1
  66. package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
  67. package/dist/{font-resolver-CWh40DYp.d.ts → font-resolver-BlQNGdvR.d.ts} +1 -1
  68. package/dist/{headless-document-view-qOpaCF82.d.ts → headless-document-view-Bcz9_Qva.d.ts} +115 -4
  69. package/dist/index.cjs +1 -1
  70. package/dist/index.d.ts +27 -25
  71. package/dist/index.js +1 -1
  72. package/dist/{layout-shaping-CWS3j0Xr.d.ts → layout-shaping-E5J4Z1Gf.d.ts} +1 -1
  73. package/dist/layout.cjs +1 -1
  74. package/dist/layout.d.ts +24 -17
  75. package/dist/layout.js +1 -1
  76. package/dist/{note-properties-QsKh24sM.d.ts → note-properties-Ds5R2_3F.d.ts} +1 -1
  77. package/dist/output.cjs +1 -1
  78. package/dist/output.d.ts +11 -7
  79. package/dist/output.js +1 -1
  80. package/dist/{protocol-COZJUKUY.d.ts → protocol-DKa4qt7F.d.ts} +75 -5
  81. package/dist/{review-paragraph-order-C_QbCKcH.d.ts → review-paragraph-order-Dc17w_6v.d.ts} +1 -1
  82. package/dist/revision-projection-Cn6rZJ7H.d.ts +258 -0
  83. package/dist/{semantic-cell-selection-Cub9FDa8.d.ts → semantic-cell-selection-BaUR0iJ4.d.ts} +2 -2
  84. package/dist/{semantic-interaction-dApRIYpt.d.ts → semantic-interaction-CJoHLoOl.d.ts} +1 -1
  85. package/dist/{semantic-paint-DLzA8sjP.d.ts → semantic-paint-BPw_n0li.d.ts} +7 -4
  86. package/dist/{semantic-record-queries-3yp9o11g.d.ts → semantic-record-queries-C0rJ3sB4.d.ts} +1 -1
  87. package/dist/{semantic-records-B-akgRch.d.ts → semantic-records-BvN-WWst.d.ts} +216 -406
  88. package/dist/store.cjs +1 -1
  89. package/dist/store.d.ts +13 -14
  90. package/dist/store.js +1 -1
  91. package/dist/{types-barrel-CkF2JbU4.d.ts → tree-op-types-C_S2niXW.d.ts} +117 -26
  92. package/dist/{tree-package-store-B8l8DX3Z.d.ts → tree-package-store-CRHvMyNj.d.ts} +2 -2
  93. package/dist/{tree-session-contract-DeLRqohz.d.ts → tree-session-contract-D1awo_dA.d.ts} +5 -5
  94. package/dist/unsupported-elements-CVos5cqe.d.ts +23 -0
  95. package/docs/accept-reject-without-scrolling.md +95 -0
  96. package/docs/comment-on-found-text.md +72 -0
  97. package/docs/custom-review-cards.md +178 -0
  98. package/docs/highlight-ranges.md +48 -0
  99. package/docs/index.md +36 -0
  100. package/docs/propose-rewrite.md +247 -0
  101. package/docs/tracked-replacement.md +68 -0
  102. package/package.json +3 -2
  103. package/dist/chunk-243W4WW2.cjs +0 -2
  104. package/dist/chunk-4S24UOPG.js +0 -30
  105. package/dist/chunk-5SO5QDMV.cjs +0 -2
  106. package/dist/chunk-6IDOVU6L.cjs +0 -1
  107. package/dist/chunk-6JIJOZDW.js +0 -1
  108. package/dist/chunk-BTQKU64Q.cjs +0 -1
  109. package/dist/chunk-DBOOTED4.cjs +0 -30
  110. package/dist/chunk-EOTAXOJY.cjs +0 -5
  111. package/dist/chunk-FDAKJ2SJ.cjs +0 -30
  112. package/dist/chunk-FNNOJNGY.js +0 -3
  113. package/dist/chunk-FT33HRZP.js +0 -5
  114. package/dist/chunk-HC6YNKUI.cjs +0 -1
  115. package/dist/chunk-HZ66UCIS.js +0 -2
  116. package/dist/chunk-IBRBNT37.cjs +0 -1
  117. package/dist/chunk-IVIN7X43.js +0 -30
  118. package/dist/chunk-LZY6B6IV.js +0 -4
  119. package/dist/chunk-N6B3BXCL.js +0 -1
  120. package/dist/chunk-Q5K2GGNG.js +0 -2
  121. package/dist/chunk-R2XINWVE.js +0 -7
  122. package/dist/chunk-SUEXVBPR.js +0 -1
  123. package/dist/chunk-T2QQHG5C.js +0 -18
  124. package/dist/chunk-VWIJKH4A.js +0 -1
  125. package/dist/chunk-WO4V6PNS.cjs +0 -18
  126. package/dist/chunk-XMJKFURD.cjs +0 -4
  127. package/dist/chunk-YQWMI6J5.cjs +0 -7
  128. package/dist/chunk-ZCJS7D7S.js +0 -2
  129. package/dist/omml-equation-BsLAa2lX.d.ts +0 -115
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkIBRBNT37_cjs=require('./chunk-IBRBNT37.cjs'),chunk243W4WW2_cjs=require('./chunk-243W4WW2.cjs'),chunkWO4V6PNS_cjs=require('./chunk-WO4V6PNS.cjs');function z(n){let r=[],s=0;for(let t of n){let o=s+t.text.length;t.resultRuns?r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,resultRuns:t.resultRuns,...t.symbolOffsets?{symbolOffsets:t.symbolOffsets}:{},...t.symbolDisplays?{symbolDisplays:t.symbolDisplays}:{},projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):t.floatingObject?r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,floatingObject:true,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):r.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,...t.symbol?{symbol:true}:{},...t.symbolOffsets?{symbolOffsets:t.symbolOffsets}:{},...t.symbolDisplays?{symbolDisplays:t.symbolDisplays}:{},projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}),s=o;}return r}function G(n,r){return r<=n.rawStart?n.projectedStart:r>=n.rawEnd?n.projectedEnd:n.expansion?n.projectedStart:n.projectedStart+r-n.rawStart}function I(n,r){return n.expansion?n.rawStart:n.rawStart+r-n.projectedStart}function L(n,r){return n.expansion?n.rawEnd:n.rawStart+r-n.projectedStart}var K=new Set([chunkWO4V6PNS_cjs.bb,"\u2011"]),Q=/[\u001e\u001f\u2011]/,Y="\uFFFF";function W(n,r){if(!Q.test(n)&&!r?.size)return {text:n,at:null};let s="",t=[];for(let o=0;o<n.length;o+=1){let l=n[o];if(r?.has(o))s+=Y;else {if(l===chunkWO4V6PNS_cjs.cb)continue;s+=K.has(l)?"-":l;}t.push(o);}return {text:s,at:t}}function U(n){let r;for(let s of n){if(s.symbol){r??=new Set;for(let t=s.projectedStart;t<s.projectedEnd;t+=1)r.add(t);}for(let t of s.symbolOffsets??[])(r??=new Set).add(s.projectedStart+t);}return r}function O(n){let r=z(n),s="";for(let o of n)s+=o.text;let t=null;return {text:s,projectedOffset(o){let l=0;for(let i of r){if(o<=i.rawEnd)return G(i,o);l=i.projectedEnd;}return l},rawRange(o,l){if(o<0||o>=l||l>s.length)return null;let i=r.find(d=>o>=d.projectedStart&&o<d.projectedEnd),e=r.find(d=>l>d.projectedStart&&l<=d.projectedEnd);return !i||!e?null:{start:I(i,o),end:L(e,l)}},sliceRaw(o,l){if(o>=l)return "";let i="";for(let e of r){if(e.expansion){o<=e.rawStart&&l>=e.rawEnd&&(i+=e.text);continue}let d=Math.max(o,e.rawStart),a=Math.min(l,e.rawEnd);d<a&&(i+=e.text.slice(d-e.rawStart,a-e.rawStart));}return i},displaySlice(o,l){let i="";for(let e of r){if(e.projectedEnd<=o||e.projectedStart>=l)continue;let d=Math.max(o,e.projectedStart)-e.projectedStart,a=Math.min(l,e.projectedEnd)-e.projectedStart;if(e.symbol){i+=e.symbolDisplays?.[0]??"";continue}let u=new Map;e.symbolOffsets?.forEach((f,c)=>u.set(f,e.symbolDisplays?.[c]??""));for(let f=d;f<a;f+=1)i+=u.get(f)??e.text[f];}return i},resultRunAddressAt(o){let l=r.find(e=>e.resultRuns!==void 0&&o>=e.projectedStart&&o<e.projectedEnd);if(!l?.resultRuns)return null;let i=o-l.projectedStart;for(let e of l.resultRuns)if(i>=e.start&&i<e.end)return {runId:e.runId,offset:i-e.start};return null},findOccurrences(o,l,i={}){let e=[];if(l<=0||!chunk243W4WW2_cjs.sa(o)||s.length===0)return {matches:e,truncated:false};let d=i.matchCase===true,a=i.wholeWord===true;t??=W(s,U(r));let u=t,f=W(o).text;if(f.length===0||f.includes(Y))return {matches:e,truncated:false};let c=d?f:chunk243W4WW2_cjs.qa(f),j=d?u.text:chunk243W4WW2_cjs.qa(u.text),R=p=>u.at?.[p]??p,X=p=>{if(!u.at)return p;let m=0;for(;m<u.at.length&&u.at[m]<p;)m+=1;return m},v=Math.min(s.length,i.to??s.length),D=new Set,b=j.indexOf(c,X(Math.max(0,i.from??0)));for(;b>=0;){let p=b+c.length,m=R(b),x=R(p-1)+1;if(x>v)return {matches:e,truncated:false};if(r.some(y=>y.floatingObject===true&&y.projectedStart>m&&y.projectedStart<x)){b=j.indexOf(c,b+1);continue}if(!a||chunk243W4WW2_cjs.ra(u.text,b,p)){let y=r.find(h=>m>=h.projectedStart&&m<h.projectedEnd),E=r.find(h=>x>h.projectedStart&&x<=h.projectedEnd);if(!y||!E)return {matches:e,truncated:false};let S=y===E&&y.expansion?y:null;if(!S||!D.has(S)){if(e.length>=l)return {matches:e,truncated:true};e.push({start:m,length:x-m,rawStart:I(y,m),rawEnd:L(E,x)}),S&&D.add(S);}}b=j.indexOf(c,p);}return {matches:e,truncated:false}}}}function q(n){return n.length===0?O([]):O([{text:n,rawStart:0,rawEnd:n.length}])}var J="http://schemas.openxmlformats.org/markup-compatibility/2006";function Z(n){if(n.kind==="textValue")return false;if(chunkWO4V6PNS_cjs.qd(n))return chunkWO4V6PNS_cjs.rd(n);let r=s=>s.kind!=="textValue"&&s.children.some(t=>t.kind==="anchoredDrawing"||t.kind!=="textValue"&&t.localName==="anchor");if(n.kind==="drawing")return r(n);if(n.namespaceUri!==J||n.localName!=="AlternateContent")return false;for(let s of n.children){if(s.kind==="textValue"||s.localName!=="Choice")continue;let t=s.children.find(o=>o.kind==="drawing"||o.kind!=="textValue"&&o.localName==="drawing");if(t)return r(t)}return false}function $(n,r,s="allMarkup"){if(!r.includes(chunkWO4V6PNS_cjs.qf)&&!r.includes(chunkWO4V6PNS_cjs.db))return r.length===0?[]:[{text:r,rawStart:0,rawEnd:r.length}];let t=chunkWO4V6PNS_cjs.Lf(n),o=chunkWO4V6PNS_cjs.lg(n,t),l=chunkIBRBNT37_cjs.d(n,t,s),i=new Map;for(let a of t)i.set(a.node.id,a);let e=[],d=0;for(let a of o){let u=i.get(a.node.id),f=!u&&chunkWO4V6PNS_cjs.eb(a.node);if(!u&&!f){Z(a.node)&&(d<a.start&&e.push({text:r.slice(d,a.start),rawStart:d,rawEnd:a.start}),e.push({text:"",rawStart:a.start,rawEnd:a.end,floatingObject:true}),d=a.end);continue}if(d<a.start&&e.push({text:r.slice(d,a.start),rawStart:d,rawEnd:a.start}),!u){e.push({text:chunkWO4V6PNS_cjs.db,rawStart:a.start,rawEnd:a.end,symbol:true,symbolDisplays:[chunkWO4V6PNS_cjs.ck(a.node)]}),d=a.end;continue}let c=l.get(u.node.id);u.kind==="simple"&&c?e.push({text:c.text,rawStart:a.start,rawEnd:a.end,resultRuns:c.runs,...c.symbols?{symbolOffsets:c.symbols}:{},...c.symbolDisplays?{symbolDisplays:c.symbolDisplays}:{}}):e.push({text:c?.text??chunkWO4V6PNS_cjs.qf,rawStart:a.start,rawEnd:a.end,...c?.symbols?{symbolOffsets:c.symbols}:{},...c?.symbolDisplays?{symbolDisplays:c.symbolDisplays}:{}}),d=a.end;}return d<r.length&&e.push({text:r.slice(d),rawStart:d,rawEnd:r.length}),e}function it(n,r,s="allMarkup"){return !r.includes(chunkWO4V6PNS_cjs.qf)&&!r.includes(chunkWO4V6PNS_cjs.db)?q(r):O($(n,r,s))}
2
- exports.a=O;exports.b=q;exports.c=$;exports.d=it;
@@ -1 +0,0 @@
1
- 'use strict';var chunkWO4V6PNS_cjs=require('./chunk-WO4V6PNS.cjs');var W=new Set(["document","hdr","ftr","footnotes","endnotes"]),$=24,J=512,U=chunkWO4V6PNS_cjs.ub($);function V(r){let n=r.root;return n.namespaceUri===chunkWO4V6PNS_cjs.la&&W.has(n.localName)}function Y(r){let n=[],e=t=>{if(t.kind!=="textValue"){t.namespaceUri===chunkWO4V6PNS_cjs.la&&t.localName==="p"&&n.push(t);for(let a of t.children)e(a);}};return e(r.root),n}function H(r){let n=chunkWO4V6PNS_cjs.Eb(r);let e=[],t=new Set;for(let a of Y(n)){let i=chunkWO4V6PNS_cjs.wb(a);if(!i||!chunkWO4V6PNS_cjs.vb(i))continue;let o=i.toUpperCase();if(t.has(o))continue;t.add(o);let s=chunkWO4V6PNS_cjs.hj(n,a.id);s!==null&&e.push(Object.freeze({paragraphId:o,nodeId:a.id,text:s}));}return Object.freeze(e)}function q(r){let n=U.get(r.root);if(n)return n;let e=chunkWO4V6PNS_cjs.Eb(r);let t=new Map,a=new Set,i=o=>{if(o.kind!=="textValue"){if(o.namespaceUri===chunkWO4V6PNS_cjs.la&&o.localName==="p"){let s=chunkWO4V6PNS_cjs.wb(o);if(s&&chunkWO4V6PNS_cjs.vb(s)){let p=s.toUpperCase();a.has(p)||(a.add(p),o.kind==="paragraph"&&t.set(p,o.id));}}for(let s of o.children)i(s);}};return i(e.root),U.set(r.root,t),t}function _(r,n){if(r.length!==n.length)return false;for(let e=0;e<r.length;e+=1)if(r[e].root!==n[e])return false;return true}function B(r){let n=new Map,e=null,t=(i,o,s)=>{for(n.delete(i),n.set(i,{partName:o.name,root:o.root,nodeId:s});n.size>J;){let p=n.keys().next();if(p.done)break;n.delete(p.value);}},a=(i,o)=>{let s=n.get(i);if(!s)return null;let p=o.find(d=>d.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkWO4V6PNS_cjs.Ta(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let c=chunkWO4V6PNS_cjs.wb(l);return !c||c.toUpperCase()!==i?null:(t(i,p,s.nodeId),{part:p,nodeId:s.nodeId})};return i=>{let o=r(),s=a(i,o);if(s)return s;if(e&&e.ids.has(i)&&_(o,e.roots))return null;for(let p of o){let l=q(p).get(i);if(l!==void 0)return t(i,p,l),{part:p,nodeId:l}}return (!e||!_(o,e.roots))&&(e={roots:o.map(p=>p.root),ids:new Set}),e.ids.size<J&&e.ids.add(i),null}}function L(r,n){return chunkWO4V6PNS_cjs.Ma(r,n)}var F=Object.freeze({kind:"body"}),Q=1e6;function O(r,n){if(n<=0||n>=r.length)return false;let e=r.charCodeAt(n-1),t=r.charCodeAt(n);return e>=55296&&e<=56319&&t>=56320&&t<=57343}function K(r,n,e){if(n===e)return [];let t=0,a=Math.min(n.length,e.length);for(;t<a&&n.charCodeAt(t)===e.charCodeAt(t);)t+=1;for(;t>0&&(O(n,t)||O(e,t));)t-=1;let i=0;for(;i<n.length-t&&i<e.length-t&&n.charCodeAt(n.length-i-1)===e.charCodeAt(e.length-i-1);)i+=1;for(;i>0&&(O(n,n.length-i)||O(e,e.length-i));)i-=1;let o=n.length-t-i,s=e.slice(t,e.length-i),p=[];return o>0&&p.push({op:"deleteText",paragraphId:r,start:t,end:t+o}),s.length>0&&p.push({op:"insertText",paragraphId:r,offset:t,text:s}),Object.freeze(p)}function tt(r){let n=t=>!!t&&t.kind!=="textValue"&&t.namespaceUri===chunkWO4V6PNS_cjs.la&&t.localName==="t"&&t.attributes.every(a=>a.namespaceUri===chunkWO4V6PNS_cjs.ma&&a.localName==="space")&&t.children.every(a=>a.kind==="textValue"),e=[];for(let t of r){let a=e.at(-1);if(!n(a)||!n(t)){e.push(t);continue}let i=a.children.map(o=>o.kind==="textValue"?o.value:"").join("")+t.children.map(o=>o.kind==="textValue"?o.value:"").join("");e[e.length-1]={...a,attributes:/^\s|\s$/.test(i)?[{kind:"xmlSpace",namespaceUri:chunkWO4V6PNS_cjs.ma,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:a.children[0]?.id??`${a.id}/text`,kind:"textValue",value:i}]};}return e}function G(r){if(r.kind==="textValue")return r;let n=false,e=r.children.map(t=>{let a=G(t);return a!==t&&(n=true),a});if(r.namespaceUri===chunkWO4V6PNS_cjs.la&&r.localName==="r"){let t=tt(e);(t.length!==e.length||t.some((a,i)=>a!==e[i]))&&(e=[...t],n=true);}return n?{...r,children:e}:r}function et(r,n,e){let t=r.parts.get(n);if(!t)return r;let a=false,i=new Set;for(let o of e)(o.op==="insertText"||o.op==="deleteText")&&!o.revision&&i.add(o.paragraphId);for(let o of i){let s=chunkWO4V6PNS_cjs.Ta(t,o);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunkWO4V6PNS_cjs.Za(t,o,p,{deferValidation:true});l.ok&&(t=l.part,a=true);}return a?chunkWO4V6PNS_cjs.Ie(r,t):r}function rt(r,n){let e=n.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let t=()=>H(r.bodyStore().part),a,i=()=>{let l=r.bodyStore().part,c=r.currentPackage();if(a?.pkg===c&&a.body===l)return a.parts;let d=[l];for(let g of c.parts.values())g===l||!V(g)||d.push(g);return a={pkg:c,body:l,parts:Object.freeze(d)},a.parts},o=B(i),s=(l,c)=>{if(l.length===0)return {ok:true,changed:false};let d=t(),g=new Set,P=[];for(let u of l){if(typeof u.text!="string"||u.text.length>Q)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=d.filter(X=>X.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let M=N[0];P.push(...K(M.nodeId,M.text,u.text));}if(P.length===0)return {ok:true,changed:false};let x=r.transact(F,u=>{for(let m of P)u.apply(m);u.applyPackage(m=>et(m,m.mainDocumentPart,P));},{origin:c.origin,actorId:c.actorId,operationId:c.operationId,recordsHistory:false});return x.ok?{ok:true,changed:x.change!==null}:{ok:false,reason:x.detail??x.reason}};return Object.freeze({documentId:e,paragraphs:t,paragraphByNodeId(l){return t().find(c=>c.nodeId===l)??null},paragraphTextOf(l){for(let c of i()){let d=chunkWO4V6PNS_cjs.hj(c,l);if(d!==null)return d}return null},paragraphByStableId(l){let c=l.toUpperCase(),d=o(c);if(!d)return null;let g=chunkWO4V6PNS_cjs.hj(d.part,d.nodeId);return g===null?null:Object.freeze({paragraphId:c,nodeId:d.nodeId,text:g})},applyParagraphText(l,c,d){return s([{paragraphId:l,text:c}],d)},applyParagraphTexts:s,applyRemotePackage(l,c){let d=r.publishRemotePackage(l,c);return d.ok?{ok:true,changed:d.change!==null}:{ok:false,reason:d.detail??d.reason}},revision:()=>r.packageRevision,subscribe:l=>r.subscribe(l),observePrimitiveJournal:l=>L(r,l),hasPendingJournals:()=>chunkWO4V6PNS_cjs.Ka(r),flushPendingJournals:()=>{chunkWO4V6PNS_cjs.La(r);},save:()=>chunkWO4V6PNS_cjs.Ge(r.currentPackage()),binaryPart(l){let c=r.currentPackage();return c.partBytes.get(l)??c.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}function nt(r,n,e){if(n===e||r>n.length)return Math.min(r,e.length);let t=0;for(;t<n.length&&t<e.length&&n[t]===e[t];)t+=1;let a=0;for(;a<n.length-t&&a<e.length-t&&n[n.length-1-a]===e[e.length-1-a];)a+=1;if(r<=t)return Math.min(r,e.length);if(r>n.length-a)return Math.min(e.length,r+e.length-n.length);let i=at(n,e,t,a),o=i.offsets.get(r);return o===void 0&&(o=(i.table?st(i.table,r,n,e,t):null)??ct(r,n,e,t,a)??t,i.offsets.set(r,o)),o}var f=[],ot=16;function at(r,n,e,t){let a=f.findIndex(o=>o.before===r&&o.after===n);if(a>=0){let[o]=f.splice(a,1);return f.push(o),o}let i={before:r,after:n,table:lt(r,n,e,t),offsets:new Map};return f.length>=ot&&f.shift(),f.push(i),i}var it=1<<18;function lt(r,n,e,t){let a=r.length-t-e,i=n.length-t-e;if(a*i>it)return null;let o=i+1,s=new Uint32Array((a+1)*o);for(let p=a-1;p>=0;p-=1)for(let l=i-1;l>=0;l-=1)s[p*o+l]=r[e+p]===n[e+l]?s[(p+1)*o+l+1]+1:Math.max(s[(p+1)*o+l],s[p*o+l+1]);return {lengths:s,width:o,columns:i}}function st(r,n,e,t,a){let{lengths:i,width:o,columns:s}=r,p=n-a,l=0,c=0;for(;l<p;)c<s&&e[a+l]===t[a+c]?(l+=1,c+=1):c>=s||i[(l+1)*o+c]>=i[l*o+c+1]?l+=1:c+=1;return a+c}var pt=[32,16,8,4];function ct(r,n,e,t,a){let i=e.slice(t,e.length-a),o=s=>{let p=i.indexOf(s);return p>=0&&i.indexOf(s,p+1)<0?p:null};for(let s of pt){let p=n.slice(Math.max(t,r-s),r);if(p.length===s){let c=o(p);if(c!==null)return t+c+p.length}let l=n.slice(r,Math.min(n.length-a,r+s));if(l.length===s){let c=o(l);if(c!==null)return t+c}}return null}exports.a=et;exports.b=rt;exports.c=nt;
@@ -1 +0,0 @@
1
- var e=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,t=/^var\(--doc-review-author-[0-9]{1,2}\)$/;function r(n){if(n!==void 0&&!(n.length>64)&&(e.test(n)||t.test(n)))return n}export{r as a};
@@ -1 +0,0 @@
1
- 'use strict';var e=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,t=/^var\(--doc-review-author-[0-9]{1,2}\)$/;function r(n){if(n!==void 0&&!(n.length>64)&&(e.test(n)||t.test(n)))return n}exports.a=r;