@eigenpal/docx-js-editor 0.0.24 → 0.0.26
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.
- package/dist/{chunk-R56SLH64.js → chunk-FUK46DWH.js} +4 -4
- package/dist/chunk-MUIREXKH.js +3 -0
- package/dist/chunk-OWMG5MW5.cjs +3 -0
- package/dist/chunk-S36T7OK5.cjs +258 -0
- package/dist/{chunk-3C2VHZX6.cjs → chunk-Y62HOQL2.cjs} +4 -4
- package/dist/chunk-YYBSUBRG.js +258 -0
- package/dist/{clipboard-DriRE6eS.d.ts → clipboard-CU-zASXS.d.ts} +1 -154
- package/dist/{clipboard-Bj2X5pLO.d.cts → clipboard-DBabJ6mU.d.cts} +1 -154
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +90 -7
- package/dist/index.d.ts +90 -7
- package/dist/index.js +6 -6
- package/dist/{react-Bj9uDtjg.d.ts → react-CFPWe7nV.d.ts} +11 -9
- package/dist/{react-BYRZYSPG.d.cts → react-CKqhN17E.d.cts} +11 -9
- package/dist/react.cjs +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.cts +5 -4
- package/dist/ui.d.ts +5 -4
- package/dist/ui.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2JOQ7WKO.js +0 -258
- package/dist/chunk-C6ELWJWO.js +0 -3
- package/dist/chunk-I5YZ4MRV.cjs +0 -3
- package/dist/chunk-RHLMVYVZ.cjs +0 -258
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {p,a,b as b$2}from'./chunk-4VUZBV2S.js';import {a as a$1,b as b$1,k}from'./chunk-SE5EN2QL.js';import*as X from'react';import X__default,{createContext,useRef,useState,useEffect,useCallback,useMemo,useContext}from'react';import*as H from'@radix-ui/react-select';import {clsx}from'clsx';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function w(...e){return clsx(e)}var ye=H.Root,Ee=H.Group,et=H.Value;function Se({className:e,children:t,onMouseDown:o,...n}){return jsxs(H.Trigger,{className:w("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-slate-700 bg-transparent","hover:bg-slate-100/80 focus:outline-none focus:bg-slate-100/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[t,jsx(H.Icon,{asChild:true,children:jsx(pn,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function Ce({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...r}){return jsx(H.Portal,{children:jsx("div",{className:"ep-root",children:jsx(H.Content,{className:w("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-slate-200 bg-white 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:a=>{a.preventDefault(),n?.(a);},...r,children:jsx(H.Viewport,{className:w("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:a=>a.preventDefault(),children:t})})})})}function De({className:e,...t}){return jsx(H.Label,{className:w("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function ce({className:e,children:t,onMouseDown:o,...n}){return jsxs(H.Item,{className:w("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-slate-700 outline-none","hover:bg-slate-100 focus:bg-slate-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[jsx(H.ItemText,{children:t}),jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsx(H.ItemIndicator,{children:jsx(dn,{className:"h-4 w-4"})})})]})}function Ge({className:e,...t}){return jsx(H.Separator,{className:w("-mx-1 my-1 h-px bg-slate-100",e),...t})}function pn({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 dn({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"})})}var mn=[{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 Jt({value:e,onChange:t,fonts:o=mn,disabled:n=false,className:r,placeholder:a="Arial",width:u=120,showPreview:d=true}){let s=X.useMemo(()=>e?o.find(f=>f.fontFamily===e||f.name.toLowerCase()===e.toLowerCase())?.name||e:a,[e,o,a]),c=X.useCallback(l=>{let f=o.find(m=>m.name===l);f&&t?.(f.fontFamily);},[t,o]),p=X.useMemo(()=>{let l={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(f=>{let m=f.category||"other";l[m].push(f);}),l},[o]);return jsxs(ye,{value:s,onValueChange:c,disabled:n,children:[jsx(Se,{className:w("h-8 text-sm",r),style:{minWidth:typeof u=="number"?`${u}px`:u},"aria-label":"Select font family",children:jsx(et,{placeholder:a,children:s})}),jsxs(Ce,{className:"max-h-[300px]",children:[p["sans-serif"].length>0&&jsxs(Ee,{children:[jsx(De,{children:"Sans Serif"}),p["sans-serif"].map(l=>jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]}),p.serif.length>0&&jsxs(Fragment,{children:[jsx(Ge,{}),jsxs(Ee,{children:[jsx(De,{children:"Serif"}),p.serif.map(l=>jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]}),p.monospace.length>0&&jsxs(Fragment,{children:[jsx(Ge,{}),jsxs(Ee,{children:[jsx(De,{children:"Monospace"}),p.monospace.map(l=>jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]})]})]})}var Qt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eo=clsx,to=(e,t)=>o=>{var n;if(t?.variants==null)return eo(e,o?.class,o?.className);let{variants:r,defaultVariants:a}=t,u=Object.keys(r).map(c=>{let p=o?.[c],l=a?.[c];if(p===null)return null;let f=Qt(p)||Qt(l);return r[c][f]}),d=o&&Object.entries(o).reduce((c,p)=>{let[l,f]=p;return f===void 0||(c[l]=f),c},{}),s=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,p)=>{let{class:l,className:f,...m}=p;return Object.entries(m).every(v=>{let[g,x]=v;return Array.isArray(x)?x.includes({...a,...d}[g]):{...a,...d}[g]===x})?[...c,l,f]:c},[]);return eo(e,u,s,o?.class,o?.className)};var fn=to("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"}}),W=X.forwardRef(({className:e,variant:t,size:o,...n},r)=>jsx("button",{className:w(fn({variant:t,size:o,className:e})),ref:r,...n}));W.displayName="Button";function h({size:e=20,className:t="",style:o,children:n}){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 -960 960 960",fill:"currentColor",className:t,style:{display:"inline-flex",flexShrink:0,...o},"aria-hidden":"true",children:n})}function bn(e){return jsx(h,{...e,children:jsx("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})})}function gn(e){return jsx(h,{...e,children:jsx("path",{d:"M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"})})}function xn(e){return jsx(h,{...e,children:jsx("path",{d:"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"})})}function Tn(e){return jsx(h,{...e,children:jsx("path",{d:"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"})})}function yn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function Sn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"})})}function Cn(e){return jsx(h,{...e,children:jsx("path",{d:"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"})})}function wn(e){return jsx(h,{...e,children:jsx("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})})}function In(e){return jsx(h,{...e,children:jsx("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})})}function Pn(e){return jsx(h,{...e,children:jsx("path",{d:"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"})})}function Mn(e){return jsx(h,{...e,children:jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function Zn(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function Rn(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function Ln(e){return jsx(h,{...e,children:jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function kn(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function It(e){return jsx(h,{...e,children:jsx("path",{d:"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"})})}function Hn(e){return jsx(h,{...e,children:jsx("path",{d:"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"})})}function qn(e){return jsx(h,{...e,children:jsx("path",{d:"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"})})}function _n(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function En(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function Dn(e){return jsx(h,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function Nn(e){return jsx(h,{...e,children:jsx("path",{d:"M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"})})}function An(e){return jsx(h,{...e,children:jsx("path",{d:"M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"})})}function Fn(e){return jsx(h,{...e,children:jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function Bn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"})})}function On(e){return jsx(h,{...e,children:jsx("path",{d:"M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"})})}function zn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"})})}function Vn(e){return jsx(h,{...e,children:jsx("path",{d:"M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})})}function Wn(e){return jsx(h,{...e,children:jsx("path",{d:"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"})})}function $n(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function Gn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"})})}function Un(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"})})}function Kn(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Yn(e){return jsx(h,{...e,children:jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function jn(e){return jsx(h,{...e,children:jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function Xn(e){return jsx(h,{...e,children:jsx("path",{d:"M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"})})}function Jn(e){return jsx(h,{...e,children:jsx("path",{d:"M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"})})}function Qn(e){return jsx(h,{...e,children:jsx("path",{d:"m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"})})}function er(e){return jsx(h,{...e,children:jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function tr(e){return jsx(h,{...e,children:jsx("path",{d:"M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"})})}function or(e){return jsx(h,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"})})}function nr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function rr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function ir(e){return jsx(h,{...e,children:jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function ar(e){return jsx(h,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function lr(e){return jsx(h,{...e,children:jsx("path",{d:"M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function sr(e){return jsx(h,{...e,children:jsx("path",{d:"M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"})})}function cr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function ur(e){return jsx(h,{...e,children:jsx("path",{d:"M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"})})}function pr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"})})}function dr(e){return jsx(h,{...e,children:jsx("path",{d:"M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"})})}function mr(e){return jsx(h,{...e,children:jsx("path",{d:"M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"})})}function hr(e){return jsx(h,{...e,children:jsx("path",{d:"M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"})})}function fr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"})})}function vr(e){return jsx(h,{...e,children:jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function br(e){return jsx(h,{...e,children:jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function gr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function xr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Tr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function yr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"})})}function Sr(e){return jsx(h,{...e,children:jsx("path",{d:"M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"})})}function Cr(e){return jsx(h,{...e,children:jsx("path",{d:"M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"})})}function wr(e){return jsx(h,{...e,children:jsx("path",{d:"M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"})})}function Ir(e){return jsx(h,{...e,children:jsx("path",{d:"M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"})})}function Pr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Mr(e){return jsx(h,{...e,children:jsx("path",{d:"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"})})}function Zr(e){return jsx(h,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"})})}function Rr(e){return jsx(h,{...e,children:jsx("path",{d:"m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"})})}function Lr(e){return jsx(h,{...e,children:jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function kr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"})})}function Hr(e){return jsx(h,{...e,children:jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function qr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function _r(e){return jsx(h,{...e,children:jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function Er(e){return jsx(h,{...e,children:jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function Dr(e){return jsx(h,{...e,children:jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function Nr(e){return jsx(h,{...e,children:jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function Ar(e){return jsx(h,{...e,children:jsx("path",{d:"M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"})})}function Fr(e){return jsx(h,{...e,children:jsx("path",{d:"M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"})})}function Br(e){return jsx(h,{...e,children:jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}function Or(e){return jsx(h,{...e,children:jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})})}function zr(e){return jsx(h,{...e,children:jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})})}function Vr(e){return jsx(h,{...e,children:jsx("path",{d:"M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Wr(e){return jsx(h,{...e,children:jsx("path",{d:"M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function $r(e){return jsx(h,{...e,children:jsx("path",{d:"M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"})})}function Gr(e){return jsx(h,{...e,children:jsx("path",{d:"M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Ur(e){return jsx(h,{...e,children:jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"})})}function Kr(e){return jsx(h,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"})})}function Yr(e){return jsx(h,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"})})}var jr={undo:bn,redo:gn,print:xn,format_bold:Tn,format_italic:yn,format_underlined:Sn,strikethrough_s:Cn,superscript:wn,subscript:In,link:Pn,format_clear:Mn,format_align_left:Zn,format_align_center:Rn,format_align_right:Ln,format_align_justify:kn,format_line_spacing:It,format_list_bulleted:Hn,format_list_numbered:qn,format_indent_increase:_n,format_indent_decrease:En,format_color_text:Dn,ink_highlighter:Nn,format_color_reset:An,arrow_drop_down:Fn,table:Bn,table_chart:On,grid_on:zn,table_rows:Vn,view_column:Wn,border_all:$n,border_outer:Gn,border_inner:Un,border_clear:Kn,add:Yn,remove:jn,delete:Xn,delete_sweep:Jn,call_merge:Qn,call_split:er,drag_indicator:tr,image:or,format_image_left:nr,format_image_right:rr,horizontal_rule:ir,flip_to_back:ar,flip_to_front:lr,open_with:sr,tune:cr,rotate_right:ur,rotate_left:pr,swap_horiz:dr,swap_vert:mr,shapes:hr,format_paint:fr,expand_more:vr,expand_less:br,border_top:gr,border_bottom:xr,border_left:Tr,border_right:yr,padding:Sr,text_rotation_none:Cr,wrap_text:wr,height:Ir,fit_width:Pr,settings:Mr,border_color:Zr,format_color_fill:Rr,vertical_align_top:Lr,vertical_align_center:kr,vertical_align_bottom:Hr,line_weight:qr,keyboard_arrow_up:_r,keyboard_arrow_down:Er,keyboard_arrow_left:Dr,keyboard_arrow_right:Nr,more_vert:Ar,page_break:Fr,arrow_back:Br,check:Or,close:zr,add_comment:Vr,comment:Wr,edit_note:$r,rate_review:Gr,visibility:Ur,format_textdirection_l_to_r:Kr,format_textdirection_r_to_l:Yr};function b({name:e,size:t=20,className:o="",style:n}){let r=jr[e];return r?jsx(r,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function G({isOpen:e,onClose:t,align:o="left"}){let n=useRef(null),r=useRef(null),[a,u]=useState({top:0,left:0});useEffect(()=>{if(!e||!n.current)return;let c=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(r.current){let p=r.current.getBoundingClientRect();u({top:c.bottom+4,left:c.right-p.width});}else u({top:c.bottom+4,left:c.left});}):u({top:c.bottom+4,left:c.left});},[e,o]),useEffect(()=>{if(!e)return;let c=f=>{let m=f.target;n.current&&!n.current.contains(m)&&r.current&&!r.current.contains(m)&&t();},p=f=>{f.key==="Escape"&&t();},l=()=>t();return document.addEventListener("mousedown",c),document.addEventListener("keydown",p),window.addEventListener("scroll",l,true),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",p),window.removeEventListener("scroll",l,true);}},[e,t]);let d=useCallback(c=>{c.preventDefault(),c.stopPropagation();},[]),s={position:"fixed",top:a.top,left:a.left,zIndex:1e4};return {containerRef:n,dropdownRef:r,dropdownStyle:s,handleMouseDown:d}}var ei=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],ti=1,oi=400;function lo(e){return e/2}function ql(e){return e*2}function io(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function ao(e,t,o){for(let n=t.length-1;n>=0;n--)if(t[n]<e)return t[n];return Math.max(e-1,o)}function so({value:e,onChange:t,sizes:o=ei,disabled:n=false,className:r,placeholder:a="11",minSize:u=ti,maxSize:d=oi}){let[s,c]=useState(false),[p,l]=useState(""),[f,m]=useState(false),v=useRef(null),g=useCallback(()=>{m(false),c(false);},[]),{containerRef:x,dropdownRef:P,dropdownStyle:T}=G({isOpen:f,onClose:g}),I=e??(parseInt(a,10)||11),L=e!==void 0?e.toString():a,M=useCallback(y=>{if(y.preventDefault(),n)return;let D=ao(I,o,u);t?.(D);},[I,o,u,n,t]),O=useCallback(y=>{if(y.preventDefault(),n)return;let D=io(I,o,d);t?.(D);},[I,o,d,n,t]),A=useCallback(y=>{y.preventDefault(),!n&&(c(true),l(L),m(true),requestAnimationFrame(()=>{v.current?.focus(),v.current?.select();}));},[n,L]),Te=useCallback(y=>{l(y.target.value);},[]),ie=useCallback(()=>{c(false);let y=parseFloat(p);if(!isNaN(y)&&y>=u&&y<=d){let D=Math.round(y*2)/2;t?.(D);}},[p,u,d,t]),me=useCallback(y=>{if(y.key==="Enter")y.preventDefault(),ie(),m(false);else if(y.key==="Escape")c(false),m(false);else if(y.key==="ArrowUp"){y.preventDefault();let D=io(I,o,d);l(D.toString()),t?.(D);}else if(y.key==="ArrowDown"){y.preventDefault();let D=ao(I,o,u);l(D.toString()),t?.(D);}},[ie,I,o,d,u,t]),Z=useCallback(y=>{t?.(y),m(false),c(false);},[t]),K=useCallback(y=>{y.target.tagName!=="INPUT"&&y.preventDefault();},[]);return jsxs("div",{ref:x,className:w("flex items-center",r),onMouseDown:K,children:[jsx(W,{variant:"ghost",size:"icon-sm",className:w("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-r-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:M,disabled:n||I<=u,"aria-label":"Decrease font size","data-testid":"font-size-decrease",children:jsx(b,{name:"remove",size:18})}),jsx("div",{className:"relative",children:s?jsx("input",{ref:v,type:"text",value:p,onChange:Te,onBlur:ie,onKeyDown:me,className:w("h-7 w-10 text-center text-sm border border-slate-300 bg-white","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none"),"aria-label":"Font size","data-testid":"font-size-input"}):jsx("button",{type:"button",onClick:A,className:w("h-7 w-10 text-center text-sm border border-slate-200 bg-white","hover:border-slate-300 hover:bg-slate-50","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none",n&&"opacity-50 cursor-not-allowed"),disabled:n,"aria-label":"Font size","aria-haspopup":"listbox","aria-expanded":f,"data-testid":"font-size-display",children:L})}),f&&jsx("div",{ref:P,style:{...T,backgroundColor:"white",border:"1px solid #e2e8f0",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":"Font sizes",children:o.map(y=>jsx("button",{type:"button",onClick:()=>Z(y),className:w("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",y===I&&"bg-slate-100 font-medium"),role:"option","aria-selected":y===I,children:y},y))}),jsx(W,{variant:"ghost",size:"icon-sm",className:w("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-l-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:O,disabled:n||I>=d,"aria-label":"Increase font size","data-testid":"font-size-increase",children:jsx(b,{name:"add",size:18})})]})}var ii=[{name:"Dark Red",hex:"C00000"},{name:"Red",hex:"FF0000"},{name:"Orange",hex:"FFC000"},{name:"Yellow",hex:"FFFF00"},{name:"Light Green",hex:"92D050"},{name:"Green",hex:"00B050"},{name:"Light Blue",hex:"00B0F0"},{name:"Blue",hex:"0070C0"},{name:"Dark Blue",hex:"002060"},{name:"Purple",hex:"7030A0"}],tt=18,ai=2,li={position:"relative",display:"inline-block"},si={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)"},ci={padding:"10px",backgroundColor:"#fff",border:"1px solid #d0d0d0",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.15)",width:"auto"},Mt={fontSize:"11px",color:"#666",marginBottom:"4px",fontWeight:500},Zt={height:"1px",backgroundColor:"#e0e0e0",margin:"8px 0"},po={display:"grid",gap:`${ai}px`},ot={width:`${tt}px`,height:`${tt}px`,border:"1px solid #c0c0c0",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},mo={...ot,transform:"scale(1.15)",borderColor:"#333",zIndex:1},ho={...ot,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},ui={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid #d0d0d0",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"12px",color:"#333"},pi={display:"flex",alignItems:"center",gap:"6px"},di={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},mi={height:"24px",padding:"0 10px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},hi={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"};function uo(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let n=b$2(e);return n||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return a(e,o)}function fi(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return (o*299+n*587+r*114)/1e3>230}function fo(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():a(e,o).replace(/^#/,"").toUpperCase())===t.toUpperCase():false}function vi({matrix:e,selectedColor:t,theme:o,onSelect:n}){let[r,a]=useState(null);return jsx("div",{style:{...po,gridTemplateColumns:`repeat(10, ${tt}px)`},children:e.flatMap((u,d)=>u.map((s,c)=>{let p=`${d}-${c}`,l=r===p,f=fo(t,s.hex,o);return jsx("button",{type:"button",style:{...f?ho:l?mo:ot,backgroundColor:`#${s.hex}`},title:s.label,"aria-label":s.label,"aria-selected":f,onClick:()=>n(s),onMouseDown:m=>m.preventDefault(),onMouseEnter:()=>a(p),onMouseLeave:()=>a(null)},p)}))})}function bi({selectedColor:e,theme:t,onSelect:o}){let[n,r]=useState(null);return jsx("div",{style:{...po,gridTemplateColumns:`repeat(10, ${tt}px)`},children:ii.map((a,u)=>{let d=n===u,s=fo(e,a.hex,t);return jsx("button",{type:"button",style:{...s?ho:d?mo:ot,backgroundColor:`#${a.hex}`},title:a.name,"aria-label":a.name,"aria-selected":s,onClick:()=>o(a.hex),onMouseDown:c=>c.preventDefault(),onMouseEnter:()=>r(u),onMouseLeave:()=>r(null)},a.hex)})})}function ke({mode:e,value:t,onChange:o,theme:n,disabled:r=false,className:a,style:u,title:d,icon:s,autoLabel:c}){let[p$1,l]=useState(false),[f,m]=useState(false),[v,g]=useState("");useEffect(()=>{let C=uo(t,e,n).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(C)&&g(C.toUpperCase());},[t,e,n]);let x=useCallback(()=>l(false),[]),{containerRef:P,dropdownRef:T,dropdownStyle:I}=G({isOpen:p$1,onClose:x}),L=n?.colorScheme??null,M=useMemo(()=>p(L),[L]),O=useMemo(()=>uo(t,e,n),[t,e,n]),A=useCallback(()=>{r||l(C=>!C);},[r]),Te=useCallback(C=>{if(e==="highlight")o?.(C.hex);else {let Y={themeColor:C.themeSlot,rgb:C.hex};C.tint&&(Y.themeTint=C.tint),C.shade&&(Y.themeShade=C.shade),o?.(Y);}l(false);},[e,o]),ie=useCallback(C=>{o?.(e==="highlight"?C:{rgb:C}),l(false);},[e,o]),me=useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),l(false);},[e,o]),Z=useCallback(()=>{let C=v.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(C)&&(o?.(e==="highlight"?C:{rgb:C}),l(false),g(""));},[e,v,o]),K={...si,...r?{cursor:"default",opacity:.38}:p$1?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:f?{backgroundColor:"var(--doc-bg-hover)"}:{}},y=e==="text"?"Font Color":e==="highlight"?"Text Highlight Color":"Border Color",D=s??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxs("div",{ref:P,className:`docx-advanced-color-picker ${a||""}`,style:{...li,...u},children:[jsxs("button",{type:"button",className:"docx-advanced-color-picker-button",style:K,onClick:A,onMouseDown:C=>C.preventDefault(),onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),disabled:r,title:d||y,"aria-label":d||y,"aria-haspopup":"true","aria-expanded":p$1,children:[jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsx(b,{name:D,size:18}),jsx("div",{style:{...hi,backgroundColor:O==="transparent"?"#fff":O,outline:O==="transparent"||fi(O)?"1px solid #bbb":"none"}})]}),jsx(b,{name:"arrow_drop_down",size:14})]}),p$1&&jsx("div",{ref:T,className:"docx-advanced-color-picker-dropdown",style:{...I,...ci},role:"dialog","aria-label":`${y} picker`,onMouseDown:C=>{C.target.tagName!=="INPUT"&&C.preventDefault();},children:jsxs(Fragment,{children:[jsxs("button",{type:"button",style:ui,onClick:me,onMouseDown:C=>C.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"}}),c??(e==="highlight"?"No Color":"Automatic")]}),jsx("div",{style:Zt}),jsx("div",{style:Mt,children:"Theme Colors"}),jsx(vi,{matrix:M,selectedColor:t,theme:n,onSelect:Te}),jsx("div",{style:Zt}),jsx("div",{style:Mt,children:"Standard Colors"}),jsx(bi,{selectedColor:t,theme:n,onSelect:ie}),jsx("div",{style:Zt}),jsx("div",{style:Mt,children:"Custom Color"}),jsxs("div",{style:pi,children:[jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsx("input",{type:"text",style:di,value:v,onChange:C=>g(C.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:C=>{C.key==="Enter"&&Z();},onMouseDown:C=>{C.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsx("button",{type:"button",style:{...mi,opacity:/^[0-9A-Fa-f]{6}$/.test(v)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(v)?"pointer":"default"},onClick:Z,onMouseDown:C=>C.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(v),children:"Apply"})]})]})})]})}function J({content:e,children:t,side:o="bottom",delayMs:n=400}){let[r,a]=X.useState(false),[u,d]=X.useState({x:0,y:0}),s=X.useRef(null),c=X.useRef(null),p=X.useCallback(()=>{c.current=setTimeout(()=>{if(s.current){let v=s.current.getBoundingClientRect(),g=v.left+v.width/2,x=o==="top"?v.top-8:v.bottom+8;d({x:g,y:x});}a(true);},n);},[n,o]),l=X.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),a(false);},[]);X.useEffect(()=>()=>{c.current&&clearTimeout(c.current);},[]);let f=t.props,m=X.cloneElement(t,{ref:s,onMouseEnter:v=>{p(),f.onMouseEnter?.(v);},onMouseLeave:v=>{l(),f.onMouseLeave?.(v);}});return jsxs(Fragment,{children:[m,r&&jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg",style:{left:u.x,top:u.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var Ye=20,Rt=[{value:"left",label:"Align Left",icon:jsx(b,{name:"format_align_left",size:Ye}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",icon:jsx(b,{name:"format_align_center",size:Ye}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",icon:jsx(b,{name:"format_align_right",size:Ye}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",icon:jsx(b,{name:"format_align_justify",size:Ye}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function go({value:e="left",onChange:t,disabled:o=false}){let[n,r]=useState(false),a=useCallback(()=>r(false),[]),{containerRef:u,dropdownRef:d,dropdownStyle:s,handleMouseDown:c}=G({isOpen:n,onClose:a}),p=useCallback(m=>{o||t?.(m),r(false);},[o,t]),l=Rt.find(m=>m.value===e)||Rt[0],f=jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",o&&"opacity-30 cursor-not-allowed"),onMouseDown:c,onClick:()=>!o&&r(m=>!m),disabled:o,"aria-label":`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsx(b,{name:l.iconName,size:Ye}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:u,style:{position:"relative",display:"inline-block"},children:[n?f:jsx(J,{content:`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,children:f}),n&&!o&&jsx("div",{ref:d,style:{...s,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:m=>m.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:Rt.map(m=>{let v=e===m.value;return jsx("button",{type:"button",title:`${m.label}${m.shortcut?` (${m.shortcut})`:""}`,"data-testid":`alignment-${m.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:g=>g.preventDefault(),onMouseEnter:g=>{v||(g.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:g=>{g.currentTarget.style.backgroundColor=v?"var(--doc-primary-light)":"transparent";},onClick:()=>p(m.value),children:jsx(b,{name:m.iconName,size:18})},m.value)})})})]})}var Ii={display:"inline-flex",alignItems:"center",gap:"4px"},xo={display:"inline-flex",alignItems:"center",gap:"4px"},at={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)"},Pi={...at,backgroundColor:"var(--doc-bg-hover)"},Mi={...at,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Zi={...at,cursor:"default",opacity:.38},Ri={width:"28px",height:"28px",padding:"2px"},Li={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},nt=20;function rt({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:a,style:u}){let[d,s]=useState(false),c={...t?Zi:e?Mi:d?Pi:at,...u},p=l=>{l.preventDefault();};return jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${a||""}`,style:c,onMouseDown:p,onClick:t?void 0:n,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:r})}function To({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:r,disabled:a=false,className:u,style:d,showIndentButtons:s=true,compact:c=false,hasIndent:p=false}){let l=useCallback(()=>c?{...Ri}:{},[c]),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 ${u||""}`,style:{...Ii,...d},role:"group","aria-label":"List formatting",children:[jsxs("div",{style:xo,role:"group","aria-label":"List type",children:[jsx(rt,{active:f,disabled:a,title:"Bullet List",onClick:t,style:l(),children:jsx(b,{name:"format_list_bulleted",size:nt})}),jsx(rt,{active:m,disabled:a,title:"Numbered List",onClick:o,style:l(),children:jsx(b,{name:"format_list_numbered",size:nt})})]}),s&&jsxs(Fragment,{children:[jsx("div",{style:Li,role:"separator"}),jsxs("div",{style:xo,role:"group","aria-label":"List indentation",children:[jsx(rt,{active:false,disabled:a||!g,title:"Decrease Indent",onClick:r,style:l(),children:jsx(b,{name:"format_indent_decrease",size:nt})}),jsx(rt,{active:false,disabled:a,title:"Increase Indent",onClick:n,style:l(),children:jsx(b,{name:"format_indent_increase",size:nt})})]})]})]})}function yo(){return {type:"none",level:0,isInList:false}}var Hi=[{label:"Single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",value:2,twipsValue:480}];function Co({value:e,onChange:t,options:o=Hi,disabled:n=false,className:r}){let a=X.useMemo(()=>e===void 0?o[0]:o.find(d=>d.twipsValue===e)||o[0],[e,o]),u=X.useCallback(d=>{let s=parseInt(d,10);isNaN(s)||t?.(s);},[t]);return jsxs(ye,{value:a.twipsValue.toString(),onValueChange:u,disabled:n,children:[jsx(Se,{className:w("h-8 text-sm gap-0.5 px-2",r),style:{width:"auto"},title:`Line spacing: ${a.label}`,children:jsx(It,{className:"h-5 w-5 shrink-0"})}),jsxs(Ce,{children:[o.map(d=>jsx(ce,{value:d.twipsValue.toString(),children:d.label},d.twipsValue)),jsx(Ge,{}),jsx(Ee,{children:jsx(De,{children:"Paragraph spacing"})})]})]})}var wo=[{styleId:"Normal",name:"Normal text",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}],qi="#4a6c8c",_i={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function Ei(e){let t={},o=_i[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,r=Math.min(Math.max(n,11),20);t.fontSize=`${r}px`;}return t.lineHeight="1.3",e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color?t.color=`#${e.color}`:e.styleId.startsWith("Heading")&&(t.color=qi),t}function Io({value:e,onChange:t,styles:o,disabled:n=false,className:r,width:a=120}){let u=X.useMemo(()=>!o||o.length===0?wo:o.filter(l=>l.type==="paragraph").filter(l=>l.qFormat?true:!(l.hidden||l.semiHidden)).map(l=>{let f=wo.find(m=>m.styleId===l.styleId);return {styleId:l.styleId,name:l.name||l.styleId,type:l.type,isDefault:l.default,qFormat:l.qFormat,priority:l.uiPriority??99,fontSize:l.rPr?.fontSize??f?.fontSize,bold:l.rPr?.bold??f?.bold,italic:l.rPr?.italic??f?.italic,color:l.rPr?.color?.rgb??f?.color}}).sort((l,f)=>(l.priority??99)-(f.priority??99)),[o]),d=X.useCallback(p=>{t?.(p);},[t]),s=e||"Normal",c=u.find(p=>p.styleId===s)?.name||s;return jsxs(ye,{value:s,onValueChange:d,disabled:n,children:[jsx(Se,{className:w("h-8 text-sm",r),style:{width:typeof a=="number"?`${a}px`:a},"aria-label":"Select paragraph style",children:jsx("span",{className:"truncate",children:c})}),jsx(Ce,{className:"min-w-[260px] max-h-[400px]",children:u.map(p=>jsx(ce,{value:p.styleId,className:"py-2.5 px-3",children:jsx("span",{style:Ei(p),children:p.name})},p.styleId))})]})}var Ni=[{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 Po({value:e=1,onChange:t,levels:o=Ni,disabled:n=false,className:r,compact:a=false}){let u=X.useMemo(()=>{let s=o.find(c=>Math.abs(c.value-e)<.001);return s?s.label:`${Math.round(e*100)}%`},[o,e]),d=X.useCallback(s=>{let c=parseFloat(s);isNaN(c)||t?.(c);},[t]);return jsxs(ye,{value:e.toString(),onValueChange:d,disabled:n,children:[jsx(Se,{className:w(a?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",r),"aria-label":`Zoom: ${u}`,children:jsx(et,{placeholder:"100%",children:u})}),jsx(Ce,{children:o.map(s=>jsx(ce,{value:s.value.toString(),children:s.label},s.value))})]})}var Bi=[{action:"borderAll",icon:"border_all",label:"All borders"},{action:"borderOutside",icon:"border_outer",label:"Outside borders"},{action:"borderInside",icon:"border_inner",label:"Inside borders"},{action:"borderTop",icon:"border_top",label:"Top border"},{action:"borderBottom",icon:"border_bottom",label:"Bottom border"},{action:"borderLeft",icon:"border_left",label:"Left border"},{action:"borderRight",icon:"border_right",label:"Right border"},{action:"borderNone",icon:"border_clear",label:"No borders"}];function Ro({onAction:e,disabled:t=false}){let[o,n]=useState(false),r=useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:u,dropdownStyle:d,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=useCallback(l=>{e(l),n(false);},[e]),p=jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border style","aria-expanded":o,"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:a,style:{position:"relative",display:"inline-block"},children:[o?p:jsx(J,{content:"Borders",children:p}),o&&!t&&jsx("div",{ref:u,style:{...d,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:l=>l.stopPropagation(),children:jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:Bi.map(({action:l,icon:f,label:m})=>jsx("button",{type:"button",title: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:v=>v.preventDefault(),onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:jsx(b,{name:f,size:18})},typeof l=="string"?l:l.type))})})]})}function Lo({onAction:e,disabled:t=false,theme:o,value:n}){let r=useCallback(a=>{typeof a=="string"?e({type:"borderColor",color:a.replace(/^#/,"")}):a.rgb?e({type:"borderColor",color:a.rgb.replace(/^#/,"")}):a.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsx(ke,{mode:"border",value:n,onChange:r,theme:o,disabled:t,title:"Border Color"})}var Wi=[{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 Ho({onAction:e,disabled:t=false}){let[o,n]=useState(false),r=useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:u,dropdownStyle:d,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=useCallback(l=>{e({type:"borderWidth",size:l}),n(false);},[e]),p=jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border width","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:a,style:{position:"relative",display:"inline-block"},children:[o?p:jsx(J,{content:"Border width",children:p}),o&&!t&&jsx("div",{ref:u,style:{...d,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:120},onMouseDown:l=>l.stopPropagation(),children:Wi.map(({size:l,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:v=>v.preventDefault(),onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:[jsx("div",{style:{width:50,height:Math.max(m,1),backgroundColor:"#000",borderRadius:m>2?1:0}}),jsx("span",{children:f})]},l))})]})}function qo({onAction:e,disabled:t=false,theme:o,value:n}){let r=useCallback(a=>{typeof a=="string"&&e(a==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:a.replace(/^#/,"")});},[e]);return jsx(ke,{mode:"highlight",value:n,onChange:r,theme:o,disabled:t,title:"Cell Fill Color",icon:"format_color_fill",autoLabel:"No fill"})}var Ui={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"},Oe={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},Do={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function No({onAction:e,disabled:t=false,tableContext:o}){let[n,r]=useState(false),[a,u]=useState(null),d=useCallback(()=>r(false),[]),{containerRef:s,dropdownRef:c,dropdownStyle:p,handleMouseDown:l}=G({isOpen:n,onClose:d,align:"right"}),f=o?.table?.attrs?.justification??"left",m=useCallback(x=>{e(x),r(false);},[e]),v=(x,P,T,I,L)=>{let M=t||L?.itemDisabled;return jsxs("button",{type:"button",role:"menuitem",style:{...Ui,backgroundColor:a===x&&!M?"var(--doc-bg-hover)":"transparent",color:M?"var(--doc-text-muted)":L?.danger?"var(--doc-error)":"var(--doc-text)",cursor:M?"not-allowed":"pointer"},onClick:()=>!M&&m(I),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),disabled:M,children:[jsx(b,{name:P,size:16,className:L?.danger&&!M?"text-red-600":""}),jsx("span",{style:{flex:1},children:T})]},x)},g=jsx(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:l,onClick:()=>!t&&r(x=>!x),disabled:t,"aria-label":"More table options","aria-expanded":n,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsx(b,{name:"more_vert",size:20})});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[n?g:jsx(J,{content:"More table options",children:g}),n&&!t&&jsxs("div",{ref:c,style:{...p,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:x=>x.stopPropagation(),children:[v("addRowAbove","add","Insert row above","addRowAbove"),v("addRowBelow","add","Insert row below","addRowBelow"),v("addColumnLeft","add","Insert column left","addColumnLeft"),v("addColumnRight","add","Insert column right","addColumnRight"),jsx("div",{style:Oe,role:"separator"}),v("mergeCells","call_merge","Merge cells","mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),v("splitCell","call_split","Split cell","splitCell",{itemDisabled:!o?.canSplitCell}),jsx("div",{style:Oe,role:"separator"}),v("deleteRow","delete","Delete row","deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),v("deleteColumn","delete","Delete column","deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),v("deleteTable","delete","Delete table","deleteTable",{danger:true}),jsx("div",{style:Oe,role:"separator"}),jsx("div",{style:Do,children:"Vertical alignment"}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(x=>{let P={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsx("button",{type:"button",title:{top:"Top",center:"Middle",bottom:"Bottom"}[x],style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{I.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:I=>{I.currentTarget.style.backgroundColor="transparent";},onClick:()=>m({type:"cellVerticalAlign",align:x}),children:jsx(b,{name:P[x],size:16})},x)})}),jsx("div",{style:Oe,role:"separator"}),jsx("div",{style:Do,children:"Table alignment"}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(x=>{let P={left:"format_align_left",center:"format_align_center",right:"format_align_right"},T=f===x;return jsx("button",{type:"button",title:`Align table ${x}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:T?"var(--doc-primary-light)":"transparent",borderColor:T?"var(--doc-primary)":"var(--doc-border)",color:T?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:I=>I.preventDefault(),onClick:()=>m({type:"tableProperties",props:{justification:x}}),children:jsx(b,{name:P[x],size:16})},x)})}),jsx("div",{style:Oe,role:"separator"}),v("headerRow","table_rows","Toggle header row",{type:"toggleHeaderRow"}),v("distribute","view_column","Distribute columns evenly",{type:"distributeColumns"}),v("autoFit","fit_width","Auto-fit to contents",{type:"autoFitContents"}),v("noWrap","wrap_text","Toggle no-wrap",{type:"toggleNoWrap"}),jsx("div",{style:Oe,role:"separator"}),v("properties","settings","Table properties...",{type:"openTableProperties"})]})]})}var Yi=20;function pt({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:r,disabled:a=false,ariaLabel:u,testId:d}){let[s,c]=useState(false),p=useCallback(()=>c(false),[]),{containerRef:l,dropdownRef:f,dropdownStyle:m,handleMouseDown:v}=G({isOpen:s,onClose:p}),g=useCallback(P=>{a||r(P),c(false);},[a,r]),x=jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",s&&"bg-slate-100",a&&"opacity-30 cursor-not-allowed"),onMouseDown:v,onClick:()=>!a&&c(P=>!P),disabled:a,"aria-label":u??n,"aria-expanded":s,"aria-haspopup":"true","data-testid":d,children:[jsx(b,{name:o,size:Yi}),jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:l,style:{position:"relative",display:"inline-block"},children:[s?x:jsx(J,{content:n,children:x}),s&&!a&&jsx("div",{ref:f,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:P=>P.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:e.map(P=>{let T=t===P.value;return jsx("button",{type:"button",title:P.label,"data-testid":d?`${d}-${P.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:T?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:T?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{T||(I.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:I=>{I.currentTarget.style.backgroundColor=T?"var(--doc-primary-light)":"transparent";},onClick:()=>g(P.value),children:jsx(b,{name:P.iconName,size:18})},P.value)})})})]})}var Ht=[{value:"inline",label:"Inline with text",iconName:"format_image_left"},{value:"wrapRight",label:"Float left (wrap right)",iconName:"format_image_right"},{value:"wrapLeft",label:"Float right (wrap left)",iconName:"format_image_left"},{value:"topAndBottom",label:"Top and bottom",iconName:"horizontal_rule"},{value:"behind",label:"Behind text",iconName:"flip_to_back"},{value:"inFront",label:"In front of text",iconName:"flip_to_front"}];function ji(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function Bo({imageContext:e,onChange:t,disabled:o=false}){let n=ji(e),r=Ht.find(a=>a.value===n)||Ht[0];return jsx(pt,{options:Ht,activeValue:n,triggerIcon:r.iconName,tooltipContent:`Wrap: ${r.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var Ji=[{value:"rotateCW",label:"Rotate clockwise",iconName:"rotate_right"},{value:"rotateCCW",label:"Rotate counter-clockwise",iconName:"rotate_left"},{value:"flipH",label:"Flip horizontal",iconName:"swap_horiz"},{value:"flipV",label:"Flip vertical",iconName:"swap_vert"}];function Oo({onTransform:e,disabled:t=false}){return jsx(pt,{options:Ji,triggerIcon:"rotate_right",tooltipContent:"Transform",onSelect:e,disabled:t,testId:"toolbar-image-transform"})}function ta(e){return "type"in e&&e.type==="separator"}var Wo={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, #374151)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},oa={...Wo,background:"var(--doc-hover, #f3f4f6)"},$o={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text, #374151)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},na={...$o,opacity:.4,cursor:"default"},ra={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},ia={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},aa={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:8,zIndex:1001};function mt({label:e,items:t,disabled:o}){let[n,r]=useState(false),[a,u]=useState(null),d=useRef(null),s=useRef(null),[c,p]=useState({top:0,left:0}),l=useCallback(()=>{r(false),u(null);},[]);useEffect(()=>{if(!n||!d.current)return;let m=d.current.getBoundingClientRect();p({top:m.bottom+2,left:m.left});},[n]),useEffect(()=>{if(!n)return;function m(x){let P=x.target;d.current&&!d.current.contains(P)&&s.current&&!s.current.contains(P)&&l();}function v(x){x.key==="Escape"&&l();}function g(){l();}return document.addEventListener("mousedown",m),document.addEventListener("keydown",v),window.addEventListener("scroll",g,true),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",v),window.removeEventListener("scroll",g,true);}},[n,l]);let f=m=>{m.disabled||m.submenuContent||m.onClick&&(m.onClick(),l());};return jsxs("div",{style:{position:"relative"},children:[jsxs("button",{ref:d,type:"button",onClick:()=>!o&&r(!n),onMouseDown:m=>m.preventDefault(),disabled:o,style:n?oa:Wo,children:[e,jsx(b,{name:"arrow_drop_down",size:16})]}),n&&jsx("div",{ref:s,style:{position:"fixed",top:c.top,left:c.left,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:m=>m.preventDefault(),children:t.map((m,v)=>{if(ta(m))return jsx("div",{style:ra},`sep-${v}`);let g=m;if(g.customContent)return jsx("div",{onMouseDown:T=>T.preventDefault(),children:g.customContent},g.label);let x=!!g.submenuContent,P=a===g.label;return jsxs("div",{style:{position:"relative"},onMouseEnter:()=>x&&u(g.label),onMouseLeave:()=>x&&u(null),children:[jsxs("button",{type:"button",style:g.disabled?na:$o,onClick:()=>f(g),onMouseDown:T=>T.preventDefault(),onMouseOver:T=>{g.disabled||(T.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:T=>{T.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:ia,children:g.shortcut}),x&&jsx("span",{style:{marginLeft:"auto"},children:jsx(b,{name:"keyboard_arrow_right",size:16})})]}),x&&P&&jsx("div",{style:aa,onMouseDown:T=>T.preventDefault(),children:g.submenuContent(l)})]},g.label)})})]})}var Et=18,sa=2,Uo={width:Et,height:Et,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},ca={...Uo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},ua={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text, #374151)",textAlign:"center"};function Ko({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[n,r]=useState(0),[a,u]=useState(0),d=useCallback(()=>{n>0&&a>0&&e(n,a);},[n,a,e]),s=[];for(let p=1;p<=t;p++)for(let l=1;l<=o;l++){let f=p<=n&&l<=a;s.push(jsx("div",{style:f?ca:Uo,onMouseEnter:()=>{r(p),u(l);},onClick:d,role:"gridcell","aria-selected":f},`${p}-${l}`));}let c=n>0&&a>0?`${a} \xD7 ${n}`:"Select size";return jsxs("div",{children:[jsx("div",{style:{display:"grid",gap:sa,gridTemplateColumns:`repeat(${o}, ${Et}px)`},onMouseLeave:()=>{r(0),u(0);},role:"grid","aria-label":"Table size selector",children:s}),jsx("div",{style:ua,children:c})]})}var da={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function vs(e){let t=e.replace(/^#/,"").toUpperCase();return da[t]||null}function Q({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:a,ariaLabel:u}){let d=u?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),s=p=>{p.preventDefault();},c=jsx(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",e&&"bg-slate-900 text-white hover:bg-slate-800 hover:text-white",t&&"opacity-30 cursor-not-allowed",a),onMouseDown:s,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":u||o,"data-testid":d?`toolbar-${d}`:void 0,children:r});return o?jsx(J,{content:o,children:c}):c}function oe({label:e,children:t,className:o}){return jsx("div",{className:w("flex items-center gap-px px-1.5 border-r border-slate-200/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function Ps(){return jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}function Ms({children:e,className:t,style:o,disabled:n=false,onFormat:r,onPrint:a,showPrintButton:u=true,onPageSetup:d,onInsertImage:s,onInsertTable:c,showTableInsert:p=true,onInsertPageBreak:l,onInsertTOC:f,onRefocusEditor:m,...v}){let g=useRef(null),x=useCallback(L=>{!n&&r&&r(L);},[n,r]),P=useCallback((L,M)=>{!n&&c&&(c(L,M),requestAnimationFrame(()=>m?.()));},[n,c,m]),T=useCallback(L=>{let M=L.target;M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.tagName==="SELECT"||M.tagName==="OPTION"||L.preventDefault();},[]),I=useCallback(L=>{let M=L.target,O=document.activeElement;M.tagName==="SELECT"||M.tagName==="OPTION"||O?.tagName==="SELECT"||requestAnimationFrame(()=>{m?.();});},[m]);return jsxs("div",{ref:g,className:w("flex items-center px-1 py-1 bg-white border-b border-slate-100 min-h-[36px] overflow-x-auto",t),style:o,role:"toolbar","aria-label":"Formatting toolbar","data-testid":"toolbar",onMouseDown:T,onMouseUp:I,children:[u&&a||d?jsx(mt,{label:"File",disabled:n,items:[...u&&a?[{icon:"print",label:"Print",shortcut:"Ctrl+P",onClick:a}]:[],...d?[{icon:"settings",label:"Page setup",onClick:d}]:[]]}):null,jsx(mt,{label:"Format",disabled:n,items:[{icon:"format_textdirection_l_to_r",label:"Left-to-right text",onClick:()=>x("setLtr")},{icon:"format_textdirection_r_to_l",label:"Right-to-left text",onClick:()=>x("setRtl")}]}),jsx(mt,{label:"Insert",disabled:n,items:[...s?[{icon:"image",label:"Image",onClick:s}]:[],...p&&c?[{icon:"grid_on",label:"Table",submenuContent:L=>jsx(Ko,{onInsert:(M,O)=>{P(M,O),L();}})}]:[],...s||p&&c?[{type:"separator"}]:[],{icon:"page_break",label:"Page break",onClick:l,disabled:!l},{icon:"format_list_numbered",label:"Table of contents",onClick:f,disabled:!f}]}),jsx(Yo,{...v,disabled:n,onFormat:r,onRefocusEditor:m,onInsertTable:c,showTableInsert:p,onInsertImage:s,onInsertPageBreak:l,onInsertTOC:f,onPrint:a,showPrintButton:u,onPageSetup:d,inline:true,children:e})]})}var Dt=createContext(null);function ks(){let e=useContext(Dt);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var ne=18;function Ta(e){let t=X__default.useContext(Dt);return t?{...t,...ya(e)}:e}function ya(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function Yo(e){let t=Ta(e),{currentFormatting:o={},onFormat:n,onUndo:r,onRedo:a$1,canUndo:u=false,canRedo:d=false,disabled:s=false,className:c,style:p,enableShortcuts:l=true,editorRef:f,children:m,showFontPicker:v=true,showFontSizePicker:g=true,showTextColorPicker:x=true,showHighlightColorPicker:P=true,showAlignmentButtons:T=true,showListButtons:I=true,showLineSpacingPicker:L=true,showStylePicker:M=true,documentStyles:O,theme:A,showZoomControl:Te=true,zoom:ie,onZoomChange:me,onRefocusEditor:Z,imageContext:K,onImageWrapType:y,onImageTransform:D,onOpenImageProperties:C,tableContext:Y,onTableAction:Ie,inline:ae=false}=t,Xe=useRef(null),F=useCallback(k=>{!s&&n&&n(k);},[s,n]),Tt=useCallback(()=>{!s&&u&&r&&r();},[s,u,r]),yt=useCallback(()=>{!s&&d&&a$1&&a$1();},[s,d,a$1]),St=useCallback(k=>{!s&&n&&(n({type:"fontFamily",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Ct=useCallback(k=>{!s&&n&&(n({type:"fontSize",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Pe=useCallback(k=>{!s&&n&&(n({type:"textColor",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Ve=useCallback(k=>{!s&&n&&(n({type:"highlightColor",value:typeof k=="string"?k:""}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),le=useCallback(k=>{!s&&n&&n({type:"alignment",value:k});},[s,n]),wt=useCallback(()=>{!s&&n&&n("bulletList");},[s,n]),_=useCallback(()=>{!s&&n&&n("numberedList");},[s,n]),Me=useCallback(()=>{!s&&n&&n("indent");},[s,n]),Je=useCallback(()=>{!s&&n&&n("outdent");},[s,n]),Ze=useCallback(k=>{!s&&n&&(n({type:"lineSpacing",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),se=useCallback(k=>{!s&&n&&(n({type:"applyStyle",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),z=useCallback(k=>{!s&&Ie&&(Ie(k),requestAnimationFrame(()=>Z?.()));},[s,Ie,Z]);useEffect(()=>{if(!l)return;let k=q=>{let We=q.target,Ut=f?.current,ln=Xe.current,sn=Ut?.contains(We),cn=ln?.contains(We);if(!sn&&!cn)return;if((q.ctrlKey||q.metaKey)&&!q.altKey)switch(q.key.toLowerCase()){case "b":q.preventDefault(),F("bold");break;case "i":q.preventDefault(),F("italic");break;case "u":q.preventDefault(),F("underline");break;case "=":q.shiftKey?(q.preventDefault(),F("superscript")):(q.preventDefault(),F("subscript"));break;case "l":q.preventDefault(),le("left");break;case "e":q.preventDefault(),le("center");break;case "r":q.preventDefault(),le("right");break;case "j":q.preventDefault(),le("both");break;case "k":q.preventDefault(),F("insertLink");break}};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k);}},[l,F,le,f]);let ee=useCallback(k=>{let q=k.target;q.tagName==="INPUT"||q.tagName==="TEXTAREA"||q.tagName==="SELECT"||q.tagName==="OPTION"||k.preventDefault();},[]),Re=useCallback(k=>{let q=k.target,We=document.activeElement;q.tagName==="SELECT"||q.tagName==="OPTION"||We?.tagName==="SELECT"||requestAnimationFrame(()=>{Z?.();});},[Z]);return jsxs("div",{ref:Xe,className:w(!ae&&"flex items-center px-2 py-1 bg-[#f1f5f9] rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",c),style:ae?{display:"contents",...p}:p,role:ae?void 0:"toolbar","aria-label":ae?void 0:"Formatting toolbar","data-testid":ae?void 0:"formatting-bar",onMouseDown:ae?void 0:ee,onMouseUp:ae?void 0:Re,children:[jsxs(oe,{label:"History",children:[jsx(Q,{onClick:Tt,disabled:s||!u,title:"Undo (Ctrl+Z)",ariaLabel:"Undo",children:jsx(b,{name:"undo",size:ne})}),jsx(Q,{onClick:yt,disabled:s||!d,title:"Redo (Ctrl+Y)",ariaLabel:"Redo",children:jsx(b,{name:"redo",size:ne})})]}),Te&&jsx(oe,{label:"Zoom",children:jsx(Po,{value:ie,onChange:me,minZoom:.5,maxZoom:2,disabled:s,compact:true,showButtons:false})}),M&&jsx(oe,{label:"Styles",children:jsx(Io,{value:o.styleId||"Normal",onChange:se,styles:O,theme:A,disabled:s,width:120})}),(v||g)&&jsxs(oe,{label:"Font",children:[v&&jsx(Jt,{value:o.fontFamily||"Arial",onChange:St,disabled:s,width:60,placeholder:"Arial"}),g&&jsx(so,{value:o.fontSize!==void 0?lo(o.fontSize):11,onChange:Ct,disabled:s,width:42,placeholder:"11"})]}),jsxs(oe,{label:"Text formatting",children:[jsx(Q,{onClick:()=>F("bold"),active:o.bold,disabled:s,title:"Bold (Ctrl+B)",ariaLabel:"Bold",children:jsx(b,{name:"format_bold",size:ne})}),jsx(Q,{onClick:()=>F("italic"),active:o.italic,disabled:s,title:"Italic (Ctrl+I)",ariaLabel:"Italic",children:jsx(b,{name:"format_italic",size:ne})}),jsx(Q,{onClick:()=>F("underline"),active:o.underline,disabled:s,title:"Underline (Ctrl+U)",ariaLabel:"Underline",children:jsx(b,{name:"format_underlined",size:ne})}),jsx(Q,{onClick:()=>F("strikethrough"),active:o.strike,disabled:s,title:"Strikethrough",ariaLabel:"Strikethrough",children:jsx(b,{name:"strikethrough_s",size:ne})}),x&&jsx(ke,{mode:"text",value:o.color?.replace(/^#/,""),onChange:Pe,theme:A,disabled:s,title:"Font Color"}),P&&jsx(ke,{mode:"highlight",value:o.highlight,onChange:Ve,theme:A,disabled:s,title:"Text Highlight Color"}),jsx(Q,{onClick:()=>F("insertLink"),disabled:s,title:"Insert link (Ctrl+K)",ariaLabel:"Insert link",children:jsx(b,{name:"link",size:ne})})]}),jsxs(oe,{label:"Script",children:[jsx(Q,{onClick:()=>F("superscript"),active:o.superscript,disabled:s,title:"Superscript (Ctrl+Shift+=)",ariaLabel:"Superscript",children:jsx(b,{name:"superscript",size:ne})}),jsx(Q,{onClick:()=>F("subscript"),active:o.subscript,disabled:s,title:"Subscript (Ctrl+=)",ariaLabel:"Subscript",children:jsx(b,{name:"subscript",size:ne})})]}),T&&jsx(oe,{label:"Alignment",children:jsx(go,{value:o.alignment||"left",onChange:le,disabled:s})}),(I||L)&&jsxs(oe,{label:"List formatting",children:[I&&jsx(To,{listState:o.listState||yo(),onBulletList:wt,onNumberedList:_,onIndent:Me,onOutdent:Je,disabled:s,showIndentButtons:true,compact:true,hasIndent:(o.indentLeft??0)>0}),L&&jsx(Co,{value:o.lineSpacing,onChange:Ze,disabled:s})]}),K&&y&&jsxs(oe,{label:"Image",children:[jsx(Bo,{imageContext:K,onChange:y,disabled:s}),D&&jsx(Oo,{onTransform:D,disabled:s}),C&&jsx(Q,{onClick:C,disabled:s,title:"Image properties (alt text, border)...",ariaLabel:"Image properties",children:jsx(b,{name:"tune",size:ne})})]}),Y?.isInTable&&Ie&&jsxs(oe,{label:"Table",children:[jsx(Ro,{onAction:z,disabled:s}),jsx(Lo,{onAction:z,disabled:s,theme:A,value:Y?.cellBorderColor?a(Y.cellBorderColor,A).replace(/^#/,""):void 0}),jsx(Ho,{onAction:z,disabled:s}),jsx(qo,{onAction:z,disabled:s,theme:A,value:Y?.cellBackgroundColor}),jsx(No,{onAction:z,disabled:s,tableContext:Y})]}),jsx(Q,{onClick:()=>F("clearFormatting"),disabled:s,title:"Clear formatting",ariaLabel:"Clear formatting",children:jsx(b,{name:"format_clear",size:ne})}),m]})}var Xo=12240,vt=1440,bt=1440,gt=567,At=22,wa="var(--doc-text-muted)",Ia="var(--doc-text-subtle)",jo="rgba(0, 0, 0, 0.02)",Pa="#4285f4",Ma="#3367d6",Za="#2a56c6",_e=5;function Ra(e,t){return t==="inch"?(e/bt).toFixed(2)+'"':(e/gt).toFixed(1)+" cm"}function ic({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:r,onFirstLineIndentChange:a,showFirstLineIndent:u=false,firstLineIndent:d=0,hangingIndent:s=false,indentLeft:c=0,indentRight:p=0,onIndentLeftChange:l,onIndentRightChange:f,unit:m="inch",className:v="",style:g,tabStops:x,onTabStopRemove:P}){let[T,I]=useState(null),[L,M]=useState(null),[O,A]=useState(null),[Te,ie]=useState(null),me=useRef(null),Z=e?.pageWidth??Xo,K=e?.marginLeft??vt,y=e?.marginRight??vt,D=Z-K-y,C=a$1(Z)*t,Y=a$1(K)*t,Ie=a$1(y)*t,ae=a$1(c)*t,Xe=a$1(p)*t,F=s?-d:d,Tt=a$1(F)*t,yt=Y+ae,St=C-Ie-Xe,Ct=Y+ae+Tt,Pe=useCallback((_,Me)=>{o&&(_.preventDefault(),_.stopPropagation(),I(Me));},[o]),Ve=useCallback(_=>{if(!T||!me.current)return;let Me=me.current.getBoundingClientRect(),Je=_.clientX-Me.left;ie(Je);let Ze=b$1(Je/t);if(T==="leftMargin"){let se=Z-y-720,z=Math.round(Math.max(0,Math.min(Ze,se)));A(z),n?.(z);}else if(T==="rightMargin"){let se=Z-Ze,z=Z-K-720,ee=Math.round(Math.max(0,Math.min(se,z)));A(ee),r?.(ee);}else if(T==="firstLineIndent"){let se=K+c,z=Ze-se,ee=D-c-p-720,Re=Math.round(Math.max(-c,Math.min(z,ee)));A(Re),a?.(Re);}else if(T==="leftIndent"){let se=Ze-K,z=D-p-720,ee=Math.round(Math.max(0,Math.min(se,z)));A(ee),l?.(ee);}else if(T==="rightIndent"){let z=Z-y-Ze,ee=D-c-720,Re=Math.round(Math.max(0,Math.min(z,ee)));A(Re),f?.(Re);}},[T,t,Z,K,y,D,c,p,n,r,a,l,f]),le=useCallback(()=>{I(null),A(null),ie(null);},[]);useEffect(()=>{if(T)return document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",le);}},[T,Ve,le]);let wt=_a(Z,t,m);return jsxs("div",{ref:me,className:`docx-horizontal-ruler ${v}`,style:{position:"relative",width:k(C),height:At,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:T?"ew-resize":"default",...g},role:"slider","aria-label":"Horizontal ruler","aria-valuemin":0,"aria-valuemax":Z,children:[jsx("div",{style:{position:"absolute",top:0,left:0,width:k(Y),height:At,backgroundColor:jo,borderRight:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?_=>Pe(_,"leftMargin"):void 0}),jsx("div",{style:{position:"absolute",top:0,right:0,width:k(Ie),height:At,backgroundColor:jo,borderLeft:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?_=>Pe(_,"rightMargin"):void 0}),jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:wt.map((_,Me)=>jsx(La,{tick:_},Me))}),u&&jsx(Ft,{direction:"down",positionPx:Ct,editable:o,isDragging:T==="firstLineIndent",isHovered:L==="firstLineIndent",onMouseEnter:()=>M("firstLineIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"firstLineIndent"),label:"First line indent"}),o&&l&&jsx(Ft,{direction:"up",positionPx:yt,editable:o,isDragging:T==="leftIndent",isHovered:L==="leftIndent",onMouseEnter:()=>M("leftIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"leftIndent"),label:"Left indent"}),o&&f&&jsx(Ft,{direction:"down",positionPx:St,editable:o,isDragging:T==="rightIndent",isHovered:L==="rightIndent",onMouseEnter:()=>M("rightIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"rightIndent"),label:"Right indent"}),x?.map(_=>jsx(qa,{tabStop:_,positionPx:a$1(_.position)*t,onDoubleClick:()=>P?.(_.position)},_.position)),T&&O!==null&&Te!==null&&jsx(ka,{value:Ra(O,m),positionPx:Te})]})}function La({tick:e}){return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",left:k(e.position),bottom:0,width:1,height:e.height,backgroundColor:Ia}}),e.label&&jsx("div",{style:{position:"absolute",left:k(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:wa,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Ft({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:r,onMouseEnter:a,onMouseLeave:u,onMouseDown:d,label:s}){let c=n?Za:r?Ma:Pa,p=Math.round(_e*1.6),l={position:"absolute",left:k(t-_e),width:_e*2,height:p+2,cursor:o?"ew-resize":"default",zIndex:n?10:4,...e==="down"?{top:0}:{bottom:0}},f=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderTop:`${p}px solid ${c}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderBottom:`${p}px solid ${c}`,transition:"border-bottom-color 0.1s"};return jsx("div",{className:"docx-ruler-indent",style:l,onMouseEnter:a,onMouseLeave:u,onMouseDown:d,role:"slider","aria-label":s,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsx("div",{style:f})})}function ka({value:e,positionPx:t}){return jsx("div",{style:{position:"absolute",left:k(t),top:-22,transform:"translateX(-50%)",backgroundColor:"#333",color:"#fff",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var Ha={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function qa({tabStop:e,positionPx:t,onDoubleClick:o}){return jsx("div",{style:{position:"absolute",left:k(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"#555",cursor:"pointer",userSelect:"none"},onDoubleClick:n=>{n.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:Ha[e.alignment]||"L"})}function _a(e,t,o){let n=[];if(o==="inch"){let r=bt/8,a=Math.ceil(e/r);for(let u=0;u<=a;u++){let d=u*r;if(d>e)break;let s=a$1(d)*t;u%8===0?n.push({position:s,height:10,label:u/8>0?String(u/8):void 0}):u%4===0?n.push({position:s,height:6}):u%2===0?n.push({position:s,height:4}):n.push({position:s,height:2});}}else {let r=gt/10,a=Math.ceil(e/r);for(let u=0;u<=a;u++){let d=u*r;if(d>e)break;let s=a$1(d)*t;u%10===0?n.push({position:s,height:10,label:u/10>0?String(u/10):void 0}):u%5===0?n.push({position:s,height:6}):n.push({position:s,height:3});}}return n}function ac(e,t,o,n){let r=b$1(e/n);return t==="left"?Math.max(0,r):Math.max(0,b$1(o/n)-r)}function lc(e,t=1){let o=e?.pageWidth??Xo,n=e?.marginLeft??vt,r=e?.marginRight??vt,a=a$1(o)*t,u=a$1(n)*t,d=a$1(r)*t;return {width:a,leftMargin:u,rightMargin:d,contentWidth:a-u-d}}function sc(e,t){return t==="inch"?(e/bt).toFixed(2)+'"':(e/gt).toFixed(1)+" cm"}function cc(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?bt:gt))}var xe=16;function Na(){return jsx(b,{name:"table_rows",size:xe,style:{transform:"scaleY(-1)"}})}function Aa(){return jsx(b,{name:"table_rows",size:xe})}function Fa(){return jsx(b,{name:"view_column",size:xe,style:{transform:"scaleX(-1)"}})}function Ba(){return jsx(b,{name:"view_column",size:xe})}function Oa(){return jsx(b,{name:"delete_sweep",size:xe})}function za(){return jsx(b,{name:"delete_sweep",size:xe,style:{transform:"rotate(90deg)"}})}function Va(){return jsx(b,{name:"call_merge",size:xe})}function Wa(){return jsx(b,{name:"call_split",size:xe})}function $a(){return jsx(b,{name:"delete",size:xe,className:"text-red-600"})}var re={container:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",border:"1px solid var(--doc-border)",fontSize:"12px"},containerCompact:{padding:"2px 4px",gap:"2px"},containerFloating:{position:"absolute",zIndex:1e3,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},group:{display:"flex",alignItems:"center",gap:"2px"},separator:{width:"1px",height:"20px",backgroundColor:"var(--doc-border-dark)",margin:"0 4px"},button:{display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 8px",border:"none",borderRadius:"3px",backgroundColor:"transparent",color:"var(--doc-text)",cursor:"pointer",fontSize:"12px",lineHeight:"1",transition:"background-color 0.15s, color 0.15s"},buttonCompact:{padding:"3px 5px"},buttonHover:{backgroundColor:"var(--doc-border)"},buttonDisabled:{color:"var(--doc-text-subtle)",cursor:"not-allowed"},buttonDelete:{color:"var(--doc-error)"},label:{fontSize:"11px",fontWeight:500,color:"var(--doc-text-muted)",marginRight:"8px",whiteSpace:"nowrap"}};function ge({action:e,label:t,icon:o,disabled:n=false,onClick:r,showLabel:a=false,compact:u=false,shortcut:d}){let[s,c]=X__default.useState(false),p=typeof e=="string"&&e.startsWith("delete"),l={...re.button,...u?re.buttonCompact:{},...s&&!n?re.buttonHover:{},...n?re.buttonDisabled:{},...p&&!n?re.buttonDelete:{}},f=d?`${t} (${d})`:t;return jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:l,disabled:n,onClick:r,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),title:f,"aria-label":t,children:[o,a&&jsx("span",{children:t})]})}function Bt({children:e,showSeparator:t=true}){return jsxs(Fragment,{children:[jsx("div",{style:re.group,children:e}),t&&jsx("div",{style:re.separator})]})}function hc({context:e,onAction:t,disabled:o=false,className:n,style:r,showLabels:a=false,compact:u=false,position:d="top",children:s}){if(!e)return null;let c=x=>{!o&&t&&e&&t(x,e);},p=e.rowCount>1,l=e.columnCount>1,f=e.hasMultiCellSelection,m=e.canSplitCell,v={...re.container,...u?re.containerCompact:{},...d==="floating"?re.containerFloating:{},...r},g=["docx-table-toolbar"];return n&&g.push(n),u&&g.push("docx-table-toolbar-compact"),d==="floating"&&g.push("docx-table-toolbar-floating"),jsxs("div",{className:g.join(" "),style:v,role:"toolbar","aria-label":"Table editing tools",children:[jsx("span",{style:re.label,children:"Table:"}),jsxs(Bt,{children:[jsx(ge,{action:"addRowAbove",label:"Insert Row Above",icon:jsx(Na,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:a,compact:u}),jsx(ge,{action:"addRowBelow",label:"Insert Row Below",icon:jsx(Aa,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:a,compact:u}),jsx(ge,{action:"deleteRow",label:"Delete Row",icon:jsx(Oa,{}),disabled:o||!p,onClick:()=>c("deleteRow"),showLabel:a,compact:u})]}),jsxs(Bt,{children:[jsx(ge,{action:"addColumnLeft",label:"Insert Column Left",icon:jsx(Fa,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:a,compact:u}),jsx(ge,{action:"addColumnRight",label:"Insert Column Right",icon:jsx(Ba,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:a,compact:u}),jsx(ge,{action:"deleteColumn",label:"Delete Column",icon:jsx(za,{}),disabled:o||!l,onClick:()=>c("deleteColumn"),showLabel:a,compact:u})]}),jsxs(Bt,{showSeparator:false,children:[jsx(ge,{action:"mergeCells",label:"Merge Cells",icon:jsx(Va,{}),disabled:o||!f,onClick:()=>c("mergeCells"),showLabel:a,compact:u}),jsx(ge,{action:"splitCell",label:"Split Cell",icon:jsx(Wa,{}),disabled:o||!m,onClick:()=>c("splitCell"),showLabel:a,compact:u}),jsx(ge,{action:"deleteTable",label:"Delete Table",icon:jsx($a,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:a,compact:u})]}),s]})}function fc(e,t){let o=e.rows.length,n=Ot(e),r=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),a=Qo(e,t.rowIndex,t.columnIndex),u=!!(a&&((a.formatting?.gridSpan??1)>1||a.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:r,canSplitCell:u,rowCount:o,columnCount:n}}function Ot(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let r of o.cells)n+=r.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function Qo(e,t,o){let n=e.rows[t];if(!n)return null;let r=0;for(let a of n.cells){let u=a.formatting?.gridSpan??1;if(o>=r&&o<r+u)return a;r+=u;}return null}function Ga(e,t){let o=[],n=0;for(let r of e.cells){let a=r.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...r.formatting,vMerge:void 0}}),n+=a;}for(;n<t;)o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}),n++;return {type:"tableRow",cells:o,formatting:{...e.formatting,header:false}}}function Ua(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function vc(e,t,o="after"){let n=[...e.rows],r=o==="before"?t:t+1,a=e.rows[t]||e.rows[0],u=Ot(e),d=Ga(a,u);return n.splice(r,0,d),{...e,rows:n}}function bc(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,r)=>r!==t);return {...e,rows:o}}function gc(e,t,o="after"){let n=o==="before"?t:t+1,r=e.rows.map(u=>{let d=[...u.cells],s=0,c=0;for(let p=0;p<u.cells.length;p++){let f=u.cells[p].formatting?.gridSpan??1;if(n<=s+f){c=o==="before"?p:p+1;break}s+=f,c=p+1;}return d.splice(c,0,Ua()),{...u,cells:d}}),a=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){a=[...e.columnWidths];let u=e.columnWidths[t]||e.columnWidths[0]||1440;a.splice(n,0,u);}return {...e,rows:r,columnWidths:a}}function xc(e,t){if(Ot(e)<=1)return e;let n=e.rows.map(a=>{let u=0,d=[];for(let s of a.cells){let c=s.formatting?.gridSpan??1;t>=u&&t<u+c?c>1&&d.push({...s,formatting:{...s.formatting,gridSpan:c-1}}):d.push(s),u+=c;}return {...a,cells:d}}),r=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(r=e.columnWidths.filter((a,u)=>u!==t)),{...e,rows:n,columnWidths:r}}function Tc(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:r,endCol:a}=t.selectedCells,u=r-o+1,d=a-n+1,s=e.rows.map((c,p)=>{if(p<o||p>r)return c;let l=[],f=0;for(let m of c.cells){let v=m.formatting?.gridSpan??1,g=f+v-1;f<=a&&g>=n?p===o&&f===n?l.push({...m,formatting:{...m.formatting,gridSpan:d,vMerge:u>1?"restart":void 0}}):p>o&&f===n&&l.push({...m,formatting:{...m.formatting,gridSpan:d,vMerge:"continue"}}):l.push(m),f+=v;}return {...c,cells:l}});return {...e,rows:s}}function yc(e,t,o){let n=Qo(e,t,o);if(!n)return e;let r=n.formatting?.gridSpan??1,a=n.formatting?.vMerge==="restart";if(r<=1&&!a)return e;let u=e.rows.map((d,s)=>{if(s!==t&&!a)return d;let c=[],p=0;for(let l of d.cells){let f=l.formatting?.gridSpan??1;if(p===o||p<=o&&o<p+f)if(r>1)for(let m=0;m<r;m++)c.push({type:"tableCell",content:m===0?l.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,gridSpan:void 0,vMerge:void 0}});else a&&s===t?c.push({...l,formatting:{...l.formatting,vMerge:void 0}}):l.formatting?.vMerge==="continue"?c.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,vMerge:void 0}}):c.push(l);else c.push(l);p+=f;}return {...d,cells:c}});return {...e,rows:u}}var wc="application/x-docx-editor",U={HTML:"text/html",PLAIN:"text/plain"};async function en(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=zt(e,o);return await xt(r)}catch(r){return n?.(r),false}}async function Ic(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=Ya(e,o);return await xt(r)}catch(r){return n?.(r),false}}function zt(e,t=true){let o=e.map($t).join(""),n=t?an(e):Gt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}function Ya(e,t=true){let o=e.map(nl).join(`
|
|
2
|
+
`),n=t?rl(e):Gt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}async function xt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[U.PLAIN]:new Blob([e.plainText],{type:U.PLAIN}),[U.HTML]:new Blob([e.html],{type:U.HTML})})];return await navigator.clipboard.write(t),!0}return tn(e)}catch{return tn(e)}}function tn(e){let t=document.createElement("div");t.innerHTML=e.html,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t);try{let o=window.getSelection();if(!o)return !1;let n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n);let r=document.execCommand("copy");return o.removeAllRanges(),r}finally{document.body.removeChild(t);}}async function Pc(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await ja(n,t)}return null}catch(n){return o?.(n),null}}async function ja(e,t){let o="",n="";for(let r of e)r.types.includes(U.HTML)&&(o=await(await r.getType(U.HTML)).text()),r.types.includes(U.PLAIN)&&(n=await(await r.getType(U.PLAIN)).text());return rn(o,n,t)}function Xa(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let r=n.getData(U.HTML),a=n.getData(U.PLAIN);return rn(r,a,o)}function rn(e,t,o=true){let n=Ja(e),r=Qa(e);if(r){let d=e.match(/data-docx-editor-content="([^"]+)"/);if(d)try{return {runs:JSON.parse(decodeURIComponent(d[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let a=e;return n&&o&&(a=el(e)),{runs:tl(a,t),fromWord:n,fromEditor:r,plainText:t}}function Ja(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function Qa(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function el(e){let t=e;return t=t.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),t=t.replace(/<!--[\s\S]*?-->/g,""),t=t.replace(/<\?xml[^>]*>/gi,""),t=t.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),t=t.replace(/<o:[^>]*\/>/gi,""),t=t.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),t=t.replace(/<w:[^>]*\/>/gi,""),t=t.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),t=t.replace(/\s*style="\s*"/gi,""),t=t.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/gi,""),t=t.replace(/<\/?font[^>]*>/gi,""),t=t.replace(/\s+/g," ").trim(),t}function tl(e,t){if(!e||e.trim()==="")return t?[Wt(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Vt(o,n,{}),n.length===0&&t?[Wt(t)]:n}function Vt(e,t,o){if(e.nodeType===Node.TEXT_NODE){let u=e.textContent||"";(u.trim()||u.includes(" "))&&t.push(Wt(u,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase(),a={...o,...ol(n)};switch(r){case "br":t.push(nn(a));return;case "p":case "div":for(let u of n.childNodes)Vt(u,t,a);n.nextSibling&&t.push(nn(a));return;case "b":case "strong":a.bold=true;break;case "i":case "em":a.italic=true;break;case "u":a.underline={style:"single"};break;case "s":case "strike":case "del":a.strike=true;break;case "sup":a.vertAlign="superscript";break;case "sub":a.vertAlign="subscript";break;case "code":case "pre":a.fontFamily={ascii:"Courier New"};break}for(let u of n.childNodes)Vt(u,t,a);}function ol(e){let t={},o=e.style;(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(t.bold=true),o.fontStyle==="italic"&&(t.italic=true);let n=o.textDecoration||o.textDecorationLine;if(n&&(n.includes("underline")&&(t.underline={style:"single"}),n.includes("line-through")&&(t.strike=true)),o.fontSize){let r=parseFloat(o.fontSize);isNaN(r)||(t.fontSize=Math.round(r/1.333*2));}if(o.fontFamily){let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(t.fontFamily={ascii:r});}if(o.color){let r=on(o.color);r&&(t.color={rgb:r});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let r=on(o.backgroundColor);r&&(t.shading={fill:{rgb:r}});}return t}function on(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let o=parseInt(t[1]).toString(16).padStart(2,"0"),n=parseInt(t[2]).toString(16).padStart(2,"0"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+r).toUpperCase()}return null}function $t(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
|
|
3
|
+
`:"").join("")}function nl(e){return (e.content||[]).map(t=>t.type==="run"?$t(t):"").join("")}function an(e){return e.map(il).join("")}function rl(e){return e.map(t=>`<p>${an(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function il(e){let t=$t(e);if(!t)return "";let o=Gt(t),n=e.formatting;if(!n)return o;n.bold&&(o=`<strong>${o}</strong>`),n.italic&&(o=`<em>${o}</em>`),n.underline&&(o=`<u>${o}</u>`),n.strike&&(o=`<s>${o}</s>`),n.vertAlign==="superscript"&&(o=`<sup>${o}</sup>`),n.vertAlign==="subscript"&&(o=`<sub>${o}</sub>`);let r=[];if(n.fontSize){let a=n.fontSize/2;r.push(`font-size: ${a}pt`);}return n.fontFamily?.ascii&&r.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&r.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&r.push(`background-color: #${n.shading.fill.rgb}`),r.length>0&&(o=`<span style="${r.join("; ")}">${o}</span>`),o}function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Wt(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function nn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function Mc(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:r={}}=e;return {handleCopy:async c=>{if(!t)return;let p=t();if(!p)return;c.preventDefault();let l=zt(p.runs);c.clipboardData?(c.clipboardData.setData(U.PLAIN,l.plainText),c.clipboardData.setData(U.HTML,l.html)):await xt(l);},handleCut:async c=>{if(!o)return;let p=o();if(!p)return;c.preventDefault();let l=zt(p.runs);c.clipboardData?(c.clipboardData.setData(U.PLAIN,l.plainText),c.clipboardData.setData(U.HTML,l.html)):await xt(l);},handlePaste:c=>{if(!n)return;c.preventDefault();let p=Xa(c,r);p&&n(p);},handleKeyDown:async c=>{let p=c.ctrlKey||c.metaKey;if(p&&c.key==="c"&&!c.shiftKey&&t){let l=t();l&&await en(l.runs,r);}if(p&&c.key==="x"&&!c.shiftKey&&o){let l=o();l&&await en(l.runs,r);}}}}export{Xa as $,Q as A,oe as B,Ps as C,Ms as D,ic as E,ac as F,lc as G,sc as H,cc as I,hc as J,fc as K,Ot as L,Qo as M,vc as N,bc as O,gc as P,xc as Q,Tc as R,yc as S,wc as T,U,en as V,Ic as W,zt as X,Ya as Y,xt as Z,Pc as _,w as a,rn as aa,W as b,Ja as ba,J as c,Qa as ca,b as d,el as da,mt as e,tl as ea,Ko as f,Mc as fa,Jt as g,G as h,ql as i,so as j,ke as k,go as l,To as m,yo as n,Co as o,Io as p,Po as q,Ro as r,Lo as s,Ho as t,qo as u,No as v,Dt as w,ks as x,Yo as y,vs as z};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';var chunkIA4LPH2A_cjs=require('./chunk-IA4LPH2A.cjs'),chunkKR32M3S4_cjs=require('./chunk-KR32M3S4.cjs'),X=require('react'),H=require('@radix-ui/react-select'),clsx=require('clsx'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var X__namespace=/*#__PURE__*/_interopNamespace(X);var H__namespace=/*#__PURE__*/_interopNamespace(H);function w(...e){return clsx.clsx(e)}var ye=H__namespace.Root,Ee=H__namespace.Group,et=H__namespace.Value;function Se({className:e,children:t,onMouseDown:o,...n}){return jsxRuntime.jsxs(H__namespace.Trigger,{className:w("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-slate-700 bg-transparent","hover:bg-slate-100/80 focus:outline-none focus:bg-slate-100/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[t,jsxRuntime.jsx(H__namespace.Icon,{asChild:true,children:jsxRuntime.jsx(pn,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function Ce({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...r}){return jsxRuntime.jsx(H__namespace.Portal,{children:jsxRuntime.jsx("div",{className:"ep-root",children:jsxRuntime.jsx(H__namespace.Content,{className:w("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-slate-200 bg-white 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:a=>{a.preventDefault(),n?.(a);},...r,children:jsxRuntime.jsx(H__namespace.Viewport,{className:w("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:a=>a.preventDefault(),children:t})})})})}function De({className:e,...t}){return jsxRuntime.jsx(H__namespace.Label,{className:w("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function ce({className:e,children:t,onMouseDown:o,...n}){return jsxRuntime.jsxs(H__namespace.Item,{className:w("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-slate-700 outline-none","hover:bg-slate-100 focus:bg-slate-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[jsxRuntime.jsx(H__namespace.ItemText,{children:t}),jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(H__namespace.ItemIndicator,{children:jsxRuntime.jsx(dn,{className:"h-4 w-4"})})})]})}function Ge({className:e,...t}){return jsxRuntime.jsx(H__namespace.Separator,{className:w("-mx-1 my-1 h-px bg-slate-100",e),...t})}function pn({className:e}){return jsxRuntime.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsxRuntime.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 dn({className:e}){return jsxRuntime.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsxRuntime.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"})})}var mn=[{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 Jt({value:e,onChange:t,fonts:o=mn,disabled:n=false,className:r,placeholder:a="Arial",width:u=120,showPreview:d=true}){let s=X__namespace.useMemo(()=>e?o.find(f=>f.fontFamily===e||f.name.toLowerCase()===e.toLowerCase())?.name||e:a,[e,o,a]),c=X__namespace.useCallback(l=>{let f=o.find(m=>m.name===l);f&&t?.(f.fontFamily);},[t,o]),p=X__namespace.useMemo(()=>{let l={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(f=>{let m=f.category||"other";l[m].push(f);}),l},[o]);return jsxRuntime.jsxs(ye,{value:s,onValueChange:c,disabled:n,children:[jsxRuntime.jsx(Se,{className:w("h-8 text-sm",r),style:{minWidth:typeof u=="number"?`${u}px`:u},"aria-label":"Select font family",children:jsxRuntime.jsx(et,{placeholder:a,children:s})}),jsxRuntime.jsxs(Ce,{className:"max-h-[300px]",children:[p["sans-serif"].length>0&&jsxRuntime.jsxs(Ee,{children:[jsxRuntime.jsx(De,{children:"Sans Serif"}),p["sans-serif"].map(l=>jsxRuntime.jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]}),p.serif.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{}),jsxRuntime.jsxs(Ee,{children:[jsxRuntime.jsx(De,{children:"Serif"}),p.serif.map(l=>jsxRuntime.jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]}),p.monospace.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{}),jsxRuntime.jsxs(Ee,{children:[jsxRuntime.jsx(De,{children:"Monospace"}),p.monospace.map(l=>jsxRuntime.jsx(ce,{value:l.name,style:d?{fontFamily:l.fontFamily}:void 0,children:l.name},l.name))]})]})]})]})}var Qt=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eo=clsx.clsx,to=(e,t)=>o=>{var n;if(t?.variants==null)return eo(e,o?.class,o?.className);let{variants:r,defaultVariants:a}=t,u=Object.keys(r).map(c=>{let p=o?.[c],l=a?.[c];if(p===null)return null;let f=Qt(p)||Qt(l);return r[c][f]}),d=o&&Object.entries(o).reduce((c,p)=>{let[l,f]=p;return f===void 0||(c[l]=f),c},{}),s=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,p)=>{let{class:l,className:f,...m}=p;return Object.entries(m).every(v=>{let[g,x]=v;return Array.isArray(x)?x.includes({...a,...d}[g]):{...a,...d}[g]===x})?[...c,l,f]:c},[]);return eo(e,u,s,o?.class,o?.className)};var fn=to("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"}}),W=X__namespace.forwardRef(({className:e,variant:t,size:o,...n},r)=>jsxRuntime.jsx("button",{className:w(fn({variant:t,size:o,className:e})),ref:r,...n}));W.displayName="Button";function h({size:e=20,className:t="",style:o,children:n}){return jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 -960 960 960",fill:"currentColor",className:t,style:{display:"inline-flex",flexShrink:0,...o},"aria-hidden":"true",children:n})}function bn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})})}function gn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"})})}function xn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"})})}function Tn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"})})}function yn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function Sn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"})})}function Cn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"})})}function wn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})})}function In(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})})}function Pn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"})})}function Mn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function Zn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function Rn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function Ln(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function kn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function It(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"})})}function Hn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"})})}function qn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"})})}function _n(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function En(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function Dn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function Nn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"})})}function An(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"})})}function Fn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function Bn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"})})}function On(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"})})}function zn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"})})}function Vn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})})}function Wn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"})})}function $n(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function Gn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"})})}function Un(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"})})}function Kn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Yn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function jn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function Xn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"})})}function Jn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"})})}function Qn(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"})})}function er(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function tr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"})})}function or(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"})})}function nr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function rr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function ir(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function ar(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function lr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function sr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"})})}function cr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function ur(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"})})}function pr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"})})}function dr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"})})}function mr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"})})}function hr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"})})}function fr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"})})}function vr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function br(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function gr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function xr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Tr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function yr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"})})}function Sr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"})})}function Cr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"})})}function wr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"})})}function Ir(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"})})}function Pr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Mr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"})})}function Zr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"})})}function Rr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"})})}function Lr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function kr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"})})}function Hr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function qr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function _r(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function Er(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function Dr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function Nr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function Ar(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"})})}function Fr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"})})}function Br(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}function Or(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})})}function zr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})})}function Vr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Wr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function $r(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"})})}function Gr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Ur(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"})})}function Kr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"})})}function Yr(e){return jsxRuntime.jsx(h,{...e,children:jsxRuntime.jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"})})}var jr={undo:bn,redo:gn,print:xn,format_bold:Tn,format_italic:yn,format_underlined:Sn,strikethrough_s:Cn,superscript:wn,subscript:In,link:Pn,format_clear:Mn,format_align_left:Zn,format_align_center:Rn,format_align_right:Ln,format_align_justify:kn,format_line_spacing:It,format_list_bulleted:Hn,format_list_numbered:qn,format_indent_increase:_n,format_indent_decrease:En,format_color_text:Dn,ink_highlighter:Nn,format_color_reset:An,arrow_drop_down:Fn,table:Bn,table_chart:On,grid_on:zn,table_rows:Vn,view_column:Wn,border_all:$n,border_outer:Gn,border_inner:Un,border_clear:Kn,add:Yn,remove:jn,delete:Xn,delete_sweep:Jn,call_merge:Qn,call_split:er,drag_indicator:tr,image:or,format_image_left:nr,format_image_right:rr,horizontal_rule:ir,flip_to_back:ar,flip_to_front:lr,open_with:sr,tune:cr,rotate_right:ur,rotate_left:pr,swap_horiz:dr,swap_vert:mr,shapes:hr,format_paint:fr,expand_more:vr,expand_less:br,border_top:gr,border_bottom:xr,border_left:Tr,border_right:yr,padding:Sr,text_rotation_none:Cr,wrap_text:wr,height:Ir,fit_width:Pr,settings:Mr,border_color:Zr,format_color_fill:Rr,vertical_align_top:Lr,vertical_align_center:kr,vertical_align_bottom:Hr,line_weight:qr,keyboard_arrow_up:_r,keyboard_arrow_down:Er,keyboard_arrow_left:Dr,keyboard_arrow_right:Nr,more_vert:Ar,page_break:Fr,arrow_back:Br,check:Or,close:zr,add_comment:Vr,comment:Wr,edit_note:$r,rate_review:Gr,visibility:Ur,format_textdirection_l_to_r:Kr,format_textdirection_r_to_l:Yr};function b({name:e,size:t=20,className:o="",style:n}){let r=jr[e];return r?jsxRuntime.jsx(r,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsxRuntime.jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function G({isOpen:e,onClose:t,align:o="left"}){let n=X.useRef(null),r=X.useRef(null),[a,u]=X.useState({top:0,left:0});X.useEffect(()=>{if(!e||!n.current)return;let c=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(r.current){let p=r.current.getBoundingClientRect();u({top:c.bottom+4,left:c.right-p.width});}else u({top:c.bottom+4,left:c.left});}):u({top:c.bottom+4,left:c.left});},[e,o]),X.useEffect(()=>{if(!e)return;let c=f=>{let m=f.target;n.current&&!n.current.contains(m)&&r.current&&!r.current.contains(m)&&t();},p=f=>{f.key==="Escape"&&t();},l=()=>t();return document.addEventListener("mousedown",c),document.addEventListener("keydown",p),window.addEventListener("scroll",l,true),()=>{document.removeEventListener("mousedown",c),document.removeEventListener("keydown",p),window.removeEventListener("scroll",l,true);}},[e,t]);let d=X.useCallback(c=>{c.preventDefault(),c.stopPropagation();},[]),s={position:"fixed",top:a.top,left:a.left,zIndex:1e4};return {containerRef:n,dropdownRef:r,dropdownStyle:s,handleMouseDown:d}}var ei=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],ti=1,oi=400;function lo(e){return e/2}function ql(e){return e*2}function io(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function ao(e,t,o){for(let n=t.length-1;n>=0;n--)if(t[n]<e)return t[n];return Math.max(e-1,o)}function so({value:e,onChange:t,sizes:o=ei,disabled:n=false,className:r,placeholder:a="11",minSize:u=ti,maxSize:d=oi}){let[s,c]=X.useState(false),[p,l]=X.useState(""),[f,m]=X.useState(false),v=X.useRef(null),g=X.useCallback(()=>{m(false),c(false);},[]),{containerRef:x,dropdownRef:P,dropdownStyle:T}=G({isOpen:f,onClose:g}),I=e??(parseInt(a,10)||11),L=e!==void 0?e.toString():a,M=X.useCallback(y=>{if(y.preventDefault(),n)return;let D=ao(I,o,u);t?.(D);},[I,o,u,n,t]),O=X.useCallback(y=>{if(y.preventDefault(),n)return;let D=io(I,o,d);t?.(D);},[I,o,d,n,t]),A=X.useCallback(y=>{y.preventDefault(),!n&&(c(true),l(L),m(true),requestAnimationFrame(()=>{v.current?.focus(),v.current?.select();}));},[n,L]),Te=X.useCallback(y=>{l(y.target.value);},[]),ie=X.useCallback(()=>{c(false);let y=parseFloat(p);if(!isNaN(y)&&y>=u&&y<=d){let D=Math.round(y*2)/2;t?.(D);}},[p,u,d,t]),me=X.useCallback(y=>{if(y.key==="Enter")y.preventDefault(),ie(),m(false);else if(y.key==="Escape")c(false),m(false);else if(y.key==="ArrowUp"){y.preventDefault();let D=io(I,o,d);l(D.toString()),t?.(D);}else if(y.key==="ArrowDown"){y.preventDefault();let D=ao(I,o,u);l(D.toString()),t?.(D);}},[ie,I,o,d,u,t]),Z=X.useCallback(y=>{t?.(y),m(false),c(false);},[t]),K=X.useCallback(y=>{y.target.tagName!=="INPUT"&&y.preventDefault();},[]);return jsxRuntime.jsxs("div",{ref:x,className:w("flex items-center",r),onMouseDown:K,children:[jsxRuntime.jsx(W,{variant:"ghost",size:"icon-sm",className:w("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-r-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:M,disabled:n||I<=u,"aria-label":"Decrease font size","data-testid":"font-size-decrease",children:jsxRuntime.jsx(b,{name:"remove",size:18})}),jsxRuntime.jsx("div",{className:"relative",children:s?jsxRuntime.jsx("input",{ref:v,type:"text",value:p,onChange:Te,onBlur:ie,onKeyDown:me,className:w("h-7 w-10 text-center text-sm border border-slate-300 bg-white","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none"),"aria-label":"Font size","data-testid":"font-size-input"}):jsxRuntime.jsx("button",{type:"button",onClick:A,className:w("h-7 w-10 text-center text-sm border border-slate-200 bg-white","hover:border-slate-300 hover:bg-slate-50","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none",n&&"opacity-50 cursor-not-allowed"),disabled:n,"aria-label":"Font size","aria-haspopup":"listbox","aria-expanded":f,"data-testid":"font-size-display",children:L})}),f&&jsxRuntime.jsx("div",{ref:P,style:{...T,backgroundColor:"white",border:"1px solid #e2e8f0",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":"Font sizes",children:o.map(y=>jsxRuntime.jsx("button",{type:"button",onClick:()=>Z(y),className:w("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",y===I&&"bg-slate-100 font-medium"),role:"option","aria-selected":y===I,children:y},y))}),jsxRuntime.jsx(W,{variant:"ghost",size:"icon-sm",className:w("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-l-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:O,disabled:n||I>=d,"aria-label":"Increase font size","data-testid":"font-size-increase",children:jsxRuntime.jsx(b,{name:"add",size:18})})]})}var ii=[{name:"Dark Red",hex:"C00000"},{name:"Red",hex:"FF0000"},{name:"Orange",hex:"FFC000"},{name:"Yellow",hex:"FFFF00"},{name:"Light Green",hex:"92D050"},{name:"Green",hex:"00B050"},{name:"Light Blue",hex:"00B0F0"},{name:"Blue",hex:"0070C0"},{name:"Dark Blue",hex:"002060"},{name:"Purple",hex:"7030A0"}],tt=18,ai=2,li={position:"relative",display:"inline-block"},si={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)"},ci={padding:"10px",backgroundColor:"#fff",border:"1px solid #d0d0d0",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.15)",width:"auto"},Mt={fontSize:"11px",color:"#666",marginBottom:"4px",fontWeight:500},Zt={height:"1px",backgroundColor:"#e0e0e0",margin:"8px 0"},po={display:"grid",gap:`${ai}px`},ot={width:`${tt}px`,height:`${tt}px`,border:"1px solid #c0c0c0",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},mo={...ot,transform:"scale(1.15)",borderColor:"#333",zIndex:1},ho={...ot,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},ui={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid #d0d0d0",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"12px",color:"#333"},pi={display:"flex",alignItems:"center",gap:"6px"},di={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},mi={height:"24px",padding:"0 10px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},hi={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"};function uo(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let n=chunkIA4LPH2A_cjs.b(e);return n||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return chunkIA4LPH2A_cjs.a(e,o)}function fi(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return (o*299+n*587+r*114)/1e3>230}function fo(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():chunkIA4LPH2A_cjs.a(e,o).replace(/^#/,"").toUpperCase())===t.toUpperCase():false}function vi({matrix:e,selectedColor:t,theme:o,onSelect:n}){let[r,a]=X.useState(null);return jsxRuntime.jsx("div",{style:{...po,gridTemplateColumns:`repeat(10, ${tt}px)`},children:e.flatMap((u,d)=>u.map((s,c)=>{let p=`${d}-${c}`,l=r===p,f=fo(t,s.hex,o);return jsxRuntime.jsx("button",{type:"button",style:{...f?ho:l?mo:ot,backgroundColor:`#${s.hex}`},title:s.label,"aria-label":s.label,"aria-selected":f,onClick:()=>n(s),onMouseDown:m=>m.preventDefault(),onMouseEnter:()=>a(p),onMouseLeave:()=>a(null)},p)}))})}function bi({selectedColor:e,theme:t,onSelect:o}){let[n,r]=X.useState(null);return jsxRuntime.jsx("div",{style:{...po,gridTemplateColumns:`repeat(10, ${tt}px)`},children:ii.map((a,u)=>{let d=n===u,s=fo(e,a.hex,t);return jsxRuntime.jsx("button",{type:"button",style:{...s?ho:d?mo:ot,backgroundColor:`#${a.hex}`},title:a.name,"aria-label":a.name,"aria-selected":s,onClick:()=>o(a.hex),onMouseDown:c=>c.preventDefault(),onMouseEnter:()=>r(u),onMouseLeave:()=>r(null)},a.hex)})})}function ke({mode:e,value:t,onChange:o,theme:n,disabled:r=false,className:a,style:u,title:d,icon:s,autoLabel:c}){let[p,l]=X.useState(false),[f,m]=X.useState(false),[v,g]=X.useState("");X.useEffect(()=>{let C=uo(t,e,n).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(C)&&g(C.toUpperCase());},[t,e,n]);let x=X.useCallback(()=>l(false),[]),{containerRef:P,dropdownRef:T,dropdownStyle:I}=G({isOpen:p,onClose:x}),L=n?.colorScheme??null,M=X.useMemo(()=>chunkIA4LPH2A_cjs.p(L),[L]),O=X.useMemo(()=>uo(t,e,n),[t,e,n]),A=X.useCallback(()=>{r||l(C=>!C);},[r]),Te=X.useCallback(C=>{if(e==="highlight")o?.(C.hex);else {let Y={themeColor:C.themeSlot,rgb:C.hex};C.tint&&(Y.themeTint=C.tint),C.shade&&(Y.themeShade=C.shade),o?.(Y);}l(false);},[e,o]),ie=X.useCallback(C=>{o?.(e==="highlight"?C:{rgb:C}),l(false);},[e,o]),me=X.useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),l(false);},[e,o]),Z=X.useCallback(()=>{let C=v.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(C)&&(o?.(e==="highlight"?C:{rgb:C}),l(false),g(""));},[e,v,o]),K={...si,...r?{cursor:"default",opacity:.38}:p?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:f?{backgroundColor:"var(--doc-bg-hover)"}:{}},y=e==="text"?"Font Color":e==="highlight"?"Text Highlight Color":"Border Color",D=s??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxRuntime.jsxs("div",{ref:P,className:`docx-advanced-color-picker ${a||""}`,style:{...li,...u},children:[jsxRuntime.jsxs("button",{type:"button",className:"docx-advanced-color-picker-button",style:K,onClick:A,onMouseDown:C=>C.preventDefault(),onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),disabled:r,title:d||y,"aria-label":d||y,"aria-haspopup":"true","aria-expanded":p,children:[jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsxRuntime.jsx(b,{name:D,size:18}),jsxRuntime.jsx("div",{style:{...hi,backgroundColor:O==="transparent"?"#fff":O,outline:O==="transparent"||fi(O)?"1px solid #bbb":"none"}})]}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14})]}),p&&jsxRuntime.jsx("div",{ref:T,className:"docx-advanced-color-picker-dropdown",style:{...I,...ci},role:"dialog","aria-label":`${y} picker`,onMouseDown:C=>{C.target.tagName!=="INPUT"&&C.preventDefault();},children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{type:"button",style:ui,onClick:me,onMouseDown:C=>C.preventDefault(),children:[e==="highlight"?jsxRuntime.jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",border:"1px solid #ccc",borderRadius:"2px",position:"relative",backgroundColor:"#fff"},children:jsxRuntime.jsx("span",{style:{position:"absolute",top:"50%",left:"-1px",right:"-1px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"}})}):jsxRuntime.jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",backgroundColor:"#000",borderRadius:"2px"}}),c??(e==="highlight"?"No Color":"Automatic")]}),jsxRuntime.jsx("div",{style:Zt}),jsxRuntime.jsx("div",{style:Mt,children:"Theme Colors"}),jsxRuntime.jsx(vi,{matrix:M,selectedColor:t,theme:n,onSelect:Te}),jsxRuntime.jsx("div",{style:Zt}),jsxRuntime.jsx("div",{style:Mt,children:"Standard Colors"}),jsxRuntime.jsx(bi,{selectedColor:t,theme:n,onSelect:ie}),jsxRuntime.jsx("div",{style:Zt}),jsxRuntime.jsx("div",{style:Mt,children:"Custom Color"}),jsxRuntime.jsxs("div",{style:pi,children:[jsxRuntime.jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsxRuntime.jsx("input",{type:"text",style:di,value:v,onChange:C=>g(C.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:C=>{C.key==="Enter"&&Z();},onMouseDown:C=>{C.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsxRuntime.jsx("button",{type:"button",style:{...mi,opacity:/^[0-9A-Fa-f]{6}$/.test(v)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(v)?"pointer":"default"},onClick:Z,onMouseDown:C=>C.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(v),children:"Apply"})]})]})})]})}function J({content:e,children:t,side:o="bottom",delayMs:n=400}){let[r,a]=X__namespace.useState(false),[u,d]=X__namespace.useState({x:0,y:0}),s=X__namespace.useRef(null),c=X__namespace.useRef(null),p=X__namespace.useCallback(()=>{c.current=setTimeout(()=>{if(s.current){let v=s.current.getBoundingClientRect(),g=v.left+v.width/2,x=o==="top"?v.top-8:v.bottom+8;d({x:g,y:x});}a(true);},n);},[n,o]),l=X__namespace.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),a(false);},[]);X__namespace.useEffect(()=>()=>{c.current&&clearTimeout(c.current);},[]);let f=t.props,m=X__namespace.cloneElement(t,{ref:s,onMouseEnter:v=>{p(),f.onMouseEnter?.(v);},onMouseLeave:v=>{l(),f.onMouseLeave?.(v);}});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[m,r&&jsxRuntime.jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg",style:{left:u.x,top:u.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var Ye=20,Rt=[{value:"left",label:"Align Left",icon:jsxRuntime.jsx(b,{name:"format_align_left",size:Ye}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",icon:jsxRuntime.jsx(b,{name:"format_align_center",size:Ye}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",icon:jsxRuntime.jsx(b,{name:"format_align_right",size:Ye}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",icon:jsxRuntime.jsx(b,{name:"format_align_justify",size:Ye}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function go({value:e="left",onChange:t,disabled:o=false}){let[n,r]=X.useState(false),a=X.useCallback(()=>r(false),[]),{containerRef:u,dropdownRef:d,dropdownStyle:s,handleMouseDown:c}=G({isOpen:n,onClose:a}),p=X.useCallback(m=>{o||t?.(m),r(false);},[o,t]),l=Rt.find(m=>m.value===e)||Rt[0],f=jsxRuntime.jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",o&&"opacity-30 cursor-not-allowed"),onMouseDown:c,onClick:()=>!o&&r(m=>!m),disabled:o,"aria-label":`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsxRuntime.jsx(b,{name:l.iconName,size:Ye}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:u,style:{position:"relative",display:"inline-block"},children:[n?f:jsxRuntime.jsx(J,{content:`${l.label}${l.shortcut?` (${l.shortcut})`:""}`,children:f}),n&&!o&&jsxRuntime.jsx("div",{ref:d,style:{...s,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:m=>m.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"flex",gap:2},children:Rt.map(m=>{let v=e===m.value;return jsxRuntime.jsx("button",{type:"button",title:`${m.label}${m.shortcut?` (${m.shortcut})`:""}`,"data-testid":`alignment-${m.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:g=>g.preventDefault(),onMouseEnter:g=>{v||(g.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:g=>{g.currentTarget.style.backgroundColor=v?"var(--doc-primary-light)":"transparent";},onClick:()=>p(m.value),children:jsxRuntime.jsx(b,{name:m.iconName,size:18})},m.value)})})})]})}var Ii={display:"inline-flex",alignItems:"center",gap:"4px"},xo={display:"inline-flex",alignItems:"center",gap:"4px"},at={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)"},Pi={...at,backgroundColor:"var(--doc-bg-hover)"},Mi={...at,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Zi={...at,cursor:"default",opacity:.38},Ri={width:"28px",height:"28px",padding:"2px"},Li={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},nt=20;function rt({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:a,style:u}){let[d,s]=X.useState(false),c={...t?Zi:e?Mi:d?Pi:at,...u},p=l=>{l.preventDefault();};return jsxRuntime.jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${a||""}`,style:c,onMouseDown:p,onClick:t?void 0:n,onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:r})}function To({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:r,disabled:a=false,className:u,style:d,showIndentButtons:s=true,compact:c=false,hasIndent:p=false}){let l=X.useCallback(()=>c?{...Ri}:{},[c]),f=e?.type==="bullet",m=e?.type==="numbered",g=(e?.isInList||f||m)&&(e?.level??0)>0||p;return jsxRuntime.jsxs("div",{className:`docx-list-buttons ${u||""}`,style:{...Ii,...d},role:"group","aria-label":"List formatting",children:[jsxRuntime.jsxs("div",{style:xo,role:"group","aria-label":"List type",children:[jsxRuntime.jsx(rt,{active:f,disabled:a,title:"Bullet List",onClick:t,style:l(),children:jsxRuntime.jsx(b,{name:"format_list_bulleted",size:nt})}),jsxRuntime.jsx(rt,{active:m,disabled:a,title:"Numbered List",onClick:o,style:l(),children:jsxRuntime.jsx(b,{name:"format_list_numbered",size:nt})})]}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:Li,role:"separator"}),jsxRuntime.jsxs("div",{style:xo,role:"group","aria-label":"List indentation",children:[jsxRuntime.jsx(rt,{active:false,disabled:a||!g,title:"Decrease Indent",onClick:r,style:l(),children:jsxRuntime.jsx(b,{name:"format_indent_decrease",size:nt})}),jsxRuntime.jsx(rt,{active:false,disabled:a,title:"Increase Indent",onClick:n,style:l(),children:jsxRuntime.jsx(b,{name:"format_indent_increase",size:nt})})]})]})]})}function yo(){return {type:"none",level:0,isInList:false}}var Hi=[{label:"Single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",value:2,twipsValue:480}];function Co({value:e,onChange:t,options:o=Hi,disabled:n=false,className:r}){let a=X__namespace.useMemo(()=>e===void 0?o[0]:o.find(d=>d.twipsValue===e)||o[0],[e,o]),u=X__namespace.useCallback(d=>{let s=parseInt(d,10);isNaN(s)||t?.(s);},[t]);return jsxRuntime.jsxs(ye,{value:a.twipsValue.toString(),onValueChange:u,disabled:n,children:[jsxRuntime.jsx(Se,{className:w("h-8 text-sm gap-0.5 px-2",r),style:{width:"auto"},title:`Line spacing: ${a.label}`,children:jsxRuntime.jsx(It,{className:"h-5 w-5 shrink-0"})}),jsxRuntime.jsxs(Ce,{children:[o.map(d=>jsxRuntime.jsx(ce,{value:d.twipsValue.toString(),children:d.label},d.twipsValue)),jsxRuntime.jsx(Ge,{}),jsxRuntime.jsx(Ee,{children:jsxRuntime.jsx(De,{children:"Paragraph spacing"})})]})]})}var wo=[{styleId:"Normal",name:"Normal text",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}],qi="#4a6c8c",_i={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function Ei(e){let t={},o=_i[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,r=Math.min(Math.max(n,11),20);t.fontSize=`${r}px`;}return t.lineHeight="1.3",e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color?t.color=`#${e.color}`:e.styleId.startsWith("Heading")&&(t.color=qi),t}function Io({value:e,onChange:t,styles:o,disabled:n=false,className:r,width:a=120}){let u=X__namespace.useMemo(()=>!o||o.length===0?wo:o.filter(l=>l.type==="paragraph").filter(l=>l.qFormat?true:!(l.hidden||l.semiHidden)).map(l=>{let f=wo.find(m=>m.styleId===l.styleId);return {styleId:l.styleId,name:l.name||l.styleId,type:l.type,isDefault:l.default,qFormat:l.qFormat,priority:l.uiPriority??99,fontSize:l.rPr?.fontSize??f?.fontSize,bold:l.rPr?.bold??f?.bold,italic:l.rPr?.italic??f?.italic,color:l.rPr?.color?.rgb??f?.color}}).sort((l,f)=>(l.priority??99)-(f.priority??99)),[o]),d=X__namespace.useCallback(p=>{t?.(p);},[t]),s=e||"Normal",c=u.find(p=>p.styleId===s)?.name||s;return jsxRuntime.jsxs(ye,{value:s,onValueChange:d,disabled:n,children:[jsxRuntime.jsx(Se,{className:w("h-8 text-sm",r),style:{width:typeof a=="number"?`${a}px`:a},"aria-label":"Select paragraph style",children:jsxRuntime.jsx("span",{className:"truncate",children:c})}),jsxRuntime.jsx(Ce,{className:"min-w-[260px] max-h-[400px]",children:u.map(p=>jsxRuntime.jsx(ce,{value:p.styleId,className:"py-2.5 px-3",children:jsxRuntime.jsx("span",{style:Ei(p),children:p.name})},p.styleId))})]})}var Ni=[{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 Po({value:e=1,onChange:t,levels:o=Ni,disabled:n=false,className:r,compact:a=false}){let u=X__namespace.useMemo(()=>{let s=o.find(c=>Math.abs(c.value-e)<.001);return s?s.label:`${Math.round(e*100)}%`},[o,e]),d=X__namespace.useCallback(s=>{let c=parseFloat(s);isNaN(c)||t?.(c);},[t]);return jsxRuntime.jsxs(ye,{value:e.toString(),onValueChange:d,disabled:n,children:[jsxRuntime.jsx(Se,{className:w(a?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",r),"aria-label":`Zoom: ${u}`,children:jsxRuntime.jsx(et,{placeholder:"100%",children:u})}),jsxRuntime.jsx(Ce,{children:o.map(s=>jsxRuntime.jsx(ce,{value:s.value.toString(),children:s.label},s.value))})]})}var Bi=[{action:"borderAll",icon:"border_all",label:"All borders"},{action:"borderOutside",icon:"border_outer",label:"Outside borders"},{action:"borderInside",icon:"border_inner",label:"Inside borders"},{action:"borderTop",icon:"border_top",label:"Top border"},{action:"borderBottom",icon:"border_bottom",label:"Bottom border"},{action:"borderLeft",icon:"border_left",label:"Left border"},{action:"borderRight",icon:"border_right",label:"Right border"},{action:"borderNone",icon:"border_clear",label:"No borders"}];function Ro({onAction:e,disabled:t=false}){let[o,n]=X.useState(false),r=X.useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:u,dropdownStyle:d,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=X.useCallback(l=>{e(l),n(false);},[e]),p=jsxRuntime.jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border style","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsxRuntime.jsx(b,{name:"border_all",size:20}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[o?p:jsxRuntime.jsx(J,{content:"Borders",children:p}),o&&!t&&jsxRuntime.jsx("div",{ref:u,style:{...d,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:l=>l.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:Bi.map(({action:l,icon:f,label:m})=>jsxRuntime.jsx("button",{type:"button",title: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:v=>v.preventDefault(),onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:jsxRuntime.jsx(b,{name:f,size:18})},typeof l=="string"?l:l.type))})})]})}function Lo({onAction:e,disabled:t=false,theme:o,value:n}){let r=X.useCallback(a=>{typeof a=="string"?e({type:"borderColor",color:a.replace(/^#/,"")}):a.rgb?e({type:"borderColor",color:a.rgb.replace(/^#/,"")}):a.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsxRuntime.jsx(ke,{mode:"border",value:n,onChange:r,theme:o,disabled:t,title:"Border Color"})}var Wi=[{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 Ho({onAction:e,disabled:t=false}){let[o,n]=X.useState(false),r=X.useCallback(()=>n(false),[]),{containerRef:a,dropdownRef:u,dropdownStyle:d,handleMouseDown:s}=G({isOpen:o,onClose:r}),c=X.useCallback(l=>{e({type:"borderWidth",size:l}),n(false);},[e]),p=jsxRuntime.jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:s,onClick:()=>!t&&n(l=>!l),disabled:t,"aria-label":"Border width","aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsxRuntime.jsx(b,{name:"line_weight",size:20}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[o?p:jsxRuntime.jsx(J,{content:"Border width",children:p}),o&&!t&&jsxRuntime.jsx("div",{ref:u,style:{...d,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:120},onMouseDown:l=>l.stopPropagation(),children:Wi.map(({size:l,label:f,thickness:m})=>jsxRuntime.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:v=>v.preventDefault(),onMouseEnter:v=>{v.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:v=>{v.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(l),children:[jsxRuntime.jsx("div",{style:{width:50,height:Math.max(m,1),backgroundColor:"#000",borderRadius:m>2?1:0}}),jsxRuntime.jsx("span",{children:f})]},l))})]})}function qo({onAction:e,disabled:t=false,theme:o,value:n}){let r=X.useCallback(a=>{typeof a=="string"&&e(a==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:a.replace(/^#/,"")});},[e]);return jsxRuntime.jsx(ke,{mode:"highlight",value:n,onChange:r,theme:o,disabled:t,title:"Cell Fill Color",icon:"format_color_fill",autoLabel:"No fill"})}var Ui={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"},Oe={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},Do={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function No({onAction:e,disabled:t=false,tableContext:o}){let[n,r]=X.useState(false),[a,u]=X.useState(null),d=X.useCallback(()=>r(false),[]),{containerRef:s,dropdownRef:c,dropdownStyle:p,handleMouseDown:l}=G({isOpen:n,onClose:d,align:"right"}),f=o?.table?.attrs?.justification??"left",m=X.useCallback(x=>{e(x),r(false);},[e]),v=(x,P,T,I,L)=>{let M=t||L?.itemDisabled;return jsxRuntime.jsxs("button",{type:"button",role:"menuitem",style:{...Ui,backgroundColor:a===x&&!M?"var(--doc-bg-hover)":"transparent",color:M?"var(--doc-text-muted)":L?.danger?"var(--doc-error)":"var(--doc-text)",cursor:M?"not-allowed":"pointer"},onClick:()=>!M&&m(I),onMouseEnter:()=>u(x),onMouseLeave:()=>u(null),disabled:M,children:[jsxRuntime.jsx(b,{name:P,size:16,className:L?.danger&&!M?"text-red-600":""}),jsxRuntime.jsx("span",{style:{flex:1},children:T})]},x)},g=jsxRuntime.jsx(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:l,onClick:()=>!t&&r(x=>!x),disabled:t,"aria-label":"More table options","aria-expanded":n,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsxRuntime.jsx(b,{name:"more_vert",size:20})});return jsxRuntime.jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[n?g:jsxRuntime.jsx(J,{content:"More table options",children:g}),n&&!t&&jsxRuntime.jsxs("div",{ref:c,style:{...p,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:x=>x.stopPropagation(),children:[v("addRowAbove","add","Insert row above","addRowAbove"),v("addRowBelow","add","Insert row below","addRowBelow"),v("addColumnLeft","add","Insert column left","addColumnLeft"),v("addColumnRight","add","Insert column right","addColumnRight"),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),v("mergeCells","call_merge","Merge cells","mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),v("splitCell","call_split","Split cell","splitCell",{itemDisabled:!o?.canSplitCell}),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),v("deleteRow","delete","Delete row","deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),v("deleteColumn","delete","Delete column","deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),v("deleteTable","delete","Delete table","deleteTable",{danger:true}),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),jsxRuntime.jsx("div",{style:Do,children:"Vertical alignment"}),jsxRuntime.jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(x=>{let P={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsxRuntime.jsx("button",{type:"button",title:{top:"Top",center:"Middle",bottom:"Bottom"}[x],style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{I.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:I=>{I.currentTarget.style.backgroundColor="transparent";},onClick:()=>m({type:"cellVerticalAlign",align:x}),children:jsxRuntime.jsx(b,{name:P[x],size:16})},x)})}),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),jsxRuntime.jsx("div",{style:Do,children:"Table alignment"}),jsxRuntime.jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(x=>{let P={left:"format_align_left",center:"format_align_center",right:"format_align_right"},T=f===x;return jsxRuntime.jsx("button",{type:"button",title:`Align table ${x}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:T?"var(--doc-primary-light)":"transparent",borderColor:T?"var(--doc-primary)":"var(--doc-border)",color:T?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:I=>I.preventDefault(),onClick:()=>m({type:"tableProperties",props:{justification:x}}),children:jsxRuntime.jsx(b,{name:P[x],size:16})},x)})}),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),v("headerRow","table_rows","Toggle header row",{type:"toggleHeaderRow"}),v("distribute","view_column","Distribute columns evenly",{type:"distributeColumns"}),v("autoFit","fit_width","Auto-fit to contents",{type:"autoFitContents"}),v("noWrap","wrap_text","Toggle no-wrap",{type:"toggleNoWrap"}),jsxRuntime.jsx("div",{style:Oe,role:"separator"}),v("properties","settings","Table properties...",{type:"openTableProperties"})]})]})}var Yi=20;function pt({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:r,disabled:a=false,ariaLabel:u,testId:d}){let[s,c]=X.useState(false),p=X.useCallback(()=>c(false),[]),{containerRef:l,dropdownRef:f,dropdownStyle:m,handleMouseDown:v}=G({isOpen:s,onClose:p}),g=X.useCallback(P=>{a||r(P),c(false);},[a,r]),x=jsxRuntime.jsxs(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",s&&"bg-slate-100",a&&"opacity-30 cursor-not-allowed"),onMouseDown:v,onClick:()=>!a&&c(P=>!P),disabled:a,"aria-label":u??n,"aria-expanded":s,"aria-haspopup":"true","data-testid":d,children:[jsxRuntime.jsx(b,{name:o,size:Yi}),jsxRuntime.jsx(b,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxRuntime.jsxs("div",{ref:l,style:{position:"relative",display:"inline-block"},children:[s?x:jsxRuntime.jsx(J,{content:n,children:x}),s&&!a&&jsxRuntime.jsx("div",{ref:f,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:P=>P.stopPropagation(),children:jsxRuntime.jsx("div",{style:{display:"flex",gap:2},children:e.map(P=>{let T=t===P.value;return jsxRuntime.jsx("button",{type:"button",title:P.label,"data-testid":d?`${d}-${P.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:T?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:T?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{T||(I.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:I=>{I.currentTarget.style.backgroundColor=T?"var(--doc-primary-light)":"transparent";},onClick:()=>g(P.value),children:jsxRuntime.jsx(b,{name:P.iconName,size:18})},P.value)})})})]})}var Ht=[{value:"inline",label:"Inline with text",iconName:"format_image_left"},{value:"wrapRight",label:"Float left (wrap right)",iconName:"format_image_right"},{value:"wrapLeft",label:"Float right (wrap left)",iconName:"format_image_left"},{value:"topAndBottom",label:"Top and bottom",iconName:"horizontal_rule"},{value:"behind",label:"Behind text",iconName:"flip_to_back"},{value:"inFront",label:"In front of text",iconName:"flip_to_front"}];function ji(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function Bo({imageContext:e,onChange:t,disabled:o=false}){let n=ji(e),r=Ht.find(a=>a.value===n)||Ht[0];return jsxRuntime.jsx(pt,{options:Ht,activeValue:n,triggerIcon:r.iconName,tooltipContent:`Wrap: ${r.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var Ji=[{value:"rotateCW",label:"Rotate clockwise",iconName:"rotate_right"},{value:"rotateCCW",label:"Rotate counter-clockwise",iconName:"rotate_left"},{value:"flipH",label:"Flip horizontal",iconName:"swap_horiz"},{value:"flipV",label:"Flip vertical",iconName:"swap_vert"}];function Oo({onTransform:e,disabled:t=false}){return jsxRuntime.jsx(pt,{options:Ji,triggerIcon:"rotate_right",tooltipContent:"Transform",onSelect:e,disabled:t,testId:"toolbar-image-transform"})}function ta(e){return "type"in e&&e.type==="separator"}var Wo={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, #374151)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},oa={...Wo,background:"var(--doc-hover, #f3f4f6)"},$o={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text, #374151)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},na={...$o,opacity:.4,cursor:"default"},ra={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},ia={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},aa={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:8,zIndex:1001};function mt({label:e,items:t,disabled:o}){let[n,r]=X.useState(false),[a,u]=X.useState(null),d=X.useRef(null),s=X.useRef(null),[c,p]=X.useState({top:0,left:0}),l=X.useCallback(()=>{r(false),u(null);},[]);X.useEffect(()=>{if(!n||!d.current)return;let m=d.current.getBoundingClientRect();p({top:m.bottom+2,left:m.left});},[n]),X.useEffect(()=>{if(!n)return;function m(x){let P=x.target;d.current&&!d.current.contains(P)&&s.current&&!s.current.contains(P)&&l();}function v(x){x.key==="Escape"&&l();}function g(){l();}return document.addEventListener("mousedown",m),document.addEventListener("keydown",v),window.addEventListener("scroll",g,true),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",v),window.removeEventListener("scroll",g,true);}},[n,l]);let f=m=>{m.disabled||m.submenuContent||m.onClick&&(m.onClick(),l());};return jsxRuntime.jsxs("div",{style:{position:"relative"},children:[jsxRuntime.jsxs("button",{ref:d,type:"button",onClick:()=>!o&&r(!n),onMouseDown:m=>m.preventDefault(),disabled:o,style:n?oa:Wo,children:[e,jsxRuntime.jsx(b,{name:"arrow_drop_down",size:16})]}),n&&jsxRuntime.jsx("div",{ref:s,style:{position:"fixed",top:c.top,left:c.left,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:m=>m.preventDefault(),children:t.map((m,v)=>{if(ta(m))return jsxRuntime.jsx("div",{style:ra},`sep-${v}`);let g=m;if(g.customContent)return jsxRuntime.jsx("div",{onMouseDown:T=>T.preventDefault(),children:g.customContent},g.label);let x=!!g.submenuContent,P=a===g.label;return jsxRuntime.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>x&&u(g.label),onMouseLeave:()=>x&&u(null),children:[jsxRuntime.jsxs("button",{type:"button",style:g.disabled?na:$o,onClick:()=>f(g),onMouseDown:T=>T.preventDefault(),onMouseOver:T=>{g.disabled||(T.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:T=>{T.currentTarget.style.backgroundColor="transparent";},disabled:g.disabled,children:[g.icon&&jsxRuntime.jsx(b,{name:g.icon,size:18}),jsxRuntime.jsx("span",{children:g.label}),g.shortcut&&jsxRuntime.jsx("span",{style:ia,children:g.shortcut}),x&&jsxRuntime.jsx("span",{style:{marginLeft:"auto"},children:jsxRuntime.jsx(b,{name:"keyboard_arrow_right",size:16})})]}),x&&P&&jsxRuntime.jsx("div",{style:aa,onMouseDown:T=>T.preventDefault(),children:g.submenuContent(l)})]},g.label)})})]})}var Et=18,sa=2,Uo={width:Et,height:Et,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},ca={...Uo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},ua={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text, #374151)",textAlign:"center"};function Ko({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[n,r]=X.useState(0),[a,u]=X.useState(0),d=X.useCallback(()=>{n>0&&a>0&&e(n,a);},[n,a,e]),s=[];for(let p=1;p<=t;p++)for(let l=1;l<=o;l++){let f=p<=n&&l<=a;s.push(jsxRuntime.jsx("div",{style:f?ca:Uo,onMouseEnter:()=>{r(p),u(l);},onClick:d,role:"gridcell","aria-selected":f},`${p}-${l}`));}let c=n>0&&a>0?`${a} \xD7 ${n}`:"Select size";return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{style:{display:"grid",gap:sa,gridTemplateColumns:`repeat(${o}, ${Et}px)`},onMouseLeave:()=>{r(0),u(0);},role:"grid","aria-label":"Table size selector",children:s}),jsxRuntime.jsx("div",{style:ua,children:c})]})}var da={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function vs(e){let t=e.replace(/^#/,"").toUpperCase();return da[t]||null}function Q({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:a,ariaLabel:u}){let d=u?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),s=p=>{p.preventDefault();},c=jsxRuntime.jsx(W,{variant:"ghost",size:"icon-sm",className:w("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",e&&"bg-slate-900 text-white hover:bg-slate-800 hover:text-white",t&&"opacity-30 cursor-not-allowed",a),onMouseDown:s,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":u||o,"data-testid":d?`toolbar-${d}`:void 0,children:r});return o?jsxRuntime.jsx(J,{content:o,children:c}):c}function oe({label:e,children:t,className:o}){return jsxRuntime.jsx("div",{className:w("flex items-center gap-px px-1.5 border-r border-slate-200/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function Ps(){return jsxRuntime.jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}function Ms({children:e,className:t,style:o,disabled:n=false,onFormat:r,onPrint:a,showPrintButton:u=true,onPageSetup:d,onInsertImage:s,onInsertTable:c,showTableInsert:p=true,onInsertPageBreak:l,onInsertTOC:f,onRefocusEditor:m,...v}){let g=X.useRef(null),x=X.useCallback(L=>{!n&&r&&r(L);},[n,r]),P=X.useCallback((L,M)=>{!n&&c&&(c(L,M),requestAnimationFrame(()=>m?.()));},[n,c,m]),T=X.useCallback(L=>{let M=L.target;M.tagName==="INPUT"||M.tagName==="TEXTAREA"||M.tagName==="SELECT"||M.tagName==="OPTION"||L.preventDefault();},[]),I=X.useCallback(L=>{let M=L.target,O=document.activeElement;M.tagName==="SELECT"||M.tagName==="OPTION"||O?.tagName==="SELECT"||requestAnimationFrame(()=>{m?.();});},[m]);return jsxRuntime.jsxs("div",{ref:g,className:w("flex items-center px-1 py-1 bg-white border-b border-slate-100 min-h-[36px] overflow-x-auto",t),style:o,role:"toolbar","aria-label":"Formatting toolbar","data-testid":"toolbar",onMouseDown:T,onMouseUp:I,children:[u&&a||d?jsxRuntime.jsx(mt,{label:"File",disabled:n,items:[...u&&a?[{icon:"print",label:"Print",shortcut:"Ctrl+P",onClick:a}]:[],...d?[{icon:"settings",label:"Page setup",onClick:d}]:[]]}):null,jsxRuntime.jsx(mt,{label:"Format",disabled:n,items:[{icon:"format_textdirection_l_to_r",label:"Left-to-right text",onClick:()=>x("setLtr")},{icon:"format_textdirection_r_to_l",label:"Right-to-left text",onClick:()=>x("setRtl")}]}),jsxRuntime.jsx(mt,{label:"Insert",disabled:n,items:[...s?[{icon:"image",label:"Image",onClick:s}]:[],...p&&c?[{icon:"grid_on",label:"Table",submenuContent:L=>jsxRuntime.jsx(Ko,{onInsert:(M,O)=>{P(M,O),L();}})}]:[],...s||p&&c?[{type:"separator"}]:[],{icon:"page_break",label:"Page break",onClick:l,disabled:!l},{icon:"format_list_numbered",label:"Table of contents",onClick:f,disabled:!f}]}),jsxRuntime.jsx(Yo,{...v,disabled:n,onFormat:r,onRefocusEditor:m,onInsertTable:c,showTableInsert:p,onInsertImage:s,onInsertPageBreak:l,onInsertTOC:f,onPrint:a,showPrintButton:u,onPageSetup:d,inline:true,children:e})]})}var Dt=X.createContext(null);function ks(){let e=X.useContext(Dt);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var ne=18;function Ta(e){let t=X__namespace.default.useContext(Dt);return t?{...t,...ya(e)}:e}function ya(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function Yo(e){let t=Ta(e),{currentFormatting:o={},onFormat:n,onUndo:r,onRedo:a,canUndo:u=false,canRedo:d=false,disabled:s=false,className:c,style:p,enableShortcuts:l=true,editorRef:f,children:m,showFontPicker:v=true,showFontSizePicker:g=true,showTextColorPicker:x=true,showHighlightColorPicker:P=true,showAlignmentButtons:T=true,showListButtons:I=true,showLineSpacingPicker:L=true,showStylePicker:M=true,documentStyles:O,theme:A,showZoomControl:Te=true,zoom:ie,onZoomChange:me,onRefocusEditor:Z,imageContext:K,onImageWrapType:y,onImageTransform:D,onOpenImageProperties:C,tableContext:Y,onTableAction:Ie,inline:ae=false}=t,Xe=X.useRef(null),F=X.useCallback(k=>{!s&&n&&n(k);},[s,n]),Tt=X.useCallback(()=>{!s&&u&&r&&r();},[s,u,r]),yt=X.useCallback(()=>{!s&&d&&a&&a();},[s,d,a]),St=X.useCallback(k=>{!s&&n&&(n({type:"fontFamily",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Ct=X.useCallback(k=>{!s&&n&&(n({type:"fontSize",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Pe=X.useCallback(k=>{!s&&n&&(n({type:"textColor",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),Ve=X.useCallback(k=>{!s&&n&&(n({type:"highlightColor",value:typeof k=="string"?k:""}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),le=X.useCallback(k=>{!s&&n&&n({type:"alignment",value:k});},[s,n]),wt=X.useCallback(()=>{!s&&n&&n("bulletList");},[s,n]),_=X.useCallback(()=>{!s&&n&&n("numberedList");},[s,n]),Me=X.useCallback(()=>{!s&&n&&n("indent");},[s,n]),Je=X.useCallback(()=>{!s&&n&&n("outdent");},[s,n]),Ze=X.useCallback(k=>{!s&&n&&(n({type:"lineSpacing",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),se=X.useCallback(k=>{!s&&n&&(n({type:"applyStyle",value:k}),requestAnimationFrame(()=>Z?.()));},[s,n,Z]),z=X.useCallback(k=>{!s&&Ie&&(Ie(k),requestAnimationFrame(()=>Z?.()));},[s,Ie,Z]);X.useEffect(()=>{if(!l)return;let k=q=>{let We=q.target,Ut=f?.current,ln=Xe.current,sn=Ut?.contains(We),cn=ln?.contains(We);if(!sn&&!cn)return;if((q.ctrlKey||q.metaKey)&&!q.altKey)switch(q.key.toLowerCase()){case "b":q.preventDefault(),F("bold");break;case "i":q.preventDefault(),F("italic");break;case "u":q.preventDefault(),F("underline");break;case "=":q.shiftKey?(q.preventDefault(),F("superscript")):(q.preventDefault(),F("subscript"));break;case "l":q.preventDefault(),le("left");break;case "e":q.preventDefault(),le("center");break;case "r":q.preventDefault(),le("right");break;case "j":q.preventDefault(),le("both");break;case "k":q.preventDefault(),F("insertLink");break}};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k);}},[l,F,le,f]);let ee=X.useCallback(k=>{let q=k.target;q.tagName==="INPUT"||q.tagName==="TEXTAREA"||q.tagName==="SELECT"||q.tagName==="OPTION"||k.preventDefault();},[]),Re=X.useCallback(k=>{let q=k.target,We=document.activeElement;q.tagName==="SELECT"||q.tagName==="OPTION"||We?.tagName==="SELECT"||requestAnimationFrame(()=>{Z?.();});},[Z]);return jsxRuntime.jsxs("div",{ref:Xe,className:w(!ae&&"flex items-center px-2 py-1 bg-[#f1f5f9] rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",c),style:ae?{display:"contents",...p}:p,role:ae?void 0:"toolbar","aria-label":ae?void 0:"Formatting toolbar","data-testid":ae?void 0:"formatting-bar",onMouseDown:ae?void 0:ee,onMouseUp:ae?void 0:Re,children:[jsxRuntime.jsxs(oe,{label:"History",children:[jsxRuntime.jsx(Q,{onClick:Tt,disabled:s||!u,title:"Undo (Ctrl+Z)",ariaLabel:"Undo",children:jsxRuntime.jsx(b,{name:"undo",size:ne})}),jsxRuntime.jsx(Q,{onClick:yt,disabled:s||!d,title:"Redo (Ctrl+Y)",ariaLabel:"Redo",children:jsxRuntime.jsx(b,{name:"redo",size:ne})})]}),Te&&jsxRuntime.jsx(oe,{label:"Zoom",children:jsxRuntime.jsx(Po,{value:ie,onChange:me,minZoom:.5,maxZoom:2,disabled:s,compact:true,showButtons:false})}),M&&jsxRuntime.jsx(oe,{label:"Styles",children:jsxRuntime.jsx(Io,{value:o.styleId||"Normal",onChange:se,styles:O,theme:A,disabled:s,width:120})}),(v||g)&&jsxRuntime.jsxs(oe,{label:"Font",children:[v&&jsxRuntime.jsx(Jt,{value:o.fontFamily||"Arial",onChange:St,disabled:s,width:60,placeholder:"Arial"}),g&&jsxRuntime.jsx(so,{value:o.fontSize!==void 0?lo(o.fontSize):11,onChange:Ct,disabled:s,width:42,placeholder:"11"})]}),jsxRuntime.jsxs(oe,{label:"Text formatting",children:[jsxRuntime.jsx(Q,{onClick:()=>F("bold"),active:o.bold,disabled:s,title:"Bold (Ctrl+B)",ariaLabel:"Bold",children:jsxRuntime.jsx(b,{name:"format_bold",size:ne})}),jsxRuntime.jsx(Q,{onClick:()=>F("italic"),active:o.italic,disabled:s,title:"Italic (Ctrl+I)",ariaLabel:"Italic",children:jsxRuntime.jsx(b,{name:"format_italic",size:ne})}),jsxRuntime.jsx(Q,{onClick:()=>F("underline"),active:o.underline,disabled:s,title:"Underline (Ctrl+U)",ariaLabel:"Underline",children:jsxRuntime.jsx(b,{name:"format_underlined",size:ne})}),jsxRuntime.jsx(Q,{onClick:()=>F("strikethrough"),active:o.strike,disabled:s,title:"Strikethrough",ariaLabel:"Strikethrough",children:jsxRuntime.jsx(b,{name:"strikethrough_s",size:ne})}),x&&jsxRuntime.jsx(ke,{mode:"text",value:o.color?.replace(/^#/,""),onChange:Pe,theme:A,disabled:s,title:"Font Color"}),P&&jsxRuntime.jsx(ke,{mode:"highlight",value:o.highlight,onChange:Ve,theme:A,disabled:s,title:"Text Highlight Color"}),jsxRuntime.jsx(Q,{onClick:()=>F("insertLink"),disabled:s,title:"Insert link (Ctrl+K)",ariaLabel:"Insert link",children:jsxRuntime.jsx(b,{name:"link",size:ne})})]}),jsxRuntime.jsxs(oe,{label:"Script",children:[jsxRuntime.jsx(Q,{onClick:()=>F("superscript"),active:o.superscript,disabled:s,title:"Superscript (Ctrl+Shift+=)",ariaLabel:"Superscript",children:jsxRuntime.jsx(b,{name:"superscript",size:ne})}),jsxRuntime.jsx(Q,{onClick:()=>F("subscript"),active:o.subscript,disabled:s,title:"Subscript (Ctrl+=)",ariaLabel:"Subscript",children:jsxRuntime.jsx(b,{name:"subscript",size:ne})})]}),T&&jsxRuntime.jsx(oe,{label:"Alignment",children:jsxRuntime.jsx(go,{value:o.alignment||"left",onChange:le,disabled:s})}),(I||L)&&jsxRuntime.jsxs(oe,{label:"List formatting",children:[I&&jsxRuntime.jsx(To,{listState:o.listState||yo(),onBulletList:wt,onNumberedList:_,onIndent:Me,onOutdent:Je,disabled:s,showIndentButtons:true,compact:true,hasIndent:(o.indentLeft??0)>0}),L&&jsxRuntime.jsx(Co,{value:o.lineSpacing,onChange:Ze,disabled:s})]}),K&&y&&jsxRuntime.jsxs(oe,{label:"Image",children:[jsxRuntime.jsx(Bo,{imageContext:K,onChange:y,disabled:s}),D&&jsxRuntime.jsx(Oo,{onTransform:D,disabled:s}),C&&jsxRuntime.jsx(Q,{onClick:C,disabled:s,title:"Image properties (alt text, border)...",ariaLabel:"Image properties",children:jsxRuntime.jsx(b,{name:"tune",size:ne})})]}),Y?.isInTable&&Ie&&jsxRuntime.jsxs(oe,{label:"Table",children:[jsxRuntime.jsx(Ro,{onAction:z,disabled:s}),jsxRuntime.jsx(Lo,{onAction:z,disabled:s,theme:A,value:Y?.cellBorderColor?chunkIA4LPH2A_cjs.a(Y.cellBorderColor,A).replace(/^#/,""):void 0}),jsxRuntime.jsx(Ho,{onAction:z,disabled:s}),jsxRuntime.jsx(qo,{onAction:z,disabled:s,theme:A,value:Y?.cellBackgroundColor}),jsxRuntime.jsx(No,{onAction:z,disabled:s,tableContext:Y})]}),jsxRuntime.jsx(Q,{onClick:()=>F("clearFormatting"),disabled:s,title:"Clear formatting",ariaLabel:"Clear formatting",children:jsxRuntime.jsx(b,{name:"format_clear",size:ne})}),m]})}var Xo=12240,vt=1440,bt=1440,gt=567,At=22,wa="var(--doc-text-muted)",Ia="var(--doc-text-subtle)",jo="rgba(0, 0, 0, 0.02)",Pa="#4285f4",Ma="#3367d6",Za="#2a56c6",_e=5;function Ra(e,t){return t==="inch"?(e/bt).toFixed(2)+'"':(e/gt).toFixed(1)+" cm"}function ic({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:r,onFirstLineIndentChange:a,showFirstLineIndent:u=false,firstLineIndent:d=0,hangingIndent:s=false,indentLeft:c=0,indentRight:p=0,onIndentLeftChange:l,onIndentRightChange:f,unit:m="inch",className:v="",style:g,tabStops:x,onTabStopRemove:P}){let[T,I]=X.useState(null),[L,M]=X.useState(null),[O,A]=X.useState(null),[Te,ie]=X.useState(null),me=X.useRef(null),Z=e?.pageWidth??Xo,K=e?.marginLeft??vt,y=e?.marginRight??vt,D=Z-K-y,C=chunkKR32M3S4_cjs.a(Z)*t,Y=chunkKR32M3S4_cjs.a(K)*t,Ie=chunkKR32M3S4_cjs.a(y)*t,ae=chunkKR32M3S4_cjs.a(c)*t,Xe=chunkKR32M3S4_cjs.a(p)*t,F=s?-d:d,Tt=chunkKR32M3S4_cjs.a(F)*t,yt=Y+ae,St=C-Ie-Xe,Ct=Y+ae+Tt,Pe=X.useCallback((_,Me)=>{o&&(_.preventDefault(),_.stopPropagation(),I(Me));},[o]),Ve=X.useCallback(_=>{if(!T||!me.current)return;let Me=me.current.getBoundingClientRect(),Je=_.clientX-Me.left;ie(Je);let Ze=chunkKR32M3S4_cjs.b(Je/t);if(T==="leftMargin"){let se=Z-y-720,z=Math.round(Math.max(0,Math.min(Ze,se)));A(z),n?.(z);}else if(T==="rightMargin"){let se=Z-Ze,z=Z-K-720,ee=Math.round(Math.max(0,Math.min(se,z)));A(ee),r?.(ee);}else if(T==="firstLineIndent"){let se=K+c,z=Ze-se,ee=D-c-p-720,Re=Math.round(Math.max(-c,Math.min(z,ee)));A(Re),a?.(Re);}else if(T==="leftIndent"){let se=Ze-K,z=D-p-720,ee=Math.round(Math.max(0,Math.min(se,z)));A(ee),l?.(ee);}else if(T==="rightIndent"){let z=Z-y-Ze,ee=D-c-720,Re=Math.round(Math.max(0,Math.min(z,ee)));A(Re),f?.(Re);}},[T,t,Z,K,y,D,c,p,n,r,a,l,f]),le=X.useCallback(()=>{I(null),A(null),ie(null);},[]);X.useEffect(()=>{if(T)return document.addEventListener("mousemove",Ve),document.addEventListener("mouseup",le),()=>{document.removeEventListener("mousemove",Ve),document.removeEventListener("mouseup",le);}},[T,Ve,le]);let wt=_a(Z,t,m);return jsxRuntime.jsxs("div",{ref:me,className:`docx-horizontal-ruler ${v}`,style:{position:"relative",width:chunkKR32M3S4_cjs.k(C),height:At,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:T?"ew-resize":"default",...g},role:"slider","aria-label":"Horizontal ruler","aria-valuemin":0,"aria-valuemax":Z,children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:chunkKR32M3S4_cjs.k(Y),height:At,backgroundColor:jo,borderRight:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?_=>Pe(_,"leftMargin"):void 0}),jsxRuntime.jsx("div",{style:{position:"absolute",top:0,right:0,width:chunkKR32M3S4_cjs.k(Ie),height:At,backgroundColor:jo,borderLeft:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?_=>Pe(_,"rightMargin"):void 0}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:wt.map((_,Me)=>jsxRuntime.jsx(La,{tick:_},Me))}),u&&jsxRuntime.jsx(Ft,{direction:"down",positionPx:Ct,editable:o,isDragging:T==="firstLineIndent",isHovered:L==="firstLineIndent",onMouseEnter:()=>M("firstLineIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"firstLineIndent"),label:"First line indent"}),o&&l&&jsxRuntime.jsx(Ft,{direction:"up",positionPx:yt,editable:o,isDragging:T==="leftIndent",isHovered:L==="leftIndent",onMouseEnter:()=>M("leftIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"leftIndent"),label:"Left indent"}),o&&f&&jsxRuntime.jsx(Ft,{direction:"down",positionPx:St,editable:o,isDragging:T==="rightIndent",isHovered:L==="rightIndent",onMouseEnter:()=>M("rightIndent"),onMouseLeave:()=>M(null),onMouseDown:_=>Pe(_,"rightIndent"),label:"Right indent"}),x?.map(_=>jsxRuntime.jsx(qa,{tabStop:_,positionPx:chunkKR32M3S4_cjs.a(_.position)*t,onDoubleClick:()=>P?.(_.position)},_.position)),T&&O!==null&&Te!==null&&jsxRuntime.jsx(ka,{value:Ra(O,m),positionPx:Te})]})}function La({tick:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkKR32M3S4_cjs.k(e.position),bottom:0,width:1,height:e.height,backgroundColor:Ia}}),e.label&&jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkKR32M3S4_cjs.k(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:wa,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Ft({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:r,onMouseEnter:a,onMouseLeave:u,onMouseDown:d,label:s}){let c=n?Za:r?Ma:Pa,p=Math.round(_e*1.6),l={position:"absolute",left:chunkKR32M3S4_cjs.k(t-_e),width:_e*2,height:p+2,cursor:o?"ew-resize":"default",zIndex:n?10:4,...e==="down"?{top:0}:{bottom:0}},f=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderTop:`${p}px solid ${c}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${_e}px solid transparent`,borderRight:`${_e}px solid transparent`,borderBottom:`${p}px solid ${c}`,transition:"border-bottom-color 0.1s"};return jsxRuntime.jsx("div",{className:"docx-ruler-indent",style:l,onMouseEnter:a,onMouseLeave:u,onMouseDown:d,role:"slider","aria-label":s,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsxRuntime.jsx("div",{style:f})})}function ka({value:e,positionPx:t}){return jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkKR32M3S4_cjs.k(t),top:-22,transform:"translateX(-50%)",backgroundColor:"#333",color:"#fff",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var Ha={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function qa({tabStop:e,positionPx:t,onDoubleClick:o}){return jsxRuntime.jsx("div",{style:{position:"absolute",left:chunkKR32M3S4_cjs.k(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"#555",cursor:"pointer",userSelect:"none"},onDoubleClick:n=>{n.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:Ha[e.alignment]||"L"})}function _a(e,t,o){let n=[];if(o==="inch"){let r=bt/8,a=Math.ceil(e/r);for(let u=0;u<=a;u++){let d=u*r;if(d>e)break;let s=chunkKR32M3S4_cjs.a(d)*t;u%8===0?n.push({position:s,height:10,label:u/8>0?String(u/8):void 0}):u%4===0?n.push({position:s,height:6}):u%2===0?n.push({position:s,height:4}):n.push({position:s,height:2});}}else {let r=gt/10,a=Math.ceil(e/r);for(let u=0;u<=a;u++){let d=u*r;if(d>e)break;let s=chunkKR32M3S4_cjs.a(d)*t;u%10===0?n.push({position:s,height:10,label:u/10>0?String(u/10):void 0}):u%5===0?n.push({position:s,height:6}):n.push({position:s,height:3});}}return n}function ac(e,t,o,n){let r=chunkKR32M3S4_cjs.b(e/n);return t==="left"?Math.max(0,r):Math.max(0,chunkKR32M3S4_cjs.b(o/n)-r)}function lc(e,t=1){let o=e?.pageWidth??Xo,n=e?.marginLeft??vt,r=e?.marginRight??vt,a=chunkKR32M3S4_cjs.a(o)*t,u=chunkKR32M3S4_cjs.a(n)*t,d=chunkKR32M3S4_cjs.a(r)*t;return {width:a,leftMargin:u,rightMargin:d,contentWidth:a-u-d}}function sc(e,t){return t==="inch"?(e/bt).toFixed(2)+'"':(e/gt).toFixed(1)+" cm"}function cc(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?bt:gt))}var xe=16;function Na(){return jsxRuntime.jsx(b,{name:"table_rows",size:xe,style:{transform:"scaleY(-1)"}})}function Aa(){return jsxRuntime.jsx(b,{name:"table_rows",size:xe})}function Fa(){return jsxRuntime.jsx(b,{name:"view_column",size:xe,style:{transform:"scaleX(-1)"}})}function Ba(){return jsxRuntime.jsx(b,{name:"view_column",size:xe})}function Oa(){return jsxRuntime.jsx(b,{name:"delete_sweep",size:xe})}function za(){return jsxRuntime.jsx(b,{name:"delete_sweep",size:xe,style:{transform:"rotate(90deg)"}})}function Va(){return jsxRuntime.jsx(b,{name:"call_merge",size:xe})}function Wa(){return jsxRuntime.jsx(b,{name:"call_split",size:xe})}function $a(){return jsxRuntime.jsx(b,{name:"delete",size:xe,className:"text-red-600"})}var re={container:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",border:"1px solid var(--doc-border)",fontSize:"12px"},containerCompact:{padding:"2px 4px",gap:"2px"},containerFloating:{position:"absolute",zIndex:1e3,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},group:{display:"flex",alignItems:"center",gap:"2px"},separator:{width:"1px",height:"20px",backgroundColor:"var(--doc-border-dark)",margin:"0 4px"},button:{display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 8px",border:"none",borderRadius:"3px",backgroundColor:"transparent",color:"var(--doc-text)",cursor:"pointer",fontSize:"12px",lineHeight:"1",transition:"background-color 0.15s, color 0.15s"},buttonCompact:{padding:"3px 5px"},buttonHover:{backgroundColor:"var(--doc-border)"},buttonDisabled:{color:"var(--doc-text-subtle)",cursor:"not-allowed"},buttonDelete:{color:"var(--doc-error)"},label:{fontSize:"11px",fontWeight:500,color:"var(--doc-text-muted)",marginRight:"8px",whiteSpace:"nowrap"}};function ge({action:e,label:t,icon:o,disabled:n=false,onClick:r,showLabel:a=false,compact:u=false,shortcut:d}){let[s,c]=X__namespace.default.useState(false),p=typeof e=="string"&&e.startsWith("delete"),l={...re.button,...u?re.buttonCompact:{},...s&&!n?re.buttonHover:{},...n?re.buttonDisabled:{},...p&&!n?re.buttonDelete:{}},f=d?`${t} (${d})`:t;return jsxRuntime.jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:l,disabled:n,onClick:r,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),title:f,"aria-label":t,children:[o,a&&jsxRuntime.jsx("span",{children:t})]})}function Bt({children:e,showSeparator:t=true}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:re.group,children:e}),t&&jsxRuntime.jsx("div",{style:re.separator})]})}function hc({context:e,onAction:t,disabled:o=false,className:n,style:r,showLabels:a=false,compact:u=false,position:d="top",children:s}){if(!e)return null;let c=x=>{!o&&t&&e&&t(x,e);},p=e.rowCount>1,l=e.columnCount>1,f=e.hasMultiCellSelection,m=e.canSplitCell,v={...re.container,...u?re.containerCompact:{},...d==="floating"?re.containerFloating:{},...r},g=["docx-table-toolbar"];return n&&g.push(n),u&&g.push("docx-table-toolbar-compact"),d==="floating"&&g.push("docx-table-toolbar-floating"),jsxRuntime.jsxs("div",{className:g.join(" "),style:v,role:"toolbar","aria-label":"Table editing tools",children:[jsxRuntime.jsx("span",{style:re.label,children:"Table:"}),jsxRuntime.jsxs(Bt,{children:[jsxRuntime.jsx(ge,{action:"addRowAbove",label:"Insert Row Above",icon:jsxRuntime.jsx(Na,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"addRowBelow",label:"Insert Row Below",icon:jsxRuntime.jsx(Aa,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"deleteRow",label:"Delete Row",icon:jsxRuntime.jsx(Oa,{}),disabled:o||!p,onClick:()=>c("deleteRow"),showLabel:a,compact:u})]}),jsxRuntime.jsxs(Bt,{children:[jsxRuntime.jsx(ge,{action:"addColumnLeft",label:"Insert Column Left",icon:jsxRuntime.jsx(Fa,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"addColumnRight",label:"Insert Column Right",icon:jsxRuntime.jsx(Ba,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"deleteColumn",label:"Delete Column",icon:jsxRuntime.jsx(za,{}),disabled:o||!l,onClick:()=>c("deleteColumn"),showLabel:a,compact:u})]}),jsxRuntime.jsxs(Bt,{showSeparator:false,children:[jsxRuntime.jsx(ge,{action:"mergeCells",label:"Merge Cells",icon:jsxRuntime.jsx(Va,{}),disabled:o||!f,onClick:()=>c("mergeCells"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"splitCell",label:"Split Cell",icon:jsxRuntime.jsx(Wa,{}),disabled:o||!m,onClick:()=>c("splitCell"),showLabel:a,compact:u}),jsxRuntime.jsx(ge,{action:"deleteTable",label:"Delete Table",icon:jsxRuntime.jsx($a,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:a,compact:u})]}),s]})}function fc(e,t){let o=e.rows.length,n=Ot(e),r=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),a=Qo(e,t.rowIndex,t.columnIndex),u=!!(a&&((a.formatting?.gridSpan??1)>1||a.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:r,canSplitCell:u,rowCount:o,columnCount:n}}function Ot(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let r of o.cells)n+=r.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function Qo(e,t,o){let n=e.rows[t];if(!n)return null;let r=0;for(let a of n.cells){let u=a.formatting?.gridSpan??1;if(o>=r&&o<r+u)return a;r+=u;}return null}function Ga(e,t){let o=[],n=0;for(let r of e.cells){let a=r.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...r.formatting,vMerge:void 0}}),n+=a;}for(;n<t;)o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}),n++;return {type:"tableRow",cells:o,formatting:{...e.formatting,header:false}}}function Ua(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function vc(e,t,o="after"){let n=[...e.rows],r=o==="before"?t:t+1,a=e.rows[t]||e.rows[0],u=Ot(e),d=Ga(a,u);return n.splice(r,0,d),{...e,rows:n}}function bc(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,r)=>r!==t);return {...e,rows:o}}function gc(e,t,o="after"){let n=o==="before"?t:t+1,r=e.rows.map(u=>{let d=[...u.cells],s=0,c=0;for(let p=0;p<u.cells.length;p++){let f=u.cells[p].formatting?.gridSpan??1;if(n<=s+f){c=o==="before"?p:p+1;break}s+=f,c=p+1;}return d.splice(c,0,Ua()),{...u,cells:d}}),a=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){a=[...e.columnWidths];let u=e.columnWidths[t]||e.columnWidths[0]||1440;a.splice(n,0,u);}return {...e,rows:r,columnWidths:a}}function xc(e,t){if(Ot(e)<=1)return e;let n=e.rows.map(a=>{let u=0,d=[];for(let s of a.cells){let c=s.formatting?.gridSpan??1;t>=u&&t<u+c?c>1&&d.push({...s,formatting:{...s.formatting,gridSpan:c-1}}):d.push(s),u+=c;}return {...a,cells:d}}),r=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(r=e.columnWidths.filter((a,u)=>u!==t)),{...e,rows:n,columnWidths:r}}function Tc(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:r,endCol:a}=t.selectedCells,u=r-o+1,d=a-n+1,s=e.rows.map((c,p)=>{if(p<o||p>r)return c;let l=[],f=0;for(let m of c.cells){let v=m.formatting?.gridSpan??1,g=f+v-1;f<=a&&g>=n?p===o&&f===n?l.push({...m,formatting:{...m.formatting,gridSpan:d,vMerge:u>1?"restart":void 0}}):p>o&&f===n&&l.push({...m,formatting:{...m.formatting,gridSpan:d,vMerge:"continue"}}):l.push(m),f+=v;}return {...c,cells:l}});return {...e,rows:s}}function yc(e,t,o){let n=Qo(e,t,o);if(!n)return e;let r=n.formatting?.gridSpan??1,a=n.formatting?.vMerge==="restart";if(r<=1&&!a)return e;let u=e.rows.map((d,s)=>{if(s!==t&&!a)return d;let c=[],p=0;for(let l of d.cells){let f=l.formatting?.gridSpan??1;if(p===o||p<=o&&o<p+f)if(r>1)for(let m=0;m<r;m++)c.push({type:"tableCell",content:m===0?l.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,gridSpan:void 0,vMerge:void 0}});else a&&s===t?c.push({...l,formatting:{...l.formatting,vMerge:void 0}}):l.formatting?.vMerge==="continue"?c.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...l.formatting,vMerge:void 0}}):c.push(l);else c.push(l);p+=f;}return {...d,cells:c}});return {...e,rows:u}}var wc="application/x-docx-editor",U={HTML:"text/html",PLAIN:"text/plain"};async function en(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=zt(e,o);return await xt(r)}catch(r){return n?.(r),false}}async function Ic(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=Ya(e,o);return await xt(r)}catch(r){return n?.(r),false}}function zt(e,t=true){let o=e.map($t).join(""),n=t?an(e):Gt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}function Ya(e,t=true){let o=e.map(nl).join(`
|
|
2
|
+
`),n=t?rl(e):Gt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}async function xt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[U.PLAIN]:new Blob([e.plainText],{type:U.PLAIN}),[U.HTML]:new Blob([e.html],{type:U.HTML})})];return await navigator.clipboard.write(t),!0}return tn(e)}catch{return tn(e)}}function tn(e){let t=document.createElement("div");t.innerHTML=e.html,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t);try{let o=window.getSelection();if(!o)return !1;let n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n);let r=document.execCommand("copy");return o.removeAllRanges(),r}finally{document.body.removeChild(t);}}async function Pc(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await ja(n,t)}return null}catch(n){return o?.(n),null}}async function ja(e,t){let o="",n="";for(let r of e)r.types.includes(U.HTML)&&(o=await(await r.getType(U.HTML)).text()),r.types.includes(U.PLAIN)&&(n=await(await r.getType(U.PLAIN)).text());return rn(o,n,t)}function Xa(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let r=n.getData(U.HTML),a=n.getData(U.PLAIN);return rn(r,a,o)}function rn(e,t,o=true){let n=Ja(e),r=Qa(e);if(r){let d=e.match(/data-docx-editor-content="([^"]+)"/);if(d)try{return {runs:JSON.parse(decodeURIComponent(d[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let a=e;return n&&o&&(a=el(e)),{runs:tl(a,t),fromWord:n,fromEditor:r,plainText:t}}function Ja(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function Qa(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function el(e){let t=e;return t=t.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),t=t.replace(/<!--[\s\S]*?-->/g,""),t=t.replace(/<\?xml[^>]*>/gi,""),t=t.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),t=t.replace(/<o:[^>]*\/>/gi,""),t=t.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),t=t.replace(/<w:[^>]*\/>/gi,""),t=t.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),t=t.replace(/\s*style="\s*"/gi,""),t=t.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/gi,""),t=t.replace(/<\/?font[^>]*>/gi,""),t=t.replace(/\s+/g," ").trim(),t}function tl(e,t){if(!e||e.trim()==="")return t?[Wt(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Vt(o,n,{}),n.length===0&&t?[Wt(t)]:n}function Vt(e,t,o){if(e.nodeType===Node.TEXT_NODE){let u=e.textContent||"";(u.trim()||u.includes(" "))&&t.push(Wt(u,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase(),a={...o,...ol(n)};switch(r){case "br":t.push(nn(a));return;case "p":case "div":for(let u of n.childNodes)Vt(u,t,a);n.nextSibling&&t.push(nn(a));return;case "b":case "strong":a.bold=true;break;case "i":case "em":a.italic=true;break;case "u":a.underline={style:"single"};break;case "s":case "strike":case "del":a.strike=true;break;case "sup":a.vertAlign="superscript";break;case "sub":a.vertAlign="subscript";break;case "code":case "pre":a.fontFamily={ascii:"Courier New"};break}for(let u of n.childNodes)Vt(u,t,a);}function ol(e){let t={},o=e.style;(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(t.bold=true),o.fontStyle==="italic"&&(t.italic=true);let n=o.textDecoration||o.textDecorationLine;if(n&&(n.includes("underline")&&(t.underline={style:"single"}),n.includes("line-through")&&(t.strike=true)),o.fontSize){let r=parseFloat(o.fontSize);isNaN(r)||(t.fontSize=Math.round(r/1.333*2));}if(o.fontFamily){let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(t.fontFamily={ascii:r});}if(o.color){let r=on(o.color);r&&(t.color={rgb:r});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let r=on(o.backgroundColor);r&&(t.shading={fill:{rgb:r}});}return t}function on(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let o=parseInt(t[1]).toString(16).padStart(2,"0"),n=parseInt(t[2]).toString(16).padStart(2,"0"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+r).toUpperCase()}return null}function $t(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
|
|
3
|
+
`:"").join("")}function nl(e){return (e.content||[]).map(t=>t.type==="run"?$t(t):"").join("")}function an(e){return e.map(il).join("")}function rl(e){return e.map(t=>`<p>${an(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function il(e){let t=$t(e);if(!t)return "";let o=Gt(t),n=e.formatting;if(!n)return o;n.bold&&(o=`<strong>${o}</strong>`),n.italic&&(o=`<em>${o}</em>`),n.underline&&(o=`<u>${o}</u>`),n.strike&&(o=`<s>${o}</s>`),n.vertAlign==="superscript"&&(o=`<sup>${o}</sup>`),n.vertAlign==="subscript"&&(o=`<sub>${o}</sub>`);let r=[];if(n.fontSize){let a=n.fontSize/2;r.push(`font-size: ${a}pt`);}return n.fontFamily?.ascii&&r.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&r.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&r.push(`background-color: #${n.shading.fill.rgb}`),r.length>0&&(o=`<span style="${r.join("; ")}">${o}</span>`),o}function Gt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Wt(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function nn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function Mc(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:r={}}=e;return {handleCopy:async c=>{if(!t)return;let p=t();if(!p)return;c.preventDefault();let l=zt(p.runs);c.clipboardData?(c.clipboardData.setData(U.PLAIN,l.plainText),c.clipboardData.setData(U.HTML,l.html)):await xt(l);},handleCut:async c=>{if(!o)return;let p=o();if(!p)return;c.preventDefault();let l=zt(p.runs);c.clipboardData?(c.clipboardData.setData(U.PLAIN,l.plainText),c.clipboardData.setData(U.HTML,l.html)):await xt(l);},handlePaste:c=>{if(!n)return;c.preventDefault();let p=Xa(c,r);p&&n(p);},handleKeyDown:async c=>{let p=c.ctrlKey||c.metaKey;if(p&&c.key==="c"&&!c.shiftKey&&t){let l=t();l&&await en(l.runs,r);}if(p&&c.key==="x"&&!c.shiftKey&&o){let l=o();l&&await en(l.runs,r);}}}}exports.$=Xa;exports.A=Q;exports.B=oe;exports.C=Ps;exports.D=Ms;exports.E=ic;exports.F=ac;exports.G=lc;exports.H=sc;exports.I=cc;exports.J=hc;exports.K=fc;exports.L=Ot;exports.M=Qo;exports.N=vc;exports.O=bc;exports.P=gc;exports.Q=xc;exports.R=Tc;exports.S=yc;exports.T=wc;exports.U=U;exports.V=en;exports.W=Ic;exports.X=zt;exports.Y=Ya;exports.Z=xt;exports._=Pc;exports.a=w;exports.aa=rn;exports.b=W;exports.ba=Ja;exports.c=J;exports.ca=Qa;exports.d=b;exports.da=el;exports.e=mt;exports.ea=tl;exports.f=Ko;exports.fa=Mc;exports.g=Jt;exports.h=G;exports.i=ql;exports.j=so;exports.k=ke;exports.l=go;exports.m=To;exports.n=yo;exports.o=Co;exports.p=Io;exports.q=Po;exports.r=Ro;exports.s=Lo;exports.t=Ho;exports.u=qo;exports.v=No;exports.w=Dt;exports.x=ks;exports.y=Yo;exports.z=vs;
|