@docx-editor.dev/core 2.11.0 → 2.12.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 (109) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.cts +5 -5
  3. package/dist/automation.d.ts +5 -5
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.cts +8 -8
  7. package/dist/binding.d.ts +8 -8
  8. package/dist/binding.js +1 -1
  9. package/dist/{chunk-EJATEGJZ.cjs → chunk-3JON7JMD.cjs} +1 -1
  10. package/dist/{chunk-GRDFEH5Q.cjs → chunk-5V6FNKBE.cjs} +1 -1
  11. package/dist/chunk-BXRVGHTY.cjs +18 -0
  12. package/dist/chunk-BXTTPJSH.js +5 -0
  13. package/dist/chunk-ILTZTY3K.cjs +10 -0
  14. package/dist/chunk-IUM7FZPA.js +2 -0
  15. package/dist/chunk-JWZG4QJ5.cjs +2 -0
  16. package/dist/chunk-JXZYDBKU.cjs +19 -0
  17. package/dist/chunk-KBOOIC2Q.js +19 -0
  18. package/dist/chunk-L6XZTLPS.js +10 -0
  19. package/dist/chunk-L7OR5TJK.cjs +5 -0
  20. package/dist/chunk-MHQNR2OU.js +2 -0
  21. package/dist/chunk-MLGPISGH.js +1 -0
  22. package/dist/chunk-NJXQABQU.js +18 -0
  23. package/dist/chunk-TKEGK4GQ.cjs +2 -0
  24. package/dist/chunk-VGFMPWND.js +2 -0
  25. package/dist/{chunk-BP7ANXGA.js → chunk-W77HJGYX.js} +1 -1
  26. package/dist/{chunk-WPQMPHNR.cjs → chunk-XCFM3G5L.cjs} +1 -1
  27. package/dist/collaboration/replication.cjs +1 -1
  28. package/dist/collaboration/replication.d.cts +3 -3
  29. package/dist/collaboration/replication.d.ts +3 -3
  30. package/dist/collaboration/replication.js +1 -1
  31. package/dist/collaboration.d.cts +3 -3
  32. package/dist/collaboration.d.ts +3 -3
  33. package/dist/contracts/editor.d.cts +7 -7
  34. package/dist/contracts/editor.d.ts +7 -7
  35. package/dist/contracts/interaction.d.cts +7 -7
  36. package/dist/contracts/interaction.d.ts +7 -7
  37. package/dist/contracts/modules.d.cts +7 -7
  38. package/dist/contracts/modules.d.ts +7 -7
  39. package/dist/{custom-node-writes-JfTn-Sy6.d.ts → custom-node-writes-CcNeHH5C.d.ts} +2 -2
  40. package/dist/{custom-node-writes-CwkYRw3V.d.cts → custom-node-writes-D4rMJIES.d.cts} +2 -2
  41. package/dist/{editor-C8edZgy5.d.cts → editor-B76SEMZw.d.cts} +3 -3
  42. package/dist/{editor-BogcVHXk.d.ts → editor-BcdsPdbY.d.ts} +3 -3
  43. package/dist/editor.cjs +1 -1
  44. package/dist/editor.d.cts +56 -23
  45. package/dist/editor.d.ts +56 -23
  46. package/dist/editor.js +1 -1
  47. package/dist/{index-BNv-ZLQP.d.ts → index-BYTvklN5.d.ts} +12 -12
  48. package/dist/{index-Dn0lOp9Z.d.cts → index-CDGhPib1.d.cts} +12 -12
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.d.cts +15 -15
  51. package/dist/index.d.ts +15 -15
  52. package/dist/index.js +1 -1
  53. package/dist/layout.cjs +1 -1
  54. package/dist/layout.d.cts +29 -18
  55. package/dist/layout.d.ts +29 -18
  56. package/dist/layout.js +1 -1
  57. package/dist/{note-properties-BmoSdyKS.d.ts → note-properties-Bx7rXruA.d.ts} +1 -1
  58. package/dist/{note-properties-BvGfHk5e.d.cts → note-properties-zQ8w04en.d.cts} +1 -1
  59. package/dist/{omml-equation-Ciq5rgb7.d.ts → omml-equation-69O1Pd8G.d.ts} +1 -1
  60. package/dist/{omml-equation-CqQOt_dD.d.cts → omml-equation-BmV51rim.d.cts} +1 -1
  61. package/dist/output.cjs +1 -1
  62. package/dist/output.d.cts +6 -6
  63. package/dist/output.d.ts +6 -6
  64. package/dist/output.js +1 -1
  65. package/dist/{protocol-Ckl7hWsv.d.ts → protocol-DC7ueVuo.d.ts} +2 -2
  66. package/dist/{protocol-BB-WP3zk.d.cts → protocol-FTXtrAIT.d.cts} +2 -2
  67. package/dist/{review-items-CkYyXhXM.d.ts → review-items-B78OsJU2.d.ts} +1 -1
  68. package/dist/{review-items-BdeLNRi2.d.cts → review-items-C-2WQdEb.d.cts} +1 -1
  69. package/dist/{review-reads-BOLSBm5w.d.cts → review-reads-CbBQlb-n.d.cts} +2 -2
  70. package/dist/{review-reads-Crf0Xn42.d.ts → review-reads-UexYBp-m.d.ts} +2 -2
  71. package/dist/{revision-projection-C2S8PSQm.d.cts → revision-projection-6u8lae9J.d.cts} +1 -1
  72. package/dist/{revision-projection-Ae2CWa8E.d.ts → revision-projection-B2v9U3qx.d.ts} +1 -1
  73. package/dist/{semantic-cell-selection-DdmoxC-y.d.ts → semantic-cell-selection-DsYz2Vg3.d.ts} +4 -4
  74. package/dist/{semantic-cell-selection-C0OFD4D9.d.cts → semantic-cell-selection-nEE7E3Z8.d.cts} +4 -4
  75. package/dist/{semantic-interaction-COyhZ9WH.d.ts → semantic-interaction-C00BpIyC.d.ts} +1 -1
  76. package/dist/{semantic-interaction-Cs2jErnt.d.cts → semantic-interaction-DiOX0FIH.d.cts} +1 -1
  77. package/dist/{semantic-paint-UHaj3sBY.d.cts → semantic-paint-Cc11nrDL.d.cts} +2 -2
  78. package/dist/{semantic-paint-vA-oLSdV.d.ts → semantic-paint-ofuoBsYo.d.ts} +2 -2
  79. package/dist/{semantic-records-5AOQJmLX.d.cts → semantic-records-CRG1r6-a.d.cts} +3 -3
  80. package/dist/{semantic-records-9xhwbJ23.d.ts → semantic-records-CzI0ZEuR.d.ts} +3 -3
  81. package/dist/{shaped-measurer-vzsY88oK.d.ts → shaped-measurer-CkOGZQn9.d.ts} +1 -1
  82. package/dist/{shaped-measurer-NeF2mPSu.d.cts → shaped-measurer-CneACGcP.d.cts} +1 -1
  83. package/dist/store.cjs +1 -1
  84. package/dist/store.d.cts +19 -13
  85. package/dist/store.d.ts +19 -13
  86. package/dist/store.js +1 -1
  87. package/dist/{tree-op-types-BPyXNxyL.d.cts → tree-op-types-CA7qgAUF.d.cts} +42 -9
  88. package/dist/{tree-op-types-DnzAOnc9.d.ts → tree-op-types-HKfUzt_-.d.ts} +42 -9
  89. package/dist/{tree-package-fragment-BjZ3RWAS.d.cts → tree-package-fragment-Cz-v-0B3.d.cts} +2 -2
  90. package/dist/{tree-package-fragment-CDER0G3B.d.ts → tree-package-fragment-oJZX_5iN.d.ts} +2 -2
  91. package/dist/{tree-session-contract-DhdsFT_z.d.ts → tree-session-contract-BPDLrEPX.d.ts} +5 -5
  92. package/dist/{tree-session-contract-BF2FVBOM.d.cts → tree-session-contract-Cbl87xa8.d.cts} +5 -5
  93. package/dist/{tree-store-CNZ3O83s.d.ts → tree-store-B7hd6cEa.d.ts} +1 -1
  94. package/dist/{tree-store-DfZi7FqY.d.cts → tree-store-BenW0Mg_.d.cts} +1 -1
  95. package/package.json +2 -2
  96. package/dist/chunk-34BNQUD4.js +0 -10
  97. package/dist/chunk-5AVHO75P.cjs +0 -19
  98. package/dist/chunk-6HMSC7UV.js +0 -2
  99. package/dist/chunk-76Y3Y45J.cjs +0 -2
  100. package/dist/chunk-CRZR6K5Z.js +0 -19
  101. package/dist/chunk-GWV65NQW.cjs +0 -10
  102. package/dist/chunk-GXLZCXEH.js +0 -2
  103. package/dist/chunk-JUQOPVSK.cjs +0 -2
  104. package/dist/chunk-LAETEBHD.js +0 -1
  105. package/dist/chunk-M6Z3KFXM.cjs +0 -5
  106. package/dist/chunk-UQFOYZJO.cjs +0 -18
  107. package/dist/chunk-WXQ245MQ.js +0 -18
  108. package/dist/chunk-WZHIFNSU.js +0 -5
  109. package/dist/chunk-X7A5XART.js +0 -2
