@docx-editor.dev/core 2.26.0 → 2.27.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.
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +14 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-2GK7YQB2.cjs +2 -0
- package/dist/chunk-4KZ6L5YF.cjs +15 -0
- package/dist/chunk-55AT3MOU.cjs +25 -0
- package/dist/chunk-6ZQMII6V.js +1 -0
- package/dist/chunk-7IGCWG4H.js +2 -0
- package/dist/chunk-7MYITTAH.js +5 -0
- package/dist/chunk-AVKVRU7Z.cjs +5 -0
- package/dist/{chunk-7RJSH72J.cjs → chunk-CWRBFNK5.cjs} +5 -5
- package/dist/chunk-DGPA3TST.cjs +27 -0
- package/dist/{chunk-6SEIXJTX.js → chunk-DNXVNQEO.js} +1 -1
- package/dist/chunk-FQN4KSFL.cjs +7 -0
- package/dist/{chunk-ELQFXMJ5.cjs → chunk-GVUOWHTO.cjs} +1 -1
- package/dist/chunk-GWQJ5774.js +5 -0
- package/dist/{chunk-5BIASAN3.js → chunk-HAQ72KD7.js} +1 -1
- package/dist/{chunk-TKR2MXX4.cjs → chunk-HO5XFO32.cjs} +1 -1
- package/dist/{chunk-LWCI65EL.js → chunk-IGR23DV2.js} +1 -1
- package/dist/{chunk-EEAV3WIN.js → chunk-JSIX2EOH.js} +1 -1
- package/dist/{chunk-CYT3OQFZ.cjs → chunk-K246T47S.cjs} +1 -1
- package/dist/chunk-KAXOGCGA.js +1 -0
- package/dist/{chunk-AGKIHLWQ.cjs → chunk-LZLTN5A3.cjs} +1 -1
- package/dist/chunk-NBCVVZOM.cjs +1 -0
- package/dist/{chunk-AJCCS53D.js → chunk-O5INAWZQ.js} +1 -1
- package/dist/{chunk-LZDI4P6I.cjs → chunk-OHAXVTWG.cjs} +1 -1
- package/dist/chunk-S74GRBNE.js +7 -0
- package/dist/chunk-UBLUVNZR.js +27 -0
- package/dist/chunk-UMRSBLO7.js +15 -0
- package/dist/chunk-VIPMGGUT.js +25 -0
- package/dist/chunk-WG4KMSX2.cjs +2 -0
- package/dist/chunk-WRLKVNNR.cjs +1 -0
- package/dist/chunk-ZU7IVN6G.js +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +14 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +20 -31
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-Cy9imOjA.d.ts → custom-node-writes-Vzpq9I8_.d.ts} +2 -2
- package/dist/{document-protection-Bp19Ad4I.d.ts → document-protection-9zpIHWTE.d.ts} +1 -1
- package/dist/{editor-DYUlyKmb.d.ts → editor-B3OBYNrF.d.ts} +29 -34
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +2 -2
- package/dist/editor.d.ts +28 -27
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +26 -14
- package/dist/export.js +1 -1
- package/dist/{font-resolver-u_nE0PI1.d.ts → font-resolver-DN0xNOf_.d.ts} +1 -1
- package/dist/{headless-document-view-R9bzzepb.d.ts → headless-document-view-ICYqNkQ1.d.ts} +2 -2
- package/dist/{image-resources-DfagDguq.d.ts → image-resources-BDFxcu7W.d.ts} +1 -1
- package/dist/{index-Docw8Dcb.d.ts → index-CkQVRJtJ.d.ts} +53 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DWitwY73.d.ts → layout-shaping-BvZD_VKP.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +32 -196
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CmfvOJsi.d.ts → note-properties-CkAk7g-n.d.ts} +1 -1
- package/dist/{omml-equation-CZ6IG2ja.d.ts → omml-equation-DuczgG5o.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +8 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-DniKeDb8.d.ts → protocol-aKYr8r3u.d.ts} +6 -5
- package/dist/{review-paragraph-order-Dc8Q6tfM.d.ts → review-paragraph-order-Ddj5d6rp.d.ts} +1 -1
- package/dist/{revision-projection-DfWxdBqA.d.ts → revision-projection-CSNFudZY.d.ts} +74 -3
- package/dist/{semantic-cell-selection-Dy_BmmpL.d.ts → semantic-cell-selection-DoqYCz_F.d.ts} +4 -4
- package/dist/{semantic-interaction-CvFAj0GR.d.ts → semantic-interaction-G0bjmmmk.d.ts} +1 -1
- package/dist/{semantic-paint-Bk9wIXdZ.d.ts → semantic-paint-CsMzF8-O.d.ts} +57 -5
- package/dist/semantic-record-queries-1du6lQqS.d.ts +177 -0
- package/dist/{semantic-records-COqi8pjP.d.ts → semantic-records-B9OolWGN.d.ts} +15 -5
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +22 -17
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-YPyYC1aD.d.ts → tree-package-fragment-DYZIk1rY.d.ts} +3 -3
- package/dist/{tree-session-contract-AeY2v0x9.d.ts → tree-session-contract-DQVJOOkv.d.ts} +5 -5
- package/dist/{types-barrel-BO73JqHG.d.ts → types-barrel-BFKR8Pzp.d.ts} +134 -110
- package/package.json +3 -3
- package/dist/chunk-2BK4G4ZN.js +0 -2
- package/dist/chunk-2SJX44PC.cjs +0 -2
- package/dist/chunk-73PG6L2X.js +0 -1
- package/dist/chunk-AN6WM4X4.js +0 -2
- package/dist/chunk-ANZ44KQT.cjs +0 -12
- package/dist/chunk-DDGGSBAN.js +0 -12
- package/dist/chunk-EYK4K2J6.js +0 -1
- package/dist/chunk-JNTETUNZ.cjs +0 -1
- package/dist/chunk-L6V3IJ3S.js +0 -5
- package/dist/chunk-NS22DVWT.cjs +0 -2
- package/dist/chunk-QIE3YTU4.cjs +0 -2
- package/dist/chunk-QVBFPAGO.js +0 -5
- package/dist/chunk-RCCOLZEQ.js +0 -2
- package/dist/chunk-SUN62YU6.cjs +0 -5
- package/dist/chunk-TKQH7BNE.cjs +0 -1
- package/dist/chunk-UJL2GDIM.cjs +0 -25
- package/dist/chunk-WQTADNHK.cjs +0 -27
- package/dist/chunk-XSHXBJ2J.js +0 -25
- package/dist/chunk-YXZEBTDF.js +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
`:n.kind==="pageBreak"?e+=
|
|
3
|
-
`?(O(),a.push({op:"insertHardBreak",paragraphId:t,offset:u}),u+=1):P===
|
|
4
|
-
`)}var zo=64,Bn=new WeakMap;function Ke(t,e=0){if(e>zo)return false;let n=Bn.get(t);if(n!==void 0)return n;let o=false;for(let s of t.children)if(s.kind!=="textValue"&&(s.kind==="commentRangeStart"||s.kind==="commentReference"||Ke(s,e+1))){o=true;break}return Bn.set(t,o),o}function Wo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function _n(t,e,n){for(let s of e)if(s.ranges.length===0)return false;let o=new Set;for(let s of t)s.kind!=="revision"||s.ranges.length>0||Hn(s,n)||o.add(chunkSUN62YU6_cjs.ta(s));for(let s of e)if(o.has(chunkSUN62YU6_cjs.ta(s)))return false;return true}function jn(t,e,n,o){let s=e.get(n);if(s===void 0)return [...t];let a=[],r=null;for(let c of t){if(c.kind==="revision"&&Hn(c,n)){r===null&&(r=a.length);continue}if(r===null){let d=Wo(c,e);d!==null&&d>s&&(r=a.length);}a.push(c);}if(r===null&&(r=a.length),o.length>0){let c=o.length<2?[...o]:[...o].sort((d,m)=>chunkSUN62YU6_cjs.wa(d,e)-chunkSUN62YU6_cjs.wa(m,e));a.splice(r,0,...c);}return chunkSUN62YU6_cjs.Qa(a)}function Hn(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Uo(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function Yo(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function Jo(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function $n(t,e,n,o,s,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==s||e.commentsExtendedPart!==a)return null;let c=t.dirty[0],d=chunkANZ44KQT_cjs.Ka(o,c);if(!d||d.kind!=="paragraph")return null;let m=chunkANZ44KQT_cjs.La(o,c);if(m){let p=m.children.findIndex(g=>g.id===c),x=m.children[p-1];if(x?.kind==="paragraph"&&chunkANZ44KQT_cjs.$i({...o,root:x}).some(g=>g.paragraphMark))return null}for(let p of n){if(p.kind==="comment"){if(Uo(p,c))return null;continue}if(p.kind==="custom"){if(p.range?.start.paragraphId===c)return null;continue}if(Yo(p,c)||Jo(p,c))return null}return c}var Un=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Go=["ascii","hAnsi","cs","eastAsia"],Ko=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Xo=128,Qo=/[\u0000-\u001F\u007F-\u009F]/;function F(t){return t.kind!=="textValue"}function Q(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Yn(t,e){let n=new Map;for(let s of t)for(let a of s.children)if(F(a))for(let[r,c]of Kn(a,e))n.has(r)||n.set(r,c);let o=[...n.values()];return o.sort((s,a)=>s<a?-1:s>a?1:0),o}var Xe=new WeakMap,Jn=16,Gn=32;function Kn(t,e,n=0){let o=e?.major??null,s=e?.minor??null,a=e?.majorEastAsia??null,r=e?.minorEastAsia??null,c=e?.majorBidi??null,d=e?.minorBidi??null,m=Xe.get(t);if(m&&m.major===o&&m.minor===s&&m.majorEastAsia===a&&m.minorEastAsia===r&&m.majorBidi===c&&m.minorBidi===d)return m.byFold;if(t.children.length>=Jn&&n<Gn&&t.localName!=="rFonts"){let u=new Map;for(let h of t.children)if(F(h))for(let[O,P]of Kn(h,e,n+1))u.has(O)||u.set(O,P);return Xe.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:c,minorBidi:d,byFold:u}),u}let p=new Map,x=u=>{if(!u||!Un.test(u))return;let h=u.toLowerCase();p.has(h)||p.set(h,u);},g=[t];for(;g.length>0;){let u=g.pop();if(F(u)){if(u.localName==="rFonts"){for(let h of Go)x(Q(u,h));if(e)for(let h of Ko)x(chunkSUN62YU6_cjs._a(Q(u,h),e));}for(let h=u.children.length-1;h>=0;h-=1)g.push(u.children[h]);}}return Xe.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:c,minorBidi:d,byFold:p}),p}function Xn(t){let e=new Map;for(let o of t)for(let s of o.children)if(F(s))for(let[a,r]of Qn(s))e.has(a)||e.set(a,r);let n=[...e.values()];return n.sort((o,s)=>o<s?-1:o>s?1:0),n}var zn=new WeakMap,Vo=new Map;function Qn(t,e=0){let n=zn.get(t);if(n)return n;let o=r=>{let c=r.size===0?Vo:r;return zn.set(t,c),c},s=new Map;if(t.children.length>=Jn&&e<Gn&&t.localName!=="sym"){for(let r of t.children)if(F(r))for(let[c,d]of Qn(r,e+1))s.has(c)||s.set(c,d);return o(s)}let a=[t];for(;a.length>0;){let r=a.pop();if(F(r)){if(r.localName==="sym"&&r.namespaceUri===chunkANZ44KQT_cjs.fa){let c=r.attributes.find(m=>m.localName==="font"&&(m.namespaceUri===chunkANZ44KQT_cjs.fa||m.namespaceUri===""))?.value,d=chunkAGKIHLWQ_cjs.b(c);d!==null&&!s.has(d.toLowerCase())&&s.set(d.toLowerCase(),d);}for(let c=r.children.length-1;c>=0;c-=1)a.push(r.children[c]);}}return o(s)}function Vn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(F(n)){if(n.localName==="t"&&n.namespaceUri===chunkANZ44KQT_cjs.fa){for(let o of n.children)if(!F(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var qo=new Set(["paragraph","character","table","numbering"]),Zo=/^[0-9A-Fa-f]{6}$/,er=16,Wn=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function qn(t){return t.children}function Qe(t,e){for(let n of qn(t))if(F(n)&&n.localName===e)return n}function tr(t){return Wn.get(t.name.toLowerCase())??Wn.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Ve(t){return t===void 0||t.length===0||t.length>Xo||Qo.test(t)?null:t}function Zn(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!F(a)||a.localName!=="style")continue;let r=Ve(Q(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,c=false,d=null,m=false,p=false,x=new Set,g=a;for(let O=0;O<er&&g!==null&&!x.has(g);O+=1){x.add(g);let P=n.get(g);if(!P)break;let R=Qe(P,"rPr");for(let v of R?qn(R):[]){if(!F(v))continue;let N=Q(v,"val"),D=N!=="0"&&N!=="false"&&N!=="off";v.localName==="b"&&!m?(r=D,m=true):v.localName==="i"&&!p?(c=D,p=true):v.localName==="color"&&d===null&&N&&Zo.test(N)&&(d=N);}let b=Qe(P,"basedOn");g=b?Ve(Q(b,"val")):null;}let u=e?.(a),h=u?.fontFamily??null;return {fontFamily:h!==null&&Un.test(h)?h:null,fontSizePt:u?.fontSizeHalfPoints!=null&&u.fontSizeHalfPoints>0?u.fontSizeHalfPoints/2:null,bold:r,italic:c,color:d}},s=[];for(let[a,r]of n){let c=Q(r,"type");if(c===void 0||!qo.has(c))continue;let d=Qe(r,"name"),m=Ve(d?Q(d,"val"):void 0);s.push({styleId:a,name:m??a,type:c,preview:o(a)});}return s.map((a,r)=>({entry:a,index:r,rank:tr(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var nr=128,or=/[\u0000-\u001F\u007F-\u009F]/,rr=/[\u0000-\u001F\u007F-\u009F]/g,ar=200;function Ze(t){return t.kind!=="textValue"}function eo(t,e){for(let n of t.children)if(Ze(n)&&n.localName===e)return n}function qe(t,e){return t.attributes.find(n=>n.localName===e)?.value}function sr(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!Ze(n)||n.localName!=="style"||qe(n,"type")!=="paragraph")continue;let o=qe(n,"styleId");if(o===void 0||o.length===0||o.length>nr||or.test(o))continue;let s=chunkCYT3OQFZ_cjs.d(n);s!==null&&e.set(o,s);}return e}function et(t){let e=eo(t,"pPr"),n=e?eo(e,"pStyle"):void 0;return n?qe(n,"val"):void 0}function to(t,e){let n=sr(e);if(n.size===0)return [];let o=[];for(let s of oe(t)){if(!Ze(s))continue;let a=et(s);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let c=chunkANZ44KQT_cjs.Zj(t,s.id)??"",d=s.kind==="paragraph"?chunkANZ44KQT_cjs.gj(s,c):c,m=chunkANZ44KQT_cjs.bb(d).replace(rr," ").trim().slice(0,ar);m.length!==0&&o.push({text:m,level:r,blockId:s.id});}return o}function ir(t,e,n){let o=new Map,s=n(t);for(let a of s){let r=o.get(a.hostParagraphId);r?r.push(a):o.set(a.hostParagraphId,[a]);}return o}function lr(t,e,n){let o=[];for(let s of chunkANZ44KQT_cjs.Cc(t.root)){let a=e.get(s.id);if(a)for(let r of a)o.push(r);}return o}function no(t,e,n=chunkANZ44KQT_cjs.Sh){let o=[],s=new Map;for(let a of t){if(o.push(a),a.scope?.kind==="note")continue;let r=s.get(a.part);r||(r=ir(a.part,e,n),s.set(a.part,r));for(let c of lr(a,r)){let d=a.scope;o.push({part:a.part,root:c.root,scope:{kind:"frame",id:c.root.id,drawingNodeId:c.drawingNodeId,hostParagraphId:c.hostParagraphId,...d?.kind==="headerFooter"?{owner:d}:{}}});}}return o}var Ie=48,cr=/[\u0000-\u001F\u007F-\u009F]/g;function dr(t){let e=[],n=chunkANZ44KQT_cjs.Of(t),o=new Map;for(let s of n.segments)chunkANZ44KQT_cjs.$e(s.node)&&o.set(s.node.id,s.formatRunIds??[]);return chunkANZ44KQT_cjs.Mc(t.children,0,s=>{if(s.kind==="run"){e.push({id:s.id,start:n.spanOf(s)?.start??0});return}if(chunkANZ44KQT_cjs.$e(s))for(let a of o.get(s.id)??[]){let r=n.spanOf(a);r&&e.push({id:a,start:r.start});}},{descendRevisions:true}),e}function ur(t){let e=chunkANZ44KQT_cjs.Bc(t);return e?[{part:t,root:e}]:[]}function pr(t,e){let n=[];for(let o of ["header","footer"])for(let s of t){let a=o==="header"?s.headers:s.footers;for(let[r,c]of a){if(!chunkANZ44KQT_cjs.Le(s,r)||e.has(c.part))continue;e.add(c.part);let d=chunkANZ44KQT_cjs.zc(c.part).find(m=>m.kind===o);d&&n.push({part:c.part,root:d.root,scope:{kind:"headerFooter",rId:c.rId}});}}return n}function oo(t,e,n){if(!t)return [];let o=[];for(let s of chunkANZ44KQT_cjs.vc(t.root)){let a=chunkANZ44KQT_cjs.jc(s);!chunkANZ44KQT_cjs.lc(s)||a===null||!n.has(a)||o.push({part:t,root:s,scope:{kind:"note",id:chunkANZ44KQT_cjs.$b(e,a)}});}return o}function fr(t,e){let n=ur(t);if(e){let o=new Set;for(let s of pr(e.headerFooterBySection,o))n.push(s);for(let s of oo(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(s);for(let s of oo(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(s);}return no(n)}function ro(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function mr(t,e,n){let o=t.findIndex(s=>s.id===e);return o<0?null:{index:o,offset:n}}function tt(t,e){return chunkANZ44KQT_cjs.bb(t).replace(cr," ").slice(0,e)}var gr=1e3;function ao(t,e,n={},o){let s=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,a={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},r=e.slice(0,gr),c=r.map(()=>({matches:[],truncated:false})),d=r.map((p,x)=>chunkSUN62YU6_cjs.Va(p)?x:-1);if(d=d.filter(p=>p>=0),d.length===0)return c;let m=n.stories==="body"?void 0:o;for(let p of fr(t,m)){let x=0;for(let g of chunkANZ44KQT_cjs.Cc(p.root)){if(g.kind!=="paragraph")continue;let u=x;x+=1;let h=chunkANZ44KQT_cjs.Zj(p.part,g.id)??"",O=chunkQIE3YTU4_cjs.d(g,h);if(O.text.length===0)continue;let P=null,R=false;for(let b of d){let v=c[b],N=s-v.matches.length,D=O.findOccurrences(r[b],Math.max(N,1),a);if(N===0&&D.matches.length>0){v.truncated=true,R=true;continue}for(let T of D.matches){let C=T.start+T.length;P??=dr(g);let M=O.resultRunAddressAt(T.start),V=M?mr(P,M.runId,M.offset)??ro(P,T.rawStart):ro(P,T.rawStart);v.matches.push({blockId:g.id,start:T.rawStart,length:T.rawEnd-T.rawStart,paragraphIndex:u,runIndex:V.index,runOffset:V.offset,...p.scope?{scope:p.scope}:{},text:tt(O.displaySlice(T.start,C),256),contextBefore:tt(O.displaySlice(Math.max(0,T.start-Ie),T.start),Ie),contextAfter:tt(O.displaySlice(C,C+Ie),Ie)});}D.truncated&&(v.truncated=true,R=true);}if(R&&(d=d.filter(b=>!c[b].truncated)),d.length===0)return c}}return c}var yr=32;function so(t){let e=null;return((n,o)=>{let s=t.revision(),a=typeof n!="string",r=`${o?.matchCase===true?"c":""}${o?.wholeWord===true?"w":""}`,c=`${o?.limit??""}:${o?.stories??"all"}`,d=JSON.stringify([r,c,n]);e?.revision!==s&&(e={revision:s,results:new Map});let m=e.results.get(d);if(m)return m;let p=t.bodyPart(),x=t.currentPackage(),g={footnote:new Set,endnote:new Set};for(let O of chunkANZ44KQT_cjs.Jg(p))g[O.noteKind].add(O.noteId);let u=ao(p,a?n:[n],o,{headerFooterBySection:t.headerFooterBySection(),footnotes:chunkANZ44KQT_cjs.Ig(x,"footnote")??null,endnotes:chunkANZ44KQT_cjs.Ig(x,"endnote")??null,referencedNoteIds:g}),h=a?u:u[0];return e.results.size>=yr&&e.results.delete(e.results.keys().next().value),e.results.set(d,h),h})}var hr=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function re(t,e=null){return chunkSUN62YU6_cjs.Za(t,e)}function io(t){let e=chunkANZ44KQT_cjs.ld(t),n=[];for(let o of hr){let s=e.get(o);if(!s)return [];n.push({slot:o,hex:s});}return n}var lo=new WeakMap;function ot(t){let e=lo.get(t);if(e!==void 0)return e;let n=chunkANZ44KQT_cjs.ib(t),o=n===null||!chunkANZ44KQT_cjs.hb(n)?null:n;return lo.set(t,o),o}var nt=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,s]of this.entries())e.call(n,s,o,this);}};function co(t,e){return Object.freeze({...t,partByNode:new nt(t.ordinalByNode,e)})}function uo(t){let e=new Map,n=new Map,o=new Map,s=new Set,a=new Map,r=new Map,c=0;for(let d of t)for(let m of _(d)){o.set(m.id,c),a.set(m.id,d),c+=1;let p=ot(m);if(p===null)continue;e.set(m.id,p);let x=p.toUpperCase(),g=r.get(x);g?(g.push(m.id),s.add(x)):(r.set(x,[m.id]),n.set(x,m.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:s,partByNode:a,claimantsByParaId:r})}function po(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),s=e.body.name===o?e.body:void 0;s??=e.openStories.find(c=>c.name===o);let a=s?void 0:e.otherStories.find(c=>c.name===o);if(s??=a?e.normalize(a):void 0,!s)return null;let r=chunkANZ44KQT_cjs.Ka(s,t);return r?.kind==="paragraph"?ot(r):null}var fo={committed:false,rejected:false,opCount:0};function H(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function mo(t,e,n={}){let o=e.filter(p=>p.ops.length>0),s=n.partOps??[],a=[...o,...s].reduce((p,x)=>p+x.ops.length,0);if(a===0)return n.packageEdits?.length?H(0,"invalidArgs"):fo;if([...o,...s].some(p=>p.ops.some(chunkANZ44KQT_cjs.qg))||[...o,...s].some(p=>p.ops.some(chunkANZ44KQT_cjs.wh)))return H(a,"invalidArgs");let[r,...c]=o,d=[];for(let p of c){let x=t.partFor(p.scope);if(!x)return H(a,"unknown-part");d.push({partName:x.name,ops:p.ops});}let m=t.transact(r?.scope??{kind:"body"},p=>{for(let x of n.packageEdits??[])p.applyPackage(x);for(let x of r?.ops??[])p.apply(x);for(let x of d)for(let g of x.ops)p.applyTo(x.partName,g);for(let x of s)for(let g of x.ops)p.applyTo(x.partName,g);},n);return m.ok?{committed:true,rejected:false,opCount:a}:H(a,m.reason)}function go(t,e,n,o,s,a){let r=a.partOps??[],c=e.length+r.reduce((x,g)=>x+g.ops.length,0);if(c===0&&!a.packageEdits?.length)return fo;if(r.some(x=>x.ops.some(g=>chunkANZ44KQT_cjs.qg(g)||chunkANZ44KQT_cjs.wh(g))))return H(c,"invalidArgs");let d=e.filter(x=>chunkANZ44KQT_cjs.qg(x)||chunkANZ44KQT_cjs.wh(x)).length;if(d>0){if(r.length||a.packageEdits?.length||d!==e.length||e.length!==1)return H(e.length,"invalidArgs");let x=chunkANZ44KQT_cjs.tb(a.actorId,()=>t.applyLifecycleOp(e[0]));return x.ok?{committed:true,rejected:false,opCount:1}:H(1,x.detail??x.reason)}let m=a.recordsHistory===false&&a.actorId&&a.operationId?t.partFor(s)?.name:void 0,p=t.transact(s,x=>{n!==void 0&&x.selectionBefore(n),o!==void 0&&x.selectionAfter(o);for(let g of a.packageEdits??[])x.applyPackage(g);for(let g of e)x.apply(g);for(let g of r)for(let u of g.ops)x.applyTo(g.partName,u);m&&x.applyPackage(g=>chunkELQFXMJ5_cjs.a(g,m,e));},a);return p.ok?{committed:true,rejected:false,opCount:c}:H(c,p.reason)}var xr=Object.freeze([]);function kr(t,e={}){let n=chunkANZ44KQT_cjs.le(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,s=o.parts.get(o.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=chunkANZ44KQT_cjs.qb(s),r=new chunkSUN62YU6_cjs.X(o,chunkSUN62YU6_cjs.Xa(o,a)),c=null,d=null,m=null,p=null,x=null;r.subscribe(i=>{p=i,x=r.currentPackage();});let g=()=>r.bodyStore(),u=()=>r.currentPackage(),h=Fn(),O=Object.freeze({kind:"body"}),P=(i,l)=>{let f=l?.find(k=>k.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!f)return;let y=chunkANZ44KQT_cjs.E(f);return y.mode==="Internal"&&y.target.ok?i.parts.get(y.target.partName):void 0},R=(i,l,f)=>{if(i.mainRelationships!==f||i.settingsPart!==P(l,f))return false;for(let y of i.resolution)for(let k of [y.headers,y.footers])for(let S of k.values())if(l.parts.get(S.partName)!==S.part)return false;return true},b=()=>{let i=u(),l=i.relationships.get(i.mainDocumentPart);if(c&&p&&x===i&&R(c,i,l)&&c.packageRevision===p.fromRevision&&r.packageRevision===p.toRevision&&p.story?.kind==="body"&&p.impact==="text-local"&&p.created.length===0&&p.deleted.length===0&&p.splitJoin.length===0&&(c={...c,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:P(i,l)}),!c||c.packageRevision!==r.packageRevision||c.pkg!==i){let f=chunkANZ44KQT_cjs.Oe(i);c={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:P(i,l),resolution:f,parts:chunkANZ44KQT_cjs.Ne(f)};}return c},v="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",N="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",D=null,T=()=>{let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===v),f;if(l){let k=chunkANZ44KQT_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/styles.xml");let y=f?.root??null;return y!==D&&(D=y,le=null,G=null),D},C=null,M=null,V=()=>{let i=u();if(C===i)return M;C=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(y=>y.type===N),f;if(l){let y=chunkANZ44KQT_cjs.E(l);y.mode==="Internal"&&y.target.ok&&(f=i.parts.get(y.target.partName));}return f??=i.parts.get("/word/numbering.xml"),M=f?.root??null,M},ho="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",rt=null,pe=null,J=()=>{let i=u();if(rt===i)return pe;rt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===ho),f;if(l){let k=chunkANZ44KQT_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/settings.xml");let y=f?.root??null;return y!==pe&&(pe=y,ge=null,le=null,G=null),pe},xo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ko="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",at=(i,l)=>{let f=u(),y=(f.relationships.get("/")??[]).find(S=>S.type===i),k;if(y){let S=chunkANZ44KQT_cjs.E(y);S.mode==="Internal"&&S.target.ok&&(k=f.parts.get(S.target.partName));}return k??f.parts.get(l)},st=null,Ee=chunkANZ44KQT_cjs.Qh,Oo=()=>{let i=u();if(st===i)return Ee;st=i;let l=at(xo,"/docProps/core.xml"),f=at(ko,"/docProps/app.xml");return Ee=chunkANZ44KQT_cjs.Rh(l?.root??null,f?.root??null),Ee},Po="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",it=null,fe=null,q=()=>{let i=u();if(it===i)return fe;it=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===Po),f;if(l){let k=chunkANZ44KQT_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/theme/theme1.xml");let y=f?.root??null;return y!==fe&&(fe=y,ge=null,Me=null,le=null,G=null),fe},So="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",me=null,bo=()=>{if(me)return me;let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(y=>y.type===So),f;if(l){let y=chunkANZ44KQT_cjs.E(l);y.mode==="Internal"&&y.target.ok&&(f=i.parts.get(y.target.partName));}return f??=i.parts.get("/word/fontTable.xml"),me=Object.freeze(chunkANZ44KQT_cjs.Se(i,f)),me},ae=null,Z=null,se=null,ie=null,le=null,Me=null,ge=null,lt=()=>{let i=[g().part.root],l=new Set;for(let f of $())l.has(f)||(l.add(f),i.push(f.root));return i},we=()=>{let i=lt(),l=T();return l&&i.splice(1,0,l),i},G=null,ye=null,ce=null,ee=null,ct=new WeakMap,he=null,dt=i=>{let l=ct.get(i);if(l)return l;let f=chunkANZ44KQT_cjs.qb(i);return ct.set(i,f),f},ut=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!ee||ee.revision!==i||ee.openStories!==l){let f=r.openStoryParts(),y=new Set(f.map(B=>B.name)),k=$().filter(B=>!y.has(B.name)).map(dt),S=[g().part,...f,...k],I=ee,w=I!==null&&p!==null&&I.openStories===l&&I.revision===p.fromRevision&&i===p.toRevision&&p.impact==="text-local"&&p.created.length===0&&p.deleted.length===0&&p.splitJoin.length===0&&I.parts.length===S.length&&I.parts.every((B,te)=>B.name===S[te]?.name);ee={revision:i,openStories:l,parts:S,index:w&&I?co(I.index,S):uo(S)};}return ee.index},pt=()=>{let i=g().part.name,l=new Map;for(let f of [g().part,...$()])for(let[y,k]of chunkSUN62YU6_cjs.oa(u(),f.name,i))l.set(y,k);return l},Ro=()=>[g().part,...$()],$=()=>{let i=[],l=new Set;for(let y of b().parts)for(let k of [y.headers,y.footers])for(let S of k.values())l.has(S)||(l.add(S),i.push(S));let f=u();for(let y of ["footnote","endnote"]){let k=chunkANZ44KQT_cjs.Ig(f,y);!k||l.has(k)||(l.add(k),i.push(k));}return i};return {ok:true,session:{editable:_(g().part).length>0,paragraphIds:()=>_(g().part).map(i=>i.id),paragraphIdsIn(i=O){let l=r.partFor(i);return l?_(l).map(f=>f.id):[]},part:()=>g().part,partFor:i=>r.partFor(i),currentPackage:u,collaborationPort:i=>chunkELQFXMJ5_cjs.b(r,{documentId:i}),applyTreeOps(i,l,f,y=O,k={}){return go(r,i,l,f,y,k)},applyTreeOpsAtomic(i,l={}){return mo(r,i,l)},projectDoc:()=>X(g().part),reconcile:i=>Ge(i,g().part,p),lastCommitWasStructural:()=>p!==null&&(p.created.length>0||p.deleted.length>0||p.splitJoin.length>0||p.impact==="global"),applyPmDoc(i){let l=g(),f=Je(l.part,i);if(!f.ok)return {committed:false,rejected:true,opCount:0,reason:f.reason};if(f.ops.length===0)return {committed:false,rejected:false,opCount:0};let y=r.transact(O,k=>{for(let S of f.ops)k.apply(S);});return y.ok?{committed:true,rejected:false,opCount:f.ops.length}:{committed:false,rejected:true,opCount:f.ops.length,reason:y.reason}},storyParts:Ro,bodyText:()=>Ln(g().part),storyText(i){let l=r.partFor(i);return l?_(l).map(f=>chunkANZ44KQT_cjs.Zj(l,f.id)??"").join(`
|
|
5
|
-
`):null},revision:()=>g().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=O)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return h(u())},headerFooterParts:()=>{let i=b().parts;return i[i.length-1]??
|
|
1
|
+
'use strict';var chunkLZLTN5A3_cjs=require('./chunk-LZLTN5A3.cjs'),chunk2GK7YQB2_cjs=require('./chunk-2GK7YQB2.cjs'),chunkK246T47S_cjs=require('./chunk-K246T47S.cjs'),chunkAVKVRU7Z_cjs=require('./chunk-AVKVRU7Z.cjs'),chunkGVUOWHTO_cjs=require('./chunk-GVUOWHTO.cjs'),chunk4KZ6L5YF_cjs=require('./chunk-4KZ6L5YF.cjs'),prosemirrorModel=require('prosemirror-model'),prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view'),prosemirrorKeymap=require('prosemirror-keymap'),prosemirrorCommands=require('prosemirror-commands');function Y(t){return t.attributes?.val}function U(t){let e=Y(t);return e===void 0||!(e==="0"||e==="false"||e==="off")}var No=/^[0-9A-Fa-f]{6}$/,Io=/^\d{1,6}$/;function We(t){return t===void 0||t==="auto"?null:No.test(t)?`#${t}`:null}var Eo={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},Mo={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function wo(t){return !t||!/^[\w \-.+]{1,64}$/.test(t)?null:`"${t}"`}function In(t,e=false){let n=chunk4KZ6L5YF_cjs._c(t);return n===null||Math.abs(n)>999999||!e&&n<0?null:n}function K(t,e=false){let n=In(t,e);return n===null?null:`${n/20}pt`}function En(t){let e=[],n=[],o=null,s=null;for(let a of t)switch(a.localName){case "b":e.push(`font-weight:${U(a)?"bold":"normal"}`);break;case "i":e.push(`font-style:${U(a)?"italic":"normal"}`);break;case "u":{let r=Y(a)??"single";if(r==="none"||!U(a))break;n.push("underline"),o=Eo[r]??"solid",s=We(a.attributes?.color);break}case "strike":U(a)&&n.push("line-through");break;case "dstrike":U(a)&&n.push("line-through");break;case "caps":U(a)&&e.push("text-transform:uppercase");break;case "smallCaps":U(a)&&e.push("font-variant:small-caps");break;case "vertAlign":{let r=Y(a);r==="superscript"?e.push("vertical-align:super","font-size:0.75em"):r==="subscript"&&e.push("vertical-align:sub","font-size:0.75em");break}case "color":{let r=We(Y(a));r&&e.push(`color:${r}`);break}case "highlight":{let r=Mo[Y(a)??""];r&&e.push(`background-color:${r}`);break}case "sz":{let r=Y(a);r!==void 0&&Io.test(r)&&e.push(`font-size:${Number(r)/2}pt`);break}case "rFonts":{let r=wo(a.attributes?.ascii??a.attributes?.hAnsi);r&&e.push(`font-family:${r}`);break}case "spacing":{let r=K(Y(a),true);r&&e.push(`letter-spacing:${r}`);break}}return n.length>0&&(e.push(`text-decoration-line:${[...new Set(n)].join(" ")}`),o&&e.push(`text-decoration-style:${o}`),s&&e.push(`text-decoration-color:${s}`)),e.join(";")}var Do={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function Mn(t){let e=[];for(let n of t)switch(n.localName){case "jc":{let o=Do[Y(n)??""];o&&e.push(`text-align:${o}`);break}case "ind":{let o=K(n.attributes?.left??n.attributes?.start,true),s=K(n.attributes?.right??n.attributes?.end,true),a=K(n.attributes?.firstLine),r=K(n.attributes?.hanging);o&&e.push(`margin-left:${o}`),s&&e.push(`margin-right:${s}`),a?e.push(`text-indent:${a}`):r&&e.push(`text-indent:-${r}`);break}case "spacing":{let o=K(n.attributes?.before),s=K(n.attributes?.after);o&&e.push(`margin-top:${o}`),s&&e.push(`margin-bottom:${s}`);let a=In(n.attributes?.line),r=n.attributes?.lineRule;a!==null&&r!=="exact"&&r!=="atLeast"?e.push(`line-height:${(a/240).toFixed(3)}`):a!==null&&e.push(`line-height:${a/20}pt`);break}case "shd":{let o=We(n.attributes?.fill);o&&e.push(`background-color:${o}`);break}case "pageBreakBefore":U(n)&&e.push("break-before:page");break;}return e.join(";")}var E=new prosemirrorModel.Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:t=>{let e=Mn(t.attrs.props??[]);return ["p",{"data-node-id":String(t.attrs.nodeId??""),...e?{style:e}:{}},0]},parseDOM:[{tag:"p",getAttrs:t=>typeof t=="string"?null:{nodeId:t.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:t=>["span",{"data-token":"unknown","data-node-id":String(t.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(t.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:t=>typeof t=="string"?false:{nodeId:t.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:t=>{let e=t.attrs.props??[],n=En(e);return ["span",{"data-run-props":Ao(e),...n?{style:n}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:t=>{if(typeof t=="string")return false;let e=Fo(t.getAttribute("data-run-props"));return e?{props:e}:false}}]}}});function Ao(t){return JSON.stringify(Array.isArray(t)?t:[])}function Fo(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let n=[];for(let o of e){if(typeof o!="object"||o===null)return null;let s=o;if(typeof s.localName!="string"||s.attributes!==void 0&&(typeof s.attributes!="object"||s.attributes===null))return null;n.push(s.attributes===void 0?{localName:s.localName}:{localName:s.localName,attributes:s.attributes});}return n}catch{return null}}function Ue(t){for(let e of t.marks)if(e.type.name==="runProps")return e.attrs.props??[];return []}function Te(t,e){return JSON.stringify(Ne(t))===JSON.stringify(Ne(e))}function Ne(t){return [...t].map(e=>({localName:e.localName,attributes:Object.fromEntries(Object.entries(e.attributes??{}).sort(([n],[o])=>n<o?-1:1))})).sort((e,n)=>e.localName<n.localName?-1:1)}function Ye(t){if(!t||t.kind==="textValue")return [];let e=[];for(let n of t.children){if(n.kind==="textValue"||n.localName==="rPrChange"||n.localName==="pPrChange")continue;let o={};for(let s of n.attributes)o[s.localName]=s.value;e.push(Object.keys(o).length>0?{localName:n.localName,attributes:o}:{localName:n.localName});}return e}function wn(t){return t.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[t.localName]??t.localName} \u2014 preserved, not editable yet`}function L(t){if(t.kind==="textValue")return [];let e=[],n=a=>{if(a.kind!=="run")return;let r=a.children.find(d=>d.kind==="runProperties"),c=Ye(r);for(let d of a.children)if(d.kind!=="runProperties"){if(d.kind==="tab"){e.push({kind:"tab"});continue}if(d.kind==="hardBreak"){e.push(chunk4KZ6L5YF_cjs.eb(d)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(d.kind==="text"){let m="";for(let p of d.children)p.kind==="textValue"&&(m+=p.value);m.length>0&&e.push({kind:"text",text:m,props:c});continue}e.push({kind:"unknown",nodeId:d.id,label:wn(d),modelLength:d.kind==="drawing"||chunk4KZ6L5YF_cjs.ud(d)||chunk4KZ6L5YF_cjs.$c(d)||chunk4KZ6L5YF_cjs.Xa(d)!==null?1:0});}},o=a=>{if(a.kind==="run"){n(a);return}e.push({kind:"unknown",nodeId:a.id,label:wn(a),modelLength:0});},s=(a,r)=>{for(let c of a)if(!(c.kind==="textValue"||c.kind==="paragraphProperties")&&!(r>=chunk4KZ6L5YF_cjs.oa)){if(chunk4KZ6L5YF_cjs.qa(c)&&!chunk4KZ6L5YF_cjs.na(c.kind)&&r<chunk4KZ6L5YF_cjs.oa){s(c.children.filter(d=>!chunk4KZ6L5YF_cjs.Sg(c,d)),chunk4KZ6L5YF_cjs.pa(c,r));continue}if(chunk4KZ6L5YF_cjs.Fc(c)){let d=chunk4KZ6L5YF_cjs.Hc(c);d&&s(d,chunk4KZ6L5YF_cjs.pa(c,r));continue}o(c);}};return s(t.children,0),e}function oe(t){let e=[],n=o=>{if(o.kind!=="textValue"){if(o.kind==="body"){for(let s of o.children)s.kind==="paragraph"&&e.push(s);return}for(let s of o.children)n(s);}};return n(t.root),e}var Dn=chunk4KZ6L5YF_cjs.Gh(16),Cn=new WeakMap;function Bo(t,e){let n=Cn.get(t);if(!n){let o=[];chunk4KZ6L5YF_cjs.Dc([t],o,0),n=Object.freeze(o),Cn.set(t,n);}for(let o of n)e.push(o);}function _(t){let e=Dn.get(t);if(e)return e;let n=[];for(let o of chunk4KZ6L5YF_cjs.zc(t))if(o.root.kind!=="textValue")for(let s of o.root.children)Bo(s,n);return Dn.set(t,n),n}function X(t){let e=oe(t).map(n=>{let o=n.kind==="textValue"?void 0:n.children.find(a=>a.kind==="paragraphProperties"),s=L(n).map(a=>{switch(a.kind){case "text":return E.text(a.text,a.props.length>0?[E.marks.runProps.create({props:a.props})]:[]);case "tab":return E.node("tab");case "hardBreak":return E.node("hardBreak");case "pageBreak":return E.node("pageBreak");default:return E.node("unknownInline",{nodeId:a.nodeId,label:a.label})}});return E.node("paragraph",{nodeId:n.id,props:Ye(o)},s)});return E.node("doc",null,e.length>0?e:[E.node("paragraph")])}function Lo(t,e){let n=[];return t.forEach(o=>{if(o.isText&&o.text){n.push({kind:"text",text:o.text,props:Ue(o)});return}o.type.name==="tab"?n.push({kind:"tab"}):o.type.name==="hardBreak"?n.push({kind:"hardBreak"}):o.type.name==="pageBreak"?n.push({kind:"pageBreak"}):o.type.name==="unknownInline"&&n.push({kind:"unknown",nodeId:String(o.attrs.nodeId??""),label:String(o.attrs.label??""),modelLength:e.has(String(o.attrs.nodeId??""))?1:0});}),n}function A(t){let e="";for(let n of t)n.kind==="text"?e+=n.text:n.kind==="tab"?e+=" ":n.kind==="hardBreak"?e+=`
|
|
2
|
+
`:n.kind==="pageBreak"?e+=chunk4KZ6L5YF_cjs.cb:n.modelLength===1&&(e+=chunk4KZ6L5YF_cjs.Ve);return e}function j(t){let e=[],n=0;for(let o of t)o.kind==="text"?n+=o.text.length:o.kind==="tab"||o.kind==="hardBreak"||o.kind==="pageBreak"?n+=1:(e.push(`${o.nodeId}@${n}`),n+=o.modelLength);return e}function _o(t,e){if(t===e)return null;let n=0,o=Math.min(t.length,e.length);for(;n<o&&t[n]===e[n];)n+=1;let s=t.length,a=e.length;for(;s>n&&a>n&&t[s-1]===e[a-1];)s-=1,a-=1;return {start:n,endBefore:s,endAfter:a}}function An(t){let e=[];for(let n of t)if(n.kind==="text")for(let o=0;o<n.text.length;o+=1)e.push(n.props);else n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak"?e.push(e[e.length-1]??[]):n.kind==="unknown"&&n.modelLength===1&&e.push([]);return e}function jo(t,e,n,o,s){let a=[],r=A(e),c=A(n),d=_o(r,c),m=[],p=0,x=false;for(let g of e){if(g.kind!=="unknown"){p+=g.kind==="text"?g.text.length:1;continue}let u=p;g.modelLength===1&&d&&(d.start<p+1&&d.endBefore>p&&(x=true),d.endBefore<=p&&(u+=d.endAfter-d.endBefore)),m.push(`${g.nodeId}@${u}`),p+=g.modelLength;}if(x||JSON.stringify(m)!==JSON.stringify(j(n)))return {ok:false,reason:"unknown-content-moved",detail:t};if(Te(o,s)||a.push({op:"setParagraphProperties",paragraphId:t,properties:Ne(s)}),d&&(d.endBefore>d.start&&a.push({op:"deleteText",paragraphId:t,start:d.start,end:d.endBefore}),d.endAfter>d.start)){let g=c.slice(d.start,d.endAfter),u=d.start,h="",O=()=>{h.length!==0&&(a.push({op:"insertText",paragraphId:t,offset:u,text:h}),u+=h.length,h="");};for(let P of g)P===" "?(O(),a.push({op:"insertTab",paragraphId:t,offset:u}),u+=1):P===`
|
|
3
|
+
`?(O(),a.push({op:"insertHardBreak",paragraphId:t,offset:u}),u+=1):P===chunk4KZ6L5YF_cjs.cb?(O(),a.push({op:"insertPageBreak",paragraphId:t,offset:u}),u+=1):h+=P;O();}if(!d){let g=An(e),u=An(n),h=0;for(;h<u.length;){if(Te(g[h]??[],u[h])){h+=1;continue}let O=h,P=u[h];for(;h<u.length&&Te(u[h],P)&&!Te(g[h]??[],u[h]);)h+=1;a.push({op:"setRunProperties",paragraphId:t,start:O,end:h,properties:Ne(P)});}}return {ok:true,ops:a}}function Je(t,e){let n=oe(t),o=new Set;for(let c of n)for(let d of L(c))d.kind==="unknown"&&d.modelLength===1&&o.add(d.nodeId);let s=c=>Lo(c,o),a=[];if(e.forEach(c=>{c.type.name==="paragraph"&&a.push(c);}),a.length!==e.childCount)return {ok:false,reason:"unsupported-node"};let r=a.length-n.length;if(r===0){let c=[];for(let[d,m]of a.entries()){let p=n[d];if(m.attrs.nodeId!==p.id)return {ok:false,reason:"paragraph-reordered",detail:String(m.attrs.nodeId)};let x=jo(p.id,L(p),s(m),Ye(p.kind==="textValue"?void 0:p.children.find(g=>g.kind==="paragraphProperties")),m.attrs.props??[]);if(!x.ok)return x;c.push(...x.ops);}return {ok:true,ops:c}}return r===1?Ho(n,a,s):r===-1?$o(n,a,s):{ok:false,reason:"paragraph-count-unexplained",detail:String(r)}}function Ho(t,e,n){for(let o=0;o<t.length;o+=1){let s=t[o],a=e[o],r=e[o+1];if(!a||!r||a.attrs.nodeId!==s.id)continue;let c=r.attrs.nodeId;if(c!==null&&c!==s.id)continue;let d=n(a),m=n(r),p=L(s),x=A(d);if(x+A(m)===A(p)&&JSON.stringify(j([...d,...m]))===JSON.stringify(j(p))&&Fn(t,e,o,n)&&Bn(t,e,o+1,o+2,n))return {ok:true,ops:[{op:"splitParagraph",paragraphId:s.id,offset:x.length}]}}return {ok:false,reason:"split-not-clean"}}function $o(t,e,n){for(let o=0;o+1<t.length;o+=1){let s=t[o],a=t[o+1],r=e[o];if(!r||r.attrs.nodeId!==s.id)continue;let c=[...L(s),...L(a)],d=n(r);if(A(d)===A(c)&&JSON.stringify(j(d))===JSON.stringify(j(c))&&Fn(t,e,o,n)&&Bn(t,e,o+2,o+1,n))return {ok:true,ops:[{op:"joinParagraphs",firstId:s.id,secondId:a.id}]}}return {ok:false,reason:"join-not-clean"}}function Fn(t,e,n,o){for(let s=0;s<n;s+=1){let a=e[s],r=t[s];if(!a||a.attrs.nodeId!==r.id||A(o(a))!==A(L(r))||JSON.stringify(j(o(a)))!==JSON.stringify(j(L(r))))return false}return true}function Bn(t,e,n,o,s){for(let a=0;n+a<t.length;a+=1){let r=t[n+a],c=e[o+a];if(!c||c.attrs.nodeId!==r.id||A(s(c))!==A(L(r))||JSON.stringify(j(s(c)))!==JSON.stringify(j(L(r))))return false}return true}function zo(t,e){return chunk4KZ6L5YF_cjs.Ka(t,e)!==null}function Ge(t,e,n){if(!n||n.created.length>0||n.deleted.length>0||n.splitJoin.length>0)return X(e);let o=new Map;t.forEach(d=>{let m=d.attrs.nodeId;typeof m=="string"&&o.set(m,d);});let s=new Set(n.dirty),a=oe(e);if(a.length!==t.childCount)return X(e);let r=X(e),c=[];for(let[d,m]of a.entries()){let p=o.get(m.id);c.push(p&&!s.has(m.id)?p:r.child(d));}return E.node("doc",null,c)}var Wo=8*1024*1024;function Ln(){let t=new WeakMap;return e=>{let n=t.get(e);if(n)return n.slice();let o=chunk4KZ6L5YF_cjs.oe(e);return t=new WeakMap,o.byteLength<=Wo&&t.set(e,o.slice()),o}}function jn(t){return _(t).map(e=>chunk4KZ6L5YF_cjs.ek(t,e.id)??"").join(`
|
|
4
|
+
`)}var Uo=64,_n=new WeakMap;function Ke(t,e=0){if(e>Uo)return false;let n=_n.get(t);if(n!==void 0)return n;let o=false;for(let s of t.children)if(s.kind!=="textValue"&&(s.kind==="commentRangeStart"||s.kind==="commentReference"||Ke(s,e+1))){o=true;break}return _n.set(t,o),o}function Yo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Hn(t,e,n){for(let s of e)if(s.ranges.length===0)return false;let o=new Set;for(let s of t)s.kind!=="revision"||s.ranges.length>0||zn(s,n)||o.add(chunkAVKVRU7Z_cjs.ta(s));for(let s of e)if(o.has(chunkAVKVRU7Z_cjs.ta(s)))return false;return true}function $n(t,e,n,o){let s=e.get(n);if(s===void 0)return [...t];let a=[],r=null;for(let c of t){if(c.kind==="revision"&&zn(c,n)){r===null&&(r=a.length);continue}if(r===null){let d=Yo(c,e);d!==null&&d>s&&(r=a.length);}a.push(c);}if(r===null&&(r=a.length),o.length>0){let c=o.length<2?[...o]:[...o].sort((d,m)=>chunkAVKVRU7Z_cjs.wa(d,e)-chunkAVKVRU7Z_cjs.wa(m,e));a.splice(r,0,...c);}return chunkAVKVRU7Z_cjs.Qa(a)}function zn(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Jo(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function Go(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function Ko(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function Wn(t,e,n,o,s,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==s||e.commentsExtendedPart!==a)return null;let c=t.dirty[0],d=chunk4KZ6L5YF_cjs.Ka(o,c);if(!d||d.kind!=="paragraph")return null;let m=chunk4KZ6L5YF_cjs.La(o,c);if(m){let p=m.children.findIndex(g=>g.id===c),x=m.children[p-1];if(x?.kind==="paragraph"&&chunk4KZ6L5YF_cjs.ej({...o,root:x}).some(g=>g.paragraphMark))return null}for(let p of n){if(p.kind==="comment"){if(Jo(p,c))return null;continue}if(p.kind==="custom"){if(p.range?.start.paragraphId===c)return null;continue}if(Go(p,c)||Ko(p,c))return null}return c}var Jn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Xo=["ascii","hAnsi","cs","eastAsia"],Qo=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Vo=128,qo=/[\u0000-\u001F\u007F-\u009F]/;function F(t){return t.kind!=="textValue"}function Q(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Gn(t,e){let n=new Map;for(let s of t)for(let a of s.children)if(F(a))for(let[r,c]of Qn(a,e))n.has(r)||n.set(r,c);let o=[...n.values()];return o.sort((s,a)=>s<a?-1:s>a?1:0),o}var Xe=new WeakMap,Kn=16,Xn=32;function Qn(t,e,n=0){let o=e?.major??null,s=e?.minor??null,a=e?.majorEastAsia??null,r=e?.minorEastAsia??null,c=e?.majorBidi??null,d=e?.minorBidi??null,m=Xe.get(t);if(m&&m.major===o&&m.minor===s&&m.majorEastAsia===a&&m.minorEastAsia===r&&m.majorBidi===c&&m.minorBidi===d)return m.byFold;if(t.children.length>=Kn&&n<Xn&&t.localName!=="rFonts"){let u=new Map;for(let h of t.children)if(F(h))for(let[O,P]of Qn(h,e,n+1))u.has(O)||u.set(O,P);return Xe.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:c,minorBidi:d,byFold:u}),u}let p=new Map,x=u=>{if(!u||!Jn.test(u))return;let h=u.toLowerCase();p.has(h)||p.set(h,u);},g=[t];for(;g.length>0;){let u=g.pop();if(F(u)){if(u.localName==="rFonts"){for(let h of Xo)x(Q(u,h));if(e)for(let h of Qo)x(chunkAVKVRU7Z_cjs._a(Q(u,h),e));}for(let h=u.children.length-1;h>=0;h-=1)g.push(u.children[h]);}}return Xe.set(t,{major:o,minor:s,majorEastAsia:a,minorEastAsia:r,majorBidi:c,minorBidi:d,byFold:p}),p}function Vn(t){let e=new Map;for(let o of t)for(let s of o.children)if(F(s))for(let[a,r]of qn(s))e.has(a)||e.set(a,r);let n=[...e.values()];return n.sort((o,s)=>o<s?-1:o>s?1:0),n}var Un=new WeakMap,Zo=new Map;function qn(t,e=0){let n=Un.get(t);if(n)return n;let o=r=>{let c=r.size===0?Zo:r;return Un.set(t,c),c},s=new Map;if(t.children.length>=Kn&&e<Xn&&t.localName!=="sym"){for(let r of t.children)if(F(r))for(let[c,d]of qn(r,e+1))s.has(c)||s.set(c,d);return o(s)}let a=[t];for(;a.length>0;){let r=a.pop();if(F(r)){if(r.localName==="sym"&&r.namespaceUri===chunk4KZ6L5YF_cjs.fa){let c=r.attributes.find(m=>m.localName==="font"&&(m.namespaceUri===chunk4KZ6L5YF_cjs.fa||m.namespaceUri===""))?.value,d=chunkLZLTN5A3_cjs.b(c);d!==null&&!s.has(d.toLowerCase())&&s.set(d.toLowerCase(),d);}for(let c=r.children.length-1;c>=0;c-=1)a.push(r.children[c]);}}return o(s)}function Zn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(F(n)){if(n.localName==="t"&&n.namespaceUri===chunk4KZ6L5YF_cjs.fa){for(let o of n.children)if(!F(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var er=new Set(["paragraph","character","table","numbering"]),tr=/^[0-9A-Fa-f]{6}$/,nr=16,Yn=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function eo(t){return t.children}function Qe(t,e){for(let n of eo(t))if(F(n)&&n.localName===e)return n}function or(t){return Yn.get(t.name.toLowerCase())??Yn.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Ve(t){return t===void 0||t.length===0||t.length>Vo||qo.test(t)?null:t}function to(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!F(a)||a.localName!=="style")continue;let r=Ve(Q(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,c=false,d=null,m=false,p=false,x=new Set,g=a;for(let O=0;O<nr&&g!==null&&!x.has(g);O+=1){x.add(g);let P=n.get(g);if(!P)break;let R=Qe(P,"rPr");for(let v of R?eo(R):[]){if(!F(v))continue;let N=Q(v,"val"),D=N!=="0"&&N!=="false"&&N!=="off";v.localName==="b"&&!m?(r=D,m=true):v.localName==="i"&&!p?(c=D,p=true):v.localName==="color"&&d===null&&N&&tr.test(N)&&(d=N);}let b=Qe(P,"basedOn");g=b?Ve(Q(b,"val")):null;}let u=e?.(a),h=u?.fontFamily??null;return {fontFamily:h!==null&&Jn.test(h)?h:null,fontSizePt:u?.fontSizeHalfPoints!=null&&u.fontSizeHalfPoints>0?u.fontSizeHalfPoints/2:null,bold:r,italic:c,color:d}},s=[];for(let[a,r]of n){let c=Q(r,"type");if(c===void 0||!er.has(c))continue;let d=Qe(r,"name"),m=Ve(d?Q(d,"val"):void 0);s.push({styleId:a,name:m??a,type:c,preview:o(a)});}return s.map((a,r)=>({entry:a,index:r,rank:or(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var rr=128,ar=/[\u0000-\u001F\u007F-\u009F]/,sr=/[\u0000-\u001F\u007F-\u009F]/g,ir=200;function Ze(t){return t.kind!=="textValue"}function no(t,e){for(let n of t.children)if(Ze(n)&&n.localName===e)return n}function qe(t,e){return t.attributes.find(n=>n.localName===e)?.value}function lr(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!Ze(n)||n.localName!=="style"||qe(n,"type")!=="paragraph")continue;let o=qe(n,"styleId");if(o===void 0||o.length===0||o.length>rr||ar.test(o))continue;let s=chunkK246T47S_cjs.d(n);s!==null&&e.set(o,s);}return e}function et(t){let e=no(t,"pPr"),n=e?no(e,"pStyle"):void 0;return n?qe(n,"val"):void 0}function oo(t,e){let n=lr(e);if(n.size===0)return [];let o=[];for(let s of oe(t)){if(!Ze(s))continue;let a=et(s);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let c=chunk4KZ6L5YF_cjs.ek(t,s.id)??"",d=s.kind==="paragraph"?chunk4KZ6L5YF_cjs.lj(s,c):c,m=chunk4KZ6L5YF_cjs.bb(d).replace(sr," ").trim().slice(0,ir);m.length!==0&&o.push({text:m,level:r,blockId:s.id});}return o}function cr(t,e,n){let o=new Map,s=n(t);for(let a of s){let r=o.get(a.hostParagraphId);r?r.push(a):o.set(a.hostParagraphId,[a]);}return o}function dr(t,e,n){let o=[];for(let s of chunk4KZ6L5YF_cjs.Cc(t.root)){let a=e.get(s.id);if(a)for(let r of a)o.push(r);}return o}function ro(t,e,n=chunk4KZ6L5YF_cjs.Xh){let o=[],s=new Map;for(let a of t){if(o.push(a),a.scope?.kind==="note")continue;let r=s.get(a.part);r||(r=cr(a.part,e,n),s.set(a.part,r));for(let c of dr(a,r)){let d=a.scope;o.push({part:a.part,root:c.root,scope:{kind:"frame",id:c.root.id,drawingNodeId:c.drawingNodeId,hostParagraphId:c.hostParagraphId,...d?.kind==="headerFooter"?{owner:d}:{}}});}}return o}var Ie=48,ur=/[\u0000-\u001F\u007F-\u009F]/g;function pr(t){let e=[],n=chunk4KZ6L5YF_cjs.Rf(t),o=new Map;for(let s of n.segments)chunk4KZ6L5YF_cjs.bf(s.node)&&o.set(s.node.id,s.formatRunIds??[]);return chunk4KZ6L5YF_cjs.Mc(t.children,0,s=>{if(s.kind==="run"){e.push({id:s.id,start:n.spanOf(s)?.start??0});return}if(chunk4KZ6L5YF_cjs.bf(s))for(let a of o.get(s.id)??[]){let r=n.spanOf(a);r&&e.push({id:a,start:r.start});}},{descendRevisions:true}),e}function fr(t){let e=chunk4KZ6L5YF_cjs.Bc(t);return e?[{part:t,root:e}]:[]}function mr(t,e){let n=[];for(let o of ["header","footer"])for(let s of t){let a=o==="header"?s.headers:s.footers;for(let[r,c]of a){if(!chunk4KZ6L5YF_cjs.Ne(s,r)||e.has(c.part))continue;e.add(c.part);let d=chunk4KZ6L5YF_cjs.zc(c.part).find(m=>m.kind===o);d&&n.push({part:c.part,root:d.root,scope:{kind:"headerFooter",rId:c.rId}});}}return n}function ao(t,e,n){if(!t)return [];let o=[];for(let s of chunk4KZ6L5YF_cjs.vc(t.root)){let a=chunk4KZ6L5YF_cjs.jc(s);!chunk4KZ6L5YF_cjs.lc(s)||a===null||!n.has(a)||o.push({part:t,root:s,scope:{kind:"note",id:chunk4KZ6L5YF_cjs.$b(e,a)}});}return o}function gr(t,e){let n=fr(t);if(e){let o=new Set;for(let s of mr(e.headerFooterBySection,o))n.push(s);for(let s of ao(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(s);for(let s of ao(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(s);}return ro(n)}function so(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function yr(t,e,n){let o=t.findIndex(s=>s.id===e);return o<0?null:{index:o,offset:n}}function tt(t,e){return chunk4KZ6L5YF_cjs.bb(t).replace(ur," ").slice(0,e)}var hr=1e3;function io(t,e,n={},o){let s=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,a={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},r=e.slice(0,hr),c=r.map(()=>({matches:[],truncated:false})),d=r.map((p,x)=>chunkAVKVRU7Z_cjs.Va(p)?x:-1);if(d=d.filter(p=>p>=0),d.length===0)return c;let m=n.stories==="body"?void 0:o;for(let p of gr(t,m)){let x=0;for(let g of chunk4KZ6L5YF_cjs.Cc(p.root)){if(g.kind!=="paragraph")continue;let u=x;x+=1;let h=chunk4KZ6L5YF_cjs.ek(p.part,g.id)??"",O=chunk2GK7YQB2_cjs.d(g,h);if(O.text.length===0)continue;let P=null,R=false;for(let b of d){let v=c[b],N=s-v.matches.length,D=O.findOccurrences(r[b],Math.max(N,1),a);if(N===0&&D.matches.length>0){v.truncated=true,R=true;continue}for(let T of D.matches){let C=T.start+T.length;P??=pr(g);let M=O.resultRunAddressAt(T.start),V=M?yr(P,M.runId,M.offset)??so(P,T.rawStart):so(P,T.rawStart);v.matches.push({blockId:g.id,start:T.rawStart,length:T.rawEnd-T.rawStart,paragraphIndex:u,runIndex:V.index,runOffset:V.offset,...p.scope?{scope:p.scope}:{},text:tt(O.displaySlice(T.start,C),256),contextBefore:tt(O.displaySlice(Math.max(0,T.start-Ie),T.start),Ie),contextAfter:tt(O.displaySlice(C,C+Ie),Ie)});}D.truncated&&(v.truncated=true,R=true);}if(R&&(d=d.filter(b=>!c[b].truncated)),d.length===0)return c}}return c}var xr=32;function lo(t){let e=null;return((n,o)=>{let s=t.revision(),a=typeof n!="string",r=`${o?.matchCase===true?"c":""}${o?.wholeWord===true?"w":""}`,c=`${o?.limit??""}:${o?.stories??"all"}`,d=JSON.stringify([r,c,n]);e?.revision!==s&&(e={revision:s,results:new Map});let m=e.results.get(d);if(m)return m;let p=t.bodyPart(),x=t.currentPackage(),g={footnote:new Set,endnote:new Set};for(let O of chunk4KZ6L5YF_cjs.Mg(p))g[O.noteKind].add(O.noteId);let u=io(p,a?n:[n],o,{headerFooterBySection:t.headerFooterBySection(),footnotes:chunk4KZ6L5YF_cjs.Lg(x,"footnote")??null,endnotes:chunk4KZ6L5YF_cjs.Lg(x,"endnote")??null,referencedNoteIds:g}),h=a?u:u[0];return e.results.size>=xr&&e.results.delete(e.results.keys().next().value),e.results.set(d,h),h})}var kr=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function re(t,e=null){return chunkAVKVRU7Z_cjs.Za(t,e)}function co(t){let e=chunk4KZ6L5YF_cjs.nd(t),n=[];for(let o of kr){let s=e.get(o);if(!s)return [];n.push({slot:o,hex:s});}return n}var uo=new WeakMap;function ot(t){let e=uo.get(t);if(e!==void 0)return e;let n=chunk4KZ6L5YF_cjs.ib(t),o=n===null||!chunk4KZ6L5YF_cjs.hb(n)?null:n;return uo.set(t,o),o}var nt=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,s]of this.entries())e.call(n,s,o,this);}};function po(t,e){return Object.freeze({...t,partByNode:new nt(t.ordinalByNode,e)})}function fo(t){let e=new Map,n=new Map,o=new Map,s=new Set,a=new Map,r=new Map,c=0;for(let d of t)for(let m of _(d)){o.set(m.id,c),a.set(m.id,d),c+=1;let p=ot(m);if(p===null)continue;e.set(m.id,p);let x=p.toUpperCase(),g=r.get(x);g?(g.push(m.id),s.add(x)):(r.set(x,[m.id]),n.set(x,m.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:s,partByNode:a,claimantsByParaId:r})}function mo(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),s=e.body.name===o?e.body:void 0;s??=e.openStories.find(c=>c.name===o);let a=s?void 0:e.otherStories.find(c=>c.name===o);if(s??=a?e.normalize(a):void 0,!s)return null;let r=chunk4KZ6L5YF_cjs.Ka(s,t);return r?.kind==="paragraph"?ot(r):null}var go={committed:false,rejected:false,opCount:0};function H(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function yo(t,e,n={}){let o=e.filter(p=>p.ops.length>0),s=n.partOps??[],a=[...o,...s].reduce((p,x)=>p+x.ops.length,0);if(a===0)return n.packageEdits?.length?H(0,"invalidArgs"):go;if([...o,...s].some(p=>p.ops.some(chunk4KZ6L5YF_cjs.tg))||[...o,...s].some(p=>p.ops.some(chunk4KZ6L5YF_cjs.Bh)))return H(a,"invalidArgs");let[r,...c]=o,d=[];for(let p of c){let x=t.partFor(p.scope);if(!x)return H(a,"unknown-part");d.push({partName:x.name,ops:p.ops});}let m=t.transact(r?.scope??{kind:"body"},p=>{for(let x of n.packageEdits??[])p.applyPackage(x);for(let x of r?.ops??[])p.apply(x);for(let x of d)for(let g of x.ops)p.applyTo(x.partName,g);for(let x of s)for(let g of x.ops)p.applyTo(x.partName,g);},n);return m.ok?{committed:true,rejected:false,opCount:a}:H(a,m.reason)}function ho(t,e,n,o,s,a){let r=a.partOps??[],c=e.length+r.reduce((x,g)=>x+g.ops.length,0);if(c===0&&!a.packageEdits?.length)return go;if(r.some(x=>x.ops.some(g=>chunk4KZ6L5YF_cjs.tg(g)||chunk4KZ6L5YF_cjs.Bh(g))))return H(c,"invalidArgs");let d=e.filter(x=>chunk4KZ6L5YF_cjs.tg(x)||chunk4KZ6L5YF_cjs.Bh(x)).length;if(d>0){if(r.length||a.packageEdits?.length||d!==e.length||e.length!==1)return H(e.length,"invalidArgs");let x=chunk4KZ6L5YF_cjs.tb(a.actorId,()=>t.applyLifecycleOp(e[0]));return x.ok?{committed:true,rejected:false,opCount:1}:H(1,x.detail??x.reason)}let m=a.recordsHistory===false&&a.actorId&&a.operationId?t.partFor(s)?.name:void 0,p=t.transact(s,x=>{n!==void 0&&x.selectionBefore(n),o!==void 0&&x.selectionAfter(o);for(let g of a.packageEdits??[])x.applyPackage(g);for(let g of e)x.apply(g);for(let g of r)for(let u of g.ops)x.applyTo(g.partName,u);m&&x.applyPackage(g=>chunkGVUOWHTO_cjs.a(g,m,e));},a);return p.ok?{committed:true,rejected:false,opCount:c}:H(c,p.reason)}var Or=Object.freeze([]);function Pr(t,e={}){let n=chunk4KZ6L5YF_cjs.ne(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,s=o.parts.get(o.mainDocumentPart);if(!s)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=chunk4KZ6L5YF_cjs.qb(s),r=new chunkAVKVRU7Z_cjs.X(o,chunkAVKVRU7Z_cjs.Xa(o,a)),c=null,d=null,m=null,p=null,x=null;r.subscribe(i=>{p=i,x=r.currentPackage();});let g=()=>r.bodyStore(),u=()=>r.currentPackage(),h=Ln(),O=Object.freeze({kind:"body"}),P=(i,l)=>{let f=l?.find(k=>k.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!f)return;let y=chunk4KZ6L5YF_cjs.E(f);return y.mode==="Internal"&&y.target.ok?i.parts.get(y.target.partName):void 0},R=(i,l,f)=>{if(i.mainRelationships!==f||i.settingsPart!==P(l,f))return false;for(let y of i.resolution)for(let k of [y.headers,y.footers])for(let S of k.values())if(l.parts.get(S.partName)!==S.part)return false;return true},b=()=>{let i=u(),l=i.relationships.get(i.mainDocumentPart);if(c&&p&&x===i&&R(c,i,l)&&c.packageRevision===p.fromRevision&&r.packageRevision===p.toRevision&&p.story?.kind==="body"&&p.impact==="text-local"&&p.created.length===0&&p.deleted.length===0&&p.splitJoin.length===0&&(c={...c,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:P(i,l)}),!c||c.packageRevision!==r.packageRevision||c.pkg!==i){let f=chunk4KZ6L5YF_cjs.Qe(i);c={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:P(i,l),resolution:f,parts:chunk4KZ6L5YF_cjs.Pe(f)};}return c},v="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",N="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",D=null,T=()=>{let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===v),f;if(l){let k=chunk4KZ6L5YF_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/styles.xml");let y=f?.root??null;return y!==D&&(D=y,le=null,G=null),D},C=null,M=null,V=()=>{let i=u();if(C===i)return M;C=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(y=>y.type===N),f;if(l){let y=chunk4KZ6L5YF_cjs.E(l);y.mode==="Internal"&&y.target.ok&&(f=i.parts.get(y.target.partName));}return f??=i.parts.get("/word/numbering.xml"),M=f?.root??null,M},ko="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",rt=null,pe=null,J=()=>{let i=u();if(rt===i)return pe;rt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===ko),f;if(l){let k=chunk4KZ6L5YF_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/settings.xml");let y=f?.root??null;return y!==pe&&(pe=y,ge=null,le=null,G=null),pe},Oo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Po="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",at=(i,l)=>{let f=u(),y=(f.relationships.get("/")??[]).find(S=>S.type===i),k;if(y){let S=chunk4KZ6L5YF_cjs.E(y);S.mode==="Internal"&&S.target.ok&&(k=f.parts.get(S.target.partName));}return k??f.parts.get(l)},st=null,Ee=chunk4KZ6L5YF_cjs.Vh,So=()=>{let i=u();if(st===i)return Ee;st=i;let l=at(Oo,"/docProps/core.xml"),f=at(Po,"/docProps/app.xml");return Ee=chunk4KZ6L5YF_cjs.Wh(l?.root??null,f?.root??null),Ee},bo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",it=null,fe=null,q=()=>{let i=u();if(it===i)return fe;it=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(k=>k.type===bo),f;if(l){let k=chunk4KZ6L5YF_cjs.E(l);k.mode==="Internal"&&k.target.ok&&(f=i.parts.get(k.target.partName));}f??=i.parts.get("/word/theme/theme1.xml");let y=f?.root??null;return y!==fe&&(fe=y,ge=null,Me=null,le=null,G=null),fe},Ro="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",me=null,vo=()=>{if(me)return me;let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(y=>y.type===Ro),f;if(l){let y=chunk4KZ6L5YF_cjs.E(l);y.mode==="Internal"&&y.target.ok&&(f=i.parts.get(y.target.partName));}return f??=i.parts.get("/word/fontTable.xml"),me=Object.freeze(chunk4KZ6L5YF_cjs.Ue(i,f)),me},ae=null,Z=null,se=null,ie=null,le=null,Me=null,ge=null,lt=()=>{let i=[g().part.root],l=new Set;for(let f of $())l.has(f)||(l.add(f),i.push(f.root));return i},we=()=>{let i=lt(),l=T();return l&&i.splice(1,0,l),i},G=null,ye=null,ce=null,ee=null,ct=new WeakMap,he=null,dt=i=>{let l=ct.get(i);if(l)return l;let f=chunk4KZ6L5YF_cjs.qb(i);return ct.set(i,f),f},ut=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!ee||ee.revision!==i||ee.openStories!==l){let f=r.openStoryParts(),y=new Set(f.map(B=>B.name)),k=$().filter(B=>!y.has(B.name)).map(dt),S=[g().part,...f,...k],I=ee,w=I!==null&&p!==null&&I.openStories===l&&I.revision===p.fromRevision&&i===p.toRevision&&p.impact==="text-local"&&p.created.length===0&&p.deleted.length===0&&p.splitJoin.length===0&&I.parts.length===S.length&&I.parts.every((B,te)=>B.name===S[te]?.name);ee={revision:i,openStories:l,parts:S,index:w&&I?po(I.index,S):fo(S)};}return ee.index},pt=()=>{let i=g().part.name,l=new Map;for(let f of [g().part,...$()])for(let[y,k]of chunkAVKVRU7Z_cjs.oa(u(),f.name,i))l.set(y,k);return l},To=()=>[g().part,...$()],$=()=>{let i=[],l=new Set;for(let y of b().parts)for(let k of [y.headers,y.footers])for(let S of k.values())l.has(S)||(l.add(S),i.push(S));let f=u();for(let y of ["footnote","endnote"]){let k=chunk4KZ6L5YF_cjs.Lg(f,y);!k||l.has(k)||(l.add(k),i.push(k));}return i},ft={ok:true,session:{editable:_(g().part).length>0,paragraphIds:()=>_(g().part).map(i=>i.id),paragraphIdsIn(i=O){let l=r.partFor(i);return l?_(l).map(f=>f.id):[]},part:()=>g().part,partFor:i=>r.partFor(i),currentPackage:u,collaborationPort:i=>chunkGVUOWHTO_cjs.b(r,{documentId:i}),applyTreeOps(i,l,f,y=O,k={}){return ho(r,i,l,f,y,k)},applyTreeOpsAtomic(i,l={}){return yo(r,i,l)},projectDoc:()=>X(g().part),reconcile:i=>Ge(i,g().part,p),lastCommitWasStructural:()=>p!==null&&(p.created.length>0||p.deleted.length>0||p.splitJoin.length>0||p.impact==="global"),applyPmDoc(i){let l=g(),f=Je(l.part,i);if(!f.ok)return {committed:false,rejected:true,opCount:0,reason:f.reason};if(f.ops.length===0)return {committed:false,rejected:false,opCount:0};let y=r.transact(O,k=>{for(let S of f.ops)k.apply(S);});return y.ok?{committed:true,rejected:false,opCount:f.ops.length}:{committed:false,rejected:true,opCount:f.ops.length,reason:y.reason}},storyParts:To,bodyText:()=>jn(g().part),storyText(i){let l=r.partFor(i);return l?_(l).map(f=>chunk4KZ6L5YF_cjs.ek(l,f.id)??"").join(`
|
|
5
|
+
`):null},revision:()=>g().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=O)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return h(u())},headerFooterParts:()=>{let i=b().parts;return i[i.length-1]??chunk4KZ6L5YF_cjs.Se(u())},headerFooterPartsBySection:()=>b().parts,headerFooterResolutionBySection:()=>b().resolution,documentFonts(){return ae&&ae.revision===r.packageRevision||(ae={revision:r.packageRevision,fonts:Gn(we(),re(q(),J()))}),ae.fonts},symbolFontFamilies(){return se&&se.revision===r.packageRevision||(se={revision:r.packageRevision,fonts:Vn(we())}),se.fonts},renderedFontFamilies(){let i=T();return Z&&Z.revision===r.packageRevision&&Z.styles===i||(Z={revision:r.packageRevision,styles:i,families:chunkLZLTN5A3_cjs.e(lt(),i,re(q(),J()))}),Z.families},rendersText(){return ie&&ie.revision===r.packageRevision||(ie={revision:r.packageRevision,rendersText:Zn(we())}),ie.rendersText},documentStyles(){let i=T(),l=q(),f=J();G??=chunkLZLTN5A3_cjs.c(i,re(l,f));let y=G;return le??=to(i,k=>y(k)),le},stylesRoot:()=>T(),documentThemeFonts(){let i=q(),l=J();return ge??=re(i,l),ge},numberingRoot:()=>V(),settingsRoot:()=>J(),documentProperties:()=>So(),trackingSettings:()=>chunk4KZ6L5YF_cjs.Sh(J()),documentThemeColors(){let i=q();return Me??=co(i),Me},effectiveRunDefaults(i,l){let f=T(),y=q(),k=J();G??=chunkLZLTN5A3_cjs.c(f,re(y,k));let S=g();if(!ye||ye.revision!==S.revision){let I=new Map;for(let w of _(S.part))w.kind!=="textValue"&&I.set(w.id,et(w)??null);ye={revision:S.revision,byId:I};}return G(ye.byId.get(i)??null,l)},documentOutline(){let i=g();return ce&&ce.revision===i.revision||(ce={revision:i.revision,outline:oo(i.part,T())}),ce.outline},findText:lo({revision:()=>r.packageRevision,bodyPart:()=>g().part,currentPackage:u,headerFooterBySection:()=>b().resolution}),embeddedFonts:vo,paragraphAnchors:ut,paraIdOf:i=>mo(i,{body:g().part,openStories:r.openStoryParts(),otherStories:$(),normalize:dt}),nodeIdOf:i=>ut().nodeByParaId.get(i.toUpperCase())??null,relationshipTarget:(i,l=O)=>{let f=u(),y=r.partFor(l);return y?chunk4KZ6L5YF_cjs.pg(f,y.name,i):null},bookmarks:()=>{let i=r.packageRevision;if(!he||he.revision!==i){let l=new Map(chunk4KZ6L5YF_cjs.Xf(g().part));for(let f of $())for(let[y,k]of chunk4KZ6L5YF_cjs.Xf(f))l.has(y)||l.set(y,k);he={revision:i,index:l};}return he.index},ensureHyperlinkRelationship(i,l=O){let f=r.partFor(l);return f?chunk4KZ6L5YF_cjs.Fa(r,()=>{let y=u(),k=chunk4KZ6L5YF_cjs.og(y,i,f.name);return k?(k.pkg!==y&&r.replacePackageShell(k.pkg),k.relationshipId):null},y=>y!==null):null},reviewItems(){let i=e.reviewModel;if(!i)return Or;let l=g(),f=`${r.packageRevision}:${l.revision}`;if(d&&d.revisionKey===f)return d.items;let y=u(),k=y.parts.get(chunkAVKVRU7Z_cjs.ea(y,l.part.name)),S=y.parts.get(chunkAVKVRU7Z_cjs.fa(y,l.part.name)),I=$(),w=d&&p?Wn(p,d,d.items,l.part,k,S,r.packageRevision):null,B,te;if(w&&d){let mt=i.revisionItemsOfParagraph(l.part,w);Hn(d.items,mt,w)?(B=$n(d.items,d.paragraphOrder,w,mt),te=d.paragraphOrder):(te=chunk4KZ6L5YF_cjs.tj(l.part),B=i.collectReviewItems({storyPart:l.part,furnitureParts:I,stylesPart:chunk4KZ6L5YF_cjs.Oc(y),commentsPart:k,commentsExtendedPart:S,customNodePayloads:pt()}));}else te=chunk4KZ6L5YF_cjs.tj(l.part),B=i.collectReviewItems({storyPart:l.part,furnitureParts:I,stylesPart:chunk4KZ6L5YF_cjs.Oc(y),commentsPart:k,commentsExtendedPart:S,customNodePayloads:pt()});return d={revisionKey:f,bodyRevision:l.revision,packageRevision:r.packageRevision,items:B,paragraphOrder:te,commentsPart:k,commentsExtendedPart:S},d.items},hasReviewContent(){let i=r.packageRevision;if(!m||m.revision!==i){let l=chunk4KZ6L5YF_cjs.Oc(u()),f=[g().part,...$(),...l?[l]:[]];m={revision:i,present:f.some(y=>chunk4KZ6L5YF_cjs.ej(y).length>0||Ke(y.root))};}return m.present},replyToComment(i,l,f,y,k,S=O,I){let w=chunkAVKVRU7Z_cjs.ga(r,{anchor:{paragraphId:l.paragraphId,start:l.start,end:l.end,...l.endParagraphId===void 0?{}:{endParagraphId:l.endParagraphId}},author:y,text:f,...k===void 0?{}:{date:k},...i===null?{}:{replyToCommentId:i},...I===void 0?{}:{actorId:I}},S);return w.ok?w.commentId:null},setCommentResolved(i,l){return chunkAVKVRU7Z_cjs.ha(r,i,l).ok},deleteComment(i,l=O,f){return this.deleteComments([{commentId:i}],l,f)},deleteComments(i,l=O,f){return chunkAVKVRU7Z_cjs.ia(r,i,l,f)},insertCustomNode(i,l=O){return chunkAVKVRU7Z_cjs.qa(r,i,l)},removeCustomNode(i,l=O){return chunkAVKVRU7Z_cjs.ra(r,i,l)},sweepCustomNodePayloads(i){return chunk4KZ6L5YF_cjs.Fa(r,()=>{let l=g(),f=chunkAVKVRU7Z_cjs.na(r.currentPackage(),l.part.name,i);return f.ok?f.removed.length===0?{ok:true,removed:[]}:(r.replacePackageShell(f.pkg),{ok:true,removed:f.removed}):{ok:false,reason:f.reason}},l=>l.ok&&l.removed.length>0)},ensureListDefinition(i){return chunk4KZ6L5YF_cjs.Fa(r,()=>{let l=chunk4KZ6L5YF_cjs.hg(u(),i);return l?(r.replacePackageShell(l.pkg),C=null,M=null,l.numId):null},l=>l!==null)},ensureNumberingLevel(i,l,f){return chunk4KZ6L5YF_cjs.Fa(r,()=>{let y=u(),k=chunk4KZ6L5YF_cjs.ig(y,i,l,f);return k?k!==y?(r.replacePackageShell(k),C=null,M=null,{ok:true,changed:true}):{ok:true,changed:false}:{ok:false,changed:false}},y=>y.changed).ok},insertImage(i,l){return r.insertImage(i,l)},replaceImage(i,l,f,y,k,S){return r.replaceImage(i,l,f,y,k,S)},deleteImage(i,l){return r.deleteImage(i,l)},deleteImageTracked(i,l,f){return r.deleteImageTracked(i,l,f)},applyImageProperties(i,l){return r.applyImageProperties(i,l)},applyFragmentPaste(i,l){return r.applyFragmentPaste(i,l)}}};return chunk4KZ6L5YF_cjs.qk(ft.session,r),ft}var Sr=chunk4KZ6L5YF_cjs.b.projection;function Cr(t,e,n){let o=t.filter(s=>s.localName!==e);return o.length!==t.length?o:[...o,n?{localName:e,attributes:n}:{localName:e}]}function Ar(t,e,n={}){let o=null,s=false,a=()=>n.onChange?.(r()),r=()=>({revision:e.revision(),canUndo:e.canUndo(),canRedo:e.canRedo(),lastRejection:o}),c=u=>{s=true;let h=m.state.tr.replaceWith(0,m.state.doc.content.size,u.content);h.setMeta("addToHistory",false),m.dispatch(h),s=false;},d=u=>()=>(u()&&(c(e.projectDoc()),a()),true),m=new prosemirrorView.EditorView(t,{state:prosemirrorState.EditorState.create({doc:e.projectDoc(),plugins:[prosemirrorKeymap.keymap({...prosemirrorCommands.baseKeymap,Home:prosemirrorCommands.selectTextblockStart,End:prosemirrorCommands.selectTextblockEnd,"Mod-z":d(()=>e.undo()!==null),"Mod-y":d(()=>e.redo()!==null),"Shift-Mod-z":d(()=>e.redo()!==null),"Mod-b":(u,h)=>g(u,h,"b"),"Mod-i":(u,h)=>g(u,h,"i"),"Mod-u":(u,h)=>g(u,h,"u",{val:"single"})})]}),editable:()=>e.editable,handleDOMEvents:{keydown:u=>(p(u),false),beforeinput:(u,h)=>{let O=h;if(u.composing)return false;p(u);let P=O.inputType;if(P==="insertText"&&O.data!=null){O.preventDefault();let{from:R,to:b}=u.state.selection;return u.dispatch(u.state.tr.insertText(O.data,R,b)),true}if(P==="deleteContentBackward"){O.preventDefault();let{from:R,empty:b}=u.state.selection;return b?R>0?u.dispatch(u.state.tr.delete(R-1,R)):prosemirrorCommands.joinBackward(u.state,u.dispatch):prosemirrorCommands.deleteSelection(u.state,u.dispatch),true}if(P==="deleteContentForward"){O.preventDefault();let{from:R,to:b,empty:v}=u.state.selection;return v?b<u.state.doc.content.size?u.dispatch(u.state.tr.delete(R,R+1)):prosemirrorCommands.joinForward(u.state,u.dispatch):prosemirrorCommands.deleteSelection(u.state,u.dispatch),true}return P==="insertParagraph"?(O.preventDefault(),prosemirrorCommands.splitBlock(u.state,u.dispatch),true):false},compositionstart:()=>(e.beginComposition(),false),compositionend:()=>(e.endComposition(),a(),false)},dispatchTransaction(u){let h=m.state.apply(u);if(s||!u.docChanged){m.updateState(h);return}let O=e.applyPmDoc(h.doc);if(O.rejected){o=String(O.reason??"rejected"),m.updateState(h),c(e.projectDoc()),a();return}o=null,m.updateState(O.committed&&e.lastCommitWasStructural()?x(h):h),a();}});function p(u){if(u.composing||s)return;let h=u.dom.ownerDocument.getSelection(),O=h?.anchorNode,P=h?.focusNode;if(!(!h||!O||!P)&&!(!u.dom.contains(O)||!u.dom.contains(P)))try{let R=u.posAtDOM(O,h.anchorOffset),b=u.posAtDOM(P,h.focusOffset),v=u.state.selection;if(v.anchor===R&&v.head===b)return;let N=prosemirrorState.TextSelection.create(u.state.doc,R,b);u.dispatch(u.state.tr.setSelection(N).setMeta("addToHistory",!1));}catch{}}function x(u){let h=e.paragraphIds(),O=u.tr,P=false,R=0;return u.doc.forEach((b,v)=>{let N=h[R];R+=1,!(b.type.name!=="paragraph"||N===void 0)&&b.attrs.nodeId!==N&&(O=O.setNodeMarkup(v,void 0,{...b.attrs,nodeId:N}),P=true);}),P?u.apply(O.setMeta("addToHistory",false)):u}function g(u,h,O,P){let R=E.marks.runProps;if(!h)return true;let{from:b,to:v,empty:N}=u.selection;if(N)return true;let T=u.doc.resolve(b).marks().find(V=>V.type===R)?.attrs.props??[],C=Cr(T,O,P),M=u.tr;return M.removeMark(b,v,R),C.length>0&&M.addMark(b,v,R.create({props:C})),h(M),true}return {view:m,state:r,undo:()=>d(()=>e.undo()!==null)(),redo:()=>d(()=>e.redo()!==null)(),toggleRunProperty(u,h){g(m.state,m.dispatch.bind(m),u,h);},destroy:()=>m.destroy()}}exports.a=E;exports.b=Ue;exports.c=oe;exports.d=_;exports.e=X;exports.f=Je;exports.g=zo;exports.h=Ge;exports.i=et;exports.j=Pr;exports.k=Sr;exports.l=Ar;
|