@heyirisai/docx-editor-react 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +139 -0
  3. package/dist/FindReplaceDialog-HM63BMXE.js +1 -0
  4. package/dist/FindReplaceDialog-KU5TEIBJ.mjs +1 -0
  5. package/dist/FootnotePropertiesDialog-TV2BGQDC.js +1 -0
  6. package/dist/FootnotePropertiesDialog-W3YHM4BV.mjs +1 -0
  7. package/dist/HyperlinkDialog-7MEQJIYP.js +1 -0
  8. package/dist/HyperlinkDialog-ZYH7ZHRF.mjs +1 -0
  9. package/dist/ImagePositionDialog-HEWYR6Q3.mjs +1 -0
  10. package/dist/ImagePositionDialog-LSCCQORZ.js +1 -0
  11. package/dist/ImagePropertiesDialog-RAB47C6M.mjs +1 -0
  12. package/dist/ImagePropertiesDialog-Z4M6XKFG.js +1 -0
  13. package/dist/KeyboardShortcutsDialog-B-h3NAat.d.mts +415 -0
  14. package/dist/KeyboardShortcutsDialog-B-h3NAat.d.ts +415 -0
  15. package/dist/PageSetupDialog-AIGIXO3E.mjs +1 -0
  16. package/dist/PageSetupDialog-LWYOYKEU.js +1 -0
  17. package/dist/SplitCellDialog-45W7SDPY.js +1 -0
  18. package/dist/SplitCellDialog-IFBKYCD6.mjs +1 -0
  19. package/dist/TablePropertiesDialog-TMLKGOOW.mjs +1 -0
  20. package/dist/TablePropertiesDialog-VCDCPM3R.js +1 -0
  21. package/dist/WatermarkDialog-KRL7WMIS.mjs +1 -0
  22. package/dist/WatermarkDialog-XGLAH3TK.js +1 -0
  23. package/dist/chunk-4Y4JFAPY.mjs +2 -0
  24. package/dist/chunk-72OSVJPF.mjs +2 -0
  25. package/dist/chunk-74OM4KEH.js +2 -0
  26. package/dist/chunk-BJ5RZW6Y.js +1 -0
  27. package/dist/chunk-BMBP5UFA.mjs +1 -0
  28. package/dist/chunk-BWGNQQOL.mjs +1 -0
  29. package/dist/chunk-BZO4G5M6.js +1 -0
  30. package/dist/chunk-FIXL5PLO.js +2 -0
  31. package/dist/chunk-GM2S2WMT.mjs +1 -0
  32. package/dist/chunk-GNIO6SOS.js +1 -0
  33. package/dist/chunk-GWXEFL3H.js +1 -0
  34. package/dist/chunk-IVFYCMAM.mjs +1 -0
  35. package/dist/chunk-J72K2BOS.mjs +2 -0
  36. package/dist/chunk-L4MDZW2J.js +1 -0
  37. package/dist/chunk-LMMQD3OQ.js +2 -0
  38. package/dist/chunk-NIBCC7WQ.js +1 -0
  39. package/dist/chunk-O6M2HAIZ.mjs +1 -0
  40. package/dist/chunk-OCA7BO3G.mjs +1 -0
  41. package/dist/chunk-OHNO4NRQ.mjs +1 -0
  42. package/dist/chunk-P5ZOUQIK.mjs +1 -0
  43. package/dist/chunk-PSBO3UDN.js +1 -0
  44. package/dist/chunk-QD7BVJV3.js +2 -0
  45. package/dist/chunk-SSLYGYTD.js +1 -0
  46. package/dist/chunk-YY52FSUR.js +1 -0
  47. package/dist/chunk-Z3X4KBNE.mjs +2 -0
  48. package/dist/chunk-ZFZJRL2R.mjs +1 -0
  49. package/dist/dialogs.d.mts +40 -0
  50. package/dist/dialogs.d.ts +40 -0
  51. package/dist/dialogs.js +1 -0
  52. package/dist/dialogs.mjs +1 -0
  53. package/dist/hooks.d.mts +513 -0
  54. package/dist/hooks.d.ts +513 -0
  55. package/dist/hooks.js +1 -0
  56. package/dist/hooks.mjs +1 -0
  57. package/dist/index.d.mts +680 -0
  58. package/dist/index.d.ts +680 -0
  59. package/dist/index.js +31 -0
  60. package/dist/index.mjs +31 -0
  61. package/dist/plugin-api.d.mts +90 -0
  62. package/dist/plugin-api.d.ts +90 -0
  63. package/dist/plugin-api.js +246 -0
  64. package/dist/plugin-api.mjs +246 -0
  65. package/dist/styles.css +1 -0
  66. package/dist/styles.d.mts +13 -0
  67. package/dist/styles.d.ts +13 -0
  68. package/dist/styles.js +1 -0
  69. package/dist/styles.mjs +1 -0
  70. package/dist/types-D35gNE-_.d.mts +106 -0
  71. package/dist/types-D35gNE-_.d.ts +106 -0
  72. package/dist/ui.d.mts +1692 -0
  73. package/dist/ui.d.ts +1692 -0
  74. package/dist/ui.js +90 -0
  75. package/dist/ui.mjs +90 -0
  76. package/dist/useFindReplace-Bc2ubEeV.d.mts +219 -0
  77. package/dist/useFindReplace-Bc2ubEeV.d.ts +219 -0
  78. package/package.json +137 -0
