@eigenpal/docx-js-editor 0.0.20 → 0.0.21

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 (200) hide show
  1. package/dist/{ClipboardManager-EZ0C6Onq.d.cts → ClipboardManager-B1jZrC6h.d.cts} +1 -1
  2. package/dist/{ClipboardManager-D6dkOFg6.d.ts → ClipboardManager-jqJVxB6g.d.ts} +1 -1
  3. package/dist/{DocumentAgent-BcCDg7i2.d.ts → DocumentAgent-CnJ9AEl_.d.cts} +31 -3
  4. package/dist/{DocumentAgent-B0EC8lPC.d.cts → DocumentAgent-CrbsDniO.d.ts} +31 -3
  5. package/dist/{FindReplaceDialog-AWQXKEUQ.js → FindReplaceDialog-AQFR4OCT.js} +1 -2
  6. package/dist/FindReplaceDialog-J3DI3U5I.cjs +1 -0
  7. package/dist/{FootnotePropertiesDialog-73VT2ZVZ.cjs → FootnotePropertiesDialog-DO5DCAW6.cjs} +1 -2
  8. package/dist/{FootnotePropertiesDialog-ZM3EF3EF.js → FootnotePropertiesDialog-YYIZU5U6.js} +1 -2
  9. package/dist/{HyperlinkDialog-BA25XUT5.js → HyperlinkDialog-HGZ2S37Z.js} +1 -2
  10. package/dist/HyperlinkDialog-PEPS3C2G.cjs +1 -0
  11. package/dist/{ImagePositionDialog-AIAMKPFK.js → ImagePositionDialog-DQ4JWS4F.js} +1 -2
  12. package/dist/{ImagePositionDialog-KMK7ROV2.cjs → ImagePositionDialog-UYXYHSP4.cjs} +1 -2
  13. package/dist/{ImagePropertiesDialog-ERFCUVCW.js → ImagePropertiesDialog-GJMGLM6G.js} +1 -2
  14. package/dist/{ImagePropertiesDialog-USMMRK6X.cjs → ImagePropertiesDialog-V6SVKINO.cjs} +1 -2
  15. package/dist/{TablePropertiesDialog-72CIUAZT.cjs → TablePropertiesDialog-A36OXG3A.cjs} +1 -2
  16. package/dist/{TablePropertiesDialog-EMUEVYB3.js → TablePropertiesDialog-STZOGHJB.js} +1 -2
  17. package/dist/{agentApi-BFVyKagE.d.cts → agentApi-DfsWRyrP.d.cts} +1 -1
  18. package/dist/{agentApi-BFVyKagE.d.ts → agentApi-DfsWRyrP.d.ts} +1 -1
  19. package/dist/{chunk-FDANI5P4.cjs → chunk-2VHQ7YOQ.cjs} +1 -2
  20. package/dist/chunk-2Y6FLZ5Q.js +3 -0
  21. package/dist/chunk-32HMU2UV.js +111 -0
  22. package/dist/chunk-4CUGBNL2.cjs +1 -0
  23. package/dist/chunk-5GFXHUMP.js +1 -0
  24. package/dist/chunk-6NDMKJIE.js +9 -0
  25. package/dist/chunk-6NYA53QC.cjs +258 -0
  26. package/dist/chunk-7KJ3YVDQ.js +10 -0
  27. package/dist/{chunk-JOYPFQW2.js → chunk-AARNCPWR.js} +1 -2
  28. package/dist/{chunk-4QT5LPBA.cjs → chunk-B7TICMXD.cjs} +16 -17
  29. package/dist/{chunk-2QOEHCBX.js → chunk-BUEMG4NW.js} +1 -2
  30. package/dist/{chunk-CV5WFE7K.js → chunk-CLDB6TL7.js} +2 -3
  31. package/dist/{chunk-M2T6XKT5.js → chunk-CTYOM6BE.js} +1 -2
  32. package/dist/chunk-EH3NY2DQ.cjs +26 -0
  33. package/dist/{chunk-FGVGZLBL.js → chunk-FVUGBRDD.js} +1 -2
  34. package/dist/chunk-FXJAIFPR.js +59 -0
  35. package/dist/chunk-GICVJSFJ.cjs +9 -0
  36. package/dist/{chunk-Y6VCTLCJ.js → chunk-H5NTJZO4.js} +1 -2
  37. package/dist/chunk-HT2Z33YM.cjs +111 -0
  38. package/dist/chunk-JRRTZZ72.cjs +1 -0
  39. package/dist/{chunk-T2HQYRA7.cjs → chunk-NVAQQYBJ.cjs} +1 -2
  40. package/dist/chunk-P3AEZKQO.cjs +3 -0
  41. package/dist/{chunk-GWBTKVFD.cjs → chunk-P7ZF45KZ.cjs} +1 -2
  42. package/dist/{chunk-QEBO3EQP.cjs → chunk-PCJ5ACUV.cjs} +1 -2
  43. package/dist/{chunk-Q6HUGWO6.js → chunk-PJVI53AH.js} +1 -2
  44. package/dist/chunk-Q7YYC75E.js +258 -0
  45. package/dist/{chunk-7JSPKVOW.js → chunk-QVPR2W5S.js} +1 -2
  46. package/dist/{chunk-XZNOV52K.cjs → chunk-TAF6KYDM.cjs} +4 -5
  47. package/dist/chunk-USRMBYI6.js +3 -0
  48. package/dist/chunk-UTWPV2I4.js +26 -0
  49. package/dist/{chunk-DJAEBZ33.cjs → chunk-VTAS7VZ6.cjs} +1 -2
  50. package/dist/chunk-XQNCLN4T.cjs +3 -0
  51. package/dist/{chunk-S26DZVRQ.cjs → chunk-XS2AQFMF.cjs} +1 -2
  52. package/dist/chunk-Y6QBJGMO.cjs +59 -0
  53. package/dist/{chunk-WD2HTKRR.cjs → chunk-YS7FDEZ4.cjs} +1 -2
  54. package/dist/chunk-ZTVQA46Q.js +1 -0
  55. package/dist/{clipboard-beGtyabO.d.ts → clipboard-BE8E-szx.d.ts} +1 -1
  56. package/dist/{clipboard-CqE-UZ2d.d.cts → clipboard-DkfAv07F.d.cts} +1 -1
  57. package/dist/{colorResolver-B5YbO_a4.d.ts → colorResolver-CYttioMe.d.ts} +46 -3
  58. package/dist/{colorResolver-Cu46bSKr.d.cts → colorResolver-Dr8kQZAQ.d.cts} +46 -3
  59. package/dist/core-plugins-reexport.cjs +1 -2
  60. package/dist/core-plugins-reexport.d.cts +4 -4
  61. package/dist/core-plugins-reexport.d.ts +4 -4
  62. package/dist/core-plugins-reexport.js +1 -2
  63. package/dist/core-reexport.cjs +1 -2
  64. package/dist/core-reexport.d.cts +10 -10
  65. package/dist/core-reexport.d.ts +10 -10
  66. package/dist/core-reexport.js +1 -2
  67. package/dist/executor-JGWZ7S6Z.cjs +1 -0
  68. package/dist/executor-L2MVKMXO.js +1 -0
  69. package/dist/{fontLoader-CFKpg0Ri.d.ts → fontLoader-BsqQnB4v.d.ts} +1 -1
  70. package/dist/{fontLoader-HZYfILUm.d.cts → fontLoader-DECXIoMr.d.cts} +1 -1
  71. package/dist/headless-reexport.cjs +4 -5
  72. package/dist/headless-reexport.d.cts +7 -7
  73. package/dist/headless-reexport.d.ts +7 -7
  74. package/dist/headless-reexport.js +4 -5
  75. package/dist/index.cjs +6 -7
  76. package/dist/index.css +0 -1
  77. package/dist/index.d.cts +12 -12
  78. package/dist/index.d.ts +12 -12
  79. package/dist/index.js +6 -7
  80. package/dist/lib-GD2QD2JK.js +1 -0
  81. package/dist/lib-HOLGQI5K.cjs +1 -0
  82. package/dist/mcp-reexport.cjs +9 -10
  83. package/dist/mcp-reexport.d.cts +2 -2
  84. package/dist/mcp-reexport.d.ts +2 -2
  85. package/dist/mcp-reexport.js +4 -5
  86. package/dist/{processTemplate-G37IM66O.js → processTemplate-3HN7Q3KT.js} +1 -2
  87. package/dist/processTemplate-BXZKWRQD.cjs +1 -0
  88. package/dist/{react-BjOCdeTs.d.ts → react-C6bgHDFl.d.ts} +8 -6
  89. package/dist/{react-UzAn4o7l.d.cts → react-CAlVCYa4.d.cts} +8 -6
  90. package/dist/react.cjs +1 -2
  91. package/dist/react.css +0 -1
  92. package/dist/react.d.cts +5 -5
  93. package/dist/react.d.ts +5 -5
  94. package/dist/react.js +1 -2
  95. package/dist/{registry-DjacfR6Q.d.cts → registry-BU-FbHh-.d.cts} +1 -1
  96. package/dist/{registry-CV6nYWqP.d.ts → registry-gRbkCooh.d.ts} +1 -1
  97. package/dist/selectionRects-7QU337P5.cjs +1 -0
  98. package/dist/selectionRects-V5RC2BYX.js +1 -0
  99. package/dist/styles.css +1 -1
  100. package/dist/{types-DwZ3xysp.d.ts → types-7wjInVMW.d.ts} +1 -1
  101. package/dist/{types-Bnp8rvJn.d.cts → types-DEEpBL9H.d.cts} +1 -1
  102. package/dist/ui.cjs +1 -2
  103. package/dist/ui.d.cts +32 -85
  104. package/dist/ui.d.ts +32 -85
  105. package/dist/ui.js +1 -2
  106. package/dist/{variableDetector-CMhJtM96.d.cts → variableDetector-B4oQJa2e.d.cts} +33 -2
  107. package/dist/{variableDetector-BaDeXz7D.d.ts → variableDetector-BXJaTkiB.d.ts} +33 -2
  108. package/package.json +1 -1
  109. package/dist/FindReplaceDialog-AWQXKEUQ.js.map +0 -1
  110. package/dist/FindReplaceDialog-I4SZDSVP.cjs +0 -2
  111. package/dist/FindReplaceDialog-I4SZDSVP.cjs.map +0 -1
  112. package/dist/FootnotePropertiesDialog-73VT2ZVZ.cjs.map +0 -1
  113. package/dist/FootnotePropertiesDialog-ZM3EF3EF.js.map +0 -1
  114. package/dist/HyperlinkDialog-BA25XUT5.js.map +0 -1
  115. package/dist/HyperlinkDialog-V63LPOT2.cjs +0 -2
  116. package/dist/HyperlinkDialog-V63LPOT2.cjs.map +0 -1
  117. package/dist/ImagePositionDialog-AIAMKPFK.js.map +0 -1
  118. package/dist/ImagePositionDialog-KMK7ROV2.cjs.map +0 -1
  119. package/dist/ImagePropertiesDialog-ERFCUVCW.js.map +0 -1
  120. package/dist/ImagePropertiesDialog-USMMRK6X.cjs.map +0 -1
  121. package/dist/TablePropertiesDialog-72CIUAZT.cjs.map +0 -1
  122. package/dist/TablePropertiesDialog-EMUEVYB3.js.map +0 -1
  123. package/dist/chunk-2CHPKB5A.cjs +0 -112
  124. package/dist/chunk-2CHPKB5A.cjs.map +0 -1
  125. package/dist/chunk-2QOEHCBX.js.map +0 -1
  126. package/dist/chunk-4QT5LPBA.cjs.map +0 -1
  127. package/dist/chunk-5DYSI4O4.cjs +0 -60
  128. package/dist/chunk-5DYSI4O4.cjs.map +0 -1
  129. package/dist/chunk-5FJXHXFV.cjs +0 -2
  130. package/dist/chunk-5FJXHXFV.cjs.map +0 -1
  131. package/dist/chunk-6FEWNF6B.js +0 -4
  132. package/dist/chunk-6FEWNF6B.js.map +0 -1
  133. package/dist/chunk-6LF5HZCV.js +0 -10
  134. package/dist/chunk-6LF5HZCV.js.map +0 -1
  135. package/dist/chunk-7JSPKVOW.js.map +0 -1
  136. package/dist/chunk-C33XDRDJ.cjs +0 -28
  137. package/dist/chunk-C33XDRDJ.cjs.map +0 -1
  138. package/dist/chunk-CV5WFE7K.js.map +0 -1
  139. package/dist/chunk-CXJRNISO.js +0 -2
  140. package/dist/chunk-CXJRNISO.js.map +0 -1
  141. package/dist/chunk-DJAEBZ33.cjs.map +0 -1
  142. package/dist/chunk-DP6Q75ZD.js +0 -28
  143. package/dist/chunk-DP6Q75ZD.js.map +0 -1
  144. package/dist/chunk-FDANI5P4.cjs.map +0 -1
  145. package/dist/chunk-FGVGZLBL.js.map +0 -1
  146. package/dist/chunk-GJ4GKSDU.cjs +0 -2
  147. package/dist/chunk-GJ4GKSDU.cjs.map +0 -1
  148. package/dist/chunk-GWBTKVFD.cjs.map +0 -1
  149. package/dist/chunk-JOYPFQW2.js.map +0 -1
  150. package/dist/chunk-L54YNLSE.js +0 -2
  151. package/dist/chunk-L54YNLSE.js.map +0 -1
  152. package/dist/chunk-LPGMLJMO.js +0 -259
  153. package/dist/chunk-LPGMLJMO.js.map +0 -1
  154. package/dist/chunk-M2T6XKT5.js.map +0 -1
  155. package/dist/chunk-OHG7ROFC.js +0 -11
  156. package/dist/chunk-OHG7ROFC.js.map +0 -1
  157. package/dist/chunk-PANKMCFX.cjs +0 -4
  158. package/dist/chunk-PANKMCFX.cjs.map +0 -1
  159. package/dist/chunk-Q6HUGWO6.js.map +0 -1
  160. package/dist/chunk-QDV75OJ4.js +0 -112
  161. package/dist/chunk-QDV75OJ4.js.map +0 -1
  162. package/dist/chunk-QEBO3EQP.cjs.map +0 -1
  163. package/dist/chunk-QVIZ775M.cjs +0 -259
  164. package/dist/chunk-QVIZ775M.cjs.map +0 -1
  165. package/dist/chunk-RMUMR42R.cjs +0 -10
  166. package/dist/chunk-RMUMR42R.cjs.map +0 -1
  167. package/dist/chunk-S26DZVRQ.cjs.map +0 -1
  168. package/dist/chunk-T2HQYRA7.cjs.map +0 -1
  169. package/dist/chunk-ULXNEG66.js +0 -60
  170. package/dist/chunk-ULXNEG66.js.map +0 -1
  171. package/dist/chunk-WD2HTKRR.cjs.map +0 -1
  172. package/dist/chunk-XZNOV52K.cjs.map +0 -1
  173. package/dist/chunk-Y6VCTLCJ.js.map +0 -1
  174. package/dist/core-plugins-reexport.cjs.map +0 -1
  175. package/dist/core-plugins-reexport.js.map +0 -1
  176. package/dist/core-reexport.cjs.map +0 -1
  177. package/dist/core-reexport.js.map +0 -1
  178. package/dist/executor-K5RXUTTR.js +0 -2
  179. package/dist/executor-K5RXUTTR.js.map +0 -1
  180. package/dist/executor-XIPIU3H4.cjs +0 -2
  181. package/dist/executor-XIPIU3H4.cjs.map +0 -1
  182. package/dist/headless-reexport.cjs.map +0 -1
  183. package/dist/headless-reexport.js.map +0 -1
  184. package/dist/index.cjs.map +0 -1
  185. package/dist/index.css.map +0 -1
  186. package/dist/index.js.map +0 -1
  187. package/dist/mcp-reexport.cjs.map +0 -1
  188. package/dist/mcp-reexport.js.map +0 -1
  189. package/dist/processTemplate-G37IM66O.js.map +0 -1
  190. package/dist/processTemplate-RFBGVH7T.cjs +0 -2
  191. package/dist/processTemplate-RFBGVH7T.cjs.map +0 -1
  192. package/dist/react.cjs.map +0 -1
  193. package/dist/react.css.map +0 -1
  194. package/dist/react.js.map +0 -1
  195. package/dist/selectionRects-6DU7HN7E.js +0 -2
  196. package/dist/selectionRects-6DU7HN7E.js.map +0 -1
  197. package/dist/selectionRects-YZSC24ZP.cjs +0 -2
  198. package/dist/selectionRects-YZSC24ZP.cjs.map +0 -1
  199. package/dist/ui.cjs.map +0 -1
  200. package/dist/ui.js.map +0 -1