@@ -1,2 +0,0 @@
1
- import {c,d,p,f,k,j,i,Ge as Ge$1,Wg,Me as Me$1,Wb,Ja,Xb,N,Ma,we as we$1,w as w$1,ma,ca}from'./chunk-34BNQUD4.js';var Gt=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Kt=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,qt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function ut(e){return Kt.test(e)||qt.test(e)}function oe(e,t){if(!ut(e))throw new Error(`invalid ${t??"registry"} id ${JSON.stringify(e)}: must be reverse-domain (dev.docx-editor.core.x) or package-owned (@scope/pkg#kind/name)`)}var Yt=/^(\d+)\.(\d+)\.(\d+)$/;function M(e){let t=Yt.exec(e);if(!t)throw new Error(`invalid semantic version: ${JSON.stringify(e)}`);return {major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function re(e,t){return e.major!==t.major?e.major<t.major?-1:1:e.minor!==t.minor?e.minor<t.minor?-1:1:e.patch!==t.patch?e.patch<t.patch?-1:1:0}function ie(e,t){let n=M(e),o=t.trim();if(o==="*")return true;if(o.startsWith("^")){let r=M(o.slice(1));return re(n,r)<0?false:r.major>0?n.major===r.major:r.minor>0?n.major===0&&n.minor===r.minor:n.major===0&&n.minor===0}if(o.includes(" ")){let r=o.split(/\s+/);if(r.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let s=true;for(let i of r){let a=i.startsWith(">=")?">=":i.startsWith("<")?"<":null;if(!a)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let l=M(i.slice(a.length)),c=re(n,l);a===">="?s=s&&c>=0:s=s&&c<0;}return s}return re(n,M(o))===0}var b=class extends Error{constructor(n,o,r=[]){super(o);this.code=n;this.responsible=r;this.name="RegistryError";}code;responsible},we=(e,t)=>`${e}:${t}`;function Xt(e,t={}){let n=new Map;for(let c of e){if(oe(c.id,"extension"),ft(c.version,c.id),n.has(c.id))throw new b("duplicate-extension",`duplicate extension id ${c.id}`,[c.id]);n.set(c.id,c);for(let p of c.contributions)oe(p.id,p.kind),ft(p.version,`${c.id} \u2192 ${p.id}`),p.replaces&&Zt(p.replaces.targetRange,`${c.id} \u2192 replaces ${p.replaces.targetId}`);}for(let c of e){for(let p of c.dependencies??[])if(!n.has(p))throw new b("missing-dependency",`${c.id} requires missing extension ${p}`,[c.id,p]);for(let p of c.conflicts??[])if(n.has(p)){let h=[c.id,p].sort();throw new b("conflict",`extensions ${h[0]} and ${h[1]} conflict`,h)}}Qt(n);let o=new Set(t.availablePorts??[]);for(let c of e)for(let p of c.contributions)p.kind==="runtimePort"&&o.add(p.id);for(let c of e)for(let p of c.requiredPorts??[])if(!o.has(p))throw new b("missing-port",`${c.id} requires unavailable port ${p}`,[c.id,p]);let r=new Map,s=new Map,i=new Map;for(let c of e)for(let p of c.contributions){let h=we(p.kind,p.id);if(p.replaces){let x=we(p.kind,p.replaces.targetId),R=i.get(x)??[];R.push({ext:c.id,c:p}),i.set(x,R);continue}if(s.has(h)){let x=[r.get(h),c.id].sort();throw new b("id-collision",`${p.kind} id ${p.id} registered by both ${x[0]} and ${x[1]}`,x)}s.set(h,p),r.set(h,c.id);}let a=new Map(s);for(let[c,p]of i){let h=s.get(c);if(!h){let v=p[0];throw new b("replacement-target-missing",`${v.ext} replaces missing target ${v.c.replaces.targetId}`,[v.ext,v.c.replaces.targetId])}let x=h.replaceable??{kind:"none"};for(let{ext:v,c:k}of p){if(!ie(h.version,k.replaces.targetRange))throw new b("replacement-version-mismatch",`${v} replaces ${k.replaces.targetId}@${h.version} outside range ${k.replaces.targetRange}`,[v,k.replaces.targetId]);if(x.kind==="none")throw new b("unauthorized-replacement",`${k.replaces.targetId} does not authorize replacement (attempted by ${v})`,[v,k.replaces.targetId])}let R=Jt(h,p);a.set(c,R);}return {extensions:n,contributions:a,get:(c,p)=>a.get(we(c,p))}}function Jt(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let r=[...t].sort((a,l)=>(l.c.replaces.priority??0)-(a.c.replaces.priority??0)),s=r[0].c.replaces.priority??0,i=r.filter(a=>(a.c.replaces.priority??0)===s);if(i.length>1){let a=i.map(l=>l.ext).sort();throw new b("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${a.join(", ")}`,a)}return r[0].c}let o=t.map(r=>r.ext).sort();throw new b("ambiguous-replacement",`multiple replacers of ${e.id}: ${o.join(", ")}`,o)}function Qt(e){let r=new Map,s=[],i=a=>{r.set(a,1),s.push(a);let l=[...e.get(a)?.dependencies??[]].sort();for(let c of l){let p=r.get(c)??0;if(p===1){let h=s.indexOf(c),x=[...s.slice(h),c];throw new b("dependency-cycle",`dependency cycle: ${x.join(" -> ")}`,x)}p===0&&i(c);}s.pop(),r.set(a,2);};for(let a of [...e.keys()].sort())(r.get(a)??0)===0&&i(a);}function ft(e,t){try{M(e);}catch{throw new b("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Zt(e,t){try{ie("0.0.0",e);}catch{throw new b("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var L=class extends Error{constructor(t){super(t),this.name="BudgetError";}},K=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new p(`${t}.budget`,n);}label;capacity;used;children=new Set;activeReservations=0;cleanups=[];disposed=false;carveAmount=0;parent;get inUse(){return this.used.current}get available(){return this.used.remaining}get isDisposed(){return this.disposed}reserve(t){this.assertLive(),this.used.add(t),this.activeReservations+=1;let n=false,o=this;return {amount:t,get released(){return n},release(){n||(n=true,o.used.release(t),o.activeReservations-=1);}}}child(t,n){this.assertLive(),this.used.add(n);let o=new e(t,n);return o.parent=this,o.carveAmount=n,this.children.add(o),o}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new L(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new L(`${this.label}: cannot release with ${this.activeReservations} reservation(s) outstanding`);let t=[];for(let n=this.cleanups.length-1;n>=0;n--)try{this.cleanups[n]();}catch(o){t.push(o);}if(this.disposed=true,this.parent&&(this.parent.children.delete(this),this.parent.used.release(this.carveAmount),this.parent=void 0),t.length>0)throw new L(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new L(`${this.label}: budget already released`)}};var ae=class extends Error{constructor(n,o){super(o?`cancelled: ${o}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},q=class{_cancelled=false;_phase="pre-publication";_reason;cancel(t){this._cancelled=true,t!==void 0&&(this._reason=t);}markPublished(){this._phase="post-publication";}get isCancelled(){return this._cancelled}get phase(){return this._phase}get isPublished(){return this._phase==="post-publication"}get derivedOnly(){return this._cancelled&&this._phase==="post-publication"}get token(){let t=this;return {get isCancelled(){return t._cancelled},get phase(){return t._phase},get derivedOnly(){return t.derivedOnly},checkpoint(){if(t._cancelled)throw new ae(t.derivedOnly,t._reason)}}}};var se=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},ke=class{ports=new Map;provide(t,n){return this.ports.set(t,n),this}has(t){return this.ports.has(t)}resolve(t){if(!this.ports.has(t))throw new se(t);return this.ports.get(t)}missing(t){return t.filter(n=>!this.ports.has(n))}availablePorts(){return [...this.ports.keys()]}clock(){return this.resolve(f.clock)}identity(){return this.resolve(f.identity)}},Ne=class{constructor(t=0,n=1){this.step=n;this.t=t;}step;t;now(){let t=this.t;return this.t+=this.step,t}},Te=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function en(e){let t=k(e.limits),n=Object.freeze({...e.config??{}}),o=e.capacity??t.maxDecompressedBytes,r=e.id??"op",s={id:r,limits:t,config:n,ports:e.ports,budget:new K(`op:${r}`,o),cancellation:new q};return Object.freeze(s)}function tn(e){e.budget.dispose();}var _e=Object.freeze({maxRecursionDepth:{unit:"depth",phase:"xml-parse"},maxElementCount:{unit:"count",phase:"xml-parse"},maxPartCount:{unit:"count",phase:"package-read"},maxDecompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressionRatio:{unit:"ratio",phase:"package-read"},maxChunkBytes:{unit:"bytes",phase:"package-read"},maxPaginationPasses:{unit:"passes",phase:"layout"},maxQueueDepth:{unit:"count",phase:"output"}}),yt=Object.keys(_e);function nn(e,t){return new p(`${_e[t].phase}:${t}`,e[t])}var Pe=class{counter;current=0;peak=0;constructor(t){this.counter=new p("memory",t);}allocate(t){this.counter.add(t),this.current+=t,this.current>this.peak&&(this.peak=this.current);}free(t){this.counter.release(t),this.current=Math.max(0,this.current-t);}get currentBytes(){return this.current}get peakBytes(){return this.peak}reset(){this.counter.release(this.current),this.current=0;}};function on(){for(let e of yt){let t=j[e],n=i[e];if(!Number.isFinite(t)||t<=0)throw new Error(`default ${e} must be finite > 0`);if(!Number.isFinite(n)||n<=0)throw new Error(`ceiling ${e} must be finite > 0`);if(t>n)throw new Error(`default ${e} exceeds ceiling`)}}function Y(e,t=new Set){let n=new WeakSet,o=r=>{if(r===null)return "null";let s=typeof r;if(s==="boolean")return r?"true":"false";if(s==="number"){let i=r;if(!Number.isFinite(i))throw new Error(`non-finite number is not comparable: ${i}`);return Object.is(i,-0)?"0":String(i)}if(s==="string")return JSON.stringify(r);if(s==="bigint")return `${r.toString()}n`;if(Array.isArray(r))return `[${r.map(o).join(",")}]`;if(s==="object"){let i=r;if(n.has(i))throw new Error("cannot canonicalize a cyclic structure");n.add(i);let l=Object.keys(i).filter(c=>!t.has(c)).sort().map(c=>`${JSON.stringify(c)}:${o(i[c])}`).join(",");return n.delete(i),`{${l}}`}throw new Error(`unsupported value type in comparator input: ${s}`)};return o(e)}function Ae(e,t){let n=Y(e,t),o=0xcbf29ce484222325n,r=0x100000001b3n,s=0xffffffffffffffffn;for(let i=0;i<n.length;i++)o^=BigInt(n.charCodeAt(i)),o=o*r&s;return o.toString(16).padStart(16,"0")}var w="dev.docx-editor.core.comparator",$e={authoredState:{id:`${w}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${w}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${w}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${w}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${w}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${w}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${w}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${w}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${w}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${w}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Me(e,t,n,o={}){let r=$e[e];switch(r.mode){case "sync-optimization-only":throw new Error(`${r.id} is not an equivalence basis (${r.note})`);case "tolerance":{if(o.epsilon===void 0)throw new Error(`${r.id} requires an explicit epsilon`);return {equal:ht(t,n,o.epsilon)}}case "exact":case "canonical-exact":{let s=r.mode==="canonical-exact"?new Set(r.ephemera):new Set,i=Y(t,s),a=Y(n,s);return i===a?{equal:true}:{equal:false,left:i,right:a}}}}function Le(e,t){let n=$e[e];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let o=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return Ae(t,o)}function ht(e,t,n){return typeof e=="number"&&typeof t=="number"?Number.isFinite(e)&&Number.isFinite(t)&&Math.abs(e-t)<=n:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((o,r)=>ht(o,t[r],n)):false}var xt=new Set([...c,...d]),gt=/^[0-9a-f]{16}$/,rn=/^[0-9a-f]*$/;function Fe(e){let t=[],n=r=>t.push(r);e.formatVersion!==1&&n(`unsupported formatVersion ${e.formatVersion}`),e.documentId||n("documentId is required"),e.source.kind==="docx"&&!/^[0-9a-f]{64}$/.test(e.source.sha256)&&n("docx source requires a 64-hex sha256");let o=-1;e.steps.forEach((r,s)=>{let i=`step[${s}]`;xt.has(r.origin)||n(`${i}: unknown origin ${r.origin}`),(!Number.isInteger(r.baseRevision)||r.baseRevision<0)&&n(`${i}: baseRevision must be a non-negative integer`),r.baseRevision<o&&n(`${i}: baseRevision regressed below ${o}`);let a=r.expect;a.outcome==="applied"?(a.committedRevision===void 0?n(`${i}: applied step needs committedRevision`):a.committedRevision<=r.baseRevision?n(`${i}: committedRevision ${a.committedRevision} must exceed baseRevision ${r.baseRevision}`):o=a.committedRevision,a.modelChange&&an(a.modelChange,i,n)):(a.committedRevision!==void 0&&n(`${i}: ${a.outcome} step must not commit a revision`),a.authoredStateHash!==void 0&&n(`${i}: ${a.outcome} step must not change authored state`)),a.authoredStateHash!==void 0&&!gt.test(a.authoredStateHash)&&n(`${i}: authoredStateHash must be 16-hex`),a.outputHash!==void 0&&!gt.test(a.outputHash)&&n(`${i}: outputHash must be 16-hex`);});for(let r of [...e.snapshots??[],...e.updates??[]])r.documentId!==e.documentId&&n(`envelope documentId ${r.documentId} != ${e.documentId}`),rn.test(r.bytesHex)||n("envelope bytesHex must be hex"),r.bytesHex.length!==r.byteLength*2&&n(`envelope byteLength ${r.byteLength} disagrees with ${r.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function an(e,t,n){xt.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function sn(e,t){let n=Fe(e);if(!n.valid)return {ok:false,mismatches:n.errors};let o=[];return t.init(e),e.steps.forEach((r,s)=>{let i=`step[${s}]`,a=t.applyStep(r),l=r.expect;if(a.outcome!==l.outcome){o.push(`${i}: outcome ${a.outcome} != expected ${l.outcome}`);return}if(l.outcome==="applied"&&(a.committedRevision!==l.committedRevision&&o.push(`${i}: revision ${a.committedRevision} != expected ${l.committedRevision}`),l.authoredStateHash!==void 0))if(a.authoredState===void 0)o.push(`${i}: store returned no authored state to hash`);else {Me("authoredState",a.authoredState,a.authoredState).equal||o.push(`${i}: authored state is not self-consistent`);let p=Rt(a.authoredState);p!==l.authoredStateHash&&o.push(`${i}: authoredStateHash ${p} != expected ${l.authoredStateHash}`);}}),{ok:o.length===0,mismatches:o}}function Rt(e){return Le("authoredState",e)}var F="http://schemas.openxmlformats.org/officeDocument/2006/relationships",ln="http://schemas.openxmlformats.org/package/2006/relationships",cn="http://schemas.openxmlformats.org/drawingml/2006/main",Et="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",vt="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",St="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",It="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",Ct="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",wt="application/vnd.openxmlformats-package.relationships+xml",De=`${F}/styles`,Be=`${F}/numbering`,kt=`${F}/footnotes`,Nt=`${F}/endnotes`,Tt=`${F}/officeDocument`,dn=`${F}/theme`;function I(e){return e.kind!=="textValue"}function Ot(e,t){return {...e,children:t}}function P(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)P(n,t);}var pn=new Set(["pStyle","rStyle","tblStyle"]);function Ue(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue"&&pn.has(o.localName)&&o.namespaceUri===ca){let r=we$1(o,"val");r&&t.add(r);}});}function Ve(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue"&&o.localName==="numId"&&o.namespaceUri===ca){let r=we$1(o,"val");r&&t.add(r);}});}function ce(e,t){for(let n of e)P(n,o=>{if(o.kind!=="textValue")for(let r of o.attributes)r.namespaceUri===F&&r.value.length>0&&t.add(r.value);});}function je(e,t){let n=new Set;for(let o of e)P(o,r=>{if(r.kind!=="textValue"&&r.kind==="noteReference"&&r.localName===t){let s=we$1(r,"id");s!==void 0&&n.add(s);}});return n}function mn(e,t){for(let n of Wb(e,t)){if(n.type!==De||n.targetMode==="External")continue;let o=w$1(n.ownerPart,n.rawTarget);if(o.ok)return e.parts.get(o.partName)??null}return e.parts.get("/word/styles.xml")??null}function Pt(e,t,n){for(let o of Wb(e,t)){if(o.type!==n||o.targetMode==="External")continue;let r=w$1(o.ownerPart,o.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return null}function _t(e,t){let n=mn(e,t),o=new Map,r=[],s=null;if(n&&I(n.root))for(let i of n.root.children){if(!I(i))continue;if(i.localName==="docDefaults"&&i.namespaceUri===ca){s=i;continue}if(i.localName!=="style"||i.namespaceUri!==ca)continue;let a=we$1(i,"styleId");a&&o.set(a,i),(we$1(i,"default")==="1"||we$1(i,"default")==="true")&&r.push(i);}return {part:n,byId:o,defaults:r,docDefaults:s}}var un=new Set(["basedOn","link","next"]);function ze(e,t){let n=new Set,o=[...t];for(let i of e.defaults){let a=we$1(i,"styleId");a&&o.push(a);}let r=[];for(;o.length>0;){let i=o.pop();if(n.has(i))continue;n.add(i);let a=e.byId.get(i);if(a){r.push(a);for(let l of a.children)if(I(l)&&un.has(l.localName)&&l.namespaceUri===ca){let c=we$1(l,"val");c&&o.push(c);}}}if(!e.part||!I(e.part.root))return r;let s=new Map;return e.part.root.children.forEach((i,a)=>s.set(i,a)),r.sort((i,a)=>(s.get(i)??0)-(s.get(a)??0))}function At(e,t,n){let o=Pt(e,t,Be)??e.parts.get("/word/numbering.xml")??null;if(!o||!I(o.root)||n.size===0)return {part:o,nums:[],abstracts:[]};let r=[],s=new Set;for(let a of o.root.children){if(!I(a)||a.localName!=="num"||a.namespaceUri!==ca)continue;let l=we$1(a,"numId");if(!(!l||!n.has(l))){r.push(a);for(let c of a.children)if(I(c)&&c.localName==="abstractNumId"){let p=we$1(c,"val");p&&s.add(p);}}}let i=[];for(let a of o.root.children){if(!I(a)||a.localName!=="abstractNum"||a.namespaceUri!==ca)continue;let l=we$1(a,"abstractNumId");l&&s.has(l)&&i.push(a);}return {part:o,nums:r,abstracts:i}}var le={latin:null,eastAsia:null,cs:null};function $t(e,t){let n=Pt(e,t,dn);if(!n)return {major:le,minor:le};let o={major:{...le},minor:{...le}};return P(n.root,r=>{if(r.kind==="textValue"||r.namespaceUri!==cn||r.localName!=="majorFont"&&r.localName!=="minorFont")return;let s=r.localName==="majorFont"?o.major:o.minor;for(let i of r.children){if(!I(i))continue;let a=we$1(i,"typeface");a&&(i.localName==="latin"?s.latin=a:i.localName==="ea"?s.eastAsia=a:i.localName==="cs"&&(s.cs=a));}}),{major:o.major,minor:o.minor}}function fn(e,t){let n=t.startsWith("major")?e.major:e.minor;return t.endsWith("EastAsia")?n.eastAsia??n.latin:t.endsWith("Bidi")?n.cs??n.latin:n.latin}var yn=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],bt=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function _(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===ca){let s=[],i=new Map;for(let a of e.attributes){let l=yn.find(([c])=>c===a.localName);if(l&&a.namespaceUri===ca){let c=fn(t,a.value);c&&i.set(l[1],c);continue}s.push(a);}for(let[a,l]of i)s.some(c=>c.localName===a)||s.push({kind:"genericExtension",namespaceUri:ca,localName:a,prefix:"w",value:l});n=s;}else e.attributes.some(s=>bt.has(s.localName)&&s.namespaceUri===ca&&e.attributes.some(i=>i.localName==="val"))&&(n=e.attributes.filter(s=>!(bt.has(s.localName)&&s.namespaceUri===ca)));let o=e.children.map(s=>_(s,t)),r=o.some((s,i)=>s!==e.children[i]);return n===e.attributes&&!r?e:{...e,attributes:n,children:o}}function Mt(e,t,n){return {id:e,name:e,contentType:t,root:n}}function Lt(e,t){if(e.root.kind==="document"){let o=e.root.children.find(s=>s.kind==="body"),r=o&&I(o)?Ot(o,t):{id:"fragment#body",kind:"body",namespaceUri:ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return Ot(e.root,[r])}let n={id:"fragment#body",kind:"body",namespaceUri:ca,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:ca,localName:"document",prefix:"w",namespaceBindings:I(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function X(e){let t=e.map(n=>{let o=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${N(n.id)}" Type="${N(n.type)}" Target="${N(n.rawTarget)}"${o}/>`}).join("");return `<Relationships xmlns="${ln}">${t}</Relationships>`}function Ft(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function Dt(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}var hn="http://schemas.openxmlformats.org/package/2006/content-types",gn=5e4;function A(e){return e.kind!=="textValue"}function z(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)z(n,t);return t}function de(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let o=de(n,t);if(o)return o}return null}function S(e,t){return {...e,children:t}}function H(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===ca}function xn(e){if(e.root.kind==="document"){let t=e.root.children.find(n=>n.kind==="body");return t&&A(t)?t:null}return A(e.root)?e.root:null}function Rn(e,t){return z(e).some(n=>t.has(n))}function On(e){let t=o=>{if(o.kind==="textValue")return o;if(H(o,"vMerge")){if(we$1(o,"val")==="restart")return o;let r=[...o.attributes.filter(s=>!(s.localName==="val"&&s.namespaceUri===ca)),{kind:"wmlVal",namespaceUri:ca,localName:"val",prefix:"w",value:"restart"}];return {...o,attributes:r}}if(H(o,"tc")||H(o,"tcPr")){let r=o.children.map(t);return S(o,r)}return o},n=e.children.map(t);return S(e,n)}function bn(e,t,n){let o=e.children.filter(l=>l.kind!=="textValue"&&H(l,"tr")),r=new Set(z(e).filter(l=>t.inRange.has(l)));if(r.size===0)return;let s=o.filter(l=>{let c=z(l);return c.length>0&&c.every(p=>t.covered.has(p))}),i=new Set(s.flatMap(l=>z(l)));if(s.length>0&&r.size===i.size&&[...r].every(l=>i.has(l))){let l=true,c=[];for(let p of e.children){if(!H(p,"tr")){c.push(p);continue}s.includes(p)&&(c.push(l?On(p):p),l=false);}n.push(S(e,c));return}for(let l of z(e)){if(!t.inRange.has(l))continue;let c=de(e,l);c&&n.push(c);}}function He(e,t,n){for(let o of e)if(A(o)){if(o.kind==="paragraph"){t.inRange.has(o.id)&&n.push(o);continue}if(t.fullBlocks.has(o.id)){n.push(o);continue}if(o.kind==="table"){bn(o,t,n);continue}if(o.kind==="contentControl"){let r=o.children.find(s=>s.kind==="contentControlContent");r&&A(r)&&He(r.children,t,n);continue}Rn(o,t.inRange)&&He(o.children,t,n);}}var En=new Set(["commentRangeStart","commentRangeEnd"]);function vn(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}function We(e){if(e.kind==="textValue")return e;if(En.has(e.localName)&&e.namespaceUri===ca||vn(e)||H(e,"sectPr"))return null;let t=false,n=[];for(let o of e.children){let r=We(o);if(r===null){t=true;continue}r!==o&&(t=true),n.push(r);}return t?S(e,n):e}function Sn(e){if(e.kind!=="run")return null;for(let t of e.children)if(t.kind==="fldChar"){let n=we$1(t,"fldCharType");return n==="begin"||n==="separate"||n==="end"?n:"begin"}return null}function In(e){return e.kind==="run"&&e.children.some(t=>t.kind==="instrText")}function Cn(e){let t=[],n=l=>{if(l.kind!=="textValue"){if(l.kind==="run"){let c=Sn(l);c?t.push({nodeId:l.id,type:c}):In(l)&&t.push({nodeId:l.id,type:"instr"});return}for(let c of l.children)n(c);}};for(let l of e)n(l);if(t.length===0)return e;let o=new Set,r=[],s=null,i=[];for(let l of t){if(l.type==="begin"){r.push({beginId:l.nodeId,separateId:null,instrIds:[]});continue}if(l.type==="separate"){let p=r[r.length-1];p?p.separateId=l.nodeId:s=l.nodeId;continue}if(l.type==="instr"){let p=r[r.length-1];p?p.instrIds.push(l.nodeId):s===null&&i.push(l.nodeId);continue}if(!r.pop()){o.add(l.nodeId),s!==null&&o.add(s);for(let p of i)o.add(p);s=null,i=[];}}for(let l of r){o.add(l.beginId),l.separateId!==null&&o.add(l.separateId);for(let c of l.instrIds)o.add(c);}s!==null&&o.add(s);for(let l of i)o.add(l);if(o.size===0)return e;let a=l=>{if(l.kind==="textValue")return l;if(o.has(l.id))return null;let c=[],p=false;for(let h of l.children){let x=a(h);if(x===null){p=true;continue}x!==h&&(p=true),c.push(x);}return p?S(l,c):l};return e.map(l=>a(l)).filter(l=>l!==null)}function Ge(e){if(e.kind==="textValue")return e.value.length;let t=0;for(let n of e.children)t+=Ge(n);return t}function wn(e,t){let n=[];for(let o of e.children){if(o.kind!=="contentControl"){n.push(o);continue}let r=t.get(o.id),s=Ge(o);if(r===void 0||s>=r){n.push(o);continue}if(s===0)continue;let i=o.children.find(a=>a.kind==="contentControlContent");i&&A(i)?n.push(...i.children):n.push(o);}return S(e,n)}function kn(e){let t=new Set,n=new Set,o=i=>{if(i.kind!=="textValue"){if(i.kind==="bookmarkStart"){let a=we$1(i,"id");a!==void 0&&t.add(a);}if(i.kind==="bookmarkEnd"){let a=we$1(i,"id");a!==void 0&&n.add(a);}for(let a of i.children)o(a);}};for(let i of e)o(i);let r=new Set([...t].filter(i=>n.has(i)));if(r.size===t.size&&r.size===n.size)return e;let s=i=>{if(i.kind==="textValue")return i;if(i.kind==="bookmarkStart"||i.kind==="bookmarkEnd"){let c=we$1(i,"id");return c!==void 0&&r.has(c)?i:null}let a=[],l=false;for(let c of i.children){let p=s(c);if(p===null){l=true;continue}p!==c&&(l=true),a.push(p);}return l?S(i,a):i};return e.map(i=>s(i)??i)}function Nn(e,t,n){let o=e.parts.get(t.partName);if(!o)return {ok:false,reason:"unknown-part"};if(t.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let r=t.paragraphIds[0],s=t.paragraphIds[t.paragraphIds.length-1],i=new Map;for(let d of [r,s]){let m=de(o.root,d);if(!m)return {ok:false,reason:"empty-range"};for(let u of m.children)u.kind==="contentControl"&&i.set(u.id,Ge(u));}let a=o,l=de(a.root,s);if(!l)return {ok:false,reason:"empty-range"};let c=Ge$1(l);if(t.endOffset<c){let d=Wg(a,{op:"deleteText",paragraphId:s,start:t.endOffset,end:c},{deferValidation:true});if(!d.ok)return {ok:false,reason:"trim-refused"};a=d.part;}if(t.startOffset>0){let d=Wg(a,{op:"deleteText",paragraphId:r,start:0,end:t.startOffset},{deferValidation:true});if(!d.ok)return {ok:false,reason:"trim-refused"};a=d.part;}let p=xn(a);if(!p)return {ok:false,reason:"unknown-part"};let h={inRange:new Set(t.paragraphIds),covered:new Set(t.coveredParagraphIds),fullBlocks:new Set(t.fullyCoveredBlockIds)},x=[];if(He(p.children,h,x),x.length===0)return {ok:false,reason:"empty-range"};if(x.length>gn)return {ok:false,reason:"resource-limit"};let R=x.map(d=>We(d)).filter(d=>d!==null).map(d=>d.kind!=="paragraph"||d.id!==r&&d.id!==s?d:wn(d,i));R=[...Cn(R)],R=[...kn(R)];let v=je(R,"footnoteReference"),k=je(R,"endnoteReference"),J=v.size>0?Me$1(e,"footnote"):null,Q=k.size>0?Me$1(e,"endnote"):null,Ke=(d,m)=>{if(!d||!A(d.root))return [];let u=[];for(let O of d.root.children){if(!A(O)||O.kind!=="note")continue;let E=we$1(O,"id"),g=we$1(O,"type");if(g==="separator"||g==="continuationSeparator"){u.push(O);continue}if(E!==void 0&&m.has(E)){let U=We(O);U&&A(U)&&u.push(U);}}return u},qe=Ke(J,v),Ye=Ke(Q,k),Bt=[...qe,...Ye],Xe=[...R,...Bt],Je=new Set;Ue(Xe,Je);let D=_t(e,e.mainDocumentPart),pe=ze(D,Je),me=new Set;Ve(Xe,me),Ve(pe,me);let C=At(e,e.mainDocumentPart,me),ue=new Set;Ue([...C.nums,...C.abstracts],ue);for(let d of [...C.nums,...C.abstracts])P(d,m=>{if(m.kind!=="textValue"&&(m.localName==="styleLink"||m.localName==="numStyleLink")&&m.namespaceUri===ca){let u=we$1(m,"val");u&&ue.add(u);}});let Ut=ze(D,ue).filter(d=>!pe.includes(d)),Vt=[...pe,...Ut],B=$t(e,e.mainDocumentPart),Qe=Vt.map(d=>_(d,B)),fe=D.docDefaults?_(D.docDefaults,B):null;R=R.map(d=>_(d,B));let ye=qe.map(d=>_(d,B)),he=Ye.map(d=>_(d,B)),Ze=new Set;ce(R,Ze);let et=Wb(e,o.name).filter(d=>Ze.has(d.id)),tt=new Map,nt=0,ot=d=>{let m=new Set;for(let u of d){if(u.targetMode==="External")continue;let O=w$1(u.ownerPart,u.rawTarget);if(!O.ok){m.add(u.id);continue}if((Xb(e,O.partName)??"").toLowerCase().startsWith("image/")&&n?.omitMedia!==true){let g=e.partBytes.get(O.partName)??e.partBytes.get(O.partName.replace(/^\//,""));g?(tt.set(O.partName,g),nt+=g.byteLength):m.add(u.id);continue}m.add(u.id);}return m},ge=ot(et),xe=(d,m)=>{if(d.kind==="textValue")return d;if(d.kind==="drawing"){let E=new Set;ce([d],E);for(let g of E)if(m.has(g))return null;return d}let u=[],O=false;for(let E of d.children){let g=xe(E,m);if(g===null){O=true;continue}g!==E&&(O=true),u.push(g);}return O?S(d,u):d};ge.size>0&&(R=R.map(d=>xe(d,ge)).filter(d=>d!==null));let jt=et.filter(d=>!ge.has(d.id)),rt=(d,m)=>{if(!d)return [];let u=new Set;ce(m,u);let O=Wb(e,d.name).filter(g=>u.has(g.id)),E=ot(O);if(E.size>0)for(let g=0;g<m.length;g+=1){let U=xe(m[g],E);U!==null&&(m[g]=U);}return O.filter(g=>!E.has(g.id))},it=rt(J,ye),at=rt(Q,he),T=new Map,st=[],W=(d,m,u)=>{T.set(d.slice(1),Ja(ma(Mt(d,m,u)))),st.push([d,m]);},Z=[...jt],lt=new Set(Z.map(d=>d.id)),ct=9001,ee=(d,m)=>{let u=Ft(lt,ct);ct+=1,lt.add(u),Z.push({ownerPart:"/word/document.xml",id:u,type:d,rawTarget:m,targetMode:"Internal",order:Z.length});},zt=Lt(a,R);if(W("/word/document.xml",Et,zt),D.part&&(Qe.length>0||fe)){let d=S(D.part.root,[...fe?[fe]:[],...Qe]);W("/word/styles.xml",vt,d),ee(De,"styles.xml");}if(C.part&&(C.nums.length>0||C.abstracts.length>0)){let d=S(C.part.root,[...C.abstracts.map(m=>_(m,B)),...C.nums]);W("/word/numbering.xml",St,d),ee(Be,"numbering.xml");}J&&ye.length>0&&(W("/word/footnotes.xml",It,S(J.root,ye)),ee(kt,"footnotes.xml"),it.length>0&&T.set("word/_rels/footnotes.xml.rels",Ja(X(it)))),Q&&he.length>0&&(W("/word/endnotes.xml",Ct,S(Q.root,he)),ee(Nt,"endnotes.xml"),at.length>0&&T.set("word/_rels/endnotes.xml.rels",Ja(X(at))));let Re=new Map;for(let[d,m]of tt){T.set(d.slice(1),m);let u=Dt(d);u&&!Re.has(u)&&Re.set(u,Xb(e,d)??"application/octet-stream");}T.set("word/_rels/document.xml.rels",Ja(X(Z))),T.set("_rels/.rels",Ja(X([{ownerPart:"/",id:"rId1",type:Tt,rawTarget:"word/document.xml",targetMode:"Internal",order:0}])));let Ht=[`<Default Extension="rels" ContentType="${wt}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...Re].map(([d,m])=>`<Default Extension="${N(d)}" ContentType="${N(m)}"/>`)].join(""),Wt=st.map(([d,m])=>`<Override PartName="${N(d)}" ContentType="${N(m)}"/>`).join("");return T.set("[Content_Types].xml",Ja(`<Types xmlns="${hn}">${Ht}${Wt}</Types>`)),{ok:true,bytes:Ma(T),lastMarkCovered:t.lastMarkCovered,blockCount:R.length,mediaBytes:nt}}
2
- export{Me as A,Le as B,Fe as C,sn as D,Rt as E,Nn as F,Gt as a,ut as b,oe as c,M as d,re as e,ie as f,b as g,Xt as h,L as i,K as j,ae as k,q as l,se as m,ke as n,Ne as o,Te as p,en as q,tn as r,_e as s,yt as t,nn as u,Pe as v,on as w,Y as x,Ae as y,$e as z};
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkGWV65NQW_cjs=require('./chunk-GWV65NQW.cjs'),fflate=require('fflate');function J(t){return t.kind!=="textValue"}function _(t,e){return t.kind!=="textValue"&&t.localName===e&&t.namespaceUri===chunkGWV65NQW_cjs.ca}function ne(t,e){for(let n of t)e(n),n.kind!=="textValue"&&ne(n.children,e);}function pe(t){if(t.kind==="textValue")return `T(${t.value})`;if(t.namespaceUri===chunkGWV65NQW_cjs.ca&&t.localName.startsWith("rsid"))return "";let e=t.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunkGWV65NQW_cjs.fa&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=t.children.map(pe).join("");return `E(${t.namespaceUri}:${t.localName}[${e}]{${n}})`}function et(t){return `S[${t.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${t.children.map(pe).join("")}`}function Ot(t){let e=[],n=new Map,r=new Set,a=null;if(t&&J(t.root))for(let i of t.root.children){if(!J(i))continue;if(_(i,"docDefaults")){a=i;continue}if(!_(i,"style"))continue;e.push(i);let o=chunkGWV65NQW_cjs.we(i,"styleId");o&&n.set(o,i);let s=i.children.find(d=>_(d,"name")),l=s?chunkGWV65NQW_cjs.we(s,"val"):void 0;l&&r.add(l);}return {part:t,styles:e,docDefaults:a,byId:n,names:r}}function xt(t,e,n){let r=new Map;if(!t)return r;let a=t.children.find(o=>_(o,e));if(!a||!J(a))return r;let i=a.children.find(o=>_(o,n));if(!i||!J(i))return r;for(let o of i.children)o.kind!=="textValue"&&r.set(o.localName,o);return r}function Qt(t,e,n,r){let a=e;for(let i=0;i<16&&a;i+=1){let o=t.byId.get(a);if(!o)return false;let s=o.children.find(d=>_(d,n));if(s&&J(s)&&s.children.some(d=>d.kind!=="textValue"&&d.localName===r))return true;let l=o.children.find(d=>_(d,"basedOn"));a=l?chunkGWV65NQW_cjs.we(l,"val"):void 0;}return false}function ni(t,e){for(let n of t.styles){if(chunkGWV65NQW_cjs.we(n,"type")!==e)continue;let r=chunkGWV65NQW_cjs.we(n,"default");if(r==="1"||r==="true")return chunkGWV65NQW_cjs.we(n,"styleId")}}function Pt(t,e){let n=t.children.find(r=>_(r,e));return n&&J(n)?n:null}var ri=new Map(["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"].map((t,e)=>[t,e])),oi=new Map(["rStyle","rFonts","b","bCs","i","iCs","caps","smallCaps","strike","dstrike","outline","shadow","emboss","imprint","noProof","snapToGrid","vanish","webHidden","color","spacing","w","kern","position","sz","szCs","highlight","u","effect","bdr","shd","fitText","vertAlign","rtl","cs","em","lang","eastAsianLayout","specVanish","oMath","rPrChange"].map((t,e)=>[t,e]));function Zt(t,e,n){let r=xt(e.docDefaults,"rPrDefault","rPr"),a=xt(n.docDefaults,"rPrDefault","rPr"),i=xt(e.docDefaults,"pPrDefault","pPr"),o=xt(n.docDefaults,"pPrDefault","pPr"),s=(p,y,f)=>{let g=ni(p,"paragraph"),O=g?p.byId.get(g):void 0;if(!O)return g;for(let[L,U]of [["rPr",y],["pPr",f]]){let S=Pt(O,L);if(S)for(let F of S.children)F.kind!=="textValue"&&U.set(F.localName,F);}return g};s(e,r,i),s(n,a,o);let l=new Map;for(let[p,y]of r){let f=a.get(p);(!f||pe(f)!==pe(y))&&l.set(p,y);}let d=new Map;for(let[p,y]of i){if(p==="sectPr")continue;let f=o.get(p);(!f||pe(f)!==pe(y))&&d.set(p,y);}if(l.size===0&&d.size===0)return t;let c=0,u=()=>`fragment#materialized-${c++}`,m=p=>{let y=f=>f.kind==="textValue"?{id:u(),kind:"textValue",value:f.value}:{...f,id:u(),children:f.children.map(y)};return y(p)},k=(p,y,f)=>{if(f.length===0)return p;let g=Pt(p,y);if(g){let L=y==="rPr"?oi:ri,U=[...g.children];for(let F of f){let V=F.kind==="textValue"?Number.MAX_SAFE_INTEGER:L.get(F.localName)??Number.MAX_SAFE_INTEGER,Z=U.length;for(let C=0;C<U.length;C+=1){let B=U[C];if(B.kind==="textValue")continue;let $=L.get(B.localName);if($!==void 0&&$>V){Z=C;break}}U.splice(Z,0,F);}let S={...g,children:U};return {...p,children:p.children.map(F=>F===g?S:F)}}let O={id:u(),kind:y==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunkGWV65NQW_cjs.ca,localName:y,prefix:"w",namespaceBindings:[],attributes:[],children:f};return {...p,children:[O,...p.children]}},h=p=>{let y=Pt(p,"pPr"),f=y?.children.find(S=>_(S,"pStyle")),g=f?chunkGWV65NQW_cjs.we(f,"val"):void 0,O=[];for(let[S,F]of d)y?.children.some(Z=>Z.kind!=="textValue"&&Z.localName===S)||g&&Qt(e,g,"pPr",S)||O.push(m(F));let L=S=>{if(S.kind==="textValue")return S;if(S.kind==="run"){let V=Pt(S,"rPr"),Z=V?.children.find($=>_($,"rStyle")),C=Z?chunkGWV65NQW_cjs.we(Z,"val"):void 0,B=[];for(let[$,G]of l)V?.children.some(E=>E.kind!=="textValue"&&E.localName===$)||C&&Qt(e,C,"rPr",$)||g&&Qt(e,g,"rPr",$)||B.push(m(G));return k(S,"rPr",B)}if(S.kind==="paragraphProperties"||S.kind==="runProperties")return S;let F=S.children.map(L);return F.some((V,Z)=>V!==S.children[Z])?{...S,children:F}:S};return L(k(p,"pPr",O))},P=p=>{if(p.kind==="textValue")return p;if(p.kind==="paragraph")return h(p);let y=p.children.map(P);return y.some((f,g)=>f!==p.children[g])?{...p,children:y}:p};return t.map(P)}function ai(t,e){return {...t,children:e}}function ii(t,e){return t.kind!=="textValue"&&t.localName===e&&t.namespaceUri===chunkGWV65NQW_cjs.ca}var si=new Set(["commentRangeStart","commentRangeEnd"]),li=new Set(["altChunk","subDoc"]);function di(t){return t.kind==="run"&&t.children.some(e=>e.kind==="commentReference")}var ci=new Set(["DDE","DDEAUTO","INCLUDE","INCLUDEPICTURE","INCLUDETEXT","IMPORT","LINK","DATABASE","AUTOTEXT","AUTOTEXTLIST","GOTOBUTTON","MACROBUTTON","PRINT","ADDIN"]);function ro(t){if(t===void 0)return false;let e=t.trim().replace(/^"+/,"").split(/\s+/,1)[0]??"";return ci.has(e.toUpperCase())}function mi(t){if(t.kind!=="run")return null;for(let e of t.children)if(e.kind==="fldChar"){let n=chunkGWV65NQW_cjs.we(e,"fldCharType");return n==="separate"||n==="end"?n:"begin"}return null}function ui(t){if(t.kind!=="run")return null;let e="",n=false;for(let r of t.children)if(r.kind==="instrText"){n=true;for(let a of r.children)a.kind==="textValue"&&(e+=a.value);}return n?e:null}function pi(t){let e=[],n=new Set,r=i=>{if(i.dangerous){for(let o of i.machinery)n.add(o);for(let o of i.instr)n.add(o);for(let o of i.preResult)n.add(o);}},a=i=>{if(i.kind!=="textValue"){if(i.kind==="run"){let o=mi(i);if(o==="begin"){e.push({dangerous:false,afterSeparate:false,machinery:[i.id],instr:[],preResult:[]});return}let s=e[e.length-1];if(s){if(o==="separate"){s.afterSeparate=true,s.machinery.push(i.id);return}if(o==="end"){s.machinery.push(i.id),e.pop(),r(s);return}let l=ui(i);if(l!==null){s.instr.push(i.id),ro(l)&&(s.dangerous=true);return}s.afterSeparate||s.preResult.push(i.id);return}return}for(let o of i.children)a(o);}};for(let i of t)a(i);for(;e.length>0;){let i=e.pop();i.dangerous=true,r(i);}return n}function fi(t,e){if(t.kind==="textValue")return t;if(t.namespaceUri===chunkGWV65NQW_cjs.ca&&(si.has(t.localName)||t.localName==="sectPr"||li.has(t.localName))||di(t)||e.has(t.id))return "drop";if(ii(t,"fldSimple")&&ro(chunkGWV65NQW_cjs.we(t,"instr")))return en(t.children,e);let n=en(t.children,e);return n.length===t.children.length&&n.every((r,a)=>r===t.children[a])?t:ai(t,n)}function en(t,e){let n=[];for(let r of t){let a=fi(r,e);a!=="drop"&&(Array.isArray(a)?n.push(...a):n.push(a));}return n}function tn(t){let e=pi(t);return en(t,e)}var oo="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function q(t,e,n,r){return {...t,attributes:t.attributes.map(a=>a.localName===n&&a.namespaceUri===e?{...a,value:r}:a)}}var gi=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),nn=chunkGWV65NQW_cjs.Te,fe=new Map;function Ue(t,e){let n=e.styleIds??fe,r=e.numIds??fe,a=e.relIds??fe,i=e.footnoteIds??fe,o=e.endnoteIds??fe,s=e.bookmarkIds??fe,l=e.sdtIds??fe,d=e.revisionIds??fe,c=e.docPrIds??fe,u=(m,k)=>{if(m.kind==="textValue")return m;let h=m;if(m.namespaceUri===chunkGWV65NQW_cjs.ca&&gi.has(m.localName)){let f=chunkGWV65NQW_cjs.we(m,"val"),g=f!==void 0?n.get(f):void 0;g!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"val",g));}if(_(m,"numId")){let f=chunkGWV65NQW_cjs.we(m,"val"),g=f!==void 0?r.get(f):void 0;g!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"val",g));}if(m.kind==="noteReference"){let f=m.localName==="footnoteReference"?i:o,g=chunkGWV65NQW_cjs.we(m,"id"),O=g!==void 0?f.get(g):void 0;O!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"id",O));}if(m.kind==="bookmarkStart"||m.kind==="bookmarkEnd"){let f=chunkGWV65NQW_cjs.we(m,"id"),g=f!==void 0?s.get(f):void 0;g!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"id",g));}if(_(m,"id")&&k==="sdtPr"){let f=chunkGWV65NQW_cjs.we(m,"val"),g=f!==void 0?l.get(f):void 0;g!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"val",g));}if(nn(m)){let f=chunkGWV65NQW_cjs.we(m,"id"),g=f!==void 0?d.get(f):void 0;g!==void 0&&(h=q(h,chunkGWV65NQW_cjs.ca,"id",g));}if(m.kind==="drawingDocPr"){let f=m.attributes.find(O=>O.localName==="id"&&O.namespaceUri==="")?.value,g=f!==void 0?c.get(f):void 0;g!==void 0&&(h=q(h,"","id",g));}for(let f of h.attributes){if(f.namespaceUri!==oo)continue;let g=a.get(f.value);g!==void 0&&g!==f.value&&(h=q(h,oo,f.localName,g));}let P=m.localName,p=h.children.map(f=>u(f,P));return h!==m||p.some((f,g)=>f!==h.children[g])?{...h,children:p}:m};return u(t,"")}function ao(t,e,n){let r=t,a=n.get(t)??2;for(;e.has(r);)r=`${t}${a}`,a+=1;return n.set(t,a),r}function io(t,e,n){let r=`${t} (pasted)`,a=n.get(t)??2;for(;e.has(r);)r=`${t} (pasted ${a})`,a+=1;return n.set(t,a),r}var hi=1e5;function so(t){let e=chunkGWV65NQW_cjs.Bb(),n=yi(t,e),r=ki(t,e),a=xi(t,e);return !n||!r||!a?null:{bookmarkIds:n,revisionIds:r,docPrIds:a}}function rn(t,e,n,r){if(t)return chunkGWV65NQW_cjs.Db(e,t,r);let a=n;return ()=>String(a++)}function lo(t,e){if(t.add(e),!/^\d{1,10}$/.test(e))return;let n=Number(e);n<=chunkGWV65NQW_cjs.zb&&t.add(String(n));}function co(t,e){if(e===void 0)return t;let n=Number(e);return Number.isInteger(n)&&n>t?n:t}function yi(t,e){let n=new Map;if(t.fragmentBookmarkIds.length===0)return n;let r=0,a=new Set;for(let o of [t.ownerPart,...t.notesParts])ne([o.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunkGWV65NQW_cjs.we(s,"id");l!==void 0&&(lo(a,l),s.kind==="bookmarkStart"&&(r=co(r,l)));});let i=rn(e,a,r+1,chunkGWV65NQW_cjs.zb);for(let o of t.fragmentBookmarkIds){if(n.has(o))continue;let s=i();if(s===null)return null;n.set(o,s);}return n}function ki(t,e){let n=new Map;if(!t.hasRevision)return n;let r=0,a=new Set;for(let s of [t.ownerPart,...t.notesParts]){let l=s===t.ownerPart;ne([s.root],d=>{if(!chunkGWV65NQW_cjs.Te(d))return;let c=chunkGWV65NQW_cjs.we(d,"id");c!==void 0&&lo(a,c),l&&(r=co(r,c));});}let i=rn(e,a,r+1,chunkGWV65NQW_cjs.zb),o=false;return ne(t.travelling,s=>{if(o||!chunkGWV65NQW_cjs.Te(s))return;let l=chunkGWV65NQW_cjs.we(s,"id");if(l===void 0||n.has(l))return;let d=i();d===null?o=true:n.set(l,d);}),o?null:n}function xi(t,e){let n=new Map;if(!t.hasDocPr)return n;let{used:r}=chunkGWV65NQW_cjs.Fb(t.pkg),a=hi;if(!e){let s=chunkGWV65NQW_cjs.Gb(t.pkg);s.ok&&(a=s.id);}let i=rn(e,r,a,chunkGWV65NQW_cjs.Eb),o=false;return ne(t.travelling,s=>{if(o||s.kind==="textValue"||s.kind!=="drawingDocPr")return;let l=s.attributes.find(c=>c.localName==="id"&&c.namespaceUri==="")?.value;if(l===void 0||n.has(l))return;let d=i();d===null?o=true:n.set(l,d);}),o?null:n}var be="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Pi=`${be}/hyperlink`,mo=`${be}/image`,It=`${be}/numbering`,on=`${be}/styles`,uo="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",po="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function tt(t,e,n,r){for(let a of chunkGWV65NQW_cjs.Wb(t,e)){if(a.type!==n||a.targetMode==="External")continue;let i=chunkGWV65NQW_cjs.w(a.ownerPart,a.rawTarget);if(i.ok){let o=t.parts.get(i.partName);if(o)return o}}return t.parts.get(r)??null}function an(t,e){let n=0;return ne([t],r=>{let a=e(r);if(a===void 0)return;let i=Number(a);Number.isInteger(i)&&i>n&&(n=i);}),n}function Rt(t,e,n,r){if(n.length===0)return t;let a=chunkGWV65NQW_cjs.Aa(e),i=n.map(d=>chunkGWV65NQW_cjs.Ae(d,a)),o=chunkGWV65NQW_cjs.$g(e,i),s=r??o.root.children.length,l=chunkGWV65NQW_cjs.Fa(o,o.root.id,s,i,{deferValidation:true});return l.ok?chunkGWV65NQW_cjs.Ub(t,l.part):null}function fo(t){let e=new Set;return ne(t,n=>{if(n.kind!=="textValue")for(let r of n.attributes)r.namespaceUri===be&&r.value.length>0&&e.add(r.value);}),e}function go(t,e){if(e.size===0)return [...t];let n=a=>{if(a.kind==="textValue")return a;if(a.kind==="drawing"){let o=false;return ne([a],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===be&&e.has(l.value)&&(o=true);}),o?null:a}if(a.kind==="hyperlink"){let o=a.attributes.find(s=>s.namespaceUri===be)?.value;if(o!==void 0&&e.has(o))return r(a.children)}let i=r(a.children);return i.length===a.children.length&&i.every((o,s)=>o===a.children[s])?a:{...a,children:i}};function r(a){let i=[];for(let o of a){let s=n(o);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(t)}var Oi=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),ho={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function Ii(t,e){let n=chunkGWV65NQW_cjs.ib(t);return n==="unknown"||(Object.hasOwn(ho,e)?ho[e]:e)!==n||Oi.has(n)&&!chunkGWV65NQW_cjs.Hb(t,n)?null:n}function yo(t,e,n){let r=e.parts.get(e.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!t.parts.has(n))return {ok:false,reason:"no-target-part"};let a=r.root.kind==="document"?r.root.children.find(x=>x.kind==="body"):null;if(!a||!J(a))return {ok:false,reason:"no-fragment-document"};let i=tn(a.children.filter(x=>x.kind==="paragraph"||x.kind==="table"||x.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let o=t,s=tt(e,e.mainDocumentPart,It,"/word/numbering.xml"),l=new Map,d=[],c=[];if(s&&J(s.root)){let x=new Map,I=[];for(let T of s.root.children)if(J(T))if(_(T,"abstractNum")){let D=chunkGWV65NQW_cjs.we(T,"abstractNumId");D&&x.set(D,T);}else _(T,"num")&&I.push(T);let R=tt(o,o.mainDocumentPart,It,"/word/numbering.xml"),b=new Map,w=new Map;if(R&&J(R.root)){for(let T of R.root.children)if(J(T)&&_(T,"abstractNum")){let D=chunkGWV65NQW_cjs.we(T,"abstractNumId");D&&w.set(D,T);}for(let T of R.root.children){if(!J(T)||!_(T,"num"))continue;let D=chunkGWV65NQW_cjs.we(T,"numId");if(!D)continue;let X=T.children.find(H=>_(H,"abstractNumId")),z=X?chunkGWV65NQW_cjs.we(X,"val"):void 0,re=z?w.get(z):void 0;b.set(`${re?et(re):"none"}::${T.children.filter(H=>_(H,"lvlOverride")).map(pe).join("")}`,D);}}let M=(R?an(R.root,T=>T.kind!=="textValue"&&_(T,"abstractNum")?chunkGWV65NQW_cjs.we(T,"abstractNumId"):void 0):0)+1,W=(R?an(R.root,T=>T.kind!=="textValue"&&_(T,"num")?chunkGWV65NQW_cjs.we(T,"numId"):void 0):0)+1,le=new Map;for(let T of I){let D=chunkGWV65NQW_cjs.we(T,"numId");if(!D)continue;let X=T.children.find(he=>_(he,"abstractNumId")),z=X?chunkGWV65NQW_cjs.we(X,"val"):void 0,re=z?x.get(z):void 0,H=`${re?et(re):"none"}::${T.children.filter(he=>_(he,"lvlOverride")).map(pe).join("")}`,K=b.get(H);if(K!==void 0){l.set(D,K);continue}let ee=z?le.get(z):void 0;ee===void 0&&re&&z&&(ee=String(M++),le.set(z,ee),c.push(q(re,chunkGWV65NQW_cjs.ca,"abstractNumId",ee)));let Ne=String(W++);l.set(D,Ne);let xe=q(T,chunkGWV65NQW_cjs.ca,"numId",Ne);if(ee!==void 0){let he=xe.children.map(Se=>_(Se,"abstractNumId")?q(Se,chunkGWV65NQW_cjs.ca,"val",ee):Se);xe={...xe,children:he};}d.push(xe),b.set(H,Ne);}}let u=Ot(tt(e,e.mainDocumentPart,on,"/word/styles.xml")),m=tt(o,o.mainDocumentPart,on,"/word/styles.xml"),k=Ot(m),h=new Map,P=[],p=new Set(k.byId.keys()),y=new Set(k.names),f=new Map,g=new Map,O=new Map,L=(x,I)=>{let R=O.get(x);return R===void 0&&(R=et(I),O.set(x,R)),R},U=x=>({...x,attributes:x.attributes.filter(I=>!(I.localName==="default"&&I.namespaceUri===chunkGWV65NQW_cjs.ca))});for(let x of u.styles){let I=chunkGWV65NQW_cjs.we(x,"styleId");if(!I)continue;let R=k.byId.get(I),b=et(Ue(x,{styleIds:h,numIds:l}));if(R&&L(I,R)===b){h.set(I,I);continue}if(!R){h.set(I,I),p.add(I),P.push(U(x));continue}let w=ao(`${I}Pasted`,p,f);p.add(w),h.set(I,w),P.push(U(q(x,chunkGWV65NQW_cjs.ca,"styleId",w)));}let S=P.map(x=>{let I=x.children.find(M=>_(M,"name")),R=I?chunkGWV65NQW_cjs.we(I,"val"):void 0;if(!R||!y.has(R))return R&&y.add(R),x;let b=io(R,y,g);y.add(b);let w=x.children.map(M=>_(M,"name")?q(M,chunkGWV65NQW_cjs.ca,"val",b):M);return {...x,children:w}}),F=null,V=1,Z=()=>{if(F)return F;let x=new Map;for(let[I,R]of o.partBytes){let b=I.startsWith("/")?I:`/${I}`;if(!b.startsWith("/word/media/"))continue;x.set(chunkGWV65NQW_cjs.a(R),b);let w=/\/image(\d+)\./.exec(b);w&&(V=Math.max(V,Number(w[1])+1));}return F=x,x},C=new Map,B=x=>{let I=C.get(x);if(!I){I=new Map;for(let R of chunkGWV65NQW_cjs.Wb(o,x)){if(R.targetMode==="External"||R.type!==mo)continue;let b=chunkGWV65NQW_cjs.w(R.ownerPart,R.rawTarget);b.ok&&I.set(b.partName,R.id);}C.set(x,I);}return I},$=(x,I)=>{let R=x.lastIndexOf("."),b=R===-1?"":x.slice(R+1);return /^[A-Za-z0-9]{1,8}$/.test(b)?b.toLowerCase():I==="image/jpeg"?"jpeg":I==="image/gif"?"gif":"png"},G=(x,I,R)=>{let b=new Map,w=new Set,M=B(I),W=[],le=new Set,T=[],D=[],X=new Map,z=[],re=e.relationships.get(x)??[];for(let H of re){if(!R.has(H.id))continue;if(H.targetMode==="External"){if(H.type===Pi){let we=chunkGWV65NQW_cjs.Bd(o,H.rawTarget,I);we?(o=we.pkg,b.set(H.id,we.relationshipId)):w.add(H.id);}else w.add(H.id);continue}let K=chunkGWV65NQW_cjs.w(H.ownerPart,H.rawTarget);if(!K.ok){w.add(H.id);continue}let ee=e.partBytes.get(K.partName)??e.partBytes.get(K.partName.replace(/^\//,"")),Ne=(chunkGWV65NQW_cjs.Xb(e,K.partName)??"").toLowerCase();if(!ee||!Ne.startsWith("image/")){w.add(H.id);continue}let xe=Ii(ee,Ne);if(xe===null){w.add(H.id);continue}let he=xe,Se=Z(),Bn=chunkGWV65NQW_cjs.a(ee),oe=Se.get(Bn);if(!oe){let we=$(K.partName,he),ti=ct=>o.partBytes.has(ct)||o.partBytes.has(ct.slice(1))||o.parts.has(ct)||le.has(ct),At=`/word/media/image${V}.${we}`;for(;ti(At);)V+=1,At=`/word/media/image${V}.${we}`;V+=1,oe=At,W.push({partName:oe,bytes:ee,contentType:he}),le.add(oe),Se.set(Bn,oe);}let ei=oe.startsWith("/word/")?oe.slice(6):oe,jn=M.get(oe);if(jn!==void 0){b.set(H.id,jn);continue}let dt=X.get(oe);dt===void 0&&(dt=T.length,X.set(oe,dt),T.push(ei),D.push(oe)),z.push({recordId:H.id,index:dt});}if(W.length>0&&(o=chunkGWV65NQW_cjs.Lb(o,W)),T.length>0){let H=chunkGWV65NQW_cjs._b(chunkGWV65NQW_cjs.$b(o,I),I,T.map(K=>[mo,K]));if(H.ok){o=H.pkg,H.ids.forEach((K,ee)=>{M.set(D[ee],K);});for(let K of z)b.set(K.recordId,H.ids[K.index]);}else for(let K of z)w.add(K.recordId);}return {relIdMap:b,dropRelIds:w}},ae=G(e.mainDocumentPart,n,fo(i));i=go(i,ae.dropRelIds);let E=new Map,st=new Map,Q=[];for(let x of ["footnote","endnote"]){let I=x==="footnote"?"footnoteReference":"endnoteReference",R=x==="footnote"?E:st,b=new Set;if(ne(i,D=>{if(D.kind!=="textValue"&&D.kind==="noteReference"&&D.localName===I){let X=chunkGWV65NQW_cjs.we(D,"id");X!==void 0&&b.add(X);}}),b.size===0)continue;let w=chunkGWV65NQW_cjs.Me(e,x);if(!w||!J(w.root))continue;let M=chunkGWV65NQW_cjs.af(o,x);if(!M.ok||!M.package)return {ok:false,reason:"merge-refused"};o=M.package;let W=chunkGWV65NQW_cjs.Me(o,x);if(!W)return {ok:false,reason:"merge-refused"};let le=an(W.root,D=>D.kind!=="textValue"&&D.kind==="note"?chunkGWV65NQW_cjs.we(D,"id"):void 0)+1,T=[];for(let D of w.root.children){if(!J(D)||D.kind!=="note")continue;let X=chunkGWV65NQW_cjs.we(D,"id"),z=chunkGWV65NQW_cjs.we(D,"type");if(z==="separator"||z==="continuationSeparator"||X===void 0||!b.has(X))continue;let re=String(le++);R.set(X,re),T.push(q(D,chunkGWV65NQW_cjs.ca,"id",re));}T.length>0&&Q.push({kind:x,fragmentPartName:w.name,bodies:tn(T)});}let We=o.parts.get(n),An=[...i,...Q.flatMap(x=>x.bodies)],_n=[],Dt=new Set,Un=false,Ln=false,Ke=new Map;ne(An,x=>{if(x.kind!=="textValue"){if(x.kind==="bookmarkStart"||x.kind==="bookmarkEnd"){let I=chunkGWV65NQW_cjs.we(x,"id");if(I!==void 0&&_n.push(I),x.kind==="bookmarkStart"){let R=chunkGWV65NQW_cjs.we(x,"name");R&&Dt.add(R);}return}if(nn(x)){Un=true;return}if(x.kind==="drawingDocPr"){Ln=true;return}if(x.kind==="contentControlProperties")for(let I of x.children){if(!_(I,"id"))continue;let R=chunkGWV65NQW_cjs.we(I,"val");if(R!==void 0&&!Ke.has(R)){let b=0,w=`${R}:${Ke.size}`;for(let M=0;M<w.length;M+=1)b=b*31+w.charCodeAt(M)>>>0;Ke.set(R,String(b%2147483647||1));}}}});let lt=so({pkg:o,ownerPart:We,notesParts:Q.map(x=>chunkGWV65NQW_cjs.Me(o,x.kind)).filter(x=>x!==null),travelling:An,fragmentBookmarkIds:_n,hasRevision:Un,hasDocPr:Ln});if(!lt)return {ok:false,reason:"merge-refused"};let Fn=lt.bookmarkIds,$n=lt.revisionIds,Hn=lt.docPrIds;if(Dt.size>0){let x=new Set;if(ne([We.root],I=>{if(I.kind!=="textValue"&&I.kind==="bookmarkStart"){let R=chunkGWV65NQW_cjs.we(I,"name"),b=chunkGWV65NQW_cjs.we(I,"id");R&&b!==void 0&&Dt.has(R)&&x.add(b);}}),x.size>0){let I=b=>{if(b.kind==="textValue")return b;let w=[],M=false;for(let W of b.children){if((W.kind==="bookmarkStart"||W.kind==="bookmarkEnd")&&x.has(chunkGWV65NQW_cjs.we(W,"id")??"")){M=true;continue}let le=I(W);le!==W&&(M=true),w.push(le);}return M?{...b,children:w}:b},R=I(We.root);R!==We.root&&(o=chunkGWV65NQW_cjs.Ub(o,{...We,root:R}));}}for(let x of Q){let I=chunkGWV65NQW_cjs.Me(o,x.kind);if(!I)return {ok:false,reason:"merge-refused"};let R=G(x.fragmentPartName,I.name,fo(x.bodies)),b=go(x.bodies,R.dropRelIds);b=[...Zt(b,u,k)],b=b.map(M=>Ue(M,{styleIds:h,numIds:l,relIds:R.relIdMap,footnoteIds:E,endnoteIds:st,bookmarkIds:Fn,sdtIds:Ke,revisionIds:$n,docPrIds:Hn}));let w=Rt(o,o.parts.get(I.name),b);if(!w)return {ok:false,reason:"merge-refused"};o=w;}if(S.length>0){let x=S.map(R=>Ue(R,{styleIds:h,numIds:l}));if(!m){let R=chunkGWV65NQW_cjs.ta(`<w:styles xmlns:w="${chunkGWV65NQW_cjs.ca}"></w:styles>`,{name:"/word/styles.xml",contentType:po});if(!R.ok)return {ok:false,reason:"merge-refused"};o=chunkGWV65NQW_cjs.bc(o,"/word/styles.xml",R.part.root,po);let b=chunkGWV65NQW_cjs.ac(chunkGWV65NQW_cjs.$b(o,o.mainDocumentPart),o.mainDocumentPart,on,"styles.xml");if(!b.ok)return {ok:false,reason:"merge-refused"};o=b.pkg,m=o.parts.get("/word/styles.xml")??null;}if(!m)return {ok:false,reason:"merge-refused"};let I=Rt(o,o.parts.get(m.name),x);if(!I)return {ok:false,reason:"merge-refused"};o=I,k=Ot(o.parts.get(m.name)??null);}if(c.length>0||d.length>0){let x=tt(o,o.mainDocumentPart,It,"/word/numbering.xml");if(!x){let M=chunkGWV65NQW_cjs.ta(`<w:numbering xmlns:w="${chunkGWV65NQW_cjs.ca}"></w:numbering>`,{name:"/word/numbering.xml",contentType:uo});if(!M.ok)return {ok:false,reason:"merge-refused"};o=chunkGWV65NQW_cjs.bc(o,"/word/numbering.xml",M.part.root,uo);let W=chunkGWV65NQW_cjs.ac(chunkGWV65NQW_cjs.$b(o,o.mainDocumentPart),o.mainDocumentPart,It,"numbering.xml");if(!W.ok)return {ok:false,reason:"merge-refused"};o=W.pkg,x=o.parts.get("/word/numbering.xml")??null;}if(!x)return {ok:false,reason:"merge-refused"};let I=o.parts.get(x.name),R=I.root.children.findIndex(M=>_(M,"num")),b=c.map(M=>Ue(M,{styleIds:h,numIds:l})),w=Rt(o,I,b,R===-1?void 0:R);if(!w)return {ok:false,reason:"merge-refused"};if(o=w,w=Rt(o,o.parts.get(x.name),d),!w)return {ok:false,reason:"merge-refused"};o=w;}let Za=[...Zt(i,u,k)].map(x=>Ue(x,{styleIds:h,numIds:l,relIds:ae.relIdMap,footnoteIds:E,endnoteIds:st,bookmarkIds:Fn,sdtIds:Ke,revisionIds:$n,docPrIds:Hn}));return {ok:true,pkg:o,blocks:Za}}var Ri=16*1024*1024;function bi(t){let e=t.parts.get(t.mainDocumentPart);if(!e||e.root.kind!=="document")return false;let n=e.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunkGWV65NQW_cjs.Yg)return false;let r=0,a=(i,o,s)=>{if(o>s||(r+=1,r>chunkGWV65NQW_cjs._g))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!a(l,o+1,s))return false;return true};for(let i of n.children)if(!a(i,1,chunkGWV65NQW_cjs.Zg))return false;for(let[i,o]of t.parts)if(i!==t.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!a(o.root,1,chunkGWV65NQW_cjs.Zg*4))return false;return true}function ko(t,e,n){if(n.fragmentBytes.byteLength>Ri)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunkGWV65NQW_cjs.Sb(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let a=r.package;if(!bi(a))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=t.resolveStory(e);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:o,story:s}=i;if(o.compositionActive||t.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=t.currentPackage(),d=o.checkpoint(),c=o.historyDepth,u=0,m="";return chunkGWV65NQW_cjs.xa(t,()=>{let k=o.transact(P=>{for(let g of n.priorOps??[])if(!P.apply(g))return;let p=null,y=P.applyPackage(g=>(p=yo(g,a,s.partName),p.ok?p.pkg:g)),f=p;if(!f||!f.ok){m=`fragment-merge:${f?f.reason:"no-merge"}`,P.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}y&&(u=f.blocks.length,P.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:f.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return m.length>0?{ok:false,reason:"invalidArgs",detail:m}:k.ok?k.change?{ok:true,change:t.promoteStoryTransactionToPackageUnit(l,o,d,c),blockCount:u}:{ok:true,change:null,blockCount:u}:{ok:false,reason:k.reason,...k.detail?{detail:k.detail}:{}}},k=>chunkGWV65NQW_cjs.ya(k))}function vi(t){if(!(t===null||t.start!==t.end))return t}var Le={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function Ni(t){return Object.freeze({parts:new Map([[t.name,t]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[t.name.toLowerCase(),t.contentType]])},mainDocumentPart:t.name})}var Fe=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];subscribers=new Set;historyLimit;settingsPartOverride;storyRef=null;composition=null;constructor(e,n,r={}){let a="root"in e,i=typeof n=="string"?n:void 0,o=typeof n=="object"&&n!==null?n:r;this.current=a?Ni(e):e,this.storyPartName=i??(a?e.name:e.mainDocumentPart),this.historyLimit=o.historyLimit??200,this.settingsPartOverride=o.settingsPart;}setStoryRef(e){this.storyRef=e;}get part(){let e=this.current.parts.get(this.storyPartName);if(!e)throw new Error(`story part missing: ${this.storyPartName}`);return e}get package(){return this.current}get revision(){return this.rev}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}get historyDepth(){return this.undoStack.length}get compositionActive(){return this.composition!==null}graftPackage(e){this.current=e(this.current);}replacePart(e){let n=this.current.parts.get(e.name);e!==n&&(this.current=chunkGWV65NQW_cjs.Ub(this.current,e),this.rev+=1);}checkpoint(){return {pkg:this.current,revision:this.rev,undoStack:this.undoStack.slice(),redoStack:this.redoStack.slice(),composition:this.composition?{entry:{...this.composition.entry},committed:this.composition.committed}:null}}restoreCheckpoint(e){this.current=e.pkg,this.rev=e.revision,this.undoStack.length=0,this.undoStack.push(...e.undoStack),this.redoStack.length=0,this.redoStack.push(...e.redoStack),this.composition=e.composition?{entry:{...e.composition.entry},committed:e.composition.committed}:null;}restoreHistoryStacks(e){this.undoStack.length=0,this.undoStack.push(...e.undoStack),this.redoStack.length=0,this.redoStack.push(...e.redoStack);}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}transact(e,n={}){return chunkGWV65NQW_cjs.Ab(n.actorId,()=>this.commitTransaction(e,n))}commitTransaction(e,n){let r=n.origin??chunkGWV65NQW_cjs.b.mutationHuman,a=this.current,i=this.rev,o=this.current,s=null,l=0,d=new Set,c=new Set,u=new Set,m=new Set,k=new Set,h=[],P=n.minimumImpact??"text-local",p=null,y=false,f=null,g=null,O=new Map,L=(C,B)=>{let $=chunkGWV65NQW_cjs.ug.get(C.op);if($===void 0)return O.clear(),null;let G=`${B.name}\0${$}`,ae=O.get(G);ae||(ae={id:null},O.set(G,ae));let E=ae;return ()=>E.id??=chunkGWV65NQW_cjs.Se(B)()},U=(C,B)=>{if(s)return false;let $=o.parts.get(C);if(!$)return s={reason:"unknown-part",detail:C},false;let G=chunkGWV65NQW_cjs.xg($,this.settingsPartOverride?.()??chunkGWV65NQW_cjs.me(o),B);if(G)return s={reason:G},false;let ae=L(B,$),E=chunkGWV65NQW_cjs.Wg($,B,{deferValidation:true,...ae?{revisionIds:ae}:{}});if(!E.ok)return s={reason:E.reason,...E.detail?{detail:E.detail}:{}},false;if(o=chunkGWV65NQW_cjs.Ub(o,E.part),E.part===$&&E.effect.dirty.length===0&&E.effect.created.length===0&&E.effect.deleted.length===0&&E.effect.split===void 0&&(E.effect.splits===void 0||E.effect.splits.length===0)&&E.effect.join===void 0&&E.effect.caret===void 0)return true;d.add(C),l+=1;for(let Q of E.effect.dirty)c.add(Q);for(let Q of E.effect.created)u.add(Q);for(let Q of E.effect.deleted)m.add(Q);for(let Q of E.effect.dependencyKeys)k.add(Q);E.effect.split&&h.push({split:E.effect.split});for(let Q of E.effect.splits??[])h.push({split:Q});return E.effect.join&&h.push({join:E.effect.join}),Le[E.effect.impact]>Le[P]&&(P=E.effect.impact),E.effect.caret&&(g={paragraphId:E.effect.caret.paragraphId,start:0,end:0}),true};if(e({apply:C=>U(this.storyPartName,C),applyTo:(C,B)=>U(C,B),applyPackage:C=>{if(s)return false;O.clear();let B=C(o);if(B===o)return true;for(let[$,G]of B.parts)o.parts.get($)!==G&&d.add($);return o=B,l+=1,Le["flow-structural"]>Le[P]&&(P="flow-structural"),true},selectionBefore:C=>{p=C;},selectionAfter:C=>{y=true,f=C;}}),s){let C=s;return {ok:false,reason:C.reason,...C.detail?{detail:C.detail}:{}}}if(l===0)return {ok:true,change:null};let S=y?f:g,F=y?vi(f):g??void 0;for(let C of d){let B=a.parts.get(C),$=o.parts.get(C);if($===void 0)continue;let G=B?chunkGWV65NQW_cjs.ra(B,$):chunkGWV65NQW_cjs.ra($,$);if(!G.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(G.issues)}}let V=chunkGWV65NQW_cjs.cc(o);return V.ok?((n.recordsHistory??(r!==chunkGWV65NQW_cjs.b.projection&&r!==chunkGWV65NQW_cjs.b.awareness))&&(this.composition?(this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:S}}):(this.pushUndo({pkg:a,revision:i,selectionBefore:p,selectionAfter:S}),this.redoStack.length=0)),this.current=o,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&Le[n.minimumImpact]>Le[P]&&(P=n.minimumImpact),{ok:true,change:this.publish(r,i,{dirty:c,created:u,deleted:m,dependencyKeys:k,splitJoin:h,impact:P,caret:F},n.story??this.storyRef??void 0,n.actorId,n.operationId)}):{ok:false,reason:"package-invariant",detail:JSON.stringify(V.issues)}}beginComposition(e=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:e,selectionAfter:null},committed:false});}endComposition(){let e=this.composition;this.composition=null,!(!e||!e.committed)&&(this.pushUndo(e.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}undo(){let e=this.undoStack.pop();if(!e)return null;let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:e.selectionBefore,selectionAfter:e.selectionAfter}),this.current=e.pkg,this.rev+=1,this.publish(chunkGWV65NQW_cjs.b.mutationUndo,n,null,this.storyRef??void 0)}redo(){let e=this.redoStack.pop();if(!e)return null;let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:e.selectionBefore,selectionAfter:e.selectionAfter}),this.current=e.pkg,this.rev+=1,this.publish(chunkGWV65NQW_cjs.b.mutationRedo,n,null,this.storyRef??void 0)}selectionForUndo(){return this.undoStack[this.undoStack.length-1]?.selectionBefore??null}selectionForRedo(){return this.redoStack[this.redoStack.length-1]?.selectionAfter??null}pushUndo(e){this.undoStack.push(e),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(e,n,r,a,i,o){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:e,...i?{actorId:i}:{},...o?{operationId:o}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:a?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...a?{story:a}:{}};for(let l of this.subscribers)l(s);return s}};function sn(t,e){return [...t.values()].map(n=>n.part).filter(n=>e.parts.has(n.name))}function xo(t,e){return sn(t,e).map(n=>n.name).sort().join(",")}var vt="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Si="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function $e(t,e){for(let n of t.children)if(n.kind!=="textValue"&&n.namespaceUri===vt&&n.localName===e)return n;return null}function bt(t,e){return t.attributes.find(n=>n.namespaceUri===vt&&n.localName===e)?.value}function wi(t){let e=bt(t,"val");return e===void 0||e==="1"||e==="true"||e==="on"}function Oo(t,e){return t.kind==="textValue"?Object.freeze({...t,id:e()}):Object.freeze({...t,id:e(),children:t.children.map(n=>Oo(n,e))})}function Ti(t){let e=chunkGWV65NQW_cjs.ta(`<w:styles xmlns:w="${vt}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:t.name,contentType:Si});if(!e.ok)return null;let n=$e(e.part.root,"style"),r=n?$e(n,"pPr"):null;return r?Oo(r,chunkGWV65NQW_cjs.Aa(t)):null}var Po=["pStyle","keepNext","keepLines","pageBreakBefore","framePr","widowControl","numPr","suppressLineNumbers","pBdr","shd","tabs","suppressAutoHyphens","kinsoku","wordWrap","overflowPunct","topLinePunct","autoSpaceDE","autoSpaceDN","bidi","adjustRightInd","snapToGrid","spacing","ind","contextualSpacing","mirrorIndents","suppressOverlap","jc","textDirection","textAlignment","textboxTightWrap","outlineLvl","divId","cnfStyle","rPr","sectPr","pPrChange"];function Ei(t,e){let n=Po.indexOf(e),r=0;return t.forEach((a,i)=>{if(a.kind==="textValue")return;let o=Po.indexOf(a.localName);o!==-1&&o<=n&&(r=i+1);}),r}function Io(t,e){let n=chunkGWV65NQW_cjs.td(t);if(!n)return null;let r=null;for(let d of n.root.children)if(d.kind!=="textValue"&&d.namespaceUri===vt&&d.localName==="style"&&bt(d,"type")==="paragraph"&&bt(d,"styleId")===e){r=d;break}if(!r)return null;let a=$e(r,"name");if(a&&bt(a,"val")?.trim().toLowerCase()!=="list paragraph"&&e!=="ListParagraph")return null;let i=Ti(n);if(!i)return null;let o=$e(i,"contextualSpacing");if(!o)return null;let s=$e(r,"pPr"),l;if(s){let d=$e(s,"contextualSpacing");if(d&&wi(d))return t;l=d?chunkGWV65NQW_cjs.Ga(n,d.id,o):chunkGWV65NQW_cjs.Fa(n,s.id,Ei(s.children,"contextualSpacing"),[o]);}else {let d=r.children.findIndex(c=>c.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(c.localName));l=chunkGWV65NQW_cjs.Fa(n,r.id,d===-1?r.children.length:d,[i]);}return l.ok?Object.freeze({...t,parts:new Map([...t.parts,[n.name,l.part]])}):null}var No="http://schemas.openxmlformats.org/package/2006/relationships",So="application/vnd.openxmlformats-package.relationships+xml",Di="http://schemas.openxmlformats.org/package/2006/content-types",Ro="/[Content_Types].xml",He="/word/numbering.xml",bo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",nt="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Ai=`<Override PartName="${He}" ContentType="${nt}"/>`;function Nt(t){return `${t.ownerPart}\0${t.id}`}function wo(t,e,n){let r=new Set(e.externalTargets.filter(s=>s.type===chunkGWV65NQW_cjs.Oa).map(Nt)),a=n.externalTargets.filter(s=>s.type===chunkGWV65NQW_cjs.Oa&&!r.has(Nt(s)));if(a.length===0)return t;let i=new Set(t.map(Nt)),o=a.filter(s=>!i.has(Nt(s)));return o.length===0?t:Object.freeze([...t,...o])}function To(t,e,n){let r=t.filter(a=>a.ownerPart===n||e.has(a.ownerPart));return r.length===t.length?t:Object.freeze(r)}function Eo(t,e,n=[]){if(t===e)return t;let r=_i(t,e);return r=Ui(r,e,n),r}function Co(t,e){let n=new Set;for(let a of t.externalTargets)a.type===chunkGWV65NQW_cjs.Oa&&a.ownerPart!==t.mainDocumentPart&&(t.parts.has(a.ownerPart)||e.has(a.ownerPart)||n.add(a.ownerPart));for(let a of t.parts.keys()){let i=Hi(a);!i||i===t.mainDocumentPart||t.parts.has(i)||e.has(i)||t.externalTargets.some(o=>o.ownerPart===i)||n.add(i);}if(n.size===0)return t;let r=t;for(let a of n)r=Bi(r,a);return r}function _i(t,e){let n=e.parts.get(He);if(!n)return t;let r=chunkGWV65NQW_cjs.Ub(t,n),a=(e.relationships.get(e.mainDocumentPart)??[]).find(o=>o.type===bo),i=r.relationships.get(r.mainDocumentPart)??[];if(a&&!i.some(o=>o.type===bo)&&!i.some(o=>o.id===a.id)){let o=Fi(r,{...a,ownerPart:r.mainDocumentPart});o&&(r=o);}if(r.contentTypes.overrides.get(chunkGWV65NQW_cjs.u(He))!==nt){let o=ji(r);o&&(r=o);}return r}function Ui(t,e,n){let r=n.filter(i=>i.type===chunkGWV65NQW_cjs.Oa);if(r.length===0)return t;let a=t;for(let i of r){let o=Li(t,e,i.ownerPart);if(!o||a.externalTargets.some(d=>d.ownerPart===o&&d.id===i.id)||new Set((a.relationships.get(o)??[]).map(d=>d.id)).has(i.id))continue;let l=$i(a,{ownerPart:o,id:i.id,type:chunkGWV65NQW_cjs.Oa,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},o);l&&(a=l);}return a}function Li(t,e,n){return n===e.mainDocumentPart?t.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function Fi(t,e){let n=t.mainDocumentPart,r=ln(n),a=t.parts.get(r),i=chunkGWV65NQW_cjs.ta(`<Relationships xmlns="${No}"><Relationship Id="${chunkGWV65NQW_cjs.P(e.id,"relationship id")}" Type="${chunkGWV65NQW_cjs.P(e.type,"relationship type")}" Target="${chunkGWV65NQW_cjs.P(e.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:So});if(!i.ok)return null;let o=t.relationships.get(n)??[];if(o.some(d=>d.id===e.id))return null;let s={...e,ownerPart:n,order:o.reduce((d,c)=>Math.max(d,c.order),-1)+1},l=new Map([...t.relationships,[n,[...o,s]]]);return a?Mo(t,a,i.part.root.children[0],l):Object.freeze({...t,parts:new Map([...t.parts,[r,i.part]]),relationships:l})}function $i(t,e,n=t.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let a=ln(r),i=t.parts.get(a),o=chunkGWV65NQW_cjs.ta(`<Relationships xmlns="${No}"><Relationship Id="${chunkGWV65NQW_cjs.P(e.id,"relationship id")}" Type="${chunkGWV65NQW_cjs.Oa}" Target="${chunkGWV65NQW_cjs.P(e.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:a,contentType:So});if(!o.ok)return null;let s=[...t.externalTargets,e];if(!i)return Object.freeze({...t,parts:new Map([...t.parts,[a,o.part]]),externalTargets:s});let l=Mo(t,i,o.part.root.children[0],t.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function Mo(t,e,n,r){if(!n)return null;let a=chunkGWV65NQW_cjs.Aa(e),i=chunkGWV65NQW_cjs.Fa(e,e.root.id,e.root.children.length,[Do(n,a)]);return i.ok?Object.freeze({...t,parts:new Map([...t.parts,[e.name,i.part]]),relationships:r}):null}function Do(t,e){return t.kind==="textValue"?{...t,id:e()}:{...t,id:e(),children:t.children.map(n=>Do(n,e))}}function ln(t){let e=t.lastIndexOf("/");return `${t.slice(0,e)}/_rels/${t.slice(e+1)}.rels`}function Hi(t){let e=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(t);if(!e)return null;let n=e[1],r=e[2];return n===""||r===""?null:`${n}/${r}`}function Bi(t,e){let n=ln(e),r=new Map(t.parts);r.delete(n);let a=new Map(t.partBytes);a.delete(n);let i=new Map(t.relationships);i.delete(e);let o=Object.freeze(t.externalTargets.filter(s=>s.ownerPart!==e));return Object.freeze({...t,parts:r,partBytes:a,relationships:i,externalTargets:o})}function ji(t){let e=t.contentTypes.overrides.get(chunkGWV65NQW_cjs.u(He));if(e===nt)return t;if(e!==void 0)return null;let n=t.partBytes.get(Ro);if(!n)return null;let r=fflate.strFromU8(n),a=vo(r);if(!a)return null;let i=r.lastIndexOf(`</${a.rootName}>`);if(i===-1)return null;let o=r.slice(0,i)+Ai+r.slice(i),s=vo(o);if(!s||s.rootName!==a.rootName)return null;let l=[...a.children,Ao("Override",{PartName:He,ContentType:nt})];return s.children.length!==l.length||s.children.some((d,c)=>d!==l[c])?null:Object.freeze({...t,partBytes:new Map([...t.partBytes,[Ro,fflate.strToU8(o)]]),contentTypes:Object.freeze({defaults:t.contentTypes.defaults,overrides:new Map([...t.contentTypes.overrides,[chunkGWV65NQW_cjs.u(He),nt]])})})}function vo(t){let e=chunkGWV65NQW_cjs.W(t);if(!e.ok)return null;let n=e.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],a=r.name.indexOf(":"),i=a===-1?"":r.name.slice(0,a);if(r.name.slice(a+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==Di)return null;let o=[];for(let s of r.children)s.type==="element"&&o.push(Ao(s.name,s.attributes));return {rootName:r.name,children:o}}function Ao(t,e){let n=Object.entries(e).map(([r,a])=>`${r}=${a}`).sort();return [t,...n].join("")}var _o=4e3,Uo=64;function Lo(t){return chunkGWV65NQW_cjs.Me(t,"footnote")!==null||chunkGWV65NQW_cjs.Me(t,"endnote")!==null}function Fo(t,e,n,r){if(!Lo(t))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let a=chunkGWV65NQW_cjs.Ca(e,n.paragraphId);return !a||a.kind!=="paragraph"?true:chunkGWV65NQW_cjs.Ee(a).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function $o(t,e,n,r){if(!Lo(t))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let a=chunkGWV65NQW_cjs.Ca(e,n.blockId);if(!a||a.kind==="textValue")return true;let i=0,o=(s,l)=>{if(i>=_o||l>Uo)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunkGWV65NQW_cjs.Ee(s).some(d=>d.node.kind==="noteReference");for(let d of s.children)if(o(d,l+1))return true;return false};return o(a,0)}function Ho(t,e,n){if(n.count>=_o||e>Uo)return true;if(n.count+=1,t.kind==="textValue")return false;if(t.kind==="commentRangeStart"||t.kind==="commentRangeEnd"||t.kind==="commentReference")return true;for(let r of t.children)if(Ho(r,e+1,n))return true;return false}function Bo(t,e,n,r){if(!chunkGWV65NQW_cjs.Of(t))return false;let a=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(a))return true;r.add(a);let i=chunkGWV65NQW_cjs.Ca(e,a);return !i||i.kind==="textValue"?true:Ho(i,0,{count:0})}var dn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",cn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function jo(t,e){let r=(t.relationships.get(t.mainDocumentPart)??[]).find(a=>a.id===e);return r?r.type!==dn&&r.type!==cn?{ok:false,reason:"wrong-relationship-type",detail:r.type}:Vi(t,r):{ok:false,reason:"dangling-relationship",detail:e}}function Vi(t,e){let n=chunkGWV65NQW_cjs.E(e);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:e.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=t.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let a=r.root.localName;return a!=="hdr"&&a!=="ftr"?{ok:false,reason:"not-a-story-part",detail:a||r.name}:{ok:true,partName:r.name,part:r}}function ve(t,e){return e.compositionActive||t.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function Vo(t,e){let n=chunkGWV65NQW_cjs.Ca(t,e);return !n||n.kind!=="drawing"?null:n.children.find(a=>a.kind==="inlineDrawing"||a.kind==="anchoredDrawing")??null}function Wo(t,e,n){let r=t.parts.get(e);if(!r)return null;let a=chunkGWV65NQW_cjs.Ca(r,n);return !a||a.kind!=="drawing"?null:chunkGWV65NQW_cjs.ab(a,{ownerPartName:e,supportedMcRequires:chunkGWV65NQW_cjs.Xa,limits:chunkGWV65NQW_cjs.Wa,resolveRelationship:chunkGWV65NQW_cjs.Za(t,e)})}function Ko(t,e,n){let r=chunkGWV65NQW_cjs.F(t.relationships.get(e)??[],e,n);return r.mode==="internal"?r.partName:null}function Be(t,e,n,r){let a=t.resolveStory(e);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let i=ve(t,a.store);if(i)return i;let{store:o,story:s}=a;return chunkGWV65NQW_cjs.xa(t,()=>Wi(t,o,s,n,r),l=>chunkGWV65NQW_cjs.ya(l))}function Wi(t,e,n,r,a){let i=n.partName,o=t.currentPackage(),s=e.checkpoint(),l=e.historyDepth,d=null,c=false,u=false,m=e.transact(P=>{if(a?.commitGuard?.()===false){u=true;return}if(a?.expectedPackageRevision!==void 0&&t.packageRevision!==a.expectedPackageRevision){c=true;return}let p=r(P,i);if(p===null){P.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}d=p;},{story:n,...a?.actorId?{actorId:a.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(u)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(c)return {ok:false,reason:"invalidArgs",detail:"stale-package-epoch"};if(!m.ok)return {ok:false,reason:m.reason,...m.detail?{detail:m.detail}:{}};if(!m.change)return {ok:true,change:null};let k=m.change.created.find(P=>{let p=e.part;return chunkGWV65NQW_cjs.Ca(p,P)?.kind==="drawing"});return k&&(d=k),{ok:true,change:t.promoteStoryTransactionToPackageUnit(o,e,s,l),...d?{drawingNodeId:d}:{}}}function zo(t,e,n){let r=t.parts.get(e);if(!r)return null;let a=Vo(r,n);return a?chunkGWV65NQW_cjs.Rg(a):null}function mn(t,e,n,r){let a=false;return t.applyPackage(i=>{let o=i.parts.get(e);if(!o)return i;let s=chunkGWV65NQW_cjs.Ca(o,n);if(!s||s.kind!=="drawing")return i;let l=Vo(o,n);if(!l)return i;let d=chunkGWV65NQW_cjs.Sg(l,r),c=Ki(s,d),u=chunkGWV65NQW_cjs.Ga(o,s.id,c,{deferValidation:true});return u.ok?(a=true,chunkGWV65NQW_cjs.Ub(i,u.part)):i}),a}function Ki(t,e){return {...t,children:t.children.map(n=>n.id===e.id?e:n)}}async function Go(t,e,n){let r=chunkGWV65NQW_cjs.Mb(n.widthPoints),a=chunkGWV65NQW_cjs.Mb(n.heightPoints);if(r===null||a===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=t.resolveStory(e);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let o=ve(t,i.store);if(o)return o;let s=i.story.partName,l=await chunkGWV65NQW_cjs.Ib(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let d=l.bytes,c=chunkGWV65NQW_cjs.Kb(t.currentPackage(),s,{bytes:d,mime:n.mime});if(!c.ok)return {ok:false,reason:"invalidArgs",detail:c.reason==="invalid-image"?"invalid-image":c.reason};let u=c.partName,m=Be(t,e,(k,h)=>{let P=t.currentPackage(),p=chunkGWV65NQW_cjs.Kb(P,h,{bytes:d,mime:n.mime});if(!p.ok)return null;P=p.pkg,u=p.partName;let y;if(n.hyperlink){let g=chunkGWV65NQW_cjs.Bd(P,n.hyperlink,h);if(!g)return null;P=g.pkg,y=g.relationshipId;}if(!k.applyPackage(()=>P))return null;let f=chunkGWV65NQW_cjs.Nb({docPrId:p.docPrId,relationshipId:p.relationshipId,extentEmu:{cx:r,cy:a},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...y?{hyperlinkRelationshipId:y}:{}});return k.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:f,...n.revision?{revision:n.revision}:{}})?f.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return m.ok?m.change?{...m,mediaPartName:u}:{ok:true,change:null,mediaPartName:u}:m}async function un(t,e,n,r,a,i,o){let s=t.resolveStory(e);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=ve(t,s.store);if(l)return l;let d=s.story.partName,c=await chunkGWV65NQW_cjs.Ib(i,r,a);if(!c.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let u=c.bytes,m=chunkGWV65NQW_cjs.Kb(t.currentPackage(),d,{bytes:u,mime:a});return m.ok?Be(t,e,(k,h)=>{let P=t.currentPackage(),p=Wo(P,d,n),y=p?.picture?.embeddedRelationshipId??null,f=p?.picture?.linkedRelationshipId??null,g=y??f;if(!g)return null;let O=y!==null?Ko(P,d,y):null,L=P,U=chunkGWV65NQW_cjs.Kb(L,h,{bytes:u,mime:a});return !U.ok||(L=U.pkg,!k.applyPackage(()=>L))||!k.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:U.relationshipId})?null:(k.applyPackage(S=>chunkGWV65NQW_cjs.Pb(S,h,O,g)),n)},{expectedPackageRevision:o.expectedPackageRevision,...o.commitGuard?{commitGuard:o.commitGuard}:{},...o.actorId?{actorId:o.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:m.reason==="invalid-image"?"invalid-image":m.reason}}function Xo(t,e,n){let r=t.resolveStory(e);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let a=ve(t,r.store);if(a)return a;let i=r.story.partName,o=t.currentPackage(),s=Wo(o,i,n);if(!s)return {ok:false,reason:"unknown-drawing"};let l=s.picture?.embeddedRelationshipId??null,d=s.picture?.linkedRelationshipId??null,c=l??d,u=l!==null?Ko(o,i,l):null;return Be(t,e,(m,k)=>m.apply({op:"deleteDrawing",drawingNodeId:n})?(m.applyPackage(h=>chunkGWV65NQW_cjs.Pb(h,k,u,c)),n):null)}function zi(t,e){let n=null,r=i=>{let o=false,s=false,l=(d,c)=>{if(o||d.kind==="textValue")return;if(d.id===e){o=true,s=c;return}let u=c||d.kind==="revisionDelete"||d.kind==="revisionMoveFrom";for(let m of d.children)l(m,u);};return l(i,false),s},a=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let o=chunkGWV65NQW_cjs.Fe(i).spanOf(e);if(o!==null&&o.end>o.start){let s=chunkGWV65NQW_cjs.Ca(t,e);if(!s||s.kind!=="drawing"&&!chunkGWV65NQW_cjs._a(s))return;n={paragraphId:i.id,start:o.start,end:o.end,alreadyDeleted:r(i)};}return}for(let o of i.children)a(o);}};return a(t.root),n}function Yo(t,e,n,r){let a=t.resolveStory(e);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let i=ve(t,a.store);if(i)return i;let o=t.currentPackage().parts.get(a.story.partName);if(!o)return {ok:false,reason:"unknown-drawing"};let s=zi(o,n);return s?s.alreadyDeleted?{ok:true,change:null}:Be(t,e,l=>l.apply({op:"deleteText",paragraphId:s.paragraphId,start:s.start,end:s.end,revision:r})?n:null):{ok:false,reason:"unknown-drawing"}}async function Jo(t,e,n,r,a,i,o,s){let l=await chunkGWV65NQW_cjs.Qb(a,r,i,void 0,o);return l.ok?un(t,e,n,l.bytes,l.mime,o,{expectedPackageRevision:t.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function qo(t,e,n,r,a,i){let o=t.resolveStory(e);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let s=ve(t,o.store);return s||Be(t,e,(l,d)=>{let c=zo(t.currentPackage(),d,n),u=null;if(i!==null){let k=chunkGWV65NQW_cjs.Bd(t.currentPackage(),i,d);if(!k||!l.applyPackage(()=>k.pkg))return null;u=k.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:a,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&u!==null){if(!mn(l,d,n,u))return null}else if(i===null&&!mn(l,d,n,null))return null;let m=false;return l.applyPackage(k=>{let h=chunkGWV65NQW_cjs.Dd(k,d,c);return h===null?(m=true,k):h}),m?null:n})}function Qo(t,e,n){let r=t.resolveStory(e);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let a=ve(t,r.store);return a||Be(t,e,(i,o)=>{let s=zo(t.currentPackage(),o,n.drawingNodeId),l=null;if(n.hyperlink!==null){let c=chunkGWV65NQW_cjs.Bd(t.currentPackage(),n.hyperlink,o);if(!c||!i.applyPackage(()=>c.pkg))return null;l=c.relationshipId;}for(let c of n.ops)if(!i.apply(c))return null;if(!mn(i,o,n.drawingNodeId,n.hyperlink===null?null:l))return null;let d=false;return i.applyPackage(c=>{let u=chunkGWV65NQW_cjs.Dd(c,o,s);return u===null?(d=true,c):u}),d?null:n.drawingNodeId})}function Gi(t,e){if(t===e)return true;if(t.byteLength!==e.byteLength)return false;for(let n=0;n<t.byteLength;n+=1)if(t[n]!==e[n])return false;return true}function Zo(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t)if(e.get(n)!==r)return false;return true}function Xi(t,e){return t===e||t.ownerPart===e.ownerPart&&t.id===e.id&&t.type===e.type&&t.rawTarget===e.rawTarget&&t.targetMode===e.targetMode&&t.order===e.order}function Yi(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t){let a=e.get(n);if(!a||a.length!==r.length||a!==r&&r.some((i,o)=>!Xi(i,a[o])))return false}return true}function Ji(t,e){return t===e?true:t.length!==e.length?false:t.every((n,r)=>{let a=e[r];return n===a||n.ownerPart===a.ownerPart&&n.id===a.id&&n.type===a.type&&n.rawTarget===a.rawTarget&&n.sinkSafe===a.sinkSafe})}function qi(t,e){if(t===e)return true;if(t.size!==e.size)return false;for(let[n,r]of t){let a=e.get(n);if(!a||!Gi(r,a))return false}return true}function Qi(t,e){return t.contentTypes===e.contentTypes||Zo(t.contentTypes.defaults,e.contentTypes.defaults)&&Zo(t.contentTypes.overrides,e.contentTypes.overrides)}var St=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),wt=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function ea(t){for(let[e,n]of t)if(!chunkGWV65NQW_cjs.oa(e,n))return wt;return St}function Zi(t,e){if(t===e)return St;if(t.mainDocumentPart!==e.mainDocumentPart||t.parts.size!==e.parts.size||!qi(t.partBytes,e.partBytes)||!Yi(t.relationships,e.relationships)||!Ji(t.externalTargets,e.externalTargets)||!Qi(t,e))return wt;let n=[];for(let[o,s]of t.parts){let l=e.parts.get(o);if(!l)return wt;s!==l&&n.push([s,l]);}if(n.length===0)return St;let[r,a]=n[0];if(n.length>1||r.name!==t.mainDocumentPart)return ea(n);let i=chunkGWV65NQW_cjs.pa(a.root,r.root);return i.undecided?ea(n):i.equal?St:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?wt:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunkGWV65NQW_cjs.g.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function pn(t){return {ok:false,reason:"package-invariant",detail:t}}function es(t,e){if(!t.parts.get(t.mainDocumentPart))return pn("no-main-document");for(let[r,a]of t.parts){let i=e?.parts.get(r);if(i===a)continue;let o=i?chunkGWV65NQW_cjs.ra(i,a):chunkGWV65NQW_cjs.qa(a);if(!o.ok)return pn(`invalid-part:${r}:${o.issues[0]?.code??"invalid"}`)}let n=chunkGWV65NQW_cjs.cc(t);return n.ok?null:pn(n.issues[0]?.code??"package-invariant")}function ta(t,e,n){let r=t.currentPackage(),a=Zi(e,r);if(a.equal)return {ok:true,change:null};let i=es(e,r);if(i)return i;let o=t.bodyStore().part.name,s=a.impact!=="global"&&e.mainDocumentPart===o;return chunkGWV65NQW_cjs.xa(t,()=>{let l=t.packageRevision;return t.installAuthoritativePackageSnapshot(e),{ok:true,change:t.publishStoryWrite({change:"model-change",fromRevision:l,toRevision:l+1,commitId:`pkg-remote-${l+1}`,origin:n.origin,...n.actorId?{actorId:n.actorId}:{},...n.operationId?{operationId:n.operationId}:{},dirty:s?a.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?a.dependencyKeys:[],impact:s?a.impact:"global",story:{kind:"body",partName:o}})}},()=>false)}function oa(t,e,n,r){let a=[...e],i=new Set;for(let o of a)t.parts.has(o)&&i.add(o);for(let o of n)na(o,a,i);for(let o of r)na(o,a,i);return i}function aa(t,e,n,r,a){let i=new Set(t);i.add(e),i.add(n);for(let o of r)ra(o,i);for(let o of a)ra(o,i);return i}function na(t,e,n){if(t.kind==="story"){n.add(t.partName);return}for(let r of e)(t.before.parts.has(r)||t.after.parts.has(r))&&n.add(r);}function ra(t,e){if(t.kind==="story"){e.add(t.partName);return}for(let n of t.before.parts.keys())e.add(n);for(let n of t.after.parts.keys())e.add(n);}var ia=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),ts=new Set(["deleteTableRow","deleteTableColumn","removeContentControl","removeRepeatingSectionItem"]),ns=64,sa=class{pkg;packageRev=0;body;stories=new Map;rIdToPartName=new Map;undoOrder=[];redoOrder=[];subscribers=new Set;historyLimit;maxEditableStoryParts;cascadeNoteReferences;lastChange=null;shellHyperlinks=Object.freeze([]);compositionSession=null;commitCounter=0;currentPackageMemo=null;constructor(e,n,r={}){this.pkg=chunkGWV65NQW_cjs.Ub(e,n),this.historyLimit=r.historyLimit??200,this.maxEditableStoryParts=r.maxEditableStoryParts??ns,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunkGWV65NQW_cjs.$e,this.body=new Fe(this.pkg,n.name,{historyLimit:this.historyLimit,settingsPart:()=>chunkGWV65NQW_cjs.me(this.pkg)}),this.body.setStoryRef({kind:"body",partName:n.name});}get packageRevision(){return this.packageRev}get canUndo(){return this.undoOrder.length>0}get canRedo(){return this.redoOrder.length>0}get lastModelChange(){return this.lastChange}bodyStore(){return this.body}currentPackage(){let e=this.currentPackageMemo;if(e&&e.pkg===this.pkg&&e.bodyPart===this.body.part){let a=0,i=true;for(let o of this.stories.values()){if(e.storyParts[a]!==o.part){i=false;break}a+=1;}if(i&&a===e.storyParts.length)return e.result}let n=chunkGWV65NQW_cjs.Ub(this.pkg,this.body.part),r=[];for(let a of this.stories.values())r.push(a.part),this.pkg.parts.has(a.part.name)&&(n=chunkGWV65NQW_cjs.Ub(n,a.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}resolveStory(e){return e.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:e.kind==="notesPart"?e.noteKind!=="footnote"&&e.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(e.noteKind)}:this.openNotesPartStore(e.noteKind):e.kind!=="headerFooter"||typeof e.rId!="string"||e.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(e.kind)}:this.openHeaderFooterStore(e.rId)}partFor(e){let n=this.resolveStory(e);return n.ok?n.store.part:null}revisionFor(e){let n=this.resolveStory(e);return n.ok?n.store.revision:null}transact(e,n,r={}){return chunkGWV65NQW_cjs.xa(this,()=>this.commitStoryTransaction(e,n,r),chunkGWV65NQW_cjs.ya)}commitStoryTransaction(e,n,r={}){let a=this.resolveStory(e);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let{store:i,story:o}=a,s=this.currentPackage(),l=i.historyDepth,d=i.compositionActive,c=i.checkpoint(),u=false,m=new Set,k=false,h=new Set,P=false,p,y=i.transact(g=>{n({...g,apply:O=>(O.op==="setListNumbering"&&O.numId!==null&&(P=true),O.op==="setParagraphProperties"&&(p??=O.properties.find(L=>L.localName==="pStyle")?.attributes?.val),u||(O.op==="deleteText"&&Fo(this.pkg,i.part,O,m)||O.op==="deleteBlock"&&$o(this.pkg,i.part,O,m)||ia.has(O.op))&&(u=true),k||(O.op==="deleteText"||O.op==="deleteBlock"?k=Bo(this.pkg,i.part,O,h):(ia.has(O.op)||ts.has(O.op))&&(k=true)),g.apply(O)),selectionBefore:O=>g.selectionBefore(O),selectionAfter:O=>g.selectionAfter(O)});},{...r,story:o,...o.kind==="headerFooter"||o.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!y.ok)return {ok:false,reason:y.reason,...y.detail?{detail:y.detail}:{}};if(this.syncPackageFromStore(i),P&&p){let g=Io(this.pkg,p);g&&this.replacePackageShell(g);}let f=false;if(y.change&&u){let g=this.currentPackage(),O=this.cascadeNoteReferences(s,g);if(O===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};O!==g&&(this.installPackageSnapshotInternal(O),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),f=true);}if(y.change&&k){let g=this.currentPackage(),O=chunkGWV65NQW_cjs.Sf(s,g,{storyPartName:o.partName});if(O===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};O!==g&&(this.installPackageSnapshotInternal(O),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),f=true);}if(y.change){this.packageRev+=1,!d&&(i.historyDepth>l||f)&&(f?this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage()}):this.pushUndoPointer({kind:"story",partName:o.partName,story:o}));let g=f?this.publishSynthetic(y.change.origin,"global",o,y.change.created):y.change;return f||this.publish(g),{ok:true,change:g}}return {ok:true,change:y.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(e,n=null){let r=this.resolveStory(e);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(e),!r.ok)?false:(this.compositionSession||(this.compositionSession={partName:r.story.partName,beforePackage:this.currentPackage(),storyCheckpoint:r.store.checkpoint(),packageWideEffects:false}),r.store.beginComposition(n),true)}endComposition(){let e=this.compositionSession;if(this.compositionSession=null,!e){this.body.endComposition();return}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return;let r=n.historyDepth;if(n.endComposition(),e.packageWideEffects){n.restoreHistoryStacks(e.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:e.beforePackage,after:this.currentPackage()});return}if(n.historyDepth>r){let a=e.partName===this.body.part.name?{kind:"body",partName:e.partName}:this.storyRefForPart(e.partName);a&&this.pushUndoPointer({kind:"story",partName:e.partName,story:a});}this.syncPackageFromStore(n);}cancelComposition(){let e=this.compositionSession;if(this.compositionSession=null,!e){this.body.cancelComposition();return}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(e.packageWideEffects){n&&n.restoreCheckpoint(e.storyCheckpoint),this.installPackageSnapshotInternal(e.beforePackage),this.packageRev+=1;let r=e.partName===this.body.part.name?{kind:"body",partName:e.partName}:this.storyRefForPart(e.partName);this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(e){return chunkGWV65NQW_cjs.xa(this,()=>this.commitLifecycleOp(e),chunkGWV65NQW_cjs.ya)}commitLifecycleOp(e){let n=this.currentPackage();if(chunkGWV65NQW_cjs.Ze(e)){let o=chunkGWV65NQW_cjs._e(n,e);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};if(o.package===n)return {ok:true,change:null};this.installPackageSnapshotInternal(o.package),this.pushUndoPointer({kind:"package",before:n,after:o.package}),this.packageRev+=1;let s={kind:"body",partName:this.body.part.name},l=this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationHuman,o.impact,s,o.createdPartName?[o.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:l}}if(!chunkGWV65NQW_cjs.Ed(e))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let r=chunkGWV65NQW_cjs.Fd(n,e);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};this.installPackageSnapshotInternal(r.package),this.pushUndoPointer({kind:"package",before:n,after:r.package}),this.packageRev+=1;let a={kind:"body",partName:this.body.part.name},i=this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationHuman,r.impact,a,r.createdPartName?[r.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:i}}undo(){let e=this.undoOrder.pop();if(!e)return null;if(e.kind==="package"){this.installPackageSnapshotInternal(e.before),this.redoOrder.push(e),this.packageRev+=1;let a=this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),a}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(e),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let e=this.redoOrder.pop();if(!e)return null;if(e.kind==="package"){this.installPackageSnapshotInternal(e.after),this.undoOrder.push(e),this.packageRev+=1;let a=this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),a}let n=e.partName===this.body.part.name?this.body:this.stories.get(e.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(e),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){let e=this.undoOrder[this.undoOrder.length-1];return !e||e.kind==="package"?null:(e.partName===this.body.part.name?this.body:this.stories.get(e.partName))?.selectionForUndo()??null}selectionForRedo(){let e=this.redoOrder[this.redoOrder.length-1];return !e||e.kind==="package"?null:(e.partName===this.body.part.name?this.body:this.stories.get(e.partName))?.selectionForRedo()??null}openStoryParts(){return sn(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return xo(this.stories,this.pkg)}insertImage(e,n){return Go(this,e,n)}applyFragmentPaste(e,n){return ko(this,e,n)}replaceImage(e,n,r,a,i,o){return un(this,e,n,r,a,i,o)}deleteImage(e,n){return Xo(this,e,n)}deleteImageTracked(e,n,r){return Yo(this,e,n,r)}embedExternalImage(e,n,r,a,i,o,s){return Jo(this,e,n,r,a,i,o,s)}setDrawingMetadataWithHyperlink(e,n,r,a,i){return qo(this,e,n,r,a,i)}applyImageProperties(e,n){return Qo(this,e,n)}promoteStoryTransactionToPackageUnit(e,n,r,a){this.installPackageSnapshotInternal(n.package),n.historyDepth>a&&n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:e,after:this.currentPackage()}),this.packageRev+=1;let i=n.part.name===this.body.part.name?{kind:"body",partName:n.part.name}:this.storyRefForPart(n.part.name);return this.publishSynthetic(chunkGWV65NQW_cjs.b.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(e){return e?(this.packageRev+=1,this.publish(e),e):null}adoptPackageUnit(e){let n=this.currentPackage();e!==n&&this.pushUndoPointer({kind:"package",before:e,after:n});}installPackageSnapshot(e){this.installPackageSnapshotInternal(e);}installAuthoritativePackageSnapshot(e){this.installPackageSnapshotInternal(e,false);}publishRemotePackage(e,n){return ta(this,e,n)}replacePackageShell(e){this.shellHyperlinks=wo(this.shellHyperlinks,this.pkg,e);let n=e;n=chunkGWV65NQW_cjs.Ub(n,this.body.part);for(let r of this.stories.values())e.parts.has(r.part.name)&&(n=chunkGWV65NQW_cjs.Ub(n,r.part));this.pkg=n;}installPackageSnapshotInternal(e,n=true){let r=n?Eo(e,this.pkg,this.shellHyperlinks):e,a=r.parts.get(r.mainDocumentPart);if(!a)return;this.body.replacePart(a);for(let[o,s]of this.stories){let l=r.parts.get(o);l&&s.replacePart(l);}this.rIdToPartName.clear();let i=r.relationships.get(r.mainDocumentPart)??[];for(let o of i){if(o.type!==dn&&o.type!==cn)continue;let s=chunkGWV65NQW_cjs.E(o);s.mode!=="Internal"||!s.target.ok||this.stories.has(s.target.partName)&&r.parts.has(s.target.partName)&&this.rIdToPartName.set(o.id,s.target.partName);}this.pkg=r,this.pkg=chunkGWV65NQW_cjs.Ub(this.pkg,this.body.part);for(let o of this.stories.values())this.pkg.parts.has(o.part.name)&&(this.pkg=chunkGWV65NQW_cjs.Ub(this.pkg,o.part));}openNotesPartStore(e){let n=chunkGWV65NQW_cjs.Me(this.currentPackage(),e);if(!n)return {ok:false,reason:"missing-part",detail:e};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:e},store:r};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let a=chunkGWV65NQW_cjs.yb(n),i=new Fe(a,{historyLimit:this.historyLimit,settingsPart:()=>chunkGWV65NQW_cjs.me(this.pkg)}),o={kind:"notesPart",partName:a.name,noteKind:e};return i.setStoryRef(o),this.stories.set(a.name,i),a!==n&&(this.pkg=chunkGWV65NQW_cjs.Ub(this.pkg,a)),{ok:true,story:o,store:i}}openHeaderFooterStore(e){let n=this.rIdToPartName.get(e);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:e},store:l}}let r=jo(this.currentPackage(),e);if(!r.ok)return r;let a=this.stories.get(r.partName);if(a)return this.rIdToPartName.set(e,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:e},store:a};if(this.openedStoryCount()>=this.maxEditableStoryParts&&this.evictUnreachableStories(),this.openedStoryCount()>=this.maxEditableStoryParts)return {ok:false,reason:"too-many-story-stores",detail:String(this.maxEditableStoryParts)};let i=chunkGWV65NQW_cjs.yb(r.part),o=new Fe(i,{historyLimit:this.historyLimit,settingsPart:()=>chunkGWV65NQW_cjs.me(this.pkg)}),s={kind:"headerFooter",partName:i.name,rId:e};return o.setStoryRef(s),this.stories.set(i.name,o),this.rIdToPartName.set(e,i.name),i!==r.part&&(this.pkg=chunkGWV65NQW_cjs.Ub(this.pkg,i)),{ok:true,story:s,store:o}}storyRefForPart(e){if(e===this.body.part.name)return {kind:"body",partName:e};for(let[r,a]of this.rIdToPartName)if(a===e)return {kind:"headerFooter",partName:e,rId:r};let n=this.currentPackage().parts.get(e);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:e,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:e,noteKind:"endnote"}:null}syncPackageFromStore(e){this.pkg=chunkGWV65NQW_cjs.Ub(this.pkg,e.part);}pushUndoPointer(e){this.undoOrder.push(e),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let e=oa(this.pkg,this.stories.keys(),this.undoOrder,this.redoOrder);for(let[a]of [...this.stories])if(!e.has(a)){this.stories.delete(a);for(let[i,o]of [...this.rIdToPartName])o===a&&this.rIdToPartName.delete(i);}let n=aa(e,this.pkg.mainDocumentPart,this.body.part.name,this.undoOrder,this.redoOrder),r=Co(this.pkg,n);r!==this.pkg&&(this.pkg=r),this.shellHyperlinks=To(this.shellHyperlinks,n,this.pkg.mainDocumentPart);}publish(e){this.lastChange=e;for(let n of this.subscribers)n(e);}publishSynthetic(e,n,r,a){this.commitCounter+=1;let i=this.packageRev-1,o={change:"model-change",fromRevision:i<0?0:i,toRevision:this.packageRev,commitId:`pkg-commit-${this.commitCounter}`,origin:e,dirty:[],created:[...a],deleted:[],splitJoin:[],dependencyKeys:[],impact:n,story:r};return this.publish(o),o}};function rs(t,e,n){for(let r of t.attributes)if(r.localName===n&&r.namespaceUri===e)return r.value}function la(t,e){if(!t){let o=chunkGWV65NQW_cjs.Bb(e);return o?chunkGWV65NQW_cjs.Cb(new Set,o,chunkGWV65NQW_cjs.zb):"0"}let n=-1,r=new Set,a=o=>{if(o.kind!=="textValue"){if(o.kind==="comment"){let s=rs(o,chunkGWV65NQW_cjs.ca,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunkGWV65NQW_cjs.zb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of o.children)a(s);}};a(t.root);let i=chunkGWV65NQW_cjs.Bb(e);return i?chunkGWV65NQW_cjs.Cb(r,i,chunkGWV65NQW_cjs.zb):String(n+1)}var os=256,as=65535,da=64;function Tt(t,e){return t.length>e}function ca(t){return typeof t!="string"||t.trim().length===0?"invalid-author":Tt(t,os)?"resource-limit":chunkGWV65NQW_cjs.O(t)?null:"invalid-author"}function ma(t){return typeof t!="string"||t.length===0?"invalid-text":Tt(t,as)?"resource-limit":chunkGWV65NQW_cjs.O(t)?null:"invalid-text"}function fn(t){if(typeof t!="string")return {ok:false,rejection:"invalid-date"};let e=t.trim();if(Tt(e,da))return {ok:false,rejection:"resource-limit"};if(!chunkGWV65NQW_cjs.O(e))return {ok:false,rejection:"invalid-date"};let n=chunkGWV65NQW_cjs.ye(e);return n===null?{ok:false,rejection:"invalid-date"}:Tt(n,da)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function Ic(t){if(t===void 0)return null;let e=fn(t);return e.ok?null:e.rejection}function gn(t){switch(t){case "invalid-author":return "invalid-author";case "invalid-text":return "invalid-text";case "invalid-date":return "invalid-property-value";case "resource-limit":return "resource-limit"}}function ua(t,e){if(t.kind==="textValue")return t;let n=e.get(t.id);if(n!==void 0)return n;let r=false,a=[];for(let i of t.children){let o=ua(i,e);o!==i&&(r=true),a.push(o);}return r?{...t,children:a}:t}function ls(t,e,n){let r=ua(t.root,e);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:t.root.id,nodeId:t.root.id}]};let a=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunkGWV65NQW_cjs.fa}]};return chunkGWV65NQW_cjs.Ga(t,t.root.id,a,{deferValidation:true})}function pa(t,e,n){let r=new Map;for(let i of e){if(i.stampParagraph===null)continue;let o=r.get(i.commentsPartName);o||(o=new Map,r.set(i.commentsPartName,o)),o.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let a=t;for(let[i,o]of r){let s=a.parts.get(i);if(!s)return null;let l=chunkGWV65NQW_cjs.wb(s.root),d=l??"w14",c=new Map;for(let m of o.values())c.set(m.paragraph.id,n(m.paragraph,m.paraId,d));let u=ls(s,c,l===null?d:null);if(!u.ok)return null;a=chunkGWV65NQW_cjs.Ub(a,u.part);}return a}function fa(t,e,n){let r=t.root.children.map(a=>a.kind==="textValue"?a:e.get(a.id)??a);return chunkGWV65NQW_cjs.Ea(t,t.root.id,[...r,...n],{deferValidation:true})}var ya="/word/comments.xml",ka="/word/commentsExtended.xml",Pn="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",On="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",ds=[On,"application/vnd.ms-word.commentsExtended+xml"],xa="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",In="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",ke="http://schemas.microsoft.com/office/word/2012/wordml";function ot(t,e,n){for(let r of t.attributes)if(r.localName===n&&r.namespaceUri===e)return r.value}function je(t,e){return {kind:"genericExtension",namespaceUri:chunkGWV65NQW_cjs.ca,localName:t,prefix:"w",value:e}}function ge(t,e,n,r,a,i,o,s=[]){return {id:t,kind:e,namespaceUri:n,localName:a,prefix:r,namespaceBindings:s,attributes:i,children:o}}function Pa(t,e,n,r,a){let i=e===t.mainDocumentPart?[e]:[e,t.mainDocumentPart];for(let o of i)for(let s of chunkGWV65NQW_cjs.Wb(t,o)){if(s.type!==n)continue;let l=chunkGWV65NQW_cjs.w(o,s.rawTarget);if(!l.ok)continue;if(!t.parts.has(l.partName))return l.partName;let d=chunkGWV65NQW_cjs.Xb(t,l.partName);if(d!==null&&(typeof r=="string"?d===r:r.includes(d)))return l.partName}return a}function hn(t,e,n){let r=t.mainDocumentPart;for(let i of chunkGWV65NQW_cjs.Wb(t,r)){if(i.type!==e)continue;let o=chunkGWV65NQW_cjs.w(r,i.rawTarget);if(o.ok&&o.partName===n)return t}let a=chunkGWV65NQW_cjs.$b(t,r);return chunkGWV65NQW_cjs.ac(a,r,e,chunkGWV65NQW_cjs.cg(r,n)).pkg}function Rn(t,e){return Pa(t,e,xa,Pn,ya)}function Oa(t,e){let n=chunkGWV65NQW_cjs.cf(t,e),r=chunkGWV65NQW_cjs.df(t,e,n).extended;return r!==null?r:Pa(t,e,In,ds,ka)}function ga(t){let e=new Set;for(let n of t.parts.values())for(let r of chunkGWV65NQW_cjs.vb(n.root))e.add(r);return e}function cs(t,e){if(!t)return null;let n=null,r=a=>{if(!(n!==null||a.kind==="textValue")){if(a.kind==="comment"&&ot(a,chunkGWV65NQW_cjs.ca,"id")===e){for(let i=a.children.length-1;i>=0;i-=1){let o=a.children[i];if(o.kind!=="paragraph")continue;let s=ot(o,chunkGWV65NQW_cjs.fa,"paraId");s!==void 0&&chunkGWV65NQW_cjs.rb(s)&&(n=s.toUpperCase());return}return}for(let i of a.children)r(i);}};return r(t.root),n}function ms(t,e){if(!t)return null;let n=null,r=a=>{if(!(n!==null||a.kind==="textValue")){if(a.kind==="comment"&&ot(a,chunkGWV65NQW_cjs.ca,"id")===e){for(let i=a.children.length-1;i>=0;i-=1){let o=a.children[i];if(o.kind==="paragraph"){n=o;return}}return}for(let i of a.children)r(i);}};return r(t.root),n}function Ia(t){let e=chunkGWV65NQW_cjs.wb(t.root);if(e!==null)return {part:t,prefix:e};let n={...t.root,namespaceBindings:[...t.root.namespaceBindings,{prefix:"w14",namespaceUri:chunkGWV65NQW_cjs.fa}]},r=chunkGWV65NQW_cjs.Ga(t,t.root.id,n,{deferValidation:true});return {part:r.ok?r.part:{...t,root:n},prefix:"w14"}}function Ra(t,e,n){return ge(t.id,"paragraph",t.namespaceUri,t.prefix??"w",t.localName,[...t.attributes.filter(r=>!(r.namespaceUri===chunkGWV65NQW_cjs.fa&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunkGWV65NQW_cjs.fa,localName:"paraId",prefix:n,value:e}],t.children,t.namespaceBindings)}function us(t,e,n,r){let a=t.parts.get(e);if(!a)return t;let i=Ia(a),o=chunkGWV65NQW_cjs.Ca(i.part,n);if(!o||o.kind!=="paragraph")return chunkGWV65NQW_cjs.Ub(t,i.part);let s=chunkGWV65NQW_cjs.Ga(i.part,o.id,Ra(o,r,i.prefix),{deferValidation:true});return chunkGWV65NQW_cjs.Ub(t,s.ok?s.part:i.part)}function ps(t,e,n,r){let a=`${ya}#comment-${t}`,i=n.text!==n.text.trim(),o=ge(`${a}.t`,"text",chunkGWV65NQW_cjs.ca,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunkGWV65NQW_cjs.da,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${a}.tv`,kind:"textValue",value:n.text}]),s=ge(`${a}.rPr`,"runProperties",chunkGWV65NQW_cjs.ca,"w","rPr",[],[ge(`${a}.rStyle`,"generic",chunkGWV65NQW_cjs.ca,"w","rStyle",[je("val","CommentReference")],[])]),l=ge(`${a}.r`,"run",chunkGWV65NQW_cjs.ca,"w","r",[],[s,o]),d=ge(`${a}.pPr`,"paragraphProperties",chunkGWV65NQW_cjs.ca,"w","pPr",[],[ge(`${a}.pStyle`,"generic",chunkGWV65NQW_cjs.ca,"w","pStyle",[je("val","CommentText")],[])]),c=ge(`${a}.p`,"paragraph",chunkGWV65NQW_cjs.ca,"w","p",[{kind:"genericExtension",namespaceUri:chunkGWV65NQW_cjs.fa,localName:"paraId",prefix:r,value:e}],[d,l]);return ge(a,"comment",chunkGWV65NQW_cjs.ca,"w","comment",[je("id",t),je("author",n.author),...n.initials===void 0?[]:[je("initials",n.initials)],...n.date===void 0?[]:[je("date",n.date)]],[c])}function yn(t,e){let n=chunkGWV65NQW_cjs.ta(e,{name:t,contentType:"application/xml"});return n.ok?n.part.root:null}function ba(t,e){for(let y of [ca(e.author),ma(e.text)])if(y)return {ok:false,reason:gn(y)};let n;if(e.date!==void 0){let y=fn(e.date);if(!y.ok)return {ok:false,reason:gn(y.rejection)};n=y.value;}let r={...e,...n===void 0?{}:{date:n}},a=t.package,i=t.part.name,o=Rn(a,i),s=Oa(a,i),l=a.parts.get(o),d=la(l,r.actorId),c=chunkGWV65NQW_cjs.ub(`${o}#${d}`,ga(a)),u=e.replyToCommentId===void 0?null:cs(l,e.replyToCommentId),m=e.replyToCommentId!==void 0&&u===null?ms(l,e.replyToCommentId):null;if(e.replyToCommentId!==void 0&&u===null&&!m)return {ok:false,reason:"unknown-revision"};let k=m?chunkGWV65NQW_cjs.ub(`${o}#parent-${e.replyToCommentId}`,new Set([...ga(a),c])):null,h=u??k,P=e.anchor.endParagraphId??e.anchor.paragraphId,p=t.transact(y=>{y.applyPackage(f=>{let g=f.parts.has(o)?f:(()=>{let O=yn(o,`<w:comments xmlns:w="${chunkGWV65NQW_cjs.ca}"/>`);return O?chunkGWV65NQW_cjs.bc(f,o,O,Pn):null})();return g===null?f:hn(g,xa,o)}),m&&k&&y.applyPackage(f=>us(f,o,m.id,k)),y.applyPackage(f=>{let g=f.parts.get(o);if(!g)return f;let O=Ia(g),L=chunkGWV65NQW_cjs.Fa(O.part,O.part.root.id,O.part.root.children.length,[ps(d,c,r,O.prefix)],{deferValidation:true});return L.ok?chunkGWV65NQW_cjs.Ub(f,L.part):f}),h!==null&&(y.applyPackage(f=>{let g=f.parts.has(s)?f:(()=>{let O=yn(s,`<w15:commentsEx xmlns:w15="${ke}"/>`);return O?chunkGWV65NQW_cjs.bc(f,s,O,On):null})();return g===null?f:hn(g,In,s)}),y.applyPackage(f=>{let g=f.parts.get(s);if(!g)return f;let L=[...fs(g).has(h.toUpperCase())?[]:[xn(`${s}#ex-${h}`,h,void 0,false)],xn(`${s}#ex-${c}`,c,h,false)],U=chunkGWV65NQW_cjs.Fa(g,g.root.id,g.root.children.length,L,{deferValidation:true});return U.ok?chunkGWV65NQW_cjs.Ub(f,U.part):f})),y.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:e.anchor.end,commentId:d,marker:"reference"}),y.applyTo(i,{op:"insertCommentMarker",paragraphId:P,offset:e.anchor.end,commentId:d,marker:"end"}),y.applyTo(i,{op:"insertCommentMarker",paragraphId:e.anchor.paragraphId,offset:e.anchor.start,commentId:d,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return p.ok?{ok:true,commentId:d,change:p.change}:{ok:false,reason:p.reason}}function kn(t){for(let e=t.children.length-1;e>=0;e-=1){let n=t.children[e];if(n.kind==="paragraph")return n}return null}function ha(t){let e=kn(t);if(!e)return null;let n=ot(e,chunkGWV65NQW_cjs.fa,"paraId");return n!==void 0&&chunkGWV65NQW_cjs.rb(n)?n.toUpperCase():null}function fs(t){let e=new Map;if(!t)return e;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===ke&&r.localName==="commentEx"){let a=ot(r,ke,"paraId");a!==void 0&&chunkGWV65NQW_cjs.rb(a)&&e.set(a.toUpperCase(),r);}for(let a of r.children)n(a);}};return n(t.root),e}function rt(t,e){return {kind:"genericExtension",namespaceUri:ke,localName:t,prefix:"w15",value:e}}function gs(t,e){return {id:t.id,kind:"generic",namespaceUri:t.namespaceUri,localName:t.localName,...t.prefix===void 0?{}:{prefix:t.prefix},namespaceBindings:t.namespaceBindings,attributes:e,children:t.children}}function hs(t,e,n){let r=[],a=false,i=false;for(let o of t.attributes){if(o.namespaceUri===ke&&o.localName==="done"){a=true,r.push({kind:"genericExtension",namespaceUri:o.namespaceUri,localName:o.localName,...o.prefix===void 0?{}:{prefix:o.prefix},value:n?"1":"0"});continue}o.namespaceUri===ke&&o.localName==="paraIdParent"&&(i=true),r.push(o);}return !i&&e!==void 0&&r.push(rt("paraIdParent",e)),a||r.push(rt("done",n?"1":"0")),gs(t,r)}function xn(t,e,n,r){return {id:t,kind:"generic",namespaceUri:ke,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[rt("paraId",e),...n===void 0?[]:[rt("paraIdParent",n)],rt("done",r?"1":"0")],children:[]}}function va(t,e,n){return ys(t,e,n,chunkGWV65NQW_cjs.bf())}function ys(t,e,n,r){let a=t.package,i=t.part.name;if(chunkGWV65NQW_cjs.cf(a,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunkGWV65NQW_cjs.ff(a,e,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunkGWV65NQW_cjs.ef(a,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let d=l.used,c=new Map,u=[];for(let P of s.ids){let p=s.records.get(P);if(!p)return {ok:false,reason:"unknown-comment"};if(!kn(p.node))return {ok:false,reason:"unknown-comment"};let f=ha(p.node),g=f??chunkGWV65NQW_cjs.ub(`${p.partName}#done-${P}`,d);f===null&&d.add(g),c.set(P,g);}for(let P of s.ids){let p=s.records.get(P),y=kn(p.node),f=c.get(P),g=ha(p.node),O=s.parentCommentIdByChildId.get(P),L=s.parentParaIdByCommentId.get(P)??(O===void 0?void 0:c.get(O)),U=s.commentExByParaId.get(f);u.push({paraId:f,stampParagraph:g===null?y:null,commentsPartName:p.partName,parentParaId:L,existing:U?.node,existingParentParaId:U?.parentParaId,existingDone:U?.done??false});}if(u.length===0)return {ok:false,reason:"unknown-comment"};if(u.every(P=>P.existingDone===n))return {ok:true,changed:false,change:null};let m=s.extendedPartName??ka,k=s.extendedPartName===null,h=t.transact(P=>{P.applyPackage(p=>{let y=pa(p,u,Ra);if(y===null)return p;let f=y;if(!f.parts.has(m)){let S=yn(m,`<w15:commentsEx xmlns:w15="${ke}"/>`);if(!S)return p;let F=chunkGWV65NQW_cjs.bc(f,m,S,On);f=k?hn(F,In,m):F;}let g=f.parts.get(m);if(!g)return p;let O=new Map,L=[];for(let S of u){let F=S.existingParentParaId??S.parentParaId;S.existing?O.set(S.existing.id,hs(S.existing,F,n)):L.push(xn(`${m}#done-${S.paraId}`,S.paraId,F,n));}let U=fa(g,O,L);return U.ok?chunkGWV65NQW_cjs.Ub(f,U.part):p});});return h.ok?{ok:true,changed:true,change:h.change}:{ok:false,reason:h.reason}}function Wc(t,e){let n=Rn(t,e);return t.parts.has(n)&&chunkGWV65NQW_cjs.Xb(t,n)===Pn}function Kc(t,e){return Rn(t,e)}function zc(t,e){return Oa(t,e)}var Na={kind:"body"};function Qc(t,e,n=Na){let r=n.kind==="body"?null:t.resolveStory(n),a=r?.ok?r.store:t.bodyStore(),i=t.currentPackage(),o=a.checkpoint();return a.graftPackage(()=>t.currentPackage()),chunkGWV65NQW_cjs.xa(t,()=>{let s=ba(a,e);return s.ok&&(a.restoreHistoryStacks(o),t.replacePackageShell(a.package),t.adoptPackageUnit(i),t.publishStoryWrite(s.change)),s},s=>chunkGWV65NQW_cjs.ya(s))}function Zc(t,e,n){let r=t.bodyStore(),a=t.currentPackage(),i=r.checkpoint();return r.graftPackage(()=>t.currentPackage()),chunkGWV65NQW_cjs.xa(t,()=>{let o=va(r,e,n);return !o.ok||!o.changed||(r.restoreHistoryStacks(i),t.replacePackageShell(r.package),t.adoptPackageUnit(a),t.publishStoryWrite(o.change)),o},o=>o.ok&&o.changed)}function em(t,e,n=Na,r){if(e.length===0)return false;let a=n.kind==="body"?t.bodyStore().part:t.partFor(n);if(!a)return false;let i={storyPartName:a.name,...r===void 0?{}:{noteId:r}},o=t.bodyStore(),s=t.currentPackage(),l=o.checkpoint();return o.graftPackage(()=>t.currentPackage()),chunkGWV65NQW_cjs.xa(t,()=>{let d=false,c=false,u=o.transact(m=>{m.applyPackage(k=>{let h=k;for(let P of e){let p=P.parentCommentId===void 0?chunkGWV65NQW_cjs.Qf(h,P.commentId,i):chunkGWV65NQW_cjs.Rf(h,P.commentId,P.parentCommentId,i);if(p===null)return d=true,k;c||=p!==h,h=p;}return h});});return d||!u.ok||!c?false:(o.restoreHistoryStacks(l),t.installPackageSnapshot(o.package),t.adoptPackageUnit(s),t.publishStoryWrite(u.change),true)},d=>d)}var ks=256*1024,xs=4096;function wa(t,e,n){let r=e.payload,a=t.part.name,i=n??a;if(r){if(r.data.length>ks)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>xs)return {ok:false,reason:"payload-too-large",detail:"label"}}let o=new Set(chunkGWV65NQW_cjs.uf(t.part.root).map(m=>m.node.id)),s=e.replaceControlId===void 0?[]:Ta(t,a,e.replaceControlId),l=null,d,c=t.transact(m=>{if(e.replaceControlId!==void 0){m.apply({op:"removeContentControl",controlId:e.replaceControlId,keepContent:false});for(let P of s)m.applyPackage(p=>chunkGWV65NQW_cjs.kg(p,P.partName,P.nodeId));}let k=e.replaceUntil;if(k!==void 0&&k<=e.offset){l="invalid-range",d="replaceUntil must be past offset";return}if(k!==void 0&&m.apply({op:"deleteText",paragraphId:e.paragraphId,start:e.offset,end:k}),!r){m.apply({op:"insertInlineContentControl",paragraphId:e.paragraphId,offset:e.offset,tag:e.tag,text:e.text,...e.alias===void 0?{}:{alias:e.alias},...e.lock===void 0?{}:{lock:e.lock}});return}let h=null;m.applyPackage(P=>{let p=chunkGWV65NQW_cjs.fg(P,i,r.namespaceUri,r.rootLocalName);if(!p.part)return l="store-not-authored",d=`no customXml store could be created for ${r.namespaceUri}. The namespace must be free of control characters and quotes, the root name must be an XML name, and a store this document already carries for that namespace must use the same root name (${r.rootLocalName})`,P;if(h=chunkGWV65NQW_cjs.pg(p.part,r.rootLocalName,r.nodeId),!h)return l="unaddressable-payload",d=`the node id ${JSON.stringify(r.nodeId)} or the namespace ${JSON.stringify(r.namespaceUri)} cannot be written into an XPath. Ids and root names must match [A-Za-z_][\\w.-]{0,127}; a namespace may not contain a quote, an angle bracket or an ampersand`,P;let y=chunkGWV65NQW_cjs.jg(p.pkg,p.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunkGWV65NQW_cjs.ig(y,p.part.partName,r.nodeId)?y:(l="store-not-authored",d="the payload node could not be written into the store",P)}),!(l!==null||!h)&&m.apply({op:"insertInlineContentControl",paragraphId:e.paragraphId,offset:e.offset,tag:e.tag,text:e.text,...e.alias===void 0?{}:{alias:e.alias},...e.lock===void 0?{}:{lock:e.lock},dataBinding:h});});if(l!==null)return {ok:false,reason:l,...d===void 0?{}:{detail:d}};if(!c.ok)return {ok:false,reason:c.reason,...c.detail===void 0?{}:{detail:c.detail}};let u=Ps(t,o);return {ok:true,change:c.change,...u===void 0?{}:{nodeId:u}}}function Ps(t,e){for(let n of chunkGWV65NQW_cjs.uf(t.part.root))if(!e.has(n.node.id))return n.node.id}function Ta(t,e,n){let r=chunkGWV65NQW_cjs.uf(t.part.root).find(i=>i.node.id===n);if(!r)return [];let a=[];for(let i of chunkGWV65NQW_cjs.dg(t.package,e)){let o=chunkGWV65NQW_cjs.sg(r.node,i.itemId);o!==null&&a.push({partName:i.partName,nodeId:o});}return a}function Ea(t,e){let n=t.part.name,r=Ta(t,n,e),a=t.transact(i=>{i.apply({op:"removeContentControl",controlId:e,keepContent:false});for(let o of r)i.applyPackage(s=>chunkGWV65NQW_cjs.kg(s,o.partName,o.nodeId));});return a.ok?{ok:true,change:a.change}:{ok:false,reason:a.reason,...a.detail===void 0?{}:{detail:a.detail}}}function im(t,e,n){if(!t.parts.has(e)||n.length===0)return {ok:true,pkg:t,removed:[]};let r=t,a=[];for(let i of n){let o=chunkGWV65NQW_cjs.eg(r,e,i);if(!o)continue;let s=chunkGWV65NQW_cjs.rg(r,o.itemId),l=chunkGWV65NQW_cjs.lg(r,o.partName,s);if(l.pkg===r&&chunkGWV65NQW_cjs.hg(r,o.partName).some(d=>!s.has(d.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,a.push(...l.removed);}return {ok:true,pkg:r,removed:a}}var Sa=new WeakMap;function Os(t,e){let n=Sa.get(t);n||(n=new Map,Sa.set(t,n));let r=n.get(e);if(r)return r;let a=chunkGWV65NQW_cjs.dg(t,e).map(i=>({itemId:i.itemId,nodes:new Map(chunkGWV65NQW_cjs.hg(t,i.partName).map(o=>[o.id,o]))}));return n.set(e,a),a}function sm(t,e,n=e){let r=new Map,a=t.parts.get(e);if(!a)return r;let i=Os(t,n);if(i.length===0)return r;for(let o of chunkGWV65NQW_cjs.uf(a.root))for(let s of i){let l=chunkGWV65NQW_cjs.sg(o.node,s.itemId);if(l===null)continue;let d=s.nodes.get(l);if(d){r.set(o.node.id,{nodeId:l,label:d.label,data:d.data});break}}return r}function lm(t,e,n){let r=new Map,a=chunkGWV65NQW_cjs.eg(t,e,n);if(!a)return r;for(let i of chunkGWV65NQW_cjs.hg(t,a.partName))r.set(i.id,{label:i.label,data:i.data});return r}var Ca={kind:"body"};function Ma(t,e,n){let r=e.kind==="body"?null:t.resolveStory(e),a=r?.ok?r.store:t.bodyStore(),i=t.currentPackage(),o=a.checkpoint();return a.graftPackage(()=>t.currentPackage()),chunkGWV65NQW_cjs.xa(t,()=>{let s=n(a);return s.ok&&(a.restoreHistoryStacks(o),t.replacePackageShell(a.package),t.adoptPackageUnit(i),t.publishStoryWrite(s.change)),s},s=>chunkGWV65NQW_cjs.ya(s))}function um(t,e,n=Ca){return Ma(t,n,r=>wa(r,e,t.bodyStore().part.name))}function pm(t,e,n=Ca){return Ma(t,n,r=>Ea(r,e))}var Ve="proposed";function Is(t,e){switch(t){case "revisionInsert":case "revisionMoveTo":return e!=="original";case "revisionDelete":case "revisionMoveFrom":return e!=="proposed";default:return false}}var Rs=32;function bn(t,e=Ve){let n=[];return at(t.children,e,0,n),n}function vn(t,e,n,r,a=Ve){let i=[];for(let o of bn(t,a)){let s=e.get(o.id);if(!s||s.end<=s.start)continue;let l=Math.max(s.start,n),d=Math.min(s.end,r);l>=d||i.push({run:o,start:l,end:d});}return i}function at(t,e,n,r){if(!(n>=Rs)){for(let a of t)if(!(a.kind==="textValue"||a.kind==="paragraphProperties")){if(a.kind==="run"){r.push(a);continue}if(a.kind==="hyperlink"){at(a.children,e,n+1,r);continue}if(chunkGWV65NQW_cjs.ja(a.kind)){if(!Is(a.kind,e))continue;at(a.children,e,n+1,r);continue}if(chunkGWV65NQW_cjs.Mc(a)){at(a.children,e,n+1,r);continue}if(chunkGWV65NQW_cjs.ue(a)){let i=chunkGWV65NQW_cjs.ve(a);i&&at(i.children,e,n+1,r);continue}}}}var bs=new Set(chunkGWV65NQW_cjs.Xe),Sn=new Set(chunkGWV65NQW_cjs.We);function vm(t){return Sn.has(t)}function Et(t,e,n){return !t||t.kind==="textValue"?void 0:t.children.find(a=>a.kind===e||a.kind==="generic"&&a.localName===n&&a.namespaceUri===chunkGWV65NQW_cjs.ca)}function wn(t,e){if(!t||t.kind==="textValue")return [];let n=[];for(let r of t.children){if(r.kind==="textValue"||!e.has(r.localName))continue;let a=chunkGWV65NQW_cjs.J();for(let i of r.attributes)a[i.localName]=i.value;n.push(Object.keys(a).length>0?{localName:r.localName,attributes:a}:{localName:r.localName});}return n}function Nm(t,e){let n=chunkGWV65NQW_cjs.Ca(t,e);return wn(Et(n,"paragraphProperties","pPr"),bs)}function vs(t,e){let n=chunkGWV65NQW_cjs.Ca(t,e),r=Et(n,"paragraphProperties","pPr");return wn(Et(r,"runProperties","rPr"),Sn)}function Da(t,e){let n=Array.isArray(e)?e:[e],r=new Set(n.map(i=>i.localName));return [...t.filter(i=>!r.has(i.localName)),...n]}var Ns=new Map([["ascii","asciiTheme"],["hAnsi","hAnsiTheme"],["eastAsia","eastAsiaTheme"],["cs","cstheme"]]);function Ss(t,e){let n=t.find(a=>a.localName==="rFonts")?.attributes;if(!n)return e;let r={...n,...e.attributes??{}};for(let a of Object.keys(e.attributes??{})){let i=Ns.get(a);i&&delete r[i];}return {localName:"rFonts",attributes:r}}function Tn(t){let e=new Map;for(let n of chunkGWV65NQW_cjs.Ee(t)){let r=n.formatRunIds&&n.formatRunIds.length>0?n.formatRunIds:n.runId?[n.runId]:[];for(let a of r){let i=e.get(a);i?(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end)):e.set(a,{start:n.start,end:n.end});}}return e}function ws(t){let e=new Set;for(let n of chunkGWV65NQW_cjs.Ee(t))if(n.formatRunIds)for(let r of n.formatRunIds)e.add(r);return e}function Nn(t,e){if(e.localName==="rFonts")return Ss(t,e);if(e.localName!=="u")return e;let n=t.find(r=>r.localName==="u")?.attributes;return n?{localName:"u",attributes:{...n,...e.attributes??{}}}:e}function Sm(t,e,n){let r=vs(t,e),a=Array.isArray(n)?n:[n];return Da(r,a.map(i=>Nn(r,i)))}function Ts(t,e){return Array.isArray(e)?e.map(n=>Nn(t,n)):Nn(t,e)}function wm(t,e,n,r,a,i=Ve){let o=chunkGWV65NQW_cjs.Ca(t,e);if(!o||o.kind!=="paragraph")return [];let s=[],l=ws(o);for(let d of vn(o,Tn(o),n,r,i)){let c=wn(Et(d.run,"runProperties","rPr"),Sn);s.push({start:d.start,end:d.end,properties:Da(c,Ts(c,a)),...l.has(d.run.id)?{targetRunIds:[d.run.id]}:{}});}return s}function Tm(t,e,n,r,a=Ve){let i=chunkGWV65NQW_cjs.Ca(t,e);if(!i||i.kind!=="paragraph"||r<=n)return [];let o=[];for(let s of vn(i,Tn(i),n,r,a)){let l=o[o.length-1];l&&s.start<=l.end?l.end=Math.max(l.end,s.end):o.push({start:s.start,end:s.end});}return o}function Em(t,e,n,r,a=Ve){let i=chunkGWV65NQW_cjs.Ca(t,e);if(!i||i.kind!=="paragraph")return [];let o=Tn(i),s=[];for(let l of bn(i,a)){let d=o.get(l.id);if(!d||d.end<=d.start)continue;(r>n?Math.max(d.start,n)<Math.min(d.end,r):d.start<=n&&n<d.end)&&s.push(l);}return s}function En(t){let e=_a.get(t.root);if(e)return e;let n=new Map,r=o=>{let s=Aa.get(o);if(s){for(let[d,c]of s)n.set(d,c);return}let l=new Map;Cs(o,l),Aa.set(o,l);for(let[d,c]of l)n.set(d,c);},a=(o,s)=>{if(!(o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){r(o);return}for(let l of o.children)a(l,s+1);}};a(t.root,0);let i=(o,s)=>{if(!(o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){let l=Ua.get(o);if(!l){let d=[];La(o,0,d),l=d,Ua.set(o,l);}for(let[d,c]of l)n.set(d,c);return}if(o.kind==="tableRow"){let l=Ct.get(o);l||(l=Fa(o),Ct.set(o,l));for(let[d,c]of l)n.set(d,c);}for(let l of o.children)i(l,s+1);}};return i(t.root,0),_a.set(t.root,n),n}function La(t,e,n){if(!(t.kind==="textValue"||e>64)){if(t.kind==="tableRow"){let r=Ct.get(t);r||(r=Fa(t),Ct.set(t,r));for(let a of r)n.push(a);}for(let r of t.children)La(r,e+1,n);}}function Fa(t){let e=null,n=(o,s)=>{if(!(e||o.kind==="textValue"||s>64)){if(o.kind==="paragraph"){e=o;return}for(let l of o.children)n(l,s+1);}};if(n(t,0),!e)return Es;let r={paragraphId:e.id,start:0,end:0},a=[],i=(o,s,l)=>{if(o.kind==="textValue"||l>64||o.kind==="paragraph")return;let d=s==="trPr"&&(o.localName==="ins"||o.localName==="del"),c=s==="tcPr"&&(o.localName==="cellIns"||o.localName==="cellDel");(d||c)&&a.push([o.id,r]);for(let u of o.children)i(u,o.localName,l+1);};return i(t,void 0,0),a}var Es=[],Aa=new WeakMap,_a=chunkGWV65NQW_cjs.Jf(8),Ct=new WeakMap,Ua=new WeakMap;function Cs(t,e){let n=chunkGWV65NQW_cjs.Fe(t),r=(o,s,l,d)=>{if(!(o.kind==="textValue"||d>64)){e.set(o.id,{paragraphId:t.id,start:s,end:l});for(let c of o.children)r(c,s,l,d+1);}},a=(o,s)=>{if(o.kind==="textValue"||s>64)return;let l=n.spanOf(o);if(o.kind==="run"){if(!l)return;e.set(o.id,{paragraphId:t.id,start:l.start,end:l.end});for(let d of o.children)d.kind==="runProperties"&&r(d,l.start,l.end,s+1);return}l&&e.set(o.id,{paragraphId:t.id,start:l.start,end:l.end});for(let d of o.children)a(d,s+1);};for(let o of t.children)o.kind!=="paragraphProperties"&&a(o,0);let i=t.children.find(o=>o.kind==="paragraphProperties");i&&r(i,n.length,n.length,0);}function _m(t){return `${t.kind}-${t.id}`}function Ha(t){return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}function Ms(t){return Ha(t)[0]??null}function Cn(t,e){let n=Ms(t);if(!n)return Number.MAX_SAFE_INTEGER;let r=e.get(n.start.paragraphId);return r===void 0?Number.MAX_SAFE_INTEGER:r*1e6+Math.min(n.start.offset,999999)}function Ds(t,e){let n=e.get(t.start.paragraphId),r=e.get(t.end.paragraphId);return n===void 0||r===void 0?Number.MAX_SAFE_INTEGER:(r-n)*1e6+(t.end.offset-t.start.offset)}var As=0,_s=1,Us=2;function Ls(t,e,n){let r=n.get(e.paragraphId),a=n.get(t.start.paragraphId),i=n.get(t.end.paragraphId);return r===void 0||a===void 0||i===void 0||r<a||r>i||r===a&&e.offset<t.start.offset||r===i&&e.offset>t.end.offset?null:a===i&&t.start.offset===t.end.offset?As:r===i&&e.offset===t.end.offset?Us:_s}function Fs(t,e,n){let r=null;for(let a of Ha(t)){let i=Ls(a,e,n);if(i===null)continue;let o=Ds(a,n);(r===null||i<r.grip||i===r.grip&&o<r.width)&&(r={grip:i,width:o});}return r}var $a={comment:0,custom:1,revision:2};function $s(t,e,n){let r=[];for(let a of t){let i=Fs(a,e,n);i!==null&&r.push({item:a,grip:i.grip,width:i.width});}return r.sort((a,i)=>a.grip!==i.grip?a.grip-i.grip:a.width!==i.width?a.width-i.width:a.item.kind!==i.item.kind?$a[a.item.kind]-$a[i.item.kind]:a.item.kind==="revision"&&i.item.kind==="revision"?i.item.nesting-a.item.nesting:0).map(a=>a.item)}function Um(t,e,n){let a=$s(t,e,n).filter(i=>!(i.kind==="comment"&&i.resolved))[0];return a?a.kind==="comment"?Ba(t,a):a:null}function Lm(t,e){return Ba(t,e)}function Ba(t,e){let n=new Map,r=new Map;for(let o of t)o.kind==="comment"?n.set(o.id,o):o.kind==="revision"&&r.set(o.id,o);let a=new Set([e.id]),i=e;for(;i.parentId!==void 0;){let o=n.get(i.parentId);if(!o||a.has(o.id))break;a.add(o.id),i=o;}if(i.parentRevisionId!==void 0){let o=r.get(i.parentRevisionId);if(o)return o}return i}var Hs={ins:"insert",del:"delete",moveFrom:"moveFrom",moveTo:"moveTo"};function Gm(t){let e=[],n=r=>{if(r.kind==="textValue"){e.push(r.value);return}for(let a of r.children)n(a);};for(let r of t.blocks)n(r);return e.join("")}function Xm(t){if(t.initials&&t.initials.trim().length>0)return t.initials.trim();let e=t.author.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function Mt(t,e){for(let n of t.attributes)if(n.localName===e&&n.namespaceUri===chunkGWV65NQW_cjs.ca)return n.value}function it(t){if(t.kind==="textValue")return t.value;if(t.kind==="tab")return " ";if(t.kind==="hardBreak")return chunkGWV65NQW_cjs.Cc(t);if(chunkGWV65NQW_cjs.Kc(t))return "";let e="";for(let n of t.children)e+=it(n);return e}function Mn(t){return `${t.id}\0${t.author}\0${t.date??""}`}var Bs={revisionInsert:"insert",revisionDelete:"delete",revisionMoveFrom:"moveFrom",revisionMoveTo:"moveTo"};function js(t){let e=t.root.kind!=="paragraph";if(e){let r=ja.get(t.root);if(r&&r.name===t.name)return r.items}let n=Vs(t);return e&&ja.set(t.root,{name:t.name,items:n}),n}var ja=chunkGWV65NQW_cjs.Jf(8);function Vs(t){let e=chunkGWV65NQW_cjs.vg(t);if(e.length===0)return [];let n=En(t),r=new Map;for(let i of e){let o=Mt(i.node,"id");if(o===void 0)continue;let s=Mt(i.node,"author")??"",l=Mt(i.node,"author")===void 0,d=Mt(i.node,"date"),c=d===void 0?{id:o,author:s}:{id:o,author:s,date:d},u=i.propertyChange?"format":i.paragraphMark?"paragraphMark":Bs[i.node.kind]??"structural",m=i.paragraphMark?Hs[i.node.localName]:void 0,k=n.get(i.node.id),h=k?{partName:t.name,start:{paragraphId:k.paragraphId,offset:k.start},end:{paragraphId:k.paragraphId,offset:k.end}}:null,P=u==="structural"?`structural\0${Mn(c)}`:`${i.node.localName}\0${Mn(c)}`,p=r.get(P);if(p){h&&!p.ranges.some(y=>y.partName===h.partName&&y.start.paragraphId===h.start.paragraphId&&y.start.offset===h.start.offset&&y.end.paragraphId===h.end.paragraphId&&y.end.offset===h.end.offset)&&p.ranges.push(h),u!=="structural"&&p.revisionKind==="structural"&&(p.revisionKind=u),(u==="insert"&&p.revisionKind==="delete"||u==="delete"&&p.revisionKind==="insert"||p.revisionKind==="replace")&&(p.revisionKind="replace"),p.readOnly||=i.refused||l,i.nesting>p.nesting&&(p.nesting=i.nesting),u==="delete"||u==="moveFrom"?p.deletedText+=it(i.node):u!=="format"&&u!=="paragraphMark"&&(p.text+=it(i.node));continue}r.set(P,{address:c,revisionKind:u,...m?{markDirection:m}:{},author:s,...d===void 0?{}:{date:d},text:u==="format"||u==="paragraphMark"||u==="delete"||u==="moveFrom"?"":it(i.node),deletedText:u==="delete"||u==="moveFrom"?it(i.node):"",ranges:h?[h]:[],nesting:i.nesting,readOnly:i.refused||l});}let a=[...r.values()].map(i=>({kind:"revision",id:`${i.revisionKind}-${t.name}\0${Mn(i.address)}`,address:i.address,addresses:[i.address],revisionKind:i.revisionKind,...i.markDirection?{markDirection:i.markDirection}:{},author:i.author,...i.date===void 0?{}:{date:i.date},text:i.revisionKind==="replace"?i.text:i.text||i.deletedText,replacedText:i.revisionKind==="replace"?i.deletedText:"",ranges:i.ranges,nesting:i.nesting,readOnly:i.readOnly,replyIds:[]}));return Ws(a,Dn(t))}function Ws(t,e){let n=Ks(t),r=n.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0),a=new Set,i=new Map,o=new Map;for(let l of r){if(l.revisionKind!=="insert")continue;let d=l.ranges[0].start,c=`${d.paragraphId}\0${d.offset}`,u=o.get(c);u?u.push(l):o.set(c,[l]);}for(let l of r){if(l.revisionKind!=="delete"||a.has(l.id))continue;let d=l.ranges[l.ranges.length-1].end,c=o.get(`${d.paragraphId}\0${d.offset}`)??[],u=c.length>1?[...c].sort((m,k)=>(m.text.length>0?0:1)-(k.text.length>0?0:1)):c;for(let m of u){if(a.has(m.id)||m.author!==l.author)continue;a.add(l.id),a.add(m.id);let k=Js(l.ranges[0],m.ranges[0],e)?l:m,h=Ys(l.date,m.date);i.set(l.id,{...k,id:`replace-${l.id}-${m.id}`,revisionKind:"replace",...h===void 0?{}:{date:h},addresses:Xs([...l.addresses,...m.addresses]),text:m.text,replacedText:l.text,ranges:[...l.ranges,...m.ranges],replacedRangeCount:l.ranges.length,readOnly:l.readOnly||m.readOnly});break}}let s=[];for(let l of n){let d=i.get(l.id);if(d){s.push(d);continue}a.has(l.id)||s.push(l);}return s}function Ks(t){let e=t.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0);if(e.length<2)return t;let n=(l,d)=>`${l.revisionKind}\0${l.author}\0${d.paragraphId}\0${d.offset}`,r=new Map,a=new Set;for(let l of e)r.set(n(l,l.ranges[0].start),l),a.add(n(l,l.ranges[l.ranges.length-1].end));let i=new Set,o=new Map;for(let l of e){if(i.has(l.id)||a.has(n(l,l.ranges[0].start)))continue;let d=[l],c=l;for(;;){let u=r.get(n(c,c.ranges[c.ranges.length-1].end));if(!u||u===c||i.has(u.id))break;i.add(u.id),d.push(u),c=u;}d.length>1&&o.set(l.id,zs(d));}if(o.size===0)return t;let s=[];for(let l of t)i.has(l.id)||s.push(o.get(l.id)??l);return s}function zs(t){let e=t[0],n=[...e.addresses],r=[...e.ranges],a=e.text,i=e.date;for(let o of t.slice(1)){for(let s of o.addresses)n.some(l=>Ya(l,s))||n.push(s);for(let s of o.ranges)r.push(s);a+=o.text,i=Gs(i,o.date);}return {...e,id:t.map(o=>o.id).join("+"),addresses:n,ranges:r,text:a,...i===void 0?{}:{date:i}}}function Gs(t,e){if(t===void 0)return e;if(e===void 0)return t;let n=Date.parse(t),r=Date.parse(e);return Number.isNaN(n)||Number.isNaN(r)?t:r>n?e:t}function Xs(t){let e=[];for(let n of t)e.some(r=>Ya(r,n))||e.push(n);return e}function Ya(t,e){return t.id===e.id&&t.author===e.author&&(t.date??"")===(e.date??"")}function Ys(t,e){if(e===void 0)return t;if(t===void 0)return e;let n=Date.parse(t),r=Date.parse(e);return Number.isNaN(n)||Number.isNaN(r)?e:n>r?t:e}function Js(t,e,n){let r=n.get(t.start.paragraphId)??0,a=n.get(e.start.paragraphId)??0;return r!==a?r<a:t.start.offset<=e.start.offset}function qs(t,e,n){let r=new Map(e.map(c=>[c.commentId,c])),a=new Map,i=new Map;for(let c of t)c.paraId&&a.set(c.paraId.toUpperCase(),c),i.set(c.id,c);let o=new Map,s=new Map;for(let c of t){let u=r.get(c.id);if(!u||u.orphaned||u.start.paragraphId===u.end.paragraphId&&u.start.offset===u.end.offset)continue;let m=`${u.start.paragraphId}:${u.start.offset}|${u.end.paragraphId}:${u.end.offset}`;o.has(m)?s.set(c.id,o.get(m)):o.set(m,c.id);}let l=new Map;for(let c of t){let u=c.paraId?n.get(c.paraId.toUpperCase()):void 0,m=u?.parentParaId?a.get(u.parentParaId):void 0,k=c.parentCommentId?i.get(c.parentCommentId):void 0,h=u===void 0?s.get(c.id):void 0,P=h?i.get(h):void 0,p=m??k??P;p&&p.id!==c.id&&l.set(c.id,p.id);}for(let c of [...l.keys()]){let u=new Set([c]),m=l.get(c);for(;m!==void 0;){if(u.has(m)){l.delete(c);break}u.add(m),m=l.get(m);}}let d=new Map;for(let[c,u]of l){let m=d.get(u);m?m.push(c):d.set(u,[c]);}return t.map(c=>{let u=r.get(c.id),m=c.paraId?n.get(c.paraId.toUpperCase()):void 0,k=l.get(c.id);return {kind:"comment",id:c.id,comment:c,range:u?{partName:u.partName,start:u.start,end:u.end}:null,resolved:m?.done??false,...k===void 0?{}:{parentId:k},replyIds:d.get(c.id)??[],orphaned:u===void 0||u.orphaned}})}function Ym(t){let e=[t.storyPart],n=new Set([t.storyPart.name]);for(let d of t.furnitureParts??[])n.has(d.name)||(n.add(d.name),e.push(d));let r=t.commentsPart?chunkGWV65NQW_cjs.Mf(t.commentsPart):[],a=t.commentsExtendedPart?chunkGWV65NQW_cjs.Nf(t.commentsExtendedPart):new Map,i=[],o=[],s=e.length===1?Dn(e[0]):new Map;for(let d of e){for(let m of js(d))i.push(m);for(let m of chunkGWV65NQW_cjs.Lf(d))o.push(m);if(e.length===1)continue;let c=s,u=c.size;for(let[m,k]of Dn(d))c.has(m)||c.set(m,u+k);}return Qs([...i,...qs(r,o,a)]).sort((d,c)=>Cn(d,s)-Cn(c,s))}function Va(t){return `${t.partName}\0${t.start.paragraphId}:${t.start.offset}|${t.end.paragraphId}:${t.end.offset}`}function Qs(t){let e=new Map;for(let o of t)if(o.kind==="revision")for(let s of o.ranges??[]){if(s.start.paragraphId===s.end.paragraphId&&s.start.offset===s.end.offset)continue;let l=Va(s),d=o.nesting??0,c=e.get(l);(c===void 0||d>c.nesting)&&e.set(l,{id:o.id,nesting:d});}let n=new Map;for(let o of t)o.kind==="comment"&&o.replyIds&&o.replyIds.length>0&&n.set(o.id,o.replyIds);let r=o=>{let s=[],l=new Set([o]),d=[...n.get(o)??[]];for(;d.length>0;){let c=d.shift();l.has(c)||(l.add(c),s.push(c),d.push(...n.get(c)??[]));}return s},a=new Map,i=new Map;for(let o of t){if(o.kind!=="comment"||o.parentId!==void 0||o.orphaned||!o.range)continue;let s=e.get(Va(o.range))?.id;if(s===void 0)continue;let l=[o.id,...r(o.id)];for(let c of l)i.set(c,s);let d=a.get(s);d?d.push(...l):a.set(s,l);}return t.map(o=>{if(o.kind==="revision"){let s=a.get(o.id)??[];return s.length===0&&(o.replyIds??[]).length===0?o:{...o,replyIds:s}}if(o.kind==="comment"){let s=i.get(o.id);if(s===void 0){if(o.parentRevisionId===void 0)return o;let{parentRevisionId:l,...d}=o;return d}return o.parentRevisionId===s?o:{...o,parentRevisionId:s}}return o})}function Dn(t){let e=Wa.get(t.root);if(e)return e;let n=new Map,r=(a,i)=>{if(!(a.kind==="textValue"||i>64)){if(a.kind==="paragraph"){n.has(a.id)||n.set(a.id,n.size);return}if(a.kind==="table"){let o=Xa.get(a);if(!o){let s=[],l=(d,c)=>{if(!(d.kind==="textValue"||c>64)){if(d.kind==="paragraph"){s.push(d.id);return}for(let u of d.children)l(u,c+1);}};for(let d of a.children)l(d,0);o=s,Xa.set(a,o);}for(let s of o)n.has(s)||n.set(s,n.size);return}for(let o of a.children)r(o,i+1);}};return r(t.root,0),Wa.set(t.root,n),n}var Wa=chunkGWV65NQW_cjs.Jf(8);function Jm(t){let e=Ga.get(t.root);if(e)return e;let n=new Map;for(let r of Ja(t.root,0))n.has(r)||n.set(r,n.size);return Ga.set(t.root,n),n}var Ka=Object.freeze([]),za=new WeakMap;function Ja(t,e){if(t.kind==="textValue"||e>64)return Ka;let n=za.get(t);if(n&&n.depth===e)return n.ids;let r=null;t.kind==="paragraph"&&(r??=[]).push(t.id);for(let i of t.children){let o=Ja(i,e+1);if(o.length!==0){r??=[];for(let s of o)r.push(s);}}let a=r??Ka;return za.set(t,{depth:e,ids:a}),a}var Ga=chunkGWV65NQW_cjs.Jf(8),Xa=new WeakMap;var Zm=256,eu=2e3,qa=/[\p{L}\p{N}_]/u;function Qa(t){let e=t.toLowerCase();if(e.length===t.length)return e;let n="";for(let r=0;r<t.length;r+=1){let a=t[r],i=a.toLowerCase();n+=i.length===1?i:a;}return n}function Zs(t,e,n){let r=e>0?t[e-1]:void 0,a=n<t.length?t[n]:void 0;return !(r!==void 0&&qa.test(r)||a!==void 0&&qa.test(a))}function el(t){return typeof t=="string"&&t.length>0&&t.length<=256}function tu(t,e,n,r={}){let a={matches:[],truncated:false};if(!el(e)||t.length===0||n<=0)return a;let i=r.matchCase===true,o=r.wholeWord===true,s=i?e:Qa(e),l=i?t:Qa(t),d=Math.max(0,r.from??0),c=Math.min(t.length,r.to??t.length),u=[],m=l.indexOf(s,d);for(;m>=0;){let k=m+s.length;if(k>c)return {matches:u,truncated:false};if(!o||Zs(t,m,k)){if(u.length>=n)return {matches:u,truncated:true};u.push({start:m,length:s.length});}m=l.indexOf(s,k);}return {matches:u,truncated:false}}
2
- exports.$=Um;exports.A=um;exports.B=pm;exports.C=Ve;exports.D=bn;exports.E=vn;exports.F=bs;exports.G=Sn;exports.H=vm;exports.I=Et;exports.J=wn;exports.K=Nm;exports.L=vs;exports.M=Da;exports.N=Ss;exports.O=Tn;exports.P=ws;exports.Q=Nn;exports.R=Sm;exports.S=wm;exports.T=Tm;exports.U=Em;exports.V=En;exports.W=_m;exports.X=Ha;exports.Y=Ms;exports.Z=Cn;exports._=$s;exports.a=yo;exports.aa=Lm;exports.b=Ri;exports.ba=Gm;exports.c=ko;exports.ca=Xm;exports.d=Fe;exports.da=js;exports.e=ns;exports.ea=qs;exports.f=sa;exports.fa=Ym;exports.g=ca;exports.ga=Qs;exports.h=ma;exports.ha=Dn;exports.i=fn;exports.ia=Jm;exports.j=Ic;exports.ja=Zm;exports.k=la;exports.ka=eu;exports.l=ba;exports.la=Qa;exports.m=va;exports.ma=Zs;exports.n=Wc;exports.na=el;exports.o=Kc;exports.oa=tu;exports.p=zc;exports.q=Qc;exports.r=Zc;exports.s=em;exports.t=ks;exports.u=xs;exports.v=wa;exports.w=Ea;exports.x=im;exports.y=sm;exports.z=lm;