@docx-editor.dev/core 2.25.0 → 2.26.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 (93) hide show
  1. package/README.md +9 -3
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +20 -9
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.js +1 -1
  7. package/dist/chunk-2BK4G4ZN.js +2 -0
  8. package/dist/chunk-2SJX44PC.cjs +2 -0
  9. package/dist/chunk-5BIASAN3.js +1 -0
  10. package/dist/{chunk-WVJRO4WY.js → chunk-6SEIXJTX.js} +1 -1
  11. package/dist/chunk-73PG6L2X.js +1 -0
  12. package/dist/chunk-7RJSH72J.cjs +5 -0
  13. package/dist/chunk-AGKIHLWQ.cjs +1 -0
  14. package/dist/chunk-AN6WM4X4.js +2 -0
  15. package/dist/chunk-ANZ44KQT.cjs +12 -0
  16. package/dist/chunk-CYT3OQFZ.cjs +1 -0
  17. package/dist/chunk-DDGGSBAN.js +12 -0
  18. package/dist/chunk-EEAV3WIN.js +3 -0
  19. package/dist/{chunk-MEF2AK5L.cjs → chunk-ELQFXMJ5.cjs} +1 -1
  20. package/dist/chunk-EYK4K2J6.js +1 -0
  21. package/dist/chunk-JNTETUNZ.cjs +1 -0
  22. package/dist/chunk-L6V3IJ3S.js +5 -0
  23. package/dist/chunk-LWCI65EL.js +1 -0
  24. package/dist/chunk-LZDI4P6I.cjs +1 -0
  25. package/dist/chunk-NS22DVWT.cjs +2 -0
  26. package/dist/chunk-QIE3YTU4.cjs +2 -0
  27. package/dist/chunk-QVBFPAGO.js +5 -0
  28. package/dist/chunk-RCCOLZEQ.js +2 -0
  29. package/dist/chunk-SUN62YU6.cjs +5 -0
  30. package/dist/chunk-TKR2MXX4.cjs +3 -0
  31. package/dist/chunk-UJL2GDIM.cjs +25 -0
  32. package/dist/chunk-WQTADNHK.cjs +27 -0
  33. package/dist/chunk-XSHXBJ2J.js +25 -0
  34. package/dist/chunk-YXZEBTDF.js +27 -0
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.js +1 -1
  37. package/dist/contracts/editor.d.ts +3 -3
  38. package/dist/{editor-DkfCCTxA.d.ts → editor-DYUlyKmb.d.ts} +1 -1
  39. package/dist/editor.cjs +1 -1
  40. package/dist/editor.css +14 -2
  41. package/dist/editor.d.ts +13 -13
  42. package/dist/editor.js +1 -1
  43. package/dist/export.cjs +2 -2
  44. package/dist/export.d.ts +5 -5
  45. package/dist/export.js +2 -2
  46. package/dist/{font-resolver-C295obND.d.ts → font-resolver-u_nE0PI1.d.ts} +5 -3
  47. package/dist/{index-3KAxeSic.d.ts → index-Docw8Dcb.d.ts} +6 -6
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.ts +7 -7
  50. package/dist/index.js +1 -1
  51. package/dist/{layout-shaping-C889tgmj.d.ts → layout-shaping-DWitwY73.d.ts} +1 -1
  52. package/dist/layout.cjs +1 -1
  53. package/dist/layout.d.ts +89 -23
  54. package/dist/layout.js +1 -1
  55. package/dist/output.cjs +1 -1
  56. package/dist/output.d.ts +3 -3
  57. package/dist/output.js +1 -1
  58. package/dist/{protocol-BhmenALD.d.ts → protocol-DniKeDb8.d.ts} +28 -1
  59. package/dist/{review-paragraph-order-BwhRT264.d.ts → review-paragraph-order-Dc8Q6tfM.d.ts} +5 -1
  60. package/dist/{semantic-cell-selection-CC3NwCtx.d.ts → semantic-cell-selection-Dy_BmmpL.d.ts} +23 -5
  61. package/dist/{semantic-interaction-BHlV61hK.d.ts → semantic-interaction-CvFAj0GR.d.ts} +1 -1
  62. package/dist/{semantic-paint-DfWIWUs6.d.ts → semantic-paint-Bk9wIXdZ.d.ts} +1 -1
  63. package/dist/{semantic-records-DrExlBy-.d.ts → semantic-records-COqi8pjP.d.ts} +77 -70
  64. package/dist/store.cjs +1 -1
  65. package/dist/store.d.ts +57 -5
  66. package/dist/store.js +1 -1
  67. package/package.json +3 -3
  68. package/dist/chunk-3RMHRNDA.cjs +0 -1
  69. package/dist/chunk-42N7OV3G.cjs +0 -1
  70. package/dist/chunk-47ZJEEBT.js +0 -2
  71. package/dist/chunk-4B3SXBV6.js +0 -4
  72. package/dist/chunk-5MWFZ7F4.cjs +0 -11
  73. package/dist/chunk-AS2OC6J4.cjs +0 -26
  74. package/dist/chunk-B7SYEMZ7.cjs +0 -1
  75. package/dist/chunk-BME2KUNL.cjs +0 -1
  76. package/dist/chunk-CDGVVEUK.js +0 -26
  77. package/dist/chunk-E4RAPI5J.cjs +0 -2
  78. package/dist/chunk-FZJTQPH4.js +0 -2
  79. package/dist/chunk-H7XMRUAO.cjs +0 -5
  80. package/dist/chunk-ILUE2SI5.js +0 -1
  81. package/dist/chunk-IZT3C23R.js +0 -1
  82. package/dist/chunk-KJLPVGSX.cjs +0 -4
  83. package/dist/chunk-LF5LPZOP.cjs +0 -18
  84. package/dist/chunk-N5WE5O5Q.js +0 -1
  85. package/dist/chunk-OVDW4XQD.cjs +0 -2
  86. package/dist/chunk-SNN53UPD.js +0 -1
  87. package/dist/chunk-V7LBEUVW.js +0 -5
  88. package/dist/chunk-VE7YBFQD.js +0 -5
  89. package/dist/chunk-VOVDX7GW.js +0 -18
  90. package/dist/chunk-VQ33XGNP.cjs +0 -5
  91. package/dist/chunk-XUJINXW6.js +0 -1
  92. package/dist/chunk-Y3TPAITU.cjs +0 -1
  93. package/dist/chunk-Z65JJLLF.js +0 -11