@@ -0,0 +1,111 @@
1
+ 'use strict';var chunkP3AEZKQO_cjs=require('./chunk-P3AEZKQO.cjs'),chunkNVAQQYBJ_cjs=require('./chunk-NVAQQYBJ.cjs'),chunkJRRTZZ72_cjs=require('./chunk-JRRTZZ72.cjs'),hr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var hr__default=/*#__PURE__*/_interopDefault(hr);var Qt=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 4v4M8 10v1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),qt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M13 3L3 13M3 3h4v4M13 13h-4v-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),eo=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),to=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 4h10M3 8h7M3 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),oo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 3h6M5 3v6M3 5c0 2 1 4 2 4s2-2 2-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M9 7l3 6M15 7l-3 6M10 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ro=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 6c0-1.1.9-2 2-2s2 .9 2 2c0 1.5-2 1.5-2 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"8",cy:"12",r:"0.5",fill:"currentColor"})]}),no=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M4 12l3-8 3 8M5 10h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 6l2 2-2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),io=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 7h4M6 9h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ao=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"5",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 9c.5.5 1 1 2 1s1.5-.5 2-1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"6",cy:"7",r:"0.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"10",cy:"7",r:"0.5",fill:"currentColor"})]}),so=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});function lo(e){switch(e){case "askAI":return jsxRuntime.jsx(Qt,{});case "rewrite":return jsxRuntime.jsx(qt,{});case "expand":return jsxRuntime.jsx(eo,{});case "summarize":return jsxRuntime.jsx(to,{});case "translate":return jsxRuntime.jsx(oo,{});case "explain":return jsxRuntime.jsx(ro,{});case "fixGrammar":return jsxRuntime.jsx(no,{});case "makeFormal":return jsxRuntime.jsx(io,{});case "makeCasual":return jsxRuntime.jsx(ao,{});case "custom":return jsxRuntime.jsx(so,{});default:return null}}var co=({action:e,onClick:t,isHighlighted:o,onMouseEnter:i})=>{let n=chunkNVAQQYBJ_cjs.e(e),r=chunkNVAQQYBJ_cjs.f(e),a=lo(e);return jsxRuntime.jsxs("button",{type:"button",className:`docx-context-menu-item ${o?"docx-context-menu-item-highlighted":""}`,onClick:t,onMouseEnter:i,title:r,role:"menuitem",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"8px 12px",border:"none",background:o?"var(--doc-primary-light)":"transparent",cursor:"pointer",fontSize:"13px",color:"var(--doc-text)",textAlign:"left"},children:[jsxRuntime.jsx("span",{style:{display:"flex",color:"var(--doc-text-muted)"},children:a}),jsxRuntime.jsx("span",{children:n})]})},po=({isOpen:e,onSubmit:t,onClose:o,selectedText:i})=>{let[n,r]=hr.useState(""),a=hr.useRef(null);hr.useEffect(()=>{e&&a.current&&a.current.focus();},[e]);let d=l=>{l.preventDefault(),n.trim()&&(t(n.trim()),r(""));},s=l=>{l.key==="Escape"&&o();};return e?jsxRuntime.jsx("div",{className:"docx-custom-prompt-dialog",style:{position:"absolute",top:"100%",left:0,right:0,padding:"8px",background:"white",borderTop:"1px solid var(--doc-border)"},children:jsxRuntime.jsxs("form",{onSubmit:d,children:[jsxRuntime.jsxs("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:['Selected: "',i.slice(0,50),i.length>50?"...":"",'"']}),jsxRuntime.jsx("input",{ref:a,type:"text",value:n,onChange:l=>r(l.target.value),onKeyDown:s,placeholder:"Enter custom prompt...",style:{width:"100%",padding:"8px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",fontSize:"13px"}}),jsxRuntime.jsxs("div",{style:{marginTop:"8px",display:"flex",gap:"8px",justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",onClick:o,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px"},children:"Cancel"}),jsxRuntime.jsx("button",{type:"submit",disabled:!n.trim(),style:{padding:"6px 12px",border:"none",borderRadius:"4px",background:n.trim()?"var(--doc-primary)":"var(--doc-border)",color:n.trim()?"white":"var(--doc-text-placeholder)",cursor:n.trim()?"pointer":"not-allowed",fontSize:"12px"},children:"Send"})]})]})}):null},Kn=({isOpen:e,position:t,selectedText:o,selectionContext:i,onAction:n,onClose:r,actions:a=chunkNVAQQYBJ_cjs.g,showCustomPrompt:d=true,className:s=""})=>{let l=hr.useRef(null),[h,m]=hr.useState(0),[p,u]=hr.useState(false),x=d?[...a,"custom"]:a;hr.useEffect(()=>{if(!e)return;let c=b=>{l.current&&!l.current.contains(b.target)&&r();};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[e,r]),hr.useEffect(()=>{if(!e)return;let c=b=>{switch(b.key){case "Escape":p?u(false):r();break;case "ArrowDown":b.preventDefault(),m(P=>(P+1)%x.length);break;case "ArrowUp":b.preventDefault(),m(P=>(P-1+x.length)%x.length);break;case "Enter":b.preventDefault();let C=x[h];C==="custom"?u(true):(n(C),r());break}};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,h,x,n,r,p]),hr.useEffect(()=>{e&&(m(0),u(false));},[e]);let v=hr.useCallback(()=>{let b=x.length*36+16,C=t.x,P=t.y;return typeof window<"u"&&(C+200>window.innerWidth&&(C=window.innerWidth-200-10),P+b>window.innerHeight&&(P=window.innerHeight-b-10),C<10&&(C=10),P<10&&(P=10)),{position:"fixed",top:P,left:C,minWidth:200,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:1e4,padding:"4px 0",overflow:"hidden"}},[t,x.length]),g=c=>{c==="custom"?u(true):(n(c),r());},f=c=>{n("custom",c),r();};return !e||!o?null:jsxRuntime.jsxs("div",{ref:l,className:`docx-context-menu ${s}`,style:v(),role:"menu","aria-label":"AI actions menu",children:[jsxRuntime.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--doc-border)",fontSize:"11px",color:"var(--doc-text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:['"',o.slice(0,30),o.length>30?"...":"",'"']}),jsxRuntime.jsx("div",{role:"group",children:x.map((c,b)=>jsxRuntime.jsx(co,{action:c,onClick:()=>g(c),isHighlighted:b===h,onMouseEnter:()=>m(b)},c))}),d&&jsxRuntime.jsx(po,{isOpen:p,onSubmit:f,onClose:()=>u(false),selectedText:o})]})};function $n(){let[e,t]=hr.useState(false),[o,i]=hr.useState({x:0,y:0}),[n,r]=hr.useState(""),[a,d]=hr.useState(),s=hr.useCallback((h,m,p)=>{h.preventDefault(),i({x:h.clientX,y:h.clientY}),r(m),d(p),t(true);},[]),l=hr.useCallback(()=>{t(false);},[]);return {isOpen:e,position:o,selectedText:n,selectionContext:a,openMenu:s,closeMenu:l}}function Gn(e){return {rewrite:"Ctrl+Shift+R",summarize:"Ctrl+Shift+S",translate:"Ctrl+Shift+T",fixGrammar:"Ctrl+Shift+G"}[e]}function jn(e,t,o){return !(!t||t.trim().length===0)}function Zn(){return [...chunkNVAQQYBJ_cjs.g]}function Xn(){return ["askAI","rewrite","expand","summarize","translate","explain","fixGrammar","makeFormal","makeCasual","custom"]}var uo=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 8l4 4 6-8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),gt=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),go=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 8a6 6 0 0111.318-2.828M14 8a6 6 0 01-11.318 2.828",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M13 2v4h-4M3 14v-4h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),mo=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11 2l3 3-9 9H2v-3l9-9z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),xo=()=>jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{animation:"spin 1s linear infinite"},children:[jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",stroke:"var(--doc-border)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("path",{d:"M10 2a8 8 0 018 8",stroke:"var(--doc-primary)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),jsxRuntime.jsx("style",{children:`
2
+ @keyframes spin {
3
+ from { transform: rotate(0deg); }
4
+ to { transform: rotate(360deg); }
5
+ }
6
+ `})]});function fo(e,t){let o=[],i=e.split(/(\s+)/),n=t.split(/(\s+)/),r=0,a=0;for(;r<i.length||a<n.length;){if(r>=i.length){o.push({type:"added",text:n.slice(a).join("")});break}if(a>=n.length){o.push({type:"removed",text:i.slice(r).join("")});break}if(i[r]===n[a])o.push({type:"same",text:i[r]}),r++,a++;else {let s=n.indexOf(i[r],a),l=i.indexOf(n[a],r);s===-1&&l===-1?(o.push({type:"removed",text:i[r]}),o.push({type:"added",text:n[a]}),r++,a++):l!==-1&&(s===-1||l-r<=s-a)?(o.push({type:"added",text:n[a]}),a++):(o.push({type:"removed",text:i[r]}),r++);}}let d=[];for(let s of o)d.length>0&&d[d.length-1].type===s.type?d[d.length-1].text+=s.text:d.push(s);return d}var ho=({original:e,modified:t})=>{let o=fo(e,t);return jsxRuntime.jsx("div",{className:"docx-response-diff",style:{lineHeight:1.6,fontSize:"14px"},children:o.map((i,n)=>{let r={};switch(i.type){case "removed":r={textDecoration:"line-through",color:"#d32f2f",backgroundColor:"#ffebee"};break;case "added":r={color:"#2e7d32",backgroundColor:"#e8f5e9"};break;}return jsxRuntime.jsx("span",{style:r,children:i.text},n)})})},oi=({originalText:e,response:t,action:o,isLoading:i,error:n,onAccept:r,onReject:a,onRetry:d,allowEdit:s=true,showDiff:l=true,className:h="",position:m})=>{let[p,u]=hr.useState(false),[x,v]=hr.useState(""),g=hr.useRef(null),f=hr.useRef(null),c=t?.newText||"";hr.useEffect(()=>{c&&v(c);},[c]),hr.useEffect(()=>{p&&g.current&&(g.current.focus(),g.current.select());},[p]),hr.useEffect(()=>{let I=D=>{D.key==="Escape"?p?(u(false),v(c)):a():D.key==="Enter"&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),b());};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[p,c,a]);let b=hr.useCallback(()=>{r(p?x:c);},[p,x,c,r]),C=hr.useCallback(()=>{u(true);},[]),P=hr.useCallback(()=>{u(false),v(c);},[c]),U={position:m?"fixed":"relative",...m&&{left:m.x,top:m.y},width:"400px",maxWidth:"90vw",maxHeight:"80vh",background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",zIndex:1e4,overflow:"hidden",display:"flex",flexDirection:"column"};return i?jsxRuntime.jsx("div",{ref:f,className:`docx-response-preview docx-response-preview-loading ${h}`,style:U,children:jsxRuntime.jsxs("div",{style:{padding:"24px",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px"},children:[jsxRuntime.jsx(xo,{}),jsxRuntime.jsxs("div",{style:{color:"var(--doc-text-muted)",fontSize:"14px"},children:[chunkNVAQQYBJ_cjs.e(o),"..."]})]})}):n?jsxRuntime.jsx("div",{ref:f,className:`docx-response-preview docx-response-preview-error ${h}`,style:U,children:jsxRuntime.jsxs("div",{style:{padding:"16px"},children:[jsxRuntime.jsx("div",{style:{padding:"12px",background:"var(--doc-error-bg)",borderRadius:"4px",color:"var(--doc-error)",fontSize:"13px",marginBottom:"16px"},children:n}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"},children:[d&&jsxRuntime.jsxs("button",{type:"button",onClick:d,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px"},children:[jsxRuntime.jsx(go,{}),"Retry"]}),jsxRuntime.jsx("button",{type:"button",onClick:a,style:{padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-border)",cursor:"pointer",fontSize:"13px"},children:"Close"})]})]})}):!t||!c?null:jsxRuntime.jsxs("div",{ref:f,className:`docx-response-preview ${h}`,style:U,children:[jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--doc-text)"},children:[chunkNVAQQYBJ_cjs.e(o)," Result"]}),jsxRuntime.jsx("button",{type:"button",onClick:a,style:{display:"flex",padding:"4px",border:"none",background:"transparent",cursor:"pointer",color:"var(--doc-text-muted)"},title:"Close (Esc)",children:jsxRuntime.jsx(gt,{})})]}),jsxRuntime.jsxs("div",{style:{padding:"16px",overflowY:"auto",flex:1},children:[p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:"Edit the result before accepting:"}),jsxRuntime.jsx("textarea",{ref:g,value:x,onChange:I=>v(I.target.value),style:{width:"100%",minHeight:"120px",padding:"12px",border:"1px solid var(--doc-primary)",borderRadius:"4px",fontSize:"14px",lineHeight:1.6,resize:"vertical",fontFamily:"inherit"}})]}):l?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:"Changes:"}),jsxRuntime.jsx(ho,{original:e,modified:c})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:"Original:"}),jsxRuntime.jsx("div",{style:{padding:"8px 12px",background:"var(--doc-bg-subtle)",borderRadius:"4px",marginBottom:"16px",textDecoration:"line-through",color:"var(--doc-text-placeholder)",fontSize:"13px"},children:e}),jsxRuntime.jsx("div",{style:{marginBottom:"8px",fontSize:"12px",color:"var(--doc-text-muted)"},children:"New:"}),jsxRuntime.jsx("div",{style:{padding:"8px 12px",background:"#e8f5e9",borderRadius:"4px",color:"#2e7d32",fontSize:"13px"},children:c})]}),t.warnings&&t.warnings.length>0&&jsxRuntime.jsx("div",{style:{marginTop:"16px",padding:"8px 12px",background:"var(--doc-warning-bg)",borderRadius:"4px",fontSize:"12px",color:"var(--doc-warning)"},children:t.warnings.map((I,D)=>jsxRuntime.jsx("div",{children:I},D))})]}),jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--doc-border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsxs("div",{children:[s&&!p&&jsxRuntime.jsxs("button",{type:"button",onClick:C,style:{display:"flex",alignItems:"center",gap:"4px",padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:[jsxRuntime.jsx(mo,{}),"Edit"]}),p&&jsxRuntime.jsx("button",{type:"button",onClick:P,style:{padding:"6px 12px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"12px",color:"var(--doc-text-muted)"},children:"Cancel Edit"})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px"},children:[jsxRuntime.jsxs("button",{type:"button",onClick:a,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"1px solid var(--doc-border-light)",borderRadius:"4px",background:"white",cursor:"pointer",fontSize:"13px",color:"var(--doc-text-muted)"},children:[jsxRuntime.jsx(gt,{}),"Reject"]}),jsxRuntime.jsxs("button",{type:"button",onClick:b,style:{display:"flex",alignItems:"center",gap:"4px",padding:"8px 16px",border:"none",borderRadius:"4px",background:"var(--doc-primary)",cursor:"pointer",fontSize:"13px",color:"white"},children:[jsxRuntime.jsx(uo,{}),"Accept"]})]})]})]})};function ri(){let[e,t]=hr.useState({isVisible:false,originalText:"",response:null,action:"rewrite",isLoading:false}),o=hr.useCallback((a,d,s)=>{t({isVisible:true,originalText:a,response:null,action:d,isLoading:true,position:s});},[]),i=hr.useCallback(a=>{t(d=>({...d,response:a,isLoading:false}));},[]),n=hr.useCallback(a=>{t(d=>({...d,error:a,isLoading:false}));},[]),r=hr.useCallback(()=>{t(a=>({...a,isVisible:false}));},[]);return {state:e,showPreview:o,setResponse:i,setError:n,hidePreview:r}}function ni(e,t){return {success:true,newText:e,warnings:t}}function ii(e){return {success:false,error:e}}var mt=[{action:"cut",label:"Cut",shortcut:"Ctrl+X"},{action:"copy",label:"Copy",shortcut:"Ctrl+C"},{action:"paste",label:"Paste",shortcut:"Ctrl+V"},{action:"pasteAsPlainText",label:"Paste as Plain Text",shortcut:"Ctrl+Shift+V",dividerAfter:true},{action:"delete",label:"Delete",shortcut:"Del",dividerAfter:true},{action:"selectAll",label:"Select All",shortcut:"Ctrl+A"}],vo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"4",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5.5 10.5L10.5 3M10.5 10.5L5.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),yo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"5",y:"5",width:"8",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M11 5V3a1 1 0 00-1-1H4a1 1 0 00-1 1v8a1 1 0 001 1h2",stroke:"currentColor",strokeWidth:"1.5"})]}),Co=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"10",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 3V2a1 1 0 011-1h2a1 1 0 011 1v1",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M6 8h4M6 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),So=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),wo=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2"}),jsxRuntime.jsx("rect",{x:"4",y:"4",width:"8",height:"8",fill:"currentColor",opacity:"0.3"})]});function ko(e){switch(e){case "cut":return jsxRuntime.jsx(vo,{});case "copy":return jsxRuntime.jsx(yo,{});case "paste":case "pasteAsPlainText":return jsxRuntime.jsx(Co,{});case "delete":return jsxRuntime.jsx(So,{});case "selectAll":return jsxRuntime.jsx(wo,{});default:return null}}var To=({item:e,onClick:t,isHighlighted:o,onMouseEnter:i})=>e.action==="separator"?jsxRuntime.jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",className:`docx-text-context-menu-item ${o?"docx-text-context-menu-item-highlighted":""} ${e.disabled?"docx-text-context-menu-item-disabled":""}`,onClick:t,onMouseEnter:i,disabled:e.disabled,role:"menuitem","aria-disabled":e.disabled,style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 12px",border:"none",background:o&&!e.disabled?"var(--doc-primary-light)":"transparent",cursor:e.disabled?"not-allowed":"pointer",fontSize:"13px",color:e.disabled?"var(--doc-text-subtle)":"var(--doc-text)",textAlign:"left",opacity:e.disabled?.6:1},children:[jsxRuntime.jsx("span",{style:{display:"flex",color:e.disabled?"var(--doc-border)":"var(--doc-text-muted)"},children:ko(e.action)}),jsxRuntime.jsx("span",{style:{flex:1},children:e.label}),e.shortcut&&jsxRuntime.jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),e.dividerAfter&&jsxRuntime.jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}})]}),di=({isOpen:e,position:t,hasSelection:o,isEditable:i,hasClipboardContent:n=true,onAction:r,onClose:a,items:d,className:s=""})=>{let l=hr.useRef(null),[h,m]=hr.useState(0),p=(d||mt).map(g=>{let f=(()=>{if(g.disabled!==void 0)return g.disabled;switch(g.action){case "cut":case "copy":case "delete":return !o;case "paste":case "pasteAsPlainText":return !i||!n;default:return false}})();return {...g,disabled:f}}),u=p.filter(g=>g.action!=="separator");hr.useEffect(()=>{if(!e)return;let g=c=>{l.current&&!l.current.contains(c.target)&&a();},f=setTimeout(()=>{document.addEventListener("mousedown",g);},0);return ()=>{clearTimeout(f),document.removeEventListener("mousedown",g);}},[e,a]),hr.useEffect(()=>{if(!e)return;let g=f=>{switch(f.key){case "Escape":f.preventDefault(),a();break;case "ArrowDown":f.preventDefault(),m(b=>{let C=(b+1)%u.length;for(;u[C]?.disabled&&C!==b;)C=(C+1)%u.length;return C});break;case "ArrowUp":f.preventDefault(),m(b=>{let C=(b-1+u.length)%u.length;for(;u[C]?.disabled&&C!==b;)C=(C-1+u.length)%u.length;return C});break;case "Enter":f.preventDefault();let c=u[h];c&&!c.disabled&&(r(c.action),a());break}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,h,u,r,a]),hr.useEffect(()=>{e&&m(0);},[e]);let x=hr.useCallback(()=>{let f=p.length*36+16,c=t.x,b=t.y;return typeof window<"u"&&(c+220>window.innerWidth&&(c=window.innerWidth-220-10),b+f>window.innerHeight&&(b=window.innerHeight-f-10),c<10&&(c=10),b<10&&(b=10)),{position:"fixed",top:b,left:c,minWidth:220,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:1e4,padding:"4px 0",overflow:"hidden"}},[t,p.length]),v=g=>{g.disabled||(r(g.action),a());};return e?jsxRuntime.jsx("div",{ref:l,className:`docx-text-context-menu ${s}`,style:x(),role:"menu","aria-label":"Text editing menu",children:p.map((g,f)=>{let c=u.findIndex(b=>b===g);return jsxRuntime.jsx(To,{item:g,onClick:()=>v(g),isHighlighted:c===h,onMouseEnter:()=>{c>=0&&!g.disabled&&m(c);}},`${g.action}-${f}`)})}):null};function pi(e={}){let{enabled:t=true,isEditable:o=true,containerRef:i,onAction:n}=e,[r,a]=hr.useState(false),[d,s]=hr.useState({x:0,y:0}),[l,h]=hr.useState(false),m=hr.useCallback(()=>{let g=window.getSelection(),f=g&&!g.isCollapsed&&g.toString().length>0;return h(!!f),!!f},[]),p=hr.useCallback(g=>{t&&(g.preventDefault(),g.stopPropagation(),m(),s({x:g.clientX,y:g.clientY}),a(true));},[t,m]),u=hr.useCallback(()=>{a(false);},[]),x=hr.useCallback(g=>{switch(u(),g){case "cut":document.execCommand("cut");break;case "copy":document.execCommand("copy");break;case "paste":document.execCommand("paste");break;case "pasteAsPlainText":navigator.clipboard.readText?.().then(f=>{document.execCommand("insertText",false,f);}).catch(()=>{document.execCommand("paste");});break;case "delete":document.execCommand("delete");break;case "selectAll":document.execCommand("selectAll");break}n?.(g);},[u,n]),v=hr.useCallback(g=>{p(g);},[p]);return hr.useEffect(()=>{if(!r)return;let g=f=>{f.key==="Escape"&&u();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r,u]),{isOpen:r,position:d,hasSelection:l,openMenu:p,closeMenu:u,handleAction:x,onContextMenu:v}}function ui(e){return {cut:"Cut",copy:"Copy",paste:"Paste",pasteAsPlainText:"Paste as Plain Text",selectAll:"Select All",delete:"Delete",separator:""}[e]}function gi(e){return {cut:"Ctrl+X",copy:"Ctrl+C",paste:"Ctrl+V",pasteAsPlainText:"Ctrl+Shift+V",selectAll:"Ctrl+A",delete:"Del",separator:""}[e]}function mi(){return [...mt]}function xi(e,t,o){switch(e){case "cut":case "copy":case "delete":return t;case "paste":case "pasteAsPlainText":return o;case "selectAll":return true;default:return true}}var Io=[{name:"Black",hex:"000000"},{name:"Dark Red",hex:"7F0000"},{name:"Dark Orange",hex:"FF6600"},{name:"Dark Yellow",hex:"808000"},{name:"Dark Green",hex:"006400"},{name:"Dark Teal",hex:"008080"},{name:"Dark Blue",hex:"000080"},{name:"Dark Purple",hex:"4B0082"},{name:"Dark Gray",hex:"404040"},{name:"Gray",hex:"808080"},{name:"Red",hex:"FF0000"},{name:"Orange",hex:"FF9900"},{name:"Yellow",hex:"FFFF00"},{name:"Light Green",hex:"00FF00"},{name:"Cyan",hex:"00FFFF"},{name:"Light Blue",hex:"0066FF"},{name:"Blue",hex:"0000FF"},{name:"Purple",hex:"9900FF"},{name:"Magenta",hex:"FF00FF"},{name:"Pink",hex:"FF66FF"},{name:"Light Red",hex:"FFCCCC"},{name:"Light Orange",hex:"FFE5CC"},{name:"Light Yellow",hex:"FFFFCC"},{name:"Pale Green",hex:"CCFFCC"},{name:"Light Cyan",hex:"CCFFFF"},{name:"Sky Blue",hex:"CCE5FF"},{name:"Light Blue 2",hex:"CCCCFF"},{name:"Lavender",hex:"E5CCFF"},{name:"Light Magenta",hex:"FFCCFF"},{name:"White",hex:"FFFFFF"}],Po=[{name:"No Color",hex:""},{name:"Yellow",hex:"FFFF00"},{name:"Bright Green",hex:"00FF00"},{name:"Cyan",hex:"00FFFF"},{name:"Magenta",hex:"FF00FF"},{name:"Blue",hex:"0000FF"},{name:"Red",hex:"FF0000"},{name:"Dark Blue",hex:"00008B"},{name:"Teal",hex:"008080"},{name:"Green",hex:"008000"},{name:"Violet",hex:"800080"},{name:"Dark Red",hex:"8B0000"},{name:"Dark Yellow",hex:"808000"},{name:"Gray 50%",hex:"808080"},{name:"Gray 25%",hex:"C0C0C0"},{name:"Black",hex:"000000"}],Lo={position:"relative",display:"inline-block"},Ae={display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"32px",padding:"2px 6px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Ro={...Ae,backgroundColor:"var(--doc-bg-hover)"},Do={...Ae,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Ao={...Ae,cursor:"default",opacity:.38},Mo={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0"},Oo={width:"14px",height:"3px",borderRadius:"0",marginTop:"-2px"},_o={display:"grid",gap:"2px"},Me={width:"20px",height:"20px",border:"1px solid #ccc",borderRadius:"2px",cursor:"pointer",transition:"transform 0.1s, border-color 0.1s",padding:0},No={...Me,transform:"scale(1.1)",borderColor:"#333",zIndex:1},Fo={...Me,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},Bo={...Me,position:"relative",backgroundColor:"#fff"},zo={position:"absolute",top:"50%",left:"-2px",right:"-2px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"},ft={fontSize:"11px",color:"#666",marginBottom:"4px",marginTop:"8px"},Wo={marginTop:"8px",paddingTop:"8px",borderTop:"1px solid #eee"},Yo={display:"flex",alignItems:"center",gap:"8px"},Uo={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},Ho={height:"24px",padding:"0 8px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Vo=()=>jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:"format_color_text",size:18}),Ko=()=>jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:"ink_highlighter",size:18}),$o=()=>jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:"arrow_drop_down",size:14});function Go({colors:e,selectedColor:t,onSelect:o,columns:i=10,cellSize:n=20}){let[r,a]=hr.useState(null),d={..._o,gridTemplateColumns:`repeat(${i}, ${n}px)`};return jsxRuntime.jsx("div",{style:d,className:"docx-color-grid",role:"grid",children:e.map((s,l)=>{let h=t?.toUpperCase()===s.hex.toUpperCase(),m=r===l,p=s.hex==="",u={...h?Fo:m?No:Me,width:`${n}px`,height:`${n}px`};return p||(u.backgroundColor=`#${s.hex}`),jsxRuntime.jsx("button",{type:"button",style:p?{...Bo,...u}:u,onClick:()=>o(s),onMouseDown:x=>x.preventDefault(),onMouseEnter:()=>a(l),onMouseLeave:()=>a(null),title:s.name,role:"gridcell","aria-label":s.name,"aria-selected":h,children:p&&jsxRuntime.jsx("span",{style:zo})},`${s.hex}-${l}`)})})}function Si({value:e,onChange:t,type:o="text",theme:i,colors:n,disabled:r=false,className:a,style:d,title:s,children:l,dropdownWidth:h=230,showNoColor:m=true,showMoreColors:p=true}){let[u,x]=hr.useState(false),[v,g]=hr.useState(false),[f,c]=hr.useState(""),b=hr.useCallback(()=>x(false),[]),{containerRef:C,dropdownRef:P,dropdownStyle:U}=chunkP3AEZKQO_cjs.e({isOpen:u,onClose:b}),I=hr.useMemo(()=>{if(o==="highlight")return Po;let M=[...Io];return m&&M.unshift({name:"Automatic",hex:"000000"}),M},[o,m]),D=n||I,N=hr.useMemo(()=>e?e.startsWith("#")?e:o==="highlight"?chunkJRRTZZ72_cjs.b(e)||"transparent":`#${e}`:o==="text"?"#000000":"transparent",[e,o]),y=hr.useCallback(M=>{t?.(M.hex),x(false);},[t]),H=hr.useCallback(()=>{let M=f.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(M)&&(t?.(M),x(false),c(""));},[f,t]),T=hr.useCallback(()=>{r||x(M=>!M);},[r]),L=r?Ao:u?Do:v?Ro:Ae,oe=o==="text"?"Font Color":"Text Highlight Color";return jsxRuntime.jsxs("div",{ref:C,className:`docx-color-picker docx-color-picker-${o} ${a||""}`,style:{...Lo,...d},children:[jsxRuntime.jsxs("button",{type:"button",className:"docx-color-picker-button",style:L,onClick:T,onMouseDown:M=>M.preventDefault(),onMouseEnter:()=>g(true),onMouseLeave:()=>g(false),disabled:r,title:s||oe,"aria-label":s||oe,"aria-haspopup":"true","aria-expanded":u,children:[l||jsxRuntime.jsxs("div",{style:Mo,children:[o==="text"?jsxRuntime.jsx(Vo,{}):jsxRuntime.jsx(Ko,{}),jsxRuntime.jsx("div",{style:{...Oo,backgroundColor:N==="transparent"?"#fff":N,border:N==="transparent"?"1px solid #ccc":"none"}})]}),jsxRuntime.jsx($o,{})]}),u&&jsxRuntime.jsxs("div",{ref:P,className:"docx-color-picker-dropdown",style:{...U,padding:"8px",backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",width:h},role:"dialog","aria-label":`${o==="text"?"Font":"Highlight"} color picker`,onMouseDown:M=>M.preventDefault(),children:[o==="highlight"&&jsxRuntime.jsx("div",{style:ft,children:"Highlight Colors"}),jsxRuntime.jsx(Go,{colors:D,selectedColor:e,onSelect:y,columns:o==="highlight"?8:10}),p&&o==="text"&&jsxRuntime.jsxs("div",{style:Wo,children:[jsxRuntime.jsx("div",{style:ft,children:"Custom Color"}),jsxRuntime.jsxs("div",{style:Yo,children:[jsxRuntime.jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsxRuntime.jsx("input",{type:"text",style:Uo,value:f,onChange:M=>c(M.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:M=>{M.key==="Enter"&&H();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsxRuntime.jsx("button",{type:"button",style:Ho,onClick:H,disabled:!/^[0-9A-Fa-f]{6}$/.test(f),children:"Apply"})]})]})]})]})}var jo={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function Ti({onPrint:e,disabled:t=false,label:o="Print",className:i="",style:n,showIcon:r=true,compact:a=false}){let d={display:"flex",alignItems:"center",gap:a?"4px":"6px",padding:a?"4px 8px":"6px 12px",fontSize:a?"13px":"14px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"4px",cursor:t?"not-allowed":"pointer",color:t?"var(--doc-text-muted)":"var(--doc-text)",opacity:t?.6:1,transition:"background-color 0.15s, border-color 0.15s",...n};return jsxRuntime.jsxs("button",{className:`docx-print-button ${i}`.trim(),style:d,onClick:e,disabled:t,"aria-label":o,title:o,children:[r&&jsxRuntime.jsx(Zo,{size:a?14:16}),!a&&jsxRuntime.jsx("span",{children:o})]})}function Ei(){return jsxRuntime.jsx("style",{children:`
7
+ @media print {
8
+ /* Hide everything except print content */
9
+ body * {
10
+ visibility: hidden;
11
+ }
12
+
13
+ .docx-print-pages,
14
+ .docx-print-pages * {
15
+ visibility: visible;
16
+ }
17
+
18
+ .docx-print-pages {
19
+ position: absolute;
20
+ left: 0;
21
+ top: 0;
22
+ }
23
+
24
+ /* Remove shadows and margins in print */
25
+ .docx-print-page {
26
+ box-shadow: none !important;
27
+ margin: 0 !important;
28
+ page-break-after: always;
29
+ page-break-inside: avoid;
30
+ }
31
+
32
+ /* Ensure images print */
33
+ img {
34
+ max-width: 100%;
35
+ page-break-inside: avoid;
36
+ }
37
+
38
+ /* Ensure tables don't break badly */
39
+ table {
40
+ page-break-inside: avoid;
41
+ }
42
+
43
+ tr {
44
+ page-break-inside: avoid;
45
+ }
46
+
47
+ /* Keep headings with content */
48
+ h1, h2, h3, h4, h5, h6 {
49
+ page-break-after: avoid;
50
+ }
51
+
52
+ /* Avoid orphan lines */
53
+ p {
54
+ orphans: 3;
55
+ widows: 3;
56
+ }
57
+ }
58
+
59
+ @page {
60
+ margin: 0;
61
+ size: auto;
62
+ }
63
+ `})}function Zo({size:e=18}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("polyline",{points:"6 9 6 2 18 2 18 9"}),jsxRuntime.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),jsxRuntime.jsx("rect",{x:"6",y:"14",width:"12",height:"8"})]})}function Ii(){window.print();}function Pi(e="Document",t){let o=window.open("","_blank");return o?(o.document.write(`
64
+ <!DOCTYPE html>
65
+ <html>
66
+ <head>
67
+ <title>${e}</title>
68
+ <style>
69
+ @media print {
70
+ body {
71
+ margin: 0;
72
+ padding: 0;
73
+ }
74
+ @page {
75
+ margin: 0;
76
+ }
77
+ }
78
+ </style>
79
+ </head>
80
+ <body>
81
+ ${t}
82
+ </body>
83
+ </html>
84
+ `),o.document.close(),o):null}function Li(){return {...jo}}function Ri(e,t){if(!e||!e.trim())return null;let o=e.trim();if(/^\d+$/.test(o)){let n=parseInt(o,10);return n>=1&&n<=t?{start:n,end:n}:null}let i=o.match(/^(\d+)-(\d+)$/);if(i){let n=parseInt(i[1],10),r=parseInt(i[2],10);return n>=1&&r<=t&&n<=r?{start:n,end:r}:null}return null}function Di(e,t){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${t} pages)`}function Ai(){return typeof window<"u"&&typeof window.print=="function"}function Yi({onAction:e,disabled:t=false,canMerge:o=false,canSplit:i=false}){let n=hr.useCallback(l=>{l.preventDefault(),l.stopPropagation();},[]),r=hr.useCallback(()=>{o&&e("mergeCells");},[e,o]),a=hr.useCallback(()=>{i&&e("splitCell");},[e,i]),d=jsxRuntime.jsx(chunkP3AEZKQO_cjs.i,{content:"Merge cells",children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.c,{variant:"ghost",size:"icon-sm",className:chunkP3AEZKQO_cjs.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!o)&&"opacity-30 cursor-not-allowed"),onMouseDown:n,onClick:r,disabled:t||!o,"aria-label":"Merge cells","data-testid":"toolbar-table-merge",children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:"call_merge",size:20})})}),s=jsxRuntime.jsx(chunkP3AEZKQO_cjs.i,{content:"Split cell",children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.c,{variant:"ghost",size:"icon-sm",className:chunkP3AEZKQO_cjs.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",(t||!i)&&"opacity-30 cursor-not-allowed"),onMouseDown:n,onClick:a,disabled:t||!i,"aria-label":"Split cell","data-testid":"toolbar-table-split",children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:"call_split",size:20})})});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d,s]})}var qo=[{action:"addRowAbove",icon:"keyboard_arrow_up",label:"Insert row above",testId:"toolbar-table-add-row-above"},{action:"addRowBelow",icon:"keyboard_arrow_down",label:"Insert row below",testId:"toolbar-table-add-row-below"},{action:"addColumnLeft",icon:"keyboard_arrow_left",label:"Insert column left",testId:"toolbar-table-add-col-left"},{action:"addColumnRight",icon:"keyboard_arrow_right",label:"Insert column right",testId:"toolbar-table-add-col-right"}];function Xi({onAction:e,disabled:t=false}){let o=hr.useCallback(i=>{i.preventDefault(),i.stopPropagation();},[]);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:qo.map(({action:i,icon:n,label:r,testId:a})=>jsxRuntime.jsx(chunkP3AEZKQO_cjs.i,{content:r,children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.c,{variant:"ghost",size:"icon-sm",className:chunkP3AEZKQO_cjs.a("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",t&&"opacity-30 cursor-not-allowed"),onMouseDown:o,onClick:()=>!t&&e(i),disabled:t,"aria-label":r,"data-testid":a,children:jsxRuntime.jsx(chunkP3AEZKQO_cjs.d,{name:n,size:20})})},typeof i=="string"?i:i.type))})}var tr="var(--doc-error)",or="var(--doc-success)",rr="You have unsaved changes. Are you sure you want to leave?",nr=({size:e=16})=>jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M3 2h8l2 2v9a1 1 0 01-1 1H3a1 1 0 01-1-1V3a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M5 2v4h5V2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M5 14v-4h6v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),ir=({size:e=16})=>jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor"})]}),ar=`
85
+ @keyframes docx-unsaved-pulse {
86
+ 0%, 100% { opacity: 1; }
87
+ 50% { opacity: 0.6; }
88
+ }
89
+ `,sr=(e,t,o,i,n,r,a)=>{let d={display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",animation:o&&i?"docx-unsaved-pulse 2s ease-in-out infinite":"none"};switch(t==="absolute-top-right"?(d.position="absolute",d.top="4px",d.right="4px"):t==="absolute-top-left"&&(d.position="absolute",d.top="4px",d.left="4px"),e){case "dot":return {...d,width:`${a}px`,height:`${a}px`,borderRadius:"50%",backgroundColor:o?n:r};case "badge":return {...d,padding:"2px 8px",borderRadius:"10px",fontSize:"11px",fontWeight:500,backgroundColor:o?n:r,color:"white"};case "text":return {...d,fontSize:"12px",color:o?n:r,fontWeight:500};case "icon":return {...d,color:o?n:r};default:return d}},ta=({hasUnsavedChanges:e,variant:t="dot",position:o="inline",showPulse:i=true,label:n="Unsaved",savedLabel:r="Saved",showWhenSaved:a=false,unsavedColor:d=tr,savedColor:s=or,size:l=8,className:h="",style:m,onClick:p,title:u})=>{if(hr.useEffect(()=>{if(!i||!e)return;let c="docx-unsaved-pulse-keyframes";if(!document.getElementById(c)){let b=document.createElement("style");b.id=c,b.textContent=ar,document.head.appendChild(b);}},[i,e]),!e&&!a)return null;let v={...sr(t,o,e,i,d,s,l),...m,cursor:p?"pointer":void 0},g=e?"Document has unsaved changes":"All changes saved",f=()=>{switch(t){case "dot":return null;case "badge":return e?n:r;case "text":return e?n:r;case "icon":return e?jsxRuntime.jsx(ir,{size:l}):jsxRuntime.jsx(nr,{size:l});default:return null}};return jsxRuntime.jsx("span",{className:`docx-unsaved-indicator docx-unsaved-indicator-${t} ${e?"docx-unsaved":"docx-saved"} ${h}`,style:v,onClick:p,title:u??g,role:p?"button":"status","aria-label":e?"Unsaved changes":"All changes saved",children:f()})};function oa(e={}){let{document:t,warnBeforeLeave:o=true,warningMessage:i=rr,enabled:n=true,onChangeStatusChange:r}=e,[a,d]=hr.useState(false),[s,l]=hr.useState(0),[h,m]=hr.useState(null),p=hr.useRef(null),u=hr.useRef(false),x=hr.useCallback(c=>{if(!c)return null;try{return JSON.stringify(c.package)}catch{return null}},[]),v=hr.useCallback(()=>{n&&(d(false),l(0),m(t??null),p.current=x(t));},[n,t,x]),g=hr.useCallback(()=>{n&&(a||(d(true),r?.(true)),l(c=>c+1));},[n,a,r]),f=hr.useCallback(c=>{let b=c!==void 0?c:t;d(false),l(0),m(b??null),p.current=x(b),u.current=true;},[t,x]);return hr.useEffect(()=>{!n||!t||u.current||f(t);},[n,t,f]),hr.useEffect(()=>{if(!n||!t||!u.current)return;let c=x(t),b=p.current;if(c!==b){let C=x(h);c!==C?(a||(d(true),r?.(true)),l(P=>P+1)):a&&(d(false),r?.(false)),p.current=c;}},[n,t,h,a,x,r]),hr.useEffect(()=>{if(!n||!o||!a)return;let c=b=>(b.preventDefault(),b.returnValue=i,i);return window.addEventListener("beforeunload",c),()=>window.removeEventListener("beforeunload",c)},[n,o,a,i]),{hasUnsavedChanges:a,markAsSaved:v,markAsChanged:g,resetTracking:f,lastSavedDocument:h,changeCount:s}}function ra(e){return {dot:"Dot",badge:"Badge",text:"Text",icon:"Icon"}[e]}function na(){return ["dot","badge","text","icon"]}function ia(){return ["inline","absolute-top-right","absolute-top-left"]}function aa(){let e=0,t=null,o=false;return {markChanged:()=>{e++,o=true;},markSaved:()=>{o=false,t=new Date;},getState:()=>({changeCount:e,lastSaveTime:t,hasUnsavedChanges:o}),reset:()=>{e=0,t=null,o=false;}}}var lr={small:{size:16,strokeWidth:2,fontSize:11},medium:{size:32,strokeWidth:3,fontSize:13},large:{size:48,strokeWidth:4,fontSize:14}},cr="var(--doc-primary)",dr=300,pr=`
90
+ @keyframes docx-loading-spin {
91
+ 0% { transform: rotate(0deg); }
92
+ 100% { transform: rotate(360deg); }
93
+ }
94
+
95
+ @keyframes docx-loading-pulse {
96
+ 0%, 100% { opacity: 1; transform: scale(1); }
97
+ 50% { opacity: 0.5; transform: scale(0.95); }
98
+ }
99
+
100
+ @keyframes docx-loading-dots {
101
+ 0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
102
+ 40% { transform: scale(1); opacity: 1; }
103
+ }
104
+
105
+ @keyframes docx-loading-bar {
106
+ 0% { left: -35%; right: 100%; }
107
+ 60% { left: 100%; right: -90%; }
108
+ 100% { left: 100%; right: -90%; }
109
+ }
110
+ `,ur=({size:e,strokeWidth:t,color:o})=>{let i=(e-t)/2,n=i*2*Math.PI;return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,style:{animation:"docx-loading-spin 1s linear infinite"},children:[jsxRuntime.jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${n*.75} ${n}`,opacity:.25}),jsxRuntime.jsx("circle",{cx:e/2,cy:e/2,r:i,fill:"none",stroke:o,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${n*.25} ${n}`,transform:`rotate(-90 ${e/2} ${e/2})`})]})},gr=({size:e,color:t})=>{let o=e/4,i=o/2;return jsxRuntime.jsx("div",{style:{display:"flex",gap:`${i}px`},children:[0,1,2].map(n=>jsxRuntime.jsx("div",{style:{width:o,height:o,borderRadius:"50%",backgroundColor:t,animation:`docx-loading-dots 1.4s ease-in-out ${n*.16}s infinite both`}},n))})},mr=({size:e,color:t})=>jsxRuntime.jsx("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:jsxRuntime.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:t,borderRadius:e/8,animation:"docx-loading-bar 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"}})}),xr=({size:e,color:t})=>jsxRuntime.jsx("div",{style:{width:e,height:e,borderRadius:"50%",backgroundColor:t,animation:"docx-loading-pulse 1.5s ease-in-out infinite"}}),fr=({size:e,color:t,progress:o,showText:i,fontSize:n})=>{let r=Math.max(0,Math.min(100,o));return jsxRuntime.jsxs("div",{style:{width:e*3,height:e/4,backgroundColor:`${t}20`,borderRadius:e/8,overflow:"hidden",position:"relative"},children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,width:`${r}%`,backgroundColor:t,borderRadius:e/8,transition:"width 0.3s ease"}}),i&&jsxRuntime.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:n,fontWeight:500,color:r>50?"#fff":t},children:[Math.round(r),"%"]})]})},pa=({isLoading:e,variant:t="spinner",size:o="medium",message:i,overlay:n=false,overlayOpacity:r=.5,progress:a=0,showProgressText:d=true,color:s=cr,className:l="",style:h})=>{let m=lr[o];if(hr.useEffect(()=>{let x="docx-loading-keyframes";if(!document.getElementById(x)){let v=document.createElement("style");v.id=x,v.textContent=pr,document.head.appendChild(v);}},[]),!e)return null;let p=()=>{switch(t){case "spinner":return jsxRuntime.jsx(ur,{size:m.size,strokeWidth:m.strokeWidth,color:s});case "dots":return jsxRuntime.jsx(gr,{size:m.size,color:s});case "bar":return jsxRuntime.jsx(mr,{size:m.size,color:s});case "pulse":return jsxRuntime.jsx(xr,{size:m.size,color:s});case "progress":return jsxRuntime.jsx(fr,{size:m.size,color:s,progress:a,showText:d,fontSize:m.fontSize});default:return null}},u=jsxRuntime.jsxs("div",{className:`docx-loading-content ${l}`,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",...h},children:[p(),i&&jsxRuntime.jsx("div",{style:{fontSize:m.fontSize,color:n?"white":"var(--doc-text-muted)",textAlign:"center"},children:i})]});return n?jsxRuntime.jsx("div",{className:`docx-loading-overlay ${l}`,style:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`rgba(0, 0, 0, ${r})`,zIndex:1e4,...h},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?a:void 0,"aria-busy":"true","aria-label":i||"Loading",children:u}):jsxRuntime.jsx("div",{className:`docx-loading-inline ${l}`,style:{display:"inline-flex",alignItems:"center",...h},role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t==="progress"?a:void 0,"aria-busy":"true","aria-label":i||"Loading",children:u})};function ua(e={}){let{initialLoading:t=false,minDuration:o=dr,onStart:i,onEnd:n}=e,[r,a]=hr.useState(t),[d,s]=hr.useState(null),[l,h]=hr.useState(0),m=hr.useRef(null),p=hr.useRef(null),u=hr.useCallback(g=>{m.current=Date.now(),a(true),s(g||null),h(0),i?.();},[i]),x=hr.useCallback(()=>{let g=m.current,f=Date.now(),c=g?f-g:0,b=Math.max(0,o-c);b>0?p.current=setTimeout(()=>{a(false),s(null),h(0),m.current=null,n?.();},b):(a(false),s(null),h(0),m.current=null,n?.());},[o,n]),v=hr.useCallback(async(g,f)=>{u(f);try{let c=await g();return x(),c}catch(c){throw x(),c}},[u,x]);return hr.useEffect(()=>()=>{p.current&&clearTimeout(p.current);},[]),{isLoading:r,message:d,progress:l,startLoading:u,stopLoading:x,setProgress:h,setMessage:s,withLoading:v}}function ga(){let[e,t]=hr.useState(new Map),o=hr.useCallback((d,s)=>{t(l=>{let h=new Map(l);return h.set(d,{id:d,message:s,startTime:Date.now()}),h});},[]),i=hr.useCallback((d,s)=>{t(l=>{let h=l.get(d);if(!h)return l;let m=new Map(l);return m.set(d,{...h,...s}),m});},[]),n=hr.useCallback(d=>{t(s=>{let l=new Map(s);return l.delete(d),l});},[]),r=e.size>0;return {operations:Array.from(e.values()),isAnyLoading:r,startOperation:o,updateOperation:i,endOperation:n,getOperation:d=>e.get(d)}}function ma(e){return {spinner:"Spinner",dots:"Dots",bar:"Bar",pulse:"Pulse",progress:"Progress"}[e]}function xa(){return ["spinner","dots","bar","pulse","progress"]}function fa(){return ["small","medium","large"]}function ha(e){return new Promise(t=>setTimeout(t,e))}var wt=4,kt=36,yr=32,Cr=()=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"3",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"13",cy:"8",r:"1.5",fill:"currentColor"})]});function Sr(e){let{containerRef:t,items:o,itemGap:i=wt,overflowButtonWidth:n=kt}=e,[r,a]=hr.useState(o.length),d=hr.useRef(new Map),s=hr.useCallback(()=>{let m=t.current;if(!m){a(o.length);return}let p=m.offsetWidth;if(p===0)return;let u=[...o].sort((g,f)=>g.alwaysVisible&&!f.alwaysVisible?-1:!g.alwaysVisible&&f.alwaysVisible?1:(g.priority||3)-(f.priority||3)),x=0,v=0;for(let g of u){let c=(g.minWidth||d.current.get(g.id)||yr)+(v>0?i:0),b=v<o.length-1?n+i:0;if(x+c+b<=p)x+=c,v++;else if(g.alwaysVisible)x+=c,v++;else break}a(Math.max(0,v));},[t,o,i,n]);hr.useLayoutEffect(()=>{let m=t.current;if(!m)return;s();let p=new ResizeObserver(()=>{s();});return p.observe(m),()=>{p.disconnect();}},[t,s]),hr.useEffect(()=>{s();},[o,s]);let{visibleItems:l,overflowItems:h}=hr.useMemo(()=>{let m=[...o].sort((p,u)=>p.alwaysVisible&&!u.alwaysVisible?-1:!p.alwaysVisible&&u.alwaysVisible?1:(p.priority||3)-(u.priority||3));return {visibleItems:m.slice(0,r),overflowItems:m.slice(r)}},[o,r]);return {visibleItems:l,overflowItems:h,hasOverflow:h.length>0,recalculate:s}}var wr=({items:e,isOpen:t,onClose:o,anchorRef:i})=>{let n=hr.useRef(null);return hr.useEffect(()=>{if(!t)return;let r=a=>{n.current&&!n.current.contains(a.target)&&i.current&&!i.current.contains(a.target)&&o();};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[t,o,i]),hr.useEffect(()=>{if(!t)return;let r=a=>{a.key==="Escape"&&o();};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,o]),!t||e.length===0?null:jsxRuntime.jsx("div",{ref:n,className:"docx-responsive-toolbar-overflow-menu",style:{position:"absolute",top:"100%",right:0,marginTop:"4px",backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",padding:"8px",zIndex:1e3,display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"300px"},role:"menu",children:e.map(r=>jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-overflow-item",role:"menuitem",children:r.content},r.id))})},Ca=({items:e,overflowItems:t=[],alwaysShowOverflow:o=false,renderOverflowButton:i,renderOverflowMenu:n,itemGap:r=wt,padding:a="8px 12px",overflowButtonWidth:d=kt,className:s="",style:l,height:h=44,backgroundColor:m="var(--doc-toolbar-bg)",borderBottom:p="1px solid var(--doc-border)"})=>{let u=hr.useRef(null),x=hr.useRef(null),[v,g]=hr.useState(false),{visibleItems:f,overflowItems:c,hasOverflow:b}=Sr({containerRef:u,items:e,itemGap:r,overflowButtonWidth:d}),C=[...c,...t],P=b||o||t.length>0,U=hr.useCallback(()=>{g(N=>!N);},[]),I=hr.useCallback(()=>{g(false);},[]),D=jsxRuntime.jsx("button",{ref:x,type:"button",className:"docx-responsive-toolbar-overflow-button",onClick:U,"aria-label":`Show ${C.length} more options`,"aria-expanded":v,"aria-haspopup":"menu",style:{display:"flex",alignItems:"center",justifyContent:"center",width:`${d}px`,height:"32px",border:"none",borderRadius:"4px",backgroundColor:v?"var(--doc-primary-light)":"transparent",color:"var(--doc-text-muted)",cursor:"pointer",transition:"background-color 0.15s ease"},children:jsxRuntime.jsx(Cr,{})});return jsxRuntime.jsxs("div",{ref:u,className:`docx-responsive-toolbar ${s}`,style:{display:"flex",alignItems:"center",gap:`${r}px`,height:typeof h=="number"?`${h}px`:h,padding:a,backgroundColor:m,borderBottom:p,position:"relative",...l},children:[f.map(N=>jsxRuntime.jsxs(hr__default.default.Fragment,{children:[jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-item","data-item-id":N.id,style:{flexShrink:0},children:N.content}),N.separatorAfter&&jsxRuntime.jsx("div",{className:"docx-responsive-toolbar-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]},N.id)),P&&jsxRuntime.jsx("div",{style:{flex:1,minWidth:0}}),P&&jsxRuntime.jsxs("div",{style:{position:"relative",flexShrink:0},children:[i?i(C.length,v,U):D,n?v&&n(C,I):jsxRuntime.jsx(wr,{items:C,isOpen:v,onClose:I,anchorRef:x})]})]})},Sa=({children:e,gap:t=2,separatorAfter:o=false,className:i="",style:n})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:`docx-toolbar-group ${i}`,style:{display:"flex",alignItems:"center",gap:`${t}px`,...n},children:e}),o&&jsxRuntime.jsx("div",{className:"docx-toolbar-group-separator",style:{width:"1px",height:"24px",backgroundColor:"var(--doc-border)",margin:"0 4px"}})]});function wa(e,t,o){return {id:e,content:t,priority:3,...o}}function ka(e){return e.map(t=>({...t,priority:t.priority||3}))}function Ta(e){return {undo:1,redo:1,bold:1,italic:1,underline:2,fontFamily:2,fontSize:2,textColor:3,highlightColor:3,alignment:3,lists:4,indent:4,lineSpacing:5,styles:5}[e]||3}var Er={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},Ir={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"320px",maxWidth:"400px",width:"100%",margin:"20px"},Pr={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},Lr={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},Rr={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},Dr={padding:"20px"},Ar={display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"16px"},Mr={display:"grid",gap:"2px",padding:"4px",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",cursor:"pointer"},Rt={width:"24px",height:"24px",backgroundColor:"white",border:"1px solid var(--doc-border-dark)",borderRadius:"2px",transition:"background-color 0.1s, border-color 0.1s"},Or={...Rt,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)"},_r={marginTop:"8px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},Nr={display:"flex",alignItems:"center",gap:"12px",margin:"16px 0",color:"var(--doc-text-muted)",fontSize:"12px"},Et={flex:1,height:"1px",backgroundColor:"var(--doc-border)"},It={display:"flex",alignItems:"center",gap:"12px",marginBottom:"12px"},Pt={fontSize:"14px",fontWeight:500,color:"var(--doc-text)",minWidth:"80px"},Lt={width:"80px",padding:"8px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",textAlign:"center"},Fr={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},Qe={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},Br={...Qe,backgroundColor:"var(--doc-primary)",color:"white"},zr={...Qe,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Wr={...Qe,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function Yr(){return jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"2",width:"16",height:"16",stroke:"currentColor",strokeWidth:"1.5",fill:"none",rx:"1"}),jsxRuntime.jsx("line",{x1:"2",y1:"7",x2:"18",y2:"7",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"2",y1:"12",x2:"18",y2:"12",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"18",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("line",{x1:"13",y1:"2",x2:"13",y2:"18",stroke:"currentColor",strokeWidth:"1.5"})]})}function Ra({isOpen:e,onClose:t,onInsert:o,maxGridRows:i=8,maxGridColumns:n=10,maxRows:r=100,maxColumns:a=20,className:d,style:s}){let[l,h]=hr.useState(0),[m,p]=hr.useState(0),[u,x]=hr.useState(3),[v,g]=hr.useState(3),f=hr.useRef(null);hr.useEffect(()=>{e&&(h(0),p(0),x(3),g(3));},[e]),hr.useEffect(()=>{e&&f.current?.focus();},[e]);let c=hr.useCallback((T,L)=>{h(T),p(L);},[]),b=hr.useCallback(()=>{l>0&&m>0&&o({rows:l,columns:m});},[l,m,o]),C=hr.useCallback(()=>{let T=Math.min(Math.max(1,u),r),L=Math.min(Math.max(1,v),a);o({rows:T,columns:L});},[u,v,r,a,o]),P=hr.useCallback(T=>{T.key==="Escape"?t():T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),C());},[t,C]),U=hr.useCallback(T=>{T.target===T.currentTarget&&t();},[t]),I=hr.useCallback(T=>{let L=parseInt(T.target.value,10);isNaN(L)?T.target.value===""&&x(1):x(Math.min(Math.max(1,L),r));},[r]),D=hr.useCallback(T=>{let L=parseInt(T.target.value,10);isNaN(L)?T.target.value===""&&g(1):g(Math.min(Math.max(1,L),a));},[a]);if(!e)return null;let N=[];for(let T=1;T<=i;T++)for(let L=1;L<=n;L++){let oe=T<=l&&L<=m;N.push(jsxRuntime.jsx("div",{style:oe?Or:Rt,onMouseEnter:()=>c(T,L),onClick:b,role:"gridcell","aria-selected":oe},`${T}-${L}`));}let y=u>=1&&v>=1,H=l>0&&m>0?`${m} x ${l} Table`:"Hover to select size";return jsxRuntime.jsx("div",{className:`docx-insert-table-dialog-overlay ${d||""}`,style:{...Er,...s},onClick:U,onKeyDown:P,role:"dialog","aria-modal":"true","aria-labelledby":"insert-table-dialog-title",children:jsxRuntime.jsxs("div",{ref:f,className:"docx-insert-table-dialog",style:Ir,tabIndex:-1,children:[jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-header",style:Pr,children:[jsxRuntime.jsx("h2",{id:"insert-table-dialog-title",style:Lr,children:jsxRuntime.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[jsxRuntime.jsx(Yr,{}),"Insert Table"]})}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-close",style:Rr,onClick:t,"aria-label":"Close dialog",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-body",style:Dr,children:[jsxRuntime.jsxs("div",{className:"docx-insert-table-grid-container",style:Ar,children:[jsxRuntime.jsx("div",{className:"docx-insert-table-grid",style:{...Mr,gridTemplateColumns:`repeat(${n}, 1fr)`},onMouseLeave:()=>{h(0),p(0);},role:"grid","aria-label":"Table size selector",children:N}),jsxRuntime.jsx("div",{className:"docx-insert-table-grid-label",style:_r,children:H})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-separator",style:Nr,children:[jsxRuntime.jsx("div",{style:Et}),jsxRuntime.jsx("span",{children:"or specify size"}),jsxRuntime.jsx("div",{style:Et})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-inputs",children:[jsxRuntime.jsxs("div",{style:It,children:[jsxRuntime.jsx("label",{htmlFor:"insert-table-rows",style:Pt,children:"Rows:"}),jsxRuntime.jsx("input",{id:"insert-table-rows",type:"number",min:1,max:r,value:u,onChange:I,style:Lt})]}),jsxRuntime.jsxs("div",{style:It,children:[jsxRuntime.jsx("label",{htmlFor:"insert-table-cols",style:Pt,children:"Columns:"}),jsxRuntime.jsx("input",{id:"insert-table-cols",type:"number",min:1,max:a,value:v,onChange:D,style:Lt})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-table-dialog-footer",style:Fr,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-cancel",style:zr,onClick:t,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-table-dialog-insert",style:y?Br:Wr,onClick:C,disabled:!y,children:"Insert Table"})]})]})})}function Da(){let[e,t]=hr.useState(false),o=hr.useCallback(()=>t(true),[]),i=hr.useCallback(()=>t(false),[]),n=hr.useCallback(()=>t(r=>!r),[]);return {isOpen:e,open:o,close:i,toggle:n}}function Aa(e=3,t=3){return {rows:e,columns:t}}function Ma(e,t=100,o=20){return e.rows>=1&&e.rows<=t&&e.columns>=1&&e.columns<=o}function Oa(e,t=100,o=20){return {rows:Math.min(Math.max(1,e.rows),t),columns:Math.min(Math.max(1,e.columns),o)}}function _a(e){return `${e.columns} x ${e.rows}`}function Na(){return [{label:"2 x 2",config:{rows:2,columns:2}},{label:"3 x 3",config:{rows:3,columns:3}},{label:"4 x 4",config:{rows:4,columns:4}},{label:"2 x 4",config:{rows:2,columns:4}},{label:"4 x 2",config:{rows:4,columns:2}},{label:"5 x 5",config:{rows:5,columns:5}}]}var Hr={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},Vr={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"600px",width:"100%",margin:"20px",maxHeight:"90vh",overflow:"auto"},Kr={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},$r={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},Gr={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},jr={padding:"20px"},qe={border:"2px dashed var(--doc-border-input)",borderRadius:"8px",padding:"40px 20px",textAlign:"center",cursor:"pointer",transition:"border-color 0.2s, background-color 0.2s",marginBottom:"16px"},Zr={...qe,borderColor:"var(--doc-primary)",backgroundColor:"var(--doc-primary-light)"},Xr={...qe,padding:"20px",borderStyle:"solid",borderColor:"var(--doc-primary)"},Jr={display:"flex",justifyContent:"center",alignItems:"center",maxHeight:"250px",overflow:"hidden"},Qr={maxWidth:"100%",maxHeight:"250px",objectFit:"contain",borderRadius:"4px"},qr={fontSize:"48px",color:"var(--doc-text-placeholder)",marginBottom:"12px"},en={fontSize:"14px",color:"var(--doc-text-muted)",marginBottom:"8px"},tn={fontSize:"12px",color:"var(--doc-text-placeholder)"},At={marginBottom:"16px"},Mt={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},on={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box"},rn={display:"flex",alignItems:"center",gap:"12px"},Ot={width:"100px",padding:"8px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",textAlign:"center"},Nt={padding:"6px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"16px"},nn={...Nt,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)",color:"white"},an={fontSize:"12px",color:"var(--doc-text-muted)",marginTop:"8px",textAlign:"center"},sn={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},et={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},ln={...et,backgroundColor:"var(--doc-primary)",color:"white"},cn={...et,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},dn={...et,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function pn(){return jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"6",y:"10",width:"36",height:"28",rx:"2",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("circle",{cx:"16",cy:"20",r:"4",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"}),jsxRuntime.jsx("path",{d:"M6 32L16 24L26 34L36 22L42 28",stroke:"var(--doc-text-placeholder)",strokeWidth:"2",fill:"none"})]})}function un({locked:e}){return e?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M12 6V4a4 4 0 0 0-8 0v2H3v8h10V6h-1zm-6-2a2 2 0 0 1 4 0v2H6V4zm6 8H4V8h8v4z"})}):jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M10 6V4a2 2 0 0 0-4 0v2H4v8h8V6h-2zM6 4a2 2 0 0 1 4 0v2h-2V4H6v2H4v2H6V4zm4 8H6V8h4v4z"})})}function Ya({isOpen:e,onClose:t,onInsert:o,maxWidth:i=800,maxHeight:n=600,accept:r="image/*",className:a,style:d}){let[s,l]=hr.useState(null),[h,m]=hr.useState(false),[p,u]=hr.useState(0),[x,v]=hr.useState(0),[g,f]=hr.useState(""),[c,b]=hr.useState(true),[C,P]=hr.useState(1),[U,I]=hr.useState(null),D=hr.useRef(null),N=hr.useRef(null);hr.useEffect(()=>{e&&(l(null),m(false),u(0),v(0),f(""),b(true),P(1),I(null));},[e]);let y=hr.useCallback(E=>{if(!E.type.startsWith("image/")){I("Please select a valid image file");return}if(E.size>10*1024*1024){I("Image file is too large (max 10MB)");return}I(null);let W=new FileReader;W.onload=Zt=>{let at=Zt.target?.result,se=new Image;se.onload=()=>{let le=se.width,ce=se.height;if(le>i||ce>n){let Xt=i/le,Jt=n/ce,st=Math.min(Xt,Jt);le=Math.round(le*st),ce=Math.round(ce*st);}u(le),v(ce),P(se.width/se.height),l({src:at,width:le,height:ce,fileName:E.name,mimeType:E.type});},se.src=at;},W.onerror=()=>{I("Failed to read image file");},W.readAsDataURL(E);},[i,n]),H=hr.useCallback(E=>{let W=E.target.files?.[0];W&&y(W);},[y]),T=hr.useCallback(()=>{D.current?.click();},[]),L=hr.useCallback(E=>{E.preventDefault(),m(true);},[]),oe=hr.useCallback(E=>{E.preventDefault(),m(false);},[]),M=hr.useCallback(E=>{E.preventDefault(),m(false);let W=E.dataTransfer.files?.[0];W&&y(W);},[y]),Ht=hr.useCallback(E=>{let W=parseInt(E.target.value,10)||0;u(W),c&&C&&v(Math.round(W/C));},[c,C]),Vt=hr.useCallback(E=>{let W=parseInt(E.target.value,10)||0;v(W),c&&C&&u(Math.round(W*C));},[c,C]),Ue=hr.useCallback(()=>{s&&o({...s,width:p,height:x,alt:g||void 0});},[s,p,x,g,o]),Kt=hr.useCallback(E=>{E.key==="Escape"?t():E.key==="Enter"&&s&&!E.shiftKey&&(E.preventDefault(),Ue());},[t,s,Ue]),$t=hr.useCallback(E=>{E.target===E.currentTarget&&t();},[t]),Gt=hr.useCallback(()=>{l(null),u(0),v(0),f(""),I(null),D.current&&(D.current.value="");},[]);if(!e)return null;let it=s!==null&&p>0&&x>0,jt=()=>s?Xr:h?Zr:qe;return jsxRuntime.jsx("div",{className:`docx-insert-image-dialog-overlay ${a||""}`,style:{...Hr,...d},onClick:$t,onKeyDown:Kt,role:"dialog","aria-modal":"true","aria-labelledby":"insert-image-dialog-title",children:jsxRuntime.jsxs("div",{ref:N,className:"docx-insert-image-dialog",style:Vr,tabIndex:-1,children:[jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-header",style:Kr,children:[jsxRuntime.jsx("h2",{id:"insert-image-dialog-title",style:$r,children:"Insert Image"}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-close",style:Gr,onClick:t,"aria-label":"Close dialog",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-body",style:jr,children:[jsxRuntime.jsx("input",{ref:D,type:"file",accept:r,onChange:H,style:{display:"none"}}),jsxRuntime.jsx("div",{className:"docx-insert-image-dropzone",style:jt(),onClick:T,onDragOver:L,onDragLeave:oe,onDrop:M,role:"button",tabIndex:0,"aria-label":"Click or drag to upload image",children:s?jsxRuntime.jsx("div",{style:Jr,children:jsxRuntime.jsx("img",{src:s.src,alt:g||"Preview",style:Qr})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:qr,children:jsxRuntime.jsx(pn,{})}),jsxRuntime.jsx("div",{style:en,children:"Click to select or drag and drop an image"}),jsxRuntime.jsx("div",{style:tn,children:"PNG, JPG, GIF up to 10MB"})]})}),s?.fileName&&jsxRuntime.jsxs("div",{style:an,children:[s.fileName,jsxRuntime.jsx("button",{type:"button",onClick:E=>{E.stopPropagation(),Gt();},style:{marginLeft:"8px",background:"none",border:"none",color:"var(--doc-primary)",cursor:"pointer",fontSize:"12px"},children:"Change"})]}),U&&jsxRuntime.jsx("div",{style:{color:"var(--doc-error)",fontSize:"14px",marginBottom:"16px",textAlign:"center"},children:U}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{style:At,children:[jsxRuntime.jsx("label",{style:Mt,children:"Dimensions"}),jsxRuntime.jsxs("div",{style:rn,children:[jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:"Width:"}),jsxRuntime.jsx("input",{type:"number",value:p,onChange:Ht,min:1,max:i,style:Ot}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:"px"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>b(!c),style:c?nn:Nt,title:c?"Aspect ratio locked":"Aspect ratio unlocked",children:jsxRuntime.jsx(un,{locked:c})}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:"Height:"}),jsxRuntime.jsx("input",{type:"number",value:x,onChange:Vt,min:1,max:n,style:Ot}),jsxRuntime.jsx("span",{style:{fontSize:"14px",color:"var(--doc-text-muted)"},children:"px"})]})]}),jsxRuntime.jsxs("div",{style:At,children:[jsxRuntime.jsx("label",{htmlFor:"insert-image-alt",style:Mt,children:"Alt Text (optional)"}),jsxRuntime.jsx("input",{id:"insert-image-alt",type:"text",value:g,onChange:E=>f(E.target.value),placeholder:"Describe the image for accessibility",style:on})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-image-dialog-footer",style:sn,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-cancel",style:cn,onClick:t,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-image-dialog-insert",style:it?ln:dn,onClick:Ue,disabled:!it,children:"Insert Image"})]})]})})}function Ua(){let[e,t]=hr.useState(false),o=hr.useCallback(()=>t(true),[]),i=hr.useCallback(()=>t(false),[]),n=hr.useCallback(()=>t(r=>!r),[]);return {isOpen:e,open:o,close:i,toggle:n}}function Ha(e){return e.type.startsWith("image/")}function Va(){return [".png",".jpg",".jpeg",".gif",".webp",".bmp",".svg"]}function Ka(){return "image/png,image/jpeg,image/gif,image/webp,image/bmp,image/svg+xml"}function $a(e,t,o,i){if(e<=o&&t<=i)return {width:e,height:t};let n=o/e,r=i/t,a=Math.min(n,r);return {width:Math.round(e*a),height:Math.round(t*a)}}function Ga(e){let t=e.split(","),o=t[0].match(/:(.*?);/)?.[1]||"image/png",i=atob(t[1]),n=new Uint8Array(i.length);for(let r=0;r<i.length;r++)n[r]=i.charCodeAt(r);return new Blob([n],{type:o})}function ja(e){return new Promise((t,o)=>{let i=new Image;i.onload=()=>t({width:i.width,height:i.height}),i.onerror=()=>o(new Error("Failed to load image")),i.src=e;})}function Za(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var fn={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},hn={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"450px",maxWidth:"550px",width:"100%",margin:"20px",maxHeight:"80vh",display:"flex",flexDirection:"column"},bn={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},vn={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},yn={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},Cn={padding:"20px",flex:1,overflow:"auto"},Sn={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",marginBottom:"16px",boxSizing:"border-box"},wn={display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"16px"},Ft={padding:"6px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"12px",transition:"all 0.15s"},kn={...Ft,backgroundColor:"var(--doc-primary)",borderColor:"var(--doc-primary)",color:"white"},Tn={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",maxHeight:"250px",overflow:"auto"},En={width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--doc-border)",borderRadius:"4px",backgroundColor:"white",cursor:"pointer",fontSize:"18px",transition:"all 0.15s"},In={marginTop:"16px",padding:"12px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",display:"flex",alignItems:"center",gap:"16px"},Pn={fontSize:"36px",width:"60px",height:"60px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"white",borderRadius:"4px",border:"1px solid var(--doc-border)"},Ln={flex:1},Rn={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},tt={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},Dn={...tt,backgroundColor:"var(--doc-primary)",color:"white"},An={...tt,backgroundColor:"var(--doc-bg-subtle)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},Mn={...tt,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"},ke=[{name:"common",label:"Common",symbols:["\xA9","\xAE","\u2122","\u2022","\u2026","\u2014","\u2013","\xB0","\xB1","\xD7","\xF7","\u2260","\u2264","\u2265","\u221E","\u221A","\u2211","\u220F","\u222B","\u03C0","\u20AC","\xA3","\xA5","\xA2","\xA7","\xB6","\u2020","\u2021","\u2030","\u2116"]},{name:"arrows",label:"Arrows",symbols:["\u2190","\u2191","\u2192","\u2193","\u2194","\u2195","\u2196","\u2197","\u2198","\u2199","\u21D0","\u21D1","\u21D2","\u21D3","\u21D4","\u21D5","\u27F5","\u27F6","\u27F7","\u2794","\u279C","\u279E","\u27A1","\u27A2","\u27A3","\u27A4","\u27A5","\u27A6","\u27A7","\u27A8"]},{name:"math",label:"Math",symbols:["+","\u2212","\xD7","\xF7","=","\u2260","<",">","\u2264","\u2265","\xB1","\u2213","\u221E","\u221A","\u221B","\u221C","\u2211","\u220F","\u222B","\u2202","\u2206","\u2207","\u2208","\u2209","\u220B","\u2205","\u2200","\u2203","\u2204","\u2282","\u2283","\u2286","\u2287","\u222A","\u2229","\u2295","\u2297","\u22A5","\u2220","\u221F"]},{name:"greek",label:"Greek",symbols:["\u03B1","\u03B2","\u03B3","\u03B4","\u03B5","\u03B6","\u03B7","\u03B8","\u03B9","\u03BA","\u03BB","\u03BC","\u03BD","\u03BE","\u03BF","\u03C0","\u03C1","\u03C3","\u03C4","\u03C5","\u03C6","\u03C7","\u03C8","\u03C9","\u0391","\u0392","\u0393","\u0394","\u0395","\u0396","\u0397","\u0398","\u0399","\u039A","\u039B","\u039C","\u039D","\u039E","\u039F","\u03A0"]},{name:"shapes",label:"Shapes",symbols:["\u25A0","\u25A1","\u25AA","\u25AB","\u25AC","\u25AD","\u25AE","\u25AF","\u25B0","\u25B1","\u25B2","\u25B3","\u25B4","\u25B5","\u25B6","\u25B7","\u25B8","\u25B9","\u25BA","\u25BB","\u25BC","\u25BD","\u25BE","\u25BF","\u25C0","\u25C1","\u25C2","\u25C3","\u25C4","\u25C5","\u25CF","\u25CB","\u25CE","\u25C9","\u25CC","\u25CD","\u25D0","\u25D1","\u25D2","\u25D3"]},{name:"punctuation",label:"Punctuation",symbols:["\u2013","\u2014","\u2018","\u2019","\u201C","\u201D","\xAB","\xBB","\u2039","\u203A","\u2026","\xB7","\u2022","\u2023","\u2043","\u2010","\u2011","\u2012","\u2015","\u2016","\u2032","\u2033","\u2034","\u2057","\u2035","\u2036","\u2037","\u203B","\u203D","\u2042"]},{name:"currency",label:"Currency",symbols:["$","\xA2","\xA3","\xA4","\xA5","\u20A0","\u20A1","\u20A2","\u20A3","\u20A4","\u20A5","\u20A6","\u20A7","\u20A8","\u20A9","\u20AA","\u20AB","\u20AC","\u20AD","\u20AE","\u20AF","\u20B0","\u20B1","\u20B2","\u20B3","\u20B4","\u20B5","\u20B6","\u20B7","\u20B8"]},{name:"music",label:"Music",symbols:["\u2669","\u266A","\u266B","\u266C","\u266D","\u266E","\u266F","\u{1D11E}","\u{1D122}","\u{1D12A}","\u{1D12B}","\u{1D157}\u{1D165}","\u{1D158}\u{1D165}","\u{1D158}\u{1D165}\u{1D16E}","\u{1D158}\u{1D165}\u{1D16F}","\u{1D158}\u{1D165}\u{1D170}","\u{1D192}","\u{1D193}","\u{1D110}","\u{1D111}"]},{name:"emoji",label:"Emoji",symbols:["\u{1F600}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F606}","\u{1F605}","\u{1F923}","\u{1F602}","\u{1F642}","\u{1F643}","\u{1F609}","\u{1F60A}","\u{1F607}","\u{1F970}","\u{1F60D}","\u{1F929}","\u{1F618}","\u{1F617}","\u263A","\u{1F61A}","\u2764","\u{1F9E1}","\u{1F49B}","\u{1F49A}","\u{1F499}","\u{1F49C}","\u{1F5A4}","\u{1F90D}","\u{1F494}","\u2763","\u{1F44D}","\u{1F44E}","\u{1F44C}","\u270C","\u{1F91E}","\u{1F91F}","\u{1F918}","\u{1F44B}","\u{1F64F}","\u2705"]}];function Bt(){return ke.flatMap(e=>e.symbols)}function es({isOpen:e,onClose:t,onInsert:o,recentSymbols:i=[],className:n,style:r}){let[a,d]=hr.useState("common"),[s,l]=hr.useState(null),[h,m]=hr.useState(""),[p,u]=hr.useState(null),x=hr.useRef(null);hr.useEffect(()=>{e&&(l(null),m(""),u(null),setTimeout(()=>x.current?.focus(),100));},[e]);let v=hr.useMemo(()=>{if(!h.trim())return a==="recent"?i:ke.find(L=>L.name===a)?.symbols||[];let y=h.toLowerCase();return Bt().filter(T=>{let L=T.codePointAt(0)?.toString(16).toUpperCase()||"";return T.includes(y)||L.includes(y.toUpperCase())||`U+${L}`.toLowerCase().includes(y)})},[h,a,i]),g=hr.useCallback(y=>{l(y);},[]),f=hr.useCallback(y=>{o(y);},[o]),c=hr.useCallback(()=>{s&&o(s);},[s,o]),b=hr.useCallback(y=>{y.key==="Escape"?t():y.key==="Enter"&&s&&(y.preventDefault(),c());},[t,s,c]),C=hr.useCallback(y=>{y.target===y.currentTarget&&t();},[t]),P=y=>{if(!y)return null;let H=y.codePointAt(0);return {character:y,codePoint:H?`U+${H.toString(16).toUpperCase().padStart(4,"0")}`:"",decimal:H||0}};if(!e)return null;let I=P(p||s),D=s!==null,N=[...i.length>0?[{name:"recent",label:"Recent"}]:[],...ke.map(y=>({name:y.name,label:y.label}))];return jsxRuntime.jsx("div",{className:`docx-insert-symbol-dialog-overlay ${n||""}`,style:{...fn,...r},onClick:C,onKeyDown:b,role:"dialog","aria-modal":"true","aria-labelledby":"insert-symbol-dialog-title",children:jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog",style:hn,children:[jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-header",style:bn,children:[jsxRuntime.jsx("h2",{id:"insert-symbol-dialog-title",style:vn,children:"Insert Symbol"}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-close",style:yn,onClick:t,"aria-label":"Close dialog",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-body",style:Cn,children:[jsxRuntime.jsx("input",{ref:x,type:"text",placeholder:"Search symbols (character or Unicode)...",value:h,onChange:y=>m(y.target.value),style:Sn}),!h&&jsxRuntime.jsx("div",{className:"docx-insert-symbol-categories",style:wn,children:N.map(y=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(y.name),style:a===y.name?kn:Ft,children:y.label},y.name))}),jsxRuntime.jsx("div",{className:"docx-insert-symbol-grid",style:Tn,children:v.map((y,H)=>jsxRuntime.jsx("button",{type:"button",onClick:()=>g(y),onDoubleClick:()=>f(y),onMouseEnter:()=>u(y),onMouseLeave:()=>u(null),style:{...En,...s===y?{backgroundColor:"var(--doc-primary-light)",borderColor:"var(--doc-primary)"}:{}},title:`${y} - U+${y.codePointAt(0)?.toString(16).toUpperCase()}`,children:y},`${y}-${H}`))}),v.length===0&&jsxRuntime.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"var(--doc-text-muted)"},children:['No symbols found for "',h,'"']}),I&&jsxRuntime.jsxs("div",{className:"docx-insert-symbol-preview",style:In,children:[jsxRuntime.jsx("div",{style:Pn,children:I.character}),jsxRuntime.jsxs("div",{style:Ln,children:[jsxRuntime.jsx("div",{style:{fontSize:"14px",fontWeight:500,marginBottom:"4px"},children:I.codePoint}),jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:["Decimal: ",I.decimal]})]})]})]}),jsxRuntime.jsxs("div",{className:"docx-insert-symbol-dialog-footer",style:Rn,children:[jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-cancel",style:An,onClick:t,children:"Cancel"}),jsxRuntime.jsx("button",{type:"button",className:"docx-insert-symbol-dialog-insert",style:D?Dn:Mn,onClick:c,disabled:!D,children:"Insert"})]})]})})}function ts(e=20){let[t,o]=hr.useState(false),[i,n]=hr.useState([]),r=hr.useCallback(()=>o(true),[]),a=hr.useCallback(()=>o(false),[]),d=hr.useCallback(()=>o(l=>!l),[]),s=hr.useCallback(l=>{n(h=>{let m=h.filter(p=>p!==l);return [l,...m].slice(0,e)});},[e]);return {isOpen:t,recentSymbols:i,open:r,close:a,toggle:d,addRecent:s}}function os(){return ke}function rs(e){return ke.find(o=>o.name===e)?.symbols||[]}function ns(e){let t=e.codePointAt(0)||0;return {character:e,codePoint:`U+${t.toString(16).toUpperCase().padStart(4,"0")}`,decimal:t,hex:t.toString(16).toUpperCase()}}function is(e){if(!e.trim())return [];let t=e.toLowerCase();return Bt().filter(o=>{let i=o.codePointAt(0)?.toString(16).toUpperCase()||"";return o.includes(e)||i.includes(t.toUpperCase())||`U+${i}`.toLowerCase().includes(t)})}function as(e){let t=e.replace(/^U\+/i,"").replace(/^0x/i,""),o=parseInt(t,16);return isNaN(o)||o<0||o>1114111?null:String.fromCodePoint(o)}var ie=[{id:"formatted",label:"Keep Source Formatting",description:"Paste with original formatting",shortcut:"Ctrl+V"},{id:"plainText",label:"Paste as Plain Text",description:"Paste without any formatting",shortcut:"Ctrl+Shift+V"}],_n=()=>jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M4 4h12v2H4V4zM4 8h8v2H4V8zM4 12h10v2H4v-2zM4 16h6v2H4v-2z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M14 10l3 3-3 3v-2h-2v-2h2v-2z",fill:"currentColor",opacity:"0.6"})]}),Nn=()=>jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 4h12v1H4V4zM4 7h12v1H4V7zM4 10h12v1H4v-1zM4 13h12v1H4v-1zM4 16h8v1H4v-1z",fill:"currentColor"})});function Fn(e){switch(e){case "formatted":return jsxRuntime.jsx(_n,{});case "plainText":return jsxRuntime.jsx(Nn,{});default:return null}}var Bn=({option:e,isSelected:t,onClick:o,onMouseEnter:i})=>jsxRuntime.jsxs("button",{type:"button",className:`docx-paste-special-option ${t?"docx-paste-special-option-selected":""}`,onClick:o,onMouseEnter:i,role:"menuitem","aria-selected":t,style:{display:"flex",alignItems:"center",gap:"12px",width:"100%",padding:"12px 16px",border:"none",background:t?"var(--doc-primary-light)":"transparent",cursor:"pointer",textAlign:"left",borderRadius:"4px",transition:"background-color 0.15s ease"},children:[jsxRuntime.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"4px",background:t?"var(--doc-primary)":"var(--doc-bg-hover)",color:t?"white":"var(--doc-text-muted)"},children:Fn(e.id)}),jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("div",{style:{fontSize:"14px",fontWeight:500,color:"var(--doc-text)",marginBottom:"2px"},children:e.label}),jsxRuntime.jsx("div",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:e.description})]}),jsxRuntime.jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),us=({isOpen:e,onClose:t,onPaste:o,position:i,className:n=""})=>{let r=hr.useRef(null),[a,d]=hr.useState(0),[s,l]=hr.useState(null),[h,m]=hr.useState(false),[p,u]=hr.useState(null);hr.useEffect(()=>{if(!e){l(null),u(null),d(0);return}(async()=>{m(true),u(null);try{let f=await chunkP3AEZKQO_cjs.ia({cleanWordFormatting:!0});l(f),f||u("No content available to paste");}catch{u("Unable to read clipboard. Please use Ctrl+V to paste.");}finally{m(false);}})();},[e]),hr.useEffect(()=>{if(!e)return;let g=f=>{r.current&&!r.current.contains(f.target)&&t();};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[e,t]),hr.useEffect(()=>{if(!e)return;let g=f=>{switch(f.key){case "Escape":f.preventDefault(),t();break;case "ArrowDown":f.preventDefault(),d(c=>(c+1)%ie.length);break;case "ArrowUp":f.preventDefault(),d(c=>(c-1+ie.length)%ie.length);break;case "Enter":f.preventDefault(),x(ie[a].id);break}};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,a,t]);let x=hr.useCallback(g=>{if(!s){u("No content available to paste");return}o(s,g==="plainText"),t();},[s,o,t]),v=hr.useCallback(()=>{let c=i?.x??(typeof window<"u"?window.innerWidth/2-160:100),b=i?.y??(typeof window<"u"?window.innerHeight/2-200/2:100);return typeof window<"u"&&(c+320>window.innerWidth&&(c=window.innerWidth-320-10),b+200>window.innerHeight&&(b=window.innerHeight-200-10),c<10&&(c=10),b<10&&(b=10)),{position:"fixed",top:b,left:c,width:320,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",zIndex:10001,overflow:"hidden"}},[i]);return e?jsxRuntime.jsxs("div",{ref:r,className:`docx-paste-special-dialog ${n}`,style:v(),role:"dialog","aria-label":"Paste Special",children:[jsxRuntime.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsxRuntime.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},children:"Paste Special"}),jsxRuntime.jsx("button",{type:"button",onClick:t,"aria-label":"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"var(--doc-text-muted)"},children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{style:{padding:"8px"},children:h?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--doc-text-muted)",fontSize:"13px"},children:"Reading clipboard..."}):p?jsxRuntime.jsx("div",{style:{padding:"20px",textAlign:"center",color:"var(--doc-error)",fontSize:"13px"},children:p}):jsxRuntime.jsx("div",{role:"menu",children:ie.map((g,f)=>jsxRuntime.jsx(Bn,{option:g,isSelected:f===a,onClick:()=>x(g.id),onMouseEnter:()=>d(f)},g.id))})}),s&&!h&&!p&&jsxRuntime.jsxs("div",{style:{padding:"8px 16px 12px",borderTop:"1px solid var(--doc-border)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"var(--doc-text-muted)",marginBottom:"4px"},children:"Preview:"}),jsxRuntime.jsxs("div",{style:{fontSize:"12px",color:"var(--doc-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",padding:"6px 8px",background:"var(--doc-bg)",borderRadius:"4px"},children:['"',s.plainText.slice(0,50),s.plainText.length>50?"...":"",'"']})]})]}):null};function gs(e={}){let{onPaste:t,enabled:o=true}=e,[i,n]=hr.useState(false),r=hr.useCallback(()=>{o&&n(true);},[o]),a=hr.useCallback(()=>{n(false);},[]),d=hr.useCallback(async()=>{if(!(!o||!t))try{let l=await chunkP3AEZKQO_cjs.ia({cleanWordFormatting:!0});l&&t(l,!0);}catch(l){console.error("Failed to paste as plain text:",l);}},[o,t]),s=hr.useCallback(l=>o&&(l.ctrlKey||l.metaKey)&&l.shiftKey&&l.key.toLowerCase()==="v"?(l.preventDefault(),r(),true):false,[o,r]);return {isOpen:i,openDialog:r,closeDialog:a,handleKeyDown:s,pasteAsPlainText:d}}function ms(e){return ie.find(t=>t.id===e)}function xs(){return [...ie]}function fs(){return "formatted"}function hs(e){return (e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key.toLowerCase()==="v"}var Yt={editing:"Editing",formatting:"Formatting",navigation:"Navigation",clipboard:"Clipboard",selection:"Selection",view:"View",file:"File",other:"Other"},Ut=["file","editing","clipboard","formatting","selection","navigation","view","other"],Ye=[{id:"save",name:"Save",description:"Save document",keys:"Ctrl+S",category:"file",common:true},{id:"print",name:"Print",description:"Print document",keys:"Ctrl+P",category:"file"},{id:"undo",name:"Undo",description:"Undo last action",keys:"Ctrl+Z",category:"editing",common:true},{id:"redo",name:"Redo",description:"Redo last action",keys:"Ctrl+Y",altKeys:"Ctrl+Shift+Z",category:"editing",common:true},{id:"delete",name:"Delete",description:"Delete selected text",keys:"Del",altKeys:"Backspace",category:"editing"},{id:"find",name:"Find",description:"Find text in document",keys:"Ctrl+F",category:"editing",common:true},{id:"replace",name:"Find & Replace",description:"Find and replace text",keys:"Ctrl+H",category:"editing"},{id:"cut",name:"Cut",description:"Cut selected text",keys:"Ctrl+X",category:"clipboard",common:true},{id:"copy",name:"Copy",description:"Copy selected text",keys:"Ctrl+C",category:"clipboard",common:true},{id:"paste",name:"Paste",description:"Paste from clipboard",keys:"Ctrl+V",category:"clipboard",common:true},{id:"paste-plain",name:"Paste as Plain Text",description:"Paste without formatting",keys:"Ctrl+Shift+V",category:"clipboard"},{id:"bold",name:"Bold",description:"Toggle bold formatting",keys:"Ctrl+B",category:"formatting",common:true},{id:"italic",name:"Italic",description:"Toggle italic formatting",keys:"Ctrl+I",category:"formatting",common:true},{id:"underline",name:"Underline",description:"Toggle underline formatting",keys:"Ctrl+U",category:"formatting",common:true},{id:"strikethrough",name:"Strikethrough",description:"Toggle strikethrough",keys:"Ctrl+Shift+X",category:"formatting"},{id:"subscript",name:"Subscript",description:"Toggle subscript",keys:"Ctrl+=",category:"formatting"},{id:"superscript",name:"Superscript",description:"Toggle superscript",keys:"Ctrl+Shift+=",category:"formatting"},{id:"align-left",name:"Align Left",description:"Left align paragraph",keys:"Ctrl+L",category:"formatting"},{id:"align-center",name:"Align Center",description:"Center align paragraph",keys:"Ctrl+E",category:"formatting"},{id:"align-right",name:"Align Right",description:"Right align paragraph",keys:"Ctrl+R",category:"formatting"},{id:"align-justify",name:"Justify",description:"Justify paragraph",keys:"Ctrl+J",category:"formatting"},{id:"indent",name:"Increase Indent",description:"Increase paragraph indent",keys:"Tab",category:"formatting"},{id:"outdent",name:"Decrease Indent",description:"Decrease paragraph indent",keys:"Shift+Tab",category:"formatting"},{id:"select-all",name:"Select All",description:"Select all content",keys:"Ctrl+A",category:"selection",common:true},{id:"select-word",name:"Select Word",description:"Select current word",keys:"Double-click",category:"selection"},{id:"select-paragraph",name:"Select Paragraph",description:"Select current paragraph",keys:"Triple-click",category:"selection"},{id:"extend-selection-word",name:"Extend Selection by Word",description:"Extend selection to next/previous word",keys:"Ctrl+Shift+Arrow",category:"selection"},{id:"extend-selection-line",name:"Extend Selection to Line Edge",description:"Extend selection to line start/end",keys:"Shift+Home/End",category:"selection"},{id:"move-word",name:"Move by Word",description:"Move cursor to next/previous word",keys:"Ctrl+Arrow",category:"navigation"},{id:"move-line-start",name:"Move to Line Start",description:"Move cursor to start of line",keys:"Home",category:"navigation"},{id:"move-line-end",name:"Move to Line End",description:"Move cursor to end of line",keys:"End",category:"navigation"},{id:"move-doc-start",name:"Move to Document Start",description:"Move cursor to start of document",keys:"Ctrl+Home",category:"navigation"},{id:"move-doc-end",name:"Move to Document End",description:"Move cursor to end of document",keys:"Ctrl+End",category:"navigation"},{id:"page-up",name:"Page Up",description:"Scroll up one page",keys:"Page Up",category:"navigation"},{id:"page-down",name:"Page Down",description:"Scroll down one page",keys:"Page Down",category:"navigation"},{id:"zoom-in",name:"Zoom In",description:"Increase zoom level",keys:"Ctrl++",altKeys:"Ctrl+Scroll Up",category:"view"},{id:"zoom-out",name:"Zoom Out",description:"Decrease zoom level",keys:"Ctrl+-",altKeys:"Ctrl+Scroll Down",category:"view"},{id:"zoom-reset",name:"Reset Zoom",description:"Reset zoom to 100%",keys:"Ctrl+0",category:"view"},{id:"shortcuts",name:"Keyboard Shortcuts",description:"Show this help dialog",keys:"Ctrl+/",altKeys:"F1",category:"view"}];function zn(){return typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)}function nt(e){return zn()?e.replace(/Ctrl\+/g,"\u2318").replace(/Alt\+/g,"\u2325").replace(/Shift\+/g,"\u21E7"):e}var Wn=({shortcut:e})=>{let t=nt(e.keys),o=e.altKeys?nt(e.altKeys):null;return jsxRuntime.jsxs("div",{className:"docx-shortcut-item",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:"1px solid var(--doc-border-light)"},children:[jsxRuntime.jsxs("div",{style:{flex:1},children:[jsxRuntime.jsx("div",{style:{fontSize:"13px",fontWeight:500,color:"var(--doc-text)"},children:e.name}),jsxRuntime.jsx("div",{style:{fontSize:"11px",color:"var(--doc-text-muted)",marginTop:"2px"},children:e.description})]}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[jsxRuntime.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",color:"var(--doc-text)",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",border:"1px solid var(--doc-border-light)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},children:t}),o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{style:{color:"var(--doc-text-subtle)",fontSize:"11px"},children:"or"}),jsxRuntime.jsx("kbd",{style:{display:"inline-flex",alignItems:"center",padding:"4px 8px",fontSize:"12px",fontFamily:"monospace",color:"var(--doc-text)",backgroundColor:"var(--doc-bg-hover)",borderRadius:"4px",border:"1px solid var(--doc-border-light)",boxShadow:"0 1px 1px rgba(0,0,0,0.1)"},children:o})]})]})]})},Ss=({isOpen:e,onClose:t,customShortcuts:o=[],showSearch:i=true,className:n=""})=>{let r=hr.useRef(null),a=hr.useRef(null),[d,s]=hr.useState(""),l=hr.useMemo(()=>{let p=[...Ye];for(let u of o){let x=p.findIndex(v=>v.id===u.id);x>=0?p[x]=u:p.push(u);}return p},[o]),h=hr.useMemo(()=>{if(!d.trim())return l;let p=d.toLowerCase();return l.filter(u=>u.name.toLowerCase().includes(p)||u.description.toLowerCase().includes(p)||u.keys.toLowerCase().includes(p)||u.altKeys&&u.altKeys.toLowerCase().includes(p))},[l,d]),m=hr.useMemo(()=>{let p=new Map;for(let x of h){let v=p.get(x.category)||[];v.push(x),p.set(x.category,v);}let u=[];for(let x of Ut){let v=p.get(x);v&&v.length>0&&u.push({category:x,shortcuts:v});}return u},[h]);return hr.useEffect(()=>{e&&i&&a.current&&setTimeout(()=>a.current?.focus(),0);},[e,i]),hr.useEffect(()=>{e||s("");},[e]),hr.useEffect(()=>{if(!e)return;let p=u=>{r.current&&!r.current.contains(u.target)&&t();};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[e,t]),hr.useEffect(()=>{if(!e)return;let p=u=>{u.key==="Escape"&&t();};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]),e?jsxRuntime.jsx("div",{className:"docx-shortcuts-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10001},children:jsxRuntime.jsxs("div",{ref:r,className:`docx-shortcuts-dialog ${n}`,style:{width:"600px",maxWidth:"90vw",maxHeight:"80vh",backgroundColor:"white",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.2)",display:"flex",flexDirection:"column",overflow:"hidden"},role:"dialog","aria-label":"Keyboard Shortcuts",children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},children:[jsxRuntime.jsx("h2",{style:{margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{type:"button",onClick:t,"aria-label":"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"50%",color:"var(--doc-text-muted)"},children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M5 5l10 10M15 5L5 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),i&&jsxRuntime.jsx("div",{style:{padding:"12px 20px",borderBottom:"1px solid var(--doc-border)"},children:jsxRuntime.jsx("input",{ref:a,type:"text",value:d,onChange:p=>s(p.target.value),placeholder:"Search shortcuts...",style:{width:"100%",padding:"10px 12px",fontSize:"14px",border:"1px solid var(--doc-border-light)",borderRadius:"6px",outline:"none"}})}),jsxRuntime.jsx("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px"},children:m.length===0?jsxRuntime.jsxs("div",{style:{textAlign:"center",padding:"32px",color:"var(--doc-text-muted)"},children:['No shortcuts found matching "',d,'"']}):m.map(({category:p,shortcuts:u})=>jsxRuntime.jsxs("div",{style:{marginBottom:"24px"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"13px",fontWeight:600,color:"var(--doc-primary)",textTransform:"uppercase",letterSpacing:"0.5px"},children:Yt[p]}),jsxRuntime.jsx("div",{children:u.map(x=>jsxRuntime.jsx(Wn,{shortcut:x},x.id))})]},p))}),jsxRuntime.jsxs("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg)",fontSize:"12px",color:"var(--doc-text-muted)",textAlign:"center"},children:["Press"," ",jsxRuntime.jsx("kbd",{style:{padding:"2px 6px",backgroundColor:"white",borderRadius:"4px",border:"1px solid var(--doc-border-light)"},children:"Esc"})," ","to close"]})]})}):null};function ws(e={}){let{enabled:t=true,openShortcut:o="Ctrl+/"}=e,[i,n]=hr.useState(false),r=hr.useCallback(()=>{t&&n(true);},[t]),a=hr.useCallback(()=>{n(false);},[]),d=hr.useCallback(()=>{n(l=>!l);},[]),s=hr.useCallback(l=>{if(!t)return;if((l.ctrlKey||l.metaKey)&&(l.key==="/"||l.key==="?")){l.preventDefault(),d();return}if(l.key==="F1"){l.preventDefault(),r();return}},[t,d,r]);return hr.useEffect(()=>{if(t)return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[t,s]),{isOpen:i,open:r,close:a,toggle:d,handleKeyDown:s}}function ks(){return [...Ye]}function Ts(e){return Ye.filter(t=>t.category===e)}function Es(){return Ye.filter(e=>e.common)}function Is(e){return Yt[e]}function Ps(){return [...Ut]}function Ls(e){return nt(e)}
111
+ exports.$=Ya;exports.A=Xi;exports.Aa=Es;exports.B=ta;exports.Ba=Is;exports.C=oa;exports.Ca=Ps;exports.D=ra;exports.Da=Ls;exports.E=na;exports.F=ia;exports.G=aa;exports.H=pa;exports.I=ua;exports.J=ga;exports.K=ma;exports.L=xa;exports.M=fa;exports.N=ha;exports.O=Sr;exports.P=Ca;exports.Q=Sa;exports.R=wa;exports.S=ka;exports.T=Ta;exports.U=Ra;exports.V=Da;exports.W=Aa;exports.X=Ma;exports.Y=Oa;exports.Z=_a;exports._=Na;exports.a=Kn;exports.aa=Ua;exports.b=$n;exports.ba=Ha;exports.c=Gn;exports.ca=Va;exports.d=jn;exports.da=Ka;exports.e=Zn;exports.ea=$a;exports.f=Xn;exports.fa=Ga;exports.g=oi;exports.ga=ja;exports.h=ri;exports.ha=Za;exports.i=ni;exports.ia=ke;exports.j=ii;exports.ja=es;exports.k=di;exports.ka=ts;exports.l=pi;exports.la=os;exports.m=ui;exports.ma=rs;exports.n=gi;exports.na=ns;exports.o=mi;exports.oa=is;exports.p=xi;exports.pa=as;exports.q=Si;exports.qa=us;exports.r=Ti;exports.ra=gs;exports.s=Ei;exports.sa=ms;exports.t=Ii;exports.ta=xs;exports.u=Pi;exports.ua=fs;exports.v=Li;exports.va=hs;exports.w=Ri;exports.wa=Ss;exports.x=Di;exports.xa=ws;exports.y=Ai;exports.ya=ks;exports.z=Yi;exports.za=Ts;
@@ -0,0 +1 @@
1
+ 'use strict';var m={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},T={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""},b={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function p(e){if(!e)return 1;let t=parseInt(e,16);return isNaN(t)?1:t/255}function c(e){let t=e.padStart(6,"0").slice(0,6),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),o=parseInt(t.slice(4,6),16);return {r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(o)?0:o}}function h(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function g(e,t,n){e/=255,t/=255,n/=255;let r=Math.max(e,t,n),o=Math.min(e,t,n),u=(r+o)/2;if(r===o)return {h:0,s:0,l:u};let l=r-o,a=u>.5?l/(2-r-o):l/(r+o),s;switch(r){case e:s=((t-n)/l+(t<n?6:0))/6;break;case t:s=((n-e)/l+2)/6;break;case n:s=((e-t)/l+4)/6;break;default:s=0;}return {h:s*360,s:a,l:u}}function C(e,t,n){if(e=e/360,t===0){let l=Math.round(n*255);return {r:l,g:l,b:l}}let r=(l,a,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?l+(a-l)*6*s:s<1/2?a:s<2/3?l+(a-l)*(2/3-s)*6:l),o=n<.5?n*(1+t):n+t-n*t,u=2*n-o;return {r:Math.round(r(u,o,e+1/3)*255),g:Math.round(r(u,o,e)*255),b:Math.round(r(u,o,e-1/3)*255)}}function f(e,t){if(t<=0||t>=1)return t>=1?"FFFFFF":e;let n=c(e),r=g(n.r,n.g,n.b);r.l=r.l+(1-r.l)*t;let o=C(r.h,r.s,r.l);return h(o.r,o.g,o.b)}function d(e,t){if(t<=0||t>=1)return t<=0?"000000":e;let n=c(e),r=g(n.r,n.g,n.b);r.l=r.l*t;let o=C(r.h,r.s,r.l);return h(o.r,o.g,o.b)}function S(e,t){let n=b[t]??t,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],o=u=>r.includes(u);return e?.colorScheme?o(n)?e.colorScheme[n]??m[n]??"000000":"000000":o(n)?m[n]??"000000":"000000"}function x(e){if(!e)return null;let t=e.toLowerCase();return b[e]??b[t]??null}function i(e,t,n="000000"){if(!e)return `#${n}`;if(e.auto)return `#${n}`;let r;if(e.themeColor){let o=x(e.themeColor);if(o?r=S(t,o):r=e.rgb??n,e.themeTint){let u=p(e.themeTint);r=f(r,u);}else if(e.themeShade){let u=p(e.themeShade);r=d(r,u);}}else e.rgb?r=e.rgb:r=n;return `#${r.toUpperCase().replace(/^#/,"")}`}function _(e){if(!e||e==="none")return "";let t=T[e];return t?`#${t}`:""}function k(e,t){return e?e.auto?"transparent":i(e,t):""}function F(e,t){if(!e)return false;if(e.auto)return true;let r=i(e,t).replace(/^#/,"").toLowerCase(),o=c(r);return (o.r+o.g+o.b)/3<20}function R(e,t){if(!e)return false;let r=i(e,t).replace(/^#/,"").toLowerCase(),o=c(r);return (o.r+o.g+o.b)/3>235}function y(e,t){if(!e)return "#000000";let r=i(e,t).replace(/^#/,""),o=c(r);return (.299*o.r+.587*o.g+.114*o.b)/255>.5?"#000000":"#FFFFFF"}function N(e){if(!e)return;let t=e.trim();if(t.toLowerCase()==="auto")return {auto:true};let n=x(t);if(n)return {themeColor:n};let r=t.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(r)?{rgb:r}:/^[0-9A-F]{3}$/i.test(r)?{rgb:r.split("").map(u=>u+u).join("")}:{rgb:r.padStart(6,"0").slice(0,6)}}function M(e,t,n){let r={themeColor:e};return t!==void 0&&t>0&&t<1&&(r.themeTint=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),n!==void 0&&n>0&&n<1&&(r.themeShade=Math.round(n*255).toString(16).toUpperCase().padStart(2,"0")),r}function V(e){return {rgb:e.replace(/^#/,"").toUpperCase()}}function A(e,t,n){let o=i(e,t).replace(/^#/,""),u=1-n/100;return `#${d(o,u)}`}function v(e,t,n){let o=i(e,t).replace(/^#/,""),u=n/100;return `#${f(o,u)}`}function L(e,t,n,r){let o=i(e,r).replace(/^#/,""),u=i(t,r).replace(/^#/,""),l=c(o),a=c(u),s={r:Math.round(l.r*(1-n)+a.r*n),g:Math.round(l.g*(1-n)+a.g*n),b:Math.round(l.b*(1-n)+a.b*n)};return `#${h(s.r,s.g,s.b)}`}function E(e){return e.startsWith("#")?e:`#${e}`}function D(e){return _(e)||E(e)}var P=[{slot:"lt1",name:"Background 1"},{slot:"dk1",name:"Text 1"},{slot:"lt2",name:"Background 2"},{slot:"dk2",name:"Text 2"},{slot:"accent1",name:"Accent 1"},{slot:"accent2",name:"Accent 2"},{slot:"accent3",name:"Accent 3"},{slot:"accent4",name:"Accent 4"},{slot:"accent5",name:"Accent 5"},{slot:"accent6",name:"Accent 6"}],I=[{type:"base",value:0,hexValue:"",labelSuffix:""},{type:"tint",value:.8,hexValue:"CC",labelSuffix:", Lighter 80%"},{type:"tint",value:.6,hexValue:"99",labelSuffix:", Lighter 60%"},{type:"tint",value:.4,hexValue:"66",labelSuffix:", Lighter 40%"},{type:"shade",value:.75,hexValue:"BF",labelSuffix:", Darker 25%"},{type:"shade",value:.5,hexValue:"80",labelSuffix:", Darker 50%"}];function U(e,t,n){return t==="tint"?f(e,n):d(e,n)}function $(e){let t=e??m;return I.map(n=>P.map(r=>{let o=t[r.slot]??m[r.slot]??"000000",u;n.type==="base"?u=o.toUpperCase():n.type==="tint"?u=f(o,n.value):u=d(o,n.value);let l={hex:u,themeSlot:r.slot,label:`${r.name}${n.labelSuffix}`};return n.type==="tint"&&n.hexValue?l.tint=n.hexValue:n.type==="shade"&&n.hexValue&&(l.shade=n.hexValue),l}))}function B(e,t,n){if(!e&&!t)return true;if(!e||!t)return false;let r=i(e,n).toUpperCase(),o=i(t,n).toUpperCase();return r===o}function X(e){return e/1440*96}function W(e){return e/96*1440}function G(e){return e/914400*96}function K(e){return e/96*914400}function w(e){return e/914400*1440}function z(e){return e/1440*914400}function j(e){return e/72*96}function Y(e){return e/144*96}function q(e){return e/2}function J(e){return e/576*96}function H(e,t=2){let n=Math.pow(10,t);return Math.round(e*n)/n}function Q(e){return `${H(e)}px`}exports.A=J;exports.B=Q;exports.a=i;exports.b=_;exports.c=k;exports.d=F;exports.e=R;exports.f=y;exports.g=N;exports.h=M;exports.i=V;exports.j=A;exports.k=v;exports.l=L;exports.m=E;exports.n=D;exports.o=U;exports.p=$;exports.q=B;exports.r=X;exports.s=W;exports.t=G;exports.u=K;exports.v=w;exports.w=z;exports.x=j;exports.y=Y;exports.z=q;
@@ -1,2 +1 @@
1
- 'use strict';function n(e){return {start:e,end:e,collapsed:true}}function r(e,t){return {start:e,end:t,collapsed:e.paragraphIndex===t.paragraphIndex&&e.offset===t.offset}}function o(e,t){return !(e.paragraphIndex<t.start.paragraphIndex||e.paragraphIndex===t.start.paragraphIndex&&e.offset<t.start.offset||e.paragraphIndex>t.end.paragraphIndex||e.paragraphIndex===t.end.paragraphIndex&&e.offset>t.end.offset)}function i(e,t){return e.paragraphIndex<t.paragraphIndex?-1:e.paragraphIndex>t.paragraphIndex?1:e.offset<t.offset?-1:e.offset>t.offset?1:0}function s(e){return {askAI:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom Prompt"}[e]}function m(e){return {askAI:"Ask AI a question about this text",rewrite:"Rewrite this text in a different way",expand:"Expand this text with more details",summarize:"Summarize this text to be shorter",translate:"Translate this text to another language",explain:"Explain what this text means",fixGrammar:"Fix grammar and spelling errors",makeFormal:"Make the tone more formal",makeCasual:"Make the tone more casual",custom:"Enter a custom prompt"}[e]}var p=["askAI","rewrite","expand","summarize","translate","explain"];function g(e){return {...e,id:a()}}function a(){return `cmd_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}exports.a=n;exports.b=r;exports.c=o;exports.d=i;exports.e=s;exports.f=m;exports.g=p;exports.h=g;//# sourceMappingURL=chunk-T2HQYRA7.cjs.map
2
- //# sourceMappingURL=chunk-T2HQYRA7.cjs.map
1
+ 'use strict';function n(e){return {start:e,end:e,collapsed:true}}function r(e,t){return {start:e,end:t,collapsed:e.paragraphIndex===t.paragraphIndex&&e.offset===t.offset}}function o(e,t){return !(e.paragraphIndex<t.start.paragraphIndex||e.paragraphIndex===t.start.paragraphIndex&&e.offset<t.start.offset||e.paragraphIndex>t.end.paragraphIndex||e.paragraphIndex===t.end.paragraphIndex&&e.offset>t.end.offset)}function i(e,t){return e.paragraphIndex<t.paragraphIndex?-1:e.paragraphIndex>t.paragraphIndex?1:e.offset<t.offset?-1:e.offset>t.offset?1:0}function s(e){return {askAI:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom Prompt"}[e]}function m(e){return {askAI:"Ask AI a question about this text",rewrite:"Rewrite this text in a different way",expand:"Expand this text with more details",summarize:"Summarize this text to be shorter",translate:"Translate this text to another language",explain:"Explain what this text means",fixGrammar:"Fix grammar and spelling errors",makeFormal:"Make the tone more formal",makeCasual:"Make the tone more casual",custom:"Enter a custom prompt"}[e]}var p=["askAI","rewrite","expand","summarize","translate","explain"];function g(e){return {...e,id:a()}}function a(){return `cmd_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}exports.a=n;exports.b=r;exports.c=o;exports.d=i;exports.e=s;exports.f=m;exports.g=p;exports.h=g;