@docx-editor.dev/core 2.36.0 → 2.37.0-canary.20261110032710.sha-525df6f

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 (102) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +6 -6
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +11 -11
  6. package/dist/binding.js +1 -1
  7. package/dist/{chrome-print-B9U_PiqL.d.ts → chrome-print-BSsqYQtt.d.ts} +51 -19
  8. package/dist/chunk-36NJQDWI.cjs +31 -0
  9. package/dist/chunk-3OKDY5TX.cjs +3 -0
  10. package/dist/{chunk-I34OVDHO.cjs → chunk-4QLFADOG.cjs} +1 -1
  11. package/dist/chunk-6EGRB3J4.js +6 -0
  12. package/dist/chunk-6I6V2JDF.cjs +7 -0
  13. package/dist/chunk-77L2HX42.js +1 -0
  14. package/dist/chunk-ATU65CUF.cjs +32 -0
  15. package/dist/chunk-EB5XLX3A.js +4 -0
  16. package/dist/chunk-G7GO4CNK.cjs +2 -0
  17. package/dist/chunk-JK4HBRVP.js +7 -0
  18. package/dist/{chunk-D75AXVLG.cjs → chunk-JZXMWGF4.cjs} +1 -1
  19. package/dist/{chunk-HLMY6NFI.js → chunk-MLJJL4QG.js} +1 -1
  20. package/dist/chunk-MYNOUTWY.js +1 -0
  21. package/dist/{chunk-QTRRXJXQ.cjs → chunk-NPPHSBFT.cjs} +3 -3
  22. package/dist/{chunk-7ZSPY7WH.cjs → chunk-OTZNA6FP.cjs} +1 -1
  23. package/dist/chunk-Q3FUAUL4.js +31 -0
  24. package/dist/chunk-RFMMFHWX.cjs +6 -0
  25. package/dist/chunk-T6MYXF6V.js +32 -0
  26. package/dist/chunk-TTPQZXYS.js +3 -0
  27. package/dist/{chunk-4RDU6QVH.cjs → chunk-UMDB6PEV.cjs} +1 -1
  28. package/dist/{chunk-NTDLU6W6.cjs → chunk-UP5TM6T6.cjs} +1 -1
  29. package/dist/{chunk-2BVJFI6B.js → chunk-WMM772MS.js} +1 -1
  30. package/dist/chunk-XI5HK3TZ.js +282 -0
  31. package/dist/chunk-XMJFDVE2.js +4 -0
  32. package/dist/chunk-XPBKJQTG.cjs +282 -0
  33. package/dist/{chunk-VS2MXS62.js → chunk-YCOHPEF2.js} +1 -1
  34. package/dist/{chunk-IMTQS6N5.cjs → chunk-YVK3NMR6.cjs} +1 -1
  35. package/dist/{chunk-K3UKJU4K.js → chunk-YVLF7HBD.js} +1 -1
  36. package/dist/chunk-Z6NPBOE6.js +2 -0
  37. package/dist/chunk-ZY7HJR3R.cjs +4 -0
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +2 -2
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/contracts/document.d.ts +2 -2
  42. package/dist/contracts/editor.d.ts +8 -8
  43. package/dist/contracts/modules.d.ts +9 -9
  44. package/dist/contracts/types.d.ts +3 -3
  45. package/dist/{custom-node-writes-DqzeiTpY.d.ts → custom-node-writes-Buryuzow.d.ts} +2 -2
  46. package/dist/{document-protection-CGnc6WX7.d.ts → document-protection-Denp0lhl.d.ts} +1 -1
  47. package/dist/{drawing-graphic-kind-Dw4Qu9VA.d.ts → drawing-graphic-kind-DjGMFeSM.d.ts} +2 -2
  48. package/dist/{drawing-preview-package-BuFluWSg.d.ts → drawing-preview-package-LHyHuTVq.d.ts} +1 -1
  49. package/dist/{editor-CoU0Ipa9.d.ts → editor-B0xPJSXd.d.ts} +233 -9
  50. package/dist/editor.cjs +1 -1
  51. package/dist/editor.css +2 -2
  52. package/dist/editor.d.ts +309 -26
  53. package/dist/editor.js +1 -1
  54. package/dist/export.cjs +2 -2
  55. package/dist/export.d.ts +2 -2
  56. package/dist/export.js +1 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +1 -1
  60. package/dist/{layout-shaping-B7ifvgm-.d.ts → layout-shaping-CFTk9pWQ.d.ts} +1 -1
  61. package/dist/layout.cjs +1 -1
  62. package/dist/layout.d.ts +16 -14
  63. package/dist/layout.js +1 -1
  64. package/dist/{note-properties-CrO9A0Ju.d.ts → note-properties-C8_cURo1.d.ts} +1 -1
  65. package/dist/output.cjs +1 -1
  66. package/dist/output.d.ts +9 -9
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-C-LfGgrt.d.ts → protocol-CG_ybtKt.d.ts} +2 -2
  69. package/dist/{review-paragraph-order-gZ8-oIWd.d.ts → review-paragraph-order-3oV2aI2q.d.ts} +1 -1
  70. package/dist/{revision-projection-BAUauksK.d.ts → revision-projection-C9oujZwA.d.ts} +1 -1
  71. package/dist/{semantic-cell-selection--xgumqWx.d.ts → semantic-cell-selection-BiYMYlbf.d.ts} +2 -2
  72. package/dist/{semantic-interaction-B_AAT9S2.d.ts → semantic-interaction-BTba0_1e.d.ts} +1 -1
  73. package/dist/{semantic-paint-Cl4VyItm.d.ts → semantic-paint-B_xi9H5m.d.ts} +4 -4
  74. package/dist/{semantic-record-queries-BKX8sDqa.d.ts → semantic-record-queries-TdjLU-AU.d.ts} +1 -1
  75. package/dist/{semantic-records-DkDc4E1z.d.ts → semantic-records-C5qbT1sK.d.ts} +29 -5
  76. package/dist/store.cjs +1 -1
  77. package/dist/store.d.ts +12 -12
  78. package/dist/store.js +1 -1
  79. package/dist/{tree-op-types-BJTz6t_O.d.ts → tree-op-types-DzstjXTb.d.ts} +12 -2
  80. package/dist/{tree-package-fragment-DDV5xjSI.d.ts → tree-package-fragment-DLbxcboK.d.ts} +67 -65
  81. package/dist/{tree-session-contract-CAsZn-VN.d.ts → tree-session-contract-BiKgucBu.d.ts} +92 -11
  82. package/dist/{unsupported-elements-1Tj829Bk.d.ts → unsupported-elements-KboafN7A.d.ts} +1 -1
  83. package/package.json +2 -2
  84. package/dist/chunk-3DLIAAXE.js +0 -2
  85. package/dist/chunk-3KSO2I22.js +0 -4
  86. package/dist/chunk-4K5QXGVN.js +0 -31
  87. package/dist/chunk-5JHQHJRH.js +0 -3
  88. package/dist/chunk-5W6DLXVG.cjs +0 -3
  89. package/dist/chunk-6VTHQTM3.js +0 -1
  90. package/dist/chunk-7MOZVKCN.js +0 -282
  91. package/dist/chunk-BR7AQCGM.cjs +0 -31
  92. package/dist/chunk-DZO5K26E.js +0 -1
  93. package/dist/chunk-K5FZYV6Z.cjs +0 -32
  94. package/dist/chunk-MK4MO7RT.cjs +0 -7
  95. package/dist/chunk-N5RYSQN5.js +0 -4
  96. package/dist/chunk-O2AEJ5T4.js +0 -5
  97. package/dist/chunk-PSVIEQUU.js +0 -32
  98. package/dist/chunk-PXF5BBEK.cjs +0 -2
  99. package/dist/chunk-R42NW5FO.js +0 -7
  100. package/dist/chunk-TCWCSTAF.cjs +0 -282
  101. package/dist/chunk-XFDDD65J.cjs +0 -4
  102. package/dist/chunk-XTNY4DBY.cjs +0 -5
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkATU65CUF_cjs=require('./chunk-ATU65CUF.cjs'),chunkXPBKJQTG_cjs=require('./chunk-XPBKJQTG.cjs');var Gr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let l=i*2n;(l>t||l===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let c=r?-a:a,s=Number(c);if(!Number.isSafeInteger(s))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return s},gt=(e,t,n,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n)||n<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");if(e===0||n===0)return chunkATU65CUF_cjs.n(0);let o=e*n;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,c=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&c%2!==0))&&(c+=1),chunkATU65CUF_cjs.n(c===0?0:o<0?-c:c)}return chunkATU65CUF_cjs.n(Gr(BigInt(e)*BigInt(n),BigInt(t),r))},Cn=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>gt(i,a,o,r)},En=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var Ue=(e,t)=>e[t]<<8|e[t+1],vn=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Wr(e,t){let n=(c,s)=>c>=0&&c+s<=e.length;if(!n(0,12))return false;let a=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"&&n(12+t*4,4)?vn(e,12+t*4):0;if(!n(a,12))return false;let i=Ue(e,a+4);for(let c=0;c<i;c+=1){let s=a+12+c*16;if(!n(s,16))return false;if(!(e[s]===99&&e[s+1]===109&&e[s+2]===97&&e[s+3]===112))continue;let u=vn(e,s+8);if(!n(u,4))return false;let y=Ue(e,u+2);for(let m=0;m<y;m+=1){let p=u+4+m*8;if(!n(p,4))return false;if(Ue(e,p)===3&&Ue(e,p+2)===0)return true}return false}return false}var Ln=new WeakMap;function Bn(e,t){let n=Ln.get(e);return n===void 0&&(n=Wr(t,e.faceIndex),Ln.set(e,n)),n}function wn(e){let t="",n=false;for(let r=0;r<e.length;r+=1){let o=e.charCodeAt(r);o>=32&&o<=255?(t+=String.fromCharCode(61440+o),n=true):t+=e[r];}return n?t:e}var Kr=4096,Tn=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,Ge=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t,n){let r=chunkATU65CUF_cjs.t(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=Kr&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${Tn(t.fontSizeHalfPoints)}\0${Tn(t.bidiLevel)}\0`,i=t.context;return !i||i.before===""&&i.after===""?`${a}-${t.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t.text}`}clear(){this.#e.clear();}};function pe(e){try{let t=new URL(e);return t.username!==""||t.password!==""||t.search!==""||t.hash!==""?`${t.protocol}//${t.host}${t.pathname}\u2026`:e}catch{let t=e.search(/[?#]/);return t===-1?e:`${e.slice(0,t)}\u2026`}}function On(e){return e.replace(/[a-z][a-z0-9+.-]*:\/\/[^\s"')]+/gi,t=>pe(t))}function jr(e){if(typeof e!="string"&&!(e instanceof URL))throw new TypeError(`setHarfBuzzWasmUrl: expected a string or URL, received ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new TypeError("setHarfBuzzWasmUrl: expected a non-empty URL");throw new Error("setHarfBuzzWasmUrl is not supported by the CommonJS build, which loads the shaper from node_modules and finds its binary on disk. Import the ESM build instead.");}function An(e){return e instanceof Error&&/process\.getBuiltinModule/.test(e.message)}function In(e){return `the text shaper cannot start on this Node version: the ESM build reaches Node builtins through \`process.getBuiltinModule\`, added in Node 20.16.0 and 22.3.0. Upgrade Node; \`setHarfBuzzWasmUrl\` does not apply here. (${On(e instanceof Error?e.message:String(e))})`}function Mn(e){let t=On(e instanceof Error?e.message:String(e));return `the HarfBuzz WASM binary could not be loaded from ${"its bundled location"}. If this bundler does not emit \`new URL(..., import.meta.url)\` assets (esbuild, Bun, and library builds that inline dynamic imports), serve \`@docx-editor.dev/core/harfbuzz.wasm\` yourself, point \`setHarfBuzzWasmUrl\` from '@docx-editor.dev/core/layout' at it before creating an editor, and reload the page. (${t})`}function _n(e,t){let n=`expected HarfBuzz ${e}, loaded ${t}`;return `${n}. The bundled binary does not match this build of the engine.`}var ie=Object.freeze({name:"HarfBuzz",version:"15.0.0"}),be=null,Se=null;function xt(){return be?Promise.resolve():Se||(Se=import('harfbuzzjs').then(e=>{let t=e.versionString();if(t!==ie.version)throw new I("shapingLibraryMismatch",{diagnostic:_n(ie.version,t)});be=e;}).catch(e=>{throw Se=null,e instanceof I?e:An(e)?new I("unsupportedRuntime",{diagnostic:In(e),cause:e}):new I("wasmUnavailable",{diagnostic:Mn(e),cause:e})}),Se)}function Yr(){return be!==null}function $r(){if(!be)throw new I("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return be}var I=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},qr=16*1024*1024,Zr=1e6,Jr=1e6,Qr=1e6,eo=4,to=512,no=1024*1024,ro=16*1024*1024,oo=32*1024*1024,ao=64*1024*1024,io=64*1024*1024,so=1e6,co=1e6,lo=1e6,uo=64,po=4096,fo=4*1024*1024,mo=64*1024*1024,yo=64*1024*1024,ho=256*1024*1024,go=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),Pn=["cmap","head","hhea","hmtx","maxp"],So=(e,t)=>e[t]<<8|e[t+1],xo=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,bo=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?xo(e,12+t*4):0,Ro=(e,t)=>{let n=bo(e,t),r=So(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},Fo=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),Co=(e,t)=>{let n=chunkATU65CUF_cjs.l(e,t);if(!n.valid)return n;let r=Ro(e,t);for(let o of Pn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},bt=Co,G=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},Eo=(e,t,n)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,c=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)c+=t[i].advanceX,i+=1;let s=chunkATU65CUF_cjs.n(c);r.push({textStart:a,textEnd:n==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:s,caretEdges:Object.freeze([chunkATU65CUF_cjs.n(0),s]),fontSpan:0}),o=i;}return r},X=64,$=8,q=8,kn=32,Rt=X+2*$,vo=X+$+q,Lo=X+$+2*q,Bo=X+$+q,zn=X+8*$,Nn=X+8*q+$,wo=X+6*q+$,To=X+3*q+2*$,Oo=X+3*q,Re=e=>X+e.length*Uint16Array.BYTES_PER_ELEMENT,Ft=e=>Bo+Re(e),xe=e=>kn+e*$,Ao=(e,t)=>Rt+Re(e)+vo+Ft(t),Io=e=>zn+Re(e)+xe(e.length)+e.length*Nn,Mo=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return zn+Re(e.text)+xe(e.glyphs.length)+e.glyphs.length*Nn+xe(e.clusters.length)+e.clusters.length*wo+e.clusters.reduce((n,r)=>n+xe(r.caretEdges.length),0)+xe(e.fontSpans.length)+e.fontSpans.length*To+(e.exactAdvancesX===void 0?0:kn+e.exactAdvancesX.length*q)+Oo+[...t].reduce((n,r)=>n+Ft(r.path),0)},_o=(e,t)=>Rt+Re(e)+Lo+t,St=class{#e;#p;#f;#m;#y;#R;#h;#l=0;#F;#g;#S;#c;#x;#u;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#C=new Ge(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#b=0;#d;constructor(t,n){chunkATU65CUF_cjs.p(this),this.#e=t,this.#p=G(n.maxFontBytes??qr,"maximum font bytes",io),this.#f=G(n.maxInputUtf16??Zr,"maximum input UTF-16 code units",so),this.#m=G(n.maxCodepoints??Jr,"maximum input code points",co),this.#y=G(n.maxGlyphs??Qr,"maximum shaped glyphs",lo),this.#h=G(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=G(n.maxCachedFaces??eo,"maximum cached faces",uo),this.#F=G(n.maxCachedShapes??to,"maximum cached shape results",po),this.#g=G(n.maxOutlineBytes??no,"maximum outline bytes",fo),this.#S=G(n.maxCachedOutlineBytes??ro,"maximum cached outline bytes",mo),this.#c=G(n.maxShapedRunBytes??oo,"maximum shaped run bytes",yo),this.#x=G(n.maxCachedShapeBytes??ao,"maximum cached shape bytes",ho),this.#u=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#C.clear(),this.#a=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#v(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#u?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=chunkATU65CUF_cjs.j(t);for(let u of Pn)if(!o.has(u))throw new I("malformedFont",{diagnostic:`missing required ${u} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(Fo(n)),i=new this.#e.Face(a,t.faceIndex),c=new this.#e.Font(i),s=c.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(s.ascender)||!Number.isSafeInteger(s.descender)||!Number.isSafeInteger(s.lineGap))throw new I("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});c.setScale(i.upem,i.upem);let l={identity:t.identity,blob:a,face:i,font:c,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let u=this.#o.keys().next().value;if(u===void 0)break;this.#l-=this.#o.get(u).byteLength,this.#o.delete(u),this.#u?.(Object.freeze({kind:"evicted",identity:u}));}this.#o.set(t.identity,l),this.#l+=n.byteLength;}return this.#u?.(Object.freeze({kind:"created",identity:t.identity})),l}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=Ft(o);if(a>this.#g)throw new I("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),c=Ao(t.identity,o)+3*Rt+2*q;if(c>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+c>this.#S;){let u=this.#s.keys().next().value;if(u===void 0)break;this.#s.delete(u);let y=this.#i.get(u.identity);y.delete(u.glyphId),y.size===0&&this.#i.delete(u.identity),this.#a-=u.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let s=this.#i.get(t.identity);s||this.#i.set(t.identity,s=new Map);let l={outline:i,bytes:c,identity:t.identity,glyphId:n};return s.set(n,l),this.#s.set(l,void 0),this.#a+=c,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#E(t){if(t.length>this.#f)throw new I("textOverLimit",{limit:this.#f,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#m)throw new I("codepointsOverLimit",{limit:this.#m,actual:n})}}shape(t){if(!this.#d)throw new I("disposed");if(chunkATU65CUF_cjs.k(t.environment.font),t.environment.font.byteLength>this.#p)throw new I("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#E(t.text);let n=Io(t.text);if(n>this.#c)throw new I("shapedRunOverLimit",{limit:this.#c,actual:n});let r=chunkATU65CUF_cjs.r(t.environment),o=this.#C.keyOf(t,r),a=this.#n.get(o);if(a)return this.#b-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o),this.#n.set(o,a),a.stamp=++this.#b),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==ie.name||r.shapingLibrary.version!==ie.version)throw new I("shapingLibraryMismatch");if(r.normalization!=="none")throw new I("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new I("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new I("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new I("unsupportedFallback");let i=chunkATU65CUF_cjs.i(r.font),c=chunkATU65CUF_cjs.j(r.font);if([...go].some(p=>c.has(p))&&!c.has("glyf")&&!c.has("CFF "))throw new I("unsupportedColorFont");let s=t.text;this.#E(s);let l=t.context?.before??"",u=t.context?.after??"",y=chunkATU65CUF_cjs.o,m=Math.max(String(l).length,String(u).length);if(typeof l!="string"||typeof u!="string"||m>y)throw new I("textOverLimit",{limit:y,actual:m});try{let p=this.#v(r.font,i),{face:g,font:h}=p,d=this.#d;d.reset();let S=Bn(r.font,i)?wn:String,x=l+s+u,R=chunkATU65CUF_cjs.A(x)?chunkATU65CUF_cjs.B(p):void 0,L=A=>S(R?chunkATU65CUF_cjs.C(A,R):A);l||u?d.addText(L(l+s+u),l.length,s.length):d.addText(L(s)),d.setDirection(r.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),d.setScript(r.script),d.setLanguage(r.language),d.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let E=Object.entries(r.features).map(([A,k])=>new this.#e.Feature(A,k));if((r.features.kern??1)!==0)for(let[A,k]of chunkATU65CUF_cjs.x(l+s+u))E.push(new this.#e.Feature("kern",0,A,k));this.#t?.onShapeCall?.(),this.#e.shape(h,d,E);let M=d.getLength();if(M>this.#y)throw new I("glyphOverLimit",{limit:this.#y,actual:M});let B=d.getGlyphInfos(),v=d.getGlyphPositions(),w=Cn(g.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),_=En(g.upem,t.fontSizeHalfPoints,r.fixedPointScale),P=[],N=chunkATU65CUF_cjs.n(0),K=chunkATU65CUF_cjs.n(0),b=new Map,f=B.map((A,k)=>{let D=v[k],Y=R?.get(x.charCodeAt(A.cluster)),se=Y?.advance??D?.xAdvance??0;P.push(_(se));let ce=w(se),Nt=w(D?.yAdvance??0),Ee=Y?.glyph??A.codepoint,Ur={id:Ee,cluster:A.cluster-l.length,originX:N,originY:K,advanceX:ce,advanceY:Nt,offsetX:w(D?.xOffset??0),offsetY:w(D?.yOffset??0),outline:b.get(Ee)??(()=>{let Dt=this.#L(p,Ee);return b.set(Ee,Dt),Dt})()};return N=chunkATU65CUF_cjs.n(N+ce),K=chunkATU65CUF_cjs.n(K+Nt),Ur}),F=h.hExtents(),C=chunkATU65CUF_cjs.u({text:s,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:f,exactAdvancesX:P,clusters:Eo(s,f,r.direction),fontSpans:f.length===0?[]:[{glyphStart:0,glyphEnd:f.length,font:r.font,fallbackIndex:null}],metrics:{ascent:w(F.ascender),descent:w(-F.descender),lineGap:w(F.lineGap)}},r),T=Mo(C);if(T>this.#c)throw new I("shapedRunOverLimit",{limit:this.#c,actual:T});let O=_o(o,T);if(O>this.#x)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),C;for(;this.#n.size>=this.#F||this.#r+O>this.#x;){let A=this.#n.keys().next().value;if(A===void 0)break;let k=this.#n.get(A);this.#n.delete(A),this.#r-=k.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:C,bytes:O,stamp:++this.#b}),this.#r+=O,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),C}catch(p){throw p instanceof I?p:new I("malformedFont",{diagnostic:p instanceof Error?p.message:"HarfBuzz shaping failed"})}}},Ct=(e={})=>new St($r(),e);var Et=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),Di=Object.freeze({...Et,maxCachedShapes:4096});function Dn(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${chunkXPBKJQTG_cjs.f(new TextEncoder().encode(JSON.stringify(n)))}`}function Hn(e,t=Et){let n=e?.maxFontBytes??t.maxFontBytes;if(!Number.isSafeInteger(n)||n<=0||n>chunkATU65CUF_cjs.a)throw new RangeError(`Font shaping byte ceiling must be between 1 and ${chunkATU65CUF_cjs.a}`);return n===t.maxFontBytes?t:Object.freeze({...t,maxFontBytes:n})}function Un(e,t,n=false){let r=false,o=Object.freeze({shape(a){if(r)throw new I("disposed");let i=a.environment.font;if(chunkATU65CUF_cjs.k(i),i.byteLength>t.maxFontBytes)throw new I("fontOverLimit",{limit:t.maxFontBytes,actual:i.byteLength});return e.shape(a)},dispose(){r||(r=true,n&&e.dispose?.());}});return chunkATU65CUF_cjs.q(e)?chunkATU65CUF_cjs.p(o):o}var Po=Object.freeze({}),Gn=chunkATU65CUF_cjs.b,ko="16.0.0",zo="none",No=1e3,Do="halfToEven",Vn="cluster-edges-only",Ho="Latn",Uo=new Uint8Array(0);var Z=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Go(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,i=e.defaultFont,c=e.language;if(!Number.isSafeInteger(r)||r<=0||r>chunkATU65CUF_cjs.a)throw new Z(`Font byte ceiling must not exceed the engine hard maximum of ${chunkATU65CUF_cjs.a}`);let s=o.length,l=a?.length??0;if(s===0||s>chunkATU65CUF_cjs.b)throw new Z(`Font source count must be between 1 and ${chunkATU65CUF_cjs.b}`);if(l>Gn)throw new Z(`Font substitution count must not exceed ${Gn}`);let u=0,y=[];for(let g=0;g<s;g+=1){let h=o[g],d=h.request,S=h.availability,x=h.id,R=h.hash,L=h.faceIndex,E=S==="forbidden",M=E?Uo:h.bytes;if(!E){if(typeof x!="string"||x.length===0)throw new TypeError("Resolved font id must not be empty");let B;try{B=chunkATU65CUF_cjs.e(M);}catch{throw new Z(`Font source ${x} must provide genuine bytes`)}if(B>r)throw new Z(`Font source ${x} exceeds the per-font byte ceiling`);if(u+=B,u>chunkATU65CUF_cjs.c)throw new Z(`Font sources exceed the aggregate byte ceiling of ${chunkATU65CUF_cjs.c}`)}y.push(t&&chunkATU65CUF_cjs.g(h)!==void 0?h:Object.freeze({request:Object.freeze({family:d.family,weight:d.weight,style:d.style}),id:x,bytes:M,hash:R,faceIndex:L,...S?{availability:S}:{}}));}let m;if(a){m=[];for(let g=0;g<l;g+=1){let h=a[g],d=h.from,S=h.to,x=h.lineMetrics;m.push(Object.freeze({from:Object.freeze({family:d.family,weight:d.weight,style:d.style}),to:Object.freeze({family:S.family,weight:S.weight,style:S.style}),...x?{lineMetrics:Object.freeze({heightEm:x.heightEm,baselineEm:x.baselineEm})}:{}}));}}let p={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:m?Object.freeze(m):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:c};return Object.freeze(p)}function Wn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:chunkATU65CUF_cjs.h(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function Wo(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function Kn(e,t){let n=s=>({family:s.family,weight:s.weight,style:s.style}),r=t?e.sources:Wn(e.sources,s=>s.request),o=e.substitutions??[],a=t?o:Wn(o,s=>s.from),i={sources:r.map(s=>{let l=s.availability??"available",u={request:n(s.request),availability:l};if(l==="forbidden")return {...u,...t?{id:s.id,faceIndex:s.faceIndex,declaredHash:s.hash}:{}};let y=chunkATU65CUF_cjs.g(s);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...u,...t?{id:s.id}:{},faceIndex:s.faceIndex,declaredHash:s.hash,actualHash:y,byteLength:s.bytes.byteLength}}),substitutions:a.map(s=>({from:n(s.from),to:n(s.to),lineMetrics:s.lineMetrics?{heightEm:s.lineMetrics.heightEm,baselineEm:s.lineMetrics.baselineEm}:null})),defaultFont:Wo(e.defaultFont,t),language:e.language||"en"},c={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?c:{},...i}}var Ko=Symbol("prepared-layout-font-configuration"),We=new WeakMap;function Vo(e){return We.has(e)}function Xo(e){let t=We.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function Zi(e){let t=We.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function vt(e,t){return Xn(e,t,false)}function Ji(e,t){return Xn(e,t,true)}function Xn(e,t,n){let r=Go(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&chunkATU65CUF_cjs.g(y)!==void 0?y:chunkATU65CUF_cjs.f(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=Kn(o,true),c=a.encode(JSON.stringify(i)),s=Kn(o,false),l=a.encode(JSON.stringify(s)),u=Object.freeze({[Ko]:true,fingerprint:`font-config:${chunkXPBKJQTG_cjs.f(c)}`});return We.set(u,{configuration:o,sharedShapingFingerprint:`shared-font-config:${chunkXPBKJQTG_cjs.f(l)}`}),u}function jo(e){return vt(e).fingerprint}function Yo(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:Dn(t),ligatureCaretPolicy:Vn,fallback:chunkATU65CUF_cjs.sa}));return `shaping:${chunkXPBKJQTG_cjs.f(n)}`}async function jn(e,t,n,r,o=false){let i=Vo(e)?e:vt(e,t),c=Xo(i),{epoch:s,maxFontBytes:l,sources:u,substitutions:y,defaultFont:m}=c,p=c.language||"en",g=i.fingerprint,h=chunkATU65CUF_cjs.m({epoch:s,maxFontBytes:l,resources:u,substitutions:y,validateFont:bt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await xt();let d=Object.freeze({script:Ho,variationAxes:Object.freeze({}),shapingLibrary:ie,unicodeDataVersion:ko,normalization:zo,language:p,features:Po,...o?{documentLigatures:true}:{},fixedPointScale:No,roundingMode:Do});return Object.freeze({fonts:h,shaper:Un(n??Ct(r),r,n===void 0),defaultFont:m,environment:d,ligatureCaretPolicy:Vn,operation:Object.freeze({resourceEpoch:h.epoch,configEpoch:s,extensionFingerprint:g,shapingHash:Yo(d,r),producerVersion:1})})}async function $o(e,t,n){return jn(e,t,void 0,Hn(n))}async function Qi(e,t,n,r,o=false){return jn(e,r,t,n,o)}function qo(e){e.shaper.dispose?.();}function Lt(e){let t=new Set([0,e.text.length]);for(let r of chunkATU65CUF_cjs.ya(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Ke(e,t){return Lt(e).includes(t)}function Zo(e,t){return Ke(e,t)}function Jo(e,t,n){return n>=t&&Ke(e,t)&&Ke(e,n)}function Qo(e){let t=chunkATU65CUF_cjs.ya(e.text);return Lt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var wt="und";function Zn(){return typeof Intl.Segmenter=="function"}function ea(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${wt})`);return e}function Jn(){let e=new(ea())(wt,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var ta=/^[\p{L}\p{N}']$/u,na=/^\s$/u;function Yn(e){return ta.test(e)}function $n(e){return na.test(e)}function Bt(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Qn(e){let t=chunkATU65CUF_cjs.ya(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if($n(o.text)){let a=r+1;for(;a<t.length&&$n(t[a].text);)a+=1;n.push(Bt(t,r,a,false)),r=a;continue}if(Yn(o.text)){let a=r+1;for(;a<t.length&&Yn(t[a].text);)a+=1;n.push(Bt(t,r,a,true)),r=a;continue}n.push(Bt(t,r,r+1,false)),r+=1;}return n}function er(){return {segment:Qn}}function tr(e={}){let t=e.isIntlAvailable??Zn,n=e.createIntlBoundary??Jn,r=e.createFallbackBoundary??er;if(!t())return r();try{return n()}catch{return r()}}var qn;function nr(){return qn??=tr(),qn}function ra(e,t=nr()){return t.segment(e)}function oa(e,t){return t.map(n=>({graphemeFrom:chunkATU65CUF_cjs.Ca(e,n.utf16From),graphemeTo:chunkATU65CUF_cjs.Ca(e,n.utf16To),wordLike:n.wordLike}))}var rr={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},At=Object.keys(rr),or=At.filter(e=>rr[e]==="coarse-gate"),Ve=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},fe=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},aa={resourceEpoch:Ve,configEpoch:Ve,extensionFingerprint:fe,shapingHash:fe,producerVersion:Ve},ia=(e,t)=>{aa[t](e[t],t);},me=e=>{for(let t of At)ia(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},sa=(e,t)=>{let n=me(e),r=me(t),o=At.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},Tt=e=>{let t=e.map(({key:n,fingerprint:r})=>(fe(n,"resource dependency key"),fe(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},ca=e=>(Ve(e.revision,"revision"),fe(e.dependencyFingerprint,"dependencyFingerprint"),fe(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:Tt(e.resourceDependencies),...me(e)})),la=(e,t)=>{let n=Tt(e),r=Tt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],c=r[a];if(i?.key!==c?.key||i?.fingerprint!==c?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??c.key}}return null};function ua(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=la(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of or)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var Ot=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=ua(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:ca(r)});}evictEpoch(t){let n=me(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;or.some(c=>i[c]!==n[c])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=me(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(s=>n.get(s.key)!==s.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function ar(e){return e.projected===true?null:e.range}function pa(e,t,n,r=false){let{page:o,story:a,host:i,noteScopeId:c,noteAreaKind:s}=e,l=a==="header"||a==="footer"?u=>chunkATU65CUF_cjs.Ia(u,e.origin,{x:o.box.x,y:o.box.y}):void 0;chunkATU65CUF_cjs.Ra(i,(u,y)=>{let{textboxDepth:m,textboxOwner:p,textboxPath:g,storyOrigin:h}=y,d=m===0?a:"textbox";if(r&&u.marker&&!u.lines.some(S=>S.spans.length>0)){let S=u.lines[0];if(!S||!u.marker)return;let x={range:{paragraphId:u.paragraphId,start:S.range.start,end:S.range.start},text:"",props:[],style:u.marker.style,box:{...S.box,width:0}};n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+x.box.x,y:h.y+x.box.y,width:0,height:x.box.height}),noteScopeId:c,noteAreaKind:s,textboxDepth:m,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:u.paragraphId,line:S,span:x,sourceRange:null});return}for(let S of u.lines){let x=[...chunkATU65CUF_cjs.Ya(S)].sort((R,L)=>(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(L.paragraphId)??Number.MAX_SAFE_INTEGER));for(let R of x)for(let L of R.spans)n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+L.box.x,y:h.y+L.box.y,width:L.box.width,height:L.box.height}),noteScopeId:c,noteAreaKind:s,textboxDepth:m,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:R.paragraphId,line:S,span:L,sourceRange:ar(L)});}},e.origin,l);}function fa(e,t,n={}){let r=new Map(chunkATU65CUF_cjs.fb(e).map((o,a)=>[o,a]));chunkATU65CUF_cjs.Oa(e,o=>pa(o,r,t,n.spanlessMarkers===true));}var ya=1,ir=4,te=Object.freeze({top:0,right:0,bottom:0,left:0}),sr=new WeakMap;function ha(e,t){let n=ga(e);return n===te?t:chunkATU65CUF_cjs.Mf(t,n)}function ga(e){let t=e.vectorShape;if(!t)return te;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return te;let o=sr.get(t);if(o||(o=Sa(t),sr.set(t,o)),o===te)return te;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return te;let c=n>0?i.width/n:i.height/r,s=r>0?i.height/r:i.width/n,l=(m,p,g)=>{if(g<-1e-3)return 0;let h=m*p-Math.max(0,g);return Number.isFinite(h)&&h>0?h:0},u=e.kind==="inlineDrawing"&&e.placeholderGraphicKind===null,y={left:l(o.left,c,i.x-a.x),top:u?0:l(o.top,s,i.y-a.y),right:l(o.right,c,a.x+a.width-(i.x+i.width)),bottom:l(o.bottom,s,a.y+a.height-(i.y+i.height))};return y.left||y.top||y.right||y.bottom?Object.freeze(y):te}function Sa(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,c=(y,m)=>{r=Math.min(r,y),a=Math.max(a,y),o=Math.min(o,m),i=Math.max(i,m);},s=e.overflowVisible===true,l=s?1/0:ya,u=y=>y.x>=-l&&y.x<=t+l&&y.y>=-l&&y.y<=n+l;for(let y of e.components){if(s)for(let d of y.subpathsEmu)for(let S of d)c(S.x,S.y);let m=y.clipEmu?void 0:y.shadow;if(m){let d=1/0,S=1/0,x=-1/0,R=-1/0;for(let B of y.subpathsEmu)for(let v of B){let w=s?v.x:Math.max(0,Math.min(t,v.x)),_=s?v.y:Math.max(0,Math.min(n,v.y));d=Math.min(d,w),S=Math.min(S,_),x=Math.max(x,w),R=Math.max(R,_);}let L=chunkATU65CUF_cjs.Lf(m.blurEmu)*.75+(y.strokeHex!==null?Math.max(1,chunkATU65CUF_cjs.Lf(y.strokeWidthEmu))/2:0),E=chunkATU65CUF_cjs.Lf(m.dxEmu),M=chunkATU65CUF_cjs.Lf(m.dyEmu);d<=x&&(c(d+E-L,S+M-L),c(x+E+L,R+M+L));}if(y.strokeHex===null||y.strokeInset===true)continue;let p=Math.max(1,chunkATU65CUF_cjs.Lf(y.strokeWidthEmu))/2,g=l+Math.max(0,chunkATU65CUF_cjs.Lf(y.strokeOutsetEmu??0)),h=d=>d.x>=-g&&d.x<=t+g&&d.y>=-g&&d.y<=n+g;y.subpathsEmu.forEach((d,S)=>{let x=y.subpathsClosed?.[S]!==false,R=xa(d,x),L=x&&R.length>2?R.length:R.length-1,E=[];for(let B=0;B<L;B+=1){let v=R[B],w=R[(B+1)%R.length],_=Math.hypot(w.x-v.x,w.y-v.y),P={x:-(w.y-v.y)/_,y:(w.x-v.x)/_};if(E.push(P),!!ba(v,w,-g,t+g,-g,n+g))for(let N=0;N<2;N+=1){let K=J[N],b=v.x+(w.x-v.x)*K,f=v.y+(w.y-v.y)*K;c(b+P.x*p,f+P.y*p),c(b-P.x*p,f-P.y*p);}}if(!x&&E.length&&(y.strokeCap==="round"||y.strokeCap==="square")){for(let[B,v,w]of [[R[0],E[0],-1],[R[R.length-1],E[E.length-1],1]])if(h(B))if(y.strokeCap==="round")c(B.x-p,B.y-p),c(B.x+p,B.y+p);else {let _=B.x+w*v.y*p,P=B.y-w*v.x*p;c(_+v.x*p,P+v.y*p),c(_-v.x*p,P-v.y*p);}}let M=x&&R.length>2?E.length:E.length-1;for(let B=0;B<M;B+=1){let v=R[(B+1)%R.length];if(!h(v))continue;if(y.strokeJoin==="round"){c(v.x-p,v.y-p),c(v.x+p,v.y+p);continue}if(y.strokeJoin==="bevel")continue;let w=E[B],_=E[(B+1)%E.length],P=1+w.x*_.x+w.y*_.y;if(P<2/(ir*ir))continue;let N=w.y*-_.x- -w.x*_.y;if(N===0)continue;let K=N>0?-1:1;c(v.x+K*(w.x+_.x)*p/P,v.y+K*(w.y+_.y)*p/P);}});for(let d of y.arrowheadsEmu??[])if(!(!d[0]||!u(d[0])))for(let S of d)c(S.x,S.y);}return r>=0&&o>=0&&a<=t&&i<=n?te:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function xa(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var J=new Float64Array(2);function ba(e,t,n,r,o,a){let i=t.x-e.x,c=t.y-e.y;return J[0]=0,J[1]=1,Xe(-i,e.x-n)&&Xe(i,r-e.x)&&Xe(-c,e.y-o)&&Xe(c,a-e.y)}function Xe(e,t){if(e===0)return t>=0;let n=t/e;return e<0?J[0]=Math.max(J[0],n):J[1]=Math.min(J[1],n),J[0]<=J[1]}var Ra=new Map([["garamond",{family:"Garamond",em:cr(1765,539,0)}],["segoe ui",{family:"Segoe UI",em:cr(2210,514,0)}]]);function cr(e,t,n){return {heightEm:(e+t+n)/2048,baselineEm:(e+n)/2048}}function It(e){return e?Ra.get(e.trim().toLowerCase()):void 0}function je(e){let t=It(e.fontFamily);if(!t)return;let n=chunkATU65CUF_cjs.gc(e)/2*chunkATU65CUF_cjs.ra(e);return {height:t.em.heightEm*n,baseline:t.em.baselineEm*n}}var Fa=new Map([["roman","serif"],["swiss","sans"],["modern","mono"]]);function gs(e,t){return t==="fixed"?"mono":e?Fa.get(e):void 0}var Ca=new Map([["calibri","sans"],["arial","sans"],["helvetica","sans"],["verdana","sans"],["tahoma","sans"],["segoe ui","sans"],["aptos","sans"],["century gothic","sans"],["carlito","sans"],["cambria","serif"],["times new roman","serif"],["georgia","serif"],["garamond","serif"],["book antiqua","serif"],["palatino linotype","serif"],["caladea","serif"],["courier new","mono"],["consolas","mono"]]);function lr(e){let t=e.trim().toLowerCase(),n=Ca.get(t);if(n)return n;let r=t.split(/[\s_-]+/);if(r.includes("mono")||r.includes("monospace")||r.includes("courier"))return "mono";if(r.includes("sans"))return "sans";if(r.includes("serif")||r.includes("roman"))return "serif"}var Ss={serif:"Times New Roman",sans:"Arial",mono:"Courier New"};var Mt="Calibri, Carlito, Helvetica, Arial, sans-serif",Ea='"Times New Roman", "Liberation Serif", Tinos, serif',va='"Courier New", "Liberation Mono", Cousine, monospace',La='Batang, AppleMyungjo, "Noto Serif CJK KR", serif';function Ba(e,t=Mt,n){if(!e)return t;if(n?.(e))return La;let r=lr(e);return r==="serif"?Ea:r==="mono"?va:t}var Ls=new Map([["calibri","Carlito"]]),wa=65536,Ta=256;function ur(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function dr(e){let t=new Map,n=null,r=null,o=0,a=c=>{c.older?c.older.newer=c.newer:n=c.newer,c.newer?c.newer.older=c.older:r=c.older,c.older=null,c.newer=null;},i=c=>{c.older=r,c.newer=null,r?r.newer=c:n=c,r=c;};return {get(c){let s=t.get(c);if(s!==void 0)return s!==r&&(a(s),i(s)),s.value},set(c,s){let l=t.get(c);if(l){l.value=s,l!==r&&(a(l),i(l));return}let u={key:c,value:s,older:null,newer:null};for(t.set(c,u),i(u);t.size>e&&n;){let y=n;a(y),t.delete(y.key),o+=1;}},get size(){return t.size},get evictions(){return o}}}var pr=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function fr(e=null){return e!=null&&typeof e.measureText=="function"}function mr(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Mt,r=e.context??null;if(!fr(r))return null;let o=r;"textRendering"in o&&(o.textRendering="geometricPrecision");let a=dr(ur(e.maxWidthEntries,wa)),i=dr(ur(e.maxMetricsEntries,Ta)),c=e.fontAlias,s=new Map,l=m=>{let p=s.get(m);if(p!==void 0)return p;let g="The quick brown fox 0123",h=false;for(let d of ["monospace","serif"]){o.font=`32px ${d}`;let S=o.measureText(g).width;if(o.font=`32px "${m}", ${d}`,o.measureText(g).width!==S){h=true;break}}return s.set(m,h),h},u=m=>{let p=m.fontFamily&&pr.test(m.fontFamily)?m.fontFamily:null,g=p?c?.(p):void 0,h=g&&pr.test(g)?g:null,d=Ba(p,n,e.serifHangulFace),S=p?h?`"${h}", "${p}", ${d}`:`"${p}", ${d}`:n,x=m.bold?"bold":"normal",R=m.italic?"italic":"normal",L=m.smallCaps?"small-caps":"normal",E=m.fontSizePt*chunkATU65CUF_cjs.ra(m)*t;return `${R} ${L} ${x} ${E}px ${S}`},y=(m,p,g)=>m/t*(g.horizontalScalePercent/100)+p.length*g.characterSpacingPt;return {measure(m,p){if(m.length===0)return 0;let g=u(p),h=chunkATU65CUF_cjs.y(p,m),d=`${g}\0${h}\0${m}`,S=a.get(d);if(S!==void 0)return y(S,m,p);o.font=g,"fontKerning"in o&&(o.fontKerning=h?"normal":"none");let x=o.measureText(m).width;return a.set(d,x),y(x,m,p)},inkBounds(m,p){if(!m||m.length>2||p.shaping?.direction==="rtl"||chunkATU65CUF_cjs.ya(m).length!==1)return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=chunkATU65CUF_cjs.w(p)?"normal":"none");let g=o.textAlign,h=o.direction,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.direction="ltr"),d=o.measureText(m);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.direction=h);}let S=d.actualBoundingBoxLeft,x=d.actualBoundingBoxRight;if(S===void 0||x===void 0||!Number.isFinite(S)||!Number.isFinite(x))return;let R=p.horizontalScalePercent/(100*t);return {left:-S*R,right:x*R}},textOutline(m,p){if(!m||p.shaping?.direction==="rtl")return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=chunkATU65CUF_cjs.w(p)?"normal":"none");let g=o.textAlign,h=o.textBaseline,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.textBaseline="alphabetic"),d=o.measureText(m);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.textBaseline=h);}let S=[-(d.actualBoundingBoxLeft??NaN),-(d.actualBoundingBoxAscent??NaN),d.actualBoundingBoxRight??NaN,d.actualBoundingBoxDescent??NaN].map(M=>M/t);if(S.some(M=>!Number.isFinite(M)))return;let[x,R,L,E]=S;if(!(!(L>x)||!(E>R)))return {path:null,ink:{left:x,top:R,right:L,bottom:E}}},lineMetrics(m){let p=m.fontSizePt*chunkATU65CUF_cjs.ra(m),g=u(m),h=i.get(g);if(h)return h;let d=It(m.fontFamily),S=d&&!l(d.family)&&je(m);if(S)return i.set(g,S),S;let x=p*1.15,R=p*.8;o.font=g,"fontKerning"in o&&(o.fontKerning=chunkATU65CUF_cjs.w(m)?"normal":"none");let L=o.measureText("Hxg"),E=L.fontBoundingBoxAscent,M=L.fontBoundingBoxDescent;if(typeof E=="number"&&Number.isFinite(E)&&E>0&&(R=E/t,typeof M=="number"&&Number.isFinite(M)&&M>=0)){let v=(E+M)/t;v>0&&(x=Math.max(v,x));}x>0||(x=p*1.15);let B={height:x,baseline:R};return i.set(g,B),B}}}function Oa(e=1,t={}){let n=mr({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:chunkATU65CUF_cjs.ta(),producer:"fixed-measurer"}}function Aa(e){let t;return n=>{t===void 0&&(t=chunkATU65CUF_cjs.xd(e.pages)?.hosts??null);let r=t?.get(n);return r?chunkATU65CUF_cjs.vd(r.pageNumber,r.format):null}}function yr(e,t){let n=chunkATU65CUF_cjs.If(e,t.displayMode??chunkATU65CUF_cjs.mb),r=chunkATU65CUF_cjs.ae({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:chunkXPBKJQTG_cjs.tj(t.package,"footnote"),endnotesPart:chunkXPBKJQTG_cjs.tj(t.package,"endnote")}:void 0,a=chunkATU65CUF_cjs.we(n,r,o,t.package?chunkATU65CUF_cjs.te(t.package,e,n):void 0,t.displayMode??chunkATU65CUF_cjs.mb);return {blocks:n,notes:o,context:a}}function hr(e,t,n,r,o){for(let a of t){if(r.length>=chunkXPBKJQTG_cjs.Fn)return;if(n.tokenForParagraph(a.id)!==""&&chunkXPBKJQTG_cjs.In(e,a.id)===null)for(let i of chunkXPBKJQTG_cjs.Hn(a)){if(r.length>=chunkXPBKJQTG_cjs.Fn)return;if(!i.rewritable)continue;let c=chunkATU65CUF_cjs.id(i.instruction);if(c===null)continue;let s=n.liveValueOf(i.fieldNodeId,c);if(s===null&&o&&n.pageRefProjectionOf){let l=n.pageRefProjectionOf(i.fieldNodeId,c);if(l){let u=o(l.targetParagraphId);u!==null&&u.length>0&&chunkATU65CUF_cjs.wd(l.calibration,l.cached,u,Number.NaN)&&(s=u);}}s===null||s===i.cachedText||s.length>chunkXPBKJQTG_cjs.Gn||s.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:s});}}}function Ia(e,t){let{blocks:n,context:r}=yr(e,t);if(r===null)return null;let o=[];return hr(e,chunkATU65CUF_cjs.ld(chunkATU65CUF_cjs.Kc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function zs(e,t){let{notes:n,context:r}=yr(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:c}of a){if(!c)continue;let s=[];for(let l of chunkATU65CUF_cjs.ue(c,t.displayMode??chunkATU65CUF_cjs.mb)){if(s.length>=chunkXPBKJQTG_cjs.Fn)break;hr(c,chunkATU65CUF_cjs.ld(chunkATU65CUF_cjs.Kc(l)),r,s);}s.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:s}});}return o}function Ma(e){return e.box}function gr(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)gr(o,t);}function _a(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>chunkXPBKJQTG_cjs.ec*4)){for(let c of o.children)if(c.kind!=="textValue"){if(c.kind==="paragraph"){for(let s of r)t.get(s)?.push(c.id);n(c,c.id,i+1);continue}if(c.kind==="contentControl"){t.set(c.id,[]),r.push(c.id);let s=chunkXPBKJQTG_cjs.oc(c);s&&n(s,a,i+1),r.pop();let l=t.get(c.id);l&&l.length===0&&a!==null&&l.push(a);continue}n(c,a,i+1);}}},r=[];return n(e,null,0),t}function Pa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function ka(e,t){let n=chunkXPBKJQTG_cjs.sc(e.root);if(n.length===0)return za;let r=new Map;t.pages.forEach((i,c)=>{(l=>{for(let u of l){let y=new Set;gr(u,y);for(let m of y){let p=r.get(m)??[];p.push({pageIndex:c,box:Ma(u)}),r.set(m,p);}}})(i.fragments);});let o=_a(e.root),a=[];for(let i of n){let c=chunkXPBKJQTG_cjs.qc(i.node),s=[...i.ancestors.map(m=>chunkXPBKJQTG_cjs.qc(m).lock),c.lock],l=o.get(i.node.id)??[],u=new Map;for(let m of l)for(let p of r.get(m)??[]){let g=u.get(p.pageIndex);u.set(p.pageIndex,g?Pa(g,p.box):p.box);}let y=[...u.entries()].sort((m,p)=>m[0]-p[0]).map(([m,p])=>({pageIndex:m,...p}));a.push({controlId:i.node.id,type:c.type,level:chunkXPBKJQTG_cjs.rc(i.node),depth:i.depth,lock:c.lock,effectiveLock:chunkXPBKJQTG_cjs.vc(s),showingPlaceholder:c.showingPlaceholder,temporary:c.temporary,...c.tag===void 0?{}:{tag:c.tag},...c.alias===void 0?{}:{alias:c.alias},...c.id===void 0?{}:{id:c.id},...c.dataBinding===void 0?{}:{dataBinding:c.dataBinding},paragraphIds:l,fragments:y});}return a}var za=Object.freeze([]);var Na=4096;function Da(e,t=0){if(!(e instanceof Uint8Array)||!Number.isSafeInteger(t)||t<0||e.byteLength<12)return;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(h,d)=>Number.isSafeInteger(h)&&Number.isSafeInteger(d)&&h>=0&&d>=0&&h<=e.length-d,o=h=>n.getUint16(h,false),a=h=>n.getUint32(h,false),i=0,c=false;if(a(0)===1953784678){c=true;let h=a(4),d=a(8);if(![65536,131072].includes(h)||!d||t>=d||!r(12,d*4))return;i=a(12+t*4);}else if(t!==0)return;if(!r(i,12)||![65536,1330926671,1953658213].includes(a(i)))return;let s=o(i+4);if(!s||s>Na||!r(i+12,s*16))return;let l=new Map;for(let h=0;h<s;h++){let d=i+12+h*16,S=a(d),x=a(d+8),R=a(d+12);if(l.has(S)||!r(x,R))return;l.set(S,{offset:x,length:R});}let u=l.get(1751474532),y=l.get(1330851634);if(!u||u.length<20||!y||y.length<4)return;let m=o(u.offset+18),p=o(y.offset),g=n.getInt16(y.offset+2,false);if(!(m<16||m>16384||p>5||g<=0))return Object.freeze({faceIndex:t,collection:c,unitsPerEm:m,os2Version:p,xAvgCharWidth:g,averageAdvanceEm:g/m})}function Sr(e,t=Da){if(typeof e!="function"||typeof t!="function")return;let n=new WeakMap;return r=>{if(!chunkATU65CUF_cjs.fc(r))return;let o;try{o=e(r);}catch{return}if(!o||typeof o!="object"||o.substitution!==null||o.family.trim().toLowerCase()!==r.fontFamily?.trim().toLowerCase()||typeof o.hash!="string"||!/^sha256:[0-9a-f]{64}$/u.test(o.hash)||!Number.isSafeInteger(o.faceIndex)||o.faceIndex<0)return;let a=n.get(o);if(a===void 0&&(a=t(o.bytes,o.faceIndex)??null,n.set(o,a)),!a)return;let i=r.fontSizePt*a.averageAdvanceEm/2;return Number.isFinite(i)&&i>=0&&i<=r.fontSizePt?i:void 0}}var W=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Ha(e,t){let n=(i,c)=>i>=0&&i+c<=e.length;if(!n(0,12))return null;let r=Q(e,0)===1953784678;if(r&&!n(12+t*4,4))return null;let o=r?Q(e,12+t*4):0;if(!n(o,12))return null;let a=W(e,o+4);for(let i=0;i<a;i+=1){let c=o+12+i*16;if(!n(c,16))return null;if(Q(e,c)!==1668112752)continue;let s=Q(e,c+8);if(!n(s,4))return null;let l=null,u=null,y=W(e,s+2);for(let m=0;m<y;m+=1){let p=s+4+m*8;if(!n(p,8))return null;let g=W(e,p),h=W(e,p+2),d=s+Q(e,p+4);if(!n(d,2)||!(g===0||g===3&&(h===1||h===10)))continue;let x=W(e,d);x===12&&u===null&&(u=d),x===4&&l===null&&(l=d);}return u!==null?{format:12,offset:u}:l!==null?{format:4,offset:l}:null}return null}function Ua(e,t,n){let r=(u,y)=>u>=0&&u+y<=e.length,o=t.offset;if(t.format===12){if(!r(o,16))return false;let u=Q(e,o+12),y=0,m=Math.min(u,Math.floor((e.length-o-16)/12))-1;for(;y<=m;){let p=y+m>>>1,g=o+16+p*12,h=Q(e,g),d=Q(e,g+4);if(n<h)m=p-1;else if(n>d)y=p+1;else return Q(e,g+8)+(n-h)!==0}return false}if(n>65535||!r(o,14))return false;let a=W(e,o+6)>>>1,i=o+14,c=i+a*2+2,s=c+a*2,l=s+a*2;if(!r(l,a*2))return false;for(let u=0;u<a;u+=1){if(n>W(e,i+u*2))continue;let y=W(e,c+u*2);if(n<y)return false;let m=W(e,s+u*2),p=l+u*2,g=W(e,p);if(g===0)return (n+m&65535)!==0;let h=p+g+(n-y)*2;if(!r(h,2))return false;let d=W(e,h);return d!==0&&(d+m&65535)!==0}return false}var xr=new WeakMap;function br(e,t){let n=chunkATU65CUF_cjs.i(e),r=xr.get(e);return r===void 0&&(r=Ha(n,e.faceIndex),xr.set(e,r)),r?Ua(n,r,t):void 0}var Rr=new WeakMap;function Ga(e){let t=Rr.get(e);if(t!==void 0)return t;let n=chunkATU65CUF_cjs.i(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i=r.getUint16(a+4);for(let c=0;c<i;c++){let s=a+12+c*16;if(r.getUint32(s)!==1330851634)continue;let l=r.getUint32(s+8),u=r.getUint32(s+12);u>=86&&l<=n.byteLength-u&&r.getUint16(l)>=1&&(o=(r.getUint32(l+78)&1966080)!==0);break}return Rr.set(e,o),o}var Fr=1.3;function Cr(e,t,n,r,o,a=false){let i=n.height-r;if(!(Math.abs(i-t)<=o)&&!a||!Ga(e))return n;let s=a?i*Fr:Math.max(n.height,t*Fr),l=n.baseline-r;return {height:s,baseline:l+(s-i)/2}}var Wa=.89111328125,Ka=443/2048,Va=87/2048,Xa=1/2048,ja=new Set(["Arab","Hebr","Syrc","Thaa","Nkoo"]);function Er(e){return e.latinLane===void 0&&!ja.has(e.shaping?.script??"")}function vr(e,t,n,r,o,a=true){if(!a||r!==0||!(o>0)||e.trim().toLowerCase()!=="times new roman")return r;let i=(c,s)=>Math.abs(c/o-s)<=Xa;return i(t,Wa)&&i(n,Ka)?Va*o:r}var Ya=.5;function $a(e,t){if(t.fontFamily===null)return false;let n=e.substitution;return n!==null&&(n.lineMetrics!==void 0||!chunkXPBKJQTG_cjs.pe(n.requested.family,n.resolved.family))?false:e.family===t.fontFamily||chunkXPBKJQTG_cjs.pe(e.family,t.fontFamily)}function Lr(e,t,n,r,o){let a=new WeakMap;return (i,c)=>{let s=chunkATU65CUF_cjs.ra(c),l=a.get(i);l||(l=new Map,a.set(i,l));let u=chunkATU65CUF_cjs.gc(c),y=Er(c),m=$a(i,c),p=(y?u:-u)+(m?Ya:0),g=l.get(p);if(g)return s===1?g:{height:g.height*s,baseline:g.baseline*s};let h,d=true,S=i.substitution?.lineMetrics;if(S){let x=u/2;h={height:S.heightEm*x,baseline:S.baselineEm*x};}else try{let x=chunkATU65CUF_cjs.hc(e,t,i,c,""),R=x.metrics.ascent/t.fixedPointScale,L=x.metrics.descent/t.fixedPointScale,E=u/2,M=R+L,B=E*r,v=M>B?B/M:1,w=M*v,_=x.metrics.lineGap/t.fixedPointScale,P=Math.min(Math.max(0,vr(i.family,R,L,_,E,y)),w*o),N=w+P;N>0?h=Cr(i,E,{height:N,baseline:R*v+P},P,2/t.fixedPointScale,m):(h=n.lineMetrics(c),d=!1);}catch{h=n.lineMetrics(c),d=false;}return d?(l.set(p,h),s===1?h:{height:h.height*s,baseline:h.baseline*s}):h}}var _t=2048,qa=32,Za=new Map([["symbol",{ascent:2059,descent:450,advances:[512,682,1460,1024,1124,1706,1593,899,682,682,1024,1124,512,1124,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1124,1124,1124,909,1124,1479,1366,1479,1253,1251,1563,1235,1479,682,1292,1479,1405,1821,1479,1479,1573,1518,1139,1212,1251,1413,899,1573,1321,1628,1251,682,1767,682,1348,1024,1024,1292,1124,1124,1012,899,1067,842,1235,674,1235,1124,1124,1180,1067,1124,1124,1067,1124,1235,899,1180,1460,1405,1010,1405,1012,983,410,983,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,506,1124,342,1460,1024,1542,1542,1542,1542,2134,2021,1235,2021,1235,819,1124,842,1124,1124,1460,1012,942,1124,1124,1124,1124,2048,1235,2048,1348,1686,1405,1628,2021,1573,1573,1686,1573,1573,1460,1460,1460,1460,1460,1460,1460,1573,1460,1618,1618,1823,1686,1124,512,1460,1235,1235,2134,2021,1235,2021,1235,1012,674,1618,1618,1610,1460,786,786,786,786,786,786,1012,1012,1012,1012,0,674,561,1405,1405,1405,786,786,786,786,786,786,1012,1012,1012,0]}],["wingdings",{ascent:1841,descent:432,advances:[2048,2110,2344,2665,2752,1830,2492,938,2220,1826,2319,2319,2399,2399,2951,2956,2245,2751,1431,1431,1826,1135,1233,2196,1941,2208,1924,1825,1826,1826,1825,1863,1863,1203,1624,1381,1381,1929,1929,1124,1124,1826,1727,1727,1727,2275,1352,1739,2230,1819,1803,1332,1665,1529,1529,1480,1420,1627,1813,1826,1834,1825,2368,2159,1974,2233,1927,1911,1937,2099,1902,2245,2181,1597,2150,2603,1529,1951,1529,1825,1825,1825,1825,937,1529,2020,1825,1183,2171,2171,1825,1826,1826,1086,1086,0,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,2048,2048,2048,2048,2048,2048,2048,2048,641,937,641,1825,1825,1825,1825,1825,1951,937,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2146,2146,2146,2146,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2566,2566,1627,1627,1825,1825,1825,1825,1825,1825,2006,2006,1825,1825,1589,1589,1589,1589,2186,2186,1825,1825,1787,1787,1787,1787,1825,1825,1660,1660,2171,1660,1601,1601,1601,1601,987,789,1301,1609,1826,1826,2119]}],["wingdings 2",{ascent:1727,descent:432,advances:[2048,2110,2090,2073,2086,2344,2045,2220,989,1431,1431,1826,1431,1431,1826,1431,1431,1826,1431,1431,2320,2246,1826,1826,1826,2320,2170,2170,1381,1381,1938,1938,1938,1938,1928,1928,1928,1928,1047,1047,1047,1047,1178,1178,1178,1178,1826,1321,1568,1826,1826,1826,1826,1825,1825,1826,1826,2226,1727,1548,1579,984,1035,864,1018,2048,2048,2048,2048,2048,2048,2048,2048,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,0,1899,1899,1453,1453,1673,1332,1431,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2048,2048,542,740,1135,1825,1825,1825,1825,1825,1825,1825,542,740,1135,1825,1825,1825,1825,1825,1825,1825,1825,1825,624,764,903,1461,2020,2020,2020,2020,2020,542,641,740,1135,1529,1529,1085,1085,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1496,1825,0,0,0,0,0,0]}],["wingdings 3",{ascent:1900,descent:432,advances:[2048,1825,1825,1135,1135,1444,1444,1444,1444,1825,1825,1135,1135,1677,1677,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1825,1825,1455,1455,1455,1455,2010,2010,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2220,1825,1751,1114,1115,1660,1660,1930,1930,1930,1930,1924,1924,1924,1924,1930,1930,1931,1931,1825,1825,1232,1232,1444,1444,1444,1444,1825,1232,2005,2005,2005,2005,1801,1801,1801,1801,1801,1801,1801,1801,1085,1085,1825,0,1825,1825,1825,1825,1825,1627,1627,1825,1825,1825,1825,789,789,1825,1825,987,987,1825,1825,1184,1184,1825,1825,1579,1579,1825,1825,888,888,1825,1825,1381,1381,1825,1825,1875,1875,1825,1825,1825,1825,1825,1825,1825,789,592,493,394,1825,1825,1825,1825,1825,1085,1085,1381,1381,1628,1628,1184,1184,900,900,1825,1825,1019,1019,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1291,1291,1291,1291,1961,1961,1825,1825,1540,1540,1540,1540,2096,2096,1825,1825,1688,1688,1688,1688,2277,2277,1825,1825,1885,1885,1885,1885,543,543,1234,1234,766,766,1234,1234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],["webdings",{ascent:1638,descent:410,advances:[1024,2048,2048,2048,2048,2028,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1100,1100,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1144,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,0,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2500,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1377,1377,2048,1726,1058,2048,2048,2048,2048,877,1240,2048,2048,2048,2048,1357,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2645,2048,2048,2048,2048]}]]);function Ja(e){if(chunkXPBKJQTG_cjs.b(e))return Za.get(e.toLowerCase())}function Br(e,t,n,r){let o=chunkATU65CUF_cjs.gc(r)/2*chunkATU65CUF_cjs.ra(r)*(r.horizontalScalePercent/100)/_t,a=[];for(let i=0;i<n.length;i++){let c=chunkXPBKJQTG_cjs.c(n.charCodeAt(i),t),s=c===null?0:e.advances[c-qa]??0;if(s===0)return;a.push(s*o+r.characterSpacingPt);}return a}function wr(e){let t=new WeakMap,n=r=>{let o=t.get(r);return o===void 0&&(o=Ja(r.fontFamily)??null,t.set(r,o)),o};return {...e,measure(r,o){let a=n(o),i=a&&Br(a,o.fontFamily,r,o);if(!i)return e.measure(r,o);let c=0;for(let s of i)c+=s;return c},caretAdvances(r,o){let a=n(o),i=a&&Br(a,o.fontFamily,r,o);if(!i)return e.caretAdvances?.(r,o);let c=[0];for(let s of i)c.push(c[c.length-1]+s);return c},lineMetrics(r,o){let a=n(r);if(!a)return e.lineMetrics(r,o);let i=chunkATU65CUF_cjs.gc(r)/2*chunkATU65CUF_cjs.ra(r);return {height:(a.ascent+a.descent)*i/_t,baseline:a.ascent*i/_t}}}}var Qa={M:2,L:2,Q:4,C:6,Z:0},Tr=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)};function Pt(e,t,n){if(!(t>0)||!(n>0))return;let r=[],o=0,a=1/0,i=-1/0,c=1/0,s=-1/0;for(let l of e.glyphs){if(l.id===0)return;let u=l.outline.path,y=l.outline.unitsPerEm;if(!u)continue;if(!(y>0)||!u.startsWith("M")||/[^MLQCZ0-9eE+.,\s-]/u.test(u))return;let m=t*(l.drawScale??1)/y,p=(l.originX+l.offsetX)/n,g=(l.originY+l.offsetY)/n;for(let h of u.matchAll(/([MLQCZ])([^MLQCZ]*)/gu)){let d=h[1],S=h[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(S.length!==Qa[d]||S.some(R=>!Number.isFinite(R)))return;let x=d;for(let R=0;R<S.length;R+=2){let L=p+S[R]*m,E=-(g+S[R+1]*m);a=Math.min(a,L),i=Math.max(i,L),c=Math.min(c,E),s=Math.max(s,E),x+=`${R?" ":""}${Tr(L)} ${Tr(E)}`;}if(o+=x.length,o>2e6)return;r.push(x);}}if(!(!r.length||!(i>a)||!(s>c)))return Object.freeze({path:r.join(""),ink:Object.freeze({left:a,top:c,right:i,bottom:s})})}var kt=new WeakMap;function ei(e){let t=kt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let c of a){let s=c[1]==="Z"?0:c[1]==="C"?6:c[1]==="Q"?4:2,l=c[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(l.length!==s||l.some(u=>!Number.isFinite(u))){kt.set(e,null);return}for(let u=0;u<l.length;u+=2)r=Math.min(r,l[u]),o=Math.max(o,l[u]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return kt.set(e,i??null),i}function Or(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let c of e.glyphs){if(c.id===0)return;let s=ei(c.outline),l=c.outline.unitsPerEm;if(!s||!(l>0))return;let u=(c.originX+c.offsetX)/n;o=Math.min(o,u+s.left*t*(c.drawScale??1)/l),a=Math.max(a,u+s.right*t*(c.drawScale??1)/l);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}var ri=1,oi=1;function Ar(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=chunkATU65CUF_cjs.jc(r,n,t);if(o===null)return null;let a=chunkATU65CUF_cjs.kc(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let c=chunkATU65CUF_cjs.kc(r,n,o,1330851634,30);if(c===null)return null;let s=r.getInt16(c+26)/i,l=r.getInt16(c+28)/i;return !(s>0)||s>ri||!(Math.abs(l)<=oi)?null:{offsetEm:l,thicknessEm:s}}var ai=.5,ii=4096,si=4,Ir=4096;function Mr(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o}=e,a=wr(e.fallback),i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},c=new WeakMap,s=new WeakMap,l=chunkATU65CUF_cjs.q(r),u=Lr(r,i,a,si,ai),y=new WeakMap,m=new WeakMap,p=new Array(Ir),g=0,h=(b,f,F)=>{let C=p[g];C&&C.cache.delete(C.text),b.set(f,F),p[g]={cache:b,text:f},g=(g+1)%Ir;},d=b=>{let f=y.get(b);if(f!==void 0)return f;let F=o(b);return y.set(b,F),F},S=Sr(d),x=(b,f,F)=>{let C=F?s:c,T=C.get(b);T||(T=new Map,C.set(b,T));let O=T.get(f);return O||(O=new Map,T.set(f,O)),O},R=new WeakMap,L=b=>{if(!b.shaping?.wordSpacingPt)return b;let f=R.get(b);return f||(f={...b,shaping:{...b.shaping,wordSpacingPt:void 0}},R.set(b,f)),f},E=(b,f)=>f.shaping?.wordSpacingPt?chunkATU65CUF_cjs.cc(b)*f.shaping.wordSpacingPt:0,M=(b,f)=>a.measure(b,L(f))+E(b,f),B=(b,f)=>{let F=Math.max(0,a.measure(b,L(f))),C=a.caretAdvances?.(b,L(f))??chunkATU65CUF_cjs.ac(b,F);if(!C||C.length!==b.length+1)return chunkATU65CUF_cjs.ac(b,M(b,f));let T=Math.max(0,M(b,f)),O=0,A=0;return C.map((k,D)=>{if(D===0)return 0;b[D-1]===" "&&A++;let Y=k+A*(f.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(T,Number.isFinite(Y)?Y:O)),D===b.length?T:O})},v=b=>chunkATU65CUF_cjs.oc(b)*(b.horizontalScalePercent/100),w=(b,f,F)=>M(b,f)+(F?chunkATU65CUF_cjs.rc(b).length*v(f):0),_=(b,f,F)=>{let C=B(b,f);return C&&F?chunkATU65CUF_cjs.tc(C,chunkATU65CUF_cjs.rc(b),v(f)):C},P=new WeakMap,N=new WeakMap;return chunkATU65CUF_cjs.ec({hasResolvedFont(b){return d(b)!==null},syntheticBold(b){let f=d(b);return f!==null&&chunkATU65CUF_cjs.nc(b,f)},faceCovers(b,f){let F=d(f);if(!F)return;let C=N.get(F);C||(C=new Map,N.set(F,C));let T=C.get(b);if(T!==void 0)return T;let O=true;for(let A of b){let k=br(F,A.codePointAt(0));if(k===void 0)return;if(!k){O=false;break}}return C.size<ii&&C.set(b,O),O},strikeoutMetrics(b){let f=d(b);if(!f)return;let F=P.get(f);if(F===void 0&&(F=Ar(f.bytes,f.faceIndex),P.set(f,F)),!F)return;let C=chunkATU65CUF_cjs.gc(b)/2*chunkATU65CUF_cjs.ra(b);return {offsetPt:F.offsetEm*C,thicknessPt:F.thicknessEm*C}},measure(b,f){if(b.length===0)return 0;let F=d(f);if(!F)return M(b,f);let C=x(F,chunkATU65CUF_cjs.gc(f),f.smallCaps),T=f.shaping?.context,O=f.shaping?`1:${JSON.stringify(T?[f.shaping.script,f.shaping.direction,b,T.before,T.after]:[f.shaping.script,f.shaping.direction,b])}`:`0:${b}`,A=chunkATU65CUF_cjs.nc(f,F),k=`${chunkATU65CUF_cjs.w(f)?1:0}:${A?1:0}:${chunkATU65CUF_cjs.O(f)}:${O}`,D=C.get(k);if(D===void 0){let Y=0;try{if(f.smallCaps&&!chunkATU65CUF_cjs.ic(r,i,F,f,m))return w(b,f,A);let se=chunkATU65CUF_cjs.hc(r,i,F,f,b);if(se.glyphs.some(ce=>ce.id===0))return w(b,f,A);for(let ce of se.glyphs)Y+=ce.advanceX;A&&(Y+=chunkATU65CUF_cjs.pc(se)*(chunkATU65CUF_cjs.gc(f)/2)*chunkATU65CUF_cjs.lc*i.fixedPointScale);}catch{return w(b,f,A)}D=Y/i.fixedPointScale,h(C,k,D);}return D*chunkATU65CUF_cjs.ra(f)*(f.horizontalScalePercent/100)+b.length*f.characterSpacingPt+E(b,f)},inkBounds(b,f){if(!b||b.length>2||f.shaping?.direction==="rtl"||chunkATU65CUF_cjs.ya(b).length!==1)return;let F=d(f);if(!F)return a.inkBounds?.(b,f);try{if(f.smallCaps&&!chunkATU65CUF_cjs.ic(r,i,F,f,m))return a.inkBounds?.(b,f);let C=chunkATU65CUF_cjs.hc(r,i,F,f,b);return Or(C,chunkATU65CUF_cjs.gc(f)/2,i.fixedPointScale,chunkATU65CUF_cjs.ra(f)*f.horizontalScalePercent/100)}catch{return}},textOutline(b,f){let F=d(f);if(!F)return a.textOutline?.(b,f);try{let C=chunkATU65CUF_cjs.hc(r,i,F,f,b);return Pt(C,chunkATU65CUF_cjs.gc(f)/2,i.fixedPointScale)??a.textOutline?.(b,f)}catch{return a.textOutline?.(b,f)}},caretAdvances(b,f){let F=d(f);if(!F)return B(b,f);let C=chunkATU65CUF_cjs.nc(f,F);try{if(f.smallCaps&&!chunkATU65CUF_cjs.ic(r,i,F,f,m))return _(b,f,C);let T=chunkATU65CUF_cjs.hc(r,i,F,f,b);if(T.glyphs.some(A=>A.id===0))return _(b,f,C);let O=chunkATU65CUF_cjs.bc(b,T,chunkATU65CUF_cjs.ra(f)*(f.horizontalScalePercent/100)/i.fixedPointScale,f.characterSpacingPt,f.shaping?.wordSpacingPt??0)??chunkATU65CUF_cjs.ac(b,T.glyphs.reduce((A,k)=>A+k.advanceX,0)*chunkATU65CUF_cjs.ra(f)*(f.horizontalScalePercent/100)/i.fixedPointScale+b.length*f.characterSpacingPt+E(b,f));return !O||!C?O:chunkATU65CUF_cjs.tc(O,chunkATU65CUF_cjs.qc(T),v(f))}catch{return _(b,f,C)}},lineMetrics(b,f){let F=d(b);if(!F)return je(b)??a.lineMetrics(b,f);if(!f||/^[\t\n\r\f ]*$/.test(f))return u(F,b);if(l){let C=u(F,b),T=Math.max(0,C.baseline),O=Math.max(0,C.height-C.baseline);return T+O>0?{height:T+O,baseline:T}:C}try{let C=chunkATU65CUF_cjs.hc(r,i,F,b,f),T=0,O=0;for(let A of C.fontSpans){let k=u(A.font,b);T=Math.max(T,k.baseline),O=Math.max(O,k.height-k.baseline);}if(T+O>0)return {height:T+O,baseline:T}}catch{}return u(F,b)}},S)}function ci(e,t){return Mr({...t,shaper:e.shaper,environment:e.environment})}function li(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let s of t.pages)r.add(s.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,c=-1;for(let s of t.pages){let l=s.box.y;l+s.box.height>=n.top&&l<=a&&(i===-1&&(i=s.index),c=s.index);}if(i===-1){let s=ui(t,n.top);s!==null&&(i=s,c=s);}if(i!==-1){let s=Math.max(0,i-o),l=Math.min(t.pages.length-1,c+o);for(let u=s;u<=l;u+=1)r.add(u);}for(let s of e.pinnedPages??[])s>=0&&s<t.pages.length&&r.add(s);return r}function ui(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var _r=["text-local","paragraph-local","flow-structural","global"];function Pr(e,t){return _r.indexOf(t)>_r.indexOf(e)?t:e}function di(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function pi(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,c=null,s=0,l=0;function u(d){let S=e.runCooperatively;if(!S)return t(d);let x=S(d);c=x;try{for(;;){let R=x.step();if(R)return R;if(n()!==d.revision)return x.cancel(),l+=1,null;if(c!==x)return null}}finally{c===x&&(c=null);}}function y(d){let S=p(n());S.impact=Pr(S.impact,d.impact),S.structural=S.structural||d.structural;for(let x of d.paragraphIds)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x);for(let x of d.deleted)S.deleted.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);}let m=d=>({impact:d.impact,paragraphIds:d.paragraphIds,created:d.created,deleted:d.deleted,dependencyKeys:d.dependencyKeys,structural:d.structural,revision:d.revision});function p(d){return a||(a=di(d)),a.revision=Math.max(a.revision,d),a}function g(){!o||i||(i=o(()=>{i=null,h();}));}function h(){i&&(i(),i=null),c&&(c.cancel(),c=null,l+=1);let d=a;if(!d)return false;a=null;let S=m(d),x=u(S);return !x||x.revision!==n()?(s+=1,y(S),g(),false):(r(x,S),true)}return {notify(d){let S=p(n());S.impact=Pr(S.impact,d.impact);for(let x of d.dirty)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x),S.paragraphIds.add(x);for(let x of d.deleted)S.deleted.add(x),S.paragraphIds.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);for(let x of d.splitJoin)S.structural=true,"split"in x?(S.paragraphIds.add(x.split.from),S.paragraphIds.add(x.split.tail)):(S.paragraphIds.add(x.join.kept),S.paragraphIds.add(x.join.removed));(d.impact==="flow-structural"||d.impact==="global")&&(S.structural=true),g();},invalidateAll(d,S){let x=p(d);x.impact="flow-structural",x.structural=true,S&&x.dependencyKeys.add(S),g();},flush:h,pending:()=>a?m(a):null,cancel(){i?.(),i=null,c?.cancel(),c=null,a=null;},get staleDiscards(){return s},get cancelledRuns(){return l}}}var kr=new WeakMap;function j(e){let t=kr.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(s,l,u,y)=>{for(let m of s){if(m.kind==="paragraph")continue;let p=m.tableId;a.set(p,Math.max(a.get(p)??0,(m.columnEdges?.length??1)-1));let g=o.get(p);g||(g=new Map,o.set(p,g),n.set(p,[]),r.set(p,new Map));for(let h of m.rows){let d=g.get(h.id);d===void 0&&(d=g.size,g.set(h.id,d),r.get(p).set(d,h.cells));for(let S of h.cells)n.get(p).push({pageIndex:l,tableId:p,row:h,cell:S,rowIndex:d,isHeaderRepeat:h.isHeaderRepeat,offsetX:u,offsetY:y}),i(S.blocks,l,u,y);}}};for(let s of e.pages){i(s.fragments,s.index,0,0);for(let l of [s.header,s.footer])l&&i(l.fragments,s.index,l.box.x-s.contentBox.x,l.box.y-s.contentBox.y);for(let l of [s.footnotes,s.endnotes])if(l)for(let u of l.notes)i(u.fragments,s.index,u.box.x-s.contentBox.x,u.box.y-s.contentBox.y);}let c=new Map;for(let[s,l]of n)c.set(s,{placed:l,rows:r.get(s)??new Map,columnCount:a.get(s)??0});return kr.set(e,c),c}function Nr(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,ne(r).to+1);return t}var ne=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function fi(e,t,n){if(t.tableId!==n.tableId)return null;let r=j(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min(ne(t).from,ne(n).from),c=Math.max(ne(t).to,ne(n).to),s=p=>{let{from:g,to:h}=ne(p);return h>=i&&g<=c},l=p=>(r.rows.get(p)??[]).some(g=>g.vMergeContinue&&s(g)),u=r.rows.size+Nr(r)+2;for(let p=0;!(p>u);p+=1){let g=false;for(let[h,d]of r.rows)if(!(h<o||h>a))for(let S of d){if(!s(S))continue;let{from:x,to:R}=ne(S);x<i&&(i=x,g=true),R>c&&(c=R,g=true);}for(;o>0&&l(o);)o-=1,g=true;for(;l(a+1);)a+=1,g=true;if(!g)break}let y=[],m=new Set;for(let p of r.placed){if(p.isHeaderRepeat||p.rowIndex<o||p.rowIndex>a)continue;let{from:g,to:h}=ne(p.cell);h<i||g>c||m.has(p.cell.id)||(m.add(p.cell.id),y.push(p.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:i,to:c},text:Hr(e,t.tableId,y)}}function mi(e,t){let n=j(e).get(t);if(!n)return null;let r=[],o=new Set,a=0;for(let i of n.placed)i.isHeaderRepeat||o.has(i.cell.id)||(o.add(i.cell.id),r.push(i.cell.id),a=Math.max(a,i.rowIndex));return r.length===0?null:{kind:"cells",tableId:t,cellIds:r,rows:{from:0,to:a},columns:{from:0,to:Nr(n)-1},text:Hr(e,t,r)}}function Ic(e,t){let n=mi(e,t.tableId);if(!n)return false;let r=new Set(t.cellIds);return n.cellIds.every(o=>r.has(o))}function Mc(e,t){return Dr(e,t,true)}function Fe(e,t){return Dr(e,t,false)}function Dr(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of j(e).values())for(let c of i.placed)if(!(c.isHeaderRepeat||!r.has(c.cell.id)))for(let s of c.cell.blocks)n&&s.kind!=="paragraph"||Ce(s,o,a);return o}function Ce(e,t,n){if(e.kind==="paragraph"){for(let r of chunkATU65CUF_cjs.ab(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)Ce(a,t,n);}function Hr(e,t,n){let r=Fe(e,n),o=r[0],a=r[r.length-1];return !o||!a?yi(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:chunkATU65CUF_cjs.gf(e,a).length}}}function yi(e,t){let n=j(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let c of o.cell.blocks)Ce(c,a,new Set);let i=a[0];if(i){let c={paragraphId:i,offset:0};return {anchor:c,head:c}}}for(let o of e.pages)for(let a of chunkATU65CUF_cjs.Ja(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function hi(e){let t=[...chunkATU65CUF_cjs.Ja(e)];for(let n of [e.header,e.footer])n&&t.push(...chunkATU65CUF_cjs.Ka(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...chunkATU65CUF_cjs.Ka(r.fragments));return t}function gi(e,t){let n=new Set(Fe(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of hi(a))if(n.has(i.paragraphId))for(let c of i.lines)for(let s of c.spans){let l=`${s.range.paragraphId}:${s.range.start}:${s.range.end}`;o.has(l)||(o.add(l),r.push(s));}return r}function Si(e,t){let n=new Set(t),r=[];for(let o of j(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function xi(e,t,n=chunkATU65CUF_cjs.gf){let r=j(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(s=>s.cell.logicalGridColumn!==void 0),i=new Map,c=new Set;for(let s of r.placed){if(s.isHeaderRepeat||!o.has(s.cell.id)||c.has(s.cell.id))continue;c.add(s.cell.id);let l=Fe(e,[s.cell.id]).map(m=>n(e,m)).join(`
2
+ `),u=i.get(s.rowIndex),y=s.cell.gridColumn+(a?Math.max(1,s.cell.gridSpan)-1:0);u?u.set(y,l):i.set(s.rowIndex,new Map([[y,l]]));}return [...i.keys()].sort((s,l)=>s-l).map(s=>{let l=i.get(s),u=[];for(let y=0;y<=t.columns.to-t.columns.from;y+=1){let m=a?t.columns.to-y:t.columns.from+y;u.push(l.get(m)??"");}return u.join(" ")}).join(`
3
+ `)}function zt(e,t){return chunkATU65CUF_cjs.rd(e,t)}function _c(e,t,n){if(n){let a=zt(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let c=j(e).get(n.tableId);if(!c)return null;for(let s of c.placed)if(s.cell.id===i)return {tableId:n.tableId,rowId:s.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:s.cell.logicalGridColumn??s.cell.gridColumn,isHeaderRepeat:s.isHeaderRepeat};return null}let r=zt(e,t);if(!r)return null;let o=j(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let c of a.cell.blocks)Ce(c,i,new Set);if(i.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var zr=new WeakMap;function bi(e,t){let n=zr.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of j(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let c=[];for(let l of i.cell.blocks)Ce(l,c,new Set);let s={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let l of c){let u=r.get(l);u&&u.tableId.length>=o.length||r.set(l,s);}}return zr.set(e,r),r.get(t)??null}function Pc(e,t,n){let r=bi(e,t);if(!r)return null;let o=j(e).get(r.tableId);if(!o)return null;let a=new Set;for(let l of o.placed)!l.isHeaderRepeat&&!l.cell.vMergeContinue&&l.cell.blocks.length>0&&a.add(l.cell.id);let i=[...a],c=i.indexOf(r.cellId);if(c<0)return null;let s=n==="next"?1:-1;for(let l=c+s;l>=0&&l<i.length;l+=s){let u=Fe(e,[i[l]]);if(u.length>0)return {cellId:i[l],paragraphIds:u}}return "end"}function Ri(e,t,n){if(![e,t,n].every(Number.isFinite)||t<=0||n<=0)return {offsetPt:0,count:0};let r=Math.ceil(e/n-1e-9)*n;if(!Number.isFinite(r))return {offsetPt:0,count:0};let o=Math.max(0,r-e);return {offsetPt:o,count:Math.min(8192,Math.max(0,Math.floor((t-o)/n+1e-9)))}}exports.$=zs;exports.A=wt;exports.B=Zn;exports.C=Jn;exports.D=Qn;exports.E=er;exports.F=tr;exports.G=nr;exports.H=ra;exports.I=oa;exports.J=me;exports.K=sa;exports.L=Ot;exports.M=ar;exports.N=fa;exports.O=ha;exports.P=It;exports.Q=gs;exports.R=lr;exports.S=Ss;exports.T=Mt;exports.U=Ba;exports.V=Ls;exports.W=fr;exports.X=mr;exports.Y=Oa;exports.Z=Aa;exports._=Ia;exports.a=gt;exports.aa=ka;exports.b=jr;exports.ba=Pt;exports.c=ie;exports.ca=Mr;exports.d=xt;exports.da=ci;exports.e=Yr;exports.ea=li;exports.f=I;exports.fa=pi;exports.g=bt;exports.ga=fi;exports.h=Ct;exports.ha=mi;exports.i=Di;exports.ia=Ic;exports.j=Dn;exports.ja=Mc;exports.k=Hn;exports.ka=Fe;exports.l=Z;exports.la=gi;exports.m=Vo;exports.ma=Si;exports.n=Xo;exports.na=xi;exports.o=Zi;exports.oa=zt;exports.p=vt;exports.pa=_c;exports.q=Ji;exports.qa=bi;exports.r=jo;exports.ra=Pc;exports.s=$o;exports.sa=Ri;exports.t=Qi;exports.u=qo;exports.v=Lt;exports.w=Ke;exports.x=Zo;exports.y=Jo;exports.z=Qo;
@@ -1 +1 @@
1
- 'use strict';var chunkTCWCSTAF_cjs=require('./chunk-TCWCSTAF.cjs');var K=new Set(["document","hdr","ftr","footnotes","endnotes"]),rr=24,H=512,z=chunkTCWCSTAF_cjs.ub(rr);function G(t){let n=t.root;return n.namespaceUri===chunkTCWCSTAF_cjs.pa&&K.has(n.localName)}function tr(t){let n=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkTCWCSTAF_cjs.pa&&r.localName==="p"&&n.push(r);for(let a of r.children)e(a);}};return e(t.root),n}function X(t){let n=chunkTCWCSTAF_cjs.Eb(t);let e=[],r=new Set;for(let a of tr(n)){let i=chunkTCWCSTAF_cjs.wb(a);if(!i||!chunkTCWCSTAF_cjs.vb(i))continue;let o=i.toUpperCase();if(r.has(o))continue;r.add(o);let l=chunkTCWCSTAF_cjs.Km(n,a.id);l!==null&&e.push(Object.freeze({paragraphId:o,nodeId:a.id,text:l}));}return Object.freeze(e)}function er(t){let n=z.get(t.root);if(n)return n;let e=W(t,"byParagraphId");return z.set(t.root,e),e}function W(t,n){let e=chunkTCWCSTAF_cjs.Eb(t);let r=new Map,a=new Set,i=o=>{if(o.kind!=="textValue"){if(o.namespaceUri===chunkTCWCSTAF_cjs.pa&&o.localName==="p"){let l=chunkTCWCSTAF_cjs.wb(o);if(l&&chunkTCWCSTAF_cjs.vb(l)){let s=l.toUpperCase();a.has(s)||(a.add(s),o.kind==="paragraph"&&(n==="byParagraphId"?r.set(s,o.id):r.set(o.id,s)));}}for(let l of o.children)i(l);}};return i(e.root),r}function V(t,n){if(t.length!==n.length)return false;for(let e=0;e<t.length;e+=1)if(t[e].root!==n[e])return false;return true}function $(t){let n=new Map,e=null,r=(o,l,s)=>{for(n.delete(o),n.set(o,{partName:l.name,root:l.root,nodeId:s});n.size>H;){let d=n.keys().next();if(d.done)break;n.delete(d.value);}},a=(o,l)=>{let s=n.get(o);if(!s)return null;let d=l.find(k=>k.name===s.partName);if(!d)return null;if(d.root===s.root)return {part:d,nodeId:s.nodeId};let u=chunkTCWCSTAF_cjs.eb(d,s.nodeId);if(!u||u.kind!=="paragraph")return null;let x=chunkTCWCSTAF_cjs.wb(u);return !x||x.toUpperCase()!==o?null:(r(o,d,s.nodeId),{part:d,nodeId:s.nodeId})};return Object.assign(o=>{let l=t(),s=a(o,l);if(s)return s;if(e&&e.ids.has(o)&&V(l,e.roots))return null;for(let d of l){let u=er(d).get(o);if(u!==void 0)return r(o,d,u),{part:d,nodeId:u}}return (!e||!V(l,e.roots))&&(e={roots:l.map(d=>d.root),ids:new Set}),e.ids.size<H&&e.ids.add(o),null},{forgetIds(o){for(let{paragraphId:l,nodeId:s}of o)n.get(l)?.nodeId!==s&&n.delete(l);},forgetAll(){n.clear();},hasHints(){return n.size>0}})}function Y(t,n,e){if(!t.hasHints())return;let r=[...e.dirty,...e.created];if(e.impact!=="text-local"||r.length===0)return t.forgetAll();let a=[];for(let i of r){let o=n.find(d=>i.startsWith(`${d.name}#`)),l=o?chunkTCWCSTAF_cjs.eb(o,i):null,s=l?.kind==="paragraph"?chunkTCWCSTAF_cjs.wb(l):null;if(!s)return t.forgetAll();a.push({paragraphId:s.toUpperCase(),nodeId:i});}t.forgetIds(a);}function q(t){let n=null;return e=>{let r=t();n?.root!==r.root&&(n={root:r.root,byNodeId:W(r,"byNodeId")});let a=n.byNodeId.get(e);if(a===void 0)return null;let i=chunkTCWCSTAF_cjs.Km(r,e);return i===null?null:Object.freeze({paragraphId:a,nodeId:e,text:i})}}function Z(t,n){return chunkTCWCSTAF_cjs.Wa(t,n)}var ar=Object.freeze({kind:"body"}),ir=1e6;function A(t,n){if(n<=0||n>=t.length)return false;let e=t.charCodeAt(n-1),r=t.charCodeAt(n);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function lr(t,n,e){if(n===e)return [];let r=0,a=Math.min(n.length,e.length);for(;r<a&&n.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(A(n,r)||A(e,r));)r-=1;let i=0;for(;i<n.length-r&&i<e.length-r&&n.charCodeAt(n.length-i-1)===e.charCodeAt(e.length-i-1);)i+=1;for(;i>0&&(A(n,n.length-i)||A(e,e.length-i));)i-=1;let o=n.length-r-i,l=e.slice(r,e.length-i),s=[];return o>0&&s.push({op:"deleteText",paragraphId:t,start:r,end:r+o}),l.length>0&&s.push({op:"insertText",paragraphId:t,offset:r,text:l}),Object.freeze(s)}function sr(t){let n=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkTCWCSTAF_cjs.pa&&r.localName==="t"&&r.attributes.every(a=>a.namespaceUri===chunkTCWCSTAF_cjs.qa&&a.localName==="space")&&r.children.every(a=>a.kind==="textValue"),e=[];for(let r of t){let a=e.at(-1);if(!n(a)||!n(r)){e.push(r);continue}let i=a.children.map(o=>o.kind==="textValue"?o.value:"").join("")+r.children.map(o=>o.kind==="textValue"?o.value:"").join("");e[e.length-1]={...a,attributes:/^\s|\s$/.test(i)?[{kind:"xmlSpace",namespaceUri:chunkTCWCSTAF_cjs.qa,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:a.children[0]?.id??`${a.id}/text`,kind:"textValue",value:i}]};}return e}function F(t){if(t.kind==="textValue")return t;let n=false,e=t.children.map(r=>{let a=F(r);return a!==r&&(n=true),a});if(t.namespaceUri===chunkTCWCSTAF_cjs.pa&&t.localName==="r"){let r=sr(e);(r.length!==e.length||r.some((a,i)=>a!==e[i]))&&(e=[...r],n=true);}return n?{...t,children:e}:t}function dr(t,n,e){let r=t.parts.get(n);if(!r)return t;let a=false,i=new Set;for(let o of e)(o.op==="insertText"||o.op==="deleteText")&&!o.revision&&i.add(o.paragraphId);for(let o of i){let l=chunkTCWCSTAF_cjs.eb(r,o);if(!l||l.kind==="textValue")continue;let s=F(l);if(s===l)continue;let d=chunkTCWCSTAF_cjs.kb(r,o,s,{deferValidation:true});d.ok&&(r=d.part,a=true);}return a?chunkTCWCSTAF_cjs.sg(t,r):t}function pr(t,n){let e=n.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>X(t.bodyStore().part),a,i=()=>{let p=t.bodyStore().part,c=t.currentPackage();if(a?.pkg===c&&a.body===p)return a.parts;let g=[p];for(let m of c.parts.values())m===p||!G(m)||g.push(m);return a={pkg:c,body:p,parts:Object.freeze(g)},a.parts},o=$(i),l=t.packageRevision,s=t.lastModelChange,d=()=>{let p=t.packageRevision,c=t.lastModelChange;p===l&&c===s||(p===l+1&&c!==null&&c!==s?Y(o,i(),c):o.forgetAll(),l=p,s=c);},u=q(()=>t.bodyStore().part),x=(p,c)=>{if(p.length===0)return {ok:true,changed:false};let g=r(),m=new Set,I=[];for(let h of p){if(typeof h.text!="string"||h.text.length>ir)return {ok:false,reason:"collaboration-text-limit"};if(typeof h.paragraphId!="string"||h.paragraphId.length===0||h.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let f=h.paragraphId.toUpperCase();if(m.has(f))return {ok:false,reason:"duplicate-paragraph-id"};m.add(f);let D=g.filter(Q=>Q.paragraphId===f);if(D.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let w=D[0];I.push(...lr(w.nodeId,w.text,h.text));}if(I.length===0)return {ok:true,changed:false};let v=t.transact(ar,h=>{for(let f of I)h.apply(f);h.applyPackage(f=>dr(f,f.mainDocumentPart,I));},{origin:c.origin,actorId:c.actorId,operationId:c.operationId,recordsHistory:false});return v.ok?{ok:true,changed:v.change!==null}:{ok:false,reason:v.detail??v.reason}},k={documentId:e,interactive:n.interactive===true,paragraphs:r,paragraphByNodeId:u,paragraphTextOf(p){for(let c of i()){let g=chunkTCWCSTAF_cjs.Km(c,p);if(g!==null)return g}return null},paragraphByStableId(p){let c=p.toUpperCase();d();let g=o(c);if(!g)return null;let m=chunkTCWCSTAF_cjs.Km(g.part,g.nodeId);return m===null?null:Object.freeze({paragraphId:c,nodeId:g.nodeId,text:m})},applyParagraphText(p,c,g){return x([{paragraphId:p,text:c}],g)},applyParagraphTexts:x,applyRemotePackage(p,c){let g=t.publishRemotePackage(p,c);return g.ok?{ok:true,changed:g.change!==null}:{ok:false,reason:g.detail??g.reason}},revision:()=>t.packageRevision,subscribe:p=>t.subscribe(p),observePrimitiveJournal:p=>Z(t,p),hasPendingJournals:()=>chunkTCWCSTAF_cjs.Sa(t),flushPendingJournals:()=>{chunkTCWCSTAF_cjs.Ta(t);},save:()=>chunkTCWCSTAF_cjs.og(t.currentPackage()),binaryPart(p){let c=t.currentPackage();return c.partBytes.get(p)??c.partBytes.get(p.startsWith("/")?p.slice(1):`/${p}`)??null}};return Object.freeze(k)}function cr(t,n,e){if(n===e||t>n.length)return Math.min(t,e.length);let r=0;for(;r<n.length&&r<e.length&&n[r]===e[r];)r+=1;let a=0;for(;a<n.length-r&&a<e.length-r&&n[n.length-1-a]===e[e.length-1-a];)a+=1;if(t<=r)return Math.min(t,e.length);if(t>n.length-a)return Math.min(e.length,t+e.length-n.length);let i=gr(n,e,r,a),o=i.offsets.get(t);return o===void 0&&(o=(i.table?fr(i.table,t,n,e,r):null)??Pr(t,n,e,r,a)??r,i.offsets.set(t,o)),o}var b=[],ur=16;function gr(t,n,e,r){let a=b.findIndex(o=>o.before===t&&o.after===n);if(a>=0){let[o]=b.splice(a,1);return b.push(o),o}let i={before:t,after:n,table:mr(t,n,e,r),offsets:new Map};return b.length>=ur&&b.shift(),b.push(i),i}var hr=1<<18;function mr(t,n,e,r){let a=t.length-r-e,i=n.length-r-e;if(a*i>hr)return null;let o=i+1,l=new Uint32Array((a+1)*o);for(let s=a-1;s>=0;s-=1)for(let d=i-1;d>=0;d-=1)l[s*o+d]=t[e+s]===n[e+d]?l[(s+1)*o+d+1]+1:Math.max(l[(s+1)*o+d],l[s*o+d+1]);return {lengths:l,width:o,columns:i}}function fr(t,n,e,r,a){let{lengths:i,width:o,columns:l}=t,s=n-a,d=0,u=0;for(;d<s;)u<l&&e[a+d]===r[a+u]?(d+=1,u+=1):u>=l||i[(d+1)*o+u]>=i[d*o+u+1]?d+=1:u+=1;return a+u}var yr=[32,16,8,4];function Pr(t,n,e,r,a){let i=e.slice(r,e.length-a),o=l=>{let s=i.indexOf(l);return s>=0&&i.indexOf(l,s+1)<0?s:null};for(let l of yr){let s=n.slice(Math.max(r,t-l),t);if(s.length===l){let u=o(s);if(u!==null)return r+u+s.length}let d=n.slice(t,Math.min(n.length-a,t+l));if(d.length===l){let u=o(d);if(u!==null)return r+u}}return null}exports.a=dr;exports.b=pr;exports.c=cr;
1
+ 'use strict';var chunkXPBKJQTG_cjs=require('./chunk-XPBKJQTG.cjs');var K=new Set(["document","hdr","ftr","footnotes","endnotes"]),rr=24,H=512,z=chunkXPBKJQTG_cjs.ub(rr);function G(t){let n=t.root;return n.namespaceUri===chunkXPBKJQTG_cjs.pa&&K.has(n.localName)}function tr(t){let n=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkXPBKJQTG_cjs.pa&&r.localName==="p"&&n.push(r);for(let a of r.children)e(a);}};return e(t.root),n}function X(t){let n=chunkXPBKJQTG_cjs.Eb(t);let e=[],r=new Set;for(let a of tr(n)){let i=chunkXPBKJQTG_cjs.wb(a);if(!i||!chunkXPBKJQTG_cjs.vb(i))continue;let o=i.toUpperCase();if(r.has(o))continue;r.add(o);let l=chunkXPBKJQTG_cjs.Nm(n,a.id);l!==null&&e.push(Object.freeze({paragraphId:o,nodeId:a.id,text:l}));}return Object.freeze(e)}function er(t){let n=z.get(t.root);if(n)return n;let e=W(t,"byParagraphId");return z.set(t.root,e),e}function W(t,n){let e=chunkXPBKJQTG_cjs.Eb(t);let r=new Map,a=new Set,i=o=>{if(o.kind!=="textValue"){if(o.namespaceUri===chunkXPBKJQTG_cjs.pa&&o.localName==="p"){let l=chunkXPBKJQTG_cjs.wb(o);if(l&&chunkXPBKJQTG_cjs.vb(l)){let s=l.toUpperCase();a.has(s)||(a.add(s),o.kind==="paragraph"&&(n==="byParagraphId"?r.set(s,o.id):r.set(o.id,s)));}}for(let l of o.children)i(l);}};return i(e.root),r}function V(t,n){if(t.length!==n.length)return false;for(let e=0;e<t.length;e+=1)if(t[e].root!==n[e])return false;return true}function $(t){let n=new Map,e=null,r=(o,l,s)=>{for(n.delete(o),n.set(o,{partName:l.name,root:l.root,nodeId:s});n.size>H;){let d=n.keys().next();if(d.done)break;n.delete(d.value);}},a=(o,l)=>{let s=n.get(o);if(!s)return null;let d=l.find(k=>k.name===s.partName);if(!d)return null;if(d.root===s.root)return {part:d,nodeId:s.nodeId};let u=chunkXPBKJQTG_cjs.eb(d,s.nodeId);if(!u||u.kind!=="paragraph")return null;let x=chunkXPBKJQTG_cjs.wb(u);return !x||x.toUpperCase()!==o?null:(r(o,d,s.nodeId),{part:d,nodeId:s.nodeId})};return Object.assign(o=>{let l=t(),s=a(o,l);if(s)return s;if(e&&e.ids.has(o)&&V(l,e.roots))return null;for(let d of l){let u=er(d).get(o);if(u!==void 0)return r(o,d,u),{part:d,nodeId:u}}return (!e||!V(l,e.roots))&&(e={roots:l.map(d=>d.root),ids:new Set}),e.ids.size<H&&e.ids.add(o),null},{forgetIds(o){for(let{paragraphId:l,nodeId:s}of o)n.get(l)?.nodeId!==s&&n.delete(l);},forgetAll(){n.clear();},hasHints(){return n.size>0}})}function Y(t,n,e){if(!t.hasHints())return;let r=[...e.dirty,...e.created];if(e.impact!=="text-local"||r.length===0)return t.forgetAll();let a=[];for(let i of r){let o=n.find(d=>i.startsWith(`${d.name}#`)),l=o?chunkXPBKJQTG_cjs.eb(o,i):null,s=l?.kind==="paragraph"?chunkXPBKJQTG_cjs.wb(l):null;if(!s)return t.forgetAll();a.push({paragraphId:s.toUpperCase(),nodeId:i});}t.forgetIds(a);}function q(t){let n=null;return e=>{let r=t();n?.root!==r.root&&(n={root:r.root,byNodeId:W(r,"byNodeId")});let a=n.byNodeId.get(e);if(a===void 0)return null;let i=chunkXPBKJQTG_cjs.Nm(r,e);return i===null?null:Object.freeze({paragraphId:a,nodeId:e,text:i})}}function Z(t,n){return chunkXPBKJQTG_cjs.Wa(t,n)}var ar=Object.freeze({kind:"body"}),ir=1e6;function A(t,n){if(n<=0||n>=t.length)return false;let e=t.charCodeAt(n-1),r=t.charCodeAt(n);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function lr(t,n,e){if(n===e)return [];let r=0,a=Math.min(n.length,e.length);for(;r<a&&n.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(A(n,r)||A(e,r));)r-=1;let i=0;for(;i<n.length-r&&i<e.length-r&&n.charCodeAt(n.length-i-1)===e.charCodeAt(e.length-i-1);)i+=1;for(;i>0&&(A(n,n.length-i)||A(e,e.length-i));)i-=1;let o=n.length-r-i,l=e.slice(r,e.length-i),s=[];return o>0&&s.push({op:"deleteText",paragraphId:t,start:r,end:r+o}),l.length>0&&s.push({op:"insertText",paragraphId:t,offset:r,text:l}),Object.freeze(s)}function sr(t){let n=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkXPBKJQTG_cjs.pa&&r.localName==="t"&&r.attributes.every(a=>a.namespaceUri===chunkXPBKJQTG_cjs.qa&&a.localName==="space")&&r.children.every(a=>a.kind==="textValue"),e=[];for(let r of t){let a=e.at(-1);if(!n(a)||!n(r)){e.push(r);continue}let i=a.children.map(o=>o.kind==="textValue"?o.value:"").join("")+r.children.map(o=>o.kind==="textValue"?o.value:"").join("");e[e.length-1]={...a,attributes:/^\s|\s$/.test(i)?[{kind:"xmlSpace",namespaceUri:chunkXPBKJQTG_cjs.qa,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:a.children[0]?.id??`${a.id}/text`,kind:"textValue",value:i}]};}return e}function F(t){if(t.kind==="textValue")return t;let n=false,e=t.children.map(r=>{let a=F(r);return a!==r&&(n=true),a});if(t.namespaceUri===chunkXPBKJQTG_cjs.pa&&t.localName==="r"){let r=sr(e);(r.length!==e.length||r.some((a,i)=>a!==e[i]))&&(e=[...r],n=true);}return n?{...t,children:e}:t}function dr(t,n,e){let r=t.parts.get(n);if(!r)return t;let a=false,i=new Set;for(let o of e)(o.op==="insertText"||o.op==="deleteText")&&!o.revision&&i.add(o.paragraphId);for(let o of i){let l=chunkXPBKJQTG_cjs.eb(r,o);if(!l||l.kind==="textValue")continue;let s=F(l);if(s===l)continue;let d=chunkXPBKJQTG_cjs.kb(r,o,s,{deferValidation:true});d.ok&&(r=d.part,a=true);}return a?chunkXPBKJQTG_cjs.vg(t,r):t}function pr(t,n){let e=n.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>X(t.bodyStore().part),a,i=()=>{let p=t.bodyStore().part,c=t.currentPackage();if(a?.pkg===c&&a.body===p)return a.parts;let g=[p];for(let m of c.parts.values())m===p||!G(m)||g.push(m);return a={pkg:c,body:p,parts:Object.freeze(g)},a.parts},o=$(i),l=t.packageRevision,s=t.lastModelChange,d=()=>{let p=t.packageRevision,c=t.lastModelChange;p===l&&c===s||(p===l+1&&c!==null&&c!==s?Y(o,i(),c):o.forgetAll(),l=p,s=c);},u=q(()=>t.bodyStore().part),x=(p,c)=>{if(p.length===0)return {ok:true,changed:false};let g=r(),m=new Set,I=[];for(let h of p){if(typeof h.text!="string"||h.text.length>ir)return {ok:false,reason:"collaboration-text-limit"};if(typeof h.paragraphId!="string"||h.paragraphId.length===0||h.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let f=h.paragraphId.toUpperCase();if(m.has(f))return {ok:false,reason:"duplicate-paragraph-id"};m.add(f);let D=g.filter(Q=>Q.paragraphId===f);if(D.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let w=D[0];I.push(...lr(w.nodeId,w.text,h.text));}if(I.length===0)return {ok:true,changed:false};let v=t.transact(ar,h=>{for(let f of I)h.apply(f);h.applyPackage(f=>dr(f,f.mainDocumentPart,I));},{origin:c.origin,actorId:c.actorId,operationId:c.operationId,recordsHistory:false});return v.ok?{ok:true,changed:v.change!==null}:{ok:false,reason:v.detail??v.reason}},k={documentId:e,interactive:n.interactive===true,paragraphs:r,paragraphByNodeId:u,paragraphTextOf(p){for(let c of i()){let g=chunkXPBKJQTG_cjs.Nm(c,p);if(g!==null)return g}return null},paragraphByStableId(p){let c=p.toUpperCase();d();let g=o(c);if(!g)return null;let m=chunkXPBKJQTG_cjs.Nm(g.part,g.nodeId);return m===null?null:Object.freeze({paragraphId:c,nodeId:g.nodeId,text:m})},applyParagraphText(p,c,g){return x([{paragraphId:p,text:c}],g)},applyParagraphTexts:x,applyRemotePackage(p,c){let g=t.publishRemotePackage(p,c);return g.ok?{ok:true,changed:g.change!==null}:{ok:false,reason:g.detail??g.reason}},revision:()=>t.packageRevision,subscribe:p=>t.subscribe(p),observePrimitiveJournal:p=>Z(t,p),hasPendingJournals:()=>chunkXPBKJQTG_cjs.Sa(t),flushPendingJournals:()=>{chunkXPBKJQTG_cjs.Ta(t);},save:()=>chunkXPBKJQTG_cjs.rg(t.currentPackage()),binaryPart(p){let c=t.currentPackage();return c.partBytes.get(p)??c.partBytes.get(p.startsWith("/")?p.slice(1):`/${p}`)??null}};return Object.freeze(k)}function cr(t,n,e){if(n===e||t>n.length)return Math.min(t,e.length);let r=0;for(;r<n.length&&r<e.length&&n[r]===e[r];)r+=1;let a=0;for(;a<n.length-r&&a<e.length-r&&n[n.length-1-a]===e[e.length-1-a];)a+=1;if(t<=r)return Math.min(t,e.length);if(t>n.length-a)return Math.min(e.length,t+e.length-n.length);let i=gr(n,e,r,a),o=i.offsets.get(t);return o===void 0&&(o=(i.table?fr(i.table,t,n,e,r):null)??Pr(t,n,e,r,a)??r,i.offsets.set(t,o)),o}var b=[],ur=16;function gr(t,n,e,r){let a=b.findIndex(o=>o.before===t&&o.after===n);if(a>=0){let[o]=b.splice(a,1);return b.push(o),o}let i={before:t,after:n,table:mr(t,n,e,r),offsets:new Map};return b.length>=ur&&b.shift(),b.push(i),i}var hr=1<<18;function mr(t,n,e,r){let a=t.length-r-e,i=n.length-r-e;if(a*i>hr)return null;let o=i+1,l=new Uint32Array((a+1)*o);for(let s=a-1;s>=0;s-=1)for(let d=i-1;d>=0;d-=1)l[s*o+d]=t[e+s]===n[e+d]?l[(s+1)*o+d+1]+1:Math.max(l[(s+1)*o+d],l[s*o+d+1]);return {lengths:l,width:o,columns:i}}function fr(t,n,e,r,a){let{lengths:i,width:o,columns:l}=t,s=n-a,d=0,u=0;for(;d<s;)u<l&&e[a+d]===r[a+u]?(d+=1,u+=1):u>=l||i[(d+1)*o+u]>=i[d*o+u+1]?d+=1:u+=1;return a+u}var yr=[32,16,8,4];function Pr(t,n,e,r,a){let i=e.slice(r,e.length-a),o=l=>{let s=i.indexOf(l);return s>=0&&i.indexOf(l,s+1)<0?s:null};for(let l of yr){let s=n.slice(Math.max(r,t-l),t);if(s.length===l){let u=o(s);if(u!==null)return r+u+s.length}let d=n.slice(t,Math.min(n.length-a,t+l));if(d.length===l){let u=o(d);if(u!==null)return r+u}}return null}exports.a=dr;exports.b=pr;exports.c=cr;
@@ -0,0 +1,6 @@
1
+ import {a,c,d,f}from'./chunk-77L2HX42.js';import {d as d$1}from'./chunk-YVLF7HBD.js';import {c as c$1,a as a$1,b as b$1}from'./chunk-YCOHPEF2.js';import {g as g$1}from'./chunk-WMM772MS.js';import {ta,T as T$1,Aa,ja as ja$1,na,ma,ea,da,ca,aa,ba,ka,R,ya}from'./chunk-XMJFDVE2.js';import {b,a as a$2}from'./chunk-MLJJL4QG.js';import {ub,tb,_g,g,Qd,fd as fd$1,eb,wn as wn$1,pa,$l as $l$1,pg,Eb,Vn,Wg,tj,Xa as Xa$1,Yi as Yi$1,Xi,ud as ud$1,Sl as Sl$1,Vk,ij,Li as Li$1,jj,ak,yf,Nm,jd,$b,$g,ye,yg,N,cf as cf$1,bf,df,ie,he as he$1,wf,vf,rb,vd as vd$1,uj,Pm,_b,re,ue as ue$1,dk,ek,oj,Jj,Aa as Aa$1,Ca,za as za$1,Ba as Ba$1,zf,ld as ld$1,nd as nd$1,X as X$1,va,E as E$1,ff,Ha as Ha$1,tg,fb,ql as ql$1,pl as pl$1,xl as xl$1,km,wb,vb,cg,se as se$1,ya as ya$1,Pa,sc as sc$1,Tj,ol as ol$1,cb,kb,vg,fg,Eg,Dg,Fg,wa,xe,W as W$1,fk,id as id$1,Om,Ii as Ii$1,hh,sd as sd$1,Ch,bc as bc$1,We,de as de$1,Ub,V,C,Mb,hd as hd$1,tf,bd as bd$1,Rc as Rc$1,Tc as Tc$1,Hc as Hc$1,Dl as Dl$1,z as z$1}from'./chunk-XI5HK3TZ.js';import {Schema}from'prosemirror-model';import {EditorState,TextSelection}from'prosemirror-state';import {EditorView}from'prosemirror-view';import {keymap}from'prosemirror-keymap';import {joinBackward,deleteSelection,joinForward,splitBlock,selectTextblockEnd,selectTextblockStart,baseKeymap}from'prosemirror-commands';function ve(e){return e.attributes?.val}function Pe(e){let t=ve(e);return t===void 0||!(t==="0"||t==="false"||t==="off")}var Gi=/^[0-9A-Fa-f]{6}$/,Ki=/^\d{1,6}$/;function zr(e){return e===void 0||e==="auto"?null:Gi.test(e)?`#${e}`:null}var Yi={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},Ji={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function Zi(e){return !e||!/^[\w \-.+]{1,64}$/.test(e)?null:`"${e}"`}function Fa(e,t=false){let r=Qd(e);return r===null||Math.abs(r)>999999||!t&&r<0?null:r}function Ne(e,t=false){let r=Fa(e,t);return r===null?null:`${r/20}pt`}function La(e){let t=[],r=[],n=null,a=null;for(let o of e)switch(o.localName){case "b":t.push(`font-weight:${Pe(o)?"bold":"normal"}`);break;case "i":t.push(`font-style:${Pe(o)?"italic":"normal"}`);break;case "u":{let s=ve(o)??"single";if(s==="none"||!Pe(o))break;r.push("underline"),n=Yi[s]??"solid",a=zr(o.attributes?.color);break}case "strike":Pe(o)&&r.push("line-through");break;case "dstrike":Pe(o)&&r.push("line-through");break;case "caps":Pe(o)&&t.push("text-transform:uppercase");break;case "smallCaps":Pe(o)&&t.push("font-variant:small-caps");break;case "vertAlign":{let s=ve(o);s==="superscript"?t.push("vertical-align:super","font-size:0.75em"):s==="subscript"&&t.push("vertical-align:sub","font-size:0.75em");break}case "color":{let s=zr(ve(o));s&&t.push(`color:${s}`);break}case "highlight":{let s=Ji[ve(o)??""];s&&t.push(`background-color:${s}`);break}case "sz":{let s=ve(o);s!==void 0&&Ki.test(s)&&t.push(`font-size:${Number(s)/2}pt`);break}case "rFonts":{let s=Zi(o.attributes?.ascii??o.attributes?.hAnsi);s&&t.push(`font-family:${s}`);break}case "spacing":{let s=Ne(ve(o),true);s&&t.push(`letter-spacing:${s}`);break}}return r.length>0&&(t.push(`text-decoration-line:${[...new Set(r)].join(" ")}`),n&&t.push(`text-decoration-style:${n}`),a&&t.push(`text-decoration-color:${a}`)),t.join(";")}var Qi={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function _a(e){let t=[];for(let r of e)switch(r.localName){case "jc":{let n=Qi[ve(r)??""];n&&t.push(`text-align:${n}`);break}case "ind":{let n=Ne(r.attributes?.left??r.attributes?.start,true),a=Ne(r.attributes?.right??r.attributes?.end,true),o=Ne(r.attributes?.firstLine),s=Ne(r.attributes?.hanging);n&&t.push(`margin-left:${n}`),a&&t.push(`margin-right:${a}`),o?t.push(`text-indent:${o}`):s&&t.push(`text-indent:-${s}`);break}case "spacing":{let n=Ne(r.attributes?.before),a=Ne(r.attributes?.after);n&&t.push(`margin-top:${n}`),a&&t.push(`margin-bottom:${a}`);let o=Fa(r.attributes?.line),s=r.attributes?.lineRule;o!==null&&s!=="exact"&&s!=="atLeast"?t.push(`line-height:${(o/240).toFixed(3)}`):o!==null&&t.push(`line-height:${o/20}pt`);break}case "shd":{let n=zr(r.attributes?.fill);n&&t.push(`background-color:${n}`);break}case "pageBreakBefore":Pe(r)&&t.push("break-before:page");break;}return t.join(";")}var X=new Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:e=>{let t=_a(e.attrs.props??[]);return ["p",{"data-node-id":String(e.attrs.nodeId??""),...t?{style:t}:{}},0]},parseDOM:[{tag:"p",getAttrs:e=>typeof e=="string"?null:{nodeId:e.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:e=>["span",{"data-token":"unknown","data-node-id":String(e.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(e.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:e=>typeof e=="string"?false:{nodeId:e.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:e=>{let t=e.attrs.props??[],r=La(t);return ["span",{"data-run-props":el(t),...r?{style:r}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:e=>{if(typeof e=="string")return false;let t=tl(e.getAttribute("data-run-props"));return t?{props:t}:false}}]}}});function el(e){return JSON.stringify(Array.isArray(e)?e:[])}function tl(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let r=[];for(let n of t){if(typeof n!="object"||n===null)return null;let a=n;if(typeof a.localName!="string"||a.attributes!==void 0&&(typeof a.attributes!="object"||a.attributes===null))return null;r.push(a.attributes===void 0?{localName:a.localName}:{localName:a.localName,attributes:a.attributes});}return r}catch{return null}}function Vr(e){for(let t of e.marks)if(t.type.name==="runProps")return t.attrs.props??[];return []}function Vt(e,t){return JSON.stringify(Gt(e))===JSON.stringify(Gt(t))}function Gt(e){return [...e].map(t=>({localName:t.localName,attributes:Object.fromEntries(Object.entries(t.attributes??{}).sort(([r],[n])=>r<n?-1:1))})).sort((t,r)=>t.localName<r.localName?-1:1)}function Gr(e){if(!e||e.kind==="textValue")return [];let t=[];for(let r of e.children){if(r.kind==="textValue"||r.namespaceUri!==pa||r.localName==="rPrChange"||r.localName==="pPrChange")continue;let n={};for(let a of r.attributes)a.namespaceUri===pa&&(n[a.localName]=a.value);t.push(Object.keys(n).length>0?{localName:r.localName,attributes:n}:{localName:r.localName});}return t}function $a(e){return e.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[e.localName]??e.localName} \u2014 preserved, not editable yet`}function ne(e){if(e.kind==="textValue")return [];let t=[],r=o=>{if(o.kind!=="run")return;let s=o.children.find(i=>i.kind==="runProperties"),l=Gr(s);for(let i of o.children)if(i.kind!=="runProperties"){if(i.kind==="tab"){t.push({kind:"tab"});continue}if(i.kind==="hardBreak"){t.push(bc$1(i)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(i.kind==="text"){let d="";for(let c of i.children)c.kind==="textValue"&&(d+=c.value);d.length>0&&t.push({kind:"text",text:d,props:l});continue}t.push({kind:"unknown",nodeId:i.id,label:$a(i),modelLength:i.kind==="drawing"||We(i)||de$1(i)||Ub(i)!==null?1:0});}},n=o=>{if(o.kind==="run"){r(o);return}t.push({kind:"unknown",nodeId:o.id,label:$a(o),modelLength:0});},a=(o,s)=>{for(let l of o)if(!(l.kind==="textValue"||l.kind==="paragraphProperties")&&!(s>=Aa$1)){if(Ca(l)&&!za$1(l.kind)&&s<Aa$1){a(l.children.filter(i=>!zf(l,i)),Ba$1(l,s));continue}if(ld$1(l)){let i=nd$1(l);i&&a(i,Ba$1(l,s));continue}n(l);}};return a(e.children,0),t}function Ze(e){let t=[],r=n=>{if(n.kind!=="textValue"){if(n.kind==="body"){for(let a of n.children)a.kind==="paragraph"&&t.push(a);return}for(let a of n.children)r(a);}};return r(e.root),t}var Ua=ub(16),Ba=tb();function rl(e,t){let r=Ba.get(e);if(!r){let n=[];jd([e],n,0),r=Object.freeze(n),Ba.set(e,r,r.length);}for(let n of r)t.push(n);}function oe(e){let t=Ua.get(e);if(t)return t;let r=[];for(let n of fd$1(e))if(n.root.kind!=="textValue")for(let a of n.root.children)rl(a,r);return Ua.set(e,r),r}function Te(e){let t=Ze(e).map(r=>{let n=r.kind==="textValue"?void 0:r.children.find(o=>o.kind==="paragraphProperties"),a=ne(r).map(o=>{switch(o.kind){case "text":return X.text(o.text,o.props.length>0?[X.marks.runProps.create({props:o.props})]:[]);case "tab":return X.node("tab");case "hardBreak":return X.node("hardBreak");case "pageBreak":return X.node("pageBreak");default:return X.node("unknownInline",{nodeId:o.nodeId,label:o.label})}});return X.node("paragraph",{nodeId:r.id,props:Gr(n)},a)});return X.node("doc",null,t.length>0?t:[X.node("paragraph")])}function nl(e,t){let r=[];return e.forEach(n=>{if(n.isText&&n.text){r.push({kind:"text",text:n.text,props:Vr(n)});return}n.type.name==="tab"?r.push({kind:"tab"}):n.type.name==="hardBreak"?r.push({kind:"hardBreak"}):n.type.name==="pageBreak"?r.push({kind:"pageBreak"}):n.type.name==="unknownInline"&&r.push({kind:"unknown",nodeId:String(n.attrs.nodeId??""),label:String(n.attrs.label??""),modelLength:t.has(String(n.attrs.nodeId??""))?1:0});}),r}function Q(e){let t="";for(let r of e)r.kind==="text"?t+=r.text:r.kind==="tab"?t+=" ":r.kind==="hardBreak"?t+=`
2
+ `:r.kind==="pageBreak"?t+=$b:r.modelLength===1&&(t+=$g);return t}function de(e){let t=[],r=0;for(let n of e)n.kind==="text"?r+=n.text.length:n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak"?r+=1:(t.push(`${n.nodeId}@${r}`),r+=n.modelLength);return t}function ol(e,t){if(e===t)return null;let r=0,n=Math.min(e.length,t.length);for(;r<n&&e[r]===t[r];)r+=1;let a=e.length,o=t.length;for(;a>r&&o>r&&e[a-1]===t[o-1];)a-=1,o-=1;return {start:r,endBefore:a,endAfter:o}}function Ha(e){let t=[];for(let r of e)if(r.kind==="text")for(let n=0;n<r.text.length;n+=1)t.push(r.props);else r.kind==="tab"||r.kind==="hardBreak"||r.kind==="pageBreak"?t.push(t[t.length-1]??[]):r.kind==="unknown"&&r.modelLength===1&&t.push([]);return t}function al(e,t,r,n,a){let o=[],s=Q(t),l=Q(r),i=ol(s,l),d=[],c=0,u=false;for(let f of t){if(f.kind!=="unknown"){c+=f.kind==="text"?f.text.length:1;continue}let m=c;f.modelLength===1&&i&&(i.start<c+1&&i.endBefore>c&&(u=true),i.endBefore<=c&&(m+=i.endAfter-i.endBefore)),d.push(`${f.nodeId}@${m}`),c+=f.modelLength;}if(u||JSON.stringify(d)!==JSON.stringify(de(r)))return {ok:false,reason:"unknown-content-moved",detail:e};if(Vt(n,a)||o.push({op:"setParagraphProperties",paragraphId:e,properties:Gt(a)}),i&&(i.endBefore>i.start&&o.push({op:"deleteText",paragraphId:e,start:i.start,end:i.endBefore}),i.endAfter>i.start)){let f=l.slice(i.start,i.endAfter),m=i.start,h="",g=()=>{h.length!==0&&(o.push({op:"insertText",paragraphId:e,offset:m,text:h}),m+=h.length,h="");};for(let y of f)y===" "?(g(),o.push({op:"insertTab",paragraphId:e,offset:m}),m+=1):y===`
3
+ `?(g(),o.push({op:"insertHardBreak",paragraphId:e,offset:m}),m+=1):y===$b?(g(),o.push({op:"insertPageBreak",paragraphId:e,offset:m}),m+=1):h+=y;g();}if(!i){let f=Ha(t),m=Ha(r),h=0;for(;h<m.length;){if(Vt(f[h]??[],m[h])){h+=1;continue}let g=h,y=m[h];for(;h<m.length&&Vt(m[h],y)&&!Vt(f[h]??[],m[h]);)h+=1;o.push({op:"setRunProperties",paragraphId:e,start:g,end:h,properties:Gt(y)});}}return {ok:true,ops:o}}function Kr(e,t){let r=Ze(e),n=new Set;for(let l of r)for(let i of ne(l))i.kind==="unknown"&&i.modelLength===1&&n.add(i.nodeId);let a=l=>nl(l,n),o=[];if(t.forEach(l=>{l.type.name==="paragraph"&&o.push(l);}),o.length!==t.childCount)return {ok:false,reason:"unsupported-node"};let s=o.length-r.length;if(s===0){let l=[];for(let[i,d]of o.entries()){let c=r[i];if(d.attrs.nodeId!==c.id)return {ok:false,reason:"paragraph-reordered",detail:String(d.attrs.nodeId)};let u=al(c.id,ne(c),a(d),Gr(c.kind==="textValue"?void 0:c.children.find(f=>f.kind==="paragraphProperties")),d.attrs.props??[]);if(!u.ok)return u;l.push(...u.ops);}return {ok:true,ops:l}}return s===1?sl(r,o,a):s===-1?il(r,o,a):{ok:false,reason:"paragraph-count-unexplained",detail:String(s)}}function sl(e,t,r){for(let n=0;n<e.length;n+=1){let a=e[n],o=t[n],s=t[n+1];if(!o||!s||o.attrs.nodeId!==a.id)continue;let l=s.attrs.nodeId;if(l!==null&&l!==a.id)continue;let i=r(o),d=r(s),c=ne(a),u=Q(i);if(u+Q(d)===Q(c)&&JSON.stringify(de([...i,...d]))===JSON.stringify(de(c))&&ja(e,t,n,r)&&Xa(e,t,n+1,n+2,r))return {ok:true,ops:[{op:"splitParagraph",paragraphId:a.id,offset:u.length}]}}return {ok:false,reason:"split-not-clean"}}function il(e,t,r){for(let n=0;n+1<e.length;n+=1){let a=e[n],o=e[n+1],s=t[n];if(!s||s.attrs.nodeId!==a.id)continue;let l=[...ne(a),...ne(o)],i=r(s);if(Q(i)===Q(l)&&JSON.stringify(de(i))===JSON.stringify(de(l))&&ja(e,t,n,r)&&Xa(e,t,n+2,n+1,r))return {ok:true,ops:[{op:"joinParagraphs",firstId:a.id,secondId:o.id}]}}return {ok:false,reason:"join-not-clean"}}function ja(e,t,r,n){for(let a=0;a<r;a+=1){let o=t[a],s=e[a];if(!o||o.attrs.nodeId!==s.id||Q(n(o))!==Q(ne(s))||JSON.stringify(de(n(o)))!==JSON.stringify(de(ne(s))))return false}return true}function Xa(e,t,r,n,a){for(let o=0;r+o<e.length;o+=1){let s=e[r+o],l=t[n+o];if(!l||l.attrs.nodeId!==s.id||Q(a(l))!==Q(ne(s))||JSON.stringify(de(a(l)))!==JSON.stringify(de(ne(s))))return false}return true}function ll(e,t){return eb(e,t)!==null}function Yr(e,t,r){if(!r||r.created.length>0||r.deleted.length>0||r.splitJoin.length>0)return Te(t);let n=new Map;e.forEach(i=>{let d=i.attrs.nodeId;typeof d=="string"&&n.set(d,i);});let a=new Set(r.dirty),o=Ze(t);if(o.length!==e.childCount)return Te(t);let s=Te(t),l=[];for(let[i,d]of o.entries()){let c=n.get(d.id);l.push(c&&!a.has(d.id)?c:s.child(i));}return X.node("doc",null,l)}var Wa=0;function za(e,t){let r=e.currentPackage();if(t===r)return {ok:true,change:null};if(!t.parts.has(t.mainDocumentPart))return {ok:false,reason:"missing-main-part"};if(t.mainDocumentPart!==r.mainDocumentPart)return {ok:false,reason:"different-main-part"};let n=e.packageRevision;return e.installAuthoritativePackageSnapshot(t),e.adoptPackageUnit(r),Wa+=1,{ok:true,change:e.publishStoryWrite({change:"model-change",fromRevision:n,toRevision:n+1,commitId:`pkg-replace-${Wa}`,origin:g.mutationHuman,dirty:[],created:[],deleted:[],splitJoin:[],dependencyKeys:[],impact:"global",story:{kind:"body",partName:e.bodyStore().part.name}})}}var Jr=e=>e,w={c:ye,a:va,r:ya$1},cl={c:w.c,a:w.a,r:w.r},P=class extends Error{constructor(r,n){super(n?`${r}: ${n}`:r);this.reason=r;this.detail=n;}reason;detail},T=e=>e?e.children.filter(t=>t.kind!=="textValue"):[];function Zr(e){if(typeof e!="string")return {ns:e.namespaceUri,local:"local"in e?e.local:e.localName};let t=e.indexOf(":");return t<0?{ns:"",local:e}:{ns:cl[e.slice(0,t)]??"",local:e.slice(t+1)}}function U(e,t){let{ns:r,local:n}=Zr(t);return T(e).find(a=>a.namespaceUri===r&&a.localName===n)}function Ie(e,t){let{ns:r,local:n}=Zr(t);return T(e).filter(a=>a.namespaceUri===r&&a.localName===n)}function I(e,t){if(!e)return;let{ns:r,local:n}=Zr(t);return e.attributes.find(a=>a.namespaceUri===r&&a.localName===n)?.value}function Qr(e){let t="";for(let r of e?.children??[])r.kind==="textValue"&&(t+=r.value);return t}var Ae=(e,t)=>({kind:"genericExtension",namespaceUri:"",localName:e,value:t});function Qe(e,t){let r=Pa(t,{name:e,contentType:"application/xml"});return r.ok?{ok:true,part:{root:Jr(r.part.root)}}:{ok:false,reason:r.reason}}function Kt(e,t){return Ha$1({id:e,name:e,contentType:"application/xml",root:t})}var dl=new Set(["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6"]);function qr(e){if(typeof e=="string")return /^#[0-9A-Fa-f]{6}$/.test(e);if(!e||typeof e!="object")return false;let{theme:t,shift:r}=e;return typeof t!="string"||!dl.has(t)?false:r===void 0||typeof r=="number"&&Number.isInteger(r)&&Math.abs(r)<100}function Va(e){if(!qr(e))throw new P("chart.errors.invalidValue","color");if(typeof e=="string")return `<a:srgbClr val="${e.replace(/^#/,"").toUpperCase()}"/>`;let t=e.shift??0;if(t===0)return `<a:schemeClr val="${e.theme}"/>`;let r=`<a:lumMod val="${(100-Math.abs(t))*1e3}"/>`,n=t>0?`<a:lumOff val="${t*1e3}"/>`:"";return `<a:schemeClr val="${e.theme}">${r}${n}</a:schemeClr>`}var Me=4e3,kt=255,qe=255;function Se(e,t=-1/0){let r=t;for(let n of e)n>r&&(r=n);return r}function Zt(e,t=1/0){let r=t;for(let n of e)n<r&&(r=n);return r}var Ja={barChart:"category",bar3DChart:"category",lineChart:"category",line3DChart:"category",areaChart:"category",area3DChart:"category",pieChart:"category",pie3DChart:"category",doughnutChart:"category",radarChart:"category",scatterChart:"xy"},ul=new Set(["bubbleChart","stockChart","surfaceChart","surface3DChart","ofPieChart"]),ml=16384,Ga=1048576;function Jt(e){let t=0;for(let r of e)t=t*26+(r.charCodeAt(0)-64);return t>=1&&t<=ml?t:void 0}function ae(e){let t="";for(let r=e;r>0;r=Math.floor((r-1)/26))t=String.fromCharCode(65+(r-1)%26)+t;return t}var fl=/^(.+)!\$?([A-Z]{1,3})\$?([0-9]{1,7})(?::\$?([A-Z]{1,3})\$?([0-9]{1,7}))?$/;function en(e){let t=e===void 0?null:fl.exec(e.trim());if(!t)return;let r=t[1];if(r.startsWith("'")?!/^'(?:[^']|'')+'$/.test(r):/[' !,()]/.test(r))return;let n=Jt(t[2]),a=Number(t[3]),o=t[4]?Jt(t[4]):n,s=t[5]?Number(t[5]):a;if(!(!n||!o||a<1||s<1||a>Ga||s>Ga)&&!(o<n||s<a))return {sheet:r,c1:n,r1:a,c2:o,r2:s}}function Za(e){return e.startsWith("'")?e.slice(1,-1).replaceAll("''","'"):e}function ue(e,t,r,n,a){let o=`$${ae(t)}$${r}`;return t===n&&r===a?`${e}!${o}`:`${e}!${o}:$${ae(n)}$${a}`}var W=(e,t)=>U(e,{namespaceUri:w.c,local:t});function pl(e){let t=Number(I(W(e,"ptCount"),"val")??0),r=Ie(e,{namespaceUri:w.c,localName:"pt"});if(!Number.isInteger(t)||t<0||t>Me||r.length>Me)return;let n=Array.from({length:t},()=>{});for(let a of r){let o=Number(I(a,"idx"));if(!Number.isInteger(o)||o<0||o>=t)continue;let s=W(a,"v");n[o]=s?Yt(s):void 0;}return n}function Yt(e){let t="";for(let r of e.children)r.kind==="textValue"&&(t+=r.value);return t}function hl(e){let t=W(e,"v");if(t)return {kind:"v",values:[Yt(t)]};for(let r of ["strRef","numRef","strLit","numLit"]){let n=W(e,r);if(!n)continue;let a=r==="strRef"||r==="numRef",o=a?W(n,r==="strRef"?"strCache":"numCache"):n,s=o?pl(o):[];if(!s)return "chart.errors.tooLarge";let l=o?Yt(W(o,"formatCode")??Ka):void 0;return {kind:r,...a?{formula:Yt(W(n,"f")??Ka)}:{},...r==="numRef"||r==="numLit"?{formatCode:l||"General"}:{},values:s}}return "chart.errors.multiLevel"}var Ka={children:[]};function gl(e){let t=W(W(e,"chart"),"plotArea");return T(t).filter(r=>r.namespaceUri===w.c&&(r.localName in Ja||ul.has(r.localName)))}function yl(e){let t=W(W(e,"chart"),"plotArea");for(let r of T(t))for(let n of Ie(W(r,"extLst"),{namespaceUri:w.c,localName:"ext"}))if(T(n).some(a=>/^filtered.*Series$/.test(a.localName)))return true;return false}function et(e){let t=gl(e);if(t.length===0)return {ok:false,reason:"chart.errors.noData"};if(t.length>1)return {ok:false,reason:"chart.errors.combination"};let r=t[0],n=Ja[r.localName];if(!n)return {ok:false,reason:"chart.errors.unsupportedType"};if(yl(e))return {ok:false,reason:"chart.errors.filtered"};let a=Ie(r,{namespaceUri:w.c,localName:"ser"});if(a.length===0)return {ok:false,reason:"chart.errors.noData"};if(a.length>kt)return {ok:false,reason:"chart.errors.tooLarge"};let o=n==="xy"?"xVal":"cat",s=n==="xy"?"yVal":"val",l=[];for(let[y,k]of a.entries()){let C={};for(let[R,F]of [["tx","tx"],["cat",o],["val",s]]){let $=W(k,F);if(!$)continue;let L=hl($);if(typeof L=="string")return {ok:false,reason:L};if(R==="val"&&L.kind!=="numRef"&&L.kind!=="numLit")return {ok:false,reason:"chart.errors.unsupportedType"};if(R==="tx"&&L.kind!=="v"&&L.kind!=="strRef")return {ok:false,reason:"chart.errors.unsupportedType"};C[R]=L;}let N=Number(I(W(k,"order"),"val")),O=C.tx?.values.find(R=>R!==void 0)??"";l.push({el:k,order:Number.isFinite(N)?N:y,at:y,s:{el:k,name:O,...C}});}l.sort((y,k)=>y.order-k.order||y.at-k.at);let i=l.map(y=>y.s),d=i.filter(y=>y.cat),c=d[0]?.cat;for(let y of d){let k=y.cat;if(k.formula!==c.formula||k.values.join("\0")!==c.values.join("\0"))return {ok:false,reason:"chart.errors.mixedCategories"}}let u=Se(i.map(y=>y.val?.values.length??0),c?.values.length??0);if(u===0)return {ok:false,reason:"chart.errors.noData"};if(u>Me)return {ok:false,reason:"chart.errors.tooLarge"};let f=Array.from({length:u},(y,k)=>c?c.values[k]??"":String(k+1)),m=c?.kind==="numRef"||c?.kind==="numLit",h=i.some(y=>y.tx?.formula||y.cat?.formula||y.val?.formula),g=xl(i,u);return {ok:true,model:{kind:n,plot:r,series:i,categories:f,hasCategories:!!c,numericCategories:m,...g?{layout:g}:{},hasFormulas:h}}}function Ya(e,t){return t==="cols"?e.c1===e.c2?{line:e.c1,from:e.r1,to:e.r2}:void 0:e.r1===e.r2?{line:e.r1,from:e.c1,to:e.c2}:void 0}function xl(e,t){for(let r of ["cols","rows"]){let n=kl(e,t,r);if(n)return n}}function kl(e,t,r){let n,a,o,s,l=[],i=u=>(n??=u.sheet)===u.sheet;for(let u of e){let f=en(u.val?.formula),m=f&&Ya(f,r);if(!f||!m||!i(f)||m.to-m.from+1!==t||(a??=m.from)!==m.from||l.includes(m.line))return;l.push(m.line);let h=u.tx?.formula?en(u.tx.formula):void 0;if(u.tx?.formula&&!h||(s??=!!h)!==!!h)return;if(h){let[g,y]=r==="cols"?[h.c1,h.r1]:[h.r1,h.c1];if(h.c1!==h.c2||h.r1!==h.r2||!i(h)||g!==m.line||(o??=y)!==y||y>=a)return}}let d=e.find(u=>u.cat)?.cat?.formula,c;if(d){let u=en(d),f=u&&Ya(u,r);if(!u||!f||!i(u)||f.from!==a||f.to-f.from+1!==t||l.includes(f.line))return;c=f.line;}return {sheet:n,orientation:r,start:a,...o!==void 0?{header:o}:{},...c!==void 0?{categoryLine:c}:{},lines:l}}var Qa=e=>e.trim()!==""&&Number.isFinite(Number(e));function qa(e){if(typeof e!="string"||e.length>qe||!X$1(e))throw new P("chart.errors.invalidText");return e}function es(e,t,r){if(e!==void 0){if(typeof e!="number"||!Number.isInteger(e)||e<0||e>=t)throw new P("chart.errors.unsupported","source");if(r.has(e))throw new P("chart.errors.unsupported","source");return r.add(e),e}}function rn(e,t){if(!t||typeof t!="object"||t.kind!==e.kind)throw new P("chart.errors.unsupported","kind");let{categories:r,series:n}=t;if(!Array.isArray(r)||!Array.isArray(n))throw new P("chart.errors.unsupported","data");if(r.length===0||n.length===0)throw new P("chart.errors.empty");if(r.length>Me||n.length>kt)throw new P("chart.errors.tooLarge");let a=new Set,o=r.map(k=>qa(k?.label)),s=r.map(k=>es(k.source,e.categories.length,a)),l=new Set,i=n.map(k=>{let C=qa(k?.name);if(!Array.isArray(k.values)||k.values.length!==o.length)throw new P("chart.errors.unsupported","values");for(let O of k.values)if(O!==null&&(typeof O!="number"||!Number.isFinite(O)))throw new P("chart.errors.notNumber");let N=es(k.source,e.series.length,l);return {name:C,values:[...k.values],...N!==void 0?{source:N}:{}}}),d=e.kind==="xy"&&(e.numericCategories||!e.hasCategories);if(d&&!o.every(Qa))throw new P("chart.errors.notNumber");let c=(e.numericCategories||d)&&o.every(Qa);if((o.length!==e.categories.length||s.some((k,C)=>k!==C)||i.length!==e.series.length||i.some((k,C)=>k.source!==C))&&e.hasFormulas&&!e.layout)throw new P("chart.errors.layout");let f=e.layout;if(!f)return {model:e,labels:o,categorySources:s,series:i,numericCategories:c};let m=Zt(f.lines),h=bl(f)?k=>m+k:void 0,g=Se(f.lines,f.categoryLine??0),y=i.map((k,C)=>({...k,line:h?h(C):k.source!==void 0?f.lines[k.source]:g+=1}));if(g=Se(y.map(k=>k.line),g),g>(f.orientation==="cols"?16384:1048576))throw new P("chart.errors.tooLarge");if(f.start+o.length-1>(f.orientation==="cols"?1048576:16384))throw new P("chart.errors.tooLarge");return {model:e,labels:o,categorySources:s,series:y,numericCategories:c,layout:{...f,lines:y.map(k=>k.line)}}}function bl(e){let t=e.lines;return t.some((r,n)=>n>0&&r!==t[n-1]+1)?false:e.categoryLine===void 0||e.categoryLine===t[0]-1}function z(e,t={},r=[]){return {id:"",kind:"generic",namespaceUri:w.c,localName:e,prefix:"c",namespaceBindings:[],attributes:Object.entries(t).map(([n,a])=>Ae(n,a)),children:r}}var Qt=e=>({kind:"textValue",id:"",value:e}),qt=(e,t)=>z(e,{val:String(t)}),q=(e,t)=>e.kind!=="textValue"&&e.namespaceUri===w.c&&e.localName===t;function ns(e,t,r){let n=e.start+r-1;return e.orientation==="cols"?ue(e.sheet,t,e.start,t,n):ue(e.sheet,e.start,t,n,t)}function Pl(e,t){let r=e.header;return e.orientation==="cols"?ue(e.sheet,t,r,t,r):ue(e.sheet,r,t,r,t)}var os=e=>String(Object.is(e,-0)?0:e);function ts(e){let t=[qt("ptCount",e.length)];return e.forEach((r,n)=>{r!==null&&t.push(z("pt",{idx:String(n)},[z("v",{},[Qt(r)])]));}),t}function er(e,t,r,n,a){let o=e?[z("formatCode",{},[Qt(n?.formatCode??"General")])]:[];if(r===void 0)return z(e?"numLit":"strLit",{},[...o,...ts(t)]);let s=e?"numRef":"strRef",l=z(e?"numCache":"strCache",{},[...o,...ts(t)]),i=a&&n?.formula===r?T(a).filter(d=>d.localName==="extLst"):[];return z(s,{},[z("f",{},[Qt(r)]),l,...i])}var tr=e=>e?T(e).find(t=>t.namespaceUri===w.c):void 0;function vl(e,t,r){let n=e.layout;if(n?.header!==void 0&&t.line!==void 0)return z("tx",{},[er(false,[t.name],Pl(n,t.line),r?.tx,tr(U(r?.el,"c:tx")))]);if(r?.tx?.kind==="strRef"&&r.tx.formula)return z("tx",{},[er(false,[t.name],r.tx.formula,r.tx,tr(U(r.el,"c:tx")))]);if(!(!r?.tx&&t.name===""))return z("tx",{},[z("v",{},[Qt(t.name)])])}function Sl(e,t,r){let{model:n,labels:a,layout:o}=e,s=a.every((u,f)=>u===String(f+1));if(!n.hasCategories&&s)return;let l=r?.cat??n.series.find(u=>u.cat)?.cat,i=o?.categoryLine!==void 0?ns(o,o.categoryLine,a.length):l?.formula&&!o?l.formula:void 0,d=e.numericCategories?a.map(u=>os(Number(u))):a,c=r?U(r.el,`c:${t}`):void 0;return z(t,{},[er(e.numericCategories,d,i,l,tr(c))])}function Cl(e,t,r,n){let a=e.layout,o=n?.val??e.model.series.find(d=>d.val)?.val,s=a?ns(a,r.line,r.values.length):n?.val?.formula||void 0,l=r.values.map(d=>d===null?null:os(d)),i=n?U(n.el,`c:${t}`):void 0;return z(t,{},[er(true,l,s,o,tr(i))])}function tn(e,t){let r=[];for(let n of e.children)if(q(n,"dPt")||q(n,"dLbl")){let a=Number(I(U(n,"c:idx"),"val")),o=t.get(a);if(o===void 0)continue;r.push({...n,children:n.children.map(s=>q(s,"idx")?qt("idx",o):s)});}else q(n,"dLbls")?r.push(tn(n,t)):r.push(n);return {...e,children:r}}var Rl=new Set(["spPr","dPt","trendline","errBars","explosion","pictureOptions","extLst"]);function Ol(e){if(e.kind==="textValue"||e.namespaceUri!==w.c)return e;if(!Rl.has(e.localName))return e.localName!=="marker"?e:{...e,children:e.children.filter(t=>!q(t,"spPr"))}}function bt(e,t,r,n){let a=[...e],o=a.findIndex(l=>q(l,r));if(o>=0)return t?a[o]=t:a.splice(o,1),a;if(!t)return a;let s=0;return a.forEach((l,i)=>{n.some(d=>q(l,d))&&(s=i+1);}),a.splice(s,0,t),a}var rs=["idx","order","tx","spPr","invertIfNegative","pictureOptions","marker","explosion","dPt","dLbls","trendline","errBars"];function wl(e){let{model:t}=e,r=t.kind==="xy",[n,a]=r?["xVal","yVal"]:["cat","val"],o=new Map;e.categorySources.forEach((i,d)=>{i!==void 0&&o.set(i,d);});let s=Se(T(t.plot).filter(i=>q(i,"ser")).map(i=>Number(I(U(i,"c:idx"),"val"))).filter(Number.isFinite),-1),l=t.series[t.series.length-1];return e.series.map((i,d)=>{let c=i.source!==void 0?t.series[i.source]:void 0,u;if(c)u=tn(c.el,o);else {let m=l.el.children.map(Ol).filter(h=>h!==void 0);u=tn({...l.el,children:m},new Map),u={...u,children:bt(u.children,qt("idx",s+=1),"idx",[])};}let f=bt(u.children,qt("order",d),"order",["idx"]);return f=bt(f,vl(e,i,c),"tx",["idx","order"]),f=bt(f,Sl(e,n,c),n,rs),f=bt(f,Cl(e,a,i,c),a,[...rs,n]),{...u,children:f}})}function as(e,t){let r=wl(t),n=t.model.plot,a=n.children.findIndex(u=>q(u,"ser")),o=n.children.filter(u=>!q(u,"ser")),s=n.children.slice(0,a).filter(u=>!q(u,"ser")).length,l={...n,children:[...o.slice(0,s),...r,...o.slice(s)]},i=U(e,"c:chart"),d=U(i,"c:plotArea"),c=(u,f,m)=>({...u,children:u.children.map(h=>h===f?m:h)});return c(e,i,c(i,d,c(d,n,l)))}var El=`xmlns:c="${w.c}" xmlns:a="${w.a}" xmlns:r="${w.r}"`;function rr(e){let t=Qe("/chart-fragment.xml",`<c:w ${El}>${e}</c:w>`);if(!t.ok)throw new P("chart.errors.unsupported","template");return T(t.part.root)}function D(e){let[t]=rr(e);if(!t)throw new P("chart.errors.unsupported","template");return t}var E=(e,t)=>U(e,{namespaceUri:w.c,local:t}),me=(e,t)=>T(e).filter(r=>r.namespaceUri===w.c&&r.localName===t),B=(e,t)=>I(E(e,t),"val");function De(e,t,r){let n=E(e,t);if(!n)return r;let a=I(n,"val");return a===void 0||a==="1"||a==="true"}var M=(e,t)=>({...e,children:[...t]}),tt=(e,t)=>M(e,e.children.filter(r=>r.kind==="textValue"||!t(r))),se=(e,...t)=>tt(e,r=>r.namespaceUri===w.c&&t.includes(r.localName));function H(e,t,r){let n=r.indexOf(t.localName),a=e.children.filter(s=>!(s.kind!=="textValue"&&s.namespaceUri===t.namespaceUri&&s.localName===t.localName)),o=a.findIndex(s=>s.kind!=="textValue"&&s.namespaceUri===t.namespaceUri&&r.indexOf(s.localName)>n);return o<0?M(e,[...a,t]):M(e,[...a.slice(0,o),t,...a.slice(o)])}var K=(e,t,r)=>M(e,e.children.map(n=>n===t?r:n)),Fe=["title","autoTitleDeleted","pivotFmts","view3D","floor","sideWall","backWall","plotArea","legend","plotVisOnly","dispBlanksAs","showDLblsOverMax","extLst"],rt=["axId","scaling","delete","axPos","majorGridlines","minorGridlines","title","numFmt","majorTickMark","minorTickMark","tickLblPos","spPr","txPr","crossAx","crosses","crossesAt","crossBetween","auto","lblAlgn","lblOffset","baseTimeUnit","majorUnit","minorUnit","majorTimeUnit","minorTimeUnit","tickLblSkip","tickMarkSkip","dispUnits","noMultiLvlLbl","extLst"],ss=["legendPos","legendEntry","layout","overlay","spPr","txPr","extLst"],nn=["idx","order","tx","spPr","explosion","invertIfNegative","pictureOptions","marker","dPt","dLbls","trendline","errBars","cat","xVal","val","yVal","shape","smooth","extLst"],is=["idx","invertIfNegative","marker","bubble3D","explosion","spPr","pictureOptions","extLst"],on=["xfrm","noFill","solidFill","gradFill","blipFill","pattFill","grpFill","ln","effectLst","effectDag","scene3d","sp3d","extLst"],Pt=new Set(["noFill","solidFill","gradFill","blipFill","pattFill","grpFill"]),Nl=new Set(["bg1","tx1","bg2","tx2","accent1","accent2","accent3","accent4","accent5","accent6"]);function vt(e){if(!e||e.namespaceUri!==w.a||e.localName!=="solidFill")return null;let t=T(e)[0];if(!t)return null;let r=I(t,"val")??"";if(t.localName==="srgbClr")return /^[0-9A-Fa-f]{6}$/.test(r)?`#${r.toUpperCase()}`:null;if(t.localName!=="schemeClr"||!Nl.has(r))return null;let n=Number(I(U(t,"a:lumMod"),"val")??1e5),a=Number(I(U(t,"a:lumOff"),"val")??0),o=a>0?Math.round(a/1e3):n<1e5?-Math.round(100-n/1e3):0,s=r;return o!==0&&Math.abs(o)<100?{theme:s,shift:o}:{theme:s}}var St=e=>`<a:solidFill>${Va(e)}</a:solidFill>`;function ls(e,t="<a:bodyPr/>",r='<a:rPr lang="en-US"/>'){let n=e?`<a:r>${r}<a:t>${V(e)}</a:t></a:r>`:'<a:endParaRPr lang="en-US"/>';return `<c:rich>${t}<a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr>${n}</a:p></c:rich>`}var Tl=["columnClustered","columnStacked","columnPercentStacked","barClustered","barStacked","barPercentStacked","line","lineMarkers","area","areaStacked","areaPercentStacked","pie","doughnut","radar","scatter","scatterLines"],or=e=>typeof e=="string"&&Tl.includes(e),Ct={columnClustered:{plot:"barChart",axes:"category",lines:false,barDir:"col",grouping:"clustered"},columnStacked:{plot:"barChart",axes:"category",lines:false,barDir:"col",grouping:"stacked"},columnPercentStacked:{plot:"barChart",axes:"category",lines:false,barDir:"col",grouping:"percentStacked"},barClustered:{plot:"barChart",axes:"category",lines:false,barDir:"bar",grouping:"clustered"},barStacked:{plot:"barChart",axes:"category",lines:false,barDir:"bar",grouping:"stacked"},barPercentStacked:{plot:"barChart",axes:"category",lines:false,barDir:"bar",grouping:"percentStacked"},line:{plot:"lineChart",axes:"category",lines:true,grouping:"standard",markers:false},lineMarkers:{plot:"lineChart",axes:"category",lines:true,grouping:"standard",markers:true},area:{plot:"areaChart",axes:"category",lines:false,grouping:"standard"},areaStacked:{plot:"areaChart",axes:"category",lines:false,grouping:"stacked"},areaPercentStacked:{plot:"areaChart",axes:"category",lines:false,grouping:"percentStacked"},pie:{plot:"pieChart",axes:"none",lines:false},doughnut:{plot:"doughnutChart",axes:"none",lines:false},radar:{plot:"radarChart",axes:"category",lines:true,markers:false},scatter:{plot:"scatterChart",axes:"xy",lines:true,markers:true},scatterLines:{plot:"scatterChart",axes:"xy",lines:true,markers:true}},Rt=e=>Ct[e].axes;function ar(e){return e.localName==="radarChart"?B(e,"radarStyle")!=="filled":e.localName==="lineChart"||e.localName==="line3DChart"||e.localName==="scatterChart"}var nt=e=>e.localName==="pieChart"||e.localName==="pie3DChart"||e.localName==="doughnutChart";function Ot(e){return nt(e)||e.localName==="ofPieChart"?"none":e.localName==="scatterChart"||e.localName==="bubbleChart"?"xy":"category"}var Il=e=>B(E(e,"marker"),"symbol")==="none",Al=e=>{let t=T(E(e,"spPr")).find(r=>r.namespaceUri===w.a&&r.localName==="ln");return T(t).some(r=>r.localName==="noFill")};function sn(e){let t=me(e,"ser"),r=B(e,"grouping")??"standard";switch(e.localName){case "barChart":{let n=B(e,"barDir")==="bar";return r==="stacked"?n?"barStacked":"columnStacked":r==="percentStacked"?n?"barPercentStacked":"columnPercentStacked":n?"barClustered":"columnClustered"}case "lineChart":return r!=="standard"?null:!De(e,"marker",true)||t.every(Il)?"line":"lineMarkers";case "areaChart":return r==="stacked"?"areaStacked":r==="percentStacked"?"areaPercentStacked":"area";case "pieChart":return "pie";case "doughnutChart":return "doughnut";case "radarChart":return B(e,"radarStyle")==="filled"?null:"radar";case "scatterChart":return t.length>0&&t.every(Al)?"scatter":"scatterLines";default:return null}}var Ml=e=>T(e).find(t=>t.namespaceUri===w.a&&t.localName==="ln"),nr=e=>T(e).find(t=>t.namespaceUri===w.a&&Pt.has(t.localName));function sr(e,t){let r=E(e,"spPr");return t?vt(nr(Ml(r)))??vt(nr(E(E(e,"marker"),"spPr")))??vt(nr(r)):vt(nr(r))}function Dl(e,t,r){let n=r?St(r):"";if(!e.lines)return r?`<c:spPr>${n}</c:spPr>`:"";let a=t==="scatter"?'<a:ln w="25400" cap="rnd"><a:noFill/><a:round/></a:ln>':`<a:ln w="28575" cap="rnd">${n}<a:round/></a:ln>`,o=t==="scatter"||r?`<c:spPr>${a}</c:spPr>`:"",s=e.markers?r?`<c:marker><c:symbol val="circle"/><c:size val="5"/><c:spPr>${n}<a:ln w="9525">${n}</a:ln></c:spPr></c:marker>`:'<c:marker><c:symbol val="circle"/><c:size val="5"/></c:marker>':'<c:marker><c:symbol val="none"/></c:marker>';return o+s}var cs=(e,t)=>({...e,localName:t});function Fl(e,t,r,n,a){let o=a.axes==="xy",s=a.axes==="none"&&nt(r),l=nt(r)?null:sr(e,ar(r)),i=E(e,"idx")??D(`<c:idx val="${t}"/>`),d=E(e,"order")??D(`<c:order val="${t}"/>`),c=E(e,"cat")??E(e,"xVal"),u=E(e,"val")??E(e,"yVal"),f=E(e,"tx"),m=[i,d];f&&m.push(f);for(let g of rr(Dl(a,n,l)))m.push(g);if(a.plot==="barChart"&&m.push(D('<c:invertIfNegative val="0"/>')),s)for(let g of me(e,"dPt"))m.push(g);c&&m.push(cs(c,o?"xVal":"cat")),u&&m.push(cs(u,o?"yVal":"val")),(a.plot==="lineChart"||a.plot==="scatterChart")&&m.push(D('<c:smooth val="0"/>'));let h=E(e,"extLst");return h&&m.push(h),M(e,m)}function Ll(e,t){let r=Ct[e],n=t.map(a=>`<c:axId val="${a}"/>`).join("");switch(r.plot){case "barChart":{let a=r.grouping!=="clustered";return {open:`<c:barChart><c:barDir val="${r.barDir}"/><c:grouping val="${r.grouping}"/><c:varyColors val="0"/>`,close:`<c:gapWidth val="${a?150:219}"/><c:overlap val="${a?100:-27}"/>${n}</c:barChart>`}}case "lineChart":return {open:'<c:lineChart><c:grouping val="standard"/><c:varyColors val="0"/>',close:`<c:marker val="1"/>${n}</c:lineChart>`};case "areaChart":return {open:`<c:areaChart><c:grouping val="${r.grouping}"/><c:varyColors val="0"/>`,close:`${n}</c:areaChart>`};case "pieChart":return {open:'<c:pieChart><c:varyColors val="1"/>',close:'<c:firstSliceAng val="0"/></c:pieChart>'};case "doughnutChart":return {open:'<c:doughnutChart><c:varyColors val="1"/>',close:'<c:firstSliceAng val="0"/><c:holeSize val="75"/></c:doughnutChart>'};case "radarChart":return {open:'<c:radarChart><c:radarStyle val="marker"/><c:varyColors val="0"/>',close:`${n}</c:radarChart>`};default:return {open:'<c:scatterChart><c:scatterStyle val="lineMarker"/><c:varyColors val="0"/>',close:`${n}</c:scatterChart>`}}}var ds='<c:spPr><a:noFill/><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></c:spPr>',us='<c:txPr><a:bodyPr rot="-60000000" vert="horz"/><a:lstStyle/><a:p><a:pPr><a:defRPr sz="1197" b="0" i="0" u="none" strike="noStrike" baseline="0"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:pPr><a:endParaRPr lang="en-US"/></a:p></c:txPr>';function _l(e,t,r){return `<c:catAx><c:axId val="${e}"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="0"/><c:axPos val="${r}"/><c:numFmt formatCode="General" sourceLinked="1"/><c:majorTickMark val="none"/><c:minorTickMark val="none"/><c:tickLblPos val="nextTo"/>${ds}${us}<c:crossAx val="${t}"/><c:crosses val="autoZero"/><c:auto val="1"/><c:lblAlgn val="ctr"/><c:lblOffset val="100"/><c:noMultiLvlLbl val="0"/></c:catAx>`}function an(e,t,r,n,a){let o=n?`<c:majorGridlines>${ds}</c:majorGridlines>`:"";return `<c:valAx><c:axId val="${e}"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="0"/><c:axPos val="${r}"/>${o}<c:numFmt formatCode="General" sourceLinked="1"/><c:majorTickMark val="none"/><c:minorTickMark val="none"/><c:tickLblPos val="nextTo"/><c:spPr><a:noFill/><a:ln><a:noFill/></a:ln></c:spPr>${us}<c:crossAx val="${t}"/><c:crosses val="autoZero"/><c:crossBetween val="${a}"/></c:valAx>`}function ln(e,t){let r=Ct[e],[n,a]=t;if(r.axes==="none")return "";if(r.axes==="xy")return an(n,a,"b",false,"midCat")+an(a,n,"l",true,"midCat");let o=r.barDir==="bar";return _l(n,a,o?"l":"b")+an(a,n,o?"b":"l",true,r.plot==="areaChart"?"midCat":"between")}var $l=new Set(["catAx","valAx","dateAx","serAx"]),Le=e=>T(e).filter(t=>t.namespaceUri===w.c&&$l.has(t.localName)),Ul=["view3D","floor","sideWall","backWall"];function Bl(e){let t=new Set(Le(e).map(n=>B(n,"axId"))),r=[];for(let n=500000001;r.length<2;n+=1)t.has(String(n))||r.push(String(n));return [r[0],r[1]]}function Hl(e,t,r){let n=Ct[r];if(n.axes==="none")return {ids:[],axes:[]};let a=Le(e),o=me(t,"axId").map(c=>I(c,"val")??""),s=o.map(c=>a.find(u=>B(u,"axId")===c));if(!(Ot(t)===n.axes&&s.length===2&&s.every(c=>c!==void 0)&&(n.axes==="xy"?s.every(c=>c.localName==="valAx"):s.some(c=>c.localName==="valAx")&&s.some(c=>c.localName!=="valAx")))){let c=Bl(e);return {ids:c,axes:rr(ln(r,c))}}if(n.plot!=="barChart")return {ids:o,axes:s};let i=n.barDir==="bar",d=s.map(c=>{let f=c.localName==="valAx"===i?"b":"l";return H(c,D(`<c:axPos val="${f}"/>`),rt)});return {ids:o,axes:d}}function ir(e,t,r){let n=E(e,"plotArea");if(!n)throw new P("chart.errors.noData");let a=Ct[r],{ids:o,axes:s}=Hl(n,t,r),l=me(t,"ser").map((R,F)=>Fl(R,F,t,r,a)),i=E(t,"dLbls"),{open:d,close:c}=Ll(r,o),u=D(`${d}${c}`),f=T(u).findIndex(R=>R.localName==="varyColors")+1,m=T(u),h=M(u,[...m.slice(0,f),...l,...i?[i]:[],...m.slice(f)]),g=new Set(Le(n)),y=M(n,[...n.children.filter(R=>R!==t&&!(R.kind!=="textValue"&&g.has(R)))]),k=y.children.findIndex(R=>R.kind!=="textValue"&&R.namespaceUri===w.c&&(R.localName==="dTable"||R.localName==="spPr"||R.localName==="extLst")),C=k<0?y.children.length:k,N=M(y,[...y.children.slice(0,C),h,...s,...y.children.slice(C)]),O=tt(e,R=>R.namespaceUri===w.c&&Ul.includes(R.localName));return O=H(O,N,Fe),O}var jl={t:"top",b:"bottom",l:"left",r:"right",tr:"right"},ms={top:"t",bottom:"b",left:"l",right:"r"};function xs(e){let t=E(e,"tx"),r=E(t,"rich");if(r)return T(r).filter(o=>o.namespaceUri===w.a&&o.localName==="p").map(o=>ks(o)).join(" ");let n=E(E(t,"strRef"),"strCache"),a=E(E(n,"pt"),"v");return a?Qr(a):void 0}function ks(e){let t="";for(let r of T(e))t+=r.namespaceUri===w.a&&r.localName==="t"?Qr(r):ks(r);return t}function Xl(e,t){let r=E(e,"title"),n=t.series.length===1?t.series[0].name:void 0;return r?xs(r)??n??"Chart Title":!De(e,"autoTitleDeleted",false)&&n!==void 0?n:null}function bs(e,t){let r=me(t,"axId").map(a=>I(a,"val")),n=Le(e).filter(a=>r.includes(B(a,"axId")));if(Ot(t)==="xy"){let a=n.find(o=>["l","r"].includes(B(o,"axPos")??""));return {value:a??n[1],category:n.find(o=>o!==(a??n[1]))}}return {value:n.find(a=>a.localName==="valAx"),category:n.find(a=>a.localName==="catAx"||a.localName==="dateAx")}}function fs(e){return !e||De(e,"delete",false)?false:["showVal","showPercent","showCatName","showSerName"].some(t=>De(e,t,false))}var ps=e=>({theme:`accent${e%6+1}`});function Wl(e){let t=e.plot;if(nt(t)){let n=e.series[0]?.el,a=me(n,"dPt");return {by:"point",colors:e.categories.map((o,s)=>{let l=a.find(i=>B(i,"idx")===String(s));return {name:o,color:l?sr(l,false):null,automatic:ps(s)}})}}let r=ar(t);return {by:"series",colors:e.series.map((n,a)=>{let o=Number(B(n.el,"idx"));return {name:n.name,color:sr(n.el,r),automatic:ps(Number.isInteger(o)&&o>=0?o:a)}})}}function lr(e){let t=et(e);if(!t.ok)throw new P(t.reason);let r=E(e,"chart");if(!r)throw new P("chart.errors.noData");return {chartSpace:e,chart:r,model:t.model}}function Ps(e){let t;try{t=lr(e);}catch(m){if(m instanceof P)return {ok:false,reason:m.reason};throw m}let{chart:r,model:n}=t,a=n.plot,o=E(r,"plotArea"),s=E(r,"legend"),l=Ot(a)!=="none",i=bs(o,a),d=m=>{let h=E(m,"title");return h?xs(h)??"Axis Title":null},{by:c,colors:u}=Wl(n);return {ok:true,format:{type:sn(a),title:Xl(r,n),legend:s?jl[B(s,"legendPos")??"r"]??"right":"none",dataLabels:fs(E(a,"dLbls"))||n.series.some(m=>fs(E(m.el,"dLbls"))),gridlines:l?!!E(i.value,"majorGridlines"):null,axes:l?Le(o).some(m=>!De(m,"delete",false)):null,axisTitles:l?{category:d(i.category),value:d(i.value)}:null,colorsBy:c,colors:u}}}function cn(e){if(typeof e!="string"||e.length>qe||!X$1(e))throw new P("chart.errors.invalidText");return e}function vs(e,t,r){let n=E(E(e,"tx"),"rich"),a=T(n).find(m=>m.namespaceUri===w.a&&m.localName==="bodyPr"),o=T(n).filter(m=>m.namespaceUri===w.a&&m.localName==="p").flatMap(m=>T(m)).find(m=>m.namespaceUri===w.a&&m.localName==="r"),s=T(o).find(m=>m.namespaceUri===w.a&&m.localName==="rPr"),i=D(`<c:tx>${ls(t,r?'<a:bodyPr rot="-5400000" vert="horz"/>':"<a:bodyPr/>")}</c:tx>`),d=E(i,"rich"),c=M(d,T(d).map(m=>m.localName==="bodyPr"&&a?a:m.localName!=="p"||!s?m:M(m,T(m).map(h=>h.localName==="r"?M(h,T(h).map(g=>g.localName==="rPr"?s:g)):h)))),u=M(i,[c]);if(!e)return zl('<c:title><c:overlay val="0"/></c:title>',u);let f=T(e).filter(m=>!(m.namespaceUri===w.c&&m.localName==="tx"));return M(e,[u,...f])}function zl(e,t){let r=D(e);return M(r,[t,...r.children])}function Vl(e,t){if(t===null){let n=se(e,"title");return H(n,D('<c:autoTitleDeleted val="1"/>'),Fe)}let r=H(e,vs(E(e,"title"),cn(t),false),Fe);return H(r,D('<c:autoTitleDeleted val="0"/>'),Fe)}function Gl(e,t){if(t==="none")return se(e,"legend");let r=Object.hasOwn(ms,t)?ms[t]:void 0;if(!r)throw new P("chart.errors.unsupported","legend");let n=E(e,"legend"),a=n?se(n,"layout"):D('<c:legend><c:overlay val="0"/></c:legend>'),o=H(a,D(`<c:legendPos val="${r}"/>`),ss);return H(e,o,Fe)}var Kl='<c:dLbls><c:showLegendKey val="0"/><c:showVal val="1"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>';function Yl(e,t){let r=M(e,e.children.map(o=>o.kind!=="textValue"&&o.namespaceUri===w.c&&o.localName==="ser"?se(o,"dLbls"):o));if(r=se(r,"dLbls"),!t)return r;let n=r.children,a=-1;return n.forEach((o,s)=>{o.kind!=="textValue"&&o.namespaceUri===w.c&&o.localName==="ser"&&(a=s);}),M(r,[...n.slice(0,a+1),D(Kl),...n.slice(a+1)])}var Jl='<c:majorGridlines><c:spPr><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="15000"/><a:lumOff val="85000"/></a:schemeClr></a:solidFill><a:round/></a:ln></c:spPr></c:majorGridlines>';function Zl(e,t,r){if(!r||typeof r!="object")throw new P("chart.errors.unsupported","format");let n=["title","legend","dataLabels","gridlines","axes","categoryAxisTitle","valueAxisTitle"];for(let d of Object.keys(r))if(!n.includes(d))throw new P("chart.errors.unsupported",d);let a=e;r.title!==void 0&&(a=Vl(a,r.title===null?null:cn(r.title))),r.legend!==void 0&&(a=Gl(a,r.legend));let o=r.gridlines!==void 0||r.axes!==void 0||r.categoryAxisTitle!==void 0||r.valueAxisTitle!==void 0;if(r.dataLabels===void 0&&!o)return a;let s=E(a,"plotArea"),l=T(s).find(d=>d.namespaceUri===w.c&&d.localName===t.plot.localName);if(!s||!l)throw new P("chart.errors.noData");let i=s;if(r.dataLabels!==void 0){if(typeof r.dataLabels!="boolean")throw new P("chart.errors.unsupported","dataLabels");i=K(i,l,Yl(l,r.dataLabels));}if(o){if(Ot(t.plot)==="none")throw new P("chart.errors.noAxes");let d=(g,y)=>{if(typeof g!="boolean")throw new P("chart.errors.unsupported",y);return g},c=T(i).find(g=>g.namespaceUri===w.c&&g.localName===t.plot.localName),u=bs(i,c),f=new Map,m=(g,y)=>{g&&f.set(g,y(f.get(g)??g));};if(r.gridlines!==void 0){let g=d(r.gridlines,"gridlines");m(u.value,y=>g?E(y,"majorGridlines")?y:H(y,D(Jl),rt):se(y,"majorGridlines"));}if(r.axes!==void 0){let g=d(r.axes,"axes");for(let y of Le(i))m(y,k=>H(k,D(`<c:delete val="${g?0:1}"/>`),rt));}let h=(g,y)=>{y!==void 0&&m(g,k=>{if(y===null)return se(k,"title");let C=["l","r"].includes(B(k,"axPos")??"");return H(k,vs(E(k,"title"),cn(y),C),rt)});};if(h(u.category,r.categoryAxisTitle),h(u.value,r.valueAxisTitle),r.categoryAxisTitle!==void 0&&!u.category||r.valueAxisTitle!==void 0&&!u.value)throw new P("chart.errors.noAxes");i=M(i,i.children.map(g=>g.kind!=="textValue"&&f.has(g)?f.get(g):g));}return K(a,s,i)}var dn=(e,t)=>K(e.chartSpace,e.chart,t);function Eu(e,t){let r=lr(e);return dn(r,Zl(r.chart,r.model,t))}function Nu(e,t){if(!or(t))throw new P("chart.errors.unsupported","chartType");let r=lr(e);if(sn(r.model.plot)===t)throw new P("chart.errors.sameType");return dn(r,ir(r.chart,r.model.plot,t))}function hs(e,t){let r=e?tt(e,n=>n.namespaceUri===w.a&&Pt.has(n.localName)):D("<c:spPr/>");return t?H(r,t,on):r}function gs(e,t){let r=e??D("<c:spPr/>"),n=T(r).find(s=>s.namespaceUri===w.a&&s.localName==="ln");if(!n&&!t||n&&T(n).some(s=>s.localName==="noFill"))return r;let a=n?tt(n,s=>s.namespaceUri===w.a&&Pt.has(s.localName)):D('<a:ln w="28575" cap="rnd"/>'),o=t?M(a,[t,...a.children]):a;return H(r,o,on)}function ys(e,t,r,n){let a=t?D(St(t)):null,o=E(e,"spPr"),s=r?gs(o,a):hs(o,a),l=T(s).length>0?H(e,s,n):se(e,"spPr"),i=E(l,"marker");if(r&&i&&B(i,"symbol")!=="none"){let d=E(i,"spPr"),c=hs(d,a);c=a?gs(c,D(St(t))):c;let u=T(c).length>0?H(i,c,["symbol","size","spPr","extLst"]):se(i,"spPr");l=K(l,i,u);}return l}function Tu(e,t,r){if(r!==null&&!qr(r))throw new P("chart.errors.unsupported","color");let n=lr(e),{model:a}=n,o=E(n.chart,"plotArea"),s=a.plot,l=nt(s),i=l?a.categories.length:a.series.length;if(!Number.isInteger(t)||t<0||t>=i)throw new P("chart.errors.unsupported","index");let d;if(l){let c=a.series[0].el,u=me(c,"dPt").find(y=>B(y,"idx")===String(t)),f=u??D(`<c:dPt><c:idx val="${t}"/><c:bubble3D val="0"/></c:dPt>`),m=ys(f,r,false,is),h=T(m).every(y=>y.localName==="idx"||y.localName==="bubble3D"),g;if(u)g=h?M(c,c.children.filter(y=>y!==u)):K(c,u,m);else if(h)g=c;else {let y=c.children,k=y.filter(N=>N.kind!=="textValue"&&N.localName==="dPt"),C=k.filter(N=>Number(B(N,"idx"))<t).at(-1);if(C){let N=y.indexOf(C)+1;g=M(c,[...y.slice(0,N),m,...y.slice(N)]);}else {let N=k[0];g=N?M(c,[...y.slice(0,y.indexOf(N)),m,...y.slice(y.indexOf(N))]):H(c,m,nn);}}d=K(s,c,g);}else {let c=a.series[t].el;d=K(s,c,ys(c,r,ar(s),nn));}return dn(n,K(n.chart,o,K(o,s,d)))}var Et="http://schemas.openxmlformats.org/spreadsheetml/2006/main",Ss="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Ql="http://schemas.openxmlformats.org/package/2006/relationships",ql="http://www.w3.org/XML/1998/namespace",ec="http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",tc="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",rc="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",nc="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",oc="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ac=32*1024*1024;function fn(e,t){let r=U(t,"c:externalData"),n=I(r,"r:id");if(!r||!n)return {state:"none"};let a=e.relationship(n);if(!a)return {state:"none",externalData:r};if(a.external)return {state:"external",externalData:r};let o=a.target,s=o?e.contentType(o)?.trim().toLowerCase():void 0;return !o||a.type!==ec||s!==oc?{state:"kept",externalData:r}:{state:"embedded",part:o,externalData:r}}function dr(e,t){let r=e.get(t);if(!r)return;let n=Qe(t,ff(r));return n.ok?n.part.root:void 0}function un(e,t,r){let n=t.lastIndexOf("/"),a=dr(e,`${t.slice(0,n)}/_rels/${t.slice(n+1)}.rels`),o=new Map;for(let s of Ie(a,{namespaceUri:Ql,localName:"Relationship"})){let l=I(s,"Id"),i=I(s,"Target");if(!l||!i||I(s,"Type")!==r||I(s,"TargetMode")==="External")continue;let d=E$1(t==="/"?"/x":t,i);d.ok&&o.set(l,d.partName);}return o}var fe=(e,t)=>U(e,{namespaceUri:Et,local:t}),pe=(e,t)=>Ie(e,{namespaceUri:Et,local:t});function mn(e,t,r){return e.orientation==="cols"?[t,r]:[r,t]}function Cs(e,t){let r=[...e.lines,...e.categoryLine!==void 0?[e.categoryLine]:[]],n=e.header??e.start,[a,o]=mn(e,Zt(r),n),[s,l]=mn(e,Se(r),e.start+t-1);return {c1:a,r1:o,c2:s,r2:l}}function sc(e,t,r){let n=new Map,a=(l,i,d)=>{let[c,u]=mn(r,l,i);n.set(`${c},${u}`,d);},o=e.model.categories.length;for(let l of [...t.lines,...t.categoryLine!==void 0?[t.categoryLine]:[]]){t.header!==void 0&&l!==t.categoryLine&&a(l,t.header,null);for(let i=0;i<o;i+=1)a(l,t.start+i,null);}let s=e.labels.length;return r.categoryLine!==void 0&&e.labels.forEach((l,i)=>a(r.categoryLine,r.start+i,e.numericCategories?Number(l):l)),e.series.forEach((l,i)=>{let d=r.lines[i];r.header!==void 0&&a(d,r.header,l.name);for(let c=0;c<s;c+=1)a(d,r.start+c,l.values[c]??null);}),n}function Ce(e,t,r=[]){return {id:"",kind:"generic",namespaceUri:Et,localName:e,namespaceBindings:[],attributes:t.map(([n,a])=>Ae(n,a)),children:r}}var Rs=e=>({kind:"textValue",id:"",value:e});function ic(e,t,r){let n=I(t,"s"),a=[["r",e],...n?[["s",n]]:[]];if(r===null)return n?Ce("c",a):void 0;if(typeof r=="number")return Ce("c",a,[Ce("v",[],[Rs(String(r))])]);let o={...Ce("t",[],r===""?[]:[Rs(r)]),attributes:r.trim()===r?[]:[{kind:"xmlSpace",namespaceUri:ql,localName:"space",prefix:"xml",value:"preserve"}]};return Ce("c",[...a,["t","inlineStr"]],[Ce("is",[],[o])])}var lc=/^([A-Z]{1,3})([0-9]{1,7})$/;function ur(e){let t=e?lc.exec(e):null,r=t?Jt(t[1]):void 0;return t&&r?[r,Number(t[2])]:void 0}function cc(e,t,r){let n=new Map;for(let o of pe(e,"row")){let s=Number(I(o,"r"));if(!Number.isInteger(s)||s<1||n.has(s))return;let l=new Map;for(let i of pe(o,"c")){let d=ur(I(i,"r"));if(!d||d[1]!==s||l.has(d[0]))return;l.set(d[0],i);}if(T(o).length!==l.size)return;n.set(s,{el:o,cells:l});}for(let[o,s]of t){let[l,i]=o.split(",").map(Number),d=n.get(i),c=d?.cells.get(l);if(c&&(fe(c,"f")||I(c,"cm")||I(c,"vm")))return;let u=l>=r.c1&&l<=r.c2&&i>=r.r1&&i<=r.r2;if(c&&!u&&T(c).length>0)return;let f=ic(`${ae(l)}${i}`,c,s);if(!d){if(!f)continue;d={el:Ce("row",[["r",String(i)]]),cells:new Map},n.set(i,d);}f?d.cells.set(l,f):d.cells.delete(l);}let a=[...n.entries()].sort(([o],[s])=>o-s).map(([,{el:o,cells:s}])=>({...o,attributes:o.attributes.filter(l=>!(l.namespaceUri===""&&l.localName==="spans")),children:[...s.entries()].sort(([l],[i])=>l-i).map(([,l])=>l)})).filter(o=>o.children.length>0||o.attributes.length>1);return {...e,children:a}}function dc(e){let t=1/0,r=1/0,n=0,a=0;for(let l of pe(e,"row"))for(let i of pe(l,"c")){let[d,c]=ur(I(i,"r"));t=Math.min(t,d),r=Math.min(r,c),n=Math.max(n,d),a=Math.max(a,c);}if(n===0)return "A1";let o=`${ae(t)}${r}`,s=`${ae(n)}${a}`;return o===s?o:`${o}:${s}`}function Os(e){let[t,r=t]=(e??"").split(":"),n=ur(t),a=ur(r);return n&&a?{c1:n[0],r1:n[1],c2:a[0],r2:a[1]}:void 0}var uc=e=>`${ae(e.c1)}${e.r1}:${ae(e.c2)}${e.r2}`,mc=(e,t)=>e.c1===t.c1&&e.r1===t.r1&&e.c2===t.c2&&e.r2===t.r2,cr=(e,t)=>e.c1<=t.c2&&t.c1<=e.c2&&e.r1<=t.r2&&t.r1<=e.r2;function wt(e,t,r){let n=e.attributes.findIndex(o=>o.namespaceUri===""&&o.localName===t),a=[...e.attributes];return n>=0?a[n]={...a[n],kind:"genericExtension",value:r}:a.push(Ae(t,r)),{...e,attributes:a}}function fc(e,t,r,n){if(Number(I(e,"totalsRowCount")??0)>0||I(e,"headerRowCount")==="0"||(I(e,"tableType")??"worksheet")!=="worksheet")return;let a=fe(e,"autoFilter");if(a&&T(a).length>0||fe(e,"sortState")||pe(fe(e,"tableColumns"),"tableColumn").some(g=>T(g).length>0))return;let o=fe(e,"tableColumns"),s=pe(o,"tableColumn");if(r.orientation!=="cols"||r.header===void 0||!o)return;let l=t.c2-t.c1+1,i=s.map(g=>Number(I(g,"id"))),d=Se(i.filter(Number.isFinite),0),c=new Map(r.lines.map((g,y)=>[g,n[y]])),u=[],f=new Set;for(let g=0;g<l;g+=1){let y=c.get(t.c1+g)??I(s[g],"name");if(!y||/[\r\n]/.test(y)||f.has(y.toLowerCase()))return;f.add(y.toLowerCase());let k=s[g];u.push(k?wt(k,"name",y):Ce("tableColumn",[["id",String(d+=1)],["name",y]]));}let m=uc(t),h=e.children.map(g=>g===o?wt({...o,children:u},"count",String(l)):g.kind!=="textValue"&&g.namespaceUri===Et&&g.localName==="autoFilter"?wt(g,"ref",m):g);return wt({...e,children:h},"ref",m)}function pn(e,t,r){let n=t.layout;if(!n||e.length>ac)return;let a=cf$1(e,bf);if(!a.ok)return;let o=new Map(a.entries),s=[...un(o,"/",tc).values()][0],l=s?dr(o,s):void 0;if(!s||!l)return;let i=Za(n.sheet).toLowerCase(),d=pe(fe(l,"sheets"),"sheet").find(O=>I(O,"name")?.toLowerCase()===i),c=un(o,s,rc).get(I(d,{namespaceUri:Ss,localName:"id"})??""),u=c?dr(o,c):void 0,f=fe(u,"sheetData");if(!c||!u||!f)return;let m=Cs(r,t.model.categories.length),h=Cs(n,t.labels.length);for(let O of pe(fe(u,"mergeCells"),"mergeCell")){let R=Os(I(O,"ref"));if(!R||cr(R,m)||cr(R,h))return}let g=un(o,c,nc),y=new Map;for(let O of pe(fe(u,"tableParts"),"tablePart")){let R=g.get(I(O,{namespaceUri:Ss,localName:"id"})??""),F=R?dr(o,R):void 0,$=Os(I(F,"ref"));if(!R||!F||!$)return;if(!cr($,m)&&!cr($,h))continue;if(!mc($,m))return;let L=fc(F,h,n,t.series.map(ie=>ie.name));if(!L)return;y.set(R,L);}let k=cc(f,sc(t,r,n),m);if(!k)return;let C=u.children.map(O=>O===f?k:O.kind!=="textValue"&&O.namespaceUri===Et&&O.localName==="dimension"?wt(O,"ref",dc(k)):O);y.set(c,{...u,children:C});let N=new TextEncoder;try{for(let[O,R]of y)o.set(O,N.encode(Kt(O,R)));return df(o)}catch{return}}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",pc=12;function hn(e){let t=(r,n)=>{if(r.kind==="textValue"||n>pc)return null;if(r.namespaceUri===ye&&r.localName==="chart")return r;for(let a of r.children){let o=t(a,n+1);if(o)return o}return null};return t(e,0)}function gn(e,t,r){let n=hn(r),a=n?ie(n,"id"):void 0;if(!a)return null;let o=he$1(e,t,a,Nt);return !o||o.root.namespaceUri!==w.c||o.root.localName!=="chartSpace"?null:{ownerPart:t,part:o.partName,chartSpace:Jr(o.root)}}function yn(e,t){let r=t.toLowerCase();for(let[n,a]of e.partBytes)if((n.startsWith("/")?n:`/${n}`).toLowerCase()===r)return a}function ws(e,t){return {relationship(r){let n=(e.relationships.get(t)??[]).find(s=>s.id===r);if(!n)return;if(n.targetMode==="External")return {type:n.type,external:true};let a=N(n),o=a.mode==="Internal"&&a.target.ok?a.target.partName:void 0;return {type:n.type,external:false,...o?{target:o}:{}}},contentType:r=>yg(e,r)??void 0,bytes:r=>yn(e,r)}}function Es(e){return {kind:e.kind,categories:e.categories.map((t,r)=>({label:t,source:r})),series:e.series.map((t,r)=>({name:t.name,values:e.categories.map((n,a)=>{let o=t.val?.values[a],s=o===void 0||o.trim()===""?NaN:Number(o);return Number.isFinite(s)?s:null}),source:r}))}}function Ns(e,t,r){let n=fn(e,t.chartSpace);if(n.state!=="embedded")return n.state;let a=n.part?e.bytes(n.part):void 0;if(!a||!r.layout)return "kept";try{let o=rn(r,Es(r));return pn(a,o,r.layout)?"embedded":"kept"}catch{return "kept"}}function Vu(e,t){let r=et(t.chartSpace);if(!r.ok)return r;let n=ws(e,t.part);return {ok:true,data:{...Es(r.model),workbook:Ns(n,t,r.model)}}}var Gu=e=>Ps(e.chartSpace);function Ku(e){let t=et(e.chartSpace);return t.ok?{editable:true}:{editable:false,reason:t.reason}}function hc(e){let t=U(e,"c:externalData");if(!t)return e;let r={id:"",kind:"generic",namespaceUri:w.c,localName:"autoUpdate",prefix:"c",namespaceBindings:[],attributes:[Ae("val","0")],children:[]},n=t.children.some(o=>o.kind!=="textValue"&&o.localName==="autoUpdate"),a={...t,children:n?t.children.map(o=>o.kind!=="textValue"&&o.localName==="autoUpdate"?r:o):[r,...t.children]};return {...e,children:e.children.map(o=>o===t?a:o)}}function Yu(e,t,r){let n=et(t.chartSpace);if(!n.ok)throw new P(n.reason);let a=rn(n.model,r),o=as(t.chartSpace,a),s=ws(e,t.part),l=fn(s,t.chartSpace);if(l.state==="external"&&(o=hc(o)),l.state==="embedded"&&l.part&&n.model.layout){let i=s.bytes(l.part),d=i?pn(i,a,n.model.layout):void 0;if(d)return {chartSpace:o,workbook:{part:l.part,bytes:d}};if(Ns(s,t,n.model)==="embedded")throw new P("chart.errors.workbook")}return {chartSpace:o}}var gc="application/vnd.openxmlformats-officedocument.drawingml.chart+xml",xn=gc,kn="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",mr="application/vnd.openxmlformats-officedocument.spreadsheetml",yc="application/vnd.openxmlformats-package.relationships+xml",_e="http://schemas.openxmlformats.org/officeDocument/2006/relationships",fr="http://schemas.openxmlformats.org/spreadsheetml/2006/main",Ts="http://schemas.openxmlformats.org/package/2006/relationships",Ds=`${_e}/package`,he=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
4
+ `,pr="Sheet1";function Fs(e){let t=["Category 1","Category 2","Category 3","Category 4"];return e==="pie"||e==="doughnut"?{categories:t,series:[{name:"Series 1",values:[8.2,3.2,1.4,1.2]}]}:{categories:Rt(e)==="xy"?["1","2","3","4"]:t,series:[{name:"Series 1",values:[4.3,2.5,3.5,4.5]},{name:"Series 2",values:[2.4,4.4,1.8,2.8]},{name:"Series 3",values:[2,2,3,5]}]}}var xc=e=>e.trim()!==""&&Number.isFinite(Number(e));function Ls(e,t){if(!e||typeof e!="object")throw new P("chart.errors.unsupported","data");let{categories:r,series:n}=e;if(!Array.isArray(r)||!Array.isArray(n))throw new P("chart.errors.unsupported","data");if(r.length===0||n.length===0)throw new P("chart.errors.empty");if(r.length>Me||n.length>kt)throw new P("chart.errors.tooLarge");let a=l=>{if(typeof l!="string"||l.length>qe||!X$1(l))throw new P("chart.errors.invalidText");return l},o=r.map(a);if(t&&!o.every(xc))throw new P("chart.errors.notNumber");let s=n.map(l=>{if(!l||typeof l!="object"||!Array.isArray(l.values))throw new P("chart.errors.unsupported","series");if(l.values.length!==o.length)throw new P("chart.errors.unsupported","values");let i=l.values.map(d=>{if(d===null)return null;if(typeof d!="number"||!Number.isFinite(d))throw new P("chart.errors.notNumber");return d});return {name:a(l.name),values:i}});return {categories:o,series:s}}var Is=(e,t)=>`<c:strRef><c:f>${V(e)}</c:f><c:strCache><c:ptCount val="${t.length}"/>${t.map((r,n)=>`<c:pt idx="${n}"><c:v>${V(r)}</c:v></c:pt>`).join("")}</c:strCache></c:strRef>`,As=(e,t)=>`<c:numRef><c:f>${V(e)}</c:f><c:numCache><c:formatCode>General</c:formatCode><c:ptCount val="${t.length}"/>${t.map((r,n)=>r===null?"":`<c:pt idx="${n}"><c:v>${r}</c:v></c:pt>`).join("")}</c:numCache></c:numRef>`,Ms=(e=1197)=>`<c:txPr><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr sz="${e}" b="0" i="0" u="none" strike="noStrike" baseline="0"><a:solidFill><a:schemeClr val="tx1"><a:lumMod val="65000"/><a:lumOff val="35000"/></a:schemeClr></a:solidFill><a:latin typeface="+mn-lt"/><a:ea typeface="+mn-ea"/><a:cs typeface="+mn-cs"/></a:defRPr></a:pPr><a:endParaRPr lang="en-US"/></a:p></c:txPr>`;function _s(e,t,r){let n=Rt(e)==="xy",a=t.categories.length,o=ue(pr,1,2,1,a+1),s=n?As(o,t.categories.map(Number)):Is(o,t.categories),l=t.series.map((g,y)=>{let k=y+2;return `<c:ser><c:idx val="${y}"/><c:order val="${y}"/><c:tx>${Is(ue(pr,k,1,k,1),[g.name])}</c:tx><c:invertIfNegative val="0"/><c:cat>${s}</c:cat><c:val>${As(ue(pr,k,2,k,a+1),g.values)}</c:val></c:ser>`}).join(""),i=["500000001","500000002"],d=`<c:chartSpace xmlns:c="${w.c}" xmlns:a="${w.a}" xmlns:r="${w.r}"><c:date1904 val="0"/><c:lang val="en-US"/><c:roundedCorners val="0"/><c:chart><c:autoTitleDeleted val="1"/><c:plotArea><c:layout/><c:barChart><c:barDir val="col"/><c:grouping val="clustered"/><c:varyColors val="0"/>${l}<c:gapWidth val="219"/><c:overlap val="-27"/><c:axId val="${i[0]}"/><c:axId val="${i[1]}"/></c:barChart>${ln("columnClustered",i)}<c:spPr><a:noFill/><a:ln><a:noFill/></a:ln></c:spPr></c:plotArea><c:legend><c:legendPos val="b"/><c:overlay val="0"/><c:spPr><a:noFill/><a:ln><a:noFill/></a:ln></c:spPr>${Ms()}</c:legend><c:plotVisOnly val="1"/><c:dispBlanksAs val="gap"/></c:chart><c:spPr><a:noFill/><a:ln><a:noFill/></a:ln></c:spPr>${Ms(1e3)}<c:externalData r:id="${W$1(r)}"><c:autoUpdate val="0"/></c:externalData></c:chartSpace>`;if(e==="columnClustered")return `${he}${d}`;let c=Qe("/word/charts/chart.xml",d);if(!c.ok)throw new P("chart.errors.unsupported","template");let u=c.part.root,f=E(u,"chart"),m=E(E(f,"plotArea"),"barChart"),h=K(u,f,ir(f,m,e));return `${he}${Kt("/word/charts/chart.xml",h)}`}function $s(e,t){let r=[],n=u=>{let f=r.indexOf(u);return f>=0?f:r.push(u)-1},a=(u,f)=>`${ae(u)}${f}`,o=(u,f,m)=>`<c r="${a(u,f)}" t="s"><v>${n(m)}</v></c>`,s=(u,f,m)=>m===null?"":`<c r="${a(u,f)}"><v>${m}</v></c>`,l=e.series.length+1,i=[`<row r="1">${e.series.map((u,f)=>o(f+2,1,u.name)).join("")}</row>`];e.categories.forEach((u,f)=>{let m=f+2,h=t?s(1,m,Number(u)):o(1,m,u);i.push(`<row r="${m}">${h}${e.series.map((g,y)=>s(y+2,m,g.values[f]??null)).join("")}</row>`);});let d=u=>new TextEncoder().encode(u),c=new Map([["/[Content_Types].xml",d(`${he}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="${yc}"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="${mr}.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="${mr}.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="${mr}.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="${mr}.sharedStrings+xml"/></Types>`)],["/_rels/.rels",d(`${he}<Relationships xmlns="${Ts}"><Relationship Id="rId1" Type="${_e}/officeDocument" Target="xl/workbook.xml"/></Relationships>`)],["/xl/workbook.xml",d(`${he}<workbook xmlns="${fr}" xmlns:r="${_e}"><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="16000" windowHeight="9000"/></bookViews><sheets><sheet name="${pr}" sheetId="1" r:id="rId1"/></sheets></workbook>`)],["/xl/_rels/workbook.xml.rels",d(`${he}<Relationships xmlns="${Ts}"><Relationship Id="rId1" Type="${_e}/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="${_e}/styles" Target="styles.xml"/><Relationship Id="rId3" Type="${_e}/sharedStrings" Target="sharedStrings.xml"/></Relationships>`)],["/xl/styles.xml",d(`${he}<styleSheet xmlns="${fr}"><fonts count="1"><font><sz val="11"/><name val="Calibri"/><family val="2"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0"/></styleSheet>`)],["/xl/worksheets/sheet1.xml",d(`${he}<worksheet xmlns="${fr}" xmlns:r="${_e}"><dimension ref="A1:${a(l,e.categories.length+1)}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${i.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`)]]);return c.set("/xl/sharedStrings.xml",d(`${he}<sst xmlns="${fr}" count="${r.length}" uniqueCount="${r.length}">${r.map(u=>`<si><t xml:space="preserve">${V(u)}</t></si>`).join("")}</sst>`)),df(c)}function kc(e,t,r){let n=new Set,a=i=>{if(n.add(i.id),i.kind!=="textValue")for(let d of i.children)a(d);};a(t);let o=new Set,s=(i,d)=>{let c=!d&&i.id!==""&&n.has(i.id)&&!o.has(i.id),u=c?i.id:r();if(o.add(u),i.kind==="textValue")return u===i.id?i:{...i,id:u};let f=i.children.map(h=>s(h,!c));return u===i.id&&f.every((h,g)=>h===i.children[g])?i:{...i,id:u,children:f}},l=e.children.map(i=>s(i,false));return {...e,id:t.id,children:l}}function Bs(e,t,r){let n=e.parts.get(t);if(!n)throw new P("chart.errors.noChart");let a=kc(r,n.root,cb(n)),o=kb(n,n.root.id,a);if(!o.ok)throw new P("chart.errors.invalidText");return vg(e,o.part)}var Hs=(e,t,r)=>fg(e,t,r,kn);function bc(e,t){let r=C(t);for(let n of [e.parts,e.partBytes])for(let a of n.keys()){let o=z$1(a.startsWith("/")?a:`/${a}`);if(o.ok&&C(o.partName)===r)return true}return false}function hr(e,t,r,n,a){for(let o of Mb(Number.MAX_SAFE_INTEGER,n)){let s=`${t}${o}${r}`;if(!a?.has(C(s))&&!bc(e,s))return s}throw new P("chart.errors.unsupported","partName")}function Tt(e,t){let r=e.split("/").slice(1,-1),n=t.split("/").slice(1),a=0;for(;a<r.length&&a<n.length-1&&r[a]===n[a];)a+=1;return [...r.slice(a).map(()=>".."),...n.slice(a)].join("/")}function js(e,t,r,n,a){if(!or(r))throw new P("chart.errors.unsupported","chartType");let o=Rt(r)==="xy",s=Ls(n??Fs(r),o),l=hr(e,"/word/charts/chart",".xml",a),i=hr(e,"/word/embeddings/Workbook",".xlsx",a),d=fg(e,i,$s(s,o),kn),c=Eg(Dg(d,l),l,Ds,Tt(l,i));if(!c.ok)throw new P("chart.errors.unsupported","relationship");d=c.pkg;let u=Pa(_s(r,s,c.relationshipId),{name:l,contentType:xn});if(!u.ok)throw new P("chart.errors.unsupported","template");let f=Fg(d,l,u.part.root,xn);if(f===d)throw new P("chart.errors.unsupported","partName");let m=Eg(Dg(f,t),t,Nt,Tt(t,l));if(!m.ok)throw new P("chart.errors.unsupported","relationship");return {pkg:m.pkg,chartPart:l,workbookPart:i,relationshipId:m.relationshipId}}var Us=12700;function Xs(e){let t=Math.max(1,Math.round(e.widthPoints*Us)),r=Math.max(1,Math.round(e.heightPoints*Us)),n=`<w:document xmlns:w="${pa}" xmlns:wp="${wa}" xmlns:a="${va}"><w:body><w:p><w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${t}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:docPr id="${e.docPrId}" name="${W$1(e.name)}"/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${xe}"><c:chart xmlns:c="${xe}" xmlns:r="${ya$1}" r:id="${W$1(e.relationshipId)}"/></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p></w:body></w:document>`,a=Pa(n,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!a.ok)throw new P("chart.errors.unsupported","drawing");let o=l=>{if(l.kind==="textValue")return null;if(l.kind==="drawing")return l;for(let i of l.children){let d=o(i);if(d)return d}return null},s=o(a.part.root);if(!s)throw new P("chart.errors.unsupported","drawing");return s}var Pc=16,vc=3;function Sc(e){let t=e.lastIndexOf("/"),r=e.lastIndexOf("."),n=r>t?e.slice(r):"";return {stem:e.slice(0,e.length-n.length).replace(/\d+$/,""),ext:n}}function Cc(e,t,r){let n=(e.relationships.get(t)??[]).find(o=>o.id===r);if(!n)return null;if(n.targetMode==="External")return "external";let a=N(n);return a.mode==="Internal"&&a.target.ok?{type:n.type,partName:a.target.partName}:null}function Rc(e,t){let r=e.parts.get(t);if(r)return r;let n=C(t);for(let[a,o]of e.parts)if(C(a.startsWith("/")?a:`/${a}`)===n)return o}function Oc(e,t,r){let n=o=>{let s=false,l=o.attributes.map(c=>{if(c.namespaceUri!==ya$1)return c;let u=t.get(c.value);return u!==void 0?(s=true,{...c,value:u}):c});if(o.attributes.some(c=>c.namespaceUri===ya$1&&r.has(c.value))){if(o.namespaceUri===ye&&o.localName==="externalData")return null;throw new P("chart.errors.unsupported","externalRelationship")}let d=[];for(let c of o.children){if(c.kind==="textValue"){d.push(c);continue}let u=n(c);u!==c&&(s=true),u&&d.push(u);}return s?{...o,attributes:l,children:d}:o},a=n(e);if(!a)throw new P("chart.errors.unsupported","externalRelationship");return a}function Ws(e,t,r,n,a){let o=e,s=new Map,l=new Set,i=[],d=(f,m)=>{let h=s.get(C(f));if(h)return h;if(m>vc||s.size>=Pc)throw new P("chart.errors.unsupported","parts");let g=yg(r,f);if(!g)throw new P("chart.errors.unsupported","contentType");let{stem:y,ext:k}=Sc(f),C$1=hr(o,y,k,a,l);s.set(C(f),C$1),l.add(C(C$1)),i.push(C$1);let N=r.relationships.get(f)??[],O=Rc(r,f);if(!O){let J=yn(r,f);if(!J||N.length>0)throw new P("chart.errors.unsupported","part");return o=fg(o,C$1,J,g),C$1}let R=new Map,F=new Set;for(let J of N){let V=Cc(r,f,J.id);if(V==="external"||V===null){F.add(J.id);continue}let Rr=d(V.partName,m+1),it=Eg(Dg(o,C$1),C$1,V.type,Tt(C$1,Rr));if(!it.ok)throw new P("chart.errors.unsupported","relationship");o=it.pkg,R.set(J.id,it.relationshipId);}let $=Pa(Ha$1(O),{name:C$1,contentType:g});if(!$.ok)throw new P("chart.errors.unsupported","part");let L=Oc($.part.root,R,F),ie=Fg(o,C$1,L,g);if(ie===o)throw new P("chart.errors.unsupported","partName");return o=ie,C$1},c=d(n,0),u=Eg(Dg(o,t),t,Nt,Tt(t,c));if(!u.ok)throw new P("chart.errors.unsupported","relationship");return {pkg:u.pkg,chartPart:c,parts:i,relationshipId:u.relationshipId}}function zs(e,t,r){if(!hn(e))throw new P("chart.errors.noChart");let n=false,a=s=>{if(s.namespaceUri===va&&(s.localName==="hlinkClick"||s.localName==="hlinkHover"))return null;let l=s.namespaceUri===ye&&s.localName==="chart",i=s.namespaceUri===wa&&s.localName==="docPr",d=s.attributes.map(u=>{if(l&&u.namespaceUri===ya$1)return u.localName!=="id"?u:(n=true,{...u,value:t});if(u.namespaceUri===ya$1)throw new P("chart.errors.unsupported","relationship");return i&&u.namespaceUri===""&&u.localName==="id"?{...u,value:String(r)}:u}),c=[];for(let u of s.children)if(u.kind==="textValue")c.push(u);else {let f=a(u);f&&c.push(f);}return {...s,attributes:d,children:c}};if(e.kind==="textValue")throw new P("chart.errors.noChart");let o=a(e);if(!o||!n)throw new P("chart.errors.noChart");return o}var bn=e=>e instanceof P?{ok:false,reason:"chart",detail:e.reason}:null;function wc(e,t,r){let n=null,a={...r.expectedPackageRevision!==void 0?{expectedPackageRevision:r.expectedPackageRevision}:{},...r.actorId?{actorId:r.actorId}:{}},o=R(e,t,(s,l)=>{try{let i=js(e.currentPackage(),l,r.chartType,r.data,r.actorId),d=cg(i.pkg);if(!d.ok||!s.applyPackage(()=>i.pkg))return null;let c=Xs({docPrId:d.id,relationshipId:i.relationshipId,name:r.name.replaceAll("{number}",String(d.id)),widthPoints:r.widthPoints,heightPoints:r.heightPoints});return s.apply({op:"insertDrawing",...r.bias?{bias:r.bias}:{},paragraphId:r.paragraphId,offset:r.offset,drawing:c})?c.id:null}catch(i){if(n=bn(i),n)return null;throw i}},a);return n??o}function Ec(e,t,r){let n=e.parts.get(t);if(!n)return null;let a=wn$1(n,r),o=a?a.chartDrawing:eb(n,r);return o?gn(e,t,o):null}function Nc(e,t,r,n,a){let o=null,s=R(e,t,(l,i)=>{try{let d=e.currentPackage(),c=Ec(d,i,r);if(!c)throw new P("chart.errors.noChart");let u=n(d,c),f=Bs(d,c.part,u.chartSpace);return u.workbook&&(f=Hs(f,u.workbook.part,u.workbook.bytes)),l.applyPackage(()=>f)?r:null}catch(d){if(o=bn(d),o)return null;throw d}},a?.actorId?{actorId:a.actorId}:void 0);return o??s}function Tc(e,t,r){let n=null,a={...r.expectedPackageRevision!==void 0?{expectedPackageRevision:r.expectedPackageRevision}:{},...r.actorId?{actorId:r.actorId}:{}},o=R(e,t,(s,l)=>{try{let{source:i}=r,d=gn(i.pkg,i.ownerPart,i.drawing);if(!d)throw new P("chart.errors.noChart");let c=Ws(e.currentPackage(),l,i.pkg,d.part,r.actorId),u=cg(c.pkg,r.actorId);if(!u.ok)return null;if(i.drawing.kind!=="drawing")throw new P("chart.errors.noChart");let f=zs(i.drawing,c.relationshipId,u.id);if(!s.applyPackage(()=>c.pkg))return null;for(let m of r.priorOps??[])if(!s.apply(m))return null;return s.apply({op:"insertDrawing",...r.bias?{bias:r.bias}:{},paragraphId:r.paragraphId,offset:r.offset,drawing:f})?f.id:null}catch(i){if(n=bn(i),n)return null;throw i}},a);return n??o}var Vs=e=>({insert:(t,r)=>wc(e,t,r),duplicate:(t,r)=>Tc(e,t,r),edit:(t,r,n,a)=>Nc(e,t,r,n,a)});var Ic=8*1024*1024;function Gs(){let e=new WeakMap;function*t(n){let a=e.get(n);if(a)return a.slice();let o=yield*tg(n);return e=new WeakMap,o.byteLength<=Ic&&e.set(n,o.slice()),o}return Object.assign(n=>{let a=t(n);for(;;){let o=a.next();if(o.done)return o.value}},{steps:t})}function Ys(e){return oe(e).map(t=>Nm(e,t.id)??"").join(`
5
+ `)}var Ac=64,Ks=new WeakMap;function Pn(e,t=0){if(t>Ac)return false;let r=Ks.get(e);if(r!==void 0)return r;let n=false;for(let a of e.children)if(a.kind!=="textValue"&&(a.kind==="commentRangeStart"||a.kind==="commentReference"||Pn(a,t+1))){n=true;break}return rb(e)&&Ks.set(e,n),n}var Mc="/word/numbering.xml";function Sn(e,t,r){if(e.relationships!==t.relationships||e.contentTypes!==t.contentTypes||e.parts.size!==t.parts.size)return false;for(let[n,a]of t.parts)if(!(n===r||n===Mc)&&e.parts.get(n)!==a)return false;return true}function Dc(e,t){let r=e.kind==="revision"?e.ranges[0]??null:e.range;if(!r)return null;let n=t.get(r.start.paragraphId);return n===void 0?null:n}function gr(e,t,r,n){for(let s of t)if(s.ranges.length===0)return false;let a=new Set;for(let s of e)s.kind!=="revision"||s.ranges.length>0||vn(s,r)||a.add(ql$1(s));for(let s of t)if(a.has(ql$1(s)))return false;let o=new Set(t.flatMap(s=>pl$1(s)));for(let s of e)if(s.kind==="revision"&&vn(s,r)&&pl$1(s).some(l=>!o.has(l)&&eb(n,l)))return false;return true}function yr(e,t,r,n,a=s=>s,o){let s=o?Fc(e,o,r):new Map;if(!s)return null;let l=t.get(r);if(l===void 0)return n.length===0?e:null;let i=[],d=null,{groups:c,absorbed:u}=Lc(e,t,r,n),f=a(u.size>0?n.filter(h=>!u.has(h)):n);for(let h of e){let g=h.kind==="revision"&&c.get(h)||h.kind==="comment"&&s.get(h)||h;if(g.kind==="revision"&&vn(g,r)){d===null&&(d=i.length);continue}if(d===null){let y=Dc(g,t);y!==null&&y>l&&(d=i.length);}i.push(g);}if(d===null&&(d=i.length),f.length>0){let h=f.length<2?[...f]:[...f].sort((g,y)=>xl$1(g,t)-xl$1(y,t));i.splice(d,0,...h);}if(c.size>0||s.size>0){let h=[];i.forEach((y,k)=>{(y.kind==="revision"?y.ranges[0]?.start:y.range?.start)?.paragraphId===r&&h.push(k);});let g=h.map(y=>i[y]).sort((y,k)=>xl$1(y,t)-xl$1(k,t));h.forEach((y,k)=>i[y]=g[k]);}let m=km(i);return m.length===e.length&&m.every((h,g)=>h===e[g])?e:m}function Fc(e,t,r){let n=new Map,a;for(let o of e){if(o.kind!=="comment"||!xr(o,r))continue;let s=o.range;if(!s||o.orphaned)return null;if(!a){let c=eb(t,r);if(!c||c.kind!=="paragraph")return null;a=Tj(c);}let l=c=>{let u=a.filter(f=>f.commentId===o.id&&f.kind===c);return u.length===1?u[0].offset:void 0},i=s.start.paragraphId===r?l("start"):s.start.offset,d=s.end.paragraphId===r?l("end"):s.end.offset;if(i===void 0||d===void 0)return null;i===s.start.offset&&d===s.end.offset||n.set(o,{...o,range:{...s,start:{...s.start,offset:i},end:{...s.end,offset:d}}});}return n}function vn(e,t){return e.ranges.length>0&&e.ranges.every(r=>r.start.paragraphId===t&&r.end.paragraphId===t)}function Qs(e){return e.revisionKind==="format"&&e.formattingKind==="pPrChange"}function Lc(e,t,r,n){let a=new Map,o=new Set,s=new Map;for(let l of e)if(l.kind==="revision"&&Qs(l)&&kr(l,r))for(let i of pl$1(l))s.set(i,l);if(s.size===0)return {groups:a,absorbed:o};for(let l of n){let i=pl$1(l),d=i.length>0?s.get(i[0]):void 0;if(!d||!i.every(f=>s.get(f)===d))continue;o.add(l);let c=a.get(d)??d,u=[...c.ranges.filter(f=>f.start.paragraphId!==r),...l.ranges].sort((f,m)=>(t.get(f.start.paragraphId)??0)-(t.get(m.start.paragraphId)??0)||f.start.offset-m.start.offset);a.set(d,ol$1({...c,ranges:u},pl$1(d)));}return {groups:a,absorbed:o}}function xr(e,t){return e.range?e.range.start.paragraphId===t||e.range.end.paragraphId===t:false}function Cn(e,t){return e.revisionKind==="structural"&&e.ranges.some(r=>r.start.paragraphId===t||r.end.paragraphId===t)}function kr(e,t){return e.ranges.length===0||!e.ranges.some(n=>n.start.paragraphId===t||n.end.paragraphId===t)?false:!e.ranges.every(n=>n.start.paragraphId===t&&n.end.paragraphId===t)}function br(e,t,r){return e.fromRevision!==t.bodyRevision||r.currentPackageRevision!==t.packageRevision+1&&(r.changePackage!==r.currentPackage||!Sn(t.pkg,r.currentPackage,r.part.name))||e.story!==void 0&&e.story.kind!=="body"||e.impact==="global"?false:t.commentsPart===r.commentsPart&&t.commentsExtendedPart===r.commentsExtendedPart}function _c(e,t){let r=fb(e,t);if(!r)return;let n=r.children.findIndex(c=>c.id===t);if(r.kind!=="tableCell"||r.children.slice(0,n).some(Zs)){let c=Js(r.children,n);return c?.kind==="paragraph"?c:void 0}let a=fb(e,r.id);if(!a)return;let o=a.children.filter(c=>c.kind==="tableCell"),s=o.indexOf(r);if(s>0){let c=o[s-1],u=c.kind==="textValue"?void 0:c.children.filter(Zs).at(-1);return u?.kind==="paragraph"?u:void 0}let l=fb(e,a.id);if(!l||l.children.find(c=>c.kind==="tableRow")!==a)return;let i=fb(e,l.id);if(!i)return;let d=Js(i.children,i.children.findIndex(c=>c.id===l.id));return d?.kind==="paragraph"?d:void 0}function Js(e,t){for(let r=t-1;r>=0;r-=1){let n=e[r];if(n.kind!=="textValue"&&!Dl$1(n))return n}}var Zs=e=>e.kind==="paragraph"||e.kind==="table"||e.kind==="generic"&&(e.localName==="sdt"||e.localName==="customXml");function Pr(e,t){let r=_c(e,t);return r!==void 0&&r.kind!=="textValue"&&Sl$1({...e,root:r}).some(n=>n.paragraphMark)}function qs(e,t,r,n){if(!br(e,t,n)||e.splitJoin.length!==1)return false;let a=e.splitJoin[0],o,s;if("split"in a){if(e.deleted.length>0||e.created.length!==1||e.created[0]!==a.split.tail)return false;o=s=[a.split.from,a.split.tail];}else {if(e.created.length>0||e.deleted.length!==1||e.deleted[0]!==a.join.removed)return false;o=[a.join.kept,a.join.removed],s=[a.join.kept];}for(let i of s){let d=eb(n.part,i);if(!d||d.kind!=="paragraph"||Sl$1({...n.part,root:d}).length>0)return false}if(Pr(n.part,s[0]))return false;let l=i=>i!==void 0&&o.includes(i);for(let i of r){let d=i.kind==="revision"?i.ranges:i.range?[i.range]:[];for(let c of d)if(l(c.start.paragraphId)||l(c.end.paragraphId))return false}return true}function Rn(e,t,r){let n=sc$1(r);if(n.length===0)return false;let a=e.parts.get(t.name),o=a?eb(a,r.id):null;if(!o)return true;let s=new Set(sc$1(o).map(l=>l.node));return n.some(l=>!s.has(l.node))}function On(e,t,r){let n=new Set(r.flatMap(a=>a.kind==="custom"?[a.id]:[]));if(n.size===0)return false;for(let a=fb(e,t);a;a=fb(e,a.id))if(a.kind==="contentControl"&&n.has(a.id))return true;return false}function ei(e,t,r,n){if(!br(e,t,n)||e.dirty.length!==1||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0)return null;let{part:a}=n,o=e.dirty[0],s=eb(a,o);if(!s||s.kind!=="paragraph"||e.impact!=="text-local"&&(Sl$1({...a,root:s}).length>0||e.impact==="flow-structural"&&fb(a,o)?.localName!=="body")||Rn(t.pkg,a,s)||On(a,o,r)||Pr(a,o))return null;for(let l of r){if(l.kind==="comment"){if(xr(l,o)&&e.impact!=="text-local")return null;continue}if(l.kind==="custom"){if(l.range?.start.paragraphId===o)return null;continue}if(Cn(l,o)||kr(l,o)&&!(e.impact==="text-local"&&Qs(l)))return null}return o}var $c=4;function ti(e){let t=e.root.children.find(r=>r.kind==="body");return t&&t.kind!=="textValue"?t:void 0}function ri(e){return e.children.find(t=>t.kind!=="textValue"&&t.namespaceUri===pa&&t.localName==="pPr")}function Uc(e,t,r,n){let a=new Map(Sl$1({...e,root:t}).map(s=>[s.node.id,s.node])),o=Sl$1({...r,root:n});return o.length>=a.size||!o.every(s=>a.get(s.node.id)===s.node)?false:o.length===0||ri(t)===ri(n)}function ni(e,t){return Sl$1({...e,root:t}).some(r=>r.paragraphMark)}function Bc(e,t,r){if(!br(e,t,r)||!Sn(t.pkg,r.currentPackage,r.part.name)||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0)return null;let n=t.pkg.parts.get(r.part.name),a=n&&ti(n),o=ti(r.part);if(!n||!a||!o||a.children.length!==o.children.length)return null;let s=[];for(let[l,i]of o.children.entries()){let d=a.children[l];if(i!==d){if(s.length>=$c||i.kind!=="paragraph"||d.kind!=="paragraph"||i.id!==d.id||!Uc(n,d,r.part,i)||ni(n,d)||ni(r.part,i)||Pr(r.part,i.id)||Rn(t.pkg,r.part,i)||On(r.part,i.id,t.items))return null;s.push(i.id);}}if(s.length===0)return null;for(let l of t.items)for(let i of s)if(l.kind==="comment"){if(xr(l,i))return null}else if(l.kind==="custom"){if(l.range?.start.paragraphId===i)return null}else if(Cn(l,i)||kr(l,i))return null;return s}function oi(e,t,r,n,a){if(!e||!t||!n.sameFilter)return null;let o=Bc(e,t,r);if(!o)return null;let s=t.paragraphOrder??Vk(r.part),l=t.items;for(let i of o){if(!n.patchable(i))return null;let d=a.revisionItemsOfParagraph(r.part,i);if(!gr(l,d,i,r.part))return null;let c=yr(l,s,i,d,n.filtered,r.part);if(!c)return null;l=c;}return {items:l,paragraphOrder:s}}function Hc(e,t){if(e.size!==t.size)return false;for(let[r,n]of e){let a=t.get(r);if(!a||a.nodeId!==n.nodeId||a.label!==n.label||a.data!==n.data)return false}return true}function jc(e,t){return e.root===t.root&&e.commentsPart===t.commentsPart&&e.commentsExtendedPart===t.commentsExtendedPart&&e.stylesPart===t.stylesPart&&e.numberingRoot===t.numberingRoot&&e.furnitureParts.length===t.furnitureParts.length&&e.furnitureParts.every((r,n)=>r===t.furnitureParts[n])&&Hc(e.customNodePayloads,t.customNodePayloads)}function ai(){let e=[];return {get(t){let r=e.findIndex(a=>jc(a.inputs,t));if(r<0)return;let[n]=e.splice(r,1);return e.unshift(n),n.items},set(t,r){let n=e.findIndex(a=>a.inputs.root===t.root);n>=0&&e.splice(n,1),e.unshift({inputs:t,items:r}),e.length>8&&(e.length=8);}}}var li=new WeakMap;function ef(e,t){return li.set(e,t),e}function Xc(e){return e?li.get(e):void 0}var ot=new WeakMap,ci={sites:new Set,paragraphs:new Map,key:"",spanning:new Set};function Wc(e){return ot.get(e)??ci}function zc(e){return e.kind==="revision"&&e.revisionKind==="format"&&(e.formattingKind==="pPrChange"||e.formattingKind==="rPrChange")}function si(e,t){if(e.size!==t.size)return false;for(let r of t)if(!e.has(r))return false;return true}function Vc(e,t){if(e.size!==t.size)return false;for(let[r,n]of t)if(e.get(r)!==n)return false;return true}function ii(e,t){return e.key===t.key&&si(e.sites,t.sites)&&Vc(e.paragraphs,t.paragraphs)&&si(e.spanning,t.spanning)?e:t}function di(e,t,r,n){let a=Xc(e),o={pkg:t,stylesRoot:r.stylesPart?.root??null,numberingRoot:r.numberingRoot},s=n?Wc(n.items):ci,l=c$1(o.stylesRoot,o.numberingRoot),i=[],d=n!==null&&n.stylesPart===r.stylesPart&&(n.numberingRoot===r.numberingRoot||s.sites.size===0&&!n.items.some(zc));return {filtered:c=>{if(!a)return c;let u=a(c,o),f=new Set(u.map(h=>h.id)),m=a$1(c.filter(h=>!f.has(h.id)));return i.push({result:u,removed:m.sites,paragraphs:m.paragraphs,spanning:m.spanning,touched:b$1(c),kept:a$1(u).sites}),u},sameFilter:d,patchable:c=>d&&!s.spanning.has(c),publish:c=>{if(!a||ot.has(c)&&(i.length===0||c!==n?.items))return c;let u=i.at(-1);if(u?.result===c){let g={sites:new Set(u.removed),paragraphs:u.paragraphs,key:l,spanning:new Set(u.spanning)};return ot.set(c,ii(s,g)),c}if(!u)return ot.set(c,s.key===l?s:{...s,key:l}),c;if(s.key===l&&i.every(g=>g.removed.length===0&&!g.kept.some(y=>s.sites.has(y))))return ot.set(c,s),c;let f=new Set(s.sites),m=new Map(s.paragraphs),h=new Set(s.spanning);for(let g of i){for(let y of g.kept)f.delete(y);for(let y of g.removed)f.add(y);for(let y of g.touched)m.delete(y);for(let[y,k]of g.paragraphs)m.set(y,k);for(let y of g.touched)h.delete(y);for(let y of g.spanning)h.add(y);}return ot.set(c,ii(s,{sites:f,paragraphs:m,key:l,spanning:h})),c}}}var fi=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u,Gc=["ascii","hAnsi","cs","eastAsia"],Kc=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],Yc=128,Jc=/[\u0000-\u001F\u007F-\u009F]/;function Y(e){return e.kind!=="textValue"}function $e(e,t){return e.attributes.find(r=>r.localName===t)?.value}function pi(e,t){let r=new Map;for(let a of e)for(let o of a.children)if(Y(o))for(let[s,l]of yi(o,t))r.has(s)||r.set(s,l);let n=[...r.values()];return n.sort((a,o)=>a<o?-1:a>o?1:0),vr.length===n.length&&vr.every((a,o)=>a===n[o])?vr:(vr=n,n)}var vr=[],wn=new WeakMap,hi=16,gi=32,at=new Map,Zc=64;function Qc(e,t){return e?.major===t?.major&&e?.minor===t?.minor&&e?.majorEastAsia===t?.majorEastAsia&&e?.minorEastAsia===t?.minorEastAsia&&e?.majorBidi===t?.majorBidi&&e?.minorBidi===t?.minorBidi}function qc(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let[r,n]of e)if(t.get(r)!==n)return false;return true}function ed(e,t,r){let n=e.children,a=at.get(e.id),o=a?.children.deref(),s=a!==void 0&&o!==void 0&&o.length===n.length&&Qc(a.themeFonts,t),l=s,i=n.map((c,u)=>{if(s&&c===o[u])return a.parts[u];let f=Y(c)?yi(c,t,r+1):null;return l&&!qc(f,a.parts[u])&&(l=false),f}),d;if(l)d=a.byFold;else {let c=new Map;for(let u of i)if(u)for(let[f,m]of u)c.has(f)||c.set(f,m);d=c;}return at.delete(e.id),at.set(e.id,{children:Ch(n),parts:i,byFold:d,themeFonts:t}),at.size>Zc&&at.delete(at.keys().next().value),d}function yi(e,t,r=0){let n=t?.major??null,a=t?.minor??null,o=t?.majorEastAsia??null,s=t?.minorEastAsia??null,l=t?.majorBidi??null,i=t?.minorBidi??null,d=wn.get(e);if(d&&d.major===n&&d.minor===a&&d.majorEastAsia===o&&d.minorEastAsia===s&&d.majorBidi===l&&d.minorBidi===i)return d.byFold;if(e.children.length>=hi&&r<gi&&e.localName!=="rFonts"){let m=ed(e,t,r);return wn.set(e,{major:n,minor:a,majorEastAsia:o,minorEastAsia:s,majorBidi:l,minorBidi:i,byFold:m}),m}let c=new Map,u=m=>{if(!m||!fi.test(m))return;let h=m.toLowerCase();c.has(h)||c.set(h,m);},f=[e];for(;f.length>0;){let m=f.pop();if(Y(m)){if(m.localName==="rFonts"){for(let h of Gc)u($e(m,h));if(t)for(let h of Kc)u(se$1($e(m,h),t));}for(let h=m.children.length-1;h>=0;h-=1)f.push(m.children[h]);}}return wn.set(e,{major:n,minor:a,majorEastAsia:o,minorEastAsia:s,majorBidi:l,minorBidi:i,byFold:c}),c}function xi(e){let t=new Map;for(let n of e)for(let a of n.children)if(Y(a))for(let[o,s]of In(a).all)t.has(o)||t.set(o,s);let r=[...t.values()];return r.sort((n,a)=>n<a?-1:n>a?1:0),r}function cf(e){let t=new Map;for(let r of e)for(let n of r.children)if(Y(n))for(let[a,o]of In(n).unmapped)t.has(a)||t.set(a,o);return [...t.values()]}var ui=new WeakMap,Tn=new Map,td={all:Tn,unmapped:Tn};function In(e,t=0){let r=ui.get(e);if(r)return r;let n=new Map,a$1=new Map,o=()=>{let i=n.size===0?td:{all:n,unmapped:a$1.size===0?Tn:a$1};return ui.set(e,i),i};if(e.children.length>=hi&&t<gi&&e.localName!=="sym"&&e.localName!=="r"){for(let i of e.children){if(!Y(i))continue;let d=In(i,t+1);for(let[c,u]of d.all)n.has(c)||n.set(c,u);for(let[c,u]of d.unmapped)a$1.has(c)||a$1.set(c,u);}return o()}let s=[e],l=new Set;for(;s.length>0;){let i=s.pop();if(!Y(i))continue;let d=l.has(i)||i.localName==="r"&&i.namespaceUri===pa&&a(i);if(i.localName==="sym"&&i.namespaceUri===pa){let c$1=i.attributes.find(f=>f.localName==="font"&&(f.namespaceUri===pa||f.namespaceUri===""))?.value,u=c(c$1);if(u!==null){let f=u.toLowerCase();n.has(f)||n.set(f,u);let m=d?null:$l$1(i);m&&rd(m.text)&&!a$1.has(f)&&a$1.set(f,u);}}for(let c=i.children.length-1;c>=0;c-=1){let u=i.children[c];d&&l.add(u),s.push(u);}}return o()}function rd(e){let t=e.codePointAt(0);return t!==void 0&&t>=57344&&t<=63743}function ki(e){let t=[...e];for(;t.length>0;){let r=t.pop();if(Y(r)){if(r.localName==="t"&&r.namespaceUri===pa){for(let n of r.children)if(!Y(n)&&n.value.length>0)return true;continue}for(let n of r.children)t.push(n);}}return false}var nd=new Set(["paragraph","character","table","numbering"]),od=/^[0-9A-Fa-f]{6}$/,ad=16,mi=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function bi(e){return e.children}function En(e,t){for(let r of bi(e))if(Y(r)&&r.localName===t)return r}function sd(e){return mi.get(e.name.toLowerCase())??mi.get(e.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Nn(e){return e===void 0||e.length===0||e.length>Yc||Jc.test(e)?null:e}function Pi(e,t){if(!e)return [];let r=new Map;for(let o of e.children){if(!Y(o)||o.localName!=="style")continue;let s=Nn($e(o,"styleId"));s!==null&&!r.has(s)&&r.set(s,o);}let n=o=>{let s=false,l=false,i=null,d=false,c=false,u=new Set,f=o;for(let g=0;g<ad&&f!==null&&!u.has(f);g+=1){u.add(f);let y=r.get(f);if(!y)break;let k=En(y,"rPr");for(let N of k?bi(k):[]){if(!Y(N))continue;let O=$e(N,"val"),R=O!=="0"&&O!=="false"&&O!=="off";N.localName==="b"&&!d?(s=R,d=true):N.localName==="i"&&!c?(l=R,c=true):N.localName==="color"&&i===null&&O&&od.test(O)&&(i=O);}let C=En(y,"basedOn");f=C?Nn($e(C,"val")):null;}let m=t?.(o),h=m?.fontFamily??null;return {fontFamily:h!==null&&fi.test(h)?h:null,fontSizePt:m?.fontSizeHalfPoints!=null&&m.fontSizeHalfPoints>0?m.fontSizeHalfPoints/2:null,bold:s,italic:l,color:i}},a=[];for(let[o,s]of r){let l=$e(s,"type");if(l===void 0||!nd.has(l))continue;let i=En(s,"name"),d=Nn(i?$e(i,"val"):void 0);a.push({styleId:o,name:d??o,type:l,preview:n(o)});}return a.map((o,s)=>({entry:o,index:s,rank:sd(o)})).sort((o,s)=>o.rank-s.rank||o.index-s.index).map(o=>o.entry)}var id=128,ld=/[\u0000-\u001F\u007F-\u009F]/,cd=/[\u0000-\u001F\u007F-\u009F]/g,dd=200;function Mn(e){return e.kind!=="textValue"}function vi(e,t){for(let r of e.children)if(Mn(r)&&r.localName===t)return r}function An(e,t){return e.attributes.find(r=>r.localName===t)?.value}function ud(e){let t=new Map;if(!e)return t;for(let r of e.children){if(!Mn(r)||r.localName!=="style"||An(r,"type")!=="paragraph")continue;let n=An(r,"styleId");if(n===void 0||n.length===0||n.length>id||ld.test(n))continue;let a=g$1(r);a!==null&&t.set(n,a);}return t}function Dn(e){let t=vi(e,"pPr"),r=t?vi(t,"pStyle"):void 0;return r?An(r,"val"):void 0}function Si(e,t){let r=ud(t);if(r.size===0)return [];let n=[];for(let a of Ze(e)){if(!Mn(a))continue;let o=Dn(a);if(o===void 0)continue;let s=r.get(o);if(s===void 0)continue;let l=Nm(e,a.id)??"",i=a.kind==="paragraph"?Pm(a,l):l,d=_b(i).replace(cd," ").trim().slice(0,dd);d.length!==0&&n.push({text:d,level:s,blockId:a.id});}return n}var Ci=new Map,Sr=new Map;function Ri(){Ci=Sr,Sr=new Map;}function Fn(e){let t=Sr.get(e)??Ci.get(e);return t||(t=id$1(e)),Sr.set(e,t),t}function md(e,t,r){let n=new Map,a=r(e);for(let o of a){let s=n.get(o.hostParagraphId);s?s.push(o):n.set(o.hostParagraphId,[o]);}return n}function fd(e,t,r){let n=[];for(let a of Fn(e.root)){let o=t.get(a.id);if(o)for(let s of o)n.push(s);}return n}function Oi(e,t,r=fk){let n=[],a=new Map;for(let o of e){if(n.push(o),o.scope?.kind==="note")continue;let s=a.get(o.part);s||(s=md(o.part,t,r),a.set(o.part,s));for(let l of fd(o,s)){let i=o.scope;n.push({part:o.part,root:l.root,scope:{kind:"frame",id:l.root.id,drawingNodeId:l.drawingNodeId,hostParagraphId:l.hostParagraphId,...i?.kind==="headerFooter"?{owner:i}:{}}});}}return n}var Cr=48,pd=/[\u0000-\u001F\u007F-\u009F]/g;function hd(e){let t=[],r=Ii$1(e),n=new Map;for(let a of r.segments)hh(a.node)&&n.set(a.node.id,a.formatRunIds??[]);return sd$1(e.children,0,a=>{if(a.kind==="run"){t.push({id:a.id,start:r.spanOf(a)?.start??0});return}if(hh(a))for(let o of n.get(a.id)??[]){let s=r.spanOf(o);s&&t.push({id:o,start:s.start});}},{descendRevisions:true}),t}function gd(e){let t=hd$1(e);return t?[{part:e,root:t}]:[]}function yd(e,t){let r=[];for(let n of ["header","footer"])for(let a of e){let o=n==="header"?a.headers:a.footers;for(let[s,l]of o){if(!tf(a,s)||t.has(l.part))continue;t.add(l.part);let i=fd$1(l.part).find(d=>d.kind===n);i&&r.push({part:l.part,root:i.root,scope:{kind:"headerFooter",rId:l.rId}});}}return r}function wi(e,t,r){if(!e)return [];let n=[];for(let a of bd$1(e.root)){let o=Rc$1(a);!Tc$1(a)||o===null||!r.has(o)||n.push({part:e,root:a,scope:{kind:"note",id:Hc$1(t,o)}});}return n}function xd(e,t){let r=gd(e);if(t){let n=new Set;for(let a of yd(t.headerFooterBySection,n))r.push(a);for(let a of wi(t.footnotes,"footnote",t.referencedNoteIds.footnote))r.push(a);for(let a of wi(t.endnotes,"endnote",t.referencedNoteIds.endnote))r.push(a);}return Oi(r)}function Ei(e,t){if(e.length===0)return {index:0,offset:t};for(let r=e.length-1;r>=0;r-=1){let n=e[r].start;if(t>=n)return {index:r,offset:t-n}}return {index:0,offset:t}}function kd(e,t,r){let n=e.findIndex(a=>a.id===t);return n<0?null:{index:n,offset:r}}var Ni=new _g;function bd(e){let t=Ni.get(e);return t||(t=d$1(e,Om(e)),Ni.set(e,t)),t}function Ln(e,t){return _b(e).replace(pd," ").slice(0,t)}var Pd=1e3;function Ti(e,t,r={},n){let a=r.limit!==void 0&&Number.isInteger(r.limit)&&r.limit>0?Math.min(r.limit,2e3):2e3,o={...r.matchCase===void 0?{}:{matchCase:r.matchCase},...r.wholeWord===void 0?{}:{wholeWord:r.wholeWord}},s=t.slice(0,Pd),l=s.map(()=>({matches:[],truncated:false})),i=s.map((c,u)=>ya(c)?u:-1);if(i=i.filter(c=>c>=0),i.length===0)return l;let d=r.stories==="body"?void 0:n;Ri();for(let c of xd(e,d)){let u=0;for(let f of Fn(c.root)){if(f.kind!=="paragraph")continue;let m=u;u+=1;let h=bd(f);if(h.text.length===0)continue;let g=null,y=false;for(let k of i){let C=l[k],N=a-C.matches.length,O=h.findOccurrences(s[k],Math.max(N,1),o);if(N===0&&O.matches.length>0){C.truncated=true,y=true;continue}for(let R of O.matches){let F=R.start+R.length;g??=hd(f);let $=h.resultRunAddressAt(R.start),L=$?kd(g,$.runId,$.offset)??Ei(g,R.rawStart):Ei(g,R.rawStart);C.matches.push({blockId:f.id,start:R.rawStart,length:R.rawEnd-R.rawStart,paragraphIndex:m,runIndex:L.index,runOffset:L.offset,...c.scope?{scope:c.scope}:{},text:Ln(h.displaySlice(R.start,F),256),contextBefore:Ln(h.displaySlice(Math.max(0,R.start-Cr),R.start),Cr),contextAfter:Ln(h.displaySlice(F,F+Cr),Cr)});}O.truncated&&(C.truncated=true,y=true);}if(y&&(i=i.filter(k=>!l[k].truncated)),i.length===0)return l}}return l}var vd=32;function Ii(e){let t=null;return((r,n)=>{let a=e.revision(),o=typeof r!="string",s=`${n?.matchCase===true?"c":""}${n?.wholeWord===true?"w":""}`,l=`${n?.limit??""}:${n?.stories??"all"}`,i=JSON.stringify([s,l,r]);t?.revision!==a&&(t={revision:a,results:new Map});let d=t.results.get(i);if(d)return d;let c=e.bodyPart(),u=e.currentPackage(),f={footnote:new Set,endnote:new Set};for(let g of uj(c))f[g.noteKind].add(g.noteId);let m=Ti(c,o?r:[r],n,{headerFooterBySection:e.headerFooterBySection(),footnotes:tj(u,"footnote")??null,endnotes:tj(u,"endnote")??null,referencedNoteIds:f}),h=o?m:m[0];return t.results.size>=vd&&t.results.delete(t.results.keys().next().value),t.results.set(i,h),h})}var Sd=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function st(e,t=null,r=null){return re(e,t,r)}function Ai(e){let t=ue$1(e),r=[];for(let n of Sd){let a=t.get(n);if(!a)return [];r.push({slot:n,hex:a});}return r}var Mi=new WeakMap;function $n(e){let t=Mi.get(e);if(t!==void 0)return t;let r=wb(e),n=r===null||!vb(r)?null:r;return Mi.set(e,n),n}var _n=class{#e;#t;constructor(t,r){this.#e=t,this.#t=r;}get size(){return this.#e.size}get(t){if(this.#e.has(t))return this.#t.find(r=>t.startsWith(`${r.name}#`))}has(t){return this.get(t)!==void 0}*entries(){for(let t of this.#e.keys()){let r=this.get(t);r&&(yield [t,r]);}}keys(){return this.#e.keys()}*values(){for(let[,t]of this.entries())yield t;}[Symbol.iterator](){return this.entries()}forEach(t,r){for(let[n,a]of this.entries())t.call(r,a,n,this);}};function Di(e,t){return Object.freeze({...e,partByNode:new _n(e.ordinalByNode,t)})}function Fi(e){let t=new Map,r=new Map,n=new Map,a=new Set,o=new Map,s=new Map,l=0;for(let i of e)for(let d of oe(i)){n.set(d.id,l),o.set(d.id,i),l+=1;let c=$n(d);if(c===null)continue;t.set(d.id,c);let u=c.toUpperCase(),f=s.get(u);f?(f.push(d.id),a.add(u)):(s.set(u,[d.id]),r.set(u,d.id));}return Object.freeze({paraIdByNode:t,nodeByParaId:r,ordinalByNode:n,ambiguousParaIds:a,partByNode:o,claimantsByParaId:s})}function Li(e,t){let r=e.indexOf("#");if(r===0)return null;let n=r===-1?Rd(e,t):Cd(e,r,t);if(!n)return null;let a=eb(n,e);return a?.kind==="paragraph"?$n(a):null}function Cd(e,t,r){let n=e.slice(0,t),a=r.body.name===n?r.body:void 0;a??=r.openStories.find(s=>s.name===n);let o=a?void 0:r.otherStories.find(s=>s.name===n);return a??(o?r.normalize(o):void 0)}function Rd(e,t){if(eb(t.body,e))return t.body;let r=t.openStories.find(n=>eb(n,e)!==null);if(r)return r;for(let n of t.otherStories){let a=t.normalize(n);if(eb(a,e))return a}}function Un(e){return e.historyToken??e.historyGroup}var _i={committed:false,rejected:false,opCount:0};function ge(e,t){return t===void 0?{committed:false,rejected:true,opCount:e}:{committed:false,rejected:true,opCount:e,reason:t}}function $i(e,t,r={}){let n=t.filter(c=>c.ops.length>0),a=r.partOps??[],o=[...n,...a].reduce((c,u)=>c+u.ops.length,0);if(o===0)return r.packageEdits?.length?ge(0,"invalidArgs"):_i;if([...n,...a].some(c=>c.ops.some(oj))||[...n,...a].some(c=>c.ops.some(Jj)))return ge(o,"invalidArgs");let[s,...l]=n,i=[];for(let c of l){let u=e.partFor(c.scope);if(!u)return ge(o,"unknown-part");i.push({partName:u.name,ops:c.ops});}let d=e.transact(s?.scope??{kind:"body"},c=>{for(let u of r.packageEdits??[])c.applyPackage(u);for(let u of s?.ops??[])c.apply(u);for(let u of i)for(let f of u.ops)c.applyTo(u.partName,f);for(let u of a)for(let f of u.ops)c.applyTo(u.partName,f);},{...r,historyGroup:Un(r)});return d.ok?{committed:true,rejected:false,opCount:o}:ge(o,d.reason)}function Ui(e,t,r,n,a,o){let s=o.partOps??[],l=t.length+s.reduce((u,f)=>u+f.ops.length,0);if(l===0&&!o.packageEdits?.length)return _i;if(s.some(u=>u.ops.some(f=>oj(f)||Jj(f))))return ge(l,"invalidArgs");let i=t.filter(u=>oj(u)||Jj(u)).length;if(i>0){if(s.length||o.packageEdits?.length||i!==t.length||t.length!==1)return ge(t.length,"invalidArgs");let u=e.applyLifecycleOp(t[0],{actorId:o.actorId,historyGroup:Un(o)});return u.ok?{committed:true,rejected:false,opCount:1}:ge(1,u.detail??u.reason)}let d=o.recordsHistory===false&&o.actorId&&o.operationId?e.partFor(a)?.name:void 0,c=e.transact(a,u=>{r!==void 0&&u.selectionBefore(r),n!==void 0&&u.selectionAfter(n);for(let f of o.packageEdits??[])u.applyPackage(f);for(let f of t)u.apply(f);for(let f of s)for(let m of f.ops)u.applyTo(f.partName,m);d&&u.applyPackage(f=>a$2(f,d,t));},{...o,historyGroup:Un(o)});return c.ok?{committed:true,rejected:false,opCount:l}:ge(l,c.reason)}var Od=Object.freeze([]);function wd(e,t={}){return Ed(pg(e),t)}function Ed(e,t={}){if(!e.ok)return e;let r=ta(e.package),n=r.parts.get(r.mainDocumentPart);if(!n)return {ok:false,reason:"no-main-document-tree",detail:r.mainDocumentPart};let a=Eb(n),o=new T$1(r,Aa(r,a),t.contentLockPolicy?{contentLockPolicy:t.contentLockPolicy}:{}),s=null,l=null,i=null,d$1=null,c=null;o.subscribe(p=>{d$1=p,c=o.currentPackage();});let u=()=>o.bodyStore(),f$1=()=>o.currentPackage(),m=Gs(),h=Object.freeze({kind:"body"}),g=(p,x)=>{let b=x?.find(S=>S.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!b)return;let v=N(b);return v.mode==="Internal"&&v.target.ok?p.parts.get(v.target.partName):void 0},y=(p,x,b)=>{if(p.mainRelationships!==b||p.settingsPart!==g(x,b))return false;for(let v of p.resolution)for(let S of [v.headers,v.footers])for(let A of S.values())if(x.parts.get(A.partName)!==A.part)return false;return true},k=()=>{let p=f$1(),x=p.relationships.get(p.mainDocumentPart);if(s&&d$1&&c===p&&y(s,p,x)&&s.packageRevision===d$1.fromRevision&&o.packageRevision===d$1.toRevision&&d$1.story?.kind==="body"&&d$1.impact==="text-local"&&d$1.created.length===0&&d$1.deleted.length===0&&d$1.splitJoin.length===0&&(s={...s,packageRevision:o.packageRevision,pkg:p,mainRelationships:x,settingsPart:g(p,x)}),!s||s.packageRevision!==o.packageRevision||s.pkg!==p){let b=wf(p);s={packageRevision:o.packageRevision,pkg:p,mainRelationships:x,settingsPart:g(p,x),resolution:b,parts:vf(b)};}return s},C="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",N$1=null,O=()=>{let p=f$1(),x=(p.relationships.get(p.mainDocumentPart)??[]).find(S=>S.type===C),b;if(x){let S=N(x);S.mode==="Internal"&&S.target.ok&&(b=p.parts.get(S.target.partName));}b??=p.parts.get("/word/styles.xml");let v=b?.root??null;return v!==N$1&&(N$1=v,ut=null,Re=null),N$1},R=null,F=null,$=()=>{let p=f$1();return R===p||(R=p,F=vd$1(p)),F},L="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",ie=null,J=null,V=()=>{let p=f$1();if(ie===p)return J;ie=p;let x=(p.relationships.get(p.mainDocumentPart)??[]).find(S=>S.type===L),b;if(x){let S=N(x);S.mode==="Internal"&&S.target.ok&&(b=p.parts.get(S.target.partName));}b??=p.parts.get("/word/settings.xml");let v=b?.root??null;return v!==J&&(J=v,At=null,ut=null,Re=null),J},Rr="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",it="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Bn=(p,x)=>{let b=f$1(),v=(b.relationships.get("/")??[]).find(A=>A.type===p),S;if(v){let A=N(v);A.mode==="Internal"&&A.target.ok&&(S=b.parts.get(A.target.partName));}return S??b.parts.get(x)},Hn=null,Or=dk,Hi=()=>{let p=f$1();if(Hn===p)return Or;Hn=p;let x=Bn(Rr,"/docProps/core.xml"),b=Bn(it,"/docProps/app.xml");return Or=ek(x?.root??null,b?.root??null),Or},ji="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",jn=null,It=null,Ue=()=>{let p=f$1();if(jn===p)return It;jn=p;let x=(p.relationships.get(p.mainDocumentPart)??[]).find(S=>S.type===ji),b;if(x){let S=N(x);S.mode==="Internal"&&S.target.ok&&(b=p.parts.get(S.target.partName));}b??=p.parts.get("/word/theme/theme1.xml");let v=b?.root??null;return v!==It&&(It=v,At=null,wr=null,ut=null,Re=null),It},Xi$1="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",Xn=null,Wn=()=>{let p=f$1(),x=(p.relationships.get(p.mainDocumentPart)??[]).find(S=>S.type===Xi$1),b=x?N(x):null;return (b?.mode==="Internal"&&b.target.ok?p.parts.get(b.target.partName):void 0)??p.parts.get("/word/fontTable.xml")},Wi=()=>(Xn??=Object.freeze(Wg(f$1(),Wn())),Xn),lt=null,Be=null,ct=null,dt=null,ut=null,wr=null,At=null,zn=()=>{let p=[u().part.root],x=new Set;for(let b of ye())x.has(b)||(x.add(b),p.push(b.root));return p},Er=()=>{let p=zn(),x=O();return x&&p.splice(1,0,x),p},Re=null,Mt=null,mt=null,He=null,Vn$1=new WeakMap,Dt=null,Gn=p=>{let x=Vn$1.get(p);if(x)return x;let b=Eb(p);return Vn$1.set(p,b),b},Kn=()=>{let p=o.packageRevision,x=o.openStoryToken();if(!He||He.revision!==p||He.openStories!==x){let b=o.openStoryParts(),v=new Set(b.map(ee=>ee.name)),S=ye().filter(ee=>!v.has(ee.name)).map(Gn),A=[u().part,...b,...S],_=He,le=_!==null&&d$1!==null&&_.openStories===x&&_.revision===d$1.fromRevision&&p===d$1.toRevision&&d$1.impact==="text-local"&&d$1.created.length===0&&d$1.deleted.length===0&&d$1.splitJoin.length===0&&_.parts.length===A.length&&_.parts.every((ee,xe)=>ee.name===A[xe]?.name);He={revision:p,openStories:x,parts:A,index:le&&_?Di(_.index,A):Fi(A)};}return He.index},Yn=ai(),zi=()=>{let p=u().part.name,x=new Map;for(let b of [u().part,...ye()])for(let[v,S]of ka(f$1(),b.name,p))x.set(v,S);return x},Vi=()=>[u().part,...ye()],ye=()=>{let p=[],x=new Set;for(let v of k().parts)for(let S of [v.headers,v.footers])for(let A of S.values())x.has(A)||(x.add(A),p.push(A));let b=f$1();for(let v of ["footnote","endnote"]){let S=tj(b,v);!S||x.has(S)||(x.add(S),p.push(S));}return p},Jn={ok:true,session:{editable:oe(u().part).length>0,paragraphIds:()=>oe(u().part).map(p=>p.id),paragraphIdsIn(p=h){let x=o.partFor(p);return x?oe(x).map(b=>b.id):[]},part:()=>u().part,partFor:p=>o.partFor(p),currentPackage:f$1,collaborationPort:p=>b(o,{documentId:p,interactive:true}),applyTreeOps(p,x,b,v=h,S={}){return Ui(o,p,x,b,v,S)},applyTreeOpsAtomic(p,x={}){return $i(o,p,x)},projectDoc:()=>Te(u().part),reconcile:p=>Yr(p,u().part,d$1),lastCommitWasStructural:()=>d$1!==null&&(d$1.created.length>0||d$1.deleted.length>0||d$1.splitJoin.length>0||d$1.impact==="global"),applyPmDoc(p){let x=u(),b=Kr(x.part,p);if(!b.ok)return {committed:false,rejected:true,opCount:0,reason:b.reason};if(b.ops.length===0)return {committed:false,rejected:false,opCount:0};let v=o.transact(h,S=>{for(let A of b.ops)S.apply(A);});return v.ok?{committed:true,rejected:false,opCount:b.ops.length}:{committed:false,rejected:true,opCount:b.ops.length,reason:v.reason}},storyParts:Vi,bodyText:()=>Ys(u().part),storyText(p){let x=o.partFor(p);return x?oe(x).map(b=>Nm(x,b.id)??"").join(`
6
+ `):null},revision:()=>u().revision,revisionFor:p=>o.revisionFor(p),packageRevision:()=>o.packageRevision,canUndo:()=>o.canUndo,canRedo:()=>o.canRedo,undo:()=>{let p=o.selectionForUndo();return o.undo()===null?null:p},redo:()=>{let p=o.selectionForRedo();return o.redo()===null?null:p},beginComposition:(p=h)=>{o.beginComposition(p);},endComposition:()=>o.endComposition(),subscribe(p){return o.subscribe(p)},save(){return m(f$1())},saveSteps(){return m.steps(f$1())},headerFooterParts:()=>{let p=k().parts;return p[p.length-1]??yf(f$1())},headerFooterPartsBySection:()=>k().parts,headerFooterResolutionBySection:()=>k().resolution,documentFonts(){return lt&&lt.revision===o.packageRevision||(lt={revision:o.packageRevision,fonts:pi(Er(),st(Ue(),V()))}),lt.fonts},symbolFontFamilies(){return ct&&ct.revision===o.packageRevision||(ct={revision:o.packageRevision,fonts:xi(Er())}),ct.fonts},renderedFontFamilies(){let p=O();return Be&&Be.revision===o.packageRevision&&Be.styles===p||(Be={revision:o.packageRevision,styles:p,families:f(zn(),p,st(Ue(),V()))}),Be.families},rendersText(){return dt&&dt.revision===o.packageRevision||(dt={revision:o.packageRevision,rendersText:ki(Er())}),dt.rendersText},documentStyles(){let p=O(),x=Ue(),b=V();Re??=d(p,st(x,b));let v=Re;return ut??=Pi(p,S=>v(S)),ut},stylesRoot:()=>O(),documentThemeFonts(){let p=Ue(),x=V();return At??=st(p,x,Wn()?.root??null),At},numberingRoot:()=>$(),settingsRoot:()=>V(),documentProperties:()=>Hi(),trackingSettings:()=>ak(V()),documentThemeColors(){let p=Ue();return wr??=Ai(p),wr},effectiveRunDefaults(p,x){let b=O(),v=Ue(),S=V();Re??=d(b,st(v,S));let A=u();if(!Mt||Mt.revision!==A.revision){let _=new Map;for(let le of oe(A.part))le.kind!=="textValue"&&_.set(le.id,Dn(le)??null);Mt={revision:A.revision,byId:_};}return Re(Mt.byId.get(p)??null,x)},documentOutline(){let p=u();return mt&&mt.revision===p.revision||(mt={revision:p.revision,outline:Si(p.part,O())}),mt.outline},findText:Ii({revision:()=>o.packageRevision,bodyPart:()=>u().part,currentPackage:f$1,headerFooterBySection:()=>k().resolution}),embeddedFonts:Wi,paragraphAnchors:Kn,paraIdOf:p=>Li(p,{body:u().part,openStories:o.openStoryParts(),otherStories:ye(),normalize:Gn}),nodeIdOf:p=>Kn().nodeByParaId.get(p.toUpperCase())??null,relationshipTarget:(p,x=h)=>{let b=f$1(),v=o.partFor(x);return v?jj(b,v.name,p):null},bookmarks:()=>{let p=o.packageRevision;if(!Dt||Dt.revision!==p){let x=new Map(Li$1(u().part));for(let b of ye())for(let[v,S]of Li$1(b))x.has(v)||x.set(v,S);Dt={revision:p,index:x};}return Dt.index},ensureHyperlinkRelationship(p,x=h){let b=o.partFor(x);return b?Xa$1(o,()=>{let v=f$1(),S=ij(v,p,b.name);return S?(S.pkg!==v&&o.replacePackageShell(S.pkg),S.relationshipId):null},v=>v!==null):null},reviewItems(){let p=t.reviewModel;if(!p)return Od;let x=u(),b=`${o.packageRevision}:${x.revision}`;if(l&&l.revisionKey===b)return l.items;let v=f$1(),S=v.parts.get(aa(v,x.part.name)),A=v.parts.get(ba(v,x.part.name)),_={root:x.part.root,commentsPart:S,commentsExtendedPart:A,stylesPart:ud$1(v),numberingRoot:$(),furnitureParts:ye(),customNodePayloads:zi()},{stylesPart:le,numberingRoot:ee}=_,xe=di(p,v,_,l),Zn=()=>Yn.get(_)??xe.filtered(p.collectReviewItems({storyPart:x.part,furnitureParts:_.furnitureParts,stylesPart:_.stylesPart,commentsPart:S,commentsExtendedPart:A,customNodePayloads:_.customNodePayloads})),Nr={part:x.part,commentsPart:S,commentsExtendedPart:A,currentPackageRevision:o.packageRevision,currentPackage:v,changePackage:c},je,ft=null;if(l&&d$1&&xe.sameFilter&&qs(d$1,l,l.items,Nr))je=l.items;else {let Xe=l&&d$1?ei(d$1,l,l.items,Nr):null,Tr=Xe&&l&&xe.patchable(Xe)?p.revisionItemsOfParagraph(x.part,Xe):null;if(Xe&&l&&Tr&&gr(l.items,Tr,Xe,x.part)){ft=l.paragraphOrder??Vk(x.part);let pt=yr(l.items,ft,Xe,Tr,xe.filtered,x.part);pt||(ft=Vk(x.part)),je=pt??Zn();}else {let pt=oi(d$1,l,Nr,xe,p);ft=pt?.paragraphOrder??Vk(x.part),je=pt?.items??Zn();}}return Yn.set(_,je=xe.publish(je)),l={revisionKey:b,bodyRevision:x.revision,packageRevision:o.packageRevision,items:je,paragraphOrder:ft,commentsPart:S,commentsExtendedPart:A,pkg:v,stylesPart:le,numberingRoot:ee},l.items},hasReviewContent(){let p=o.packageRevision;if(!i||i.revision!==p){let x=ud$1(f$1()),b=[u().part,...ye(),...x?[x]:[]];i={revision:p,present:b.some(v=>Pn(v.root)||Sl$1(v).length>0)};}return i.present},replyToComment(p,x,b,v,S,A=h,_,le={}){let ee=ca(o,{anchor:{paragraphId:x.paragraphId,start:x.start,end:x.end,...x.endParagraphId===void 0?{}:{endParagraphId:x.endParagraphId}},author:v,text:b,...S===void 0?{}:{date:S},...p===null?{}:{replyToCommentId:p},..._===void 0?{}:{actorId:_}},A,le.historyToken);return ee.ok?ee.commentId:null},setCommentResolved(p,x,b={}){return da(o,p,x,b.historyToken).ok},deleteComment(p,x=h,b,v){return this.deleteComments([{commentId:p}],x,b,v)},deleteComments(p,x=h,b,v={}){return ea(o,p,x,b,v.historyToken)},insertCustomNode(p,x=h,b={}){return ma(o,p,x,b.historyToken)},removeCustomNode(p,x=h){return na(o,p,x)},sweepCustomNodePayloads(p){return Xa$1(o,()=>{let x=u(),b=ja$1(o.currentPackage(),x.part.name,p);return b.ok?b.removed.length===0?{ok:true,removed:[]}:(o.replacePackageShell(b.pkg),{ok:true,removed:b.removed}):{ok:false,reason:b.reason}},x=>x.ok&&x.removed.length>0)},ensureListDefinition(p,x){return Xa$1(o,()=>{let b=Xi(f$1(),p,x);return b?(o.replacePackageShell(b.pkg),R=null,F=null,b.numId):null},b=>b!==null)},ensureNumberingLevel(p,x,b){return Xa$1(o,()=>{let v=f$1(),S=Yi$1(v,p,x,b);return S?S!==v?(o.replacePackageShell(S),R=null,F=null,{ok:true,changed:true}):{ok:true,changed:false}:{ok:false,changed:false}},v=>v.changed).ok},insertImage(p,x){return o.insertImage(p,x)},replaceImage(p,x,b,v,S,A){return o.replaceImage(p,x,b,v,S,A)},deleteImage(p,x){return o.deleteImage(p,x)},deleteImageTracked(p,x,b){return o.deleteImageTracked(p,x,b)},applyImageProperties:(p,x)=>o.applyImageProperties(p,x),charts:()=>Vs(o),applyFragmentPaste:(p,x)=>o.applyFragmentPaste(p,x),replacePackage:p=>za(o,p)}};return Vn(Jn.session,o),Jn}var Nd=g.projection;function Bd(e,t,r){let n=e.filter(a=>a.localName!==t);return n.length!==e.length?n:[...n,r?{localName:t,attributes:r}:{localName:t}]}function Hd(e,t,r={}){let n=null,a=false,o=()=>r.onChange?.(s()),s=()=>({revision:t.revision(),canUndo:t.canUndo(),canRedo:t.canRedo(),lastRejection:n}),l=m=>{a=true;let h=d.state.tr.replaceWith(0,d.state.doc.content.size,m.content);h.setMeta("addToHistory",false),d.dispatch(h),a=false;},i=m=>()=>(m()&&(l(t.projectDoc()),o()),true),d=new EditorView(e,{state:EditorState.create({doc:t.projectDoc(),plugins:[keymap({...baseKeymap,Home:selectTextblockStart,End:selectTextblockEnd,"Mod-z":i(()=>t.undo()!==null),"Mod-y":i(()=>t.redo()!==null),"Shift-Mod-z":i(()=>t.redo()!==null),"Mod-b":(m,h)=>f(m,h,"b"),"Mod-i":(m,h)=>f(m,h,"i"),"Mod-u":(m,h)=>f(m,h,"u",{val:"single"})})]}),editable:()=>t.editable,handleDOMEvents:{keydown:m=>(c(m),false),beforeinput:(m,h)=>{let g=h;if(m.composing)return false;c(m);let y=g.inputType;if(y==="insertText"&&g.data!=null){g.preventDefault();let{from:k,to:C}=m.state.selection;return m.dispatch(m.state.tr.insertText(g.data,k,C)),true}if(y==="deleteContentBackward"){g.preventDefault();let{from:k,empty:C}=m.state.selection;return C?k>0?m.dispatch(m.state.tr.delete(k-1,k)):joinBackward(m.state,m.dispatch):deleteSelection(m.state,m.dispatch),true}if(y==="deleteContentForward"){g.preventDefault();let{from:k,to:C,empty:N}=m.state.selection;return N?C<m.state.doc.content.size?m.dispatch(m.state.tr.delete(k,k+1)):joinForward(m.state,m.dispatch):deleteSelection(m.state,m.dispatch),true}return y==="insertParagraph"?(g.preventDefault(),splitBlock(m.state,m.dispatch),true):false},compositionstart:()=>(t.beginComposition(),false),compositionend:()=>(t.endComposition(),o(),false)},dispatchTransaction(m){let h=d.state.apply(m);if(a||!m.docChanged){d.updateState(h);return}let g=t.applyPmDoc(h.doc);if(g.rejected){n=String(g.reason??"rejected"),d.updateState(h),l(t.projectDoc()),o();return}n=null,d.updateState(g.committed&&t.lastCommitWasStructural()?u(h):h),o();}});function c(m){if(m.composing||a)return;let h=m.dom.ownerDocument.getSelection(),g=h?.anchorNode,y=h?.focusNode;if(!(!h||!g||!y)&&!(!m.dom.contains(g)||!m.dom.contains(y)))try{let k=m.posAtDOM(g,h.anchorOffset),C=m.posAtDOM(y,h.focusOffset),N=m.state.selection;if(N.anchor===k&&N.head===C)return;let O=TextSelection.create(m.state.doc,k,C);m.dispatch(m.state.tr.setSelection(O).setMeta("addToHistory",!1));}catch{}}function u(m){let h=t.paragraphIds(),g=m.tr,y=false,k=0;return m.doc.forEach((C,N)=>{let O=h[k];k+=1,!(C.type.name!=="paragraph"||O===void 0)&&C.attrs.nodeId!==O&&(g=g.setNodeMarkup(N,void 0,{...C.attrs,nodeId:O}),y=true);}),y?m.apply(g.setMeta("addToHistory",false)):m}function f(m,h,g,y){let k=X.marks.runProps;if(!h)return true;let{from:C,to:N,empty:O}=m.selection;if(O)return true;let F=m.doc.resolve(C).marks().find(ie=>ie.type===k)?.attrs.props??[],$=Bd(F,g,y),L=m.tr;return L.removeMark(C,N,k),$.length>0&&L.addMark(C,N,k.create({props:$})),h(L),true}return {view:d,state:s,undo:()=>i(()=>t.undo()!==null)(),redo:()=>i(()=>t.redo()!==null)(),toggleRunProperty(m,h){f(d.state,d.dispatch.bind(d),m,h);},destroy:()=>d.destroy()}}export{wd as A,Ed as B,Nd as C,Hd as D,Me as a,kt as b,qe as c,Tl as d,or as e,Eu as f,Nu as g,Tu as h,Vu as i,Gu as j,Ku as k,Yu as l,Fs as m,Ec as n,X as o,Vr as p,Ze as q,oe as r,Te as s,Kr as t,ll as u,Yr as v,Dn as w,ef as x,Wc as y,cf as z};