@@ -0,0 +1,5 @@
1
+ 'use strict';var chunkANZ44KQT_cjs=require('./chunk-ANZ44KQT.cjs'),fflate=require('fflate');var Xd=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Yd=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,Jd=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function Vi(e){return Yd.test(e)||Jd.test(e)}function Dn(e,t){if(!Vi(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 qd=/^(\d+)\.(\d+)\.(\d+)$/;function st(e){let t=qd.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 _n(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 Fn(e,t){let n=st(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=st(r.slice(1));return _n(n,o)<0?false:o.major>0?n.major===o.major:o.minor>0?n.major===0&&n.minor===o.minor:n.major===0&&n.minor===0}if(r.includes(" ")){let o=r.split(/\s+/);if(o.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let i=true;for(let a of o){let s=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!s)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let l=st(a.slice(s.length)),d=_n(n,l);s===">="?i=i&&d>=0:i=i&&d<0;}return i}return _n(n,st(r))===0}var fe=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},Kr=(e,t)=>`${e}:${t}`;function Qd(e,t={}){let n=new Map;for(let d of e){if(Dn(d.id,"extension"),zi(d.version,d.id),n.has(d.id))throw new fe("duplicate-extension",`duplicate extension id ${d.id}`,[d.id]);n.set(d.id,d);for(let c of d.contributions)Dn(c.id,c.kind),zi(c.version,`${d.id} \u2192 ${c.id}`),c.replaces&&tc(c.replaces.targetRange,`${d.id} \u2192 replaces ${c.replaces.targetId}`);}for(let d of e){for(let c of d.dependencies??[])if(!n.has(c))throw new fe("missing-dependency",`${d.id} requires missing extension ${c}`,[d.id,c]);for(let c of d.conflicts??[])if(n.has(c)){let m=[d.id,c].sort();throw new fe("conflict",`extensions ${m[0]} and ${m[1]} conflict`,m)}}ec(n);let r=new Set(t.availablePorts??[]);for(let d of e)for(let c of d.contributions)c.kind==="runtimePort"&&r.add(c.id);for(let d of e)for(let c of d.requiredPorts??[])if(!r.has(c))throw new fe("missing-port",`${d.id} requires unavailable port ${c}`,[d.id,c]);let o=new Map,i=new Map,a=new Map;for(let d of e)for(let c of d.contributions){let m=Kr(c.kind,c.id);if(c.replaces){let f=Kr(c.kind,c.replaces.targetId),h=a.get(f)??[];h.push({ext:d.id,c}),a.set(f,h);continue}if(i.has(m)){let f=[o.get(m),d.id].sort();throw new fe("id-collision",`${c.kind} id ${c.id} registered by both ${f[0]} and ${f[1]}`,f)}i.set(m,c),o.set(m,d.id);}let s=new Map(i);for(let[d,c]of a){let m=i.get(d);if(!m){let u=c[0];throw new fe("replacement-target-missing",`${u.ext} replaces missing target ${u.c.replaces.targetId}`,[u.ext,u.c.replaces.targetId])}let f=m.replaceable??{kind:"none"};for(let{ext:u,c:g}of c){if(!Fn(m.version,g.replaces.targetRange))throw new fe("replacement-version-mismatch",`${u} replaces ${g.replaces.targetId}@${m.version} outside range ${g.replaces.targetRange}`,[u,g.replaces.targetId]);if(f.kind==="none")throw new fe("unauthorized-replacement",`${g.replaces.targetId} does not authorize replacement (attempted by ${u})`,[u,g.replaces.targetId])}let h=Zd(m,c);s.set(d,h);}return {extensions:n,contributions:s,get:(d,c)=>s.get(Kr(d,c))}}function Zd(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((s,l)=>(l.c.replaces.priority??0)-(s.c.replaces.priority??0)),i=o[0].c.replaces.priority??0,a=o.filter(s=>(s.c.replaces.priority??0)===i);if(a.length>1){let s=a.map(l=>l.ext).sort();throw new fe("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${i}: ${s.join(", ")}`,s)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new fe("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function ec(e){let o=new Map,i=[],a=s=>{o.set(s,1),i.push(s);let l=[...e.get(s)?.dependencies??[]].sort();for(let d of l){let c=o.get(d)??0;if(c===1){let m=i.indexOf(d),f=[...i.slice(m),d];throw new fe("dependency-cycle",`dependency cycle: ${f.join(" -> ")}`,f)}c===0&&a(d);}i.pop(),o.set(s,2);};for(let s of [...e.keys()].sort())(o.get(s)??0)===0&&a(s);}function zi(e,t){try{st(e);}catch{throw new fe("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function tc(e,t){try{Fn("0.0.0",e);}catch{throw new fe("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var lt=class extends Error{constructor(t){super(t),this.name="BudgetError";}},jt=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new chunkANZ44KQT_cjs.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,r=this;return {amount:t,get released(){return n},release(){n||(n=true,r.used.release(t),r.activeReservations-=1);}}}child(t,n){this.assertLive(),this.used.add(n);let r=new e(t,n);return r.parent=this,r.carveAmount=n,this.children.add(r),r}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new lt(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new lt(`${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(r){t.push(r);}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 lt(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new lt(`${this.label}: budget already released`)}};var Ln=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},Ht=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 Ln(t.derivedOnly,t._reason)}}}};var $n=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},Xr=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 $n(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(chunkANZ44KQT_cjs.f.clock)}identity(){return this.resolve(chunkANZ44KQT_cjs.f.identity)}},Yr=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}},Jr=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function nc(e){let t=chunkANZ44KQT_cjs.k(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",i={id:o,limits:t,config:n,ports:e.ports,budget:new jt(`op:${o}`,r),cancellation:new Ht};return Object.freeze(i)}function rc(e){e.budget.dispose();}var Qr=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"}}),Wi=Object.keys(Qr);function oc(e,t){return new chunkANZ44KQT_cjs.p(`${Qr[t].phase}:${t}`,e[t])}var qr=class{counter;current=0;peak=0;constructor(t){this.counter=new chunkANZ44KQT_cjs.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 ac(){for(let e of Wi){let t=chunkANZ44KQT_cjs.j[e],n=chunkANZ44KQT_cjs.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 Vt(e,t=new Set){let n=new WeakSet,r=[],o=i=>{if(i===null)return "null";let a=typeof i;if(a==="boolean")return i?"true":"false";if(a==="number"){let l=i;if(!Number.isFinite(l))throw new Error(`non-finite number is not comparable: ${l}`);return Object.is(l,-0)?"0":String(l)}if(a==="string")return JSON.stringify(i);if(a==="bigint")return `${i.toString()}n`;if(Array.isArray(i))return `[${i.map((l,d)=>{r.push(d);try{return o(l)}finally{r.pop();}}).join(",")}]`;if(a==="object"){let l=i;if(n.has(l))throw new Error("cannot canonicalize a cyclic structure");n.add(l);let c=Object.keys(l).filter(m=>!t.has(m)).sort().map(m=>{r.push(m);try{return `${JSON.stringify(m)}:${o(l[m])}`}finally{r.pop();}}).join(",");return n.delete(l),`{${c}}`}let s=r.length>0?` at ${r.map(String).join(".")}`:"";throw new Error(`unsupported value type in comparator input: ${a}${s}`)};return o(e)}function Zr(e,t){return ic(Vt(e,t))}function ic(e){let t=3421674724,n=2216829733;for(let r=0;r<e.length;r++){n=(n^e.charCodeAt(r))>>>0;let o=n*435,i=Math.floor(o/4294967296);t=Math.imul(t,435)+Math.imul(n,256)+i>>>0,n=o>>>0;}return t.toString(16).padStart(8,"0")+n.toString(16).padStart(8,"0")}var $e="dev.docx-editor.core.comparator",eo={authoredState:{id:`${$e}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${$e}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${$e}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${$e}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${$e}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${$e}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${$e}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${$e}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${$e}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${$e}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function to(e,t,n,r={}){let o=eo[e];switch(o.mode){case "sync-optimization-only":throw new Error(`${o.id} is not an equivalence basis (${o.note})`);case "tolerance":{if(r.epsilon===void 0)throw new Error(`${o.id} requires an explicit epsilon`);return {equal:Gi(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let i=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=Vt(t,i),s=Vt(n,i);return a===s?{equal:true}:{equal:false,left:a,right:s}}}}function no(e,t){let n=eo[e];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let r=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return Zr(t,r)}function Gi(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((r,o)=>Gi(r,t[o],n)):false}var Xi=new Set([...chunkANZ44KQT_cjs.c,...chunkANZ44KQT_cjs.d]),Ki=/^[0-9a-f]{16}$/,sc=/^[0-9a-f]*$/;function ro(e){let t=[],n=o=>t.push(o);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 r=-1;e.steps.forEach((o,i)=>{let a=`step[${i}]`;Xi.has(o.origin)||n(`${a}: unknown origin ${o.origin}`),(!Number.isInteger(o.baseRevision)||o.baseRevision<0)&&n(`${a}: baseRevision must be a non-negative integer`),o.baseRevision<r&&n(`${a}: baseRevision regressed below ${r}`);let s=o.expect;s.outcome==="applied"?(s.committedRevision===void 0?n(`${a}: applied step needs committedRevision`):s.committedRevision<=o.baseRevision?n(`${a}: committedRevision ${s.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=s.committedRevision,s.modelChange&&lc(s.modelChange,a,n)):(s.committedRevision!==void 0&&n(`${a}: ${s.outcome} step must not commit a revision`),s.authoredStateHash!==void 0&&n(`${a}: ${s.outcome} step must not change authored state`)),s.authoredStateHash!==void 0&&!Ki.test(s.authoredStateHash)&&n(`${a}: authoredStateHash must be 16-hex`),s.outputHash!==void 0&&!Ki.test(s.outputHash)&&n(`${a}: outputHash must be 16-hex`);});for(let o of [...e.snapshots??[],...e.updates??[]])o.documentId!==e.documentId&&n(`envelope documentId ${o.documentId} != ${e.documentId}`),sc.test(o.bytesHex)||n("envelope bytesHex must be hex"),o.bytesHex.length!==o.byteLength*2&&n(`envelope byteLength ${o.byteLength} disagrees with ${o.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function lc(e,t,n){Xi.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function dc(e,t){let n=ro(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,i)=>{let a=`step[${i}]`,s=t.applyStep(o),l=o.expect;if(s.outcome!==l.outcome){r.push(`${a}: outcome ${s.outcome} != expected ${l.outcome}`);return}if(l.outcome==="applied"&&(s.committedRevision!==l.committedRevision&&r.push(`${a}: revision ${s.committedRevision} != expected ${l.committedRevision}`),l.authoredStateHash!==void 0))if(s.authoredState===void 0)r.push(`${a}: store returned no authored state to hash`);else {to("authoredState",s.authoredState,s.authoredState).equal||r.push(`${a}: authored state is not self-consistent`);let c=Yi(s.authoredState);c!==l.authoredStateHash&&r.push(`${a}: authoredStateHash ${c} != expected ${l.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function Yi(e){return no("authoredState",e)}function zt(e){let t=[...e];for(;t.length;){let n=t.pop();if(n.kind!=="textValue"){if(n.namespaceUri===chunkANZ44KQT_cjs.fa&&n.localName==="object")return true;for(let r of n.children)t.push(r);}}return false}var Ji=24,Bn=Object.freeze([Object.freeze({localName:"kern",attributes:Object.freeze({val:"2"})}),Object.freeze({localName:"sz",attributes:Object.freeze({val:String(Ji)})}),Object.freeze({localName:"szCs",attributes:Object.freeze({val:String(Ji)})})]),jn=Object.freeze([Object.freeze({localName:"spacing",attributes:Object.freeze({after:"160",line:"278",lineRule:"auto"})})]),Qi=Object.freeze({run:true,paragraph:true}),Zi=Object.freeze({run:false,paragraph:false});function es(e){if(!e)return Qi;let t=n=>e.children.some(r=>r.kind!=="textValue"&&r.namespaceUri===chunkANZ44KQT_cjs.fa&&r.localName===n);return {run:!t("rPrDefault"),paragraph:!t("pPrDefault")}}function oo(e,t){return e&&e.namespaceUri!==chunkANZ44KQT_cjs.fa?Zi:es(t)}function qp(e){return e?e.namespaceUri!==chunkANZ44KQT_cjs.fa?Zi:es(cc(e)):Qi}function Un(e,t,n,r){return {id:n,kind:e,namespaceUri:chunkANZ44KQT_cjs.fa,localName:t,prefix:"w",namespaceBindings:[],attributes:[],children:r}}function qi(e,t){let n=e==="rPr"?Bn:jn;return Un(e==="rPr"?"runProperties":"paragraphProperties",e,`${t}-${e}`,n.map(r=>chunkANZ44KQT_cjs.Gi(r,`${t}-${e}-${r.localName}`)))}function cc(e){let t=e.children.find(n=>n.kind!=="textValue"&&n.namespaceUri===chunkANZ44KQT_cjs.fa&&n.localName==="docDefaults");return t&&t.kind!=="textValue"?t:void 0}function ts(e,t,n){let r=oo(e,t);if(!r.run&&!r.paragraph)return t;let o=[];r.run&&o.push(Un("generic","rPrDefault",`${n}-rPrDefault`,[qi("rPr",n)])),r.paragraph&&o.push(Un("generic","pPrDefault",`${n}-pPrDefault`,[qi("pPr",n)]));let i=r.run?[...o,...t?.children??[]]:[...t?.children??[],...o];return t?{...t,children:i}:Un("generic","docDefaults",`${n}-docDefaults`,i)}var dt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",mc="http://schemas.openxmlformats.org/package/2006/relationships",uc="http://schemas.openxmlformats.org/drawingml/2006/main",os="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",as="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",is="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",ss="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",ls="application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",ao="application/vnd.openxmlformats-package.relationships+xml",io=`${dt}/styles`,so=`${dt}/numbering`,ds=`${dt}/footnotes`,cs=`${dt}/endnotes`,ms=`${dt}/officeDocument`,pc=`${dt}/theme`;function Me(e){return e.kind!=="textValue"}function ns(e,t){return {...e,children:t}}function qe(e,t){if(t(e),e.kind!=="textValue")for(let n of e.children)qe(n,t);}var fc=new Set(["pStyle","rStyle","tblStyle"]);function lo(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue"&&fc.has(r.localName)&&r.namespaceUri===chunkANZ44KQT_cjs.fa){let o=chunkANZ44KQT_cjs.Cf(r,"val");o&&t.add(o);}});}function co(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue"&&r.localName==="numId"&&r.namespaceUri===chunkANZ44KQT_cjs.fa){let o=chunkANZ44KQT_cjs.Cf(r,"val");o&&t.add(o);}});}function mo(e){let t=new Set;return Wt(e,t),t}function Wt(e,t){for(let n of e)qe(n,r=>{if(r.kind!=="textValue")for(let o of r.attributes)o.namespaceUri===dt&&o.value.length>0&&t.add(o.value);});}function Ne(e){return /^\d+$/.test(e)?e.replace(/^0+(?=\d)/,""):e}function Vn(e,t){let n={footnote:new Set,endnote:new Set},r=[],o=i=>{for(let a of i)qe(a,s=>{if(s.kind!=="noteReference")return;let l=s.localName==="footnoteReference"?"footnote":"endnote",d=chunkANZ44KQT_cjs.Cf(s,"id");if(d===void 0)return;let c=Ne(d);n[l].has(c)||(n[l].add(c),r.push({kind:l,id:c}));});};for(o(e);r.length>0;){let i=r.pop(),a=t(i.kind,i.id);a!==null&&o([a]);}return n}function uo(e,t,n){if(e.kind==="textValue")return e;let r=[],o=false;for(let i of e.children){if(i.kind!=="textValue"&&i.namespaceUri===chunkANZ44KQT_cjs.fa&&(i.localName==="footnoteReference"||i.localName==="endnoteReference")){let l=i.localName==="footnoteReference"?t:n,d=chunkANZ44KQT_cjs.Cf(i,"id");if(i.kind!=="noteReference"||d===void 0||!l.has(Ne(d))){o=true;continue}}let s=uo(i,t,n);s!==i&&(o=true),r.push(s);}return o?{...e,children:r}:e}function gc(e,t){for(let n of chunkANZ44KQT_cjs.pe(e,t)){if(n.type!==io||n.targetMode==="External")continue;let r=chunkANZ44KQT_cjs.w(n.ownerPart,n.rawTarget);if(r.ok)return e.parts.get(r.partName)??null}return e.parts.get("/word/styles.xml")??null}function us(e,t,n){for(let r of chunkANZ44KQT_cjs.pe(e,t)){if(r.type!==n||r.targetMode==="External")continue;let o=chunkANZ44KQT_cjs.w(r.ownerPart,r.rawTarget);if(o.ok)return e.parts.get(o.partName)??null}return null}function ps(e,t){let n=gc(e,t),r=new Map,o=[],i=null;if(n&&Me(n.root))for(let a of n.root.children){if(!Me(a))continue;if(a.localName==="docDefaults"&&a.namespaceUri===chunkANZ44KQT_cjs.fa){i=a;continue}if(a.localName!=="style"||a.namespaceUri!==chunkANZ44KQT_cjs.fa)continue;let s=chunkANZ44KQT_cjs.Cf(a,"styleId");s&&r.set(s,a),(chunkANZ44KQT_cjs.Cf(a,"default")==="1"||chunkANZ44KQT_cjs.Cf(a,"default")==="true")&&o.push(a);}return {part:n,byId:r,defaults:o,docDefaults:i}}var hc=new Set(["basedOn","link","next"]);function fs(e,t){let n=new Set,r=[...t];for(let a of e.defaults){let s=chunkANZ44KQT_cjs.Cf(a,"styleId");s&&r.push(s);}let o=[];for(;r.length>0;){let a=r.pop();if(n.has(a))continue;n.add(a);let s=e.byId.get(a);if(s){o.push(s);for(let l of s.children)if(Me(l)&&hc.has(l.localName)&&l.namespaceUri===chunkANZ44KQT_cjs.fa){let d=chunkANZ44KQT_cjs.Cf(l,"val");d&&r.push(d);}}}if(!e.part||!Me(e.part.root))return o;let i=new Map;return e.part.root.children.forEach((a,s)=>i.set(a,s)),o.sort((a,s)=>(i.get(a)??0)-(i.get(s)??0))}function po(e,t,n){let r=us(e,t,so)??e.parts.get("/word/numbering.xml")??null;if(!r||!Me(r.root)||n.size===0)return {part:r,nums:[],abstracts:[]};let o=[],i=new Set;for(let s of r.root.children){if(!Me(s)||s.localName!=="num"||s.namespaceUri!==chunkANZ44KQT_cjs.fa)continue;let l=chunkANZ44KQT_cjs.Cf(s,"numId");if(!(!l||!n.has(l))){o.push(s);for(let d of s.children)if(Me(d)&&d.localName==="abstractNumId"){let c=chunkANZ44KQT_cjs.Cf(d,"val");c&&i.add(c);}}}let a=[];for(let s of r.root.children){if(!Me(s)||s.localName!=="abstractNum"||s.namespaceUri!==chunkANZ44KQT_cjs.fa)continue;let l=chunkANZ44KQT_cjs.Cf(s,"abstractNumId");l&&i.has(l)&&a.push(s);}return {part:r,nums:o,abstracts:a}}var Hn={latin:null,eastAsia:null,cs:null};function gs(e,t){let n=us(e,t,pc);if(!n)return {major:Hn,minor:Hn};let r={major:{...Hn},minor:{...Hn}};return qe(n.root,o=>{if(o.kind==="textValue"||o.namespaceUri!==uc||o.localName!=="majorFont"&&o.localName!=="minorFont")return;let i=o.localName==="majorFont"?r.major:r.minor;for(let a of o.children){if(!Me(a))continue;let s=chunkANZ44KQT_cjs.Cf(a,"typeface");s&&(a.localName==="latin"?i.latin=s:a.localName==="ea"?i.eastAsia=s:a.localName==="cs"&&(i.cs=s));}}),{major:r.major,minor:r.minor}}function yc(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 xc=[["asciiTheme","ascii"],["hAnsiTheme","hAnsi"],["eastAsiaTheme","eastAsia"],["cstheme","cs"]],rs=new Set(["themeColor","themeTint","themeShade","themeFill","themeFillTint","themeFillShade"]);function Qe(e,t){if(e.kind==="textValue")return e;let n=e.attributes;if(e.localName==="rFonts"&&e.namespaceUri===chunkANZ44KQT_cjs.fa){let i=[],a=new Map;for(let s of e.attributes){let l=xc.find(([d])=>d===s.localName);if(l&&s.namespaceUri===chunkANZ44KQT_cjs.fa){let d=yc(t,s.value);d&&a.set(l[1],d);continue}i.push(s);}for(let[s,l]of a)i.some(d=>d.localName===s)||i.push({kind:"genericExtension",namespaceUri:chunkANZ44KQT_cjs.fa,localName:s,prefix:"w",value:l});n=i;}else e.attributes.some(i=>rs.has(i.localName)&&i.namespaceUri===chunkANZ44KQT_cjs.fa&&e.attributes.some(a=>a.localName==="val"))&&(n=e.attributes.filter(i=>!(rs.has(i.localName)&&i.namespaceUri===chunkANZ44KQT_cjs.fa)));let r=e.children.map(i=>Qe(i,t)),o=r.some((i,a)=>i!==e.children[a]);return n===e.attributes&&!o?e:{...e,attributes:n,children:r}}function hs(e,t,n){return {id:e,name:e,contentType:t,root:n}}function ys(e,t){if(e.root.kind==="document"){let r=e.root.children.find(i=>i.kind==="body"),o=r&&Me(r)?ns(r,t):{id:"fragment#body",kind:"body",namespaceUri:chunkANZ44KQT_cjs.fa,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return ns(e.root,[o])}let n={id:"fragment#body",kind:"body",namespaceUri:chunkANZ44KQT_cjs.fa,localName:"body",prefix:"w",namespaceBindings:[],attributes:[],children:t};return {id:"fragment#document",kind:"document",namespaceUri:chunkANZ44KQT_cjs.fa,localName:"document",prefix:"w",namespaceBindings:Me(e.root)?e.root.namespaceBindings:[],attributes:[],children:[n]}}function Gt(e){let t=e.map(n=>{let r=n.targetMode==="External"?' TargetMode="External"':"";return `<Relationship Id="${chunkANZ44KQT_cjs.N(n.id)}" Type="${chunkANZ44KQT_cjs.N(n.type)}" Target="${chunkANZ44KQT_cjs.N(n.rawTarget)}"${r}/>`}).join("");return `<Relationships xmlns="${mc}">${t}</Relationships>`}function xs(e,t){let n=t;for(;e.has(`rId${n}`);)n+=1;return `rId${n}`}function ks(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function zn(e,t){return {...e,children:t}}function Wn(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkANZ44KQT_cjs.fa}function Kt(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)Kt(n,t);return t}function Ps(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=Ps(n,t);if(r)return r}return null}function kc(e){let t=(n,r)=>{if(n.kind==="textValue")return n;if(r&&Wn(n,"vMerge")){if(chunkANZ44KQT_cjs.Cf(n,"val")==="restart")return n;let i=[...n.attributes.filter(a=>!(a.localName==="val"&&a.namespaceUri===chunkANZ44KQT_cjs.fa)),{kind:"wmlVal",namespaceUri:chunkANZ44KQT_cjs.fa,localName:"val",prefix:"w",value:"restart"}];return {...n,attributes:i}}if(n.kind==="paragraph"||n.kind==="table")return n;let o=r||Wn(n,"tc");return zn(n,n.children.map(i=>t(i,o)))};return zn(e,e.children.map(n=>t(n,false)))}function Rs(e,t){if(!(e.kind==="textValue"||e.kind==="table")){if(Wn(e,"tr")){t.push(e);return}for(let n of e.children)Rs(n,t);}}function Os(e,t,n){if(e.kind==="textValue"||e.kind==="table")return {node:e,hadRows:false,keptRows:false};if(Wn(e,"tr")){if(!t.has(e))return {node:null,hadRows:true,keptRows:false};let a=n.value?kc(e):e;return n.value=false,{node:a,hadRows:true,keptRows:true}}let r=false,o=false,i=[];for(let a of e.children){let s=Os(a,t,n);r||=s.hadRows,o||=s.keptRows,s.node!==null&&i.push(s.node);}return r?{node:o?zn(e,i):null,hadRows:true,keptRows:o}:{node:e,hadRows:false,keptRows:false}}function vs(e,t,n){let r=[];for(let l of e.children)Rs(l,r);let o=new Set(Kt(e).filter(l=>t.inRange.has(l)));if(o.size===0)return;let i=r.filter(l=>{let d=Kt(l);return d.length>0&&d.every(c=>t.covered.has(c))}),a=new Set(i.flatMap(l=>Kt(l)));if(i.length>0&&o.size===a.size&&[...o].every(l=>a.has(l))){let l={value:true},d=new Set(i),c=[];for(let m of e.children){let f=Os(m,d,l);f.node!==null&&c.push(f.node);}n.push(zn(e,c));return}for(let l of Kt(e)){if(!t.inRange.has(l))continue;let d=Ps(e,l);d&&n.push(d);}}var Pc="http://schemas.openxmlformats.org/package/2006/content-types",Rc=5e4;function Ue(e){return e.kind!=="textValue"}function Is(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)Is(n,t);return t}function fo(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=fo(n,t);if(r)return r}return null}function Oc(){return {id:"fragment#styles",kind:"generic",namespaceUri:chunkANZ44KQT_cjs.fa,localName:"styles",prefix:"w",namespaceBindings:[{prefix:"w",namespaceUri:chunkANZ44KQT_cjs.fa}],attributes:[],children:[]}}function ze(e,t){return {...e,children:t}}function vc(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkANZ44KQT_cjs.fa}function Ic(e){if(e.root.kind==="document"){let t=e.root.children.find(n=>n.kind==="body");return t&&Ue(t)?t:null}return Ue(e.root)?e.root:null}function bc(e,t){return Is(e).some(n=>t.has(n))}function go(e,t,n){for(let r of e)if(Ue(r)){if(r.kind==="paragraph"){t.inRange.has(r.id)&&n.push(r);continue}if(t.fullBlocks.has(r.id)){n.push(r);continue}if(r.kind==="table"){vs(r,t,n);continue}if(r.kind==="contentControl"){let o=r.children.find(i=>i.kind==="contentControlContent");o&&Ue(o)&&go(o.children,t,n);continue}bc(r,t.inRange)&&go(r.children,t,n);}}var Sc=new Set(["commentRangeStart","commentRangeEnd"]);function Nc(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}function ho(e){if(e.kind==="textValue")return e;if(Sc.has(e.localName)&&e.namespaceUri===chunkANZ44KQT_cjs.fa||Nc(e)||vc(e,"sectPr"))return null;let t=false,n=[];for(let r of e.children){let o=ho(r);if(o===null){t=true;continue}o!==r&&(t=true),n.push(o);}return t?ze(e,n):e}function wc(e){let t=[],n=l=>{if(l.kind!=="textValue"){if(l.kind==="run"){for(let d of l.children)if(d.kind==="fldChar"){let c=chunkANZ44KQT_cjs.Cf(d,"fldCharType");t.push({nodeId:d.id,type:c==="separate"||c==="end"?c:"begin"});}else d.kind==="instrText"&&t.push({nodeId:d.id,type:"instr"});return}for(let d of l.children)n(d);}};for(let l of e)n(l);if(t.length===0)return e;let r=new Set,o=[],i=null,a=[];for(let l of t){if(l.type==="begin"){o.push({beginId:l.nodeId,separateId:null,instrIds:[]});continue}if(l.type==="separate"){let c=o[o.length-1];c?c.separateId=l.nodeId:i=l.nodeId;continue}if(l.type==="instr"){let c=o[o.length-1];c?c.instrIds.push(l.nodeId):i===null&&a.push(l.nodeId);continue}if(!o.pop()){r.add(l.nodeId),i!==null&&r.add(i);for(let c of a)r.add(c);i=null,a=[];}}for(let l of o){r.add(l.beginId),l.separateId!==null&&r.add(l.separateId);for(let d of l.instrIds)r.add(d);}i!==null&&r.add(i);for(let l of a)r.add(l);if(r.size===0)return e;let s=l=>{if(l.kind==="textValue")return l;if(r.has(l.id))return null;let d=[],c=false;for(let m of l.children){let f=s(m);if(f===null){c=true;continue}f!==m&&(c=true),d.push(f);}return c?ze(l,d):l};return e.map(l=>s(l)).filter(l=>l!==null)}function yo(e){if(e.kind==="textValue")return e.value.length;let t=0;for(let n of e.children)t+=yo(n);return t}function Ec(e,t){let n=[];for(let r of e.children){if(r.kind!=="contentControl"){n.push(r);continue}let o=t.get(r.id),i=yo(r);if(o===void 0||i>=o){n.push(r);continue}if(i===0)continue;let a=r.children.find(s=>s.kind==="contentControlContent");a&&Ue(a)?n.push(...a.children):n.push(r);}return ze(e,n)}function Tc(e){let t=new Set,n=new Set,r=a=>{if(a.kind!=="textValue"){if(a.kind==="bookmarkStart"){let s=chunkANZ44KQT_cjs.Cf(a,"id");s!==void 0&&t.add(s);}if(a.kind==="bookmarkEnd"){let s=chunkANZ44KQT_cjs.Cf(a,"id");s!==void 0&&n.add(s);}for(let s of a.children)r(s);}};for(let a of e)r(a);let o=new Set([...t].filter(a=>n.has(a)));if(o.size===t.size&&o.size===n.size)return e;let i=a=>{if(a.kind==="textValue")return a;if(a.kind==="bookmarkStart"||a.kind==="bookmarkEnd"){let d=chunkANZ44KQT_cjs.Cf(a,"id");return d!==void 0&&o.has(d)?a:null}let s=[],l=false;for(let d of a.children){let c=i(d);if(c===null){l=true;continue}c!==d&&(l=true),s.push(c);}return l?ze(a,s):a};return e.map(a=>i(a)??a)}function Cc(e,t,n){let r=e.parts.get(t.partName);if(!r)return {ok:false,reason:"unknown-part"};if(t.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let o=t.paragraphIds[0],i=t.paragraphIds[t.paragraphIds.length-1],a=new Map;for(let w of [o,i]){let j=fo(r.root,w);if(!j)return {ok:false,reason:"empty-range"};for(let G of j.children)G.kind==="contentControl"&&a.set(G.id,yo(G));}let s=r,l=fo(s.root,i);if(!l)return {ok:false,reason:"empty-range"};let d=chunkANZ44KQT_cjs.Rf(l);if(t.endOffset<d){let w=chunkANZ44KQT_cjs.Yj(s,{op:"deleteText",paragraphId:i,start:t.endOffset,end:d},{deferValidation:true});if(!w.ok)return {ok:false,reason:"trim-refused"};s=w.part;}if(t.startOffset>0){let w=chunkANZ44KQT_cjs.Yj(s,{op:"deleteText",paragraphId:o,start:0,end:t.startOffset},{deferValidation:true});if(!w.ok)return {ok:false,reason:"trim-refused"};s=w.part;}let c=Ic(s);if(!c)return {ok:false,reason:"unknown-part"};let m={inRange:new Set(t.paragraphIds),covered:new Set(t.coveredParagraphIds),fullBlocks:new Set(t.fullyCoveredBlockIds)},f=[];if(go(c.children,m,f),f.length===0)return {ok:false,reason:"empty-range"};if(f.length>Rc)return {ok:false,reason:"resource-limit"};let h=f.map(w=>ho(w)).filter(w=>w!==null).map(w=>w.kind!=="paragraph"||w.id!==o&&w.id!==i?w:Ec(w,a));h=[...wc(h)],h=[...Tc(h)];let u=chunkANZ44KQT_cjs.Ig(e,"footnote"),g=chunkANZ44KQT_cjs.Ig(e,"endnote"),y=(w,j)=>Ue(w)&&w.namespaceUri===chunkANZ44KQT_cjs.fa&&w.localName===j,P=Vn(h,(w,j)=>{let G=w==="footnote"?u:g;if(!G||!Ue(G.root))return null;for(let Y of G.root.children){if(!y(Y,w))continue;let re=chunkANZ44KQT_cjs.Cf(Y,"id");if(re!==void 0&&Ne(re)===j)return Y}return null}),p=P.footnote,k=P.endnote;p.size===0&&(u=null),k.size===0&&(g=null);let v=(w,j,G)=>{if(!w||!Ue(w.root))return [];let Y=[];for(let re of w.root.children){if(!y(re,j))continue;let oe=chunkANZ44KQT_cjs.Cf(re,"id"),_e=chunkANZ44KQT_cjs.Cf(re,"type");if(_e==="separator"||_e==="continuationSeparator"){Y.push(re);continue}if(oe!==void 0&&G.has(Ne(oe))){let Fe=ho(re);Fe&&Ue(Fe)&&Y.push(Fe);}}return Y},R=v(u,"footnote",p),x=v(g,"endnote",k),C=[...R,...x];if(zt(h)||zt(C))return {ok:false,reason:"unsupported-content"};let I=[...h,...C],H=new Set;lo(I,H);let D=ps(e,e.mainDocumentPart),J=new Set;co(I,J);let V=[],T=po(e,e.mainDocumentPart,J);for(;;){let w=H.size,j=J.size;V=fs(D,H),co(V,J),T=po(e,e.mainDocumentPart,J);let G=[...T.nums,...T.abstracts];lo(G,H);for(let Y of G)qe(Y,re=>{if(re.kind!=="textValue"&&(re.localName==="styleLink"||re.localName==="numStyleLink")&&re.namespaceUri===chunkANZ44KQT_cjs.fa){let oe=chunkANZ44KQT_cjs.Cf(re,"val");oe&&H.add(oe);}});if(H.size===w&&J.size===j)break}let L=gs(e,e.mainDocumentPart),te=V.map(w=>Qe(w,L)),de=D.part&&Ue(D.part.root)?D.part.root:null,U=ts(de,D.docDefaults,"fragment#doc-defaults"),B=U?Qe(U,L):null;h=h.map(w=>Qe(w,L));let K=R.map(w=>Qe(w,L)),S=x.map(w=>Qe(w,L)),b=new Set;Wt(h,b);let M=chunkANZ44KQT_cjs.pe(e,r.name).filter(w=>b.has(w.id)),X=new Map,ee=0,se=w=>{let j=new Set;for(let G of w){if(G.targetMode==="External")continue;let Y=chunkANZ44KQT_cjs.w(G.ownerPart,G.rawTarget);if(!Y.ok){j.add(G.id);continue}if((chunkANZ44KQT_cjs.qe(e,Y.partName)??"").toLowerCase().startsWith("image/")&&n?.omitMedia!==true){let oe=e.partBytes.get(Y.partName)??e.partBytes.get(Y.partName.replace(/^\//,""));oe?(X.set(Y.partName,oe),ee+=oe.byteLength):j.add(G.id);continue}j.add(G.id);}return j},z=se(M),De=(w,j)=>{if(w.kind==="textValue")return w;if(w.kind==="drawing"||w.namespaceUri===chunkANZ44KQT_cjs.fa&&(w.localName==="pict"||w.localName==="object")){let re=new Set;Wt([w],re);for(let oe of re)if(j.has(oe))return null;return w}let G=[],Y=false;for(let re of w.children){let oe=De(re,j);if(oe===null){Y=true;continue}oe!==re&&(Y=true),G.push(oe);}return Y?ze(w,G):w};z.size>0&&(h=h.map(w=>De(w,z)).filter(w=>w!==null));let pe=M.filter(w=>!z.has(w.id)),At=(w,j)=>{if(!w)return [];let G=new Set;Wt(j,G);let Y=chunkANZ44KQT_cjs.pe(e,w.name).filter(oe=>G.has(oe.id)),re=se(Y);if(re.size>0)for(let oe=0;oe<j.length;oe+=1){let _e=De(j[oe],re);_e!==null&&(j[oe]=_e);}return Y.filter(oe=>!re.has(oe.id))},on=At(u,K),an=At(g,S),Ie=new Map,sn=[],ln=new Map,N=(w,j,G)=>{let Y=hs(w,j,G);Ie.set(w.slice(1),chunkANZ44KQT_cjs.Cd(chunkANZ44KQT_cjs.ta(Y))),sn.push([w,j]),ln.set(w,Y);},A=(w,j)=>w.map(G=>{if(G.targetMode==="External")return {...G,ownerPart:j};let Y=chunkANZ44KQT_cjs.w(G.ownerPart,G.rawTarget);return {...G,ownerPart:j,rawTarget:Y.ok?Y.partName:G.rawTarget}}),_=A(pe,"/word/document.xml"),$=A(on,"/word/footnotes.xml"),W=A(an,"/word/endnotes.xml"),q=new Set(_.map(w=>w.id)),le=9001,ye=(w,j)=>{let G=xs(q,le);le+=1,q.add(G),_.push({ownerPart:"/word/document.xml",id:G,type:w,rawTarget:j,targetMode:"Internal",order:_.length});},xe=ys(s,h);if(N("/word/document.xml",os,xe),te.length>0||B){let w=ze(de??Oc(),[...B?[B]:[],...te]);N("/word/styles.xml",as,w),ye(io,"styles.xml");}if(T.part&&(T.nums.length>0||T.abstracts.length>0)){let w=ze(T.part.root,[...T.abstracts.map(j=>Qe(j,L)),...T.nums]);N("/word/numbering.xml",is,w),ye(so,"numbering.xml");}u&&K.length>0&&(N("/word/footnotes.xml",ss,ze(u.root,K)),ye(ds,"footnotes.xml"),$.length>0&&Ie.set("word/_rels/footnotes.xml.rels",chunkANZ44KQT_cjs.Cd(Gt($)))),g&&S.length>0&&(N("/word/endnotes.xml",ls,ze(g.root,S)),ye(cs,"endnotes.xml"),W.length>0&&Ie.set("word/_rels/endnotes.xml.rels",chunkANZ44KQT_cjs.Cd(Gt(W))));let be=new Map;for(let[w,j]of X){Ie.set(w.slice(1),j);let G=ks(w);G&&!be.has(G)&&be.set(G,chunkANZ44KQT_cjs.qe(e,w)??"application/octet-stream");}let Ke={ownerPart:"/",id:"rId1",type:ms,rawTarget:"word/document.xml",targetMode:"Internal",order:0};Ie.set("word/_rels/document.xml.rels",chunkANZ44KQT_cjs.Cd(Gt(_))),Ie.set("_rels/.rels",chunkANZ44KQT_cjs.Cd(Gt([Ke])));let Xe=[`<Default Extension="rels" ContentType="${ao}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...be].map(([w,j])=>`<Default Extension="${chunkANZ44KQT_cjs.N(w)}" ContentType="${chunkANZ44KQT_cjs.N(j)}"/>`)].join(""),ur=sn.map(([w,j])=>`<Override PartName="${chunkANZ44KQT_cjs.N(w)}" ContentType="${chunkANZ44KQT_cjs.N(j)}"/>`).join("");Ie.set("[Content_Types].xml",chunkANZ44KQT_cjs.Cd(`<Types xmlns="${Pc}">${Xe}${ur}</Types>`));let ae=new Map;ae.set("/",[Ke]),ae.set("/word/document.xml",_),$.length>0&&ae.set("/word/footnotes.xml",$),W.length>0&&ae.set("/word/endnotes.xml",W);let me=[];for(let w of ae.values())for(let j of w)j.targetMode==="External"&&me.push({ownerPart:j.ownerPart,id:j.id,type:j.type,rawTarget:j.rawTarget,sinkSafe:chunkANZ44KQT_cjs.x(j.rawTarget).ok});let we=new Map;we.set("rels",ao),we.set("xml","application/xml");for(let[w,j]of be)we.set(w,j);let dn={defaults:we,overrides:new Map(sn)},Dt=new Map;for(let[w,j]of Ie)Dt.set(w.startsWith("/")?w:`/${w}`,j);return {ok:true,bytes:chunkANZ44KQT_cjs.Bd(Ie),package:Object.freeze({parts:ln,partBytes:Dt,relationships:ae,externalTargets:me,contentTypes:dn,mainDocumentPart:"/word/document.xml"}),lastMarkCovered:t.lastMarkCovered,blockCount:h.length,mediaBytes:ee}}function ie(e){return e.kind!=="textValue"}function Q(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===chunkANZ44KQT_cjs.fa}function Ae(e,t){for(let n of e)t(n),n.kind!=="textValue"&&Ae(n.children,t);}function Ze(e){if(e.kind==="textValue")return `T(${e.value})`;if(e.namespaceUri===chunkANZ44KQT_cjs.fa&&e.localName.startsWith("rsid"))return "";let t=e.attributes.filter(r=>!r.localName.startsWith("rsid")&&!(r.namespaceUri===chunkANZ44KQT_cjs.ja&&(r.localName==="paraId"||r.localName==="textId"))).map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(","),n=e.children.map(Ze).join("");return `E(${e.namespaceUri}:${e.localName}[${t}]{${n}})`}function Yt(e){return `S[${e.attributes.filter(n=>n.localName!=="styleId").map(n=>`${n.localName}=${n.value}`).sort().join(",")}]${e.children.map(Ze).join("")}`}function Xn(e){let t=[],n=new Map,r=new Set,o=null;if(e&&ie(e.root))for(let i of e.root.children){if(!ie(i))continue;if(Q(i,"docDefaults")){o=i;continue}if(!Q(i,"style"))continue;t.push(i);let a=chunkANZ44KQT_cjs.Cf(i,"styleId");a&&n.set(a,i);let s=i.children.find(d=>Q(d,"name")),l=s?chunkANZ44KQT_cjs.Cf(s,"val"):void 0;l&&r.add(l);}return {part:e,styles:t,docDefaults:o,byId:n,names:r}}function Gn(e,t,n){let r=new Map;if(!e)return r;let o=e.children.find(a=>Q(a,t));if(!o||!ie(o))return r;let i=o.children.find(a=>Q(a,n));if(!i||!ie(i))return r;for(let a of i.children)a.kind!=="textValue"&&r.set(a.localName,a);return r}function Ss(e){let t=e.part?.root;return t&&ie(t)?t:null}function bs(e){return oo(Ss(e),e.docDefaults)}function Kn(e){return new Map(e.map(t=>[t.localName,chunkANZ44KQT_cjs.Gi(t,`fragment#application-${t.localName}`)]))}function Mc(e,t){let n=new Set,r=t;for(let o=0;o<16&&r;o+=1){let i=e.byId.get(r);if(!i)break;let s=Xt(i,"pPr")?.children.find(d=>Q(d,"spacing"));if(s&&ie(s))for(let d of s.attributes)n.add(d.localName);let l=i.children.find(d=>Q(d,"basedOn"));r=l?chunkANZ44KQT_cjs.Cf(l,"val"):void 0;}return n}function xo(e,t,n,r){let o=t;for(let i=0;i<16&&o;i+=1){let a=e.byId.get(o);if(!a)return false;let s=a.children.find(d=>Q(d,n));if(s&&ie(s)&&s.children.some(d=>d.kind!=="textValue"&&d.localName===r))return true;let l=a.children.find(d=>Q(d,"basedOn"));o=l?chunkANZ44KQT_cjs.Cf(l,"val"):void 0;}return false}function Ac(e,t){for(let n of e.styles){if(chunkANZ44KQT_cjs.Cf(n,"type")!==t)continue;let r=chunkANZ44KQT_cjs.Cf(n,"default");if(r==="1"||r==="true")return chunkANZ44KQT_cjs.Cf(n,"styleId")}}function Xt(e,t){let n=e.children.find(r=>Q(r,t));return n&&ie(n)?n:null}var Dc=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((e,t)=>[e,t])),_c=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((e,t)=>[e,t]));function ko(e,t,n){let r=Ss(t)?bs(t):null,o=bs(n),i=r?.run?Kn(Bn):Gn(t.docDefaults,"rPrDefault","rPr"),a=o.run?Kn(Bn):Gn(n.docDefaults,"rPrDefault","rPr"),s=r?.paragraph?Kn(jn):Gn(t.docDefaults,"pPrDefault","pPr"),l=o.paragraph?Kn(jn):Gn(n.docDefaults,"pPrDefault","pPr"),d=(p,k,v)=>{let R=Ac(p,"paragraph"),x=R?p.byId.get(R):void 0;if(!x)return R;for(let[C,I]of [["rPr",k],["pPr",v]]){let H=Xt(x,C);if(H)for(let D of H.children)D.kind!=="textValue"&&I.set(D.localName,D);}return R};d(t,i,s),d(n,a,l);let c=new Map;for(let[p,k]of i){let v=a.get(p);(!v||Ze(v)!==Ze(k))&&c.set(p,k);}let m=new Map;for(let[p,k]of s){if(p==="sectPr")continue;let v=l.get(p);(!v||Ze(v)!==Ze(k))&&m.set(p,k);}if(c.size===0&&m.size===0)return e;let f=0,h=()=>`fragment#materialized-${f++}`,u=p=>{let k=v=>v.kind==="textValue"?{id:h(),kind:"textValue",value:v.value}:{...v,id:h(),children:v.children.map(k)};return k(p)},g=(p,k,v)=>{if(v.length===0)return p;let R=Xt(p,k);if(R){let C=k==="rPr"?_c:Dc,I=[...R.children];for(let D of v){let J=D.kind==="textValue"?Number.MAX_SAFE_INTEGER:C.get(D.localName)??Number.MAX_SAFE_INTEGER,V=I.length;for(let T=0;T<I.length;T+=1){let L=I[T];if(L.kind==="textValue")continue;let te=C.get(L.localName);if(te!==void 0&&te>J){V=T;break}}I.splice(V,0,D);}let H={...R,children:I};return {...p,children:p.children.map(D=>D===R?H:D)}}let x={id:h(),kind:k==="rPr"?"runProperties":"paragraphProperties",namespaceUri:chunkANZ44KQT_cjs.fa,localName:k,prefix:"w",namespaceBindings:[],attributes:[],children:v};return {...p,children:[x,...p.children]}},y=(p,k,v,R,x)=>{let C=Mc(t,x),I=k.children.find(T=>Q(T,"spacing"));if(I&&ie(I))for(let T of I.attributes)C.add(T.localName);let H=new Map(R&&ie(R)?R.attributes.map(T=>[T.localName,T.value]):[]),D=v.attributes.filter(T=>!C.has(T.localName)&&H.get(T.localName)!==T.value);if(D.length===0)return p;let J=I&&ie(I)?{...I,attributes:[...I.attributes,...D]}:{...v,id:h(),attributes:D,children:[]},V=I?{...k,children:k.children.map(T=>T===I?J:T)}:g(p,"pPr",[J]).children.find(T=>Q(T,"pPr"));return {...p,children:p.children.map(T=>T===k?V:T)}},O=p=>{let k=Xt(p,"pPr"),v=k?.children.find(D=>Q(D,"pStyle")),R=v?chunkANZ44KQT_cjs.Cf(v,"val"):void 0,x=[],C=p;for(let[D,J]of m){let V=k?.children.some(L=>L.kind!=="textValue"&&L.localName===D),T=!!R&&xo(t,R,"pPr",D);D==="spacing"&&(V||T)&&k!==null&&ie(J)&&(C=y(C,k,J,l.get("spacing"),R)),!(V||T)&&x.push(u(J));}let I=D=>{if(D.kind==="textValue")return D;if(D.kind==="run"){let V=Xt(D,"rPr"),T=V?.children.find(de=>Q(de,"rStyle")),L=T?chunkANZ44KQT_cjs.Cf(T,"val"):void 0,te=[];for(let[de,U]of c)V?.children.some(K=>K.kind!=="textValue"&&K.localName===de)||L&&xo(t,L,"rPr",de)||R&&xo(t,R,"rPr",de)||te.push(u(U));return g(D,"rPr",te)}if(D.kind==="paragraphProperties"||D.kind==="runProperties")return D;let J=D.children.map(I);return J.some((V,T)=>V!==D.children[T])?{...D,children:J}:D};return I(g(C,"pPr",x))},P=p=>{if(p.kind==="textValue")return p;if(p.kind==="paragraph")return O(p);let k=p.children.map(P);return k.some((v,R)=>v!==p.children[R])?{...p,children:k}:p};return e.map(P)}var Ns="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function ge(e,t,n,r){return {...e,attributes:e.attributes.map(o=>o.localName===n&&o.namespaceUri===t?{...o,value:r}:o)}}var Fc=new Set(["pStyle","rStyle","tblStyle","basedOn","link","next","styleLink","numStyleLink"]),Po=chunkANZ44KQT_cjs.Tg,We=new Map;function It(e,t){let n=t.styleIds??We,r=t.numIds??We,o=t.relIds??We,i=t.footnoteIds??We,a=t.endnoteIds??We,s=t.bookmarkIds??We,l=t.sdtIds??We,d=t.revisionIds??We,c=t.docPrIds??We,m=(f,h)=>{if(f.kind==="textValue")return f;let u=f;if(f.namespaceUri===chunkANZ44KQT_cjs.fa&&Fc.has(f.localName)){let P=chunkANZ44KQT_cjs.Cf(f,"val"),p=P!==void 0?n.get(P):void 0;p!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"val",p));}if(Q(f,"numId")){let P=chunkANZ44KQT_cjs.Cf(f,"val"),p=P!==void 0?r.get(P):void 0;p!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"val",p));}if(f.kind==="noteReference"){let P=f.localName==="footnoteReference"?i:a,p=chunkANZ44KQT_cjs.Cf(f,"id"),k=p!==void 0?P.get(Ne(p)):void 0;k!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"id",k));}if(f.kind==="bookmarkStart"||f.kind==="bookmarkEnd"){let P=chunkANZ44KQT_cjs.Cf(f,"id"),p=P!==void 0?s.get(P):void 0;p!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"id",p));}if(Q(f,"id")&&h==="sdtPr"){let P=chunkANZ44KQT_cjs.Cf(f,"val"),p=P!==void 0?l.get(P):void 0;p!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"val",p));}if(Po(f)){let P=chunkANZ44KQT_cjs.Cf(f,"id"),p=P!==void 0?d.get(P):void 0;p!==void 0&&(u=ge(u,chunkANZ44KQT_cjs.fa,"id",p));}if(f.kind==="drawingDocPr"){let P=f.attributes.find(k=>k.localName==="id"&&k.namespaceUri==="")?.value,p=P!==void 0?c.get(P):void 0;p!==void 0&&(u=ge(u,"","id",p));}for(let P of u.attributes){if(P.namespaceUri!==Ns)continue;let p=o.get(P.value);p!==void 0&&p!==P.value&&(u=ge(u,Ns,P.localName,p));}let g=f.localName,y=u.children.map(P=>m(P,g));return u!==f||y.some((P,p)=>P!==u.children[p])?{...u,children:y}:f};return m(e,"")}function ws(e,t,n){let r=e,o=n.get(e)??2;for(;t.has(r);)r=`${e}${o}`,o+=1;return n.set(e,o),r}function Es(e,t,n){let r=`${e} (pasted)`,o=n.get(e)??2;for(;t.has(r);)r=`${e} (pasted ${o})`,o+=1;return n.set(e,o),r}var Lc=1e5;function Ts(e){let t=chunkANZ44KQT_cjs.ub(),n=$c(e,t),r=Uc(e,t),o=Bc(e,t);return !n||!r||!o?null:{bookmarkIds:n,revisionIds:r,docPrIds:o}}function Ro(e,t,n,r){if(e)return chunkANZ44KQT_cjs.xb(t,e,r);let o=n;return ()=>String(o++)}function Cs(e,t){if(e.add(t),!/^\d{1,10}$/.test(t))return;let n=Number(t);n<=chunkANZ44KQT_cjs.rb&&e.add(String(n));}function Ms(e,t){if(t===void 0)return e;let n=Number(t);return Number.isInteger(n)&&n>e?n:e}function $c(e,t){let n=new Map;if(e.fragmentBookmarkIds.length===0)return n;let r=0,o=new Set;for(let a of [e.ownerPart,...e.notesParts])Ae([a.root],s=>{if(s.kind!=="bookmarkStart"&&s.kind!=="bookmarkEnd")return;let l=chunkANZ44KQT_cjs.Cf(s,"id");l!==void 0&&(Cs(o,l),s.kind==="bookmarkStart"&&(r=Ms(r,l)));});let i=Ro(t,o,r+1,chunkANZ44KQT_cjs.rb);for(let a of e.fragmentBookmarkIds){if(n.has(a))continue;let s=i();if(s===null)return null;n.set(a,s);}return n}function Uc(e,t){let n=new Map;if(!e.hasRevision)return n;let r=0,o=new Set;for(let s of [e.ownerPart,...e.notesParts]){let l=s===e.ownerPart;Ae([s.root],d=>{if(!chunkANZ44KQT_cjs.Tg(d))return;let c=chunkANZ44KQT_cjs.Cf(d,"id");c!==void 0&&Cs(o,c),l&&(r=Ms(r,c));});}let i=Ro(t,o,r+1,chunkANZ44KQT_cjs.rb),a=false;return Ae(e.travelling,s=>{if(a||!chunkANZ44KQT_cjs.Tg(s))return;let l=chunkANZ44KQT_cjs.Cf(s,"id");if(l===void 0||n.has(l))return;let d=i();d===null?a=true:n.set(l,d);}),a?null:n}function Bc(e,t){let n=new Map;if(!e.hasDocPr)return n;let{used:r}=chunkANZ44KQT_cjs.Zd(e.pkg),o=Lc;if(!t){let s=chunkANZ44KQT_cjs._d(e.pkg);s.ok&&(o=s.id);}let i=Ro(t,r,o,chunkANZ44KQT_cjs.Yd),a=false;return Ae(e.travelling,s=>{if(a||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?a=true:n.set(l,d);}),a?null:n}function As(e,t){return `${t?Yt(t):"none"}::${e.children.filter(n=>Q(n,"lvlOverride")).map(Ze).join("")}`}function Ds(e){let t=e.children.find(n=>Q(n,"abstractNumId"));return t?chunkANZ44KQT_cjs.Cf(t,"val"):void 0}function _s(e,t,n){let r=new Set(["0"]),o=0;for(let s of e?.root.children??[]){if(!ie(s)||!Q(s,t))continue;let l=chunkANZ44KQT_cjs.Cf(s,n);if(l===void 0)continue;let d=Number(l);Number.isInteger(d)&&(r.add(String(d)),d>o&&(o=d));}let i=chunkANZ44KQT_cjs.ub();if(i)return chunkANZ44KQT_cjs.xb(r,i,chunkANZ44KQT_cjs.sb);let a=o+1;return ()=>String(a++)}function Fs(e,t){let n={numIdMap:new Map,numsToImport:[],abstractsToImport:[]};if(!e||!ie(e.root))return n;let r=new Map,o=[];for(let d of e.root.children)if(ie(d))if(Q(d,"abstractNum")){let c=chunkANZ44KQT_cjs.Cf(d,"abstractNumId");c&&r.set(c,d);}else Q(d,"num")&&o.push(d);let i=new Map;if(t&&ie(t.root)){let d=new Map;for(let c of t.root.children){if(!ie(c)||!Q(c,"abstractNum"))continue;let m=chunkANZ44KQT_cjs.Cf(c,"abstractNumId");m&&d.set(m,c);}for(let c of t.root.children){if(!ie(c)||!Q(c,"num"))continue;let m=chunkANZ44KQT_cjs.Cf(c,"numId");if(!m)continue;let f=Ds(c),h=f?d.get(f):void 0;i.set(As(c,h),m);}}let a=_s(t,"abstractNum","abstractNumId"),s=_s(t,"num","numId"),l=new Map;for(let d of o){let c=chunkANZ44KQT_cjs.Cf(d,"numId");if(!c)continue;let m=Ds(d),f=m?r.get(m):void 0,h=As(d,f),u=i.get(h);if(u!==void 0){n.numIdMap.set(c,u);continue}let g=m?l.get(m):void 0;if(g===void 0&&f&&m){let P=a();if(P===null)return null;g=P,l.set(m,g),n.abstractsToImport.push(ge(f,chunkANZ44KQT_cjs.fa,"abstractNumId",g));}let y=s();if(y===null)return null;n.numIdMap.set(c,y);let O=ge(d,chunkANZ44KQT_cjs.fa,"numId",y);if(g!==void 0){let P=O.children.map(p=>Q(p,"abstractNumId")?ge(p,chunkANZ44KQT_cjs.fa,"val",g):p);O={...O,children:P};}n.numsToImport.push(O),i.set(h,y);}return n}var bt="http://schemas.openxmlformats.org/officeDocument/2006/relationships",jc=`${bt}/hyperlink`,Ls=`${bt}/image`,Yn=`${bt}/numbering`,Oo=`${bt}/styles`,$s="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Us="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Jt(e,t,n,r){for(let o of chunkANZ44KQT_cjs.pe(e,t)){if(o.type!==n||o.targetMode==="External")continue;let i=chunkANZ44KQT_cjs.w(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a)return a}}return e.parts.get(r)??null}function Hc(e,t){let n=0;return Ae([e],r=>{let o=t(r);if(o===void 0)return;let i=Number(o);Number.isInteger(i)&&i>n&&(n=i);}),n}function Jn(e,t,n,r){if(n.length===0)return e;let o=chunkANZ44KQT_cjs.Ia(t,"paste"),i=n.map(d=>chunkANZ44KQT_cjs.Hf(d,o)),a=chunkANZ44KQT_cjs.Wj(t,i),s=r??a.root.children.length,l=chunkANZ44KQT_cjs.Oa(a,a.root.id,s,i,{deferValidation:true});return l.ok?chunkANZ44KQT_cjs.ne(e,l.part):null}function Bs(e,t){if(t.size===0)return [...e];let n=o=>{if(o.kind==="textValue")return o;if(o.kind==="drawing"||Q(o,"pict")||Q(o,"object")){let a=false;return Ae([o],s=>{if(s.kind!=="textValue")for(let l of s.attributes)l.namespaceUri===bt&&t.has(l.value)&&(a=true);}),a?null:o}if(o.kind==="hyperlink"){let a=o.attributes.find(s=>s.namespaceUri===bt)?.value;if(a!==void 0&&t.has(a))return r(o.children)}let i=r(o.children);return i.length===o.children.length&&i.every((a,s)=>a===o.children[s])?o:{...o,children:i}};function r(o){let i=[];for(let a of o){let s=n(a);s!==null&&(Array.isArray(s)?i.push(...s):i.push(s));}return i}return r(e)}var Vc=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),js={"image/jpg":"image/jpeg","image/x-ms-bmp":"image/bmp","image/x-bmp":"image/bmp"};function zc(e,t){let n=chunkANZ44KQT_cjs.Od(e);return n==="unknown"||(Object.hasOwn(js,t)?js[t]:t)!==n||Vc.has(n)&&!chunkANZ44KQT_cjs.$d(e,n)?null:n}function vo(e,t,n){for(let N of t.parts.values())if(zt([N.root]))return {ok:false,reason:"unsupported-content"};let r=t.parts.get(t.mainDocumentPart);if(!r)return {ok:false,reason:"no-fragment-document"};if(!e.parts.has(n))return {ok:false,reason:"no-target-part"};let o=r.root.kind==="document"?r.root.children.find(N=>N.kind==="body"):null;if(!o||!ie(o))return {ok:false,reason:"no-fragment-document"};let i=chunkANZ44KQT_cjs.Xj(o.children.filter(N=>N.kind==="paragraph"||N.kind==="table"||N.kind==="contentControl"));if(i.length===0)return {ok:false,reason:"no-fragment-document"};let a=e,s=Fs(Jt(t,t.mainDocumentPart,Yn,"/word/numbering.xml"),Jt(a,a.mainDocumentPart,Yn,"/word/numbering.xml"));if(!s)return {ok:false,reason:"merge-refused"};let{numIdMap:l,numsToImport:d,abstractsToImport:c}=s,m=Xn(Jt(t,t.mainDocumentPart,Oo,"/word/styles.xml")),f=Jt(a,a.mainDocumentPart,Oo,"/word/styles.xml"),h=Xn(f),u=new Map,g=[],y=new Set(h.byId.keys()),O=new Set(h.names),P=new Map,p=new Map,k=new Map,v=(N,A)=>{let _=k.get(N);return _===void 0&&(_=Yt(A),k.set(N,_)),_},R=N=>({...N,attributes:N.attributes.filter(A=>!(A.localName==="default"&&A.namespaceUri===chunkANZ44KQT_cjs.fa))});for(let N of m.styles){let A=chunkANZ44KQT_cjs.Cf(N,"styleId");if(!A)continue;let _=h.byId.get(A),$=Yt(It(N,{styleIds:u,numIds:l}));if(_&&v(A,_)===$){u.set(A,A);continue}if(!_){u.set(A,A),y.add(A),g.push(R(N));continue}let W=ws(`${A}Pasted`,y,P);y.add(W),u.set(A,W),g.push(R(ge(N,chunkANZ44KQT_cjs.fa,"styleId",W)));}let x=g.map(N=>{let A=N.children.find(q=>Q(q,"name")),_=A?chunkANZ44KQT_cjs.Cf(A,"val"):void 0;if(!_||!O.has(_))return _&&O.add(_),N;let $=Es(_,O,p);O.add($);let W=N.children.map(q=>Q(q,"name")?ge(q,chunkANZ44KQT_cjs.fa,"val",$):q);return {...N,children:W}}),C=null,I=1,H=()=>{if(C)return C;let N=new Map;for(let[A,_]of a.partBytes){let $=A.startsWith("/")?A:`/${A}`;if(!$.startsWith("/word/media/"))continue;N.set(chunkANZ44KQT_cjs.a(_),$);let W=/\/image(\d+)\./.exec($);W&&(I=Math.max(I,Number(W[1])+1));}return C=N,N},D=new Map,J=N=>{let A=D.get(N);if(!A){A=new Map;for(let _ of chunkANZ44KQT_cjs.pe(a,N)){if(_.targetMode==="External"||_.type!==Ls)continue;let $=chunkANZ44KQT_cjs.w(_.ownerPart,_.rawTarget);$.ok&&A.set($.partName,_.id);}D.set(N,A);}return A},V=(N,A)=>{let _=N.lastIndexOf("."),$=_===-1?"":N.slice(_+1);return /^[A-Za-z0-9]{1,8}$/.test($)?$.toLowerCase():A==="image/jpeg"?"jpeg":A==="image/gif"?"gif":"png"},T=(N,A,_)=>{let $=new Map,W=new Set,q=J(A),le=[],ye=new Set,xe=[],be=[],Ke=new Map,Xe=[],ur=t.relationships.get(N)??[];for(let ae of ur){if(!_.has(ae.id))continue;if(ae.targetMode==="External"){if(ae.type===jc){let Fe=chunkANZ44KQT_cjs.lg(a,ae.rawTarget,A);Fe?(a=Fe.pkg,$.set(ae.id,Fe.relationshipId)):W.add(ae.id);}else W.add(ae.id);continue}let me=chunkANZ44KQT_cjs.w(ae.ownerPart,ae.rawTarget);if(!me.ok){W.add(ae.id);continue}let we=t.partBytes.get(me.partName)??t.partBytes.get(me.partName.replace(/^\//,"")),dn=(chunkANZ44KQT_cjs.qe(t,me.partName)??"").toLowerCase();if(!we||!dn.startsWith("image/")){W.add(ae.id);continue}let Dt=zc(we,dn);if(Dt===null){W.add(ae.id);continue}let w=Dt,j=H(),G=chunkANZ44KQT_cjs.a(we),Y=j.get(G);if(!Y){let Fe=V(me.partName,w),Kd=cn=>a.partBytes.has(cn)||a.partBytes.has(cn.slice(1))||a.parts.has(cn)||ye.has(cn),pr=`/word/media/image${I}.${Fe}`;for(;Kd(pr);)I+=1,pr=`/word/media/image${I}.${Fe}`;I+=1,Y=pr,le.push({partName:Y,bytes:we,contentType:w}),ye.add(Y),j.set(G,Y);}let re=Y.startsWith("/word/")?Y.slice(6):Y,oe=q.get(Y);if(oe!==void 0){$.set(ae.id,oe);continue}let _e=Ke.get(Y);_e===void 0&&(_e=xe.length,Ke.set(Y,_e),xe.push(re),be.push(Y)),Xe.push({recordId:ae.id,index:_e});}if(le.length>0&&(a=chunkANZ44KQT_cjs.de(a,le)),xe.length>0){let ae=chunkANZ44KQT_cjs.te(chunkANZ44KQT_cjs.ve(a,A),A,xe.map(me=>[Ls,me]));if(ae.ok){a=ae.pkg,ae.ids.forEach((me,we)=>{q.set(be[we],me);});for(let me of Xe)$.set(me.recordId,ae.ids[me.index]);}else for(let me of Xe)W.add(me.recordId);}return {relIdMap:$,dropRelIds:W}},L=T(t.mainDocumentPart,n,mo(i));i=Bs(i,L.dropRelIds);let te=new Map,de=new Map,U=[],B=(N,A)=>ie(N)&&N.namespaceUri===chunkANZ44KQT_cjs.fa&&N.localName===A,K={},S=Vn(i,(N,A)=>{let _=K[N];if(_===void 0){_=new Map,K[N]=_;let $=chunkANZ44KQT_cjs.Ig(t,N);if($&&ie($.root))for(let W of $.root.children){if(!B(W,N))continue;let q=chunkANZ44KQT_cjs.Cf(W,"id");if(q===void 0)continue;let le=Ne(q);_.has(le)||_.set(le,W);}}return _.get(A)??null});for(let N of ["footnote","endnote"]){let A=N==="footnote"?te:de,_=S[N];if(_.size===0)continue;let $=chunkANZ44KQT_cjs.Ig(t,N);if(!$||!ie($.root))continue;let W=chunkANZ44KQT_cjs.zh(a,N);if(!W.ok||!W.package)return {ok:false,reason:"merge-refused"};a=W.package;let q=chunkANZ44KQT_cjs.Ig(a,N);if(!q)return {ok:false,reason:"merge-refused"};let le=Hc(q.root,xe=>B(xe,N)?chunkANZ44KQT_cjs.Cf(xe,"id"):void 0)+1,ye=[];for(let xe of $.root.children){if(!B(xe,N))continue;let be=chunkANZ44KQT_cjs.Cf(xe,"id"),Ke=chunkANZ44KQT_cjs.Cf(xe,"type");if(Ke==="separator"||Ke==="continuationSeparator"||be===void 0||!_.has(Ne(be))||A.has(Ne(be)))continue;let Xe=String(le++);A.set(Ne(be),Xe),ye.push(ge(xe,chunkANZ44KQT_cjs.fa,"id",Xe));}ye.length>0&&U.push({kind:N,fragmentPartName:$.name,bodies:chunkANZ44KQT_cjs.Xj(ye)});}let b=a.parts.get(n),M=[...i,...U.flatMap(N=>N.bodies)],X=[],ee=new Set,se=false,z=false,De=new Map;Ae(M,N=>{if(N.kind!=="textValue"){if(N.kind==="bookmarkStart"||N.kind==="bookmarkEnd"){let A=chunkANZ44KQT_cjs.Cf(N,"id");if(A!==void 0&&X.push(A),N.kind==="bookmarkStart"){let _=chunkANZ44KQT_cjs.Cf(N,"name");_&&ee.add(_);}return}if(Po(N)){se=true;return}if(N.kind==="drawingDocPr"){z=true;return}if(N.kind==="contentControlProperties")for(let A of N.children){if(!Q(A,"id"))continue;let _=chunkANZ44KQT_cjs.Cf(A,"val");if(_!==void 0&&!De.has(_)){let $=0,W=`${_}:${De.size}`;for(let q=0;q<W.length;q+=1)$=$*31+W.charCodeAt(q)>>>0;De.set(_,String($%2147483647||1));}}}});let pe=Ts({pkg:a,ownerPart:b,notesParts:U.map(N=>chunkANZ44KQT_cjs.Ig(a,N.kind)).filter(N=>N!==null),travelling:M,fragmentBookmarkIds:X,hasRevision:se,hasDocPr:z});if(!pe)return {ok:false,reason:"merge-refused"};let At=pe.bookmarkIds,on=pe.revisionIds,an=pe.docPrIds;if(ee.size>0){let N=new Set;if(Ae([b.root],A=>{if(A.kind!=="textValue"&&A.kind==="bookmarkStart"){let _=chunkANZ44KQT_cjs.Cf(A,"name"),$=chunkANZ44KQT_cjs.Cf(A,"id");_&&$!==void 0&&ee.has(_)&&N.add($);}}),N.size>0){let A=$=>{if($.kind==="textValue")return $;let W=[],q=false;for(let le of $.children){if((le.kind==="bookmarkStart"||le.kind==="bookmarkEnd")&&N.has(chunkANZ44KQT_cjs.Cf(le,"id")??"")){q=true;continue}let ye=A(le);ye!==le&&(q=true),W.push(ye);}return q?{...$,children:W}:$},_=A(b.root);_!==b.root&&(chunkANZ44KQT_cjs.Ma(b.root,_),a=chunkANZ44KQT_cjs.ne(a,{...b,root:_}));}}let Ie=N=>uo(N,te,de);for(let N of U){N.bodies=N.bodies.map(Ie);let A=chunkANZ44KQT_cjs.Ig(a,N.kind);if(!A)return {ok:false,reason:"merge-refused"};let _=T(N.fragmentPartName,A.name,mo(N.bodies)),$=Bs(N.bodies,_.dropRelIds);$=[...ko($,m,h)],$=$.map(q=>It(q,{styleIds:u,numIds:l,relIds:_.relIdMap,footnoteIds:te,endnoteIds:de,bookmarkIds:At,sdtIds:De,revisionIds:on,docPrIds:an}));let W=Jn(a,a.parts.get(A.name),$);if(!W)return {ok:false,reason:"merge-refused"};a=W;}if(x.length>0){let N=x.map(_=>It(_,{styleIds:u,numIds:l}));if(!f){let _=chunkANZ44KQT_cjs.Aa(`<w:styles xmlns:w="${chunkANZ44KQT_cjs.fa}"></w:styles>`,{name:"/word/styles.xml",contentType:Us});if(!_.ok)return {ok:false,reason:"merge-refused"};a=chunkANZ44KQT_cjs.xe(a,"/word/styles.xml",_.part.root,Us);let $=chunkANZ44KQT_cjs.we(chunkANZ44KQT_cjs.ve(a,a.mainDocumentPart),a.mainDocumentPart,Oo,"styles.xml");if(!$.ok)return {ok:false,reason:"merge-refused"};a=$.pkg,f=a.parts.get("/word/styles.xml")??null;}if(!f)return {ok:false,reason:"merge-refused"};let A=Jn(a,a.parts.get(f.name),N);if(!A)return {ok:false,reason:"merge-refused"};a=A,h=Xn(a.parts.get(f.name)??null);}if(c.length>0||d.length>0){let N=Jt(a,a.mainDocumentPart,Yn,"/word/numbering.xml");if(!N){let q=chunkANZ44KQT_cjs.Aa(`<w:numbering xmlns:w="${chunkANZ44KQT_cjs.fa}"></w:numbering>`,{name:"/word/numbering.xml",contentType:$s});if(!q.ok)return {ok:false,reason:"merge-refused"};a=chunkANZ44KQT_cjs.xe(a,"/word/numbering.xml",q.part.root,$s);let le=chunkANZ44KQT_cjs.we(chunkANZ44KQT_cjs.ve(a,a.mainDocumentPart),a.mainDocumentPart,Yn,"numbering.xml");if(!le.ok)return {ok:false,reason:"merge-refused"};a=le.pkg,N=a.parts.get("/word/numbering.xml")??null;}if(!N)return {ok:false,reason:"merge-refused"};let A=a.parts.get(N.name),_=A.root.children.findIndex(q=>Q(q,"num")),$=c.map(q=>It(q,{styleIds:u,numIds:l})),W=Jn(a,A,$,_===-1?void 0:_);if(!W)return {ok:false,reason:"merge-refused"};if(a=W,W=Jn(a,a.parts.get(N.name),d),!W)return {ok:false,reason:"merge-refused"};a=W;}let ln=[...ko(i,m,h)].map(Ie).map(N=>It(N,{styleIds:u,numIds:l,relIds:L.relIdMap,footnoteIds:te,endnoteIds:de,bookmarkIds:At,sdtIds:De,revisionIds:on,docPrIds:an}));return {ok:true,pkg:a,blocks:ln}}var Hs=16*1024*1024;function Wc(e){let t=e.parts.get(e.mainDocumentPart);if(!t||t.root.kind!=="document")return false;let n=t.root.children.find(i=>i.kind==="body");if(!n||n.kind!=="body"||n.children.length>chunkANZ44KQT_cjs.Tj)return false;let r=0,o=(i,a,s)=>{if(a>s||(r+=1,r>chunkANZ44KQT_cjs.Vj))return false;if(i.kind==="textValue")return true;for(let l of i.children)if(!o(l,a+1,s))return false;return true};for(let i of n.children)if(!o(i,1,chunkANZ44KQT_cjs.Uj))return false;for(let[i,a]of e.parts)if(i!==e.mainDocumentPart&&/\/(styles|numbering|footnotes|endnotes)\.xml$/.test(i)&&!o(a.root,1,chunkANZ44KQT_cjs.Uj*4))return false;return true}function Io(e,t,n){if(n.fragmentBytes.byteLength>Hs)return {ok:false,reason:"invalidArgs",detail:"fragment-too-large"};let r=chunkANZ44KQT_cjs.le(n.fragmentBytes);if(!r.ok)return {ok:false,reason:"invalidArgs",detail:`fragment-read:${r.reason}`};let o=r.package;if(!Wc(o))return {ok:false,reason:"invalidArgs",detail:"fragment-over-budget"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let{store:a,story:s}=i;if(a.compositionActive||e.compositionSessionOpen())return {ok:false,reason:"invalidArgs",detail:"ime-composition-active"};let l=e.currentPackage(),d=a.checkpoint();a.graftPackage(()=>e.currentPackage());let c=0,m="";return chunkANZ44KQT_cjs.Fa(e,()=>{let f=a.transact(u=>{for(let P of n.priorOps??[])if(!u.apply(P))return;let g=null,y=u.applyPackage(P=>(g=vo(P,o,s.partName),g.ok?g.pkg:P)),O=g;if(!O||!O.ok){m=`fragment-merge:${O?O.reason:"no-merge"}`,u.apply({op:"insertText",paragraphId:"\0fragment-abort",offset:0,text:"x"});return}y&&(c=O.blocks.length,u.apply({op:"insertFragment",paragraphId:n.paragraphId,offset:n.offset,blocks:O.blocks,lastMarkCovered:n.lastMarkCovered}));},{story:s,...n.actorId?{actorId:n.actorId}:{}});return m.length>0?{ok:false,reason:"invalidArgs",detail:m}:f.ok?f.change?{ok:true,change:e.promoteStoryTransactionToPackageUnit(l,a,d),blockCount:c}:{ok:true,change:null,blockCount:c}:{ok:false,reason:f.reason,...f.detail?{detail:f.detail}:{}}},f=>chunkANZ44KQT_cjs.Ga(f))}function Vs(){let e=null;return (t,n,r)=>{let o=e;if(e=null,!chunkANZ44KQT_cjs.rj(n)||!("paragraphId"in r)||!chunkANZ44KQT_cjs.tj(t,r.paragraphId))return r;if(r.op==="insertText"&&!r.revision&&r.inside===void 0&&o&&o.partName===t.name&&o.paragraphId===r.paragraphId&&o.offset===r.offset)return {...r,inside:o.controlId};if(r.op!=="deleteText"||r.revision||r.start>=r.end)return r;let i=chunkANZ44KQT_cjs.Ka(t,r.paragraphId);if(i?.kind!=="paragraph")return r;let a=chunkANZ44KQT_cjs.yj(t,chunkANZ44KQT_cjs.xj(r));if(a.unprotected.length)return r;let s=chunkANZ44KQT_cjs.Of(i);for(let l of a.touches){let d=s.spanOf(l.control);d&&d.start<=r.start&&d.end>=r.end&&(e={partName:t.name,paragraphId:r.paragraphId,offset:r.start,controlId:l.control.id});}return r}}var zs=new WeakSet;function Gc(e){return zs.add(e),e}function Ws(e){return zs.has(e)}function qt(e){return {...e,applyPackage:t=>e.applyPackage(Gc(t))}}var Kc=new Set(["insertText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertDrawing","deleteText"]),Gs=new Set(["insertDrawing"]);function Xc(e){if(!(e===null||e.start!==e.end))return e}var St={"text-local":0,"paragraph-local":1,"flow-structural":2,global:3};function Yc(e){return Object.freeze({parts:new Map([[e.name,e]]),partBytes:new Map,relationships:new Map,externalTargets:[],contentTypes:{defaults:new Map,overrides:new Map([[e.name.toLowerCase(),e.contentType]])},mainDocumentPart:e.name})}var ct=class{current;storyPartName;rev=0;commitCounter=0;undoStack=[];redoStack=[];subscribers=new Set;historyLimit;settingsPartOverride;storyRef=null;composition=null;constructor(t,n,r={}){let o="root"in t,i=typeof n=="string"?n:void 0,a=typeof n=="object"&&n!==null?n:r;this.current=o?Yc(t):t,this.storyPartName=i??(o?t.name:t.mainDocumentPart),this.historyLimit=a.historyLimit??200,this.settingsPartOverride=a.settingsPart;}setStoryRef(t){this.storyRef=t;}get part(){let t=this.current.parts.get(this.storyPartName);if(!t)throw new Error(`story part missing: ${this.storyPartName}`);return t}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(t){this.current=t(this.current);}replacePart(t){let n=this.current.parts.get(t.name);t!==n&&(this.current=chunkANZ44KQT_cjs.ne(this.current,t),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(t){this.current=t.pkg,this.rev=t.revision,this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack),this.composition=t.composition?{entry:{...t.composition.entry},committed:t.composition.committed}:null;}restoreHistoryStacks(t){this.undoStack.length=0,this.undoStack.push(...t.undoStack),this.redoStack.length=0,this.redoStack.push(...t.redoStack);}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}transact(t,n={}){return chunkANZ44KQT_cjs.tb(n.actorId,()=>this.commitTransaction(t,n))}commitTransaction(t,n){let r=n.origin??chunkANZ44KQT_cjs.b.mutationHuman,o=n.recordsHistory??(r!==chunkANZ44KQT_cjs.b.projection&&r!==chunkANZ44KQT_cjs.b.awareness),i=this.undoStack[this.undoStack.length-1];o&&!this.composition&&i?.group!==n.historyGroup&&this.closeHistoryGroup();let a=this.current,s=this.rev,l=this.current,d=null,c=0,m=new Set,f=new Set,h=new Set,u=new Set,g=new Set,y=[],O=n.minimumImpact??"text-local",P=null,p=false,k=null,v=null,R=new Map,x=new Map,C=U=>{let B=x.get(U.name);B||(B={mint:null,written:new Set},x.set(U.name,B));let K=B;return {mint:()=>(K.mint??=chunkANZ44KQT_cjs.Sg(U))(),wrote:S=>{K.written.add(S);},wroteUnder:S=>K.written.has(S)}},I=()=>{for(let U of x.values())U.mint=null;},H=(U,B)=>{let K=chunkANZ44KQT_cjs.Ti.get(U.op);if(K===void 0)return R.clear(),null;let S=`${B.name}\0${K}`,b=R.get(S);b||(b={id:null},R.set(S,b));let M=b;return ()=>M.id??=C(B).mint()},D=(U,B)=>{let K=Kc.has(U.op);return !K&&chunkANZ44KQT_cjs.Ti.get(U.op)!==void 0?null:((!K||Gs.has(U.op))&&I(),K?C(B):null)},J=Vs(),V=null,T=(U,B)=>{if(d)return false;let K=l.parts.get(U);if(!K)return d={reason:"unknown-part",detail:U},false;B=J(K,this.settingsPartOverride?.()??chunkANZ44KQT_cjs.xg(l),B);let S=chunkANZ44KQT_cjs.qj(this.settingsPartOverride?.()??chunkANZ44KQT_cjs.xg(l),B)??chunkANZ44KQT_cjs.zj(K,this.settingsPartOverride?.()??chunkANZ44KQT_cjs.xg(l),B,V?.partName===U&&"paragraphId"in B&&V.paragraphId===B.paragraphId?V.fieldNodeId:void 0);if(S)return d={reason:S},false;let b=H(B,K),M=D(B,K),X=this.settingsPartOverride?.()??chunkANZ44KQT_cjs.xg(l),ee=chunkANZ44KQT_cjs.rj(X)&&"paragraphId"in B&&chunkANZ44KQT_cjs.tj(K,B.paragraphId)?chunkANZ44KQT_cjs.wi(K,B,V?.partName===U&&V.paragraphId===B.paragraphId?V.fieldNodeId:void 0):null;V=ee&&"paragraphId"in B?{partName:U,paragraphId:B.paragraphId,fieldNodeId:ee.fieldNodeId}:null;let se={deferValidation:true,...b?{revisionIds:b}:{},...M?{trackedRevisionIds:M}:{}},z=ee?chunkANZ44KQT_cjs.Ci(K,B,ee,se):chunkANZ44KQT_cjs.Yj(K,B,se);if(!z.ok)return d={reason:z.reason,...z.detail?{detail:z.detail}:{}},false;if(Gs.has(B.op)&&I(),l=chunkANZ44KQT_cjs.ne(l,z.part),z.part===K&&z.effect.dirty.length===0&&z.effect.created.length===0&&z.effect.deleted.length===0&&z.effect.split===void 0&&(z.effect.splits===void 0||z.effect.splits.length===0)&&z.effect.join===void 0&&z.effect.caret===void 0)return true;m.add(U),c+=1;for(let pe of z.effect.dirty)f.add(pe);for(let pe of z.effect.created)h.add(pe);for(let pe of z.effect.deleted)u.add(pe);for(let pe of z.effect.dependencyKeys)g.add(pe);z.effect.split&&y.push({split:z.effect.split});for(let pe of z.effect.splits??[])y.push({split:pe});return z.effect.join&&y.push({join:z.effect.join}),St[z.effect.impact]>St[O]&&(O=z.effect.impact),z.effect.caret&&(v={paragraphId:z.effect.caret.paragraphId,start:0,end:0}),true};if(t({apply:U=>T(this.storyPartName,U),applyTo:(U,B)=>T(U,B),applyPackage:U=>{if(d)return false;let B=this.settingsPartOverride?.()??chunkANZ44KQT_cjs.xg(l),K=Ws(U)?chunkANZ44KQT_cjs.pj(B,{op:"comment"}):chunkANZ44KQT_cjs.qj(B);if(K)return d={reason:K},false;R.clear(),I();let S=U(l);if(S===l)return true;for(let[b,M]of S.parts)l.parts.get(b)!==M&&m.add(b);return l=S,c+=1,St["flow-structural"]>St[O]&&(O="flow-structural"),true},selectionBefore:U=>{P=U;},selectionAfter:U=>{p=true,k=U;}}),d){let U=d;return {ok:false,reason:U.reason,...U.detail?{detail:U.detail}:{}}}if(c===0)return {ok:true,change:null};let L=p?k:v,te=p?Xc(k):v??void 0;for(let U of m){let B=a.parts.get(U),K=l.parts.get(U);if(K===void 0)continue;let S=B?chunkANZ44KQT_cjs.ya(B,K):chunkANZ44KQT_cjs.ya(K,K);if(!S.ok)return {ok:false,reason:"tree-invariant",detail:JSON.stringify(S.issues)}}let de=chunkANZ44KQT_cjs.ye(l);if(!de.ok)return {ok:false,reason:"package-invariant",detail:JSON.stringify(de.issues)};if(o)if(this.composition)chunkANZ44KQT_cjs.gk(n.historyGroup,"split","composition"),this.composition.committed=true,this.composition={...this.composition,entry:{...this.composition.entry,selectionAfter:L}};else {let U=n.historyGroup,B=this.undoStack[this.undoStack.length-1];U!==void 0&&B!==void 0&&B.group===U?this.undoStack[this.undoStack.length-1]={...B,selectionAfter:L??B.selectionAfter}:this.pushUndo({pkg:a,revision:s,selectionBefore:P,selectionAfter:L,group:U}),chunkANZ44KQT_cjs.gk(U,B?.group===U?"extended":"started"),this.redoStack.length=0;}return this.current=l,this.rev+=1,n.story&&(this.storyRef=n.story),n.minimumImpact&&St[n.minimumImpact]>St[O]&&(O=n.minimumImpact),{ok:true,change:this.publish(r,s,{dirty:f,created:h,deleted:u,dependencyKeys:g,splitJoin:y,impact:O,caret:te},n.story??this.storyRef??void 0,n.actorId,n.operationId)}}beginComposition(t=null){this.composition||(this.composition={entry:{pkg:this.current,revision:this.rev,selectionBefore:t,selectionAfter:null},committed:false});}endComposition(){let t=this.composition;this.composition=null,!(!t||!t.committed)&&(this.pushUndo(t.entry),this.redoStack.length=0);}cancelComposition(){this.composition=null;}closeHistoryGroup(){let t=this.undoStack[this.undoStack.length-1];t===void 0||t.group===void 0||(this.undoStack[this.undoStack.length-1]={...t,group:void 0});}undo(){let t=this.undoStack.pop();if(!t)return null;this.closeHistoryGroup();let n=this.rev;return this.redoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkANZ44KQT_cjs.b.mutationUndo,n,null,this.storyRef??void 0)}redo(){let t=this.redoStack.pop();if(!t)return null;this.closeHistoryGroup();let n=this.rev;return this.undoStack.push({pkg:this.current,revision:this.rev,selectionBefore:t.selectionBefore,selectionAfter:t.selectionAfter}),this.current=t.pkg,this.rev+=1,this.publish(chunkANZ44KQT_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(t){this.undoStack.push(t),this.undoStack.length>this.historyLimit&&this.undoStack.shift();}publish(t,n,r,o,i,a){this.commitCounter+=1;let s={change:"model-change",fromRevision:n,toRevision:this.rev,commitId:`commit-${this.commitCounter}`,origin:t,...i?{actorId:i}:{},...a?{operationId:a}:{},dirty:r?[...r.dirty]:[],created:r?[...r.created]:[],deleted:r?[...r.deleted]:[],splitJoin:r?r.splitJoin:[],dependencyKeys:r?[...r.dependencyKeys]:[],impact:r?r.impact:o?.kind==="headerFooter"?"global":"flow-structural",...r?.caret?{caret:r.caret}:{},...o?{story:o}:{}};for(let l of this.subscribers)l(s);return s}};function bo(e,t,n,r){if(!e)return null;if(e.kind==="package")return (r==="undo"?e.selectionBefore:e.selectionAfter)??null;let o=e.partName===t.part.name?t:n.get(e.partName);return (r==="undo"?o?.selectionForUndo():o?.selectionForRedo())??null}function Ks(e){let t=null,n;return {context:{selectionBefore(r){t=r,e.selectionBefore(r);},selectionAfter(r){n=r,e.selectionAfter(r);}},snapshot(r){return {selectionBefore:t,selectionAfter:n===void 0?r??null:n}}}}function So(e,t){return [...e.values()].map(n=>n.part).filter(n=>t.parts.has(n.name))}function Xs(e,t){return So(e,t).map(n=>n.name).sort().join(",")}function Ys(e,t,n){if(e.relationships!==t.relationships||e.contentTypes!==t.contentTypes||e.partBytes!==t.partBytes||e.externalTargets!==t.externalTargets||e.mainDocumentPart!==t.mainDocumentPart)return true;if(e.parts===t.parts)return false;if(e.parts.size!==t.parts.size)return true;for(let[r,o]of t.parts)if(r!==n&&e.parts.get(r)!==o)return true;return false}var Qn="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Jc="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";function Nt(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===Qn&&n.localName===t)return n;return null}function qn(e,t){return e.attributes.find(n=>n.namespaceUri===Qn&&n.localName===t)?.value}function qc(e){let t=qn(e,"val");return t===void 0||t==="1"||t==="true"||t==="on"}function qs(e,t){return e.kind==="textValue"?Object.freeze({...e,id:t()}):Object.freeze({...e,id:t(),children:e.children.map(n=>qs(n,t))})}function Qc(e){let t=chunkANZ44KQT_cjs.Aa(`<w:styles xmlns:w="${Qn}"><w:style w:type="paragraph" w:styleId="ListParagraph"><w:pPr><w:contextualSpacing/></w:pPr></w:style></w:styles>`,{name:e.name,contentType:Jc});if(!t.ok)return null;let n=Nt(t.part.root,"style"),r=n?Nt(n,"pPr"):null;return r?qs(r,chunkANZ44KQT_cjs.Ia(e)):null}var Js=["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 Zc(e,t){let n=Js.indexOf(t),r=0;return e.forEach((o,i)=>{if(o.kind==="textValue")return;let a=Js.indexOf(o.localName);a!==-1&&a<=n&&(r=i+1);}),r}function Qs(e,t){let n=chunkANZ44KQT_cjs.Oc(e);if(!n)return null;let r=null;for(let d of n.root.children)if(d.kind!=="textValue"&&d.namespaceUri===Qn&&d.localName==="style"&&qn(d,"type")==="paragraph"&&qn(d,"styleId")===t){r=d;break}if(!r)return null;let o=Nt(r,"name");if(o&&qn(o,"val")?.trim().toLowerCase()!=="list paragraph"&&t!=="ListParagraph")return null;let i=Qc(n);if(!i)return null;let a=Nt(i,"contextualSpacing");if(!a)return null;let s=Nt(r,"pPr"),l;if(s){let d=Nt(s,"contextualSpacing");if(d&&qc(d))return e;l=d?chunkANZ44KQT_cjs.Pa(n,d.id,a):chunkANZ44KQT_cjs.Oa(n,s.id,Zc(s.children,"contextualSpacing"),[a]);}else {let d=r.children.findIndex(c=>c.kind!=="textValue"&&["rPr","tblPr","tcPr","tblStylePr"].includes(c.localName));l=chunkANZ44KQT_cjs.Oa(n,r.id,d===-1?r.children.length:d,[i]);}return l.ok?Object.freeze({...e,parts:new Map([...e.parts,[n.name,l.part]])}):null}var nl="http://schemas.openxmlformats.org/package/2006/relationships",rl="application/vnd.openxmlformats-package.relationships+xml",nm="http://schemas.openxmlformats.org/package/2006/content-types",Zs="/[Content_Types].xml",mt="/word/numbering.xml",el="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",Qt="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",rm=`<Override PartName="${mt}" ContentType="${Qt}"/>`;function Zn(e){return `${e.ownerPart}\0${e.id}`}function ol(e,t,n){let r=new Set(t.externalTargets.filter(s=>s.type===chunkANZ44KQT_cjs.gd).map(Zn)),o=n.externalTargets.filter(s=>s.type===chunkANZ44KQT_cjs.gd&&!r.has(Zn(s)));if(o.length===0)return e;let i=new Set(e.map(Zn)),a=o.filter(s=>!i.has(Zn(s)));return a.length===0?e:Object.freeze([...e,...a])}function al(e,t,n){let r=e.filter(o=>o.ownerPart===n||t.has(o.ownerPart));return r.length===e.length?e:Object.freeze(r)}function il(e,t,n=[],r=false){if(e===t)return e;let o=om(e,t,r);return o=im(o,t,n),o}function sl(e,t){let n=new Set;for(let o of e.externalTargets)o.type===chunkANZ44KQT_cjs.gd&&o.ownerPart!==e.mainDocumentPart&&(e.parts.has(o.ownerPart)||t.has(o.ownerPart)||n.add(o.ownerPart));for(let o of e.parts.keys()){let i=cm(o);!i||i===e.mainDocumentPart||e.parts.has(i)||t.has(i)||e.externalTargets.some(a=>a.ownerPart===i)||n.add(i);}if(n.size===0)return e;let r=e;for(let o of n)r=mm(r,o);return r}function om(e,t,n){let r=t.parts.get(mt);if(!r)return e;let o=e.parts.get(mt),i=n&&o?am(o,r):r,a=chunkANZ44KQT_cjs.ne(e,i),s=(t.relationships.get(t.mainDocumentPart)??[]).find(d=>d.type===el),l=a.relationships.get(a.mainDocumentPart)??[];if(s&&!l.some(d=>d.type===el)&&!l.some(d=>d.id===s.id)){let d=lm(a,{...s,ownerPart:a.mainDocumentPart});d&&(a=d);}if(a.contentTypes.overrides.get(chunkANZ44KQT_cjs.u(mt))!==Qt){let d=um(a);d&&(a=d);}return a}function am(e,t){let n="http://schemas.openxmlformats.org/wordprocessingml/2006/main",r=l=>{if(l.kind==="textValue"||l.namespaceUri!==n)return null;let d=l.localName==="abstractNum"?"abstractNumId":l.localName==="num"?"numId":l.localName==="numPicBullet"?"numPicBulletId":null;if(!d)return null;let c=l.attributes.find(m=>m.namespaceUri===n&&m.localName===d)?.value;return c===void 0?null:`${l.localName}:${c}`},o=new Set(e.root.children.map(r).filter(Boolean)),i=chunkANZ44KQT_cjs.Ia(e),a=["numPicBullet","abstractNum","num","numIdMacAtCleanup"],s=e;for(let l of t.root.children){let d=r(l);if(!d||o.has(d)||l.kind==="textValue")continue;let c=a.indexOf(l.localName),m=s.root.children.findIndex(h=>h.kind!=="textValue"&&h.namespaceUri===n&&a.indexOf(h.localName)>c),f=chunkANZ44KQT_cjs.Oa(s,s.root.id,m<0?s.root.children.length:m,[No(l,i)]);f.ok&&(s=f.part,o.add(d));}return s}function im(e,t,n){let r=n.filter(i=>i.type===chunkANZ44KQT_cjs.gd);if(r.length===0)return e;let o=e;for(let i of r){let a=sm(e,t,i.ownerPart);if(!a||o.externalTargets.some(d=>d.ownerPart===a&&d.id===i.id)||new Set((o.relationships.get(a)??[]).map(d=>d.id)).has(i.id))continue;let l=dm(o,{ownerPart:a,id:i.id,type:chunkANZ44KQT_cjs.gd,rawTarget:i.rawTarget,sinkSafe:i.sinkSafe},a);l&&(o=l);}return o}function sm(e,t,n){return n===t.mainDocumentPart?e.mainDocumentPart:typeof n!="string"||n.length===0?null:n}function lm(e,t){let n=e.mainDocumentPart,r=wo(n),o=e.parts.get(r),i=chunkANZ44KQT_cjs.Aa(`<Relationships xmlns="${nl}"><Relationship Id="${chunkANZ44KQT_cjs.P(t.id,"relationship id")}" Type="${chunkANZ44KQT_cjs.P(t.type,"relationship type")}" Target="${chunkANZ44KQT_cjs.P(t.rawTarget,"relationship target")}"/></Relationships>`,{name:r,contentType:rl});if(!i.ok)return null;let a=e.relationships.get(n)??[];if(a.some(d=>d.id===t.id))return null;let s={...t,ownerPart:n,order:a.reduce((d,c)=>Math.max(d,c.order),-1)+1},l=new Map([...e.relationships,[n,[...a,s]]]);return o?ll(e,o,i.part.root.children[0],l):Object.freeze({...e,parts:new Map([...e.parts,[r,i.part]]),relationships:l})}function dm(e,t,n=e.mainDocumentPart){let r=n;if(typeof r!="string"||r.length===0)return null;let o=wo(r),i=e.parts.get(o),a=chunkANZ44KQT_cjs.Aa(`<Relationships xmlns="${nl}"><Relationship Id="${chunkANZ44KQT_cjs.P(t.id,"relationship id")}" Type="${chunkANZ44KQT_cjs.gd}" Target="${chunkANZ44KQT_cjs.P(t.rawTarget,"relationship target")}" TargetMode="External"/></Relationships>`,{name:o,contentType:rl});if(!a.ok)return null;let s=[...e.externalTargets,t];if(!i)return Object.freeze({...e,parts:new Map([...e.parts,[o,a.part]]),externalTargets:s});let l=ll(e,i,a.part.root.children[0],e.relationships);return l?Object.freeze({...l,externalTargets:s}):null}function ll(e,t,n,r){if(!n)return null;let o=chunkANZ44KQT_cjs.Ia(t),i=chunkANZ44KQT_cjs.Oa(t,t.root.id,t.root.children.length,[No(n,o)]);return i.ok?Object.freeze({...e,parts:new Map([...e.parts,[t.name,i.part]]),relationships:r}):null}function No(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>No(n,t))}}function wo(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function cm(e){let t=/^(.*)\/_rels\/([^/]+)\.rels$/.exec(e);if(!t)return null;let n=t[1],r=t[2];return n===""||r===""?null:`${n}/${r}`}function mm(e,t){let n=wo(t),r=new Map(e.parts);r.delete(n);let o=new Map(e.partBytes);o.delete(n);let i=new Map(e.relationships);i.delete(t);let a=Object.freeze(e.externalTargets.filter(s=>s.ownerPart!==t));return Object.freeze({...e,parts:r,partBytes:o,relationships:i,externalTargets:a})}function um(e){let t=e.contentTypes.overrides.get(chunkANZ44KQT_cjs.u(mt));if(t===Qt)return e;if(t!==void 0)return null;let n=e.partBytes.get(Zs);if(!n)return null;let r=fflate.strFromU8(n),o=tl(r);if(!o)return null;let i=r.lastIndexOf(`</${o.rootName}>`);if(i===-1)return null;let a=r.slice(0,i)+rm+r.slice(i),s=tl(a);if(!s||s.rootName!==o.rootName)return null;let l=[...o.children,dl("Override",{PartName:mt,ContentType:Qt})];return s.children.length!==l.length||s.children.some((d,c)=>d!==l[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[Zs,fflate.strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[chunkANZ44KQT_cjs.u(mt),Qt]])})})}function tl(e){let t=chunkANZ44KQT_cjs.X(e);if(!t.ok)return null;let n=t.nodes.filter(s=>s.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),i=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[i?`xmlns:${i}`:"xmlns"]!==nm)return null;let a=[];for(let s of r.children)s.type==="element"&&a.push(dl(s.name,s.attributes));return {rootName:r.name,children:a}}function dl(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}var cl=4e3,ml=64;function ul(e){return chunkANZ44KQT_cjs.Ig(e,"footnote")!==null||chunkANZ44KQT_cjs.Ig(e,"endnote")!==null}function pl(e,t,n,r){if(!ul(e))return false;if(r.has(n.paragraphId))return true;r.add(n.paragraphId);let o=chunkANZ44KQT_cjs.Ka(t,n.paragraphId);return !o||o.kind!=="paragraph"?true:chunkANZ44KQT_cjs.Mf(o).some(i=>i.node.kind==="noteReference"&&i.start<n.end&&i.end>n.start)}function fl(e,t,n,r){if(!ul(e))return false;if(r.has(n.blockId))return true;r.add(n.blockId);let o=chunkANZ44KQT_cjs.Ka(t,n.blockId);if(!o||o.kind==="textValue")return true;let i=0,a=(s,l)=>{if(i>=cl||l>ml)return true;if(i+=1,s.kind==="textValue")return false;if(s.kind==="paragraph")return chunkANZ44KQT_cjs.Mf(s).some(d=>d.node.kind==="noteReference");for(let d of s.children)if(a(d,l+1))return true;return false};return a(o,0)}function gl(e,t,n){if(n.count>=cl||t>ml)return true;if(n.count+=1,e.kind==="textValue")return false;if(e.kind==="commentRangeStart"||e.kind==="commentRangeEnd"||e.kind==="commentReference")return true;for(let r of e.children)if(gl(r,t+1,n))return true;return false}function hl(e,t,n,r){if(!chunkANZ44KQT_cjs.Hh(e))return false;let o=n.op==="deleteText"?n.paragraphId:n.blockId;if(r.has(o))return true;r.add(o);let i=chunkANZ44KQT_cjs.Ka(t,o);return !i||i.kind==="textValue"?true:gl(i,0,{count:0})}var Eo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",To="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";function yl(e,t){let r=(e.relationships.get(e.mainDocumentPart)??[]).find(o=>o.id===t);return r?r.type!==Eo&&r.type!==To?{ok:false,reason:"wrong-relationship-type",detail:r.type}:pm(e,r):{ok:false,reason:"dangling-relationship",detail:t}}function pm(e,t){let n=chunkANZ44KQT_cjs.E(t);if(n.mode==="External")return {ok:false,reason:"external-relationship",detail:t.id};if(!n.target.ok)return {ok:false,reason:"bad-relationship-target",detail:n.target.reason};let r=e.parts.get(n.target.partName);if(!r)return {ok:false,reason:"missing-part",detail:n.target.partName};let o=r.root.localName;return o!=="hdr"&&o!=="ftr"?{ok:false,reason:"not-a-story-part",detail:o||r.name}:{ok:true,partName:r.name,part:r}}function ut(e,t){return t.compositionActive||e.compositionSessionOpen()?{ok:false,reason:"invalidArgs",detail:"ime-composition-active"}:null}function xl(e,t){let n=chunkANZ44KQT_cjs.Ka(e,t);return !n||n.kind!=="drawing"?null:n.children.find(o=>o.kind==="inlineDrawing"||o.kind==="anchoredDrawing")??null}function kl(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=chunkANZ44KQT_cjs.Ka(r,n);return !o||o.kind!=="drawing"?null:chunkANZ44KQT_cjs.wd(o,{ownerPartName:t,supportedMcRequires:chunkANZ44KQT_cjs.pd,limits:chunkANZ44KQT_cjs.od,resolveRelationship:chunkANZ44KQT_cjs.rd(e,t)})}function Pl(e,t,n){let r=chunkANZ44KQT_cjs.F(e.relationships.get(t)??[],t,n);return r.mode==="internal"?r.partName:null}function wt(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=ut(e,o.store);if(i)return i;let{store:a,story:s}=o;return chunkANZ44KQT_cjs.Fa(e,()=>fm(e,a,s,n,r),l=>chunkANZ44KQT_cjs.Ga(l))}function fm(e,t,n,r,o){let i=n.partName,a=e.currentPackage(),s=t.checkpoint();t.graftPackage(()=>e.currentPackage());let l=null,d=false,c=false,m=t.transact(u=>{if(o?.commitGuard?.()===false){c=true;return}if(o?.expectedPackageRevision!==void 0&&e.packageRevision!==o.expectedPackageRevision){d=true;return}let g=r(u,i);if(g===null){u.apply({op:"insertText",paragraphId:"\0task12-abort",offset:0,text:"x"});return}l=g;},{story:n,...o?.actorId?{actorId:o.actorId}:{},...n.kind==="headerFooter"||n.kind==="notesPart"?{minimumImpact:"global"}:{}});if(c)return {ok:false,reason:"invalidArgs",detail:"stale drawing selection"};if(d)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 f=m.change.created.find(u=>{let g=t.part;return chunkANZ44KQT_cjs.Ka(g,u)?.kind==="drawing"});return f&&(l=f),{ok:true,change:e.promoteStoryTransactionToPackageUnit(a,t,s),...l?{drawingNodeId:l}:{}}}function Rl(e,t,n){let r=e.parts.get(t);if(!r)return null;let o=xl(r,n);return o?chunkANZ44KQT_cjs.Pj(o):null}function Co(e,t,n,r){let o=false;return e.applyPackage(i=>{let a=i.parts.get(t);if(!a)return i;let s=chunkANZ44KQT_cjs.Ka(a,n);if(!s||s.kind!=="drawing")return i;let l=xl(a,n);if(!l)return i;let d=chunkANZ44KQT_cjs.Qj(l,r),c=gm(s,d),m=chunkANZ44KQT_cjs.Pa(a,s.id,c,{deferValidation:true});return m.ok?(o=true,chunkANZ44KQT_cjs.ne(i,m.part)):i}),o}function gm(e,t){return {...e,children:e.children.map(n=>n.id===t.id?t:n)}}async function Ol(e,t,n){let r=chunkANZ44KQT_cjs.fe(n.widthPoints),o=chunkANZ44KQT_cjs.fe(n.heightPoints);if(r===null||o===null)return {ok:false,reason:"invalidArgs",detail:"invalid-dimensions"};let i=e.resolveStory(t);if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{}};let a=ut(e,i.store);if(a)return a;let s=i.story.partName,l=await chunkANZ44KQT_cjs.ae(n.decodePort,n.bytes,n.mime);if(!l.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let d=l.bytes,c=chunkANZ44KQT_cjs.ce(e.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 m=c.partName,f=wt(e,t,(h,u)=>{let g=e.currentPackage(),y=chunkANZ44KQT_cjs.ce(g,u,{bytes:d,mime:n.mime});if(!y.ok)return null;g=y.pkg,m=y.partName;let O;if(n.hyperlink){let p=chunkANZ44KQT_cjs.lg(g,n.hyperlink,u);if(!p)return null;g=p.pkg,O=p.relationshipId;}if(!h.applyPackage(()=>g))return null;let P=chunkANZ44KQT_cjs.ge({docPrId:y.docPrId,relationshipId:y.relationshipId,extentEmu:{cx:r,cy:o},...n.title!==void 0?{title:n.title}:{},...n.description!==void 0?{description:n.description}:{},...O?{hyperlinkRelationshipId:O}:{}});return h.apply({op:"insertDrawing",paragraphId:n.paragraphId,offset:n.offset,drawing:P,...n.revision?{revision:n.revision}:{}})?P.id:null},{expectedPackageRevision:n.expectedPackageRevision,...n.commitGuard?{commitGuard:n.commitGuard}:{},...n.actorId?{actorId:n.actorId}:{}});return f.ok?f.change?{...f,mediaPartName:m}:{ok:true,change:null,mediaPartName:m}:f}async function Mo(e,t,n,r,o,i,a){let s=e.resolveStory(t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};let l=ut(e,s.store);if(l)return l;let d=s.story.partName,c=await chunkANZ44KQT_cjs.ae(i,r,o);if(!c.ok)return {ok:false,reason:"invalidArgs",detail:"invalid-image"};let m=c.bytes,f=chunkANZ44KQT_cjs.ce(e.currentPackage(),d,{bytes:m,mime:o});return f.ok?wt(e,t,(h,u)=>{let g=e.currentPackage(),y=kl(g,d,n),O=y?.picture?.embeddedRelationshipId??null,P=y?.picture?.linkedRelationshipId??null,p=O??P;if(!p)return null;let k=O!==null?Pl(g,d,O):null,v=g,R=chunkANZ44KQT_cjs.ce(v,u,{bytes:m,mime:o});return !R.ok||(v=R.pkg,!h.applyPackage(()=>v))||!h.apply({op:"replaceDrawingResource",drawingNodeId:n,relationshipId:R.relationshipId})?null:(h.applyPackage(x=>chunkANZ44KQT_cjs.ie(x,u,k,p)),n)},{expectedPackageRevision:a.expectedPackageRevision,...a.commitGuard?{commitGuard:a.commitGuard}:{},...a.actorId?{actorId:a.actorId}:{}}):{ok:false,reason:"invalidArgs",detail:f.reason==="invalid-image"?"invalid-image":f.reason}}function vl(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=ut(e,r.store);if(o)return o;let i=r.story.partName,a=e.currentPackage(),s=a.parts.get(i),l=kl(a,i,n)??(s?chunkANZ44KQT_cjs.Gj(s,n):null);if(!l)return {ok:false,reason:"unknown-drawing"};let d=l.picture?.embeddedRelationshipId??null,c=l.picture?.linkedRelationshipId??null,m=d??c,f=d!==null?Pl(a,i,d):null;return wt(e,t,(h,u)=>h.apply({op:"deleteDrawing",drawingNodeId:n})?(h.applyPackage(g=>chunkANZ44KQT_cjs.ie(g,u,f,m)),n):null)}function hm(e,t){let n=null,r=i=>{let a=false,s=false,l=(d,c)=>{if(a||d.kind==="textValue")return;if(d.id===t){a=true,s=c;return}let m=c||d.kind==="revisionDelete"||d.kind==="revisionMoveFrom";for(let f of d.children)l(f,m);};return l(i,false),s},o=i=>{if(!(n!==null||i.kind==="textValue")){if(i.kind==="paragraph"){let a=chunkANZ44KQT_cjs.Of(i).spanOf(t);if(a!==null&&a.end>a.start){let s=chunkANZ44KQT_cjs.Ka(e,t);if(!s||s.kind!=="drawing"&&!chunkANZ44KQT_cjs.sd(s))return;n={paragraphId:i.id,start:a.start,end:a.end,alreadyDeleted:r(i)};}return}for(let a of i.children)o(a);}};return o(e.root),n}function Il(e,t,n,r){let o=e.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let i=ut(e,o.store);if(i)return i;let a=e.currentPackage().parts.get(o.story.partName);if(!a)return {ok:false,reason:"unknown-drawing"};let s=hm(a,n);return s?s.alreadyDeleted?{ok:true,change:null}:wt(e,t,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 bl(e,t,n,r,o,i,a,s){let l=await chunkANZ44KQT_cjs.je(o,r,i,void 0,a);return l.ok?Mo(e,t,n,l.bytes,l.mime,a,{expectedPackageRevision:e.packageRevision,...s?{actorId:s}:{}}):{ok:false,reason:"invalidArgs",detail:`${l.reason}${l.detail?`:${l.detail}`:""}`}}function Sl(e,t,n,r,o,i){let a=e.resolveStory(t);if(!a.ok)return {ok:false,reason:a.reason,...a.detail?{detail:a.detail}:{}};let s=ut(e,a.store);return s||wt(e,t,(l,d)=>{let c=Rl(e.currentPackage(),d,n),m=null;if(i!==null){let h=chunkANZ44KQT_cjs.lg(e.currentPackage(),i,d);if(!h||!l.applyPackage(()=>h.pkg))return null;m=h.relationshipId;}if(!l.apply({op:"setDrawingMetadata",drawingNodeId:n,title:r,description:o,...i===null?{hyperlink:null}:{}}))return null;if(i!==null&&m!==null){if(!Co(l,d,n,m))return null}else if(i===null&&!Co(l,d,n,null))return null;let f=false;return l.applyPackage(h=>{let u=chunkANZ44KQT_cjs.ng(h,d,c);return u===null?(f=true,h):u}),f?null:n})}function Nl(e,t,n){let r=e.resolveStory(t);if(!r.ok)return {ok:false,reason:r.reason,...r.detail?{detail:r.detail}:{}};let o=ut(e,r.store);return o||wt(e,t,(i,a)=>{let s=Rl(e.currentPackage(),a,n.drawingNodeId),l=null;if(n.hyperlink!==null){let c=chunkANZ44KQT_cjs.lg(e.currentPackage(),n.hyperlink,a);if(!c||!i.applyPackage(()=>c.pkg))return null;l=c.relationshipId;}for(let c of n.ops)if(!i.apply(c))return null;if(!Co(i,a,n.drawingNodeId,n.hyperlink===null?null:l))return null;let d=false;return i.applyPackage(c=>{let m=chunkANZ44KQT_cjs.ng(c,a,s);return m===null?(d=true,c):m}),d?null:n.drawingNodeId})}function ym(e,t){if(e===t)return true;if(e.byteLength!==t.byteLength)return false;for(let n=0;n<e.byteLength;n+=1)if(e[n]!==t[n])return false;return true}function wl(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e)if(t.get(n)!==r)return false;return true}function xm(e,t){return e===t||e.ownerPart===t.ownerPart&&e.id===t.id&&e.type===t.type&&e.rawTarget===t.rawTarget&&e.targetMode===t.targetMode&&e.order===t.order}function km(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||o.length!==r.length||o!==r&&r.some((i,a)=>!xm(i,o[a])))return false}return true}function Pm(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return n===o||n.ownerPart===o.ownerPart&&n.id===o.id&&n.type===o.type&&n.rawTarget===o.rawTarget&&n.sinkSafe===o.sinkSafe})}function Rm(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e){let o=t.get(n);if(!o||!ym(r,o))return false}return true}function Om(e,t){return e.contentTypes===t.contentTypes||wl(e.contentTypes.defaults,t.contentTypes.defaults)&&wl(e.contentTypes.overrides,t.contentTypes.overrides)}var er=Object.freeze({equal:true,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"}),tr=Object.freeze({equal:false,dirty:Object.freeze([]),dependencyKeys:Object.freeze([]),impact:"global"});function El(e){for(let[t,n]of e)if(!chunkANZ44KQT_cjs.va(t,n))return tr;return er}function vm(e,t){if(e===t)return er;if(e.mainDocumentPart!==t.mainDocumentPart||e.parts.size!==t.parts.size||!Rm(e.partBytes,t.partBytes)||!km(e.relationships,t.relationships)||!Pm(e.externalTargets,t.externalTargets)||!Om(e,t))return tr;let n=[];for(let[a,s]of e.parts){let l=t.parts.get(a);if(!l)return tr;s!==l&&n.push([s,l]);}if(n.length===0)return er;let[r,o]=n[0];if(n.length>1||r.name!==e.mainDocumentPart)return El(n);let i=chunkANZ44KQT_cjs.wa(o.root,r.root);return i.undecided?El(n):i.equal?er:!i.idsPreserved||i.reach==="outside-paragraph"||i.paragraphIds.length===0?tr:{equal:false,dirty:i.paragraphIds,dependencyKeys:[chunkANZ44KQT_cjs.g.story],impact:i.reach==="paragraph-text"?"text-local":"flow-structural"}}function Ao(e){return {ok:false,reason:"package-invariant",detail:e}}function Im(e,t){if(!e.parts.get(e.mainDocumentPart))return Ao("no-main-document");for(let[r,o]of e.parts){let i=t?.parts.get(r);if(i===o)continue;let a=i?chunkANZ44KQT_cjs.ya(i,o):chunkANZ44KQT_cjs.xa(o);if(!a.ok)return Ao(`invalid-part:${r}:${a.issues[0]?.code??"invalid"}`)}let n=chunkANZ44KQT_cjs.ye(e);return n.ok?null:Ao(n.issues[0]?.code??"package-invariant")}function Tl(e,t,n){let r=e.currentPackage(),o=vm(t,r);if(o.equal)return {ok:true,change:null};let i=Im(t,r);if(i)return i;let a=e.bodyStore().part.name,s=o.impact!=="global"&&t.mainDocumentPart===a;return chunkANZ44KQT_cjs.Fa(e,()=>{let l=e.packageRevision;return e.installAuthoritativePackageSnapshot(t),{ok:true,change:e.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?o.dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:s?o.dependencyKeys:[],impact:s?o.impact:"global",story:{kind:"body",partName:a}})}},()=>false)}function Al(e,t,n,r){let o=[...t],i=new Set;for(let a of o)e.parts.has(a)&&i.add(a);for(let a of n)Cl(a,o,i);for(let a of r)Cl(a,o,i);return i}function Dl(e,t,n,r,o){let i=new Set(e);i.add(t),i.add(n);for(let a of r)Ml(a,i);for(let a of o)Ml(a,i);return i}function Cl(e,t,n){if(e.kind==="story"){n.add(e.partName);return}for(let r of t)(e.before.parts.has(r)||e.after.parts.has(r))&&n.add(r);}function Ml(e,t){if(e.kind==="story"){t.add(e.partName);return}for(let n of e.before.parts.keys())t.add(n);for(let n of e.after.parts.keys())t.add(n);}var _l=new Set(["acceptRevision","rejectRevision","acceptAllRevisions","rejectAllRevisions"]),Fl=new Set(["authorTable","deleteTableRow","deleteTableColumn","removeContentControl","removeRepeatingSectionItem"]),Ll=64,Zt=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(t,n,r={}){this.pkg=chunkANZ44KQT_cjs.ne(t,n),this.historyLimit=r.historyLimit??200,this.maxEditableStoryParts=r.maxEditableStoryParts??Ll,this.cascadeNoteReferences=r.cascadeDeletedNoteReferences??chunkANZ44KQT_cjs.yh,this.body=new ct(this.pkg,n.name,{historyLimit:this.historyLimit,settingsPart:()=>chunkANZ44KQT_cjs.xg(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 t=this.currentPackageMemo;if(t&&t.pkg===this.pkg&&t.bodyPart===this.body.part){let o=0,i=true;for(let a of this.stories.values()){if(t.storyParts[o]!==a.part){i=false;break}o+=1;}if(i&&o===t.storyParts.length)return t.result}let n=chunkANZ44KQT_cjs.ne(this.pkg,this.body.part),r=[];for(let o of this.stories.values())r.push(o.part),this.pkg.parts.has(o.part.name)&&(n=chunkANZ44KQT_cjs.ne(n,o.part));return this.currentPackageMemo={pkg:this.pkg,bodyPart:this.body.part,storyParts:r,result:n},n}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}resolveStory(t){return t.kind==="body"?{ok:true,story:{kind:"body",partName:this.body.part.name},store:this.body}:t.kind==="notesPart"?t.noteKind!=="footnote"&&t.noteKind!=="endnote"?{ok:false,reason:"unknown-scope",detail:String(t.noteKind)}:this.openNotesPartStore(t.noteKind):t.kind!=="headerFooter"||typeof t.rId!="string"||t.rId.length===0?{ok:false,reason:"unknown-scope",detail:String(t.kind)}:this.openHeaderFooterStore(t.rId)}partFor(t){let n=this.resolveStory(t);return n.ok?n.store.part:null}revisionFor(t){let n=this.resolveStory(t);return n.ok?n.store.revision:null}transact(t,n,r={}){return chunkANZ44KQT_cjs.Fa(this,()=>this.commitStoryTransaction(t,n,r),chunkANZ44KQT_cjs.Ga,r.historyGroup)}commitStoryTransaction(t,n,r={}){let o=this.resolveStory(t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let{store:i,story:a}=o,s=this.currentPackage(),l=i.historyDepth,d=i.compositionActive,c=i.checkpoint(),m=false,f=new Set,h=false,u=new Set,g=false,y,O=false,P;i.graftPackage(()=>this.currentPackage());let p=i.transact(R=>{P=Ks(R),n({...R,applyTo:(x,C)=>{let I=R.applyTo(x,C);return I&&x!==a.partName&&(O=true),I},applyPackage:x=>R.applyPackage(C=>{let I=x(C);return I!==C&&!O&&(O=Ys(C,I,a.partName)),I}),apply:x=>(x.op==="setListNumbering"&&x.numId!==null&&(g=true),x.op==="setParagraphProperties"&&(y??=x.properties.find(C=>C.localName==="pStyle")?.attributes?.val),m||(x.op==="deleteText"&&pl(this.pkg,i.part,x,f)||x.op==="deleteBlock"&&fl(this.pkg,i.part,x,f)||_l.has(x.op)||Fl.has(x.op))&&(m=true),h||(x.op==="deleteText"||x.op==="deleteBlock"?h=hl(this.pkg,i.part,x,u):(_l.has(x.op)||Fl.has(x.op))&&(h=true)),R.apply(x)),...P.context});},{...r,story:a,...a.kind==="headerFooter"||a.kind==="notesPart"?{minimumImpact:"global"}:{}});if(!p.ok)return {ok:false,reason:p.reason,...p.detail?{detail:p.detail}:{}};this.syncPackageFromStore(i);let k=false;if(p.change&&O&&(this.installPackageSnapshotInternal(i.package,false),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),k=true),g&&y){let R=Qs(this.pkg,y);R&&this.replacePackageShell(R);}let v=false;if(p.change&&m){let R=this.currentPackage(),x=this.cascadeNoteReferences(s,R);if(x===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"note-cascade-failed"};x!==R&&(this.installPackageSnapshotInternal(x),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),v=true);}if(p.change&&h){let R=this.currentPackage(),x=chunkANZ44KQT_cjs.Lh(s,R,{storyPartName:a.partName});if(x===null)return i.restoreCheckpoint(c),this.installPackageSnapshotInternal(s),{ok:false,reason:"invalidArgs",detail:"comment-cascade-failed"};x!==R&&(this.installPackageSnapshotInternal(x),d?this.compositionSession&&(this.compositionSession.packageWideEffects=true):i.restoreHistoryStacks(c),v=true);}if(p.change){this.packageRev+=1;let R=v||k;R&&chunkANZ44KQT_cjs.gk(r.historyGroup,"split","package-unit"),!d&&r.recordsHistory!==false&&(i.historyDepth>l||R)&&(R?this.pushUndoPointer({kind:"package",before:s,after:this.currentPackage(),...P?.snapshot(p.change.caret)}):this.pushUndoPointer({kind:"story",partName:a.partName,story:a}));let x=R?this.publishSynthetic(p.change.origin,"global",a,p.change.created):p.change;return R||this.publish(x),{ok:true,change:x}}return {ok:true,change:p.change}}compositionSessionOpen(){return this.compositionSession!==null}beginComposition(t,n=null){let r=this.resolveStory(t);return !r.ok||this.compositionSession&&this.compositionSession.partName!==r.story.partName&&(this.endComposition(),r=this.resolveStory(t),!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 t=this.compositionSession;if(this.compositionSession=null,!t){this.body.endComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return;let r=n.historyDepth;if(n.endComposition(),t.packageWideEffects){n.restoreHistoryStacks(t.storyCheckpoint),this.syncPackageFromStore(n),this.pushUndoPointer({kind:"package",before:t.beforePackage,after:this.currentPackage()});return}if(n.historyDepth>r){let o=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);o&&this.pushUndoPointer({kind:"story",partName:t.partName,story:o});}this.syncPackageFromStore(n);}cancelComposition(){let t=this.compositionSession;if(this.compositionSession=null,!t){this.body.cancelComposition();return}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(t.packageWideEffects){n&&n.restoreCheckpoint(t.storyCheckpoint),this.installPackageSnapshotInternal(t.beforePackage),this.packageRev+=1;let r=t.partName===this.body.part.name?{kind:"body",partName:t.partName}:this.storyRefForPart(t.partName);this.publishSynthetic(chunkANZ44KQT_cjs.b.mutationHuman,"global",r??{kind:"body",partName:this.body.part.name},[]);return}n?.cancelComposition();}applyLifecycleOp(t){return chunkANZ44KQT_cjs.Fa(this,()=>this.commitLifecycleOp(t),chunkANZ44KQT_cjs.Ga)}commitLifecycleOp(t){let n=this.currentPackage(),r=chunkANZ44KQT_cjs.pj(chunkANZ44KQT_cjs.xg(n),t);if(r)return {ok:false,reason:r};if(chunkANZ44KQT_cjs.wh(t)){let s=chunkANZ44KQT_cjs.xh(n,t);if(!s.ok)return {ok:false,reason:s.reason,...s.detail?{detail:s.detail}:{}};if(s.package===n)return {ok:true,change:null};this.installPackageSnapshotInternal(s.package),this.pushUndoPointer({kind:"package",before:n,after:s.package}),this.packageRev+=1;let l={kind:"body",partName:this.body.part.name},d=this.publishSynthetic(chunkANZ44KQT_cjs.b.mutationHuman,s.impact,l,s.createdPartName?[s.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:d}}if(!chunkANZ44KQT_cjs.qg(t))return {ok:false,reason:"invalidArgs",detail:"not-lifecycle-op"};let o=chunkANZ44KQT_cjs.rg(n,t);if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};this.installPackageSnapshotInternal(o.package),this.pushUndoPointer({kind:"package",before:n,after:o.package}),this.packageRev+=1;let i={kind:"body",partName:this.body.part.name},a=this.publishSynthetic(chunkANZ44KQT_cjs.b.mutationHuman,o.impact,i,o.createdPartName?[o.createdPartName]:[]);return this.evictUnreachableStories(),{ok:true,change:a}}undo(){let t=this.undoOrder.pop();if(!t)return null;if(chunkANZ44KQT_cjs.ek(this.body,this.stories,null),t.kind==="package"){this.installPackageSnapshotInternal(t.before,true,t.restoreNumbering),this.redoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunkANZ44KQT_cjs.b.mutationUndo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.undo();return r?(this.redoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}redo(){let t=this.redoOrder.pop();if(!t)return null;if(chunkANZ44KQT_cjs.ek(this.body,this.stories,null),t.kind==="package"){this.installPackageSnapshotInternal(t.after,true,t.restoreNumbering),this.undoOrder.push(t),this.packageRev+=1;let o=this.publishSynthetic(chunkANZ44KQT_cjs.b.mutationRedo,"global",{kind:"body",partName:this.body.part.name},[]);return this.evictUnreachableStories(),o}let n=t.partName===this.body.part.name?this.body:this.stories.get(t.partName);if(!n)return null;let r=n.redo();return r?(this.undoOrder.push(t),this.syncPackageFromStore(n),this.packageRev+=1,this.publish(r),this.evictUnreachableStories(),r):null}selectionForUndo(){return bo(this.undoOrder.at(-1),this.body,this.stories,"undo")}selectionForRedo(){return bo(this.redoOrder.at(-1),this.body,this.stories,"redo")}openStoryParts(){return So(this.stories,this.pkg)}openedStoryCount(){return 1+this.stories.size}openStoryToken(){return Xs(this.stories,this.pkg)}insertImage(t,n){return Ol(this,t,n)}applyFragmentPaste(t,n){return Io(this,t,n)}replaceImage(t,n,r,o,i,a){return Mo(this,t,n,r,o,i,a)}deleteImage(t,n){return vl(this,t,n)}deleteImageTracked(t,n,r){return Il(this,t,n,r)}embedExternalImage(t,n,r,o,i,a,s){return bl(this,t,n,r,o,i,a,s)}setDrawingMetadataWithHyperlink(t,n,r,o,i){return Sl(this,t,n,r,o,i)}applyImageProperties(t,n){return Nl(this,t,n)}promoteStoryTransactionToPackageUnit(t,n,r,o){this.installPackageSnapshotInternal(n.package,false),n.restoreHistoryStacks(r),this.pushUndoPointer({kind:"package",before:t,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(chunkANZ44KQT_cjs.b.mutationHuman,i?.kind==="headerFooter"?"global":"flow-structural",i??{kind:"body",partName:this.body.part.name},[])}publishStoryWrite(t){return t?(this.packageRev+=1,this.publish(t),t):null}adoptPackageUnit(t){let n=this.currentPackage();t!==n&&this.pushUndoPointer({kind:"package",before:t,after:n});}installPackageSnapshot(t){this.installPackageSnapshotInternal(t);}installAuthoritativePackageSnapshot(t){this.installPackageSnapshotInternal(t,false);}publishRemotePackage(t,n){return Tl(this,t,n)}replacePackageShell(t){this.shellHyperlinks=ol(this.shellHyperlinks,this.pkg,t);let n=t;n=chunkANZ44KQT_cjs.ne(n,this.body.part);for(let r of this.stories.values())t.parts.has(r.part.name)&&(n=chunkANZ44KQT_cjs.ne(n,r.part));this.pkg=n;}installPackageSnapshotInternal(t,n=true,r=false){let o=n?il(t,this.pkg,this.shellHyperlinks,r):t,i=o.parts.get(o.mainDocumentPart);if(!i)return;this.body.replacePart(i);for(let[s,l]of this.stories){let d=o.parts.get(s);d&&l.replacePart(d);}this.rIdToPartName.clear();let a=o.relationships.get(o.mainDocumentPart)??[];for(let s of a){if(s.type!==Eo&&s.type!==To)continue;let l=chunkANZ44KQT_cjs.E(s);l.mode!=="Internal"||!l.target.ok||this.stories.has(l.target.partName)&&o.parts.has(l.target.partName)&&this.rIdToPartName.set(s.id,l.target.partName);}this.pkg=o,this.pkg=chunkANZ44KQT_cjs.ne(this.pkg,this.body.part);for(let s of this.stories.values())this.pkg.parts.has(s.part.name)&&(this.pkg=chunkANZ44KQT_cjs.ne(this.pkg,s.part));}openNotesPartStore(t){let n=chunkANZ44KQT_cjs.Ig(this.currentPackage(),t);if(!n)return {ok:false,reason:"missing-part",detail:t};let r=this.stories.get(n.name);if(r)return {ok:true,story:{kind:"notesPart",partName:n.name,noteKind:t},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 o=chunkANZ44KQT_cjs.qb(n),i=new ct(o,{historyLimit:this.historyLimit,settingsPart:()=>chunkANZ44KQT_cjs.xg(this.pkg)}),a={kind:"notesPart",partName:o.name,noteKind:t};return i.setStoryRef(a),this.stories.set(o.name,i),o!==n&&(this.pkg=chunkANZ44KQT_cjs.ne(this.pkg,o)),{ok:true,story:a,store:i}}openHeaderFooterStore(t){let n=this.rIdToPartName.get(t);if(n){let l=this.stories.get(n);if(l)return {ok:true,story:{kind:"headerFooter",partName:n,rId:t},store:l}}let r=yl(this.currentPackage(),t);if(!r.ok)return r;let o=this.stories.get(r.partName);if(o)return this.rIdToPartName.set(t,r.partName),{ok:true,story:{kind:"headerFooter",partName:r.partName,rId:t},store:o};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=chunkANZ44KQT_cjs.qb(r.part),a=new ct(i,{historyLimit:this.historyLimit,settingsPart:()=>chunkANZ44KQT_cjs.xg(this.pkg)}),s={kind:"headerFooter",partName:i.name,rId:t};return a.setStoryRef(s),this.stories.set(i.name,a),this.rIdToPartName.set(t,i.name),i!==r.part&&(this.pkg=chunkANZ44KQT_cjs.ne(this.pkg,i)),{ok:true,story:s,store:a}}storyRefForPart(t){if(t===this.body.part.name)return {kind:"body",partName:t};for(let[r,o]of this.rIdToPartName)if(o===t)return {kind:"headerFooter",partName:t,rId:r};let n=this.currentPackage().parts.get(t);return n?.root.localName==="footnotes"?{kind:"notesPart",partName:t,noteKind:"footnote"}:n?.root.localName==="endnotes"?{kind:"notesPart",partName:t,noteKind:"endnote"}:null}syncPackageFromStore(t){this.pkg=chunkANZ44KQT_cjs.ne(this.pkg,t.part);}pushUndoPointer(t){chunkANZ44KQT_cjs.ek(this.body,this.stories,t),t.kind==="package"&&t.before.parts.get("/word/numbering.xml")!==t.after.parts.get("/word/numbering.xml")&&(t={...t,restoreNumbering:true}),this.undoOrder.push(t),this.redoOrder.length=0,this.undoOrder.length>this.historyLimit&&this.undoOrder.shift(),this.evictUnreachableStories();}evictUnreachableStories(){let t=Al(this.pkg,this.stories.keys(),this.undoOrder,this.redoOrder);for(let[o]of [...this.stories])if(!t.has(o)){this.stories.delete(o);for(let[i,a]of [...this.rIdToPartName])a===o&&this.rIdToPartName.delete(i);}let n=Dl(t,this.pkg.mainDocumentPart,this.body.part.name,this.undoOrder,this.redoOrder),r=sl(this.pkg,n);r!==this.pkg&&(this.pkg=r),this.shellHyperlinks=al(this.shellHyperlinks,n,this.pkg.mainDocumentPart);}publish(t){this.lastChange=t;for(let n of this.subscribers)n(t);}publishSynthetic(t,n,r,o){this.commitCounter+=1;let i=this.packageRev-1,a={change:"model-change",fromRevision:i<0?0:i,toRevision:this.packageRev,commitId:`pkg-commit-${this.commitCounter}`,origin:t,dirty:[],created:[...o],deleted:[],splitJoin:[],dependencyKeys:[],impact:n,story:r};return this.publish(a),a}};var bm=256,Sm=65535,$l=64;function nr(e,t){return e.length>t}function Ul(e){return typeof e!="string"||e.trim().length===0?"invalid-author":nr(e,bm)?"resource-limit":chunkANZ44KQT_cjs.O(e)?null:"invalid-author"}function Bl(e){return typeof e!="string"||e.length===0?"invalid-text":nr(e,Sm)?"resource-limit":chunkANZ44KQT_cjs.O(e)?null:"invalid-text"}function Do(e){if(typeof e!="string")return {ok:false,rejection:"invalid-date"};let t=e.trim();if(nr(t,$l))return {ok:false,rejection:"resource-limit"};if(!chunkANZ44KQT_cjs.O(t))return {ok:false,rejection:"invalid-date"};let n=chunkANZ44KQT_cjs.Ff(t);return n===null?{ok:false,rejection:"invalid-date"}:nr(n,$l)?{ok:false,rejection:"resource-limit"}:{ok:true,value:n}}function ty(e){if(e===void 0)return null;let t=Do(e);return t.ok?null:t.rejection}function _o(e){switch(e){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 Nm(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function Fo(e,t){if(!e){let a=chunkANZ44KQT_cjs.ub(t);return a?chunkANZ44KQT_cjs.wb(new Set,a,chunkANZ44KQT_cjs.rb):"0"}let n=-1,r=new Set,o=a=>{if(a.kind!=="textValue"){if(a.kind==="comment"){let s=Nm(a,chunkANZ44KQT_cjs.fa,"id");if(s!==void 0&&/^\d{1,10}$/.test(s)){let l=Number(s);Number.isSafeInteger(l)&&l<=chunkANZ44KQT_cjs.rb&&(r.add(String(l)),l>n&&(n=l));}}for(let s of a.children)o(s);}};o(e.root);let i=chunkANZ44KQT_cjs.ub(t);return i?chunkANZ44KQT_cjs.wb(r,i,chunkANZ44KQT_cjs.rb):String(n+1)}function jl(e,t){if(e.kind==="textValue")return e;let n=t.get(e.id);if(n!==void 0)return n;let r=false,o=[];for(let i of e.children){let a=jl(i,t);a!==i&&(r=true),o.push(a);}return r?{...e,children:o}:e}function Tm(e,t,n){let r=jl(e.root,t);if(r.kind==="textValue")return {ok:false,issues:[{code:"known-node-invariant",path:e.root.id,nodeId:e.root.id}]};let o=n===null?r:{...r,namespaceBindings:[...r.namespaceBindings,{prefix:n,namespaceUri:chunkANZ44KQT_cjs.ja}]};return chunkANZ44KQT_cjs.Pa(e,e.root.id,o,{deferValidation:true})}function Hl(e,t,n){let r=new Map;for(let i of t){if(i.stampParagraph===null)continue;let a=r.get(i.commentsPartName);a||(a=new Map,r.set(i.commentsPartName,a)),a.set(i.stampParagraph.id,{paragraph:i.stampParagraph,paraId:i.paraId});}let o=e;for(let[i,a]of r){let s=o.parts.get(i);if(!s)return null;let l=chunkANZ44KQT_cjs.mb(s.root),d=l??"w14",c=new Map;for(let f of a.values())c.set(f.paragraph.id,n(f.paragraph,f.paraId,d));let m=Tm(s,c,l===null?d:null);if(!m.ok)return null;o=chunkANZ44KQT_cjs.ne(o,m.part);}return o}function Vl(e,t,n){let r=e.root.children.map(o=>o.kind==="textValue"?o:t.get(o.id)??o);return chunkANZ44KQT_cjs.Na(e,e.root.id,[...r,...n],{deferValidation:true})}var Gl="/word/comments.xml",Kl="/word/commentsExtended.xml",jo="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Ho="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Cm=[Ho,"application/vnd.ms-word.commentsExtended+xml"],Xl="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Vo="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",et="http://schemas.microsoft.com/office/word/2012/wordml";function tn(e,t,n){for(let r of e.attributes)if(r.localName===n&&r.namespaceUri===t)return r.value}function Et(e,t){return {kind:"genericExtension",namespaceUri:chunkANZ44KQT_cjs.fa,localName:e,prefix:"w",value:t}}function Ge(e,t,n,r,o,i,a,s=[]){return {id:e,kind:t,namespaceUri:n,localName:o,prefix:r,namespaceBindings:s,attributes:i,children:a}}function Yl(e,t,n,r,o){let i=t===e.mainDocumentPart?[t]:[t,e.mainDocumentPart];for(let a of i)for(let s of chunkANZ44KQT_cjs.pe(e,a)){if(s.type!==n)continue;let l=chunkANZ44KQT_cjs.w(a,s.rawTarget);if(!l.ok)continue;if(!e.parts.has(l.partName))return l.partName;let d=chunkANZ44KQT_cjs.qe(e,l.partName);if(d!==null&&(typeof r=="string"?d===r:r.includes(d)))return l.partName}return o}function Lo(e,t,n){let r=e.mainDocumentPart;for(let i of chunkANZ44KQT_cjs.pe(e,r)){if(i.type!==t)continue;let a=chunkANZ44KQT_cjs.w(r,i.rawTarget);if(a.ok&&a.partName===n)return e}let o=chunkANZ44KQT_cjs.ve(e,r);return chunkANZ44KQT_cjs.we(o,r,t,chunkANZ44KQT_cjs.Yh(r,n)).pkg}function zo(e,t){return Yl(e,t,Xl,jo,Gl)}function Jl(e,t){let n=chunkANZ44KQT_cjs.Gd(e,t),r=chunkANZ44KQT_cjs.Hd(e,t,n).extended;return r!==null?r:Yl(e,t,Vo,Cm,Kl)}function zl(e){let t=new Set;for(let n of e.parts.values())for(let r of chunkANZ44KQT_cjs.lb(n.root))t.add(r);return t}function Mm(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&tn(o,chunkANZ44KQT_cjs.fa,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind!=="paragraph")continue;let s=tn(a,chunkANZ44KQT_cjs.ja,"paraId");s!==void 0&&chunkANZ44KQT_cjs.hb(s)&&(n=s.toUpperCase());return}return}for(let i of o.children)r(i);}};return r(e.root),n}function Am(e,t){if(!e)return null;let n=null,r=o=>{if(!(n!==null||o.kind==="textValue")){if(o.kind==="comment"&&tn(o,chunkANZ44KQT_cjs.fa,"id")===t){for(let i=o.children.length-1;i>=0;i-=1){let a=o.children[i];if(a.kind==="paragraph"){n=a;return}}return}for(let i of o.children)r(i);}};return r(e.root),n}function ql(e){let t=chunkANZ44KQT_cjs.mb(e.root);if(t!==null)return {part:e,prefix:t};let n={...e.root,namespaceBindings:[...e.root.namespaceBindings,{prefix:"w14",namespaceUri:chunkANZ44KQT_cjs.ja}]},r=chunkANZ44KQT_cjs.Pa(e,e.root.id,n,{deferValidation:true});return r.ok?{part:r.part,prefix:"w14"}:(chunkANZ44KQT_cjs.Ma(e.root,n),{part:{...e,root:n},prefix:"w14"})}function Ql(e,t,n){return Ge(e.id,"paragraph",e.namespaceUri,e.prefix??"w",e.localName,[...e.attributes.filter(r=>!(r.namespaceUri===chunkANZ44KQT_cjs.ja&&r.localName==="paraId")),{kind:"genericExtension",namespaceUri:chunkANZ44KQT_cjs.ja,localName:"paraId",prefix:n,value:t}],e.children,e.namespaceBindings)}function Dm(e,t,n,r){let o=e.parts.get(t);if(!o)return e;let i=ql(o),a=chunkANZ44KQT_cjs.Ka(i.part,n);if(!a||a.kind!=="paragraph")return chunkANZ44KQT_cjs.ne(e,i.part);let s=chunkANZ44KQT_cjs.Pa(i.part,a.id,Ql(a,r,i.prefix),{deferValidation:true});return chunkANZ44KQT_cjs.ne(e,s.ok?s.part:i.part)}function _m(e,t,n,r){let o=`${Gl}#comment-${e}`,i=n.text!==n.text.trim(),a=Ge(`${o}.t`,"text",chunkANZ44KQT_cjs.fa,"w","t",i?[{kind:"xmlSpace",namespaceUri:chunkANZ44KQT_cjs.ga,localName:"space",prefix:"xml",value:"preserve"}]:[],[{id:`${o}.tv`,kind:"textValue",value:n.text}]),s=Ge(`${o}.rPr`,"runProperties",chunkANZ44KQT_cjs.fa,"w","rPr",[],[Ge(`${o}.rStyle`,"generic",chunkANZ44KQT_cjs.fa,"w","rStyle",[Et("val","CommentReference")],[])]),l=Ge(`${o}.r`,"run",chunkANZ44KQT_cjs.fa,"w","r",[],[s,a]),d=Ge(`${o}.pPr`,"paragraphProperties",chunkANZ44KQT_cjs.fa,"w","pPr",[],[Ge(`${o}.pStyle`,"generic",chunkANZ44KQT_cjs.fa,"w","pStyle",[Et("val","CommentText")],[])]),c=Ge(`${o}.p`,"paragraph",chunkANZ44KQT_cjs.fa,"w","p",[{kind:"genericExtension",namespaceUri:chunkANZ44KQT_cjs.ja,localName:"paraId",prefix:r,value:t}],[d,l]);return Ge(o,"comment",chunkANZ44KQT_cjs.fa,"w","comment",[Et("id",e),Et("author",n.author),...n.initials===void 0?[]:[Et("initials",n.initials)],...n.date===void 0?[]:[Et("date",n.date)]],[c])}function $o(e,t){let n=chunkANZ44KQT_cjs.Aa(t,{name:e,contentType:"application/xml"});return n.ok?n.part.root:null}function Wo(e,t){for(let O of [Ul(t.author),Bl(t.text)])if(O)return {ok:false,reason:_o(O)};let n;if(t.date!==void 0){let O=Do(t.date);if(!O.ok)return {ok:false,reason:_o(O.rejection)};n=O.value;}let r={...t,...n===void 0?{}:{date:n}},o=e.package,i=e.part.name,a=zo(o,i),s=Jl(o,i),l=o.parts.get(a),d=Fo(l,r.actorId),c=chunkANZ44KQT_cjs.kb(`${a}#${d}`,zl(o)),m=t.replyToCommentId===void 0?null:Mm(l,t.replyToCommentId),f=t.replyToCommentId!==void 0&&m===null?Am(l,t.replyToCommentId):null;if(t.replyToCommentId!==void 0&&m===null&&!f)return {ok:false,reason:"unknown-revision"};let h=f?chunkANZ44KQT_cjs.kb(`${a}#parent-${t.replyToCommentId}`,new Set([...zl(o),c])):null,u=m??h,g=t.anchor.endParagraphId??t.anchor.paragraphId,y=e.transact(O=>{let P=qt(O);P.applyPackage(p=>{let k=p.parts.has(a)?p:(()=>{let v=$o(a,`<w:comments xmlns:w="${chunkANZ44KQT_cjs.fa}"/>`);return v?chunkANZ44KQT_cjs.xe(p,a,v,jo):null})();return k===null?p:Lo(k,Xl,a)}),f&&h&&P.applyPackage(p=>Dm(p,a,f.id,h)),P.applyPackage(p=>{let k=p.parts.get(a);if(!k)return p;let v=ql(k),R=chunkANZ44KQT_cjs.Oa(v.part,v.part.root.id,v.part.root.children.length,[_m(d,c,r,v.prefix)],{deferValidation:true});return R.ok?chunkANZ44KQT_cjs.ne(p,R.part):p}),u!==null&&(P.applyPackage(p=>{let k=p.parts.has(s)?p:(()=>{let v=$o(s,`<w15:commentsEx xmlns:w15="${et}"/>`);return v?chunkANZ44KQT_cjs.xe(p,s,v,Ho):null})();return k===null?p:Lo(k,Vo,s)}),P.applyPackage(p=>{let k=p.parts.get(s);if(!k)return p;let R=[...Fm(k).has(u.toUpperCase())?[]:[Bo(`${s}#ex-${u}`,u,void 0,false)],Bo(`${s}#ex-${c}`,c,u,false)],x=chunkANZ44KQT_cjs.Oa(k,k.root.id,k.root.children.length,R,{deferValidation:true});return x.ok?chunkANZ44KQT_cjs.ne(p,x.part):p})),P.applyTo(i,{op:"insertCommentMarker",paragraphId:g,offset:t.anchor.end,commentId:d,marker:"reference"}),P.applyTo(i,{op:"insertCommentMarker",paragraphId:g,offset:t.anchor.end,commentId:d,marker:"end"}),P.applyTo(i,{op:"insertCommentMarker",paragraphId:t.anchor.paragraphId,offset:t.anchor.start,commentId:d,marker:"start"});},r.actorId===void 0?{}:{actorId:r.actorId});return y.ok?{ok:true,commentId:d,change:y.change}:{ok:false,reason:y.reason}}function Uo(e){for(let t=e.children.length-1;t>=0;t-=1){let n=e.children[t];if(n.kind==="paragraph")return n}return null}function Wl(e){let t=Uo(e);if(!t)return null;let n=tn(t,chunkANZ44KQT_cjs.ja,"paraId");return n!==void 0&&chunkANZ44KQT_cjs.hb(n)?n.toUpperCase():null}function Fm(e){let t=new Map;if(!e)return t;let n=r=>{if(r.kind!=="textValue"){if(r.namespaceUri===et&&r.localName==="commentEx"){let o=tn(r,et,"paraId");o!==void 0&&chunkANZ44KQT_cjs.hb(o)&&t.set(o.toUpperCase(),r);}for(let o of r.children)n(o);}};return n(e.root),t}function en(e,t){return {kind:"genericExtension",namespaceUri:et,localName:e,prefix:"w15",value:t}}function Lm(e,t){return {id:e.id,kind:"generic",namespaceUri:e.namespaceUri,localName:e.localName,...e.prefix===void 0?{}:{prefix:e.prefix},namespaceBindings:e.namespaceBindings,attributes:t,children:e.children}}function $m(e,t,n){let r=[],o=false,i=false;for(let a of e.attributes){if(a.namespaceUri===et&&a.localName==="done"){o=true,r.push({kind:"genericExtension",namespaceUri:a.namespaceUri,localName:a.localName,...a.prefix===void 0?{}:{prefix:a.prefix},value:n?"1":"0"});continue}a.namespaceUri===et&&a.localName==="paraIdParent"&&(i=true),r.push(a);}return !i&&t!==void 0&&r.push(en("paraIdParent",t)),o||r.push(en("done",n?"1":"0")),Lm(e,r)}function Bo(e,t,n,r){return {id:e,kind:"generic",namespaceUri:et,localName:"commentEx",prefix:"w15",namespaceBindings:[],attributes:[en("paraId",t),...n===void 0?[]:[en("paraIdParent",n)],en("done",r?"1":"0")],children:[]}}function Go(e,t,n){return Um(e,t,n,chunkANZ44KQT_cjs.Fd())}function Um(e,t,n,r){let o=e.package,i=e.part.name;if(chunkANZ44KQT_cjs.Gd(o,i)===null)return {ok:false,reason:"unknown-comment"};let s=chunkANZ44KQT_cjs.Ah(o,t,{storyPartName:i},r);if(!s.ok)return {ok:false,reason:"unknown-comment"};let l=chunkANZ44KQT_cjs.Id(o,r);if(l.truncated||r.truncated)return {ok:false,reason:"unknown-comment"};let d=l.used,c=new Map,m=[];for(let g of s.ids){let y=s.records.get(g);if(!y)return {ok:false,reason:"unknown-comment"};if(!Uo(y.node))return {ok:false,reason:"unknown-comment"};let P=Wl(y.node),p=P??chunkANZ44KQT_cjs.kb(`${y.partName}#done-${g}`,d);P===null&&d.add(p),c.set(g,p);}for(let g of s.ids){let y=s.records.get(g),O=Uo(y.node),P=c.get(g),p=Wl(y.node),k=s.parentCommentIdByChildId.get(g),v=s.parentParaIdByCommentId.get(g)??(k===void 0?void 0:c.get(k)),R=s.commentExByParaId.get(P);m.push({paraId:P,stampParagraph:p===null?O:null,commentsPartName:y.partName,parentParaId:v,existing:R?.node,existingParentParaId:R?.parentParaId,existingDone:R?.done??false});}if(m.length===0)return {ok:false,reason:"unknown-comment"};if(m.every(g=>g.existingDone===n))return {ok:true,changed:false,change:null};let f=s.extendedPartName??Kl,h=s.extendedPartName===null,u=e.transact(g=>{qt(g).applyPackage(O=>{let P=Hl(O,m,Ql);if(P===null)return O;let p=P;if(!p.parts.has(f)){let C=$o(f,`<w15:commentsEx xmlns:w15="${et}"/>`);if(!C)return O;let I=chunkANZ44KQT_cjs.xe(p,f,C,Ho);p=h?Lo(I,Vo,f):I;}let k=p.parts.get(f);if(!k)return O;let v=new Map,R=[];for(let C of m){let I=C.existingParentParaId??C.parentParaId;C.existing?v.set(C.existing.id,$m(C.existing,I,n)):R.push(Bo(`${f}#done-${C.paraId}`,C.paraId,I,n));}let x=Vl(k,v,R);return x.ok?chunkANZ44KQT_cjs.ne(p,x.part):O});});return u.ok?{ok:true,changed:true,change:u.change}:{ok:false,reason:u.reason}}function Bm(e,t){let n=zo(e,t);return e.parts.has(n)&&chunkANZ44KQT_cjs.qe(e,n)===jo}function jm(e,t){return zo(e,t)}function Hm(e,t){return Jl(e,t)}var Zl={kind:"body"};function Vm(e,t,n=Zl){let r=n.kind==="body"?null:e.resolveStory(n),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunkANZ44KQT_cjs.Fa(e,()=>{let s=Wo(o,t);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkANZ44KQT_cjs.Ga(s))}function zm(e,t,n){let r=e.bodyStore(),o=e.currentPackage(),i=chunkANZ44KQT_cjs.pj(chunkANZ44KQT_cjs.xg(o),{op:"setCommentResolved"});if(i)return {ok:false,reason:i};let a=r.checkpoint();return r.graftPackage(()=>e.currentPackage()),chunkANZ44KQT_cjs.Fa(e,()=>{let s=Go(r,t,n);return !s.ok||!s.changed||(r.restoreHistoryStacks(a),e.replacePackageShell(r.package),e.adoptPackageUnit(o),e.publishStoryWrite(s.change)),s},s=>s.ok&&s.changed)}function Wm(e,t,n=Zl,r){if(t.length===0||chunkANZ44KQT_cjs.pj(chunkANZ44KQT_cjs.xg(e.currentPackage()),{op:"deleteComments"}))return false;let o=n.kind==="body"?e.bodyStore().part:e.partFor(n);if(!o)return false;let i={storyPartName:o.name,...r===void 0?{}:{noteId:r}},a=e.bodyStore(),s=e.currentPackage(),l=a.checkpoint();return a.graftPackage(()=>e.currentPackage()),chunkANZ44KQT_cjs.Fa(e,()=>{let d=false,c=false,m=a.transact(f=>{qt(f).applyPackage(u=>{let g=u;for(let y of t){let O=y.parentCommentId===void 0?chunkANZ44KQT_cjs.Jh(g,y.commentId,i):chunkANZ44KQT_cjs.Kh(g,y.commentId,y.parentCommentId,i);if(O===null)return d=true,u;c||=O!==g,g=O;}return g});});return d||!m.ok||!c?false:(a.restoreHistoryStacks(l),e.installPackageSnapshot(a.package),e.adoptPackageUnit(s),e.publishStoryWrite(m.change),true)},d=>d)}var td=256*1024,nd=4096;function Ko(e,t,n){let r=t.payload,o=e.part.name,i=n??o;if(r){if(r.data.length>td)return {ok:false,reason:"payload-too-large",detail:"data"};if(r.label.length>nd)return {ok:false,reason:"payload-too-large",detail:"label"}}let a=new Set(chunkANZ44KQT_cjs.Mb(e.part.root).map(f=>f.node.id)),s=t.replaceControlId===void 0?[]:rd(e,o,t.replaceControlId),l=null,d,c=e.transact(f=>{if(t.replaceControlId!==void 0){f.apply({op:"removeContentControl",controlId:t.replaceControlId,keepContent:false});for(let g of s)f.applyPackage(y=>chunkANZ44KQT_cjs.ei(y,g.partName,g.nodeId));}let h=t.replaceUntil;if(h!==void 0&&h<=t.offset){l="invalid-range",d="replaceUntil must be past offset";return}if(h!==void 0&&f.apply({op:"deleteText",paragraphId:t.paragraphId,start:t.offset,end:h}),!r){f.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock}});return}let u=null;f.applyPackage(g=>{let y=chunkANZ44KQT_cjs.$h(g,i,r.namespaceUri,r.rootLocalName);if(!y.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})`,g;if(u=chunkANZ44KQT_cjs.ji(y.part,r.rootLocalName,r.nodeId),!u)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`,g;let O=chunkANZ44KQT_cjs.di(y.pkg,y.part.partName,{id:r.nodeId,label:r.label,data:r.data});return chunkANZ44KQT_cjs.ci(O,y.part.partName,r.nodeId)?O:(l="store-not-authored",d="the payload node could not be written into the store",g)}),!(l!==null||!u)&&f.apply({op:"insertInlineContentControl",paragraphId:t.paragraphId,offset:t.offset,tag:t.tag,text:t.text,...t.alias===void 0?{}:{alias:t.alias},...t.lock===void 0?{}:{lock:t.lock},dataBinding:u});});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 m=Gm(e,a);return {ok:true,change:c.change,...m===void 0?{}:{nodeId:m}}}function Gm(e,t){for(let n of chunkANZ44KQT_cjs.Mb(e.part.root))if(!t.has(n.node.id))return n.node.id}function rd(e,t,n){let r=chunkANZ44KQT_cjs.Mb(e.part.root).find(i=>i.node.id===n);if(!r)return [];let o=[];for(let i of chunkANZ44KQT_cjs.Zh(e.package,t)){let a=chunkANZ44KQT_cjs.mi(r.node,i.itemId);a!==null&&o.push({partName:i.partName,nodeId:a});}return o}function Xo(e,t){let n=e.part.name,r=rd(e,n,t),o=e.transact(i=>{i.apply({op:"removeContentControl",controlId:t,keepContent:false});for(let a of r)i.applyPackage(s=>chunkANZ44KQT_cjs.ei(s,a.partName,a.nodeId));});return o.ok?{ok:true,change:o.change}:{ok:false,reason:o.reason,...o.detail===void 0?{}:{detail:o.detail}}}function Km(e,t,n){if(!e.parts.has(t)||n.length===0)return {ok:true,pkg:e,removed:[]};let r=e,o=[];for(let i of n){let a=chunkANZ44KQT_cjs._h(r,t,i);if(!a)continue;let s=chunkANZ44KQT_cjs.li(r,a.itemId),l=chunkANZ44KQT_cjs.fi(r,a.partName,s);if(l.pkg===r&&chunkANZ44KQT_cjs.bi(r,a.partName).some(d=>!s.has(d.id)))return {ok:false,reason:`the payload store for ${i} refused the sweep`};r=l.pkg,o.push(...l.removed);}return {ok:true,pkg:r,removed:o}}var ed=new WeakMap;function Xm(e,t){let n=ed.get(e);n||(n=new Map,ed.set(e,n));let r=n.get(t);if(r)return r;let o=chunkANZ44KQT_cjs.Zh(e,t).map(i=>({itemId:i.itemId,nodes:new Map(chunkANZ44KQT_cjs.bi(e,i.partName).map(a=>[a.id,a]))}));return n.set(t,o),o}function Ym(e,t,n=t){let r=new Map,o=e.parts.get(t);if(!o)return r;let i=Xm(e,n);if(i.length===0)return r;for(let a of chunkANZ44KQT_cjs.Mb(o.root))for(let s of i){let l=chunkANZ44KQT_cjs.mi(a.node,s.itemId);if(l===null)continue;let d=s.nodes.get(l);if(d){r.set(a.node.id,{nodeId:l,label:d.label,data:d.data});break}}return r}function Jm(e,t,n){let r=new Map,o=chunkANZ44KQT_cjs._h(e,t,n);if(!o)return r;for(let i of chunkANZ44KQT_cjs.bi(e,o.partName))r.set(i.id,{label:i.label,data:i.data});return r}var od={kind:"body"};function ad(e,t,n){let r=t.kind==="body"?null:e.resolveStory(t),o=r?.ok?r.store:e.bodyStore(),i=e.currentPackage(),a=o.checkpoint();return o.graftPackage(()=>e.currentPackage()),chunkANZ44KQT_cjs.Fa(e,()=>{let s=n(o);return s.ok&&(o.restoreHistoryStacks(a),e.replacePackageShell(o.package),e.adoptPackageUnit(i),e.publishStoryWrite(s.change)),s},s=>chunkANZ44KQT_cjs.Ga(s))}function qm(e,t,n=od){return ad(e,n,r=>Ko(r,t,e.bodyStore().part.name))}function Qm(e,t,n=od){return ad(e,n,r=>Xo(r,t))}var sd=new WeakMap;function Oe(e,t){return sd.set(e,t),e}function Z(e){return sd.get(e)??[]}function nn(e){return `${e.kind}-${e.id}`}function Yo(e){return e.kind==="revision"?e.ranges:e.range?[e.range]:[]}function ld(e){return Yo(e)[0]??null}function Tt(e,t){let n=ld(e);if(!n)return Number.MAX_SAFE_INTEGER;let r=t.get(n.start.paragraphId);return r===void 0?Number.MAX_SAFE_INTEGER:r*1e6+Math.min(n.start.offset,999999)}function Zm(e,t){let n=t.get(e.start.paragraphId),r=t.get(e.end.paragraphId);return n===void 0||r===void 0?Number.MAX_SAFE_INTEGER:(r-n)*1e6+(e.end.offset-e.start.offset)}var eu=0,tu=1,nu=2;function ru(e,t,n){let r=n.get(t.paragraphId),o=n.get(e.start.paragraphId),i=n.get(e.end.paragraphId);return r===void 0||o===void 0||i===void 0||r<o||r>i||r===o&&t.offset<e.start.offset||r===i&&t.offset>e.end.offset?null:o===i&&e.start.offset===e.end.offset?eu:r===i&&t.offset===e.end.offset?nu:tu}function ou(e,t,n){let r=null;for(let o of Yo(e)){let i=ru(o,t,n);if(i===null)continue;let a=Zm(o,n);(r===null||i<r.grip||i===r.grip&&a<r.width)&&(r={grip:i,width:a});}return r}var id={comment:0,custom:1,revision:2};function au(e,t,n){let r=[];for(let o of e){let i=ou(o,t,n);i!==null&&r.push({item:o,grip:i.grip,width:i.width});}return r.sort((o,i)=>o.grip!==i.grip?o.grip-i.grip:o.width!==i.width?o.width-i.width:o.item.kind!==i.item.kind?id[o.item.kind]-id[i.item.kind]:o.item.kind==="revision"&&i.item.kind==="revision"?i.item.nesting-o.item.nesting:0).map(o=>o.item)}function zy(e,t,n){let o=au(e,t,n).filter(i=>!(i.kind==="comment"&&i.resolved))[0];return o?o.kind==="comment"?dd(e,o):o:null}function Wy(e,t){return dd(e,t)}function dd(e,t){let n=new Map,r=new Map;for(let a of e)a.kind==="comment"?n.set(a.id,a):a.kind==="revision"&&r.set(a.id,a);let o=new Set([t.id]),i=t;for(;i.parentId!==void 0;){let a=n.get(i.parentId);if(!a||o.has(a.id))break;o.add(a.id),i=a;}if(i.parentRevisionId!==void 0){let a=r.get(i.parentRevisionId);if(a)return a}return i}var iu=new Map([[167,"\u2663"],[168,"\u2666"],[169,"\u2665"],[170,"\u2660"],[174,"\u2192"],[176,"\xB0"],[180,"\xD7"],[183,"\u2022"],[222,"\u21D2"]]),cd=new Map([[108,"\u25CF"],[110,"\u25A0"],[111,"\u25A1"],[167,"\u25AA"],[216,"\u27A2"],[252,"\u2714"],[253,"\u2718"]]),md=new Map([[167,"\u25AA"],[183,"\u2022"]]),rr=new Map([["symbol",iu],["wingdings",cd],["wingdings 2",md],["wingdings 3",md],["webdings",cd]]),su=64,Ky=Object.freeze([...rr.keys()]);function or(e){return !e||e.length>su?false:rr.has(e.toLowerCase())}function Xy(e){for(let t of e){let n=t.codePointAt(0);if(n>=61440&&n<=61695)return true}return false}function Jo(e,t,n){if(e.length===0||!or(t))return e;let r=rr.get(t.toLowerCase());if(n?.(t)===true)return e;let o="",i=false;for(let a of e){let s=a.codePointAt(0);if(s>=61440&&s<=61695){let l=r.get(s-61440);if(l!==void 0){o+=l,i=true;continue}}o+=a;}return i?o:e}function Yy(e,t,n){if(e.length===1&&or(t)){let r=t.toLowerCase();if(r==="symbol"||r==="wingdings"){let o=rr.get(r).get(e.charCodeAt(0));if(o!==void 0&&n?.(t)!==true)return o}}return Jo(e,t,n)}var ar=61440,ud=61695,lu=128;function du(e){return e.kind==="generic"&&e.namespaceUri===chunkANZ44KQT_cjs.fa&&e.localName==="sym"}function pd(e,t){if(!(e.kind==="textValue"||!("attributes"in e))){for(let n of e.attributes)if(n.localName===t&&(n.namespaceUri===chunkANZ44KQT_cjs.fa||n.namespaceUri===""))return n.value}}function cu(e){return !e||e.length>4||!/^[0-9A-Fa-f]{1,4}$/.test(e)?null:Number.parseInt(e,16)}function mu(e){return !(!Number.isInteger(e)||e<32||e>1114111||e>=127&&e<=159||e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65534)===65534||e===65532)}function uu(e){if(!du(e))return null;let t=cu(pd(e,"char"));if(t===null)return null;let n=pd(e,"font"),r=n&&n.length<=lu?n:null,o=or(r),i=o&&t<=255&&t+ar<=ud?t+ar:t;if(o&&i>=ar&&i<=ud){let a=Jo(String.fromCodePoint(i),r),s=a.codePointAt(0)<ar;return {text:a,font:r,unicode:s}}return mu(t)?{text:String.fromCodePoint(t),font:r,unicode:t<57344||t>63743}:null}function qo(e){let t=uu(e);return t?.unicode?t.text:""}function fd(e){return chunkANZ44KQT_cjs.bb(gd(e,true))}function ox(e){return gd(e,false)}function gd(e,t){let n=[],r=o=>{if(o.kind==="textValue"){n.push(o.value);return}if(t&&chunkANZ44KQT_cjs.Wa(o)){n.push(qo(o));return}let i=chunkANZ44KQT_cjs.Xa(o);if(i!==null){n.push(i);return}for(let a of o.children)r(a);};for(let o of e.blocks)r(o);return n.join("")}function hd(e){if(e.initials&&e.initials.trim().length>0)return e.initials.trim();let t=e.author.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function pt(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkANZ44KQT_cjs.fb(e);if(chunkANZ44KQT_cjs.Wa(e))return qo(e);let t=chunkANZ44KQT_cjs.Xa(e);if(t!==null)return t;if(chunkANZ44KQT_cjs.Ze(e))return "";let n="";for(let r of e.children)n+=pt(r);return n}var Ct=(e,t)=>e.kind!=="textValue"&&e.namespaceUri===chunkANZ44KQT_cjs.fa&&e.localName===t;function yd(e,t,n){let r=new Set(["tcPrChange","trPrChange","tblPrExChange","tblGridChange","tblPrChange"]),o=new Map(n.filter(g=>g.propertyChange&&r.has(g.node.localName)).map(g=>[g.node.id,g]));if(!o.size)return [...t];let i=chunkANZ44KQT_cjs.Oi(e,n).tableHistories,a=[],s=new Map,l=g=>g.node.attributes.find(y=>y.namespaceUri===chunkANZ44KQT_cjs.fa&&y.localName==="author")?.value??"",d=(g,y)=>{if(g.kind==="textValue"||Ct(g,"tbl"))return;let O=o.get(g.id);O&&y.push(O);for(let P of g.children)d(P,y);},c=g=>{if(g.kind!=="textValue"){if(Ct(g,"tbl")){let y,O=[],P=[],p=[],k=false;for(let R of g.children){if(Ct(R,"tblGrid")&&d(R,P),Ct(R,"tblPr")&&d(R,p),!Ct(R,"tr"))continue;let x=[];if(d(R,x),k||=x.some(I=>I.refused),!x.length||x.some(I=>I.refused)){y=void 0;continue}let C=l(x[x.length-1]);(!y||y.author!==C)&&(y={ids:new Set,author:C,tableId:g.id},a.push(y),O.push(y));for(let I of x)y.ids.add(I.node.id);}let v=O.at(-1);if(v&&!k&&P.every(R=>!R.refused)){for(let R of P)v.ids.add(R.node.id);if(O.length===1&&P.length>0)for(let R of p){let x=R.node.children.find(C=>Ct(C,"tblPr"));!R.refused&&R.parent?.kind==="tableProperties"&&x&&l(R)===v.author&&(i.has(R.node.id)||chunkANZ44KQT_cjs.va({...R.parent,children:R.parent.children.filter(C=>C.id!==R.node.id)},x))&&v.ids.add(R.node.id);}}}for(let y of g.children)c(y);}};c(e.root);for(let g of a)for(let y of g.ids)s.set(y,g);let m=new Set;for(let g of t){let O=Z(g).map(P=>s.get(P));if(O.some(P=>P!==O[0]))for(let P of O)P&&m.add(P.tableId);}for(let g of a)if(m.has(g.tableId))for(let y of g.ids)o.get(y)?.node.localName==="tblGridChange"&&(g.ids.delete(y),s.delete(y));let f=new Map;for(let g of t){let y=Z(g),O=y.length?s.get(y[0]):void 0;if(!O||g.readOnly||g.revisionKind!=="format"||!y.every(p=>s.get(p)===O))continue;let P=f.get(O)??[];P.push(g),f.set(O,P);}let h=new Map,u=new Set;for(let g of a){let y=f.get(g)??[],O=y.find(x=>!["tblGridChange","tblPrChange"].includes(x.formattingKind??""))??y[0],P=O?[O,...y.filter(x=>x!==O)]:[],p=P.flatMap(Z),k=new Set(p);if(!O||P.length<2||![...g.ids].every(x=>k.has(x)))continue;let v=[...new Map(P.flatMap(x=>x.addresses).map(x=>[JSON.stringify([x.id,x.author,x.date??null]),x])).values()],R=[...new Map(P.filter(x=>!["tblGridChange","tblPrChange"].includes(x.formattingKind??"")).flatMap(x=>x.ranges).map(x=>[JSON.stringify(x),x])).values()];h.set(O,Oe({...O,author:g.author,addresses:v,ranges:R,text:[...new Set(P.map(x=>x.text).filter(Boolean))].join(`
2
+ `)},p));for(let x of P.slice(1))u.add(x);}return t.filter(g=>!u.has(g)).map(g=>h.get(g)??g)}var kd=e=>e.kind==="textValue"?e.value:[e.namespaceUri,e.localName,e.attributes.map(t=>[t.namespaceUri,t.localName,t.value]).sort((t,n)=>JSON.stringify(t).localeCompare(JSON.stringify(n))),e.children.map(kd)],xd=e=>new Map(e.children.filter(t=>t.kind!=="textValue"&&!(t.namespaceUri===chunkANZ44KQT_cjs.fa&&t.localName==="rPrChange")).map(t=>t.kind==="textValue"?["",""]:[JSON.stringify([t.namespaceUri,t.localName]),JSON.stringify(kd(t))]));function pu(e){if(e.node.localName!=="rPrChange"||!e.parent||e.paragraphMark||e.refused)return;let t=e.node.children.find(i=>i.kind!=="textValue"&&i.namespaceUri===chunkANZ44KQT_cjs.fa&&i.localName==="rPr");if(!t||t.kind==="textValue")return;let n=xd(t),r=xd(e.parent),o=[...new Set([...n.keys(),...r.keys()])].sort().filter(i=>n.get(i)!==r.get(i)).map(i=>[i,r.get(i)??null]);return o.length?JSON.stringify(o):void 0}function Pd(e,t){let n=new Map(t.map(s=>[s.node.id,pu(s)])),r=new Map;for(let s of e){if(s.revisionKind!=="format"||s.formattingKind!=="rPrChange"||s.readOnly||s.ranges.length!==1)continue;let l=s.ranges[0];if(l.start.paragraphId!==l.end.paragraphId||l.start.offset===l.end.offset)continue;let d=Z(s),c=d.length?n.get(d[0]):void 0;if(!c||!d.every(h=>n.get(h)===c))continue;let m=JSON.stringify([s.author,l.partName,l.start.paragraphId,c]),f=r.get(m)??[];f.push(s),r.set(m,f);}let o=new Set,i=new Map,a=s=>{if(s.length<2)return;let l=s[0],d=[...new Map(s.flatMap(c=>c.addresses).map(c=>[JSON.stringify([c.id,c.author,c.date??null]),c])).values()];i.set(l,Oe({...l,addresses:d,ranges:s.flatMap(c=>c.ranges),text:s.map(c=>c.text).join("")},s.flatMap(Z)));for(let c of s.slice(1))o.add(c);};for(let s of r.values()){s.sort((d,c)=>d.ranges[0].start.offset-c.ranges[0].start.offset);let l=[];for(let d of s)l.length&&l[l.length-1].ranges[0].end.offset!==d.ranges[0].start.offset&&(a(l),l=[]),l.push(d);a(l);}return e.filter(s=>!o.has(s)).map(s=>i.get(s)??s)}var ce=(e,t)=>e.kind!=="textValue"&&e.namespaceUri===chunkANZ44KQT_cjs.fa&&e.localName===t,rn=(e,t)=>e.attributes.find(n=>n.namespaceUri===chunkANZ44KQT_cjs.fa&&n.localName===t)?.value;function fu(e,t,n){let r=e.children.filter(o=>ce(o,"tc"));return r.length>0&&r.every(o=>{if(o.kind==="textValue")return false;let i=o.children.filter(a=>a.kind==="paragraph");return i.length>0&&i.every(a=>{if(a.kind==="textValue")return false;let s=a.children.find(m=>ce(m,"pPr")),l=s?.kind!=="textValue"?s?.children.find(m=>ce(m,"rPr")):void 0,d=l?.kind!=="textValue"?l?.children.filter(m=>ce(m,"ins")||ce(m,"del")):void 0,c=d?.length===1?d[0]:void 0;return !!c&&c.kind!=="textValue"&&c.localName===t&&rn(c,"author")===n})})}function gu(e,t,n,r){let o=new Map(n.filter(p=>p.parent?.localName==="trPr"&&(p.node.localName==="ins"||p.node.localName==="del")).map(p=>[p.node.id,p]));if(o.size===0)return [...t];let i=new Map(n.map(p=>[p.node.id,p])),a=new Map;for(let p of r.values())a.set(p.paragraphId,Math.max(a.get(p.paragraphId)??0,p.end));let s=[],l=new Map,d=new Set,c=new Map,m=(p,k)=>{if(p.kind==="textValue"||ce(p,"tbl"))return;let v=i.get(p.id),R=o.has(p.id);v&&!v.propertyChange&&p.localName===k.direction&&!v.refused&&(R?rn(p,"author")===k.author:v.paragraphMark||p.kind==="revisionInsert"||p.kind==="revisionDelete")&&(c.set(p.id,k),R&&k.markerIds.add(p.id));for(let x of p.children)m(x,k);},f=(p,k=0)=>{if(p.kind!=="textValue"){if(ce(p,"tr")&&k>1){let v=p.children.find(R=>ce(R,"trPr"));if(v&&v.kind!=="textValue")for(let R of v.children)o.has(R.id)&&l.set(R.id,p);}if(ce(p,"tbl")){let v;for(let R of p.children){if(R.kind==="textValue"||!ce(R,"tr")){v=void 0;continue}let x=R.children.find(J=>ce(J,"trPr")),C=x?.kind!=="textValue"?x?.children.filter(J=>o.has(J.id))??[]:[],I=C.length===1?C[0]:void 0,H=I&&I.kind!=="textValue"?rn(I,"author"):void 0;if(!I||I.kind==="textValue"||H===void 0||o.get(I.id)?.refused){v=void 0;continue}let D=I.localName;if(k>0){if(!fu(R,D,H)){v=void 0;continue}d.add(R.id);}(!v||v.author!==H||v.direction!==D)&&(v={markerIds:new Set,rows:[],author:H,direction:D,followingText:[]},s.push(v)),v.rows.push(R),v.markerIds.add(I.id),m(R,v);}}for(let v of p.children)f(v,k+(ce(p,"tbl")?1:0));}};f(e.root);let h,u=new Set(s.flatMap(p=>p.rows.map(k=>k.id))),g=(p,k=0,v=false)=>{if(p.kind==="textValue")return;d.has(p.id)&&(h=void 0);let R=k+(ce(p,"tbl")?1:0),x=v||u.has(p.id);if(p.kind==="run"&&!x&&(h=void 0),h&&(p.kind==="revisionInsert"||p.kind==="revisionDelete")){let C=h;h=void 0;let I=i.get(p.id),H=rn(C.marker,"author");if(I&&!I.refused&&H!==void 0&&p.localName===C.marker.localName&&rn(p,"author")===H&&(c.get(p.id)?.author??H)===H){let D=c.get(p.id);D||(D={markerIds:new Set,rows:[C.row],author:H,direction:C.marker.localName,followingText:[pt(p)],rowEndOnly:true},s.push(D),c.set(p.id,D)),D.markerIds.add(C.marker.id),c.set(C.marker.id,D);}}for(let C of p.children)g(C,R,x);if((ce(p,"tc")||p.kind==="paragraph"&&!x)&&(h=void 0),ce(p,"tr")&&(h=void 0,R>1&&!d.has(p.id))){let C=p.children.find(D=>ce(D,"trPr")),I=C&&C.kind!=="textValue"?C.children.filter(D=>o.has(D.id)):[],H=I.length===1?I[0]:void 0;H&&H.kind!=="textValue"&&!o.get(H.id)?.refused&&(h={marker:H,row:p});}};g(e.root),t=t.map(p=>{let k=Z(p);if(p.revisionKind!=="structural"||!k.length||!k.every(R=>l.has(R)))return p;let v=[];for(let R of k){let x,C=I=>{if(!(I.kind==="textValue"||ce(I,"tbl")))if(I.kind==="paragraph")x=I;else for(let H of I.children)C(H);};if(C(l.get(R)),x){let I={paragraphId:x.id,offset:a.get(x.id)??0};v.push({partName:e.name,start:I,end:I});}}return v.length?Oe({...p,ranges:v},k):p});let y=new Map;for(let p of t){let k=Z(p),v=k.length?c.get(k[0]):void 0;if(!v||p.readOnly||!k.every(x=>c.get(x)===v))continue;let R=y.get(v)??[];R.push(p),y.set(v,R);}let O=new Set,P=new Map;for(let p of s){let k=y.get(p)??[],v=k.find(T=>Z(T).some(L=>p.markerIds.has(L))),R=new Set(k.flatMap(Z));if(!v||![...p.markerIds].every(T=>R.has(T)))continue;let x=[v,...k.filter(T=>T!==v)],C=x.flatMap(T=>T.addresses),I=[],H=[],D=T=>{if(!(T.kind==="textValue"||ce(T,"tbl"))){if(T.kind==="paragraph"){I.push({partName:e.name,start:{paragraphId:T.id,offset:0},end:{paragraphId:T.id,offset:a.get(T.id)??0}}),H.push(pt(T));return}for(let L of T.children)D(L);}};for(let T of p.rows)D(T);if(p.rowEndOnly&&I.length){let T=I[I.length-1];I.splice(0,I.length,{...T,start:T.end});}let J=new Set(I.map(T=>T.start.paragraphId));for(let T of x)if(!(T.revisionKind==="structural"&&Z(T).some(L=>!l.has(L))))for(let L of T.ranges)J.has(L.start.paragraphId)||I.push(L);H.push(...p.followingText);let V=Oe({...v,addresses:[...new Map(C.map(T=>[JSON.stringify([T.id,T.author,T.date??null]),T])).values()],ranges:I.length?I:x.flatMap(T=>T.ranges),text:H.join(`
3
+ `),nesting:x.reduce((T,L)=>Math.min(T,L.nesting),v.nesting)},x.flatMap(Z));P.set(v,V);for(let T of k)T!==v&&O.add(T);}return t.filter(p=>!O.has(p)).map(p=>P.get(p)??p)}function Rd(e,t,n,r,o){let i=Pd(yd(e,gu(e,t,n,r),n),n),a=new Set(n.filter(s=>s.node.kind==="moveFromRangeStart"||s.node.kind==="moveToRangeStart").map(s=>s.node.id));return a.size>0||n.some(s=>s.parent?.localName==="trPr"&&["ins","del"].includes(s.node.localName))?i.sort((s,l)=>Tt(s,o)-Tt(l,o)||Number(Z(l).some(d=>a.has(d)))-Number(Z(s).some(d=>a.has(d)))):i}function Od(e){if(e.parent?.localName==="trPr"){if(e.node.localName==="ins")return "rowInsert";if(e.node.localName==="del")return "rowDelete"}if(e.parent?.localName==="tcPr"){if(e.node.localName==="cellIns")return "cellInsert";if(e.node.localName==="cellDel")return "cellDelete";if(e.node.localName==="cellMerge")return "cellMerge"}if(e.parent?.localName==="numPr"&&e.node.localName==="ins")return "numberingInsert"}function vd(e,t,n,r){if(!e.some(u=>u.revisionKind==="paragraphMark"))return e;let o=new Map,i=(u,g)=>{if(!(u.kind==="textValue"||g>64))for(let y=0;y<u.children.length;y+=1){let O=u.children[y],P=u.children[y+1];O.kind==="paragraph"&&P?.kind==="paragraph"&&o.set(O.id,P.id),i(O,g+1);}};i(t.root,0);let a=e.map((u,g)=>g),s=u=>{for(;a[u]!==u;)a[u]=a[a[u]],u=a[u];return u},l=new Map,d=new Map,c=(u,g,y)=>JSON.stringify([u.revisionKind==="paragraphMark"?u.markDirection:u.revisionKind,u.author,u.nesting,g,y]),m=(u,g,y)=>{let O=u.get(g);O?O.push(y):u.set(g,[y]);};e.forEach((u,g)=>{if(!(u.readOnly||!["insert","delete","paragraphMark"].includes(u.revisionKind)))for(let y of u.ranges)m(l,c(u,y.start.paragraphId,y.start.offset),g),m(d,c(u,y.end.paragraphId,y.end.offset),g);});let f=(u,g)=>{for(let y of g){let O=e[u].date,P=e[y].date;O!==void 0&&P!==void 0&&!chunkANZ44KQT_cjs.Wg(O,P)||(a[s(y)]=s(u));}};e.forEach((u,g)=>{if(!(u.readOnly||u.revisionKind!=="paragraphMark"||!["insert","delete"].includes(u.markDirection??"")))for(let y of u.ranges){f(g,d.get(c(u,y.start.paragraphId,y.start.offset))??[]);let O=o.get(y.end.paragraphId);O&&f(g,l.get(c(u,O,0))??[]);}});let h=new Map;return e.forEach((u,g)=>{let y=s(g),O=h.get(y);O?O.push(u):h.set(y,[u]);}),[...h.values()].map(u=>{if(u.length===1)return u[0];let g=u.flatMap(k=>k.ranges).sort((k,v)=>n.get(k.start.paragraphId)-n.get(v.start.paragraphId)||k.start.offset-v.start.offset),y=u.flatMap(k=>Z(k)).flatMap(k=>{let v=r.get(k);return v?[v]:[]}).sort((k,v)=>n.get(k.range.start.paragraphId)-n.get(v.range.start.paragraphId)||k.range.start.offset-v.range.start.offset),O=u[0],P=u.find(k=>k.revisionKind!=="paragraphMark"),p=[...new Map(u.flatMap(k=>k.addresses).map(k=>[JSON.stringify(k),k])).values()];return Oe({...O,id:u.map(k=>k.id).join("+"),revisionKind:P?.revisionKind??"paragraphMark",...P?{markDirection:void 0}:{},addresses:p,ranges:g,text:P?y.map(k=>k.text).join(""):""},u.flatMap(k=>Z(k)))})}function Qo(e){if(!e.propertyChange||!e.parent)return [];let t=(o,i)=>{let a=o?.children.find(s=>s.kind!=="textValue"&&s.namespaceUri===chunkANZ44KQT_cjs.fa&&s.localName==="lang");return a&&a.kind!=="textValue"?a.attributes.find(s=>s.namespaceUri===chunkANZ44KQT_cjs.fa&&s.localName===i)?.value:void 0},n=e.node.children.find(o=>o.kind!=="textValue"&&o.localName===e.parent.localName),r=[];for(let o of ["val","eastAsia","bidi"]){let i=t(e.parent,o),a=t(n?.kind!=="textValue"?n:void 0,o);i&&i!==a&&!r.includes(i)&&r.push(i);}return r}var hu=[{property:"bold",element:"b",attribute:"val",kind:"toggle"},{property:"italic",element:"i",attribute:"val",kind:"toggle"},{property:"underline",element:"u",attribute:"val"},{property:"strike",element:"strike",attribute:"val",kind:"toggle"},{property:"fontFamily",element:"rFonts",attribute:"ascii"},{property:"fontSize",element:"sz",attribute:"val",kind:"halfPoints"},{property:"color",element:"color",attribute:"val"},{property:"alignment",element:"jc",attribute:"val"},{property:"leftIndent",element:"ind",attribute:"left",kind:"twips"},{property:"rightIndent",element:"ind",attribute:"right",kind:"twips"},{property:"firstLineIndent",element:"ind",attribute:"firstLine",kind:"twips"},{property:"hangingIndent",element:"ind",attribute:"hanging",kind:"twips"},{property:"spaceBefore",element:"spacing",attribute:"before",kind:"twips"},{property:"spaceAfter",element:"spacing",attribute:"after",kind:"twips"}];function Zo(e){if(!e.propertyChange||!e.parent)return [];let t=e.node.children.find(r=>r.kind!=="textValue"&&r.namespaceUri===chunkANZ44KQT_cjs.fa&&r.localName===e.parent.localName),n=[];for(let r of hu){let o=a=>{let s=a?.children.find(d=>d.kind!=="textValue"&&d.namespaceUri===chunkANZ44KQT_cjs.fa&&d.localName===r.element);if(!s||s.kind==="textValue")return null;let l=s.attributes.find(d=>d.namespaceUri===chunkANZ44KQT_cjs.fa&&d.localName===r.attribute)?.value;if(r.kind==="toggle")return l==="0"||l==="false"||l==="off"?"false":"true";if(l===void 0)return null;if(r.kind==="halfPoints"||r.kind==="twips"){let d=r.kind==="twips"?chunkANZ44KQT_cjs._c(l)??Number.NaN:Number(l);return Number.isFinite(d)?String(d/(r.kind==="halfPoints"?2:20)):l}return l},i=o(e.parent);i!==o(t?.kind!=="textValue"?t:void 0)&&n.push({property:r.property,value:i});}return n}function sr(e){return Nd(e,true)}function Ex(e){return Nd(e,false)}function Nd(e,t){let n=t?bd.get(e.root):void 0;if(n)return n;let r=new Map,o=s=>{let l=t?Id.get(s):void 0;if(l){for(let[c,m]of l)r.set(c,m);return}let d=new Map;xu(s,d,t),t&&Id.set(s,d);for(let[c,m]of d)r.set(c,m);},i=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){o(s);return}for(let d of s.children)i(d,l+1);}};i(e.root,0);let a=(s,l)=>{if(!(s.kind==="textValue"||l>64)){if(s.kind==="paragraph"){let d=t?Sd.get(s):void 0;if(!d){let c=[];wd(s,0,c,t),d=c,t&&Sd.set(s,d);}for(let[c,m]of d)r.set(c,m);return}if(s.kind==="table"||s.kind==="tableRow"||s.kind==="tableCell"){let d=t?ir.get(s):void 0;d||(d=Ed(s),t&&ir.set(s,d));for(let[c,m]of d)r.set(c,m);}for(let d of s.children)a(d,l+1);}};return a(e.root,0),t&&bd.set(e.root,r),r}function wd(e,t,n,r){if(!(e.kind==="textValue"||t>64)){if(e.kind==="table"||e.kind==="tableRow"||e.kind==="tableCell"){let o=r?ir.get(e):void 0;o||(o=Ed(e),r&&ir.set(e,o));for(let i of o)n.push(i);}for(let o of e.children)wd(o,t+1,n,r);}}function Ed(e){let t=null,n=(i,a)=>{if(!(t||i.kind==="textValue"||a>64)){if(i.kind==="paragraph"){t=i;return}for(let s of i.children)n(s,a+1);}};if(n(e,0),!t)return yu;let r={paragraphId:t.id,start:0,end:0},o=[];if(e.kind==="textValue")return o;for(let i of e.children)if(!(i.kind==="textValue"||!["tblPr","tblGrid","tblPrEx","trPr","tcPr"].includes(i.localName)))for(let a of i.children){if(a.kind==="textValue")continue;(a.localName===`${i.localName}Change`||i.localName==="trPr"&&["ins","del"].includes(a.localName)||i.localName==="tcPr"&&["cellIns","cellDel","cellMerge"].includes(a.localName))&&o.push([a.id,r]);}return o}var yu=[],Id=new WeakMap,bd=chunkANZ44KQT_cjs.Bh(8),ir=new WeakMap,Sd=new WeakMap;function xu(e,t,n){let r=n?chunkANZ44KQT_cjs.Of(e):chunkANZ44KQT_cjs.Qf(e),o=(s,l,d,c)=>{if(!(s.kind==="textValue"||c>64)){t.set(s.id,{paragraphId:e.id,start:l,end:d});for(let m of s.children)o(m,l,d,c+1);}},i=(s,l)=>{if(s.kind==="textValue"||l>64)return;let d=r.spanOf(s);if(s.kind==="fldSimple"&&d){o(s,d.start,d.end,l);return}if(s.kind==="run"){if(!d)return;t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)c.kind==="runProperties"&&o(c,d.start,d.end,l+1);return}d&&t.set(s.id,{paragraphId:e.id,start:d.start,end:d.end});for(let c of s.children)i(c,l+1);};for(let s of e.children)s.kind!=="paragraphProperties"&&i(s,0);let a=e.children.find(s=>s.kind==="paragraphProperties");a&&o(a,r.length,r.length,0);}var Pu={ins:"insert",del:"delete",moveFrom:"moveFrom",moveTo:"moveTo"};function lr(e,t){for(let n of e.attributes)if(n.localName===t&&n.namespaceUri===chunkANZ44KQT_cjs.fa)return n.value}function ea(e){return `${e.id}\0${e.author}\0${e.date??""}`}var Ru={revisionInsert:"insert",revisionDelete:"delete",revisionMoveFrom:"moveFrom",revisionMoveTo:"moveTo",moveFromRangeStart:"moveFrom",moveToRangeStart:"moveTo"},Md={retainRevisionItems:true,revisionSites:chunkANZ44KQT_cjs.$i,locations:sr,commentAnchors:chunkANZ44KQT_cjs.Dh,deepOrder:chunkANZ44KQT_cjs.oj};function dr(e){return Ad(e,Md)}function Ad(e,t){let n=e.root.kind!=="paragraph";if(n&&t.retainRevisionItems){let o=Td.get(e.root);if(o&&o.name===e.name)return o.items}let r=Ou(e,t);return n&&t.retainRevisionItems&&Td.set(e.root,{name:e.name,items:r}),r}var Td=chunkANZ44KQT_cjs.Bh(8);function Ou(e,t){let n=t.revisionSites(e);if(n.length===0)return [];let r=t.locations(e),o=new Map(chunkANZ44KQT_cjs.Pi(e.root).map(u=>[u.start.id,u])),i=chunkANZ44KQT_cjs.Ri(e.root),a=n.some(u=>u.paragraphMark),s=new Map,l=new Map,d=chunkANZ44KQT_cjs.Ni(e,n);for(let u of n){if(d.has(u.node.id))continue;let g=o.get(u.node.id),y=g?g.content.map(pt).join(""):pt(u.node),O=lr(u.node,"id"),P=O??`missing-${u.node.id}`,p=lr(u.node,"author")??"",k=lr(u.node,"author")===void 0&&u.node.localName!=="tblGridChange",v=lr(u.node,"date"),R=v===void 0?{id:P,author:p}:{id:P,author:p,date:v},x=i.has(u.node.id)?"insert":u.propertyChange?"format":u.paragraphMark?"paragraphMark":Ru[u.node.kind]??"structural",C=u.paragraphMark?Pu[u.node.localName]:void 0,I=x==="structural"?Od(u):void 0,H=r.get(u.node.id),D=g?.end&&r.get(g.end.id),J=H&&D&&H.paragraphId===D.paragraphId?{...H,end:D.end}:H,V=J?{partName:e.name,start:{paragraphId:J.paragraphId,offset:J.start},end:{paragraphId:J.paragraphId,offset:J.end}}:null;a&&V&&(x==="paragraphMark"||x==="insert"||x==="delete")&&s.set(u.node.id,{range:V,text:x==="paragraphMark"?`
4
+ `:y});let T=x==="structural"?`structural\0${ea(R)}`:`${x}\0${u.node.localName}\0${ea(R)}`,L=l.get(T);if(L){L.siteNodeIds.push(u.node.id),I&&!L.structuralChanges?.includes(I)&&(L.structuralChanges??=[]).push(I),u.propertyChange&&(L.formattingLanguages=[...new Set([...L.formattingLanguages??[],...Qo(u)])],L.formattingChanges=[...new Map([...L.formattingChanges??[],...Zo(u)].map(te=>[JSON.stringify(te),te])).values()]),V&&!L.ranges.some(te=>te.partName===V.partName&&te.start.paragraphId===V.start.paragraphId&&te.start.offset===V.start.offset&&te.end.paragraphId===V.end.paragraphId&&te.end.offset===V.end.offset)&&L.ranges.push(V),x!=="structural"&&L.revisionKind==="structural"&&(L.revisionKind=x),(x==="insert"&&L.revisionKind==="delete"||x==="delete"&&L.revisionKind==="insert"||L.revisionKind==="replace")&&(L.revisionKind="replace"),L.readOnly||=u.refused||k,u.nesting>L.nesting&&(L.nesting=u.nesting),x==="delete"||x==="moveFrom"?L.deletedText+=y:x!=="format"&&x!=="paragraphMark"&&(L.text+=y);continue}l.set(T,{address:R,localName:u.node.localName,...I?{structuralChanges:[I]}:{},...u.propertyChange?{formattingLanguages:Qo(u),formattingChanges:Zo(u)}:{},revisionKind:x,...C?{markDirection:C}:{},author:p,...v===void 0?{}:{date:v},text:x==="format"||x==="paragraphMark"||x==="delete"||x==="moveFrom"?"":y,deletedText:x==="delete"||x==="moveFrom"?y:"",ranges:V?[V]:[],siteNodeIds:[u.node.id],nesting:u.nesting,readOnly:u.refused||k||O===void 0});}let c=[...l.values()].map(u=>Oe({kind:"revision",id:`${u.revisionKind}${u.revisionKind==="format"||u.revisionKind==="paragraphMark"?`-${u.localName}`:""}-${e.name}\0${ea(u.address)}`,address:u.address,addresses:[u.address],revisionKind:u.revisionKind,...u.revisionKind==="format"?{formattingKind:u.localName}:{},...u.structuralChanges?.length?{structuralChanges:u.structuralChanges}:{},...u.formattingChanges?.length?{formattingChanges:u.formattingChanges}:{},...u.formattingLanguages?.length?{formattingLanguages:u.formattingLanguages}:{},...u.markDirection?{markDirection:u.markDirection}:{},author:u.author,...u.date===void 0?{}:{date:u.date},text:u.revisionKind==="replace"?u.text:u.text||u.deletedText,replacedText:u.revisionKind==="replace"?u.deletedText:"",ranges:u.ranges,nesting:u.nesting,readOnly:u.readOnly,replyIds:[]},u.siteNodeIds)),m=t.deepOrder(e),f=Rd(e,c,n,r,m),h=Dd(f,m);return vu(vd(h,e,m,s),m)}function vu(e,t){let n=Dd(e,t),r=n.filter(l=>(l.revisionKind==="insert"||l.revisionKind==="delete")&&!l.readOnly&&l.ranges.length>0),o=new Set,i=new Map,a=new Map;for(let l of r){if(l.revisionKind!=="insert")continue;let d=l.ranges[0].start,c=`${d.paragraphId}\0${d.offset}`,m=a.get(c);m?m.push(l):a.set(c,[l]);}for(let l of r){if(l.revisionKind!=="delete"||o.has(l.id))continue;let d=l.ranges[l.ranges.length-1].end,c=a.get(`${d.paragraphId}\0${d.offset}`)??[],m=c.length>1?[...c].sort((f,h)=>(f.text.length>0?0:1)-(h.text.length>0?0:1)):c;for(let f of m){if(o.has(f.id)||f.author!==l.author)continue;o.add(l.id),o.add(f.id);let h=Eu(l.ranges[0],f.ranges[0],t)?l:f,u=wu(l.date,f.date);i.set(l.id,Oe({...h,id:`replace-${l.id}-${f.id}`,revisionKind:"replace",...u===void 0?{}:{date:u},addresses:Nu([...l.addresses,...f.addresses]),text:f.text,replacedText:l.text,ranges:[...l.ranges,...f.ranges],replacedRangeCount:l.ranges.length,readOnly:l.readOnly||f.readOnly},[...Z(l),...Z(f)]));break}}let s=[];for(let l of n){let d=i.get(l.id);if(d){s.push(d);continue}o.has(l.id)||s.push(l);}return s}function Dd(e,t){let n=e.filter(d=>(d.revisionKind==="insert"||d.revisionKind==="delete")&&!d.readOnly&&d.ranges.length>0);if(n.length<2)return e;let r=d=>`${d.paragraphId}\0${d.offset}`,o=new Map;for(let d of n){let c=`${d.revisionKind}\0${d.author}`,m=o.get(c);m?m.push(d):o.set(c,[d]);}let i=(d,c)=>{let m=d.ranges[0].start,f=c.ranges[0].start,h=(t.get(m.paragraphId)??0)-(t.get(f.paragraphId)??0);return h!==0?h:m.offset-f.offset};for(let d of o.values()){let c=true;for(let m=1;m<d.length&&c;m+=1)c=i(d[m-1],d[m])<=0;c||d.sort(i);}let a=new Set,s=new Map;for(let d of o.values()){let c=[],m="",f=()=>{if(c.length>1){s.set(c[0].id,bu(c));for(let h=1;h<c.length;h+=1)a.add(c[h].id);}c=[];};for(let h of d){let u=r(h.ranges[0].start);c.length>0&&u!==m&&f();let g=c.length===0;c.push(h),(g||Iu(h))&&(m=r(h.ranges[h.ranges.length-1].end));}f();}if(s.size===0)return e;let l=[];for(let d of e)a.has(d.id)||l.push(s.get(d.id)??d);return l}function Iu(e){return e.ranges.some(t=>t.start.paragraphId!==t.end.paragraphId||t.start.offset!==t.end.offset)}function bu(e){let t=e[0],n=[...t.addresses],r=[...t.ranges],o=[...Z(t)],i=t.text,a=t.date;for(let s of e.slice(1)){for(let l of s.addresses)n.some(d=>_d(d,l))||n.push(l);for(let l of s.ranges)r.push(l);for(let l of Z(s))o.push(l);i+=s.text,a=Su(a,s.date);}return Oe({...t,id:e.map(s=>s.id).join("+"),addresses:n,ranges:r,text:i,...a===void 0?{}:{date:a}},o)}function Su(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?e:r>n?t:e}function Nu(e){let t=[];for(let n of e)t.some(r=>_d(r,n))||t.push(n);return t}function _d(e,t){return e.id===t.id&&e.author===t.author&&(e.date??"")===(t.date??"")}function wu(e,t){if(t===void 0)return e;if(e===void 0)return t;let n=Date.parse(e),r=Date.parse(t);return Number.isNaN(n)||Number.isNaN(r)?t:n>r?e:t}function Eu(e,t,n){let r=n.get(e.start.paragraphId)??0,o=n.get(t.start.paragraphId)??0;return r!==o?r<o:e.start.offset<=t.start.offset}function Fd(e,t,n){let r=new Map(t.map(c=>[c.commentId,c])),o=new Map,i=new Map;for(let c of e)c.paraId&&o.set(c.paraId.toUpperCase(),c),i.set(c.id,c);let a=new Map,s=new Map;for(let c of e){let m=r.get(c.id);if(!m||m.orphaned||m.start.paragraphId===m.end.paragraphId&&m.start.offset===m.end.offset)continue;let f=`${m.start.paragraphId}:${m.start.offset}|${m.end.paragraphId}:${m.end.offset}`;a.has(f)?s.set(c.id,a.get(f)):a.set(f,c.id);}let l=new Map;for(let c of e){let m=c.paraId?n.get(c.paraId.toUpperCase()):void 0,f=m?.parentParaId?o.get(m.parentParaId):void 0,h=c.parentCommentId?i.get(c.parentCommentId):void 0,u=m===void 0?s.get(c.id):void 0,g=u?i.get(u):void 0,y=f??h??g;y&&y.id!==c.id&&l.set(c.id,y.id);}for(let c of [...l.keys()]){let m=new Set([c]),f=l.get(c);for(;f!==void 0;){if(m.has(f)){l.delete(c);break}m.add(f),f=l.get(f);}}let d=new Map;for(let[c,m]of l){let f=d.get(m);f?f.push(c):d.set(m,[c]);}return e.map(c=>{let m=r.get(c.id),f=c.paraId?n.get(c.paraId.toUpperCase()):void 0,h=l.get(c.id);return {kind:"comment",id:c.id,comment:c,range:m?{partName:m.partName,start:m.start,end:m.end}:null,resolved:f?.done??false,...h===void 0?{}:{parentId:h},replyIds:d.get(c.id)??[],orphaned:m===void 0||m.orphaned}})}function Tu(e){return Cu(e,Md)}function Cu(e,t){let n=[e.storyPart],r=new Set([e.storyPart.name]);for(let c of [...e.furnitureParts??[],...e.stylesPart?[e.stylesPart]:[]])r.has(c.name)||(r.add(c.name),n.push(c));let o=e.commentsPart?chunkANZ44KQT_cjs.Fh(e.commentsPart):[],i=e.commentsExtendedPart?chunkANZ44KQT_cjs.Gh(e.commentsExtendedPart):new Map,a=[],s=[],l=n.length===1?t.deepOrder(n[0]):new Map;for(let c of n){for(let h of Ad(c,t))a.push(h);for(let h of t.commentAnchors(c))s.push(h);if(n.length===1)continue;let m=l,f=m.size;for(let[h,u]of t.deepOrder(c))m.has(h)||m.set(h,f+u);}return Ld([...a,...Fd(o,s,i)]).sort((c,m)=>Tt(c,l)-Tt(m,l))}function Mu(e,t){if(e.kind!=="comment")return e;let n=e.replyIds??[],r=n.filter(i=>t.has(i)),o=e.parentId!==void 0&&!t.has(e.parentId);if(!o&&r.length===n.length)return e;if(o){let{parentId:i,parentRevisionId:a,...s}=e;return r.length===n.length?s:{...s,replyIds:r}}return {...e,replyIds:r}}function Cd(e){return `${e.partName}\0${e.start.paragraphId}:${e.start.offset}|${e.end.paragraphId}:${e.end.offset}`}function Ld(e){let t=new Set;for(let l of e)l.kind==="comment"&&t.add(l.id);let n=e.map(l=>Mu(l,t)),r=new Map;for(let l of n)if(l.kind==="revision")for(let d of l.ranges??[]){if(d.start.paragraphId===d.end.paragraphId&&d.start.offset===d.end.offset)continue;let c=Cd(d),m=l.nesting??0,f=r.get(c);(f===void 0||m>f.nesting)&&r.set(c,{id:l.id,nesting:m});}let o=new Map;for(let l of n)l.kind==="comment"&&l.replyIds&&l.replyIds.length>0&&o.set(l.id,l.replyIds);let i=l=>{let d=[],c=new Set([l]),m=[...o.get(l)??[]];for(;m.length>0;){let f=m.shift();c.has(f)||(c.add(f),d.push(f),m.push(...o.get(f)??[]));}return d},a=new Map,s=new Map;for(let l of n){if(l.kind!=="comment"||l.parentId!==void 0||l.orphaned||!l.range)continue;let d=r.get(Cd(l.range))?.id;if(d===void 0)continue;let c=[l.id,...i(l.id)];for(let f of c)s.set(f,d);let m=a.get(d);m?m.push(...c):a.set(d,c);}return n.map(l=>{if(l.kind==="revision"){let d=a.get(l.id)??[];return d.length===0&&(l.replyIds??[]).length===0?l:Oe({...l,replyIds:d},Z(l))}if(l.kind==="comment"){let d=s.get(l.id);if(d===void 0){if(l.parentRevisionId===void 0)return l;let{parentRevisionId:c,...m}=l;return m}return l.parentRevisionId===d?l:{...l,parentRevisionId:d}}return l})}var Au=256,Du=2e3,$d=/[\p{L}\p{N}_]/u;function ta(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r=0;r<e.length;r+=1){let o=e[r],i=o.toLowerCase();n+=i.length===1?i:o;}return n}function Ud(e,t,n){let r=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return !(r!==void 0&&$d.test(r)||o!==void 0&&$d.test(o))}function Bd(e){return typeof e=="string"&&e.length>0&&e.length<=256}function _u(e,t,n,r={}){let o={matches:[],truncated:false};if(!Bd(t)||e.length===0||n<=0)return o;let i=r.matchCase===true,a=r.wholeWord===true,s=i?t:ta(t),l=i?e:ta(e),d=Math.max(0,r.from??0),c=Math.min(e.length,r.to??e.length),m=[],f=l.indexOf(s,d);for(;f>=0;){let h=f+s.length;if(h>c)return {matches:m,truncated:false};if(!a||Ud(e,f,h)){if(m.length>=n)return {matches:m,truncated:true};m.push({start:f,length:s.length});}f=l.indexOf(s,h);}return {matches:m,truncated:false}}var Fu=new Set(["plainText","richText","date","dropDownList","comboBox","docPartList"]),Lu=96;function na(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunkANZ44KQT_cjs.fa&&e.localName===t}function $u(e){return e.kind==="textValue"&&e.value.trim()===""}function Uu(e){let t=[],n=(r,o,i)=>{if(r.kind==="textValue"||i>Lu)return;if(chunkANZ44KQT_cjs.zf(r)){let s=chunkANZ44KQT_cjs.Bf(r),l=chunkANZ44KQT_cjs.Kb(r);if(s&&l&&s.children.every($u)&&Fu.has(l.type)){t.push({control:r,content:s,kind:l.type,docPart:l.placeholderDocPart,inline:o});return}}let a=o||r.kind==="paragraph"||na(r,"p");for(let s of r.children)n(s,a,i+1);};return n(e,false,0),t}function Bu(e){return chunkANZ44KQT_cjs.Aj(e,"rPr",{kind:"runProperties",children:[chunkANZ44KQT_cjs.Aj(e,"rStyle",{attributes:[["val","PlaceholderText"]]})]})}function ju(e){let t=e.find(r=>r.kind==="paragraph"||na(r,"p"));if(!t||t.kind==="textValue")return null;let n=t.children.filter(r=>r.kind!=="paragraphProperties"&&!na(r,"pPr"));return n.length>0?n:null}function ra(e,t){let n=Uu(t.root);if(n.length===0)return t;let r=null,o=d=>{if(d!==void 0)return r??=chunkANZ44KQT_cjs.hg(e),r.find(c=>c.name===d)},i=chunkANZ44KQT_cjs.Ia(t,"paste"),a=new Set(chunkANZ44KQT_cjs.lb(t.root)),s={value:0},l=t;for(let[d,c]of n.entries()){let m=o(c.docPart),f=chunkANZ44KQT_cjs.nb(t,c.control),h=null;if(m){let P=m.blocks.map((p,k)=>chunkANZ44KQT_cjs.pb(chunkANZ44KQT_cjs.Hf(p,i),a,chunkANZ44KQT_cjs.vb(`${c.control.id}:placeholder:${d}:${k}`),s,f));h=c.inline?ju(P):P;}if(!h){let P=chunkANZ44KQT_cjs.Bj(i,chunkANZ44KQT_cjs.vj(c.kind),Bu(i));h=c.inline?[P]:[chunkANZ44KQT_cjs.pb(chunkANZ44KQT_cjs.Aj(i,"p",{kind:"paragraph",children:[P]}),a,chunkANZ44KQT_cjs.vb(`${c.control.id}:placeholder:${d}`),s,f)];}let u=chunkANZ44KQT_cjs.Cj(chunkANZ44KQT_cjs.Af(c.control),{showingPlaceholder:true},i),g={...c.content,children:h},y=c.control.children.map(P=>P.id===c.content.id?g:P.kind!=="textValue"&&P.localName==="sdtPr"?u:P),O=chunkANZ44KQT_cjs.Na(l,c.control.id,y);O.ok&&(l=O.part);}return l}function jd(e,t,n){let r=t.filter(a=>a.node.localName==="tblGridChange"&&n.has(a.node.id));if(!r.length)return new Set;let o=new Map;for(let a of t){if(!["trPrChange","tcPrChange","tblPrExChange"].includes(a.node.localName))continue;let s=a.parent;for(;s&&s.kind!=="table";)s=chunkANZ44KQT_cjs.La(e,s.id);if(!s)continue;let l=o.get(s.id)??[];l.push(a.node.id),o.set(s.id,l);}let i=new Set;for(let a of r){let s=a.parent&&chunkANZ44KQT_cjs.La(e,a.parent.id),l=s&&o.get(s.id);l?.some(d=>n.has(d))&&l.some(d=>!n.has(d))&&i.add(a.node.id);}return i}function Hu(e,t,n,r){let o=r??e.root,i=o.kind==="textValue"?e:{...e,root:o},a=dr(i),s=n===void 0?[...chunkANZ44KQT_cjs.Ni(i,chunkANZ44KQT_cjs.$i(i))]:[],l=s.length?[{op:"acceptAllRevisions",siteNodeIds:s,...r?{scopeRootId:r.id}:{}}]:[];if(n?.length===0||a.length===0)return {ops:l,result:{resolved:[],skipped:[...new Set(n??[])].map(S=>({key:S,reason:"unknown-revision"})),remaining:a.length}};let d=new Set(n??a.map(nn)),c=new Map(a.map(S=>[nn(S),S])),m=new Set;for(let S of d){let b=c.get(S);if(b)for(let M of Z(b))m.add(M);}let f=chunkANZ44KQT_cjs.$i(i),h=chunkANZ44KQT_cjs.Qi(o,f,m,t);for(let S of h.selected)m.add(S);for(let S of a){let b=Z(S);b.length&&b.every(M=>m.has(M))&&d.add(nn(S));}let u=chunkANZ44KQT_cjs.cj(o,f),g=new Map(f.map((S,b)=>[S.node.id,b])),y=f.map((S,b)=>b),O=S=>{for(;y[S]!==S;)y[S]=y[y[S]],S=y[S];return S},P=(S,b)=>{y[O(b)]=O(S);};for(let S of h.dependencies){let b=S.flatMap(M=>g.has(M)?[g.get(M)]:[]);for(let M of b)P(b[0],M);}let p=new Map;for(let S of a){let b=Z(S).flatMap(M=>{let X=g.get(M);return X===void 0?[]:[X]});for(let M of b)P(b[0],M);}let k=f.filter(S=>m.has(S.node.id)),v=new Set(chunkANZ44KQT_cjs.Vi(e,k,t).keys()),R=new Map;for(let[S,b]of f.entries()){if(t==="reject"&&b.propertyChange&&b.parent&&m.has(b.node.id))for(let X of b.parent.children)chunkANZ44KQT_cjs.Si(b.node.localName,X)||p.set(X.id,S);let M=t==="accept"?b.node.localName==="del"||b.node.localName==="moveFrom":b.node.localName==="ins"||b.node.localName==="moveTo";if(b.paragraphMark&&b.parent&&M&&!u.has(b.node.id)&&m.has(b.node.id)){let X=chunkANZ44KQT_cjs.La(e,b.parent.id),ee=X&&chunkANZ44KQT_cjs.La(e,X.id),se=ee&&chunkANZ44KQT_cjs.La(e,ee.id);if(X&&ee&&se){let z=R.get(se.id);z||(z=chunkANZ44KQT_cjs.Zi(se.children,v),R.set(se.id,z)),z.has(ee.id)&&p.set(X.id,S);}}if(m.has(b.node.id)&&chunkANZ44KQT_cjs.Wi(e,b,t)){let X=chunkANZ44KQT_cjs.Wi(e,b,t);X&&!b.refused&&p.set(X.id,S);}}for(let[S,b]of chunkANZ44KQT_cjs.Xi(e,k,t)){let M=chunkANZ44KQT_cjs.Ka(e,S),X=g.get(b[0]);if(!(M?.kind!=="tableCell"||X===void 0))for(let ee of M.children)ee.localName==="tcPr"&&p.set(ee.id,X);}let x=(S,b)=>{let M=g.get(S.id),X=p.get(S.id);M!==void 0&&X!==void 0&&P(X,M);let ee=M??X;ee!==void 0&&b!==void 0&&P(b,ee);let se=ee??b;if(S.kind!=="textValue")for(let z of S.children)x(z,se);};x(o);for(let S of chunkANZ44KQT_cjs.bj(o).values()){let b=S.wrappers.flatMap(M=>{let X=g.get(M.id);return X===void 0?[]:[X]});for(let M of b)P(b[0],M);}for(let S of f.some(b=>b.node.localName==="cellMerge")?chunkANZ44KQT_cjs.Yi(i):[]){let b=S.flatMap(M=>{let X=g.get(M);return X===void 0?[]:[X]});for(let M of b)P(b[0],M);}let C=new Map;for(let[S,b]of f.entries()){let M=O(S),X=C.get(M)??[];X.push(b),C.set(M,X);}let I=new Map;for(let[S,b]of C)b.some(M=>M.refused||t==="reject"&&M.propertyChange&&chunkANZ44KQT_cjs.Ui(M.node)===null)?I.set(S,"unsupported-revision"):b.some(M=>!m.has(M.node.id))&&I.set(S,"incomplete-group");for(let S of a)if(S.readOnly)for(let b of Z(S)){let M=g.get(b);M!==void 0&&I.set(O(M),"unsupported-revision");}let H=f.filter((S,b)=>m.has(S.node.id)&&!I.has(O(b))),D=false,J=chunkANZ44KQT_cjs.Vi(e,H,t);for(let[S,b]of J){if(p.has(S))continue;let M=g.get(b[0]);M!==void 0&&(p.set(S,M),D=true);}if(D){x(o);for(let[S,b]of [...I]){let M=O(S);I.get(M)!=="unsupported-revision"&&I.set(M,b);}}let V=[],T=[],L=new Set,te=new Set(chunkANZ44KQT_cjs.Mi(e,f,t));for(let S of te){let b=chunkANZ44KQT_cjs.La(e,S);for(;b;){if(J.has(b.id)){te.delete(S);break}b=chunkANZ44KQT_cjs.La(e,b.id);}}for(let S of d){let b=c.get(S);if(!b){T.push({key:S,reason:"unknown-revision"});continue}let M={key:S,author:b.author,partName:e.name,revisionKind:b.revisionKind},X=Z(b),ee;for(let se of X){let z=g.get(se);if(ee=z===void 0?"incomplete-group":I.get(O(z)),ee)break}if(X.length||(ee="unsupported-revision"),ee)T.push({key:S,reason:ee,revision:M});else {X.some(se=>te.has(se))?T.push({key:S,reason:"retained-structure",revision:M}):V.push(M);for(let se of X)te.has(se)||L.add(se);}}let de=jd(e,f,L),U=new Set;for(let S of a){let b=Z(S);if(S.formattingKind!=="tblGridChange"&&b.length>1)for(let M of b)de.has(M)&&U.add(M);}let B=[...L].filter(S=>!h.implicit.has(S)&&!U.has(S)),K=a.length-V.length;if(K>0&&B.length){let S={...e,root:{...e.root}},b=chunkANZ44KQT_cjs.dj(S,t,void 0,{siteNodeIds:B,...r?{scopeRootId:r.id}:{}});if(b.ok&&b.part){let M=r?chunkANZ44KQT_cjs.Ka(b.part,r.id):b.part.root;K=M&&M.kind!=="textValue"?dr({...b.part,root:M}).length:0;}}return {ops:L.size?[...l,{op:t==="accept"?"acceptAllRevisions":"rejectAllRevisions",siteNodeIds:B,...r?{scopeRootId:r.id}:{}}]:l,result:{resolved:V,skipped:T,remaining:K}}}function oa(e){return e.kind!=="textValue"}function cr(e,t){for(let n of e.children)if(oa(n)&&n.localName===t)return n;return null}function Vu(e,t){let n=[e];for(;n.length>0;){let r=n.pop();if(oa(r)){if(r.localName===t)return r;for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}}return null}var Wd=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Mt(e,t,n){let r=cr(e,t),i=(r?cr(r,n):null)?.attributes.find(a=>a.localName==="typeface")?.value;return i!==void 0&&Wd.test(i)?i:null}var Hd=new WeakMap;function zu(e){let t=e?Hd.get(e):void 0;if(t)return t;let n=e?Vu(e,"fontScheme"):null;if(!n)return Gd;let r=Object.freeze({major:Mt(n,"majorFont","latin"),minor:Mt(n,"minorFont","latin"),majorEastAsia:Mt(n,"majorFont","ea"),minorEastAsia:Mt(n,"minorFont","ea"),majorBidi:Mt(n,"majorFont","cs"),minorBidi:Mt(n,"minorFont","cs"),...Xu(n)});return e&&Hd.set(e,r),r}var Vd=new WeakMap,Gd=Object.freeze({major:null,minor:null,majorEastAsia:null,minorEastAsia:null});function aa(e,t=null){let n=e?zu(e):Gd,r=t?cr(t,"themeFontLang"):null;if(!r||!t)return n;let o=Vd.get(t);o||Vd.set(t,o=new WeakMap);let i=o.get(n);if(i)return i;let a=h=>r.attributes.find(u=>u.localName===h)?.value,s=zd(a("val")),l=zd(a("bidi")),d=a("eastAsia"),c=mr(d),m=(h,u,g)=>u&&(h?n.majorSupplemental:n.minorSupplemental)?.[u]||g||null,f=Object.freeze({major:m(true,s,n.major),minor:m(false,s,n.minor),majorEastAsia:m(true,c,n.majorEastAsia),minorEastAsia:m(false,c,n.minorEastAsia),majorBidi:m(true,l,n.majorBidi),minorBidi:m(false,l,n.minorBidi),...d===void 0?{majorSupplemental:n.majorSupplemental,minorSupplemental:n.minorSupplemental}:{}});return o.set(n,f),f}var Wu=new Map([["minorAscii",e=>e.minor],["minorHAnsi",e=>e.minor],["majorAscii",e=>e.major],["majorHAnsi",e=>e.major],["minorEastAsia",e=>e.minorEastAsia??null],["majorEastAsia",e=>e.majorEastAsia??null],["minorBidi",e=>e.minorBidi??null],["majorBidi",e=>e.majorBidi??null]]);function TP(e,t,n){if(e===void 0)return null;let r=Wu.get(e)?.(t)??null;if(r!==null)return r;let o=mr(n);return o?(e==="majorEastAsia"?t.majorSupplemental:e==="minorEastAsia"?t.minorSupplemental:void 0)?.[o]??null:null}function mr(e){if(!e||e.length>85)return null;let t=e.toLowerCase().split("-");return t[0]==="ja"?"Jpan":t[0]==="ko"?"Hang":t[0]!=="zh"?null:t.includes("hant")?"Hant":t.includes("hans")?"Hans":t.some(n=>["tw","hk","mo"].includes(n))?"Hant":"Hans"}var Gu=new Map([["ar","Arab"],["fa","Arab"],["ur","Arab"],["ps","Arab"],["he","Hebr"],["yi","Hebr"],["dv","Thaa"],["syr","Syrc"]]);function zd(e){if(!e||e.length>85)return null;let t=e.toLowerCase().split("-");return t[1]&&/^[a-z]{4}$/.test(t[1])?t[1][0].toUpperCase()+t[1].slice(1):mr(e)??Gu.get(t[0])??null}var Ku=new Map([["Hans","SimSun"],["Hant","PMingLiU"],["Jpan","MS Mincho"],["Hang","Batang"]]);function CP(e){return Ku.get(mr(e)??"")??null}function Xu(e){let t={};for(let[n,r]of [["majorFont","majorSupplemental"],["minorFont","minorSupplemental"]]){let o=Object.create(null);for(let i of cr(e,n)?.children??[]){if(!oa(i)||i.localName!=="font")continue;let a=i.attributes.find(l=>l.localName==="script")?.value,s=i.attributes.find(l=>l.localName==="typeface")?.value;a&&/^[A-Z][a-z]{3}$/.test(a)&&s&&Wd.test(s)&&(o[a]=s);}Object.keys(o).length&&(t[r]=Object.freeze(o));}return t}var ft=Object.freeze({styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"});function ia(e,t,n,r){let o=(e.relationships.get(t)??[]).find(i=>i.type===n);if(o){let i=chunkANZ44KQT_cjs.E(o);if(i.mode==="Internal"&&i.target.ok){let a=e.parts.get(i.target.partName);if(a)return a}}return e.parts.get(r)}function HP(e){let t=chunkANZ44KQT_cjs.le(e);if(!t.ok)return {ok:false,reason:t.reason,...t.detail?{detail:t.detail}:{}};let n=t.package.parts.get(t.package.mainDocumentPart);if(!n)return {ok:false,reason:"no-main-document-tree",detail:t.package.mainDocumentPart};let r=new Zt(t.package,ra(t.package,chunkANZ44KQT_cjs.qb(n)));return {ok:true,view:Yu(r)}}function Yu(e){let t=()=>e.currentPackage(),n=()=>e.bodyStore().part,r=(d,c)=>ia(t(),t().mainDocumentPart,d,c)?.root??null,o=Object.freeze(aa(null)),i=null,a=chunkANZ44KQT_cjs.Qh,s=null;return Object.freeze({part:n,currentPackage:t,packageRevision:()=>e.packageRevision,stylesRoot:()=>r(ft.styles,"/word/styles.xml"),numberingRoot:()=>r(ft.numbering,"/word/numbering.xml"),settingsRoot:()=>r(ft.settings,"/word/settings.xml"),documentThemeFonts(){let d=t();return i!==d&&(o=Object.freeze(aa(r(ft.theme,"/word/theme/theme1.xml"),r(ft.settings,"/word/settings.xml"))),i=d),o},documentProperties(){let d=t();if(s!==d){let c=ia(d,"/",ft.coreProperties,"/docProps/core.xml"),m=ia(d,"/",ft.extendedProperties,"/docProps/app.xml");a=chunkANZ44KQT_cjs.Rh(c?.root??null,m?.root??null),s=d;}return a},headerFooterPartsBySection:()=>chunkANZ44KQT_cjs.Pe(t()),headerFooterResolutionBySection:()=>chunkANZ44KQT_cjs.Oe(t()),relationshipTarget:d=>chunkANZ44KQT_cjs.mg(t(),n().name,d)})}
5
+ exports.$=ty;exports.$a=CP;exports.A=qr;exports.Aa=ar;exports.B=ac;exports.Ba=ud;exports.C=Vt;exports.Ca=lu;exports.D=Zr;exports.Da=du;exports.E=ic;exports.Ea=mu;exports.F=eo;exports.Fa=uu;exports.G=to;exports.Ga=qo;exports.H=no;exports.Ha=fd;exports.I=ro;exports.Ia=ox;exports.J=dc;exports.Ja=hd;exports.K=Yi;exports.Ka=sr;exports.L=zt;exports.La=Ex;exports.M=Bn;exports.Ma=dr;exports.N=jn;exports.Na=Fd;exports.O=es;exports.Oa=Tu;exports.P=qp;exports.Pa=Cu;exports.Q=qi;exports.Qa=Ld;exports.R=Cc;exports.Ra=Au;exports.S=vo;exports.Sa=Du;exports.T=Hs;exports.Ta=ta;exports.U=Io;exports.Ua=Ud;exports.V=ct;exports.Va=Bd;exports.W=Ll;exports.Wa=_u;exports.X=Zt;exports.Xa=ra;exports.Y=Ul;exports.Ya=Hu;exports.Z=Bl;exports.Za=aa;exports._=Do;exports._a=TP;exports.a=Ky;exports.aa=Fo;exports.ab=HP;exports.b=or;exports.ba=Wo;exports.bb=Yu;exports.c=Xy;exports.ca=Go;exports.d=Jo;exports.da=Bm;exports.e=Yy;exports.ea=jm;exports.f=Xd;exports.fa=Hm;exports.g=Vi;exports.ga=Vm;exports.h=Dn;exports.ha=zm;exports.i=st;exports.ia=Wm;exports.j=_n;exports.ja=td;exports.k=Fn;exports.ka=nd;exports.l=fe;exports.la=Ko;exports.m=Qd;exports.ma=Xo;exports.n=lt;exports.na=Km;exports.o=jt;exports.oa=Ym;exports.p=Ln;exports.pa=Jm;exports.q=Ht;exports.qa=qm;exports.r=$n;exports.ra=Qm;exports.s=Xr;exports.sa=Z;exports.t=Yr;exports.ta=nn;exports.u=Jr;exports.ua=Yo;exports.v=nc;exports.va=ld;exports.w=rc;exports.wa=Tt;exports.x=Qr;exports.xa=au;exports.y=Wi;exports.ya=zy;exports.z=oc;exports.za=Wy;