@eigenpal/docx-editor-core 1.5.0 → 1.6.1

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 (252) hide show
  1. package/dist/agent/index.d.mts +4 -4
  2. package/dist/agent/index.d.ts +4 -4
  3. package/dist/agent/index.js +1 -1
  4. package/dist/agent/index.mjs +1 -1
  5. package/dist/chunk-3HLRRK6N.mjs +2 -0
  6. package/dist/{chunk-COV4LHQ7.js → chunk-4272FQ2E.js} +1 -1
  7. package/dist/chunk-47SKD7QB.mjs +4 -0
  8. package/dist/chunk-4DCTKHS5.js +1 -0
  9. package/dist/{chunk-3SJQRYO7.js → chunk-4HNEXEGS.js} +1 -1
  10. package/dist/chunk-4U2S3WV2.js +1 -0
  11. package/dist/{chunk-3HENAL6V.mjs → chunk-5EP47PMQ.mjs} +1 -1
  12. package/dist/{chunk-T4O4PFJD.mjs → chunk-6ENZQGYR.mjs} +1 -1
  13. package/dist/chunk-7EU6E64E.mjs +1 -0
  14. package/dist/chunk-A7C3DGQA.mjs +1 -0
  15. package/dist/chunk-B6FA4MJ5.mjs +1 -0
  16. package/dist/chunk-BJSG6TEG.js +1 -0
  17. package/dist/chunk-BMP2OSXE.js +1 -0
  18. package/dist/{chunk-NPFFCPZ6.js → chunk-DEQFU56O.js} +1 -1
  19. package/dist/chunk-DFDL337G.js +4 -0
  20. package/dist/chunk-DKUHG27E.js +1 -0
  21. package/dist/{chunk-WWVIVYX6.mjs → chunk-DU5TWD2W.mjs} +1 -1
  22. package/dist/chunk-DUVSDFRG.js +2 -0
  23. package/dist/{chunk-TV6JLFY5.js → chunk-DUXHJ6QP.js} +1 -1
  24. package/dist/{chunk-TE2AF7FM.js → chunk-FETIBXTH.js} +1 -1
  25. package/dist/chunk-GLPOVLZD.mjs +1 -0
  26. package/dist/{chunk-M7KTKPGO.mjs → chunk-HEJJXAXN.mjs} +1 -1
  27. package/dist/chunk-HQ76VZAN.mjs +1 -0
  28. package/dist/{chunk-WYFK4QOF.mjs → chunk-ICNIAAH7.mjs} +1 -1
  29. package/dist/{chunk-5WINQXA3.js → chunk-ILPNMG7Q.js} +1 -1
  30. package/dist/{chunk-TDYWEVAE.js → chunk-K7NSOCSY.js} +1 -1
  31. package/dist/{chunk-6KM4VW4L.js → chunk-KEDY4GFG.js} +3 -3
  32. package/dist/chunk-KNY7SXPJ.mjs +1 -0
  33. package/dist/{chunk-SKBHY5MK.mjs → chunk-KPWWI5UW.mjs} +1 -1
  34. package/dist/chunk-LVUL7O27.js +1 -0
  35. package/dist/{chunk-O2643IUW.js → chunk-LW5OFHSW.js} +2 -2
  36. package/dist/chunk-MWOHCSZE.js +1 -0
  37. package/dist/chunk-NKIDBERV.js +1 -0
  38. package/dist/chunk-NN2EJIO7.mjs +1 -0
  39. package/dist/{chunk-QUM4DFRE.mjs → chunk-O4RCQNUW.mjs} +1 -1
  40. package/dist/chunk-O5L4BZCZ.mjs +1 -0
  41. package/dist/chunk-OSTMAXZZ.mjs +1 -0
  42. package/dist/{chunk-PYDX4MOT.mjs → chunk-OWGY46IW.mjs} +1 -1
  43. package/dist/chunk-PGWY6UFK.js +1 -0
  44. package/dist/chunk-PJEB3ZWG.mjs +3 -0
  45. package/dist/{chunk-GB7RICH6.js → chunk-PM4KDJJ2.js} +1 -1
  46. package/dist/chunk-Q2VALXEU.js +3 -0
  47. package/dist/chunk-QCPISGPW.mjs +1 -0
  48. package/dist/{chunk-CBKJOPOW.mjs → chunk-QRBFMR7Z.mjs} +1 -1
  49. package/dist/chunk-RRJKF2XI.mjs +1 -0
  50. package/dist/chunk-SHZOAUHB.mjs +1 -0
  51. package/dist/chunk-TT3ILFZC.js +1 -0
  52. package/dist/chunk-TXAB4I4M.mjs +2 -0
  53. package/dist/chunk-UC7JW66O.mjs +1 -0
  54. package/dist/chunk-VMBCUUZM.mjs +1 -0
  55. package/dist/chunk-WTIN6QHX.js +1 -0
  56. package/dist/{chunk-P7HWOJC5.js → chunk-WVY2UXAK.js} +1 -1
  57. package/dist/chunk-XCTYXYEU.js +1 -0
  58. package/dist/{chunk-WXSGCEBZ.js → chunk-XCXQWCV2.js} +1 -1
  59. package/dist/{chunk-M3UL6EUU.mjs → chunk-YSBX4LFA.mjs} +2 -2
  60. package/dist/chunk-YUHOVME2.js +1 -0
  61. package/dist/{content-BlWiORm-.d.mts → content-BEFz1zcs.d.mts} +2 -2
  62. package/dist/{content-eG_Rtl0l.d.ts → content-DNcMlHU0.d.ts} +2 -2
  63. package/dist/{contentControlValues-CO7pUqOf.d.ts → contentControlValues-2pV4M4kG.d.ts} +1 -1
  64. package/dist/{contentControlValues-DfYN9BZ8.d.mts → contentControlValues-CKWIIkkr.d.mts} +1 -1
  65. package/dist/core-plugins.d.mts +2 -2
  66. package/dist/core-plugins.d.ts +2 -2
  67. package/dist/core-plugins.js +1 -1
  68. package/dist/core-plugins.mjs +1 -1
  69. package/dist/core.d.mts +7 -7
  70. package/dist/core.d.ts +7 -7
  71. package/dist/core.js +1 -1
  72. package/dist/core.mjs +1 -1
  73. package/dist/docx/index.d.mts +2 -2
  74. package/dist/docx/index.d.ts +2 -2
  75. package/dist/docx/index.js +1 -1
  76. package/dist/docx/index.mjs +1 -1
  77. package/dist/docx/parser.d.mts +2 -2
  78. package/dist/docx/parser.d.ts +2 -2
  79. package/dist/docx/parser.js +1 -1
  80. package/dist/docx/parser.mjs +1 -1
  81. package/dist/docx/rezip.d.mts +2 -2
  82. package/dist/docx/rezip.d.ts +2 -2
  83. package/dist/docx/serializer/index.d.mts +3 -3
  84. package/dist/docx/serializer/index.d.ts +3 -3
  85. package/dist/editor/index.d.mts +2 -2
  86. package/dist/editor/index.d.ts +2 -2
  87. package/dist/editor/index.js +1 -1
  88. package/dist/editor/index.mjs +1 -1
  89. package/dist/executor-FHL5D4CB.js +1 -0
  90. package/dist/executor-FL6XGVP3.mjs +1 -0
  91. package/dist/{fontLoader-C6VvBUVB.d.ts → fontLoader-CH12AtFF.d.ts} +1 -1
  92. package/dist/{fontLoader-3MFD_Hj2.d.mts → fontLoader-D3X2Qgb_.d.mts} +1 -1
  93. package/dist/{headerFooterLayout-bdHWlU6g.d.ts → headerFooterLayout-BdGTU0IA.d.ts} +31 -16
  94. package/dist/{headerFooterLayout-DJb-dV7X.d.mts → headerFooterLayout-D5-u-IsD.d.mts} +31 -16
  95. package/dist/headless.d.mts +5 -5
  96. package/dist/headless.d.ts +5 -5
  97. package/dist/headless.js +1 -1
  98. package/dist/headless.mjs +1 -1
  99. package/dist/layout-bridge/clickToPositionDom.js +1 -1
  100. package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
  101. package/dist/layout-bridge/index.d.mts +67 -5
  102. package/dist/layout-bridge/index.d.ts +67 -5
  103. package/dist/layout-bridge/index.js +1 -1
  104. package/dist/layout-bridge/index.mjs +1 -1
  105. package/dist/layout-bridge/measuring/index.d.mts +2 -2
  106. package/dist/layout-bridge/measuring/index.d.ts +2 -2
  107. package/dist/layout-bridge/measuring/index.js +1 -1
  108. package/dist/layout-bridge/measuring/index.mjs +1 -1
  109. package/dist/layout-bridge/tableInsertHover.js +1 -1
  110. package/dist/layout-bridge/tableInsertHover.mjs +1 -1
  111. package/dist/layout-bridge/toFlowBlocks.d.mts +2 -2
  112. package/dist/layout-bridge/toFlowBlocks.d.ts +2 -2
  113. package/dist/layout-bridge/toFlowBlocks.js +1 -1
  114. package/dist/layout-bridge/toFlowBlocks.mjs +1 -1
  115. package/dist/layout-engine/index.d.mts +2 -2
  116. package/dist/layout-engine/index.d.ts +2 -2
  117. package/dist/layout-engine/index.js +1 -1
  118. package/dist/layout-engine/index.mjs +1 -1
  119. package/dist/layout-engine/types.d.mts +2 -2
  120. package/dist/layout-engine/types.d.ts +2 -2
  121. package/dist/layout-painter/index.d.mts +3 -3
  122. package/dist/layout-painter/index.d.ts +3 -3
  123. package/dist/layout-painter/index.js +1 -1
  124. package/dist/layout-painter/index.mjs +1 -1
  125. package/dist/layout-painter/renderPage.d.mts +3 -3
  126. package/dist/layout-painter/renderPage.d.ts +3 -3
  127. package/dist/layout-painter/renderPage.js +1 -1
  128. package/dist/layout-painter/renderPage.mjs +1 -1
  129. package/dist/managers/AutoSaveManager.d.mts +2 -2
  130. package/dist/managers/AutoSaveManager.d.ts +2 -2
  131. package/dist/managers/TableSelectionManager.d.mts +2 -2
  132. package/dist/managers/TableSelectionManager.d.ts +2 -2
  133. package/dist/managers/types.d.mts +2 -2
  134. package/dist/managers/types.d.ts +2 -2
  135. package/dist/mcp-cli.mjs +22 -22
  136. package/dist/mcp.d.mts +2 -2
  137. package/dist/mcp.d.ts +2 -2
  138. package/dist/mcp.js +7 -7
  139. package/dist/mcp.mjs +1 -1
  140. package/dist/{nodes-RfTS-NSv.d.mts → nodes-5w_QaI3g.d.mts} +13 -1
  141. package/dist/{nodes-BJef4KFW.d.ts → nodes-qQdZtu3Z.d.ts} +13 -1
  142. package/dist/prosemirror/applyFormatting.d.mts +34 -4
  143. package/dist/prosemirror/applyFormatting.d.ts +34 -4
  144. package/dist/prosemirror/applyFormatting.js +1 -1
  145. package/dist/prosemirror/applyFormatting.mjs +1 -1
  146. package/dist/prosemirror/commands/formatting.js +1 -1
  147. package/dist/prosemirror/commands/formatting.mjs +1 -1
  148. package/dist/prosemirror/commands/index.d.mts +2 -1
  149. package/dist/prosemirror/commands/index.d.ts +2 -1
  150. package/dist/prosemirror/commands/index.js +1 -1
  151. package/dist/prosemirror/commands/index.mjs +1 -1
  152. package/dist/prosemirror/commands/paragraph.js +1 -1
  153. package/dist/prosemirror/commands/paragraph.mjs +1 -1
  154. package/dist/prosemirror/commands/sectionBreak.d.mts +25 -0
  155. package/dist/prosemirror/commands/sectionBreak.d.ts +25 -0
  156. package/dist/prosemirror/commands/sectionBreak.js +1 -0
  157. package/dist/prosemirror/commands/sectionBreak.mjs +1 -0
  158. package/dist/prosemirror/commentIdAllocator.d.mts +2 -2
  159. package/dist/prosemirror/commentIdAllocator.d.ts +2 -2
  160. package/dist/prosemirror/commentOps.d.mts +2 -2
  161. package/dist/prosemirror/commentOps.d.ts +2 -2
  162. package/dist/prosemirror/conversion/fromProseDoc.d.mts +2 -2
  163. package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -2
  164. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  165. package/dist/prosemirror/conversion/fromProseDoc.mjs +1 -1
  166. package/dist/prosemirror/conversion/index.d.mts +2 -2
  167. package/dist/prosemirror/conversion/index.d.ts +2 -2
  168. package/dist/prosemirror/conversion/index.js +1 -1
  169. package/dist/prosemirror/conversion/index.mjs +1 -1
  170. package/dist/prosemirror/extensions/index.js +1 -1
  171. package/dist/prosemirror/extensions/index.mjs +1 -1
  172. package/dist/prosemirror/index.d.mts +4 -4
  173. package/dist/prosemirror/index.d.ts +4 -4
  174. package/dist/prosemirror/index.js +2 -2
  175. package/dist/prosemirror/index.mjs +2 -2
  176. package/dist/prosemirror/plugins/index.d.mts +2 -2
  177. package/dist/prosemirror/plugins/index.d.ts +2 -2
  178. package/dist/prosemirror/plugins/index.js +1 -1
  179. package/dist/prosemirror/plugins/index.mjs +1 -1
  180. package/dist/prosemirror/queries.d.mts +2 -2
  181. package/dist/prosemirror/queries.d.ts +2 -2
  182. package/dist/prosemirror/schema/index.d.mts +3 -3
  183. package/dist/prosemirror/schema/index.d.ts +3 -3
  184. package/dist/prosemirror/schema/index.js +1 -1
  185. package/dist/prosemirror/schema/index.mjs +1 -1
  186. package/dist/prosemirror/utils/extractTrackedChanges.d.mts +2 -2
  187. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +2 -2
  188. package/dist/{sectionPropertiesSerializer-S8J1V9mb.d.ts → sectionPropertiesSerializer-BJSNK-Wl.d.ts} +1 -1
  189. package/dist/{sectionPropertiesSerializer-C8XCmzE4.d.mts → sectionPropertiesSerializer-DI3OIQ1j.d.mts} +1 -1
  190. package/dist/types/content.d.mts +2 -2
  191. package/dist/types/content.d.ts +2 -2
  192. package/dist/types/content.js +1 -1
  193. package/dist/types/content.mjs +1 -1
  194. package/dist/types/document.d.mts +3 -3
  195. package/dist/types/document.d.ts +3 -3
  196. package/dist/types/document.js +1 -1
  197. package/dist/types/document.mjs +1 -1
  198. package/dist/utils/cardStyles.js +1 -1
  199. package/dist/utils/cardStyles.mjs +1 -1
  200. package/dist/utils/comments.d.mts +2 -2
  201. package/dist/utils/comments.d.ts +2 -2
  202. package/dist/utils/index.d.mts +37 -4
  203. package/dist/utils/index.d.ts +37 -4
  204. package/dist/utils/index.js +3 -3
  205. package/dist/utils/index.mjs +3 -3
  206. package/dist/utils/stylePreview.d.mts +83 -0
  207. package/dist/utils/stylePreview.d.ts +83 -0
  208. package/dist/utils/stylePreview.js +1 -0
  209. package/dist/utils/stylePreview.mjs +1 -0
  210. package/dist/utils/units.d.mts +7 -1
  211. package/dist/utils/units.d.ts +7 -1
  212. package/dist/utils/units.js +1 -1
  213. package/dist/utils/units.mjs +1 -1
  214. package/dist/{variableDetector-CN9_pUR_.d.mts → variableDetector-7xBsshP0.d.mts} +1 -1
  215. package/dist/{variableDetector-o4Rb2Csy.d.ts → variableDetector-Bv5Tm0D-.d.ts} +1 -1
  216. package/dist/{watermark-DAcnAs_J.d.mts → watermark-D90356ZM.d.mts} +7 -1
  217. package/dist/{watermark-DAcnAs_J.d.ts → watermark-D90356ZM.d.ts} +7 -1
  218. package/package.json +17 -1
  219. package/dist/chunk-4Q2IP5FW.js +0 -1
  220. package/dist/chunk-4RQAAKQI.mjs +0 -1
  221. package/dist/chunk-5HA66FH4.mjs +0 -1
  222. package/dist/chunk-7OW3VCZE.mjs +0 -1
  223. package/dist/chunk-AA6D2C6R.js +0 -4
  224. package/dist/chunk-AMJNIGO2.mjs +0 -2
  225. package/dist/chunk-BHBOAP6Z.js +0 -3
  226. package/dist/chunk-BTSL4AYY.js +0 -1
  227. package/dist/chunk-C45EFOVP.js +0 -1
  228. package/dist/chunk-CUY2THAO.mjs +0 -1
  229. package/dist/chunk-DKKTY56Q.js +0 -1
  230. package/dist/chunk-DZ3FN3JI.js +0 -2
  231. package/dist/chunk-ENIWJBS7.mjs +0 -2
  232. package/dist/chunk-EZNVVB63.mjs +0 -1
  233. package/dist/chunk-GKAXYZCE.mjs +0 -1
  234. package/dist/chunk-IGYHDSM7.mjs +0 -1
  235. package/dist/chunk-L6ZRNW7Y.mjs +0 -1
  236. package/dist/chunk-LJ2TB6CY.js +0 -1
  237. package/dist/chunk-MOKKS75W.mjs +0 -3
  238. package/dist/chunk-ND33YQGU.js +0 -1
  239. package/dist/chunk-QXSDGNJ4.js +0 -1
  240. package/dist/chunk-RT52EYG3.mjs +0 -4
  241. package/dist/chunk-SHYNWAW6.mjs +0 -1
  242. package/dist/chunk-SNTAAXXA.mjs +0 -1
  243. package/dist/chunk-TAQTZAVZ.js +0 -1
  244. package/dist/chunk-UKMKGIME.js +0 -1
  245. package/dist/chunk-UXPY65AC.js +0 -1
  246. package/dist/chunk-VOCHZNOF.mjs +0 -1
  247. package/dist/chunk-VW22RZ6C.mjs +0 -1
  248. package/dist/chunk-WQRWRWSK.js +0 -1
  249. package/dist/chunk-YHXVNJK5.mjs +0 -1
  250. package/dist/chunk-ZETEPB7I.js +0 -1
  251. package/dist/executor-DZAMMQ35.js +0 -1
  252. package/dist/executor-ZCJRLT3Z.mjs +0 -1
