@nervekit/desktop 0.40.1 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -2
- package/THIRD-PARTY-LICENSES.txt +968 -30
- package/dist/bin.js +1 -0
- package/dist/{chunk-OY6PIAR7.js → chunk-2ICPO4UM.js} +5 -5
- package/dist/{chunk-SQ7CWNIT.js → chunk-3CZXUKLG.js} +1 -1
- package/dist/{chunk-QFXKQNMT.js → chunk-4OCDR4DU.js} +14 -17
- package/dist/chunk-62DQXVPO.js +69 -0
- package/dist/chunk-6GUJQURI.js +142 -0
- package/dist/{chunk-CEX2GWGZ.js → chunk-6IHXVT5H.js} +1 -1
- package/dist/{chunk-MH3SUHI2.js → chunk-6ZS7TA6E.js} +2 -2
- package/dist/chunk-7FSH3ABG.js +249 -0
- package/dist/chunk-7HGFEQSD.js +224 -0
- package/dist/chunk-7RPHIJT3.js +153 -0
- package/dist/{chunk-5Y3NEEOK.js → chunk-AAEIGAGD.js} +9 -9
- package/dist/{chunk-HKLAYK2Z.js → chunk-APY4TUR3.js} +210 -0
- package/dist/chunk-BACYVEE6.js +128 -0
- package/dist/chunk-BG2KGLIA.js +783 -0
- package/dist/{chunk-XBHEYY65.js → chunk-BN5YDZUZ.js} +1205 -326
- package/dist/chunk-BUD4JHBZ.js +7017 -0
- package/dist/{chunk-MN7PZ2PH.js → chunk-DDBE2VLT.js} +2 -2
- package/dist/chunk-EF7ZZKA3.js +168 -0
- package/dist/{chunk-TJR6ASRW.js → chunk-EUT45AKW.js} +22 -24
- package/dist/{chunk-L3YB2QLN.js → chunk-FCAIYPDJ.js} +2 -2
- package/dist/{chunk-AJGPULMX.js → chunk-FZ557YWE.js} +47603 -55411
- package/dist/chunk-HPINJGBO.js +359 -0
- package/dist/{chunk-H5UKINTD.js → chunk-IRRR3PWN.js} +68 -65
- package/dist/{chunk-CWHAK2HX.js → chunk-IVBMHEPK.js} +33 -55
- package/dist/{chunk-FESN7DND.js → chunk-JBEWFFOK.js} +1 -1
- package/dist/{chunk-CKVFGRVV.js → chunk-KEXKZKN4.js} +54 -7
- package/dist/{chunk-UGDIHDAR.js → chunk-KUFIFCB4.js} +1 -1
- package/dist/chunk-L5WGVYXM.js +42 -0
- package/dist/{chunk-ONWQH2W6.js → chunk-LGIIT2NF.js} +15 -18
- package/dist/{chunk-KSZJ3HGD.js → chunk-LP4APBBQ.js} +1 -1
- package/dist/{chunk-DBXMYYPJ.js → chunk-M3ELKCNA.js} +1 -1
- package/dist/chunk-MI6L5CEA.js +183 -0
- package/dist/chunk-N4OXAS3A.js +40 -0
- package/dist/chunk-N6BUYKF3.js +340 -0
- package/dist/{chunk-KIGB3FK6.js → chunk-NVVW3MWJ.js} +9 -8
- package/dist/{chunk-V53CETNZ.js → chunk-O5JHHRFN.js} +242 -105
- package/dist/{chunk-KQPEOUCA.js → chunk-O6FDXE54.js} +19 -23
- package/dist/{chunk-QWTKCUIZ.js → chunk-OMCM3MHS.js} +11 -9
- package/dist/{chunk-55OGZFNA.js → chunk-P72Y5ZBH.js} +31 -15
- package/dist/{chunk-AON37AL2.js → chunk-PVPJAGWR.js} +29 -4
- package/dist/{chunk-24GQ74HM.js → chunk-Q3C7TQ2M.js} +3 -3
- package/dist/chunk-Q5E4ZL2R.js +14 -0
- package/dist/chunk-QFK2SWD2.js +258 -0
- package/dist/chunk-RJR7DJJK.js +32 -0
- package/dist/{chunk-BXVRC3HF.js → chunk-RL52LSTV.js} +1 -1
- package/dist/{chunk-KAZFF2RD.js → chunk-RTB6CF7F.js} +137 -113
- package/dist/{chunk-TW6FURZ7.js → chunk-SDDKYMIP.js} +18313 -4317
- package/dist/{chunk-S2PITDVA.js → chunk-TQURLRHD.js} +1 -1
- package/dist/{chunk-2Z5FLMLE.js → chunk-TSAUBRRU.js} +1 -1
- package/dist/chunk-U3TEC52G.js +64 -0
- package/dist/chunk-U5KGV63C.js +39 -0
- package/dist/{chunk-FOFVPPPV.js → chunk-UVRULOOP.js} +10 -9
- package/dist/{chunk-QVHYARC2.js → chunk-VOATSLRG.js} +5 -1
- package/dist/{chunk-WXRYBXYR.js → chunk-W7LEYYFH.js} +53 -65
- package/dist/chunk-WC5HHPPM.js +22 -0
- package/dist/{chunk-3DGBM7UW.js → chunk-WG62RHZ2.js} +3 -3
- package/dist/{chunk-D7WIIZAV.js → chunk-WIQEPAUG.js} +10 -9
- package/dist/chunk-XM27UVWN.js +250 -0
- package/dist/{chunk-4MMJDHFX.js → chunk-XTUSLUQ7.js} +70 -71
- package/dist/{chunk-N5B2RRSS.js → chunk-Z6AY5VOZ.js} +47 -26
- package/dist/{chunk-I6NVW4NX.js → chunk-ZGWXLG5X.js} +29 -33
- package/dist/{chunk-XNYZEQ3U.js → chunk-ZUWBEV2O.js} +1 -1
- package/dist/chunk-ZVH6EB7S.js +29 -0
- package/dist/daemon.js +65 -26
- package/dist/extension-assets/atlassian/docs/confluence-raw.md +31 -0
- package/dist/extension-assets/atlassian/docs/confluence-writing.md +101 -0
- package/dist/extension-assets/atlassian/docs/jira-raw.md +16 -0
- package/dist/extension-assets/atlassian/docs/jira-workflows.md +77 -0
- package/dist/extension-assets/atlassian/docs/project-knowledge.md +25 -0
- package/dist/extension-assets/atlassian/docs/storage.md +58 -0
- package/dist/extension-assets/atlassian/icon.svg +20 -0
- package/dist/extension-assets/diagram/docs/diagrams.md +12 -0
- package/dist/extension-assets/imagegen/docs/imagegen.md +17 -0
- package/dist/extension-assets/web-search/icon.svg +1 -0
- package/dist/git-isolated-reader-helper.js +1 -1
- package/dist/html-to-markdown.worker.js +6 -7028
- package/dist/main.js +583 -164
- package/dist/preload.cjs +45 -2
- package/dist/quick-script-docs/runtime/documents.md +54 -0
- package/dist/quick-script-docs/runtime/files.md +11 -0
- package/dist/quick-script-docs/runtime/images.md +10 -0
- package/dist/sandbox-libraries/docx.LICENSE +21 -0
- package/dist/sandbox-libraries/docx.min.js +9 -0
- package/dist/sandbox-libraries/jszip.LICENSE +651 -0
- package/dist/sandbox-libraries/jszip.min.js +13 -0
- package/dist/sandbox-libraries/mammoth.LICENSE +22 -0
- package/dist/sandbox-libraries/mammoth.browser.min.js +13 -0
- package/dist/sandbox-libraries/papaparse.LICENSE +20 -0
- package/dist/sandbox-libraries/papaparse.min.js +7 -0
- package/dist/sandbox-libraries/pptxgen.bundle.js +96 -0
- package/dist/sandbox-libraries/pptxgenjs.LICENSE +21 -0
- package/dist/sandbox-libraries/xlsx.LICENSE +201 -0
- package/dist/sandbox-libraries/xlsx.full.min.js +24 -0
- package/dist/web/assets/{AsyncBashCenterHost-HGsdxUJ3.js → AsyncBashCenterHost-D2Sy43Ub.js} +1 -1
- package/dist/web/assets/ConversationListItem-DvxCcAYm.js +3 -0
- package/dist/web/assets/ConversationsWorkbenchPanel-YeNq9LRn.js +1 -0
- package/dist/web/assets/DiscoverCenterHost-B6K-QnBF.js +1 -0
- package/dist/web/assets/{FileCenterHost-DigJOU5M.js → FileCenterHost-Dlk53K5G.js} +1 -1
- package/dist/web/assets/FilesWorkbenchPanel-PeCu12oU.js +12 -0
- package/dist/web/assets/{GitDiffCenterHost-IuZfF3hG.js → GitDiffCenterHost-3_Ea0RyG.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-CScC0CfH.js → GitWorkbenchPanel-CYvCkOAW.js} +1 -1
- package/dist/web/assets/{LaunchCenterHost-CIu7bcoZ.js → LaunchCenterHost-CP773N_3.js} +1 -1
- package/dist/web/assets/LaunchConfigurationNotice-CtmZ1uIQ.js +1 -0
- package/dist/web/assets/{LaunchesWorkbenchPanel-Vy0Gm7gg.js → LaunchesWorkbenchPanel-DP3yVfkO.js} +1 -1
- package/dist/web/assets/LogsCenterHost-BFP0doQf.js +1 -0
- package/dist/web/assets/{MermaidCenterHost-DDh4ArdK.js → MermaidCenterHost-Bjl6Dvrq.js} +1 -1
- package/dist/web/assets/MobileFilesBody-CDp21MGZ.js +1 -0
- package/dist/web/assets/{MobileFilesHost-C1jev2Un.js → MobileFilesHost-DlJI_yau.js} +1 -1
- package/dist/web/assets/MobileLaunchOutputHost-y3TehLWF.js +1 -0
- package/dist/web/assets/MobileLaunchesHost-CBNtDTrs.js +2 -0
- package/dist/web/assets/MobileLogsHost-BSb2lydK.js +1 -0
- package/dist/web/assets/MobileNoteEditorHost-7yW7hIC2.js +1 -0
- package/dist/web/assets/{MobileNotesHost-BZeYpK9H.js → MobileNotesHost-CvDHzpAh.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsHost-U3Mx3EN8.js → MobileProjectSettingsHost-CjtPfyKT.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsPageHost-CMvxbjfs.js → MobileProjectSettingsPageHost-j_7N-B9L.js} +1 -1
- package/dist/web/assets/{MobileSettingsHost-CP8Z_-gH.js → MobileSettingsHost-DXIKNF01.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageHost-BPjXKTMV.js → MobileSettingsPageHost-CEzo7J9p.js} +1 -1
- package/dist/web/assets/MobileSettingsPageScreen-99wMLRsn.js +1 -0
- package/dist/web/assets/NotesWorkbenchPanel-DqTwXBBv.js +1 -0
- package/dist/web/assets/ProjectSettingsCenterHost-D96cL0uH.js +1 -0
- package/dist/web/assets/{PullRequestCenterHost-CZhXfCX2.js → PullRequestCenterHost-DY0yPDK2.js} +1 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-D07LE8vJ.js +1 -0
- package/dist/web/assets/{SearchWorkbenchPanel-qLgszneN.js → SearchWorkbenchPanel-D2_3iXo8.js} +1 -1
- package/dist/web/assets/SettingsCenter-BQWc24di.js +1 -0
- package/dist/web/assets/SettingsCenterHost-BvgNfeZN.js +1 -0
- package/dist/web/assets/{SystemPromptCenterHost-ya5AvXsd.js → SystemPromptCenterHost-BLHkB7lp.js} +1 -1
- package/dist/web/assets/activity-notices-C9aphS1s.js +1 -0
- package/dist/web/assets/adapters-DNU88KT0.js +1 -0
- package/dist/web/assets/agent-profiles.svelte-DgI8wSS2.js +1 -0
- package/dist/web/assets/api-CHNbLvvY.js +1 -0
- package/dist/web/assets/center-tabs.svelte-CyhCD_6b.js +1 -0
- package/dist/web/assets/channel-6wGoOwGx.js +57 -0
- package/dist/web/assets/circle-question-mark-C7NgqbLL.js +1 -0
- package/dist/web/assets/code-DJR0pnqV.js +7 -0
- package/dist/web/assets/{confirm-dialog-Bw_IxcZD.js → confirm-dialog-BDjzMiC4.js} +1 -1
- package/dist/web/assets/{conversation-connection-3GxIuhbS.js → conversation-connection-mLNyfV2d.js} +1 -1
- package/dist/web/assets/dialog-CkRcLEJT.js +1 -0
- package/dist/web/assets/discover-Dh4m7djO.js +4 -0
- package/dist/web/assets/dist-DSApqEag.js +1 -0
- package/dist/web/assets/file-tabs.svelte-cX3MMyG6.js +2 -0
- package/dist/web/assets/filesystem-BbIXrkGB.js +1 -0
- package/dist/web/assets/{git-store.svelte-CM5k7yRU.js → git-store.svelte-D3uwRVnj.js} +1 -1
- package/dist/web/assets/{git.api-D2CfUXZW.js → git.api-CTu-tG8A.js} +1 -1
- package/dist/web/assets/index-BrxjAwg0.js +46 -0
- package/dist/web/assets/index-yEOHI1Z7.css +1 -0
- package/dist/web/assets/launches-CC4gLnSa.js +5 -0
- package/dist/web/assets/{launches.api-BZxyWF8t.js → launches.api-CaotSs6l.js} +1 -1
- package/dist/web/assets/launches.svelte-DDA5J-RZ.js +2 -0
- package/dist/web/assets/{message-square-CqLxHJuW.js → list-checks-zV9Dp7Cu.js} +1 -1
- package/dist/web/assets/{logs.api-Coi8HJuy.js → logs.api-DMmVlkSz.js} +1 -1
- package/dist/web/assets/{maintenance-state.svelte-CDO9i4dk.js → maintenance-state.svelte-l9v7Hg3i.js} +2 -2
- package/dist/web/assets/notify.svelte-BTEXJZ8P.js +1 -0
- package/dist/web/assets/popover-panel-C-weKOk3.js +5 -0
- package/dist/web/assets/pr-view-loader.svelte-C0NClMS6.js +1 -0
- package/dist/web/assets/progress-CKEsTSOk.js +1 -0
- package/dist/web/assets/scratch-notes-state.svelte-B_rY_-9q.js +1 -0
- package/dist/web/assets/{scratch-notes.api-Cbvag3bv.js → scratch-notes.api-B2gOOK6Z.js} +1 -1
- package/dist/web/assets/search-input-CEr0SmAB.js +1 -0
- package/dist/web/assets/settings-2-CWd8Y06n.js +1 -0
- package/dist/web/assets/settings-CRmC19nG.js +1 -0
- package/dist/web/assets/settings-CXoAzSmm.js +1 -0
- package/dist/web/assets/settings-actions.svelte-BB6u_lQ0.js +1 -0
- package/dist/web/assets/settings-page-controllers.svelte-al78EDTL.js +29 -0
- package/dist/web/assets/sheet-content-DauQ7hPL.js +1 -0
- package/dist/web/assets/shell-CYbWnH52.js +4 -0
- package/dist/web/assets/shell-layout.svelte-CmEWk428.js +2 -0
- package/dist/web/assets/textarea-BEZ65po_.js +1 -0
- package/dist/web/assets/views-BumCSQ3W.js +2 -0
- package/dist/web/assets/{workbench-connection-gGGv4o8i.js → workbench-connection-CGHdORw3.js} +1 -1
- package/dist/web/assets/{workspace-Cc47dGjw.js → workspace-CW738NJG.js} +1 -1
- package/dist/web/assets/{workspace-actions.svelte-B3oum_9S.js → workspace-actions.svelte-DL9xv7lJ.js} +1 -1
- package/dist/web/assets/workspace-selectors.svelte-BRJvPEBh.js +105 -0
- package/dist/web/index.html +142 -83
- package/dist/web/sw.js +1 -1
- package/dist/worker.js +14 -9
- package/package.json +8 -9
- package/dist/chunk-RUZ2UAYH.js +0 -365
- package/dist/guides/confluence/SKILL.md +0 -36
- package/dist/guides/jira/SKILL.md +0 -34
- package/dist/resize-worker.js +0 -168
- package/dist/web/assets/ConversationListItem-Caz2KiJH.js +0 -3
- package/dist/web/assets/ConversationsWorkbenchPanel-B6dzWkG1.js +0 -1
- package/dist/web/assets/DiscoverCenterHost-B186WBRA.js +0 -1
- package/dist/web/assets/FilesWorkbenchPanel-VPvx3Bmi.js +0 -12
- package/dist/web/assets/LaunchConfigurationNotice-5yb4cH27.js +0 -1
- package/dist/web/assets/LogsCenterHost-BXBozCYw.js +0 -1
- package/dist/web/assets/MobileFilesBody-Cda_7gDp.js +0 -1
- package/dist/web/assets/MobileLaunchOutputHost-Bsv12o2H.js +0 -1
- package/dist/web/assets/MobileLaunchesHost-C9VH-2bn.js +0 -2
- package/dist/web/assets/MobileLogsHost-BMDXc-WC.js +0 -1
- package/dist/web/assets/MobileNoteEditorHost-BA6WIY1Y.js +0 -1
- package/dist/web/assets/MobileSettingsPageScreen-C5rHdrUU.js +0 -1
- package/dist/web/assets/NotesWorkbenchPanel-Bf6rySTL.js +0 -1
- package/dist/web/assets/ProjectSettingsCenterHost-BVXpBixy.js +0 -1
- package/dist/web/assets/PullRequestsWorkbenchPanel-BBnZJVnI.js +0 -1
- package/dist/web/assets/SettingsCenter-7BfrBfiy.js +0 -1
- package/dist/web/assets/SettingsCenterHost-Ck5uHILP.js +0 -1
- package/dist/web/assets/adapters-DxJoo6Za.js +0 -1
- package/dist/web/assets/agent-profiles.svelte-D5YHPc90.js +0 -1
- package/dist/web/assets/api-eaGLre0q.js +0 -1
- package/dist/web/assets/center-tabs.svelte-JJGozG_H.js +0 -1
- package/dist/web/assets/channel-B503YLZR.js +0 -57
- package/dist/web/assets/chevron-left-DPEFG6UJ.js +0 -1
- package/dist/web/assets/circle-alert-Cp2l2jcj.js +0 -5
- package/dist/web/assets/clock-Db6f9HtS.js +0 -1
- package/dist/web/assets/code-BRQC0Tpn.js +0 -7
- package/dist/web/assets/dialog-DU4gXD1J.js +0 -1
- package/dist/web/assets/discover-B3I5g1_G.js +0 -4
- package/dist/web/assets/dist-B_NFPhKV.js +0 -1
- package/dist/web/assets/file-tabs.svelte-DKtVVVCq.js +0 -2
- package/dist/web/assets/filesystem-ReGivxAC.js +0 -1
- package/dist/web/assets/index-DIQuyMVT.css +0 -1
- package/dist/web/assets/index-FJEmK_L5.js +0 -48
- package/dist/web/assets/launches-DiAl56ED.js +0 -5
- package/dist/web/assets/launches.svelte-BVs1pAhl.js +0 -2
- package/dist/web/assets/notebook-pen-lVsLYSe4.js +0 -1
- package/dist/web/assets/notify.svelte-BKVBraTJ.js +0 -1
- package/dist/web/assets/pencil-BrlypebI.js +0 -1
- package/dist/web/assets/pr-view-loader.svelte-DcIwqDJV.js +0 -1
- package/dist/web/assets/progress-DBCSpVPn.js +0 -1
- package/dist/web/assets/scratch-notes-state.svelte-Br_WiMEp.js +0 -1
- package/dist/web/assets/search-input-zU4WCZiz.js +0 -1
- package/dist/web/assets/settings-2-8MSBUGAl.js +0 -1
- package/dist/web/assets/settings-9LBrw4Nv.js +0 -1
- package/dist/web/assets/settings-B7uXsflY.js +0 -1
- package/dist/web/assets/settings-actions.svelte-B8psX3cj.js +0 -1
- package/dist/web/assets/settings-page-controllers.svelte-CU0i08wo.js +0 -30
- package/dist/web/assets/shell-DB5Db5-E.js +0 -4
- package/dist/web/assets/shell-layout.svelte-BT2508sa.js +0 -2
- package/dist/web/assets/textarea-CeoFJ0-t.js +0 -1
- package/dist/web/assets/views-Z-n-GTYY.js +0 -2
- package/dist/web/assets/workspace-selectors.svelte-DLUlSgEE.js +0 -131
- /package/dist/{html-to-markdown.worker.js.LEGAL.txt → chunk-BUD4JHBZ.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-CKVFGRVV.js.LEGAL.txt → chunk-KEXKZKN4.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-TW6FURZ7.js.LEGAL.txt → chunk-SDDKYMIP.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var docx=(function(h){Object.defineProperty(h,Symbol.toStringTag,{value:"Module"});var Vu=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports);function Dt(e){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(e)}function ju(e,t){if(Dt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xu(e){var t=ju(e,"string");return Dt(t)=="symbol"?t:t+""}function v(e,t,r){return(t=Xu(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bt=class{constructor(e){v(this,"rootKey",void 0),this.rootKey=e}get writtenAs(){}},en=e=>e instanceof bt||typeof e=="object"&&e!==null&&typeof e.prepForXml=="function",Tt=e=>en(e)?e.rootKey:void 0,ga=Object.seal({}),b=class extends bt{constructor(e){super(e),v(this,"root",void 0),this.root=new Array}prepForXml(e){var t;e.stack.push(this);const r=this.root.flatMap(n=>{if(en(n)){const s=n.writtenAs;return s?s.map(a=>a.prepForXml(e)):n.prepForXml(e)}return n}).filter(n=>n!==void 0);return e.stack.pop(),{[this.rootKey]:r.length?r.length===1&&(!((t=r[0])===null||t===void 0)&&t._attr)?r[0]:r:ga}}addChildElement(e){return this.root.push(e),this}},$e=class extends b{constructor(e,t){super(e),v(this,"includeIfEmpty",void 0),this.includeIfEmpty=t}prepForXml(e){const t=super.prepForXml(e);return this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length)?t:void 0}};function ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ya(Object(r),!0).forEach(function(n){v(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ya(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _=class extends bt{constructor(e){super("_attr"),v(this,"root",void 0),v(this,"xmlKeys",void 0),this.root=e}prepForXml(e){const t={};return Object.entries(this.root).forEach(([r,n])=>{if(n!==void 0){const s=this.xmlKeys&&this.xmlKeys[r]||r;t[s]=n}}),{_attr:t}}},Mt=class extends bt{constructor(e){super("_attr"),v(this,"root",void 0),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:t})=>t!==void 0).reduce((t,{key:r,value:n})=>w(w({},t),{},{[r]:n}),{})}}},le=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}};function Ku(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Ft(e,t){if(e==null)return{};var r,n,s=Ku(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}var zu=["elements"],qu=new Map([["amp","&"],["lt","<"],["gt",">"],["quot",'"'],["apos","'"]]),Yu=/&([^;]*);?/g,ba=e=>e.indexOf("&")===-1?e:e.replace(Yu,(t,r)=>{if(!t.endsWith(";"))throw new Error(`Invalid XML: "&" that starts no entity, in "${e}"`);const n=qu.get(r);if(n!==void 0)return n;const s=/^#x[0-9a-f]+$/i.test(r)?parseInt(r.slice(2),16):/^#[0-9]+$/.test(r)?parseInt(r.slice(1),10):NaN;if(!(s>0&&s<=1114111))throw new Error(`Invalid XML: unknown entity "${t}"`);return String.fromCodePoint(s)}),cr=e=>e===" "||e===`
|
|
2
|
+
`||e===" "||e==="\r",Ju=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,Zu=e=>Object.fromEntries([...e.matchAll(Ju)].map(([,t,r,n])=>[t,r??n])),Et=(e,{keepWhitespaceText:t=!1}={})=>{const r={},n=[];let s=e.charCodeAt(0)===65279?1:0;for(;s<e.length&&cr(e[s]);)s++;const a=d=>{var m;const g=n.length===0?r:n[n.length-1];((m=g.elements)!==null&&m!==void 0?m:g.elements=[]).push(d)},i=d=>{if(d.trim()===""){d!==""&&t&&a({type:"text",text:d});return}if(n.length===0)throw new Error(`Invalid XML: text outside of the root element, "${d.trim()}"`);a({type:"text",text:ba(d)})},o=(d,m,g)=>{const p=e.indexOf(d,m);if(p===-1)throw new Error(`Invalid XML: ${g} that isn't closed`);return p};for(;s<e.length;){const d=e.indexOf("<",s);if(i(e.slice(s,d===-1?e.length:d)),d===-1)break;if(e.startsWith("<?",d)){const m=o("?>",d+2,"processing instruction"),g=e.slice(d+2,m),p=g.search(/\s/),f=p===-1?g:g.slice(0,p),y=p===-1?"":g.slice(p).trimStart();if(f.toLowerCase()==="xml"){const I=Zu(y);r.declaration=Object.keys(I).length>0?{attributes:I}:{}}else a({type:"instruction",name:f,instruction:y});s=m+2}else if(e.startsWith("<!--",d)){const m=o("-->",d+4,"comment"),g=e.slice(d+4,m);g!==""&&a({type:"comment",comment:g}),s=m+3}else if(e.startsWith("<![CDATA[",d)){const m=o("]]>",d+9,"CDATA section"),g=e.slice(d+9,m);g!==""&&a({type:"cdata",cdata:g}),s=m+3}else if(e.startsWith("<!DOCTYPE",d)){let m=d+9,g,p=!1;for(;m<e.length;m++){const f=e[m];if(g!==void 0)g=f===g?void 0:g;else if(f==='"'||f==="'")g=f;else if(f==="[")p=!0;else if(f==="]")p=!1;else if(f===">"&&!p)break}if(m===e.length)throw new Error("Invalid XML: DOCTYPE that isn't closed");a({type:"doctype",doctype:e.slice(d+9,m).replace(/^ /,"")}),s=m+1}else if(e.startsWith("</",d)){const m=o(">",d+2,"closing tag"),g=e.slice(d+2,m).trimEnd(),p=n.pop();if(p?.name!==g){var c;throw new Error(`Invalid XML: closing tag </${g}> doesn't match <${(c=p?.name)!==null&&c!==void 0?c:""}>`)}s=m+1}else s=Qu(e,d+1,(m,g)=>{a(m),g||n.push(m)})}if(n.length>0)throw new Error(`Invalid XML: <${n[n.length-1].name}> isn't closed`);const{elements:l}=r,u=Ft(r,zu);return l===void 0?u:w(w({},u),{},{elements:l})},Qu=(e,t,r)=>{let n=t;for(;n<e.length&&!cr(e[n])&&e[n]!=="/"&&e[n]!==">";)n++;const s=e.slice(t,n);if(s==="")throw new Error("Invalid XML: tag without a name");const a=[];let i=n;for(;;){for(;i<e.length&&cr(e[i]);)i++;if(i>=e.length)throw new Error(`Invalid XML: <${s}> that isn't closed`);if(e[i]===">"||e.startsWith("/>",i)){const m=e[i]==="/";return r(w({type:"element",name:s},a.length>0?{attributes:Object.fromEntries(a)}:{}),m),i+(m?2:1)}const o=e.indexOf("=",i),c=e.slice(i,o===-1?e.length:o).trimEnd();if(o===-1||c===""||/[\s/>]/.test(c))throw new Error(`Invalid XML: attribute of <${s}> without a value`);let l=o+1;for(;l<e.length&&cr(e[l]);)l++;const u=e[l];if(u!=='"'&&u!=="'")throw new Error(`Invalid XML: value of ${c} on <${s}> isn't quoted`);const d=e.indexOf(u,l+1);if(d===-1)throw new Error(`Invalid XML: value of ${c} on <${s}> isn't closed`);a.some(([m])=>m===c)||a.push([c,ba(e.slice(l+1,d))]),i=d+1}},Ta=new Map([["&","&"],['"',"""],["'","'"],["<","<"],[">",">"]]),ur=e=>e.replace(/[&"'<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var r;return(r=Ta.get(t))!==null&&r!==void 0?r:""}),ed=e=>e.replace(/[&<>\x00-\x08\x0B\x0C\x0E-\x1F]/g,t=>{var r;return(r=Ta.get(t))!==null&&r!==void 0?r:""}),tn=e=>typeof e=="string"?ur(e):e,Ea=(e,t,r)=>{const n=Object.keys(e)[0],s=n===void 0?void 0:e[n],a=[],i=[],o=c=>{for(const[l,u]of Object.entries(c))a.push(`${l}="${String(tn(u))}"`)};if(typeof s=="object"){if(s!==null){const{_attr:c,_cdata:l}=s;if(c&&o(c),l&&i.push(`<![CDATA[${l.replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`),Array.isArray(s)){let u=!1;i.push("");for(const d of s)typeof d=="object"?Object.keys(d)[0]==="_attr"?o(d._attr):i.push(Ea(d,t,r+1)):(i.pop(),u=!0,i.push(tn(d)));u||i.push("")}}}else i.push(tn(s));return{name:n,attributes:a,content:i,indents:r>1?t.repeat(r-1):""}},xa=(e,t,r)=>{if(typeof e!="object")return String(e);const{name:n,attributes:s,content:a,indents:i}=e,{length:o}=a,c=i+(n?`<${n}`:"")+(s.length>0?` ${s.join(" ")}`:"")+(o>0?n?">":"":"/>")+(t&&o>1?`
|
|
3
|
+
`:"");return o===0?c+(t?`
|
|
4
|
+
`:""):c+a.map(l=>l===void 0?"":xa(l,t,!1)).join("")+(o>1?i:"")+(n?`</${n}>`:"")+(t&&!r?`
|
|
5
|
+
`:"")},H=(e,{indent:t="",declaration:r}={})=>{const n=Array.isArray(e)?e:[e],s=t?1:0,a=r?.standalone?` standalone="${ur(r.standalone)}"`:"";return(r===void 0?"":`<?xml version="1.0" encoding="${ur(r.encoding||"UTF-8")}"${a}?>${t?`
|
|
6
|
+
`:""}`)+n.map((i,o)=>xa(Ea(i,t,s),t,o===n.length-1)).join("")},Sa=e=>Object.entries(e??{}).flatMap(([t,r])=>r==null?[]:[` ${t}="${ur(String(r))}"`]).join(""),Aa=e=>{switch(e.type){case"element":{var t,r;const n=(t=e.elements)!==null&&t!==void 0?t:[],s=`<${e.name}${Sa(e.attributes)}`;return n.length>0||((r=e.attributes)===null||r===void 0?void 0:r["xml:space"])==="preserve"?`${s}>${n.map(Aa).join("")}</${e.name}>`:`${s}/>`}case"text":return ed(String(e.text));case"cdata":return`<![CDATA[${String(e.cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")}]]>`;case"comment":return`<!--${e.comment}-->`;case"doctype":return`<!DOCTYPE ${e.doctype}>`;case"instruction":return`<?${e.name}${e.instruction?` ${e.instruction}`:""}?>`;default:return""}},td=e=>{var t;return(e.declaration?`<?xml${Sa(e.declaration.attributes)}?>`:"")+((t=e.elements)!==null&&t!==void 0?t:[]).map(Aa).join("")},dr=e=>{switch(e.type){case void 0:case"element":const t=new Ia(e.name,e.attributes),r=e.elements||[];for(const n of r){const s=dr(n);s!==void 0&&t.push(s)}return t;case"text":return e.text;default:return}},rd=class extends _{},Ia=class extends b{static fromXmlString(e){return dr(Et(e))}constructor(e,t){super(e),t&&this.root.push(new rd(t))}push(e){this.root.push(e)}get writtenAs(){return this.rootKey===void 0?this.root.filter(e=>typeof e!="string"):void 0}prepForXml(e){const t=this.writtenAs;return t?.length===1?t[0].prepForXml(e):super.prepForXml(e)}},Ca=class extends b{constructor(e){super(""),v(this,"_attr",void 0),this._attr=e}prepForXml(e){return{_attr:this._attr}}},rn=class extends b{constructor(e,t){super(e),t&&(this.root=t.root)}},G=e=>{if(!Number.isFinite(e))throw new Error(`Invalid value '${e}' specified. Must be an integer.`);return Math.floor(e)},$t=e=>{const t=G(e);if(t<0)throw new Error(`Invalid value '${e}' specified. Must be a positive integer.`);return t},hr=(e,t)=>{const r=t*2;if(e.length!==r||isNaN(+`0x${e}`))throw new Error(`Invalid hex value '${e}'. Expected ${r} digit hex value`);return e},nd=e=>hr(e,4),Na=e=>hr(e,2),nn=e=>hr(e,1),Ht=e=>{const t=e.slice(-2),r=e.substring(0,e.length-2);return`${Number(r)}${t}`},sd={in:1440,cm:1440/2.54,mm:1440/25.4,pt:20,pc:240,pi:240},Ye=e=>{if(typeof e=="number")return e;const t=e.slice(-2),r=Number(e.substring(0,e.length-2)),n=sd[t];if(n===void 0||Number.isNaN(r))throw new Error(`Invalid universal measure '${e}'. Expected a number followed by mm, cm, in, pt, pc or pi.`);return r*n},sn=e=>{const t=Ht(e);if(parseFloat(t)<0)throw new Error(`Invalid value '${t}' specified. Expected a positive number.`);return t},an=e=>e==="auto"?e:hr(e.charAt(0)==="#"?e.substring(1):e,3),Ne=e=>typeof e=="string"?Ht(e):G(e),Ra=e=>typeof e=="string"?sn(e):$t(e),ad=e=>typeof e=="string"?Ht(e):G(e),Q=e=>typeof e=="string"?sn(e):$t(e),ka=e=>{const t=e.substring(0,e.length-1);return`${Number(t)}%`},on=e=>typeof e=="number"?G(e):e.slice(-1)==="%"?ka(e):Ht(e),Pa=$t,Oa=$t,La=e=>e.toISOString(),R=class extends b{constructor(e,t=!0){super(e),t!==!0&&this.root.push(new le({val:t}))}},mr=class extends b{constructor(e,t){super(e),this.root.push(new le({val:Ra(t)}))}},ne=class extends b{},Re=class extends b{constructor(e,t){super(e),this.root.push(new le({val:t}))}},xt=(e,t)=>new T({name:e,attributes:{value:{key:"w:val",value:t}}}),St=class extends b{constructor(e,t){super(e),this.root.push(new le({val:t}))}},id=class extends b{constructor(e,t){super(e),this.root.push(new le({val:t}))}},st=class extends b{constructor(e,t){super(e),this.root.push(t)}},T=class extends b{constructor({name:e,attributes:t,children:r}){super(e),t&&this.root.push(new Mt(t)),r&&this.root.push(...r)}},ce={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},ln=e=>new T({name:"w:jc",attributes:{val:{key:"w:val",value:e}}}),cn={dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hyperlink:"hlink",followedHyperlink:"folHlink"},_a={dark2:"44546A",light2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hyperlink:"0563C1",followedHyperlink:"954F72"},Da={dark1:{value:"windowText",lastColor:"000000"},light1:{value:"window",lastColor:"FFFFFF"}},Ma=(e,t)=>{if(t==="auto")throw new Error(`Invalid theme color ${e} 'auto'. Expected 6 digit hex value`);return an(t)},un=(e={})=>Object.fromEntries(Object.keys(cn).map(t=>{const r=e[t],n=t==="dark1"||t==="light1"?Da[t].lastColor:_a[t];return[t,r===void 0?n:Ma(t,r)]})),od=(e,t)=>new T({name:"a:srgbClr",attributes:{value:{key:"val",value:Ma(e,t)}}}),ld=(e,t)=>{const r=t[e],n=e==="dark1"||e==="light1"?Da[e]:void 0;return new T({name:`a:${cn[e]}`,children:[r===void 0&&n?new T({name:"a:sysClr",attributes:{value:{key:"val",value:n.value},lastColor:{key:"lastClr",value:n.lastColor}}}):od(e,r??_a[e])]})},cd=(e,t={})=>new T({name:"a:clrScheme",attributes:{name:{key:"name",value:e}},children:Object.keys(cn).map(r=>ld(r,t))}),Fa=new Set(["dark1","light1","dark2","light2","accent1","accent2","accent3","accent4","accent5","accent6","hyperlink","followedHyperlink"]),ud=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["hlink","hyperlink"],["folHlink","followedHyperlink"],["text1","dark1"],["background1","light1"],["text2","dark2"],["background2","light2"]]),$a=(e,t)=>{if(!(e>=0&&e<=100))throw new Error(`Invalid ${t} ${e}. Expected a number from 0 to 100`);return Math.round(255*(1-e/100))},dd=({theme:e,lighter:t,darker:r})=>{if(!Fa.has(e)){const a=ud.get(e);throw new Error(`Invalid theme color "${e}". ${a?`Did you mean "${a}"?`:`Expected one of ${[...Fa].join(", ")}`}`)}if(t!==void 0&&r!==void 0)throw new Error("Invalid theme color. Expected lighter or darker, not both");const n=t===void 0?void 0:$a(t,"lighter"),s=r===void 0?void 0:$a(r,"darker");return{tint:n===255?void 0:n,shade:s===255?void 0:s}},hd=e=>{const[t,r,n]=[0,2,4].map(c=>parseInt(e.slice(c,c+2),16)/255),s=Math.max(t,r,n),a=Math.min(t,r,n),i=(s+a)/2,o=s-a;return o===0?{hue:0,saturation:0,lightness:i}:{hue:(s===t?((r-n)/o+6)%6:s===r?(n-t)/o+2:(t-r)/o+4)*60,saturation:o/(1-Math.abs(2*i-1)),lightness:i}},md=({hue:e,saturation:t,lightness:r})=>{const n=(1-Math.abs(2*r-1))*t,s=n*(1-Math.abs(e/60%2-1)),[a,i,o]=e<60?[n,s,0]:e<120?[s,n,0]:e<180?[0,n,s]:e<240?[0,s,n]:e<300?[s,0,n]:[n,0,s],c=r-n/2;return[a,i,o].map(l=>Math.floor((l+c)*255+1e-9).toString(16).padStart(2,"0")).join("").toUpperCase()},pd=(e,{tint:t,shade:r})=>{if(t===void 0&&r===void 0)return e;const n=hd(e),s=t===void 0?n.lightness*r/255:n.lightness*t/255+(1-t/255);return md(w(w({},n),{},{lightness:s}))},Ha=e=>e===void 0?void 0:e.toString(16).padStart(2,"0").toUpperCase(),vd=e=>typeof e=="string"?{type:"hex",value:an(e)}:{type:"theme",color:e,change:dd(e)},fd=(e,t)=>e.type==="hex"?{color:e.value}:{color:pd(t[e.color.theme],e.change),theme:e.color.theme,tint:Ha(e.change.tint),shade:Ha(e.change.shade)},wd=un(),dn=class extends bt{constructor(e){super("_attr"),v(this,"attributes",void 0),this.attributes=e.map(t=>"keys"in t?{keys:t.keys,color:t.color===void 0?void 0:vd(t.color)}:t)}prepForXml(e){var t,r;const n=(t=(r=e.file)===null||r===void 0||(r=r.Theme)===null||r===void 0?void 0:r.Colors)!==null&&t!==void 0?t:wd,s=this.attributes.flatMap(a=>{if(!("keys"in a))return[[a.key,a.value]];if(a.color===void 0)return[];const{keys:i}=a,o=fd(a.color,n);return[[i.color,o.color],[i.theme,o.theme],[i.tint,o.tint],[i.shade,o.shade]]});return{_attr:Object.fromEntries(s.filter(([,a])=>a!==void 0))}}},gd=class extends b{constructor(e,t){super(e),this.root.push(new dn(t))}},hn=(e,t)=>new gd(e,t),Bt={color:"w:color",theme:"w:themeColor",tint:"w:themeTint",shade:"w:themeShade"},ee=(e,{color:t,size:r,space:n,style:s})=>hn(e,[{key:"w:val",value:s},{keys:Bt,color:t},{key:"w:sz",value:r===void 0?void 0:Pa(r)},{key:"w:space",value:n===void 0?void 0:Oa(n)}]),pr={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},Ba=class extends $e{constructor(e){super("w:pBdr"),e.top&&this.root.push(ee("w:top",e.top)),e.left&&this.root.push(ee("w:left",e.left)),e.bottom&&this.root.push(ee("w:bottom",e.bottom)),e.right&&this.root.push(ee("w:right",e.right)),e.between&&this.root.push(ee("w:between",e.between))}},Wa=class extends b{constructor(){super("w:pBdr");const e=ee("w:bottom",{color:"auto",space:1,style:pr.SINGLE,size:6});this.root.push(e)}},Ua=({start:e,end:t,left:r,right:n,hanging:s,firstLine:a,firstLineChars:i})=>new T({name:"w:ind",attributes:{start:{key:"w:start",value:e===void 0?void 0:Ne(e)},end:{key:"w:end",value:t===void 0?void 0:Ne(t)},left:{key:"w:left",value:r===void 0?void 0:Ne(r)},right:{key:"w:right",value:n===void 0?void 0:Ne(n)},hanging:{key:"w:hanging",value:s===void 0?void 0:Q(s)},firstLine:{key:"w:firstLine",value:a===void 0?void 0:Q(a)},firstLineChars:{key:"w:firstLineChars",value:i===void 0?void 0:G(i)}}}),Ga=()=>new T({name:"w:br"}),vr={BEGIN:"begin",END:"end",SEPARATE:"separate"},mn=(e,t,r)=>new T({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:e},dirty:{key:"w:dirty",value:t},locked:{key:"w:fldLock",value:r}}}),Je=(e,t)=>mn(vr.BEGIN,e,t),Va=new WeakSet,yd=class extends T{constructor(){super({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:vr.BEGIN},dirty:{key:"w:dirty",value:!0}}})}prepForXml(e){const t=super.prepForXml(e);return Va.add(t),t}},pn=()=>new yd,bd=e=>typeof e=="object"&&e!==null&&Va.has(e),ke=e=>mn(vr.SEPARATE,e),xe=e=>mn(vr.END,e),Td={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},Ed={BOTTOM:"bottom",CENTER:"center",INSIDE:"inside",OUTSIDE:"outside",TOP:"top"},xd={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH_DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH_2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULL_STOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PAREN:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_TEN_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL_2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW_1:"hebrew1",HEBREW_2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},ve={DEFAULT:"default",PRESERVE:"preserve"},we=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{space:"xml:space"})}},Sd=class extends b{constructor(){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("PAGE")}},Ad=class extends b{constructor(){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("NUMPAGES")}},Id=class extends b{constructor(){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("SECTIONPAGES")}},Cd=class extends b{constructor(){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("SECTION")}},Wt=({fill:e,color:t,type:r})=>hn("w:shd",[{keys:{color:"w:fill",theme:"w:themeFill",tint:"w:themeFillTint",shade:"w:themeFillShade"},color:e},{keys:Bt,color:t},{key:"w:val",value:r??ja.CLEAR}]),ja={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},ge=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},Nd=class extends b{constructor(e){super("w:del"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},Rd=class extends b{constructor(e){super("w:ins"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},kd={NONE:"none",ROUND:"round",SQUARE:"square",ANGLE:"angle",CURLY:"curly"},Xa=({twoLinesInOne:e,brackets:t,horizontalInVertical:r,fitToLine:n,group:s})=>new T({name:"w:eastAsianLayout",attributes:{id:{key:"w:id",value:s===void 0?void 0:G(s)},combine:{key:"w:combine",value:e},combineBrackets:{key:"w:combineBrackets",value:t},vert:{key:"w:vert",value:r},vertCompress:{key:"w:vertCompress",value:n}}}),vn={DOT:"dot"},fn=(e=vn.DOT)=>new T({name:"w:em",attributes:{val:{key:"w:val",value:e}}}),Pd=()=>fn(vn.DOT),Od="57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9",Ld=(e,t=21)=>(r=t)=>{let n="",s=r|0;for(;s-- >0;)n+=e[Math.random()*e.length|0];return n},_d=(e=21)=>{let t="",r=e|0;for(;r-- >0;)t+=Od[Math.random()*64|0];return t},Ka=e=>{const t=new Int32Array(Math.ceil((e.length+9)/64)*16);for(let r=0;r<e.length;r++)t[r>>2]|=e[r]<<24-(r&3)*8;return t[e.length>>2]|=128<<24-(e.length&3)*8,t[t.length-2]=Math.floor(e.length/536870912),t[t.length-1]=e.length*8,t},za=e=>{const t=new Uint8Array(e.length*4);for(let r=0;r<t.length;r++)t[r]=e[r>>2]>>>24-(r&3)*8;return t},wn=(e,t)=>e<<t|e>>>32-t,He=(e,t)=>e>>>t|e<<32-t,Dd=[1732584193,4023233417,2562383102,271733878,3285377520],Md=Int32Array.of(1518500249,1859775393,2400959708,3395469782),Fd=new Int32Array(80),$d=e=>{const t=Ka(e),r=Fd;let[n,s,a,i,o]=Dd;for(let c=0;c<t.length;c+=16){r.set(t.subarray(c,c+16));for(let p=16;p<80;p++)r[p]=wn(r[p-3]^r[p-8]^r[p-14]^r[p-16],1);let[l,u,d,m,g]=[n,s,a,i,o];for(let p=0;p<80;p++){const f=p<20?u&d|~u&m:p>=40&&p<60?u&d|u&m|d&m:u^d^m,y=wn(l,5)+f+g+Md[Math.floor(p/20)]+r[p]|0;g=m,m=d,d=wn(u,30),u=l,l=y}[n,s,a,i,o]=[n+l|0,s+u|0,a+d|0,i+m|0,o+g|0]}return za([n,s,a,i,o])},Hd=Int32Array.of(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),Bd=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],Wd=new Int32Array(64),qa=e=>{const t=Ka(e),r=Wd;let[n,s,a,i,o,c,l,u]=Bd;for(let d=0;d<t.length;d+=16){r.set(t.subarray(d,d+16));for(let P=16;P<64;P++){const L=r[P-15],S=r[P-2];r[P]=r[P-16]+(He(L,7)^He(L,18)^L>>>3)+r[P-7]+(He(S,17)^He(S,19)^S>>>10)}let[m,g,p,f,y,I,C,E]=[n,s,a,i,o,c,l,u];for(let P=0;P<64;P++){const L=E+(He(y,6)^He(y,11)^He(y,25))+(y&I^~y&C)+Hd[P]+r[P]|0,S=(He(m,2)^He(m,13)^He(m,22))+(m&g^m&p^g&p)|0;E=C,C=I,I=y,y=f+L|0,f=p,p=g,g=m,m=L+S|0}[n,s,a,i,o,c,l,u]=[n+m|0,s+g|0,a+p|0,i+f|0,o+y|0,c+I|0,l+C|0,u+E|0]}return za([n,s,a,i,o,c,l,u])},Ud=e=>Math.floor(e/25.4*72*20),Se=e=>Math.floor(e*72*20),mt=(e=0)=>{let t=e;return()=>++t},Ya=()=>mt(),Ja=()=>mt(1),Za=()=>mt(),Qa=Za(),ei=()=>mt(),gn=ei(),Gd=mt(),ti=()=>-Gd(),Ze=()=>_d().toLowerCase(),yn=e=>Array.from($d(typeof e=="string"?Tn(e):ArrayBuffer.isView(e)?e:new Uint8Array(e)),t=>t.toString(16).padStart(2,"0")).join(""),Ut=e=>Ld("1234567890abcdef",e)(),bn=()=>`${Ut(8)}-${Ut(4)}-${Ut(4)}-${Ut(4)}-${Ut(12)}`,Tn=e=>new Uint8Array(new TextEncoder().encode(e)),ri=({width:e,group:t})=>new T({name:"w:fitText",attributes:{val:{key:"w:val",value:Math.round(Ye(Q(e)))},id:{key:"w:id",value:t===void 0?ti():G(t)}}}),Vd=class extends b{constructor(e){super("w:spacing"),this.root.push(new le({val:Ne(e)}))}},jd=class extends b{constructor(e){super("w:color"),this.root.push(new dn([{keys:w(w({},Bt),{},{color:"w:val"}),color:e}]))}},Xd=class extends b{constructor(e){super("w:highlight"),this.root.push(new le({val:e}))}},Kd=e=>new T({name:"w:lang",attributes:{value:{key:"w:val",value:e.value},eastAsia:{key:"w:eastAsia",value:e.eastAsia},bidirectional:{key:"w:bidi",value:e.bidirectional}}}),fr=(e,t)=>{if(typeof e=="string"){const n=e;return new T({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:n},cs:{key:"w:cs",value:n},eastAsia:{key:"w:eastAsia",value:n},hAnsi:{key:"w:hAnsi",value:n},hint:{key:"w:hint",value:t}}})}if("theme"in e){const n=e.theme==="headings"?"major":"minor";return new T({name:"w:rFonts",attributes:{ascii:{key:"w:asciiTheme",value:`${n}HAnsi`},eastAsia:{key:"w:eastAsiaTheme",value:`${n}EastAsia`},hAnsi:{key:"w:hAnsiTheme",value:`${n}HAnsi`},cs:{key:"w:cstheme",value:`${n}Bidi`}}})}const r=e;return new T({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:r.ascii},cs:{key:"w:cs",value:r.cs},eastAsia:{key:"w:eastAsia",value:r.eastAsia},hAnsi:{key:"w:hAnsi",value:r.hAnsi},hint:{key:"w:hint",value:r.hint}}})},ni=e=>new T({name:"w:vertAlign",attributes:{val:{key:"w:val",value:e}}}),zd=()=>ni("superscript"),qd=()=>ni("subscript"),En={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},si=(e=En.SINGLE,t)=>hn("w:u",[{key:"w:val",value:e},{keys:Bt,color:t}]),Yd={BLINK_BACKGROUND:"blinkBackground",LIGHTS:"lights",ANTS_BLACK:"antsBlack",ANTS_RED:"antsRed",SHIMMER:"shimmer",SPARKLE:"sparkle",NONE:"none"},Jd={BLACK:"black",BLUE:"blue",CYAN:"cyan",DARK_BLUE:"darkBlue",DARK_CYAN:"darkCyan",DARK_GRAY:"darkGray",DARK_GREEN:"darkGreen",DARK_MAGENTA:"darkMagenta",DARK_RED:"darkRed",DARK_YELLOW:"darkYellow",GREEN:"green",LIGHT_GRAY:"lightGray",MAGENTA:"magenta",NONE:"none",RED:"red",WHITE:"white",YELLOW:"yellow"},Be=class extends $e{constructor(e){if(super("w:rPr"),!e)return;if(e.style&&this.push(new Re("w:rStyle",e.style)),e.font&&(typeof e.font=="string"?this.push(fr(e.font)):"name"in e.font?this.push(fr(e.font.name,e.font.hint)):this.push(fr(e.font))),e.bold!==void 0&&this.push(new R("w:b",e.bold)),e.boldComplexScript===void 0&&e.bold!==void 0||e.boldComplexScript){var t;this.push(new R("w:bCs",(t=e.boldComplexScript)!==null&&t!==void 0?t:e.bold))}if(e.italics!==void 0&&this.push(new R("w:i",e.italics)),e.italicsComplexScript===void 0&&e.italics!==void 0||e.italicsComplexScript){var r;this.push(new R("w:iCs",(r=e.italicsComplexScript)!==null&&r!==void 0?r:e.italics))}e.smallCaps!==void 0?this.push(new R("w:smallCaps",e.smallCaps)):e.allCaps!==void 0&&this.push(new R("w:caps",e.allCaps)),e.strike!==void 0&&this.push(new R("w:strike",e.strike)),e.doubleStrike!==void 0&&this.push(new R("w:dstrike",e.doubleStrike)),e.emboss!==void 0&&this.push(new R("w:emboss",e.emboss)),e.imprint!==void 0&&this.push(new R("w:imprint",e.imprint)),e.noProof!==void 0&&this.push(new R("w:noProof",e.noProof)),e.snapToGrid!==void 0&&this.push(new R("w:snapToGrid",e.snapToGrid)),e.vanish!==void 0&&this.push(new R("w:vanish",e.vanish)),e.color&&this.push(new jd(e.color)),e.characterSpacing&&this.push(new Vd(e.characterSpacing)),e.scale!==void 0&&this.push(new St("w:w",e.scale)),e.kern&&this.push(new mr("w:kern",e.kern)),e.position&&this.push(new Re("w:position",e.position)),e.size!==void 0&&this.push(new mr("w:sz",e.size));const n=e.sizeComplexScript===void 0||e.sizeComplexScript===!0?e.size:e.sizeComplexScript;n&&this.push(new mr("w:szCs",n)),e.highlight&&this.push(new Xd(e.highlight)),e.underline&&this.push(si(e.underline.type,e.underline.color)),e.effect&&this.push(new Re("w:effect",e.effect)),e.border&&this.push(ee("w:bdr",e.border)),e.shading&&this.push(Wt(e.shading)),e.fitText&&this.push(ri(e.fitText)),e.subScript&&this.push(qd()),e.superScript&&this.push(zd()),e.rightToLeft!==void 0&&this.push(new R("w:rtl",e.rightToLeft)),e.emphasisMark&&this.push(fn(e.emphasisMark.type)),e.language&&this.push(Kd(e.language)),e.eastAsianLayout&&this.push(Xa(e.eastAsianLayout)),e.specVanish!==void 0&&this.push(new R("w:specVanish",e.specVanish)),e.math!==void 0&&this.push(new R("w:oMath",e.math)),e.revision&&this.push(new ii(e.revision))}push(e){this.root.push(e)}},ai=class extends Be{constructor(e){super(e),e?.insertion&&this.push(new Rd(e.insertion)),e?.deletion&&this.push(new Nd(e.deletion))}},ii=class extends b{constructor(e){super("w:rPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.addChildElement(new Be(e))}},Gt=class extends b{constructor(e){if(super("w:t"),typeof e=="string")this.root.push(new we({space:ve.PRESERVE})),this.root.push(e);else{var t;this.root.push(new we({space:(t=e.space)!==null&&t!==void 0?t:ve.DEFAULT})),this.root.push(e.text)}}},at={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},Zd=e=>{switch(e){case at.CURRENT:return[Je(),new Sd,ke(),xe()];case at.TOTAL_PAGES:return[Je(),new Ad,ke(),xe()];case at.TOTAL_PAGES_IN_SECTION:return[Je(),new Id,ke(),xe()];case at.CURRENT_SECTION:return[Je(),new Cd,ke(),xe()];default:return}},te=class fa extends b{constructor(t){if(super("w:r"),v(this,"properties",void 0),v(this,"following",[]),this.properties=new Be(t),this.root.push(this.properties),t.break)for(let r=0;r<t.break;r++)this.root.push(Ga());if(t.children)for(const[r,n]of t.children.entries()){if(Tt(n)==="w:r"){const s=t.children.slice(r+1);this.following=[n,...s.length>0?[new fa(w(w({},t),{},{break:void 0,children:s}))]:[]];break}if(typeof n=="string"){const s=Zd(n);if(s){const a=t.children.slice(r+1),i=l=>new fa(w(w({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(s[0]);const c=o?s.slice(1):s;this.following=[...c.map(l=>i([l])),...a.length>0?[i(a)]:[]];break}this.root.push(new Gt(n));continue}this.root.push(n)}else t.text!==void 0&&this.root.push(new Gt(t.text))}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var r;return(r=t.writtenAs)!==null&&r!==void 0?r:t})]:void 0}},We=class extends te{constructor(e){super(typeof e=="string"?{text:e}:e)}},Qd=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{char:"w:char",symbolfont:"w:font"})}},oi=class extends b{constructor(e="",t="Wingdings"){super("w:sym"),this.root.push(new Qd({char:e,symbolfont:t}))}},li=class extends te{constructor(e){super(typeof e=="string"?{}:e),this.root.push(typeof e=="string"?new oi(e):new oi(e.char,e.symbolfont))}},eh=e=>{const t=e.indexOf(";base64,"),r=t===-1?0:t+8;return new Uint8Array(atob(e.substring(r)).split("").map(n=>n.charCodeAt(0)))},wr=e=>typeof e=="string"?eh(e):e,th=[["png",[137,80,78,71,13,10,26,10]],["jpg",[255,216,255]],["gif",[71,73,70,56,55,97]],["gif",[71,73,70,56,57,97]],["bmp",[66,77]]],ci=({type:e,data:t},r)=>{if(e!==void 0)return e;const n=wr(t),s=ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n),a=th.find(([,i])=>i.every((o,c)=>s[c]===o));if(a===void 0)throw new Error(`${r}: type isn't given, and data isn't a PNG, JPEG, GIF or BMP file to read it from. Give its type`);return a[0]},ui={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},di={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"},hi=()=>new T({name:"wp:simplePos",attributes:{x:{key:"x",value:0},y:{key:"y",value:0}}}),mi=e=>new T({name:"wp:align",children:[e]}),pi=e=>new T({name:"wp:posOffset",children:[e.toString()]}),vi=({relative:e,align:t,offset:r})=>new T({name:"wp:positionH",attributes:{relativeFrom:{key:"relativeFrom",value:e??ui.PAGE}},children:[(()=>{if(t)return mi(t);if(r!==void 0)return pi(r);throw new Error("There is no configuration provided for floating position (Align or offset)")})()]}),fi=({relative:e,align:t,offset:r})=>new T({name:"wp:positionV",attributes:{relativeFrom:{key:"relativeFrom",value:e??di.PAGE}},children:[(()=>{if(t)return mi(t);if(r!==void 0)return pi(r);throw new Error("There is no configuration provided for floating position (Align or offset)")})()]}),rh=(function(e){return e.CENTER="ctr",e.TOP="t",e.BOTTOM="b",e})({}),wi=(e={})=>{var t,r,n,s;return new T({name:"wps:bodyPr",attributes:{lIns:{key:"lIns",value:(t=e.margins)===null||t===void 0?void 0:t.left},rIns:{key:"rIns",value:(r=e.margins)===null||r===void 0?void 0:r.right},tIns:{key:"tIns",value:(n=e.margins)===null||n===void 0?void 0:n.top},bIns:{key:"bIns",value:(s=e.margins)===null||s===void 0?void 0:s.bottom},anchor:{key:"anchor",value:e.verticalAnchor}},children:[...e.noAutoFit?[new R("a:noAutofit",e.noAutoFit)]:[]]})},nh=(e={txBox:"1"})=>new T({name:"wps:cNvSpPr",attributes:{txBox:{key:"txBox",value:e.txBox}}}),sh=e=>new T({name:"w:txbxContent",children:[...e]}),ah=e=>new T({name:"wps:txbx",children:[sh(e)]}),ih=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{cx:"cx",cy:"cy"})}},gi=class extends b{constructor(e,t){super("a:ext"),v(this,"attributes",void 0),this.attributes=new ih({cx:e,cy:t}),this.root.push(this.attributes)}},oh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{x:"x",y:"y"})}},yi=class extends b{constructor(e,t){super("a:off"),this.root.push(new oh({x:e??0,y:t??0}))}},lh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}},ch=class extends b{constructor(e){var t,r,n,s;super("a:xfrm"),v(this,"extents",void 0),v(this,"offset",void 0),this.root.push(new lh({flipVertical:(t=e.flip)===null||t===void 0?void 0:t.vertical,flipHorizontal:(r=e.flip)===null||r===void 0?void 0:r.horizontal,rotation:e.rotation})),this.offset=new yi((n=e.offset)===null||n===void 0||(n=n.emus)===null||n===void 0?void 0:n.x,(s=e.offset)===null||s===void 0||(s=s.emus)===null||s===void 0?void 0:s.y),this.extents=new gi(e.emus.x,e.emus.y),this.root.push(this.offset),this.root.push(this.extents)}},bi=()=>new T({name:"a:noFill"}),uh=e=>new T({name:"a:srgbClr",attributes:{value:{key:"val",value:e.value}}}),dh={BG1:"bg1",TX1:"tx1",BG2:"bg2",TX2:"tx2",ACCENT1:"accent1",ACCENT2:"accent2",ACCENT3:"accent3",ACCENT4:"accent4",ACCENT5:"accent5",ACCENT6:"accent6",HLINK:"hlink",FOLHLINK:"folHlink",DK1:"dk1",LT1:"lt1",DK2:"dk2",LT2:"lt2",PHCLR:"phClr"},hh=e=>new T({name:"a:schemeClr",attributes:{value:{key:"val",value:e.value}}}),xn=e=>new T({name:"a:solidFill",children:[e.type==="rgb"?uh(e):hh(e)]}),mh={ROUND:"rnd",SQUARE:"sq",FLAT:"flat"},ph={SINGLE:"sng",DOUBLE:"dbl",THICK_THIN:"thickThin",THIN_THICK:"thinThick",TRI:"tri"},vh={CENTER:"ctr",INSET:"in"},fh=e=>new T({name:"a:ln",attributes:{width:{key:"w",value:e.width},cap:{key:"cap",value:e.cap===void 0?void 0:mh[e.cap]},compoundLine:{key:"cmpd",value:e.compoundLine===void 0?void 0:ph[e.compoundLine]},align:{key:"algn",value:e.align===void 0?void 0:vh[e.align]}},children:[e.type==="noFill"?bi():e.solidFillType==="rgb"?xn({type:"rgb",value:e.value}):xn({type:"scheme",value:e.value})]}),wh=class extends b{constructor(){super("a:avLst")}},gh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{prst:"prst"})}},yh=class extends b{constructor(){super("a:prstGeom"),this.root.push(new gh({prst:"rect"})),this.root.push(new wh)}},bh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{bwMode:"bwMode"})}},Ti=class extends b{constructor({element:e,outline:t,solidFill:r,transform:n}){super(`${e}:spPr`),v(this,"form",void 0),this.root.push(new bh({bwMode:"auto"})),this.form=new ch(n),this.root.push(this.form),this.root.push(new yh),r?this.root.push(xn(r)):t&&this.root.push(bi()),t&&this.root.push(fh(t))}},Ei=e=>new T({name:"wps:wsp",children:[nh(e.nonVisualProperties),new Ti({element:"wps",transform:e.transformation,outline:e.outline,solidFill:e.solidFill}),ah(e.children),wi(e.bodyProperties)]}),gr=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{uri:"uri"})}},Th=e=>new T({name:"asvg:svgBlip",attributes:{asvg:{key:"xmlns:asvg",value:"http://schemas.microsoft.com/office/drawing/2016/SVG/main"},embed:{key:"r:embed",value:`rId{${e.fileName}}`}}}),Eh=e=>new T({name:"a:ext",attributes:{uri:{key:"uri",value:"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"}},children:[Th(e)]}),xh=e=>new T({name:"a:extLst",children:[Eh(e)]}),Sh=e=>new T({name:"a:blip",attributes:{embed:{key:"r:embed",value:`rId{${e.type==="svg"?e.fallback.fileName:e.fileName}}`},cstate:{key:"cstate",value:"none"}},children:e.type==="svg"?[xh(e)]:[]}),Ah=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{left:"l",top:"t",right:"r",bottom:"b"})}},yr=(e,t)=>{if(e!==void 0){if(!(e>=0&&e<=100))throw new Error(`Invalid crop ${t} ${e}. Expected a number from 0 to 100`);return Math.round(e*1e3)}},Ih=class extends b{constructor(e){super("a:srcRect"),e&&this.root.push(new Ah({left:yr(e.left,"left"),top:yr(e.top,"top"),right:yr(e.right,"right"),bottom:yr(e.bottom,"bottom")}))}},Ch=class extends b{constructor(){super("a:fillRect")}},Nh=class extends b{constructor(){super("a:stretch"),this.root.push(new Ch)}},Rh=class extends b{constructor(e,t){super("pic:blipFill"),this.root.push(Sh(e)),this.root.push(new Ih(t)),this.root.push(new Nh)}},kh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}},Ph=class extends b{constructor(){super("a:picLocks"),this.root.push(new kh({noChangeAspect:1,noChangeArrowheads:1}))}},Oh=class extends b{constructor(){super("pic:cNvPicPr"),this.root.push(new Ph)}},Lh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}},_h=class extends b{constructor(){super("pic:cNvPr"),this.root.push(new Lh({id:0,name:"",descr:""}))}prepForXml(e){for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof Nt){this.root.push(n.createDrawingClick(e,!1));break}}const t=super.prepForXml(e);return this.root.splice(1),t}},Dh=class extends b{constructor(){super("pic:nvPicPr"),this.root.push(new _h),this.root.push(new Oh)}},Mh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns:pic"})}},xi=class extends b{constructor({mediaData:e,transform:t,outline:r,solidFill:n,crop:s}){super("pic:pic"),this.root.push(new Mh({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new Dh),this.root.push(new Rh(e,s)),this.root.push(new Ti({element:"pic",transform:t,outline:r,solidFill:n}))}},Fh=e=>{var t,r,n,s;return new T({name:"a:xfrm",attributes:{flipVertical:{key:"flipV",value:(t=e.flip)===null||t===void 0?void 0:t.vertical},flipHorizontal:{key:"flipH",value:(r=e.flip)===null||r===void 0?void 0:r.horizontal},rotation:{key:"rot",value:e.rotation}},children:[new yi((n=e.offset)===null||n===void 0||(n=n.emus)===null||n===void 0?void 0:n.x,(s=e.offset)===null||s===void 0||(s=s.emus)===null||s===void 0?void 0:s.y),new gi(e.emus.x,e.emus.y),new T({name:"a:chOff",attributes:{x:{key:"x",value:0},y:{key:"y",value:0}}}),new T({name:"a:chExt",attributes:{x:{key:"cx",value:e.emus.x},y:{key:"cy",value:e.emus.y}}})]})},$h=()=>new T({name:"wpg:cNvGrpSpPr"}),Hh=e=>new T({name:"wpg:wgp",children:[$h(),new T({name:"wpg:grpSpPr",children:[Fh(e.transformation)]}),...e.children]}),Bh=class extends b{constructor({mediaData:e,transform:t,outline:r,solidFill:n,crop:s}){if(super("a:graphicData"),e.type==="graphic")this.root.push(new gr({uri:e.uri})),this.root.push(e.content);else if(e.type==="wps"){this.root.push(new gr({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));const a=Ei(w(w({},e.data),{},{transformation:t,outline:r,solidFill:n}));this.root.push(a)}else if(e.type==="wpg"){this.root.push(new gr({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"}));const a=Hh({children:e.children.map(i=>i.type==="wps"?Ei(w(w({},i.data),{},{transformation:i.transformation,outline:i.outline,solidFill:i.solidFill})):new xi({mediaData:i,transform:i.transformation,outline:i.outline,solidFill:i.solidFill})),transformation:t});this.root.push(a)}else{this.root.push(new gr({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"}));const a=new xi({mediaData:e,transform:t,outline:r,solidFill:n,crop:s});this.root.push(a)}}},Wh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{a:"xmlns:a"})}},Si=class extends b{constructor({mediaData:e,transform:t,outline:r,solidFill:n,crop:s}){super("a:graphic"),v(this,"data",void 0),this.root.push(new Wh({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new Bh({mediaData:e,transform:t,outline:r,solidFill:n,crop:s}),this.root.push(this.data)}},At={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3,THROUGH:4},Sn={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"},An=()=>new T({name:"wp:wrapNone"}),Ai=(e,t={top:0,bottom:0,left:0,right:0})=>new T({name:"wp:wrapSquare",attributes:{wrapText:{key:"wrapText",value:e.side||Sn.BOTH_SIDES},distT:{key:"distT",value:t.top},distB:{key:"distB",value:t.bottom},distL:{key:"distL",value:t.left},distR:{key:"distR",value:t.right}}}),br=21600,Vt=(e,{x:t,y:r})=>new T({name:e,attributes:{x:{key:"x",value:t},y:{key:"y",value:r}}}),Uh=()=>new T({name:"wp:wrapPolygon",attributes:{edited:{key:"edited",value:!1}},children:[Vt("wp:start",{x:0,y:0}),Vt("wp:lineTo",{x:0,y:br}),Vt("wp:lineTo",{x:br,y:br}),Vt("wp:lineTo",{x:br,y:0}),Vt("wp:lineTo",{x:0,y:0})]}),Ii=(e,t={},r)=>{var n;return new T({name:e,attributes:{wrapText:{key:"wrapText",value:(n=r?.side)!==null&&n!==void 0?n:Sn.BOTH_SIDES},distL:{key:"distL",value:t.left},distR:{key:"distR",value:t.right}},children:[Uh()]})},Ci=(e,t)=>Ii("wp:wrapTight",e,t),Ni=(e,t)=>Ii("wp:wrapThrough",e,t),Ri=(e={top:0,bottom:0})=>new T({name:"wp:wrapTopAndBottom",attributes:{distT:{key:"distT",value:e.top},distB:{key:"distB",value:e.bottom}}}),In={EXTERNAL:"External"},Gh=(e,t,r,n)=>new T({name:"Relationship",attributes:{id:{key:"Id",value:e},type:{key:"Type",value:t},target:{key:"Target",value:r},targetMode:{key:"TargetMode",value:n}}}),ki=(e,t)=>new T({name:"a:hlinkClick",attributes:w(w({},t?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${e}`}})}),Vh="{C183D7F6-B498-43B3-948B-1728B52AA6E4}",Pi=e=>new T({name:"a:extLst",attributes:{namespace:{key:"xmlns:a",value:e?"http://schemas.openxmlformats.org/drawingml/2006/main":void 0}},children:[new T({name:"a:ext",attributes:{uri:{key:"uri",value:Vh}},children:[new T({name:"adec:decorative",attributes:{namespace:{key:"xmlns:adec",value:"http://schemas.microsoft.com/office/drawing/2017/decorative"},value:{key:"val",value:1}}})]})]}),Cn=class{constructor(e){v(this,"link",void 0),v(this,"linkId",Ze()),v(this,"addedTo",new WeakSet),this.link=e}createClick(e){return ki(this.linkId,e)}addRelationship(e){const t=e.viewWrapper.Relationships;this.addedTo.has(t)||(this.addedTo.add(t),t.addRelationship(this.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",this.link,In.EXTERNAL))}},jh=class extends b{constructor(e,{id:t,name:r,description:n,title:s,link:a,decorative:i}){super(e),v(this,"link",void 0),this.link=a===void 0?void 0:new Cn(a),this.root.push(new Mt({id:{key:"id",value:t},name:{key:"name",value:r},description:{key:"descr",value:n},title:{key:"title",value:s}})),this.link&&this.root.push(this.link.createClick(!1)),i&&this.root.push(Pi(!1))}prepForXml(e){var t;return(t=this.link)===null||t===void 0||t.addRelationship(e),super.prepForXml(e)}},Oi=class extends b{constructor({name:e="",description:t,title:r,id:n}={},{link:s,decorative:a}={}){super("wp:docPr"),v(this,"link",void 0),v(this,"decorative",void 0);const i={id:{key:"id",value:n??Qa()},name:{key:"name",value:e}};t&&(i.description={key:"descr",value:t}),r&&(i.title={key:"title",value:r}),this.root.push(new Mt(i)),this.link=s===void 0?void 0:new Cn(s),this.decorative=a}prepForXml(e){if(this.link)this.link.addRelationship(e),this.root.push(this.link.createClick(!0));else for(let r=e.stack.length-1;r>=0;r--){const n=e.stack[r];if(n instanceof Nt){this.root.push(n.createDrawingClick(e,!0));break}}this.decorative&&this.root.push(Pi(!0));const t=super.prepForXml(e);return this.root.splice(1),t}},Li=({top:e,right:t,bottom:r,left:n})=>new T({name:"wp:effectExtent",attributes:{top:{key:"t",value:e},right:{key:"r",value:t},bottom:{key:"b",value:r},left:{key:"l",value:n}}}),Nn=2147483647,_i=9525,Di=(e,t)=>{if(t!==void 0&&t>Nn)throw new Error(`Invalid drawing ${e} ${t} EMUs (${Math.round(t/_i)} pixels). Word won't open a drawing with a ${e} over ${Nn} EMUs (${Math.floor(Nn/_i)} pixels). Sizes such as an ImageRun's transformation are in pixels, not EMUs`);return t},Mi=({x:e,y:t})=>new T({name:"wp:extent",attributes:{x:{key:"cx",value:Di("width",e)},y:{key:"cy",value:Di("height",t)}}}),Xh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}},Kh=class extends b{constructor(){super("a:graphicFrameLocks"),this.root.push(new Xh({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}},Fi=(e=!0)=>new T({name:"wp:cNvGraphicFramePr",children:e?[new Kh]:[]}),zh=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}},qh=class extends b{constructor({mediaData:e,transform:t,drawingOptions:r}){var n;super("wp:anchor");const s=w({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},r.floating);if(this.root.push(new zh({distT:s.margins&&s.margins.top||0,distB:s.margins&&s.margins.bottom||0,distL:s.margins&&s.margins.left||0,distR:s.margins&&s.margins.right||0,simplePos:"0",allowOverlap:s.allowOverlap===!0?"1":"0",behindDoc:s.behindDocument===!0?"1":"0",locked:s.lockAnchor===!0?"1":"0",layoutInCell:s.layoutInCell===!0?"1":"0",relativeHeight:s.zIndex?s.zIndex:t.emus.y})),this.root.push(hi()),this.root.push(vi(s.horizontalPosition)),this.root.push(fi(s.verticalPosition)),this.root.push(Mi({x:t.emus.x,y:t.emus.y})),this.root.push(Li((n=r.effectExtent)!==null&&n!==void 0?n:{top:0,right:0,bottom:0,left:0})),r.floating!==void 0&&r.floating.wrap!==void 0)switch(r.floating.wrap.type){case At.SQUARE:this.root.push(Ai(r.floating.wrap,r.floating.margins));break;case At.TIGHT:this.root.push(Ci(r.floating.margins,r.floating.wrap));break;case At.THROUGH:this.root.push(Ni(r.floating.margins,r.floating.wrap));break;case At.TOP_AND_BOTTOM:this.root.push(Ri(r.floating.margins));break;case At.NONE:default:this.root.push(An())}else this.root.push(An());this.root.push(new Oi(r.docProperties,{link:r.link,decorative:r.decorative})),this.root.push(Fi(e.type!=="graphic"||e.lockAspectRatio!==!1)),this.root.push(new Si({mediaData:e,transform:t,outline:r.outline,solidFill:r.solidFill,crop:r.crop}))}},Yh=({mediaData:e,transform:t,docProperties:r,outline:n,solidFill:s,crop:a,effectExtent:i,link:o,decorative:c})=>{var l,u,d,m;return new T({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[Mi({x:t.emus.x,y:t.emus.y}),Li(i??(n?{top:((l=n.width)!==null&&l!==void 0?l:9525)*2,right:((u=n.width)!==null&&u!==void 0?u:9525)*2,bottom:((d=n.width)!==null&&d!==void 0?d:9525)*2,left:((m=n.width)!==null&&m!==void 0?m:9525)*2}:{top:0,right:0,bottom:0,left:0})),new Oi(r,{link:o,decorative:c}),Fi(e.type!=="graphic"||e.lockAspectRatio!==!1),new Si({mediaData:e,transform:t,outline:n,solidFill:s,crop:a})]})},Tr=class extends b{constructor(e,t={}){super("w:drawing"),t.floating?this.root.push(new qh({mediaData:e,transform:e.transformation,drawingOptions:t})):this.root.push(Yh({mediaData:e,transform:e.transformation,docProperties:t.docProperties,outline:t.outline,solidFill:t.solidFill,crop:t.crop,effectExtent:t.effectExtent,link:t.link,decorative:t.decorative}))}},$i=(e,t)=>({data:wr(e.data),fileName:t,transformation:{pixels:{x:Math.round(e.transformation.width),y:Math.round(e.transformation.height)},emus:{x:Math.round(e.transformation.width*9525),y:Math.round(e.transformation.height*9525)},flip:e.transformation.flip,rotation:e.transformation.rotation?e.transformation.rotation*6e4:void 0}}),Hi=(e,t,r)=>{const n=ci(e,r);return w({type:n},$i(w(w({},e),{},{transformation:t}),`${yn(e.data)}.${n}`))},Jh=({id:e,author:t,date:r},n)=>new T({name:"w:del",attributes:{id:{key:"w:id",value:e},author:{key:"w:author",value:t},date:{key:"w:date",value:r}},children:[n]}),Zh=class extends b{constructor(e){var t;const r=e.type==="svg"?w(w({type:e.type},$i(e,`${yn(e.data)}.svg`)),{},{fallback:Hi(e.fallback,e.transformation,"ImageRun fallback")}):Hi(e,e.transformation,"ImageRun"),n=new Tr(r,{floating:e.floating,docProperties:e.altText,outline:e.outline,solidFill:e.solidFill,crop:e.crop,link:e.link,decorative:e.decorative}),s=new Be(e.run),a=(t=e.insertion)!==null&&t!==void 0?t:e.deletion,i=e.insertion?"w:ins":e.deletion?"w:del":"w:r";if(super(i),v(this,"imageData",void 0),a){this.root.push(new ge({id:a.id,author:a.author,date:a.date}));const o=new T({name:"w:r",children:[s,n]});this.addChildElement(e.insertion&&e.deletion?Jh(e.deletion,o):o)}else this.root.push(s),this.root.push(n);this.imageData=r}prepForXml(e){return e.file.Media.addImage(this.imageData.fileName,this.imageData),this.imageData.type==="svg"&&e.file.Media.addImage(this.imageData.fallback.fileName,this.imageData.fallback),super.prepForXml(e)}},Rn=e=>{var t,r,n,s,a,i,o,c;return{offset:{pixels:{x:Math.round((t=(r=e.offset)===null||r===void 0?void 0:r.left)!==null&&t!==void 0?t:0),y:Math.round((n=(s=e.offset)===null||s===void 0?void 0:s.top)!==null&&n!==void 0?n:0)},emus:{x:Math.round(((a=(i=e.offset)===null||i===void 0?void 0:i.left)!==null&&a!==void 0?a:0)*9525),y:Math.round(((o=(c=e.offset)===null||c===void 0?void 0:c.top)!==null&&o!==void 0?o:0)*9525)}},pixels:{x:Math.round(e.width),y:Math.round(e.height)},emus:{x:Math.round(e.width*9525),y:Math.round(e.height*9525)},flip:e.flip,rotation:e.rotation?e.rotation*6e4:void 0}},Qh=class extends te{constructor(e){super({}),v(this,"wpsShapeData",void 0),this.wpsShapeData={type:e.type,transformation:Rn(e.transformation),data:w({},e)};const t=new Tr(this.wpsShapeData,{floating:e.floating,docProperties:e.altText,outline:e.outline,solidFill:e.solidFill});this.root.push(t)}},em=class extends te{constructor(e){super({}),v(this,"wpgGroupData",void 0),v(this,"mediaDatas",void 0),this.wpgGroupData={type:e.type,transformation:Rn(e.transformation),children:e.children};const t=new Tr(this.wpgGroupData,{floating:e.floating,docProperties:e.altText});this.mediaDatas=e.children.filter(r=>r.type!=="wps").map(r=>r),this.root.push(t)}prepForXml(e){return this.mediaDatas.forEach(t=>{e.file.Media.addImage(t.fileName,t),t.type==="svg"&&e.file.Media.addImage(t.fallback.fileName,t.fallback)}),super.prepForXml(e)}},tm=class extends b{constructor(e){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push(`SEQ ${e}`)}},rm=class extends te{constructor(e){super({}),this.root.push(pn()),this.root.push(new tm(e)),this.root.push(ke()),this.root.push(xe())}},nm=/^\s*(?:XE|TC|TA|RD|PRIVATE)\b/i,sm=class extends b{constructor(e){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push(e)}},am=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{instr:"w:instr",fldLock:"w:fldLock"})}},kn=class extends b{constructor(e,t,r={}){const n=nm.test(e);if(super(n?"w:r":"w:fldSimple"),n){this.root.push(Je(void 0,r.locked?!0:void 0)),this.root.push(new sm(e)),this.root.push(xe());return}this.root.push(new am({instr:e,fldLock:r.locked?!0:void 0})),t!==void 0&&this.root.push(new We(t))}},im=class extends kn{constructor(e){super(` MERGEFIELD ${e} `,`\xAB${e}\xBB`)}},om=32767,lm=780,cm=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],um=e=>e<=om?cm.reduce(({rest:t,text:r},[n,s])=>({rest:t%n,text:r+s.repeat(Math.floor(t/n))}),{rest:e,text:""}).text:void 0,dm=e=>e===0?"":e<=lm?String.fromCharCode(65+(e-1)%26).repeat(Math.ceil(e/26)):void 0,hm=e=>{var t;return`${e}${e%100>=11&&e%100<=13?"th":(t=["th","st","nd","rd"][e%10])!==null&&t!==void 0?t:"th"}`},Pn=e=>{const t=e.charAt(0)!==e.charAt(0).toUpperCase(),r=n=>s=>{var a;return t?(a=n(s))===null||a===void 0?void 0:a.toLowerCase():n(s)};switch(e.toLowerCase()){case"arabic":return String;case"roman":return r(um);case"alphabetic":return r(dm);case"ordinal":return n=>n>0?hm(n):void 0;case"arabicdash":return n=>`- ${n} -`;default:return}},Bi=new Set(["mergeformat","charformat","mergeformatinet"]),Wi=new Set(["upper","lower","firstcap","caps"]),mm=e=>/^[#0,]*[#0][#0,]*$/.test(e),pm=(e,t)=>{const r=[...t].filter(a=>a==="0").length,n=r+[...t].filter(a=>a==="#").length,s=String(e).padStart(r,"0");if(!(s.length<n||r===0&&e===0))return t.includes(",")?s.replace(/\B(?=(\d{3})+$)/g,","):s},vm=(e,t)=>{switch(t){case"upper":return e.toUpperCase();case"lower":return e.toLowerCase();case"firstcap":return e.charAt(0).toUpperCase()+e.slice(1);default:return e}},fm=e=>{var t;const r=new RegExp("^\\s*(PAGEREF|NUMPAGES|SECTIONPAGES)\\b(.*)$","is").exec(e),n=r?.[1].toUpperCase()==="PAGEREF"?new RegExp('^\\s*("?)([^\\s"\\\\]+)\\1(.*)$',"s").exec(r[2]):void 0;if(!r||r[1].toUpperCase()==="PAGEREF"&&!n)return;const s=(t=(n?n[3]:r[2]).match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];let a,i;const o=[];let c=!1,l=!0;for(let g=0;g<s.length;g++){const p=s[g],f=()=>{var y;return(p.length>2?p.slice(2):(y=s[++g])!==null&&y!==void 0?y:"").replace(/^"(.*)"$/,"$1")};if(/^\\p$/i.test(p))c=!0;else if(p.startsWith("\\#")){var u;const y=f();l&&(l=i===void 0&&mm(y)),(u=i)!==null&&u!==void 0||(i=y)}else if(p.startsWith("\\*")){const y=f(),I=y.toLowerCase();if(Wi.has(I))o.push(I);else if(y!==""&&!Bi.has(I)){var d;l&&(l=a===void 0&&Pn(y)!==void 0),(d=a)!==null&&d!==void 0||(a=y)}}}const m=w(w(w(w({},a===void 0?{}:{numberFormat:a}),i===void 0?{}:{picture:i}),o.length===0?{}:{capitals:o[0]}),{},{written:l&&o.length<=1&&o[0]!=="caps"&&(a===void 0||i===void 0)});return w(n?{type:"pageReference",bookmark:n[2],relative:c}:{type:"pageCount",scope:r[1].toUpperCase()==="NUMPAGES"?"document":"section"},m)},wm=e=>new RegExp("^\\s*TOC\\b.*\\\\s\\b","is").test(e),Ui=(e,{enclosing:t,within:r,inTextBox:n},{estimate:s,sectionPageCount:a,blank:i,relativeTo:o})=>{const c=fm(e);if(c===void 0)return;const{bookmarks:l,pageCount:u,bookmarkPageNumbers:d}=s,{numberFormat:m,picture:g,capitals:p,written:f}=c,y=m!==void 0||g!==void 0,I=P=>P===void 0?void 0:g===void 0?Pn(m??"arabic")(P):pm(P,g),C=c.type==="pageReference"&&c.relative&&r==="counted"&&!n?o?.(c.bookmark):void 0;let E;return f?c.type==="pageCount"?E=I(c.scope==="document"?u:a):t.some(wm)?E=void 0:y?E=I(d?.get(c.bookmark)):E=c.relative?C:l.get(c.bookmark):E=void 0,E===void 0?i?"":void 0:vm(E,p)},gm=(e,t)=>e==="mc:Fallback"||t==="fallback"?"fallback":e==="w:del"||e==="w:moveFrom"?"deleted":t,jt=(e,t,r,n,s="counted",a=!1)=>{for(let l=0;l<t.length;l++){const u=t[l],d=e.nameOf(u);if(d===void 0)continue;const m=r[r.length-1];if(d==="w:fldChar"){const g=e.attributeOf(u,"w:fldCharType");g==="begin"?r.push({begin:u,instruction:"",inResult:!1}):g==="separate"&&m?(e.writeClean(m.begin,m.instruction),m.inResult=!0,m.result=n.resultOf(m.instruction,{within:s,enclosing:r.slice(0,-1).map(p=>p.instruction),inTextBox:a}),m.result!==void 0&&(t.splice(l+1,0,e.textElement(m.result)),l++)):g==="end"&&r.pop()}else if(d==="w:instrText"&&m&&!m.inResult)m.instruction+=e.textOf(u);else if((d==="w:t"||d==="w:tab"||d==="w:br"||d==="w:cr")&&m?.result!==void 0)t.splice(l,1),l--;else if(d==="w:fldSimple"){const g=n.resultOf(String(e.attributeOf(u,"w:instr")),{within:s,enclosing:r.map(p=>p.instruction),inTextBox:a});if(g===void 0){var i;jt(e,(i=e.contentOf(u))!==null&&i!==void 0?i:[],[],n,s,a)}else e.setSimpleFieldResult(u,g)}else{var o;if(d==="w:p"){var c;(c=n.beforeParagraph)===null||c===void 0||c.call(n,u)}jt(e,(o=e.contentOf(u))!==null&&o!==void 0?o:[],r,n,gm(d,s),a||d==="w:txbxContent"),d==="w:p"&&n.afterParagraph(u)}}},Gi=(e,t)=>t.flatMap(r=>{var n;const s=e.nameOf(r);return s===void 0?[]:s==="w:sectPr"?[r]:Gi(e,(n=e.contentOf(r))!==null&&n!==void 0?n:[])}),ym=(e,t)=>{var r;return((r=e.contentOf(t))!==null&&r!==void 0?r:[]).some(n=>{var s;return e.nameOf(n)==="w:pPr"&&((s=e.contentOf(n))!==null&&s!==void 0?s:[]).some(a=>e.nameOf(a)==="w:sectPr")})},bm=(e,t,r)=>{const n=Gi(e,[t]).reduce((s,a)=>{var i,o;const c=((i=e.contentOf(a))!==null&&i!==void 0?i:[]).flatMap(l=>{const u=e.nameOf(l);return u==="w:headerReference"||u==="w:footerReference"?[[`${u} ${String(e.attributeOf(l,"w:type"))}`,String(e.attributeOf(l,"r:id"))]]:[]});return[...s,new Map([...(o=s[s.length-1])!==null&&o!==void 0?o:[],...c])]},[]).reduce((s,a,i)=>{for(const c of a.values()){var o;s.set(c,[...(o=s.get(c))!==null&&o!==void 0?o:[],r[i]])}return s},new Map);return new Map([...n].flatMap(([s,[a,...i]])=>a!==void 0&&i.every(o=>o===a)?[[s,a]]:[]))},Vi=(e,t,r,{blank:n})=>{const{sectionPageCounts:s=[],relativePositions:a}=r;let i=0;const o=new Map,c=l=>{var u,d;const m=(u=o.get(l))!==null&&u!==void 0?u:0;return o.set(l,m+1),a==null||(d=a.get(l))===null||d===void 0?void 0:d[m]};return jt(e,[t],[],{resultOf:(l,u)=>Ui(l,u,{estimate:r,sectionPageCount:s[i],blank:n,relativeTo:c}),afterParagraph:l=>{i+=ym(e,l)?1:0}}),bm(e,t,s)},ji=(e,t,r,{blank:n,sectionPageCount:s,notes:a=!1})=>{const i=o=>{const c=r.bookmarks.get(o);return c===void 0?void 0:`on page ${c}`};jt(e,[t],[],{resultOf:(o,c)=>Ui(o,c,w({estimate:r,sectionPageCount:s,blank:n},a?{relativeTo:i}:{})),afterParagraph:()=>{}})},Tm=(e,t,{beforeParagraph:r,resultOf:n})=>jt(e,[t],[],{resultOf:(s,{within:a})=>n(s,a),beforeParagraph:r,afterParagraph:()=>{}}),Xi=class extends b{constructor(e={}){super("w:instrText"),v(this,"properties",void 0),this.properties=e,this.root.push(new we({space:ve.PRESERVE}));let t="TOC";if(this.properties.captionLabel&&(t=`${t} \\a "${this.properties.captionLabel}"`),this.properties.entriesFromBookmark&&(t=`${t} \\b "${this.properties.entriesFromBookmark}"`),this.properties.captionLabelIncludingNumbers&&(t=`${t} \\c "${this.properties.captionLabelIncludingNumbers}"`),this.properties.sequenceAndPageNumbersSeparator&&(t=`${t} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`),this.properties.tcFieldIdentifier&&(t=`${t} \\f "${this.properties.tcFieldIdentifier}"`),this.properties.hyperlink&&(t=`${t} \\h`),this.properties.tcFieldLevelRange&&(t=`${t} \\l "${this.properties.tcFieldLevelRange}"`),this.properties.pageNumbersEntryLevelsRange&&(t=`${t} \\n "${this.properties.pageNumbersEntryLevelsRange}"`),this.properties.headingStyleRange&&(t=`${t} \\o "${this.properties.headingStyleRange}"`),this.properties.entryAndPageNumberSeparator&&(t=`${t} \\p "${this.properties.entryAndPageNumberSeparator}"`),this.properties.seqFieldIdentifierForPrefix&&(t=`${t} \\s "${this.properties.seqFieldIdentifierForPrefix}"`),this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){const r=this.properties.stylesWithLevels.map(n=>`${n.styleName},${n.level}`).join(",");t=`${t} \\t "${r}"`}this.properties.useAppliedParagraphOutlineLevel&&(t=`${t} \\u`),this.properties.preserveTabInEntries&&(t=`${t} \\w`),this.properties.preserveNewLineInEntries&&(t=`${t} \\x`),this.properties.hideTabAndPageNumbersInWebView&&(t=`${t} \\z`),this.root.push(t)}},On=class extends b{constructor(){super("w:sdtContent")}},Ki=e=>e===void 0?pn():Je(e),Ln=new WeakMap,Em=(e,t)=>{Ln.set(e,t)},xm=class{constructor(){v(this,"ids",[])}get(e){var t,r;return(r=(t=this.ids)[e])!==null&&r!==void 0||(t[e]=gn()),this.ids[e]}},Ue=e=>typeof e=="object"&&e!==null?Object.keys(e)[0]:void 0,Ge=e=>{const t=Ue(e),r=t===void 0?void 0:e[t];return Array.isArray(r)?r:r===void 0?[]:[r]},Pe=(e,t)=>Ge(e).find(r=>Ue(r)===t),Ae=(e,t)=>{var r;return(r=Pe(e,"_attr"))===null||r===void 0||(r=r._attr)===null||r===void 0?void 0:r[t]},_n=(e,t)=>{const r=Ae(e,t);return r===void 0?void 0:Number(r)},Sm=new Set(["w:tbl","w:tr","w:tc","w:sdt","w:sdtContent","w:customXml"]),zi=e=>e.flatMap(t=>{const r=Ue(t);return r==="w:p"||Ln.has(t)?[t]:r!==void 0&&Sm.has(r)?zi(Ge(t)):[]}),Am=new Set(["w:r","w:hyperlink","w:ins","w:moveTo","w:smartTag","w:customXml","w:sdt","w:sdtContent","w:fldSimple","w:dir","w:bdo"]),Im=e=>{switch(Ue(e)){case"w:t":return Ge(e).filter(t=>typeof t=="string").join("");case"w:tab":return" ";case"w:br":return[void 0,"textWrapping"].includes(Ae(e,"w:type"))?`
|
|
7
|
+
`:"";case"w:cr":return`
|
|
8
|
+
`;case"w:noBreakHyphen":return"-";default:return""}},Cm=e=>{const t=[],r=n=>{const s=Ue(n);if(s!==void 0&&Am.has(s))return Ge(n).map(r).join("");if(s==="w:fldChar"){const a=Ae(n,"w:fldCharType");return a==="begin"?t.push(!1):a==="separate"?t[t.length-1]=!0:t.pop(),""}return t.every(Boolean)?Im(n):""};return Ge(e).map(r).join("")},qi=e=>{const t=Ue(e);return t==="w:bookmarkStart"?[{start:!0,id:Ae(e,"w:id"),name:Ae(e,"w:name")}]:t==="w:bookmarkEnd"?[{start:!1,id:Ae(e,"w:id")}]:t===void 0||t==="_attr"?[]:Ge(e).flatMap(qi)},Nm=e=>{const t=new Map;return e.map(r=>{const n=qi(r),s=new Set([...t.values(),...n.flatMap(a=>a.start?[a.name]:[])]);for(const a of n)a.start?t.set(a.id,a.name):t.delete(a.id);return s})},Rm=(e,t)=>{const r=t?Nm(e):[];return e.map((n,s)=>{var a;const i=Pe(n,"w:pPr");return{element:n,styleId:Ae(Pe(i,"w:pStyle"),"w:val"),outlineLevel:_n(Pe(i,"w:outlineLvl"),"w:val"),text:Cm(n),bookmarks:(a=r[s])!==null&&a!==void 0?a:new Set}})},Yi=e=>{var t;const r=(t=e.file)===null||t===void 0||(t=t.Styles)===null||t===void 0?void 0:t.prepForXml(e);return new Map(Ge(r).filter(n=>Ue(n)==="w:style"&&["paragraph",void 0].includes(Ae(n,"w:type"))).map(n=>[Ae(n,"w:styleId"),{name:Ae(Pe(n,"w:name"),"w:val"),basedOn:Ae(Pe(n,"w:basedOn"),"w:val"),outlineLevel:_n(Pe(Pe(n,"w:pPr"),"w:outlineLvl"),"w:val")}]))},Ji=e=>{const t=/^\s*(\d+)\s*-\s*(\d+)\s*$/.exec(e);return t?[Number(t[1]),Number(t[2])]:void 0},Dn=(e,[t,r])=>e>=t&&e<=r,Mn=(e,t)=>{var r,n;if(e===void 0)return;const s=/^heading ?([1-9])$/i.exec((r=(n=t.get(e))===null||n===void 0?void 0:n.name)!==null&&r!==void 0?r:e);return s?Number(s[1]):void 0},Zi=(e,t,r=0)=>{var n;if(e===void 0||r>t.size)return;const s=t.get(e),a=Mn(e,t);return(n=s?.outlineLevel)!==null&&n!==void 0?n:a===void 0?Zi(s?.basedOn,t,r+1):a-1},km=e=>{const t=Yi(e);return r=>{const n=Pe(r,"w:pPr"),s=Ae(Pe(n,"w:pStyle"),"w:val"),a=Mn(s,t),i=Qi({styleId:s,outlineLevel:_n(Pe(n,"w:outlineLvl"),"w:val")},t),o=i===void 0||i>=9?void 0:i+1;return a!==void 0&&(o===void 0||o===a)?a:o===void 0?void 0:"unclear"}},Qi=(e,t)=>{var r;return(r=e.outlineLevel)!==null&&r!==void 0?r:Zi(e.styleId,t)},Pm=(e,t,r)=>{var n;const{entriesFromBookmark:s,headingStyleRange:a,stylesWithLevels:i=[],useAppliedParagraphOutlineLevel:o}=e;if(t.text.trim()===""||s&&!t.bookmarks.has(s))return;const c=[t.styleId,t.styleId===void 0||(n=r.get(t.styleId))===null||n===void 0?void 0:n.name].filter(p=>p!==void 0).map(p=>p.toLowerCase()),l=i.find(p=>c.includes(p.styleName.toLowerCase()));if(l)return l.level;const u=!!a||i.length>0||!!o||!!e.tcFieldIdentifier||!!e.tcFieldLevelRange||!!e.captionLabel||!!e.captionLabelIncludingNumbers,d=a?Ji(a):u?void 0:[1,9],m=Mn(t.styleId,r);if(d&&m!==void 0&&Dn(m,d))return m;const g=o?Qi(t,r):void 0;return g!==void 0&&Dn(g+1,d??[1,9])?g+1:void 0},Om=(e,t)=>{const r=t.preserveTabInEntries?e:e.replace(/\t/g," ");return(t.preserveNewLineInEntries?r.split(`
|
|
9
|
+
`):[r.replace(/\n/g," ")]).map((n,s)=>new We({break:s>0?1:void 0,children:n.split(" ").flatMap((a,i)=>[...i>0?[new Xt]:[],...a===""?[]:[a]])}))},Lm=({text:e,separator:t})=>t==="tab"?[new We(e),new We({children:[new Xt]})]:[new We(`${e} `)],_m=(e,t)=>{const r=240*(e-1)+t+240;return r<=1920?Math.ceil(r/240)*240:Math.round(r)},Dm=(e,t)=>{var r,n;return(r=(n=[...t].find(([,s])=>{var a;return((a=s.name)===null||a===void 0?void 0:a.toLowerCase())===`toc ${e}`}))===null||n===void 0?void 0:n[0])!==null&&r!==void 0?r:`TOC${e}`},Mm=({properties:e,beginDirty:t,textWidth:r,tabLeader:n},s,a,i)=>{var o;const c=e.pageNumbersEntryLevelsRange?(o=Ji(e.pageNumbersEntryLevelsRange))!==null&&o!==void 0?o:[1,9]:void 0,l=new On;return s.forEach((u,d)=>{var m;const g=c===void 0||!Dn(u.level,c),p=[...u.listNumber?Lm(u.listNumber):[],...Om(u.title,e),...g?[new We({children:[e.entryAndPageNumberSeparator||new Xt]}),new yo(u.bookmark,{hyperlink:e.hyperlink})]:[]];l.addChildElement(new ue({style:Dm(u.level,a),tabStops:[...((m=u.listNumber)===null||m===void 0?void 0:m.separator)==="tab"?[{type:"left",position:_m(u.level,u.listNumber.width)}]:[],{type:"right",position:r,leader:n}],children:[...d===0?[new te({children:[Ki(t),new Xi(e),ke()]})]:[],...e.hyperlink?[new Gn({anchor:u.bookmark,children:p})]:p]}))}),l.addChildElement(new ue({children:[new te({children:[xe()]})]})),l.prepForXml(i)},Fm=(e,t,r,n)=>{const s=Ge(e),a=s.findIndex(i=>Ue(i)==="w:pPr")+1;e["w:p"]=[...s.slice(0,a),new jn(t,r).prepForXml(n),...s.slice(a),new Xn(r).prepForXml(n)]},$m=(e,t,r,n)=>{const s=zi(Ge(e)),a=s.flatMap(u=>{const d=Ln.get(u);return d?[[u,d]]:[]});if(a.length===0)return;const i=Yi(t),o=a.some(([,{properties:u}])=>!!u.entriesFromBookmark),c=Rm(s.filter(u=>Ue(u)==="w:p"),o).map(u=>({paragraph:u,levels:a.map(([,{properties:d}])=>Pm(d,u,i))})).filter(({levels:u})=>u.some(d=>d!==void 0)).map((u,d)=>w(w({},u),{},{id:r.get(d)}));for(const{paragraph:u,id:d}of c)Fm(u.element,`_Toc${d}`,d,t);const l=c.length>0?n?.(e):void 0;a.forEach(([u,d],m)=>{const g=c.flatMap(({paragraph:p,levels:f,id:y})=>{const I=f[m],C=l?.get(`_Toc${y}`);return I===void 0?[]:[w({title:p.text,level:I,bookmark:`_Toc${y}`},C?{listNumber:C}:{})]});g.length!==0&&(u["w:sdt"]=Ge(u).map(p=>Ue(p)==="w:sdtContent"?Mm(d,g,i,t):p))})},Hm=new RegExp("^\\p{L}[\\p{L}\\p{N}_]*$","u"),Bm=e=>{var t,r;let n,s=!1,a,i=!1,o=!1;for(let d=0;d<e.length;d++){var c,l;const m=e[d],g=(c=e[d+1])!==null&&c!==void 0?c:"";let p;if(d===0&&!m.startsWith("\\"))p={type:"bookmark"};else if(m==="\\c"||m==="\\n")p={type:m==="\\c"?"repeat":"next"};else if((m==="\\r"||m==="\\s")&&/^\d+$/.test(g))d++,p=m==="\\r"?{type:"reset",to:Number(g)}:{type:"heading",level:Number(g)};else if(m==="\\h")s=!0;else if(m==="\\#"&&d+1<e.length)d++,o=!0;else if(m==="\\*"&&d+1<e.length){const f=e[++d];if(Wi.has(f.toLowerCase()))i=!0;else if(!Bi.has(f.toLowerCase())){if(a!==void 0)return;a=f}}else return;if(p&&n)return;n=(l=p)!==null&&l!==void 0?l:n}if(n?.type==="bookmark"&&e.length>1)return;const u=!o&&!(i&&a!==void 0&&a.toLowerCase()!=="arabic");return{step:(t=n)!==null&&t!==void 0?t:{type:"next"},hidden:s&&a===void 0,format:u?(r=a)!==null&&r!==void 0?r:"ARABIC":""}},Fn=e=>{var t;const r=new RegExp("^\\s*SEQ\\b(.*)$","is").exec(e);if(!r)return;const[n,...s]=(t=r[1].match(/"[^"]*"|\S+/g))!==null&&t!==void 0?t:[];if(n===void 0)return{};const a=n.replace(/^"(.*)"$/,"$1");return Hm.test(a)?{identifier:a,sequence:Bm(s)}:{identifier:a}},Wm=e=>Fn(e)!==void 0,$n=e=>typeof e!="object"||e===null?[]:Array.isArray(e)?e.flatMap($n):Object.entries(e).flatMap(([t,r])=>[...(t==="w:instrText"&&Array.isArray(r)?r:t==="_attr"?[r["w:instr"]]:[]).flatMap(n=>{const s=typeof n=="string"?Fn(n):void 0;return s?.identifier===void 0?[]:[s.identifier.toLowerCase()]}),...$n(r)]),Um=e=>{var t;const r=(t=e.file)===null||t===void 0?void 0:t.Comments;if(!r)return new Set;const n={View:r,Relationships:r.Relationships};return new Set($n(r.prepForXml(w(w({},e),{},{viewWrapper:n,stack:[]}))))},Gm=e=>{const t=km(e),r=new Map,n=new Map,s=[];let a=-1,i=-1,o;const c=(l,u)=>{var d;const m=Math.max(-1,...s.slice(1,u+1).filter(f=>f!==void 0)),g=((d=n.get(l))!==null&&d!==void 0?d:[]).filter(f=>f.paragraph>=m),p=g.every(({step:f})=>f?.type==="next"||f?.type==="heading"&&f.level===u);return a>m||!p?void 0:g.length+1};return{startParagraph:l=>{i++;const u=t(l);u==="unclear"?a=i:u!==void 0&&(s[u]=i)},numberOf:(l,u)=>{var d,m,g;const{identifier:p,sequence:f}=Fn(l);if(p===void 0||u==="fallback")return;(d=o)!==null&&d!==void 0||(o=Um(e));const y=p.toLowerCase();if(f?.step.type==="bookmark"&&u==="counted"&&!o.has(y))return;const I=r.has(y)?r.get(y):0,C=o.has(y)||u==="deleted"?void 0:f?.step,E=C?.type==="reset"?C.to:C?.type==="repeat"?I:C?.type==="heading"?c(y,C.level):C?.type==="next"&&I!==void 0?I+1:void 0;return r.set(y,E),n.set(y,[...(m=n.get(y))!==null&&m!==void 0?m:[],w({paragraph:i},E===void 0?{}:{step:C})]),E===void 0||f===void 0?void 0:f.hidden?"":(g=Pn(f.format))===null||g===void 0?void 0:g(E)}}},Hn=e=>{const t=typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.keys(e)[0]:void 0;return t==="_attr"?void 0:t},eo=e=>({"w:t":[{_attr:{"xml:space":"preserve"}},e]}),Er={nameOf:Hn,contentOf:e=>{const t=e[Hn(e)];return Array.isArray(t)?t:void 0},attributeOf:(e,t)=>{var r;const n=e[Hn(e)],s=Array.isArray(n)?n.find(a=>typeof a=="object"&&a!==null&&"_attr"in a):n;return s==null||(r=s._attr)===null||r===void 0?void 0:r[t]},textOf:e=>Er.contentOf(e).filter(t=>typeof t=="string").join(""),textElement:eo,writeClean:e=>{if(bd(e)){const t=e["w:fldChar"]._attr;e["w:fldChar"]={_attr:Object.fromEntries(Object.entries(t).filter(([r])=>r!=="w:dirty"))}}},setSimpleFieldResult:(e,t)=>{const r=e["w:fldSimple"];e["w:fldSimple"]=[...(Array.isArray(r)?r:[r]).filter(n=>typeof n=="object"&&n!==null&&"_attr"in n),{"w:r":[eo(t)]}]}},to=new WeakMap,ro=(e,t)=>{const{startParagraph:r,numberOf:n}=Gm(t);Tm(Er,e,{beforeParagraph:s=>r(s),resultOf:(s,a)=>Wm(s)?n(s,a):void 0})},no=(e,t,r)=>{const n=r(e,t),s=Vi(Er,e,n,{blank:!1});t.file&&to.set(t.file,{estimate:n,partPageCounts:s})},It=(e,t,r)=>{const n=t.file&&to.get(t.file);if(!e||!n)return;const s=r===void 0?void 0:n.partPageCounts.get(`rId${r}`),a="w:footnotes"in e||"w:endnotes"in e;ji(Er,e,n.estimate,{blank:!1,sectionPageCount:s,notes:a})},Vm=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns"})}},se=class Hu extends b{constructor(){super("Relationships"),this.root.push(new Vm({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(t,r,n,s){this.root.push(Gh(`rId${t}`,r,n,s))}static copy(t){const r=new Hu;return r.root.push(...t.root.slice(1)),r}get RelationshipCount(){return this.root.length-1}},jm=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},Bn=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Xm=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps","mc:Ignorable":"mc:Ignorable"})}},Km=class extends b{constructor(e){super("w:commentRangeStart"),this.root.push(new Bn({id:e}))}},zm=class extends b{constructor(e){super("w:commentRangeEnd"),this.root.push(new Bn({id:e}))}},qm=class extends b{constructor(e){super("w:commentReference"),this.root.push(new Bn({id:e}))}},Wn=class extends b{constructor({id:e,initials:t,author:r,date:n=new Date,children:s},a){super("w:comment"),v(this,"paraId",void 0),this.paraId=a,this.root.push(new jm({id:e,initials:t,author:r,date:n.toISOString()}));for(const i of s)this.root.push(i)}prepForXml(e){const t=super.prepForXml(e);if(!t||!this.paraId)return t;const r=t["w:comment"];if(!Array.isArray(r))return t;for(let n=r.length-1;n>=0;n--){const s=r[n];if(s&&typeof s=="object"&&"w:p"in s){const a=s["w:p"];Array.isArray(a)&&a.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return t}},so=e=>(e+1).toString(16).toUpperCase().padStart(8,"0"),ao=class extends b{constructor({children:e}){super("w:comments"),v(this,"relationships",void 0),v(this,"threadData",void 0),v(this,"commentIdsData",void 0),v(this,"isEmpty",void 0),this.isEmpty=e.length===0,this.root.push(new Xm({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape","mc:Ignorable":"w14 w15 wp14"}));const t=e.some(n=>n.parentId!==void 0),r=e.some(n=>n.durableId!==void 0);if(t||r){const n=new Map(e.map(s=>[s.id,so(s.id)]));for(const s of e)this.root.push(new Wn(s,n.get(s.id)));t&&(this.threadData=e.map(s=>({paraId:n.get(s.id),parentParaId:s.parentId!==void 0?n.get(s.parentId):void 0,done:s.resolved}))),r&&(this.commentIdsData=e.map(s=>{var a;return{paraId:n.get(s.id),durableId:(a=s.durableId)!==null&&a!==void 0?a:n.get(s.id)}}))}else for(const n of e)this.root.push(new Wn(n));this.relationships=new se}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}get CommentIdsData(){return this.commentIdsData}get IsEmpty(){return this.isEmpty}prepForXml(e){const t=super.prepForXml(e);return It(t,e),t}},Ym=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id",editorGroup:"w:edGrp"})}},Jm=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Zm=class extends b{constructor(e){super("w:permStart"),this.root.push(new Ym({id:e,editorGroup:"everyone"}))}},Qm=class extends b{constructor(e){super("w:permEnd"),this.root.push(new Jm({id:e}))}},ep=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},tp=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},rp=class extends b{constructor(e){super("w15:commentEx"),this.root.push(new tp({paraId:e.paraId,paraIdParent:e.parentParaId,done:e.done!==void 0?e.done?"1":"0":void 0}))}},io=class extends b{constructor(e){super("w15:commentsEx"),this.root.push(new ep({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(const t of e)this.root.push(new rp(t))}},np=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{paraId:"w16cid:paraId",durableId:"w16cid:durableId"})}},sp=class extends b{constructor(e){super("w16cid:commentId"),this.root.push(new np({paraId:e.paraId,durableId:e.durableId}))}},ap=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{"xmlns:w16cid":"xmlns:w16cid","xmlns:mc":"xmlns:mc","mc:Ignorable":"mc:Ignorable"})}},oo=class extends b{constructor(e){super("w16cid:commentsIds"),this.root.push(new ap({"xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","mc:Ignorable":"w16cid"}));for(const t of e)this.root.push(new sp(t))}},ip=class extends ne{constructor(){super("w:noBreakHyphen")}},op=class extends ne{constructor(){super("w:softHyphen")}},lp=class extends ne{constructor(){super("w:dayShort")}},cp=class extends ne{constructor(){super("w:monthShort")}},up=class extends ne{constructor(){super("w:yearShort")}},dp=class extends ne{constructor(){super("w:dayLong")}},hp=class extends ne{constructor(){super("w:monthLong")}},mp=class extends ne{constructor(){super("w:yearLong")}},pp=class extends ne{constructor(){super("w:annotationRef")}},vp=class extends ne{constructor(){super("w:footnoteRef")}},lo=class extends ne{constructor(){super("w:endnoteRef")}},fp=class extends ne{constructor(){super("w:separator")}},wp=class extends ne{constructor(){super("w:continuationSeparator")}},gp=class extends ne{constructor(){super("w:pgNum")}},yp=class extends ne{constructor(){super("w:cr")}},Xt=class extends ne{constructor(){super("w:tab")}},bp=class extends ne{constructor(){super("w:lastRenderedPageBreak")}},Tp={LEFT:"left",CENTER:"center",RIGHT:"right"},Ep={MARGIN:"margin",INDENT:"indent"},xp={NONE:"none",DOT:"dot",HYPHEN:"hyphen",UNDERSCORE:"underscore",MIDDLE_DOT:"middleDot"},Sp=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{alignment:"w:alignment",relativeTo:"w:relativeTo",leader:"w:leader"})}},Ap=class extends b{constructor(e){super("w:ptab"),this.root.push(new Sp({alignment:e.alignment,relativeTo:e.relativeTo,leader:e.leader}))}},co={COLUMN:"column",PAGE:"page"},uo=class extends b{constructor(e){super("w:br"),this.root.push(new le({type:e}))}},Ip=class extends te{constructor(){super({}),this.root.push(new uo(co.PAGE))}},Cp=class extends te{constructor(){super({}),this.root.push(new uo(co.COLUMN))}},ho=class extends b{constructor(){super("w:pageBreakBefore")}},pt={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},mo=({after:e,before:t,line:r,lineRule:n,beforeAutoSpacing:s,afterAutoSpacing:a})=>new T({name:"w:spacing",attributes:{after:{key:"w:after",value:e},before:{key:"w:before",value:t},line:{key:"w:line",value:r},lineRule:{key:"w:lineRule",value:n},beforeAutoSpacing:{key:"w:beforeAutospacing",value:s},afterAutoSpacing:{key:"w:afterAutospacing",value:a}}}),Np={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},Ct=e=>new T({name:"w:pStyle",attributes:{val:{key:"w:val",value:e}}}),Un={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},po={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},Rp={MAX:9026},vo=({type:e,position:t,leader:r})=>new T({name:"w:tab",attributes:{val:{key:"w:val",value:e},pos:{key:"w:pos",value:Ne(t)},leader:{key:"w:leader",value:r}}}),fo=e=>new T({name:"w:tabs",children:e.map(t=>vo(t))}),Kt=class extends b{constructor(e,t){super("w:numPr"),this.root.push(new kp(t)),this.root.push(new Pp(e))}},kp=class extends b{constructor(e){if(super("w:ilvl"),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new le({val:e}))}},Pp=class extends b{constructor(e){super("w:numId"),this.root.push(new le({val:typeof e=="string"?`{${e}}`:e}))}},zt=class extends b{constructor(...e){super(...e),v(this,"fileChild",Symbol())}},Op=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},Lp={INTERNAL:"INTERNAL",EXTERNAL:"EXTERNAL"},Nt=class extends b{constructor(e,t,r,n){super("w:hyperlink"),v(this,"linkId",void 0),v(this,"drawingLink",void 0),this.linkId=t,this.drawingLink=r&&n!==void 0?new Cn(n):void 0;const s=new Op({history:1,anchor:r||void 0,id:!r||n!==void 0?`rId${this.linkId}`:void 0});this.root.push(s),e.forEach(a=>{this.root.push(a)})}createDrawingClick(e,t){return this.drawingLink?(this.drawingLink.addRelationship(e),this.drawingLink.createClick(t)):ki(this.linkId,t)}},Gn=class extends Nt{constructor(e){super(e.children,Ze(),e.anchor)}},wo=class extends b{constructor(e){super("w:externalHyperlink"),v(this,"options",void 0),this.options=e}},_p=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id",name:"w:name"})}},Dp=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Vn=class Bu{constructor(t){v(this,"start",void 0),v(this,"children",void 0),v(this,"end",void 0);const r=gn();this.start=new jn(t.id,r),this.children=t.children,this.end=new Xn(r)}get writtenAs(){return[this.start,...this.children.flatMap(t=>t instanceof Bu?t.writtenAs:[t]),this.end]}},jn=class extends b{constructor(e,t){super("w:bookmarkStart");const r=new _p({name:e,id:t});this.root.push(r)}},Xn=class extends b{constructor(e){super("w:bookmarkEnd");const t=new Dp({id:e});this.root.push(t)}},Mp=(function(e){return e.NONE="none",e.RELATIVE="relative",e.NO_CONTEXT="no_context",e.FULL_CONTEXT="full_context",e})({}),Fp={relative:"\\r",no_context:"\\n",full_context:"\\w",none:void 0},$p=class extends kn{constructor(e,t,r={}){const{hyperlink:n=!0,referenceFormat:s="full_context"}=r,a=`${`REF ${e}`} ${[...n?["\\h"]:[],...[Fp[s]].filter(i=>!!i)].join(" ")}`;super(a,t)}},go=e=>new T({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:e}}}),Hp=class extends b{constructor(e,t={}){super("w:instrText"),this.root.push(new we({space:ve.PRESERVE}));let r=`PAGEREF ${e}`;t.hyperlink&&(r=`${r} \\h`),t.useRelativePosition&&(r=`${r} \\p`),this.root.push(r)}},yo=class extends te{constructor(e,t={}){super({children:[pn(),new Hp(e,t),ke(),xe()]})}},Bp=255,bo=e=>{const t=e.indexOf("#"),r=e.length-t-1;return t>0&&r>0&&r<=Bp?{target:e.slice(0,t),anchor:e.slice(t+1)}:{target:e}},xr=(e,t,r)=>r===void 0?`${e}-${t}`:`${e}-restart ${r}`,Wp={ANSI:"00",DEFAULT:"01",SYMBOL:"02",MAC:"4D",JIS:"80",HANGUL:"81",JOHAB:"82",GB_2312:"86",CHINESEBIG5:"88",GREEK:"A1",TURKISH:"A2",VIETNAMESE:"A3",HEBREW:"B1",ARABIC:"B2",BALTIC:"BA",RUSSIAN:"CC",THAI:"DE",EASTEUROPE:"EE",OEM:"FF"},Sr=({id:e,fontKey:t,subsetted:r},n)=>new T({name:n,attributes:w({id:{key:"r:id",value:e}},t?{fontKey:{key:"w:fontKey",value:`{${t.toUpperCase()}}`}}:{}),children:[...r?[new R("w:subsetted",r)]:[]]}),Up=({name:e,altName:t,panose1:r,charset:n,family:s,notTrueType:a,pitch:i,sig:o,embedRegular:c,embedBold:l,embedItalic:u,embedBoldItalic:d})=>new T({name:"w:font",attributes:{name:{key:"w:name",value:e}},children:[...t?[xt("w:altName",t)]:[],...r?[xt("w:panose1",r)]:[],...n?[xt("w:charset",n)]:[],...s?[xt("w:family",s)]:[],...a?[new R("w:notTrueType",a)]:[],...i?[xt("w:pitch",i)]:[],...o?[new T({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:o.usb0},usb1:{key:"w:usb1",value:o.usb1},usb2:{key:"w:usb2",value:o.usb2},usb3:{key:"w:usb3",value:o.usb3},csb0:{key:"w:csb0",value:o.csb0},csb1:{key:"w:csb1",value:o.csb1}}})]:[],...c?[Sr(c,"w:embedRegular")]:[],...l?[Sr(l,"w:embedBold")]:[],...u?[Sr(u,"w:embedItalic")]:[],...d?[Sr(d,"w:embedBoldItalic")]:[]]}),Gp=({name:e,characterSet:t,embedRegular:r,embedBold:n,embedItalic:s,embedBoldItalic:a})=>Up({name:e,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:t,family:"auto",pitch:"variable",embedRegular:r,embedBold:n,embedItalic:s,embedBoldItalic:a}),Vp=e=>new T({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:e.map(Gp)}),jp=[{option:"data",element:"embedRegular",bold:!1,italic:!1},{option:"bold",element:"embedBold",bold:!0,italic:!1},{option:"italic",element:"embedItalic",bold:!1,italic:!0},{option:"boldItalic",element:"embedBoldItalic",bold:!0,italic:!0}],To=class{constructor(e){v(this,"options",void 0),v(this,"fontTable",void 0),v(this,"relationships",void 0),v(this,"fontOptionsWithKey",[]),v(this,"files",[]),this.options=e;const t=e.map(r=>jp.flatMap(({option:n,element:s,bold:a,italic:i})=>{const o=r[n];return o?[{element:s,file:{name:r.name,data:o,bold:a,italic:i,fontKey:bn()}}]:[]}));this.files=t.flatMap(r=>r.map(({file:n})=>n)),this.fontOptionsWithKey=e.map((r,n)=>w(w({},r),{},{fontKey:t[n][0].file.fontKey})),this.fontTable=Vp(e.map((r,n)=>w({name:r.name,characterSet:r.characterSet},Object.fromEntries(t[n].map(({element:s,file:a})=>[s,{id:`rId${this.files.indexOf(a)+1}`,fontKey:a.fontKey}]))))),this.relationships=new se;for(let r=0;r<this.files.length;r++)this.relationships.addRelationship(r+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/font${r+1}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}},Xp=()=>new T({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),Kp={NONE:"none",DROP:"drop",MARGIN:"margin"},zp={MARGIN:"margin",PAGE:"page",TEXT:"text"},qp={AROUND:"around",AUTO:"auto",NONE:"none",NOT_BESIDE:"notBeside",THROUGH:"through",TIGHT:"tight"},Eo=e=>{var t,r;return new T({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:e.anchorLock},dropCap:{key:"w:dropCap",value:e.dropCap},width:{key:"w:w",value:e.width},height:{key:"w:h",value:e.height},x:{key:"w:x",value:e.position?e.position.x:void 0},y:{key:"w:y",value:e.position?e.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:e.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:e.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(t=e.space)===null||t===void 0?void 0:t.horizontal},spaceVertical:{key:"w:vSpace",value:(r=e.space)===null||r===void 0?void 0:r.vertical},rule:{key:"w:hRule",value:e.rule},alignmentX:{key:"w:xAlign",value:e.alignment?e.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:e.alignment?e.alignment.y:void 0},lines:{key:"w:lines",value:e.lines},wrap:{key:"w:wrap",value:e.wrap}}})},Kn=new WeakMap,Yp=mt(),Jp={left:"right",right:"left"},it=class extends $e{constructor(e,{implicitListParagraphStyle:t=!0,inListOrder:r=!0}={}){if(super("w:pPr",e?.includeIfEmpty),v(this,"numbering",void 0),v(this,"numberProperties",void 0),!e)return this;if(e.heading&&this.push(Ct(e.heading)),t&&(e.bullet&&this.push(Ct("ListParagraph")),e.numbering&&!e.numbering.custom&&!e.style&&!e.heading&&this.push(Ct("ListParagraph"))),e.style&&this.push(Ct(e.style)),e.keepNext!==void 0&&this.push(new R("w:keepNext",e.keepNext)),e.keepLines!==void 0&&this.push(new R("w:keepLines",e.keepLines)),e.pageBreakBefore&&this.push(new ho),e.frame&&this.push(Eo(e.frame)),e.widowControl!==void 0&&this.push(new R("w:widowControl",e.widowControl)),e.bullet&&this.push(new Kt(1,e.bullet.level)),e.numbering){const{reference:s,instance:a,level:i,restart:o}=e.numbering,c=typeof s=="string"?s:s.reference,l=new Kt(xr(c,a??0),i);this.numbering={reference:c,level:i,instance:a,restartedListId:o&&r&&a===void 0?Yp():void 0,definition:typeof s=="string"?void 0:s},this.numberProperties=l,this.push(l)}else e.numbering===!1&&this.push(new Kt(0,0));e.border&&this.push(new Ba(e.border)),e.thematicBreak&&this.push(new Wa),e.shading&&this.push(Wt(e.shading)),e.wordWrap&&this.push(Xp()),e.overflowPunctuation&&this.push(new R("w:overflowPunct",e.overflowPunctuation));const n=[...e.rightTabStop!==void 0?[{type:Un.RIGHT,position:e.rightTabStop}]:[],...e.tabStops?e.tabStops:[],...e.leftTabStop!==void 0?[{type:Un.LEFT,position:e.leftTabStop}]:[]];n.length>0&&this.push(fo(n)),e.bidirectional!==void 0&&this.push(new R("w:bidi",e.bidirectional)),e.spacing&&this.push(mo(e.spacing)),e.indent&&this.push(Ua(e.indent)),e.contextualSpacing!==void 0&&this.push(new R("w:contextualSpacing",e.contextualSpacing)),e.alignment&&this.push(ln(e.bidirectional&&Jp[e.alignment]||e.alignment)),e.outlineLevel!==void 0&&this.push(go(e.outlineLevel)),e.suppressLineNumbers!==void 0&&this.push(new R("w:suppressLineNumbers",e.suppressLineNumbers)),e.autoSpaceEastAsianText!==void 0&&this.push(new R("w:autoSpaceDN",e.autoSpaceEastAsianText)),e.run&&this.push(new ai(e.run)),e.revision&&this.push(new zn(e.revision))}push(e){this.root.push(e)}addSectionProperties(e){const t=this.root.findIndex(r=>r instanceof zn);if(t===-1){this.root.push(e);return}this.root.splice(t,0,e)}removeSectionProperties(e){const t=this.root.indexOf(e);t!==-1&&this.root.splice(t,1)}prepForXml(e){var t;if(this.numbering){var r,n;const{reference:i,level:o,instance:c=0,definition:l}=this.numbering,u=this.numbering.instance===void 0?(r=this.numbering.restartedListId)!==null&&r!==void 0?r:(n=Kn.get(e))===null||n===void 0?void 0:n.get(i):void 0;e.viewWrapper instanceof To||e.file.Numbering.createConcreteNumberingInstance(i,c,l,u);const d=new Kt(xr(i,c,u),o);this.root.splice(this.root.indexOf(this.numberProperties),1,d),this.numberProperties=d}const s=super.prepForXml(e);if(((t=this.numbering)===null||t===void 0?void 0:t.restartedListId)!==void 0){var a;Kn.set(e,new Map([...(a=Kn.get(e))!==null&&a!==void 0?a:[],[this.numbering.reference,this.numbering.restartedListId]]))}return s}},zn=class extends b{constructor(e){super("w:pPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.root.push(new it(w(w({},e),{},{includeIfEmpty:!0}),{inListOrder:!1}))}},ue=class Wu extends zt{constructor(t){if(super("w:p"),v(this,"options",void 0),v(this,"properties",void 0),v(this,"alignment",void 0),this.options=typeof t=="string"?{text:t}:t,typeof t=="string")return this.alignment={},this.properties=new it({}),this.root.push(this.properties),this.root.push(new We(t)),this;if(this.alignment={alignment:t.alignment,bidirectional:t.bidirectional},this.properties=new it(t),this.root.push(this.properties),t.text&&this.root.push(new We(t.text)),t.children)for(const r of t.children){if(r instanceof Vn){this.root.push(...r.writtenAs);continue}this.root.push(r)}}prepForXml(t){for(const r of this.root)if(Tt(r)==="w:externalHyperlink"){const n=this.root.indexOf(r),{options:s}=r,{target:a,anchor:i}=bo(s.link),o=new Nt(s.children,Ze(),i,s.link);t.viewWrapper.Relationships.addRelationship(o.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",a,In.EXTERNAL),this.root[n]=o}return super.prepForXml(t)}addSectionProperties(t){this.properties.addSectionProperties(t)}removeSectionProperties(t){this.properties.removeSectionProperties(t)}get Alignment(){return this.alignment}with(t){return new Wu(w(w({},this.options),t))}addRunToFront(t){return this.root.splice(1,0,t),this}},Zp=class extends b{constructor(e){super("m:oMath");for(const t of e.children)this.root.push(t)}},Qp=class extends b{constructor(e){super("m:t"),/^[\s\u200B]|[\s\u200B]$/.test(e)&&this.root.push(new we({space:ve.PRESERVE})),this.root.push(e)}},ev=["text","normalText","script","literal"],qn={plain:"p",bold:"b",italic:"i",boldItalic:"bi"},Yn={roman:"roman",script:"script",fraktur:"fraktur",doubleStruck:"double-struck",sansSerif:"sans-serif",monospace:"monospace"},Ar=(e,t)=>new T({name:e,attributes:{value:{key:"m:val",value:t}}}),tv=class extends b{constructor(e){var t;super("m:r");const r=typeof e=="string"?{text:e}:e,{text:n,normalText:s,script:a,literal:i}=r,o=(t=Ft(r,ev).style)!==null&&t!==void 0?t:a===void 0||a==="roman"?void 0:"plain";if(s&&(o!==void 0||a!==void 0))throw new Error("MathRun: normalText can't be given with style or script, which are for math. Give one or the other");if(o!==void 0&&!Object.keys(qn).includes(o))throw new Error(`MathRun: style is "${o}", which isn't one of ${Object.keys(qn).join(", ")}`);if(a!==void 0&&!Object.keys(Yn).includes(a))throw new Error(`MathRun: script is "${a}", which isn't one of ${Object.keys(Yn).join(", ")}`);const c=[...i?[Ar("m:lit",1)]:[],...s?[Ar("m:nor",1)]:[],...a===void 0?[]:[Ar("m:scr",Yn[a])],...o===void 0?[]:[Ar("m:sty",qn[o])]];c.length>0&&this.root.push(new T({name:"m:rPr",children:c})),this.root.push(new Qp(n))}},xo=class extends b{constructor(e){super("m:den");for(const t of e)this.root.push(t)}},So=class extends b{constructor(e){super("m:num");for(const t of e)this.root.push(t)}},Jn={stacked:"bar",skewed:"skw",linear:"lin",noBar:"noBar"},rv=class extends b{constructor(e){if(super("m:f"),e.type!==void 0){if(!Object.keys(Jn).includes(e.type))throw new Error(`MathFraction: type is "${e.type}", which isn't one of ${Object.keys(Jn).join(", ")}`);this.root.push(new T({name:"m:fPr",children:[new T({name:"m:type",attributes:{value:{key:"m:val",value:Jn[e.type]}}})]}))}this.root.push(new So(e.numerator)),this.root.push(new xo(e.denominator))}},Ao=({accent:e})=>new T({name:"m:chr",attributes:{accent:{key:"m:val",value:e}}}),ye=({children:e})=>new T({name:"m:e",children:e}),Io=({value:e})=>new T({name:"m:limLoc",attributes:{value:{key:"m:val",value:e||"undOvr"}}}),nv=()=>new T({name:"m:subHide",attributes:{hide:{key:"m:val",value:1}}}),sv=()=>new T({name:"m:supHide",attributes:{hide:{key:"m:val",value:1}}}),Zn=({accent:e,hasSuperScript:t,hasSubScript:r,limitLocationVal:n})=>new T({name:"m:naryPr",children:[...e?[Ao({accent:e})]:[],Io({value:n}),...r?[]:[nv()],...t?[]:[sv()]]}),Rt=({children:e})=>new T({name:"m:sub",children:e}),Qn={aboveBelow:"undOvr",side:"subSup"},Co=(e,t,r)=>{if(t===void 0)return r;if(!Object.keys(Qn).includes(t))throw new Error(`${e}: limits is "${t}", which isn't one of ${Object.keys(Qn).join(", ")}`);return Qn[t]},kt=({children:e})=>new T({name:"m:sup",children:e}),av=class extends b{constructor(e){var t,r;super("m:nary"),this.root.push(Zn({accent:"\u2211",hasSuperScript:!!e.superScript,hasSubScript:!!e.subScript,limitLocationVal:Co("MathSum",e.limits,"undOvr")})),this.root.push(Rt({children:(t=e.subScript)!==null&&t!==void 0?t:[]})),this.root.push(kt({children:(r=e.superScript)!==null&&r!==void 0?r:[]})),this.root.push(ye({children:e.children}))}},iv=class extends b{constructor(e){var t,r;super("m:nary"),this.root.push(Zn({accent:"",hasSuperScript:!!e.superScript,hasSubScript:!!e.subScript,limitLocationVal:Co("MathIntegral",e.limits,"subSup")})),this.root.push(Rt({children:(t=e.subScript)!==null&&t!==void 0?t:[]})),this.root.push(kt({children:(r=e.superScript)!==null&&r!==void 0?r:[]})),this.root.push(ye({children:e.children}))}},es=class extends b{constructor(e){super("m:lim");for(const t of e)this.root.push(t)}},ov=class extends b{constructor(e){super("m:limUpp"),this.root.push(ye({children:e.children})),this.root.push(new es(e.limit))}},lv=class extends b{constructor(e){super("m:limLow"),this.root.push(ye({children:e.children})),this.root.push(new es(e.limit))}},No=()=>new T({name:"m:sSupPr"}),cv=class extends b{constructor(e){super("m:sSup"),this.root.push(No()),this.root.push(ye({children:e.children})),this.root.push(kt({children:e.superScript}))}},Ro=()=>new T({name:"m:sSubPr"}),uv=class extends b{constructor(e){super("m:sSub"),this.root.push(Ro()),this.root.push(ye({children:e.children})),this.root.push(Rt({children:e.subScript}))}},ko=()=>new T({name:"m:sSubSupPr"}),dv=class extends b{constructor(e){super("m:sSubSup"),this.root.push(ko()),this.root.push(ye({children:e.children})),this.root.push(Rt({children:e.subScript})),this.root.push(kt({children:e.superScript}))}},Po=()=>new T({name:"m:sPrePr"}),hv=class extends T{constructor({children:e,subScript:t,superScript:r}){super({name:"m:sPre",children:[Po(),Rt({children:t}),kt({children:r}),ye({children:e})]})}},Oo=class extends b{constructor(e){if(super("m:deg"),e)for(const t of e)this.root.push(t)}},mv=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{hide:"m:val"})}},pv=class extends b{constructor(){super("m:degHide"),this.root.push(new mv({hide:1}))}},Lo=class extends b{constructor(e){super("m:radPr"),e||this.root.push(new pv)}},vv=class extends b{constructor(e){super("m:rad"),this.root.push(new Lo(!!e.degree)),this.root.push(new Oo(e.degree)),this.root.push(ye({children:e.children}))}},_o=class extends b{constructor(e){super("m:fName");for(const t of e)this.root.push(t)}},Do=class extends b{constructor(){super("m:funcPr")}},fv=class extends b{constructor(e){super("m:func"),this.root.push(new Do),this.root.push(new _o(e.name)),this.root.push(ye({children:e.children}))}},wv=({character:e})=>new T({name:"m:begChr",attributes:{character:{key:"m:val",value:e}}}),gv=({character:e})=>new T({name:"m:endChr",attributes:{character:{key:"m:val",value:e}}}),Ir=({characters:e})=>new T({name:"m:dPr",children:e?[wv({character:e.beginningCharacter}),gv({character:e.endingCharacter})]:[]}),yv=class extends b{constructor(e){super("m:d"),this.root.push(Ir({})),this.root.push(ye({children:e.children}))}},bv=class extends b{constructor(e){super("m:d"),this.root.push(Ir({characters:{beginningCharacter:"[",endingCharacter:"]"}})),this.root.push(ye({children:e.children}))}},Tv=class extends b{constructor(e){super("m:d"),this.root.push(Ir({characters:{beginningCharacter:"{",endingCharacter:"}"}})),this.root.push(ye({children:e.children}))}},Ev=class extends b{constructor(e){super("m:d"),this.root.push(Ir({characters:{beginningCharacter:"\u27E8",endingCharacter:"\u27E9"}})),this.root.push(ye({children:e.children}))}},Mo={TOP:"top",CENTER:"center",BOTTOM:"bottom"},Fo=w(w({},Mo),{},{BOTH:"both"}),xv=Fo,ts=e=>new T({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:e}}}),$o=({space:e,count:t,separate:r,equalWidth:n,children:s})=>new T({name:"w:cols",attributes:{space:{key:"w:space",value:e===void 0?void 0:Q(e)},count:{key:"w:num",value:t===void 0?void 0:G(t)},separate:{key:"w:sep",value:r},equalWidth:{key:"w:equalWidth",value:n}},children:!n&&s?s:void 0}),Sv={DEFAULT:"default",LINES:"lines",LINES_AND_CHARS:"linesAndChars",SNAP_TO_CHARS:"snapToChars"},Ho=({type:e,linePitch:t,charSpace:r})=>new T({name:"w:docGrid",attributes:{type:{key:"w:type",value:e},linePitch:{key:"w:linePitch",value:G(t)},charSpace:{key:"w:charSpace",value:r?G(r):void 0}}}),vt={DEFAULT:"default",FIRST:"first",EVEN:"even"},rs={HEADER:"w:headerReference",FOOTER:"w:footerReference"},Cr=(e,t)=>new T({name:e,attributes:{type:{key:"w:type",value:t.type||vt.DEFAULT},id:{key:"r:id",value:`rId${t.id}`}}}),Av={NEW_PAGE:"newPage",NEW_SECTION:"newSection",CONTINUOUS:"continuous"},Bo=({countBy:e,start:t,restart:r,distance:n})=>new T({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:e===void 0?void 0:G(e)},start:{key:"w:start",value:t===void 0?void 0:G(t)},restart:{key:"w:restart",value:r},distance:{key:"w:distance",value:n===void 0?void 0:Q(n)}}}),Iv={PAGE_BOTTOM:"pageBottom",BENEATH_TEXT:"beneathText",SECTION_END:"sectEnd",DOCUMENT_END:"docEnd"},Cv={SECTION_END:"sectEnd",DOCUMENT_END:"docEnd"},Nv={CONTINUOUS:"continuous",EACH_SECTION:"eachSect",EACH_PAGE:"eachPage"},Wo=({name:e,position:t,numberFormat:r,start:n,restart:s})=>new T({name:e,children:[...t===void 0?[]:[new T({name:"w:pos",attributes:{val:{key:"w:val",value:t}}})],...r?[new T({name:"w:numFmt",attributes:{val:{key:"w:val",value:r.type},format:{key:"w:format",value:r.format}}})]:[],...n===void 0?[]:[new T({name:"w:numStart",attributes:{val:{key:"w:val",value:G(n)}}})],...s===void 0?[]:[new T({name:"w:numRestart",attributes:{val:{key:"w:val",value:s}}})]]}),Uo=e=>Wo(w({name:"w:footnotePr"},e)),Go=e=>Wo(w({name:"w:endnotePr"},e)),Rv={ALL_PAGES:"allPages",FIRST_PAGE:"firstPage",NOT_FIRST_PAGE:"notFirstPage"},kv={PAGE:"page",TEXT:"text"},Pv={BACK:"back",FRONT:"front"},Vo=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},jo=class extends $e{constructor(e){if(super("w:pgBorders"),!e)return this;e.pageBorders?this.root.push(new Vo({display:e.pageBorders.display,offsetFrom:e.pageBorders.offsetFrom,zOrder:e.pageBorders.zOrder})):this.root.push(new Vo({})),e.pageBorderTop&&this.root.push(ee("w:top",e.pageBorderTop)),e.pageBorderLeft&&this.root.push(ee("w:left",e.pageBorderLeft)),e.pageBorderBottom&&this.root.push(ee("w:bottom",e.pageBorderBottom)),e.pageBorderRight&&this.root.push(ee("w:right",e.pageBorderRight))}},Xo=(e,t,r,n,s,a,i)=>new T({name:"w:pgMar",attributes:{top:{key:"w:top",value:Ne(e)},right:{key:"w:right",value:Q(t)},bottom:{key:"w:bottom",value:Ne(r)},left:{key:"w:left",value:Q(n)},header:{key:"w:header",value:Q(s)},footer:{key:"w:footer",value:Q(a)},gutter:{key:"w:gutter",value:Q(i)}}}),Ko={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},zo=({start:e,formatType:t,separator:r,chapterHeadingLevel:n})=>new T({name:"w:pgNumType",attributes:{start:{key:"w:start",value:e===void 0?void 0:G(e)},formatType:{key:"w:fmt",value:t},separator:{key:"w:chapSep",value:r===Ko.EN_DASH?"enDash":r},chapterHeadingLevel:{key:"w:chapStyle",value:n===void 0?void 0:G(n)}}}),qt={PORTRAIT:"portrait",LANDSCAPE:"landscape"},qo=({width:e,height:t,orientation:r,code:n})=>{const s=Q(e),a=Q(t);return new T({name:"w:pgSz",attributes:{width:{key:"w:w",value:r===qt.LANDSCAPE?a:s},height:{key:"w:h",value:r===qt.LANDSCAPE?s:a},orientation:{key:"w:orient",value:r},code:{key:"w:code",value:n}}})},Ov={LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"},Lv=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},Yo=class extends b{constructor(e){super("w:textDirection"),this.root.push(new Lv({val:e}))}},_v={NEXT_PAGE:"nextPage",NEXT_COLUMN:"nextColumn",CONTINUOUS:"continuous",EVEN_PAGE:"evenPage",ODD_PAGE:"oddPage"},Jo=e=>new T({name:"w:type",attributes:{val:{key:"w:val",value:e}}}),Oe={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},Yt={WIDTH:11906,HEIGHT:16838,ORIENTATION:qt.PORTRAIT},Nr=class Uu extends b{constructor({page:{size:{width:t=Yt.WIDTH,height:r=Yt.HEIGHT,orientation:n=Yt.ORIENTATION,code:s}={},margin:{top:a=Oe.TOP,right:i=Oe.RIGHT,bottom:o=Oe.BOTTOM,left:c=Oe.LEFT,header:l=Oe.HEADER,footer:u=Oe.FOOTER,gutter:d=Oe.GUTTER}={},pageNumbers:m={},borders:g,textDirection:p}={},grid:{linePitch:f=360,charSpace:y,type:I}={},headerWrapperGroup:C={},footerWrapperGroup:E={},lineNumbers:P,titlePage:L,verticalAlign:S,column:x,type:A,footnoteProperties:N,endnoteProperties:k,revision:D}={}){super("w:sectPr"),v(this,"availableTextWidth",void 0),this.availableTextWidth=Uu.calculateAvailableTextWidth({pageWidth:n===qt.LANDSCAPE?r:t,left:c,right:i,gutter:d,column:x}),this.addHeaderFooterGroup(rs.HEADER,C),this.addHeaderFooterGroup(rs.FOOTER,E),N&&this.root.push(Uo(N)),k&&this.root.push(Go(k)),A&&this.root.push(Jo(A)),this.root.push(qo({width:t,height:r,orientation:n,code:s})),this.root.push(Xo(a,i,o,c,l,u,d)),g&&this.root.push(new jo(g)),P&&this.root.push(Bo(P)),this.root.push(zo(m)),x&&this.root.push($o(x)),S&&this.root.push(ts(S)),L!==void 0&&this.root.push(new R("w:titlePg",L)),p&&this.root.push(new Yo(p)),this.root.push(Ho({linePitch:f,charSpace:y,type:I})),D&&this.root.push(new Zo(D))}get AvailableTextWidth(){return this.availableTextWidth}static calculateAvailableTextWidth({pageWidth:t,left:r,right:n,gutter:s,column:a}){var i,o;const c=Ye(t)-Ye(r)-Ye(n)-Ye(s),l=(i=a?.count)!==null&&i!==void 0?i:1;return l<=1?c:(c-Ye((o=a?.space)!==null&&o!==void 0?o:720)*(l-1))/l}addHeaderFooterGroup(t,r){r.default&&this.root.push(Cr(t,{type:vt.DEFAULT,id:r.default.View.ReferenceId})),r.first&&this.root.push(Cr(t,{type:vt.FIRST,id:r.first.View.ReferenceId})),r.even&&this.root.push(Cr(t,{type:vt.EVEN,id:r.even.View.ReferenceId}))}},Zo=class extends b{constructor(e){super("w:sectPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.root.push(new Nr(e))}},ns=class extends b{constructor({pageNumbers:e}={}){super("w:body"),v(this,"sections",[]),v(this,"sectionParagraphs",new Map),v(this,"headingBookmarkIds",new xm),v(this,"pageNumbers",void 0),this.pageNumbers=e}getSectionPropertiesFor(e){const t=e?Math.max(this.root.indexOf(e),0):0;for(let r=t;r<this.root.length;r++){const n=this.root[r];if(n instanceof Nr)return n;const s=this.sectionParagraphs.get(n);if(s)return s}return this.sections[this.sections.length-1]}addSection(e){const t=this.sections.pop(),r=this.lastParagraphOfSection();if(t&&r)this.sectionParagraphs.set(r,t);else{const n=this.createSectionParagraph();this.root.push(n),t&&this.sectionParagraphs.set(n,t)}this.sections.push(new Nr(e))}prepForXml(e){var t;this.sections.length===1&&(this.root.splice(0,1),this.root.push(this.sections.pop()));for(const[s,a]of this.sectionParagraphs)s.addSectionProperties(a);let r;try{r=super.prepForXml(e)}finally{for(const[s,a]of this.sectionParagraphs)s.removeSectionProperties(a)}const n=(t=this.pageNumbers)===null||t===void 0?void 0:t.listNumbers;return $m(r,e,this.headingBookmarkIds,n&&(s=>n(s,e))),this.pageNumbers&&(ro(r,e),no(r,e,this.pageNumbers)),r}push(e){const t=e instanceof ue?this.sectionParagraphs.get(e):void 0;if(t){const r=this.createSectionParagraph();this.root.splice(this.root.indexOf(e)+1,0,r),this.sectionParagraphs.delete(e),this.sectionParagraphs.set(r,t)}this.root.push(e)}lastParagraphOfSection(){const e=this.root[this.root.length-1];return e instanceof ue&&e!==this.root[0]&&!this.sectionParagraphs.has(e)&&this.root.indexOf(e)===this.root.length-1?e:void 0}createSectionParagraph(){return new ue({})}},Ve={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},Pt=(e,{type:t=Ve.AUTO,size:r})=>{let n=r;return t===Ve.PERCENTAGE&&typeof r=="number"&&(n=Math.round(r*50)),new T({name:e,attributes:{type:{key:"w:type",value:t},size:{key:"w:w",value:on(n)}}})},Rr=Yt.WIDTH-Oe.LEFT-Oe.RIGHT-Oe.GUTTER,Qo=e=>e.options.columnSpan||1,ss=(e,t)=>{if(!e)return;const{type:r=Ve.AUTO,size:n}=e;if(r!==Ve.PERCENTAGE&&r!==Ve.DXA)return;const s=typeof n=="number"?r===Ve.PERCENTAGE?n/100*t:n:n.endsWith("%")?Number(n.slice(0,-1))/100*t:Ye(n);return s>0?s:void 0},Dv=(e,t)=>{var r;return(r=ss(e,t))!==null&&r!==void 0?r:t},Mv=e=>Math.max(0,...e.map(t=>t.cells.reduce((r,n)=>r+Qo(n),0))),el=({rows:e,width:t,availableWidth:r})=>{const n=Mv(e);if(n===0)return[];const s=Dv(t,r),a=Array.from({length:n},()=>{}),i=[];for(const u of e){let d=0;for(const m of u.cells){const g=Qo(m),p=ss(m.options.width,s);if(p!==void 0)if(g===1){var o,c;(c=a[o=d])!==null&&c!==void 0||(a[o]=p)}else i.push({start:d,span:g,width:p});d+=g}}for(const{start:u,span:d,width:m}of i){const g=Array.from({length:d},(y,I)=>u+I).filter(y=>y<n),p=g.filter(y=>a[y]===void 0),f=m-g.reduce((y,I)=>{var C;return y+((C=a[I])!==null&&C!==void 0?C:0)},0);if(p.length>0&&f>0)for(const y of p)a[y]=f/p.length}const l=a.flatMap((u,d)=>u===void 0?[d]:[]);if(l.length>0){const u=s-a.reduce((m,g)=>m+(g??0),0),d=u>0?u/l.length:s/n;for(const m of l)a[m]=d}return a.map(u=>Math.round(u))},Fv=e=>new T({name:"w:gridCol",attributes:e!==void 0?{width:{key:"w:w",value:Q(e)}}:void 0}),kr=class extends b{constructor(e,t){super("w:tblGrid");for(const r of e)this.root.push(Fv(r));t&&this.root.push(new Hv(t))}},$v=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Hv=class extends b{constructor(e){super("w:tblGridChange"),this.root.push(new $v({id:e.id})),this.root.push(new kr(e.columnWidths))}},Bv=class extends b{constructor(e){super("w:ins"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.addChildElement(new We(e))}},Wv=class extends b{constructor(){super("w:delInstrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("PAGE")}},Uv=class extends b{constructor(){super("w:delInstrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("NUMPAGES")}},Gv=class extends b{constructor(){super("w:delInstrText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push("SECTIONPAGES")}},tl=class extends b{constructor(e){super("w:delText"),this.root.push(new we({space:ve.PRESERVE})),this.root.push(e)}},Vv=e=>{switch(e){case at.CURRENT:return[Je(),new Wv,ke(),xe()];case at.TOTAL_PAGES:return[Je(),new Uv,ke(),xe()];case at.TOTAL_PAGES_IN_SECTION:return[Je(),new Gv,ke(),xe()];default:return}},jv=class extends b{constructor(e){super("w:del"),v(this,"deletedTextRunWrapper",void 0),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.deletedTextRunWrapper=new Xv(e),this.addChildElement(this.deletedTextRunWrapper)}},Xv=class wa extends b{constructor(t){if(super("w:r"),v(this,"following",[]),this.root.push(new Be(t)),t.children)for(const[r,n]of t.children.entries()){if(n instanceof te){const s=t.children.slice(r+1);this.following=[n,...s.length>0?[new wa(w(w({},t),{},{break:void 0,children:s}))]:[]];break}if(typeof n=="string"){const s=Vv(n);if(s){const a=t.children.slice(r+1),i=l=>new wa(w(w({},t),{},{break:void 0,children:l})),o=this.root.length===1;o&&this.root.push(s[0]);const c=o?s.slice(1):s;this.following=[...c.map(l=>i([l])),...a.length>0?[i(a)]:[]];break}this.root.push(new tl(n));continue}this.root.push(n)}else t.text&&this.root.push(new tl(t.text));if(t.break)for(let r=0;r<t.break;r++)this.root.splice(1,0,Ga())}get writtenAs(){return this.following.length>0?[this,...this.following.flatMap(t=>{var r;return(r=t.writtenAs)!==null&&r!==void 0?r:t})]:void 0}},rl=class extends b{constructor(e){super("w:ins"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},nl=class extends b{constructor(e){super("w:del"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},sl=class extends b{constructor(e){super("w:cellIns"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},al=class extends b{constructor(e){super("w:cellDel"),this.root.push(new ge({id:e.id,author:e.author,date:e.date}))}},Kv={CONTINUE:"cont",RESTART:"rest"},il=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}},ol=class extends b{constructor(e){super("w:cellMerge"),this.root.push(new il(e))}},ll=({marginUnitType:e=Ve.DXA,top:t,left:r,bottom:n,right:s})=>[{name:"w:top",size:t},{name:"w:left",size:r},{name:"w:bottom",size:n},{name:"w:right",size:s}].filter(a=>a.size!==void 0).map(({name:a,size:i})=>Pt(a,{type:e,size:i})),zv=e=>{const t=ll(e);if(t.length!==0)return new T({name:"w:tblCellMar",children:t})},qv=e=>{const t=ll(e);if(t.length!==0)return new T({name:"w:tcMar",children:t})},cl=class extends $e{constructor(e){super("w:tcBorders"),e.top&&this.root.push(ee("w:top",e.top)),e.start&&this.root.push(ee("w:start",e.start)),e.left&&this.root.push(ee("w:left",e.left)),e.bottom&&this.root.push(ee("w:bottom",e.bottom)),e.end&&this.root.push(ee("w:end",e.end)),e.right&&this.root.push(ee("w:right",e.right)),e.diagonalDown&&this.root.push(ee("w:tl2br",e.diagonalDown)),e.diagonalUp&&this.root.push(ee("w:tr2bl",e.diagonalUp))}},Yv=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},ul=class extends b{constructor(e){super("w:gridSpan"),this.root.push(new Yv({val:G(e)}))}},as={CONTINUE:"continue",RESTART:"restart"},Jv=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},is=class extends b{constructor(e){super("w:vMerge"),this.root.push(new Jv({val:e}))}},Zv={BOTTOM_TO_TOP_LEFT_TO_RIGHT:"btLr",LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"},Qv=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},dl=class extends b{constructor(e){super("w:textDirection"),this.root.push(new Qv({val:e}))}},hl=class extends $e{constructor(e){if(super("w:tcPr",e.includeIfEmpty),v(this,"hasWidth",void 0),v(this,"hasColumnWidth",!1),this.hasWidth=e.width!==void 0,e.width&&this.root.push(Pt("w:tcW",e.width)),e.columnSpan&&this.root.push(new ul(e.columnSpan)),e.verticalMerge?this.root.push(new is(e.verticalMerge)):e.rowSpan&&e.rowSpan>1&&this.root.push(new is(as.RESTART)),e.borders&&this.root.push(new cl(e.borders)),e.shading&&this.root.push(Wt(e.shading)),e.margins){const t=qv(e.margins);t&&this.root.push(t)}e.textDirection&&this.root.push(new dl(e.textDirection)),e.verticalAlign&&this.root.push(ts(e.verticalAlign)),e.insertion&&this.root.push(new sl(e.insertion)),e.deletion&&this.root.push(new al(e.deletion)),e.cellMerge&&this.root.push(new ol(e.cellMerge)),e.revision&&this.root.push(new ef(e.revision))}setColumnWidth(e){this.hasWidth||(this.root.splice(0,this.hasColumnWidth?1:0,Pt("w:tcW",{size:e,type:Ve.DXA})),this.hasColumnWidth=!0)}},ef=class extends b{constructor(e){super("w:tcPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.root.push(new hl(w(w({},e),{},{includeIfEmpty:!0})))}},os=class extends b{constructor(e){super("w:tc"),v(this,"options",void 0),v(this,"properties",void 0),this.options=e,this.properties=new hl(e),this.root.push(this.properties);for(const t of e.children)this.root.push(t)}setColumnWidth(e){this.properties.setColumnWidth(e)}prepForXml(e){return Tt(this.root[this.root.length-1])!=="w:p"&&this.root.push(new ue({})),super.prepForXml(e)}},ls=(e,t)=>t?new R(e):new Re(e,"off"),Ot={style:pr.NONE,size:0,color:"auto"},tf={style:pr.SINGLE,size:4,color:"auto"},cs=class extends $e{constructor(e,{fillMissingSides:t=!0}={}){super("w:tblBorders");const r=[["w:top",e.top],["w:left",e.left],["w:bottom",e.bottom],["w:right",e.right],["w:insideH",e.insideHorizontal],["w:insideV",e.insideVertical]];for(const[n,s]of r){const a=s??(t?tf:void 0);a&&this.root.push(ee(n,a))}}};v(cs,"NONE",{top:Ot,bottom:Ot,left:Ot,right:Ot,insideHorizontal:Ot,insideVertical:Ot});var rf={MARGIN:"margin",PAGE:"page",TEXT:"text"},Pr={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},ml={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},nf={NEVER:"never",OVERLAP:"overlap"},pl=({horizontalAnchor:e,verticalAnchor:t,absoluteHorizontalPosition:r,relativeHorizontalPosition:n,absoluteVerticalPosition:s,relativeVerticalPosition:a,bottomFromText:i,topFromText:o,leftFromText:c,rightFromText:l})=>new T({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:c===void 0?void 0:Q(c)},rightFromText:{key:"w:rightFromText",value:l===void 0?void 0:Q(l)},topFromText:{key:"w:topFromText",value:o===void 0?void 0:Q(o)},bottomFromText:{key:"w:bottomFromText",value:i===void 0?void 0:Q(i)},absoluteHorizontalPosition:{key:"w:tblpX",value:r===void 0?void 0:Ne(r)},absoluteVerticalPosition:{key:"w:tblpY",value:s===void 0?void 0:Ne(s)},horizontalAnchor:{key:"w:horzAnchor",value:e},relativeHorizontalPosition:{key:"w:tblpXSpec",value:n},relativeVerticalPosition:{key:"w:tblpYSpec",value:a},verticalAnchor:{key:"w:vertAnchor",value:t}}}),sf={AUTOFIT:"autofit",FIXED:"fixed"},vl=e=>new T({name:"w:tblLayout",attributes:{type:{key:"w:type",value:e}}}),af={DXA:"dxa",NIL:"nil"},fl=({type:e=af.DXA,value:t})=>new T({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:e},value:{key:"w:w",value:on(t)}}}),wl=({firstRow:e,lastRow:t,firstColumn:r,lastColumn:n,noHBand:s,noVBand:a})=>new T({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:e},lastRow:{key:"w:lastRow",value:t},firstColumn:{key:"w:firstColumn",value:r},lastColumn:{key:"w:lastColumn",value:n},noHBand:{key:"w:noHBand",value:s},noVBand:{key:"w:noVBand",value:a}}}),of=e=>new T({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:e}}}),lf={[Pr.LEFT]:ce.LEFT,[Pr.CENTER]:ce.CENTER,[Pr.RIGHT]:ce.RIGHT},Or=class extends $e{constructor(e){var t,r,n;super("w:tblPr",e.includeIfEmpty),e.style&&this.root.push(new Re("w:tblStyle",e.style));const s=((t=e.float)===null||t===void 0?void 0:t.relativeVerticalPosition)===ml.INLINE,a=s?void 0:e.float;a&&this.root.push(pl(a)),a?.overlap&&this.root.push(of(a.overlap)),e.visuallyRightToLeft!==void 0&&this.root.push(ls("w:bidiVisual",e.visuallyRightToLeft)),e.width&&this.root.push(Pt("w:tblW",e.width));const i=(r=e.alignment)!==null&&r!==void 0?r:s&&(!((n=e.float)===null||n===void 0)&&n.relativeHorizontalPosition)?lf[e.float.relativeHorizontalPosition]:void 0;if(i&&this.root.push(ln(i)),e.cellSpacing&&this.root.push(fl(e.cellSpacing)),e.indent&&this.root.push(Pt("w:tblInd",e.indent)),e.borders&&this.root.push(new cs(e.borders,{fillMissingSides:!e.style})),e.shading&&this.root.push(Wt(e.shading)),e.layout&&this.root.push(vl(e.layout)),e.cellMargin){const o=zv(e.cellMargin);o&&this.root.push(o)}e.tableLook&&this.root.push(wl(e.tableLook)),e.revision&&this.root.push(new cf(e.revision))}},cf=class extends b{constructor(e){super("w:tblPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.root.push(new Or(w(w({},e),{},{includeIfEmpty:!0})))}},uf={AUTO:"auto",ATLEAST:"atLeast",EXACT:"exact"},gl=(e,t)=>new T({name:"w:trHeight",attributes:{value:{key:"w:val",value:Q(e)},rule:{key:"w:hRule",value:t}}}),us=class extends $e{constructor(e){super("w:trPr",e.includeIfEmpty),e.cantSplit!==void 0&&this.root.push(ls("w:cantSplit",e.cantSplit)),e.tableHeader!==void 0&&this.root.push(ls("w:tblHeader",e.tableHeader)),e.height&&this.root.push(gl(e.height.value,e.height.rule)),e.cellSpacing&&this.root.push(fl(e.cellSpacing)),e.insertion&&this.root.push(new rl(e.insertion)),e.deletion&&this.root.push(new nl(e.deletion)),e.revision&&this.root.push(new yl(e.revision))}},yl=class extends b{constructor(e){super("w:trPrChange"),this.root.push(new ge({id:e.id,author:e.author,date:e.date})),this.root.push(new us(w(w({},e),{},{includeIfEmpty:!0})))}},Lr=(e,t)=>{const r=e[t];return Array.isArray(r)?r:[]},Jt=e=>Object.keys(e)[0],df=(e,t)=>{const r=Lr(e,"w:p"),n=r.find(o=>Jt(o)==="w:pPr");if(!n)return{"w:p":[{"w:pPr":[t]},...r]};const s=Lr(n,"w:pPr");if(s.some(o=>Jt(o)==="w:keepNext"))return e;const a=s.filter(o=>Jt(o)==="w:pStyle").length,i={"w:pPr":[...s.slice(0,a),t,...s.slice(a)]};return{"w:p":r.map(o=>o===n?i:o)}},bl=class extends b{constructor(e){super("w:tr"),v(this,"options",void 0),this.options=e,this.root.push(new us(e));for(const t of e.children)this.root.push(t)}prepForXml(e){if(this.cells.length===0)return;const t=super.prepForXml(e);if(!t||this.options.keepNext===void 0)return t;const r=new R("w:keepNext",this.options.keepNext).prepForXml(e);return{"w:tr":Lr(t,"w:tr").map(n=>Jt(n)==="w:tc"?{"w:tc":Lr(n,"w:tc").map(s=>Jt(s)==="w:p"?df(s,r):s)}:n)}}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(e=>Tt(e)==="w:tc")}addCellToIndex(e,t){this.root.splice(t+1,0,e)}addCellToColumnIndex(e,t){const r=this.columnIndexToRootIndex(t,!0);this.addCellToIndex(e,r-1)}rootIndexToColumnIndex(e){if(e<1||e>=this.root.length)throw new Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let t=0;for(let r=1;r<e;r++){const n=this.root[r];t+=n.options.columnSpan||1}return t}columnIndexToRootIndex(e,t=!1){if(e<0)throw new Error("cell 'columnIndex' should not less than zero");let r=0,n=1;for(;r<=e;){if(n>=this.root.length){if(t)return this.root.length;throw new Error(`cell 'columnIndex' should not great than ${r-1}`)}const s=this.root[n];n+=1,r+=s&&s.options.columnSpan||1}return n-1}},hf=class Gu extends zt{constructor({rows:t,width:r,columnWidths:n,columnWidthsRevision:s,margins:a,indent:i,float:o,layout:c,style:l,borders:u,alignment:d,visuallyRightToLeft:m,tableLook:g,cellSpacing:p,revision:f}){super("w:tbl"),v(this,"rows",void 0),v(this,"width",void 0),v(this,"columnWidths",void 0),v(this,"columnWidthsRevision",void 0),v(this,"resolvedColumnWidths",void 0),this.rows=t,this.width=r??{size:100},this.columnWidths=n,this.columnWidthsRevision=s,t.forEach((y,I)=>{if(I===t.length-1)return;let C=0;y.cells.forEach(E=>{if(E.options.rowSpan&&E.options.rowSpan>1){const P=E.options.children[E.options.children.length-1],L=new os({rowSpan:E.options.rowSpan-1,columnSpan:E.options.columnSpan,width:E.options.width,borders:E.options.borders,shading:E.options.shading,margins:E.options.margins,textDirection:E.options.textDirection,verticalAlign:E.options.verticalAlign,children:P instanceof ue?[new ue(P.Alignment)]:[],verticalMerge:as.CONTINUE});t[I+1].addCellToColumnIndex(L,C)}C+=E.options.columnSpan||1})}),this.setCellWidths(Rr),this.resolvedColumnWidths=n??el({rows:t,width:this.width,availableWidth:Rr}),this.root.push(new Or({borders:l?u:u??{},width:this.width,indent:i,float:o,layout:c,style:l,alignment:d,cellMargin:a,visuallyRightToLeft:m,tableLook:g,cellSpacing:p,revision:f})),this.root.push(new kr(this.resolvedColumnWidths,s));for(const y of t)this.root.push(y)}get ColumnWidths(){return this.resolvedColumnWidths}getCellWidth(t,r){const{cells:n}=t,s=n.indexOf(r);if(s===-1)return;const a=n.slice(0,s).reduce((o,c)=>o+(c.options.columnSpan||1),0),i=this.resolvedColumnWidths.slice(a,a+(r.options.columnSpan||1));return i.length===0?void 0:i.reduce((o,c)=>o+c,0)}prepForXml(t){if(this.setCellWidths(this.resolveAvailableWidth(t)),this.columnWidths===void 0){this.resolvedColumnWidths=el({rows:this.rows,width:this.width,availableWidth:this.resolveAvailableWidth(t)});const r=this.root.findIndex(n=>n instanceof kr);this.root[r]=new kr(this.resolvedColumnWidths,this.columnWidthsRevision)}return super.prepForXml(t)}setCellWidths(t){var r;if(this.columnWidths===void 0)return;const n=this.columnWidths.reduce((i,o)=>i+o,0),s=(r=ss(this.width,t))!==null&&r!==void 0?r:0,a=n>0&&s>n?s/n:1;for(const i of this.rows){let o=0;for(const c of i.cells){const l=c.options.columnSpan||1,u=this.columnWidths.slice(o,o+l),d=Math.round(u.reduce((m,g)=>m+g,0)*a);u.length===l&&d>0&&c.setColumnWidth(d),o+=l}}}resolveAvailableWidth(t){var r,n,s;const{stack:a}=t,i=a[a.length-1],o=a[a.length-2],c=a[a.length-3];if(i instanceof os&&o instanceof bl&&c instanceof Gu){const m=c.getCellWidth(o,i);if(m!==void 0)return m}const l=a.findIndex(m=>m instanceof ns),u=(r=t.file)===null||r===void 0||(r=r.Document)===null||r===void 0?void 0:r.View.Body,d=l>=0?a[l].getSectionPropertiesFor((n=a[l+1])!==null&&n!==void 0?n:this):u?.getSectionPropertiesFor();return(s=d?.AvailableTextWidth)!==null&&s!==void 0?s:Rr}},mf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},pf=class extends b{constructor(){super("Properties"),this.root.push(new mf({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},vf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns"})}},Qe=(e,t)=>new T({name:"Default",attributes:{contentType:{key:"ContentType",value:e},extension:{key:"Extension",value:t}}}),ae=(e,t)=>new T({name:"Override",attributes:{contentType:{key:"ContentType",value:e},partName:{key:"PartName",value:t}}}),ff=class extends b{constructor({macros:e=!1}={}){super("Types"),this.root.push(new vf({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(Qe("image/png","png")),this.root.push(Qe("image/jpeg","jpeg")),this.root.push(Qe("image/jpeg","jpg")),this.root.push(Qe("image/bmp","bmp")),this.root.push(Qe("image/gif","gif")),this.root.push(Qe("image/svg+xml","svg")),this.root.push(Qe("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(Qe("application/xml","xml")),this.root.push(Qe("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(ae(e?"application/vnd.ms-word.document.macroEnabled.main+xml":"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(ae("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml")),this.root.push(ae("application/vnd.openxmlformats-officedocument.theme+xml","/word/theme/theme1.xml")),e&&this.root.push(ae("application/vnd.ms-office.vbaProject","/word/vbaProject.bin"))}addComments(){this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml"))}addCommentsExtended(){this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addCommentsIds(){this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml","/word/commentsIds.xml"))}addFooter(e){this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${e}.xml`))}addOverride(e,t){this.root.push(ae(e,t))}addHeader(e){this.root.push(ae("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${e}.xml`))}},_r={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Zt=class extends _{constructor(e,t){super(w({Ignorable:t},Object.fromEntries(e.map(r=>[r,_r[r]])))),v(this,"xmlKeys",w({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(_r).map(r=>[r,`xmlns:${r}`]))))}},wf=class extends b{constructor(e){super("cp:coreProperties"),this.root.push(new Zt(["cp","dc","dcterms","dcmitype","xsi"])),e.title&&this.root.push(new st("dc:title",e.title)),e.subject&&this.root.push(new st("dc:subject",e.subject)),e.creator&&this.root.push(new st("dc:creator",e.creator)),e.keywords&&this.root.push(new st("cp:keywords",e.keywords)),e.description&&this.root.push(new st("dc:description",e.description)),e.lastModifiedBy&&this.root.push(new st("cp:lastModifiedBy",e.lastModifiedBy)),e.revision&&this.root.push(new st("cp:revision",String(e.revision))),this.root.push(new Tl("dcterms:created")),this.root.push(new Tl("dcterms:modified"))}},gf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{type:"xsi:type"})}},Tl=class extends b{constructor(e){super(e),this.root.push(new gf({type:"dcterms:W3CDTF"})),this.root.push(La(new Date))}},yf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},bf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},Tf=class extends b{constructor(e,t){super("property"),this.root.push(new bf({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:e.toString(),name:t.name})),this.root.push(new Ef(t.value))}},Ef=class extends b{constructor(e){super("vt:lpwstr"),this.root.push(e)}},xf=class extends b{constructor(e){super("Properties"),v(this,"nextId",void 0),v(this,"properties",[]),this.root.push(new yf({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(const t of e)this.addCustomProperty(t)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.properties),super.prepForXml(e)}addCustomProperty(e){this.properties.push(new Tf(this.nextId++,e))}},Sf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{width:"w:w",space:"w:space"})}},Af=class extends b{constructor(e){super("w:col"),this.root.push(new Sf({width:Q(e.width),space:e.space===void 0?void 0:Q(e.space)}))}},If=e=>new T({name:"ds:datastoreItem",attributes:{itemId:{key:"ds:itemID",value:e},namespace:{key:"xmlns:ds",value:"http://schemas.openxmlformats.org/officeDocument/2006/customXml"}},children:[new T({name:"ds:schemaRefs",children:[new T({name:"ds:schemaRef",attributes:{uri:{key:"ds:uri",value:"http://schemas.openxmlformats.org/officeDocument/2006/bibliography"}}})]})]}),Cf={new:"wne:eventDocNew",open:"wne:eventDocOpen",close:"wne:eventDocClose",sync:"wne:eventDocSync",xmlAfterInsert:"wne:eventDocXmlAfterInsert",xmlBeforeDelete:"wne:eventDocXmlBeforeDelete",contentControlAfterAdd:"wne:eventDocContentControlAfterInsert",contentControlBeforeDelete:"wne:eventDocContentControlBeforeDelete",contentControlOnExit:"wne:eventDocContentControlOnExit",contentControlOnEnter:"wne:eventDocContentControlOnEnter",contentControlBeforeStoreUpdate:"wne:eventDocStoreUpdate",contentControlBeforeContentUpdate:"wne:eventDocContentControlContentUpdate",buildingBlockInsert:"wne:eventDocBuildingBlockAfterInsert"},Nf=e=>new T({name:"wne:vbaSuppData",attributes:{namespace:{key:"xmlns:wne",value:"http://schemas.microsoft.com/office/word/2006/wordml"}},children:[new T({name:"wne:docEvents",children:Object.entries(Cf).filter(([t])=>e.includes(t)).map(([,t])=>new T({name:t}))})]}),Rf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}},El=class extends b{constructor({color:e,themeColor:t,themeShade:r,themeTint:n}){if(super("w:background"),typeof e=="object"&&(t!==void 0||r!==void 0||n!==void 0))throw new Error("Invalid background. Expected a theme color in color, or themeColor, themeShade and themeTint, not both");this.root.push(new dn([{keys:Bt,color:e},{key:"w:themeColor",value:t},{key:"w:themeShade",value:r===void 0?void 0:nn(r)},{key:"w:themeTint",value:n===void 0?void 0:nn(n)}]))}},kf=class extends b{constructor(e){super("w:document"),v(this,"body",void 0),this.root.push(new Zt(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new ns({pageNumbers:e.pageNumbers}),e.background&&this.root.push(new El(e.background)),this.root.push(this.body)}add(e){return this.body.push(e),this}get Body(){return this.body}},Pf=class{constructor(e){v(this,"document",void 0),v(this,"relationships",void 0),this.document=new kf(e),this.relationships=new se}get View(){return this.document}get Relationships(){return this.relationships}},Of=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},xl=class extends b{constructor(e,t){super("w:p"),v(this,"paragraph",void 0),v(this,"mark",void 0),this.paragraph=e,this.mark=t}prepForXml(e){const t=this.paragraph.prepForXml(e)["w:p"],r=Array.isArray(t)?t:[],n=r.length>0&&"w:pPr"in r[0]?1:0;return{"w:p":[...r.slice(0,n),this.mark.prepForXml(e),...r.slice(n)]}}},Lf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{type:"w:type",id:"w:id"})}},Sl=class extends te{constructor(){super({style:"EndnoteReference"}),this.root.push(new lo)}},Al={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},ds=class extends b{constructor(e){super("w:endnote"),this.root.push(new Lf({type:e.type,id:e.id}));for(const[t,r]of e.children.entries())this.root.push(t===0?new xl(r,new Sl):r)}},_f=class extends b{constructor(){super("w:continuationSeparator")}},Il=class extends te{constructor(){super({}),this.root.push(new _f)}},Df=class extends b{constructor(){super("w:separator")}},Cl=class extends te{constructor(){super({}),this.root.push(new Df)}},hs=class extends b{constructor(){super("w:endnotes"),v(this,"ownNotes",new Map),v(this,"highestId",0),this.root.push(new Of({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const e=new ds({id:-1,type:Al.SEPARATOR,children:[new ue({spacing:{after:0,line:240,lineRule:pt.AUTO},children:[new Cl]})]});this.root.push(e);const t=new ds({id:0,type:Al.CONTINUATION_SEPARATOR,children:[new ue({spacing:{after:0,line:240,lineRule:pt.AUTO},children:[new Il]})]});this.root.push(t)}createEndnote(e,t){const r=new ds({id:e,children:t});this.root.push(r),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,r){if(r.viewWrapper!==r.file.Document)return;const n=this.ownNotes.get(e);if(n!==void 0)return n;const s=this.highestId+1;return this.createEndnote(s,t.children),this.ownNotes.set(e,s),s}prepForXml(e){const t=super.prepForXml(e);return It(t,e),t}},Mf=class{constructor(){v(this,"endnotes",void 0),v(this,"relationships",void 0),this.endnotes=new hs,this.relationships=new se}get View(){return this.endnotes}get Relationships(){return this.relationships}},Ff=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}},$f=class extends rn{constructor(e,t){super("w:ftr",t),v(this,"refId",void 0),this.refId=e,t||this.root.push(new Ff({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){const t=super.prepForXml(e);return It(t,e,this.refId),t}},Nl=class{constructor(e,t,r){v(this,"media",void 0),v(this,"footer",void 0),v(this,"relationships",void 0),this.media=e,this.footer=new $f(t,r),this.relationships=new se}add(e){this.footer.add(e)}addChildElement(e){this.footer.addChildElement(e)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}},Hf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{type:"w:type",id:"w:id"})}},Bf=class extends b{constructor(){super("w:footnoteRef")}},Rl=class extends te{constructor(){super({style:"FootnoteReference"}),this.root.push(new Bf)}},kl={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"},ms=class extends b{constructor(e){super("w:footnote"),this.root.push(new Hf({type:e.type,id:e.id}));for(const[t,r]of e.children.entries())this.root.push(t===0?new xl(r,new Rl):r)}},Wf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},ps=class extends b{constructor(){super("w:footnotes"),v(this,"ownNotes",new Map),v(this,"highestId",0),this.root.push(new Wf({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));const e=new ms({id:-1,type:kl.SEPERATOR,children:[new ue({spacing:{after:0,line:240,lineRule:pt.AUTO},children:[new Cl]})]});this.root.push(e);const t=new ms({id:0,type:kl.CONTINUATION_SEPERATOR,children:[new ue({spacing:{after:0,line:240,lineRule:pt.AUTO},children:[new Il]})]});this.root.push(t)}createFootNote(e,t){const r=new ms({id:e,children:t});this.root.push(r),Number.isFinite(e)&&(this.highestId=Math.max(this.highestId,Math.floor(e)))}idOf(e,t,r){if(r.viewWrapper!==r.file.Document)return;const n=this.ownNotes.get(e);if(n!==void 0)return n;const s=this.highestId+1;return this.createFootNote(s,t.children),this.ownNotes.set(e,s),s}prepForXml(e){const t=super.prepForXml(e);return It(t,e),t}},Uf=class{constructor(){v(this,"footnotess",void 0),v(this,"relationships",void 0),this.footnotess=new ps,this.relationships=new se}get View(){return this.footnotess}get Relationships(){return this.relationships}},Gf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}},Vf=class extends rn{constructor(e,t){super("w:hdr",t),v(this,"refId",void 0),this.refId=e,t||this.root.push(new Gf({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(e){this.root.push(e)}prepForXml(e){const t=super.prepForXml(e);return It(t,e,this.refId),t}},Pl=class{constructor(e,t,r){v(this,"media",void 0),v(this,"header",void 0),v(this,"relationships",void 0),this.media=e,this.header=new Vf(t,r),this.relationships=new se}add(e){return this.header.add(e),this}addChildElement(e){this.header.addChildElement(e)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}},jf=()=>{const e=new Map;return t=>{var r;const n=((r=e.get(t))!==null&&r!==void 0?r:0)+1;return e.set(t,n),`media/image${n}.${t}`}},vs=class{constructor(e=jf()){v(this,"map",new Map),v(this,"takePath",void 0),this.takePath=e}addImage(e,t){if(this.map.has(e))return;const r=this.takePath(t.type);this.map.set(e,w(w({},t),{},{fileName:r.slice(r.lastIndexOf("/")+1)}))}get Array(){return Array.from(this.map.values())}get Entries(){return Array.from(this.map.entries())}},je={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"},Xf=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w:tentative"})}},Kf=class extends b{constructor(e){super("w:numFmt"),this.root.push(new le({val:e}))}},zf=class extends b{constructor(e){super("w:lvlText"),this.root.push(new le({val:e}))}},qf=e=>{switch(e){case ce.CENTER:return"center";case ce.END:case ce.RIGHT:return"right";default:return"left"}},Yf=class extends b{constructor(e){super("w:lvlJc"),this.root.push(new le({val:qf(e)}))}},Jf={NOTHING:"nothing",SPACE:"space",TAB:"tab"},Zf=class extends b{constructor(e){super("w:suff"),this.root.push(new le({val:e}))}},Qf=class extends b{constructor(){super("w:isLgl")}},fs=class extends b{constructor({level:e,format:t,text:r,alignment:n=ce.START,start:s=1,style:a,suffix:i,isLegalNumberingStyle:o}){if(super("w:lvl"),v(this,"paragraphProperties",void 0),v(this,"runProperties",void 0),this.root.push(new St("w:start",G(s))),t&&this.root.push(new Kf(t)),a?.style&&this.root.push(Ct(a.style)),o&&this.root.push(new Qf),i&&this.root.push(new Zf(i)),r&&this.root.push(new zf(r)),this.root.push(new Yf(n)),this.paragraphProperties=new it(a&&a.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new Be(a?.run&&w(w({},a.run),{},{highlight:void 0,math:void 0,revision:void 0})),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),e>9)throw new Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new Xf({ilvl:G(e),tentative:1}))}},Ol=class extends fs{},ew=class extends fs{},tw=class extends b{constructor(e){super("w:multiLevelType"),this.root.push(new le({val:e}))}},rw=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},Dr=class extends b{constructor(e,t){super("w:abstractNum"),v(this,"id",void 0),this.root.push(new rw({abstractNumId:G(e),restartNumberingAfterBreak:0})),this.root.push(new tw("hybridMultilevel")),this.id=e;for(const r of t)this.root.push(new Ol(r))}},nw=class extends b{constructor(e){super("w:abstractNumId"),this.root.push(new le({val:e}))}},sw=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{numId:"w:numId"})}},ws=class extends b{constructor(e){if(super("w:num"),v(this,"numId",void 0),v(this,"reference",void 0),v(this,"instance",void 0),v(this,"restartedListId",void 0),this.numId=e.numId,this.reference=e.reference,this.instance=e.instance,this.restartedListId=e.restartedListId,this.root.push(new sw({numId:G(e.numId)})),this.root.push(new nw(G(e.abstractNumId))),e.overrideLevels&&e.overrideLevels.length)for(const t of e.overrideLevels)this.root.push(new Ll(t.num,t.start))}},aw=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{ilvl:"w:ilvl"})}},Ll=class extends b{constructor(e,t){super("w:lvlOverride"),this.root.push(new aw({ilvl:e})),t!==void 0&&this.root.push(new ow(t))}},iw=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},ow=class extends b{constructor(e){super("w:startOverride"),this.root.push(new iw({val:e}))}},gs=class extends b{constructor(e){super("w:numbering"),v(this,"abstractNumberingMap",new Map),v(this,"concreteNumberingMap",new Map),v(this,"referenceConfigMap",new Map),v(this,"abstractNumUniqueNumericId",Ya()),v(this,"concreteNumUniqueNumericId",Ja()),this.root.push(new Zt(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));const t=new Dr(this.abstractNumUniqueNumericId(),[{level:0,format:je.BULLET,text:"\u25CF",alignment:ce.LEFT,style:{paragraph:{indent:{left:Se(.5),hanging:Se(.25)}}}},{level:1,format:je.BULLET,text:"\u25CB",alignment:ce.LEFT,style:{paragraph:{indent:{left:Se(1),hanging:Se(.25)}}}},{level:2,format:je.BULLET,text:"\u25A0",alignment:ce.LEFT,style:{paragraph:{indent:{left:2160,hanging:Se(.25)}}}},{level:3,format:je.BULLET,text:"\u25CF",alignment:ce.LEFT,style:{paragraph:{indent:{left:2880,hanging:Se(.25)}}}},{level:4,format:je.BULLET,text:"\u25CB",alignment:ce.LEFT,style:{paragraph:{indent:{left:3600,hanging:Se(.25)}}}},{level:5,format:je.BULLET,text:"\u25A0",alignment:ce.LEFT,style:{paragraph:{indent:{left:4320,hanging:Se(.25)}}}},{level:6,format:je.BULLET,text:"\u25CF",alignment:ce.LEFT,style:{paragraph:{indent:{left:5040,hanging:Se(.25)}}}},{level:7,format:je.BULLET,text:"\u25CF",alignment:ce.LEFT,style:{paragraph:{indent:{left:5760,hanging:Se(.25)}}}},{level:8,format:je.BULLET,text:"\u25CF",alignment:ce.LEFT,style:{paragraph:{indent:{left:6480,hanging:Se(.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new ws({numId:1,abstractNumId:t.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",t);for(const r of e.config)this.abstractNumberingMap.set(r.reference,new Dr(this.abstractNumUniqueNumericId(),r.levels)),this.referenceConfigMap.set(r.reference,r.levels)}prepForXml(e){return this.root.splice(1,this.root.length-1,...this.abstractNumberingMap.values(),...this.concreteNumberingMap.values()),super.prepForXml(e)}createConcreteNumberingInstance(e,t,r,n){var s;r&&!this.abstractNumberingMap.has(r.reference)&&(this.abstractNumberingMap.set(r.reference,new Dr(this.abstractNumUniqueNumericId(),r.levels)),this.referenceConfigMap.set(r.reference,r.levels));const a=this.abstractNumberingMap.get(e);if(!a)return;const i=xr(e,t,n);if(this.concreteNumberingMap.has(i))return;const o=(s=this.referenceConfigMap.get(e))!==null&&s!==void 0?s:[{level:0}],c={numId:this.concreteNumUniqueNumericId(),abstractNumId:a.id,reference:e,instance:t,restartedListId:n,overrideLevels:o.map(({level:l,start:u=1})=>({num:l,start:G(u)}))};this.concreteNumberingMap.set(i,new ws(c))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},ys=/^[\w-]+$/,lw=new Set(["_rels","fonts","theme"]),_l=class{constructor(e){if(v(this,"options",void 0),v(this,"id",Ze()),v(this,"relationshipId",`rId${this.id}`),v(this,"addedTo",new WeakSet),this.options=e,!ys.test(e.folder)||lw.has(e.folder))throw new Error(`Invalid package part folder "${e.folder}". Expected a folder name docx doesn't use, such as "charts"`);if(!ys.test(e.name))throw new Error(`Invalid package part name "${e.name}". Expected letters, digits, "_" and "-", such as "chart"`);if(!ys.test(e.extension))throw new Error(`Invalid package part extension "${e.extension}". Expected letters, digits, "_" and "-", such as "xml"`)}addTo(e){const t=e.file.PackageParts,r=t.add(this),n=e.viewWrapper.Relationships;this.addedTo.has(n)||(this.addedTo.add(n),n.addRelationship(this.id,this.options.relationshipType,t.getTarget(n,r)))}},Dl=class{constructor(e,t=new Set){v(this,"contentTypes",void 0),v(this,"paths",new Map),v(this,"taken",void 0),v(this,"folders",new WeakMap),this.contentTypes=e,this.taken=new Set(t)}add(e){const t=this.paths.get(e);if(t!==void 0)return t;const{folder:r,name:n,extension:s,contentType:a}=e.options,i=this.takePath(r,n,s);return this.paths.set(e,i),this.contentTypes.addOverride(a,`/word/${i}`),i}takePath(e,t,r){let n=1;for(;this.taken.has(`${e}/${t}${n}.${r}`);)n++;const s=`${e}/${t}${n}.${r}`;return this.taken.add(s),s}get Array(){return[...this.paths].map(([e,t])=>({part:e,path:t}))}createRelationships(e){const t=new se;return this.folders.set(t,e.slice(0,e.indexOf("/"))),t}getTarget(e,t){const r=this.folders.get(e);return r===void 0?t:t.startsWith(`${r}/`)?t.slice(r.length+1):`../${t}`}},cw=e=>new T({name:"w:compatSetting",attributes:{version:{key:"w:val",value:e},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),uw=class extends b{constructor(e){super("w:compat"),e.useSingleBorderforContiguousCells&&this.root.push(new R("w:useSingleBorderforContiguousCells",e.useSingleBorderforContiguousCells)),e.wordPerfectJustification&&this.root.push(new R("w:wpJustification",e.wordPerfectJustification)),e.noTabStopForHangingIndent&&this.root.push(new R("w:noTabHangInd",e.noTabStopForHangingIndent)),e.noLeading&&this.root.push(new R("w:noLeading",e.noLeading)),e.spaceForUnderline&&this.root.push(new R("w:spaceForUL",e.spaceForUnderline)),e.noColumnBalance&&this.root.push(new R("w:noColumnBalance",e.noColumnBalance)),e.balanceSingleByteDoubleByteWidth&&this.root.push(new R("w:balanceSingleByteDoubleByteWidth",e.balanceSingleByteDoubleByteWidth)),e.noExtraLineSpacing&&this.root.push(new R("w:noExtraLineSpacing",e.noExtraLineSpacing)),e.doNotLeaveBackslashAlone&&this.root.push(new R("w:doNotLeaveBackslashAlone",e.doNotLeaveBackslashAlone)),e.underlineTrailingSpaces&&this.root.push(new R("w:ulTrailSpace",e.underlineTrailingSpaces)),e.doNotExpandShiftReturn&&this.root.push(new R("w:doNotExpandShiftReturn",e.doNotExpandShiftReturn)),e.spacingInWholePoints&&this.root.push(new R("w:spacingInWholePoints",e.spacingInWholePoints)),e.lineWrapLikeWord6&&this.root.push(new R("w:lineWrapLikeWord6",e.lineWrapLikeWord6)),e.printBodyTextBeforeHeader&&this.root.push(new R("w:printBodyTextBeforeHeader",e.printBodyTextBeforeHeader)),e.printColorsBlack&&this.root.push(new R("w:printColBlack",e.printColorsBlack)),e.spaceWidth&&this.root.push(new R("w:wpSpaceWidth",e.spaceWidth)),e.showBreaksInFrames&&this.root.push(new R("w:showBreaksInFrames",e.showBreaksInFrames)),e.subFontBySize&&this.root.push(new R("w:subFontBySize",e.subFontBySize)),e.suppressBottomSpacing&&this.root.push(new R("w:suppressBottomSpacing",e.suppressBottomSpacing)),e.suppressTopSpacing&&this.root.push(new R("w:suppressTopSpacing",e.suppressTopSpacing)),e.suppressSpacingAtTopOfPage&&this.root.push(new R("w:suppressSpacingAtTopOfPage",e.suppressSpacingAtTopOfPage)),e.suppressTopSpacingWP&&this.root.push(new R("w:suppressTopSpacingWP",e.suppressTopSpacingWP)),e.suppressSpBfAfterPgBrk&&this.root.push(new R("w:suppressSpBfAfterPgBrk",e.suppressSpBfAfterPgBrk)),e.swapBordersFacingPages&&this.root.push(new R("w:swapBordersFacingPages",e.swapBordersFacingPages)),e.convertMailMergeEsc&&this.root.push(new R("w:convMailMergeEsc",e.convertMailMergeEsc)),e.truncateFontHeightsLikeWP6&&this.root.push(new R("w:truncateFontHeightsLikeWP6",e.truncateFontHeightsLikeWP6)),e.macWordSmallCaps&&this.root.push(new R("w:mwSmallCaps",e.macWordSmallCaps)),e.usePrinterMetrics&&this.root.push(new R("w:usePrinterMetrics",e.usePrinterMetrics)),e.doNotSuppressParagraphBorders&&this.root.push(new R("w:doNotSuppressParagraphBorders",e.doNotSuppressParagraphBorders)),e.wrapTrailSpaces&&this.root.push(new R("w:wrapTrailSpaces",e.wrapTrailSpaces)),e.footnoteLayoutLikeWW8&&this.root.push(new R("w:footnoteLayoutLikeWW8",e.footnoteLayoutLikeWW8)),e.shapeLayoutLikeWW8&&this.root.push(new R("w:shapeLayoutLikeWW8",e.shapeLayoutLikeWW8)),e.alignTablesRowByRow&&this.root.push(new R("w:alignTablesRowByRow",e.alignTablesRowByRow)),e.forgetLastTabAlignment&&this.root.push(new R("w:forgetLastTabAlignment",e.forgetLastTabAlignment)),e.adjustLineHeightInTable&&this.root.push(new R("w:adjustLineHeightInTable",e.adjustLineHeightInTable)),e.autoSpaceLikeWord95&&this.root.push(new R("w:autoSpaceLikeWord95",e.autoSpaceLikeWord95)),e.noSpaceRaiseLower&&this.root.push(new R("w:noSpaceRaiseLower",e.noSpaceRaiseLower)),e.doNotUseHTMLParagraphAutoSpacing&&this.root.push(new R("w:doNotUseHTMLParagraphAutoSpacing",e.doNotUseHTMLParagraphAutoSpacing)),e.layoutRawTableWidth&&this.root.push(new R("w:layoutRawTableWidth",e.layoutRawTableWidth)),e.layoutTableRowsApart&&this.root.push(new R("w:layoutTableRowsApart",e.layoutTableRowsApart)),e.useWord97LineBreakRules&&this.root.push(new R("w:useWord97LineBreakRules",e.useWord97LineBreakRules)),e.doNotBreakWrappedTables&&this.root.push(new R("w:doNotBreakWrappedTables",e.doNotBreakWrappedTables)),e.doNotSnapToGridInCell&&this.root.push(new R("w:doNotSnapToGridInCell",e.doNotSnapToGridInCell)),e.selectFieldWithFirstOrLastCharacter&&this.root.push(new R("w:selectFldWithFirstOrLastChar",e.selectFieldWithFirstOrLastCharacter)),e.applyBreakingRules&&this.root.push(new R("w:applyBreakingRules",e.applyBreakingRules)),e.doNotWrapTextWithPunctuation&&this.root.push(new R("w:doNotWrapTextWithPunct",e.doNotWrapTextWithPunctuation)),e.doNotUseEastAsianBreakRules&&this.root.push(new R("w:doNotUseEastAsianBreakRules",e.doNotUseEastAsianBreakRules)),e.useWord2002TableStyleRules&&this.root.push(new R("w:useWord2002TableStyleRules",e.useWord2002TableStyleRules)),e.growAutofit&&this.root.push(new R("w:growAutofit",e.growAutofit)),e.useFELayout&&this.root.push(new R("w:useFELayout",e.useFELayout)),e.useNormalStyleForList&&this.root.push(new R("w:useNormalStyleForList",e.useNormalStyleForList)),e.doNotUseIndentAsNumberingTabStop&&this.root.push(new R("w:doNotUseIndentAsNumberingTabStop",e.doNotUseIndentAsNumberingTabStop)),e.useAlternateEastAsianLineBreakRules&&this.root.push(new R("w:useAltKinsokuLineBreakRules",e.useAlternateEastAsianLineBreakRules)),e.allowSpaceOfSameStyleInTable&&this.root.push(new R("w:allowSpaceOfSameStyleInTable",e.allowSpaceOfSameStyleInTable)),e.doNotSuppressIndentation&&this.root.push(new R("w:doNotSuppressIndentation",e.doNotSuppressIndentation)),e.doNotAutofitConstrainedTables&&this.root.push(new R("w:doNotAutofitConstrainedTables",e.doNotAutofitConstrainedTables)),e.autofitToFirstFixedWidthCell&&this.root.push(new R("w:autofitToFirstFixedWidthCell",e.autofitToFirstFixedWidthCell)),e.underlineTabInNumberingList&&this.root.push(new R("w:underlineTabInNumList",e.underlineTabInNumberingList)),e.displayHangulFixedWidth&&this.root.push(new R("w:displayHangulFixedWidth",e.displayHangulFixedWidth)),e.splitPgBreakAndParaMark&&this.root.push(new R("w:splitPgBreakAndParaMark",e.splitPgBreakAndParaMark)),e.doNotVerticallyAlignCellWithSp&&this.root.push(new R("w:doNotVertAlignCellWithSp",e.doNotVerticallyAlignCellWithSp)),e.doNotBreakConstrainedForcedTable&&this.root.push(new R("w:doNotBreakConstrainedForcedTable",e.doNotBreakConstrainedForcedTable)),e.ignoreVerticalAlignmentInTextboxes&&this.root.push(new R("w:doNotVertAlignInTxbx",e.ignoreVerticalAlignmentInTextboxes)),e.useAnsiKerningPairs&&this.root.push(new R("w:useAnsiKerningPairs",e.useAnsiKerningPairs)),e.cachedColumnBalance&&this.root.push(new R("w:cachedColBalance",e.cachedColumnBalance)),e.version&&this.root.push(cw(e.version))}},Ml=1e5,Fl=15,dw=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],hw=[[44796,19929,39858,10053,20106,40212,10761],[31585,63170,64933,60267,50935,40399,11199],[17763,35526,1453,2906,5812,11624,23248],[885,1770,3540,7080,14160,28320,56640],[55369,41139,20807,41614,21821,43642,17621],[28485,56970,44341,19019,38038,14605,29210],[60195,50791,40175,10751,21502,43004,24537],[18387,36774,3949,7898,15796,31592,63184],[47201,24803,49606,37805,14203,28406,56812],[17824,35648,1697,3394,6788,13576,27152],[43601,17539,35078,557,1114,2228,4456],[30388,60776,51953,34243,7079,14158,28316],[14128,28256,56512,43425,17251,34502,7597],[13105,26210,52420,35241,883,1766,3532],[4129,8258,16516,33032,4657,9314,18628]],$l=e=>e>>14&1|e<<1&32767,mw=e=>{const t=e.slice(0,Fl).split("").map(s=>{const a=s.charCodeAt(0);return(a&255)!==0?a&255:a>>8&255}),r=t.reduce((s,a,i)=>hw[Fl-t.length+i].reduce((o,c,l)=>a>>l&1?o^c:o,s),dw[t.length-1]),n=($l(t.reduceRight((s,a)=>$l(s)^a,0))^t.length^52811)&65535;return[n&255,n>>8,r&255,r>>8].map(s=>s.toString(16).toUpperCase().padStart(2,"0")).join("")},pw=(e,t,r)=>{const n=[...mw(e)].flatMap(o=>[o.charCodeAt(0),0]);let s=qa(Uint8Array.from([...t,...n]));const a=new Uint8Array(s.length+4),i=new DataView(a.buffer);for(let o=0;o<r;o++)a.set(s),i.setUint32(s.length,o,!0),s=qa(a);return Array.from(s)},vw=e=>{var t;const r=new Uint8Array(e);return typeof((t=globalThis.crypto)===null||t===void 0?void 0:t.getRandomValues)=="function"?(globalThis.crypto.getRandomValues(r),[...r]):[...r].map(()=>Math.floor(Math.random()*256))},fw={READ_ONLY:"readOnly",COMMENTS:"comments",TRACKED_CHANGES:"trackedChanges",FORMS:"forms"},Hl=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{edit:"w:edit",enforcement:"w:enforcement",cryptProviderType:"w:cryptProviderType",cryptAlgorithmClass:"w:cryptAlgorithmClass",cryptAlgorithmType:"w:cryptAlgorithmType",cryptAlgorithmSid:"w:cryptAlgorithmSid",cryptSpinCount:"w:cryptSpinCount",hash:"w:hash",salt:"w:salt"})}},Bl=e=>btoa(String.fromCharCode(...e)),ww=class extends b{constructor({type:e,password:t}){if(super("w:documentProtection"),t===void 0||t===""){this.root.push(new Hl({edit:e,enforcement:!0}));return}const r=vw(16);this.root.push(new Hl({edit:e,enforcement:!0,cryptProviderType:"rsaAES",cryptAlgorithmClass:"hash",cryptAlgorithmType:"typeAny",cryptAlgorithmSid:12,cryptSpinCount:Ml,hash:Bl(pw(t,r,Ml)),salt:Bl(r)}))}},gw=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},yw=class extends b{constructor(e){var t,r,n,s,a,i,o,c,l;super("w:settings"),this.root.push(new gw({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new R("w:displayBackgroundShape",!0)),e.embedFonts!==void 0&&this.root.push(new R("w:embedTrueTypeFonts",e.embedFonts)),e.trackRevisions!==void 0&&this.root.push(new R("w:trackRevisions",e.trackRevisions)),e.protection!==void 0&&this.root.push(new ww(e.protection)),this.root.push(new St("w:defaultTabStop",(t=e.defaultTabStop)!==null&&t!==void 0?t:720)),((r=e.hyphenation)===null||r===void 0?void 0:r.autoHyphenation)!==void 0&&this.root.push(new R("w:autoHyphenation",e.hyphenation.autoHyphenation)),((n=e.hyphenation)===null||n===void 0?void 0:n.consecutiveHyphenLimit)!==void 0&&this.root.push(new St("w:consecutiveHyphenLimit",e.hyphenation.consecutiveHyphenLimit)),((s=e.hyphenation)===null||s===void 0?void 0:s.hyphenationZone)!==void 0&&this.root.push(new St("w:hyphenationZone",e.hyphenation.hyphenationZone)),((a=e.hyphenation)===null||a===void 0?void 0:a.doNotHyphenateCaps)!==void 0&&this.root.push(new R("w:doNotHyphenateCaps",e.hyphenation.doNotHyphenateCaps)),e.evenAndOddHeaders!==void 0&&this.root.push(new R("w:evenAndOddHeaders",e.evenAndOddHeaders)),e.updateFields!==void 0&&this.root.push(new R("w:updateFields",e.updateFields)),this.root.push(new uw(w(w({},(i=e.compatibility)!==null&&i!==void 0?i:{}),{},{version:(o=(c=(l=e.compatibility)===null||l===void 0?void 0:l.version)!==null&&c!==void 0?c:e.compatibilityModeVersion)!==null&&o!==void 0?o:15})))}},Wl=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w:val"})}},bw=class extends b{constructor(e){super("w:name"),this.root.push(new Wl({val:e}))}},Tw=class extends b{constructor(e){super("w:uiPriority"),this.root.push(new Wl({val:G(e)}))}},Ew=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},bs=class extends b{constructor(e,t){super("w:style"),this.root.push(new Ew(e)),t.name&&this.root.push(new bw(t.name)),t.basedOn&&t.basedOn!==e.styleId&&this.root.push(new Re("w:basedOn",t.basedOn)),t.next&&this.root.push(new Re("w:next",t.next)),t.link&&this.root.push(new Re("w:link",t.link)),t.uiPriority!==void 0&&this.root.push(new Tw(t.uiPriority)),t.semiHidden!==void 0&&this.root.push(new R("w:semiHidden",t.semiHidden)),t.unhideWhenUsed!==void 0&&this.root.push(new R("w:unhideWhenUsed",t.unhideWhenUsed)),t.quickFormat!==void 0&&this.root.push(new R("w:qFormat",t.quickFormat))}},Xe=class extends bs{constructor(e){super({type:"paragraph",styleId:e.id},e),v(this,"paragraphProperties",void 0),v(this,"runProperties",void 0),this.paragraphProperties=new it(e.paragraph,{implicitListParagraphStyle:!1,inListOrder:!1}),this.runProperties=new Be(e.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},ot=class extends bs{constructor(e){super({type:"character",styleId:e.id},w({uiPriority:99,unhideWhenUsed:!0},e)),v(this,"runProperties",void 0),this.runProperties=new Be(e.run),this.root.push(this.runProperties)}},lt=class extends Xe{constructor(e){super(w({basedOn:"Normal",next:"Normal",quickFormat:!0},e))}},xw=class extends lt{constructor(e){super(w({id:"Title",name:"Title"},e))}},Sw=class extends lt{constructor(e){super(w({id:"Heading1",name:"Heading 1"},e))}},Aw=class extends lt{constructor(e){super(w({id:"Heading2",name:"Heading 2"},e))}},Iw=class extends lt{constructor(e){super(w({id:"Heading3",name:"Heading 3"},e))}},Cw=class extends lt{constructor(e){super(w({id:"Heading4",name:"Heading 4"},e))}},Nw=class extends lt{constructor(e){super(w({id:"Heading5",name:"Heading 5"},e))}},Rw=class extends lt{constructor(e){super(w({id:"Heading6",name:"Heading 6"},e))}},kw=class extends lt{constructor(e){super(w({id:"Strong",name:"Strong"},e))}},Pw=class extends Xe{constructor(e){super(w({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},e))}},Ow=class extends Xe{constructor(e){super(w({id:"Caption",name:"caption",basedOn:"Normal",next:"Normal",uiPriority:35,semiHidden:!0,unhideWhenUsed:!0,quickFormat:!0,paragraph:{spacing:{after:200}},run:{italics:!0,color:{theme:"dark2"},size:18}},e))}},Lw=class extends Xe{constructor(e){super(w({id:"Bibliography",name:"Bibliography",basedOn:"Normal",next:"Normal",uiPriority:37,unhideWhenUsed:!0},e))}},Ul=new WeakSet,Gl=e=>Ul.has(e),et=class extends Xe{constructor(e,t){super({id:`TOC${e}`,name:`toc ${e}`,basedOn:"Normal",next:"Normal",uiPriority:39,semiHidden:!0,unhideWhenUsed:!0,paragraph:w({spacing:{after:100}},e>1?{indent:{left:(e-1)*t}}:{})})}prepForXml(e){const t=super.prepForXml(e);return Ul.add(t),t}},Vl=class extends Xe{constructor(e){super(w({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:pt.AUTO}},run:{size:20}},e))}},jl=class extends ot{constructor(e){super(w({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},Xl=class extends ot{constructor(e){super(w({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},e))}},Kl=class extends Xe{constructor(e){super(w({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:pt.AUTO}},run:{size:20}},e))}},zl=class extends ot{constructor(e){super(w({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},e))}},ql=class extends ot{constructor(e){super(w({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},e))}},_w=class extends ot{constructor(e){super(w({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:En.SINGLE}}},e))}},Dw=class extends ot{constructor(e){super(w({id:"LineNumber",name:"line number",basedOn:"DefaultParagraphFont",semiHidden:!0},e))}},Mw=class extends bs{constructor(){super({type:"table",styleId:"TableNormal",default:!0},{name:"Normal Table",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0}),this.root.push(new Or({indent:{size:0,type:Ve.DXA},cellMargin:{top:0,left:108,bottom:0,right:108}}))}},Qt=e=>typeof e=="object"?Object.keys(e)[0]:void 0,Ts=e=>{var t;return(t=[e["w:style"]].flat().find(r=>r._attr))===null||t===void 0?void 0:t._attr},Yl=e=>{var t;return(t=Ts(e))===null||t===void 0?void 0:t["w:styleId"]},Jl=e=>{var t;const r=(t=[e["w:style"]].flat().find(n=>Qt(n)==="w:name"))===null||t===void 0||(t=t["w:name"])===null||t===void 0||(t=t._attr)===null||t===void 0?void 0:t["w:val"];return r===void 0?void 0:String(r).toLowerCase()},Es=e=>{var t,r;return Qt(e)==="w:style"&&((t=(r=Ts(e))===null||r===void 0?void 0:r["w:type"])!==null&&t!==void 0?t:"paragraph")==="paragraph"},Fw=e=>{const t=Es(e)?Ts(e):void 0;return t?.["w:default"]!==void 0&&!["0","false","off"].includes(String(t["w:default"]))},$w=e=>({"w:style":[e["w:style"]].flat().map(t=>t._attr?{_attr:w(w({},t._attr),{},{"w:default":"1"})}:t)}),Mr=class extends b{constructor(e){if(super("w:styles"),e.initialStyles&&this.root.push(e.initialStyles),e.importedStyles)for(const t of e.importedStyles)this.root.push(t);if(e.paragraphStyles)for(const t of e.paragraphStyles)this.root.push(new Xe(t));if(e.characterStyles)for(const t of e.characterStyles)this.root.push(new ot(t))}prepForXml(e){const t=super.prepForXml(e),r=t["w:styles"];if(!Array.isArray(r))return t;const n=l=>r.filter(u=>Qt(u)===l),s=r.map(l=>Qt(l)==="w:style"?Yl(l):void 0),a=r.filter((l,u)=>!["_attr","w:docDefaults","w:latentStyles"].includes(Qt(l))&&(s[u]===void 0||s.lastIndexOf(s[u])===u)),i=new Set(a.filter(l=>Es(l)&&!Gl(l)).map(Jl)),o=a.filter(l=>!Gl(l)||!i.has(Jl(l))),c=o.some(Fw)?o:o.map(l=>Es(l)&&Yl(l)==="Normal"?$w(l):l);return{"w:styles":[...n("_attr"),...n("w:docDefaults").slice(-1),...n("w:latentStyles").slice(-1),...c]}}},Zl=class extends b{constructor(e){super("w:pPrDefault"),this.root.push(new it(e,{implicitListParagraphStyle:!1,inListOrder:!1}))}},Ql=class extends b{constructor(e){super("w:rPrDefault"),this.root.push(new Be(e))}},ec=class extends b{constructor(e){super("w:docDefaults"),v(this,"runPropertiesDefaults",void 0),v(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new Ql(e.run),this.paragraphPropertiesDefaults=new Zl(e.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},Hw=class{newInstance(e){const t=Et(e);let r;for(const s of t.elements||[])s.name==="w:styles"&&(r=s);if(r===void 0)throw new Error("can not find styles element");const n=r.elements||[];return{initialStyles:new Ca(r.attributes),importedStyles:n.map(s=>dr(s))}}},Bw=e=>{var t;const r=(t=e.document)===null||t===void 0||(t=t.run)===null||t===void 0?void 0:t.size;return r===void 0?200:Math.round(typeof r=="number"?r*10:Ye(r))},Ww=e=>({tableOfContents1:new et(1,e),tableOfContents2:new et(2,e),tableOfContents3:new et(3,e),tableOfContents4:new et(4,e),tableOfContents5:new et(5,e),tableOfContents6:new et(6,e),tableOfContents7:new et(7,e),tableOfContents8:new et(8,e),tableOfContents9:new et(9,e)}),xs=(e={})=>{var t;return w(w({normal:new Xe({id:"Normal",name:"Normal",quickFormat:!0}),normalTable:new Mw,document:new ec((t=e.document)!==null&&t!==void 0?t:{}),title:new xw(w({run:{size:56}},e.title)),heading1:new Sw(w({run:{color:"2E74B5",size:32}},e.heading1)),heading2:new Aw(w({run:{color:"2E74B5",size:26}},e.heading2)),heading3:new Iw(w({run:{color:"1F4D78",size:24}},e.heading3)),heading4:new Cw(w({run:{color:"2E74B5",italics:!0}},e.heading4)),heading5:new Nw(w({run:{color:"2E74B5"}},e.heading5)),heading6:new Rw(w({run:{color:"1F4D78"}},e.heading6)),strong:new kw(w({run:{bold:!0}},e.strong)),listParagraph:new Pw(e.listParagraph||{}),caption:new Ow(e.caption||{}),bibliography:new Lw(e.bibliography||{})},Ww(Bw(e))),{},{hyperlink:new _w(e.hyperlink||{}),footnoteReference:new jl(e.footnoteReference||{}),footnoteText:new Vl(e.footnoteText||{}),footnoteTextChar:new Xl(e.footnoteTextChar||{}),endnoteReference:new zl(e.endnoteReference||{}),endnoteText:new Kl(e.endnoteText||{}),endnoteTextChar:new ql(e.endnoteTextChar||{}),lineNumber:new Dw(e.lineNumber||{})})},tc=class{newInstance(e={}){return{initialStyles:new Zt(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:Object.values(xs(e))}}},rc={headings:{latin:"Calibri Light",panose:"020F0302020204030204"},body:{latin:"Calibri",panose:"020F0502020204030204"}},Uw=[["Jpan","\u6E38\u30B4\u30B7\u30C3\u30AF Light","\u6E38\u660E\u671D"],["Hang","\uB9D1\uC740 \uACE0\uB515"],["Hans","\u7B49\u7EBF Light","\u7B49\u7EBF"],["Hant","\u65B0\u7D30\u660E\u9AD4"],["Arab","Times New Roman","Arial"],["Hebr","Times New Roman","Arial"],["Thai","Angsana New","Cordia New"],["Ethi","Nyala"],["Beng","Vrinda"],["Gujr","Shruti"],["Khmr","MoolBoran","DaunPenh"],["Knda","Tunga"],["Guru","Raavi"],["Cans","Euphemia"],["Cher","Plantagenet Cherokee"],["Yiii","Microsoft Yi Baiti"],["Tibt","Microsoft Himalaya"],["Thaa","MV Boli"],["Deva","Mangal"],["Telu","Gautami"],["Taml","Latha"],["Syrc","Estrangelo Edessa"],["Orya","Kalinga"],["Mlym","Kartika"],["Laoo","DokChampa"],["Sinh","Iskoola Pota"],["Mong","Mongolian Baiti"],["Viet","Times New Roman","Arial"],["Uigh","Microsoft Uighur"],["Geor","Sylfaen"],["Armn","Arial"],["Bugi","Leelawadee UI"],["Bopo","Microsoft JhengHei"],["Java","Javanese Text"],["Lisu","Segoe UI"],["Mymr","Myanmar Text"],["Nkoo","Ebrima"],["Olck","Nirmala UI"],["Osma","Ebrima"],["Phag","Phagspa"],["Syrn","Estrangelo Edessa"],["Syrj","Estrangelo Edessa"],["Syre","Estrangelo Edessa"],["Sora","Nirmala UI"],["Tale","Microsoft Tai Le"],["Talu","Microsoft New Tai Lue"],["Tfng","Ebrima"]],Ss=(e,t,r)=>new T({name:e,attributes:{typeface:{key:"typeface",value:t},panose:{key:"panose",value:r}}}),Gw=(e,t)=>{const r=t[e],n=typeof r=="string"?r:r?.latin;return n??rc[e].latin},Vw=(e,t={})=>{const r=Uw.map(([s,a,i=a])=>{var o;return[s,(o=t[s])!==null&&o!==void 0?o:e==="headings"?a:i]}),n=new Set(r.map(([s])=>s));return[...r,...Object.entries(t).filter(([s])=>!n.has(s))]},nc=(e,t)=>{const r=t[e],{eastAsia:n="",complexScript:s="",scripts:a}=typeof r=="object"?r:{},i=Gw(e,t),o=rc[e];return new T({name:e==="headings"?"a:majorFont":"a:minorFont",children:[Ss("a:latin",i,i===o.latin?o.panose:void 0),Ss("a:ea",n),Ss("a:cs",s),...Vw(e,a).map(([c,l])=>new T({name:"a:font",attributes:{script:{key:"script",value:c},typeface:{key:"typeface",value:l}}}))]})},jw=(e,t={})=>new T({name:"a:fontScheme",attributes:{name:{key:"name",value:e}},children:[nc("headings",t),nc("body",t)]}),sc=(e=[])=>new T({name:"a:schemeClr",attributes:{value:{key:"val",value:"phClr"}},children:e.map(([t,r])=>new T({name:`a:${t}`,attributes:{value:{key:"val",value:r}}}))}),Fr=e=>new T({name:"a:solidFill",children:[sc(e)]}),As=e=>new T({name:"a:gradFill",attributes:{rotateWithShape:{key:"rotWithShape",value:!0}},children:[new T({name:"a:gsLst",children:e.map((t,r)=>new T({name:"a:gs",attributes:{position:{key:"pos",value:r*5e4}},children:[sc(t)]}))}),new T({name:"a:lin",attributes:{angle:{key:"ang",value:54e5},scaled:{key:"scaled",value:!1}}})]}),Is=e=>new T({name:"a:ln",attributes:{width:{key:"w",value:e},cap:{key:"cap",value:"flat"},compound:{key:"cmpd",value:"sng"},alignment:{key:"algn",value:"ctr"}},children:[Fr(),new T({name:"a:prstDash",attributes:{value:{key:"val",value:"solid"}}}),new T({name:"a:miter",attributes:{limit:{key:"lim",value:8e5}}})]}),Cs=e=>new T({name:"a:effectStyle",children:[new T({name:"a:effectLst",children:e})]}),Xw=()=>new T({name:"a:outerShdw",attributes:{blurRadius:{key:"blurRad",value:57150},distance:{key:"dist",value:19050},direction:{key:"dir",value:54e5},alignment:{key:"algn",value:"ctr"},rotateWithShape:{key:"rotWithShape",value:!1}},children:[new T({name:"a:srgbClr",attributes:{value:{key:"val",value:"000000"}},children:[new T({name:"a:alpha",attributes:{value:{key:"val",value:63e3}}})]})]}),Kw=()=>new T({name:"a:fmtScheme",attributes:{name:{key:"name",value:"Office"}},children:[new T({name:"a:fillStyleLst",children:[Fr(),As([[["lumMod",11e4],["satMod",105e3],["tint",67e3]],[["lumMod",105e3],["satMod",103e3],["tint",73e3]],[["lumMod",105e3],["satMod",109e3],["tint",81e3]]]),As([[["satMod",103e3],["lumMod",102e3],["tint",94e3]],[["satMod",11e4],["lumMod",1e5],["shade",1e5]],[["lumMod",99e3],["satMod",12e4],["shade",78e3]]])]}),new T({name:"a:lnStyleLst",children:[Is(6350),Is(12700),Is(19050)]}),new T({name:"a:effectStyleLst",children:[Cs([]),Cs([]),Cs([Xw()])]}),new T({name:"a:bgFillStyleLst",children:[Fr(),Fr([["tint",95e3],["satMod",17e4]]),As([[["tint",93e3],["satMod",15e4],["shade",98e3],["lumMod",102e3]],[["tint",98e3],["satMod",13e4],["shade",9e4],["lumMod",103e3]],[["shade",63e3],["satMod",12e4]]])]})]}),ac=class extends b{constructor({name:e="Office Theme",colors:t,fonts:r}={}){super("a:theme"),v(this,"colors",void 0),this.colors=un(t),this.root.push(new Mt({namespace:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"},name:{key:"name",value:e}})),this.root.push(new T({name:"a:themeElements",children:[cd(t?e:"Office",t),jw(r?e:"Office",r),Kw()]})),this.root.push(new T({name:"a:objectDefaults"})),this.root.push(new T({name:"a:extraClrSchemeLst"}))}get Colors(){return this.colors}},Le=e=>{const t=e.lastIndexOf("/");return`${e.slice(0,t+1)}_rels/${e.slice(t+1)}.rels`},ic=e=>e.replace(/(^|\/)_rels\/([^/]*)\.rels$/,"$1$2"),oc=e=>e.slice(0,e.lastIndexOf("/")+1),ft=(e,t)=>{const r=t.replace(/\\/g,"/");return(r.startsWith("/")?r:`${oc(e)}${r}`).split("/").reduce((n,s)=>s===""||s==="."?n:s===".."?n.slice(0,-1):[...n,s],[]).join("/")},Ns=(e,t)=>{const r=oc(e).split("/").filter(Boolean),n=t.split("/"),s=r.findIndex((i,o)=>o>=n.length-1||n[o]!==i),a=s===-1?r.length:s;return[...r.slice(a).map(()=>".."),...n.slice(a)].join("/")},lc=(e,t)=>e.toLowerCase()===t.toLowerCase(),q=Uint8Array,Te=Uint16Array,Rs=Int32Array,$r=new q([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hr=new q([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ks=new q([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),cc=function(e,t){for(var r=new Te(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var s=new Rs(r[30]),n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)s[a]=a-r[n]<<5|n;return{b:r,r:s}},uc=cc($r,2),dc=uc.b,Ps=uc.r;dc[28]=258,Ps[258]=28;for(var hc=cc(Hr,0),zw=hc.b,mc=hc.r,Os=new Te(32768),W=0;W<32768;++W){var ct=(W&43690)>>1|(W&21845)<<1;ct=(ct&52428)>>2|(ct&13107)<<2,ct=(ct&61680)>>4|(ct&3855)<<4,Os[W]=((ct&65280)>>8|(ct&255)<<8)>>1}for(var Ke=(function(e,t,r){for(var n=e.length,s=0,a=new Te(t);s<n;++s)e[s]&&++a[e[s]-1];var i=new Te(t);for(s=1;s<t;++s)i[s]=i[s-1]+a[s-1]<<1;var o;if(r){o=new Te(1<<t);var c=15-t;for(s=0;s<n;++s)if(e[s])for(var l=s<<4|e[s],u=t-e[s],d=i[e[s]-1]++<<u,m=d|(1<<u)-1;d<=m;++d)o[Os[d]>>c]=l}else for(o=new Te(n),s=0;s<n;++s)e[s]&&(o[s]=Os[i[e[s]-1]++]>>15-e[s]);return o}),ut=new q(288),W=0;W<144;++W)ut[W]=8;for(var W=144;W<256;++W)ut[W]=9;for(var W=256;W<280;++W)ut[W]=7;for(var W=280;W<288;++W)ut[W]=8;for(var er=new q(32),W=0;W<32;++W)er[W]=5;var qw=Ke(ut,9,0),Yw=Ke(ut,9,1),Jw=Ke(er,5,0),Zw=Ke(er,5,1),Ls=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},_e=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},_s=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Ds=function(e){return(e+7)/8|0},tr=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new q(e.subarray(t,r))},Qw=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],fe=function(e,t,r){var n=new Error(t||Qw[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,fe),!r)throw n;return n},e0=function(e,t,r,n){var s=e.length,a=n?n.length:0;if(!s||t.f&&!t.l)return r||new q(0);var i=!r,o=i||t.i!=2,c=t.i;i&&(r=new q(s*3));var l=function(Z){var U=r.length;if(Z>U){var Ee=new q(Math.max(U*2,Z));Ee.set(r),r=Ee}},u=t.f||0,d=t.p||0,m=t.b||0,g=t.l,p=t.d,f=t.m,y=t.n,I=s*8;do{if(!g){u=_e(e,d,1);var C=_e(e,d+1,3);if(d+=3,C)if(C==1)g=Yw,p=Zw,f=9,y=5;else if(C==2){var S=_e(e,d,31)+257,x=_e(e,d+10,15)+4,A=S+_e(e,d+5,31)+1;d+=14;for(var N=new q(A),k=new q(19),D=0;D<x;++D)k[ks[D]]=_e(e,d+D*3,7);d+=x*3;for(var M=Ls(k),X=(1<<M)-1,Y=Ke(k,M,1),D=0;D<A;){var K=Y[_e(e,d,X)];d+=K&15;var E=K>>4;if(E<16)N[D++]=E;else{var z=0,B=0;for(E==16?(B=3+_e(e,d,3),d+=2,z=N[D-1]):E==17?(B=3+_e(e,d,7),d+=3):E==18&&(B=11+_e(e,d,127),d+=7);B--;)N[D++]=z}}var oe=N.subarray(0,S),re=N.subarray(S);f=Ls(oe),y=Ls(re),g=Ke(oe,f,1),p=Ke(re,y,1)}else fe(1);else{var E=Ds(d)+4,P=e[E-4]|e[E-3]<<8,L=E+P;if(L>s){c&&fe(0);break}o&&l(m+P),r.set(e.subarray(E,L),m),t.b=m+=P,t.p=d=L*8,t.f=u;continue}if(d>I){c&&fe(0);break}}o&&l(m+131072);for(var ht=(1<<f)-1,be=(1<<y)-1,Me=d;;Me=d){var z=g[_s(e,d)&ht],me=z>>4;if(d+=z&15,d>I){c&&fe(0);break}if(z||fe(2),me<256)r[m++]=me;else if(me==256){Me=d,g=null;break}else{var pe=me-254;if(me>264){var D=me-257,V=$r[D];pe=_e(e,d,(1<<V)-1)+dc[D],d+=V}var O=p[_s(e,d)&be],F=O>>4;O||fe(3),d+=O&15;var re=zw[F];if(F>3){var V=Hr[F];re+=_s(e,d)&(1<<V)-1,d+=V}if(d>I){c&&fe(0);break}o&&l(m+131072);var $=m+pe;if(m<re){var j=a-re,J=Math.min(re,$);for(j+m<0&&fe(3);m<J;++m)r[m]=n[j+m]}for(;m<$;++m)r[m]=r[m-re]}}t.l=g,t.p=Me,t.b=m,t.f=u,g&&(u=1,t.m=f,t.d=p,t.n=y)}while(!u);return m!=r.length&&i?tr(r,0,m):r.subarray(0,m)},tt=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},rr=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Ms=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var s=r.length,a=r.slice();if(!s)return{t:wc,l:0};if(s==1){var i=new q(r[0].s+1);return i[r[0].s]=1,{t:i,l:1}}r.sort(function(L,S){return L.f-S.f}),r.push({s:-1,f:25001});var o=r[0],c=r[1],l=0,u=1,d=2;for(r[0]={s:-1,f:o.f+c.f,l:o,r:c};u!=s-1;)o=r[r[l].f<r[d].f?l++:d++],c=r[l!=u&&r[l].f<r[d].f?l++:d++],r[u++]={s:-1,f:o.f+c.f,l:o,r:c};for(var m=a[0].s,n=1;n<s;++n)a[n].s>m&&(m=a[n].s);var g=new Te(m+1),p=Fs(r[u-1],g,0);if(p>t){var n=0,f=0,y=p-t,I=1<<y;for(a.sort(function(S,x){return g[x.s]-g[S.s]||S.f-x.f});n<s;++n){var C=a[n].s;if(g[C]>t)f+=I-(1<<p-g[C]),g[C]=t;else break}for(f>>=y;f>0;){var E=a[n].s;g[E]<t?f-=1<<t-g[E]++-1:++n}for(;n>=0&&f;--n){var P=a[n].s;g[P]==t&&(--g[P],++f)}p=t}return{t:new q(g),l:p}},Fs=function(e,t,r){return e.s==-1?Math.max(Fs(e.l,t,r+1),Fs(e.r,t,r+1)):t[e.s]=r},pc=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Te(++t),n=0,s=e[0],a=1,i=function(c){r[n++]=c},o=1;o<=t;++o)if(e[o]==s&&o!=t)++a;else{if(!s&&a>2){for(;a>138;a-=138)i(32754);a>2&&(i(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(i(s),--a;a>6;a-=6)i(8304);a>2&&(i(a-3<<5|8208),a=0)}for(;a--;)i(s);a=1,s=e[o]}return{c:r.subarray(0,n),n:t}},nr=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},vc=function(e,t,r){var n=r.length,s=Ds(t+2);e[s]=n&255,e[s+1]=n>>8,e[s+2]=e[s]^255,e[s+3]=e[s+1]^255;for(var a=0;a<n;++a)e[s+a+4]=r[a];return(s+4+n)*8},fc=function(e,t,r,n,s,a,i,o,c,l,u){tt(t,u++,r),++s[256];for(var d=Ms(s,15),m=d.t,g=d.l,p=Ms(a,15),f=p.t,y=p.l,I=pc(m),C=I.c,E=I.n,P=pc(f),L=P.c,S=P.n,x=new Te(19),A=0;A<C.length;++A)++x[C[A]&31];for(var A=0;A<L.length;++A)++x[L[A]&31];for(var N=Ms(x,7),k=N.t,D=N.l,M=19;M>4&&!k[ks[M-1]];--M);var X=l+5<<3,Y=nr(s,ut)+nr(a,er)+i,K=nr(s,m)+nr(a,f)+i+14+3*M+nr(x,k)+2*x[16]+3*x[17]+7*x[18];if(c>=0&&X<=Y&&X<=K)return vc(t,u,e.subarray(c,c+l));var z,B,oe,re;if(tt(t,u,1+(K<Y)),u+=2,K<Y){z=Ke(m,g,0),B=m,oe=Ke(f,y,0),re=f;var ht=Ke(k,D,0);tt(t,u,E-257),tt(t,u+5,S-1),tt(t,u+10,M-4),u+=14;for(var A=0;A<M;++A)tt(t,u+3*A,k[ks[A]]);u+=3*M;for(var be=[C,L],Me=0;Me<2;++Me)for(var me=be[Me],A=0;A<me.length;++A){var pe=me[A]&31;tt(t,u,ht[pe]),u+=k[pe],pe>15&&(tt(t,u,me[A]>>5&127),u+=me[A]>>12)}}else z=qw,B=ut,oe=Jw,re=er;for(var A=0;A<o;++A){var V=n[A];if(V>255){var pe=V>>18&31;rr(t,u,z[pe+257]),u+=B[pe+257],pe>7&&(tt(t,u,V>>23&31),u+=$r[pe]);var O=V&31;rr(t,u,oe[O]),u+=re[O],O>3&&(rr(t,u,V>>5&8191),u+=Hr[O])}else rr(t,u,z[V]),u+=B[V]}return rr(t,u,z[256]),u+B[256]},t0=new Rs([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),wc=new q(0),r0=function(e,t,r,n,s,a){var i=a.z||e.length,o=new q(n+i+5*(1+Math.ceil(i/7e3))+s),c=o.subarray(n,o.length-s),l=a.l,u=(a.r||0)&7;if(t){u&&(c[0]=a.r>>3);for(var d=t0[t-1],m=d>>13,g=d&8191,p=(1<<r)-1,f=a.p||new Te(32768),y=a.h||new Te(p+1),I=Math.ceil(r/3),C=2*I,E=function(Ee){return(e[Ee]^e[Ee+1]<<I^e[Ee+2]<<C)&p},P=new Rs(25e3),L=new Te(288),S=new Te(32),x=0,A=0,N=a.i||0,k=0,D=a.w||0,M=0;N+2<i;++N){var X=E(N),Y=N&32767,K=y[X];if(f[Y]=K,y[X]=Y,D<=N){var z=i-N;if((x>7e3||k>24576)&&(z>423||!l)){u=fc(e,c,0,P,L,S,A,k,M,N-M,u),k=x=A=0,M=N;for(var B=0;B<286;++B)L[B]=0;for(var B=0;B<30;++B)S[B]=0}var oe=2,re=0,ht=g,be=Y-K&32767;if(z>2&&X==E(N-be))for(var Me=Math.min(m,z)-1,me=Math.min(32767,N),pe=Math.min(258,z);be<=me&&--ht&&Y!=K;){if(e[N+oe]==e[N+oe-be]){for(var V=0;V<pe&&e[N+V]==e[N+V-be];++V);if(V>oe){if(oe=V,re=be,V>Me)break;for(var O=Math.min(be,V-2),F=0,B=0;B<O;++B){var $=N-be+B&32767,j=$-f[$]&32767;j>F&&(F=j,K=$)}}}Y=K,K=f[Y],be+=Y-K&32767}if(re){P[k++]=268435456|Ps[oe]<<18|mc[re];var J=Ps[oe]&31,Z=mc[re]&31;A+=$r[J]+Hr[Z],++L[257+J],++S[Z],D=N+oe,++x}else P[k++]=e[N],++L[e[N]]}}for(N=Math.max(N,D);N<i;++N)P[k++]=e[N],++L[e[N]];u=fc(e,c,l,P,L,S,A,k,M,N-M,u),l||(a.r=u&7|c[u/8|0]<<3,u-=7,a.h=y,a.p=f,a.i=N,a.w=D)}else{for(var N=a.w||0;N<i+l;N+=65535){var U=N+65535;U>=i&&(c[u/8|0]=l,U=i),u=vc(c,u+1,e.subarray(N,U))}a.i=i}return tr(o,0,n+Ds(u)+s)},n0=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r}return e})(),s0=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n<t.length;++n)r=n0[r&255^t[n]]^r>>>8;e=r},d:function(){return~e}}},a0=function(e,t,r,n,s){if(!s&&(s={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),i=new q(a.length+e.length);i.set(a),i.set(e,a.length),e=i,s.w=a.length}return r0(e,t.level==null?6:t.level,t.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,s)},gc=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},ze=function(e,t){return e[t]|e[t+1]<<8},Ie=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},$s=function(e,t){return Ie(e,t)+Ie(e,t+4)*4294967296},de=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function i0(e,t){return a0(e,t||{},0,0)}function o0(e,t){return e0(e,{i:2},t&&t.out,t&&t.dictionary)}var yc=function(e,t,r,n){for(var s in e){var a=e[s],i=t+s,o=n;Array.isArray(a)&&(o=gc(n,a[1]),a=a[0]),ArrayBuffer.isView(a)?r[i]=[a,o]:(r[i+="/"]=[new q(0),o],yc(a,i,r,n))}},bc=typeof TextEncoder<"u"&&new TextEncoder,Hs=typeof TextDecoder<"u"&&new TextDecoder;try{Hs.decode(wc,{stream:!0})}catch{}var l0=function(e){for(var t="",r=0;;){var n=e[r++],s=(n>127)+(n>223)+(n>239);if(r+s>e.length)return{s:t,r:tr(e,r-1)};s?s==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):s&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function Tc(e,t){if(t){for(var r=new q(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(bc)return bc.encode(e);for(var s=e.length,a=new q(e.length+(e.length>>1)),i=0,o=function(u){a[i++]=u},n=0;n<s;++n){if(i+5>a.length){var c=new q(i+8+(s-n<<1));c.set(a),a=c}var l=e.charCodeAt(n);l<128||t?o(l):l<2048?(o(192|l>>6),o(128|l&63)):l>55295&&l<57344?(l=65536+(l&1047552)|e.charCodeAt(++n)&1023,o(240|l>>18),o(128|l>>12&63),o(128|l>>6&63),o(128|l&63)):(o(224|l>>12),o(128|l>>6&63),o(128|l&63))}return tr(a,0,i)}function c0(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(Hs)return Hs.decode(e);var s=l0(e),a=s.s,r=s.r;return r.length&&fe(8),a}}var u0=function(e,t){return t+30+ze(e,t+26)+ze(e,t+28)},d0=function(e,t,r){var n=ze(e,t+28),s=ze(e,t+30),a=c0(e.subarray(t+46,t+46+n),!(ze(e,t+8)&2048)),i=t+46+n,o=h0(e,i,s,r,Ie(e,t+20),Ie(e,t+24),Ie(e,t+42)),c=o[0],l=o[1],u=o[2];return[ze(e,t+10),c,l,a,i+s+ze(e,t+32),u]},h0=function(e,t,r,n,s,a,i){var o=s==4294967295,c=a==4294967295,l=i==4294967295,u=t+r,d=o+c+l;if(n&&d){for(;t+4<u;t+=4+ze(e,t+2))if(ze(e,t)==1)return[o?$s(e,t+4+8*c):s,c?$s(e,t+4):a,l?$s(e,t+4+8*(c+o)):i,1];n<2&&fe(13)}return[s,a,i,0]},Bs=function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&fe(9),t+=n+4}return t},Ec=function(e,t,r,n,s,a,i,o){var c=n.length,l=r.extra,u=o&&o.length,d=Bs(l);de(e,t,i!=null?33639248:67324752),t+=4,i!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(a<0&&8),e[t++]=s&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var m=new Date(r.mtime==null?Date.now():r.mtime),g=m.getFullYear()-1980;if((g<0||g>119)&&fe(10),de(e,t,g<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),t+=4,a!=-1&&(de(e,t,r.crc),de(e,t+4,a<0?-a-2:a),de(e,t+8,r.size)),de(e,t+12,c),de(e,t+14,d),t+=16,i!=null&&(de(e,t,u),de(e,t+6,r.attrs),de(e,t+10,i),t+=14),e.set(n,t),t+=c,d)for(var p in l){var f=l[p],y=f.length;de(e,t,+p),de(e,t+2,y),e.set(f,t+4),t+=4+y}return u&&(e.set(o,t),t+=u),t},m0=function(e,t,r,n,s){de(e,t,101010256),de(e,t+8,r),de(e,t+10,r),de(e,t+12,n),de(e,t+16,s)};function p0(e,t){t||(t={});var r={},n=[];yc(e,"",r,t);var s=0,a=0;for(var i in r){var o=r[i],c=o[0],l=o[1],u=l.level==0?0:8,d=Tc(i),m=d.length,g=l.comment,p=g&&Tc(g),f=p&&p.length,y=Bs(l.extra);m>65535&&fe(11);var I=u?i0(c,l):c,C=I.length,E=s0();E.p(c),n.push(gc(l,{size:c.length,crc:E.d(),c:I,f:d,m:p,u:m!=i.length||p&&g.length!=f,o:s,compression:u})),s+=30+m+y+C,a+=76+2*(m+y)+(f||0)+C}for(var P=new q(a+22),L=s,S=a-s,x=0;x<n.length;++x){var d=n[x];Ec(P,d.o,d,d.f,d.u,d.c.length);var A=30+d.f.length+Bs(d.extra);P.set(d.c,d.o+A),Ec(P,s,d,d.f,d.u,d.c.length,d.o,d.m),s+=16+A+(d.m?d.m.length:0)}return m0(P,s,n.length,S,L),P}function v0(e,t){for(var r={},n=e.length-22;Ie(e,n)!=101010256;--n)(!n||e.length-n>65558)&&fe(13);var s=ze(e,n+8);if(!s)return{};var a=Ie(e,n+16),i=Ie(e,n-20)==117853008;if(i){var o=Ie(e,n-12);i=Ie(e,o)==101075792,i&&(s=Ie(e,o+32),a=Ie(e,o+48))}for(var c=t&&t.filter,l=0;l<s;++l){var u=d0(e,a,i),d=u[0],m=u[1],g=u[2],p=u[3],f=u[4],y=u[5],I=u0(e,y);a=f,(!c||c({name:p,size:m,originalSize:g,compression:d}))&&(d?d==8?r[p]=o0(e.subarray(I,I+m),{out:new q(g)}):fe(14,"unknown compression type "+d):r[p]=tr(e,I,I+m))}return r}var f0=e=>typeof e=="string"?Tn(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e),Br=e=>p0(Object.fromEntries([...e].map(([t,r])=>[t,f0(r)]))),w0=1032,xc=e=>new Error(`Corrupted zip: ${e} isn't the size the zip file gives it`),Wr=(e,t=()=>!0)=>{const r=new Map;let n=0;const s=v0(e,{filter:({name:i,size:o,originalSize:c})=>{if(i.endsWith("/")||!t(i))return!1;if(n+=o,n>e.length||c>o*w0)throw xc(i);return r.set(i,c),!0}}),a=Object.entries(s).find(([i,o])=>o.length!==r.get(i));if(a!==void 0)throw xc(a[0]);return new Map(Object.entries(s))},Ws=e=>{let t="";for(let r=0;r<e.length;r+=32768)t+=String.fromCharCode(...e.subarray(r,r+32768));return t},Ur=e=>new Error(`${e} is not supported by this platform`),Sc={uint8array:e=>e,arraybuffer:e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),array:e=>Array.from(e),string:Ws,binarystring:Ws,base64:e=>btoa(Ws(e)),blob:(e,t)=>{if(typeof Blob>"u")throw Ur("blob");return new Blob([e],{type:t})},nodebuffer:e=>{if(typeof Buffer>"u")throw Ur("nodebuffer");return Buffer.from(e.buffer,e.byteOffset,e.byteLength)},text:()=>{throw Ur("text")}},Us=(e,t,r)=>{const n=Object.prototype.hasOwnProperty.call(Sc,t.toLowerCase())?Sc[t.toLowerCase()]:void 0;if(n===void 0)throw Ur(t);return n(e,r)},g0=new Map([["dk1","dark1"],["lt1","light1"],["dk2","dark2"],["lt2","light2"],["accent1","accent1"],["accent2","accent2"],["accent3","accent3"],["accent4","accent4"],["accent5","accent5"],["accent6","accent6"],["hlink","hyperlink"],["folHlink","followedHyperlink"]]),y0=new Map([["dark1","windowText"],["light1","window"]]),b0=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument"]),T0=new Set(["http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","http://purl.oclc.org/ooxml/officeDocument/relationships/theme"]),rt=e=>{var t,r;return(t=e==null||(r=e.name)===null||r===void 0?void 0:r.slice(e.name.indexOf(":")+1))!==null&&t!==void 0?t:""},wt=e=>{var t,r;return(t=e==null||(r=e.elements)===null||r===void 0?void 0:r.filter(n=>n.type==="element"))!==null&&t!==void 0?t:[]},De=(e,t)=>wt(e).find(r=>rt(r)===t),nt=(e,t)=>{var r;const n=e==null||(r=e.attributes)===null||r===void 0?void 0:r[t];return n===void 0?void 0:String(n)},E0=e=>e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,Gs=e=>new TextDecoder(e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8").decode(e),Ac=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),Ic=(e,t,r)=>{const n=e.get(Le(t)),s=nt(n&&wt(De(Et(Gs(n)),"Relationships")).find(a=>{var i;return r.has((i=nt(a,"Type"))!==null&&i!==void 0?i:"")}),"Target");return s===void 0?void 0:ft(t,s)},Cc=(e,t)=>Ic(e,t,T0),x0=e=>{const t=Wr(e,a=>a.endsWith(".rels")),r=Ic(t,"",b0);if(r===void 0)throw new Error("Invalid file: a zip file that isn't a Word, PowerPoint or Excel file or an Office theme (.thmx)");const n=Cc(t,r),s=n===void 0?void 0:[...Wr(e,a=>lc(a,n)).values()][0];if(s===void 0)throw new Error(`The file has no theme: its main part, ${r}, refers to none`);return Gs(s)},S0=(e,t,r)=>{const[n]=wt(t),s=rt(n)==="srgbClr"?nt(n,"val"):rt(n)==="sysClr"&&(r||nt(n,"val")!==y0.get(e))?nt(n,"lastClr"):void 0;return s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?s.toUpperCase():void 0},Vs=(e,t=!1)=>Object.fromEntries(wt(e).flatMap(r=>{const n=g0.get(rt(r)),s=n&&S0(n,r,t);return n&&s?[[n,s]]:[]})),A0=e=>{const[t]=wt(Et(e)),r=rt(t)==="theme"?De(De(t,"themeElements"),"clrScheme"):void 0;return r?Vs(r,!0):{}},js=e=>nt(e,"typeface")||void 0,Nc=e=>{const t=wt(e).filter(r=>rt(r)==="font").flatMap(r=>{const n=nt(r,"script"),s=nt(r,"typeface");return n&&s!==void 0?[[n,s]]:[]});return Ac({latin:js(De(e,"latin")),eastAsia:js(De(e,"ea")),complexScript:js(De(e,"cs")),scripts:t.length>0?Object.fromEntries(t):void 0})},Rc=e=>({headings:Nc(De(e,"majorFont")),body:Nc(De(e,"minorFont"))}),I0=e=>{if(typeof e=="string")return e;const t=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);return E0(t)?x0(t):Gs(t)},C0=e=>{const[t]=wt(Et(I0(e)));if(rt(t)==="clrScheme")return{colors:Vs(t)};if(rt(t)==="fontScheme")return{fonts:Rc(t)};if(rt(t)!=="theme"){var r;throw new Error(`Invalid theme: expected the XML of a theme, such as a document's word/theme/theme1.xml, but its root element is ${(r=t?.name)!==null&&r!==void 0?r:"missing"}`)}const n=De(t,"themeElements"),s=De(n,"clrScheme"),a=De(n,"fontScheme");return Ac({name:nt(t,"name")||void 0,colors:s&&Vs(s),fonts:a&&Rc(a)})},N0=[208,207,17,224,161,177,26,225],kc=class{constructor(e){var t,r,n,s,a,i,o,c,l,u,d,m,g,p;if(v(this,"currentRelationshipId",1),v(this,"documentWrapper",void 0),v(this,"headers",[]),v(this,"footers",[]),v(this,"coreProperties",void 0),v(this,"numbering",void 0),v(this,"media",void 0),v(this,"fileRelationships",void 0),v(this,"footnotesWrapper",void 0),v(this,"endnotesWrapper",void 0),v(this,"settings",void 0),v(this,"contentTypes",void 0),v(this,"customProperties",void 0),v(this,"appProperties",void 0),v(this,"styles",void 0),v(this,"comments",void 0),v(this,"commentsExtended",void 0),v(this,"commentsIds",void 0),v(this,"fontWrapper",void 0),v(this,"theme",void 0),v(this,"packageParts",void 0),v(this,"macros",void 0),v(this,"bibliography",void 0),e.macros!==void 0){const{project:E,events:P=[]}=e.macros,L=E instanceof Uint8Array?E:new Uint8Array(E);if(!N0.every((x,A)=>L[A]===x))throw new Error("macros.project isn't a VBA project. Use createMacros from docx/macros, or the word/vbaProject.bin in a .docm rather than the .docm itself");const S=new se;P.length>0&&S.addRelationship(1,"http://schemas.microsoft.com/office/2006/relationships/wordVbaData","vbaData.xml"),this.macros={project:L,events:P.length>0?Nf(P):void 0,relationships:S}}if(this.coreProperties=new wf(w(w({},e),{},{creator:(t=e.creator)!==null&&t!==void 0?t:"Un-named",revision:(r=e.revision)!==null&&r!==void 0?r:1,lastModifiedBy:(n=e.lastModifiedBy)!==null&&n!==void 0?n:"Un-named"})),this.numbering=new gs(e.numbering?e.numbering:{config:[]}),this.comments=new ao((s=e.comments)!==null&&s!==void 0?s:{children:[]}),this.comments.ThreadData&&(this.commentsExtended=new io(this.comments.ThreadData)),this.comments.CommentIdsData&&(this.commentsIds=new oo(this.comments.CommentIdsData)),this.fileRelationships=new se,this.customProperties=new xf((a=e.customProperties)!==null&&a!==void 0?a:[]),this.appProperties=new pf,this.footnotesWrapper=new Uf,this.endnotesWrapper=new Mf,this.contentTypes=new ff({macros:this.macros!==void 0}),((i=this.macros)===null||i===void 0?void 0:i.events)!==void 0&&this.contentTypes.addOverride("application/vnd.ms-word.vbaData+xml","/word/vbaData.xml"),e.bibliography!==void 0){const E=new se;E.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps","itemProps1.xml"),this.bibliography={sources:e.bibliography.sources,properties:If(`{${bn().toUpperCase()}}`),relationships:E},this.contentTypes.addOverride("application/vnd.openxmlformats-officedocument.customXmlProperties+xml","/customXml/itemProps1.xml")}if(this.packageParts=new Dl(this.contentTypes),this.documentWrapper=new Pf({background:e.background,pageNumbers:e.pageNumbers}),this.settings=new yw({compatibilityModeVersion:e.compatabilityModeVersion,compatibility:e.compatibility,evenAndOddHeaders:!!e.evenAndOddHeaderAndFooters,trackRevisions:(o=e.features)===null||o===void 0?void 0:o.trackRevisions,updateFields:(c=e.features)===null||c===void 0?void 0:c.updateFields,embedFonts:!((l=e.fonts)===null||l===void 0)&&l.length?!0:void 0,defaultTabStop:e.defaultTabStop,protection:e.protection,hyphenation:{autoHyphenation:(u=e.hyphenation)===null||u===void 0?void 0:u.autoHyphenation,hyphenationZone:(d=e.hyphenation)===null||d===void 0?void 0:d.hyphenationZone,consecutiveHyphenLimit:(m=e.hyphenation)===null||m===void 0?void 0:m.consecutiveHyphenLimit,doNotHyphenateCaps:(g=e.hyphenation)===null||g===void 0?void 0:g.doNotHyphenateCaps}}),this.media=new vs(E=>this.packageParts.takePath("media","image",E)),e.externalStyles!==void 0){var f,y,I,C;const E=(f=(y=e.styles)===null||y===void 0?void 0:y.default)!==null&&f!==void 0?f:{},P=Object.entries(xs(E)),L=([x])=>E[x]!==void 0,S=new Hw().newInstance(e.externalStyles);this.styles=new Mr(w(w({},S),{},{paragraphStyles:(I=e.styles)===null||I===void 0?void 0:I.paragraphStyles,characterStyles:(C=e.styles)===null||C===void 0?void 0:C.characterStyles,importedStyles:[...P.filter(x=>!L(x)).map(([,x])=>x),...S.importedStyles,...P.filter(L).map(([,x])=>x)]}))}else if(e.styles){const E=new tc().newInstance(e.styles.default);this.styles=new Mr(w(w({},E),e.styles))}else{const E=new tc;this.styles=new Mr(E.newInstance())}this.addDefaultRelationships();for(const E of e.sections)this.addSection(E);if(e.footnotes)for(const E in e.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(E),e.footnotes[E].children);if(e.endnotes)for(const E in e.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(E),e.endnotes[E].children);this.fontWrapper=new To((p=e.fonts)!==null&&p!==void 0?p:[]),this.theme=new ac(e.theme),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme","theme/theme1.xml"),this.macros!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2006/relationships/vbaProject","vbaProject.bin"),this.bibliography!==void 0&&this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml","../customXml/item1.xml")}addSection({headers:e={},footers:t={},children:r,properties:n}){this.documentWrapper.View.Body.addSection(w(w({},n),{},{headerWrapperGroup:{default:e.default?this.createHeader(e.default):void 0,first:e.first?this.createHeader(e.first):void 0,even:e.even?this.createHeader(e.even):void 0},footerWrapperGroup:{default:t.default?this.createFooter(t.default):void 0,first:t.first?this.createFooter(t.first):void 0,even:t.even?this.createFooter(t.even):void 0}}));for(const s of r)this.documentWrapper.View.add(s)}createHeader(e){const t=new Pl(this.media,this.currentRelationshipId++);for(const r of e.options.children)t.add(r);return this.addHeaderToDocument(t),t}createFooter(e){const t=new Nl(this.media,this.currentRelationshipId++);for(const r of e.options.children)t.add(r);return this.addFooterToDocument(t),t}addHeaderToDocument(e,t=vt.DEFAULT){this.headers.push({header:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(e,t=vt.DEFAULT){this.footers.push({footer:e,type:t}),this.documentWrapper.Relationships.addRelationship(e.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.comments.IsEmpty||(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.contentTypes.addComments()),this.commentsExtended&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()),this.commentsIds&&(this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds","commentsIds.xml"),this.contentTypes.addCommentsIds())}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(e=>e.header)}get Footers(){return this.footers.map(e=>e.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get CommentsIds(){return this.commentsIds}get FontTable(){return this.fontWrapper}get Theme(){return this.theme}get PackageParts(){return this.packageParts}get Macros(){return this.macros}get Bibliography(){return this.bibliography}},Pc=class extends b{constructor(e){super("w:sdtPr"),e&&this.root.push(new Re("w:alias",e))}},R0=e=>new T({name:"w:docPartObj",children:[new Re("w:docPartGallery",e),new T({name:"w:docPartUnique"})]}),k0=["contentChildren","cachedEntries","beginDirty","tabLeader"],P0=class extends zt{constructor(e="Table of Contents",t={}){let{contentChildren:r=[],cachedEntries:n=[],beginDirty:s,tabLeader:a=po.DOT}=t,i=Ft(t,k0);super("w:sdt"),v(this,"fromHeadings",void 0);const o=new Pc(e);o.addChildElement(R0("Table of Contents")),this.root.push(o);const c=new On,l=[new te({children:[Ki(s),new Xi(i),ke()]})],u=[new te({children:[xe()]})];if(n!==void 0&&n.length>0){const{stylesWithLevels:d}=i,m=n.map((p,f)=>{var y,I;const C=this.buildCachedContentParagraphChild(p,i),E=(y=d==null||(I=d.find(L=>L.level===p.level))===null||I===void 0?void 0:I.styleName)!==null&&y!==void 0?y:`TOC${p.level}`,P=f===0?[...l,C]:f===n.length-1?[C,...u]:[C];return new ue({style:E,tabStops:this.getTabStopsForLevel(p.level,a),children:P})});let g=m;n.length<=1&&(g=[...m,new ue({children:u})]);for(const p of g)c.addChildElement(p)}else{const d=new ue({children:l});c.addChildElement(d);for(const g of r)c.addChildElement(g);const m=new ue({children:u});c.addChildElement(m),r.length===0&&(this.fromHeadings={properties:i,beginDirty:s,tabLeader:a})}this.root.push(c)}prepForXml(e){const t=super.prepForXml(e);return Em(t,this.fromHeadings&&w(w({},this.fromHeadings),{},{textWidth:this.textWidthIn(e)})),t}textWidthIn(e){var t,r;return(t=(r=e.file)===null||r===void 0||(r=r.Document)===null||r===void 0||(r=r.View.Body.getSectionPropertiesFor(this))===null||r===void 0?void 0:r.AvailableTextWidth)!==null&&t!==void 0?t:Rr}getTabStopsForLevel(e,t,r=9025){return[{type:"clear",position:r+1-(e-1)*240},{type:"right",position:r,leader:t}]}buildCachedContentRun(e,t){var r,n;return new te({style:t?.hyperlink&&e.href!==void 0?"IndexLink":void 0,children:[new Gt({text:e.title}),new Xt,new Gt({text:(r=(n=e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:""})]})}buildCachedContentParagraphChild(e,t){const r=this.buildCachedContentRun(e,t);return t?.hyperlink&&e.href!==void 0?new Gn({anchor:e.href,children:[r]}):r}},O0=class{constructor(e,t){v(this,"styleName",void 0),v(this,"level",void 0),this.styleName=e,this.level=t}},L0=class{constructor(e={children:[]}){v(this,"options",void 0),this.options=e}},_0=class{constructor(e={children:[]}){v(this,"options",void 0),this.options=e}},Oc=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Xs=class extends b{constructor(e){super("w:footnoteReference"),this.root.push(new Oc({id:e}))}},D0=class extends te{constructor(e){super({style:"FootnoteReference"}),v(this,"footnote",void 0),typeof e=="number"?this.root.push(new Xs(e)):this.footnote=e}prepForXml(e){var t;if(this.footnote===void 0)return super.prepForXml(e);const r=(t=e.file)===null||t===void 0?void 0:t.FootNotes.View.idOf(this,this.footnote,e);if(r!==void 0){this.root.push(new Xs(r));try{return super.prepForXml(e)}finally{this.root.pop()}}}},Lc=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{id:"w:id"})}},Ks=class extends b{constructor(e){super("w:endnoteReference"),this.root.push(new Lc({id:e}))}},M0=class extends te{constructor(e){super({style:"EndnoteReference"}),v(this,"endnote",void 0),typeof e=="number"?this.root.push(new Ks(e)):this.endnote=e}prepForXml(e){var t;if(this.endnote===void 0)return super.prepForXml(e);const r=(t=e.file)===null||t===void 0?void 0:t.Endnotes.View.idOf(this,this.endnote,e);if(r!==void 0){this.root.push(new Ks(r));try{return super.prepForXml(e)}finally{this.root.pop()}}}},_c=class extends _{constructor(...e){super(...e),v(this,"xmlKeys",{val:"w14:val",symbolfont:"w14:font"})}},Gr=class extends b{constructor(e,t,r){super(e),r?this.root.push(new _c({val:Na(t),symbolfont:r})):this.root.push(new _c({val:t}))}},Dc=class extends b{constructor(e){var t,r,n,s,a,i,o,c;super("w14:checkbox"),v(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),v(this,"DEFAULT_CHECKED_SYMBOL","2612"),v(this,"DEFAULT_FONT","MS Gothic");const l=e?.checked?"1":"0";let u,d;this.root.push(new Gr("w14:checked",l)),u=!(e==null||(t=e.checkedState)===null||t===void 0)&&t.value?e==null||(r=e.checkedState)===null||r===void 0?void 0:r.value:this.DEFAULT_CHECKED_SYMBOL,d=!(e==null||(n=e.checkedState)===null||n===void 0)&&n.font?e==null||(s=e.checkedState)===null||s===void 0?void 0:s.font:this.DEFAULT_FONT,this.root.push(new Gr("w14:checkedState",u,d)),u=!(e==null||(a=e.uncheckedState)===null||a===void 0)&&a.value?e==null||(i=e.uncheckedState)===null||i===void 0?void 0:i.value:this.DEFAULT_UNCHECKED_SYMBOL,d=!(e==null||(o=e.uncheckedState)===null||o===void 0)&&o.font?e==null||(c=e.uncheckedState)===null||c===void 0?void 0:c.font:this.DEFAULT_FONT,this.root.push(new Gr("w14:uncheckedState",u,d))}},F0=class extends b{constructor(e){var t,r,n,s;super("w:sdt"),v(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),v(this,"DEFAULT_CHECKED_SYMBOL","2612"),v(this,"DEFAULT_FONT","MS Gothic");const a=new Pc(e?.alias);a.addChildElement(new Dc(e)),this.root.push(a);const i=new On,o=e==null||(t=e.checkedState)===null||t===void 0?void 0:t.font,c=e==null||(r=e.checkedState)===null||r===void 0?void 0:r.value,l=e==null||(n=e.uncheckedState)===null||n===void 0?void 0:n.font,u=e==null||(s=e.uncheckedState)===null||s===void 0?void 0:s.value;let d,m;e?.checked?(d=o||this.DEFAULT_FONT,m=c||this.DEFAULT_CHECKED_SYMBOL):(d=l||this.DEFAULT_FONT,m=u||this.DEFAULT_UNCHECKED_SYMBOL);const g=new li({char:m,symbolfont:d});i.addChildElement(g),this.root.push(i)}},zs=e=>e===void 0?void 0:e?"t":"f",$0=({children:e})=>new T({name:"w:pict",children:e}),H0={flip:"flip",height:"height",left:"left",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",positionHorizontal:"mso-position-horizontal",positionHorizontalRelative:"mso-position-horizontal-relative",positionVertical:"mso-position-vertical",positionVerticalRelative:"mso-position-vertical-relative",wrapDistanceBottom:"mso-wrap-distance-bottom",wrapDistanceLeft:"mso-wrap-distance-left",wrapDistanceRight:"mso-wrap-distance-right",wrapDistanceTop:"mso-wrap-distance-top",wrapEdited:"mso-wrap-edited",wrapStyle:"mso-wrap-style",position:"position",rotation:"rotation",top:"top",visibility:"visibility",width:"width",zIndex:"z-index"},B0=e=>e?Object.entries(e).filter(([,t])=>t!==void 0).map(([t,r])=>`${H0[t]}:${r}`).join(";"):void 0,Mc=({id:e,type:t,style:r,coordinateSize:n,adjustment:s,path:a,presetShapeType:i,allowInCell:o,alt:c,title:l,fillColor:u,filled:d,stroked:m,strokeColor:g,strokeWeight:p,children:f=[]})=>new T({name:"v:shape",attributes:{id:{key:"id",value:e},type:{key:"type",value:t},style:{key:"style",value:B0(r)},coordinateSize:{key:"coordsize",value:n},adjustment:{key:"adj",value:s},path:{key:"path",value:a},presetShapeType:{key:"o:spt",value:i},allowInCell:{key:"o:allowincell",value:zs(o)},alt:{key:"alt",value:c},title:{key:"title",value:l},fillColor:{key:"fillcolor",value:u},filled:{key:"filled",value:zs(d)},stroked:{key:"stroked",value:zs(m)},strokeColor:{key:"strokecolor",value:g},strokeWeight:{key:"strokeweight",value:p}},children:f}),W0=({shape:e})=>$0({children:[e]}),U0=({children:e=[]})=>new T({name:"w:txbxContent",children:e}),G0=({style:e,children:t,inset:r})=>new T({name:"v:textbox",attributes:{style:{key:"style",value:e},inset:{key:"inset",value:r?`${r.left}, ${r.top}, ${r.right}, ${r.bottom}`:void 0}},children:[U0({children:t})]}),V0="#_x0000_t202",j0="1in",X0=e=>e&&(e.height===void 0||e.height==="auto")?w(w({},e),{},{height:j0}):e,K0=({id:e,children:t,type:r=V0,style:n})=>Mc({id:e,type:r,style:X0(n),children:[G0({style:"mso-fit-shape-to-text:t;",children:t})]}),z0=["style","children"],q0=class extends zt{constructor(e){let{style:t,children:r}=e,n=Ft(e,z0);super("w:p"),v(this,"run",void 0),this.root.push(new it(n)),this.run=new T({name:"w:r",children:[W0({shape:K0({children:r,id:Ze(),style:t})})]}),this.root.push(this.run)}prepForXml(e){return Tt(e.stack[e.stack.length-1])==="w:p"?this.run.prepForXml(e):super.prepForXml(e)}},sr=0,qs=32,Y0=32,J0=(e,t)=>{const r=t.replace(/-/g,"");if(r.length!==Y0)throw new Error(`Error: Cannot extract GUID from font filename: ${t}`);const n=r.replace(/(..)/g,"$1 ").trim().split(" ").map(i=>parseInt(i,16));n.reverse();const s=e.slice(sr,qs).map((i,o)=>i^n[o%n.length]),a=new Uint8Array(sr+s.length+Math.max(0,e.length-qs));return a.set(e.slice(0,sr)),a.set(s,sr),a.set(e.slice(qs),sr+s.length),a},gt=class{format(e,t={stack:[]}){const r=e.prepForXml(t);if(r)return r;throw Error("XMLComponent did not format correctly")}},Fc=/\{([^{}]+)\}/g,$c=(e,t)=>t.size===0?e:e.replace(Fc,(r,n)=>{var s;return(s=t.get(n))!==null&&s!==void 0?s:r}),Z0=e=>new Set(Array.from(e.matchAll(Fc),([,t])=>t)),Hc=class{replace(e,t,r){return $c(e,new Map(t.map((n,s)=>[n.key,(r+s).toString()])))}getMediaData(e,t){const r=Z0(e);return t.Entries.filter(([n])=>r.has(n)).map(([n,{fileName:s}])=>({key:n,fileName:s}))}},Q0=class{replace(e,t){return $c(e,new Map(t.map(({reference:r,instance:n,restartedListId:s,numId:a})=>[xr(r,n,s),a.toString()])))}},eg=new gt,Ys=(e,t,r,n,s=!0)=>H(eg.format(t,{viewWrapper:{View:t,Relationships:n},file:e,stack:[]}),{indent:r,declaration:s?{standalone:"yes",encoding:"UTF-8"}:{encoding:"UTF-8"}}),tg=(e,t,r,n)=>{const{content:s}=t.options;if(s instanceof Uint8Array)return[{data:s,path:`word/${r}`}];if("files"in s)return[{data:Br(s.files.map(({path:l,content:u})=>[l,u instanceof Uint8Array?u:Ys(e,u,n,new se)])),path:`word/${r}`}];const a=e.PackageParts.createRelationships(r),i=Ys(e,s,n,a),o=r.slice(0,r.lastIndexOf("/")),c=r.slice(r.lastIndexOf("/")+1);return[{data:i,path:`word/${r}`},...a.RelationshipCount>0?[{data:Ys(e,a,n,a,!1),path:`word/${o}/_rels/${c}.rels`}]:[]]},Js=(e,t,r=0)=>{const n=e.PackageParts.Array.slice(r);return n.length===0?[]:[...n.flatMap(({part:s,path:a})=>tg(e,s,a,t)),...Js(e,t,r+n.length)]},rg=["PackageParts"],ng=class{constructor(){v(this,"formatter",void 0),v(this,"imageReplacer",void 0),v(this,"numberingReplacer",void 0),this.formatter=new gt,this.imageReplacer=new Hc,this.numberingReplacer=new Q0}compile(e,t,r=[]){const n=this.xmlifyFile(e,t),{PackageParts:s}=n,a=Ft(n,rg),i=Object.values(a).flatMap(o=>Array.isArray(o)?o:[o]);return new Map([...i.map(({path:o,data:c})=>[o,c]),...s.map(({path:o,data:c})=>[o,c]),...r.map(({path:o,data:c})=>[o,c]),...e.Macros===void 0?[]:[["word/vbaProject.bin",e.Macros.project]],...e.Media.Array.map(o=>[`word/media/${o.fileName}`,o.data]),...e.FontTable.files.map(({data:o,fontKey:c},l)=>[`word/fonts/font${l+1}.odttf`,J0(o,c)])])}xmlifyFile(e,t){var r;const n=H(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),s=H(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=H(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),i=H(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),o=e.Document.Relationships.RelationshipCount+1,c=e.Comments.Relationships.RelationshipCount+1,l=e.FootNotes.Relationships.RelationshipCount+1,u=e.Endnotes.Relationships.RelationshipCount+1,d=this.imageReplacer.getMediaData(n,e.Media),m=this.imageReplacer.getMediaData(s,e.Media),g=this.imageReplacer.getMediaData(a,e.Media),p=this.imageReplacer.getMediaData(i,e.Media);return w(w(w(w(w(w({Relationships:{data:(()=>{const f=se.copy(e.Document.Relationships);return d.forEach((y,I)=>{f.addRelationship(o+I,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${y.fileName}`)}),f.addRelationship(f.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),H(this.formatter.format(f,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const f=this.imageReplacer.replace(n,d,o);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const f=H(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:H(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},FileRelationships:{data:H(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((f,y)=>{const I=H(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(I,e.Media),E=se.copy(f.Relationships);return C.forEach((P,L)=>{E.addRelationship(L,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${P.fileName}`)}),{data:H(this.formatter.format(E,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${y+1}.xml.rels`}}),FooterRelationships:e.Footers.map((f,y)=>{const I=H(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(I,e.Media),E=se.copy(f.Relationships);return C.forEach((P,L)=>{E.addRelationship(L,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${P.fileName}`)}),{data:H(this.formatter.format(E,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${y+1}.xml.rels`}}),Headers:e.Headers.map((f,y)=>{const I=H(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(I,e.Media),E=this.imageReplacer.replace(I,C,0);return{data:this.numberingReplacer.replace(E,e.Numbering.ConcreteNumbering),path:`word/header${y+1}.xml`}}),Footers:e.Footers.map((f,y)=>{const I=H(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(I,e.Media),E=this.imageReplacer.replace(I,C,0);return{data:this.numberingReplacer.replace(E,e.Numbering.ConcreteNumbering),path:`word/footer${y+1}.xml`}}),CustomProperties:{data:H(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:H(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{const f=this.imageReplacer.replace(a,g,l);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{const f=se.copy(e.FootNotes.Relationships);return g.forEach((y,I)=>{f.addRelationship(l+I,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${y.fileName}`)}),H(this.formatter.format(f,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(()=>{const f=this.imageReplacer.replace(i,p,u);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/endnotes.xml"},EndnotesRelationships:{data:(()=>{const f=se.copy(e.Endnotes.Relationships);return p.forEach((y,I)=>{f.addRelationship(u+I,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${y.fileName}`)}),H(this.formatter.format(f,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/endnotes.xml.rels"},Settings:{data:H(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"}},e.Comments.IsEmpty?{}:{Comments:{data:(()=>{const f=this.imageReplacer.replace(s,m,c);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{const f=se.copy(e.Comments.Relationships);return m.forEach((y,I)=>{f.addRelationship(c+I,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${y.fileName}`)}),H(this.formatter.format(f,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}}),e.CommentsExtended?{CommentsExtended:{data:H(this.formatter.format(e.CommentsExtended,{viewWrapper:{View:e.CommentsExtended,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),e.CommentsIds?{CommentsIds:{data:H(this.formatter.format(e.CommentsIds,{viewWrapper:{View:e.CommentsIds,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsIds.xml"}}:{}),{},{FontTable:{data:H(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:H(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"},Theme:{data:H(this.formatter.format(e.Theme,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/theme/theme1.xml"}},!((r=e.Macros)===null||r===void 0)&&r.events?{MacroEvents:{data:H(this.formatter.format(e.Macros.events,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/vbaData.xml"},MacroRelationships:{data:H(this.formatter.format(e.Macros.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/vbaProject.bin.rels"}}:{}),e.Bibliography?{BibliographySources:{data:H(this.formatter.format(e.Bibliography.sources,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/item1.xml"},BibliographySourcesProperties:{data:H(this.formatter.format(e.Bibliography.properties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"no",encoding:"UTF-8"}}),path:"customXml/itemProps1.xml"},BibliographySourcesRelationships:{data:H(this.formatter.format(e.Bibliography.relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"customXml/_rels/item1.xml.rels"}}:{}),{},{PackageParts:Js(e,t),Numbering:{data:H(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},ContentTypes:{data:H(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"}})}},Bc=Vu(((e,t)=>{var r=typeof Reflect=="object"?Reflect:null,n=r&&typeof r.apply=="function"?r.apply:function(x,A,N){return Function.prototype.apply.call(x,A,N)},s;r&&typeof r.ownKeys=="function"?s=r.ownKeys:Object.getOwnPropertySymbols?s=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:s=function(x){return Object.getOwnPropertyNames(x)};function a(S){console&&console.warn&&console.warn(S)}var i=Number.isNaN||function(x){return x!==x};function o(){o.init.call(this)}t.exports=o,t.exports.once=E,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");c=S}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||i(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function u(S){return S._maxListeners===void 0?o.defaultMaxListeners:S._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(x){for(var A=[],N=1;N<arguments.length;N++)A.push(arguments[N]);var k=x==="error",D=this._events;if(D!==void 0)k=k&&D.error===void 0;else if(!k)return!1;if(k){var M;if(A.length>0&&(M=A[0]),M instanceof Error)throw M;var X=new Error("Unhandled error."+(M?" ("+M.message+")":""));throw X.context=M,X}var Y=D[x];if(Y===void 0)return!1;if(typeof Y=="function")n(Y,this,A);else for(var K=Y.length,z=y(Y,K),N=0;N<K;++N)n(z[N],this,A);return!0};function d(S,x,A,N){var k,D,M;if(l(A),D=S._events,D===void 0?(D=S._events=Object.create(null),S._eventsCount=0):(D.newListener!==void 0&&(S.emit("newListener",x,A.listener?A.listener:A),D=S._events),M=D[x]),M===void 0)M=D[x]=A,++S._eventsCount;else if(typeof M=="function"?M=D[x]=N?[A,M]:[M,A]:N?M.unshift(A):M.push(A),k=u(S),k>0&&M.length>k&&!M.warned){M.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+M.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=S,X.type=x,X.count=M.length,a(X)}return S}o.prototype.addListener=function(x,A){return d(this,x,A,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(x,A){return d(this,x,A,!0)};function m(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function g(S,x,A){var N={fired:!1,wrapFn:void 0,target:S,type:x,listener:A},k=m.bind(N);return k.listener=A,N.wrapFn=k,k}o.prototype.once=function(x,A){return l(A),this.on(x,g(this,x,A)),this},o.prototype.prependOnceListener=function(x,A){return l(A),this.prependListener(x,g(this,x,A)),this},o.prototype.removeListener=function(x,A){var N,k,D,M,X;if(l(A),k=this._events,k===void 0)return this;if(N=k[x],N===void 0)return this;if(N===A||N.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete k[x],k.removeListener&&this.emit("removeListener",x,N.listener||A));else if(typeof N!="function"){for(D=-1,M=N.length-1;M>=0;M--)if(N[M]===A||N[M].listener===A){X=N[M].listener,D=M;break}if(D<0)return this;D===0?N.shift():I(N,D),N.length===1&&(k[x]=N[0]),k.removeListener!==void 0&&this.emit("removeListener",x,X||A)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(x){var A,N=this._events,k;if(N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete N[x]),this;if(arguments.length===0){var D=Object.keys(N),M;for(k=0;k<D.length;++k)M=D[k],M!=="removeListener"&&this.removeAllListeners(M);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=N[x],typeof A=="function")this.removeListener(x,A);else if(A!==void 0)for(k=A.length-1;k>=0;k--)this.removeListener(x,A[k]);return this};function p(S,x,A){var N=S._events;if(N===void 0)return[];var k=N[x];return k===void 0?[]:typeof k=="function"?A?[k.listener||k]:[k]:A?C(k):y(k,k.length)}o.prototype.listeners=function(x){return p(this,x,!0)},o.prototype.rawListeners=function(x){return p(this,x,!1)},o.listenerCount=function(S,x){return typeof S.listenerCount=="function"?S.listenerCount(x):f.call(S,x)},o.prototype.listenerCount=f;function f(S){var x=this._events;if(x!==void 0){var A=x[S];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function y(S,x){for(var A=new Array(x),N=0;N<x;++N)A[N]=S[N];return A}function I(S,x){for(;x+1<S.length;x++)S[x]=S[x+1];S.pop()}function C(S){for(var x=new Array(S.length),A=0;A<x.length;++A)x[A]=S[A].listener||S[A];return x}function E(S,x){return new Promise(function(A,N){function k(M){S.removeListener(x,D),N(M)}function D(){typeof S.removeListener=="function"&&S.removeListener("error",k),A([].slice.call(arguments))}L(S,x,D,{once:!0}),x!=="error"&&P(S,k,{once:!0})})}function P(S,x,A){typeof S.on=="function"&&L(S,"error",x,A)}function L(S,x,A,N){if(typeof S.on=="function")N.once?S.once(x,A):S.on(x,A);else if(typeof S.addEventListener=="function")S.addEventListener(x,function k(D){N.once&&S.removeEventListener(x,k),A(D)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}}))();var sg=class extends Bc.EventEmitter{pipe(e,t){const r=this,n=e,s=d=>{n.writable&&n.write(d)===!1&&r.pause&&r.pause()};r.on("data",s);const a=()=>{r.readable&&r.resume&&r.resume()};n.on("drain",a),!n._isStdio&&(!t||t.end!==!1)&&(r.on("end",o),r.on("close",c));let i=!1;function o(){i||(i=!0,n.end())}function c(){i||(i=!0,typeof n.destroy=="function"&&n.destroy())}function l(d){if(u(),Bc.EventEmitter.listenerCount(this,"error")===0)throw d}r.on("error",l),n.on("error",l);function u(){r.removeListener("data",s),n.removeListener("drain",a),r.removeListener("end",o),r.removeListener("close",c),r.removeListener("error",l),n.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),n.removeListener("close",u)}return r.on("end",u),r.on("close",u),n.on("close",u),n.emit("pipe",r),n}};function Wc(e,t,r,n,s,a,i){try{var o=e[a](i),c=o.value}catch(l){r(l);return}o.done?t(c):Promise.resolve(c).then(n,s)}function dt(e){return function(){var t=this,r=arguments;return new Promise(function(n,s){var a=e.apply(t,r);function i(c){Wc(a,n,s,i,o,"next",c)}function o(c){Wc(a,n,s,i,o,"throw",c)}i(void 0)})}}var Uc={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:" "},Gc=e=>e===!0?Uc.WITH_2_BLANKS:e===!1?void 0:e,Vc=e=>e.Macros===void 0?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"application/vnd.ms-word.document.macroEnabled.12",jc=class _t{static pack(t,r,n){var s=this;return dt(function*(a,i,o,c=[]){return Us(Br(s.compiler.compile(a,Gc(o),c)),i,Vc(a))}).apply(this,arguments)}static toString(t,r,n=[]){return _t.pack(t,"string",r,n)}static toBuffer(t,r,n=[]){return _t.pack(t,"nodebuffer",r,n)}static toBase64String(t,r,n=[]){return _t.pack(t,"base64",r,n)}static toBlob(t,r,n=[]){return _t.pack(t,"blob",r,n)}static toArrayBuffer(t,r,n=[]){return _t.pack(t,"arraybuffer",r,n)}static toStream(t,r,n=[]){const s=new sg,a=this.compiler.compile(t,Gc(r),n);return new Promise(i=>setTimeout(i)).then(()=>Us(Br(a),"nodebuffer",Vc(t))).then(i=>{s.emit("data",i),s.emit("end")},i=>s.emit("error",i)),s}};v(jc,"compiler",new ng);var Xc=e=>{var t;if(e.name!=="w:bookmarkStart"&&e.name!=="w:bookmarkEnd")return;const r=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return Number.isInteger(r)?r:void 0},Kc=e=>{var t;const r=Xc(e);return[...r===void 0?[]:[r],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Kc)]},ag=e=>{const t=new Set(e),r=new Map;let n=e.reduce((i,o)=>Math.max(i,o),0);const s=i=>{const o=r.get(i);if(o!==void 0)return o;const c=t.has(i)?n+1:i;return n=Math.max(n,c),t.add(c),r.set(i,c),c},a=i=>{const o=Xc(i);return w(w(w({},i),o===void 0?{}:{attributes:w(w({},i.attributes),{},{"w:id":String(s(o))})}),i.elements===void 0?{}:{elements:i.elements.map(a)})};return i=>i.map(a)},ig=new gt,Vr=e=>new TextDecoder("utf-8",{ignoreBOM:!0}).decode(e),qe=e=>Et(e,{keepWhitespaceText:!0}),zc=e=>{var t;return(t=qe(H(ig.format(new Gt({text:e})))).elements[0].elements)!==null&&t!==void 0?t:[]},qc=e=>w(w({},e),{},{attributes:{"xml:space":"preserve"}}),he=(e,t)=>{var r,n;const s=(r=e.elements)===null||r===void 0?void 0:r.find(a=>a.name===t);return s===void 0?[]:((n=s.elements)!==null&&n!==void 0||(s.elements=[]),s.elements)},Yc=e=>{if(!e?.start.trim()||!e?.end.trim())throw new Error("Both start and end delimiters must be non-empty strings.")},Lt=(e,t,r)=>{const n=he(e,"Types");n.some(s=>{var a,i;return s.type==="element"&&s.name==="Default"&&(s==null||(a=s.attributes)===null||a===void 0?void 0:a.ContentType)===t&&(s==null||(i=s.attributes)===null||i===void 0?void 0:i.Extension)===r})||n.push({attributes:{ContentType:t,Extension:r},name:"Default",type:"element"})},og=(e,t,r)=>{const n=he(e,"Types");n.some(s=>{var a;return s.type==="element"&&s.name==="Override"&&((a=s.attributes)===null||a===void 0?void 0:a.PartName)===r})||n.push({attributes:{ContentType:t,PartName:r},name:"Override",type:"element"})},lg=(e,t)=>{var r;const n=(r=e.elements)===null||r===void 0?void 0:r.find(s=>s.name==="Types");n?.elements!==void 0&&(n.elements=n.elements.filter(s=>{var a,i;return!(s.name==="Override"&&String((a=(i=s.attributes)===null||i===void 0?void 0:i.PartName)!==null&&a!==void 0?a:"").toLowerCase()===t.toLowerCase())}))},cg=e=>{const t=parseInt(e.substring(3),10);return isNaN(t)?0:t},Zs=e=>he(e,"Relationships").map(t=>{var r,n;return cg((r=(n=t.attributes)===null||n===void 0||(n=n.Id)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"")}).reduce((t,r)=>Math.max(t,r),0)+1,Qs=(e,t,r,n,s)=>{const a=he(e,"Relationships");return a.push({attributes:{Id:`rId${t}`,Type:r,Target:n,TargetMode:s},name:"Relationship",type:"element"}),a},ar=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),Jc="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",ug="application/vnd.openxmlformats-package.core-properties+xml",Zc="_rels/.rels",Qc="docProps/core.xml",ea={cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/"},dg={title:{namespace:"dc",name:"title"},subject:{namespace:"dc",name:"subject"},creator:{namespace:"dc",name:"creator"},keywords:{namespace:"cp",name:"keywords"},description:{namespace:"dc",name:"description"},lastModifiedBy:{namespace:"cp",name:"lastModifiedBy"},revision:{namespace:"cp",name:"revision"}},eu=e=>e===""?[]:[{type:"text",text:String(e)}],tu=e=>{var t;return(t=e.name)===null||t===void 0?void 0:t.slice(e.name.indexOf(":")+1)},hg=(e,t)=>{var r;const n=(r=Object.entries(w({},e.attributes)).find(([s,a])=>(s==="xmlns"||s.startsWith("xmlns:"))&&a===ea[t]))===null||r===void 0?void 0:r[0];return n===void 0?(e.attributes=w(w({},e.attributes),{},{[`xmlns:${t}`]:ea[t]}),`${t}:`):n==="xmlns"?"":`${n.slice(6)}:`},mg=e=>{const t=e[0]===255&&e[1]===254?"utf-16le":e[0]===254&&e[1]===255?"utf-16be":"utf-8";return new TextDecoder(t).decode(e)},pg=(e,t,r)=>{var n;const s=t.get(r);if(s===void 0)return e.get(r);const a=qe(mg(s));return!((n=a.declaration)===null||n===void 0)&&n.attributes&&(a.declaration.attributes.encoding="UTF-8"),t.delete(r),e.set(r,a),a},vg=e=>{var t,r;const n=(t=e.get(Zc))!==null&&t!==void 0?t:ar(),s=(r=he(n,"Relationships").find(a=>{var i;return((i=a.attributes)===null||i===void 0?void 0:i.Type)===Jc}))===null||r===void 0||(r=r.attributes)===null||r===void 0?void 0:r.Target;return typeof s=="string"?ft("",s):(Qs(n,Zs(n),Jc,Qc),e.set(Zc,n),Qc)},fg=(e,t,r,{addContentTypeOverride:n})=>{var s,a;const i=vg(e),o=pg(e,t,i),c=o??{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"cp:coreProperties",attributes:{"xmlns:cp":ea.cp},elements:[]}]};o===void 0&&(e.set(i,c),n(ug,`/${i}`));const l=(s=c.elements)===null||s===void 0?void 0:s.find(u=>tu(u)==="coreProperties");if(l===void 0)throw new Error(`Could not find the core properties in ${i}`);(a=l.elements)!==null&&a!==void 0||(l.elements=[]);for(const[u,{namespace:d,name:m}]of Object.entries(dg)){const g=r[u];if(g===void 0)continue;const p=l.elements.find(f=>tu(f)===m);p?p.elements=eu(g):l.elements.push({type:"element",name:`${hg(l,d)}${m}`,elements:eu(g)})}},ta=new Set(["wp:inline","wp:anchor"]),ra=new Set(["wp:docPr","wps:cNvPr","wpg:cNvPr"]),wg=new Set(["a:stCxn","a:endCxn"]),jr=(e,t)=>{var r,n;if(!t.has((r=e.name)!==null&&r!==void 0?r:""))return;const s=Number((n=e.attributes)===null||n===void 0?void 0:n.id);return Number.isInteger(s)?s:void 0},ru=e=>{var t;const r=jr(e,ra);return[...r===void 0?[]:[r],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(ru)]},gg=e=>{const t=r=>{var n;const s=jr(r,ra);return[...s===void 0?[]:[s],...((n=r.elements)!==null&&n!==void 0?n:[]).flatMap(a=>{var i;return ta.has((i=a.name)!==null&&i!==void 0?i:"")?[]:t(a)})]};return t(e)},yg=e=>{const t=new Set(e);let r=e.reduce((i,o)=>Math.max(i,o),0);const n=i=>{const o=t.has(i)?r+1:i;return r=Math.max(r,o),t.add(o),o},s=i=>{const o=new Map([...new Set(gg(i))].map(l=>[l,n(l)])),c=l=>{var u,d;if(l!==i&&ta.has((u=l.name)!==null&&u!==void 0?u:""))return s(l);const m=(d=jr(l,ra))!==null&&d!==void 0?d:jr(l,wg),g=m===void 0?void 0:o.get(m);return w(w(w({},l),g===void 0?{}:{attributes:w(w({},l.attributes),{},{id:String(g)})}),l.elements===void 0?{}:{elements:l.elements.map(c)})};return c(i)},a=i=>{var o;return ta.has((o=i.name)!==null&&o!==void 0?o:"")?s(i):w(w({},i),i.elements===void 0?{}:{elements:i.elements.map(a)})};return i=>i.map(a)},ie={DOCUMENT:"file",PARAGRAPH:"paragraph",TABLE_ROWS:"tableRows",DRAWING:"drawing"},nu=class{constructor(){v(this,"type",ie.DRAWING)}},bg=new Map([["wp:inline","wp:docPr"],["wp:anchor","wp:docPr"],["wpg:graphicFrame","wpg:cNvPr"],["wpc:graphicFrame","wpg:cNvPr"]]),Xr=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(r=>{var n;const s=r.name===void 0?void 0:bg.get(r.name),a=s===void 0||(n=r.elements)===null||n===void 0?void 0:n.find(i=>i.name===s);return[...a?[{element:r,properties:a}]:[],...Xr(r)]})},su=e=>{var t,r;return[(t=e.attributes)===null||t===void 0?void 0:t.descr,(r=e.attributes)===null||r===void 0?void 0:r.title].flatMap(n=>n===void 0?[]:[String(n)])},au="[Content_Types].xml",Tg=e=>{var t;if(!(!((t=e.elements)===null||t===void 0)&&t.some(n=>n.name==="Relationships"))){var r;e.elements=[...(r=e.elements)!==null&&r!==void 0?r:[],...ar().elements]}return he(e,"Relationships")},Eg="http://schemas.openxmlformats.org/officeDocument/2006/relationships",na=e=>{var t,r;return new Set(["r",...Object.entries((t=e.attributes)!==null&&t!==void 0?t:{}).flatMap(([n,s])=>n.startsWith("xmlns:")&&s===Eg?[n.slice(6)]:[]),...((r=e.elements)!==null&&r!==void 0?r:[]).flatMap(n=>[...na(n)])])},sa=(e,t)=>{var r,n;return new Set([...Object.entries((r=e.attributes)!==null&&r!==void 0?r:{}).flatMap(([s,a])=>s.includes(":")&&t.has(s.slice(0,s.indexOf(":")))?[String(a)]:[]),...((n=e.elements)!==null&&n!==void 0?n:[]).flatMap(s=>[...sa(s,t)])])},xg=(e,t)=>{const r=l=>e.has(l)||t.has(l),n=l=>{if(r(l))return l;const u=(()=>{try{return decodeURI(l)}catch{return}})();if(u!==void 0&&r(u))return u;const d=l.toLowerCase();return[...e.keys(),...t.keys()].find(m=>m.toLowerCase()===d)},s=(l,u)=>{const d=e.get(Le(l));return d===void 0?void 0:he(d,"Relationships").find(m=>{var g;return m.name==="Relationship"&&((g=m.attributes)===null||g===void 0?void 0:g.Id)===u})},a=(l,u)=>{var d,m;const g=(d=u.attributes)===null||d===void 0?void 0:d.Target;return((m=u.attributes)===null||m===void 0?void 0:m.TargetMode)==="External"||g===void 0?void 0:n(ft(l,String(g)))},i=l=>[...e].some(([u,d])=>u.endsWith(".rels")&&he(d,"Relationships").some(m=>a(ic(u),m)===l)),o=(l,u)=>{if(u===void 0||u===l||u===au||u.endsWith(".rels")||i(u))return;const d=e.get(Le(u));e.delete(u),t.delete(u),e.delete(Le(u));const m=e.get(au);m!==void 0&&lg(m,`/${u}`);for(const g of d===void 0?[]:he(d,"Relationships"))o(u,a(u,g))};return{findRelationship:s,pathOf:a,removeIfUnreferenced:o,removeRelationships:(l,u)=>{var d,m;const g=(d=e.get(Le(l)))===null||d===void 0||(d=d.elements)===null||d===void 0?void 0:d.find(f=>f.name==="Relationships"),p=((m=g?.elements)!==null&&m!==void 0?m:[]).filter(f=>{var y;return f.name==="Relationship"&&u.has(String((y=f.attributes)===null||y===void 0?void 0:y.Id))});if(!(g===void 0||p.length===0)){g.elements=g.elements.filter(f=>!p.includes(f));for(const f of p)o(l,a(l,f))}}}},Sg=(e,{findRelationship:t,pathOf:r,removeIfUnreferenced:n},s,a)=>{const i=new gt;return{getRelatedPart:(o,c)=>{const l=t(o.path,c),u=l===void 0?void 0:r(o.path,l);return u===void 0?void 0:{path:u,xml:e.get(u)}},replaceRelatedPart:(o,c,l)=>{const u=`word/${s.PackageParts.add(l)}`,{relationshipType:d}=l.options,m=Ns(o.path,u),g=c===void 0?void 0:t(o.path,c);if(g===void 0){var p;const y=Le(o.path),I=(p=e.get(y))!==null&&p!==void 0?p:ar();e.set(y,I);const C=c??`rId${Zs(I)}`;return Tg(I).push({type:"element",name:"Relationship",attributes:{Id:C,Type:d,Target:m}}),C}const f=r(o.path,g);return g.attributes=w(w({},Object.fromEntries(Object.entries(g.attributes).filter(([y])=>y!=="TargetMode"))),{},{Type:d,Target:m}),n(o.path,f),String(g.attributes.Id)},format:o=>qe(H(i.format(o,a))).elements[0]}},Ag=({parts:e,binaryParts:t,file:r,patches:n,delimiters:s},a)=>{const i=n.map(([l,u])=>({placeholder:`${s.start}${l}${s.end}`,patch:u})),o=[...e].filter(([l])=>l.startsWith("word/")&&!l.endsWith(".rels")).flatMap(([l,u])=>Xr(u).flatMap(d=>{const m=su(d.properties),g=i.filter(({placeholder:y})=>m.some(I=>I.includes(y)));if(g.length>1){var p,f;throw new Error(`The drawing "${(p=(f=d.properties.attributes)===null||f===void 0?void 0:f.name)!==null&&p!==void 0?p:""}" in ${l} has the placeholders ${g.map(({placeholder:y})=>y).join(" and ")} in its alt text. A drawing can only be patched once`)}return g.map(({placeholder:y,patch:I})=>({drawing:w(w({placeholder:y},d),{},{part:{path:l,xml:u}}),patch:I}))})),c=xg(e,t);for(const{drawing:l,patch:u}of o){const d=sa(l.element,na(l.part.xml));u.patch(l,Sg(e,c,r,a(l.part.path)));const m=sa(l.part.xml,na(l.part.xml));c.removeRelationships(l.part.path,new Set([...d].filter(g=>!m.has(g))))}},Ig=e=>typeof e=="object"&&e!==null&&"on"in e&&typeof e.on=="function",Cg=e=>typeof e=="object"&&e!==null&&"generateAsync"in e&&typeof e.generateAsync=="function",Ng=e=>["[object Blob]","[object File]"].includes(Object.prototype.toString.call(e)),Rg=e=>new Promise((t,r)=>{const n=[];e.on("data",s=>{ArrayBuffer.isView(s)?n.push(new Uint8Array(s.buffer,s.byteOffset,s.byteLength)):typeof s=="number"?n.push(s):r(new TypeError(`A template stream must give bytes, but it gave a ${typeof s}. A stream with an encoding set gives text, so do not set one.`))}),e.on("error",r),e.on("end",()=>{const s=new Uint8Array(n.reduce((a,i)=>a+(typeof i=="number"?1:i.length),0));n.reduce((a,i)=>typeof i=="number"?(s[a]=i,a+1):(s.set(i,a),a+i.length),0),t(s)})}),kg=(function(){var e=dt(function*(t){return Cg(t)?t.generateAsync({type:"uint8array"}):Ig(t)?Rg(t):Ng(t)?new Uint8Array(yield t.arrayBuffer()):typeof t=="string"?Uint8Array.from({length:t.length},(r,n)=>t.charCodeAt(n)):Array.isArray(t)?Uint8Array.from(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)});return function(r){return e.apply(this,arguments)}})(),iu=(function(){var e=dt(function*(t,r){return Wr(yield kg(t),r)});return function(r,n){return e.apply(this,arguments)}})(),Pg=new gt,Kr="word/document.xml",Og={path:"word/footnotes.xml",rootName:"w:footnotes",noteName:"w:footnote",referenceName:"w:footnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",create:{part:()=>new ps,mark:()=>new Rl,styles:()=>[new Vl({}),new Xl({}),new jl({})]}},Lg={path:"word/endnotes.xml",rootName:"w:endnotes",noteName:"w:endnote",referenceName:"w:endnoteReference",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml",relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",create:{part:()=>new hs,mark:()=>new Sl,styles:()=>[new Kl({}),new ql({}),new zl({})]}},zr=(e,t)=>qe(H(Pg.format(e,t))).elements[0],ou=(e,t)=>{var r,n,s;const a=t.includes((r=e.name)!==null&&r!==void 0?r:"")?Number((n=e.attributes)===null||n===void 0?void 0:n["w:id"]):NaN;return[...Number.isInteger(a)?[a]:[],...((s=e.elements)!==null&&s!==void 0?s:[]).flatMap(i=>ou(i,t))]},_g=(e,t)=>{var r,n;const s=(r=e.elements)!==null&&r!==void 0?r:[],a=((n=s[0])===null||n===void 0?void 0:n.name)==="w:pPr"?1:0;return w(w({},e),{},{elements:[...s.slice(0,a),t,...s.slice(a)]})},lu=(e,t,r,{createContext:n,addContentTypeOverride:s,renumberBookmarks:a,renumberDrawings:i,renumberLists:o,useStyles:c})=>{const l=new Map(Object.entries(t).map(([C,E])=>[Number(C),E])),u=new Map;let d=[...l.keys()].filter(Number.isFinite).reduce((C,E)=>Math.max(C,Math.floor(E)),0);const m=new Map;let g;const p=C=>{var E,P;const L=C.name===e.referenceName?l.get(Number((E=C.attributes)===null||E===void 0?void 0:E["w:id"])):void 0;return L===void 0?C.elements===void 0?C:w(w({},C),{},{elements:C.elements.map(p)}):(g=((P=g)!==null&&P!==void 0?P:[...r.values()].flatMap(S=>ou(S,[e.noteName,e.referenceName])).reduce((S,x)=>Math.max(S,x),0))+1,m.set(g,L),w(w({},C),{},{attributes:w(w({},C.attributes),{},{"w:id":String(g)})}))},f=()=>{var C;const E=he((C=r.get(Le(Kr)))!==null&&C!==void 0?C:{},"Relationships").find(L=>{var S;return((S=L.attributes)===null||S===void 0?void 0:S.Type)===e.relationshipType}),P=E?ft(Kr,String(E.attributes.Target)):e.path;return r.has(P)||(r.set(P,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[zr(e.create.part(),n(P))]}),s(e.contentType,`/${P}`)),E||n(Kr).viewWrapper.Relationships.addRelationship(Ze(),e.relationshipType,Ns(Kr,P)),P};return{renumber:C=>C.map(p),write:()=>{if(m.size===0)return;const C=f(),E=n(C),P=new Map([...new Set(m.values())].map(S=>{const x=zr(e.create.mark(),E);return[S,c(o(a(S.children.map(A=>zr(A,E)).map((A,N)=>N===0?_g(A,x):A))))]}));he(r.get(C),e.rootName).push(...[...m].map(([S,x])=>({type:"element",name:e.noteName,attributes:{"w:id":String(S)},elements:[...i(P.get(x))]})));const L=r.get("word/styles.xml");if(L){const S=he(L,"w:styles"),x=new Set(S.map(A=>{var N;return(N=A.attributes)===null||N===void 0?void 0:N["w:styleId"]}));S.push(...e.create.styles().map(A=>zr(A,E)).filter(A=>{var N;return!x.has((N=A.attributes)===null||N===void 0?void 0:N["w:styleId"])}))}},carry:(C,E)=>{const P=u.get(C);return P!==void 0?P:(d++,l.set(d,E),u.set(C,d),d)}}},Dg=({footnotes:e={},endnotes:t={}},r,n)=>{const s={footnotes:lu(Og,e,r,n),endnotes:lu(Lg,t,r,n)};return{carry:(a,i,o)=>s[a].carry(i,o),renumber:a=>Object.values(s).reduce((i,o)=>o.renumber(i),a),write:()=>{for(const a of Object.values(s))a.write()}}},Mg=new gt,qr="word/document.xml",Fg="word/numbering.xml",$g="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",cu="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",Hg="default-bullet-numbering",Bg="1",Wg=(e,t)=>qe(H(Mg.format(e,t))).elements[0],uu=e=>e.reduce((t,r)=>Math.max(t,r),0),Ug=(e,t,{createContext:r,addContentTypeOverride:n})=>{const s=new Map;let a;const i=()=>{var p;return he((p=t.get(Le(qr)))!==null&&p!==void 0?p:{},"Relationships").find(f=>{var y;return((y=f.attributes)===null||y===void 0?void 0:y.Type)===cu})},o=(p=i())=>p?ft(qr,String(p.attributes.Target)):Fg,c=(p,f)=>{var y;return he((y=t.get(o()))!==null&&y!==void 0?y:{},"w:numbering").filter(I=>I.name===p).map(I=>Number(I.attributes[f]))},l=p=>{if(p===Bg)return e.ConcreteNumbering.find(({reference:y})=>y===Hg);if(!p.startsWith("{"))return;const f=e.ConcreteNumbering.find(({reference:y,instance:I})=>p===`{${y}-${I}}`);if(!f){const y=p.slice(1,-1).replace(/-\d+$/,"");throw new Error(`A paragraph in a patch uses the numbering "${y}", which isn't in the numbering option of patchDocument. Add it there with its levels, as in a Document`)}return f},u=p=>{var f;const y=s.get(p.numId);return y!==void 0?y:(a=((f=a)!==null&&f!==void 0?f:uu(c("w:num","w:numId")))+1,s.set(p.numId,a),a)},d=p=>{const f=p.name==="w:numId"?l(String(p.attributes["w:val"])):void 0;return f===void 0?p.elements===void 0?p:w(w({},p),{},{elements:p.elements.map(d)}):w(w({},p),{},{attributes:w(w({},p.attributes),{},{"w:val":String(u(f))})})},m=p=>{const f=i(),y=o(f);return t.has(y)||(t.set(y,{declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[w(w({},p),{},{elements:[]})]}),n($g,`/${y}`)),f||r(qr).viewWrapper.Relationships.addRelationship(Ze(),cu,Ns(qr,y)),y};return{renumber:p=>p.map(d),write:()=>{var p,f;if(s.size===0)return;const y=Wg(e,r(o())),I=k=>Number(k.elements.find(D=>D.name==="w:abstractNumId").attributes["w:val"]),C=y.elements.filter(k=>k.name==="w:num"&&s.has(Number(k.attributes["w:numId"]))),E=uu(c("w:abstractNum","w:abstractNumId")),P=new Map([...new Set(C.map(I))].map((k,D)=>[k,E+D+1])),L=y.elements.flatMap(k=>{const D=k.name==="w:abstractNum"?P.get(Number(k.attributes["w:abstractNumId"])):void 0;return D===void 0?[]:[w(w({},k),{},{attributes:w(w({},k.attributes),{},{"w:abstractNumId":String(D)})})]}),S=m(y),x=t.get(S).elements.find(k=>k.name==="w:numbering");x.attributes=w(w(w({},Object.fromEntries(Object.entries(y.attributes).filter(([k])=>k.startsWith("xmlns:")))),x.attributes),{},{"mc:Ignorable":[...new Set([...String((p=(f=x.attributes)===null||f===void 0?void 0:f["mc:Ignorable"])!==null&&p!==void 0?p:"").split(" "),...String(y.attributes["mc:Ignorable"]).split(" ")])].filter(k=>k!=="").join(" ")});const A=he(t.get(S),"w:numbering"),N=k=>{const D=A.findIndex(M=>k.includes(M.name));return D===-1?A.length:D};A.splice(N(["w:num","w:numIdMacAtCleanup"]),0,...L),A.splice(N(["w:numIdMacAtCleanup"]),0,...C.map(k=>w(w({},k),{},{attributes:w(w({},k.attributes),{},{"w:numId":String(s.get(Number(k.attributes["w:numId"])))}),elements:k.elements.map(D=>D.name==="w:abstractNumId"?w(w({},D),{},{attributes:{"w:val":String(P.get(I(k)))}}):D)})))}}},aa={nameOf:e=>e.type==="element"?e.name:void 0,contentOf:e=>e.elements,attributeOf:(e,t)=>{var r;return(r=e.attributes)===null||r===void 0?void 0:r[t]},textOf:e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).filter(({type:r})=>r==="text").map(({text:r})=>String(r)).join("")},textElement:e=>({type:"element",name:"w:t",attributes:{"xml:space":"preserve"},elements:[{type:"text",text:e}]}),writeClean:(e,t)=>{var r;/^\s*(PAGEREF|TOC)\b/i.test(t)&&((r=e.attributes)===null||r===void 0?void 0:r["w:dirty"])!==void 0&&(e.attributes=Object.fromEntries(Object.entries(e.attributes).filter(([n])=>n!=="w:dirty")))},setSimpleFieldResult:(e,t)=>{e.elements=[{type:"element",name:"w:r",elements:[aa.textElement(t)]}]}},ia="word/document.xml",Gg="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",Vg=[80,75,3,4],jg=(function(){var e=dt(function*(t){if(Vg.every((r,n)=>t[n]===r))try{const r=new Map,n=new Map;for(const[a,i]of Wr(t))/\.(xml|rels)$/.test(a)?r.set(a,qe(Vr(i))):n.set(a,i);const s=yield du(r,n);return w({parts:r,binaryParts:n},s.size>0?{importedDocuments:s}:{})}catch{return}});return function(r){return e.apply(this,arguments)}})(),du=(function(){var e=dt(function*(t,r){const n=new Map;for(const[i,o]of t){var s,a;if(i.endsWith(".rels"))for(const{attributes:c={}}of(s=(a=Yr(o))===null||a===void 0?void 0:a.elements)!==null&&s!==void 0?s:[]){const l=ft(ic(i),String(c.Target)),u=r.get(l),d=c.Type===Gg&&c.TargetMode!=="External"&&u?yield jg(u):void 0;d&&n.set(l,d)}}return n});return function(r,n){return e.apply(this,arguments)}})(),Yr=e=>{var t;return e==null||(t=e.elements)===null||t===void 0?void 0:t.find(({type:r})=>r==="element")},Xg=(function(){var e=dt(function*(t,r,n=new Map){var s,a;const i=Yr(t.get(ia));if(!i)return;const o=yield du(t,n),c=r(w({parts:t,binaryParts:n},o.size>0?{importedDocuments:o}:{})),l=Vi(aa,i,c,{blank:!0}),u=(s=(a=Yr(t.get(Le(ia))))===null||a===void 0?void 0:a.elements)!==null&&s!==void 0?s:[];for(const{attributes:d={}}of u){const m=/\/(header|footer)$/.test(String(d.Type))?Yr(t.get(ft(ia,String(d.Target)))):void 0;m&&ji(aa,m,c,{blank:!0,sectionPageCount:l.get(String(d.Id))})}});return function(r,n){return e.apply(this,arguments)}})(),Kg=new Set(["w:hyperlink","w:sdt","w:sdtContent","w:ins","w:moveTo","w:smartTag","w:customXml","w:fldSimple","w:dir","w:bdo"]),hu=(e,t)=>{var r;return((r=e.elements)!==null&&r!==void 0?r:[]).flatMap((n,s)=>{var a;return n.name==="w:r"?[{element:n,path:[...t,s]}]:Kg.has((a=n.name)!==null&&a!==void 0?a:"")?hu(n,[...t,s]):[]})},Jr=(e,t)=>t.reduce((r,n)=>r.elements[n],e),ir=e=>{if(e.element.name!=="w:p")throw new Error(`Invalid node type: ${e.element.name}`);if(!e.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let t=0;const r=hu(e.element,[]).map(({element:n,path:s})=>{const a=zg(n,s,t);return t+=a.text.length,a});return{text:r.reduce((n,s)=>n+s.text,""),runs:r,index:e.index,pathToParagraph:mu(e)}},zg=(e,t,r)=>{if(!e.elements)return{text:"",parts:[],path:t,start:r,end:r};let n=r;const s=e.elements.map((a,i)=>{var o,c;if(a.name!=="w:t"||!a.elements||a.elements.length===0)return;const l=(o=(c=a.elements[0].text)===null||c===void 0?void 0:c.toString())!==null&&o!==void 0?o:"",u=n;return n+=l.length,{text:l,index:i,start:u,end:u+l.length-1}}).filter(a=>!!a).map(a=>a);return{text:s.reduce((a,i)=>a+i.text,""),parts:s,path:t,start:r,end:s.length>0?s[s.length-1].end:r}},mu=e=>e.parent?[...mu(e.parent),e.index]:[e.index],qg=class extends Error{constructor(e){super(`Token ${e} not found`),this.name="TokenNotFoundError"}},Yg=(e,t)=>{const r=ir({element:e,index:0,parent:void 0}).runs.find(({parts:n})=>n.some(({text:s})=>s.includes(t)));if(!r)throw new qg(t);return r.path},Jg=(e,t)=>{var r,n;let s=-1;const a=(r=(n=e.elements)===null||n===void 0?void 0:n.map((i,o)=>{if(s!==-1)return i;if(i.type==="element"&&i.name==="w:t"){var c,l;const u=((c=(l=i.elements)===null||l===void 0||(l=l[0])===null||l===void 0?void 0:l.text)!==null&&c!==void 0?c:"").split(t),d=u.map(m=>w(w(w({},i),qc(i)),{},{elements:zc(m)}));return u.length>1&&(s=o),d}else return i}).flat())!==null&&r!==void 0?r:[];return{left:w(w({},JSON.parse(JSON.stringify(e))),{},{elements:a.slice(0,s+1)}),right:w(w({},JSON.parse(JSON.stringify(e))),{},{elements:a.slice(s+1)})}},or={START:0,MIDDLE:1,END:2},pu=({paragraphElement:e,renderedParagraph:t,originalText:r,replacementText:n,fromIndex:s=0})=>{const a=t.text.indexOf(r,s),i=a+r.length-1;let o=or.START;for(const c of t.runs){const l=Jr(e,c.path);for(const{text:u,index:d,start:m,end:g}of c.parts)switch(o){case or.START:if(a>=m&&a<=g){const p=a-m,f=Math.min(i,g)-m;if(u.substring(p,f+1)==="")continue;const y=u.substring(0,p)+n+u.substring(f+1);oa(l.elements[d],y),o=or.MIDDLE;continue}break;case or.MIDDLE:if(i<=g){const p=u.substring(i-m+1);oa(l.elements[d],p);const f=l.elements[d];l.elements[d]=qc(f),o=or.END}else oa(l.elements[d],"")}}return e},oa=(e,t)=>(e.elements=zc(t),e),vu=e=>{var t,r;return(t=(r=e.element.elements)===null||r===void 0?void 0:r.map((n,s)=>({element:n,index:s,parent:e})))!==null&&t!==void 0?t:[]},fu=e=>{const t=[],r=[...vu({element:e,index:0,parent:void 0})];for(const n of r){n.element.name==="w:p"&&t.push(ir(n));for(const s of vu(n))r.push(s)}return t},la=(e,t)=>fu(e).filter(r=>r.text.includes(t)),ca="\uFFFF",Zg=({json:e,patch:t,patchText:r,context:n,keepOriginalStyles:s=!0,recursive:a=!0,renumberIds:i=o=>o})=>{const o=la(e,r);if(o.length===0)return{element:e,didFindOccurrence:!1};const c=[...o].reverse(),l=t.type===ie.DOCUMENT?cy(c):c;let u;const d=()=>{var g;return u=((g=u)!==null&&g!==void 0?g:bu(e))+1,String(u)};for(const g of l)switch(t.type){case ie.DOCUMENT:{var m;const p=uy(e,g.pathToParagraph),f=dy(g.pathToParagraph),y=wu(t,n,i),I=p.name==="w:tc"&&f===p.elements.length-1&&((m=y[y.length-1])===null||m===void 0?void 0:m.name)!=="w:p"?[{type:"element",name:"w:p"}]:[];p.elements.splice(f,1,...y,...I);break}case ie.PARAGRAPH:default:{const p=Tu(e,g.pathToParagraph);let f=g,y=0;do y=Qg({paragraphElement:p,renderedParagraph:f,patchText:r,fromIndex:y,children:wu(t,n,i),keepOriginalStyles:s,newTrackedChangeId:d}),f=ir({element:p,index:g.index,parent:void 0});while(a&&f.text.includes(r,y));break}}return{element:e,didFindOccurrence:!0}},wu=(e,t,r)=>r(e.children.flatMap(n=>{var s;return(s=n.writtenAs)!==null&&s!==void 0?s:n}).flatMap(n=>{const s=n.prepForXml(t);return s?[qe(H(s)).elements[0]]:[]})),Qg=({paragraphElement:e,renderedParagraph:t,patchText:r,fromIndex:n,children:s,keepOriginalStyles:a,newTrackedChangeId:i})=>{const o=t.text.indexOf(r,n);pu({paragraphElement:e,renderedParagraph:t,originalText:r,replacementText:ca,fromIndex:n});const c=Yg(e,ca),l=c.slice(0,-1),u=Jr(e,l),d=c[c.length-1],m=l.map((L,S)=>Jr(e,l.slice(0,S+1))).filter(L=>L.name==="w:sdt"),g=[...m].reverse().find(ey),p=u.elements[d],{left:f,right:y}=Jg(p,ca),I=p.elements.find(L=>L.type==="element"&&L.name==="w:rPr"),C=g?ty(g):I,E=a&&C?s.map(L=>gu(L,C)):s,P=I?w(w({},y),{},{elements:[I,...y.elements]}):y;return u.elements.splice(d,1,f,...E,P),m.forEach(L=>sy(L,E)),iy(e,l,i),o+ir({element:{name:"w:p",elements:[...E]},index:0,parent:void 0}).text.length},ua=e=>{var t;return(t=e.elements)===null||t===void 0?void 0:t.find(r=>r.name==="w:sdtPr")},ey=e=>{var t;return!!(!((t=ua(e))===null||t===void 0||(t=t.elements)===null||t===void 0)&&t.some(r=>r.name==="w:showingPlcHdr"))},ty=e=>{var t;return(t=ua(e))===null||t===void 0||(t=t.elements)===null||t===void 0?void 0:t.find(r=>r.name==="w:rPr")},ry=new Set(["w:rPr","w:t","w:tab","w:br"]),ny=e=>e.name==="w:bookmarkStart"||e.name==="w:bookmarkEnd"||e.name==="w:r"&&yt(e).every(t=>ry.has(t.name)),sy=(e,t)=>{const r=ua(e);if(!r?.elements)return;const n=r.elements.some(s=>s.name==="w:text")&&!t.every(ny);r.elements=r.elements.filter(s=>s.name!=="w:showingPlcHdr"&&s.name!=="w:dataBinding"&&!(n&&s.name==="w:text"))},da=new Set(["w:hyperlink","w:fldSimple","w:subDoc"]),ay=new Map([["w:ins",da],["w:moveTo",da],["w:hyperlink",new Set(["w:hyperlink"])]]),iy=(e,t,r)=>{for(let s=t.length;s>0;s--){var n;const a=Jr(e,t.slice(0,s-1)),i=t[s-1],o=a.elements[i],c=ay.get(o.name),l=y=>!!c?.has(y.name);if(!(!((n=o.elements)===null||n===void 0)&&n.some(l)))continue;const{elements:u}=o,d=u.flatMap((y,I)=>I===0||l(y)||l(u[I-1])?[I]:[]),m=d.map((y,I)=>u.slice(y,d[I+1])),g=c===da;let p=!0;const f=m.map(y=>{if(l(y[0]))return y[0];const I=g&&!p?w(w({},o.attributes),{},{"w:id":r()}):o.attributes;return p=!1,w(w({},o),{},{attributes:I,elements:[...y]})});a.elements.splice(i,1,...f)}},gu=(e,t)=>e.name==="w:r"?oy(e,t):e.elements?w(w({},e),{},{elements:e.elements.map(r=>gu(r,t))}):e,oy=(e,t)=>{const r=yt(e).find(i=>i.type==="element"&&i.name==="w:rPr");if(!r)return w(w({},e),{},{elements:[t,...yt(e)]});const n=new Set(yt(r).map(i=>i.name)),s=[...yt(t).filter(i=>!n.has(i.name)),...yt(r)],a=w(w({},r),{},{elements:[...s].sort((i,o)=>yu(i)-yu(o))});return w(w({},e),{},{elements:yt(e).map(i=>i===r?a:i)})},ha=["w:rStyle","w:rFonts","w:b","w:bCs","w:i","w:iCs","w:caps","w:smallCaps","w:strike","w:dstrike","w:outline","w:shadow","w:emboss","w:imprint","w:noProof","w:snapToGrid","w:vanish","w:webHidden","w:color","w:spacing","w:w","w:kern","w:position","w:sz","w:szCs","w:highlight","w:u","w:effect","w:bdr","w:shd","w:fitText","w:vertAlign","w:rtl","w:cs","w:em","w:lang","w:eastAsianLayout","w:specVanish","w:oMath","w14:glow","w14:shadow","w14:reflection","w14:textOutline","w14:textFill","w14:scene3d","w14:props3d","w14:ligatures","w14:numForm","w14:numSpacing","w14:stylisticSets","w14:cntxtAlts"],yu=e=>{var t;if(e.name==="w:rPrChange")return ha.length+1;const r=ha.indexOf((t=e.name)!==null&&t!==void 0?t:"");return r===-1?ha.length:r},yt=e=>{var t;return(t=e.elements)!==null&&t!==void 0?t:[]},bu=e=>{var t,r;const n=Number((t=e.attributes)===null||t===void 0?void 0:t["w:id"]);return((r=e.elements)!==null&&r!==void 0?r:[]).reduce((s,a)=>Math.max(s,bu(a)),Number.isInteger(n)?n:0)},ly=(e,t)=>e.length>t.length&&t.every((r,n)=>e[n]===r),cy=e=>e.filter(t=>!e.some(r=>ly(t.pathToParagraph,r.pathToParagraph))),Tu=(e,t)=>{let r=e;for(let n=1;n<t.length;n++){const s=t[n];r=r.elements[s]}return r},uy=(e,t)=>Tu(e,t.slice(0,t.length-1)),dy=e=>e[e.length-1],hy=new gt,ma="word/styles.xml",my=new Set(["w:pStyle","w:rStyle","w:tblStyle","w:basedOn","w:next","w:link"]),lr=e=>{var t;return String((t=e.attributes)===null||t===void 0?void 0:t["w:styleId"])},pa=e=>{var t;const r=(t=e.elements)===null||t===void 0||(t=t.find(n=>n.name==="w:name"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"];return r===void 0?void 0:String(r).toLowerCase()},Zr=(e,t)=>{var r;return e==null||(r=e.elements)===null||r===void 0?void 0:r.find(n=>n.name===t)},Eu=e=>{var t;const r=Number((t=Zr(e,"w:sz"))===null||t===void 0||(t=t.attributes)===null||t===void 0?void 0:t["w:val"]);return Number.isNaN(r)?void 0:r},py=e=>{var t,r;const n=e.filter(i=>i.name==="w:style"),s=(t=n.find(i=>lr(i)==="Normal"))!==null&&t!==void 0?t:n.find(i=>{var o;return((o=i.attributes)===null||o===void 0?void 0:o["w:type"])==="paragraph"&&pa(i)==="normal"}),a=e.find(i=>i.name==="w:docDefaults");return(r=Eu(Zr(s,"w:rPr")))!==null&&r!==void 0?r:Eu(Zr(Zr(a,"w:rPrDefault"),"w:rPr"))},vy=(e,t)=>new Map(Object.values(xs({document:{run:{size:t}}})).map(r=>qe(H(hy.format(r,e))).elements[0]).filter(r=>r.name==="w:style").map(r=>[lr(r),r])),fy=(e,t)=>{var r;const n=he((r=e.get(ma))!==null&&r!==void 0?r:{},"w:styles"),s=n.filter(p=>p.name==="w:style"),a=new Set(s.map(lr));let i;const o=p=>{var f;return(f=i)!==null&&f!==void 0||(i=vy(t(ma),py(n))),i.get(p)},c=new Set,l=new Map,u=p=>{const f=a.has(p)?void 0:o(p);if(f===void 0)return p;const y=s.find(I=>{var C,E;return((C=I.attributes)===null||C===void 0?void 0:C["w:type"])===((E=f.attributes)===null||E===void 0?void 0:E["w:type"])&&pa(I)===pa(f)});return y!==void 0?lr(y):(c.add(p),p)},d=p=>(l.has(p)||l.set(p,u(p)),l.get(p)),m=p=>{var f;return my.has((f=p.name)!==null&&f!==void 0?f:"")?w(w({},p),{},{attributes:w(w({},p.attributes),{},{"w:val":d(String(p.attributes["w:val"]))})}):p.elements===void 0?p:w(w({},p),{},{elements:p.elements.map(m)})};return{use:p=>p.map(m),write:()=>{const p=e.get(ma);if(!p)return;const f=he(p,"w:styles"),y=new Set(f.map(lr));for(const I of c)y.has(I)||(y.add(I),f.push(m(o(I))))}}},wy={type:ie.PARAGRAPH,children:[]},gy=({json:e,key:t,patch:r,delimiters:{start:n,end:s},patchPlaceholder:a,renumberDrawings:i})=>{const o=`${n}${t}.`;for(const c of yy(e,o)){const l=Ey(c.elements,o,s),u=r.rows.flatMap((d,m)=>{const g={type:"element",name:"w:tbl",elements:[...m===0?c.elements.map(xy):i(Su(c.elements))]},p=new Map(Object.entries(d).flatMap(([f,y])=>y===void 0?[]:[[f,y]]));for(const[f,y]of p)a(g,`${t}.${f}`,y);for(const f of l.filter(y=>!p.has(y)))a(g,`${t}.${f}`,wy);return g.elements});c.parent.elements.splice(c.parent.elements.indexOf(c.elements[0]),c.elements.length,...u),c.table&&!xu(c.table.element)&&c.table.parent.elements.splice(c.table.parent.elements.indexOf(c.table.element),1)}},yy=(e,t)=>{const r=la(e,t).flatMap(s=>{const a=by(e,s.pathToParagraph);return a?[a]:[]}),n=r.filter(s=>!r.some(a=>Ty(s.path,a.path))).filter((s,a,i)=>i.findIndex(o=>o.row===s.row)===a);return[...new Set(n.map(s=>s.parent))].flatMap(s=>{const a=s.elements.filter(c=>c.name==="w:tr"),i=n.filter(c=>c.parent===s).map(c=>a.indexOf(c.row)).sort((c,l)=>c-l),{table:o}=n.find(c=>c.parent===s);return i.reduce((c,l)=>{const u=c[c.length-1];return u?.[u.length-1]===l-1?[...c.slice(0,-1),[...u,l]]:[...c,[l]]},[]).map(c=>{const l=s.elements.indexOf(a[c[0]]),u=s.elements.indexOf(a[c[c.length-1]]);return{parent:s,table:o,elements:s.elements.slice(l,u+1)}})})},by=(e,t)=>{let r=e,n,s;for(let a=1;a<t.length;a++){const i=r.elements[t[a]];i.name==="w:tbl"&&(s={element:i,parent:r}),i.name==="w:tr"&&(n={parent:r,table:s,row:i,path:t.slice(0,a+1)}),r=i}return n},Ty=(e,t)=>e.length>t.length&&t.every((r,n)=>e[n]===r),xu=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).some(r=>r.name==="w:tr"||r.name!=="w:tblPr"&&r.name!=="w:tblGrid"&&xu(r))},Ey=(e,t,r)=>{const n=la({elements:[...e]},t).flatMap(({text:s})=>s.split(t).slice(1).flatMap(a=>{const i=a.indexOf(r);return i>0?[a.slice(0,i)]:[]}));return[...new Set(n)]},xy=e=>JSON.parse(JSON.stringify(e)),Sy=["w14:paraId","w14:textId"],Ay=["w:bookmarkStart","w:bookmarkEnd"],Su=(e,t)=>e.filter(r=>{var n;return!Ay.includes((n=r.name)!==null&&n!==void 0?n:"")&&!(t?.name==="w:sdtPr"&&r.name==="w:id")}).map(r=>w(w(w({},r),r.attributes===void 0?{}:{attributes:Object.fromEntries(Object.entries(r.attributes).filter(([n])=>!Sy.includes(n)))}),r.elements===void 0?{}:{elements:[...Su(r.elements,r)]})),Iy=e=>e[0]===255&&e[1]===254||e[0]===254&&e[1]===255,Cy=e=>{var t;const r=Cc(e,"word/document.xml"),n=r===void 0||(t=[...e].find(([s])=>lc(s,r)))===null||t===void 0?void 0:t[1];return n===void 0||Iy(n)?void 0:un(A0(Vr(n)))},Qr=(e,t,{start:r,end:n},s)=>{for(let a=e.indexOf(r,t);a!==-1;a=e.indexOf(r,a+1)){const i=e.indexOf(n,a+r.length);if(i===-1)return;const o=e.slice(a+r.length,i),c=o.trim();if(c!==o&&s(c))return{index:a,placeholder:e.slice(a,i+n.length),trimmed:`${r}${c}${n}`}}},Ny=(e,t,r)=>{let n=e;for(let s=Qr(n,0,t,r);s!==void 0;s=Qr(n,s.index+s.trimmed.length,t,r))n=`${n.slice(0,s.index)}${s.trimmed}${n.slice(s.index+s.placeholder.length)}`;return n},Au=e=>{var t;return((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(r=>[...r.name==="w:p"?[r]:[],...Au(r)])},Ry=(e,t,r)=>{const n=()=>ir({element:e,index:0,parent:void 0});for(let s=n(),a=Qr(s.text,0,t,r);a!==void 0;s=n(),a=Qr(s.text,a.index+a.trimmed.length,t,r))pu({paragraphElement:e,renderedParagraph:s,originalText:a.placeholder,replacementText:a.trimmed,fromIndex:a.index})},ky=(e,{delimiters:t,textKeys:r,tableRowsKeys:n,drawingKeys:s})=>{const a=c=>r.has(c)||n.some(l=>c.startsWith(`${l}.`));for(const c of Au(e))Ry(c,t,a);const i=c=>s.has(c);for(const{properties:c}of Xr(e))for(const l of["descr","title"]){var o;const u=(o=c.attributes)===null||o===void 0?void 0:o[l];u!==void 0&&(c.attributes[l]=Ny(String(u),t,i))}},Iu=e=>{var t;return e.name==="v:shapetype"&&((t=e.attributes)===null||t===void 0?void 0:t.id)!==void 0?String(e.attributes.id):void 0},Cu=e=>{var t;const r=Iu(e);return[...r===void 0?[]:[r],...((t=e.elements)!==null&&t!==void 0?t:[]).flatMap(Cu)]},Py=e=>{const t=new Set(Cu(e)),r=n=>{const s=Iu(n);return s!==void 0?t.has(s)?[]:(t.add(s),[n]):[n.elements===void 0?n:w(w({},n),{},{elements:n.elements.flatMap(r)})]};return n=>n.flatMap(r)},Oy="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Ly={png:"image/png",jpg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",svg:"image/svg+xml"},_y=["png","jpg","gif","bmp"],Nu=9525,Ru="{96DAC541-7B7A-43D3-8B79-37D633B846F1}",Dy="{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",Ce=(e,t)=>{var r;return e==null||(r=e.elements)===null||r===void 0?void 0:r.find(n=>n.name===t)},My=e=>{const t=wr(e);return ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)},ku=(e,t)=>new _l({folder:"media",name:"image",extension:e,contentType:Ly[e],relationshipType:Oy,content:My(t)}),Pu=(e,t)=>{const r=ci(e,t);if(!_y.includes(r))throw new Error(`${t}: invalid type "${r}". Expected "png", "jpg", "gif", "bmp" or, with a fallback, "svg"`);return ku(r,e.data)},Fy=new Map([["c:chart","It is a chart, not a picture. Give a chart new data with ChartDataPatch from docx/charts"],["cx:chart","It is a chart, not a picture. Give a chart new data with ChartDataPatch from docx/charts"],["wpg:wgp","It is a group of drawings. Ungroup the picture in Word, and put the placeholder in its alt text"],["wpc:wpc","It is a drawing canvas. Move the picture out of it in Word, and put the placeholder in its alt text"],["wps:wsp","It is a shape, not a picture"]]),$y=(e,t)=>{var r,n;const s=Ce(Ce(e,"a:graphic"),"a:graphicData"),a=Ce(s,"pic:pic");if(a!==void 0)return a;const i=s==null||(r=s.elements)===null||r===void 0||(r=r.find(o=>o.type==="element"))===null||r===void 0?void 0:r.name;throw new Error(`Can't patch the picture ${t}. ${(n=Fy.get(i??""))!==null&&n!==void 0?n:"It isn't a picture"}`)},Hy=(e,t)=>{var r,n;const s=(r=e.elements)!==null&&r!==void 0?r:[],a=Ce(e,"a:extLst"),i=t===void 0?[]:[{type:"element",name:"a:ext",attributes:{uri:Ru},elements:[{type:"element",name:"asvg:svgBlip",attributes:{"xmlns:asvg":"http://schemas.microsoft.com/office/drawing/2016/SVG/main","r:embed":t}}]}],o=[...((n=a?.elements)!==null&&n!==void 0?n:[]).filter(l=>{var u;return l.name==="a:ext"&&![Ru,Dy].includes(String((u=l.attributes)===null||u===void 0?void 0:u.uri).toUpperCase())}),...i],c=o.length===0?[]:[w(w({},a),{},{type:"element",name:"a:extLst",elements:o})];return[...s.filter(l=>l!==a),...c]},Ou=(e,t,r)=>{var n,s;const a=c=>{var l;const u=(l=e.attributes)===null||l===void 0?void 0:l[c];return u===void 0?void 0:String(u).split(t).join("").trim()},i=(n=r?.description)!==null&&n!==void 0?n:a("descr"),o=(s=r?.title)!==null&&s!==void 0?s:a("title");e.attributes=Object.fromEntries(Object.entries(w(w({},e.attributes),{},{descr:i||void 0,title:o||void 0})).filter(([,c])=>c!==void 0))},Lu=(e,{width:t,height:r})=>{e!==void 0&&(e.attributes=w(w({},e.attributes),{},{cx:Math.round(t*Nu),cy:Math.round(r*Nu)}))},By=class extends nu{constructor(e){if(super(),v(this,"image",void 0),v(this,"svg",void 0),v(this,"transformation",void 0),v(this,"altText",void 0),e.type==="svg"){if(e.fallback===void 0)throw new Error("ImagePatch: an SVG image needs a fallback, a PNG, JPEG, GIF or BMP image for applications that can't show SVG");this.image=Pu(e.fallback,"ImagePatch fallback"),this.svg=ku("svg",e.data)}else this.image=Pu(e,"ImagePatch");const{transformation:t}=e;if(t!==void 0){for(const r of["width","height"]){const n=t[r];if(!(typeof n=="number"&&n>0&&Number.isFinite(n)))throw new Error(`ImagePatch: invalid ${r} ${String(n)}. Expected a number of pixels greater than 0`)}this.transformation={width:t.width,height:t.height}}this.altText=e.altText&&w({},e.altText)}patch({element:e,properties:t,placeholder:r,part:n},s){var a;const i=$y(e,r),o=Ce(i,"pic:blipFill"),c=Ce(o,"a:blip");if(o===void 0||c===void 0)throw new Error(`Can't patch the picture ${r}. It has no image: it has no a:blip`);const l=s.replaceRelatedPart(n,void 0,this.image),u=this.svg&&s.replaceRelatedPart(n,void 0,this.svg);c.attributes=w({"r:embed":l},Object.fromEntries(Object.entries((a=c.attributes)!==null&&a!==void 0?a:{}).filter(([m])=>!/^[^:]+:(embed|link)$/.test(m)))),c.elements=[...Hy(c,u)],o.elements=o.elements.filter(m=>m.name!=="a:srcRect"),this.transformation!==void 0&&(Lu(Ce(e,"wp:extent"),this.transformation),Lu(Ce(Ce(Ce(i,"pic:spPr"),"a:xfrm"),"a:ext"),this.transformation)),Ou(t,r,this.altText);const d=Ce(Ce(i,"pic:nvPicPr"),"pic:cNvPr");d!==void 0&&Ou(d,r,this.altText)}},_u=(e,t,{inTableRow:r})=>{if(t?.type===ie.TABLE_ROWS&&Array.isArray(t.rows)){for(const n of t.rows){if(typeof n!="object"||n===null)throw new Error(`Invalid patch "${e}". Expected each of its rows to be an object of patches, by the name of their field`);for(const[s,a]of Object.entries(n))a!==void 0&&_u(`${e}.${s}`,a,{inTableRow:!0})}return}if(!(t?.type===ie.DRAWING?!r&&typeof t.patch=="function":t?.type!==ie.TABLE_ROWS&&Array.isArray(t?.children)))throw new Error(`Invalid patch "${e}". Expected { type: PatchType.PARAGRAPH or PatchType.DOCUMENT, children: [...] }, ${r?"or { type: PatchType.TABLE_ROWS, rows: [...] }":"{ type: PatchType.TABLE_ROWS, rows: [...] }, or a drawing patch such as ImagePatch, or ChartDataPatch from docx/charts"}`)},Du=new Hc,Wy=new Uint8Array([255,254]),Uy=new Uint8Array([254,255]),Gy=new Set(["w:document","w:hdr","w:ftr","w:footnotes","w:endnotes","w:comments"]),Mu=(e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},Vy=(function(){var e=dt(function*({outputType:t,data:r,patches:n,keepOriginalStyles:s,placeholderDelimiters:a={start:"{{",end:"}}"},recursive:i=!0,trimPlaceholders:o=!1,footnotes:c,endnotes:l,numbering:u={config:[]},pageNumbers:d,properties:m}){const g=yield iu(r),p=new Map,f=Cy(g),y=[],I=new Dl({addOverride:(O,F)=>y.push({contentType:O,partName:F})},new Set([...g.keys()].filter(O=>O.startsWith("word/")).map(O=>O.slice(5)))),C={Media:new vs(O=>I.takePath("media","image",O)),Numbering:new gs(u),Theme:f&&{Colors:f},FootNotes:{View:{idOf:(O,F,$)=>ht("footnotes",O,F,$)}},Endnotes:{View:{idOf:(O,F,$)=>ht("endnotes",O,F,$)}},PackageParts:I},E=new Map,P=[],L=[];let S=!1;const x=new Map;Yc(a);const{start:A,end:N}=a;for(const[O,F]of Object.entries(n))_u(O,F,{inTableRow:!1});for(const[O,F]of g){var k;const $=F.slice(0,2);if(Mu($,Wy)||Mu($,Uy)){x.set(O,F);continue}if(!O.endsWith(".xml")&&!O.endsWith(".rels")){x.set(O,F);continue}const j=qe(Vr(F)),J=(k=j.elements)===null||k===void 0?void 0:k.find(Z=>{var U;return Gy.has((U=Z.name)!==null&&U!==void 0?U:"")});if(J&&J.attributes){for(const Z of["mc","wp","r","w15","m","v","o"])J.attributes[`xmlns:${Z}`]=_r[Z];J.attributes["mc:Ignorable"]=`${J.attributes["mc:Ignorable"]||""} w15`.trim()}E.set(O,j)}const D=ag([...E.values()].flatMap(Kc)),M=yg([...E.values()].flatMap(ru)),X=new Map,Y=O=>{const F=X.get(O);if(F)return F;const $={Relationships:{addRelationship:(j,J,Z,U)=>{L.push({key:O,id:j,type:J,target:Z,targetMode:U})}}};return X.set(O,$),$},K=O=>({file:C,viewWrapper:Y(O),stack:[]}),z=(O,F)=>{y.push({contentType:O,partName:F})},B=fy(E,K),oe=Ug(C.Numbering,E,{createContext:K,addContentTypeOverride:z}),re=Dg({footnotes:c,endnotes:l},E,{createContext:K,addContentTypeOverride:z,renumberBookmarks:D,renumberDrawings:M,renumberLists:oe.renumber,useStyles:B.use}),ht=(O,F,$,j)=>j.viewWrapper===Y("word/document.xml")?re.carry(O,F,$):void 0;if(o){const O=$=>Object.entries(n).flatMap(([j,J])=>$(J.type)?[j]:[]),F={delimiters:{start:A,end:N},textKeys:new Set(O($=>$!==ie.TABLE_ROWS&&$!==ie.DRAWING)),tableRowsKeys:O($=>$===ie.TABLE_ROWS),drawingKeys:new Set(O($=>$===ie.DRAWING))};for(const[$,j]of E)$.startsWith("word/")&&!$.endsWith(".rels")&&ky(j,F)}Ag({parts:E,binaryParts:x,file:C,patches:Object.entries(n).flatMap(([O,F])=>F.type===ie.DRAWING?[[O,F]]:[]),delimiters:{start:A,end:N}},K);const be=Object.entries(n).flatMap(([O,F])=>F.type===ie.DRAWING?[]:[[O,F]]),Me=[...be.filter(([,O])=>O.type===ie.TABLE_ROWS),...be.filter(([,O])=>O.type!==ie.TABLE_ROWS)];for(const[O,F]of[...E]){if(!O.startsWith("word/")||O.endsWith(".xml.rels"))continue;const $=K(O);p.set(O,$);const j=Py(F),J=(Z,U,Ee)=>{if(Ee.type===ie.TABLE_ROWS){gy({json:Z,key:U,patch:Ee,delimiters:{start:A,end:N},patchPlaceholder:J,renumberDrawings:M});return}const Fu=[],{didFindOccurrence:zy}=Zg({json:Z,patch:w(w({},Ee),{},{children:Ee.children.flatMap(Fe=>Fe instanceof Vn?Fe.writtenAs:[Fe]).map(Fe=>{if(Fe instanceof wo){const{target:qy,anchor:Yy}=bo(Fe.options.link),$u=new Nt(Fe.options.children,Ze(),Yy,Fe.options.link);return Fu.push({key:O,id:$u.linkId,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",target:qy,targetMode:In.EXTERNAL}),$u}else return Fe})}),patchText:`${A}${U}${N}`,context:$,keepOriginalStyles:s,recursive:i,renumberIds:Fe=>B.use(oe.renumber(re.renumber(D(M(j(Fe))))))});zy&&L.push(...Fu)};for(const[Z,U]of Me)J(F,Z,U)}re.write(),oe.write(),B.write();for(const[O,F]of E){if(!O.startsWith("word/")||O.endsWith(".xml.rels"))continue;const $=Du.getMediaData(JSON.stringify(F),C.Media);$.length>0&&(S=!0,P.push({key:O,mediaDatas:$}))}for(const{key:O,mediaDatas:F}of P){var me;const $=Le(O),j=(me=E.get($))!==null&&me!==void 0?me:ar();E.set($,j);const J=Zs(j),Z=Du.replace(JSON.stringify(E.get(O)),F,J);E.set(O,JSON.parse(Z));for(let U=0;U<F.length;U++){const{fileName:Ee}=F[U];Qs(j,J+U,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${Ee}`)}}for(const{key:O,id:F,type:$,target:j,targetMode:J}of L){var pe;const Z=Le(O),U=(pe=E.get(Z))!==null&&pe!==void 0?pe:ar();E.set(Z,U),Qs(U,F,$,j,J)}d&&(yield Xg(E,d,x)),m&&fg(E,x,m,{addContentTypeOverride:z});const V=Js(C,void 0);if(S||y.length>0){const O=E.get("[Content_Types].xml");if(!O)throw new Error("Could not find content types file");S&&(Lt(O,"image/png","png"),Lt(O,"image/jpeg","jpeg"),Lt(O,"image/jpeg","jpg"),Lt(O,"image/bmp","bmp"),Lt(O,"image/gif","gif"),Lt(O,"image/svg+xml","svg"));for(const{contentType:F,partName:$}of y)og(O,F,$)}return Us(Br([...[...E].map(([O,F])=>[O,td(F)]),...x,...C.Media.Array.map(({data:O,fileName:F})=>[`word/media/${F}`,O]),...V.map(({path:O,data:F})=>[O,F])]),t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document")});return function(r){return e.apply(this,arguments)}})(),jy=e=>e.startsWith("word/")&&/\.(xml|rels)$/.test(e)&&!e.endsWith(".xml.rels"),Xy=(function(){var e=dt(function*({data:t,placeholderDelimiters:r={start:"{{",end:"}}"},trimPlaceholders:n=!1}){Yc(r);const s=Ky(r),a=yield iu(t,jy),i=new Set;for(const[,o]of a){const c=qe(Vr(o));[...fu(c).map(l=>l.text),...Xr(c).flatMap(({properties:l})=>su(l))].flatMap(l=>{var u;return(u=l.match(s))!==null&&u!==void 0?u:[]}).map(l=>n?l.trim():l).filter(l=>l!=="").forEach(l=>i.add(l))}return Array.from(i)});return function(r){return e.apply(this,arguments)}})(),va=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ky=({start:e,end:t})=>new RegExp(`(?<=${va(e)})(?:(?!${va(e)}).)+?(?=${va(t)})`,"gs");return h.AbstractNumbering=Dr,h.AlignmentType=ce,h.AnnotationReference=pp,h.Attributes=le,h.BaseXmlComponent=bt,h.Body=ns,h.Bookmark=Vn,h.BookmarkEnd=Xn,h.BookmarkStart=jn,h.Border=Ba,h.BorderStyle=pr,h.BuilderElement=T,h.CarriageReturn=yp,h.CellMerge=ol,h.CellMergeAttributes=il,h.CharacterSet=Wp,h.CheckBox=F0,h.CheckBoxSymbolElement=Gr,h.CheckBoxUtil=Dc,h.Column=Af,h.ColumnBreak=Cp,h.Comment=Wn,h.CommentRangeEnd=zm,h.CommentRangeStart=Km,h.CommentReference=qm,h.Comments=ao,h.CommentsExtended=io,h.CommentsIds=oo,h.ConcreteHyperlink=Nt,h.ConcreteNumbering=ws,h.ContinuationSeparator=wp,h.DayLong=dp,h.DayShort=lp,h.DeletedTableCell=al,h.DeletedTableRow=nl,h.DeletedTextRun=jv,h.Document=kc,h.DocumentAttributeNamespaces=_r,h.DocumentAttributes=Zt,h.DocumentBackground=El,h.DocumentBackgroundAttributes=Rf,h.DocumentDefaults=ec,h.DocumentGridType=Sv,h.DocumentProtectionType=fw,h.Drawing=Tr,h.DrawingPatch=nu,h.DropCapType=Kp,h.EMPTY_OBJECT=ga,h.EditableRangeEnd=Qm,h.EditableRangeStart=Zm,h.EmphasisMarkType=vn,h.EmptyElement=ne,h.EndnoteIdReference=Ks,h.EndnotePosition=Cv,h.EndnoteReference=lo,h.EndnoteReferenceRun=M0,h.EndnoteReferenceRunAttributes=Lc,h.Endnotes=hs,h.ExternalHyperlink=wo,h.File=kc,h.FileChild=zt,h.FootNoteReferenceRunAttributes=Oc,h.FootNotes=ps,h.Footer=_0,h.FooterWrapper=Nl,h.FootnotePosition=Iv,h.FootnoteReference=Xs,h.FootnoteReferenceElement=vp,h.FootnoteReferenceRun=D0,h.FrameAnchorType=zp,h.FrameWrap=qp,h.GridSpan=ul,h.Header=L0,h.HeaderFooterReferenceType=vt,h.HeaderFooterType=rs,h.HeaderWrapper=Pl,h.HeadingLevel=Np,h.HeightRule=uf,h.HighlightColor=Jd,h.HorizontalPositionAlign=Td,h.HorizontalPositionRelativeFrom=ui,h.HpsMeasureElement=mr,h.HyperlinkType=Lp,h.IgnoreIfEmptyXmlComponent=$e,h.ImagePatch=By,h.ImageRun=Zh,h.ImportedRootElementAttributes=Ca,h.ImportedXmlComponent=Ia,h.InitializableXmlComponent=rn,h.InsertedTableCell=sl,h.InsertedTableRow=rl,h.InsertedTextRun=Bv,h.InternalHyperlink=Gn,h.LastRenderedPageBreak=bp,h.LeaderType=po,h.Level=Ol,h.LevelBase=fs,h.LevelForOverride=ew,h.LevelFormat=je,h.LevelOverride=Ll,h.LevelSuffix=Jf,h.LineNumberRestartFormat=Av,h.LineRuleType=pt,h.Math=Zp,h.MathAngledBrackets=Ev,h.MathCurlyBrackets=Tv,h.MathDegree=Oo,h.MathDenominator=xo,h.MathFraction=rv,h.MathFunction=fv,h.MathFunctionName=_o,h.MathFunctionProperties=Do,h.MathIntegral=iv,h.MathLimit=es,h.MathLimitLower=lv,h.MathLimitUpper=ov,h.MathNumerator=So,h.MathPreSubSuperScript=hv,h.MathRadical=vv,h.MathRadicalProperties=Lo,h.MathRoundBrackets=yv,h.MathRun=tv,h.MathSquareBrackets=bv,h.MathSubScript=uv,h.MathSubSuperScript=dv,h.MathSum=av,h.MathSuperScript=cv,h.Media=vs,h.MonthLong=hp,h.MonthShort=cp,h.NextAttributeComponent=Mt,h.NoBreakHyphen=ip,h.NonVisualDrawingProperties=jh,h.NoteNumberRestart=Nv,h.NumberFormat=xd,h.NumberProperties=Kt,h.NumberValueElement=St,h.NumberedItemReference=$p,h.NumberedItemReferenceFormat=Mp,h.Numbering=gs,h.OnOffElement=R,h.OverlapType=nf,h.PackagePart=_l,h.Packer=jc,h.PageBorderDisplay=Rv,h.PageBorderOffsetFrom=kv,h.PageBorderZOrder=Pv,h.PageBorders=jo,h.PageBreak=Ip,h.PageBreakBefore=ho,h.PageNumber=at,h.PageNumberElement=gp,h.PageNumberSeparator=Ko,h.PageOrientation=qt,h.PageReference=yo,h.PageTextDirection=Yo,h.PageTextDirectionType=Ov,h.Paragraph=ue,h.ParagraphProperties=it,h.ParagraphPropertiesChange=zn,h.ParagraphPropertiesDefaults=Zl,h.ParagraphRunProperties=ai,h.PatchType=ie,h.PositionalTab=Ap,h.PositionalTabAlignment=Tp,h.PositionalTabLeader=xp,h.PositionalTabRelativeTo=Ep,h.PrettifyType=Uc,h.RelativeHorizontalPosition=Pr,h.RelativeVerticalPosition=ml,h.Run=te,h.RunProperties=Be,h.RunPropertiesChange=ii,h.RunPropertiesDefaults=Ql,h.SchemeColor=dh,h.SectionProperties=Nr,h.SectionPropertiesChange=Zo,h.SectionType=_v,h.Separator=fp,h.SequentialIdentifier=rm,h.ShadingType=ja,h.SimpleField=kn,h.SimpleMailMergeField=im,h.SoftHyphen=op,h.SpaceType=ve,h.StringContainer=st,h.StringEnumValueElement=id,h.StringValueElement=Re,h.StyleForCharacter=ot,h.StyleForParagraph=Xe,h.StyleLevel=O0,h.Styles=Mr,h.SymbolRun=li,h.TDirection=dl,h.Tab=Xt,h.TabStopPosition=Rp,h.TabStopType=Un,h.Table=hf,h.TableAnchorType=rf,h.TableBorders=cs,h.TableCell=os,h.TableCellBorders=cl,h.TableLayoutType=sf,h.TableOfContents=P0,h.TableProperties=Or,h.TableRow=bl,h.TableRowProperties=us,h.TableRowPropertiesChange=yl,h.TextDirection=Zv,h.TextEffect=Yd,h.TextRun=We,h.TextWrappingSide=Sn,h.TextWrappingType=At,h.Textbox=q0,h.ThematicBreak=Wa,h.Theme=ac,h.TwoLinesInOneBrackets=kd,h.UnderlineType=En,h.VerticalAlign=xv,h.VerticalAlignSection=Fo,h.VerticalAlignTable=Mo,h.VerticalAnchor=rh,h.VerticalMerge=is,h.VerticalMergeRevisionType=Kv,h.VerticalMergeType=as,h.VerticalPositionAlign=Ed,h.VerticalPositionRelativeFrom=di,h.WidthType=Ve,h.WpgGroupRun=em,h.WpsShapeRun=Qh,h.XmlAttributeComponent=_,h.XmlComponent=b,h.YearLong=mp,h.YearShort=up,h.abstractNumUniqueNumericIdGen=Ya,h.bookmarkUniqueNumericId=gn,h.bookmarkUniqueNumericIdGen=ei,h.commentIdToParaId=so,h.concreteNumUniqueNumericIdGen=Ja,h.convertInchesToTwip=Se,h.convertMillimetersToTwip=Ud,h.convertToXmlComponent=dr,h.createAlignment=ln,h.createBodyProperties=wi,h.createBorderElement=ee,h.createColumns=$o,h.createDocumentGrid=Ho,h.createDotEmphasisMark=Pd,h.createEastAsianLayout=Xa,h.createEmphasisMark=fn,h.createEndnoteProperties=Go,h.createFitText=ri,h.createFootnoteProperties=Uo,h.createFrameProperties=Eo,h.createHeaderFooterReference=Cr,h.createHorizontalPosition=vi,h.createIndent=Ua,h.createLineNumberType=Bo,h.createMathAccentCharacter=Ao,h.createMathBase=ye,h.createMathLimitLocation=Io,h.createMathNAryProperties=Zn,h.createMathPreSubSuperScriptProperties=Po,h.createMathSubScriptElement=Rt,h.createMathSubScriptProperties=Ro,h.createMathSubSuperScriptProperties=ko,h.createMathSuperScriptElement=kt,h.createMathSuperScriptProperties=No,h.createOutlineLevel=go,h.createPageMargin=Xo,h.createPageNumberType=zo,h.createPageSize=qo,h.createParagraphStyle=Ct,h.createRunFonts=fr,h.createSectionType=Jo,h.createShading=Wt,h.createSimplePos=hi,h.createSpacing=mo,h.createStringElement=xt,h.createTabStop=fo,h.createTabStopItem=vo,h.createTableFloatProperties=pl,h.createTableLayout=vl,h.createTableLook=wl,h.createTableRowHeight=gl,h.createTableWidthElement=Pt,h.createTransformation=Rn,h.createUnderline=si,h.createVerticalAlign=ts,h.createVerticalPosition=fi,h.createVmlShape=Mc,h.createWrapNone=An,h.createWrapSquare=Ai,h.createWrapThrough=Ni,h.createWrapTight=Ci,h.createWrapTopAndBottom=Ri,h.dateTimeValue=La,h.decimalNumber=G,h.docPropertiesUniqueNumericId=Qa,h.docPropertiesUniqueNumericIdGen=Za,h.eighthPointMeasureValue=Pa,h.elementOf=Tt,h.encodeUtf8=Tn,h.fillPageNumbers=no,h.fillPartPageNumbers=It,h.fillSequenceNumbers=ro,h.fitTextUniqueNumericId=ti,h.hashedId=yn,h.hexColorValue=an,h.hpsMeasureValue=Ra,h.isXmlComponent=en,h.longHexNumber=nd,h.measurementOrPercentValue=on,h.patchDetector=Xy,h.patchDocument=Vy,h.percentageValue=ka,h.pointMeasureValue=Oa,h.positiveUniversalMeasureValue=sn,h.readTheme=C0,h.sectionMarginDefaults=Oe,h.sectionPageSizeDefaults=Yt,h.shortHexNumber=Na,h.signedHpsMeasureValue=ad,h.signedTwipsMeasureValue=Ne,h.standardizeData=wr,h.twipsMeasureValue=Q,h.uCharHexNumber=nn,h.uniqueId=Ze,h.uniqueNumericIdCreator=mt,h.uniqueUuid=bn,h.universalMeasureToTwips=Ye,h.universalMeasureValue=Ht,h.unsignedDecimalNumber=$t,h})({});
|