@docx-editor.dev/core 2.29.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +22 -26
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +47 -40
  6. package/dist/binding.js +1 -1
  7. package/dist/bookmark-names-DDuAra_V.d.ts +37 -0
  8. package/dist/{chrome-print-CAs51cpq.d.ts → chrome-print-BWvaVEhD.d.ts} +577 -243
  9. package/dist/chunk-243W4WW2.cjs +2 -0
  10. package/dist/{chunk-G4HOFIKJ.js → chunk-2E2RPEKX.js} +1 -1
  11. package/dist/chunk-4S24UOPG.js +30 -0
  12. package/dist/chunk-5JPIEN54.cjs +3 -0
  13. package/dist/{chunk-7WQ7AAHW.cjs → chunk-5SO5QDMV.cjs} +1 -1
  14. package/dist/{chunk-UHHYFIDT.cjs → chunk-6IDOVU6L.cjs} +1 -1
  15. package/dist/chunk-DBOOTED4.cjs +30 -0
  16. package/dist/chunk-EOTAXOJY.cjs +5 -0
  17. package/dist/chunk-FDAKJ2SJ.cjs +30 -0
  18. package/dist/chunk-FNNOJNGY.js +3 -0
  19. package/dist/chunk-FT33HRZP.js +5 -0
  20. package/dist/{chunk-W35WTWAO.cjs → chunk-HC6YNKUI.cjs} +1 -1
  21. package/dist/chunk-HZ66UCIS.js +2 -0
  22. package/dist/{chunk-MM5QBMTE.cjs → chunk-IBRBNT37.cjs} +1 -1
  23. package/dist/chunk-IVIN7X43.js +30 -0
  24. package/dist/chunk-LZY6B6IV.js +4 -0
  25. package/dist/chunk-MOYYRVFV.cjs +2 -0
  26. package/dist/{chunk-OMCG63ZF.js → chunk-N6B3BXCL.js} +1 -1
  27. package/dist/chunk-Q5K2GGNG.js +2 -0
  28. package/dist/chunk-R2XINWVE.js +7 -0
  29. package/dist/chunk-SUEXVBPR.js +1 -0
  30. package/dist/chunk-T2QQHG5C.js +18 -0
  31. package/dist/{chunk-LSZ6KPKK.js → chunk-VWIJKH4A.js} +1 -1
  32. package/dist/chunk-WO4V6PNS.cjs +18 -0
  33. package/dist/chunk-XMJKFURD.cjs +4 -0
  34. package/dist/{chunk-BY2ACZZ6.cjs → chunk-XSTGE3NI.cjs} +1 -1
  35. package/dist/chunk-YQWMI6J5.cjs +7 -0
  36. package/dist/{chunk-RCLZXP3B.js → chunk-ZCJS7D7S.js} +1 -1
  37. package/dist/collaboration/replication.cjs +1 -1
  38. package/dist/collaboration/replication.d.ts +4 -5
  39. package/dist/collaboration/replication.js +1 -1
  40. package/dist/collaboration.d.ts +3 -4
  41. package/dist/contracts/document.d.ts +3 -3
  42. package/dist/contracts/editor.d.ts +8 -9
  43. package/dist/contracts/interaction.d.ts +2 -2
  44. package/dist/contracts/modules.d.ts +12 -13
  45. package/dist/contracts/types.d.ts +2 -2
  46. package/dist/{custom-node-writes-Bn6uciLb.d.ts → custom-node-writes-TeUvMP13.d.ts} +2 -2
  47. package/dist/{diagnostic-context-B8M79cfK.d.ts → diagnostic-context-DJ0P1uZE.d.ts} +3 -2
  48. package/dist/{diagnostic-hints-BeVjfNOv.d.ts → diagnostic-hints-C9JlLz1L.d.ts} +12 -5
  49. package/dist/{document-protection-CUb55pl_.d.ts → document-protection-C8x3P2J6.d.ts} +1 -1
  50. package/dist/{editor-CZQZmTIU.d.ts → editor-B2ShlO23.d.ts} +368 -52
  51. package/dist/{editor-scope-7o9xweiJ.d.ts → editor-scope-C7ke1KJG.d.ts} +57 -4
  52. package/dist/editor.cjs +1 -1
  53. package/dist/editor.css +5 -3
  54. package/dist/editor.d.ts +606 -34
  55. package/dist/editor.js +1 -1
  56. package/dist/export.cjs +2 -2
  57. package/dist/export.d.ts +17 -15
  58. package/dist/export.js +2 -2
  59. package/dist/{font-resolver-lSBLirLR.d.ts → font-resolver-CWh40DYp.d.ts} +1 -1
  60. package/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
  61. package/dist/{headless-document-view-pp3q7wIh.d.ts → headless-document-view-qOpaCF82.d.ts} +2 -2
  62. package/dist/index.cjs +1 -1
  63. package/dist/index.d.ts +24 -24
  64. package/dist/index.js +1 -1
  65. package/dist/{layout-shaping-BD-dF_rn.d.ts → layout-shaping-CWS3j0Xr.d.ts} +3 -2
  66. package/dist/layout.cjs +1 -1
  67. package/dist/layout.d.ts +112 -44
  68. package/dist/layout.js +1 -1
  69. package/dist/{note-properties-qQUjO1GQ.d.ts → note-properties-QsKh24sM.d.ts} +1 -1
  70. package/dist/{omml-equation-BUbU0utM.d.ts → omml-equation-BsLAa2lX.d.ts} +38 -8
  71. package/dist/output.cjs +1 -1
  72. package/dist/output.d.ts +20 -10
  73. package/dist/output.js +1 -1
  74. package/dist/{protocol-DYzzz2ej.d.ts → protocol-COZJUKUY.d.ts} +94 -2
  75. package/dist/{review-paragraph-order-CN_0l2Cb.d.ts → review-paragraph-order-C_QbCKcH.d.ts} +1 -1
  76. package/dist/{semantic-cell-selection-eYag3P47.d.ts → semantic-cell-selection-Cub9FDa8.d.ts} +2 -2
  77. package/dist/{semantic-interaction-kR_QB845.d.ts → semantic-interaction-dApRIYpt.d.ts} +1 -1
  78. package/dist/{semantic-paint-ZayFF3tD.d.ts → semantic-paint-DLzA8sjP.d.ts} +3 -3
  79. package/dist/{semantic-record-queries-Bsgth6lv.d.ts → semantic-record-queries-3yp9o11g.d.ts} +1 -1
  80. package/dist/{semantic-records-DQmumPgL.d.ts → semantic-records-B-akgRch.d.ts} +207 -139
  81. package/dist/store.cjs +1 -1
  82. package/dist/store.d.ts +49 -136
  83. package/dist/store.js +1 -1
  84. package/dist/{tree-package-store-CovjNARF.d.ts → tree-package-store-B8l8DX3Z.d.ts} +612 -428
  85. package/dist/{tree-session-contract-CZVAGl51.d.ts → tree-session-contract-DeLRqohz.d.ts} +28 -13
  86. package/dist/{types-barrel-DuC5QBNC.d.ts → types-barrel-CkF2JbU4.d.ts} +1146 -745
  87. package/package.json +2 -2
  88. package/dist/chunk-236O4YQW.js +0 -2
  89. package/dist/chunk-6JPL6ZAS.cjs +0 -5
  90. package/dist/chunk-6ZQP4HQ7.js +0 -3
  91. package/dist/chunk-BCXH4BXB.js +0 -5
  92. package/dist/chunk-CAJEXXVG.cjs +0 -4
  93. package/dist/chunk-CPWLFPWC.js +0 -30
  94. package/dist/chunk-D7ZMDMPX.cjs +0 -3
  95. package/dist/chunk-DOHF6FA7.cjs +0 -30
  96. package/dist/chunk-DVX32P2P.js +0 -27
  97. package/dist/chunk-E4LOMDNL.js +0 -1
  98. package/dist/chunk-EKLM7NWB.cjs +0 -7
  99. package/dist/chunk-G3K63G7P.cjs +0 -27
  100. package/dist/chunk-JLVBDYVQ.cjs +0 -2
  101. package/dist/chunk-LQX36Z5P.js +0 -7
  102. package/dist/chunk-OSFOJTHU.cjs +0 -18
  103. package/dist/chunk-T6K2QYNZ.cjs +0 -2
  104. package/dist/chunk-TRGAVV2Y.js +0 -4
  105. package/dist/chunk-U4JZVSOE.js +0 -2
  106. package/dist/chunk-YQ5G6LC7.js +0 -18
  107. package/dist/image-resources-tXLQShoC.d.ts +0 -211
@@ -0,0 +1,30 @@
1
+ 'use strict';var chunkV3N4SOAK_cjs=require('./chunk-V3N4SOAK.cjs'),chunkXMJKFURD_cjs=require('./chunk-XMJKFURD.cjs'),chunkMOYYRVFV_cjs=require('./chunk-MOYYRVFV.cjs'),chunk5JPIEN54_cjs=require('./chunk-5JPIEN54.cjs'),chunkYQWMI6J5_cjs=require('./chunk-YQWMI6J5.cjs'),chunkHC6YNKUI_cjs=require('./chunk-HC6YNKUI.cjs'),chunkDBOOTED4_cjs=require('./chunk-DBOOTED4.cjs'),chunkEOTAXOJY_cjs=require('./chunk-EOTAXOJY.cjs'),chunkXSTGE3NI_cjs=require('./chunk-XSTGE3NI.cjs'),chunk243W4WW2_cjs=require('./chunk-243W4WW2.cjs'),chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs'),chunk6IDOVU6L_cjs=require('./chunk-6IDOVU6L.cjs'),chunkWO4V6PNS_cjs=require('./chunk-WO4V6PNS.cjs'),chunkUKVVUHZL_cjs=require('./chunk-UKVVUHZL.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');function Tw(e){return e===void 0?void 0:Object.freeze({maxFontBytes:chunk5JPIEN54_cjs.k(e).maxFontBytes})}function q1(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var Pw=false;function Ew(e){if(Pw)return;Pw=true;let t=e.diagnostic?`: ${e.diagnostic}`:".";console.error(`[@docx-editor.dev/core] text shaping is disabled${t}
2
+ Text is being measured with fallback metrics, so line and page breaks will not match Word.`);}function ia(e){if(e instanceof chunkUKVVUHZL_cjs.a)return e;if(e instanceof chunkDBOOTED4_cjs.d)return new chunkUKVVUHZL_cjs.a(e.code,e.message,{request:q1(e.request),diagnostic:e.diagnostic});if(e instanceof chunk5JPIEN54_cjs.l)return new chunkUKVVUHZL_cjs.a("overLimit",e.message,{diagnostic:e.message});if(e instanceof chunk5JPIEN54_cjs.f){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new chunkUKVVUHZL_cjs.a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new chunkUKVVUHZL_cjs.a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e)})}async function qs(e,t,n){try{return await chunk5JPIEN54_cjs.s(e,t,n)}catch(r){throw ia(r)}}var sd=Object.freeze({opening:"auto",overflow:"float",revisionsIn:"pane",commentMarkers:"icon"}),Fp={opening:["auto","manual"],overflow:["float","shrinkPage","scroll"],revisionsIn:["pane","balloons"],commentMarkers:["initials","icon"]};function ld(e,t=sd){if(e===void 0)return t;if(e===null||typeof e!="object")throw new TypeError("review pane settings must be an object");let n=t;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;if(!Object.hasOwn(Fp,r))throw new TypeError(`unknown review pane setting ${r}`);let i=r;if(typeof o!="string"||!Fp[i].includes(o))throw new TypeError(`review pane ${i} must be ${Fp[i].join(" or ")}`);n[i]!==o&&(n={...n,[i]:o});}return n===t?t:Object.freeze(n)}function Lp(e,t){return e==="pane"?true:t.kind==="revision"?false:!(t.kind==="comment"&&t.parentRevisionId!==void 0)}var W1=Object.freeze({revisionMarkup:chunkDBOOTED4_cjs.Wa,reviewPane:sd,scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,openFailure:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false,collaborationStatus:"inactive"});var Cw="http://schemas.openxmlformats.org/wordprocessingml/2006/main",j1="http://schemas.openxmlformats.org/package/2006/content-types",Ow="http://schemas.openxmlformats.org/package/2006/relationships",V1="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",U1="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",z1=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${j1}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`,G1=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Ow}"><Relationship Id="rId1" Type="${V1}" Target="word/document.xml"/></Relationships>`,Z1=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Ow}"><Relationship Id="rId1" Type="${U1}" Target="styles.xml"/></Relationships>`,X1=[{level:1,before:240,color:"2F5496",halfPoints:32,italic:false},{level:2,before:40,color:"2F5496",halfPoints:26,italic:false},{level:3,before:40,color:"1F3763",halfPoints:24,italic:false},{level:4,before:40,color:"2F5496",halfPoints:null,italic:true},{level:5,before:40,color:"2F5496",halfPoints:null,italic:false},{level:6,before:40,color:"1F3763",halfPoints:null,italic:false},{level:7,before:40,color:"1F3763",halfPoints:null,italic:true},{level:8,before:40,color:"272727",halfPoints:21,italic:false},{level:9,before:40,color:"272727",halfPoints:21,italic:true}],Y1=e=>`<w:style w:type="paragraph" w:styleId="Heading${e.level}"><w:name w:val="heading ${e.level}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:keepLines/><w:spacing w:before="${e.before}" w:after="0"/><w:outlineLvl w:val="${e.level-1}"/></w:pPr><w:rPr>`+(e.italic?"<w:i/><w:iCs/>":"")+`<w:color w:val="${e.color}"/>`+(e.halfPoints===null?"":`<w:sz w:val="${e.halfPoints}"/><w:szCs w:val="${e.halfPoints}"/>`)+"</w:rPr></w:style>",Q1=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${Cw}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+X1.map(Y1).join("")+'<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:uiPriority w:val="1"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="numbering" w:default="1" w:styleId="NoList"><w:name w:val="No List"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="10"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/><w:contextualSpacing/></w:pPr><w:rPr><w:spacing w:val="-10"/><w:kern w:val="28"/><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="11"/><w:qFormat/><w:rPr><w:color w:val="5A5A5A"/><w:spacing w:val="15"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="29"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="35"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:after="0"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="NoSpacing"><w:name w:val="No Spacing"/><w:uiPriority w:val="1"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720"/><w:contextualSpacing/></w:pPr></w:style></w:styles>',J1=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${Cw}"><w:body><w:p/><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/></w:sectPr></w:body></w:document>`;function Dp(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(z1),"_rels/.rels":fflate.strToU8(G1),"word/_rels/document.xml.rels":fflate.strToU8(Z1),"word/document.xml":fflate.strToU8(J1),"word/styles.xml":fflate.strToU8(Q1)})}var Mw="http://schemas.microsoft.com/office/2004/12/omml",eD="http://www.w3.org/1998/Math/MathML",tD=4096,Aw=32;function Fw(e,t){return e.failed||t>Aw||e.left<=0?(e.failed=true,false):(e.left-=1,true)}function Ks(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunkWO4V6PNS_cjs.Ue&&(t===void 0||e.localName===t)}function Np(e,t){if(e.kind!=="textValue")return e.attributes.find(n=>n.localName==="val"&&n.namespaceUri===t)?.value}function Lw(e,t,n){if(!Fw(t,n))return "";if(e.kind==="textValue")return e.value;let r="";for(let o of e.children)r+=Lw(o,t,n+1);return r}function nD(e,t,n){if(e.kind==="textValue")return "";let r="",o,i=false,a;for(let d of e.children)if(Ks(d,"t"))r+=Lw(d,t,n+1);else if(Ks(d,"rPr")&&d.kind!=="textValue")for(let u of d.children)Ks(u,"sty")&&(o=Np(u,chunkWO4V6PNS_cjs.Ue)),Ks(u,"nor")&&(i=true);else if(d.kind!=="textValue"&&d.namespaceUri===chunkWO4V6PNS_cjs.la&&d.localName==="rPr"){let u=d.children.find(m=>m.kind!=="textValue"&&m.localName==="color"),f=u?Np(u,chunkWO4V6PNS_cjs.la):void 0;f&&/^[0-9A-Fa-f]{6}$/.test(f)&&(a=f.toUpperCase());}if(r.length===0)return "";let s=`<m:r>${chunkWO4V6PNS_cjs.R(r)}</m:r>`;a!==void 0&&(s=`<span style="color:#${a}">${s}</span>`);let l=!i&&(o===void 0||o==="i"||o==="bi"),c=o==="b"||o==="bi";return l&&(s=`<i>${s}</i>`),c&&(s=`<b>${s}</b>`),s}function Dw(e,t,n){if(e.kind==="textValue"||!Ks(e)||!Fw(t,n))return "";if(e.localName==="r")return nD(e,t,n);if(e.localName==="ctrlPr")return "";let r=Np(e,chunkWO4V6PNS_cjs.Ue),o=r===void 0?"":` m:val="${chunkWO4V6PNS_cjs.S(r)}"`,i="";for(let a of e.children)i+=Dw(a,t,n+1);return i.length>0?`<m:${e.localName}${o}>${i}</m:${e.localName}>`:`<m:${e.localName}${o}/>`}function rD(e){let t="";for(let n of e.match(/\d+(?:\.\d+)?|\p{L}|\s+|./gu)??[]){if(/^\s+$/.test(n))continue;let r=chunkWO4V6PNS_cjs.R(n);/^\d/.test(n)?t+=`<mn>${r}</mn>`:/^\p{L}$/u.test(n)?t+=`<mi>${r}</mi>`:t+=`<mo>${r}</mo>`;}return t}function Hp(e,t){if(t>Aw)return "";let n=r=>`<mrow>${Hp(r,t+1)}</mrow>`;switch(e.kind){case "text":return e.format?.normalText?`<mtext>${chunkWO4V6PNS_cjs.R(e.value)}</mtext>`:rD(e.value);case "fallback":return `<mtext>${chunkWO4V6PNS_cjs.R(e.text)}</mtext>`;case "row":return e.items.map(r=>Hp(r,t+1)).join("");case "bar":return e.position==="top"?`<mover accent="true">${n(e.body)}<mo>\xAF</mo></mover>`:`<munder accentunder="true">${n(e.body)}<mo>\xAF</mo></munder>`;case "fraction":return `<mfrac>${n(e.numerator)}${n(e.denominator)}</mfrac>`;case "radical":return e.degree===void 0?`<msqrt>${n(e.radicand)}</msqrt>`:`<mroot>${n(e.radicand)}${n(e.degree)}</mroot>`;case "script":{let r=n(e.base);return e.subscript&&e.superscript?`<msubsup>${r}${n(e.subscript)}${n(e.superscript)}</msubsup>`:e.subscript?`<msub>${r}${n(e.subscript)}</msub>`:e.superscript?`<msup>${r}${n(e.superscript)}</msup>`:r}case "nary":{let r=`<mo>${chunkWO4V6PNS_cjs.R(e.operator)}</mo>`,o=e.lowerLimit?n(e.lowerLimit):"",i=e.upperLimit?n(e.upperLimit):"";return `<mrow>${o&&i?`<munderover>${r}${o}${i}</munderover>`:o?`<munder>${r}${o}</munder>`:i?`<mover>${r}${i}</mover>`:r}${n(e.body)}</mrow>`}}}function Nw(e){if(!chunkWO4V6PNS_cjs.$e(e))return "";let t=chunkWO4V6PNS_cjs._e(e),n=t?chunkWO4V6PNS_cjs.bf(e):chunkWO4V6PNS_cjs.We(e),r={left:tD,failed:false},o=Dw(e,r,0),i=n===null?"":`<math xmlns="${eD}"${t?' display="block"':""}>${Hp(n.expression,0)}</math>`;return r.failed||o.length===0?i:`<!--[if gte msEquation 12]>${o}<![endif]--><![if !msEquation]>${i}<![endif]>`}function Hw(e){return e.includes("<!--[if gte msEquation 12]>")}var aa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",oD=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<aa.length;t+=1)e[aa.charCodeAt(t)]=t;return e})();function cd(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,i=r.length/4*3-o;if(i<=0||i>t)return null;let a=new Uint8Array(i),s=0;for(let l=0;l<r.length;l+=4){let c=0,d=0;for(let u=0;u<4;u+=1){let f=r.charCodeAt(l+u);if(f===61){if(l+u<r.length-o)return null;continue}let m=f<128?oD[f]:-1;if(m<0)return null;c=c<<6|m,d+=6;}c<<=24-d,d>=12&&(a[s++]=c>>>16&255),d>=18&&(a[s++]=c>>>8&255),d>=24&&(a[s++]=c&255);}return s===i?a:null}function dd(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],i=r+1<e.length?e[r+1]:0,a=r+2<e.length?e[r+2]:0;n+=aa[o>>2]+aa[(o&3)<<4|i>>4],n+=r+1<e.length?aa[(i&15)<<2|a>>6]:"=",n+=r+2<e.length?aa[a&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var iD=16*1024*1024,Bw=64*1024*1024,$w="data-docx-fragment",qw="data-docx-fragment-end",aD=dd;function Ww(e,t){let n=t?.lastMarkCovered?"covered":"open",r=t?`<div ${$w}="${aD(t.bytes)}" ${qw}="${n}">${e}</div>`:`<div>${e}</div>`;return Hw(e)?`<html xmlns:m="${Mw}"><body>${r}</body></html>`:r}function _w(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>Bw)return null;let o=r+n.length,i=e.indexOf('"',o);return i===-1?null:e.slice(o,i)}function sa(e,t=iD){if(e.length>Bw)return null;let n=_w(e,$w);if(n===null||n.length===0)return null;let r=cd(n,t);if(r===null||r.byteLength===0)return null;let o=_w(e,qw);return {bytes:r,lastMarkCovered:o==="covered"}}function ri(e){if(e==null)return null;let t=e.trim();return /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/.test(t)?t:null}var Bp=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],_p={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},$p=new Map([...Object.entries(_p).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function Kw(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(_p,e)?_p[e]:null}var qp=Object.fromEntries(chunkXMJKFURD_cjs.o),Wp={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function jw(e){let t=e.trim();if(t.length===0||t.length>255)return null;let n=t.replace(/[^\p{L}\p{N} _.,-]/gu,"");return n.length===0?null:`"${chunkWO4V6PNS_cjs.V(n)}"`}var sD=new Map([["single","solid"],["thick","solid"],["double","double"],["triple","double"],["dotted","dotted"],["dashed","dashed"],["dashSmallGap","dashed"],["dotDash","dashed"],["dotDotDash","dashed"],["wave","solid"],["hairline","solid"],["inset","solid"],["outset","solid"]]);function oi(e){if(e===null)return null;let t=chunkWO4V6PNS_cjs.$f(e,"val",chunkWO4V6PNS_cjs.la);if(t===void 0||t==="nil"||t==="none")return null;let n=sD.get(t)??"solid",r=chunkWO4V6PNS_cjs.$f(e,"sz",chunkWO4V6PNS_cjs.la),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,i=o>0?o/8:.5,a=`${Math.round(i*100)/100}pt`,s=chunkWO4V6PNS_cjs.$f(e,"color",chunkWO4V6PNS_cjs.la),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${a} ${n} ${l.toLowerCase()}`}function Vw(e,t){return e===null||e<=0?[]:t==="exact"||t==="atLeast"?[`line-height:${`${Math.round(e/20*100)/100}pt`}`,`mso-line-height-rule:${t==="exact"?"exactly":"at-least"}`]:[`line-height:${Math.round(e/240*100)/100}`]}var lD=new Map([["double","double"],["wavyDouble","double"],["dotted","dotted"],["dottedHeavy","dotted"],["dash","dashed"],["dashedHeavy","dashed"],["dashLong","dashed"],["dashLongHeavy","dashed"],["dotDash","dashed"],["dashDotHeavy","dashed"],["dotDotDash","dashed"],["dashDotDotHeavy","dashed"],["wave","wavy"],["wavyHeavy","wavy"]]),cD=new Set(Bp);function Uw(e){if(e===null)return [];let t=chunkWO4V6PNS_cjs.$f(e,"val",chunkWO4V6PNS_cjs.la),n=[],r=t===void 0?void 0:lD.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&cD.has(t)&&n.push(`text-underline:${t}`);let o=chunkWO4V6PNS_cjs.$f(e,"color",chunkWO4V6PNS_cjs.la);return o!==void 0&&/^[0-9A-Fa-f]{6}$/.test(o)&&n.push(`text-decoration-color:#${o.toLowerCase()}`),t==="thick"&&n.push("text-decoration-thickness:2px"),n}function zw(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function Gw(e,t,n,r){if(e.namespaceUri!==chunkWO4V6PNS_cjs.la)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,i=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,a=o??i;if(a===null)return "";let s=chunkWO4V6PNS_cjs.$f(e,"id",chunkWO4V6PNS_cjs.la),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(a,l))return "";let c=a==="footnote",d=o!==null,u=c?"MsoFootnoteReference":"MsoEndnoteReference",f=c?"ftn":"edn",m=d?`#_${f}ref${l}`:`#_${f}${l}`,g=d?`_${f}${l}`:`_${f}ref${l}`;return `<a style="mso-${c?"footnote":"endnote"}-id:${f}${l}" href="${m}" name="${g}"><span class="${u}"><span style="mso-special-character:footnote">[${n(a,l)}]</span></span></a>`}function Zw(e){if(e.namespaceUri!==chunkWO4V6PNS_cjs.la||e.localName!=="ptab")return "";let t=chunkWO4V6PNS_cjs.$f(e,"alignment",chunkWO4V6PNS_cjs.la),n=chunkWO4V6PNS_cjs.$f(e,"relativeTo",chunkWO4V6PNS_cjs.la),r=chunkWO4V6PNS_cjs.$f(e,"leader",chunkWO4V6PNS_cjs.la)??"none";if(t!=="left"&&t!=="center"&&t!=="right")return "";let o=n==="margin"||n==="leftMargin"?"margin":n==="indent"?"indent":null;return o===null||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middleDot"&&r!=="heavy"?"":`<w:PTab Alignment="${t.toUpperCase()}" RelativeTo="${o.toUpperCase()}" Leader="${r.toUpperCase()}"></w:PTab>`}function Mt(e){let t=e.trim().toLowerCase();if(/^-?0+(\.0+)?$/.test(t))return 0;let n=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|in|cm|mm|pc)$/.exec(t);if(!n)return null;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return null;switch(n[2]){case "px":return r*.75;case "in":return r*72;case "cm":return r*72/2.54;case "mm":return r*72/25.4;case "pc":return r*12;default:return r}}function Qw(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("<o:p")||e.includes("class=Mso")||e.includes('class="Mso')||e.includes("class='Mso")}function Jw(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let i=/^Heading([1-9])$/.exec(r);if(i)return `Heading${i[1]}`;let a=$p.get(r);if(a!==void 0)return a}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(Qe(e)):null;return n?`Heading${n[1]}`:void 0}var eS=262144,dD=4096,uD=256,fD=2048,pD=8,mD=new Set(["MsoNormal",...$p.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),gD=new Map([["left","left"],["start","start"],["center","center"],["right","right"],["end","end"],["justify","both"]]),hD=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function yD(e){let t="";for(let n=0;n<e.length;n+=1){if(e.startsWith("<!--",n)){n+=3;continue}if(e.startsWith("-->",n)){n+=2;continue}t+=e[n];}return t}function bD(e,t){let n=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(o==="{"){if(n+=1,n>4)return null}else if(o==="}"&&(n-=1,n===0))return r+1}return null}function vD(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return bD(e,n)}return null}function xD(e){let t=e.split(",");if(t.length===0||t.length>pD)return null;let n=[];for(let r of t){let o=hD.exec(r);if(!o)return null;let i=o[2];if(!mD.has(i))return null;n.includes(i)||n.push(i);}return n}function wD(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let i=n.slice(r+1).trim().toLowerCase();if(i.length===0||i.length>32||i.includes("("))continue;let a=0;for(;a<i.length&&i.charCodeAt(a)>32;)a+=1;let s=gD.get(i.slice(0,a));s!==void 0&&(t=s);}return t}function SD(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>eS)return n();let r=yD(e),o=0,i=0;for(;o<r.length&&i<dD;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let f=vD(r,o);if(f===null)return n();o=f;continue}let a=r.indexOf("{",o);if(a<0)return n();let s=r.slice(o,a),l=r.indexOf("}",a+1);if(l<0)return n();let c=r.slice(a+1,l);if(i+=1,o=l+1,s.length>uD||c.length>fD||c.includes("{"))return n();let d=xD(s),u=wD(c);if(!(!d||u===void 0))for(let f of d)t.set(f,u);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function tS(e){let t=new Map,n=e.getElementsByTagName("style");if(n.length>16)return new Map;for(let r=0;r<n.length;r+=1){let o=n[r]?.textContent??"";if(o.length>eS)return new Map;let i=SD(o);if(!i.ok)return new Map;for(let[a,s]of i.alignments)t.set(a,s);}return t}var kD=262144;function nS(e,t=kD){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let i=n[o]?.textContent??"";i.length>t||r.length+i.length>t||(r+=`
3
+ ${i}`);}return r}function rS(e,t,n){for(let o of t.classList){let i=n.get(o);if(i!==void 0){e.jc=i;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function Kp(e,t,n,r){let o=Mt(t.get(n)??"");if(o!==null&&o>0)return o/.75;let i=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(i))return null;let a=Number.parseInt(i,10);return r?a/.75:a}function la(e){return e.nodeType===1}function Qe(e){return e.tagName.toLowerCase()}var ID=new Map("black:000000 white:FFFFFF red:FF0000 green:008000 blue:0000FF yellow:FFFF00 gray:808080 grey:808080 silver:C0C0C0 maroon:800000 navy:000080 purple:800080 orange:FFA500 aqua:00FFFF cyan:00FFFF fuchsia:FF00FF magenta:FF00FF lime:00FF00 olive:808000 windowtext:000000".split(" ").map(e=>e.split(":"))),RD=new Map([["yellow","yellow"],["aqua","cyan"],["cyan","cyan"],["fuchsia","magenta"],["magenta","magenta"],["lime","green"],["green","green"],["olive","darkYellow"],["red","red"],["blue","blue"],["black","black"],["white","white"],["darkblue","darkBlue"],["darkcyan","darkCyan"],["darkgray","darkGray"],["darkgrey","darkGray"],["darkgreen","darkGreen"],["darkmagenta","darkMagenta"],["darkred","darkRed"],["darkyellow","darkYellow"],["lightgray","lightGray"],["lightgrey","lightGray"]]),PD=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,TD=new Map(Bp.map(e=>[e.toLowerCase(),e])),Xw=new WeakMap;function vt(e){let t=Xw.get(e);if(t!==void 0)return t;let n=new Map;Xw.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let i=o.indexOf(":");if(i<=0)continue;let a=o.slice(0,i).trim().toLowerCase(),s=o.slice(i+1).trim();a.length>0&&s.length>0&&(n.delete(a),n.set(a,s));}return n}function vo(e){let t=e.trim().toLowerCase(),n=ID.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[a,s,l]=o[1];return `${a}${a}${s}${s}${l}${l}`.toUpperCase()}let i=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(i){let a=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${a(i[1])}${a(i[2])}${a(i[3])}`.toUpperCase()}return null}function ED(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return RD.get(t)}function Yw(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||PD.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:vo(t)}function Cn(e,t,n){return Math.min(n,Math.max(t,e))}function fd(e){let t=null;for(let[n,r]of e)if(n==="background")t=Yw(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let i=Yw(r);i!==null&&(t=i);}return t}var CD=new Set(["left","center","right","decimal","bar"]),OD=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function MD(e){if(e===void 0||e.length===0||e.length>512)return;let t="left",n,r=[];for(let o of e.trim().toLowerCase().split(/\s+/)){if(CD.has(o)){t=o;continue}if(o==="list"){t="left";continue}let i=OD.get(o);if(i!==void 0){n=i;continue}let a=Mt(o);if(!(a===null||a<0)){if(r.push({val:t,posTwips:Cn(Math.round(a*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var AD=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function jp(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var FD=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function ud(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let i of jp(e)){let a=i.toLowerCase();if(a==="none"||a==="hidden"){n=true;continue}let s=AD.get(a);if(s!==void 0){t=s;continue}let l=FD.get(i.toLowerCase())??Mt(i);if(l!==null){r=l;continue}let c=vo(i);if(c!==null){o=c;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:Cn(Math.round(r*8),2,96),color:o??"000000"}}function pd(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function js(e,t){return t==="b"||t==="strong"?{...e,bold:true}:t==="i"||t==="em"?{...e,italic:true}:t==="u"||t==="ins"?{...e,underline:true}:t==="s"||t==="strike"||t==="del"?{...e,strike:true}:t==="sub"?{...e,vertAlign:"subscript"}:t==="sup"?{...e,vertAlign:"superscript"}:t==="code"||t==="tt"||t==="kbd"||t==="samp"?{...e,font:"Courier New"}:e}function Vp(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let x=Number.parseInt(r,10);r==="bold"||x>=600?n.bold=true:(r==="normal"||x<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let i=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();i!==void 0&&(i.includes("underline")&&(n.underline=true),i.includes("line-through")&&(n.strike=true),i.includes("none")&&(n.underline=n.strike=false));let a=t.get("font-variant")?.toLowerCase();a!==void 0&&(a.includes("small-caps")?n.smallCaps=true:(a.includes("normal")||a.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let x of l.trim().split(/\s+/)){let k=x.toLowerCase(),R=TD.get(k);if(R!==void 0)n.underline=true,n.underlineVal=R;else {let C=vo(x);C!==null&&(n.underlineColor=C);}}let c=t.get("text-decoration-style")?.trim().toLowerCase();if(c==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){c==="double"?n.underlineVal="double":c==="dotted"?n.underlineVal="dotted":c==="dashed"?n.underlineVal="dash":c==="wavy"&&(n.underlineVal="wave");let x=vo(t.get("text-decoration-color")??"");x!==null&&(n.underlineColor=x);}let d=vo(t.get("color")??"");d&&(n.color=d);let u=ED(t.get("mso-highlight"));if(u)n.highlight=u,delete n.shdFill;else {let x=fd(t);x&&(n.shdFill=x);}let f=Mt(t.get("font-size")??"");f!==null&&f>0&&(n.szHalfPoints=Cn(Math.round(f*2),2,3276));let m=t.get("font-family");if(m!==void 0){let x=m.split(",")[0].trim().replace(/^['"]|['"]$/g,"");x.length>0&&x.length<=64&&(n.font=x);}let g=Mt(t.get("letter-spacing")??"");g!==null&&(n.charSpacingTwentieths=Cn(Math.round(g*20),-31680,31680));let b=t.get("vertical-align")?.trim().toLowerCase();b==="sub"?n.vertAlign="subscript":b==="super"&&(n.vertAlign="superscript");let y=ri(t.get("mso-ansi-language")),h=ri(t.get("mso-fareast-language")),v=ri(t.get("mso-bidi-language"));return y!==null&&(n.langVal=y),h!==null&&(n.langEastAsia=h),v!==null&&(n.langBidi=v),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function ii(e,t){let n=Vp(e,vt(t)),r=ri(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function oS(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="right"||n==="start"||n==="end"?e.jc=n:n==="center"?e.jc="center":n==="justify"&&(e.jc="both"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let h=o.trim().split(/\s+/).map(v=>Mt(v));if(h.length>=1&&h.length<=4&&!h.some(v=>v===null)){let[v,x=v,k=v,R=x]=h.length===2?[h[0],h[1],h[0],h[1]]:h.length===3?[h[0],h[1],h[2],h[1]]:h;r.top=v??null,r.right=x??null,r.bottom=k??null,r.left=R??null;}}let i=Mt(t.get("margin-left")??"")??r.left;i!==null&&(i>0||i===0&&!e.numPr)&&(e.indLeftTwips=Cn(Math.round(i*20),0,31680));let a=Mt(t.get("margin-right")??"")??r.right;a!==null&&a>=0&&(e.indRightTwips=Cn(Math.round(a*20),0,31680));let s=Mt(t.get("text-indent")??"");if(s!==null&&s!==0){let h=Cn(Math.round(s*20),-31680,31680);h!==0&&(e.firstLineTwips=h);}let l=Mt(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=Cn(Math.round(l*20),0,31680));let c=Mt(t.get("margin-bottom")??"")??r.bottom;c!==null&&c>=0&&(e.spacingAfterTwips=Cn(Math.round(c*20),0,31680));let d=t.get("line-height")?.trim()??"",u=t.get("mso-line-height-rule")?.trim().toLowerCase(),f=Mt(d);if(f!==null&&f>0)e.lineTwentieths=Cn(Math.round(f*20),24,31680),e.lineRule=u==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(d)&&Number.parseFloat(d)>0)e.lineTwentieths=Cn(Math.round(240*Number.parseFloat(d)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(d)){let h=Number.parseFloat(d);h>0&&(e.lineTwentieths=Cn(Math.round(2.4*h),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let m=fd(t);m&&(e.shdFill=m);let g=MD(t.get("tab-stops"));g!==void 0&&(e.tabs=g);let b=ud(t.get("mso-border-alt"))??ud(t.get("border")),y={};for(let h of ["top","left","bottom","right"]){let v=ud(t.get(`mso-border-${h}-alt`))??ud(t.get(`border-${h}`))??b;v!==void 0&&v!=="suppressed"&&(y[h]=v);}Object.keys(y).length>0&&(e.borders=y);}var LD="http://schemas.openxmlformats.org/drawingml/2006/picture",DD=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,ND=new Map([["image/png","png"],["image/jpeg","jpeg"],["image/gif","gif"],["image/bmp","bmp"],["image/webp","webp"],["image/svg+xml","svg"],["image/tiff","tiff"],["image/x-emf","emf"],["image/x-wmf","wmf"]]);function iS(e,t,n){return Math.min(n,Math.max(t,e))}function aS(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let i=DD.exec(o);if(!i)return;let a=n.mediaBySrc.get(o),s=a===void 0?void 0:n.media.get(a),l=s??cd(i[1],n.maxImageBytes);if(l==null)return;let c=chunkWO4V6PNS_cjs.fe(l),d=ND.get(c);if(d===void 0)return;let u=c==="image/png"||c==="image/jpeg"||c==="image/gif"||c==="image/bmp"||c==="image/webp"?chunkWO4V6PNS_cjs.ke(l,c):null,f=vt(e),m=Kp(e,f,"width",n.wordHtml),g=Kp(e,f,"height",n.wordHtml);u!==null?m===null&&g===null?(m=u.pixelWidth*96/(u.dpiX??96),g=u.pixelHeight*96/(u.dpiY??96)):m!==null&&g===null?g=m*u.pixelHeight/u.pixelWidth:m===null&&g!==null&&(m=g*u.pixelWidth/u.pixelHeight):m!==null&&g===null?g=m*2/3:m===null&&g!==null&&(m=g*3/2);let b=m===null?381e4:iS(Math.round(m*9525),9525,3e7),y=g===null?254e4:iS(Math.round(g*9525),9525,3e7),h=s===void 0?void 0:a;h===void 0&&(n.imageCount+=1,h=`word/media/image${n.imageCount}.${d}`,n.media.set(h,l),n.mediaBySrc.set(o,h),n.mediaExtensions.has(d)||n.mediaExtensions.set(d,c));let v=r(h.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${b}" cy="${y}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${LD}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${v}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${b}" cy="${y}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}var HD="http://schemas.openxmlformats.org/wordprocessingml/2006/main",_D='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',sS=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function lS(e,t,n){let r=720*(n+1);if(e==="bullet"){let i=sS[n%sS.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunkWO4V6PNS_cjs.S(i.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${i.font}" w:hAnsi="${i.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=e==="lowerRoman"||e==="upperRoman";return `<w:lvl w:ilvl="${n}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="%${n+1}."/><w:lvlJc w:val="${o?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${o?180:360}"/></w:pPr></w:lvl>`}var BD=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),$D=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),cS=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function dS(e){let t=new Map;if(e.length===0||e.length>262200)return t;cS.lastIndex=0;let n,r=0;for(;(n=cS.exec(e))!==null&&r<512;){r+=1;let o="decimal",i=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let c=s.slice(0,l).trim().toLowerCase(),d=s.slice(l+1).trim().toLowerCase();c==="mso-level-number-format"?o=$D.get(d)??null:c==="mso-level-start-at"&&/^\d{1,5}$/.test(d)&&(i=Math.min(32767,Number.parseInt(d,10)));}if(o===null)continue;let a=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(a)||t.set(a,{kind:o,start:i});}return t}function uS(e,t){let n=e.trim().replace(/^\(/,"");if(t==="decimal"){let r=/^(\d{1,5}(?:\.\d{1,5})*)/.exec(n);if(!r)return null;let o=r[1].split(".");return Math.min(32767,Number.parseInt(o[o.length-1],10))}if(t==="lowerRoman"||t==="upperRoman"){let r=/^([A-Za-z]{1,8})/.exec(n);return r?fS(r[1]):null}if(t==="lowerLetter"||t==="upperLetter"){let r=/^(([A-Za-z])\2{0,4})(?![A-Za-z])/.exec(n);if(!r)return null;let o=r[2].toLowerCase().charCodeAt(0);return Math.min(32767,(r[1].length-1)*26+(o-96))}return null}var qD=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function fS(e){let t=e.toLowerCase();if(!qD.test(t))return null;let n=0,r=0;for(let o of t){let i=BD.get(o);if(i===void 0)return null;n+=i,r>0&&r<i&&(n-=2*r),r=i;}return n>0&&n<=32767?n:null}function pS(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let a=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(a[a.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let a=r[1].toLowerCase();if(a==="i"||a==="v"||a==="x"){let l=a==="i"?1:a==="v"?5:10;return {kind:r[1]===a?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let a=o[1],s=a===a.toLowerCase(),l=/^([A-Za-z])\1+$/.test(a);if(!l||/^[iI]+$/.test(a)){let c=fS(a);if(c!==null)return {kind:s?"lowerRoman":"upperRoman",start:c}}if(l){let c=a.toLowerCase().charCodeAt(0),d=Math.min(32767,(a.length-1)*26+(c-96));return {kind:s?"lowerLetter":"upperLetter",start:d}}}let i=/\d{1,5}/.exec(t);return i?{kind:"decimal",start:Math.min(32767,Number.parseInt(i[0],10))}:{kind:"bullet",start:1}}var WD=new Map([["none","none"],["decimal","decimal"],["upper-alpha","upperLetter"],["upper-latin","upperLetter"],["lower-alpha","lowerLetter"],["lower-latin","lowerLetter"],["upper-roman","upperRoman"],["lower-roman","lowerRoman"]]);function mS(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=vt(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:WD.get(t);if(n!==void 0)return n;let r=e.getAttribute("type");return r==="A"?"upperLetter":r==="a"?"lowerLetter":r==="I"?"upperRoman":r==="i"?"lowerRoman":"decimal"}function Up(e){let t=e.getAttribute("start")?.trim();return t!==void 0&&/^\d{1,5}$/.test(t)?Math.min(32767,Number.parseInt(t,10)):1}function gS(e){let t=e.map((r,o)=>{let i=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},a=Array.from({length:9},(s,l)=>{let c=r.levels.get(l);return c?lS(c.kind,c.start,l):lS(i.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${a}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${_D}<w:numbering xmlns:w="${HD}">${t}${n}</w:numbering>`}function Gn(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let a=0;a<t.length;a+=1)r=(Math.imul(r,33)^t.charCodeAt(a))>>>0;let o=`_${r.toString(36)}`,i=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(i)||(i=`_${i.slice(0,39-o.length)}`),`${i}${o}`}function hS(e){if(e===null)return false;if(e.startsWith("#"))return Gn(e.slice(1))!==null;let t=chunkWO4V6PNS_cjs.Q(e);return t?.ok===true&&t.href.length>0}function yS(e,t){if(e!==void 0&&e.startsWith("#")){let o=Gn(e.slice(1)),i=Gn(t)??o;return i===null?null:`#${i}`}let n=e===void 0?null:chunkWO4V6PNS_cjs.Q(e),r=Gn(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function bS(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let a=e.value;return e=null,a}let o=r(),i={html:t,key:n,value:o};return e=i,globalThis.setTimeout(()=>{e===i&&(e=null);},0),o}}var KD=/^(ftn|edn)([1-9]\d{0,9})$/i,jD={footnote:"ftn",endnote:"edn"};function vS(e,t){let n=e===null?null:KD.exec(e);if(!n||n[1].toLowerCase()!==jD[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function zp(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=vS(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function VD(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=vS(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function xS(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],i=VD(o,vt(o));i!==null&&t.push({...i,element:o});}return t}function wS(e,t,n){let r=new Map(t.map(a=>[a.element,a])),o=a=>{let s=a.parentElement;for(let l=0;s!==null&&l<128;l+=1){let c=r.get(s);if(c!==void 0)return c;s=s.parentElement;}return null},i=e.getElementsByTagName("a");for(let a=0;a<i.length&&a<2e4;a+=1){let s=i[a],l=zp(vt(s));if(l===null)continue;let c=o(s);c!==null&&c.kind===l.kind&&c.id===l.id||n[l.kind].add(l.id);}}function SS(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var UD=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function ca(e,t,n){return e.replace(UD,(r,o,i)=>{let a=`${o}:${i}`;return t.has(a)?n?.get(a)??"":r})}function Gp(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${n}</w:${e}s>`}function kS(e,t,n,r){let o=new Set,i={footnote:new Set,endnote:new Set},a=()=>{i.footnote.clear(),i.endnote.clear();let s=[],l=(c,d)=>{o.has(`${c}:${d}`)||!e.notes[c].has(d)||i[c].has(d)||(i[c].add(d),s.push({kind:c,id:d}));};for(let c of ["footnote","endnote"])for(let d of e.bodyNoteRefs[c])l(c,d);for(let c of o)for(let d of e.noteNoteRefs.get(c)??[])l(d.kind,d.id);for(;s.length>0;){let c=s.pop();for(let d of e.noteNoteRefs.get(`${c.kind}:${c.id}`)??[])l(d.kind,d.id);}};for(;;){a();let s=false;for(let l of ["footnote","endnote"]){for(let c of e.notes[l].keys()){let d=`${l}:${c}`;if(!(i[l].has(c)||o.has(d))){o.add(d),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,c]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,c.map(d=>ca(d,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,c]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let d=new Map;for(let u of c){let f=ca(u.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(m,g,b)=>{let y=d.get(b);if(y===void 0){let h=e.noteRels[s].find(v=>v.id===b);if(h===void 0)return m;y=r(e,h.type,h.target,h.external),d.set(b,y);}return ` r:${g}="${y}"`});n.push(f),e.lastMarkCovered=false;}}}function Zp(e,t,n,r=1,o=0){let i=e.lists.get(t);if(i)return i.levels.has(o)||i.levels.set(o,{kind:n,start:r}),i.numId;let a=String(1001+e.lists.size),s={numId:a,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(a,s),a}function IS(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let i=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!i)return;let a=Math.min(Math.max(Number.parseInt(i[2],10)-1,0),8),s=zD(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),c=(l!==null?n.listDefinitions.get(`l${i[1]}:level${i[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${i[1]}:level${i[2]}`),d,u;c!==void 0?(d=c.kind,u=uS(s,d)??c.start??1):{kind:d,start:u}=pS(s);let m=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${i[1]}${l?`:lfo${l[1]}`:""}`;return {numId:Zp(n,m,d,u,a),ilvl:a}}function zD(e,t){let n="",r=(o,i)=>{if(!(n.length>0||i>8||t.nodesLeft<=0)&&la(o)){if(pd(o)){n=(o.textContent??"").slice(0,16);return}for(let a of Array.from(o.childNodes))r(a,i+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var GD="http://schemas.openxmlformats.org/package/2006/relationships",ZD="http://schemas.openxmlformats.org/package/2006/content-types",XD="application/vnd.openxmlformats-package.relationships+xml",Qp='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',YD="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Yp="http://schemas.openxmlformats.org/officeDocument/2006/relationships",QD="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",JD="http://schemas.openxmlformats.org/drawingml/2006/main",eN="http://schemas.openxmlformats.org/drawingml/2006/picture",tN="http://schemas.openxmlformats.org/officeDocument/2006/math",RS={document:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",numbering:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"};function Xp(e){let t=e.map(n=>`<Relationship Id="${chunkWO4V6PNS_cjs.S(n.id)}" Type="${chunkWO4V6PNS_cjs.S(n.type)}" Target="${chunkWO4V6PNS_cjs.S(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${Qp}<Relationships xmlns="${GD}">${t}</Relationships>`}function nN(e){let t=new Map;t.set("word/document.xml",chunkWO4V6PNS_cjs.Vd(e.documentXml)),t.set("word/_rels/document.xml.rels",chunkWO4V6PNS_cjs.Vd(Xp(e.rels))),t.set("_rels/.rels",chunkWO4V6PNS_cjs.Vd(Xp([{id:"rId1",type:`${Yp}/officeDocument`,target:"word/document.xml",external:false}])));let n=[["numbering",e.numberingXml],["footnotes",e.footnotesXml],["endnotes",e.endnotesXml]],r=`<Override PartName="/word/document.xml" ContentType="${RS.document}"/>`;for(let[i,a]of n)a!==void 0&&(t.set(`word/${i}.xml`,chunkWO4V6PNS_cjs.Vd(a)),r+=`<Override PartName="/word/${i}.xml" ContentType="${RS[i]}"/>`);for(let[i,a]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])a!==void 0&&a.length>0&&t.set(`word/_rels/${i}.xml.rels`,chunkWO4V6PNS_cjs.Vd(Xp(a)));for(let[i,a]of e.media)t.set(i,a);let o=`<Default Extension="rels" ContentType="${XD}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[i,a]of e.mediaExtensions)o+=`<Default Extension="${chunkWO4V6PNS_cjs.S(i)}" ContentType="${chunkWO4V6PNS_cjs.S(a)}"/>`;return t.set("[Content_Types].xml",chunkWO4V6PNS_cjs.Vd(`${Qp}<Types xmlns="${ZD}">${o}${r}</Types>`)),chunkWO4V6PNS_cjs.Ud(t)}function PS(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${Yp}/${o}`,target:`${o}.xml`,external:false});};e.lists.length>0&&n("numbering");for(let o of ["footnote","endnote"])e.notes[o].size>0&&n(`${o}s`);let r=`${Qp}<w:document xmlns:w="${YD}" xmlns:r="${Yp}" xmlns:wp="${QD}" xmlns:a="${JD}" xmlns:pic="${eN}" xmlns:m="${tN}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return nN({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:gS(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:Gp("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:Gp("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function zr(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(!(r!==9&&(r<32||r===65534||r===65535))){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function yr(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${chunkWO4V6PNS_cjs.S(e.rStyle)}"/>`),e.font!==void 0){let a=chunkWO4V6PNS_cjs.S(zr(e.font));t+=e.rtl?`<w:rFonts w:cs="${a}"/>`:`<w:rFonts w:ascii="${a}" w:hAnsi="${a}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${chunkWO4V6PNS_cjs.S(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let i=`${n===void 0?"":` w:val="${chunkWO4V6PNS_cjs.S(n)}"`}${r===void 0?"":` w:eastAsia="${chunkWO4V6PNS_cjs.S(r)}"`}${o===void 0?"":` w:bidi="${chunkWO4V6PNS_cjs.S(o)}"`}`;return i.length>0&&(t+=`<w:lang${i}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function md(e,t){return `<w:r>${yr(t)}<w:t xml:space="preserve">${chunkWO4V6PNS_cjs.R(zr(e))}</w:t></w:r>`}function rN(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${chunkWO4V6PNS_cjs.S(e.styleId)}"/>`),e.keepNext&&(t+="<w:keepNext/>"),e.keepLines&&(t+="<w:keepLines/>"),e.pageBreakBefore&&(t+="<w:pageBreakBefore/>"),e.widowControl&&(t+="<w:widowControl/>"),e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${chunkWO4V6PNS_cjs.S(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let a="";for(let s of ["top","left","bottom","right"]){let l=e.borders[s];l!==void 0&&(a+=`<w:${s} w:val="${l.val}" w:sz="${l.szEighthPoints}" w:space="0" w:color="${l.color}"/>`);}a.length>0&&(t+=`<w:pBdr>${a}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(a=>`<w:tab w:val="${a.val}" w:pos="${a.posTwips}"`+(a.leader===void 0?"/>":` w:leader="${a.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let a="<w:spacing";e.spacingBeforeTwips!==void 0&&(a+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(a+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(a+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${a}/>`;}let n=e.firstLineTwips,[r,o]=e.bidi?[e.indRightTwips,e.indLeftTwips]:[e.indLeftTwips,e.indRightTwips];if(r!==void 0||o!==void 0||n!==void 0){let a="<w:ind";r!==void 0&&(a+=` w:left="${r}"`),o!==void 0&&(a+=` w:right="${o}"`),n!==void 0&&(a+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${a}/>`;}let i=e.jc==="start"?"left":e.jc==="end"?"right":e.bidi&&(e.jc==="left"||e.jc==="right")?e.jc==="left"?"right":"left":e.jc;return i!==void 0&&(t+=`<w:jc w:val="${i}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function ai(e,t){return `<w:p>${rN(e)}${t.join("")}</w:p>`}var ES={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function gd(e){let t=e[e.length-1];if(t?.endsWith("</w:p>")){e[e.length-1]=`${t.slice(0,-6)}<w:r><w:br w:type="page"/></w:r></w:p>`;return}e.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>');}var oN=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,TS=new WeakMap;function Jp(e){let t=TS.get(e);for(t||(t={checked:0,furniture:true},TS.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=oN.test(e[t.checked]),t.checked+=1;return t.furniture}var si=32;function On(e){return e.left<=0?(e.truncated=true,false):(e.left-=1,e.visited+=1,true)}var CS=Object.freeze({});function OS(e,t){let n={...t};return e.bold!==void 0&&(n.bold=e.bold),e.italic!==void 0&&(n.italic=e.italic),e.color!==void 0&&(n.color=e.color),e.highlight!==void 0&&(n.highlight=e.highlight),e.shdFill!==void 0&&(n.shdFill=e.shdFill),e.szHalfPoints!==void 0&&(n.szHalfPoints=e.szHalfPoints),n}function iN(e){return e.replace(/ /g," ").replace(/[⁡-⁤]/g,"").replace(/[ \t\r\n\f\v]+/g," ")}function Gr(e,t,n){let r=chunkWO4V6PNS_cjs.R(zr(iN(e)));if(r.length===0)return "";let i=n.uprightUnlessItalic===true&&n.italic!==true?n.bold?"b":"p":n.bold?"bi":null,a=t.length>0?t:i?`<m:sty m:val="${i}"/>`:"",s=yr({...n.color!==void 0?{color:n.color}:{},...n.highlight!==void 0?{highlight:n.highlight}:{},...n.shdFill!==void 0?{shdFill:n.shdFill}:{},...n.szHalfPoints!==void 0?{szHalfPoints:n.szHalfPoints}:{}});return `<m:r>${a.length>0?`<m:rPr>${a}</m:rPr>`:""}${s}<m:t xml:space="preserve">${r}</m:t></m:r>`}var aN=512,MS=new Set(["\u2211","\u220F","\u2210","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"]),sN=new Map([["^","\u0302"],["\u02C6","\u0302"],["\u0302","\u0302"],["~","\u0303"],["\u02DC","\u0303"],["\u0303","\u0303"],["\u02D9","\u0307"],["\u0307","\u0307"],["\xA8","\u0308"],["\u0308","\u0308"],["\u2192","\u20D7"],["\u20D7","\u20D7"],["\xB4","\u0301"],["`","\u0300"],["\u02C7","\u030C"],["\u02D8","\u0306"]]),AS=new Set(["\xAF","\u203E","_","\u2015","\u2014","\u0305","-"]),FS=new Map([["(",")"],["[","]"],["{","}"],["|","|"],["\u2016","\u2016"],["\u27E8","\u27E9"],["\u2329","\u232A"],["\u230A","\u230B"],["\u2308","\u2309"]]),lN=new Set(["annotation","annotation-xml","none","mprescripts","mspace","maligngroup","malignmark","mphantom"]),cN=new Set(["msub","msup","msubsup","munder","mover","munderover"]);function Zr(e){return e.localName.toLowerCase()}function Us(e){return Array.from(e.children)}function xo(e){return (e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim().slice(0,aN)}function li(e){return chunkWO4V6PNS_cjs.S(zr(e))}function $e(e,t){return t.length>0?`<m:${e}>${t}</m:${e}>`:`<m:${e}/>`}function LS(e,t){let n=t,r=e.getAttribute("mathcolor")?.trim()??"",o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r)?.[1];if(o!==void 0){let a=o.length===3?o.replace(/./g,s=>s+s):o;n={...n,color:a.toUpperCase()};}let i=e.getAttribute("mathvariant")?.trim().toLowerCase();return (i==="bold"||i==="bold-italic")&&(n={...n,bold:true}),n}function Vs(e){if(e===void 0||Zr(e)!=="mo")return null;let t=xo(e);return [...t].length===1?t:null}var em=class{constructor(t){this.state=t;}state;node(t,n,r){if(n>si)return this.state.truncated=true,"";if(!On(this.state))return "";let o=Zr(t),i=LS(t,r),a=Us(t),s=l=>a[l]?this.node(a[l],n+1,i):"";if(lN.has(o))return "";switch(o){case "semantics":return s(0);case "mi":return this.identifier(t,i);case "mn":case "mo":return Gr(xo(t),"",i);case "mtext":return Gr(xo(t),"<m:nor/>",i);case "ms":return Gr(`"${xo(t)}"`,"<m:nor/>",i);case "msub":return `<m:sSub>${$e("e",s(0))}${$e("sub",s(1))}</m:sSub>`;case "msup":return `<m:sSup>${$e("e",s(0))}${$e("sup",s(1))}</m:sSup>`;case "msubsup":return `<m:sSubSup>${$e("e",s(0))}${$e("sub",s(1))}${$e("sup",s(2))}</m:sSubSup>`;case "mfrac":return this.fraction(t,s(0),s(1));case "msqrt":return `<m:rad><m:radPr><m:degHide m:val="1"/></m:radPr><m:deg/>${$e("e",this.row(a,n+1,i))}</m:rad>`;case "mroot":return `<m:rad>${$e("deg",s(1))}${$e("e",s(0))}</m:rad>`;case "munder":return this.under(a[1],s(0),s(1));case "mover":return this.over(t,a[1],s(0),s(1));case "munderover":return `<m:limUpp>${$e("e",`<m:limLow>${$e("e",s(0))}${$e("lim",s(1))}</m:limLow>`)}${$e("lim",s(2))}</m:limUpp>`;case "mfenced":return this.fenced(t,a,n,i);case "menclose":return `<m:borderBox>${$e("e",this.row(a,n+1,i))}</m:borderBox>`;case "mtable":return this.table(a,n,i);case "mmultiscripts":return this.multiscripts(a,n,i);default:return this.row(a,n+1,i)}}identifier(t,n){let r=xo(t),o=t.getAttribute("mathvariant")?.trim().toLowerCase(),i="";return o==="normal"||o===void 0&&[...r].length>1?i='<m:sty m:val="p"/>':o==="bold"?i='<m:sty m:val="b"/>':o==="bold-italic"&&(i='<m:sty m:val="bi"/>'),Gr(r,i,n)}fraction(t,n,r){let o=t.getAttribute("linethickness")?.trim().toLowerCase(),i=t.getAttribute("bevelled")?.trim().toLowerCase()==="true",a=o!==void 0&&/^0(?:\.0*)?(?:px|pt|em|ex|%)?$/.test(o)?"noBar":i?"skw":null;return `<m:f>${a===null?"":`<m:fPr><m:type m:val="${a}"/></m:fPr>`}${$e("num",n)}${$e("den",r)}</m:f>`}under(t,n,r){let o=Vs(t);return o!==null&&AS.has(o)?`<m:bar><m:barPr><m:pos m:val="bot"/></m:barPr>${$e("e",n)}</m:bar>`:`<m:limLow>${$e("e",n)}${$e("lim",r)}</m:limLow>`}over(t,n,r,o){let i=Vs(n);if(i!==null&&AS.has(i))return `<m:bar><m:barPr><m:pos m:val="top"/></m:barPr>${$e("e",r)}</m:bar>`;let a=i===null?void 0:sN.get(i);return a!==void 0||i!==null&&t.getAttribute("accent")?.trim()==="true"?`<m:acc><m:accPr><m:chr m:val="${li(a??i)}"/></m:accPr>${$e("e",r)}</m:acc>`:`<m:limUpp>${$e("e",r)}${$e("lim",o)}</m:limUpp>`}fenced(t,n,r,o){let i=[...t.getAttribute("open")??"("].slice(0,1).join(""),a=[...t.getAttribute("close")??")"].slice(0,1).join(""),s=[...(t.getAttribute("separators")??",").trim()][0]??"",l=n.map(c=>$e("e",this.node(c,r+1,o)));return `<m:d><m:dPr><m:begChr m:val="${li(i)}"/>${s.length>0?`<m:sepChr m:val="${li(s)}"/>`:""}<m:endChr m:val="${li(a)}"/></m:dPr>${l.join("")||"<m:e/>"}</m:d>`}table(t,n,r){let o="";for(let i of t){if(!On(this.state))break;let a=Zr(i);if(a!=="mtr"&&a!=="mlabeledtr")continue;let s=Us(i).slice(a==="mlabeledtr"?1:0);o+="<m:mr>"+s.map(l=>$e("e",Zr(l)==="mtd"?this.row(Us(l),n+2,r):this.node(l,n+2,r))).join("")+"</m:mr>";}return o.length>0?`<m:m>${o}</m:m>`:""}multiscripts(t,n,r){let o=c=>c===void 0||Zr(c)==="none"?"":this.node(c,n+1,r),i=t.findIndex(c=>Zr(c)==="mprescripts"),a=i<0?t.slice(1):t.slice(1,i),s=i<0?[]:t.slice(i+1),l=o(t[0]);return a.length>0&&(l=`<m:sSubSup>${$e("e",l)}${$e("sub",o(a[0]))}${$e("sup",o(a[1]))}</m:sSubSup>`),s.length>0?`<m:sPre>${$e("sub",o(s[0]))}${$e("sup",o(s[1]))}${$e("e",l)}</m:sPre>`:l}nary(t,n,r,o){let i=Zr(t),a=Us(t),s=xo(i==="mo"?t:a[0]),l=g=>a[g]?this.node(a[g],r+1,o):"",c="",d="";i==="msub"||i==="munder"?c=l(1):i==="msup"||i==="mover"?d=l(1):(i==="msubsup"||i==="munderover")&&(c=l(1),d=l(2));let u=i==="munder"||i==="mover"||i==="munderover"?"undOvr":"subSup",f=`<m:chr m:val="${li(s)}"/><m:limLoc m:val="${u}"/>${c.length===0?'<m:subHide m:val="1"/>':""}${d.length===0?'<m:supHide m:val="1"/>':""}`,m=n?this.node(n,r+1,o):"";return `<m:nary><m:naryPr>${f}</m:naryPr>${$e("sub",c)}${$e("sup",d)}${$e("e",m)}</m:nary>`}isNary(t){let n=Zr(t);if(n==="mo")return MS.has(xo(t));if(!cN.has(n))return false;let r=t.children[0];return r!==void 0&&MS.has(Vs(r)??"")}row(t,n,r){if(n>si)return this.state.truncated=true,"";let o=Vs(t[0]),i=Vs(t[t.length-1]);if(t.length>=2&&o!==null&&i!==null&&FS.has(o)&&[...FS.values()].includes(i)){let l=this.row(t.slice(1,-1),n+1,r);return `<m:d><m:dPr><m:begChr m:val="${li(o)}"/><m:endChr m:val="${li(i)}"/></m:dPr>${$e("e",l)}</m:d>`}let a="";for(let s=0;s<t.length;s+=1){let l=t[s];if(this.isNary(l)){let c=t[s+1];a+=this.nary(l,c,n,r),c!==void 0&&(s+=1);continue}a+=this.node(l,n,r);}return a}};function tm(e){return Zr(e)==="math"}function DS(e){return e.getAttribute("display")?.trim().toLowerCase()==="block"||e.getAttribute("mode")?.trim().toLowerCase()==="display"}function NS(e,t,n){return new em(t).row(Us(e),1,LS(e,n))}var dN="acc accPr aln alnScr argPr argSz bar barPr baseJc begChr borderBox borderBoxPr box boxPr brk brkBin brkBinSub cGp cGpRule chr count cSp ctrlPr d defJc deg degHide den diff dispDef dPr e endChr eqArr eqArrPr f fName fPr func funcPr groupChr groupChrPr grow hideBot hideLeft hideRight hideTop interSp intLim intraSp jc lim limLoc limLow limLowPr limUpp limUppPr lit lMargin m mathFont mathPr maxDist mc mcJc mcPr mcs mPr mr nary naryLim naryPr noBreak nor num objDist oMath oMathPara oMathParaPr opEmu phant phantPr plcHide pos postSp preSp r rad radPr rMargin rPr rSp rSpRule scr sepChr show shp smallFrac sPre sPrePr sSub sSubPr sSubSup sSubSupPr sSup sSupPr strikeBLTR strikeH strikeTLBR strikeV sty sub subHide sup supHide t transp type vertJc wrapIndent wrapRight zeroAsc zeroDesc zeroWid".split(" "),_S=new Map(dN.map(e=>[`m:${e.toLowerCase()}`,e])),uN=new Set(["oMath","e","num","den","sub","sup","deg","lim","fName"]),fN=512,pN=512,mN=64,gN=64,hN=2,yN=256,HS=/^\[if\s+gte\s+msEquation\b[^\]]*\]>([\s\S]*)<!\[endif\]$/i,bN=/^\[if\s+!msEquation\s*\]$/i,vN=/^\[if\b[^\]]*\]$/i,xN=/^\[endif\]$/i,wN=Object.freeze({byElement:new Map,visited:0,truncated:false});function BS(e){return /<m:omath|msEquation|<math[\s>]/i.test(e)}function zs(e){return e.nodeType===1?_S.get(Qe(e)):void 0}function $S(e,t,n,r){if(!(n>si||!On(t))){if(e.nodeType===3){r.push(e.nodeValue??"");return}if(!(e.nodeType!==1||Qe(e)==="o:p"))for(let o of Array.from(e.childNodes))$S(o,t,n+1,r);}}function nm(e,t){return OS(ii(js({},Qe(e)),e),t)}function SN(e,t,n,r){let o="",i=[],a=r;for(let s of Array.from(e.childNodes)){let l=zs(s);if(l==="rPr")o+=hd(s,"rPr",t,n+1,r);else {if(s.nodeType===1&&Qe(s)==="w:rpr")continue;s.nodeType===1&&l===void 0&&(a=nm(s,a)),$S(s,t,n+1,i);}}return Gr(i.join(""),o,a)}function hd(e,t,n,r,o){let i="",a="",s=uN.has(t);for(let l of Array.from(e.childNodes)){if(l.nodeType===3){if(!On(n))break;s&&(a+=l.nodeValue??"");continue}l.nodeType===1&&(a.trim().length>0&&(i+=Gr(a,"",o)),a="",i+=qS(l,t,n,r+1,o));}return a.trim().length>0&&(i+=Gr(a,"",o)),i}function qS(e,t,n,r,o){if(r>si)return n.truncated=true,"";if(!On(n))return "";let i=_S.get(Qe(e));if(i===void 0)return Qe(e)==="o:p"?"":hd(e,t,n,r,nm(e,o));if(i==="ctrlPr"||i==="oMathPara"||i==="oMath")return "";if(i==="r"||i==="t")return SN(e,n,r,o);let a=e.getAttribute("m:val"),s=a!==null&&a.length<=mN?` m:val="${chunkWO4V6PNS_cjs.S(zr(a))}"`:"",l=hd(e,i,n,r,o);return l.length>0?`<m:${i}${s}>${l}</m:${i}>`:`<m:${i}${s}/>`}function WS(e,t,n){if(!On(t))return null;let r=hd(e,"oMath",t,1,n);return r.length>0?`<m:oMath>${r}</m:oMath>`:null}function KS(e,t,n,r,o){if(!(n>si||!On(t)))for(let i of Array.from(e.children)){let a=zs(i);if(a==="oMath"){let s=WS(i,t,r);s!==null&&o.equations.push(s);}else a==="oMathParaPr"&&o.properties.length===0?o.properties=qS(i,"oMathPara",t,n+1,r):a===void 0&&KS(i,t,n+1,nm(i,r),o);}}function kN(e){let t=zs(e);return t==="oMath"||t==="oMathPara"||tm(e)}function IN(e){let t=0;for(let n=e.parentElement;n!==null;n=n.parentElement)if((t+=1)>yN||kN(n))return true;return false}function RN(e,t){if(typeof e.createTreeWalker!="function")return;let n=e.createTreeWalker(e.body,128),r=[];for(let o=n.nextNode();o!==null;o=n.nextNode()){if(!On(t))return;let i=o.data;if(/<m:omath|<math[\s>]/i.test(i)&&HS.test(i)){if(r.length>=pN){t.truncated=true;break}r.push(o);}}for(let o of r){let i=HS.exec(o.data)?.[1]??"",a;try{a=new DOMParser().parseFromString(i,"text/html");}catch{continue}let s=o.parentNode;if(!(s===null||a.body===null)){for(let l of Array.from(a.body.childNodes))s.insertBefore(e.importNode(l,true),o);s.removeChild(o);}}}function PN(e){return e.nodeType===3?(e.nodeValue??"").replace(/[\s ]/g,"").length>0:e.nodeType===1||e.nodeType===8}function TN(e){let t=e;for(let n=0;n<=hN;n+=1){let r=t.nextSibling;for(;r!==null&&!PN(r);)r=r.nextSibling;if(r!==null){if(r.nodeType!==8||!bN.test(r.data.trim()))return;let a=[r],s=1;for(let l=r.nextSibling;l!==null&&a.length<=gN;l=l.nextSibling)if(a.push(l),l.nodeType===8){let c=l.data.trim();if(xN.test(c)?s-=1:vN.test(c)&&(s+=1),s===0){for(let d of a)d.parentNode?.removeChild(d);return}}return}let o=t.parentElement;if(o===null||zs(o)!==void 0)return;let i=Qe(o);if(i!=="span"&&i!=="i"&&i!=="b"&&i!=="font")return;t=o;}}function EN(e,t){let n=e.getElementsByTagName("i").length>0?{uprightUnlessItalic:true}:CS;if(tm(e)){if(!On(t))return null;let r=NS(e,t,n);return r.length===0?null:DS(e)?`<m:oMathPara><m:oMath>${r}</m:oMath></m:oMathPara>`:`<m:oMath>${r}</m:oMath>`}if(zs(e)==="oMathPara"){let r={properties:"",equations:[]};return KS(e,t,1,n,r),r.equations.length===0?null:`<m:oMathPara>${r.properties}${r.equations.join("")}</m:oMathPara>`}return WS(e,t,n)}function jS(e,t){if(e.body===null||t<=0)return wN;let n={left:t,visited:0,truncated:false};RN(e,n);let r=new Map,o=[];for(let i of ["m:omathpara","m:omath","math"]){let a=e.body.getElementsByTagName(i);for(let s=0;s<a.length;s+=1){if(o.length>=fN){n.truncated=true;break}if(!On(n))break;let l=a[s];IN(l)||o.push(l);}}for(let i of o){if(n.left<=0){n.truncated=true;break}let a=EN(i,n);a===null||n.truncated||(r.set(i,[a]),TN(i));}return {byElement:r,visited:n.visited,truncated:n.truncated}}function rm(e){return e.startsWith("<m:oMath>")||e.startsWith("<m:oMathPara>")}function Zn(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var wo=31680;function Xr(e,t,n){return Math.min(n,Math.max(t,e))}function VS(e){let t=Mt(vt(e).get("width")??"");if(t!==null&&t>0)return t;let n=e.getAttribute("width")?.trim();if(n===void 0||!/^\d{1,6}(\.\d+)?$/.test(n))return null;let r=Number.parseFloat(n);return Number.isFinite(r)&&r>0?r*.75:null}function CN(e){return ci(e,"colspan",63)}function US(e){return Array.from(e.children).flatMap(t=>{let n=Qe(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>Qe(r)==="tr")})}function ci(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Xr(Number.parseInt(r,10),1,n)}function zS(e,t){let n=(vt(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${Xr(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=VS(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let i=Xr(Math.round(o*20),1,wo);return {xml:`<w:tblW w:w="${i}" w:type="dxa"/>`,twips:i}}function GS(e){let n=vt(e).get("mso-table-left")?.trim().toLowerCase(),r=(n==="left"||n==="center"||n==="right"?n:void 0)??e.getAttribute("align")?.trim().toLowerCase();return r==="left"||r==="center"||r==="right"?r:void 0}function ZS(e){let t=vt(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",i=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,a=t.get("mso-table-left")?.trim().toLowerCase();if(a==="left"||a==="center"||a==="right")i+=` w:tblpXSpec="${a}"`;else {let l=Mt(a??"");l!==null&&(i+=` w:tblpX="${Xr(Math.round(l*20),-wo,wo)}"`);}let s=Mt(t.get("mso-table-top")??"");return s!==null&&(i+=` w:tblpY="${Xr(Math.round(s*20),-wo,wo)}"`),`<w:tblpPr${i}/>`}function XS(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,i=Array.from({length:t},()=>r),a=new Array(t).fill(null);for(let d of e){let u=Array.from({length:t},()=>r),f=0,m=0,g=a.map(h=>h?h.span:null);for(let h=0;h<t;h+=1){let v=a[h];v&&(v.remaining-=1,v.remaining<=0&&(a[h]=null));}let b=Array.from(d.children).filter(h=>/^t[dh]$/.test(Qe(h))),y=0;for(;m<t;){let h=g[m];if(h!==null){m+=h;continue}let v=b[y];if(v===void 0)break;y+=1;let x=Math.min(CN(v),t-m);for(let C=m+1;C<m+x;C+=1)if(g[C]!==null){x=C-m;break}let k=ci(v,"rowspan",1e3);k>1&&(a[m]={remaining:k-1,span:x});let R=VS(v);if(R!==null){let C=Xr(Math.round(R*20/x),1,wo);for(let P=0;P<x;P+=1)u[m+P]=C;f+=x;}m+=x;}f>o&&(o=f,i=u);}let s=i.reduce((d,u)=>d+u,0);if(s<=0)return i;let l=i.map(d=>Math.max(1,Math.round(d*n/s))),c=n-l.reduce((d,u)=>d+u,0);return l[l.length-1]=Math.max(1,l[l.length-1]+c),l}function om(e,t,n){let r=0;for(let o=0;o<n;o+=1)r+=e[t+o]??0;return Math.max(1,r)}var YS=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),QS=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function JS(e){return Xr(Math.round(e*8),2,96)}function br(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of jp(e)){let i=YS.get(o.toLowerCase());if(i!==void 0){t=i;continue}let a=QS.get(o.toLowerCase())??Mt(o);if(a!==null){n=a;continue}let s=vo(o);if(s!==null){r=s;continue}return}if(t!==void 0){if(t==="nil")return {val:t,size:0,color:r??"auto"};if(n===void 0)return {val:t,size:4,color:r??"000000"};if(!(n<=0))return {val:t,size:JS(n),color:r??"000000"}}}function yd(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=YS.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],i=o===void 0||o.length>64?null:QS.get(o.toLowerCase())??Mt(o);if(i!==null&&i<=0)return;let a=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=a===void 0||a.length>64?null:vo(a);return {val:r,size:i===null?4:JS(i),color:s??"000000"}}function ek(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function tk(e,t=false){let n=vt(e),o=br(n.get("mso-border-alt"))??br(n.get("border"))??yd(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),i=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],a="";for(let[s,l]of i){let c=Zn(l,t),d=br(n.get(`mso-border-${c}-alt`))??br(n.get(`mso-border-${c}`))??br(n.get(`border-${c}`))??yd(n,`border-${c}`)??o;d!==void 0&&(a+=ek(s,d));}return a.length>0?`<w:tblBorders>${a}</w:tblBorders>`:""}function nk(e){let t=vt(e),n=Mt(t.get("height")??"");if(n===null||n<=0)return "";let r=Xr(Math.round(n*20),1,wo),i=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${i}"/></w:trPr>`}function ON(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let i=r.trim().split(/\s+/).map(a=>Mt(a));if(i.length>=1&&i.length<=4&&!i.some(a=>a===null||a<0)){let[a,s=a,l=a,c=s]=i.length===2?[i[0],i[1],i[0],i[1]]:i.length===3?[i[0],i[1],i[2],i[1]]:i;n.top=a??null,n.right=s??null,n.bottom=l??null,n.left=c??null;}}for(let i of ["top","right","bottom","left"]){let a=Mt(e.get(`padding-${i}`)??"");a!==null&&a>=0&&(n[i]=a);}let o="";for(let i of ["top","left","bottom","right"]){let a=Zn(i,t),s=n[a];s!==null&&(o+=`<w:${i} w:w="${Xr(Math.round(s*20),0,wo)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function rk(e,t=false){let n=vt(e),r=br(n.get("mso-border-alt"))??br(n.get("border"))??yd(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let c=Zn(l,t),d=br(n.get(`mso-border-${c}-alt`))??br(n.get(`mso-border-${c}`))??br(n.get(`border-${c}`))??yd(n,`border-${c}`)??r;d!==void 0&&(o+=ek(l,d));}let i=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",a=fd(n);a&&(i+=`<w:shd w:val="clear" w:color="auto" w:fill="${a}"/>`),i+=ON(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?i+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?i+='<w:vAlign w:val="center"/>':s==="bottom"&&(i+='<w:vAlign w:val="bottom"/>'),i}var MN=9360;function ok(e,t,n,r,o,i){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let P of Array.from(e.children))Qe(P)==="caption"&&i(Array.from(P.childNodes),t+1,n,r,o,true);let a=US(e);if(a.length===0)return;let s=1,l=r.nodesLeft,c=[];for(let P of a){if(l<=0||s>=63)break;let E=c.map(A=>A?A.span:null);for(let A=0;A<c.length;A+=1){let $=c[A];$&&($.remaining-=1,$.remaining<=0&&(c[A]=null));}let w=Array.from(P.children).filter(A=>/^t[dh]$/.test(Qe(A))),S=0,F=0;for(;F<63&&(l-=1,!(l<=0));){let A=F<E.length?E[F]:null;if(A!=null){F+=A;continue}let $=w[S];if($===void 0)break;S+=1;let W=Math.min(ci($,"colspan",63),63-F);for(let _=F+1;_<F+W;_+=1)if(_<E.length&&E[_]!=null){W=_-F;break}let U=ci($,"rowspan",1e3);if(U>1){for(;c.length<=F;)c.push(null);c[F]={remaining:U-1,span:W};}F+=W;}for(let A=F;A<E.length&&A<63;A+=1){let $=E[A];$!=null&&(F=Math.max(F,A+$));}s=Math.max(s,F);}s=Math.min(Math.max(s,1),63);let d=zS(e,MN),u=d.twips,f=a.length>r.nodesLeft?a.slice(0,Math.max(1,r.nodesLeft)):a,m=XS(f,s,u),b=(vt(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",y=tk(e,b),h=ZS(e),v=GS(e)??(b?"left":void 0),x=v===void 0?"":`<w:jc w:val="${Zn(v,b)}"/>`,k=m.map(P=>`<w:gridCol w:w="${P}"/>`).join(""),R=new Array(s).fill(null),C=[];for(let P of a){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let E=R.map(W=>W?W.span:null);for(let W=0;W<s;W+=1){let U=R[W];U&&(U.remaining-=1,U.remaining<=0&&(R[W]=null));}let w=Array.from(P.children).filter(W=>/^t[dh]$/.test(Qe(W))),S=0,F=[],A=0,$=true;for(;A<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,$=false;break}let W=E[A];if(W!==null){let Z=W>1?`<w:gridSpan w:val="${W}"/>`:"";F.push(`<w:tc><w:tcPr><w:tcW w:w="${om(m,A,W)}" w:type="dxa"/>${Z}<w:vMerge/></w:tcPr><w:p/></w:tc>`),A+=W;continue}let U=w[S];if(U===void 0){F.push(`<w:tc><w:tcPr><w:tcW w:w="${m[A]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),A+=1;continue}S+=1;let _=Math.min(ci(U,"colspan",63),s-A);for(let Z=A+1;Z<A+_;Z+=1)if(E[Z]!==null){_=Z-A;break}let L=ci(U,"rowspan",1e3);L>1&&(R[A]={remaining:L-1,span:_}),F.push(AN(U,_,om(m,A,_),L>1,t,n,r,i,b)),A+=_;}if(!$)break;C.push(`<w:tr>${nk(P)}${F.join("")}</w:tr>`);}C.length!==0&&(o.push(`<w:tbl><w:tblPr>${b?"<w:bidiVisual/>":""}${h}${d.xml}${x}${y}</w:tblPr><w:tblGrid>${k}</w:tblGrid>${C.join("")}</w:tbl>`),r.lastMarkCovered=false);}function AN(e,t,n,r,o,i,a,s,l){let c=Qe(e)==="th",d=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(d+=`<w:gridSpan w:val="${t}"/>`),r&&(d+='<w:vMerge w:val="restart"/>'),d+=rk(e,l);let u={run:c?{...i.run,bold:true}:i.run,para:c?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...i.noteBody?{noteBody:i.noteBody}:{},...i.rels?{rels:i.rels}:{}},f=[];return s(Array.from(e.childNodes),o+2,u,a,f,true),(f.length===0||f[f.length-1].endsWith("</w:tbl>"))&&f.push("<w:p/>"),`<w:tc><w:tcPr>${d}</w:tcPr>${f.join("")}</w:tc>`}function ik(e){if(e===void 0)return "";let t=e.trim();return /^\d{1,4}$/.test(t)?"<w:tab/>".repeat(Math.min(Number.parseInt(t,10),64)):""}function ak(e){let t=e.getAttribute("alignment")?.trim().toLowerCase(),n=e.getAttribute("relativeto")?.trim().toLowerCase(),r=e.getAttribute("leader")?.trim().toLowerCase();return t!=="left"&&t!=="center"&&t!=="right"||n!=="margin"&&n!=="indent"||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middledot"?"":`<w:ptab w:alignment="${t}" w:relativeTo="${n}" w:leader="${r==="middledot"?"middleDot":r}"/>`}function sk(e){if(Qe(e)!=="br")return false;let t=vt(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function lk(e){if(sk(e))return true;if(Qe(e)!=="span"||e.childNodes.length>8)return false;let t=false;for(let n=0;n<e.childNodes.length;n+=1){let r=e.childNodes[n];if(!(r.nodeType===3&&(r.nodeValue??"").trim().length===0)){if(r.nodeType!==1||t||!sk(r))return false;t=true;}}return t}function ck(e){if(Qe(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let i=e.childNodes[o];if(i.nodeType===3){if((i.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(i.nodeType!==1||t!==null)return false;t=i;}if(t===null)return false;let n=vt(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(Qe(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let i=t.childNodes[o];if(i.nodeType!==3)return false;r+=i.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function im(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var am=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),sm=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),lm=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),FN=new Set([...sm,...lm,"table","ol","ul","w:sdt"]);function cm(e){for(let t=0;t<e.children.length;t+=1)if(FN.has(Qe(e.children[t])))return true;return false}var LN=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function dk(e){if(Qe(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let i=0;i<o.children.length&&n<64;i+=1){let a=o.children[i];n+=1;let s=Qe(a);if(LN.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(a);}}return null}var DN=4*1024*1024,NN=1e5,HN=64,_N=2*1024*1024,uk="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function dm(e,t,n,r,o=e.rels){let i=`rId${o.length+1}`;return o.push({id:i,type:t,target:n,external:r}),i}function bd(e,t,n,r,o){if(o.nodesLeft<=0){o.truncated=true;return}if(t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let b=e.nodeValue??"";if(n.pre){let h=b.replace(/\r\n?/g,`
4
+ `).split(`
5
+ `);for(let v=0;v<h.length;v+=1){if(v>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${yr(n.run)}<w:br/></w:r>`);}let x=h[v];x.length>0&&r.push(md(x,n.run));}return}let y=b.replace(/[ \t\r\n\f\v]+/g," ");if(y.length===0||y===" "&&Jp(r))return;r.push(md(y,n.run));return}if(!la(e))return;let i=o.equations.get(e);if(i!==void 0){for(let b of i)r.push(b);return}let a=Qe(e);if(am.has(a))return;let s=vt(e);if(pd(e)&&n.para.numPr!==void 0||s.get("mso-element")?.trim().toLowerCase()==="comment-reference"||s.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let b=ak(e);b.length>0&&r.push(`<w:r>${yr(n.run)}${b}</w:r>`);return}let c=ik(s.get("mso-tab-count"));if(c.length>0){if(o.nodesLeft-=c.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let b=Vp(js(n.run,a),s);if(r.push(`<w:r>${yr(b)}${c}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let b=s.get("page-break-before")?.trim().toLowerCase()==="always"||s.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${yr(n.run)}${b?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){aS(e,r,o,b=>dm(o,`${uk}/image`,b,false,n.rels??o.rels));return}let d=js(n.run,a),u=a==="a"?e.getAttribute("href"):null,f=a==="a"?zp(s):null;f===null&&hS(u)&&(d={...d,rStyle:"Hyperlink"});let m=ii(d,e),g={...n,run:m,pre:n.pre||a==="pre"};if(f!==null){let b={...g.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===f.kind&&n.noteBody.id===f.id){let y=f.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${yr(b)}<w:${y}/></w:r>`);return}if(o.definedNotes[f.kind].has(f.id)){let y=f.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${yr(b)}<w:${y} w:id="${f.id}"/></w:r>`);let h=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),v=`${f.kind}:${f.id}`;if(h.length>0&&!o.noteMarkFallbacks.has(v)&&o.noteMarkFallbacks.set(v,md(h,b)),n.noteBody===void 0)o.bodyNoteRefs[f.kind].add(f.id);else {let x=`${n.noteBody.kind}:${n.noteBody.id}`,k=o.noteNoteRefs.get(x)??[];k.push({kind:f.kind,id:f.id}),o.noteNoteRefs.set(x,k);}return}for(let y of Array.from(e.childNodes))bd(y,t+1,g,r,o);return}if(a==="a"){let b=e.getAttribute("href"),y=Gn(e.getAttribute("name")||e.getAttribute("id")),h=[];for(let k of Array.from(e.childNodes))bd(k,t+1,g,h,o);let v=b?.startsWith("#")?Gn(b.slice(1)):null,x=h.join("");if(v!==null)x=`<w:hyperlink w:anchor="${chunkWO4V6PNS_cjs.S(v)}">${x}</w:hyperlink>`;else if(b!==null&&!b.startsWith("#")){let k=chunkWO4V6PNS_cjs.Q(b);k.ok&&k.href.length>0&&(x=`<w:hyperlink r:id="${dm(o,`${uk}/hyperlink`,k.href,true,n.rels??o.rels)}">${x}</w:hyperlink>`);}if(y!==null){let k=String(o.nextBookmarkId++);x=`<w:bookmarkStart w:id="${k}" w:name="${chunkWO4V6PNS_cjs.S(y)}"/>${x}<w:bookmarkEnd w:id="${k}"/>`;}x.length>0&&r.push(x);return}for(let b of Array.from(e.childNodes))bd(b,t+1,g,r,o);}function fk(e,t,n,r){let o=Qe(e),i=vt(e),a={};r&&(a.pageBreakBefore=true);let s=Jw(e,n.wordHtml);s!==void 0&&(a.styleId=s),t.para.numPr&&(a.numPr=t.para.numPr),t.para.jc&&(a.jc=t.para.jc),t.para.bidi&&(a.bidi=true);let l={...t.run},c=ES[o];c!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=c);let d=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let u=IS(e,i,n,t.noteBody);return u&&(a.numPr=u),rS(a,e,n.classAlignments),oS(a,i),l=ii(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(a.bidi=true),{run:l,para:a,paragraphMarkCovered:a.styleId!==void 0||a.numPr!==void 0,pre:d,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function pk(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let a=fk(e,n,r,i);So(Array.from(e.childNodes),t+1,a,r,o,true,void 0,false);}function mk(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let a=mS(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:Zp(r,`sem:${r.semanticListCount}`,a,Up(e)),level:0};if(n.list){let d=r.listsByNumId.get(s.numId);d!==void 0&&!d.levels.has(s.level)&&d.levels.set(s.level,{kind:a,start:Up(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},c=i;for(let d of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!la(d))continue;let u=Qe(d);if(u==="li")r.nodesLeft-=1,pk(d,t+1,l,r,o,c),c=false;else if(u==="ol"||u==="ul"){let f=o.length;mk(d,t+1,{...n,list:s},r,o,c),o.length>f&&(c=false);}}}function So(e,t,n,r,o,i=false,a,s=true){if(t>r.maxDepth)return;let l=o.length,c=a===void 0,d=[],u=[],f=n.para,m=a??{pending:false,skipSpacer:false},g=()=>({...f,pageBreakBefore:void 0,numPr:void 0}),b=()=>{if(d.length===0)return;if(!d.some(h=>h.includes("<w:r")||rm(h))){if(o.length===l){u=u.concat(d),d=[];return}let h=o[o.length-1];h?.endsWith("</w:p>")?(o[o.length-1]=`${h.slice(0,-6)}${d.join("")}</w:p>`,d=[]):h!==void 0&&d.length>0&&(o.push(ai(g(),d)),d=[],r.lastMarkCovered=false);return}let y=m.pending?{...f,pageBreakBefore:true}:f;o.push(ai(y,d)),f.pageBreakBefore&&(f={...f,pageBreakBefore:void 0}),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,d=[];};for(let y of e){if(r.nodesLeft<=0){r.truncated=true;break}if(la(y)){let h=Qe(y),v=h==="w:sdt"?dk(y):null;if(s&&lk(y)){b(),r.nodesLeft-=1,m.pending&&gd(o),m.pending=true,m.skipSpacer=true;continue}if(am.has(h)&&!r.equations.has(y)){r.nodesLeft-=1;continue}let x=vt(y);if(x.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(SS(x)){b(),r.nodesLeft-=1,So(Array.from(y.childNodes),t+1,n,r,o,false,m,s);continue}if(r.definedNoteElements.has(y)){r.nodesLeft-=1;continue}if(sm.has(h)){if(b(),r.nodesLeft-=1,m.pending&&m.skipSpacer&&ck(y)){m.skipSpacer=false;continue}if(h==="div"&&cm(y)){let R=fk(y,n,r,false);R.para.pageBreakBefore&&(m.pending=true),So(Array.from(y.childNodes),t+1,R,r,o,false,m,s);continue}let k=o.length;pk(y,t,n,r,o,m.pending),o.length>k&&(m.pending=false,m.skipSpacer=false);continue}if(h==="ol"||h==="ul"){b();let k=o.length;mk(y,t,n,r,o,m.pending),o.length>k&&(m.pending=false,m.skipSpacer=false);continue}if(h==="table"){b(),m.pending&&gd(o),BN(y,t,n,r,o),m.pending=false,m.skipSpacer=false;continue}if(lm.has(h)||v!==null||h==="span"&&cm(y)){b(),r.nodesLeft-=1,So(v??Array.from(y.childNodes),t+1,n,r,o,false,m,s);continue}}if(y.nodeType===3&&/^[\s\u00a0]+$/.test(y.nodeValue??"")&&Jp(d)){r.nodesLeft-=1;continue}bd(y,t,n,d,r);}if(i&&o.length===l&&d.length>0&&!d.some(y=>y.includes("<w:r")||rm(y))&&(o.push(ai(f,d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered),b(),u.length>0){let y=o[l];y!==void 0&&y.startsWith("<w:p>")?o[l]=y.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${u.join("")}`):y!==void 0?o.splice(l,0,ai(g(),u)):d=u.concat(d),u=[];}d.length>0&&(o.push(ai(g(),d)),d=[],r.lastMarkCovered=false),c&&m.pending&&(gd(o),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=false),i&&o.length===l&&(o.push(ai(f,d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered);}function BN(e,t,n,r,o){ok(e,t,n,r,o,So);}function $N(e,t){return PS({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function qN(e,t){let n=t.maxHtmlBytes??DN;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let i=t.maxNodes??NN,a=BS(e)?jS(r,i):null,s=xS(r),l={footnote:new Set,endnote:new Set},c=new Set,d={footnote:new Set,endnote:new Set};wS(r,s,d);let u={nodesLeft:i-(a?.visited??0),maxDepth:t.maxDepth??HN,maxImageBytes:t.maxImageBytes??_N,wordHtml:Qw(e),truncated:false,lastMarkCovered:false,rels:[],media:new Map,mediaExtensions:new Map,mediaBySrc:new Map,lists:new Map,listsByNumId:new Map,semanticListCount:0,imageCount:0,docPrId:0,nextBookmarkId:1,classAlignments:tS(r),listDefinitions:dS(nS(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:l,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:c,equations:a?.byElement??new Map},f={};f=ii(f,r.documentElement),f=ii(f,o);let m={run:f,para:f.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},g=[];for(let x of s)d[x.kind].has(x.id)&&(l[x.kind].has(x.id)||(l[x.kind].add(x.id),c.add(x.element),g.push(x)));g.sort((x,k)=>im(k.element)-im(x.element)),u.lastMarkCovered=false;let b=[];So(Array.from(o.childNodes),0,m,u,b);let y=u.lastMarkCovered,h=u.truncated,v=false;for(let x=0;x<g.length;x+=1){let k=g[x];u.truncated=false;let R=u.nodesLeft,C=[];if(So(Array.from(k.element.childNodes),0,{...m,noteBody:{kind:k.kind,id:k.id},rels:u.noteRels[k.kind]},u,C,true),u.truncated||C.length===0){v=true;let P=new Set;for(let E=x;E<g.length;E+=1){let w=g[E];l[w.kind].delete(w.id),c.delete(w.element),u.notes[w.kind].delete(w.id),u.bodyNoteRefs[w.kind].delete(w.id),P.add(`${w.kind}:${w.id}`);}if(P.size>0){for(let E=0;E<b.length;E+=1)b[E]=ca(b[E],P,u.noteMarkFallbacks);for(let E of ["footnote","endnote"])for(let[w,S]of u.notes[E])u.notes[E].set(w,S.map(F=>ca(F,P,u.noteMarkFallbacks)));}u.nodesLeft=R;for(let E=x;E<g.length&&u.nodesLeft>0;E+=1)So(Array.from(g[E].element.childNodes),0,m,u,b);break}u.notes[k.kind].set(k.id,C);}return u.truncated=h||v,u.lastMarkCovered=y,kS(u,l,b,dm),b.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:u,blocks:b}}var WN=bS();function gk(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return WN(e,n,()=>qN(e,t))}function hk(e,t={}){let n=gk(e,t);return n.ok?{ok:true,fragmentBytes:$N(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function yk(e,t={}){let n=gk(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var KN={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function bk(e){return e.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,n)=>{if(n.startsWith("#")){let r=n.startsWith("#x")?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return !Number.isFinite(r)||r<0||r>1114111||r>=55296&&r<=57343?t:String.fromCodePoint(r)}return KN[n.toLowerCase()]??t})}var jN=new Set(["script","style","title","template"]),VN=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),UN=new Set(["td","th"]),vk=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),zN=e=>vk(e)||e!==void 0&&e>="0"&&e<="9",xk=e=>e===" "||e===" "||e===`
6
+ `||e==="\r"||e==="\f";function GN(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!vk(e[n]))return null;let o=n;for(;n<e.length&&zN(e[n]);)n+=1;let i=e.slice(o,n).toLowerCase(),a="",s=false;for(;n<e.length;){let l=e[n];if(a!=="")l===a&&(a="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))a=l,s=false;else {if(l===">")return {name:i,closing:r,end:n+1};xk(l)||(s=false);}n+=1;}return {name:i,closing:r,end:e.length}}function ZN(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===9;)t-=1;return t===e.length?e:e.slice(0,t)}function XN(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let i=o+2;if(e.slice(i,i+t.length).toLowerCase()===t){for(i+=t.length;i<e.length&&xk(e[i]);)i+=1;if(e[i]===">")return i+1}r=o+2;}return e.length}function*wk(e){let t=0;for(;t<e.length;){let n=e.indexOf("<",t);if(n===-1){yield e.slice(t);break}if(n>t&&(yield e.slice(t,n)),e.startsWith("<!--",n)){if(e[n+4]===">"){t=n+5;continue}if(e[n+4]==="-"&&e[n+5]===">"){t=n+6;continue}let o=e.indexOf("-->",n+4);t=o===-1?e.length:o+3;continue}if(e[n+1]==="!"||e[n+1]==="?"){let o=e.indexOf(">",n+1);t=o===-1?e.length:o+1;continue}let r=GN(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&jN.has(r.name)?t=XN(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
7
+ `:r.closing&&UN.has(r.name)?yield " ":r.closing&&VN.has(r.name)&&(yield `
8
+ `);}}function YN(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of wk(t))n+=r;return bk(n).replace(/\r\n?/g,`
9
+ `).split(`
10
+ `).map(ZN).join(`
11
+ `).replace(/\n{3,}/g,`
12
+
13
+ `).trim()}function Sk(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
14
+ `;continue}if(r===13){t+=`
15
+ `,e.charCodeAt(n+1)===10&&(n+=1);continue}if(r===9||r===10){t+=e[n];continue}if(!(r<32||r===65534||r===65535)){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}var kk=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function Ik(e){return kk.test(e)}function um(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of wk(t)){let r=n.includes("&")?bk(n):n;if(kk.test(r))return true}return false}function fm(e){if(!e)return "";let t=e.getData("text/plain");if(t.length>0)return t;let n=e.getData("text/html");return n.length>0?YN(n):""}function pm(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function QN(e){if(!e)return false;if(Ik(pm(e,"text/plain")))return true;let t=pm(e,"text/html");if(t.length===0)return false;if(um(t))return true;let n=sa(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:yk(t).imageCount>0}function JN(e){return e?um(pm(e,"text/html")):false}var eH="popup,width=1000,height=900",Rk=["class","style","data-theme","data-color-mode","dir","lang"];async function tH(e={}){let t=globalThis.window;if(!t?.open)return null;let n=e.url??"about:blank",r=t.open(n,e.name??"docx-editor",e.features??eH);if(!r)return null;n!=="about:blank"&&await nH(r);let o=r.document;e.title&&(o.title=e.title),o.body.style.margin="0";let i=o.createElement("div");i.style.height="100vh",o.body.append(i);let a=e.styles??true,s=a===false?()=>{}:a===true?Tk(t.document,o):a(t.document,o),l=new Set,c=false,d=()=>{if(!c){c=true,r.removeEventListener("pagehide",d),t.removeEventListener("pagehide",u),s();for(let f of [...l])try{f();}catch(m){console.error(m);}l.clear();}},u=()=>{d(),r.close();};return r.addEventListener("pagehide",d),t.addEventListener("pagehide",u),{window:r,element:i,onClose(f){return l.add(f),()=>l.delete(f)},close:u}}function nH(e){return new Promise(t=>{let n=false,r=()=>{n||(n=true,t());};e.addEventListener("load",r,{once:true});try{e.document.readyState==="complete"&&e.location.href!=="about:blank"&&r();}catch{}})}function Tk(e,t){let n=new Map,r=b=>{if(n.has(b))return;let y=t.importNode(b,true),h=b.sheet;b.localName==="style"&&h&&!(b.textContent??"").trim()&&(y.textContent=mm(h)),t.head.append(y),n.set(b,y);},o=b=>b.nodeType===1&&(b.localName==="style"||b.localName==="link"&&(b.getAttribute("rel")??"").split(/\s+/).includes("stylesheet"));for(let b of Array.from(e.querySelectorAll('link[rel~="stylesheet"], style')))r(b);let i=t.createElement("style");i.dataset.docxAdopted="",t.head.append(i);let a="",s=()=>{let b=e.adoptedStyleSheets??[],y=b.map(h=>Pk(h)).join(",");y!==a&&(a=y,i.textContent=b.map(mm).join(`
16
+ `));};s();let l=()=>{for(let b of Rk){let y=e.documentElement.getAttribute(b);y===null?t.documentElement.removeAttribute(b):t.documentElement.setAttribute(b,y);}};l();let c=new Map,d=()=>{for(let[b,y]of n){let h=b.sheet;if(b.localName!=="style"||!h)continue;let v=Pk(h);if(c.get(b)===v)continue;let x=!c.has(b);c.set(b,v),x||(y.textContent=mm(h));}s();};d();let u=t.defaultView?.setInterval(d,rH),f=()=>{u!==void 0&&t.defaultView?.clearInterval(u);},m=e.defaultView?.MutationObserver;if(typeof m!="function")return f;let g=new m(b=>{for(let y of b){if(y.type==="attributes"){l();continue}for(let v of Array.from(y.addedNodes))if(o(v))r(v);else if(v.nodeType===1)for(let x of Array.from(v.querySelectorAll("style, link")))o(x)&&r(x);for(let v of Array.from(y.removedNodes)){let x=n.get(v);x&&(n.delete(v),x.parentNode?.removeChild(x));}let h=y.target;if(y.type==="characterData"||h.localName==="style"&&n.has(h)){let v=y.type==="characterData"?y.target.parentNode:h,x=v&&n.get(v);x&&(x.textContent=v.textContent);}}});return g.observe(e.head,{childList:true,subtree:true,characterData:true}),g.observe(e.documentElement,{attributes:true,attributeFilter:Rk}),()=>{g.disconnect(),f();}}var rH=250;function Pk(e){try{return e.cssRules.length}catch{return -1}}function mm(e){try{return Array.from(e.cssRules,t=>t.cssText).join(`
17
+ `)}catch{return ""}}function Gs(e){if(e){if(e.nodeType===9)return e;if(e.ownerDocument)return e.ownerDocument}return globalThis.document}function Ze(e){return Gs(e)?.defaultView??globalThis}var Ek=new WeakMap;function Ck(e,t){Ek.set(e,t);}function oH(e){return Yr(e)}function Yr(e){return Ek.get(e)?.()??null}function Ok(e){let t=e.ownerDocument?.defaultView;return t?t.closed?"attach() needs an element in an open window; this window has closed":null:"attach() needs an element in a document with a window; this one has none"}function iH(e){return Gs(Yr(e))}function aH(e){return Ze(Yr(e))}function _t(e){return typeof e=="object"&&e!==null&&e.nodeType===1}function vr(e){return _t(e)&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function sH(e){return typeof e=="object"&&e!==null&&e.nodeType===3}function ko(e){return typeof e=="object"&&e!==null&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function vd(e,t){return vr(e)&&e.localName===t}function gm(){return globalThis}function ut(e){let t=0,n=new Map,r=new Map;function o(f,m){f.win=m,f.native=f.kind==="frame"&&typeof m.requestAnimationFrame=="function"?m.requestAnimationFrame(f.fire):m.setTimeout(()=>f.fire(m.performance?.now()??Date.now()),Math.max(0,f.dueAt-Date.now())),a(m);}function i(f){f.kind==="frame"&&typeof f.win.cancelAnimationFrame=="function"?f.win.cancelAnimationFrame(f.native):f.win.clearTimeout(f.native);}function a(f){if(r.has(f)||f===gm())return;let m=()=>{s(f);let g=Ze(e()),b=g===f?gm():g;for(let y of n.values())y.win===f&&(i(y),o(y,b));};f.addEventListener("pagehide",m),r.set(f,m);}function s(f){let m=r.get(f);m&&(r.delete(f),f.removeEventListener("pagehide",m));}function l(f){let m=n.get(f);if(m){n.delete(f);for(let g of n.values())if(g.win===m.win)return;s(m.win);}}function c(){if(n.size===0)return;let f=Ze(e());for(let m of n.values()){if(m.win===f)continue;let g=m.win;i(m),o(m,f);let b=false;for(let y of n.values())y.win===g&&(b=true);b||s(g);}}function d(f,m,g=0){c();let b=++t,y={kind:f,win:gm(),native:0,dueAt:Date.now()+g,fire:h=>{l(b),m(h);}};return n.set(b,y),o(y,Ze(e())),b}function u(f){if(f==null)return;let m=n.get(f);m&&(i(m),l(f));}return {setTimeout:(f,m)=>d("timeout",()=>f(),m),clearTimeout:u,requestAnimationFrame:f=>d("frame",f),cancelAnimationFrame:u,migrate:c}}function Zs(e){return typeof e.key=="string"&&"repeat"in e}function hm(e){return typeof e.pointerId=="number"}function lH(e){return typeof e.button=="number"&&"clientX"in e}function ym(e){return typeof e.inputType=="string"}var cH=Object.freeze({kind:"body"});function Ce(e,t){let n=t?.indexOf("#")??-1;if(n===-1)return null;let r=t.slice(0,n);return r.length===0?null:e.currentPackage().parts.get(r)??null}function Bt(e,t,n){let r=t?.indexOf("#")??-1;return bm(e,r===-1?"":t.slice(0,r),n)}function bm(e,t,n){if(t.length===0||t===e.part().name)return {kind:"body"};for(let r of e.headerFooterResolutionBySection())for(let o of [r.headers,r.footers])for(let i of o.values())if(i.partName===t)return {kind:"headerFooter",rId:i.rId};for(let r of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:r})?.name===t)return {kind:"notesPart",noteKind:r};return n}function xd(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunkWO4V6PNS_cjs.pc(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function Ak(e,t){return e?e.scope:t||cH}function dH(e,t,n){if(n){let o=[];for(let i of [e.footnotes,e.endnotes])if(i)for(let a of i.notes)a.scopeId===n&&o.push(...Mk(a.fragments));return o}if(!t)return chunkDBOOTED4_cjs.za(e);let r=da(e,t);return r?Mk(r.fragments):[]}function da(e,t){let n=t.kind==="header"?e.header:e.footer;if(n&&(n.rId&&n.rId===t.scope.rId||!n.rId&&n.partName===t.partName))return n}function Fk(e,t){for(let n of e.pages)for(let r of ["header","footer"]){let o=n[r];if(o?.rId===t)return {pageIndex:n.index,kind:r,story:o}}return null}function wd(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function vm(e,t,n){let r=chunkDBOOTED4_cjs._d(e,t.y),o=e.pages[r];if(!o)return false;let i=t.x-n(r),a=t.y,s=o.contentBox;return i>=s.x&&i<s.x+s.width&&a>=s.y&&a<s.y+s.height}function xm(e,t,n,r,o={}){return chunkDBOOTED4_cjs.ce(e,t,n.fragments,r,o)}function uH(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=da(r,t);return o?chunkDBOOTED4_cjs.pe(e,t.pageIndex,o.fragments,n):null}function fH(e,t,n){let r=[];for(let o of e.pages)for(let i of [o.footnotes,o.endnotes]){let a=i?.notes.find(s=>s.scopeId===t);a&&r.push(...chunkDBOOTED4_cjs.pe(e,o.index,a.fragments,n));}return r.length>0?r:null}function Lk(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function Dk(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let i of r){if(i.dataset.docxNoteScope!==t||!i.matches("[data-docx-note]"))continue;o??=i;let a=Number(i.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&a===n)return i}return o}function Nk(e,t,n){if((i=>{let a=e.pages[i];return !!a&&!!da(a,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let i of e.pages)if(da(i,t)&&(o===null&&(o=i.index),n===void 0||n.has(i.index)))return i.index;return o??t.pageIndex}function Hk(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function _k(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function wm(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Sm(e,t,n,r,o,i,a,s){let l=o?uH(e,o,a):i?fH(e,i,a):null,c=chunkDBOOTED4_cjs.ue(e,t,n,r,{...a?{measurer:a}:{},...l?{stops:l}:{},...s!==void 0?{lineId:s}:{}});if(!c)return null;let u=(l?.find(m=>m.position.paragraphId===c.position.paragraphId&&m.position.offset===c.position.offset&&(c.lineId===void 0||m.lineId===c.lineId))??l?.find(m=>m.position.paragraphId===c.position.paragraphId&&m.position.offset===c.position.offset))?.pageIndex,f=c.lineId===void 0?null:chunkDBOOTED4_cjs.qe(e,c.position,{...a?{measurer:a}:{},...u!==void 0?{preferredPageIndex:u}:{},preferredLineId:c.lineId});return {position:c.position,desiredX:c.desiredX,...u!==void 0?{pageIndex:u}:{},...f?{caret:f}:{}}}function Sd(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of [r.footnotes,r.endnotes])if(i)for(let a of i.notes){let s=a.box,l=s.x+o,c=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=c&&t.y<c+s.height)return {pageIndex:r.index,scopeId:a.scopeId,noteKind:a.noteKind,noteId:a.noteId,local:{x:t.x-l,y:t.y-c},fragments:a.fragments}}}return null}function Bk(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let c=o.y,d=r.y,u=n?Math.max(d,n.box.y+n.box.height):d,f=n?Math.min(c,n.box.y):c;return u<=f?null:{x:r.x,y:f,width:r.width,height:u-f}}let i=r.y+r.height,a=o.y+o.height,s=n?Math.min(i,n.box.y):i,l=n?Math.max(a,n.box.y+n.box.height):a;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function km(e,t,n){for(let r of e.pages){if(r.parityBlank)continue;let o=n(r.index);for(let i of ["header","footer"]){if(r[i])continue;let a=Bk(r,i);if(!a)continue;let s=a.x+o;if(t.x>=s&&t.x<s+a.width&&t.y>=a.y&&t.y<a.y+a.height)return {pageIndex:r.index,kind:i}}}return null}function Im(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of ["header","footer"]){let a=r[i];if(!a)continue;let s=a.box,l=Bk(r,i)??s,c=l.x+o,d=l.y;if(t.x>=c&&t.x<c+l.width&&t.y>=d&&t.y<d+l.height)return {pageIndex:r.index,kind:i,story:a,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function $k(e,t,n,r,o,i){let a=e.pages[t.pageIndex];if(!a)return false;let s=a.contentBox,l=n.x-r(a.index)-s.x,c=n.y-s.y;if(l<0||l>=s.width||c<0||c>=s.height)return false;let d=i?{measurer:i}:{},{story:u,local:f}=t,m=chunkDBOOTED4_cjs.ae(u.anchoredDrawings,f,a.index)!==null||chunkDBOOTED4_cjs.ce(e,a.index,u.fragments,f,d)?.onGlyphs===true;if(o&&m)return false;let g=chunkDBOOTED4_cjs.be(e,a.index,{x:l,y:c},d),b=Sd(e,n,r),y=g?.onGlyphs===true&&g.pageIndex===a.index||b?.pageIndex===a.index&&chunkDBOOTED4_cjs.ce(e,a.index,b.fragments,b.local,d)?.onGlyphs===true;return o?y:y||!m}function ua(e,t,n){if(!t&&!n)return chunkDBOOTED4_cjs.Ta(e);let r=new Set,o=[];for(let i of e.pages)for(let a of dH(i,t,n)){for(let s of a.lines)for(let l of chunkDBOOTED4_cjs.Oa(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));a.lines.length===0&&!r.has(a.paragraphId)&&(r.add(a.paragraphId),o.push(a.paragraphId));}return o}function kd(e,t,n,r){let o=ua(e,n,r);if(o.length===0)return t;let i=new Set(o),a=s=>i.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:a(t.anchor),head:a(t.head)}}function Mk(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let i of o.rows)if(!i.isHeaderRepeat)for(let a of i.cells)n(a.blocks);}};return n(e),t}function qk(e,t){for(let n of e.pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of chunkDBOOTED4_cjs.Aa(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function Wk(e){return e.family.trim().length===0?"font family must not be empty":!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3?"font weight must be an integer from 1 through 1000":e.style!=="normal"&&e.style!=="italic"?"font style must be normal or italic":null}function pH(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function mH(e,t){if(!e)return null;try{let n=await e.match(t);return n?new Uint8Array(await n.arrayBuffer()):null}catch{return null}}async function gH(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function hH(e,t){if(e)try{await e.delete(t);}catch{}}async function Rm(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??chunkDBOOTED4_cjs.a,o=await pH(e.cacheName??"docx-editor-fonts");t();async function i(c){t();let d=Object.freeze({family:c.family,weight:c.weight,style:c.style}),u=Wk(d);if(u)return {failure:{url:c.url,request:d,reason:"invalidRequest",diagnostic:u}};let f=(h,v)=>{if(h.byteLength===0)return {url:c.url,request:d,reason:"emptyResponse"};if(h.byteLength>r)return {url:c.url,request:d,reason:"overLimit"};let x=chunkDBOOTED4_cjs.l(h,c.faceIndex??0);if(!x.valid)return {url:c.url,request:d,reason:"malformed",diagnostic:x.diagnostic};let k=chunkWO4V6PNS_cjs.f(h);return c.hash!==void 0&&c.hash!==k?{url:c.url,request:d,reason:"hashMismatch",expectedHash:c.hash,actualHash:k,...v?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:d,id:`url:${c.url}`,bytes:h,hash:k,faceIndex:c.faceIndex??0}},m=await mH(o,c.url);if(t(),m){let h=f(m,true);if(!("reason"in h))return {source:h};await hH(o,c.url),t();}let g;try{g=e.signal?await n(c.url,{signal:e.signal}):await n(c.url),t();}catch(h){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:h instanceof Error?h.message:String(h)}}}if(!g.ok)return {failure:{url:c.url,request:d,reason:"httpError",status:g.status}};let b;try{b=new Uint8Array(await g.arrayBuffer()),t();}catch(h){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:h instanceof Error?h.message:String(h)}}}let y=f(b,false);return "reason"in y?{failure:y}:(await gH(o,c.url,b),t(),{source:y})}let a=await Promise.all(e.sources.map(c=>i(c)));t();let s=[],l=[];for(let c of a)"source"in c?s.push(c.source):l.push(c.failure);return {sources:s,failures:l}}function yH(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,i=Wk(r);if(i)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:i}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunkDBOOTED4_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let a=t.faceIndex??0,s=chunkDBOOTED4_cjs.l(e,a);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunkWO4V6PNS_cjs.f(e),faceIndex:a}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var bH=e=>e.trim().toLowerCase(),Kk=e=>JSON.stringify([bH(e.family),e.weight,e.style]);function vH(e){return chunkMOYYRVFV_cjs.j(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(Kk)),r=e.sources.filter(s=>!n.has(Kk(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...i}=e,a=await Rm({...i,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of a.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return a})}var xH=96,jk=37.79527559055118;function wH(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let a=Math.floor(e/12);for(let s=0;s<=a;s+=1){let l=s*12;if(s%8===0){let c=s/8;n.push({position:l,height:10,...c>0?{label:String(c)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=jk/10,o=Math.floor(e/r);for(let i=0;i<=o;i+=1){let a=i*r;if(i%10===0){let s=i/10;n.push({position:a,height:10,...s>0?{label:String(s)}:{}});}else i%5===0?n.push({position:a,height:6}):n.push({position:a,height:3});}return n}function SH(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var kH=1440,IH=567,RH=180,PH=56.7,Vk=e=>({pageWidth:e.pageWidth,leftMargin:e.rightMargin,rightMargin:e.leftMargin}),Id=(e,t,n)=>n<t||e<t?t:e>n?n:e;function Uk(e,t,n){if(t.rtl)return n.pageWidth-Uk(e,{...t,rtl:false},Vk(n));switch(e){case "firstLine":return n.leftMargin+t.left+t.firstLine;case "hanging":case "left":return n.leftMargin+t.left;case "right":return n.pageWidth-n.rightMargin-t.right}}function zk(e,t,n){if(n)return Math.round(e);let r=t==="cm"?56.7:180;return Math.round(Math.round(e/r)*r)}function Gk(e,t,n,r,o={}){if(n.rtl)return {...Gk(e,r.pageWidth-t,{...n,rtl:false},Vk(r),o),rtl:true};let i=zk(t,o.unit??"inch",o.precise??false),a=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=Id(i,0,a);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),c=a-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:Id(i-r.leftMargin,l,c)}}case "hanging":{let l=Id(i-r.leftMargin,-r.leftMargin,a-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=Id(i,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function Zk(e,t){let n=e.snapshot().formatting;if(n)switch(t){case "text.color":return n.color?.kind==="hex"?n.color.value.replace(/^#/,""):void 0;case "text.highlight":return n.highlight;case "styles.style":return n.styleId;case "font.family":return n.fontFamily;case "font.size":return n.fontSizePt===void 0?void 0:String(n.fontSizePt*2);case "list.lineSpacing":return n.lineSpacing?.rule==="multiple"?String(n.lineSpacing.value):void 0;default:return}}function TH(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var Xk="no formatting has been copied",Rd="there is nothing at the selection to copy",Pm="the selection has nothing to paint",Pd=Object.freeze({mode:"off",level:"none"});function Yk(e,t){let n=Math.round(t*12700),r=1143e3,o=`<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p><w:r>
18
+ <w:drawing xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
19
+ <wp:anchor distT="0" distB="0" distL="91440" distR="91440" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
20
+ <wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>
21
+ <wp:extent cx="${n}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:wrapNone/><wp:docPr id="${e}" name="Text Box ${e}"/><wp:cNvGraphicFramePr/>
22
+ <a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"/><wps:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${n}" cy="${r}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill><a:ln w="12700"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln></wps:spPr><wps:txbx><w:txbxContent><w:p/></w:txbxContent></wps:txbx><wps:bodyPr lIns="91440" rIns="91440" tIns="45720" bIns="45720" anchor="t"><a:noAutofit/></wps:bodyPr></wps:wsp></a:graphicData></a:graphic>
23
+ </wp:anchor></w:drawing></w:r></w:p></w:body></w:document>`,i=chunkWO4V6PNS_cjs.Ia(o,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!i.ok)throw new Error("Cannot build textbox drawing");let a=l=>{if(l.kind==="drawing")return l;if(l.kind==="textValue")return null;for(let c of l.children){let d=a(c);if(d)return d}return null},s=a(i.part.root);if(!s)throw new Error("Textbox drawing is missing");return s}function Tm(e){let t=e.activeScope();if(e.editingMode()!=="edit"||t.kind!=="body"&&t.kind!=="frame")return {ok:false,code:"unsupported",reason:"Textboxes can only be inserted in body editing mode"};let n=t.kind==="frame"?t.hostParagraphId:e.state().selection.head.paragraphId;return e.layout().pages.some(r=>r.fragments.some(o=>o.kind==="paragraph"&&o.paragraphId===n))?null:{ok:false,code:"unsupported",reason:"Select a body paragraph outside a table to insert a textbox"}}function Qk(e){let t=Tm(e);if(t)return t;let n=e.activeScope(),r=n.kind==="frame"?n.hostParagraphId:e.state().selection.head.paragraphId,o=e.session.part(),i=chunkWO4V6PNS_cjs.Ta(o,r);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:"Textbox anchor is missing"};let a=chunkWO4V6PNS_cjs.re(e.session.currentPackage(),e.collaborationSession()?.identity.actorId);if(!a.ok)return {ok:false,code:"invalidArgs",reason:"Cannot allocate textbox identity"};let s=new Set(chunkWO4V6PNS_cjs.wi(o).map(m=>m.root.id)),l=e.layout().pages.flatMap(m=>m.fragments).find(m=>m.kind==="paragraph"&&m.paragraphId===r),c=Math.min(300,l?.box.width??300);n.kind==="frame"&&e.setActiveScope({kind:"body"});let d=chunkWO4V6PNS_cjs.og(i);e.setSelection({anchor:{paragraphId:r,offset:d},head:{paragraphId:r,offset:d}});let u=e.applyDrawingOps([{op:"insertDrawing",paragraphId:r,offset:d,drawing:Yk(a.id,c)}]);if(u.rejected)return {ok:false,code:"invalidArgs",reason:u.reason??"Textbox insertion was refused"};let f=chunkWO4V6PNS_cjs.wi(e.session.part()).find(m=>!s.has(m.root.id));return f&&e.setActiveScope({kind:"frame",id:f.root.id,drawingNodeId:f.drawingNodeId,hostParagraphId:f.hostParagraphId}),e.focus(),{ok:true,changed:u.committed}}var Em=new WeakMap;function Qr(e){let t=Em.get(e);if(t)return t;let n=chunkWO4V6PNS_cjs.Uf(e);if(n.length===0)return Em.set(e,[]),[];let r=[];for(let o of n){let i=chunkWO4V6PNS_cjs.Tf(o);for(let a of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=chunkWO4V6PNS_cjs.Ta(e,a);if(s?.kind!=="paragraph")continue;let l=chunkWO4V6PNS_cjs.mg(s),c=a===o.beginParagraphId,d=a===o.endParagraphId;r.push({toc:o,paragraphId:a,length:l.length,startsHere:c,endsHere:d,start:c?l.spanOf(o.beginNodeId)?.start??0:0,end:d&&i?l.spanOf(i.endNodeId)?.end??l.length:l.length});}}return Em.set(e,r),r}function Td(e){return new Set(Qr(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function Cm(e,t){return e.endsHere&&!e.startsHere&&e.end===0||e.startsHere&&e.start>0&&t<=e.start||e.endsHere&&e.end<e.length&&t>=e.end?false:t>=e.start&&t<=e.end}function Mn(e,t){return Qr(e).find(n=>n.paragraphId===t.paragraphId&&Cm(n,t.offset))?.toc}function Jk(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),i=Math.max(n.offset,r.offset);return Qr(e).some(a=>a.paragraphId===n.paragraphId&&(o===i?Cm(a,o):o<a.end&&i>a.start))}return Mn(e,n)!==void 0||Mn(e,r)!==void 0}function eI(e,t){let n=Qr(e);if(n.length===0)return false;let r=chunkWO4V6PNS_cjs.Hk(t);if(r.kind==="nodes")return r.targets.some(a=>n.some(s=>{if(a.nodeId!==s.paragraphId)return false;if(a.range){let{start:l,end:c}=a.range;return l===c?Cm(s,l):l<s.end&&c>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:a.removes||a.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(a=>a.paragraphId)),i=(a,s="")=>typeof a=="string"?/(?:Id|Ids)$/.test(s)&&o.has(a):Array.isArray(a)?a.some(l=>i(l,s)):!!a&&typeof a=="object"&&Object.entries(a).some(([l,c])=>i(c,l));return i(t)}function tI(e,t,n){let r=Mn(e,t);if(!r)return null;let o=Qr(e).find(i=>i.toc.id===r.id&&(n?i.startsHere&&i.start>0:i.endsHere&&i.end<i.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function nI(e,t){return !Qr(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function rI(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return Qr(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:Td(e).has(t)))?.toc}function oI(e,t){return chunkWO4V6PNS_cjs.Uf(e).some(n=>n.beginParagraphId===t||n.endParagraphId===t||n.resultParagraphIds.includes(t))}var Xs=/^[0-9A-Fa-f]{6}$/,iI={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folhlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedhyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"},EH={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"};function Om(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function Ed(e){return Math.max(0,Math.min(1,e))}function aI(e){let t=e.replace(/^#/,"").padStart(6,"0").slice(0,6);return {r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0}}function sI(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function lI(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-Ed(t))*255)))/255,o=aI(e);return sI(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function cI(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(Ed(t)*255)))/255,o=aI(e);return sI(r*o.r,r*o.g,r*o.b)}function Mm(e){return iI[e]??iI[e.toLowerCase()]??null}function CH(e,t){let n=Mm(e);if(!n)return null;let r=t.find(i=>i.slot===n)?.hex;if(r&&Xs.test(r))return r.toUpperCase();let o=EH[n];return o&&Xs.test(o)?o.toUpperCase():null}function Cd(e,t){let n=CH(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!Om(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!Om(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=lI(r,Ed(e.tint)):e.shade!==void 0&&(r=cI(r,Ed(e.shade))),{ok:true,hex:r}}var OH="000000";function Am(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return Xs.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"border colour requires a six-digit hex value"}}if(e.kind==="auto")return {ok:true,color:{kind:"auto",resolvedHex:OH}};let n=Cd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Mm(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function Fm(e,t){if(e.kind==="auto")return {ok:false,reason:"automatic fill cannot be written without a resolved colour"};if(e.kind==="hex"){let o=e.value.toUpperCase();return Xs.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=Cd(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Mm(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function MH(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return Xs.test(o)?`#${o}`:`#${n}`}let r=Cd(e,t);return `#${r.ok?r.hex:n}`}function Lm(e,t){return chunkDBOOTED4_cjs.Se(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function dI(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var DH=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function Io(e){return DH.has(e.type)}function be(e,t){return {ok:false,code:e,reason:t}}function Dm(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return be("invalidArgs","the table target is no longer valid");case "table-has-merge":return be("unsupported","this table has merged cells");case "row-hides-cell":return be("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return be("unsupported","the table must keep at least one row or column");case "resource-limit":return be("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return be("invalidArgs","the table command arguments are invalid");default:return be("unsupported",`the table operation was refused (${e})`)}}function Jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kn(e,t){return !Jt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function mI(e){if(!Jt(e))return false;let t=e.kind;if(t==="hex")return kn(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return kn(e,["kind"]);if(t==="theme"){if(typeof e.slot!="string")return false;let n=["kind","slot"];if(e.tint!==void 0){if(typeof e.tint!="number"||!Number.isFinite(e.tint))return false;n.push("tint");}if(e.shade!==void 0){if(typeof e.shade!="number"||!Number.isFinite(e.shade))return false;n.push("shade");}return kn(e,n)}return false}function gI(e){return Jt(e)&&kn(e,["sourceRevision","tableId","rowId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.rowId=="string"&&e.rowId.length>0&&typeof e.isHeaderRepeat=="boolean"}function hI(e){return Jt(e)&&kn(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.gridColumnId=="string"&&e.gridColumnId.length>0&&typeof e.isHeaderRepeat=="boolean"}function NH(e){return Jt(e)&&kn(e,["sourceRevision","tableId","leftGridColumnId","rightGridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.leftGridColumnId=="string"&&typeof e.rightGridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function HH(e){return Jt(e)&&kn(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.gridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function _H(e){return !Jt(e)||!kn(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&mI(e.color)}function uI(e){return !("target"in e)||e.target===void 0||gI(e.target)}function fI(e){return !("target"in e)||e.target===void 0||hI(e.target)}function BH(e){switch(e.type){case "insertRow":return !Jt(e)||e.type!=="insertRow"?be("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?be("invalidArgs","insertRow where must be above or below"):uI(e)?null:be("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !Jt(e)||e.type!=="deleteRow"?be("invalidArgs","deleteRow command shape is invalid"):uI(e)?null:be("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !Jt(e)||e.type!=="insertColumn"?be("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?be("invalidArgs","insertColumn where must be left or right"):fI(e)?null:be("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !Jt(e)||e.type!=="deleteColumn"?be("invalidArgs","deleteColumn command shape is invalid"):fI(e)?null:be("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !Jt(e)||!kn(e,["type"])?be("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !Jt(e)||!kn(e,["type","color"])?be("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!mI(e.color)?be("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !Jt(e)||!kn(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?be("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !Jt(e)||e.type!=="setTableBorders"?be("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?be("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!_H(e.spec)?be("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !Jt(e)||!kn(e,["type","target","leftWidthTwips","rightWidthTwips"])||!NH(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?be("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !Jt(e)||!kn(e,["type","target","columnWidthTwips","tableWidthTwips"])||!HH(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?be("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function $H(e){return !("target"in e)||e.target===void 0?null:gI(e.target)?e.target:null}function qH(e){return !("target"in e)||e.target===void 0?null:hI(e.target)?e.target:null}function WH(e,t){let n=chunkWO4V6PNS_cjs.oj(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(i=>i.cells.some(a=>r.has(a.id))).map(i=>i.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function KH(e,t){let n=chunkWO4V6PNS_cjs.oj(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let i of n.topology.rows){let a=0;for(let s of i.cells){let l=yI(s);if(r.has(s.id))for(let c=0;c<l;c+=1){let d=n.topology.gridColumns[a+c];d&&o.add(d.id);}a+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function pI(e,t,n){let r=chunkWO4V6PNS_cjs.oj(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function jH(e){let t=chunk5JPIEN54_cjs.qa(e.layout,e.selection.head.paragraphId,e.cellSelection);return t?{tableId:t.tableId,rowId:t.rowId,cellId:t.cellId,cellIds:[...t.cellIds],gridColumnIndex:t.gridColumnIndex,isHeaderRepeat:t.isHeaderRepeat}:null}function yI(e){let t=chunkWO4V6PNS_cjs.lj(e,"tcPr"),n=t&&chunkWO4V6PNS_cjs.lj(t,"gridSpan"),r=n&&chunkWO4V6PNS_cjs.mj(n,"val");if(!r||!/^\d{1,7}$/.test(r))return 1;let o=Number(r);return Number.isInteger(o)&&o>1?Math.min(o,1024):1}function VH(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:i}of e.rows){let a=0;for(let s of i){let l=yI(s);if(r>=a&&r<a+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};a+=l;}}return null}function UH(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkWO4V6PNS_cjs.oj(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(a=>a.row.id===t.rowId);if(r===-1)return null;let i=n.topology.rows[r].cells[0];return i?{tableId:t.tableId,rowId:t.rowId,cellId:i.id,cellIds:[i.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function zH(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkWO4V6PNS_cjs.oj(e.part.root,t.tableId);return n.ok?VH(n.topology,t.tableId,t.gridColumnId):null}function GH(e,t){for(let n of t){let r=chunkWO4V6PNS_cjs.ol(e,n);if(r)return Dm(r)}return null}function Sn(e,t,n){let r=GH(e,t);return r||{ok:true,ops:t,selection:n}}function ZH(e,t){if(!chunkWO4V6PNS_cjs.Wk.includes(e.style))return {ok:false,reason:"border style is not allowlisted"};if(!Number.isInteger(e.size)||e.size<1)return {ok:false,reason:"border size is out of range"};if(e.size>96)return {ok:false,reason:"border size is out of range"};let n=Am(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function Ys(e,t,n){return n!==e.storeRevision?be("invalidArgs","the table target is stale"):chunkWO4V6PNS_cjs.oj(e.part.root,t).ok?null:be("invalidArgs","the table target is no longer valid")}function XH(e){return e?.isHeaderRepeat?be("unsupported","repeated header rows cannot be edited"):null}function YH(e,t,n,r){let o=Ys(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return be("invalidArgs","column widths must be whole twips");if(n<300||r<300)return be("invalidArgs","column widths are below the minimum");let i=chunkWO4V6PNS_cjs.oj(e.part.root,t.tableId);if(!i.ok){let u=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return Dm(u)}let a=i.topology.gridColumns.find(u=>u.id===t.leftGridColumnId),s=i.topology.gridColumns.find(u=>u.id===t.rightGridColumnId);if(!a||!s)return be("invalidArgs","the table target is no longer valid");let l=i.topology.gridColumns.indexOf(a),c=i.topology.gridColumns.indexOf(s);if(Math.abs(c-l)!==1)return be("invalidArgs","the column divider target is not adjacent");let d={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<c?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<c?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<c?n:r,rightWidthTwips:l<c?r:n};return Sn(e.part,[d],{kind:"preserveSelection"})}function QH(e,t,n,r){let o=Ys(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return be("invalidArgs","column widths must be whole twips");if(n<300)return be("invalidArgs","column widths are below the minimum");let i=chunkWO4V6PNS_cjs.oj(e.part.root,t.tableId);if(!i.ok){let l=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return Dm(l)}let a=i.topology.gridColumns[i.topology.gridColumns.length-1];if(!a||a.id!==t.gridColumnId)return be("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return Sn(e.part,[s],{kind:"preserveSelection"})}function bI(e,t,n){if(e.viewing||!e.editable)return be("locked","the document is open for viewing");let r=Ys(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return be("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return Sn(e.part,[o],{kind:"preserveSelection"})}function Jr(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return be("locked","the document is open for viewing");switch(t.type){case "mergeCells":return be("unsupported","cell merge is not supported yet");case "splitCell":return be("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return be("unsupported",`command '${t.type}' is not supported by the tree editor`);}let i=BH(t);if(i)return i;let a=$H(t),s=qH(t),l=XH(a??s);if(l)return l;if(a){let d=Ys(e,a.tableId,a.sourceRevision);if(d)return d}if(s){let d=Ys(e,s.tableId,s.sourceRevision);if(d)return d}let c=a!==null?UH(e,a):s!==null?zH(e,s):jH(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!c)return a||s?be("invalidArgs","the table target is no longer valid"):be("unsupported","the selection is not inside a table");if(c?.isHeaderRepeat)return be("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!c)return be("unsupported","the selection is not inside a table");let d={op:"insertTableRow",tableId:c.tableId,rowId:c.rowId,where:t.where};return Sn(n,[d],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!c)return be("unsupported","the selection is not inside a table");let d=WH(n,c),u=d.wholeTable?[{op:"deleteBlock",blockId:c.tableId}]:d.rowIds.map(f=>({op:"deleteTableRow",tableId:c.tableId,rowId:f,...f===c.rowId?{referenceCellId:c.cellId}:{}}));return Sn(n,u,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!c)return be("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=s?.gridColumnId??pI(n,d,c.gridColumnIndex),f=Lm(e.layout,d)?t.where==="left"?"right":"left":t.where,m=u?{op:"insertTableColumn",tableId:d,where:f,gridColumnId:u}:{op:"insertTableColumn",tableId:d,where:f,referenceCellId:c.cellId};return Sn(n,[m],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!c)return be("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=s?.gridColumnId??pI(n,d,c.gridColumnIndex);if(!u)return be("invalidArgs","the table has no grid column to delete");let f=s?.gridColumnId===void 0?KH(n,c):{gridColumnIds:[u],wholeTable:false};if(f.wholeTable)return Sn(n,[{op:"deleteBlock",blockId:d}],{kind:"adoptCommittedCaret"});let g=(f.gridColumnIds.length>0?f.gridColumnIds:[u]).map(b=>({op:"deleteTableColumn",tableId:d,gridColumnId:b}));return Sn(n,g,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!c)return be("unsupported","the selection is not inside a table");let d={op:"deleteBlock",blockId:c.tableId};return Sn(n,[d],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!c)return be("unsupported","the selection is not inside a table");let d;if(t.color===null)d=null;else {let f=Fm(t.color,e.themeColors);if(!f.ok)return be("invalidArgs",f.reason);d=f.color;}let u={op:"setTableCellFill",tableId:c.tableId,cellIds:c.cellIds,color:d};return Sn(n,[u],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!c)return be("unsupported","the selection is not inside a table");let d={op:"setTableCellVerticalAlignment",tableId:c.tableId,cellIds:c.cellIds,alignment:t.alignment};return Sn(n,[d],{kind:"preserveSelection"})}case "setTableBorders":{if(!c)return be("unsupported","the selection is not inside a table");if(t.scope==="none"){let f={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:"none",target:dI(t.target,Lm(e.layout,c.tableId))};return Sn(n,[f],{kind:"preserveSelection"})}let d=ZH(t.spec,e.themeColors);if(!d.ok)return be("invalidArgs",d.reason);let u={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:dI(t.scope,Lm(e.layout,c.tableId)),spec:d.spec};return Sn(n,[u],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return YH(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return QH(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return be("unsupported",`command '${t.type}' is not a table command`)}}function vI(e){if(!Io(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "mergeCells":return {supported:false,reason:"cell merge is not supported yet"};case "splitCell":return {supported:false,reason:"cell split is not supported yet"};case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}var Od="Calibri",Nm=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),JH=4e3,fa=e=>Math.max(1,Math.min(JH,e));function e2(e,t,n,r){let o={...chunkDBOOTED4_cjs.ba,fontFamily:t.fontFamily,bold:t.bold,italic:t.italic,fontSizePt:t.size??100},i=r?.measure(e,o)??NaN,a=r?.lineMetrics(o).height??NaN;if(i>0||(i=.55*o.fontSizePt*Array.from(e).length),a>0||(a=1.22*o.fontSizePt),t.size!==null)return {width:fa(i),height:fa(a)};let s=a/i,l=Math.min(n.width,n.height),c=t.diagonal?l*Math.SQRT2/(1+s):n.width;return {width:fa(c),height:fa(c*s)}}function t2(e,t,n){let r=chunkWO4V6PNS_cjs.fe(e);if(!Nm.has(r))return null;let o=chunkWO4V6PNS_cjs.ke(e,r);if(!o)return null;let i=o.pixelWidth*72/(o.dpiX&&o.dpiX>0?o.dpiX:96),a=o.pixelHeight*72/(o.dpiY&&o.dpiY>0?o.dpiY:96);if(!(i>0)||!(a>0))return null;let s=t??Math.min(n.width/i,n.height/a);return {width:fa(i*s),height:fa(a*s)}}function Qs(e,t,n){if(e.imageData)return t2(e.imageData,e.scale??null,t);let r=e.text??"";return r===""?null:e2(r,{fontFamily:e.fontFamily?.trim()||Od,bold:e.bold??false,italic:e.italic??false,size:e.fontSizePt??null,diagonal:(e.layout??"diagonal")==="diagonal"},t,n)}var n2="C0C0C0",r2=.5,o2=/^[^"';{}<>\\\u0000-\u001f]{1,64}$/u;function Md(e){if(!e)return null;let t=chunkWO4V6PNS_cjs.Sg(e.session.currentPackage());return t?t.kind==="picture"?Object.freeze({kind:"image",washout:t.washout}):Object.freeze({kind:"text",text:t.text,fontFamily:t.fontFamily,fontSizePt:t.fontSizePt,bold:t.bold,italic:t.italic,color:t.colorHex,transparency:Math.round((1-t.opacity)*1e3)/1e3,layout:t.diagonal?"diagonal":"horizontal"}):null}function wI(e){let t=Md(e);if(!t||!e)return null;if(t.kind==="text"){let{kind:i,...a}=t;return Object.freeze(a)}let n=e.session.currentPackage(),r=chunkWO4V6PNS_cjs.Sg(n),o=r?.kind==="picture"&&r.mediaPartName?n.partBytes.get(r.mediaPartName):void 0;return Object.freeze({washout:t.washout??false,scale:null,...o?{imageData:o}:{}})}var Hm=(e,t,n)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n;function _m(e){if(e===null)return null;if(typeof e!="object"||e===void 0)return "watermark must be an object or null";let t=e,n=t.text!==void 0,r=t.imageData!==void 0;if(n===r)return "set exactly one of text and imageData";if(n){if(typeof t.text!="string"||!t.text.trim())return "text must be a non-empty string";if(t.text.length>chunkWO4V6PNS_cjs.od)return `text is longer than ${chunkWO4V6PNS_cjs.od}`;if(/[\r\n\v\f\u2028\u2029]/u.test(t.text))return "text must be one line";if(/[\u0000-\u0008\u000e-\u001f]/u.test(t.text))return "text holds a control character";if(t.fontFamily!==void 0&&(typeof t.fontFamily!="string"||!o2.test(t.fontFamily.trim())))return "fontFamily is not a font name";if(t.fontSizePt!==void 0&&t.fontSizePt!==null&&!Hm(t.fontSizePt,1,1e3))return "fontSizePt must be from 1 to 1000";if(t.color!==void 0&&(typeof t.color!="string"||!/^[0-9a-f]{6}$/iu.test(t.color)))return "color must be RRGGBB";if(t.transparency!==void 0&&!Hm(t.transparency,0,1))return "transparency must be from 0 to 1";if(t.layout!==void 0&&t.layout!=="diagonal"&&t.layout!=="horizontal")return "layout must be 'diagonal' or 'horizontal'";for(let i of ["bold","italic"])if(t[i]!==void 0&&typeof t[i]!="boolean")return `${i} must be a boolean`;return t.scale!==void 0||t.washout!==void 0?"scale and washout apply to a picture watermark":null}if(!(t.imageData instanceof Uint8Array))return "imageData must be a Uint8Array";let o=chunkWO4V6PNS_cjs.fe(t.imageData);if(!Nm.has(o))return "imageData is not a PNG, JPEG, GIF, BMP or WebP picture";if(!chunkWO4V6PNS_cjs.se(t.imageData,o))return "imageData is not a readable picture";if(t.scale!==void 0&&t.scale!==null&&!Hm(t.scale,.01,10))return "scale must be from 0.01 to 10";if(t.washout!==void 0&&typeof t.washout!="boolean")return "washout must be a boolean";for(let i of ["fontFamily","fontSizePt","bold","italic","color","transparency","layout"])if(t[i]!==void 0)return `${i} applies to a text watermark`;return null}function SI(e){let{pageSize:t,margins:n}=e,r=(t.widthTwips-n.leftTwips-n.rightTwips-n.gutterTwips)/20,o=(t.heightTwips-n.topTwips-n.bottomTwips)/20;return {width:Math.max(72,r),height:Math.max(72,o)}}function xI(e,t,n){let r=e.session.currentPackage(),o=r.parts.get(r.mainDocumentPart);if(o)return chunkDBOOTED4_cjs.Qc(o).map(i=>{let a=Qs(t,SI(i.properties),n);return a?{widthPt:a.width,heightPt:a.height}:null})}function i2(e,t){let n=SI(e.sectionPropertiesAt(e.state().selection.head.paragraphId)),r=e.textMeasurer?.();if(t.imageData){let u=chunkWO4V6PNS_cjs.fe(t.imageData),f=Qs(t,n);return f?{kind:"picture",washout:t.washout??true,widthPt:f.width,heightPt:f.height,sectionSizes:xI(e,t,r),image:{bytes:t.imageData,mime:u}}:null}let o=t.text??"",i=t.fontFamily?.trim()||Od,a=t.bold??false,s=t.italic??false,l=(t.layout??"diagonal")==="diagonal",c=t.fontSizePt??null,d=Qs(t,n,r);return {kind:"text",text:o,fontFamily:i,fontSizePt:c,bold:a,italic:s,colorHex:(t.color??n2).toUpperCase(),opacity:1-(t.transparency??r2),diagonal:l,widthPt:d.width,heightPt:d.height,sectionSizes:xI(e,t,r)}}function kI(e,t){let n=_m(t);if(n)return {ok:false,code:"invalidArgs",reason:n};if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"watermarks are not available"};let r=t?i2(e,t):null;if(t&&!r)return {ok:false,code:"invalidArgs",reason:"imageData is not a readable picture"};if(!t&&!chunkWO4V6PNS_cjs.Sg(e.session.currentPackage()))return {ok:true,changed:false};let o={op:"setWatermark",watermark:r},i=e.applyHeaderFooterLifecycle(o);return i.ok?{ok:true,changed:true}:{ok:false,code:i.reason==="locked"?"locked":"invalidArgs",reason:`the watermark was not written: ${i.reason}`}}function Wt(e){if(typeof e!="object"||e===null)return false;let t=e;return typeof t.paraId=="string"&&t.paraId.length>0&&(t.search===void 0||typeof t.search=="string"&&t.search.length>0)&&(t.occurrence===void 0||typeof t.occurrence=="number"&&Number.isInteger(t.occurrence)&&t.occurrence>=1)}function di(e){if(typeof e!="object"||e===null)return false;let t=e;return Wt(t.from)&&Wt(t.to)}function II(e,t,n){let r=[],o=e.indexOf(t);for(;o>=0&&r.length<n;)r.push(o),o=e.indexOf(t,o+1);return r}function In(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let i=chunkWO4V6PNS_cjs.hj(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:i.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=II(i,n.search,n.occurrence),l=s[n.occurrence-1];return l===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:l,end:l+n.search.length}}}let a=II(i,n.search,2);return a.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:a.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:a[0],end:a[0]+n.search.length}}}function RI(e,t,n){if("anchor"in n){let s=In(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let l={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:l,head:l}}}let{from:r,to:o}=n.range;if(!Wt(r)||!Wt(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let i=In(e,t,r);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:r};let a=In(e,t,o);return a.ok?{ok:true,selection:{anchor:{paragraphId:i.span.nodeId,offset:i.span.start},head:{paragraphId:a.span.nodeId,offset:a.span.end}}}:{ok:false,code:a.code,reason:a.reason,target:o}}function PI(e){let t=e.match;return typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0?"match must carry a blockId and offsets":typeof e.text!="string"?"replaceMatch requires text":/[\r\n\v\f\u2028\u2029]/.test(e.text)?"replaceMatch requires text without a paragraph mark":null}function Bm(e,t){let n=t.scope??{kind:"body"},r=e.activeScope();return (n.kind==="body"?r.kind==="body":n.kind==="headerFooter"?r.kind==="headerFooter"&&r.rId===n.rId:n.kind==="note"?r.kind==="note"&&r.id===n.id:false)?null:{ok:false,code:"unsupported",reason:n.kind==="frame"?"replaceMatch does not replace text in a text box":"replaceMatch replaces text only in the open story"}}function TI(e,t){let n=Bm(e,t.match);if(n)return n;let{blockId:r,start:o,length:i}=t.match;return e.replaceTextInPlace(r,o,o+i,t.text)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"replaceMatch was refused"}}var a2=["alignment","direction","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function s2(e,t){return e===t?true:!e||!t?false:a2.every(n=>e[n]===t[n])}function $m(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.direction!==t.direction||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.indent?.rtl!==t.indent?.rtl||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!s2(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((i,a)=>i.positionTwips!==t.tabStops?.[a]?.positionTwips||i.alignment!==t.tabStops?.[a]?.alignment||(i.leader??"none")!==(t.tabStops?.[a]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let i of o)if(n[i]!==r[i])return false;return true}function qm(e,t){return e.current===t.current&&e.total===t.total}function Wm(e,t){return e===t?true:!e||!t?false:e.pageWidthTwips===t.pageWidthTwips&&e.pageHeightTwips===t.pageHeightTwips&&e.orientation===t.orientation&&e.marginsTwips.top===t.marginsTwips.top&&e.marginsTwips.right===t.marginsTwips.right&&e.marginsTwips.bottom===t.marginsTwips.bottom&&e.marginsTwips.left===t.marginsTwips.left&&e.gutterTwips===t.gutterTwips}function EI(e,t){if(e===t)return true;if(!e||!t)return false;let n=e,r=t;return n.paraId===r.paraId&&n.search===r.search&&n.occurrence===r.occurrence}function Km(e,t){return e===t?true:!e||!t||!di(e)||!di(t)?false:EI(e.from,t.from)&&EI(e.to,t.to)}function jm(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var l2={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",openFailure:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",reviewPane:"compared",showParagraphMarks:"compared",showBookmarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",revisionMarkup:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},c2=Object.keys(l2);function Vm(e,t){return c2.every(n=>e[n]===t[n])}function Ad(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)Ad(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))Ad(t[n]);return Object.freeze(e)}var Um=new Map([["bold",{localName:"b"}],["italic",{localName:"i"}],["underline",{localName:"u",attributes:{val:"single"}}],["strike",{localName:"strike"}],["superscript",{localName:"vertAlign",attributes:{val:"superscript"}}],["subscript",{localName:"vertAlign",attributes:{val:"subscript"}}]]),d2=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),u2=/^[0-9A-Fa-f]{6}$/;function zm(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||chunkXSTGE3NI_cjs.a(n)===null?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_,;]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!u2.test(n)?{ok:false,code:"invalidArgs",reason:"color requires a six-digit hex value like FF0000, or 'auto'"}:{ok:true,localName:"color",attributes:{val:n}};case "highlight":return typeof n!="string"||!d2.has(n)?{ok:false,code:"invalidArgs",reason:"highlight requires an ST_HighlightColor name (yellow, cyan, ...)"}:{ok:true,localName:"highlight",attributes:{val:n}};default:return {ok:false,code:"unsupported",reason:`mark '${t}' is not supported by setMarkAttr`}}}function AI(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function Gm(e){return typeof e=="object"&&e!==null&&AI(e.anchor)&&AI(e.head)}function tn(e,t){let n=new Error(t);return n.code=e,n}function Fd(e,t){return e===t?true:!e||!t?false:e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function Zm(e){return e==="blank"?Dp():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function FI(e){return typeof e=="string"?`'${e}' is not a document; pass DOCX bytes, or 'blank' for an empty one`:"a DocumentHandle cannot be re-loaded; pass DOCX bytes"}function ui(e){switch(e.type){case "toggleMark":return Um.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=zm(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "setParagraphDirection":return e.direction==="ltr"||e.direction==="rtl"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"setParagraphDirection requires a direction of 'ltr' or 'rtl'"};case "clearFormatting":return {supported:true,mutating:true};case "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>chunkDBOOTED4_cjs.id))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunkDBOOTED4_cjs.id}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.direction!==void 0&&!["ltr","rtl"].includes(e.direction))return {supported:false,code:"invalidArgs",reason:"unknown direction"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>chunkDBOOTED4_cjs.id)return {supported:false,reason:`indent values must be within \xB1${chunkDBOOTED4_cjs.id} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "replaceMatch":{let t=PI(e);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "editTextFormField":return {supported:true,mutating:false};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "editHeaderFooter":return e.position!=="header"&&e.position!=="footer"?{supported:false,reason:"editHeaderFooter requires position 'header' or 'footer'"}:e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"editHeaderFooter variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "exitHeaderFooter":return {supported:true,mutating:false};case "removeHeaderFooter":case "linkHeaderFooterToPrevious":case "unlinkHeaderFooterFromPrevious":return "variant"in e&&e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"furniture variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "setHeaderFooterOptions":return e.titlePage===void 0&&e.evenAndOddHeaders===void 0&&e.headerDistanceTwips===void 0&&e.footerDistanceTwips===void 0?{supported:false,reason:"setHeaderFooterOptions requires at least one option"}:{supported:true,mutating:true};case "insertPageField":return e.field==="PAGE"||e.field==="NUMPAGES"||e.field==="SECTIONPAGES"||e.field==="PAGE_X_OF_Y"?{supported:true,mutating:true}:{supported:false,reason:"insertPageField field must be 'PAGE', 'NUMPAGES', 'SECTIONPAGES', or 'PAGE_X_OF_Y'"};case "insertNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"insertNote noteKind must be 'footnote' or 'endnote'"};case "deleteNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"deleteNote noteKind must be 'footnote' or 'endnote'"};case "convertNote":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertNote fromKind must be 'footnote' or 'endnote'"};case "convertAllNotes":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertAllNotes fromKind must be 'footnote' or 'endnote'"};case "setNoteProperties":return e.endnote?.position==="pageBottom"?{supported:false,reason:"endnote-pageBottom"}:e.footnote!==void 0||e.endnote!==void 0?{supported:true,mutating:true}:{supported:false,reason:"setNoteProperties requires footnote and/or endnote fields"};case "selectAll":case "copy":return {supported:true,mutating:false};case "cut":return {supported:true,mutating:true};case "paste":case "pasteWithoutFormatting":{if(typeof e.text!="string")return {supported:false,code:"invalidArgs",reason:"paste requires text"};let t=e.type==="paste"?e.html:void 0;return t!==void 0&&typeof t!="string"?{supported:false,code:"invalidArgs",reason:"paste html must be a string"}:e.text===""&&(t===void 0||t==="")?{supported:false,code:"invalidArgs",reason:"there is nothing to paste"}:{supported:true,mutating:true}}case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{let t=vI(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(Gm(e.range)||di(e.range))||"anchor"in e&&Wt(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertTextBox":return {supported:true,mutating:true};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return typeof e.name=="string"&&e.name.length>0?{supported:true,mutating:e.type!=="goToBookmark"}:{supported:false,code:"invalidArgs",reason:`${e.type} needs a name`};case "setWatermark":{let t=_m(e.watermark);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}default:return {supported:false,reason:Xm(e.type)}}}function Xm(e){return `command '${e}' is not supported by the tree editor`}var nn="comments and tracked changes require the pro review module (@docx-editor.dev/pro)",LI="realtime collaboration requires the pro collaboration module (@docx-editor.dev/pro)",xr="suggesting mode needs an author; configure author before enabling it",f2="this document asks for tracked changes, but no author is configured",Ld="this document is protected for filling in forms, which does not track changes",Qm="this document permits editing only as tracked changes",Js="image changes are not supported in suggesting mode",pa="this revision kind has no structural accept/reject yet",fi="this document is protected against editing; open it in Word to change that",pi="this document is protected for comments only",Ym={mode:null,rejection:null};function Jm(e,t){if(e===void 0||e==="view")return Ym;if(e==="edit")return {mode:"editing",rejection:null};let n=eg(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function eg(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:xr}:{ok:false,code:"unsupported",reason:nn}}function DI(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==xr||t||n!==null||(n=globalThis.setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let i=`${xr}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(tn("suggestingNeedsAuthor",i)),r(`[@docx-editor.dev/core] ${i}`);},0));},dispose(){n!==null&&globalThis.clearTimeout(n),n=null;}}}function tg(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?Ym:{mode:"viewing",rejection:fi};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?Ym:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:pi}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Ld}:r:e.viewOnly||t!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?r:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:n,rejection:f2}}function NI(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function ng(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:fi}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:pi}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:Ld}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:Qm}}function HI(e,t,n,r,o,i=false){let a=Jm(e,t),s=e==="view"?"viewing":a.mode??o,l=tg({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:i});l.mode!==null&&(s=l.mode);let c=ng(n,s),d=n.restrictedToReadOnly?"viewing":r;return {mode:c===null?s:d,rejection:l.rejection??c?.reason??null,configurationRejection:a.rejection}}var _I=new WeakMap;function BI(e,t){_I.set(e,t);}var $I=new WeakMap;function qI(e,t){let n=chunkWO4V6PNS_cjs.yj(t);n&&$I.set(e,n);}var rg="this document is protected for tracked changes; their authors cannot change",mi="this document is protected; only form fields can be filled";function Xn(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=chunkWO4V6PNS_cjs.ah(t.session.currentPackage()),r=chunkWO4V6PNS_cjs.Ug(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?pi:fi};if(r.edit==="trackedChanges"&&e.type==="setReviewChangesAuthor")return {ok:false,code:"locked",reason:rg};if(r.edit!=="forms"||Io(e))return null;let o="structure",i,a=false;switch(e.type){case "insertText":o="text",i=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",i=e.text,a=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setParagraphDirection":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "setWatermark":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "setReviewChangesAuthor":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(f=>s.head.paragraphId.startsWith(`${f.name}#`));if(!l)return {ok:false,code:"locked",reason:mi};let c=t.state().cellSelection;return (c&&(o==="runFormat"||o==="paragraph")?[...chunk5JPIEN54_cjs.la(t.layout(),c.cellIds)].map(f=>({anchor:{paragraphId:f,offset:0},head:{paragraphId:f,offset:(chunkWO4V6PNS_cjs.hj(l,f)??"").length}})):[s]).some(f=>chunkWO4V6PNS_cjs.Gj(l,n,{selection:f,intent:o,text:i,paste:a,fieldId:_I.get(t)?.()??void 0,contentLockPolicy:$I.get(t)}))?{ok:false,code:"locked",reason:mi}:null}function WI(e,t){if(e!=="locked")return e;let n=chunkWO4V6PNS_cjs.Ug(t);return n.enforced?n.edit==="comments"?pi:n.edit==="forms"?mi:fi:"this content is locked"}function KI(e){return e!==null&&Xn({type:"resolveAllReviewChanges"},e)!==null}function jI(e,t){return ()=>e()??(t()?null:"the document is read-only")}function VI(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function UI(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function zI(e){return e.widthEmu!==void 0||e.heightEmu!==void 0||e.alt!==void 0||e.title!==void 0||e.description!==void 0||e.hyperlink!==void 0||e.crop!==void 0||e.wrap!==void 0||e.resetToNaturalSize===true||chunkWO4V6PNS_cjs.fl(e)}function GI(e,t){for(let n of e.pages){let r=p2(n.fragments,t);if(r!==void 0)return r}return null}function p2(e,t){for(let n of e)if(n.kind==="paragraph")for(let r of n.lines)for(let o of r.drawings??[]){if(o.drawingNodeId!==t)continue;if(n.fragmentIndex!==0||n.positionedFrame||n.outOfFlow)return null;let i=Math.round(o.x*12700),a=Math.round((o.y-n.box.y)*12700);return !Number.isFinite(i)||!Number.isFinite(a)?null:Object.freeze({mode:"frame",horizontalEmu:i,verticalEmu:a,relativeToH:"margin",relativeToV:"paragraph"})}}var ZI=new WeakMap;function XI(e,t){ZI.set(e,t);}function YI(e,t,n){ZI.get(e)?.(t,n);}function m2(e){return [e.left,e.top,e.right,e.bottom]}function og(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function g2(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function el(e){return Math.round(e*1e3)}function tl(e){return e/1e3}function ig(e){return Object.freeze({left:el(e.left),top:el(e.top),right:el(e.right),bottom:el(e.bottom)})}function h2(e){return Object.freeze({left:tl(e.left),top:tl(e.top),right:tl(e.right),bottom:tl(e.bottom)})}function ag(e){return m2(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var Dd=12700;function Kt(e){return Math.round(e*12700)}function gi(e){return e/12700}function QI(e,t,n,r,o,i){let a=gi(e),s=gi(t),l=a/s,c=n.includes("e")?r:n.includes("w")?-r:0,d=n.includes("s")?o:n.includes("n")?-o:0;if(a=Math.max(1,a+c),s=Math.max(1,s+d),i)if(n.length===2){let f=Math.max(a/gi(e),s/gi(t));a=Math.max(1,gi(e)*f),s=Math.max(1,a/l);}else n==="e"||n==="w"?s=Math.max(1,a/l):a=Math.max(1,s*l);return Object.freeze({cx:Kt(a),cy:Kt(s)})}function Nd(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Kt(t),verticalEmu:(e.verticalEmu??0)+Kt(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Kt(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Kt(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}var y2=new Set(["insertImage","replaceImage"]),b2=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function sg(e,t,n){return e.accessibility.hidden||n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function v2(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&sg(o,n,r))return o;return null}function x2(e,t,n,r){let o=e.layout();for(let i of o.pages){for(let a of i.anchoredDrawings??[])if(a.anchorParagraphId===t&&sg(a,n,r))return a;for(let a of [i.header,i.footer])if(a){for(let s of a.anchoredDrawings??[])if(s.anchorParagraphId===t&&sg(s,n,r))return s}}return null}function eR(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Fn(e){if(!e)return null;let t=e.drawingSelectionIntent();if(t.kind==="none")return null;let{anchor:n,head:r}=e.state().selection;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=chunkDBOOTED4_cjs.yd(e.layout(),n.paragraphId,n.offset),i=t.kind==="pointer"?t.drawingNodeId:null;return v2(o,n.paragraphId,n.offset,i)??x2(e,n.paragraphId,n.offset,i)}function tR(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunkWO4V6PNS_cjs.Ta(r,t.drawingNodeId);return o?o.kind!=="drawing"?chunkWO4V6PNS_cjs.bl(r,t.drawingNodeId):chunkWO4V6PNS_cjs.Pd(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunkWO4V6PNS_cjs.Id,limits:chunkWO4V6PNS_cjs.Hd,resolveRelationship:chunkWO4V6PNS_cjs.Kd(e.session.currentPackage(),t.ownerPartName)}):null}function nR(e){if(e.kind!=="anchored"||!e.position)return null;let t=e.position;return e.anchor?.simplePos?Object.freeze({mode:"simple",horizontalEmu:t.simplePosition.xEmu,verticalEmu:t.simplePosition.yEmu}):Object.freeze({mode:"frame",...t.horizontal.offsetEmu!==null?{horizontalEmu:t.horizontal.offsetEmu}:{},...t.vertical.offsetEmu!==null?{verticalEmu:t.vertical.offsetEmu}:{},relativeToH:t.horizontal.relativeFrom,relativeToV:t.vertical.relativeFrom})}function w2(e){let t=e.resource;return t.kind!=="ready"?null:Object.freeze({pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,dpiX:t.dpiX,dpiY:t.dpiY})}function rR(e){let t=e.locks,n=e.kind==="inline"&&e.textboxStory!==null;return Object.freeze({canResize:!n&&!t.resize&&!e.hidden,canMove:!n&&!t.move&&!e.hidden,canChangeWrap:e.picture!==null&&!t.move&&!e.hidden,canCrop:e.picture!==null&&!t.resize&&!t.changeAspect&&!e.hidden})}function S2(e){return e.kind==="inlineDrawing"?"inline":e.wrap}var oR=e=>e.placeholderGraphicKind===null||!!e.textboxStory;function wr(e){let t=Fn(e);if(!t||!oR(t))return null;let n=e?tR(e,t):null;if(!n||n.hidden||n.locks.select)return null;let r=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:og(t.crop),rotationDegrees:r.rotationDegrees,wrap:S2(t),position:nR(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:w2(t),...rR(n)})}function iR(e,t){return e===t?true:!e||!t?false:e.id===t.id&&e.kind===t.kind&&e.widthEmu===t.widthEmu&&e.heightEmu===t.heightEmu&&e.crop.left===t.crop.left&&e.crop.top===t.crop.top&&e.crop.right===t.crop.right&&e.crop.bottom===t.crop.bottom&&e.rotationDegrees===t.rotationDegrees&&e.wrap===t.wrap&&e.name===t.name&&e.title===t.title&&e.description===t.description&&e.hyperlink===t.hyperlink&&e.hidden===t.hidden&&e.resourceStatus===t.resourceStatus&&e.canResize===t.canResize&&e.canMove===t.canMove&&e.canChangeWrap===t.canChangeWrap&&e.canCrop===t.canCrop&&e.locks.select===t.locks.select&&e.locks.move===t.locks.move&&e.locks.resize===t.locks.resize&&e.locks.changeAspect===t.locks.changeAspect&&(e.position?.mode??"frame")===(t.position?.mode??"frame")&&(e.position?.horizontalEmu??null)===(t.position?.horizontalEmu??null)&&(e.position?.verticalEmu??null)===(t.position?.verticalEmu??null)&&(e.position?.relativeToH??null)===(t.position?.relativeToH??null)&&(e.position?.relativeToV??null)===(t.position?.relativeToV??null)&&(e.intrinsic?.pixelWidth??null)===(t.intrinsic?.pixelWidth??null)&&(e.intrinsic?.pixelHeight??null)===(t.intrinsic?.pixelHeight??null)&&(e.intrinsic?.dpiX??null)===(t.intrinsic?.dpiX??null)&&(e.intrinsic?.dpiY??null)===(t.intrinsic?.dpiY??null)}function lg(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function aR(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function cg(e){return lg(e)!==void 0||aR(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function dg(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=aR(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let i=lg(t),a=wr(r);if(i!==void 0&&(!a||a.id!==i))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return ma(e,n,{requireDrawing:i!==void 0||n.drawingNodeId!==null,drawingNodeId:i??n.drawingNodeId??void 0})}function Ro(e,t){let n=wr(e),r=lg(t);return r?!n||n.id!==r?{ok:false,code:"notFound",reason:"stale drawing selection"}:{id:r}:n?{id:n.id}:{ok:false,code:"notFound",reason:"no drawing is selected"}}function k2(e){return e.rejected?{ok:false,code:"invalidArgs",reason:e.reason==="drawing-locked"?"the drawing is locked":e.reason==="unknown-drawing"?"stale drawing selection":typeof e.reason=="string"?e.reason:"the image change was refused"}:null}function JI(e,t,n){if(n==="inline")return [];let r=GI(e.layout(),t);return r?[{op:"positionDrawing",drawingNodeId:t,position:r}]:[]}function Hd(e,t){return k2(e.applyDrawingOps(t))}function I2(e){if(!e.intrinsic)return null;let t=Math.round(e.intrinsic.pixelWidth*914400/e.intrinsic.dpiX),n=Math.round(e.intrinsic.pixelHeight*914400/e.intrinsic.dpiY);return !Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0?null:{cx:t,cy:n}}function sR(e,t){return t?.position?.mode==="simple"?Object.freeze({mode:"simple",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{}}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function nl(e){return b2.has(e.type)}function R2(e){return y2.has(e.type)}function lR(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function cR(e,t){if(!e)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=e.editingMode();return n==="view"?{ok:false,code:"locked",reason:"the document is open for viewing"}:n==="suggest"&&t==="replaceImage"?{ok:false,code:"invalidArgs",reason:Js}:null}function rl(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=wr(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function ma(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:i}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==i.paragraphId||o.offset!==i.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let a=wr(r),s=n.drawingNodeId??t.drawingNodeId;if(!a||!s||a.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}var ug="a picture is selected; place the caret in text to insert a picture";function ga(e,t){if(!nl(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=Xn(e,t);if(n)return n;if(e.type==="insertImage")return Fn(t)?{ok:false,code:"invalidArgs",reason:ug}:!(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;let r=Fn(t);if(r&&"textboxStory"in r&&r.textboxStory&&(e.type==="replaceImage"||e.type==="transformImage"||e.type==="setImageProperties"&&e.hyperlink!==void 0))return {ok:false,code:"unsupported",reason:"this operation is not supported for textboxes"};if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let s=Ro(t,e);return "ok"in s?s:null}let i=Ro(t,e);if("ok"in i)return i;let a=wr(t);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:Js};switch(e.type){case "deleteImage":return a.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return a.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return a.locks.changeAspect||a.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!UI(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let s=a.position?.mode??"frame";return chunkWO4V6PNS_cjs.hl(e,s)?chunkWO4V6PNS_cjs.cl(sR(e,a))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(VI(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!zI(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!a.intrinsic)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};if(e.widthEmu!==void 0&&(!Number.isFinite(e.widthEmu)||e.widthEmu<=0))return {ok:false,code:"invalidArgs",reason:"widthEmu must be a positive finite number"};if(e.heightEmu!==void 0&&(!Number.isFinite(e.heightEmu)||e.heightEmu<=0))return {ok:false,code:"invalidArgs",reason:"heightEmu must be a positive finite number"};if(e.widthEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!ag(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!a.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunkWO4V6PNS_cjs.Q(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!a.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunkWO4V6PNS_cjs.fl(e)){if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let l=a.position?.mode??"frame";if(!chunkWO4V6PNS_cjs.hl(e,l))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunkWO4V6PNS_cjs.cl(chunkWO4V6PNS_cjs.gl(e,a)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function fg(e,t){let n=cR(t,e.type);if(n)return n;let r=ga(e,t);return r||{ok:true}}function dR(e,t){let n=ga(e,t);return n||lR(e)}function pg(e,t,n){if(R2(t))return lR(t);let r=n&&cg(t)?rl(n):null;if(r&&n){let o=dg(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=Ro(e,t);if("ok"in o)return o;let i=e.deleteImage(o.id);return i.ok?null:{ok:false,code:"invalidArgs",reason:i.detail??i.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=Ro(e,t);return "ok"in o?o:Hd(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target},...JI(e,o.id,t.target)])}case "transformImage":{let o=Ro(e,t);return "ok"in o?o:Hd(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=Ro(e,t);if("ok"in o)return o;let i=wr(e),a=sR(t,i);return Hd(e,[{op:"positionDrawing",drawingNodeId:o.id,position:a}])}case "setImageProperties":{let o=Ro(e,t);if("ok"in o)return o;let i=wr(e);if(!i)return {ok:false,code:"notFound",reason:"no drawing is selected"};let a=[];if(t.resetToNaturalSize){let c=I2(i);if(!c)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:c});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??i.widthEmu,cy:t.heightEmu??i.heightEmu}});t.crop!==void 0&&a.push({op:"cropDrawing",drawingNodeId:o.id,crop:ig(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&a.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??i.title,description:l??i.description}),t.wrap!==void 0&&(a.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),a.push(...JI(e,o.id,t.wrap))),chunkWO4V6PNS_cjs.fl(t)){let c=chunkWO4V6PNS_cjs.gl(t,i);a.push({op:"positionDrawing",drawingNodeId:o.id,position:c});}if(t.hyperlink!==void 0){let c=e.applyImageProperties({drawingNodeId:o.id,ops:a,hyperlink:t.hyperlink});return c.ok?null:{ok:false,code:"invalidArgs",reason:c.detail??c.reason??"setImageProperties was refused"}}return a.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:Hd(e,a)}default:return null}}function P2(e,t,n,r,o){let i=chunkDBOOTED4_cjs.Tc(e.sectionPropertiesAt(t)),a=i.width-i.margin.left-i.margin.right,s=chunkDBOOTED4_cjs.Ic(i),l=i.height-s.top-s.bottom,c=chunkDBOOTED4_cjs.yd(e.layout(),t,n),d=c&&c.box.width>0?Math.min(c.box.width,a):a,u=Math.min(1,d/r,l/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function mg(e,t){let n=await T2(e,t);return YI(e,t,n),n}async function T2(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=cR(n,t.type);if(r)return r;let o=ga(t,n);if(o)return o;let i=rl(e);if(!i)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:u}=n.state().selection,f=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let m=P2(n,u.paragraphId,u.offset,t.widthPoints,t.heightPoints),g=await n.insertImage({paragraphId:u.paragraphId,offset:u.offset,bytes:t.data,mime:t.mime,widthPoints:m.widthPoints,heightPoints:m.heightPoints,expectedPackageRevision:f,commitGuard:()=>ma(e,i)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),b=ma(e,i);return b||(g.ok?{ok:true,changed:g.change!==null}:{ok:false,code:"invalidArgs",reason:g.detail==="stale-package-epoch"?"stale package revision":g.detail??g.reason??"insertImage was refused"})}let a=Ro(n,t);if("ok"in a)return a;let s=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let l=t.mime??"image/png",c=await n.replaceImage(a.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>ma(e,i,{requireDrawing:true,drawingNodeId:a.id})===null}),d=ma(e,i,{requireDrawing:true,drawingNodeId:a.id});return d||(c.ok?{ok:true,changed:c.change!==null}:{ok:false,code:"invalidArgs",reason:c.detail==="stale-package-epoch"?"stale package revision":c.detail??c.reason??"replaceImage was refused"})}var E2=1,C2=10;function O2(e,t){if(!t||t.hidden||t.locks.select||!oR(e))return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=rR(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function M2(e){if(!e)return null;let t=e.activeScope(),{anchor:n,head:r}=e.state().selection;if(t.kind!=="frame"&&(n.paragraphId!==r.paragraphId||n.offset!==r.offset))return null;let o=t.kind==="frame"?chunkDBOOTED4_cjs.ie(e.layout(),t.drawingNodeId)?.record:Fn(e);if(!o||o.accessibility.hidden)return null;let i=e.layout(),a=chunkDBOOTED4_cjs.ie(i,o.drawingNodeId);if(!a)return null;let s=tR(e,o);if(!s||s.locks.select)return null;let l=O2(o,s),d=e.editingMode()==="edit"&&e.session.editable?l:{...l,canResize:false,canMove:false},u=o.kind==="anchoredDrawing"?Object.freeze({x:o.horizontalFrameOrigin,y:o.verticalFrameOrigin}):null;return Object.freeze({id:o.drawingNodeId,textbox:"textboxStory"in o&&!!o.textboxStory,pageIndex:a.pageIndex,x:a.x,y:a.y,width:a.width,height:a.height,kind:o.kind==="inlineDrawing"?"inline":"anchored",widthEmu:s.extentEmu.cx,heightEmu:s.extentEmu.cy,position:nR(s),anchorFrameOrigin:u,transform:o.transform,...d})}function A2(e,t){let n=e.surface;return n?n.publishedLayout().revision!==t.layoutRevision?{ok:false,code:"notFound",reason:"stale layout revision"}:n.session.packageRevision()!==t.packageRevision?{ok:false,code:"notFound",reason:"stale package revision"}:ma(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function gg(e,t){for(let n of [e.footnotes,e.endnotes]){let r=n?.notes.find(o=>chunkDBOOTED4_cjs.Aa(o.fragments).some(i=>i.paragraphId===t));if(r)return r}}function ol(e,t){for(let n of [e.header,e.footer]){if(!n)continue;if(chunkDBOOTED4_cjs.Aa(n.fragments).some(o=>o.paragraphId===t))return n.box}return gg(e,t)?.box??e.contentBox}var F2={empty:"a bookmark needs a name",tooLong:"a bookmark name has at most 40 characters",invalidStart:"a bookmark name starts with a letter",invalidCharacter:"a bookmark name holds only letters, digits and underscores"};function hg(e){let t=chunkWO4V6PNS_cjs.Gg(e);return t?F2[t]:e.startsWith("_")?"a bookmark name starts with a letter":null}var uR=new WeakMap;function L2(e){let t=uR.get(e);return t||(t=chunkWO4V6PNS_cjs.Jg(e),uR.set(e,t)),t}function D2(e,t){return e.kind==="body"?"body":e.kind==="notesPart"?e.noteKind:t.root.localName==="ftr"?"footer":"header"}function fR(e){return e.kind==="body"?"body":e.kind==="headerFooter"?"headerFooter":"note"}function gR(e){let t=e.options.showBookmarks===true,n=null;e.options.bookmarkMarks?.onChange(()=>{t&&n?.isConnected&&e.repaint();});let r=null,o=()=>{let c=e.session.storyParts();if(r?.parts.length===c.length&&r.parts.every((u,f)=>u===c[f]))return r.entries;let d=[];for(let u of c){let f=bm(e.session,u.name,{kind:"body"}),m=D2(f,u);for(let g of L2(u))d.push({record:g,scope:f,partName:u.name,place:m});}return r={parts:c,entries:d},d},i=c=>{let d=chunkWO4V6PNS_cjs.Ig(c);return o().find(u=>chunkWO4V6PNS_cjs.Ig(u.record.name)===d)??null},a=(c,d,u=[])=>{let f=false;return e.commit(()=>(f=e.session.applyTreeOps([c],void 0,void 0,d,{packageEdits:u}).committed,f)),f},s=c=>hg(c)??e.writeRefusal(),l=()=>{let c=e.orderedRange().from,d=JSON.stringify(e.storyScope()),u,f=g=>(u??=new Map(e.session.paragraphIdsIn(e.storyScope()).map((b,y)=>[b,y]))).get(g)??-1,m=(g,b)=>g===c.paragraphId?[0,b-c.offset]:[f(g)-f(c.paragraphId),0];return (g,b)=>{if(JSON.stringify(b)!==d)return false;let[y,h]=m(g.start.paragraphId,g.start.offset),[v,x]=m(g.end.paragraphId,g.end.offset),k=y<0||y===0&&h<=0,R=v>0||v===0&&x>=0;return k&&R}};return {list(){let c=l(),d=new Map;for(let{record:m}of o()){let g=chunkWO4V6PNS_cjs.Ig(m.name);d.set(g,(d.get(g)??0)+m.copies);}let u=new Set,f=[];for(let{record:m,scope:g,place:b}of o()){let y=chunkWO4V6PNS_cjs.Ig(m.name);u.has(y)||(u.add(y),f.push(Object.freeze({name:m.name,hidden:m.hidden,story:fR(g),place:b,order:f.length,empty:m.start.paragraphId===m.end.paragraphId&&m.start.offset===m.end.offset,atSelection:c(m,g),duplicates:(d.get(y)??1)-1})));}return f},insertRefusal:s,insert(c){if(s(c))return false;let d=e.storyScope(),u=e.orderedRange(),f=chunkWO4V6PNS_cjs.Ig(c),m=new Set(o().filter(g=>chunkWO4V6PNS_cjs.Ig(g.record.name)===f&&JSON.stringify(g.scope)!==JSON.stringify(d)).map(g=>g.partName));return a({op:"insertBookmark",name:c,start:{paragraphId:u.from.paragraphId,offset:u.from.offset},end:{paragraphId:u.to.paragraphId,offset:u.to.offset}},d,[...m].map(g=>b=>chunkWO4V6PNS_cjs.ej(b,g,c)))},remove(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=chunkWO4V6PNS_cjs.Ig(c),f=new Set(o().filter(m=>chunkWO4V6PNS_cjs.Ig(m.record.name)===u&&m.partName!==d.partName).map(m=>m.partName));return a({op:"deleteBookmark",name:c},d.scope,[...f].map(m=>g=>chunkWO4V6PNS_cjs.ej(g,m,c)))},keepFirst(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=chunkWO4V6PNS_cjs.Ig(c),m=[...new Set(o().filter(b=>chunkWO4V6PNS_cjs.Ig(b.record.name)===u&&b.partName!==d.partName).map(b=>b.partName))].map(b=>y=>chunkWO4V6PNS_cjs.ej(y,b,c));if(d.record.copies>1)return a({op:"deleteBookmark",name:c,keepFirst:true},d.scope,m);if(m.length===0)return false;let g=false;return e.commit(()=>(g=e.session.applyTreeOps([],void 0,void 0,d.scope,{packageEdits:m}).committed,g)),g},writeRefusal:()=>e.writeRefusal(),goTo(c){let d=i(c);if(!d)return false;let{start:u,end:f}=d.record,m=e.goToPosition(u,{orShow:true,center:true});return m?(m===true&&e.setSelection({anchor:u,head:f}),true):false},shown:()=>t,setShown(c){c!==t&&(e.beforeChange(),t=c,e.repaint());},paint(c){if(n=c.layer,!t){c.layer.replaceChildren();return}let d=e.options.bookmarkMarks?.current()??{};c.layer.classList.toggle("docx-bookmark-overlay--print",d.print===true);let u=d.include??"visible",f=[],m=new Set;for(let{record:g,scope:b,partName:y}of o()){let h=chunkWO4V6PNS_cjs.Ig(g.name);if(m.has(h))continue;m.add(h);let v={name:g.name,hidden:g.hidden,story:fR(b)};if(u==="visible"?g.hidden:u!=="all"&&!u(v))continue;let x=g.start.paragraphId===g.end.paragraphId&&g.start.offset===g.end.offset,k=b.kind==="headerFooter"?y:void 0;if(x){f.push({...v,edge:"point",...g.start,repeats:k});continue}f.push({...v,edge:"start",...g.start,repeats:k},{...v,edge:"end",...g.end,repeats:k});}H2(c,f,d.decorate,e.options.bookmarkMarks?.reportError);}}}var pR=new WeakMap,mR=new WeakSet;function N2(e){mR.has(e)||(mR.add(e),e.addEventListener("mousedown",t=>{let r=t.target?.localName;r==="input"||r==="select"||r==="textarea"||t.preventDefault();}));}function H2(e,t,n,r){let{layer:o,layout:i,scale:a}=e,s=o.ownerDocument;N2(o),o.style.setProperty("--docx-bookmark-scale",String(a));let l=[],c=e.pages?[...e.pages]:i.pages.map((f,m)=>m),d=pR.get(i);d||pR.set(i,d=new Map);let u=d;for(let f of t){let m={paragraphId:f.paragraphId,offset:f.offset},g=(h,v)=>{let x=`${f.paragraphId}:${h}:${v??""}`;if(u.has(x))return u.get(x);let k=chunkDBOOTED4_cjs.qe(i,{paragraphId:f.paragraphId,offset:h},{...e.measurer?{measurer:e.measurer}:{},...v!==void 0?{preferredPageIndex:v}:{}});return u.set(x,k),k},b=f.repeats?c.map(h=>g(m.offset,h)):[g(m.offset)],y=new Set;for(let h of b){if(!h||!(h.height>0)||y.has(h.pageIndex)||e.pages&&!e.pages.has(h.pageIndex))continue;let v=i.pages[h.pageIndex];if(!v)continue;let x=e.pageOffsetX?.get(h.pageIndex)??0,k=f.repeats?[v.header,v.footer].find(S=>S?.partName===f.repeats):f.story==="note"?gg(v,f.paragraphId):void 0;if((f.repeats||f.story==="note")&&!k)continue;let R=k?.box??v.contentBox;y.add(h.pageIndex);let C=s.createElement("div");C.className=`docx-bookmark-mark docx-bookmark-mark--${f.edge}`;let P=f.edge==="end"?m.offset-1:m.offset+1,E=P>=0?g(P,f.repeats?h.pageIndex:void 0):null;E?.lineId===h.lineId&&(f.edge==="end"?E.x>h.x:E.x<h.x)&&C.classList.add("docx-bookmark-mark--rtl");let w={name:f.name,hidden:f.hidden,story:f.story,edge:f.edge};try{C=n?.(C,w)??C;}catch(S){r?.(S);}C.dataset.bookmarkName=f.name,C.dataset.bookmarkHidden=String(f.hidden),C.dataset.bookmarkEdge=f.edge,C.dataset.bookmarkStory=f.story,C.dataset.docxMarker="",C.setAttribute("contenteditable","false"),C.style.position="absolute",C.style.left=`${(R.x+h.x+x)*a}px`,C.style.top=`${(R.y+h.y)*a}px`,C.style.height=`${h.height*a}px`,l.push(C);}}o.replaceChildren(...l);}function _2(e){return e.type==="insertBookmark"||e.type==="deleteBookmark"||e.type==="keepFirstBookmark"||e.type==="goToBookmark"}function B2(e,t){let n=chunkWO4V6PNS_cjs.Ig(t);return e.bookmarkEditing.list().some(r=>chunkWO4V6PNS_cjs.Ig(r.name)===n)}function yg(e,t){if(!_2(t))return null;if(t.type==="insertBookmark"){let n=hg(t.name);if(n)return {ok:false,code:"invalidArgs",reason:n};let r=e.bookmarkEditing.insertRefusal(t.name);return r?{ok:false,code:"locked",reason:r}:null}if(!B2(e,t.name))return {ok:false,code:"notFound",reason:"the document has no bookmark with that name"};if(t.type==="keepFirstBookmark"){let n=chunkWO4V6PNS_cjs.Ig(t.name);if(!e.bookmarkEditing.list().find(o=>chunkWO4V6PNS_cjs.Ig(o.name)===n)?.duplicates)return {ok:false,code:"unsupported",reason:"the bookmark has no copies"}}if(t.type!=="goToBookmark"){let n=e.bookmarkEditing.writeRefusal();if(n)return {ok:false,code:"locked",reason:n}}return null}function bg(e,t,n,r="bookmark dialog"){return t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.canOpen()?(n&&e.open(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:`no ${r} is registered`}}function hR(e,t){let n=yg(e,t);return n||(t.type==="goToBookmark"?e.bookmarkEditing.goTo(t.name)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the bookmark cannot be shown"}:(t.type==="insertBookmark"?e.bookmarkEditing.insert(t.name):t.type==="keepFirstBookmark"?e.bookmarkEditing.keepFirst(t.name):e.bookmarkEditing.remove(t.name))?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:e.state().lastRejection??`${t.type} was refused`})}function yR(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.direction?{direction:t.direction}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}var vg=new WeakMap;function bR(e,t){let n=e.isScheduled(),r=xg(t);return r?vg.set(e,r):n||vg.delete(e),r??(n?vg.get(e)??null:null)}function xg(e){if(!e)return null;let t=e.sectionPropertiesAt(e.state().selection.head.paragraphId);return {pageWidthTwips:t.pageSize.widthTwips,pageHeightTwips:t.pageSize.heightTwips,orientation:t.landscape?"landscape":"portrait",marginsTwips:{top:t.margins.topTwips,right:t.margins.rightTwips,bottom:t.margins.bottomTwips,left:t.margins.leftTwips},gutterTwips:t.margins.gutterTwips}}function _d(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let c=e.session.paraIdOf(t.paragraphId);return c===null?null:{from:{paraId:c},to:{paraId:c}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),i=r.paraIdByNode.get(n.paragraphId);if(o===void 0||i===void 0)return null;let a=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<a||s===a&&n.offset<t.offset?{from:{paraId:i},to:{paraId:o}}:{from:{paraId:o},to:{paraId:i}}}function vR(e){if(!e)return null;let t=e.hyperlinks.linkAtCaret();if(!t)return null;let n=e.session.paraIdOf(t.paragraphId);return n===null?null:{href:t.href??"",range:{from:{paraId:n},to:{paraId:n}},...t.tooltip!==void 0?{tooltip:t.tooltip}:{}}}function xR(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunkEOTAXOJY_cjs.d(n).map(o=>{let i=r.paraIdByNode.get(o.id),a=o.kind==="textValue"?void 0:chunkEOTAXOJY_cjs.i(o);return {...i!==void 0?{paraId:i}:{},text:chunkWO4V6PNS_cjs.hj(n,o.id)??"",...a!==void 0?{styleId:a}:{}}})}function ha(e){return e?e.state().pageCount:0}function wg(e,t="caret"){return e?e.currentPage(t):1}function $2(e,t){if(!Io(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=Bd(e,t);return n.can.ok?{ok:true,tablePlan:n.plan}:{ok:false,refusal:{ok:false,code:n.can.code,reason:n.can.reason}}}function q2(e,t){return {command:e,part:t.session.partFor(t.storyScope())??t.session.part(),layout:t.layout(),storeRevision:t.session.packageRevision(),selection:t.state().selection,cellSelection:t.state().cellSelection,themeColors:t.session.documentThemeColors(),editable:t.session.editable,viewing:t.editingMode()==="view"}}function Bd(e,t){let n=q2(e,t),r=Jr(n),o=chunkWO4V6PNS_cjs.ah(t.session.currentPackage());return r.ok&&r.ops.some(i=>chunkWO4V6PNS_cjs.Jk(n.part,o,i))&&(r={ok:false,code:"locked",reason:mi}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function il(e,t,n,r){if(r?.scope){if(r.scope.kind==="all")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"the all scope is read-only"}};if(r.scope.kind==="note"||r.scope.kind==="frame")return {ok:false,refusal:{ok:false,code:"unsupported",reason:`scope kind '${r.scope.kind}' is not supported`}};if(r.scope.kind==="headerFooter"){let l=t?.activeScope?.()??{kind:"body"};if(l.kind!=="headerFooter"||l.rId!==r.scope.rId)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"open that header or footer before dispatching against its scope"}}}}let o=ui(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};let i=o.mutating?Xn(e,t):null;if(i)return {ok:false,refusal:i};if(e.type==="insertTextBox"){let l=Tm(t);return l?{ok:false,refusal:l}:{ok:true}}if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="deleteText"&&Fn(t)){let l=ga({type:"deleteImage"},t);return l&&!l.ok?{ok:false,refusal:l}:{ok:true}}if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:l,head:c}=t.state().selection;if(l.paragraphId===c.paragraphId&&l.offset===c.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(l=>l.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="pasteFormatting"&&t.formatPainter.state().level==="none")return {ok:false,refusal:{ok:false,code:"notFound",reason:Xk}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().canRedo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};let a=yg(t,e);if(a)return {ok:false,refusal:a};if(e.type==="insertToc"&&!t.canInsertToc())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table of contents can only be inserted in the editable document body"}};if(e.type==="editTextFormField"&&!t.canEditTextFormField())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"field options are unavailable"}};if(e.type==="refreshToc"&&!t.canRefreshToc(e.tocId))return {ok:false,refusal:{ok:false,code:"notFound",reason:"there is no refreshable table of contents at the selection"}};if(e.type==="insertPageField"&&(t.activeScope?.()??{kind:"body"}).kind!=="headerFooter")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}};if(e.type==="insertNote"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertNote requires body scope"}};if(e.type==="insertBreak"&&(e.kind==="section"||e.kind==="sectionContinuous")){if((t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a section break can only be inserted in the editable document body"}};let c=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(c)return {ok:false,refusal:{ok:false,code:"unsupported",reason:c}}}if(e.type==="insertBreak"&&e.kind==="page"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a page break can only be inserted in the editable document body"}};if(e.type==="linkHeaderFooterToPrevious"){let l=t.headerFooterState?.();if((e.sectionIndex??l?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(Io(e)){let l=$2(e,t);return l.ok?{ok:true,tablePlan:l.tablePlan}:l}let s=ga(e,t);return s&&!s.ok?{ok:false,refusal:s}:{ok:true}}function wR(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunkWO4V6PNS_cjs.Ta(n,t))return true;let r=chunkWO4V6PNS_cjs.Ua(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunkWO4V6PNS_cjs.Ua(n,r.id);}return false}function SR(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!wR(e,t.selection.head.paragraphId))return null;let r=chunk5JPIEN54_cjs.pa(e.layout(),t.selection.head.paragraphId);return r?{blockId:r.tableId,rowCount:r.rows,columnCount:r.columns,cell:{row:n?n.rows.from:r.rowIndex,column:n?n.columns.from:r.columnIndex}}:null}function $d(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!wR(e,t.selection.head.paragraphId))return null;let r=chunk5JPIEN54_cjs.pa(e.layout(),t.selection.head.paragraphId);return r?{rows:r.rows,columns:r.columns,rowIndex:n?n.rows.from:r.rowIndex,columnIndex:n?n.columns.from:r.columnIndex}:null}function kR(e){return e?{...e.bold!==void 0?{bold:e.bold}:{},...e.italic!==void 0?{italic:e.italic}:{},...e.underline!==void 0?{underline:e.underline}:{},...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSizePt!==void 0?{fontSizeHalfPoints:Math.round(e.fontSizePt*2)}:{},...e.styleId?{styleId:e.styleId}:{},...e.alignment?{alignment:e.alignment}:{}}:null}function IR(e){return !!e&&Mn(e.session.part(),e.state().selection.head)!==void 0}var se={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],format_shapes:["M40-40v-240h80v-400H40v-240h240v80h400v-80h240v240h-80v400h80v240H680v-80H280v80H40Zm240-160h400v-80h80v-400h-80v-80H280v80h-80v400h80v80Zm32-120 136-360h64l136 360h-62l-32-92H408l-32 92h-64Zm114-144h108l-52-150h-4l-52 150ZM120-760h80v-80h-80v80Zm640 0h80v-80h-80v80Zm0 640h80v-80h-80v80Zm-640 0h80v-80h-80v80Zm80-640Zm560 0Zm0 560Zm-560 0Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],bookmark:["M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"],bookmarks:["M120-40v-640q0-33 23.5-56.5T200-760h400q33 0 56.5 23.5T680-680v640L400-160 120-40Zm80-122 200-86 200 86v-518H200v518Zm560 2v-680H240v-80h520q33 0 56.5 23.5T840-840v680h-80ZM200-680h400-400Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],rate_review:["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],visibility:["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],format_textdirection_l_to_r:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],format_textdirection_r_to_l:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],"agent-sparkle":["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]};var ya={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},PR=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function Sg(e){return i18n.createT(i18n.en)(e)}function al(e){return PR.includes(e)}function j2(e){return e!=null}var TR=[{value:"all",icon:"border_all",labelKey:"table.borders.all"},{value:"outside",icon:"border_outer",labelKey:"table.borders.outside"},{value:"inside",icon:"border_inner",labelKey:"table.borders.inside"},{value:"top",icon:"border_top",labelKey:"table.borders.top"},{value:"bottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{value:"left",icon:"border_left",labelKey:"table.borders.left"},{value:"right",icon:"border_right",labelKey:"table.borders.right"},{value:"none",icon:"border_clear",labelKey:"table.borders.none"}],ER=[{value:"single",labelKey:"table.borderStyles.single",previewClass:"docx-table-line--single"},{value:"dashed",labelKey:"table.borderStyles.dashed",previewClass:"docx-table-line--dashed"},{value:"dotted",labelKey:"table.borderStyles.dotted",previewClass:"docx-table-line--dotted"},{value:"double",labelKey:"table.borderStyles.double",previewClass:"docx-table-line--double"},{value:"triple",labelKey:"table.borderStyles.triple",previewClass:"docx-table-line--triple"},{value:"thick",labelKey:"table.borderStyles.thick",previewClass:"docx-table-line--thick"}],V2=[{size:4,labelKey:"table.borderWidths.halfPt",previewThickness:.5},{size:8,labelKey:"table.borderWidths.onePt",previewThickness:1},{size:12,labelKey:"table.borderWidths.oneHalfPt",previewThickness:1.5},{size:16,labelKey:"table.borderWidths.twoPt",previewThickness:2},{size:24,labelKey:"table.borderWidths.threePt",previewThickness:3}];function U2(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function z2(e){return e==="none"||U2(e)}function RR(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function G2(e){return ER.some(t=>t.value===e)}function hi(e,t,n){switch(t){case "table.borderTarget":return z2(n)?n==="none"?{command:{type:"setTableBorders",scope:"none",target:e.activeTarget},nextDraft:e}:{command:{type:"setTableBorders",scope:n,spec:e.spec},nextDraft:{activeTarget:n,spec:e.spec}}:null;case "table.borderColor":{if(!RR(n))return null;let r={...e.spec,color:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderStyle":{if(!G2(n))return null;let r={...e.spec,style:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderWidth":{if(typeof n!="number"||!Number.isInteger(n))return null;let r={...e.spec,size:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.cellFill":return n!==null&&!RR(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function kg(e,t=ya){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return hi(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return hi(t,e,"single")?.command??null;case "table.borderWidth":return hi(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function Z2(e){return TR.find(n=>n.value===e)?.labelKey??"table.borders.all"}function X2(e){return se[e]}function ba(e){let t=[];return {current:()=>t[t.length-1]??e,push:n=>(t.push(n),()=>{let r=t.lastIndexOf(n);r>=0&&t.splice(r,1);})}}function qd(e){let t=ba({}),n=false,r=false,o=()=>t.current().onRequest!==void 0,i=()=>{o()!==n&&(n=o(),e?.());};return {canOpen:o,open(){let a=t.current().onRequest;return a?.(),a!==void 0},shortcutOn:()=>t.current().shortcut!==false,openFromShortcut(){if(t.current().shortcut===false)return false;let a=t.current().onRequest;return a?.(),a!==void 0},register(a){let s=t.push(a);return i(),()=>{s(),!r&&(r=true,globalThis.queueMicrotask(()=>{r=false,i();}));}}}}function CR(e={}){let t=qd(e.changed),n=qd(e.changed),r=ba({}),o=null,i={current:r.current,onChange:a=>{o=a;},reportError:a=>e.error?.(a)};return {surfaceOptions:{onRequestBookmark:t.open,onRequestGoTo:n.openFromShortcut,bookmarkMarks:i},bookmarkDialog:t,goTo:n,setters:{setBookmarkChrome:a=>t.register(a),setGoToChrome:a=>n.register(a),setBookmarkMarks(a){let s=r.push(a);return o?.(),()=>{s(),o?.();}}}}}var Wd="no comment draft view is registered",OR=new WeakMap;function MR(e={}){let t=qd(e.changed);return {requests:{canOpen:t.canOpen,open:t.open},setters:{setCommentDraftChrome:r=>t.register(r)}}}function AR(e,t){OR.set(e,t);}function Ig(e){return OR.get(e)??null}function Po(e){return e.surface??null}var Y2={"review.revisionMarkup":{type:"openRevisionMarkupDialog"},"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.bookmarks":{type:"toggleBookmarks"},"insert.bookmark":{type:"openBookmarkDialog"},"insert.goToBookmark":{type:"openGoTo"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"direction.ltr":{type:"setParagraphDirection",direction:"ltr"},"direction.rtl":{type:"setParagraphDirection",direction:"rtl"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.textBox":{type:"insertTextBox"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"}};function Q2(e){return LR[e]??null}var FR=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),LR={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:FR,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"},"insert.watermark":{type:"setWatermark",watermark:{text:"DRAFT"}}};function jd(e){return Y2[e]??null}var J2={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},DR={"font.family":"Arial","font.size":22,"text.color":"000000","text.highlight":"yellow","styles.style":"Normal","list.lineSpacing":1,"image.wrap":"square","image.altText":"probe alt text"};function NR(e,t,n){return hi(n,e,t)?.command??null}function Kd(e,t){if(e==="review.editingMode")return {type:"setEditingMode",mode:t};if(e==="styles.style")return {type:"setParagraphStyle",styleId:t};if(e==="list.lineSpacing")return {type:"setLineSpacing",rule:"multiple",value:t};if(al(e))return NR(e,t,ya);if(e==="image.wrap")return typeof t!="string"||!chunkWO4V6PNS_cjs.Gd.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=J2[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function HR(e,t,n=ya){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=kg(t,n);if(!r)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let o=e.can(r);return o.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:o.reason,active:false}}var e8=["editing","suggesting","viewing"];function _R(e){let t="review.addComment",n=o=>({id:t,enabled:false,disabledReason:o,active:false}),r=e.can({type:"toggleReviewPane"});return r.ok?(e.getEditingMode?.()??"editing")==="viewing"?n("the document is open for viewing"):Ig(e)?.canOpen()?e.getSelectionPlacement()===null?n("a comment needs a selected range"):{id:t,enabled:true,disabledReason:null,active:false}:n(Wd):n(r.reason)}function BR(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(al(t))return HR(e,t);if(t==="review.editingMode"){let i=e.getEditingMode?.()??"editing",a=e8.filter(c=>c!==i).map(c=>e.can(Kd(t,c))),s=a.some(c=>c.ok),l=a.find(c=>!c.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:i}}if(t==="format.painter"){let i=Po(e);if(!i)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let a=i.formatPainter.state();if(a.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:a.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:a.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:a.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let i=Po(e),a=i?.state().contentControls,s=t==="contentControl.showAll"?a?.showAll??false:a?.formFill??false;return {id:t,enabled:i!==null,disabledReason:i?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let i=Po(e);return i?i.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}if(t==="review.addComment")return _R(e);if(t==="review.authors"){let i=e.can({type:"toggleReviewPane"});return i.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:i.reason,active:false}}let n=jd(t);if(!n){let i=DR[t];if(i!==void 0){let s=Kd(t,i);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),c=e.getSelectedImage?.()??null,d=t==="image.wrap"?c?.wrap:t==="image.altText"?c?.description:Zk(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...d!==void 0?{value:d}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...d!==void 0?{value:d}:{}}}let a=LR[t];if(a){if(t==="image.insert"&&a.type==="insertImage"){let l=e.canExecuteImageCommand?.({type:"insertImage",data:FR,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="image.properties"&&a.type==="setImageProperties"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="table.insert"&&a.type==="insertTable"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="paragraph.dialog"&&a.type==="setParagraphFormat"){let l=e.can(a);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}let s=e.can(a);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false}}return t==="file.exportMarkdown"||t==="file.exportPdf"?{id:t,enabled:false,active:false,disabledReason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{id:t,enabled:false,active:false,disabledReason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function t8(e){if(e==="format.painter")return true;let t=jd(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleBookmarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"||t?.type==="setParagraphDirection"}function n8(e,t){return t.map(n=>BR(e,n))}function r8(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=hi(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let i=e.can(o.command);if(!i.ok)return {result:{ok:false,code:i.code,reason:i.reason},nextDraft:null};let a=e.exec(o.command);return a.ok?{result:a,nextDraft:o.nextDraft}:{result:a,nextDraft:null}}var o8=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove","review.addComment"]);function i8(e,t,n,r){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(n&&typeof n=="object"&&("historyGroup"in n||"scope"in n||Object.keys(n).length===0)){if(r||DR[t]!==void 0||al(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&o8.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let a=Po(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(a.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return a.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Rd}}if(t==="review.addComment"){let a=_R(e);return a.enabled?Ig(e)?.open()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:Wd}:{ok:false,code:"unsupported",reason:a.disabledReason??Wd}}if(t==="contentControl.showAll"){let a=Po(e);return a?(a.contentControls.setShowAll(!a.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let a=Po(e);return a?(a.contentControls.setFormFill(!a.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let a=Po(e);return a?a.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let a=Po(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=a.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=a.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:a.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:a.state().lastRejection??"unsupported",reason:a.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?jd(t):Kd(t,n);if(!o)return n!==void 0?{ok:false,code:"unsupported",reason:"invalid value for toolbar command"}:t==="file.exportMarkdown"||t==="file.exportPdf"?{ok:false,code:"unsupported",reason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{ok:false,code:"unsupported",reason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"}:t==="file.open"?{ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"}:{ok:false,code:"unsupported",reason:"not wired to an editor command"};let i=e.can(o,r);return i.ok?e.exec(o,r):{ok:false,code:i.code,reason:i.reason}}function a8(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function s8(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=Bd(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function l8(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let r=e.can(t,n);return r.ok?e.exec(t,n):{ok:false,code:r.code,reason:r.reason}}function Rg(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(Rg):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,Rg(e[t])]))}function c8(e){return JSON.stringify(Rg(e))}var Pg=["zoom","script","format","list","alignment","styles","font","text","history"],d8=new Set(["review"]),qR=24,WR=new Set;function KR(e,t=Pg){let n=t.indexOf(e);return n===-1?void 0:(n+1)*10}function u8(e,t=Pg,n){let r=[],o=[];return e.forEach((i,a)=>{let s=n?.get(i)??KR(i,t);s===void 0||Number.isNaN(s)?o.push(i):r.push({id:i,priority:s,position:a});}),r.sort((i,a)=>i.priority-a.priority||a.position-i.position),[...o.reverse(),...r.map(i=>i.id)]}function f8(e,t){let n=[...e],r=new Map,o=t.filter(i=>!e.includes(i.id));for(;o.length>0;){let i=[];for(let a of o){let s=a.after;if(s===void 0||s===a.id){n.push(a.id);continue}if(!n.includes(s)){i.push(a);continue}let l=r.get(s)??s;n.splice(n.indexOf(l)+1,0,a.id),r.set(s,a.id);}if(i.length===o.length){n.push(...i.map(a=>a.id));break}o=i;}return n}var Tg=8;function p8(e){let t=e.margin??Tg,n=Math.max(0,e.viewportWidth-t*2),r=Math.min(e.panelWidth,n),o=t,i=e.viewportWidth-t-r,a=e.triggerRight-r;if(a>=o&&a<=i)return {left:a,maxWidth:n,anchor:"end"};let s=e.triggerLeft;return s>=o&&s<=i?{left:s,maxWidth:n,anchor:"start"}:{left:Math.max(o,Math.min(a,i)),maxWidth:n,anchor:"clamped"}}function $R(e,t){let{widths:n,groups:r,order:o,fixed:i,more:a}=e,s=i;for(let c of r)s+=n.get(c)??0;if(s<=t)return WR;s+=a;let l=new Set;for(let c of o){if(s<=t)break;let d=n.get(c);d===void 0||l.has(c)||(l.add(c),s-=d);}return l}function jR(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}var m8=jR;function g8(e){if(!(e.available>0))return WR;let t=$R(e,e.available),n=e.previous;if(!n||n.size===0||t.size>=n.size)return t;let r=$R(e,e.available-(e.hysteresis??qR));return jR(r,n)?n:r}function h8(e){let t=e.margin??Tg,n=e.viewportWidth-t-e.popupWidth;return Math.max(t,Math.min(e.anchorLeft,n))}function y8(e,t,n,r){return e+t+n+r*2}function b8(e,t){return e+t}function v8(e,t){return e+t}function x8(e){let t=Number.parseFloat(e.marginInlineStart||e.marginLeft),n=Number.parseFloat(e.marginInlineEnd||e.marginRight);return {start:Number.isFinite(t)?t:0,end:Number.isFinite(n)?n:0}}function Yn(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function w8(e){return Yn(e.columnGap)}function VR(e){if(!(e.parentContent>0))return e.own;let t=e.parentContent-e.siblings-e.margins;return e.maxWidth!==null&&(t=Math.min(t,e.maxWidth)),Math.max(e.own,t-e.chrome)}function UR(e){return e.position==="absolute"||e.position==="fixed"||e.display==="none"}function zR(e){let t=e.computedStyleMap;if(typeof t!="function")return null;try{return t.call(e)}catch{return null}}function Eg(e,t){let n=e?.get(t);return n&&typeof n.value=="string"?n.value:null}var S8=new Set(["auto","max-content","fit-content","min-content"]);function GR(e){return e.display.includes("flex")&&!e.flexDirection.startsWith("column")&&!e.flexWrap.startsWith("wrap")}function Ud(e,t,n){return Eg(e,`margin-${n}`)==="auto"?0:Yn(n==="left"?t.marginLeft:t.marginRight)}function k8(e){return /^(input|textarea|select|button|img|video|canvas|iframe|svg)$/i.test(e.tagName)?true:e.children.length>0||(e.textContent??"").trim().length>0}function I8(e,t,n){let r=t.flexBasis.trim(),o=r.endsWith("px")?Yn(r):0,i=Eg(n,"min-width")??t.minWidth.trim();return i==="auto"||i===""?k8(e)?null:o:/^[\d.]+px$/.test(i)?Math.max(o,Yn(i)):null}function ZR(e,t,n){for(let r of e.childNodes){if(r.nodeType===3&&(r.textContent??"").trim().length>0)return false;if(!_t(r))continue;let o=Ze(r).getComputedStyle(r);if(o.display==="contents"){if(!ZR(r,t,n))return false;continue}if(UR(o)||(n.items+=1,r===t))continue;let i=zR(r),s=Number.parseFloat(o.flexGrow)>0?I8(r,o,i):r.getBoundingClientRect().width;if(s===null)return false;n.width+=s+Ud(i,o,"left")+Ud(i,o,"right");}return true}function R8(e,t){if(!GR(t)||!e.parentElement)return 0;let n={width:0,items:0};return ZR(e.parentElement,e,n)?n.width+Math.max(0,n.items-1)*Yn(t.columnGap):null}function P8(e,t,n){let r=e.maxWidth.trim();if(r==="none"||r==="")return null;let o;if(/^-?[\d.]+%$/.test(r))o=Number.parseFloat(r)/100*t;else if(/^-?[\d.]+px$/.test(r))o=Number.parseFloat(r);else return;if(Number.isFinite(o))return e.boxSizing==="border-box"?o:o+n}var T8="[data-toolbar-group], [data-toolbar-fixed], [data-toolbar-more]";function XR(e,t){let n=e.getBoundingClientRect();if(!(n.width>0))return null;let r=n.left+e.clientLeft+Yn(t.paddingLeft),o=n.left+e.clientLeft+e.clientWidth-Yn(t.paddingRight);for(let i of e.querySelectorAll(T8)){let a=i.getBoundingClientRect();if(a.width!==0&&(a.right>o+1||a.left<r-1))return true}return false}var sl=new WeakMap,Vd=new WeakMap;function E8(e,t,n,r){let o=e.parentElement;if(!o||UR(t)||(t.cssFloat||t.getPropertyValue("float")||"none")!=="none")return null;let i=zR(e),a=Eg(i,"width");if(a===null||!S8.has(a))return null;let s=Ze(o).getComputedStyle(o),l=GR(s),c=s.display.includes("flex")&&s.flexDirection.startsWith("column"),d=(s.display==="block"||s.display==="flow-root"||c)&&!t.display.startsWith("inline");if(!l&&!d||l&&Number.parseFloat(t.flexGrow)>0)return null;let u=o.clientWidth-Yn(s.paddingLeft)-Yn(s.paddingRight),f=Math.max(0,e.offsetWidth-e.clientWidth)+r,m=R8(e,s),g=P8(t,u,f);return m===null||g===void 0?null:{room:VR({own:n,parentContent:u,siblings:m,margins:Ud(i,t,"left")+Ud(i,t,"right"),chrome:f,maxWidth:g}),parentContent:u}}function C8(e,t){let n=Yn(t.paddingLeft)+Yn(t.paddingRight),r=e.clientWidth-n,o=E8(e,t,r,n);if(!o)return sl.delete(e),Vd.delete(e),r;let i=sl.get(e);if(i&&i.parentContent!==o.parentContent&&sl.delete(e),XR(e,t)===true)return Vd.get(e)&&sl.set(e,{parentContent:o.parentContent,cap:r}),Vd.set(e,false),r;let a=sl.get(e)?.cap??Number.POSITIVE_INFINITY,s=Math.max(r,Math.min(o.room,a));return Vd.set(e,s>r),s}var M8=/^[a-z]$/;function zd(e){let t=e.key.toLowerCase();if(M8.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function Cg(e,t=i18n.isApplePlatform()){if(e.shiftKey||e.isComposing)return false;if(t){if(!e.metaKey||!e.altKey||e.ctrlKey)return false}else if(!e.ctrlKey||e.metaKey||e.altKey)return false;return zd(e)==="g"}function YR(e){let t=[],n=r=>{for(let o of r)o.kind==="item"?t.push(o.slot):o.kind==="submenu"&&n(o.items);};for(let r of e)n(r.entries);return t}var QR={id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:se.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:se.file_download,state:{kind:"save"}},{id:"exportMarkdown",labelKey:"toolbar.exportMarkdown",paths:se.file_download,state:{kind:"export"}},{id:"exportPdf",labelKey:"toolbar.exportPdf",paths:se.file_download,state:{kind:"export"}},{id:"print",labelKey:"toolbar.print",paths:se.print,state:{kind:"export"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:se.settings,state:{kind:"command"}}]};var JR={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"revisionMarkup",shape:"icon",labelKey:"revisionMarkup.title",defaultToolbar:false,paths:se.edit_note,state:{kind:"command"}},{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:se.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:se.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:se.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:se.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:se.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:se.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:se.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:se.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:se.format_paragraph,state:{kind:"command"}},{id:"bookmarks",shape:"icon",labelKey:"formattingBar.showBookmarks",defaultToolbar:false,paths:se.bookmarks,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:se.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:se.comment,state:{kind:"command"}},{id:"addComment",shape:"icon",labelKey:"formattingBar.addComment",defaultToolbar:false,paths:se.add_comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:se.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:se.edit_note,state:{kind:"command"}}]};var Og=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:se.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:se.redo,state:{kind:"command"}}]},{id:"zoom",labelKey:"formattingBar.groups.zoom",controls:[{id:"level",shape:"stepper",valueText:"100%",labelKey:"formattingBar.groups.zoom",paths:null,valueKey:"zoom.zoomLevel",state:{kind:"command"}}]},{id:"styles",labelKey:"formattingBar.groups.styles",controls:[{id:"style",shape:"dropdown",labelKey:"styles.selectAriaLabel",paths:null,valueKey:"styles.normalText",state:{kind:"value"}}]},{id:"font",labelKey:"formattingBar.groups.font",controls:[{id:"family",shape:"dropdown",labelKey:"font.selectAriaLabel",paths:null,valueKey:"font.sansSerif",state:{kind:"value"}},{id:"size",shape:"stepper",valueText:"11",labelKey:"fontSize.listLabel",paths:null,valueKey:"fontSize.label",state:{kind:"value"}}]},{id:"text",labelKey:"formattingBar.groups.textFormatting",controls:[{id:"bold",labelKey:"formattingBar.boldShortcut",paths:se.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:se.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:se.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:se.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:se.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:se.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:se.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:se.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:se.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:se.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:se.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:se.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:se.format_align_justify,state:{kind:"command"}}]},{id:"direction",labelKey:"formattingBar.groups.direction",contextual:true,controls:[{id:"ltr",labelKey:"toolbar.leftToRight",paths:se.format_textdirection_l_to_r,state:{kind:"command"}},{id:"rtl",labelKey:"toolbar.rightToLeft",paths:se.format_textdirection_r_to_l,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:se.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:se.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:se.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:se.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:se.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:se.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:se.format_clear,state:{kind:"command"}}]},JR,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:se.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:se.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:se.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:se.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:se.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:se.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:se.wrap_text,valueKey:"imageWrap.inline",state:{kind:"value"}},{id:"altText",shape:"dropdown",labelKey:"formattingBar.altText",paths:null,valueKey:"imageProperties.altText",state:{kind:"value"}}]},{id:"table",labelKey:"formattingBar.groups.table",contextual:true,controls:[{id:"insert",labelKey:"toolbar.table",paths:se.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:se.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:se.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:se.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:se.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:se.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:se.format_line_spacing,state:{kind:"command"}}]},QR,{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"textBox",labelKey:"toolbar.insertTextBox",paths:se.format_shapes,state:{kind:"command"}},{id:"footnote",labelKey:"toolbar.insertFootnote",paths:se.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:se.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:se.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:se.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:se.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:se.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:se.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:se.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:se.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:se.toc,state:{kind:"command"}},{id:"bookmark",labelKey:"toolbar.bookmark",paths:se.bookmark,state:{kind:"command"}},{id:"goToBookmark",labelKey:"toolbar.goToBookmark",paths:se.bookmarks,state:{kind:"command"}},{id:"watermark",labelKey:"toolbar.watermark",paths:se.branding_watermark,state:{kind:"command"}}]}],eP=Og;function A8(e,t){return `${e.id}.${t.id}`}function tP(){return eP.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function F8(e){let t=tP();if(!e)return t;let n=eP.find(r=>r.id==="image");return n?[...t,n]:t}var nP=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.export",paths:se.file_download,items:[{kind:"item",slot:"file.exportMarkdown"},{kind:"item",slot:"file.exportPdf"}]},{kind:"item",slot:"file.print",shortcutKey:"toolbar.printShortcut"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"direction.ltr"},{kind:"item",slot:"direction.rtl"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.painter",labelKey:"formattingBar.formatPainter"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"insert.textBox"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:se.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"},{kind:"item",slot:"insert.bookmark",shortcutKey:"toolbar.bookmarkShortcut"},{kind:"item",slot:"insert.goToBookmark"},{kind:"item",slot:"insert.watermark"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:se.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.revisionMarkup"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"item",slot:"review.bookmarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function L8(){return YR(nP)}function D8(){return Og.reduce((e,t)=>e+t.controls.length,0)}var N8="formattingBar.unavailableInPreview";var Gd=class{constructor(t,n,r,o){this.selection=n;this.part=r;this.revision=o;this.position=t?chunkWO4V6PNS_cjs.Dl(t):void 0;}selection;part;revision;entries=new WeakMap;position;save(){let t=this.part(),n=o=>{let i=chunkWO4V6PNS_cjs.Ta(t,o.paragraphId);return {nodeId:o.paragraphId,stableId:i&&i.kind!=="textValue"?chunkWO4V6PNS_cjs.wb(i):null,offset:o.offset}},r=this.selection();return {partName:t.name,anchor:n(r.anchor),head:n(r.head)}}begin(){if(!this.position)return ()=>{};let t=this.revision(),n=this.save();return ()=>{let r=this.position.current();!r||t===this.revision()||this.entries.set(r,{before:this.entries.get(r)?.before??n,after:this.save()});}}step(t,n){let r=this.position?.current(),o=n(),i=t==="undo"?r:this.position?.current(),a=i?this.entries.get(i):void 0,s=t==="undo"?a?.before:a?.after;return {changed:o,selection:s?this.resolve(s):null}}resolve(t){let n=this.part();if(n.name!==t.partName)return null;let r=new Map,o=[n.root];for(;o.length;){let l=o.pop();for(let d of l.children)d.kind!=="textValue"&&o.push(d);if(l.kind!=="paragraph")continue;let c=chunkWO4V6PNS_cjs.wb(l);c&&r.set(c,l.id);}let i=l=>{let c=l.stableId?r.get(l.stableId):l.nodeId;return c?{paragraphId:c,offset:l.offset}:null},a=i(t.anchor),s=i(t.head);return a&&s?{anchor:a,head:s}:null}};var H8=new Set(["Shift","Control","Alt","AltGraph","Meta","OS","Hyper","Super","Symbol","Fn","FnLock","CapsLock","NumLock","ScrollLock","SymbolLock"]),_8=["opening","fonts","drawing-resources"];function rP(e){return !H8.has(e.key)}function oP(e){return e.paragraphIds.size>0||!_8.some(t=>e.dependencyKeys.has(t))}var B8=new Set;function ll(e,t){let n=chunkDBOOTED4_cjs.sd(e,t.displayMode,t.authorFilter),r=chunkDBOOTED4_cjs.vc(n);if(r===n)return B8;let o=new Set(n.map(i=>i.id));return new Set(r.flatMap(i=>o.has(i.id)?[]:[i.id]))}function $8(e,t,n){let r=chunkDBOOTED4_cjs.sd(e,n.displayMode,n.authorFilter),o=chunkDBOOTED4_cjs.vc(r);if(o===r)return null;let i=new Set(r.map(l=>l.id));if(i.has(t))return null;let a=o.findIndex(l=>l.id===t);if(a===-1)return null;let s=o.slice(a+1).find(l=>i.has(l.id));return s?.kind==="paragraph"?s.id:null}function q8(e,t,n,r){let o=c=>e.findIndex(d=>d.kind!=="textValue"&&d.id===c),i=o(t),a=o(n);if(i===-1||a<=i)return null;let s=[];for(let c=i+1;c<a;c+=1){let d=e[c];if(d.kind==="textValue")return null;s.push(d.id);}if(s.length===0)return s;let l=r();return s.every(c=>l.has(c))?s:null}function iP(e,t,n,r){let o=chunkWO4V6PNS_cjs.Ua(e,t);if(o===null||chunkWO4V6PNS_cjs.Ua(e,n)?.id!==o.id)return null;let i=q8(o.children,t,n,()=>ll(o.children,r));return i===null?null:[...i,n].map(a=>({op:"joinParagraphs",firstId:t,secondId:a}))}function aP(e,t,n,r){if(chunkDBOOTED4_cjs.xd(e,n.paragraphId).length>0)return n;let o=chunkWO4V6PNS_cjs.Ua(t,n.paragraphId);if(o===null)return n;let i=$8(o.children,n.paragraphId,r);return i===null?n:{paragraphId:i,offset:0}}function W8(e,t,n,r,o){if(chunkDBOOTED4_cjs.xd(e,n.paragraphId).length>0)return null;let i=chunkWO4V6PNS_cjs.Ua(t,n.paragraphId);if(i===null||!ll(i.children,r).has(n.paragraphId))return null;let a=i.children,s=a.findIndex(d=>d.kind!=="textValue"&&d.id===n.paragraphId),l;for(let d=s-1;d>=0&&l===void 0;d-=1)a[d].kind!=="textValue"&&(l=a[d]);if(l===void 0||l.kind!=="paragraph")return null;let c=o==="backward"?{paragraphId:l.id,offset:(chunkWO4V6PNS_cjs.hj(t,l.id)??"").length}:aP(e,t,n,r);return {ops:[{op:"joinParagraphs",firstId:l.id,secondId:n.paragraphId}],caret:c}}function K8(e,t,n){let r=chunkWO4V6PNS_cjs.Ua(e,t);if(r===null)return null;let o=r.children,i=o.findIndex(l=>l.kind!=="textValue"&&l.id===t);if(i===-1)return null;let a=null,s=[];for(let l=i+1;l<o.length;l+=1){let c=o[l];if(c.kind!=="textValue"){if(a??=ll(o,n),!a.has(c.id))break;s.push({op:"joinParagraphs",firstId:t,secondId:c.id});}}return s.length>0?s:null}function sP(e){let t=n=>aP(e.layout(),e.part(),n,e.view());return {joinOps:(n,r)=>iP(e.part(),n,r,e.view()),forwardJoinOps:(n,r)=>iP(e.part(),n,r,e.view())??K8(e.part(),n,e.view()),shown:t,removedCaretEdit:(n,r)=>W8(e.layout(),e.part(),n,e.view(),r),shownRange:n=>{let{from:r,to:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(r);return i===r?n:{from:i,to:i}},shownSelection:n=>{let{anchor:r,head:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(o);return i===o?n:{...n,anchor:i,head:i}}}}var lP="\uFFFC";function j8(e,t){let n=new Map,r=new Set,o=chunkDBOOTED4_cjs.xd(e,t),i=o[0],a=i&&e.pages.find(l=>l.index===i.pageIndex),s=i&&[a?.header,a?.footer].some(l=>l?chunkDBOOTED4_cjs.Aa(l.fragments).some(c=>c.lines.includes(i.line)):false);for(let{line:l,pageIndex:c}of o)if(!(s&&c!==i.pageIndex)&&!r.has(l)){r.add(l);for(let d of chunkDBOOTED4_cjs.Pa(l,t)?.spans??[])!d.fieldAtom&&!d.projected||d.range.end-d.range.start===1&&n.set(d.range.start,(n.get(d.range.start)??"")+d.text);}for(let[l,c]of n)c.length<=1&&n.delete(l);return n}function cl(e,t){let n=new Map,r=i=>{let a=n.get(i);return a||n.set(i,a=j8(e,i)),a},o=i=>{let a=t(e,i).split("");for(let s of r(i).keys())s<a.length&&(a[s]=lP);return a};return {markedText:(i,a)=>o(a).join(""),resultAt:(i,a)=>r(i).get(a)??null,spelledText:(i,a)=>{let s=r(a);return o(a).map((l,c)=>l===lP?s.get(c)??l:l).join("")}}}var V8=/[\p{L}\p{N}_'’]/u,cP=e=>e!==void 0&&V8.test(e);function Zd(e,t,n){let r=chunkDBOOTED4_cjs.se(e,t.paragraphId),o=t.paragraphId,i=Math.max(0,Math.min(t.offset,r.length)),a=-1;if(cP(r[i])?a=i:i>0&&cP(r[i-1])&&(a=i-1),a===-1){let s=i,l=i;for(;s>0&&/\s/.test(r[s-1]??"");)s-=1;for(;l<r.length&&/\s/.test(r[l]??"");)l+=1;return s===l&&l<r.length&&(l+=1),{from:{paragraphId:o,offset:s},to:{paragraphId:o,offset:l}}}return {from:{paragraphId:o,offset:chunkDBOOTED4_cjs.ke(r,a+1,-1,n)},to:{paragraphId:o,offset:chunkDBOOTED4_cjs.ke(r,a,1,n)}}}function Ke(e){return {anchor:e,head:e}}function yi(e){if(e.anchor.paragraphId!==e.head.paragraphId)return null;let t=Math.min(e.anchor.offset,e.head.offset),n=Math.max(e.anchor.offset,e.head.offset);return {paragraphId:e.head.paragraphId,start:t,end:n}}function Xd(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let i=n??chunkDBOOTED4_cjs.Ta(e);return i.indexOf(r.paragraphId)<=i.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function To(e,t,n){let r=t[0],o=i=>{let a=t.includes(i.paragraphId),s=a?i.paragraphId:r??i.paragraphId,l=a?i.offset:0,c=chunkDBOOTED4_cjs.se(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,c))}};return {anchor:o(n.anchor),head:o(n.head)}}function Mg(e,t,n,r,o,i=chunkDBOOTED4_cjs.se){let a=(f,m,g)=>o===void 0||!m.includes("\uFFFC")?m:m.replace(/\uFFFC/g,(b,y)=>o(f,g+y)??b);if(t.paragraphId===n.paragraphId)return a(t.paragraphId,i(e,t.paragraphId).slice(t.offset,n.offset),t.offset);let s=r??chunkDBOOTED4_cjs.Ta(e),l=s.indexOf(t.paragraphId),c=s.indexOf(n.paragraphId);if(l===-1||c===-1)return "";let d=s.slice(l,c+1),u=a(t.paragraphId,i(e,t.paragraphId).slice(t.offset),t.offset);for(let f=1;f<d.length;f+=1){let m=d[f],g=i(e,m),b=chunkDBOOTED4_cjs.Qa(e,m).includes(d[f-1])?"":`
24
+ `;u+=b+a(m,f===d.length-1?g.slice(0,n.offset):g,0);}return u}function uP(e,t,n,r){let o=cl(e,chunkDBOOTED4_cjs.se);return Mg(e,t,n,r,o.resultAt,o.markedText)}function fP(e,t){return chunk5JPIEN54_cjs.oa(e,t,cl(e,chunkDBOOTED4_cjs.se).spelledText)}function Ag(e){let t=[],n=r=>{if(r.kind!=="textValue"){r.kind==="paragraph"&&t.push(r.id);for(let o of r.children)n(o);}};return n(e),t}function pP(e){return e.kind}function mP(e){return e.kind!=="textValue"&&pP(e)==="contentControl"}function dP(e){return e.kind!=="textValue"&&pP(e)==="contentControlContent"}function U8(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let i=Ag(o);if(i.length>0&&i.every(a=>t.has(a))){n.set(o.id,i);return}}for(let i of o.children)r(i);}};return r(e.root),n}function z8(e,t,n){let r=new Set,o=(i,a)=>{if(i.kind!=="textValue"){if(i.kind==="table"&&n.has(i.id)){for(let s of i.children)o(s,true);return}if(mP(i)){let s=Ag(i);!a&&s.length>0&&s.every(l=>t.has(l))&&r.add(i.id);for(let l of i.children)o(l,a);return}for(let s of i.children)o(s,a);}};return o(e.root,false),r}function gP(e,t,n,r,o,i){let a=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||i.offset===e(l).length):s!==r||i.offset===e(l).length)&&a.add(l);}return a}function G8(e,t,n){let r=[],o=i=>{if(i.kind!=="textValue"){if(i.kind==="table"||mP(i)){let s=Ag(i).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(i.id);return}}for(let a of i.children)o(a);}};return o(e.root),r}function hP(e,t,n,r,o){let i=f=>chunkDBOOTED4_cjs.se(e,f);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let a=o??chunkDBOOTED4_cjs.Ta(e),s=a.indexOf(n.paragraphId),l=a.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let c=a.slice(s,l+1),d=gP(i,a,s,l,n,r),u=a[l];return {partName:t.name,paragraphIds:c,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...d],fullyCoveredBlockIds:G8(t,d,new Set(a)),lastMarkCovered:r.offset===i(u).length}}function yP(e,t,n,r,o,i={displayMode:e.displayMode??"all-markup",authorFilter:void 0}){let a=w=>chunkDBOOTED4_cjs.se(e,w);if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:[{op:"deleteText",paragraphId:n.paragraphId,start:n.offset,end:r.offset}],collapseTo:n};let s=o??chunkDBOOTED4_cjs.Ta(e),l=s.indexOf(n.paragraphId),c=s.indexOf(r.paragraphId);if(l===-1||c===-1)return {ops:[],collapseTo:n};let d=gP(a,s,l,c,n,r),u=U8(t,d),f=new Map;for(let[w,S]of u)for(let F of S)f.set(F,w);let m=z8(t,d,u),g=l;if(f.has(n.paragraphId)){g=-1;for(let w=l+1;w<=c;w+=1)if(!f.has(s[w])){g=w;break}if(g===-1){let w=f.get(n.paragraphId);for(let S of u.get(w)??[])f.delete(S);u.delete(w),g=l;}}let b=s[g],y=g===l?n:{paragraphId:b,offset:0},h=[];for(let w=l;w<=c;w+=1){let S=s[w];if(f.has(S))continue;let F=a(S).length,A=w===l?n.offset:0,$=w===c?r.offset:F;A<$&&h.push({op:"deleteText",paragraphId:S,start:A,end:$});}for(let w of u.keys())h.push({op:"deleteBlock",blockId:w});for(let w of m)h.push({op:"removeContentControl",controlId:w});let v=w=>{let S=chunkWO4V6PNS_cjs.Ua(t,w);for(;S&&dP(S);){let F=chunkWO4V6PNS_cjs.Ua(t,S.id);if(!F||!m.has(F.id))break;S=chunkWO4V6PNS_cjs.Ua(t,F.id);}return S},x=new Map,k=w=>{let S=x.get(w.id);return S||x.set(w.id,S=ll(w.children,i)),S},R=w=>{let S=[],F=A=>{for(let $ of A)if($.kind!=="textValue"&&!u.has($.id)){if(m.has($.id)){let W=$.children.find(dP);W&&W.kind!=="textValue"&&F(W.children);continue}if($.kind==="paragraph"){S.push($.id);continue}S.push(`\0barrier:${$.id}`);}};return F(w.children),S},C=(w,S)=>{let F=v(w);if(!F||v(S)!==F)return null;let A=R(F),$=A.indexOf(w),W=A.indexOf(S);if($===-1||W<=$)return null;let U=A.slice($+1,W);if(U.length===0)return U;let _=k(F);return U.every(L=>_.has(L))?U:null},P=b,E=b;for(let w=g+1;w<=c;w+=1){let S=s[w];if(f.has(S))continue;let F=C(E,S);if(F)for(let A of [...F,S])h.push({op:"joinParagraphs",firstId:P,secondId:A});else P=S;E=S;}return {ops:h,collapseTo:y}}function bP(e,t,n,r){return t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?[]:chunkDBOOTED4_cjs.ye(e,t,n(),r)}function Fg(e,t){if(!e)return null;let n=e.position,r=o=>o.paragraphId===n.paragraphId&&o.offset===n.offset;return r(t.anchor)&&r(t.head)?e:null}function vP(e,t,n,r){if(n===null||n.length===0)return t?null:void 0;let{anchor:o,head:i}=e;if(!(o.paragraphId!==i.paragraphId||o.offset!==i.offset))return {position:i,properties:n,base:Fg(t,e)?.base??r()}}function xP(e,t,n){let r=To(t,n,e.selection),o=n.includes(e.selection.head.paragraphId);return {selection:r,format:o&&e.format?{...e.format,position:r.head}:null}}var Yd=class{undo=[];redo=[];moving=false;group;position;constructor(t){this.position=chunkWO4V6PNS_cjs.Dl(t);}get canUndo(){return this.matches(this.undo.at(-1))}get canRedo(){return this.matches(this.redo.at(-1))}matches(t){return !!t&&!!this.position&&t.anchor===this.position.current()}record(t,n,r){if(!this.position)return;let o=this.undo.at(-1);if(r!==void 0&&r===this.group&&this.matches(o)){this.undo[this.undo.length-1]={...o,after:n},chunkWO4V6PNS_cjs.Bl(r,"extended");return}this.group=r,this.position.split(),this.redo.length=0,this.undo.push({anchor:this.position.current(),before:t,after:n}),this.undo.length>200&&this.undo.shift(),chunkWO4V6PNS_cjs.Bl(r,"started");}endGroup(){this.group=void 0;}noteEdit(){this.endGroup(),this.moving||(this.redo.length=0);}step(t,n,r){let o=t==="undo"?this.undo:this.redo,i=t==="undo"?this.redo:this.undo;this.endGroup(),this.moving=true;try{if(this.matches(o.at(-1))){let a=o.pop();i.push(a),n(t==="undo"?a.before:a.after);}else r();}finally{this.moving=false;}}};function wP(e,t,n,r){let o=e??chunkDBOOTED4_cjs.Wa,i,a,s;return {current:()=>o,filter(){let l=t();return (!s||l!==i||o!==a)&&(i=l,a=o,s={...l,hiddenAuthors:l?.hiddenAuthors??new Set,revisionMarkup:o,cacheKey:`${l?.cacheKey??""}|markup:${JSON.stringify(o)}`}),s},set(l){JSON.stringify(l)!==JSON.stringify(o)&&(n(),o=l,r());}}}function SP(e){return e?.root.children.some(t=>t.kind!=="textValue"&&(t.localName==="mirrorMargins"||t.localName==="evenAndOddHeaders")&&!t.attributes.some(n=>n.localName==="val"&&["0","false","off"].includes(n.value)))??false}function kP(e,t,n,r){let o=chunkWO4V6PNS_cjs.Ta(e,t);if(o?.kind!=="paragraph")return false;if(!chunkDBOOTED4_cjs.tc(o,n,r))return true;let i=chunkWO4V6PNS_cjs.Ua(e,t);return i?chunkDBOOTED4_cjs.sd(i.children,n,r).some(a=>a.kind==="paragraph"&&a.id===t):false}var Z8=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]);function IP(e){return {onDrawingPointerGesture(t){if(hm(t)&&t.button!==0||e.surface.editingMode()==="view")return;let n=_t(t.target)?t.target:null,o=!e.textbox()?.preparePointer(n)&&n?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");if(o&&n?.closest(".docx-drawing-textbox")){let i;for(let a of e.surface.layout().pages)if(i=chunkDBOOTED4_cjs.Bd(a,o),i)break;if(i&&e.surface.selectDrawing(o,i.paragraphId)){t.preventDefault(),t.stopImmediatePropagation();return}}e.setIntent(o?{kind:"pointer",drawingNodeId:o}:{kind:"none"});},onDrawingKeyGesture(t){if(Zs(t)&&Z8.has(t.key))return;if(Zs(t)&&t.key==="Escape"&&e.textbox()?.active()){e.textbox().exit(),t.preventDefault(),t.stopImmediatePropagation();return}if((Zs(t)&&(t.key==="Delete"||t.key==="Backspace")&&!t.altKey&&!t.ctrlKey&&!t.metaKey||ym(t)&&(t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward"))&&e.intent().kind==="pointer"){let r=Fn(e.surface);if(r!==null){t.preventDefault(),t.stopImmediatePropagation(),e.setIntent({kind:"none"}),e.surface.deleteImage(r.drawingNodeId);return}}e.setIntent({kind:"none"});}}}var TP=32,RP=new WeakMap,PP=new WeakMap,X8=new WeakMap,Y8=new WeakMap;function Qd(e){let t=RP.get(e);if(t)return t;let n=[e.fragments];e.header&&n.push(e.header.fragments),e.footer&&n.push(e.footer.fragments);for(let o of [e.footnotes,e.endnotes])if(o)for(let i of o.notes)n.push(i.fragments);let r={stories:n,sparse:new Map,complete:null};return RP.set(e,r),r}function EP(e,t){let n=t?Y8:X8,r=n.get(e);return r||(r={fragment:e,indent:{indent:e.indent,inTable:t},emptyStyle:e.emptyParagraphStyle},n.set(e,r)),r}function CP(e,t){return e?!e.emptyStyle&&t.emptyStyle?{...e,emptyStyle:t.emptyStyle}:e:t}function dl(e,t,n){let r=e.get(t),o=CP(r,n);o!==r&&e.set(t,o);}function Q8(e,t){let n=(r,o)=>{for(let i of r){if(i.kind==="paragraph"){t(i,o);continue}for(let a of i.rows)if(!a.isHeaderRepeat)for(let s of a.cells)n(s.blocks,true);}};for(let r of e)n(r,false);}function Lg(e){if(e.complete)return e.complete;let t=new Map;Q8(e.stories,(n,r)=>{let o=EP(n,r);for(let i of chunkDBOOTED4_cjs.Ra(n))dl(t,i,o);});for(let[n,r]of e.sparse)r&&t.set(n,r);return e.sparse.clear(),e.complete=t,t}function J8(e,t){if(e.paragraphId===t)return true;for(let n of e.lines??[])if(n.range.paragraphId===t||n.spans.some(r=>r.range.paragraphId===t)||(n.drawings??[]).some(r=>r.paragraphId===t))return chunkDBOOTED4_cjs.Ra(e).includes(t);return false}function OP(e,t){if(e.complete)return e.complete.get(t);let n=e.sparse.get(t);if(n!==void 0)return n??void 0;if(e.sparse.size>=TP)return Lg(e).get(t);let r,o=(i,a)=>{for(let s of i){if(s.kind==="paragraph"){if(!J8(s,t))continue;if(r=CP(r,EP(s,a)),r.emptyStyle)return true;continue}if(chunkDBOOTED4_cjs.ff(s).has(t)){for(let l of s.rows)if(!l.isHeaderRepeat){for(let c of l.cells)if(o(c.blocks,true))return true}}}return false};for(let i of e.stories)if(o(i,false))break;return e.sparse.set(t,r??null),r}function e6(e,t,n){for(let[r,o]of n)MP(e,t,r,o);for(let r=0;r<t.frontier;r+=1)for(let[o,i]of Lg(Qd(e.pages[r])))n.has(o)||dl(t.entries,o,i);t.progress=null;}function MP(e,t,n,r){for(let o=r;o<t.frontier;o+=1){let i=OP(Qd(e.pages[o]),n);i&&dl(t.entries,n,i);}}function ul(e,t,n=false){let r=PP.get(e);r||(r={frontier:0,entries:new Map,progress:new Map},PP.set(e,r));let o=()=>{let s=r.entries.get(t);return s&&(!n||s.emptyStyle)?s:void 0},i=r.progress;if(i&&!i.has(t)&&i.size>=TP&&e6(e,r,i),r.progress){MP(e,r,t,r.progress.get(t)??0);let s=o();for(;!s&&r.frontier<e.pages.length;){let l=OP(Qd(e.pages[r.frontier++]),t);l&&dl(r.entries,t,l),s=o();}return r.progress.set(t,r.frontier),s??r.entries.get(t)}let a=o();for(;!a&&r.frontier<e.pages.length;){for(let[s,l]of Lg(Qd(e.pages[r.frontier++])))dl(r.entries,s,l);a=o();}return a??r.entries.get(t)}var Dg=e=>chunkDBOOTED4_cjs.vd(e)?"rtl":"ltr";function t6(e,t){return ul(e,t,true)?.emptyStyle}var FP=Object.freeze([]);function Sr(e,t){return ul(e,t)?.fragment.props??FP}function fl(e,t){return ul(e,t)?.fragment.tabStops??null}function Jd(e){return Math.round((e.hanging>0?-e.hanging:e.firstLine)*20)}function Ng(e,t){return ul(e,t)?.indent??null}function LP(e,t,n,r,o=chunkWO4V6PNS_cjs.Dh,i){let a=chunkWO4V6PNS_cjs.Ta(e,t);if(!a||a.kind!=="paragraph")return false;for(let s of chunkWO4V6PNS_cjs.Eh(a,chunkWO4V6PNS_cjs.Rh(a),n,r,o,i))if(chunkWO4V6PNS_cjs.Mh(chunkWO4V6PNS_cjs.Lh(s.run,"runProperties","rPr"),chunkWO4V6PNS_cjs.Jh).length>0)return true;return false}function wa(e,t,n,r=chunkWO4V6PNS_cjs.Dh,o){let i=chunkWO4V6PNS_cjs.Ta(e,t);if(!i||i.kind!=="paragraph")return [];let a=chunkWO4V6PNS_cjs.Yh(i,n,r,o);return a?chunkWO4V6PNS_cjs.Mh(chunkWO4V6PNS_cjs.Lh(a,"runProperties","rPr"),chunkWO4V6PNS_cjs.Jh):chunkWO4V6PNS_cjs.Oh(e,t)}function xa(e,t,n){let r=e?.find(i=>i.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function DP(e,t){if(!t||t.length===0)return e;let n=e;for(let r of t){let o=r.attributes?.val;switch(r.localName){case "b":n={...n,bold:xa(t,"b")===true};break;case "i":n={...n,italic:xa(t,"i")===true};break;case "u":n={...n,underline:xa(t,"u")===true};break;case "strike":n={...n,strikethrough:xa(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let i=Number(o);Number.isFinite(i)&&(n={...n,fontSizeHalfPoints:i});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function Hg(e,t,n,r){return (n&&n.length>0?chunk5JPIEN54_cjs.ma(e,n):chunkDBOOTED4_cjs.we(e,t,r??(t.anchor.paragraphId===t.head.paragraphId?[]:chunkDBOOTED4_cjs.Ua(e)))).map(i=>{let a=chunkDBOOTED4_cjs.x(chunkDBOOTED4_cjs.w(i.style));return a===i.style?i:{...i,style:a}})}function eu(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);if(n===-1||r===-1)return [];let o=r>n&&t.to.offset===0?r-1:r;return e.slice(n,o+1)}function tu(e,t,n,r){return Hg(e,t,n,r)[0]?.style??null}function _g(e,t,n,r,o,i){let a=Hg(e,t,r,i);if(a.length===0)return false;let s=l=>{switch(n){case "b":return l.style.bold;case "i":return l.style.italic;case "u":return l.style.underline!==null;case "strike":return l.style.strike;case "vertAlign":return l.style.verticalAlign===o;default:return false}};return a.every(s)}function NP(e,t,n,r,o,i,a){let s=Hg(e,t,r,i),l=s.length===0?AP(e,t,r,i).map(_=>t6(e,_)).filter(_=>_!==void 0):[],c=l.length>0?l:s.map(_=>_.style),d=_=>{if(c.length===0)return null;let L=_(c[0]);return c.every(Z=>_(Z)===L)?L:null},u=(_,L=(Z,ee)=>Z===ee)=>_.length>0&&_.every(Z=>L(Z,_[0]))?_[0]:null,f=(_,L)=>_.props.some(Z=>Z.localName===L),m=_=>_.style.fontFamily??n?.(_.range.paragraphId,_.props).fontFamily??null,g=_=>f(_,"sz")?Math.round(_.style.fontSizePt*2):n?.(_.range.paragraphId,_.props).fontSizeHalfPoints??Math.round(_.style.fontSizePt*2),b=l.length>0?{fontFamily:d(_=>_.fontFamily??a??null),fontSizeHalfPoints:d(_=>Math.round(_.fontSizePt*2))}:s.length===0?n?.(t.head.paragraphId,[]):void 0,y=AP(e,t,r,i),h=_=>u(y.map(L=>_(Sr(e,L)))),v=(_,L=(Z,ee)=>Z===ee)=>{if(y.length<2)return false;let Z=_(Sr(e,y[0]));return y.some((ee,te)=>te>0&&!L(_(Sr(e,ee)),Z))},x=h(_=>chunkDBOOTED4_cjs.dd(_)),k=h(Dg),R=h(_=>chunkDBOOTED4_cjs.Q(_,"pStyle")?.val??o??void 0)??null,C=_=>chunkDBOOTED4_cjs.Q(_,"spacing")??void 0,P=_=>{if(_===FP)return "";let L=chunkDBOOTED4_cjs.S(_),Z=ee=>Math.round(ee*100)/100;return L.rule==="auto"?`multiple:${Z(L.value/240)}`:`${L.rule}:${Z(L.value)}`},E=h(P),w=(()=>{if(!E)return null;let[_,L]=E.split(":");return {rule:_,value:Number(L)}})(),S=(_,L)=>{let Z=chunkWO4V6PNS_cjs.nd(C(_)?.[L]);return Z===null?null:Math.round(Z/20*100)/100},F=_=>h(L=>S(L,_)),A=(()=>{let _=B=>Dg(Sr(e,B))==="rtl",L=y.map(B=>{let q=Ng(e,B);return !q||!_(B)?q:{...q,indent:{...q.indent,left:q.indent.right,right:q.indent.left}}}),Z=L[0];if(!Z||L.some(B=>B===null||B.inTable))return null;let ee=_(y[0]),te=B=>Math.round(B*20),me=L,le=te(Z.indent.left),D=te(Z.indent.right),T=Jd(Z.indent);return {left:le,right:D,firstLine:T,mixed:{left:me.some(B=>te(B.indent.left)!==le),right:me.some(B=>te(B.indent.right)!==D),firstLine:me.some(B=>Jd(B.indent)!==T)},...ee?{rtl:ee}:{}}})(),$=_=>h(L=>_(chunkDBOOTED4_cjs.qd(L))),W=h(chunkDBOOTED4_cjs.J),U=h(chunkDBOOTED4_cjs.U);return {bold:c.length>0&&c.every(_=>_.bold),italic:c.length>0&&c.every(_=>_.italic),underline:c.length>0&&c.every(_=>_.underline!==null),strikethrough:c.length>0&&c.every(_=>_.strike),superscript:c.length>0&&c.every(_=>_.verticalAlign==="superscript"),subscript:c.length>0&&c.every(_=>_.verticalAlign==="subscript"),fontFamily:s.length>0?u(s.map(m)):b?.fontFamily??null,fontSizeHalfPoints:s.length>0?u(s.map(g)):b?.fontSizeHalfPoints??null,color:d(_=>_.color),highlight:d(_=>_.highlight),alignment:x,direction:k,styleId:R,lineSpacing:w,spaceBeforePt:F("before"),spaceAfterPt:F("after"),disagrees:{alignment:v(_=>chunkDBOOTED4_cjs.dd(_)),direction:v(Dg),spaceBeforePt:v(_=>S(_,"before")),spaceAfterPt:v(_=>S(_,"after")),lineSpacing:v(P),tabStops:(()=>{if(y.length<2)return false;let _=JSON.stringify(fl(e,y[0])?.stops??null);return y.some((L,Z)=>Z>0&&JSON.stringify(fl(e,L)?.stops??null)!==_)})()},indent:A,tabStops:u(y.map(_=>fl(e,_)?.stops??null),(_,L)=>_===null||L===null?_===L:_.length===L.length&&_.every((Z,ee)=>Math.round(Z.positionPt*20)===Math.round(L[ee].positionPt*20)&&Z.alignment===L[ee].alignment&&(Z.leader??"none")===(L[ee].leader??"none")))?.map(_=>({positionTwips:Math.round(_.positionPt*20),alignment:_.alignment,..._.leader?{leader:_.leader}:{}}))??null,paragraphFlags:{contextualSpacing:U,keepNext:$(_=>_.keepNext),keepLines:$(_=>_.keepLines),widowControl:$(_=>_.widowControl),pageBreakBefore:W}}}function AP(e,t,n,r){if(n&&n.length>0)return [...chunk5JPIEN54_cjs.la(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunkDBOOTED4_cjs.Ua(e),i=o.indexOf(t.anchor.paragraphId),a=o.indexOf(t.head.paragraphId);return i===-1||a===-1?[t.head.paragraphId]:o.slice(Math.min(i,a),Math.max(i,a)+1)}function HP(e,t,n,r){return t.paragraphId!==n.paragraphId?[]:t.offset!==0||n.offset!==e.length?[]:e.length===0?[]:[{op:"setParagraphMarkProperties",paragraphId:t.paragraphId,properties:r}]}function _P(e){let t=null,n=null,r=null,o=()=>t&&chunkWO4V6PNS_cjs.wi(e.session.part()).find(l=>l.root.id===t.id&&l.drawingNodeId===t.drawingNodeId),i=()=>{if(t&&!o()){a();return}for(let l of e.pagesLayer.querySelectorAll(".docx-drawing-textbox")){let c=l.dataset.drawingNodeId===t?.drawingNodeId;l.dataset.docxTextboxActive=String(c),l.contentEditable=c?"true":"false",l.setAttribute("role",c?"textbox":"img"),c?(l.removeAttribute("aria-hidden"),l.setAttribute("aria-multiline","true")):(l.removeAttribute("aria-multiline"),l.hasAttribute("aria-label")||l.setAttribute("aria-hidden","true"));for(let d of l.querySelectorAll("[data-textbox-paragraph-id]"))c?d.dataset.paragraphId=d.dataset.textboxParagraphId:delete d.dataset.paragraphId;}},a=(l=true)=>{t&&(e.flush(),t=null,r=null,i(),l&&n&&e.setSelection(n),n=null);},s=l=>{if(l.owner||!e.writable())return false;e.flush();let c=chunkWO4V6PNS_cjs.wi(e.session.part()).find(R=>R.root.id===l.id&&R.drawingNodeId===l.drawingNodeId&&R.hostParagraphId===l.hostParagraphId),d=c&&chunkWO4V6PNS_cjs.Ua(e.session.part(),c.root.id),u=d&&chunkWO4V6PNS_cjs.Ua(e.session.part(),d.id),f=u&&chunkWO4V6PNS_cjs.wd(u.children,{namespaceUri:chunkWO4V6PNS_cjs.ia,localName:"spPr"}),m=f&&chunkWO4V6PNS_cjs.wd(f.children,{namespaceUri:chunkWO4V6PNS_cjs.ra,localName:"xfrm"}),g=u&&chunkWO4V6PNS_cjs.wd(u.children,{namespaceUri:chunkWO4V6PNS_cjs.ia,localName:"bodyPr"}),b=m&&chunkWO4V6PNS_cjs.ka(m.attributes,"rot"),y=g&&chunkWO4V6PNS_cjs.ka(g.attributes,"rot"),h=g&&chunkWO4V6PNS_cjs.ka(g.attributes,"vert");if(b&&Number(b)!==0||y&&Number(y)!==0||h&&h!=="horz")return false;let v;for(let R of e.layout().pages)if(v=chunkDBOOTED4_cjs.Bd(R,l.drawingNodeId),v)break;if(!c||!v?.textboxStory||v.transform.rotationDegrees!==0||v.textboxStory.fragments.some(R=>R.kind!=="paragraph"))return false;let x=v.textboxStory.fragments[0];if(!x||x.kind!=="paragraph")return false;if(t?.id===l.id)return true;a(),e.leaveOtherStories(),n=e.selection(),t=l,r=null,i();let k={paragraphId:x.paragraphId,offset:x.range.start};return e.setSelection({anchor:k,head:k}),true};return {active:()=>t,replacementFormatOps(l,c,d){let{anchor:u,head:f}=e.selection();if(!t||d===0||u.paragraphId===f.paragraphId&&u.offset===f.offset)return [];let m=wa(e.session.part(),l,c);return m.length?[{op:"setRunProperties",paragraphId:l,start:c,end:c+d,properties:m}]:[]},enter:s,exit:a,syncDom:i,contains:l=>{let c=o();return !!c&&chunkWO4V6PNS_cjs.Rc(c.root).some(d=>d.id===l)},paragraphIds:()=>{let l=o();return l?chunkWO4V6PNS_cjs.Rc(l.root).map(c=>c.id):[]},caretInput(l){if(!t)return {};let c=t.drawingNodeId,d;for(let g of l.pages)if(d=chunkDBOOTED4_cjs.Bd(g,c),d)break;let u=d?.textboxStory,m=[...e.pagesLayer.querySelectorAll(".docx-drawing-textbox")].find(g=>g.dataset.drawingNodeId===c)?.querySelector(".docx-drawing-textbox-content");return !d||!u||!m?{}:{scopedHost:m,scopedHostKind:"textbox",scopedOrigin:{x:d.x+u.contentOffset.x,y:d.y+u.contentOffset.y}}},layout(l){if(!t)return l;if(r?.base===l&&r.id===t.id)return r.layout;let c=t.drawingNodeId,d={...l,pages:l.pages.map(u=>{let f=chunkDBOOTED4_cjs.Bd(u,c),m=f?.textboxStory;return {...u,header:void 0,footer:void 0,footnotes:void 0,endnotes:void 0,anchoredDrawings:[],fragments:f&&m?m.fragments.flatMap(g=>g.kind==="paragraph"?[chunkDBOOTED4_cjs.Pe(g,f.x+m.contentOffset.x,f.y+m.contentOffset.y)]:[]):[]}})};return r={base:l,id:t.id,layout:d},d},preparePointer(l){let d=l?.closest(".docx-drawing-textbox-content")?.closest("[data-drawing-node-id]")?.dataset.drawingNodeId,u=d&&chunkWO4V6PNS_cjs.wi(e.session.part()).find(f=>f.drawingNodeId===d);return u&&s({kind:"frame",id:u.root.id,drawingNodeId:u.drawingNodeId,hostParagraphId:u.hostParagraphId})?true:(a(false),false)}}}function BP(e,t,n){return (r,o)=>{let i=t(),a=n();return chunkWO4V6PNS_cjs.Xh(Ce(e,r)??e.part(),r,o,chunkYQWMI6J5_cjs.a(e.stylesRoot(),e.settingsRoot(),i,a),i,a)}}function Bg(e,t){e.setAttribute("aria-label",t?.("editor.documentContent")??i18n.en.editor.documentContent);}var $g="An external document refresh is in progress.",ml="rejected",eo="A preview is open. Commit or discard it before editing.",Sa=new WeakSet,pl=new WeakSet,$P=new WeakMap,Qn=e=>Sa.has(e)||pl.has(e),qP=e=>Sa.has(e),ka=e=>!Sa.has(e)&&pl.has(e)?eo:$g;function Eo(e,t){t?Sa.add(e):Sa.delete(e);}function qg(e,t){t?pl.add(e):pl.delete(e);}function WP(e,t){$P.set(e,t);}var nu=e=>$P.get(e)?.()??false,r6=new Set(["toggleReviewPane","toggleParagraphMarks","selectAll","setSelection","copyFormatting"]),Wg=(e,t)=>!Sa.has(e)&&pl.has(e)&&r6.has(t.type);function KP(e){let t="select[data-docx-form-dropdown]",n=c=>_t(c)?c.closest(t):null,r=c=>{let d=c.closest("[data-start][data-paragraph-id]"),u=d?.dataset.paragraphId;if(!d||!u)return null;let f=e.part(u),m=chunkWO4V6PNS_cjs.Ta(f,u);if(m?.kind!=="paragraph")return null;let g=Number(d.dataset.start),b=chunkWO4V6PNS_cjs.Wi(m).find(h=>h.start<=g&&g<h.end);if(!b)return null;let y={op:"setLegacyDropdown",paragraphId:u,fieldNodeId:b.fieldNodeId,selectedIndex:c.selectedIndex};return {field:b,paragraphId:u,op:y,enabled:e.editable()&&e.canApply(y)&&chunkWO4V6PNS_cjs.Cj(e.settings(),y)===null&&chunkWO4V6PNS_cjs.ol(f,y)===null}},o=()=>{for(let c of e.pagesLayer.querySelectorAll(t))c.disabled=!r(c)?.enabled;},i=c=>{let d=n(c.target);d&&(c.stopPropagation(),r(d)?.enabled||c.preventDefault());},a=c=>{let d=n(c.target);d&&(d.disabled=!r(d)?.enabled);},s=c=>{let d=n(c.target);if(!d)return;c.stopPropagation();let u=r(d);if(!u)return;if(!u.enabled||!e.apply(u.op)){d.selectedIndex=u.field.selectedIndex;return}e.select({anchor:{paragraphId:u.paragraphId,offset:u.field.start},head:{paragraphId:u.paragraphId,offset:u.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(m=>{let g=m.closest("[data-start][data-paragraph-id]");return g?.dataset.paragraphId===u.paragraphId&&Number(g.dataset.start)===u.field.start})?.focus({preventScroll:true});},l=new(Ze(e.pagesLayer)).MutationObserver(c=>{for(let d of c)for(let u of d.addedNodes){if(!_t(u))continue;let f=u.matches(t)?[u]:u.querySelectorAll(t);for(let m of f)m.disabled=!r(m)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",i,true),e.pagesLayer.addEventListener("focusin",a),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(c){let d=n(c.target);if(!d)return false;c.stopPropagation();let u=c.key.toLowerCase();return (c.ctrlKey||c.metaKey)&&!c.altKey&&(u==="z"||u==="y")?(c.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(u==="y"||c.shiftKey?"redo":"undo"),true):(!r(d)?.enabled&&c.key!=="Tab"&&c.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",i,true),e.pagesLayer.removeEventListener("focusin",a),e.pagesLayer.removeEventListener("change",s);}}}function jP(e,t){let n=chunkWO4V6PNS_cjs.Ua(e,t.id);for(let i=0;n&&i<64&&(n.namespaceUri===chunkWO4V6PNS_cjs.la&&n.localName==="customXml"||chunkWO4V6PNS_cjs.Uc(n)||chunkWO4V6PNS_cjs.Vc(n));i+=1)n=chunkWO4V6PNS_cjs.Ua(e,n.id);if(!n)return [];let r=chunkWO4V6PNS_cjs.Yc(n.children),o=r.findIndex(i=>i.id===t.id);return o>=2?r.slice(o-2,o):[]}function VP(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==chunkWO4V6PNS_cjs.la?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function UP(e,t,n,r,o,i,a,s){let l=chunkWO4V6PNS_cjs.Ta(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[c,d]=jP(e,l);if(d?.kind!=="paragraph"||c?.kind!=="paragraph"||!VP(d))return null;let u=chunkDBOOTED4_cjs.Sa(t,l.id),f=chunkDBOOTED4_cjs.Sa(t,c.id);if(!u||u.numId!==f?.numId||u.level!==f.level||chunkDBOOTED4_cjs.Sa(t,d.id))return null;let m=(C,P,E,w)=>({id:C,kind:P,localName:E,namespaceUri:chunkWO4V6PNS_cjs.la,prefix:"w",namespaceBindings:[],attributes:[],children:w}),g=l.children.find(C=>C.kind==="paragraphProperties"),b=g&&{...g,children:g.children.filter(C=>C.localName!=="sectPr")},y=chunkWO4V6PNS_cjs.Vi({localName:"pStyle",attributes:{val:o}},"separator-style"),h=r.map((C,P)=>chunkWO4V6PNS_cjs.Vi(C,`separator-format-${P}`));a&&h.push(chunkWO4V6PNS_cjs.Vi({localName:"ins",attributes:{id:chunkWO4V6PNS_cjs.xh(e,s)(),author:a.author,...a.date?{date:a.date}:{}}},"separator-insertion"));let v=m("separator-mark","runProperties","rPr",h),x=m("separator-properties","paragraphProperties","pPr",[...y?[y]:[],...h.length?[v]:[]]),k=[...x.children],R=i?.styles.has(o)?x:m("separator-defaults","paragraphProperties","pPr",[]);return i&&chunkDBOOTED4_cjs.yc(chunkDBOOTED4_cjs.ld(i,R).paragraphPropertyNodes)&&k.splice(y?1:0,0,m("separator-numbering","generic","numPr",[chunkWO4V6PNS_cjs.Vi({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[m("separator-head","paragraph","p",b?[b]:[]),m("separator-blank","paragraph","p",[m("separator-properties-final","paragraphProperties","pPr",k)])],lastMarkCovered:true}}function zP(e,t=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:t})??false}function Kg(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}var GP=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve","revision-attribution"]);var o6="list paragraph",i6="ListParagraph";function ZP(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function ru(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===o6)return n.styleId;t===null&&n.styleId===i6&&(t=n.styleId);}return t}function XP(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:chunkDBOOTED4_cjs.kd(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o){let i=ru(t.documentStyles());if(i===null)return [];let a=r(),s=e.storyPart(),l=[];for(let c of o){let d=chunkWO4V6PNS_cjs.Nh(s,c),u=ZP(d);u!==void 0&&u!==a||l.push({op:"setParagraphProperties",paragraphId:c,properties:chunkWO4V6PNS_cjs.Ph(d,{localName:"pStyle",attributes:{val:i}})});}return l},clearOp(o){let i=ru(t.documentStyles());if(i===null)return null;let a=chunkWO4V6PNS_cjs.Nh(e.storyPart(),o);return ZP(a)!==i?null:{op:"setParagraphProperties",paragraphId:o,properties:a.filter(s=>s.localName!=="pStyle")}}}}function YP(e,t){return n=>{let r=chunkWO4V6PNS_cjs.bd(n),o=r?.name??"/word/styles.xml",i="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",a=r?null:chunkWO4V6PNS_cjs.Ia('<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>',{name:o,contentType:i}),s=r??(a?.ok?a.part:null);if(!s)throw new Error("Cannot create list paragraph style");if(s.root.children.some(g=>g.kind!=="textValue"&&g.attributes.some(b=>b.localName==="styleId"&&b.value===t)))return n;let l=chunkWO4V6PNS_cjs.Ra(s),c=(g,b={},y=[])=>({...chunkWO4V6PNS_cjs.Vi({localName:g,attributes:b},l()),children:y,...g==="pPr"?{kind:"paragraphProperties"}:{}}),u={...c("style",{type:"paragraph",styleId:t},[c("name",{val:"List Paragraph"}),...e?[c("basedOn",{val:e})]:[],c("uiPriority",{val:"34"}),c("qFormat"),c("pPr",{},[c("ind",{left:"720"}),c("contextualSpacing")])]),namespaceBindings:[{prefix:"w",namespaceUri:chunkWO4V6PNS_cjs.la}]};if(r){let g=chunkWO4V6PNS_cjs.Ya(s,s.root.id,s.root.children.length,[u]);if(!g.ok)throw new Error("Cannot insert list paragraph style");return chunkWO4V6PNS_cjs.Ie(n,g.part)}let f=chunkWO4V6PNS_cjs.Se(n,o,{...s.root,children:[u]},i);f=chunkWO4V6PNS_cjs.Qe(f,n.mainDocumentPart);let m=chunkWO4V6PNS_cjs.Re(f,n.mainDocumentPart,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",o);if(!m.ok)throw new Error("Cannot link list paragraph style");return m.pkg}}function ou(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",i,true),n.removeEventListener("keydown",a,true);},i=s=>{if(e.parentNode===null){o();return}let l=s.target,c=_t(l)?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||c?.getAttribute("data-docx-cc-id")===r)||(o(),t());},a=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",i,true),n.addEventListener("keydown",a,true),o}function QP(e,t,n,r,o){let a=chunkDBOOTED4_cjs.re(e).find(u=>u.id===n)?.fragments[0],s=a?e.pages[a.pageIndex]:void 0;if(!a||!s)return null;let l=o?.get(a.pageIndex)??0,c=s.contentBox.x-s.box.x,d=s.contentBox.y-s.box.y;return {left:(s.box.x+l+c+a.box.x)*t,top:(s.box.y+d+a.box.y+a.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function JP(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(JP).join("")}function jg(e,t){let n=e?JP(e):"";return t.find(r=>r.displayText===n)?.value??n}function eT(e){let t=e?.children.find(n=>n.kind!=="textValue"&&n.localName==="sdtPr");if(!(!t||t.kind==="textValue")){for(let n of t.children)if(n.kind!=="textValue"){if(n.localName==="dropDownList")return "dropdown";if(n.localName==="comboBox"||n.localName==="date")return n.localName;if(n.localName==="checkbox")return "checkbox";if(n.localName==="picture")return "picture";if(n.localName==="docPartList")return "buildingBlockGallery"}}}var a6=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function tT(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,i){if(r(),n||!e.request||!a6.includes(i))return false;let a=new AbortController;t={controller:a,id:o};let s=()=>!n&&t?.controller===a&&!a.signal.aborted,l=()=>s()&&eT(e.find(o))===i&&e.allowed(o),c=e.find(o),d=e.items(o).map(b=>({...b})),u=jg(c,d),f=i==="picture"?e.picture(o):void 0;if(i==="picture"&&!f)return r(),false;let m=false,g={controlId:o,kind:i,items:d,value:i==="date"?e.date(o)??"":i==="checkbox"?String(e.checked(o)):i==="picture"?f:i==="buildingBlockGallery"?"":u,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(b=>b.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:a.signal,canApply:l,apply(b){return i==="picture"||!l()||!e.apply(o,b)?false:(s()&&r(),true)},cancel(){s()&&r();},...i==="picture"?{async replaceImage(b){if(m||!l())return false;m=true;try{return await e.replaceImage(o,b,()=>l()&&e.picture(o)===f)?(s()&&r(),!0):!1}finally{m=false;}}}:{}};return e.setOpen(o,true),e.request(g)?true:(g.cancel(),false)}}}function nT(e,t){if(!e)return [];if(t&&oT(e))return chunkWO4V6PNS_cjs.Ng(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let i of r.children){if(i.kind==="textValue"||i.localName!=="listItem")continue;let a=i.attributes.find(l=>l.localName==="value")?.value??"",s=i.attributes.find(l=>l.localName==="displayText")?.value??a;o.push({displayText:s,value:a});}return o}return []}function rT(e){if(e){for(let t of e.children)if(t.kind==="contentControlProperties"){for(let n of t.children)if(n.kind==="contentControlDate")return n.attributes.find(r=>r.localName==="fullDate")?.value}}}function oT(e){return eT(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function iT(e,t,n,r){if(!e||!oT(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=chunkWO4V6PNS_cjs.Ng(t(),e).filter(a=>a.name===r),i=o.length===1?o[0]:void 0;return i?[{op:"insertBuildingBlock",controlId:n,name:i.name,blocks:i.blocks}]:null}function aT(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!chunkWO4V6PNS_cjs.ti(e.settingsRoot()).doNotShadeFormData),n}}var Ia="switch to field results before editing a form value";function sT(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let i of [n,r]){let a=e(i.paragraphId),s=a&&chunkWO4V6PNS_cjs.Ta(a,i.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):i.offset,c=o?Math.max(n.offset,r.offset):i.offset,d=chunkWO4V6PNS_cjs.mg(s);if(chunkWO4V6PNS_cjs.Kf(s).filter(f=>f.addressing==="editable-result").map(f=>{let m=d.spanOf(f.node)?.start??0,g=m;for(let b of f.removeNodeIds)g=Math.max(g,d.spanOf(b)?.end??g);return {start:m,end:g}}).some(f=>l===c?l>=f.start&&(l<f.end||f.start===f.end):l<f.end&&c>f.start))return true}return false}function lT(e,t,n,r){let o=e.contentControlId?chunkDBOOTED4_cjs.re(t).find(d=>d.id===e.contentControlId):void 0,i=Qr(n).filter(d=>d.toc.id===e.id),a=i.some(d=>d.start>0||d.end<d.length);if(o&&!a)return {tocId:e.id,boundary:o,additional:false};let s=new Map(i.map(d=>[d.paragraphId,d])),l=i.filter(d=>d.start>0||d.end<d.length).flatMap(d=>chunkDBOOTED4_cjs.xe(t,{anchor:{paragraphId:d.paragraphId,offset:d.start},head:{paragraphId:d.paragraphId,offset:d.end}},[d.paragraphId],r)),c=t.pages.flatMap(d=>{let u=chunkDBOOTED4_cjs.za(d).filter(y=>{let h=s.get(y.paragraphId);return h&&h.start===0&&h.end===h.length}).map(chunkDBOOTED4_cjs.Hd);if(u.push(...l.filter(y=>y.pageIndex===d.index)),u.length===0)return [];let f=Math.min(...u.map(y=>y.x)),m=Math.min(...u.map(y=>y.y)),g=Math.max(...u.map(y=>y.x+y.width)),b=Math.max(...u.map(y=>y.y+y.height));return [{pageIndex:d.index,box:{x:f,y:m,width:g-f,height:b-m}}]});return c.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:c}}}var cT=new WeakMap;function dT(e,t,n,r){cT.set(e,o=>{let i=t();e.flushPendingInput();try{n(o),r();}catch(a){throw n(i),r(),a}});}function uT(e,t){let n=cT.get(e);if(!n)throw new Error("Surface does not support measurement updates");n(t);}var iu=new WeakMap;function fT(e){if(e.host){e.status.replaceChildren();return}let t=e.status.ownerDocument.createElement("span");t.className="docx-editor__loading-spinner",t.setAttribute("aria-hidden","true"),e.status.replaceChildren(t);}function pT(e,t){let n=t.ownerDocument,r=n.createElement("div");r.className="docx-opening-indicator",r.contentEditable="false";let o=n.createElement("div");o.className="docx-editor__loading-page-status",o.setAttribute("role","status"),r.append(o);let i={frame:r,status:o,host:null};iu.set(e,i),fT(i);let a=()=>{let s=t.querySelector(':scope > .docx-pages > .docx-page[data-page-index="0"]');r.hidden=!s,s&&(r.style.left=s.style.left,r.style.top=s.style.top,r.style.width=s.style.width,r.style.height=s.style.height);};return t.append(r),a(),{place:a,remove:()=>{iu.get(e)===i&&(iu.delete(e),r.remove(),i.host?.publish(null));}}}function Vg(e,t){let n=iu.get(e);if(!n||n.host===t)return;let r=n.host;n.host=t,r?.publish(null),fT(n),t?.publish(n.status);}var au=new WeakMap;function l6(e,t){au.set(e,t);}function Ra(e,t){let n=au.get(e);if(!n)return true;let r=n(t);return r&&au.delete(e),r}function bi(e){return au.has(e)}var c6=15e4,d6=16,gT=4096;function u6(e,t,n){let r=0,o=e;for(;o<t&&o-e<gT&&(o-e<d6||r<c6);)r+=f6(n(o)),o+=1;return o}var mT=new WeakMap;function f6(e){if(typeof e!="object"||e===null)return 1;let t=mT.get(e);if(t!==void 0)return t;let n=1,r=[e];for(;r.length>0;){let o=r.pop();if(o.kind==="textValue")n+=o.value?.length??0;else if(o.children)for(let i of o.children)r.push(i);}return mT.set(e,n),n}function hT(e,t,n,r){let o=r,i=null,a=()=>{let l=i;i=null,l&&chunkDBOOTED4_cjs.jf(l);},s=l=>{let c=n.now()+l;for(;n.limit()!==null&&!n.destroyed();){if(!i){let u=n.limit(),f=n.bodyBlockCount();if(f!==void 0&&u>=f)return n.finish(),true;let m=f===void 0?u+o:u6(u,f,g=>n.bodyBlock(g));n.setLimit(m),i=n.prefixPass(m);}let d=false;do d=i.next().done===true;while(!d&&n.now()<c);if(!d||(i=null,o=Math.min(gT,o*2),n.now()>=c))return false}return true};if(t.removeAttribute("data-docx-opening-preview"),n.limit()!==null){t.setAttribute("data-docx-opening-preview","");let l=pT(e,t);l6(e,c=>{let d=s(c);return d?(t.removeAttribute("data-docx-opening-preview"),l.remove()):l.place(),d});}return a}var p6=40,m6=12,g6=8;function Ug(e,t){if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);return}(t??globalThis).setTimeout(e,0);}function y6(e,t){let n=t??globalThis;if(typeof n.requestAnimationFrame=="function"){n.requestAnimationFrame(()=>Ug(e,t));return}Ug(e,t);}function yT(e){let t=null,n=0,r=(l,c)=>{l&&e.passTimed?.(c);},o=l=>{let c=t===null!=(l===null);t=l,c&&e.pendingChanged?.(l!==null);},i=(l,c)=>{e.revision()===c&&e.publish(l);},a=()=>{let l=t;if(!l)return;let c=e.now(),d=c+m6;for(;;){let u=l.steps.next();if(!u.done&&u.value?.wrapUp&&(l.wrapUp=u.value.wrapUp),u.done){o(null),i(u.value,l.revision),r(l.timed,l.spent+e.now()-c);return}if(e.now()>=d)break}l.spent+=e.now()-c,Ug(a,e.view?.());},s=()=>{let l=t;if(!l)return;let c=e.now();o(null),i(chunkDBOOTED4_cjs.jf(l.steps),l.revision),r(l.timed,l.spent+e.now()-c);};return {run(l,c,d=true){let u=e.snapshot(),f=e.now(),m=d?n:0;d&&(n=0);let g=f+p6,b=e.pageAfterView(),y=e.current(),h=null;for(;;){let v=l.next();if(v.done)return r(d,m+e.now()-f),v.value;if(v.value&&(h=v.value),b===void 0||!h?.finalize||h.pages.length<=b||e.now()<g||!y||y.pages.length-h.pages.length<g6)continue;let x=[...h.pages,...y.pages.slice(h.pages.length)];return o({steps:l,revision:c,restore:u,spent:m+e.now()-f,timed:d,restorable:h.restorable!==false,wrapUp:h.wrapUp}),y6(a,e.view?.()),h.finalize(x)}},finish:s,abandon(){let l=t;if(l){if(!l.restorable)return l.wrapUp?.(),s();o(null),l.restore(),l.timed&&(n+=l.spent);}},pending:()=>t!==null,cancel(){o(null);}}}var b6=1e3,v6=12,bT=100;function vT(e,t){let n=o=>{let i=o.fragments[0];if(!i)return "";let a=i.kind==="paragraph"?i.lines[0]:void 0;return `${i.id}:${a?.range.start??""}`},r=o=>(o.footnotes?.notes??[]).map(i=>`${i.noteId}${i.continuation?"c":""}:${i.box.height}`).join(",");return `${e.pages.map(o=>`${n(o)}/${r(o)}`).join("|")}#${chunkDBOOTED4_cjs.Bf(t)}`}function xT(e){let t=null,n=false,r=false,o=null,i=()=>{t?.(),t=null;},a=(l,c)=>{i(),!r&&(t=e.schedule(()=>{t=null,r||l();},c));},s=()=>{if(e.busy())return a(s,bT);let l=e.live().notePageBottomReserves,c=e.current();if(!l||!c)return;let d=vT(c,l);if(d===o)return;let u=e.revision(),f=e.createSession(),m=e.pass(u,f),g=()=>{if(e.revision()!==u)return;let y=e.now()+v6;for(;;){let h=m.next();if(h.done)return b(h.value);if(e.now()>=y)break}a(g,0);},b=y=>{if(e.revision()!==u)return;if(e.busy())return a(()=>b(y),bT);let h=e.live().notePageBottomReserves,v=f.notePageBottomReserves??new Map;if(h&&chunkDBOOTED4_cjs.Af(h,v)){o=d;return}n=true;try{e.adopt(f,y);}finally{n=false;}o=vT(y,v);};g();};return {request(){n||r||a(s,b6);},cancel(){r=true,i();}}}var x6=1e4;function wT(e){let t=null,n=()=>{let a=[],s=new Set([e.part()]);for(let l of e.headerFooterPartsBySection())for(let c of [l.headers,l.footers])for(let d of c.values())s.has(d)||(s.add(d),a.push(d));for(let l of ["footnote","endnote"]){let c=e.partFor({kind:"notesPart",noteKind:l});!c||s.has(c)||(s.add(c),a.push(c));}return a},r=(a,s)=>a.length===s.length&&a.every((l,c)=>l===s[c]),o=a=>{let s=chunkWO4V6PNS_cjs.Ta(e.part(),a);if(!s||s.kind!=="paragraph")return false;let l=0,c=[...s.children];for(;c.length>0;){let d=c.pop();if(++l>x6)return false;if(d.kind!=="textValue"){if(d.namespaceUri===chunkWO4V6PNS_cjs.la&&d.localName==="p")return false;for(let u of d.children)c.push(u);}}return true},i=(a,s)=>{if(a.splitJoin.length!==1||a.story!==void 0&&a.story.kind!=="body")return false;let l=a.splitJoin[0];if("split"in l){let{from:u,tail:f}=l.split,m=s.get(u);if(m===void 0||s.has(f)||a.deleted.length>0||a.created.length!==1||a.created[0]!==f||!o(u)||!o(f))return false;for(let[g,b]of s)b>m&&s.set(g,b+1);return s.set(f,m+1),true}let{kept:c,removed:d}=l.join;return !s.has(c)||a.created.length>0||a.deleted.length!==1||a.deleted[0]!==d||!o(c)?false:(s.delete(d),true)};return {retain(a){if(!t)return;let s=a.created.length>0||a.deleted.length>0||a.splitJoin.length>0,l=a.impact==="text-local"&&!s?t.otherParts:n();a.impact!=="global"&&(a.impact==="text-local"||r(t.otherParts,l))&&(!s||r(t.otherParts,l)&&i(a,t.index))?t={packageRevision:e.packageRevision(),bodyRoot:e.part().root,index:t.index,otherParts:l}:t=null;},index(){let a=e.packageRevision(),s=e.part().root;if(t&&t.packageRevision===a&&t.bodyRoot===s)return t.index;let l=new Map,c=u=>{let f=l.size;for(let[m,g]of u)l.has(m)||l.set(m,f+g);};c(chunkWO4V6PNS_cjs.Aj(e.part()));let d=n();for(let u of d)c(chunkWO4V6PNS_cjs.Aj(u));return t={packageRevision:a,bodyRoot:s,index:l,otherParts:d},l}}}var w6=`revision-${chunkWO4V6PNS_cjs.Nj}`,Pa=new WeakMap;function Ta(e){return e?Pa.get(e)??null:null}function su(e){let t=Pa.get(e);return t?[e,t.deletion,t.insertion]:[e]}var S6=chunkWO4V6PNS_cjs.Pj,ST=new WeakMap;function k6(e,t){let n=ST.get(e);if(n&&Pa.get(n)?.insertion===t)return n;let r=t.date??e.date,o={kind:"revision",id:chunkWO4V6PNS_cjs.Oj(e.id,t.id),address:e.address,addresses:[...e.addresses,...t.addresses],replacedText:e.text,revisionKind:"replace",author:t.author,...r!==void 0?{date:r}:{},text:t.text,ranges:[...e.ranges,...t.ranges],nesting:e.nesting,replacedRangeCount:e.ranges.length,readOnly:e.readOnly||t.readOnly,replyIds:[...e.replyIds,...t.replyIds]};return Pa.set(o,{deletion:e,insertion:t}),ST.set(e,o),chunkWO4V6PNS_cjs.Kj(o,[...chunkWO4V6PNS_cjs.Lj(e),...chunkWO4V6PNS_cjs.Lj(t)])}function RT(e){let t=e.filter(a=>a.kind==="revision"),n=new Map,r=new Set,o=new Map;for(let a=0;a+1<t.length;a+=1){let s=t[a],l=t[a+1];if(!S6(s,l))continue;let c=k6(s,l);n.set(s,c),r.add(l),o.set(s.id,c.id),o.set(l.id,c.id),a+=1;}if(n.size===0)return {items:e,renamed:o};let i=[];for(let a of e)r.has(a)||i.push(n.get(a)??a);return {items:i,renamed:o}}function PT(e,t){let n=`${zg(t)}|${[...t?.excludeRevisionKinds??[]].sort().join(",")}`,r=kT.get(e),o=r?.get(n);if(o)return o;let i=I6(e,t);return r||kT.set(e,r=new Map),r.set(n,i),i}var kT=new WeakMap;function I6(e,t){let n=new Set(t?.excludeRevisionKinds??[]),r=s=>s.kind!=="revision"||!n.has(s.revisionKind),o=n.size>0?e.filter(r):e,i=new Map;if(zg(t)){let s=RT(o);i=s.renamed,o=n.size>0?s.items.filter(r):s.items;}if(n.size===0&&i.size===0)return o;let a=new Set(o.filter(s=>s.kind==="revision").map(s=>s.id));return o.map(s=>{if(s.kind!=="comment"||s.parentRevisionId===void 0)return s;let l=i.get(s.parentRevisionId)??s.parentRevisionId;if(a.has(l))return l===s.parentRevisionId?s:{...s,parentRevisionId:l};let{parentRevisionId:c,...d}=s;return d})}function lu(e,t,n){if(t===null)return new Set;let r=n?R6(e(),t):null;return new Set(r===null?[t]:[t,r])}function R6(e,t){for(let n of RT(e).items){let r=Pa.get(n);if(!r)continue;let o=chunkWO4V6PNS_cjs.Mj(r.deletion),i=chunkWO4V6PNS_cjs.Mj(r.insertion);if(o===t)return i;if(i===t)return o}return null}function TT(e,t){let n=null;return {set:r=>n=r,lightsPair:()=>e()||n!==null&&t()?.activatedReviewKey()===n}}function zg(e){return e?.pairReplacements!==false}function vi(e){return e.startsWith(w6)}function kr(e,t){let n={placement:false,pairReplacements:vi(t)};return e(n).find(r=>r.key===t)}function cu(e){let t=Pa.get(e);return t?[chunkWO4V6PNS_cjs.Mj(t.deletion),chunkWO4V6PNS_cjs.Mj(t.insertion)]:[chunkWO4V6PNS_cjs.Mj(e)]}function Gg(e,t,n){return t===null||!zg(n)?t:e({...n,placement:false}).find(o=>vi(o.key)&&cu(o.item).includes(t))?.key??t}function Zg(e,t){let n=vi(t.key)?t.key:Gg(e,t.key,{pairReplacements:true});return n!==null&&vi(n)?{...t,pairKey:n}:t}var IT=new WeakMap;function ET(e){let t=IT.get(e);if(!t){let n=new Map;for(let r of e)n.set(chunkWO4V6PNS_cjs.Mj(r),r);IT.set(e,t=n);}return t}var E6=i18n.createT(i18n.en);function Ln(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return E6(t)}}var CT=new WeakMap;function du(e,t){let n=new Map;return CT.set(e,n),(r,o,i="textContent")=>{let a=n.get(r);a||n.set(r,a=new Map),a.set(i,o),i==="textContent"?r.textContent=t(o):r.setAttribute(i,t(o));}}function OT(e,t){let n=CT.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[i,a]of o)i==="textContent"?r.textContent=t(a):r.setAttribute(i,t(a));}}function MT(e,t){let n=e.ownerDocument.defaultView;if(!n)return;if(n.getComputedStyle(e).position==="fixed"){let E=t.getBoundingClientRect();e.style.maxHeight="";let w=Number.parseFloat(n.getComputedStyle(e).maxHeight),S=Number.isFinite(w)?w:n.innerHeight;e.style.maxWidth=`${Math.max(0,n.innerWidth-16)}px`,e.style.maxHeight=`${Math.max(0,Math.min(S,n.innerHeight-16))}px`;let F=e.getBoundingClientRect(),A=Math.max(0,n.innerHeight-8-E.bottom-4),$=Math.max(0,E.top-8-4),W=F.height>A&&$>A,U=Math.min(F.height,W?$:A);e.style.maxHeight=`${U}px`,e.style.left=`${Math.max(8,Math.min(E.left,n.innerWidth-8-F.width))}px`;let _=W?E.top-4-U:E.bottom+4;e.style.top=`${Math.max(8,Math.min(_,n.innerHeight-8-U))}px`,e.dataset.placement=W?"top":"bottom";return}let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),i=t.closest(".docx-page")?.getBoundingClientRect(),a=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,i?.left??0,a?.left??0),l=Math.min(n.innerWidth,i?.right??n.innerWidth,a?.right??n.innerWidth),c=Math.max(0,a?.top??0),d=Math.min(n.innerHeight,a?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,d-c)}px`;let u=e.getBoundingClientRect(),f=d-o.bottom,m=o.top-c,g=u.height>f&&m>f,b=Math.max(0,g?m:f);e.style.maxHeight=`${Math.max(0,Math.min(d-c,b))}px`;let y=Math.min(u.height,b),h=Math.max(s,Math.min(o.left,l-u.width)),v=Math.max(c,g?o.top-y:o.bottom),x=r.getBoundingClientRect(),k=r.offsetWidth?x.width/r.offsetWidth:1,R=r.offsetHeight?x.height/r.offsetHeight:1;e.style.left=`${(h-x.left)/k-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(v-x.top)/R-r.clientTop+r.scrollTop}px`,e.dataset.placement=g?"top":"bottom";}function gl(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,i=t,a=()=>{if(!i.isConnected&&r&&o){let c=[...r.querySelectorAll("[data-docx-content-control]")].find(d=>d.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");c&&(s?.unobserve(i),i=c,s?.observe(i));}i.isConnected&&MT(e,i);},s=typeof n?.ResizeObserver=="function"?new n.ResizeObserver(a):null;s?.observe(e),s?.observe(i);let l=typeof n?.MutationObserver=="function"?new n.MutationObserver(a):null;return r&&l?.observe(r,{childList:true,subtree:true}),a(),n?.addEventListener("resize",a),e.ownerDocument.addEventListener("scroll",a,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",a),e.ownerDocument.removeEventListener("scroll",a,true);}}function hl(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(a=>a.tabIndex>=0&&!a.hasAttribute("disabled")&&!a.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(a).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,i=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;i&&(t.preventDefault(),i.focus());}function C6(e){let t=e?.ownerDocument??(typeof globalThis.document>"u"?null:globalThis.document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var Xg="image/png,image/jpeg,image/gif,image/bmp,image/webp",O6=new Set(Xg.split(",")),M6=8;function A6(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>M6)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let i=t(o,r+1);if(i)return i}}};return t(e,0)}function AT(e){let t=null,n=null,r=null,o,i,a=0,s=false,l=()=>{a++,o?.(),i?.(),r?.remove(),r=null;let u=n;t?.remove(),t=null,n=null,u&&(e.setOpen(u,false),s||e.layer.focus({preventScroll:true}));},c=u=>A6(e.find(u)),d=async(u,f,m=()=>true)=>{if(s||!m()||!e.allowed(u))return false;if(f.byteLength>chunkWO4V6PNS_cjs.r.maxEncodedBytes)return e.reject("image-resource-limit"),false;let g=c(u);if(!g)return e.reject("no-picture"),false;let b=chunkWO4V6PNS_cjs.fe(f);if(!O6.has(b))return e.reject("unsupported-image"),false;let y=await e.replaceImage(g,f,b,()=>!s&&m()&&e.allowed(u)&&c(u)===g);return y.ok?true:(e.reject(y.detail??y.reason),false)};return {drawingOf:c,replace:d,cancel:l,select(u){let f=c(u),m=f?chunkDBOOTED4_cjs.ie(e.layout(),f):null;return m?e.selectDrawing(f,m.record.paragraphId):false},pick(u){if(l(),s||!e.allowed(u))return;let f=a,m=()=>!s&&a===f;if(!c(u)){e.reject("no-picture");return}let g=e.document.createElement("input");g.type="file",g.accept=Xg,g.className="docx-content-control-picture-picker",g.dataset.docxMarker="",g.dataset.docxCcId=u,g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.tabIndex=-1;let b=Ln(e.translate),y=e.document.createElement("div");y.className="docx-content-control-menu",y.style.position="absolute",y.style.zIndex="20",y.style.pointerEvents="auto",y.dataset.docxCcId=u,y.dataset.docxMarker="",y.setAttribute("role","dialog"),y.setAttribute("aria-label",b("contentControl.types.picture")),y.setAttribute("contenteditable","false"),y.hidden=true;let h=e.document.createElement("div");h.className="docx-content-control-widget-error",h.setAttribute("role","alert"),h.textContent=b("disabledReason.invalidValue");let v=e.document.createElement("button");v.type="button",v.textContent=b("common.cancel"),v.addEventListener("click",l),y.addEventListener("pointerdown",x=>x.stopPropagation()),y.addEventListener("keydown",x=>{hl(y,x,l),x.stopPropagation();}),y.append(h,v),g.addEventListener("change",()=>{let x=g.files?.[0];!x||!m()||(g.value="",g.disabled=true,(async()=>{let k=false;try{x.size>chunkWO4V6PNS_cjs.r.maxEncodedBytes?e.reject("image-resource-limit"):k=await d(u,new Uint8Array(await x.arrayBuffer()),m);}catch{m()&&e.reject("image-read-failed");}if(!m())return;if(k){l();return}g.disabled=false,g.className="docx-content-control-picture-input",g.removeAttribute("aria-hidden"),g.tabIndex=0,g.setAttribute("aria-label",b("contentControl.types.picture")),g.setAttribute("aria-invalid","true"),y.prepend(g),y.hidden=false;let R=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(C=>C.getAttribute("data-docx-content-control")===u)?.querySelector(".docx-content-control-boundary");i?.(),o?.(),R&&(i=gl(y,R)),o=ou(y,l),g.focus();})());}),g.addEventListener("cancel",l),e.layer.append(g),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(y),r=y,t=g,n=u,e.setOpen(u,true),g.click();},destroy(){s=true,l();}}}function FT(e,t,n,r){return (chunkWO4V6PNS_cjs.Nk(e,t,n)?.offset??n)+r}function LT(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!e.bound&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function DT(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}var F6=22,Yg=3;function L6(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let i of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let a of i.querySelectorAll(".docx-content-control-boundary")){let s=a.getBoundingClientRect();if(t>=s.left-Yg&&t<=s.right+F6&&n>=s.top-Yg&&n<=s.bottom+Yg)return i}return null}function NT(e){let t=null,n=ut(()=>e),r=0,o=null,i=c=>{c!==t&&(t?.isConnected&&delete t.dataset.hover,t=c,c&&(c.dataset.hover=""));},a=()=>{r=0,o&&i(L6(e,o.x,o.y));},s=c=>{o={x:c.clientX,y:c.clientY},n.migrate(),r===0&&(r=n.requestAnimationFrame(a));},l=()=>{o=null,i(null);};return e.addEventListener("pointermove",s),e.addEventListener("pointerleave",l),{destroy(){e.removeEventListener("pointermove",s),e.removeEventListener("pointerleave",l),n.cancelAnimationFrame(r),i(null);}}}var yl=.25;function HT(e,t,n){let r=(s,l)=>{let c=chunkDBOOTED4_cjs.qe(e,s,n);return c?chunkDBOOTED4_cjs.ne(e,{x:c.x+l,y:c.y+c.height/2,pageIndex:c.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return r(t.head,-yl);let a=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,a?yl:-yl)??r(t.anchor,a?-yl:yl)}function _T(e,t,n,r,o){let i=r==="left"?-1:1,a=chunkDBOOTED4_cjs.qe(e,t.from,o),s=chunkDBOOTED4_cjs.qe(e,t.to,o),l=a?chunkDBOOTED4_cjs.le(e,a)??1:1,c=i*l===-1?t.from:t.to;if(!a||!s||a.lineId!==s.lineId||a.pageIndex!==s.pageIndex)return c;let d=chunkDBOOTED4_cjs.xd(e,t.from.paragraphId)?.find(({line:g})=>g.id===a.lineId)?.line;if(!d?.spans.some(g=>g.style.shaping))return c;let u=n.indexOf(t.from.paragraphId),f=n.indexOf(t.to.paragraphId),m;for(let g of d.spans){let b=g.range.paragraphId,y=n.indexOf(b);if(y<u||y>f)continue;let h=Math.max(g.range.start,b===t.from.paragraphId?t.from.offset:0),v=Math.min(g.range.end,b===t.to.paragraphId?t.to.offset:1/0);if(!(h>=v))for(let x of [h,v]){let k={paragraphId:b,offset:x},R=chunkDBOOTED4_cjs.qe(e,k,o);if(!R||R.lineId!==a.lineId||R.pageIndex!==a.pageIndex)continue;let C=R.x;(!m||(C-m.x)*i>0)&&(m={position:k,x:C});}}return m?.position??c}function BT(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function $T(e,t,n,r){let o=Ln(r),i=e.ownerDocument,a=i.createElement("dialog"),s=du(a,o);a.className="docx-text-form-dialog",a.setAttribute("role","alertdialog"),a.setAttribute("data-docx-modal",""),s(a,"textFormField.invalidTitle","aria-label"),s(a,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=i.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let c=i.createElement("div");c.className="docx-text-form-dialog__body",s(c,`textFormField.invalid${t==="number"?"Number":"Date"}`);let d=i.createElement("div");d.className="docx-text-form-dialog__footer";let u=i.createElement("button");u.type="button",u.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(u,"textFormField.apply");let f=false,m=()=>{f||(f=true,n());};return u.addEventListener("click",m),a.addEventListener("keydown",g=>{g.key!=="Enter"||g.isComposing||(g.preventDefault(),g.stopPropagation(),m());}),a.addEventListener("cancel",g=>{g.preventDefault(),m();}),d.append(u),a.append(l,c,d),e.append(a),a.showModal(),u.focus(),a}function qT(e,t,n,r,o){let i=Ln(o),a=e.ownerDocument,s=a.createElement("dialog"),l=du(s,i);s.className="docx-text-form-dialog",s.setAttribute("data-docx-modal",""),l(s,"textFormField.title","aria-label");let c=a.createElement("h2");c.className="docx-text-form-dialog__header",l(c,"textFormField.title");let d=a.createElement("div");d.className="docx-text-form-dialog__body";let u=a.createElement("div");u.className="docx-text-form-dialog__footer",s.append(c,d,u);let f=(S,F)=>{let A=a.createElement("label");A.className="docx-text-form-dialog__row";let $=a.createElement("span");$.className="docx-text-form-dialog__label",l($,S),F.className="docx-text-form-dialog__input",A.append($,F),d.append(A);},m=a.createElement("input");m.type="text",m.value=t.defaultText,f("textFormField.defaultText",m);let g=a.createElement("select"),b=["regular","number","date"];for(let S of b){let F=a.createElement("option");F.value=S,l(F,`textFormField.${S}`),g.append(F);}if(!b.includes(t.type)){let S=a.createElement("option");S.value=t.type,l(S,"textFormField.preservedType"),S.disabled=true,g.append(S);}g.value=t.type,f("textFormField.type",g);let y=a.createElement("input");y.type="number",y.min="0",y.max="32767",y.step="1",y.value=String(t.maxLength),f("textFormField.maxLength",y);let h=a.createElement("select"),v=S=>{h.replaceChildren();let F=chunkWO4V6PNS_cjs._i[g.value]??[];for(let A of F){let $=a.createElement("option");$.value=A;let U={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[A];U||!A?l($,U??"textFormField.noFormat"):$.textContent=A,h.append($);}if(!F.includes(S)){let A=a.createElement("option");A.value=S,S?A.textContent=S:l(A,"textFormField.noFormat"),A.disabled=true,h.append(A);}h.value=S;};v(t.format),g.addEventListener("change",()=>v("")),f("textFormField.format",h);let x=a.createElement("input");x.type="checkbox",x.checked=t.enabled;let k=a.createElement("label");k.className="docx-text-form-dialog__checkbox-row";let R=a.createElement("span");l(R,"textFormField.enabled"),k.append(x,R),d.append(k);let C=a.createElement("p");C.className="docx-text-form-dialog__error",C.setAttribute("role","alert"),d.append(C);let P=a.createElement("button");P.type="button",P.className="docx-text-form-dialog__button",l(P,"textFormField.cancel"),P.addEventListener("click",r);let E=a.createElement("button");E.type="button",E.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(E,"textFormField.apply");let w=()=>{if(!y.value||!y.checkValidity()||!n(m.value,{type:g.value,maxLength:Number(y.value),format:h.value,enabled:x.checked})){l(C,"textFormField.invalidOptions");return}r();};return E.addEventListener("click",w),s.addEventListener("keydown",S=>{S.key==="Enter"&&!S.isComposing&&vd(S.target,"input")&&(S.preventDefault(),w());}),s.addEventListener("cancel",S=>{S.preventDefault(),r();}),u.append(P,E),e.append(s),s.showModal(),m.focus(),m.select(),s}function WT(e,t,n){let r=[],o=[];for(let a of e)for(let s of chunkWO4V6PNS_cjs.Aj(a).keys()){let l=chunkWO4V6PNS_cjs.Ta(a,s);if(l?.kind==="paragraph")for(let c of chunkWO4V6PNS_cjs.vj(l)){let d=t.get(c.fieldNodeId);if(!d)continue;let u=(chunkWO4V6PNS_cjs.hj(a,s)??"").slice(c.start,c.end),f=chunkWO4V6PNS_cjs.$i(u,c,"fill",d.locale);if(f===null)return {reason:"invalidArgs"};if(f===u)continue;let m={op:"commitTextFormField",paragraphId:s,fieldNodeId:c.fieldNodeId,locale:d.locale},g=chunkWO4V6PNS_cjs.ol(a,m);if(g)return {reason:g};r.push(m),o.push({paragraphId:s,start:c.start,end:c.end,length:f.length});}}let i=a=>{let s=a.offset;for(let l of o)l.paragraphId!==a.paragraphId||a.offset<=l.start||(s+=a.offset>=l.end?l.length-(l.end-l.start):Math.min(a.offset-l.start,l.length)-(a.offset-l.start));return s===a.offset?a:{...a,offset:s}};return {ops:r,selection:{anchor:i(n.anchor),head:i(n.head)}}}var Qg=new WeakMap,uu=new WeakMap;function D6(e){for(let t of Array.from(e.children))if(t.classList.contains("docx-pages"))return t;return null}function jT(e){let t=D6(e);return (t&&uu.get(t)?.())??null}function KT(e){return [...chunkWO4V6PNS_cjs.Aj(e).keys()].flatMap(t=>{let n=chunkWO4V6PNS_cjs.Ta(e,t);return n?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(n):[]})}function VT(e,t){let n=Ln(e.translate),r,o=false,i=new Map,a=()=>e.parts?.()??[e.part()];if(t?.length)for(let D of a()){let T=t.filter(q=>q.partName===D.name);if(!T.length)continue;let B=KT(D);for(let q of T){let j=B[q.fieldIndex];j&&i.set(j.fieldNodeId,{text:q.text,locale:q.locale});}}let s=new WeakMap,l=new WeakMap,c=(D=e.part())=>{s.set(D,new Map([...i].filter(([T])=>T.startsWith(`${D.name}#`))));},d=()=>(i=new Map(a().flatMap(D=>[...s.get(D)??[]])),l.get(e.part())??null),u=D=>{i.delete(D),c();};a().forEach(c);let f=()=>{if(!i.size)return null;if(o)return "invalidState";let D=WT(a(),i,e.selection());if("reason"in D)return D.reason;if(D.ops.length&&!e.editable())return "locked";let T=a();a().forEach(c);let B=i;D.ops.length&&l.set(e.part(),e.selection()),i=new Map,o=true;try{let q=D.ops.length?e.save?e.save(D.ops,D.selection):"unsupported":null;return q?i=B:(delete le.dataset.fieldError,D.ops.length&&l.set(e.part(),D.selection)),a().forEach(c),q}catch(q){throw a().every(j=>T.includes(j))&&(i=B),a().forEach(c),q}finally{o=false;}};uu.set(e.pagesLayer,f);let m=()=>i.size?a().flatMap(D=>KT(D).flatMap((T,B)=>{let q=i.get(T.fieldNodeId);return q?[{partName:D.name,fieldIndex:B,...q}]:[]})):[];Qg.set(e.pagesLayer,m);let g,b=(D,T)=>(chunkWO4V6PNS_cjs.hj(e.part(),D)??"").slice(T.start,T.end),y=null,h=null,v=null,x=false,k=false,R=()=>{let D=v;v=null,k=false,y?.remove(),y=null,D?.abort();},C=()=>{if(!y&&!v)return;let D=e.selection();R(),!x&&(e.pagesLayer.focus({preventScroll:true}),e.select(D));};function P(D,T,B="plain"){g={paragraphId:D,fieldNodeId:T.fieldNodeId},e.select({anchor:{paragraphId:D,offset:T.start},head:{paragraphId:D,offset:T.end}},B==="press"?"pressed":void 0);let q=e.selection().head.paragraphId===D&&e.selection().head.offset>=T.start&&e.selection().head.offset<=T.end;q&&(h=g??h),g=void 0,q&&B==="travel"&&e.reveal?.({paragraphId:D,offset:T.start});}function E(D,T){if(x)return;C();let B=e.locale?.()??"en-US",q=new AbortController;v=q;let j=()=>{if(x||q.signal.aborted||v!==q)return false;let oe=chunkWO4V6PNS_cjs.Ta(e.part(D),D);return oe?.kind==="paragraph"&&chunkWO4V6PNS_cjs.vj(oe).some(H=>H.fieldNodeId===T.fieldNodeId)&&e.editable()&&!e.protected(D)},X={field:{...T},signal:q.signal,canApply:j,apply(oe,H){if(!j()||!e.apply({op:"setTextFormFieldDefault",locale:B,paragraphId:D,fieldNodeId:T.fieldNodeId,text:oe,options:H}))return false;if(x||v!==q||q.signal.aborted)return true;let V=chunkWO4V6PNS_cjs.Ta(e.part(D),D),z=V?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(V).find(Y=>Y.fieldNodeId===T.fieldNodeId):null;return z&&P(D,z),C(),true},cancel(){v===q&&!q.signal.aborted&&C();}};e.onRequest?.(X)||q.signal.aborted||(y=qT(e.container,T,X.apply,X.cancel,n));}let w=D=>{let B=D.target?.closest('[data-field-atom="form"][data-start]'),q=B?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!B||!q||!e.editable())return null;let j=chunkWO4V6PNS_cjs.Ta(e.part(),q);if(j?.kind!=="paragraph")return null;let X=Number(B.dataset.start),oe=chunkWO4V6PNS_cjs.vj(j).find(H=>H.start<=X&&X<H.end);return oe?{paragraphId:q,field:oe}:null},S=null,F=D=>D.shiftKey||D.altKey||D.ctrlKey||D.metaKey,A=D=>{if(r=void 0,S=null,D.button!==0)return;let T=w(D);T&&!F(D)&&!e.protected(T.paragraphId)&&(S={x:D.clientX,y:D.clientY,paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId,moved:false}),g=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",A,{capture:true});let $=D=>{S&&Math.hypot(D.clientX-S.x,D.clientY-S.y)>4&&(S.moved=true);},W=()=>{S=null;},U=(D,T=false)=>{let B=S;if(S=null,!B||B.moved||y||D.button!==0||D.detail>1||Math.hypot(D.clientX-B.x,D.clientY-B.y)>4||!e.editable()||F(D)||e.protected(B.paragraphId))return;let q=chunkWO4V6PNS_cjs.Ta(e.part(),B.paragraphId),j=q?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(q).find(oe=>oe.fieldNodeId===B.fieldNodeId):null;if(!j)return;let X=e.selection();T&&(X.anchor.paragraphId!==X.head.paragraphId||X.anchor.offset!==X.head.offset)&&!(X.anchor.paragraphId===B.paragraphId&&X.head.paragraphId===B.paragraphId&&Math.min(X.anchor.offset,X.head.offset)===j.start&&Math.max(X.anchor.offset,X.head.offset)===j.end)||P(B.paragraphId,j,"press");},_=[e.listeners.onDocument("pointermove",$),e.listeners.onDocument("pointercancel",W)];e.pagesLayer.addEventListener("click",U);let L=D=>{if(D.shiftKey||D.altKey||D.ctrlKey||D.metaKey||e.pagesLayer.contentEditable==="false")return false;let T=w(D);if(!T)return false;let{paragraphId:B,field:q}=T;return D.preventDefault(),P(B,q,"press"),e.protected(B)||E(B,q),true};e.pagesLayer.addEventListener("dblclick",L);function Z(){let D=e.selection();if(D.anchor.paragraphId!==D.head.paragraphId)return null;let T=D.head.paragraphId,B=chunkWO4V6PNS_cjs.Ta(e.part(),T);if(B?.kind!=="paragraph")return null;let q=Math.min(D.anchor.offset,D.head.offset),j=Math.max(D.anchor.offset,D.head.offset),X=chunkWO4V6PNS_cjs.vj(B).filter(H=>H.start<=q&&H.end>=j&&(H.start===H.end||q!==j||q<H.end||e.protected(T))),oe=X.find(H=>h?.paragraphId===T&&H.fieldNodeId===h.fieldNodeId)??X.find(H=>H.start===q&&H.end===j)??X[0];return oe?{paragraphId:T,field:oe}:null}function ee(){if(r===void 0)return Z();if(!r)return null;let D=chunkWO4V6PNS_cjs.Ta(e.part(),r.paragraphId),T=D?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(D).find(B=>B.fieldNodeId===r.fieldNodeId):null;return T?{paragraphId:r.paragraphId,field:T}:null}let te=D=>{let T=D.button===-1||D.clientX===0&&D.clientY===0?Z():w(D);r=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",te);let me=()=>{let D=ee();return !!D&&e.editable()&&!e.protected(D.paragraphId)&&!chunkWO4V6PNS_cjs.ol(e.part(),{op:"setTextFormFieldDefault",paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},le=e.pagesLayer.ownerDocument.createElement("span");return le.className="docx-text-form-status",e.container.append(le),{doubleClick:L,pointerUp:D=>U(D,true),canEdit:me,edit(){if(!me())return false;let D=ee();return P(D.paragraphId,D.field,"travel"),E(D.paragraphId,D.field),true},selectForDeletion(D){let T=e.selection(),{paragraphId:B,offset:q}=T.head;if(!e.editable()||e.protected(B)||T.anchor.paragraphId!==B||T.anchor.offset!==q)return false;let j=chunkWO4V6PNS_cjs.Ta(e.part(),B);if(j?.kind!=="paragraph")return false;let X=chunkWO4V6PNS_cjs.vj(j).find(oe=>oe.start<oe.end&&(D==="backward"?oe.end===q:oe.start===q));return X?(P(B,X),true):false},wordDeletionBoundary(D,T,B,q){let j=chunkDBOOTED4_cjs.ke(D,T,B,q),X=e.selection().head.paragraphId;if(e.protected(X))return j;let oe=chunkWO4V6PNS_cjs.Ta(e.part(X),X);if(oe?.kind!=="paragraph")return j;let H=chunkWO4V6PNS_cjs.vj(oe),V=H.find(Y=>Y.start<Y.end&&(B===-1?Y.end===T:Y.start===T));if(V)return B===-1?V.start:V.end;let z=j;for(let Y of H)for(let fe of [Y.start,Y.end])B===-1&&fe<T&&fe>z&&(z=fe),B===1&&fe>T&&fe<z&&(z=fe);return z},beforeSelect(D){let T=Ae=>{if(g!==void 0)h=g;else if(D.anchor.paragraphId!==D.head.paragraphId||h?.paragraphId!==D.head.paragraphId)h=null;else {let Fe=chunkWO4V6PNS_cjs.Ta(e.part(),D.head.paragraphId),we=Fe?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(Fe).find(Je=>Je.fieldNodeId===h?.fieldNodeId):null;(!we||Math.min(D.anchor.offset,D.head.offset)<we.start||Math.max(D.anchor.offset,D.head.offset)>we.end)&&(h=null);}return g=void 0,delete le.dataset.fieldError,Ae};if(o||k)return null;if(!e.editable())return D;let B=Z();if(!B||!e.protected(B.paragraphId)||!B.field.enabled||!chunkWO4V6PNS_cjs.aj(B.field))return T(D);let{field:q,paragraphId:j}=B;if((!g||g.fieldNodeId===q.fieldNodeId)&&D.anchor.paragraphId===j&&D.head.paragraphId===j&&Math.min(D.anchor.offset,D.head.offset)>=q.start&&Math.max(D.anchor.offset,D.head.offset)<=q.end)return T(D);let X=i.get(q.fieldNodeId),oe=X?.text,H=X?.locale??e.locale?.()??"en-US",V=b(j,q);if(q.type==="date"&&oe===void 0)return u(q.fieldNodeId),T(D);let z=chunkWO4V6PNS_cjs.$i(V,q,"fill",H);if(z===V||z===null&&(oe===void 0||oe===V))return u(q.fieldNodeId),T(D);o=true;let Y=e.part();c(Y);let fe=i;i=new Map(fe),i.delete(q.fieldNodeId);let ne;try{ne=e.apply({op:"commitTextFormField",locale:H,paragraphId:j,fieldNodeId:q.fieldNodeId}),ne||(i=fe);}catch(Ae){throw e.part()===Y&&(i=fe),Ae}finally{c(),o=false;}if(!ne){if(g=void 0,le.setAttribute("role","alert"),le.dataset.fieldError="true",le.textContent=n("textFormField.invalidValue"),z===null&&(q.type==="number"||q.type==="date")){R();let Ae=new AbortController;v=Ae,k=true;let Fe=()=>{if(x||Ae.signal.aborted||v!==Ae||(R(),x))return;let Je=e.selection(),Zt=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(Je);},Se=chunkWO4V6PNS_cjs.Ta(e.part(),j),Me=Se?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(Se).find(tt=>tt.fieldNodeId===q.fieldNodeId):null;if(!Me||!e.editable()||!e.protected(j)||b(j,Me)!==V||!Me.enabled||!chunkWO4V6PNS_cjs.aj(Me)||Me.type!==q.type||Me.format!==q.format||chunkWO4V6PNS_cjs.$i(V,Me,"fill",H)!==null){Zt();return}o=true;try{if(e.apply({op:"deleteText",paragraphId:j,start:Me.start,end:Me.end,textFormFieldId:Me.fieldNodeId})){u(Me.fieldNodeId),delete le.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let tt={paragraphId:j,offset:Me.start};o=!1,e.select({anchor:tt,head:tt}),h={paragraphId:j,fieldNodeId:Me.fieldNodeId};}else o=!1,Zt();}finally{o=false;}},we={type:q.type,signal:Ae.signal,acknowledge:Fe,cancel(){v===Ae&&!Ae.signal.aborted&&C();}};!e.onInvalidRequest?.(we)&&!Ae.signal.aborted&&(y=$T(e.container,q.type,Fe,n));}return null}u(q.fieldNodeId);let ce=chunkWO4V6PNS_cjs.Ta(e.part(),j),ve=ce?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(ce).find(Ae=>Ae.fieldNodeId===q.fieldNodeId):null,Re=ve?ve.end-q.end:0,ht=Ae=>Ae.paragraphId===j&&Ae.offset>=q.end?{...Ae,offset:Ae.offset+Re}:Ae;return T({anchor:ht(D.anchor),head:ht(D.head)})},update(){y&&OT(y,n);let D=Z(),T=e.selection(),B=!!D&&T.anchor.offset!==T.head.offset&&Math.min(T.anchor.offset,T.head.offset)===D.field.start&&Math.max(T.anchor.offset,T.head.offset)===D.field.end;for(let q of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let j=q.closest("[data-paragraph-id]")?.dataset.paragraphId,X=Number(q.dataset.start);!!D&&j===D.paragraphId&&X>=D.field.start&&X<D.field.end?q.dataset.textFormSelection=B?"whole":"caret":delete q.dataset.textFormSelection;}if(le.dataset.fieldError){le.textContent=n("textFormField.invalidValue");return}D?le.setAttribute("role","status"):le.removeAttribute("role"),le.textContent=D?n(B?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>Z()?.field.fieldNodeId??null,afterApply(D){D?c():d();},restoreAfterHistory:d,annotate(D){(!o||D.some(B=>B.op!=="commitTextFormField"))&&c(),D.some(B=>B.op==="insertText"||B.op==="deleteText")&&delete le.dataset.fieldError;let T=Z();return h=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null,D.map(B=>{if(!h||B.op!=="insertText"&&B.op!=="deleteText"||B.revision||B.paragraphId!==h.paragraphId||!e.protected(B.paragraphId))return B;let q=chunkWO4V6PNS_cjs.Ta(e.part(),B.paragraphId),j=q?.kind==="paragraph"?chunkWO4V6PNS_cjs.vj(q).find(H=>H.fieldNodeId===h.fieldNodeId):null,X=B.op==="insertText"?B.offset:B.start,oe=B.op==="insertText"?B.offset:B.end;return !j||X<j.start||oe>j.end?B:(i.has(j.fieldNodeId)||i.set(j.fieldNodeId,{text:b(B.paragraphId,j),locale:e.locale?.()??"en-US"}),{...B,textFormFieldId:j.fieldNodeId})})},keydown(D){if(D.key==="F10"&&D.shiftKey&&!D.altKey&&!D.ctrlKey&&!D.metaKey)return r=void 0,D.preventDefault(),e.pagesLayer.dispatchEvent(new(Ze(e.pagesLayer)).MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(D.key!=="Tab"||D.altKey||D.ctrlKey||D.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let T=[],B=[e.part().root];for(;B.length;){let z=B.pop();if(z.kind==="paragraph")for(let Y of chunkWO4V6PNS_cjs.vj(z))e.protected(z.id)&&Y.enabled&&chunkWO4V6PNS_cjs.aj(Y)&&!chunkWO4V6PNS_cjs.ol(e.part(),{op:"insertText",paragraphId:z.id,offset:Y.start,text:"x"})&&T.push({paragraphId:z.id,field:Y});else for(let Y=z.children.length-1;Y>=0;Y--){let fe=z.children[Y];fe.kind!=="textValue"&&B.push(fe);}}if(!T.length)return false;let q=e.selection(),j=q.head,X=h?T.findIndex(z=>z.paragraphId===h.paragraphId&&z.field.fieldNodeId===h.fieldNodeId&&z.field.start<=Math.min(q.anchor.offset,j.offset)&&z.field.end>=Math.max(q.anchor.offset,j.offset)):-1,oe=X>=0?X:T.findIndex(z=>z.paragraphId===j.paragraphId&&z.field.start<=Math.min(q.anchor.offset,j.offset)&&z.field.end>=Math.max(q.anchor.offset,j.offset)),H=oe<0?D.shiftKey?T.length-1:0:(oe+(D.shiftKey?-1:1)+T.length)%T.length,V=T[H];return D.preventDefault(),P(V.paragraphId,V.field,"travel"),true},destroy(){x=true,R(),uu.get(e.pagesLayer)===f&&uu.delete(e.pagesLayer),Qg.get(e.pagesLayer)===m&&Qg.delete(e.pagesLayer);for(let D of _)D();e.pagesLayer.removeEventListener("click",U),e.pagesLayer.removeEventListener("contextmenu",te),le.remove(),e.pagesLayer.removeEventListener("dblclick",L),e.pagesLayer.removeEventListener("pointerdown",A,{capture:true}),y?.remove(),y=null;}}}function UT(e,t,n,r=o=>o){let o,i=e.subscribe(a=>{for(let s of a.splitJoin)"split"in s&&s.split.from===t&&(o=s.split.tail);});try{n(()=>{let a=o&&r(o,t);if(!a)return null;let s={paragraphId:a,offset:0};return {anchor:s,head:s}});}finally{i();}}var fu=new WeakMap;function bl(e){let t=fu.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function zT(e){let t=fu.get(e)??{depth:0};return t.depth++,fu.set(e,t),()=>{--t.depth===0&&(fu.delete(e),t.resolve?.());}}var N6=12;function vl(e,t){if(typeof MessageChannel!="function"){t.setTimeout(e,0);return}let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);}function GT(e,t,n=N6){let r=globalThis.performance??Date;return new Promise((o,i)=>{let a=()=>{let s=r.now()+n;try{for(;;){let l=e.next();if(l.done){o(l.value);return}if(r.now()>=s)break}}catch(l){i(l);return}vl(a,Ze(t));};a();})}async function ZT(e,t,n){if(!e)throw tn("notFound","no document is loaded");let r=t?bl(t):void 0;if(r&&(await r,n()!==e))throw tn("invalidState","The document changed before the pending save could finish.");return (await GT(e.saveSteps(),t)).slice().buffer}function XT(e,t,n){return QT(e,t,n,()=>e.session.save())}function YT(e,t,n){return QT(e,t,n,()=>e.session.saveSteps())}function QT(e,t,n,r){let o=()=>{if(n())throw tn("destroyed","Cannot save a destroyed surface.")};if(o(),bl(t))throw tn("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),o();let i=jT(t);if(i)throw tn(i,"Cannot save pending text form input. Enter a valid value in each field.");o(),e.refreshRefFieldResults(),o();let a=qP(t);Eo(t,true);try{return r()}finally{Eo(t,a);}}function pu(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function JT(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let a of e){if(a.op!=="commitTextFormField")return "invalidArgs";let s=Bt(n.session,a.paragraphId,{kind:"body"}),l=JSON.stringify(s),c=o.get(l)??{scope:s,ops:[]};c.ops.push(a),o.set(l,c);}for(let a of o.values()){let s=n.gate(a.ops,a.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let i;return n.commit(()=>i=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),i?.rejected?i.reason??"invalidArgs":null}function eE(e,t){let n=chunkWO4V6PNS_cjs.Xi(e);return {get:()=>n,set(r){let o=chunkWO4V6PNS_cjs.Xi(r);n!==o&&(t(),n=o);}}}var H6=42,_6=/^(\d{4})-(\d{2})-(\d{2})/,B6=new Set(["AG","AS","BD","BR","BS","BT","BW","BZ","CA","CO","DM","DO","ET","GT","GU","HK","HN","ID","IL","IN","JM","JP","KE","KH","KR","LA","MH","MM","MO","MT","MX","MZ","NI","NP","PA","PE","PH","PK","PR","PT","PY","SA","SG","SV","TH","TT","TW","UM","US","VE","VI","WS","YE","ZA","ZW"]),$6=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function xi(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function to(e){let t=_6.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let i=new Date(n,r-1,o);return i.getFullYear()!==n||i.getMonth()!==r-1||i.getDate()!==o?null:i}function mu(e){let t=chunkWO4V6PNS_cjs.Xi(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let i=n.maximize().region;if(i&&B6.has(i))return 0;if(i&&$6.has(i))return 6}catch{}return 1}function tE(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function nE(e,t,n){return new Intl.DateTimeFormat(chunkWO4V6PNS_cjs.Xi(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function rE(e){let t=chunkWO4V6PNS_cjs.Xi(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=mu(t);return Array.from({length:7},(o,i)=>n.format(new Date(2024,0,7+(r+i)%7)))}function Jg(e,t,n={}){let r=chunkWO4V6PNS_cjs.Xi(n.locale),o=n.selected?to(n.selected):null,i=n.today??new Date,a=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=mu(r),l=(new Date(e,t,1).getDay()-s+7)%7,c=[];for(let d=0;d<H6;d+=1){let u=new Date(e,t,d-l+1);c.push({iso:xi(u),day:u.getDate(),label:a.format(u),otherMonth:u.getMonth()!==t,selected:o!==null&&tE(u,o),today:tE(u,i)});}return {year:e,month:t,title:nE(e,t,r),weekdays:rE(r),days:c}}function gu(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function eh(e,t,n,r=false){let o=to(e);if(!o)return null;let i={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},a=(o.getDay()-mu(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-a:t==="End"?6-a:i[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?xi(o):null}function hu(e,t){let n=to(e);if(!n)return "";let r=chunkWO4V6PNS_cjs.Xi(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(i=>i.type==="year"?i.value.padStart(4,o):i.value).join("")}function th(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=to(n);return s?xi(s):null}let r=chunkWO4V6PNS_cjs.Yi(chunkWO4V6PNS_cjs.Xi(t)),o=r.pattern.exec(chunkWO4V6PNS_cjs.Zi(n,r));if(!o)return null;let i={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{i[s]=o[l+1];}),i.year.length!==4)return null;let a=`${i.year}-${i.month.padStart(2,"0")}-${i.day.padStart(2,"0")}`;return to(a)?a:null}function nh(e){let t=new Intl.DateTimeFormat(chunkWO4V6PNS_cjs.Xi(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function rh(e){let t="",n=0,r=new Intl.Collator(chunkWO4V6PNS_cjs.Xi(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,i){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let a=o.target.tagName==="INPUT",s=[...i.querySelectorAll('[role="option"]')].filter(d=>!d.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(i.ownerDocument.activeElement),c;if(o.key==="ArrowDown")c=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")c=l<0?s.length-1:Math.max(0,l-1);else if(!a&&o.key==="Home")c=0;else if(!a&&o.key==="End")c=s.length-1;else if(!a&&o.key.length===1&&o.key!==" "){let d=Date.now();t=d-n>700?o.key:(t+o.key).slice(-100),n=d;let u=[...t].every(f=>r.compare(f,o.key)===0)?o.key:t;for(let f=1;f<=s.length;f++){let m=(Math.max(-1,l)+f)%s.length;if(r.compare((s[m].textContent??"").slice(0,u.length),u)===0){c=m;break}}}c!==void 0&&(o.preventDefault(),s.forEach((d,u)=>{d.tabIndex=u===c?0:-1;}),s[c]?.focus({preventScroll:true}),s[c]?.scrollIntoView?.({block:"nearest"}));}}}var q6=0;function oE(e,t){let n=e.document.createElement("div");n.className="docx-content-control-menu",n.dataset.docxMarker="",n.dataset.docxPart="popup",n.addEventListener("keydown",r=>hl(n,r,()=>e.close(n))),n.dataset.docxCcId=t,n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.zIndex="20",n.style.pointerEvents="auto",n.addEventListener("pointerdown",r=>r.stopPropagation());for(let r of ["keydown","beforeinput","input","compositionstart","compositionupdate","compositionend","copy","cut","paste"])n.addEventListener(r,o=>o.stopPropagation());return n}function iE(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let a=gl(e,n.element),s=new(Ze(e)).MutationObserver(()=>{e.isConnected||(a(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let i=n.left+o-n.sheetRight;i>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-i)}px`);}function yu(e,t,n,r){if(e.setValue(n,r))return e.close(t),true;let o=t.querySelector("[data-docx-part=error]");return o||(o=e.document.createElement("div"),o.dataset.docxPart="error",o.className="docx-content-control-widget-error",o.setAttribute("role","alert"),t.append(o)),o.hidden=false,o.textContent=Ln(e.translate)("disabledReason.invalidValue"),false}function aE(e,t,n,r,o,i){let a=oE(e,t),s=Ln(e.translate);a.setAttribute("role","dialog"),a.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++q6}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let c=rh(e.locale());a.addEventListener("keydown",u=>c.keyDown(u,a));let d=r.findIndex(u=>u.value===i);for(let[u,f]of r.entries()){let m=e.document.createElement("button");m.type="button",m.className="docx-content-control-menu-item",m.dataset.docxPart="item",m.dataset.value=f.value,m.setAttribute("role","option"),m.setAttribute("aria-selected",String(f.value===i)),m.tabIndex=u===Math.max(0,d)?0:-1,m.textContent=f.displayText,m.addEventListener("click",()=>{yu(e,a,t,f.value);}),l.append(m);}if(n==="buildingBlockGallery"&&r.length===0){let u=e.document.createElement("div");u.className="docx-content-control-menu-empty",u.dataset.docxPart="empty",u.setAttribute("role","note"),u.tabIndex=0,u.textContent=s("contentControl.gallery.empty"),l.append(u);}if(n==="comboBox"){let u=e.document.createElement("input");u.type="text",u.className="docx-content-control-menu-input",u.dataset.docxPart="input",u.value=i??"",u.setAttribute("aria-label",o||s("contentControl.types.comboBox")),u.setAttribute("aria-autocomplete","list"),u.setAttribute("role","combobox"),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-controls",l.id),u.addEventListener("keydown",m=>{m.key!=="Enter"||m.isComposing||(m.preventDefault(),yu(e,a,t,u.value));}),a.append(u);let f=e.document.createElement("div");f.className="docx-dialog__footer",f.dataset.docxPart="footer";for(let m of ["cancel","apply"]){let g=e.document.createElement("button");g.type="button",g.className=`docx-dialog__button${m==="apply"?" docx-dialog__button--primary":""}`,g.dataset.docxPart=m,g.textContent=s(`common.${m}`),g.addEventListener("click",()=>{m==="apply"?yu(e,a,t,u.value):e.close(a);}),f.append(g);}a.append(l,f);}else a.append(l);return a}function bu(e,t){let n=(t?e.querySelector(`[data-iso="${t}"]`):null)??e.querySelector("[data-selected]")??e.querySelector("[data-today]:not([data-other-month])")??e.querySelector(".docx-content-control-calendar-day:not([data-other-month])");for(let r of e.querySelectorAll("[data-iso]"))r.tabIndex=r===n?0:-1;n?.focus({preventScroll:true});}function sE(e,t,n,r){let o=Ln(e.translate),i=oE(e,t);i.classList.add("docx-content-control-calendar"),i.setAttribute("role","dialog"),i.setAttribute("aria-label",r||o("contentControl.types.date"));let a=n?to(n):null,s=a?xi(a):null,l=new Date,c={year:(a??l).getFullYear(),month:(a??l).getMonth()},d=null,u=hu(s??"",e.locale()),f=h=>{yu(e,i,t,h);},m=h=>{h.addEventListener("mousedown",v=>v.stopPropagation());},g=e.document.createElement("div");g.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",g.dataset.docxPart="title",g.setAttribute("aria-live","polite");let b=()=>{let h=e.document.activeElement?.dataset.docxCalendarNav,v=Jg(c.year,c.month,{locale:e.locale(),selected:s,today:l}),x=e.document.createElement("div");x.className="docx-content-control-calendar-header",x.dataset.docxPart="header";let k=e.document.createElement("button");k.type="button",k.className="docx-content-control-calendar-nav",k.dataset.docxPart="previousMonth",k.dataset.docxCalendarNav="previous",k.textContent="\u2039",k.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),g.textContent=v.title;let R=e.document.createElement("button");R.type="button",R.className="docx-content-control-calendar-nav",R.dataset.docxPart="nextMonth",R.dataset.docxCalendarNav="next",R.textContent="\u203A",R.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),m(k),m(R),k.addEventListener("click",()=>{c=gu(c.year,c.month,-1),d=null,b();}),R.addEventListener("click",()=>{c=gu(c.year,c.month,1),d=null,b();});let C=e.document.createElement("div");C.className="docx-content-control-calendar-navigation",C.dataset.docxPart="navigation";let P=e.document.createElement("select");P.className="docx-content-control-calendar-month",P.dataset.docxPart="month",P.dataset.docxCalendarNav="month",P.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[L,Z]of nh(e.locale()).entries()){let ee=e.document.createElement("option");ee.value=String(L),ee.textContent=Z,P.append(ee);}P.value=String(c.month);let E=e.document.createElement("input");E.type="number",E.min="100",E.max="9999",E.value=String(c.year),E.className="docx-content-control-calendar-year",E.dataset.docxPart="year",E.dataset.docxCalendarNav="year",E.addEventListener("keydown",L=>{L.key==="Enter"&&!L.isComposing&&(L.preventDefault(),E.blur());}),E.setAttribute("aria-label",o("contentControl.calendar.year")),P.addEventListener("change",()=>{c.month=Number(P.value),d=null,b();}),E.addEventListener("change",()=>{let L=Number(E.value);if(!Number.isInteger(L)||L<100||L>9999){E.value=String(c.year);return}c.year=L,d=null,b();}),C.append(P,E);let w=e.document.createElement("div");w.className="docx-content-control-calendar-weekdays",w.dataset.docxPart="weekdays";for(let L of v.weekdays){let Z=e.document.createElement("span");Z.textContent=L,w.append(Z);}let S=e.document.createElement("div");S.className="docx-content-control-calendar-grid",S.dataset.docxPart="grid",S.setAttribute("role","grid"),S.setAttribute("aria-label",v.title);for(let L=0;L<v.days.length;L+=7){let Z=e.document.createElement("div");Z.className="docx-content-control-calendar-week",Z.setAttribute("role","row");for(let ee of v.days.slice(L,L+7))Z.append(y(ee));S.append(Z);}let F=e.document.createElement("div");F.className="docx-content-control-calendar-entry",F.dataset.docxPart="dateEntry";let A=e.document.createElement("button");A.type="button",A.className="docx-content-control-calendar-today",A.dataset.docxPart="today",A.textContent=o("contentControl.calendar.today"),m(A),A.addEventListener("click",()=>f(xi(l)));let $=e.document.createElement("input");$.type="text",$.className="docx-content-control-menu-input",$.dataset.docxPart="input",$.setAttribute("aria-label",o("contentControl.types.date")),$.placeholder=hu("2006-11-22",e.locale()),$.value=u,$.addEventListener("input",()=>{u=$.value,$.removeAttribute("aria-invalid"),W.hidden=true;});let W=e.document.createElement("div");W.className="docx-content-control-widget-error",W.dataset.docxPart="error",W.setAttribute("role","alert"),W.hidden=true,W.textContent=o("disabledReason.invalidValue");let U=()=>{let L=th(u,e.locale());L?f(L):(W.hidden=false,$.setAttribute("aria-invalid","true"),$.focus());};$.addEventListener("keydown",L=>{L.key==="Enter"&&!L.isComposing&&(L.preventDefault(),U());});let _=e.document.createElement("div");_.className="docx-dialog__footer",_.dataset.docxPart="footer";for(let L of ["cancel","apply"]){let Z=e.document.createElement("button");Z.type="button",Z.dataset.docxPart=L,Z.className=`docx-dialog__button${L==="apply"?" docx-dialog__button--primary":""}`,Z.textContent=o(`common.${L}`),Z.addEventListener("click",L==="apply"?U:()=>e.close(i)),_.append(Z);}x.append(k,C,R,g),F.append(A,$),i.replaceChildren(x,w,S,F,W,_),bu(i,d),h==="previous"&&k.focus({preventScroll:true}),h==="next"&&R.focus({preventScroll:true}),h==="month"&&P.focus({preventScroll:true}),h==="year"&&E.focus({preventScroll:true});},y=h=>{let v=e.document.createElement("button");return v.type="button",v.className="docx-content-control-calendar-day",v.dataset.docxPart="day",v.textContent=String(h.day),v.dataset.iso=h.iso,v.setAttribute("role","gridcell"),v.setAttribute("aria-label",h.label),h.otherMonth&&(v.dataset.otherMonth=""),h.selected&&(v.dataset.selected="",v.setAttribute("aria-selected","true")),v.setAttribute("aria-selected",String(h.selected)),h.today&&(v.dataset.today="",v.setAttribute("aria-current","date")),m(v),v.addEventListener("click",()=>f(h.iso)),v.addEventListener("keydown",x=>{if(x.isComposing||x.altKey||x.ctrlKey||x.metaKey)return;let k=eh(h.iso,x.key,e.locale(),x.shiftKey);if(!k)return;x.preventDefault();let R=to(k);if(d=k,R.getFullYear()!==c.year||R.getMonth()!==c.month){c={year:R.getFullYear(),month:R.getMonth()},b();return}bu(i,d);}),v};return b(),i}function oh(e,t){let r=(_t(t)?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let i=chunkWO4V6PNS_cjs.Ta(e.part(o),o);if(i?.kind!=="paragraph")return null;let a=Number(r.dataset.start),s=chunkWO4V6PNS_cjs.xj(i).find(l=>l.start<=a&&a<l.end);return s?{paragraphId:o,field:s}:null}function lE(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function cE(e){let t=(i,a)=>{if(!e.editable()||!a.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:i,fieldNodeId:a.fieldNodeId,checked:!a.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:i,offset:a.start},head:{paragraphId:i,offset:a.end}})),s},n=i=>{if(i.button!==0||lE(i))return;let a=oh(e,i.target);!a||!e.editable()||!a.field.enabled||(i.preventDefault(),i.stopPropagation(),t(a.paragraphId,a.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=i=>{let a=oh(e,i.target);a&&vr(i.target)&&i.target.setAttribute("aria-disabled",String(!e.editable()||!a.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let i=e.selection();if(i.anchor.paragraphId!==i.head.paragraphId)return null;let a=i.head.paragraphId,s=chunkWO4V6PNS_cjs.Ta(e.part(a),a);if(s?.kind!=="paragraph")return null;let l=Math.min(i.anchor.offset,i.head.offset),c=Math.max(i.anchor.offset,i.head.offset),d=chunkWO4V6PNS_cjs.xj(s).find(u=>u.start===l&&u.end===c||l===c&&l===u.start&&e.protected(a));return d?{paragraphId:a,field:d}:null};return {keydown(i){let a=oh(e,i.target);if(a&&i.key==="Tab")return true;if(a&&i.key.length===1&&i.key!==" "&&!i.ctrlKey&&!i.metaKey&&!i.altKey)return i.preventDefault(),true;if(i.key!==" "||lE(i)||i.isComposing)return false;let s=a??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return a?(i.preventDefault(),true):false;i.preventDefault();let l=t(s.paragraphId,s.field);return a&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(c=>c.dataset.paragraphId===s.paragraphId&&Number(c.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var W6=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTable","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function dE(e){return W6.has(e.op)}function xl(e){if(dE(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "insertContentControl":case "authorTable":case "setListNumbering":case "setListLevel":case "splitParagraphMany":return e.revision!==void 0;default:return false}}var K6=e=>chunkWO4V6PNS_cjs.jk.has(e);function wl(e,t,n){return e.flatMap(r=>dE(r)?!n&&K6(r.op)?[r]:[r.revision!==void 0?r:{...r,revision:t}]:r.op==="splitParagraphMany"?[{...r,revision:t}]:r.op==="splitParagraph"?[r,{op:"setParagraphMarkRevision",paragraphId:r.paragraphId,kind:"ins",revision:t}]:r.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:r.secondId,revision:t}]:[r])}function vu(e,t,n,r,o){let{past:i,landing:a}=chunkWO4V6PNS_cjs.Ch(e,{start:t,end:n},n,r,o),s=chunkWO4V6PNS_cjs.Ah(e,t,i,r);return (i-t>s?a:i)-s}function ah(e){return e?.trim()||void 0}var ih=new Map;function uE(e){let t=ih.get(e);if(t!==void 0)return t;let n=e.trim().split(/\s+/).filter(Boolean),r=n.length===0?"?":n.slice(0,2).map(o=>o[0].toUpperCase()).join("");return ih.size<256&&ih.set(e,r),r}function fE(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function Ea(e,t,n){if(!e)return null;let r=chunkDBOOTED4_cjs.ie(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var pE="docx-field-atom--active",j6="docx-field-atom",mE=new WeakMap;function sh(e,t,n){let r=mE.get(e);r||(r={caretKey:null,marked:[]},mE.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let a of r.marked)a.classList.remove(pE);if(r.marked=[],r.caretKey=o,!t)return;let i=e.querySelectorAll(`.${j6}`);for(let a of i){if(a.dataset.paragraphId!==t.paragraphId)continue;let s=Number(a.dataset.fieldResultStart??a.dataset.start),l=Number(a.dataset.fieldResultEnd??a.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(a.classList.add(pE),r.marked.push(a));}}var V6={kind:"body"};function gE(e){let{session:t}=e;if(e.editingMode==="view"||!t.editable)return true;if(e.collaborationActive)return false;let n,r=e.reviewerFilterActive?l=>(n??=chunk5JPIEN54_cjs.Y(e.canonicalUnfilteredLayout()),n(l)):chunk5JPIEN54_cjs.Y(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},i=chunk5JPIEN54_cjs.Z(t.part(),o),a=chunk5JPIEN54_cjs._(t.part(),o);if(!i&&a.length===0)return true;let s=[];i&&s.push({scope:V6,ops:[i]});for(let l of a)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function yE(e){let t=0,n=null,r="",o=null,i=true,a=null,s="";return ()=>{let l=e.surface(),c=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,d=e.activeKey(),u=e.paneOpen(),f=e.selectionAnchor(),m=e.authorFilterKey();return (l!==n||c!==r||d!==o||u!==i||f!==a||m!==s)&&(n=l,r=c,o=d,i=u,a=f,s=m,t+=1),t}}function xu(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=chunkDBOOTED4_cjs.cb(t),o=null,i="accept",a=null,s="accept",l=new WeakMap,c=null,d=false,u=0,f=null,m=[],g=null,b=[],y=r,h=t,v=new Set,x="accept",k=new WeakSet,R=new WeakMap,C=new Map,P=()=>{u+=1,f=null,m=[],g=null;},E=F=>JSON.stringify([F.id,chunkWO4V6PNS_cjs.Lj(F)]),w=(F,A,$)=>{let W=U6($),U=t,_=r?.hiddenAuthors??chunkDBOOTED4_cjs.bb,L=i,Z;U===h&&z6(W,v)&&(W.size===0||L===x)?Z=y:W.size===0&&U.size===0?Z=void 0:Z=Object.freeze({hiddenAuthors:_,includes:te=>!U.has(te.author)&&!W.has(te.nodeId),includesNode:(te,me)=>!U.has(me)&&!W.has(te),excludedNodeMode:(te,me)=>U.has(me)?"proposed":W.has(te)&&L==="reject"?"original":"proposed",cacheKey:G6(U,W,L)});let ee=[];for(let te of F){let me=hE(te);me!==null&&U.has(me)||te.kind==="revision"&&A.has(te)||ee.push(te);}b=ee.length===F.length?F:chunkWO4V6PNS_cjs.Ck(ee),g=F,k=A,y=Z,h=U,v=W,x=L,d=false,a=null,s="accept",l=new WeakMap,c=null;},S=F=>{if(F===g)return;let A=new WeakSet,$=[],W=[];try{for(let _ of F){if(_.kind!=="revision")continue;let L=!t.has(_.author),Z=R.get(_);Z===void 0&&(Z=o?.(_)??!0,W.push([_,Z])),!(L&&Z)&&(A.add(_),Z||$.push(_));}}catch(_){if(d)o=a,i=s,R=l,g=c,a=null,s="accept",l=new WeakMap,c=null,u+=1;else {let L=new WeakSet,Z=[];for(let ee of F){if(ee.kind!=="revision")continue;let te=C.get(E(ee))??true;(t.has(ee.author)||!te)&&L.add(ee),te||Z.push(ee);}w(F,L,Z);}throw d=false,_}for(let[_,L]of W)R.set(_,L);let U=new Map;for(let _ of F)_.kind==="revision"&&U.set(E(_),R.get(_)??true);C=U,w(F,A,$);};return {get hiddenAuthors(){return r?.hiddenAuthors??chunkDBOOTED4_cjs.bb},get hiddenAuthorList(){return n},get stateKey(){return String(u)},get hasFilter(){return t.size>0||o!==null},filterFor(F){return o?(S(F),y):r},filterForSession(F){return o?(S(F.reviewItems()),y):r},filterItems(F){if(!o){if(t.size===0)return F;if(F===f)return m;let A=F.filter($=>{let W=hE($);return W===null||!t.has(W)});return f=F,m=A.length===F.length?F:chunkWO4V6PNS_cjs.Ck(A),m}return S(F),b},includesRevisionItem(F){return !k.has(F)},setPredicate(F,A="accept"){return o===null&&F===null?false:F===null?(o=null,i="accept",a=null,s="accept",d=false,R=new WeakMap,l=new WeakMap,C=new Map,c=null,b=[],k=new WeakSet,y=r,h=t,v=new Set,x="accept",P(),true):(a=o,s=i,l=R,c=g,d=true,o=F,i=A,R=new WeakMap,P(),true)},isVisible:F=>!t.has(F),setVisible(F,A){if(A===!t.has(F))return false;let $=new Set(t);return A?$.delete(F):$.add(F),t=$,n=Object.freeze([...$]),r=chunkDBOOTED4_cjs.cb($),P(),true},setAllVisible(F,A){let $=A?new Set:new Set(F);return $.size===t.size&&[...$].every(W=>t.has(W))?false:(t=$,n=Object.freeze([...$]),r=chunkDBOOTED4_cjs.cb($),P(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,P(),true)}}}function bE(e,t){return t.filterItems(e)}function U6(e){let t=new Set;for(let n of e)for(let r of chunkWO4V6PNS_cjs.Lj(n))t.add(r);return t}function z6(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function G6(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function hE(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function vE(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let i=t.surface();if(i)return i.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}var Z6=Object.freeze({mode:"atomic",run:e=>e(),wrap:e=>e,methods:e=>e,listeners:()=>{},selectsWholeFieldWhen:()=>{},edits:e=>e});function X6(e){if(e===void 0||e==="atomic")return "atomic";if(e==="editable")return "editable";throw new TypeError('Invalid fieldResults: use "atomic" or "editable"')}var lh='fieldResults "editable" is not supported in a collaboration session: shared paragraph text keeps each field one unit';function Y6(e){if(e==="atomic")return Z6;let t=o=>chunkWO4V6PNS_cjs.nf(e,o),n=o=>function(...i){return t(()=>o.apply(this,i))},r=()=>false;return {mode:e,run:t,wrap:n,selectsWholeFieldWhen(o){r=o;},edits:o=>function(...i){return r()?chunkWO4V6PNS_cjs.of(()=>o.apply(this,i)):o.apply(this,i)},methods(o){for(let i of Reflect.ownKeys(o)){let a=Object.getOwnPropertyDescriptor(o,i);if(a?.configurable){if(typeof a.value=="function")a.value=n(a.value);else if(a.get||a.set)a.get&&(a.get=n(a.get)),a.set&&(a.set=n(a.set));else continue;Object.defineProperty(o,i,a);}}return o},listeners(o){let i=o.addEventListener,a=o.removeEventListener,s=new WeakMap,l=c=>{let d=s.get(c);return d||(d=typeof c=="function"?function(u){return t(()=>c.call(this,u))}:u=>t(()=>c.handleEvent(u)),s.set(c,d)),d};Object.defineProperty(o,"addEventListener",{configurable:true,writable:true,value(c,d,u){d&&i.call(o,c,l(d),u);}}),Object.defineProperty(o,"removeEventListener",{configurable:true,writable:true,value(c,d,u){d&&a.call(o,c,s.get(d)??d,u);}});}}}function xE(e,t){if(t.mode==="atomic")return e;let n=e,r=n.subscribe.bind(n),o=n.applyTreeOps.bind(n),i=n.applyTreeOpsAtomic.bind(n);return n.subscribe=a=>r(t.wrap(a)),n.applyTreeOps=t.edits(o),n.applyTreeOpsAtomic=t.edits(i),t.methods(e)}function wu(e){let t=X6(e.fieldResults);if(t==="editable"&&e.collaborationModel)throw new TypeError(lh);return Y6(t)}function Su(e,t){let n=e.part(t),r=n?chunkWO4V6PNS_cjs.Ta(n,t):null;return r?.kind!=="paragraph"?[]:chunkWO4V6PNS_cjs.Ui(r).filter(o=>o.start<o.end)}function Q6(e,t){return Su(e,t.paragraphId).find(n=>t.offset>n.start&&t.offset<n.end)}function J6(e,t){let n=(i,a)=>{let s=Q6(e,i);if(!s||a.paragraphId===i.paragraphId&&a.offset>=s.start&&a.offset<=s.end)return i;let l=e.compare(a,i)<0?s.end:s.start;return {paragraphId:i.paragraphId,offset:l}},r=n(t.anchor,t.head),o=n(t.head,t.anchor);return r===t.anchor&&o===t.head?t:{anchor:r,head:o}}function e_(e,t){if(t.length!==2)return t;let[n,r]=t;if(n?.op!=="deleteText"||r?.op!=="insertText"||r.paragraphId!==n.paragraphId||n.start>=n.end||r.offset!==n.start&&r.offset!==n.end)return t;let{start:o,end:i}=n,a=Su(e,n.paragraphId).find(l=>l.start<=o&&i<=l.end);if(!a||o!==a.start&&i!==a.end)return t;let s=r.text.length;return [{...r,offset:o,...o===a.start?{bias:"right"}:{}},{...n,start:o+s,end:i+s}]}function wE(e,t,n){if(n.mode==="atomic")return e;let{selectForDeletion:r,wordDeletionBoundary:o,beforeSelect:i,annotate:a}=e,s=null,l=d=>s!==null&&d.anchor.paragraphId===s.anchor.paragraphId&&d.head.paragraphId===s.head.paragraphId&&d.anchor.offset===s.anchor.offset&&d.head.offset===s.head.offset;n.selectsWholeFieldWhen(()=>l(t.selection()));let c=d=>{let{anchor:u,head:f}=t.selection();if(!(u.paragraphId!==f.paragraphId||u.offset!==f.offset))return Su(t,f.paragraphId).find(m=>d===-1?m.end===f.offset:m.start===f.offset)};return Object.assign(e,{annotate:n.wrap(d=>a.call(e,l(t.selection())?d:e_(t,d))),selectForDeletion:n.wrap(d=>{let u=t.writable()?c(d==="backward"?-1:1):void 0;if(!u)return r.call(e,d);let{paragraphId:f}=t.selection().head;return s={anchor:{paragraphId:f,offset:u.start},head:{paragraphId:f,offset:u.end}},t.select(s),true}),wordDeletionBoundary:n.wrap((d,u,f,m)=>{let g=o.call(e,d,u,f,m),b=Su(t,t.selection().head.paragraphId),y=b.find(v=>f===-1?v.end===u:v.start===u);if(y)return f===-1?y.start:y.end;let h=g;for(let v of b)for(let x of [v.start,v.end])f===-1&&x<u&&x>h&&(h=x),f===1&&x>u&&x<h&&(h=x);return h}),beforeSelect:n.wrap(d=>(l(d)||(s=null),i.call(e,J6(t,d))))})}function SE(e,t){let n,r=()=>{n!==void 0&&(n=void 0,t());};return ()=>{let o=e.ownerDocument?.defaultView??null;n!==void 0&&n===o||(n=o,o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(r):queueMicrotask(r));}}var kE=chunkDBOOTED4_cjs.Oe;function IE(e){let{session:t,...n}=e;return chunkDBOOTED4_cjs.af({view:t,...n})}function $t(e){return e.closest(".docx-editor__scroll-container")}function RE(e){let t=$t(e);t&&(t.scrollTop=0,t.scrollLeft=0);}function PE(e,t,n){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return {top:(t.scrollTop!==0&&r.top===0&&o.top===0?t.scrollTop-e.offsetTop:o.top+t.clientTop-r.top)/n,height:t.clientHeight/n}}function TE(e,t,n){let r=$t(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=PE(e,r,n),i=o.top+o.height/2;for(let a of t.pages)if(i<a.box.y+a.box.height)return a.index+1;return t.pages.length}function EE(e,t,n,r){let o=$t(e);if(!o||o.clientHeight===0)return;let i=PE(e,o,r),a=[];for(let s of [n.anchor,n.head]){let l=chunkDBOOTED4_cjs.qe(t,s);l&&a.push(l.pageIndex);}return chunk5JPIEN54_cjs.ha({layout:t,viewport:i,overscanPages:1,pinnedPages:a})}function ch(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function ku(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,i=0;for(let s of o)i=Math.max(i,s.box.x+s.box.width);let a=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)a.set(s.index,(i-s.box.width)/2-s.box.x);return {width:i,height:r,pageOffsetX:a}}function CE(e,t){if(e.width!==t.width||e.height!==t.height||e.pageOffsetX.size!==t.pageOffsetX.size)return false;for(let[n,r]of e.pageOffsetX)if(t.pageOffsetX.get(n)!==r)return false;return true}function OE(e,t,n,r){for(let o of t.pages){let i=e.children.item(o.index);if(i?.dataset.pageIndex!==String(o.index))continue;let a=n.pageOffsetX.get(o.index)??0;i.style.left=`${(o.box.x+a)*r}px`;}}function ME(e){let{pagesLayer:t,listeners:n}=e,r=n.onDocument("selectionchange",e.onSelectionChange),o=SE(t,e.rematerialize),i=n.onDocument("scroll",m=>{let g=$t(e.container());!g||m.target!==g||o();},{capture:true,passive:true}),a=n.onWindow("resize",o,{passive:true}),s=null,l=null,c=null,d=false;function u(){s?.disconnect(),s=null,l=null,c=null;}function f(){if(d)return;let m=Ze(t);if(m!==l&&(u(),l=m,s=typeof m.ResizeObserver=="function"?new m.ResizeObserver(o):null),!s)return;let g=$t(e.container());g!==c&&(s.disconnect(),c=g,g&&s.observe(g));}return f(),{schedule:o,watchScrollerSize:f,rebind(){d=false,f(),o();},suspend(){d=true,u();},destroy(){r(),i(),a(),u();}}}function AE(e){let t=new Set,n=false;function r(s){return s==="document"?Gs(e()):Ze(e())}function o(s){s.bound?.removeEventListener(s.type,s.listener,s.options),s.bound=null;}function i(s){let l=r(s.target);s.bound!==l&&(o(s),l.addEventListener(s.type,s.listener,s.options),s.bound=l);}function a(s,l,c,d){let u={target:s,type:l,listener:c,options:d,bound:null};return t.add(u),n||i(u),()=>{o(u),t.delete(u);}}return {onDocument(s,l,c){return a("document",s,l,c)},onWindow(s,l,c){return a("window",s,l,c)},rebind(){n=false;for(let s of t)i(s);},suspend(){n=true;for(let s of t)o(s);},clear(){for(let s of t)o(s);t.clear();},stale(){if(n)return false;for(let s of t)if(s.bound!==r(s.target))return true;return false}}}var t_=["docx-paginated-surface--viewing","docx-paginated-surface--hf-editing"],n_=["data-docx-layout-pending","data-docx-opening-preview"];function r_(e,t){if(e===t)return;t.style.position="relative";let n=Array.from(e.childNodes);t.replaceChildren();for(let r of n)t.appendChild(r);for(let r of t_)e.classList.contains(r)&&(e.classList.remove(r),t.classList.add(r));for(let r of n_){let o=e.getAttribute(r);o!==null&&(e.removeAttribute(r),t.setAttribute(r,o));}e.style.removeProperty("position"),e.style.removeProperty("width"),e.style.removeProperty("height");}var FE=["focusin","pointerdown","pointerenter","wheel"],o_=5,i_=2e3;function a_(e){return _t(e)?e.localName==="input"||e.localName==="textarea"||e.localName==="select"||vr(e)&&e.isContentEditable:false}function LE(e){let t=null,n=null,r=false,o=Number.NEGATIVE_INFINITY,i=f=>{let m=f.relatedTarget;ko(m)&&e.pagesLayer.contains(m)||(o=a_(m)?Number.NEGATIVE_INFINITY:Date.now());};e.pagesLayer.addEventListener("focusout",i);let a=ut(()=>e.pagesLayer);function s(f){if(t!==null)return;let m=$t(f),g=e.scale();n=m?{x:(m.scrollLeft-f.offsetLeft)/g,y:(m.scrollTop-f.offsetTop)/g}:null;let b=e.pagesLayer.ownerDocument.activeElement;r=!!b&&e.pagesLayer.contains(b)||Date.now()-o<i_;}function l(){let f=n;if(n=null,!f)return;let m=()=>{let y=e.container(),h=$t(y);if(!h)return false;let v=e.scale();return h.scrollTop=Math.max(0,f.y*v+y.offsetTop),h.scrollLeft=Math.max(0,f.x*v+y.offsetLeft),true};m();let g=0,b=()=>{t!==null||m()||++g>o_||a.requestAnimationFrame(b);};queueMicrotask(b);}function c(f){s(e.container()),e.settle(),e.listeners.suspend(),e.viewport()?.suspend(),r_(e.container(),f),e.setContainer(f);}let d=false;function u(){if(!(d||t!==null||e.destroyed()||!e.listeners.stale())){d=true;try{e.listeners.rebind(),e.viewport()?.rebind(),e.settle(),e.onHostMoved?.(e.pagesLayer.ownerDocument);}finally{d=false;}}}for(let f of FE)e.pagesLayer.addEventListener(f,u,{capture:true,passive:true});return {moveTo(f,m){if(!e.destroyed()){if(f===e.container()&&t===null)return u();c(f),t=null,e.listeners.rebind(),e.viewport()?.rebind(),(m?.focus??r)&&e.pagesLayer.focus({preventScroll:true}),e.repaint(),l();}},park(){if(e.destroyed()||t!==null)return;let f=e.pagesLayer.ownerDocument.createElement("div");c(f),t=f;},parked:()=>t!==null,heal:u,destroy(){for(let f of FE)e.pagesLayer.removeEventListener(f,u,{capture:true});e.pagesLayer.removeEventListener("focusout",i);}}}function dh(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function DE(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),i=t;if(i?.layout===n&&i.items===r&&i.styles===o)return i;let a=e.slots.resolve(chunkXMJKFURD_cjs.d(n),(function*(){for(let f of r){let m=dh(f);m!==null&&(yield m);}})()),s=i?.value,l=s!==void 0&&s.size===a.size&&[...a].every(([u,f])=>s.get(u)===f),c=l?s:a,d=i!==null&&l&&i.styles===o?i.resolved:new Map(chunkXMJKFURD_cjs.c(c,o).map(u=>[u.author,u]));return t={layout:n,items:r,styles:o,value:c,resolved:d},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function NE(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return chunkBTQKU64Q_cjs.a(o.color)??chunkXMJKFURD_cjs.a(o.slot);let i=e.slots.resolve(r.value,[n]).get(n);return i===void 0?void 0:chunkXMJKFURD_cjs.a(i)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:chunkXMJKFURD_cjs.b(r)}),chunkBTQKU64Q_cjs.a(t.resolved.get(n)?.color)}}}function wi(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}var HE=new WeakMap;function s_(e){let t=[],n={x:e.box.x,y:e.box.y};for(let r of [e.header,e.footer]){if(!r)continue;let o={x:r.box.x,y:r.box.y};chunkDBOOTED4_cjs.Ha(r,(i,a)=>{a.textboxDepth===0||a.textboxOwner?.accessibility.hidden||t.push(chunkDBOOTED4_cjs.Pe(i,a.storyOrigin.x-e.contentBox.x,a.storyOrigin.y-e.contentBox.y));},o,i=>chunkDBOOTED4_cjs.ya(i,o,n));}return t}function Si(e){let t=HE.get(e);if(t)return t;let n=e.pages.map(o=>{let i=chunkDBOOTED4_cjs.Ad(o).flatMap(a=>{let s=a.textboxStory;return s.fragments.flatMap(l=>l.kind==="paragraph"?[chunkDBOOTED4_cjs.Pe(l,a.x+s.contentOffset.x,a.y+s.contentOffset.y)]:[])});return i.push(...s_(o)),i.length?{...o,fragments:[...o.fragments,...i]}:o}),r=n.every((o,i)=>o===e.pages[i])?e:{...e,pages:n};return HE.set(e,r),r}function BE(e,t,n){let r=t(e.anchor.paragraphId),o=t(e.head.paragraphId);return !r||!o?null:{anchor:{paragraphId:r.paragraphId,offset:Math.max(0,e.anchor.offset)},head:{paragraphId:o.paragraphId,offset:Math.max(0,e.head.offset)},...n?{kind:n}:{}}}function $E(e,t){let n=chunkWO4V6PNS_cjs.Ta(e,t);if(!n||n.kind==="textValue")return null;let r=chunkWO4V6PNS_cjs.wb(n);return !r||!chunkWO4V6PNS_cjs.vb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var uh=new WeakMap;function l_(e,t,n){return e.map(r=>chunkBTQKU64Q_cjs.a(n?.(r.name))??chunkBTQKU64Q_cjs.a(r.color)??chunkBTQKU64Q_cjs.a(t?.(r.name)))}function c_(e,t){let n="";for(let[r,o]of e.entries())n+=`${o.actorId} ${o.name} ${t[r]??""} ${o.kind??""} `,n+=`${o.anchor.nodeId}:${o.anchor.offset} `,n+=`${o.head.nodeId}:${o.head.offset}
25
+ `;return n}function d_(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function u_(e){if(!e||e.size===0)return "";let t=[];for(let[n,r]of e)t.push(`${n}:${r}`);return t.sort(),t.join(",")}function f_(e,t,n){return e.layout===n.layout&&e.fingerprint===n.fingerprint&&e.pagesKey===n.pagesKey&&e.scale===n.scale&&e.offsetKey===n.offsetKey&&e.labelHost===n.labelHost&&e.childCount===t.childElementCount}function _E(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function p_(e,t){let n=chunk5JPIEN54_cjs.ra(e,t.anchor.nodeId),r=chunk5JPIEN54_cjs.ra(e,t.head.nodeId);if(!n||!r)return [];let o=chunk5JPIEN54_cjs.ja(e,n,r);return o?chunk5JPIEN54_cjs.na(e,o.cellIds).map(i=>({...i,className:"docx-remote-selection-rect"})):[]}function qE(e,t,n,r){t=Si(t);let{scale:o,pageOffsetX:i,pages:a,colorForAuthor:s,declaredColorFor:l}=r,c=r.labelHost??null,d=l_(n,s,l),u={layout:t,fingerprint:c_(n,d),pagesKey:d_(a),scale:o,offsetKey:u_(i),labelHost:c},f=uh.get(e);if(f&&f_(f,e,u))return;uh.delete(e);let m=[],g=[],b=[],y=[];for(let[k,R]of n.entries())R.kind==="cells"||_E(R)||y.push({key:String(k),from:{paragraphId:R.anchor.nodeId,offset:R.anchor.offset},to:{paragraphId:R.head.nodeId,offset:R.head.offset}});let h=y.length>0?chunkDBOOTED4_cjs.Ee(t,y,chunkDBOOTED4_cjs.Ua(t),a,r.measurer):null;for(let[k,R]of n.entries()){let C=d[k],P=chunkDBOOTED4_cjs.qe(t,{paragraphId:R.head.nodeId,offset:R.head.offset},r.measurer);if(P){let w=chunkDBOOTED4_cjs.De(t,R.head.nodeId,P.pageIndex);b.push({selection:R,...C?{color:C}:{},pageIndex:P.pageIndex,x:P.x+w.x,y:P.y+w.y});}if(R.kind==="cells"){let w=p_(t,R);if(w.length>0){for(let S of w)m.push(S),g.push(C);continue}}if(_E(R)){let w=chunkDBOOTED4_cjs.qe(t,{paragraphId:R.anchor.nodeId,offset:R.anchor.offset},r.measurer);if(!w)continue;let S=chunkDBOOTED4_cjs.De(t,R.anchor.nodeId,w.pageIndex);m.push({pageIndex:w.pageIndex,x:w.x+S.x,y:w.y+S.y,width:Math.max(1/o,1),height:w.height,className:"docx-remote-caret"}),g.push(C);continue}let E=h?.get(String(k));if(E)for(let w of E)m.push({...w,className:"docx-remote-selection-rect"}),g.push(C);}chunkXMJKFURD_cjs.s(e,t,m,{scale:o,pageOffsetX:i}),[...e.children].forEach((k,R)=>{let C=chunkBTQKU64Q_cjs.a(g[R]);!C||!vr(k)||k.style.setProperty("--doc-remote-color",C);});let v=e.ownerDocument,x=[];for(let k of b){let R=t.pages[k.pageIndex];if(!R)continue;let C=v.createElement("div");C.className="docx-remote-caret-label",c?(C.setAttribute("data-docx-remote-actor",k.selection.actorId),x.push({element:C,selection:k.selection})):C.textContent=k.selection.name,C.style.left=`${(R.contentBox.x+k.x+(i?.get(k.pageIndex)??0))*o}px`,C.style.top=`${(R.contentBox.y+k.y)*o}px`;let P=chunkBTQKU64Q_cjs.a(k.color);P&&C.style.setProperty("--doc-remote-color",P),e.append(C);}uh.set(e,{...u,childCount:e.childElementCount}),c&&c.publish(x);}function m_(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var zE=/^[^\s]{1,512}$/,fh=/["\\\u0000-\u001f\u007f]/;function GE(e,t){return !e||t===void 0||!/^\d{1,9}$/.test(t)||!zE.test(e)||e==="__proto__"?null:{paragraphId:e,offset:Number(t)}}function Co(e){let t=GE(e.dataset?.paragraphId,e.dataset?.start);if(!t)return null;let{paragraphId:n,offset:r}=t,o=e.dataset?.end,i=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:n,start:r,end:i}}function Ca(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;return !t.classList.contains("docx-inline-drawing-advance")||t.parentElement?.dataset.paragraphId===void 0?null:GE(t.dataset.drawingParagraphId,t.dataset.drawingStart)}function g_(e,t){let n=fh.test(t)?"[data-paragraph-id][data-start], .docx-inline-drawing-advance":`[data-paragraph-id="${t}"][data-start], .docx-inline-drawing-advance[data-drawing-paragraph-id="${t}"]`,r=[],o=[];for(let i of e.querySelectorAll(n))i.classList.contains("docx-inline-drawing-advance")?Ca(i)?.paragraphId===t&&o.push(i):r.push(i);return {spans:r,spacers:o}}function Ru(e,t,n){return fh.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function ZE(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=Co(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function XE(e){return e.querySelector("[data-docx-hf-active]")}function ki(e,t){if(!e||t&&!t.contains(e))return;let o=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest("[data-page-index]")?.dataset?.pageIndex;if(!(o===void 0||!/^\d{1,9}$/.test(o)))return Number(o)}function h_(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Iu(e,t){let n=XE(e);if(n)return [n,e];let r=h_(e,t);return r&&r!==e?[r,e]:[e]}function WE(e,t){let n=l=>({paragraphId:l.paragraphId,offset:t?l.end:l.start}),r=l=>t?{...l,offset:l.offset+1}:l,o=ZE(e);if(o)return n(o.identity);let i=Ca(e);if(i)return r(i);if(e.nodeType!==Node.ELEMENT_NODE)return null;let a=e.querySelectorAll("[data-paragraph-id][data-start], .docx-inline-drawing-advance"),s=t?[...a].reverse():[...a];for(let l of s){let c=Ca(l);if(c)return r(c);let d=Co(l);if(d)return n(d)}return null}function KE(e,t,n=false){let r=[...e.childNodes];if(r.length===0)return null;let o=Ca(r[t-1]);if(o)return {paragraphId:o.paragraphId,offset:o.offset+1};for(let i=Math.max(0,t);!n&&i<r.length;i+=1){let a=WE(r[i],false);if(a)return a}for(let i=Math.min(t,r.length)-1;i>=0;i-=1){let a=WE(r[i],true);if(a)return a}return null}function jE(e,t,n){if(!n.contains(e))return null;let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(r?.closest("[data-docx-field]"))return null;let o=r?.closest("[data-docx-hf]");if(o&&!o.hasAttribute("data-docx-hf-active")||XE(n)&&r?.closest(".docx-page-content"))return null;let i=r?.closest("[data-docx-marker]"),a=Ca(i??void 0);if(a)return t>0?{...a,offset:a.offset+1}:a;let s=r?.closest(".docx-terminator-seat");if(s?.querySelector(".docx-line-break-mark")&&s.parentElement){let d=s.parentElement,u=[...d.querySelectorAll(".layout-run[data-start]")].filter(g=>g.closest(".docx-line")===d).flatMap(g=>{let b=Co(g);return b?[{run:g,identity:b}]:[]}),f=u.at(-1)?.identity.paragraphId,m;for(let g of u)g.identity.paragraphId===f&&(!m||g.identity.start>m.identity.start)&&(m=g);if(m){let g=m.run.textContent===`
26
+ `,{start:b,end:y}=m.identity;return {paragraphId:m.identity.paragraphId,offset:g?b:y}}}let l=s??(i?.classList.contains("docx-wrap-advance")?i:null);if(l?.parentElement){let d=[...l.parentElement.childNodes],u=d.indexOf(l);if(s){let g="[data-start], a, br, .docx-inline-drawing-advance, .docx-wrap-advance";for(;u>0&&!d[u-1].matches?.(g);)u-=1;}let f=!s&&t>0?1:0,m=KE(l.parentElement,u+f,!!s);if(m)return m}if(i)return i.parentElement?YE(i.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let d=e,u=Co(d);if(u)return {paragraphId:u.paragraphId,offset:t>0?u.end:u.start};let f=KE(d,t);return f||x_(d)}let c=ZE(e);return c?{paragraphId:c.identity.paragraphId,offset:m_(c.identity,t)}:null}function Oa(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t;if(!n||!o)return null;let a=jE(n,r,e),s=jE(o,i,e);if(!a||!s){let l=a??s;return l?{anchor:l,head:l}:null}return {anchor:a,head:s}}function ph(e,t){if(!t||t.rangeCount===0)return false;let{anchorNode:n,focusNode:r}=t;return !!n&&e.contains(n)||!!r&&e.contains(r)}function VE(e,t,n,r){if(r!==void 0)for(let o of Iu(e,n)){let i=fh.test(r)?"[data-line-id]":`[data-line-id="${r}"]`;for(let a of o.querySelectorAll(i)){if(a.dataset.lineId!==r)continue;let s=UE(a,t);if(s)return s}}for(let o of Iu(e,n)){let i=UE(o,t);if(i)return i}return null}function y_(e,t){let n=null;for(let r of e){if(!r.hasAttribute("data-docx-field")||!r.parentNode)continue;let o=Co(r);if(o?.paragraphId===t.paragraphId){if(o.start===t.offset)return {node:r.parentNode,offset:[...r.parentNode.childNodes].indexOf(r)};o.end===t.offset&&(n=r);}}if(n){let r=Co(n);for(let o of e){let i=Co(o);i?.paragraphId===t.paragraphId&&i.start===r.start&&i.end===r.end&&(n=o);}}return n?.parentNode?{node:n.parentNode,offset:[...n.parentNode.childNodes].indexOf(n)+1}:null}function UE(e,t){let{spans:n,spacers:r}=g_(e,t.paragraphId),o=y_(n,t);if(o)return o;let i=null,a=false;for(let m of n){let g=Co(m);if(!g||g.paragraphId!==t.paragraphId)continue;let b=b_(m),y=m.textContent?.length??0,h=g.end;if(b){if(m.closest?.("[data-docx-field]")){a=true;continue}if(a=true,t.offset>=g.start&&t.offset<=h){let v={node:b,offset:Math.min(t.offset-g.start,y)};if(t.offset<h)return v;i=v;}}}let s=m=>r.find(g=>Ca(g)?.offset===m)??null,l=s(t.offset);if(i&&l?.parentNode&&!l.parentNode.contains(i.node))return {node:l.parentNode,offset:[...l.parentNode.childNodes].indexOf(l)};if(i)return i;let c=l,d=c?null:s(t.offset-1),u=c??d;if(u?.parentNode)return {node:u.parentNode,offset:[...u.parentNode.childNodes].indexOf(u)+(d?1:0)};if(a||=r.length>0,a)return null;let f=v_(e,t.paragraphId);return f?{node:f,offset:0}:null}function b_(e){let t=e.firstChild;for(;t&&t.nodeType===Node.ELEMENT_NODE;)t=t.firstChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function v_(e,t){let n=null;for(let r of Ru(e,t,""))if(r.dataset?.paragraphId===t&&r.dataset?.start===void 0){if(r.dataset?.lineId!==void 0)return r;n??=r;}return n}function YE(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!zE.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function x_(e){let t=YE(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function QE(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??ki(n.anchorNode,e),a=At(t,{anchor:t.head,head:t.head})?r?.preferredLineId:void 0,s=VE(e,t.anchor,o,a),l=VE(e,t.head,o,a);if(!s||!l)return false;let c=Oa(e,n);if(c&&At(c,t)){let d=ki(n.anchorNode,e),f=(n.focusNode?.nodeType===Node.ELEMENT_NODE?n.focusNode:n.focusNode?.parentElement)?.closest("[data-line-id]")?.dataset.lineId;if((o===void 0||d===o)&&(a===void 0||f===a))return true}try{return n.setBaseAndExtent(s.node,s.offset,l.node,l.offset),!0}catch{return false}}function At(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}var w_='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function JE(e,t,n){let r=e.dataset.end;if(r===void 0||!/^\d{1,9}$/.test(r))return n;let o=Number(r);return o>=t?o:n}function eC(e,t){if(e.dataset.paragraphId!==t)return null;let n=e.dataset.start;return n===void 0||!/^\d{1,9}$/.test(n)?null:Number(n)}function S_(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function k_(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function tC(e,t,n,r){if(e.dataset.docxField!==void 0){let i=JE(e,t,t);return {start:t,end:i,text:n.slice(t,i),seq:r}}let o=e.textContent??"";return {start:t,end:JE(e,t,t+o.length),text:o,seq:r}}function nC(e,t){for(let n of e.childNodes){if(n.nodeType===Node.TEXT_NODE){let s=n.textContent??"";s.length>0&&(t.pieces.push({start:t.end,end:t.end,text:s,seq:t.seq}),t.seq+=1);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let r=n,o=eC(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0)continue;let s=r.dataset?.drawingStart;if(r.dataset?.drawingParagraphId===t.paragraphId&&s!==void 0&&/^\d{1,9}$/.test(s)){t.end=Math.max(t.end,Number(s)+1);continue}if(r.matches?.(w_))continue;nC(r,t);continue}let i=tC(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,i.end);let a=`${i.start}:${i.end}`;t.ranges.has(a)||(t.ranges.add(a),t.pieces.push(i));}}function I_(e,t,n,r){let o=[];for(let a of Ru(e,t,"")){let s=a;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let i=new Map;for(let a of o){let s=a.dataset.fragmentIndex??"",l=k_(a,n,r),c=i.get(s);(!c||l>c.affinity)&&i.set(s,{element:a,affinity:l});}return [...i.values()].map(a=>a.element)}function R_(e,t,n){for(let r of Ru(e,n.paragraphId,"[data-start]")){let o=r,i=eC(o,n.paragraphId);if(i===null||t.some(l=>l.contains(o)))continue;let a=tC(o,i,n.modelText,n.seq);n.seq+=1;let s=`${a.start}:${a.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(a));}}function P_(e,t){let n=[...e].sort((i,a)=>i.start-a.start||i.seq-a.seq),r="",o=0;for(let i of n)i.start>o&&(r+=t.slice(o,i.start)),r+=i.text,o=Math.max(o,i.end);return o<t.length&&(r+=t.slice(o)),r}function rC(e,t,n,r){let o=I_(e,t,r,S_(r)),i={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let a of o)nC(a,i);return R_(e,o,i),i.pieces.length===0?null:P_(i.pieces,n)}function mh(e){if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return t==="y"?"redo":t==="z"?e.shiftKey?"redo":"undo":null}var lC={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"};function T_(e){return lC[e.key]||e.key==="PageUp"||e.key==="PageDown"?true:(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="a"}var oC={l:"left",e:"center",r:"right",j:"both"},iC={1:"240",5:"360",2:"480"},aC={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function E_(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}function cC(e,t={}){return n=>{if(n.defaultPrevented||e.editingMode()==="view"&&T_(n))return;if(n.key==="F5"&&n.shiftKey&&(n.ctrlKey||n.metaKey)&&!n.altKey&&!n.isComposing&&t.onRequestBookmark?.()){n.preventDefault();return}if(Cg(n)&&t.onRequestGoTo?.()){n.preventDefault();return}if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}let r=zd(n);if(E_(n,r)&&!n.shiftKey){let s=r;if(s==="f"){n.preventDefault(),e.insertNote("footnote");return}if(s==="d"){n.preventDefault(),e.insertNote("endnote");return}if(s==="c"){n.preventDefault(),e.formatPainter.capture();return}if(s==="v"){n.preventDefault(),e.formatPainter.apply();return}}let o=n.metaKey||n.ctrlKey,i=lC[n.key];if(i){let s=i;n.key==="Home"||n.key==="End"?o&&(s=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?s=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?s=n.key==="ArrowLeft"?"lineStart":"lineEnd":o&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(s=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(s,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(o?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){o||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){o||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}let s=n.shiftKey?"decrease":"increase";e.isListParagraph()?e.adjustIndent(s):e.indentWithTab(s)||(n.shiftKey?e.adjustIndent("decrease"):e.insertTab()),n.preventDefault();return}if(n.key==="Enter"){o?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(o&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(o&&!n.shiftKey&&aC[n.key.toLowerCase()]){let s=aC[n.key.toLowerCase()];e.toggleRunProperty(s.localName,s.attributes),n.preventDefault();return}if(o&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(o&&!n.shiftKey&&oC[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperties([{localName:"jc",attributes:{val:oC[n.key.toLowerCase()]},physicalAlignment:true}]),n.preventDefault();return}if(o&&!n.shiftKey&&iC[n.key]){e.setParagraphProperty("spacing",{line:iC[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}let a=mh(n);a&&(a==="redo"?e.redo():e.undo(),n.preventDefault());}}function dC(e){let t=i=>{let a=e.copyFlavours();return a.reason?(i.preventDefault(),false):!a.text||!i.clipboardData?false:(i.clipboardData?.setData("text/plain",a.text),a.html&&i.clipboardData?.setData("text/html",a.html),true)};return {onCopy:i=>{t(i)&&i.preventDefault();},onCut:i=>{t(i)&&(e.deleteSelection(),i.preventDefault());},onPaste:i=>{let a=fm(i.clipboardData),s=i.clipboardData?.getData("text/html")??"";i.preventDefault(),!(!a&&!s)&&e.pasteRich(a,s.length>0?s:null);}}}function sC(e){let t=fm(e.dataTransfer);return t.length>0?t:null}function uC(e,t){return n=>{if(n.preventDefault(),!t.isComposing()){if(n.inputType==="insertText"&&n.data!=null){e.enqueueType(n.data);return}if(n.inputType!=="insertFromPaste"){if(n.inputType==="insertReplacementText"){let r=n.data??sC(n);if(!r)return;A_(e,O_(n),r),t.onBrowserSelectionFixup?.();return}if(n.inputType==="deleteContentBackward"){e.deleteBackward();return}if(n.inputType==="deleteWordBackward"){e.deleteWordBackward();return}if(n.inputType==="deleteContentForward"){e.deleteForward();return}if(n.inputType==="deleteWordForward"){e.deleteWordForward();return}if(n.inputType==="insertLineBreak"){e.insertLineBreak();return}if(n.inputType==="insertFromDrop"||n.inputType==="insertFromPasteAsQuotation"){let r=sC(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function C_(e){let{startContainer:t,endContainer:n}=e;if(t===n&&t.nodeType===Node.TEXT_NODE)return (t.textContent??"").slice(e.startOffset,e.endOffset);let r=t.ownerDocument;if(!r)return null;try{let o=r.createRange();return o.setStart(t,e.startOffset),o.setEnd(n,e.endOffset),o.toString()}catch{return null}}function O_(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=C_(n);return r?{text:r,paragraphId:M_(n)}:null}function M_(e){let t=e.startContainer;return t.isConnected?(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement??null)?.closest("[data-paragraph-id]")?.getAttribute("data-paragraph-id")??null:null}function A_(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,i=t.text;if(At(r.selection,Ke(o))&&o.offset>=i.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let a=Ce(e.session,o.paragraphId)??e.session.part(),s=chunkWO4V6PNS_cjs.hj(a,o.paragraphId);s!==null&&s.slice(o.offset-i.length,o.offset)===i&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-i.length},head:o});}}e.type(n);}function fC(e,t,n,r=null){for(let o of Iu(e)){let i=rC(o,t,n,r);if(i!==null)return i}return null}function pC(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let i=n.slice(r,n.length-o),a=[];return t.length-o>r&&a.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),i.length>0&&a.push({op:"insertText",paragraphId:e,offset:r,text:i}),a.length===0?null:{ops:a,caret:r+i.length}}var F_="equation replacement and removal are not supported in suggesting mode",mC=new WeakMap,gC=new WeakSet;function gh(e,t){let n=chunkWO4V6PNS_cjs.Ta(e,t);if(!n||n.kind!=="paragraph")return [];let r=mC.get(n);if(r)return r;let o=[];for(let a of chunkWO4V6PNS_cjs.kg(n))for(let s of chunkWO4V6PNS_cjs.af(a.node)){let l=chunkWO4V6PNS_cjs.We(s);if(!l)continue;let c=Object.freeze({id:s.id,paragraphId:t,start:a.start,end:a.end,linear:chunkWO4V6PNS_cjs.Ye(l.expression),fallbackText:l.fallbackText,supported:Nn(l.expression)});Dn(l.expression)&&gC.add(c),o.push(c);}let i=Object.freeze(o);return mC.set(n,i),i}function hC(e,t,n){let r=gh(e,t).filter(o=>o.start===n);return r.length===0?null:r.map(o=>o.linear||o.fallbackText).join(" ")}function yC(e){return "controlProperties"in e&&e.controlProperties===true}function Dn(e){if(yC(e))return true;switch(e.kind){case "bar":return true;case "text":return e.format!==void 0;case "fallback":return false;case "row":return e.items.some(Dn);case "fraction":return Dn(e.numerator)||Dn(e.denominator);case "radical":return Dn(e.radicand)||e.degree!==void 0&&Dn(e.degree);case "script":return Dn(e.base)||e.subscript!==void 0&&Dn(e.subscript)||e.superscript!==void 0&&Dn(e.superscript);case "nary":return Dn(e.body)||e.lowerLimit!==void 0&&Dn(e.lowerLimit)||e.upperLimit!==void 0&&Dn(e.upperLimit)}}function Nn(e){if(yC(e))return false;switch(e.kind){case "fallback":case "bar":return false;case "text":return e.format===void 0;case "row":return e.items.every(Nn);case "fraction":return Nn(e.numerator)&&Nn(e.denominator);case "radical":return Nn(e.radicand)&&(e.degree===void 0||Nn(e.degree));case "script":return Nn(e.base)&&(e.subscript===void 0||Nn(e.subscript))&&(e.superscript===void 0||Nn(e.superscript));case "nary":return Nn(e.body)&&(e.lowerLimit===void 0||Nn(e.lowerLimit))&&(e.upperLimit===void 0||Nn(e.upperLimit))}}function bC(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function vC(e){let t=null,n=a=>{if(!e.pagesLayer.ownerDocument.defaultView||!_t(a))return null;let l=a.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(a,s)=>{let l=e.equationById(a);l&&(e.pagesLayer.contentEditable!=="false"&&e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=a=>{t=null;let s=n(a.target),l=s?.dataset.docxEquation;if(!s||!l)return;let c=s.getBoundingClientRect();t={equationId:l,rect:{left:c.left,top:c.top,right:c.right,bottom:c.bottom}};},i=a=>{let s=n(a.target),l=s?.dataset.docxEquation,c=t;if(t=null,!s||!l){if(!c)return;a.preventDefault(),r(c.equationId,c.rect);return}let d=s.getBoundingClientRect();a.preventDefault(),r(l,{left:d.left,top:d.top,right:d.right,bottom:d.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",i),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",i);}}}function xC(e){let t=()=>e.session.partFor(e.storyScope()),n=l=>{let c=t();return c?gh(c,l):[]},r=()=>{let l=e.selection().head;return bC(n(l.paragraphId),l)},o=l=>{let c=n(e.selection().head.paragraphId).find(d=>d.id===l);if(c)return c;for(let d of e.session.storyParts()){let u=chunkWO4V6PNS_cjs.Ta(d,l);if(!u||u.kind!=="generic"||u.namespaceUri!==chunkWO4V6PNS_cjs.Ue||u.localName!=="oMath")continue;let f=u;for(;f&&f.kind!=="paragraph";)f=chunkWO4V6PNS_cjs.Ua(d,f.id);return !f||f.kind!=="paragraph"?null:gh(d,f.id).find(m=>m.id===l)??null}return null},i=(l,c)=>{let d=false,u={paragraphId:l.paragraphId,offset:l.start};return e.commit(()=>{let f=e.session.applyTreeOps([c],e.selectionMark(),{paragraphId:u.paragraphId,start:u.offset,end:u.offset},e.storyScope());return d=f.committed,f},()=>({anchor:u,head:u})),d},a=(l,c)=>{let d=o(l);if(!d)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:F_};if(c==="replace"&&gC.has(d))return {ok:false,code:"unsupported",reason:"compact linear editing cannot preserve this equation source formatting"};let u=c==="replace"?{op:"setMathEquation",equationId:l,linear:d.linear}:{op:"removeMathEquation",equationId:l},f=e.writeRefusal(u);return f===null?{ok:true}:{ok:false,code:"locked",reason:f}},s=l=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:l.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:a,applyEquation(l,c){let d=o(l);if(!d)return false;let u=a(l,"replace");return u.ok?d.supported&&d.linear===c?true:i(d,{op:"setMathEquation",equationId:l,linear:c}):s(u)},removeEquation(l){let c=o(l);if(!c)return false;let d=a(l,"remove");return d.ok?i(c,{op:"removeMathEquation",equationId:l}):s(d)}}}function wC(e,t){for(let[n,r]of t){let o=chunkWO4V6PNS_cjs.Ta(e,n);if(o&&o.kind!=="textValue"&&o.kind==="paragraph"&&r&&r.end>r.start){let i=chunkWO4V6PNS_cjs.mg(o),a=[...o.children];for(;a.length;){let s=a.pop();if(s.kind!=="textValue"){if(chunk243W4WW2_cjs.G(s)){let l=i.spanOf(s);if(l?l.end>r.start&&l.start<r.end:r.start===0&&r.end===1/0)return true}for(let l of s.children)a.push(l);}}}}return false}function Pu(e){let t=chunkWO4V6PNS_cjs.Ee(e);if(!t.ok)return false;for(let n of t.package.parts.values())if(chunk243W4WW2_cjs.H([n.root]))return true;return false}function je(e){return e.kind!=="textValue"}function ge(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(je(n)&&n.localName===t&&n.namespaceUri===chunkWO4V6PNS_cjs.la)return n;return null}function it(e,t="val"){return e?chunkWO4V6PNS_cjs.$f(e,t,chunkWO4V6PNS_cjs.la):void 0}function Hn(e,t,n){return e?chunkWO4V6PNS_cjs.$f(e,t,n):void 0}function hh(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=hh(n);return t}function Ma(e,t,n){if(e.kind==="textValue")return null;if(e.localName===t&&e.namespaceUri===n)return e;for(let r of e.children){let o=Ma(r,t,n);if(o)return o}return null}function Oo(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function gn(e){return chunkWO4V6PNS_cjs.nd(e)}function yh(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var Ir=yh;function Tu(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function Jn(e){return `${Math.round(e/20*100)/100}pt`}var L_="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",D_=chunkDBOOTED4_cjs.Kb;function Sl(e,t,n){for(let o of chunkWO4V6PNS_cjs.Ke(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let i=chunkWO4V6PNS_cjs.B(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a&&je(a.root))return a.root}}let r=e.parts.get(n);return r&&je(r.root)?r.root:null}function SC(e){let t=Sl(e,L_,"/word/styles.xml"),n=new Map,r=null,o=null,i=null,a=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s};let l=0,c=null;for(let d of t.children){if(!je(d)||d.namespaceUri!==chunkWO4V6PNS_cjs.la)continue;if(d.localName==="docDefaults"){c=d,r=ge(ge(d,"rPrDefault"),"rPr"),o=ge(ge(d,"pPrDefault"),"pPr");continue}if(d.localName!=="style")continue;if(l>=chunkDBOOTED4_cjs.jd)break;l+=1;let u=chunkWO4V6PNS_cjs.$f(d,"styleId",chunkWO4V6PNS_cjs.la);if(!u)continue;n.set(u,d);let f=chunkWO4V6PNS_cjs.$f(d,"default",chunkWO4V6PNS_cjs.la),m=chunkWO4V6PNS_cjs.$f(d,"type",chunkWO4V6PNS_cjs.la);f==="1"||f==="true"||f==="on"?m==="paragraph"?i=u:m==="character"?a=u:m==="table"&&(s=u):(i===u&&(i=null),a===u&&(a=null),s===u&&(s=null));}if(t.namespaceUri===chunkWO4V6PNS_cjs.la){let d=chunk243W4WW2_cjs.K(c);d.run&&(r=chunk243W4WW2_cjs.M("rPr","application")),d.paragraph&&(o=chunk243W4WW2_cjs.M("pPr","application"));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s}}function no(e,t,n){let r=[],o=new Set,i=t;for(;i&&!o.has(i)&&r.length<D_;){o.add(i);let a=e.byId.get(i);if(!a)break;if(r.length===0&&n!==void 0){let s=chunkWO4V6PNS_cjs.$f(a,"type",chunkWO4V6PNS_cjs.la);if(s!==void 0&&s!==n)return []}r.unshift(a),i=it(ge(a,"basedOn"));}return r}function bh(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let i of n)r.push(i);let o=it(ge(t,"pStyle"));for(let i of no(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let a=ge(i,"pPr");a&&r.push(a);}return t&&r.push(t),r}function Eu(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let i=[];if(r)for(let u of r)i.push(u);let a=[],s=it(ge(t,"pStyle"));for(let u of no(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let f=ge(u,"rPr");f&&a.push(f);}let l=[],c=it(ge(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let u of no(e,c,"character")){let f=ge(u,"rPr");f&&l.push(f);}let d=[...o,...i,...a,...l];return n&&d.push(n),{all:d,defaults:o,tableLevel:i,paragraphLevel:a,characterLevel:l,direct:n}}function _n(e,t){let n=null;for(let r of e){let o=ge(r,t);o&&(n=o);}return n}function Ft(e,t,n){let r;for(let o of e){let i=ge(o,t);if(!i)continue;let a=chunkWO4V6PNS_cjs.$f(i,n,chunkWO4V6PNS_cjs.la);a!==void 0&&(r=a);}return r}function Cu(e){return !(e==="0"||e==="false"||e==="off")}function Rr(e,t){let n=false;for(let r of e){let o=ge(r,t);o&&(n=Cu(it(o)));}return n}function Mo(e,t){let n;for(let r of e){let o=ge(r,t);o&&(n=Cu(it(o)));}return n}function er(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return Cu(it(n));let r=Mo(e.tableLevel,t),o=Mo(e.paragraphLevel,t),i=Mo(e.characterLevel,t);return i===false||i===void 0&&o===false||i===void 0&&o===void 0&&r===false?false:Mo(e.defaults,t)===true?true:r===true!=(o===true)!=(i===true)}function vh(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return Cu(it(n));let r=Mo(e.characterLevel,t);if(r!==void 0)return r;let o=Mo(e.paragraphLevel,t);if(o!==void 0)return o;let i=Mo(e.tableLevel,t);return i!==void 0?i:Mo(e.defaults,t)===true}function kC(e){return e.isLgl?"decimal":e.numFmt}function IC(e){let t=chunkDBOOTED4_cjs.nc(e),n=new Map,r=new Map,o=new Map,i=new Map,a=new Map,s=new Map;for(let[l,c]of t.abstractNums){c.numStyleLink!==void 0&&s.set(l,c.numStyleLink);let d=new Map,u=new Map;for(let[f,m]of c.levels)d.set(String(f),kC(m)),u.set(String(f),m.start);r.set(l,d),o.set(l,u);}for(let[l,c]of t.nums){n.set(l,c.abstractNumId);for(let[d,u]of c.overrides){let f=`${l}:${d}`,m=u.startOverride??u.level?.start;m!==void 0&&i.set(f,m),u.level!==void 0&&a.set(f,kC(u.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:i,formatOverrides:a,styleLinks:s}}function RC(e,t){return e===null?null:chunkWO4V6PNS_cjs.nd(chunkWO4V6PNS_cjs.$f(e,t,chunkWO4V6PNS_cjs.la))}function TC(e,t){if(e===null)return null;let n=chunkWO4V6PNS_cjs.$f(e,t,chunkWO4V6PNS_cjs.la);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function PC(e){return `${Math.round(e/20*100)/100}pt`}var N_=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function Aa(e,t,n){if(e===null)return null;let r=chunkWO4V6PNS_cjs.$f(e,t,chunkWO4V6PNS_cjs.la);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=chunkWO4V6PNS_cjs.$f(e,"val",chunkWO4V6PNS_cjs.la);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function xh(e,t){let n=new Map,r=new Set(N_);for(let o of e)for(let i of o.children){if(i.kind==="textValue"||i.localName!=="tblStylePr"||i.namespaceUri!==chunkWO4V6PNS_cjs.la)continue;let a=chunkWO4V6PNS_cjs.$f(i,"type",chunkWO4V6PNS_cjs.la);a===void 0||!r.has(a)||n.set(a,{fill:TC(ge(ge(i,"tcPr"),"shd"),"fill"),rPr:ge(i,"rPr"),pPr:ge(i,"pPr")});}return {byType:n,firstRowEnabled:Aa(t,"firstRow",32)??false,lastRowEnabled:Aa(t,"lastRow",64)??false,firstColumnEnabled:Aa(t,"firstColumn",128)??false,lastColumnEnabled:Aa(t,"lastColumn",256)??false,hBandingEnabled:!(Aa(t,"noHBand",512)??false),vBandingEnabled:!(Aa(t,"noVBand",1024)??false)}}function wh(e,t,n,r,o,i){let a=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,c=e.lastColumnEnabled&&o,d=u=>e.byType.get(u)??null;if(s&&l&&d("swCell"))return d("swCell");if(s&&c&&d("seCell"))return d("seCell");if(a&&l&&d("nwCell"))return d("nwCell");if(a&&c&&d("neCell"))return d("neCell");if(s&&d("lastRow"))return d("lastRow");if(a&&d("firstRow"))return d("firstRow");if(c&&d("lastCol"))return d("lastCol");if(l&&d("firstCol"))return d("firstCol");if(e.hBandingEnabled){let u=t-(e.firstRowEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Horz":"band2Horz");if(f)return f}}if(e.vBandingEnabled){let u=i-(e.firstColumnEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Vert":"band2Vert");if(f)return f}}return null}function EC(e,t,n,r,o,i,a,s,l=false,c=[]){let d=[],u=ge(e,"tcBorders"),f={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:i?"left":"insideV",right:a?"right":"insideV"};for(let k of ["top","left","bottom","right"]){let R=k==="left"?"start":k==="right"?"end":k,C=ge(u,k)??ge(u,R),P=f[k],E=P==="left"?"start":P==="right"?"end":P,w=C!==null?oi(C):oi(ge(t,P)??ge(t,E));w&&d.push(`border-${Zn(k,l)}:${w}`);}let m=TC(ge(e,"shd"),"fill")??s;m&&d.push(`background-color:${m}`);let g=ge(e,"vAlign"),b=g===null?void 0:chunkWO4V6PNS_cjs.$f(g,"val",chunkWO4V6PNS_cjs.la);b==="center"?d.push("vertical-align:middle"):(b==="bottom"||b==="top")&&d.push(`vertical-align:${b}`);let y=ge(e,"tcW"),h=RC(y,"w"),v=y===null?void 0:chunkWO4V6PNS_cjs.$f(y,"type",chunkWO4V6PNS_cjs.la);h!==null&&h>0&&(v===void 0||v==="dxa")&&d.push(`width:${PC(h)}`);let x=ge(e,"tcMar");for(let k of ["top","right","bottom","left"]){let R=k==="left"?"start":k==="right"?"end":k,C=ge(x,k)??ge(x,R)??c.map(w=>ge(w,k)??ge(w,R)).find(w=>w!==null)??null,P=RC(C,"w"),E=C===null?void 0:chunkWO4V6PNS_cjs.$f(C,"type",chunkWO4V6PNS_cjs.la);P!==null&&P>=0&&(E===void 0||E==="dxa")&&d.push(`padding-${Zn(k,l)}:${PC(P)}`);}return d.join(";")}function H_(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===chunkWO4V6PNS_cjs.la}function CC(e){return e.localName==="customXml"&&e.namespaceUri===chunkWO4V6PNS_cjs.la}function OC(e){let t=[],n=[],r=o=>{for(let i of o)if(je(i)){if(i.kind==="tableRow"||i.localName==="tr"&&i.namespaceUri===chunkWO4V6PNS_cjs.la){n.push({row:t.length}),t.push(i);continue}if(i.kind==="contentControl"){let a=i.children.find(s=>s.kind==="contentControlContent");a&&je(a)&&r(a.children);continue}if(CC(i)){r(i.children);continue}n.push({skip:i});}};return r(e.children),{rows:t,tableItems:n}}function MC(e){let t=[],n=[],r=new Set;for(let o of e){let i=new Set,a=[],s=[],l=0,c=d=>{for(let u of d)if(je(u)){if(H_(u)){let f=ge(u,"tcPr"),m=Math.min(Math.max(Oo(it(ge(f,"gridSpan")))??1,1),63),g=ge(f,"vMerge"),b=g===null?null:it(g)==="restart"?"restart":"continue",y=b==="continue"&&!r.has(l)?"restart":b;b!==null&&i.add(l);let h={cell:u,startColumn:l,span:m,vMerge:y};a.push(h),s.push({placement:h}),l+=m;continue}if(u.kind==="contentControl"){let f=u.children.find(m=>m.kind==="contentControlContent");f&&je(f)&&c(f.children);continue}if(CC(u)){c(u.children);continue}s.push({skip:u});}};c(o.children),r=i,t.push(a),n.push(s);}return {placements:t,items:n}}function AC(e){let t=1;for(let n of e)for(let r of n)t=Math.max(t,r.startColumn+r.span);return t}function FC(e,t,n,r){let o=new Map,i=t.byType.get("wholeTable")??null;for(let a=0;a<n.length;a+=1)for(let s of n[a]??[]){if(s.vMerge==="continue")continue;let l=wh(t,a,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),c=[],d=[];i?.rPr&&c.push(i.rPr),i?.pPr&&d.push(i.pPr),l?.rPr&&c.push(l.rPr),l?.pPr&&d.push(l.pPr),o.set(s.cell,c.length>0||d.length>0?{...e,tableRPr:c,tablePPr:d}:e);}return o}function LC(e,t){let n=no(e.styles,it(ge(t,"tblStyle")),"table");return n.length>0?n:no(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function DC(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&je(n)?n:null,o=LC(e,r),i=xh(o,ge(r,"tblLook")),{rows:a}=OC(t),{placements:s}=MC(a);return FC(e,i,s,AC(s))}function NC(e,t,n,r){let o=t.children.find(w=>w.kind==="tableProperties"),i=o&&je(o)?o:null,a=null,s=LC(e,i);for(let w of s){let S=ge(ge(w,"tblPr"),"tblBorders");S&&(a=S);}let l=s.map(w=>ge(w,"tblPr")).filter(w=>w!==null);i&&l.push(i);let c=Rr(l,"bidiVisual"),d=[],u;for(let w of l){let S=ge(w,"tblCellMar");S&&d.unshift(S),u=it(ge(w,"jc"))??u;}let f=ge(i,"tblBorders");f&&(a=f);let m=xh(s,ge(i,"tblLook")),{rows:g,tableItems:b}=OC(t),{placements:y,items:h}=MC(g),v=AC(y),x=FC(e,m,y,v),k=["border-collapse:collapse"],R=ge(i,"tblW"),C=gn(Hn(R,"w",chunkWO4V6PNS_cjs.la));C!==null&&C>0&&Hn(R,"type",chunkWO4V6PNS_cjs.la)==="dxa"&&k.push(`width:${Jn(C)}`);let P=Zn(u==="right"||u==="end"?"right":u==="center"?"center":"left",c);P==="center"?k.push("margin-left:auto","margin-right:auto"):P==="right"?k.push("margin-left:auto","margin-right:0"):k.push("margin-left:0","margin-right:auto");for(let[w,S]of [["insideH","insideh"],["insideV","insidev"]]){let F=oi(ge(a,w));F&&k.push(`mso-border-${S}-alt:${F}`);}let E=`<table dir="${c?"rtl":"ltr"}" align="${P}" style="${k.join(";")}">`;for(let w of b){if("skip"in w){r.advanceFieldState(w.skip,n);continue}let S=w.row,F=ge(ge(g[S]??null,"trPr"),"trHeight"),A=gn(Hn(F,"val",chunkWO4V6PNS_cjs.la)),$=zw(A,Hn(F,"hRule",chunkWO4V6PNS_cjs.la)),W=$===""?"":` style="${$}"`;E+=`<tr${W}>`;for(let U of h[S]??[]){if("skip"in U){r.advanceFieldState(U.skip,n);continue}let _=U.placement;if(_.vMerge==="continue"){r.advanceFieldState(_.cell,n);continue}let L=1;if(_.vMerge==="restart")for(let B=S+1;B<y.length&&y[B].find(j=>j.startColumn===_.startColumn&&j.vMerge==="continue");B+=1)L+=1;let Z=ge(_.cell,"tcPr"),ee=_.startColumn+_.span>=v,te=wh(m,S,y.length,_.startColumn===0,ee,_.startColumn),me=m.byType.get("wholeTable")??null,le=EC(Z,a,S,y.length,L,_.startColumn===0,ee,te?.fill??me?.fill??null,c,d),D=(_.span>1?` colspan="${_.span}"`:"")+(L>1?` rowspan="${L}"`:"")+(le===""?"":` style="${Ir(le)}"`),T=x.get(_.cell)??e;E+=`<td dir="ltr"${D}>${r.renderBlocks(T,_.cell.children,n)}</td>`;}E+="</tr>";}return `${E}</table>`}function Ou(e){if(e===void 0||!/^\d{1,10}$/.test(e))return null;let t=Number.parseInt(e,10);return t>=1&&t<=2147483647?t:null}function Sh(e){let t=chunkWO4V6PNS_cjs.$f(e,"type",chunkWO4V6PNS_cjs.la);return t==="separator"||t==="continuationSeparator"}function kh(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!je(r)||r.namespaceUri!==chunkWO4V6PNS_cjs.la||r.localName!==t||Sh(r))continue;let o=Ou(chunkWO4V6PNS_cjs.$f(r,"id",chunkWO4V6PNS_cjs.la));o!==null&&n.add(o);}return n}function kl(e,t,n,r,o,i,a){for(let s of t.children)if(je(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){kl(e,s,n,r,o,i,DC(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===chunkWO4V6PNS_cjs.la&&s.localName==="tc"){let l=a?.get(s);if(l===void 0){r.inert||o(s,r);continue}kl(l,s,n,r,o,i,a);continue}if(s.kind==="paragraph"){let l=s.children.find(c=>c.kind==="paragraphProperties");kl(e,s,n,r,o,l&&je(l)?l:null,a);continue}if(s.kind==="run"){if(s.children.some(d=>d.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(d=>d.kind==="instrText")||!r.inert&&r.stack.some(d=>d==="instr"))continue;let l=s.children.find(d=>d.kind==="runProperties"),c=Eu(e.styles,i,l&&je(l)?l:null,e.tableRPr);if(er(c,"vanish"))continue}if(s.namespaceUri===chunkWO4V6PNS_cjs.la&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=Ou(chunkWO4V6PNS_cjs.$f(s,"id",chunkWO4V6PNS_cjs.la));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}kl(e,s,n,r,o,i,a);}}function __(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!je(r)||r.namespaceUri!==chunkWO4V6PNS_cjs.la)&&!(r.localName!==t||Sh(r))&&Ou(chunkWO4V6PNS_cjs.$f(r,"id",chunkWO4V6PNS_cjs.la))===n)return r;return null}function HC(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let i of ["footnote","endnote"])for(let a of r[i])o.push({kind:i,id:a});for(;o.length>0;){let i=o.pop(),a=__(t[i.kind],i.kind,i.id);if(a===null)continue;let s={stack:[],inert:false};n(a,s);let l={stack:[],inert:s.stack.length>0},c=[];kl(e,a,c,l,n,null);for(let d of c)e.availableNotes[d.kind].has(d.id)&&(r[d.kind].has(d.id)||(r[d.kind].add(d.id),o.push(d)));}return r}function Ih(e,t,n,r,o){if(n===null)return "";let i=`/word/${t}s.xml`;for(let[l,c]of e.pkg.parts)c.root===n&&(i=l);let a=chunkWO4V6PNS_cjs.Ke(e.pkg,i),s="";for(let l of n.children){if(!je(l)||l.namespaceUri!==chunkWO4V6PNS_cjs.la||l.localName!==t||Sh(l))continue;let c=chunkWO4V6PNS_cjs.$f(l,"id",chunkWO4V6PNS_cjs.la),d=Ou(c);if(c===void 0||d===null||!r.has(d))continue;let u=o({...e,noteBody:{kind:t,id:d},docRels:a},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${d}">${u===""?"<p></p>":u}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}function _C(e){if(!e)return null;let t=[];for(let n of e.children){if(!je(n)||n.localName!=="tab")continue;let r=it(n),o=gn(chunkWO4V6PNS_cjs.$f(n,"pos",chunkWO4V6PNS_cjs.la));if(o===null||o<0||r!=="left"&&r!=="center"&&r!=="right"&&r!=="decimal"&&r!=="bar")continue;let i=it(n,"leader"),a=i==="dot"?"dotted":i==="hyphen"?"dashed":i==="underscore"?"lined":i==="middleDot"?"middledot":i==="heavy"?"heavy":"";t.push(`${r}${a?` ${a}`:""} ${Jn(o)}`);}return t.length>0?`tab-stops:${t.join(" ")}`:null}var Rh="http://schemas.openxmlformats.org/officeDocument/2006/relationships",B_=`${Rh}/numbering`,$_=`${Rh}/footnotes`,q_=`${Rh}/endnotes`,W_=2*1024*1024,K_=8*1024*1024,BC=9525,j_=new Map([["image/png","image/png"],["image/jpeg","image/jpeg"],["image/jpg","image/jpeg"],["image/gif","image/gif"],["image/bmp","image/bmp"],["image/x-ms-bmp","image/bmp"],["image/x-bmp","image/bmp"],["image/webp","image/webp"],["image/svg+xml","image/svg+xml"],["image/tiff","image/tiff"],["image/x-emf","image/x-emf"],["image/x-wmf","image/x-wmf"]]);function Mu(e,t,n,r){let o=e.direct!==null&&ge(e.direct,r)!==null||_n(e.defaults,r)!==null||_n(e.tableLevel,r)!==null||_n(e.paragraphLevel,r)!==null||_n(e.characterLevel,r)!==null;return er(e,t&&o?r:n)}function V_(e){let t=e.all;if(er(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=Rr(t,"rtl"),o=(r?Ft(t,"rFonts","cs"):void 0)??Ft(t,"rFonts","ascii")??Ft(t,"rFonts","hAnsi")??Ft(t,"rFonts","eastAsia")??(r?void 0:Ft(t,"rFonts","cs"));if(o!==void 0){let k=jw(o);k&&n.push(`font-family:${k}`);}let i=Oo((r?Ft(t,"szCs","val"):void 0)??Ft(t,"sz","val")??(r?void 0:Ft(t,"szCs","val")));i!==null&&i>0&&n.push(`font-size:${Math.round(i/2*100)/100}pt`);let a={...e,direct:null},s=e.direct?t.slice(0,-1):t;Mu(e,r,"b","bCs")?n.push("font-weight:bold"):Mu(a,r,"b","bCs")&&n.push("font-weight:normal"),Mu(e,r,"i","iCs")?n.push("font-style:italic"):Mu(a,r,"i","iCs")&&n.push("font-style:normal");let l=[],c=_n(t,"u"),d=c!==null&&it(c)!=="none";d&&l.push("underline");let u=vh(e,"dstrike");if((er(e,"strike")||u)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let k=_n(s,"u");(k!==null&&it(k)!=="none"||er(a,"strike")||vh(a,"dstrike"))&&n.push("text-decoration:none");}d&&n.push(...Uw(c)),u&&!d&&n.push("text-decoration-style:double");let f=Tu(Ft(t,"color","val"));f&&n.push(`color:${f}`);let m=gn(Ft(t,"spacing","val"));m!==null&&n.push(`letter-spacing:${Math.round(m/20*100)/100}pt`);let g=it(_n(t,"highlight")),b=g!==void 0&&Object.hasOwn(qp,g)?qp[g]:void 0,y=Tu(Ft(t,"shd","fill"));b?n.push(`background-color:${b}`,`mso-highlight:${g}`):y&&n.push(`background-color:${y}`),er(e,"caps")?n.push("text-transform:uppercase"):er(a,"caps")&&n.push("text-transform:none"),er(e,"smallCaps")?n.push("font-variant:small-caps"):er(a,"smallCaps")&&n.push("font-variant:normal");let h=it(_n(t,"vertAlign")),v=h==="superscript"||h==="subscript"?h:null,x=ri((r?Ft(t,"lang","bidi"):void 0)??Ft(t,"lang","val")??Ft(t,"lang","bidi")??Ft(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:v,lang:x,rtl:r}}function U_(e,t,n=false){let r=[],o=it(_n(e,"jc")),i=o!==void 0&&Object.hasOwn(Wp,o)?Wp[o]:void 0;i&&r.push(`text-align:${n&&i!=="center"&&i!=="justify"?i==="left"?"right":"left":i}`);let a=gn(Ft(e,"spacing","before"));a!==null&&a>=0&&r.push(`margin-top:${Jn(a)}`);let s=gn(Ft(e,"spacing","after"));s!==null&&s>=0&&r.push(`margin-bottom:${Jn(s)}`);let l=gn(Ft(e,"spacing","line")),c=Ft(e,"spacing","lineRule");r.push(...Vw(l,c));let d=null,u=null,f=null,m=null;for(let h of e){let v=ge(h,"ind");if(!v)continue;let x=gn(Hn(v,"left",chunkWO4V6PNS_cjs.la)??Hn(v,"start",chunkWO4V6PNS_cjs.la));x!==null&&(d=x);let k=gn(Hn(v,"right",chunkWO4V6PNS_cjs.la)??Hn(v,"end",chunkWO4V6PNS_cjs.la));k!==null&&(u=k);let R=gn(Hn(v,"hanging",chunkWO4V6PNS_cjs.la)),C=gn(Hn(v,"firstLine",chunkWO4V6PNS_cjs.la));R!==null?(f=R,m=null):C!==null&&(m=C,f=null);}!t&&d!==null&&r.push(`margin-${n?"right":"left"}:${Jn(d)}`),u!==null&&r.push(`margin-${n?"left":"right"}:${Jn(u)}`),f!==null&&f!==0?r.push(`text-indent:${Jn(-f)}`):m!==null&&m!==0&&r.push(`text-indent:${Jn(m)}`);let g=_C(_n(e,"tabs"));g&&r.push(g),Rr(e,"pageBreakBefore")&&r.push("page-break-before:always"),Rr(e,"keepNext")&&r.push("page-break-after:avoid"),Rr(e,"keepLines")&&r.push("page-break-inside:avoid"),Rr(e,"widowControl")&&r.push("widows:2","orphans:2");let b=Tu(Ft(e,"shd","fill"));b&&r.push(`background-color:${b}`);let y=_n(e,"pBdr");if(y)for(let h of ["top","left","bottom","right"]){let v=oi(ge(y,h));v&&r.push(`border-${h}:${v}`,`mso-border-${h}-alt:${v}`);}return r.join(";")}function z_(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let i=r.size+1;return r.set(n,i),i}var $C={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function WC(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",i=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:i}}function G_(e,t){let n,r;for(let s of t){let l=ge(s,"numPr");if(!l)continue;let c=it(ge(l,"numId"));c!==void 0&&(n=c);let d=it(ge(l,"ilvl"));d!==void 0&&(r=d);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),c=l===void 0?void 0:e.styles.byId.get(l),d=it(ge(ge(ge(c??null,"pPr"),"numPr"),"numId")),u=d===void 0?void 0:e.numbering.numToAbstract.get(d);if(u===void 0||u===o)break;o=u;}let i=Math.min(Math.max(Oo(r)??0,0),8),a=WC(e,n,o,i);return {numId:n,abstractId:o,level:i,fmt:a.fmt,start:a.start}}function Z_(e,t){let n=chunkWO4V6PNS_cjs.G(e.pkg.contentTypes,t);if(n.ok){let i=j_.get(n.contentType.toLowerCase());if(i!==void 0)return i}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function X_(e,t){let n=Ma(t,"inline",chunkWO4V6PNS_cjs.sa)??Ma(t,"anchor",chunkWO4V6PNS_cjs.sa);if(!n)return "";let r=Ma(n,"blip",chunkWO4V6PNS_cjs.ra);if(!r)return "";let o=chunkWO4V6PNS_cjs.$f(r,"embed",chunkWO4V6PNS_cjs.ua);if(!o)return "";let i=e.docRels.find(b=>b.id===o&&b.targetMode!=="External");if(!i)return "";let a=chunkWO4V6PNS_cjs.B(i.ownerPart,i.rawTarget);if(!a.ok)return "";let s=e.pkg.partBytes.get(a.partName.replace(/^\//,""))??e.pkg.partBytes.get(a.partName);if(!s)return "";let l=Z_(e,a.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let c=e.imageDataUris.get(a.partName);c==null&&(c=`data:${l};base64,${dd(s)}`,e.imageDataUris.set(a.partName,c));let d=Ma(n,"extent",chunkWO4V6PNS_cjs.sa),u=d?Oo(chunkWO4V6PNS_cjs.$f(d,"cx","")):null,f=d?Oo(chunkWO4V6PNS_cjs.$f(d,"cy","")):null,m=b=>Math.round(b/12700*100)/100,g=u!==null&&f!==null&&u>0&&f>0?` width="${Math.round(u/BC)}" height="${Math.round(f/BC)}" style="width:${m(u)}pt;height:${m(f)}pt"`:"";return `<img src="${c}"${g}>`}function Ri(e,t,n=0){if(n>=chunkWO4V6PNS_cjs.wa)return;let r=chunkWO4V6PNS_cjs.yf(e)?n+1:chunkWO4V6PNS_cjs.xa(e,n);for(let o of e.children)if(je(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let i=o.children.find(a=>a.kind==="contentControlContent");i&&je(i)&&Ri(i,t,r+1);continue}if(o.kind==="fldChar"){KC(o,t);continue}Ri(o,t,r);}}function KC(e,t){let n=chunkWO4V6PNS_cjs.$f(e,"fldCharType",chunkWO4V6PNS_cjs.la);n==="begin"?t.stack.push("instr"):n==="separate"&&t.stack.length>0?t.stack[t.stack.length-1]="result":n==="end"&&t.stack.pop();}function Y_(e,t,n,r){let o=t.children.find(c=>c.kind==="runProperties"),i=Eu(e.styles,n,o&&je(o)?o:null,e.tableRPr),a=V_(i),s="";for(let c of t.children){if(!je(c))continue;if(c.kind==="fldChar"){r.inert||KC(c,r);continue}if(c.kind==="instrText"||!r.inert&&r.stack.some(f=>f==="instr")||a.vanish)continue;let d=Zw(c);if(d!==""){s+=d;continue}let u=Gw(c,e.noteBody,(f,m)=>z_(e,f,m),(f,m)=>e.availableNotes[f].has(m));if(u!==""){s+=u;continue}switch(c.kind){case "text":s+=yh(hh(c));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let f=chunkWO4V6PNS_cjs.$f(c,"type",chunkWO4V6PNS_cjs.la);s+=f==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let f=Gn(chunkWO4V6PNS_cjs.$f(c,"name",chunkWO4V6PNS_cjs.la));f!==null&&(s+=`<a id="${Ir(f)}"></a>`);break}case "drawing":s+=X_(e,c);break;default:s+=chunkDBOOTED4_cjs.lb(c)?.text??"";break}}if(s==="")return "";a.vertAlign==="superscript"?s=`<sup>${s}</sup>`:a.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${a.lang===null?"":` lang="${a.lang}"`}${a.rtl?' dir="rtl"':""}${a.css===""?"":` style="${Ir(a.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Ii(e,t,n,r,o=0){if(o>=chunkWO4V6PNS_cjs.wa)return "";let i="";for(let a of t)if(je(a))switch(chunkWO4V6PNS_cjs.yf(a)?"fldSimple":a.kind){case "run":i+=Y_(e,a,n,r);break;case "hyperlink":{let s=Ii(e,a.children,n,r,o+1);if(s==="")break;let l=chunkWO4V6PNS_cjs.$f(a,"id",chunkWO4V6PNS_cjs.ua),c=l?e.docRels.find(f=>f.id===l):void 0,d=c===void 0?void 0:c.targetMode==="External"||c.rawTarget.startsWith("#")?c.rawTarget:void 0,u=yS(d,chunkWO4V6PNS_cjs.$f(a,"anchor",chunkWO4V6PNS_cjs.la));i+=u!==null?`<a href="${Ir(u)}">${s}</a>`:s;break}case "bookmarkStart":{let s=Gn(chunkWO4V6PNS_cjs.$f(a,"name",chunkWO4V6PNS_cjs.la));s!==null&&(i+=`<a id="${Ir(s)}"></a>`);break}case "fldSimple":i+=Ii(e,a.children,n,r,o+1);break;case "contentControl":{let s=a.children.find(l=>l.kind==="contentControlContent");s&&je(s)&&(i+=Ii(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":i+=Ii(e,a.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":Ri(a,r,o);break;case "generic":if(chunkWO4V6PNS_cjs.$e(a))i+=Nw(a);else if(chunkWO4V6PNS_cjs.ya(a))i+=Ii(e,a.children,n,r,o+1);else {let s=chunkWO4V6PNS_cjs.Wc(a);s&&(i+=Ii(e,s,n,r,o+1));}break}return i}function Q_(e,t){let n=it(ge(t,"pStyle")),r=no(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let i=chunkWO4V6PNS_cjs.$f(r[o],"styleId",chunkWO4V6PNS_cjs.la),a=i?/^Heading([1-6])$/.exec(i):null;if(a)return {level:Number(a[1]),fromStyle:true}}if(n===void 0){let o=Oo(it(ge(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function J_(e,t){let n=no(e.styles,it(ge(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=Kw(chunkWO4V6PNS_cjs.$f(n[r],"styleId",chunkWO4V6PNS_cjs.la));if(o!==null)return o}return null}function qC(e,t,n,r){let o=t.children.find(y=>y.kind==="paragraphProperties"),i=o&&je(o)?o:null,a=bh(e.styles,i,e.tablePPr),s=U_(a,n.asListItem,Rr(a,"bidi")),l=Ii(e,t.children,i,r),c=s===""?"":` style="${Ir(s)}"`,d=Rr(a,"bidi")?' dir="rtl"':"",u=J_(e,i),f=u===null?"":` class="${u}"`,m=Q_(e,i);if(n.asListItem)return `<li${m?.fromStyle===true?` class="Heading${m.level}"`:f}${d}${c}>${l}</li>`;let g=m===null?"p":`h${m.level}`,b=m===null?f:m.fromStyle?` class="Heading${m.level}"`:' class="docx-outline"';return `<${g}${b}${d}${c}>${l}</${g}>`}var e5={renderBlocks:(e,t,n)=>Au(e,t,n),advanceFieldState:Ri};function Au(e,t,n){let r="",o=[],i=null,a=new Map,s=n;if(s===void 0){let f={stack:[]};for(let m of t)je(m)&&Ri(m,f);s={stack:[],inert:f.stack.length>0};}let l=()=>{let f=o.pop();f&&(r+=`</${f.tag}>`);},c=()=>{for(;o.length>0;)l();i=null;},d=(f,m)=>{for(i!==null&&m.level<i&&c();o.length>0&&o[o.length-1].abstractId!==m.abstractId;)l();o.length===0&&(i=m.level);let g=i??m.level,b=m.level-g+1;for(;o.length>b;)l();for(o.length===b&&o[b-1].numId!==m.numId&&l();o.length<b;){let v=g+o.length,x=WC(e,m.numId,m.abstractId,v),k=a.get(`${m.abstractId}:${m.numId}:${v}`)??0,R=x.start+k,C=x.fmt==="bullet"?"ul":"ol",P=C==="ol"?Object.hasOwn($C,x.fmt)?$C[x.fmt]:"decimal":null,E=C==="ol"&&R!==1?` start="${R}"`:"";r+=P?`<${C}${E} style="list-style-type:${Ir(P)}">`:`<${C}>`,o.push({tag:C,numId:m.numId,abstractId:m.abstractId});}let y=`${m.abstractId}:${m.numId}:${m.level}`;a.set(y,(a.get(y)??0)+1);let h=`${m.abstractId}:`;for(let v of a.keys()){if(!v.startsWith(h))continue;let x=v.slice(v.lastIndexOf(":")+1);/^\d+$/.test(x)&&Number(x)>m.level&&a.delete(v);}r+=qC(e,f,{asListItem:true},s);},u=f=>{for(let m of f)if(je(m))switch(m.kind){case "paragraph":{let g=m.children.find(h=>h.kind==="paragraphProperties"),b=g&&je(g)?g:null,y=G_(e,bh(e.styles,b));y?d(m,y):(c(),r+=qC(e,m,{asListItem:false},s));break}case "table":c(),r+=NC(e,m,s,e5);break;case "contentControl":{let g=m.children.find(b=>b.kind==="contentControlContent");g&&je(g)&&u(g.children);break}case "generic":u(m.children);break;case "bookmarkStart":{let g=Gn(chunkWO4V6PNS_cjs.$f(m,"name",chunkWO4V6PNS_cjs.la));g!==null&&(r+=`<a id="${Ir(g)}"></a>`);break}default:s.inert||Ri(m,s);break}};return u(t),c(),r}function jC(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!je(n.root))return "";let r=n.root.children.find(c=>c.kind==="body");if(!r||!je(r))return "";let o=Sl(e,$_,"/word/footnotes.xml"),i=Sl(e,q_,"/word/endnotes.xml"),a={pkg:e,styles:SC(e),numbering:IC(Sl(e,B_,"/word/numbering.xml")),docRels:chunkWO4V6PNS_cjs.Ke(e,e.mainDocumentPart),maxImageBytes:W_,maxTotalImageBytes:K_,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:kh(o,"footnote"),endnote:kh(i,"endnote")},noteBody:null},s=Au(a,r.children),l=HC(a,{footnote:o,endnote:i},Ri);return s+Ih(a,"footnote",o,l.footnote,Au)+Ih(a,"endnote",i,l.endnote,Au)}var t5=12*1024*1024;function n5(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function r5(e){return `<div><table>${e.split(`
27
+ `).map(n=>`<tr>${n.split(" ").map(r=>`<td>${n5(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function Ph(e){if(e.cellRectangle)return {text:e.text,html:r5(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunk243W4WW2_cjs.N(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null,...t.reason==="unsupported-content"?{reason:t.reason}:{}};let n=e.maxFragmentBytes??t5,r=t.bytes;if(t.bytes.byteLength>n){let a=chunk243W4WW2_cjs.N(e.pkg,e.coverage,{omitMedia:true});r=a.ok&&a.bytes.byteLength<=n?a.bytes:null;}let o;try{o=jC(t.package);}catch(a){console.error("docx-editor: copy HTML flavour failed to render",a),o="";}let i=Ww(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:i}}function VC(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain)return n();let r=t.html;if(r===null||r.length===0)return n();let o=sa(r);if(!e.richLaneOpen)return o&&Pu(o.bytes)?"unsupported-content":n();if(o){let a=e.pasteFragment(o.bytes,o.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "fragment"}let i=hk(r);if(i.ok&&i.truncated&&t.text.length>0)return n();if(i.ok){let a=e.pasteFragment(i.fragmentBytes,i.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "external-html"}return n()}function UC(e,t){let n=chunkDBOOTED4_cjs.se(e,t);if(!n.includes("\xAD"))return n;let r=n.split("");for(let{line:o}of chunkDBOOTED4_cjs.xd(e,t)??[])for(let i of chunkDBOOTED4_cjs.Pa(o,t)?.spans??[])chunkDBOOTED4_cjs.gd(i)&&i.range.start<r.length&&(r[i.range.start]=chunkWO4V6PNS_cjs.cb);return r.join("")}function zC(e){return e.includes(chunkWO4V6PNS_cjs.cb)?e.replaceAll(chunkWO4V6PNS_cjs.cb,""):e}function GC(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!chunkWO4V6PNS_cjs.Ej(e.settingsRoot()))return r;let i=Ce(e,t.paragraphId)??e.part();if(!chunkWO4V6PNS_cjs.Fj(i,t.paragraphId))return r;let a=chunkWO4V6PNS_cjs.Ta(i,t.paragraphId);if(a?.kind!=="paragraph")return r;let s=chunkWO4V6PNS_cjs.vj(a).find(y=>y.fieldNodeId===o&&y.start<=t.offset&&y.end>=n.offset);if(!s?.enabled||!chunkWO4V6PNS_cjs.aj(s)||s.maxLength<=0)return r;let l=(chunkWO4V6PNS_cjs.hj(i,t.paragraphId)??"").slice(s.start,s.end),c=l.slice(0,t.offset-s.start),d=l.slice(n.offset-s.start),u=c+d,f=y=>chunkWO4V6PNS_cjs.bj(c+y+d,s,u)<=s.maxLength;if(f(r))return r;let m=[...r],g=s.maxLength-[...u].length;if(s.type==="number"&&s.format)for(let y of u)(y===","&&s.format.includes(",")||y==="%"&&s.format.endsWith("%"))&&g++;let b=new Set;if(s.type==="date"){let y=0;for(let h=0;h<m.length;h++)if(/\S/.test(m[h])){if(++y>18)break;b.add(h+1);}else (h+1===m.length||/\S/.test(m[h+1]))&&b.add(h+1);}else if(s.type==="number"&&s.format)for(let y=1;y<=3;y++)b.add(g+y);for(let y of [...b].sort((h,v)=>v-h)){if(y<=Math.max(0,g)||y>m.length)continue;let h=m.slice(0,y).join("");if(f(h))return h}return m.slice(0,Math.max(0,g)).join("")}var ZC=zC,o5=2e3;function XC(e){let{session:t}=e,n=null;function r(s){let l=Sk(s),c=e.orderedRange(),d=GC(t,c.from,c.to,l,e.textFormFieldId?.()??null).split(`
28
+ `),u=e.deleteSelectionPlan(),f=u.replaceAt??u.collapseTo,m=d.join(""),g=[...u.ops],b=e.consumePendingFormatOps(f.paragraphId,f.offset,m.length);m.length>0&&(g.push({op:"insertText",paragraphId:f.paragraphId,offset:f.offset,text:m}),g.push(...b));let y=[],h=0;for(let C=0;C<d.length-1;C+=1)h+=d[C].length,y.push(f.offset+h);if(y.length>0&&g.push({op:"splitParagraphMany",paragraphId:f.paragraphId,offsets:y}),g.length===0)return;let v=new Set(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())),x=d[d.length-1],k=y.length===0?e.caretMark({paragraphId:f.paragraphId,offset:f.offset+x.length}):void 0,R=g.filter(C=>!b.includes(C));e.commit(()=>e.withoutPendingOnRejection(g,R,e.selectionMark(),k),()=>{if(y.length===0)return Ke({paragraphId:f.paragraphId,offset:f.offset+x.length});let C=(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())).filter(E=>!v.has(E)),P=C[C.length-1];return P?Ke({paragraphId:P,offset:x.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection(),l=e.orderedRange(),c=e.paragraphOrder(),d=s?chunk5JPIEN54_cjs.la(e.layout(),s.cellIds):c.slice(c.indexOf(l.from.paragraphId),c.indexOf(l.to.paragraphId)+1),u=new Map(d.map(P=>[P,{start:!s&&P===l.from.paragraphId?l.from.offset:0,end:!s&&P===l.to.paragraphId?l.to.offset:1/0}])),m=e.storyScope().kind==="body"?t.part():Ce(t,d[0]??l.from.paragraphId);if(m&&wC(m,u))return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),{text:"",html:null,reason:"unsupported-content"};let g=cl(e.layout(),UC);if(s)return Ph({text:ZC(chunk5JPIEN54_cjs.oa(e.layout(),s,g.spelledText)),cellRectangle:true,coverage:null,pkg:null});let{from:b,to:y}=e.orderedRange(),h=t.part(),v=ZC(Mg(e.layout(),b,y,e.paragraphOrder(),(P,E)=>g.resultAt(P,E)??(h?hC(h,P,E):null),g.markedText)),x=e.storyScope();if(b.paragraphId===y.paragraphId&&b.offset===y.offset||x.kind!=="body")return {text:v,html:null};let R=t.part(),C=hP(e.layout(),R,b,y,e.paragraphOrder());return Ph({text:v,cellRectangle:false,coverage:C,pkg:t.currentPackage()})}function i(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let c=e.deleteSelectionPlan(),d=c.replaceAt??c.collapseTo,u=false,f=false;return e.commit(()=>{let m=e.collaborationGate(c.ops,{kind:"body"});if(m)return {committed:false,rejected:true,opCount:0,reason:m};let g=e.actorId(),b=t.applyFragmentPaste({kind:"body"},{paragraphId:d.paragraphId,offset:d.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:c.ops,...g!==void 0?{actorId:g}:{}});return u=b.ok,f=!b.ok&&b.detail==="fragment-merge:unsupported-content",{committed:b.ok,rejected:!b.ok,opCount:b.ok?1:0,...b.ok?{}:{reason:b.detail??b.reason}}},()=>Ke(d)),f?"unsupported-content":u}function a(s,l){let c=n!==null&&e.now()-n<o5;n=null;let d=VC({richLaneOpen:(e.richPasteAllowed?.()??true)&&e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(u,f)=>i(u,f),insertPlainText:r},{html:l,text:s,forcePlain:c});return d==="unsupported-content"?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),false):d!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:a,armForcePlainPaste:()=>{n=e.now();}}}function i5(e){return e.level==="inline"&&e.range!==void 0&&e.range.start<e.range.end&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function a5(e,t,n){let r=(e.contentControls??[]).filter(l=>i5(l)&&l.range.paragraphId===t.paragraphId&&l.range.start>=t.offset&&l.range.end<=n.offset),o=r.filter(l=>!r.some(c=>c!==l&&c.range.start<=l.range.start&&c.range.end>=l.range.end&&c.nestingDepth<l.nestingDepth)).sort((l,c)=>c.range.start-l.range.start);if(o.length===0)return null;let i=t.paragraphId,a=[],s=n.offset;for(let l of o)l.range.end<s&&a.push({op:"deleteText",paragraphId:i,start:l.range.end,end:s}),a.push({op:"removeContentControl",controlId:l.id,keepContent:false}),s=l.range.start;return t.offset<s&&a.push({op:"deleteText",paragraphId:i,start:t.offset,end:s}),a}function YC(e){let{anchor:t,head:n}=e.selection;if(t.paragraphId!==n.paragraphId)return null;if(t.offset!==n.offset){let[l,c]=t.offset<n.offset?[t,n]:[n,t],d=a5(e.layout,l,c);return d?{kind:"remove",ops:d,collapseTo:l}:null}let r=e.shown(n),o=e.direction==="backward",i=e.controlBeside(r,o?"before":"after");if(!i)return null;let a={paragraphId:r.paragraphId,offset:i.start},s={paragraphId:r.paragraphId,offset:i.end};return i.contentLocked?{kind:"select",selection:o?{anchor:s,head:a}:{anchor:a,head:s}}:{kind:"remove",ops:[{op:"removeContentControl",controlId:i.controlId,keepContent:false}],collapseTo:o?a:r}}function QC(e){let{session:t}=e,n=null,r=()=>n??e.selection(),o=()=>n?null:e.cellSelection();function i(){return yi(e.selection())}function a(){e.flushPendingInputAndLayout();let k=r(),R=k.anchor.paragraphId===k.head.paragraphId?void 0:e.paragraphOrder();return Xd(e.layout(),k,R)}function s(){return a().from}function l(k){return chunkDBOOTED4_cjs.se(e.layout(),k)}function c(k,R){let C=t.partFor(e.storyScope())??t.part(),P=chunkWO4V6PNS_cjs.Ta(C,k.paragraphId);if(!P||P.kind!=="paragraph")return null;let E=R==="before"?chunkWO4V6PNS_cjs.pg(P,k.offset):chunkWO4V6PNS_cjs.qg(P,k.offset);if(!E)return null;let w=chunkWO4V6PNS_cjs.bg(C,E.controlId),S=w?chunkWO4V6PNS_cjs.Zb(w):null;if(!S)return null;let F=S.lock==="contentLocked"||S.lock==="sdtContentLocked";return F||S.type==="checkbox"||S.type==="picture"?{...E,contentLocked:F}:null}function d(k,R){return e.flushPendingInputAndLayout(),e.cellSelection()?null:YC({layout:e.layout(),selection:e.selection(),direction:k,shown:R,controlBeside:c})}function u(k){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let R=a();return R.from.paragraphId===R.to.paragraphId&&R.from.offset===R.to.offset?e.atParagraphEnd(k.paragraphId,k.offset):e.atParagraphEnd(R.to.paragraphId,R.to.offset)}function f(k){let R=k?.trim()||void 0,C=m(g(),!R&&e.editingMode()!=="suggest"),P=o(),E=null;return {...C,get replaceAt(){return E??=v(C,R,P),E}}}function m(k,R){if(!R||k.ops.length===0||o())return k;let{from:C,to:P}=a();if(C.paragraphId===P.paragraphId)return k;let E=Ce(t,C.paragraphId)??t.part(),w=chunkWO4V6PNS_cjs.fj(E,C,P,e.paragraphOrder());return w.length===0?k:{...k,ops:[...w,...k.ops]}}function g(){e.flushPendingInputAndLayout();let k=o();if(k){let E=[];for(let w of chunk5JPIEN54_cjs.la(e.layout(),k.cellIds)){let S=chunkDBOOTED4_cjs.se(e.layout(),w).length;S>0&&E.push({op:"deleteText",paragraphId:w,start:0,end:S});}return {ops:E,collapseTo:s()}}let R=r();if(R.anchor.paragraphId===R.head.paragraphId&&R.anchor.offset===R.head.offset)return {ops:[],collapseTo:chunkDBOOTED4_cjs.zd(e.layout(),R.head)};let{from:C,to:P}=a();return yP(e.layout(),t.partFor(e.storyScope())??t.part(),C,P,e.paragraphOrder(),e.revisionView())}function b(){return f().ops}function y(k){let R=n;n=k;try{let C=f();return {ops:C.ops,replaceAt:C.replaceAt??C.collapseTo}}finally{n=R;}}function h(k,R,C){if(!(C!==void 0||e.editingMode()==="suggest")||k.paragraphId!==R.paragraphId||R.offset<=k.offset)return k.offset;let E=(C??e.author())?.trim();if(!E)return chunkDBOOTED4_cjs.zd(e.layout(),R).offset;let w=Ce(t,R.paragraphId)??t.part(),S=chunkWO4V6PNS_cjs.Ta(w,R.paragraphId);return !S||S.kind!=="paragraph"?chunkDBOOTED4_cjs.zd(e.layout(),R).offset:vu(S,k.offset,R.offset,E,e.trackedDate())}function v(k,R,C){let P=k.collapseTo;if(R===void 0&&e.editingMode()!=="suggest")return P;if(C){for(let te of C.cellIds){let me=chunk5JPIEN54_cjs.ka(e.layout(),[te]),le=me.length>0?me:chunk5JPIEN54_cjs.la(e.layout(),[te]);if(le.length===0)continue;let D=new Map,T=X=>{let oe=D.get(X);return oe===void 0&&(oe=h({paragraphId:X,offset:0},{paragraphId:X,offset:l(X).length},R),D.set(X,oe)),oe},B=(R??e.author())?.trim(),q=X=>{let oe=l(X);if(!B)return /\S/.test(oe);let H=chunkWO4V6PNS_cjs.Ta(Ce(t,X)??t.part(),X);if(!H||H.kind!=="paragraph")return /\S/.test(oe);let V="",z=0;for(let Y of chunkWO4V6PNS_cjs.Bh(H,0,oe.length,B))V+=oe.slice(z,Math.max(z,Y.start)),z=Math.max(z,Y.end);return V+=oe.slice(z),/\S/.test(V)},j=null;for(let X=le.length-1;X>=0;X-=1){let oe=le[X];if(q(oe)){j=oe;break}}if(j===null)for(let X=le.length-1;X>=0;X-=1){let oe=le[X];if(T(oe)!==0){j=oe;break}}return j??=le[le.length-1],{paragraphId:j,offset:T(j)}}return P}let{from:E,to:w}=a();if(E.paragraphId===w.paragraphId&&E.offset===w.offset)return P;if(E.paragraphId===w.paragraphId)return {paragraphId:w.paragraphId,offset:h(E,w,R)};let S=new Set(k.ops.flatMap(te=>te.op==="deleteBlock"?[te.blockId]:[])),F=Ce(t,w.paragraphId)??t.part();if(S.size>0)for(let te=chunkWO4V6PNS_cjs.Ua(F,w.paragraphId);te;te=chunkWO4V6PNS_cjs.Ua(F,te.id)){if(!S.has(te.id))continue;let me={paragraphId:P.paragraphId,offset:l(P.paragraphId).length};return {paragraphId:P.paragraphId,offset:h(P,me,R)}}let A=(R??e.author())?.trim();if(!A)return P;let $=new Set(k.ops.flatMap(te=>te.op==="joinParagraphs"?[te.secondId]:[])),W=e.paragraphOrder(),U=W.indexOf(E.paragraphId),_=W.indexOf(w.paragraphId);if(U===-1||_===-1)return P;let L=te=>{let me=chunkWO4V6PNS_cjs.Ta(F,te);return me?.kind==="paragraph"&&chunkWO4V6PNS_cjs.vl(me,A)},Z=_;for(;Z>U&&$.has(W[Z])&&L(W[Z-1]);)Z-=1;let ee=0;for(let te=Z;te<=_;te+=1){let me=W[te],le={paragraphId:me,offset:me===E.paragraphId?E.offset:0},D=me===w.paragraphId?chunkDBOOTED4_cjs.zd(e.layout(),w):{paragraphId:me,offset:l(me).length};te===Z&&(ee+=le.offset),ee+=D.offset-le.offset-x(le,D,A);}return {paragraphId:W[Z],offset:ee}}function x(k,R,C){let P=C?.trim();if(!P||k.paragraphId!==R.paragraphId)return 0;let E=Ce(t,R.paragraphId)??t.partFor(e.storyScope())??t.part(),w=chunkWO4V6PNS_cjs.Ta(E,R.paragraphId);return !w||w.kind!=="paragraph"?0:chunkWO4V6PNS_cjs.Ah(w,k.offset,R.offset,P)}return {selectionMark:i,orderedRange:a,orderedStart:s,textOf:l,inlineControlBeside:c,atomicControlDeletion:d,splitEndsTheParagraph:u,deleteSelectionPlan:f,deleteSelectionOps:b,deleteRangePlan:y,replacementOffset:h}}function Il(e,t,n,r){if(r===n)return e;let o=i=>i.paragraphId===t?{...i,offset:chunk6IDOVU6L_cjs.c(i.offset,n,r)}:i;return {anchor:o(e.anchor),head:o(e.head)}}var eO=[24,16,12,8,6,4],s5=8;function JC(e,t,n,r,o){let i=r.textOf(e.paragraphId)??"",a=n.after.slice(0,s5);if(a&&i.slice(e.offset,e.offset+a.length)===a)return e;let s=new Set;for(let l of [e.paragraphId,t.paragraphId]){let c=o.indexOf(l);if(!(c<0))for(let d of [c,c-1,c+1])o[d]&&s.add(o[d]);}for(let l of eO){if(n.before.length<l)continue;let c=n.before.slice(-l);if(i.slice(Math.max(0,e.offset-l),e.offset)===c)return e;let d=null;for(let u of s){let f=r.textOf(u)??"";for(let m=f.indexOf(c);m>=0;m=f.indexOf(c,m+1)){if(d)return e;d={...e,paragraphId:u,offset:m+c.length};}}if(d)return d}return e}var Fu="stale",l5=16;function Th(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function tO(e){let t=null,n=false,r=o=>{let i=new Set(e.order());return o.filter(a=>i.has(a)).slice(0,l5).map(a=>({id:a,text:e.textOf(a)??""}))};return {expectHistory(o){n=o;},note(o,i,a){let s=n;if(n=false,t!==null){s&&t!==Fu&&t.history.length===0&&(t={...t,history:r(i)});return}if(!a){t=Fu;return}let l=new Map;for(let d of [o.anchor.paragraphId,o.head.paragraphId]){let u=e.textOf(d);u!==null&&l.set(d,u);}let c=d=>{let u=l.get(d.paragraphId)??"",f=eO[0];return {before:u.slice(Math.max(0,d.offset-f),d.offset),after:u.slice(d.offset,d.offset+f)}};t={selection:o,before:l,order:e.order(),context:{anchor:c(o.anchor),head:c(o.head)},history:s?r(i):[]};},noteLocal(){t!==null&&(t=Fu);},discard(){t=null;},map(o){let i=t;if(t=null,!i)return o;let a=e.carried?.()??null,s=x=>a&&Th(a.from,x)&&Th(o,x)&&e.textOf(a.to.anchor.paragraphId)!==null&&e.textOf(a.to.head.paragraphId)!==null?a.to:null;if(i===Fu)return s(o)??o;let l=e.order(),c=new Set(l);for(let{id:x,text:k}of i.history){if(!c.has(x))continue;let R=e.textOf(x)??k;if(R===k)continue;let C=0;for(;C<k.length&&C<R.length&&k[C]===R[C];)C+=1;let P={paragraphId:x,offset:C+Math.max(0,R.length-k.length)};return {anchor:P,head:P}}let d=new Set(l),u=s(i.selection);if(u)return u;let f=new Set(i.order),m=x=>{let k=i.before.get(x.paragraphId),R=e.textOf(x.paragraphId);if(k===void 0||R===null||R.length>=k.length||!k.startsWith(R)||x.offset<=R.length)return null;let C=l[l.indexOf(x.paragraphId)+1];return C===void 0||f.has(C)||!(e.textOf(C)??"").startsWith(k.slice(R.length))?null:{paragraphId:C,offset:x.offset-R.length}},g=m(o.anchor),b=m(o.head),y=o;for(let[x,k]of i.before)d.has(x)&&(y=Il(y,x,k,e.textOf(x)??k));y={anchor:g??y.anchor,head:b??y.head};let h=x=>{if(d.has(x.paragraphId))return x;let k=i.order.indexOf(x.paragraphId),R=null;for(let E=k-1;E>=0&&R===null;E-=1)d.has(i.order[E])&&(R=i.order[E]);let C=i.before.get(x.paragraphId),P=R===null?"":e.textOf(R)??"";if(R!==null&&C!==void 0&&P.endsWith(C)){let E=P.length-C.length+x.offset;return {paragraphId:R,offset:E}}for(let E=k+1;k>=0&&E<i.order.length;E+=1){let w=i.order[E];if(d.has(w))return {paragraphId:w,offset:0}}return R===null?x:{paragraphId:R,offset:P.length}};return !(l.length!==i.order.length||l.some((x,k)=>x!==i.order[k]))||!Th(o,i.selection)?{anchor:h(y.anchor),head:h(y.head)}:{anchor:JC(h(y.anchor),o.anchor,i.context.anchor,e,l),head:JC(h(y.head),o.head,i.context.head,e,l)}}}}function nO(e,t){let n=e?.historySelection?.()??null;return n&&t?c5(n,t):null}function rO(e){let t=e?.remoteSelectionMove?.();if(!t)return null;let n=o=>({paragraphId:o.nodeId,offset:o.offset}),r=o=>({anchor:n(o.anchor),head:n(o.head)});return {from:r(t.from),to:r(t.to)}}function c5(e,t){let n=i=>{let a=t.paragraphByStableId(i.paragraphId);return a?{paragraphId:a.nodeId,offset:Math.min(i.offset,a.text.length)}:null},r=n(e.anchor),o=n(e.head);return r&&o?{anchor:r,head:o}:null}function oO(e){return {atParagraphEnd(t,n){let r=chunkWO4V6PNS_cjs.hj(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let i=chunkWO4V6PNS_cjs.Nh(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(i==null)return;let a=r.styles.get(i)?.next;if(!a||a===i)return;let s=r.styles.get(a);if(!(!s||s.type!=="paragraph"))return a===r.defaultParagraphStyleId?null:a}}}function aO(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let i=new Blob([new Uint8Array(n)],{type:r}),a;try{a=await t.createImageBitmap(i,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;a=await t.createImageBitmap(i);}try{let s=a.width,l=a.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{a.close();}},convertPreserved(n,r,o){return r==="image/tiff"?f5(e,n,o):d5(n,r)}})}async function d5(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),i=new Uint8Array(e),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),s={maxWidth:4096,maxHeight:4096},l=t==="image/x-emf"?await r(a,s):await o(a,s);if(!l)return null;let c="data:image/png;base64,";if(!l.startsWith(c))return null;let d=atob(l.slice(c.length)),u=new Uint8Array(d.length);for(let f=0;f<d.length;f+=1)u[f]=d.charCodeAt(f);return Object.freeze({bytes:u,mime:"image/png"})}function iO(e,t){let n=e[t];if(!Array.isArray(n)||n.length===0)return null;let r=Number(n[0]);return Number.isSafeInteger(r)&&r>0?r:null}async function u5(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,i=r.decode(o)[0];if(!i)return null;let a=iO(i,"t256"),s=iO(i,"t257");if(a===null||s===null||a>t.maxDimension||s>t.maxDimension||a>t.maxPixels/s)return null;let l=a*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,i),i.width!==a||i.height!==s))return null;let c=r.toRGBA8(i);return c.length!==l*4?null:Object.freeze({rgba:c,pixelWidth:a,pixelHeight:s})}async function f5(e,t,n){let r=await u5(t,n);if(r===null)return null;let o=await p5(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function p5(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let i=o.getContext("2d");if(!i)return null;let a=i.createImageData(n,r);a.data.set(t),i.putImageData(a,0,0);let s=await new Promise(l=>{o.toBlob(c=>l(c),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function sO(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function lO(e){return typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function"?null:Object.freeze({create(t,n){let r=e.mintValidatedBytes(t,t.contentId);if(!r)throw new Error(`PaintImageUrlSource: validated bytes unavailable for ${t.resourceKey}`);let o=new Uint8Array(r);return URL.createObjectURL(new Blob([o],{type:n}))},revoke(t){URL.revokeObjectURL(t);}})}var m5="docx-editor-one-surface__caret",Eh="docx-editor-one-surface__caret--steady",g5=530;function cO(e,t,n){let r=e.ownerDocument.createElement("div");r.className=m5,r.dataset.docxCaret="",r.dataset.docxMarker="",r.setAttribute("contenteditable","false"),r.setAttribute("aria-hidden","true"),r.dataset.noColorInvert="",r.style.position="absolute",r.style.pointerEvents="none",r.style.userSelect="none",r.style.setProperty("-webkit-user-select","none");let o=false,i=ut(()=>e),a=null,s=null,l=null;function c(){let v=e.ownerDocument.activeElement;return v===e||!!v&&e.contains(v)}function d(v){return v.anchor.paragraphId===v.head.paragraphId&&v.anchor.offset===v.head.offset}function u(){s=null,a!==null&&(i.clearTimeout(a),a=null),r.classList.remove(Eh),r.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function f(){r.classList.add(Eh),a!==null&&i.clearTimeout(a),a=i.setTimeout(()=>{a=null,r.classList.remove(Eh);},g5);}function m(){if(o||!c()||n().suppress){u();return}let{layout:v,selection:x,scopedHost:k,scopedHostKind:R,scopedOrigin:C,preferredPageIndex:P,preferredLineId:E,measurer:w,typingStyle:S}=n(),F=t();if(!d(x)){u();return}let A=chunkDBOOTED4_cjs.qe(v,x.head,{...w?{measurer:w}:{},...P!==void 0?{preferredPageIndex:P}:{},...E!==void 0?{preferredLineId:E}:{}});if(!A||!Number.isInteger(A.pageIndex)){u();return}if(S&&w){let{pageIndex:L,lineId:Z}=A,ee=chunkDBOOTED4_cjs.xd(v,x.head.paragraphId)?.find(me=>me.pageIndex===L&&me.line.id===Z),te=ee?.line;if(te&&!te.drawings?.length&&!chunkDBOOTED4_cjs.Yd(A)&&(te.spans.length>0||te.box.height>0)){let me=S();if(me){let le={...tu(v,x)??chunkDBOOTED4_cjs.ba,...me},D=w.lineMetrics(le);if(D.height>0){let T=chunkDBOOTED4_cjs.Gd({...A,width:0,y:te.spans.length>0?te.box.y+te.baseline-D.baseline-chunkDBOOTED4_cjs.ga(le):A.y,height:D.height},ee?.clipBox);if(!T){u();return}A=T;}}}}let $=k??e.querySelector(`[data-page-index="${A.pageIndex}"] > .docx-page-content`);if(!$){u();return}if(!(A.height>0)){u();return}r.style.left=`${(A.x-(C?.x??0))*F}px`,r.style.top=`${(A.y-(C?.y??0))*F}px`,r.style.height=`${A.height*F}px`;let W=chunkDBOOTED4_cjs.Yd(A);r.style.transformOrigin=W?"0 0":"",r.style.transform=W?"rotate(-90deg)":"",r.parentNode!==$&&$.append(r),e.style.caretColor="transparent",l&&l!==k&&l.style.removeProperty("caret-color"),l=k??null,l?.style.setProperty("caret-color","transparent");let U=$===k?R??"scoped":"body",_=`${A.pageIndex}:${U}:${A.x}:${A.y}:${A.height}`;_!==s&&(s=_,f());}let g=()=>{o=true,m();},b=()=>{o=false,m();},y=()=>m(),h=v=>{let x=v.relatedTarget;x&&e.contains(x)||u();};return e.addEventListener("compositionstart",g),e.addEventListener("compositionend",b),e.addEventListener("focusin",y),e.addEventListener("focusout",h),{update:m,destroy(){e.removeEventListener("compositionstart",g),e.removeEventListener("compositionend",b),e.removeEventListener("focusin",y),e.removeEventListener("focusout",h),u();}}}function Ch(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function Pi(e,t){let n=Ch(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function Oh(e,t){return !e||e.kind==="tableBody"?null:Ch(e.tableId)===Ch(t)?e:null}function Rl(e,t,n){let r=a=>{for(let s of a)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let c of l.cells){let d=r(c.blocks);if(d)return d}}return null},o=e.pages[n];if(!o)return null;let i=r(o.fragments);if(i)return {table:i,origin:o.contentBox};for(let a of [o.header,o.footer]){if(!a)continue;let s=r(a.fragments);if(s)return {table:s,origin:a.box}}return null}function Mh(e,t){for(let n of e)if(n.kind==="table"){t(n);for(let r of n.rows)for(let o of r.cells)Mh(o.blocks,t);}}function h5(e,t){for(let n of e.pages){let r=o=>{for(let i=0;i<o.rows.length;i+=1)t({table:o,row:o.rows[i],rowIndex:i});};Mh(n.fragments,r);for(let o of [n.header,n.footer])o&&Mh(o.fragments,r);}}function Ah(e,t,n,r){let o=null;return h5(e,i=>{i.table.tableId===t&&i.row.id===n&&i.row.isHeaderRepeat===r&&(o=i);}),o}function Fh(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function dO(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function uO(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function fO(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var b5=120,pO=20;function Lu(e){return chunkWO4V6PNS_cjs.nd(chunkWO4V6PNS_cjs.mj(e,"w"))??0}function v5(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function Lh(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function Dh(e,t){return t.kind==="insertColumn"?Ah(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?Ah(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function mO(e){return Math.min(160,e)}function gO(e){let t=e.furnitureLayer;t.className="docx-table-furniture",t.setAttribute("contenteditable","false"),t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none";let n=ut(()=>t),r=null,o=null,i=null,a=null,s=null,l=null,c=false,d=0,u=0,f=null,m=null,g=null;function b(H){return vd(H,"button")&&(H.classList.contains("docx-table-insert-row")||H.classList.contains("docx-table-insert-column"))}function y(){let H=t.ownerDocument.activeElement;return H!==null&&b(H)&&H.closest(".docx-table-furniture")===t?H:null}function h(H){for(let V of [...t.children])b(V)&&V!==H&&V.remove();}function v(){m=null,g=null;}function x(){r!==null&&(n.clearTimeout(r),r=null);}function k(){for(let V of [...t.children])b(V)||V.remove();let H=y();if(!H){h(null),v();return}m=H,h(H);}function R(H){let V=m??y(),z=V!==null&&t.ownerDocument.activeElement===V;v(),t.replaceChildren(),H&&z&&e.pagesLayer.focus({preventScroll:true});}function C(){for(let H of [...t.children])b(H)||H.remove();}function P(H,V,z,Y){let ne=e.read().layout.pages[H];if(!ne)return {left:0,top:0};let ce=Y??ne.contentBox,ve=e.scale(),Re=e.pageOffsetX(H);return {left:(ce.x+V+Re)*ve,top:(ce.y+z)*ve}}function E(H,V){let z=e.read(),Y=Rl(z.layout,V.tableId,V.pageIndex);if(!Y)return;let{table:fe,origin:ne}=Y,ce=t.ownerDocument.createElement("div");ce.className="docx-table-resize-preview",ce.style.position="absolute",ce.style.pointerEvents="none";let ve=V.kind!=="rowDivider",Re=P(V.pageIndex,ve?fe.box.x+H:fe.box.x,ve?fe.box.y:fe.box.y+H,ne);ce.style.left=`${Re.left}px`,ce.style.top=`${Re.top}px`,ce.style.width=ve?"2px":`${fe.box.width*e.scale()}px`,ce.style.height=ve?`${fe.box.height*e.scale()}px`:"2px",t.append(ce);}function w(){let H=t.ownerDocument.createElement("button");return H.type="button",H.textContent="+",H.style.position="absolute",H.style.pointerEvents="auto",H}function S(H){W(H);let V=g;if(!V)return;let z=e.read();V.kind==="insertRow"?_(V,z):V.kind==="insertColumn"&&L(V,z);}function F(){queueMicrotask(()=>{!m||t.ownerDocument.activeElement===m||c||o?.kind==="insertRow"||o?.kind==="insertColumn"||(m.remove(),v());});}function A(){if(m&&t.contains(m))return m;let H=y();if(H)return m=H,H;let V=w();return V.addEventListener("pointerenter",()=>{c=true,x();}),V.addEventListener("pointerleave",()=>{c=false;}),V.addEventListener("pointerdown",W),V.addEventListener("mousedown",W),V.addEventListener("click",S),V.addEventListener("blur",F),m=V,V}function $(H,V){let z=Rl(V.layout,H.tableId,H.pageIndex);if(!z)return;let{table:Y,origin:fe}=z,ne=A();if(h(ne),g=H,ne.dataset.tableId=H.tableId,H.kind==="insertRow"){let ce=Y.rows.find(ht=>ht.id===H.rowId);if(!ce)return;ne.dataset.rowId=H.rowId,delete ne.dataset.gridColumnId,ne.className="docx-table-insert-row",ne.setAttribute("aria-label",e.label("table.insertRowBelow"));let ve=ce.box.y+ce.box.height/2,Re=P(H.pageIndex,Y.box.x-14,ve,fe);ne.style.left=`${Re.left}px`,ne.style.top=`${Re.top-8}px`;}else {let ce=Y.rows[0]?.cells.find(Ae=>Ae.gridColumnId===H.gridColumnId);if(!ce)return;ne.dataset.gridColumnId=H.gridColumnId,delete ne.dataset.rowId;let ve=Y.columnEdges[ce.gridColumn]??0,Re=Y.columnEdges[ce.gridColumn+1]??Y.box.width;ne.className="docx-table-insert-column",ne.setAttribute("aria-label",e.label("table.insertColumnRight"));let ht=P(H.pageIndex,Y.box.x+(ve+Re)/2-8,Y.box.y-14,fe);ne.style.left=`${ht.left}px`,ne.style.top=`${ht.top}px`;}t.contains(ne)||t.append(ne);}function W(H){H.preventDefault(),H.stopPropagation();}function U(H,V){if(C(),h(m??y()),!(l||V.editingMode==="view")){if((H.kind==="columnDivider"||H.kind==="rightEdge")&&!H.isHeaderRepeat){let z=Rl(V.layout,H.tableId,H.pageIndex);if(!z)return;let{table:Y,origin:fe}=z,ne=t.ownerDocument.createElement("div");ne.className=H.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",ne.style.position="absolute",ne.style.pointerEvents="auto",ne.style.cursor="col-resize",ne.dataset.active="true";let ce=P(H.pageIndex,Y.box.x+H.edgeX,Y.box.y,fe);ne.style.left=`${ce.left-3}px`,ne.style.top=`${ce.top}px`,ne.style.width="6px",ne.style.height=`${Y.box.height*e.scale()}px`,ne.addEventListener("pointerdown",Z),t.append(ne);}if(H.kind==="rowDivider"&&!H.isHeaderRepeat){let z=Rl(V.layout,H.tableId,H.pageIndex);if(!z)return;let{table:Y,origin:fe}=z,ne=t.ownerDocument.createElement("div");ne.className="docx-table-row-divider-handle layout-table-row-resize-handle",ne.style.position="absolute",ne.style.pointerEvents="auto",ne.style.cursor="row-resize",ne.dataset.active="true";let ce=P(H.pageIndex,Y.box.x,Y.box.y+H.edgeY,fe);ne.style.left=`${ce.left}px`,ne.style.top=`${ce.top-3}px`,ne.style.width=`${Y.box.width*e.scale()}px`,ne.style.height="6px",ne.addEventListener("pointerdown",Z),t.append(ne);}H.kind==="insertRow"&&!H.isHeaderRepeat&&$(H,V),H.kind==="insertColumn"&&!H.isHeaderRepeat&&$(H,V);}}function _(H,V){let z=Dh(V.layout,H);if(!z)return;let Y=Lh(V),fe=Jr({command:{type:"insertRow",where:"below",target:Fh(H.sourceRevision,z)},part:Pi(e.session(),H.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...Y});e.applyTableCommandPlan(fe);}function L(H,V){let z=Dh(V.layout,H);if(!z)return;let Y=z.row.cells.find(ve=>ve.gridColumnId===H.gridColumnId);if(!Y)return;let fe=dO(H.sourceRevision,z,Y);if(!fe)return;let ne=Lh(V),ce=Jr({command:{type:"insertColumn",where:"right",target:fe},part:Pi(e.session(),H.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...ne});e.applyTableCommandPlan(ce);}function Z(H){if(H.button!==0)return;let V=e.read();if(V.editingMode==="view"||!o||o.kind!=="columnDivider"&&o.kind!=="rightEdge"&&o.kind!=="rowDivider")return;H.preventDefault(),H.stopPropagation();let z=o,Y=Dh(V.layout,z);if(!Y)return;let fe=chunkWO4V6PNS_cjs.oj(Pi(e.session(),z.tableId).root,z.tableId);if(!fe.ok||z.kind!=="rowDivider"&&chunkWO4V6PNS_cjs.Vk(fe.topology)!==null)return;let ne=0,ce=0,ve=0,Re=fe.topology.gridColumns.reduce((Fe,we)=>Fe+Lu(we),0),ht;if(z.kind==="columnDivider"){let Fe=fe.topology.gridColumns.find(Je=>Je.id===z.leftGridColumnId),we=fe.topology.gridColumns.find(Je=>Je.id===z.rightGridColumnId);if(!Fe||!we)return;ne=Lu(Fe),ce=Lu(we),ht=uO(z.sourceRevision,Y,z.leftGridColumnId,z.rightGridColumnId);}else if(z.kind==="rightEdge"){let Fe=fe.topology.gridColumns.find(we=>we.id===z.gridColumnId);if(!Fe)return;ne=Lu(Fe),ce=0,ht=fO(z.sourceRevision,Y,z.gridColumnId);}else ve=Math.max(20,Math.round(Y.row.box.height*pO)),ht=Fh(z.sourceRevision,Y);let Ae=H.currentTarget;Ae.setPointerCapture(H.pointerId),d=H.clientX,u=H.clientY,l={pointerId:H.pointerId,startClientX:H.clientX,startClientY:H.clientY,startEdgePt:z.kind==="rowDivider"?z.edgeY:z.edgeX,leftTwips:ne,rightTwips:ce,tableWidthTwips:Re,rowHeightTwips:ve,target:z,ref:Y,resizeTarget:ht,captureElement:Ae,rightEdge:z.kind==="rightEdge",vertical:z.kind==="rowDivider",cancelled:false};for(let Fe of [...t.children])Fe!==Ae&&Fe.remove();E(z.kind==="rowDivider"?z.edgeY:z.edgeX,z);}function ee(){if(l){try{l.captureElement.hasPointerCapture(l.pointerId)&&l.captureElement.releasePointerCapture(l.pointerId);}catch{}l.cancelled=true,l=null,k(),o=null;}}function te(){if(!l||l.cancelled){l=null,k();return}let H=l;l=null;try{H.captureElement.hasPointerCapture(H.pointerId)&&H.captureElement.releasePointerCapture(H.pointerId);}catch{}if(H.vertical?u===H.startClientY:d===H.startClientX){k();return}let V=e.read(),z=Lh(V),Y=(H.vertical?u-H.startClientY:d-H.startClientX)/e.scale(),fe=Math.round(Y*pO),ne;if(H.target.kind==="rowDivider")ne=bI({part:Pi(e.session(),H.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...z},H.resizeTarget,Math.max(mO(H.rowHeightTwips),H.rowHeightTwips+fe));else if(H.rightEdge&&H.target.kind==="rightEdge"){let ce=Math.max(300,H.leftTwips+fe),ve=Math.max(ce,H.tableWidthTwips+fe);ne=Jr({command:{type:"commitTableRightEdgeResize",target:H.resizeTarget,columnWidthTwips:ce,tableWidthTwips:ve},part:Pi(e.session(),H.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...z});}else if(H.target.kind==="columnDivider"){let ce=H.leftTwips+fe,ve=H.rightTwips-fe;ce=Math.max(300,ce),ve=Math.max(300,ve);let Re=H.leftTwips+H.rightTwips;ce+ve!==Re&&(ce>Re-300?(ce=Re-300,ve=300):ve=Re-ce),ne=Jr({command:{type:"commitTableColumnDividerResize",target:H.resizeTarget,leftWidthTwips:ce,rightWidthTwips:ve},part:Pi(e.session(),H.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...z});}else {k();return}e.applyTableCommandPlan(ne),k();}function me(H){if(!f)return null;i??=chunkDBOOTED4_cjs.Se(H.layout);let V=e.pageOffsetX(f.pageIndex);return chunkDBOOTED4_cjs.We(i,f.x,f.y,H.layout,V,f.pageIndex)}function le(H){if(!o||l||H.editingMode==="view")return;x();let V=me(H),z=Oh(V,H.selection.head.paragraphId);if(!z){o=null,k();return}if(chunkDBOOTED4_cjs.Ue(z)!==chunkDBOOTED4_cjs.Ue(o)){o=null,k();return}o=z,U(z,H);}function D(){let H=m??y(),V=H!==null&&t.ownerDocument.activeElement===H;v(),H&&t.contains(H)&&H.remove(),V&&e.pagesLayer.focus({preventScroll:true});}function T(H){if(l||H.editingMode==="view")return;let V=m??y();if(!V||!t.contains(V)){g&&v();return}if(m=V,!g||g.kind!=="insertRow"&&g.kind!=="insertColumn")return;i??=chunkDBOOTED4_cjs.Se(H.layout);let z=chunkDBOOTED4_cjs.Ue(g),Y=chunkDBOOTED4_cjs.Ve(i,g);if(!Y||chunkDBOOTED4_cjs.Ue(Y)!==z){D();return}g=Y,$(Y,H);}function B(H){let V=e.read();if(l&&H.pointerId===l.pointerId){d=H.clientX,u=H.clientY;let ve=(l.vertical?H.clientY-l.startClientY:H.clientX-l.startClientX)/e.scale();l.target.kind==="rowDivider"&&(ve=Math.max(ve,(mO(l.rowHeightTwips)-l.rowHeightTwips)/20));for(let Re of [...t.children])Re!==l.captureElement&&Re.remove();E(l.startEdgePt+ve,l.target);return}if(V.editingMode==="view"){R(false);return}if(ko(H.target)&&m?.contains(H.target)){x();return}let z=v5(e,H.clientX,H.clientY),Y=chunkDBOOTED4_cjs._d(V.layout,z.y);Y>=0&&(f={x:z.x,y:z.y,pageIndex:Y});let fe=Y>=0?e.pageOffsetX(Y):0;i??=chunkDBOOTED4_cjs.Se(V.layout);let ne=i?chunkDBOOTED4_cjs.We(i,z.x,z.y,V.layout,fe,Y>=0?Y:void 0):null,ce=Oh(ne,V.selection.head.paragraphId);if(!ce){if(c)return;n.migrate(),!r&&o&&(r=n.setTimeout(()=>{r=null,o=null,k();},b5));return}r&&(n.clearTimeout(r),r=null),!(o&&chunkDBOOTED4_cjs.Te(ce)===chunkDBOOTED4_cjs.Te(o))&&(o=ce,U(ce,V));}function q(H){if(!(!l||H.pointerId!==l.pointerId)){if(e.read().editingMode==="view"){ee();return}te();}}function j(H){!l||H.pointerId!==l.pointerId||ee();}function X(H){H.key!=="Escape"||!l||ee();}e.pagesLayer.addEventListener("pointermove",B);let oe=[e.listeners.onDocument("pointermove",B),e.listeners.onDocument("pointerup",q),e.listeners.onDocument("pointercancel",j)];return e.pagesLayer.addEventListener("keydown",X),{update(){let H=e.read(),V=a,z=s;i=null,a=H.layout.revision,s=H.storeRevision,H.editingMode==="view"?(ee(),o=null,x(),R(true)):V!==null&&(V!==H.layout.revision||z!==H.storeRevision)&&(o!==null&&le(H),T(H)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},cancelDrag:ee,refreshLabels(){let H=e.read();if(H.editingMode==="view")return;let V=m??y();if(V&&t.contains(V)&&g&&(g.kind==="insertRow"||g.kind==="insertColumn")){$(g,H);return}o&&(o.kind==="insertRow"||o.kind==="insertColumn")&&$(o,H);},destroy(){x(),ee(),v(),k(),e.pagesLayer.removeEventListener("pointermove",B);for(let H of oe)H();e.pagesLayer.removeEventListener("keydown",X),t.remove();}}}var x5=e=>e==="left"||e==="center"||e==="right"||e==="both";function hO(e,t){if(!t.some(r=>r.localName==="bidi"))return e;let n=e.map(r=>r.localName).lastIndexOf("bidi");return n===-1?e:e.filter((r,o)=>o!==n)}function Du(e,t,n,r=n){let o=()=>chunkDBOOTED4_cjs.vd([...t,...n]);if(e.paragraphDirection!==void 0&&e.localName==="bidi"){let a=e.paragraphDirection==="rtl";return o()===a?null:a?chunkDBOOTED4_cjs.vd(hO(t,r))?{localName:"bidi",remove:true}:{localName:"bidi"}:chunkDBOOTED4_cjs.vd(hO(t,r))?{localName:"bidi",attributes:{val:"0"}}:{localName:"bidi",remove:true}}let i=e.attributes?.val;return !e.physicalAlignment||e.localName!=="jc"||!x5(i)?e:{localName:"jc",attributes:{val:chunkDBOOTED4_cjs.ed(i,o())}}}function yO(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkYQWMI6J5_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),{session:r,commit:o,orderedRange:i,selectionMark:a,textOf:s}=e,l=()=>e.displayMode(),c=()=>e.authorFilter(),d=()=>r.partFor(e.storyScope())??r.part(),u=(x,k,R)=>{let C=P=>r.applyTreeOps(P,k,R,e.storyScope());return e.applyOutsideToc?e.applyOutsideToc(x,C):C(x)},f=()=>{let x=e.runFormatRefusal?.();return x?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:x})),true):false},m={get value(){return e.layout()}},g={get value(){return e.selection()}},b=(x,k,R)=>{let C=d();if(x.paragraphId===k.paragraphId){let F=t(C,x.paragraphId,x.offset,k.offset,R,l(),c());if(F.length===0)return;let A=n(C,x.paragraphId,R);o(()=>u([...F.map($=>({op:"setRunProperties",paragraphId:x.paragraphId,start:$.start,end:$.end,properties:$.properties,...$.targetRunIds?{targetRunIds:$.targetRunIds}:{}})),...e.paragraphMarkVisible(x.paragraphId)?HP(s(x.paragraphId),x,k,A):[]],a()));return}let P=e.paragraphOrder(),E=P.indexOf(x.paragraphId),w=P.indexOf(k.paragraphId);if(E===-1||w===-1)return;let S=[];for(let F=E;F<=w;F+=1){let A=P[F],$=s(A),W=F===E?x.offset:0,U=F===w?k.offset:$.length,_=W<U?t(C,A,W,U,R,l(),c()):[];for(let Z of _)S.push({op:"setRunProperties",paragraphId:A,start:Z.start,end:Z.end,properties:Z.properties,...Z.targetRunIds?{targetRunIds:Z.targetRunIds}:{}});(F<w||W===0&&U===$.length&&$.length>0)&&e.paragraphMarkVisible(A)&&S.push({op:"setParagraphMarkProperties",paragraphId:A,properties:n(C,A,R)});}S.length!==0&&o(()=>u(S,a()));},y=(x,k)=>{let R=d(),C=[];for(let P of chunk5JPIEN54_cjs.la(m.value,x)){let E=s(P);for(let w of t(R,P,0,E.length,k,l(),c()))C.push({op:"setRunProperties",paragraphId:P,start:w.start,end:w.end,properties:w.properties,...w.targetRunIds?{targetRunIds:w.targetRunIds}:{}});e.paragraphMarkVisible(P)&&C.push({op:"setParagraphMarkProperties",paragraphId:P,properties:n(R,P,k)});}return C.length===0?false:(o(()=>u(C,a()),void 0,{keepCellSelection:true}),true)},h=x=>{chunkWO4V6PNS_cjs.Kh(x.localName)&&e.setPendingFormats(chunkWO4V6PNS_cjs.Ph(e.pendingFormats()??[],x));},v=x=>{if(x.length===0)return;let k=e.selectedCells?.(),R=k&&k.length>0?[...chunk5JPIEN54_cjs.la(m.value,k)]:null,{from:C,to:P}=i(),E=R??e.paragraphOrder(),w=R?0:E.indexOf(C.paragraphId),S=R?E.length-1:E.indexOf(P.paragraphId);if(w===-1||S===-1)return;let F=d(),A=E.slice(w,S+1).filter($=>e.paragraphMarkVisible($)).flatMap($=>{let W=chunkWO4V6PNS_cjs.Nh(F,$),U=W,_=Sr(m.value,$),L=false;for(let Z of x){let ee=Du(Z,_,U,W);if(!ee)continue;if(L=true,ee.remove){U=U.filter(le=>le.localName!==ee.localName);continue}let te=ee.mergeAttributes?{...U.find(le=>le.localName===ee.localName)?.attributes??{},...ee.attributes}:ee.attributes??{},me=Object.fromEntries(Object.entries(te).filter(([,le])=>le!=null));U=chunkWO4V6PNS_cjs.Ph(U,{localName:ee.localName,...Object.keys(me).length>0?{attributes:me}:{}});}return L?[{op:"setParagraphProperties",paragraphId:$,properties:U}]:[]});A.length!==0&&o(()=>u(A,a()),void 0,{keepCellSelection:R!==null});};return {setRunProperty(x,k){if(f())return;let R={localName:x,...k?{attributes:k}:{}},C=e.selectedCells?.();if(C&&C.length>0){y(C,R);return}let{from:P,to:E}=i();if(P.paragraphId===E.paragraphId&&P.offset===E.offset){h(R);return}b(P,E,R);},setParagraphProperty(x,k,R){v([{localName:x,...k?{attributes:k}:{},...R??{}}]);},setParagraphProperties:v,formatting:()=>DP(NP(m.value,g.value,(x,k)=>{let R=r.effectiveRunDefaults(x,k);if(R.fontFamily!==null)return R;let C=e.defaultFontFamily?.()??null;return C===null?R:{...R,fontFamily:C}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,g.value.anchor.paragraphId===g.value.head.paragraphId?[g.value.head.paragraphId]:e.paragraphOrder(),e.defaultFontFamily?.()??null),e.pendingFormats()),toggleRunProperty(x,k){if(f())return;let R=e.selectedCells?.(),C=k?.val,P=xa(e.pendingFormats(),x,C)??_g(m.value,g.value,x,R,C,e.paragraphOrder()),E=P?{localName:x,attributes:{val:w5[x]??"0"}}:{localName:x,...k?{attributes:k}:{}};if(R&&R.length>0){y(R,E);return}let{from:w,to:S}=i();if(w.paragraphId===S.paragraphId&&w.offset===S.offset){let F=e.pendingFormats()??[],A=_g(m.value,g.value,x,void 0,C,e.paragraphOrder());if(!P===A){let $=F.filter(W=>W.localName!==x);e.setPendingFormats($.length>0?$:null);}else h(E);return}b(w,S,E);},clearFormatting(){if(f())return;e.setPendingFormats(null);let x=m.value,k=e.paragraphOrder(),R=e.selectedCells?.(),C=R&&R.length>0?[...chunk5JPIEN54_cjs.la(x,R)]:eu(k,i());if(C.length===0)return;let{from:P,to:E}=i(),w=R!==void 0&&R.length>0,S=d(),F=[];for(let A of C){let $=s(A),W=w||A!==P.paragraphId?0:P.offset,U=w||A!==E.paragraphId?$.length:E.offset;for(let Z of chunkWO4V6PNS_cjs.$h(S,A,W,U,l(),c()))LP(S,A,Z.start,Z.end,l(),c())&&F.push({op:"setRunProperties",paragraphId:A,start:Z.start,end:Z.end,properties:[]});e.paragraphMarkVisible(A)&&chunkWO4V6PNS_cjs.Oh(S,A).length>0&&F.push({op:"setParagraphMarkProperties",paragraphId:A,properties:[]});let _=chunkWO4V6PNS_cjs.Nh(S,A),L=_.filter(Z=>Z.localName==="bidi");e.paragraphMarkVisible(A)&&_.length>L.length&&F.push({op:"setParagraphProperties",paragraphId:A,properties:L});}F.length!==0&&o(()=>u(F,a()),void 0,{keepCellSelection:w});}}}var w5={u:"none",vertAlign:"baseline"};var S5=new Set,bO=500;function k5(e){let t=l=>({val:l?"1":"0"}),n=l=>String(Math.max(2,Math.min(3276,Math.round(l*2)))),r=e.latinLane??e,o=e.complexLane??e,i=n(r.fontSizePt),a=[{localName:"b",attributes:t(r.bold)},{localName:"i",attributes:t(r.italic)},{localName:"bCs",attributes:t(o.bold)},{localName:"iCs",attributes:t(o.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:i}},{localName:"szCs",attributes:{val:n(o.fontSizePt)}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}],s=e.complexLane?.fontFamily??null;return (r.fontFamily||r.fontFamilyEastAsia||s)&&a.push({localName:"rFonts",attributes:{...r.fontFamily?{ascii:r.fontFamily,hAnsi:r.fontFamily}:{},...r.fontFamilyEastAsia?{eastAsia:r.fontFamilyEastAsia}:{},...s?{cs:s}:{}}}),a}function vO(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunkYQWMI6J5_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),r=e.session,o=()=>r.partFor(e.storyScope())??r.part(),i="off",a=null,s=null,l=null,c=Pd,d=()=>{let v=a===null?"none":a.paragraphProperties?"paragraph":"run";return (c.mode!==i||c.level!==v)&&(c={mode:i,level:v}),c},u=(v,x,k)=>{if(k||v.paragraphId!==x.paragraphId||v.offset===x.offset)return true;let R=e.textOf(v.paragraphId);return v.offset===0&&x.offset===R.length&&R.length>0},f=()=>{let v=e.selectedCells?.(),x=v!==void 0&&v.length>0,{from:k,to:R}=e.orderedRange();if(!e.paragraphOrder().includes(k.paragraphId))return false;let C=tu(e.layout(),e.selection(),v,e.paragraphOrder()),P=u(k,R,x)?chunkWO4V6PNS_cjs.Nh(o(),k.paragraphId):null;return !C&&P===null?false:(a={runProperties:C?k5(C):[],paragraphProperties:P},true)},m=()=>f()?(e.publish(),true):false,g=()=>{let v=a;if(!v)return {wrote:false,armed:false,built:false};let x=e.selectedCells?.(),k=x!==void 0&&x.length>0,{from:R,to:C}=e.orderedRange(),P=!k&&R.paragraphId===C.paragraphId&&R.offset===C.offset,E=P?Zd(e.layout(),R,S5):null,w=E?.from??R,S=E?.to??C,F=P&&w.offset===S.offset,A=k?[...chunk5JPIEN54_cjs.la(e.layout(),x)]:eu(e.paragraphOrder(),{from:w,to:S});if(A.length===0)return {wrote:false,armed:false,built:false};let $=o(),W=e.displayMode(),U=[];for(let ee of A){let te=e.textOf(ee),me=k||ee!==w.paragraphId?0:w.offset,le=k||ee!==S.paragraphId?te.length:S.offset;if(me<le&&v.runProperties.length>0)for(let B of t($,ee,me,le,v.runProperties,W,e.authorFilter()))U.push({op:"setRunProperties",paragraphId:ee,start:B.start,end:B.end,properties:B.properties,...B.targetRunIds?{targetRunIds:B.targetRunIds}:{}});let D=v.paragraphProperties!==null||k||ee!==S.paragraphId||me===0&&le===te.length&&te.length>0,T=e.paragraphMarkVisible(ee);D&&T&&v.runProperties.length>0&&U.push({op:"setParagraphMarkProperties",paragraphId:ee,properties:n($,ee,v.runProperties)}),v.paragraphProperties&&T&&U.push({op:"setParagraphProperties",paragraphId:ee,properties:[...v.paragraphProperties]});}let _=r.packageRevision();U.length>0&&e.commit(()=>r.applyTreeOps(U,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:k});let L=r.packageRevision()!==_,Z=F&&v.runProperties.length>0&&(L||U.length===0);return Z&&e.armPendingFormats(v.runProperties),{wrote:L,armed:Z,built:U.length>0}},b=()=>{let v=g();return v.wrote&&i==="once"&&h(),v.wrote?"painted":v.armed?"armed":v.built?"refused":"nothingToPaint"},y=()=>{i!=="off"&&(i="off",e.publish());},h=()=>{s=null,l=null,y();};return {state:d,capture:m,apply:b,disarm:h,press(){let v=e.now(),x=s!==null&&v-s<bO,k=i;s=v;let R=()=>(s=null,false);return k==="once"&&x?f()?(i="locked",e.publish(),true):(y(),R()):k!=="off"?(y(),l=k==="locked"?v:null,true):l!==null&&v-l<bO?(l=null,true):f()?(i="once",l=null,e.publish(),true):R()},applyIfArmed(){i==="off"||a===null||g().wrote&&i==="once"&&h();}}}var xO=new WeakMap;function I5(e){let t=xO.get(e);if(t!==void 0)return t;let n=[e],r=false;for(;n.length>0&&!r;){let o=n.pop();if(o.kind!=="textValue"){(o.localName==="bidi"||o.localName==="rtl")&&(r=true);for(let i of o.children)n.push(i);}}return xO.set(e,r),r}function wO(e,t=()=>null){let n=null;return {keydown(r){if(r.key==="Shift"&&(r.location===1||r.location===2)&&r.ctrlKey&&!r.altKey&&!r.metaKey&&!r.isComposing&&!r.defaultPrevented){n=r.location===2?"rtl":"ltr";return}r.key!=="Control"&&(n=null);},keyup(r){if(n===null||r.key!=="Shift"&&r.key!=="Control")return;let o=n;if(n=null,r.defaultPrevented)return;let i=t();i===null||!I5(i)||e.setParagraphProperties([{localName:"bidi",paragraphDirection:o}]);},disarm(){n=null;}}}function SO(e,t){return e.addEventListener("keyup",t.keyup),e.addEventListener("pointerdown",t.disarm,{capture:true}),e.addEventListener("focusout",t.disarm),()=>{e.removeEventListener("keyup",t.keyup),e.removeEventListener("pointerdown",t.disarm,{capture:true}),e.removeEventListener("focusout",t.disarm);}}function R5(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),i=Math.min(e.y+e.height,t.y+t.height);return o<=n||i<=r?0:(o-n)*(i-r)}function P5(e,t){return R5(e,t)>0?true:e.width===0?t.x<=e.x&&e.x<=t.x+t.width&&!(e.y+e.height<t.y||t.y+t.height<e.y):false}function Pr(e,t,n){if(t.paragraphId===n.paragraphId)return t.offset-n.offset;let r=chunkDBOOTED4_cjs.Ta(e);return r.indexOf(t.paragraphId)-r.indexOf(n.paragraphId)}function IO(e,t,n){if(!(t>chunkDBOOTED4_cjs.Vd))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunkDBOOTED4_cjs.Vd)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let i of o.cells)IO(i.blocks,t+1,n);}}}function Nh(e,t){if(t.range){let{paragraphId:o,start:i,end:a}=t.range;return {from:{paragraphId:o,offset:i},to:{paragraphId:o,offset:a}}}if(t.level==="inline"||t.fragments.length===0)return null;let n=null,r=null;for(let o of t.fragments){let i=e.pages[o.pageIndex];i&&IO(i.fragments,0,a=>{if(!P5(o.box,a.box))return;let s={paragraphId:a.paragraphId,offset:0},l={paragraphId:a.paragraphId,offset:chunkDBOOTED4_cjs.se(e,a.paragraphId).length};(!n||Pr(e,s,n)<0)&&(n=s),(!r||Pr(e,l,r)>0)&&(r=l);});}return n&&r?{from:n,to:r}:null}function Pl(e,t){return t.placeholder?Nh(e,t):null}function RO(e){return !e.placeholder&&e.level==="inline"&&e.range!==void 0&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function T5(e){return e.placeholder}var kO=new WeakMap;function E5(e,t){let n=kO.get(e);if(!n){n=new Map;for(let r of e.contentControls??[]){if(!RO(r))continue;let o=Nh(e,r),i=n.get(o.from.paragraphId)??[];i.push(o),n.set(o.from.paragraphId,i);}kO.set(e,n);}return n.get(t)??[]}function Hh(e,t){let n=null;for(let r of E5(e,t.paragraphId))t.offset<=r.from.offset||t.offset>=r.to.offset||(!n||r.from.offset<n.from.offset||r.from.offset===n.from.offset&&r.to.offset>n.to.offset)&&(n=r);return n}function PO(e,t,n){let r=Hh(e,n);if(!r)return n;let o=t.paragraphId===n.paragraphId?n.offset-t.offset:0;if(o>0)return r.to;if(o<0)return r.from;let i=(r.from.offset+r.to.offset)/2;return n.offset<i?r.from:r.to}function Tl(e,t,n={}){let r=e.contentControls??[];if(r.length===0)return t;let o=Pr(e,t.anchor,t.head)<=0,i=o?t.anchor:t.head,a=o?t.head:t.anchor,s=true;for(;s;){s=false;for(let l of r){let c=n.atomic===true&&RO(l);if(!l.placeholder&&!c)continue;let d=Nh(e,l);if(!d)continue;let u=Pr(e,i,a)===0,f=Pr(e,i,d.from);(u?(T5(l)?f>=0:f>0)&&Pr(e,i,d.to)<0:Pr(e,i,d.to)<0&&Pr(e,a,d.from)>0)&&(Pr(e,d.from,i)<0&&(i=d.from,s=true),Pr(e,d.to,a)>0&&(a=d.to,s=true));}}return o?{anchor:i,head:a}:{anchor:a,head:i}}var C5=500,TO=4,Fa=40,Nu=12;function O5(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function EO(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},i=chunkDBOOTED4_cjs.ee(e,t.pageIndex,o);return i?.placeholder?i:null}let r=O5(e,n);return r?.placeholder?r:null}var M5=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function CO(e,t={}){if(t.mode==="native")return {dragging:()=>false,cancelGesture:()=>{},destroy:()=>{}};let{pagesLayer:n}=e,r=t.atomicInlineControls===true,o=ut(()=>n),i=null,a=null,s=null,l=0,c=0,d=0,u=0,f=null;function m(T,B){if(!s){let j=n.getBoundingClientRect();s={left:j.left,top:j.top};}let q=e.scale()||1;return {x:(T-s.left)/q,y:(B-s.top)/q}}function g(T){return {scope:{kind:"headerFooter",rId:T.rId},pageIndex:T.pageIndex,kind:T.kind,partName:T.partName,variant:T.variant}}function b(T,B){let q=e.layout(),j=m(T,B),X=chunkDBOOTED4_cjs._d(q,j.y),oe=q.pages[X];if(!oe)return null;let H=e.measurer();return chunkDBOOTED4_cjs.be(q,X,{x:j.x-oe.contentBox.x-e.pageOffsetX(X),y:j.y-oe.contentBox.y},H?{measurer:H}:{})}function y(T,B){let q=e.activeNote?.()??null;if(q){let V=e.layout(),z=Sd(V,m(T,B),e.pageOffsetX);if(!z||z.scopeId!==q.scopeId)return null;let Y=e.measurer();return chunkDBOOTED4_cjs.ce(V,z.pageIndex,z.fragments,z.local,{...Y?{measurer:Y}:{}})}let j=e.activeHeaderFooter?.()??null;if(!j)return b(T,B);let X=e.layout(),oe=m(T,B),H=Im(X,oe,e.pageOffsetX);if(H&&wd(H.story,g(j))){let V=e.measurer();return xm(X,H.pageIndex,H.story,H.local,V?{measurer:V}:{})}return null}function h(T,B){let{story:q,pageIndex:j,kind:X}=T;return {rId:q.rId,pageIndex:j,kind:X,partName:q.partName,variant:q.variant,...B?{position:B}:{}}}function v(T){let B=e.measurer();return xm(e.layout(),T.pageIndex,T.story,T.local,B?{measurer:B}:{})?.position??void 0}let x=new WeakMap;function k(T,B){let q=e.activeNote?.();if(q){let H=ua(T,null,q.scopeId).indexOf(B);return H===-1?-1:H}let j=e.activeHeaderFooter?.();if(j){let H=ua(T,g(j)).indexOf(B);return H===-1?-1:H}let X=x.get(T);return X||(X=new Map(chunkDBOOTED4_cjs.Ta(T).map((oe,H)=>[oe,H])),x.set(T,X)),X.get(B)??-1}function R(T,B,q){let j=k(T,B.paragraphId),X=k(T,q.paragraphId);return j!==X?j<X:B.offset<q.offset}function C(T,B,q){if(q==="character")return {from:B,to:B};let j=B.paragraphId;if(q==="paragraph"){let X=chunkDBOOTED4_cjs.se(T,j);return {from:{paragraphId:j,offset:0},to:{paragraphId:j,offset:X.length}}}return Zd(T,B,chunkDBOOTED4_cjs.te(T,j))}function P(T,B,q,j,X){let oe=X?EO(T,X):null,H=oe?Pl(T,oe)??C(T,q,j):C(T,q,j),V=R(T,H.from,B.from)?{anchor:B.to,head:H.from}:{anchor:B.from,head:H.to};return Tl(T,V,{atomic:r})}function E(){return e.container.closest(".docx-editor__scroll-container")}function w(T,B,q){if(q<T+Fa){let j=Math.max(0,T+Fa-q);return -Math.min(Nu,j/Fa*Nu)}if(q>B-Fa){let j=Math.max(0,q-(B-Fa));return Math.min(Nu,j/Fa*Nu)}return 0}function S(){f!==null&&(o.cancelAnimationFrame(f),f=null);}function F(){f=null;let T=a,B=E();if(!T||!B)return;let q=B.getBoundingClientRect(),j=w(q.top,q.bottom,T.clientY);j!==0&&(B.scrollTop+=j,s=null,$(T.clientX,T.clientY),f=o.requestAnimationFrame(F));}function A(){if(f!==null||!a)return;let T=E();if(!T)return;let B=T.getBoundingClientRect();w(B.top,B.bottom,a.clientY)!==0&&(f=o.requestAnimationFrame(F));}function $(T,B){let q=a;if(!q)return;let j=y(T,B);j&&((e.isReadOnlyPosition?.(j.position)??e.isReadOnlyParagraph?.(j.position.paragraphId))||W(q,j)||(q.caret=j.caret,e.setSelection(P(e.layout(),q.anchorRange,j.position,q.granularity,j),j.caret)));}function W(T,B){let q=T.anchorCell;if(!q)return false;if(!B.cell||B.cell.tableId!==q.tableId)return T.cellDragging;if(!T.cellDragging&&B.cell.cellId===q.cellId)return false;let j=chunk5JPIEN54_cjs.ja(e.layout(),q,B.cell);return j?(T.cellDragging=true,e.setCellSelection(j),true):T.cellDragging}function U(T){let B=Date.now(),q=B-c;return l=Math.abs(T.clientX-d)<=TO&&Math.abs(T.clientY-u)<=TO&&q>=0&&q<=C5?l+1:1,c=B,d=T.clientX,u=T.clientY,l}let _=["character","word","paragraph"],L=T=>{if(T.button!==0)return;if(e.onChangeBarToggle&&T.target?.closest?.("[data-docx-change-bar-toggle]")){T.preventDefault(),T.stopPropagation(),e.onChangeBarToggle();return}let B=T.target?.closest?.("[data-docx-cc-widget]");if(B){if(T.preventDefault(),T.stopPropagation(),B.hasAttribute("disabled")||B.dataset.disabledReason)return;let Se=B.dataset.docxCcId,Me=B.dataset.docxCcWidget;Se&&Me&&e.onContentControlWidget?.(Se,Me);return}if(e.selectionLocked?.()||T.pointerType==="touch")return;a&&me(),s=null;let q=e.layout(),j=m(T.clientX,T.clientY),X=e.activeHeaderFooter?.()??null,oe=e.activeNote?.()??null,H=Im(q,j,e.pageOffsetX),V=H!==null&&$k(q,H,j,e.pageOffsetX,X!==null&&wd(H.story,g(X)),e.measurer()),z=V?null:H,Y=Sd(q,j,e.pageOffsetX),fe=V?null:T.target?.closest("[data-docx-hf]"),ne=!!(fe||z),ce=T.target,ve=ce?.closest("[data-docx-note-ref]"),Re=ce?.closest("[data-docx-note-mark-back]"),ht=null,Ae=()=>ht??=U(T);if(ve?.dataset.docxNoteScope){T.preventDefault(),e.focus(),e.enterNote?.(ve.dataset.docxNoteScope);return}if(Re){T.preventDefault(),e.focus(),e.exitNote?.(true);return}if(Y&&!ne){let Se=e.measurer?.(),Me=chunkDBOOTED4_cjs.ce(q,Y.pageIndex,Y.fragments,Y.local,{...Se?{measurer:Se}:{}});if(!oe||oe.scopeId!==Y.scopeId){T.preventDefault(),e.focus(),e.enterNote?.(Y.scopeId,Me?{paragraphId:Me.position.paragraphId,offset:Me.position.offset}:void 0,Y.pageIndex);return}if(oe.pageIndex!==Y.pageIndex){T.preventDefault(),e.focus(),e.enterNote?.(Y.scopeId,Me?{paragraphId:Me.position.paragraphId,offset:Me.position.offset}:void 0,Y.pageIndex);return}}else if(oe){if(!vm(q,j,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(X)if(z&&wd(z.story,g(X)))z.pageIndex!==X.pageIndex&&e.enterHeaderFooter?.(h(z,v(z)));else if(z&&z.story.rId){T.preventDefault(),e.focus(),e.enterHeaderFooter?.(h(z,v(z)));return}else if(vm(q,j,e.pageOffsetX)){T.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let Se=Ae()>=2?km(q,j,e.pageOffsetX):null;Se&&(T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Se.kind,Se.pageIndex));return}else if(ne&&Ae()>=2){if(z?.story.rId)T.preventDefault(),e.focus(),e.enterHeaderFooter?.(h(z,v(z)));else if(vr(fe)){let Se=fe.dataset.docxRId,Me=fe.dataset.docxHf,tt=fe.closest("[data-page-index]")?.getAttribute("data-page-index"),Et=tt!=null?Number(tt):NaN;if((Me==="header"||Me==="footer")&&Number.isInteger(Et))if(Se){let un=q.pages[Et]?.[Me];T.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:Se,pageIndex:Et,kind:Me,partName:un?.partName??"",variant:un?.variant??"default"});}else q.pages[Et]?.[Me]||(T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Me,Et));}return}else if(Ae()>=2){let Se=km(q,j,e.pageOffsetX);if(Se){T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Se.kind,Se.pageIndex);return}}let Fe=y(T.clientX,T.clientY);if(!Fe)return;if(e.isReadOnlyPosition?.(Fe.position)??e.isReadOnlyParagraph?.(Fe.position.paragraphId)){T.preventDefault();return}if(Ae()===2&&e.onTextFormDoubleClick?.(T))return;T.preventDefault(),e.focus();try{n.setPointerCapture(T.pointerId);}catch{}i=n.ownerDocument,i.addEventListener("pointermove",ee),i.addEventListener("pointerup",te),i.addEventListener("pointercancel",te);let we=Ae(),Je=T.shiftKey?"character":_[(we-1)%_.length],Zt=EO(q,Fe);if(Zt&&!T.shiftKey){let Se=()=>{we===1&&M5.has(Zt.controlType)&&e.onContentControlWidget?.(Zt.id,Zt.controlType);};if(e.selectContentControl?.(Zt.id)){let tt=e.selection(),Et=R(q,tt.anchor,tt.head)||tt.anchor.paragraphId===tt.head.paragraphId&&tt.anchor.offset===tt.head.offset?{from:tt.anchor,to:tt.head}:{from:tt.head,to:tt.anchor};a={pointerId:T.pointerId,granularity:"character",anchorRange:Et,anchorCell:Fe.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},Se();return}let Me=Pl(q,Zt);if(Me){a={pointerId:T.pointerId,granularity:"character",anchorRange:Me,anchorCell:Fe.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},Z(()=>e.setSelection({anchor:Me.from,head:Me.to})),Se();return}}if(T.shiftKey){let Se=e.selection();a={pointerId:T.pointerId,granularity:Je,caret:Fe.caret,anchorRange:{from:Se.anchor,to:Se.anchor},anchorCell:Fe.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},Z(()=>e.setSelection(P(q,{from:Se.anchor,to:Se.anchor},Fe.position,Je,Fe),Fe.caret));}else {let Se=(r&&Je==="word"?Hh(q,Fe.position):null)??C(q,Fe.position,Je);a={pointerId:T.pointerId,granularity:Je,caret:Fe.caret,anchorRange:Se,anchorCell:Fe.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},Z(()=>e.setSelection(Tl(q,{anchor:Se.from,head:Se.to},{atomic:r}),Fe.caret));}};function Z(T){try{T();}catch(B){throw me(),B}}let ee=T=>{let B=a;if(!(!B||T.pointerId!==B.pointerId)){if(e.selectionLocked?.())return me();T.preventDefault(),B.clientX=T.clientX,B.clientY=T.clientY,$(T.clientX,T.clientY),A();}},te=T=>{let B=a;if(!B||T.pointerId!==B.pointerId)return;me();try{n.releasePointerCapture(B.pointerId);}catch{}let q=e.cellSelection();q?e.setCellSelection(q):e.setSelection(e.selection(),B.caret),T.type==="pointerup"&&(e.onTextFormPointerUp?.(T),e.onSelectionSettled?.());};function me(){if(a)try{n.releasePointerCapture(a.pointerId);}catch{}a=null,s=null,S(),i?.removeEventListener("pointermove",ee),i?.removeEventListener("pointerup",te),i?.removeEventListener("pointercancel",te),i=null;}let le=()=>{s=null;};n.addEventListener("pointerdown",L);let D=[e.listeners.onWindow("scroll",le,{capture:true,passive:true}),e.listeners.onWindow("resize",le,{passive:true})];return {dragging:()=>a!==null,cancelGesture:me,destroy(){me(),n.removeEventListener("pointerdown",L);for(let T of D)T();}}}function OO(e,t,n){let r=e??chunkDBOOTED4_cjs.$a;return {view:()=>r,projection:()=>chunkDBOOTED4_cjs._a(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&chunkDBOOTED4_cjs._a(r)!=="all-markup"?chunkDBOOTED4_cjs.ab(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function MO(e){let{pagesLayer:t,session:n}=e,r=()=>t.ownerDocument,o=false,i=null,a,s;function l(){let{head:w}=e.selection();return s&&s.position.paragraphId===w.paragraphId&&s.position.offset===w.offset?s.lineId:void 0}function c(w){let S=ki(w?.anchorNode,t)??ki(w?.focusNode,t);S!==void 0&&(a=S);}function d(w){return a??ki(w?.anchorNode,t)??ki(w?.focusNode,t)}let u=false,f=false,m=false,g=null,b=false;function y(){if(e.selectionLocked?.())return false;let w=r().getSelection(),S=Oa(t,w);return !S||(c(w),At(S,e.selection()))?false:(e.adoptSelection(S),true)}function h(){let w=r().activeElement;if(w&&t.contains(w))return true;if(w&&w!==r().body&&w!==r().documentElement)return false;let S=r().getSelection();if(!S||S.rangeCount===0)return true;let F=S.anchorNode;return !F||!F.isConnected?true:t.contains(F)}let v=()=>{if(e.selectionLocked?.())return;let w=r().getSelection(),S=Oa(t,w);if(!S){if(!ph(t,w))return;u=false;let F=Ke(e.selection().head);if(At(F,e.selection()))return;e.setSelection(F);return}u=false,c(w),!At(S,e.selection())&&e.setSelection(S);};function x(w){let S=e.textOf(w),F=fC(t,w,S,r().getSelection()?.anchorNode??null);if(F===null)return;let A=pC(w,S,F);if(!A)return;let $=A.ops.find(ee=>ee.op==="deleteText"),W=A.ops.find(ee=>ee.op==="insertText"),U=W&&$?e.replacementOffset?.(w,$.start,$.end):void 0,_=W&&U!==void 0&&U!==W.offset?A.ops.map(ee=>ee===W?{...W,offset:U}:ee):A.ops,L=W?e.pendingFormatOps?.(w,U??W.offset,W.text.length,$?{start:$.start,end:$.end}:void 0)??[]:[],Z=e.storyScope();e.commit(()=>{let ee=e.applyOps([..._,...L],e.selectionMark(),Z);return L.length===0||!ee.rejected?ee:e.applyOps(_,e.selectionMark(),Z)}),e.setSelection(Ke({paragraphId:w,offset:W&&U!==void 0?U+W.text.length:A.caret}));}function k(){o||m||e.isGesturing?.()||e.holdsCellSelection?.()||R()||u&&v();}function R(){if(!f||u)return false;if(!i)return true;let w=Oa(t,r().getSelection());return w!==null&&At(w,i)}function C(w){if(!(w.type.startsWith("pointer")&&w.button!==0)){if(w.type==="selectstart"&&e.selectionLocked?.()){w.preventDefault();return}u=true;}}let P=false;function E(w=false){if(e.updateCaret(),!w&&!h())return;o=true;let S=e.now(),F=e.domSelection?.()??e.selection();u=false;let A=r().getSelection(),$=d(A),W=l(),U=QE(t,F,A,{...$!==void 0?{preferredPageIndex:$}:{},...W!==void 0?{preferredLineId:W}:{}});U&&c(A),i=U?F:null,U||(f=true),e.recordSelectionMs(e.now()-S),queueMicrotask(()=>{o=false;});}return t.addEventListener("pointerdown",C,true),t.addEventListener("selectstart",C,true),{adoptBeforePaint(){let w=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,S=f||w||!u?false:y();return e.hasPendingInput?.()!==true&&(f=false),S},noteModelMoved(){f=true,s=void 0;},noteSelectionSettled(){f=false;},mirrorToDom:E,adoptBeforeInput:k,isComposing:()=>m,noteBrowserSelectionFixup(){P=true;},onSelectionChange:()=>{if(!o&&!m&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(P&&ph(t,r().getSelection())){let w=Oa(t,r().getSelection());if((w===null||!At(w,e.selection()))&&(P=false,!u)){E();return}}R()||v();}},onCompositionStart:()=>{k(),m=true;let w=e.selection();b=w.anchor.paragraphId!==w.head.paragraphId,g=w.head.paragraphId,n.beginComposition(e.storyScope());},onCompositionEnd:w=>{m=false;let S=g??e.selection().head.paragraphId;g=null;let F=b;b=false;let A=e.storyScope(),$=n.revisionFor(A);if(F){let W=w?.data??"";W.length>0&&e.replaceSelectionWith?.(W);}else x(S);n.endComposition(),n.revisionFor(A)===$&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>a,selectionLineId:l,caretPreference(w=a){let S=l();return {...w!==void 0?{preferredPageIndex:w}:{},...S!==void 0?{preferredLineId:S}:{}}},notePointerCaret(w){s=w,w&&(a=w.pageIndex);},destroy(){t.removeEventListener("pointerdown",C,true),t.removeEventListener("selectstart",C,true),u=false;}}}var A5=32;function _h(e,t,n,r){if(!(e.kind==="textValue"||r>A5)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)_h(o,t,n,r+1);}}var AO=new WeakMap;function FO(e,t,n,r){if(e.kind==="paragraph"||e.kind==="textValue"){_h(e,t,n,0);return}let o=AO.get(e);if(!o){let i=new Map;_h(e,0,i,0),o=[...i.keys()],AO.set(e,o);}for(let i of o)n.has(i)||n.set(i,t);}function D5(e,t){let n=chunkDBOOTED4_cjs.td(e),r=chunkDBOOTED4_cjs.vc(n),o=0,i=chunkDBOOTED4_cjs.Qc(e),a=new Map;for(let s=0;s<i.length;s+=1){let l=i[s];for(let c=l.blockStart;c<l.blockEndExclusive;c+=1){let d=n[c];if(d){for(;o<r.length&&r[o]!==d;)FO(r[o],s,a),o+=1;o+=1,FO(d,s,a);}}}return a}var LO=new WeakMap;function N5(e){return !(!e.story||e.origin===chunkWO4V6PNS_cjs.g.mutationUndo||e.origin===chunkWO4V6PNS_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunkWO4V6PNS_cjs.l.section))}function H5(e,t){t.story&&t.story.kind!=="body"||N5(t)||(e.map=null);}function _5(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>H5(t,n)));}function B5(e,t){let n=LO.get(e);return n||(n={map:null,subscribed:false},LO.set(e,n)),_5(e,n),n.map||(n.map=D5(t)),n.map}function DO(e,t,n){return n.startsWith(`${t.name}#`)?B5(e,t).get(n)??null:null}var NO=32;function El(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkDBOOTED4_cjs.Qc(a,o,i);if(s.length<=1)return 0;let l=chunkDBOOTED4_cjs.Rc(a,o,i),c=f=>{let m=l.indexOf(f);if(m!==-1)return m;let g=l.findIndex(b=>b>f);return g===-1?Math.max(0,l.length-1):g},d=Bh(e,t);if(d!==null)return c(d);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let f=e.headerFooterResolutionBySection().findIndex(m=>[m.headers,m.footers].some(g=>[...g.values()].some(b=>b.rId===n.rId)));return f===-1?0:c(f)}let u=q5(e,t);if(u!==null){let f=Bh(e,u);if(f!==null)return c(f)}return 0}function HO(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkDBOOTED4_cjs.Qc(a);if(s.length<=1)return {kind:"whole-document"};let l=chunkDBOOTED4_cjs.Rc(a,o,i),c=Bh(e,t),d=El(e,t,n,r,o,i),u=l[d]??d;if(c!==null&&c===u)return {kind:"anchor",paragraphId:t};let f=s[u];if(!f)return {kind:"unaddressable"};let m=chunkDBOOTED4_cjs.td(a);for(let g=f.blockStart;g<f.blockEndExclusive;g+=1){let b=$5(m[g]);if(b!==null)return {kind:"anchor",paragraphId:b}}return {kind:"unaddressable"}}function $5(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>NO)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let i=t(o,r+1);if(i!==null)return i}return null};return t(e,0)}function Bh(e,t){return DO(e,e.part(),t)}function q5(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunkWO4V6PNS_cjs.lh(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let i of chunkWO4V6PNS_cjs.Jc(o.root)){let a=chunkWO4V6PNS_cjs.yc(i);if(a===null||!W5(i,t))continue;return chunkWO4V6PNS_cjs.mh(e.part()).find(l=>l.noteKind===r&&l.noteId===a)?.paragraphId??null}}return null}function W5(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>NO)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let i of r.children)if(n(i,o+1))return true;return false};return n(e,0)}function La(e,t){if(t===void 0)return {};let n=`${e}Autospacing`,r=`${e}Lines`;return t===null?{[e]:null,[n]:null,[r]:null}:{[e]:String(Math.round(t*20)),[n]:"0",[r]:null}}function Hu(e){return e===void 0?{}:e===null?{line:null,lineRule:null}:e.rule==="multiple"?{line:String(Math.round(e.value*240)),lineRule:"auto"}:{line:String(Math.round(e.value*20)),lineRule:e.rule==="exact"?"exact":"atLeast"}}function _O(e){return {val:e?"1":"0"}}function $O(e){let t=null,n=null,r=null,o=(a,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(a)?a:[a],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),i=(a,s,l)=>{let c=chunkWO4V6PNS_cjs.pc(a);if(!c)return e.setLastRejection("invalid note scope id"),false;let d=e.session.currentPackage(),u=chunkWO4V6PNS_cjs.lh(d,c.noteKind),f=u?chunkWO4V6PNS_cjs.Lc(u.root,c.noteId):null;if(!u||!f)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let m=e.selection();r={anchor:{paragraphId:m.anchor.paragraphId,offset:m.anchor.offset},head:{paragraphId:m.head.paragraphId,offset:m.head.offset}};}if(t={kind:"note",id:chunkWO4V6PNS_cjs.oc(c.noteKind,c.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let m=K5(f),g=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:c.noteKind})),b=m.find(y=>g.has(y.id));if(b){let y=$h(b);e.setSelection({anchor:{paragraphId:b.id,offset:y},head:{paragraphId:b.id,offset:y}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(a){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let d=BO(e.session.currentPackage(),a);if(!o({op:"insertNote",noteKind:a,paragraphId:l.paragraphId,offset:l.offset},()=>{let g={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:g,head:g}}))return s.ops.length>0&&e.undo(),false;let m=[...BO(e.session.currentPackage(),a)].find(g=>!d.has(g));return m===void 0?true:i(chunkWO4V6PNS_cjs.oc(a,m))},deleteNote(a,s){return o({op:"deleteNote",noteKind:a,noteId:s})},convertNote(a,s){return o({op:"convertNote",fromKind:a,noteId:s})},convertAllNotes(a){return o({op:"convertAllNotes",fromKind:a})},setNoteProperties(a){return o({op:"setNoteProperties",scope:a.scope,sectionIndex:a.sectionIndex,footnote:a.footnote,endnote:a.endnote})},enterNote:i,exitNote(a=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),a&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(a){!t||!Number.isInteger(a)||n!==a&&(n=a);}}}function K5(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let i of r.children)n(i,o+1);}};return n(e,0),t}function $h(e){let t=chunkWO4V6PNS_cjs.kg(e)[0];return t&&chunkWO4V6PNS_cjs.uc(t.node)?t.end:0}function BO(e,t){let n=chunkWO4V6PNS_cjs.lh(e,t),r=new Set;if(!n)return r;for(let o of chunkWO4V6PNS_cjs.Jc(n.root)){if(!chunkWO4V6PNS_cjs.Ac(o))continue;let i=chunkWO4V6PNS_cjs.yc(o);i!==null&&r.add(i);}return r}var j5=720;function qh(e,t,n=j5){return KO(e,t,e+t*n)}function WO(e,t,n){let r=t>0?Math.floor(e/n)+1:Math.ceil(e/n)-1;return KO(e,t,r*n)}function KO(e,t,n){return t>0?Math.max(e,Math.min(chunkDBOOTED4_cjs.id,n)):Math.max(0,n)}function Wh(e){let t;for(let r of e){if(r.localName!=="ind")continue;let o=r.attributes?.left??r.attributes?.start;o!==void 0&&(t=o);}let n=chunkWO4V6PNS_cjs.nd(t);return n===null||Math.abs(n)>9999999?0:n}function qO(e,t){return e.kind==="midLine"?false:e.kind==="empty"||t<=e.offset}function jO(e,t,n,r,o){let{from:i,to:a}=e;if(i.paragraphId===a.paragraphId&&i.offset===a.offset)return null;let s=t.length>1?n.start(a.paragraphId):null,c=s!==null&&qO(s,a.offset)&&!(s.kind==="empty"&&n.endsStory(a.paragraphId))?t.slice(0,-1):t;if(c.length>1)return {write:"stepLeft",paragraphs:c};if(!qO(n.start(i.paragraphId),i.offset))return null;let{resolved:d,direct:u}=n.firstLine(i.paragraphId);return r==="increase"?{write:d>=0&&d<o?"setFirstLine":"stepLeft",paragraphs:c}:{write:u&&d>0?"clearFirstLine":"stepLeft",paragraphs:c}}function V5(e,t){let n=Number.POSITIVE_INFINITY,r=false;for(let{line:o}of chunkDBOOTED4_cjs.wd(e).get(t)??[]){if(!r&&(r=true,chunkDBOOTED4_cjs.Oa(o)[0]?.paragraphId!==t))return {kind:"midLine"};let i=chunkDBOOTED4_cjs.Pa(o,t);if(i){for(let a of i.spans)a.range.end>a.range.start&&(n=Math.min(n,a.range.start));for(let a of i.drawings)n=Math.min(n,a.start);if(Number.isFinite(n))break}}return Number.isFinite(n)?{kind:"start",offset:n}:{kind:"empty"}}var U5=["firstLine","hanging","firstLineChars","hangingChars"];function VO(e,t,n){let r=new Map;return {start(o){let i=r.get(o);if(i)return i;let a=V5(e,o);if(a.kind==="start"){let s=chunkWO4V6PNS_cjs.Ta(t,o),l=s?.kind==="paragraph"?$h(s):0;l>a.offset&&(a={kind:"start",offset:l});}return r.set(o,a),a},endsStory:o=>n[n.length-1]===o,firstLine(o){let i=Ng(e,o),a=chunkWO4V6PNS_cjs.Nh(t,o).find(l=>l.localName==="ind")?.attributes,s=U5.some(l=>a?.[l]!==void 0);return {resolved:i?Jd(i.indent):0,direct:s}}}}function UO(e,t){let n=(r,o)=>r.paragraphId===o.paragraphId&&r.offset===o.offset;return (e.contentControls??[]).some(r=>{if(!r.placeholder)return false;let o=Pl(e,r);return o!==null&&n(o.from,t.from)&&n(o.to,t.to)})}var Cl="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",Da="a section break cannot be inserted inside a table cell",Bu="a section break cannot change a section that a locked or linked content control holds",Ol="a section break cannot be inserted in locked or linked content";function z5(e){let t=new Set,n=new Set,r=i=>{if(i.kind==="textValue"||!("localName"in i)||i.localName!=="sdt")return false;let a=i.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !a||a.kind==="textValue"?false:(a.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunkWO4V6PNS_cjs.la)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(c=>c.localName==="val"&&c.namespaceUri===chunkWO4V6PNS_cjs.la)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(i,a,s)=>{if(i.kind==="textValue")return;if(i.kind==="paragraph"){a&&t.add(i.id),s&&n.add(i.id);return}let l=a||i.kind==="table",c=s||r(i);for(let d of i.children??[])o(d,l,c);};return o(e.root,false,false),{inCell:t,held:n}}var G5=32;function Z5(e){let t=new Set(chunkWO4V6PNS_cjs.Yk(e).map(n=>chunkWO4V6PNS_cjs.$k(n)));return chunkWO4V6PNS_cjs.Xk(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function jh(e,t){let n=t.replaceAt??t.collapseTo;return chunkWO4V6PNS_cjs.Zk(e,n.paragraphId)?t.collapseTo:n}var Kh=(e,t)=>chunkWO4V6PNS_cjs.dg(e,t)||chunkWO4V6PNS_cjs.ag(e,t).content;function _u(e,t,n,r){if(chunkWO4V6PNS_cjs.Zk(e,t))return Da;if(Kh(e,t))return Ol;let{section:o,ownerId:i}=chunkWO4V6PNS_cjs._k(e,t);return chunkWO4V6PNS_cjs.$k(o)===n?null:i!==null&&Kh(e,i)?Bu:r?Cl:null}function zO(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return Da;if(e.caretParagraphId!==null)return _u(e.part(),e.caretParagraphId,t,n);let r=z5(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:i}=e.orderedRange(),a=e.part(),s=chunkWO4V6PNS_cjs._k(a,o.paragraphId),l=chunkWO4V6PNS_cjs._k(a,i.paragraphId),c=s.section===l.section,d=c?chunkWO4V6PNS_cjs.$k(s.section):Z5(a),u=e.paragraphOrder(),f=u.indexOf(o.paragraphId),m=u.indexOf(i.paragraphId),g=f===-1||m===-1?null:u.slice(f,m+1),b=g!==null&&!g.some(h=>r.inCell.has(h))&&!g.some(h=>r.held.has(h));if(d!==null&&d!==t){if(b&&c&&s.ownerId!==null&&Kh(a,s.ownerId))return Bu;if(n&&b)return Cl}if(b&&d!==null)return null;if(g===null||g.length-1>G5)return n&&d!==null&&d!==t?Cl:null;let y=jh(a,e.deleteSelectionPlan());return _u(a,y.paragraphId,t,n)}var X5=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function Y5(e,t){let n={...e??{}};return delete n.leftChars,delete n.startChars,e?.start!==void 0&&(n.start=t),(e?.start===void 0||e.left!==void 0)&&(n.left=t),n}function $u(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let i=String(r),a=e[n]!==void 0;return a&&(o[n]=i),(!a||e[t]!==void 0)&&(o[t]=i),o}function GO(e,t){let n={...e};return delete n.firstLineChars,delete n.hangingChars,t===null?(delete n.firstLine,delete n.hanging,n):(t>=0?(n.firstLine=String(t),n.hanging="0"):(n.hanging=String(-t),n.firstLine="0"),n)}function ZO(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:i,collapsedAt:a}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),c=(w,S,F)=>t.applyTreeOps(w,S,F,e.storyScope()),d=XP({session:t,storyPart:l}),u=()=>e.paragraphOrder(),f={get value(){return e.layout()}};function m(){let w=e.selectedCells?.();return w&&w.length>0?w:null}function g(w){let S=false;return n(()=>{let F=w();return S=F.committed,F},void 0,{keepCellSelection:m()!==null}),S}function b(w=o()){if(m()!==null)return [...chunk5JPIEN54_cjs.la(f.value,m())];let{from:S,to:F}=w,A=u(),$=A.indexOf(S.paragraphId),W=A.indexOf(F.paragraphId);return $===-1||W===-1?null:A.slice($,W+1)}let y=8;function h(w){return v(w)?.level??null}function v(w){return chunkDBOOTED4_cjs.Sa(f.value,w)}function x(w){let S=v(w);return S?S.numFmt==="bullet"?"bullet":"ordered":null}function k(w,S){let F=u(),A=F.indexOf(w[0]??""),$=F.indexOf(w[w.length-1]??"");if(A===-1||$===-1)return null;for(let W of [A-1,$+1]){let U=F[W];if(!U)continue;let _=v(U);if(_&&(_.numFmt==="bullet"?"bullet":"ordered")===S)return _.numId}return null}function R(w,S){return S<0||S>y?false:e.numberingLevelExists(w.numId,S)}function C(w,S){return S<0||S>y?false:e.numberingLevelExists(w.numId,S)?true:t.ensureNumberingLevel(w.numId,S,w.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(w.numId,S)}function P(w,S,F){let A=S==="increase"?1:-1,$=[];for(let W of w){let U=Sr(f.value,W),_=v(W),L=_?.level??null;if(_&&L!==null){let le=L+A;if(le<0||le>y||!C(_,le))continue;$.push({op:"setListLevel",paragraphId:W,level:le});continue}let Z=Wh(U),ee=F===void 0?qh(Z,A):WO(Z,A,F);if(ee===Z)continue;let te=chunkWO4V6PNS_cjs.Nh(l(),W),me=te.find(le=>le.localName==="ind");$.push({op:"setParagraphProperties",paragraphId:W,properties:chunkWO4V6PNS_cjs.Ph(te,{localName:"ind",attributes:Y5(me?.attributes,String(ee))})});}return $.length===0?false:g(()=>c($,i()))}function E(w,S){let F=[];for(let A of w){let $=chunkWO4V6PNS_cjs.Nh(l(),A),U={...$.find(_=>_.localName==="ind")?.attributes??{}};S.left!==void 0&&(U=$u(U,"left","start",S.left)),S.right!==void 0&&(U=$u(U,"right","end",S.right)),S.firstLine!==void 0&&(U=GO(U,S.firstLine)),F.push({op:"setParagraphProperties",paragraphId:A,properties:chunkWO4V6PNS_cjs.Ph($,{localName:"ind",...Object.keys(U).length>0?{attributes:U}:{}})});}return F.length===0?false:g(()=>c(F,i()))}return {insertTab(){let w=s(),S=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertTab",paragraphId:S.paragraphId,offset:S.offset}],i()),()=>a({...S,offset:S.offset+1}));},insertLineBreak(){let w=s(),S=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertHardBreak",paragraphId:S.paragraphId,offset:S.offset}],i()),()=>a({...S,offset:S.offset+1}));},insertPageBreak(){let w=s(),S=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertPageBreak",paragraphId:S.paragraphId,offset:S.offset}],i()),()=>a({...S,offset:S.offset+1}));},exitListOnEmptyItem(){let{from:w,to:S}=o();if(w.paragraphId!==S.paragraphId||w.offset!==S.offset)return false;let F=v(w.paragraphId);if(!F||e.paragraphTextOf(w.paragraphId).length>0)return false;let $=F.level>0&&R(F,F.level-1),W=[];if($)W.push({op:"setListLevel",paragraphId:w.paragraphId,level:F.level-1});else {let _=d.clearOp(w.paragraphId);_&&W.push(_),W.push({op:"setListNumbering",paragraphId:w.paragraphId,numId:null});}let U=false;return n(()=>{let _=c(W,i());return U=_.committed,_}),U},isListParagraph(){let{paragraphId:w}=r();return h(w)!==null},isListActive(w){let S=b();if(S===null)return false;let F=w==="bullet"?"bullet":"ordered";return S.length>0&&S.every(A=>x(A)===F)},toggleList(w){let S=b();if(S===null||S.length===0)return false;let F=S.every(W=>x(W)===w),A=F?null:k(S,w)??t.ensureListDefinition(w);if(!F&&A===null)return false;let $=F?[]:d.applyOps(S);for(let W of S){let U=h(W);$.push({op:"setListNumbering",paragraphId:W,numId:A,...U!==null?{level:U}:{}});}return g(()=>c($,i()))},canAdjustIndent(w){let S=b();if(S===null)return false;let F=w==="increase"?1:-1;return S.some(A=>{let $=v(A);if($){let U=$.level+F;return U>=0&&U<=y}let W=Wh(Sr(f.value,A));return qh(W,F)!==W})},adjustIndent(w){let S=b();return S!==null&&P(S,w)},setIndent(w){if(w.left===void 0&&w.right===void 0&&w.firstLine===void 0)return false;let S=b();return S!==null&&E(S,w)},indentWithTab(w){let S=o();if(S.from.paragraphId===S.to.paragraphId&&S.from.offset===S.to.offset&&m()===null||UO(f.value,S))return false;let A=b(S);if(A===null)return false;let $=Math.round(chunkDBOOTED4_cjs.Bb(t.settingsRoot())*20),W=VO(f.value,l(),u()),U=m()===null?jO(S,A,W,w,$):{write:"stepLeft",paragraphs:A};return U===null?false:(U.write==="stepLeft"?P(U.paragraphs,w,$):E(U.paragraphs,{firstLine:U.write==="setFirstLine"?$:null}),true)},setParagraphFormat(w){let S=b();if(S===null||S.length===0)return false;let F=[];w.direction!==void 0&&F.push({localName:"bidi",paragraphDirection:w.direction}),w.alignment!==void 0&&F.push({localName:"jc",attributes:{val:w.alignment},physicalAlignment:true});let A={...La("before",w.spaceBeforePt),...La("after",w.spaceAfterPt),...Hu(w.lineSpacing)};Object.keys(A).length>0&&F.push({localName:"spacing",attributes:A,mergeAttributes:true});for(let[_,L]of X5){let Z=w[_];Z!==void 0&&F.push({localName:L,attributes:_O(Z)});}let $=w.tabStops!==void 0,W=w.indentLeftTwips!==void 0||w.indentRightTwips!==void 0||w.indentFirstLineTwips!==void 0;if(F.length===0&&!W&&!$)return false;let U=[];for(let _ of S){let L=chunkWO4V6PNS_cjs.Nh(l(),_),Z=L;if(W){let D={...L.find(T=>T.localName==="ind")?.attributes??{}};w.indentLeftTwips!==void 0&&(D=$u(D,"left","start",w.indentLeftTwips)),w.indentRightTwips!==void 0&&(D=$u(D,"right","end",w.indentRightTwips)),w.indentFirstLineTwips!==void 0&&(D=GO(D,w.indentFirstLineTwips)),Z=chunkWO4V6PNS_cjs.Ph(Z,{localName:"ind",...Object.keys(D).length>0?{attributes:D}:{}});}let ee=Sr(f.value,_),te=L,me=false;for(let le of F){let D=Du(le,ee,Z,te);if(!D)continue;if(me=true,D.remove){Z=Z.filter(q=>q.localName!==D.localName);continue}let T=D.mergeAttributes?{...Z.find(q=>q.localName===D.localName)?.attributes??{},...D.attributes}:D.attributes??{},B=Object.fromEntries(Object.entries(T).filter(([,q])=>q!=null));Z=chunkWO4V6PNS_cjs.Ph(Z,{localName:D.localName,...Object.keys(B).length>0?{attributes:B}:{}});}if((me||W)&&U.push({op:"setParagraphProperties",paragraphId:_,properties:Z}),$){let le=fl(e.layout(),_);U.push({op:"setParagraphTabStops",paragraphId:_,stops:w.tabStops.map(D=>({positionTwips:Math.round(D.positionTwips),alignment:D.alignment,...D.leader&&D.leader!=="none"?{leader:D.leader}:{}})),...le?{inForcePositionsTwips:le.stops.map(D=>Math.round(D.positionPt*20))}:{}});}}return U.length===0?false:g(()=>c(U,i()))},sectionProperties:()=>chunkDBOOTED4_cjs.Pc(t.part()),sectionPropertiesAt(w){let S=chunkDBOOTED4_cjs.Qc(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),F=El(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (S[F]??S[S.length-1]).properties},sectionAnchorParagraphAt(w){return HO(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(w){let S=false;return n(()=>{let F=e.storyScope().kind==="body",A=t.applyTreeOps([{op:"setSectionProperties",...w}],F?i():void 0,void 0,{kind:"body"});return S=A.committed,A}),S},sectionBreakRefusal(w="nextPage"){return e.storyScope().kind!=="body"?null:zO({part:()=>t.part(),breakType:w,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:u,deleteSelectionPlan:s})},insertSectionBreak(w="nextPage"){if(e.storyScope().kind!=="body")return false;let S=s(),F=jh(t.part(),S),A=(chunkWO4V6PNS_cjs.Zk(t.part(),F.paragraphId)?Da:null)??_u(t.part(),F.paragraphId,w,e.editingMode?.()==="suggest");if(A!==null)return e.publishRefusal?.(A),false;let $=new Set(t.paragraphIds()),W=false,U=false;return n(()=>{let _=t.applyTreeOps([...S.ops,{op:"splitParagraph",paragraphId:F.paragraphId,offset:F.offset},{op:"setSectionMark",paragraphId:F.paragraphId,breakType:w}],i(),void 0,{kind:"body"});return W=_.committed,U=_.reason==="locked"||_.reason==="bound",_},()=>{let _=t.paragraphIds().find(L=>!$.has(L));return _?a({paragraphId:_,offset:0}):null}),!W&&U&&e.publishRefusal?.(Ol),W}}}var eM="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function tM(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===eM}function Q5(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===eM}function Vh(e){return e.kind==="textValue"?[]:e.children}function nM(e,t=0){if(e.kind==="textValue")return e.value;if(t>=chunkWO4V6PNS_cjs.wa||e.kind==="deletedText"||J5(e.kind)||chunkWO4V6PNS_cjs.wf(e)||e.kind==="runProperties")return "";let n=chunkWO4V6PNS_cjs.fb(e);if(n!==null)return n;if(e.kind==="generic"&&!chunkWO4V6PNS_cjs.ya(e)&&!tM(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkWO4V6PNS_cjs.pb(e);let r=chunkWO4V6PNS_cjs.xa(e,t),o="";for(let i of e.children)o+=nM(i,r);return o}function J5(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function Uh(e,t,n){if(!(t>=chunkWO4V6PNS_cjs.wa))for(let r of e){if(r.kind==="hyperlink"){chunkWO4V6PNS_cjs.xa(r,t)<chunkWO4V6PNS_cjs.wa&&n(r,t);continue}if(chunkWO4V6PNS_cjs.ya(r)){Uh(Vh(r),chunkWO4V6PNS_cjs.xa(r,t),n);continue}if(tM(r)){for(let o of Vh(r))Q5(o)&&Uh(Vh(o),chunkWO4V6PNS_cjs.xa(r,t),n);continue}n(r,t);}}function XO(e,t,n){let r=eB(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunkWO4V6PNS_cjs.mg(r),i=[],a=0;return Uh(r.children,0,(s,l)=>{let c=o.spanOf(s);if(c&&(a=Math.max(a,c.end)),s.kind!=="hyperlink")return;let d=c?c.start:a,u=c?c.end:a,f=chunkWO4V6PNS_cjs.Dd(s,n);i.push({id:s.id,paragraphId:t,start:d,end:u,text:chunkWO4V6PNS_cjs.jb(nM(s,l)),kind:f.kind,href:f.href,authored:f.authored,...f.anchor!==void 0?{anchor:f.anchor}:{},...f.tooltip!==void 0?{tooltip:f.tooltip}:{}});}),i}function eB(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let i=n(o);if(i)return i}return null};return n(e.root)}function tB(e,t){for(let n of e)if(n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)return n;return null}function nB(e,t){for(let n of chunkDBOOTED4_cjs.Ia(e,t.paragraphId))for(let r of n.lines)for(let o of r.spans)if(!(!o.fieldAtom||!o.link)&&t.offset>=o.range.start&&t.offset<=o.range.end)return o.link.id;return null}function rM(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=c=>e.session.relationshipTarget(c,t()),o=(c,d,u)=>e.session.applyTreeOps(c,d,u,t()),i=c=>{let d=n();return d?XO(d,c,r):[]},a=()=>tB(i(e.selection().head.paragraphId),e.selection().head),s=()=>{let c=e.selection().head,d=nB(e.layout(),c);return d===null?null:e.fieldLinkById(d)},l=c=>{let d=e.selection().head.paragraphId,u=i(d).find(f=>f.id===c);if(u)return u;for(let f of e.session.storyParts()){let m=g=>chunkWO4V6PNS_cjs.Qg(e.session.currentPackage(),f.name,g);for(let g of chunkWO4V6PNS_cjs.Oc(f))for(let b of chunkWO4V6PNS_cjs.Rc(g.root)){let y=b.id,h=XO(f,y,m).find(v=>v.id===c);if(h)return h}}return null};return {linksInCaretParagraph:()=>i(e.selection().head.paragraphId),linkAtCaret:a,fieldLinkAtCaret:s,linkById:l,applyHyperlink(c){let d=c.text===void 0?c:{...c,text:chunkWO4V6PNS_cjs.kb(c.text)},u=d.url!==void 0&&d.url.length>0,f=d.anchor!==void 0&&d.anchor.length>0;if(u===f)return false;let m=t();if(!n()||e.refusesWrite())return false;let g;if(u){let S=()=>e.session.ensureHyperlinkRelationship(d.url,m),F=e.withMintActor?e.withMintActor(S):S();if(!F)return false;g=F;}let b={...g!==void 0?{relationshipId:g}:{},...f?{anchor:d.anchor}:{},...d.tooltip!==void 0?{tooltip:d.tooltip}:{}},y=a(),h=e.orderedRange(),v=h.from.paragraphId===h.to.paragraphId&&h.from.offset===h.to.offset;if(y&&(v||rB(y,h))){let S=[];if(d.text!==void 0&&d.text!==chunkWO4V6PNS_cjs.kb(y.text)){if(d.text.length===0)return false;let A=e.replacementLanding?.(y.paragraphId,y.start,y.end),$=e.textOf(y.paragraphId).slice(y.start,y.start+2),W=y.start+($.length===2&&$.charCodeAt(0)>=55296&&$.charCodeAt(0)<=56319&&$.charCodeAt(1)>=56320&&$.charCodeAt(1)<=57343?2:1);if(A!=null&&A>y.start&&W<y.end)S.push({op:"setHyperlinkTarget",linkId:y.id,...b},{op:"deleteText",paragraphId:y.paragraphId,start:y.start,end:y.end},{op:"insertText",paragraphId:y.paragraphId,offset:W,text:d.text});else if(A!=null){let U=YO(e.session);S.push({op:"setHyperlinkTarget",linkId:y.id,...b},...QO(y,A,d.text),{op:"insertHyperlink",paragraphId:y.paragraphId,start:A,end:A+d.text.length,...b,...U?{styleId:U}:{}});}else {let U=JO(y.paragraphId,y.start,y.end,d.text);if(!U)return false;S.push({op:"setHyperlinkTarget",linkId:y.id,...b},...U);}}else S.push({op:"setHyperlinkTarget",linkId:y.id,...b});let F=false;return e.commit(()=>{let A=o(S,e.selectionMark());return F=A.committed,A},()=>null),F}let x=h.from.paragraphId;if(h.to.paragraphId!==x)return false;let k=[],R=h.from.offset,C=h.to.offset;if(v){let S=d.text??d.url??d.anchor??"";if(S.length===0)return false;R=e.insertionLanding?.(x,R)??R,k.push({op:"insertText",paragraphId:x,offset:R,text:S}),C=R+S.length;}else {let S=e.replacementLanding?.(x,R,C);if(S!=null){let F=d.text??e.textOf(x).slice(R,C);if(F.length===0)return false;k.push(...QO({paragraphId:x,start:R,end:C},S,F)),R=S,C=S+F.length;}else if(d.text!==void 0&&d.text!==e.textOf(x).slice(R,C)){let F=JO(x,R,C,d.text);if(!F)return false;k.push(...F),C=R+d.text.length;}}if(C<=R)return false;let P=YO(e.session);k.push({op:"insertHyperlink",paragraphId:x,start:R,end:C,...b,...P?{styleId:P}:{}});let E=false,w={paragraphId:x,offset:C};return e.commit(()=>{let S=o(k,e.selectionMark(),{paragraphId:x,start:C,end:C});return E=S.committed,S},()=>({anchor:w,head:w})),E},removeHyperlink(c){if(!n())return false;let d=c?l(c):a();if(!d)return false;let u=false,f={paragraphId:d.paragraphId,offset:d.end};return e.commit(()=>{let m=o([{op:"removeHyperlink",linkId:d.id}],e.selectionMark());return u=m.committed,m},()=>({anchor:f,head:f})),u}}}function YO(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function rB(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function QO(e,t,n){return [{op:"deleteText",paragraphId:e.paragraphId,start:e.start,end:e.end},{op:"insertText",paragraphId:e.paragraphId,offset:t,text:n}]}function JO(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}function oB(e,t,n){if(!t)return 0;let r=t.scrollTop;return e.pages.find(i=>(i.box.y+i.box.height)*n>r)?.index??0}var iB=24;function aB(e,t,n){if(!n)return Math.max(0,t-iB);let r=e.clientHeight,o=e.scrollTop;return t>=o+r*.2&&t<=o+r*.8?o:Math.max(0,t-r/2)}function oM(e){let{pagesLayer:t}=e;function n(){return e.container.closest(".docx-editor__scroll-container")}let r=u=>{if(!u||u.length===0||u.startsWith("#"))return false;let f=chunkWO4V6PNS_cjs.Q(u);if(!f.ok||!f.href)return false;let m=t.ownerDocument.defaultView;return m?(m.open(f.href,"_blank","noopener,noreferrer"),true):false},o=(u,f)=>{let m=!e.enterStoryFor||e.enterStoryFor(u.paragraphId);if(!m&&!f?.orShow)return false;let g=e.layout(),b=n(),y=chunkDBOOTED4_cjs.qe(g,u,m?void 0:{preferredPageIndex:oB(g,b,e.scale())});if(!y)return false;let h=g.pages[y.pageIndex];if(!h)return false;let v=ol(h,u.paragraphId).y+y.y;return b&&(b.scrollTop=aB(b,v*e.scale(),f?.center===true),e.onScrolled?.()),m?(e.setSelection(u),true):"shown"},i=u=>{let f=e.bookmarks().get(u);return f?o(f)===true:false},a=null;function s(u){if(!u||u.closest("[data-docx-hf]"))return null;let f=u.closest("a.docx-hyperlink");if(f){let g=f.dataset.docxLink;return g?{linkId:g,drawing:false}:null}let m=u.closest("[data-docx-drawing-link]");if(m){let g=m.dataset.docxDrawingLink;return g?{linkId:g,drawing:true}:null}return null}let l=u=>{a=null;let f=u.target,m=s(f);if(!m)return;let b=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();a={linkId:m.linkId,drawing:m.drawing,rect:{left:b.left,top:b.top,bottom:b.bottom,right:b.right}};},c=u=>{let f=u.target,m=s(f);if(!m){let y=a;if(a=null,!y)return;u.preventDefault(),d(y.linkId,y.rect,u,y.drawing);return}a=null,u.preventDefault();let b=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();d(m.linkId,{left:b.left,top:b.top,bottom:b.bottom,right:b.right},u,m.drawing);};function d(u,f,m,g){let b=g?e.drawingLinkById?.(u)??null:e.linkById(u);if(!b)return;if(m.metaKey||m.ctrlKey){b.kind==="external"?r(b.href):b.anchor&&i(b.anchor);return}if(e.isCollapsedSelection()){if(b.kind==="internal"){b.anchor&&i(b.anchor);return}e.onPopover?.({link:b,rect:f});}}return t.addEventListener("pointerdown",l,true),t.addEventListener("click",c),{goToPosition:o,goToBookmark:i,openExternal:r,destroy(){t.removeEventListener("pointerdown",l,true),t.removeEventListener("click",c);}}}function sB(e){let t=e.hyperlinkHref;if(!t)return null;let n=e.kind==="anchoredDrawing"?e.anchorParagraphId:e.paragraphId,r=e.kind==="inlineDrawing"?e.start:0,o=t.startsWith("#")?"internal":"external";return Object.freeze({id:e.drawingNodeId,paragraphId:n,start:r,end:r+1,text:"",kind:o,href:t,authored:t,...o==="internal"?{anchor:t.slice(1)}:{}})}function zh(e,t){return e.drawingNodeId!==t?null:sB(e)}function iM(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=zh(n,t);if(r)return r}return null}function lB(e,t){for(let r of e.anchoredDrawings??[]){let o=zh(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let i of r.rows)for(let a of i.cells)for(let s of a.blocks){let l=sM(s,t);if(l)return l}continue}let o=aM(r,t);if(o)return o}let n=iM(e.header,t);return n||iM(e.footer,t)}function aM(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=zh(r,t);if(o)return o}return null}function sM(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let i=sM(o,t);if(i)return i}return null}return aM(e,t)}function lM(e,t){for(let n of e.pages){let r=lB(n,t);if(r)return r}return null}var qu=24;function cM(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let i=n?"none":o;if(e.storyScopeOpen())return;let a=e.selection();if(!(a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset)&&i!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(!(l===e.pagesLayer||!!l&&e.pagesLayer.contains(l))&&i!=="none")return;let d=e.preferredPageIndex(),u=e.preferredLineId?.(),f=e.layout(),m=chunkDBOOTED4_cjs.qe(f,a.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{},...u!==void 0?{preferredLineId:u}:{}});if(!m)return;let g=t!==null&&t!==m.pageIndex;if(t=m.pageIndex,i==="none"||!r&&!g)return;let b=f.pages[m.pageIndex],y=e.scroller();if(!b||!y||y.clientHeight<=0)return;let h=e.scale(),v=b.contentBox.y-b.box.y,x=(b.box.y+v+m.y)*h+e.container.offsetTop,k=x+m.height*h,R=y.scrollTop,C=R+y.clientHeight,P=R;if(x<R+qu)P=x-qu;else if(k>C-qu)P=k+qu-y.clientHeight;else return;let E=Math.max(0,y.scrollHeight-y.clientHeight),w=Math.max(0,Math.min(P,E));Math.abs(w-y.scrollTop)<.5||(y.scrollTop=w,e.scheduleRematerialize());}}}function dM(e){return (t,n,r,o)=>{if(e.settle(),/[\r\n\v\f\u2028\u2029]/.test(o))return e.refuse("replacement requires text without a paragraph mark");if(!e.storyParagraphs().includes(t))return e.refuse("that text is not in the story being edited");let i=e.textOf(t);if(n<0||r<n||r>i.length)return e.refuse("that range is outside the paragraph");let a={paragraphId:t,offset:n},s=r>n?e.rangePlan({anchor:a,head:{paragraphId:t,offset:r}}):{ops:[],replaceAt:e.insertionPoint(a)},l=[...s.ops],{paragraphId:c,offset:d}=s.replaceAt;if(o.length>0&&l.push({op:"insertText",paragraphId:c,offset:d,text:o}),l.length===0)return true;let u=e.selection();return e.commitWithoutFollow(l,e.selectionMark()??void 0,()=>{e.flushLayout();let f=e.textOf(t),m=Il(u,t,i,f);return e.selectionsEqual(m,u)?null:(e.noteModelMoved(),m)})}}function uM(e,t){let n=[],r=a=>{for(let s of a){if(s.kind==="paragraph"){n.push({id:s.id,length:chunkWO4V6PNS_cjs.mg(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let a=n[0],s=n[n.length-1];return {anchor:{paragraphId:a.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,i=a=>{for(let s of a){if(s.kind==="paragraph"){let l=chunkWO4V6PNS_cjs.mg(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&i(s.children))return true}return false};return i(t.searchRoots()),o}function fM(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlContent"||t.localName==="sdtContent"))return t.children;return []}function pM(e){return {applyHeaderFooterLifecycle(t){let n=null;return e.commit(()=>{let r=e.applyOps([t]);return r.rejected&&(n=String(r.reason??"rejected")),r}),n?{ok:false,reason:n}:{ok:true}},insertPageField(t){if(!e.isHeaderFooterOpen())return false;let n=e.deleteSelectionPlan(),r=n.replaceAt??n.collapseTo;return e.commit(()=>e.applyOps([...n.ops,{op:"insertPageField",paragraphId:r.paragraphId,offset:r.offset,field:t}],e.selectionMark()),()=>e.collapsedAt({paragraphId:r.paragraphId,offset:r.offset+(t==="PAGE_X_OF_Y"?6:1)})),e.lastRejection()===null}}}var Ml="the document is open for viewing",Gh="image changes are not supported in suggesting mode",mM="tracked changes need a non-empty author";function gM(e){function t(){return {committed:false,rejected:true,opCount:0,reason:Ml}}function n(){return {committed:false,rejected:true,opCount:0,reason:Gh}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),i={committed:false,rejected:true,opCount:0};return e.commit(()=>(i=e.applyOps(r,o,o),i)),i},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Ml};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:Gh};let o={ok:false,reason:"invalidArgs"};return e.commit(()=>(o=e.session.applyImageProperties(e.storyScope(),r),{committed:o.ok,rejected:!o.ok,opCount:o.ok?1:0,...o.ok?{}:{reason:o.detail??o.reason}})),o},deleteImage(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Ml};let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return {ok:false,reason:"invalidArgs",detail:mM};let a={ok:false,reason:"invalidArgs"};return e.commit(()=>(a=o?e.session.deleteImageTracked(e.storyScope(),r,{author:i,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:a.ok,rejected:!a.ok,opCount:a.ok?1:0,...a.ok?{}:{reason:a.detail??a.reason}})),a},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Ml});let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:mM});let a=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:i,date:e.trackedDate()}}:{},...a?{actorId:a}:{}})},replaceImage(r,o,i,a){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Ml});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Gh});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,i,e.decodePort(),{...a,commitGuard:()=>e.editingMode()==="edit"&&a.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function hM(e){let t=null,n=null,r="",o=()=>{let c=e.session.part(),d=e.revisionDisplayMode(),u=e.revisionAuthorFilter();return {sections:chunkDBOOTED4_cjs.Qc(c,d,u),sourceIndexes:chunkDBOOTED4_cjs.Rc(c,d,u)}},i=c=>{let{sourceIndexes:d}=o(),u=d.indexOf(c);if(u!==-1)return u;let f=d.findIndex(m=>m>c);return f===-1?Math.max(0,d.length-1):f},a=()=>{if(!t)return;let c=Nk(e.layout(),t,e.materializedPages?.());c!==t.pageIndex&&(t={...t,pageIndex:c,sectionIndex:e.sectionAtPage(c).sectionIndex});},s=c=>{if(e.entryRefused?.()===true&&t?.scope.rId!==c.rId||!c.rId||e.session.partFor({kind:"headerFooter",rId:c.rId})===null)return false;t?.scope.rId!==c.rId&&e.leaveOtherStories?.();let d=e.layout(),u=Fk(d,c.rId),f=t,m=f?.scope.rId===c.rId,g=u?null:cB(e.session,c.rId);if(!u&&!g)return false;let b=c.pageIndex??(m&&f?f.pageIndex:u?.pageIndex??0),y=c.kind??(m&&f?f.kind:u?.kind??g.kind),h=c.variant??(m&&f?f.variant:u?.story.variant??g.variant),v=m&&f?f.partName:u?.story.partName??g.partName,x=d.pages[b]??d.pages[u?.pageIndex??0],k=(x?da(x,{scope:{kind:"headerFooter",rId:c.rId},kind:y,partName:v}):null)??u?.story??{scope:{rId:c.rId},variant:h,partName:v},R=e.selection(),C=f?f.savedBodySelection:{anchor:{...R.anchor},head:{...R.head}},P=m&&f?.sectionIndex!==void 0&&b===f.pageIndex,E=c.sectionIndex??(P?f.sectionIndex:u?e.sectionAtPage(b).sectionIndex:g?i(g.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:c.rId},pageIndex:b,...E!==void 0?{sectionIndex:E}:{},kind:y,variant:k.variant,partName:k.partName,savedBodySelection:C};let S=e.session.paragraphIdsIn(xd(t))[0];if(!S)return t=null,false;let F=c.position?kd(d,{anchor:c.position,head:c.position},t):m?kd(d,R,t):{anchor:{paragraphId:S,offset:0},head:{paragraphId:S,offset:0}};return e.setScopeSelection(F),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let c=t.savedBodySelection;t=null,e.setScopeSelection(kd(e.layout(),c,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>Ak(t),setActiveScope(c){return c.kind==="body"?(l(),true):c.kind==="headerFooter"?s({rId:c.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:a,headerFooterState(){if(!t)return null;let c=e.session.headerFooterResolutionBySection(),d=t.sectionIndex??0,u=o(),f,m,g,b=x=>{let k=u.sourceIndexes[x]??x,R=c[k];if(!R)return false;let P=(t.kind==="header"?R.headers:R.footers).get(t.variant);return !P||P.rId!==t.scope.rId?false:(d=x,f=P.inherited,m=R.titlePage,g=R.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&b(t.sectionIndex))){let x;c.forEach((k,R)=>{let P=(t.kind==="header"?k.headers:k.footers).get(t.variant);!P||P.rId!==t.scope.rId||!(x===void 0||x&&!P.inherited||x===P.inherited&&i(R)<d)||(d=i(R),f=P.inherited,m=k.titlePage,g=k.evenAndOddHeaders,x=P.inherited);});}let y=u.sections[d]?.properties??u.sections.at(-1)?.properties,h=y?.margins.headerTwips,v=y?.margins.footerTwips;return {editing:t.kind,sectionIndex:d,variant:t.variant,rId:t.scope.rId,partName:t.partName,...f!==void 0?{inherited:f}:{},...m!==void 0?{titlePage:m}:{},...g!==void 0?{evenAndOddHeaders:g}:{},...h!==void 0?{headerDistanceTwips:h}:{},...v!==void 0?{footerDistanceTwips:v}:{}}},headerFooterStateStable(c){if(!t)return n=null,r="",null;let d=this.headerFooterState();if(!d)return null;let u=[c,d.editing,d.sectionIndex,d.variant??"",d.rId??"",d.partName??"",String(d.inherited),String(d.titlePage),String(d.evenAndOddHeaders),String(d.headerDistanceTwips??""),String(d.footerDistanceTwips??"")].join("|");return n&&r===u||(n=Object.freeze({...d}),r=u),n}}}function yM(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function cB(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of ["header","footer"]){let a=i==="header"?o.headers:o.footers;for(let[s,l]of a)if(l.rId===t)return {sectionIndex:r,kind:i,variant:s,partName:l.partName}}}return null}function bM(e,t,n){let{sectionIndex:r,sectionStart:o}=e.sectionAtPage(n),i=f=>f[Math.min(r,Math.max(0,f.length-1))],a=f=>{let m=i(f);return t==="header"?m?.headers:m?.footers},s=e.session.headerFooterResolutionBySection(),l=i(s),c=e.layout.pages[n]?.pageFieldSource?.pageNumber??n+1,d=l?.evenAndOddHeaders&&c%2===0?"even":l?.titlePage&&n===o?"first":"default",u=a(s)?.get(d)?.rId;if(!u){if(!e.create({op:"createHeaderFooter",sectionIndex:r,kind:t,variant:d,...d==="first"?{titlePage:true}:{},...d==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;u=a(e.session.headerFooterResolutionBySection())?.get(d)?.rId,e.flushLayout();}u&&e.enter({rId:u,pageIndex:n,sectionIndex:r,kind:t,variant:d});}var dB=500;function uB(e,t,n,r){let o=e.part(),i=chunkDBOOTED4_cjs.td(o,n,r),a=chunkDBOOTED4_cjs.Nc(o);return t.map((s,l)=>{let c=s.blockStart<s.blockEndExclusive?i[s.blockEndExclusive-1]:void 0,d=c?.kind==="paragraph"?chunkDBOOTED4_cjs.Oc(c):void 0;return d||(l===t.length-1&&a?.kind!=="textValue"?a:void 0)})}function vM(e,t){if(!e)return null;let n=e.session,r=chunkDBOOTED4_cjs._a(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,i=El(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:Bt(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),a=n.currentPackage(),s=chunkWO4V6PNS_cjs.ah(a),l=chunkWO4V6PNS_cjs.bh(s),c=chunkWO4V6PNS_cjs.ch(s),d=chunkDBOOTED4_cjs.Qc(n.part(),r,t),u=uB(n,d,r,t),f=chunkWO4V6PNS_cjs._g(u[i]),m=chunkWO4V6PNS_cjs.$g(u[i]),g=chunkWO4V6PNS_cjs.dh(f,l),b=chunkWO4V6PNS_cjs.eh(m,c);return {sectionIndex:i,footnote:{resolved:g,...l?{documentAuthored:l}:{},...f?{sectionAuthored:f}:{}},endnote:{resolved:b,...c?{documentAuthored:c}:{},...m?{sectionAuthored:m}:{}}}}function xM(e,t){let n=chunkWO4V6PNS_cjs.pc(t);if(!n)return null;let r=chunkWO4V6PNS_cjs.lh(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,i=chunkWO4V6PNS_cjs.Lc(o.root,n.noteId);if(!i)return null;let a=[],s=dB,l=(d,u)=>{if(!(u>32||s<=0)){if(d.kind==="paragraph"&&typeof d.id=="string"){let f=(chunkWO4V6PNS_cjs.hj(o,d.id)??"").replace(/\uFFFC/g,"").trim();if(f){let m=f.slice(0,s);a.push(m),s-=m.length;}return}if(d.kind!=="textValue")for(let f of d.children)l(f,u+1);}};l(i,0);let c=a.filter(Boolean).join(" ").trim();return c.length>0?c:null}function wM(e){return [()=>{chunkWO4V6PNS_cjs.zb(e().root);},()=>{chunkWO4V6PNS_cjs.Aj(e());},()=>{chunkWO4V6PNS_cjs.rk(e());}]}var fB=50,pB=16;function SM(e){let t=e.schedule??((s,l)=>{let c=globalThis.setTimeout(s,l);return ()=>globalThis.clearTimeout(c)}),n=false,r=null,o=0,i=0,a=s=>{r=t(()=>{if(r=null,!(n||i>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>fB)return;a(pB);return}try{e.steps[i]();}catch{return}i+=1,i<e.steps.length&&a(0);}},s);};return a(0),()=>{n=true,r&&r(),r=null;}}var ro=null;function Na(e,t,n){let r=ro;ro=t===void 0?null:{owner:e,group:t};try{return n()}finally{ro=r;}}function Zh(e){if(ro===null||ro.owner!==e)return;let{group:t}=ro;return ro=null,t}function mB(e,t){ro===null&&(ro={owner:e,group:t});}var Wu=class{current;get value(){return this.current}around(t,n,r,o=true){let i=this.current,a=Zh(t);this.current=a??(o?Symbol("command"):void 0);let s;try{s=n();}finally{this.current=i;}return a!==void 0&&!r(s)&&mB(t,a),s}};function kM(e,t){let n=t.indexOf("#"),r=n>0?t.slice(0,n):e.mainDocumentPart,o=e.parts.get(r);return o?chunkWO4V6PNS_cjs.Ta(o,t):null}function IM(e){let{anchor:t,head:n}=e;return t.paragraphId!==n.paragraphId||t.offset!==n.offset?null:`${n.paragraphId}\0${n.offset}`}var gB=1e3,hB=2e3,Ku=class{constructor(t,n=()=>performance.now()){this.currentPackage=t;this.now=n;}currentPackage;now;group;expected=null;startedAt=0;lastTypedAt=0;paragraphId=null;landedNode=null;groupAt(t){let n=this.now();return (this.group===void 0||IM(t)!==this.expected||n-this.lastTypedAt>=gB||n-this.startedAt>=hB||n<this.lastTypedAt)&&(this.group=Symbol("typing"),this.startedAt=n),this.lastTypedAt=n,this.group}landed(t){this.expected=IM(t),this.paragraphId=this.expected===null?null:t.head.paragraphId;let n=this.paragraphId;this.landedNode=n===null?null:kM(this.currentPackage(),n),this.expected===null&&(this.group=void 0);}noteForeignChange(t){let n=this.paragraphId;if(n===null||t.origin===chunkWO4V6PNS_cjs.g.projection||t.origin===chunkWO4V6PNS_cjs.g.awareness)return;if(t.dirty.includes(n)||t.deleted.includes(n))return this.end();if(t.dirty.length>0||t.deleted.length>0)return;let r=this.landedNode,o=kM(this.currentPackage(),n);r!==o&&(r===null||o===null||!chunkWO4V6PNS_cjs.Da(r,o))&&this.end();}end(){this.group=void 0,this.expected=null,this.paragraphId=null,this.landedNode=null;}};function Xh(e){return e.bound?"bound":e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function RM(e){return e.effectiveLock==="sdtLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function PM(e,t){for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr")){if(n.children.some(r=>r.kind!=="textValue"&&r.localName==="dataBinding")&&t==="edit")return "bound";for(let r of n.children){if(r.kind==="textValue"||r.localName!=="lock")continue;let o=r.attributes.find(i=>i.localName==="val")?.value;if(t==="remove"){if(o==="sdtLocked"||o==="sdtContentLocked")return "locked"}else if(o==="contentLocked"||o==="sdtContentLocked")return "locked"}}return null}function Ti(e,t,n=true){let r=e.createElement("div");return r.className=t,r.contentEditable="false",n&&r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.pointerEvents="none",r}function TM(e,t,n){for(let r of e)r.style.width=t,r.style.height=n;}var EM=64;function Al(e,t,n={}){let r=n,o=wu(n),i=r.openedSession??chunkEOTAXOJY_cjs.j(t,{...n.reviewModel?{reviewModel:n.reviewModel}:{},...n.contentLockPolicy?{contentLockPolicy:n.contentLockPolicy}:{}});if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{},..."limit"in i&&i.limit?{limit:i.limit}:{}};let a=xE(i.session,o),s=wT(a),l=s.index,c=n.collaborationModel?.session,d=n.author,u=n.scale??96/72,f={resolve:n.tableInteractionLabel??(p=>Sg(p))},m="the document is open for viewing",g="the table of contents is generated and read-only",b=false,y="\0range\0",h=()=>`${new Date().toISOString().slice(0,19)}Z`,v=n.measurer?null:chunk5JPIEN54_cjs.X(u,{context:wi(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=n.measurer??v.measurer,k=chunkDBOOTED4_cjs.Ke(),R=chunkDBOOTED4_cjs.Nf();function C(){return n.measurer?n.producer??"host-measurer":`${n.producer??v?.producer??"fixed-measurer"}@scale:${u}`}let P=C(),E=n.lockedControlNavigation==="atomic",w=e.ownerDocument,S=w.createElement("div"),F=AE(()=>S);S.className="docx-pages",S.style.position="relative",o.listeners(S),S.contentEditable="true",S.spellcheck=false,S.setAttribute("role","textbox"),S.setAttribute("aria-multiline","true"),Bg(S,n.translate),S.style.outline="none";let A=Ti(w,"docx-selection-overlay"),$=Ti(w,"docx-comment-overlay"),W=Ti(w,"docx-text-highlight-overlay"),U=null,_=Ti(w,"docx-remote-selection-overlay"),L=Ti(w,"docx-bookmark-overlay"),Z=Ti(w,"docx-table-furniture",false);e.style.position="relative";let ee=[Z,$,L,W,_,A];e.replaceChildren(S,...ee);let te=cO(S,()=>u,()=>{let p=De?.getActive()??null,I=ue?.activeNoteScope()??null,M=ue?.activeNotePageIndex()??null,N=p?Lk(S,p.pageIndex):I?Dk(S,I.id,M):null;return {layout:ke(),selection:Vt.shownSelection(T),...Ge.caretPreference(p?.pageIndex??M??void 0),measurer:x,...Et()?{typingStyle:()=>{let K=He.formatting();return K.fontSizeHalfPoints?{fontSizePt:K.fontSizeHalfPoints/2,fontFamily:K.fontFamily,bold:K.bold,italic:K.italic,verticalAlign:K.superscript?"superscript":K.subscript?"subscript":"baseline"}:null}}:{},scopedHost:N,...p?{scopedHostKind:"headerFooter"}:I?{scopedHostKind:"note"}:{},...qe?.caretInput(ye)}}),me=Td(a.part()),le=a.paragraphIds(),D=le.find(p=>!me.has(p))??le[0]??"",T=r.initialSelection??{anchor:{paragraphId:D,offset:0},head:{paragraphId:D,offset:0}},B=r.initialDrawingSelectionIntent??{kind:"none"};function q(p,I){p.kind===B.kind&&(p.kind!=="pointer"||B.kind==="pointer"&&p.drawingNodeId===B.drawingNodeId)||(B=p,I&&n.onChange?.(St()));}let j=null,X=null;function oe(p){return X=H(p),n.onChange?.(St()),false}function H(p,I=p){return n.onRejection?.(I),p}let V=()=>n.onEdit?.(mn),z=new Wu,Y=new Ku(()=>a.currentPackage()),fe="suggesting needs an author before it can propose a change",ne=false,ce=false,ve=null,Re=new Map;function ht(){ve=null;for(let p of Re.values())ve=p;}function Ae(p,I){if(p.paragraphId===I.paragraphId)return p.offset-I.offset;let M=at();return M.indexOf(p.paragraphId)-M.indexOf(I.paragraphId)}function Fe(p){if(!ve)return;let{from:I,to:M}=Xd(ke(),ve),N=p.head;Ae(N,I)>=0&&Ae(N,M)<=0||(Re.clear(),ve=null);}let we=null,Je=new Yd(c??a),Zt=new Gd(c??a,()=>T,()=>Ce(a,T.head.paragraphId)??a.part(),()=>a.packageRevision());function Se(p){let I=null;c&&hn.expectHistory(true);let M;try{M=Zt.step(p,()=>{if(c)return c[p]();let K=a.packageRevision();return I=a[p](),a.packageRevision()!==K});}finally{c&&hn.expectHistory(false);}if(!M.changed)return;V();let N=p==="undo"?nO(c,zl):null;L1(N??M.selection??I);}function Me(p){Ge.noteModelMoved(),Ut();let I=xP(p,ke(),at());kt(I.selection),we=I.format,te.update(),n.onChange?.(St());}function tt(){return Et()?.properties??null}function Et(){return Fg(we,T)}function jt(p){if(!we)return;let I=we.position;p.anchor.paragraphId===I.paragraphId&&p.anchor.offset===I.offset&&p.head.paragraphId===I.paragraphId&&p.head.offset===I.offset||(we=null);}function un(p,I,M,N,K){let G=rt([...p],M,N,Oe(),true,K);return p.length===I.length||!G.rejected?G:rt([...I],M,N,Oe(),true,K)}function Fo(p,I,M,N){let K=qe?.replacementFormatOps(p,I,M);if(K?.length)return K;let G=Et()??(zt(T.head.paragraphId).length===0?{base:[],properties:wa(Ce(a,T.head.paragraphId)??a.part(),T.head.paragraphId,T.head.offset,rn(),Rt())}:null);if(!G||M===0||G.properties.length===0&&G.base.length===0)return [];let J=we?.position??T.head,ae=N&&J.paragraphId===p&&J.offset>=N.start&&J.offset<=N.end?{paragraphId:p,offset:Mf({paragraphId:p,offset:N.start},{paragraphId:p,offset:N.end})}:chunkDBOOTED4_cjs.zd(ke(),J);return ae.paragraphId!==p||ae.offset!==I?[]:[{op:"setRunProperties",paragraphId:p,start:I,end:I+M,properties:chunkWO4V6PNS_cjs.Wh(G.base,G.properties,$n(p,I))}]}let De=null,ue=null,qe=null,ke=()=>qe?.layout(ye)??ye,Mi=()=>qe?.active()?qe.paragraphIds():a.paragraphIdsIn(Oe()),Ve=null,Oe=()=>xd(De?.getActive()??null,ue?.activeNoteScope()??null),Ai=()=>ue?.activeNoteScope()?.id??null,fn=p=>{let I=R.multi?.spans,M=0,N=0;if(I&&I.length>0)for(let K=0;K<I.length;K+=1){let G=I[K];if(M=K,N=G.startIndex,p<G.startIndex+G.pageCount)break}return {sectionIndex:M,sectionStart:N}},Bl=(p,I)=>{if(qe?.active()){let J=qe.paragraphIds();return J.includes(p)?p:J[J.indexOf(I)+1]??null}let M=Ce(a,p)??Ce(a,I)??a.part();if(chunkWO4V6PNS_cjs.Ta(M,p))return p;let N=chunkWO4V6PNS_cjs.Ua(M,I),K=N?N.children.findIndex(J=>J.id===I):-1,G=N&&K>=0?N.children[K+1]:void 0;return G?.kind==="paragraph"?G.id:null},at=()=>ua(ke(),De?.getActive()??null,Ai()),hn=tO({textOf:p=>zt(p),order:at,carried:()=>rO(c)}),yt=()=>globalThis.performance?.now()??Date.now(),oo=0,Tr=0,Fi=0,Lo=p=>{rP(p)&&n.onTiming?.("input",p.timeStamp);},{styleCascade:nr,numberingIndex:Er,defaultTabStopPt:ja,compatibilityMode:$l}=kE(a),ql=oO({styleCascade:nr,partOf:p=>Ce(a,p)??a.part()}),Wl=null,Li=n.imageDecodePort??aO(w)??sO(),Lt=chunkDBOOTED4_cjs.Qe({session:a,decodePort:Li,onResourcesChanged:()=>Wl?.()}),Di=n.drawingStrings??chunkXMJKFURD_cjs.l,Ni=chunkXMJKFURD_cjs.f(n.translate),Va=n.tocLabels,Do=()=>T.anchor.paragraphId!==T.head.paragraphId||T.anchor.offset!==T.head.offset?null:{paragraphId:T.head.paragraphId,offset:T.head.offset},Kl=aT(a),Ua=lO({mintValidatedBytes:(p,I)=>Lt.mintValidatedBytes(p,I)}),Rn=false,rr=OO(n.revisionDisplayMode,!!n.reviewModel,p=>Te.setRevisionDisplayMode(p)),jl=rr.view,rn=rr.projection,sf=rr.changeBars,or=r.revisionAuthorVisibility??xu(n.hiddenRevisionAuthors),Vt=sP({layout:ke,part:()=>a.partFor(Oe())??a.part(),view:sb}),No=wP(n.revisionMarkup,()=>rr.filter(or.filterForSession(a)),()=>Ye(),()=>{yn=Cr(Rt()),ct.invalidateAll(a.packageRevision(),"revision-markup"),ct.flush(),It(false);}),Rt=No.filter,$n=BP(a,rn,Rt),Ho=p=>{let I=Ce(a,p)??a.part();return kP(I,p,rn(),Rt())},yn,io=chunkDBOOTED4_cjs.df(a),ir=chunkDBOOTED4_cjs.ef(),Cr=(p,I=Rn)=>IE({session:a,measurer:x,producer:P,cache:k,styleCascade:nr,numberingIndex:Er,defaultTabStopPt:ja,compatibilityMode:$l,displayMode:rn(),showFieldCodes:I,revisionAuthorFilter:p,inlineDrawingLayoutForPart:M=>Lt.contextForPart(M),drawingLayoutTokenForPart:M=>Lt.cacheTokenForPart(M),drawingTokenForParagraphForPart:(M,N)=>Lt.drawingTokenForParagraph(N,M),linkProjectors:io,projectFieldLink:M=>ir.project(M)});yn=Cr(Rt());let ar={...a,applyTreeOps:(p,I,M,N,K)=>rt(p,I,M,N,true,K?.packageEdits),ensureListDefinition:p=>chunkWO4V6PNS_cjs.Hb(c?.identity.actorId,()=>a.ensureListDefinition(p)),applyPmDoc:p=>Le==="view"?{committed:false,rejected:true,opCount:0,reason:m}:c?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:Pf()?{committed:false,rejected:true,opCount:0,reason:g}:a.applyPmDoc(p)},ao=()=>{},qn=yT({now:yt,view:()=>Ze(S),pageAfterView:()=>{let p=ff();return p&&p.size>0?Math.max(...p)+1:void 0},current:()=>ye,revision:()=>a.packageRevision(),publish:p=>o.wrap(()=>lf(p))(),snapshot:()=>{let p={...R};return ()=>{Object.assign(R,p);}},pendingChanged:p=>e.toggleAttribute("data-docx-layout-pending",p),passTimed:p=>n.onTiming?.("layout",p)}),so=r.progressiveOpen?EM:null,ye=sr(),lo=n.revisionStyles,pn=BT(n.showParagraphMarks??false,Ye,()=>It(false)),Or=gR({session:ar,storyScope:Oe,orderedRange:()=>Nr(),writeRefusal:()=>dr(true),commit:(p,I)=>_e(p,I),goToPosition:(p,I)=>nt.goToPosition(p,I),setSelection:p=>kt(p),beforeChange:Ye,repaint:()=>It(false),options:n}),O=r.reviewAuthorSlots??chunkXMJKFURD_cjs.e(),Q=DE({layout:ke,items:()=>a.reviewItems(),styles:()=>lo,slots:O});function re(p){Ht(),c?.flushPendingJournals();let I={selection:T,format:we},M=JSON.stringify(He.formatting()),N=vP(T,we,p,()=>wa(a.partFor(Oe())??a.part(),T.head.paragraphId,T.head.offset,rn(),Rt()));N!==void 0&&(we=N,M!==JSON.stringify(He.formatting())&&Je.record(I,{selection:T,format:we},Zh(Te)),Y.end(),te.update(),n.onChange?.(St()));}let He=yO({runFormatRefusal:()=>Xn({type:"toggleMark"},Te)?.reason??null,session:ar,applyOutsideToc:(p,I)=>{let M=p.filter(N=>!vb(N));if(M.length===0)return I(p);b=true;try{return I(M)}finally{b=false;}},storyScope:Oe,paragraphOrder:at,layout:ke,selection:()=>Vt.shownSelection(T),displayMode:()=>rn(),authorFilter:Rt,paragraphMarkVisible:Ho,commit:(p,I,M)=>_e(p,I,M),orderedRange:()=>Vt.shownRange(Nr()),selectionMark:()=>et(),textOf:p=>zt(p),selectedCells:()=>j?.cellIds,defaultParagraphStyleId:()=>nr()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>tt(),setPendingFormats:re}),xe=vO({session:ar,storyScope:Oe,layout:ke,selection:()=>Vt.shownSelection(T),displayMode:()=>rn(),authorFilter:Rt,paragraphMarkVisible:Ho,commit:(p,I,M)=>_e(p,I,M),orderedRange:()=>Vt.shownRange(Nr()),selectionMark:()=>et(),textOf:p=>zt(p),paragraphOrder:at,selectedCells:()=>j?.cellIds,armPendingFormats:p=>re(p),now:yt,publish:()=>{xe.state().mode!=="off"?S.dataset.formatPainter="":delete S.dataset.formatPainter,n.onChange?.(St());}}),lt=ZO({session:ar,storyScope:Oe,headerFooterSectionIndex:()=>De?.getActive()?.sectionIndex,revisionDisplayMode:rn,revisionAuthorFilter:Rt,paragraphOrder:at,selectedCells:()=>j?.cellIds,editingMode:()=>Le,publishRefusal:oe,caretParagraphId:()=>T.anchor.paragraphId===T.head.paragraphId&&T.anchor.offset===T.head.offset?T.head.paragraphId:null,layout:ke,commit:(p,I,M)=>_e(p,I,{rearmPending:Et()??void 0,...M?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>Of(),orderedRange:()=>Nr(),selectionMark:()=>et(),collapsedAt:p=>Ke(p),deleteSelectionPlan:()=>Hr(),paragraphTextOf:p=>zt(p),numberingLevelExists:(p,I)=>chunkDBOOTED4_cjs.oc(chunkDBOOTED4_cjs.zc(Er(),nr()),p,I)!==null});function Ue(p,I,M){return Le!=="suggest"?null:Mf({paragraphId:p,offset:I},{paragraphId:p,offset:M})}let Pt=rM({session:ar,layout:ke,fieldLinkById:p=>ir.linkById(p),refusesWrite:()=>dr(true)!==null,withMintActor:p=>chunkWO4V6PNS_cjs.Hb(c?.identity.actorId,p),storyScope:Oe,replacementLanding:Ue,insertionLanding:(p,I)=>chunkDBOOTED4_cjs.zd(ke(),{paragraphId:p,offset:I}).offset,selection:()=>T,orderedRange:()=>Nr(),selectionMark:()=>et(),textOf:p=>zt(p),commit:(p,I)=>_e(p,I)}),Ne=xC({session:ar,storyScope:Oe,editingMode:()=>Le,writeRefusal:p=>dr(true,[p]),selection:()=>T,selectionMark:()=>et(),commit:(p,I)=>_e(p,I)}),ze=p=>{let I=Bt(a,p,{kind:"body"});if(I.kind==="body")return ue?.exitNote(),De?.exitHeaderFooter(),true;if(I.kind==="headerFooter"){let N=De?.activeScope();return N?.kind==="headerFooter"&&N.rId===I.rId?true:(ue?.exitNote(),De?.enterHeaderFooter({rId:I.rId})??false)}let M=qk(ye,p);return M?ue?.activeNoteScope()?.id===M?true:(De?.exitHeaderFooter(),ue?.enterNote(M)??false):false},nt=oM({pagesLayer:S,get container(){return e},scale:()=>u,layout:ke,bookmarks:()=>a.bookmarks(),linkById:p=>ir.linkById(p)??Pt.linkById(p),drawingLinkById:p=>lM(ye,p),setSelection:p=>kt(Ke(p)),enterStoryFor:p=>ze(p),isCollapsedSelection:()=>Le==="view"||At(T,Ke(T.head)),onScrolled:()=>Ql(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),Dt=vC({pagesLayer:S,equationById:p=>Ne.equationById(p),setSelection:p=>kt(p,false,"none"),...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});S.addEventListener("contextmenu",Jy),S.addEventListener("click",eb),S.addEventListener("pointermove",zy),S.addEventListener("pointerleave",Zy);let Xe=NT(S),bt=null;function xt(p,I,M,N){return ao(),qn.finish(),chunkDBOOTED4_cjs.jf(Nt(p,I,M,N))}function*Nt(p,I,M,N){let K=M?M.authorFilter:Rt(),G=M?.layoutSession??R,J=M?.furnitureSource??yn;return I&&chunkDBOOTED4_cjs.xc(G,I),!M&&N===void 0&&(so=null),Lt.sync(a),yield*chunkHC6YNKUI_cjs.a({view:a,revision:p,measurer:x,cache:k,session:G,producer:P,styleCascade:nr,defaultTabStopPt:ja,numberingIndex:Er,furniture:J,compatibilityMode:$l,linkProjectors:io,projectFieldLink:ae=>ir.project(ae),inlineDrawingLayout:Lt.bodyContext,inlineDrawingLayoutForPart:ae=>Lt.contextForPart(ae),drawingTokenForParagraph:ae=>Lt.drawingTokenForParagraph(ae,a.part().name),drawingTokenForParagraphForPart:(ae,he)=>Lt.drawingTokenForParagraph(he,ae),drawingLayoutEpoch:Lt.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:ae=>Lt.cacheTokenForPart(ae),displayMode:rn(),showFieldCodes:M&&!M.live?false:Rn,fieldResults:o.mode,revisionAuthorFilter:K,bodyBlockLimit:N})}function Mr(){return xt(a.packageRevision(),void 0,{layoutSession:chunkDBOOTED4_cjs.Nf(),furnitureSource:Cr(void 0,false)})}function sr(){let p=yt(),I=xt(a.packageRevision(),void 0,void 0,so??void 0);return oo=yt()-p,I}let st=ut(()=>S),wt=null,Ar=0,lr=false,_o=null,Hi=false;function Bo(){if(Hi)return;Hi=true;let p=a.packageRevision();_o=SM({steps:wM(()=>a.part()),shouldRun:()=>Le!=="view"&&a.editable&&a.packageRevision()===p,hasPendingInput:Fr,schedule:(I,M)=>{let N=st.setTimeout(I,M);return ()=>st.clearTimeout(N)}});}function Fr(p=true){return zP(e,p)}function za(){if(Ar>0){lr=true,Bo();return}if(!Fr()){It(),Bo();return}wt===null&&(wt=st.setTimeout(o.wrap(()=>{wt=null,ct.pending()===null&&(It(),Bo());}),0));}let Be="",Ct=null,mn=false;function Ht(){if(mn||(Ct!==null&&(st.clearTimeout(Ct),Ct=null),Be.length===0))return;let p=Be;Be="",mn=true;try{Na(Te,Y.groupAt(T),()=>Te.type(p)),Y.landed(T);}catch(I){throw Be=p+Be,I}finally{mn=false;}}function co(p){Be+=p,Ct===null&&(Ct=st.setTimeout(o.wrap(()=>{Ct=null,Ht();}),0));}function $o(p,I,M){Ht();let N=M?.trim()||d?.trim();if(!N)return oe("tracked changes need a non-empty author");if(p!=="deletion"&&I.length===0)return oe(`${p} requires non-empty text`);if(p!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(I))return oe(`${p} requires text without a paragraph mark`);let K={author:N,date:h()},G=Nr(),J=G.from.paragraphId===G.to.paragraphId&&G.from.offset===G.to.offset;if(p!=="insertion"&&J&&!(p==="replacement"&&j))return oe(`${p} needs a non-collapsed selection`);let ae=p==="insertion"?{ops:[],collapseTo:chunkDBOOTED4_cjs.zd(ke(),G.from)}:Hr(N),he=wl(ae.ops,K,ab()),Pe=ae.collapseTo;if(p==="insertion"||p==="replacement"){let pe=p==="replacement"?ae.replaceAt??ae.collapseTo:ae.collapseTo;he.push({op:"insertText",paragraphId:pe.paragraphId,offset:pe.offset,text:I,revision:K}),Pe={paragraphId:pe.paragraphId,offset:pe.offset+I.length};}let Ee=false;return _e(()=>{let pe=rt(he,et(),Dr(Pe));return Ee=pe.committed,pe},()=>Ke(Pe)),Ee}function Vl(p){Wo=false,Jl.without(p),Wo=false;}let Ul=dM({settle:()=>Ye(),refuse:p=>oe(p),storyParagraphs:()=>at(),textOf:p=>zt(p),rangePlan:p=>O1(p),insertionPoint:p=>chunkDBOOTED4_cjs.zd(ke(),p),selection:()=>T,selectionMark:()=>et(),commitWithoutFollow:(p,I,M)=>{let N=false;return Vl(()=>_e(()=>{let K=rt(p,I,I,Oe(),false);return N=K.committed,K},M)),N},flushLayout:()=>Ut(),noteModelMoved:()=>Ge.noteModelMoved(),selectionsEqual:At}),ct=chunk5JPIEN54_cjs.ia({run:p=>{let I=yt();ao(),qn.abandon();let M=Nt(p.revision,p),N=qn.run(M,p.revision,oP(p));return oo=yt()-I,N},currentRevision:()=>a.packageRevision(),schedule:p=>{let I=st.setTimeout(o.wrap(p),0);return ()=>st.clearTimeout(I)},publish:p=>lf(p)});function lf(p){Q.releaseLayout(),ye=p;let I=hn.map(T);I!==T&&(T=I,Ko()),za(),$y.request();}let $y=xT({now:yt,schedule:(p,I)=>st.clearTimeout.bind(null,st.setTimeout(o.wrap(p),I)),revision:()=>a.packageRevision(),live:()=>R,current:()=>ye,busy:()=>qn.pending()||so!==null,pass:(p,I)=>Nt(p,void 0,{authorFilter:Rt(),layoutSession:I,furnitureSource:yn,live:true}),createSession:chunkDBOOTED4_cjs.Nf,adopt:(p,I)=>{R=p,lf(I);}}),cf=false;Wl=()=>{ct.invalidateAll(a.packageRevision(),"drawing-resources"),!cf&&(cf=true,st.setTimeout(o.wrap(()=>{cf=false,Ut();}),0));};let r1=a.subscribe(p=>{s.retain(p),p.origin!==chunkWO4V6PNS_cjs.g.mutationRemote&&p.origin!==chunkWO4V6PNS_cjs.g.mutationUndo&&p.origin!==chunkWO4V6PNS_cjs.g.mutationRedo&&Je.noteEdit(),we=null,mn||Y.noteForeignChange(p),p.origin===chunkWO4V6PNS_cjs.g.mutationRemote?hn.note(T,p.dirty,ye.revision===p.fromRevision):hn.noteLocal(),ct.notify(p);}),zl=c?a.collaborationPort(c.documentId):null,qy=()=>{},Wy=()=>{},df=false,uf=null,Ky=null,o1=c?c.subscribeRemoteSelections(()=>{df&&oc();}):()=>{};function ff(){let p=EE(e,ye,T,u),I=De?.getActive()?.pageIndex??Ge.selectionPageIndex();return I===void 0||p===void 0||p.has(I)?p:new Set([...p,I])}function jy(){lr&&It();}function Ut(){return ct.pending()?ct.flush():false}let i1=8;function a1(p){!p&&ct.pending()!==null&&oo>i1&&Fr(false)||(!Ut()||p&&lr)&&It();}function Ye(){Ht(),Ut();}function Gl(){Ht();let p=Ut();return wt!==null||lr?(It(),Bo(),true):p}let Ga=null;function Vy(p){return nI(p,a.part())}function s1(){for(let p of S.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(p.getAttribute("data-docx-content-control")===Ga){p.dataset.hover="",p.dataset.boundaryVisible="";continue}delete p.dataset.hover,ne||delete p.dataset.boundaryVisible;}}function Uy(p){Ga!==p&&(Ga=p,s1());}function pf(p){return rI(a.part(),Gy(p),p.target)}function zy(p){let I=pf(p);Uy(I?Vy(I):null);}function Gy(p){let I=p.target,M=I?.isConnected?I.closest("[data-paragraph-id]"):void 0;if(M)return M.dataset.paragraphId;let N=S.ownerDocument;return typeof N.elementFromPoint!="function"?void 0:N.elementFromPoint(p.clientX,p.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Zy(){Uy(null);}function l1(){let p=uo(),I=chunkDBOOTED4_cjs.ob(a.part()),M=chunkWO4V6PNS_cjs.Uf(a.part()),N=M.map(pe=>{let ft=lT(pe,ye,a.part(),x);return ft?{...ft,empty:I.has(pe.beginParagraphId)}:null}).filter(pe=>pe!==null),K=new Set(N.map(pe=>pe.boundary.id)),G=new Set(N.filter(pe=>pe.empty).map(pe=>pe.boundary.id));for(let pe of M)pe.contentControlId&&Vy(pe)!==pe.contentControlId&&G.add(pe.contentControlId);let J=p&&!K.has(p.id)?new Set([p.id]):void 0,ae=Ga?new Set([Ga]):void 0,he=new Set(chunkDBOOTED4_cjs.re(ye).filter(pe=>pe.controlType==="checkbox"&&gf(pe.id)).map(pe=>pe.id)),Pe=N.filter(pe=>pe.additional&&!pe.empty).map(pe=>pe.boundary),Ee=ob()!==null;if(!(!ne&&!J&&!ae&&!Ee&&he.size===0&&Pe.length===0&&K.size===0))return {...Ee?{readOnly:true}:{},...ne?{showAll:true}:{},...J?{activeIds:J}:{},...ae?{hoverIds:ae}:{},...he.size>0?{checkedIds:he}:{},...Pe.length>0?{additionalBoundaries:Pe}:{},...K.size>0?{tocControlIds:K}:{},...G.size>0?{suppressedIds:G}:{}}}let Za=null;function uo(){let p=Oe();if(p.kind!=="body")return u1(p);if(Za&&Za.layout===ye&&Za.selection===T)return Za.result;let I=c1();return Za={layout:ye,selection:T,result:I},I}function c1(){let p=HT(ye,T,x);return p&&d1(p.id)===a.part().name?p:null}function d1(p){let I=p.indexOf("#");return I===-1?"":p.slice(0,I)}function u1(p){let I=a.partFor(p);return I?chunkDBOOTED4_cjs.hf(I,T.head.paragraphId):null}function cr(p){let I=Ce(a,p),M=chunkWO4V6PNS_cjs.Ta(I??a.part(),p);return !M||!chunkWO4V6PNS_cjs.Uc(M)?null:M}function Xy(p){let I=cr(p);if(!I)return null;for(let M of I.children)if(M.kind!=="textValue"&&(M.kind==="contentControlProperties"||M.localName==="sdtPr"))for(let N of M.children){if(N.kind==="textValue"||N.localName!=="tabIndex")continue;let K=N.attributes.find(J=>J.localName==="val")?.value;if(K===void 0)return null;let G=Number(K);return Number.isFinite(G)?G:null}return null}function f1(){let p=Oe(),I=p.kind==="body"?null:a.partFor(p),M=p.kind==="notesPart"?new Set(at()):void 0;return (I?[...chunkDBOOTED4_cjs.gf(I,M)]:[...chunkDBOOTED4_cjs.re(ye)]).filter(K=>Xh(K)===null).sort((K,G)=>{let J=Xy(K.id),ae=Xy(G.id);return J!==null&&ae!==null&&J!==ae?J-ae:J!==null&&ae===null?-1:J===null&&ae!==null?1:0})}function mf(p){De?.getActive()||ue?.activeNoteScope()||Bt(a,p.paragraphId,{kind:"body"}).kind==="body"&&Te.revealPosition(p);}function p1(p){let I=cr(p);if(!I)return false;let M=uM(I,{contentChildrenOf:fM,searchRoots:()=>(a.partFor(Bt(a,p,Oe()))??a.part()).root.children});if(!M)return false;let N=T;return kt(M,false,"none"),(T!==N||At(T,M))&&mf(T.anchor),true}let Yy=p=>nT(cr(p),()=>a.currentPackage());function gf(p){let I=cr(p);if(!I)return false;for(let M of I.children)if(M.kind!=="textValue"&&!(M.kind!=="contentControlProperties"&&M.localName!=="sdtPr")){for(let N of M.children)if(N.kind==="contentControlCheckbox")for(let K of N.children){if(K.kind!=="contentControlChecked")continue;let G=K.attributes.find(J=>J.localName==="val")?.value;return !(G==="0"||G==="false"||G==="off")}}return false}let Qy=p=>rT(cr(p));function Zl(p,I){for(let M of S.querySelectorAll("[data-docx-content-control]"))M.getAttribute("data-docx-content-control")===p&&(I?M.dataset.open="":delete M.dataset.open);}let qo=AT({get document(){return S.ownerDocument},layer:S,find:cr,layout:ke,selectDrawing:(p,I)=>Te.selectDrawing(p,I),allowed:p=>!Lr.disabledReason(p,"edit"),translate:p=>Qa?.(p)??p,replaceImage:(p,I,M,N)=>Te.replaceImage(p,I,M,{expectedPackageRevision:a.packageRevision(),commitGuard:N}),setOpen:Zl,reject:oe}),hf=tT({find:cr,allowed:p=>!Lr.disabledReason(p,"edit"),apply:(p,I)=>Lr.setValue(p,I),items:Yy,date:Qy,checked:gf,picture:qo.drawingOf,replaceImage:qo.replace,locale:()=>tc.get(),layer:S,setOpen:Zl,request:n.onRequestContentControlWidget}),Xl=null,yf;function bf(p){Xl===p&&(Xl=null,yf?.(),yf=void 0);let I=p.dataset.docxCcId,M=p.contains(S.ownerDocument.activeElement);p.remove(),I&&Zl(I,false),M&&S.focus({preventScroll:true});}function Yl(){hf.cancel();let p=Xl;return p&&bf(p),p}function Jy(p){let I=pf(p);m1(I&&Cf(I.id)?I.id:null);}let Xa=null;function m1(p){Xa!==p&&(Xa=p,n.onChange?.(St()));}function eb(p){if(p.button!==0||p.target?.closest("a.docx-hyperlink")||Le!=="view"&&!At(T,Ke(T.head)))return;let I=Gy(p);if(!I)return;let M=chunkWO4V6PNS_cjs.Uf(a.part()).find(G=>G.resultParagraphIds.includes(I));if(!M||pf(p)?.id!==M.id)return;let K=chunkWO4V6PNS_cjs.zg(a.part(),M,a.documentOutline(),Tf(M))[M.resultParagraphIds.indexOf(I)];K&&(p.preventDefault(),nt.goToPosition({paragraphId:K,offset:0}));}let tb={get document(){return S.ownerDocument},locale:()=>tc.get(),translate:p=>Qa?.(p)??p,setValue:(p,I)=>Lr.setValue(p,I),close:p=>bf(p)};function g1(p,I){let M=Lr.disabledReason(p,"edit");if(M){X=H(M),n.onChange?.(St());return}if(qo.cancel(),Yl()?.dataset.docxCcId===p||(I==="picture"&&qo.select(p),hf.open(p,I)))return;if(I==="picture")return qo.pick(p);if(I==="checkbox"){Lr.setValue(p,gf(p)?"false":"true");return}let N=chunkDBOOTED4_cjs.re(ye).find(G=>G.id===p)?.alias,K;if(I==="dropdown"||I==="comboBox"||I==="buildingBlockGallery"){let G=Yy(p);if(G.length===0&&I==="dropdown")return;K=aE(tb,p,I,G,N,jg(cr(p),G));}else if(I==="date")K=sE(tb,p,Qy(p),N);else return;Xl=K,iE(K,S,QP(ye,u,p,S,Tt?.pageOffsetX)),Zl(p,true),yf=ou(K,()=>bf(K)),I==="date"?bu(K):(K.querySelector("input")??K.querySelector('[role=option][tabindex="0"]')??K.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let Lr={setShowAll(p){ne!==p&&(ne=p,It());},setFormFill(p){ce!==p&&(ce=p,n.onChange?.(St()));},showAll:()=>ne,formFill:()=>ce,atCaret:()=>uo(),navigate(p){let I=f1();if(I.length===0)return false;let M=uo(),N=M?I.findIndex(G=>G.id===M.id):-1;p==="next"?N=N<0?0:(N+1)%I.length:N=N<0?I.length-1:(N-1+I.length)%I.length;let K=I[N];return p1(K.id)},setValue(p,I){let M=Lr.disabledReason(p,"edit");if(M)return oe(M);let N=iT(cr(p),()=>a.currentPackage(),p,I);if(!N)return oe("unknown-building-block");let K=false;return _e(()=>{let G=rt(N,et(),void 0,Bt(a,p,Oe()),false);return K=G.committed,G}),K},remove(p){let I=p??uo()?.id;if(!I)return oe("notFound");let M=Lr.disabledReason(I,"remove");if(M)return oe(M);let N=false;return _e(()=>{let K=rt([{op:"removeContentControl",controlId:I}],et(),void 0,Bt(a,I,Oe()),false);return N=K.committed,K}),N},disabledReason(p,I){let M=ob();if(M!==null)return M;let N=chunkDBOOTED4_cjs.re(ye).find(G=>G.id===p);if(N)return I==="remove"?RM(N):Xh(N);let K=cr(p);return K?PM(K,I):"notFound"}};function vf(){let p=xf&&Le!=="view";S.contentEditable=p?"true":"false",S.setAttribute("aria-readonly",p?"false":"true");}function St(){return {revision:a.packageRevision(),pageCount:ye.pages.length,selection:T,cellSelection:j,canUndo:Je.canUndo||(c?.canUndo()??a.canUndo()),canRedo:Je.canRedo||(c?.canRedo()??a.canRedo()),collaborationStatus:c?.status()??"inactive",lastRejection:X,pendingFormat:tt(),contentControls:{showAll:ne,formFill:ce,activeControlId:uo()?.id??null},contextTocId:Xa,formatPainter:xe.state(),perf:{layoutMs:oo,paintMs:Tr,selectionMs:Fi,placed:R.stats.placed,total:R.stats.total,reusedPages:R.stats.reusedPages,fullPasses:R.stats.fullPasses,staleDiscards:ct.staleDiscards,cancelledRuns:ct.cancelledRuns}}}let on,Tt,Wo=false,Ya=null,_i=LE({pagesLayer:S,listeners:F,viewport:()=>Ya,container:()=>e,setContainer:p=>e=p,destroyed:()=>po,scale:()=>u,settle:()=>{Gl(),ao(),qn.finish(),Yl(),qo.cancel(),ac?.cancelGesture(),qi.cancelDrag();},repaint:()=>It(false),onHostMoved:p=>n.onHostMoved?.(p)});function It(p=true){if(wt!==null&&(st.clearTimeout(wt),wt=null,p=true),_i.heal(),_i.parked()){lr=false,rc(),p&&n.onChange?.(St());return}lr=false;let I=Ge.adoptBeforePaint(),M=yt();on=ff(),De?.reconcileOccurrence();let N=De?.getActive()??null,K=l1(),G=chunkDBOOTED4_cjs.ob(a.part());chunkXMJKFURD_cjs.r(S,ye,{scale:u,readOnlyParagraphIds:Td(a.part()),...G.size>0?{emptyTocPlaceholderIds:G}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:on,ariaHidden:false,drawingStrings:Di,breakMarkStrings:Ni,...n.fieldShading?{fieldShading:n.fieldShading}:{},...lo!==void 0?{revisionStyles:lo}:{},revisionMarkup:No.current(),facingPages:SP(chunkWO4V6PNS_cjs.ah(a.currentPackage())),shadeFormFields:Kl(),showParagraphMarks:pn.get(),changeBars:sf(),changeBarsToggle:!!n.reviewModel,...Ua?{imageUrlPort:Ua}:{},...N?{activeHeaderFooterRId:N.scope.rId,activeHeaderFooterPageIndex:N.pageIndex}:{},...K?{contentControlChrome:K}:{}},Q.get().value),qe?.syncDom(),sh(S,Do(),{domReplaced:true}),_k(e,S,N!=null),wm(e,Le),Tt=ku(ye,on),OE(S,ye,Tt,u),S.style.width=`${Tt.width*u}px`,S.style.height=`${Tt.height*u}px`,e.style.width=`${Tt.width*u}px`,e.style.height=`${Tt.height*u}px`;let{width:J,height:ae}=Tt;TM(ee,`${J*u}px`,`${ae*u}px`),qi.update(),Tr=yt()-M,n.onTiming?.("paint",Tr),os(),oc(),$i(true),Or.paint(bb(L)),rc(),Ya?.watchScrollerSize(),Ge.mirrorToDom(),nb(Wo),Wo=false,(p||I)&&n.onChange?.(St());}function Ql(){Ye();let p=ff(),I=ku(ye,p);Tt&&ch(p,on)&&CE(I,Tt)||It(false);}let Jl=cM({storyScopeOpen:()=>!!(De?.getActive()||ue?.activeNoteScope()),selection:()=>Vt.shownSelection(T),layout:ke,measurer:()=>x,preferredPageIndex:()=>Ge.selectionPageIndex(),preferredLineId:()=>Ge.selectionLineId(),pagesLayer:S,get container(){return e},scroller:()=>$t(e),scale:()=>u,scheduleRematerialize:()=>Ya?.schedule()});function nb(p=false,I="caret"){Jl.follow(p,I);}let Le=n.editingMode??"edit",xf=true,ec=Object.freeze({kind:"body"}),rb=0,tc=eE(n.locale,Ht),Qa=n.translate,Ot=null,nc=null,wf=null;function rt(p,I,M,N=Oe(),K=true,G){Ht();let J=dr(p.some(ib)||!!G?.length,p,K);if(J!==null)return {committed:false,rejected:true,opCount:0,reason:J};let ae=h1(K&&Ot?Ot.annotate(p):p),he=Ja(ae,I,M,N,G);return K&&Ot?.afterApply(he.committed),he.committed&&ae.some(xl)&&r.onTrackedChange?.(),he}function Ja(p,I,M,N=Oe(),K){let G=c?.gateOperations(p,N);if(G)return {committed:false,rejected:true,opCount:0,reason:G};rb+=1;let J=z.value;return a.applyTreeOps(p,I,M,N,c?{packageEdits:K,origin:chunkWO4V6PNS_cjs.g.mutationHuman,actorId:c.identity.actorId,operationId:`${c.identity.actorId}:${c.sessionId}:browser:${rb}`,recordsHistory:false,historyToken:J}:{packageEdits:K,historyToken:J})}function dr(p,I=[],M=true){if(Qn(e))return ka(e);let N=yM(I);if(Le==="view"&&!N)return m;if(Rn&&p&&M&&!N&&sT(G=>Ce(a,G),T))return Ia;if(p&&!N&&(M&&!b&&Pf()||I.some(G=>vb(G))))return g;if(Le==="suggest"&&!d?.trim()&&p)return fe;if(Le==="suggest"&&I.some(G=>G.op==="deleteNote"))return "suggesting cannot delete a note outright; strike its reference to propose the deletion";let K=G=>G.op==="removeContentControl"&&G.keepContent===false;return Le==="suggest"&&I.some(K)?"suggesting cannot remove a content control outright":null}let ob=jI(()=>dr(true,[],false),()=>a.editable);function ib(p){return p.op!=="acceptRevision"&&p.op!=="rejectRevision"&&p.op!=="acceptAllRevisions"&&p.op!=="rejectAllRevisions"&&p.op!=="setRevisionAttribution"}let ab=()=>No.current().trackFormatting&&!a.trackingSettings().doNotTrackFormatting;function Sf(){let p=d?.trim();return Le==="suggest"&&p?p:void 0}function h1(p){let I=Sf();return I===void 0?[...p]:wl(p,{author:I,date:h()},ab())}function sb(){return {displayMode:rn(),authorFilter:Rt()}}function lb(p){let I=Vt.removedCaretEdit(T.head,p);return I===null?false:(_e(()=>rt(I.ops,et(),Dr(I.caret)),()=>Ke(I.caret)),true)}function kf(p){let I=T1(p,M=>Vt.shown(M));if(I?.kind==="select")kt(I.selection);else if(I){let M=Et()??void 0;_e(()=>rt(I.ops,et(),Dr(I.collapseTo)),()=>Ke(I.collapseTo),{rearmPending:M});}return I!==null}function Dr(p){return {paragraphId:p.paragraphId,start:p.offset,end:p.offset}}function _e(...p){if(Qn(e))return H(ka(e));let I=zT(e);try{return y1(...p)}finally{I();}}function y1(p,I,M={}){Ht(),mn||Y.end();let N=Zt.begin();M?.keepCellSelection||(j=null),we=null,Ge.noteModelMoved(),Ar+=1;let K=null;try{let G=z.around(Te,p,ae=>typeof ae=="boolean"?ae:ae.committed,!M?.automation),J=typeof G=="boolean"||!G.rejected?null:G;if(J){let ae=String(J.reason??ml);K=X=H(WI(ae,a.settingsRoot()),ae);}else {X=null,(typeof G=="boolean"?G:G.committed)&&V();let ae=I?.();ae&&(rs(),T=ae,q({kind:"none"},!1),bt=null,Wo=!0);let he=M?.rearmPending;if(he&&he.properties.length>0){let{anchor:Pe,head:Ee}=T;Pe.paragraphId===Ee.paragraphId&&Pe.offset===Ee.offset&&(we={properties:he.properties,base:he.base,position:Ee});}}N(),Ko();}catch(G){if((Ar-=1)===0&&lr)try{It();}catch{}throw G}return Ar-=1,a1(K!==null),K}function b1(){if(!on)return true;for(let p of [T.anchor,T.head]){let I=chunkDBOOTED4_cjs.qe(ke(),p);if(I&&!on.has(I.pageIndex))return false}return true}function Ko(){let p=c;if(!p)return;let I=zl?BE(j?.text??T,N=>{let K=Ce(a,N)??a.part();return $E(K,N)},j?"cells":void 0):null,M=I?`${I.anchor.paragraphId}:${I.anchor.offset}|${I.head.paragraphId}:${I.head.offset}|${I.kind??""}`:"";M!==Ky&&(Ky=M,p.setLocalSelection(I));}function kt(p,I=false,M="caret",N){let K=!At(p,T);qe?.active()&&(!qe.contains(p.anchor.paragraphId)||!qe.contains(p.head.paragraphId))&&qe.exit(false),K&&Be.length>0&&Ht();let G=Ot?.beforeSelect(p);if(G===null)return;K&&!mn&&(Y.end(),Je.endGroup()),p=G??p,jt(p),Fe(p);let J=uo()?.id??null,ae=Mn(a.part(),T.head)?.id;rs(),T=p,j=null,I||(bt=null),b1()||(Ge.noteModelMoved(),M==="none"?Jl.without(()=>It(false)):It(false)),Ge.noteSelectionSettled(),Ge.notePointerCaret(N),Ge.mirrorToDom(true),nb(true,M),os(),jo.clear(),$i();let he=uo()?.id??null,Pe=Mn(a.part(),T.head)?.id;(J!==he||ae!==Pe)&&It(false),Ko(),n.onChange?.(St());}let Ge=MO({session:a,storyScope:Oe,pagesLayer:S,selection:()=>T,setSelection:p=>kt(p),adoptSelection:p=>{let I=Ot?.beforeSelect(p);I!==null&&(p=I??p,jt(p),Fe(p),rs(),T=p,bt=null,Wo=true,Ko());},commit:p=>_e(p),applyOps:(p,I,M)=>rt(p,I,void 0,M),hasPendingInput:()=>Be.length>0,replacementOffset:(p,I,M)=>Mf({paragraphId:p,offset:I},{paragraphId:p,offset:M}),render:()=>It(),flushLayout:()=>Ut(),flushToPaint:()=>Gl(),updateCaret:()=>{te.update(),sh(S,Do());},textOf:p=>zt(p),pendingFormatOps:(p,I,M,N)=>Fo(p,I,M,N),selectionMark:()=>et(),now:yt,recordSelectionMs:p=>{Fi=p;},isGesturing:()=>B.kind==="pointer"||(ac?.dragging()??false),selectionLocked:()=>Le==="view",domSelection:()=>j?Ke(j.text.anchor):T,holdsCellSelection:()=>j!==null,replaceSelectionWith:p=>Te.type(p),discardPaint:()=>chunkXMJKFURD_cjs.p(S)});De=hM({session:a,layout:ke,sectionAtPage:fn,revisionDisplayMode:rn,revisionAuthorFilter:Rt,selection:()=>T,setScopeSelection:p=>{Ht(),rs(),jt(p),jo.clear(),T=p,j=null,bt=null,Ko();},noteModelMoved:()=>Ge.noteModelMoved(),render:()=>It(),mirrorToDom:()=>Ge.mirrorToDom(),notify:()=>n.onChange?.(St()),materializedPages:()=>on,entryRefused:()=>Le==="view",leaveOtherStories:()=>{ue?.exitNote(),qe?.exit();}}),ue=$O({session:a,exitHeaderFooter:()=>{De?.exitHeaderFooter(),qe?.exit();},applyOps:rt,commit:_e,selection:()=>T,selectionMark:()=>et(),orderedStart:()=>Of(),deleteSelectionPlan:()=>Hr(),undo:()=>Te.undo(),activeScope:()=>{let p=qe?.active();if(p)return p;let I=ue?.activeNoteScope();return I||(De?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:p=>De.setActiveScope(p),setSelection:p=>kt(p),noteModelMoved:()=>Ge.noteModelMoved(),render:()=>{Ut()||It();},revealNote:p=>{Ut();for(let I of ye.pages){let M=[...I.footnotes?.notes??[],...I.endnotes?.notes??[]].find(N=>N.scopeId===p);if(M)return as(M.box.y,M.box.height,{block:"nearest",offsetPx:48}),I.index}return null},notify:()=>n.onChange?.(St()),lastRejection:()=>X,setLastRejection:p=>{X=p===null?null:H(p);}});function cb(p){p&&Ht(),j=p,p&&(jt(p.text),rs(),T=p.text),bt=null,Ge.noteSelectionSettled(),Ge.mirrorToDom(),os(),jo.clear(),$i(),Ko(),n.onChange?.(St());}let fo=null;function v1(){let I=chunkDBOOTED4_cjs.qe(ke(),T.head)?.pageIndex??0,M=new Set;for(let N=I-1;N<=I+1;N+=1)N>=0&&N<ye.pages.length&&M.add(N);return M}function x1(){let p=a.revision(),I=on??v1();if(fo?.layout===ye&&fo.revision===p&&ch(fo.pages,I))return fo.rects;let M=I?chunkDBOOTED4_cjs.ze(ye,I):()=>true,N=[];for(let J of Bi()){if(J.kind==="comment"){if(J.range===null||!M(J.range.start.paragraphId,J.range.end.paragraphId))continue;N.push({key:chunkWO4V6PNS_cjs.Mj(J),from:{paragraphId:J.range.start.paragraphId,offset:J.range.start.offset},to:{paragraphId:J.range.end.paragraphId,offset:J.range.end.offset}});continue}let ae=chunkWO4V6PNS_cjs.Mj(J),he=J.kind==="revision"?J.ranges:J.range?[J.range]:[];for(let[Pe,Ee]of he.entries())M(Ee.start.paragraphId,Ee.end.paragraphId)&&N.push({key:he.length===1?ae:`${ae}${y}${Pe}`,from:{paragraphId:Ee.start.paragraphId,offset:Ee.start.offset},to:{paragraphId:Ee.end.paragraphId,offset:Ee.end.offset}});}let K=chunkDBOOTED4_cjs.Ae(ye,N,I,x),G=[];for(let[J,ae]of K)for(let he of ae)G.push({...he,key:J});return fo={layout:ye,revision:p,pages:I,rects:G},G}let jo=new Set,es=null,ts,ns=null,If=false,db=false;function rs(){If||(ns=null);}function ub(){let p=ns;if(!p||!T)return null;let I=(N,K)=>N.paragraphId===K.paragraphId&&N.offset===K.offset;if(!I(T.anchor,p.anchor)||!I(T.head,p.head))return null;let M=Bi().find(N=>chunkWO4V6PNS_cjs.Mj(N)===p.key);return !M||M.kind==="custom"&&!M.carded||M.kind==="revision"&&es!==null&&es.has(M.revisionKind)&&(M.revisionKind!=="format"||ts===void 0||ts.has(M.formattingKind??""))&&!db?null:M}function Rf(){let p=ub();if(p)return fb(p);if(!T)return null;let M=chunkWO4V6PNS_cjs.Vj(Bi(),T.anchor,T.head,l()).filter(N=>!(N.kind==="comment"&&N.resolved)&&!jo.has(chunkWO4V6PNS_cjs.Mj(N))&&!(N.kind==="custom"&&!N.carded)&&!(N.kind==="revision"&&es!==null&&es.has(N.revisionKind)&&(N.revisionKind!=="format"||ts===void 0||ts.has(N.formattingKind??""))))[0];return M?fb(M):null}function fb(p){if(p.kind!=="comment")return p;let I=chunkWO4V6PNS_cjs.Xj(Bi(),p);return jo.has(chunkWO4V6PNS_cjs.Mj(I))?null:I}function Bi(){return or.filterItems(a.reviewItems())}let pb=NE({roster:Q.get,styles:()=>lo,slots:O}),mb=pb.forAuthor,w1=pb.declaredFor;function S1(p,I,M){let N=p.split(y),K=N[0],G=I.has(K);if(p.startsWith("comment-")){let Ee=M.get(K),pe=Ee?.kind==="comment"&&Ee.resolved;return pe&&!G?null:G?`docx-comment-band docx-comment-band--active${pe?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(p.startsWith("custom-"))return G?"docx-comment-band docx-comment-band--active":null;let J=M.get(K);if(!J||J.kind!=="revision")return null;let ae=N.length>1?Number(N[1]):0;return `docx-revision-band docx-revision-band--${(Ee=>Ee==="delete"||Ee==="moveFrom"?"delete":Ee==="insert"||Ee==="moveTo"?"insert":Ee==="replace"&&J.replacedRangeCount!==void 0?ae<J.replacedRangeCount?"delete":"insert":"other")(J.revisionKind)}${G?" docx-revision-band--active":""}`}let gb=null,hb,yb=null;function $i(p=false){let I=Rf(),M=I&&chunkWO4V6PNS_cjs.Mj(I),N=lu(Bi,M,n.pairsReplacements?.()),K=[...N].join(`
29
+ `),G=Q.get();if(!p&&gb===ye&&hb===K&&yb===G.resolved)return;let J=ET(Bi()),ae=[];for(let he of x1()){let Pe=S1(he.key,N,J);if(!Pe)continue;let Ee=he.key.split(y)[0],pe=J.get(Ee),ft=pe?dh(pe):null,Pn=ft===null||ft===""?void 0:G.resolved.get(ft),Gt=pe?.kind==="revision"&&N.has(Ee)?Pn?.style?.activeBackground:void 0;ae.push({...he,className:Pe,...Pn?{reviewAuthor:Pn}:{},...Gt!==void 0?{activeBackground:Gt}:{}});}chunkXMJKFURD_cjs.s($,ye,ae,{scale:u,...Tt?{pageOffsetX:Tt.pageOffsetX}:{}}),gb=ye,hb=K,yb=G.resolved;}function os(){Ot?.update();let p=j?chunk5JPIEN54_cjs.na(ye,j.cellIds):ve?chunkDBOOTED4_cjs.xe(ke(),ve,at(),x):bP(ke(),T,at,x);chunkXMJKFURD_cjs.s(A,ye,p,{scale:u,pageOffsetX:Tt?.pageOffsetX,...j?{}:{className:ve?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function bb(p){return {layer:p,layout:ye,revision:a.packageRevision(),scale:u,measurer:x,...on?{pages:on}:{},...Tt?{pageOffsetX:Tt.pageOffsetX}:{}}}function rc(){U?.(bb(W));}function oc(){if(!df){_.replaceChildren();return}let p=c;if(!p){_.replaceChildren();return}qE(_,ye,p.remoteSelections(),{scale:u,pageOffsetX:Tt?.pageOffsetX,...on?{pages:on}:{},colorForAuthor:mb,declaredColorFor:w1,labelHost:uf,measurer:x});}function ic(p){let I=chunkWO4V6PNS_cjs.Uf(a.part());if(p)return I.find(K=>K.id===p)??null;let M=Xa?I.find(K=>K.id===Xa):void 0;if(M)return M;let N=T.head.paragraphId;return I.find(K=>K.beginParagraphId===N||K.endParagraphId===N||K.resultParagraphIds.includes(N))??(I.length===1?I[0]:null)}function Pf(){return Jk(a.part(),T)}function vb(p){return eI(a.part(),p)}function xb(){return new Set(chunkWO4V6PNS_cjs.Uf(a.part()).flatMap(p=>[p.beginParagraphId,...p.resultParagraphIds,p.endParagraphId]))}function Tf(p){return new Set([p.beginParagraphId,p.endParagraphId,...p.resultParagraphIds])}function k1(p){let I=0;for(let M of ye.pages)for(let N of chunkDBOOTED4_cjs.za(M))p.has(N.paragraphId)&&(I+=N.lines.length);return I}function Ef(p,I){let M=new Set(I),N=new Map;for(let K of p.pages)for(let G of chunkDBOOTED4_cjs.za(K)){if(!M.has(G.paragraphId)||N.has(G.paragraphId))continue;let J=K.pageFieldSource;N.set(G.paragraphId,chunkDBOOTED4_cjs.gc(J?.pageNumber??K.index+1,J?.format));}return N}function Cf(p){if(Le==="view"||!a.editable)return false;let I=ic(p);return !I||!chunkWO4V6PNS_cjs.Wf(a.part(),a.documentOutline(),I.instruction)?false:chunkWO4V6PNS_cjs.ol(a.part(),{op:"rewriteTocPageNumbers",tocId:I.id,updates:[]})===null}function wb(p,I){if(!Number.isInteger(p)||!Number.isInteger(I)||p<1||I<1)return null;let M=lt.sectionPropertiesAt(T.head.paragraphId),N=M.pageSize.widthTwips-M.margins.leftTwips-M.margins.rightTwips-M.margins.gutterTwips,K=Math.max(300,Math.floor(N/I));return {op:"insertTable",beforeParagraphId:T.head.paragraphId,rows:p,cols:I,columnWidthTwips:K}}function Sb(p,I){if(qe?.active()||Le==="view"||!a.editable)return false;let M=wb(p,I),N=a.partFor(Oe())??a.part();return M!==null&&chunkWO4V6PNS_cjs.ol(N,M)===null}function I1(p,I){if(!Sb(p,I))return false;let M=wb(p,I);if(!M)return false;let N=null,K=a.subscribe(J=>{J.caret&&(N=J.caret);}),G=false;try{_e(()=>{let J=rt([M],et());return J.committed||(X=H(J.reason??"the table could not be inserted here",J.reason??"table-insert-refused")),G=J.committed,J},()=>{let J=N;return J?Ke({paragraphId:J.paragraphId,offset:J.start}):null});}finally{K();}return G}let kb='TOC \\o "1-3" \\h';function Ib(){let p=chunkWO4V6PNS_cjs.Sf(kb);if(!p)return null;let I=a.documentOutline(),M=chunkWO4V6PNS_cjs.xg(a.part(),I,p,Ef(Te.layout(),I.map(N=>N.blockId)),xb(),c?.identity.actorId);return {op:"insertToc",beforeParagraphId:T.head.paragraphId,instruction:kb,alias:Va?.title??"TOC",entries:M.entries,bookmarksToCreate:M.bookmarksToCreate}}function Rb(){if(Le==="view"||!a.editable||Pf())return false;let p=Ib();return p!==null&&chunkWO4V6PNS_cjs.ol(a.part(),p)===null}function R1(){if(!Rb())return false;let p=Ib();if(!p)return false;let I=new Set(chunkWO4V6PNS_cjs.Uf(a.part()).map(K=>K.id)),M=Ja([p],void 0,void 0,ec);if(!M.committed)return X=H(M.reason??"the table of contents could not be inserted",M.reason??"table-of-contents-refused"),false;let N=chunkWO4V6PNS_cjs.Uf(a.part()).find(K=>!I.has(K.id));return N?Pb(N.id,"pageNumbers"):true}function Pb(p,I="entire"){let M=ic(p);if(!M||!Cf(M.id))return false;let N=Te.layout(),K=a.documentOutline(),G=chunkWO4V6PNS_cjs.Wf(a.part(),K,M.instruction);if(!G)return false;let J=G.map(he=>he.blockId);if(I==="entire"){let he=chunkWO4V6PNS_cjs.xg(a.part(),K,M.instruction,Ef(N,J),Tf(M),c?.identity.actorId),Pe=Ja([{op:"replaceTocResult",tocId:M.id,entries:he.entries,bookmarksToCreate:he.bookmarksToCreate}],void 0,void 0,ec);if(!Pe.committed)return X=H(Pe.reason??"the table of contents could not be refreshed",Pe.reason??"table-of-contents-refused"),false;if(N=Te.layout(),M=ic(M.id),!M)return true}let ae="";for(let he=0;he<3;he+=1){let Pe=Ef(N,J),Ee=chunkWO4V6PNS_cjs.zg(a.part(),M,K,Tf(M)),pe=M.resultParagraphIds.flatMap((Gt,_r)=>{let lc=Ee[_r],ss=lc?Pe.get(lc):void 0;return ss===void 0?[]:[{paragraphId:Gt,pageNumberText:ss}]});if(pe.length===0)break;let ft=pe.map(Gt=>`${Gt.paragraphId}\0${Gt.pageNumberText}`).join("");if(ft===ae)break;ae=ft;let Pn=Ja([{op:"rewriteTocPageNumbers",tocId:M.id,updates:pe}],void 0,void 0,ec);if(!Pn.committed){if(Pn.rejected)return X=H(Pn.reason??"the table of contents page numbers were refused",Pn.reason??"table-of-contents-refused"),false;break}N=Te.layout(),M=ic(M.id)??M;}return true}function P1(){return gE({session:a,editingMode:Le,collaborationActive:c!==void 0,reviewerFilterActive:or.filterForSession(a)!==void 0,layout:Te.layout(),canonicalUnfilteredLayout:Mr,styleCascade:nr(),numberingIndex:Er(),displayMode:rn()})}let{selectionMark:et,orderedRange:Nr,orderedStart:Of,textOf:zt,atomicControlDeletion:T1,splitEndsTheParagraph:E1,deleteSelectionPlan:Hr,deleteSelectionOps:C1,deleteRangePlan:O1,replacementOffset:Mf}=QC({session:a,layout:ke,selection:()=>T,cellSelection:()=>j,editingMode:()=>Le,author:()=>d,trackedDate:h,storyScope:Oe,paragraphOrder:at,flushPendingInputAndLayout:Ye,trackedAuthorOrNone:Sf,atParagraphEnd:(p,I)=>ql.atParagraphEnd(p,I),revisionView:sb}),{insertPlainText:Tb,copyFlavoursNow:M1,pasteRichNow:A1,armForcePlainPaste:F1}=XC({session:a,textFormFieldId:()=>Ot?.fieldId()??null,richPasteAllowed:()=>!qe?.active(),paragraphIds:Mi,layout:ke,cellSelection:()=>j,editingMode:()=>Le,storyScope:Oe,paragraphOrder:at,actorId:()=>c?.identity.actorId,collaborationGate:(p,I)=>c?.gateOperations(p,I)??null,now:yt,flushPendingInputAndLayout:Ye,orderedRange:Nr,selectionMark:et,deleteSelectionPlan:Hr,consumePendingFormatOps:Fo,withoutPendingOnRejection:un,caretMark:Dr,commit:_e});function is(p){p&&(Ve=null,Ye(),yn=Cr(Rt()),ct.invalidateAll(a.packageRevision(),"tracked-change-filter"),ct.flush(),n.onChange?.(St()));}let po=false,Te={session:a,applyGatedTreeOps:(p,I,M,N)=>Ja(p,I,M,N??Oe()),storyScope:Oe,imageDecodePort:()=>Li,textMeasurer:()=>x,layout:()=>(Ye(),ye),state:St,currentPage:(p="caret")=>{if(Ye(),p==="viewport"){let M=TE(e,ye,u);if(M!==null)return M}let I=chunkDBOOTED4_cjs.qe(ke(),T.head);return I?I.pageIndex+1:1},automationWriteRefusal:(p,I)=>dr(p.some(ib)||I,p,false),setScale(p){if(!(p>0)||!Number.isFinite(p))return false;if(p===u)return true;let I={scale:u,defaults:v,measurer:x,producer:P,furnitureSource:yn};try{let M=$t(e),N=M?{x:(M.scrollLeft-e.offsetLeft+M.clientWidth/2)/u,y:(M.scrollTop-e.offsetTop+M.clientHeight/2)/u}:null;if(u=p,n.measurer||(v=chunk5JPIEN54_cjs.X(u,{context:wi(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=v.measurer),P=C(),yn=Cr(Rt()),on=void 0,Tt=void 0,fo=null,ct.invalidateAll(a.packageRevision(),"zoom"),ct.flush(),jy(),M&&N){let K=Math.max(0,N.x*u+e.offsetLeft-M.clientWidth/2),G=Math.max(0,N.y*u+e.offsetTop-M.clientHeight/2),J=Number.isFinite(M.scrollWidth)?Math.max(0,M.scrollWidth-M.clientWidth):null,ae=Number.isFinite(M.scrollHeight)?Math.max(0,M.scrollHeight-M.clientHeight):null;M.scrollLeft=J===null?K:Math.min(K,J),M.scrollTop=ae===null?G:Math.min(G,ae),Ql();}return !0}catch{(({scale:u,defaults:v,measurer:x,producer:P,furnitureSource:yn}=I)),on=void 0,Tt=void 0,fo=null;try{ct.invalidateAll(a.packageRevision(),"zoom-rollback"),ct.flush();}catch{}return false}},enqueueType:co,flushPendingInput:Ye,type(p){let I=Hr(),M=I.replaceAt??I.collapseTo,N=Fo(M.paragraphId,M.offset,p.length),K=I.ops.length===0?LT(uo()):void 0,G=[...I.ops,DT(M,p,K)],J=FT(Ce(a,M.paragraphId)??a.part(),M.paragraphId,M.offset,p.length),ae={paragraphId:M.paragraphId,start:J,end:J};_e(()=>un([...G,...N],G,et(),ae),()=>Ke({paragraphId:M.paragraphId,offset:J}));},proposeTextChange:(p,I,M)=>$o(p,I,M),replaceTextInPlace:Ul,insertPlainText:p=>Tb(p),deleteBackward(){if(Ot?.selectForDeletion("backward")||kf("backward"))return;let p=Hr();if(p.ops.length>0){_e(()=>rt(p.ops,et(),Dr(p.collapseTo)),()=>Ke(p.collapseTo));return}if(lb("backward"))return;let I=Et()??void 0,M=Vt.shown(T.head);if(M.offset===0){for(let he of chunkDBOOTED4_cjs.Qa(ke(),M.paragraphId)){let Pe=zt(he);if(Pe.length!==0){_e(()=>rt([{op:"deleteText",paragraphId:he,start:Pe.length-1,end:Pe.length}],et(),Dr({paragraphId:he,offset:Pe.length-1})),()=>Ke({paragraphId:he,offset:Pe.length-1}),{rearmPending:I});return}}let N=at(),K=N.indexOf(M.paragraphId),G=N[K-1];if(!G)return;let J=Vt.joinOps(G,M.paragraphId);if(!J){kt(Ke({paragraphId:G,offset:zt(G).length}));return}let ae=zt(G).length;_e(()=>rt(J,et(),Dr({paragraphId:G,offset:ae})),()=>Ke({paragraphId:G,offset:ae}),{rearmPending:I});return}_e(()=>rt([{op:"deleteText",paragraphId:M.paragraphId,start:M.offset-1,end:M.offset}],et(),Dr({...M,offset:M.offset-1})),()=>Ke({...M,offset:M.offset-1}),{rearmPending:I});},splitParagraph(){let p=Hr(),I=p.replaceAt??p.collapseTo,M=Et()??{properties:wa(Ce(a,I.paragraphId)??a.part(),I.paragraphId,I.offset,rn(),Rt()),base:[]},N=E1(I),K=N?ql.followerStyleId(I.paragraphId):void 0,G=chunkWO4V6PNS_cjs.Wh(M.base,M.properties,$n(I.paragraphId,I.offset)),J=N&&Le==="edit"&&G.length>0?[{op:"setParagraphMarkProperties",paragraphId:I.paragraphId,properties:G}]:[],ae={op:"splitParagraph",paragraphId:I.paragraphId,offset:I.offset,tailStyleId:K},he=Sf(),Pe=he?{author:he,date:h()}:void 0,Ee=a.documentStyles(),pe=ru(Ee),ft=pe??"ListParagraph",Pn=new Set(Ee.map(Br=>Br.styleId));for(let Br=1;!pe&&Pn.has(ft);Br++)ft=`ListParagraph${Br}`;let Gt=Le!=="view"&&p.ops.every(Br=>Br.op==="deleteText"&&Br.paragraphId===I.paragraphId)&&K===void 0?UP(Ce(a,I.paragraphId)??a.part(),ye,I,G,ft,nr(),Pe,c?.identity.actorId):null,_r=Pe?[{op:"setParagraphMarkRevision",paragraphId:I.paragraphId,kind:"ins",revision:Pe}]:[],lc=Gt?[Gt,...J,..._r]:[ae],ss=Gt?new Set(Mi()):null;UT(a,I.paragraphId,Br=>_e(()=>un([...p.ops,...J,...lc],[...p.ops,...Gt?[Gt,..._r]:[ae]],et(),void 0,Gt&&!pe?[YP(nr()?.defaultParagraphStyleId??null,ft)]:void 0),()=>{if(!ss)return Br();let Hb=Mi().filter($1=>!ss.has($1)),_b=Gt?Hb.at(-1):Hb[0];return _b?Ke({paragraphId:_b,offset:0}):null},{rearmPending:M}),Bl);},navigate(p,I=false){if(Ye(),!I&&(p==="left"||p==="right")&&(T.anchor.paragraphId!==T.head.paragraphId||T.anchor.offset!==T.head.offset)){let pe=Nr();bt=null;let ft=_T(ke(),pe,at(),p,x);kt(Ke(ft),true);return}let M=ke(),N=Sm(M,Vt.shown(T.head),p,bt,De?.getActive()??null,Ai(),x,Ge.selectionLineId());if(!N)return;let K=xb(),G=tI(a.part(),N.position,["left","wordLeft","lineStart","up","pageUp"].includes(p));if(G&&(N={...N,position:G,caret:void 0}),E){let pe=PO(M,T.head,N.position);pe!==N.position&&(N={...N,position:pe,caret:void 0});}if(Mn(a.part(),N.position)){if(I)return;let ft=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(p)?"up":"down",Pn=k1(K)+4;for(let Gt=0;Gt<Pn;Gt+=1){let _r=Sm(ke(),N.position,ft,N.desiredX,De?.getActive()??null,Ai(),x);if(!_r||_r.position.paragraphId===N.position.paragraphId&&_r.position.offset===N.position.offset)return;if(N=_r,!Mn(a.part(),N.position))break}if(Mn(a.part(),N.position))return}bt=N.desiredX,ue?.activeNoteScope()&&N.pageIndex!==void 0&&Number.isInteger(N.pageIndex)&&ue.setActiveNotePageIndex(N.pageIndex);let ae={anchor:I?Vt.shown(T.anchor):N.position,head:N.position},he=I&&!E?ae:Tl(M,ae,{atomic:I&&E}),Pe=!I&&!At(he,ae),Ee=T;kt(he,true,Pe?"none":"head",Pe?void 0:N.caret),Pe&&(T!==Ee||At(T,he))&&mf(T.anchor);},deleteWordBackward(){if(Te.deleteSelection())return;let p=T.head,I=(Ot?.wordDeletionBoundary??chunkDBOOTED4_cjs.ke)(zt(p.paragraphId),p.offset,-1,chunkDBOOTED4_cjs.te(ke(),p.paragraphId));if(I===p.offset){Te.deleteBackward();return}_e(()=>rt([{op:"deleteText",paragraphId:p.paragraphId,start:I,end:p.offset}],et()),()=>Ke({...p,offset:I}),{rearmPending:Et()??void 0});},deleteWordForward(){if(Te.deleteSelection())return;let p=T.head,I=(Ot?.wordDeletionBoundary??chunkDBOOTED4_cjs.ke)(zt(p.paragraphId),p.offset,1,chunkDBOOTED4_cjs.te(ke(),p.paragraphId));if(I===p.offset){Te.deleteForward();return}_e(()=>rt([{op:"deleteText",paragraphId:p.paragraphId,start:p.offset,end:I}],et()),void 0,{rearmPending:Et()??void 0});},deleteForward(){if(Ot?.selectForDeletion("forward")||kf("forward")||Te.deleteSelection()||lb("forward"))return;let p=Et()??void 0,I=Vt.shown(T.head),M=zt(I.paragraphId);if(I.offset<M.length){_e(()=>rt([{op:"deleteText",paragraphId:I.paragraphId,start:I.offset,end:I.offset+1}],et()),void 0,{rearmPending:p});return}let N=at(),K=N[N.indexOf(I.paragraphId)+1];if(K){if(chunkDBOOTED4_cjs.Qa(ke(),K).includes(I.paragraphId)){if(zt(K).length===0)return;_e(()=>rt([{op:"deleteText",paragraphId:K,start:0,end:1}],et()),()=>Ke(I),{rearmPending:p});return}_e(()=>rt(Vt.forwardJoinOps(I.paragraphId,K)??[{op:"joinParagraphs",firstId:I.paragraphId,secondId:K}],et()),()=>Ke(I),{rearmPending:p});}},...lt,...He,setSelection:p=>{At(p,T)||q({kind:"programmatic"},false),hn.discard(),kt(p);},selectDrawing(p,I){Ut();let M=Ea(ye,p,I);if(!M)return false;let N=Ke(M);return q({kind:"pointer",drawingNodeId:p},At(N,T)),kt(N,true,"none"),Fn(Te)?.drawingNodeId===p},revealPage(p,I){Ut();let M=ye.pages.find(N=>N.index===p);return M?as(M.box.y,M.box.height,I):false},revealParagraph(p,I){Ut();let M=chunkDBOOTED4_cjs.qe(ke(),{paragraphId:p,offset:0});if(!M)return false;let N=ye.pages.find(K=>K.index===M.pageIndex);return N?as(N.contentBox.y+M.y,M.height,I):false},revealPosition(p,I){Ut();let M=chunkDBOOTED4_cjs.qe(ke(),p);if(!M)return false;let N=ye.pages.find(G=>G.index===M.pageIndex);if(!N)return false;let K=ol(N,p.paragraphId).y+M.y;return as(K,M.height,{block:"nearest",...I})},setEditable(p){xf=p,p||qe?.exit(),vf();},selectAll(){let p=at(),I=p[0],M=p[p.length-1];!I||!M||kt({anchor:{paragraphId:I,offset:0},head:{paragraphId:M,offset:zt(M).length}});},hyperlinks:Pt,equations:Ne,contentControls:Lr,formatPainter:xe,canInsertTable:Sb,insertTable:I1,canInsertToc:Rb,insertToc:R1,canRefreshToc:Cf,canEditTextFormField:()=>Ot?.canEdit()??false,editTextFormField:()=>Ot?.edit()??false,refreshToc:Pb,refreshRefFieldResults:P1,save:()=>XT(Te,e,()=>po),saveSteps:()=>YT(Te,e,()=>po),isInsideToc:p=>oI(a.part(),p),retainSelection:()=>{let p=Symbol("selection-pin");return Re.set(p,T),ve=T,os(),p},releaseSelection:p=>{Re.delete(p)&&(ht(),os());},retainedSelection:()=>ve,publishedLayout:()=>ye,drawingSelectionIntent:()=>B,overlayCoordinates:()=>Object.freeze({paintScale:u,pageOffsetX:Tt?.pageOffsetX??new Map}),commitReviewOps:(p,I)=>{Ye();let M=T.head.paragraphId,N=zt(M);return _e(()=>{if(Le==="view")return {committed:false,rejected:true,opCount:0,reason:m};if(c&&(I===void 0||!GP.has(I)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(c){let he=c.gateOperations([],Oe());if(he)return {committed:false,rejected:true,opCount:0,reason:he}}let K=c?.identity.actorId,G=chunkWO4V6PNS_cjs.Hb(K,()=>p(z.value)),J=typeof G.reason=="string"?{reason:G.reason}:{},ae=G.committed;return {committed:ae,rejected:!ae,opCount:0,...J}},()=>{Ut(),Ge.noteModelMoved();let K=at();if(K.length===0)return null;let G=Il(T,M,N,zt(M));return To(ke(),K,G)})},revisionDisplayMode:jl,replacementLanding:Ue,applyAutomationOps:(p,I,M,N=false)=>{let K=null,G=I??ec,ae=_e(()=>{let he=dr(false);if(he!==null)return K={committed:false,rejected:true,opCount:0,reason:he};let Pe=null,Ee=p(pe=>{let ft=dr(true,[],false);return ft===null?chunkWO4V6PNS_cjs.Hb(c?.identity.actorId,()=>a.ensureHyperlinkRelationship(pe,G)):(Pe=ft,null)});return Ee===null?K={committed:false,rejected:true,opCount:0,reason:Pe??"this engine will not author that hyperlink target"}:!n.reviewModel&&(N||Ee.some(xl))?K={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:K=rt(Ee,void 0,void 0,G,false,M)},()=>{Ut(),Ge.noteModelMoved();let he=at();return he.length===0?null:To(ke(),he,T)},{automation:true})??ml;return K??{committed:false,rejected:true,opCount:0,reason:ae}},editingMode:()=>Le,author:()=>d,setAuthor:p=>{d!==p&&(Ht(),d=p,p?.trim()&&fE(X)&&(X=null,n.onChange?.(St())));},setDrawingStrings:p=>{Di!==p&&chunkXMJKFURD_cjs.k(Di)!==chunkXMJKFURD_cjs.k(p)&&(Di=p,Ye(),It(false));},setLocale:tc.set,setTranslate:p=>{if(Qa===p)return;Qa=p,Bg(S,p),Ot?.update();let I=chunkXMJKFURD_cjs.f(p),M=chunkXMJKFURD_cjs.g(I)!==chunkXMJKFURD_cjs.g(Ni);Ni=I,M&&pn.get()&&(Ye(),It(false));},setTocLabels:p=>{Va=p;},setEditingMode:p=>{Ye();let I=Le!==p;Le=p,I&&p!=="edit"&&qe?.exit(),I&&p==="view"&&De?.exitHeaderFooter(),I&&p==="view"&&ue?.exitNote(),I&&p==="view"&&xe.disarm(),Yl(),vf(),wm(e,Le),I&&It(false),X=null,n.onChange?.(St());},revisionAuthors:()=>Q.get().value,setRevisionDisplayMode(p){po||p===rr.view()||(Ye(),rr.set(p),is(true));},hiddenRevisionAuthors:()=>or.hiddenAuthors,setRevisionAuthorVisible(p,I){is(or.setVisible(p,I));},setAllRevisionAuthorsVisible(p){is(or.setAllVisible(Q.get().value.keys(),p));},showAllRevisionAuthors(){is(or.showAll());},setTrackedChangesFilter(p,I){is(or.setPredicate(p,I));},collaborationSession:()=>c??null,remotePresenceColor:mb,setShowParagraphMarks:pn.set,setRevisionMarkup:No.set,setRevisionStyles:p=>{p!==lo&&(lo=p,Ye(),It(false));},setHighlightPainter(p){U=p,p||W.replaceChildren(),rc();},repaintHighlights:rc,setRemoteCaretLabelHost:p=>{p!==uf&&(uf=p,oc());},setReviewActivationExclusions(p,I){ts=I?.formattingKinds?new Set(I.formattingKinds):void 0,es=p===null?null:new Set(p),$i(),n.onChange?.(St());},activeReviewKey:()=>{let p=Rf();return p?chunkWO4V6PNS_cjs.Mj(p):null},activateReview:(p,I,M)=>{if(jo.clear(),db=M?.allowExcluded??false,ns=I?{key:p,anchor:I.anchor,head:I.head}:{key:p,anchor:T.anchor,head:T.head},I){let N=()=>{If=true;try{kt(I,!1,M?.preventScroll?"none":"caret");}finally{If=false;}};M?.preventScroll?Vl(N):N();return}$i(),n.onChange?.(St());},activatedReviewKey:()=>ub()===null?null:ns?.key??null,dismissActiveReview:()=>{let p=Rf();p&&(jo.add(chunkWO4V6PNS_cjs.Mj(p)),ns=null,$i(),n.onChange?.(St()));},navigation:nt,bookmarkEditing:Or,bookmarks:()=>a.bookmarks(),selectedText(){if(j)return fP(ye,j);let{from:p,to:I}=Nr();return uP(ke(),p,I,at())},copyFlavours:()=>M1(),pasteRich:(p,I)=>A1(p,I),armForcePlainPaste:F1,deleteSelection(){if(!At(T,Ke(T.head))&&kf("backward"))return true;let I=Hr();return I.ops.length===0?false:(_e(()=>rt(I.ops,et(),Dr(I.collapseTo)),()=>Ke(I.collapseTo)),true)},setCellSelection:cb,layoutSession:()=>R,undo:()=>{if(Le==="view"||Qn(e)){X=H(m),n.onChange?.(St());return}Ht(),Y.end(),c?.flushPendingJournals(),Je.step("undo",Me,()=>Se("undo"));},redo:()=>{if(Le==="view"||Qn(e)){X=H(m),n.onChange?.(St());return}Ht(),Y.end(),c?.flushPendingJournals(),Je.step("redo",Me,()=>Se("redo"));},sectionAtPage:fn,activeScope:()=>{let p=qe?.active();if(p)return p;let I=ue?.activeNoteScope();return I||De.activeScope()},setActiveScope:p=>(Ye(),p.kind==="frame"?qe.enter(p):p.kind!=="body"&&p.kind!=="headerFooter"&&p.kind!=="note"?false:(qe?.exit(),p.kind==="note"?ue.enterNote(p.id):(ue?.exitNote(),De.setActiveScope(p)))),insertNote:p=>(Ye(),ue.insertNote(p)),deleteNote:(p,I)=>ue.deleteNote(p,I),convertNote:(p,I)=>ue.convertNote(p,I),convertAllNotes:p=>ue.convertAllNotes(p),setNoteProperties:p=>ue.setNoteProperties(p),enterNote:(p,I)=>(Ye(),ue.enterNote(p,I)),exitNote:()=>(Ye(),ue.exitNote()),notePropertiesState:()=>{let p=Te.state().selection.head.paragraphId,I=a.packageRevision(),M=a.currentPackage(),N=a.part(),K=chunkWO4V6PNS_cjs.ah(M),G=chunkWO4V6PNS_cjs.lh(M,"footnote"),J=chunkWO4V6PNS_cjs.lh(M,"endnote"),ae=Te.activeScope().kind==="headerFooter",he=Te.headerFooterState(),Pe=he?.rId??null,Ee=he?.sectionIndex??null,pe=Ve;if(pe&&pe.packageRevision===I&&pe.paragraphId===p&&pe.bodyPart===N&&pe.settingsPart===K&&pe.footnotesPart===G&&pe.endnotesPart===J&&pe.headerFooterOpen===ae&&pe.headerFooterRId===Pe&&pe.headerFooterSectionIndex===Ee)return pe.result;let ft=vM(Te,Rt());return Ve={packageRevision:I,paragraphId:p,bodyPart:N,settingsPart:K,footnotesPart:G,endnotesPart:J,headerFooterOpen:ae,headerFooterRId:Pe,headerFooterSectionIndex:Ee,result:ft},ft},notePreviewText:p=>xM(a,p),applyTableCommandPlan(p){if(!p.ok)return {ok:false,code:p.code,reason:p.reason};let I=null,M=a.subscribe(N=>{N.caret&&(I=N.caret);});try{let N=et(),K=p.selection.kind==="adoptCommittedCaret";_e(()=>rt(p.ops,N),K?()=>{let G=I;return G?Ke({paragraphId:G.paragraphId,offset:G.start}):null}:void 0,p.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{M();}return X?{ok:false,code:"invalidArgs",reason:X}:{ok:true,changed:true}},enterHeaderFooter:p=>{Ye();let I=De.enterHeaderFooter(p);if(!I)return I;let M=De.getActive(),N=M?ye.pages[M.pageIndex]:void 0;if(M&&N){let K=M.kind==="header"?N.header:N.footer,G=K?.box.y??(M.kind==="header"?N.box.y:N.box.y+N.box.height-1),J=K?.box.height??1;as(G,J,{block:"nearest"});}return I},exitHeaderFooter:()=>(Ye(),De.exitHeaderFooter()),headerFooterState:()=>De.headerFooterStateStable(a.packageRevision()),...pM({applyOps:rt,commit:_e,deleteSelectionOps:C1,deleteSelectionPlan:()=>Hr(),orderedStart:Of,selectionMark:et,collapsedAt:Ke,isHeaderFooterOpen:()=>De?.getActive()!==null,lastRejection:()=>X}),...gM({session:a,applyOps:rt,commit:_e,storyScope:Oe,selectionMark:et,editingMode:()=>Le,author:()=>d,trackedDate:h,decodePort:()=>Li,actorId:()=>c?.identity.actorId}),focus:()=>{S.ownerDocument.activeElement!==S&&(S.focus({preventScroll:true}),Ge.mirrorToDom(true));},setTableInteractionLabel(p){f.resolve=p;},refreshTableInteractionLabels(){qi.refreshLabels();},moveTo:_i.moveTo,park:_i.park,parked:_i.parked,hostElement:()=>e,destroy(){if(!po){po=true,qn.cancel(),$y.cancel();try{Gl();}finally{S.removeEventListener("pointerdown",Nb,{capture:true}),S.removeEventListener("keydown",sc,{capture:true}),S.removeEventListener("keydown",Lo,{capture:true}),S.removeEventListener("pointerdown",Lo,{capture:true}),S.removeEventListener("beforeinput",sc,{capture:true}),S.removeEventListener("keydown",Mb),B1(),S.removeEventListener("beforeinput",Db),S.removeEventListener("copy",Ab),S.removeEventListener("cut",Fb),S.removeEventListener("paste",Lb),S.removeEventListener("compositionstart",Cb),S.removeEventListener("compositionend",Eb),Ya?.destroy(),F.clear(),_i.destroy(),Yl(),hf.destroy(),qo.destroy(),Ot?.destroy(),nc?.destroy(),wf?.destroy(),ac?.destroy(),qi.destroy(),nt.destroy(),Dt.destroy(),Ge.destroy(),S.removeEventListener("contextmenu",Jy),S.removeEventListener("click",eb),S.removeEventListener("pointermove",zy),S.removeEventListener("pointerleave",Zy),Xe.destroy(),ct.cancel(),wt!==null&&st.clearTimeout(wt),wt=null,_o&&_o(),_o=null,Lt.dispose(),chunkXMJKFURD_cjs.j(S),te.destroy(),o1(),Wy(),qy(),r1(),e.replaceChildren();}}}};function L1(p){we=null;let I=Ot?.restoreAfterHistory();if(!p&&I&&(T=I),Ge.noteModelMoved(),Ut(),!p){kt(To(ke(),at(),T));return}if("anchor"in p){let N=at(),K=!c&&[p.anchor,p.head].every(G=>N.includes(G.paragraphId));kt(K?p:To(ke(),N,p));return}let M={anchor:{paragraphId:p.paragraphId,offset:p.start},head:{paragraphId:p.paragraphId,offset:p.end}};kt(at().includes(p.paragraphId)?M:To(ke(),at(),M));}function as(p,I,M){let N=$t(e);if(!N||N.clientHeight===0)return false;jy();let K=p*u+e.offsetTop,G=I*u,J=M?.offsetPx??24,ae=M?.block??"start",he=N.clientHeight;if(ae==="nearest"||ae==="centerIfNeeded"){let pe=K<N.scrollTop,ft=K+G>N.scrollTop+he;if(!pe&&!ft)return true}let Pe=ae==="center"||ae==="centerIfNeeded"?K-Math.max(0,(he-G)/2):ae==="nearest"&&K>N.scrollTop?K+G+J-he:K-J,Ee=Math.max(0,N.scrollHeight-he);return N.scrollTo({top:Math.max(0,Math.min(Pe,Ee)),behavior:M?.behavior??"auto"}),Ql(),true}let{onSelectionChange:D1,onCompositionEnd:Eb}=o.methods({...Ge}),Cb=(...p)=>{Ge.adoptBeforeInput(),Gl(),Ge.onCompositionStart(...p);},ac=null,N1=VT({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:tc.get,translate:(p,I)=>Qa?.(p,I)??p,pagesLayer:S,get container(){return e},listeners:F,part:p=>Ce(a,p??T.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(p=T.head.paragraphId)=>chunkWO4V6PNS_cjs.Ej(a.settingsRoot())&&chunkWO4V6PNS_cjs.Fj(Ce(a,p)??a.part(),p),selection:()=>T,select:(p,I)=>kt(p,false,I?"none":"caret"),reveal:mf,editable:()=>Le==="edit"&&!Rn,apply:p=>pu(p,_e,rt),save:(p,I)=>JT(p,I,{session:a,commit:_e,refusal:()=>dr(true,p,false),gate:(M,N)=>c?.gateOperations(M,N)??null,collaborationActive:c!==void 0})},r.initialTextFormInput);Ot=wE(N1,{part:p=>Ce(a,p),selection:()=>T,select:p=>kt(p),writable:()=>Le!=="view"&&!Rn,compare:Ae},o),BI(Te,Ot.fieldId),qI(Te,n.contentLockPolicy),wf=cE({pagesLayer:S,part:p=>Ce(a,p??T.head.paragraphId)??a.part(),editable:()=>Le==="edit"&&!Rn,protected:p=>chunkWO4V6PNS_cjs.Ej(a.settingsRoot())&&chunkWO4V6PNS_cjs.Fj(Ce(a,p)??a.part(),p),selection:()=>T,select:p=>kt(p,false,"none"),apply:p=>pu(p,_e,rt)}),nc=KP({pagesLayer:S,settings:()=>chunkWO4V6PNS_cjs.ah(a.currentPackage()),part:p=>Ce(a,p??T.head.paragraphId)??a.part(),editable:()=>Le==="edit"&&!Rn,select:p=>kt(p,false,"none"),canApply:p=>a.editable&&dr(true,[p],false)===null,history:p=>Te[p](),apply:p=>pu(p,_e,rt)});let H1=cC(Te,{...n,onToggleFieldCodes:()=>{Ye(),Rn=!Rn,yn=Cr(Rt()),ct.invalidateAll(a.packageRevision(),"field-code-view"),ct.flush();}}),Ob=wO(Te,()=>(Ce(a,T.head.paragraphId)??a.part()).root),Mb=p=>{Ob.keydown(p),!nc?.keydown(p)&&(p.defaultPrevented||Ge.adoptBeforeInput(),!(wf?.keydown(p)||Ot?.keydown(p))&&H1(p));},{onCopy:Ab,onCut:Fb,onPaste:Lb}=dC(Te),_1=uC(Te,{isComposing:()=>Ge.isComposing(),insertPlainText:Tb,onBrowserSelectionFixup:()=>{Ge.mirrorToDom(),Ge.noteBrowserSelectionFixup();}}),Db=p=>{Ge.adoptBeforeInput(),_1(p);},{onDrawingPointerGesture:Nb,onDrawingKeyGesture:sc}=IP({surface:Te,textbox:()=>qe,intent:()=>B,setIntent:p=>q(p,true)});S.addEventListener("pointerdown",Nb,{capture:true}),S.addEventListener("keydown",sc,{capture:true}),S.addEventListener("beforeinput",sc,{capture:true}),S.addEventListener("keydown",Lo,{capture:true}),S.addEventListener("pointerdown",Lo,{capture:true}),S.addEventListener("keydown",Mb);let B1=SO(S,Ob);S.addEventListener("beforeinput",Db),S.addEventListener("copy",Ab),S.addEventListener("cut",Fb),S.addEventListener("paste",Lb),S.addEventListener("compositionstart",Cb),S.addEventListener("compositionend",Eb),Ya=ME({pagesLayer:S,container:()=>e,listeners:F,onSelectionChange:D1,rematerialize:o.wrap(Ql)}),qe=_P({session:a,pagesLayer:S,layout:()=>ye,selection:()=>T,setSelection:p=>kt(p,false,"none"),flush:Ye,leaveOtherStories:()=>{ue?.exitNote(),De?.exitHeaderFooter();},writable:()=>xf&&Le==="edit"&&a.editable}),ac=CO({onTextFormDoubleClick:p=>Ot?.doubleClick(p)??false,onTextFormPointerUp:p=>Ot?.pointerUp(p),pagesLayer:S,get container(){return e},listeners:F,scale:()=>u,pageOffsetX:p=>Tt?.pageOffsetX.get(p)??0,layout:()=>(Wo=false,Jl.without(Ut),ke()),measurer:()=>x,selection:()=>Vt.shownSelection(T),setSelection:(p,I)=>kt(p,false,"none",I),cellSelection:()=>j,setCellSelection:p=>cb(p),focus:()=>S.focus({preventScroll:true}),onSelectionSettled:()=>xe.applyIfArmed(),selectionLocked:()=>Le==="view",activeHeaderFooter:()=>Hk(De?.getActive()??null),activeNote:()=>{let p=ue?.activeNoteScope();return p?{scopeId:p.id,pageIndex:ue?.activeNotePageIndex()??null}:null},enterHeaderFooter:p=>{Ye(),De?.enterHeaderFooter({rId:p.rId,pageIndex:p.pageIndex,sectionIndex:fn(p.pageIndex).sectionIndex,kind:p.kind,...p.position?{position:p.position}:{}});},enterNote:(p,I,M)=>{Ye(),ue?.enterNote(p,I,M);},exitNote:p=>{Ye(),ue?.exitNote(p);},exitHeaderFooter:()=>(Ye(),De?.exitHeaderFooter()),enterEmptyHeaderFooter:(p,I)=>{if(Le==="view")return;Ye();let M=De;M&&bM({session:a,layout:ye,sectionAtPage:fn,create:N=>Te.applyHeaderFooterLifecycle?.(N),flushLayout:Ut,enter:N=>M.enterHeaderFooter(N)},p,I);},onContentControlWidget:(p,I)=>g1(p,I),...n.reviewModel?{onChangeBarToggle:rr.toggleByChangeBar}:{},isReadOnlyPosition:p=>Mn(a.part(),p)!==void 0},{...n.pointer?{mode:n.pointer}:{},...E?{atomicInlineControls:true}:{}});let qi=gO({pagesLayer:S,furnitureLayer:Z,listeners:F,scale:()=>u,pageOffsetX:p=>Tt?.pageOffsetX.get(p)??0,read:()=>({layout:ye,storeRevision:a.packageRevision(),selection:T,cellSelection:j,editingMode:Le,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:p=>Te.applyTableCommandPlan(p),label:p=>f.resolve(p)});if(It(),nc?.sync(),df=true,oc(),c&&(Wy=c.subscribeStatus(()=>{n.onChange?.(St());})),c&&zl)try{qy=c.attach(zl);}catch{try{c.destroy();}catch{}}return Ko(),vf(),Te.setTableInteractionLabel=p=>{f.resolve=p,qi.refreshLabels();},Te.refreshTableInteractionLabels=()=>{qi.refreshLabels();},dT(Te,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),p=>{n={...n,...p},x=n.measurer??v.measurer,P=C();},()=>{po||(yn=Cr(Rt()),on=void 0,Tt=void 0,fo=null,ct.invalidateAll(a.packageRevision(),"fonts"),ct.flush());}),WP(Te,()=>Ge.isComposing()),ao=hT(Te,e,{now:yt,destroyed:()=>po,limit:()=>so,setLimit:p=>so=p,bodyBlockCount:()=>chunkDBOOTED4_cjs.Lf(R),bodyBlock:p=>chunkDBOOTED4_cjs.Mf(R)?.[p],prefixPass:p=>Nt(a.packageRevision(),void 0,void 0,p),finish:o.wrap(()=>{ct.invalidateAll(a.packageRevision(),"opening"),ct.flush(),so=null;})},EM),{ok:true,surface:o.methods(Te)}}function CM(e,t=()=>null){let n,r={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set,diagnostic:new Set,revisionMarkupChange:new Set,reviewItemReveal:new Set,hostChange:new Set},o=()=>{let c=t();if(c===n||n===void 0&&c===null)return;n=c;let d=Object.freeze({document:c});for(let u of [...r.hostChange])u(d);},i=0,a=false,s=[],l=c=>{i>0||a?s.push(c):c();};return {defer(c){i+=1;try{return c()}finally{if(i-=1,i===0&&!a){a=true;try{for(;s.length>0;){let d=s;s=[];for(let u of d)try{u();}catch{}}}finally{a=false;}}}},emitError(c,d){l(()=>{for(let u of [...r.error]){if(d&&!d())return;u(c);}});},emitDocumentChange(c){l(()=>{for(let d of [...r.change])d(c);});},emitSelectionChange(){l(()=>{if(o(),!r.selectionChange.size)return;let c=e();for(let d of [...r.selectionChange])d(c);});},emitHistoryDiagnostic(c){l(()=>{for(let d of [...r.historyDiagnostic])d(c);});},emitDiagnostic(c){l(()=>{for(let d of [...r.diagnostic])d(c);});},emitRevisionMarkupChange(c){l(()=>{for(let d of [...r.revisionMarkupChange])d(c);});},emitReviewItemReveal(c){l(()=>{let d=Object.freeze({...c});for(let u of [...r.reviewItemReveal])u(d);});},hasErrorHandlers:()=>r.error.size>0,hasDiagnosticHandlers:()=>r.diagnostic.size>0,clear(){s=[];for(let c of Object.values(r))c.clear();},on(c,d){return r[c].add(d),()=>{r[c].delete(d);}}}}var OM={"paragraph-count-unexplained":"edit.unmapped-change","paragraph-reordered":"edit.unmapped-change","unknown-paragraph-id":"edit.unmapped-change","unknown-content-moved":"edit.unmapped-change","unsupported-node":"edit.unsupported-content","split-not-clean":"edit.unmapped-change","join-not-clean":"edit.unmapped-change"},FM=new Map([["the document is open for viewing","edit.read-only"],["the document is read-only","edit.read-only"],["this content is locked","edit.protected-content"],[fi,"edit.read-only"],[pi,"edit.protected-content"],[mi,"edit.protected-content"],[Ld,"edit.protected-content"],[xr,"edit.suggesting-needs-author"],[rg,"edit.suggesting-needs-author"],[nn,"edit.review-module-required"],[LI,"edit.unsupported-content"],[lh,"edit.unsupported-story"],[Ia,"edit.field-structure"],[Cl,"edit.tracked-structure-unsupported"],[Da,"edit.section-mark"],[Bu,"edit.protected-content"],[Ol,"edit.protected-content"],[$g,"edit.refresh-in-progress"],[eo,"edit.preview-active"],["invalid note scope id","edit.stale-target"],[Qm,"edit.tracking-required"],[Js,"edit.tracked-image-replace-unsupported"],[ug,"edit.picture-selected"],[pa,"edit.revision-unsupported"],["note not found","edit.stale-target"]]);function Ha(e){let t=String(e??"refused");return FM.get(t)??t}function _a(e,t){return (Object.hasOwn(OM,e)?OM[e]:void 0)??chunkYQWMI6J5_cjs.t(e)??FM.get(e)??(t!==void 0&&Object.hasOwn(MM,t)?MM[t]:void 0)??"edit.refused"}var MM={notFound:"edit.stale-target",ambiguous:"edit.invalid-argument",locked:"edit.protected-content",bound:"edit.protected-content",typeMismatch:"edit.invalid-argument",kindMismatch:"edit.invalid-argument",outOfBounds:"edit.invalid-argument",unsupported:"edit.unsupported-content",invalidArgs:"edit.invalid-argument"},AM={wasmUnavailable:"font.shaper-unavailable",initializationFailed:"font.shaper-unavailable",missing:"font.missing",forbidden:"font.load-failed",overLimit:"font.size-limit",malformed:"font.malformed",fontFaceLoadFailed:"font.load-failed",loadFailed:"font.load-failed",missingFont:"font.missing",hashMismatch:"font.integrity-mismatch",hashInvalid:"font.integrity-mismatch",metadataMismatch:"font.integrity-mismatch",fontMismatch:"font.integrity-mismatch",unsupportedFaceIndex:"font.unsupported-face",unsupportedFace:"font.unsupported-face"};function LM(e){return e!==void 0&&Object.hasOwn(AM,e)?AM[e]:"font.load-failed"}var Yh=Object.freeze([16,33,50,100,200,500,1e3]),DM=2048,yB=6e4,bB=200,vB=20,xB=256,wB=6e4;function SB(){return {now:()=>globalThis.performance?.now()??Date.now(),afterNextFrame(t,n){let r=globalThis.requestAnimationFrame;return typeof r!="function"?false:(r(()=>{t(),globalThis.setTimeout(n,0);}),true)},setTimer(t,n){let r=globalThis.setTimeout(t,n);return r.unref?.(),r},clearTimer:t=>globalThis.clearTimeout(t)}}function Ba(){return {count:0,max:0,bands:new Array(Yh.length+1).fill(0),samples:[]}}function NM(e,t){return e[Math.min(e.length-1,Math.ceil(t*e.length)-1)]}function kB(e){let t=[...e.samples].sort((n,r)=>n-r);return Object.freeze({count:e.count,p50Ms:Math.round(NM(t,.5)),p95Ms:Math.round(NM(t,.95)),maxMs:Math.round(e.max),bands:Object.freeze([...e.bands])})}function HM(e){let t=e.clock??SB(),n=e.windowMs??yB,r={interaction:Ba(),layout:Ba(),paint:Ba()},o=null,i=null,a=null,s=[],l=false;function c(m,g){if(!Number.isFinite(g)||g<0)return;let b=r[m];b.count+=1,b.max=Math.max(b.max,g);let y=Yh.findIndex(h=>g<=h);if(b.bands[y===-1?Yh.length:y]+=1,b.samples.length<DM)b.samples.push(g);else {let h=Math.floor(Math.random()*b.count);h<DM&&(b.samples[h]=g);}o===null&&(o=t.now(),i=t.setTimer(d,n));}function d(){i!==null&&t.clearTimer(i),i=null;let m=o;o=null;let g=r;if(r={interaction:Ba(),layout:Ba(),paint:Ba()},m===null)return;let b={};for(let h of ["interaction","layout","paint"])g[h].count>0&&(b[h]=kB(g[h]));let y=(b.interaction?.count??0)>=vB&&b.interaction.p95Ms>bB;e.deliver({kind:"performance",...y?{code:"performance.slow-interaction"}:{},windowMs:Math.max(0,Math.round(t.now()-m)),...a===null?{}:{pagesBucket:chunkYQWMI6J5_cjs.w(a)},...b});}let u=()=>{globalThis.document?.visibilityState==="hidden"&&(s=[],d());};globalThis.document?.addEventListener?.("visibilitychange",u);let f=()=>globalThis.document?.visibilityState==="hidden";return {timing(m,g,b){if(l||!e.enabled())return;if(b&&(a=b()),m!=="input"){c(m,g);return}if(s.length>=xB||f())return;let y=t.now(),h=g>0&&g<=y?g:y;if(s.push(h),s.length>1)return;let v=s,x=false;t.afterNextFrame(()=>{v===s&&(s=[],x=true);},()=>{if(!x||l)return;let R=t.now();for(let C of v)R-C<=wB&&c("interaction",R-C);})||(s=[]);},flush:d,dispose(){l||(d(),l=true,globalThis.document?.removeEventListener?.("visibilitychange",u));}}}function IB(){return {now:()=>globalThis.performance?.now()??Date.now(),setTimer:(e,t)=>{let n=globalThis.setTimeout(e,t);return n.unref?.(),n},clearTimer:e=>globalThis.clearTimeout(e)}}var Qh=()=>({activeMs:0,inputEdits:0,commandEdits:0,automationEdits:0}),RB={input:"inputEdits",command:"commandEdits",automation:"automationEdits"};function _M(e){let t=e.clock??IB(),n=e.windowMs??6e4,r=t.now(),o=Qh(),i=Qh(),a=null,s=null,l=null,c=false,d=false;queueMicrotask(()=>{c||!e.enabled()||(d=true,e.deliver({kind:"session",phase:"start"}));});function u(){s!==null&&t.clearTimer(s),s=null;let b=a;a=null;let y=o;if(o=Qh(),!(b===null||!d)){for(let h of Object.keys(y))i[h]+=y[h];e.deliver({kind:"session",phase:"active",durationMs:Math.max(0,Math.round(t.now()-b)),...y,activeMs:Math.round(y.activeMs)});}}function f(){if(c)return;let b=t.now();l!==null&&b-l<=3e4&&(o.activeMs+=Math.max(0,b-l)),l=b,a===null&&(a=b,s=t.setTimer(u,n));}let m=()=>{globalThis.document?.visibilityState==="hidden"&&u();};globalThis.document?.addEventListener?.("visibilitychange",m);function g(){c||(u(),c=true,globalThis.document?.removeEventListener?.("visibilitychange",m),d&&e.deliver({kind:"session",phase:"end",durationMs:Math.max(0,Math.round(t.now()-r)),...i,activeMs:Math.round(i.activeMs)}));}return {activity:f,edit(b){c||(o[RB[b]]+=1,f());},flush:u,end:g}}var Jh=new Set,PB=e=>{if(!e.persisted)for(let t of [...Jh])try{t();}catch{}};globalThis.addEventListener?.("pagehide",PB);function BM(e){return Jh.add(e),()=>{Jh.delete(e);}}var TB=new Set(["insertImage","openBookmarkDialog","openGoTo","openRevisionMarkupDialog","proposeDeletion","proposeInsertion","proposeReplacement","replaceImage","setEditingMode","setReviewDisplayMode","toggleDocumentProtection","toggleParagraphMarks","toggleReviewPane"]);function $M(e){if(TB.has(e.type))return e.type;try{let t=ui(e);return t.supported||t.reason!==Xm(e.type)?e.type:void 0}catch{return}}function EB(e){let t=e.type;if(t==="acceptRevision"||t==="acceptAllRevisions")return "accept";if(t==="rejectRevision"||t==="rejectAllRevisions")return "reject";let n=e.action;return n==="accept"||n==="reject"?n:void 0}var qM=new WeakMap;function WM(e,t){let n=qM.get(e);return n?n(t):t()}var ey=new WeakMap;function CB(e,t,n,r){ey.get(e)?.(t,n,r);}function OB(e,t,n){ey.get(e)?.("edit.internal-invariant",n,"exception",{thrown:t});}function MB(e){let t=e?.code;return t==="notFound"?"save.no-document":t==="invalidState"?"save.document-changed":"save.failed"}var AB=new Set(["split","possible-ungrouped-gesture","possible-fragmented-gesture"]);function KM(e){let t=()=>globalThis.performance?.now()??Date.now(),n=chunkYQWMI6J5_cjs.x(()=>[...e.modules.diagnosticListeners,e.events.emitDiagnostic],e.now),r=n.deliver,o=null,i=0,a=0,s=0,l=false;e.events.on("historyDiagnostic",v=>{AB.has(v.kind)&&r({kind:"history",code:`history.${v.kind}`});}),e.customNodes?.observe(v=>{let x=v?.code;(x==="payload-invalid"||x==="payload-missing")&&r({kind:"custom-node",code:`custom-node.${x}`});});let c=e.modules.collaboration?.session,d=c?LB(c,r,t):()=>{},u=HM({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("performance"),...e.performance}),f=_M({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("session"),...e.session}),m=BM(()=>{u.flush(),f.end();}),g=v=>{let x=new Map;for(let[k,R]of v)for(let{reason:C,revision:P,detail:E}of k){let w=chunkYQWMI6J5_cjs.u(C);if(!w)continue;let S=chunkYQWMI6J5_cjs.D(P?.revisionKind),F=S==="format"?chunkYQWMI6J5_cjs.E(P?.formattingKind):void 0,A=chunkYQWMI6J5_cjs.C(P?.partName),$=chunkYQWMI6J5_cjs.z(E),W=[w,$,R,S,F,A].join("|"),U=x.get(W);U?U.count+=1:x.set(W,{count:1,event:{code:w,...R?{operation:R}:{},...S?{changeKind:S}:{},...F?{formattingKind:F}:{},...A?{part:A}:{},...$?{cause:$}:{}}});}for(let{event:k,count:R}of x.values())r({kind:"review.skipped",...k,count:R});},b=(v,x)=>g([[x.revisions?.skipped??[],EB(v)],[x.revisionAuthors?.skipped??[],"reassign"]]),y=(v,x,k)=>{try{r({kind:"edit.rejected",code:"edit.internal-invariant",origin:"command",...k,cause:chunkYQWMI6J5_cjs.A(),errorName:chunkYQWMI6J5_cjs.B(v),stage:x});}catch{}},h=v=>{if(v||i===0&&a===0){f.edit("input");return}l||(l=true,f.edit(a>0?"automation":"command"));};return {editorSessionId:n.editorSessionId,surfaceHooks(v,x){return {onRejection:k=>this.inputRejected(k,v()),onTiming:(k,R)=>this.timing(k,R,x()??void 0),onEdit:h}},openStarted(v){o={sizeBucket:chunkYQWMI6J5_cjs.v(v.byteLength),start:t()};},openDeferred(){o&&(o.start=null);},openMounting(){o&&o.start===null&&(o.start=t());},openSettled(v){if(!o)return;let{sizeBucket:x,start:k}=o;o=null,r({kind:"document.open",outcome:"opened",sizeBucket:x,pagesBucket:chunkYQWMI6J5_cjs.w(ha(v)),durationMs:k===null?0:Math.max(0,Math.round(t()-k)),...FB(v)});},openRejected(v,x,k){let R=o?.sizeBucket;o=null;let C=chunkYQWMI6J5_cjs.z(v),P=chunkYQWMI6J5_cjs.C(k);r({kind:"document.open",outcome:"rejected",code:chunkYQWMI6J5_cjs.s(v,x),...R?{sizeBucket:R}:{},...C?{cause:C}:{},...P?{part:P}:{}});},openCrashed(v,x="open-mount"){if(!o)return;let{sizeBucket:k}=o;o=null,r({kind:"document.open",outcome:"rejected",code:"open.failed",sizeBucket:k,cause:chunkYQWMI6J5_cjs.A(),errorName:chunkYQWMI6J5_cjs.B(v),stage:x}),e.onOpenCrash?.();},continueOpen(v){try{return v()}catch(x){throw this.openCrashed(x,"open-layout"),x}},reviewItem(v,x,k,R){return (C,P)=>{let E=x(C),w=s,S;try{S=v(C,P);}catch(W){throw i===0&&y(W,"review-item",{tracked:R()}),W}if(S.ok||i>0)return S;let F=_a(S.reason,S.code),A=F==="edit.refresh-in-progress"||F==="edit.collaboration-not-ready";if(S.code==="notFound"||S.code==="unsupported"&&E&&!A){let W=E?k(E,P):{},U=E&&{revisionKind:E.revisionKind,partName:W.partName??"",...E.formattingKind?{formattingKind:E.formattingKind}:{}},_=S.reason===pa?W.detail??"read-only":chunkYQWMI6J5_cjs.z(S.reason)??W.detail;return g([[[{reason:S.code==="notFound"?"unknown-revision":"unsupported-revision",...U?{revision:U}:{},detail:_}],P]]),S}if(s!==w)return S;let $=chunkYQWMI6J5_cjs.z(S.reason);return r({kind:"edit.rejected",code:F,origin:"command",tracked:R(),...$?{cause:$}:{}}),S}},exec(v,x,k,R){i===0&&a===0&&(l=false),i+=1;let C;try{C=k();}catch(P){if(i===1){let E;try{E=$M(v);}catch{E=void 0;}y(P,"command",{tracked:x,...E?{command:E}:{}});}throw P}finally{i-=1;}if(i>0)return C;if(C.ok&&!l&&R?.()&&(l=true,f.edit(a>0?"automation":"command")),!C.ok){let P=$M(v),E=chunkYQWMI6J5_cjs.z(C.reason);r({kind:"edit.rejected",code:_a(C.reason,C.code),origin:"command",tracked:x,...P?{command:P}:{},...E?{cause:E}:{}});}return b(v,C),C},inputRejected(v,x){if(i>0||a>0)return;s+=1;let k=_a(v),R=chunkYQWMI6J5_cjs.z(v);r({kind:"edit.rejected",code:k,origin:"input",tracked:x,...R?{cause:R}:{}});},fontFailed(v){r({kind:"font.failed",code:LM(v)});},attach(v,x){let k=v.exec,R=()=>v.getDocumentHandle().revision;v.exec=(P,E)=>{let w=R();return this.exec(P,x(),()=>k(P,E),()=>R()!==w)};let C=v.save;v.save=()=>this.save(()=>C.call(v)),qM.set(v,P=>{i===0&&a===0&&(l=false),a+=1;try{return P()}finally{a-=1;}}),XI(v,(P,E)=>{this.exec(P,x(),()=>E);}),ey.set(v,(P,E,w,S)=>{let F=chunkYQWMI6J5_cjs.z(w);r({kind:"edit.rejected",code:P,origin:"automation",tracked:E,...F?{cause:F}:{},...S?{errorName:chunkYQWMI6J5_cjs.B(S.thrown),stage:"automation"}:{}});});},async save(v){let x=t(),k=()=>Math.max(0,Math.round(t()-x)),R;try{R=await v();}catch(C){try{let P=MB(C);r({kind:"document.save",outcome:"rejected",code:P,durationMs:k(),...P==="save.failed"?{cause:chunkYQWMI6J5_cjs.A(),errorName:chunkYQWMI6J5_cjs.B(C),stage:"save"}:{}});}catch{}throw C}return r({kind:"document.save",outcome:"saved",sizeBucket:chunkYQWMI6J5_cjs.v(R.byteLength),durationMs:k()}),R},timing(v,x,k){v==="input"&&f.activity(),u.timing(v,x,v==="paint"&&k?()=>ha(k):void 0);},dispose(){u.dispose(),d(),f.end(),m();}}}function FB(e){try{let{session:t}=e;return {shape:{parts:chunkYQWMI6J5_cjs.w(t.currentPackage().parts.size),paragraphs:chunkYQWMI6J5_cjs.w(t.paragraphIds().length),reviewItems:chunkYQWMI6J5_cjs.w(t.reviewItems().length),embeddedFonts:chunkYQWMI6J5_cjs.w(t.embeddedFonts().length)}}}catch{return {}}}function LB(e,t,n){let r=n(),o="none",i,a=false,s=false,l=-1,c=()=>{let f=e.statusSnapshot(),m=f.reason?.code,g=f.recovering===true;if(f.status===o&&m===i&&g===a)return;let b=f.status==="ready"&&!s,y=b&&o!=="none";b&&(s=true),t({kind:"collab.status",status:f.status,previous:o,...m?{code:`collab.${m}`}:{},recovering:g,...y?{connectMs:Math.max(0,Math.round(n()-r))}:{}}),o=f.status,i=m,a=g;},d=()=>{let f=e.participants().length;f!==l&&(l=f,t({kind:"collab.participants",count:f}));},u=[e.subscribeStatus(c),e.subscribeParticipants(d)];return c(),()=>{for(let f of u)f();}}function jM(e,t,n=()=>true){if(!n())return;let r=e.code==="wasmUnavailable"||e.cause instanceof chunk5JPIEN54_cjs.f&&e.cause.code==="unsupportedRuntime";r&&!t.config.onFontError&&!t.events.hasErrorHandlers()&&Ew(e);try{t.config.onFontError?.(e);}catch{}n()&&(t.events.emitError(e,n),n()&&t.diagnostics.fontFailed(r?"wasmUnavailable":e.code));}function Fl(e){let t=[],n=(r,o)=>{let i=o.kind,a=r.handlers.kinds??e;return typeof i!="string"||!a||a.includes(i)};return {request(r){let o=t.filter(l=>n(l,r)),i=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!i?.handlers.onRequest)return false;let{sessions:a,handlers:s}=i;return a.add(r),r.signal.addEventListener("abort",()=>a.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let i={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(i),()=>{let a=t.indexOf(i);if(!(a<0)){t.splice(a,1);for(let s of i.sessions)s.cancel();}}}}}var DB=()=>Fl();function VM(e={}){let t=ba({}),n=ba({}),r=CR(e),o=MR(e),i=DB(),a=Fl(["dropdown","comboBox","date","buildingBlockGallery"]),s=Fl();return {surfaceOptions:{onRequestTextFormField:i.request,onRequestContentControlWidget:a.request,onRequestInvalidTextFormField:s.request,onHyperlinkPopover:l=>t.current().onPopover?.(l),onRequestHyperlink:()=>t.current().onRequest?.(),onEquationPopover:l=>n.current().onPopover?.(l),...r.surfaceOptions},bookmarkDialog:r.bookmarkDialog,goTo:r.goTo,commentDraft:o.requests,setters:{setTextFormFieldChrome:i.register,setContentControlWidgetChrome:a.register,setInvalidTextFormFieldChrome:s.register,setHyperlinkChrome:t.push,setEquationChrome:n.push,...r.setters,...o.setters}}}function UM(e,t){let n=chunkDBOOTED4_cjs.Xa(e),r=null,o=null,i=null,a=Fl(),s=()=>t.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:t.contribution()?.createRevisionMarkupDialog?t.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:"the review module does not supply a settings dialog"},l=f=>{if(t.destroyed())return;let m=chunkDBOOTED4_cjs.Xa(f,n);JSON.stringify(m)!==JSON.stringify(n)&&(n=m,t.apply(n),i?.(),t.changed(n));},c=()=>{if(o){o.cancel();return}let f=r;r=null,f?.destroy();},d=()=>{let f=new AbortController,m=new Set,g=n,b=h=>{if(!(f.signal.aborted||JSON.stringify(h)===JSON.stringify(g))){g=h;for(let v of [...m])v();}},y={signal:f.signal,get:()=>g,set(h){f.signal.aborted||b(chunkDBOOTED4_cjs.Xa(h,g));},reset:()=>b(chunkDBOOTED4_cjs.Wa),subscribe(h){return f.signal.aborted?()=>{}:(m.add(h),()=>{m.delete(h);})},canApply:()=>o===y&&!f.signal.aborted&&s().ok,apply(){return y.canApply()?(l(g),y.cancel(),true):false},cancel(){if(f.signal.aborted)return;o===y&&(o=null,i=null),m.clear();let h=r;r=null,f.abort(),h?.destroy();}};return i=()=>b(n),y},u=f=>{r=t.contribution().createRevisionMarkupDialog({...f,container:t.container(),translate:m=>t.translate()?.(m)}),f.signal.aborted?c():r.open();};return {current:()=>n,set:l,canOpen:s,register(f,m){return a.register(f??{onRequest:u},m)},open(){let f=s();if(!f.ok)return f;c();let m=d();o=m;try{a.request(m)||u(m);}catch(g){throw m.cancel(),g}return {ok:true,changed:false}},destroyDialog:c}}var zM=new WeakMap;function BB(e){return !(!e.story||e.origin===chunkWO4V6PNS_cjs.g.mutationUndo||e.origin===chunkWO4V6PNS_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunkWO4V6PNS_cjs.l.story))}function $B(e,t){BB(t)||(e.summaries=null);}function qB(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>$B(t,n)));}function ZM(e){}function XM(e,t){let n=zM.get(e);return n||(n={summaries:null,subscribed:false},zM.set(e,n)),qB(e,n),n.summaries||(n.summaries=t()),n.summaries}var WB=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function KB(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function jB(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Wt(t)){let o=In(n,r,t);return o.ok?{ok:true,span:{paragraphId:o.span.nodeId,start:o.span.start,end:o.span.end}}:{ok:false,code:o.code,reason:o.reason,target:t}}if(KB(t)){if(!Wt(t.from)||!Wt(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=In(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let i=In(n,r,t.to);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:t};if(o.span.nodeId!==i.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let a=Math.min(o.span.start,i.span.start),s=Math.max(o.span.end,i.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:a,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function ty(e,t){let n=WB.get(t.subtype);if(!n)return {ok:false,code:"invalidArgs",reason:`that control type cannot be inserted (${String(t.subtype)})`,...t.target===void 0?{}:{target:t.target}};let r;if(t.target===void 0){let o=yi(e.state().selection);if(!o)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported"};r=o;}else {let o=jB(e,t.target);if(!o.ok)return o;r=o.span;}return {ok:true,span:r,op:{op:"insertContentControl",paragraphId:r.paragraphId,start:r.start,end:r.end,type:n,...t.tag===void 0?{}:{tag:t.tag},...t.title===void 0?{}:{alias:t.title}}}}var VB="http://schemas.microsoft.com/office/word/2010/wordml",UB="http://schemas.microsoft.com/office/word/2012/wordml";function Ei(e){return chunkWO4V6PNS_cjs.Uc(e)}function Ll(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function zB(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunkWO4V6PNS_cjs.la)return t.value}}function ny(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return zB(n)}}function GB(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=ZB(t);if(n!==void 0)return n}return "richText"}function ZB(e){if(e.kind==="textValue")return;let t=e.kind,n=e.localName,r=e.namespaceUri;if(t==="contentControlDropDownList"||n==="dropDownList")return "dropdown";if(t==="contentControlComboBox"||n==="comboBox")return "comboBox";if(t==="contentControlDate"||n==="date")return "date";if(n==="picture")return "picture";if(n==="docPartList")return "buildingBlockGallery";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===VB||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===UB)return "repeatingSection"}function ju(e){let t=ny(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function XB(e,t){if(ju(Ll(t)))return true;let n=chunkWO4V6PNS_cjs.Ua(e,t.id);for(;n;){if(Ei(n)&&ju(Ll(n)))return true;n=chunkWO4V6PNS_cjs.Ua(e,n.id);}return false}function oy(e,t){let n=Ll(e),r=ny(n,"tag"),o=ny(n,"alias"),i=t?XB(t,e):ju(n);return {id:e.id,controlType:GB(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...i?{locked:true}:{}}}var YM=new WeakMap;function YB(e,t){let n=[],r=chunkWO4V6PNS_cjs.Ua(e,t.id);for(;r;)Ei(r)&&n.push(`${r.id}:${ju(Ll(r))?1:0}`),r=chunkWO4V6PNS_cjs.Ua(e,r.id);return n.join("|")}function JM(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function QB(e){return Object.freeze(e.map(t=>JM(t)))}function JB(e,t){let n=e.node,r=Ll(n),o=YB(t,n),i=YM.get(n);if(i&&i.properties===r&&i.lockAncestors===o)return i.summary;let a=JM(oy(n,t));return YM.set(n,{properties:r,lockAncestors:o,summary:a}),a}function e4(e){let t=chunkWO4V6PNS_cjs.$b(e.root);return ZM(t.length),t.map(n=>JB(n,e))}function t4(e){return QB(e.storyParts().flatMap(t=>e4(t)))}function n4(e){return XM(e,()=>t4(e))}function ry(e,t){return t?!(t.tag!==void 0&&e.tag!==t.tag||t.alias!==void 0&&e.alias!==t.alias||t.controlType!==void 0&&e.controlType!==t.controlType):true}function r4(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,i,a)=>{if(a>=chunkWO4V6PNS_cjs.wa)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=chunkWO4V6PNS_cjs.ng(e,l);continue}if(chunkWO4V6PNS_cjs.ya(l)){s=n(l.children,s,i,a+1);continue}if(Ei(l)){let c=s,d=i+1;s=n(chunkWO4V6PNS_cjs.Tb(l),s,d,a+1),t.push({control:l,start:c,end:s,depth:d});continue}s+=chunkWO4V6PNS_cjs.ng(e,l);}return s};return n(e.children,0,-1,0),t}function iy(e,t,n){return r4(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>oy(r.control,n))}function ay(e,t){let n=[],r=chunkWO4V6PNS_cjs.Ua(e,t);for(;r;)Ei(r)&&n.push(oy(r,e)),r=chunkWO4V6PNS_cjs.Ua(e,r.id);return n.reverse()}function eA(e,t){if(!e)return [];let n=n4(e.session);return t?n.filter(r=>ry(r,t)):n}function sy(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Ce(e.session,n)??e.session.part(),i=chunkWO4V6PNS_cjs.Ta(o,n);if(i&&i.kind==="paragraph"){for(let s of iy(i,r,o))if(ry(s,t))return s}let a=ay(o,n);for(let s=a.length-1;s>=0;s-=1){let l=a[s];if(ry(l,t))return l}return null}function ly(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function o4(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function i4(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function a4(e){let t=n=>{if(n.kind==="textValue")return null;if(n.kind==="body")return n;for(let r of n.children){let o=t(r);if(o)return o}return null};return t(e.root)}function Vu(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Ei(n))&&t.push(n);return t}function s4(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...Vu(r.children));return t}function l4(e){return e.kind==="table"?s4(e):Ei(e)?Vu(chunkWO4V6PNS_cjs.Tb(e)):e.kind==="body"?Vu(e.children):[]}function c4(e,t,n){if(Ei(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let a of iy(t,r,e))return {ok:true,controlId:a.id};let i=ay(e,t.id).at(-1);if(i)return {ok:true,controlId:i.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function d4(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=a4(e);if(!n)return {ok:false,code:"notFound",reason:"the document body was not found",target:t};if(t.path.length===0)return {ok:false,code:"notFound",reason:"DocLocation path is empty",target:t};let r=Vu(n.children),o=null;for(let a=0;a<t.path.length;a+=1){if(o=r[t.path[a]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[a]} is out of range`,target:t};a<t.path.length-1&&(r=l4(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let i=c4(e,o,t.offset);return i.ok?i:{...i,target:t}}function u4(e,t,n){let r=In(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,i=chunkWO4V6PNS_cjs.Ta(o,r.span.nodeId);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let a=r.span.start;for(let c of iy(i,a,o))return {ok:true,controlId:c.id};let l=ay(o,i.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function tA(e,t){if(t===void 0){let r=sy(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(i4(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return o4(t)?d4(n,t):Wt(t)?u4(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function nA(e){switch(e){case "locked":case "bound":case "typeMismatch":case "invalidArgs":case "unsupported":return e;case "unknown-control":return "notFound";case "indivisible-content":return "unsupported";default:return "unsupported"}}function rA(e){switch(e){case "locked":return "the content control is locked";case "bound":return "the content control is bound to external data";case "typeMismatch":return "the value does not match the control type";case "invalidArgs":return "the value is not valid for this control";case "unsupported":return "this control type is not supported";case "unknown-control":return "the content control was not found";case "indivisible-content":return "a content control cannot start or end inside a hyperlink, a field, or another inline control";default:return `the edit was refused (${e})`}}function oA(e,t){return {ok:false,code:nA(e),reason:rA(e),...t!==void 0?{target:t}:{}}}function f4(e,t,n,r){return r?.scope&&r.scope.kind!=="body"&&e.target!==void 0?{ok:false,refusal:{ok:false,code:"unsupported",reason:"a location or anchor target resolves in the body only; omit it to use the caret"}}:t?n==="view"||!t.session.editable?{ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}}:e.type==="setContentControlValue"&&typeof e.value!="string"?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"setContentControlValue requires a string value"}}:{ok:true}:{ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}}}function cy(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function dy(e,t,n,r){let o=f4(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=ty(t,e);return s.ok?QM(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let i=tA(t,e.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};let a=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:i.controlId,value:e.value}:{op:"removeContentControl",controlId:i.controlId};return QM(t,a,i.controlId)}function QM(e,t,n){let r=Ce(e.session,n)??e.session.part(),o=chunkWO4V6PNS_cjs.ah(e.session.currentPackage()),i=chunkWO4V6PNS_cjs.Cj(o,t)??chunkWO4V6PNS_cjs.Jk(r,o,t)??chunkWO4V6PNS_cjs.ol(r,t);return i?{ok:false,code:nA(i),reason:rA(i)}:{ok:true}}function iA(e,t,n,r){t?.flushPendingInput();let o=dy(e,t,n,r);return o.ok?p4(t,e):o}function aA(e,t,n,r,o){let i=e.applyGatedTreeOps;return typeof i=="function"?i.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function p4(e,t){if(t.type==="insertContentControl")return m4(e,t);let n=tA(e,t.target);if(!n.ok){let a=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...a!==void 0?{target:a}:{}}}e.flushPendingInput();let r=yi(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},i=aA(e,[o],r,r,Bt(e.session,n.controlId,{kind:"body"}));return i.rejected?oA(i.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:i.committed})}function m4(e,t){e.flushPendingInput();let n=ty(e,t);if(!n.ok){let c=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...c!==void 0?{target:c}:{}}}let{paragraphId:r,start:o,end:i}=n.span,a=yi(e.state().selection),s={paragraphId:r,start:o,end:i},l=aA(e,[n.op],a,s,Bt(e.session,r,{kind:"body"}));return l.rejected?oA(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}function sA(e,t,n){switch(n.type){case "selectedText":return e?.selectedText()??"";case "selectionFormatting":return e?t():null;case "selection":return _d(e);case "paragraphs":return xR(e,n.container);case "isInsideToc":return IR(e);case "hyperlinkAt":return vR(e);case "contentControls":return eA(e,n.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return sy(e,n.filter);case "tableContext":return $d(e);case "watermark":return wI(e);case "bookmarks":return e?.bookmarkEditing.list()??[];default:return null}}var g4=40,h4="docx-preview-surface",lA="data-docx-previewing";function y4(e){let t=e.ownerDocument.defaultView;for(let n=e.parentElement;n;n=n.parentElement){let r=t?.getComputedStyle(n),o=`${r?.overflowY??""} ${r?.overflowX??""}`;if(/(auto|scroll|overlay)/.test(o))return n}return null}function cA(e,t,n){let r=e.parentElement;if(!r)return null;let o=e.ownerDocument,i=y4(e),a=i?.scrollTop??0,s=i?.scrollLeft??0,l=o.createElement("div");l.className=h4,l.setAttribute("data-docx-preview",""),l.setAttribute("role","region"),l.setAttribute("aria-label",t),l.style.position="absolute",l.style.margin="0";let c=P=>{P.stopPropagation(),P.type!=="contextmenu"&&P.preventDefault();};for(let P of ["contextmenu","paste","cut","drop","dragover"])l.addEventListener(P,c);let d=()=>{l.style.top=`${e.offsetTop}px`,l.style.left=`${e.offsetLeft}px`,l.style.width=`${e.offsetWidth}px`,l.style.minHeight=`${e.offsetHeight}px`;};d(),r.insertBefore(l,e.nextSibling);let u=n(l);if(!u)return l.remove(),null;l.style.position="absolute",d();let f=o.activeElement,m=f&&e.contains(f)?f:null;m?.blur();let g=e.style.visibility;e.style.visibility="hidden",i&&(i.scrollTop=a,i.scrollLeft=s);let y=o.defaultView,h=y?.ResizeObserver,v=h?new h(d):null;v?.observe(e),v?.observe(r),y?.addEventListener("resize",d);let x=e.closest(".docx-editor")??r;x.setAttribute(lA,"");let k=ut(()=>l),R=null,C=()=>{R=null,Ra(u,g4)||(R=k.setTimeout(C,0));};return bi(u)&&(R=k.setTimeout(C,0)),{surface:u,place:d,finishOpening(){for(R!==null&&k.clearTimeout(R),R=null;!Ra(u,Number.POSITIVE_INFINITY););},remove(){R!==null&&k.clearTimeout(R),R=null,v?.disconnect(),y?.removeEventListener("resize",d),x.removeAttribute(lA);let P=i?.scrollTop??0,E=i?.scrollLeft??0;e.style.visibility=g,u.destroy(),l.remove(),i&&(i.scrollTop=P,i.scrollLeft=E),m?.isConnected&&m.focus({preventScroll:true});}}}function Uu(e){if(e.kind==="paragraph")return e.id;if(!("children"in e)||!Array.isArray(e.children))return null;for(let t of e.children){let n=Uu(t);if(n)return n}return null}function dA(e,t){let n=e.parts.get(e.mainDocumentPart)?.root,r=t.parts.get(t.mainDocumentPart)?.root;if(!n||!r||n===r)return null;let o=(a,s)=>{let l=a.children,c=s.children;for(let u=0;u<c.length;u+=1){let f=c[u],m=l[u];if(m!==f)return f.kind==="paragraph"?f.id:m&&m.kind===f.kind&&"children"in m&&"children"in f?o(m,f)??Uu(f):Uu(f)}let d=c[c.length-1];return d?Uu(d):null},i=o(n,r);return i&&chunkWO4V6PNS_cjs.Ta(t.parts.get(t.mainDocumentPart),i)?i:null}var uy="review-module-required",uA="preview-operation-unsupported",fA=()=>`${new Date().toISOString().slice(0,19)}Z`;function pA(e,t,n){let r=chunkYQWMI6J5_cjs.p(e),o=t,i=t.collaborationSession(),a=i?.identity.actorId,s=()=>n().reviewModel!==void 0,l=()=>{let u=t.author()?.trim();return t.editingMode()==="suggest"&&u?u:void 0},c=()=>(n().revisionMarkup??chunkDBOOTED4_cjs.Wa).trackFormatting&&!t.session.trackingSettings().doNotTrackFormatting,d=u=>{let f=l();return f===void 0?u:wl(u,{author:f,date:fA()},c())};return {...r,collaborative:()=>!!i,trackedRangeReplacement:()=>!i,suggesting:()=>t.editingMode()==="suggest",revisionDisplayMode:()=>chunkDBOOTED4_cjs._a(t.revisionDisplayMode()),replacementLanding(u,f,m){let g=l();if(g===void 0)return null;if(m<=f)return f;let b=b4(e,u);return b?vu(b,f,m,g,fA()):f},apply(u,f,m=[],g=false){let b=o.automationWriteRefusal([],false);if(b!==null)return {ok:false,reason:b};if(g&&!s())return {ok:false,reason:uy};let y=chunkWO4V6PNS_cjs.Hb(a,()=>r.apply(h=>{let v=u(h);if(v===null||(b=o.automationWriteRefusal(v,m.length>0),b!==null))return null;let x=d(v);return x.some(xl)&&!s()?b=uy:b=i?.gateOperations(x,f)??null,b===null?x:null},f,m));return b!==null?{ok:false,reason:b}:y},applyCommentWrites(u,f){let m=o.automationWriteRefusal([],false);if(m!==null)return {ok:false,reason:m};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};if(!s())return {ok:false,reason:uy};let g=i?.gateOperations([],f);return g?{ok:false,reason:g}:chunkWO4V6PNS_cjs.Hb(a,()=>r.applyCommentWrites(u,f))},applyCustomNodeWrite:()=>({ok:false,reason:uA}),applyLifecycle:()=>({ok:false,reason:uA})}}function b4(e,t){let n=e.currentPackage(),r=n.parts.get(n.mainDocumentPart),o=r?[r,...n.parts.values()]:[...n.parts.values()];for(let i of o){if(!i.root)continue;let a=chunkWO4V6PNS_cjs.Ta(i,t);if(a?.kind==="paragraph")return a}return null}var zu=new WeakMap;function mA(e,t){zu.set(e,{...t,active:null});}function gA(e){zu.get(e)?.active?.end();}function $a(e){let t=zu.get(e)?.active;return !!t&&!t.ended&&t.shown}var x4=Object.freeze({document:true,save:false,events:false,selection:false,scrolling:false,layout:false}),w4=new Uint8Array(0);function S4(e){let t=zu.get(e),n=e.surface;if(!t||!n||n.parked())return {ok:false,reason:"no-document"};if(t.active&&!t.active.ended)return {ok:false,reason:"preview-active"};let r=n.hostElement();if(Qn(r))return {ok:false,reason:"blocked"};if(n.editingMode()==="view")return {ok:false,reason:"viewing"};if(nu(n))return {ok:false,reason:"composing"};n.flushPendingInput();let o=n.session.currentPackage(),i=o.parts.get(o.mainDocumentPart);if(!i)return {ok:false,reason:"no-document"};let a=t.displayOptions(),s=new chunk243W4WW2_cjs.T(o,i,a.contentLockPolicy?{contentLockPolicy:a.contentLockPolicy}:{}),l=chunkYQWMI6J5_cjs.m({port:pA(s,n,t.displayOptions),capabilities:x4}),c=e.mountGeneration,d=new Set,u=null,f=false,m=e.on("change",()=>{if(f)return;if(e.surface!==n||e.mountGeneration!==c){g.end();return}if(!u)return;let{scale:b,showParagraphMarks:y}=t.displayOptions();b!==void 0&&u.surface.setScale(b)&&u.place(),u.surface.setShowParagraphMarks(y??false);}),g={deferEvents:t.deferEvents,host:l,get shown(){return u!==null},get ended(){return f},show(){if(f||u)return false;let b=t.displayOptions(),y=chunkEOTAXOJY_cjs.k({ok:true,package:s.currentPackage()},{...b.reviewModel?{reviewModel:b.reviewModel}:{},...b.contentLockPolicy?{contentLockPolicy:b.contentLockPolicy}:{}});if(!y.ok)return false;let h=b.translate?.("editor.previewContent")??i18n.en.editor.previewContent;return u=cA(r,h,v=>{let x={...b,editingMode:"view",revisionDisplayMode:n.revisionDisplayMode(),openedSession:y,progressiveOpen:true},k=Al(v,w4,x);return k.ok?(k.surface.setEditable(false),k.surface):null}),u?(qg(r,true),t.changed(),true):false},reveal(){if(!u)return false;let b=dA(o,s.currentPackage());return b===null?false:(u.finishOpening(),u.surface.revealPosition({paragraphId:b,offset:0}),true)},end(){if(f)return;f=true,m();let b=u!==null;u?.remove(),u=null,b&&qg(r,false),t.active===g&&(t.active=null),b&&t.changed();for(let y of [...d])try{y();}catch{}d.clear();},onEnd(b){return f?(b(),()=>{}):(d.add(b),()=>d.delete(b))}};return t.active=g,{ok:true,fork:g}}var hA=new WeakMap;function yA(e){let t=hA.get(e);if(!t)throw new Error("External refresh requires a mounted createDocxEditor instance.");return t}function bA(e,t){let n=null,r=null,o={...t,epoch:0,revision:0,mountedRevision:0,source:void 0,invalidated:new Set,cancel(){if(!r||r.mountedRevision!==null)return;t.cancelLoad();let i=r;r=null,Eo(i.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,i.resolve(false);try{t.changed();}catch{}},invalidate(){o.cancel(),o.epoch++,n=null,r&&(Eo(r.container,false),r.resolve(false),r=null),o.source=void 0;for(let i of o.invalidated)i();},contentMounted(i){r?.bytes===i&&(r.mountedRevision=o.revision);},mounted(i,a){if(!r||r.bytes!==i)return;let s=r,l=!a&&!!t.surface();o.mountedRevision=s.mountedRevision??o.revision,l?n=null:n={top:s.top,left:s.left};let c=$t(s.container);if(l&&c&&(c.scrollTop=Math.max(0,Math.min(s.top,c.scrollHeight-c.clientHeight)),c.scrollLeft=Math.max(0,Math.min(s.left,c.scrollWidth-c.clientWidth)),c.dispatchEvent(new(Ze(c)).Event("scroll"))),r===s){r=null,Eo(s.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,s.resolve(l);try{t.changed();}catch{}}},replace(i,a){let s=t.container();if(!s||r)return Promise.resolve(false);let l=$t(s);return new Promise(c=>{r={bytes:i,resolve:c,container:s,top:a==="recovery"&&n?n.top:l?.scrollTop??0,left:a==="recovery"&&n?n.left:l?.scrollLeft??0,mountedRevision:null},o.source=a,Eo(s,true),t.surface()?.setEditable(false);try{t.load(i);}catch(d){o.mounted(i,d);}})}};return e.on("change",i=>{i.source||o.revision++;}),hA.set(e,o),o}function vA(e,t,n,r,o,i){let a=new Map,s=new Set,l=m=>{let{family:g,weight:b,style:y}=m.request;return `${m.identity}|${g}|${b}|${y}`},c=i?{shape(m){try{return e.shaper.shape(m)}catch(g){let b=m.environment.font;if(g instanceof chunk5JPIEN54_cjs.f&&g.code==="fontOverLimit"&&!s.has(l(b))){s.add(l(b));let{family:y,weight:h,style:v}=b.request;try{i(new chunkUKVVUHZL_cjs.a("overLimit",g.message,{request:Object.freeze({family:y,weight:h,style:v}),diagnostic:g.diagnostic??g.message,cause:g}));}catch{}}throw g}}}:e.shaper,d=c!==e.shaper&&chunkDBOOTED4_cjs.q(e.shaper)?chunkDBOOTED4_cjs.p(c):c,u=chunk5JPIEN54_cjs.ga({...e,shaper:d},{resolveFont:m=>{let g=m.fontFamily??t.defaultFont.family;if(g.trim().length===0)return null;let b={family:g,weight:m.bold?700:400,style:m.italic?"italic":"normal"},y=chunkDBOOTED4_cjs.h(b);if(a.has(y))return a.get(y)??null;let h;try{h=e.fonts.resolve(b);}catch{return a.set(y,null),null}let v=h instanceof chunkDBOOTED4_cjs.d?null:h;return a.set(y,v),v},fallback:n.measurer}),f=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:u,producer:f}}var k4="The quick brown fox 0123 \u2014 {}#@",I4=["monospace","serif"],R4=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function wA(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(k4).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!R4.test(r))return t.set(r,true),true;let i=false;for(let a of I4){let s=n(`32px ${a}`);if(n(`32px "${r}", ${a}`)!==s){i=true;break}}return t.set(r,i),i}}var xA=4;function SA(e,t,n){let r=new Set,o=[];for(let d of t){let u=d.toLowerCase();r.has(u)||(r.add(u),o.push(d));}let i=d=>new Set(e.slice(0,Math.max(d,0)).map(u=>u.toLowerCase())),a=0;for(let d=0;d<=xA;d+=1){let u=i(n-a),f=o.filter(g=>!u.has(g.toLowerCase())).length,m=Math.min(f,xA,Math.floor(n/2));if(m===a)break;a=m;}let s=e.slice(0,Math.max(n-a,0)),l=i(n-a),c=o.filter(d=>!l.has(d.toLowerCase()));return [...s,...c].slice(0,n)}function kA(e,t,n,r=new Set){let o=[];for(let i of e){if(r.has(i.toLowerCase())){o.push(i);continue}if(t(i)||n(i))continue;let a=chunk5JPIEN54_cjs.U.get(i.toLowerCase());a!==void 0&&n(a)||o.push(i);}return o}function IA(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let i of t){let a=i.from.family.toLowerCase();n.has(a)||!n.has(i.to.family.toLowerCase())||(n.add(a),o=true);}if(!o)break}return n}var RA=new WeakMap,P4=0,T4=chunkMOYYRVFV_cjs.p((e,t)=>{if(e.kind==="paragraphProperties"){let n=RA.get(e);return n||(n=String(++P4),RA.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:chunkMOYYRVFV_cjs.q(e,t)}});function Gu(e){return T4(e,{key:""})}var PA=new WeakMap,TA=new WeakMap;function fy(e){let t=TA.get(e);return t||TA.set(e,t=chunkMOYYRVFV_cjs.r()),t}function py(e,t){fy(e)(t,e.stylesRoot(),e.documentThemeFonts()),chunkMOYYRVFV_cjs.t(t),Gu(t);}function EA(e,t,n,r){let o=fy(e).warmTableRows(t,n,r,e.stylesRoot(),e.documentThemeFonts()),i=t.children.slice(n,r);return chunkMOYYRVFV_cjs.t(i),Gu(i),Math.max(o,t.children.length)}function CA(e){let t=e.packageRevision(),n=PA.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??fy(e),o=e.storyParts().map(f=>f.root),i=e.stylesRoot(),a=e.numberingRoot(),s=e.documentThemeFonts(),l=Gu(o),d=n&&n.stylesRoot===i&&n.numberingRoot===a&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((f,m)=>f===l[m])?n.numberingFamilies:chunkMOYYRVFV_cjs.v(o,a,i,s),u=[...e.symbolFontFamilies(),...r(o,i,s),...chunkMOYYRVFV_cjs.t(o),...d];return PA.set(e,{eastAsianFonts:r,revision:t,families:u,numberingInputs:l,numberingFamilies:d,numberingRoot:a,stylesRoot:i,theme:s}),u}function OA(e,t,n){let[r]=chunkMOYYRVFV_cjs.a([[t]]);return SA([...new Set([...r&&r!==n?[r]:[],...e.documentFonts()])],CA(e),chunkMOYYRVFV_cjs.c)}function MA(e,t){let n,r=false,o=()=>{r=false;let a=e();if(!a)return;let s=n?.generation!==a.generation;s&&(n={generation:a.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!a.dynamic)return;let c=a.families().filter(u=>!l.requested.has(u.toLowerCase()));if(!s&&c.length===0)return;for(let u of c)l.requested.add(u.toLowerCase());l.running=true;let d=t(c);return d.finally(()=>{l.running=false,n===l&&i();}),d},i=(a=false)=>{if(a)return o();r||(r=true,queueMicrotask(o));};return {schedule:i}}function Bn(e,t,n="unsupported"){if(e===null||e===ml)return {ok:false,code:n,reason:t};let r=_a(e);return {ok:false,code:r==="edit.read-only"||r==="edit.protected-content"?"locked":"unsupported",reason:e}}function FA(e){return e.kind==="custom"?`custom node '${e.name}' has no reviewCard, so it has no card to activate`:`review items of kind '${e.kind==="revision"?e.revisionKind:e.kind}' are excluded from activation`}function my(e,t){let n=e.review;return n?{reviewModel:{...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)}}:{}}var E4=["all-markup","simple-markup","proposed","original"];function LA(e){let t=()=>e.placements({pairReplacements:true}).filter(h=>h.kind==="revision"&&(h.activatable||h.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(h=>h.kind==="revision")??[],r=h=>{let v=n(),x,k=E=>(x??=new Map(e.placements({placement:false,pairReplacements:true}).filter(w=>vi(w.key)).map(w=>[w.key,w])),x.get(E)),R=new Set(h.keys?.flatMap(E=>{if(!vi(E))return [E];let w=k(E);return w?cu(w.item):[E]})??(h.scope==="document"?v:e.visible()).filter(E=>E.kind==="revision").map(chunkWO4V6PNS_cjs.Mj)),C=new Map,P=h.scope==="document"&&h.keys===void 0;if(P){let E=e.surface().session;for(let w of E.storyParts())C.set(w.name,{scope:Bt(E,w.root.id,{kind:"body"}),part:w,keys:[]});}for(let E of v){let w=e.scope(E),S=Ce(e.surface().session,chunkWO4V6PNS_cjs.Lj(E)[0]);if(!S)continue;let F=C.get(S.name);F||(F={scope:w,part:S,keys:[]},C.set(S.name,F));let A=chunkWO4V6PNS_cjs.Mj(E);R.delete(A)&&F.keys.push(A);}return {scopes:[...C.values()],missing:[...R],unfilteredDocument:P}},o=h=>{let v=chunkWO4V6PNS_cjs.bd(e.surface().session.currentPackage()),x=[],k=[];for(let{scope:R,part:C,ops:P}of h)P.length&&(C.name===v?.name?k.push({partName:C.name,ops:P}):x.push({scope:R,ops:P}));return {groups:x,partOps:k}},i=h=>{let{scopes:v,missing:x,unfilteredDocument:k}=r(h),R=[],C=x.map(w=>({key:w,reason:"unknown-revision"})),P=[],E=0;for(let{scope:w,part:S,keys:F}of v){let A=chunk243W4WW2_cjs.va(S,h.action,k?void 0:F);R.push(...A.result.resolved),C.push(...A.result.skipped),E+=A.result.remaining,P.push({scope:w,part:S,ops:A.ops});}return {...o(P),result:{resolved:R,skipped:C,remaining:E}}},a=h=>h.author===void 0?e.surface()?.author():h.author,s=h=>{let{scopes:v,missing:x}=r(h),k={author:a(h)??"",...h.date===void 0?{}:{date:h.date}},R=x.map(E=>({key:E,reason:"unknown-revision"})),C=[];for(let{scope:E,part:w,keys:S}of v){if(!S.length)continue;let F=chunkWO4V6PNS_cjs.Ek(w,k,S,void 0,h.authors);C.push({scope:E,part:w,ops:F.ops,plan:F});}let P=E=>({updated:E.flatMap(w=>w.updated),skipped:[...R,...E.flatMap(w=>w.skipped)]});return {...o(C),result:P(C.map(({plan:E})=>E.result)),finish:()=>{let E=e.surface().session.currentPackage().parts;return P(C.map(({part:w,plan:S})=>{let F=E.get(w.name);return F?S.finish(F):S.result}))}}},l=()=>e.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.enabled()?e.surface()?{ok:true}:{ok:false,code:"notFound",reason:"no document is open"}:{ok:false,code:"unsupported",reason:nn},c=h=>h.scope!==void 0&&!["visible","document"].includes(h.scope)||h.unsupported!==void 0&&!["skip","fail"].includes(h.unsupported)||h.keys!==void 0&&(!Array.isArray(h.keys)||h.keys.some(v=>typeof v!="string"))?{ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"}:null,d=h=>{let v=l();if(!v.ok)return {gate:v};if(e.viewing())return {gate:{ok:false,code:"locked",reason:"the document is open for viewing"}};let x=Xn(h,e.surface());if(x)return {gate:x};let k=a(h);if(k===void 0)return {gate:{ok:false,code:"invalidArgs",reason:"pass an author, or configure the editor author, to change the author"}};if(typeof k!="string"||h.date!==void 0&&typeof h.date!="string"||chunkWO4V6PNS_cjs.Dk({author:k,...h.date===void 0?{}:{date:h.date}}))return {gate:{ok:false,code:"invalidArgs",reason:"author must be nonblank text, and date an ISO 8601 date and time"}};let R=c(h);if(R)return {gate:R};if(h.keys!==void 0&&(h.scope!==void 0||h.authors!==void 0)||h.authors!==void 0&&(!Array.isArray(h.authors)||h.authors.some(E=>typeof E!="string")))return {gate:{ok:false,code:"invalidArgs",reason:"select by keys, or by scope and authors; authors must be a list of names"}};let C=s(h),{result:P}=C;return h.unsupported==="fail"&&P.skipped.length?{gate:{ok:false,code:"unsupported",reason:"some selected changes cannot change author"},plan:C}:P.updated.length?{gate:{ok:true},plan:C}:{gate:{ok:false,code:P.skipped.some(E=>E.reason==="unsupported-revision")?"unsupported":"notFound",reason:"no eligible selected changes to update"},plan:C}},u=h=>{e.surface()?.flushPendingInput();let{gate:v,plan:x}=d(h);if(!v.ok)return x?{...v,revisionAuthors:{...x.result,updated:[]}}:v;let k=e.surface(),{groups:R,partOps:C}=x;if(!R.length&&!C.length)return {ok:true,changed:false,revisionAuthors:x.result};let P=e.placements({placement:false,pairReplacements:false}).find(A=>A.isActive)?.key,E,w=k.commitReviewOps(A=>(E=k.session.applyTreeOpsAtomic(R,{partOps:C,historyToken:A}),E),"revision-attribution");if(!E?.committed)return Bn(w,"the changes were refused");let S=x.finish(),F=S.updated.find(A=>A.previousKey===P);return F&&e.activate(F.key),{ok:true,changed:true,revisionAuthors:S}},f=h=>{if(h.type==="setReviewChangesAuthor")return d(h).gate;if(h.type!=="navigateReviewChange"&&h.type!=="resolveAllReviewChanges"&&h.type!=="setReviewDisplayMode")return null;let v=l();if(!v.ok)return v;if(h.type==="setReviewDisplayMode")return E4.includes(h.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(h.type==="navigateReviewChange"&&!["next","previous"].includes(h.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(h.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(h.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(h.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let x=Xn(h,e.surface());if(x)return x;let k=c(h);if(k)return k;let{result:R,groups:C,partOps:P}=i(h);return h.unsupported==="fail"&&R.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:!R.resolved.length&&!C.length&&!P.length?{ok:false,code:R.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}:{ok:true}},m=(h,v)=>{let x=l();if(!x.ok)return x;if(e.viewing()){let E=e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve");return Bn(E,"the document is open for viewing","locked")}let k=Xn({type:"resolveAllReviewChanges"},e.surface());if(k)return k;e.surface().flushPendingInput();let R=kr(e.placements,h)?.item;if(!R||R.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(R.readOnly)return {ok:false,code:"unsupported",reason:pa};let C,P=e.surface().commitReviewOps(E=>{let w=e.surface().session,S=Ce(w,chunkWO4V6PNS_cjs.Lj(R)[0]);return S&&S.name===chunkWO4V6PNS_cjs.bd(w.currentPackage())?.name?(C=w.applyTreeOpsAtomic([],{partOps:[{partName:S.name,ops:AA(R,v,S)}],historyToken:E}),C):(C=e.surface().session.applyTreeOps(AA(R,v,e.surface().session.partFor(e.scope(R))),void 0,void 0,e.scope(R),{historyToken:E}),C)},"revision-resolve");return C?.committed?{ok:true,changed:true}:Bn(P,"the revision was refused")},g=h=>{if(h.type==="setReviewChangesAuthor")return u(h);if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(h.type))return null;e.surface()?.flushPendingInput();let v=f(h);if(!v)return null;if(!v.ok){if(h.type==="resolveAllReviewChanges"&&(v.code==="notFound"||v.code==="unsupported")&&l().ok&&!e.viewing()){let{result:w}=i(h);return {...v,revisions:{...w,resolved:[],remaining:w.remaining+w.resolved.length}}}return v}let x=e.surface();if(h.type==="setReviewDisplayMode")return e.setDisplayMode(h.mode),{ok:true,changed:false};if(h.type==="navigateReviewChange"){let w=t(),S=w.findIndex(L=>L.isActive),F=h.direction==="next"?1:-1,A=S<0?C4(w,x,F):(S+F+w.length)%w.length,$=w[A],W=Ta($.item),U=W?chunkWO4V6PNS_cjs.Mj(W.deletion):$.key,_=e.activate($.key,!$.activatable&&$.revisionKind==="format");return _.ok&&e.reveal({key:U,source:"navigate"}),_}if(h.type!=="resolveAllReviewChanges")return null;let{groups:k,partOps:R,result:C}=i(h),P,E=x.commitReviewOps(w=>(P=x.session.applyTreeOpsAtomic(k,{partOps:R,historyToken:w}),P),"revision-resolve");return P?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...C,remaining:n().length}}):Bn(E,"the revisions were refused")},b=h=>{let v=kr(e.placements,h)?.item;return v?.kind==="revision"?v:void 0},y=e.report?e.report.diagnostics.reviewItem(m,b,(h,v)=>{let x=e.surface()?.session,k=x&&Ce(x,chunkWO4V6PNS_cjs.Lj(h)[0]);if(!k)return {};try{let C=chunk243W4WW2_cjs.va(k,v,[chunkWO4V6PNS_cjs.Mj(h)]).result.skipped[0]?.detail;return {partName:k.name,...C?{detail:C}:{}}}catch{return {partName:k.name}}},e.report.tracked):m;return {can:f,exec:g,resolveReviewItem:y}}function C4(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),i=o?chunkWO4V6PNS_cjs.Aj(o):new Map,a=i.get(r.paragraphId);if(a!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],c=l.kind==="revision"?l.item.ranges[0]?.start:void 0,d=c?i.get(c.paragraphId):void 0;if(c&&d!==void 0&&(n>0?d>a||d===a&&c.offset>=r.offset:d<a||d===a&&c.offset<=r.offset))return s}return n>0?0:e.length-1}function AA(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];if(e.revisionKind==="structural"||chunkWO4V6PNS_cjs.Ij(n.root).length>0||e.revisionKind==="format"&&chunkWO4V6PNS_cjs.Lj(e).length>1)return [...chunk243W4WW2_cjs.va(n,t,cu(e)).ops];let o=new Set(chunkWO4V6PNS_cjs.Lj(e)),i=new Map;for(let a of chunkWO4V6PNS_cjs.rk(n)){if(!o.has(a.node.id))continue;let s=f=>a.node.attributes.find(m=>m.namespaceUri===chunkWO4V6PNS_cjs.la&&m.localName===f)?.value,l=e.addresses.find(f=>f.id===s("id")&&f.author===(s("author")??"")&&(f.date??"")===(s("date")??""));if(!l)continue;let c=a.node.localName,d=JSON.stringify([l,c]),u=i.get(d);u?u.siteNodeIds.push(a.node.id):i.set(d,{revision:l,localName:c,siteNodeIds:[a.node.id]});}return [...i.values()].map(({revision:a,localName:s,siteNodeIds:l})=>({op:r,revision:a,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function DA(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function HA(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="toggleBookmarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:nn}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function NA(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function _A(e){let t=0,n=0,r=VM({changed:()=>{t+=1,e.changed();},error:a=>e.emitError(tn("hostCallback",`a bookmark mark callback failed: ${a instanceof Error?a.message:String(a)}`))}),o=NA(a=>{e.surface()?.setShowParagraphMarks(a),e.changed();}),i=NA(a=>{e.surface()?.bookmarkEditing.setShown(a),e.changed();});return {popupChrome:r,chromeSettled(){let a=n===t;return n=t,a},capability:e.capability,surfaceOptions:()=>({showParagraphMarks:o.get(),onToggleParagraphMarks:o.toggle,showBookmarks:i.get(),...r.surfaceOptions}),snapshot:()=>({showParagraphMarks:o.get(),showBookmarks:i.get()}),dialog(a,s){if(a.type==="openGoTo"){let l=r.goTo,c=a.fromShortcut===true;return c&&l.canOpen()&&!l.shortcutOn()&&!e.destroyed()?{ok:false,code:"unsupported",reason:"the Go To shortcut is turned off"}:bg(c?{canOpen:l.canOpen,open:l.openFromShortcut}:l,e.destroyed(),s,"Go To view")}return a.type!=="openBookmarkDialog"?null:bg(r.bookmarkDialog,e.destroyed(),s)},toggle(a){if(a.type==="toggleParagraphMarks")o.toggle();else if(a.type==="toggleBookmarks")i.toggle();else return null;return {ok:true,changed:false}},isActive(a){return a.type==="toggleParagraphMarks"?o.get():a.type==="toggleBookmarks"?i.get():null}}}function BA(e,t){return e.session.subscribe(n=>{let r={revision:e.session.packageRevision(),created:n.created,deleted:n.deleted,dirty:n.dirty};t.refitIfPageResized(),t.bump(),t.emit(r);})}function $A(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setParagraphDirection":return t.direction===e.direction;case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}var qA=new WeakMap;function gy(e,t){let n=t(e?.matches??[]);return qA.set(n,e?.truncated??false),n}function WA(e){return qA.get(e)}function Zu(e,t,n){return t.kind==="note"?e.enterNote?.(t.id,n)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the note could not be opened"}:(t.furnitureKind?e.enterHeaderFooter?.({rId:t.rId,kind:t.furnitureKind,position:n}):e.enterHeaderFooter?.({rId:t.rId,position:n}))?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function O4(e){return e?.kind==="headerFooter"||e?.kind==="note"}function M4(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function Xu(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.activeScope().kind==="frame"&&e.setActiveScope({kind:"body"}),e.exitNote?.(),e.exitHeaderFooter?.());}function KA(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let i={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!Ea(e.layout(),r,o))return i;let a=t.scope.owner;if(a){let s=Zu(e,a,{paragraphId:o,offset:0});if(!s.ok)return s}else Xu(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:i}let n={paragraphId:t.blockId,offset:t.start};if(O4(t.scope)){let r=Zu(e,t.scope,n);if(!r.ok)return r}else {if(t.scope&&t.scope.kind!=="body")return {ok:false,code:"unsupported",reason:"the match scope cannot be opened"};Xu(e,t.blockId);}return e.setSelection({anchor:n,head:{paragraphId:t.blockId,offset:t.start+t.length}}),e.revealParagraph(t.blockId),{ok:true,changed:false}}function jA(e,t,n,r,o){let i={...o?.matchCase!==void 0?{matchCase:o.matchCase}:{},...o?.wholeWord!==void 0?{wholeWord:o.wholeWord}:{},...e?{stories:M4(e,t)}:{}};if(typeof r=="string")return gy(e?.session.findText(r,i),n);let a=e?.session.findText(r,i);return r.map((s,l)=>gy(a?.[l],n))}function qa(e,t,n){let r=e.block??t,o=e.behavior??"instant",i=e.offsetPx??24;if(!["start","center","centerIfNeeded","nearest"].includes(r))throw new TypeError("block must be start, center, centerIfNeeded, or nearest.");if(!["instant","smooth"].includes(o))throw new TypeError("behavior must be instant or smooth.");if(!Number.isFinite(i)||i<0)throw new RangeError("offsetPx must be finite and nonnegative.");let a=n?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;return {block:r,offsetPx:i,behavior:a?"instant":o}}function VA(e,t,n=()=>null){return {scrollToPage(r){return !Number.isInteger(r)||r<1?false:(t(),e()?.revealPage(r-1)??false)},scrollToBlock(r,o){if(typeof r!="string"||r.length===0)return false;let i;try{i=qa(o??{},"start",n());}catch{return false}t();let a=e();return a&&Xu(a,r),a?.revealParagraph(r,i)??false}}}var UA="cubic-bezier(0.23, 1, 0.32, 1)";function Ci(e,t,n,r=1/0){let o=e??t;if(!Number.isFinite(o)||o<0||o>r)throw new RangeError(r===1/0?`${n} must be a finite, nonnegative number.`:`${n} must be finite and between 0 and ${r}.`);return o}function zA(e,t=180){if(e!==void 0&&typeof e!="boolean"&&(typeof e!="object"||e===null||Array.isArray(e)))throw new TypeError("animation must be a boolean or a durationMs settings object.");return e===false?0:Ci(typeof e=="object"?e.durationMs:void 0,e===true||typeof e=="object"?180:t,"animation.durationMs",1e4)}function Yu(e,t,{marker:n,defaultColor:r},o){let i=[],a=new Map,s=new Set,l=null,c=null,d=r,u=.14,f=4,m=6,g=0,b=r,y="solid",h="",v=180,x=180,k,R=UA,C=ut(()=>t.container()),P,E=0,w=()=>{E++,P!==void 0&&C.clearTimeout(P),P=void 0;},S=D=>{let T=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(D!==void 0&&(typeof D!="string"||!D.trim()||/var\(|^(inherit|initial|unset|revert|revert-layer)$/i.test(D.trim())||T?.supports&&!T.supports("animation-timing-function",D)))throw new TypeError("animation.easing must be a CSS timing function without variables.");let B=t.container()?.ownerDocument.defaultView?.KeyframeEffect??globalThis.KeyframeEffect;if(D!==void 0&&B)try{new B(null,[],{easing:D});}catch{throw new TypeError("animation.easing must be one valid animation timing function.")}return D},F=(D,T)=>Ci(typeof D=="object"?D.exitDurationMs:void 0,T,"animation.exitDurationMs",1e4),A=(D={})=>{if(D.includePrevious!==void 0&&typeof D.includePrevious!="boolean")throw new TypeError("includePrevious must be a boolean.");let T=Ci(D.opacity,.14,"opacity",1),B=Ci(D.padding,4,"padding"),q=Ci(D.borderRadius,6,"borderRadius"),j=zA(D.animation),X=F(D.animation,j),oe=S(typeof D.animation=="object"?D.animation.easing:void 0),H=D.timeoutMs===null?null:Ci(D.timeoutMs,3e3,"timeoutMs",2147483647),V=D.color??r,z=Ci(D.borderWidth,0,"borderWidth"),Y=D.borderColor??V,fe=D.borderStyle??"solid",ne=D.className??"";if(!["solid","dashed","dotted"].includes(fe))throw new TypeError("borderStyle must be solid, dashed, or dotted.");if(typeof ne!="string")throw new TypeError("className must be a string.");let ce=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(typeof V!="string"||!V.trim()||ce?.supports&&!ce.supports("color",V))throw new TypeError("color must be a CSS color or var() expression.");if(ce?.supports&&!ce.supports("color",`color-mix(in srgb, ${V} ${T*100}%, transparent)`))throw new TypeError("color must be valid inside color-mix(), including var() expressions.");if(typeof Y!="string"||!Y.trim()||ce?.supports&&!ce.supports("color",Y))throw new TypeError("borderColor must be a CSS color or var() expression.");if(D.changeIds!==void 0&&(!Array.isArray(D.changeIds)||D.changeIds.length>1e4||D.changeIds.some(ve=>typeof ve!="string"||!ve)))throw new TypeError("changeIds must contain at most 10000 nonempty string IDs.");return {nextOpacity:T,nextPadding:B,nextRadius:q,nextDuration:j,nextExitDuration:X,nextEasing:oe,nextTimeout:H,nextColor:V,nextBorderWidth:z,nextBorderColor:Y,nextBorderStyle:fe,nextClassName:ne}},$=()=>k||t.container()?.ownerDocument.defaultView?.getComputedStyle(t.container()).getPropertyValue("--doc-motion-ease-out").trim()||UA,W=D=>{D.animation&&(D.animation.onfinish=null,D.animation.cancel(),D.animation=void 0);},U=(D,T)=>{W(T),T.element.remove(),a.get(D)===T&&a.delete(D);},_=()=>(c||(c=t.container()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,c?.addEventListener("change",Z)),c?.matches??false),L=()=>{c?.removeEventListener("change",Z),c=null;};function Z(){if(c?.matches){for(let[D,T]of a)W(T),T.exiting&&U(D,T);a.size||L();}}let ee=(D,T,B,q,j=false)=>{if(!j&&T.target===B&&!T.exiting)return;let X=T.element.ownerDocument.defaultView,oe=j?0:Number.parseFloat(X?.getComputedStyle(T.element).opacity??String(T.target));W(T),T.target=B,T.element.style.opacity=String(B);let H=_()?Math.min(q,125):q;if(H===0||typeof T.element.animate!="function"){T.exiting&&U(D,T);return}try{let V=T.element.animate([{opacity:Number.isFinite(oe)?oe:B},{opacity:B}],{duration:H,easing:R});T.animation=V,V.onfinish=()=>{T.animation===V&&(T.animation=void 0,T.exiting&&U(D,T),a.size||L());};}catch{T.exiting&&U(D,T);}},te=()=>{l?.disconnect();let D=t.surface(),T=t.container();if(!D||!T||i.length===0)return;R=$();let B=new Set(i.map(H=>H.paragraphId)),q=e.getRenderScale(),j=e.snapshot().zoom,X=new Set,oe=new Set;for(let H of D.layout().pages){let V=T.querySelector(`[data-page-index="${H.index}"] > .docx-page-content`);if(V)for(let z of chunkDBOOTED4_cjs.za(H)){if(!B.has(z.paragraphId))continue;let Y=`${H.index}:${z.id}`;X.add(Y);let fe=chunkDBOOTED4_cjs.Hd(z),ne=z.lines.length&&!z.clipToBox?1/0:fe.y,ce=z.lines.length&&!z.clipToBox?-1/0:fe.y+fe.height;for(let Se of z.clipToBox?[]:z.lines)ne=Math.min(ne,Se.box.y),ce=Math.max(ce,Se.box.y+Se.box.height);let ve=z.clipToBox?0:f*j,Re=H.contentBox.x-H.box.x,ht=H.contentBox.y-H.box.y,Ae=Math.max(-Re*q,fe.x*q-ve),Fe=Math.min((H.box.width-Re)*q,(fe.x+fe.width)*q+ve);ne=Math.max(-ht*q,ne*q-ve),ce=Math.min((H.box.height-ht)*q,ce*q+ve);let we=a.get(Y);we&&we.element.parentElement!==V&&(U(Y,we),we=void 0);let Je=!we;if(!we){let Se=T.ownerDocument.createElement("div");Se.setAttribute("data-docx-marker",""),Se.setAttribute(n,""),Se.setAttribute("contenteditable","false"),Se.setAttribute("aria-hidden","true"),Se.style.cssText="position:absolute;pointer-events:none;box-sizing:border-box;",we={element:Se,paragraphId:z.paragraphId,target:-1,exiting:false},a.set(Y,we),V.append(Se);}let Zt=we.exiting;we.exiting=false,Zt&&(we.target=-1),we.element.className=h,Object.assign(we.element.style,{border:g?`${g*j}px ${y} ${b}`:"0",backgroundColor:`color-mix(in srgb, ${d} ${u*100}%, transparent)`,borderRadius:`${m*j}px`,left:`${Ae}px`,top:`${ne}px`,width:`${Math.max(0,Fe-Ae)}px`,height:`${Math.max(0,ce-ne)}px`}),ee(Y,we,1,Je&&s.has(z.paragraphId)?0:v,Je),oe.add(z.paragraphId);}}for(let H of oe)s.add(H);for(let[H,V]of a)X.has(H)||(!V.element.isConnected||B.has(V.paragraphId)||x===0?U(H,V):V.exiting||(V.exiting=true,ee(H,V,0,x)));l??=new(Ze(T)).MutationObserver(te),l.observe(T,{childList:true,subtree:true});},me=()=>{w(),i=[],s.clear(),l?.disconnect();for(let[D,T]of a)U(D,T);L();},le=(D={})=>{let T=F(D.animation,zA(D.animation,x));R=S(typeof D.animation=="object"?D.animation.easing:void 0)??$(),w(),i=[],s.clear(),l?.disconnect();for(let[q,j]of a)j.exiting&&T>0||(j.exiting=true,ee(q,j,0,T));a.size||L();};return e.on("selectionChange",()=>{i.length&&te();}),{show(D,T={}){let{nextOpacity:B,nextPadding:q,nextRadius:j,nextDuration:X,nextExitDuration:oe,nextEasing:H,nextTimeout:V,nextColor:z,nextBorderWidth:Y,nextBorderColor:fe,nextBorderStyle:ne,nextClassName:ce}=A(T),ve=new Set(i.map(Re=>Re.paragraphId));if(s=new Set([...s].filter(Re=>ve.has(Re))),d=z,g=Y,b=fe,y=ne,h=ce,u=B,f=q,m=j,v=X,x=oe,k=H,i=D,v===0)for(let Re of a.values())Re.exiting||W(Re);if(!i.length){le();return}if(te(),w(),V!==null){let Re=E;P=C.setTimeout(()=>{Re===E&&(P=void 0,le(),o());},V);}},validate:A,hide:le,clear:me,repaint:te}}function GA(e,t){e.flushPendingInput();let n=In(e.session.part(),e.session.paragraphAnchors(),t);return n.ok?n.span:null}function ZA(e,t,n){let r=null,o=i=>{if(r)return r;let a=e(),s=Yu(a,i,{marker:"data-docx-anchor-highlight",defaultColor:"var(--doc-anchor-highlight-color)"},()=>{});return i.invalidated.add(()=>s.clear()),a.on("change",l=>{l.source&&s.clear();}),r=s,s};return {scrollToAnchor(i,a={}){let s=t(),l=qa(a,"centerIfNeeded",s?.container()??null);if(!Wt(i))return false;n();let c=s?.surface();if(!c)return false;let d=GA(c,i);return !!d&&c.revealPosition({paragraphId:d.nodeId,offset:d.start},l)},highlightAnchor(i,a){let s=t();if(!s)return false;let l=o(s);if(l.validate(a),!Wt(i))return false;n();let c=s.surface();if(!c||!s.container()||s.source)return false;let d=GA(c,i)?.nodeId;return !d||!c.layout().pages.some(f=>chunkDBOOTED4_cjs.za(f).some(m=>m.paragraphId===d))?false:(l.show([{paragraphId:d}],a),true)},clearAnchorHighlight(i){let a=t();a&&o(a).hide(i);}}}function XA(e,t){if(!t.some(o=>o.scope?.kind==="frame"))return t;let n=e.publishedLayout();if(n.revision!==e.session.packageRevision())return t;let r=new Map;return t.filter(o=>{let i=o.scope;if(i?.kind!=="frame")return true;let a=`${i.drawingNodeId}\0${i.hostParagraphId}`,s=r.get(a);return s===void 0&&(s=!!Ea(n,i.drawingNodeId,i.hostParagraphId),r.set(a,s)),s})}var A4=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,F4=/^-?[A-Za-z_][A-Za-z0-9_-]*$/,L4=1e4,YA=32,hy=1e3;function D4(e,t,n){let r=e?.ownerDocument.defaultView?.CSS??globalThis.CSS;return !r?.supports||r.supports(t,n)}function QA(e,t,n){if(e!==void 0){if(typeof e!="string"||!e.trim()||!D4(n,"color",e))throw new TypeError(`${t} must be a CSS color or var() expression.`);return e}}function JA(e){if(typeof e!="string"||!A4.test(e))throw new TypeError('Highlight set names are 1 to 64 letters, digits, "-", or "_", starting with a letter.');return e}function N4(e,t,n,r,o){if(!Array.isArray(t))throw new TypeError("ranges must be an array of HighlightRange.");if(n!==void 0&&(typeof n!="object"||n===null))throw new TypeError("options must be an object.");let i=t.slice(0,L4),a=t.length-i.length,s=[],l=new Int32Array(i.length),c=new Int32Array(i.length);for(let[y,h]of i.entries()){if(!(typeof h=="object"&&h!==null&&typeof h.blockId=="string"&&h.blockId.length>0&&Number.isSafeInteger(h.start)&&h.start>=0&&Number.isSafeInteger(h.length)&&h.length>=0&&h.start+h.length<=2147483647&&(h.expectedText===void 0||typeof h.expectedText=="string")))throw new TypeError(`ranges[${y}] must have a blockId string, nonnegative integer start and length, and an optional expectedText string.`);s.push(h.blockId),l[y]=h.start,c[y]=h.start+h.length;}let d=n?.activeIndex??-1;if(!Number.isInteger(d)||d<-1)throw new RangeError("activeIndex must be an integer of -1 or more.");let u=n?.priority??0;if(!Number.isInteger(u)||Math.abs(u)>hy)throw new RangeError(`priority must be an integer from -${hy} to ${hy}.`);let f=n?.className??"";if(typeof f!="string")throw new TypeError("className must be a string.");let m=f.split(/\s+/).filter(Boolean);if(m.some(y=>!F4.test(y)))throw new TypeError("className must hold space-separated CSS class names.");let g=QA(n?.color,"color",o),b=QA(n?.activeColor,"activeColor",o);return {name:e,ranges:i,overflow:a,blockIds:s,starts:l,ends:c,...g!==void 0?{color:g}:{},...b!==void 0?{activeColor:b}:{},activeIndex:d,classes:m,priority:u,order:r,expected:null,seen:new Array(i.length).fill(null),resolved:new Uint8Array(i.length),live:new Uint8Array(i.length),checkedAt:null}}function H4(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r+=1;let o=0;for(;o<n-r&&e.charCodeAt(e.length-1-o)===t.charCodeAt(t.length-1-o);)o+=1;return {from:r,oldTo:e.length-o,delta:t.length-e.length}}function _4(e,t,n){return t<=n.from?0:e>=n.oldTo?n.delta:0}var xy=new WeakMap,iF=new WeakMap,eF=new WeakSet,yy=new WeakMap,by=new WeakMap;function B4(e,t){return xy.has(e)?xy.get(e):typeof e.expectedText=="string"?e.expectedText:(yy.has(e)||yy.set(e,t),yy.get(e))}var vy=new WeakMap;function aF(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=Ce(e.session,n),o=r?chunkWO4V6PNS_cjs.Ta(r,n):null,i=null;return r&&o&&(vy.has(o)?i=vy.get(o):(i=chunkWO4V6PNS_cjs.hj(r,n),vy.set(o,i))),t.set(n,i),i}}function tF(e,t,n){let r=t.session,o=r.packageRevision(),i=e.checkedAt;if(i?.session===r&&i.revision===o&&i.layout===n)return;let a=aF(t),s=chunkDBOOTED4_cjs.Ge(n),l=e.expected===null,c=e.expected??new Array(e.ranges.length).fill(null),d=new Map;for(let u=0;u<e.ranges.length;u+=1){let f=e.ranges[u],m=e.ends[u]>e.starts[u]?a(e.blockIds[u]):null;if(!l&&m!==null&&m===e.seen[u]){e.live[u]=e.resolved[u]&&s.has(e.blockIds[u])?1:0;continue}let g=l?iF.get(f)??by.get(f)??m:e.seen[u];if(m!==null&&g!==null&&g!==m){let x=e.blockIds[u],k=d.get(x);k?.seen!==g&&(k={seen:g,edit:H4(g,m)},d.set(x,k));let R=_4(e.starts[u],e.ends[u],k.edit);e.starts[u]=e.starts[u]+R,e.ends[u]=e.ends[u]+R;}e.seen[u]=m;let b=e.starts[u],y=e.ends[u],h=m!==null&&y<=m.length?m.slice(b,y):null;if(!l&&m!==null&&h!==c[u]&&g!==null){let x=m.length-g.length,k=b+x>=0?m.slice(b+x,y+x):null;x!==0&&k!==null&&k===c[u]&&(e.starts[u]=b+x,e.ends[u]=y+x,h=k);}l&&(c[u]=B4(f,h),m!==null&&!by.has(f)&&by.set(f,m));let v=h!==null&&h===c[u];e.resolved[u]=v?1:0,e.live[u]=v&&s.has(e.blockIds[u])?1:0;}e.expected=c,e.checkedAt={session:r,revision:o,layout:n};}var nF=new WeakMap,rF=new WeakMap,oF=new WeakMap;function $4(e){let t=new Map;for(let n=0;n<e.ranges.length;n+=1){if(!e.live[n])continue;let r=e.blockIds[n],o=t.get(r)??[];o.push({key:n,start:e.starts[n],end:e.ends[n]}),t.set(r,o);}return t}function q4(e,t,n,r,o){let i=t.children[n];i||(i=e.createElement("div"),i.style.position="absolute",t.append(i));let a=r.index===o.activeIndex,s=`${r.index}|${a?1:0}|${r.left}|${r.top}|${r.width}|${r.height}`;oF.get(i)?.key!==s&&(i.className=a?"docx-text-highlight docx-text-highlight--active":"docx-text-highlight",o.classes.length>0&&i.classList.add(...o.classes),i.setAttribute("data-highlight-index",String(r.index)),i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,oF.set(i,{key:s}));}function W4(e){return e?[...e].sort((t,n)=>t-n).join(","):"*"}function K4(e){return e?[...e].map(([t,n])=>`${t}:${n}`).join(","):""}function sF(e){let t=new Map,n=0,r=0,o=[],i=null,a=null,s=null,l=null,c=()=>[...t.values()].sort((y,h)=>y.priority-h.priority||y.order-h.order);function d(y){let h=e.surface();if(i=y.layer,l=y,!h||t.size===0){y.layer.childElementCount>0&&y.layer.replaceChildren(),o=[],a=null;return}let v=c();for(let w of v)tF(w,h,y.layout);let x=Si(y.layout),k=[r,h.session.packageRevision(),W4(y.pages),y.scale,K4(y.pageOffsetX)].join("|");if(k===a&&x===s&&y.layer.childElementCount>0)return;a=k,s=x;let R=y.layer.ownerDocument,C=[],P=[];for(let w of v){let S=u(w,x,y),F=f(R,w),A=0;for(let $ of S){let W=x.pages[$.pageIndex];if(!W)continue;let U=y.pageOffsetX?.get($.pageIndex)??0,_={set:w,index:$.key,left:(W.contentBox.x+$.x+U)*y.scale,top:(W.contentBox.y+$.y)*y.scale,width:$.width*y.scale,height:$.height*y.scale};q4(R,F,A,_,w),A+=1,P.push(_);}for(;F.childElementCount>A;)F.lastElementChild.remove();C.push(F);}let E=y.layer.children;(E.length!==C.length||C.some((w,S)=>E[S]!==w))&&y.layer.replaceChildren(...C),o=P;}function u(y,h,v){let x=nF.get(y);x||(x=new WeakMap,nF.set(y,x));let k=[],R=new Map;for(let P of h.pages)v.pages&&!v.pages.has(P.index)||(k.push(P),x.has(P)||R.set(P.index,{page:P,rects:[]}));if(R.size>0){let P=chunkDBOOTED4_cjs.Fe(h,$4(y),new Set(R.keys()),v.measurer);for(let E of P)R.get(E.pageIndex).rects.push(E);for(let{page:E,rects:w}of R.values())x.set(E,w);}let C=[];for(let P of k)for(let E of x.get(P))C.push(E);return y.activeIndex>=0&&C.sort((P,E)=>+(P.key===y.activeIndex)-+(E.key===y.activeIndex)),C}function f(y,h){let v=rF.get(h);if(v)return v;let x=y.createElement("div");return x.className="docx-text-highlight-set",x.setAttribute("data-highlight-set",h.name),h.color&&x.style.setProperty("--doc-text-highlight-set-color",h.color),h.activeColor&&x.style.setProperty("--doc-text-highlight-set-active-color",h.activeColor),rF.set(h,x),x}function m(){r+=1,e.surface()?.repaintHighlights();}function g(y){let h=e.surface();if(!h)return {applied:0,unavailable:y.ranges.length+y.overflow};let v=h.publishedLayout();tF(y,h,v);let x=v.revision!==h.session.packageRevision(),k=0;for(let R=0;R<y.ranges.length;R+=1)k+=x?y.resolved[R]:y.live[R];return {applied:k,unavailable:y.ranges.length-k+y.overflow}}return {members:{setHighlights(y,h,v){JA(y),Array.isArray(h)&&h.length>0&&e.flushOpen();let x=t.get(y),k=N4(y,h,v,x?.order??n,e.container());if(!x&&k.ranges.length>0&&t.size>=YA)throw new RangeError(`At most ${YA} highlight sets exist at once.`);if(k.ranges.length===0)return x&&(t.delete(y),m()),{applied:0,unavailable:0};x||(n+=1),t.set(y,k);let R=g(k);return m(),R},clearHighlights(y){if(y===void 0){if(t.size===0)return;t.clear();}else if(!t.delete(JA(y)))return;m();},getHighlightsAt(y,h){if(!Number.isFinite(y)||!Number.isFinite(h))return [];let v=i;if(!v?.isConnected||o.length===0)return [];let x=v.getBoundingClientRect(),k=y-x.left,R=h-x.top,C=[],P=new Set;for(let E=o.length-1;E>=0;E-=1){let w=o[E];if(k<w.left||k>=w.left+w.width||R<w.top||R>=w.top+w.height)continue;let S=`${w.set.name}\0${w.index}`;if(P.has(S)||t.get(w.set.name)!==w.set)continue;P.add(S);let F=x.left+w.left,A=x.top+w.top;C.push({name:w.set.name,index:w.index,range:w.set.ranges[w.index],start:w.set.starts[w.index],length:w.set.ends[w.index]-w.set.starts[w.index],active:w.index===w.set.activeIndex,rect:{x:F,y:A,left:F,top:A,width:w.width,height:w.height,right:F+w.width,bottom:A+w.height}});}return C}},frame:()=>{let y=e.surface();if(!l||!y)return l;let h=y.session.packageRevision();if(l.layout.revision===h)return l;let v=y.layout();return l.layout===v?l:{...l,layout:v,revision:h}},noteMatches(y){let h=e.surface();if(!h||eF.has(y))return y;let v=XA(h,y);eF.add(v);let x=aF(h);for(let k of v){let R=x(k.blockId);R!==null&&iF.set(k,R);let C=k.start+k.length;xy.set(k,R!==null&&C<=R.length?R.slice(k.start,C):null);}return v},attach(y,h=false){a=null,l=null,h&&t.clear(),y?.setHighlightPainter(d);},reset(){t.size!==0&&(t.clear(),m());}}}var lF=new WeakMap;function cF(e){let t=lF.get(e);if(t)return t;let n=new Map,r=new Map,o=(s,l)=>{if(n.has(l))return;let c=r.get(s);c||(c=[],r.set(s,c)),n.set(l,{story:s,index:c.length}),c.push(l);},i=(s,l)=>{for(let c of chunkDBOOTED4_cjs.Aa(l)){for(let d of c.lines)for(let u of chunkDBOOTED4_cjs.Oa(d))o(s,u.paragraphId);c.lines.length===0&&o(s,c.paragraphId);}};for(let s of e.pages){i("body",s.fragments);for(let l of [s.header,s.footer])l&&i(`part:${l.partName}`,l.fragments);for(let l of [s.footnotes,s.endnotes])for(let c of l?.notes??[])i(`notes:${c.noteKind}`,c.fragments);}let a={positions:n,paragraphs:r};return lF.set(e,a),a}function j4(e,t,n,r){let o=(d,u,f)=>{if(f<=u)return;let m=r.get(d);m?m.push({key:t,start:u,end:f}):r.set(d,[{key:t,start:u,end:f}]);},{start:i,end:a}=e;if(i.paragraphId===a.paragraphId){o(i.paragraphId,i.offset,a.offset);return}let s=n.positions.get(i.paragraphId),l=n.positions.get(a.paragraphId);if(o(i.paragraphId,i.offset,Number.POSITIVE_INFINITY),o(a.paragraphId,0,a.offset),!s||!l||s.story!==l.story||l.index<=s.index)return;let c=n.paragraphs.get(s.story);for(let d=s.index+1;d<l.index;d+=1)o(c[d],0,Number.POSITIVE_INFINITY);}function V4(e,t){if(e.start.paragraphId===e.end.paragraphId)return e.end.offset-e.start.offset;let n=t.positions.get(e.start.paragraphId),r=t.positions.get(e.end.paragraphId);return !n||!r||n.story!==r.story?Number.MAX_SAFE_INTEGER:(r.index-n.index)*1e6+(e.end.offset-e.start.offset)}function U4(e){let t=e.item;return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}var dF={comment:0,custom:1,revision:2};function uF(e,t){let n=new Map,r=[];return e.forEach((o,i)=>{for(let a of U4(o)){let s=r.length;r.push({placement:i,width:V4(a,t)}),j4(a,s,t,n);}}),{byParagraph:n,sources:r}}function fF(e,t){return !e.pages||e.pages.has(t.index)}function pF(e,t,n,r){let o=e.pageOffsetX?.get(n.index)??0,i=t.left+(n.contentBox.x+r.x+o)*e.scale,a=t.top+(n.contentBox.y+r.y)*e.scale,s=r.width*e.scale,l=r.height*e.scale;return {x:i,y:a,left:i,top:a,width:s,height:l,right:i+s,bottom:a+l}}function mF(e){function t(){let n=e.frame();return !n?.layer.isConnected||!(n.scale>0)?null:{frame:n,origin:n.layer.getBoundingClientRect()}}return {getReviewItemsAt(n,r,o){if(!Number.isFinite(n)||!Number.isFinite(r))return [];let i=t();if(!i)return [];let{frame:a,origin:s}=i,l=(n-s.left)/a.scale,c=(r-s.top)/a.scale,d=a.layout.pages.find(k=>{if(!fF(a,k))return false;let R=k.box.x+(a.pageOffsetX?.get(k.index)??0);return l>=R&&l<R+k.box.width&&c>=k.box.y&&c<k.box.y+k.box.height});if(!d)return [];let u=e.placements(o);if(u.length===0)return [];let f=cF(a.layout),{byParagraph:m,sources:g}=uF(u,f),b=l-(a.pageOffsetX?.get(d.index)??0)-d.contentBox.x,y=c-d.contentBox.y,h=new Map,v=chunkDBOOTED4_cjs.Fe(Si(a.layout),m,new Set([d.index]),a.measurer);for(let k of v){if(b<k.x||b>=k.x+k.width||y<k.y||y>=k.y+k.height)continue;let R=g[k.key],C=h.get(R.placement);(!C||R.width<C.width)&&h.set(R.placement,{width:R.width,rect:k});}let x=[...h.entries()].map(([k,R])=>({at:k,...R}));return x.sort((k,R)=>{if(k.width!==R.width)return k.width-R.width;let C=u[k.at],P=u[R.at];if(C.kind!==P.kind)return dF[C.kind]-dF[P.kind];if(C.kind==="revision"&&P.kind==="revision"){let E=P.item.nesting-C.item.nesting;if(E!==0)return E}return k.at-R.at}),x.map(k=>({placement:u[k.at],rect:pF(a,s,d,k.rect)}))},getReviewItemRects(n){if(typeof n!="string"||n.length===0)return [];let r=t();if(!r)return [];let{frame:o,origin:i}=r,a=kr(e.placements,n);if(!a)return [];let s=new Set(o.layout.pages.filter(c=>fF(o,c)).map(c=>c.index)),{byParagraph:l}=uF([a],cF(o.layout));return chunkDBOOTED4_cjs.Fe(Si(o.layout),l,s,o.measurer).map(c=>pF(o,i,o.layout.pages[c.pageIndex],c))}}}var z4=new WeakMap,G4=new WeakMap;function Z4(e,t){return e.anchorY===t.anchorY&&e.pageIndex===t.pageIndex&&e.activatable===t.activatable&&e.isActive===t.isActive&&e.locked===t.locked}function gF(e,t){let n=t.anchorY===null&&t.pageIndex===null?G4:z4,r=n.get(e);if(r&&Z4(r.inputs,t))return r.placement;let o=X4(e,t);return n.set(e,{inputs:t,placement:o}),o}function X4(e,t){let n=DA(e),r={key:chunkWO4V6PNS_cjs.Mj(e),id:e.id,...n!==void 0?{date:n}:{},activatable:t.activatable,anchorY:t.anchorY,pageIndex:t.pageIndex,isActive:t.isActive};return e.kind==="comment"?{...r,kind:"comment",author:e.comment.author,initials:chunkWO4V6PNS_cjs.fk(e.comment),text:chunkWO4V6PNS_cjs.dk(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:e.parentId}:{},...e.parentRevisionId!==void 0?{parentRevisionId:e.parentRevisionId}:{},replyIds:e.replyIds,readOnly:false,item:e}:e.kind==="revision"?{...r,kind:"revision",revisionKind:e.revisionKind,author:e.author,initials:uE(e.author),text:chunkWO4V6PNS_cjs.lb(e.text),...e.replacedText?{replacedText:chunkWO4V6PNS_cjs.lb(e.replacedText)}:{},replyIds:e.replyIds,readOnly:e.readOnly||t.locked,item:e}:{...r,kind:"custom",author:"",initials:"",text:e.detail??e.text,replyIds:[],readOnly:true,item:e}}function Y4(e){return e==="password"?{ok:false,code:"locked",reason:hF}:e==="other-restriction"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:e==="no-change"?{ok:false,code:"invalidArgs",reason:"the document protection is already set"}:{ok:false,code:"unsupported",reason:"document protection could not be written"}}var hF="this document is protected with a password; open it in Word to change that";function yF(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,i=null,a=()=>{let l=e.surface();if(!l)return null;let c=l.session.settingsRoot();return (c!==o||i===null)&&(o=c,i=c?chunkWO4V6PNS_cjs.Ug(c):chunkWO4V6PNS_cjs.Tg),i},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=a();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:hF}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let c=r();c!==t&&(t=c,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:a,isActive:()=>a()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let c=s();if(c&&!c.ok)return c;let d=e.surface(),u=!a().enforced,f=d.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:u});return f?f.ok?(e.publish(),{ok:true,changed:true}):Y4(f.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}function bF(e,t){return Lp(e.revisionsIn,t)}function vF(e,t){let n=ld(e);return {current:()=>n,set(r){if(!t.enabled)return {ok:false,code:"unsupported",reason:nn};let o;try{o=ld(r,n);}catch(a){return {ok:false,code:"invalidArgs",reason:a.message}}if(o===n)return {ok:true,changed:false};let i=n;return n=o,t.changed(n,i),{ok:true,changed:false}},shows:r=>r.some(o=>bF(n,o)),opensOnLoad:r=>n.opening==="auto"&&r.some(o=>bF(n,o)),opensOnTrackedChange:()=>n.opening==="auto"&&n.revisionsIn==="pane",pairsReplacements:()=>n.revisionsIn==="balloons"}}var Q4=e=>chunkDBOOTED4_cjs.za(e);function wF(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunk5JPIEN54_cjs.ba(t,Q4);for(let o of t.pages){for(let i of [o.header,o.footer])i&&xF(r,i.fragments,o.index,i.box.y);for(let i of [o.footnotes,o.endnotes])if(i)for(let a of i.notes)xF(r,a.fragments,o.index,a.box.y);}return e.set(t,r),r}}function xF(e,t,n,r){for(let o of chunkDBOOTED4_cjs.Aa(t))for(let i of chunkDBOOTED4_cjs.Ra(o))e.has(i)||e.set(i,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}var SF=new WeakMap;function IF(e){let t=SF.get(e);if(t)return t;let n=new Map;for(let r of e.pages)for(let o of [r.footnotes,r.endnotes])if(o)for(let i of o.notes)for(let a of chunkDBOOTED4_cjs.Aa(i.fragments))for(let s of chunkDBOOTED4_cjs.Ra(a))n.has(s)||n.set(s,i.scopeId);return SF.set(e,n),n}var kF=new WeakMap;function RF(e){let t=kF.get(e);if(t)return t;let n=new Map;for(let[r,o]of chunkDBOOTED4_cjs.Ta(e).entries())n.set(o,r);return kF.set(e,n),n}var J4={"open.zip-corrupt":"damaged","open.zip-invalid-entry-name":"damaged","open.xml-malformed":"damaged","open.content-types-invalid":"damaged","open.relationships-invalid":"damaged","open.unsupported-source":"not-docx","open.missing-main-document":"not-docx","open.zip-entry-limit":"too-large","open.zip-size-limit":"too-large","open.zip-ratio-limit":"too-large","open.xml-part-size-limit":"too-large","open.xml-depth-limit":"too-large","open.xml-element-limit":"too-large","open.relationship-limit":"too-large","open.part-limit":"too-large","open.xml-dtd-forbidden":"blocked","open.invalid-limits":"unknown","open.failed":"unknown"};function wy(e){return Object.freeze({code:e,reason:J4[e]??"unknown"})}function PF(e){let t=null,n=null;return {get parseError(){return t},get failure(){return n},reject(r,o,i){t=i?`${r}: ${i}`:r,n=wy(chunkYQWMI6J5_cjs.s(r,o));},refuseSource(r,o=false){let i=FI(r);return o||(t=i,n=wy("open.unsupported-source"),e()),i},crash(){t="open failed",n=wy("open.failed"),e();},clear(){t=null,n=null;}}}function TF(e,t){if(e==="")return;let n=(t??globalThis).navigator?.clipboard;if(n?.writeText)try{n.writeText(e).catch(()=>{});}catch{}}function Sy(e,t,n){if(e===""&&(t===null||t===""))return;let r=n??globalThis,o=r.navigator?.clipboard;if(!o)return;let i=r.ClipboardItem,a=r.Blob;if(t&&o.write&&i&&a)try{let s=new i({"text/plain":new a([e],{type:"text/plain"}),"text/html":new a([t],{type:"text/html"})});o.write([s]).catch(()=>{TF(e,n);});return}catch{}TF(e,n);}function e3(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function t3(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function EF(e){return CF(e.children)}function CF(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunkWO4V6PNS_cjs.Qb(n))&&t.push(n);return t}function n3(e){if(chunkWO4V6PNS_cjs.Qb(e))return CF(chunkWO4V6PNS_cjs.Tb(e));if(e.kind!=="table")return [];let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...EF(r));return t}function r3(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},i=e.session.partFor(o);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let a="noteId"in r?r.noteId:null,s=r.part==="body"?chunkWO4V6PNS_cjs.Qc(i):chunkWO4V6PNS_cjs.Oc(i).find(m=>r.part==="header"||r.part==="footer"?m.kind===r.part:m.kind==="note"&&chunkWO4V6PNS_cjs.yc(m.root)===a)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let l=EF(s),c;for(let m=0;m<t.path.length;m+=1){let g=t.path[m];if(!Number.isInteger(g)||g<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(c=l[g],!c)return {ok:false,code:"notFound",reason:`block index ${g} is out of range`};m<t.path.length-1&&(l=n3(c));}if(!c||c.kind!=="paragraph"||!chunkWO4V6PNS_cjs.Ta(i,c.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let d=(chunkWO4V6PNS_cjs.hj(i,c.id)??"").length,u=t.offset??(n==="start"?0:d);if(!Number.isInteger(u)||u<0||u>d)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let f={paragraphId:c.id,offset:u};return {ok:true,selection:{anchor:f,head:f}}}function Qu(e,t,n){if(e3(t))return r3(e,t,n);if(!Wt(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let i=Bt(e.session,o,{kind:"body"}),a=e.session.partFor(i);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=In(a,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,c={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:c,head:c}}}function Ju(e,t){if(!t3(t)){let o=Qu(e,t,"start");if(!o.ok)return o;let i=Qu(e,t,"end");return i.ok?{ok:true,selection:{anchor:o.selection.anchor,head:i.selection.head}}:i}let n=Qu(e,t.from,"start");if(!n.ok)return n;let r=Qu(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function o3(e){return e.evenPage?"even":e.firstPage?"first":"default"}function OF(e){return e.variant!==void 0?e.variant==="default"||e.variant==="first"||e.variant==="even"?e.variant:{ok:false,reason:"variant must be 'default', 'first', or 'even'"}:o3(e)}function ky(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let i=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?OF(t):n?.variant??"default";if(typeof i=="object"&&i.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:i.reason}};let a=i,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:a}}function i3(e){let t=e??"rejected";return t==="first-section"||t.includes("first-section")?{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}:{ok:false,code:"invalidArgs",reason:`header/footer lifecycle refused: ${t}`}}function Dl(e,t){if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"header/footer lifecycle is not available"};let n=e.applyHeaderFooterLifecycle(t);return n.ok?{ok:true,changed:true}:i3(n.reason)}function ef(e,t,n,r){let i=e.session.headerFooterResolutionBySection()[t];if(!i)return null;let s=(n==="header"?i.headers:i.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:i.titlePage,evenAndOddHeaders:i.evenAndOddHeaders}:null}function MF(e,t){if(typeof e.enterHeaderFooter!="function")return {ok:false,code:"unsupported",reason:"header/footer editing is not available"};let n=t.sectionIndex??0;if(!Number.isInteger(n)||n<0)return {ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"};let r=t.position,o=OF(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let i=o,s=ef(e,n,r,i)?.rId,l=false;if(!s){let d=Dl(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:i,...i==="first"?{titlePage:true}:{},...i==="even"?{evenAndOddHeaders:true}:{}});if(!d.ok)return d;l=true,s=ef(e,n,r,i)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:i})?{ok:true,changed:l}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function AF(e,t){let n=ky(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,i=Dl(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return i.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),i}function FF(e,t){let n=ky(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=Dl(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;if(o){let a=ef(e,n.sectionIndex,n.kind,n.variant);a?e.enterHeaderFooter({rId:a.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return i}function LF(e,t){let n=ky(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=r?.rId,a=Dl(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;let s=ef(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==i&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),a}function DF(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return Dl(e,{op:"setSectionFurnitureOptions",...r!==void 0?{sectionIndex:r}:{},...t.titlePage!==void 0?{titlePage:t.titlePage}:{},...t.evenAndOddHeaders!==void 0?{evenAndOddHeaders:t.evenAndOddHeaders}:{},...t.headerDistanceTwips!==void 0?{headerDistanceTwips:t.headerDistanceTwips}:{},...t.footerDistanceTwips!==void 0?{footerDistanceTwips:t.footerDistanceTwips}:{}})}function NF(e,t){return e.activeScope().kind!=="headerFooter"?{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}:typeof e.insertPageField!="function"?{ok:false,code:"unsupported",reason:"page field insertion is not available"}:e.insertPageField(t.field)?{ok:true,changed:true}:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"page field insertion was refused"}}function HF(e,t){let n=e.activeScope();return n.kind==="headerFooter"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside a header or footer"}:n.kind==="note"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside another note"}:typeof e.insertNote!="function"?{ok:false,code:"unsupported",reason:"insertNote is not available"}:e.insertNote(t.noteKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"insertNote was refused"}}function _F(e,t){return typeof e.deleteNote!="function"?{ok:false,code:"unsupported",reason:"deleteNote is not available"}:e.deleteNote(t.noteKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"deleteNote was refused"}}function BF(e,t){return typeof e.convertNote!="function"?{ok:false,code:"unsupported",reason:"convertNote is not available"}:e.convertNote(t.fromKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertNote was refused"}}function $F(e,t){return typeof e.convertAllNotes!="function"?{ok:false,code:"unsupported",reason:"convertAllNotes is not available"}:e.convertAllNotes(t.fromKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertAllNotes was refused"}}function qF(e,t){if(typeof e.setNoteProperties!="function")return {ok:false,code:"unsupported",reason:"setNoteProperties is not available"};let n=t.scope??"document";return e.setNoteProperties({scope:n,sectionIndex:t.sectionIndex,footnote:t.footnote,endnote:t.endnote})?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"setNoteProperties was refused"}}function VF(e,t,n){switch(t.type){case "toggleMark":{let r=Um.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=zm(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};e.setRunProperty(r.localName,r.attributes);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Rd};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:Pm};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??Pm};break}case "setLineSpacing":e.setParagraphProperty("spacing",Hu({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...La("before",t.beforePt),...La("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperties([{localName:"jc",attributes:{val:t.align==="justify"?"both":t.align},physicalAlignment:true}]);break;case "setParagraphDirection":e.setParagraphProperties([{localName:"bidi",paragraphDirection:t.direction}]);break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.direction!==void 0?{direction:t.direction}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,i=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||i!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,c=i??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,c):Math.min(l,c),i=t.orientation==="landscape"?Math.min(l,c):Math.max(l,c);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...i!==void 0?{pageHeightTwips:i}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertTextBox":return Qk(e);case "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Ia)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":if(Fn(e))return pg(e,{type:"deleteImage"},n?.editor);e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let i=Ju(e,t.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};e.setSelection(i.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "replaceMatch":return TI(e,t);case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "editHeaderFooter":return MF(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return AF(e,t);case "linkHeaderFooterToPrevious":return FF(e,t);case "unlinkHeaderFooterFromPrevious":return LF(e,t);case "setHeaderFooterOptions":return DF(e,t);case "setWatermark":return kI(e,t.watermark);case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return hR(e,t);case "insertPageField":return NF(e,t);case "insertNote":return HF(e,t);case "deleteNote":return _F(e,t);case "convertNote":return BF(e,t);case "convertAllNotes":return $F(e,t);case "setNoteProperties":return qF(e,t);case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{if(!Io(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Jr({command:t,part:e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:e.state().selection,cellSelection:e.state().cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return r.reason?{ok:false,code:"unsupported",reason:r.reason}:(Sy(r.text,r.html,WF(n?.editor)),{ok:true,changed:false})}case "cut":{let r=e.copyFlavours();if(r.reason)return {ok:false,code:"unsupported",reason:r.reason};Sy(r.text,r.html,WF(n?.editor)),e.deleteSelection();break}case "paste":{let r=t.html?sa(t.html):null;if(r&&Pu(r.bytes))return {ok:false,code:"unsupported",reason:"unsupported-content"};if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break}case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&Gm(t.range)){let a=jF(e,t.range);return a.ok?(e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}let r="anchor"in t&&Wt(t.anchor)?{anchor:t.anchor}:"range"in t&&di(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=RI(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let i=jF(e,o.selection);return i.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):i}default:return nl(t)?pg(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function WF(e){return e?Ze(Yr(e)):void 0}function KF(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of chunkDBOOTED4_cjs.Aa(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function a3(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of [o.header,o.footer])if(i){for(let a of chunkDBOOTED4_cjs.Aa(i.fragments))if(a.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function s3(e,t){return e.kind!==t.kind?false:e.kind==="headerFooter"&&t.kind==="headerFooter"?e.rId===t.rId:e.kind==="notesPart"&&t.kind==="notesPart"?e.noteKind===t.noteKind:true}function jF(e,t){let n=Bt(e.session,t.head.paragraphId,{kind:"body"}),r=Bt(e.session,t.anchor.paragraphId,{kind:"body"});if(!s3(n,r))return {ok:false,code:"unsupported",reason:"a selection cannot span two stories"};let o=e.activeScope();if(n.kind==="body")return o.kind!=="body"&&(e.exitNote?.(),e.exitHeaderFooter?.()),{ok:true,changed:false};if(n.kind==="headerFooter"){if(o.kind==="headerFooter"&&o.rId===n.rId)return {ok:true,changed:false};e.exitNote?.();let l=a3(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let i=KF(e,t.head.paragraphId);return i?(t.anchor.paragraphId===t.head.paragraphId?i:KF(e,t.anchor.paragraphId))!==i?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===i?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(i)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}var l3=new Set(["resolveAllReviewChanges","setReviewChangesAuthor","proposeInsertion","proposeDeletion","proposeReplacement","replaceMatch","toggleMark","setMarkAttr","setAlignment","setParagraphDirection","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),c3=Object.freeze({ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document; begin a new group after end(), detach, or load"}),Iy=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,i=Date.now(),a=this.burst,s=a?.key===o&&i-a.time<=250?a.count+1:1;this.burst={key:o,time:i,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch,lastOutcome:null},r=d3(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}validate(t){let n=t?.historyGroup;return n===void 0?null:this.token(n)===void 0?c3:null}token(t){let n=this.records.get(t);return n&&t.state==="open"?n.token:void 0}gate(t,n){let r=this.validate(n);return r||n?.historyGroup===void 0?r:l3.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let i=r?.historyGroup,a=i&&this.records.get(i);if(!a){let d=Na(t,void 0,o);return n&&this.diagnoseWrites(n,d),d}let s,l=chunkWO4V6PNS_cjs.Al(a.token,(d,u)=>s={kind:d,reason:u},()=>Na(t,a.token,o));if(!l.ok)return l;let c=this.settle(a,s);return c.kind==="started"&&n?this.diagnoseWrites(n,l,true):this.burst=void 0,{...l,history:c}}automationFrames(t){let n=this.token(t)===void 0?void 0:this.records.get(t);if(!n)return null;let r=[];return {bind:(o,i)=>{let a,s=chunkWO4V6PNS_cjs.Al(n.token,(l,c)=>a={kind:l,reason:c},()=>Na(o,n.token,i));return a&&r.push(a),s},finish:()=>{if(r.length===0)return null;this.burst=void 0;let o=r.find((i,a)=>i.kind==="split"||a>0&&i.kind==="started");return this.settle(n,o?{kind:"split",reason:o.reason}:r[0])}}}settle(t,n){let r=n?.kind==="split"||n?.kind==="started"&&t.committed,o=n===void 0?{kind:"none",reason:"no-history"}:r?{kind:"split",reason:n.reason??(t.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:n.kind};return n&&(t.committed=true,t.undoEpoch=this.undoEpoch),t.lastOutcome=o,o.kind==="split"&&this.diagnose({kind:"split",reason:o.reason??"history-boundary"}),o}};function d3(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},get lastOutcome(){return e.lastOutcome},end(){e.closed=true,e.owner=void 0;}})}function UF(e,t,n){let r={generation:-1,token:{}};return new Iy(()=>{let{mounted:o,generation:i}=e();return o?(r.generation!==i&&(r={generation:i,token:{}}),r.token):null},t,n)}var zF={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none",collaborationStatus:"inactive"};function GF(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:eR(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`,collaborationStatus:e.collaborationStatus}}function ZF(){let e={...zF};return {moved(t,n){let r=GF(t,n),o=Fd(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter&&r.collaborationStatus===e.collaborationStatus;return e=r,!o},adopt(t){e=GF(t.state(),t);},reset(){e={...zF};}}}var XF=512*1024;function u3(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),i=-1;for(let c=n-22;c>=o;c-=1)if(r.getUint32(c,true)===101010256){i=c;break}if(i<0)return false;let a=r.getUint16(i+10,true),s=r.getUint32(i+16,true),l=0;for(let c=0;c<a;c+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}var f3=2e3,p3=40;function YF(e){let t=null,n=()=>Ze(e.node?.()??null),r=()=>{if(!t)return null;let{bytes:o}=t;return t.cancel(),t=null,o};return {shouldYield:o=>typeof n().requestAnimationFrame=="function"&&typeof n().cancelAnimationFrame=="function"&&(o.byteLength>=XF||u3(o,XF)),schedule(o){let i=ut(()=>e.node?.()??null),a=null,s=null,l=e.prepare?()=>e.prepare(o):null,c=false,d=false,u=b=>{try{return b()}catch(y){throw t===g&&(t=null,e.scheduled()),y}},f=()=>{if(c)return;if(l){let y=l;l=null;let h;try{h=y();}catch{}if(typeof h=="function"){l=h,vl(f,n());return}if(!h){a=i.setTimeout(f,0);return}let v=true,x=()=>{v&&(v=false,a!==null&&i.clearTimeout(a),a=i.setTimeout(f,0));};a=i.setTimeout(x,f3),h.then(x,x);return}d=true,u(()=>e.mount(o));let b=()=>{if(!(c||t!==g)){if(e.continueOpen&&!u(()=>e.continueOpen(p3))){vl(b,n());return}t=null,e.continueOpen&&e.scheduled();}};e.continueOpen?vl(b,n()):t=null;},m=i.requestAnimationFrame(()=>{s!==null&&i.clearTimeout(s),s=null,a=i.setTimeout(f,0);});s=i.setTimeout(()=>{i.cancelAnimationFrame(m),f();},250);let g={bytes:o,mounted:()=>d,cancel:()=>{c=true,i.cancelAnimationFrame(m),a!==null&&i.clearTimeout(a),s!==null&&i.clearTimeout(s);}};t=g,e.scheduled();},cancel:r,flush(){let o=t;if(!o)return;let i=o.mounted();r();try{if(i||e.mount(o.bytes),e.continueOpen)for(;!e.continueOpen(Number.POSITIVE_INFINITY););}catch(a){throw e.scheduled(),a}i&&e.scheduled();},isScheduled:()=>t!==null}}var Py=40,Ry=16,QF=32,Ty=new WeakMap;function Ey(e,t){let n=chunkWO4V6PNS_cjs.yj(t.contentLockPolicy);return n?{...e,contentLockPolicy:n}:e}function m3(e,t,n){let r=chunkWO4V6PNS_cjs.Fe(e),o=()=>{let i=performance.now()+Py;for(;;){let a=r.next();if(a.done){let s=chunkEOTAXOJY_cjs.k(a.value,t);return Ty.set(e,s),n(s)}if(performance.now()>=i)return o}};return o}function JF(e){let t=Ty.get(e);return t===void 0?{}:(Ty.delete(e),{openedSession:t,progressiveOpen:true})}function eL(e,t,n){return r=>m3(r,e(),o=>{let i=o.ok?t(r,o.session):null;return o.ok&&i?g3(o.session,i,n):void 0})}function tL(e){let t=null;return {set(n){t=n;let r=e();r&&Vg(r,n);},adopt:n=>Vg(n,t)}}function g3(e,t,n){let r=e.part().root.children.find(g=>g.kind==="body"),o=r?.kind==="body"?r.children:[],i=[];for(let g of o){if(g.kind==="table")for(let b of g.children)i.push(b);i.push(g);}let a=[];for(let g=0;g<o.length;){let b=o[g];if(b.kind==="table"){for(let v=0;v<b.children.length;v+=QF){let x=v;a.push(()=>{EA(e,b,x,x+QF);});}a.push(()=>py(e,[b])),g+=1;continue}let y=g;for(;y<o.length&&y-g<Ry&&o[y].kind!=="table";)y+=1;let h=o.slice(g,y);a.push(()=>py(e,h)),g=y;}let s=0,l=0,c=false,d,u=chunkWO4V6PNS_cjs.Pa(e.part().root),f=[()=>{let g=performance.now()+Py;return u(()=>performance.now()>=g)},()=>(e.reviewItems(),true)],m=()=>{if(!t())return;let g=performance.now()+Py;if(!c){for(;s<a.length&&performance.now()<g;)a[s++]();return s<a.length||(c=true,d=n()),m}if(l<i.length){for(;l<i.length&&performance.now()<g;)chunkDBOOTED4_cjs.Ie(i.slice(l,l+Ry)),l+=Ry;return m}let b=f[0];return b?(b()&&f.shift(),m):d};return m}function nL(e){return {...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...e.lockedControlNavigation==="atomic"?{lockedControlNavigation:"atomic"}:{}}}function rL(e){let t=[];return Object.assign(r=>{for(let o of [...e.customNodeDiagnostics,...t])try{o(r);}catch{}},{observe(r){t.push(r);}})}function oL(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function iL(e){return e.kind==="comment"}function aL(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let i=e.bodyOrder(),a=i.get(r.paragraphId)??-1,s=i.get(o.paragraphId)??-1;if(a===-1||s===-1){let c=e.openStoryOrder();a=c.get(r.paragraphId)??-1,s=c.get(o.paragraphId)??-1;}return a===-1||s===-1?null:a<s||a===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function y3(e){let t=new Map;for(let n of e){let r=n.item;if(!iL(r))continue;let o=t.get(r.id);if(o===void 0){t.set(r.id,r);continue}if(o.comment!==r.comment)return "ambiguous"}return t}function b3(e,t){let n=e.filter(i=>i.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(i=>i.item).filter(iL);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let i of r)if(i.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function sL(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing"){let u=e.surface?.commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"comment-resolve"),f="the document is open for viewing";return Bn(u??f,f,"locked")}let r=e.placements({pairReplacements:false}),o=b3(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let i=y3(r);if(i==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let a=o,s=new Set;for(;a.parentId!==void 0&&!s.has(a.id);){s.add(a.id);let u=i.get(a.parentId);if(!u)break;a=u;}let l=false,c=false,d=e.surface.commitReviewOps(u=>{let f=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(a.id,n,{historyToken:u}),c=l&&e.surface.session.packageRevision()!==f,{committed:c}},"comment-resolve");return l?(c&&e.bump(),{ok:true,changed:c}):Bn(d,"the comment could not be resolved","notFound")}function lL(e,t,n){return e.kind==="comment"&&e.resolved?{ok:false,code:"unsupported",reason:"a resolved comment takes no replies"}:n.length===0||t.trim().length===0?{ok:false,code:"invalidArgs",reason:"a reply needs both an author and text"}:e.kind==="custom"?{ok:false,code:"unsupported",reason:"a custom node card takes no replies"}:null}var v3=Object.freeze({ok:false,code:"invalidArgs",reason:"pass the author as a string and options last, or options alone in place of the author"});function cL(e,t){if(e==null||typeof e=="string")return [e??void 0,t];let n=typeof e=="object"?Object.getPrototypeOf(e):void 0;return !(n===null||n!==void 0&&Object.getPrototypeOf(n)===null)||Array.isArray(e)||t!==void 0?v3:[void 0,e]}var dL=()=>`${new Date().toISOString().slice(0,19)}Z`;function uL(e){let t=(i,a)=>{let s=e.historyGroups.validate(i);if(s)return s;let l=e.surface();return l?e.historyGroups.run(l,void 0,i,a):a()},n=(i,a)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:nn};let s=e.surface();s?.flushPendingInput();let l=e.commentTargetRange();if(!l||!s)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let c=(a??e.author()??"").trim();if(c.length===0||i.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let d=null,u=s.commitReviewOps(f=>(d=s.session.replyToComment(null,{paragraphId:l.from.paragraphId,start:l.from.offset,end:l.to.offset,...l.to.paragraphId===l.from.paragraphId?{}:{endParagraphId:l.to.paragraphId}},i,c,dL(),e.storyScopeOfParagraph(l.from.paragraphId),void 0,{historyToken:f}),{committed:d!==null}),"comment-add");return d===null?Bn(u,"the comment could not be committed"):{ok:true,changed:true}},r=i=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:nn};let a=e.surface(),s=kr(e.placements,i)?.item;if(!s||!a)return {ok:false,code:"notFound",reason:"no review item with that key"};if(s.kind==="revision")return e.resolveReviewItem(i,"reject");if(s.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};let l=false,c=a.commitReviewOps(d=>{let u=e.noteHomeOf(s),f=u===null?null:chunkWO4V6PNS_cjs.pc(u);return l=a.session.deleteComment(s.id,e.storyScopeOfReviewItem(s),f?.noteId,{historyToken:d}),{committed:l}},"comment-delete");return l?(e.bump(),{ok:true,changed:true}):Bn(c,"the comment could not be deleted")},o=(i,a,s)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:nn};let l=e.surface();l?.flushPendingInput();let c=kr(e.placements,i)?.item,d=Ta(c)?.insertion??c;if(!d||!l)return {ok:false,code:"notFound",reason:"no review item with that key"};let u=chunkWO4V6PNS_cjs.Sj(d);if(!u)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let f=(s??e.author()??"").trim(),m=lL(d,a,f);if(m)return m;let g=d.kind==="comment"?d.id:null,b=null,y=l.commitReviewOps(h=>(b=l.session.replyToComment(g,{paragraphId:u.start.paragraphId,start:u.start.offset,end:u.end.offset},a,f,dL(),e.storyScopeOfReviewItem(d),void 0,{historyToken:h}),{committed:b!==null}),"comment-reply");return b===null?Bn(y,"the reply could not be committed"):{ok:true,changed:true}};return {addComment:(i,a,s)=>{let l=cL(a,s);if(!Array.isArray(l))return l;let[c,d]=l;return t(d,()=>n(i,c))},acceptReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"accept")),rejectReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"reject")),setCommentResolved:(i,a,s)=>t(s,()=>sL({reviewEnabled:e.reviewEnabled,editingMode:e.editingMode(),placements:e.placements,surface:e.surface(),proReviewReason:nn,bump:e.bump},i,a)),deleteReviewItem:(i,a)=>t(a,()=>r(i)),replyToReviewItem:(i,a,s,l)=>{let c=cL(s,l);if(!Array.isArray(c))return c;let[d,u]=c;return t(u,()=>o(i,a,d))}}}var Cy=new WeakMap;function fL(e,t){Cy.set(e,t);}function pL(e,t){return Cy.get(e)?.automationFrames(t)??null}function mL(e,t){return Cy.get(e)?.token(t)!==void 0}var x3=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),w3=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function gL(e,t){let n=new Map,r=s=>{if(s===void 0||!w3.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(chunkMOYYRVFV_cjs.g(e));let o=e?.substitutions??[],i=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])i.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of chunkMOYYRVFV_cjs.a([e?.supportedFamilies]))r(s);for(let s of x3)r(s);for(let s of t)r(s);let a=[...n.values()];return a.sort((s,l)=>s<l?-1:s>l?1:0),a}var hL=e=>new chunkUKVVUHZL_cjs.a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),yL=e=>new chunkUKVVUHZL_cjs.a(e.reason,e.reason==="overLimit"?"an embedded font exceeds the font byte budget":"an embedded font part declares an invalid family name",{request:e.request});function bL(e,t){return chunkMOYYRVFV_cjs.C(e,t)}function Oy(e,t,n){return chunkMOYYRVFV_cjs.D(e,t,n)}var vL=chunkDBOOTED4_cjs.a;function dn(e,t){if(!e)throw new Error(t)}function xL(e){let t=0;for(let n=0;n<e.length;n+=4){let r=(e[n]||0)*16777216+(e[n+1]||0)*65536+(e[n+2]||0)*256+(e[n+3]||0)>>>0;t=t+r>>>0;}return t}function wL(e,t=0){dn(e instanceof Uint8Array&&e.length>=12&&e.length<=vL,"Unsupported font byte length"),dn(Number.isSafeInteger(t)&&t>=0,"Invalid face index");let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(k,R)=>{dn(Number.isSafeInteger(k)&&Number.isSafeInteger(R)&&k>=0&&R>=0&&k+R<=e.length,"Font range exceeds source");},o=k=>String.fromCharCode(...e.subarray(k,k+4));if(o(0)!=="ttcf")return dn(t===0,"Face index requires a collection"),dn([65536,1330926671,1953658213].includes(n.getUint32(0)),"Unsupported SFNT version"),e.slice();let i=n.getUint32(4);dn(i===65536||i===131072,"Unsupported TTC version");let a=n.getUint32(8);dn(a>0&&t<a,"Collection face absent"),r(12,a*4+(i===131072?12:0));let s=12+a*4+(i===131072?12:0),l=n.getUint32(12+t*4);r(l,12);let c=n.getUint32(l);dn([65536,1330926671,1953658213,1954115633].includes(c),"Unsupported face version");let d=n.getUint16(l+4);dn(d>0,"Missing face tables"),r(l,12+d*16),dn(l>=s,"Selected directory overlaps collection header");let u=[[0,s],[l,l+12+d*16]],f=[],m=new Set;for(let k=0;k<d;k++){let R=l+12+k*16,C=o(R),P=n.getUint32(R+8),E=n.getUint32(R+12);dn(/^[\x20-\x7e]{4}$/.test(C)&&!m.has(C),"Invalid or duplicate table tag"),m.add(C),r(P,E);for(let[w,S]of u)dn(E===0||P>=S||P+E<=w,"Table overlaps collection directory");f.push({name:C,offset:P,length:E,destination:0});}let g=f.filter(k=>k.length>0).sort((k,R)=>k.offset-R.offset);for(let k=1;k<g.length;k++)dn(g[k].offset>=g[k-1].offset+g[k-1].length,"Selected face tables overlap");let b=f.find(k=>k.name==="head");dn(b&&b.length>=54,"Missing or truncated head table"),f.sort((k,R)=>k.name<R.name?-1:k.name>R.name?1:0);let y=12+d*16;for(let k of f)k.destination=y,y+=k.length+3&-4,dn(y<=vL,"Standalone face exceeds byte ceiling");let h=new Uint8Array(y),v=new DataView(h.buffer);v.setUint32(0,c),v.setUint16(4,d);let x=2**Math.floor(Math.log2(d));v.setUint16(6,x*16),v.setUint16(8,Math.log2(x)),v.setUint16(10,d*16-x*16);for(let[k,R]of f.entries()){let C=12+k*16;for(let P=0;P<4;P++)h[C+P]=R.name.charCodeAt(P);h.set(e.subarray(R.offset,R.offset+R.length),R.destination),R.name==="head"&&v.setUint32(R.destination+8,0),v.setUint32(C+4,xL(h.subarray(R.destination,R.destination+R.length))),v.setUint32(C+8,R.destination),v.setUint32(C+12,R.length);}return v.setUint32(b.destination+8,2981146554-xL(h)>>>0),h}var SL=Object.freeze({installed:0,alias:()=>{},showIn(){},dispose(){}});function S3(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1)t=t*31+n.charCodeAt(r)>>>0;return `docx-embedded-${t.toString(36)}`}var tf=e=>e.trim().toLowerCase();function nf(e){let t=e??(typeof globalThis.document<"u"?globalThis.document:void 0),n=t?.fonts,r=t?.defaultView?.FontFace;return !n||typeof r!="function"?{}:{fontSet:n,createFontFace:(o,i,a)=>new r(o,i.slice().buffer,a)}}async function kL(e,t=nf(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return SL;let i=new Map;for(let u of e){let f=tf(u.request.family),m=i.get(f);m?m.push(u):i.set(f,[u]);}let a=new Map,s=[],l=[];if(await Promise.all([...i].map(async([u,f])=>{let m=S3(f.map(b=>`${b.hash}:face:${b.faceIndex}`)),g=false;await Promise.all(f.map(async b=>{try{let y=b.bytes.length>=4&&b.bytes[0]===116&&b.bytes[1]===116&&b.bytes[2]===99&&b.bytes[3]===102;if(y&&b.faceIndex===0&&!chunkDBOOTED4_cjs.l(b.bytes,0).valid)throw new Error("Invalid collection face");let h=y&&b.faceIndex!==0?wL(b.bytes,b.faceIndex):b.bytes;if(!y&&b.faceIndex!==0)throw new Error("Font face index requires a collection");let v={weight:String(b.request.weight),style:b.request.style},x=o(m,h,v);await x.load(),r.add(x),s.push({set:r,face:x}),l.push({alias:m,bytes:h,descriptors:v}),g=!0;}catch{}})),g&&a.set(u,m);})),s.length===0)return SL;for(let u of n){let f=tf(u.from.family);if(a.has(f))continue;let m=a.get(tf(u.to.family));m!==void 0&&a.set(f,m);}let c=false,d=new WeakSet([r]);return {installed:s.length,alias:u=>c?void 0:a.get(tf(u)),showIn(u){if(c)return;let f=nf(u);if(!(!f.fontSet||!f.createFontFace||d.has(f.fontSet))){d.add(f.fontSet);for(let{alias:m,bytes:g,descriptors:b}of l)try{let y=f.createFontFace(m,g,b);f.fontSet.add(y),s.push({set:f.fontSet,face:y}),y.load().catch(()=>{});}catch{}}},dispose(){if(!c){c=true;for(let{set:u,face:f}of s)try{u.delete(f);}catch{}}}}}var Ay=44,Nl=.1,Hl=5;var Wa={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},k3={type:"fit",fit:"pageWidth"},rf={type:"fixed"};function of(e){return e==="auto"?Wa:!e||typeof e!="object"?null:e.type==="fixed"?rf:e.type==="fit"&&e.fit==="pageWidth"?af(e,Wa)?Wa:e:null}function af(e,t){return e===t?true:e.type!==t.type?false:e.type!=="fit"||t.type!=="fit"?true:e.fit===t.fit&&Object.is(e.minZoom,t.minZoom)&&Object.is(e.maxZoom,t.maxZoom)}function Fy(e,t,n="float"){return e?.type!=="fit"?t:n==="shrinkPage"?e.minZoom!==void 0&&Number.isFinite(e.minZoom)?My(e.minZoom):.1:e.maxZoom!==void 0&&e.maxZoom<5?e.maxZoom:null}function Ka(e){return e.type==="fit"}function IL({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let i=Number.isFinite(n)&&n>0?n:0,a=Math.max(e-2*i,e*.5),s=Number.isFinite(r)?My(r):.1,l=Number.isFinite(o)?My(o):5,c=Math.floor(a/t*100)/100;return Math.min(Math.max(c,s),Math.max(l,s))}function My(e){return Math.min(Math.max(e,.1),5)}var I3=88;function R3(e,t=false){let n=$t(e);if(!n)return null;let r=n.clientWidth;if(!Number.isFinite(r)||r<=0)return null;let o=n.ownerDocument.defaultView?.getComputedStyle(n);if(t&&n.hasAttribute("data-review-pane")){let s=Number.parseFloat(o?.getPropertyValue("--docx-review-strip")??""),l=Number.isFinite(s)?s:I3,c=l/2,d=Number.parseFloat(o?.getPropertyValue("--docx-nav-shift")??""),u=Number.parseFloat(o?.getPropertyValue("--docx-review-gutter-start")??""),f=(Number.isFinite(d)?d:0)+(Number.isFinite(u)?u:c)-c;return Math.max(r-l-Math.max(f,0),0)}if(!o)return r;let i=Number.parseFloat(o.paddingLeft)||0,a=Number.parseFloat(o.paddingRight)||0;return Math.max(r-i-a,0)}function RL(e){let t=null,n=null,r=ut(()=>n),o=null,i=null;function a(){o!==null&&(r.cancelAnimationFrame(o),o=null);}function s(){let c=e.mode();if(!Ka(c))return;let d=e.container();if(!d)return;let u=e.reviewPaneScrolls?.()===true&&Fy(c,e.zoom())!==null,f=R3(d,u);if(f===null)return;let m=e.pageWidthPx();if(m===null)return;i=e.pageWidthTwips();let g=IL({availableWidthPx:f,pageWidthPx:m,...c.minZoom!==void 0?{minZoom:c.minZoom}:{},...c.maxZoom!==void 0?{maxZoom:c.maxZoom}:{}});if(g===null||g===e.zoom())return;let b=$t(d),y=b!==null&&b.scrollLeft===0;e.applyZoom(g),y&&b&&b.scrollLeft!==0&&(b.scrollLeft=0);}function l(){if(!n||typeof Ze(n).requestAnimationFrame!="function"){s();return}r.migrate(),o===null&&(o=r.requestAnimationFrame(()=>{o=null,s();}));}return {refitIfPageResized(){let c=e.pageWidthTwips();c===null||c===i||s();},attach(){this.detach();let c=e.container();if(!c)return;let d=$t(c);if(!d)return;n=d;let u=Ze(d);typeof u.ResizeObserver=="function"&&(t=new u.ResizeObserver(l),t.observe(d)),s();},refit:s,detach(){a(),t?.disconnect(),t=null,n=null,i=null;}}}function TL(e,t){let n=e.zoom!==void 0&&Number.isFinite(e.zoom)&&e.zoom>=.1&&e.zoom<=5?e.zoom:null,r=n??1,o=of(e.zoomMode??(n!==null?rf:"auto"))??Wa;function i(l,c){if(l===r)return c?.(),true;let d=t.surface();return d&&!Kg(d,l*(96/72))?false:(r=l,c?.(),t.bump(),t.emitSelectionChange(),true)}function a(){o=rf,s.detach();}let s=RL({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{i(l);},reviewPaneScrolls:()=>t.reviewPaneScrolls?.()===true});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{Ka(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let c=Ka(o);return l===r?c?(a(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:i(l,c?a:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let c=of(l);return c?af(c,o)?{ok:true,changed:false}:(o=c,Ka(c)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function PL(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function EL(e,t){return {getZoom:()=>e.zoom(),setZoom:n=>e.setZoom(n),getZoomMode:()=>e.mode(),setZoomMode:n=>e.setZoomMode(n),getRenderScale:()=>e.scale(),getPageGeometry:()=>{let n=t();return n?n.layout().pages.map(r=>({index:r.index,box:PL(r.box),contentBox:PL(r.contentBox)})):[]}}}var CL=new Map;function OL(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let i=chunkXMJKFURD_cjs.c(o,t);return n={slots:o,colors:t,value:i},i},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunkXMJKFURD_cjs.b(t)}),r.value.get(o))}}function ML(e){let t=chunkWO4V6PNS_cjs.Xi(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(i18n.locales,n);){let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s);}let r=new Intl.Locale(t).maximize(),o=n?void 0:Object.keys(i18n.locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),i=n||o||"en",a=i18n.createT(i18n.deepMerge(i18n.en,i==="en"?void 0:i18n.locales[i]),i);return {locale:t,labels:{title:a("toolbar.tableOfContents")}}}function AL(e){let t=e.mode,n=e.translate,r=n?chunkXMJKFURD_cjs.m(n):chunkXMJKFURD_cjs.l,o=ML(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:i=>Jm(t,i),setMode(i){return t===i?false:(t=i,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(i){if(n===i)return null;n=i;let a=i?chunkXMJKFURD_cjs.m(i):chunkXMJKFURD_cjs.l;return chunkXMJKFURD_cjs.k(r)===chunkXMJKFURD_cjs.k(a)?(r=a,null):(r=a,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(i){let a=ML(i);return o.locale===a.locale?null:(o=a,o.labels)}}}function FL(e,t){return {setTranslate(n){let r=e.setTranslate(n);t.surface()?.setTranslate(e.translate()),r!==null&&(t.surface()?.setDrawingStrings(r),t.bump(),t.emitSelectionChange());},setLocale(n){let r=e.setLocale(n);r!==null&&(t.surface()?.setLocale(e.locale()),t.surface()?.setTocLabels(r),t.bump(),t.emitSelectionChange());}}}var C3=Object.freeze({kind:"body"}),O3=Object.freeze([]);function M3(e){let t=Tw(e.fontShaping),n,r=null,o=null,i=-1,a=()=>o!==null||!!L&&bi(L),s=AL(e),l=ah(e.author),c=e.container??null,d=chunkV3N4SOAK_cjs.a(e.modules),u=rL(d),f=d.review!==null,m=vF(d.review?.pane,{enabled:f,changed:(O,Q)=>{jt&&O.revisionsIn!==Q.revisionsIn&&!m.shows(L?.session.reviewItems()??[])&&(jt=false),ue(),Ve(),yt.refit();}}),g=null,b=new WeakMap,y=YF({mount:O=>Fi(O),continueOpen:O=>{if(!L)return true;let Q=Oe.continueOpen(()=>Ra(L,O));return Q&&Oe.openSettled(L),Q},prepare:eL(()=>Ey(my(d,u),e),(O,Q)=>r===O?null:(o=Q,()=>o===Q),()=>fe.schedule(true)),scheduled:()=>{ue(),Ve();},node:()=>c}),h=s.mode()==="view"?"viewing":"editing",v=null,x,k=false,R=TT(m.pairsReplacements,()=>L),C=xu(),P=OL(e.revisionStyles),E=chunkXMJKFURD_cjs.e(),w=false,S=false,F=null,A=()=>({reviewEnabled:f,hasAuthor:!!l}),$=false,W=null,U=DI({stillMissing:()=>!T&&l===void 0&&ir(null)===xr,emit:O=>ke(O)}),_=s.openingModeDecision(A());_.mode!==null&&(h=_.mode),_.rejection!==null&&(F=_.rejection),U.report(_.rejection);let L=null,Z=null,ee=tL(()=>L),te=PF(()=>{ue(),Ve();}),me=null,le=ZF(),D=_A({surface:()=>L,destroyed:()=>T,changed:()=>(ue(),Ve()),emitError:O=>ke(O),capability:O=>HA(O,T,f,ao)}),T=false,B,q,j=null,X=()=>{},oe=0;function H(){j?.dispose(),j=null;}let V=0,z,Y=()=>typeof e.fonts=="function"?z:e.fonts,fe=MA(()=>{let O=o??L?.session;if(T||!O)return null;let Q=o?void 0:Lt().formatting?.fontFamily;return {generation:V,dynamic:typeof e.fonts=="function",families:()=>OA(O,Q,chunkMOYYRVFV_cjs.g(Y()))}},async O=>{let Q=o?{session:o}:L;Q&&await $l(V,Q,O);}),ne=false,ce=null,ve=O=>(ce||(ce=wA(c?wi(c.ownerDocument):null)),ce(O)),Re=new Set,ht=new Set,Ae=O=>Re.has(O.toLowerCase())||j?.alias(O)!==void 0,Fe=()=>!L||ne?O3:kA(L.session.renderedFontFamilies(),Ae,ve,ht),we=0,Je=null,Zt,Se=null,Me=-1,tt=0,Et=-1,jt=false,un=e.reviewDisplayMode??(f?"all-markup":"proposed");if(!["all-markup","simple-markup","proposed","original"].includes(un))throw new TypeError("Invalid reviewDisplayMode");if(e.reviewDisplayMode&&e.reviewDisplayMode!=="proposed"&&!f)throw new TypeError("reviewDisplayMode requires a review module");let Fo=wu({fieldResults:e.fieldResults,collaborationModel:d.collaboration??void 0}),De=yF({surface:()=>L,destroyed:()=>T,editingMode:()=>h,hostViewOnly:()=>s.mode()==="view",publish:()=>{ue(),Ve();},decision:()=>yn(),tracking:Ho,adopt:O=>{F=O.rejection??ir(null),O.mode!==null&&(S=O.mode==="viewing",io(O.mode)),ue(),Ve();}});function ue(){we+=1;}let qe=CM(Lt,()=>c?.ownerDocument??null),{emitError:ke,emitDocumentChange:Mi,emitSelectionChange:Ve}=qe,Oe=KM({modules:d,events:qe,customNodes:u,onOpenCrash:te.crash}),Ai=()=>h==="suggesting",fn=UM(e.revisionMarkup,{container:()=>c,destroyed:()=>T,contribution:()=>d.review,translate:()=>s.translate(),apply:O=>{L?.setRevisionMarkup(O),ue();},changed:O=>{Ve(),qe.emitRevisionMarkupChange(O);}});function Bl(O){fn.destroyDialog(),j?.showIn(O),yt.detach(),yt.attach(),ue(),Ve();}let at=()=>{};function hn(){at(),fn.destroyDialog(),me?.(),me=null,L?.destroy(),L=null,le.reset(),tt+=1;}let yt=TL(e,{container:()=>c,surface:()=>L,bump:ue,emitSelectionChange:Ve,reviewPaneScrolls:()=>m.current().overflow==="scroll"}),oo=()=>yt.scale(),Tr=sF({surface:()=>L,container:()=>c,flushOpen:()=>y.flush()});function Fi(...O){let Q=n?.source!==void 0;try{if(r===O[0]){r=null,Er(O[0],!0);return}nr(...O),n?.mounted(O[0]);}catch(re){if(Oe.openCrashed(re),n?.mounted(O[0],re),!Q)throw re}}function Lo(){return {scale:oo(),...D.snapshot(),defaultFontFamily:chunkMOYYRVFV_cjs.g(Y()),translate:s.translate(),drawingStrings:s.drawingStrings(),locale:s.locale(),...l?{author:l}:{},...P.current()!==void 0?{revisionStyles:P.current()}:{},reviewAuthorSlots:E,revisionAuthorVisibility:C,revisionMarkup:fn.current(),...Ey(my(d,u),e),pairsReplacements:R.lightsPair,...B?{measurer:B,...q?{producer:q}:{}}:{},...j?{fontAlias:j.alias}:{},...nL(e),...Fo.mode==="editable"?{fieldResults:Fo.mode}:{}}}function nr(O,Q,re){if(re??=b.get(O),b.delete(O),o=null,!c){hn(),g=O,re&&b.set(O,re),te.clear(),Oe.openDeferred(),ue();return}Oe.openMounting(),hn();let He=C.stateKey,xe=Al(c,O,{...Lo(),...D.surfaceOptions(),initialSelection:Q,initialTextFormInput:re,editingMode:h==="suggesting"?"suggest":h==="viewing"?"view":"edit",revisionDisplayMode:f?un:"proposed",...Oe.surfaceHooks(Ai,()=>L),...JF(O),...d.collaboration?{collaborationModel:d.collaboration}:{},onHostMoved:Bl,onTrackedChange:()=>{jt||!m.opensOnTrackedChange()||(jt=true,ue(),Ve());},tocLabels:s.tocLabels(),onChange:lt=>{if(!L)return;ue(),De.sync(),fe.schedule();let Ue=f&&un!==L.revisionDisplayMode();Ue&&(un=L.revisionDisplayMode());let Pt=He!==C.stateKey||Ue;He=C.stateKey,!(!Pt&&!le.moved(lt,L))&&Ve();}});if(!xe.ok){te.reject(xe.reason,xe.limit,xe.detail),ue(),ke(tn(xe.reason,`failed to open document: ${xe.reason}`)),Oe.openRejected(xe.reason,xe.limit,xe.detail);return}te.clear(),L=xe.surface,j?.showIn(c.ownerDocument),i=V,Tr.attach(L,n?.source!==void 0),De.prime(),jt=f&&m.opensOnLoad(L.session.reviewItems()),le.adopt(L),W!==null?ar(W,false):Cr(),oL(L,d),bi(L)||Oe.openSettled(L),tt+=1,L.setEditable(h!=="viewing"),Z!==null&&L.setRemoteCaretLabelHost(Z),ee.adopt(L),v!==null&&L.setReviewActivationExclusions(v,{formattingKinds:x}),me=BA(xe.surface,{refitIfPageResized:()=>yt.refitIfPageResized(),bump:ue,emit:Mi}),n?.contentMounted(O),yt.attach(),ue(),Mi({revision:L.session.packageRevision(),source:n?.source??"load"}),Ve(),fe.schedule(true);}function Er(O,Q=false){if(y.cancel(),te.clear(),o=null,r=null,n?.source&&!Q&&c&&y.shouldYield(O)){r=O,y.schedule(O);return}b=new WeakMap,Oe.openStarted(O),jt=false,V+=1,E=chunkXMJKFURD_cjs.e(),C.showAll(),B=void 0,q=void 0,z=void 0,Re=new Set,ht=new Set,H(),X(),X=()=>{},ne=false,c&&!n?.source&&RE(c),!Q&&c&&y.shouldYield(O)?(hn(),y.schedule(O)):Fi(O);}function ja(O,Q=V){jM(O,{config:e,events:qe,diagnostics:Oe},()=>!T&&Q===V);}async function $l(O,Q,re){let He=Ue=>ja(Ue,O),xe=e.fonts,lt=Q.session.embeddedFonts();if(!(!xe&&lt.length===0)){ne=true,ue();try{let{plan:Ue,request:Pt}=chunkMOYYRVFV_cjs.y(Q.session,re,Y()),ze=!!c&&wi(c.ownerDocument)!==null?chunkMOYYRVFV_cjs.B(Ue.fallbacks,ve):Ue.fallbacks,nt=typeof xe!="function"?xe:z?await chunkMOYYRVFV_cjs.n([z,chunkMOYYRVFV_cjs.j(Be=>xe(Be))],Pt,{onOriginFailure:({cause:Be})=>He(ia(Be))}):await xe(Pt),Dt=typeof xe=="function"?chunkMOYYRVFV_cjs.b(nt):nt;if(T||O!==V){O===V&&(ne=!1);return}if(z=nt,lt.length===0&&(!Dt||nt?.supportedFamilies?.length&&!chunkMOYYRVFV_cjs.b(nt))){ne=!1,ue(),Ve();return}let Xe=(Dt&&"maxFontBytes"in Dt?Dt.maxFontBytes:void 0)??chunkDBOOTED4_cjs.a,bt=bL(Dt?.sources??[],Xe),xt=bt.sources;for(let Be of bt.dropped)He(hL(Be));let Nt=Oy(lt,xt,Xe),Mr=!1,sr=()=>{if(!Mr){Mr=!0;for(let Be of Nt.dropped)He(yL(Be));}},st=chunkMOYYRVFV_cjs.z(chunkMOYYRVFV_cjs.f({epoch:O,...Dt,sources:xt},Nt),Ue,ze);if(st.sources.length===0){sr(),ne=!1,ue(),Dt&&He(new chunkUKVVUHZL_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let wt=await qs(st,void 0,t),Ar=()=>!T&&O===V?!1:(chunk5JPIEN54_cjs.u(wt),O===V&&(ne=!1),!0);if(Ar())return;let lr=Be=>{sr(),Be&&chunk5JPIEN54_cjs.u(Be),ne=!1,ue();},_o=(Be,Ct)=>{let mn=new Set;for(let Ht of Ct.sources??[]){let co=Be.fonts.resolve(Ht.request);co instanceof chunkDBOOTED4_cjs.d&&(He(ia(co)),mn.add(chunkDBOOTED4_cjs.h(Ht.request)));}return mn},Hi=_o(wt,st);try{if(Hi.size>0){let Be=xt.filter($o=>!Hi.has(chunkDBOOTED4_cjs.h($o.request))),Ct=Be.length!==xt.length;Ct&&(Nt=Oy(lt,Be,Xe));let mn=Nt.sources.filter($o=>Ct||!Hi.has(chunkDBOOTED4_cjs.h($o.request))),Ht=wt;if(st=chunkMOYYRVFV_cjs.z(chunkMOYYRVFV_cjs.f({epoch:O,...Dt,sources:Be},{sources:mn}),Ue,ze),st.sources.length===0)return lr(Ht);if(wt=await qs(st,void 0,t),chunk5JPIEN54_cjs.u(Ht),Ar())return;let co=_o(wt,st);if(co.size>0){let $o=Be.filter(ct=>!co.has(chunkDBOOTED4_cjs.h(ct.request))),Vl=Nt.sources.filter(ct=>!co.has(chunkDBOOTED4_cjs.h(ct.request))),Ul=wt;if(st=chunkMOYYRVFV_cjs.z(chunkMOYYRVFV_cjs.f({epoch:O,...Dt,sources:$o},{sources:Vl}),Ue,ze),st.sources.length===0)return lr(Ul);if(wt=await qs(st,void 0,t),chunk5JPIEN54_cjs.u(Ul),Ar())return}}}finally{sr();}let Bo=st.sources.map(Be=>{let Ct=wt.fonts.resolve(Be.request);return Ct instanceof chunkDBOOTED4_cjs.d||Ct.id!==Be.id?null:{request:Be.request,id:Ct.id,bytes:Ct.bytes,hash:Ct.hash,faceIndex:Ct.faceIndex}}).filter(Be=>Be!==null),Fr=await kL(Bo,nf(c?.ownerDocument),st.substitutions??[]);if(T||O!==V){Fr.dispose(),Ar();return}let za={embeddedFaces:j,coveredFontFamilies:Re,documentSubstitutedFamilies:ht,shapedMeasurer:B,shapedProducer:q,disposeShapedFonts:X};try{j=Fr,c&&Fr.showIn(c.ownerDocument),Re=IA(Bo,st.substitutions??[]),ht=chunkMOYYRVFV_cjs.w(st,Ue,wt.fonts);let Be=chunk5JPIEN54_cjs.X(oo(),{context:c?wi(c.ownerDocument):null,...j?{fontAlias:j.alias}:{}}),Ct=vA(wt,st,Be,oo(),++oe,mn=>!T&&O===V&&ja(mn));if(B=Ct.measurer,q=Ct.producer,ne=!1,L&&i===O&&uT(L,{measurer:B,producer:q,fontAlias:j?.alias,defaultFontFamily:chunkMOYYRVFV_cjs.g(Y())}),T||O!==V){Fr.dispose(),chunk5JPIEN54_cjs.u(wt);return}}catch(Be){throw !T&&O===V&&({embeddedFaces:j,coveredFontFamilies:Re,documentSubstitutedFamilies:ht,shapedMeasurer:B,shapedProducer:q,disposeShapedFonts:X}=za),Fr.dispose(),chunk5JPIEN54_cjs.u(wt),Be}X=()=>chunk5JPIEN54_cjs.u(wt),za.disposeShapedFonts(),za.embeddedFaces?.dispose(),ue(),Ve();}catch(Ue){if(T||O!==V)return;ne=false,ue(),He(ia(Ue));}}}let ql=jm();function Wl(){let O=L?.state()??null;return {scope:L?.activeScope?.()??C3,isLoading:te.parseError===null&&L===null&&g===null&&!y.isScheduled(),isOpening:y.isScheduled()&&!n?.source,parseError:te.parseError,openFailure:te.failure,editable:L!==null&&L.session.editable&&s.mode()!=="view"&&h!=="viewing"&&!(c&&Qn(c)),zoom:yt.zoom(),zoomMode:yt.mode(),selection:_d(L),selectionCollapsed:O===null||O.selection.anchor.paragraphId===O.selection.head.paragraphId&&O.selection.anchor.offset===O.selection.head.offset,formatting:yR(L),table:$d(L),tocContext:ql(O?.contextTocId??null),image:wr(L),page:{current:wg(L),total:ha(L)},canUndo:O?.canUndo??false,canRedo:O?.canRedo??false,pageSetup:bR(y,L),reviewPaneOpen:jt,reviewPane:m.current(),...D.snapshot(),documentProtection:De.state(),revisionMarkup:fn.current(),reviewDisplayMode:L&&f?L.revisionDisplayMode():un,hasReviewContent:L?.session.hasReviewContent()??false,hiddenReviewAuthors:C.hiddenAuthorList,collaborationStatus:O?.collaborationStatus??"inactive",editingMode:h,lastRejection:F??O?.lastRejection??null,fontSubstitutions:Fe(),formatPainter:O?.formatPainter??Pd}}let Li;function Lt(){if(Je&&Et===we)return Je;let O=Je,Q=Y()===Li;Li=Y();let re=D.chromeSettled(),He=l===Zt&&re;Zt=l;let xe=L?.state().selection??null,lt=Fd(xe,Se);Se=xe;let Ue=L?.session.packageRevision()??-1,Pt=Ue===Me;Me=Ue;let Ne=Wl(),ze=Ne;if(O){let nt=$m(Ne.formatting,O.formatting)?O.formatting:Ne.formatting,Dt=qm(Ne.page,O.page)?O.page:Ne.page,Xe=Wm(Ne.pageSetup??null,O.pageSetup??null)?O.pageSetup:Ne.pageSetup,bt=Km(Ne.selection,O.selection)?O.selection:Ne.selection,xt=iR(Ne.image,O.image)?O.image:Ne.image,Nt=O.fontSubstitutions!==void 0&&Ne.fontSubstitutions!==void 0&&O.fontSubstitutions.length===Ne.fontSubstitutions.length&&Ne.fontSubstitutions.every((Mr,sr)=>O.fontSubstitutions[sr]===Mr)?O.fontSubstitutions:Ne.fontSubstitutions;ze={...Ne,formatting:nt,page:Dt,pageSetup:Xe,selection:bt,image:xt,fontSubstitutions:Nt},Vm(ze,O)&&lt&&Pt&&He&&Q&&(ze=O);}return Je=Ad(ze),Et=we,Je}if(e.document){let O=Zm(e.document);O?Er(O):(ke(tn("unsupported",te.refuseSource(e.document))),Oe.openRejected("unsupported"));}let Di=yE({surface:()=>L,activeKey:No,paneOpen:()=>jt,selectionAnchor:()=>Vt()?.anchorY??null,authorFilterKey:()=>C.stateKey});function Ni(O){return chunkWO4V6PNS_cjs.Sj(O)===null||O.kind==="custom"&&!O.carded?false:!(O.kind==="revision"&&v!==null&&v.includes(O.revisionKind)&&(O.revisionKind!=="format"||x===void 0||x.includes(O.formattingKind??"")))}let Va=wF();function Do(O){let Q=chunkWO4V6PNS_cjs.Sj(O)?.partName;if(!Q||!L||Q===L.session.part().name)return null;for(let re of L.session.headerFooterResolutionBySection())for(let He of ["header","footer"]){let xe=He==="header"?re.headers:re.footers;for(let lt of xe.values())if(lt.partName===Q)return {kind:He,rId:lt.rId}}return null}function Kl(O){let Q=chunkWO4V6PNS_cjs.Sj(O),re=L?.publishedLayout();return !Q||!re?null:IF(re).get(Q.start.paragraphId)??null}function Ua(O){let Q=chunkWO4V6PNS_cjs.Sj(O)?.partName;if(!Q||!L)return null;for(let re of ["footnote","endnote"])if(chunkWO4V6PNS_cjs.lh(L.session.currentPackage(),re)?.name===Q)return {kind:"notesPart",noteKind:re};return null}function Rn(O){let Q=Do(O);return Q!==null?{kind:"headerFooter",rId:Q.rId}:Ua(O)??{kind:"body"}}function rr(){return aL({surface:L,bodyOrder:()=>{let O=L?.publishedLayout();return O?RF(O):new Map},openStoryOrder:sf})}function jl(){let O=L?.activeScope();if(O?.kind==="headerFooter")return {kind:"headerFooter",rId:O.rId};if(O?.kind==="note"){let Q=chunkWO4V6PNS_cjs.pc(O.id);if(Q)return {kind:"notesPart",noteKind:Q.noteKind}}return {kind:"body"}}function rn(O){if(!L)return {kind:"body"};let Q=O.slice(0,O.indexOf("#"));if(Q.length===0||Q===L.session.part().name)return {kind:"body"};for(let re of L.session.headerFooterResolutionBySection())for(let He of [re.headers,re.footers])for(let xe of He.values())if(xe.partName===Q)return {kind:"headerFooter",rId:xe.rId};for(let re of ["footnote","endnote"])if(chunkWO4V6PNS_cjs.lh(L.session.currentPackage(),re)?.name===Q)return {kind:"notesPart",noteKind:re};return jl()}function sf(){if(!L)return new Map;let O=jl();if(O.kind==="body")return new Map;let Q=new Map;for(let[re,He]of L.session.paragraphIdsIn(O).entries())Q.set(He,re);return Q}function or(O){if(O.kind==="revision"){let re=O.ranges;if(re.length===0)return null;let xe=O.revisionKind==="replace"||O.revisionKind==="insert"||O.revisionKind==="delete"?re[re.length-1]:re[0];return {start:re[0].start,end:xe.end}}let Q=chunkWO4V6PNS_cjs.Sj(O);return Q?{start:Q.start,end:Q.end}:null}function Vt(){if(L&&L.activatedReviewKey()!==null)return null;let O=rr(),Q=L?.publishedLayout();if(!O||!Q)return null;let re=Va(Q).get(O.from.paragraphId);return re?{pageIndex:re.pageIndex,anchorY:re.contentY+chunk5JPIEN54_cjs.aa(re,O.from.paragraphId,O.from.offset)}:null}function No(){return L?.activeReviewKey()??null}let Rt=new WeakMap;function $n(O){if(!f)return [];let Q=C.filterItems(L?.session.reviewItems()??[]),re=PT(Q,O),He=O?.placement!==false,xe=null;if(He&&re.length>0){let Xe=L?.publishedLayout()??null;Xe&&(xe=Va(Xe));}let lt=lu(()=>Q,No(),R.lightsPair()),Ue=Xe=>{let bt=Do(Xe);return bt===null?1:bt.kind==="header"?0:2},Pt=L?.session.packageRevision()??-1,Ne=Rt.get(re);if(!Ne||Ne.anchors!==xe||Ne.revision!==Pt){let Xe=re.map(xt=>xe?chunk5JPIEN54_cjs.ca(xt,xe):null),bt=re.map((xt,Nt)=>({position:Nt,pageIndex:Xe[Nt]?.pageIndex??null,group:Ue(xt)}));bt.sort((xt,Nt)=>{let Mr=xt.pageIndex??Number.MAX_SAFE_INTEGER,sr=Nt.pageIndex??Number.MAX_SAFE_INTEGER;return Mr!==sr?Mr-sr:xt.group!==Nt.group?xt.group-Nt.group:xt.position-Nt.position}),Ne={anchors:xe,revision:Pt,geometries:Xe,order:bt.map(xt=>xt.position)},Rt.set(re,Ne);}let{geometries:ze,order:nt}=Ne,Dt=KI(L);return nt.map(Xe=>{let bt=re[Xe];return gF(bt,{anchorY:ze[Xe]?.y??null,pageIndex:ze[Xe]?.pageIndex??null,activatable:su(bt).every(Ni),isActive:lt.size>0&&su(bt).some(xt=>lt.has(chunkWO4V6PNS_cjs.Mj(xt))),locked:Dt})})}function Ho(){return L?.session.trackingSettings()??chunkWO4V6PNS_cjs.qi}function yn(O=h,Q=w){let re=Ho();return tg({...A(),viewOnly:s.mode()==="view",hostChoseMode:s.mode()!==void 0,readerChoseMode:Q,currentMode:O,trackRevisions:re.trackRevisions,restrictedToTrackedChanges:re.restrictedToTrackedChanges,restrictedToForms:re.restrictedToForms,restrictedToReadOnly:re.restrictedToReadOnly,restrictedToComments:re.restrictedToComments,engineAdoptedViewing:S})}function io(O){W=null,h=O,L?.setEditingMode(O==="suggesting"?"suggest":O==="viewing"?"view":"edit"),L?.setEditable(O!=="viewing");}function ir(O){return O!==null?O:h==="suggesting"&&l===void 0?xr:$?xr:w?null:s.openingModeDecision(A()).rejection}function Cr(){let O=yn();F=ir(O.rejection),O.mode!==null&&(S=O.mode==="viewing",io(O.mode));}function ar(O="editing",Q=true){if(y.isScheduled()){W=O;return}W=null;let re=HI(s.mode(),A(),Ho(),h,O,S);S=re.mode==="viewing"&&s.mode()!=="view",re.mode!==h&&io(re.mode),F=ir(re.rejection),U.report(re.configurationRejection),Q&&(ue(),Ve());}function ao(O){return s.mode()==="view"&&O!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(O==="suggesting"?eg(A()):null)??ng(Ho(),O)}let qn=LA({surface:()=>L,enabled:()=>f,destroyed:()=>T,viewing:()=>h==="viewing",placements:$n,visible:()=>bE(L?.session.reviewItems()??[],C),scope:Rn,reveal:O=>qe.emitReviewItemReveal(Zg($n,O)),activate:(O,Q)=>{k=Q??false;try{return pn.setActiveReviewItem(O,{announce:!1})}finally{k=false;}},setDisplayMode:O=>{un=O,L?.setRevisionDisplayMode(O),ue(),Ve();},report:{diagnostics:Oe,tracked:()=>h==="suggesting"}}),{resolveReviewItem:so}=qn,ye=UF(()=>({mounted:!!L&&!!c,generation:tt}),qe.emitHistoryDiagnostic,()=>JSON.stringify(L?.state().selection)),lo=uL({reviewEnabled:f,historyGroups:ye,surface:()=>L,author:()=>l,editingMode:()=>h,commentTargetRange:rr,storyScopeOfParagraph:rn,storyScopeOfReviewItem:Rn,noteHomeOf:Kl,placements:$n,resolveReviewItem:so,bump:ue}),pn={beginHistoryGroup(){return y.flush(),ye.begin()},get mountGeneration(){return tt},get surface(){return L&&bi(L)?null:L},...D.popupChrome.setters,stateVersion:()=>we,fontMeasurement:()=>({measurer:B&&!a()?"shaped":"fixed",resolving:ne||a(),...B&&q&&!a()?{producer:q}:{}}),attach(O,Q){let re=Ok(O);if(re)return ke(tn("invalidTarget",re));if(c!==O&&n?.invalidate(),T){ke(tn("destroyed","this editor was destroyed; create a new instance to remount"));return}if(L&&c===O)return L.moveTo(O,Q);let He=y.cancel();if(He&&(hn(),g=He),yt.detach(),c=O,ce=null,L){at(),L.moveTo(O,Q),tt+=1,Bl(O.ownerDocument);return}let xe=g;g=null,xe&&y.shouldYield(xe)?y.schedule(xe):xe?Fi(xe):ue();},detach(){if(n?.invalidate(),T)return;yt.detach();let O=y.cancel();O?(hn(),g=O):L&&(fn.destroyDialog(),at(),L.park(),tt+=1),c=null,ce=null,ue(),Ve();},load(O){let Q=Zm(O);if(!Q){let re=L!==null||g!==null||y.isScheduled();ke(tn("unsupported",te.refuseSource(O,re))),Oe.openRejected("unsupported");return}n?.invalidate(),Tr.reset(),Er(Q);},save(){return y.flush(),ZT(L,L?.hostElement()??c,()=>L)},getDocumentHandle(){return Object.freeze({revision:L?.session.packageRevision()??0})},exec(O,Q){if(c&&Qn(c)&&!Wg(c,O))return {ok:false,code:"unsupported",reason:ka(c)};if(y.flush(),O.type==="openRevisionMarkupDialog")return fn.open();let re=D.dialog(O,true);if(re)return re;let He=ye.gate(O,Q);if(He)return He;ye.note(O);let xe=D.capability(O);if(T&&xe&&!xe.ok)return xe;if(O.type==="setEditingMode"){let Xe=ao(O.mode);return Xe!==null?(Xe.reason===xr&&($=true,F=Xe.reason,U.report(Xe.reason),ue(),Ve()),Xe):(w=true,$=false,F=null,io(O.mode),ue(),Ve(),{ok:true,changed:false})}let lt=D.toggle(O);if(lt)return lt;if(O.type==="toggleReviewPane")return f?(jt=!jt,ue(),Ve(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:nn};let Ue=De.exec(O);if(Ue)return Ue;let Pt=L&&(O.type==="resolveAllReviewChanges"||O.type==="setReviewChangesAuthor")?ye.run(L,O,Q,()=>qn.exec(O)):qn.exec(O);if(Pt)return Pt;if(ly(O))return iA(O,L,cy(h),Q);let Ne=ui(O);if(h==="viewing"&&Ne.supported&&Ne.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let ze=il(O,L,s.modeForGate(),Q);if(!ze.ok)return ze.refusal;let nt=L,Dt=nt.session.packageRevision();return ye.run(nt,O,Q,()=>{let Xe=VF(nt,O,{...ze.tablePlan?{admittedTablePlan:ze.tablePlan}:{},editor:pn});return Xe||{ok:true,changed:nt.session.packageRevision()!==Dt}})},can(O,Q){if(c&&Qn(c)&&!Wg(c,O))return {ok:false,code:"unsupported",reason:ka(c)};if(O.type==="openRevisionMarkupDialog")return fn.canOpen();let re=D.dialog(O,false);if(re)return re;let He=ye.gate(O,Q);if(He)return He;if(O.type==="insertImage"||O.type==="replaceImage"){if(T)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let ze=il(O,L,s.modeForGate(),Q);if(!ze.ok)return ze.refusal}return dR(O,L)}let xe=D.capability(O);if(xe)return xe;let lt=De.can(O);if(lt)return lt;let Ue=qn.can(O);if(Ue)return Ue;if(ly(O))return dy(O,L,cy(h),Q);let Pt=ui(O);if(h==="viewing"&&Pt.supported&&Pt.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let Ne=il(O,L,s.modeForGate(),Q);if(!Ne.ok)return Ne.refusal;if(O.type==="replaceMatch"){let ze=Bm(L,O.match);if(ze)return ze}if(O.type==="proposeInsertion"||O.type==="proposeDeletion"||O.type==="proposeReplacement"){if(!(O.author??l??"").trim())return {ok:false,code:"invalidArgs",reason:`${O.type} requires a non-empty author`};let nt=O.target===void 0?{ok:true,selection:L.state().selection}:Ju(L,O.target);if(!nt.ok)return nt;let{anchor:Dt,head:Xe}=nt.selection,bt=Dt.paragraphId===Xe.paragraphId&&Dt.offset===Xe.offset,xt=O.type==="proposeReplacement"&&O.target===void 0&&L.state().cellSelection!==null;if(O.type!=="proposeInsertion"&&bt&&!xt)return {ok:false,code:"invalidArgs",reason:`${O.type} needs a non-collapsed selection`}}if(nl(O)&&cg(O)){let ze=rl(pn);if(ze){let nt=dg(pn,O,ze);if(nt)return nt}}return {ok:true}},isActive(O){let Q=D.isActive(O);return Q!==null?Q:O.type==="toggleDocumentProtection"?De.isActive():O.type==="setReviewDisplayMode"?un===O.mode:O.type==="toggleReviewPane"?jt:O.type==="setEditingMode"?h===O.mode:$A(O,L?Lt().formatting:null,re=>L?.isListActive(re)??false)},getDocumentStyles:()=>L?.session.documentStyles()??[],getDocumentFonts:()=>L?.session.documentFonts()??[],getAvailableFonts:()=>gL(Y(),L?.session.documentFonts()??[]),getDocumentThemeColors:()=>L?.session.documentThemeColors()??[],getOutline:()=>L?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>kR(L?Lt().formatting:null),findMatches:((O,Q)=>jA(L,h,Tr.noteMatches,O,Q)),selectMatch(O){return y.flush(),L?KA(L,O):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>Lt().image,getSelectedTable:()=>SR(L),getTableCellSelection:()=>{let O=L?.state().cellSelection;return O?{tableId:O.tableId,rows:O.rows,columns:O.columns,cellIds:O.cellIds}:null},setTableInteractionLabel(O){L?.setTableInteractionLabel(O);},canExecuteImageCommand(O,Q){if(T)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let re=il(O,L,s.modeForGate(),Q);if(!re.ok)return re.refusal}return fg(O,L)},executeImageCommand(O){return T?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):mg(pn,O)},getPageSetup:()=>xg(L),getWatermark:()=>Md(L),getTrackedChanges:()=>(L?.session.reviewItems()??[]).filter(O=>O.kind==="revision").map(O=>{let Q=Do(O);return {id:O.id,kind:O.kind==="revision"?O.revisionKind:"revision",...O.kind==="revision"&&O.author?{author:O.author}:{},story:Q!==null?Q.kind:Ua(O)?.noteKind??"body"}}),getReviewItems:O=>$n(O),getCustomNodeDefinitions:()=>d.customNodes,reportCustomNodeDiagnostic:u,...lo,getSelectionPlacement:()=>Vt(),isReviewPaneOpen:()=>jt,getEditingMode:()=>h,getReviewAuthors:()=>P.authorsFor(L?.revisionAuthors()??CL),...vE(C,{enabled:f,surface:()=>L,notify:()=>{ue(),Ve();}}),setTrackedChangesFilter(O,Q){if(L)return L.setTrackedChangesFilter(O,Q);C.setPredicate(O,Q)&&(ue(),Ve());},getConfiguredAuthor:()=>l??null,setAuthor(O){let Q=ah(O);if(l!==Q){if(l=Q,L?.setAuthor(l),l!==void 0&&$){$=false;let re=NI(ao("suggesting"));if(re.enter)w=true,io("suggesting");else {F=re.rejection,ue(),Ve();return}}else if(!w){let re=W??h;ar(s.mode()===void 0?re:"editing");return}F=ir(null),U.report(F),ue(),Ve();}},setMode(O){s.setMode(O)&&(w=false,$=false,ar());},...FL(s,{surface:()=>L,bump:ue,emitSelectionChange:Ve}),presenceColorFor:O=>L?.remotePresenceColor(O)??"var(--doc-accent)",collaborationSession:()=>L?.collaborationSession()??null,getReviewAuthorStyle:O=>P.styleFor(O),setOpeningIndicatorHost:ee.set,setRemoteCaretLabelHost(O){Z=O,L?.setRemoteCaretLabelHost(O);},setReviewPaneOptions:m.set,setRevisionMarkup:fn.set,setRevisionMarkupChrome:fn.register,setRevisionStyles(O){P.set(O),L?.setRevisionStyles(O),ue(),Ve();},setEditingMode:O=>pn.exec({type:"setEditingMode",mode:O}),getReviewRevision:()=>Di(),getActivatedReviewItemKey:O=>Gg($n,L?.activatedReviewKey()??null,O),setActiveReviewItem(O,Q){if(O===null)return L?.dismissActiveReview(),ue(),Ve(),{ok:true,changed:false};if(!L)return {ok:false,code:"notFound",reason:"no document is open"};L.flushPendingInput();let re=kr($n,O)?.item;if(!re)return {ok:false,code:"notFound",reason:"no review item with that key"};let He=Ta(re),xe=R.set(He?chunkWO4V6PNS_cjs.Mj(He.deletion):null)??O,lt=chunkWO4V6PNS_cjs.Sj(re);if(!lt)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!su(re).every(Ni)&&!(k&&re.kind==="revision"&&re.revisionKind==="format"))return {ok:false,code:"unsupported",reason:FA(re)};let Ue=re?Do(re):null,Pt=Ue===null&&re?Kl(re):null;if(Ue!==null||Pt!==null){let Ne=Ue!==null?{kind:"headerFooter",rId:Ue.rId,furnitureKind:Ue.kind}:{kind:"note",id:Pt},ze=Zu(L,Ne,lt.start);if(!ze.ok)return ze}else {L.exitNote?.(),L.exitHeaderFooter?.();let Ne=or(re)??lt,ze={paragraphId:Ne.start.paragraphId,offset:Ne.start.offset};L.activateReview(xe,{anchor:ze,head:ze},{allowExcluded:k,preventScroll:true});let nt=Q?.reveal??"centerIfNeeded";nt!==false&&L.revealPosition?.(Ne.start,{block:nt});}return (Ue!==null||Pt!==null)&&L.activateReview(xe,void 0,{allowExcluded:k}),ue(),Ve(),Q?.announce===true&&qe.emitReviewItemReveal(Zg($n,{key:O,source:"host"})),{ok:true,changed:false}},setReviewActivationExclusions(O,Q){v=O===null?null:[...O],x=Q?.formattingKinds?[...Q.formattingKinds]:void 0,L?.setReviewActivationExclusions(v,{formattingKinds:x});},getHeaderFooterState:()=>L?.headerFooterState()??null,getNotePropertiesState:()=>L?.notePropertiesState?.()??null,getNotePreviewText:O=>L?.notePreviewText?.(O)??null,setActiveScope(O){L?.setActiveScope(O)&&ue();},getActiveScope:()=>L?.activeScope()??{kind:"body"},query:O=>sA(L,()=>Lt().formatting,O),snapshot:()=>Lt(),getTotalPages:()=>ha(L),getCurrentPage:O=>wg(L,O),...VA(()=>L,()=>y.flush(),()=>c),...ZA(()=>pn,()=>n,()=>y.flush()),...EL(yt,()=>L),...Tr.members,...mF({frame:Tr.frame,placements:$n}),relayout(O){O?.sync,L?.layout();},retainSelection:()=>c?L?.retainSelection()??null:null,releaseSelection:O=>L?.releaseSelection(O),focus(O){return y.flush(),L?O&&O.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:O&&!L.setActiveScope(O)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(L.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){n?.invalidate(),T=true,U.dispose(),y.cancel(),yt.detach(),H(),X(),X=()=>{},hn(),c=null,g=null,b=new WeakMap,tt+=1,ue(),Oe.dispose(),qe.clear();},on:qe.on};n=bA(pn,{surface:()=>L,container:()=>c,collaboration:()=>d.collaboration!==null,load:Er,changed:()=>{ue(),Ve();},cancelLoad:()=>{r=null,y.cancel();}}),Oe.attach(pn,Ai);let Or=Fo.methods(pn);return Ck(Or,()=>c),fL(Or,ye),AR(Or,D.popupChrome.commentDraft),at=()=>gA(Or),mA(Or,{deferEvents:qe.defer,displayOptions:Lo,changed:()=>{ue(),Ve();}}),Or}var LL=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function A3(e){if(e.length===0)return;if(e.every(n=>n.kind==="delete"))return "comment-delete";if(e.length!==1)return;let t=e[0];if(t.kind==="resolve")return "comment-resolve";if(t.kind==="create")return "comment-add";if(t.kind==="reply")return "comment-reply"}function F3(e){let t,n=chunkYQWMI6J5_cjs.m({port:L3(e,()=>t),capabilities:LL}),r=false,o=i=>(r||e.surface?.flushPendingInput(),WM(e,()=>n.execute(i)));return {...n,save:()=>{try{return n.save()}catch(i){return {ok:false,error:{code:"transaction-refused",message:i instanceof Error?i.message:"Cannot save the document."}}}},dispose:()=>{r=true,n.dispose();},execute:o,beginHistoryGroupRun:i=>{let a=r?null:pL(e,i);if(a===null)return null;let s=false;return {execute:l=>{if(s||r||!mL(e,i))return null;let c=t;t=a;try{return o(l)}finally{t=c;}},finish:()=>{s||(s=true,a.finish());}}}}}function L3(e,t){let n=(u,f)=>{let m=t();return m===void 0?f():m.bind(u,f)},r=0,o=0,i=null,a=false,s=false,l=()=>{if(s)return null;let u=e.surface?.session??null;return u!==i&&(a&&(r+=o+1),a=true,i=u,o=0),u&&(o=u.packageRevision()),u},c,d=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(u){if(!u.operations.some(g=>g.op==="updateFieldResult"))return;c=void 0,d=null;let f=e.surface;if(!f)return;let m=f.layout();c=chunkYQWMI6J5_cjs.j(m),d=l()?.currentPackage()??null;},fieldPageContext(u,f,m){let g=l()?.currentPackage()??null;if(!g||g!==d)return null;let b=chunkYQWMI6J5_cjs.i(g).story(u);return b?chunkYQWMI6J5_cjs.k(c,b.part,f,m):null},revision(){return l(),r+o},currentPackage:()=>l()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?chunkDBOOTED4_cjs._a(e.surface.revisionDisplayMode()):chunkWO4V6PNS_cjs.Dh,collaborative:()=>!!e.surface?.collaborationSession(),allocationActor:()=>e.surface?.collaborationSession()?.identity.actorId,trackedRangeReplacement:()=>!e.surface?.collaborationSession(),replacementLanding:(u,f,m)=>e.surface?.replacementLanding(u,f,m)??null,apply(u,f,m=[],g=false){if(l(),$a(e))return {ok:false,reason:eo};let b=e.surface;if(!b)return {ok:false,reason:"no-document"};let y=n(b,()=>b.applyAutomationOps(u,f,m,g));return y.rejected?{ok:false,reason:Ha(y.reason)}:{ok:true,changed:y.committed}},applyLifecycle(u){if(l(),$a(e))return {ok:false,reason:eo};let f=e.surface;if(!f)return {ok:false,reason:"no-document"};let m=n(f,()=>f.applyAutomationOps(()=>[u]));return m.rejected?{ok:false,reason:Ha(m.reason)}:{ok:true,changed:m.committed}},applyCommentWrites(u,f){let m=e.surface,g=l();if(!m||!g)return {ok:false,reason:"no-document"};if($a(e))return {ok:false,reason:eo};if(u.length===0)return {ok:true,changed:false};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let b=e.can({type:"toggleReviewPane"});if(!b.ok)return {ok:false,reason:Ha(b.reason??"review-module-required")};if(u.length!==1&&!u.every(v=>v.kind==="delete"))return {ok:false,reason:"mixed-comment-writes"};let y=null,h=n(m,()=>m.commitReviewOps(v=>{if(u.every(R=>R.kind==="delete")){let R=u.find(P=>P.kind==="delete"),C=g.deleteComments(u.map(P=>{if(P.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:P.commentId,...P.parentCommentId===void 0?{}:{parentCommentId:P.parentCommentId}}}),f,R?.kind==="delete"?R.noteId:void 0,{historyToken:v});return y=C?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:C}}if(u.length!==1)return y={ok:false,reason:"mixed-comment-writes"},{committed:false};let x=u[0];if(x.kind==="resolve"){let R=g.setCommentResolved(x.commentId,x.resolved,{historyToken:v});return y=R?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:R}}if(x.kind!=="create"&&x.kind!=="reply")return y={ok:false,reason:"unsupported-comment-write"},{committed:false};let k=g.replyToComment(x.kind==="reply"?x.parentCommentId:null,x.anchor,x.text,x.author,x.date,void 0,void 0,{historyToken:v});return y=k===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:k},{committed:k!==null}},A3(u)));return y??{ok:false,reason:Ha(h??"refused")}},applyCustomNodeWrite(u,f){let m=e.surface,g=l();if(!m||!g)return {ok:false,reason:"no-document"};if($a(e))return {ok:false,reason:eo};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let b=null,y=n(m,()=>m.commitReviewOps(h=>{let v=g.insertCustomNode(u,void 0,{historyToken:h});return b=v.ok?{ok:true,changed:v.change!==null}:{ok:false,reason:v.detail?`${v.reason}: ${v.detail}`:v.reason},{committed:v.ok}},"package-scoped"));return b??{ok:false,reason:Ha(y??"refused")}},save:()=>l()?e.surface?.save()??null:null,selectRefusal(u,f){if(u.kind==="body")return null;let m=e.surface;return m?.editingMode()==="view"?"a read-only editor does not open a header, footer or note to select in it":m&&!chunkDBOOTED4_cjs.qe(m.layout(),{paragraphId:f,offset:0})?"that header, footer or note is not shown on any page":null},select(u,f){if(!e.surface)return false;let g=f==="end"?u.end:u.start,b=f==="start"?u.start:u.end;return e.exec({type:"setSelection",range:{anchor:{paragraphId:g.paragraphId,offset:g.offset},head:{paragraphId:b.paragraphId,offset:b.offset}}}).ok},subscribe:u=>e.on("change",()=>u()),dispose(){s=true,i=null;}}}function Dy(e){let t=e?.closest(".docx-editor")??null;for(;t&&!t.querySelector(".docx-pages");)t=t.parentElement?.closest(".docx-editor")??null;return t}function D3(e){let t=e.popup.ownerDocument,n=r=>{if(r.key!=="Escape"||r.isComposing||r.keyCode===229||e.skip?.(r))return;let o=r.composedPath(),i=o[0]??r.target,a=ko(i)?i:null,s=a!==null&&e.contains(a);if(!s&&DL(a,e.popup))return;let l=[Dy(e.popup),e.chromeRoot?.(),...e.editorElements?.()??[]],c=s||l.some(d=>d!=null&&o.includes(d));e.close(s),c&&(r.preventDefault(),r.stopPropagation());};return t.addEventListener("keydown",n,true),()=>t.removeEventListener("keydown",n,true)}function DL(e,t){let r=(_t(e)?e:e?.parentElement??null)?.closest('[aria-modal="true"], [data-docx-modal]');return r?r.hasAttribute("data-docx-dialog")||r.hasAttribute("data-docx-modal")?true:Dy(t)?.contains(r)===true:false}var N3='[aria-expanded="true"], [role="menu"], [role="listbox"], [role="dialog"]';function H3(e){return e?.querySelector(N3)!=null}function _3(e){let t=e.popup.ownerDocument,n=r=>{let o=r.composedPath()[0]??r.target;if(!ko(o)||e.contains(o))return;let i=_t(o)?o:o.parentElement;i===null||i===t.body||i===t.documentElement||i.closest(".docx-pages")||DL(i,e.popup)||e.close();};return t.addEventListener("focusin",n,true),()=>t.removeEventListener("focusin",n,true)}function B3(e){return e*(96/72)}function $3(e,t){return e*t}function q3(e,t){return e/t}function W3(e,t,n){let r=e.pages.find(a=>a.index===t.pageIndex)??e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,i=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*i,top:(r.contentBox.y+t.y)*i,width:t.width*i,height:t.height*i})}function K3(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function HL(e,t,n,r=false){return t?true:e.length===1?false:r?n:!n}var NL=["e","se","s","sw","w","nw","n","ne"];function j3(e,t){let n=NL.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return NL[(n-r+8)%8]}function V3(e,t,n){let r=e,o=t,i=-n.rotationDegrees*Math.PI/180,a=Math.cos(i),s=Math.sin(i),l=r*a-o*s,c=r*s+o*a;return r=l,o=c,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function Oi(e){return e/12700}function _L(e){let t=V3(e.deltaXPt,e.deltaYPt,e.transform),n=Oi(e.startWidthEmu),r=Oi(e.startHeightEmu),o=n/r,i=j3(e.handle,e.transform),a=i.includes("e")?t.x:i.includes("w")?-t.x:0,s=i.includes("s")?t.y:i.includes("n")?-t.y:0;if(n=Math.max(1,n+a),r=Math.max(1,r+s),e.preserveAspect)if(i.length===2){let x=Math.max(n/Oi(e.startWidthEmu),r/Oi(e.startHeightEmu));n=Math.max(1,Oi(e.startWidthEmu)*x),r=Math.max(1,n/o);}else i==="e"||i==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=Oi(e.startWidthEmu),c=Oi(e.startHeightEmu),d=n/l,u=r/c,f=Math.max(1,e.startBounds.width*d),m=Math.max(1,e.startBounds.height*u),g=e.startBounds.x,b=e.startBounds.y,y=e.handle;y.includes("w")&&(g=e.startBounds.x+e.startBounds.width-f),y.includes("n")&&(b=e.startBounds.y+e.startBounds.height-m);let h=null;if(e.kind==="anchored"&&e.startPosition&&(y.includes("w")||y.includes("n")||e.anchorFrameOrigin&&(e.startPosition.horizontalEmu===void 0&&n!==l||e.startPosition.verticalEmu===void 0&&r!==c)))if(e.startPosition.mode==="simple"){let v=y.includes("w")?Kt(g-e.startBounds.x):0,x=y.includes("n")?Kt(b-e.startBounds.y):0;h=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+v,verticalEmu:(e.startPosition.verticalEmu??0)+x});}else if(e.anchorFrameOrigin)h=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...y.includes("w")||e.startPosition.horizontalEmu===void 0&&n!==l?{horizontalEmu:Kt(g-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...y.includes("n")||e.startPosition.verticalEmu===void 0&&r!==c?{verticalEmu:Kt(b-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let v=y.includes("w")?Kt(g-e.startBounds.x):0,x=y.includes("n")?Kt(b-e.startBounds.y):0;h=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+v}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+x}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Kt(n),heightEmu:Kt(r),previewBounds:Object.freeze({x:g,y:b,width:f,height:m}),position:h})}function U3(e,t){return Object.freeze({scrollBy(n){if(!Number.isFinite(n)||n===0)return 0;let r=e.scrollTop;return e.scrollTop+=n*t,(e.scrollTop-r)/t}})}function z3(e){if(e.session.mode==="move"){let t=e.session.startBounds.x+e.deltaXPt,n=e.session.startBounds.y+e.deltaYPt+e.accumulatedScrollPt,r=e.session.startPosition&&Nd(e.session.startPosition.mode==="frame"&&e.anchorFrameOrigin?{...e.session.startPosition,horizontalEmu:e.session.startPosition.horizontalEmu??Kt(e.session.startBounds.x-e.anchorFrameOrigin.x),verticalEmu:e.session.startPosition.verticalEmu??Kt(e.session.startBounds.y-e.anchorFrameOrigin.y)}:e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?_L({handle:e.session.handle,startWidthEmu:e.session.startWidthEmu,startHeightEmu:e.session.startHeightEmu,startBounds:e.session.startBounds,startPosition:e.session.startPosition,anchorFrameOrigin:e.anchorFrameOrigin,deltaXPt:e.deltaXPt,deltaYPt:e.deltaYPt,transform:e.session.transform,preserveAspect:HL(e.session.handle,e.aspectLocked,e.shiftKey,e.textbox),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var BL=e=>Math.round(e/1440*100)/100,G3=e=>BL(e).toLocaleString(void 0,{maximumFractionDigits:2}),Z3=e=>Math.round(e*1440),X3={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},$L=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",qL=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function Y3(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",direction:e.direction??"ltr",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:$L(t),specialBy:Math.abs(t??0),spaceBefore:e.spaceBeforePt??0,spaceAfter:e.spaceAfterPt??0,lineRule:e.lineSpacing?.rule??"multiple",lineValue:e.lineSpacing?.value??1.08,contextualSpacing:e.contextualSpacing===true,keepNext:e.keepNext===true,keepLines:e.keepLines===true,widowControl:e.widowControl!==false,pageBreakBefore:e.pageBreakBefore===true,tabStops:e.tabStops??[],clearedAllTabStops:false}}var WL={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,direction:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function Q3(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,direction:e.disagrees.direction,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function KL(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return o!==void 0&&n.positionTwips===o.positionTwips&&n.alignment===o.alignment&&(n.leader??"none")===(o.leader??"none")})}function J3(e,t,n=WL,r=n){let o={},i=false,a=(c,d)=>{o[c]=d,i=true;},s=c=>n[c]&&!r[c];(e.direction!==t.direction||s("direction"))&&a("direction",t.direction);let l=!n.direction&&!n.alignment&&e.direction!==t.direction&&t.alignment===jL(e.alignment);return (e.alignment!==t.alignment&&!l||s("alignment"))&&a("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&a("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&a("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&a("indentFirstLineTwips",qL(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&a("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&a("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&a("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&a("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&a("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&a("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&a("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&a("pageBreakBefore",t.pageBreakBefore),(!KL(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&a("tabStops",t.tabStops),i?o:null}function jL(e){return e==="left"?"right":e==="right"?"left":e}function e$(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function t$(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(a=>!a.hasAttribute("disabled")&&a.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],i=e.ownerDocument.activeElement;return t.shiftKey&&(i===r||i===e)?(o.focus(),true):!t.shiftKey&&i===o?(r.focus(),true):false}function n$(e,t,n){let r,o=false,i,a=ut(()=>t),s,l=new Set,c=[],d=()=>{a.clearTimeout(s),s=void 0,r?.end(),r=void 0,i=void 0,l.clear();},u=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},f=()=>{d(),u();},m=()=>{let y=r;i=void 0,l.clear(),a.clearTimeout(s),s=a.setTimeout(()=>{r===y&&d();},0);},g=(y,h,v,x=false)=>{y.addEventListener(h,v,x),c.push(()=>y.removeEventListener(h,v,x));},b=y=>n.kind==="native-color"?y==="Enter"||y===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(y);if(g(t,"pointerdown",y=>{let h=y;if(!(h.button!==0||n.kind==="keyboard")&&(f(),i=h.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(h.pointerId);}catch{}},true),g(t,"keydown",y=>{let h=y;if(h.key==="Escape"){m();return}!b(h.key)||h.altKey||h.ctrlKey||h.metaKey||(!h.repeat&&l.size===0&&f(),l.add(h.key),u());},true),g(t.ownerDocument,"keyup",y=>{let h=y.key;l.delete(h)&&n.kind!=="native-color"&&l.size===0&&m();},true),n.kind!=="native-color")for(let y of ["pointerup","pointercancel","lostpointercapture"])g(y==="lostpointercapture"?t:t.ownerDocument,y,h=>{i!==void 0&&h.pointerId===i&&m();},true);return g(t,"input",()=>{s!==void 0?f():u();},true),g(t,"change",()=>{(n.kind==="native-color"||i===void 0&&l.size===0)&&m();}),g(t,"blur",m,true),t.ownerDocument.defaultView&&g(t.ownerDocument.defaultView,"blur",m),{options:()=>({historyGroup:u()}),dispose(){if(!o){o=true,d();for(let y of c)y();}}}}var UL=Object.freeze([1,1.15,1.5,2,2.5,3]);function r$(e){return Number.isInteger(e*10)?e.toFixed(1):String(e)}function VL(e,t,n){let r=e.rule==="multiple";return {spacing:e,command:t?null:{type:"setLineSpacing",rule:e.rule,value:e.value},text:r?r$(e.value):String(e.value),labelKey:r?null:e.rule==="exact"?"lineSpacing.exactlyPoints":"lineSpacing.atLeastPoints",selected:t,preset:n}}function o$(e){let t=UL.map(o=>VL({rule:"multiple",value:o},e?.rule==="multiple"&&e.value===o,true));if(!e||t.some(o=>o.selected))return t;let n=VL(e,true,false);if(e.rule!=="multiple")return [n,...t];let r=t.findIndex(o=>o.spacing.value>e.value);return t.splice(r===-1?t.length:r,0,n),t}function i$(e,t,n){let r={minimumFractionDigits:t,maximumFractionDigits:2};try{return new Intl.NumberFormat(n,r).format(e)}catch{return new Intl.NumberFormat("en",r).format(e)}}function a$(e,t,n){let r=n===void 0?e.text:i$(e.spacing.value,e.spacing.rule==="multiple"?1:0,n);return e.labelKey?t(e.labelKey).replace("{value}",r):r}var Ao=class extends Error{code;constructor(t,n){super(`Document capture failed: ${t}.`,{cause:n}),this.name="DocumentRefreshError",this.code=t;}};function zL(e){return JSON.stringify([e.revisionKind,e.author,e.date,e.text,e.replacedText])}function GL(e){return new Map(e.surface()?.session.reviewItems().filter(t=>t.kind==="revision").map(t=>[t.id,zL(t)]))}function ZL(e,t,n,r){let o=e.surface();if(!o)return {located:[],available:false};let i=o.session.part(),a=chunkEOTAXOJY_cjs.d(i),s=o.session.paragraphAnchors().paraIdByNode,l=new Map,c=new Map;a.forEach((g,b)=>{c.set(g.id,b);let y=s.get(g.id);if(y){let h=y.toUpperCase();l.set(h,l.has(h)?null:g);}});let d=new Set(o.layout().pages.flatMap(g=>chunkDBOOTED4_cjs.za(g).map(b=>b.paragraphId))),u=(g,b=JSON.stringify([typeof g.location?.text=="string"?g.location.text:null,g.unavailableReason,g.description]))=>{let y={id:g.id,resultId:t,isNew:r.get(g.id)!==b,...g.description!==void 0?{description:g.description}:{}};if(!g.location)return {fingerprint:b,change:{...y,status:g.unavailableReason??"unavailable",diagnostic:Object.freeze({code:g.unavailableReason==="deleted"?"deleted":"missing-location"})}};let h=g.location,v=C=>({fingerprint:b,change:{...y,status:"invalid",diagnostic:Object.freeze({code:C,location:Object.freeze({...h})})}});if(h.paragraphId===void 0==(h.paragraphIndex===void 0)||h.paragraphIndex!==void 0&&(!Number.isSafeInteger(h.paragraphIndex)||h.paragraphIndex<0))return v("invalid-selector");if(h.paragraphId!==void 0&&(typeof h.paragraphId!="string"||!chunkWO4V6PNS_cjs.vb(h.paragraphId)))return v("invalid-paragraph-id");let x=h.paragraphId!==void 0?l.get(h.paragraphId.toUpperCase()):a[h.paragraphIndex];if(x===null)return v("ambiguous-paragraph-id");if(!x)return v("paragraph-not-found");let k=x?chunkWO4V6PNS_cjs.hj(i,x.id)??"":"";if(!Number.isSafeInteger(h.start)||!Number.isSafeInteger(h.end)||h.start<0||h.end<=h.start||h.end>k.length)return v("invalid-offsets");if(k.slice(h.start,h.end)!==h.text)return v("text-mismatch");let R=d.has(x.id);return {fingerprint:b,change:{...y,status:R?"available":"unavailable",location:Object.freeze({...h}),...R?{}:{diagnostic:Object.freeze({code:"not-rendered",location:Object.freeze({...h})})}},...R?{paragraphId:x.id,offset:h.start}:{}}};if(n)return {located:n.map(g=>u(g)),available:true};let f=o.session.reviewItems().filter(g=>g.kind==="revision");return {located:f.map(g=>{let b=zL(g),y=g.ranges[0];if(!y||y.partName!==i.name)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:y?"unsupported-story":"unavailable",diagnostic:Object.freeze({code:y?"unsupported-story":"missing-location"})}};let h=c.get(y.start.paragraphId)??-1;if(g.revisionKind==="delete"||g.revisionKind==="moveFrom")return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"deleted",diagnostic:Object.freeze({code:"deleted"})}};if(y.start.paragraphId!==y.end.paragraphId)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"unavailable",diagnostic:Object.freeze({code:"multiple-paragraphs"})}};let v=chunkWO4V6PNS_cjs.hj(i,y.start.paragraphId)??"",x={paragraphIndex:h,start:y.start.offset,end:y.end.offset,text:v.slice(y.start.offset,y.end.offset)};return u({id:g.id,location:x},b)}),available:f.length>0}}var XL=new WeakMap,s$=0;function l$(e){let t=XL.get(e);if(t)return t;let n=yA(e),r=`refresh-${++s$}`,o=0,i=null,a=new AbortController,s=false,l=Promise.resolve(),c=null,d=[],u=null,f=new Set,m=new Set,g=Object.freeze({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false}),b=P=>{g=Object.freeze({...g,...P});for(let E of f)try{E();}catch{}},y=Yu(e,n,{marker:"data-docx-refresh-highlight",defaultColor:"var(--doc-refresh-highlight-color)"},()=>{g.highlightsVisible&&b({highlightsVisible:false});}),h=(P,E)=>{E&&b({phase:E,result:P,recoveryAvailable:c!==null});for(let w of m)try{w(P);}catch{}return P},v=(P,E,w)=>({ok:false,resultId:P,code:E,...w===void 0?{}:{recovered:w}}),x=()=>n.collaboration()?"collaboration":!n.surface()||!n.container()||e.snapshot().isOpening?"unavailable":null,k=()=>{o++,i=null,a.abort(),a=new AbortController,d=[],u=null,y.clear();};n.invalidated.add(()=>{k(),c=null,b({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});}),e.on("change",P=>{P.source||u===null||n.revision===u||(d=[],y.clear(),u=null,b({changes:[],highlightsVisible:false}));});let R=async P=>{let E=n.surface(),w=n.container();if(!E||!w)throw new Error("unavailable");nu(E)&&await new Promise((A,$)=>{let W=()=>{w.removeEventListener("compositionend",U),P.removeEventListener("abort",_);},U=()=>{W(),A();},_=()=>{W(),$(new Error("cancelled"));};w.addEventListener("compositionend",U),P.addEventListener("abort",_,{once:true}),P.aborted&&_();});let S=bl(w);if(S&&await S,P.aborted||n.surface()!==E)throw new Error("document-changed");let F=E.save();if(n.surface()!==E)throw new Error("document-changed");return {bytes:F,revision:n.revision}},C={async capture(){let P=x();if(c)throw new Ao("recovery-failed");if(P||s)throw new Ao(P??"busy");k(),c=null;let E=o,w=n.epoch,S=a.signal;b({phase:"capturing",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});try{let F=await R(S);if(E!==o||w!==n.epoch)throw new Error("superseded");let A=Object.freeze({id:`${r}-${E}`,bytes:F.bytes.slice().buffer});return i={token:A,epoch:w,revision:F.revision,sequence:-1,seen:GL(n)},b({phase:"processing"}),A}catch(F){throw E===o&&b({phase:"failed"}),new Ao(E===o?"input-failed":"superseded",F)}},applyUpdate(P){let E=`${P.submission?.id??"unknown"}:${P.sequence}`,w;try{if(!Number.isSafeInteger(P.sequence)||P.sequence<0||!(P.bytes instanceof Uint8Array||P.bytes instanceof ArrayBuffer)||P.failures!==void 0&&(!Array.isArray(P.failures)||P.failures.length>1e4||Array.from(P.failures).some(A=>typeof A!="string"))||P.changes!==void 0&&(!Array.isArray(P.changes)||P.changes.length>1e4||new Set(P.changes.map(A=>A.id)).size!==P.changes.length||Array.from(P.changes).some(A=>!A||typeof A.id!="string"||!A.id||A.description!==void 0&&(typeof A.description!="string"||A.description.length>1e3)||A.location!==void 0&&(!A.location||typeof A.location!="object"||A.location.paragraphId!==void 0&&typeof A.location.paragraphId!="string"||A.location.paragraphIndex!==void 0&&typeof A.location.paragraphIndex!="number"||typeof A.location.start!="number"||typeof A.location.end!="number"||typeof A.location.text!="string")||A.unavailableReason!==void 0&&!["deleted","unavailable"].includes(A.unavailableReason))))throw new Error("invalid-result");w={...P,bytes:new Uint8Array((P.bytes instanceof Uint8Array,P.bytes)).slice(),changes:P.changes?.map(A=>({id:A.id,description:A.description,unavailableReason:A.unavailableReason,location:A.location?{paragraphId:A.location.paragraphId,paragraphIndex:A.location.paragraphIndex,start:A.location.start,end:A.location.end,text:A.location.text}:void 0})),failures:P.failures?.slice()};}catch{return Promise.resolve(h(v(E,"invalid-result")))}let S=async()=>{let A=i,$=x();if($)return h(v(E,$));if(!A||A.token!==w.submission)return h(v(E,"superseded"));if(w.sequence<=A.sequence)return h(v(E,"out-of-order"));if(A.epoch!==n.epoch)return h(v(E,"document-changed"));s=true;let W=a.signal,U=()=>i===A&&A.epoch===n.epoch&&!W.aborted;try{let _=await R(W);if(!U())return h(v(E,"cancelled"));if(_.revision!==A.revision)return h(v(E,"local-edits"),"failed");let L=w.bytes;if(!chunkWO4V6PNS_cjs.Ee(L).ok)return h(v(E,"invalid-document"),"failed");if(y.clear(),d=[],u=null,b({phase:"refreshing",changes:[],highlightsVisible:!1}),!U())return h(v(E,"cancelled"));let Z=n.surface().save();if(!U())return h(v(E,"cancelled"));if(n.revision!==A.revision)return h(v(E,"local-edits"),"failed");c={bytes:Z.slice(),epoch:n.epoch};let ee=await n.replace(L,"refresh");if(A.epoch!==n.epoch)return h(v(E,"document-changed"));if(!ee&&!U())return c=null,h(v(E,"cancelled"));if(!ee){if(b({phase:"recovering"}),A.epoch!==n.epoch)return h(v(E,"document-changed"));let D=c&&await n.replace(c.bytes,"recovery");return A.epoch!==n.epoch?h(v(E,"document-changed")):(D&&(c=null),i=null,h(v(E,D?"load-failed":"recovery-failed",!!D),"failed"))}c=null,y.clear(),A.revision=n.mountedRevision,A.sequence=w.sequence;let te=ZL(n,E,w.changes,A.seen);d=n.revision===A.revision?te.located:[];for(let D of d)A.seen.set(D.change.id,D.fingerprint);u=A.revision;let me=Object.freeze(d.map(D=>Object.freeze(D.change))),le=Object.freeze({ok:!0,resultId:E,changes:me,changeInformation:n.revision===A.revision&&te.available?"available":"unavailable",failures:Object.freeze(w.failures??[])});return b({changes:me,result:le,phase:"complete",recoveryAvailable:!1}),h(le)}catch{return h(v(E,U()?"input-failed":"cancelled"),U()?"failed":void 0)}finally{s=false;}},F=l.then(S);return l=F.then(()=>{},()=>{}),F},cancel(){let P=g.phase==="recovering"||!n.surface()&&c!==null;n.cancel(),o++,i=null,a.abort(),a=new AbortController,P||(c=null),b({phase:P?"failed":g.result?.ok?"complete":"idle",result:P||g.result?.ok?g.result:null,recoveryAvailable:c!==null});},finish(P){i?.token===P&&!s&&(i=null,b({phase:g.phase==="processing"?"idle":g.phase}));},snapshot:()=>g,subscribe(P){return f.add(P),()=>{f.delete(P);}},onResult(P){return m.add(P),()=>{m.delete(P);}},highlightChanges(P){if(y.validate(P),u!==n.revision)return 0;let E=P?.changeIds===void 0?null:new Set(P.changeIds),w=d.filter(S=>S.change.status==="available"&&(E?E.has(S.change.id):P?.includePrevious||S.change.isNew));return y.show(w,P),b({highlightsVisible:w.length>0}),w.length},clearHighlights(P){y.hide(P),b({highlightsVisible:false});},navigateToChange(P,E={}){if(E.focus!==void 0&&typeof E.focus!="boolean")throw new TypeError("focus must be a boolean.");let w=qa(E,"center",n.container());if(u!==n.revision)return false;let S=d.find(A=>A.change.id===P);if(!S?.paragraphId||S.offset===void 0)return false;let F=n.surface();if(!F?.revealPosition({paragraphId:S.paragraphId,offset:S.offset},w))return false;if(E?.focus){F.setActiveScope({kind:"body"});let A={paragraphId:S.paragraphId,offset:S.offset};F.setSelection({anchor:A,head:A}),F.focus();}return true},recoveryBytes:()=>c?c.bytes.slice().buffer:null,async recover(){if(!c||c.epoch!==n.epoch||s)return false;s=true;let P=c;b({phase:"recovering"});try{if(P.epoch!==n.epoch)return !1;let E=await n.replace(P.bytes,"recovery");return P.epoch!==n.epoch?!1:(E&&(c=null),b({phase:E?"idle":"failed",recoveryAvailable:!E}),E)}finally{s=false;}}};return XL.set(e,C),C}var YL=150,c$=1e3,d$=Object.freeze({applied:0,unavailable:0});function u$(e,t,n,r={}){let{onResult:o,...i}=r,a=n,s=i,l=d$,c=false,d=ut(()=>Yr(e)),u,f=0,m=h=>{h.applied===l.applied&&h.unavailable===l.unavailable||(l=h,o?.(h));},g=()=>{if(d.clearTimeout(u),u=void 0,f=0,c)return;let h=typeof a=="function"?a(e):a;m(e.setHighlights(t,h,s));},b=()=>{let h=Date.now();f===0&&(f=h),d.clearTimeout(u);let v=Math.min(YL,c$-(h-f));u=d.setTimeout(g,Math.max(0,v));},y=e.on("change",h=>{typeof a=="function"?h.source?g():b():h.source==="refresh"||h.source==="recovery"?g():h.source==="load"&&m({applied:0,unavailable:a.length});});return g(),{get result(){return l},refresh:g,update(h,v){a=h,v!==void 0&&(s=v),g();},stop(){c||(c=true,d.clearTimeout(u),y(),e.clearHighlights(t));}}}var Hy=150,JL=2e3,e1="search",t1=10,Ny=Object.freeze([]),f$=1e3;function p$(e,t){let n=e.activeIndex>=0?e.matches[e.activeIndex]:void 0;if(!n)return -1;let r=-1;for(let[o,i]of t.entries())i.blockId===n.blockId&&(r<0||Math.abs(i.start-n.start)<Math.abs(t[r].start-n.start))&&(r=o);return r}var QL=new WeakMap;function m$(e){let t=QL.get(e);if(t)return t;let n={query:"",matchCase:false,wholeWord:false,matches:Ny,truncated:false,activeIndex:-1,activeMatch:null,isPending:false},r="",o={},i=ut(()=>Yr(e)),a,s=new Set,l=new Map,c=false;function d(){let P="none";for(let E of l.values()){if(E==="all")return "all";E==="active"&&(P="active");}return P}function u(){let P=d(),{matches:E,activeIndex:w}=n,S=w>=0?E[w]:void 0,F=P==="all"?E:P==="active"&&S?[S]:[];F.length===0&&!c||(e.setHighlights(e1,F,{activeIndex:P==="all"?w:F.length>0?0:-1,priority:t1}),c=F.length>0);}function f(P){let E={...n,...P};if(E.matches!==n.matches&&P.activeIndex===void 0&&(E.activeIndex=p$(n,E.matches)),E.truncated=WA(E.matches)??E.matches.length>=JL,E.activeMatch=E.matches[E.activeIndex]??null,!!Object.keys(E).some(S=>E[S]!==n[S])){n=E,u();for(let S of [...s])S();}}function m(P=r,E=n){return P.length===0?Ny:e.findMatches(P,{matchCase:E.matchCase??false,wholeWord:E.wholeWord??false})}function g(){i.clearTimeout(a),a=void 0;}function b(){g(),r=n.query,f({matches:m(),isPending:false});}let y,h=0,v=()=>{i.clearTimeout(y),y=void 0,h=0,r.length>0&&f({matches:m()});},x=()=>{y!==void 0&&v();};e.on("change",P=>{if(r.length===0)return;if(P.source)return v();let E=Date.now();h===0&&(h=E),i.clearTimeout(y);let w=Math.min(Hy,f$-(E-h));y=i.setTimeout(v,Math.max(0,w));});let k=e.snapshot().editingMode;e.on("selectionChange",P=>{P.editingMode!==k&&(k=P.editingMode,v());});let R=(P,E)=>{x();let w=n.matches.length;if(w===0)return false;let S=n.activeIndex<0?P>0?-1:0:n.activeIndex;return C.goTo((S+P+w)%w,E)},C={getState:()=>n,subscribe(P){return s.add(P),()=>s.delete(P)},find(P,E={}){g(),r=P;let w=E.matchCase??n.matchCase,S=E.wholeWord??n.wholeWord,F=m(P,{matchCase:w,wholeWord:S});return E.highlight===void 0||E.highlight==="none"?l.delete(o):l.set(o,E.highlight),f({query:P,matchCase:w,wholeWord:S,matches:F,activeIndex:-1,isPending:false}),u(),E.selectFirst&&C.goTo(0),n.matches},setQuery(P){P!==n.query&&(g(),P!==r&&(a=i.setTimeout(b,Hy)),f({query:P,isPending:P!==r}));},setMatchCase(P){f({matchCase:P,matches:m(r,{...n,matchCase:P})});},setWholeWord(P){f({wholeWord:P,matches:m(r,{...n,wholeWord:P})});},goTo(P,E){x();let w=n.matches[P];return !w||(E?.focus&&e.focus(),!e.selectMatch(w).ok)?false:(f({activeIndex:P}),true)},next:P=>R(1,P),previous:P=>R(-1,P),clear(){g(),r="",l.delete(o),f({query:"",matches:Ny,activeIndex:-1,isPending:false});},showHighlights(P){let E={};return l.set(E,P),u(),()=>{l.delete(E)&&u();}}};return QL.set(e,C),C}var g$=[37,80,68,70,45],_l=class extends Error{constructor(n){super(`Install @docx-editor.dev/docx-to-${n} and configure menu.exporters.${n}.`+(n==="pdf"?" PDF conversion requires a Node.js server.":""));this.format=n;this.name="ChromeExportError";}format;code="missing-exporter"};async function _y(e,t,n={}){if(t==="markdown"){if(!n.markdown)throw new _l(t);let a=await n.markdown(new Uint8Array(await e.save()));if(typeof a?.markdown!="string")throw new TypeError("The Markdown converter returned no Markdown.");return {bytes:new TextEncoder().encode(a.markdown),extension:"md",mimeType:"text/markdown;charset=utf-8"}}if(t!=="pdf")throw new TypeError("Unsupported export format.");if(!n.pdf)throw new _l(t);let r=e.snapshot?.(),o=r?{displayMode:r.reviewDisplayMode??"proposed",revisionMarkup:r.revisionMarkup,...e.getReviewAuthors?{revisionAuthorSlots:Object.freeze(Object.fromEntries(e.getReviewAuthors().map(({author:a,slot:s})=>[a,s])))}:{}}:void 0,i=await n.pdf(new Uint8Array(await e.save()),o);if(!(i?.bytes instanceof Uint8Array)||i.bytes.length===0)throw new TypeError("The PDF converter returned no PDF bytes.");if(!g$.every((a,s)=>i.bytes[s]===a))throw new TypeError("The PDF converter returned a file without a PDF header.");return {bytes:i.bytes,extension:"pdf",mimeType:"application/pdf"}}var y$=15e3,tr=class extends Error{code;constructor(t){super(t==="pdf-viewer-unavailable"?"This browser cannot display PDF files in the page.":t==="pdf-load-failed"?"The PDF did not load for printing.":t==="print-refused"?"The browser refused to print the PDF from the page.":"The print job has ended."),this.code=t,this.name="ChromePrintError";}};function b$(e){if(e.altKey||e.shiftKey||typeof e.key!="string")return false;let t=e.key.toLowerCase();return t!=="p"&&(e.code!=="KeyP"||/^[a-z]$/.test(t))?false:i18n.isApplePlatform()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}async function v$(e,t={},n=globalThis.document){let{bytes:r,mimeType:o}=await _y(e,"pdf",t);return x$(r,o,n)}function x$(e,t,n){let r=n.nodeType===9?n.body:n;if(!r)throw new TypeError("Printing requires a document body.");let o=r.ownerDocument,i=o.defaultView;if(!i)throw new TypeError("Printing requires a document with a window.");let a=e.buffer instanceof ArrayBuffer?e:e.slice(),s=i.URL.createObjectURL(new i.Blob([a],{type:t})),l=null,c=null,d,u=null,f=false,m=y=>{i.clearTimeout(d),u?.(y),u=null,l?.remove(),l=null,c=null;},g=()=>{if(c)return c;let y=o.createElement("iframe");return l=y,y.setAttribute("aria-hidden","true"),y.setAttribute("tabindex","-1"),y.setAttribute("data-docx-print-frame",""),y.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",c=new Promise((h,v)=>{u=v,d=i.setTimeout(()=>m(new tr("pdf-load-failed")),y$),y.addEventListener("load",()=>{if(i.clearTimeout(d),!y.contentWindow){m(new tr("pdf-load-failed"));return}u=null,h(y.contentWindow);},{once:true});}),c.catch(()=>{}),y.src=s,r.append(y),c};return {url:s,async print(y={}){if(f)throw new tr("print-ended");if(i.navigator.pdfViewerEnabled===false)throw new tr("pdf-viewer-unavailable");let h=await g();if(f)throw new tr("print-ended");if(await y.beforePrint?.(),f)throw new tr("print-ended");let v=o.activeElement;try{h.focus(),h.print();}catch{throw new tr("print-refused")}finally{v?.isConnected&&v.focus({preventScroll:true});}},dispose(){f||(f=true,m(new tr("print-ended")),i.URL.revokeObjectURL(s));}}}var w$=new Intl.Collator(void 0,{numeric:true,sensitivity:"base"});function n1(e,t){let n=e.filter(r=>t.showHidden||!r.hidden);return t.sortBy==="location"?[...n].sort((r,o)=>r.order-o.order):[...n].sort((r,o)=>w$.compare(r.name,o.name)||r.order-o.order)}var By=["body","header","footer","footnote","endnote"];function S$(e,t){let n=n1(e,t),r=chunkWO4V6PNS_cjs.Ig(t.query.trim()),o=n;if(r.length>0){let i=[],a=[];for(let s of n){let l=chunkWO4V6PNS_cjs.Ig(s.name);l.startsWith(r)?i.push(s):l.includes(r)&&a.push(s);}o=[...i,...a];}return t.sortBy!=="location"?o:[...o].sort((i,a)=>By.indexOf(i.place)-By.indexOf(a.place))}function k$(e,t,n){let r=chunkWO4V6PNS_cjs.Ig(t.trim());return r.length===0?null:e.find(o=>chunkWO4V6PNS_cjs.Ig(o.name)===r)??n[0]??null}function I$(e,t){let n=chunkWO4V6PNS_cjs.Ig(t.trim()),r=chunkWO4V6PNS_cjs.Ig(e);if(n.length===0||r.length!==e.length)return null;let o=r.indexOf(n);return o<0?null:{start:o,end:o+n.length}}function R$(e){return By.map(t=>({place:t,rows:e.flatMap((n,r)=>n.place===t?[{row:n,index:r}]:[])})).filter(t=>t.rows.length>0)}function P$(e){return e.find(t=>t.atSelection&&!t.hidden)?.name??""}function T$(e,t,n){let r=chunkWO4V6PNS_cjs.Gg(t)??(chunkWO4V6PNS_cjs.Hg(t)?"invalidStart":null),o=chunkWO4V6PNS_cjs.Ig(t),i=t.length===0?null:e.find(a=>chunkWO4V6PNS_cjs.Ig(a.name)===o)??null;return {problem:r,existing:i,canAdd:n&&r===null,canDelete:n&&i!==null,canGoTo:i!==null}}
30
+ exports.$=tl;exports.$a=h8;exports.$b=LL;exports.A=Rm;exports.Aa=kg;exports.Ab=nE;exports.Ac=e$;exports.B=yH;exports.Ba=Z2;exports.Bb=rE;exports.Bc=t$;exports.C=vH;exports.Ca=X2;exports.Cb=Jg;exports.Cc=n$;exports.D=xH;exports.Da=Q2;exports.Db=gu;exports.Dc=UL;exports.E=jk;exports.Ea=jd;exports.Eb=eh;exports.Ec=o$;exports.F=wH;exports.Fa=NR;exports.Fb=hu;exports.Fc=a$;exports.G=SH;exports.Ga=Kd;exports.Gb=th;exports.Gc=Ao;exports.H=kH;exports.Ha=HR;exports.Hb=nh;exports.Hc=l$;exports.I=IH;exports.Ia=BR;exports.Ib=rh;exports.Ic=YL;exports.J=RH;exports.Ja=t8;exports.Jb=ku;exports.Jc=u$;exports.K=PH;exports.Ka=n8;exports.Kb=mh;exports.Kc=Hy;exports.L=Uk;exports.La=r8;exports.Lb=bC;exports.Lc=JL;exports.M=zk;exports.Ma=i8;exports.Mb=Al;exports.Mc=e1;exports.N=Gk;exports.Na=a8;exports.Nb=_a;exports.Nc=t1;exports.O=TH;exports.Oa=s8;exports.Ob=CB;exports.Oc=m$;exports.P=Om;exports.Pa=l8;exports.Pb=OB;exports.Pc=_l;exports.Q=lI;exports.Qa=c8;exports.Qb=$a;exports.Qc=_y;exports.R=cI;exports.Ra=Pg;exports.Rb=S4;exports.Rc=tr;exports.S=Cd;exports.Sa=d8;exports.Sb=Ay;exports.Sc=b$;exports.T=Am;exports.Ta=qR;exports.Tb=Nl;exports.Tc=v$;exports.U=Fm;exports.Ua=KR;exports.Ub=Hl;exports.Uc=n1;exports.V=MH;exports.Va=u8;exports.Vb=Wa;exports.Vc=S$;exports.W=Od;exports.Wa=f8;exports.Wb=k3;exports.Wc=k$;exports.X=Qs;exports.Xa=Tg;exports.Xb=of;exports.Xc=I$;exports.Y=og;exports.Ya=p8;exports.Yb=af;exports.Yc=R$;exports.Z=g2;exports.Za=m8;exports.Zb=Fy;exports.Zc=P$;exports._=el;exports._a=g8;exports._b=M3;exports._c=T$;exports.a=ia;exports.aa=ig;exports.ab=y8;exports.ac=F3;exports.b=qs;exports.ba=h2;exports.bb=b8;exports.bc=Dy;exports.c=sd;exports.ca=ag;exports.cb=v8;exports.cc=D3;exports.d=ld;exports.da=Dd;exports.db=x8;exports.dc=H3;exports.e=Lp;exports.ea=Kt;exports.eb=w8;exports.ec=_3;exports.f=W1;exports.fa=gi;exports.fb=VR;exports.fc=B3;exports.g=Dp;exports.ga=QI;exports.gb=XR;exports.gc=$3;exports.h=QN;exports.ha=Nd;exports.hb=C8;exports.hc=q3;exports.i=JN;exports.ia=wr;exports.ib=zd;exports.ic=W3;exports.j=tH;exports.ja=rl;exports.jb=Cg;exports.jc=K3;exports.k=Tk;exports.ka=fg;exports.kb=Og;exports.kc=HL;exports.l=Gs;exports.la=mg;exports.lb=A8;exports.lc=_L;exports.m=Ze;exports.ma=E2;exports.mb=tP;exports.mc=U3;exports.n=oH;exports.na=C2;exports.nb=F8;exports.nc=z3;exports.o=iH;exports.oa=M2;exports.ob=nP;exports.oc=BL;exports.p=aH;exports.pa=A2;exports.pb=L8;exports.pc=G3;exports.q=_t;exports.qa=Bd;exports.qb=D8;exports.qc=Z3;exports.r=vr;exports.ra=ya;exports.rb=N8;exports.rc=X3;exports.s=sH;exports.sa=PR;exports.sb=MT;exports.sc=$L;exports.t=ko;exports.ta=Sg;exports.tb=gl;exports.tc=qL;exports.u=ut;exports.ua=al;exports.ub=hl;exports.uc=Y3;exports.v=Zs;exports.va=j2;exports.vb=C6;exports.vc=WL;exports.w=hm;exports.wa=TR;exports.wb=Xg;exports.wc=Q3;exports.x=lH;exports.xa=ER;exports.xb=xi;exports.xc=KL;exports.y=ym;exports.ya=V2;exports.yb=to;exports.yc=J3;exports.z=Ce;exports.za=hi;exports.zb=mu;exports.zc=jL;