@@ -1,10 +1,10 @@
1
- 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkP7HWOJC5_js=require('./chunk-P7HWOJC5.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
1
+ 'use strict';var chunkU4UCHBZ7_js=require('./chunk-U4UCHBZ7.js'),chunkESI4BSBF_js=require('./chunk-ESI4BSBF.js'),chunkWVY2UXAK_js=require('./chunk-WVY2UXAK.js');function M(o){return typeof o=="object"&&o!==null&&("_def"in o||"parse"in o||"safeParse"in o)}function v(o,i){let s=i,{position:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.paragraphIndex} out of bounds`);let l=a[n.paragraphIndex],p=`{${t}}`;return C(l,n.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function w(o,i){let s=i,{range:n,variableName:t}=s,e=JSON.parse(JSON.stringify(o)),a=e.package.document.content.filter(m=>m.type==="paragraph");if(n.start.paragraphIndex!==n.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(n.start.paragraphIndex>=a.length)throw new Error(`Paragraph index ${n.start.paragraphIndex} out of bounds`);let l=a[n.start.paragraphIndex];I(l,n.start.offset,n.end.offset);let p=`{${t}}`;return C(l,n.start.offset,p),e.templateVariables||(e.templateVariables=[]),e.templateVariables.includes(t)||e.templateVariables.push(t),e}function C(o,i,s){let n=0,t=false;for(let e=0;e<o.content.length;e++){let r=o.content[e];if(r.type==="run"){let a=g(r),l=n,p=n+a.length;if(!t&&i>=l&&i<=p){let m=i-l,f=a.slice(0,m),x=a.slice(m),d=[];for(let c=0;c<e;c++)d.push(o.content[c]);f&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:f}]}),d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:s}]}),x&&d.push({type:"run",formatting:r.formatting,content:[{type:"text",text:x}]});for(let c=e+1;c<o.content.length;c++)d.push(o.content[c]);o.content=d,t=true;break}n=p;}else if(r.type==="hyperlink")for(let a of r.children)a.type==="run"&&(n+=g(a).length);}t||o.content.push({type:"run",content:[{type:"text",text:s}]});}function I(o,i,s){let n=[],t=0;for(let e of o.content)if(e.type==="run"){let r=g(e),a=t,l=t+r.length;if(l<=i||a>=s)n.push(e);else {let p="";a<i&&(p+=r.slice(0,i-a)),l>s&&(p+=r.slice(s-a)),p.length>0&&n.push({type:"run",formatting:e.formatting,content:[{type:"text",text:p}]});}t=l;}else n.push(e);o.content=n;}function g(o){return o.content.filter(i=>i.type==="text").map(i=>i.text).join("")}var u={type:"string",description:"Document ID from a previous docx_load call"},D={type:"object",properties:{paragraphIndex:{type:"number",description:"Index of the paragraph (0-indexed)"},offset:{type:"number",description:"Character offset within the paragraph"}},required:["paragraphIndex","offset"]},V={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
2
2
  Returns variable names without braces, along with their locations (body, headers, footers, etc.).
3
3
  Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};try{let t=chunkU4UCHBZ7_js.b(n.document);return {content:[{type:"text",text:JSON.stringify({variables:t.variables,count:t.variables.length,totalOccurrences:t.totalOccurrences,byLocation:t.byLocation},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low",examples:[{description:"Get all variables from a loaded document",input:{documentId:"doc_123"},output:'{"variables": ["customer_name", "invoice_date"], "count": 2}'}]}},R={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
4
4
  The variable can later be substituted with actual values using docx_apply_template.
5
- Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-DZAMMQ35.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
5
+ Variable names should follow the pattern: letters, numbers, underscores, starting with a letter.`,inputSchema:{type:"object",properties:{documentId:u,position:D,variableName:{type:"string",description:'Variable name without braces (e.g., "customer_name"). Will be inserted as {customer_name}',pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$"}},required:["documentId","position","variableName"]},handler:async(o,i)=>{let{documentId:s,position:n,variableName:t}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(t))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${t}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:r}=await import('./executor-FHL5D4CB.js'),a=r(e.document,{type:"insertText",position:n,text:`{${t}}`});return e.document=a,e.lastModified=Date.now(),a.templateVariables||(a.templateVariables=[]),a.templateVariables.includes(t)||a.templateVariables.push(t),{content:[{type:"text",text:JSON.stringify({success:!0,variable:t,insertedAs:`{${t}}`,position:n})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"low",examples:[{description:"Insert customer name variable at start of first paragraph",input:{documentId:"doc_123",position:{paragraphIndex:0,offset:0},variableName:"customer_name"}}]}},S={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
6
6
  Replaces all {variable} placeholders with the corresponding values provided.
7
7
  Preserves all formatting (fonts, styles, colors, tables).
8
- Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkP7HWOJC5_js.a(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
8
+ Use docx_get_variables first to discover what variables exist in the document.`,inputSchema:{type:"object",properties:{documentId:u,variables:{type:"object",description:'Map of variable names to values (e.g., {"customer_name": "John Doe", "date": "2024-01-15"})',additionalProperties:{type:"string"}},keepUnmatchedVariables:{type:"boolean",description:"If true, keep {variable} placeholders for variables not in the map. If false, replace with empty string. Default: true",default:true}},required:["documentId","variables"]},handler:async(o,i)=>{let{documentId:s,variables:n,keepUnmatchedVariables:t=true}=o,e=i.session.documents.get(s);if(!e)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!e.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let r=chunkESI4BSBF_js.b(e.buffer,n,{nullGetter:t?"keep":"empty"}),a=await chunkWVY2UXAK_js.a(r.buffer);return e.document=a,e.buffer=r.buffer,e.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:r.replacedVariables,unreplacedVariables:r.unreplacedVariables,warnings:r.warnings})}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${r.message}`}]}}},annotations:{category:"template",readOnly:false,complexity:"medium",examples:[{description:"Fill in customer and date values",input:{documentId:"doc_123",variables:{customer_name:"Jane Smith",invoice_date:"2024-02-15",amount:"$1,234.56"}}}]}},k={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
9
9
  Checks for syntax errors like unclosed braces, invalid tag names, etc.
10
10
  Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:u},required:["documentId"]},handler:async(o,i)=>{let{documentId:s}=o,n=i.session.documents.get(s);if(!n)return {isError:true,content:[{type:"text",text:`Document not found: ${s}`}]};if(!n.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let t=chunkESI4BSBF_js.f(n.buffer);return {content:[{type:"text",text:JSON.stringify({valid:t.valid,tags:t.tags,errors:t.errors.map(e=>({message:e.message,variable:e.variable,type:e.type}))},null,2)}]}}catch(t){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${t.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},P=[V,R,S,k];var E={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:v,replaceWithTemplateVariable:w},mcpTools:P};exports.a=M;exports.b=E;
@@ -0,0 +1 @@
1
+ var u=1440;var o=96,P=14;function _(n){return n/1440*96}function I(n){return n/96*1440}function E(n){return n==null||isNaN(n)?0:Math.round(n*96/914400)}function i(n){return Math.round(n/96*914400)}function m(n){return Math.round(n/914400*1440)}function N(n){return Math.round(n/1440*914400)}function H(n){return n/72*96}function b(n){return n/144*96}function s(n){return n/2}function p(n){return n*2}function x(n){return n/576*96}function e(n,t=2){let r=Math.pow(10,t);return Math.round(n*r)/r}function R(n,t,r){return Math.min(Math.max(n,t),r)}function S(n){return `${e(n)}px`}export{u as a,o as b,P as c,_ as d,I as e,E as f,i as g,m as h,N as i,H as j,b as k,s as l,p as m,x as n,e as o,R as p,S as q};
@@ -1 +1 @@
1
- import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-SNTAAXXA.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function _(e){let{$from:t}=e.selection,n=null,r=null,s=null,a=-1,o=-1;for(let i=t.depth;i>0;i--){let c=t.node(i);if(c.type.name==="tableCell"||c.type.name==="tableHeader"){s=c;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(o===-1){if(S===t.index(i-1)){o=b;return}b+=h.attrs.colspan||1;}});}}else if(c.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(a=t.index(i-1));else if(c.type.name==="table"){n=c,r=t.before(i);break}}return !n||r==null||!s||a<0||o<0?null:{table:n,tablePos:r,cell:s,row:a,col:o,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let a=e.child(s),o=0;a.forEach(i=>{for(;t[s]?.[o];)o++;let c=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:o,rowspan:c,colspan:l});for(let b=s;b<s+c;b++){let h=t[b]??[];t[b]=h;for(let y=o;y<o+l;y++)h[y]=true;}o+=l,r=Math.max(r,o);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let a={...e.attrs},o=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),c=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return a.colspan=n,a.rowspan=r,a.colwidth=null,o>0&&(a.width=Math.round(i/o*5e3),a.widthType="pct"),c&&(a._originalFormatting=null),a}function Y(e,t,n,r){let s=t+1;for(let a=0;a<e.childCount;a++){let o=e.child(a),i=s+1,c=0;for(let l=0;l<o.childCount;l++){let b=o.child(l);if(a===n&&c===r)return i;c+=b.attrs.colspan||1,i+=b.nodeSize;}s+=o.nodeSize;}return null}function q(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function Q(e$1){let t=_(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Z(e,t,n,r,s,a){if(n<1||r<1)return false;let o=_(e);if(!o||!t)return false;let i=o;if(s!=null&&a!=null&&(s!==o.row||a!==o.col)){let{anchors:p}=H(o.table),g=p.find(T=>T.row===s&&T.col===a);if(!g)return false;i={...o,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:c$1,totalCols:l}=H(i.table),b$1=q(i.table,l),h=b(b$1,i.col,i.colspan,r),y=c$1.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(c$1,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),d=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,d),C=f.doc.nodeAt(i.tablePos);if(C){let p=Y(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function re(e,t){return m.insertTable(e,t)}function ne(e,t){return m.addRowAbove()(e,t)}function oe(e,t){return m.addRowBelow()(e,t)}function ae(e,t){return m.deleteRow()(e,t)}function ie(e,t){return m.addColumnLeft()(e,t)}function se(e,t){return m.addColumnRight()(e,t)}function le(e,t){return m.deleteColumn()(e,t)}function ce(e,t){return m.deleteTable()(e,t)}function de(e,t){return m.selectTable()(e,t)}function ue(e,t){return m.selectRow()(e,t)}function pe(e,t){return m.selectColumn()(e,t)}function me(e,t){return m.mergeCells()(e,t)}function fe(e,t){return m.splitCell()(e,t)}function ge(e,t,n){return m.setCellBorder(e,t,n)}function be(e,t){return m.setTableBorders(e,t)}function he(e,t){return m.removeTableBorders()(e,t)}function ye(e,t,n){return m.setAllTableBorders(n)(e,t)}function Ce(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function Te(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Se(e){return m.setCellVerticalAlign(e)}function ke(e){return m.setCellMargins(e)}function ve(e){return m.setCellTextDirection(e)}function xe(){return m.toggleNoWrap()}function we(e,t){return m.setRowHeight(e,t)}function Ie(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function Ae(){return m.autoFitContents()}function Ee(e){return m.setTableProperties(e)}function Me(e){return m.applyTableStyle(e)}function Re(e){return m.setCellFillColor(e)}function Ne(e){return m.setTableBorderColor(e)}function Be(e){return m.setTableBorderWidth(e)}var Fe=a.getCommands();function O(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),a=i(e),o=e.schema.marks.insertion;return a&&o&&s.addMark(r,r+n.nodeSize,o.create({revisionId:a.revisionId,author:a.author,date:a.date})),t(s.scrollIntoView()),true}var V=612;function We(e,t,n){let r=n?.maxWidth??V,s=new FileReader;s.onload=()=>{let a=s.result,o=new Image;o.onload=()=>{let i=o.naturalWidth,c=o.naturalHeight;i>r&&(c=Math.round(c*(r/i)),i=r);let l=e.state.schema.nodes.image.create({src:a,alt:t.name,width:i,height:c,rId:`rId_img_${Date.now()}_${Math.round(Math.random()*1e9)}`,wrapType:"inline",displayMode:"inline"});O(e.state,e.dispatch,l,e.state.selection.from),e.focus(),n?.onInserted?.();},o.onerror=()=>n?.onError?.(new Error("Failed to decode image")),o.src=a;},s.onerror=()=>n?.onError?.(s.error),s.readAsDataURL(t);}function De(e,t,n){return Fe.setImageWrapType(e,t,n)}function Le(e){return (t,n)=>{let{from:r,to:s,empty:a}=t.selection;if(a)return false;let o=t.schema.marks.comment;if(!o)return false;if(n){let i=t.tr.addMark(r,s,o.create({commentId:e}));n(i);}return true}}function ze(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((a,o)=>{if(a.isText)for(let i of a.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(o,o+a.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function $(e,t,n){return (r,s)=>{let a=r.schema.marks.insertion,o=r.schema.marks.deletion;if(!a&&!o)return false;let i=n==="accept"?a:o,c=n==="accept"?o:a;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);c&&h.marks.some(k=>k.type===c)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function He(e,t){return $(e,t,"accept")}function je(e,t){return $(e,t,"reject")}function U(e){let t=new Set,n=[],r=o=>{typeof o=="number"&&!t.has(o)&&(t.add(o),n.push(o));},s=e.schema.marks.insertion,a=e.schema.marks.deletion;return e.doc.descendants(o=>{if(o.type.name==="paragraph"){r(o.attrs.pPrIns?.revisionId),r(o.attrs.pPrDel?.revisionId);let i=o.attrs.pPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableRow"){r(o.attrs.trIns?.revisionId),r(o.attrs.trDel?.revisionId);let i=o.attrs.trPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableCell"||o.type.name==="tableHeader"){let i=o.attrs.cellMarker;r(i?.info?.revisionId);let c=o.attrs.tcPrChange;if(Array.isArray(c))for(let l of c)r(l.info.id);}if(o.type.name==="table"){let i=o.attrs.tblPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.isInline)for(let i of o.marks)(s&&i.type===s||a&&i.type===a)&&r(i.attrs.revisionId);}),n}function _e(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"accept")(r,s);return true}}function Oe(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"reject")(r,s);return true}}function G(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(s)return false;if(a.isInline&&!(o+a.nodeSize<=t)){for(let i of a.marks)if(i.type===n||i.type===r)return s={from:Math.max(o,t),to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?G(e,0):s}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrIns,o=r.attrs.pPrDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function $e(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrChange;Array.isArray(a)&&a.forEach((o,i)=>{!o?.info||typeof o.info.id!="number"||o.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:o.previousFormatting,current:o.currentFormatting});});}),n}function Ue(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((a,o)=>{if(a.isInline){for(let i of a.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let c=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===c&&l.to===o?l.to=o+a.nodeSize:n.push({from:o,to:o+a.nodeSize,markName:c});}}}),n}function Ge(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,a=e.doc.nodeAt(s);!a||a.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...a.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Xe(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let a=s.slice();a.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:a.length>0?a:null});}function Je(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let a of s)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let a=r.attrs.trIns,o=r.attrs.trDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ye(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let a=r.attrs.cellMarker;a?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:a.kind});}),n}function M(e,t){return (n,r)=>{let s=Ve(n,e),a=Ue(n,e),o=$e(n,e),i=Ke(n,e),c=Ye(n,e);if(s.length===0&&a.length===0&&o.length===0&&i.length===0&&c.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...a].sort((u,d)=>d.from-u.from);for(let u of y){let d=u.markName==="insertion";if(t==="accept"&&!d||t==="reject"&&d)l.delete(u.from,u.to);else {let C=d?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,d)=>d.pos-u.pos);for(let u of S){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=d+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,d,u.kind):(N(l,d,u.kind),Ge(l,d));}else N(l,d,u.kind);}let x=[...o].sort((u,d)=>d.pos-u.pos);for(let u of x){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Je(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(d,void 0,{...g,pPrChange:T.length>0?T:null});}else Xe(l,d,p);}let w=[...c].sort((u,d)=>d.pos-u.pos);for(let u of w){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(d,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,d)=>d.pos-u.pos);for(let u of k){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(d+1),I=v.node(v.depth-1),P=v.before(v.depth-1);if(I?.type.name==="table"&&I.childCount>1)l.delete(d,d+f.nodeSize);else if(I?.type.name==="table")if(l.doc.resolve(P).parent.childCount===1){let J=l.doc.type.schema.nodes.paragraph;l.replaceWith(P,P+I.nodeSize,J.create());}else l.delete(P,P+I.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(d,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(d,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function qe(e){return M(e,"accept")}function Qe(e){return M(e,"reject")}function X(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(a.isInline){if(o>=t)return false;for(let i of a.marks)(i.type===n||i.type===r)&&(s={from:o,to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?X(e,e.doc.content.size):s}function Ze(e){return e.doc.attrs.watermark??null}function et(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}export{Ie as A,Pe as B,Ae as C,Ee as D,Me as E,Re as F,Ne as G,Be as H,O as I,V as J,We as K,De as L,Le as M,ze as N,He as O,je as P,_e as Q,Oe as R,G as S,qe as T,Qe as U,X as V,Ze as W,et as X,Q as a,Z as b,re as c,ne as d,oe as e,ae as f,ie as g,se as h,le as i,ce as j,de as k,ue as l,pe as m,me as n,fe as o,ge as p,be as q,he as r,ye as s,Ce as t,Te as u,Se as v,ke as w,ve as x,xe as y,we as z};
1
+ import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-SHZOAUHB.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function _(e){let{$from:t}=e.selection,n=null,r=null,s=null,a=-1,o=-1;for(let i=t.depth;i>0;i--){let c=t.node(i);if(c.type.name==="tableCell"||c.type.name==="tableHeader"){s=c;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(o===-1){if(S===t.index(i-1)){o=b;return}b+=h.attrs.colspan||1;}});}}else if(c.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(a=t.index(i-1));else if(c.type.name==="table"){n=c,r=t.before(i);break}}return !n||r==null||!s||a<0||o<0?null:{table:n,tablePos:r,cell:s,row:a,col:o,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let a=e.child(s),o=0;a.forEach(i=>{for(;t[s]?.[o];)o++;let c=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:o,rowspan:c,colspan:l});for(let b=s;b<s+c;b++){let h=t[b]??[];t[b]=h;for(let y=o;y<o+l;y++)h[y]=true;}o+=l,r=Math.max(r,o);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let a={...e.attrs},o=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),c=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return a.colspan=n,a.rowspan=r,a.colwidth=null,o>0&&(a.width=Math.round(i/o*5e3),a.widthType="pct"),c&&(a._originalFormatting=null),a}function Y(e,t,n,r){let s=t+1;for(let a=0;a<e.childCount;a++){let o=e.child(a),i=s+1,c=0;for(let l=0;l<o.childCount;l++){let b=o.child(l);if(a===n&&c===r)return i;c+=b.attrs.colspan||1,i+=b.nodeSize;}s+=o.nodeSize;}return null}function q(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function Q(e$1){let t=_(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Z(e,t,n,r,s,a){if(n<1||r<1)return false;let o=_(e);if(!o||!t)return false;let i=o;if(s!=null&&a!=null&&(s!==o.row||a!==o.col)){let{anchors:p}=H(o.table),g=p.find(T=>T.row===s&&T.col===a);if(!g)return false;i={...o,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:c$1,totalCols:l}=H(i.table),b$1=q(i.table,l),h=b(b$1,i.col,i.colspan,r),y=c$1.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(c$1,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),d=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,d),C=f.doc.nodeAt(i.tablePos);if(C){let p=Y(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function re(e,t){return m.insertTable(e,t)}function ne(e,t){return m.addRowAbove()(e,t)}function oe(e,t){return m.addRowBelow()(e,t)}function ae(e,t){return m.deleteRow()(e,t)}function ie(e,t){return m.addColumnLeft()(e,t)}function se(e,t){return m.addColumnRight()(e,t)}function le(e,t){return m.deleteColumn()(e,t)}function ce(e,t){return m.deleteTable()(e,t)}function de(e,t){return m.selectTable()(e,t)}function ue(e,t){return m.selectRow()(e,t)}function pe(e,t){return m.selectColumn()(e,t)}function me(e,t){return m.mergeCells()(e,t)}function fe(e,t){return m.splitCell()(e,t)}function ge(e,t,n){return m.setCellBorder(e,t,n)}function be(e,t){return m.setTableBorders(e,t)}function he(e,t){return m.removeTableBorders()(e,t)}function ye(e,t,n){return m.setAllTableBorders(n)(e,t)}function Ce(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function Te(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Se(e){return m.setCellVerticalAlign(e)}function ke(e){return m.setCellMargins(e)}function ve(e){return m.setCellTextDirection(e)}function xe(){return m.toggleNoWrap()}function we(e,t){return m.setRowHeight(e,t)}function Ie(){return m.toggleHeaderRow()}function Pe(){return m.distributeColumns()}function Ae(){return m.autoFitContents()}function Ee(e){return m.setTableProperties(e)}function Me(e){return m.applyTableStyle(e)}function Re(e){return m.setCellFillColor(e)}function Ne(e){return m.setTableBorderColor(e)}function Be(e){return m.setTableBorderWidth(e)}var Fe=a.getCommands();function O(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),a=i(e),o=e.schema.marks.insertion;return a&&o&&s.addMark(r,r+n.nodeSize,o.create({revisionId:a.revisionId,author:a.author,date:a.date})),t(s.scrollIntoView()),true}var V=612;function We(e,t,n){let r=n?.maxWidth??V,s=new FileReader;s.onload=()=>{let a=s.result,o=new Image;o.onload=()=>{let i=o.naturalWidth,c=o.naturalHeight;i>r&&(c=Math.round(c*(r/i)),i=r);let l=e.state.schema.nodes.image.create({src:a,alt:t.name,width:i,height:c,rId:`rId_img_${Date.now()}_${Math.round(Math.random()*1e9)}`,wrapType:"inline",displayMode:"inline"});O(e.state,e.dispatch,l,e.state.selection.from),e.focus(),n?.onInserted?.();},o.onerror=()=>n?.onError?.(new Error("Failed to decode image")),o.src=a;},s.onerror=()=>n?.onError?.(s.error),s.readAsDataURL(t);}function De(e,t,n){return Fe.setImageWrapType(e,t,n)}function Le(e){return (t,n)=>{let{from:r,to:s,empty:a}=t.selection;if(a)return false;let o=t.schema.marks.comment;if(!o)return false;if(n){let i=t.tr.addMark(r,s,o.create({commentId:e}));n(i);}return true}}function ze(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((a,o)=>{if(a.isText)for(let i of a.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(o,o+a.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function $(e,t,n){return (r,s)=>{let a=r.schema.marks.insertion,o=r.schema.marks.deletion;if(!a&&!o)return false;let i=n==="accept"?a:o,c=n==="accept"?o:a;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);c&&h.marks.some(k=>k.type===c)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function He(e,t){return $(e,t,"accept")}function je(e,t){return $(e,t,"reject")}function U(e){let t=new Set,n=[],r=o=>{typeof o=="number"&&!t.has(o)&&(t.add(o),n.push(o));},s=e.schema.marks.insertion,a=e.schema.marks.deletion;return e.doc.descendants(o=>{if(o.type.name==="paragraph"){r(o.attrs.pPrIns?.revisionId),r(o.attrs.pPrDel?.revisionId);let i=o.attrs.pPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableRow"){r(o.attrs.trIns?.revisionId),r(o.attrs.trDel?.revisionId);let i=o.attrs.trPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.type.name==="tableCell"||o.type.name==="tableHeader"){let i=o.attrs.cellMarker;r(i?.info?.revisionId);let c=o.attrs.tcPrChange;if(Array.isArray(c))for(let l of c)r(l.info.id);}if(o.type.name==="table"){let i=o.attrs.tblPrChange;if(Array.isArray(i))for(let c of i)r(c.info.id);}if(o.isInline)for(let i of o.marks)(s&&i.type===s||a&&i.type===a)&&r(i.attrs.revisionId);}),n}function _e(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"accept")(r,s);return true}}function Oe(){return (e,t)=>{let n=U(e);if(n.length===0)return false;if(!t)return true;let r=e,s=a=>{t(a),r=r.apply(a);};for(let a of n)M(a,"reject")(r,s);return true}}function G(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(s)return false;if(a.isInline&&!(o+a.nodeSize<=t)){for(let i of a.marks)if(i.type===n||i.type===r)return s={from:Math.max(o,t),to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?G(e,0):s}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrIns,o=r.attrs.pPrDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function $e(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let a=r.attrs.pPrChange;Array.isArray(a)&&a.forEach((o,i)=>{!o?.info||typeof o.info.id!="number"||o.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:o.previousFormatting,current:o.currentFormatting});});}),n}function Ue(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((a,o)=>{if(a.isInline){for(let i of a.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let c=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===c&&l.to===o?l.to=o+a.nodeSize:n.push({from:o,to:o+a.nodeSize,markName:c});}}}),n}function Ge(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,a=e.doc.nodeAt(s);!a||a.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...a.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Xe(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let a=s.slice();a.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:a.length>0?a:null});}function Je(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let a of s)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let a=r.attrs.trIns,o=r.attrs.trDel;a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ye(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let a=r.attrs.cellMarker;a?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:a.kind});}),n}function M(e,t){return (n,r)=>{let s=Ve(n,e),a=Ue(n,e),o=$e(n,e),i=Ke(n,e),c=Ye(n,e);if(s.length===0&&a.length===0&&o.length===0&&i.length===0&&c.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...a].sort((u,d)=>d.from-u.from);for(let u of y){let d=u.markName==="insertion";if(t==="accept"&&!d||t==="reject"&&d)l.delete(u.from,u.to);else {let C=d?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,d)=>d.pos-u.pos);for(let u of S){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=d+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,d,u.kind):(N(l,d,u.kind),Ge(l,d));}else N(l,d,u.kind);}let x=[...o].sort((u,d)=>d.pos-u.pos);for(let u of x){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Je(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(d,void 0,{...g,pPrChange:T.length>0?T:null});}else Xe(l,d,p);}let w=[...c].sort((u,d)=>d.pos-u.pos);for(let u of w){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(d,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,d)=>d.pos-u.pos);for(let u of k){let d=l.mapping.map(u.pos),f=l.doc.nodeAt(d);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(d+1),I=v.node(v.depth-1),P=v.before(v.depth-1);if(I?.type.name==="table"&&I.childCount>1)l.delete(d,d+f.nodeSize);else if(I?.type.name==="table")if(l.doc.resolve(P).parent.childCount===1){let J=l.doc.type.schema.nodes.paragraph;l.replaceWith(P,P+I.nodeSize,J.create());}else l.delete(P,P+I.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(d,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(d,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function qe(e){return M(e,"accept")}function Qe(e){return M(e,"reject")}function X(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((a,o)=>{if(a.isInline){if(o>=t)return false;for(let i of a.marks)(i.type===n||i.type===r)&&(s={from:o,to:o+a.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?X(e,e.doc.content.size):s}function Ze(e){return e.doc.attrs.watermark??null}function et(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}export{Ie as A,Pe as B,Ae as C,Ee as D,Me as E,Re as F,Ne as G,Be as H,O as I,V as J,We as K,De as L,Le as M,ze as N,He as O,je as P,_e as Q,Oe as R,G as S,qe as T,Qe as U,X as V,Ze as W,et as X,Q as a,Z as b,re as c,ne as d,oe as e,ae as f,ie as g,se as h,le as i,ce as j,de as k,ue as l,pe as m,me as n,fe as o,ge as p,be as q,he as r,ye as s,Ce as t,Te as u,Se as v,ke as w,ve as x,xe as y,we as z};
@@ -0,0 +1 @@
1
+ 'use strict';var o=["CONFIDENTIAL","DRAFT","DO NOT COPY","SAMPLE","URGENT","ASAP"];function r(t,n){if(!(t>0)||!(n>0))return;let e=t/n;return e>=1?{widthEmu:3954780,heightEmu:Math.round(3954780/e)}:{widthEmu:Math.round(3954780*e),heightEmu:3954780}}exports.a=o;exports.b=r;
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js');var pe={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},G={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function J(e,n){let t=chunk3R7QHNI5_js.i(n),i=t.find(r=>r.name==="a:shade");if(i){let r=chunk3R7QHNI5_js.j(i,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=t.find(r=>r.name==="a:tint");if(o){let r=chunk3R7QHNI5_js.j(o,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function K(e){if(!e)return;let n=chunk3R7QHNI5_js.i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=chunk3R7QHNI5_js.j(t,null,"val");if(l)return J({rgb:l},t)}let i=n.find(l=>l.name==="a:schemeClr");if(i){let l=chunk3R7QHNI5_js.j(i,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:chunk3R7QHNI5_js.j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=chunk3R7QHNI5_js.j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=chunk3R7QHNI5_js.i(e);if(n.find(i=>i.name==="a:noFill"))return {type:"none"};let t=n.find(i=>i.name==="a:solidFill");if(t)return {type:"solid",color:K(t)};if(n.find(i=>i.name==="a:gradFill"))return {type:"gradient"}}function S(e){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n)return;let t=chunk3R7QHNI5_js.i(n);if(t.find(u=>u.name==="a:noFill"))return;let i={},o=chunk3R7QHNI5_js.j(n,null,"w");o&&(i.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=chunk3R7QHNI5_js.j(l,null,"val");u&&(i.style=u);}return i}function L(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"relativeFrom")??"column",t=chunk3R7QHNI5_js.h(e,"wp:align");if(t){let o=chunk3R7QHNI5_js.k(t);return {relativeTo:n,alignment:o}}let i=chunk3R7QHNI5_js.h(e,"wp:posOffset");if(i){let o=chunk3R7QHNI5_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"relativeFrom")??"paragraph",t=chunk3R7QHNI5_js.h(e,"wp:align");if(t){let o=chunk3R7QHNI5_js.k(t);return {relativeTo:n,alignment:o}}let i=chunk3R7QHNI5_js.h(e,"wp:posOffset");if(i){let o=chunk3R7QHNI5_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=chunk3R7QHNI5_js.h(e,"wp:positionH"),t=chunk3R7QHNI5_js.h(e,"wp:positionV");if(!(!n&&!t))return {horizontal:L(n)??{relativeTo:"column"},vertical:z(t)??{relativeTo:"paragraph"}}}var W=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function D(e,n,t){if(!e){let p={type:n?"behind":"inFront"};return t?.distT!==void 0&&(p.distT=t.distT),t?.distB!==void 0&&(p.distB=t.distB),t?.distL!==void 0&&(p.distL=t.distL),t?.distR!==void 0&&(p.distR=t.distR),p}let o=(e.name||"").replace("wp:",""),r;switch(o){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let l={type:r},u=chunk3R7QHNI5_js.j(e,null,"wrapText");u&&(l.wrapText=u);let s=chunk3R7QHNI5_js.l(e,null,"distT")??t?.distT,c=chunk3R7QHNI5_js.l(e,null,"distB")??t?.distB,m=chunk3R7QHNI5_js.l(e,null,"distL")??t?.distL,g=chunk3R7QHNI5_js.l(e,null,"distR")??t?.distR;return s!==void 0&&(l.distT=s),c!==void 0&&(l.distB=c),m!==void 0&&(l.distL=m),g!==void 0&&(l.distR=g),l}function Y(e){let n=chunk3R7QHNI5_js.i(e),t=chunk3R7QHNI5_js.j(e,null,"behindDoc")==="1",i=n.find(r=>W.includes(r.name??"")),o={distT:chunk3R7QHNI5_js.l(e,null,"distT")??void 0,distB:chunk3R7QHNI5_js.l(e,null,"distB")??void 0,distL:chunk3R7QHNI5_js.l(e,null,"distL")??void 0,distR:chunk3R7QHNI5_js.l(e,null,"distR")??void 0};return D(i??null,t,o)}var ce={accent1:"5B9BD5",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"4472C4",accent6:"70AD47",dk1:"000000",lt1:"FFFFFF",dk2:"1F497D",lt2:"EEECE1",text1:"000000",text2:"1F497D",background1:"FFFFFF",background2:"EEECE1",hlink:"0563C1",folHlink:"954F72"};function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${ce[e.themeColor]??"000000"}`}}var k=91440;function Z(e){if(!e)return {};let n={},t=chunk3R7QHNI5_js.l(e,null,"lIns"),i=chunk3R7QHNI5_js.l(e,null,"rIns"),o=chunk3R7QHNI5_js.l(e,null,"tIns"),r=chunk3R7QHNI5_js.l(e,null,"bIns");return (t!==void 0||i!==void 0||o!==void 0||r!==void 0)&&(n.margins={left:t,right:i,top:o,bottom:r}),n}function ve(e){if(!e)return {paragraphElements:[],tableElements:[]};let n=chunk3R7QHNI5_js.g(e,"p"),t=chunk3R7QHNI5_js.g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i,o,r,l,u){if(!e)return [];let s=[],c=chunk3R7QHNI5_js.i(e);for(let m of c){let g=m.name||"",p=g.indexOf(":"),T=p>=0?g.substring(p+1):g;if(T==="p"){let b=n(m,i,o,r,l);s.push(b);}}return s}function ee(e){let t=chunk3R7QHNI5_js.i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i=chunk3R7QHNI5_js.h(t,"a:graphic");if(!i)return false;let o=chunk3R7QHNI5_js.h(i,"a:graphicData");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"wps:wsp");return r?chunk3R7QHNI5_js.h(r,"wps:txbx")!==null:false}function Ce(e){return chunk3R7QHNI5_js.h(e,"wps:txbx")!==null}function Me(e){let t=chunk3R7QHNI5_js.i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i=t.name==="wp:anchor",o=chunk3R7QHNI5_js.h(t,"a:graphic");if(!o)return null;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");if(!r)return null;let l=chunk3R7QHNI5_js.h(r,"wps:wsp");if(!l||!chunk3R7QHNI5_js.h(l,"wps:txbx"))return null;let s=chunk3R7QHNI5_js.i(l),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=chunk3R7QHNI5_js.h(t,"wp:extent"),p=chunk3R7QHNI5_js.l(g,null,"cx")??0,T=chunk3R7QHNI5_js.l(g,null,"cy")??0,b={width:p,height:T},C=chunk3R7QHNI5_js.h(t,"wp:docPr"),P=C?chunk3R7QHNI5_js.j(C,null,"id")??void 0:void 0,v=N(c??null),B=S(c??null),E=Z(m??null),y={type:"textBox",size:b,content:[]};if(P&&(y.id=P),v&&(y.fill=v),B&&(y.outline=B),E.margins&&(y.margins=E.margins),i){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=chunk3R7QHNI5_js.h(e,"wps:txbx");return n?chunk3R7QHNI5_js.h(n,"w:txbxContent"):null}function Xe(e,n,t,i){if(!chunk3R7QHNI5_js.h(e,"wps:txbx"))return null;let r=chunk3R7QHNI5_js.i(e),l=r.find(b=>b.name==="wps:spPr"),u=r.find(b=>b.name==="wps:bodyPr"),s=r.find(b=>b.name==="wps:cNvPr"),c=s?chunk3R7QHNI5_js.j(s,null,"id")??void 0:void 0,m=N(l??null),g=S(l??null),p=Z(u??null),T={type:"textBox",size:n,content:[]};return c&&(T.id=c),m&&(T.fill=m),g&&(T.outline=g),p.margins&&(T.margins=p.margins),t&&(T.position=t),i&&(T.wrap=i),T}function ke(e){return chunk4Q2IP5FW_js.e(e.size.width)}function Ae(e){return chunk4Q2IP5FW_js.e(e.size.height)}function Oe(e){return {width:chunk4Q2IP5FW_js.e(e.size.width),height:chunk4Q2IP5FW_js.e(e.size.height)}}function Ne(e){let n=e.margins;return {top:chunk4Q2IP5FW_js.e(n?.top??k),bottom:chunk4Q2IP5FW_js.e(n?.bottom??k),left:chunk4Q2IP5FW_js.e(n?.left??k),right:chunk4Q2IP5FW_js.e(n?.right??k)}}function Se(e){return e.position!==void 0||e.wrap!==void 0}function Le(e){return e.fill!==void 0&&e.fill.type!=="none"}function ze(e){return e.outline!==void 0}function We(e){return e.content.length>0}function De(e){let n=[];for(let t of e.content){let i=[];for(let o of t.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&i.push(r.text);n.push(i.join(""));}return n.join(`
2
- `)}function He(e){if(!(!e.fill||e.fill.type!=="solid"))return H(e.fill.color)}function Ve(e){if(e.outline?.color)return H(e.outline.color)}function _e(e){return e.outline?.width?chunk4Q2IP5FW_js.e(e.outline.width):0}function me(e){if(!e)return;let n=parseInt(e,10);if(!isNaN(n))return n/6e4}function ge(e,n){let t=chunk3R7QHNI5_js.i(e);for(let i of t)if(n.includes(i.name||""))return i;return null}function ne(e){if(!e)return {width:0,height:0};let n=chunk3R7QHNI5_js.l(e,null,"cx")??0,t=chunk3R7QHNI5_js.l(e,null,"cy")??0;return {width:n,height:t}}function te(e){if(!e)return;let n=chunk3R7QHNI5_js.l(e,null,"l")??0,t=chunk3R7QHNI5_js.l(e,null,"t")??0,i=chunk3R7QHNI5_js.l(e,null,"r")??0,o=chunk3R7QHNI5_js.l(e,null,"b")??0;if(!(n===0&&t===0&&i===0&&o===0))return {left:n,top:t,right:i,bottom:o}}function ie(e){if(!e)return {};let n=chunk3R7QHNI5_js.j(e,null,"id")??void 0,t=chunk3R7QHNI5_js.j(e,null,"name")??void 0,i=chunk3R7QHNI5_js.j(e,null,"descr")??void 0,o=chunk3R7QHNI5_js.j(e,null,"title")??void 0,r=chunk3R7QHNI5_js.j(e,null,"decorative")==="1",l=chunk3R7QHNI5_js.e(e,"a","hlinkClick"),u=l?chunk3R7QHNI5_js.j(l,"r","id")??void 0:void 0;return {id:n,name:t,alt:i,title:o,decorative:r||void 0,hlinkRId:u}}function re(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"rot"),t=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",i=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",o=me(n);if(o===void 0&&!t&&!i)return;let r={};return o!==void 0&&(r.rotation=o),t&&(r.flipH=true),i&&(r.flipV=true),r}function oe(e){let n=chunk3R7QHNI5_js.h(e,"a:graphic");if(!n)return {blipFill:null,blip:null};let t=chunk3R7QHNI5_js.h(n,"a:graphicData");if(!t)return {blipFill:null,blip:null};let i=chunk3R7QHNI5_js.h(t,"pic:pic");if(!i)return {blipFill:null,blip:null};let o=chunk3R7QHNI5_js.h(i,"pic:blipFill");return o?{blipFill:o,blip:chunk3R7QHNI5_js.h(o,"a:blip")}:{blipFill:null,blip:null}}function le(e){if(!e)return;let n=chunk3R7QHNI5_js.h(e,"a:srcRect");if(!n)return;let t=s=>{let c=chunk3R7QHNI5_js.l(n,null,s);if(!(c===void 0||c===0))return c/1e5},i=t("l"),o=t("t"),r=t("r"),l=t("b");if(i===void 0&&o===void 0&&r===void 0&&l===void 0)return;let u={};return i!==void 0&&(u.left=i),o!==void 0&&(u.top=o),r!==void 0&&(u.right=r),l!==void 0&&(u.bottom=l),u}function ae(e){if(!e)return;let n=chunk3R7QHNI5_js.h(e,"a:alphaModFix");if(!n)return;let t=chunk3R7QHNI5_js.l(n,null,"amt");if(!(t===void 0||t>=1e5))return Math.max(0,Math.min(1,t/1e5))}function se(e){if(!e)return "";let n=chunk3R7QHNI5_js.j(e,"r","embed");if(n)return n;let t=chunk3R7QHNI5_js.j(e,null,"embed");if(t)return t;let i=chunk3R7QHNI5_js.j(e,"r","link");return i||""}function ue(e){let n=chunk3R7QHNI5_js.h(e,"a:graphic");if(!n)return null;let t=chunk3R7QHNI5_js.h(n,"a:graphicData");if(!t)return null;let i=chunk3R7QHNI5_js.h(t,"pic:pic");if(!i)return null;let o=chunk3R7QHNI5_js.h(i,"pic:spPr");return o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null}function xe(e){if(!e)return e;let n=e.replace(/^\/+/,"");return n.startsWith("media/")?n=`word/${n}`:n.startsWith("word/")||(n=`word/${n}`),n}function he(e){let n=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[n]??"application/octet-stream"}function de(e,n,t){if(!e||!n)return {};let i=n.get(e);if(!i)return {};let o=i.target;if(!o)return {};let r=xe(o),l=o.split("/").pop(),u=(s,c)=>{let m=c.toLowerCase();for(let[g,p]of s.entries())if(g.toLowerCase()===m)return p};if(t){let s=u(t,r);if(s)return {src:s.dataUrl||s.base64,mimeType:s.mimeType,filename:l};let c=o.replace(/^\/+/,""),m=u(t,c);if(m)return {src:m.dataUrl||m.base64,mimeType:m.mimeType,filename:l};let g=`word/${c}`,p=u(t,g);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:l}}return {mimeType:he(o),filename:l}}function Te(e,n,t){let i=chunk3R7QHNI5_js.h(e,"wp:extent"),o=ne(i),r=chunk3R7QHNI5_js.h(e,"wp:effectExtent"),l=te(r),u=chunk3R7QHNI5_js.h(e,"wp:docPr"),s=ie(u),{blip:c,blipFill:m}=oe(e),g=se(c),p=le(m),T=ae(c),b=de(g,n,t),C=ue(e),P=re(C),v=chunk3R7QHNI5_js.l(e,null,"distT")??void 0,B=chunk3R7QHNI5_js.l(e,null,"distB")??void 0,E=chunk3R7QHNI5_js.l(e,null,"distL")??void 0,y=chunk3R7QHNI5_js.l(e,null,"distR")??void 0,x={type:"inline"};v!==void 0&&(x.distT=v),B!==void 0&&(x.distB=B),E!==void 0&&(x.distL=E),y!==void 0&&(x.distR=y);let h={type:"image",rId:g,size:o,wrap:x};if(s.id&&(h.id=s.id),s.alt&&(h.alt=s.alt),s.title&&(h.title=s.title),s.decorative&&(h.decorative=true),b.src&&(h.src=b.src),b.mimeType&&(h.mimeType=b.mimeType),b.filename&&(h.filename=b.filename),l&&(h.padding=l),P&&(h.transform=P),p&&(h.crop=p),T!==void 0&&(h.opacity=T),s.hlinkRId&&n){let X=chunkZ3LGMBJC_js.d(n,s.hlinkRId);X&&(h.hlinkHref=X);}return h}function be(e,n,t){let i=chunk3R7QHNI5_js.h(e,"wp:extent"),o=ne(i),r=chunk3R7QHNI5_js.h(e,"wp:effectExtent"),l=te(r),u=chunk3R7QHNI5_js.h(e,"wp:docPr"),s=ie(u),c=chunk3R7QHNI5_js.j(e,null,"behindDoc")==="1",m=chunk3R7QHNI5_js.j(e,null,"layoutInCell"),g=m===null?void 0:m==="1",p=chunk3R7QHNI5_js.j(e,null,"allowOverlap"),T=p===null?void 0:p==="1",b={distT:chunk3R7QHNI5_js.l(e,null,"distT")??void 0,distB:chunk3R7QHNI5_js.l(e,null,"distB")??void 0,distL:chunk3R7QHNI5_js.l(e,null,"distL")??void 0,distR:chunk3R7QHNI5_js.l(e,null,"distR")??void 0},C=ge(e,W),P=D(C,c,b),v=chunk3R7QHNI5_js.h(e,"wp:positionH"),B=chunk3R7QHNI5_js.h(e,"wp:positionV"),E=L(v),y=z(B),x;(E||y)&&(x={horizontal:E??{relativeTo:"column"},vertical:y??{relativeTo:"paragraph"}});let{blip:h,blipFill:X}=oe(e),V=se(h),_=le(X),U=ae(h),M=de(V,n,t),fe=ue(e),j=re(fe),I={type:"image",rId:V,size:o,wrap:P};if(s.id&&(I.id=s.id),s.alt&&(I.alt=s.alt),s.title&&(I.title=s.title),s.decorative&&(I.decorative=true),M.src&&(I.src=M.src),M.mimeType&&(I.mimeType=M.mimeType),M.filename&&(I.filename=M.filename),x&&(I.position=x),l&&(I.padding=l),j&&(I.transform=j),_&&(I.crop=_),U!==void 0&&(I.opacity=U),g!==void 0&&(I.layoutInCell=g),T!==void 0&&(I.allowOverlap=T),s.hlinkRId&&n){let q=chunkZ3LGMBJC_js.d(n,s.hlinkRId);q&&(I.hlinkHref=q);}return I}function we(e,n,t){if(ee(e))return null;let i=chunk3R7QHNI5_js.i(e);for(let o of i){let r=o.name||"";if(r==="wp:inline"||r==="wp:anchor")return r==="wp:inline"?Te(o,n,t):be(o,n,t)}return null}function Qe(e,n,t){return we(e,n,t)}function Ye(e){return e.wrap.type==="inline"}function Ze(e){return e.wrap.type!=="inline"}function en(e){return e.wrap.type==="behind"}function nn(e){return e.wrap.type==="inFront"}function tn(e){return chunk4Q2IP5FW_js.e(e.size.width)}function rn(e){return chunk4Q2IP5FW_js.e(e.size.height)}function on(e){return e.decorative===true}function ln(e){return {top:chunk4Q2IP5FW_js.e(e.wrap.distT),bottom:chunk4Q2IP5FW_js.e(e.wrap.distB),left:chunk4Q2IP5FW_js.e(e.wrap.distL),right:chunk4Q2IP5FW_js.e(e.wrap.distR)}}exports.A=Ye;exports.B=Ze;exports.C=en;exports.D=nn;exports.E=tn;exports.F=rn;exports.G=on;exports.H=ln;exports.a=K;exports.b=N;exports.c=Q;exports.d=Y;exports.e=H;exports.f=ve;exports.g=Be;exports.h=ee;exports.i=Ce;exports.j=Me;exports.k=Re;exports.l=Xe;exports.m=ke;exports.n=Ae;exports.o=Oe;exports.p=Ne;exports.q=Se;exports.r=Le;exports.s=ze;exports.t=We;exports.u=De;exports.v=He;exports.w=Ve;exports.x=_e;exports.y=we;exports.z=Qe;
1
+ 'use strict';var chunkZ3LGMBJC_js=require('./chunk-Z3LGMBJC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunk3R7QHNI5_js=require('./chunk-3R7QHNI5.js');var pe={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},G={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function J(e,n){let t=chunk3R7QHNI5_js.i(n),i=t.find(r=>r.name==="a:shade");if(i){let r=chunk3R7QHNI5_js.j(i,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let o=t.find(r=>r.name==="a:tint");if(o){let r=chunk3R7QHNI5_js.j(o,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function K(e){if(!e)return;let n=chunk3R7QHNI5_js.i(e),t=n.find(l=>l.name==="a:srgbClr");if(t){let l=chunk3R7QHNI5_js.j(t,null,"val");if(l)return J({rgb:l},t)}let i=n.find(l=>l.name==="a:schemeClr");if(i){let l=chunk3R7QHNI5_js.j(i,null,"val");if(l){let u={themeColor:pe[l]??"dk1"};return J(u,i)}}let o=n.find(l=>l.name==="a:sysClr");if(o)return {rgb:chunk3R7QHNI5_js.j(o,null,"lastClr")??"000000"};let r=n.find(l=>l.name==="a:prstClr");if(r){let l=chunk3R7QHNI5_js.j(r,null,"val");if(l&&G[l])return {rgb:G[l]}}}function N(e){if(!e)return;let n=chunk3R7QHNI5_js.i(e);if(n.find(i=>i.name==="a:noFill"))return {type:"none"};let t=n.find(i=>i.name==="a:solidFill");if(t)return {type:"solid",color:K(t)};if(n.find(i=>i.name==="a:gradFill"))return {type:"gradient"}}function S(e){let n=e?chunk3R7QHNI5_js.h(e,"a:ln"):null;if(!n)return;let t=chunk3R7QHNI5_js.i(n);if(t.find(u=>u.name==="a:noFill"))return;let i={},o=chunk3R7QHNI5_js.j(n,null,"w");o&&(i.width=parseInt(o,10));let r=t.find(u=>u.name==="a:solidFill");r&&(i.color=K(r));let l=t.find(u=>u.name==="a:prstDash");if(l){let u=chunk3R7QHNI5_js.j(l,null,"val");u&&(i.style=u);}return i}function L(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"relativeFrom")??"column",t=chunk3R7QHNI5_js.h(e,"wp:align");if(t){let o=chunk3R7QHNI5_js.k(t);return {relativeTo:n,alignment:o}}let i=chunk3R7QHNI5_js.h(e,"wp:posOffset");if(i){let o=chunk3R7QHNI5_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function z(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"relativeFrom")??"paragraph",t=chunk3R7QHNI5_js.h(e,"wp:align");if(t){let o=chunk3R7QHNI5_js.k(t);return {relativeTo:n,alignment:o}}let i=chunk3R7QHNI5_js.h(e,"wp:posOffset");if(i){let o=chunk3R7QHNI5_js.k(i),r=parseInt(o,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Q(e){let n=chunk3R7QHNI5_js.h(e,"wp:positionH"),t=chunk3R7QHNI5_js.h(e,"wp:positionV");if(!(!n&&!t))return {horizontal:L(n)??{relativeTo:"column"},vertical:z(t)??{relativeTo:"paragraph"}}}var W=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function D(e,n,t){if(!e){let p={type:n?"behind":"inFront"};return t?.distT!==void 0&&(p.distT=t.distT),t?.distB!==void 0&&(p.distB=t.distB),t?.distL!==void 0&&(p.distL=t.distL),t?.distR!==void 0&&(p.distR=t.distR),p}let o=(e.name||"").replace("wp:",""),r;switch(o){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let l={type:r},u=chunk3R7QHNI5_js.j(e,null,"wrapText");u&&(l.wrapText=u);let s=chunk3R7QHNI5_js.l(e,null,"distT")??t?.distT,c=chunk3R7QHNI5_js.l(e,null,"distB")??t?.distB,m=chunk3R7QHNI5_js.l(e,null,"distL")??t?.distL,g=chunk3R7QHNI5_js.l(e,null,"distR")??t?.distR;return s!==void 0&&(l.distT=s),c!==void 0&&(l.distB=c),m!==void 0&&(l.distL=m),g!==void 0&&(l.distR=g),l}function Y(e){let n=chunk3R7QHNI5_js.i(e),t=chunk3R7QHNI5_js.j(e,null,"behindDoc")==="1",i=n.find(r=>W.includes(r.name??"")),o={distT:chunk3R7QHNI5_js.l(e,null,"distT")??void 0,distB:chunk3R7QHNI5_js.l(e,null,"distB")??void 0,distL:chunk3R7QHNI5_js.l(e,null,"distL")??void 0,distR:chunk3R7QHNI5_js.l(e,null,"distR")??void 0};return D(i??null,t,o)}var ce={accent1:"5B9BD5",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"4472C4",accent6:"70AD47",dk1:"000000",lt1:"FFFFFF",dk2:"1F497D",lt2:"EEECE1",text1:"000000",text2:"1F497D",background1:"FFFFFF",background2:"EEECE1",hlink:"0563C1",folHlink:"954F72"};function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${ce[e.themeColor]??"000000"}`}}var k=91440;function Z(e){if(!e)return {};let n={},t=chunk3R7QHNI5_js.l(e,null,"lIns"),i=chunk3R7QHNI5_js.l(e,null,"rIns"),o=chunk3R7QHNI5_js.l(e,null,"tIns"),r=chunk3R7QHNI5_js.l(e,null,"bIns");return (t!==void 0||i!==void 0||o!==void 0||r!==void 0)&&(n.margins={left:t,right:i,top:o,bottom:r}),n}function ve(e){if(!e)return {paragraphElements:[],tableElements:[]};let n=chunk3R7QHNI5_js.g(e,"p"),t=chunk3R7QHNI5_js.g(e,"tbl");return {paragraphElements:n,tableElements:t}}function Be(e,n,t,i,o,r,l,u){if(!e)return [];let s=[],c=chunk3R7QHNI5_js.i(e);for(let m of c){let g=m.name||"",p=g.indexOf(":"),T=p>=0?g.substring(p+1):g;if(T==="p"){let b=n(m,i,o,r,l);s.push(b);}}return s}function ee(e){let t=chunk3R7QHNI5_js.i(e).find(u=>u.name==="wp:inline"||u.name==="wp:anchor");if(!t)return false;let i=chunk3R7QHNI5_js.h(t,"a:graphic");if(!i)return false;let o=chunk3R7QHNI5_js.h(i,"a:graphicData");if(!o)return false;let r=chunk3R7QHNI5_js.h(o,"wps:wsp");return r?chunk3R7QHNI5_js.h(r,"wps:txbx")!==null:false}function Ce(e){return chunk3R7QHNI5_js.h(e,"wps:txbx")!==null}function Me(e){let t=chunk3R7QHNI5_js.i(e).find(x=>x.name==="wp:inline"||x.name==="wp:anchor");if(!t)return null;let i=t.name==="wp:anchor",o=chunk3R7QHNI5_js.h(t,"a:graphic");if(!o)return null;let r=chunk3R7QHNI5_js.h(o,"a:graphicData");if(!r)return null;let l=chunk3R7QHNI5_js.h(r,"wps:wsp");if(!l||!chunk3R7QHNI5_js.h(l,"wps:txbx"))return null;let s=chunk3R7QHNI5_js.i(l),c=s.find(x=>x.name==="wps:spPr"),m=s.find(x=>x.name==="wps:bodyPr"),g=chunk3R7QHNI5_js.h(t,"wp:extent"),p=chunk3R7QHNI5_js.l(g,null,"cx")??0,T=chunk3R7QHNI5_js.l(g,null,"cy")??0,b={width:p,height:T},C=chunk3R7QHNI5_js.h(t,"wp:docPr"),P=C?chunk3R7QHNI5_js.j(C,null,"id")??void 0:void 0,v=N(c??null),B=S(c??null),E=Z(m??null),y={type:"textBox",size:b,content:[]};if(P&&(y.id=P),v&&(y.fill=v),B&&(y.outline=B),E.margins&&(y.margins=E.margins),i){let x=Q(t);x&&(y.position=x);let h=Y(t);h&&(y.wrap=h);}return y}function Re(e){let n=chunk3R7QHNI5_js.h(e,"wps:txbx");return n?chunk3R7QHNI5_js.h(n,"w:txbxContent"):null}function Xe(e,n,t,i){if(!chunk3R7QHNI5_js.h(e,"wps:txbx"))return null;let r=chunk3R7QHNI5_js.i(e),l=r.find(b=>b.name==="wps:spPr"),u=r.find(b=>b.name==="wps:bodyPr"),s=r.find(b=>b.name==="wps:cNvPr"),c=s?chunk3R7QHNI5_js.j(s,null,"id")??void 0:void 0,m=N(l??null),g=S(l??null),p=Z(u??null),T={type:"textBox",size:n,content:[]};return c&&(T.id=c),m&&(T.fill=m),g&&(T.outline=g),p.margins&&(T.margins=p.margins),t&&(T.position=t),i&&(T.wrap=i),T}function ke(e){return chunkBJSG6TEG_js.f(e.size.width)}function Ae(e){return chunkBJSG6TEG_js.f(e.size.height)}function Oe(e){return {width:chunkBJSG6TEG_js.f(e.size.width),height:chunkBJSG6TEG_js.f(e.size.height)}}function Ne(e){let n=e.margins;return {top:chunkBJSG6TEG_js.f(n?.top??k),bottom:chunkBJSG6TEG_js.f(n?.bottom??k),left:chunkBJSG6TEG_js.f(n?.left??k),right:chunkBJSG6TEG_js.f(n?.right??k)}}function Se(e){return e.position!==void 0||e.wrap!==void 0}function Le(e){return e.fill!==void 0&&e.fill.type!=="none"}function ze(e){return e.outline!==void 0}function We(e){return e.content.length>0}function De(e){let n=[];for(let t of e.content){let i=[];for(let o of t.content)if(o.type==="run")for(let r of o.content)r.type==="text"&&i.push(r.text);n.push(i.join(""));}return n.join(`
2
+ `)}function He(e){if(!(!e.fill||e.fill.type!=="solid"))return H(e.fill.color)}function Ve(e){if(e.outline?.color)return H(e.outline.color)}function _e(e){return e.outline?.width?chunkBJSG6TEG_js.f(e.outline.width):0}function me(e){if(!e)return;let n=parseInt(e,10);if(!isNaN(n))return n/6e4}function ge(e,n){let t=chunk3R7QHNI5_js.i(e);for(let i of t)if(n.includes(i.name||""))return i;return null}function ne(e){if(!e)return {width:0,height:0};let n=chunk3R7QHNI5_js.l(e,null,"cx")??0,t=chunk3R7QHNI5_js.l(e,null,"cy")??0;return {width:n,height:t}}function te(e){if(!e)return;let n=chunk3R7QHNI5_js.l(e,null,"l")??0,t=chunk3R7QHNI5_js.l(e,null,"t")??0,i=chunk3R7QHNI5_js.l(e,null,"r")??0,o=chunk3R7QHNI5_js.l(e,null,"b")??0;if(!(n===0&&t===0&&i===0&&o===0))return {left:n,top:t,right:i,bottom:o}}function ie(e){if(!e)return {};let n=chunk3R7QHNI5_js.j(e,null,"id")??void 0,t=chunk3R7QHNI5_js.j(e,null,"name")??void 0,i=chunk3R7QHNI5_js.j(e,null,"descr")??void 0,o=chunk3R7QHNI5_js.j(e,null,"title")??void 0,r=chunk3R7QHNI5_js.j(e,null,"decorative")==="1",l=chunk3R7QHNI5_js.e(e,"a","hlinkClick"),u=l?chunk3R7QHNI5_js.j(l,"r","id")??void 0:void 0;return {id:n,name:t,alt:i,title:o,decorative:r||void 0,hlinkRId:u}}function re(e){if(!e)return;let n=chunk3R7QHNI5_js.j(e,null,"rot"),t=chunk3R7QHNI5_js.j(e,null,"flipH")==="1",i=chunk3R7QHNI5_js.j(e,null,"flipV")==="1",o=me(n);if(o===void 0&&!t&&!i)return;let r={};return o!==void 0&&(r.rotation=o),t&&(r.flipH=true),i&&(r.flipV=true),r}function oe(e){let n=chunk3R7QHNI5_js.h(e,"a:graphic");if(!n)return {blipFill:null,blip:null};let t=chunk3R7QHNI5_js.h(n,"a:graphicData");if(!t)return {blipFill:null,blip:null};let i=chunk3R7QHNI5_js.h(t,"pic:pic");if(!i)return {blipFill:null,blip:null};let o=chunk3R7QHNI5_js.h(i,"pic:blipFill");return o?{blipFill:o,blip:chunk3R7QHNI5_js.h(o,"a:blip")}:{blipFill:null,blip:null}}function le(e){if(!e)return;let n=chunk3R7QHNI5_js.h(e,"a:srcRect");if(!n)return;let t=s=>{let c=chunk3R7QHNI5_js.l(n,null,s);if(!(c===void 0||c===0))return c/1e5},i=t("l"),o=t("t"),r=t("r"),l=t("b");if(i===void 0&&o===void 0&&r===void 0&&l===void 0)return;let u={};return i!==void 0&&(u.left=i),o!==void 0&&(u.top=o),r!==void 0&&(u.right=r),l!==void 0&&(u.bottom=l),u}function ae(e){if(!e)return;let n=chunk3R7QHNI5_js.h(e,"a:alphaModFix");if(!n)return;let t=chunk3R7QHNI5_js.l(n,null,"amt");if(!(t===void 0||t>=1e5))return Math.max(0,Math.min(1,t/1e5))}function se(e){if(!e)return "";let n=chunk3R7QHNI5_js.j(e,"r","embed");if(n)return n;let t=chunk3R7QHNI5_js.j(e,null,"embed");if(t)return t;let i=chunk3R7QHNI5_js.j(e,"r","link");return i||""}function ue(e){let n=chunk3R7QHNI5_js.h(e,"a:graphic");if(!n)return null;let t=chunk3R7QHNI5_js.h(n,"a:graphicData");if(!t)return null;let i=chunk3R7QHNI5_js.h(t,"pic:pic");if(!i)return null;let o=chunk3R7QHNI5_js.h(i,"pic:spPr");return o?chunk3R7QHNI5_js.h(o,"a:xfrm"):null}function xe(e){if(!e)return e;let n=e.replace(/^\/+/,"");return n.startsWith("media/")?n=`word/${n}`:n.startsWith("word/")||(n=`word/${n}`),n}function he(e){let n=e.split(".").pop()?.toLowerCase()??"";return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[n]??"application/octet-stream"}function de(e,n,t){if(!e||!n)return {};let i=n.get(e);if(!i)return {};let o=i.target;if(!o)return {};let r=xe(o),l=o.split("/").pop(),u=(s,c)=>{let m=c.toLowerCase();for(let[g,p]of s.entries())if(g.toLowerCase()===m)return p};if(t){let s=u(t,r);if(s)return {src:s.dataUrl||s.base64,mimeType:s.mimeType,filename:l};let c=o.replace(/^\/+/,""),m=u(t,c);if(m)return {src:m.dataUrl||m.base64,mimeType:m.mimeType,filename:l};let g=`word/${c}`,p=u(t,g);if(p)return {src:p.dataUrl||p.base64,mimeType:p.mimeType,filename:l}}return {mimeType:he(o),filename:l}}function Te(e,n,t){let i=chunk3R7QHNI5_js.h(e,"wp:extent"),o=ne(i),r=chunk3R7QHNI5_js.h(e,"wp:effectExtent"),l=te(r),u=chunk3R7QHNI5_js.h(e,"wp:docPr"),s=ie(u),{blip:c,blipFill:m}=oe(e),g=se(c),p=le(m),T=ae(c),b=de(g,n,t),C=ue(e),P=re(C),v=chunk3R7QHNI5_js.l(e,null,"distT")??void 0,B=chunk3R7QHNI5_js.l(e,null,"distB")??void 0,E=chunk3R7QHNI5_js.l(e,null,"distL")??void 0,y=chunk3R7QHNI5_js.l(e,null,"distR")??void 0,x={type:"inline"};v!==void 0&&(x.distT=v),B!==void 0&&(x.distB=B),E!==void 0&&(x.distL=E),y!==void 0&&(x.distR=y);let h={type:"image",rId:g,size:o,wrap:x};if(s.id&&(h.id=s.id),s.alt&&(h.alt=s.alt),s.title&&(h.title=s.title),s.decorative&&(h.decorative=true),b.src&&(h.src=b.src),b.mimeType&&(h.mimeType=b.mimeType),b.filename&&(h.filename=b.filename),l&&(h.padding=l),P&&(h.transform=P),p&&(h.crop=p),T!==void 0&&(h.opacity=T),s.hlinkRId&&n){let X=chunkZ3LGMBJC_js.d(n,s.hlinkRId);X&&(h.hlinkHref=X);}return h}function be(e,n,t){let i=chunk3R7QHNI5_js.h(e,"wp:extent"),o=ne(i),r=chunk3R7QHNI5_js.h(e,"wp:effectExtent"),l=te(r),u=chunk3R7QHNI5_js.h(e,"wp:docPr"),s=ie(u),c=chunk3R7QHNI5_js.j(e,null,"behindDoc")==="1",m=chunk3R7QHNI5_js.j(e,null,"layoutInCell"),g=m===null?void 0:m==="1",p=chunk3R7QHNI5_js.j(e,null,"allowOverlap"),T=p===null?void 0:p==="1",b={distT:chunk3R7QHNI5_js.l(e,null,"distT")??void 0,distB:chunk3R7QHNI5_js.l(e,null,"distB")??void 0,distL:chunk3R7QHNI5_js.l(e,null,"distL")??void 0,distR:chunk3R7QHNI5_js.l(e,null,"distR")??void 0},C=ge(e,W),P=D(C,c,b),v=chunk3R7QHNI5_js.h(e,"wp:positionH"),B=chunk3R7QHNI5_js.h(e,"wp:positionV"),E=L(v),y=z(B),x;(E||y)&&(x={horizontal:E??{relativeTo:"column"},vertical:y??{relativeTo:"paragraph"}});let{blip:h,blipFill:X}=oe(e),V=se(h),_=le(X),U=ae(h),M=de(V,n,t),fe=ue(e),j=re(fe),I={type:"image",rId:V,size:o,wrap:P};if(s.id&&(I.id=s.id),s.alt&&(I.alt=s.alt),s.title&&(I.title=s.title),s.decorative&&(I.decorative=true),M.src&&(I.src=M.src),M.mimeType&&(I.mimeType=M.mimeType),M.filename&&(I.filename=M.filename),x&&(I.position=x),l&&(I.padding=l),j&&(I.transform=j),_&&(I.crop=_),U!==void 0&&(I.opacity=U),g!==void 0&&(I.layoutInCell=g),T!==void 0&&(I.allowOverlap=T),s.hlinkRId&&n){let q=chunkZ3LGMBJC_js.d(n,s.hlinkRId);q&&(I.hlinkHref=q);}return I}function we(e,n,t){if(ee(e))return null;let i=chunk3R7QHNI5_js.i(e);for(let o of i){let r=o.name||"";if(r==="wp:inline"||r==="wp:anchor")return r==="wp:inline"?Te(o,n,t):be(o,n,t)}return null}function Qe(e,n,t){return we(e,n,t)}function Ye(e){return e.wrap.type==="inline"}function Ze(e){return e.wrap.type!=="inline"}function en(e){return e.wrap.type==="behind"}function nn(e){return e.wrap.type==="inFront"}function tn(e){return chunkBJSG6TEG_js.f(e.size.width)}function rn(e){return chunkBJSG6TEG_js.f(e.size.height)}function on(e){return e.decorative===true}function ln(e){return {top:chunkBJSG6TEG_js.f(e.wrap.distT),bottom:chunkBJSG6TEG_js.f(e.wrap.distB),left:chunkBJSG6TEG_js.f(e.wrap.distL),right:chunkBJSG6TEG_js.f(e.wrap.distR)}}exports.A=Qe;exports.B=Ye;exports.C=Ze;exports.D=en;exports.E=nn;exports.F=tn;exports.G=rn;exports.H=on;exports.I=ln;exports.a=K;exports.b=N;exports.c=Q;exports.d=Y;exports.e=H;exports.f=ve;exports.g=Be;exports.h=ee;exports.i=Ce;exports.j=Me;exports.k=Re;exports.l=Xe;exports.m=ke;exports.n=Ae;exports.o=Oe;exports.p=Ne;exports.q=Se;exports.r=Le;exports.s=ze;exports.t=We;exports.u=De;exports.v=He;exports.w=Ve;exports.x=_e;exports.y=de;exports.z=we;
@@ -0,0 +1 @@
1
+ 'use strict';var y=".layout-page-content";function M(e){return Array.from(e.querySelectorAll(`${y} span[data-pm-start][data-pm-end]`))}function S(e){return Array.from(e.querySelectorAll(`${y} .layout-empty-run`))}function P(e){return Array.from(e.querySelectorAll(`${y} [data-pm-start]`))}function _(e,t){return Number.isFinite(t)?e.querySelector(`${y} [data-pm-start="${t}"]`):null}function F(e,t,a,o=1){let i=document.elementsFromPoint(t,a),c=i.find(r=>r.classList.contains("layout-page"));if(!c)return null;let p=i.find(r=>r.tagName==="SPAN"&&r.dataset.pmStart!==void 0&&r.dataset.pmEnd!==void 0);if(p)return L(p,t);let n=i.find(r=>r.classList.contains("layout-empty-run"));if(n){let r=n.closest(".layout-paragraph");if(r&&r.dataset.pmStart)return Number(r.dataset.pmStart)}let m=i.find(r=>r.classList.contains("layout-paragraph")&&r.dataset.pmStart!==void 0);if(m&&m.dataset.pmStart){let r=H(m,t,a);return r!==null?r:Number(m.dataset.pmStart)}let s=i.find(r=>r.classList.contains("layout-table-cell"));return s?H(s,t,a):B(e,c,t,a)}function L(e,t,a){let o=Number(e.dataset.pmStart),i=Number(e.dataset.pmEnd);if(e.classList.contains("layout-run-tab")){let l=e.getBoundingClientRect(),d=(l.left+l.right)/2;return t<d?o:i}let c=e.firstChild;if(!c||c.nodeType!==Node.TEXT_NODE)return o;let p=c,n=p.length;if(n===0)return o;let m=e.ownerDocument;if(!m)return o;let s=0,r=n;for(;s<r;){let l=Math.floor((s+r)/2),d=m.createRange();d.setStart(p,l),d.setEnd(p,l);let f=d.getBoundingClientRect().left;t<f?r=l:s=l+1;}if(s>0&&s<=n){let l=m.createRange();l.setStart(p,s-1),l.setEnd(p,s-1);let d=l.getBoundingClientRect();l.setStart(p,Math.min(s,n)),l.setEnd(p,Math.min(s,n));let u=l.getBoundingClientRect(),f=Math.abs(t-d.left),g=Math.abs(t-u.left);if(f<g)return o+(s-1)}return o+Math.min(s,i-o)}function H(e,t,a){let o=e.querySelector(".layout-empty-run");if(o){let l=o.closest(".layout-paragraph");if(l&&l.dataset.pmStart)return Number(l.dataset.pmStart)}let i=e.querySelectorAll(".layout-line"),c=null,p=1/0;for(let l of Array.from(i)){let d=l,u=d.getBoundingClientRect(),f=(u.top+u.bottom)/2,g=Math.abs(a-f);g<p&&(p=g,c=d);}if(!c){let l=e.querySelector(".layout-paragraph[data-pm-start]");return l?.dataset.pmStart?Number(l.dataset.pmStart):e.dataset.pmStart?Number(e.dataset.pmStart):null}let n=c.querySelectorAll("span[data-pm-start][data-pm-end]");if(n.length===0){let l=c.closest(".layout-paragraph");return l?.dataset.pmStart?Number(l.dataset.pmStart):null}let m=null,s=1/0;for(let l of Array.from(n)){let d=l,u=d.getBoundingClientRect();if(t>=u.left&&t<=u.right)return L(d,t);let f=t<u.left?u.left-t:t-u.right;f<s&&(s=f,m=d);}if(!m)return null;let r=m.getBoundingClientRect();return t<r.left?Number(m.dataset.pmStart):Number(m.dataset.pmEnd)}function B(e,t,a,o,i){if(t.querySelectorAll("span[data-pm-start][data-pm-end]").length===0){let u=t.querySelectorAll(".layout-paragraph");if(u.length>0){let f=u[0];return Number(f.dataset.pmStart)||0}return null}let p=t.querySelectorAll(".layout-line"),n=null,m=1/0;for(let u of Array.from(p)){let f=u,g=f.getBoundingClientRect(),b=(g.top+g.bottom)/2,h=Math.abs(o-b);h<m&&(m=h,n=f);}if(!n)return null;let s=n.querySelectorAll("span[data-pm-start][data-pm-end]");if(s.length===0){let u=n.closest(".layout-paragraph");return u?.dataset.pmStart?Number(u.dataset.pmStart):null}let r=null,l=1/0;for(let u of Array.from(s)){let f=u,g=f.getBoundingClientRect();if(a>=g.left&&a<=g.right)return L(f,a);let b=a<g.left?g.left-a:a-g.right;b<l&&(l=b,r=f);}if(!r)return null;let d=r.getBoundingClientRect();return a<d.left?Number(r.dataset.pmStart):Number(r.dataset.pmEnd)}var A=.5;function D(e,t){let a=e.closest(".layout-table:not(.layout-nested-table)");if(!a)return {left:t.left,top:t.top,right:t.right,bottom:t.bottom};let o=a.getBoundingClientRect(),i=Math.max(t.top,o.top),c=Math.min(t.bottom,o.bottom);return c-i<=A?null:{left:t.left,top:i,right:t.right,bottom:c}}var I=4;function N(e,t){let o=(e.closest(".layout-line")??e).getBoundingClientRect(),i=e.getBoundingClientRect().left,c=D(e,{left:i,top:o.top,right:i+I,bottom:o.bottom});if(!c)return null;let p=e.closest(".layout-page");return {x:c.left-t.left,y:c.top-t.top,width:c.right-c.left,height:c.bottom-c.top,pageIndex:p?Number(p.dataset.pageNumber||1)-1:0}}function O(e){let t=e.closest(".layout-paragraph");if(!t)return null;let a=Number(t.dataset.pmStart),o=Number(t.dataset.pmEnd);return !Number.isFinite(a)||!Number.isFinite(o)?null:{pmStart:a,pmEnd:o}}function $(e,t,a,o){let i=[],c=M(e);for(let p of Array.from(c)){let n=p,m=Number(n.dataset.pmStart),s=Number(n.dataset.pmEnd);if(s<=t||m>=a)continue;let r=n.closest(".layout-page"),l=r?Number(r.dataset.pageNumber||1)-1:0,d=T=>{let E=D(n,T);E&&i.push({x:E.left-o.left,y:E.top-o.top,width:E.right-E.left,height:E.bottom-E.top,pageIndex:l});};if(m===s){let T=N(n,o);T&&i.push(T);continue}if(n.classList.contains("layout-run-tab")){d(n.getBoundingClientRect());continue}let u=null;if(n.firstChild?.nodeType===Node.TEXT_NODE?u=n.firstChild:n.firstChild?.nodeType===Node.ELEMENT_NODE&&n.firstChild.tagName==="A"&&n.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(u=n.firstChild.firstChild),!u)continue;let f=n.ownerDocument;if(!f)continue;let g=Math.max(0,t-m),b=Math.min(u.length,a-m);if(g>=b)continue;let h=f.createRange();h.setStart(u,g),h.setEnd(u,b);for(let T of Array.from(h.getClientRects()))d(T);}for(let p of S(e)){let n=O(p);if(!n||n.pmEnd<=t||n.pmStart>=a)continue;let m=N(p,o);m&&i.push(m);}return i}function C(e,t){let a=e.closest(".layout-table:not(.layout-nested-table)");if(!a)return false;let o=a.getBoundingClientRect(),i=(t.top+t.bottom)/2;return i<o.top-.5||i>o.bottom+.5}function R(e,t,a,o){let i=e.closest(".layout-page"),c=i?Number(i.dataset.pageNumber||1)-1:0,p=e.closest(".layout-line"),n=p?p.offsetHeight:16,m=e.firstChild;if(e.classList.contains("layout-run-tab")||!m||m.nodeType!==Node.TEXT_NODE){let g=e.getBoundingClientRect();return {x:g.left-o.left,y:g.top-o.top,height:n,pageIndex:c}}let r=m,l=Math.min(t-a,r.length),u=e.ownerDocument.createRange();u.setStart(r,l),u.setEnd(r,l);let f=u.getBoundingClientRect();return {x:f.left-o.left,y:f.top-o.top,height:f.height||n,pageIndex:c}}function W(e,t,a){let o=M(e),i=null,c=0;for(let m of Array.from(o)){let s=m,r=Number(s.dataset.pmStart),l=Number(s.dataset.pmEnd);if(!(s.classList.contains("layout-run-tab")?t>=r&&t<l:t>=r&&t<=l))continue;let f=s.getBoundingClientRect();if(C(s,f)){i||(i=s,c=r);continue}return R(s,t,r,a)}if(i)return R(i,t,c,a);let p=e.querySelectorAll(".layout-paragraph"),n=null;for(let m of Array.from(p)){let s=m,r=Number(s.dataset.pmStart),l=Number(s.dataset.pmEnd);if(t>=r&&t<=l){let u=s.querySelector(".layout-empty-run")||s,f=u.getBoundingClientRect();if(C(s,f)){n||(n={el:s,targetEl:u});continue}return x(s,u,a)}}return n?x(n.el,n.targetEl,a):null}function x(e,t,a){let o=t.getBoundingClientRect(),i=e.closest(".layout-page"),c=i?Number(i.dataset.pageNumber||1)-1:0,n=(t.closest(".layout-line")||t).offsetHeight||16;return {x:o.left-a.left,y:o.top-a.top,height:n,pageIndex:c}}exports.a=M;exports.b=S;exports.c=P;exports.d=_;exports.e=F;exports.f=D;exports.g=$;exports.h=W;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkIMKU4O3P_js=require('./chunk-IMKU4O3P.js'),chunkDROCYKAR_js=require('./chunk-DROCYKAR.js'),chunkDFDL337G_js=require('./chunk-DFDL337G.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkH57LNDBH_js=require('./chunk-H57LNDBH.js');function B(e,s){let r={};for(let t of e)switch(t.type.name){case "bold":r.bold=true;break;case "italic":r.italic=true;break;case "underline":{let n=t.attrs;if(n.style||n.color){let i=n.color?chunkMJ5FQX7Q_js.a(n.color,s):void 0;r.underline={style:n.style,color:i};}else r.underline=true;break}case "strike":r.strike=true;break;case "textColor":{let n=t.attrs;(n.themeColor||n.rgb)&&(r.color=chunkMJ5FQX7Q_js.a({rgb:n.rgb,themeColor:n.themeColor,themeTint:n.themeTint,themeShade:n.themeShade},s));break}case "highlight":r.highlight=chunkMJ5FQX7Q_js.o(t.attrs.color);break;case "fontSize":{let n=t.attrs;r.fontSize=n.size/2;break}case "fontFamily":{let n=t.attrs;r.fontFamily=n.ascii||n.hAnsi;break}case "characterSpacing":{let n=t.attrs;n.spacing!=null&&n.spacing!==0&&(r.letterSpacing=chunkIMKU4O3P_js.a(n.spacing)),n.position!=null&&n.position!==0&&(r.positionPx=chunkBJSG6TEG_js.k(n.position)),n.scale!=null&&n.scale!==100&&(r.horizontalScale=n.scale),n.kerning!=null&&n.kerning>0&&(r.kerningMinPt=chunkBJSG6TEG_js.l(n.kerning));break}case "allCaps":r.allCaps=true;break;case "smallCaps":r.smallCaps=true;break;case "emboss":r.emboss=true;break;case "imprint":r.imprint=true;break;case "textShadow":r.textShadow=true;break;case "textOutline":r.textOutline=true;break;case "hidden":r.hidden=true;break;case "rtl":r.rtl=true;break;case "textEffect":{let n=t.attrs.effect;(n==="blinkBackground"||n==="lights"||n==="antsBlack"||n==="antsRed"||n==="shimmer"||n==="sparkle")&&(r.textEffect=n);break}case "emphasisMark":{let n=t.attrs.type;n==="dot"||n==="comma"||n==="circle"||n==="underDot"?r.emphasisMark=n:r.emphasisMark="dot";break}case "superscript":r.superscript=true;break;case "subscript":r.subscript=true;break;case "hyperlink":{let n=t.attrs;r.hyperlink={href:n.href,tooltip:n.tooltip};break}case "footnoteRef":{let n=t.attrs,i=typeof n.id=="string"?parseInt(n.id,10):n.id;n.noteType==="endnote"?r.endnoteRefId=i:r.footnoteRefId=i,r.superscript=true;break}case "comment":{let n=t.attrs.commentId;n&&(r.commentIds||(r.commentIds=[]),r.commentIds.push(n));break}case "insertion":r.isInsertion=true,r.changeAuthor=t.attrs.author,r.changeDate=t.attrs.date,r.changeRevisionId=t.attrs.revisionId;break;case "deletion":r.isDeletion=true,r.changeAuthor=t.attrs.author,r.changeDate=t.attrs.date,r.changeRevisionId=t.attrs.revisionId;break}return r}function G(e){let s=e.defaultTextFormatting;if(!s)return {};let r={};if(s.fontFamily){let t=s.fontFamily.ascii||s.fontFamily.hAnsi;t&&(r.fontFamily=t);}return s.fontSize!=null&&(r.fontSize=s.fontSize/2),r}function D(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function $(e){return e==="contentLocked"||e==="sdtContentLocked"}function Y(e,s){let r=e.attrs;if(r.sdtType==="checkbox"&&!($(r.lock)||r.dataBinding!=null))return {kind:"checkbox",groupId:`sdt@${s}`,pos:s,tag:r.tag!=null?String(r.tag):void 0,alias:r.alias!=null?String(r.alias):void 0,checked:typeof r.checked=="boolean"?r.checked:void 0}}function N(e,s,r){let t=[],n=s+1,i=r.theme,l=G(e.attrs),b=e.attrs.styleId,d=typeof b=="string"&&/^TOC\d*$/i.test(b);function f(u,m,p){if(u.isText&&u.text){let a=B(u.marks,i);d&&D(a);let o={kind:"text",text:u.text,...l,...a,pmStart:m,pmEnd:m+u.nodeSize,inlineSdtWidget:p};t.push(o);}else if(u.type.name==="hardBreak")t.push({kind:"lineBreak",pmStart:m,pmEnd:m+u.nodeSize});else if(u.type.name==="tab"){let a=B(u.marks,i),o={kind:"tab",...l,...a,pmStart:m,pmEnd:m+u.nodeSize};t.push(o);}else if(u.type.name==="image"){let a=u.attrs,o=chunkIMKU4O3P_js.b(a.width||100,a.height||100,r.pageContentHeight),c=B(u.marks,i),h={kind:"image",src:a.src,width:o.width,height:o.height,alt:a.alt,transform:a.transform,wrapType:a.wrapType,displayMode:a.displayMode,cssFloat:a.cssFloat,distTop:a.distTop,distBottom:a.distBottom,distLeft:a.distLeft,distRight:a.distRight,position:a.position,cropTop:a.cropTop,cropRight:a.cropRight,cropBottom:a.cropBottom,cropLeft:a.cropLeft,opacity:a.opacity,isInsertion:c.isInsertion,isDeletion:c.isDeletion,changeAuthor:c.changeAuthor,changeDate:c.changeDate,changeRevisionId:c.changeRevisionId,pmStart:m,pmEnd:m+u.nodeSize};t.push(h);}else if(u.type.name==="field"){let a=u.attrs.fieldType,o=a==="PAGE"?"PAGE":a==="NUMPAGES"?"NUMPAGES":a==="DATE"?"DATE":a==="TIME"?"TIME":"OTHER",c=B(u.marks,i);d&&D(c),t.push({kind:"field",fieldType:o,fallback:u.attrs.displayText||"",...l,...c,pmStart:m,pmEnd:m+u.nodeSize});}else if(u.type.name==="math"){let a=u.attrs.plainText||"[equation]";t.push({kind:"text",text:a,italic:true,fontFamily:"Cambria Math",pmStart:m,pmEnd:m+u.nodeSize});}else if(u.type.name==="sdt"){let a=Y(u,m)??p,o=m+1;u.forEach((c,h)=>{f(c,o+h,a);});}}return e.forEach((u,m)=>{f(u,n+m);}),t}function j(e){return Math.max(1,Math.round(e/8*1.333))}var Z={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",wave:"solid",doubleWave:"double",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function w(e,s){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let r={style:Z[e.style]||"solid",width:j(e.size??0),color:e.color?chunkMJ5FQX7Q_js.a(e.color,s):"#000000"};return e.space!==void 0&&(r.space=chunkBJSG6TEG_js.j(e.space)),r}function O(e,s){let r=e.borders;if(!r)return;let t={},n=["top","bottom","left","right"];for(let i of n){let l=r[i],b=l?w(l,s):void 0;t[i]=b??{width:0,style:"none"};}return Object.keys(t).length>0?t:void 0}function V(e,s){let r=[];for(let t=0;t<=s;t+=1){let n=e[t]??0;if(n<=0)break;r.push(n);}return r.length===0?"1.":`${r.join(".")}.`}var q=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function W(e,s){if(e<=0)return "";let r=e,t="";for(let[n,i]of q)for(;r>=n;)t+=i,r-=n;return s?t:t.toLowerCase()}function H(e,s){if(e<=0)return "";let r=e,t="";for(;r>0;){let n=(r-1)%26;t=String.fromCharCode(65+n)+t,r=Math.floor((r-1)/26);}return s?t:t.toLowerCase()}function K(e,s){if(e<=0)return "";switch(s){case "upperRoman":return W(e,true);case "lowerRoman":return W(e,false);case "upperLetter":return H(e,true);case "lowerLetter":return H(e,false);case "decimalZero":return chunkH57LNDBH_js.f(e,2);case "decimalZero3":return chunkH57LNDBH_js.f(e,3);case "decimalZero4":return chunkH57LNDBH_js.f(e,4);case "decimalZero5":return chunkH57LNDBH_js.f(e,5);case "none":return "";default:return String(e)}}function X(e,s,r){return e.replace(/%(\d)([.):\]])?/g,(t,n,i="")=>{let l=parseInt(n,10)-1;if(l<0)return "";let b=s[l]??0,d=r?.[l]??"decimal",f=K(b,d);return f?f+i:""})}function _(e,s,r){let t=e.numPr;if(!t)return null;let n=t.numId;if(n==null||n===0)return null;if(e.listIsBullet)return chunkDFDL337G_js.p(e.listMarker||"");let i=t.ilvl??0;if((e.listLevelNumFmts?.[i]??e.listNumFmt)==="none")return e.listMarker?e.listMarker:null;let b=e.listAbstractNumId??n,d=s.get(b)??new Array(9).fill(0),f=`${n}:${i}`;r.has(f)||(r.add(f),e.listStartOverride!=null&&(d[i]=e.listStartOverride-1)),d[i]=(d[i]??0)+1;for(let u=i+1;u<d.length;u+=1)d[u]=0;return s.set(b,d),e.listMarker&&e.listMarker.includes("%")?X(e.listMarker,d,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:V(d,i)}var J="Calibri",Q=11;function A(e,s,r,t,n){let i={};if(e.alignment){let o=e.alignment;o==="both"||o==="distribute"?i.alignment="justify":o==="left"?i.alignment="left":o==="center"?i.alignment="center":o==="right"&&(i.alignment="right");}let l=e._originalFormatting?.beforeAutospacing,b=e._originalFormatting?.afterAutospacing;(l||b||e.spaceBefore!=null||e.spaceAfter!=null||e.lineSpacing!=null)&&(i.spacing={},l?i.spacing.before=14:e.spaceBefore!=null&&(i.spacing.before=chunkIMKU4O3P_js.a(e.spaceBefore)),b?i.spacing.after=14:e.spaceAfter!=null&&(i.spacing.after=chunkIMKU4O3P_js.a(e.spaceAfter)),e.lineSpacing!=null&&(e.lineSpacingRule==="exact"||e.lineSpacingRule==="atLeast"?(i.spacing.line=chunkIMKU4O3P_js.a(e.lineSpacing),i.spacing.lineUnit="px",i.spacing.lineRule=e.lineSpacingRule):(i.spacing.line=e.lineSpacing/240,i.spacing.lineUnit="multiplier",i.spacing.lineRule="auto"))),e.spacingExplicit&&(i.spacingExplicit=e.spacingExplicit);let d=e.indentLeft,f=e.indentFirstLine,u=e.hangingIndent;if(e.numPr?.numId&&d==null&&(d=((e.numPr.ilvl??0)+1)*720,f==null&&(f=-360,u=true)),(d!=null||e.indentRight!=null||f!=null)&&(i.indent={},d!=null&&(i.indent.left=chunkIMKU4O3P_js.a(d)),e.indentRight!=null&&(i.indent.right=chunkIMKU4O3P_js.a(e.indentRight)),f!=null&&(u?i.indent.hanging=Math.abs(chunkIMKU4O3P_js.a(f)):i.indent.firstLine=chunkIMKU4O3P_js.a(f))),e.styleId&&(i.styleId=e.styleId),e.borders){let o=e.borders;i.borders={};let c=h=>h?w(h,s):void 0;o.top&&(i.borders.top=c(o.top)),o.bottom&&(i.borders.bottom=c(o.bottom)),o.left&&(i.borders.left=c(o.left)),o.right&&(i.borders.right=c(o.right)),o.between&&(i.borders.between=c(o.between)),o.bar&&(i.borders.bar=c(o.bar)),!i.borders.top&&!i.borders.bottom&&!i.borders.left&&!i.borders.right&&!i.borders.between&&!i.borders.bar&&delete i.borders;}let m=chunkMJ5FQX7Q_js.b(e.shading?.fill,s);m&&(i.shading=`#${m}`),e.tabs&&e.tabs.length>0&&(i.tabs=e.tabs.map(o=>({val:ee(o.alignment),pos:o.position,leader:o.leader}))),e.pageBreakBefore&&(i.pageBreakBefore=true),e.keepNext&&(i.keepNext=true),e.keepLines&&(i.keepLines=true),e.contextualSpacing&&(i.contextualSpacing=true),e.bidi&&(i.bidi=true),e.styleId&&(i.styleId=e.styleId),e.numPr&&(i.numPr={numId:e.numPr.numId,ilvl:e.numPr.ilvl});let p=r&&t?_(e,r,t):null;p!=null?i.listMarker=p:e.listMarker&&(i.listMarker=e.listMarker),e.listIsBullet!=null&&(i.listIsBullet=e.listIsBullet),e.listMarkerHidden&&(i.listMarkerHidden=true),e.listMarkerFontFamily&&(i.listMarkerFontFamily=e.listMarkerFontFamily),e.listMarkerFontSize&&(i.listMarkerFontSize=e.listMarkerFontSize),e.listMarkerSuffix&&(i.listMarkerSuffix=e.listMarkerSuffix),n!==void 0&&(i.defaultTabStopTwips=n);let a=e.defaultTextFormatting;if(a&&(a.fontSize!=null&&(i.defaultFontSize=a.fontSize/2),a.fontFamily&&(i.defaultFontFamily=a.fontFamily.ascii||a.fontFamily.hAnsi)),e.pPrIns&&(i.pPrIns=e.pPrIns),e.pPrDel&&(i.pPrDel=e.pPrDel),e.numPr){let o=e.pPrChange,c=Array.isArray(o)&&o.some(h=>!h?.previousFormatting?.numPr);e.pPrDel?i.listMarkerRevision="del":(e.pPrIns||c)&&(i.listMarkerRevision="ins");}return i}function ee(e){switch(e){case "left":return "start";case "right":return "end";case "center":return "center";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "start";default:return "start"}}function M(e,s,r){let t=e.attrs,n=N(e,s,r),i=A(t,r.theme,r.listCounters,r.listSeenNumIds,r.defaultTabStopTwips);return {kind:"paragraph",id:chunkIMKU4O3P_js.c(),runs:n,attrs:i,pmStart:s,pmEnd:s+e.nodeSize}}function te(e,s,r,t){let n=[],i=s+1;e.forEach(o=>{o.type.name==="paragraph"?n.push(M(o,i,r)):o.type.name==="table"&&n.push(U(o,i,r)),i+=o.nodeSize;});let l=e.attrs,b=l.width,d=l.widthType,f=b&&(!d||d==="dxa"||d==="auto")?chunkIMKU4O3P_js.a(b):void 0,u=l.margins,m=(o,c)=>{if(o!=null){let h=chunkIMKU4O3P_js.a(o);if(h>0)return h}if(c!=null){let h=chunkIMKU4O3P_js.a(c);if(h>=0)return h}return 0},p={top:m(u?.top,t?.top),right:m(u?.right,t?.right),bottom:m(u?.bottom,t?.bottom),left:m(u?.left,t?.left)},a=l.cellMarker;return {id:chunkIMKU4O3P_js.c(),blocks:n,colSpan:l.colspan,rowSpan:l.rowspan,width:f,widthValue:b,widthType:d,verticalAlign:l.verticalAlign,background:l.backgroundColor?`#${l.backgroundColor}`:void 0,borders:O(l,r.theme),padding:p,noWrap:l.noWrap||void 0,trackedMarker:a??void 0}}function ne(e,s,r,t){let n=[],i=s+1;e.forEach(d=>{(d.type.name==="tableCell"||d.type.name==="tableHeader")&&n.push(te(d,i,r,t)),i+=d.nodeSize;});let l=e.attrs,b=l._originalFormatting;return {id:chunkIMKU4O3P_js.c(),cells:n,height:l.height?chunkIMKU4O3P_js.a(l.height):void 0,heightRule:l.heightRule??void 0,isHeader:l.isHeader,cantSplit:b?.cantSplit||void 0,trackedIns:l.trIns??void 0,trackedDel:l.trDel??void 0}}function U(e,s,r){let t=[],n=s+1,i=e.attrs.cellMargins;e.forEach(c=>{c.type.name==="tableRow"&&t.push(ne(c,n,r,i)),n+=c.nodeSize;});let b=e.attrs.columnWidths?.map(chunkIMKU4O3P_js.a),d=e.attrs.width,f=e.attrs.widthType;if(!b&&t.length>0){let h=t[0].cells.map(k=>k.width);h.every(k=>k!==void 0&&k>0)&&(b=h);}let u=e.attrs.justification,m=e.attrs._originalFormatting,p=m?.indent?.value&&m.indent.type==="dxa"?chunkIMKU4O3P_js.a(m.indent.value):void 0,a=e.attrs.floating,o=a?{horzAnchor:a.horzAnchor,vertAnchor:a.vertAnchor,tblpX:a.tblpX!==void 0?chunkIMKU4O3P_js.a(a.tblpX):void 0,tblpXSpec:a.tblpXSpec,tblpY:a.tblpY!==void 0?chunkIMKU4O3P_js.a(a.tblpY):void 0,tblpYSpec:a.tblpYSpec,topFromText:a.topFromText!==void 0?chunkIMKU4O3P_js.a(a.topFromText):void 0,bottomFromText:a.bottomFromText!==void 0?chunkIMKU4O3P_js.a(a.bottomFromText):void 0,leftFromText:a.leftFromText!==void 0?chunkIMKU4O3P_js.a(a.leftFromText):void 0,rightFromText:a.rightFromText!==void 0?chunkIMKU4O3P_js.a(a.rightFromText):void 0}:void 0;return {kind:"table",id:chunkIMKU4O3P_js.c(),rows:t,columnWidths:b,width:d,widthType:f,justification:u,indent:p,floating:o,pmStart:s,pmEnd:s+e.nodeSize}}function re(e,s,r){let t=e.attrs,n=t.wrapType,i=n==="behind"||n==="inFront",l=chunkIMKU4O3P_js.b(t.width||100,t.height||100,r);return {kind:"image",id:chunkIMKU4O3P_js.c(),src:t.src,width:l.width,height:l.height,alt:t.alt,transform:t.transform,anchor:i?{isAnchored:true,offsetH:t.distLeft,offsetV:t.distTop,behindDoc:n==="behind"}:void 0,hlinkHref:t.hlinkHref,pmStart:s,pmEnd:s+e.nodeSize}}function ie(e,s,r){let t=e.attrs,n=[];return e.forEach((i,l)=>{if(i.type.name==="paragraph"){let b=M(i,s+1+l,r);n.push(b);}}),{kind:"textBox",id:chunkIMKU4O3P_js.c(),width:t.width??chunkDROCYKAR_js.b,height:t.height??void 0,fillColor:t.fillColor,outlineWidth:t.outlineWidth,outlineColor:t.outlineColor,outlineStyle:t.outlineStyle,margins:{top:t.marginTop??chunkDROCYKAR_js.a.top,bottom:t.marginBottom??chunkDROCYKAR_js.a.bottom,left:t.marginLeft??chunkDROCYKAR_js.a.left,right:t.marginRight??chunkDROCYKAR_js.a.right},content:n,displayMode:t.displayMode,cssFloat:t.cssFloat,wrapType:t.wrapType,wrapText:t.wrapText,anchorTarget:t.anchorTarget,position:t.position,distTop:t.distTop,distBottom:t.distBottom,distLeft:t.distLeft,distRight:t.distRight,pmStart:s,pmEnd:s+e.nodeSize}}function xe(e,s={}){let r=e.attrs?.defaultTabStopTwips,t={...s,defaultFont:s.defaultFont??J,defaultSize:s.defaultSize??Q,defaultTabStopTwips:s.defaultTabStopTwips??r},n=[],i=0,l={top:1440,bottom:1440,left:1440,right:1440};t.listCounters||(t.listCounters=new Map),t.listSeenNumIds||(t.listSeenNumIds=new Set);let b=(d,f,u)=>{if(d.type.name==="blockSdt"){let p=d.attrs,a={id:`sdt@${f}`,sdtType:typeof p.sdtType=="string"?p.sdtType:"richText",tag:p.tag!=null?String(p.tag):void 0,alias:p.alias!=null?String(p.alias):void 0,lock:p.lock!=null?String(p.lock):void 0,checked:typeof p.checked=="boolean"?p.checked:void 0,bound:p.dataBinding!=null?true:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(p.rawPropertiesXml??""))?true:void 0},o=[...u,a];d.forEach((c,h)=>{b(c,f+1+h,o);});return}let m=n.length;switch(d.type.name){case "paragraph":{let p=M(d,f,t),a=d.attrs;n.push(p);let o=a._sectionProperties;if(o||a.sectionBreakType){let c={kind:"sectionBreak",id:chunkIMKU4O3P_js.c(),type:o?.sectionStart??a.sectionBreakType};if(o){if((o.pageWidth!==void 0||o.pageHeight!==void 0)&&(c.pageSize={w:chunkIMKU4O3P_js.a(o.pageWidth??12240),h:chunkIMKU4O3P_js.a(o.pageHeight??15840)}),o.marginTop!==void 0||o.marginBottom!==void 0||o.marginLeft!==void 0||o.marginRight!==void 0){let k={top:o.marginTop??l.top,bottom:o.marginBottom??l.bottom,left:o.marginLeft??l.left,right:o.marginRight??l.right};c.margins={top:chunkIMKU4O3P_js.a(k.top),bottom:chunkIMKU4O3P_js.a(k.bottom),left:chunkIMKU4O3P_js.a(k.left),right:chunkIMKU4O3P_js.a(k.right)},l=k;}let h=o.columnCount??1;if(h>1){let k={count:h,gap:chunkIMKU4O3P_js.a(o.columnSpace??720),equalWidth:o.equalWidth??true,separator:o.separator};c.columns=k;}}n.push(c);}}break;case "table":n.push(U(d,f,t));break;case "image":n.push(re(d,f,t.pageContentHeight));break;case "textBox":n.push(ie(d,f,t));break;case "horizontalRule":case "pageBreak":{let p={kind:"pageBreak",id:chunkIMKU4O3P_js.c(),pmStart:f,pmEnd:f+d.nodeSize};n.push(p);break}}if(u.length>0)for(let p=m;p<n.length;p++)n[p].sdtGroups=u;};return e.forEach((d,f)=>{b(d,i+f,[]);}),n}exports.a=w;exports.b=X;exports.c=xe;
@@ -0,0 +1 @@
1
+ import {d,f,g,c,b as b$3}from'./chunk-O5L4BZCZ.mjs';import {b as b$5}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-GYWTUUXX.mjs';import {b as b$1}from'./chunk-SHZOAUHB.mjs';import {b}from'./chunk-2XP6GLA4.mjs';import {b as b$4,n}from'./chunk-67LVRQIR.mjs';import {f as f$1}from'./chunk-KNY7SXPJ.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';function ve(e){if(!e||e.pattern&&e.pattern!=="clear")return;let n$1=e.fill?.rgb;if(!(!n$1||e.fill?.auto))return n(n$1)}function j(e){if(!e)return [];let n=[];e.bold&&n.push(b$1.mark("bold")),e.italic&&n.push(b$1.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(b$1.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(b$1.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(b$1.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade}));let o=e.highlight&&e.highlight!=="none"?e.highlight:ve(e.shading);return o&&n.push(b$1.mark("highlight",{color:o})),e.fontSize&&n.push(b$1.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(b$1.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(b$1.mark("superscript")):e.vertAlign==="subscript"&&n.push(b$1.mark("subscript")),e.allCaps&&n.push(b$1.mark("allCaps")),e.smallCaps&&n.push(b$1.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(b$1.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(b$1.mark("emboss")),e.imprint&&n.push(b$1.mark("imprint")),e.shadow&&n.push(b$1.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(b$1.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(b$1.mark("textOutline")),e.hidden&&n.push(b$1.mark("hidden")),e.rtl&&n.push(b$1.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(b$1.mark("textEffect",{effect:e.effect})),e.styleId&&n.push(b$1.mark("runStyle",{styleId:e.styleId})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?b$2(o,e):e}function te(e,n){let o="",l,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(o+=u.text);!l&&s.formatting&&(l=s.formatting);}}let r=b$2(n,l),i=j(r);return b$1.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,i)}function ne(e){return b$1.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function U(e,n,o){let l=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,r=b$2(b$2(n,t),e.formatting),i=j(r);for(let s of e.content){let u=he(s,i);l.push(...u);}return l}function he(e,n){switch(e.type){case "text":return e.text?[b$1.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[b$1.node("hardBreak",null,void 0,n)]:[];case "tab":return [b$1.node("tab",null,void 0,n)];case "drawing":return e.image?[Me(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[Ne(t)]}case "footnoteRef":let o=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [b$1.text(e.id.toString(),[...n,o])];case "endnoteRef":let l=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [b$1.text(e.id.toString(),[...n,l])];default:return []}}function Me(e){let n=e.size?.width?f$1(e.size.width):void 0,o=e.size?.height?f$1(e.size.height):void 0,l=e.wrap.type,t=e.wrap.wrapText,r=e.position?.horizontal?.alignment,i;l==="inline"||l==="topAndBottom"?i="none":l==="square"||l==="tight"||l==="through"?t==="left"?i="right":t==="right"||r==="left"?i="left":r==="right"?i="right":i="none":i="none";let s="inline";l==="inline"?s="inline":l==="topAndBottom"?s="block":b$5(l)||i&&i!=="none"?s="float":s="block";let u;if(e.transform){let P=[];e.transform.rotation&&P.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&P.push("scaleX(-1)"),e.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(u=P.join(" "));}let m=e.wrap.distT!=null?f$1(e.wrap.distT):void 0,c=e.wrap.distB!=null?f$1(e.wrap.distB):void 0,f=e.wrap.distL!=null?f$1(e.wrap.distL):void 0,a=e.wrap.distR!=null?f$1(e.wrap.distR):void 0,p;e.position&&(p={horizontal:e.position.horizontal?{relativeTo:e.position.horizontal.relativeTo,posOffset:e.position.horizontal.posOffset,align:e.position.horizontal.alignment}:void 0,vertical:e.position.vertical?{relativeTo:e.position.vertical.relativeTo,posOffset:e.position.vertical.posOffset,align:e.position.vertical.alignment}:void 0});let S,k,v;if(e.outline&&e.outline.width){S=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(k=`#${e.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};v=e.outline.style&&P[e.outline.style]||"solid";}let D=e.padding?.top?f$1(e.padding.top):void 0,N=e.padding?.bottom?f$1(e.padding.bottom):void 0,B=e.padding?.left?f$1(e.padding.left):void 0,g=e.padding?.right?f$1(e.padding.right):void 0;return b$1.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:o,rId:e.rId,wrapType:l,displayMode:s,cssFloat:i,transform:u,distTop:m,distBottom:c,distLeft:f,distRight:a,position:p,borderWidth:S,borderColor:k,borderStyle:v,wrapText:t,hlinkHref:e.hlinkHref,cropTop:e.crop?.top,cropRight:e.crop?.right,cropBottom:e.crop?.bottom,cropLeft:e.crop?.left,opacity:e.opacity,effectExtentTop:D,effectExtentBottom:N,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function Y(e,n,o){let l=[],t=e.href||(e.anchor?`#${e.anchor}`:""),r=b$1.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let i of e.children)if(i.type==="run"){let s=i.formatting?.styleId?o?.getRunStyleOwnProperties(i.formatting.styleId):void 0,u=b$2(b$2(n,s),i.formatting),c=[...j(u),r];for(let f of i.content)l.push(...he(f,c));}return l}function Ne(e){let n=e.size?.width?f$1(e.size.width):100,o=e.size?.height?f$1(e.size.height):80,l,t="solid",r,i,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(l=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let a=e.fill.gradient;r=a.type,i=a.angle,s=JSON.stringify(a.stops.map(p=>({position:p.position,color:p.color.rgb?`#${p.color.rgb}`:"#000000"})));}let u,m,c;e.outline&&(e.outline.width&&(u=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(m=`#${e.outline.color.rgb}`),c=e.outline.style||"solid");let f;if(e.transform){let a=[];e.transform.rotation&&a.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&a.push("scaleX(-1)"),e.transform.flipV&&a.push("scaleY(-1)"),a.length>0&&(f=a.join(" "));}return b$1.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:o,fillColor:l,fillType:t,gradientType:r,gradientAngle:i,gradientStops:s,outlineWidth:u,outlineColor:m,outlineStyle:c,transform:f})}function $(e,n,o,l){let t=Be(e,n),r=[],i,s=[],u=new Set,m;n&&(m=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let c=b$2(m,l);for(let f of e.content){if(f.type==="commentRangeStart")u.add(f.id);else if(f.type==="commentRangeEnd")u.delete(f.id);else if(f.type==="run"){let a=U(f,c,n),p=Ie(f,a);p&&s?s.push(p):s=void 0,u.size>0&&(a=O(a,u)),r.push(...a);}else if(f.type==="hyperlink"){let a=Y(f,c,n);r.push(...a),s=void 0;}else if(f.type==="simpleField"||f.type==="complexField"){let a=te(f,c);a&&r.push(a),s=void 0;}else if(f.type==="inlineSdt"){let a=be(f,c,n);a&&r.push(a),s=void 0;}else if(f.type==="insertion"){let a=J(f,"insertion",c,n);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="deletion"){let a=J(f,"deletion",c,n);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="moveFrom"){let a=J(f,"deletion",c,n,true);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="moveTo"){let a=J(f,"insertion",c,n,true);u.size>0&&(a=O(a,u)),r.push(...a),s=void 0;}else if(f.type==="mathEquation"){let a=ne(f);a&&r.push(a),s=void 0;}else f.type!=="bookmarkStart"&&f.type!=="bookmarkEnd"&&(s=void 0);f.type==="bookmarkStart"&&(i||(i=[]),i.push({id:f.id,name:f.name}));}return i&&(t.bookmarks=i),s&&s.length>0&&(t._originalRunBoundaries=s),b$1.node("paragraph",t,r)}function Ie(e,n){let o="",l;for(let t of n){if(!t.isText)return null;o+=t.text??"";let r=c(t.marks,b$3);if(l!=null&&l!==r)return null;l=r;}return {text:o,...l!=null?{marksKey:l}:{},...e.formatting?{formatting:e.formatting}:{},...e.propertyChanges?{propertyChanges:e.propertyChanges}:{}}}function O(e,n){if(n.size===0)return e;let o=[...n][0],l=b$1.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(l.addToSet(t.marks)):t)}function J(e,n,o,l,t=false){let r=[];for(let s of e.content)s.type==="run"?r.push(...U(s,o,l)):s.type==="hyperlink"&&r.push(...Y(s,o,l));let i=b$1.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return r.map(s=>s.isText||s.type.allowsMarkType(i.type)?s.mark(i.addToSet(s.marks)):s)}function Be(e,n){let o=e.formatting,l=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:l,numPr:o?.numPr,numPrFromStyle:o?.numPrFromStyle,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let r=n.resolveParagraphStyle(l),i=r.paragraphFormatting,s=r.runFormatting;t.alignment=o?.alignment??i?.alignment,t.spaceBefore=o?.spaceBefore??i?.spaceBefore,t.spaceAfter=o?.spaceAfter??i?.spaceAfter,t.lineSpacing=o?.lineSpacing??i?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??i?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??i?.indentLeft,t.indentRight=o?.indentRight??i?.indentRight;let m=o?.numPr?.numId===0&&i?.numPr&&i.numPr.numId!==0?void 0:i;t.indentFirstLine=o?.indentFirstLine??m?.indentFirstLine,t.hangingIndent=o?.hangingIndent??m?.hangingIndent,t.borders=o?.borders??i?.borders,t.shading=o?.shading??i?.shading,t.tabs=o?.tabs??i?.tabs,t.pageBreakBefore=o?.pageBreakBefore??i?.pageBreakBefore,t.keepNext=o?.keepNext??i?.keepNext,t.keepLines=o?.keepLines??i?.keepLines,t.contextualSpacing=o?.contextualSpacing??i?.contextualSpacing,t.outlineLevel=o?.outlineLevel??i?.outlineLevel,t.bidi=o?.bidi??i?.bidi;let c=n.getDefaultCharacterStyle()?.rPr,f=c?b$2(s,c):s,a=E(o?.runProperties,n);t.defaultTextFormatting=b$2(f,a),!o?.numPr&&i?.numPr&&i.numPr.numId!==0&&(t.numPr=i.numPr,t.numPrFromStyle=i.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let r=e.sectionProperties.sectionStart;(r==="nextPage"||r==="continuous"||r==="oddPage"||r==="evenPage")&&(t.sectionBreakType=r);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),ze(e)&&(t.pageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function be(e,n,o){let l=e.properties,t=[];for(let r of e.content)if(r.type==="run"){let i=U(r,n,o);t.push(...i);}else if(r.type==="hyperlink"){let i=Y(r,n,o);t.push(...i);}else if(r.type==="simpleField"||r.type==="complexField"){let i=te(r,n);i&&t.push(i);}else if(r.type==="inlineSdt"){let i=be(r,n,o);i&&t.push(i);}else if(r.type==="mathEquation"){let i=ne(r);i&&t.push(i);}return b$1.node("sdt",d(l),t.length>0?t:void 0)}function De(e){return e.type==="text"?e.text.length>0:true}function Te(e,n){for(let o of e)o.type==="break"&&o.breakType==="page"?n.push("pageBreak"):De(o)&&n.push("visible");}function V(e,n){for(let o of e)o.type==="run"?Te(o.content,n):V(o.children.filter(l=>l.type==="run"),n);}function ye(e,n){for(let o of e)switch(o.type){case "run":Te(o.content,n);break;case "hyperlink":V(o.children.filter(l=>l.type==="run"),n);break;case "simpleField":V(o.content,n);break;case "complexField":V([...o.fieldCode,...o.fieldResult],n);break;case "inlineSdt":ye(o.content,n);break;case "insertion":case "deletion":case "moveFrom":case "moveTo":V(o.content,n);break;case "mathEquation":n.push("visible");break}}function Pe(e){let n=[];return ye(e.content,n),n}function ze(e){return Pe(e)[0]==="pageBreak"}function Ce(e){let n=false,o=false;for(let l of Pe(e))if(l==="pageBreak"){if(o||n)return true;n=true;}else o=true;return false}function R(e,n,o){if(!e||!n)return;let l=e.getStyle(n);if(!l?.tblStylePr)return;let t=l.tblStylePr.find(u=>u.type===o);if(!t)return;let r=E(t.pPr?.runProperties,e),i=E(t.rPr,e),s=b$2(r,i);return {tcPr:t.tcPr,rPr:s}}function I(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},l=e.tcPr,t=n.tcPr;if(l||t){let r={...l??{},...t??{}};(l?.borders||t?.borders)&&(r.borders={...l?.borders??{},...t?.borders??{}}),(l?.shading||t?.shading)&&(r.shading={...l?.shading??{},...t?.shading??{}}),(l?.margins||t?.margins)&&(r.margins={...l?.margins??{},...t?.margins??{}}),o.tcPr=r;}return o.rPr=b$2(e.rPr,n.rPr),o}function Ae(e){let n=new Map,o=e.rows.length,l=new Map;for(let t=0;t<o;t++){let r=e.rows[t],i=0,s=r.cells.map(m=>{let c=m.formatting?.gridSpan??1,f=i;return i+=c,{colIndex:f,vMerge:m.formatting?.vMerge,key:`${t}-${f}`}});if(s.length>0&&s.every(({colIndex:m,vMerge:c})=>c==="continue"&&l.has(m))){for(let{colIndex:m,key:c}of s)l.delete(m),n.set(c,{rowSpan:1,skip:false});continue}for(let{colIndex:m,vMerge:c,key:f}of s){let a=m;if(c==="restart")l.set(a,t),n.set(f,{rowSpan:1,skip:false});else if(c==="continue"){let p=l.get(a);if(p!==void 0){let S=`${p}-${a}`,k=n.get(S);k&&k.rowSpan++,n.set(f,{rowSpan:1,skip:true});}else n.set(f,{rowSpan:1,skip:false});}else l.delete(a),n.set(f,{rowSpan:1,skip:false});}}return n}function oe(e,n,o){let l=Ae(e),t=e.columnWidths,r=t?.reduce((P,x)=>P+x,0)??0,i=e.formatting?.styleId,s=e.formatting?.look,u=i?n?.getStyle(i):void 0,m=n?.getDefaultTableStyle(),c=e.formatting?.borders??u?.tblPr?.borders??m?.tblPr?.borders,f=e.formatting?.cellMargins??u?.tblPr?.cellMargins??m?.tblPr?.cellMargins??void 0,a=f?{top:f.top?.value,bottom:f.bottom?.value,left:f.left?.value,right:f.right?.value}:void 0,p={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,tableLayout:e.formatting?.layout??null,floating:e.formatting?.floating,cellMargins:a,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(p.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,i,"wholeTable"),firstRow:R(n,i,"firstRow"),lastRow:R(n,i,"lastRow"),firstCol:R(n,i,"firstCol"),lastCol:R(n,i,"lastCol"),band1Horz:R(n,i,"band1Horz"),band2Horz:R(n,i,"band2Horz"),band1Vert:R(n,i,"band1Vert"),band2Vert:R(n,i,"band2Vert"),nwCell:R(n,i,"nwCell"),neCell:R(n,i,"neCell"),swCell:R(n,i,"swCell"),seCell:R(n,i,"seCell")},k=s?.noHBand!==true,v=s?.noVBand!==true,D=0,N=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,F)=>x+(F.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let F=x===0&&!!s?.firstRow,M=x===N-1&&!!s?.lastRow,h=k&&!F&&!M?D%2===0?S.band1Horz:S.band2Horz:void 0;return k&&!F&&!M&&D++,He(P,n,F,t,r,S,h,v,s,c,x,N,B,l,a,o)});return b$1.node("table",p,g)}function He(e,n,o,l,t,r,i,s,u,m,c,f,a,p,S,k){let v={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,z={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?v.trIns=z:C.type==="tableRowDeletion"&&(v.trDel=z);}e.propertyChanges&&e.propertyChanges.length>0&&(v.trPrChange=e.propertyChanges);let D=e.cells.length,N=c===0,B=c===(f??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??N,x=g?.lastRow??B,F=a??D,M=0,h=[];for(let C=0;C<e.cells.length;C++){let z=e.cells[C],H=z.formatting?.gridSpan??1,Fe=`${c??0}-${M}`,ie=p?.get(Fe),Se=ie?.skip??false,Re=ie?.rowSpan??1,le;if(l&&t&&t>0){let K=0;for(let A=0;A<H&&M+A<l.length;A++)K+=l[M+A];le=Math.round(K/t*100);}if(M+=H,Se)continue;let se=M-H===0,ae=M===F,T=z.formatting?.conditionalFormat,G=T?.firstRow??P,Q=T?.lastRow??x,W=T?.firstColumn??se,_=T?.lastColumn??ae,q;if(s){let K=u?.firstColumn?1:0,A=M-H-K;A>=0&&!(u?.lastColumn&&_)&&!(u?.firstColumn&&W)&&(q=A%2===0?r?.band1Vert:r?.band2Vert);}T?.oddVBand?q=r?.band1Vert:T?.evenVBand&&(q=r?.band2Vert);let L=i;g?.oddHBand?L=r?.band1Horz:g?.evenHBand&&(L=r?.band2Horz),T?.oddHBand?L=r?.band1Horz:T?.evenHBand&&(L=r?.band2Horz);let b=r?.wholeTable;b=I(b,L),b=I(b,q),G&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(b=I(b,r?.firstRow)),Q&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(b=I(b,r?.lastRow)),W&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.firstCol)),_&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.lastCol)),G&&W&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.nwCell)),G&&_&&(u?.firstRow||g?.firstRow||T?.firstRow)&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.neCell)),Q&&W&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(u?.firstColumn||g?.firstColumn||T?.firstColumn)&&(b=I(b,r?.swCell)),Q&&_&&(u?.lastRow||g?.lastRow||T?.lastRow)&&(u?.lastColumn||g?.lastColumn||T?.lastColumn)&&(b=I(b,r?.seCell)),h.push(ke(z,n,o,le,b,m,N,B,se,ae,Re,S,k));}if(h.length===0){let C=Math.max(F,1),z={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=I(r?.wholeTable,i);h.push(ke(z,n,o,t&&t>0?100:void 0,H,m,N,B,true,true,1,S,k));}return b$1.node("tableRow",v,h)}var Ee=["top","bottom","left","right","insideH","insideV"];function Le(e,n){if(!e)return e;let o;for(let l of Ee){let t=e[l];if(!t?.color?.themeColor||t.color.auto)continue;let r=b$4(t.color,n);r&&(o??(o={...e}),o[l]={...t,color:{rgb:r}});}return o??e}function ke(e,n,o,l,t,r,i,s,u,m,c,f,a){let p=e.formatting,S=c??1,k=p?.width?.value,v=p?.width?.type;k===void 0&&l!==void 0&&(k=l,v="pct");let D=b$4(p?.shading?.fill??t?.tcPr?.shading?.fill,a),N=r?{top:i?r.top:r.insideH,bottom:s?r.bottom:r.insideH,left:u?r.left:r.insideV,right:m?r.right:r.insideV}:void 0,B=t?.tcPr?.borders,g=p?.borders,P=Le(N||B||g?{...N??{},...B??{},...g??{}}:void 0,a),x={colspan:p?.gridSpan??1,rowspan:S,width:k,widthType:v,verticalAlign:p?.verticalAlign,backgroundColor:D,textDirection:p?.textDirection,noWrap:p?.noWrap,borders:P,margins:p?.margins?{top:p.margins.top?.value,bottom:p.margins.bottom?.value,left:p.margins.left?.value,right:p.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:f,_originalFormatting:p||void 0,_originalResolvedFill:D};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let F=[];for(let h of e.content)h.type==="paragraph"?F.push($(h,n,void 0,t?.rPr)):h.type==="table"&&F.push(oe(h,n));F.length===0&&F.push(b$1.node("paragraph",{},[]));let M=o?"tableHeader":"tableCell";return b$1.node(M,x,F)}function we(e,n){let o=Ve(e),l=$(e,n),t=[],r=o.length>0&&l.content.size===0,{anchored:i,inFlow:s}=Oe(o);for(let u of i)t.push(xe(u,n));r||t.push(l);for(let u of s)t.push(xe(u,n));return t}function Oe(e){let n=[],o=[];for(let l of e)f(l)?n.push(l):o.push(l);return {anchored:n,inFlow:o}}function Ve(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let l of o.content)if(l.type==="shape"&&"shape"in l){let t=l.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function xe(e,n){let o=e.size?.width?f$1(e.size.width):200,l=e.size?.height?f$1(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let r,i,s;e.outline&&e.outline.width&&(r=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(i=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let u=e.margins?.top!=null?f$1(e.margins.top):4,m=e.margins?.bottom!=null?f$1(e.margins.bottom):4,c=e.margins?.left!=null?f$1(e.margins.left):7,f=e.margins?.right!=null?f$1(e.margins.right):7,a=[];for(let p of e.content)a.push($(p,n));return a.length===0&&a.push(b$1.node("paragraph",{},[])),b$1.node("textBox",{width:o,height:l,textBoxId:e.id,fillColor:t,outlineWidth:r,outlineColor:i,outlineStyle:s,marginTop:u,marginBottom:m,marginLeft:c,marginRight:f,...g(e)},a)}function re(e,n,o,l){let t=[];for(let r of e)if(r.type==="paragraph")t.push(...we(r,n)),l&&Ce(r)&&t.push(b$1.node("pageBreak"));else if(r.type==="table")t.push(oe(r,n,o));else if(r.type==="blockSdt"){let i=re(r.content,n,o,l),s=i.length>0?i:[b$1.node("paragraph",{},[])];t.push(b$1.node("blockSdt",d(r.properties),s));}return t}function wt(e,n){let o=e.package.theme??null,l=n?.styles?b(n.styles):null,t=re(e.package.document.content,l,o,true);return t.length===0&&t.push(b$1.node("paragraph",{},[])),t[t.length-1]?.type.name==="blockSdt"&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null,watermark:a(e)??null},t)}function $e(e,n){let o=n?.styles?b(n.styles):null,l=n?.theme??null,t=re(e,o,l,false);return t.length===0&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},t)}function Ft(e,n){return $e(e,n)}function St(){return b$1.node("doc",null,[b$1.node("paragraph",{},[])])}export{wt as a,$e as b,Ft as c,St as d};
@@ -1 +1 @@
1
- import {a}from'./chunk-SNTAAXXA.mjs';var e=a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
1
+ import {a}from'./chunk-SHZOAUHB.mjs';var e=a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();export{j as A,q as B,w as C,z as D,g as a,l as b,u as c,x as d,C as e,f,S as g,L as h,b as i,y as j,v as k,A as l,I as m,h as n,R as o,T as p,P as q,B as r,k as s,E as t,F as u,H as v,J as w,N as x,O as y,M as z};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-QPFJJPIC.mjs';import {f as f$1,g as g$1}from'./chunk-KNY7SXPJ.mjs';function g(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function m(e){let t={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(t.id=e.id),e.alias!=null&&(t.alias=String(e.alias)),e.tag!=null&&(t.tag=String(e.tag)),e.lock!=null&&(t.lock=e.lock),e.placeholder!=null&&(t.placeholder=String(e.placeholder)),e.showingPlaceholder&&(t.showingPlaceholder=true),e.dateFormat!=null&&(t.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{t.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(t.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{t.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(t.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(t.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),t}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function x(e){let t=e.wrap?.type??"inline",i=e.wrap?.wrapText,n=e.position?.horizontal?.alignment;return {displayMode:s(t),cssFloat:p(t,i,n),wrapType:t,wrapText:i,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?f$1(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?f$1(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?f$1(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?f$1(e.wrap.distR):void 0}}function y(e){return e.anchorTarget==="followingBlock"||d(e)}function P(e){let t=e.position;if(!(!t?.horizontal&&!t?.vertical))return {horizontal:{relativeTo:t.horizontal?.relativeTo??"margin",alignment:t.horizontal?.align,posOffset:t.horizontal?.posOffset},vertical:{relativeTo:t.vertical?.relativeTo??"paragraph",alignment:t.vertical?.align,posOffset:t.vertical?.posOffset}}}function B(e){let t=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!t||t==="inline")return;let i={type:t};return e.wrapText&&(i.wrapText=e.wrapText),e.distTop!=null&&(i.distT=g$1(e.distTop)),e.distBottom!=null&&(i.distB=g$1(e.distBottom)),e.distLeft!=null&&(i.distL=g$1(e.distLeft)),e.distRight!=null&&(i.distR=g$1(e.distRight)),i}function s(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function d(e){return e.displayMode==="float"||a$1(e.wrapType)}function p(e,t,i){return e==="inline"||e==="topAndBottom"?"none":t==="left"?"right":t==="right"||i==="left"?"left":i==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}var c=new Set(["hyperlink"]),S=new Set(["hyperlink","comment"]);function I(e,t=c){let i=e.filter(n=>!t.has(n.type.name));return i.length===0?"":i.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}export{c as a,S as b,I as c,g as d,m as e,a as f,x as g,y as h,P as i,B as j};
@@ -0,0 +1 @@
1
+ import {h,e,i,j,c,b as b$1,a as a$1}from'./chunk-O5L4BZCZ.mjs';import {a,b}from'./chunk-GYWTUUXX.mjs';import {g}from'./chunk-KNY7SXPJ.mjs';function K(t){return t.attrs.href||""}function z(t){return c(t,a$1)}function T(t){let e={};for(let n of t)switch(n.type.name){case "bold":e.bold=true,e.boldCs=true;break;case "italic":e.italic=true,e.italicCs=true;break;case "underline":{let i=n.attrs;e.underline={style:i.style||"single",color:i.color};break}case "strike":n.attrs.double?e.doubleStrike=true:e.strike=true;break;case "textColor":{let i=n.attrs;e.color={rgb:i.rgb,themeColor:i.themeColor,themeTint:i.themeTint,themeShade:i.themeShade};break}case "highlight":e.highlight=n.attrs.color;break;case "fontSize":e.fontSize=n.attrs.size,e.fontSizeCs=n.attrs.size;break;case "fontFamily":{let i=n.attrs;e.fontFamily={ascii:i.ascii,hAnsi:i.hAnsi,eastAsia:i.eastAsia||void 0,cs:i.cs||i.ascii||void 0,asciiTheme:i.asciiTheme,hAnsiTheme:i.hAnsiTheme||void 0,eastAsiaTheme:i.eastAsiaTheme||void 0,csTheme:i.csTheme||void 0};break}case "superscript":e.vertAlign="superscript";break;case "subscript":e.vertAlign="subscript";break;case "allCaps":e.allCaps=true;break;case "smallCaps":e.smallCaps=true;break;case "characterSpacing":{n.attrs.spacing!=null&&(e.spacing=n.attrs.spacing),n.attrs.position!=null&&(e.position=n.attrs.position),n.attrs.scale!=null&&(e.scale=n.attrs.scale),n.attrs.kerning!=null&&(e.kerning=n.attrs.kerning);break}case "emboss":e.emboss=true;break;case "imprint":e.imprint=true;break;case "textShadow":e.shadow=true;break;case "emphasisMark":e.emphasisMark=n.attrs.type||"dot";break;case "textOutline":e.outline=true;break;case "hidden":e.hidden=true;break;case "rtl":e.rtl=true;break;case "textEffect":e.effect=n.attrs.effect||"blinkBackground";break;case "runStyle":n.attrs.styleId&&(e.styleId=n.attrs.styleId);break}return e}function V(t){let e=t.attrs.href;return e?.startsWith("#")?{type:"hyperlink",anchor:e.substring(1),tooltip:t.attrs.tooltip||void 0,children:[]}:{type:"hyperlink",href:e,tooltip:t.attrs.tooltip||void 0,rId:t.attrs.rId||void 0,children:[]}}function M(t,e){let n=e.marks.filter(i=>i.type.name!=="hyperlink");e.isText&&e.text?t.children.push(w(e.text,n)):e.type.name==="tab"?t.children.push(S()):e.type.name==="hardBreak"&&t.children.push(v());}function w(t,e){let n=T(e),i={type:"text",text:t};return {type:"run",formatting:Object.keys(n).length>0?n:void 0,content:[i]}}function U(t,e){let n=t.content[t.content.length-1];n&&n.type==="text"?n.text+=e:t.content.push({type:"text",text:e});}function v(){return {type:"run",content:[{type:"break",breakType:"textWrapping"}]}}function S(){return {type:"run",content:[{type:"tab"}]}}function $(t,e){let n=t.attrs,i=e&&e.length>0?T(e):void 0,r=n.displayText||"";if(!r)switch(n.fieldType){case "PAGE":r="1";break;case "NUMPAGES":r="1";break;default:r=" ";break}let o={type:"run",content:[{type:"text",text:r}],...i&&Object.keys(i).length>0?{formatting:i}:{}};return n.fieldKind==="complex"?{type:"complexField",instruction:n.instruction,fieldType:n.fieldType,fieldCode:[],fieldResult:[o],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}:{type:"simpleField",instruction:n.instruction,fieldType:n.fieldType,content:[o],fldLock:n.fldLock||void 0,dirty:n.dirty||void 0}}function J(t){let e=t.attrs;return {type:"mathEquation",display:e.display||"inline",ommlXml:e.ommlXml,plainText:e.plainText||void 0}}function I(t){let e=t.attrs,i={type:e.wrapType||"inline"};e.distTop!==void 0&&(i.distT=g(e.distTop)),e.distBottom!==void 0&&(i.distB=g(e.distBottom)),e.distLeft!==void 0&&(i.distL=g(e.distLeft)),e.distRight!==void 0&&(i.distR=g(e.distRight)),e.wrapText&&(i.wrapText=e.wrapText);let r={type:"image",rId:e.rId||"",src:e.src,alt:e.alt||void 0,title:e.title||void 0,size:{width:g(e.width||0),height:g(e.height||0)},wrap:i};if(e.transform){let a=e.transform,l={},d=a.match(/rotate\(([-\d.]+)deg\)/);d&&(l.rotation=parseFloat(d[1])),a.includes("scaleX(-1)")&&(l.flipH=true),a.includes("scaleY(-1)")&&(l.flipV=true),(l.rotation||l.flipH||l.flipV)&&(r.transform=l);}if(e.position?.horizontal&&e.position?.vertical){let a=e.position;r.position={horizontal:{relativeTo:a.horizontal.relativeTo||"column",alignment:a.horizontal.align,posOffset:a.horizontal.posOffset},vertical:{relativeTo:a.vertical.relativeTo||"paragraph",alignment:a.vertical.align,posOffset:a.vertical.posOffset}};}if(e.borderWidth&&e.borderWidth>0){let a={solid:"solid",dotted:"dot",dashed:"dash",double:"solid",groove:"solid",ridge:"solid",inset:"solid",outset:"solid"};r.outline={width:g(e.borderWidth),color:e.borderColor?{rgb:e.borderColor.replace("#","")}:void 0,style:e.borderStyle&&a[e.borderStyle]||"solid"};}if(e.hlinkHref&&(r.hlinkHref=e.hlinkHref),e.cropTop!==void 0||e.cropRight!==void 0||e.cropBottom!==void 0||e.cropLeft!==void 0){let a={};e.cropTop!==void 0&&e.cropTop!==null&&(a.top=e.cropTop),e.cropRight!==void 0&&e.cropRight!==null&&(a.right=e.cropRight),e.cropBottom!==void 0&&e.cropBottom!==null&&(a.bottom=e.cropBottom),e.cropLeft!==void 0&&e.cropLeft!==null&&(a.left=e.cropLeft),Object.keys(a).length>0&&(r.crop=a);}if(e.opacity!==void 0&&e.opacity!==null&&e.opacity<1&&(r.opacity=e.opacity),e.layoutInCell!==void 0&&e.layoutInCell!==null&&(r.layoutInCell=e.layoutInCell),e.allowOverlap!==void 0&&e.allowOverlap!==null&&(r.allowOverlap=e.allowOverlap),e.effectExtentTop||e.effectExtentBottom||e.effectExtentLeft||e.effectExtentRight){let a={};e.effectExtentTop&&(a.top=g(e.effectExtentTop)),e.effectExtentBottom&&(a.bottom=g(e.effectExtentBottom)),e.effectExtentLeft&&(a.left=g(e.effectExtentLeft)),e.effectExtentRight&&(a.right=g(e.effectExtentRight)),Object.keys(a).length>0&&(r.padding=a);}return {type:"run",content:[{type:"drawing",image:r}]}}function B(t){let e=t.attrs,n={type:"shape",shapeType:e.shapeType||"rect",id:e.shapeId||void 0,size:{width:e.width?g(e.width):0,height:e.height?g(e.height):0}};if(e.fillType==="gradient"&&e.gradientStops)try{let r=JSON.parse(e.gradientStops);n.fill={type:"gradient",gradient:{type:e.gradientType||"linear",angle:e.gradientAngle||void 0,stops:r.map(o=>({position:o.position,color:{rgb:o.color.replace("#","")}}))}};}catch{n.fill={type:"solid",color:{rgb:(e.fillColor||"000000").replace("#","")}};}else e.fillColor?n.fill={type:e.fillType||"solid",color:{rgb:e.fillColor.replace("#","")}}:e.fillType==="none"&&(n.fill={type:"none"});if(e.outlineWidth&&e.outlineWidth>0){let r={solid:"solid",dotted:"dot",dashed:"dash"};n.outline={width:g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&r[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:n}]}}function x(t){let e=t.attrs,n=Q(G(t),t);n=re(n,t);let i=e.bookmarks;if(i&&i.length>0){let o=i.map(l=>({type:"bookmarkStart",id:l.id,name:l.name})),a=i.map(l=>({type:"bookmarkEnd",id:l.id}));n=[...o,...n,...a];}let r={type:"paragraph",paraId:e.paraId||void 0,textId:e.textId||void 0,formatting:se(e),content:n};return e.renderedPageBreakBefore&&(r.renderedPageBreakBefore=true),e.pPrIns&&(r.pPrIns={id:e.pPrIns.revisionId,author:e.pPrIns.author,...e.pPrIns.date?{date:e.pPrIns.date}:{}}),e.pPrDel&&(r.pPrDel={id:e.pPrDel.revisionId,author:e.pPrDel.author,...e.pPrDel.date?{date:e.pPrDel.date}:{}}),e.pPrChange&&e.pPrChange.length>0&&(r.propertyChanges=e.pPrChange),e._sectionProperties?r.sectionProperties=e._sectionProperties:e.sectionBreakType&&(r.sectionProperties={sectionStart:e.sectionBreakType}),r}function Q(t,e){let n=e.attrs._originalRunBoundaries;if(!n||n.length===0||!t.every(a=>a.type==="run"))return t;let i=t;if(!i.every(Z))return t;let r=i.map(F).join(""),o=n.map(a=>a.text).join("");return r!==o||!ee(e,n)?t:te(i,n)??t}function Z(t){return t.content.every(e=>e.type==="text")}function F(t){return t.content.map(e=>e.type==="text"?e.text:"").join("")}function ee(t,e){let n=0,i=0,r=true;if(t.forEach(o=>{if(!r)return;if(!o.isText){r=false;return}let a=c(o.marks,b$1),l=o.text??"",d=0;for(;d<l.length;){for(;n<e.length&&e[n].text.length===0;)n++;let s=e[n];if(!s||a!==(s.marksKey??"")){r=false;return}let u=s.text.length-i,c=l.length-d,p=Math.min(u,c),m=l.slice(d,d+p),g=s.text.slice(i,i+p);if(m!==g){r=false;return}d+=p,i+=p,i===s.text.length&&(n++,i=0);}}),!r)return false;for(;n<e.length&&e[n].text.length===0;)n++;return n===e.length&&i===0}function te(t,e){let n=[],i={runIndex:0,runOffset:0};for(let r of e){if(r.text.length===0){n.push(ne(r));continue}let o=ie(t,i,r.text.length);if(!o)return null;r.propertyChanges&&r.propertyChanges.length>0&&(o.propertyChanges=r.propertyChanges),n.push(o);}for(;i.runIndex<t.length;){if(F(t[i.runIndex]).length-i.runOffset>0)return null;i.runIndex++,i.runOffset=0;}return n}function ne(t){let e={type:"run",content:[]};return t.formatting&&Object.keys(t.formatting).length>0&&(e.formatting=t.formatting),t.propertyChanges&&t.propertyChanges.length>0&&(e.propertyChanges=t.propertyChanges),e}function ie(t,e,n){let i=n,r="",o,a;for(;i>0;){let d=t[e.runIndex];if(!d)return null;let s=F(d),u=s.length-e.runOffset;if(u<=0){e.runIndex++,e.runOffset=0;continue}let c=JSON.stringify(d.formatting??null);if(a==null)o=d.formatting,a=c;else if(a!==c)return null;let p=Math.min(i,u);r+=s.slice(e.runOffset,e.runOffset+p),e.runOffset+=p,i-=p,e.runOffset===s.length&&(e.runIndex++,e.runOffset=0);}let l={type:"run",content:[{type:"text",text:r}]};return o&&Object.keys(o).length>0&&(l.formatting=o),l}function re(t,e){let n=new Set;if(e.forEach(a=>{for(let l of a.marks)l.type.name==="comment"&&n.add(l.attrs.commentId);}),n.size===0)return t;let i=[],r=new Set,o={index:0};for(e.forEach(a=>{let l=new Set;for(let d of a.marks)d.type.name==="comment"&&l.add(d.attrs.commentId);for(let d of [...r])l.has(d)||(i.push({type:"commentRangeEnd",id:d}),r.delete(d));for(let d of l)r.has(d)||(i.push({type:"commentRangeStart",id:d}),r.add(d));oe(i,t,o,a);});o.index<t.length;)i.push(t[o.index]),o.index++;for(let a of r)i.push({type:"commentRangeEnd",id:a});return i}function oe(t,e,n,i){if(!i.isText){ae(t,e,n);return}let r=(i.text??"").length;for(;r>0&&n.index<e.length;){let o=e[n.index];t.push(o),n.index++,r-=q(o);}}function ae(t,e,n){n.index>=e.length||(t.push(e[n.index]),n.index++);}function q(t){switch(t.type){case "run":return le(t);case "hyperlink":return k(t.children);case "simpleField":return k(t.content);case "complexField":return k(t.fieldResult);case "inlineSdt":return k(t.content);case "insertion":case "deletion":case "moveFrom":case "moveTo":return k(t.content);case "mathEquation":return t.plainText?.length??0;default:return 0}}function k(t){return t.reduce((e,n)=>e+q(n),0)}function le(t){return t.content.reduce((e,n)=>{switch(n.type){case "text":case "instrText":return e+n.text.length;case "symbol":return e+n.char.length;case "tab":case "softHyphen":case "noBreakHyphen":return e+1;default:return e}},0)}function X(t){return t.numPrFromStyle!=null&&t.numPr!=null&&JSON.stringify(t.numPr)===JSON.stringify(t.numPrFromStyle)}function se(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.alignment!==(n.alignment||void 0)&&(i.alignment=t.alignment||void 0),X(t)?(delete i.numPr,delete i.numPrFromStyle):t.numPr!==n.numPr&&JSON.stringify(t.numPr)!==JSON.stringify(n.numPr)&&(i.numPr=t.numPr||void 0,delete i.numPrFromStyle),t.styleId!==(n.styleId||void 0)&&(i.styleId=t.styleId||void 0),t.pageBreakBefore!==(n.pageBreakBefore||void 0)&&(i.pageBreakBefore=t.pageBreakBefore||void 0),t.bidi!==(n.bidi||void 0)&&(i.bidi=t.bidi||void 0),i}if(t.alignment||t.spaceBefore||t.spaceAfter||t.lineSpacing||t.indentLeft||t.indentRight||t.indentFirstLine||t.numPr||t.styleId||t.borders||t.shading||t.tabs||t.outlineLevel!=null||t.contextualSpacing||t.pageBreakBefore||t.bidi)return {alignment:t.alignment||void 0,spaceBefore:t.spaceBefore||void 0,spaceAfter:t.spaceAfter||void 0,lineSpacing:t.lineSpacing||void 0,lineSpacingRule:t.lineSpacingRule||void 0,indentLeft:t.indentLeft||void 0,indentRight:t.indentRight||void 0,indentFirstLine:t.indentFirstLine||void 0,hangingIndent:t.hangingIndent||void 0,numPr:X(t)?void 0:t.numPr||void 0,styleId:t.styleId||void 0,borders:t.borders||void 0,shading:t.shading||void 0,tabs:t.tabs||void 0,outlineLevel:t.outlineLevel??void 0,contextualSpacing:t.contextualSpacing||void 0,pageBreakBefore:t.pageBreakBefore||void 0,bidi:t.bidi||void 0}}function G(t){let e=[],n=null,i=null,r=null;return t.forEach(o=>{let a=o.marks.find(u=>u.type.name==="footnoteRef");if(a){n&&(e.push(n),n=null,i=null),r&&(e.push(r),r=null);let c={type:a.attrs.noteType==="endnote"?"endnoteRef":"footnoteRef",id:parseInt(a.attrs.id,10)||0};e.push({type:"run",content:[c]});return}let l=o.marks.find(u=>u.type.name==="insertion"),d=o.marks.find(u=>u.type.name==="deletion");if(l||d){n&&(e.push(n),n=null,i=null),r&&(e.push(r),r=null);let u=l||d,c;if(o.type.name==="image")c=I(o);else if(o.type.name==="shape")c=B(o);else {let g=o.marks.filter(y=>y.type.name!=="insertion"&&y.type.name!=="deletion"),h=T(g);c={type:"run",content:o.isText&&o.text?[{type:"text",text:o.text}]:[],...Object.keys(h).length>0?{formatting:h}:{}};}let p={id:u.attrs.revisionId,author:u.attrs.author||"Unknown",date:u.attrs.date||void 0},m=u.attrs.isMovePair===true;l?m?e.push({type:"moveTo",info:p,content:[c]}):e.push({type:"insertion",info:p,content:[c]}):m?e.push({type:"moveFrom",info:p,content:[c]}):e.push({type:"deletion",info:p,content:[c]});return}let s=o.marks.find(u=>u.type.name==="hyperlink");if(s){let u=K(s),c=r?.href||(r?.anchor?`#${r.anchor}`:"");r&&c===u?M(r,o):(n&&(e.push(n),n=null,i=null),r&&e.push(r),r=V(s),M(r,o));return}if(r&&(e.push(r),r=null),o.isText){let u=z(o.marks);n&&i===u?U(n,o.text||""):(n&&e.push(n),n=w(o.text||"",o.marks),i=u);}else o.type.name==="hardBreak"?(n&&(e.push(n),n=null,i=null),e.push(v())):o.type.name==="image"?(n&&(e.push(n),n=null,i=null),e.push(I(o))):o.type.name==="shape"?(n&&(e.push(n),n=null,i=null),e.push(B(o))):o.type.name==="tab"?(n&&(e.push(n),n=null,i=null),e.push(S())):o.type.name==="field"?(n&&(e.push(n),n=null,i=null),e.push($(o,o.marks))):o.type.name==="sdt"?(n&&(e.push(n),n=null,i=null),e.push(de(o))):o.type.name==="math"&&(n&&(e.push(n),n=null,i=null),e.push(J(o)));}),n&&e.push(n),r&&e.push(r),e}function de(t){let e$1=e(t.attrs),i=G(t).filter(r=>r.type==="run"||r.type==="hyperlink"||r.type==="simpleField"||r.type==="complexField"||r.type==="inlineSdt"||r.type==="mathEquation");return {type:"inlineSdt",properties:e$1,content:i}}function ue(t){for(let e of t)for(let n of e.cells){let i=n.formatting?.borders;if(i){let r=i.top||i.left||i.right||i.bottom||i.insideH||i.insideV;return r?{top:i.top??r,bottom:i.bottom??r,left:i.left??r,right:i.right??r,insideH:i.insideH??i.bottom??r,insideV:i.insideV??i.right??r}:void 0}}}function pe(t){let e=[],n=[],i=0;for(let r=0;r<t.childCount;r++){let o=t.child(r),a=0;o.forEach(l=>{if(l.type.name!=="tableCell"&&l.type.name!=="tableHeader")return;for(;e[r]?.[a];)a++;let d=l.attrs.rowspan||1,s=l.attrs.colspan||1;n.push({row:r,col:a,rowspan:d,colspan:s,cell:he(l)});for(let u=r;u<r+d;u++){let c=e[u]??[];e[u]=c;for(let p=a;p<a+s;p++)c[p]=true;}a+=s,i=Math.max(i,a);});}return {anchors:n,totalCols:i}}function ce(t){let e=new Map;t.forEach((i,r)=>{let o=0;for(let a of i.cells){let l=o;if(o+=a.formatting?.gridSpan??1,a.formatting?.vMerge){let d=e.get(l)??[];d.push({rowIndex:r,cell:a}),e.set(l,d);}}});let n=i=>{i.formatting&&(delete i.formatting.vMerge,Object.keys(i.formatting).length===0&&(i.formatting=void 0));};for(let i of e.values()){let r=null,o=0,a=-1,l=()=>{r&&o<2&&n(r),r=null,o=0;};for(let{rowIndex:d,cell:s}of i){let u=s.formatting?.vMerge;u==="restart"?(l(),r=s,o=1,a=d):u==="continue"&&(r&&d===a+1?(o++,a=d):(l(),n(s)));}l();}}function A(t){let e=t.attrs,{anchors:n,totalCols:i}=pe(t),r=new Map,o=new Map;for(let s of n){r.set(`${s.row}-${s.col}`,s);for(let u=s.row;u<s.row+s.rowspan;u++)for(let c=s.col;c<s.col+s.colspan;c++)o.set(`${u}-${c}`,s);}let a=[];for(let s=0;s<t.childCount;s++){let u=t.child(s),c=[];for(let g=0;g<i;){let h=r.get(`${s}-${g}`);if(h){let b={...h.cell.formatting??{}};h.colspan>1?b.gridSpan=h.colspan:delete b.gridSpan,h.rowspan>1?b.vMerge="restart":b.vMerge!=="restart"&&b.vMerge!=="continue"&&delete b.vMerge,c.push({...h.cell,formatting:Object.keys(b).length?b:void 0}),g+=h.colspan;continue}let y=o.get(`${s}-${g}`);if(!y){g++;continue}let C={...y.cell.formatting??{}};y.colspan>1?C.gridSpan=y.colspan:delete C.gridSpan,C.vMerge="continue",c.push({...y.cell,content:[],formatting:C}),g+=y.colspan;}let p=u.attrs,m={type:"tableRow",formatting:ge(p),cells:c};p.trIns?m.structuralChange={type:"tableRowInsertion",info:{id:p.trIns.revisionId,author:p.trIns.author,...p.trIns.date?{date:p.trIns.date}:{}}}:p.trDel&&(m.structuralChange={type:"tableRowDeletion",info:{id:p.trDel.revisionId,author:p.trDel.author,...p.trDel.date?{date:p.trDel.date}:{}}}),p.trPrChange&&p.trPrChange.length>0&&(m.propertyChanges=p.trPrChange),a.push(m);}ce(a);let l=fe(e)||void 0;if(!l?.borders){let s=ue(a);if(s)if(l)l.borders=s;else return {type:"table",columnWidths:e.columnWidths||void 0,formatting:{borders:s},rows:a}}let d={type:"table",columnWidths:e.columnWidths||void 0,formatting:l,rows:a};return e.tblPrChange&&e.tblPrChange.length>0&&(d.propertyChanges=e.tblPrChange),d}function fe(t){if(t._originalFormatting){let r=t._originalFormatting,o={...r};t.styleId!==(r.styleId||void 0)&&(o.styleId=t.styleId||void 0),t.justification!==(r.justification||void 0)&&(o.justification=t.justification||void 0),t.floating!==(r.floating||void 0)&&(o.floating=t.floating||void 0),t.tableLayout!==(r.layout||void 0)&&(o.layout=t.tableLayout||void 0),t.look!==(r.look||void 0)&&(o.look=t.look||void 0);let a=r.width?.value,l=r.width?.type;return (t.width!==a||t.widthType!==l)&&(t.width!=null||t.widthType?o.width={value:t.width??0,type:t.widthType||"dxa"}:o.width=void 0),t.cellMargins&&(o.cellMargins={top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}),o}if(!(t.styleId||t.width!=null||t.widthType||t.justification||t.tableLayout||t.floating||t.cellMargins||t.look))return;let n=t.cellMargins?{top:t.cellMargins.top!=null?{value:t.cellMargins.top,type:"dxa"}:void 0,bottom:t.cellMargins.bottom!=null?{value:t.cellMargins.bottom,type:"dxa"}:void 0,left:t.cellMargins.left!=null?{value:t.cellMargins.left,type:"dxa"}:void 0,right:t.cellMargins.right!=null?{value:t.cellMargins.right,type:"dxa"}:void 0}:void 0,i;return (t.width!=null||t.widthType)&&(i={value:t.width??0,type:t.widthType||"dxa"}),{styleId:t.styleId||void 0,width:i,justification:t.justification||void 0,layout:t.tableLayout||void 0,floating:t.floating||void 0,cellMargins:n,look:t.look||void 0}}function ge(t){if(t._originalFormatting){let n=t._originalFormatting,i={...n};return t.height!==(n.height?.value||void 0)&&(i.height=t.height?{value:t.height,type:"dxa"}:void 0),t.heightRule!==(n.heightRule||void 0)&&(i.heightRule=t.heightRule||void 0),t.isHeader!==(n.header||void 0)&&(i.header=t.isHeader||void 0),i}if(t.height||t.isHeader)return {height:t.height?{value:t.height,type:"dxa"}:void 0,heightRule:t.heightRule||void 0,header:t.isHeader||void 0}}function he(t){let e=t.attrs,n=[];t.forEach(r=>{r.type.name==="paragraph"?n.push(x(r)):r.type.name==="table"&&n.push(A(r));});let i={type:"tableCell",formatting:me(e),content:n};if(e.cellMarker){let r=e.cellMarker,o={id:r.info.revisionId,author:r.info.author,...r.info.date?{date:r.info.date}:{}};r.kind==="ins"?i.structuralChange={type:"tableCellInsertion",info:o}:r.kind==="del"?i.structuralChange={type:"tableCellDeletion",info:o}:i.structuralChange={type:"tableCellMerge",info:o,...r.vMerge?{vMerge:r.vMerge}:{},...r.vMergeOrig?{vMergeOrig:r.vMergeOrig}:{}};}return e.tcPrChange&&e.tcPrChange.length>0&&(i.propertyChanges=e.tcPrChange),i}function me(t){if(t._originalFormatting){let i=t._originalFormatting,r={...i};if(t.colspan>1&&(r.gridSpan=t.colspan),t.width!=null&&(r.width={value:t.width,type:t.widthType||"dxa"}),t.verticalAlign!==(i.verticalAlign||void 0)&&(r.verticalAlign=t.verticalAlign||void 0),t.backgroundColor?t._originalResolvedFill===t.backgroundColor&&i.shading?r.shading=i.shading:r.shading={fill:{rgb:t.backgroundColor}}:i.shading&&(r.shading=void 0),t.borders&&(r.borders=t.borders),t.margins){let o=t.margins,a={};o.top!=null&&(a.top={value:o.top,type:"dxa"}),o.bottom!=null&&(a.bottom={value:o.bottom,type:"dxa"}),o.left!=null&&(a.left={value:o.left,type:"dxa"}),o.right!=null&&(a.right={value:o.right,type:"dxa"}),r.margins=a;}return t.textDirection!==(i.textDirection||void 0)&&(r.textDirection=t.textDirection||void 0),r}if(!(t.colspan>1||t.rowspan>1||t.width!=null||t.verticalAlign||t.backgroundColor||t.borders||t.margins||t.textDirection))return;let n;if(t.margins){let i=t.margins;n={},i.top!=null&&(n.top={value:i.top,type:"dxa"}),i.bottom!=null&&(n.bottom={value:i.bottom,type:"dxa"}),i.left!=null&&(n.left={value:i.left,type:"dxa"}),i.right!=null&&(n.right={value:i.right,type:"dxa"});}return {gridSpan:t.colspan>1?t.colspan:void 0,width:t.width!=null?{value:t.width,type:t.widthType||"dxa"}:void 0,verticalAlign:t.verticalAlign||void 0,textDirection:t.textDirection||void 0,shading:t.backgroundColor?{fill:{rgb:t.backgroundColor}}:void 0,borders:t.borders,margins:n}}function O(t){let e=t.attrs,n=[];t.forEach(l=>{l.type.name==="paragraph"&&n.push(x(l));});let i$1={type:"shape",shapeType:"rect",id:e.textBoxId||void 0,size:{width:e.width?g(e.width):0,height:e.height?g(e.height):0},textBody:{content:n.length>0?n:[{type:"paragraph",content:[]}],margins:{top:e.marginTop!=null?g(e.marginTop):void 0,bottom:e.marginBottom!=null?g(e.marginBottom):void 0,left:e.marginLeft!=null?g(e.marginLeft):void 0,right:e.marginRight!=null?g(e.marginRight):void 0}}},r=i(e);r&&(i$1.position=r);let o=j(e);if(o&&(i$1.wrap=o),e.fillColor&&(i$1.fill={type:"solid",color:{rgb:e.fillColor.replace("#","")}}),e.outlineWidth&&e.outlineWidth>0){let l={solid:"solid",dotted:"dot",dashed:"dash"};i$1.outline={width:g(e.outlineWidth),color:e.outlineColor?{rgb:e.outlineColor.replace("#","")}:void 0,style:e.outlineStyle&&l[e.outlineStyle]||"solid"};}return {type:"run",content:[{type:"shape",shape:i$1}]}}function Y(t){return {type:"paragraph",content:[O(t)]}}function ye(t,e){let i={content:N(t),finalSectionProperties:e?.package.document.finalSectionProperties,sections:e?.package.document.sections,comments:e?.package.document.comments},r=e?{...e,package:{...e.package,document:i}}:{package:{document:i}},o=t.attrs.watermark??null,a$1=a(r)??null;return o!==a$1?b(r,o):r}function N(t){let e=[],n=[],i=()=>{for(let r of n)e.push({type:"paragraph",content:[r]});n=[];};return t.forEach(r=>{if(r.type.name==="paragraph"){let o=x(r);n.length>0&&(o.content=[...n,...o.content],n=[]),e.push(o);}else if(r.type.name==="table")i(),e.push(A(r));else if(r.type.name==="blockSdt")i(),e.push(be(r));else if(r.type.name==="textBox"){let o=r.attrs;h(o)?n.push(O(r)):(i(),e.push(Y(r)));}else r.type.name==="pageBreak"&&(i(),e.push(xe()));}),i(),e}function be(t){return {type:"blockSdt",properties:e(t.attrs),content:N(t)}}function xe(){return {type:"paragraph",content:[{type:"run",content:[{type:"break",breakType:"page"}]}]}}function Ke(t,e){return ye(e,t)}function ze(t){return N(t)}export{ye as a,Ke as b,ze as c};
@@ -1,4 +1,4 @@
1
- import {c}from'./chunk-QZPVZY6S.mjs';import {a as a$2}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$3}from'./chunk-CUY2THAO.mjs';import {i,t}from'./chunk-F24WZXN4.mjs';import {a as a$1}from'./chunk-3HENAL6V.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await a$1(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$2(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await a$1(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t$1){if(this._document.originalBuffer){if(t$1?.selective){let n=await c(this._document,this._document.originalBuffer,t$1.selective);if(n)return this._document.originalBuffer=n,n}let e=await i(this._document);return this._document.originalBuffer=e,e}return t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$3(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
1
+ import {c}from'./chunk-QZPVZY6S.mjs';import {a as a$2}from'./chunk-ARHPXIBJ.mjs';import {b,a as a$3}from'./chunk-B6FA4MJ5.mjs';import {i,t}from'./chunk-F24WZXN4.mjs';import {a as a$1}from'./chunk-5EP47PMQ.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var P=class o{constructor(t){a(this,"_document");a(this,"_pendingVariables");t instanceof ArrayBuffer||ArrayBuffer.isView(t)?this._document={package:{document:{content:[]}},originalBuffer:t instanceof ArrayBuffer?t:t.buffer}:this._document=t,this._pendingVariables={};}static async fromBuffer(t){let e=await a$1(t);return new o(e)}static fromDocument(t){return new o(t)}getDocument(){return this._document}getText(){let t=this._document.package.document;return this._getBodyText(t)}getFormattedText(){let t=[],e=this._document.package.document;for(let n of e.content)n.type==="paragraph"&&this._extractParagraphSegments(n,t);return t}getVariables(){return a$2(this._document)}getStyles(){let t=this._document.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}getPageCount(){let t=this.getWordCount();return Math.max(1,Math.ceil(t/500))}getWordCount(){return this.getText().split(/\s+/).filter(n=>n.length>0).length}getCharacterCount(t=true){let e=this.getText();return t?e.length:e.replace(/\s/g,"").length}getParagraphCount(){return this._document.package.document.content.filter(t=>t.type==="paragraph").length}getTableCount(){return this._document.package.document.content.filter(t=>t.type==="table").length}getAgentContext(t=100){let e=this._document.package.document,n=e.content.filter(i=>i.type==="paragraph"),r=n.map((i,s)=>{let c=this._getParagraphText(i),p=i.formatting?.styleId;return {index:s,preview:c.slice(0,t),style:p,isHeading:p?.toLowerCase().includes("heading")||false,headingLevel:this._parseHeadingLevel(p),isListItem:!!i.listRendering,isEmpty:c.trim().length===0}}),a=(e.sections||[]).map((i,s)=>({index:s,paragraphCount:i.content?.length||0,pageSize:i.properties?.pageWidth&&i.properties?.pageHeight?{width:i.properties.pageWidth,height:i.properties.pageHeight}:void 0,isLandscape:i.properties?.orientation==="landscape",hasHeader:!!i.properties?.headerReferences?.length,hasFooter:!!i.properties?.footerReferences?.length}));return {paragraphCount:n.length,wordCount:this.getWordCount(),characterCount:this.getCharacterCount(),variables:this.getVariables(),variableCount:this.getVariables().length,availableStyles:this.getStyles(),outline:r,sections:a,hasTables:this.getTableCount()>0,hasImages:this._hasImages(),hasHyperlinks:this._hasHyperlinks()}}insertText(t,e,n={}){let r={type:"insertText",position:t,text:e,formatting:n.formatting};return this._executeCommand(r)}replaceRange(t,e,n={}){let r={type:"replaceText",range:t,text:e,formatting:n.formatting};return this._executeCommand(r)}deleteRange(t){let e={type:"deleteText",range:t};return this._executeCommand(e)}applyFormatting(t,e){let n={type:"formatText",range:t,formatting:e};return this._executeCommand(n)}applyStyle(t,e){let n={type:"applyStyle",paragraphIndex:t,styleId:e};return this._executeCommand(n)}applyParagraphFormatting(t,e){let n={type:"formatParagraph",paragraphIndex:t,formatting:e};return this._executeCommand(n)}insertTable(t,e,n,r={}){let a={type:"insertTable",position:t,rows:e,columns:n,data:r.data,hasHeader:r.hasHeader};return this._executeCommand(a)}insertImage(t,e,n={}){let r={type:"insertImage",position:t,src:e,width:n.width,height:n.height,alt:n.alt};return this._executeCommand(r)}insertHyperlink(t,e,n={}){let r={type:"insertHyperlink",range:t,url:e,displayText:n.displayText,tooltip:n.tooltip};return this._executeCommand(r)}removeHyperlink(t){let e={type:"removeHyperlink",range:t};return this._executeCommand(e)}insertParagraphBreak(t){let e={type:"insertParagraphBreak",position:t};return this._executeCommand(e)}mergeParagraphs(t,e){let n={type:"mergeParagraphs",paragraphIndex:t,count:e};return this._executeCommand(n)}setVariable(t,e){return this._pendingVariables[t]=e,this}setVariables(t){for(let[e,n]of Object.entries(t))this._pendingVariables[e]=n;return this}getPendingVariables(){return {...this._pendingVariables}}clearPendingVariables(){return this._pendingVariables={},this}async applyVariables(t){let e={...this._pendingVariables,...t};if(Object.keys(e).length===0)return this;let n=this._document.originalBuffer;if(!n)throw new Error("Cannot apply variables: no original buffer for processing");let{processTemplate:r}=await import('./processTemplate-GPFDLQMX.mjs'),a=r(n,e),i=await a$1(a),s=new o(i);return s._pendingVariables={},s}async toBuffer(t$1){if(this._document.originalBuffer){if(t$1?.selective){let n=await c(this._document,this._document.originalBuffer,t$1.selective);if(n)return this._document.originalBuffer=n,n}let e=await i(this._document);return this._document.originalBuffer=e,e}return t(this._document)}async toBlob(t="application/vnd.openxmlformats-officedocument.wordprocessingml.document"){let e=await this.toBuffer();return new Blob([e],{type:t})}executeCommands(t){return new o(b(this._document,t))}_executeCommand(t){let e=new o(a$3(this._document,t));return e._pendingVariables={...this._pendingVariables},e}_getBodyText(t){let e=[];for(let n of t.content)n.type==="paragraph"?e.push(this._getParagraphText(n)):n.type==="table"&&e.push(this._getTableText(n));return e.join(`
2
2
  `)}_getParagraphText(t){let e=[];for(let n of t.content)n.type==="run"?e.push(this._getRunText(n)):n.type==="hyperlink"&&e.push(this._getHyperlinkText(n));return e.join("")}_getRunText(t){return t.content.filter(e=>e.type==="text").map(e=>e.text).join("")}_getHyperlinkText(t){let e=[];for(let n of t.children)n.type==="run"&&e.push(this._getRunText(n));return e.join("")}_getTableText(t){let e=[];for(let n of t.rows)for(let r of n.cells)for(let a of r.content)a.type==="paragraph"&&e.push(this._getParagraphText(a));return e.join(" ")}_extractParagraphSegments(t,e){for(let n of t.content)if(n.type==="run"){let r=this._getRunText(n);r&&e.push({text:r,formatting:n.formatting});}else if(n.type==="hyperlink"){let r=n.href||"";for(let a of n.children)if(a.type==="run"){let i=this._getRunText(a);i&&e.push({text:i,formatting:a.formatting,isHyperlink:true,hyperlinkUrl:r});}}}_parseHeadingLevel(t){if(!t)return;let e=t.match(/heading\s*(\d)/i);if(e)return parseInt(e[1],10)}_hasImages(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}_hasHyperlinks(){let t=this._document.package.document;for(let e of t.content)if(e.type==="paragraph"){for(let n of e.content)if(n.type==="hyperlink")return true}return false}};async function Ct(o){return P.fromBuffer(o)}function kt(o){return P.fromDocument(o)}function M(o,t={}){let{outlineMaxChars:e=100,maxOutlineParagraphs:n=50}=t,r=o.package.document,a=r.content.filter(y=>y.type==="paragraph"),i=z(a,e,n),s=a$2(o),c=W(o),p=$(r),u=U(r),d=G(r),f=r.content.some(y=>y.type==="table"),x=K(r),l=N(r);return {paragraphCount:a.length,wordCount:u,characterCount:d,variables:s,variableCount:s.length,availableStyles:c,outline:i,sections:p,hasTables:f,hasImages:x,hasHyperlinks:l}}function At(o,t,e={}){let{contextChars:n=200,includeSuggestions:r=true}=e,i=o.package.document.content.filter(m=>m.type==="paragraph"),s=i[t.start.paragraphIndex];if(!s)throw new Error(`Paragraph not found at index ${t.start.paragraphIndex}`);let c=g(s),p="";if(t.start.paragraphIndex===t.end.paragraphIndex)p=c.slice(t.start.offset,t.end.offset);else {let m=[];for(let b=t.start.paragraphIndex;b<=t.end.paragraphIndex;b++){let H=i[b];if(!H)continue;let _=g(H);b===t.start.paragraphIndex?m.push(_.slice(t.start.offset)):b===t.end.paragraphIndex?m.push(_.slice(0,t.end.offset)):m.push(_);}p=m.join(`
3
3
  `);}let u=Y(i,t.start.paragraphIndex,t.start.offset,n),d=Z(i,t.end.paragraphIndex,t.end.offset,n),f=tt(s,t.start.offset),x=s.formatting||{},l={index:t.start.paragraphIndex,fullText:c,style:s.formatting?.styleId,wordCount:v(c)},y=false,A=et(s,t.start.offset),S=r?nt(p):[];return {selectedText:p,range:t,formatting:f,paragraphFormatting:x,textBefore:u,textAfter:d,paragraph:l,inTable:y,inHyperlink:A,suggestedActions:S}}function L(o){let t=M(o,{outlineMaxChars:50,maxOutlineParagraphs:10}),e=[`Document with ${t.paragraphCount} paragraphs, ${t.wordCount} words.`];t.hasTables&&e.push("Contains tables."),t.hasImages&&e.push("Contains images."),t.hasHyperlinks&&e.push("Contains hyperlinks."),t.variableCount>0&&e.push(`Has ${t.variableCount} template variables: ${t.variables.join(", ")}`);let n=t.outline.filter(r=>r.isHeading);if(n.length>0){e.push(`
4
4
  Headings:`);for(let r of n.slice(0,5)){let a=r.headingLevel||1;e.push(`${" ".repeat(a-1)}- ${r.preview}`);}n.length>5&&e.push(` ... and ${n.length-5} more headings`);}return e.join(" ")}function z(o,t,e){let n=[];for(let r=0;r<Math.min(o.length,e);r++){let a=o[r],i=g(a),s=a.formatting?.styleId;n.push({index:r,preview:i.slice(0,t),style:s,isHeading:Q(s),headingLevel:X(s),isListItem:!!a.listRendering,isEmpty:i.trim().length===0});}return n}function W(o){let t=o.package.styles;if(!t?.styles)return [];let e=[];for(let[n,r]of Object.entries(t.styles))if(typeof r=="object"&&r!==null){let a=r;e.push({id:n,name:a.name||n,type:a.type==="numbering"?"paragraph":a.type||"paragraph",builtIn:a.default});}return e}function $(o){return o.sections?o.sections.map((t,e)=>({index:e,paragraphCount:t.content?.length||0,pageSize:t.properties?.pageWidth&&t.properties?.pageHeight?{width:t.properties.pageWidth,height:t.properties.pageHeight}:void 0,isLandscape:t.properties?.orientation==="landscape",hasHeader:!!t.properties?.headerReferences?.length,hasFooter:!!t.properties?.footerReferences?.length})):[]}function U(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=v(n);}else e.type==="table"&&(t+=q(e));return t}function v(o){return o.split(/\s+/).filter(e=>e.length>0).length}function G(o){let t=0;for(let e of o.content)if(e.type==="paragraph"){let n=g(e);t+=n.length;}else e.type==="table"&&(t+=J(e));return t}function q(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=v(a);}return t}function J(o){let t=0;for(let e of o.rows)for(let n of e.cells)for(let r of n.content)if(r.type==="paragraph"){let a=g(r);t+=a.length;}return t}function g(o){let t=[];for(let e of o.content)e.type==="run"?t.push(T(e)):e.type==="hyperlink"&&t.push(F(e));return t.join("")}function T(o){return o.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function F(o){let t=[];for(let e of o.children)e.type==="run"&&t.push(T(e));return t.join("")}function K(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="run"){for(let n of e.content)if(n.type==="drawing")return true}}return false}function N(o){for(let t of o.content)if(t.type==="paragraph"){for(let e of t.content)if(e.type==="hyperlink")return true}return false}function Q(o){return o?o.toLowerCase().includes("heading"):false}function X(o){if(!o)return;let t=o.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function Y(o,t,e,n){let r=[],a=0,i=o[t];if(i){let p=g(i).slice(0,e);r.unshift(p),a+=p.length;}for(let c=t-1;c>=0&&a<n;c--){let p=o[c];if(!p)continue;let u=g(p);r.unshift(u),a+=u.length;}let s=r.join(`
@@ -0,0 +1 @@
1
+ 'use strict';var chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js');function g(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function m(e){let t={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(t.id=e.id),e.alias!=null&&(t.alias=String(e.alias)),e.tag!=null&&(t.tag=String(e.tag)),e.lock!=null&&(t.lock=e.lock),e.placeholder!=null&&(t.placeholder=String(e.placeholder)),e.showingPlaceholder&&(t.showingPlaceholder=true),e.dateFormat!=null&&(t.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{t.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(t.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{t.dataBinding=JSON.parse(e.dataBinding);}catch{}return e.rawPropertiesXml!=null&&(t.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(t.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),t}function a(e){return !!e.wrap&&e.wrap.type!=="inline"}function x(e){let t=e.wrap?.type??"inline",i=e.wrap?.wrapText,n=e.position?.horizontal?.alignment;return {displayMode:s(t),cssFloat:p(t,i,n),wrapType:t,wrapText:i,anchorTarget:a(e)?"followingBlock":void 0,position:e.position?f(e.position):void 0,distTop:e.wrap?.distT!=null?chunkBJSG6TEG_js.f(e.wrap.distT):void 0,distBottom:e.wrap?.distB!=null?chunkBJSG6TEG_js.f(e.wrap.distB):void 0,distLeft:e.wrap?.distL!=null?chunkBJSG6TEG_js.f(e.wrap.distL):void 0,distRight:e.wrap?.distR!=null?chunkBJSG6TEG_js.f(e.wrap.distR):void 0}}function y(e){return e.anchorTarget==="followingBlock"||d(e)}function P(e){let t=e.position;if(!(!t?.horizontal&&!t?.vertical))return {horizontal:{relativeTo:t.horizontal?.relativeTo??"margin",alignment:t.horizontal?.align,posOffset:t.horizontal?.posOffset},vertical:{relativeTo:t.vertical?.relativeTo??"paragraph",alignment:t.vertical?.align,posOffset:t.vertical?.posOffset}}}function B(e){let t=e.wrapType??(e.displayMode==="float"?"square":"inline");if(!t||t==="inline")return;let i={type:t};return e.wrapText&&(i.wrapText=e.wrapText),e.distTop!=null&&(i.distT=chunkBJSG6TEG_js.g(e.distTop)),e.distBottom!=null&&(i.distB=chunkBJSG6TEG_js.g(e.distBottom)),e.distLeft!=null&&(i.distL=chunkBJSG6TEG_js.g(e.distLeft)),e.distRight!=null&&(i.distR=chunkBJSG6TEG_js.g(e.distRight)),i}function s(e){return e==="inline"?"inline":e==="topAndBottom"?"block":"float"}function d(e){return e.displayMode==="float"||chunkJFZIXFRC_js.a(e.wrapType)}function p(e,t,i){return e==="inline"||e==="topAndBottom"?"none":t==="left"?"right":t==="right"||i==="left"?"left":i==="right"?"right":"none"}function f(e){return {horizontal:e.horizontal?{relativeTo:e.horizontal.relativeTo,posOffset:e.horizontal.posOffset,align:e.horizontal.alignment}:void 0,vertical:e.vertical?{relativeTo:e.vertical.relativeTo,posOffset:e.vertical.posOffset,align:e.vertical.alignment}:void 0}}var c=new Set(["hyperlink"]),S=new Set(["hyperlink","comment"]);function I(e,t=c){let i=e.filter(n=>!t.has(n.type.name));return i.length===0?"":i.map(n=>`${n.type.name}:${JSON.stringify(n.attrs)}`).sort().join("|")}exports.a=c;exports.b=S;exports.c=I;exports.d=g;exports.e=m;exports.f=a;exports.g=x;exports.h=y;exports.i=P;exports.j=B;
@@ -0,0 +1,3 @@
1
+ import {b,a as a$1}from'./chunk-AMENZY5F.mjs';import {a,o,d as d$1,b as b$1}from'./chunk-67LVRQIR.mjs';import {l,k as k$1,q as q$1,d,n}from'./chunk-KNY7SXPJ.mjs';function ie(e,n){if(!e)return {};let t={};if(e.fontFamily){let a=null;if(e.fontFamily.asciiTheme&&n?.fontScheme&&(a=b(e.fontFamily.asciiTheme,n.fontScheme)),a||(a=e.fontFamily.ascii||e.fontFamily.hAnsi||e.fontFamily.eastAsia||e.fontFamily.cs||null),a){let d=a$1(a);t.fontFamily=d.cssFallback;}}if(e.fontSize!==void 0&&(t.fontSize=`${l(e.fontSize)}pt`),e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color&&(t.color=a(e.color,n)),e.highlight&&e.highlight!=="none"&&(t.backgroundColor=o(e.highlight)),e.shading){let a=v(e.shading,n);a&&!t.backgroundColor&&(t.backgroundColor=a);}let r=[],i=[],o$1=[];if(e.underline&&e.underline.style!=="none"){r.push("underline");let a$1=j(e.underline.style);a$1!=="solid"&&i.push(a$1),e.underline.color&&o$1.push(a(e.underline.color,n));}if(e.strike&&r.push("line-through"),e.doubleStrike&&r.push("line-through"),r.length>0&&(t.textDecoration=r.join(" "),i.length>0&&(t.textDecorationStyle=i[0]),o$1.length>0&&(t.textDecorationColor=o$1[0])),e.vertAlign)switch(e.vertAlign){case "superscript":t.verticalAlign="super",t.fontSize||(t.fontSize="0.83em");break;case "subscript":t.verticalAlign="sub",t.fontSize||(t.fontSize="0.83em");break}if(e.position&&e.position!==0){let a=k$1(e.position);t.position="relative",t.top=q$1(-a);}return e.allCaps?t.textTransform="uppercase":e.smallCaps&&(t.fontVariant="small-caps"),e.spacing!==void 0&&e.spacing!==0&&(t.letterSpacing=q$1(d(e.spacing))),e.scale!==void 0&&e.scale!==100&&(t.transform=`scaleX(${e.scale/100})`,t.display="inline-block"),e.hidden&&(t.display="none"),e.emboss&&(t.textShadow="1px 1px 1px rgba(255,255,255,0.5), -1px -1px 1px rgba(0,0,0,0.3)"),e.imprint&&(t.textShadow="-1px -1px 1px rgba(255,255,255,0.5), 1px 1px 1px rgba(0,0,0,0.3)"),e.outline&&(t.WebkitTextStroke="1px currentColor",t.WebkitTextFillColor="transparent"),e.shadow&&!e.emboss&&!e.imprint&&(t.textShadow="1px 1px 2px rgba(0,0,0,0.3)"),e.rtl&&(t.direction="rtl"),t}function oe(e,n){if(!e)return {};let t={};if(e.alignment&&(t.textAlign=$(e.alignment)),e.beforeAutospacing?t.marginTop=q$1(14):e.spaceBefore!==void 0&&(t.marginTop=q$1(d(e.spaceBefore))),e.afterAutospacing?t.marginBottom=q$1(14):e.spaceAfter!==void 0&&(t.marginBottom=q$1(d(e.spaceAfter))),e.lineSpacing!==void 0&&e.lineSpacing>0)switch(e.lineSpacingRule){case "exact":{let r=d(e.lineSpacing);r>0&&(t.lineHeight=q$1(r));break}case "atLeast":{let r=d(e.lineSpacing);r>0&&(t.minHeight=q$1(r),t.lineHeight=q$1(r));break}default:{let r=e.lineSpacing/240;r>0&&(t.lineHeight=r.toString());break}}if(e.indentLeft!==void 0&&(t.marginLeft=q$1(d(e.indentLeft))),e.indentRight!==void 0&&(t.marginRight=q$1(d(e.indentRight))),e.indentFirstLine!==void 0&&(e.hangingIndent?t.textIndent=q$1(d(e.indentFirstLine)):t.textIndent=q$1(d(e.indentFirstLine))),e.borders&&(e.borders.top&&Object.assign(t,h(e.borders.top,"Top",n)),e.borders.bottom&&Object.assign(t,h(e.borders.bottom,"Bottom",n)),e.borders.left&&Object.assign(t,h(e.borders.left,"Left",n)),e.borders.right&&Object.assign(t,h(e.borders.right,"Right",n))),e.shading){let r=v(e.shading,n);r&&(t.backgroundColor=r);}return e.bidi&&(t.direction="rtl"),e.pageBreakBefore&&(t.pageBreakBefore="always"),e.keepNext&&(t.pageBreakAfter="avoid"),e.keepLines&&(t.pageBreakInside="avoid"),t}function h(e,n$1="",t){if(!e||e.style==="none"||e.style==="nil")return {};let r={},i=e.size?n(e.size):1,o=e.color?a(e.color,t):"#000000",a$1=_(e.style),d=`border${n$1}Width`,g=`border${n$1}Style`,s=`border${n$1}Color`;return r[d]=q$1(Math.max(1,i)),r[g]=a$1,r[s]=o,r}function v(e,n){return !e||e.pattern==="clear"||e.pattern==="nil"?"":e.fill?e.fill.auto||e.fill.rgb==="auto"||e.fill.rgb==="FFFFFF"?"":d$1(e.fill,n):e.pattern==="solid"&&e.color?d$1(e.color,n):e.pattern&&e.pattern.startsWith("pct")&&e.color?d$1(e.color,n):""}function j(e){switch(e){case "double":return "double";case "dotted":case "dottedHeavy":return "dotted";case "dash":case "dashedHeavy":case "dashLong":case "dashLongHeavy":case "dotDash":case "dashDotHeavy":case "dotDotDash":case "dashDotDotHeavy":return "dashed";case "wave":case "wavyHeavy":case "wavyDouble":return "wavy";default:return "solid"}}function $(e){switch(e){case "center":return "center";case "right":return "right";case "both":case "distribute":return "justify";default:return "left"}}function _(e){switch(e){case "none":case "nil":return "none";case "double":case "triple":return "double";case "dotted":return "dotted";case "dashed":case "dashSmallGap":return "dashed";case "threeDEmboss":return "ridge";case "threeDEngrave":return "groove";case "outset":return "outset";case "inset":return "inset";default:return "solid"}}function se(...e){let n={};for(let t of e)t&&Object.assign(n,t);return n}function ae(e,n){if(!e)return {};let t={};if(e.verticalAlign&&(t.verticalAlign=e.verticalAlign),e.textDirection&&(e.textDirection.includes("rl")||e.textDirection.includes("Rl"))&&(t.direction="rtl"),e.shading){let r=v(e.shading,n);r&&(t.backgroundColor=r);}return e.borders&&(e.borders.top&&Object.assign(t,h(e.borders.top,"Top",n)),e.borders.bottom&&Object.assign(t,h(e.borders.bottom,"Bottom",n)),e.borders.left&&Object.assign(t,h(e.borders.left,"Left",n)),e.borders.right&&Object.assign(t,h(e.borders.right,"Right",n))),e.margins&&(e.margins.top?.value&&(t.paddingTop=q$1(d(e.margins.top.value))),e.margins.bottom?.value&&(t.paddingBottom=q$1(d(e.margins.bottom.value))),e.margins.left?.value&&(t.paddingLeft=q$1(d(e.margins.left.value))),e.margins.right?.value&&(t.paddingRight=q$1(d(e.margins.right.value)))),t}function le(e,n){if(!e)return {};let t={};if(e.pageWidth&&(t.width=q$1(d(e.pageWidth))),e.pageHeight&&(t.minHeight=q$1(d(e.pageHeight))),e.marginTop&&(t.paddingTop=q$1(d(e.marginTop))),e.marginBottom&&(t.paddingBottom=q$1(d(e.marginBottom))),e.marginLeft&&(t.paddingLeft=q$1(d(e.marginLeft))),e.marginRight&&(t.paddingRight=q$1(d(e.marginRight))),e.background?.color){let r=a(e.background.color,n);r&&(t.backgroundColor=r);}return t}var pe="application/x-docx-editor",f={HTML:"text/html",PLAIN:"text/plain"};function de(e){if(!e)return [];let n=()=>{if(!e.items||e.items.length===0)return [];let s=[];for(let c of Array.from(e.items)){if(c.kind!=="file"||!c.type.startsWith("image/"))continue;let u=c.getAsFile();u&&s.push(u);}return s},t=()=>!e.files||e.files.length===0?[]:Array.from(e.files).filter(s=>s.type.startsWith("image/")),r=n(),i=r.length?r:t();if(i.length<=1)return i;let o=["image/png","image/jpeg","image/webp","image/gif","image/svg+xml","image/bmp","image/tiff"],a=s=>{let c=s[0],u=o.indexOf(c.type);u<0&&(u=Number.MAX_SAFE_INTEGER);for(let y of s.slice(1)){let b=o.indexOf(y.type);if(b<0&&(b=Number.MAX_SAFE_INTEGER),b<u){c=y,u=b;continue}b===u&&y.size>c.size&&(c=y);}return c},d=new Map;for(let s of i){let c=s.name?.trim()??"",y=(c?c.replace(/\.[^/.]+$/,"").toLowerCase():"")||`size:${s.size}`,b=d.get(y);b?b.push(s):d.set(y,[s]);}let g=[];for(let s of d.values())g.push(a(s));return g}async function B(e,n={}){let{includeFormatting:t=true,onError:r,theme:i}=n;try{let o=k(e,t,i);return await S(o)}catch(o){return r?.(o),false}}async function fe(e,n={}){let{includeFormatting:t=true,onError:r,theme:i}=n;try{let o=G(e,t,i);return await S(o)}catch(o){return r?.(o),false}}function k(e,n=true,t){let r=e.map(w).join(""),i=n?z(e,t):R(r),o=JSON.stringify(e);return {plainText:r,html:i,internal:o}}function G(e,n=true,t){let r=e.map(Q).join(`
2
+ `),i=n?Z(e,t):R(r),o=JSON.stringify(e);return {plainText:r,html:i,internal:o}}async function S(e){try{if(navigator.clipboard&&navigator.clipboard.write){let n=[new ClipboardItem({[f.PLAIN]:new Blob([e.plainText],{type:f.PLAIN}),[f.HTML]:new Blob([e.html],{type:f.HTML})})];return await navigator.clipboard.write(n),!0}return I(e)}catch{return I(e)}}function I(e){let n=document.createElement("div");n.innerHTML=e.html,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n);try{let t=window.getSelection();if(!t)return !1;let r=document.createRange();r.selectNodeContents(n),t.removeAllRanges(),t.addRange(r);let i=document.execCommand("copy");return t.removeAllRanges(),i}finally{document.body.removeChild(n);}}async function ge(e={}){let{cleanWordFormatting:n=true,onError:t}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let r=await navigator.clipboard.read();return await K(r,n)}return null}catch(r){return t?.(r),null}}async function K(e,n){let t="",r="";for(let i of e)i.types.includes(f.HTML)&&(t=await(await i.getType(f.HTML)).text()),i.types.includes(f.PLAIN)&&(r=await(await i.getType(f.PLAIN)).text());return W(t,r,n)}function U(e,n={}){let{cleanWordFormatting:t=true}=n,r=e.clipboardData;if(!r)return null;let i=r.getData(f.HTML),o=r.getData(f.PLAIN);return W(i,o,t)}function W(e,n,t=true){let r=X(e),i=J(e);if(i){let d=e.match(/data-docx-editor-content="([^"]+)"/);if(d)try{return {runs:JSON.parse(decodeURIComponent(d[1])),fromWord:!1,fromEditor:!0,plainText:n}}catch{}}let o=e;return r&&t&&(o=Y(e)),{runs:q(o,n),fromWord:r,fromEditor:i,plainText:n}}function X(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function J(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function Y(e){let n=e;return n=n.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),n=n.replace(/<!--[\s\S]*?-->/g,""),n=n.replace(/<\?xml[^>]*>/gi,""),n=n.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),n=n.replace(/<o:[^>]*\/>/gi,""),n=n.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),n=n.replace(/<w:[^>]*\/>/gi,""),n=n.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),n=n.replace(/\s*style="\s*"/gi,""),n=n.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),n=n.replace(/<span[^>]*>\s*<\/span>/gi,""),n=n.replace(/<\/?font[^>]*>/gi,""),n=n.replace(/\s+/g," ").trim(),n}function q(e,n){if(!e||e.trim()==="")return n?[P(n)]:[];let t=document.createElement("div");t.innerHTML=e;let r=[];return F(t,r,{}),r.length===0&&n?[P(n)]:r}function F(e,n,t){if(e.nodeType===Node.TEXT_NODE){let a=e.textContent||"";(a.trim()||a.includes(" "))&&n.push(P(a,t));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let r=e,i=r.tagName.toLowerCase(),o={...t,...V(r)};switch(i){case "br":n.push(M(o));return;case "p":case "div":for(let a of r.childNodes)F(a,n,o);r.nextSibling&&n.push(M(o));return;case "b":case "strong":o.bold=true;break;case "i":case "em":o.italic=true;break;case "u":o.underline={style:"single"};break;case "s":case "strike":case "del":o.strike=true;break;case "sup":o.vertAlign="superscript";break;case "sub":o.vertAlign="subscript";break;case "code":case "pre":o.fontFamily={ascii:"Courier New"};break}for(let a of r.childNodes)F(a,n,o);}function V(e){let n={},t=e.style;(t.fontWeight==="bold"||parseInt(t.fontWeight)>=700)&&(n.bold=true),t.fontStyle==="italic"&&(n.italic=true);let r=t.textDecoration||t.textDecorationLine;if(r&&(r.includes("underline")&&(n.underline={style:"single"}),r.includes("line-through")&&(n.strike=true)),t.fontSize){let i=parseFloat(t.fontSize);isNaN(i)||(n.fontSize=Math.round(i/1.333*2));}if(t.fontFamily){let i=t.fontFamily.replace(/["']/g,"").split(",")[0].trim();i&&(n.fontFamily={ascii:i});}if(t.color){let i=O(t.color);i&&(n.color={rgb:i});}if(t.backgroundColor&&t.backgroundColor!=="transparent"){let i=O(t.backgroundColor);i&&(n.shading={fill:{rgb:i}});}return n}function O(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(n){let t=parseInt(n[1]).toString(16).padStart(2,"0"),r=parseInt(n[2]).toString(16).padStart(2,"0"),i=parseInt(n[3]).toString(16).padStart(2,"0");return (t+r+i).toUpperCase()}return null}function w(e){return e.content.map(n=>n.type==="text"?n.text:n.type==="tab"?" ":n.type==="break"&&n.breakType==="textWrapping"?`
3
+ `:"").join("")}function Q(e){return (e.content||[]).map(n=>n.type==="run"?w(n):"").join("")}function z(e,n){return e.map(t=>ee(t,n)).join("")}function Z(e,n){return e.map(t=>`<p>${z(t.content?.filter(r=>r.type==="run")||[],n)}</p>`).join("")}function ee(e,n){let t=w(e);if(!t)return "";let r=R(t),i=e.formatting;if(!i)return r;i.bold&&(r=`<strong>${r}</strong>`),i.italic&&(r=`<em>${r}</em>`),i.underline&&(r=`<u>${r}</u>`),i.strike&&(r=`<s>${r}</s>`),i.vertAlign==="superscript"&&(r=`<sup>${r}</sup>`),i.vertAlign==="subscript"&&(r=`<sub>${r}</sub>`);let o=[];if(i.fontSize){let g=i.fontSize/2;o.push(`font-size: ${g}pt`);}i.fontFamily?.ascii&&o.push(`font-family: "${i.fontFamily.ascii}"`);let a=b$1(i.color,n);a&&o.push(`color: #${a}`);let d=b$1(i.shading?.fill,n);return d&&o.push(`background-color: #${d}`),o.length>0&&(r=`<span style="${o.join("; ")}">${r}</span>`),r}function R(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function P(e,n){return {type:"run",formatting:n,content:[{type:"text",text:e}]}}function M(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function be(e){let{onCopy:n,onCut:t,onPaste:r,clipboardOptions:i={}}=e;return {handleCopy:async s=>{if(!n)return;let c=n();if(!c)return;s.preventDefault();let u=k(c.runs);s.clipboardData?(s.clipboardData.setData(f.PLAIN,u.plainText),s.clipboardData.setData(f.HTML,u.html)):await S(u);},handleCut:async s=>{if(!t)return;let c=t();if(!c)return;s.preventDefault();let u=k(c.runs);s.clipboardData?(s.clipboardData.setData(f.PLAIN,u.plainText),s.clipboardData.setData(f.HTML,u.html)):await S(u);},handlePaste:s=>{if(!r)return;s.preventDefault();let c=U(s,i);c&&r(c);},handleKeyDown:async s=>{let c=s.ctrlKey||s.metaKey;if(c&&s.key==="c"&&!s.shiftKey&&n){let u=n();u&&await B(u.runs,i);}if(c&&s.key==="x"&&!s.shiftKey&&t){let u=t();u&&await B(u.runs,i);}}}}export{ie as a,oe as b,h as c,v as d,se as e,ae as f,le as g,pe as h,f as i,de as j,B as k,fe as l,k as m,G as n,S as o,ge as p,U as q,W as r,X as s,J as t,Y as u,q as v,be as w};
@@ -1 +1 @@
1
- 'use strict';var chunkQXSDGNJ4_js=require('./chunk-QXSDGNJ4.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunk4Q2IP5FW_js.f((r.left-a.left)/p)),verticalEmu:Math.round(chunk4Q2IP5FW_js.f((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunkQXSDGNJ4_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunkQXSDGNJ4_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunkQXSDGNJ4_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunkQXSDGNJ4_js.y(e,r,a,o,{document:this.doc})}return chunkQXSDGNJ4_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
1
+ 'use strict';var chunkTT3ILFZC_js=require('./chunk-TT3ILFZC.js'),chunkBJSG6TEG_js=require('./chunk-BJSG6TEG.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunkBJSG6TEG_js.g((r.left-a.left)/p)),verticalEmu:Math.round(chunkBJSG6TEG_js.g((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"var(--doc-page-bg, #ffffff)",t.style.color="var(--doc-page-text, #000000)",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunkTT3ILFZC_js.y(e,r,a,o,{document:this.doc})}return chunkTT3ILFZC_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;