@@ -0,0 +1,2 @@
1
+ import {b,c,a}from'./chunk-72OSVJPF.mjs';import {b as b$1}from'./chunk-ZFZJRL2R.mjs';import*as J from'react';import J__default,{createContext,useState,useRef,useCallback,useMemo,useEffect,Children,isValidElement,useContext}from'react';import {clsx}from'clsx';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {halfPointsToPoints}from'@heyirisai/docx-editor-core/utils/units';export{pointsToHalfPoints as d}from'@heyirisai/docx-editor-core/utils/units';import {createDefaultListState}from'@heyirisai/docx-editor-core/utils/listState';export{createDefaultListState as f}from'@heyirisai/docx-editor-core/utils/listState';import {en}from'@heyirisai/docx-editor-i18n';import*as E from'@radix-ui/react-select';import {excludeFontsByName,generateThemeTintShadeMatrix,resolveColorToHex,twipsToPixels,pixelsToTwips,formatPx,resolveHighlightColor,resolveColor}from'@heyirisai/docx-editor-core/utils';import {resolveParagraphStyleOptions,getStylePreviewProps}from'@heyirisai/docx-editor-core/utils/stylePreview';import {normalizeFontFamilies}from'@heyirisai/docx-editor-core/utils/fontOptions';export{mapHexToHighlightName as g}from'@heyirisai/docx-editor-core/utils/highlightColors';import {openReportIssue}from'@heyirisai/docx-editor-core/utils/reportIssue';var Xt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jt=clsx,Jt=(e,t)=>o=>{var r;if(t?.variants==null)return jt(e,o?.class,o?.className);let{variants:n,defaultVariants:l}=t,i=Object.keys(n).map(a=>{let p=o?.[a],b=l?.[a];if(p===null)return null;let d=Xt(p)||Xt(b);return n[a][d]}),c=o&&Object.entries(o).reduce((a,p)=>{let[b,d]=p;return d===void 0||(a[b]=d),a},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((a,p)=>{let{class:b,className:d,...f}=p;return Object.entries(f).every(m=>{let[s,g]=m;return Array.isArray(g)?g.includes({...l,...c}[s]):{...l,...c}[s]===g})?[...a,b,d]:a},[]);return jt(e,i,u,o?.class,o?.className)};function M(...e){return clsx(e)}var ur=Jt("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),K=J.forwardRef(({className:e,variant:t,size:o,...r},n)=>jsx("button",{className:M(ur({variant:t,size:o,className:e})),ref:n,...r}));K.displayName="Button";var fr=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],br=1,gr=400;function eo(e,t,o){for(let r of t)if(r>e)return r;return Math.min(e+1,o)}function to(e,t,o){for(let r=t.length-1;r>=0;r--)if(t[r]<e)return t[r];return Math.max(e-1,o)}function oo({value:e,onChange:t,sizes:o=fr,disabled:r=false,className:n,placeholder:l="11",minSize:i=br,maxSize:c$1=gr}){let{t:u}=b$1(),[a,p]=useState(false),[b$2,d]=useState(""),[f,m]=useState(false),s=useRef(null),g=useCallback(()=>{m(false),p(false);},[]),{containerRef:h,dropdownRef:v,dropdownStyle:y}=c({isOpen:f,onClose:g}),C=e??(parseInt(l,10)||11),L=e!==void 0?e.toString():l,P=useCallback(S=>{if(S.preventDefault(),r)return;let D=to(C,o,i);t?.(D);},[C,o,i,r,t]),U=useCallback(S=>{if(S.preventDefault(),r)return;let D=eo(C,o,c$1);t?.(D);},[C,o,c$1,r,t]),F=useCallback(S=>{S.preventDefault(),!r&&(p(true),d(L),m(true),requestAnimationFrame(()=>{s.current?.focus(),s.current?.select();}));},[r,L]),we=useCallback(S=>{d(S.target.value);},[]),Z=useCallback(()=>{p(false);let S=parseFloat(b$2);if(!isNaN(S)&&S>=i&&S<=c$1){let D=Math.round(S*2)/2;t?.(D);}},[b$2,i,c$1,t]),ge=useCallback(S=>{if(S.key==="Enter")S.preventDefault(),Z(),m(false);else if(S.key==="Escape")p(false),m(false);else if(S.key==="ArrowUp"){S.preventDefault();let D=eo(C,o,c$1);d(D.toString()),t?.(D);}else if(S.key==="ArrowDown"){S.preventDefault();let D=to(C,o,i);d(D.toString()),t?.(D);}},[Z,C,o,c$1,i,t]),q=useCallback(S=>{t?.(S),m(false),p(false);},[t]),j=useCallback(S=>{S.target.tagName!=="INPUT"&&S.preventDefault();},[]);return jsxs("div",{ref:h,className:M("flex items-center",n),onMouseDown:j,children:[jsx(K,{variant:"ghost",size:"icon-sm",className:M("h-7 w-7 text-muted-foreground hover:text-foreground hover:bg-muted/80 rounded-r-none",r&&"opacity-30 cursor-not-allowed"),onMouseDown:P,disabled:r||C<=i,"aria-label":u("fontSize.decrease"),"data-testid":"font-size-decrease",children:jsx(b,{name:"remove",size:18})}),jsx("div",{className:"relative",children:a?jsx("input",{ref:s,type:"text",value:b$2,onChange:we,onBlur:Z,onKeyDown:ge,className:M("h-7 w-10 text-center text-sm border border-input bg-doc-bg-input text-doc-text","focus:outline-none focus:ring-1 focus:ring-ring","rounded-none"),"aria-label":u("fontSize.label"),"data-testid":"font-size-input"}):jsx("button",{type:"button",onClick:F,className:M("h-7 w-10 text-center text-sm border border-border bg-doc-bg-input text-doc-text","hover:border-input hover:bg-doc-bg-hover","focus:outline-none focus:ring-1 focus:ring-ring","rounded-none",r&&"opacity-50 cursor-not-allowed"),disabled:r,"aria-label":u("fontSize.label"),"aria-haspopup":"listbox","aria-expanded":f,"data-testid":"font-size-display",children:L})}),f&&jsx("div",{ref:v,style:{...y,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:6,boxShadow:"0 4px 12px var(--doc-shadow)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":u("fontSize.listLabel"),children:o.map(S=>jsx("button",{type:"button",onClick:()=>q(S),className:M("w-full px-3 py-1.5 text-sm text-left","hover:bg-muted",S===C&&"bg-muted font-medium"),role:"option","aria-selected":S===C,children:S},S))}),jsx(K,{variant:"ghost",size:"icon-sm",className:M("h-7 w-7 text-muted-foreground hover:text-foreground hover:bg-muted/80 rounded-l-none",r&&"opacity-30 cursor-not-allowed"),onMouseDown:U,disabled:r||C>=c$1,"aria-label":u("fontSize.increase"),"data-testid":"font-size-increase",children:jsx(b,{name:"add",size:18})})]})}var yr={display:"inline-flex",alignItems:"center",gap:"4px"},no={display:"inline-flex",alignItems:"center",gap:"4px"},ct={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",padding:"4px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Cr={...ct,backgroundColor:"var(--doc-bg-hover)"},wr={...ct,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Sr={...ct,cursor:"default",opacity:.38},Tr={width:"28px",height:"28px",padding:"2px"},kr={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},it=20;function lt({active:e=false,disabled:t=false,title:o,onClick:r,children:n,className:l,style:i}){let[c,u]=useState(false),a={...t?Sr:e?wr:c?Cr:ct,...i},p=b=>{b.preventDefault();};return jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${l||""}`,style:a,onMouseDown:p,onClick:t?void 0:r,onMouseEnter:()=>u(true),onMouseLeave:()=>u(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:n})}function ao({listState:e,onBulletList:t,onNumberedList:o,onIndent:r,onOutdent:n,disabled:l=false,className:i,style:c,showIndentButtons:u=true,compact:a=false,hasIndent:p=false}){let{t:b$2}=b$1(),d=useCallback(()=>a?{...Tr}:{},[a]),f=e?.type==="bullet",m=e?.type==="numbered",g=(e?.isInList||f||m)&&(e?.level??0)>0||p;return jsxs("div",{className:`docx-list-buttons ${i||""}`,style:{...yr,...c},role:"group","aria-label":b$2("lists.ariaLabel"),children:[jsxs("div",{style:no,role:"group","aria-label":b$2("lists.typeAriaLabel"),children:[jsx(lt,{active:f,disabled:l,title:b$2("lists.bulletList"),onClick:t,style:d(),children:jsx(b,{name:"format_list_bulleted",size:it})}),jsx(lt,{active:m,disabled:l,title:b$2("lists.numberedList"),onClick:o,style:d(),children:jsx(b,{name:"format_list_numbered",size:it})})]}),u&&jsxs(Fragment,{children:[jsx("div",{style:kr,role:"separator"}),jsxs("div",{style:no,role:"group","aria-label":b$2("lists.indentationAriaLabel"),children:[jsx(lt,{active:false,disabled:l||!g,title:b$2("lists.decreaseIndent"),onClick:n,style:d(),children:jsx(b,{name:"format_indent_decrease",size:it})}),jsx(lt,{active:false,disabled:l,title:b$2("lists.increaseIndent"),onClick:r,style:d(),children:jsx(b,{name:"format_indent_increase",size:it})})]})]})]})}var dt={hfInlineEditor:10,ruler:30,outline:40,dropdown:100,toolbar:100,contextMenu:1e4};var lo=[{action:"cut",labelKey:"contextMenu.cut",shortcutKey:"contextMenu.cutShortcut"},{action:"copy",labelKey:"contextMenu.copy",shortcutKey:"contextMenu.copyShortcut"},{action:"paste",labelKey:"contextMenu.paste",shortcutKey:"contextMenu.pasteShortcut"},{action:"pasteAsPlainText",labelKey:"contextMenu.pastePlainText",shortcutKey:"contextMenu.pastePlainTextShortcut",dividerAfter:true},{action:"delete",labelKey:"contextMenu.delete",shortcutKey:"contextMenu.deleteShortcut",dividerAfter:true},{action:"selectAll",labelKey:"contextMenu.selectAll",shortcutKey:"contextMenu.selectAllShortcut"}],Lr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"4",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M5.5 10.5L10.5 3M10.5 10.5L5.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Rr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"5",y:"5",width:"8",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M11 5V3a1 1 0 00-1-1H4a1 1 0 00-1 1v8a1 1 0 001 1h2",stroke:"currentColor",strokeWidth:"1.5"})]}),Er=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"3",y:"3",width:"10",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 3V2a1 1 0 011-1h2a1 1 0 011 1v1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 8h4M6 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Ar=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),Nr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2"}),jsx("rect",{x:"4",y:"4",width:"8",height:"8",fill:"currentColor",opacity:"0.3"})]}),Dr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 1v3M6.5 2.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),Br=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 12v3M6.5 13.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),_r=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M5 8h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Fr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M3 8H0.5M1.75 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),Or=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M13 8h2.5M14.25 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),zr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Kr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"4",width:"4",height:"8",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"10",y:"4",width:"4",height:"8",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M7 8h2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsx("path",{d:"M8 7l1 1-1 1",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),Hr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"4",width:"12",height:"8",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 4v8",stroke:"currentColor",strokeWidth:"1.2",strokeDasharray:"2 1"}),jsx("path",{d:"M6.5 8h-1M9.5 8h1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Wr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 1.5"}),jsx("path",{d:"M8 2v12M2 8h12",stroke:"currentColor",strokeWidth:"1.2"})]}),Vr=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),jsx("path",{d:"M5 2v12M2 8h11",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.6"}),jsx("path",{d:"M5.5 5.5l5 5M10.5 5.5l-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),$r=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M3 3h10a1 1 0 011 1v6a1 1 0 01-1 1H6l-3 2.5V11H3a1 1 0 01-1-1V4a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),jsx("path",{d:"M5 6h6M5 8.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});function Gr(e){switch(e){case "cut":return jsx(Lr,{});case "copy":return jsx(Rr,{});case "paste":case "pasteAsPlainText":return jsx(Er,{});case "delete":return jsx(Ar,{});case "selectAll":return jsx(Nr,{});case "addRowAbove":return jsx(Dr,{});case "addRowBelow":return jsx(Br,{});case "deleteRow":return jsx(_r,{});case "addColumnLeft":return jsx(Fr,{});case "addColumnRight":return jsx(Or,{});case "deleteColumn":return jsx(zr,{});case "mergeCells":return jsx(Kr,{});case "splitCell":return jsx(Hr,{});case "selectTable":return jsx(Wr,{});case "deleteTable":return jsx(Vr,{});case "addComment":return jsx($r,{});default:return null}}var Ur=({item:e,onClick:t,isHighlighted:o,onMouseEnter:r})=>e.action==="separator"?jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}}):jsxs(Fragment,{children:[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:r,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:[jsx("span",{style:{display:"flex",color:e.disabled?"var(--doc-border)":"var(--doc-text-muted)"},children:Gr(e.action)}),jsx("span",{style:{flex:1},children:e.label}),e.shortcut&&jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),e.dividerAfter&&jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}})]}),bi=({isOpen:e,position:t,hasSelection:o,isEditable:r,hasClipboardContent:n=true,onAction:l,onClose:i,items:c,className:u=""})=>{let a=useRef(null),[p,b]=useState(0),{t:d}=b$1(),f=useMemo(()=>lo.map(v=>({action:v.action,label:d(v.labelKey),shortcut:v.shortcutKey?d(v.shortcutKey):void 0,dividerAfter:v.dividerAfter})),[d]),m=(c||f).map(v=>{let y=(()=>{if(v.disabled!==void 0)return v.disabled;switch(v.action){case "cut":case "copy":case "delete":return !o;case "paste":case "pasteAsPlainText":return !r||!n;default:return false}})();return {...v,disabled:y}}),s=m.filter(v=>v.action!=="separator");useEffect(()=>{if(!e)return;let v=C=>{a.current&&!a.current.contains(C.target)&&i();},y=setTimeout(()=>{document.addEventListener("mousedown",v);},0);return ()=>{clearTimeout(y),document.removeEventListener("mousedown",v);}},[e,i]),useEffect(()=>{if(!e)return;let v=y=>{switch(y.key){case "Escape":y.preventDefault(),i();break;case "ArrowDown":y.preventDefault(),b(L=>{let P=(L+1)%s.length;for(;s[P]?.disabled&&P!==L;)P=(P+1)%s.length;return P});break;case "ArrowUp":y.preventDefault(),b(L=>{let P=(L-1+s.length)%s.length;for(;s[P]?.disabled&&P!==L;)P=(P-1+s.length)%s.length;return P});break;case "Enter":y.preventDefault();let C=s[p];C&&!C.disabled&&(l(C.action),i());break}};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,p,s,l,i]),useEffect(()=>{e&&b(0);},[e]);let g=useCallback(()=>{let y=m.length*36+16,C=t.x,L=t.y;return typeof window<"u"&&(C+220>window.innerWidth&&(C=window.innerWidth-220-10),L+y>window.innerHeight&&(L=window.innerHeight-y-10),C<10&&(C=10),L<10&&(L=10)),{position:"fixed",top:L,left:C,minWidth:220,background:"var(--doc-surface)",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px var(--doc-shadow)",zIndex:dt.contextMenu,padding:"4px 0",overflow:"hidden"}},[t,m.length]),h=v=>{v.disabled||(l(v.action),i());};return e?jsx("div",{ref:a,className:`docx-text-context-menu ${u}`,style:g(),role:"menu","aria-label":d("contextMenu.textMenuAriaLabel"),children:m.map((v,y)=>{let C=s.findIndex(L=>L===v);return jsx(Ur,{item:v,onClick:()=>h(v),isHighlighted:C===p,onMouseEnter:()=>{C>=0&&!v.disabled&&b(C);}},`${v.action}-${y}`)})}):null};function gi(e={}){let{enabled:t=true,isEditable:o=true,containerRef:r,onAction:n}=e,[l,i]=useState(false),[c,u]=useState({x:0,y:0}),[a,p]=useState(false),b=useCallback(()=>{let g=window.getSelection(),h=g&&!g.isCollapsed&&g.toString().length>0;return p(!!h),!!h},[]),d=useCallback(g=>{t&&(g.preventDefault(),g.stopPropagation(),b(),u({x:g.clientX,y:g.clientY}),i(true));},[t,b]),f=useCallback(()=>{i(false);},[]),m=useCallback(g=>{switch(f(),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(h=>{document.execCommand("insertText",false,h);}).catch(()=>{document.execCommand("paste");});break;case "delete":document.execCommand("delete");break;case "selectAll":document.execCommand("selectAll");break}n?.(g);},[f,n]),s=useCallback(g=>{d(g);},[d]);return useEffect(()=>{if(!l)return;let g=h=>{h.key==="Escape"&&f();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[l,f]),{isOpen:l,position:c,hasSelection:a,openMenu:d,closeMenu:f,handleAction:m,onContextMenu:s}}function hi(e){return {cut:"Cut",copy:"Copy",paste:"Paste",pasteAsPlainText:"Paste as Plain Text",selectAll:"Select All",delete:"Delete",separator:"",addRowAbove:"Insert row above",addRowBelow:"Insert row below",deleteRow:"Delete row",addColumnLeft:"Insert column left",addColumnRight:"Insert column right",deleteColumn:"Delete column",mergeCells:en.table.mergeCells,splitCell:en.table.splitCell,selectTable:en.table.selectTable,deleteTable:en.table.deleteTable,addComment:"Comment"}[e]}function vi(e){return {cut:"Ctrl+X",copy:"Ctrl+C",paste:"Ctrl+V",pasteAsPlainText:"Ctrl+Shift+V",selectAll:"Ctrl+A",delete:"Del",separator:"",addRowAbove:"",addRowBelow:"",deleteRow:"",addColumnLeft:"",addColumnRight:"",deleteColumn:"",mergeCells:"",splitCell:"",selectTable:"",deleteTable:"",addComment:""}[e]}function xi(){return lo.map(e=>({action:e.action,label:e.labelKey,shortcut:e.shortcutKey,dividerAfter:e.dividerAfter}))}function yi(e,t,o){switch(e){case "cut":case "copy":case "delete":return t;case "paste":case "pasteAsPlainText":return o;case "addComment":return t;case "selectAll":return true;default:return true}}var Te=E.Root,ke=E.Group,ft=E.Value;function Pe({className:e,children:t,onMouseDown:o,...r}){return jsxs(E.Trigger,{className:M("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-foreground bg-transparent","hover:bg-muted/80 focus:outline-none focus:bg-muted/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:n=>{n.preventDefault(),o?.(n);},...r,children:[t,jsx(E.Icon,{asChild:true,children:jsx(qr,{className:"h-4 w-4 text-muted-foreground shrink-0"})})]})}function Me({className:e,children:t,position:o="popper",onCloseAutoFocus:r,...n}){let l=typeof document<"u"&&!!document.querySelector(".ep-root.dark");return jsx(E.Portal,{children:jsx("div",{className:M("ep-root",l&&"dark"),children:jsx(E.Content,{className:M("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-border bg-popover text-popover-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",e),position:o,onCloseAutoFocus:i=>{i.preventDefault(),r?.(i);},...n,children:jsx(E.Viewport,{className:M("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:i=>i.preventDefault(),children:t})})})})}function _e({className:e,...t}){return jsx(E.Label,{className:M("px-2 py-1.5 text-xs font-medium text-muted-foreground",e),...t})}function oe({className:e,children:t,onMouseDown:o,...r}){return jsxs(E.Item,{className:M("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-foreground outline-none","hover:bg-muted focus:bg-muted","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:n=>{n.preventDefault(),o?.(n);},...r,children:[jsx(E.ItemText,{children:t}),jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsx(E.ItemIndicator,{children:jsx(Yr,{className:"h-4 w-4"})})})]})}function Fe({className:e,...t}){return jsx(E.Separator,{className:M("-mx-1 my-1 h-px bg-muted",e),...t})}function qr({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})}function Yr({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}function It(e){let t=e.trim();if(!t)return "";let o=null,r="";for(let n of t){if((n==='"'||n==="'")&&o===null){o=n,r+=n;continue}if(n===o){o=null,r+=n;continue}if(n===","&&o===null)break;r+=n;}return r.trim().replace(/^['"]|['"]$/g,"")}var jr=[{name:"Arial",fontFamily:"Arial, Helvetica, sans-serif",category:"sans-serif"},{name:"Calibri",fontFamily:'"Calibri", Arial, sans-serif',category:"sans-serif"},{name:"Helvetica",fontFamily:"Helvetica, Arial, sans-serif",category:"sans-serif"},{name:"Verdana",fontFamily:"Verdana, Geneva, sans-serif",category:"sans-serif"},{name:"Open Sans",fontFamily:'"Open Sans", sans-serif',category:"sans-serif"},{name:"Roboto",fontFamily:"Roboto, sans-serif",category:"sans-serif"},{name:"Times New Roman",fontFamily:'"Times New Roman", Times, serif',category:"serif"},{name:"Georgia",fontFamily:"Georgia, serif",category:"serif"},{name:"Cambria",fontFamily:"Cambria, Georgia, serif",category:"serif"},{name:"Garamond",fontFamily:"Garamond, serif",category:"serif"},{name:"Courier New",fontFamily:'"Courier New", Courier, monospace',category:"monospace"},{name:"Consolas",fontFamily:"Consolas, monospace",category:"monospace"}];function co({value:e,onChange:t,fonts:o=jr,documentFonts:r,disabled:n=false,className:l,placeholder:i="Arial",width:c=120,showPreview:u=true}){let{t:a}=b$1(),p=J.useMemo(()=>excludeFontsByName(r,o.map(s=>s.name)),[r,o]),b=J.useMemo(()=>[...p,...o],[p,o]),d=J.useMemo(()=>e?b.find(g=>g.fontFamily===e||g.name.toLowerCase()===e.toLowerCase()||It(g.fontFamily).toLowerCase()===e.toLowerCase())?.name||e:i,[e,b,i]),f=J.useCallback(s=>{let g=b.find(h=>h.name===s);g&&t?.(It(g.fontFamily)||g.name);},[t,b]),m=J.useMemo(()=>{let s={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(g=>{let h=g.category||"other";s[h].push(g);}),s},[o]);return jsxs(Te,{value:d,onValueChange:f,disabled:n,children:[jsx(Pe,{className:M("h-8 text-sm",l),style:{minWidth:typeof c=="number"?`${c}px`:c},"aria-label":a("font.selectAriaLabel"),children:jsx(ft,{placeholder:i,children:d})}),jsxs(Me,{className:"max-h-[300px]",children:[p.length>0&&jsxs(Fragment,{children:[jsxs(ke,{children:[jsx(_e,{children:a("font.documentFonts")}),p.map(s=>jsx(oe,{value:s.name,style:u?{fontFamily:s.fontFamily}:void 0,children:s.name},`doc-${s.name}`))]}),jsx(Fe,{})]}),m["sans-serif"].length>0&&jsxs(ke,{children:[jsx(_e,{children:a("font.sansSerif")}),m["sans-serif"].map(s=>jsx(oe,{value:s.name,style:u?{fontFamily:s.fontFamily}:void 0,children:s.name},s.name))]}),m.serif.length>0&&jsxs(Fragment,{children:[jsx(Fe,{}),jsxs(ke,{children:[jsx(_e,{children:a("font.serif")}),m.serif.map(s=>jsx(oe,{value:s.name,style:u?{fontFamily:s.fontFamily}:void 0,children:s.name},s.name))]})]}),m.monospace.length>0&&jsxs(Fragment,{children:[jsx(Fe,{}),jsxs(ke,{children:[jsx(_e,{children:a("font.monospace")}),m.monospace.map(s=>jsx(oe,{value:s.name,style:u?{fontFamily:s.fontFamily}:void 0,children:s.name},s.name))]})]}),m.other.length>0&&jsxs(Fragment,{children:[jsx(Fe,{}),jsx(ke,{children:m.other.map(s=>jsx(oe,{value:s.name,style:u?{fontFamily:s.fontFamily}:void 0,children:s.name},s.name))})]})]})]})}var rn=[{name:"Dark Red",nameKey:"colorPicker.colors.darkRed",hex:"C00000"},{name:"Red",nameKey:"colorPicker.colors.red",hex:"FF0000"},{name:"Orange",nameKey:"colorPicker.colors.orange",hex:"FFC000"},{name:"Yellow",nameKey:"colorPicker.colors.yellow",hex:"FFFF00"},{name:"Light Green",nameKey:"colorPicker.colors.lightGreen",hex:"92D050"},{name:"Green",nameKey:"colorPicker.colors.green",hex:"00B050"},{name:"Light Blue",nameKey:"colorPicker.colors.lightBlue",hex:"00B0F0"},{name:"Blue",nameKey:"colorPicker.colors.blue",hex:"0070C0"},{name:"Dark Blue",nameKey:"colorPicker.colors.darkBlue",hex:"002060"},{name:"Purple",nameKey:"colorPicker.colors.purple",hex:"7030A0"}],gt=18,nn=2,an={position:"relative",display:"inline-block"},ln={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)"},sn={padding:"10px",backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border-dark)",borderRadius:"6px",boxShadow:"0 4px 16px var(--doc-shadow)",width:"auto"},Rt={fontSize:"11px",color:"var(--doc-text-muted)",marginBottom:"4px",fontWeight:500},Et={height:"1px",backgroundColor:"var(--doc-border)",margin:"8px 0"},mo={display:"grid",gap:`${nn}px`},ht={width:`${gt}px`,height:`${gt}px`,border:"1px solid var(--doc-border-input)",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},fo={...ht,transform:"scale(1.15)",borderColor:"var(--doc-text)",zIndex:1},bo={...ht,borderWidth:"2px",borderColor:"var(--doc-primary)",boxShadow:"0 0 0 1px var(--doc-primary)"},cn={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid var(--doc-border-dark)",borderRadius:"4px",backgroundColor:"var(--doc-surface)",cursor:"pointer",fontSize:"12px",color:"var(--doc-text)"},dn={display:"flex",alignItems:"center",gap:"6px"},un={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"12px"},pn={height:"24px",padding:"0 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",backgroundColor:"var(--doc-bg-subtle)",fontSize:"12px",cursor:"pointer"},uo={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"},mn={display:"inline-flex",alignItems:"stretch",height:"32px",gap:"2px"},fn={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:0,width:"28px",padding:"2px 4px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},bn={display:"flex",alignItems:"center",justifyContent:"center",width:"18px",padding:0,border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"};function At(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let r=resolveHighlightColor(e);return r||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return resolveColor(e,o)}function po(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16);return (o*299+r*587+n*114)/1e3>230}function go(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():resolveColorToHex(e,o))===t.toUpperCase():false}function gn({matrix:e,selectedColor:t,theme:o,onSelect:r}){let[n,l]=useState(null);return jsx("div",{style:{...mo,gridTemplateColumns:`repeat(10, ${gt}px)`},children:e.flatMap((i,c)=>i.map((u,a)=>{let p=`${c}-${a}`,b=n===p,d=go(t,u.hex,o);return jsx("button",{type:"button",style:{...d?bo:b?fo:ht,backgroundColor:`#${u.hex}`},title:u.label,"aria-label":u.label,"aria-selected":d,onClick:()=>r(u),onMouseDown:f=>f.preventDefault(),onMouseEnter:()=>l(p),onMouseLeave:()=>l(null)},p)}))})}function hn({selectedColor:e,theme:t,onSelect:o}){let[r,n]=useState(null),{t:l}=b$1();return jsx("div",{style:{...mo,gridTemplateColumns:`repeat(10, ${gt}px)`},children:rn.map((i,c)=>{let u=r===c,a=go(e,i.hex,t),p=l(i.nameKey);return jsx("button",{type:"button",style:{...a?bo:u?fo:ht,backgroundColor:`#${i.hex}`},title:p,"aria-label":p,"aria-selected":a,onClick:()=>o(i.hex),onMouseDown:b=>b.preventDefault(),onMouseEnter:()=>n(c),onMouseLeave:()=>n(null)},i.hex)})})}function Ke({mode:e,value:t,onChange:o,theme:r,disabled:n=false,className:l,style:i,title:c$1,icon:u,autoLabel:a,splitButton:p=true,defaultColor:b$2}){let[d,f]=useState(false),[m,s]=useState(false),[g,h]=useState(false),[v,y]=useState(false),[C,L]=useState(""),[P,U]=useState(()=>b$2??(e==="highlight"?"FFFF00":e==="border"?{rgb:"000000"}:{rgb:"FF0000"})),{t:F}=b$1();useEffect(()=>{let T=At(t,e,r).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(T)&&L(T.toUpperCase());},[t,e,r]);let we=useCallback(()=>f(false),[]),{containerRef:Z,dropdownRef:ge,dropdownStyle:q}=c({isOpen:d,onClose:we}),j=r?.colorScheme??null,S=useMemo(()=>generateThemeTintShadeMatrix(j),[j]),D=useMemo(()=>At(t,e,r),[t,e,r]),de=useMemo(()=>At(P,e,r),[P,e,r]),he=useCallback(()=>{n||f(T=>!T);},[n]),Ne=useCallback(T=>{let V;if(e==="highlight")V=T.hex;else {let xe={themeColor:T.themeSlot,rgb:T.hex};T.tint&&(xe.themeTint=T.tint),T.shade&&(xe.themeShade=T.shade),V=xe;}U(V),o?.(V),f(false);},[e,o]),ve=useCallback(T=>{let V=e==="highlight"?T:{rgb:T};U(V),o?.(V),f(false);},[e,o]),Se=useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),f(false);},[e,o]),Q=useCallback(()=>{let T=C.replace(/^#/,"").toUpperCase();if(/^[0-9A-F]{6}$/i.test(T)){let V=e==="highlight"?T:{rgb:T};U(V),o?.(V),f(false),L("");}},[e,C,o]),Ue=useCallback(()=>{n||o?.(P);},[n,P,o]),z={...ln,...n?{cursor:"default",opacity:.38}:d?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:m?{backgroundColor:"var(--doc-bg-hover)"}:{}},ae=F(e==="text"?"formattingBar.fontColor":e==="highlight"?"formattingBar.highlightColor":"table.borderColor"),Ze=u??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxs("div",{ref:Z,className:`docx-color-picker ${l||""}`,style:{...an,...i},children:[p?jsxs("div",{className:"docx-color-picker-split",style:{...mn,...n?{opacity:.38,cursor:"default"}:null},children:[jsxs("button",{type:"button",className:"docx-color-picker-apply",style:{...fn,...n?{cursor:"default"}:g?{backgroundColor:"var(--doc-bg-hover)"}:null},onClick:Ue,onMouseDown:T=>T.preventDefault(),onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),disabled:n,title:c$1||ae,"aria-label":c$1||ae,children:[jsx(b,{name:Ze,size:18}),jsx("div",{style:{...uo,backgroundColor:de==="transparent"?"#fff":de,outline:de==="transparent"||po(de)?"1px solid #bbb":"none"}})]}),jsx("button",{type:"button",className:"docx-color-picker-arrow",style:{...bn,...n?{cursor:"default"}:d?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:v?{backgroundColor:"var(--doc-bg-hover)"}:null},onClick:he,onMouseDown:T=>T.preventDefault(),onMouseEnter:()=>y(true),onMouseLeave:()=>y(false),disabled:n,title:c$1||ae,"aria-label":c$1||ae,"aria-haspopup":"true","aria-expanded":d,children:jsx(b,{name:"arrow_drop_down",size:18})})]}):jsxs("button",{type:"button",className:"docx-color-picker-button",style:z,onClick:he,onMouseDown:T=>T.preventDefault(),onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),disabled:n,title:c$1||ae,"aria-label":c$1||ae,"aria-haspopup":"true","aria-expanded":d,children:[jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsx(b,{name:Ze,size:18}),jsx("div",{style:{...uo,backgroundColor:D==="transparent"?"#fff":D,outline:D==="transparent"||po(D)?"1px solid #bbb":"none"}})]}),jsx(b,{name:"arrow_drop_down",size:14})]}),d&&jsx("div",{ref:ge,className:"docx-color-picker-dropdown",style:{...q,...sn},role:"dialog","aria-label":`${ae} picker`,onMouseDown:T=>{T.target.tagName!=="INPUT"&&T.preventDefault();},children:jsxs(Fragment,{children:[jsxs("button",{type:"button",style:cn,onClick:Se,onMouseDown:T=>T.preventDefault(),children:[e==="highlight"?jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",border:"1px solid #ccc",borderRadius:"2px",position:"relative",backgroundColor:"#fff"},children:jsx("span",{style:{position:"absolute",top:"50%",left:"-1px",right:"-1px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"}})}):jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",backgroundColor:"#000",borderRadius:"2px"}}),a??F(e==="highlight"?"colorPicker.noColor":"colorPicker.automatic")]}),jsx("div",{style:Et}),jsx("div",{style:Rt,children:F("colorPicker.themeColors")}),jsx(gn,{matrix:S,selectedColor:t,theme:r,onSelect:Ne}),jsx("div",{style:Et}),jsx("div",{style:Rt,children:F("colorPicker.standardColors")}),jsx(hn,{selectedColor:t,theme:r,onSelect:ve}),jsx("div",{style:Et}),jsx("div",{style:Rt,children:F("colorPicker.customColor")}),jsxs("div",{style:dn,children:[jsx("span",{style:{fontSize:"12px",color:"var(--doc-text-muted)"},children:"#"}),jsx("input",{type:"text",style:un,value:C,onChange:T=>L(T.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:T=>{T.key==="Enter"&&Q();},onMouseDown:T=>{T.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsx("button",{type:"button",style:{...pn,opacity:/^[0-9A-Fa-f]{6}$/.test(C)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(C)?"pointer":"default"},onClick:Q,onMouseDown:T=>T.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(C),children:F("common.apply")})]})]})})]})}function re({content:e,children:t,side:o="bottom",delayMs:r=400}){let[n,l]=J.useState(false),[i,c]=J.useState({x:0,y:0}),u=J.useRef(null),a=J.useRef(null),p=J.useCallback(()=>{a.current=setTimeout(()=>{if(u.current){let m=u.current.getBoundingClientRect(),s=m.left+m.width/2,g=o==="top"?m.top-8:m.bottom+8;c({x:s,y:g});}l(true);},r);},[r,o]),b=J.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),l(false);},[]);J.useEffect(()=>()=>{a.current&&clearTimeout(a.current);},[]);let d=t.props,f=J.cloneElement(t,{ref:u,onMouseEnter:m=>{p(),d.onMouseEnter?.(m);},onMouseLeave:m=>{b(),d.onMouseLeave?.(m);}});return jsxs(Fragment,{children:[f,n&&jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-foreground dark:bg-muted dark:text-foreground rounded-md shadow-lg",style:{left:i.x,top:i.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var et=20,Nt=[{value:"left",label:"Align Left",labelKey:"alignment.alignLeft",shortcutKey:"alignment.alignLeftShortcut",icon:jsx(b,{name:"format_align_left",size:et}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",labelKey:"alignment.center",shortcutKey:"alignment.centerShortcut",icon:jsx(b,{name:"format_align_center",size:et}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",labelKey:"alignment.alignRight",shortcutKey:"alignment.alignRightShortcut",icon:jsx(b,{name:"format_align_right",size:et}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",labelKey:"alignment.justify",shortcutKey:"alignment.justifyShortcut",icon:jsx(b,{name:"format_align_justify",size:et}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function xo({value:e="left",onChange:t,disabled:o=false}){let{t:r}=b$1(),[n,l]=useState(false),i=useCallback(()=>l(false),[]),{containerRef:c$1,dropdownRef:u,dropdownStyle:a,handleMouseDown:p}=c({isOpen:n,onClose:i}),b$2=useCallback(h=>{o||t?.(h),l(false);},[o,t]),d=Nt.find(h=>h.value===e)||Nt[0],f=r(d.labelKey),m=d.shortcutKey?r(d.shortcutKey):void 0,s=`${f}${m?` (${m})`:""}`,g=jsxs(K,{variant:"ghost",size:"icon-sm",className:M("text-muted-foreground hover:text-foreground hover:bg-muted/80",n&&"bg-muted",o&&"opacity-30 cursor-not-allowed"),onMouseDown:p,onClick:()=>!o&&l(h=>!h),disabled:o,"aria-label":s,"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsx(b,{name:d.iconName,size:et}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:c$1,style:{position:"relative",display:"inline-block"},children:[n?g:jsx(re,{content:s,children:g}),n&&!o&&jsx("div",{ref:u,style:{...a,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px var(--doc-shadow)",padding:6},onMouseDown:h=>h.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:Nt.map(h=>{let v=e===h.value,y=r(h.labelKey),C=h.shortcutKey?r(h.shortcutKey):void 0;return jsx("button",{type:"button",title:`${y}${C?` (${C})`:""}`,"data-testid":`alignment-${h.value}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:v?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:v?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:L=>L.preventDefault(),onMouseEnter:L=>{v||(L.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=v?"var(--doc-primary-light)":"transparent";},onClick:()=>b$2(h.value),children:jsx(b,{name:h.iconName,size:18})},h.value)})})})]})}var Sn=[{label:"Single",labelKey:"lineSpacing.single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",labelKey:"lineSpacing.double",value:2,twipsValue:480}];function Co({value:e,onChange:t,options:o=Sn,disabled:r=false,className:n}){let{t:l}=b$1(),i=J.useMemo(()=>e===void 0?o[0]:o.find(a=>a.twipsValue===e)||o[0],[e,o]),c=J.useCallback(a=>{let p=parseInt(a,10);isNaN(p)||t?.(p);},[t]),u=a=>a.labelKey?l(a.labelKey):a.label;return jsxs(Te,{value:i.twipsValue.toString(),onValueChange:c,disabled:r,children:[jsx(Pe,{className:M("h-8 text-sm gap-0.5 px-2",n),style:{width:"auto"},title:l("lineSpacing.lineSpacingTitle",{label:u(i)}),children:jsx(a,{className:"h-5 w-5 shrink-0"})}),jsxs(Me,{children:[o.map(a=>jsx(oe,{value:a.twipsValue.toString(),children:u(a)},a.twipsValue)),jsx(Fe,{}),jsx(ke,{children:jsx(_e,{children:l("lineSpacing.paragraphSpacing")})})]})]})}var wo=[{styleId:"Normal",name:"Normal text",nameKey:"styles.normalText",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",nameKey:"styles.title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",nameKey:"styles.subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",nameKey:"styles.heading1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",nameKey:"styles.heading2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",nameKey:"styles.heading3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}];function So({value:e,onChange:t,styles:o,disabled:r=false,className:n,width:l=120}){let{t:i}=b$1(),c=J.useMemo(()=>{let f=resolveParagraphStyleOptions(o);return f.length===0?wo:f.map(m=>({...m,type:"paragraph",nameKey:wo.find(s=>s.styleId===m.styleId)?.nameKey}))},[o]),u=J.useCallback(f=>{t?.(f);},[t]),a=f=>f.nameKey?i(f.nameKey):f.name,p=e||"Normal",b=c.find(f=>f.styleId===p),d=b?a(b):p;return jsxs(Te,{value:p,onValueChange:u,disabled:r,children:[jsx(Pe,{className:M("h-8 text-sm",n),style:{width:typeof l=="number"?`${l}px`:l},"aria-label":i("styles.selectAriaLabel"),children:jsx("span",{className:"truncate",children:d})}),jsx(Me,{className:"min-w-[260px] max-h-[400px]",children:c.map(f=>jsx(oe,{value:f.styleId,className:"py-2.5 px-3",children:jsx("span",{style:getStylePreviewProps(f),children:a(f)})},f.styleId))})]})}var Mn=[{value:.5,label:"50%"},{value:.75,label:"75%"},{value:1,label:"100%"},{value:1.25,label:"125%"},{value:1.5,label:"150%"},{value:2,label:"200%"}];function ko({value:e=1,onChange:t,levels:o=Mn,disabled:r=false,className:n,compact:l=false}){let{t:i}=b$1(),c=J.useMemo(()=>{let f=o.find(m=>Math.abs(m.value-e)<.001);return f?f.label:`${Math.round(e*100)}%`},[o,e]),u=J.useCallback(f=>{let m=parseFloat(f);isNaN(m)||t?.(m);},[t]),a=J.useMemo(()=>[...o].sort((f,m)=>f.value-m.value),[o]),p=J.useMemo(()=>[...a].reverse().find(f=>f.value<e-.001),[a,e]),b$2=J.useMemo(()=>a.find(f=>f.value>e+.001),[a,e]),d=l?"h-7 w-7":"h-8 w-8";return jsxs("div",{className:"flex items-center",children:[jsx(K,{variant:"ghost",size:"icon-sm",className:M(d,"text-muted-foreground hover:text-foreground hover:bg-muted/80 rounded-r-none",(r||!p)&&"opacity-30 cursor-not-allowed"),onClick:()=>p&&t?.(p.value),disabled:r||!p,"aria-label":i("zoom.zoomOut"),children:jsx(b,{name:"remove",size:18})}),jsxs(Te,{value:e.toString(),onValueChange:u,disabled:r,children:[jsx(Pe,{className:M(l?"h-7 min-w-[55px] text-xs":"h-8 min-w-[64px] text-sm","rounded-none",n),"aria-label":i("zoom.ariaLabel",{label:c}),children:jsx(ft,{placeholder:"100%",children:c})}),jsx(Me,{children:o.map(f=>jsx(oe,{value:f.value.toString(),children:f.label},f.value))})]}),jsx(K,{variant:"ghost",size:"icon-sm",className:M(d,"text-muted-foreground hover:text-foreground hover:bg-muted/80 rounded-l-none",(r||!b$2)&&"opacity-30 cursor-not-allowed"),onClick:()=>b$2&&t?.(b$2.value),disabled:r||!b$2,"aria-label":i("zoom.zoomIn"),children:jsx(b,{name:"add",size:18})})]})}var Ln=[{action:"borderAll",icon:"border_all",labelKey:"table.borders.all"},{action:"borderOutside",icon:"border_outer",labelKey:"table.borders.outside"},{action:"borderInside",icon:"border_inner",labelKey:"table.borders.inside"},{action:"borderTop",icon:"border_top",labelKey:"table.borders.top"},{action:"borderBottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{action:"borderLeft",icon:"border_left",labelKey:"table.borders.left"},{action:"borderRight",icon:"border_right",labelKey:"table.borders.right"},{action:"borderNone",icon:"border_clear",labelKey:"table.borders.none"}];function Io({onAction:e,disabled:t=false}){let{t:o}=b$1(),[r,n]=useState(false),l=useCallback(()=>n(false),[]),{containerRef:i,dropdownRef:c$1,dropdownStyle:u,handleMouseDown:a}=c({isOpen:r,onClose:l}),p=useCallback(d=>{e(d),n(false);},[e]),b$2=jsxs(K,{variant:"ghost",size:"icon-sm",className:M("text-muted-foreground hover:text-foreground hover:bg-muted/80",r&&"bg-muted",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&n(d=>!d),disabled:t,"aria-label":o("table.borders.styleAriaLabel"),"aria-expanded":r,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsx(b,{name:"border_all",size:20}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:i,style:{position:"relative",display:"inline-block"},children:[r?b$2:jsx(re,{content:o("table.borders.tooltip"),children:b$2}),r&&!t&&jsx("div",{ref:c$1,style:{...u,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px var(--doc-shadow)",padding:6},onMouseDown:d=>d.stopPropagation(),children:jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:Ln.map(({action:d,icon:f,labelKey:m})=>jsx("button",{type:"button",title:o(m),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:"transparent",cursor:"pointer",color:"var(--doc-text)"},onMouseDown:s=>s.preventDefault(),onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent";},onClick:()=>p(d),children:jsx(b,{name:f,size:18})},typeof d=="string"?d:d.type))})})]})}function Lo({onAction:e,disabled:t=false,theme:o,value:r}){let{t:n}=b$1(),l=useCallback(i=>{typeof i=="string"?e({type:"borderColor",color:i.replace(/^#/,"")}):i.rgb?e({type:"borderColor",color:i.rgb.replace(/^#/,"")}):i.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsx(Ke,{mode:"border",value:r,onChange:l,theme:o,disabled:t,title:n("table.borderColor")})}var Nn=[{size:4,label:"0.5 pt",thickness:.5},{size:8,label:"1 pt",thickness:1},{size:12,label:"1.5 pt",thickness:1.5},{size:16,label:"2 pt",thickness:2},{size:24,label:"3 pt",thickness:3}];function Eo({onAction:e,disabled:t=false}){let[o,r]=useState(false),{t:n}=b$1(),l=useCallback(()=>r(false),[]),{containerRef:i,dropdownRef:c$1,dropdownStyle:u,handleMouseDown:a}=c({isOpen:o,onClose:l}),p=useCallback(d=>{e({type:"borderWidth",size:d}),r(false);},[e]),b$2=jsxs(K,{variant:"ghost",size:"icon-sm",className:M("text-muted-foreground hover:text-foreground hover:bg-muted/80",o&&"bg-muted",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&r(d=>!d),disabled:t,"aria-label":n("table.borderWidth"),"aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsx(b,{name:"line_weight",size:20}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:i,style:{position:"relative",display:"inline-block"},children:[o?b$2:jsx(re,{content:n("table.borderWidth"),children:b$2}),o&&!t&&jsx("div",{ref:c$1,style:{...u,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px var(--doc-shadow)",padding:"4px 0",minWidth:120},onMouseDown:d=>d.stopPropagation(),children:Nn.map(({size:d,label:f,thickness:m})=>jsxs("button",{type:"button",style:{display:"flex",alignItems:"center",gap:10,padding:"6px 12px",width:"100%",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:12,color:"var(--doc-text)"},onMouseDown:s=>s.preventDefault(),onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="transparent";},onClick:()=>p(d),children:[jsx("div",{style:{width:50,height:Math.max(m,1),backgroundColor:"#000",borderRadius:m>2?1:0}}),jsx("span",{children:f})]},d))})]})}function Ao({onAction:e,disabled:t=false,theme:o,value:r}){let{t:n}=b$1(),l=useCallback(i=>{typeof i=="string"&&e(i==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:i.replace(/^#/,"")});},[e]);return jsx(Ke,{mode:"highlight",value:r,onChange:l,theme:o,disabled:t,title:n("table.cellFillColor"),icon:"format_color_fill",autoLabel:n("colorPicker.noColor")})}var _n={display:"flex",alignItems:"center",gap:10,padding:"7px 14px",fontSize:13,color:"var(--doc-text)",cursor:"pointer",border:"none",backgroundColor:"transparent",width:"100%",textAlign:"left"},Ve={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},Bo={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function _o({onAction:e,disabled:t=false,tableContext:o}){let{t:r}=b$1(),[n,l]=useState(false),[i,c$1]=useState(null),u=useCallback(()=>l(false),[]),{containerRef:a,dropdownRef:p,dropdownStyle:b$2,handleMouseDown:d}=c({isOpen:n,onClose:u,align:"right"}),f=o?.table?.attrs?.justification??"left",m=useCallback(h=>{e(h),l(false);},[e]),s=(h,v,y,C,L)=>{let P=t||L?.itemDisabled;return jsxs("button",{type:"button",role:"menuitem",style:{..._n,backgroundColor:i===h&&!P?"var(--doc-bg-hover)":"transparent",color:P?"var(--doc-text-muted)":L?.danger?"var(--doc-error)":"var(--doc-text)",cursor:P?"not-allowed":"pointer"},onClick:()=>!P&&m(C),onMouseEnter:()=>c$1(h),onMouseLeave:()=>c$1(null),disabled:P,children:[jsx(b,{name:v,size:16,className:L?.danger&&!P?"text-destructive":""}),jsx("span",{style:{flex:1},children:y})]},h)},g=jsx(K,{variant:"ghost",size:"icon-sm",className:M("text-muted-foreground hover:text-foreground hover:bg-muted/80",n&&"bg-muted",t&&"opacity-30 cursor-not-allowed"),onMouseDown:d,onClick:()=>!t&&l(h=>!h),disabled:t,"aria-label":r("table.moreOptions"),"aria-expanded":n,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsx(b,{name:"more_vert",size:20})});return jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[n?g:jsx(re,{content:r("table.moreOptions"),children:g}),n&&!t&&jsxs("div",{ref:p,style:{...b$2,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px var(--doc-shadow)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:h=>h.stopPropagation(),children:[s("addRowAbove","add",r("table.insertRowAbove"),"addRowAbove"),s("addRowBelow","add",r("table.insertRowBelow"),"addRowBelow"),s("addColumnLeft","add",r("table.insertColumnLeft"),"addColumnLeft"),s("addColumnRight","add",r("table.insertColumnRight"),"addColumnRight"),jsx("div",{style:Ve,role:"separator"}),s("mergeCells","call_merge",r("table.mergeCells"),"mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),s("splitCell","call_split",r("table.splitCell"),"splitCell",{itemDisabled:!o?.canSplitCell}),jsx("div",{style:Ve,role:"separator"}),s("selectTable","select_all",r("table.selectTable"),"selectTable"),jsx("div",{style:Ve,role:"separator"}),s("deleteRow","delete",r("table.deleteRow"),"deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),s("deleteColumn","delete",r("table.deleteColumn"),"deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),s("deleteTable","delete",r("table.deleteTable"),"deleteTable",{danger:true}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:Bo,children:r("tableAdvanced.verticalAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(h=>{let v={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsx("button",{type:"button",title:r({top:"tableAdvanced.top",center:"tableAdvanced.middle",bottom:"tableAdvanced.bottom"}[h]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:C=>C.preventDefault(),onMouseEnter:C=>{C.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent";},onClick:()=>m({type:"cellVerticalAlign",align:h}),children:jsx(b,{name:v[h],size:16})},h)})}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:Bo,children:r("tableAdvanced.tableAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(h=>{let v={left:"format_align_left",center:"format_align_center",right:"format_align_right"},y=f===h;return jsx("button",{type:"button",title:r({left:"tableAdvanced.alignTableLeft",center:"tableAdvanced.alignTableCenter",right:"tableAdvanced.alignTableRight"}[h]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",borderColor:y?"var(--doc-primary)":"var(--doc-border)",color:y?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:C=>C.preventDefault(),onClick:()=>m({type:"tableProperties",props:{justification:h}}),children:jsx(b,{name:v[h],size:16})},h)})}),jsx("div",{style:Ve,role:"separator"}),s("headerRow","table_rows",r("tableAdvanced.toggleHeaderRow"),{type:"toggleHeaderRow"}),s("distribute","view_column",r("tableAdvanced.distributeColumns"),{type:"distributeColumns"}),s("autoFit","fit_width",r("tableAdvanced.autoFit"),{type:"autoFitContents"}),s("noWrap","wrap_text",r("tableAdvanced.toggleNoWrap"),{type:"toggleNoWrap"}),jsx("div",{style:Ve,role:"separator"}),s("properties","settings",r("tableAdvanced.tableProperties"),{type:"openTableProperties"})]})]})}var On=20;function yt({options:e,activeValue:t,triggerIcon:o,tooltipContent:r,onSelect:n,disabled:l=false,ariaLabel:i,testId:c$1,showLabels:u=false}){let[a,p]=useState(false),b$1=useCallback(()=>p(false),[]),{containerRef:d,dropdownRef:f,dropdownStyle:m,handleMouseDown:s}=c({isOpen:a,onClose:b$1}),g=useCallback(v=>{l||n(v),p(false);},[l,n]),h=jsxs(K,{variant:"ghost",size:"icon-sm",className:M("text-muted-foreground hover:text-foreground hover:bg-muted/80",a&&"bg-muted",l&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!l&&p(v=>!v),disabled:l,"aria-label":i??r,"aria-expanded":a,"aria-haspopup":"true","data-testid":c$1,children:[jsx(b,{name:o,size:On}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:d,style:{position:"relative",display:"inline-block"},children:[a?h:jsx(re,{content:r,children:h}),a&&!l&&jsx("div",{ref:f,style:{...m,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px var(--doc-shadow)",padding:6},onMouseDown:v=>v.stopPropagation(),children:jsx("div",{style:{display:"flex",flexDirection:u?"column":"row",gap:u?1:2,minWidth:u?200:void 0},children:e.map(v=>{let y=t===v.value;return jsxs("button",{type:"button",title:v.label,"data-testid":c$1?`${c$1}-${v.value}`:void 0,style:{display:"flex",alignItems:"center",height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:y?"var(--doc-primary)":"var(--doc-text)",...u?{width:"100%",gap:10,padding:"0 10px",justifyContent:"flex-start",fontSize:13,textAlign:"left"}:{width:32,justifyContent:"center"}},onMouseDown:C=>C.preventDefault(),onMouseEnter:C=>{y||(C.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:C=>{C.currentTarget.style.backgroundColor=y?"var(--doc-primary-light)":"transparent";},onClick:()=>g(v.value),children:[jsx(b,{name:v.iconName,size:18}),u&&jsx("span",{style:{flex:1},children:v.label})]},v.value)})})})]})}var zn=[{value:"inline",labelKey:"imageWrap.inline",iconName:"wrap_text"},{value:"wrapRight",labelKey:"imageWrap.floatLeft",iconName:"format_image_left"},{value:"wrapLeft",labelKey:"imageWrap.floatRight",iconName:"format_image_right"},{value:"behind",labelKey:"imageWrap.behindText",iconName:"flip_to_back"},{value:"inFront",labelKey:"imageWrap.inFrontOfText",iconName:"flip_to_front"}];function Kn(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function zo({imageContext:e,onChange:t,disabled:o=false}){let{t:r}=b$1(),n=zn.map(c=>({...c,label:r(c.labelKey)})),l=Kn(e),i=n.find(c=>c.value===l)||n[0];return jsx(yt,{options:n,activeValue:l,triggerIcon:i.iconName,tooltipContent:`Wrap: ${i.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap",showLabels:true})}var Wn=[{value:"rotateCW",labelKey:"imageTransform.rotateClockwise",iconName:"rotate_right"},{value:"rotateCCW",labelKey:"imageTransform.rotateCounterClockwise",iconName:"rotate_left"},{value:"flipH",labelKey:"imageTransform.flipHorizontal",iconName:"swap_horiz"},{value:"flipV",labelKey:"imageTransform.flipVertical",iconName:"swap_vert"}];function Ko({onTransform:e,disabled:t=false}){let{t:o}=b$1(),r=Wn.map(n=>({...n,label:o(n.labelKey)}));return jsx(yt,{options:r,triggerIcon:"rotate_right",tooltipContent:o("imageTransform.tooltip"),onSelect:e,disabled:t,testId:"toolbar-image-transform"})}var ot=createContext(null);function Ho(){let e=useContext(ot);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var se=18;function ce({active:e=false,disabled:t=false,title:o,onClick:r,children:n,className:l,ariaLabel:i}){let c=i?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^()]*\)/g,"").trim(),u=p=>{p.preventDefault();},a=jsx(K,{variant:"ghost",size:"icon-sm",className:M("ep-toolbar-toggle text-muted-foreground",t&&"opacity-30 cursor-not-allowed",l),"data-active":e?"true":void 0,onMouseDown:u,onClick:t?void 0:r,disabled:t,"aria-pressed":e,"aria-label":i||o,"data-testid":c?`toolbar-${c}`:void 0,children:n});return o?jsx(re,{content:o,children:a}):a}function fe({label:e,children:t,className:o}){return jsx("div",{className:M("flex items-center gap-px px-1.5 border-r border-border/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function Qs(){return jsx("div",{className:"w-px h-6 bg-border mx-1.5",role:"separator"})}function Yn(e){let t=J__default.useContext(ot);return t?{...t,...Xn(e)}:e}function Xn(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function Vo(e){let{t}=b$1(),o=Yn(e),{currentFormatting:r={},onFormat:n,onUndo:l,onRedo:i,canUndo:c=false,canRedo:u=false,disabled:a=false,className:p,style:b$2,enableShortcuts:d=true,editorRef:f,children:m,showFontPicker:s=true,fontFamilies:g,documentFonts:h,showFontSizePicker:v=true,showTextColorPicker:y=true,showHighlightColorPicker:C=true,showAlignmentButtons:L=true,showListButtons:P=true,showLineSpacingPicker:U=true,showStylePicker:F=true,documentStyles:we,theme:Z,showZoomControl:ge=true,zoom:q,onZoomChange:j,onRefocusEditor:S,imageContext:D,onImageWrapType:de,onImageTransform:he,onOpenImageProperties:Ne,tableContext:ve,onTableAction:Se,inline:Q=false}=o,Ue=useRef(null),z=useCallback(R=>{!a&&n&&n(R);},[a,n]),ae=useCallback(()=>{!a&&c&&l&&l();},[a,c,l]),Ze=useCallback(()=>{!a&&u&&i&&i();},[a,u,i]),T=useCallback(R=>{!a&&n&&(n({type:"fontFamily",value:R}),requestAnimationFrame(()=>S?.()));},[a,n,S]),V=J__default.useMemo(()=>normalizeFontFamilies(g),[g]),xe=useCallback(R=>{!a&&n&&(n({type:"fontSize",value:R}),requestAnimationFrame(()=>S?.()));},[a,n,S]),Pt=useCallback(R=>{!a&&n&&(n({type:"textColor",value:R}),requestAnimationFrame(()=>S?.()));},[a,n,S]),B=useCallback(R=>{!a&&n&&(n({type:"highlightColor",value:typeof R=="string"?R:""}),requestAnimationFrame(()=>S?.()));},[a,n,S]),ee=useCallback(R=>{!a&&n&&n({type:"alignment",value:R});},[a,n]),at=useCallback(()=>{!a&&n&&n("bulletList");},[a,n]),De=useCallback(()=>{!a&&n&&n("numberedList");},[a,n]),ue=useCallback(()=>{!a&&n&&n("indent");},[a,n]),te=useCallback(()=>{!a&&n&&n("outdent");},[a,n]),ie=useCallback(R=>{!a&&n&&(n({type:"lineSpacing",value:R}),requestAnimationFrame(()=>S?.()));},[a,n,S]),Be=useCallback(R=>{!a&&n&&(n({type:"applyStyle",value:R}),requestAnimationFrame(()=>S?.()));},[a,n,S]),Je=useCallback(R=>{!a&&Se&&(Se(R),requestAnimationFrame(()=>S?.()));},[a,Se,S]);useEffect(()=>{if(!d)return;let R=N=>{let Qe=N.target,qt=f?.current,ir=Ue.current,lr=qt?.contains(Qe),sr=ir?.contains(Qe);if(!lr&&!sr)return;if((N.ctrlKey||N.metaKey)&&!N.altKey)switch(N.key.toLowerCase()){case "b":N.preventDefault(),z("bold");break;case "i":N.preventDefault(),z("italic");break;case "u":N.preventDefault(),z("underline");break;case "=":N.shiftKey?(N.preventDefault(),z("superscript")):(N.preventDefault(),z("subscript"));break;case "l":N.preventDefault(),ee("left");break;case "e":N.preventDefault(),ee("center");break;case "r":N.preventDefault(),ee("right");break;case "j":N.preventDefault(),ee("both");break;case "k":N.preventDefault(),z("insertLink");break}};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R);}},[d,z,ee,f]);let nr=useCallback(R=>{let N=R.target;N.tagName==="INPUT"||N.tagName==="TEXTAREA"||N.tagName==="SELECT"||N.tagName==="OPTION"||R.preventDefault();},[]),ar=useCallback(R=>{let N=R.target,Qe=document.activeElement;N.tagName==="SELECT"||N.tagName==="OPTION"||Qe?.tagName==="SELECT"||requestAnimationFrame(()=>{S?.();});},[S]);return jsxs("div",{ref:Ue,className:M(!Q&&"flex items-center px-2 py-1 bg-muted rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",p),style:Q?{display:"contents",...b$2}:b$2,role:Q?void 0:"toolbar","aria-label":Q?void 0:t("toolbar.ariaLabel"),"data-testid":Q?void 0:"formatting-bar",onMouseDown:Q?void 0:nr,onMouseUp:Q?void 0:ar,children:[jsxs(fe,{label:t("formattingBar.groups.history"),children:[jsx(ce,{onClick:ae,disabled:a||!c,title:t("formattingBar.undoShortcut"),ariaLabel:t("formattingBar.undo"),children:jsx(b,{name:"undo",size:se})}),jsx(ce,{onClick:Ze,disabled:a||!u,title:t("formattingBar.redoShortcut"),ariaLabel:t("formattingBar.redo"),children:jsx(b,{name:"redo",size:se})})]}),ge&&jsx(fe,{label:t("formattingBar.groups.zoom"),children:jsx(ko,{value:q,onChange:j,disabled:a,compact:true})}),F&&jsx(fe,{label:t("formattingBar.groups.styles"),children:jsx(So,{value:r.styleId||"Normal",onChange:Be,styles:we,theme:Z,disabled:a,width:120})}),(s||v)&&jsxs(fe,{label:t("formattingBar.groups.font"),children:[s&&jsx(co,{value:r.fontFamily||"Arial",onChange:T,fonts:V,documentFonts:h,disabled:a,width:60,placeholder:"Arial"}),v&&jsx(oo,{value:r.fontSize!==void 0?halfPointsToPoints(r.fontSize):11,onChange:xe,disabled:a,width:42,placeholder:"11"})]}),jsxs(fe,{label:t("formattingBar.groups.textFormatting"),children:[jsx(ce,{onClick:()=>z("bold"),active:r.bold,disabled:a,title:t("formattingBar.boldShortcut"),ariaLabel:t("formattingBar.bold"),children:jsx(b,{name:"format_bold",size:se})}),jsx(ce,{onClick:()=>z("italic"),active:r.italic,disabled:a,title:t("formattingBar.italicShortcut"),ariaLabel:t("formattingBar.italic"),children:jsx(b,{name:"format_italic",size:se})}),jsx(ce,{onClick:()=>z("underline"),active:r.underline,disabled:a,title:t("formattingBar.underlineShortcut"),ariaLabel:t("formattingBar.underline"),children:jsx(b,{name:"format_underlined",size:se})}),jsx(ce,{onClick:()=>z("strikethrough"),active:r.strike,disabled:a,title:t("formattingBar.strikethrough"),ariaLabel:t("formattingBar.strikethrough"),children:jsx(b,{name:"strikethrough_s",size:se})}),y&&jsx(Ke,{mode:"text",value:r.color?.replace(/^#/,""),onChange:Pt,theme:Z,disabled:a,title:t("formattingBar.fontColor")}),C&&jsx(Ke,{mode:"highlight",value:r.highlight,onChange:B,theme:Z,disabled:a,title:t("formattingBar.highlightColor")}),jsx(ce,{onClick:()=>z("insertLink"),disabled:a,title:t("formattingBar.insertLinkShortcut"),ariaLabel:t("formattingBar.insertLink"),children:jsx(b,{name:"link",size:se})})]}),jsxs(fe,{label:t("formattingBar.groups.script"),children:[jsx(ce,{onClick:()=>z("superscript"),active:r.superscript,disabled:a,title:t("formattingBar.superscriptShortcut"),ariaLabel:t("formattingBar.superscript"),children:jsx(b,{name:"superscript",size:se})}),jsx(ce,{onClick:()=>z("subscript"),active:r.subscript,disabled:a,title:t("formattingBar.subscriptShortcut"),ariaLabel:t("formattingBar.subscript"),children:jsx(b,{name:"subscript",size:se})})]}),L&&jsx(fe,{label:t("formattingBar.groups.alignment"),children:jsx(xo,{value:r.alignment||"left",onChange:ee,disabled:a})}),(P||U)&&jsxs(fe,{label:t("formattingBar.groups.listFormatting"),children:[P&&jsx(ao,{listState:r.listState||createDefaultListState(),onBulletList:at,onNumberedList:De,onIndent:ue,onOutdent:te,disabled:a,showIndentButtons:true,compact:true,hasIndent:(r.indentLeft??0)>0}),U&&jsx(Co,{value:r.lineSpacing,onChange:ie,disabled:a})]}),D&&de&&jsxs(fe,{label:t("formattingBar.groups.image"),children:[jsx(zo,{imageContext:D,onChange:de,disabled:a}),he&&jsx(Ko,{onTransform:he,disabled:a}),Ne&&jsx(ce,{onClick:Ne,disabled:a,title:t("formattingBar.imagePropertiesShortcut"),ariaLabel:t("formattingBar.imageProperties"),children:jsx(b,{name:"tune",size:se})})]}),ve?.isInTable&&Se&&jsxs(fe,{label:t("formattingBar.groups.table"),children:[jsx(Io,{onAction:Je,disabled:a}),jsx(Lo,{onAction:Je,disabled:a,theme:Z,value:resolveColorToHex(ve?.cellBorderColor,Z)}),jsx(Eo,{onAction:Je,disabled:a}),jsx(Ao,{onAction:Je,disabled:a,theme:Z,value:ve?.cellBackgroundColor}),jsx(_o,{onAction:Je,disabled:a,tableContext:ve})]}),jsx(ce,{onClick:()=>z("clearFormatting"),disabled:a,title:t("formattingBar.clearFormatting"),ariaLabel:t("formattingBar.clearFormatting"),children:jsx(b,{name:"format_clear",size:se})}),m]})}function Jn(e){return "type"in e&&e.type==="separator"}var Uo={display:"flex",alignItems:"center",gap:2,padding:"2px 8px",border:"none",background:"transparent",borderRadius:4,cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--doc-text)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},Qn={...Uo,background:"var(--doc-bg-hover)"},Zo={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},ea={...Zo,opacity:.4,cursor:"default"},ta={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},oa={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted)"},ra={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:6,boxShadow:"0 4px 12px var(--doc-shadow)",padding:8,zIndex:1001};function rt({label:e,items:t,disabled:o,showChevron:r=false}){let[n,l]=useState(false),[i,c]=useState(null),u=useRef(null),a=useRef(null),[p,b$1]=useState({top:0,left:0}),d=useCallback(()=>{l(false),c(null);},[]);useEffect(()=>{if(!n||!u.current)return;let m=u.current.getBoundingClientRect();b$1({top:m.bottom+2,left:m.left});},[n]),useEffect(()=>{if(!n)return;function m(h){let v=h.target;u.current&&!u.current.contains(v)&&a.current&&!a.current.contains(v)&&d();}function s(h){h.key==="Escape"&&d();}function g(){d();}return document.addEventListener("mousedown",m),document.addEventListener("keydown",s),window.addEventListener("scroll",g,true),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",s),window.removeEventListener("scroll",g,true);}},[n,d]);let f=m=>{m.disabled||m.submenuContent||m.onClick&&(m.onClick(),d());};return jsxs("div",{style:{position:"relative"},children:[jsxs("button",{ref:u,type:"button",onClick:()=>!o&&l(!n),onMouseDown:m=>m.preventDefault(),disabled:o,style:n?Qn:Uo,children:[e,r&&jsx(b,{name:"arrow_drop_down",size:16})]}),n&&jsx("div",{ref:a,style:{position:"fixed",top:p.top,left:p.left,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:6,boxShadow:"0 4px 12px var(--doc-shadow)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:m=>m.preventDefault(),children:t.map((m,s)=>{if(Jn(m))return jsx("div",{style:ta},`sep-${s}`);let g=m;if(g.customContent)return jsx("div",{onMouseDown:y=>y.preventDefault(),children:g.customContent},g.label);let h=!!g.submenuContent,v=i===g.label;return jsxs("div",{style:{position:"relative"},onMouseEnter:()=>h&&c(g.label),onMouseLeave:()=>h&&c(null),children:[jsxs("button",{type:"button",style:g.disabled?ea:Zo,onClick:()=>f(g),onMouseDown:y=>y.preventDefault(),onMouseOver:y=>{g.disabled||(y.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseOut:y=>{y.currentTarget.style.backgroundColor="transparent";},disabled:g.disabled,children:[g.icon&&jsx(b,{name:g.icon,size:18}),jsx("span",{children:g.label}),g.shortcut&&jsx("span",{style:oa,children:g.shortcut}),h&&jsx("span",{style:{marginLeft:"auto"},children:jsx(b,{name:"keyboard_arrow_right",size:16})})]}),h&&v&&jsx("div",{style:ra,onMouseDown:y=>y.preventDefault(),children:g.submenuContent(d)})]},g.label)})})]})}var zt=18,aa=2,Yo={width:zt,height:zt,backgroundColor:"var(--doc-surface)",border:"1px solid var(--doc-border)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},ia={...Yo,backgroundColor:"var(--doc-primary)",border:"1px solid var(--doc-primary)"},la={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text)",textAlign:"center"};function Xo({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[r,n]=useState(0),[l,i]=useState(0),c=useCallback(()=>{r>0&&l>0&&e(r,l);},[r,l,e]),u=[];for(let p=1;p<=t;p++)for(let b=1;b<=o;b++){let d=p<=r&&b<=l;u.push(jsx("div",{style:d?ia:Yo,onMouseEnter:()=>{n(p),i(b);},onClick:c,role:"gridcell","aria-selected":d},`${p}-${b}`));}let a=r>0&&l>0?`${l} \xD7 ${r}`:"Select size";return jsxs("div",{children:[jsx("div",{style:{display:"grid",gap:aa,gridTemplateColumns:`repeat(${o}, ${zt}px)`},onMouseLeave:()=>{n(0),i(0);},role:"grid","aria-label":"Table size selector",children:u}),jsx("div",{style:la,children:a})]})}function ua({items:e,closeMenu:t}){return jsx("div",{style:{display:"flex",flexDirection:"column",minWidth:220},children:e.map(o=>{let r=!o.onClick;return jsxs("button",{type:"button",disabled:r,style:{display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:r?"default":"pointer",fontSize:13,color:"var(--doc-text)",width:"100%",textAlign:"left",whiteSpace:"nowrap",opacity:r?.4:1},onMouseDown:n=>n.preventDefault(),onClick:()=>{r||(o.onClick?.(),t());},onMouseOver:n=>{r||(n.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseOut:n=>{n.currentTarget.style.backgroundColor="transparent";},children:[jsx(b,{name:o.icon,size:18}),jsx("span",{children:o.label})]},o.label)})})}function pa(){return jsxs("svg",{width:"32",height:"40",viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M2 0C0.9 0 0 0.9 0 2V38C0 39.1 0.9 40 2 40H30C31.1 40 32 39.1 32 38V10L22 0H2Z",fill:"#cbd5e1"}),jsx("path",{d:"M22 0L32 10H24C22.9 10 22 9.1 22 8V0Z",fill:"#94a3b8"}),jsx("rect",{x:"7",y:"18",width:"18",height:"2",rx:"1",fill:"#fff"}),jsx("rect",{x:"7",y:"23",width:"18",height:"2",rx:"1",fill:"#fff"}),jsx("rect",{x:"7",y:"28",width:"12",height:"2",rx:"1",fill:"#fff"})]})}function Ht({children:e}){return jsx("div",{className:"flex items-center flex-shrink-0",children:e})}function ma(e){return e.replace(/\.docx$/i,"")}function Jo({value:e,onChange:t,placeholder:o,editable:r=true}){let{t:n}=b$1(),l=o??n("titleBar.untitled"),i=ma(e)??"";return r?jsx("input",{type:"text",value:i,onChange:c=>{let u=c.target.value;t?.(u.endsWith(".docx")?u:u+".docx");},placeholder:l,className:"text-base font-normal text-foreground bg-transparent border-0 outline-none px-2 py-0 rounded hover:bg-muted focus:bg-doc-bg-input focus:ring-1 focus:ring-ring min-w-[100px] max-w-[300px] truncate leading-tight","aria-label":n("titleBar.documentNameAriaLabel")}):jsx("span",{className:"text-base font-normal text-foreground px-2 py-0 min-w-[100px] max-w-[300px] truncate leading-tight",children:i||l})}function Wt({children:e}){return jsx("div",{className:"flex items-center gap-2 ml-auto flex-shrink-0",children:e})}function Vt(){let{t:e}=b$1(),t=Ho(),{disabled:o=false,onFormat:r,onPrint:n,onOpen:l,onSave:i,onPageSetup:c,onInsertImage:u,onInsertTable:a,showTableInsert:p=true,showHelpMenu:b=true,onInsertPageBreak:d,onInsertSectionBreakNextPage:f,onInsertSectionBreakContinuous:m,onInsertTOC:s,onWatermark:g,onRefocusEditor:h}=t,v=useCallback(P=>{!o&&r&&r(P);},[o,r]),y=useCallback((P,U)=>{!o&&a&&(a(P,U),requestAnimationFrame(()=>h?.()));},[o,a,h]),C=!!n||!!c,L=C||l||i;return jsxs("div",{className:"flex items-center",role:"menubar","aria-label":e("titleBar.menuBarAriaLabel"),children:[L&&jsx(rt,{label:e("toolbar.file"),disabled:o,items:[...l?[{icon:"file_upload",label:e("toolbar.open"),shortcut:e("toolbar.openShortcut"),onClick:l}]:[],...i?[{icon:"file_download",label:e("toolbar.save"),shortcut:e("toolbar.saveShortcut"),onClick:i}]:[],...(l||i)&&C?[{type:"separator"}]:[],...n?[{icon:"print",label:e("toolbar.print"),shortcut:e("toolbar.printShortcut"),onClick:n}]:[],...c?[{icon:"settings",label:e("toolbar.pageSetup"),onClick:c}]:[]]}),jsx(rt,{label:e("toolbar.format"),disabled:o,items:[{icon:"format_textdirection_l_to_r",label:e("toolbar.leftToRight"),onClick:()=>v("setLtr")},{icon:"format_textdirection_r_to_l",label:e("toolbar.rightToLeft"),onClick:()=>v("setRtl")}]}),jsx(rt,{label:e("toolbar.insert"),disabled:o,items:[...u?[{icon:"image",label:e("toolbar.image"),onClick:u}]:[],...p&&a?[{icon:"grid_on",label:e("toolbar.table"),submenuContent:P=>jsx(Xo,{onInsert:(U,F)=>{y(U,F),P();}})}]:[],...u||p&&a?[{type:"separator"}]:[],{icon:"page_break",label:e("toolbar.break"),submenuContent:P=>jsx(ua,{closeMenu:P,items:[{icon:"page_break",label:e("toolbar.pageBreak"),onClick:d},{icon:"horizontal_rule",label:e("toolbar.sectionBreakNextPage"),onClick:f},{icon:"border_horizontal",label:e("toolbar.sectionBreakContinuous"),onClick:m}]})},{icon:"format_list_numbered",label:e("toolbar.tableOfContents"),onClick:s,disabled:!s},...g?[{icon:"branding_watermark",label:e("toolbar.watermark"),onClick:g}]:[]]}),b&&jsx(rt,{label:e("toolbar.help"),disabled:o,items:[{label:e("toolbar.reportIssue"),onClick:()=>openReportIssue()}]})]})}function Qo({children:e}){let t=null,o=null,r=[],n=[];Children.forEach(e,i=>{isValidElement(i)&&(i.type===Ht?t=i:i.type===Wt?o=i:i.type===Vt?n.push(i):r.push(i));});let l=useCallback(i=>{let c=i.target;c.tagName==="INPUT"||c.tagName==="TEXTAREA"||c.tagName==="SELECT"||c.tagName==="OPTION"||i.preventDefault();},[]);return jsxs("div",{className:"flex items-stretch bg-doc-surface pt-2 pb-1",onMouseDown:l,"data-testid":"title-bar",children:[jsx("div",{className:"flex items-center flex-shrink-0 pl-3 pr-1",children:t||jsx(pa,{})}),jsxs("div",{className:"flex flex-col justify-center flex-1 min-w-0 py-1",children:[r.length>0&&jsx("div",{className:"flex items-center gap-2 px-1",children:r}),n.length>0&&jsx("div",{className:"flex items-center px-1",children:n})]}),o&&jsx("div",{className:"flex items-center flex-shrink-0 px-3",children:o})]})}function fa({children:e,className:t,style:o,...r}){return jsx(ot.Provider,{value:r,children:jsx("div",{className:M("flex flex-col bg-doc-surface shadow-sm flex-shrink-0",t),style:{position:"relative",zIndex:dt.toolbar,...o},"data-testid":"editor-toolbar",children:e})})}var je=fa;je.TitleBar=Qo;je.Logo=Ht;je.DocumentName=Jo;je.MenuBar=Vt;je.TitleBarRight=Wt;je.Toolbar=Vo;var or=12240,St=1440,Tt=1440,kt=567,Gt=22,ha="var(--doc-text-muted)",va="var(--doc-text-subtle)",tr="var(--doc-shadow-subtle)",xa="var(--doc-primary)",ya="var(--doc-primary-hover)",Ca="var(--doc-primary-hover)",Ge=5;function wa(e,t){return t==="inch"?(e/Tt).toFixed(2)+'"':(e/kt).toFixed(1)+" cm"}function Nc({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:r,onRightMarginChange:n,onFirstLineIndentChange:l,showFirstLineIndent:i=false,firstLineIndent:c=0,hangingIndent:u=false,indentLeft:a=0,indentRight:p=0,onIndentLeftChange:b,onIndentRightChange:d,unit:f="inch",className:m="",style:s,tabStops:g,onTabStopRemove:h}){let{t:v}=b$1(),[y,C]=useState(null),[L,P]=useState(null),[U,F]=useState(null),[we,Z]=useState(null),ge=useRef(null),q=e?.pageWidth??or,j=e?.marginLeft??St,S=e?.marginRight??St,D=q-j-S,de=twipsToPixels(q)*t,he=twipsToPixels(j)*t,Ne=twipsToPixels(S)*t,ve=twipsToPixels(a)*t,Se=twipsToPixels(p)*t,Q=u?-c:c,Ue=twipsToPixels(Q)*t,z=he+ve,ae=de-Ne-Se,Ze=he+ve+Ue,T=useCallback((B,ee)=>{o&&(B.preventDefault(),B.stopPropagation(),C(ee));},[o]),V=useCallback(B=>{if(!y||!ge.current)return;let ee=ge.current.getBoundingClientRect(),at=B.clientX-ee.left;Z(at);let De=pixelsToTwips(at/t);if(y==="leftMargin"){let ue=q-S-720,te=Math.round(Math.max(0,Math.min(De,ue)));F(te),r?.(te);}else if(y==="rightMargin"){let ue=q-De,te=q-j-720,ie=Math.round(Math.max(0,Math.min(ue,te)));F(ie),n?.(ie);}else if(y==="firstLineIndent"){let ue=j+a,te=De-ue,ie=D-a-p-720,Be=Math.round(Math.max(-a,Math.min(te,ie)));F(Be),l?.(Be);}else if(y==="leftIndent"){let ue=De-j,te=D-p-720,ie=Math.round(Math.max(0,Math.min(ue,te)));F(ie),b?.(ie);}else if(y==="rightIndent"){let te=q-S-De,ie=D-a-720,Be=Math.round(Math.max(0,Math.min(te,ie)));F(Be),d?.(Be);}},[y,t,q,j,S,D,a,p,r,n,l,b,d]),xe=useCallback(()=>{C(null),F(null),Z(null);},[]);useEffect(()=>{if(y)return document.addEventListener("mousemove",V),document.addEventListener("mouseup",xe),()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",xe);}},[y,V,xe]);let Pt=Ma(q,t,f);return jsxs("div",{ref:ge,className:`docx-horizontal-ruler ${m}`,style:{position:"relative",width:formatPx(de),height:Gt,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:y?"ew-resize":"default",...s},role:"slider","aria-label":v("ruler.horizontal"),"aria-valuemin":0,"aria-valuemax":q,children:[jsx("div",{style:{position:"absolute",top:0,left:0,width:formatPx(he),height:Gt,backgroundColor:tr,borderRight:"1px solid var(--doc-shadow-subtle)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?B=>T(B,"leftMargin"):void 0}),jsx("div",{style:{position:"absolute",top:0,right:0,width:formatPx(Ne),height:Gt,backgroundColor:tr,borderLeft:"1px solid var(--doc-shadow-subtle)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?B=>T(B,"rightMargin"):void 0}),jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:Pt.map((B,ee)=>jsx(Sa,{tick:B},ee))}),i&&jsx(Ut,{direction:"down",positionPx:Ze,editable:o,isDragging:y==="firstLineIndent",isHovered:L==="firstLineIndent",onMouseEnter:()=>P("firstLineIndent"),onMouseLeave:()=>P(null),onMouseDown:B=>T(B,"firstLineIndent"),label:v("ruler.firstLineIndent")}),o&&b&&jsx(Ut,{direction:"up",positionPx:z,editable:o,isDragging:y==="leftIndent",isHovered:L==="leftIndent",onMouseEnter:()=>P("leftIndent"),onMouseLeave:()=>P(null),onMouseDown:B=>T(B,"leftIndent"),label:v("ruler.leftIndent")}),o&&d&&jsx(Ut,{direction:"down",positionPx:ae,editable:o,isDragging:y==="rightIndent",isHovered:L==="rightIndent",onMouseEnter:()=>P("rightIndent"),onMouseLeave:()=>P(null),onMouseDown:B=>T(B,"rightIndent"),label:v("ruler.rightIndent")}),g?.map(B=>jsx(Pa,{tabStop:B,positionPx:twipsToPixels(B.position)*t,onDoubleClick:()=>h?.(B.position)},B.position)),y&&U!==null&&we!==null&&jsx(Ta,{value:wa(U,f),positionPx:we})]})}function Sa({tick:e}){return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",left:formatPx(e.position),bottom:0,width:1,height:e.height,backgroundColor:va}}),e.label&&jsx("div",{style:{position:"absolute",left:formatPx(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:ha,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Ut({direction:e,positionPx:t,editable:o,isDragging:r,isHovered:n,onMouseEnter:l,onMouseLeave:i,onMouseDown:c,label:u}){let a=r?Ca:n?ya:xa,p=Math.round(Ge*1.6),b={position:"absolute",left:formatPx(t-Ge),width:Ge*2,height:p+2,cursor:o?"ew-resize":"default",zIndex:r?10:4,...e==="down"?{top:0}:{bottom:0}},d=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${Ge}px solid transparent`,borderRight:`${Ge}px solid transparent`,borderTop:`${p}px solid ${a}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${Ge}px solid transparent`,borderRight:`${Ge}px solid transparent`,borderBottom:`${p}px solid ${a}`,transition:"border-bottom-color 0.1s"};return jsx("div",{className:"docx-ruler-indent",style:b,onMouseEnter:l,onMouseLeave:i,onMouseDown:c,role:"slider","aria-label":u,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsx("div",{style:d})})}function Ta({value:e,positionPx:t}){return jsx("div",{style:{position:"absolute",left:formatPx(t),top:-22,transform:"translateX(-50%)",backgroundColor:"var(--doc-text)",color:"var(--doc-on-primary)",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var ka={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function Pa({tabStop:e,positionPx:t,onDoubleClick:o}){return jsx("div",{style:{position:"absolute",left:formatPx(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"var(--doc-text-muted)",cursor:"pointer",userSelect:"none"},onDoubleClick:r=>{r.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:ka[e.alignment]||"L"})}function Ma(e,t,o){let r=[];if(o==="inch"){let n=Tt/8,l=Math.ceil(e/n);for(let i=0;i<=l;i++){let c=i*n;if(c>e)break;let u=twipsToPixels(c)*t;i%8===0?r.push({position:u,height:10,label:i/8>0?String(i/8):void 0}):i%4===0?r.push({position:u,height:6}):i%2===0?r.push({position:u,height:4}):r.push({position:u,height:2});}}else {let n=kt/10,l=Math.ceil(e/n);for(let i=0;i<=l;i++){let c=i*n;if(c>e)break;let u=twipsToPixels(c)*t;i%10===0?r.push({position:u,height:10,label:i/10>0?String(i/10):void 0}):i%5===0?r.push({position:u,height:6}):r.push({position:u,height:3});}}return r}function Dc(e,t,o,r){let n=pixelsToTwips(e/r);return t==="left"?Math.max(0,n):Math.max(0,pixelsToTwips(o/r)-n)}function Bc(e,t=1){let o=e?.pageWidth??or,r=e?.marginLeft??St,n=e?.marginRight??St,l=twipsToPixels(o)*t,i=twipsToPixels(r)*t,c=twipsToPixels(n)*t;return {width:l,leftMargin:i,rightMargin:c,contentWidth:l-i-c}}function _c(e,t){return t==="inch"?(e/Tt).toFixed(2)+'"':(e/kt).toFixed(1)+" cm"}function Fc(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?Tt:kt))}
2
+ export{ce as A,fe as B,Qs as C,Vo as D,je as E,Nc as F,Dc as G,Bc as H,_c as I,Fc as J,M as a,K as b,oo as c,ao as e,dt as h,bi as i,gi as j,hi as k,vi as l,xi as m,yi as n,re as o,co as p,Ke as q,xo as r,Co as s,So as t,ko as u,Io as v,Lo as w,Eo as x,Ao as y,_o as z};
@@ -0,0 +1 @@
1
+ import {createContext,useMemo,useContext}from'react';import {en,deepMerge,createT}from'@heyirisai/docx-editor-i18n';import {jsx}from'react/jsx-runtime';var s=createContext(en),l=createContext("en");function u({i18n:e,children:o}){let r=typeof e?._lang=="string"?e._lang:"en",d=useMemo(()=>deepMerge(en,e),[e]);return jsx(l.Provider,{value:r,children:jsx(s.Provider,{value:d,children:o})})}function L(){let e=useContext(s),o=useContext(l);return {t:useMemo(()=>createT(e,o),[e,o])}}export{u as a,L as b};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @heyirisai/docx-editor-react/dialogs
3
+ *
4
+ * Modal dialogs for hyperlinks, find/replace, paste-special, page setup,
5
+ * and keyboard shortcuts. Pair with the hooks under
6
+ * `@heyirisai/docx-editor-react/hooks` when wiring custom UI.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { HyperlinkDialog, FindReplaceDialog } from '@heyirisai/docx-editor-react/dialogs';
11
+ * ```
12
+ *
13
+ * @packageDocumentation
14
+ * @public
15
+ */
16
+ export { B as BookmarkOption, F as FindReplaceDialog, a as FindReplaceDialogProps, H as HyperlinkData, b as HyperlinkDialog, c as HyperlinkDialogProps, K as KeyboardShortcut, d as KeyboardShortcutsDialog, e as KeyboardShortcutsDialogProps, P as PasteOption, f as PasteSpecialDialog, g as PasteSpecialDialogProps, S as ShortcutCategory, U as UseKeyboardShortcutsDialogOptions, h as UseKeyboardShortcutsDialogReturn, i as UsePasteSpecialOptions, j as UsePasteSpecialReturn, x as createBookmarkLinkData, y as createHyperlinkData, z as emailToMailto, A as extractBookmarksForDialog, k as formatShortcutKeys, l as getAllCategories, m as getAllPasteOptions, n as getCategoryLabel, o as getCommonShortcuts, p as getDefaultPasteOption, q as getDefaultShortcuts, C as getDisplayText, r as getPasteOption, s as getShortcutsByCategory, D as getUrlType, E as isBookmarkHyperlinkData, G as isExternalHyperlinkData, t as isPasteSpecialShortcut, I as isValidUrl, J as normalizeUrl, L as phoneToTel, v as useKeyboardShortcutsDialog, w as usePasteSpecial } from './KeyboardShortcutsDialog-B-h3NAat.mjs';
17
+ import React__default from 'react';
18
+ import { SectionProperties } from '@heyirisai/docx-editor-core/types/document';
19
+ export { FindMatch, FindOptions, FindResult, HighlightOptions, createDefaultFindOptions, createSearchPattern, escapeRegexString, findAllMatches, getDefaultHighlightOptions, getMatchCountText, isEmptySearch, replaceAllInContent, replaceFirstInContent } from '@heyirisai/docx-editor-core/utils/findReplace';
20
+ import '@heyirisai/docx-editor-core/utils';
21
+ import '@heyirisai/docx-editor-i18n';
22
+
23
+ /**
24
+ * Page Setup Dialog
25
+ *
26
+ * Modal for editing page layout properties:
27
+ * - Page size (Letter, A4, Legal, etc.)
28
+ * - Orientation (portrait/landscape)
29
+ * - Margins (top, bottom, left, right) in inches
30
+ */
31
+
32
+ interface PageSetupDialogProps {
33
+ isOpen: boolean;
34
+ onClose: () => void;
35
+ onApply: (props: Partial<SectionProperties>) => void;
36
+ currentProps?: SectionProperties;
37
+ }
38
+ declare function PageSetupDialog({ isOpen, onClose, onApply, currentProps, }: PageSetupDialogProps): React__default.ReactElement | null;
39
+
40
+ export { PageSetupDialog, type PageSetupDialogProps };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @heyirisai/docx-editor-react/dialogs
3
+ *
4
+ * Modal dialogs for hyperlinks, find/replace, paste-special, page setup,
5
+ * and keyboard shortcuts. Pair with the hooks under
6
+ * `@heyirisai/docx-editor-react/hooks` when wiring custom UI.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { HyperlinkDialog, FindReplaceDialog } from '@heyirisai/docx-editor-react/dialogs';
11
+ * ```
12
+ *
13
+ * @packageDocumentation
14
+ * @public
15
+ */
16
+ export { B as BookmarkOption, F as FindReplaceDialog, a as FindReplaceDialogProps, H as HyperlinkData, b as HyperlinkDialog, c as HyperlinkDialogProps, K as KeyboardShortcut, d as KeyboardShortcutsDialog, e as KeyboardShortcutsDialogProps, P as PasteOption, f as PasteSpecialDialog, g as PasteSpecialDialogProps, S as ShortcutCategory, U as UseKeyboardShortcutsDialogOptions, h as UseKeyboardShortcutsDialogReturn, i as UsePasteSpecialOptions, j as UsePasteSpecialReturn, x as createBookmarkLinkData, y as createHyperlinkData, z as emailToMailto, A as extractBookmarksForDialog, k as formatShortcutKeys, l as getAllCategories, m as getAllPasteOptions, n as getCategoryLabel, o as getCommonShortcuts, p as getDefaultPasteOption, q as getDefaultShortcuts, C as getDisplayText, r as getPasteOption, s as getShortcutsByCategory, D as getUrlType, E as isBookmarkHyperlinkData, G as isExternalHyperlinkData, t as isPasteSpecialShortcut, I as isValidUrl, J as normalizeUrl, L as phoneToTel, v as useKeyboardShortcutsDialog, w as usePasteSpecial } from './KeyboardShortcutsDialog-B-h3NAat.js';
17
+ import React__default from 'react';
18
+ import { SectionProperties } from '@heyirisai/docx-editor-core/types/document';
19
+ export { FindMatch, FindOptions, FindResult, HighlightOptions, createDefaultFindOptions, createSearchPattern, escapeRegexString, findAllMatches, getDefaultHighlightOptions, getMatchCountText, isEmptySearch, replaceAllInContent, replaceFirstInContent } from '@heyirisai/docx-editor-core/utils/findReplace';
20
+ import '@heyirisai/docx-editor-core/utils';
21
+ import '@heyirisai/docx-editor-i18n';
22
+
23
+ /**
24
+ * Page Setup Dialog
25
+ *
26
+ * Modal for editing page layout properties:
27
+ * - Page size (Letter, A4, Legal, etc.)
28
+ * - Orientation (portrait/landscape)
29
+ * - Margins (top, bottom, left, right) in inches
30
+ */
31
+
32
+ interface PageSetupDialogProps {
33
+ isOpen: boolean;
34
+ onClose: () => void;
35
+ onApply: (props: Partial<SectionProperties>) => void;
36
+ currentProps?: SectionProperties;
37
+ }
38
+ declare function PageSetupDialog({ isOpen, onClose, onApply, currentProps, }: PageSetupDialogProps): React__default.ReactElement | null;
39
+
40
+ export { PageSetupDialog, type PageSetupDialogProps };
@@ -0,0 +1 @@
1
+ 'use strict';var chunkYY52FSUR_js=require('./chunk-YY52FSUR.js'),chunk74OM4KEH_js=require('./chunk-74OM4KEH.js'),chunkPSBO3UDN_js=require('./chunk-PSBO3UDN.js'),chunkGWXEFL3H_js=require('./chunk-GWXEFL3H.js'),chunkL4MDZW2J_js=require('./chunk-L4MDZW2J.js'),chunkQD7BVJV3_js=require('./chunk-QD7BVJV3.js');require('./chunk-GNIO6SOS.js'),require('./chunk-BJ5RZW6Y.js');var export_createDefaultFindOptions=chunkL4MDZW2J_js.a.createDefaultFindOptions;var export_createSearchPattern=chunkL4MDZW2J_js.a.createSearchPattern;var export_escapeRegexString=chunkL4MDZW2J_js.a.escapeRegexString;var export_findAllMatches=chunkL4MDZW2J_js.a.findAllMatches;var export_getDefaultHighlightOptions=chunkL4MDZW2J_js.a.getDefaultHighlightOptions;var export_getMatchCountText=chunkL4MDZW2J_js.a.getMatchCountText;var export_isEmptySearch=chunkL4MDZW2J_js.a.isEmptySearch;var export_replaceAllInContent=chunkL4MDZW2J_js.a.replaceAllInContent;var export_replaceFirstInContent=chunkL4MDZW2J_js.a.replaceFirstInContent;Object.defineProperty(exports,"PageSetupDialog",{enumerable:true,get:function(){return chunkYY52FSUR_js.a}});Object.defineProperty(exports,"KeyboardShortcutsDialog",{enumerable:true,get:function(){return chunk74OM4KEH_js.l}});Object.defineProperty(exports,"PasteSpecialDialog",{enumerable:true,get:function(){return chunk74OM4KEH_js.a}});Object.defineProperty(exports,"getAllCategories",{enumerable:true,get:function(){return chunk74OM4KEH_js.k}});Object.defineProperty(exports,"getAllPasteOptions",{enumerable:true,get:function(){return chunk74OM4KEH_js.d}});Object.defineProperty(exports,"getCategoryLabel",{enumerable:true,get:function(){return chunk74OM4KEH_js.j}});Object.defineProperty(exports,"getCommonShortcuts",{enumerable:true,get:function(){return chunk74OM4KEH_js.i}});Object.defineProperty(exports,"getDefaultPasteOption",{enumerable:true,get:function(){return chunk74OM4KEH_js.e}});Object.defineProperty(exports,"getDefaultShortcuts",{enumerable:true,get:function(){return chunk74OM4KEH_js.g}});Object.defineProperty(exports,"getPasteOption",{enumerable:true,get:function(){return chunk74OM4KEH_js.c}});Object.defineProperty(exports,"getShortcutsByCategory",{enumerable:true,get:function(){return chunk74OM4KEH_js.h}});Object.defineProperty(exports,"isPasteSpecialShortcut",{enumerable:true,get:function(){return chunk74OM4KEH_js.f}});Object.defineProperty(exports,"useKeyboardShortcutsDialog",{enumerable:true,get:function(){return chunk74OM4KEH_js.m}});Object.defineProperty(exports,"usePasteSpecial",{enumerable:true,get:function(){return chunk74OM4KEH_js.b}});Object.defineProperty(exports,"formatShortcutKeys",{enumerable:true,get:function(){return chunkPSBO3UDN_js.a}});Object.defineProperty(exports,"FindReplaceDialog",{enumerable:true,get:function(){return chunkGWXEFL3H_js.a}});Object.defineProperty(exports,"HyperlinkDialog",{enumerable:true,get:function(){return chunkQD7BVJV3_js.d}});Object.defineProperty(exports,"createBookmarkLinkData",{enumerable:true,get:function(){return chunkQD7BVJV3_js.f}});Object.defineProperty(exports,"createHyperlinkData",{enumerable:true,get:function(){return chunkQD7BVJV3_js.e}});Object.defineProperty(exports,"emailToMailto",{enumerable:true,get:function(){return chunkQD7BVJV3_js.j}});Object.defineProperty(exports,"extractBookmarksForDialog",{enumerable:true,get:function(){return chunkQD7BVJV3_js.l}});Object.defineProperty(exports,"getDisplayText",{enumerable:true,get:function(){return chunkQD7BVJV3_js.i}});Object.defineProperty(exports,"getUrlType",{enumerable:true,get:function(){return chunkQD7BVJV3_js.c}});Object.defineProperty(exports,"isBookmarkHyperlinkData",{enumerable:true,get:function(){return chunkQD7BVJV3_js.h}});Object.defineProperty(exports,"isExternalHyperlinkData",{enumerable:true,get:function(){return chunkQD7BVJV3_js.g}});Object.defineProperty(exports,"isValidUrl",{enumerable:true,get:function(){return chunkQD7BVJV3_js.a}});Object.defineProperty(exports,"normalizeUrl",{enumerable:true,get:function(){return chunkQD7BVJV3_js.b}});Object.defineProperty(exports,"phoneToTel",{enumerable:true,get:function(){return chunkQD7BVJV3_js.k}});exports.createDefaultFindOptions=export_createDefaultFindOptions;exports.createSearchPattern=export_createSearchPattern;exports.escapeRegexString=export_escapeRegexString;exports.findAllMatches=export_findAllMatches;exports.getDefaultHighlightOptions=export_getDefaultHighlightOptions;exports.getMatchCountText=export_getMatchCountText;exports.isEmptySearch=export_isEmptySearch;exports.replaceAllInContent=export_replaceAllInContent;exports.replaceFirstInContent=export_replaceFirstInContent;
@@ -0,0 +1 @@
1
+ export{a as PageSetupDialog}from'./chunk-P5ZOUQIK.mjs';export{l as KeyboardShortcutsDialog,a as PasteSpecialDialog,k as getAllCategories,d as getAllPasteOptions,j as getCategoryLabel,i as getCommonShortcuts,e as getDefaultPasteOption,g as getDefaultShortcuts,c as getPasteOption,h as getShortcutsByCategory,f as isPasteSpecialShortcut,m as useKeyboardShortcutsDialog,b as usePasteSpecial}from'./chunk-4Y4JFAPY.mjs';export{a as formatShortcutKeys}from'./chunk-O6M2HAIZ.mjs';export{a as FindReplaceDialog}from'./chunk-OCA7BO3G.mjs';import {a}from'./chunk-OHNO4NRQ.mjs';export{d as HyperlinkDialog,f as createBookmarkLinkData,e as createHyperlinkData,j as emailToMailto,l as extractBookmarksForDialog,i as getDisplayText,c as getUrlType,h as isBookmarkHyperlinkData,g as isExternalHyperlinkData,a as isValidUrl,b as normalizeUrl,k as phoneToTel}from'./chunk-J72K2BOS.mjs';import'./chunk-ZFZJRL2R.mjs';import'./chunk-BMBP5UFA.mjs';var export_createDefaultFindOptions=a.createDefaultFindOptions;var export_createSearchPattern=a.createSearchPattern;var export_escapeRegexString=a.escapeRegexString;var export_findAllMatches=a.findAllMatches;var export_getDefaultHighlightOptions=a.getDefaultHighlightOptions;var export_getMatchCountText=a.getMatchCountText;var export_isEmptySearch=a.isEmptySearch;var export_replaceAllInContent=a.replaceAllInContent;var export_replaceFirstInContent=a.replaceFirstInContent;export{export_createDefaultFindOptions as createDefaultFindOptions,export_createSearchPattern as createSearchPattern,export_escapeRegexString as escapeRegexString,export_findAllMatches as findAllMatches,export_getDefaultHighlightOptions as getDefaultHighlightOptions,export_getMatchCountText as getMatchCountText,export_isEmptySearch as isEmptySearch,export_replaceAllInContent as replaceAllInContent,export_replaceFirstInContent as replaceFirstInContent};