@zeke-02/docx-editor 0.5.2 → 0.5.4

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 (223) hide show
  1. package/LICENSE +204 -0
  2. package/dist/FindReplaceDialog-7SQOVQWH.js +1 -0
  3. package/dist/FindReplaceDialog-RK3A7MSK.mjs +1 -0
  4. package/dist/{FootnotePropertiesDialog-XQ7NIFIU.js → FootnotePropertiesDialog-2Q2SHVMR.js} +1 -1
  5. package/dist/{FootnotePropertiesDialog-TNVJJCY6.mjs → FootnotePropertiesDialog-ZKQXW3YO.mjs} +1 -1
  6. package/dist/{HyperlinkDialog-FR4IZZ7E.mjs → HyperlinkDialog-QV3CVFQU.mjs} +1 -1
  7. package/dist/HyperlinkDialog-XVAF7FVN.js +1 -0
  8. package/dist/{ImagePositionDialog-JSZSIKF5.mjs → ImagePositionDialog-EGRH3HPP.mjs} +1 -1
  9. package/dist/{ImagePositionDialog-2YXRAGZS.js → ImagePositionDialog-HIVHUTBT.js} +1 -1
  10. package/dist/ImagePropertiesDialog-67WLFIIZ.mjs +1 -0
  11. package/dist/ImagePropertiesDialog-HSM3JJ22.js +1 -0
  12. package/dist/KeyboardShortcutsDialog-B0UFuR4w.d.ts +395 -0
  13. package/dist/KeyboardShortcutsDialog-t6JKL4Aj.d.mts +395 -0
  14. package/dist/PageSetupDialog-642IAVG2.js +1 -0
  15. package/dist/PageSetupDialog-ERUQDHAY.mjs +1 -0
  16. package/dist/PluginHost-HS31VIuo.d.mts +16 -0
  17. package/dist/PluginHost-zILZO7zX.d.ts +16 -0
  18. package/dist/{SplitCellDialog-NP3JJYHD.mjs → SplitCellDialog-GFWCFCTD.mjs} +1 -1
  19. package/dist/{SplitCellDialog-JIAC3RYV.js → SplitCellDialog-M7WF7ANE.js} +1 -1
  20. package/dist/{TablePropertiesDialog-TIK4AA5M.mjs → TablePropertiesDialog-TZ7VCL6V.mjs} +1 -1
  21. package/dist/{TablePropertiesDialog-T7D4HSVP.js → TablePropertiesDialog-ZKU2FTUX.js} +1 -1
  22. package/dist/agentApi-B2Y7kexW.d.ts +486 -0
  23. package/dist/agentApi-BzUJ_kao.d.mts +486 -0
  24. package/dist/chunk-2XXILKEQ.js +1 -0
  25. package/dist/chunk-35DG3R42.js +2 -0
  26. package/dist/chunk-5UX5CD4C.js +1 -0
  27. package/dist/chunk-7QQSDIWK.mjs +2 -0
  28. package/dist/chunk-AW5TISUL.js +3 -0
  29. package/dist/chunk-B45ECEGY.js +18 -0
  30. package/dist/chunk-B7CCL7SL.mjs +2 -0
  31. package/dist/chunk-BRMTZRLJ.js +2 -0
  32. package/dist/chunk-D47GTKGU.js +2 -0
  33. package/dist/chunk-F5SERL7X.mjs +2 -0
  34. package/dist/chunk-FWPVBFKQ.mjs +1 -0
  35. package/dist/chunk-GGQK26JO.js +2 -0
  36. package/dist/chunk-GM2S2WMT.mjs +1 -0
  37. package/dist/chunk-HXDMASAR.js +1 -0
  38. package/dist/chunk-ILYKDR3C.js +1 -0
  39. package/dist/chunk-JFRDFK7V.mjs +260 -0
  40. package/dist/chunk-JPF5R2ZM.mjs +1 -0
  41. package/dist/chunk-KOXCF3CL.mjs +1 -0
  42. package/dist/chunk-KRLNX56Y.mjs +2 -0
  43. package/dist/chunk-LWOHVYKW.mjs +1 -0
  44. package/dist/chunk-MDTA25AN.mjs +60 -0
  45. package/dist/chunk-MKNSJOCN.js +70 -0
  46. package/dist/chunk-NIBCC7WQ.js +1 -0
  47. package/dist/chunk-NLFXR2VH.js +2 -0
  48. package/dist/chunk-NOLMVQNN.mjs +40 -0
  49. package/dist/chunk-ONIYA2FU.mjs +2 -0
  50. package/dist/chunk-RCIZ7OM3.mjs +70 -0
  51. package/dist/chunk-SGTUE33R.js +260 -0
  52. package/dist/{chunk-EHFEG3TX.js → chunk-SNZ57XBI.js} +1 -1
  53. package/dist/chunk-SOTWG3KJ.mjs +1 -0
  54. package/dist/chunk-TYPGB4KF.js +1 -0
  55. package/dist/chunk-U7ZW2DOO.mjs +2 -0
  56. package/dist/chunk-WO3FIV4B.js +40 -0
  57. package/dist/{chunk-PKEOQIQO.mjs → chunk-WPI3YRFO.mjs} +1 -1
  58. package/dist/chunk-XGJ2EORY.mjs +1 -0
  59. package/dist/chunk-XQZTWWRF.mjs +18 -0
  60. package/dist/chunk-Y3SEHWZ2.js +1 -0
  61. package/dist/chunk-YBEVHQCT.js +60 -0
  62. package/dist/chunk-ZVAFVHWR.mjs +3 -0
  63. package/dist/chunk-ZXPCJWVY.js +2 -0
  64. package/dist/{agentApi-DLt94vXk.d.mts → content-REFGFfEH.d.mts} +8 -755
  65. package/dist/{agentApi-DLt94vXk.d.ts → content-REFGFfEH.d.ts} +8 -755
  66. package/dist/dialogs.d.mts +25 -0
  67. package/dist/dialogs.d.ts +25 -0
  68. package/dist/dialogs.js +1 -0
  69. package/dist/dialogs.mjs +1 -0
  70. package/dist/document-Cu2vq_wS.d.mts +294 -0
  71. package/dist/document-CxOagoLQ.d.ts +294 -0
  72. package/dist/executor-WBHID2RK.mjs +1 -0
  73. package/dist/executor-Y5VUOAHY.js +1 -0
  74. package/dist/findReplace-Bue0JaXh.d.ts +138 -0
  75. package/dist/findReplace-shXbOjFQ.d.mts +138 -0
  76. package/dist/fork.d.mts +535 -0
  77. package/dist/fork.d.ts +535 -0
  78. package/dist/fork.js +1 -0
  79. package/dist/fork.mjs +1 -0
  80. package/dist/hooks.d.mts +598 -0
  81. package/dist/hooks.d.ts +598 -0
  82. package/dist/hooks.js +1 -0
  83. package/dist/hooks.mjs +1 -0
  84. package/dist/index-B5A-J9GC.d.ts +1119 -0
  85. package/dist/index-bw-PaozF.d.mts +1119 -0
  86. package/dist/index.d.mts +12 -591
  87. package/dist/index.d.ts +12 -591
  88. package/dist/index.js +1 -120
  89. package/dist/index.mjs +1 -120
  90. package/dist/layout-bridge-5GYGYKM5.mjs +1 -0
  91. package/dist/layout-bridge-QQDA7ELH.js +1 -0
  92. package/dist/plugin-api.d.mts +165 -0
  93. package/dist/plugin-api.d.ts +165 -0
  94. package/dist/plugin-api.js +1 -0
  95. package/dist/plugin-api.mjs +1 -0
  96. package/dist/processTemplate-BTBTR7AM.js +1 -0
  97. package/dist/{processTemplate-W2C5PXZB.mjs → processTemplate-MBX2KDLE.mjs} +1 -1
  98. package/dist/styles.css +1 -1
  99. package/dist/styles.d.mts +18 -0
  100. package/dist/styles.d.ts +18 -0
  101. package/dist/styles.js +1 -0
  102. package/dist/styles.mjs +1 -0
  103. package/dist/types-BF48VxkC.d.mts +18 -0
  104. package/dist/types-BF48VxkC.d.ts +18 -0
  105. package/dist/types-BnIs4sE7.d.mts +281 -0
  106. package/dist/types-BnIs4sE7.d.ts +281 -0
  107. package/dist/types-CW6HFAX6.d.ts +39 -0
  108. package/dist/types-DIsDCwTG.d.mts +39 -0
  109. package/dist/ui.d.mts +111 -552
  110. package/dist/ui.d.ts +111 -552
  111. package/dist/ui.js +111 -1
  112. package/dist/ui.mjs +111 -1
  113. package/dist/useFindReplace-DKy-s3gS.d.ts +261 -0
  114. package/dist/useFindReplace-vuoKpDKE.d.mts +261 -0
  115. package/package.json +47 -49
  116. package/dist/ClipboardManager-CVKX0v9q.d.ts +0 -464
  117. package/dist/ClipboardManager-V3aaMnWE.d.mts +0 -464
  118. package/dist/DocumentAgent-BWflKHpH.d.mts +0 -442
  119. package/dist/DocumentAgent-DsdXtetF.d.ts +0 -442
  120. package/dist/FindReplaceDialog-L3YF5HIS.mjs +0 -1
  121. package/dist/FindReplaceDialog-SEBWC5P7.js +0 -1
  122. package/dist/HyperlinkDialog-WEK6JSAC.js +0 -1
  123. package/dist/ImagePropertiesDialog-527MFLQO.mjs +0 -1
  124. package/dist/ImagePropertiesDialog-HG4K3IE7.js +0 -1
  125. package/dist/PageSetupDialog-GALVJMUB.js +0 -1
  126. package/dist/PageSetupDialog-TGQIAMI7.mjs +0 -1
  127. package/dist/TableToolbar-DUgmob2I.d.ts +0 -1273
  128. package/dist/TableToolbar-YL74HNS1.d.mts +0 -1273
  129. package/dist/chunk-23SXXIZS.js +0 -111
  130. package/dist/chunk-3F52AP2Q.js +0 -1
  131. package/dist/chunk-42O5GXM5.mjs +0 -82
  132. package/dist/chunk-54ULJEHM.mjs +0 -1
  133. package/dist/chunk-5XK326FI.mjs +0 -1
  134. package/dist/chunk-6WPRCJ5A.mjs +0 -1
  135. package/dist/chunk-76IYR7C7.mjs +0 -1
  136. package/dist/chunk-AGRIVA4G.js +0 -1
  137. package/dist/chunk-BTCQ2QI3.mjs +0 -3
  138. package/dist/chunk-BUEMG4NW.js +0 -1
  139. package/dist/chunk-BXRC4U3X.mjs +0 -2
  140. package/dist/chunk-CPAYKE6X.mjs +0 -1
  141. package/dist/chunk-DACWLFKI.mjs +0 -1
  142. package/dist/chunk-EPBFWE36.js +0 -2
  143. package/dist/chunk-FXES3YDB.js +0 -82
  144. package/dist/chunk-HI66BSGS.mjs +0 -9
  145. package/dist/chunk-INTPVEO6.mjs +0 -9
  146. package/dist/chunk-IOAGVW6Q.mjs +0 -2
  147. package/dist/chunk-JCEWC5QL.mjs +0 -4
  148. package/dist/chunk-JTIUFACT.js +0 -1
  149. package/dist/chunk-LUF7PWIC.js +0 -10
  150. package/dist/chunk-MGEN6GOE.mjs +0 -2
  151. package/dist/chunk-MOE2ZGUE.js +0 -18
  152. package/dist/chunk-MWLHJWB6.js +0 -9
  153. package/dist/chunk-OFYVDN3U.mjs +0 -2
  154. package/dist/chunk-P4VSHBGZ.js +0 -2
  155. package/dist/chunk-P5FQHIES.mjs +0 -1
  156. package/dist/chunk-PBC7XAYZ.js +0 -3
  157. package/dist/chunk-PEMB6SZT.js +0 -2
  158. package/dist/chunk-PQMSZTBB.js +0 -9
  159. package/dist/chunk-Q7UDQXAF.js +0 -1
  160. package/dist/chunk-QGTAIC5E.js +0 -1
  161. package/dist/chunk-QVPR2W5S.js +0 -1
  162. package/dist/chunk-R3QMYPL5.mjs +0 -59
  163. package/dist/chunk-RBUTXXQJ.mjs +0 -18
  164. package/dist/chunk-RRWYZ2TS.mjs +0 -111
  165. package/dist/chunk-S3STEPVO.js +0 -182
  166. package/dist/chunk-SFUM35DH.js +0 -2
  167. package/dist/chunk-SNLC6EK2.js +0 -1
  168. package/dist/chunk-TMTLIGLZ.js +0 -59
  169. package/dist/chunk-TSE2PWFX.mjs +0 -10
  170. package/dist/chunk-UKESXQS5.mjs +0 -182
  171. package/dist/chunk-UWYD42WV.js +0 -4
  172. package/dist/chunk-UXVACQCY.mjs +0 -1
  173. package/dist/chunk-W4EIKDM6.mjs +0 -2
  174. package/dist/chunk-W53SI3XW.mjs +0 -1
  175. package/dist/chunk-WNS2RBQD.js +0 -2
  176. package/dist/chunk-Z3KMSHUP.js +0 -1
  177. package/dist/core-plugins-reexport.d.mts +0 -31
  178. package/dist/core-plugins-reexport.d.ts +0 -31
  179. package/dist/core-plugins-reexport.js +0 -1
  180. package/dist/core-plugins-reexport.mjs +0 -1
  181. package/dist/core-reexport.d.mts +0 -340
  182. package/dist/core-reexport.d.ts +0 -340
  183. package/dist/core-reexport.js +0 -1
  184. package/dist/core-reexport.mjs +0 -1
  185. package/dist/documentSerializer-DtS_-oGA.d.mts +0 -664
  186. package/dist/documentSerializer-Wj1p2ASa.d.ts +0 -664
  187. package/dist/executor-C3VXF7QA.mjs +0 -1
  188. package/dist/executor-GDBV3AGV.js +0 -1
  189. package/dist/headless-reexport.d.mts +0 -197
  190. package/dist/headless-reexport.d.ts +0 -197
  191. package/dist/headless-reexport.js +0 -1
  192. package/dist/headless-reexport.mjs +0 -1
  193. package/dist/insertOperations-BTH1Asas.d.mts +0 -176
  194. package/dist/insertOperations-CbUnXAXH.d.ts +0 -176
  195. package/dist/layout-bridge-EA4DJ227.js +0 -1
  196. package/dist/layout-bridge-XDPSO6GO.mjs +0 -1
  197. package/dist/mcp-reexport.d.mts +0 -156
  198. package/dist/mcp-reexport.d.ts +0 -156
  199. package/dist/mcp-reexport.js +0 -16
  200. package/dist/mcp-reexport.mjs +0 -16
  201. package/dist/processTemplate-MJ2PCSO5.js +0 -1
  202. package/dist/react-B0W16SV6.d.ts +0 -1330
  203. package/dist/react-D0Pn1nww.d.mts +0 -1330
  204. package/dist/react.d.mts +0 -10
  205. package/dist/react.d.ts +0 -10
  206. package/dist/react.js +0 -1
  207. package/dist/react.mjs +0 -1
  208. package/dist/registry-CH9V-IX0.d.ts +0 -165
  209. package/dist/registry-CWBKYlNW.d.mts +0 -165
  210. package/dist/types-UDsUq8D3.d.mts +0 -310
  211. package/dist/types-jbivc9Lj.d.ts +0 -310
  212. package/dist/variableDetector-CdQ7ZTzA.d.mts +0 -204
  213. package/dist/variableDetector-DsRV3A9z.d.ts +0 -204
  214. package/i18n/de.json +0 -792
  215. package/i18n/en.json +0 -792
  216. package/i18n/he.json +0 -792
  217. package/i18n/pl.json +0 -792
  218. package/i18n/pt-BR.json +0 -792
  219. package/i18n/tr.json +0 -792
  220. package/i18n/zh-CN.json +0 -792
  221. /package/dist/{chunk-YC5KZSYD.js → chunk-ESZ6JRTW.js} +0 -0
  222. /package/dist/{chunk-LVGJKS7Y.mjs → chunk-TZMMD6RR.mjs} +0 -0
  223. /package/dist/{react.css → fork.css} +0 -0
@@ -1,9 +0,0 @@
1
- async function B(t){if(t instanceof ArrayBuffer)return t;if(t instanceof Uint8Array){let o=new ArrayBuffer(t.byteLength);return new Uint8Array(o).set(t),o}if(t instanceof Blob)return t.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof t}`)}var l=new Set,f=new Map,u=new Set,d=false;function h(t,o=[400,700],n=["normal","italic"]){let e=encodeURIComponent(t),s=[];for(let r of n){let i=r==="italic"?1:0;for(let c of o)s.push(`${i},${c}`);}s.sort();let a=s.join(";");return `https://fonts.googleapis.com/css2?family=${e}:ital,wght@${a}&display=swap`}async function m(t,o){if(typeof document>"u")return false;let n=t.trim();if(l.has(n))return true;let e=f.get(n);if(e)return e;let s=(async()=>{d=true;try{let a=h(n,o?.weights,o?.styles),r=document.createElement("link");return r.rel="stylesheet",r.href=a,await new Promise(c=>{r.onload=()=>c(!0),r.onerror=()=>c(!1),document.head.appendChild(r),setTimeout(()=>c(!1),5e3);})?(await p(n,3e3),l.add(n),y([n]),!0):!1}catch(a){return console.warn(`Failed to load font "${n}":`,a),false}finally{f.delete(n),f.size===0&&(d=false);}})();return f.set(n,s),s}async function w(t,o){let n=t.filter(e=>!l.has(e.trim()));n.length!==0&&await Promise.all(n.map(e=>m(e,o)));}function S(t){return l.has(t.trim())}function $(){return d}function L(){return Array.from(l)}function T(t){return u.add(t),()=>{u.delete(t);}}function y(t){for(let o of u)try{o(t);}catch(n){console.warn("Font load callback error:",n);}}async function p(t,o){if("fonts"in document)try{let n=`400 16px "${t}"`;return await Promise.race([document.fonts.load(n),new Promise(e=>setTimeout(e,o))]),document.fonts.check(n)}catch{}return await new Promise(n=>setTimeout(n,100)),true}function v(t,o="sans-serif"){if(typeof document>"u")return false;let n=(s,a)=>{let i=document.createElement("canvas").getContext("2d");if(!i)return false;i.textBaseline="top";let c="abcdefghijklmnopqrstuvwxyz0123456789";i.font=`72px ${a}`;let g=i.measureText(c).width;return i.font=`72px "${s}", ${a}`,i.measureText(c).width!==g};return n(t,o)?true:n(t,o==="sans-serif"?"serif":"sans-serif")}async function G(t,o,n){let e=t.trim();if(l.has(e))return true;try{let s=new Blob([o],{type:"font/ttf"}),a=URL.createObjectURL(s),r=document.createElement("style");return r.textContent=`
2
- @font-face {
3
- font-family: "${e}";
4
- src: url(${a}) format('truetype');
5
- font-weight: ${n?.weight??"normal"};
6
- font-style: ${n?.style??"normal"};
7
- font-display: swap;
8
- }
9
- `,document.head.appendChild(r),await p(e,3e3),l.add(e),y([e]),!0}catch(s){return console.warn(`Failed to load font "${e}" from buffer:`,s),false}}var F={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function b(t){let o=t.trim();return F[o]||o}async function x(t){let o=t.trim(),n=b(o);if(n!==o){let e=await m(n);return e&&l.add(o),e}return m(n)}async function A(t){let o=[...new Set(t.map(n=>n.trim()))];await Promise.all(o.map(n=>x(n)));}async function E(){await w(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function P(t){let o=new Set,n=t;if(!n?.package)return o;let e=n.package?.document?.content;if(Array.isArray(e)){for(let a of e)if(a?.type==="paragraph"&&Array.isArray(a.content)){for(let r of a.content)if(r?.type==="run"&&r.formatting?.fontFamily){let{ascii:i,hAnsi:c}=r.formatting.fontFamily;i&&o.add(i),c&&c!==i&&o.add(c);}}}let s=n.package?.styles?.styles;if(Array.isArray(s)){for(let a of s)if(a?.runProperties?.fontFamily){let{ascii:r,hAnsi:i}=a.runProperties.fontFamily;r&&o.add(r),i&&i!==r&&o.add(i);}}return o}async function I(t){let o=P(t);o.size!==0&&await A(Array.from(o));}export{B as a,m as b,w as c,S as d,$ as e,L as f,T as g,v as h,G as i,A as j,E as k,I as l};
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-WOHFANC5.mjs';import {j,k,w,v,i,o,p,q as q$1,r,b,d,c as c$1,g,f,a as a$2,e,t,h,n,l}from'./chunk-RBUTXXQJ.mjs';import {a as a$1,j as j$1}from'./chunk-INTPVEO6.mjs';import {c}from'./chunk-TAUMSKRE.mjs';var pe=c(a());async function ge(t){let i=await pe.default.loadAsync(t),e={documentXml:null,stylesXml:null,themeXml:null,numberingXml:null,fontTableXml:null,settingsXml:null,webSettingsXml:null,headers:new Map,footers:new Map,footnotesXml:null,endnotesXml:null,commentsXml:null,commentsExtensibleXml:null,commentsExtendedXml:null,documentRels:null,packageRels:null,contentTypesXml:null,corePropsXml:null,appPropsXml:null,customPropsXml:null,media:new Map,fonts:new Map,allXml:new Map,originalZip:i,originalBuffer:t};for(let[n,s]of Object.entries(i.files)){if(s.dir)continue;let o=n.toLowerCase();if(o.endsWith(".xml")||o.endsWith(".rels")){let a=await s.async("text");if(e.allXml.set(n,a),o==="word/document.xml")e.documentXml=a;else if(o==="word/styles.xml")e.stylesXml=a;else if(o==="word/theme/theme1.xml")e.themeXml=a;else if(o==="word/numbering.xml")e.numberingXml=a;else if(o==="word/fonttable.xml")e.fontTableXml=a;else if(o==="word/settings.xml")e.settingsXml=a;else if(o==="word/websettings.xml")e.webSettingsXml=a;else if(o==="word/footnotes.xml")e.footnotesXml=a;else if(o==="word/endnotes.xml")e.endnotesXml=a;else if(o==="word/comments.xml")e.commentsXml=a;else if(o==="word/commentsextensible.xml")e.commentsExtensibleXml=a;else if(o==="word/commentsextended.xml")e.commentsExtendedXml=a;else if(o==="word/_rels/document.xml.rels")e.documentRels=a;else if(o==="_rels/.rels")e.packageRels=a;else if(o==="[content_types].xml")e.contentTypesXml=a;else if(o==="docprops/core.xml")e.corePropsXml=a;else if(o==="docprops/app.xml")e.appPropsXml=a;else if(o==="docprops/custom.xml")e.customPropsXml=a;else if(o.match(/^word\/header\d+\.xml$/)){let c=n.split("/").pop()||n;e.headers.set(c,a);}else if(o.match(/^word\/footer\d+\.xml$/)){let c=n.split("/").pop()||n;e.footers.set(c,a);}}else if(o.startsWith("word/media/")){let a=await s.async("arraybuffer");e.media.set(n,a);}else if(o.startsWith("word/fonts/")){let a=await s.async("arraybuffer");e.fonts.set(n,a);}}return e}function we(t){switch(t.toLowerCase().split(".").pop()){case "png":return "image/png";case "jpg":case "jpeg":return "image/jpeg";case "gif":return "image/gif";case "bmp":return "image/bmp";case "tif":case "tiff":return "image/tiff";case "wmf":return "image/x-wmf";case "emf":return "image/x-emf";case "svg":return "image/svg+xml";case "webp":return "image/webp";default:return "application/octet-stream"}}function J(t,i){if(!t)return;let e={},n=c$1(t,"w","b");n&&(e.bold=h(n));let s=c$1(t,"w","bCs");s&&(e.boldCs=h(s));let o=c$1(t,"w","i");o&&(e.italic=h(o));let a=c$1(t,"w","iCs");a&&(e.italicCs=h(a));let c=c$1(t,"w","u");if(c){let g=f(c,"w","val");if(g){e.underline={style:g};let E=f(c,"w","color"),A=f(c,"w","themeColor");(E||A)&&(e.underline.color=ee(E,A,f(c,"w","themeTint"),f(c,"w","themeShade")));}}let d=c$1(t,"w","strike");d&&(e.strike=h(d));let u=c$1(t,"w","dstrike");u&&(e.doubleStrike=h(u));let m=c$1(t,"w","vertAlign");if(m){let g=f(m,"w","val");(g==="superscript"||g==="subscript"||g==="baseline")&&(e.vertAlign=g);}let w=c$1(t,"w","smallCaps");w&&(e.smallCaps=h(w));let p=c$1(t,"w","caps");p&&(e.allCaps=h(p));let v=c$1(t,"w","vanish");v&&(e.hidden=h(v));let f$1=c$1(t,"w","color");f$1&&(e.color=ee(f(f$1,"w","val"),f(f$1,"w","themeColor"),f(f$1,"w","themeTint"),f(f$1,"w","themeShade")));let h$1=c$1(t,"w","highlight");if(h$1){let g=f(h$1,"w","val");g&&(e.highlight=g);}let C=c$1(t,"w","shd");C&&(e.shading=q(C));let M=c$1(t,"w","sz");if(M){let g$1=g(M,"w","val");g$1!==void 0&&(e.fontSize=g$1);}let D=c$1(t,"w","szCs");if(D){let g$1=g(D,"w","val");g$1!==void 0&&(e.fontSizeCs=g$1);}let N=c$1(t,"w","rFonts");if(N){e.fontFamily={ascii:f(N,"w","ascii")??void 0,hAnsi:f(N,"w","hAnsi")??void 0,eastAsia:f(N,"w","eastAsia")??void 0,cs:f(N,"w","cs")??void 0};let g=f(N,"w","asciiTheme");g&&(e.fontFamily.asciiTheme=g,i&&!e.fontFamily.ascii&&(e.fontFamily.ascii=l(i,g)));let E=f(N,"w","hAnsiTheme");E&&(e.fontFamily.hAnsiTheme=E,i&&!e.fontFamily.hAnsi&&(e.fontFamily.hAnsi=l(i,E)));let A=f(N,"w","eastAsiaTheme");A&&(e.fontFamily.eastAsiaTheme=A,i&&!e.fontFamily.eastAsia&&(e.fontFamily.eastAsia=l(i,A)));let Y=f(N,"w","cstheme");Y&&(e.fontFamily.csTheme=Y,i&&!e.fontFamily.cs&&(e.fontFamily.cs=l(i,Y)));}let F=c$1(t,"w","spacing");if(F){let g$1=g(F,"w","val");g$1!==void 0&&(e.spacing=g$1);}let y=c$1(t,"w","position");if(y){let g$1=g(y,"w","val");g$1!==void 0&&(e.position=g$1);}let x=c$1(t,"w","w");if(x){let g$1=g(x,"w","val");g$1!==void 0&&(e.scale=g$1);}let T=c$1(t,"w","kern");if(T){let g$1=g(T,"w","val");g$1!==void 0&&(e.kerning=g$1);}let X=c$1(t,"w","effect");if(X){let g=f(X,"w","val");g&&(e.effect=g);}let L=c$1(t,"w","em");if(L){let g=f(L,"w","val");g&&(e.emphasisMark=g);}let I=c$1(t,"w","emboss");I&&(e.emboss=h(I));let k=c$1(t,"w","imprint");k&&(e.imprint=h(k));let U=c$1(t,"w","outline");U&&(e.outline=h(U));let V=c$1(t,"w","shadow");V&&(e.shadow=h(V));let O=c$1(t,"w","rtl");O&&(e.rtl=h(O));let P=c$1(t,"w","cs");P&&(e.cs=h(P));let R=c$1(t,"w","rStyle");if(R){let g=f(R,"w","val");g&&(e.styleId=g);}return Object.keys(e).length>0?e:void 0}function ee(t,i,e,n){let s={};return t&&t!=="auto"?s.rgb=t:t==="auto"&&(s.auto=true),i&&(s.themeColor=i),e&&(s.themeTint=e),n&&(s.themeShade=n),s}function q(t){if(!t)return;let i={},e=f(t,"w","color");e&&e!=="auto"&&(i.color={rgb:e});let n=f(t,"w","fill");n&&n!=="auto"&&(i.fill={rgb:n});let s=f(t,"w","themeFill");s&&(i.fill=i.fill||{},i.fill.themeColor=s);let o=f(t,"w","themeFillTint");o&&i.fill&&(i.fill.themeTint=o);let a=f(t,"w","themeFillShade");a&&i.fill&&(i.fill.themeShade=a);let c=f(t,"w","val");return c&&(i.pattern=c),Object.keys(i).length>0?i:void 0}function B(t){if(!t)return;let i=f(t,"w","val");if(!i)return;let e={style:i},n=f(t,"w","color"),s=f(t,"w","themeColor");(n||s)&&(e.color=ee(n,s,f(t,"w","themeTint"),f(t,"w","themeShade")));let o=g(t,"w","sz");o!==void 0&&(e.size=o);let a=g(t,"w","space");a!==void 0&&(e.space=a);let c=f(t,"w","shadow");c&&(e.shadow=c==="1"||c==="true");let d=f(t,"w","frame");return d&&(e.frame=d==="1"||d==="true"),e}function Me(t){if(!t)return;let i=d(t,"w","tab");if(i.length===0)return;let e=[];for(let n of i){let s=g(n,"w","pos"),o=f(n,"w","val");if(s!==void 0&&o){let a={position:s,alignment:o},c=f(n,"w","leader");c&&(a.leader=c),e.push(a);}}return e.length>0?e:void 0}function te(t,i){if(!t)return;let e={},n=c$1(t,"w","jc");if(n){let y=f(n,"w","val");y&&(e.alignment=y);}let s=c$1(t,"w","bidi");s&&(e.bidi=h(s));let o=c$1(t,"w","spacing");if(o){let y=g(o,"w","before");y!==void 0&&(e.spaceBefore=y);let x=g(o,"w","after");x!==void 0&&(e.spaceAfter=x);let T=g(o,"w","line");T!==void 0&&(e.lineSpacing=T);let X=f(o,"w","lineRule");X&&(e.lineSpacingRule=X);let L=f(o,"w","beforeAutospacing");L&&(e.beforeAutospacing=L==="1"||L==="true");let I=f(o,"w","afterAutospacing");I&&(e.afterAutospacing=I==="1"||I==="true");}let a=c$1(t,"w","ind");if(a){let y=g(a,"w","left");y!==void 0&&(e.indentLeft=y);let x=g(a,"w","right");x!==void 0&&(e.indentRight=x);let T=g(a,"w","firstLine");T!==void 0&&(e.indentFirstLine=T);let X=g(a,"w","hanging");X!==void 0&&(e.indentFirstLine=-X,e.hangingIndent=true);}let c=c$1(t,"w","pBdr");if(c){let y={},x=B(c$1(c,"w","top"));x&&(y.top=x);let T=B(c$1(c,"w","bottom"));T&&(y.bottom=T);let X=B(c$1(c,"w","left"));X&&(y.left=X);let L=B(c$1(c,"w","right"));L&&(y.right=L);let I=B(c$1(c,"w","between"));I&&(y.between=I);let k=B(c$1(c,"w","bar"));k&&(y.bar=k),Object.keys(y).length>0&&(e.borders=y);}let d=c$1(t,"w","shd");d&&(e.shading=q(d));let u=c$1(t,"w","tabs");u&&(e.tabs=Me(u));let m=c$1(t,"w","keepNext");m&&(e.keepNext=h(m));let w=c$1(t,"w","keepLines");w&&(e.keepLines=h(w));let p=c$1(t,"w","widowControl");p&&(e.widowControl=h(p));let v=c$1(t,"w","pageBreakBefore");v&&(e.pageBreakBefore=h(v));let f$1=c$1(t,"w","contextualSpacing");f$1&&(e.contextualSpacing=h(f$1));let h$1=c$1(t,"w","numPr");if(h$1){let y=c$1(h$1,"w","numId"),x=c$1(h$1,"w","ilvl");if(y||x){if(e.numPr={},y){let T=g(y,"w","val");T!==void 0&&(e.numPr.numId=T);}if(x){let T=g(x,"w","val");T!==void 0&&(e.numPr.ilvl=T);}}}let C=c$1(t,"w","outlineLvl");if(C){let y=g(C,"w","val");y!==void 0&&(e.outlineLevel=y);}let M=c$1(t,"w","pStyle");if(M){let y=f(M,"w","val");y&&(e.styleId=y);}let D=c$1(t,"w","suppressLineNumbers");D&&(e.suppressLineNumbers=h(D));let N=c$1(t,"w","suppressAutoHyphens");N&&(e.suppressAutoHyphens=h(N));let F=c$1(t,"w","rPr");return F&&(e.runProperties=J(F,i)),Object.keys(e).length>0?e:void 0}function H(t){if(!t)return;let i=g(t,"w","w"),e=f(t,"w","type");if(i!==void 0&&e)return {value:i,type:e}}function ve(t){if(!t)return;let i={},e=B(c$1(t,"w","top"));e&&(i.top=e);let n=B(c$1(t,"w","bottom"));n&&(i.bottom=n);let s=B(c$1(t,"w","left"));s&&(i.left=s);let o=B(c$1(t,"w","right"));o&&(i.right=o);let a=B(c$1(t,"w","insideH"));a&&(i.insideH=a);let c=B(c$1(t,"w","insideV"));return c&&(i.insideV=c),Object.keys(i).length>0?i:void 0}function Se(t){if(!t)return;let i={},e=H(c$1(t,"w","top"));e&&(i.top=e);let n=H(c$1(t,"w","bottom"));n&&(i.bottom=n);let s=H(c$1(t,"w","left"));s&&(i.left=s);let o=H(c$1(t,"w","right"));return o&&(i.right=o),Object.keys(i).length>0?i:void 0}function Xe(t){if(!t)return;let i={},e=f(t,"w","val");if(e){let u=parseInt(e,16);isNaN(u)||(i.firstRow=(u&32)!==0,i.lastRow=(u&64)!==0,i.firstColumn=(u&128)!==0,i.lastColumn=(u&256)!==0,i.noHBand=(u&512)!==0,i.noVBand=(u&1024)!==0);}let n=f(t,"w","firstColumn");n&&(i.firstColumn=n==="1");let s=f(t,"w","firstRow");s&&(i.firstRow=s==="1");let o=f(t,"w","lastColumn");o&&(i.lastColumn=o==="1");let a=f(t,"w","lastRow");a&&(i.lastRow=a==="1");let c=f(t,"w","noHBand");c&&(i.noHBand=c==="1");let d=f(t,"w","noVBand");return d&&(i.noVBand=d==="1"),Object.keys(i).length>0?i:void 0}function he(t,i){if(!t)return;let e={},n=c$1(t,"w","tblW");n&&(e.width=H(n));let s=c$1(t,"w","jc");if(s){let f$1=f(s,"w","val");(f$1==="left"||f$1==="center"||f$1==="right")&&(e.justification=f$1);}let o=c$1(t,"w","tblCellSpacing");o&&(e.cellSpacing=H(o));let a=c$1(t,"w","tblInd");a&&(e.indent=H(a));let c=c$1(t,"w","tblBorders");c&&(e.borders=ve(c));let d=c$1(t,"w","tblCellMar");d&&(e.cellMargins=Se(d));let u=c$1(t,"w","tblLayout");if(u){let f$1=f(u,"w","type");(f$1==="fixed"||f$1==="autofit")&&(e.layout=f$1);}let m=c$1(t,"w","tblStyle");if(m){let f$1=f(m,"w","val");f$1&&(e.styleId=f$1);}let w=c$1(t,"w","tblLook");w&&(e.look=Xe(w));let p=c$1(t,"w","shd");p&&(e.shading=q(p));let v=c$1(t,"w","bidiVisual");return v&&(e.bidi=h(v)),Object.keys(e).length>0?e:void 0}function be(t){if(!t)return;let i={},e=c$1(t,"w","trHeight");if(e){i.height=H(e);let c=f(e,"w","hRule");c&&(i.heightRule=c);}let n=c$1(t,"w","tblHeader");n&&(i.header=h(n));let s=c$1(t,"w","cantSplit");s&&(i.cantSplit=h(s));let o=c$1(t,"w","jc");if(o){let c=f(o,"w","val");(c==="left"||c==="center"||c==="right")&&(i.justification=c);}let a=c$1(t,"w","hidden");return a&&(i.hidden=h(a)),Object.keys(i).length>0?i:void 0}function ye(t,i){if(!t)return;let e={},n=c$1(t,"w","tcW");n&&(e.width=H(n));let s=c$1(t,"w","tcBorders");s&&(e.borders=ve(s));let o=c$1(t,"w","tcMar");o&&(e.margins=Se(o));let a=c$1(t,"w","shd");a&&(e.shading=q(a));let c=c$1(t,"w","vAlign");if(c){let f$1=f(c,"w","val");(f$1==="top"||f$1==="center"||f$1==="bottom")&&(e.verticalAlign=f$1);}let d=c$1(t,"w","textDirection");if(d){let f$1=f(d,"w","val");f$1&&(e.textDirection=f$1);}let u=c$1(t,"w","gridSpan");if(u){let f=g(u,"w","val");f!==void 0&&(e.gridSpan=f);}let m=c$1(t,"w","vMerge");if(m){let f$1=f(m,"w","val");e.vMerge=f$1==="restart"?"restart":"continue";}let w=c$1(t,"w","tcFitText");w&&(e.fitText=h(w));let p=c$1(t,"w","noWrap");p&&(e.noWrap=h(p));let v=c$1(t,"w","hideMark");return v&&(e.hideMark=h(v)),Object.keys(e).length>0?e:void 0}function De(t,i){let e={styleId:f(t,"w","styleId")??"",type:f(t,"w","type")??"paragraph"},n=f(t,"w","default");n&&(e.default=n==="1"||n==="true");let s=c$1(t,"w","name");s&&(e.name=f(s,"w","val")??void 0);let o=c$1(t,"w","basedOn");o&&(e.basedOn=f(o,"w","val")??void 0);let a=c$1(t,"w","next");a&&(e.next=f(a,"w","val")??void 0);let c=c$1(t,"w","link");c&&(e.link=f(c,"w","val")??void 0);let d$1=c$1(t,"w","uiPriority");if(d$1){let F=g(d$1,"w","val");F!==void 0&&(e.uiPriority=F);}let u=c$1(t,"w","hidden");u&&(e.hidden=h(u));let m=c$1(t,"w","semiHidden");m&&(e.semiHidden=h(m));let w=c$1(t,"w","unhideWhenUsed");w&&(e.unhideWhenUsed=h(w));let p=c$1(t,"w","qFormat");p&&(e.qFormat=h(p));let v=c$1(t,"w","personal");v&&(e.personal=h(v));let f$1=c$1(t,"w","pPr");f$1&&(e.pPr=te(f$1,i));let h$1=c$1(t,"w","rPr");h$1&&(e.rPr=J(h$1,i));let C=c$1(t,"w","tblPr");C&&(e.tblPr=he(C));let M=c$1(t,"w","trPr");M&&(e.trPr=be(M));let D=c$1(t,"w","tcPr");D&&(e.tcPr=ye(D));let N=d(t,"w","tblStylePr");if(N.length>0){e.tblStylePr=[];for(let F of N){let y=f(F,"w","type");if(y){let x={type:y},T=c$1(F,"w","pPr");T&&(x.pPr=te(T,i));let X=c$1(F,"w","rPr");X&&(x.rPr=J(X,i));let L=c$1(F,"w","tblPr");L&&(x.tblPr=he(L));let I=c$1(F,"w","trPr");I&&(x.trPr=be(I));let k=c$1(F,"w","tcPr");k&&(x.tcPr=ye(k)),e.tblStylePr.push(x);}}}return e}function Le(t,i){if(!t)return;let e={},n=c$1(t,"w","rPrDefault");if(n){let o=c$1(n,"w","rPr");o&&(e.rPr=J(o,i));}let s=c$1(t,"w","pPrDefault");if(s){let o=c$1(s,"w","pPr");o&&(e.pPr=te(o,i));}return e.rPr||e.pPr?e:void 0}function ke(t,i){if(!i)return t;if(!t)return i?{...i}:void 0;let e={...t};for(let n$1 of Object.keys(i)){let s=i[n$1];if(s!==void 0)if(n$1==="runProperties")e.runProperties=n(e.runProperties,i.runProperties);else if(n$1==="borders"||n$1==="numPr"||n$1==="frame"){let o=e[n$1],a=s;e[n$1]={...o||{},...a||{}};}else n$1==="tabs"&&Array.isArray(s)?e.tabs=[...s]:e[n$1]=s;}return e}function xe(t,i,e,n$1=new Set){if(n$1.has(t.styleId)||(n$1.add(t.styleId),!t.basedOn))return t;let s=i.get(t.basedOn);if(!s)return t;let o=xe(s,i,e,n$1),a={...t,pPr:ke(o.pPr,t.pPr),rPr:n(o.rPr,t.rPr)};return t.type==="table"&&((o.tblPr||t.tblPr)&&(a.tblPr={...o.tblPr||{},...t.tblPr||{}}),(o.trPr||t.trPr)&&(a.trPr={...o.trPr||{},...t.trPr||{}}),(o.tcPr||t.tcPr)&&(a.tcPr={...o.tcPr||{},...t.tcPr||{}})),a}function ne(t,i){let e=new Map;try{let n=b(t);if(!n)return e;let s=d(n,"w","style");for(let o of s){let a=De(o,i);a.styleId&&e.set(a.styleId,a);}for(let[o,a]of e){let c=xe(a,e,i);e.set(o,c);}}catch(n){console.warn("Failed to parse styles:",n);}return e}function Ce(t,i){let e={styles:[]};try{let n=b(t);if(!n)return e;let s=c$1(n,"w","docDefaults");e.docDefaults=Le(s,i);let o=c$1(n,"w","latentStyles");o&&(e.latentStyles={defLockedState:f(o,"w","defLockedState")==="1",defUIPriority:g(o,"w","defUIPriority"),defSemiHidden:f(o,"w","defSemiHidden")==="1",defUnhideWhenUsed:f(o,"w","defUnhideWhenUsed")==="1",defQFormat:f(o,"w","defQFormat")==="1",count:g(o,"w","count")});let a=ne(t,i);e.styles=Array.from(a.values());}catch(n){console.warn("Failed to parse style definitions:",n);}return e}function Fe(t){let i={abstractNums:[],nums:[]};if(!t)return ie(i);let e=b(t);if(!e)return ie(i);let n=d(e,"w","abstractNum");for(let o of n){let a=Ae(o);a&&i.abstractNums.push(a);}let s=d(e,"w","num");for(let o of s){let a=Ee(o);a&&i.nums.push(a);}return ie(i)}function Ae(t){let i=f(t,"w","abstractNumId");if(i===null)return null;let e=parseInt(i,10);if(isNaN(e))return null;let n={abstractNumId:e,levels:[]},s=c$1(t,"w","multiLevelType");if(s){let u=f(s,"w","val");(u==="hybridMultilevel"||u==="multilevel"||u==="singleLevel")&&(n.multiLevelType=u);}let o=c$1(t,"w","name");o&&(n.name=f(o,"w","val")??void 0);let a=c$1(t,"w","numStyleLink");a&&(n.numStyleLink=f(a,"w","val")??void 0);let c=c$1(t,"w","styleLink");c&&(n.styleLink=f(c,"w","val")??void 0);let d$1=d(t,"w","lvl");for(let u of d$1){let m=Te(u);m&&n.levels.push(m);}return n.levels.sort((u,m)=>u.ilvl-m.ilvl),n}function Ee(t){let i=f(t,"w","numId");if(i===null)return null;let e=parseInt(i,10);if(isNaN(e))return null;let n=c$1(t,"w","abstractNumId");if(!n)return null;let s=f(n,"w","val");if(s===null)return null;let o=parseInt(s,10);if(isNaN(o))return null;let a={numId:e,abstractNumId:o},c=d(t,"w","lvlOverride");if(c.length>0){a.levelOverrides=[];for(let d of c){let u=f(d,"w","ilvl");if(u===null)continue;let m=parseInt(u,10);if(isNaN(m))continue;let w={ilvl:m},p=c$1(d,"w","startOverride");if(p){let f$1=f(p,"w","val");if(f$1!==null){let h=parseInt(f$1,10);isNaN(h)||(w.startOverride=h);}}let v=c$1(d,"w","lvl");v&&(w.lvl=Te(v)??void 0),a.levelOverrides.push(w);}}return a}function Te(t){let i=f(t,"w","ilvl");if(i===null)return null;let e=parseInt(i,10);if(isNaN(e)||e<0||e>8)return null;let n={ilvl:e,numFmt:"decimal",lvlText:""},s=c$1(t,"w","start");if(s){let f$1=f(s,"w","val");if(f$1!==null){let h=parseInt(f$1,10);isNaN(h)||(n.start=h);}}let o=c$1(t,"w","numFmt");if(o){let f$1=f(o,"w","val");f$1&&(n.numFmt=Re(f$1));}let a=c$1(t,"w","lvlText");a&&(n.lvlText=f(a,"w","val")??"");let c=c$1(t,"w","lvlJc");if(c){let f$1=f(c,"w","val");(f$1==="left"||f$1==="center"||f$1==="right")&&(n.lvlJc=f$1);}let d=c$1(t,"w","suff");if(d){let f$1=f(d,"w","val");(f$1==="tab"||f$1==="space"||f$1==="nothing")&&(n.suffix=f$1);}let u=c$1(t,"w","isLgl");u&&(n.isLgl=h(u));let m=c$1(t,"w","lvlRestart");if(m){let f$1=f(m,"w","val");if(f$1!==null){let h=parseInt(f$1,10);isNaN(h)||(n.lvlRestart=h);}}let w=c$1(t,"w","legacy");w&&(n.legacy={legacy:h(w),legacySpace:g(w,"w","legacySpace"),legacyIndent:g(w,"w","legacyIndent")});let p=c$1(t,"w","pPr");p&&(n.pPr=Be(p));let v=c$1(t,"w","rPr");return v&&(n.rPr=He(v)),n}function Re(t){return {decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",hex:"hex",chicago:"chicago",bullet:"bullet",none:"none",decimalZero:"decimalZero",ganada:"ganada",chosung:"chosung",ideographDigital:"ideographDigital",japaneseCounting:"japaneseCounting",aiueo:"aiueo",iroha:"iroha",decimalFullWidth:"decimalFullWidth",decimalHalfWidth:"decimalHalfWidth",japaneseLegal:"japaneseLegal",japaneseDigitalTenThousand:"japaneseDigitalTenThousand",decimalEnclosedCircle:"decimalEnclosedCircle",decimalFullWidth2:"decimalFullWidth2",aiueoFullWidth:"aiueoFullWidth",irohaFullWidth:"irohaFullWidth",decimalEnclosedFullstop:"decimalEnclosedFullstop",decimalEnclosedParen:"decimalEnclosedParen",decimalEnclosedCircleChinese:"decimalEnclosedCircleChinese",ideographEnclosedCircle:"ideographEnclosedCircle",ideographTraditional:"ideographTraditional",ideographZodiac:"ideographZodiac",ideographZodiacTraditional:"ideographZodiacTraditional",taiwaneseCounting:"taiwaneseCounting",ideographLegalTraditional:"ideographLegalTraditional",taiwaneseCountingThousand:"taiwaneseCountingThousand",taiwaneseDigital:"taiwaneseDigital",chineseCounting:"chineseCounting",chineseLegalSimplified:"chineseLegalSimplified",chineseCountingThousand:"chineseCountingThousand",koreanDigital:"koreanDigital",koreanCounting:"koreanCounting",koreanLegal:"koreanLegal",koreanDigital2:"koreanDigital2",vietnameseCounting:"vietnameseCounting",russianLower:"russianLower",russianUpper:"russianUpper",numberInDash:"numberInDash",hebrew1:"hebrew1",hebrew2:"hebrew2",arabicAlpha:"arabicAlpha",arabicAbjad:"arabicAbjad",hindiVowels:"hindiVowels",hindiConsonants:"hindiConsonants",hindiNumbers:"hindiNumbers",hindiCounting:"hindiCounting",thaiLetters:"thaiLetters",thaiNumbers:"thaiNumbers",thaiCounting:"thaiCounting"}[t]??"decimal"}function Be(t){let i={},e=c$1(t,"w","ind");if(e){let s=g(e,"w","left"),o=g(e,"w","right"),a=g(e,"w","start"),c=g(e,"w","end"),d=g(e,"w","firstLine"),u=g(e,"w","hanging"),m=s??a,w=o??c;m!==void 0&&(i.indentLeft=m),w!==void 0&&(i.indentRight=w),u!==void 0?(i.indentFirstLine=-u,i.hangingIndent=true):d!==void 0&&(i.indentFirstLine=d);}let n=c$1(t,"w","tabs");if(n){i.tabs=[];let s=d(n,"w","tab");for(let o of s){let a=g(o,"w","pos"),c=f(o,"w","val"),d=f(o,"w","leader");a!==void 0&&c&&i.tabs.push({position:a,alignment:Oe(c),leader:je(d)});}}return i}function Oe(t){switch(t){case "left":return "left";case "center":return "center";case "right":return "right";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "num";default:return "left"}}function je(t){if(t)switch(t){case "none":return "none";case "dot":return "dot";case "hyphen":return "hyphen";case "underscore":return "underscore";case "heavy":return "heavy";case "middleDot":return "middleDot";default:return}}function He(t){let i={},e=c$1(t,"w","rFonts");e&&(i.fontFamily={ascii:f(e,"w","ascii")??void 0,hAnsi:f(e,"w","hAnsi")??void 0,eastAsia:f(e,"w","eastAsia")??void 0,cs:f(e,"w","cs")??void 0});let n=c$1(t,"w","sz");if(n){let d=g(n,"w","val");d!==void 0&&(i.fontSize=d);}let s=c$1(t,"w","color");if(s){let d=f(s,"w","val"),u=f(s,"w","themeColor");d==="auto"?i.color={auto:true}:u?i.color={themeColor:u,themeTint:f(s,"w","themeTint")??void 0,themeShade:f(s,"w","themeShade")??void 0}:d&&(i.color={rgb:d});}let o=c$1(t,"w","b");o&&(i.bold=h(o));let a=c$1(t,"w","i");a&&(i.italic=h(a));let c=c$1(t,"w","vanish");return c&&(i.hidden=h(c)),i}function ie(t){let i=new Map;for(let n of t.abstractNums)i.set(n.abstractNumId,n);let e=new Map;for(let n of t.nums)e.set(n.numId,n);return {definitions:t,getLevel(n,s){let o=e.get(n);if(!o)return null;if(o.levelOverrides){let c=o.levelOverrides.find(d=>d.ilvl===s);if(c){if(c.lvl)return c.lvl;let d=i.get(o.abstractNumId);if(d){let u=d.levels.find(m=>m.ilvl===s);if(u&&c.startOverride!==void 0)return {...u,start:c.startOverride}}}}let a=i.get(o.abstractNumId);if(!a)return null;if(a.numStyleLink&&a.levels.length===0){for(let c of i.values())if(c.styleLink===a.numStyleLink&&c.levels.length>0){a=c;break}}return a.levels.find(c=>c.ilvl===s)??null},getAbstract(n){return i.get(n)??null},getInstance(n){return e.get(n)??null},hasNumbering(n){return e.has(n)}}}function Ue(t){let i=new Map,e$1=a$2(t);if(!e$1)return i;let n=c$1(e$1,"w16cex","commentsExtensible")??e$1;for(let s of e(n)){if((s.name?.replace(/^.*:/,"")??"")!=="comment")continue;let a=f(s,"w16cex","paraId")??f(s,"w15","paraId")??s.attributes?.["w16cex:paraId"]??s.attributes?.["w15:paraId"],c=f(s,"w16cex","dateUtc")??f(s,"w15","dateUtc")??s.attributes?.["w16cex:dateUtc"]??s.attributes?.["w15:dateUtc"];a&&c&&i.set(String(a).toUpperCase(),String(c));}return i}function Ve(t){let i=new Map,e$1=new Map,n=a$2(t);if(!n)return {parentByParaId:i,doneByParaId:e$1};let s=c$1(n,"w15","commentsEx")??n;for(let o of e(s)){if((o.name?.replace(/^.*:/,"")??"")!=="commentEx")continue;let c=f(o,"w15","paraId")??o.attributes?.["w15:paraId"],d=f(o,"w15","paraIdParent")??o.attributes?.["w15:paraIdParent"],u=f(o,"w15","done")??o.attributes?.["w15:done"];if(c){let m=String(c).toUpperCase();d&&i.set(m,String(d).toUpperCase()),u==="1"&&e$1.set(m,true);}}return {parentByParaId:i,doneByParaId:e$1}}function Pe(t$1,i,e$1,n,s,o,a){if(!t$1)return [];let c=a$2(t$1);if(!c)return [];let d=o?Ue(o):new Map,u=a?Ve(a):null,m=c$1(c,"w","comments")??c,w=e(m),p=[],v=[];for(let f$1 of w){if((f$1.name?.replace(/^.*:/,"")??"")!=="comment")continue;let C=parseInt(f(f$1,"w","id")??"0",10),M=f(f$1,"w","author")??"Unknown",D=f(f$1,"w","initials"),N=D!=null?String(D):void 0,F=f(f$1,"w","date"),y=F!=null?String(F):void 0,x=f(f$1,"w14","paraId")??f$1.attributes?.["w14:paraId"]??f(f$1,"w","paraId"),X=(x?d.get(String(x).toUpperCase()):void 0)??y,L=f(f$1,"w","done")??f$1.attributes?.["w:done"],I=L==="1"||L==="true"?true:void 0,k=f(f$1,"w16cid","parentId")??f(f$1,"w","parentId")??f$1.attributes?.["w16cid:parentId"]??f$1.attributes?.["w:parentId"],U=k!=null?parseInt(String(k),10):void 0,V=[],O="";for(let P of e(f$1))if((P.name?.replace(/^.*:/,"")??"")==="p"){let g=t(P,i,e$1,null,n,s);V.push(g);let E=f(P,"w14","paraId")??P.attributes?.["w14:paraId"];E&&(O=String(E).toUpperCase());}I==null&&u&&O&&u.doneByParaId.get(O)&&(I=true),v.push(O),p.push({id:C,author:M,initials:N,date:X,content:V,...I!=null?{done:I}:{},...U!=null&&!isNaN(U)?{parentId:U}:{}});}if(u&&u.parentByParaId.size>0){let f=new Map;for(let h=0;h<p.length;h++){let C=v[h];C&&f.set(C,p[h].id);}for(let h=0;h<p.length;h++){if(p[h].parentId!=null)continue;let C=v[h];if(!C)continue;let M=u.parentByParaId.get(C);if(!M)continue;let D=f.get(M);D!=null&&(p[h]={...p[h],parentId:D});}}return p}async function pt(t,i={}){let e=t instanceof ArrayBuffer?t:await a$1(t),{onProgress:n=()=>{},preloadFonts:s=true,parseHeadersFooters:o=true,parseNotes:a=true,detectVariables:c=true}=i,d=[];try{let p=function(P,R){let g=performance.now(),E=R(),A=performance.now()-g;return w$1.push({stage:P,ms:A}),A>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(A)}ms`),E};var u=p;let m=performance.now(),w$1=[];async function v$1(P,R){let g=performance.now(),E=await R(),A=performance.now()-g;return w$1.push({stage:P,ms:A}),A>1e3&&console.warn(`[parseDocx] ${P} took ${Math.round(A)}ms`),E}n("Extracting DOCX...",0);let f=await v$1("unzip",()=>ge(e));n("Extracted DOCX",10),n("Parsing relationships...",10);let h=p("relationships",()=>f.documentRels?j(f.documentRels):new Map);n("Parsed relationships",15),n("Parsing theme...",15);let C=p("theme",()=>k(f.themeXml));n("Parsed theme",20),n("Parsing styles...",20);let M=null,D;p("styles",()=>{f.stylesXml&&(M=ne(f.stylesXml,C),D=Ce(f.stylesXml,C));}),n("Parsed styles",30),n("Parsing numbering...",30);let N=p("numbering",()=>Fe(f.numberingXml));n("Parsed numbering",35),n("Processing media files...",35);let F=p("media",()=>We(f,h));n("Processed media",40),n("Parsing document body...",40);let y={content:[]};p("documentBody",()=>{f.documentXml?y=w(f.documentXml,M,C,N,h,F):d.push("No document.xml found in DOCX");}),n("Parsed document body",55);let x,T;if(o){n("Parsing headers/footers...",55);let P=p("headersFooters",()=>ze(f,M,C,N,h,F));x=P.headers,T=P.footers,n("Parsed headers/footers",65);}else n("Skipping headers/footers",65);let X,L;if(a){n("Parsing footnotes/endnotes...",65);let P=p("footnotesEndnotes",()=>$e(f,M,C,N,h,F));X=P.footnotes,L=P.endnotes,n("Parsed footnotes/endnotes",75);}else n("Skipping footnotes/endnotes",75);n("Parsing comments...",75);let I=p("comments",()=>Pe(f.commentsXml,M,C,h,F,f.commentsExtensibleXml,f.commentsExtendedXml));I.length>0&&(y.comments=I);let k$1;c?(n("Detecting template variables...",75),k$1=p("variables",()=>v(y.content)),n("Detected variables",80)):n("Skipping variable detection",80),s?(n("Loading fonts...",80),await v$1("fonts",()=>Ze(C,D,y)),n("Loaded fonts",95)):n("Skipping font loading",95),n("Assembling document...",95);let V={package:{document:y,styles:D,theme:C,numbering:N.definitions,headers:x,footers:T,footnotes:X,endnotes:L,relationships:h,media:F},originalBuffer:e,templateVariables:k$1,warnings:d.length>0?d:void 0},O=performance.now()-m;if(O>2e3){let P=w$1.filter(R=>R.ms>100).map(R=>`${R.stage}: ${Math.round(R.ms)}ms`).join(", ");console.warn(`[parseDocx] Total: ${Math.round(O)}ms`+(P?` (${P})`:""));}return n("Complete",100),V}catch(m){let w=m instanceof Error?m.message:String(m);throw console.error("[parseDocx] Failed to parse DOCX:",w,m),new Error(`Failed to parse DOCX: ${w}`)}}function We(t,i){let e=new Map;for(let[n,s]of t.media.entries()){let o=n.split("/").pop()||n,a=we(n),c=new Uint8Array(s),d="";for(let v=0;v<c.length;v++)d+=String.fromCharCode(c[v]);let u=btoa(d),m=`data:${a};base64,${u}`,w={path:n,filename:o,mimeType:a,data:s,dataUrl:m};e.set(n,w);let p=n.replace(/^word\//,"");p!==n&&e.set(p,w);}return e}function Q(t,i){let e=i.toLowerCase();for(let[n,s]of t.entries())if(n.toLowerCase()===e)return s}function ze(t,i$1,e,n,s,o$1){let a=new Map,c=new Map;for(let[d,u]of s.entries())if(u.type===i.header&&u.target){let m=u.target.split("/").pop()||u.target,w=Q(t.headers,m);if(w){let p=`word/_rels/${m}.rels`,v=Q(t.allXml,p),f=v?j(v):s,h=o(w,"default",i$1,e,n,f,o$1);a.set(d,h);}}else if(u.type===i.footer&&u.target){let m=u.target.split("/").pop()||u.target,w=Q(t.footers,m);if(w){let p$1=`word/_rels/${m}.rels`,v=Q(t.allXml,p$1),f=v?j(v):s,h=p(w,"default",i$1,e,n,f,o$1);c.set(d,h);}}return {headers:a,footers:c}}function $e(t,i,e,n,s,o){let a=q$1(t.footnotesXml,i,e,n,s,o),c=r(t.endnotesXml,i,e,n,s,o);return {footnotes:a.getNormalFootnotes(),endnotes:c.getNormalEndnotes()}}async function Ze(t,i,e){let n=new Set;if(t?.fontScheme){let{majorFont:s,minorFont:o}=t.fontScheme;s?.latin&&n.add(s.latin),o?.latin&&n.add(o.latin);}if(i?.docDefaults?.rPr?.fontFamily?.ascii&&n.add(i.docDefaults.rPr.fontFamily.ascii),i?.styles)for(let s of i.styles)s.rPr?.fontFamily?.ascii&&n.add(s.rPr.fontFamily.ascii),s.rPr?.fontFamily?.hAnsi&&n.add(s.rPr.fontFamily.hAnsi);if(e.content){for(let s of e.content)if(s.type==="paragraph")for(let o of s.content)o.type==="run"&&o.formatting?.fontFamily&&(o.formatting.fontFamily.ascii&&n.add(o.formatting.fontFamily.ascii),o.formatting.fontFamily.hAnsi&&n.add(o.formatting.fontFamily.hAnsi));}if(n.size>0)try{await j$1(Array.from(n));}catch(s){console.warn("Failed to load some fonts:",s);}}
2
- export{pt as a};
@@ -1,4 +0,0 @@
1
- function u(e){let t=[];for(let n of e.content)n.type==="run"?t.push(p(n)):n.type==="hyperlink"&&t.push(l(n));return t.join("")}function p(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}function l(e){let t=[];for(let n of e.children)n.type==="run"&&t.push(p(n));return t.join("")}function h(e){let t=[];for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&t.push(u(o));return t.join(" ")}function m(e){let t=[];for(let n of e.content)n.type==="paragraph"?t.push(u(n)):n.type==="table"&&t.push(h(n));return t.join(`
2
- `)}function g(e){return e.split(/\s+/).filter(n=>n.length>0).length}function b(e,t=true){return t?e.length:e.replace(/\s/g,"").length}function k(e){let t=0;for(let n of e.content)n.type==="paragraph"?t+=g(u(n)):n.type==="table"&&(t+=x(n));return t}function x(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&(t+=g(u(o)));return t}function P(e){let t=0;for(let n of e.content)n.type==="paragraph"?t+=u(n).length:n.type==="table"&&(t+=y(n));return t}function y(e){let t=0;for(let n of e.rows)for(let r of n.cells)for(let o of r.content)o.type==="paragraph"&&(t+=u(o).length);return t}function T(e,t,n){let r=[],o=0,c=e[t.paragraphIndex];if(c){let a=u(c).slice(0,t.offset);r.unshift(a),o+=a.length;}for(let f=t.paragraphIndex-1;f>=0&&o<n;f--){let a=e[f];if(!a)continue;let s=u(a);r.unshift(s),o+=s.length;}let i=r.join(`
3
- `);return i.length>n?"..."+i.slice(-n):i}function B(e,t,n){let r=[],o=0,c=e[t.paragraphIndex];if(c){let a=u(c).slice(t.offset);r.push(a),o+=a.length;}for(let f=t.paragraphIndex+1;f<e.length&&o<n;f++){let a=e[f];if(!a)continue;let s=u(a);r.push(s),o+=s.length;}let i=r.join(`
4
- `);return i.length>n?i.slice(0,n)+"...":i}function w(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=p(r),c=n+o.length;if(t>=n&&t<c)return r.formatting||{};n=c;}else if(r.type==="hyperlink"){let o=l(r),c=n+o.length;if(t>=n&&t<c){for(let i of r.children)if(i.type==="run")return i.formatting||{}}n=c;}return {}}function D(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=p(r);n+=o.length;}else if(r.type==="hyperlink"){let o=l(r),c=n,i=n+o.length;if(t>=c&&t<i)return true;n=i;}return false}function H(e,t){let n=0;for(let r of e.content)if(r.type==="run"){let o=p(r);n+=o.length;}else if(r.type==="hyperlink"){let o=l(r),c=n,i=n+o.length;if(t>=c&&t<i)return r;n=i;}}function I(e){return e?e.toLowerCase().includes("heading"):false}function j(e){if(!e)return;let t=e.match(/heading\s*(\d)/i);if(t)return parseInt(t[1],10)}function C(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="run"){for(let r of n.content)if(r.type==="drawing")return true}}return false}function A(e){for(let t of e.content)if(t.type==="paragraph"){for(let n of t.content)if(n.type==="hyperlink")return true}return false}function E(e){return e.content.some(t=>t.type==="table")}function d(e){return e.content.filter(t=>t.type==="paragraph")}function F(e,t){return d(e)[t]}function O(e,t){let n=0;for(let r=0;r<e.content.length;r++)if(e.content[r].type==="paragraph"){if(n===t)return r;n++;}return -1}export{u as a,p as b,l as c,h as d,m as e,g as f,b as g,k as h,P as i,T as j,B as k,w as l,D as m,H as n,I as o,j as p,C as q,A as r,E as s,d as t,F as u,O as v};
@@ -1 +0,0 @@
1
- 'use strict';var chunkH5NTJZO4_js=require('./chunk-H5NTJZO4.js');function B(n,t){if(!t||!t.trim())return null;let e=null;return n.descendants((o,r)=>e!==null?false:o.attrs?.paraId===t&&o.isTextblock?(e=r,false):true),e}function O(n,t){if(!t||!t.trim())return null;let e=null;return n.descendants((o,r)=>e!==null?false:o.isTextblock&&o.attrs?.paraId===t?(e={node:o,from:r,to:r+o.nodeSize},false):true),e}var l=class{constructor(t){chunkH5NTJZO4_js.d(this,"listeners",new Set);chunkH5NTJZO4_js.d(this,"snapshot");chunkH5NTJZO4_js.d(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t);}));chunkH5NTJZO4_js.d(this,"getSnapshot",()=>this.snapshot);this.snapshot=t;}setSnapshot(t){this.snapshot=t,this.notify();}notify(){for(let t of this.listeners)t();}};var T="docx-editor-autosave",H=3e4,V=1440*60*1e3,U=2e3,C=1;function E(){try{let n="__docx_editor_test__";return localStorage.setItem(n,"test"),localStorage.removeItem(n),!0}catch{return false}}function x(n){return JSON.stringify({...n,originalBuffer:null})}function $(n){try{let t=JSON.parse(n);return !t||typeof t!="object"||!t.document||!t.savedAt?null:(t.version!==C&&console.warn("Auto-save data version mismatch, may need migration"),t)}catch{return null}}function J(n,t){let e=new Date(n).getTime();return Date.now()-e>t}var d=class extends l{constructor(e={}){super({status:"idle",lastSaveTime:null,hasRecoveryData:false,isEnabled:true});chunkH5NTJZO4_js.d(this,"storageKey");chunkH5NTJZO4_js.d(this,"interval");chunkH5NTJZO4_js.d(this,"maxAge");chunkH5NTJZO4_js.d(this,"saveOnChange");chunkH5NTJZO4_js.d(this,"debounceDelay");chunkH5NTJZO4_js.d(this,"onSaveCallback");chunkH5NTJZO4_js.d(this,"onErrorCallback");chunkH5NTJZO4_js.d(this,"onRecoveryAvailableCallback");chunkH5NTJZO4_js.d(this,"storageAvailable");chunkH5NTJZO4_js.d(this,"currentDocument",null);chunkH5NTJZO4_js.d(this,"lastSavedJson",null);chunkH5NTJZO4_js.d(this,"intervalTimer",null);chunkH5NTJZO4_js.d(this,"debounceTimer",null);chunkH5NTJZO4_js.d(this,"status","idle");chunkH5NTJZO4_js.d(this,"lastSaveTime",null);chunkH5NTJZO4_js.d(this,"_hasRecoveryData",false);chunkH5NTJZO4_js.d(this,"_isEnabled");this.storageKey=e.storageKey??T,this.interval=e.interval??H,this.maxAge=e.maxAge??V,this.saveOnChange=e.saveOnChange??true,this.debounceDelay=e.debounceDelay??U,this.onSaveCallback=e.onSave,this.onErrorCallback=e.onError,this.onRecoveryAvailableCallback=e.onRecoveryAvailable,this._isEnabled=true,this.storageAvailable=E(),this.checkRecoveryData();}onDocumentChanged(e){this.currentDocument=e,this._isEnabled&&this.saveOnChange&&e&&this.storageAvailable&&this.debounceSave();}async save(){if(!this.storageAvailable)return this.onErrorCallback?.(new Error("localStorage is not available")),false;let e=this.currentDocument;if(!e)return false;this.updateStatus("saving");try{let o=x(e);if(o===this.lastSavedJson)return this.updateStatus("saved"),!0;this.persistToStorage(o),this.lastSavedJson=o;let r=new Date;return this.lastSaveTime=r,this.updateStatus("saved"),this.onSaveCallback?.(r),!0}catch(o){return console.error("Auto-save failed:",o),this.updateStatus("error"),this.onErrorCallback?.(o),false}}clear(){if(this.storageAvailable)try{localStorage.removeItem(this.storageKey),this._hasRecoveryData=!1,this.lastSavedJson=null,this.emitSnapshot();}catch(e){console.error("Failed to clear auto-save:",e);}}getRecoveryData(){if(!this.storageAvailable)return null;try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let o=$(e);return o?J(o.savedAt,this.maxAge)?(this.clear(),null):o:null}catch{return null}}acceptRecovery(){let e=this.getRecoveryData();return e?(this._hasRecoveryData=false,this.emitSnapshot(),e.document):null}dismissRecovery(){this.clear(),this._hasRecoveryData=false,this.emitSnapshot();}enable(){this._isEnabled=true,this.startInterval(),this.emitSnapshot();}disable(){this._isEnabled=false,this.stopTimers(),this.emitSnapshot();}startInterval(){this.stopTimers(),!(!this._isEnabled||!this.storageAvailable)&&(this.intervalTimer=setInterval(()=>{this.save();},this.interval));}destroy(){if(this.stopTimers(),this._isEnabled&&this.currentDocument&&this.storageAvailable)try{this.persistToStorage(x(this.currentDocument));}catch(e){console.error("Failed to save on destroy:",e);}}checkRecoveryData(){if(!this.storageAvailable)return;let e=this.getRecoveryData();e&&(this._hasRecoveryData=true,this.emitSnapshot(),this.onRecoveryAvailableCallback?.(e));}persistToStorage(e){let o={document:JSON.parse(e),savedAt:new Date().toISOString(),version:C};localStorage.setItem(this.storageKey,JSON.stringify(o));}debounceSave(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.save();},this.debounceDelay);}stopTimers(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null),this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null);}updateStatus(e){this.status=e,this.emitSnapshot();}emitSnapshot(){this.setSnapshot({status:this.status,lastSaveTime:this.lastSaveTime,hasRecoveryData:this._hasRecoveryData,isEnabled:this._isEnabled});}};function D(n){if(!n)return "Never";let e=new Date().getTime()-n.getTime(),o=Math.floor(e/1e3),r=Math.floor(o/60),a=Math.floor(r/60);return o<10?"Just now":o<60?`${o} seconds ago`:r<60?`${r} minute${r===1?"":"s"} ago`:a<24?`${a} hour${a===1?"":"s"} ago`:n.toLocaleDateString()}function R(n){return {idle:"Ready",saving:"Saving...",saved:"Saved",error:"Save failed"}[n]}function I(n=T){try{let t=localStorage.getItem(n);return t?new Blob([t]).size:0}catch{return 0}}function _(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function A(){return E()}var m={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function P(n,t){if(!(n instanceof Element))return null;let e=n;for(;e&&e!==t;){if(e.tagName==="TD"||e.tagName==="TH"){let o=e.getAttribute(m.ROW_INDEX),r=e.getAttribute(m.COLUMN_INDEX);if(o!==null&&r!==null){let a=e;for(;a&&a!==t;){if(a.tagName==="TABLE"){let s=a.getAttribute(m.TABLE_INDEX);if(s!==null)return {tableIndex:parseInt(s,10),rowIndex:parseInt(o,10),columnIndex:parseInt(r,10)};break}a=a.parentElement;}}break}e=e.parentElement;}return null}function L(n,t){if(!n.package?.document?.content)return null;let e=0;for(let o of n.package.document.content)if(o.type==="table"){if(e===t)return o;e++;}return null}function k(n,t,e){if(!n.package?.document?.content)return n;let o=0,r=n.package.document.content.map(a=>{if(a.type==="table"){if(o===t)return o++,e;o++;}return a});return {...n,package:{...n.package,document:{...n.package.document,content:r}}}}function F(n,t){if(!n.package?.document?.content)return n;let e=0,o=n.package.document.content.filter(r=>{if(r.type==="table"){let a=e===t;return e++,!a}return true});return {...n,package:{...n.package,document:{...n.package.document,content:o}}}}var p=class extends l{constructor(){super({selectedCell:null});}selectCell(t){this.setSnapshot({selectedCell:t});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(t,e,o){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===t&&r.rowIndex===e&&r.columnIndex===o:false}getSelectedCell(){return this.getSnapshot().selectedCell}};function M(n){if(!n||n==="transparent"||n==="inherit")return null;if(n.startsWith("#"))return n.slice(1).toUpperCase();let t=n.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let e=parseInt(t[1]).toString(16).padStart(2,"0"),o=parseInt(t[2]).toString(16).padStart(2,"0"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (e+o+r).toUpperCase()}return null}function v(n){let t=window.getComputedStyle(n),e={};(t.fontWeight==="bold"||parseInt(t.fontWeight)>=700)&&(e.bold=true),t.fontStyle==="italic"&&(e.italic=true);let o=t.textDecoration||t.textDecorationLine;o&&o.includes("underline")&&(e.underline={style:"single"}),o&&o.includes("line-through")&&(e.strike=true);let r=parseFloat(t.fontSize);!isNaN(r)&&r>0&&(e.fontSize=Math.round(r/1.333*2));let a=t.fontFamily.replace(/["']/g,"").split(",")[0].trim();a&&(e.fontFamily={ascii:a});let s=t.color;if(s&&s!=="rgb(0, 0, 0)"){let c=M(s);c&&(e.color={rgb:c});}let u=t.backgroundColor;if(u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"){let c=y(u);c&&(e.shading={fill:{rgb:c}});}return Object.keys(e).length>0?e:void 0}function W(n,t){let e=document.createRange();e.selectNodeContents(n);let o=t.compareBoundaryPoints(Range.START_TO_START,e)>=0&&t.compareBoundaryPoints(Range.START_TO_END,e)<=0,r=t.compareBoundaryPoints(Range.END_TO_START,e)>=0&&t.compareBoundaryPoints(Range.END_TO_END,e)<=0;if(o&&r)return t.toString();if(o){let a=document.createRange();return a.setStart(t.startContainer,t.startOffset),a.selectNodeContents(n),a.setEnd(e.endContainer,e.endOffset),a.toString()}else if(r){let a=document.createRange();return a.selectNodeContents(n),a.setEnd(t.endContainer,t.endOffset),a.setStart(e.startContainer,e.startOffset),a.toString()}else if(t.intersectsNode(n))return n.textContent||"";return ""}function N(n){let t=n;for(;t;){if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(e.hasAttribute("data-paragraph-index"))return e}t=t.parentNode;}return null}function b(){let n=window.getSelection();if(!n||n.isCollapsed)return [];let t=[],e=n.getRangeAt(0),o=e.commonAncestorContainer,r=o.nodeType===Node.ELEMENT_NODE?o:o.parentElement;if(!r)return t;if(r.querySelectorAll(".docx-run").forEach(s=>{if(e.intersectsNode(s)){let u=W(s,e);if(u){let c=v(s);t.push({type:"run",formatting:c,content:[{type:"text",text:u}]});}}}),t.length===0){let s=n.toString();s&&t.push({type:"run",content:[{type:"text",text:s}]});}return t}function z(){let n=window.getSelection();if(!n||n.isCollapsed)return null;let t=b();if(t.length===0)return null;let e=n.toString(),o=n.getRangeAt(0),r=N(o.startContainer),a=N(o.endContainer),s=r?parseInt(r.getAttribute("data-paragraph-index")||"0",10):0,u=a?parseInt(a.getAttribute("data-paragraph-index")||"0",10):0;return {text:e,runs:t,startParagraphIndex:s,startRunIndex:0,startOffset:o.startOffset,endParagraphIndex:u,endRunIndex:0,endOffset:o.endOffset,isMultiParagraph:s!==u}}var y=M;var h=class extends l{constructor(){super({notifications:[]});chunkH5NTJZO4_js.d(this,"notifications",[]);chunkH5NTJZO4_js.d(this,"idCounter",0);chunkH5NTJZO4_js.d(this,"timers",new Set);}showError(e,o){return this.addNotification(e,"error",o)}showWarning(e,o){return this.addNotification(e,"warning",o)}showInfo(e,o){return this.addNotification(e,"info",o)}dismiss(e){this.notifications=this.notifications.map(r=>r.id===e?{...r,dismissed:true}:r),this.emitSnapshot();let o=setTimeout(()=>{this.timers.delete(o),this.notifications=this.notifications.filter(r=>r.id!==e),this.emitSnapshot();},300);this.timers.add(o);}clearAll(){this.notifications=[];for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.emitSnapshot();}destroy(){for(let e of this.timers)clearTimeout(e);this.timers.clear(),this.notifications=[];}addNotification(e,o,r){let a=`error-${++this.idCounter}-${Date.now()}`,s={id:a,message:e,severity:o,details:r,timestamp:Date.now()};if(this.notifications=[...this.notifications,s],this.emitSnapshot(),o!=="error"){let u=setTimeout(()=>{this.timers.delete(u),this.dismiss(a);},5e3);this.timers.add(u);}return a}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};function w(n,t){let e=`plugin-styles-${n}`,o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=t,document.head.appendChild(r),()=>{let a=document.getElementById(e);a&&a.remove();}}var g=class extends l{constructor(){super({states:new Map,version:0});chunkH5NTJZO4_js.d(this,"plugins",[]);chunkH5NTJZO4_js.d(this,"pluginStates",new Map);chunkH5NTJZO4_js.d(this,"version",0);}initialize(e,o){this.destroyPlugins(),this.plugins=e;for(let r of e)r.initialize&&!this.pluginStates.has(r.id)&&this.pluginStates.set(r.id,r.initialize(o));this.emitSnapshot();}updateStates(e){let o=false;for(let r of this.plugins)if(r.onStateChange){let a=r.onStateChange(e);a!==void 0&&(this.pluginStates.set(r.id,a),o=true);}return o&&(this.version++,this.emitSnapshot()),o}getPluginState(e){return this.pluginStates.get(e)}setPluginState(e,o){this.pluginStates.set(e,o),this.version++,this.emitSnapshot();}destroy(){this.destroyPlugins(),this.emitSnapshot();}destroyPlugins(){for(let e of this.plugins)e.destroy&&e.destroy();this.pluginStates.clear(),this.plugins=[];}emitSnapshot(){this.setSnapshot({states:new Map(this.pluginStates),version:this.version});}};var f=class extends l{constructor(){super({hasLayout:false,selectionRects:[],caretPosition:null,selectedImageInfo:null,isFocused:false,isDragging:false,isResizingColumn:false,isImageInteracting:false,version:0});chunkH5NTJZO4_js.d(this,"_hasLayout",false);chunkH5NTJZO4_js.d(this,"_selectionRects",[]);chunkH5NTJZO4_js.d(this,"_caretPosition",null);chunkH5NTJZO4_js.d(this,"_isDragging",false);chunkH5NTJZO4_js.d(this,"_dragAnchor",null);chunkH5NTJZO4_js.d(this,"_columnResize",{isResizing:false,startX:0,columnIndex:0,tablePmStart:0,originalWidths:{left:0,right:0}});chunkH5NTJZO4_js.d(this,"_selectedImageInfo",null);chunkH5NTJZO4_js.d(this,"_isImageInteracting",false);chunkH5NTJZO4_js.d(this,"_isFocused",false);chunkH5NTJZO4_js.d(this,"_version",0);}setLayoutReady(e){this._hasLayout=e,this.emitSnapshot();}updateSelection(e,o){this._selectionRects=e,this._caretPosition=o,this.emitSnapshot();}startDrag(e){this._isDragging=true,this._dragAnchor=e,this.emitSnapshot();}endDrag(){this._isDragging=false,this._dragAnchor=null,this.emitSnapshot();}getDragAnchor(){return this._dragAnchor}startColumnResize(e,o,r,a){this._columnResize={isResizing:true,startX:r,columnIndex:o,tablePmStart:e,originalWidths:a},this.emitSnapshot();}endColumnResize(){this._columnResize={...this._columnResize,isResizing:false},this.emitSnapshot();}getColumnResize(){return this._columnResize}setSelectedImage(e){this._selectedImageInfo=e,this.emitSnapshot();}clearSelectedImage(){this._selectedImageInfo=null,this._isImageInteracting=false,this.emitSnapshot();}setImageInteracting(e){this._isImageInteracting=e,this.emitSnapshot();}setFocused(e){this._isFocused=e,this.emitSnapshot();}emitSnapshot(){this._version++,this.setSnapshot({hasLayout:this._hasLayout,selectionRects:this._selectionRects,caretPosition:this._caretPosition,selectedImageInfo:this._selectedImageInfo,isFocused:this._isFocused,isDragging:this._isDragging,isResizingColumn:this._columnResize.isResizing,isImageInteracting:this._isImageInteracting,version:this._version});}};var S=class extends l{constructor(e={}){let o=e.initialZoom??1;super({loadingState:"idle",parseError:null,isReady:false,zoom:o,fontsLoaded:false,version:0});chunkH5NTJZO4_js.d(this,"_loadingState","idle");chunkH5NTJZO4_js.d(this,"_parseError",null);chunkH5NTJZO4_js.d(this,"_zoom");chunkH5NTJZO4_js.d(this,"_fontsLoaded",false);chunkH5NTJZO4_js.d(this,"_document",null);chunkH5NTJZO4_js.d(this,"_version",0);chunkH5NTJZO4_js.d(this,"onChangeCallback");chunkH5NTJZO4_js.d(this,"onErrorCallback");this._zoom=o,this.onChangeCallback=e.onChange,this.onErrorCallback=e.onError;}setParsingStarted(){this._loadingState="parsing",this._parseError=null,this.emitSnapshot();}setDocumentLoaded(e){this._document=e,this._loadingState="loading-fonts",this._parseError=null,this.emitSnapshot();}setFontsLoaded(){this._fontsLoaded=true,this._loadingState="ready",this.emitSnapshot();}setLoadError(e){this._loadingState="error",this._parseError=e.message,this.onErrorCallback?.(e),this.emitSnapshot();}getDocument(){return this._document}updateDocument(e){this._document=e,this.onChangeCallback?.(e),this.emitSnapshot();}setZoom(e){this._zoom=Math.max(.25,Math.min(4,e)),this.emitSnapshot();}getZoom(){return this._zoom}emitSnapshot(){this._version++,this.setSnapshot({loadingState:this._loadingState,parseError:this._parseError,isReady:this._loadingState==="ready",zoom:this._zoom,fontsLoaded:this._fontsLoaded,version:this._version});}};var uo="0.0.2";exports.a=B;exports.b=O;exports.c=l;exports.d=d;exports.e=D;exports.f=R;exports.g=I;exports.h=_;exports.i=A;exports.j=m;exports.k=P;exports.l=L;exports.m=k;exports.n=F;exports.o=p;exports.p=v;exports.q=b;exports.r=z;exports.s=y;exports.t=h;exports.u=w;exports.v=g;exports.w=f;exports.x=S;exports.y=uo;
@@ -1,10 +0,0 @@
1
- 'use strict';var chunkP4VSHBGZ_js=require('./chunk-P4VSHBGZ.js'),chunkYC5KZSYD_js=require('./chunk-YC5KZSYD.js');function _(e){return g(e).variables}function g(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let r=A(e.package.document);r.forEach(o=>{t.push({name:o,location:"body"});}),n.body=Array.from(new Set(r)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((r,o)=>{r.properties.headerReferences&&r.properties.headerReferences.forEach(i=>{});}),e.package?.footnotes){let r=C(e.package.footnotes);r.forEach(o=>{t.push({name:o,location:"footnote"});}),n.footnotes=Array.from(new Set(r)).sort();}if(e.package?.endnotes){let r=C(e.package.endnotes);r.forEach(o=>{t.push({name:o,location:"endnote"});}),n.endnotes=Array.from(new Set(r)).sort();}e.templateVariables&&e.templateVariables.forEach(r=>{t.some(o=>o.name===r)||t.push({name:r,location:"body"});});let a=new Set;return t.forEach(r=>a.add(r.name)),{variables:Array.from(a).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function A(e){let t=[];if(e.content&&t.push(...w(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...w(n.content));return t}function w(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...I(n));return t}function b(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...d(n)):n.type==="hyperlink"?t.push(...O(n)):n.type==="simpleField"?t.push(...N(n)):n.type==="complexField"&&t.push(...H(n));return t}function d(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...P(n.text));return t}function O(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...d(n));return t}function N(e){let t=[];if(e.instruction&&t.push(...P(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...d(n));return t}function H(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...d(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...d(n));return t}function I(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let a of n.cells)t.push(...$(a));return t}function $(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...b(n)):n.type==="table"&&t.push(...I(n));return t}function C(e){let t=[];for(let n of e)if(n.content)for(let a of n.content)a.type==="paragraph"&&t.push(...b(a));return t}var R=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,D=/\{(.+?)\}/g;function P(e){if(!e)return [];let t=[],n=new RegExp(R),a;for(;(a=n.exec(e))!==null;)t.push(a[1]);return t}function q(e){return R.test(e)}function U(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function X(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function G(e){return `{${e}}`}function K(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function Q(e,t){return e&&e.replace(D,(n,a)=>{let r=a.trim();return r in t?t[r]:n})}function Y(e,t=""){return e&&e.replace(D,t)}function ee(e){return _(e).length>0}function J(e){return typeof e=="object"&&e!==null&&("_def"in e||"parse"in e||"safeParse"in e)}function k(e,t){let n=t,{position:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.paragraphIndex} out of bounds`);let c=s[a.paragraphIndex],l=`{${r}}`;return E(c,a.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function M(e,t){let n=t,{range:a,variableName:r}=n,o=JSON.parse(JSON.stringify(e)),s=o.package.document.content.filter(u=>u.type==="paragraph");if(a.start.paragraphIndex!==a.end.paragraphIndex)throw new Error("Template variable replacement cannot span multiple paragraphs");if(a.start.paragraphIndex>=s.length)throw new Error(`Paragraph index ${a.start.paragraphIndex} out of bounds`);let c=s[a.start.paragraphIndex];L(c,a.start.offset,a.end.offset);let l=`{${r}}`;return E(c,a.start.offset,l),o.templateVariables||(o.templateVariables=[]),o.templateVariables.includes(r)||o.templateVariables.push(r),o}function E(e,t,n){let a=0,r=false;for(let o=0;o<e.content.length;o++){let i=e.content[o];if(i.type==="run"){let s=x(i),c=a,l=a+s.length;if(!r&&t>=c&&t<=l){let u=t-c,h=s.slice(0,u),y=s.slice(u),m=[];for(let p=0;p<o;p++)m.push(e.content[p]);h&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:h}]}),m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:n}]}),y&&m.push({type:"run",formatting:i.formatting,content:[{type:"text",text:y}]});for(let p=o+1;p<e.content.length;p++)m.push(e.content[p]);e.content=m,r=true;break}a=l;}else if(i.type==="hyperlink")for(let s of i.children)s.type==="run"&&(a+=x(s).length);}r||e.content.push({type:"run",content:[{type:"text",text:n}]});}function L(e,t,n){let a=[],r=0;for(let o of e.content)if(o.type==="run"){let i=x(o),s=r,c=r+i.length;if(c<=t||s>=n)a.push(o);else {let l="";s<t&&(l+=i.slice(0,t-s)),c>n&&(l+=i.slice(n-s)),l.length>0&&a.push({type:"run",formatting:o.formatting,content:[{type:"text",text:l}]});}r=c;}else a.push(o);e.content=a;}function x(e){return e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}var f={type:"string",description:"Document ID from a previous docx_load call"},F={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"]},B={name:"docx_get_variables",description:`List all template variables ({name} format) found in the document.
2
- Returns variable names without braces, along with their locations (body, headers, footers, etc.).
3
- Use this to discover what data fields a template document expects.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};try{let r=g(a.document);return {content:[{type:"text",text:JSON.stringify({variables:r.variables,count:r.variables.length,totalOccurrences:r.totalOccurrences,byLocation:r.byLocation},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to detect variables: ${r.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}'}]}},Z={name:"docx_insert_variable",description:`Insert a template variable placeholder ({name}) at a specific position in the document.
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:f,position:F,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(e,t)=>{let{documentId:n,position:a,variableName:r}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!/^[a-zA-Z_][a-zA-Z0-9_\-.]*$/.test(r))return {isError:true,content:[{type:"text",text:`Invalid variable name: ${r}. Must start with letter/underscore and contain only alphanumeric, underscore, hyphen, or dot.`}]};try{let{executeCommand:i}=await import('./executor-GDBV3AGV.js'),s=i(o.document,{type:"insertText",position:a,text:`{${r}}`});return o.document=s,o.lastModified=Date.now(),s.templateVariables||(s.templateVariables=[]),s.templateVariables.includes(r)||s.templateVariables.push(r),{content:[{type:"text",text:JSON.stringify({success:!0,variable:r,insertedAs:`{${r}}`,position:a})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to insert variable: ${i.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"}}]}},z={name:"docx_apply_template",description:`Substitute template variables with actual values in the document.
6
- Replaces all {variable} placeholders with the corresponding values provided.
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:f,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(e,t)=>{let{documentId:n,variables:a,keepUnmatchedVariables:r=true}=e,o=t.session.documents.get(n);if(!o)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!o.buffer)return {isError:true,content:[{type:"text",text:"Cannot apply template: document was not loaded from a DOCX buffer"}]};try{let i=chunkYC5KZSYD_js.b(o.buffer,a,{nullGetter:r?"keep":"empty"}),s=await chunkP4VSHBGZ_js.a(i.buffer);return o.document=s,o.buffer=i.buffer,o.lastModified=Date.now(),{content:[{type:"text",text:JSON.stringify({success:!0,replacedVariables:i.replacedVariables,unreplacedVariables:i.unreplacedVariables,warnings:i.warnings})}]}}catch(i){return {isError:true,content:[{type:"text",text:`Failed to apply template: ${i.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"}}}]}},j={name:"docx_validate_template",description:`Validate that a document is a valid docxtemplater template.
9
- Checks for syntax errors like unclosed braces, invalid tag names, etc.
10
- Returns validation result with any errors found and list of valid tags.`,inputSchema:{type:"object",properties:{documentId:f},required:["documentId"]},handler:async(e,t)=>{let{documentId:n}=e,a=t.session.documents.get(n);if(!a)return {isError:true,content:[{type:"text",text:`Document not found: ${n}`}]};if(!a.buffer)return {isError:true,content:[{type:"text",text:"Cannot validate template: document was not loaded from a DOCX buffer"}]};try{let r=chunkYC5KZSYD_js.f(a.buffer);return {content:[{type:"text",text:JSON.stringify({valid:r.valid,tags:r.tags,errors:r.errors.map(o=>({message:o.message,variable:o.variable,type:o.type}))},null,2)}]}}catch(r){return {isError:true,content:[{type:"text",text:`Failed to validate template: ${r.message}`}]}}},annotations:{category:"template",readOnly:true,complexity:"low"}},S=[B,Z,z,j];var W={id:"docxtemplater",name:"Docxtemplater",version:"1.0.0",description:"Template variable support using standard docxtemplater syntax ({variable})",commandHandlers:{insertTemplateVariable:k,replaceWithTemplateVariable:M},mcpTools:S};exports.a=_;exports.b=g;exports.c=A;exports.d=b;exports.e=P;exports.f=q;exports.g=U;exports.h=X;exports.i=G;exports.j=K;exports.k=Q;exports.l=Y;exports.m=ee;exports.n=J;exports.o=W;
@@ -1,2 +0,0 @@
1
- import {createContext,useMemo,useContext,useCallback}from'react';import {jsx}from'react/jsx-runtime';var g={_lang:"en",common:{cancel:"Cancel",insert:"Insert",apply:"Apply",close:"Close",delete:"Delete",update:"Update",save:"Save",retry:"Retry",send:"Send",edit:"Edit",comment:"Comment",reply:"Reply",accept:"Accept",reject:"Reject",dismiss:"Dismiss",change:"Change",px:"px",closeDialog:"Close dialog"},toolbar:{ariaLabel:"Formatting toolbar",file:"File",format:"Format",insert:"Insert",open:"Open",openShortcut:"Ctrl+O",save:"Save",saveShortcut:"Ctrl+S",print:"Print",printShortcut:"Ctrl+P",pageSetup:"Page setup",leftToRight:"Left-to-right text",rightToLeft:"Right-to-left text",image:"Image",table:"Table",pageBreak:"Page break",tableOfContents:"Table of contents",symbol:"Symbol",help:"Help",reportIssue:"Report issue"},formattingBar:{groups:{history:"History",zoom:"Zoom",styles:"Styles",font:"Font",textFormatting:"Text formatting",script:"Script",alignment:"Alignment",listFormatting:"List formatting",image:"Image",table:"Table"},undo:"Undo",undoShortcut:"Undo (Ctrl+Z)",redo:"Redo",redoShortcut:"Redo (Ctrl+Y)",bold:"Bold",boldShortcut:"Bold (Ctrl+B)",italic:"Italic",italicShortcut:"Italic (Ctrl+I)",underline:"Underline",underlineShortcut:"Underline (Ctrl+U)",strikethrough:"Strikethrough",fontColor:"Font Color",highlightColor:"Text Highlight Color",insertLink:"Insert link",insertLinkShortcut:"Insert link (Ctrl+K)",superscript:"Superscript",superscriptShortcut:"Superscript (Ctrl+Shift+=)",subscript:"Subscript",subscriptShortcut:"Subscript (Ctrl+=)",imageProperties:"Image properties",imagePropertiesShortcut:"Image properties (alt text, border)...",clearFormatting:"Clear formatting"},alignment:{alignLeft:"Align Left",alignLeftShortcut:"Ctrl+L",center:"Center",centerShortcut:"Ctrl+E",alignRight:"Align Right",alignRightShortcut:"Ctrl+R",justify:"Justify",justifyShortcut:"Ctrl+J"},lists:{ariaLabel:"List formatting",typeAriaLabel:"List type",indentationAriaLabel:"List indentation",bulletList:"Bullet List",numberedList:"Numbered List",decreaseIndent:"Decrease Indent",increaseIndent:"Increase Indent"},lineSpacing:{single:"Single",double:"Double",lineSpacingTitle:"Line spacing: {label}",paragraphSpacing:"Paragraph spacing"},styles:{selectAriaLabel:"Select paragraph style",normalText:"Normal text",title:"Title",subtitle:"Subtitle",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3"},font:{selectAriaLabel:"Select font family",sansSerif:"Sans Serif",serif:"Serif",monospace:"Monospace"},fontSize:{decrease:"Decrease font size",increase:"Increase font size",label:"Font size",listLabel:"Font sizes"},zoom:{ariaLabel:"Zoom: {label}"},colorPicker:{ariaLabel:"{type} color picker",highlightColors:"Highlight Colors",customColor:"Custom Color",noColor:"No Color",automatic:"Automatic",themeColors:"Theme Colors",standardColors:"Standard Colors",colors:{black:"Black",darkRed:"Dark Red",red:"Red",orange:"Orange",yellow:"Yellow",darkYellow:"Dark Yellow",green:"Green",darkGreen:"Dark Green",teal:"Teal",darkTeal:"Dark Teal",blue:"Blue",darkBlue:"Dark Blue",purple:"Purple",darkPurple:"Dark Purple",brown:"Brown",grey50:"Grey 50%",grey25:"Grey 25%",grey10:"Grey 10%",white:"White",lightRed:"Light Red",lightOrange:"Light Orange",lightYellow:"Light Yellow",lightGreen:"Light Green",lightBlue:"Light Blue",lightPurple:"Light Purple",pink:"Pink",rose:"Rose",gold:"Gold",aqua:"Aqua",lavender:"Lavender",silver:"Silver",darkOrange:"Dark Orange",darkGray:"Dark Gray",gray:"Gray",cyan:"Cyan",magenta:"Magenta",paleGreen:"Pale Green",lightCyan:"Light Cyan",skyBlue:"Sky Blue",lightBlue2:"Light Blue 2",lightMagenta:"Light Magenta",brightGreen:"Bright Green",violet:"Violet"}},dialogs:{findReplace:{titleFind:"Find",titleFindReplace:"Find and Replace",findLabel:"Find:",findPlaceholder:"Enter text to find...",findAriaLabel:"Find text",findPrevious:"Find previous",findPreviousTitle:"Find Previous (Shift+Enter)",findNext:"Find next",findNextTitle:"Find Next (Enter)",matchCount:"{current} of {total} matches",noResults:"No results found",replaceLabel:"Replace:",replacePlaceholder:"Enter replacement text...",replaceAriaLabel:"Replace text",replaceButton:"Replace",replaceCurrentTitle:"Replace current match",replaceAllButton:"Replace All",replaceAllTitle:"Replace all matches",matchCase:"Match case",wholeWords:"Whole words",toggleReplace:"+ Replace"},hyperlink:{titleEdit:"Edit Hyperlink",titleInsert:"Insert Hyperlink",tabWebAddress:"Web Address",tabBookmark:"Bookmark",urlLabel:"URL",urlPlaceholder:"https://example.com",urlHint:"Enter a web address, email (mailto:), or phone (tel:)",bookmarkLabel:"Bookmark",bookmarkPlaceholder:"Select a bookmark...",displayTextLabel:"Display Text",displayTextPlaceholder:"Text to display (optional)",displayTextHint:"Leave empty to use the selected text",tooltipLabel:"Tooltip (optional)",tooltipPlaceholder:"Text shown on hover",removeLink:"Remove Link",invalidUrl:"Please enter a valid URL",urlRequired:"URL is required"},insertTable:{title:"Insert Table",hoverToSelect:"Hover to select size",tableSize:"{cols} x {rows} Table",orSpecifySize:"or specify size",rowsLabel:"Rows:",columnsLabel:"Columns:",insertButton:"Insert Table",sizeSelector:"Table size selector"},splitCell:{title:"Split Cell",description:"Set how many rows and columns to split the selected cell into.",rowsLabel:"Rows:",columnsLabel:"Columns:",currentMinimum:"Minimum from current span: {rows} row(s) x {cols} column(s)",minValue:"Use at least {rows} row(s) and {cols} column(s).",notOneByOne:"Choose at least two resulting cells."},insertImage:{title:"Insert Image",uploadAriaLabel:"Click or drag to upload image",uploadText:"Click to select or drag and drop an image",uploadSubtext:"PNG, JPG, GIF up to 10MB",dimensions:"Dimensions",widthLabel:"Width:",heightLabel:"Height:",aspectRatioLocked:"Aspect ratio locked",aspectRatioUnlocked:"Aspect ratio unlocked",altTextLabel:"Alt Text (optional)",altTextPlaceholder:"Describe the image for accessibility",insertButton:"Insert Image",invalidFile:"Please select a valid image file",fileTooLarge:"Image file is too large (max 10MB)",readFailed:"Failed to read image file",loadFailed:"Failed to load image",preview:"Preview"},insertSymbol:{title:"Insert Symbol",searchPlaceholder:"Search symbols (character or Unicode)...",noResults:'No symbols found for "{query}"',decimal:"Decimal: {value}",categories:{common:"Common",arrows:"Arrows",math:"Math",greek:"Greek",shapes:"Shapes",punctuation:"Punctuation",currency:"Currency",music:"Music",emoji:"Emoji"}},imageProperties:{title:"Image Properties",altText:"Alt Text",altTextPlaceholder:"Describe this image for accessibility...",border:"Border",width:"Width",style:"Style",color:"Color",preview:"Preview",borderStyles:{solid:"Solid",dashed:"Dashed",dotted:"Dotted",double:"Double",groove:"Groove",ridge:"Ridge",inset:"Inset",outset:"Outset"}},imagePosition:{title:"Image Position",horizontal:"Horizontal",vertical:"Vertical",position:"Position",alignment:"Alignment",offset:"Offset",offsetPx:"Offset (px)",align:"Align",relativeTo:"Relative to",alignOptions:{left:"Left",center:"Center",right:"Right",top:"Top",bottom:"Bottom"},relativeOptions:{page:"Page",column:"Column",margin:"Margin",character:"Character",paragraph:"Paragraph",line:"Line"}},pageSetup:{title:"Page Setup",pageSize:"PAGE SIZE",sizeLabel:"Size",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"MARGINS",top:"Top",bottom:"Bottom",left:"Left",right:"Right",pageSizes:{letter:'Letter (8.5" \xD7 11")',a4:'A4 (8.27" \xD7 11.69")',legal:'Legal (8.5" \xD7 14")',a3:'A3 (11.69" \xD7 16.54")',a5:'A5 (5.83" \xD7 8.27")',b5:'B5 (6.93" \xD7 9.84")',executive:'Executive (7.25" \xD7 10.5")'}},tableProperties:{title:"Table Properties",widthType:"Width type",widthLabel:"Width",alignmentLabel:"Alignment",widthTypes:{auto:"Auto",fixed:"Fixed (twips)",percentage:"Percentage"},units:{fiftiethsPercent:"(50ths of %)",twips:"tw"},alignOptions:{left:"Left",center:"Center",right:"Right"}},pasteSpecial:{title:"Paste Special",keepFormatting:"Keep Source Formatting",keepFormattingDescription:"Paste with original formatting",keepFormattingShortcut:"Ctrl+V",plainText:"Paste as Plain Text",plainTextDescription:"Paste without any formatting",plainTextShortcut:"Ctrl+Shift+V",readingClipboard:"Reading clipboard...",preview:"Preview:",noContent:"No content available to paste",clipboardError:"Unable to read clipboard. Please use Ctrl+V to paste."},footnoteProperties:{title:"Footnote & Endnote Properties",footnotes:"Footnotes",endnotes:"Endnotes",position:"Position",numberFormat:"Number format",startAt:"Start at",numbering:"Numbering",footnotePositions:{bottomOfPage:"Bottom of page",belowText:"Below text"},endnotePositions:{endOfDocument:"End of document",endOfSection:"End of section"},numberingOptions:{continuous:"Continuous",restartSection:"Restart each section",restartPage:"Restart each page"},formats:{decimal:"1, 2, 3, ...",lowerRoman:"i, ii, iii, ...",upperRoman:"I, II, III, ...",lowerAlpha:"a, b, c, ...",upperAlpha:"A, B, C, ...",symbols:"*, \u2020, \u2021, ..."}},keyboardShortcuts:{ariaLabel:"Keyboard Shortcuts",searchPlaceholder:"Search shortcuts...",categories:{editing:"Editing",formatting:"Formatting",navigation:"Navigation",clipboard:"Clipboard",selection:"Selection",view:"View",file:"File",other:"Other"},shortcuts:{save:"Save",saveDescription:"Save document",print:"Print",printDescription:"Print document",undo:"Undo",undoDescription:"Undo last action",redo:"Redo",redoDescription:"Redo last action",delete:"Delete",deleteDescription:"Delete selected text",find:"Find",findDescription:"Find text in document",findReplace:"Find & Replace",findReplaceDescription:"Find and replace text",cut:"Cut",cutDescription:"Cut selected text",copy:"Copy",copyDescription:"Copy selected text",paste:"Paste",pasteDescription:"Paste from clipboard",pastePlainText:"Paste as Plain Text",pastePlainTextDescription:"Paste without formatting",bold:"Bold",boldDescription:"Toggle bold formatting",italic:"Italic",italicDescription:"Toggle italic formatting",underline:"Underline",underlineDescription:"Toggle underline formatting",strikethrough:"Strikethrough",strikethroughDescription:"Toggle strikethrough",subscript:"Subscript",subscriptDescription:"Toggle subscript",superscript:"Superscript",superscriptDescription:"Toggle superscript",alignLeft:"Align Left",alignLeftDescription:"Left align paragraph",alignCenter:"Align Center",alignCenterDescription:"Center align paragraph",alignRight:"Align Right",alignRightDescription:"Right align paragraph",justify:"Justify",justifyDescription:"Justify paragraph",increaseIndent:"Increase Indent",increaseIndentDescription:"Increase paragraph indent",decreaseIndent:"Decrease Indent",decreaseIndentDescription:"Decrease paragraph indent",selectAll:"Select All",selectAllDescription:"Select all content",selectWord:"Select Word",selectWordDescription:"Select current word",selectParagraph:"Select Paragraph",selectParagraphDescription:"Select current paragraph",extendSelectionByWord:"Extend Selection by Word",extendSelectionByWordDescription:"Extend selection to next/previous word",extendSelectionToLineEdge:"Extend Selection to Line Edge",extendSelectionToLineEdgeDescription:"Extend selection to line start/end",moveByWord:"Move by Word",moveByWordDescription:"Move cursor to next/previous word",moveToLineStart:"Move to Line Start",moveToLineStartDescription:"Move cursor to start of line",moveToLineEnd:"Move to Line End",moveToLineEndDescription:"Move cursor to end of line",moveToDocumentStart:"Move to Document Start",moveToDocumentStartDescription:"Move cursor to start of document",moveToDocumentEnd:"Move to Document End",moveToDocumentEndDescription:"Move cursor to end of document",pageUp:"Page Up",pageUpDescription:"Scroll up one page",pageDown:"Page Down",pageDownDescription:"Scroll down one page",zoomIn:"Zoom In",zoomInDescription:"Increase zoom level",zoomOut:"Zoom Out",zoomOutDescription:"Decrease zoom level",resetZoom:"Reset Zoom",resetZoomDescription:"Reset zoom to 100%",keyboardShortcuts:"Keyboard Shortcuts",keyboardShortcutsDescription:"Show this help dialog"},noResults:'No shortcuts found matching "{query}"',pressEscToClose:"Press {key} to close",or:"or"}},comments:{resolved:"Resolved",resolve:"Resolve",reopen:"Reopen",moreOptions:"More options",unknown:"Unknown",addComment:"Add a comment...",replyPlaceholder:"Reply or add others with @",replyCount:"{count, plural, one {# reply} other {# replies}}"},trackedChanges:{unknown:"Unknown",replaced:"Replaced",with:"with",added:"Added",deleted:"Deleted"},contextMenu:{ariaLabel:"AI actions menu",textMenuAriaLabel:"Text editing menu",customPromptPlaceholder:"Enter custom prompt...",cut:"Cut",cutShortcut:"Ctrl+X",copy:"Copy",copyShortcut:"Ctrl+C",paste:"Paste",pasteShortcut:"Ctrl+V",pastePlainText:"Paste as Plain Text",pastePlainTextShortcut:"Ctrl+Shift+V",delete:"Delete",deleteShortcut:"Del",selectAll:"Select All",selectAllShortcut:"Ctrl+A",selected:"Selected:",aiActions:{askAi:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom"}},documentOutline:{ariaLabel:"Document outline",closeAriaLabel:"Close outline",closeTitle:"Close outline",title:"Outline",noHeadings:"No headings found. Add headings to your document to see them here."},sidebar:{ariaLabel:"Annotations sidebar"},viewer:{pageIndicator:"{current} of {total}"},titleBar:{untitled:"Untitled",documentNameAriaLabel:"Document name",menuBarAriaLabel:"Menu bar"},errors:{loadingDocument:"Loading document...",noDocumentLoaded:"No document loaded",failedToLoad:"Failed to Load Document",unableToParse:"Unable to Parse Document",somethingWentWrong:"Something went wrong",errorDescription:"An error occurred while rendering this component. Please try again or contact support if the problem persists.",errorLabel:"Error:",componentStack:"Component Stack:",tryAgain:"Try Again",showDetails:"Show details",hideDetails:"Hide details",unsavedChanges:"You have unsaved changes. Are you sure you want to leave?"},table:{insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",mergeCells:"Merge cells",splitCell:"Split cell",editingTools:"Table editing tools",label:"Table:",cellFillColor:"Cell Fill Color",borderColor:"Border Color",borderWidth:"Border width",unknownAction:"Unknown Action",borders:{all:"All borders",outside:"Outside borders",inside:"Inside borders",none:"No borders",remove:"Remove borders",top:"Top border",bottom:"Bottom border",left:"Left border",right:"Right border",styleAriaLabel:"Border style",tooltip:"Borders"},moreOptions:"More table options",styles:{title:"Table Styles",label:"Styles",normalTable:"Normal Table",tableGrid:"Table Grid",gridTableLight:"Grid Table Light",plainTable1:"Plain Table 1",plainTable2:"Plain Table 2",plainTable3:"Plain Table 3",plainTable4:"Plain Table 4",gridTable1Light:"Grid Table 1 Light",gridTable4Accent1:"Grid Table 4 Accent 1",gridTable5Dark:"Grid Table 5 Dark",listTable3Accent2:"List Table 3 Accent 2",listTable4Accent3:"List Table 4 Accent 3",gridTable4Accent5:"Grid Table 4 Accent 5",gridTable4Accent6:"Grid Table 4 Accent 6"}},tableAdvanced:{verticalAlignment:"Vertical alignment",top:"Top",middle:"Middle",bottom:"Bottom",cellMargins:"Cell margins",textDirection:"Text direction",textDirections:{horizontal:"Horizontal (LR)",verticalRL:"Vertical (top-bottom, RL)",verticalLR:"Vertical (bottom-top, LR)"},toggleNoWrap:"Toggle no-wrap",rowHeight:"Row height",heightRules:{auto:"Auto",atLeast:"At least",exact:"Exact"},rule:"Rule",height:"Height",toggleHeaderRow:"Toggle header row",distributeColumns:"Distribute columns evenly",autoFit:"Auto-fit to contents",tableProperties:"Table properties...",tableAlignment:"Table alignment",alignTableLeft:"Align table left",alignTableCenter:"Align table center",alignTableRight:"Align table right",tableOptionsMenu:"Table options menu",tableOptions:"Table options"},imageTransform:{tooltip:"Transform",rotateClockwise:"Rotate clockwise",rotateCounterClockwise:"Rotate counter-clockwise",flipHorizontal:"Flip horizontal",flipVertical:"Flip vertical"},imageWrap:{inline:"In Line with Text",floatLeft:"Square Left",floatRight:"Square Right",topAndBottom:"Top and Bottom",behindText:"Behind Text",inFrontOfText:"In Front of Text",tooltipPrefix:"Wrap: {label}",menu:{inLineWithText:"In Line with Text",squareLeft:"Square Left",squareRight:"Square Right",behindText:"Behind Text",inFrontOfText:"In Front of Text",ariaLabel:"Image layout options"},menuDesc:{inLineWithText:"Image flows in the line as a glyph",squareLeft:"Image floats left, text wraps on the right",squareRight:"Image floats right, text wraps on the left",behindText:"Image paints behind body text",inFrontOfText:"Image paints over body text"}},responsePreview:{loading:"{action}...",result:"{action} Result",closeEsc:"Close (Esc)",editPrompt:"Edit the result before accepting:",changes:"Changes:",original:"Original:",new:"New:",cancelEdit:"Cancel Edit"},commentMarkers:{resolvedComment:"Resolved comment",comment:"Comment"},editor:{toggleCommentsSidebar:"Toggle comments sidebar",showDocumentOutline:"Show document outline",editing:"Editing",editingDescription:"Edit document directly",suggesting:"Suggesting",suggestingDescription:"Edits become suggestions",viewing:"Viewing",viewingDescription:"Read-only, no edits",failedToParse:"Failed to parse document",linkRemoved:"Link removed",linkCopied:"Link copied to clipboard",failedToSave:"Failed to save document"},hyperlinkPopup:{displayTextPlaceholder:"Display text",urlPlaceholder:"https://example.com",copyLink:"Copy link",editLink:"Edit link",removeLink:"Remove link"},headerFooter:{header:"Header",footer:"Footer",options:"Options",insertPageNumber:"Insert current page number",insertTotalPages:"Insert total page count",remove:"Remove {label}",closeEditing:"Close {label} editing"},image:{placeholder:"Image placeholder",placeholderText:"[Image]",editableAriaLabel:"Editable image"},ruler:{horizontal:"Horizontal ruler",vertical:"Vertical ruler",firstLineIndent:"First line indent",leftIndent:"Left indent",rightIndent:"Right indent",topMargin:"Top margin",bottomMargin:"Bottom margin"},print:{label:"Print",allPages:"All ({totalPages} pages)",singlePage:"Page {start}",pageRange:"Pages {start}-{end}"},unsaved:{unsaved:"Unsaved",saved:"Saved",unsavedTitle:"Document has unsaved changes",savedTitle:"All changes saved",unsavedAriaLabel:"Unsaved changes",savedAriaLabel:"All changes saved"},loading:{label:"Loading"},agentPanel:{defaultTitle:"Assistant",toggle:"Open assistant",close:"Close panel",resizeHandle:"Resize agent panel",thinking:"Assistant is thinking",composerPlaceholder:"Ask the assistant\u2026",send:"Send",timeline:{working:"Working\u2026 {count, plural, one {# step} other {# steps}}",summary:"{count, plural, one {# step} other {# steps}}",earlier:"+ {count, plural, one {# earlier step} other {# earlier steps}}"}}};var b=g,f=createContext(b),T=createContext("en");function d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function L(e,o){if(!o)return e;let t={...e};for(let r of Object.keys(o)){let i=o[r];i!==null&&(d(e[r])&&d(i)?t[r]=L(e[r],i):i!==void 0&&(t[r]=i));}return t}function v(e,o){let t=e;for(let r of o.split(".")){if(!d(t))return;t=t[r];}return typeof t=="string"?t:void 0}function P(e){let o={},t=/(=\d+|\w+)\s*\{([^}]*)\}/g,r;for(;(r=t.exec(e))!==null;)o[r[1]]=r[2];return o}function x(e,o,t){return o?e.replace(/\{(\w+),\s*plural,\s*((?:[^{}]|\{[^{}]*\})*)\}/g,(i,n,l)=>{let a=Number(o[n]);if(isNaN(a))return i;let s=P(l),p=s[`=${a}`];if(p!==void 0)return p.replace(/#/g,String(a));let c;try{c=new Intl.PluralRules(t||"en").select(a);}catch{c=a===1?"one":"other";}return (s[c]??s.other??"").replace(/#/g,String(a))}).replace(/\{(\w+)\}/g,(i,n)=>{let l=o[n];return l!==void 0?String(l):`{${n}}`}):e}function R({i18n:e,children:o}){let t=e,r=typeof t?._lang=="string"?t._lang:"en",i=useMemo(()=>L(b,t),[t]);return jsx(T.Provider,{value:r,children:jsx(f.Provider,{value:i,children:o})})}function w(){let e=useContext(f),o=useContext(T);return {t:useCallback((r,i)=>{let n=v(e,r);return x(n??r,i,o)},[e,o])}}
2
- export{g as a,R as b,w as c};