@sheetxl/studio-vanilla 0.4.8 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/browser/cjs/{CHSE1pa8SMApg4BM.cjs → 3GhIDU8JK1oBJrCA.cjs} +2 -2
  2. package/browser/cjs/{BYhOQCFEzewgsKDn.cjs → 5hPVyVAXmITQCRAG.cjs} +2 -2
  3. package/browser/cjs/{3nTDo2EiTknjadbt.cjs → 7PlrLPQx1lct0mdN.cjs} +1 -1
  4. package/browser/cjs/{C6nZKAevPqj8zJY-.cjs → B4K6KuggSdXj-V8g.cjs} +2 -2
  5. package/browser/cjs/{DWTMnPR33rKK87Xt.cjs → B5Qc3gXLEhscRsFm.cjs} +4 -4
  6. package/browser/cjs/{BCnlTOmUDmizyvVV.cjs → B7eW1GQgFvphlLGY.cjs} +2 -2
  7. package/browser/cjs/{CD_HItzF2RneMAER.cjs → BQPFxJ77OaD_sBIX.cjs} +2 -2
  8. package/browser/cjs/{i0D2haODisHW8uGg.cjs → Ba3O1f0NYbzEwNAd.cjs} +1 -1
  9. package/browser/cjs/{Cqymi9AOXO_JYvY4.cjs → BoojmbbjqixMVu2H.cjs} +2 -2
  10. package/browser/cjs/{CE5NVYltiso41NzK.cjs → CSGVl8EBCRhxcFm1.cjs} +1 -1
  11. package/browser/cjs/{6Wu3sLyx-7NM6CXS.cjs → CalnqtYH48_x2rcI.cjs} +8 -8
  12. package/browser/cjs/{euAV1pPrNOIb6DV4.cjs → CjDsO4sQWUHbIX1N.cjs} +2 -2
  13. package/browser/cjs/{BIPxYhhi1F-y0gSm.cjs → CsCaFaiySArzEfdH.cjs} +2 -2
  14. package/browser/cjs/{BqLDj2GlSzX8ZN3l.cjs → D6AUUY9awlTRjjqd.cjs} +1 -1
  15. package/browser/cjs/{oNi7wirDlZ81Lm0Z.cjs → D8lN5Mv3J4SwSpLP.cjs} +1 -1
  16. package/browser/cjs/{CTXKzcsm-W1ujL_U.cjs → D9RQ5oYv7U38wSI7.cjs} +3 -3
  17. package/browser/cjs/{CcQjGGiCx6Qz7yJ4.cjs → DCd2rPNFkSHDaRcM.cjs} +1 -1
  18. package/browser/cjs/{z1aNSOtWsEE21p2H.cjs → DGQrcBvjSGwwoZEv.cjs} +2 -2
  19. package/browser/cjs/{DMUSzq5n2k0WNFw6.cjs → DIXyMJKaeCGuWxjZ.cjs} +1 -1
  20. package/browser/cjs/{Dy4SB47It0LGbh2I.cjs → Dmw7xaaV85s72QZe.cjs} +1 -1
  21. package/browser/cjs/{D6pPBbRPLTNFSXuO.cjs → DzCXPcqV1oKbCcLO.cjs} +1 -1
  22. package/browser/cjs/{Dds58NEqJ0OalWH3.cjs → EoaX6dPoS-Mb-ITO.cjs} +2 -2
  23. package/browser/cjs/{B11W4AIKbkJQG6ug.cjs → Y6OgkWqbIB761o5q.cjs} +2 -2
  24. package/browser/cjs/{VJLb1uMfbKAUW1QF.cjs → gbABnN2zW1kHo3_I.cjs} +3 -3
  25. package/browser/cjs/index.cjs +2 -2
  26. package/browser/cjs/{bHWvGntvmuk8t7sX.cjs → kfV5Cli9oE9IsCtx.cjs} +2 -2
  27. package/browser/cjs/{C2B3wbeahcHlbOBZ.cjs → nURb18uhj9rScsHa.cjs} +2 -2
  28. package/browser/esm/{D_FC0zteMRPriWTD.mjs → 2NQDbhor1Nuzndgq.mjs} +1 -1
  29. package/{cdn/assets/CPi83FXApMlTaVbs.js → browser/esm/4aC35Q2XPOwifBRR.mjs} +1 -1
  30. package/{cdn/assets/CjVsKZEPAncg5mIk.js → browser/esm/5zFDFBAgT-aPgQQ0.mjs} +1 -1
  31. package/browser/esm/{Ckz080o58XOgRhqj.mjs → B3I_TrFN_pAK5Mdh.mjs} +2 -2
  32. package/browser/esm/{eXQ_1uhRMyN-hfDZ.mjs → BD9GKsR-k4aEK2tx.mjs} +1 -1
  33. package/browser/esm/{EUFvcP5R4HFDLn2V.mjs → BQpsMTJvguy6LMIq.mjs} +2 -2
  34. package/browser/esm/{DQ0Li3WfKbZxSFuB.mjs → BfCWogOnq8R-c3dD.mjs} +2 -2
  35. package/browser/esm/{cSe92c0HnvbRwiVM.mjs → BkGQPKMRPIVUVTLO.mjs} +64 -64
  36. package/browser/esm/{B7qUiL1xPnzfOHZw.mjs → C81J50HcankGTOIj.mjs} +1 -1
  37. package/browser/esm/{DnWiOUNTPvi_llPT.mjs → CO_s27056nua6qzN.mjs} +1 -1
  38. package/browser/esm/{BM74iVi-iQkHbrfo.mjs → CPEjlDUTxckVS1rp.mjs} +2 -2
  39. package/browser/esm/{BP8kNG31HYSkk1VW.mjs → CY7astxzrfb7uZqy.mjs} +4 -4
  40. package/browser/esm/{6KgR81NK4yzANTBT.mjs → CZVzRhflTpwAAl1o.mjs} +2 -2
  41. package/browser/esm/{h4NbNvV8KCL9Tl1v.mjs → CaWZXQsmKl4hTNq5.mjs} +3 -3
  42. package/{cdn/assets/BEFQcBJ71bA297Zu.js → browser/esm/CxcLNXXaxyFyUzyb.mjs} +1 -1
  43. package/browser/esm/{4C7Rg83L5RYFoOvl.mjs → D0icxW0WVNoeVRLH.mjs} +2 -2
  44. package/browser/esm/{2RGq163l1wYJKGsa.mjs → DFQvqk5r1uf_z0h_.mjs} +9 -9
  45. package/{cdn/assets/xlL3Ai-ka9qMVeua.js → browser/esm/DRL5s4S0fIXi1aU7.mjs} +1 -1
  46. package/browser/esm/{DyUvHYGMNA9W2zL6.mjs → DRmeb1VC4YCzKKWd.mjs} +1 -1
  47. package/browser/esm/{DXyJaUwHLq39-Jfa.mjs → DTwhl4v5YnZrUSgI.mjs} +2 -2
  48. package/browser/esm/{BEIn7yNWsHNJisB6.mjs → DmpPAs6w-XNWGTIN.mjs} +3 -3
  49. package/browser/esm/{B1CYiJmSpyx4TD5r.mjs → Dx-GS3XDBkRaMNG-.mjs} +3 -3
  50. package/browser/esm/{CDkmbShJijwq4EBo.mjs → V5CA7xqGOB7-Qx4Y.mjs} +6 -6
  51. package/browser/esm/{ClXspoNrNV-A8BaL.mjs → gsfI5CGYr7LCQxRx.mjs} +2 -2
  52. package/browser/esm/index.mjs +2 -2
  53. package/browser/esm/{C_hRuPoaT857EnC1.mjs → tOBqasyBAnd7O4qE.mjs} +2 -2
  54. package/browser/esm/{CA_DRvBOFOlhezCt.mjs → tPrnEcHW_czJDZOT.mjs} +2 -2
  55. package/cdn/assets/{D_FC0zteMRPriWTD.js → 2NQDbhor1Nuzndgq.js} +1 -1
  56. package/{browser/esm/CPi83FXApMlTaVbs.mjs → cdn/assets/4aC35Q2XPOwifBRR.js} +1 -1
  57. package/{browser/esm/CjVsKZEPAncg5mIk.mjs → cdn/assets/5zFDFBAgT-aPgQQ0.js} +1 -1
  58. package/cdn/assets/{CtDntnnwJW1rZ3sM.js → B0w_moB3pDJd-a6V.js} +2 -2
  59. package/cdn/assets/{eXQ_1uhRMyN-hfDZ.js → BD9GKsR-k4aEK2tx.js} +1 -1
  60. package/cdn/assets/{O1XID2whLDb1cTWS.js → BJVOhUH_XL03H6ZD.js} +2 -2
  61. package/cdn/assets/{C1x5-f1q8NeSwRA2.js → BWJOkXXB6Tr-jYUS.js} +3 -3
  62. package/cdn/assets/{DppHXtCDGzttFdS4.js → BapFqJyAb3cblvJM.js} +2 -2
  63. package/cdn/assets/{CpVan9KpuEGXgwIK.js → Bg88bG-JM9EHeyYX.js} +2 -2
  64. package/cdn/assets/{B7qUiL1xPnzfOHZw.js → C81J50HcankGTOIj.js} +1 -1
  65. package/cdn/assets/{DnWiOUNTPvi_llPT.js → CO_s27056nua6qzN.js} +1 -1
  66. package/cdn/assets/{CuG5WoZ4OOj9RCsv.js → CXa9u-7w14dyPYxk.js} +3 -3
  67. package/cdn/assets/{Bvy1txLm7c3LbPL7.js → CkcETdiKdTsZAzma.js} +6 -6
  68. package/{browser/esm/BEFQcBJ71bA297Zu.mjs → cdn/assets/CxcLNXXaxyFyUzyb.js} +1 -1
  69. package/cdn/assets/{BXBP2rNGQxrgUPvU.js → D0PaU6F-TNaTWj-a.js} +2 -2
  70. package/cdn/assets/{CLA1BGtRbWm0K0U0.js → D4hoypx6_sZbvrC_.js} +2 -2
  71. package/cdn/assets/{BgChN-ZVYUOMDX9_.js → D5exf1RvCqvUoJ3X.js} +4 -4
  72. package/cdn/assets/{B2hDWpWSEoChxhVY.js → DKLitAhDj5Ibh2cc.js} +8 -8
  73. package/{browser/esm/xlL3Ai-ka9qMVeua.mjs → cdn/assets/DRL5s4S0fIXi1aU7.js} +1 -1
  74. package/cdn/assets/{DyUvHYGMNA9W2zL6.js → DRmeb1VC4YCzKKWd.js} +1 -1
  75. package/cdn/assets/{DTvvMKZZfsVRhbow.js → DYkBvlMlZjOASUJs.js} +2 -2
  76. package/cdn/assets/{C5NMOq74C3Sme49x.js → ON5--a75QdEU99y_.js} +3 -3
  77. package/cdn/assets/{Dbd0AFDlzQDW0tOg.js → PIZDjyqIbvmHXs1T.js} +2 -2
  78. package/cdn/assets/{DuU1-7vd87A1wfGJ.js → TOkIJFYhNg78FdJa.js} +2 -2
  79. package/cdn/assets/{g4FhlroGKmJM7Utd.js → b9dlFmoFz8tJhV0Z.js} +2 -2
  80. package/cdn/assets/{tJI1G_FjDgqWo3rJ.js → d1PG-QPA1GcQ_RuH.js} +64 -64
  81. package/cdn/index.js +2 -2
  82. package/cdn/loader.js +1 -1
  83. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.8
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.9
3
3
  *
4
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -143,7 +143,7 @@ export default theme;`}function nh(e={},...t){const{breakpoints:n,mixins:o={},sp
143
143
  `);await navigator.clipboard.writeText(p),r("Copied!"),setTimeout(()=>r(null),2e3)}catch(d){r("Can't copy!"),console.warn("Failed to copy stack trace:",d)}},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Copy stack trace",children:s.jsx(aR,{sx:{fontSize:"0.875rem"}})}),s.jsx(Tr,{size:"small",onClick:()=>{console.log(e)},sx:{color:"inherit",opacity:.7,"&:hover":{opacity:1}},title:"Log error to console",children:s.jsx(rR,{sx:{fontSize:"0.875rem"}})})]}),s.jsxs(Ae,{sx:{mt:1,backgroundColor:"rgba(0, 0, 0, 0.2)",borderRadius:1,p:1,maxHeight:"300px",overflow:"auto",fontFamily:"monospace",fontSize:"0.75rem",lineHeight:1.4},children:[l.map((d,p)=>d.isBoundary?s.jsx(Ae,{sx:{py:1,mt:p>0?1:0,mb:.5,borderTop:p>0?"1px solid rgba(255, 255, 255, 0.1)":"none"},children:s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",fontWeight:"bold",color:f=>d.isBoundary?f.palette.text.primary:f.palette.text.secondary,display:"block"},children:d.line})},`error-${p}`):s.jsxs(Ae,{sx:{display:"flex",alignItems:"flex-start",gap:1,py:.25,pl:1,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},children:[!n&&s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.5,minWidth:"20px",textAlign:"right",userSelect:"none"},children:p+1}),s.jsxs(Ae,{sx:{flex:1,overflow:"hidden"},children:[s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.75rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",color:"inherit"},children:d.line}),d.location&&d.line!==d.location&&s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic"},children:d.location})]})]},`stack-${p}`)),c&&s.jsxs(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic",textAlign:"center",display:"block",mt:1},children:["... and ",a.length-t," more frames"]})]})]})});Z3.displayName="StackTrace";const uv=u.memo(u.forwardRef((e,t)=>{const{sx:n,icon:o=s.jsx(lR,{style:{fontSize:48}}),error:r,hideStackTrace:i=!1,stackTraceExpanded:a=!1,...l}=e,c=u.useMemo(()=>((d,p=!1)=>{if(u.isValidElement(d))return d;if(d instanceof Error)return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",maxWidth:"500px",width:"100%"},children:[s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,mb:1},children:d.message}),d.cause?s.jsxs(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em",mb:1,opacity:.8},children:["Caused by: ",d.cause instanceof Error?d.cause.message:String(d.cause)]}):null,!p&&s.jsx(Z3,{error:d,hideLineNumbers:!0})]});const f=d==="string"?d:`Unknown Error: ${String(d)}`;return s.jsx(Tn,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,letterSpacing:"0.01071em"},children:f})})(r,i),[r,i,a]);return u.useMemo(()=>s.jsx(Ae,{ref:t,sx:{boxSizing:"border-box",alignItems:"center",justifyContent:"center",display:"flex",flexDirection:"row",overflow:"hidden",width:"100%",height:"100%",...n},...l,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",height:"100%",alignItems:"center",justifyContent:"center",boxSizing:"border-box",position:"relative"},children:[s.jsx(Ae,{className:"backdrop",sx:{backdropFilter:"blur(4px)",borderRadius:d=>`${d.shape.borderRadius}px`,zIndex:-1,position:"absolute",width:"100%",height:"100%",boxSizing:"border-box"}}),s.jsx(Ti,{elevation:0,sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",rowGap:"8px",alignSelf:"center",marginBottom:"5%",backgroundColor:d=>d.palette.error.light,color:d=>d.palette.error.contrastText,paddingLeft:d=>d.spacing(2),paddingRight:d=>d.spacing(2),paddingTop:d=>d.spacing(2),paddingBottom:d=>d.spacing(2),borderRadius:d=>`${d.shape.borderRadius}px`,boxShadow:d=>d.shadows[2],"& .primary":{background:d=>`${d.palette.error.contrastText} !important`,border:"solid transparent"},zIndex:1},children:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:d=>d.spacing(2),width:"100%",maxWidth:"600px"},children:s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:d=>d.spacing(2)},children:[o,c]})})})]})}),[n])}));uv.displayName="ErrorPanel";const pv=u.memo(u.forwardRef((e,t)=>{const{chips:n,sx:o,...r}=e,i=u.useMemo(()=>{if(!n)return null;let a=null;a=Array.isArray(n)?n:[n];const l=[];for(let c=0;c<a.length;c++){const d=a[c];let p=null;typeof d=="string"?p=s.jsx(lT,{label:d,color:"primary",size:"small",sx:{scale:"0.8"}},"chip-"+c):u.cloneElement(d,{key:"chip-"+c}),l.push(p)}return l},[n]);return s.jsx(Ae,{ref:t,sx:{display:"flex",flexDirection:"row",marginLeft:"4px",gap:"2px",...o},...r,children:i})}));var hh="top",Kd="bottom",fh="right",hv="left",zD=[hh,Kd,fh,hv],fv="viewport",O0="popper";function kl(e){return e?(e.nodeName||"").toLowerCase():null}function Pa(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function _s(e){return e instanceof Pa(e).Element||e instanceof Element}function js(e){return e instanceof Pa(e).HTMLElement||e instanceof HTMLElement}function mh(e){return typeof ShadowRoot<"u"&&(e instanceof Pa(e).ShadowRoot||e instanceof ShadowRoot)}var vc=Math.max,Q7=Math.min,e8=Math.round;function gh(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mv(){return!/^((?!chrome|android).)*safari/i.test(gh())}function X3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&js(e)&&(r=e.offsetWidth>0&&e8(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&e8(o.height)/e.offsetHeight||1);var a=(_s(e)?Pa(e):window).visualViewport,l=!mv()&&n,c=(o.left+(l&&a?a.offsetLeft:0))/r,d=(o.top+(l&&a?a.offsetTop:0))/i,p=o.width/r,f=o.height/i;return{width:p,height:f,top:d,right:c+p,bottom:d+f,left:c,x:c,y:d}}function Za(e){return Pa(e).getComputedStyle(e)}function FD(e){return["table","td","th"].indexOf(kl(e))>=0}function Rs(e){return((_s(e)?e.ownerDocument:e.document)||window.document).documentElement}function ju(e){return kl(e)==="html"?e:e.assignedSlot||e.parentNode||(mh(e)?e.host:null)||Rs(e)}function t8(e){return js(e)&&Za(e).position!=="fixed"?e.offsetParent:null}function gv(e){var t=Pa(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function n8(e){return X3(Rs(e)).left+gv(e).scrollLeft}function yv(e){var t=Za(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function xv(e){return["html","body","#document"].indexOf(kl(e))>=0?e.ownerDocument.body:js(e)&&yv(e)?e:xv(ju(e))}function bv(e,t){var n;t===void 0&&(t=[]);var o=xv(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=Pa(o),a=r?[i].concat(i.visualViewport||[],yv(o)?o:[]):o,l=t.concat(a);return r?l:l.concat(bv(ju(a)))}function yh(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function o8(e,t,n){return t===fv?yh(function(o,r){var i=Pa(o),a=Rs(o),l=i.visualViewport,c=a.clientWidth,d=a.clientHeight,p=0,f=0;if(l){c=l.width,d=l.height;var h=mv();(h||!h&&r==="fixed")&&(p=l.offsetLeft,f=l.offsetTop)}return{width:c,height:d,x:p+n8(o),y:f}}(e,n)):_s(t)?function(o,r){var i=X3(o,!1,r==="fixed");return i.top=i.top+o.clientTop,i.left=i.left+o.clientLeft,i.bottom=i.top+o.clientHeight,i.right=i.left+o.clientWidth,i.width=o.clientWidth,i.height=o.clientHeight,i.x=i.left,i.y=i.top,i}(t,n):yh(function(o){var r,i=Rs(o),a=gv(o),l=(r=o.ownerDocument)==null?void 0:r.body,c=vc(i.scrollWidth,i.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=vc(i.scrollHeight,i.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),p=-a.scrollLeft+n8(o),f=-a.scrollTop;return Za(l||i).direction==="rtl"&&(p+=vc(i.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:p,y:f}}(Rs(e)))}const BD={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(e){var t=e.state,n=e.name,o=function(g,m){m===void 0&&(m={});var y,x,v=m,b=v.placement,w=b===void 0?g.placement:b,M=v.strategy,k=M===void 0?g.strategy:M,j=v.boundary,_=j===void 0?"clippingParents":j,L=v.rootBoundary,T=L===void 0?fv:L,D=v.elementContext,C=D===void 0?O0:D,S=v.altBoundary,R=S!==void 0&&S,P=v.padding,I=P===void 0?0:P,z=(x=typeof I!="number"?I:(y=I,zD.reduce(function(le,re){return le[re]=y,le},{})),Object.assign({},{top:0,right:0,bottom:0,left:0},x)),A=C===O0?"reference":O0,O=g.rects.popper,N=g.elements[R?A:C],F=function(le,re,ge,Q){var xe=re==="clippingParents"?function(ae){var we=bv(ju(ae)),se=["absolute","fixed"].indexOf(Za(ae).position)>=0&&js(ae)?function(J){for(var ce=Pa(J),ne=t8(J);ne&&FD(ne)&&Za(ne).position==="static";)ne=t8(ne);return ne&&(kl(ne)==="html"||kl(ne)==="body"&&Za(ne).position==="static")?ce:ne||function(Pe){var Ee=/firefox/i.test(gh());if(/Trident/i.test(gh())&&js(Pe)&&Za(Pe).position==="fixed")return null;var it=ju(Pe);for(mh(it)&&(it=it.host);js(it)&&["html","body"].indexOf(kl(it))<0;){var Ue=Za(it);if(Ue.transform!=="none"||Ue.perspective!=="none"||Ue.contain==="paint"||["transform","perspective"].indexOf(Ue.willChange)!==-1||Ee&&Ue.willChange==="filter"||Ee&&Ue.filter&&Ue.filter!=="none")return it;it=it.parentNode}return null}(J)||ce}(ae):ae;return _s(se)?we.filter(function(J){return _s(J)&&function(ce,ne){var Pe=ne.getRootNode&&ne.getRootNode();if(ce.contains(ne))return!0;if(Pe&&mh(Pe)){var Ee=ne;do{if(Ee&&ce.isSameNode(Ee))return!0;Ee=Ee.parentNode||Ee.host}while(Ee)}return!1}(J,se)&&kl(J)!=="body"}):[]}(le):[].concat(re),be=[].concat(xe,[ge]),Fe=be[0],ee=be.reduce(function(ae,we){var se=o8(le,we,Q);return ae.top=vc(se.top,ae.top),ae.right=Q7(se.right,ae.right),ae.bottom=Q7(se.bottom,ae.bottom),ae.left=vc(se.left,ae.left),ae},o8(le,Fe,Q));return ee.width=ee.right-ee.left,ee.height=ee.bottom-ee.top,ee.x=ee.left,ee.y=ee.top,ee}(_s(N)?N:N.contextElement||Rs(g.elements.popper),_,T,k),E=X3(g.elements.reference),B=function(le){var re,ge=le.reference,Q=le.element,xe=le.placement,be=xe?xe.split("-")[0]:null,Fe=xe?xe.split("-")[1]:null,ee=ge.x+ge.width/2-Q.width/2,ae=ge.y+ge.height/2-Q.height/2;switch(be){case hh:re={x:ee,y:ge.y-Q.height};break;case Kd:re={x:ee,y:ge.y+ge.height};break;case fh:re={x:ge.x+ge.width,y:ae};break;case hv:re={x:ge.x-Q.width,y:ae};break;default:re={x:ge.x,y:ge.y}}var we=be?["top","bottom"].indexOf(be)>=0?"x":"y":null;if(we!=null){var se=we==="y"?"height":"width";switch(Fe){case"start":re[we]=re[we]-(ge[se]/2-Q[se]/2);break;case"end":re[we]=re[we]+(ge[se]/2-Q[se]/2)}}return re}({reference:E,element:O,placement:w}),H=yh(Object.assign({},O,B)),U=C===O0?H:E,Z={top:F.top-U.top+z.top,bottom:U.bottom-F.bottom+z.bottom,left:F.left-U.left+z.left,right:U.right-F.right+z.right},G=g.modifiersData.offset;if(C===O0&&G){var V=G[w];Object.keys(Z).forEach(function(le){var re=[fh,Kd].indexOf(le)>=0?1:-1,ge=[hh,Kd].indexOf(le)>=0?"y":"x";Z[le]+=V[ge]*re})}return Z}(t,e.options),r=t.modifiersData.preventOverflow||{x:0,y:0},i=r.x,a=r.y;let l=t.rects.popper,c=l.width,d=l.height,p=t.placement.split("-")[0],f=p==="left"?"left":"right",h=p==="top"?"top":"bottom";t.modifiersData[n]={width:c-o[f]-i,height:d-o[h]-a}}},ND=[0,2],vv=u.memo(u.forwardRef((e,t)=>{const{sx:n,open:o,children:r,label:i,offsets:a=ND,anchorEl:l,anchorPosition:c,onMount:d,onOpening:p,onOpen:f,onClosing:h,onClose:g,resizeOnOverflow:m=!0,...y}=e;if(Array.isArray(r))throw new Error("children can not be an array");const x=N3(),v={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:N}){const{height:F}=N.modifiersData.maxSize;N.styles.popper.maxHeight=F-10+"px"}},b=u.useMemo(()=>{const N=[{name:"offset",options:{offset:a}},{name:"flip",enabled:!0,options:{rootBoundary:"document"}}];return m&&N.unshift(BD,v),N},[m,a]),[w,M]=u.useState(!1),k=u.useRef(null),j=En(()=>{d?.(R.current,k.current)},[p]),_=En(p,[p]),L=En(f,[f]),T=En(h,[h]),D=En(()=>{M(!1),g?.()},[g]),[C,S]=u.useState(!1),R=u.useRef(null),P=u.useRef(!0),I=u.useMemo(()=>({onFirstUpdate:()=>{P.current&&(S(!0),j?.(),P.current=!1)}}),[o,w]);u.useEffect(()=>{o&&C?_?.():!o&&w&&T?.(),o&&M(o)},[o,C]);const z=u.useMemo(()=>({getBoundingClientRect:()=>c?new DOMRect(c?.left||0,c?.top||0,0,0):l.getBoundingClientRect()}),[c,l]);u.useImperativeHandle(t,()=>({instance:()=>k.current,element:()=>R.current}),[]);const{getPortalContainer:A}=U3(),O=u.useMemo(()=>({zIndex:o?"1300":"1299",display:"flex",pointerEvents:w&&o?void 0:"none",maxWidth:"100%",maxHeight:"100%",...n}),[n,o,w]);return s.jsx(b3,{ref:R,popperRef:k,container:A,anchorEl:z,open:w,role:void 0,popperOptions:I,transition:!0,sx:O,placement:"bottom-start",modifiers:b,...y,children:({TransitionProps:N,placement:F,...E})=>{const{in:B,onEnter:H,onExited:U,...Z}=N??{};return s.jsx(Fc,{...Z,in:o,onEnter:()=>{H?.(),L()},onExited:()=>{U?.(),D()},timeout:{enter:x.transitions.duration.shorter,exit:0},style:{transformOrigin:F==="bottom-start"?"left top":"center bottom"},children:typeof r=="function"?r({TransitionProps:N,placement:F,...E}):r||{}})}})}));vv.displayName="ExhibitPopper";const Ri={Toolbar:"toolbar",Menuitem:"menuitem"},Bn=e=>{const{closeFloat:t,closeFloatAll:n,floatReference:o,popupContainer:r,children:i,className:a,sx:l,...c}=e;return s.jsx(Ae,{className:rr("menu",a),sx:{display:"flex",flexDirection:"column",...l},...c,children:i})},r8=(e,t,n)=>s.jsx(nR,{sx:{marginLeft:e?void 0:t?"-5px":"-3px",marginRight:e?void 0:t?"-5px":"-6px",transform:()=>{let o;return t&&(o=(o?o+" ":"")+"scale(0.8)"),n&&(o=(o?o+" ":"")+"rotate(180deg)"),o}},color:"inherit"}),$D=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,VD=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,xh=function(e,t=null){if(!e)return e;e=e.replace($D,function(o,r,i,a){return r+r+i+i+a+a});let n=VD.exec(e);return n?t===null?`rgb(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)})`:`rgb(${parseInt(n[1],16)} ${parseInt(n[2],16)} ${parseInt(n[3],16)} / ${100*t}%)`:e},mi=function(e,t=.2,n="light"){if(!e)return e;let o=n!=="dark";return t<0&&(o=!o,t*=-1),e=xh(e),o?Ol(e,Math.max(0,Math.min(1,1*t))):Dl(e,Math.max(0,Math.min(1,1.5*t)))};function Y3(e,t){const n={"&::-webkit-scrollbar, & *::-webkit-scrollbar":{backgroundColor:pt((t=cr({track:mi(e.palette.background.paper,.05,e?.palette.mode),thumb:mi(e.palette.background.paper,.3,e?.palette.mode),active:e.palette.primary.main,corner:e.palette.background.paper,outline:!1},t||{})).track,.2),width:"13px",height:"13px"},"&::-webkit-scrollbar-button":{display:"none"},"& .scrollbar-button":{fill:t.thumb,backgroundColor:"transparent",transition:"fill opacity 260ms ease",width:"13px",height:"13px"},"& .scrollbar-button:hover:not([disabled])":{fill:t.active},"& .scrollbar-button:disabled":{opacity:.8},"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track":{},"&::-webkit-scrollbar-track-piece, & *::-webkit-scrollbar-track-piece":{},"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb":{borderRadius:8,backgroundColor:t.thumb,minHeight:"24px",minWidth:"24px",border:`2px solid ${t.track}`},"&::-webkit-scrollbar-thumb:focus, & *::-webkit-scrollbar-thumb:focus":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:active, & *::-webkit-scrollbar-thumb:active":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover":{backgroundColor:t.active,border:t.outline?t.outline:void 0},"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner":{backgroundColor:t.corner||t.thumb}};return To.getOS()===To.OSType.Firefox&&(n["* .pseudo-scrollbar"]={scrollbarColor:`${t.thumb} transparent`},n["* .pseudo-scrollbar:hover:not([disabled])"]={scrollbarColor:`${t.active} transparent`}),n}const wv=u.memo(u.forwardRef((e,t)=>{const{open:n,anchorEl:o,anchorPosition:r,label:i,floatReference:a,createPopupPanel:l=Bn,popperProps:c,onMount:d,onClosing:p,onClose:f,onOpening:h,onOpen:g,children:m,sx:y,...x}=e,v=En(p,[p]),b=En(f,[f]),w=En(h,[h]),M=En(g,[g]),[k,j]=u.useState(),_=u.useRef(null),L=En((D,C)=>{j(D),d?.(_.current,C)},[d]),T=u.useMemo(()=>{const D={popupContainer:k,floatReference:a,children:m,...x},C=l(D);return s.jsx(Ti,{elevation:8,ref:_,sx:{display:"flex",overflow:"auto",outline:"none","&.MuiPaper-root":S=>Y3(S)},tabIndex:0,children:C})},[l,m,k,a]);return s.jsx(vv,{ref:t,anchorEl:o,anchorPosition:r,label:i,open:n,onMount:L,onOpening:w,onOpen:M,onClosing:v,onClose:b,...c,children:T})}));wv.displayName="ExhibitFloatPanel";const Va=new Map;let Dp=null;const Ha=new Map;let Ca=null;const Ap=(e=null,t,n,o)=>(Ca&&(Ca.fn.clear(),Ca=null),e===0?t:(e===null&&(e=120),Ca={fn:To.debounce(()=>t(),e),setReferences:n,isClose:o},Ca.fn)),Sv=(e,t)=>{if(t===null)return;e.add(t);const n=Va.get(t.key);if(!n)return;const o=Ha.get(n);o&&Sv(e,o)},i8=e=>{const t=new Set;return Sv(t,e),t},ha=e=>{const{anchor:t,label:n=null,parentFloat:o=null,onOpen:r,onClose:i,popperProps:a,createPopupPanel:l=Bn}=e??{},c=En(r,[r]),d=En(i,[i]),[p,f]=u.useState(null),[h,g]=u.useState(!1),[m,y]=u.useState(!1),x=u.useMemo(()=>o===null?(Dp===null&&(Dp={key:{label:"root"},isRoot:!0,parent:null,open:()=>null,close:V=>null,closeChild:V=>null,onChildVisible:()=>{},onChildHidden:()=>{},closeAll:()=>z(0),floatElement:()=>null,anchorElement:()=>null}),Dp):o,[]),v=u.useMemo(()=>({label:n}),[]),b=u.useRef(null),w=u.useRef(t);u.useEffect(()=>{w.current=t},[t]);const M=V=>{const le=Va.get(V);let re=null;return le&&(re=Ha.get(le)?.close(0)),re},k=()=>M(N.key),[j,_]=u.useState(),L=()=>{if(!p)return void S();const V=new Promise((le,re)=>{_(ge=>({resolve:le,reject:re}))});return k(),Va.delete(x.key),f(!1),V};u.useEffect(()=>{j&&(j.resolve(),_(null))},[h,m,j]);const T=u.useCallback(()=>{let V=x;for(;V.parent;)V=V.parent;return M(V.key)},[]),D=()=>{if(p)return void S();x&&Ha.get(x.key)?.open(0);const V=Va.get(x.key);V&&V!==v&&Ha.get(V)?.close(0),requestAnimationFrame(()=>{Va.set(x.key,N.key),f(!0)})},[C,S]=u.useReducer(V=>V+1,0),R=u.useCallback(V=>l===null?null:l({closeFloat:z,closeFloatAll:O,...V}),[l]),P=l===null,I=En((V=120)=>Ap(V,D,new Set([N]),!1)(),[D]),z=En((V=60)=>Ap(V,L,i8(N),!0)(),[L]),A=En((V=360)=>Ap(V,k,i8((le=>{const re=Va.get(le.key);return re&&Ha.get(re)||null})(N)),!0)(),[k]),O=En(T,[T]),N=u.useMemo(()=>({key:v,isRoot:!1,label:n,parent:x,onChildVisible:()=>{y(!0)},onChildHidden:()=>{y(!1)},open:I,close:z,closeChild:A,closeAll:O,floatElement:()=>b.current,anchorElement:()=>w.current}),[]);u.useEffect(()=>{Ha.set(v,N)},[N]),u.useEffect(()=>()=>{Ha.delete(v),z(0)},[]),u.useEffect(()=>{p&&!P&&(g(!0),x.onChildVisible())},[p,P]);const F=u.useCallback(V=>{V.which===xr.Escape&&(V.preventDefault(),V.stopPropagation(),z(0))},[]),E=u.useRef(null),B=u.useCallback(()=>{const V=E.current,le=b.current;V&&le&&(requestAnimationFrame(()=>{(le.contains(document.activeElement)||document.activeElement===document.body)&&V.focus()}),E.current=null),d?.()},[]),H=u.useCallback(V=>{b.current=V,V.addEventListener("focus",re=>{E.current=re.relatedTarget},{once:!0,passive:!0});const le=document.activeElement;requestAnimationFrame(()=>{le===document.activeElement&&V.focus()})},[]),[U,Z]=u.useState();u.useEffect(()=>{P&&(p?c?.():p===!1&&d?.()),Z(h?s.jsx(wv,{floatReference:N,open:p,label:n,anchorEl:t,onOpening:()=>{c?.(),x.onChildVisible()},onClosing:B,onClose:()=>{g(!1),x.onChildHidden()},onMount:H,popperProps:{onKeyDown:F,onMouseEnter:V=>{p&&Ca?.isClose&&Ca.setReferences.has(N)&&(Ca.fn.clear(),Ca=null,N.closeChild())},...a},createPopupPanel:R}):null)},[h,p,n,P,a,R,C]);const G=En(V=>{if(Va.size===0)return;let le=!1;Va.forEach(re=>{const ge=Ha.get(re);!le&&ge&&(ge.floatElement()?.contains?.(V.target)&&(le=!0),ge.anchorElement()?.contains?.(V.target)&&(le=!0))}),le||T()},[T]);return u.useEffect(()=>{if(!p||!x.isRoot)return;const V=le=>{G(le)};return document.addEventListener("mousedown",V),document.addEventListener("touchstart",V),document.addEventListener("focus",V),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("touchstart",V),document.removeEventListener("focus",V)}},[p,x]),{component:U,reference:N}},HD=u.memo(u.forwardRef((e,t)=>{const{nestedChildren:n,variant:o,disabled:r=!1,createPopupPanel:i,...a}=e,l={disabled:r,createPopupPanel:En(c=>{if(!n||n.length===0)return null;const{popupContainer:d,floatReference:p,ref:f,...h}=c,g=[];for(let m=0;m<n.length;m++){const y=n[m];y&&g.push(s.jsx(HD,{parentFloat:p,...h,...y},m))}return s.jsxs(Ae,{ref:t,sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:["Children here",g,s.jsx(Gr,{parentFloat:p,children:"Close other children"})]})},[n]),...a};return s.jsx(o===Ri.Toolbar?qi:k1,{...l})})),WD={placement:"right-start"},Cv=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,createPopupPanel:i,popperProps:a=WD,label:l,...c}=e;(function(x){if(!x)throw new Error("Invariant failed")})(u.isValidElement(n));const d=n,p=u.useMemo(()=>({...d?.props,...c,onContextMenu:x=>{d?.props?.onContextMenu?.(x),x.isDefaultPrevented()||(c?.onContextMenu?.(x),x.isDefaultPrevented()||(g(x),x.preventDefault()))}}),[c,d?.props]),f=En(i,[i]),[h,g]=u.useState(null),{reference:m,component:y}=ha({label:l??"contextMenu",popperProps:a,parentFloat:r,anchor:{getBoundingClientRect:()=>new DOMRect(h?.clientX||0,h?.clientY||0)},onClose:()=>g(null),createPopupPanel:f});return u.useEffect(()=>{h?m.open(0):m.close(0)},[h]),s.jsxs(s.Fragment,{children:[u.cloneElement(n,p),y]})})),di=u.forwardRef((e,t)=>{const{slotProps:n,...o}=e,{getPortalContainer:r}=U3();return s.jsx(jj,{ref:t,slotProps:{...n,popper:{container:r,...n?.popper||{}}},...o})});di.displayName="SimpleTooltip";const D0=u.memo(e=>{const{modifier:t,sx:n,...o}=e;return s.jsx(Ae,{sx:{marginLeft:"1px",marginRight:"1px",borderRadius:"4px",borderStyle:"solid",borderTopWidth:"1px",borderLeftWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"2px",borderTopColor:r=>pt(r.palette.background.paper,r.palette.action.disabledOpacity),borderLeftColor:r=>pt(r.palette.background.paper,r.palette.action.disabledOpacity),borderRightColor:r=>pt(r.palette.background.paper,r.palette.action.disabledOpacity),borderBottomColor:r=>pt(r.palette.background.paper,1-r.palette.action.disabledOpacity),backgroundColor:r=>pt(r.palette.action.hover,r.palette.action.disabledOpacity),paddingLeft:"4px",paddingRight:"4px",minHeight:"1.6em",display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"content-box",overflow:"hidden",...n},...o,children:s.jsx(Ae,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center","& *":{fontWeight:"500"}},children:t})})}),UD=To.getOS()===To.OSType.MacOS||To.getOS()===To.OSType.IOS?"Cmd":"Ctrl",J3=(e,t=!1,n=null)=>{if(Array.isArray(e)){let i=[],a=e;for(let l=0;l<a.length;l++)i.push(J3(a[l],t,n??""+l));return s.jsx(Ae,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:i},n)}if(!e?.key)return null;const o={};for(let i=0;e.modifiers&&i<e.modifiers.length;i++)o[e.modifiers[i]]=!0;const r=[];return o?.ctrl&&(r.push(s.jsx(D0,{modifier:t?"^":s.jsx("div",{style:{paddingRight:"1px"},children:UD})},"ctrl")),r.push("+")),o?.alt&&(r.push(s.jsx(D0,{modifier:t?"⌥":"Alt"},"alt")),r.push("+")),o?.shift&&(r.push(s.jsx(D0,{modifier:t?"⇧":s.jsx("div",{style:{paddingRight:"1px"},children:"Shift"})},"shift")),r.push("+")),o?.meta&&(r.push(s.jsx(D0,{modifier:t?s.jsx("div",{style:{paddingTop:"1px"},children:"⌘"}):"Meta"},"meta")),r.push("+")),r.push(s.jsx(D0,{modifier:tO.toPrettyKeyCode(e.key)},"character")),s.jsx(Ae,{sx:{display:"flex",alignItems:"center"},children:r},n)},br=u.memo(u.forwardRef((e,t)=>{const{disabled:n=!1,label:o,shortcut:r,chips:i,description:a,maxWidth:l=280,useModifierSymbols:c=!1,children:d,simple:p,componentDisabled:f=!1,sx:h,...g}=e;let m=null;return r&&(m=J3(r,c)),s.jsx(di,{slotProps:{popper:{sx:{"& .MuiTooltip-tooltip":{marginTop:"0px !important"},...h},modifiers:[{name:"offset",options:{offset:[0,14]}}]}},className:"tooltip-wrapper",tabIndex:-1,title:!n&&o?s.jsxs(Ae,{sx:{maxWidth:`${l}px`},ref:t,children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",marginBottom:a?"4px":"0px"},children:[s.jsx(Tn,{variant:"subtitle1",component:"div",flex:"1 1 100%",children:o}),i?s.jsx(pv,{chips:i}):null,m?s.jsx(Ae,{sx:{marginLeft:"8px"}},"leadingSpace"):s.jsx(s.Fragment,{}),m]}),a?s.jsx(Tn,{variant:"caption",sx:{whiteSpace:"pre-line",lineHeight:"1.4"},children:a}):s.jsx(s.Fragment,{})]}):"",enterDelay:260,enterNextDelay:130,leaveDelay:230,disableInteractive:!0,...g,children:s.jsx("div",{style:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},children:d})})})),_2=s.jsx(Us,{}),qD=ze(s.jsx(R3,{})),ii=u.memo(u.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,disableHover:r=!1,parentFloat:i,selected:a,icon:l,tooltipProps:c,children:d,primary:p,sx:f,className:h,onFocus:g,onBlur:m,...y}=e,[x,v]=u.useState(!1),b={marginRight:"0px",padding:n?"2px":"7px",borderRadius:_=>`${_.shape.borderRadius}px`,color:_=>p?void 0:_.palette.text.icon??_.palette.action.active,border:_=>`solid ${o?_.palette.divider:"transparent"} 1px`,"& .MuiTouchRipple-child":{borderRadius:_=>`${_.shape.borderRadius}px !important`},"&.Mui-selected":{backgroundColor:_=>pt(_.palette.text.primary,_.palette.action.selectedOpacity),border:_=>`solid ${o?_.palette.text?.primary:_.palette.divider} 1px`},"&.Mui-disabled":{border:_=>`solid ${o?_.palette.divider:"transparent"} 1px`},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},"&.Mui-focusVisible":{outline:"solid transparent 1px",border:"1px solid transparent"},...f},w={"&:hover:not(.Mui-disabled, [disabled])":{color:_=>_.palette.text.primary,border:_=>`solid ${o?_.palette.text?.primary:_.palette.divider} 1px`,"&.Mui-selected":{backgroundColor:_=>pt(_.palette.text.primary,_.palette.action.selectedOpacity+_.palette.action.hoverOpacity)},"> .outline-hover":{outline:_=>`solid ${o?_.palette.text?.primary:_.palette.divider} 1px`},backgroundColor:null},"&.Mui-focusVisible":{outline:_=>`solid ${_.palette.primary.main} 1px`,border:_=>`1px solid ${_.palette?.primary?.main}`,zIndex:1}};let M=b;r||(M=To.mergeContentful(b,w));const k=u.useMemo(()=>{let _=typeof l=="function"?l():l;return _===null?_:_||(a===void 0?_2:qD)},[l,a]);let j=s.jsxs(Tr,{component:"div",ref:t,className:rr({"Mui-focusVisible":x,"Mui-selected":a},h),onFocus:_=>{v(!0),g?.(_)},onBlur:_=>{v(!1),m?.(_)},size:"small",TouchRippleProps:{center:!1},sx:M,edge:"end",...y,children:[k,d]});if(c)if(c.simple&&c.label&&!c.disabled){const{label:_,description:L,maxWidth:T,shortcut:D,useModifierSymbols:C,componentDisabled:S,simple:R,chips:P,ref:I,...z}=c;j=s.jsx(di,{disableInteractive:!0,title:_??"",...z,children:s.jsx(Ae,{sx:{display:"flex"},children:j})})}else j=s.jsx(br,{children:j,...c});return j})),KD=e=>e.icon,Gr=u.memo(u.forwardRef((e,t)=>{const{icon:n=_2,renderIcon:o=KD,parentFloat:r,className:i,onFocus:a,selected:l,onBlur:c,onMouseOver:d,onMouseOut:p,onMouseEnter:f,disabled:h,children:g,sx:m,tooltipProps:y,chips:x,primary:v,...b}=e,[w,M]=u.useState(!1),[k,j]=u.useState(!1),_=u.useMemo(()=>{const T=o?.({icon:n,disabled:h,selected:l});return T?s.jsx(D_,{className:rr({"Mui-focusVisible":w,"Mui-hovered":k}),sx:{"& .MuiSvgIcon-root":{color:D=>v?void 0:D.palette.text.icon??D.palette.action.active},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{"& .MuiSvgIcon-root":{color:D=>D.palette.text.primary}}},children:T}):null},[o,h,n,w,k,v,l]);let L=s.jsxs(v1,{ref:t,disabled:h,onMouseOver:T=>{d?.(T),T.isDefaultPrevented()||j(!0)},onMouseOut:T=>{p?.(T),T.isDefaultPrevented()||j(!1)},onMouseEnter:T=>{f?.(T),T.isDefaultPrevented()||r?.closeChild()},TouchRippleProps:{center:!1},className:rr({"Mui-focusVisible":w,"Mui-hovered":k},i),onFocus:T=>{a?.(T),M(!0)},onBlur:T=>{c?.(T),M(!1)},sx:{flex:"1 1 100%","&.Mui-disabled path.styled":{filter:"grayscale(65%)"},"&.Mui-selected":{color:T=>T.palette.text.primary},color:T=>T.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:T=>T.palette.text.primary},...m},...b,children:[_,g,x?s.jsx(pv,{chips:x}):null]});return y&&(L=s.jsx(br,{children:L,placement:"right-start",...y})),L})),Gs=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,primary:r=!1,variant:i="subtitle1",...a}=e;return s.jsx(s.Fragment,{children:s.jsx(Tn,{ref:t,variant:i,component:"div",sx:{userSelect:"none",fontWeight:"500",paddingLeft:"8px",paddingTop:i==="subtitle1"?"2px":void 0,paddingBottom:i==="subtitle1"?"2px":void 0,color:l=>r?void 0:l.palette.text.secondary,...o},...a,children:n})})})),qi=u.memo(u.forwardRef((e,t)=>{const{dense:n=!0,outlined:o=!1,label:r,selected:i=!1,onQuickClick:a,parentFloat:l,createPopupPanel:c,popupProps:d,onPopupOpen:p,onPopupClose:f,quickButtonProps:h,createQuickButton:g,tooltip:m="",createTooltip:y,icon:x,disabled:v,buttonProps:b=To.EmptyObject,disableHover:w,touchRippleRef:M,primary:k,children:j,sx:_,className:L,...T}=e,D=N3(),C=u.useMemo(()=>{const ee=(ae,we,se,J=se)=>{const ce=typeof o=="boolean"?null:o[ae];return typeof ce=="function"?ce(we):ce||(o?se:J)};return{outline:{color:ae=>ee("color",ae,ae.palette.divider,"transparent"),hoverColor:ae=>ee("hoverColor",ae,ae.palette.text?.primary,ae.palette.divider),focusColor:ae=>ee("focusColor",ae,ae.palette?.primary?.main)},active:D.palette.mode==="dark"?D.palette.text.secondary:D.palette.text.primary,text:D.palette.text.icon??D.palette.action.active}},[o,D]),[S,R]=u.useState(!1),[P,I]=u.useState(!1),[z,A]=u.useState(!1),O=u.useRef(null),N=u.useRef(null),F=ha({anchor:O.current,label:r,createPopupPanel:c,parentFloat:l,popperProps:d?.popperProps,onClose:()=>{R(!1),f?.()},onOpen:()=>{R(!0),p?.()}}),E=En(ee=>{a?.(ee),F.reference.close(0)},[a,F]),B=En(()=>{S?F.reference.close(0):F.reference.open(0)},[S,F,l,r]),H=u.useMemo(()=>{const ee={"&.bordered":{borderWidth:"1px",borderRadius:"0px",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:ne=>C.outline.color(ne),"&.Mui-focusVisible":{border:ne=>`1px solid ${C.outline.focusColor(ne)} !important`},"&:hover:not(.Mui-disabled, [disabled])":{borderColor:()=>w?"transparent":void 0,backgroundColor:()=>w?"transparent":void 0},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{borderColor:ne=>C.outline.hoverColor(ne)},"&.Mui-selected:not(.Mui-disabled, [disabled])":{borderColor:ne=>C.outline.hoverColor(ne)},"&.left":{borderTopLeftRadius:ne=>`${ne.shape.borderRadius}px`,borderBottomLeftRadius:ne=>`${ne.shape.borderRadius}px`,borderLeftStyle:"solid"},"&.hard-right":{borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:ne=>C.outline.color(ne)},"&.right":{borderTopRightRadius:ne=>`${ne.shape.borderRadius}px`,borderBottomRightRadius:ne=>`${ne.shape.borderRadius}px`,borderRightStyle:"solid"},"&.divider":{borderLeftWidth:"0px !important"}},"& .MuiTouchRipple-child":{borderRadius:ne=>`${ne.shape.borderRadius}px !important`}},ae={"&.Mui-selected":{backgroundColor:ne=>pt(ne.palette.primary.main,ne.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:ne=>pt(ne.palette.primary.main,ne.palette.action.selectedOpacity+ne.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ne=>pt(ne.palette.primary.main,ne.palette.action.selectedOpacity)}}}},we={maxHeight:"100%","&.Mui-selected":{backgroundColor:ne=>pt(ne.palette.text.icon??ne.palette.action.active,ne.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:ne=>pt(ne.palette.text.icon??ne.palette.action.active,ne.palette.action.selectedOpacity+ne.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ne=>pt(ne.palette.text.icon??ne.palette.action.active,ne.palette.action.selectedOpacity)}}},"&:hover:not(.Mui-disabled, [disabled])":{color:ne=>ne.palette.text.primary},backgroundColor:()=>w?"transparent":void 0,color:ne=>ne.palette.text.icon,"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},padding:()=>n?"2px 3px":"7px",marginRight:"0"},se=To.mergeContentful(we,ee),J=To.mergeContentful(se,ae),ce=To.mergeContentful(we,ee);return{quickButtonStyling:se,openQuickButtonStyling:J,compoundStyling:ce,openCompoundStyling:To.mergeContentful(ce,ae)}},[C,w]),U=En(ee=>{const{children:ae,ref:we,...se}=ee;return s.jsx(di,{ref:we,...se,disableInteractive:!0,children:ae})},[]),Z=a||g,G=Z&&(h?.tooltip||h?.createTooltip),V=ee=>{const{tooltip:ae,createTooltip:we,sx:se,...J}=ee;let ce=s.jsx(Tr,{sx:{...se},component:"div",...J});return G&&(ce=(we??U)({title:S?"":ae??m,children:s.jsx("div",{children:ce})},S)),ce},le={onKeyDown:ee=>{ee.keyCode===xr.Space?B():ee.keyCode===xr.F4||ee.keyCode===xr.Down?F.reference.open(0):ee.keyCode===xr.Up&&F.reference.close(0)}};let re=s.jsx(s.Fragment,{});const ge=u.useMemo(()=>typeof x=="function"?x():x,[x]);if(Z){let ee=S?H.openQuickButtonStyling:H.quickButtonStyling;const ae=(g||V)({tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseEnter:()=>{F.reference.parent.closeChild()},onMouseDown:se=>{se.button===0&&(se.preventDefault(),E(se))},touchRippleRef:M,children:ge,...h,className:rr({"Mui-focusVisible":P||S,"Mui-selected":i,"Mui-hovered":z||S,"Mui-disabled":v,bordered:!0,left:!0,"hard-right":!0},h?.className),sx:{...H.quickButtonStyling,height:"100%",...h?.sx}});let we=r8(!0,n,S);G&&(we=(y??U)({title:S?"":m,children:we},S)),re=s.jsxs(s.Fragment,{children:[ae,s.jsx(Tr,{ref:N,component:"div",className:rr({"Mui-selected":S,"Mui-hovered":z||S,"Mui-disabled":v,"Mui-focusVisible":P||S,bordered:!0,right:!0,divider:!0}),sx:{paddingLeft:(n?0:2)+"px",paddingRight:(n?0:2)+"px",width:()=>"1em",...H.quickButtonStyling,...ee},TouchRippleProps:{center:!1},tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseDown:se=>{se.button===0&&(se.preventDefault(),B())},children:we})]})}else{let ee=S?H.openCompoundStyling:H.compoundStyling;re=s.jsx(ii,{ref:N,tabIndex:-1,disabled:v,size:"small",icon:ge,className:rr({"Mui-selected":S||i,"Mui-hovered":z,"Mui-disabled":v,"Mui-focusVisible":P||S,bordered:!0,left:!0,right:!0}),sx:{...H.quickButtonStyling,...ee},onMouseDown:ae=>{ae.button===0&&(ae.preventDefault(),B())},children:r8(!1,n,S)})}const{className:Q,sx:xe,...be}=b;let Fe=s.jsx(Ae,{onFocus:()=>I(!0),onBlur:()=>I(!1),onMouseOver:()=>A(!0),onMouseOut:()=>A(!1),...le,"aria-label":"split button",ref:O,tabIndex:v?void 0:0,className:rr(Q,"split-button-root",{"Mui-focusVisible":P||S,"Mui-selected":S||i,"Mui-hovered":z,"Mui-disabled":v}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","&:not(.Mui-disabled)":{cursor:"pointer"},marginLeft:o?"1px":"0px",marginRight:o?"1px":"0px",borderRadius:ee=>`${ee.shape.borderRadius}px`,"&.Mui-focusVisible":{outline:ee=>`solid ${ee.palette.primary.main} 1px`,zIndex:2},...xe},...be,children:re});return G||(Fe=(y??U)({title:S?"":m,children:Fe},S)),s.jsxs(Ae,{className:rr(L,"popupIconButton"),ref:t,...T,sx:{zIndex:P||S?2:void 0,display:"flex",alignItems:"center",..._},children:[Fe,F.component]})}));qi.displayName="ExhibitPopupIconButton";const GD={},k1=u.memo(u.forwardRef((e,t)=>{const{selected:n=!1,label:o,onQuickClick:r,parentFloat:i,createPopupPanel:a,popupProps:l=GD,onPopupOpen:c,onPopupClose:d,quickButtonProps:p,createQuickButton:f,tooltip:h="",createTooltip:g,icon:m,disabled:y,touchRippleRef:x,primary:v,children:b,sx:w,...M}=e,[k,j]=u.useState(!1),[_,L]=u.useState(!1),[T,D]=u.useState(!1),[C,S]=u.useState(!1),R=u.useRef(null),P=u.useRef(null),I=u.useMemo(()=>{if(!l)return;const{popperProps:G}=l;return{placement:"right-start",offsets:[-4,-2],...G}},[l]),z=ha({anchor:R.current,label:o,createPopupPanel:a,parentFloat:i,popperProps:I,onClose:()=>{j(!1),d?.()},onOpen:()=>{j(!0),c?.()}}),A=En(G=>{G.button===0&&(r?.(G),z.reference.close(0))},[r]),O=s.jsx(Ax,{sx:{transform:()=>{}}}),N={"&.Mui-selected":{color:G=>G.palette.text.primary,"& svg * ":{color:G=>G.palette.text.primary}}},F=u.useCallback(G=>{const{children:V,ref:le,...re}=G;return s.jsx(di,{ref:le,...re,disableInteractive:!0,children:V})},[]),E=r||f,B=G=>{const{tooltip:V,createTooltip:le,...re}=G;return s.jsx(Gr,{icon:m,className:rr({"Mui-hovered":T}),sx:{flex:"1 1 100%",...N},...re,children:o})},H={onFocus:()=>{L(!0)},onBlur:()=>L(!1),onMouseOver:()=>{D(!0)},onMouseLeave:()=>{D(!1)},onMouseEnter:()=>{z.reference.open()},onMouseDown:G=>{G.button===0&&G.preventDefault()}};let U=s.jsx(s.Fragment,{});if(E){const G=(f||B)({tabIndex:-1,disabled:y,onMouseEnter:()=>{z.reference.parent.closeChild()},onMouseDown:V=>{V.button===0&&(V.preventDefault(),A(V))},className:rr("quick-left",{},p?.className),...p});U=s.jsxs(s.Fragment,{children:[G,s.jsx(wa,{sx:{ml:"0px",mr:"0px"},orientation:"vertical",variant:"middle",flexItem:!0}),s.jsx(v1,{ref:P,className:rr({"Mui-selected":k,"Mui-hovered":T}),sx:{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px",paddingLeft:"0px",paddingRight:"0px",marginLeft:"0px",color:V=>v?void 0:V.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:V=>V.palette.text.primary},...N},tabIndex:-1,disabled:y,...H,children:s.jsx(Ae,{className:"expand-icon",sx:{flex:"none",display:"flex",border:"1px solid transparent",paddingTop:"1px",paddingBottom:"1px",color:V=>v?void 0:V.palette.text.icon??V.palette.action.active},onMouseOver:V=>{V.preventDefault(),S(!0)},onMouseLeave:()=>{S(!1)},onClick:V=>{V.preventDefault(),k?z.reference.close():z.reference.open()},children:O})})]})}else U=s.jsxs(Gr,{ref:P,tabIndex:-1,disabled:y,icon:m,className:rr({"Mui-selected":k||n,"Mui-hovered":T}),sx:{flex:"1 1 100%",paddingRight:"0px",...N},onClick:G=>{G.preventDefault(),k?z.reference.close():z.reference.open()},...H,children:[s.jsx("div",{style:{flex:"1 1 100%"},children:o}),s.jsx(Ae,{className:"expand-icon2",sx:{flex:"none",display:"flex",color:G=>v?void 0:G.palette.text.icon??G.palette.action.active},children:O})]});let Z=s.jsx(Ae,{"aria-label":"split button",ref:R,tabIndex:y?void 0:0,className:rr({"Mui-disabled":y,"Mui-selected":k,"Mui-focusVisible":_||k,"Mui-hovered":T}),sx:{display:"flex",flex:"1 1 100%",alignItems:"center",width:"fit-content","& .quick-left":{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",marginRight:"-1px"},"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},...w},...M,children:U});return E&&!C&&(p?.tooltip||p?.createTooltip)&&(Z=(p?.createTooltip??F)({title:k?"":Z??p?.tooltip,children:Z},k)),s.jsxs(Ae,{ref:t,sx:{zIndex:_||k?2:void 0,display:"flex"," .tooltip-wrapper":{display:"flex",flex:"1 1 100%"}},children:[Z,z.component]})})),kv=u.memo(u.forwardRef((e,t)=>{const{onSelectToggle:n,selected:o=!1,label:r,shortcut:i,tabIndex:a=0,preventFocus:l=!1,...c}=e;return s.jsx(br,{label:r,shortcut:i,children:s.jsx(ii,{ref:t,outlined:!1,tabIndex:a,selected:o,onMouseDown:d=>{l&&d.preventDefault()},onClick:()=>{n?.(!o)},...c})})})),E1=u.memo(u.forwardRef((e,t)=>{const{children:n,selected:o=!0,outlined:r=!0,sx:i,...a}=e,l={display:"flex",border:d=>o?`solid ${r?d.palette.divider:"transparent"} 1px`:"solid transparent 1px",borderRadius:d=>`${d.shape.borderRadius}px`,backgroundColor:d=>{if(o)return pt(d.palette.text.icon??d.palette.action.active,d.palette.action.selectedOpacity)}};let c=n;return c===null&&(c=s.jsx(Us,{})),c||(c=s.jsx(R3,{})),c=ze(c),s.jsx(Ae,{ref:t,sx:{...l,...i},...a,children:c})}));function Er(){return Er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Er.apply(null,arguments)}function Ev(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}var ki,is,ZD={state:{},updateModal:function(){},hideModal:function(){},destroyModal:function(){},destroyModalsByRootId:function(){},showModal:function(){return{id:"id",hide:function(){},destroy:function(){},update:function(){}}}},Mv=u.createContext(void 0);(is=ki||(ki={})).SHOW="SHOW",is.HIDE="HIDE",is.UPDATE="UPDATE",is.DESTROY="DESTROY",is.DESTROY_BY_ROOT_ID="DESTROY_BY_ROOT_ID",is.UNKNOWN="UNKNOWN";var XD={};function YD(e,t){switch(t.type){case ki.SHOW:var n,o=t.payload,r=o.id,i=o.component,a=o.props,l=o.options;return Er({},e,((n={})[r]={component:i,props:Er({},a,{open:!0}),options:l},n));case ki.HIDE:var c,d=t.payload.id;return e[d]?Er({},e,((c={})[d]=Er({},e[d],{props:Er({},e[d].props,{open:!1})}),c)):e;case ki.UPDATE:var p,f=t.payload,h=f.id,g=f.props;return e[h]?Er({},e,((p={})[h]=Er({},e[h],{props:Er({},e[h].props,g)}),p)):e;case ki.DESTROY:var m=t.payload.id,y=Er({},e);return delete y[m],y;case ki.DESTROY_BY_ROOT_ID:var x=t.payload.rootId;return Object.keys(e).filter(function(v){return v.split(".")[0]!==x}).reduce(function(v,b){var w;return Er({},v,((w={})[b]=e[b],w))},{});default:throw new Error("Unexpected action")}}var Lp="[ERROR]: Modal ID is missing",Tv=function(e){e===void 0&&(e=8);for(var t=[],n=0;n<e;n++)t[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t.join("")},JD=["open"],QD=["showModal","destroyModalsByRootId"],a8={disableAutoDestroy:!1};function pd(e){e===void 0&&(e=a8);var t=Er({},a8,e).disableAutoDestroy,n=u.useContext(Mv)||ZD,o=n.showModal,r=n.destroyModalsByRootId,i=Ev(n,QD),a=u.useRef(Tv(6));return u.useEffect(function(){return function(){!t&&r&&r(a.current)}},[t,r]),Er({showModal:u.useCallback(function(l,c,d){return o(l,c,Er({rootId:a.current,hideOnClose:!0},d))},[o]),destroyModalsByRootId:r},i)}var _v=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ru=_v.join(","),jv=typeof Element>"u",Rl=jv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Gd=!jv&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Iu=function e(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert");return r===""||r==="true"||n&&t&&e(t.parentNode)},Rv=function(e,t,n){if(Iu(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Ru));return t&&Rl.call(e,Ru)&&o.unshift(e),o.filter(n)},Iv=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Iu(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{Rl.call(a,Ru)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var d=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),p=!Iu(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(d&&p){var f=e(d===!0?a.children:d.children,!0,o);o.flatten?r.push.apply(r,f):r.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return r},Pv=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Xa=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||(o=(t=e)==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable"))===""||o==="true")&&!Pv(e)?0:e.tabIndex;var t,n,o},eA=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ov=function(e){return e.tagName==="INPUT"},l8=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},Pu=function(e,t){return!(t.disabled||Iu(t)||(o=t,Ov(o)&&o.type==="hidden")||function(r,i){var a=i.displayCheck,l=i.getShadowRoot;if(getComputedStyle(r).visibility==="hidden")return!0;var c=Rl.call(r,"details>summary:first-of-type")?r.parentElement:r;if(Rl.call(c,"details:not([open]) *"))return!0;if(a&&a!=="full"&&a!=="legacy-full"){if(a==="non-zero-area")return l8(r)}else{if(typeof l=="function"){for(var d=r;r;){var p=r.parentElement,f=Gd(r);if(p&&!p.shadowRoot&&l(p)===!0)return l8(r);r=r.assignedSlot?r.assignedSlot:p||f===r.ownerDocument?p:f.host}r=d}if(function(h){var g,m,y,x,v=h&&Gd(h),b=(g=v)===null||g===void 0?void 0:g.host,w=!1;if(v&&v!==h)for(w=!!((m=b)!==null&&m!==void 0&&(y=m.ownerDocument)!==null&&y!==void 0&&y.contains(b)||h!=null&&(x=h.ownerDocument)!==null&&x!==void 0&&x.contains(h));!w&&b;){var M,k,j;w=!((k=b=(M=v=Gd(b))===null||M===void 0?void 0:M.host)===null||k===void 0||(j=k.ownerDocument)===null||j===void 0||!j.contains(b))}return w}(r))return!r.getClientRects().length;if(a!=="legacy-full")return!0}return!1}(t,e)||(n=t,n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(r){return r.tagName==="SUMMARY"}))||function(r){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(r.tagName))for(var i=r.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var a=0;a<i.children.length;a++){var l=i.children.item(a);if(l.tagName==="LEGEND")return!!Rl.call(i,"fieldset[disabled] *")||!l.contains(r)}return!0}i=i.parentElement}return!1}(t));var n,o},bh=function(e,t){return!(Ov(o=n=t)&&o.type==="radio"&&!function(r){if(!r.name)return!0;var i,a=r.form||Gd(r),l=function(d){return a.querySelectorAll('input[type="radio"][name="'+d+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")i=l(window.CSS.escape(r.name));else try{i=l(r.name)}catch(d){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",d.message),!1}var c=function(d,p){for(var f=0;f<d.length;f++)if(d[f].checked&&d[f].form===p)return d[f]}(i,r.form);return!c||c===r}(n)||Xa(t)<0||!Pu(e,t));var n,o},tA=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},nA=function e(t){var n=[],o=[];return t.forEach(function(r,i){var a,l,c,d=!!r.scopeParent,p=d?r.scopeParent:r,f=(l=d,(c=Xa(a=p))<0&&l&&!Pv(a)?0:c),h=d?e(r.candidates):p;f===0?d?n.push.apply(n,h):n.push(p):o.push({documentOrder:i,tabIndex:f,item:r,isScope:d,content:h})}),o.sort(eA).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Dv=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Iv([e],t.includeContainer,{filter:bh.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:tA}):Rv(e,t.includeContainer,bh.bind(null,t)),nA(n)},Av=function(e,t){return(t=t||{}).getShadowRoot?Iv([e],t.includeContainer,{filter:Pu.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Rv(e,t.includeContainer,Pu.bind(null,t))},gl=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Rl.call(e,Ru)!==!1&&bh(t,e)},oA=_v.concat("iframe").join(","),Zd=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Rl.call(e,oA)!==!1&&Pu(t,e)};const rA=Object.freeze(Object.defineProperty({__proto__:null,focusable:Av,getTabIndex:Xa,isFocusable:Zd,isTabbable:gl,tabbable:Dv},Symbol.toStringTag,{value:"Module"}));function zp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function iA(e,t,n){return(t=function(o){var r=function(i){if(typeof i!="object"||!i)return i;var a=i[Symbol.toPrimitive];if(a!==void 0){var l=a.call(i,"string");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}(o);return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function c8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s8(Object(n),!0).forEach(function(o){iA(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s8(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}var wc=function(e){return e?.key==="Tab"||e?.keyCode===9},aA=function(e){return wc(e)&&!e.shiftKey},lA=function(e){return wc(e)&&e.shiftKey},d8=function(e){return setTimeout(e,0)},A0=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return typeof e=="function"?e.apply(void 0,n):e},hd=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},sA=[];const cA=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(e,t){var n,o=t?.document||document,r=t?.trapStack||sA,i=c8({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:aA,isKeyBackward:lA},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l=function(T,D,C){return T&&T[D]!==void 0?T[D]:i[C||D]},c=function(T,D){var C=typeof D?.composedPath=="function"?D.composedPath():void 0;return a.containerGroups.findIndex(function(S){var R=S.container,P=S.tabbableNodes;return R.contains(T)||C?.includes(R)||P.find(function(I){return I===T})})},d=function(T){var D,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=C.hasFallback,R=S!==void 0&&S,P=C.params,I=P===void 0?[]:P,z=i[T];if(typeof z=="function"&&(z=z.apply(void 0,function(O){if(Array.isArray(O))return zp(O)}(D=I)||function(O){if(typeof Symbol<"u"&&O[Symbol.iterator]!=null||O["@@iterator"]!=null)return Array.from(O)}(D)||function(O,N){if(O){if(typeof O=="string")return zp(O,N);var F={}.toString.call(O).slice(8,-1);return F==="Object"&&O.constructor&&(F=O.constructor.name),F==="Map"||F==="Set"?Array.from(O):F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F)?zp(O,N):void 0}}(D)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
144
144
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),z===!0&&(z=void 0),!z){if(z===void 0||z===!1)return z;throw new Error("`".concat(T,"` was specified but was not a node, or did not return a node"))}var A=z;if(typeof z=="string"){try{A=o.querySelector(z)}catch(O){throw new Error("`".concat(T,'` appears to be an invalid selector; error="').concat(O.message,'"'))}if(!A&&!R)throw new Error("`".concat(T,"` as selector refers to no known node"))}return A},p=function(){var T=d("initialFocus",{hasFallback:!0});if(T===!1)return!1;if(T===void 0||T&&!Zd(T,i.tabbableOptions))if(c(o.activeElement)>=0)T=o.activeElement;else{var D=a.tabbableGroups[0];T=D&&D.firstTabbableNode||d("fallbackFocus")}else T===null&&(T=d("fallbackFocus"));if(!T)throw new Error("Your focus-trap needs to have at least one focusable element");return T},f=function(){if(a.containerGroups=a.containers.map(function(T){var D=Dv(T,i.tabbableOptions),C=Av(T,i.tabbableOptions),S=D.length>0?D[0]:void 0,R=D.length>0?D[D.length-1]:void 0,P=C.find(function(A){return gl(A)}),I=C.slice().reverse().find(function(A){return gl(A)}),z=!!D.find(function(A){return Xa(A)>0});return{container:T,tabbableNodes:D,focusableNodes:C,posTabIndexesFound:z,firstTabbableNode:S,lastTabbableNode:R,firstDomTabbableNode:P,lastDomTabbableNode:I,nextTabbableNode:function(A){var O=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],N=D.indexOf(A);return N<0?O?C.slice(C.indexOf(A)+1).find(function(F){return gl(F)}):C.slice(0,C.indexOf(A)).reverse().find(function(F){return gl(F)}):D[N+(O?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(T){return T.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(T){return T.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function(T){var D=T.activeElement;if(D)return D.shadowRoot&&D.shadowRoot.activeElement!==null?h(D.shadowRoot):D},g=function(T){var D;T!==!1&&T!==h(document)&&(T&&T.focus?(T.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=T,(D=T).tagName&&D.tagName.toLowerCase()==="input"&&typeof D.select=="function"&&T.select()):g(p()))},m=function(T){var D=d("setReturnFocus",{params:[T]});return D||D!==!1&&T},y=function(T){var D=T.target,C=T.event,S=T.isBackward,R=S!==void 0&&S;D=D||hd(C),f();var P=null;if(a.tabbableGroups.length>0){var I=c(D,C),z=I>=0?a.containerGroups[I]:void 0;if(I<0)P=R?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(R){var A=a.tabbableGroups.findIndex(function(H){var U=H.firstTabbableNode;return D===U});if(A<0&&(z.container===D||Zd(D,i.tabbableOptions)&&!gl(D,i.tabbableOptions)&&!z.nextTabbableNode(D,!1))&&(A=I),A>=0){var O=A===0?a.tabbableGroups.length-1:A-1,N=a.tabbableGroups[O];P=Xa(D)>=0?N.lastTabbableNode:N.lastDomTabbableNode}else wc(C)||(P=z.nextTabbableNode(D,!1))}else{var F=a.tabbableGroups.findIndex(function(H){var U=H.lastTabbableNode;return D===U});if(F<0&&(z.container===D||Zd(D,i.tabbableOptions)&&!gl(D,i.tabbableOptions)&&!z.nextTabbableNode(D))&&(F=I),F>=0){var E=F===a.tabbableGroups.length-1?0:F+1,B=a.tabbableGroups[E];P=Xa(D)>=0?B.firstTabbableNode:B.firstDomTabbableNode}else wc(C)||(P=z.nextTabbableNode(D))}}else P=d("fallbackFocus");return P},x=function(T){var D=hd(T);c(D,T)>=0||(A0(i.clickOutsideDeactivates,T)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):A0(i.allowOutsideClick,T)||T.preventDefault())},v=function(T){var D=hd(T),C=c(D,T)>=0;if(C||D instanceof Document)C&&(a.mostRecentlyFocusedNode=D);else{var S;T.stopImmediatePropagation();var R=!0;if(a.mostRecentlyFocusedNode)if(Xa(a.mostRecentlyFocusedNode)>0){var P=c(a.mostRecentlyFocusedNode),I=a.containerGroups[P].tabbableNodes;if(I.length>0){var z=I.findIndex(function(A){return A===a.mostRecentlyFocusedNode});z>=0&&(i.isKeyForward(a.recentNavEvent)?z+1<I.length&&(S=I[z+1],R=!1):z-1>=0&&(S=I[z-1],R=!1))}}else a.containerGroups.some(function(A){return A.tabbableNodes.some(function(O){return Xa(O)>0})})||(R=!1);else R=!1;R&&(S=y({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),g(S||a.mostRecentlyFocusedNode||p())}a.recentNavEvent=void 0},b=function(T){(i.isKeyForward(T)||i.isKeyBackward(T))&&function(D){var C=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=D;var S=y({event:D,isBackward:C});S&&(wc(D)&&D.preventDefault(),g(S))}(T,i.isKeyBackward(T))},w=function(T){var D;((D=T)==null?void 0:D.key)!=="Escape"&&D?.key!=="Esc"&&D?.keyCode!==27||A0(i.escapeDeactivates,T)===!1||(T.preventDefault(),n.deactivate())},M=function(T){var D=hd(T);c(D,T)>=0||A0(i.clickOutsideDeactivates,T)||A0(i.allowOutsideClick,T)||(T.preventDefault(),T.stopImmediatePropagation())},k=function(){if(a.active)return function(T,D){if(T.length>0){var C=T[T.length-1];C!==D&&C._setPausedState(!0)}var S=T.indexOf(D);S===-1||T.splice(S,1),T.push(D)}(r,n),a.delayInitialFocusTimer=i.delayInitialFocus?d8(function(){g(p())}):g(p()),o.addEventListener("focusin",v,!0),o.addEventListener("mousedown",x,{capture:!0,passive:!1}),o.addEventListener("touchstart",x,{capture:!0,passive:!1}),o.addEventListener("click",M,{capture:!0,passive:!1}),o.addEventListener("keydown",b,{capture:!0,passive:!1}),o.addEventListener("keydown",w),n},j=function(){if(a.active)return o.removeEventListener("focusin",v,!0),o.removeEventListener("mousedown",x,!0),o.removeEventListener("touchstart",x,!0),o.removeEventListener("click",M,!0),o.removeEventListener("keydown",b,!0),o.removeEventListener("keydown",w),n},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(function(T){T.some(function(D){return Array.from(D.removedNodes).some(function(C){return C===a.mostRecentlyFocusedNode})})&&g(p())}):void 0,L=function(){_&&(_.disconnect(),a.active&&!a.paused&&a.containers.map(function(T){_.observe(T,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(T){if(a.active)return this;var D=l(T,"onActivate"),C=l(T,"onPostActivate"),S=l(T,"checkCanFocusTrap");S||f(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=h(o),D?.();var R=function(){S&&f(),k(),L(),C?.()};return S?(S(a.containers.concat()).then(R,R),this):(R(),this)},deactivate:function(T){if(!a.active)return this;var D,C,S,R=c8({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},T);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,j(),a.active=!1,a.paused=!1,L(),C=n,(S=(D=r).indexOf(C))!==-1&&D.splice(S,1),D.length>0&&!D[D.length-1]._isManuallyPaused()&&D[D.length-1]._setPausedState(!1);var P=l(R,"onDeactivate"),I=l(R,"onPostDeactivate"),z=l(R,"checkCanReturnFocus"),A=l(R,"returnFocus","returnFocusOnDeactivate");P?.();var O=function(){d8(function(){A&&g(m(a.nodeFocusedBeforeActivation)),I?.()})};return A&&z?(z(m(a.nodeFocusedBeforeActivation)).then(O,O),this):(O(),this)},pause:function(T){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,T)):this},unpause:function(T){return a.active?(a.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,T)):this},updateContainerElements:function(T){var D=[].concat(T).filter(Boolean);return a.containers=D.map(function(C){return typeof C=="string"?o.querySelector(C):C}),a.active&&f(),L(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(T,D){if(a.paused===T)return this;if(a.paused=T,T){var C=l(D,"onPause"),S=l(D,"onPostPause");C?.(),j(),L(),S?.()}else{var R=l(D,"onUnpause"),P=l(D,"onPostUnpause");R?.(),f(),k(),L(),P?.()}return this}}}),n.updateContainerElements(e),n}},Symbol.toStringTag,{value:"Module"})),dA=Rb(cA),uA=Rb(rA);var u8,p8,pA=function(){if(p8)return u8;function e(f){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(f)}function t(){try{var f=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t=function(){return!!f})()}function n(f){return(n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(h){return h.__proto__||Object.getPrototypeOf(h)})(f)}function o(f,h){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,m){return g.__proto__=m,g})(f,h)}function r(f){var h=function(g){if(e(g)!="object"||!g)return g;var m=g[Symbol.toPrimitive];if(m!==void 0){var y=m.call(g,"string");if(e(y)!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}(f);return e(h)=="symbol"?h:h+""}p8=1;var i=u,a=th(),l=dA.createFocusTrap,c=uA.isFocusable,d=function(f){function h(y){var x,v,b,w;(function(j,_){if(!(j instanceof _))throw new TypeError("Cannot call a class as a function")})(this,h),function(j,_,L){(_=r(_))in j?Object.defineProperty(j,_,{value:L,enumerable:!0,configurable:!0,writable:!0}):j[_]=L}((v=this,w=[y],b=n(b=h),x=function(j,_){if(_&&(e(_)=="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(L){if(L===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L}(j)}(v,t()?Reflect.construct(b,w||[],n(v).constructor):b.apply(v,w))),"getNodeForOption",function(j){var _,L=(_=this.internalOptions[j])!==null&&_!==void 0?_:this.originalOptions[j];if(typeof L=="function"){for(var T=arguments.length,D=new Array(T>1?T-1:0),C=1;C<T;C++)D[C-1]=arguments[C];L=L.apply(void 0,D)}if(L===!0&&(L=void 0),!L){if(L===void 0||L===!1)return L;throw new Error("`".concat(j,"` was specified but was not a node, or did not return a node"))}var S,R=L;if(typeof L=="string"&&!(R=(S=this.getDocument())===null||S===void 0?void 0:S.querySelector(L)))throw new Error("`".concat(j,"` as selector refers to no known node"));return R}),x.handleDeactivate=x.handleDeactivate.bind(x),x.handlePostDeactivate=x.handlePostDeactivate.bind(x),x.handleClickOutsideDeactivates=x.handleClickOutsideDeactivates.bind(x),x.internalOptions={returnFocusOnDeactivate:!1,checkCanReturnFocus:null,onDeactivate:x.handleDeactivate,onPostDeactivate:x.handlePostDeactivate,clickOutsideDeactivates:x.handleClickOutsideDeactivates},x.originalOptions={returnFocusOnDeactivate:!0,onDeactivate:null,onPostDeactivate:null,checkCanReturnFocus:null,clickOutsideDeactivates:!1};var M=y.focusTrapOptions;for(var k in M)Object.prototype.hasOwnProperty.call(M,k)&&(k!=="returnFocusOnDeactivate"&&k!=="onDeactivate"&&k!=="onPostDeactivate"&&k!=="checkCanReturnFocus"&&k!=="clickOutsideDeactivates"?x.internalOptions[k]=M[k]:x.originalOptions[k]=M[k]);return x.outsideClick=null,x.focusTrapElements=y.containerElements||[],x.updatePreviousElement(),x}return function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),x&&o(y,x)}(h,f),g=h,m=[{key:"getDocument",value:function(){return this.props.focusTrapOptions.document||(typeof document<"u"?document:void 0)}},{key:"getReturnFocusNode",value:function(){var y=this.getNodeForOption("setReturnFocus",this.previouslyFocusedElement);return y||y!==!1&&this.previouslyFocusedElement}},{key:"updatePreviousElement",value:function(){var y=this.getDocument();y&&(this.previouslyFocusedElement=y.activeElement)}},{key:"deactivateTrap",value:function(){this.focusTrap&&this.focusTrap.active&&this.focusTrap.deactivate({returnFocus:!1,checkCanReturnFocus:null,onDeactivate:this.originalOptions.onDeactivate})}},{key:"handleClickOutsideDeactivates",value:function(y){var x=typeof this.originalOptions.clickOutsideDeactivates=="function"?this.originalOptions.clickOutsideDeactivates.call(null,y):this.originalOptions.clickOutsideDeactivates;return x&&(this.outsideClick={target:y.target,allowDeactivation:x}),x}},{key:"handleDeactivate",value:function(){this.originalOptions.onDeactivate&&this.originalOptions.onDeactivate.call(null),this.deactivateTrap()}},{key:"handlePostDeactivate",value:function(){var y=this,x=function(){var v=y.getReturnFocusNode(),b=!(!y.originalOptions.returnFocusOnDeactivate||v==null||!v.focus||y.outsideClick&&(!y.outsideClick.allowDeactivation||c(y.outsideClick.target,y.internalOptions.tabbableOptions))),w=y.internalOptions.preventScroll,M=w!==void 0&&w;b&&v.focus({preventScroll:M}),y.originalOptions.onPostDeactivate&&y.originalOptions.onPostDeactivate.call(null),y.outsideClick=null};this.originalOptions.checkCanReturnFocus?this.originalOptions.checkCanReturnFocus.call(null,this.getReturnFocusNode()).then(x,x):x()}},{key:"setupFocusTrap",value:function(){this.focusTrap?this.props.active&&!this.focusTrap.active&&(this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()):this.focusTrapElements.some(Boolean)&&(this.focusTrap=this.props._createFocusTrap(this.focusTrapElements,this.internalOptions),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause())}},{key:"componentDidMount",value:function(){this.props.active&&this.setupFocusTrap()}},{key:"componentDidUpdate",value:function(y){if(this.focusTrap){y.containerElements!==this.props.containerElements&&this.focusTrap.updateContainerElements(this.props.containerElements);var x=!y.active&&this.props.active,v=y.active&&!this.props.active,b=!y.paused&&this.props.paused,w=y.paused&&!this.props.paused;if(x&&(this.updatePreviousElement(),this.focusTrap.activate()),v)return void this.deactivateTrap();b&&this.focusTrap.pause(),w&&this.focusTrap.unpause()}else y.containerElements!==this.props.containerElements&&(this.focusTrapElements=this.props.containerElements),this.props.active&&(this.updatePreviousElement(),this.setupFocusTrap())}},{key:"componentWillUnmount",value:function(){this.deactivateTrap()}},{key:"render",value:function(){var y=this,x=this.props.children?i.Children.only(this.props.children):void 0;if(x){if(x.type&&x.type===i.Fragment)throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");return i.cloneElement(x,{ref:function(v){var b=y.props.containerElements;x&&(typeof x.ref=="function"?x.ref(v):x.ref&&(x.ref.current=v)),y.focusTrapElements=b||[v]}})}return null}}],m&&function(y,x){for(var v=0;v<x.length;v++){var b=x[v];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,r(b.key),b)}}(g.prototype,m),Object.defineProperty(g,"prototype",{writable:!1}),g;var g,m}(i.Component),p=typeof Element>"u"?Function:Element;return d.propTypes={active:a.bool,paused:a.bool,focusTrapOptions:a.shape({document:a.object,onActivate:a.func,onPostActivate:a.func,checkCanFocusTrap:a.func,onPause:a.func,onPostPause:a.func,onUnpause:a.func,onPostUnpause:a.func,onDeactivate:a.func,onPostDeactivate:a.func,checkCanReturnFocus:a.func,initialFocus:a.oneOfType([a.instanceOf(p),a.string,a.bool,a.func]),fallbackFocus:a.oneOfType([a.instanceOf(p),a.string,a.func]),escapeDeactivates:a.oneOfType([a.bool,a.func]),clickOutsideDeactivates:a.oneOfType([a.bool,a.func]),returnFocusOnDeactivate:a.bool,setReturnFocus:a.oneOfType([a.instanceOf(p),a.string,a.bool,a.func]),allowOutsideClick:a.oneOfType([a.bool,a.func]),preventScroll:a.bool,tabbableOptions:a.shape({displayCheck:a.oneOf(["full","legacy-full","non-zero-area","none"]),getShadowRoot:a.oneOfType([a.bool,a.func])}),trapStack:a.array,isKeyForward:a.func,isKeyBackward:a.func}),containerElements:a.arrayOf(a.instanceOf(p)),children:a.oneOfType([a.element,a.instanceOf(p)])},d.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:l},u8=d}();const hA=jb(pA);var h8,f8,L0={exports:{}},m8={},fd={exports:{}},$o={},dl={};function Ou(){return f8||(f8=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},dl.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},dl.int=function(e){return parseInt(e,10)},dl.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},dl.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),dl}var g8,y8,La={};function vh(){if(y8)return $o;y8=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.addClassName=a,$o.addEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.addEventListener?c.addEventListener(d,p,h):c.attachEvent?c.attachEvent("on"+d,p):c["on"+d]=p},$o.addUserSelectStyles=function(c){if(!c)return;let d=c.getElementById("react-draggable-style-el");d||(d=c.createElement("style"),d.type="text/css",d.id="react-draggable-style-el",d.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
145
145
  `,d.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
146
- `,c.getElementsByTagName("head")[0].appendChild(d)),c.body&&a(c.body,"react-draggable-transparent-selection")},$o.createCSSTransform=function(c,d){const p=r(c,d,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},$o.createSVGTransform=function(c,d){return r(c,d,"")},$o.getTouch=function(c,d){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>d===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>d===p.identifier)},$o.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},$o.getTranslation=r,$o.innerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingTop),d-=(0,e.int)(p.paddingBottom),d},$o.innerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingLeft),d-=(0,e.int)(p.paddingRight),d},$o.matchesSelector=o,$o.matchesSelectorAndParentsTo=function(c,d,p){let f=c;do{if(o(f,d))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},$o.offsetXYFromParent=function(c,d,p){const f=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect();return{x:(c.clientX+d.scrollLeft-f.left)/p,y:(c.clientY+d.scrollTop-f.top)/p}},$o.outerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderTopWidth),d+=(0,e.int)(p.borderBottomWidth),d},$o.outerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderLeftWidth),d+=(0,e.int)(p.borderRightWidth),d},$o.removeClassName=l,$o.removeEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(d,p,h):c.detachEvent?c.detachEvent("on"+d,p):c["on"+d]=null},$o.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=Ou(),t=function(c){if(typeof WeakMap=="function")var d=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(f=d){if(f.has(p))return f.get(p);f.set(p,g)}for(const m in p)m!=="default"&&{}.hasOwnProperty.call(p,m)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,m))&&(h.get||h.set)?f(g,m,h):g[m]=p[m]);return g}(c)}(function(){if(g8)return La;g8=1,Object.defineProperty(La,"__esModule",{value:!0}),La.browserPrefixToKey=p,La.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},La.default=void 0,La.getPrefix=d;const c=["Moz","Webkit","O","ms"];function d(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let g=0;g<c.length;g++)if(p(f,c[g])in h)return c[g];return""}function p(f,h){return h?`${h}${function(g){let m="",y=!0;for(let x=0;x<g.length;x++)y?(m+=g[x].toUpperCase(),y=!1):g[x]==="-"?y=!0:m+=g[x];return m}(f)}`:f}return La.default=d(),La}());let n="";function o(c,d){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](d)}function r(c,d,p){let{x:f,y:h}=c,g=`translate(${f}${p},${h}${p})`;return d&&(g=`translate(${typeof d.x=="string"?d.x:d.x+p}, ${typeof d.y=="string"?d.y:d.y+p})`+g),g}function i(c){if(c)try{if(c.body&&l(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const d=(c.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function a(c,d){c.classList?c.classList.add(d):c.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(c.className+=` ${d}`)}function l(c,d){c.classList?c.classList.remove(d):c.className=c.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return $o}var x8,Ji={};function b8(){if(x8)return Ji;x8=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Ji.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Ji.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),l=n(o);return a?{node:l,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:l,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Ji.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Ji.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;var l;a=typeof a=="string"?a:{left:(l=a).left,top:l.top,right:l.right,bottom:l.bottom};const c=n(o);if(typeof a=="string"){const{ownerDocument:d}=c,p=d.defaultView;let f;if(f=a==="parent"?c.parentNode:c.getRootNode().querySelector(a),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,g=p.getComputedStyle(c),m=p.getComputedStyle(h);a={left:-c.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(g.marginLeft),top:-c.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(g.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(g.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(g.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},Ji.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const l=n(i),c=i.props.offsetParent||l.offsetParent||l.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},Ji.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Ou(),t=vh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Ji}var v8,w8,S8,C8,z0={},Fp={};function k8(){return v8||(v8=1,Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.default=function(){}),Fp}var fA=function(){if(C8)return L0.exports;C8=1;const{default:e,DraggableCore:t}=(S8||(S8=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),n.default=void 0;var o=function(x){if(typeof WeakMap=="function")var v=new WeakMap;return function(b){if(b&&b.__esModule)return b;var w,M,k={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return k;if(w=v){if(w.has(b))return w.get(b);w.set(b,k)}for(const j in b)j!=="default"&&{}.hasOwnProperty.call(b,j)&&((M=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,j))&&(M.get||M.set)?w(k,j,M):k[j]=b[j]);return k}(x)}(u),r=h(th()),i=h(yo),a=function(){if(h8)return fd.exports;function x(b){var w,M,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b)){var j=b.length;for(w=0;w<j;w++)b[w]&&(M=x(b[w]))&&(k&&(k+=" "),k+=M)}else for(M in b)b[M]&&(k&&(k+=" "),k+=M);return k}function v(){for(var b,w,M=0,k="",j=arguments.length;M<j;M++)(b=arguments[M])&&(w=x(b))&&(k&&(k+=" "),k+=w);return k}return h8=1,fd.exports=v,fd.exports.clsx=v,fd.exports}(),l=vh(),c=b8(),d=Ou(),p=h(function(){if(w8)return z0;w8=1,Object.defineProperty(z0,"__esModule",{value:!0}),z0.default=void 0;var x=function(R){if(typeof WeakMap=="function")var P=new WeakMap;return function(I){if(I&&I.__esModule)return I;var z,A,O={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return O;if(z=P){if(z.has(I))return z.get(I);z.set(I,O)}for(const N in I)N!=="default"&&{}.hasOwnProperty.call(I,N)&&((A=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,N))&&(A.get||A.set)?z(O,N,A):O[N]=I[N]);return O}(R)}(u),v=_(th()),b=_(yo),w=vh(),M=b8(),k=Ou(),j=_(k8());function _(R){return R&&R.__esModule?R:{default:R}}function L(R,P,I){return(P=typeof(z=function(A){if(typeof A!="object"||!A)return A;var O=A[Symbol.toPrimitive];if(O!==void 0){var N=O.call(A,"string");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(P))=="symbol"?z:z+"")in R?Object.defineProperty(R,P,{value:I,enumerable:!0,configurable:!0,writable:!0}):R[P]=I,R;var z}const T={start:"touchstart",move:"touchmove",stop:"touchend"},D={start:"mousedown",move:"mousemove",stop:"mouseup"};let C=D,S=class extends x.Component{constructor(){super(...arguments),L(this,"dragging",!1),L(this,"lastX",NaN),L(this,"lastY",NaN),L(this,"touchIdentifier",null),L(this,"mounted",!1),L(this,"handleDragStart",R=>{if(this.props.onMouseDown(R),!this.props.allowAnyClick&&typeof R.button=="number"&&R.button!==0)return!1;const P=this.findDOMNode();if(!P||!P.ownerDocument||!P.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:I}=P;if(this.props.disabled||!(R.target instanceof I.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(R.target,this.props.handle,P)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(R.target,this.props.cancel,P))return;R.type!=="touchstart"||this.props.allowMobileScroll||R.preventDefault();const z=(0,w.getTouchIdentifier)(R);this.touchIdentifier=z;const A=(0,M.getControlPosition)(R,z,this);if(A==null)return;const{x:O,y:N}=A,F=(0,M.createCoreData)(this,O,N);(0,j.default)("DraggableCore: handleDragStart: %j",F),(0,j.default)("calling",this.props.onStart),this.props.onStart(R,F)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(I),this.dragging=!0,this.lastX=O,this.lastY=N,(0,w.addEvent)(I,C.move,this.handleDrag),(0,w.addEvent)(I,C.stop,this.handleDragStop))}),L(this,"handleDrag",R=>{const P=(0,M.getControlPosition)(R,this.touchIdentifier,this);if(P==null)return;let{x:I,y:z}=P;if(Array.isArray(this.props.grid)){let O=I-this.lastX,N=z-this.lastY;if([O,N]=(0,M.snapToGrid)(this.props.grid,O,N),!O&&!N)return;I=this.lastX+O,z=this.lastY+N}const A=(0,M.createCoreData)(this,I,z);if((0,j.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(R,A)!==!1&&this.mounted!==!1)this.lastX=I,this.lastY=z;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const O=document.createEvent("MouseEvents");O.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(O)}}),L(this,"handleDragStop",R=>{if(!this.dragging)return;const P=(0,M.getControlPosition)(R,this.touchIdentifier,this);if(P==null)return;let{x:I,y:z}=P;if(Array.isArray(this.props.grid)){let N=I-this.lastX||0,F=z-this.lastY||0;[N,F]=(0,M.snapToGrid)(this.props.grid,N,F),I=this.lastX+N,z=this.lastY+F}const A=(0,M.createCoreData)(this,I,z);if(this.props.onStop(R,A)===!1||this.mounted===!1)return!1;const O=this.findDOMNode();O&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(O.ownerDocument),(0,j.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,O&&((0,j.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(O.ownerDocument,C.move,this.handleDrag),(0,w.removeEvent)(O.ownerDocument,C.stop,this.handleDragStop))}),L(this,"onMouseDown",R=>(C=D,this.handleDragStart(R))),L(this,"onMouseUp",R=>(C=D,this.handleDragStop(R))),L(this,"onTouchStart",R=>(C=T,this.handleDragStart(R))),L(this,"onTouchEnd",R=>(C=T,this.handleDragStop(R)))}componentDidMount(){this.mounted=!0;const R=this.findDOMNode();R&&(0,w.addEvent)(R,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const R=this.findDOMNode();if(R){const{ownerDocument:P}=R;(0,w.removeEvent)(P,D.move,this.handleDrag),(0,w.removeEvent)(P,T.move,this.handleDrag),(0,w.removeEvent)(P,D.stop,this.handleDragStop),(0,w.removeEvent)(P,T.stop,this.handleDragStop),(0,w.removeEvent)(R,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(P)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:b.default.findDOMNode(this)}render(){return x.cloneElement(x.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return z0.default=S,L(S,"displayName","DraggableCore"),L(S,"propTypes",{allowAnyClick:v.default.bool,allowMobileScroll:v.default.bool,children:v.default.node.isRequired,disabled:v.default.bool,enableUserSelectHack:v.default.bool,offsetParent:function(R,P){if(R[P]&&R[P].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:v.default.arrayOf(v.default.number),handle:v.default.string,cancel:v.default.string,nodeRef:v.default.object,onStart:v.default.func,onDrag:v.default.func,onStop:v.default.func,onMouseDown:v.default.func,scale:v.default.number,className:k.dontSetMe,style:k.dontSetMe,transform:k.dontSetMe}),L(S,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),z0}()),f=h(k8());function h(x){return x&&x.__esModule?x:{default:x}}function g(){return g=Object.assign?Object.assign.bind():function(x){for(var v=1;v<arguments.length;v++){var b=arguments[v];for(var w in b)({}).hasOwnProperty.call(b,w)&&(x[w]=b[w])}return x},g.apply(null,arguments)}function m(x,v,b){return(v=typeof(w=function(M){if(typeof M!="object"||!M)return M;var k=M[Symbol.toPrimitive];if(k!==void 0){var j=k.call(M,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(M)}(v))=="symbol"?w:w+"")in x?Object.defineProperty(x,v,{value:b,enumerable:!0,configurable:!0,writable:!0}):x[v]=b,x;var w}class y extends o.Component{static getDerivedStateFromProps(v,b){let{position:w}=v,{prevPropsPosition:M}=b;return!w||M&&w.x===M.x&&w.y===M.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:M}),{x:w.x,y:w.y,prevPropsPosition:{...w}})}constructor(v){super(v),m(this,"onDragStart",(b,w)=>{if((0,f.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,c.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,f.default)("Draggable: onDrag: %j",w);const M=(0,c.createDraggableData)(this,w),k={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:_}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[L,T]=(0,c.getBoundPosition)(this,k.x,k.y);k.x=L,k.y=T,k.slackX=this.state.slackX+(j-k.x),k.slackY=this.state.slackY+(_-k.y),M.x=k.x,M.y=k.y,M.deltaX=k.x-this.state.x,M.deltaY=k.y-this.state.y}if(this.props.onDrag(b,M)===!1)return!1;this.setState(k)}),m(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,c.createDraggableData)(this,w))===!1)return!1;(0,f.default)("Draggable: onDragStop: %j",w);const M={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:k,y:j}=this.props.position;M.x=k,M.y=j}this.setState(M)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},!v.position||v.onDrag||v.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??i.default.findDOMNode(this)}render(){const{axis:v,bounds:b,children:w,defaultPosition:M,defaultClassName:k,defaultClassNameDragging:j,defaultClassNameDragged:_,position:L,positionOffset:T,scale:D,...C}=this.props;let S={},R=null;const P=!L||this.state.dragging,I=L||M,z={x:(0,c.canDragX)(this)&&P?this.state.x:I.x,y:(0,c.canDragY)(this)&&P?this.state.y:I.y};this.state.isElementSVG?R=(0,l.createSVGTransform)(z,T):S=(0,l.createCSSTransform)(z,T);const A=(0,a.clsx)(w.props.className||"",k,{[j]:this.state.dragging,[_]:this.state.dragged});return o.createElement(p.default,g({},C,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(w),{className:A,style:{...w.props.style,...S},transform:R}))}}n.default=y,m(y,"displayName","Draggable"),m(y,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),m(y,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(m8)),m8);return L0.exports=e,L0.exports.default=e,L0.exports.DraggableCore=t,L0.exports}();const mA=jb(fA),E8={x:0,y:0},gA=u.memo(u.forwardRef((e,t)=>{const{defaultPosition:n=E8,PaperComponent:o=Ti,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:a=".draggable-title",titleSize:l,rootSize:c,...d}=e,p=u.useRef(null),f=u.useMemo(()=>l&&c?{left:0,top:0,right:c.width-l.width,bottom:c.height-l.height}:null,[l,c]),[h,g]=u.useState(null),[m,y]=u.useState(null),[x,v]=u.useState(null);return u.useLayoutEffect(()=>{!h&&n&&g(n??E8)},[n]),u.useEffect(()=>{f&&h&&y({x:Math.max(0,Math.min(h.x,f.right)),y:Math.max(0,Math.min(h.y,f.bottom))})},[h,f]),s.jsx(mA,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:m,bounds:f??".MuiModal-root",onStop:r,onStart:(b,w)=>{const M=b;v({x:(M.clientX??M.touches?.[0]?.clientX)-w.x,y:(M.clientY??M.touches?.[0]?.clientY)-w.y})},onDrag:(b,w)=>{const M=b,k=M.clientX??M.touches?.[0]?.clientX,j=M.clientY??M.touches?.[0]?.clientY;g({x:k-x.x,y:j-x.y})},children:s.jsx(o,{ref:_u([p,t]),...d})})})),yA={x:"50",y:"50"},Lv=u.memo(u.forwardRef((e,t)=>{const n=function({props:ce,name:ne}){return function({props:Pe,name:Ee,defaultTheme:it,themeId:Ue}){let ke=function(_e=aP){return function(Xe=null){const Be=X.useContext(t0);return Be&&(ct=Be,Object.keys(ct).length!==0)?Be:Xe;var ct}(_e)}(it);return ke=ke[Ue]||ke,bP({theme:ke,name:Ee,props:Pe})}({props:ce,name:ne,defaultTheme:B3,themeId:I3})}({props:e,name:"MuiDialog"}),o=N3(),r={enter:.66*o.transitions.duration.enteringScreen,exit:.66*o.transitions.duration.leavingScreen},{title:i="SheetXL",key:a="draggable-window",onCancel:l,onDone:c,onShow:d,onShown:p,onHide:f,open:h,autoFocusSel:g,children:m,TransitionComponent:y=Sx,TransitionProps:x,transitionDuration:v=r,BackdropComponent:b=Cx,BackdropProps:w,PaperComponent:M=Ti,PaperProps:k,onBackdropClick:j,sx:_,className:L,onMouseDown:T,initialPosition:D=yA,isModal:C=!1,...S}=n,R=u.useRef(null),[P,I]=u.useState(null),[z,A]=u.useState(!1),[O,N]=u.useState(!1),F=u.useRef(null),[E,B]=Y7(),H=u.useRef(null),[U,Z]=Y7(),G=u.useRef(null);u.useEffect(()=>{P&&A(h)},[h,P]);const V=En(()=>{l?.(),A(!1)},[l]);u.useEffect(()=>{if(B.width===0&&B.height===0||P)return;const ce=G.current?.getBoundingClientRect(),ne=B.height-ce.height,Pe=B.width-ce.width;let Ee=.5*Pe,it=.5*ne;typeof D?.x=="number"?Ee=D.x:typeof D?.x=="string"&&(Ee=Pe*(parseFloat(D.x)/100)),typeof D?.y=="number"?it=D.y:typeof D?.y=="string"&&(it=ne*(parseFloat(D.y)/100)),I({x:Ee,y:it})},[B,Z]);const[le,re]=u.useState(!1),[ge,Q]=u.useState(null),[xe,be]=u.useState(null),Fe=En(ce=>{if(ge)return ge.focus(ce),!0;if(g){const ne=H.current?.querySelectorAll?.(g);if(ne&&ne.length>0)return ne[0]?.focus?.(ce),!0}return H.current?.focus?.(ce),!1},[ge,g]),ee=T2(t,()=>({focus:ce=>{Fe(ce)}}),[]),ae={...x,onExited:ce=>{c?.(null),x?.onExited?.(ce)},onExit:ce=>{const ne=xe;ne&&requestAnimationFrame(()=>{ee.current?.contains(document.activeElement)&&ne.focus()}),f?.(),N(!1),x?.onExit?.(ce)},onEntered:(ce,ne)=>{d?.(),x?.onEntered?.(ce,ne)},onEntering:(ce,ne)=>{N(!0),p?.(ee.current)}};u.useEffect(()=>{O&&Fe()},[O]);const we=s.jsx(hA,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:R,active:O,children:s.jsx(y,{in:z,timeout:v,role:"presentation",...ae,children:s.jsx(Ae,{className:"MuiDialog-container",ref:H,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:ce=>{ce.which===xr.Escape&&(V(),F.current?.start(ce,{center:!1}),setTimeout(()=>F.current?.stop(ce),180)),ce.stopPropagation()},children:s.jsxs(gA,{ref:_u([G,t]),className:rr({"Mui-focusVisible":le},L),sx:{"& *":ce=>Y3(ce),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:ce=>`solid ${pt(ce.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:ce=>`solid ${pt(ce.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",..._},defaultPosition:P,titleSize:Z,rootSize:B,PaperComponent:M,...S,...k,children:[i?s.jsx(Mx,{className:rr({"Mui-selected":le},"draggable-title"),sx:{cursor:"move",display:"flex",color:ce=>ce.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:ce=>`${ce.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:ce=>ce.transitions.duration.shortest/2+"ms"},backgroundColor:ce=>pt(ce.palette.action.hover,.03)},ref:U,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:ce=>ce.spacing(1),marginLeft:ce=>ce.spacing(1),marginRight:ce=>ce.spacing(1)},children:[s.jsx(Ae,{sx:{flex:"1 1 100%",paddingLeft:ce=>ce.spacing(1)},children:i}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:ce=>ce.palette.text.icon??ce.palette.action.active},touchRippleRef:F,onPointerDown:ce=>{F.current?.start(ce,{center:!1}),ce.stopPropagation(),ce.preventDefault()},onPointerUp:V,children:s.jsx(M3,{})})})]})}):null,m]})})})});let se=null;C&&(se=s.jsx(b,{...w,open:z,onMouseDown:ce=>{V(),w?.onMouseDown?.(ce)},onClick:ce=>{j?.(ce),w?.onClick?.(ce)},sx:{pointerEvents:"auto",...w?.sx}}));const{getPortalContainer:J}=U3();return yo.createPortal(s.jsxs(Ae,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:_u([ee,E]),onPointerDown:ce=>{le&&(ce.target===H.current||ce.target.tabIndex<0)&&H.current?.contains(document.activeElement)},onContextMenu:ce=>{ce.isPropagationStopped()||ce.preventDefault()},onFocus:ce=>{!le&&(ce.target===H.current||ce.target.tabIndex<0)&&setTimeout(()=>{Fe()},100),R.current?.focusTrap?.unpause(),re(!0),H.current?.contains(ce.target)&&ce.target!==H.current&&Q(ce.target),ce.relatedTarget&&!xe&&be(ce.relatedTarget)},onBlur:ce=>{ee?.current?.contains(ce.relatedTarget)||(be(null),R.current?.focusTrap?.pause(),re(!1))},children:[se,we]}),J(),a+"")}));var Mi=typeof window<"u"?window:{screen:{},navigator:{}},Zs=(Mi.matchMedia||function(){return{matches:!1}}).bind(Mi),xA={get passive(){return!0}},M8=function(){};Mi.addEventListener&&Mi.addEventListener("p",M8,xA),Mi.removeEventListener&&Mi.removeEventListener("p",M8,!1);var Q3="ontouchstart"in Mi,bA=Q3||"TouchEvent"in Mi&&Zs("(any-pointer: coarse)").matches,T8=(Mi.navigator.maxTouchPoints||0)>0||bA,zv=Mi.navigator.userAgent||"",vA=Zs("(pointer: coarse)").matches&&/iPad|Macintosh/.test(zv)&&Math.min(Mi.screen.width||0,Mi.screen.height||0)>=768,Fv=(Zs("(pointer: coarse)").matches||!Zs("(pointer: fine)").matches&&Q3)&&!/Windows.*Firefox/.test(zv),wA=Zs("(any-pointer: fine)").matches||Zs("(any-hover: hover)").matches||vA||!Q3,_8=!T8||!wA&&Fv?T8?"touchOnly":"mouseOnly":"hybrid",SA=_8==="mouseOnly"?"mouse":_8==="touchOnly"||Fv?"touch":"mouse",Sc=e=>e.type==="checkbox",El=e=>e instanceof Date,Lr=e=>e==null;const Bv=e=>typeof e=="object";var Zo=e=>!Lr(e)&&!Array.isArray(e)&&Bv(e)&&!El(e),ef=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Cr(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(ef&&(e instanceof Blob||o)||!n&&!Zo(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return Zo(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Cr(e[r]));else t=e}return t}var j2=e=>/^\w*$/.test(e),Jo=e=>e===void 0,wh=e=>Array.isArray(e)?e.filter(Boolean):[],tf=e=>wh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Kt=(e,t,n)=>{if(!t||!Zo(e))return n;const o=(j2(t)?[t]:tf(t)).reduce((r,i)=>Lr(r)?r:r[i],e);return Jo(o)||o===e?Jo(e[t])?n:e[t]:o},oa=e=>typeof e=="boolean",xo=(e,t,n)=>{let o=-1;const r=j2(t)?[t]:tf(t),i=r.length,a=i-1;for(;++o<i;){const l=r[o];let c=n;if(o!==a){const d=e[l];c=Zo(d)||Array.isArray(d)?d:isNaN(+r[o+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Nv="onChange",$v="onSubmit",oc="all",j8="pattern",R8="required",Vv=u.createContext(null);Vv.displayName="HookFormContext";const CA=e=>{const{children:t,...n}=e;return u.createElement(Vv.Provider,{value:n},t)},kA=typeof window<"u"?X.useLayoutEffect:X.useEffect;var sa=e=>typeof e=="string",EA=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},rc=e=>Array.isArray(e)?e:[e],I8=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Sh=e=>Lr(e)||!Bv(e);function qa(e,t){if(Sh(e)||Sh(t))return e===t;if(El(e)&&El(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const a=t[r];if(El(i)&&El(a)||Zo(i)&&Zo(a)||Array.isArray(i)&&Array.isArray(a)?!qa(i,a):i!==a)return!1}}return!0}var $r=e=>Zo(e)&&!Object.keys(e).length,nf=e=>e.type==="file",$i=e=>typeof e=="function",Du=e=>{if(!ef)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hv=e=>e.type==="select-multiple",of=e=>e.type==="radio",Bp=e=>Du(e)&&e.isConnected;function nr(e,t){const n=Array.isArray(t)?t:j2(t)?[t]:tf(t),o=n.length===1?e:function(a,l){const c=l.slice(0,-1).length;let d=0;for(;d<c;)a=Jo(a)?d++:a[l[d++]];return a}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(Zo(o)&&$r(o)||Array.isArray(o)&&function(a){for(const l in a)if(a.hasOwnProperty(l)&&!Jo(a[l]))return!1;return!0}(o))&&nr(e,n.slice(0,-1)),e}var Wv=e=>{for(const t in e)if($i(e[t]))return!0;return!1};function Au(e,t={}){const n=Array.isArray(e);if(Zo(e)||n)for(const o in e)Array.isArray(e[o])||Zo(e[o])&&!Wv(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Au(e[o],t[o])):Lr(e[o])||(t[o]=!0);return t}function Uv(e,t,n){const o=Array.isArray(e);if(Zo(e)||o)for(const r in e)Array.isArray(e[r])||Zo(e[r])&&!Wv(e[r])?Jo(t)||Sh(n[r])?n[r]=Array.isArray(e[r])?Au(e[r],[]):{...Au(e[r])}:Uv(e[r],Lr(t)?{}:t[r],n[r]):n[r]=!qa(e[r],t[r]);return n}var F0=(e,t)=>Uv(e,t,Au(t));const P8={value:!1,isValid:!1},O8={value:!0,isValid:!0};var qv=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Jo(e[0].attributes.value)?Jo(e[0].value)||e[0].value===""?O8:{value:e[0].value,isValid:!0}:O8:P8}return P8},Kv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Jo(e)?e:t?e===""?NaN:e&&+e:n&&sa(e)?new Date(e):o?o(e):e;const D8={isValid:!1,value:null};var Gv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,D8):D8;function A8(e){const t=e.ref;return nf(t)?t.files:of(t)?Gv(e.refs).value:Hv(t)?[...t.selectedOptions].map(({value:n})=>n):Sc(t)?qv(e.refs).value:Kv(Jo(t.value)?e.ref.value:t.value,e)}var Lu=e=>e instanceof RegExp,B0=e=>Jo(e)?e:Lu(e)?e.source:Zo(e)?Lu(e.value)?e.value.source:e.value:e,L8=e=>({isOnSubmit:!e||e===$v,isOnBlur:e==="onBlur",isOnChange:e===Nv,isOnAll:e===oc,isOnTouch:e==="onTouched"});const z8="AsyncFunction";var MA=e=>!!e&&!!e.validate&&!!($i(e.validate)&&e.validate.constructor.name===z8||Zo(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===z8)),F8=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Cc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Kt(e,r);if(i){const{_f:a,...l}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o||a.ref&&t(a.ref,a.name)&&!o)return!0;if(Cc(l,t))break}else if(Zo(l)&&Cc(l,t))break}}};function B8(e,t,n){const o=Kt(e,n);if(o||j2(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Kt(t,i),l=Kt(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};r.pop()}return{name:n}}var TA=(e,t,n)=>{const o=rc(Kt(e,n));return xo(o,"root",t[n]),xo(e,n,o),e},Xd=e=>sa(e);function N8(e,t,n="validate"){if(Xd(e)||Array.isArray(e)&&e.every(Xd)||oa(e)&&!e)return{type:n,message:Xd(e)?e:"",ref:t}}var as=e=>Zo(e)&&!Lu(e)?e:{value:e,message:""},$8=async(e,t,n,o,r,i)=>{const{ref:a,refs:l,required:c,maxLength:d,minLength:p,min:f,max:h,pattern:g,validate:m,name:y,valueAsNumber:x,mount:v}=e._f,b=Kt(n,y);if(!v||t.has(y))return{};const w=l?l[0]:a,M=S=>{r&&w.reportValidity&&(w.setCustomValidity(oa(S)?"":S||""),w.reportValidity())},k={},j=of(a),_=Sc(a),L=j||_,T=(x||nf(a))&&Jo(a.value)&&Jo(b)||Du(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,D=EA.bind(null,y,o,k),C=(S,R,P,I="maxLength",z="minLength")=>{const A=S?R:P;k[y]={type:S?I:z,message:A,ref:a,...D(S?I:z,A)}};if(i?!Array.isArray(b)||!b.length:c&&(!L&&(T||Lr(b))||oa(b)&&!b||_&&!qv(l).isValid||j&&!Gv(l).isValid)){const{value:S,message:R}=Xd(c)?{value:!!c,message:c}:as(c);if(S&&(k[y]={type:R8,message:R,ref:w,...D(R8,R)},!o))return M(R),k}if(!(T||Lr(f)&&Lr(h))){let S,R;const P=as(h),I=as(f);if(Lr(b)||isNaN(b)){const z=a.valueAsDate||new Date(b),A=F=>new Date(new Date().toDateString()+" "+F),O=a.type=="time",N=a.type=="week";sa(P.value)&&b&&(S=O?A(b)>A(P.value):N?b>P.value:z>new Date(P.value)),sa(I.value)&&b&&(R=O?A(b)<A(I.value):N?b<I.value:z<new Date(I.value))}else{const z=a.valueAsNumber||b&&+b;Lr(P.value)||(S=z>P.value),Lr(I.value)||(R=z<I.value)}if((S||R)&&(C(!!S,P.message,I.message,"max","min"),!o))return M(k[y].message),k}if((d||p)&&!T&&(sa(b)||i&&Array.isArray(b))){const S=as(d),R=as(p),P=!Lr(S.value)&&b.length>+S.value,I=!Lr(R.value)&&b.length<+R.value;if((P||I)&&(C(P,S.message,R.message),!o))return M(k[y].message),k}if(g&&!T&&sa(b)){const{value:S,message:R}=as(g);if(Lu(S)&&!b.match(S)&&(k[y]={type:j8,message:R,ref:a,...D(j8,R)},!o))return M(R),k}if(m){if($i(m)){const S=N8(await m(b,n),w);if(S&&(k[y]={...S,...D("validate",S.message)},!o))return M(S.message),k}else if(Zo(m)){let S={};for(const R in m){if(!$r(S)&&!o)break;const P=N8(await m[R](b,n),w,R);P&&(S={...P,...D(R,P.message)},M(P.message),o&&(k[y]=S))}if(!$r(S)&&(k[y]={ref:w,...S},!o))return k}}return M(!0),k};const _A={mode:$v,reValidateMode:Nv,shouldFocusError:!0},jA=["Ok","Cancel"],Ch=u.memo(u.forwardRef((e,t)=>{const{description:n,icon:o,onCancel:r,onOption:i,onDone:a,onValidateOption:l,createOptionsButton:c,options:d=jA,autoFocusSel:p=".defaultOption",defaultOption:f=d[0],cancelOption:h="Cancel",children:g,...m}=e,y=function(C={}){const S=u.useRef(void 0),R=u.useRef(void 0),[P,I]=u.useState({isDirty:!1,isValidating:!1,isLoading:$i(C.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:C.errors||{},disabled:C.disabled||!1,isReady:!1,defaultValues:$i(C.defaultValues)?void 0:C.defaultValues});if(!S.current)if(C.formControl)S.current={...C.formControl,formState:P},C.defaultValues&&!$i(C.defaultValues)&&C.formControl.reset(C.defaultValues,C.resetOptions);else{const{formControl:A,...O}=function(N={}){let F={..._A,...N},E={submitCount:0,isDirty:!1,isReady:!1,isLoading:$i(F.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:F.errors||{},disabled:F.disabled||!1};const B={};let H,U=(Zo(F.defaultValues)||Zo(F.values))&&Cr(F.defaultValues||F.values)||{},Z=F.shouldUnregister?{}:Cr(U),G={action:!1,mount:!1,watch:!1},V={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},le=0;const re={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let ge={...re};const Q={array:I8(),state:I8()},xe=F.criteriaMode===oc,be=async K=>{if(!F.disabled&&(re.isValid||ge.isValid||K)){const W=F.resolver?$r((await we()).errors):await se(B,!0);W!==E.isValid&&Q.state.next({isValid:W})}},Fe=(K,W)=>{!F.disabled&&(re.isValidating||re.validatingFields||ge.isValidating||ge.validatingFields)&&((K||Array.from(V.mount)).forEach(te=>{te&&(W?xo(E.validatingFields,te,W):nr(E.validatingFields,te))}),Q.state.next({validatingFields:E.validatingFields,isValidating:!$r(E.validatingFields)}))},ee=(K,W,te,oe)=>{const ue=Kt(B,K);if(ue){const ie=Kt(Z,K,Jo(te)?Kt(U,K):te);Jo(ie)||oe&&oe.defaultChecked||W?xo(Z,K,W?ie:A8(ue._f)):ne(K,ie),G.mount&&be()}},ae=(K,W,te,oe,ue)=>{let ie=!1,pe=!1;const fe={name:K};if(!F.disabled){if(!te||oe){(re.isDirty||ge.isDirty)&&(pe=E.isDirty,E.isDirty=fe.isDirty=J(),ie=pe!==fe.isDirty);const ye=qa(Kt(U,K),W);pe=!!Kt(E.dirtyFields,K),ye?nr(E.dirtyFields,K):xo(E.dirtyFields,K,!0),fe.dirtyFields=E.dirtyFields,ie=ie||(re.dirtyFields||ge.dirtyFields)&&pe!==!ye}if(te){const ye=Kt(E.touchedFields,K);ye||(xo(E.touchedFields,K,te),fe.touchedFields=E.touchedFields,ie=ie||(re.touchedFields||ge.touchedFields)&&ye!==te)}ie&&ue&&Q.state.next(fe)}return ie?fe:{}},we=async K=>{Fe(K,!0);const W=await F.resolver(Z,F.context,((te,oe,ue,ie)=>{const pe={};for(const fe of te){const ye=Kt(oe,fe);ye&&xo(pe,fe,ye._f)}return{criteriaMode:ue,names:[...te],fields:pe,shouldUseNativeValidation:ie}})(K||V.mount,B,F.criteriaMode,F.shouldUseNativeValidation));return Fe(K),W},se=async(K,W,te={valid:!0})=>{for(const oe in K){const ue=K[oe];if(ue){const{_f:ie,...pe}=ue;if(ie){const fe=V.array.has(ie.name),ye=ue._f&&MA(ue._f);ye&&re.validatingFields&&Fe([oe],!0);const De=await $8(ue,V.disabled,Z,xe,F.shouldUseNativeValidation&&!W,fe);if(ye&&re.validatingFields&&Fe([oe]),De[ie.name]&&(te.valid=!1,W))break;!W&&(Kt(De,ie.name)?fe?TA(E.errors,De,ie.name):xo(E.errors,ie.name,De[ie.name]):nr(E.errors,ie.name))}!$r(pe)&&await se(pe,W,te)}}return te.valid},J=(K,W)=>!F.disabled&&(K&&W&&xo(Z,K,W),!qa(_e(),U)),ce=(K,W,te)=>{return oe=K,ue=V,ie={...G.mount?Z:Jo(W)?U:sa(K)?{[K]:W}:W},pe=te,fe=W,sa(oe)?(pe&&ue.watch.add(oe),Kt(ie,oe,fe)):Array.isArray(oe)?oe.map(ye=>(pe&&ue.watch.add(ye),Kt(ie,ye))):(pe&&(ue.watchAll=!0),ie);var oe,ue,ie,pe,fe},ne=(K,W,te={})=>{const oe=Kt(B,K);let ue=W;if(oe){const ie=oe._f;ie&&(!ie.disabled&&xo(Z,K,Kv(W,ie)),ue=Du(ie.ref)&&Lr(W)?"":W,Hv(ie.ref)?[...ie.ref.options].forEach(pe=>pe.selected=ue.includes(pe.value)):ie.refs?Sc(ie.ref)?ie.refs.forEach(pe=>{pe.defaultChecked&&pe.disabled||(Array.isArray(ue)?pe.checked=!!ue.find(fe=>fe===pe.value):pe.checked=ue===pe.value||!!ue)}):ie.refs.forEach(pe=>pe.checked=pe.value===ue):nf(ie.ref)?ie.ref.value="":(ie.ref.value=ue,ie.ref.type||Q.state.next({name:K,values:Cr(Z)})))}(te.shouldDirty||te.shouldTouch)&&ae(K,ue,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&ke(K)},Pe=(K,W,te)=>{for(const oe in W){if(!W.hasOwnProperty(oe))return;const ue=W[oe],ie=K+"."+oe,pe=Kt(B,ie);(V.array.has(K)||Zo(ue)||pe&&!pe._f)&&!El(ue)?Pe(ie,ue,te):ne(ie,ue,te)}},Ee=(K,W,te={})=>{const oe=Kt(B,K),ue=V.array.has(K),ie=Cr(W);xo(Z,K,ie),ue?(Q.array.next({name:K,values:Cr(Z)}),(re.isDirty||re.dirtyFields||ge.isDirty||ge.dirtyFields)&&te.shouldDirty&&Q.state.next({name:K,dirtyFields:F0(U,Z),isDirty:J(K,ie)})):!oe||oe._f||Lr(ie)?ne(K,ie,te):Pe(K,ie,te),F8(K,V)&&Q.state.next({...E}),Q.state.next({name:G.mount?K:void 0,values:Cr(Z)})},it=async K=>{G.mount=!0;const W=K.target;let te=W.name,oe=!0;const ue=Kt(B,te),ie=Ve=>{oe=Number.isNaN(Ve)||El(Ve)&&isNaN(Ve.getTime())||qa(Ve,Kt(Z,te,Ve))},pe=L8(F.mode),fe=L8(F.reValidateMode);if(ue){let Ve,Je;const ot=W.type?A8(ue._f):Zo(De=K)&&De.target?Sc(De.target)?De.target.checked:De.target.value:De,tt=K.type==="blur"||K.type==="focusout",Lt=!((ye=ue._f).mount&&(ye.required||ye.min||ye.max||ye.maxLength||ye.minLength||ye.pattern||ye.validate)||F.resolver||Kt(E.errors,te)||ue._f.deps)||((Jt,Qt,rn,yn,dn)=>!dn.isOnAll&&(!rn&&dn.isOnTouch?!(Qt||Jt):(rn?yn.isOnBlur:dn.isOnBlur)?!Jt:!(rn?yn.isOnChange:dn.isOnChange)||Jt))(tt,Kt(E.touchedFields,te),E.isSubmitted,fe,pe),At=F8(te,V,tt);xo(Z,te,ot),tt?(ue._f.onBlur&&ue._f.onBlur(K),H&&H(0)):ue._f.onChange&&ue._f.onChange(K);const _t=ae(te,ot,tt),Yt=!$r(_t)||At;if(!tt&&Q.state.next({name:te,type:K.type,values:Cr(Z)}),Lt)return(re.isValid||ge.isValid)&&(F.mode==="onBlur"?tt&&be():tt||be()),Yt&&Q.state.next({name:te,...At?{}:_t});if(!tt&&At&&Q.state.next({...E}),F.resolver){const{errors:Jt}=await we([te]);if(ie(ot),oe){const Qt=B8(E.errors,B,te),rn=B8(Jt,B,Qt.name||te);Ve=rn.error,te=rn.name,Je=$r(Jt)}}else Fe([te],!0),Ve=(await $8(ue,V.disabled,Z,xe,F.shouldUseNativeValidation))[te],Fe([te]),ie(ot),oe&&(Ve?Je=!1:(re.isValid||ge.isValid)&&(Je=await se(B,!0)));oe&&(ue._f.deps&&ke(ue._f.deps),((Jt,Qt,rn,yn)=>{const dn=Kt(E.errors,Jt),kt=(re.isValid||ge.isValid)&&oa(Qt)&&E.isValid!==Qt;var xn;if(F.delayError&&rn?(xn=()=>{return tn=Jt,_n=rn,xo(E.errors,tn,_n),void Q.state.next({errors:E.errors});var tn,_n},H=tn=>{clearTimeout(le),le=setTimeout(xn,tn)},H(F.delayError)):(clearTimeout(le),H=null,rn?xo(E.errors,Jt,rn):nr(E.errors,Jt)),(rn?!qa(dn,rn):dn)||!$r(yn)||kt){const tn={...yn,...kt&&oa(Qt)?{isValid:Qt}:{},errors:E.errors,name:Jt};E={...E,...tn},Q.state.next(tn)}})(te,Je,Ve,_t))}var ye,De},Ue=(K,W)=>{if(Kt(E.errors,W)&&K.focus)return K.focus(),1},ke=async(K,W={})=>{let te,oe;const ue=rc(K);if(F.resolver){const ie=await(async pe=>{const{errors:fe}=await we(pe);if(pe)for(const ye of pe){const De=Kt(fe,ye);De?xo(E.errors,ye,De):nr(E.errors,ye)}else E.errors=fe;return fe})(Jo(K)?K:ue);te=$r(ie),oe=K?!ue.some(pe=>Kt(ie,pe)):te}else K?(oe=(await Promise.all(ue.map(async ie=>{const pe=Kt(B,ie);return await se(pe&&pe._f?{[ie]:pe}:pe)}))).every(Boolean),(oe||E.isValid)&&be()):oe=te=await se(B);return Q.state.next({...!sa(K)||(re.isValid||ge.isValid)&&te!==E.isValid?{}:{name:K},...F.resolver||!K?{isValid:te}:{},errors:E.errors}),W.shouldFocus&&!oe&&Cc(B,Ue,K?ue:V.mount),oe},_e=K=>{const W={...G.mount?Z:U};return Jo(K)?W:sa(K)?Kt(W,K):K.map(te=>Kt(W,te))},Xe=(K,W)=>({invalid:!!Kt((W||E).errors,K),isDirty:!!Kt((W||E).dirtyFields,K),error:Kt((W||E).errors,K),isValidating:!!Kt(E.validatingFields,K),isTouched:!!Kt((W||E).touchedFields,K)}),Be=(K,W,te)=>{const oe=(Kt(B,K,{_f:{}})._f||{}).ref,ue=Kt(E.errors,K)||{},{ref:ie,message:pe,type:fe,...ye}=ue;xo(E.errors,K,{...ye,...W,ref:oe}),Q.state.next({name:K,errors:E.errors,isValid:!1}),te&&te.shouldFocus&&oe&&oe.focus&&oe.focus()},ct=K=>Q.state.subscribe({next:W=>{var te,oe,ue;te=K.name,oe=W.name,ue=K.exact,te&&oe&&te!==oe&&!rc(te).some(ie=>ie&&(ue?ie===oe:ie.startsWith(oe)||oe.startsWith(ie)))||!((ie,pe,fe,ye)=>{fe(ie);const{name:De,...Ve}=ie;return $r(Ve)||Object.keys(Ve).length>=Object.keys(pe).length||Object.keys(Ve).find(Je=>pe[Je]===(!ye||oc))})(W,K.formState||re,Le,K.reRenderRoot)||K.callback({values:{...Z},...E,...W})}}).unsubscribe,et=(K,W={})=>{for(const te of K?rc(K):V.mount)V.mount.delete(te),V.array.delete(te),W.keepValue||(nr(B,te),nr(Z,te)),!W.keepError&&nr(E.errors,te),!W.keepDirty&&nr(E.dirtyFields,te),!W.keepTouched&&nr(E.touchedFields,te),!W.keepIsValidating&&nr(E.validatingFields,te),!F.shouldUnregister&&!W.keepDefaultValue&&nr(U,te);Q.state.next({values:Cr(Z)}),Q.state.next({...E,...W.keepDirty?{isDirty:J()}:{}}),!W.keepIsValid&&be()},he=({disabled:K,name:W})=>{(oa(K)&&G.mount||K||V.disabled.has(W))&&(K?V.disabled.add(W):V.disabled.delete(W))},Ye=(K,W={})=>{let te=Kt(B,K);const oe=oa(W.disabled)||oa(F.disabled);return xo(B,K,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:K}},name:K,mount:!0,...W}}),V.mount.add(K),te?he({disabled:oa(W.disabled)?W.disabled:F.disabled,name:K}):ee(K,!0,W.value),{...oe?{disabled:W.disabled||F.disabled}:{},...F.progressive?{required:!!W.required,min:B0(W.min),max:B0(W.max),minLength:B0(W.minLength),maxLength:B0(W.maxLength),pattern:B0(W.pattern)}:{},name:K,onChange:it,onBlur:it,ref:ue=>{if(ue){Ye(K,W),te=Kt(B,K);const De=Jo(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Ve=of(ye=De)||Sc(ye),Je=te._f.refs||[];if(Ve?Je.find(ot=>ot===De):De===te._f.ref)return;xo(B,K,{_f:{...te._f,...Ve?{refs:[...Je.filter(Bp),De,...Array.isArray(Kt(U,K))?[{}]:[]],ref:{type:De.type,name:K}}:{ref:De}}}),ee(K,!1,void 0,De)}else te=Kt(B,K,{}),te._f&&(te._f.mount=!1),(F.shouldUnregister||W.shouldUnregister)&&(ie=V.array,pe=K,!ie.has((fe=pe).substring(0,fe.search(/\.\d+(\.|$)/))||fe)||!G.action)&&V.unMount.add(K);var ie,pe,fe,ye}}},Se=()=>F.shouldFocusError&&Cc(B,Ue,V.mount),Ie=(K,W)=>async te=>{let oe;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let ue=Cr(Z);if(Q.state.next({isSubmitting:!0}),F.resolver){const{errors:ie,values:pe}=await we();E.errors=ie,ue=pe}else await se(B);if(V.disabled.size)for(const ie of V.disabled)xo(ue,ie,void 0);if(nr(E.errors,"root"),$r(E.errors)){Q.state.next({errors:{}});try{await K(ue,te)}catch(ie){oe=ie}}else W&&await W({...E.errors},te),Se(),setTimeout(Se);if(Q.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$r(E.errors)&&!oe,submitCount:E.submitCount+1,errors:E.errors}),oe)throw oe},de=(K,W={})=>{const te=K?Cr(K):U,oe=Cr(te),ue=$r(K),ie=ue?U:oe;if(W.keepDefaultValues||(U=te),!W.keepValues){if(W.keepDirtyValues){const pe=new Set([...V.mount,...Object.keys(F0(U,Z))]);for(const fe of Array.from(pe))Kt(E.dirtyFields,fe)?xo(ie,fe,Kt(Z,fe)):Ee(fe,Kt(ie,fe))}else{if(ef&&Jo(K))for(const pe of V.mount){const fe=Kt(B,pe);if(fe&&fe._f){const ye=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Du(ye)){const De=ye.closest("form");if(De){De.reset();break}}}}for(const pe of V.mount)Ee(pe,Kt(ie,pe))}Z=Cr(ie),Q.array.next({values:{...ie}}),Q.state.next({values:{...ie}})}V={mount:W.keepDirtyValues?V.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},G.mount=!re.isValid||!!W.keepIsValid||!!W.keepDirtyValues,G.watch=!!F.shouldUnregister,Q.state.next({submitCount:W.keepSubmitCount?E.submitCount:0,isDirty:!ue&&(W.keepDirty?E.isDirty:!(!W.keepDefaultValues||qa(K,U))),isSubmitted:!!W.keepIsSubmitted&&E.isSubmitted,dirtyFields:ue?{}:W.keepDirtyValues?W.keepDefaultValues&&Z?F0(U,Z):E.dirtyFields:W.keepDefaultValues&&K?F0(U,K):W.keepDirty?E.dirtyFields:{},touchedFields:W.keepTouched?E.touchedFields:{},errors:W.keepErrors?E.errors:{},isSubmitSuccessful:!!W.keepIsSubmitSuccessful&&E.isSubmitSuccessful,isSubmitting:!1})},Oe=(K,W)=>de($i(K)?K(Z):K,W),Le=K=>{E={...E,...K}},je={control:{register:Ye,unregister:et,getFieldState:Xe,handleSubmit:Ie,setError:Be,_subscribe:ct,_runSchema:we,_focusError:Se,_getWatch:ce,_getDirty:J,_setValid:be,_setFieldArray:(K,W=[],te,oe,ue=!0,ie=!0)=>{if(oe&&te&&!F.disabled){if(G.action=!0,ie&&Array.isArray(Kt(B,K))){const ye=te(Kt(B,K),oe.argA,oe.argB);ue&&xo(B,K,ye)}if(ie&&Array.isArray(Kt(E.errors,K))){const ye=te(Kt(E.errors,K),oe.argA,oe.argB);ue&&xo(E.errors,K,ye),pe=E.errors,!wh(Kt(pe,fe=K)).length&&nr(pe,fe)}if((re.touchedFields||ge.touchedFields)&&ie&&Array.isArray(Kt(E.touchedFields,K))){const ye=te(Kt(E.touchedFields,K),oe.argA,oe.argB);ue&&xo(E.touchedFields,K,ye)}(re.dirtyFields||ge.dirtyFields)&&(E.dirtyFields=F0(U,Z)),Q.state.next({name:K,isDirty:J(K,W),dirtyFields:E.dirtyFields,errors:E.errors,isValid:E.isValid})}else xo(Z,K,W);var pe,fe},_setDisabledField:he,_setErrors:K=>{E.errors=K,Q.state.next({errors:E.errors,isValid:!1})},_getFieldArray:K=>wh(Kt(G.mount?Z:U,K,F.shouldUnregister?Kt(U,K,[]):[])),_reset:de,_resetDefaultValues:()=>$i(F.defaultValues)&&F.defaultValues().then(K=>{Oe(K,F.resetOptions),Q.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const K of V.unMount){const W=Kt(B,K);W&&(W._f.refs?W._f.refs.every(te=>!Bp(te)):!Bp(W._f.ref))&&et(K)}V.unMount=new Set},_disableForm:K=>{oa(K)&&(Q.state.next({disabled:K}),Cc(B,(W,te)=>{const oe=Kt(B,te);oe&&(W.disabled=oe._f.disabled||K,Array.isArray(oe._f.refs)&&oe._f.refs.forEach(ue=>{ue.disabled=oe._f.disabled||K}))},0,!1))},_subjects:Q,_proxyFormState:re,get _fields(){return B},get _formValues(){return Z},get _state(){return G},set _state(K){G=K},get _defaultValues(){return U},get _names(){return V},set _names(K){V=K},get _formState(){return E},get _options(){return F},set _options(K){F={...F,...K}}},subscribe:K=>(G.mount=!0,ge={...ge,...K.formState},ct({...K,formState:ge})),trigger:ke,register:Ye,handleSubmit:Ie,watch:(K,W)=>$i(K)?Q.state.subscribe({next:te=>K(ce(void 0,W),te)}):ce(K,W,!0),setValue:Ee,getValues:_e,reset:Oe,resetField:(K,W={})=>{Kt(B,K)&&(Jo(W.defaultValue)?Ee(K,Cr(Kt(U,K))):(Ee(K,W.defaultValue),xo(U,K,Cr(W.defaultValue))),W.keepTouched||nr(E.touchedFields,K),W.keepDirty||(nr(E.dirtyFields,K),E.isDirty=W.defaultValue?J(K,Cr(Kt(U,K))):J()),W.keepError||(nr(E.errors,K),re.isValid&&be()),Q.state.next({...E}))},clearErrors:K=>{K&&rc(K).forEach(W=>nr(E.errors,W)),Q.state.next({errors:K?E.errors:{}})},unregister:et,setError:Be,setFocus:(K,W={})=>{const te=Kt(B,K),oe=te&&te._f;if(oe){const ue=oe.refs?oe.refs[0]:oe.ref;ue.focus&&(ue.focus(),W.shouldSelect&&$i(ue.select)&&ue.select())}},getFieldState:Xe};return{...je,formControl:je}}(C);S.current={...O,formState:P}}const z=S.current.control;return z._options=C,kA(()=>{const A=z._subscribe({formState:z._proxyFormState,callback:()=>I({...z._formState}),reRenderRoot:!0});return I(O=>({...O,isReady:!0})),z._formState.isReady=!0,A},[z]),u.useEffect(()=>z._disableForm(C.disabled),[z,C.disabled]),u.useEffect(()=>{C.mode&&(z._options.mode=C.mode),C.reValidateMode&&(z._options.reValidateMode=C.reValidateMode)},[z,C.mode,C.reValidateMode]),u.useEffect(()=>{C.errors&&(z._setErrors(C.errors),z._focusError())},[z,C.errors]),u.useEffect(()=>{C.shouldUnregister&&z._subjects.state.next({values:z._getWatch()})},[z,C.shouldUnregister]),u.useEffect(()=>{if(z._proxyFormState.isDirty){const A=z._getDirty();A!==P.isDirty&&z._subjects.state.next({isDirty:A})}},[z,P.isDirty]),u.useEffect(()=>{C.values&&!qa(C.values,R.current)?(z._reset(C.values,z._options.resetOptions),R.current=C.values,I(A=>({...A}))):z._resetDefaultValues()},[z,C.values]),u.useEffect(()=>{z._state.mount||(z._setValid(),z._state.mount=!0),z._state.watch&&(z._state.watch=!1,z._subjects.state.next({...z._formState})),z._removeUnmounted()}),S.current.formState=((A,O,N,F=!0)=>{const E={defaultValues:O._defaultValues};for(const B in A)Object.defineProperty(E,B,{get:()=>{const H=B;return O._proxyFormState[H]!==oc&&(O._proxyFormState[H]=!F||oc),A[H]}});return E})(P,z),S.current}({shouldUseNativeValidation:!1}),{handleSubmit:x,formState:v}=y,b=u.useRef(null),w=u.useRef(null),M=u.useRef(null),k=En(async C=>{let S;try{if(S=await Promise.resolve(l?.(C))??!0,S!==!0)return;await Promise.resolve(i?.(C,C===h,C===f)),a?.(C)}catch{}},[i,a,l,h,f]),j=En((C,S)=>{setTimeout(()=>{k(f)},180)},[k]),_=En(()=>{i?.(h,!0,!1),r?.(),a?.(null)},[i,h,r,a]),L=v&&(Object.keys(v.errors).length>0||v.disabled||v.isSubmitted),T=En((C,S)=>{const R=C===h,P={className:S?"defaultOption":"action",type:S?"submit":"button",style:{minWidth:"75px"},onClick:()=>{R?_():S||k(C)}};if(c)return c(C,P,S);const I={className:S?"defaultOption":"action",variant:S?"contained":"outlined",size:"small",disabled:!R&&L,color:"primary",...P};if(S||R){const z=S?b:w;I.touchRippleRef=z,I.onPointerDown=A=>{z.current?.start(A,{center:!1}),A.stopPropagation(),A.preventDefault()}}return s.jsx(zc,{...I,children:s.jsx("div",{style:{paddingTop:"3px"},children:C})},`action:${C}`)},[d,f,h,c,v]),D=u.useMemo(()=>{const C=[];for(let S=0;S<d.length;S++){const R=d[S],P=f?R===f:S===0;C.push(T(R,P))}return C},[d,f,v]);return s.jsx(Lv,{onCancel:_,initialPosition:{y:SA==="touch"?"15":"35"},onDone:a,autoFocusSel:p,isModal:!0,ref:t,PaperProps:{},...m,children:s.jsx(CA,{...y,children:s.jsxs("form",{ref:M,onSubmit:x(j),children:[s.jsx(Ex,{dividers:!0,onKeyDown:C=>{if(C.isDefaultPrevented())return;C.stopPropagation();let S=null,R=null;const P=C.which===xr.Escape&&h;if(P)S=h,R=w;else{if(L)return;C.which===xr.Enter&&(S=f??d[0],R=b)}S&&(R.current?.start(C,{center:!1}),setTimeout(()=>{R.current?.stop(C),P&&k(S)},180))},children:s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:C=>C.spacing(o||n?1.5:0)},children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column"},children:[o,n]}),g]})}),s.jsx(JT,{sx:{paddingTop:C=>C.spacing(1),paddingBottom:C=>C.spacing(1),paddingLeft:C=>C.spacing(1),paddingRight:C=>C.spacing(1),backgroundColor:C=>pt(C.palette.action.hover,.03)},children:D})]})})})})),RA=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:Ch,default:Ch},Symbol.toStringTag,{value:"Module"})),IA=u.lazy(()=>Promise.resolve().then(()=>RA)),PA=u.lazy(()=>Promise.resolve().then(()=>require("./BYhOQCFEzewgsKDn.cjs"))),l0=u.memo(u.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return q3(n),s.jsx(br,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...a,children:s.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),Ge=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,label:l,disabled:c=!1,variant:d=Ci.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...g}=e,m=u.useRef(null),y=u.useRef(!1),x=u.useMemo(()=>{const L={onExecute(T,D){o?.onExecute?.(T,D),y.current||(m.current?.start({center:!1}),setTimeout(()=>m.current?.stop({}),180)),y.current=!1},onError(T,D,C){o?.onError(T,D,C)}};return o?.beforeExecute&&(L.beforeExecute=o.beforeExecute),L},[o]),v=q3(n,x),b=u.useCallback(L=>{L.button===0&&L.preventDefault()},[]),w=u.useCallback(L=>{L.button===0&&n?.execute(f,o)},[v,o,f]),M=u.useCallback(L=>{L.keyCode!==xr.Enter&&L.keyCode!==xr.Space||n?.execute(f,o)},[v,o,f]),k=u.useMemo(()=>a||d===Ci.Toolbar||n?.state()?typeof a=="function"?a(n):a:_2,[v,a]),j=u.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:d===Ci.Toolbar?k:s.jsx(E1,{selected:n?.state()??!1,children:k}),touchRippleRef:m,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:w,onKeyDown:M}),[v,o,c,k]);let _;return _=d===Ci.Menuitem?s.jsx(Gr,{...g,chips:n?.tags(),...j,children:l??n?.label(r,i)}):s.jsx(ii,{...g,...j}),(l||n?.label())&&((n.disabled()||c)&&(_=s.jsx("div",{children:_})),_=s.jsx(l0,{command:n,placement:d===Ci.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:_})),_})),OA=u.memo(u.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=_2,label:i,variant:a=Ci.Toolbar,disabled:l=!1,commandHook:c,...d}=e,p=u.useRef(null),f=u.useRef(!1),h=u.useMemo(()=>{const _={onExecute(L,T){c?.onExecute?.(L,T),f.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),f.current=!1},onError(L,T,D){c?.onError(L,T,D)}};return c?.beforeExecute&&(_.beforeExecute=c.beforeExecute),_},[c]),g=q3(n,h),m=()=>n?.state()?.toString()||"0",[y,x]=u.useState(m),v=En(()=>{const _=parseFloat(y);isNaN(_)?x(m()):parseFloat(m())!==_&&n.execute(_,c)},[m,n,y,c]);u.useEffect(()=>{x(m())},[n?.state()]);const b=u.useMemo(()=>typeof r=="function"?r(n):r,[g,r]),w=u.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[g]),M=u.useMemo(()=>s.jsx(Tr,{...d,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:_=>_.stopPropagation(),onMouseDown:_=>{_.button===0&&_.stopPropagation()},onMouseUp:_=>{_.button===0&&_.stopPropagation()},children:s.jsx(Kl,{inputMode:"numeric",disabled:l||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:_=>`${Math.round(_.typography.fontSize)}px`,width:_=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:y,onFocus:_=>{_.target?.select()},onKeyDown:_=>{if(_.which===xr.Enter)m()!==y&&(_.stopPropagation(),_.preventDefault(),v());else if(_.which===xr.Escape)m()!==y&&(x(m()),setTimeout(()=>{_.target?.select()},0),_.stopPropagation(),_.preventDefault());else{if(_.key.match("[-]")||_.key.match("[0-9.]")&&(y+_.key).length>4)return _.stopPropagation(),void _.preventDefault();if(_.which===xr.Space)return void _.preventDefault()}},onBlur:()=>{v()},onChange:_=>{if(_.target.value.length>4)return _.stopPropagation(),void _.preventDefault();x(_.target.value)}})}),[y,l,n]),k={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:l||!n||n.disabled(),onMouseDown:_=>{_.button===0&&_.preventDefault()},onMouseUp:_=>{_.button!==0||_.isPropagationStopped()||_.isDefaultPrevented()||_.isDefaultPrevented()||(_.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:_=>{_.keyCode!==xr.Enter&&_.keyCode!==xr.Space||n?.execute(!n?.state?.(),h)}};let j;return j=a===Ci.Menuitem?s.jsxs(Gr,{...d,chips:n?.tags(),...k,children:[w,M]}):s.jsx(ii,{...d,...k}),n?.label()&&((n.disabled()||l)&&(j=s.jsx("div",{children:j})),j=s.jsx(l0,{command:n,placement:a===Ci.Toolbar?"bottom-start":"right-start",children:j})),j})),Xn=u.memo(u.forwardRef((e,t)=>{const{variant:n=Ci.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:a,commandHook:l,disabled:c,label:d,icon:p,createPopupPanel:f,tooltip:h,selected:g,scope:m,...y}=e,x=u.useRef(null),v=u.useRef(!1),b=u.useMemo(()=>{const D={onExecute(C,S){l?.onExecute?.(C,S),v.current||(x.current?.start({center:!1}),setTimeout(()=>x.current?.stop({}),180)),v.current=!1},onError(C,S,R){l?.onError(C,S,R)}};return l?.beforeExecute&&(D.beforeExecute=l.beforeExecute),D},[l]),w=K3(i,[o],null,[o]),M=w[0],{label:k,icon:j}=u.useMemo(()=>{let D=null;d&&(D=typeof d=="function"?d(M):d),D||(D=M?.label?.(m));let C=null;return p&&(C=typeof p=="function"?p(M):p),C||(C=M?.icon?.()),{label:D,icon:C}},[w,d,p]),_={disabled:c,scope:m,touchRippleRef:x,onQuickClick:r,tooltip:h,label:k,icon:j};(k||h)&&(_.createTooltip=({children:D},C)=>s.jsx(br,{label:k,description:h,disabled:C,children:D}));const L=En(D=>f?.(D,i),[f,w]),T=En(D=>M?.execute(a,b),[M]);return M?(_.quickButtonProps={},_.quickButtonProps.createTooltip=({children:D,placement:C},S)=>s.jsx(l0,{command:M,placement:C??n===Ci.Toolbar?"bottom-start":"right-start",disabled:S,children:D}),_.disabled=_.disabled??M?.disabled(),r||(_.onQuickClick=T)):o&&(_.onQuickClick=()=>{}),_.selected=g??M?.state(),_.createPopupPanel=L,n===Ci.Toolbar?s.jsx(qi,{...y,..._,ref:t}):s.jsx(k1,{...y,..._,ref:t})}));Xn.displayName="CommandPopupButton";const Xs=e=>{const{command:t,label:n,scope:o,icon:r=s.jsx(R3,{}),sx:i,...a}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:l=>l.typography.subtitle2.fontSize,...i},...a,children:[r?ze(r):null,s.jsx(Tn,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:l=>l.spacing(.25),paddingRight:l=>l.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},M1=u.memo(u.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:l,...c}=e,d=T2(t,()=>({}),[]),[p,f]=u.useState(null),{reference:h}=ha({label:"toolbar",anchor:d.current,parentFloat:i,createPopupPanel:null}),g=u.useCallback(()=>{const _=p;_&&requestAnimationFrame(()=>{d.current?.contains(document.activeElement)&&_.focus()})},[]),m=u.useMemo(()=>({dense:!0,outlined:!1}),[]),y=u.useMemo(()=>{const{commandHook:_,...L}=r||{};return{commandHook:{beforeExecute:(T,D)=>_?.beforeExecute?.(T,D)!==!1&&h.closeAll(),onExecute(T,D){_?.onExecute?.(T,D),g()},onError(T,D,C){_?.onError?.(T,D,C)}},...L}},[h,r]),x=u.useMemo(()=>({...m,...y}),[m,y]),[v,b]=u.useReducer(_=>_+1,0);K3(o,[],{onChange:()=>{b()}});const w=u.useMemo(()=>({commands:o,parentFloat:h,...y}),[v,x,h,r]);let M=0;m.dense||(M+=2),m.outlined&&M++;let k=2;m.dense||(k=4);const j=u.useMemo(()=>a({commands:o,commandButtonProps:x,commandPopupProps:{commands:o,...w,...r}}),[v,x,w,a]);return s.jsx(Aj,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${k}px`,paddingBottom:`${k}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:d,onFocus:_=>{_.relatedTarget&&!p&&f(_.relatedTarget)},onBlur:_=>{p&&!d?.current?.contains(_.relatedTarget)&&f(null)},onKeyDown:_=>{p&&_.which===xr.Escape&&p.focus()},...c,children:s.jsx("div",{ref:d,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${k}px`,columnGap:`${M}px`,alignItems:"center",maxWidth:"100%"},children:j})})}));M1.displayName="CommandToolbar";const DA=e=>{const{key:t,...n}=e;return s.jsx(Ge,{...n},t)},ca=u.memo(u.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o=DA,scope:r,commands:i,icon:a,quickCommand:l,popupScope:c=l,commandState:d,commandHook:p,disabled:f=!1,...h}=e,g=K3(i,n?[l,...n]:[l]),m=u.useCallback((y,x)=>{const v={variant:Ci.Menuitem,commandHook:p,commandState:d,icon:a,scope:c,disabled:f},b=[];for(let w=0;w<n?.length;w++){const M=n[w];if(M===null||M==="-"){b.push(s.jsx(Ft,{orientation:"horizontal"},`element-${b.length}`));continue}const k=x.getCommand(M),j={key:`${M}-${b.length}`,command:k,...v},_=o(j);_&&b.push(_)}return Bn({...y,children:b})},[f,p,d,c,n,a,o]);return n?s.jsx(Xn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:d,scope:r,quickCommand:l,icon:a,createPopupPanel:m,...h}):o({ref:t,disabled:f,commandHook:p,commandState:d,scope:r,command:g[0],icon:a,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Zv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=u.useMemo(()=>{for(let g=0;g<c.length;g++)if(c[g]?.state())return c[g].key();return c[0]?.key()},[c]),p=u.useMemo(()=>{const g=new Map;return g.set("formatAlignLeftToggle",ze(s.jsx(X6,{}))),g.set("formatAlignCenterToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignRightToggle",ze(s.jsx(cR,{}))),g.set("formatAlignJustifyToggle",ze(s.jsx(xc,{}))),g.set("formatAlignCenterContinuousToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignFillToggle",ze(s.jsx(xc,{}))),g.set("formatAlignDistributedHorizontalToggle",ze(s.jsx(xc,{}))),g},[]),f=u.useMemo(()=>{if(!o)return null;const g={...o};return delete g.beforeExecute,g},[o]),h=u.useCallback((g,m)=>{const y={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...y,command:m.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=s.jsxs(Ae,{sx:{className:Eo("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[s.jsx(Ge,{command:m.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(OO,{}))}),s.jsx(Ge,{command:m.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(PO,{}))})]}),b=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})]});return Bn({...g,children:b})},[i,o]);return s.jsx(Xn,{ref:t,parentFloat:a,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:p.get(d)??s.jsx(X6,{}),...l})})),Xv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatAlignTopToggle",ze(s.jsx($O,{}))),f.set("formatAlignMiddleToggle",ze(s.jsx(VO,{}))),f.set("formatAlignBottomToggle",ze(s.jsx(U7,{}))),f.set("formatAlignJustifyVerticalToggle",ze(s.jsx(xc,{}))),f.set("formatAlignDistributedVerticalToggle",ze(s.jsx(xc,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return Bn({...f,children:m})},[i,o,d]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(c)??ze(s.jsx(U7,{})),...a})})),Yv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatTextOverflowVisibleToggle",ze(s.jsx(X4,{}))),f.set("formatTextOverflowWrapToggle",ze(s.jsx(jI,{}))),f.set("formatTextOverflowClipToggle",ze(s.jsx(RI,{}))),f.set("formatTextOverflowShrinkToggle",ze(s.jsx(II,{}))),f},[]),p=Te((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:d.get(c)??ze(s.jsx(X4,{})),...a})})),Jv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=u.useMemo(()=>{const h=l.length;for(let g=0;g<h;g++){const m=l[g];if(m?.state())return m.key()}return l[1]?.key()},[l]),d=u.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ze(s.jsx(ud,{}))),h.set("formatTextRotate315",ze(s.jsx(ud,{}))),h.set("formatTextRotate45",ze(s.jsx($7,{}))),h.set("formatTextRotate90",ze(s.jsx(V7,{}))),h.set("formatTextRotate270",ze(s.jsx(H7,{}))),h.set("formatTextRotateCustom",ze(s.jsx(W7,{}))),h},[]),p=u.useCallback((h,g)=>{const m={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},y=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate0"),icon:ze(s.jsx(NO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate315"),icon:ze(s.jsx(ud,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate45"),icon:ze(s.jsx($7,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate90"),icon:ze(s.jsx(V7,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate270"),icon:ze(s.jsx(H7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(OA,{...m,command:g.getCommand("formatTextRotateCustom"),icon:ze(s.jsx(W7,{})),label:"Custom"})]});return Bn({...h,children:y})},[i,o,r,n]),f=u.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[l]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,selected:f,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:f?"formatTextRotate0":"formatTextRotate315",icon:ze(d.get(c)??s.jsx(ud,{})),...a})}));function $l(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Ja="$$material";var bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},V8,H8,W8={exports:{}},ro={},Qv=(H8||(H8=1,W8.exports=function(){if(V8)return ro;V8=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function m(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type){case n:case r:case o:case c:case d:case h:return y;default:switch(y=y&&y.$$typeof){case a:case l:case f:case p:case i:return y;default:return x}}case t:return x}}}return ro.ContextConsumer=i,ro.ContextProvider=a,ro.Element=e,ro.ForwardRef=l,ro.Fragment=n,ro.Lazy=f,ro.Memo=p,ro.Portal=t,ro.Profiler=r,ro.StrictMode=o,ro.Suspense=c,ro.SuspenseList=d,ro.isContextConsumer=function(y){return m(y)===i},ro.isContextProvider=function(y){return m(y)===a},ro.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},ro.isForwardRef=function(y){return m(y)===l},ro.isFragment=function(y){return m(y)===n},ro.isLazy=function(y){return m(y)===f},ro.isMemo=function(y){return m(y)===p},ro.isPortal=function(y){return m(y)===t},ro.isProfiler=function(y){return m(y)===r},ro.isStrictMode=function(y){return m(y)===o},ro.isSuspense=function(y){return m(y)===c},ro.isSuspenseList=function(y){return m(y)===d},ro.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===r||y===o||y===c||y===d||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===p||y.$$typeof===a||y.$$typeof===i||y.$$typeof===l||y.$$typeof===g||y.getModuleId!==void 0)},ro.typeOf=m,ro}()),W8.exports);function ka(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function ew(e){if(X.isValidElement(e)||Qv.isValidElementType(e)||!ka(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=ew(e[n])}),t}function ai(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return ka(e)&&ka(t)&&Object.keys(t).forEach(r=>{X.isValidElement(t[r])||Qv.isValidElementType(t[r])?o[r]=t[r]:ka(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&ka(e[r])?o[r]=ai(e[r],t[r],n):n.clone?o[r]=ka(t[r])?ew(t[r]):t[r]:o[r]=t[r]}),o}function rf(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function nl(e){if(e.type)return e;if(e.charAt(0)==="#")return nl(function(i){i=i.slice(1);const a=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let l=i.match(a);return l&&l[0].length===1&&(l=l.map(c=>c+c)),l?`rgb${l.length===4?"a":""}(${l.map((c,d)=>d<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error($l(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error($l(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const ic=(e,t)=>{try{return(n=>{const o=nl(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function R2(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function tw(e){e=nl(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),a=(d,p=(d+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let l="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return e.type==="hsla"&&(l+="a",c.push(t[3])),R2({type:l,values:c})}function kh(e){let t=(e=nl(e)).type==="hsl"||e.type==="hsla"?nl(tw(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function md(e,t,n){try{return function(o,r){return o=nl(o),r=rf(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,R2(o)}(e,t)}catch{return e}}function af(e,t){if(e=nl(e),t=rf(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return R2(e)}function po(e,t,n){try{return af(e,t)}catch{return e}}function lf(e,t){if(e=nl(e),t=rf(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return R2(e)}function ho(e,t,n){try{return lf(e,t)}catch{return e}}function gd(e,t,n){try{return function(o,r=.15){return kh(o)>.5?af(o,r):lf(o,r)}(e,t)}catch{return e}}const Zc={black:"#000",white:"#fff"},AA={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},U8="#d32f2f",q8="#42a5f5",K8="#0288d1";function nw(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Zc.white,default:Zc.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const LA=nw();function ow(){return{text:{primary:Zc.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Zc.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const G8=ow();function Z8(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=lf(e.main,r):t==="dark"&&(e.dark=af(e.main,i)))}function sf(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(m="light"){return m==="dark"?{main:"#90caf9",light:"#e3f2fd",dark:q8}:{main:"#1976d2",light:q8,dark:"#1565c0"}}(t),a=e.secondary||function(m="light"){return m==="dark"?{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"}:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"}}(t),l=e.error||function(m="light"){return m==="dark"?{main:"#f44336",light:"#e57373",dark:U8}:{main:U8,light:"#ef5350",dark:"#c62828"}}(t),c=e.info||function(m="light"){return m==="dark"?{main:"#29b6f6",light:"#4fc3f7",dark:K8}:{main:K8,light:"#03a9f4",dark:"#01579b"}}(t),d=e.success||function(m="light"){return m==="dark"?{main:"#66bb6a",light:"#81c784",dark:"#388e3c"}:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"}}(t),p=e.warning||function(m="light"){return m==="dark"?{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"}:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"}}(t);function f(m){return function(y,x){const v=kh(y),b=kh(x);return(Math.max(v,b)+.05)/(Math.min(v,b)+.05)}(m,G8.text.primary)>=n?G8.text.primary:LA.text.primary}const h=({color:m,name:y,mainShade:x=500,lightShade:v=300,darkShade:b=700})=>{if(!(m={...m}).main&&m[x]&&(m.main=m[x]),!m.hasOwnProperty("main"))throw new Error($l(11,y?` (${y})`:"",x));if(typeof m.main!="string")throw new Error($l(12,y?` (${y})`:"",JSON.stringify(m.main)));return Z8(m,"light",v,o),Z8(m,"dark",b,o),m.contrastText||(m.contrastText=f(m.main)),m};let g;return t==="light"?g=nw():t==="dark"&&(g=ow()),ai({common:{...Zc},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:d,name:"success"}),grey:AA,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...g},r)}var X8,Y8,Np,J8,Q8,e9={exports:{}};function zA(){if(J8)return Np;J8=1;var e=Y8?X8:(Y8=1,X8="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Np=function(){function o(a,l,c,d,p,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Np}function Xc(){return Q8||(Q8=1,e9.exports=zA()()),e9.exports}function kc(e,t){return t?ai(e,t,{clone:!1}):e}function t9(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const I2={xs:0,sm:600,md:900,lg:1200,xl:1536},n9={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${I2[e]}px)`},FA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:I2[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Ra(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||n9;return t.reduce((i,a,l)=>(i[r.up(r.keys[l])]=n(t[l]),i),{})}if(typeof t=="object"){const r=o.breakpoints||n9;return Object.keys(t).reduce((i,a)=>{if(l=r.keys,(c=a)==="@"||c.startsWith("@")&&(l.some(d=>c.startsWith(`@${d}`))||c.match(/^@\d/))){const d=function(p,f){const h=f.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,g,m]=h,y=Number.isNaN(+g)?g||0:+g;return p.containerQueries(m).up(y)}(o.containerQueries?o:FA,a);d&&(i[d]=n(t[a],a))}else if(Object.keys(r.values||I2).includes(a))i[r.up(a)]=n(t[a],a);else{const d=a;i[d]=t[d]}var l,c;return i},{})}return n(t)}function o9(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function rw(e){if(typeof e!="string")throw new Error($l(7));return e.charAt(0).toUpperCase()+e.slice(1)}function P2(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function zu(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:P2(e,n)||o,t&&(r=t(r,o,e)),r}function qo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=a=>{if(a[t]==null)return null;const l=a[t],c=P2(a.theme,o)||{};return Ra(a,l,d=>{let p=zu(c,r,d);return d===p&&typeof d=="string"&&(p=zu(c,r,`${t}${d==="default"?"":rw(d)}`,d)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const BA={m:"margin",p:"padding"},NA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},r9={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},$A=function(){const e={};return t=>(e[t]===void 0&&(e[t]=(n=>{if(n.length>2){if(!r9[n])return[n];n=r9[n]}const[o,r]=n.split(""),i=BA[o],a=NA[r]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]})(t)),e[t])}(),iw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],aw=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function T1(e,t,n,o){const r=P2(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),l=r[a];return i>=0?l:typeof l=="number"?-l:`-${l}`}:typeof r=="function"?r:()=>{}}function cf(e){return T1(e,"spacing",8)}function _1(e,t){return typeof t=="string"||t==null?t:e(t)}function lw(e,t){const n=cf(e.theme);return Object.keys(e).map(o=>function(r,i,a,l){if(!i.includes(a))return null;const c=function(d,p){return f=>d.reduce((h,g)=>(h[g]=_1(p,f),h),{})}($A(a),l);return Ra(r,r[a],c)}(e,t,o,n)).reduce(kc,{})}function Do(e){return lw(e,iw)}function Ao(e){return lw(e,aw)}Do.propTypes={},Do.filterProps=iw,Ao.propTypes={},Ao.filterProps=aw;const VA={borderRadius:4};function Fu(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?kc(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function wi(e){return typeof e!="number"?e:`${e}px solid`}function Oi(e,t){return qo({prop:e,themeKey:"borders",transform:t})}const HA=Oi("border",wi),WA=Oi("borderTop",wi),UA=Oi("borderRight",wi),qA=Oi("borderBottom",wi),KA=Oi("borderLeft",wi),GA=Oi("borderColor"),ZA=Oi("borderTopColor"),XA=Oi("borderRightColor"),YA=Oi("borderBottomColor"),JA=Oi("borderLeftColor"),QA=Oi("outline",wi),eL=Oi("outlineColor"),Yd=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=T1(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:_1(t,o)});return Ra(e,e.borderRadius,n)}return null};Yd.propTypes={},Yd.filterProps=["borderRadius"],Fu(HA,WA,UA,qA,KA,GA,ZA,XA,YA,JA,Yd,QA,eL);const Bu=e=>{if(e.gap!==void 0&&e.gap!==null){const t=T1(e.theme,"spacing",8),n=o=>({gap:_1(t,o)});return Ra(e,e.gap,n)}return null};Bu.propTypes={},Bu.filterProps=["gap"];const Nu=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=T1(e.theme,"spacing",8),n=o=>({columnGap:_1(t,o)});return Ra(e,e.columnGap,n)}return null};Nu.propTypes={},Nu.filterProps=["columnGap"];const Jd=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=T1(e.theme,"spacing",8),n=o=>({rowGap:_1(t,o)});return Ra(e,e.rowGap,n)}return null};function Is(e,t){return t==="grey"?t:e}function ti(e){return e<=1&&e!==0?100*e+"%":e}Jd.propTypes={},Jd.filterProps=["rowGap"],Fu(Bu,Nu,Jd,qo({prop:"gridColumn"}),qo({prop:"gridRow"}),qo({prop:"gridAutoFlow"}),qo({prop:"gridAutoColumns"}),qo({prop:"gridAutoRows"}),qo({prop:"gridTemplateColumns"}),qo({prop:"gridTemplateRows"}),qo({prop:"gridTemplateAreas"}),qo({prop:"gridArea"})),Fu(qo({prop:"color",themeKey:"palette",transform:Is}),qo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Is}),qo({prop:"backgroundColor",themeKey:"palette",transform:Is}));const tL=qo({prop:"width",transform:ti}),df=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||I2[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ti(n)}};return Ra(e,e.maxWidth,t)}return null};df.filterProps=["maxWidth"];const nL=qo({prop:"minWidth",transform:ti}),oL=qo({prop:"height",transform:ti}),rL=qo({prop:"maxHeight",transform:ti}),iL=qo({prop:"minHeight",transform:ti});qo({prop:"size",cssProperty:"width",transform:ti}),qo({prop:"size",cssProperty:"height",transform:ti}),Fu(tL,df,nL,oL,rL,iL,qo({prop:"boxSizing"}));const O2={border:{themeKey:"borders",transform:wi},borderTop:{themeKey:"borders",transform:wi},borderRight:{themeKey:"borders",transform:wi},borderBottom:{themeKey:"borders",transform:wi},borderLeft:{themeKey:"borders",transform:wi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:wi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yd},color:{themeKey:"palette",transform:Is},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Is},backgroundColor:{themeKey:"palette",transform:Is},p:{style:Ao},pt:{style:Ao},pr:{style:Ao},pb:{style:Ao},pl:{style:Ao},px:{style:Ao},py:{style:Ao},padding:{style:Ao},paddingTop:{style:Ao},paddingRight:{style:Ao},paddingBottom:{style:Ao},paddingLeft:{style:Ao},paddingX:{style:Ao},paddingY:{style:Ao},paddingInline:{style:Ao},paddingInlineStart:{style:Ao},paddingInlineEnd:{style:Ao},paddingBlock:{style:Ao},paddingBlockStart:{style:Ao},paddingBlockEnd:{style:Ao},m:{style:Do},mt:{style:Do},mr:{style:Do},mb:{style:Do},ml:{style:Do},mx:{style:Do},my:{style:Do},margin:{style:Do},marginTop:{style:Do},marginRight:{style:Do},marginBottom:{style:Do},marginLeft:{style:Do},marginX:{style:Do},marginY:{style:Do},marginInline:{style:Do},marginInlineStart:{style:Do},marginInlineEnd:{style:Do},marginBlock:{style:Do},marginBlockStart:{style:Do},marginBlockEnd:{style:Do},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Bu},rowGap:{style:Jd},columnGap:{style:Nu},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ti},maxWidth:{style:df},minWidth:{transform:ti},height:{transform:ti},maxHeight:{transform:ti},minHeight:{transform:ti},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},s0=function(){function e(t,n,o,r){const i={[t]:n,theme:o},a=r[t];if(!a)return{[t]:n};const{cssProperty:l=t,themeKey:c,transform:d,style:p}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const f=P2(o,c)||{};return p?p(i):Ra(i,n,h=>{let g=zu(f,d,h);return h===g&&typeof h=="string"&&(g=zu(f,d,`${t}${h==="default"?"":rw(h)}`,h)),l===!1?g:{[l]:g}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const a=r.unstable_sxConfig??O2;function l(c){let d=c;if(typeof c=="function")d=c(r);else if(typeof c!="object")return c;if(!d)return null;const p=function(g={}){return g.keys?.reduce((m,y)=>(m[g.up(y)]={},m),{})||{}}(r.breakpoints),f=Object.keys(p);let h=p;return Object.keys(d).forEach(g=>{const m=typeof(y=d[g])=="function"?y(r):y;var y;if(m!=null)if(typeof m=="object")if(a[g])h=kc(h,e(g,m,r,a));else{const x=Ra({theme:r},m,v=>({[g]:v}));(function(...v){const b=v.reduce((M,k)=>M.concat(Object.keys(k)),[]),w=new Set(b);return v.every(M=>w.size===Object.keys(M).length)})(x,m)?h[g]=t({sx:m,theme:r,nested:!0}):h=kc(h,x)}else h=kc(h,e(g,m,r,a))}),!i&&r.modularCssLayers?{"@layer sx":t9(r,o9(f,h))}:t9(r,o9(f,h))}return Array.isArray(o)?o.map(l):l(o)}}();function aL(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function sw(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...a}=e,l=function(d){const{values:p={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:f="px",step:h=5,...g}=d,m=(w=>{const M=Object.keys(w).map(k=>({key:k,val:w[k]}))||[];return M.sort((k,j)=>k.val-j.val),M.reduce((k,j)=>({...k,[j.key]:j.val}),{})})(p),y=Object.keys(m);function x(w){return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f})`}function v(w){return`@media (max-width:${(typeof p[w]=="number"?p[w]:w)-h/100}${f})`}function b(w,M){const k=y.indexOf(M);return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f}) and (max-width:${(k!==-1&&typeof p[y[k]]=="number"?p[y[k]]:M)-h/100}${f})`}return{keys:y,values:m,up:x,down:v,between:b,only:function(w){return y.indexOf(w)+1<y.length?b(w,y[y.indexOf(w)+1]):x(w)},not:function(w){const M=y.indexOf(w);return M===0?x(y[1]):M===y.length-1?v(y[M]):b(w,y[y.indexOf(w)+1]).replace("@media","@media not all and")},unit:f,...g}}(n);let c=ai({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:function(d=8,p=cf({spacing:d})){if(d.mui)return d;const f=(...h)=>(h.length===0?[1]:h).map(g=>{const m=p(g);return typeof m=="number"?`${m}px`:m}).join(" ");return f.mui=!0,f}(r),shape:{...VA,...i}},a);return c=function(d){const p=(m,y)=>m.replace("@media",y?`@container ${y}`:"@container");function f(m,y){m.up=(...x)=>p(d.breakpoints.up(...x),y),m.down=(...x)=>p(d.breakpoints.down(...x),y),m.between=(...x)=>p(d.breakpoints.between(...x),y),m.only=(...x)=>p(d.breakpoints.only(...x),y),m.not=(...x)=>{const v=p(d.breakpoints.not(...x),y);return v.includes("not all and")?v.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):v}}const h={},g=m=>(f(h,m),h);return f(g),{...d,containerQueries:g}}(c),c.applyStyles=aL,c=t.reduce((d,p)=>ai(d,p),c),c.unstable_sxConfig={...O2,...a?.unstable_sxConfig},c.unstable_sx=function(d){return s0({sx:d,theme:this})},c}s0.filterProps=["sx"];const i9=(e,t,n,o=[])=>{let r=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function $p(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},a={};var l,c;return l=(d,p,f)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(d,p))){const m=`--${n?`${n}-`:""}${d.join("-")}`,y=(h=d,typeof(g=p)=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(x=>h.includes(x))||h[h.length-1].toLowerCase().includes("opacity")?g:`${g}px`:g);Object.assign(r,{[m]:y}),i9(i,d,`var(${m})`,f),i9(a,d,`var(${m}, ${y})`,f)}var h,g},c=d=>d[0]==="vars",function d(p,f=[],h=[]){Object.entries(p).forEach(([g,m])=>{(!c||c&&!c([...f,g]))&&m!=null&&(typeof m=="object"&&Object.keys(m).length>0?d(m,[...f,g],Array.isArray(m)?[...h,g]:h):l([...f,g],m,h))})}(e),{css:r,vars:i,varsWithDefaults:a}}function lL(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}const a9={textTransform:"uppercase"},l9='"Roboto", "Helvetica", "Arial", sans-serif';function cw(e,t){const{fontFamily:n=l9,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:d,pxToRem:p,...f}=typeof t=="function"?t(e):t,h=o/14,g=p||(x=>x/c*h+"rem"),m=(x,v,b,w,M)=>{return{fontFamily:n,fontWeight:x,fontSize:g(v),lineHeight:b,...n===l9?{letterSpacing:(k=w/v,Math.round(1e5*k)/1e5+"em")}:{},...M,...d};var k},y={h1:m(r,96,1.167,-1.5),h2:m(r,60,1.2,-.5),h3:m(i,48,1.167,0),h4:m(i,34,1.235,.25),h5:m(i,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(i,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(i,16,1.5,.15),body2:m(i,14,1.43,.15),button:m(a,14,1.75,.4,a9),caption:m(i,12,1.66,.4),overline:m(i,12,2.66,1,a9),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ai({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:l,...y},f,{clone:!1})}function ko(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const sL=["none",ko(0,2,1,-1,0,1,1,0,0,1,3,0),ko(0,3,1,-2,0,2,2,0,0,1,5,0),ko(0,3,3,-2,0,3,4,0,0,1,8,0),ko(0,2,4,-1,0,4,5,0,0,1,10,0),ko(0,3,5,-1,0,5,8,0,0,1,14,0),ko(0,3,5,-1,0,6,10,0,0,1,18,0),ko(0,4,5,-2,0,7,10,1,0,2,16,1),ko(0,5,5,-3,0,8,10,1,0,3,14,2),ko(0,5,6,-3,0,9,12,1,0,3,16,2),ko(0,6,6,-3,0,10,14,1,0,4,18,3),ko(0,6,7,-4,0,11,15,1,0,4,20,3),ko(0,7,8,-4,0,12,17,2,0,5,22,4),ko(0,7,8,-4,0,13,19,2,0,5,24,4),ko(0,7,9,-4,0,14,21,2,0,5,26,4),ko(0,8,9,-5,0,15,22,2,0,6,28,5),ko(0,8,10,-5,0,16,24,2,0,6,30,5),ko(0,8,11,-5,0,17,26,2,0,6,32,5),ko(0,9,11,-5,0,18,28,2,0,7,34,6),ko(0,9,12,-6,0,19,29,2,0,7,36,6),ko(0,10,13,-6,0,20,31,3,0,8,38,7),ko(0,10,13,-6,0,21,33,3,0,8,40,7),ko(0,10,14,-6,0,22,35,3,0,8,42,7),ko(0,11,14,-7,0,23,36,3,0,9,44,8),ko(0,11,15,-7,0,24,38,3,0,9,46,8)],cL={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},dL={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function s9(e){return`${Math.round(e)}ms`}function uL(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function pL(e){const t={...cL,...e.easing},n={...dL,...e.duration};return{getAutoHeightDuration:uL,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=r;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof i=="string"?i:s9(i)} ${a} ${typeof l=="string"?l:s9(l)}`).join(",")},...e,easing:t,duration:n}}const hL={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function fL(e){return ka(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function dw(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[a,l]=r[i];!fL(l)||a.startsWith("unstable_")?delete o[a]:ka(l)&&(o[a]={...l},n(o[a]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
146
+ `,c.getElementsByTagName("head")[0].appendChild(d)),c.body&&a(c.body,"react-draggable-transparent-selection")},$o.createCSSTransform=function(c,d){const p=r(c,d,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},$o.createSVGTransform=function(c,d){return r(c,d,"")},$o.getTouch=function(c,d){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>d===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>d===p.identifier)},$o.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},$o.getTranslation=r,$o.innerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingTop),d-=(0,e.int)(p.paddingBottom),d},$o.innerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingLeft),d-=(0,e.int)(p.paddingRight),d},$o.matchesSelector=o,$o.matchesSelectorAndParentsTo=function(c,d,p){let f=c;do{if(o(f,d))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},$o.offsetXYFromParent=function(c,d,p){const f=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect();return{x:(c.clientX+d.scrollLeft-f.left)/p,y:(c.clientY+d.scrollTop-f.top)/p}},$o.outerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderTopWidth),d+=(0,e.int)(p.borderBottomWidth),d},$o.outerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderLeftWidth),d+=(0,e.int)(p.borderRightWidth),d},$o.removeClassName=l,$o.removeEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(d,p,h):c.detachEvent?c.detachEvent("on"+d,p):c["on"+d]=null},$o.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=Ou(),t=function(c){if(typeof WeakMap=="function")var d=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(f=d){if(f.has(p))return f.get(p);f.set(p,g)}for(const m in p)m!=="default"&&{}.hasOwnProperty.call(p,m)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,m))&&(h.get||h.set)?f(g,m,h):g[m]=p[m]);return g}(c)}(function(){if(g8)return La;g8=1,Object.defineProperty(La,"__esModule",{value:!0}),La.browserPrefixToKey=p,La.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},La.default=void 0,La.getPrefix=d;const c=["Moz","Webkit","O","ms"];function d(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let g=0;g<c.length;g++)if(p(f,c[g])in h)return c[g];return""}function p(f,h){return h?`${h}${function(g){let m="",y=!0;for(let x=0;x<g.length;x++)y?(m+=g[x].toUpperCase(),y=!1):g[x]==="-"?y=!0:m+=g[x];return m}(f)}`:f}return La.default=d(),La}());let n="";function o(c,d){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](d)}function r(c,d,p){let{x:f,y:h}=c,g=`translate(${f}${p},${h}${p})`;return d&&(g=`translate(${typeof d.x=="string"?d.x:d.x+p}, ${typeof d.y=="string"?d.y:d.y+p})`+g),g}function i(c){if(c)try{if(c.body&&l(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const d=(c.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function a(c,d){c.classList?c.classList.add(d):c.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(c.className+=` ${d}`)}function l(c,d){c.classList?c.classList.remove(d):c.className=c.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return $o}var x8,Ji={};function b8(){if(x8)return Ji;x8=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Ji.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Ji.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),l=n(o);return a?{node:l,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:l,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},Ji.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},Ji.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;var l;a=typeof a=="string"?a:{left:(l=a).left,top:l.top,right:l.right,bottom:l.bottom};const c=n(o);if(typeof a=="string"){const{ownerDocument:d}=c,p=d.defaultView;let f;if(f=a==="parent"?c.parentNode:c.getRootNode().querySelector(a),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,g=p.getComputedStyle(c),m=p.getComputedStyle(h);a={left:-c.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(g.marginLeft),top:-c.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(g.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(g.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(g.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},Ji.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const l=n(i),c=i.props.offsetParent||l.offsetParent||l.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},Ji.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Ou(),t=vh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Ji}var v8,w8,S8,C8,z0={},Fp={};function k8(){return v8||(v8=1,Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.default=function(){}),Fp}var fA=function(){if(C8)return L0.exports;C8=1;const{default:e,DraggableCore:t}=(S8||(S8=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),n.default=void 0;var o=function(x){if(typeof WeakMap=="function")var v=new WeakMap;return function(b){if(b&&b.__esModule)return b;var w,M,k={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return k;if(w=v){if(w.has(b))return w.get(b);w.set(b,k)}for(const j in b)j!=="default"&&{}.hasOwnProperty.call(b,j)&&((M=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,j))&&(M.get||M.set)?w(k,j,M):k[j]=b[j]);return k}(x)}(u),r=h(th()),i=h(yo),a=function(){if(h8)return fd.exports;function x(b){var w,M,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b)){var j=b.length;for(w=0;w<j;w++)b[w]&&(M=x(b[w]))&&(k&&(k+=" "),k+=M)}else for(M in b)b[M]&&(k&&(k+=" "),k+=M);return k}function v(){for(var b,w,M=0,k="",j=arguments.length;M<j;M++)(b=arguments[M])&&(w=x(b))&&(k&&(k+=" "),k+=w);return k}return h8=1,fd.exports=v,fd.exports.clsx=v,fd.exports}(),l=vh(),c=b8(),d=Ou(),p=h(function(){if(w8)return z0;w8=1,Object.defineProperty(z0,"__esModule",{value:!0}),z0.default=void 0;var x=function(R){if(typeof WeakMap=="function")var P=new WeakMap;return function(I){if(I&&I.__esModule)return I;var z,A,O={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return O;if(z=P){if(z.has(I))return z.get(I);z.set(I,O)}for(const N in I)N!=="default"&&{}.hasOwnProperty.call(I,N)&&((A=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,N))&&(A.get||A.set)?z(O,N,A):O[N]=I[N]);return O}(R)}(u),v=_(th()),b=_(yo),w=vh(),M=b8(),k=Ou(),j=_(k8());function _(R){return R&&R.__esModule?R:{default:R}}function L(R,P,I){return(P=typeof(z=function(A){if(typeof A!="object"||!A)return A;var O=A[Symbol.toPrimitive];if(O!==void 0){var N=O.call(A,"string");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(P))=="symbol"?z:z+"")in R?Object.defineProperty(R,P,{value:I,enumerable:!0,configurable:!0,writable:!0}):R[P]=I,R;var z}const T={start:"touchstart",move:"touchmove",stop:"touchend"},D={start:"mousedown",move:"mousemove",stop:"mouseup"};let C=D,S=class extends x.Component{constructor(){super(...arguments),L(this,"dragging",!1),L(this,"lastX",NaN),L(this,"lastY",NaN),L(this,"touchIdentifier",null),L(this,"mounted",!1),L(this,"handleDragStart",R=>{if(this.props.onMouseDown(R),!this.props.allowAnyClick&&typeof R.button=="number"&&R.button!==0)return!1;const P=this.findDOMNode();if(!P||!P.ownerDocument||!P.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:I}=P;if(this.props.disabled||!(R.target instanceof I.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(R.target,this.props.handle,P)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(R.target,this.props.cancel,P))return;R.type!=="touchstart"||this.props.allowMobileScroll||R.preventDefault();const z=(0,w.getTouchIdentifier)(R);this.touchIdentifier=z;const A=(0,M.getControlPosition)(R,z,this);if(A==null)return;const{x:O,y:N}=A,F=(0,M.createCoreData)(this,O,N);(0,j.default)("DraggableCore: handleDragStart: %j",F),(0,j.default)("calling",this.props.onStart),this.props.onStart(R,F)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(I),this.dragging=!0,this.lastX=O,this.lastY=N,(0,w.addEvent)(I,C.move,this.handleDrag),(0,w.addEvent)(I,C.stop,this.handleDragStop))}),L(this,"handleDrag",R=>{const P=(0,M.getControlPosition)(R,this.touchIdentifier,this);if(P==null)return;let{x:I,y:z}=P;if(Array.isArray(this.props.grid)){let O=I-this.lastX,N=z-this.lastY;if([O,N]=(0,M.snapToGrid)(this.props.grid,O,N),!O&&!N)return;I=this.lastX+O,z=this.lastY+N}const A=(0,M.createCoreData)(this,I,z);if((0,j.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(R,A)!==!1&&this.mounted!==!1)this.lastX=I,this.lastY=z;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const O=document.createEvent("MouseEvents");O.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(O)}}),L(this,"handleDragStop",R=>{if(!this.dragging)return;const P=(0,M.getControlPosition)(R,this.touchIdentifier,this);if(P==null)return;let{x:I,y:z}=P;if(Array.isArray(this.props.grid)){let N=I-this.lastX||0,F=z-this.lastY||0;[N,F]=(0,M.snapToGrid)(this.props.grid,N,F),I=this.lastX+N,z=this.lastY+F}const A=(0,M.createCoreData)(this,I,z);if(this.props.onStop(R,A)===!1||this.mounted===!1)return!1;const O=this.findDOMNode();O&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(O.ownerDocument),(0,j.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,O&&((0,j.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(O.ownerDocument,C.move,this.handleDrag),(0,w.removeEvent)(O.ownerDocument,C.stop,this.handleDragStop))}),L(this,"onMouseDown",R=>(C=D,this.handleDragStart(R))),L(this,"onMouseUp",R=>(C=D,this.handleDragStop(R))),L(this,"onTouchStart",R=>(C=T,this.handleDragStart(R))),L(this,"onTouchEnd",R=>(C=T,this.handleDragStop(R)))}componentDidMount(){this.mounted=!0;const R=this.findDOMNode();R&&(0,w.addEvent)(R,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const R=this.findDOMNode();if(R){const{ownerDocument:P}=R;(0,w.removeEvent)(P,D.move,this.handleDrag),(0,w.removeEvent)(P,T.move,this.handleDrag),(0,w.removeEvent)(P,D.stop,this.handleDragStop),(0,w.removeEvent)(P,T.stop,this.handleDragStop),(0,w.removeEvent)(R,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(P)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:b.default.findDOMNode(this)}render(){return x.cloneElement(x.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return z0.default=S,L(S,"displayName","DraggableCore"),L(S,"propTypes",{allowAnyClick:v.default.bool,allowMobileScroll:v.default.bool,children:v.default.node.isRequired,disabled:v.default.bool,enableUserSelectHack:v.default.bool,offsetParent:function(R,P){if(R[P]&&R[P].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:v.default.arrayOf(v.default.number),handle:v.default.string,cancel:v.default.string,nodeRef:v.default.object,onStart:v.default.func,onDrag:v.default.func,onStop:v.default.func,onMouseDown:v.default.func,scale:v.default.number,className:k.dontSetMe,style:k.dontSetMe,transform:k.dontSetMe}),L(S,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),z0}()),f=h(k8());function h(x){return x&&x.__esModule?x:{default:x}}function g(){return g=Object.assign?Object.assign.bind():function(x){for(var v=1;v<arguments.length;v++){var b=arguments[v];for(var w in b)({}).hasOwnProperty.call(b,w)&&(x[w]=b[w])}return x},g.apply(null,arguments)}function m(x,v,b){return(v=typeof(w=function(M){if(typeof M!="object"||!M)return M;var k=M[Symbol.toPrimitive];if(k!==void 0){var j=k.call(M,"string");if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(M)}(v))=="symbol"?w:w+"")in x?Object.defineProperty(x,v,{value:b,enumerable:!0,configurable:!0,writable:!0}):x[v]=b,x;var w}class y extends o.Component{static getDerivedStateFromProps(v,b){let{position:w}=v,{prevPropsPosition:M}=b;return!w||M&&w.x===M.x&&w.y===M.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:M}),{x:w.x,y:w.y,prevPropsPosition:{...w}})}constructor(v){super(v),m(this,"onDragStart",(b,w)=>{if((0,f.default)("Draggable: onDragStart: %j",w),this.props.onStart(b,(0,c.createDraggableData)(this,w))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(b,w)=>{if(!this.state.dragging)return!1;(0,f.default)("Draggable: onDrag: %j",w);const M=(0,c.createDraggableData)(this,w),k={x:M.x,y:M.y,slackX:0,slackY:0};if(this.props.bounds){const{x:j,y:_}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[L,T]=(0,c.getBoundPosition)(this,k.x,k.y);k.x=L,k.y=T,k.slackX=this.state.slackX+(j-k.x),k.slackY=this.state.slackY+(_-k.y),M.x=k.x,M.y=k.y,M.deltaX=k.x-this.state.x,M.deltaY=k.y-this.state.y}if(this.props.onDrag(b,M)===!1)return!1;this.setState(k)}),m(this,"onDragStop",(b,w)=>{if(!this.state.dragging||this.props.onStop(b,(0,c.createDraggableData)(this,w))===!1)return!1;(0,f.default)("Draggable: onDragStop: %j",w);const M={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:k,y:j}=this.props.position;M.x=k,M.y=j}this.setState(M)}),this.state={dragging:!1,dragged:!1,x:v.position?v.position.x:v.defaultPosition.x,y:v.position?v.position.y:v.defaultPosition.y,prevPropsPosition:{...v.position},slackX:0,slackY:0,isElementSVG:!1},!v.position||v.onDrag||v.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??i.default.findDOMNode(this)}render(){const{axis:v,bounds:b,children:w,defaultPosition:M,defaultClassName:k,defaultClassNameDragging:j,defaultClassNameDragged:_,position:L,positionOffset:T,scale:D,...C}=this.props;let S={},R=null;const P=!L||this.state.dragging,I=L||M,z={x:(0,c.canDragX)(this)&&P?this.state.x:I.x,y:(0,c.canDragY)(this)&&P?this.state.y:I.y};this.state.isElementSVG?R=(0,l.createSVGTransform)(z,T):S=(0,l.createCSSTransform)(z,T);const A=(0,a.clsx)(w.props.className||"",k,{[j]:this.state.dragging,[_]:this.state.dragged});return o.createElement(p.default,g({},C,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(w),{className:A,style:{...w.props.style,...S},transform:R}))}}n.default=y,m(y,"displayName","Draggable"),m(y,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),m(y,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(m8)),m8);return L0.exports=e,L0.exports.default=e,L0.exports.DraggableCore=t,L0.exports}();const mA=jb(fA),E8={x:0,y:0},gA=u.memo(u.forwardRef((e,t)=>{const{defaultPosition:n=E8,PaperComponent:o=Ti,onDragStop:r,rootSel:i=".MuiModal-root",handleSel:a=".draggable-title",titleSize:l,rootSize:c,...d}=e,p=u.useRef(null),f=u.useMemo(()=>l&&c?{left:0,top:0,right:c.width-l.width,bottom:c.height-l.height}:null,[l,c]),[h,g]=u.useState(null),[m,y]=u.useState(null),[x,v]=u.useState(null);return u.useLayoutEffect(()=>{!h&&n&&g(n??E8)},[n]),u.useEffect(()=>{f&&h&&y({x:Math.max(0,Math.min(h.x,f.right)),y:Math.max(0,Math.min(h.y,f.bottom))})},[h,f]),s.jsx(mA,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:m,bounds:f??".MuiModal-root",onStop:r,onStart:(b,w)=>{const M=b;v({x:(M.clientX??M.touches?.[0]?.clientX)-w.x,y:(M.clientY??M.touches?.[0]?.clientY)-w.y})},onDrag:(b,w)=>{const M=b,k=M.clientX??M.touches?.[0]?.clientX,j=M.clientY??M.touches?.[0]?.clientY;g({x:k-x.x,y:j-x.y})},children:s.jsx(o,{ref:_u([p,t]),...d})})})),yA={x:"50",y:"50"},Lv=u.memo(u.forwardRef((e,t)=>{const n=function({props:ce,name:ne}){return function({props:Pe,name:Ee,defaultTheme:it,themeId:Ue}){let ke=function(_e=aP){return function(Xe=null){const Be=X.useContext(t0);return Be&&(ct=Be,Object.keys(ct).length!==0)?Be:Xe;var ct}(_e)}(it);return ke=ke[Ue]||ke,bP({theme:ke,name:Ee,props:Pe})}({props:ce,name:ne,defaultTheme:B3,themeId:I3})}({props:e,name:"MuiDialog"}),o=N3(),r={enter:.66*o.transitions.duration.enteringScreen,exit:.66*o.transitions.duration.leavingScreen},{title:i="SheetXL",key:a="draggable-window",onCancel:l,onDone:c,onShow:d,onShown:p,onHide:f,open:h,autoFocusSel:g,children:m,TransitionComponent:y=Sx,TransitionProps:x,transitionDuration:v=r,BackdropComponent:b=Cx,BackdropProps:w,PaperComponent:M=Ti,PaperProps:k,onBackdropClick:j,sx:_,className:L,onMouseDown:T,initialPosition:D=yA,isModal:C=!1,...S}=n,R=u.useRef(null),[P,I]=u.useState(null),[z,A]=u.useState(!1),[O,N]=u.useState(!1),F=u.useRef(null),[E,B]=Y7(),H=u.useRef(null),[U,Z]=Y7(),G=u.useRef(null);u.useEffect(()=>{P&&A(h)},[h,P]);const V=En(()=>{l?.(),A(!1)},[l]);u.useEffect(()=>{if(B.width===0&&B.height===0||P)return;const ce=G.current?.getBoundingClientRect(),ne=B.height-ce.height,Pe=B.width-ce.width;let Ee=.5*Pe,it=.5*ne;typeof D?.x=="number"?Ee=D.x:typeof D?.x=="string"&&(Ee=Pe*(parseFloat(D.x)/100)),typeof D?.y=="number"?it=D.y:typeof D?.y=="string"&&(it=ne*(parseFloat(D.y)/100)),I({x:Ee,y:it})},[B,Z]);const[le,re]=u.useState(!1),[ge,Q]=u.useState(null),[xe,be]=u.useState(null),Fe=En(ce=>{if(ge)return ge.focus(ce),!0;if(g){const ne=H.current?.querySelectorAll?.(g);if(ne&&ne.length>0)return ne[0]?.focus?.(ce),!0}return H.current?.focus?.(ce),!1},[ge,g]),ee=T2(t,()=>({focus:ce=>{Fe(ce)}}),[]),ae={...x,onExited:ce=>{c?.(null),x?.onExited?.(ce)},onExit:ce=>{const ne=xe;ne&&requestAnimationFrame(()=>{ee.current?.contains(document.activeElement)&&ne.focus()}),f?.(),N(!1),x?.onExit?.(ce)},onEntered:(ce,ne)=>{d?.(),x?.onEntered?.(ce,ne)},onEntering:(ce,ne)=>{N(!0),p?.(ee.current)}};u.useEffect(()=>{O&&Fe()},[O]);const we=s.jsx(hA,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:R,active:O,children:s.jsx(y,{in:z,timeout:v,role:"presentation",...ae,children:s.jsx(Ae,{className:"MuiDialog-container",ref:H,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:ce=>{ce.which===xr.Escape&&(V(),F.current?.start(ce,{center:!1}),setTimeout(()=>F.current?.stop(ce),180)),ce.stopPropagation()},children:s.jsxs(gA,{ref:_u([G,t]),className:rr({"Mui-focusVisible":le},L),sx:{"& *":ce=>Y3(ce),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:ce=>`solid ${pt(ce.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:ce=>`solid ${pt(ce.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",..._},defaultPosition:P,titleSize:Z,rootSize:B,PaperComponent:M,...S,...k,children:[i?s.jsx(Mx,{className:rr({"Mui-selected":le},"draggable-title"),sx:{cursor:"move",display:"flex",color:ce=>ce.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:ce=>`${ce.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:ce=>ce.transitions.duration.shortest/2+"ms"},backgroundColor:ce=>pt(ce.palette.action.hover,.03)},ref:U,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:ce=>ce.spacing(1),marginLeft:ce=>ce.spacing(1),marginRight:ce=>ce.spacing(1)},children:[s.jsx(Ae,{sx:{flex:"1 1 100%",paddingLeft:ce=>ce.spacing(1)},children:i}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:ce=>ce.palette.text.icon??ce.palette.action.active},touchRippleRef:F,onPointerDown:ce=>{F.current?.start(ce,{center:!1}),ce.stopPropagation(),ce.preventDefault()},onPointerUp:V,children:s.jsx(M3,{})})})]})}):null,m]})})})});let se=null;C&&(se=s.jsx(b,{...w,open:z,onMouseDown:ce=>{V(),w?.onMouseDown?.(ce)},onClick:ce=>{j?.(ce),w?.onClick?.(ce)},sx:{pointerEvents:"auto",...w?.sx}}));const{getPortalContainer:J}=U3();return yo.createPortal(s.jsxs(Ae,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:_u([ee,E]),onPointerDown:ce=>{le&&(ce.target===H.current||ce.target.tabIndex<0)&&H.current?.contains(document.activeElement)},onContextMenu:ce=>{ce.isPropagationStopped()||ce.preventDefault()},onFocus:ce=>{!le&&(ce.target===H.current||ce.target.tabIndex<0)&&setTimeout(()=>{Fe()},100),R.current?.focusTrap?.unpause(),re(!0),H.current?.contains(ce.target)&&ce.target!==H.current&&Q(ce.target),ce.relatedTarget&&!xe&&be(ce.relatedTarget)},onBlur:ce=>{ee?.current?.contains(ce.relatedTarget)||(be(null),R.current?.focusTrap?.pause(),re(!1))},children:[se,we]}),J(),a+"")}));var Mi=typeof window<"u"?window:{screen:{},navigator:{}},Zs=(Mi.matchMedia||function(){return{matches:!1}}).bind(Mi),xA={get passive(){return!0}},M8=function(){};Mi.addEventListener&&Mi.addEventListener("p",M8,xA),Mi.removeEventListener&&Mi.removeEventListener("p",M8,!1);var Q3="ontouchstart"in Mi,bA=Q3||"TouchEvent"in Mi&&Zs("(any-pointer: coarse)").matches,T8=(Mi.navigator.maxTouchPoints||0)>0||bA,zv=Mi.navigator.userAgent||"",vA=Zs("(pointer: coarse)").matches&&/iPad|Macintosh/.test(zv)&&Math.min(Mi.screen.width||0,Mi.screen.height||0)>=768,Fv=(Zs("(pointer: coarse)").matches||!Zs("(pointer: fine)").matches&&Q3)&&!/Windows.*Firefox/.test(zv),wA=Zs("(any-pointer: fine)").matches||Zs("(any-hover: hover)").matches||vA||!Q3,_8=!T8||!wA&&Fv?T8?"touchOnly":"mouseOnly":"hybrid",SA=_8==="mouseOnly"?"mouse":_8==="touchOnly"||Fv?"touch":"mouse",Sc=e=>e.type==="checkbox",El=e=>e instanceof Date,Lr=e=>e==null;const Bv=e=>typeof e=="object";var Zo=e=>!Lr(e)&&!Array.isArray(e)&&Bv(e)&&!El(e),ef=typeof window<"u"&&window.HTMLElement!==void 0&&typeof document<"u";function Cr(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(ef&&(e instanceof Blob||o)||!n&&!Zo(e))return e;if(t=n?[]:{},n||(r=>{const i=r.constructor&&r.constructor.prototype;return Zo(i)&&i.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Cr(e[r]));else t=e}return t}var j2=e=>/^\w*$/.test(e),Jo=e=>e===void 0,wh=e=>Array.isArray(e)?e.filter(Boolean):[],tf=e=>wh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Kt=(e,t,n)=>{if(!t||!Zo(e))return n;const o=(j2(t)?[t]:tf(t)).reduce((r,i)=>Lr(r)?r:r[i],e);return Jo(o)||o===e?Jo(e[t])?n:e[t]:o},oa=e=>typeof e=="boolean",xo=(e,t,n)=>{let o=-1;const r=j2(t)?[t]:tf(t),i=r.length,a=i-1;for(;++o<i;){const l=r[o];let c=n;if(o!==a){const d=e[l];c=Zo(d)||Array.isArray(d)?d:isNaN(+r[o+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Nv="onChange",$v="onSubmit",oc="all",j8="pattern",R8="required",Vv=u.createContext(null);Vv.displayName="HookFormContext";const CA=e=>{const{children:t,...n}=e;return u.createElement(Vv.Provider,{value:n},t)},kA=typeof window<"u"?X.useLayoutEffect:X.useEffect;var sa=e=>typeof e=="string",EA=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},rc=e=>Array.isArray(e)?e:[e],I8=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(n=>n!==t)}}),unsubscribe:()=>{e=[]}}},Sh=e=>Lr(e)||!Bv(e);function qa(e,t){if(Sh(e)||Sh(t))return e===t;if(El(e)&&El(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n){const i=e[r];if(!o.includes(r))return!1;if(r!=="ref"){const a=t[r];if(El(i)&&El(a)||Zo(i)&&Zo(a)||Array.isArray(i)&&Array.isArray(a)?!qa(i,a):i!==a)return!1}}return!0}var $r=e=>Zo(e)&&!Object.keys(e).length,nf=e=>e.type==="file",$i=e=>typeof e=="function",Du=e=>{if(!ef)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Hv=e=>e.type==="select-multiple",of=e=>e.type==="radio",Bp=e=>Du(e)&&e.isConnected;function nr(e,t){const n=Array.isArray(t)?t:j2(t)?[t]:tf(t),o=n.length===1?e:function(a,l){const c=l.slice(0,-1).length;let d=0;for(;d<c;)a=Jo(a)?d++:a[l[d++]];return a}(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(Zo(o)&&$r(o)||Array.isArray(o)&&function(a){for(const l in a)if(a.hasOwnProperty(l)&&!Jo(a[l]))return!1;return!0}(o))&&nr(e,n.slice(0,-1)),e}var Wv=e=>{for(const t in e)if($i(e[t]))return!0;return!1};function Au(e,t={}){const n=Array.isArray(e);if(Zo(e)||n)for(const o in e)Array.isArray(e[o])||Zo(e[o])&&!Wv(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Au(e[o],t[o])):Lr(e[o])||(t[o]=!0);return t}function Uv(e,t,n){const o=Array.isArray(e);if(Zo(e)||o)for(const r in e)Array.isArray(e[r])||Zo(e[r])&&!Wv(e[r])?Jo(t)||Sh(n[r])?n[r]=Array.isArray(e[r])?Au(e[r],[]):{...Au(e[r])}:Uv(e[r],Lr(t)?{}:t[r],n[r]):n[r]=!qa(e[r],t[r]);return n}var F0=(e,t)=>Uv(e,t,Au(t));const P8={value:!1,isValid:!1},O8={value:!0,isValid:!0};var qv=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Jo(e[0].attributes.value)?Jo(e[0].value)||e[0].value===""?O8:{value:e[0].value,isValid:!0}:O8:P8}return P8},Kv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Jo(e)?e:t?e===""?NaN:e&&+e:n&&sa(e)?new Date(e):o?o(e):e;const D8={isValid:!1,value:null};var Gv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,D8):D8;function A8(e){const t=e.ref;return nf(t)?t.files:of(t)?Gv(e.refs).value:Hv(t)?[...t.selectedOptions].map(({value:n})=>n):Sc(t)?qv(e.refs).value:Kv(Jo(t.value)?e.ref.value:t.value,e)}var Lu=e=>e instanceof RegExp,B0=e=>Jo(e)?e:Lu(e)?e.source:Zo(e)?Lu(e.value)?e.value.source:e.value:e,L8=e=>({isOnSubmit:!e||e===$v,isOnBlur:e==="onBlur",isOnChange:e===Nv,isOnAll:e===oc,isOnTouch:e==="onTouched"});const z8="AsyncFunction";var MA=e=>!!e&&!!e.validate&&!!($i(e.validate)&&e.validate.constructor.name===z8||Zo(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===z8)),F8=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Cc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Kt(e,r);if(i){const{_f:a,...l}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],r)&&!o||a.ref&&t(a.ref,a.name)&&!o)return!0;if(Cc(l,t))break}else if(Zo(l)&&Cc(l,t))break}}};function B8(e,t,n){const o=Kt(e,n);if(o||j2(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Kt(t,i),l=Kt(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};r.pop()}return{name:n}}var TA=(e,t,n)=>{const o=rc(Kt(e,n));return xo(o,"root",t[n]),xo(e,n,o),e},Xd=e=>sa(e);function N8(e,t,n="validate"){if(Xd(e)||Array.isArray(e)&&e.every(Xd)||oa(e)&&!e)return{type:n,message:Xd(e)?e:"",ref:t}}var as=e=>Zo(e)&&!Lu(e)?e:{value:e,message:""},$8=async(e,t,n,o,r,i)=>{const{ref:a,refs:l,required:c,maxLength:d,minLength:p,min:f,max:h,pattern:g,validate:m,name:y,valueAsNumber:x,mount:v}=e._f,b=Kt(n,y);if(!v||t.has(y))return{};const w=l?l[0]:a,M=S=>{r&&w.reportValidity&&(w.setCustomValidity(oa(S)?"":S||""),w.reportValidity())},k={},j=of(a),_=Sc(a),L=j||_,T=(x||nf(a))&&Jo(a.value)&&Jo(b)||Du(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,D=EA.bind(null,y,o,k),C=(S,R,P,I="maxLength",z="minLength")=>{const A=S?R:P;k[y]={type:S?I:z,message:A,ref:a,...D(S?I:z,A)}};if(i?!Array.isArray(b)||!b.length:c&&(!L&&(T||Lr(b))||oa(b)&&!b||_&&!qv(l).isValid||j&&!Gv(l).isValid)){const{value:S,message:R}=Xd(c)?{value:!!c,message:c}:as(c);if(S&&(k[y]={type:R8,message:R,ref:w,...D(R8,R)},!o))return M(R),k}if(!(T||Lr(f)&&Lr(h))){let S,R;const P=as(h),I=as(f);if(Lr(b)||isNaN(b)){const z=a.valueAsDate||new Date(b),A=F=>new Date(new Date().toDateString()+" "+F),O=a.type=="time",N=a.type=="week";sa(P.value)&&b&&(S=O?A(b)>A(P.value):N?b>P.value:z>new Date(P.value)),sa(I.value)&&b&&(R=O?A(b)<A(I.value):N?b<I.value:z<new Date(I.value))}else{const z=a.valueAsNumber||b&&+b;Lr(P.value)||(S=z>P.value),Lr(I.value)||(R=z<I.value)}if((S||R)&&(C(!!S,P.message,I.message,"max","min"),!o))return M(k[y].message),k}if((d||p)&&!T&&(sa(b)||i&&Array.isArray(b))){const S=as(d),R=as(p),P=!Lr(S.value)&&b.length>+S.value,I=!Lr(R.value)&&b.length<+R.value;if((P||I)&&(C(P,S.message,R.message),!o))return M(k[y].message),k}if(g&&!T&&sa(b)){const{value:S,message:R}=as(g);if(Lu(S)&&!b.match(S)&&(k[y]={type:j8,message:R,ref:a,...D(j8,R)},!o))return M(R),k}if(m){if($i(m)){const S=N8(await m(b,n),w);if(S&&(k[y]={...S,...D("validate",S.message)},!o))return M(S.message),k}else if(Zo(m)){let S={};for(const R in m){if(!$r(S)&&!o)break;const P=N8(await m[R](b,n),w,R);P&&(S={...P,...D(R,P.message)},M(P.message),o&&(k[y]=S))}if(!$r(S)&&(k[y]={ref:w,...S},!o))return k}}return M(!0),k};const _A={mode:$v,reValidateMode:Nv,shouldFocusError:!0},jA=["Ok","Cancel"],Ch=u.memo(u.forwardRef((e,t)=>{const{description:n,icon:o,onCancel:r,onOption:i,onDone:a,onValidateOption:l,createOptionsButton:c,options:d=jA,autoFocusSel:p=".defaultOption",defaultOption:f=d[0],cancelOption:h="Cancel",children:g,...m}=e,y=function(C={}){const S=u.useRef(void 0),R=u.useRef(void 0),[P,I]=u.useState({isDirty:!1,isValidating:!1,isLoading:$i(C.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:C.errors||{},disabled:C.disabled||!1,isReady:!1,defaultValues:$i(C.defaultValues)?void 0:C.defaultValues});if(!S.current)if(C.formControl)S.current={...C.formControl,formState:P},C.defaultValues&&!$i(C.defaultValues)&&C.formControl.reset(C.defaultValues,C.resetOptions);else{const{formControl:A,...O}=function(N={}){let F={..._A,...N},E={submitCount:0,isDirty:!1,isReady:!1,isLoading:$i(F.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:F.errors||{},disabled:F.disabled||!1};const B={};let H,U=(Zo(F.defaultValues)||Zo(F.values))&&Cr(F.defaultValues||F.values)||{},Z=F.shouldUnregister?{}:Cr(U),G={action:!1,mount:!1,watch:!1},V={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},le=0;const re={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let ge={...re};const Q={array:I8(),state:I8()},xe=F.criteriaMode===oc,be=async K=>{if(!F.disabled&&(re.isValid||ge.isValid||K)){const W=F.resolver?$r((await we()).errors):await se(B,!0);W!==E.isValid&&Q.state.next({isValid:W})}},Fe=(K,W)=>{!F.disabled&&(re.isValidating||re.validatingFields||ge.isValidating||ge.validatingFields)&&((K||Array.from(V.mount)).forEach(te=>{te&&(W?xo(E.validatingFields,te,W):nr(E.validatingFields,te))}),Q.state.next({validatingFields:E.validatingFields,isValidating:!$r(E.validatingFields)}))},ee=(K,W,te,oe)=>{const ue=Kt(B,K);if(ue){const ie=Kt(Z,K,Jo(te)?Kt(U,K):te);Jo(ie)||oe&&oe.defaultChecked||W?xo(Z,K,W?ie:A8(ue._f)):ne(K,ie),G.mount&&be()}},ae=(K,W,te,oe,ue)=>{let ie=!1,pe=!1;const fe={name:K};if(!F.disabled){if(!te||oe){(re.isDirty||ge.isDirty)&&(pe=E.isDirty,E.isDirty=fe.isDirty=J(),ie=pe!==fe.isDirty);const ye=qa(Kt(U,K),W);pe=!!Kt(E.dirtyFields,K),ye?nr(E.dirtyFields,K):xo(E.dirtyFields,K,!0),fe.dirtyFields=E.dirtyFields,ie=ie||(re.dirtyFields||ge.dirtyFields)&&pe!==!ye}if(te){const ye=Kt(E.touchedFields,K);ye||(xo(E.touchedFields,K,te),fe.touchedFields=E.touchedFields,ie=ie||(re.touchedFields||ge.touchedFields)&&ye!==te)}ie&&ue&&Q.state.next(fe)}return ie?fe:{}},we=async K=>{Fe(K,!0);const W=await F.resolver(Z,F.context,((te,oe,ue,ie)=>{const pe={};for(const fe of te){const ye=Kt(oe,fe);ye&&xo(pe,fe,ye._f)}return{criteriaMode:ue,names:[...te],fields:pe,shouldUseNativeValidation:ie}})(K||V.mount,B,F.criteriaMode,F.shouldUseNativeValidation));return Fe(K),W},se=async(K,W,te={valid:!0})=>{for(const oe in K){const ue=K[oe];if(ue){const{_f:ie,...pe}=ue;if(ie){const fe=V.array.has(ie.name),ye=ue._f&&MA(ue._f);ye&&re.validatingFields&&Fe([oe],!0);const De=await $8(ue,V.disabled,Z,xe,F.shouldUseNativeValidation&&!W,fe);if(ye&&re.validatingFields&&Fe([oe]),De[ie.name]&&(te.valid=!1,W))break;!W&&(Kt(De,ie.name)?fe?TA(E.errors,De,ie.name):xo(E.errors,ie.name,De[ie.name]):nr(E.errors,ie.name))}!$r(pe)&&await se(pe,W,te)}}return te.valid},J=(K,W)=>!F.disabled&&(K&&W&&xo(Z,K,W),!qa(_e(),U)),ce=(K,W,te)=>{return oe=K,ue=V,ie={...G.mount?Z:Jo(W)?U:sa(K)?{[K]:W}:W},pe=te,fe=W,sa(oe)?(pe&&ue.watch.add(oe),Kt(ie,oe,fe)):Array.isArray(oe)?oe.map(ye=>(pe&&ue.watch.add(ye),Kt(ie,ye))):(pe&&(ue.watchAll=!0),ie);var oe,ue,ie,pe,fe},ne=(K,W,te={})=>{const oe=Kt(B,K);let ue=W;if(oe){const ie=oe._f;ie&&(!ie.disabled&&xo(Z,K,Kv(W,ie)),ue=Du(ie.ref)&&Lr(W)?"":W,Hv(ie.ref)?[...ie.ref.options].forEach(pe=>pe.selected=ue.includes(pe.value)):ie.refs?Sc(ie.ref)?ie.refs.forEach(pe=>{pe.defaultChecked&&pe.disabled||(Array.isArray(ue)?pe.checked=!!ue.find(fe=>fe===pe.value):pe.checked=ue===pe.value||!!ue)}):ie.refs.forEach(pe=>pe.checked=pe.value===ue):nf(ie.ref)?ie.ref.value="":(ie.ref.value=ue,ie.ref.type||Q.state.next({name:K,values:Cr(Z)})))}(te.shouldDirty||te.shouldTouch)&&ae(K,ue,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&ke(K)},Pe=(K,W,te)=>{for(const oe in W){if(!W.hasOwnProperty(oe))return;const ue=W[oe],ie=K+"."+oe,pe=Kt(B,ie);(V.array.has(K)||Zo(ue)||pe&&!pe._f)&&!El(ue)?Pe(ie,ue,te):ne(ie,ue,te)}},Ee=(K,W,te={})=>{const oe=Kt(B,K),ue=V.array.has(K),ie=Cr(W);xo(Z,K,ie),ue?(Q.array.next({name:K,values:Cr(Z)}),(re.isDirty||re.dirtyFields||ge.isDirty||ge.dirtyFields)&&te.shouldDirty&&Q.state.next({name:K,dirtyFields:F0(U,Z),isDirty:J(K,ie)})):!oe||oe._f||Lr(ie)?ne(K,ie,te):Pe(K,ie,te),F8(K,V)&&Q.state.next({...E}),Q.state.next({name:G.mount?K:void 0,values:Cr(Z)})},it=async K=>{G.mount=!0;const W=K.target;let te=W.name,oe=!0;const ue=Kt(B,te),ie=Ve=>{oe=Number.isNaN(Ve)||El(Ve)&&isNaN(Ve.getTime())||qa(Ve,Kt(Z,te,Ve))},pe=L8(F.mode),fe=L8(F.reValidateMode);if(ue){let Ve,Je;const ot=W.type?A8(ue._f):Zo(De=K)&&De.target?Sc(De.target)?De.target.checked:De.target.value:De,tt=K.type==="blur"||K.type==="focusout",Lt=!((ye=ue._f).mount&&(ye.required||ye.min||ye.max||ye.maxLength||ye.minLength||ye.pattern||ye.validate)||F.resolver||Kt(E.errors,te)||ue._f.deps)||((Jt,Qt,rn,yn,dn)=>!dn.isOnAll&&(!rn&&dn.isOnTouch?!(Qt||Jt):(rn?yn.isOnBlur:dn.isOnBlur)?!Jt:!(rn?yn.isOnChange:dn.isOnChange)||Jt))(tt,Kt(E.touchedFields,te),E.isSubmitted,fe,pe),At=F8(te,V,tt);xo(Z,te,ot),tt?(ue._f.onBlur&&ue._f.onBlur(K),H&&H(0)):ue._f.onChange&&ue._f.onChange(K);const _t=ae(te,ot,tt),Yt=!$r(_t)||At;if(!tt&&Q.state.next({name:te,type:K.type,values:Cr(Z)}),Lt)return(re.isValid||ge.isValid)&&(F.mode==="onBlur"?tt&&be():tt||be()),Yt&&Q.state.next({name:te,...At?{}:_t});if(!tt&&At&&Q.state.next({...E}),F.resolver){const{errors:Jt}=await we([te]);if(ie(ot),oe){const Qt=B8(E.errors,B,te),rn=B8(Jt,B,Qt.name||te);Ve=rn.error,te=rn.name,Je=$r(Jt)}}else Fe([te],!0),Ve=(await $8(ue,V.disabled,Z,xe,F.shouldUseNativeValidation))[te],Fe([te]),ie(ot),oe&&(Ve?Je=!1:(re.isValid||ge.isValid)&&(Je=await se(B,!0)));oe&&(ue._f.deps&&ke(ue._f.deps),((Jt,Qt,rn,yn)=>{const dn=Kt(E.errors,Jt),kt=(re.isValid||ge.isValid)&&oa(Qt)&&E.isValid!==Qt;var xn;if(F.delayError&&rn?(xn=()=>{return tn=Jt,_n=rn,xo(E.errors,tn,_n),void Q.state.next({errors:E.errors});var tn,_n},H=tn=>{clearTimeout(le),le=setTimeout(xn,tn)},H(F.delayError)):(clearTimeout(le),H=null,rn?xo(E.errors,Jt,rn):nr(E.errors,Jt)),(rn?!qa(dn,rn):dn)||!$r(yn)||kt){const tn={...yn,...kt&&oa(Qt)?{isValid:Qt}:{},errors:E.errors,name:Jt};E={...E,...tn},Q.state.next(tn)}})(te,Je,Ve,_t))}var ye,De},Ue=(K,W)=>{if(Kt(E.errors,W)&&K.focus)return K.focus(),1},ke=async(K,W={})=>{let te,oe;const ue=rc(K);if(F.resolver){const ie=await(async pe=>{const{errors:fe}=await we(pe);if(pe)for(const ye of pe){const De=Kt(fe,ye);De?xo(E.errors,ye,De):nr(E.errors,ye)}else E.errors=fe;return fe})(Jo(K)?K:ue);te=$r(ie),oe=K?!ue.some(pe=>Kt(ie,pe)):te}else K?(oe=(await Promise.all(ue.map(async ie=>{const pe=Kt(B,ie);return await se(pe&&pe._f?{[ie]:pe}:pe)}))).every(Boolean),(oe||E.isValid)&&be()):oe=te=await se(B);return Q.state.next({...!sa(K)||(re.isValid||ge.isValid)&&te!==E.isValid?{}:{name:K},...F.resolver||!K?{isValid:te}:{},errors:E.errors}),W.shouldFocus&&!oe&&Cc(B,Ue,K?ue:V.mount),oe},_e=K=>{const W={...G.mount?Z:U};return Jo(K)?W:sa(K)?Kt(W,K):K.map(te=>Kt(W,te))},Xe=(K,W)=>({invalid:!!Kt((W||E).errors,K),isDirty:!!Kt((W||E).dirtyFields,K),error:Kt((W||E).errors,K),isValidating:!!Kt(E.validatingFields,K),isTouched:!!Kt((W||E).touchedFields,K)}),Be=(K,W,te)=>{const oe=(Kt(B,K,{_f:{}})._f||{}).ref,ue=Kt(E.errors,K)||{},{ref:ie,message:pe,type:fe,...ye}=ue;xo(E.errors,K,{...ye,...W,ref:oe}),Q.state.next({name:K,errors:E.errors,isValid:!1}),te&&te.shouldFocus&&oe&&oe.focus&&oe.focus()},ct=K=>Q.state.subscribe({next:W=>{var te,oe,ue;te=K.name,oe=W.name,ue=K.exact,te&&oe&&te!==oe&&!rc(te).some(ie=>ie&&(ue?ie===oe:ie.startsWith(oe)||oe.startsWith(ie)))||!((ie,pe,fe,ye)=>{fe(ie);const{name:De,...Ve}=ie;return $r(Ve)||Object.keys(Ve).length>=Object.keys(pe).length||Object.keys(Ve).find(Je=>pe[Je]===(!ye||oc))})(W,K.formState||re,Le,K.reRenderRoot)||K.callback({values:{...Z},...E,...W})}}).unsubscribe,et=(K,W={})=>{for(const te of K?rc(K):V.mount)V.mount.delete(te),V.array.delete(te),W.keepValue||(nr(B,te),nr(Z,te)),!W.keepError&&nr(E.errors,te),!W.keepDirty&&nr(E.dirtyFields,te),!W.keepTouched&&nr(E.touchedFields,te),!W.keepIsValidating&&nr(E.validatingFields,te),!F.shouldUnregister&&!W.keepDefaultValue&&nr(U,te);Q.state.next({values:Cr(Z)}),Q.state.next({...E,...W.keepDirty?{isDirty:J()}:{}}),!W.keepIsValid&&be()},he=({disabled:K,name:W})=>{(oa(K)&&G.mount||K||V.disabled.has(W))&&(K?V.disabled.add(W):V.disabled.delete(W))},Ye=(K,W={})=>{let te=Kt(B,K);const oe=oa(W.disabled)||oa(F.disabled);return xo(B,K,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:K}},name:K,mount:!0,...W}}),V.mount.add(K),te?he({disabled:oa(W.disabled)?W.disabled:F.disabled,name:K}):ee(K,!0,W.value),{...oe?{disabled:W.disabled||F.disabled}:{},...F.progressive?{required:!!W.required,min:B0(W.min),max:B0(W.max),minLength:B0(W.minLength),maxLength:B0(W.maxLength),pattern:B0(W.pattern)}:{},name:K,onChange:it,onBlur:it,ref:ue=>{if(ue){Ye(K,W),te=Kt(B,K);const De=Jo(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Ve=of(ye=De)||Sc(ye),Je=te._f.refs||[];if(Ve?Je.find(ot=>ot===De):De===te._f.ref)return;xo(B,K,{_f:{...te._f,...Ve?{refs:[...Je.filter(Bp),De,...Array.isArray(Kt(U,K))?[{}]:[]],ref:{type:De.type,name:K}}:{ref:De}}}),ee(K,!1,void 0,De)}else te=Kt(B,K,{}),te._f&&(te._f.mount=!1),(F.shouldUnregister||W.shouldUnregister)&&(ie=V.array,pe=K,!ie.has((fe=pe).substring(0,fe.search(/\.\d+(\.|$)/))||fe)||!G.action)&&V.unMount.add(K);var ie,pe,fe,ye}}},Se=()=>F.shouldFocusError&&Cc(B,Ue,V.mount),Ie=(K,W)=>async te=>{let oe;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let ue=Cr(Z);if(Q.state.next({isSubmitting:!0}),F.resolver){const{errors:ie,values:pe}=await we();E.errors=ie,ue=pe}else await se(B);if(V.disabled.size)for(const ie of V.disabled)xo(ue,ie,void 0);if(nr(E.errors,"root"),$r(E.errors)){Q.state.next({errors:{}});try{await K(ue,te)}catch(ie){oe=ie}}else W&&await W({...E.errors},te),Se(),setTimeout(Se);if(Q.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$r(E.errors)&&!oe,submitCount:E.submitCount+1,errors:E.errors}),oe)throw oe},de=(K,W={})=>{const te=K?Cr(K):U,oe=Cr(te),ue=$r(K),ie=ue?U:oe;if(W.keepDefaultValues||(U=te),!W.keepValues){if(W.keepDirtyValues){const pe=new Set([...V.mount,...Object.keys(F0(U,Z))]);for(const fe of Array.from(pe))Kt(E.dirtyFields,fe)?xo(ie,fe,Kt(Z,fe)):Ee(fe,Kt(ie,fe))}else{if(ef&&Jo(K))for(const pe of V.mount){const fe=Kt(B,pe);if(fe&&fe._f){const ye=Array.isArray(fe._f.refs)?fe._f.refs[0]:fe._f.ref;if(Du(ye)){const De=ye.closest("form");if(De){De.reset();break}}}}for(const pe of V.mount)Ee(pe,Kt(ie,pe))}Z=Cr(ie),Q.array.next({values:{...ie}}),Q.state.next({values:{...ie}})}V={mount:W.keepDirtyValues?V.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},G.mount=!re.isValid||!!W.keepIsValid||!!W.keepDirtyValues,G.watch=!!F.shouldUnregister,Q.state.next({submitCount:W.keepSubmitCount?E.submitCount:0,isDirty:!ue&&(W.keepDirty?E.isDirty:!(!W.keepDefaultValues||qa(K,U))),isSubmitted:!!W.keepIsSubmitted&&E.isSubmitted,dirtyFields:ue?{}:W.keepDirtyValues?W.keepDefaultValues&&Z?F0(U,Z):E.dirtyFields:W.keepDefaultValues&&K?F0(U,K):W.keepDirty?E.dirtyFields:{},touchedFields:W.keepTouched?E.touchedFields:{},errors:W.keepErrors?E.errors:{},isSubmitSuccessful:!!W.keepIsSubmitSuccessful&&E.isSubmitSuccessful,isSubmitting:!1})},Oe=(K,W)=>de($i(K)?K(Z):K,W),Le=K=>{E={...E,...K}},je={control:{register:Ye,unregister:et,getFieldState:Xe,handleSubmit:Ie,setError:Be,_subscribe:ct,_runSchema:we,_focusError:Se,_getWatch:ce,_getDirty:J,_setValid:be,_setFieldArray:(K,W=[],te,oe,ue=!0,ie=!0)=>{if(oe&&te&&!F.disabled){if(G.action=!0,ie&&Array.isArray(Kt(B,K))){const ye=te(Kt(B,K),oe.argA,oe.argB);ue&&xo(B,K,ye)}if(ie&&Array.isArray(Kt(E.errors,K))){const ye=te(Kt(E.errors,K),oe.argA,oe.argB);ue&&xo(E.errors,K,ye),pe=E.errors,!wh(Kt(pe,fe=K)).length&&nr(pe,fe)}if((re.touchedFields||ge.touchedFields)&&ie&&Array.isArray(Kt(E.touchedFields,K))){const ye=te(Kt(E.touchedFields,K),oe.argA,oe.argB);ue&&xo(E.touchedFields,K,ye)}(re.dirtyFields||ge.dirtyFields)&&(E.dirtyFields=F0(U,Z)),Q.state.next({name:K,isDirty:J(K,W),dirtyFields:E.dirtyFields,errors:E.errors,isValid:E.isValid})}else xo(Z,K,W);var pe,fe},_setDisabledField:he,_setErrors:K=>{E.errors=K,Q.state.next({errors:E.errors,isValid:!1})},_getFieldArray:K=>wh(Kt(G.mount?Z:U,K,F.shouldUnregister?Kt(U,K,[]):[])),_reset:de,_resetDefaultValues:()=>$i(F.defaultValues)&&F.defaultValues().then(K=>{Oe(K,F.resetOptions),Q.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const K of V.unMount){const W=Kt(B,K);W&&(W._f.refs?W._f.refs.every(te=>!Bp(te)):!Bp(W._f.ref))&&et(K)}V.unMount=new Set},_disableForm:K=>{oa(K)&&(Q.state.next({disabled:K}),Cc(B,(W,te)=>{const oe=Kt(B,te);oe&&(W.disabled=oe._f.disabled||K,Array.isArray(oe._f.refs)&&oe._f.refs.forEach(ue=>{ue.disabled=oe._f.disabled||K}))},0,!1))},_subjects:Q,_proxyFormState:re,get _fields(){return B},get _formValues(){return Z},get _state(){return G},set _state(K){G=K},get _defaultValues(){return U},get _names(){return V},set _names(K){V=K},get _formState(){return E},get _options(){return F},set _options(K){F={...F,...K}}},subscribe:K=>(G.mount=!0,ge={...ge,...K.formState},ct({...K,formState:ge})),trigger:ke,register:Ye,handleSubmit:Ie,watch:(K,W)=>$i(K)?Q.state.subscribe({next:te=>K(ce(void 0,W),te)}):ce(K,W,!0),setValue:Ee,getValues:_e,reset:Oe,resetField:(K,W={})=>{Kt(B,K)&&(Jo(W.defaultValue)?Ee(K,Cr(Kt(U,K))):(Ee(K,W.defaultValue),xo(U,K,Cr(W.defaultValue))),W.keepTouched||nr(E.touchedFields,K),W.keepDirty||(nr(E.dirtyFields,K),E.isDirty=W.defaultValue?J(K,Cr(Kt(U,K))):J()),W.keepError||(nr(E.errors,K),re.isValid&&be()),Q.state.next({...E}))},clearErrors:K=>{K&&rc(K).forEach(W=>nr(E.errors,W)),Q.state.next({errors:K?E.errors:{}})},unregister:et,setError:Be,setFocus:(K,W={})=>{const te=Kt(B,K),oe=te&&te._f;if(oe){const ue=oe.refs?oe.refs[0]:oe.ref;ue.focus&&(ue.focus(),W.shouldSelect&&$i(ue.select)&&ue.select())}},getFieldState:Xe};return{...je,formControl:je}}(C);S.current={...O,formState:P}}const z=S.current.control;return z._options=C,kA(()=>{const A=z._subscribe({formState:z._proxyFormState,callback:()=>I({...z._formState}),reRenderRoot:!0});return I(O=>({...O,isReady:!0})),z._formState.isReady=!0,A},[z]),u.useEffect(()=>z._disableForm(C.disabled),[z,C.disabled]),u.useEffect(()=>{C.mode&&(z._options.mode=C.mode),C.reValidateMode&&(z._options.reValidateMode=C.reValidateMode)},[z,C.mode,C.reValidateMode]),u.useEffect(()=>{C.errors&&(z._setErrors(C.errors),z._focusError())},[z,C.errors]),u.useEffect(()=>{C.shouldUnregister&&z._subjects.state.next({values:z._getWatch()})},[z,C.shouldUnregister]),u.useEffect(()=>{if(z._proxyFormState.isDirty){const A=z._getDirty();A!==P.isDirty&&z._subjects.state.next({isDirty:A})}},[z,P.isDirty]),u.useEffect(()=>{C.values&&!qa(C.values,R.current)?(z._reset(C.values,z._options.resetOptions),R.current=C.values,I(A=>({...A}))):z._resetDefaultValues()},[z,C.values]),u.useEffect(()=>{z._state.mount||(z._setValid(),z._state.mount=!0),z._state.watch&&(z._state.watch=!1,z._subjects.state.next({...z._formState})),z._removeUnmounted()}),S.current.formState=((A,O,N,F=!0)=>{const E={defaultValues:O._defaultValues};for(const B in A)Object.defineProperty(E,B,{get:()=>{const H=B;return O._proxyFormState[H]!==oc&&(O._proxyFormState[H]=!F||oc),A[H]}});return E})(P,z),S.current}({shouldUseNativeValidation:!1}),{handleSubmit:x,formState:v}=y,b=u.useRef(null),w=u.useRef(null),M=u.useRef(null),k=En(async C=>{let S;try{if(S=await Promise.resolve(l?.(C))??!0,S!==!0)return;await Promise.resolve(i?.(C,C===h,C===f)),a?.(C)}catch{}},[i,a,l,h,f]),j=En((C,S)=>{setTimeout(()=>{k(f)},180)},[k]),_=En(()=>{i?.(h,!0,!1),r?.(),a?.(null)},[i,h,r,a]),L=v&&(Object.keys(v.errors).length>0||v.disabled||v.isSubmitted),T=En((C,S)=>{const R=C===h,P={className:S?"defaultOption":"action",type:S?"submit":"button",style:{minWidth:"75px"},onClick:()=>{R?_():S||k(C)}};if(c)return c(C,P,S);const I={className:S?"defaultOption":"action",variant:S?"contained":"outlined",size:"small",disabled:!R&&L,color:"primary",...P};if(S||R){const z=S?b:w;I.touchRippleRef=z,I.onPointerDown=A=>{z.current?.start(A,{center:!1}),A.stopPropagation(),A.preventDefault()}}return s.jsx(zc,{...I,children:s.jsx("div",{style:{paddingTop:"3px"},children:C})},`action:${C}`)},[d,f,h,c,v]),D=u.useMemo(()=>{const C=[];for(let S=0;S<d.length;S++){const R=d[S],P=f?R===f:S===0;C.push(T(R,P))}return C},[d,f,v]);return s.jsx(Lv,{onCancel:_,initialPosition:{y:SA==="touch"?"15":"35"},onDone:a,autoFocusSel:p,isModal:!0,ref:t,PaperProps:{},...m,children:s.jsx(CA,{...y,children:s.jsxs("form",{ref:M,onSubmit:x(j),children:[s.jsx(Ex,{dividers:!0,onKeyDown:C=>{if(C.isDefaultPrevented())return;C.stopPropagation();let S=null,R=null;const P=C.which===xr.Escape&&h;if(P)S=h,R=w;else{if(L)return;C.which===xr.Enter&&(S=f??d[0],R=b)}S&&(R.current?.start(C,{center:!1}),setTimeout(()=>{R.current?.stop(C),P&&k(S)},180))},children:s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:C=>C.spacing(o||n?1.5:0)},children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column"},children:[o,n]}),g]})}),s.jsx(JT,{sx:{paddingTop:C=>C.spacing(1),paddingBottom:C=>C.spacing(1),paddingLeft:C=>C.spacing(1),paddingRight:C=>C.spacing(1),backgroundColor:C=>pt(C.palette.action.hover,.03)},children:D})]})})})})),RA=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:Ch,default:Ch},Symbol.toStringTag,{value:"Module"})),IA=u.lazy(()=>Promise.resolve().then(()=>RA)),PA=u.lazy(()=>Promise.resolve().then(()=>require("./5hPVyVAXmITQCRAG.cjs"))),l0=u.memo(u.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return q3(n),s.jsx(br,{ref:t,label:o!==void 0?n?.label():"",shortcut:r!==void 0?r:Array.isArray(n?.shortcut())?n?.shortcut()[0]:n?.shortcut(),description:n?.description(),disabled:o,chips:n?.tags(),componentDisabled:n?.disabled(),...a,children:s.jsx("div",{style:{display:"flex",flex:"1 1 0%"},children:i})})})),Ge=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,label:l,disabled:c=!1,variant:d=Ci.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...g}=e,m=u.useRef(null),y=u.useRef(!1),x=u.useMemo(()=>{const L={onExecute(T,D){o?.onExecute?.(T,D),y.current||(m.current?.start({center:!1}),setTimeout(()=>m.current?.stop({}),180)),y.current=!1},onError(T,D,C){o?.onError(T,D,C)}};return o?.beforeExecute&&(L.beforeExecute=o.beforeExecute),L},[o]),v=q3(n,x),b=u.useCallback(L=>{L.button===0&&L.preventDefault()},[]),w=u.useCallback(L=>{L.button===0&&n?.execute(f,o)},[v,o,f]),M=u.useCallback(L=>{L.keyCode!==xr.Enter&&L.keyCode!==xr.Space||n?.execute(f,o)},[v,o,f]),k=u.useMemo(()=>a||d===Ci.Toolbar||n?.state()?typeof a=="function"?a(n):a:_2,[v,a]),j=u.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:d===Ci.Toolbar?k:s.jsx(E1,{selected:n?.state()??!1,children:k}),touchRippleRef:m,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:w,onKeyDown:M}),[v,o,c,k]);let _;return _=d===Ci.Menuitem?s.jsx(Gr,{...g,chips:n?.tags(),...j,children:l??n?.label(r,i)}):s.jsx(ii,{...g,...j}),(l||n?.label())&&((n.disabled()||c)&&(_=s.jsx("div",{children:_})),_=s.jsx(l0,{command:n,placement:d===Ci.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:_})),_})),OA=u.memo(u.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=_2,label:i,variant:a=Ci.Toolbar,disabled:l=!1,commandHook:c,...d}=e,p=u.useRef(null),f=u.useRef(!1),h=u.useMemo(()=>{const _={onExecute(L,T){c?.onExecute?.(L,T),f.current||(p.current?.start({center:!1}),setTimeout(()=>p.current?.stop({}),180)),f.current=!1},onError(L,T,D){c?.onError(L,T,D)}};return c?.beforeExecute&&(_.beforeExecute=c.beforeExecute),_},[c]),g=q3(n,h),m=()=>n?.state()?.toString()||"0",[y,x]=u.useState(m),v=En(()=>{const _=parseFloat(y);isNaN(_)?x(m()):parseFloat(m())!==_&&n.execute(_,c)},[m,n,y,c]);u.useEffect(()=>{x(m())},[n?.state()]);const b=u.useMemo(()=>typeof r=="function"?r(n):r,[g,r]),w=u.useMemo(()=>i===void 0?n?.label(o):typeof i=="function"?i():i,[g]),M=u.useMemo(()=>s.jsx(Tr,{...d,sx:{paddingTop:"0px",paddingBottom:"0px"},component:"div",disableRipple:!0,onClick:_=>_.stopPropagation(),onMouseDown:_=>{_.button===0&&_.stopPropagation()},onMouseUp:_=>{_.button===0&&_.stopPropagation()},children:s.jsx(Kl,{inputMode:"numeric",disabled:l||!n||n.disabled(),inputProps:{tabIndex:0,name:`input-${n.key()}`,autoComplete:"off",type:"number",maxLength:4},sx:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:_=>`${Math.round(_.typography.fontSize)}px`,width:_=>"3.2em",input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield"},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:y,onFocus:_=>{_.target?.select()},onKeyDown:_=>{if(_.which===xr.Enter)m()!==y&&(_.stopPropagation(),_.preventDefault(),v());else if(_.which===xr.Escape)m()!==y&&(x(m()),setTimeout(()=>{_.target?.select()},0),_.stopPropagation(),_.preventDefault());else{if(_.key.match("[-]")||_.key.match("[0-9.]")&&(y+_.key).length>4)return _.stopPropagation(),void _.preventDefault();if(_.which===xr.Space)return void _.preventDefault()}},onBlur:()=>{v()},onChange:_=>{if(_.target.value.length>4)return _.stopPropagation(),void _.preventDefault();x(_.target.value)}})}),[y,l,n]),k={tabIndex:0,ref:t,icon:b,touchRippleRef:p,disabled:l||!n||n.disabled(),onMouseDown:_=>{_.button===0&&_.preventDefault()},onMouseUp:_=>{_.button!==0||_.isPropagationStopped()||_.isDefaultPrevented()||_.isDefaultPrevented()||(_.preventDefault(),n?.execute(!n?.state?.(),h))},onKeyDown:_=>{_.keyCode!==xr.Enter&&_.keyCode!==xr.Space||n?.execute(!n?.state?.(),h)}};let j;return j=a===Ci.Menuitem?s.jsxs(Gr,{...d,chips:n?.tags(),...k,children:[w,M]}):s.jsx(ii,{...d,...k}),n?.label()&&((n.disabled()||l)&&(j=s.jsx("div",{children:j})),j=s.jsx(l0,{command:n,placement:a===Ci.Toolbar?"bottom-start":"right-start",children:j})),j})),Xn=u.memo(u.forwardRef((e,t)=>{const{variant:n=Ci.Toolbar,quickCommand:o,onQuickClick:r,commands:i,commandState:a,commandHook:l,disabled:c,label:d,icon:p,createPopupPanel:f,tooltip:h,selected:g,scope:m,...y}=e,x=u.useRef(null),v=u.useRef(!1),b=u.useMemo(()=>{const D={onExecute(C,S){l?.onExecute?.(C,S),v.current||(x.current?.start({center:!1}),setTimeout(()=>x.current?.stop({}),180)),v.current=!1},onError(C,S,R){l?.onError(C,S,R)}};return l?.beforeExecute&&(D.beforeExecute=l.beforeExecute),D},[l]),w=K3(i,[o],null,[o]),M=w[0],{label:k,icon:j}=u.useMemo(()=>{let D=null;d&&(D=typeof d=="function"?d(M):d),D||(D=M?.label?.(m));let C=null;return p&&(C=typeof p=="function"?p(M):p),C||(C=M?.icon?.()),{label:D,icon:C}},[w,d,p]),_={disabled:c,scope:m,touchRippleRef:x,onQuickClick:r,tooltip:h,label:k,icon:j};(k||h)&&(_.createTooltip=({children:D},C)=>s.jsx(br,{label:k,description:h,disabled:C,children:D}));const L=En(D=>f?.(D,i),[f,w]),T=En(D=>M?.execute(a,b),[M]);return M?(_.quickButtonProps={},_.quickButtonProps.createTooltip=({children:D,placement:C},S)=>s.jsx(l0,{command:M,placement:C??n===Ci.Toolbar?"bottom-start":"right-start",disabled:S,children:D}),_.disabled=_.disabled??M?.disabled(),r||(_.onQuickClick=T)):o&&(_.onQuickClick=()=>{}),_.selected=g??M?.state(),_.createPopupPanel=L,n===Ci.Toolbar?s.jsx(qi,{...y,..._,ref:t}):s.jsx(k1,{...y,..._,ref:t})}));Xn.displayName="CommandPopupButton";const Xs=e=>{const{command:t,label:n,scope:o,icon:r=s.jsx(R3,{}),sx:i,...a}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:l=>l.typography.subtitle2.fontSize,...i},...a,children:[r?ze(r):null,s.jsx(Tn,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:l=>l.spacing(.25),paddingRight:l=>l.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},M1=u.memo(u.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:l,...c}=e,d=T2(t,()=>({}),[]),[p,f]=u.useState(null),{reference:h}=ha({label:"toolbar",anchor:d.current,parentFloat:i,createPopupPanel:null}),g=u.useCallback(()=>{const _=p;_&&requestAnimationFrame(()=>{d.current?.contains(document.activeElement)&&_.focus()})},[]),m=u.useMemo(()=>({dense:!0,outlined:!1}),[]),y=u.useMemo(()=>{const{commandHook:_,...L}=r||{};return{commandHook:{beforeExecute:(T,D)=>_?.beforeExecute?.(T,D)!==!1&&h.closeAll(),onExecute(T,D){_?.onExecute?.(T,D),g()},onError(T,D,C){_?.onError?.(T,D,C)}},...L}},[h,r]),x=u.useMemo(()=>({...m,...y}),[m,y]),[v,b]=u.useReducer(_=>_+1,0);K3(o,[],{onChange:()=>{b()}});const w=u.useMemo(()=>({commands:o,parentFloat:h,...y}),[v,x,h,r]);let M=0;m.dense||(M+=2),m.outlined&&M++;let k=2;m.dense||(k=4);const j=u.useMemo(()=>a({commands:o,commandButtonProps:x,commandPopupProps:{commands:o,...w,...r}}),[v,x,w,a]);return s.jsx(Aj,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${k}px`,paddingBottom:`${k}px`,paddingLeft:"6px !important",paddingRight:"6px !important",flex:"1 1 0%",alignItems:"center",userSelect:"none",flexGrow:1,display:"flex",overflow:"hidden",...n},ref:d,onFocus:_=>{_.relatedTarget&&!p&&f(_.relatedTarget)},onBlur:_=>{p&&!d?.current?.contains(_.relatedTarget)&&f(null)},onKeyDown:_=>{p&&_.which===xr.Escape&&p.focus()},...c,children:s.jsx("div",{ref:d,style:{flex:"1 1 100%",display:"flex",flexWrap:"wrap",rowGap:`${k}px`,columnGap:`${M}px`,alignItems:"center",maxWidth:"100%"},children:j})})}));M1.displayName="CommandToolbar";const DA=e=>{const{key:t,...n}=e;return s.jsx(Ge,{...n},t)},ca=u.memo(u.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o=DA,scope:r,commands:i,icon:a,quickCommand:l,popupScope:c=l,commandState:d,commandHook:p,disabled:f=!1,...h}=e,g=K3(i,n?[l,...n]:[l]),m=u.useCallback((y,x)=>{const v={variant:Ci.Menuitem,commandHook:p,commandState:d,icon:a,scope:c,disabled:f},b=[];for(let w=0;w<n?.length;w++){const M=n[w];if(M===null||M==="-"){b.push(s.jsx(Ft,{orientation:"horizontal"},`element-${b.length}`));continue}const k=x.getCommand(M),j={key:`${M}-${b.length}`,command:k,...v},_=o(j);_&&b.push(_)}return Bn({...y,children:b})},[f,p,d,c,n,a,o]);return n?s.jsx(Xn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:d,scope:r,quickCommand:l,icon:a,createPopupPanel:m,...h}):o({ref:t,disabled:f,commandHook:p,commandState:d,scope:r,command:g[0],icon:a,...h})}));(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._traverse-ellipsis_14l1h_1{display:inline-block;position:relative}._traverse-ellipsis_14l1h_1 div{position:absolute;border-radius:50%}._traverse-ellipsis_14l1h_1 div:nth-child(1){left:0;animation:_traverse-ellipsis1_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(2){left:0;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(3){left:24px;animation:_traverse-ellipsis2_14l1h_1 .6s infinite}._traverse-ellipsis_14l1h_1 div:nth-child(4){left:48px;animation:_traverse-ellipsis3_14l1h_1 .6s infinite}@keyframes _traverse-ellipsis1_14l1h_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _traverse-ellipsis3_14l1h_1{0%{transform:scale(1)}to{transform:scale(0)}}@keyframes _traverse-ellipsis2_14l1h_1{0%{transform:translate(0)}to{transform:translate(24px)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const Zv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["formatAlignLeftToggle","formatAlignCenterToggle","formatAlignRightToggle","formatAlignJustifyToggle","formatAlignCenterContinuousToggle","formatAlignFillToggle","formatAlignDistributedHorizontalToggle"]),d=u.useMemo(()=>{for(let g=0;g<c.length;g++)if(c[g]?.state())return c[g].key();return c[0]?.key()},[c]),p=u.useMemo(()=>{const g=new Map;return g.set("formatAlignLeftToggle",ze(s.jsx(X6,{}))),g.set("formatAlignCenterToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignRightToggle",ze(s.jsx(cR,{}))),g.set("formatAlignJustifyToggle",ze(s.jsx(xc,{}))),g.set("formatAlignCenterContinuousToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignFillToggle",ze(s.jsx(xc,{}))),g.set("formatAlignDistributedHorizontalToggle",ze(s.jsx(xc,{}))),g},[]),f=u.useMemo(()=>{if(!o)return null;const g={...o};return delete g.beforeExecute,g},[o]),h=u.useCallback((g,m)=>{const y={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...y,command:m.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),s.jsx(Ge,{...y,command:m.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=s.jsxs(Ae,{sx:{className:Eo("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[s.jsx(Ge,{command:m.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(OO,{}))}),s.jsx(Ge,{command:m.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(PO,{}))})]}),b=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:x})]});return Bn({...g,children:b})},[i,o]);return s.jsx(Xn,{ref:t,parentFloat:a,commands:n,commandHook:o,scope:r,createPopupPanel:h,label:"Horizontal Alignment",tooltip:"Configure how text is placed in the horizontal direction of the cell.",quickCommand:d,icon:p.get(d)??s.jsx(X6,{}),...l})})),Xv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatAlignTopToggle","formatAlignMiddleToggle","formatAlignBottomToggle","formatAlignJustifyVerticalToggle","formatAlignDistributedVerticalToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatAlignTopToggle",ze(s.jsx($O,{}))),f.set("formatAlignMiddleToggle",ze(s.jsx(VO,{}))),f.set("formatAlignBottomToggle",ze(s.jsx(U7,{}))),f.set("formatAlignJustifyVerticalToggle",ze(s.jsx(xc,{}))),f.set("formatAlignDistributedVerticalToggle",ze(s.jsx(xc,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatAlignDistributedVerticalToggle"),icon:d.get("formatAlignDistributedVerticalToggle")})]});return Bn({...f,children:m})},[i,o,d]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:p,label:"Vertical Alignment",tooltip:"Configure how text is placed in the vertical direction of the cell.",icon:d.get(c)??ze(s.jsx(U7,{})),...a})})),Yv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatTextOverflowVisibleToggle","formatTextOverflowWrapToggle","formatTextOverflowClipToggle","formatTextOverflowShrinkToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatTextOverflowVisibleToggle",ze(s.jsx(X4,{}))),f.set("formatTextOverflowWrapToggle",ze(s.jsx(jI,{}))),f.set("formatTextOverflowClipToggle",ze(s.jsx(RI,{}))),f.set("formatTextOverflowShrinkToggle",ze(s.jsx(II,{}))),f},[]),p=Te((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...g,command:h.getCommand("formatTextOverflowShrinkToggle"),icon:d.get("formatTextOverflowShrinkToggle")})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,label:"Text Overflow",tooltip:"Configure how text behaves when it doesn't fit within a cell.",createPopupPanel:p,icon:d.get(c)??ze(s.jsx(X4,{})),...a})})),Jv=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatTextRotate0","formatTextRotate315","formatTextRotate45","formatTextRotate90","formatTextRotate270","formatSubscriptToggle","formatTextRotateCustom"]),c=u.useMemo(()=>{const h=l.length;for(let g=0;g<h;g++){const m=l[g];if(m?.state())return m.key()}return l[1]?.key()},[l]),d=u.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ze(s.jsx(ud,{}))),h.set("formatTextRotate315",ze(s.jsx(ud,{}))),h.set("formatTextRotate45",ze(s.jsx($7,{}))),h.set("formatTextRotate90",ze(s.jsx(V7,{}))),h.set("formatTextRotate270",ze(s.jsx(H7,{}))),h.set("formatTextRotateCustom",ze(s.jsx(W7,{}))),h},[]),p=u.useCallback((h,g)=>{const m={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},y=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate0"),icon:ze(s.jsx(NO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate315"),icon:ze(s.jsx(ud,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate45"),icon:ze(s.jsx($7,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate90"),icon:ze(s.jsx(V7,{}))}),s.jsx(Ge,{...m,command:g.getCommand("formatTextRotate270"),icon:ze(s.jsx(H7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(OA,{...m,command:g.getCommand("formatTextRotateCustom"),icon:ze(s.jsx(W7,{})),label:"Custom"})]});return Bn({...h,children:y})},[i,o,r,n]),f=u.useMemo(()=>(n.getCommand("formatTextRotateCustom")?.state()??0)!==0,[l]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,selected:f,label:"Text Orientation",tooltip:"Rotate your text diagonally or vertically. This is a great way to label narrow columns.",createPopupPanel:p,quickCommand:f?"formatTextRotate0":"formatTextRotate315",icon:ze(d.get(c)??s.jsx(ud,{})),...a})}));function $l(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Ja="$$material";var bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},V8,H8,W8={exports:{}},ro={},Qv=(H8||(H8=1,W8.exports=function(){if(V8)return ro;V8=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function m(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type){case n:case r:case o:case c:case d:case h:return y;default:switch(y=y&&y.$$typeof){case a:case l:case f:case p:case i:return y;default:return x}}case t:return x}}}return ro.ContextConsumer=i,ro.ContextProvider=a,ro.Element=e,ro.ForwardRef=l,ro.Fragment=n,ro.Lazy=f,ro.Memo=p,ro.Portal=t,ro.Profiler=r,ro.StrictMode=o,ro.Suspense=c,ro.SuspenseList=d,ro.isContextConsumer=function(y){return m(y)===i},ro.isContextProvider=function(y){return m(y)===a},ro.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},ro.isForwardRef=function(y){return m(y)===l},ro.isFragment=function(y){return m(y)===n},ro.isLazy=function(y){return m(y)===f},ro.isMemo=function(y){return m(y)===p},ro.isPortal=function(y){return m(y)===t},ro.isProfiler=function(y){return m(y)===r},ro.isStrictMode=function(y){return m(y)===o},ro.isSuspense=function(y){return m(y)===c},ro.isSuspenseList=function(y){return m(y)===d},ro.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===r||y===o||y===c||y===d||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===p||y.$$typeof===a||y.$$typeof===i||y.$$typeof===l||y.$$typeof===g||y.getModuleId!==void 0)},ro.typeOf=m,ro}()),W8.exports);function ka(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return!(t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.toStringTag in e||Symbol.iterator in e)}function ew(e){if(X.isValidElement(e)||Qv.isValidElementType(e)||!ka(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=ew(e[n])}),t}function ai(e,t,n={clone:!0}){const o=n.clone?{...e}:e;return ka(e)&&ka(t)&&Object.keys(t).forEach(r=>{X.isValidElement(t[r])||Qv.isValidElementType(t[r])?o[r]=t[r]:ka(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&ka(e[r])?o[r]=ai(e[r],t[r],n):n.clone?o[r]=ka(t[r])?ew(t[r]):t[r]:o[r]=t[r]}),o}function rf(e,t=0,n=1){return function(o,r=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER){return Math.max(r,Math.min(o,i))}(e,t,n)}function nl(e){if(e.type)return e;if(e.charAt(0)==="#")return nl(function(i){i=i.slice(1);const a=new RegExp(`.{1,${i.length>=6?2:1}}`,"g");let l=i.match(a);return l&&l[0].length===1&&(l=l.map(c=>c+c)),l?`rgb${l.length===4?"a":""}(${l.map((c,d)=>d<3?parseInt(c,16):Math.round(parseInt(c,16)/255*1e3)/1e3).join(", ")})`:""}(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error($l(9,e));let o,r=e.substring(t+1,e.length-1);if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error($l(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const ic=(e,t)=>{try{return(n=>{const o=nl(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function R2(e){const{type:t,colorSpace:n}=e;let{values:o}=e;return t.includes("rgb")?o=o.map((r,i)=>i<3?parseInt(r,10):r):t.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),o=t.includes("color")?`${n} ${o.join(" ")}`:`${o.join(", ")}`,`${t}(${o})`}function tw(e){e=nl(e);const{values:t}=e,n=t[0],o=t[1]/100,r=t[2]/100,i=o*Math.min(r,1-r),a=(d,p=(d+n/30)%12)=>r-i*Math.max(Math.min(p-3,9-p,1),-1);let l="rgb";const c=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return e.type==="hsla"&&(l+="a",c.push(t[3])),R2({type:l,values:c})}function kh(e){let t=(e=nl(e)).type==="hsl"||e.type==="hsla"?nl(tw(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function md(e,t,n){try{return function(o,r){return o=nl(o),r=rf(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,R2(o)}(e,t)}catch{return e}}function af(e,t){if(e=nl(e),t=rf(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return R2(e)}function po(e,t,n){try{return af(e,t)}catch{return e}}function lf(e,t){if(e=nl(e),t=rf(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return R2(e)}function ho(e,t,n){try{return lf(e,t)}catch{return e}}function gd(e,t,n){try{return function(o,r=.15){return kh(o)>.5?af(o,r):lf(o,r)}(e,t)}catch{return e}}const Zc={black:"#000",white:"#fff"},AA={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},U8="#d32f2f",q8="#42a5f5",K8="#0288d1";function nw(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Zc.white,default:Zc.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const LA=nw();function ow(){return{text:{primary:Zc.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Zc.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const G8=ow();function Z8(e,t,n,o){const r=o.light||o,i=o.dark||1.5*o;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=lf(e.main,r):t==="dark"&&(e.dark=af(e.main,i)))}function sf(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:o=.2,...r}=e,i=e.primary||function(m="light"){return m==="dark"?{main:"#90caf9",light:"#e3f2fd",dark:q8}:{main:"#1976d2",light:q8,dark:"#1565c0"}}(t),a=e.secondary||function(m="light"){return m==="dark"?{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"}:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"}}(t),l=e.error||function(m="light"){return m==="dark"?{main:"#f44336",light:"#e57373",dark:U8}:{main:U8,light:"#ef5350",dark:"#c62828"}}(t),c=e.info||function(m="light"){return m==="dark"?{main:"#29b6f6",light:"#4fc3f7",dark:K8}:{main:K8,light:"#03a9f4",dark:"#01579b"}}(t),d=e.success||function(m="light"){return m==="dark"?{main:"#66bb6a",light:"#81c784",dark:"#388e3c"}:{main:"#2e7d32",light:"#4caf50",dark:"#1b5e20"}}(t),p=e.warning||function(m="light"){return m==="dark"?{main:"#ffa726",light:"#ffb74d",dark:"#f57c00"}:{main:"#ed6c02",light:"#ff9800",dark:"#e65100"}}(t);function f(m){return function(y,x){const v=kh(y),b=kh(x);return(Math.max(v,b)+.05)/(Math.min(v,b)+.05)}(m,G8.text.primary)>=n?G8.text.primary:LA.text.primary}const h=({color:m,name:y,mainShade:x=500,lightShade:v=300,darkShade:b=700})=>{if(!(m={...m}).main&&m[x]&&(m.main=m[x]),!m.hasOwnProperty("main"))throw new Error($l(11,y?` (${y})`:"",x));if(typeof m.main!="string")throw new Error($l(12,y?` (${y})`:"",JSON.stringify(m.main)));return Z8(m,"light",v,o),Z8(m,"dark",b,o),m.contrastText||(m.contrastText=f(m.main)),m};let g;return t==="light"?g=nw():t==="dark"&&(g=ow()),ai({common:{...Zc},mode:t,primary:h({color:i,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:l,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:c,name:"info"}),success:h({color:d,name:"success"}),grey:AA,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...g},r)}var X8,Y8,Np,J8,Q8,e9={exports:{}};function zA(){if(J8)return Np;J8=1;var e=Y8?X8:(Y8=1,X8="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function t(){}function n(){}return n.resetWarningCache=t,Np=function(){function o(a,l,c,d,p,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}function r(){return o}o.isRequired=o;var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Np}function Xc(){return Q8||(Q8=1,e9.exports=zA()()),e9.exports}function kc(e,t){return t?ai(e,t,{clone:!1}):e}function t9(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(o=>o.startsWith("@container")).sort((o,r)=>{const i=/min-width:\s*([0-9.]+)/;return+(o.match(i)?.[1]||0)-+(r.match(i)?.[1]||0)});return n.length?n.reduce((o,r)=>{const i=t[r];return delete o[r],o[r]=i,o},{...t}):t}const I2={xs:0,sm:600,md:900,lg:1200,xl:1536},n9={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${I2[e]}px)`},FA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:I2[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Ra(e,t,n){const o=e.theme||{};if(Array.isArray(t)){const r=o.breakpoints||n9;return t.reduce((i,a,l)=>(i[r.up(r.keys[l])]=n(t[l]),i),{})}if(typeof t=="object"){const r=o.breakpoints||n9;return Object.keys(t).reduce((i,a)=>{if(l=r.keys,(c=a)==="@"||c.startsWith("@")&&(l.some(d=>c.startsWith(`@${d}`))||c.match(/^@\d/))){const d=function(p,f){const h=f.match(/^@([^/]+)?\/?(.+)?$/);if(!h)return null;const[,g,m]=h,y=Number.isNaN(+g)?g||0:+g;return p.containerQueries(m).up(y)}(o.containerQueries?o:FA,a);d&&(i[d]=n(t[a],a))}else if(Object.keys(r.values||I2).includes(a))i[r.up(a)]=n(t[a],a);else{const d=a;i[d]=t[d]}var l,c;return i},{})}return n(t)}function o9(e,t){return e.reduce((n,o)=>{const r=n[o];return(!r||Object.keys(r).length===0)&&delete n[o],n},t)}function rw(e){if(typeof e!="string")throw new Error($l(7));return e.charAt(0).toUpperCase()+e.slice(1)}function P2(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const o=`vars.${t}`.split(".").reduce((r,i)=>r&&r[i]?r[i]:null,e);if(o!=null)return o}return t.split(".").reduce((o,r)=>o&&o[r]!=null?o[r]:null,e)}function zu(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:P2(e,n)||o,t&&(r=t(r,o,e)),r}function qo(e){const{prop:t,cssProperty:n=e.prop,themeKey:o,transform:r}=e,i=a=>{if(a[t]==null)return null;const l=a[t],c=P2(a.theme,o)||{};return Ra(a,l,d=>{let p=zu(c,r,d);return d===p&&typeof d=="string"&&(p=zu(c,r,`${t}${d==="default"?"":rw(d)}`,d)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const BA={m:"margin",p:"padding"},NA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},r9={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},$A=function(){const e={};return t=>(e[t]===void 0&&(e[t]=(n=>{if(n.length>2){if(!r9[n])return[n];n=r9[n]}const[o,r]=n.split(""),i=BA[o],a=NA[r]||"";return Array.isArray(a)?a.map(l=>i+l):[i+a]})(t)),e[t])}(),iw=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],aw=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function T1(e,t,n,o){const r=P2(e,t,!0)??n;return typeof r=="number"||typeof r=="string"?i=>typeof i=="string"?i:typeof r=="string"?`calc(${i} * ${r})`:r*i:Array.isArray(r)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),l=r[a];return i>=0?l:typeof l=="number"?-l:`-${l}`}:typeof r=="function"?r:()=>{}}function cf(e){return T1(e,"spacing",8)}function _1(e,t){return typeof t=="string"||t==null?t:e(t)}function lw(e,t){const n=cf(e.theme);return Object.keys(e).map(o=>function(r,i,a,l){if(!i.includes(a))return null;const c=function(d,p){return f=>d.reduce((h,g)=>(h[g]=_1(p,f),h),{})}($A(a),l);return Ra(r,r[a],c)}(e,t,o,n)).reduce(kc,{})}function Do(e){return lw(e,iw)}function Ao(e){return lw(e,aw)}Do.propTypes={},Do.filterProps=iw,Ao.propTypes={},Ao.filterProps=aw;const VA={borderRadius:4};function Fu(...e){const t=e.reduce((o,r)=>(r.filterProps.forEach(i=>{o[i]=r}),o),{}),n=o=>Object.keys(o).reduce((r,i)=>t[i]?kc(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function wi(e){return typeof e!="number"?e:`${e}px solid`}function Oi(e,t){return qo({prop:e,themeKey:"borders",transform:t})}const HA=Oi("border",wi),WA=Oi("borderTop",wi),UA=Oi("borderRight",wi),qA=Oi("borderBottom",wi),KA=Oi("borderLeft",wi),GA=Oi("borderColor"),ZA=Oi("borderTopColor"),XA=Oi("borderRightColor"),YA=Oi("borderBottomColor"),JA=Oi("borderLeftColor"),QA=Oi("outline",wi),eL=Oi("outlineColor"),Yd=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=T1(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:_1(t,o)});return Ra(e,e.borderRadius,n)}return null};Yd.propTypes={},Yd.filterProps=["borderRadius"],Fu(HA,WA,UA,qA,KA,GA,ZA,XA,YA,JA,Yd,QA,eL);const Bu=e=>{if(e.gap!==void 0&&e.gap!==null){const t=T1(e.theme,"spacing",8),n=o=>({gap:_1(t,o)});return Ra(e,e.gap,n)}return null};Bu.propTypes={},Bu.filterProps=["gap"];const Nu=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=T1(e.theme,"spacing",8),n=o=>({columnGap:_1(t,o)});return Ra(e,e.columnGap,n)}return null};Nu.propTypes={},Nu.filterProps=["columnGap"];const Jd=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=T1(e.theme,"spacing",8),n=o=>({rowGap:_1(t,o)});return Ra(e,e.rowGap,n)}return null};function Is(e,t){return t==="grey"?t:e}function ti(e){return e<=1&&e!==0?100*e+"%":e}Jd.propTypes={},Jd.filterProps=["rowGap"],Fu(Bu,Nu,Jd,qo({prop:"gridColumn"}),qo({prop:"gridRow"}),qo({prop:"gridAutoFlow"}),qo({prop:"gridAutoColumns"}),qo({prop:"gridAutoRows"}),qo({prop:"gridTemplateColumns"}),qo({prop:"gridTemplateRows"}),qo({prop:"gridTemplateAreas"}),qo({prop:"gridArea"})),Fu(qo({prop:"color",themeKey:"palette",transform:Is}),qo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Is}),qo({prop:"backgroundColor",themeKey:"palette",transform:Is}));const tL=qo({prop:"width",transform:ti}),df=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{const o=e.theme?.breakpoints?.values?.[n]||I2[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ti(n)}};return Ra(e,e.maxWidth,t)}return null};df.filterProps=["maxWidth"];const nL=qo({prop:"minWidth",transform:ti}),oL=qo({prop:"height",transform:ti}),rL=qo({prop:"maxHeight",transform:ti}),iL=qo({prop:"minHeight",transform:ti});qo({prop:"size",cssProperty:"width",transform:ti}),qo({prop:"size",cssProperty:"height",transform:ti}),Fu(tL,df,nL,oL,rL,iL,qo({prop:"boxSizing"}));const O2={border:{themeKey:"borders",transform:wi},borderTop:{themeKey:"borders",transform:wi},borderRight:{themeKey:"borders",transform:wi},borderBottom:{themeKey:"borders",transform:wi},borderLeft:{themeKey:"borders",transform:wi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:wi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Yd},color:{themeKey:"palette",transform:Is},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Is},backgroundColor:{themeKey:"palette",transform:Is},p:{style:Ao},pt:{style:Ao},pr:{style:Ao},pb:{style:Ao},pl:{style:Ao},px:{style:Ao},py:{style:Ao},padding:{style:Ao},paddingTop:{style:Ao},paddingRight:{style:Ao},paddingBottom:{style:Ao},paddingLeft:{style:Ao},paddingX:{style:Ao},paddingY:{style:Ao},paddingInline:{style:Ao},paddingInlineStart:{style:Ao},paddingInlineEnd:{style:Ao},paddingBlock:{style:Ao},paddingBlockStart:{style:Ao},paddingBlockEnd:{style:Ao},m:{style:Do},mt:{style:Do},mr:{style:Do},mb:{style:Do},ml:{style:Do},mx:{style:Do},my:{style:Do},margin:{style:Do},marginTop:{style:Do},marginRight:{style:Do},marginBottom:{style:Do},marginLeft:{style:Do},marginX:{style:Do},marginY:{style:Do},marginInline:{style:Do},marginInlineStart:{style:Do},marginInlineEnd:{style:Do},marginBlock:{style:Do},marginBlockStart:{style:Do},marginBlockEnd:{style:Do},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Bu},rowGap:{style:Jd},columnGap:{style:Nu},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ti},maxWidth:{style:df},minWidth:{transform:ti},height:{transform:ti},maxHeight:{transform:ti},minHeight:{transform:ti},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},s0=function(){function e(t,n,o,r){const i={[t]:n,theme:o},a=r[t];if(!a)return{[t]:n};const{cssProperty:l=t,themeKey:c,transform:d,style:p}=a;if(n==null)return null;if(c==="typography"&&n==="inherit")return{[t]:n};const f=P2(o,c)||{};return p?p(i):Ra(i,n,h=>{let g=zu(f,d,h);return h===g&&typeof h=="string"&&(g=zu(f,d,`${t}${h==="default"?"":rw(h)}`,h)),l===!1?g:{[l]:g}})}return function t(n){const{sx:o,theme:r={},nested:i}=n||{};if(!o)return null;const a=r.unstable_sxConfig??O2;function l(c){let d=c;if(typeof c=="function")d=c(r);else if(typeof c!="object")return c;if(!d)return null;const p=function(g={}){return g.keys?.reduce((m,y)=>(m[g.up(y)]={},m),{})||{}}(r.breakpoints),f=Object.keys(p);let h=p;return Object.keys(d).forEach(g=>{const m=typeof(y=d[g])=="function"?y(r):y;var y;if(m!=null)if(typeof m=="object")if(a[g])h=kc(h,e(g,m,r,a));else{const x=Ra({theme:r},m,v=>({[g]:v}));(function(...v){const b=v.reduce((M,k)=>M.concat(Object.keys(k)),[]),w=new Set(b);return v.every(M=>w.size===Object.keys(M).length)})(x,m)?h[g]=t({sx:m,theme:r,nested:!0}):h=kc(h,x)}else h=kc(h,e(g,m,r,a))}),!i&&r.modularCssLayers?{"@layer sx":t9(r,o9(f,h))}:t9(r,o9(f,h))}return Array.isArray(o)?o.map(l):l(o)}}();function aL(e,t){const n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function sw(e={},...t){const{breakpoints:n={},palette:o={},spacing:r,shape:i={},...a}=e,l=function(d){const{values:p={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:f="px",step:h=5,...g}=d,m=(w=>{const M=Object.keys(w).map(k=>({key:k,val:w[k]}))||[];return M.sort((k,j)=>k.val-j.val),M.reduce((k,j)=>({...k,[j.key]:j.val}),{})})(p),y=Object.keys(m);function x(w){return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f})`}function v(w){return`@media (max-width:${(typeof p[w]=="number"?p[w]:w)-h/100}${f})`}function b(w,M){const k=y.indexOf(M);return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f}) and (max-width:${(k!==-1&&typeof p[y[k]]=="number"?p[y[k]]:M)-h/100}${f})`}return{keys:y,values:m,up:x,down:v,between:b,only:function(w){return y.indexOf(w)+1<y.length?b(w,y[y.indexOf(w)+1]):x(w)},not:function(w){const M=y.indexOf(w);return M===0?x(y[1]):M===y.length-1?v(y[M]):b(w,y[y.indexOf(w)+1]).replace("@media","@media not all and")},unit:f,...g}}(n);let c=ai({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:function(d=8,p=cf({spacing:d})){if(d.mui)return d;const f=(...h)=>(h.length===0?[1]:h).map(g=>{const m=p(g);return typeof m=="number"?`${m}px`:m}).join(" ");return f.mui=!0,f}(r),shape:{...VA,...i}},a);return c=function(d){const p=(m,y)=>m.replace("@media",y?`@container ${y}`:"@container");function f(m,y){m.up=(...x)=>p(d.breakpoints.up(...x),y),m.down=(...x)=>p(d.breakpoints.down(...x),y),m.between=(...x)=>p(d.breakpoints.between(...x),y),m.only=(...x)=>p(d.breakpoints.only(...x),y),m.not=(...x)=>{const v=p(d.breakpoints.not(...x),y);return v.includes("not all and")?v.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):v}}const h={},g=m=>(f(h,m),h);return f(g),{...d,containerQueries:g}}(c),c.applyStyles=aL,c=t.reduce((d,p)=>ai(d,p),c),c.unstable_sxConfig={...O2,...a?.unstable_sxConfig},c.unstable_sx=function(d){return s0({sx:d,theme:this})},c}s0.filterProps=["sx"];const i9=(e,t,n,o=[])=>{let r=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(r)?r[Number(i)]=n:r&&typeof r=="object"&&(r[i]=n):r&&typeof r=="object"&&(r[i]||(r[i]=o.includes(i)?[]:{}),r=r[i])})};function $p(e,t){const{prefix:n,shouldSkipGeneratingVar:o}=t||{},r={},i={},a={};var l,c;return l=(d,p,f)=>{if(!(typeof p!="string"&&typeof p!="number"||o&&o(d,p))){const m=`--${n?`${n}-`:""}${d.join("-")}`,y=(h=d,typeof(g=p)=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(x=>h.includes(x))||h[h.length-1].toLowerCase().includes("opacity")?g:`${g}px`:g);Object.assign(r,{[m]:y}),i9(i,d,`var(${m})`,f),i9(a,d,`var(${m}, ${y})`,f)}var h,g},c=d=>d[0]==="vars",function d(p,f=[],h=[]){Object.entries(p).forEach(([g,m])=>{(!c||c&&!c([...f,g]))&&m!=null&&(typeof m=="object"&&Object.keys(m).length>0?d(m,[...f,g],Array.isArray(m)?[...h,g]:h):l([...f,g],m,h))})}(e),{css:r,vars:i,varsWithDefaults:a}}function lL(e){const t={};return Object.entries(e).forEach(n=>{const[o,r]=n;typeof r=="object"&&(t[o]=`${r.fontStyle?`${r.fontStyle} `:""}${r.fontVariant?`${r.fontVariant} `:""}${r.fontWeight?`${r.fontWeight} `:""}${r.fontStretch?`${r.fontStretch} `:""}${r.fontSize||""}${r.lineHeight?`/${r.lineHeight} `:""}${r.fontFamily||""}`)}),t}const a9={textTransform:"uppercase"},l9='"Roboto", "Helvetica", "Arial", sans-serif';function cw(e,t){const{fontFamily:n=l9,fontSize:o=14,fontWeightLight:r=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:d,pxToRem:p,...f}=typeof t=="function"?t(e):t,h=o/14,g=p||(x=>x/c*h+"rem"),m=(x,v,b,w,M)=>{return{fontFamily:n,fontWeight:x,fontSize:g(v),lineHeight:b,...n===l9?{letterSpacing:(k=w/v,Math.round(1e5*k)/1e5+"em")}:{},...M,...d};var k},y={h1:m(r,96,1.167,-1.5),h2:m(r,60,1.2,-.5),h3:m(i,48,1.167,0),h4:m(i,34,1.235,.25),h5:m(i,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(i,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(i,16,1.5,.15),body2:m(i,14,1.43,.15),button:m(a,14,1.75,.4,a9),caption:m(i,12,1.66,.4),overline:m(i,12,2.66,1,a9),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ai({htmlFontSize:c,pxToRem:g,fontFamily:n,fontSize:o,fontWeightLight:r,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:l,...y},f,{clone:!1})}function ko(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const sL=["none",ko(0,2,1,-1,0,1,1,0,0,1,3,0),ko(0,3,1,-2,0,2,2,0,0,1,5,0),ko(0,3,3,-2,0,3,4,0,0,1,8,0),ko(0,2,4,-1,0,4,5,0,0,1,10,0),ko(0,3,5,-1,0,5,8,0,0,1,14,0),ko(0,3,5,-1,0,6,10,0,0,1,18,0),ko(0,4,5,-2,0,7,10,1,0,2,16,1),ko(0,5,5,-3,0,8,10,1,0,3,14,2),ko(0,5,6,-3,0,9,12,1,0,3,16,2),ko(0,6,6,-3,0,10,14,1,0,4,18,3),ko(0,6,7,-4,0,11,15,1,0,4,20,3),ko(0,7,8,-4,0,12,17,2,0,5,22,4),ko(0,7,8,-4,0,13,19,2,0,5,24,4),ko(0,7,9,-4,0,14,21,2,0,5,26,4),ko(0,8,9,-5,0,15,22,2,0,6,28,5),ko(0,8,10,-5,0,16,24,2,0,6,30,5),ko(0,8,11,-5,0,17,26,2,0,6,32,5),ko(0,9,11,-5,0,18,28,2,0,7,34,6),ko(0,9,12,-6,0,19,29,2,0,7,36,6),ko(0,10,13,-6,0,20,31,3,0,8,38,7),ko(0,10,13,-6,0,21,33,3,0,8,40,7),ko(0,10,14,-6,0,22,35,3,0,8,42,7),ko(0,11,14,-7,0,23,36,3,0,9,44,8),ko(0,11,15,-7,0,24,38,3,0,9,46,8)],cL={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},dL={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function s9(e){return`${Math.round(e)}ms`}function uL(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function pL(e){const t={...cL,...e.easing},n={...dL,...e.duration};return{getAutoHeightDuration:uL,create:(o=["all"],r={})=>{const{duration:i=n.standard,easing:a=t.easeInOut,delay:l=0,...c}=r;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof i=="string"?i:s9(i)} ${a} ${typeof l=="string"?l:s9(l)}`).join(",")},...e,easing:t,duration:n}}const hL={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function fL(e){return ka(e)||e===void 0||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function dw(e={}){const t={...e};return function n(o){const r=Object.entries(o);for(let i=0;i<r.length;i++){const[a,l]=r[i];!fL(l)||a.startsWith("unstable_")?delete o[a]:ka(l)&&(o[a]={...l},n(o[a]))}}(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
147
147
 
148
148
  const theme = ${JSON.stringify(t,null,2)};
149
149
 
@@ -195,7 +195,7 @@ Please use Chrome or Edge if external copy and paste is required.`,Perms:qp,Perm
195
195
 
196
196
  The formatting is not applied.`,shortcut:{key:"V",modifiers:[$e.Ctrl,$e.Shift]}}),new We("pasteFormats",A,{label:"Paste Formatting",scopedLabels:{paste:"Formatting"},description:`Paste only the formats of the selected cells.
197
197
 
198
- The content is not applied.`}),new We("pasteFormulas",A,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new We("pasteTranspose",A,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new We("pasteLinks",A,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];m.addCommands(O,!0)},[m,f]),u.useEffect(()=>{if(!m)return;const A={disabled:!h.getProtection().isFormatCellsAllowed()};m.getCommand("pasteValues").updateCallback(O=>I.paste({...aF,...O})).update(A),m.getCommand("pasteFormats").updateCallback((O,N)=>I.paste({...lF,description:N.label(),...O})).update(A),m.getCommand("pasteFormulas").updateCallback((O,N)=>I.paste({...sF,description:N.label(),...O})).update(A),m.getCommand("pasteTranspose").updateCallback((O,N)=>I.paste({...cF,description:N.label(),...O})).update(A),m.getCommand("pasteLinks").updateCallback((O,N)=>I.paste({...dF,description:N.label(),...O})).update(A),m.getCommand("cut").update(A),m.getCommand("paste").update(A)},[h,m]);const z=u.useMemo(()=>{if(!C||!T.current)return;const A=C.key;if(A!=="copy"&&A!=="cut"&&A!=="formatPainter")return;const O=T.current.getItem();if(O.getSource()!==h)return;const N=T.current.isCut?.(),F=N?k:M,E=N?w:b,B=O.getCoords(),H=B?[B]:null;return H&&H.length!==0?U=>{const Z=[];for(let G=0;G<H.length;G++){const V=H[G],le=U.toClipBounds(U.getRangeCoordsBounds(V,{top:0,left:0,right:1,bottom:1}),Rr);le&&(Z.push(L({range:V,key:`copy-selection-background-${G}`,x:le.x,y:le.y,width:Math.max(le.width,0),height:Math.max(le.height,0),stroke:F,strokeWidth:2})),Z.push(L({range:V,key:`copy-selection-foreground-${G}`,x:le.x+(le.width<=2?-1:0),y:le.y,width:Math.max(le.width,3),height:Math.max(le.height,3),stroke:E,strokeWidth:2,isAnimatedStroke:!0})))}return Z}:null},[C,h,g,b,M,w,k]);return{...I,clipboard:P,overlays:z}})({element:o,sheet:r,sheetView:d,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:l});return cn(r?.getSelection(),{onChange(f){}}),u.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),pF={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},hF={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},fF={key:"dragCopy",description:"Drag selection to copy cell contents."},mF={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},fg=(e,t)=>t.ctrlKey&&t.shiftKey?mF:t.ctrlKey?fF:t.shiftKey?hF:pF,gF={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},yF=u.memo(u.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:a,onShowTooltip:l,onCloseTooltip:c,sheet:d,gridRef:p,gridStyle:f,isActive:h,editingCoords:g,...m}=e,y=n?.getBounds(),x=Te(l,[l]),v=Te(c,[c]),[b,w]=u.useState(()=>d?.getSelection().getCoords()),M=Te(Q=>{Go.isEqualSelectionCoords(Q,b)||d&&d.getSelection().updateCoords(Q)},[d,b]),k=Wi(),j=u.useRef(null),[_,L]=u.useState(d?.getProtection().isLocked()),[T,D]=u.useState(d?.getView().getMovableSelection().length>0),C=jn.detectIt().primaryInput==="touch",S=!C&&h,R=g!==null||T,P=Te(Q=>{const xe=Go.cellToRange(Q);if(d.isClosed())return xe;const be=d.getRange(xe,{excludeHidden:!0}).getMerges();return be.length===0?xe:be[0]},[d]),I=Te((Q,xe,be,Fe,ee,ae)=>{const we=d.getSelectedRange().getExtended(Fe,Q).getCoords();switch(Fe){case $.IRange.Direction.Up:return we.rowStart;case $.IRange.Direction.Down:return we.rowEnd;case $.IRange.Direction.Left:return we.colStart;case $.IRange.Direction.Right:return we.colEnd}},[d]),z=Te(()=>{const Q=d.getUsedRange()?.getCoords(),xe=d.getRowHeaders().getUsedRange()?.getCoords(),be=d.getColumnHeaders().getUsedRange()?.getCoords();return{...Q,colEnd:Math.max(Q?.colEnd??0,be?.max??0),rowEnd:Math.max(Q?.rowEnd??0,xe?.max??0)}},[d]),A=Te((Q,xe)=>d.getRowHeaders().hiddenHeadersAt(Q,xe),[d]),O=Te((Q,xe)=>d.getColumnHeaders().hiddenHeadersAt(Q,xe),[d]),N=Te(Q=>d.getRange(Q,{excludeHidden:!0}).getMerges(),[d]),F=Te(Q=>{d?.getSelection().setAdjusting(Q)},[d]),E=Te(async()=>{d?.getSelection().setAdjusting(null),k.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),k.setMode(null))},[k,b,d,o]),B=u.useMemo(()=>{const Q=k.getMode();return Q?.key==="cut"||Q?.key==="copy"},[k]);cn(d?.getView(),{onMovableSelectionChange:()=>{D(d.getView().getMovableSelection().length>0)}}),cn(d?.getSelection(),{onChange(Q){const xe=d.getSelection().getCoords();w(xe)}}),cn(d,{onProtectionChange:()=>{L(d.getProtection().isLocked())}});const{body:H={}}=f||{},U=n.getLayout(),Z=!(S&&b.ranges.length<=1&&g===null&&!_&&(!k.getMode()||B)),{overlay:G,onPointerDown:V}=Ww({gridRef:p,commands:o,layout:U,getCellCoordsAsRangeCoords:P,selection:b,fillHandleBorderColor:H.fill,selectionBackgroundColor:h?f.selection.fill:f.selectionInactive.fill,selectionBorderColor:h?f.selection.strokeFill:f.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?f.selectionRemove.fill:f.selectionInactive.fill,selectionRemoveBorderColor:h?f.selectionRemove.strokeFill:f.selectionInactive.strokeFill,disableFillDrag:Z,disableMoveDrag:C||!(h&&b.ranges.length<=1&&g===null&&!_),disableTouchSelection:R,onSelectionChange:M,onSelectionDragStart:F,onSelectionDragEnd:E,onMoveDragStart:(Q,xe,be)=>{k.setMode(fg(0,be))},onMoveDragUpdate:(Q,xe,be)=>{k.setMode(fg(0,be))},onMoveDragEnd:(Q,xe)=>{k.setMode(null)},onMoveDragDone:async(Q,xe,be)=>{if(Go.isEqualRanges(Q,xe))return;const Fe=d.getRange(xe);if(a?.showOptions){const J=Fe.getDifferences(Q);let ce=!1;for(let ne=0;!ce&&ne<J.getCount();ne++)ce=J.at(ne).isContentful();if(ce&&await a?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ee=!be.ctrlKey,ae=be.shiftKey,we=ae?ee?"Insert Moved Cells":"Insert Copied Cells":ee?"Move Cells":"Copy Cells",se=await a?.showBusy?.(we);try{const J=d.getRange(Q);await Fe.doBatch(async()=>{ae?await Fe.insertFrom(Q,{isCut:ee,undoRange:J}):await Fe.copyFrom(Q,{isCut:ee,undoRange:J}),J.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0}),Fe.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0})},{description:we,autoSelect:!0})}catch(J){a?.showError?.(J)}finally{se?.()}},contentfulCellFinder:I,hiddenRowsAt:A,hiddenColumnsAt:O,mergedRanges:N,getDataCoords:z,canSelectionSpanMergedCells:Q=>{const xe=d.getRange(Q);return xe.isEntireColumns()||xe.isEntireRows()},onFill:async(Q,xe)=>{const be="Auto Fill",Fe=await a?.showBusy?.(be);try{await d.doBatch(()=>{d.getRange(Q).autoFill(xe),d.getRange(xe).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:be,autoSelect:!0})}catch(ee){a?.showError?.(ee)}finally{j.current=null,Fe?.()}},onFillPreview:(Q,xe,be)=>{if(p.current&&x){k.setMode(gF);try{j.current?.direction!==be&&(j.current=null,d.getRange(Q).autoFill(xe,{previewOnly:ne=>{j.current={callback:ne,direction:be}}}));const Fe=j.current?.callback?.(xe);if(!Fe||Fe.isEmpty())return;const ee=Fe.toText();if(!ee)return;const ae=Go.cellToRange(Fe.getCoords()),we=n.getRelativePointFromClient(0,0);let se=0,J=0,ce=mp;if(be===$.IRange.Direction.Down){se=U.getColOffset(ae.colEnd+1)-we.x;const ne=U.getRowOffset(ae.rowEnd),Pe=U.getRowOffset(ae.rowEnd+1);J=Pe-(Pe-ne)/2-we.y,ce=q5}else if(be===$.IRange.Direction.Right){J=U.getRowOffset(ae.rowEnd+1)-we.y;const ne=U.getColOffset(ae.colEnd),Pe=U.getColOffset(ae.colEnd+1);se=Pe-(Pe-ne)/2-we.x,ce=mp}else if(be===$.IRange.Direction.Up){se=U.getColOffset(ae.colEnd+1)-we.x;const ne=U.getRowOffset(ae.rowStart),Pe=U.getRowOffset(ae.rowStart+1);J=Pe-(Pe-ne)/2-we.y,ce=q5}else if(be===$.IRange.Direction.Left){J=U.getRowOffset(ae.rowEnd+1)-we.y;const ne=U.getColOffset(ae.colStart),Pe=U.getColOffset(ae.colStart+1);se=Pe-(Pe-ne)/2-we.x,ce=mp}x({anchor:{x:se,y:J},display:ee,placement:ce})}catch(Fe){a?.showError?.(Fe)}}},onFillDone:()=>{j.current=null,k.setMode(null),v?.()}}),le=Te(Q=>{V(jn.createSyntheticEvent(Q))},[V,g]);u.useEffect(()=>{const Q=n?.getStage();if(Q)return Q.addEventListener("pointerdown",le),()=>{Q.removeEventListener("pointerdown",le)}},[n?.getStage()]);const re=ir(t,()=>({}),[]),ge=u.useRef(null);return s.jsx("div",{className:Zr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:y?.width,height:y?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:c0([re,ge]),...m,children:G(n)})})),kd=Object.freeze({x:0,y:0,width:0,height:0}),xF={fireOnModelChange:!1},bF=u.memo(u.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:a,onHide:l,onShow:c,onUnFocus:d,isDragging:p,updateFrameBounds:f,dragStart:h,style:g,disabled:m,renderMovable:y,...x}=e,[v,b]=u.useState(kd),[w,M]=u.useState(null),[k,j]=u.useState(!1),_=u.useRef(null);u.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const D=o.toViewBounds(T);b(D??kd),f(D??kd)},[o?.getBounds()]),cn(r,{onBoundsChange:T=>{const D=T.getBounds();if(!D)return;const C=o.toViewBounds(D);b(C??kd),f(C)},onSelectionChange:()=>{const T=Gt.hasFocus(_.current,!0);!k&&!T||r.isSelected()||d()}}),cn(r,{onRequestFocus:()=>Gt.whenFocus(_.current,!0)},xF),u.useEffect(()=>{const T=_.current;return i(T),()=>{a(T)}},[]);const L=u.useMemo(()=>{if(!v)return null;let{width:T,height:D}=v;return y({view:o,movable:r,disabled:m,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:D},onHide:l,onShow:c})},[o,r,v.width,v.height,m,p]);return s.jsx("div",{className:"movable",tabIndex:0,ref:c0([_,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...g},onMouseDown:async T=>{const D=T.shiftKey||T.ctrlKey,C=r.isSelected(),S=T.currentTarget;D&&C?r.unselect():(C&&!D||await r.select({addToSelection:D}),h(T.nativeEvent,S),S.focus())},onFocus:T=>{T.relatedTarget&&!w&&M(T.relatedTarget),j(!0)},onBlur:T=>{w&&!_?.current?.contains(T.relatedTarget)&&M(null),T.relatedTarget&&j(!1)},...x,children:L})})),vF=u.memo(u.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:a,onUnFocus:l,onFocus:c,disabled:d=!1,disableDrag:p=!1,disableResize:f=!1,className:h,style:g,renderDirections:m=["nw","n","ne","w","e","sw","s","se"],onFirstRender:y,...x}=e,v=n.getBounds(),b=Te(y,[y]),w=Te(l,[l]),M=Te(c,[c]),[k,j]=u.useState([]),[_,L]=u.useState(!1),[T,D]=u.useState(!1),C=u.useRef(!0),S=u.useRef(new Map),R=u.useRef(new Map),P=u.useRef(new Map),I=u.useRef(new Map),z=u.useRef(new Map),A=u.useRef({onRequestFocus:ke=>(be(ke),null)}),O=u.useRef(null),N=u.useRef(null),F=u.useRef(null),[E,B]=u.useReducer(ke=>ke+1,0);u.useLayoutEffect(()=>{B()},[n,o]),cn(o,{onCollectionChange:()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),_e=z.current;_e.forEach(Be=>{Be()}),_e.clear();const Xe=A.current;for(let Be=0;Be<ke.length;Be++){const ct=ke[Be];if(ct.isClosed())continue;const et=ct.addListeners(Xe);_e.set(ct,et)}B()},onInvalidated:()=>{B()}}),cn(r,{onMovableSelectionChange(ke){U(),B()}});const H=u.useCallback((ke,_e)=>{const Xe=P.current.get(ke);F.current&&(F.current.getTargets().forEach(Be=>{if(Be===Xe)return Be.style.left=_e.x+"px",Be.style.top=_e.y+"px",Be.style.width=_e.width+"px",void(Be.style.height=_e.height+"px")}),F.current.updateRect())},[]),U=()=>{const ke=[],_e=r.getMovableSelection();_e.forEach(Xe=>{const Be=P.current.get(Xe);Be&&_e.indexOf(Xe)!==-1&&ke.push(Be)}),j(Xe=>Gt.isEqualArrays(Xe,ke)?Xe:ke)},Z=u.useRef(null),G=u.useMemo(()=>new Promise(ke=>{Z.current=ke}),[]),V=u.useRef(null),le=Te(async(ke,_e)=>{V.current=_e,await(async()=>!(!await G.then()||!F.current))()&&V.current===_e&&F.current.dragStart(ke,_e)},[k]),[re,ge]=u.useState(!1),Q=u.useRef(null),xe=u.useRef(null),be=Te(async(ke=null)=>{if(ke||(ke=r.getMovableSelection()[0]),!ke)return w?.(),!1;const _e=P.current.get(ke);_e?(await Gt.whenFocus(_e),_e.focus(),xe.current=_e,Q.current=null):Q.current=ke},[r]);u.useEffect(()=>{re&&k.length>0&&xe.current!==k[0]&&be(),C.current&&(b?.(),C.current=!1)},[k]);const Fe=u.useMemo(()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ke.length===0&&S.current.size===0)return null;const _e=(he,Ye,Se,Ie=!0)=>{const de=he.isSelected(),Oe={tabIndex:Se,view:n,movable:he,onRefLoad:Le=>{Q.current===he&&(Le.focus(),xe.current=Le,Q.current=null),P.current.set(he,Le),R.current.set(Le,he),Ye.rendered=!0,U()},onRefUnload:Le=>{P.current.delete(he),R.current.delete(Le),Ye.rendered=!1,U()},onUnFocus:w,onHide:Le=>{Ye.onHide=Le},onShow:Le=>{Ye.onShow=Le},isDragging:de&&(T||_),disabled:d,renderMovable:i,updateFrameBounds:Le=>{H(he,Le)},dragStart:le,onMouseUp:()=>{if(V.current=null,N.current){L(!1),D(!1);let Le=!1;I.current?.forEach(je=>{Gt.isEqualBounds(je.movable.getBounds(),je.startBounds)||(Le=!0)}),Le?ae():we()}},style:{opacity:Ie?_&&de?.7:void 0:0,zIndex:_&&de?he.getZIndex()+ke.length:void 0,pointerEvents:Ie?void 0:"none",cursor:T&&de?"grabbing":d||p?"initial":"move",boxShadow:!de||T&&!_?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(bF,{...Oe},`movable-${he.getUUID()}`)},Xe=S.current,Be=new Map,ct=[];for(let he=0;he<ke.length;he++){const Ye=ke[he];if(Ye.isClosed())continue;let Se=Xe.get(Ye);Se||(Se={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Ie,de)=>{if(!de||de.shown===!0)return;de.shown=!0;const Oe=++de.visibilityRequestId;requestAnimationFrame(()=>{const Le=S.current.get(Ie);Le&&Oe===de.visibilityRequestId&&(de.onShow?.(Ie),Le.shown=!0)})},doHide:async(Ie,de)=>{if(!de||de?.shown===!1)return;de.shown=!1;const Oe=++de.visibilityRequestId,Le=await Promise.resolve(de.onHide?.(Ie));Oe===de.visibilityRequestId&&Le!==!1&&(de.shown=!1,S.current.delete(Ie),B())},visibilityRequestId:0}),Se.frame=_e(Ye,Se,he,!0),ct.push(Se.frame),Se.doShow(Ye,Se),Xe.delete(Ye),Be.set(Ye,Se)}const et=[];return r.getMovableSelection().forEach(he=>{const Ye=Xe.get(he);Ye&&(Ye.frame=_e(he,Ye,-1,!1),et.push(Ye.frame),Xe.delete(he),Be.set(he,Ye))}),Xe.forEach((he,Ye)=>{he.frame=_e(Ye,he,-1,!1),et.push(he.frame),he.doHide(Ye,he),Xe.delete(Ye),Be.set(Ye,he)}),S.current=Be,U(),[...et,...ct]},[E,n,i,d,p,f,_,T]),ee=Te((ke,_e)=>{const Xe=`${_e} ${k.length===1?$.TextUtils.capitalize(R.current?.get(k[0]).getContent().getType()):"Drawings"}`;N.current&&(console.warn(`Transaction ${N.current.getDescription()} is being replaced by ${Xe}`),N.current.rollback(),N.current=null),N.current=a.beginCommit({description:Xe}),I.current.clear();for(let Be=0;Be<k.length;Be++){const ct=k[Be],et=R.current?.get(ct);et?I.current.set(ct,{movable:et,startBounds:n.toViewBounds(et.getBounds())}):console.warn("invalid element",et)}},[a,n,k]),ae=u.useCallback(()=>{if(!N.current)return;const ke=[];I.current?.forEach(_e=>{ke.push(_e.movable)}),N.current.commit({viewAfter:{view:r,movableSelection:ke}}),I.current.clear(),N.current=null},[]),we=u.useCallback(()=>{N.current&&(N.current.rollback(),N.current=null)},[]),se=u.useRef(null);u.useEffect(()=>{se.current&&(se.current.onscroll=ke=>{ke.preventDefault(),ke.srcElement.scrollTop=0,ke.srcElement.scrollLeft=0})},[se.current]);const J=ir(t,()=>({isMovableArea:()=>!0,focusMovable:be,focus:()=>{be()}}),[r]),[ce,ne]=u.useState(null),Pe=u.useRef(!1),Ee=u.useRef(!1),it=u.useRef(!1);u.useEffect(()=>{if(d||k.length===0||it.current||Pe.current)return;if(Ee.current)return void requestAnimationFrame(()=>{F.current&&O.current&&F.current.refTargets.length>0&&(it.current=!0,Z.current?.(!0)),j([...k])});Pe.current=!0;const ke=u.lazy(async()=>{try{const _e=await Promise.resolve().then(()=>require("./oNi7wirDlZ81Lm0Z.cjs"));return Pe.current=!1,Ee.current=!0,j([...k]),_e}catch(_e){return console.warn(_e),Z.current?.(!1),null}});ne(ke)},[k,d,p,f]);const Ue=u.useMemo(()=>!ce||d?null:s.jsx(u.Suspense,{children:s.jsx(ce,{className:Zr({dragging:_||T,resizing:_,moving:T}),container:null,ref:F,target:F.current?k:[],draggable:!d&&!p,resizable:!d&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:ke=>{ee(ke.target,"Resize")},onResize:ke=>{if(!N.current)return ke.stopDrag(),void B();L(!0);const _e=ke.direction[0]!==0&&ke.direction[1]!==0;let Xe=0,Be=0;for(let ct=0;ct<k.length;ct++){const et=k[ct],he=I.current.get(et),Ye=R.current.get(et);if(!he||!Ye){console.warn("invalid element");continue}let Se=ke.dist[0],Ie=ke.dist[1],de=ke.drag.dist[0],Oe=ke.drag.dist[1],Le=he.startBounds.width,je=he.startBounds.height;ct===0?(Xe=Le,Be=je):(Se*=Le/Xe,de*=Le/Xe,Ie*=je/Be,Oe*=je/Be);const K={...he.startBounds};if(K.width=Math.max(0,Le+Se),K.height=Math.max(0,je+Ie),ke.direction[0]===-1&&(K.width=Math.max(0,Math.min(he.startBounds.x+Le,Le-de))),ke.direction[1]===-1&&(K.height=Math.max(0,Math.min(he.startBounds.y+je,je-Oe))),_e&&(Ye.isLockAspectRatio()||ke.inputEvent?.shiftKey)){const W=Le/je,te=K.width/K.height;te>W?K.height=K.width/W:te<W&&(K.width=K.height*W)}ke.direction[0]===-1&&(K.x=Math.max(0,Math.min(he.startBounds.x+Le,he.startBounds.x+Le-K.width))),ke.direction[1]===-1&&(K.y=Math.min(he.startBounds.y+je,he.startBounds.y+je-K.height)),he.movable.setBounds(n.toAbsoluteBounds(K))}},onResizeEnd:ke=>{L(!1),ae()},onDragStart:ke=>{ee(ke.target,"Move")},onDrag:ke=>{if(!N.current)return ke.stopDrag(),void B();D(!0);for(let _e=0;_e<k.length;_e++){const Xe=k[_e],Be=I.current.get(Xe);Be?Be.movable.setBounds(n.toAbsoluteBounds({...Be.startBounds,x:Be.startBounds.x+ke.translate[0],y:Be.startBounds.y+ke.translate[1]})):console.warn("invalid element")}},onDragEnd:ke=>{},onMouseUp:ke=>{}})}),[E,ce,k,n,d,p,f,_,T]);return s.jsx("div",{className:Zr(h,"movable-area","_movable-area_314c6_5"),style:{width:v.width,height:v.height,...g,position:"absolute",overflow:"hidden",willChange:"transform"},ref:c0([J,se]),...x,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:v.width,height:v.height},...x,children:s.jsxs("div",{ref:O,style:{position:"absolute",pointerEvents:"auto"},onFocus:ke=>{M?.(),ge(!0)},onBlur:ke=>{ge(!1)},onKeyDownCapture:ke=>{if(ke.isDefaultPrevented())return;const _e=ke.nativeEvent.ctrlKey,Xe=ke.nativeEvent.altKey,Be=ke.nativeEvent.shiftKey;if(ke.which===on.Escape){const Se=r.getMovableSelection();let Ie=[...Se];return k.forEach(de=>{if(Ie.length===0)return;const Oe=R.current.get(de);let Le=Ie.indexOf(Oe);Ie.splice(Le,1)}),Ie.length!==Se.length&&r.selectMovables(Ie),Ie.length===0&&w?.(),void ke.preventDefault()}const ct=.1,et=Se=>{o.updateSelected(Ie=>{Ie.setRotation(Ie.getRotation()+Se)},"Rotate")},he=(Se,Ie=!0)=>{o.updateSelected(de=>{const Oe=de.getBounds();let Le=1+Se;Ie||(Le=1/Le);const je=Math.sqrt(Math.pow(Oe.width,2)+Math.pow(Oe.height,2)),K=Math.atan2(Oe.height,Oe.width),W=Le*je;if(W<10)return;const te=W*Math.cos(K),oe=W*Math.sin(K),ue={x:Oe.x+(Oe.width-te)/2,y:Oe.y+(Oe.height-oe)/2,width:te,height:oe};de.setBounds(ue)},"Resize")},Ye=Se=>{o.updateSelected(Ie=>{const de=Ie.getBounds(),Oe={x:de.x+(Se.x??0),y:de.y+(Se.y??0),width:de.width+(Se.width??0),height:de.height+(Se.height??0)};Ie.setBounds(Oe)},"Nudge")};if(ke.which===on.Delete)o.updateSelected(Se=>{Se.delete()},"Delete"),ke.preventDefault();else if(ke.key==="a"&&_e){const Se=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(Se,!0),ke.preventDefault()}else ke.key==="ArrowLeft"?(Be?he(ct,!1):Xe?et(-10):Ye({x:_e?-10:-1}),ke.preventDefault()):ke.key==="ArrowRight"?(Be?he(ct,!0):Xe?et(10):Ye({x:_e?10:1}),ke.preventDefault()):ke.key==="ArrowUp"?(Be?he(ct,!0):Ye({y:_e?-10:-1}),ke.preventDefault()):ke.key==="ArrowDown"&&(Be?he(ct,!1):Ye({y:_e?10:1}),ke.preventDefault())},children:[Fe,Ue]})})})})),ss=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const a=e[i].getBounds();t=Math.min(a.x,t),n=Math.min(a.y,n),o=Math.max(a.x+a.width,o),r=Math.max(a.y+a.height,r)}return{x:t,y:n,width:o-t,height:r-n}},mg=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let a=0,l=Number.MAX_SAFE_INTEGER,c=0;for(let f=0;f<e.length;f++){const h=e[f],g=h.getBounds();a+=g[i],l=Math.min(g[o],l),c=Math.max(g[o]+g[i],c),n.push({bounds:g,movable:h})}const d=(c-l-a)/(e.length-1);n.sort((f,h)=>{const g=f.bounds[o],m=h.bounds[o];return g!==m?g-m:f.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let f=1;f<n.length-1;f++){const h=n[f-1].bounds,g={...n[f].bounds};g[o]=h[o]+h[i]+d,n[f].bounds=g,p.set(n[f].movable,g)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},wF=u.memo(u.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:a,onHide:l,onShow:c,...d}=e;u.useEffect(()=>{},[r]);const p=ir(t,()=>({isEmptyFrame:()=>!0}),[]),[f,{height:h,width:g}]=Wl();return s.jsx("div",{...d,ref:c0([p,f]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:a?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:r})})})})),SF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:a,target:l,notifier:c,onRepeatCommandChange:d}=e,p=function(h){const{movables:g,movablesView:m,transactional:y,commands:x,target:v,onRepeatCommandChange:b,notifier:w}=h,M=Wi();u.useRef(M.getMode()).current=M.getMode();const k=Te(async(I,z,A=null,O=!0)=>{const N=async()=>{const F=await Promise.resolve(w?.showBusy?.(I.label()));try{await z();const E=A??I?.label?.();if(b){let B=null;I&&E!==!1&&(B=new Tt(I.key(),v,{label:E,description:E},N)),b(B)}F?.(),O&&M.setMode(null)}catch(E){F?.(),w?.showError?.(E)}};await N()},[b,w]),[j,_]=u.useReducer(I=>I+1,0),L=Te((I,z,A)=>{if(!m)return;const O=m.getMovableSelection();if(O.length===0)return;let N="Drawings";if(O.length===1){const E=O[0];N=$.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const F=`${I.label()} ${N}`;k(I,()=>{let E=null;y&&(E=y.beginCommit(F));const B=m.getMovableSelection();if(B.length===0)return;const H=A?.(B);for(let U=0;U<B.length;U++){const Z=B[U];z(Z,H)}E?.commit()})},[m,y]),[T,D]=u.useState(m.getMovableSelection()[0]??null),[C,S]=u.useState(!T||T?.isProtected()),R=u.useMemo(()=>[new We("moveToFront",v,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[$e.Ctrl,$e.Shift]}},function(){L(this,I=>{I.moveToFront()})}),new We("moveForward",v,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[$e.Ctrl]}},function(){L(this,I=>{I.moveForward()})}),new We("moveToBack",v,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[$e.Ctrl,$e.Shift]}},function(){L(this,I=>{I.moveToBack()})}),new We("moveBackward",v,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[$e.Ctrl]}},function(){L(this,I=>{I.moveBackward()})}),new We("toggleLockAspectRatio",v,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){L(this,I=>{I.setLockAspectRatio(!I.isLockAspectRatio())})}),new We("formatAnchorTypeTwoCell",v,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.TwoCell)})}),new We("formatAnchorTypeOneCell",v,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.OneCell)})}),new We("formatAnchorTypeAbsolute",v,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.Absolute)})}),new We("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){L(this,(I,z)=>{I.setBounds({x:z.x})},ss)}),new We("formatDrawAlignCenter",v,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){L(this,(I,z)=>{I.setBounds({x:(z.width-I.getBounds().width)/2+z.x})},ss)}),new We("formatDrawAlignRight",v,{label:"Align Right",description:"Align the selected drawings to the right."},function(){L(this,(I,z)=>{I.setBounds({x:z.width-I.getBounds().width+z.x})},ss)}),new We("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){L(this,(I,z)=>{I.setBounds({y:z.y})},ss)}),new We("formatDrawAlignMiddle",v,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){L(this,(I,z)=>{I.setBounds({y:(z.height-I.getBounds().height)/2+z.y})},ss)}),new We("formatDrawAlignBottom",v,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){L(this,(I,z)=>{I.setBounds({y:z.height-I.getBounds().height+z.y})},ss)}),new We("formatDrawDistributeHorz",v,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){L(this,(I,z)=>{I.setBounds(z.get(I))},I=>mg(I))}),new We("formatDrawDistributeVert",v,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){L(this,(I,z)=>{I.setBounds(z.get(I))},I=>mg(I,!1))}),new We("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new We("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new We("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new We("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new We("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new We("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new We("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[m,T]);u.useEffect(()=>{},[M]);const P=u.useMemo(()=>{let I=null;return I=x?x.createChildGroup(v,"movable",!1):new a0(v,"movable"),I.addCommands(R,!0),I},[x,R]);return cn(T,{onAnyChange:()=>{P.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===$.IAnchored.Type.TwoCell}),P.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===$.IAnchored.Type.OneCell}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),P.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:I=>{S(I.isProtected())},onDelete:()=>{}}),cn(m,{onMovableSelectionChange:()=>{const I=m.getMovableSelection()[0]??null;D(I),S(!I||I.isProtected()),_()}}),cn(g,{onCollectionChange:()=>{_()}}),u.useEffect(()=>{const I={disabled:C};P.getCommand("formatAnchorTypeTwoCell").update(I),P.getCommand("formatAnchorTypeOneCell").update(I),P.getCommand("formatAnchorTypeAbsolute").update(I),P.getCommand("toggleLockAspectRatio").update(I);const z=g.getCount(),A=m.getMovableSelection(),O=C||z<=1||A.length===0;let N={disabled:O},F=N;if(!O&&A.length===1){const H=A[0];H.getZIndex()===0&&(N={disabled:!0}),H.getZIndex()===z-1&&(F={disabled:!0})}P.getCommand("moveToFront").update(F),P.getCommand("moveForward").update(F),P.getCommand("moveToBack").update(N),P.getCommand("moveBackward").update(N);const E={disabled:C||A.length<=1};P.getCommand("formatDrawAlignLeft").update(E),P.getCommand("formatDrawAlignCenter").update(E),P.getCommand("formatDrawAlignRight").update(E),P.getCommand("formatDrawAlignTop").update(E),P.getCommand("formatDrawAlignMiddle").update(E),P.getCommand("formatDrawAlignBottom").update(E),P.getCommand("formatDrawFlipHorz").update(E),P.getCommand("formatDrawFlipVert").update(E),P.getCommand("formatDrawGroup").update(E),P.getCommand("formatDrawUngroup").update(E),P.getCommand("formatDrawSwapShapes").update(E),P.getCommand("formatDrawSwapShapesHorz").update(E),P.getCommand("formatDrawSwapShapesVert").update(E);const B={disabled:C||A.length<=2};P.getCommand("formatDrawDistributeHorz").update(B),P.getCommand("formatDrawDistributeVert").update(B)},[j,C,j]),P}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:d,commands:a,target:l,notifier:c});u.useEffect(()=>{n?.getStage()},[n?.getStage()]);const f=u.useMemo(()=>s.jsx(vF,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,a,p]);return f&&n?f:null})),CF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:l,commands:c,notifier:d=xu}=e,p=Wi(),[f,h]=u.useState(null),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),[w,M]=u.useState(null);u.useLayoutEffect(()=>{if(y===null)return b(null),void M(null);const A=()=>{const O=o.getRange(y).getCell(),N=O.getStyle();let F,E=N.getFill()?.toCSS(r.body.darkMode);E.background!=="none"&&E.background!=="transparent"||(E=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),E.background!=="none"&&E.background!=="transparent"||(E={background:r.body.fill}),b({style:E}),O&&!O.getFormula()&&(F=O?.getRenderHorizontalAlignment()),M(F??"left")};return A(),o.getRange(y).addListener(()=>{A()})},[o,y,r?.body]);const k=Te(()=>{let A=g.editState.dirty??"";if(g.editState.dirty!==void 0){const O=$.TextUtils.clampString(A);try{const N=g.sheet.getRange(g.coords),F=`Typing '${O}' into ${N.toString()}`;return N.setValue(A,{description:F,autoFit:!0}),x(null),m(null),p.setMode(null),l(null),!0}catch(N){throw d.showError(new Error(`Unable to enter '${O}'.`,{cause:N})),N}}},[o,g,d]),j=Te(A=>o.getRange(A).getCell().getExtrusions()??Go.cellToRange(A),[o]);Te(A=>{let O=$.IRange.Orientation.Row,N=!1;A!==$.IRange.Direction.Up&&A!==$.IRange.Direction.Down||(O=$.IRange.Orientation.Column),A!==$.IRange.Direction.Left&&A!==$.IRange.Direction.Up||(N=!0),o.getSelection().traverse(O,N)},[o]);const _=u.useCallback((A,O)=>{if(i)return i(A,O);if(!o)return null;const{ref:N,...F}=A;return s.jsx(Xw,{ref:N,...F,sheet:o,bodyStyle:r?.body,activeCoords:O,commands:c,onChangeEdit:E=>{const B={sheet:o,coords:O,editState:E};p.setMode(H=>({...H,description:B.editState.editMode?"Edit":"Enter",args:{...H?.args,stateAndCoords:B}}))},editState:g.editState})},[o,v,i,g,y]),{overlay:L,startEdit:T,submitEdit:D,cancelEdit:C,onKeyboardEventNative:S,onPointerEventNative:R}=(A=>{const{view:O,canEdit:N=xz,getCellEditor:F,onBeforeStartEdit:E,onStartEdit:B,onSubmitEdit:H,onCancelEdit:U,onDoneEdit:Z,isEditorStartKeyEvent:G=bz,isEditorStartPointerEvent:V=vz,containerProps:le,borderStrokeFill:re,borderStrokeWidth:ge=2,getRangeCoords:Q=null,activeCoords:xe,alignment:be=sc.Left}=A,[Fe,ee]=u.useState(!1),[ae,we]=u.useState(void 0),se=wt((W,te,oe,ue,ie,pe)=>{if(!te)return null;const fe=ie?.(te,W),ye=W.getRangeCoordsBounds(fe),De=W.toClipBounds(ye),Ve=ye,Je=W.getZoom();if(!De)return null;oe&&(oe*=Je),ue&&(ue*=Je);let ot=Ve,tt=!1;if(oe!==void 0){let _t={...fe},Yt=0;for(;!tt&&ot.width<=oe&&Yt<20;){Yt++,Yt>19&&console.warn("max width reached");const Jt=W.getTotalRangeCoords(),Qt=W.getLayout();pe===sc.Left?_t.colEnd+1<Jt.colEnd?_t.colEnd=Qt.getColIndex(ot.x+oe):tt=!0:pe===sc.Right?_t.colStart-1>=0?_t.colStart=Qt.getColIndex(ot.x-(oe-ot.width)):tt=!0:pe===sc.Center&&_t.colEnd+1<Jt.colEnd&&_t.colStart-1>=0?(_t.colStart=Qt.getColIndex(ot.x-(oe-ot.width)/2),_t.colEnd=Qt.getColIndex(ot.x+ot.width+(oe-ot.width)/2)):tt=!0,tt||(ot=W.getRangeCoordsBounds(_t))}}ot.height=Ve.height,ue!==void 0&&(ot.height=Math.max(ue+1,Ve.height));const{width:Lt,height:At}=W.getViewportSize();return{x:ot.x??0,y:ot.y??0,height:Math.min(At-ot.y,ot.height)+1,width:Math.min(Lt-ot.x,ot.width)+1}},[be]),J=wt(N,[N]),ce=u.useCallback(()=>{O?.getStage()?.focus()},[O]),ne=u.useRef(null),Pe=wt(W=>{E?.(W),Ye(),ee(!0),ne.current=null},[E]),Ee=wt(W=>{B?.(W.coords)},[B]),it=wt(W=>{W.isSubmitted||W.isCancelled||(_e.current.isEditorClosed=!0,ce(),W.isCancelled=!0,U?.(W.coords),Ye())},[U]),Ue=wt(W=>{if(W.isSubmitted||W.isCancelled)return!1;try{return ne.current=W.coords,W.isEditorClosing=!0,W.isSubmitted=!0,W.isEditorSubmitted||(W.isEditorSubmitted=!0,W.editorRefs[0]?.submitEdit?.()),W.coords,H?.(W.coords),W.isEditorClosed=!0,ce(),Ye(),!0}catch(te){throw W.isEditorClosing=!1,W.isSubmitted=!1,te}},[H]),ke=wt(W=>{ee(!1),Z?.(W.coords),Ye()},[Z]),_e=u.useRef(null),Xe=u.useRef(null),Be=u.useRef(null),ct=u.useRef([]),[et,he]=u.useReducer(W=>W+1,0),Ye=u.useCallback(W=>{W&&ct.current.push(W),he()},[]),Se=wt(W=>{if(W.defaultPrevented||W.isSynthetic||!O)return;const te=O?.getCellCoordsFromClient(W.clientX,W.clientY);te&&Ye({eventType:"pointer",event:W,coords:te})},[O]),Ie=wt(W=>{const te=W.nativeEvent;Se(te)},[O]),de=wt(W=>{if(W.defaultPrevented||W.isSynthetic||!O?.getStage())return;const te=Xe.current;G(W,te)&&(W.stopPropagation(),W.preventDefault()),W.key,Ye({eventType:"keyboard",event:W,coords:te})},[O]);u.useLayoutEffect(()=>{const W=(ue,ie)=>{const pe=ie?.cell??ue;if(!pe)return null;const fe=pe;if(!J(pe))return null;Pe?.(pe);const ye=Qo.uuidV4();ie=Object.freeze({autoFocus:!0,...ie}),Be.current=pe;const De={coords:fe,startEvent:ie,uuid:ye,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:Ve=>{De.isMounted||(De.isMounted=!0,Ye())},onUnmount:Ve=>{if(De.editorRefs.length===0){const Je=()=>{De.isMounted=!1,Ye()};if(document.activeElement!==document.body)Je();else{const ot=tt=>{tt.defaultPrevented||tt.target!==document.body||de(tt)};window.addEventListener("keydown",ot,!0),O.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",ot),Je()},{once:!0}),ce()}}}};return De};if(ct.current.length<=0&&!_e.current)return;const te=ct.current[0];$9(te),(ue=>{const ie=[],pe=ue?.length??0;for(let fe=0;fe<pe;fe++){const ye=ue[fe];ie.push($9(ye))}})(ct.current),_e.current,_e.current;let oe=_e.current;if(_e.current){if(_e.current.isDone)_e.current=null;else if(_e.current.isSubmitted||_e.current.isCancelled){if(_e.current.isMounted)return;_e.current.isDone||(ke(_e.current),_e.current.isDone=!0)}}if(te){if(te.eventType==="start"){const ue=te,ie=ue.startEvent?.cell??Xe.current;_e.current&&$t.isEqualCells(_e.current.coords,ie)||(_e.current=W(ie,ue.startEvent))}else if(te.eventType==="keyboard"){const ue=te.event;if(_e.current){let ie=!1;switch(ue.which){case 37:case 39:case 38:case 40:case 13:case 9:ie=!0}if(!ie){_e.current.events.push(te);for(let pe=0;pe<_e.current.editorRefsDispatchEditorEvent.length;pe++)_e.current.editorRefsDispatchEditorEvent[pe](te)}}else if(G(ue,te.coords)){const ie=W(Xe.current,void 0);ie&&ie.events.push(te),_e.current=ie}}else if(te.eventType==="pointer"){const ue=te.event;if(_e.current){_e.current.events.push(te);for(let ie=0;ie<_e.current.editorRefsDispatchEditorEvent.length;ie++)_e.current.editorRefsDispatchEditorEvent[ie](te)}else{const ie=te?.coords??Xe.current,pe=V(ue,ie);if(pe){let fe;typeof fe!="boolean"&&(fe=pe);const ye=W(ie,fe);ye&&ye.events.push(te),_e.current=ye}}}else if(te.eventType==="submit"){if(_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;Ue(_e.current)}}else if(te.eventType==="cancel"){if(_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;it(_e.current)}}else if(te.eventType==="coordsChange"){const ue=te;if(Xe.current=ue.activeCoords,_e.current,_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;try{Ue(_e.current)}catch{}}}}ct.current.length>0&&(ct.current.shift(),Ye()),ct.current.length===0&&(!_e.current||_e.current.isEditorClosing||_e.current.isEditorClosed?!_e.current&&oe&&ce():_e.current.isMounted&&!_e.current.isStarted&&(_e.current.isStarted=!0,_e.current.startEvent.autoFocus&&(typeof _e.current.startEvent.autoFocus=="string"?_e.current.editorRefs[0]?.autoFocus(_e.current.startEvent.autoFocus):_e.current.editorRefs[0]?.autoFocus()),Ee?.(_e.current),requestAnimationFrame(()=>{O&&_e.current?.coords&&O.scrollCellCoordsIntoView(_e.current.coords)})))},[et]),u.useEffect(()=>{Be.current=xe;const W=_e.current?.coords;$t.isEqualCells(W,xe)||(_e.current&&(_e.current.isEditorClosing=!0),Ye({eventType:"coordsChange",activeCoords:xe}))},[xe]);const Oe=u.useCallback(W=>{de(W.nativeEvent)},[]),{width:Le=0,height:je=0}=ae??{width:0,height:0},K=wt(F,[F]);return{overlay:wt(W=>{if(!_e.current||_e.current.isEditorClosed)return _e.current,null;_e.current.coords;let te=se(W,_e.current.coords,Le,je,Q,be),oe=!0;te&&te.width!==0&&te.height!==0||(te={x:0,y:0,width:Le,height:Le},oe=!1);const ue=W.getZoom(),ie={containerBounds:{x:0,y:0,width:te.width/ue,height:te.height/ue},setNaturalDimensions:we,zoom:ue};return s.jsx(wz,{session:_e.current,refLatestCoords:Be,handleSubmitEdit:Ue,handleCancelEdit:it,cellBounds:te,borderStrokeWidth:ge,borderStrokeFill:re,isInBounds:oe,getCellEditor:K,propsEditor:ie,alignment:be,...le},"editor:"+_e.current.uuid)},[F,Q,et,Le,je,be,ge,re]),startEdit:u.useCallback(W=>{Ye({eventType:"start",startEvent:W})},[]),submitEdit:u.useCallback(()=>{Ye({eventType:"submit"})},[]),cancelEdit:u.useCallback(()=>{Ye({eventType:"cancel"})},[]),onKeyboardEvent:Oe,onPointerEvent:Ie,onKeyboardEventNative:de,onPointerEventNative:Se,isEditing:Fe}})({view:n,activeCoords:f,getCellEditor:_,canEdit:()=>{const A=o.getProtection();if(A.isReadOnly())return!1;const O=A.isLocked();return O&&a(),!O},onBeforeStartEdit:A=>{const O=Yw(()=>o.getRange(A).getCell()),N={sheet:o,coords:A,editState:Object.freeze(O)};p.setMode({key:"edit",args:{stateAndCoords:N}}),m(N)},onStartEdit:A=>{x(A),l(A)},onSubmitEdit:k,onCancelEdit:A=>{x(null),m(null),p.setMode(null),l(null)},onDoneEdit:A=>{p.setMode(null)},containerProps:v,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:w,getRangeCoords:j});cn(o.getSelection(),{onChange(A){h(o.getSelection().getCoords().cell)}});const P=Te(A=>{R(A),y&&D()},[R,C,y]),I=u.useCallback(A=>{R(A)},[R]),z=u.useCallback(A=>{S(A)},[S]);return u.useEffect(()=>{const A=n?.getStage();if(A)return A.addEventListener("pointerdown",P),A.addEventListener("dblclick",I),A.addEventListener("keydown",z),()=>{A.removeEventListener("pointerdown",P),A.removeEventListener("dblclick",I),A.removeEventListener("keydown",z)}},[n?.getStage()]),u.useEffect(()=>{const A=p.getMode(),O=A?.key;O==="edit"||O==="enter"?g?A.args?.cancel?C():A.args?.submit?D():m(A.args?.stateAndCoords):T(A.args?.start):y&&C()},[p]),L(n,t)})),nS="white",oS="black",kF=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${oS}' fill='${nS}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,EF=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${oS}' fill='${nS}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,MF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=u.useState(o.getTables().getCount()>0),[a,l]=u.useState(null),[c,d]=u.useState(null),[p,f]=u.useState(null),[h,g]=u.useState(null),m=Te(()=>{if(o.getTables().getCount()>0){i(!0);const k=o.getTables().search({address:n.getVisibleRangeCoords()});l(k.length>0?k:null)}else i(!1),l(null)},[o,n]),y=Te(k=>{k.preventDefault(),k.stopPropagation();const j=n.getCellCoordsFromClient(k.clientX,k.clientY),_=o.getTables().search({address:j});_.length===1&&_[0].select()},[n,o]),x=Te(k=>{k.preventDefault(),k.stopPropagation();const j=n.getCellCoordsFromClient(k.clientX,k.clientY),_=o.getTables().search({address:j});if(_.length===1){const L=_[0].getRange().getCoords(),T={colStart:L.colStart,rowStart:j.rowIndex,colEnd:L.colEnd,rowEnd:j.rowIndex};o.getRange(T).select()}},[n,o]),v=Te(()=>{if(!r)return;const k=o.getTables().search({address:n.getVisibleRangeCoords()});l(k.length>0?k:null)},[o,r,n]);cn(o?.getSelection(),{onChange(k){d(o.getSelection().getCoords().cell)}}),cn(p,{onAnyChange(k){m(),v()}}),cn(h,{onAnyChange(k){v()}}),cn(o,{onTablesChange(k){m(),v()},onInvalidated(k){m(),v()}});const b=u.useMemo(()=>Gt.debounce(Gt.throttle(v,300),300),[]);u.useEffect(()=>{b()},[n]),u.useEffect(()=>{let k=null;if(a)for(let j=0;j<a.length&&!k;j++){const _=a[j],L=_.getRange().getCoords();$.CoordUtils.isCellWithinRange(c,L)&&(k=_)}f(k)},[c,a]);const w=Te(k=>{let j=null;if(a)for(let _=0;_<a.length;_++){const L=a[_],T=L.getRange().getCoords();let D=n.getRangeCoordsBounds(T);const C=n.getRelativePointFromClient(k.clientX,k.clientY),S=C.x,R=C.y;if(S>=D.x&&S<=D.x+D.width&&R>=D.y&&R<=D.y+D.height){const P=n.getViewportSize();S<=0||R<=0||S>=P.width||R>=P.height||(j=L)}}g(j)},[n,a]);if(u.useEffect(()=>{const k=n?.getStage();if(k&&a)return k.addEventListener("mousemove",w),k.addEventListener("mouseleave",w),()=>{k.removeEventListener("mousemove",w),k.removeEventListener("mouseleave",w)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const M=[];for(let k=0;k<a.length;k++){const j=a[k];if(j.isClosed())continue;const _=j===h,L=j===p,T=j.getRange().getCoords(),D=n.getRangeCoordsBounds(T);let C;if(_||L){const S=j.getStyle().getProperties(),R=S.headerRow?.fill?.background??S.wholeTable?.border?.top?.color?.toString();if(R&&o){const P=o.getStyles().parseColor(R);P&&(C=P.toCSS())}C||(C="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}M.push(s.jsx("div",{style:{position:"absolute",left:D.x,top:D.y,width:Math.min(16,D.width),height:D.height,pointerEvents:"all",cursor:kF},onMouseDown:x},`table-select-row-${j.getName()}`)),M.push(s.jsx("div",{style:{position:"absolute",left:D.x,top:D.y,width:Math.min(16,D.width),height:Math.min(16,D.height),pointerEvents:"all",cursor:EF},onMouseDown:y},`table-select-${j.getName()}`)),M.push(s.jsx(A2,{x:D.x,y:D.y,width:D.width,height:D.height,range:T,strokeWidth:L?.5:0,stroke:C??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:_?`${C} 0px 0px 1px 1px`:void 0}},`table-outline-${j.getName()}`))}return M})),TF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,a]=u.useState(null),[l,c]=u.useState(null),d=u.useRef(null),p=Te(()=>{const x=o.getSelectedCell(),v=x.getSpill()?.getCoords()??null;Go.isEqualRanges(v,i)||(c(v?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(v),coords:v}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),a(v))},[o,n,i]);u.useEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),l&&(d.current=setTimeout(()=>{c(null),d.current=null},r)),()=>{d.current&&(clearTimeout(d.current),d.current=null)}),[l,r]);const f=u.useMemo(()=>Gt.debounce(Gt.throttle(p,80),80),[]);if(cn(o?.getSelection(),{onChange(x){f()}}),cn(o,{onSpillsChange(x){p()},onInvalidated(x){p()}}),!n||!i&&!l)return null;const h=o.getRange(i).getValue()instanceof $.FormulaError.Spill,g=[];let m=l?.bounds??n.getRangeCoordsBounds(i);if(l&&!Gt.isEqualBounds(l.bounds,n.getRangeCoordsBounds(l.coords))&&c(null),m=n.toClipBounds(m,-10),!m)return;const y="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return g.push(s.jsx(A2,{x:m.x,y:m.y,width:m.width,height:m.height,range:i,strokeWidth:1,stroke:y,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:l?.transition==="out"?0:1,transition:l?.transition?l.transition==="in"||l.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${y} 0px 0px 4px 0px`}},"spill-outline}")),g})),_F={position:"absolute",top:0,left:0,bottom:0,right:0},gg=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},a=n.body=Gt.mergeContentful(e.body,i);return n.body=Gt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=Gt.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=Gt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Gt.mergeContentful(n.header,i),n.headerSelect=Gt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Gt.mergeContentful(n.headerSelect,i),n.headerSelectAll=Gt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Gt.mergeContentful(n.headerSelectAll,i),n},jF={fireOnModelChange:!1},yg={},rS=u.memo(u.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=yg,headersStyle:r=yg,onSheetContextMenu:i,showColumnHeaders:a,columnHeaderProps:l,showRowHeaders:c,rowHeaderProps:d,showScrollbars:p=!0,scrollPaneProps:f,onViewportChange:h,commands:g,onRepeatCommandChange:m,onMoveCell:y,overlays:x,renderMovable:v,viewportComponent:b,onElementLoad:w,getCellEditor:M,onFocus:k,onBlur:j,style:_=jn.EmptyCssProperties,notifier:L,onShowTooltip:T,onShowColumnTooltip:D,onShowRowTooltip:C,onCloseTooltip:S,gridProps:R,cellRenderProps:P,...I}=e;if(u.useEffect(()=>{$.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[z,A]=u.useReducer(Ze=>Ze+1,0),[O,{width:N,height:F}]=Wl(),E=Te(T,[T]),B=Te(D,[D]),H=Te(C,[C]),U=Te(S,[S]),Z=u.useRef(!1);u.useLayoutEffect(()=>{Z.current=!0},[n]);const G=n?.getStyles(),V=u.useMemo(()=>gg(o,G),[o,G]),le=u.useMemo(()=>gg(r,G),[r,G]),{body:re={},buttonSurface:ge={}}=V,{header:Q={},headerSelect:xe={},headerSelectAll:be={}}=le,Fe=u.useRef(null),[ee,ae]=u.useState(()=>n?.getView()),we=(ee?.getZoomScale()??100)/100,se=u.useMemo(()=>({vertical:ee.isShowColumnGridlines()&&we>=.4,horizontal:ee.isShowRowGridlines()&&we>=.4}),[ee?.isShowColumnGridlines(),ee?.isShowRowGridlines(),we]),J=u.useMemo(()=>{if(ee?.getGridLineColor())return{strokeDasharray:"1,1"}},[ee?.getGridLineColor(),V]),ce=a??ee?.isShowColumnHeaders(),ne=c??ee?.isShowRowHeaders(),[Pe,Ee]=u.useState({width:0,height:0}),it=u.useMemo(()=>{let Ze=40,ve=20;const St=n?.getStyles().getNormal().getFont();if(Pe.width>0&&Pe.height>0){const q=St?.toCSS()?.fontFamily??V.header.text.fontFamily,Ce=St?.getSize()??V.header.text.fontSize,Y=$.IFont.getSharedMeasurer()(""+Pe.height,Math.ceil(Ce*$.IFont.getDeviceScale()),q);Ze=Y.width,ve=Y.lineHeight}return{width:Math.round(Ze+5),height:Math.round(ve+3)}},[Pe,V?.header.text,n]),Ue=ne?we*it.width:Q.edgeStrokeWidth,ke=ce?we*it.height:Q.edgeStrokeWidth,_e=Math.max(N,(n?.getColumnHeaders().getDefaultSize()??it.width)+Ue+1),Xe=Math.max(F,(n?.getRowHeaders().getDefaultSize()??it.height)+ke+1),Be=u.useRef(new Map),ct=u.useRef(null),et=()=>({getColOffset:Ze=>n.getColumnHeaders().findOffset(Ze),getColIndex:Ze=>n.getColumnHeaders().findIndex(Ze),getRowOffset:Ze=>n.getRowHeaders().findOffset(Ze),getRowIndex:Ze=>n.getRowHeaders().findIndex(Ze)}),[he,Ye]=u.useState(()=>et()),[Se,Ie]=u.useState(!1),[de,Oe]=u.useState(null),Le=!0,je=V.selection?.strokeFill,K=u.useCallback(()=>pr.current,[]),[W,te]=u.useState(),oe=Te(Ze=>{te(Ze),n&&n.getView()&&n.getView().setTopLeft(Ze?{left:Ze.left,top:Ze.top}:null),h?.(Ze)},[n,h]),ue=u.useRef(null);u.useEffect(()=>{if(!W||!n)return;const Ze=n.getRangeAtBounds({x:W.left,y:W.top,width:W.width,height:W.height});ue.current?.(),ue.current=Ze.addListener(()=>{const ve=Ze.getCoords();Fe?.current?.invalidate(ve)})},[W,n]);const[ie,pe]=u.useState(()=>n?.getView().getTopLeft()),fe=Te(Ze=>{const ve=Go.cellToRange(Ze);if(n.isClosed())return ve;const St=n.getRange(ve,{excludeHidden:!0}).getMerges();return St.length===0?ve:St[0]},[n]),ye=Ze=>{if(!Ze||Ze.coords.colIndex===0&&Ze.coords.rowIndex===0)return null;const ve={};return Ze.coords.colIndex>0&&(ve[zo.Left]={index:Ze.coords.colIndex,scrollOffset:Ze.topLeft.left}),Ze.coords.rowIndex>0&&(ve[zo.Top]={index:Ze.coords.rowIndex,scrollOffset:Ze.topLeft.top}),ve},[De,Ve]=u.useState(()=>ye(n.getView().getFreezePanes())),Je=Wi(),ot=u.useCallback(()=>Fe.current,[]),tt=Te(Ze=>{Je.setMode(ve=>ve?.key==="edit"?{...ve,args:{...ve.args}}:{key:"edit",args:{stateAndCoords:null,start:Ze}})},[]),Lt=Te(()=>W,[W]),At=function(Ze){const{sheet:ve,onRepeatCommandChange:St,bodyStyle:q,commands:Ce,target:Y,notifier:me,onStartEdit:qe,getViewport:mt}=Ze,[Ke,Wt]=u.useState(null),[Mt,Bt]=u.useState(null),Ut=u.useRef(null),mn=Te(qe,[qe]),Vt=Te(mt,[mt]),[Nt,io]=u.useState(),[Ct,ln]=u.useState(()=>ve?.getStyles().parseColor($.IColor.Scheme.Bg2)),[go,pn]=u.useState(()=>ve?.getStyles().getNormal().getFont().getFill()),qt=Wi();u.useRef(qt.getMode()).current=qt.getMode();const vo=hb(),[Bo,Zl]=u.useState(Gt.EmptyArray),Xl=u.useCallback(()=>{if(Ut.current!==ve)return;const Me=ve.getSelectedRanges();let nt=null;Bo.length>0&&Go.isCellWithinRange(Ke,Bo[0].getRange().getCoords())&&(nt=Bo[0]);const dt=ve?.getSelectedCell(),He=dt?.getCoords()??null;yo.unstable_batchedUpdates(()=>{q2(nt),Wt(He),Bt(Me)})},[ve,Bo,Mt,Ke]),U2=u.useCallback(Gt.debounce(Xl,210),[Xl]);u.useEffect(()=>{Ut.current=ve,Xl()},[ve]);const ar=Te(()=>ve.getRange(Ke).getCell(),[ve,Ke]),wo=Te(async(Me,nt,dt=null,He=!1,ht=!0)=>{const bt=Me?.label?.(),bn=async()=>{const hn=await Promise.resolve(ht&&me?.showBusy?.(bt??"Busy..."));try{await ve.doBatch(async()=>nt(ve),bt),He&&qt.setMode(null),hn&&hn()}catch(ao){if(hn&&hn(),!ao)return;me?.showError?.(ao)}},vn=[];let sn=!1;const kn=async()=>(vn.push(bn),(async()=>{if(!sn){for(sn=!0;vn.length>0;){const hn=vn.shift();hn&&await hn()}sn=!1}})());if(St){let hn=null;if(dt!==!1&&Me){const ao=dt??bt;hn=new Tt(Me.key(),Y,{label:ao,description:ao},kn)}St(hn)}return kn()},[ve,St,me]),Xt=Te((Me,nt,dt=!1,He)=>wo(Me,ht=>{const bt=ht.getSelectedRanges();dt&&bt.updateStyle(null,He),bt.updateStyle(nt,He),bt.autoFit({expandOnly:$.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[ve]),Yf=Te((Me,nt,dt)=>{wo(Me,He=>{let ht=nt;(dt||nt?.address)&&(ht=ht??{},!dt&&nt?.address?.startsWith("#")?dt=nt?.address.substring(1):dt&&(ht.displayText=dt)),He.getSelectedRange().setHyperlink(ht)})},[ve]),Jf=Te((Me,nt)=>{wo(Me,dt=>{dt.getSelectedRange().setComments(nt)})},[ve]),p0=Te((Me,nt)=>{wo(Me,dt=>{dt.getSelectedRanges().clear(nt)})},[ve]),il=Te(async(Me,nt,dt=!1,He=!1)=>wo(Me,async ht=>{let bt=ht.getSelectedRanges();dt&&(nt===$.IRange.Orientation.Row?bt=bt.getEntireRows(He):nt===$.IRange.Orientation.Column&&(bt=bt.getEntireColumns(He)));let bn=null;const vn=qt.getMode()?.key;if(vn==="copy"||vn==="cut"){const sn=await vo.getClipboard().readReference();sn&&sn.getItemType()==="range"&&(bn=sn.getItem(),bn.getCoords()||(bn=null))}if(bn){const sn=await bt.insertFrom(bn,{...bn.getMarkOptions(),orientation:nt,autoSelect:!0});!sn||sn.isEntireRows()||sn.isEntireColumns()||sn.autoFit({orientations:$.IRange.Orientations.Row,minContent:!0}),qt.setMode(null)}else bt.insert(nt,{autoSelect:!0})},"Insert Cells",!1),[qt]),[fa,q2]=u.useState(null),NC=Te(Me=>ve.getStyles().setDefaultTableStyle(Me),[ve]),$C=Te(Me=>{ve.getStyles().getTableStyle(Me)?.delete()},[ve]),h0=Te((Me,nt)=>{wo(Me,async dt=>{const He=dt.getSelectedRange(),ht=dt.getSelectedCell().getCoords();let bt=null,bn=0;const vn=ht.rowIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex}).getExtended($.IRange.Direction.Up):null;vn&&dt.getRange({colStart:ht.colIndex,rowStart:vn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:vn.getCoords().rowStart}).isContentful()&&(bt=$.IRange.Direction.Up,bn=ht.rowIndex-vn.getCoords().rowEnd);const sn=ht.colIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex-1}).getExtended($.IRange.Direction.Left):null;if(sn&&dt.getRange({colStart:sn.getCoords().colStart,rowStart:ht.rowIndex,colEnd:sn.getCoords().colStart,rowEnd:ht.rowIndex}).isContentful()){const hn=ht.colIndex-sn.getCoords().colEnd;(hn<bn||!bt)&&(bt=$.IRange.Direction.Left,bn=hn)}let kn=null;if(bt===$.IRange.Direction.Up){if(kn={...vn.getCoords()},(kn.rowEnd===ht.rowIndex||!dt.getRange({colIndex:ht.colIndex,rowIndex:ht.rowIndex-1}).isContentful())&&kn.rowStart>0&&dt.getRange({colIndex:ht.colIndex,rowIndex:kn.rowStart-1}).isContentful()){const hn=vn.getExtended($.IRange.Direction.Up);kn={colStart:ht.colIndex,rowStart:hn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:vn.getCoords().rowEnd}}kn.rowEnd=ht.rowIndex-1}else if(bt===$.IRange.Direction.Left){if(kn={...sn.getCoords()},(kn.colEnd===ht.colIndex||!dt.getRange({colIndex:ht.colIndex-1,rowIndex:ht.rowIndex}).isContentful())&&kn.colStart>0&&dt.getRange({colIndex:kn.colStart-1,rowIndex:ht.rowIndex}).isContentful()){const hn=sn.getExtended($.IRange.Direction.Left);kn={colStart:hn.getCoords().colStart,rowStart:ht.rowIndex,colEnd:hn.getCoords().colEnd,rowEnd:ht.rowIndex}}kn.colEnd=ht.colIndex-1}if(He.size!==1&&bt){const hn=He.getCoords(),ao=He.startIncrementalUpdates({orientation:$.IRange.Orientation.Column}),jo={...kn},wr=hn.rowStart,Ai=hn.rowEnd,Li=hn.colStart,zi=hn.colEnd,Nr=bt===$.IRange.Direction.Up;for(let fr=Li;fr<=zi;fr++){jo.colStart=Nr?fr:kn.colStart+(fr-Li),jo.colEnd=Nr?fr:kn.colEnd+(fr-Li);for(let No=wr;No<=Ai;No++){jo.rowStart=Nr?kn.rowStart+(No-wr):No,jo.rowEnd=Nr?kn.rowEnd+(No-wr):No;const hi=dt.getRange(jo).toString();ao.pushAt(No,fr,`=${nt}(${hi})`)}}ao.apply()}else{const hn=kn?dt.getRange(kn).toString():"",ao=`=${nt}(`;mn?.({text:`${ao}${hn})`,editMode:!0,initialSelection:{start:ao.length,end:ao.length+hn.length}})}},!1)},[ve]),R1=Te((Me,nt,dt=!1,He=!0)=>{wo(Me,async ht=>{let bt=null;if(fa)return void fa.updateStyleOptions(nt);{const sn=ht.getSelectedRanges().getFixed(!0),kn=ht.getSelectedRange().getDefaultSortCriteria();let hn={ranges:sn,hasHeader:kn?.options?.hasHeader??!1};bt=He?new Promise((ao,jo)=>{const wr={tableOptions:hn,onCancel:()=>{jo()},onDone:Ai=>{ao(Ai)},context:{getNames:()=>ht.getNames()}};me.showWindow?.("tableNew",wr)}):{option:"Ok",tableOptions:hn}}const bn=await Promise.resolve(bt);if(bn?.option!=="Ok")throw null;const vn=await Promise.resolve(me?.showBusy?.(Me.label()));try{await ht.getTables().add(bn.tableOptions.ranges.at(0),{styleName:nt?.name,clearFormatting:dt,hasHeader:bn.tableOptions.hasHeader}).getRange().select()}catch(sn){vn(),me?.showError?.(sn)}vn()},!1,!0,!1)},[fa]),Qf=Te(()=>q,[q]),em=Te(Me=>({styles:()=>ve.getStyles(),table:()=>Me,bodyStyle:Qf,getNames:()=>ve.getNames()}),[ve]),VC=Te(async(Me,nt,dt,He=!0)=>{let ht=null;if(!nt){let bt=ve.getSelectedRange();bt.size===1&&(bt=bt.getSurrounding());let bn=ve.getTables().search({address:ve.getSelectedRange()});bn.length>0&&(nt=bn[0]),await bt.select()}if(nt){if(He){try{dt&&await nt.select()}catch{}ht=new Promise(async(bt,bn)=>{Me.update({context:em(nt)});const vn={command:Me,commands:Re,notifier:me,onDone:kn=>{bt(kn)}},sn=await me.showWindow?.("tableDetails",vn,{disableAutoDestroy:!0});setTimeout(()=>{sn.focus()},180)})}Promise.resolve(ht).then(bt=>{},bt=>{me?.showError?.(bt)})}},[me]),tm=Te(async(Me,nt,dt=!1)=>{let He=null;if(nt)nt.isITable?He=nt:nt.getValue()&&(He=nt.getValue());else{const ht=ve.getTables().search({address:ve.getSelectedRange()});ht.length>0&&(He=ht[0])}if(He){if(!dt){const ht=He.getRange().getCoords(),bt=(ht.colEnd-ht.colStart+1)*(ht.rowEnd-ht.rowStart+1);if(bt>1e4&&await me?.showOptions({title:"Confirm",description:`Converting a table to range with '${bt}' cells will set a large number of cell styles and may affect performance.
198
+ The content is not applied.`}),new We("pasteFormulas",A,{label:"Paste Formulas",scopedLabels:{paste:"Formulas"},description:"Paste only the formulas of the selected cells. The values and formatting is not applied."}),new We("pasteTranspose",A,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new We("pasteLinks",A,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];m.addCommands(O,!0)},[m,f]),u.useEffect(()=>{if(!m)return;const A={disabled:!h.getProtection().isFormatCellsAllowed()};m.getCommand("pasteValues").updateCallback(O=>I.paste({...aF,...O})).update(A),m.getCommand("pasteFormats").updateCallback((O,N)=>I.paste({...lF,description:N.label(),...O})).update(A),m.getCommand("pasteFormulas").updateCallback((O,N)=>I.paste({...sF,description:N.label(),...O})).update(A),m.getCommand("pasteTranspose").updateCallback((O,N)=>I.paste({...cF,description:N.label(),...O})).update(A),m.getCommand("pasteLinks").updateCallback((O,N)=>I.paste({...dF,description:N.label(),...O})).update(A),m.getCommand("cut").update(A),m.getCommand("paste").update(A)},[h,m]);const z=u.useMemo(()=>{if(!C||!T.current)return;const A=C.key;if(A!=="copy"&&A!=="cut"&&A!=="formatPainter")return;const O=T.current.getItem();if(O.getSource()!==h)return;const N=T.current.isCut?.(),F=N?k:M,E=N?w:b,B=O.getCoords(),H=B?[B]:null;return H&&H.length!==0?U=>{const Z=[];for(let G=0;G<H.length;G++){const V=H[G],le=U.toClipBounds(U.getRangeCoordsBounds(V,{top:0,left:0,right:1,bottom:1}),Rr);le&&(Z.push(L({range:V,key:`copy-selection-background-${G}`,x:le.x,y:le.y,width:Math.max(le.width,0),height:Math.max(le.height,0),stroke:F,strokeWidth:2})),Z.push(L({range:V,key:`copy-selection-foreground-${G}`,x:le.x+(le.width<=2?-1:0),y:le.y,width:Math.max(le.width,3),height:Math.max(le.height,3),stroke:E,strokeWidth:2,isAnimatedStroke:!0})))}return Z}:null},[C,h,g,b,M,w,k]);return{...I,clipboard:P,overlays:z}})({element:o,sheet:r,sheetView:d,commands:a,copyForegroundColor:i.selection.strokeFill,copyBackgroundColor:c.fill,cutForegroundColor:i.selectionRemove.strokeFill,cutBackgroundColor:c.fill,notifier:l});return cn(r?.getSelection(),{onChange(f){}}),u.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),pF={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},hF={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},fF={key:"dragCopy",description:"Drag selection to copy cell contents."},mF={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},fg=(e,t)=>t.ctrlKey&&t.shiftKey?mF:t.ctrlKey?fF:t.shiftKey?hF:pF,gF={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},yF=u.memo(u.forwardRef((e,t)=>{const{view:n,commands:o,className:r,onFirstRender:i,notifier:a,onShowTooltip:l,onCloseTooltip:c,sheet:d,gridRef:p,gridStyle:f,isActive:h,editingCoords:g,...m}=e,y=n?.getBounds(),x=Te(l,[l]),v=Te(c,[c]),[b,w]=u.useState(()=>d?.getSelection().getCoords()),M=Te(Q=>{Go.isEqualSelectionCoords(Q,b)||d&&d.getSelection().updateCoords(Q)},[d,b]),k=Wi(),j=u.useRef(null),[_,L]=u.useState(d?.getProtection().isLocked()),[T,D]=u.useState(d?.getView().getMovableSelection().length>0),C=jn.detectIt().primaryInput==="touch",S=!C&&h,R=g!==null||T,P=Te(Q=>{const xe=Go.cellToRange(Q);if(d.isClosed())return xe;const be=d.getRange(xe,{excludeHidden:!0}).getMerges();return be.length===0?xe:be[0]},[d]),I=Te((Q,xe,be,Fe,ee,ae)=>{const we=d.getSelectedRange().getExtended(Fe,Q).getCoords();switch(Fe){case $.IRange.Direction.Up:return we.rowStart;case $.IRange.Direction.Down:return we.rowEnd;case $.IRange.Direction.Left:return we.colStart;case $.IRange.Direction.Right:return we.colEnd}},[d]),z=Te(()=>{const Q=d.getUsedRange()?.getCoords(),xe=d.getRowHeaders().getUsedRange()?.getCoords(),be=d.getColumnHeaders().getUsedRange()?.getCoords();return{...Q,colEnd:Math.max(Q?.colEnd??0,be?.max??0),rowEnd:Math.max(Q?.rowEnd??0,xe?.max??0)}},[d]),A=Te((Q,xe)=>d.getRowHeaders().hiddenHeadersAt(Q,xe),[d]),O=Te((Q,xe)=>d.getColumnHeaders().hiddenHeadersAt(Q,xe),[d]),N=Te(Q=>d.getRange(Q,{excludeHidden:!0}).getMerges(),[d]),F=Te(Q=>{d?.getSelection().setAdjusting(Q)},[d]),E=Te(async()=>{d?.getSelection().setAdjusting(null),k.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),k.setMode(null))},[k,b,d,o]),B=u.useMemo(()=>{const Q=k.getMode();return Q?.key==="cut"||Q?.key==="copy"},[k]);cn(d?.getView(),{onMovableSelectionChange:()=>{D(d.getView().getMovableSelection().length>0)}}),cn(d?.getSelection(),{onChange(Q){const xe=d.getSelection().getCoords();w(xe)}}),cn(d,{onProtectionChange:()=>{L(d.getProtection().isLocked())}});const{body:H={}}=f||{},U=n.getLayout(),Z=!(S&&b.ranges.length<=1&&g===null&&!_&&(!k.getMode()||B)),{overlay:G,onPointerDown:V}=Ww({gridRef:p,commands:o,layout:U,getCellCoordsAsRangeCoords:P,selection:b,fillHandleBorderColor:H.fill,selectionBackgroundColor:h?f.selection.fill:f.selectionInactive.fill,selectionBorderColor:h?f.selection.strokeFill:f.selectionInactive.strokeFill,selectionRemoveBackgroundColor:h?f.selectionRemove.fill:f.selectionInactive.fill,selectionRemoveBorderColor:h?f.selectionRemove.strokeFill:f.selectionInactive.strokeFill,disableFillDrag:Z,disableMoveDrag:C||!(h&&b.ranges.length<=1&&g===null&&!_),disableTouchSelection:R,onSelectionChange:M,onSelectionDragStart:F,onSelectionDragEnd:E,onMoveDragStart:(Q,xe,be)=>{k.setMode(fg(0,be))},onMoveDragUpdate:(Q,xe,be)=>{k.setMode(fg(0,be))},onMoveDragEnd:(Q,xe)=>{k.setMode(null)},onMoveDragDone:async(Q,xe,be)=>{if(Go.isEqualRanges(Q,xe))return;const Fe=d.getRange(xe);if(a?.showOptions){const J=Fe.getDifferences(Q);let ce=!1;for(let ne=0;!ce&&ne<J.getCount();ne++)ce=J.at(ne).isContentful();if(ce&&await a?.showOptions({title:"Confirm",description:"There is already data here. Do you want to replace it?",options:["Replace","Cancel"],defaultOption:"Replace"})!=="Replace")return}const ee=!be.ctrlKey,ae=be.shiftKey,we=ae?ee?"Insert Moved Cells":"Insert Copied Cells":ee?"Move Cells":"Copy Cells",se=await a?.showBusy?.(we);try{const J=d.getRange(Q);await Fe.doBatch(async()=>{ae?await Fe.insertFrom(Q,{isCut:ee,undoRange:J}):await Fe.copyFrom(Q,{isCut:ee,undoRange:J}),J.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0}),Fe.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0})},{description:we,autoSelect:!0})}catch(J){a?.showError?.(J)}finally{se?.()}},contentfulCellFinder:I,hiddenRowsAt:A,hiddenColumnsAt:O,mergedRanges:N,getDataCoords:z,canSelectionSpanMergedCells:Q=>{const xe=d.getRange(Q);return xe.isEntireColumns()||xe.isEntireRows()},onFill:async(Q,xe)=>{const be="Auto Fill",Fe=await a?.showBusy?.(be);try{await d.doBatch(()=>{d.getRange(Q).autoFill(xe),d.getRange(xe).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:be,autoSelect:!0})}catch(ee){a?.showError?.(ee)}finally{j.current=null,Fe?.()}},onFillPreview:(Q,xe,be)=>{if(p.current&&x){k.setMode(gF);try{j.current?.direction!==be&&(j.current=null,d.getRange(Q).autoFill(xe,{previewOnly:ne=>{j.current={callback:ne,direction:be}}}));const Fe=j.current?.callback?.(xe);if(!Fe||Fe.isEmpty())return;const ee=Fe.toText();if(!ee)return;const ae=Go.cellToRange(Fe.getCoords()),we=n.getRelativePointFromClient(0,0);let se=0,J=0,ce=mp;if(be===$.IRange.Direction.Down){se=U.getColOffset(ae.colEnd+1)-we.x;const ne=U.getRowOffset(ae.rowEnd),Pe=U.getRowOffset(ae.rowEnd+1);J=Pe-(Pe-ne)/2-we.y,ce=q5}else if(be===$.IRange.Direction.Right){J=U.getRowOffset(ae.rowEnd+1)-we.y;const ne=U.getColOffset(ae.colEnd),Pe=U.getColOffset(ae.colEnd+1);se=Pe-(Pe-ne)/2-we.x,ce=mp}else if(be===$.IRange.Direction.Up){se=U.getColOffset(ae.colEnd+1)-we.x;const ne=U.getRowOffset(ae.rowStart),Pe=U.getRowOffset(ae.rowStart+1);J=Pe-(Pe-ne)/2-we.y,ce=q5}else if(be===$.IRange.Direction.Left){J=U.getRowOffset(ae.rowEnd+1)-we.y;const ne=U.getColOffset(ae.colStart),Pe=U.getColOffset(ae.colStart+1);se=Pe-(Pe-ne)/2-we.x,ce=mp}x({anchor:{x:se,y:J},display:ee,placement:ce})}catch(Fe){a?.showError?.(Fe)}}},onFillDone:()=>{j.current=null,k.setMode(null),v?.()}}),le=Te(Q=>{V(jn.createSyntheticEvent(Q))},[V,g]);u.useEffect(()=>{const Q=n?.getStage();if(Q)return Q.addEventListener("pointerdown",le),()=>{Q.removeEventListener("pointerdown",le)}},[n?.getStage()]);const re=ir(t,()=>({}),[]),ge=u.useRef(null);return s.jsx("div",{className:Zr(r,"sheet-selection","_sheet-selection_12wyx_5"),style:{position:"absolute",width:y?.width,height:y?.height,overflow:"hidden",pointerEvents:"none",willChange:"none"},ref:c0([re,ge]),...m,children:G(n)})})),kd=Object.freeze({x:0,y:0,width:0,height:0}),xF={fireOnModelChange:!1},bF=u.memo(u.forwardRef((e,t)=>{const{children:n,view:o,movable:r,onRefLoad:i,onRefUnload:a,onHide:l,onShow:c,onUnFocus:d,isDragging:p,updateFrameBounds:f,dragStart:h,style:g,disabled:m,renderMovable:y,...x}=e,[v,b]=u.useState(kd),[w,M]=u.useState(null),[k,j]=u.useState(!1),_=u.useRef(null);u.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const D=o.toViewBounds(T);b(D??kd),f(D??kd)},[o?.getBounds()]),cn(r,{onBoundsChange:T=>{const D=T.getBounds();if(!D)return;const C=o.toViewBounds(D);b(C??kd),f(C)},onSelectionChange:()=>{const T=Gt.hasFocus(_.current,!0);!k&&!T||r.isSelected()||d()}}),cn(r,{onRequestFocus:()=>Gt.whenFocus(_.current,!0)},xF),u.useEffect(()=>{const T=_.current;return i(T),()=>{a(T)}},[]);const L=u.useMemo(()=>{if(!v)return null;let{width:T,height:D}=v;return y({view:o,movable:r,disabled:m,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:D},onHide:l,onShow:c})},[o,r,v.width,v.height,m,p]);return s.jsx("div",{className:"movable",tabIndex:0,ref:c0([_,t]),style:{display:"flex",alignItems:"stretch",justifyContent:"stretch",position:"absolute",maxWidth:"auto",maxHeight:"auto",minWidth:"auto",minHeight:"auto",left:v.x,top:v.y,width:v.width,height:v.height,...g},onMouseDown:async T=>{const D=T.shiftKey||T.ctrlKey,C=r.isSelected(),S=T.currentTarget;D&&C?r.unselect():(C&&!D||await r.select({addToSelection:D}),h(T.nativeEvent,S),S.focus())},onFocus:T=>{T.relatedTarget&&!w&&M(T.relatedTarget),j(!0)},onBlur:T=>{w&&!_?.current?.contains(T.relatedTarget)&&M(null),T.relatedTarget&&j(!1)},...x,children:L})})),vF=u.memo(u.forwardRef((e,t)=>{const{view:n,movables:o,movablesView:r,renderMovable:i,transactional:a,onUnFocus:l,onFocus:c,disabled:d=!1,disableDrag:p=!1,disableResize:f=!1,className:h,style:g,renderDirections:m=["nw","n","ne","w","e","sw","s","se"],onFirstRender:y,...x}=e,v=n.getBounds(),b=Te(y,[y]),w=Te(l,[l]),M=Te(c,[c]),[k,j]=u.useState([]),[_,L]=u.useState(!1),[T,D]=u.useState(!1),C=u.useRef(!0),S=u.useRef(new Map),R=u.useRef(new Map),P=u.useRef(new Map),I=u.useRef(new Map),z=u.useRef(new Map),A=u.useRef({onRequestFocus:ke=>(be(ke),null)}),O=u.useRef(null),N=u.useRef(null),F=u.useRef(null),[E,B]=u.useReducer(ke=>ke+1,0);u.useLayoutEffect(()=>{B()},[n,o]),cn(o,{onCollectionChange:()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),_e=z.current;_e.forEach(Be=>{Be()}),_e.clear();const Xe=A.current;for(let Be=0;Be<ke.length;Be++){const ct=ke[Be];if(ct.isClosed())continue;const et=ct.addListeners(Xe);_e.set(ct,et)}B()},onInvalidated:()=>{B()}}),cn(r,{onMovableSelectionChange(ke){U(),B()}});const H=u.useCallback((ke,_e)=>{const Xe=P.current.get(ke);F.current&&(F.current.getTargets().forEach(Be=>{if(Be===Xe)return Be.style.left=_e.x+"px",Be.style.top=_e.y+"px",Be.style.width=_e.width+"px",void(Be.style.height=_e.height+"px")}),F.current.updateRect())},[]),U=()=>{const ke=[],_e=r.getMovableSelection();_e.forEach(Xe=>{const Be=P.current.get(Xe);Be&&_e.indexOf(Xe)!==-1&&ke.push(Be)}),j(Xe=>Gt.isEqualArrays(Xe,ke)?Xe:ke)},Z=u.useRef(null),G=u.useMemo(()=>new Promise(ke=>{Z.current=ke}),[]),V=u.useRef(null),le=Te(async(ke,_e)=>{V.current=_e,await(async()=>!(!await G.then()||!F.current))()&&V.current===_e&&F.current.dragStart(ke,_e)},[k]),[re,ge]=u.useState(!1),Q=u.useRef(null),xe=u.useRef(null),be=Te(async(ke=null)=>{if(ke||(ke=r.getMovableSelection()[0]),!ke)return w?.(),!1;const _e=P.current.get(ke);_e?(await Gt.whenFocus(_e),_e.focus(),xe.current=_e,Q.current=null):Q.current=ke},[r]);u.useEffect(()=>{re&&k.length>0&&xe.current!==k[0]&&be(),C.current&&(b?.(),C.current=!1)},[k]);const Fe=u.useMemo(()=>{const ke=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(ke.length===0&&S.current.size===0)return null;const _e=(he,Ye,Se,Ie=!0)=>{const de=he.isSelected(),Oe={tabIndex:Se,view:n,movable:he,onRefLoad:Le=>{Q.current===he&&(Le.focus(),xe.current=Le,Q.current=null),P.current.set(he,Le),R.current.set(Le,he),Ye.rendered=!0,U()},onRefUnload:Le=>{P.current.delete(he),R.current.delete(Le),Ye.rendered=!1,U()},onUnFocus:w,onHide:Le=>{Ye.onHide=Le},onShow:Le=>{Ye.onShow=Le},isDragging:de&&(T||_),disabled:d,renderMovable:i,updateFrameBounds:Le=>{H(he,Le)},dragStart:le,onMouseUp:()=>{if(V.current=null,N.current){L(!1),D(!1);let Le=!1;I.current?.forEach(je=>{Gt.isEqualBounds(je.movable.getBounds(),je.startBounds)||(Le=!0)}),Le?ae():we()}},style:{opacity:Ie?_&&de?.7:void 0:0,zIndex:_&&de?he.getZIndex()+ke.length:void 0,pointerEvents:Ie?void 0:"none",cursor:T&&de?"grabbing":d||p?"initial":"move",boxShadow:!de||T&&!_?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(bF,{...Oe},`movable-${he.getUUID()}`)},Xe=S.current,Be=new Map,ct=[];for(let he=0;he<ke.length;he++){const Ye=ke[he];if(Ye.isClosed())continue;let Se=Xe.get(Ye);Se||(Se={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Ie,de)=>{if(!de||de.shown===!0)return;de.shown=!0;const Oe=++de.visibilityRequestId;requestAnimationFrame(()=>{const Le=S.current.get(Ie);Le&&Oe===de.visibilityRequestId&&(de.onShow?.(Ie),Le.shown=!0)})},doHide:async(Ie,de)=>{if(!de||de?.shown===!1)return;de.shown=!1;const Oe=++de.visibilityRequestId,Le=await Promise.resolve(de.onHide?.(Ie));Oe===de.visibilityRequestId&&Le!==!1&&(de.shown=!1,S.current.delete(Ie),B())},visibilityRequestId:0}),Se.frame=_e(Ye,Se,he,!0),ct.push(Se.frame),Se.doShow(Ye,Se),Xe.delete(Ye),Be.set(Ye,Se)}const et=[];return r.getMovableSelection().forEach(he=>{const Ye=Xe.get(he);Ye&&(Ye.frame=_e(he,Ye,-1,!1),et.push(Ye.frame),Xe.delete(he),Be.set(he,Ye))}),Xe.forEach((he,Ye)=>{he.frame=_e(Ye,he,-1,!1),et.push(he.frame),he.doHide(Ye,he),Xe.delete(Ye),Be.set(Ye,he)}),S.current=Be,U(),[...et,...ct]},[E,n,i,d,p,f,_,T]),ee=Te((ke,_e)=>{const Xe=`${_e} ${k.length===1?$.TextUtils.capitalize(R.current?.get(k[0]).getContent().getType()):"Drawings"}`;N.current&&(console.warn(`Transaction ${N.current.getDescription()} is being replaced by ${Xe}`),N.current.rollback(),N.current=null),N.current=a.beginCommit({description:Xe}),I.current.clear();for(let Be=0;Be<k.length;Be++){const ct=k[Be],et=R.current?.get(ct);et?I.current.set(ct,{movable:et,startBounds:n.toViewBounds(et.getBounds())}):console.warn("invalid element",et)}},[a,n,k]),ae=u.useCallback(()=>{if(!N.current)return;const ke=[];I.current?.forEach(_e=>{ke.push(_e.movable)}),N.current.commit({viewAfter:{view:r,movableSelection:ke}}),I.current.clear(),N.current=null},[]),we=u.useCallback(()=>{N.current&&(N.current.rollback(),N.current=null)},[]),se=u.useRef(null);u.useEffect(()=>{se.current&&(se.current.onscroll=ke=>{ke.preventDefault(),ke.srcElement.scrollTop=0,ke.srcElement.scrollLeft=0})},[se.current]);const J=ir(t,()=>({isMovableArea:()=>!0,focusMovable:be,focus:()=>{be()}}),[r]),[ce,ne]=u.useState(null),Pe=u.useRef(!1),Ee=u.useRef(!1),it=u.useRef(!1);u.useEffect(()=>{if(d||k.length===0||it.current||Pe.current)return;if(Ee.current)return void requestAnimationFrame(()=>{F.current&&O.current&&F.current.refTargets.length>0&&(it.current=!0,Z.current?.(!0)),j([...k])});Pe.current=!0;const ke=u.lazy(async()=>{try{const _e=await Promise.resolve().then(()=>require("./D8lN5Mv3J4SwSpLP.cjs"));return Pe.current=!1,Ee.current=!0,j([...k]),_e}catch(_e){return console.warn(_e),Z.current?.(!1),null}});ne(ke)},[k,d,p,f]);const Ue=u.useMemo(()=>!ce||d?null:s.jsx(u.Suspense,{children:s.jsx(ce,{className:Zr({dragging:_||T,resizing:_,moving:T}),container:null,ref:F,target:F.current?k:[],draggable:!d&&!p,resizable:!d&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:ke=>{ee(ke.target,"Resize")},onResize:ke=>{if(!N.current)return ke.stopDrag(),void B();L(!0);const _e=ke.direction[0]!==0&&ke.direction[1]!==0;let Xe=0,Be=0;for(let ct=0;ct<k.length;ct++){const et=k[ct],he=I.current.get(et),Ye=R.current.get(et);if(!he||!Ye){console.warn("invalid element");continue}let Se=ke.dist[0],Ie=ke.dist[1],de=ke.drag.dist[0],Oe=ke.drag.dist[1],Le=he.startBounds.width,je=he.startBounds.height;ct===0?(Xe=Le,Be=je):(Se*=Le/Xe,de*=Le/Xe,Ie*=je/Be,Oe*=je/Be);const K={...he.startBounds};if(K.width=Math.max(0,Le+Se),K.height=Math.max(0,je+Ie),ke.direction[0]===-1&&(K.width=Math.max(0,Math.min(he.startBounds.x+Le,Le-de))),ke.direction[1]===-1&&(K.height=Math.max(0,Math.min(he.startBounds.y+je,je-Oe))),_e&&(Ye.isLockAspectRatio()||ke.inputEvent?.shiftKey)){const W=Le/je,te=K.width/K.height;te>W?K.height=K.width/W:te<W&&(K.width=K.height*W)}ke.direction[0]===-1&&(K.x=Math.max(0,Math.min(he.startBounds.x+Le,he.startBounds.x+Le-K.width))),ke.direction[1]===-1&&(K.y=Math.min(he.startBounds.y+je,he.startBounds.y+je-K.height)),he.movable.setBounds(n.toAbsoluteBounds(K))}},onResizeEnd:ke=>{L(!1),ae()},onDragStart:ke=>{ee(ke.target,"Move")},onDrag:ke=>{if(!N.current)return ke.stopDrag(),void B();D(!0);for(let _e=0;_e<k.length;_e++){const Xe=k[_e],Be=I.current.get(Xe);Be?Be.movable.setBounds(n.toAbsoluteBounds({...Be.startBounds,x:Be.startBounds.x+ke.translate[0],y:Be.startBounds.y+ke.translate[1]})):console.warn("invalid element")}},onDragEnd:ke=>{},onMouseUp:ke=>{}})}),[E,ce,k,n,d,p,f,_,T]);return s.jsx("div",{className:Zr(h,"movable-area","_movable-area_314c6_5"),style:{width:v.width,height:v.height,...g,position:"absolute",overflow:"hidden",willChange:"transform"},ref:c0([J,se]),...x,children:s.jsx("div",{className:"movable-scroll",style:{position:"absolute",cursor:"initial",left:0,top:0,width:v.width,height:v.height},...x,children:s.jsxs("div",{ref:O,style:{position:"absolute",pointerEvents:"auto"},onFocus:ke=>{M?.(),ge(!0)},onBlur:ke=>{ge(!1)},onKeyDownCapture:ke=>{if(ke.isDefaultPrevented())return;const _e=ke.nativeEvent.ctrlKey,Xe=ke.nativeEvent.altKey,Be=ke.nativeEvent.shiftKey;if(ke.which===on.Escape){const Se=r.getMovableSelection();let Ie=[...Se];return k.forEach(de=>{if(Ie.length===0)return;const Oe=R.current.get(de);let Le=Ie.indexOf(Oe);Ie.splice(Le,1)}),Ie.length!==Se.length&&r.selectMovables(Ie),Ie.length===0&&w?.(),void ke.preventDefault()}const ct=.1,et=Se=>{o.updateSelected(Ie=>{Ie.setRotation(Ie.getRotation()+Se)},"Rotate")},he=(Se,Ie=!0)=>{o.updateSelected(de=>{const Oe=de.getBounds();let Le=1+Se;Ie||(Le=1/Le);const je=Math.sqrt(Math.pow(Oe.width,2)+Math.pow(Oe.height,2)),K=Math.atan2(Oe.height,Oe.width),W=Le*je;if(W<10)return;const te=W*Math.cos(K),oe=W*Math.sin(K),ue={x:Oe.x+(Oe.width-te)/2,y:Oe.y+(Oe.height-oe)/2,width:te,height:oe};de.setBounds(ue)},"Resize")},Ye=Se=>{o.updateSelected(Ie=>{const de=Ie.getBounds(),Oe={x:de.x+(Se.x??0),y:de.y+(Se.y??0),width:de.width+(Se.width??0),height:de.height+(Se.height??0)};Ie.setBounds(Oe)},"Nudge")};if(ke.which===on.Delete)o.updateSelected(Se=>{Se.delete()},"Delete"),ke.preventDefault();else if(ke.key==="a"&&_e){const Se=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(Se,!0),ke.preventDefault()}else ke.key==="ArrowLeft"?(Be?he(ct,!1):Xe?et(-10):Ye({x:_e?-10:-1}),ke.preventDefault()):ke.key==="ArrowRight"?(Be?he(ct,!0):Xe?et(10):Ye({x:_e?10:1}),ke.preventDefault()):ke.key==="ArrowUp"?(Be?he(ct,!0):Ye({y:_e?-10:-1}),ke.preventDefault()):ke.key==="ArrowDown"&&(Be?he(ct,!1):Ye({y:_e?10:1}),ke.preventDefault())},children:[Fe,Ue]})})})})),ss=e=>{let t=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,o=0,r=0;for(let i=0;i<e.length;i++){const a=e[i].getBounds();t=Math.min(a.x,t),n=Math.min(a.y,n),o=Math.max(a.x+a.width,o),r=Math.max(a.y+a.height,r)}return{x:t,y:n,width:o-t,height:r-n}},mg=(e,t=!0)=>{const n=[],o=t?"x":"y",r=t?"y":"x",i=t?"width":"height";let a=0,l=Number.MAX_SAFE_INTEGER,c=0;for(let f=0;f<e.length;f++){const h=e[f],g=h.getBounds();a+=g[i],l=Math.min(g[o],l),c=Math.max(g[o]+g[i],c),n.push({bounds:g,movable:h})}const d=(c-l-a)/(e.length-1);n.sort((f,h)=>{const g=f.bounds[o],m=h.bounds[o];return g!==m?g-m:f.bounds[r]-h.bounds[r]});const p=new Map;p.set(n[0].movable,n[0].bounds);for(let f=1;f<n.length-1;f++){const h=n[f-1].bounds,g={...n[f].bounds};g[o]=h[o]+h[i]+d,n[f].bounds=g,p.set(n[f].movable,g)}return p.set(n[n.length-1].movable,n[n.length-1].bounds),p},wF=u.memo(u.forwardRef((e,t)=>{const{children:n,disabled:o,description:r,view:i,isDragging:a,onHide:l,onShow:c,...d}=e;u.useEffect(()=>{},[r]);const p=ir(t,()=>({isEmptyFrame:()=>!0}),[]),[f,{height:h,width:g}]=Wl();return s.jsx("div",{...d,ref:c0([p,f]),children:s.jsx("div",{className:"chart-editor",style:{width:"100%",height:"100%",border:"var(--sxl-app-color-grey, grey) solid 1px",backgroundColor:"var(--sxl-app-color-background, white)",backgroundImage:"var(--sxl-app-image-background)",alignItems:"center",justifyContent:"center",zoom:i.getZoom(),display:"flex",position:"relative",filter:o?"blur(1px)":void 0,boxShadow:a?"1px 1px 2px var(--sxl-app-color-shadow, rgba(0,0,0,.15))":void 0},children:s.jsx("div",{style:{textAlign:"center"},children:r})})})})),SF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,movableProps:r,renderMovable:i,commands:a,target:l,notifier:c,onRepeatCommandChange:d}=e,p=function(h){const{movables:g,movablesView:m,transactional:y,commands:x,target:v,onRepeatCommandChange:b,notifier:w}=h,M=Wi();u.useRef(M.getMode()).current=M.getMode();const k=Te(async(I,z,A=null,O=!0)=>{const N=async()=>{const F=await Promise.resolve(w?.showBusy?.(I.label()));try{await z();const E=A??I?.label?.();if(b){let B=null;I&&E!==!1&&(B=new Tt(I.key(),v,{label:E,description:E},N)),b(B)}F?.(),O&&M.setMode(null)}catch(E){F?.(),w?.showError?.(E)}};await N()},[b,w]),[j,_]=u.useReducer(I=>I+1,0),L=Te((I,z,A)=>{if(!m)return;const O=m.getMovableSelection();if(O.length===0)return;let N="Drawings";if(O.length===1){const E=O[0];N=$.TextUtils.capitalize(E.getContent().getType())??"Drawing"}const F=`${I.label()} ${N}`;k(I,()=>{let E=null;y&&(E=y.beginCommit(F));const B=m.getMovableSelection();if(B.length===0)return;const H=A?.(B);for(let U=0;U<B.length;U++){const Z=B[U];z(Z,H)}E?.commit()})},[m,y]),[T,D]=u.useState(m.getMovableSelection()[0]??null),[C,S]=u.useState(!T||T?.isProtected()),R=u.useMemo(()=>[new We("moveToFront",v,{label:"Bring to Front",description:"Move to the front of all of the other drawings.",shortcut:{key:"BracketRight",modifiers:[$e.Ctrl,$e.Shift]}},function(){L(this,I=>{I.moveToFront()})}),new We("moveForward",v,{label:"Bring Forward",description:"Move forward one layer in the z order.",shortcut:{key:"BracketRight",modifiers:[$e.Ctrl]}},function(){L(this,I=>{I.moveForward()})}),new We("moveToBack",v,{label:"Send to Back",description:"Move to the back of all of the other drawings.",shortcut:{key:"BracketLeft",modifiers:[$e.Ctrl,$e.Shift]}},function(){L(this,I=>{I.moveToBack()})}),new We("moveBackward",v,{label:"Send Backward",description:"Move backwards one layer in the z order.",shortcut:{key:"BracketLeft",modifiers:[$e.Ctrl]}},function(){L(this,I=>{I.moveBackward()})}),new We("toggleLockAspectRatio",v,{label:"Lock Aspect Ratio",description:"Toggle whether the aspect ratio should be maintained when resizing from corners."},function(){L(this,I=>{I.setLockAspectRatio(!I.isLockAspectRatio())})}),new We("formatAnchorTypeTwoCell",v,{label:"Move and size with cells",description:"Set your drawing to move and resize when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.TwoCell)})}),new We("formatAnchorTypeOneCell",v,{label:"Move but don't size with cells",description:"Set your drawing to only move when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.OneCell)})}),new We("formatAnchorTypeAbsolute",v,{label:"Don't move or size with cells",description:"Set your drawing to never move or resize when underling sheet resizes."},function(){L(this,I=>{I.setAnchorType($.IAnchored.Type.Absolute)})}),new We("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){L(this,(I,z)=>{I.setBounds({x:z.x})},ss)}),new We("formatDrawAlignCenter",v,{label:"Align Center",description:"Align the selected drawings vertically relative to each other."},function(){L(this,(I,z)=>{I.setBounds({x:(z.width-I.getBounds().width)/2+z.x})},ss)}),new We("formatDrawAlignRight",v,{label:"Align Right",description:"Align the selected drawings to the right."},function(){L(this,(I,z)=>{I.setBounds({x:z.width-I.getBounds().width+z.x})},ss)}),new We("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){L(this,(I,z)=>{I.setBounds({y:z.y})},ss)}),new We("formatDrawAlignMiddle",v,{label:"Align Middle",description:"Align the selected drawings horizontally relative to each other."},function(){L(this,(I,z)=>{I.setBounds({y:(z.height-I.getBounds().height)/2+z.y})},ss)}),new We("formatDrawAlignBottom",v,{label:"Align Bottom",description:"Align the selected drawings to the bottom."},function(){L(this,(I,z)=>{I.setBounds({y:z.height-I.getBounds().height+z.y})},ss)}),new We("formatDrawDistributeHorz",v,{label:"Distribute Horizontally",description:"Distribute the selected drawings horizontally with equal spacing between each."},function(){L(this,(I,z)=>{I.setBounds(z.get(I))},I=>mg(I))}),new We("formatDrawDistributeVert",v,{label:"Distribute Vertically",description:"Distribute the selected drawings vertically with equal spacing between each."},function(){L(this,(I,z)=>{I.setBounds(z.get(I))},I=>mg(I,!1))}),new We("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new We("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new We("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new We("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new We("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new We("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new We("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[m,T]);u.useEffect(()=>{},[M]);const P=u.useMemo(()=>{let I=null;return I=x?x.createChildGroup(v,"movable",!1):new a0(v,"movable"),I.addCommands(R,!0),I},[x,R]);return cn(T,{onAnyChange:()=>{P.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===$.IAnchored.Type.TwoCell}),P.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===$.IAnchored.Type.OneCell}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),P.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),P.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:I=>{S(I.isProtected())},onDelete:()=>{}}),cn(m,{onMovableSelectionChange:()=>{const I=m.getMovableSelection()[0]??null;D(I),S(!I||I.isProtected()),_()}}),cn(g,{onCollectionChange:()=>{_()}}),u.useEffect(()=>{const I={disabled:C};P.getCommand("formatAnchorTypeTwoCell").update(I),P.getCommand("formatAnchorTypeOneCell").update(I),P.getCommand("formatAnchorTypeAbsolute").update(I),P.getCommand("toggleLockAspectRatio").update(I);const z=g.getCount(),A=m.getMovableSelection(),O=C||z<=1||A.length===0;let N={disabled:O},F=N;if(!O&&A.length===1){const H=A[0];H.getZIndex()===0&&(N={disabled:!0}),H.getZIndex()===z-1&&(F={disabled:!0})}P.getCommand("moveToFront").update(F),P.getCommand("moveForward").update(F),P.getCommand("moveToBack").update(N),P.getCommand("moveBackward").update(N);const E={disabled:C||A.length<=1};P.getCommand("formatDrawAlignLeft").update(E),P.getCommand("formatDrawAlignCenter").update(E),P.getCommand("formatDrawAlignRight").update(E),P.getCommand("formatDrawAlignTop").update(E),P.getCommand("formatDrawAlignMiddle").update(E),P.getCommand("formatDrawAlignBottom").update(E),P.getCommand("formatDrawFlipHorz").update(E),P.getCommand("formatDrawFlipVert").update(E),P.getCommand("formatDrawGroup").update(E),P.getCommand("formatDrawUngroup").update(E),P.getCommand("formatDrawSwapShapes").update(E),P.getCommand("formatDrawSwapShapesHorz").update(E),P.getCommand("formatDrawSwapShapesVert").update(E);const B={disabled:C||A.length<=2};P.getCommand("formatDrawDistributeHorz").update(B),P.getCommand("formatDrawDistributeVert").update(B)},[j,C,j]),P}({movables:o.getMovables(),movablesView:o?.getView(),transactional:o,onRepeatCommandChange:d,commands:a,target:l,notifier:c});u.useEffect(()=>{n?.getStage()},[n?.getStage()]);const f=u.useMemo(()=>s.jsx(vF,{ref:t,view:n,movables:o.getMovables(),disableResize:!o.getProtection().isObjectsAllowed(),disableDrag:!o.getProtection().isObjectsAllowed(),movablesView:o.getView(),transactional:o,renderMovable:i,...r,onFocus:()=>{p.activate(),r?.onFocus?.()}},"movable-area"),[o,r,a,p]);return f&&n?f:null})),CF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:l,commands:c,notifier:d=xu}=e,p=Wi(),[f,h]=u.useState(null),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),[w,M]=u.useState(null);u.useLayoutEffect(()=>{if(y===null)return b(null),void M(null);const A=()=>{const O=o.getRange(y).getCell(),N=O.getStyle();let F,E=N.getFill()?.toCSS(r.body.darkMode);E.background!=="none"&&E.background!=="transparent"||(E=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),E.background!=="none"&&E.background!=="transparent"||(E={background:r.body.fill}),b({style:E}),O&&!O.getFormula()&&(F=O?.getRenderHorizontalAlignment()),M(F??"left")};return A(),o.getRange(y).addListener(()=>{A()})},[o,y,r?.body]);const k=Te(()=>{let A=g.editState.dirty??"";if(g.editState.dirty!==void 0){const O=$.TextUtils.clampString(A);try{const N=g.sheet.getRange(g.coords),F=`Typing '${O}' into ${N.toString()}`;return N.setValue(A,{description:F,autoFit:!0}),x(null),m(null),p.setMode(null),l(null),!0}catch(N){throw d.showError(new Error(`Unable to enter '${O}'.`,{cause:N})),N}}},[o,g,d]),j=Te(A=>o.getRange(A).getCell().getExtrusions()??Go.cellToRange(A),[o]);Te(A=>{let O=$.IRange.Orientation.Row,N=!1;A!==$.IRange.Direction.Up&&A!==$.IRange.Direction.Down||(O=$.IRange.Orientation.Column),A!==$.IRange.Direction.Left&&A!==$.IRange.Direction.Up||(N=!0),o.getSelection().traverse(O,N)},[o]);const _=u.useCallback((A,O)=>{if(i)return i(A,O);if(!o)return null;const{ref:N,...F}=A;return s.jsx(Xw,{ref:N,...F,sheet:o,bodyStyle:r?.body,activeCoords:O,commands:c,onChangeEdit:E=>{const B={sheet:o,coords:O,editState:E};p.setMode(H=>({...H,description:B.editState.editMode?"Edit":"Enter",args:{...H?.args,stateAndCoords:B}}))},editState:g.editState})},[o,v,i,g,y]),{overlay:L,startEdit:T,submitEdit:D,cancelEdit:C,onKeyboardEventNative:S,onPointerEventNative:R}=(A=>{const{view:O,canEdit:N=xz,getCellEditor:F,onBeforeStartEdit:E,onStartEdit:B,onSubmitEdit:H,onCancelEdit:U,onDoneEdit:Z,isEditorStartKeyEvent:G=bz,isEditorStartPointerEvent:V=vz,containerProps:le,borderStrokeFill:re,borderStrokeWidth:ge=2,getRangeCoords:Q=null,activeCoords:xe,alignment:be=sc.Left}=A,[Fe,ee]=u.useState(!1),[ae,we]=u.useState(void 0),se=wt((W,te,oe,ue,ie,pe)=>{if(!te)return null;const fe=ie?.(te,W),ye=W.getRangeCoordsBounds(fe),De=W.toClipBounds(ye),Ve=ye,Je=W.getZoom();if(!De)return null;oe&&(oe*=Je),ue&&(ue*=Je);let ot=Ve,tt=!1;if(oe!==void 0){let _t={...fe},Yt=0;for(;!tt&&ot.width<=oe&&Yt<20;){Yt++,Yt>19&&console.warn("max width reached");const Jt=W.getTotalRangeCoords(),Qt=W.getLayout();pe===sc.Left?_t.colEnd+1<Jt.colEnd?_t.colEnd=Qt.getColIndex(ot.x+oe):tt=!0:pe===sc.Right?_t.colStart-1>=0?_t.colStart=Qt.getColIndex(ot.x-(oe-ot.width)):tt=!0:pe===sc.Center&&_t.colEnd+1<Jt.colEnd&&_t.colStart-1>=0?(_t.colStart=Qt.getColIndex(ot.x-(oe-ot.width)/2),_t.colEnd=Qt.getColIndex(ot.x+ot.width+(oe-ot.width)/2)):tt=!0,tt||(ot=W.getRangeCoordsBounds(_t))}}ot.height=Ve.height,ue!==void 0&&(ot.height=Math.max(ue+1,Ve.height));const{width:Lt,height:At}=W.getViewportSize();return{x:ot.x??0,y:ot.y??0,height:Math.min(At-ot.y,ot.height)+1,width:Math.min(Lt-ot.x,ot.width)+1}},[be]),J=wt(N,[N]),ce=u.useCallback(()=>{O?.getStage()?.focus()},[O]),ne=u.useRef(null),Pe=wt(W=>{E?.(W),Ye(),ee(!0),ne.current=null},[E]),Ee=wt(W=>{B?.(W.coords)},[B]),it=wt(W=>{W.isSubmitted||W.isCancelled||(_e.current.isEditorClosed=!0,ce(),W.isCancelled=!0,U?.(W.coords),Ye())},[U]),Ue=wt(W=>{if(W.isSubmitted||W.isCancelled)return!1;try{return ne.current=W.coords,W.isEditorClosing=!0,W.isSubmitted=!0,W.isEditorSubmitted||(W.isEditorSubmitted=!0,W.editorRefs[0]?.submitEdit?.()),W.coords,H?.(W.coords),W.isEditorClosed=!0,ce(),Ye(),!0}catch(te){throw W.isEditorClosing=!1,W.isSubmitted=!1,te}},[H]),ke=wt(W=>{ee(!1),Z?.(W.coords),Ye()},[Z]),_e=u.useRef(null),Xe=u.useRef(null),Be=u.useRef(null),ct=u.useRef([]),[et,he]=u.useReducer(W=>W+1,0),Ye=u.useCallback(W=>{W&&ct.current.push(W),he()},[]),Se=wt(W=>{if(W.defaultPrevented||W.isSynthetic||!O)return;const te=O?.getCellCoordsFromClient(W.clientX,W.clientY);te&&Ye({eventType:"pointer",event:W,coords:te})},[O]),Ie=wt(W=>{const te=W.nativeEvent;Se(te)},[O]),de=wt(W=>{if(W.defaultPrevented||W.isSynthetic||!O?.getStage())return;const te=Xe.current;G(W,te)&&(W.stopPropagation(),W.preventDefault()),W.key,Ye({eventType:"keyboard",event:W,coords:te})},[O]);u.useLayoutEffect(()=>{const W=(ue,ie)=>{const pe=ie?.cell??ue;if(!pe)return null;const fe=pe;if(!J(pe))return null;Pe?.(pe);const ye=Qo.uuidV4();ie=Object.freeze({autoFocus:!0,...ie}),Be.current=pe;const De={coords:fe,startEvent:ie,uuid:ye,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:Ve=>{De.isMounted||(De.isMounted=!0,Ye())},onUnmount:Ve=>{if(De.editorRefs.length===0){const Je=()=>{De.isMounted=!1,Ye()};if(document.activeElement!==document.body)Je();else{const ot=tt=>{tt.defaultPrevented||tt.target!==document.body||de(tt)};window.addEventListener("keydown",ot,!0),O.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",ot),Je()},{once:!0}),ce()}}}};return De};if(ct.current.length<=0&&!_e.current)return;const te=ct.current[0];$9(te),(ue=>{const ie=[],pe=ue?.length??0;for(let fe=0;fe<pe;fe++){const ye=ue[fe];ie.push($9(ye))}})(ct.current),_e.current,_e.current;let oe=_e.current;if(_e.current){if(_e.current.isDone)_e.current=null;else if(_e.current.isSubmitted||_e.current.isCancelled){if(_e.current.isMounted)return;_e.current.isDone||(ke(_e.current),_e.current.isDone=!0)}}if(te){if(te.eventType==="start"){const ue=te,ie=ue.startEvent?.cell??Xe.current;_e.current&&$t.isEqualCells(_e.current.coords,ie)||(_e.current=W(ie,ue.startEvent))}else if(te.eventType==="keyboard"){const ue=te.event;if(_e.current){let ie=!1;switch(ue.which){case 37:case 39:case 38:case 40:case 13:case 9:ie=!0}if(!ie){_e.current.events.push(te);for(let pe=0;pe<_e.current.editorRefsDispatchEditorEvent.length;pe++)_e.current.editorRefsDispatchEditorEvent[pe](te)}}else if(G(ue,te.coords)){const ie=W(Xe.current,void 0);ie&&ie.events.push(te),_e.current=ie}}else if(te.eventType==="pointer"){const ue=te.event;if(_e.current){_e.current.events.push(te);for(let ie=0;ie<_e.current.editorRefsDispatchEditorEvent.length;ie++)_e.current.editorRefsDispatchEditorEvent[ie](te)}else{const ie=te?.coords??Xe.current,pe=V(ue,ie);if(pe){let fe;typeof fe!="boolean"&&(fe=pe);const ye=W(ie,fe);ye&&ye.events.push(te),_e.current=ye}}}else if(te.eventType==="submit"){if(_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;Ue(_e.current)}}else if(te.eventType==="cancel"){if(_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;it(_e.current)}}else if(te.eventType==="coordsChange"){const ue=te;if(Xe.current=ue.activeCoords,_e.current,_e.current&&!_e.current.isSubmitted&&!_e.current.isCancelled){if(!_e.current.isMounted)return;try{Ue(_e.current)}catch{}}}}ct.current.length>0&&(ct.current.shift(),Ye()),ct.current.length===0&&(!_e.current||_e.current.isEditorClosing||_e.current.isEditorClosed?!_e.current&&oe&&ce():_e.current.isMounted&&!_e.current.isStarted&&(_e.current.isStarted=!0,_e.current.startEvent.autoFocus&&(typeof _e.current.startEvent.autoFocus=="string"?_e.current.editorRefs[0]?.autoFocus(_e.current.startEvent.autoFocus):_e.current.editorRefs[0]?.autoFocus()),Ee?.(_e.current),requestAnimationFrame(()=>{O&&_e.current?.coords&&O.scrollCellCoordsIntoView(_e.current.coords)})))},[et]),u.useEffect(()=>{Be.current=xe;const W=_e.current?.coords;$t.isEqualCells(W,xe)||(_e.current&&(_e.current.isEditorClosing=!0),Ye({eventType:"coordsChange",activeCoords:xe}))},[xe]);const Oe=u.useCallback(W=>{de(W.nativeEvent)},[]),{width:Le=0,height:je=0}=ae??{width:0,height:0},K=wt(F,[F]);return{overlay:wt(W=>{if(!_e.current||_e.current.isEditorClosed)return _e.current,null;_e.current.coords;let te=se(W,_e.current.coords,Le,je,Q,be),oe=!0;te&&te.width!==0&&te.height!==0||(te={x:0,y:0,width:Le,height:Le},oe=!1);const ue=W.getZoom(),ie={containerBounds:{x:0,y:0,width:te.width/ue,height:te.height/ue},setNaturalDimensions:we,zoom:ue};return s.jsx(wz,{session:_e.current,refLatestCoords:Be,handleSubmitEdit:Ue,handleCancelEdit:it,cellBounds:te,borderStrokeWidth:ge,borderStrokeFill:re,isInBounds:oe,getCellEditor:K,propsEditor:ie,alignment:be,...le},"editor:"+_e.current.uuid)},[F,Q,et,Le,je,be,ge,re]),startEdit:u.useCallback(W=>{Ye({eventType:"start",startEvent:W})},[]),submitEdit:u.useCallback(()=>{Ye({eventType:"submit"})},[]),cancelEdit:u.useCallback(()=>{Ye({eventType:"cancel"})},[]),onKeyboardEvent:Oe,onPointerEvent:Ie,onKeyboardEventNative:de,onPointerEventNative:Se,isEditing:Fe}})({view:n,activeCoords:f,getCellEditor:_,canEdit:()=>{const A=o.getProtection();if(A.isReadOnly())return!1;const O=A.isLocked();return O&&a(),!O},onBeforeStartEdit:A=>{const O=Yw(()=>o.getRange(A).getCell()),N={sheet:o,coords:A,editState:Object.freeze(O)};p.setMode({key:"edit",args:{stateAndCoords:N}}),m(N)},onStartEdit:A=>{x(A),l(A)},onSubmitEdit:k,onCancelEdit:A=>{x(null),m(null),p.setMode(null),l(null)},onDoneEdit:A=>{p.setMode(null)},containerProps:v,borderStrokeFill:r.selection?.strokeFill,borderStrokeWidth:o?.getSelection().getCoords().ranges?.length>1?1:2,alignment:w,getRangeCoords:j});cn(o.getSelection(),{onChange(A){h(o.getSelection().getCoords().cell)}});const P=Te(A=>{R(A),y&&D()},[R,C,y]),I=u.useCallback(A=>{R(A)},[R]),z=u.useCallback(A=>{S(A)},[S]);return u.useEffect(()=>{const A=n?.getStage();if(A)return A.addEventListener("pointerdown",P),A.addEventListener("dblclick",I),A.addEventListener("keydown",z),()=>{A.removeEventListener("pointerdown",P),A.removeEventListener("dblclick",I),A.removeEventListener("keydown",z)}},[n?.getStage()]),u.useEffect(()=>{const A=p.getMode(),O=A?.key;O==="edit"||O==="enter"?g?A.args?.cancel?C():A.args?.submit?D():m(A.args?.stateAndCoords):T(A.args?.start):y&&C()},[p]),L(n,t)})),nS="white",oS="black",kF=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${oS}' fill='${nS}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,EF=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${oS}' fill='${nS}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,MF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o}=e,[r,i]=u.useState(o.getTables().getCount()>0),[a,l]=u.useState(null),[c,d]=u.useState(null),[p,f]=u.useState(null),[h,g]=u.useState(null),m=Te(()=>{if(o.getTables().getCount()>0){i(!0);const k=o.getTables().search({address:n.getVisibleRangeCoords()});l(k.length>0?k:null)}else i(!1),l(null)},[o,n]),y=Te(k=>{k.preventDefault(),k.stopPropagation();const j=n.getCellCoordsFromClient(k.clientX,k.clientY),_=o.getTables().search({address:j});_.length===1&&_[0].select()},[n,o]),x=Te(k=>{k.preventDefault(),k.stopPropagation();const j=n.getCellCoordsFromClient(k.clientX,k.clientY),_=o.getTables().search({address:j});if(_.length===1){const L=_[0].getRange().getCoords(),T={colStart:L.colStart,rowStart:j.rowIndex,colEnd:L.colEnd,rowEnd:j.rowIndex};o.getRange(T).select()}},[n,o]),v=Te(()=>{if(!r)return;const k=o.getTables().search({address:n.getVisibleRangeCoords()});l(k.length>0?k:null)},[o,r,n]);cn(o?.getSelection(),{onChange(k){d(o.getSelection().getCoords().cell)}}),cn(p,{onAnyChange(k){m(),v()}}),cn(h,{onAnyChange(k){v()}}),cn(o,{onTablesChange(k){m(),v()},onInvalidated(k){m(),v()}});const b=u.useMemo(()=>Gt.debounce(Gt.throttle(v,300),300),[]);u.useEffect(()=>{b()},[n]),u.useEffect(()=>{let k=null;if(a)for(let j=0;j<a.length&&!k;j++){const _=a[j],L=_.getRange().getCoords();$.CoordUtils.isCellWithinRange(c,L)&&(k=_)}f(k)},[c,a]);const w=Te(k=>{let j=null;if(a)for(let _=0;_<a.length;_++){const L=a[_],T=L.getRange().getCoords();let D=n.getRangeCoordsBounds(T);const C=n.getRelativePointFromClient(k.clientX,k.clientY),S=C.x,R=C.y;if(S>=D.x&&S<=D.x+D.width&&R>=D.y&&R<=D.y+D.height){const P=n.getViewportSize();S<=0||R<=0||S>=P.width||R>=P.height||(j=L)}}g(j)},[n,a]);if(u.useEffect(()=>{const k=n?.getStage();if(k&&a)return k.addEventListener("mousemove",w),k.addEventListener("mouseleave",w),()=>{k.removeEventListener("mousemove",w),k.removeEventListener("mouseleave",w)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const M=[];for(let k=0;k<a.length;k++){const j=a[k];if(j.isClosed())continue;const _=j===h,L=j===p,T=j.getRange().getCoords(),D=n.getRangeCoordsBounds(T);let C;if(_||L){const S=j.getStyle().getProperties(),R=S.headerRow?.fill?.background??S.wholeTable?.border?.top?.color?.toString();if(R&&o){const P=o.getStyles().parseColor(R);P&&(C=P.toCSS())}C||(C="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}M.push(s.jsx("div",{style:{position:"absolute",left:D.x,top:D.y,width:Math.min(16,D.width),height:D.height,pointerEvents:"all",cursor:kF},onMouseDown:x},`table-select-row-${j.getName()}`)),M.push(s.jsx("div",{style:{position:"absolute",left:D.x,top:D.y,width:Math.min(16,D.width),height:Math.min(16,D.height),pointerEvents:"all",cursor:EF},onMouseDown:y},`table-select-${j.getName()}`)),M.push(s.jsx(A2,{x:D.x,y:D.y,width:D.width,height:D.height,range:T,strokeWidth:L?.5:0,stroke:C??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:_?`${C} 0px 0px 1px 1px`:void 0}},`table-outline-${j.getName()}`))}return M})),TF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,animationTime:r=60}=e,[i,a]=u.useState(null),[l,c]=u.useState(null),d=u.useRef(null),p=Te(()=>{const x=o.getSelectedCell(),v=x.getSpill()?.getCoords()??null;Go.isEqualRanges(v,i)||(c(v?{transition:i?"move":"in",bounds:n.getRangeCoordsBounds(v),coords:v}:{transition:"out",bounds:n.getRangeCoordsBounds(i),coords:i}),a(v))},[o,n,i]);u.useEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),l&&(d.current=setTimeout(()=>{c(null),d.current=null},r)),()=>{d.current&&(clearTimeout(d.current),d.current=null)}),[l,r]);const f=u.useMemo(()=>Gt.debounce(Gt.throttle(p,80),80),[]);if(cn(o?.getSelection(),{onChange(x){f()}}),cn(o,{onSpillsChange(x){p()},onInvalidated(x){p()}}),!n||!i&&!l)return null;const h=o.getRange(i).getValue()instanceof $.FormulaError.Spill,g=[];let m=l?.bounds??n.getRangeCoordsBounds(i);if(l&&!Gt.isEqualBounds(l.bounds,n.getRangeCoordsBounds(l.coords))&&c(null),m=n.toClipBounds(m,-10),!m)return;const y="var(--sxl-app-color-primary-dark, rgba(0,0,0,.15))";return g.push(s.jsx(A2,{x:m.x,y:m.y,width:m.width,height:m.height,range:i,strokeWidth:1,stroke:y,style:{willChange:"transform, opacity, width, height, opacity, left, top",strokeDasharray:h?"6 3":void 0,opacity:l?.transition==="out"?0:1,transition:l?.transition?l.transition==="in"||l.transition==="out"?`opacity ${1.5*r}ms ease-in-out`:`left ${r}ms ease-out, top ${r}ms ease-out, width ${r}ms ease-out, height ${r}ms ease-out`:"none",boxShadow:`${y} 0px 0px 4px 0px`}},"spill-outline}")),g})),_F={position:"absolute",top:0,left:0,bottom:0,right:0},gg=(e,t)=>{const n={...e},o=t?.getNormal().getFont(),r=o?.toCSS(),i={text:{fontFamily:r?.fontFamily,fontSize:o?.getSize()}},a=n.body=Gt.mergeContentful(e.body,i);return n.body=Gt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=Gt.mergeContentful({fill:"#fff",text:{fill:"black"},edgeStrokeFill:"black"},n.buttonSurface),n.selection={fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#217346",strokeWidth:2,...e.selection},n.selectionInactive={...n.selection,fill:"rgba(16, 124, 65, 0.1)",strokeFill:"#dad8d6",...e.selectionInactive},n.selectionRemove={...n.selection,fill:"rgba(200, 0, 0, 0.1)",strokeFill:"rgba(200, 0, 0, 1)",...e.selectionRemove},n.headerSelection={...n.selection,...e.headerSelection},n.headerSelectionInactive={...n.selectionInactive,...e.headerSelectionInactive},n.header=Gt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Gt.mergeContentful(n.header,i),n.headerSelect=Gt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Gt.mergeContentful(n.headerSelect,i),n.headerSelectAll=Gt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Gt.mergeContentful(n.headerSelectAll,i),n},jF={fireOnModelChange:!1},yg={},rS=u.memo(u.forwardRef((e,t)=>{const{sheet:n,gridStyle:o=yg,headersStyle:r=yg,onSheetContextMenu:i,showColumnHeaders:a,columnHeaderProps:l,showRowHeaders:c,rowHeaderProps:d,showScrollbars:p=!0,scrollPaneProps:f,onViewportChange:h,commands:g,onRepeatCommandChange:m,onMoveCell:y,overlays:x,renderMovable:v,viewportComponent:b,onElementLoad:w,getCellEditor:M,onFocus:k,onBlur:j,style:_=jn.EmptyCssProperties,notifier:L,onShowTooltip:T,onShowColumnTooltip:D,onShowRowTooltip:C,onCloseTooltip:S,gridProps:R,cellRenderProps:P,...I}=e;if(u.useEffect(()=>{$.LicenseManager._validate(!0)},[]),!n)throw new Error("ISheet must be provided.");const[z,A]=u.useReducer(Ze=>Ze+1,0),[O,{width:N,height:F}]=Wl(),E=Te(T,[T]),B=Te(D,[D]),H=Te(C,[C]),U=Te(S,[S]),Z=u.useRef(!1);u.useLayoutEffect(()=>{Z.current=!0},[n]);const G=n?.getStyles(),V=u.useMemo(()=>gg(o,G),[o,G]),le=u.useMemo(()=>gg(r,G),[r,G]),{body:re={},buttonSurface:ge={}}=V,{header:Q={},headerSelect:xe={},headerSelectAll:be={}}=le,Fe=u.useRef(null),[ee,ae]=u.useState(()=>n?.getView()),we=(ee?.getZoomScale()??100)/100,se=u.useMemo(()=>({vertical:ee.isShowColumnGridlines()&&we>=.4,horizontal:ee.isShowRowGridlines()&&we>=.4}),[ee?.isShowColumnGridlines(),ee?.isShowRowGridlines(),we]),J=u.useMemo(()=>{if(ee?.getGridLineColor())return{strokeDasharray:"1,1"}},[ee?.getGridLineColor(),V]),ce=a??ee?.isShowColumnHeaders(),ne=c??ee?.isShowRowHeaders(),[Pe,Ee]=u.useState({width:0,height:0}),it=u.useMemo(()=>{let Ze=40,ve=20;const St=n?.getStyles().getNormal().getFont();if(Pe.width>0&&Pe.height>0){const q=St?.toCSS()?.fontFamily??V.header.text.fontFamily,Ce=St?.getSize()??V.header.text.fontSize,Y=$.IFont.getSharedMeasurer()(""+Pe.height,Math.ceil(Ce*$.IFont.getDeviceScale()),q);Ze=Y.width,ve=Y.lineHeight}return{width:Math.round(Ze+5),height:Math.round(ve+3)}},[Pe,V?.header.text,n]),Ue=ne?we*it.width:Q.edgeStrokeWidth,ke=ce?we*it.height:Q.edgeStrokeWidth,_e=Math.max(N,(n?.getColumnHeaders().getDefaultSize()??it.width)+Ue+1),Xe=Math.max(F,(n?.getRowHeaders().getDefaultSize()??it.height)+ke+1),Be=u.useRef(new Map),ct=u.useRef(null),et=()=>({getColOffset:Ze=>n.getColumnHeaders().findOffset(Ze),getColIndex:Ze=>n.getColumnHeaders().findIndex(Ze),getRowOffset:Ze=>n.getRowHeaders().findOffset(Ze),getRowIndex:Ze=>n.getRowHeaders().findIndex(Ze)}),[he,Ye]=u.useState(()=>et()),[Se,Ie]=u.useState(!1),[de,Oe]=u.useState(null),Le=!0,je=V.selection?.strokeFill,K=u.useCallback(()=>pr.current,[]),[W,te]=u.useState(),oe=Te(Ze=>{te(Ze),n&&n.getView()&&n.getView().setTopLeft(Ze?{left:Ze.left,top:Ze.top}:null),h?.(Ze)},[n,h]),ue=u.useRef(null);u.useEffect(()=>{if(!W||!n)return;const Ze=n.getRangeAtBounds({x:W.left,y:W.top,width:W.width,height:W.height});ue.current?.(),ue.current=Ze.addListener(()=>{const ve=Ze.getCoords();Fe?.current?.invalidate(ve)})},[W,n]);const[ie,pe]=u.useState(()=>n?.getView().getTopLeft()),fe=Te(Ze=>{const ve=Go.cellToRange(Ze);if(n.isClosed())return ve;const St=n.getRange(ve,{excludeHidden:!0}).getMerges();return St.length===0?ve:St[0]},[n]),ye=Ze=>{if(!Ze||Ze.coords.colIndex===0&&Ze.coords.rowIndex===0)return null;const ve={};return Ze.coords.colIndex>0&&(ve[zo.Left]={index:Ze.coords.colIndex,scrollOffset:Ze.topLeft.left}),Ze.coords.rowIndex>0&&(ve[zo.Top]={index:Ze.coords.rowIndex,scrollOffset:Ze.topLeft.top}),ve},[De,Ve]=u.useState(()=>ye(n.getView().getFreezePanes())),Je=Wi(),ot=u.useCallback(()=>Fe.current,[]),tt=Te(Ze=>{Je.setMode(ve=>ve?.key==="edit"?{...ve,args:{...ve.args}}:{key:"edit",args:{stateAndCoords:null,start:Ze}})},[]),Lt=Te(()=>W,[W]),At=function(Ze){const{sheet:ve,onRepeatCommandChange:St,bodyStyle:q,commands:Ce,target:Y,notifier:me,onStartEdit:qe,getViewport:mt}=Ze,[Ke,Wt]=u.useState(null),[Mt,Bt]=u.useState(null),Ut=u.useRef(null),mn=Te(qe,[qe]),Vt=Te(mt,[mt]),[Nt,io]=u.useState(),[Ct,ln]=u.useState(()=>ve?.getStyles().parseColor($.IColor.Scheme.Bg2)),[go,pn]=u.useState(()=>ve?.getStyles().getNormal().getFont().getFill()),qt=Wi();u.useRef(qt.getMode()).current=qt.getMode();const vo=hb(),[Bo,Zl]=u.useState(Gt.EmptyArray),Xl=u.useCallback(()=>{if(Ut.current!==ve)return;const Me=ve.getSelectedRanges();let nt=null;Bo.length>0&&Go.isCellWithinRange(Ke,Bo[0].getRange().getCoords())&&(nt=Bo[0]);const dt=ve?.getSelectedCell(),He=dt?.getCoords()??null;yo.unstable_batchedUpdates(()=>{q2(nt),Wt(He),Bt(Me)})},[ve,Bo,Mt,Ke]),U2=u.useCallback(Gt.debounce(Xl,210),[Xl]);u.useEffect(()=>{Ut.current=ve,Xl()},[ve]);const ar=Te(()=>ve.getRange(Ke).getCell(),[ve,Ke]),wo=Te(async(Me,nt,dt=null,He=!1,ht=!0)=>{const bt=Me?.label?.(),bn=async()=>{const hn=await Promise.resolve(ht&&me?.showBusy?.(bt??"Busy..."));try{await ve.doBatch(async()=>nt(ve),bt),He&&qt.setMode(null),hn&&hn()}catch(ao){if(hn&&hn(),!ao)return;me?.showError?.(ao)}},vn=[];let sn=!1;const kn=async()=>(vn.push(bn),(async()=>{if(!sn){for(sn=!0;vn.length>0;){const hn=vn.shift();hn&&await hn()}sn=!1}})());if(St){let hn=null;if(dt!==!1&&Me){const ao=dt??bt;hn=new Tt(Me.key(),Y,{label:ao,description:ao},kn)}St(hn)}return kn()},[ve,St,me]),Xt=Te((Me,nt,dt=!1,He)=>wo(Me,ht=>{const bt=ht.getSelectedRanges();dt&&bt.updateStyle(null,He),bt.updateStyle(nt,He),bt.autoFit({expandOnly:$.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[ve]),Yf=Te((Me,nt,dt)=>{wo(Me,He=>{let ht=nt;(dt||nt?.address)&&(ht=ht??{},!dt&&nt?.address?.startsWith("#")?dt=nt?.address.substring(1):dt&&(ht.displayText=dt)),He.getSelectedRange().setHyperlink(ht)})},[ve]),Jf=Te((Me,nt)=>{wo(Me,dt=>{dt.getSelectedRange().setComments(nt)})},[ve]),p0=Te((Me,nt)=>{wo(Me,dt=>{dt.getSelectedRanges().clear(nt)})},[ve]),il=Te(async(Me,nt,dt=!1,He=!1)=>wo(Me,async ht=>{let bt=ht.getSelectedRanges();dt&&(nt===$.IRange.Orientation.Row?bt=bt.getEntireRows(He):nt===$.IRange.Orientation.Column&&(bt=bt.getEntireColumns(He)));let bn=null;const vn=qt.getMode()?.key;if(vn==="copy"||vn==="cut"){const sn=await vo.getClipboard().readReference();sn&&sn.getItemType()==="range"&&(bn=sn.getItem(),bn.getCoords()||(bn=null))}if(bn){const sn=await bt.insertFrom(bn,{...bn.getMarkOptions(),orientation:nt,autoSelect:!0});!sn||sn.isEntireRows()||sn.isEntireColumns()||sn.autoFit({orientations:$.IRange.Orientations.Row,minContent:!0}),qt.setMode(null)}else bt.insert(nt,{autoSelect:!0})},"Insert Cells",!1),[qt]),[fa,q2]=u.useState(null),NC=Te(Me=>ve.getStyles().setDefaultTableStyle(Me),[ve]),$C=Te(Me=>{ve.getStyles().getTableStyle(Me)?.delete()},[ve]),h0=Te((Me,nt)=>{wo(Me,async dt=>{const He=dt.getSelectedRange(),ht=dt.getSelectedCell().getCoords();let bt=null,bn=0;const vn=ht.rowIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex}).getExtended($.IRange.Direction.Up):null;vn&&dt.getRange({colStart:ht.colIndex,rowStart:vn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:vn.getCoords().rowStart}).isContentful()&&(bt=$.IRange.Direction.Up,bn=ht.rowIndex-vn.getCoords().rowEnd);const sn=ht.colIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex-1}).getExtended($.IRange.Direction.Left):null;if(sn&&dt.getRange({colStart:sn.getCoords().colStart,rowStart:ht.rowIndex,colEnd:sn.getCoords().colStart,rowEnd:ht.rowIndex}).isContentful()){const hn=ht.colIndex-sn.getCoords().colEnd;(hn<bn||!bt)&&(bt=$.IRange.Direction.Left,bn=hn)}let kn=null;if(bt===$.IRange.Direction.Up){if(kn={...vn.getCoords()},(kn.rowEnd===ht.rowIndex||!dt.getRange({colIndex:ht.colIndex,rowIndex:ht.rowIndex-1}).isContentful())&&kn.rowStart>0&&dt.getRange({colIndex:ht.colIndex,rowIndex:kn.rowStart-1}).isContentful()){const hn=vn.getExtended($.IRange.Direction.Up);kn={colStart:ht.colIndex,rowStart:hn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:vn.getCoords().rowEnd}}kn.rowEnd=ht.rowIndex-1}else if(bt===$.IRange.Direction.Left){if(kn={...sn.getCoords()},(kn.colEnd===ht.colIndex||!dt.getRange({colIndex:ht.colIndex-1,rowIndex:ht.rowIndex}).isContentful())&&kn.colStart>0&&dt.getRange({colIndex:kn.colStart-1,rowIndex:ht.rowIndex}).isContentful()){const hn=sn.getExtended($.IRange.Direction.Left);kn={colStart:hn.getCoords().colStart,rowStart:ht.rowIndex,colEnd:hn.getCoords().colEnd,rowEnd:ht.rowIndex}}kn.colEnd=ht.colIndex-1}if(He.size!==1&&bt){const hn=He.getCoords(),ao=He.startIncrementalUpdates({orientation:$.IRange.Orientation.Column}),jo={...kn},wr=hn.rowStart,Ai=hn.rowEnd,Li=hn.colStart,zi=hn.colEnd,Nr=bt===$.IRange.Direction.Up;for(let fr=Li;fr<=zi;fr++){jo.colStart=Nr?fr:kn.colStart+(fr-Li),jo.colEnd=Nr?fr:kn.colEnd+(fr-Li);for(let No=wr;No<=Ai;No++){jo.rowStart=Nr?kn.rowStart+(No-wr):No,jo.rowEnd=Nr?kn.rowEnd+(No-wr):No;const hi=dt.getRange(jo).toString();ao.pushAt(No,fr,`=${nt}(${hi})`)}}ao.apply()}else{const hn=kn?dt.getRange(kn).toString():"",ao=`=${nt}(`;mn?.({text:`${ao}${hn})`,editMode:!0,initialSelection:{start:ao.length,end:ao.length+hn.length}})}},!1)},[ve]),R1=Te((Me,nt,dt=!1,He=!0)=>{wo(Me,async ht=>{let bt=null;if(fa)return void fa.updateStyleOptions(nt);{const sn=ht.getSelectedRanges().getFixed(!0),kn=ht.getSelectedRange().getDefaultSortCriteria();let hn={ranges:sn,hasHeader:kn?.options?.hasHeader??!1};bt=He?new Promise((ao,jo)=>{const wr={tableOptions:hn,onCancel:()=>{jo()},onDone:Ai=>{ao(Ai)},context:{getNames:()=>ht.getNames()}};me.showWindow?.("tableNew",wr)}):{option:"Ok",tableOptions:hn}}const bn=await Promise.resolve(bt);if(bn?.option!=="Ok")throw null;const vn=await Promise.resolve(me?.showBusy?.(Me.label()));try{await ht.getTables().add(bn.tableOptions.ranges.at(0),{styleName:nt?.name,clearFormatting:dt,hasHeader:bn.tableOptions.hasHeader}).getRange().select()}catch(sn){vn(),me?.showError?.(sn)}vn()},!1,!0,!1)},[fa]),Qf=Te(()=>q,[q]),em=Te(Me=>({styles:()=>ve.getStyles(),table:()=>Me,bodyStyle:Qf,getNames:()=>ve.getNames()}),[ve]),VC=Te(async(Me,nt,dt,He=!0)=>{let ht=null;if(!nt){let bt=ve.getSelectedRange();bt.size===1&&(bt=bt.getSurrounding());let bn=ve.getTables().search({address:ve.getSelectedRange()});bn.length>0&&(nt=bn[0]),await bt.select()}if(nt){if(He){try{dt&&await nt.select()}catch{}ht=new Promise(async(bt,bn)=>{Me.update({context:em(nt)});const vn={command:Me,commands:Re,notifier:me,onDone:kn=>{bt(kn)}},sn=await me.showWindow?.("tableDetails",vn,{disableAutoDestroy:!0});setTimeout(()=>{sn.focus()},180)})}Promise.resolve(ht).then(bt=>{},bt=>{me?.showError?.(bt)})}},[me]),tm=Te(async(Me,nt,dt=!1)=>{let He=null;if(nt)nt.isITable?He=nt:nt.getValue()&&(He=nt.getValue());else{const ht=ve.getTables().search({address:ve.getSelectedRange()});ht.length>0&&(He=ht[0])}if(He){if(!dt){const ht=He.getRange().getCoords(),bt=(ht.colEnd-ht.colStart+1)*(ht.rowEnd-ht.rowStart+1);if(bt>1e4&&await me?.showOptions({title:"Confirm",description:`Converting a table to range with '${bt}' cells will set a large number of cell styles and may affect performance.
199
199
  Continue?`,options:["Convert","Cancel"],defaultOption:"Convert"})!=="Convert")return}wo(Me,async()=>{dt?He.delete():He.convertToRange()},!1,!0)}},[me]),K2=Te((Me,nt,dt)=>{wo(Me,async He=>{let ht=He.getSelectedRanges();if(ht.getCount()>1)throw new Error("Can not sort on multiple cell ranges. Please select a single range and try again.");let bt=ht.at(0);bt.size===1&&(bt=bt.getSurrounding());const bn=He.getSelection().getCoords().cell;let vn=bt.getDefaultSortCriteria($.IRange.Orientation.Row,bn);if(!vn){if(dt)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let sn=vn.options;if(dt&&(sn=new Promise((hn,ao)=>{const jo={range:bt,options:vn.options,cell:bn,onCancel:()=>{ao()},onDone:wr=>{wr?hn(wr.options):ao()}};me.showWindow?.("sort",jo)})),sn=await Promise.resolve(sn),!sn)return;const kn=await Promise.resolve(me?.showBusy?.(Me.label()));try{bt.doBatch(()=>{const hn={...sn,...nt};bt.sort(hn),bt.autoFit({orientations:hn?.orientation===$.IRange.Orientation.Column?$.IRange.Orientations.Column:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},Me?.label?.())}catch(hn){kn(),me?.showError?.(hn)}kn()},!1,!1,!1)},[me]),HC=Te(()=>{console.log("compactedSelection");const Me=ve.getSelection().getCoords(),nt=ve.getSelectedRanges().getFlattened().getCoords(),dt=(()=>{const bt=new Blob(["console.log('hello from worker');"],{type:"application/javascript"}),bn=URL.createObjectURL(bt),vn=new Worker(bn);return URL.revokeObjectURL(bn),vn})();setTimeout(()=>{dt.terminate(),console.log("Worker terminated")},5e3);let He=-1;for(let bt=0;He===-1&&bt<nt.length;bt++)Go.isCellWithinRange(Me.cell,nt[bt])&&(He=bt);if(Go.isEqualRangesArrays(Me.ranges,nt))return;const ht={cell:Me.cell,ranges:nt,rangeIndex:He};ve.getSelection().updateCoords(ht)},[ve]),WC=Te(()=>{console.log("selectComments")},[ve]),nm=Te(async(Me=!1,nt=!1)=>{let dt=null;if(nt)dt=ve.getEntireRange();else{const He=ve.getSelectedRange();if(He.isEntireRange()){const ht=ve.getSelection().getCoords().cell,bt=ve.getRange(ht);dt=bt.getSurrounding(),dt.isEntireRange()&&(dt=bt)}else dt=He.getSurrounding({contentOnly:Me})}dt&&await dt.select()},[ve]),f0=Te((Me,nt,dt)=>{wo(Me,async He=>{let ht=He.getSelectedRanges();dt&&(nt===$.IRange.Orientation.Row?ht=ht.getEntireRows():nt===$.IRange.Orientation.Column&&(ht=ht.getEntireColumns())),ht.delete(nt)},"Delete Cells")},[ve]);Te(async Me=>{let nt=null;const dt=Vt(),He=Math.min(dt.width-8,480),ht=Math.min(dt.height-8,288);try{ve.getSelectedRanges(),nt=await ve.getMovables().add({bounds:{x:dt.left+(dt.width-He)/2,y:dt.top+(dt.height-ht)/2,width:He,height:ht},type:"chart",json:Me.template}),nt.select(),qt.setMode(null)}catch(bt){me?.showError?.(bt)}return nt},[ve,me]);const om=Te(async(Me,nt,dt)=>{const He=await me?.showBusy?.(Me.label());try{const ht=await ve.getMovables().addImage(nt,{autoSelect:!0,...dt});return He(),qt.setMode(null),ht}catch(ht){He();let bt=ht;typeof bt!="string"&&(console.warn(ht),bt="Unable to resolve image."),me?.showMessage?.(bt,{type:pa.Error})}},[ve,me]),I1=Te((Me,nt)=>{wo(Me,async dt=>{const He=dt.getSelectedRanges();He.doBatch(()=>{const ht=nt===$.IRange.Direction.Up||nt===$.IRange.Direction.Down,bt=He.getCoords().slice().sort(Go.createRangeComparator(ht?$.IRange.Orientation.Row:$.IRange.Orientation.Column));for(let bn=0;bn<bt.length;bn++){const vn=bt[bn];let sn=vn;const kn=dt.getRange(sn).getMerges();let hn=0,ao=0;if(kn.length>0){const jo=kn[0];hn=jo.rowEnd-jo.rowStart,ao=jo.colEnd-jo.colStart}nt===$.IRange.Direction.Left?sn={...vn,colStart:vn.colEnd+ao}:nt===$.IRange.Direction.Right?sn={...vn,colEnd:vn.colStart+ao}:nt===$.IRange.Direction.Up?sn={...vn,rowStart:vn.rowEnd+hn}:nt===$.IRange.Direction.Down&&(sn={...vn,rowEnd:vn.rowStart+hn}),dt.getRange(sn).autoFill(vn,{filler:$.AutoFill.Types.Copy}),dt.getRange(vn).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:Me.label()})})},[me]),UC=Te(()=>{let Me=null;const nt=ve.getSelectedCell().getCoords();if(nt?.rowIndex>0){const dt=ve.getRange({rowIndex:nt.rowIndex-1,colIndex:nt.colIndex}).getCell();dt&&(Me=dt.toTextUnformatted(!0))}mn?.({text:Me})},[ve]),[m0,qC]=u.useReducer(Me=>Me+1,0),[P1,Yl]=u.useReducer(Me=>Me+1,0),rm=u.useMemo(()=>[new We("gridlinesToggle",Y,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new We("sheetViewToggleGridlinesRows",Y,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new We("sheetViewToggleGridlinesColumns",Y,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new We("sheetViewFormatGridlinesColor",Y,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new We("sheetViewToggleShowHeadings",Y,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new We("sheetViewToggleShowHeadingRows",Y,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new We("sheetViewToggleShowHeadingColumns",Y,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new We("sheetViewToggleShowHeadingsNumeric",Y,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[$e.Ctrl,$e.Shift]}}),new We("sheetViewToggleFormulaView",Y,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[$e.Ctrl]},{key:"`",modifiers:[$e.Ctrl,$e.Shift]}]}),new We("sheetViewToggleShowZeros",Y,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new Tt("selectComments",Y,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[$e.Ctrl,$e.Shift]}},()=>WC()),new We("selectAll",Y,{label:"Select All",description:"Select the closest data or the entire sheet if no data is nearby.",shortcut:[{key:"A",modifiers:[$e.Ctrl]},{key:"Space",modifiers:[$e.Ctrl,$e.Shift]}]},(Me=!1)=>nm(!1,Me)),new Tt("selectRegion",Y,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[$e.Ctrl,$e.Shift]}},()=>nm(!0,!1)),new Tt("breakSelection",Y,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl,$e.Alt]}},()=>HC()),new Tt("formatTextRotate0",Y,{label:"No Text Rotation",description:"Remove all text rotation."}),new Tt("formatTextRotate45",Y,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new Tt("formatTextRotate90",Y,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new Tt("formatTextRotate270",Y,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new Tt("formatTextRotate315",Y,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new We("formatTextRotateCustom",Y,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new Tt("formatTextRotateVertical",Y,{label:"Vertical Text",description:"Stack text vertically."}),new Tt("sortAscending",Y,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){K2(this,{reverse:!1},!1)}),new Tt("sortDescending",Y,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){K2(this,{reverse:!0},!1)}),new Tt("sortCustom",Y,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){K2(this,{},!0)}),new We("protectionSheetToggle",Y,{label:"Protect Sheet",scopedLabels:{sheet:"Protected"},description:`Prevent unwanted changes from others by limiting their ability to edit.
200
200
  For example, you can prevent people from editing locked cells or making formatting changes.`}),new We("formatSheetTabColor",Y,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new We("formatCellStyle",Y,{label:"Cell Styles",scopedLabels:{cellStyle:"Apply"},description:"A colorful style is a great way to make important data stand out on the sheet."},function(Me){Xt(this,{named:Me.getName()},!0)}),new We("formatTableStyle",Y,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(Me){R1(this,Me)}),new We("formatTableStyleClearCellStyles",Y,{label:"Format as Table (Clear Styles)",scopedLabels:{table:"Apply (Clear Styles)"},description:"Create a table or apply style to the current table and clears all cell styles."},function(Me){R1(this,Me,!0)}),new We("formatTableStyleClearTableStyle",Y,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){R1(this,{name:null},!0)}),new We("setDefaultTableStyle",Y,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},NC),new We("deleteTableStyle",Y,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},$C),new We("formatBorder",Y,{label:"Border",description:"Create an outline border."},function(Me){Xt(this,{border:Me})}),new We("formatFillColor",Y,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(Me){Xt(this,{fill:Me})}),new We("formatFontColor",Y,{label:"Font Color",description:"Change the color of your text."},function(Me){Xt(this,{font:{fill:Me}})}),new We("formatBoldToggle",Y,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[$e.Ctrl]},{key:"2",modifiers:[$e.Ctrl]}]}),new We("formatItalicToggle",Y,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[$e.Ctrl]},{key:"3",modifiers:[$e.Ctrl]}]}),new We("formatUnderlinedToggle",Y,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[$e.Ctrl]},{key:"4",modifiers:[$e.Ctrl]}]}),new We("formatUnderlinedDoubleToggle",Y,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new We("formatUnderlinedAccountingToggle",Y,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new We("formatUnderlinedAccountingDoubleToggle",Y,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new We("formatStrikeThroughToggle",Y,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[$e.Ctrl]}}),new We("formatSuperscriptToggle",Y,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new We("formatSubscriptToggle",Y,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new We("formatAlignTopToggle",Y,{label:"Align Top",description:"Align text to the top."}),new We("formatTextOverflowVisibleToggle",Y,{label:"Overflow Text",description:"Overflow text to the next cells."}),new We("formatTextOverflowWrapToggle",Y,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new We("formatTextOverflowClipToggle",Y,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new We("formatTextOverflowShrinkToggle",Y,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new We("formatTextOverflowEllipsisToggle",Y,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new We("formatAlignMiddleToggle",Y,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new We("formatAlignBottomToggle",Y,{label:"Align Bottom",description:"Align text to the bottom."}),new We("formatAlignJustifyVerticalToggle",Y,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new We("formatAlignDistributedVerticalToggle",Y,{label:"Distribute Vertically",description:"Justify your content vertically."}),new We("formatAlignLeftToggle",Y,{label:"Align Left",description:"Align your content to the left."}),new We("formatAlignCenterToggle",Y,{label:"Align Center",description:"Center your content."}),new We("formatAlignRightToggle",Y,{label:"Align Right",description:"Align your content to the right."}),new We("formatAlignJustifyToggle",Y,{label:"Align Justify",description:"Justify your content."}),new We("formatAlignCenterContinuousToggle",Y,{label:"Center Across",description:"Center your content across multiple cells."}),new We("formatAlignFillToggle",Y,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new We("formatAlignDistributedHorizontalToggle",Y,{label:"Distribute Horizontally",description:"Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell."}),new Tt("formatFontSizeIncrease",Y,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,Me=>({font:{size:Fh(Me.getFont().getSize(),!0)}}))}),new Tt("formatFontSizeDecrease",Y,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,Me=>({font:{size:Fh(Me.getFont().getSize(),!1)}}))}),new We("formatFontFamily",Y,{label:"Font",description:"Select the font your text."},function(Me){Xt(this,{font:{family:Me}})}),new We("formatFontSize",Y,{label:"Font Size",description:"Change the size of your text."},function(Me){Xt(this,{font:{size:Me}})}),new We("formatNumberDialog",Y,{label:"Custom Number Format",scopedLabels:{numberFormat:"Custom"},description:"Create a custom number format.",shortcut:[{key:"1",modifiers:[$e.Ctrl]},{key:"1",modifiers:[$e.Ctrl,$e.Alt]}]},function(Me,nt){const dt=this,He={initialValue:Me??nt.state(),context:nt.context(),onInputOption:(ht,bt)=>{Xt(dt,{numberFormat:ht})}};me.showWindow?.("numberFormat",He)}),new We("formatNumberFormat",Y,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(Me){Xt(this,{numberFormat:Me})}),new We("formatNumberFormatGeneralStyle",Y,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:$.NumberFormat.Type.General})}),new We("formatNumberFormatNumberStyle",Y,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:"#,##0.00"})}),new We("formatNumberFormatTimeStyle",Y,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:"h:mm AM/PM"})}),new We("formatNumberFormatDateStyle",Y,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:"d-mmm-yy"})}),new We("formatNumberFormatAccountingStyle",Y,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[$e.Ctrl,$e.Shift]}},function(Me){Xt(this,{numberFormat:Me??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new We("formatNumberFormatPercentStyle",Y,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:"0%"})}),new We("formatNumberFormatScientificStyle",Y,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[$e.Ctrl,$e.Shift]}},function(){Xt(this,{numberFormat:"0.00E+00"})}),new We("formatNumberFormatCommaStyle",Y,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[$e.Ctrl]}},function(){Xt(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new We("formatNumberFormatIncreaseDecimal",Y,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){Xt(this,Me=>({numberFormat:$.NumberFormat.Parser.adjustDecimalPlaces(Me.getNumberFormat(),1)}))}),new We("formatNumberFormatDecreaseDecimal",Y,{label:"Decrease Decimal",description:"Show few decimal places."},function(){Xt(this,Me=>({numberFormat:$.NumberFormat.Parser.adjustDecimalPlaces(Me.getNumberFormat(),-1)}))}),new We("displayPlaceholdersToggle",Y,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[$e.Ctrl]}}),new Tt("noOp",Y,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[$e.Ctrl]}},function(){}),new We("displayOutlineSymbolsToggle",Y,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[$e.Ctrl]}}),new We("hideRows",Y,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[$e.Ctrl]}}),new We("unhideRows",Y,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[$e.Ctrl,$e.Shift]}}),new We("hideColumns",Y,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[$e.Ctrl]},{key:"0",modifiers:[$e.Ctrl,$e.Alt]}]}),new We("unhideColumns",Y,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[$e.Ctrl,$e.Shift]}}),new We("quickFormulaSum",Y,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[$e.Alt]}},function(){h0(this,"SUM")}),new We("quickFormulaAverage",Y,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){h0(this,"AVERAGE")}),new We("quickFormulaCount",Y,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){h0(this,"COUNT")}),new We("quickFormulaMax",Y,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){h0(this,"MAX")}),new We("quickFormulaMin",Y,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){h0(this,"MIN")}),new We("startEditCurrentTime",Y,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl,$e.Shift]}},function(){mn?.({text:ve.createTemporaryCell({value:t1(),style:{numberFormat:"Medium Time"}}).toText()})}),new We("startEditCurrentDate",Y,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl]}},function(){mn?.({text:ve.createTemporaryCell({value:t1(),style:{numberFormat:"Short Date"}}).toText()})}),new Tt("sheetZoomOut",Y,{label:"Zoom Out",description:"Zoom out to see less detail but more area.",shortcut:[{key:"-",modifiers:[$e.Ctrl,$e.Alt]},{key:"NumpadSubtract",modifiers:[$e.Ctrl,$e.Alt]}]}),new Tt("sheetZoomIn",Y,{label:"Zoom In",description:"Zoom in to see more detail but less area.",shortcut:[{key:"=",modifiers:[$e.Ctrl,$e.Alt]},{key:"NumpadAdd",modifiers:[$e.Ctrl,$e.Alt]}]}),new Tt("sheetZoom100",Y,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[$e.Ctrl,$e.Alt]}}),new We("insertFunction",Y,{label:"Insert Function",disabled:!0,scopedLabels:{insert:"Function",quickFormula:"More Functions..."},description:"Work with the formula in the current cell.",shortcut:{key:"F3",modifiers:[$e.Shift]}},function(Me,nt){console.log("insertFunction")}),new We("updateHyperlink",Y,{label:"Link",scopedLabels:{contextMenu:"Insert Link…",insert:"Link…",hyperlink:"Edit"},description:"Create a hyperlink to either another webpage or another location within this document.",context:()=>ar,shortcut:[{key:"K",modifiers:[$e.Ctrl]},{key:"K",modifiers:[$e.Ctrl,$e.Alt]}]},async function(Me,nt){const dt=this,He={context:nt.context(),onUpdateHyperlink:(ht,bt)=>{Yf(dt,ht,bt)}};me.showWindow?.("hyperlink",He)}),new We("openHyperlink",Y,{label:"Open Link",scopedLabels:{hyperlink:"Open"},shortcut:{key:"Enter",modifiers:[$e.Ctrl]},description:"Open the hyperlink or goto another location within this document.",context:()=>ar},async(Me,nt)=>{const dt=nt.context()();if(!dt)return;const He=dt.getHyperlink();if(He)try{await He.open()}catch(ht){me?.showError?.(ht)}}),new We("deleteHyperlink",Y,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>ar},function(Me,nt){Yf(this,null,null)}),new Tt("insertNote",Y,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[$e.Shift]},description:"Add a note to the cell."},(Me,nt)=>{var dt,He;dt=me,He=nt.label(),dt?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[He," is not yet implemented.",s.jsx("br",{}),s.jsx("br",{}),"Please see the ",s.jsx("a",{style:{whiteSpace:"nowrap"},href:"https://www.sheetxl.com/docs/introduction/roadmap",target:"_blank",rel:"noopener",children:"SheetXL Roadmap"}),"."]}))}),new We("updateComments",Y,{label:"Comments",scopedLabels:{contextMenu:"Insert Comments…",insert:"Comments…"},shortcut:{key:"M",modifiers:[$e.Ctrl,$e.Alt]},description:"Add a comment to the current cell.",context:()=>ar},async function(Me,nt){const dt=this,He={context:nt.context(),onUpdateComments:ht=>{Jf(dt,ht)}};me.showWindow?.("comments",He)}),new We("deleteComments",Y,{label:"Delete Comments",description:"Remove any comments.",context:()=>ar},function(Me,nt){Jf(this,null)}),new We("insertImageFromFile",Y,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(Me=null){let nt=null,dt=null;typeof Me=="string"?dt=Me:nt=Me?.file?Me.file:Me,(nt||(nt=await Gt.openFileDialog(dt??"image/*"),nt))&&await om(this,{file:nt},Me?.options)}),new We("insertImageFromURL",Y,{label:"Insert Image From Web",scopedLabels:{insert:"Image From Web",insertImage:"From the Web…"},description:"Insert a picture from the web."},async function(Me){if(!Me){const nt=await me?.showInputOptions?.({title:"Insert Image from Web",description:"Enter the web address for the image to insert.",inputLabel:"Address",initialValue:"https://picsum.photos/360",inputProps:{style:{minWidth:"440px"}},options:["Insert"]});if(nt.option!=="Insert")return;Me=nt.input}Me&&om(this,{fetch:Me})}),new Tt("insertTable",Y,{label:"Insert Table",scopedLabels:{contextMenu:"Insert Table…",insert:"Table"},description:"Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.",shortcut:[{key:"L",modifiers:[$e.Ctrl]},{key:"T",modifiers:[$e.Alt,$e.Ctrl]}]},function(){R1(this)}),new We("editTable",Y,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(Me){let nt=null,dt=!1;Me.isITable?nt=Me:Me.getValue()&&(nt=Me.getValue(),dt=!0),VC(this,nt,dt)}),new We("deleteTable",Y,{label:"Delete Table",scopedLabels:{delete:"Table",table:"Delete",namedItem:"Delete"},description:`Remove the table.
201
201
 
@@ -209,18 +209,18 @@ All contents and formatting are removed.`,shortcut:{key:"Delete",modifiers:[$e.C
209
209
  To pick up a draggable item, press the space bar.
210
210
  While dragging, use the arrow keys to move the item.
211
211
  Press space again to drop the item in its new position, or press escape to cancel.
212
- `},FF={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function BF(e){let{announcements:t=FF,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=zF}=e;const{announce:i,announcement:a}=function(){const[f,h]=u.useState("");return{announce:u.useCallback(g=>{g!=null&&h(g)},[]),announcement:f}}(),l=n1("DndLiveRegion"),[c,d]=u.useState(!1);if(u.useEffect(()=>{d(!0)},[]),function(f){const h=u.useContext(sS);u.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(f)},[f,h])}(u.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;i(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;i(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const p=u.createElement(u.Fragment,null,u.createElement(AF,{id:o,value:r.draggable}),u.createElement(LF,{id:l,announcement:a}));return n?yo.createPortal(p,n):p}var or;function Zu(){}function r5(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(or||(or={}));const Ui=Object.freeze({x:0,y:0});function cS(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function NF(e,t){const n=Gu(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function dS(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function $F(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function vg(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function uS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function wg(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const VF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=wg(t,t.left,t.top),i=[];for(const a of o){const{id:l}=a,c=n.get(l);if(c){const d=cS(wg(c),r);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(dS)};function HF(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-o,l=i-n;if(o<r&&n<i){const c=t.width*t.height,d=e.width*e.height,p=a*l;return Number((p/(c+d-p)).toFixed(4))}return 0}const WF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:a}=i,l=n.get(a);if(l){const c=HF(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort($F)};function Sg(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ui}const UF=function(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return n.reduce((r,i)=>({...r,top:r.top+1*i.y,bottom:r.bottom+1*i.y,left:r.left+1*i.x,right:r.right+1*i.x}),{...e})}}();function pS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const qF={ignoreTransform:!1};function u0(e,t){t===void 0&&(t=qF);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:p}=Fr(e).getComputedStyle(e);d&&(n=function(f,h,g){const m=pS(h);if(!m)return f;const{scaleX:y,scaleY:x,x:v,y:b}=m,w=f.left-v-(1-y)*parseFloat(g),M=f.top-b-(1-x)*parseFloat(g.slice(g.indexOf(" ")+1)),k=y?f.width/y:f.width,j=x?f.height/x:f.height;return{width:k,height:j,top:M,right:w+k,bottom:M+j,left:w}}(n,d,p))}const{top:o,left:r,width:i,height:a,bottom:l,right:c}=n;return{top:o,left:r,width:i,height:a,bottom:l,right:c}}function Cg(e){return u0(e,{ignoreTransform:!0})}function N2(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(gf(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!j1(r)||aS(r)||n.includes(r))return n;const i=Fr(e).getComputedStyle(r);return r!==e&&function(c,d){d===void 0&&(d=Fr(c).getComputedStyle(c));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(f=>{const h=d[f];return typeof h=="string"&&p.test(h)})}(r,i)&&n.push(r),a=r,(l=i)===void 0&&(l=Fr(a).getComputedStyle(a)),l.position==="fixed"?n:o(r.parentNode);var a,l}(e):n}function hS(e){const[t]=N2(e,1);return t??null}function i5(e){return z2&&e?d0(e)?e:mf(e)?gf(e)||e===Js(e).scrollingElement?window:j1(e)?e:null:null:null}function fS(e){return d0(e)?e.scrollX:e.scrollLeft}function mS(e){return d0(e)?e.scrollY:e.scrollTop}function Bh(e){return{x:fS(e),y:mS(e)}}var sr;function gS(e){return!(!z2||!e)&&e===document.scrollingElement}function yS(e){const t={x:0,y:0},n=gS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sr||(sr={}));const KF={x:.2,y:.2};function GF(e,t,n,o,r){let{top:i,left:a,right:l,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=KF);const{isTop:d,isBottom:p,isLeft:f,isRight:h}=yS(e),g={x:0,y:0},m={x:0,y:0},y=t.height*r.y,x=t.width*r.x;return!d&&i<=t.top+y?(g.y=sr.Backward,m.y=o*Math.abs((t.top+y-i)/y)):!p&&c>=t.bottom-y&&(g.y=sr.Forward,m.y=o*Math.abs((t.bottom-y-c)/y)),!h&&l>=t.right-x?(g.x=sr.Forward,m.x=o*Math.abs((t.right-x-l)/x)):!f&&a<=t.left+x&&(g.x=sr.Backward,m.x=o*Math.abs((t.left+x-a)/x)),{direction:g,speed:m}}function ZF(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function xS(e){return e.reduce((t,n)=>ks(t,Bh(n)),Ui)}function bS(e,t){if(t===void 0&&(t=u0),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);hS(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const XF=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+fS(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+mS(n),0)}]];class Nh{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=N2(n),r=xS(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of XF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(o),p=r[i]-d;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Mc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function a5(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var xi,$n;function kg(e){e.preventDefault()}function YF(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xi||(xi={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}($n||($n={}));const vS={start:[$n.Space,$n.Enter],cancel:[$n.Esc],end:[$n.Space,$n.Enter,$n.Tab]},JF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $n.Right:return{...n,x:n.x+25};case $n.Left:return{...n,x:n.x-25};case $n.Down:return{...n,y:n.y+25};case $n.Up:return{...n,y:n.y-25}}};class yf{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Mc(Js(n)),this.windowListeners=new Mc(Fr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xi.Resize,this.handleCancel),this.windowListeners.add(xi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&bS(o),n(Ui)}handleKeyDown(t){if(B2(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=vS,coordinateGetter:a=JF,scrollBehavior:l="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:d}=o.current,p=d?{x:d.left,y:d.top}:Ui;this.referenceCoordinates||(this.referenceCoordinates=p);const f=a(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=o1(f,p),g={x:0,y:0},{scrollableAncestors:m}=o.current;for(const y of m){const x=t.code,{isTop:v,isRight:b,isLeft:w,isBottom:M,maxScroll:k,minScroll:j}=yS(y),_=ZF(y),L={x:Math.min(x===$n.Right?_.right-_.width/2:_.right,Math.max(x===$n.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(x===$n.Down?_.bottom-_.height/2:_.bottom,Math.max(x===$n.Down?_.top:_.top+_.height/2,f.y))},T=x===$n.Right&&!b||x===$n.Left&&!w,D=x===$n.Down&&!M||x===$n.Up&&!v;if(T&&L.x!==f.x){const C=y.scrollLeft+h.x,S=x===$n.Right&&C<=k.x||x===$n.Left&&C>=j.x;if(S&&!h.y)return void y.scrollTo({left:C,behavior:l});g.x=S?y.scrollLeft-C:x===$n.Right?y.scrollLeft-k.x:y.scrollLeft-j.x,g.x&&y.scrollBy({left:-g.x,behavior:l});break}if(D&&L.y!==f.y){const C=y.scrollTop+h.y,S=x===$n.Down&&C<=k.y||x===$n.Up&&C>=j.y;if(S&&!h.x)return void y.scrollTo({top:C,behavior:l});g.y=S?y.scrollTop-C:x===$n.Down?y.scrollTop-k.y:y.scrollTop-j.y,g.y&&y.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,ks(o1(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Eg(e){return!(!e||!("distance"in e))}function Mg(e){return!(!e||!("delay"in e))}yf.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=vS,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const l=i.activatorNode.current;return!(l&&e.target!==l||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class xf{constructor(t,n,o){var r;o===void 0&&(o=function(l){const{EventTarget:c}=Fr(l);return l instanceof c?l:Js(l)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=Js(a),this.documentListeners=new Mc(this.document),this.listeners=new Mc(o),this.windowListeners=new Mc(Fr(a)),this.initialCoordinates=(r=Gu(i))!=null?r:Ui,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xi.Resize,this.handleCancel),this.windowListeners.add(xi.DragStart,kg),this.windowListeners.add(xi.VisibilityChange,this.handleCancel),this.windowListeners.add(xi.ContextMenu,kg),this.documentListeners.add(xi.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mg(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Eg(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xi.Click,YF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!r)return;const c=(n=Gu(t))!=null?n:Ui,d=o1(r,c);if(!o&&l){if(Eg(l)){if(l.tolerance!=null&&a5(d,l.tolerance))return this.handleCancel();if(a5(d,l.distance))return this.handleStart()}return Mg(l)&&a5(d,l.tolerance)?this.handleCancel():void this.handlePending(l,d)}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===$n.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const QF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wS extends xf{constructor(t){const{event:n}=t,o=Js(n.target);super(t,QF,o)}}wS.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const eB={move:{name:"mousemove"},end:{name:"mouseup"}};var $h;(function(e){e[e.RightClick=2]="RightClick"})($h||($h={}));class SS extends xf{constructor(t){super(t,eB,Js(t.event.target))}}SS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==$h.RightClick&&(o?.({event:n}),!0)}}];const l5={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class CS extends xf{constructor(t){super(t,l5)}static setup(){return window.addEventListener(l5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(l5.move.name,t)};function t(){}}}var Tc,Xu;CS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Tc||(Tc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Xu||(Xu={}));const tB={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};var r1,Vh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(r1||(r1={})),(Vh||(Vh={})).Optimized="optimized";const Tg=new Map;function Hh(e,t){return dc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Yu(e){let{callback:t,disabled:n}=e;const o=F2(t),r=u.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function nB(e){return new Nh(u0(e),e)}function _g(e,t,n){t===void 0&&(t=nB);const[o,r]=u.useState(null);function i(){r(c=>{if(!e)return null;var d;if(e.isConnected===!1)return(d=c??n)!=null?d:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const a=function(c){let{callback:d,disabled:p}=c;const f=F2(d),h=u.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:g}=window;return new g(f)},[f,p]);return u.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const d of c){const{type:p,target:f}=d;if(p==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=Yu({callback:i});return Vi(()=>{i(),e?(l?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[e]),o}const jg=[];function Rg(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const o=e!==Ui;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?o1(e,n.current):Ui}function Ig(e){return u.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const Pg=[];function kS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return j1(t)?t:e}const oB=[{sensor:wS,options:{}},{sensor:yf,options:{}}],rB={current:{}},ou={draggable:{measure:Cg},droppable:{measure:Cg,strategy:r1.WhileDragging,frequency:Vh.Optimized},dragOverlay:{measure:u0}};class _c extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const iB={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _c,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ou,measureDroppableContainers:Zu,windowRect:null,measuringScheduled:!1},ES={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zu,draggableNodes:new Map,over:null,measureDroppableContainers:Zu},i1=u.createContext(ES),MS=u.createContext(iB);function aB(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _c}}}function lB(e,t){switch(t.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case or.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new _c(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case or.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new _c(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case or.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new _c(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function sB(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(i1),i=Ku(o),a=Ku(n?.id);return u.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!B2(i)||document.activeElement===i.target)return;const l=r.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const p of[c.current,d.current]){if(!p)continue;const f=OF(p);if(f){f.focus();break}}})}},[o,t,r,a,i]),null}function TS(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const $2=u.createContext({...Ui,scaleX:1,scaleY:1});var Ga;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ga||(Ga={}));const cB=u.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=oB,collisionDetection:p=WF,measuring:f,modifiers:h,...g}=e;const m=u.useReducer(lB,void 0,aB),[y,x]=m,[v,b]=function(){const[oe]=u.useState(()=>new Set),ue=u.useCallback(ie=>(oe.add(ie),()=>oe.delete(ie)),[oe]);return[u.useCallback(ie=>{let{type:pe,event:fe}=ie;oe.forEach(ye=>{var De;return(De=ye[pe])==null?void 0:De.call(ye,fe)})},[oe]),ue]}(),[w,M]=u.useState(Ga.Uninitialized),k=w===Ga.Initialized,{draggable:{active:j,nodes:_,translate:L},droppable:{containers:T}}=y,D=j!=null?_.get(j):null,C=u.useRef({initial:null,translated:null}),S=u.useMemo(()=>{var oe;return j!=null?{id:j,data:(oe=D?.data)!=null?oe:rB,rect:C}:null},[j,D]),R=u.useRef(null),[P,I]=u.useState(null),[z,A]=u.useState(null),O=Ec(g,Object.values(g)),N=n1("DndDescribedBy",i),F=u.useMemo(()=>T.getEnabled(),[T]),E=u.useMemo(()=>({draggable:{...ou.draggable,...B?.draggable},droppable:{...ou.droppable,...B?.droppable},dragOverlay:{...ou.dragOverlay,...B?.dragOverlay}}),[(B=f)==null?void 0:B.draggable,B?.droppable,B?.dragOverlay]);var B;const{droppableRects:H,measureDroppableContainers:U,measuringScheduled:Z}=function(oe,ue){let{dragging:ie,dependencies:pe,config:fe}=ue;const[ye,De]=u.useState(null),{frequency:Ve,measure:Je,strategy:ot}=fe,tt=u.useRef(oe),Lt=function(){switch(ot){case r1.Always:return!1;case r1.BeforeDragging:return ie;default:return!ie}}(),At=Ec(Lt),_t=u.useCallback(function(Qt){Qt===void 0&&(Qt=[]),At.current||De(rn=>rn===null?Qt:rn.concat(Qt.filter(yn=>!rn.includes(yn))))},[At]),Yt=u.useRef(null),Jt=dc(Qt=>{if(Lt&&!ie)return Tg;if(!Qt||Qt===Tg||tt.current!==oe||ye!=null){const rn=new Map;for(let yn of oe){if(!yn)continue;if(ye&&ye.length>0&&!ye.includes(yn.id)&&yn.rect.current){rn.set(yn.id,yn.rect.current);continue}const dn=yn.node.current,kt=dn?new Nh(Je(dn),dn):null;yn.rect.current=kt,kt&&rn.set(yn.id,kt)}return rn}return Qt},[oe,ye,ie,Lt,Je]);return u.useEffect(()=>{tt.current=oe},[oe]),u.useEffect(()=>{Lt||_t()},[ie,Lt]),u.useEffect(()=>{ye&&ye.length>0&&De(null)},[JSON.stringify(ye)]),u.useEffect(()=>{Lt||typeof Ve!="number"||Yt.current!==null||(Yt.current=setTimeout(()=>{_t(),Yt.current=null},Ve))},[Ve,Lt,_t,...pe]),{droppableRects:Jt,measureDroppableContainers:_t,measuringScheduled:ye!=null}}(F,{dragging:k,dependencies:[L.x,L.y],config:E.droppable}),G=function(oe,ue){const ie=ue!=null?oe.get(ue):void 0,pe=ie?ie.node.current:null;return dc(fe=>{var ye;return ue==null?null:(ye=pe??fe)!=null?ye:null},[pe,ue])}(_,j),V=u.useMemo(()=>z?Gu(z):null,[z]),le=function(){const oe=P?.autoScrollEnabled===!1,ue=typeof l=="object"?l.enabled===!1:l===!1,ie=k&&!oe&&!ue;return typeof l=="object"?{...l,enabled:ie}:{enabled:ie}}(),re=(ge=G,Q=E.draggable.measure,Hh(ge,Q));var ge,Q;(function(oe){let{activeNode:ue,measure:ie,initialRect:pe,config:fe=!0}=oe;const ye=u.useRef(!1),{x:De,y:Ve}=typeof fe=="boolean"?{x:fe,y:fe}:fe;Vi(()=>{if(!De&&!Ve||!ue)return void(ye.current=!1);if(ye.current||!pe)return;const Je=ue?.node.current;if(!Je||Je.isConnected===!1)return;const ot=Sg(ie(Je),pe);if(De||(ot.x=0),Ve||(ot.y=0),ye.current=!0,Math.abs(ot.x)>0||Math.abs(ot.y)>0){const tt=hS(Je);tt&&tt.scrollBy({top:ot.y,left:ot.x})}},[ue,De,Ve,pe,ie])})({activeNode:j!=null?_.get(j):null,config:le.layoutShiftCompensation,initialRect:re,measure:E.draggable.measure});const xe=_g(G,E.draggable.measure,re),be=_g(G?G.parentElement:null),Fe=u.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=T.getNodeFor((t=Fe.current.over)==null?void 0:t.id),ae=function(oe){let{measure:ue}=oe;const[ie,pe]=u.useState(null),fe=Yu({callback:u.useCallback(Je=>{for(const{target:ot}of Je)if(j1(ot)){pe(tt=>{const Lt=ue(ot);return tt?{...tt,width:Lt.width,height:Lt.height}:Lt});break}},[ue])}),ye=u.useCallback(Je=>{const ot=kS(Je);fe?.disconnect(),ot&&fe?.observe(ot),pe(ot?ue(ot):null)},[ue,fe]),[De,Ve]=nu(ye);return u.useMemo(()=>({nodeRef:De,rect:ie,setRef:Ve}),[ie,De,Ve])}({measure:E.dragOverlay.measure}),we=(n=ae.nodeRef.current)!=null?n:G,se=k?(o=ae.rect)!=null?o:xe:null,J=!(!ae.nodeRef.current||!ae.rect),ce=Sg(ne=J?null:xe,Hh(ne));var ne;const Pe=Ig(we?Fr(we):null),Ee=function(oe){const ue=u.useRef(oe),ie=dc(pe=>oe?pe&&pe!==jg&&oe&&ue.current&&oe.parentNode===ue.current.parentNode?pe:N2(oe):jg,[oe]);return u.useEffect(()=>{ue.current=oe},[oe]),ie}(k?ee??G:null),it=function(oe,ue){ue===void 0&&(ue=u0);const[ie]=oe,pe=Ig(ie?Fr(ie):null),[fe,ye]=u.useState(Pg);function De(){ye(()=>oe.length?oe.map(Je=>gS(Je)?pe:new Nh(ue(Je),Je)):Pg)}const Ve=Yu({callback:De});return Vi(()=>{Ve?.disconnect(),De(),oe.forEach(Je=>Ve?.observe(Je))},[oe]),fe}(Ee),Ue=TS(h,{transform:{x:L.x-ce.x,y:L.y-ce.y,scaleX:1,scaleY:1},activatorEvent:z,active:S,activeNodeRect:xe,containerNodeRect:be,draggingNodeRect:se,over:Fe.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Ee,scrollableAncestorRects:it,windowRect:Pe}),ke=V?ks(V,L):null,_e=function(oe){const[ue,ie]=u.useState(null),pe=u.useRef(oe),fe=u.useCallback(ye=>{const De=i5(ye.target);De&&ie(Ve=>Ve?(Ve.set(De,Bh(De)),new Map(Ve)):null)},[]);return u.useEffect(()=>{const ye=pe.current;if(oe!==ye){De(ye);const Ve=oe.map(Je=>{const ot=i5(Je);return ot?(ot.addEventListener("scroll",fe,{passive:!0}),[ot,Bh(ot)]):null}).filter(Je=>Je!=null);ie(Ve.length?new Map(Ve):null),pe.current=oe}return()=>{De(oe),De(ye)};function De(Ve){Ve.forEach(Je=>{i5(Je)?.removeEventListener("scroll",fe)})}},[fe,oe]),u.useMemo(()=>oe.length?ue?Array.from(ue.values()).reduce((ye,De)=>ks(ye,De),Ui):xS(oe):Ui,[oe,ue])}(Ee),Xe=Rg(_e),Be=Rg(_e,[xe]),ct=ks(Ue,Xe),et=se?UF(se,Ue):null,he=S&&et?p({active:S,collisionRect:et,droppableRects:H,droppableContainers:F,pointerCoordinates:ke}):null,Ye=uS(he,"id"),[Se,Ie]=u.useState(null),de=function(oe,ue,ie){return{...oe,scaleX:ue&&ie?ue.width/ie.width:1,scaleY:ue&&ie?ue.height/ie.height:1}}(J?Ue:ks(Ue,Be),(r=Se?.rect)!=null?r:null,xe),Oe=u.useRef(null),Le=u.useCallback((oe,ue)=>{let{sensor:ie,options:pe}=ue;if(R.current==null)return;const fe=_.get(R.current);if(!fe)return;const ye=oe.nativeEvent,De=new ie({active:R.current,activeNode:fe,event:ye,options:pe,context:Fe,onAbort(Je){if(!_.get(Je))return;const{onDragAbort:ot}=O.current,tt={id:Je};ot?.(tt),v({type:"onDragAbort",event:tt})},onPending(Je,ot,tt,Lt){if(!_.get(Je))return;const{onDragPending:At}=O.current,_t={id:Je,constraint:ot,initialCoordinates:tt,offset:Lt};At?.(_t),v({type:"onDragPending",event:_t})},onStart(Je){const ot=R.current;if(ot==null)return;const tt=_.get(ot);if(!tt)return;const{onDragStart:Lt}=O.current,At={activatorEvent:ye,active:{id:ot,data:tt.data,rect:C}};yo.unstable_batchedUpdates(()=>{Lt?.(At),M(Ga.Initializing),x({type:or.DragStart,initialCoordinates:Je,active:ot}),v({type:"onDragStart",event:At}),I(Oe.current),A(ye)})},onMove(Je){x({type:or.DragMove,coordinates:Je})},onEnd:Ve(or.DragEnd),onCancel:Ve(or.DragCancel)});function Ve(Je){return async function(){const{active:ot,collisions:tt,over:Lt,scrollAdjustedTranslate:At}=Fe.current;let _t=null;if(ot&&At){const{cancelDrop:Yt}=O.current;_t={activatorEvent:ye,active:ot,collisions:tt,delta:At,over:Lt},Je===or.DragEnd&&typeof Yt=="function"&&await Promise.resolve(Yt(_t))&&(Je=or.DragCancel)}R.current=null,yo.unstable_batchedUpdates(()=>{x({type:Je}),M(Ga.Uninitialized),Ie(null),I(null),A(null),Oe.current=null;const Yt=Je===or.DragEnd?"onDragEnd":"onDragCancel";if(_t){const Jt=O.current[Yt];Jt?.(_t),v({type:Yt,event:_t})}})}}Oe.current=De},[_]),je=u.useCallback((oe,ue)=>(ie,pe)=>{const fe=ie.nativeEvent,ye=_.get(pe);if(R.current!==null||!ye||fe.dndKit||fe.defaultPrevented)return;const De={active:ye};oe(ie,ue.options,De)===!0&&(fe.dndKit={capturedBy:ue.sensor},R.current=pe,Le(ie,ue))},[_,Le]),K=function(oe,ue){return u.useMemo(()=>oe.reduce((ie,pe)=>{const{sensor:fe}=pe;return[...ie,...fe.activators.map(ye=>({eventName:ye.eventName,handler:ue(ye.handler,pe)}))]},[]),[oe,ue])}(d,je);(function(oe){u.useEffect(()=>{if(!z2)return;const ue=oe.map(ie=>{let{sensor:pe}=ie;return pe.setup==null?void 0:pe.setup()});return()=>{for(const ie of ue)ie?.()}},oe.map(ue=>{let{sensor:ie}=ue;return ie}))})(d),Vi(()=>{xe&&w===Ga.Initializing&&M(Ga.Initialized)},[xe,w]),u.useEffect(()=>{const{onDragMove:oe}=O.current,{active:ue,activatorEvent:ie,collisions:pe,over:fe}=Fe.current;if(!ue||!ie)return;const ye={active:ue,activatorEvent:ie,collisions:pe,delta:{x:ct.x,y:ct.y},over:fe};yo.unstable_batchedUpdates(()=>{oe?.(ye),v({type:"onDragMove",event:ye})})},[ct.x,ct.y]),u.useEffect(()=>{const{active:oe,activatorEvent:ue,collisions:ie,droppableContainers:pe,scrollAdjustedTranslate:fe}=Fe.current;if(!oe||R.current==null||!ue||!fe)return;const{onDragOver:ye}=O.current,De=pe.get(Ye),Ve=De&&De.rect.current?{id:De.id,rect:De.rect.current,data:De.data,disabled:De.disabled}:null,Je={active:oe,activatorEvent:ue,collisions:ie,delta:{x:fe.x,y:fe.y},over:Ve};yo.unstable_batchedUpdates(()=>{Ie(Ve),ye?.(Je),v({type:"onDragOver",event:Je})})},[Ye]),Vi(()=>{Fe.current={activatorEvent:z,active:S,activeNode:G,collisionRect:et,collisions:he,droppableRects:H,draggableNodes:_,draggingNode:we,draggingNodeRect:se,droppableContainers:T,over:Se,scrollableAncestors:Ee,scrollAdjustedTranslate:ct},C.current={initial:se,translated:et}},[S,G,he,et,_,we,se,H,T,Se,Ee,ct]),function(oe){let{acceleration:ue,activator:ie=Tc.Pointer,canScroll:pe,draggingRect:fe,enabled:ye,interval:De=5,order:Ve=Xu.TreeOrder,pointerCoordinates:Je,scrollableAncestors:ot,scrollableAncestorRects:tt,delta:Lt,threshold:At}=oe;const _t=function(tn){let{delta:_n,disabled:Nn}=tn;const fn=Ku(_n);return dc(fo=>{if(Nn||!fn||!fo)return tB;const bo=Math.sign(_n.x-fn.x),Fo=Math.sign(_n.y-fn.y);return{x:{[sr.Backward]:fo.x[sr.Backward]||bo===-1,[sr.Forward]:fo.x[sr.Forward]||bo===1},y:{[sr.Backward]:fo.y[sr.Backward]||Fo===-1,[sr.Forward]:fo.y[sr.Forward]||Fo===1}}},[Nn,_n,fn])}({delta:Lt,disabled:!ye}),[Yt,Jt]=function(){const tn=u.useRef(null);return[u.useCallback((_n,Nn)=>{tn.current=setInterval(_n,Nn)},[]),u.useCallback(()=>{tn.current!==null&&(clearInterval(tn.current),tn.current=null)},[])]}(),Qt=u.useRef({x:0,y:0}),rn=u.useRef({x:0,y:0}),yn=u.useMemo(()=>{switch(ie){case Tc.Pointer:return Je?{top:Je.y,bottom:Je.y,left:Je.x,right:Je.x}:null;case Tc.DraggableRect:return fe}},[ie,fe,Je]),dn=u.useRef(null),kt=u.useCallback(()=>{const tn=dn.current;if(!tn)return;const _n=Qt.current.x*rn.current.x,Nn=Qt.current.y*rn.current.y;tn.scrollBy(_n,Nn)},[]),xn=u.useMemo(()=>Ve===Xu.TreeOrder?[...ot].reverse():ot,[Ve,ot]);u.useEffect(()=>{if(ye&&ot.length&&yn){for(const tn of xn){if(pe?.(tn)===!1)continue;const _n=ot.indexOf(tn),Nn=tt[_n];if(!Nn)continue;const{direction:fn,speed:fo}=GF(tn,Nn,yn,ue,At);for(const bo of["x","y"])_t[bo][fn[bo]]||(fo[bo]=0,fn[bo]=0);if(fo.x>0||fo.y>0)return Jt(),dn.current=tn,Yt(kt,De),Qt.current=fo,void(rn.current=fn)}Qt.current={x:0,y:0},rn.current={x:0,y:0},Jt()}else Jt()},[ue,kt,pe,Jt,ye,De,JSON.stringify(yn),JSON.stringify(_t),Yt,ot,xn,tt,JSON.stringify(At)])}({...le,delta:L,draggingRect:et,pointerCoordinates:ke,scrollableAncestors:Ee,scrollableAncestorRects:it});const W=u.useMemo(()=>({active:S,activeNode:G,activeNodeRect:xe,activatorEvent:z,collisions:he,containerNodeRect:be,dragOverlay:ae,draggableNodes:_,droppableContainers:T,droppableRects:H,over:Se,measureDroppableContainers:U,scrollableAncestors:Ee,scrollableAncestorRects:it,measuringConfiguration:E,measuringScheduled:Z,windowRect:Pe}),[S,G,xe,z,he,be,ae,_,T,H,Se,U,Ee,it,E,Z,Pe]),te=u.useMemo(()=>({activatorEvent:z,activators:K,active:S,activeNodeRect:xe,ariaDescribedById:{draggable:N},dispatch:x,draggableNodes:_,over:Se,measureDroppableContainers:U}),[z,K,S,xe,x,N,_,Se,U]);return u.createElement(sS.Provider,{value:b},u.createElement(i1.Provider,{value:te},u.createElement(MS.Provider,{value:W},u.createElement($2.Provider,{value:de},c)),u.createElement(sB,{disabled:a?.restoreFocus===!1})),u.createElement(BF,{...a,hiddenTextDescribedById:N}))}),dB=u.createContext(null),Og="button";function _S(){return u.useContext(MS)}const uB={timeout:25};function pB(e){let{animation:t,children:n}=e;const[o,r]=u.useState(null),[i,a]=u.useState(null),l=Ku(n);return n||o||!l||r(l),Vi(()=>{if(!i)return;const c=o?.key,d=o?.props.id;c!=null&&d!=null?Promise.resolve(t(d,i)).then(()=>{r(null)}):r(null)},[t,o,i]),u.createElement(u.Fragment,null,n,o?u.cloneElement(o,{ref:a}):null)}const hB={x:0,y:0,scaleX:1,scaleY:1};function fB(e){let{children:t}=e;return u.createElement(i1.Provider,{value:ES},u.createElement($2.Provider,{value:hB},t))}const mB={position:"fixed",touchAction:"none"},gB=e=>B2(e)?"transform 250ms ease":void 0,yB=u.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:l,style:c,transform:d,transition:p=gB}=e;if(!l)return null;const f=r?d:{...d,scaleX:1,scaleY:1},h={...mB,width:l.width,height:l.height,top:l.top,left:l.left,transform:Ul.Transform.toString(f),transformOrigin:r&&o?NF(o,l):void 0,transition:typeof p=="function"?p(o):p,...c};return u.createElement(n,{className:a,style:h,ref:t},i)}),jS={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ul.Transform.toString(t)},{transform:Ul.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[l,c]of Object.entries(i.active))c!==void 0&&(r[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(i!=null&&i.dragOverlay)for(const[l,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&o.node.classList.add(a.dragOverlay),function(){for(const[l,c]of Object.entries(r))n.node.style.setProperty(l,c);a!=null&&a.active&&n.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};let Dg=0;const xB=u.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:a,wrapperElement:l="div",className:c,zIndex:d=999}=e;const{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:m,droppableContainers:y,dragOverlay:x,over:v,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:M,windowRect:k}=_S(),j=u.useContext($2),_=(S=f?.id,u.useMemo(()=>{if(S!=null)return Dg++,Dg},[S])),L=TS(a,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:x.rect,over:v,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:M,transform:j,windowRect:k}),T=Hh(h),D=function(R){let{config:P,draggableNodes:I,droppableContainers:z,measuringConfiguration:A}=R;return F2((O,N)=>{if(P===null)return;const F=I.get(O);if(!F)return;const E=F.node.current;if(!E)return;const B=kS(N);if(!B)return;const{transform:H}=Fr(N).getComputedStyle(N),U=pS(H);if(!U)return;const Z=typeof P=="function"?P:function(G){const{duration:V,easing:le,sideEffects:re,keyframes:ge}={...jS,...G};return Q=>{let{active:xe,dragOverlay:be,transform:Fe,...ee}=Q;if(!V)return;const ae=be.rect.left-xe.rect.left,we=be.rect.top-xe.rect.top,se={scaleX:Fe.scaleX!==1?xe.rect.width*Fe.scaleX/be.rect.width:1,scaleY:Fe.scaleY!==1?xe.rect.height*Fe.scaleY/be.rect.height:1},J={x:Fe.x-ae,y:Fe.y-we,...se},ce=ge({...ee,active:xe,dragOverlay:be,transform:{initial:Fe,final:J}}),[ne]=ce,Pe=ce[ce.length-1];if(JSON.stringify(ne)===JSON.stringify(Pe))return;const Ee=re?.({active:xe,dragOverlay:be,...ee}),it=be.node.animate(ce,{duration:V,easing:le,fill:"forwards"});return new Promise(Ue=>{it.onfinish=()=>{Ee?.(),Ue()}})}}(P);return bS(E,A.draggable.measure),Z({active:{id:O,data:F.data,node:E,rect:A.draggable.measure(E)},draggableNodes:I,dragOverlay:{node:N,rect:A.dragOverlay.measure(B)},droppableContainers:z,measuringConfiguration:A,transform:U})})}({config:o,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),C=T?x.setRef:void 0;var S;return u.createElement(fB,null,u.createElement(pB,{animation:D},f&&_?u.createElement(yB,{key:_,id:f.id,ref:C,as:l,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:T,style:{zIndex:d,...r},transform:L},n):null))});function bf(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function bB(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Ed(e){return e!==null&&e>=0}const Md={scaleX:1,scaleY:1},vB=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:a}=e;const l=(t=n[r])!=null?t:o;if(!l)return null;const c=function(d,p,f){const h=d[p],g=d[p-1],m=d[p+1];return h&&(g||m)?f<p?g?h.left-(g.left+g.width):m.left-(h.left+h.width):m?m.left-(h.left+h.width):h.left-(g.left+g.width):0}(n,a,r);if(a===r){const d=n[i];return d?{x:r<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...Md}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Md}:a<r&&a>=i?{x:l.width+c,y:0,...Md}:{x:0,y:0,...Md}},vf=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=bf(t,o,n),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},RS="Sortable",IS=u.createContext({activeIndex:-1,containerId:RS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vf,disabled:{draggable:!1,droppable:!1}});function wB(e){let{children:t,id:n,items:o,strategy:r=vf,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:p}=_S(),f=n1(RS,n),h=l.rect!==null,g=u.useMemo(()=>o.map(j=>typeof j=="object"&&"id"in j?j.id:j),[o]),m=a!=null,y=a?g.indexOf(a.id):-1,x=d?g.indexOf(d.id):-1,v=u.useRef(g),b=!function(j,_){if(j===_)return!0;if(j.length!==_.length)return!1;for(let L=0;L<j.length;L++)if(j[L]!==_[L])return!1;return!0}(g,v.current),w=x!==-1&&y===-1||b,M=function(j){return typeof j=="boolean"?{draggable:j,droppable:j}:j}(i);Vi(()=>{b&&m&&p(g)},[b,g,m,p]),u.useEffect(()=>{v.current=g},[g]);const k=u.useMemo(()=>({activeIndex:y,containerId:f,disabled:M,disableTransforms:w,items:g,overIndex:x,useDragOverlay:h,sortedRects:bB(g,c),strategy:r}),[y,f,M.draggable,M.droppable,w,g,x,c,h,r]);return u.createElement(IS.Provider,{value:k},t)}const SB=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bf(n,o,r).indexOf(t)},CB=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=e;return!(!d||!o||l!==i&&r===a||!n&&(a===r||t!==c))},kB={duration:200,easing:"ease"},PS="transform",EB=Ul.Transition.toString({property:PS,duration:0,easing:"linear"}),MB={roleDescription:"sortable"};function Ju(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const TB=[$n.Down,$n.Right,$n.Up,$n.Left],_B=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(TB.includes(e.code)){if(e.preventDefault(),!n||!o)return;const p=[];i.getEnabled().forEach(g=>{if(!g||g!=null&&g.disabled)return;const m=r.get(g.id);if(m)switch(e.code){case $n.Down:o.top<m.top&&p.push(g);break;case $n.Up:o.top>m.top&&p.push(g);break;case $n.Left:o.left>m.left&&p.push(g);break;case $n.Right:o.left<m.left&&p.push(g)}});const f=(g=>{let{collisionRect:m,droppableRects:y,droppableContainers:x}=g;const v=vg(m),b=[];for(const w of x){const{id:M}=w,k=y.get(M);if(k){const j=vg(k),_=v.reduce((T,D,C)=>T+cS(j[C],D),0),L=Number((_/4).toFixed(4));b.push({id:M,data:{droppableContainer:w,value:L}})}}return b.sort(dS)})({collisionRect:o,droppableRects:r,droppableContainers:p});let h=uS(f,"id");if(h===a?.id&&f.length>1&&(h=f[1].id),h!=null){const g=i.get(n.id),m=i.get(h),y=m?r.get(m.id):null,x=m?.node.current;if(x&&y&&g&&m){const v=N2(x).some((j,_)=>l[_]!==j),b=Ag(g,m),w=(d=m,!!(Ju(c=g)&&Ju(d)&&Ag(c,d))&&c.data.current.sortable.index<d.data.current.sortable.index),M=v||!b?{x:0,y:0}:{x:w?o.width-y.width:0,y:w?o.height-y.height:0},k={x:y.left,y:y.top};return M.x&&M.y?k:o1(k,M)}}}var c,d};function Ag(e,t){return!(!Ju(e)||!Ju(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const jB=e=>{let{transform:t}=e;return{...t,y:0}},RB=u.memo(u.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:a,editable:l,selectedIndex:c,background:d,activeColor:p,borderColor:f,borderWidth:h,dragging:g,...m}=e;return s.jsxs("div",{ref:t,className:Zr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":d,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...m,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Fi={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},OS=u.memo(u.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:a,index:l,listeners:c,onRemove:d,renderItem:p,sorting:f,style:h,transition:g,transform:m,value:y,wrapperStyle:x,...v},b)=>{u.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!f,index:l,fadeIn:!!r,listeners:c,ref:b,style:h,transform:m,transition:g,value:y}):s.jsx(s.Fragment,{children:y});return s.jsx("div",{className:Zr("tab-item",Fi.Wrapper,r&&Fi.fadeIn,f&&Fi.sorting,t&&Fi.dragOverlay),style:{...x,transition:[g,x?.transition].filter(Boolean).join(", "),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":l},ref:b,children:s.jsx("div",{className:Zr(Fi.Item,n&&Fi.dragging,i&&Fi.withHandle,t&&Fi.dragOverlay,o&&Fi.disabled,e&&Fi.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...v,tabIndex:i?void 0:-1,children:w})})})),Lg={Row:"_Row_1kr10_1"},IB=u.memo(u.forwardRef(({children:e,horizontal:t,style:n},o)=>s.jsx("div",{ref:o,style:{...n},className:Zr(Lg.Row,t&&Lg.horizontal),children:e}))),PB={...jS},OB=u.memo(u.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=VF,coordinateGetter:l=_B,dropAnimation:c=PB,getItemStyles:d=()=>({}),getNewIndex:p,handle:f=!1,items:h,onMove:g,isDisabled:m=()=>!1,measuring:y,modifiers:x,renderItem:v,renderDivider:b,reorderItems:w=bf,strategy:M=vf,style:k,useDragOverlay:j=!0,onDragStart:_,wrapperStyle:L=()=>({})}=e,[T,D]=u.useState(()=>h);u.useEffect(()=>{D(h)},[h]);const[C,S]=u.useState(null),R=function(){for(var O=arguments.length,N=new Array(O),F=0;F<O;F++)N[F]=arguments[F];return u.useMemo(()=>[...N].filter(E=>E!=null),[...N])}(r5(SS,{activationConstraint:o}),r5(CS,{activationConstraint:o}),r5(yf,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:l})),P=T.indexOf.bind(T),I=C?P(C):-1,z=[];T.map((O,N)=>{z.push(s.jsx(DB,{id:O,handle:f,index:N,style:d,wrapperStyle:L,disabled:m(O),renderItem:v,animateLayoutChanges:r,useDragOverlay:j,getNewIndex:p},O+"-"+N));const F=b?.({key:"divider-"+N});F&&z.push(F)});const{getPortalContainer:A}=(u.useEffect(()=>{function O(){const N=document.fullscreenElement;if(!N)return;let F=N.querySelector(".fullscreen-portal-root");F||(F=document.createElement("div"),F.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",N.appendChild(F))}return ed++,O(),document.addEventListener("fullscreenchange",O),()=>{document.removeEventListener("fullscreenchange",O),ed--,ed<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(N=>{N.parentNode&&N.parentNode.removeChild(N)}),ed=0)}},[]),{getPortalContainer:YR});return s.jsxs(cB,{sensors:R,collisionDetection:a,onDragStart:O=>{const{active:N}=O;N&&(_?.(O),S(N.id))},autoScroll:{canScroll:O=>!0},onDragEnd:O=>{if(S(null),O.over){const N=P(O.over.id);I!==N&&(D(F=>w(F,I,N)),g?.(I,N))}},onDragCancel:()=>{S(null)},measuring:y,modifiers:x,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...k},className:Zr(n,Fi.Wrapper),children:s.jsx(wB,{items:T,strategy:M,children:s.jsx(IB,{ref:t,children:z})})}),j?yo.createPortal(s.jsx(xB,{adjustScale:i,dropAnimation:c,children:C?s.jsx(OS,{value:T[I],handle:f,renderItem:v,wrapperStyle:L({index:I,isDragging:!0,id:T[I]}),index:I,dragging:!0,style:d({id:T[I],index:I,isSorting:C!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),A()):null]})}));function DB({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:a,style:l,renderItem:c,useDragOverlay:d,wrapperStyle:p}){const{attributes:f,isDragging:h,isSorting:g,listeners:m,overIndex:y,setNodeRef:x,transform:v,transition:b}=function(w){let{animateLayoutChanges:M=CB,attributes:k,disabled:j,data:_,getNewIndex:L=SB,id:T,strategy:D,resizeObserverConfig:C,transition:S=kB}=w;const{items:R,containerId:P,activeIndex:I,disabled:z,disableTransforms:A,sortedRects:O,overIndex:N,useDragOverlay:F,strategy:E}=u.useContext(IS),B=(he=z,typeof(et=j)=="boolean"?{draggable:et,droppable:!1}:{draggable:(Ye=et?.draggable)!=null?Ye:he.draggable,droppable:(Se=et?.droppable)!=null?Se:he.droppable}),H=R.indexOf(T),U=u.useMemo(()=>({sortable:{containerId:P,index:H,items:R},..._}),[P,_,H,R]),Z=u.useMemo(()=>R.slice(R.indexOf(T)),[R,T]),{rect:G,node:V,isOver:le,setNodeRef:re}=function(Ie){let{data:de,disabled:Oe=!1,id:Le,resizeObserverConfig:je}=Ie;const K=n1("Droppable"),{active:W,dispatch:te,over:oe,measureDroppableContainers:ue}=u.useContext(i1),ie=u.useRef({disabled:Oe}),pe=u.useRef(!1),fe=u.useRef(null),ye=u.useRef(null),{disabled:De,updateMeasurementsFor:Ve,timeout:Je}={...uB,...je},ot=Ec(Ve??Le),tt=Yu({callback:u.useCallback(()=>{pe.current?(ye.current!=null&&clearTimeout(ye.current),ye.current=setTimeout(()=>{ue(Array.isArray(ot.current)?ot.current:[ot.current]),ye.current=null},Je)):pe.current=!0},[Je]),disabled:De||!W}),Lt=u.useCallback((Jt,Qt)=>{tt&&(Qt&&(tt.unobserve(Qt),pe.current=!1),Jt&&tt.observe(Jt))},[tt]),[At,_t]=nu(Lt),Yt=Ec(de);return u.useEffect(()=>{tt&&At.current&&(tt.disconnect(),pe.current=!1,tt.observe(At.current))},[At,tt]),u.useEffect(()=>(te({type:or.RegisterDroppable,element:{id:Le,key:K,disabled:Oe,node:At,rect:fe,data:Yt}}),()=>te({type:or.UnregisterDroppable,key:K,id:Le})),[Le]),u.useEffect(()=>{Oe!==ie.current.disabled&&(te({type:or.SetDroppableDisabled,id:Le,key:K,disabled:Oe}),ie.current.disabled=Oe)},[Le,K,Oe,te]),{active:W,rect:fe,isOver:oe?.id===Le,node:At,over:oe,setNodeRef:_t}}({id:T,data:U,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Z,...C}}),{active:ge,activatorEvent:Q,activeNodeRect:xe,attributes:be,setNodeRef:Fe,listeners:ee,isDragging:ae,over:we,setActivatorNodeRef:se,transform:J}=function(Ie){let{id:de,data:Oe,disabled:Le=!1,attributes:je}=Ie;const K=n1("Draggable"),{activators:W,activatorEvent:te,active:oe,activeNodeRect:ue,ariaDescribedById:ie,draggableNodes:pe,over:fe}=u.useContext(i1),{role:ye=Og,roleDescription:De="draggable",tabIndex:Ve=0}=je??{},Je=oe?.id===de,ot=u.useContext(Je?$2:dB),[tt,Lt]=nu(),[At,_t]=nu(),Yt=(Qt=W,rn=de,u.useMemo(()=>Qt.reduce((yn,dn)=>{let{eventName:kt,handler:xn}=dn;return yn[kt]=tn=>{xn(tn,rn)},yn},{}),[Qt,rn])),Jt=Ec(Oe);var Qt,rn;return Vi(()=>(pe.set(de,{id:de,key:K,node:tt,activatorNode:At,data:Jt}),()=>{const yn=pe.get(de);yn&&yn.key===K&&pe.delete(de)}),[pe,de]),{active:oe,activatorEvent:te,activeNodeRect:ue,attributes:u.useMemo(()=>({role:ye,tabIndex:Ve,"aria-disabled":Le,"aria-pressed":!(!Je||ye!==Og)||void 0,"aria-roledescription":De,"aria-describedby":ie.draggable}),[Le,ye,Ve,Je,De,ie.draggable]),isDragging:Je,listeners:Le?void 0:Yt,node:tt,over:fe,setNodeRef:Lt,setActivatorNodeRef:_t,transform:ot}}({id:T,data:U,attributes:{...MB,...k},disabled:B.draggable}),ce=function(){for(var Ie=arguments.length,de=new Array(Ie),Oe=0;Oe<Ie;Oe++)de[Oe]=arguments[Oe];return u.useMemo(()=>Le=>{de.forEach(je=>je(Le))},de)}(re,Fe),ne=!!ge,Pe=ne&&!A&&Ed(I)&&Ed(N),Ee=!F&&ae,it=Pe?(Ee&&Pe?J:null)??(D??E)({rects:O,activeNodeRect:xe,activeIndex:I,overIndex:N,index:H}):null,Ue=Ed(I)&&Ed(N)?L({id:T,items:R,activeIndex:I,overIndex:N}):H,ke=ge?.id,_e=u.useRef({activeId:ke,items:R,newIndex:Ue,containerId:P}),Xe=R!==_e.current.items,Be=M({active:ge,containerId:P,isDragging:ae,isSorting:ne,id:T,index:H,items:R,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:S,wasDragging:_e.current.activeId!=null}),ct=function(Ie){let{disabled:de,index:Oe,node:Le,rect:je}=Ie;const[K,W]=u.useState(null),te=u.useRef(Oe);return Vi(()=>{if(!de&&Oe!==te.current&&Le.current){const oe=je.current;if(oe){const ue=u0(Le.current,{ignoreTransform:!0}),ie={x:oe.left-ue.left,y:oe.top-ue.top,scaleX:oe.width/ue.width,scaleY:oe.height/ue.height};(ie.x||ie.y)&&W(ie)}}Oe!==te.current&&(te.current=Oe)},[de,Oe,Le,je]),u.useEffect(()=>{K&&W(null)},[K]),K}({disabled:!Be,index:H,node:V,rect:G});var et,he,Ye,Se;return u.useEffect(()=>{ne&&_e.current.newIndex!==Ue&&(_e.current.newIndex=Ue),P!==_e.current.containerId&&(_e.current.containerId=P),R!==_e.current.items&&(_e.current.items=R)},[ne,Ue,P,R]),u.useEffect(()=>{if(ke===_e.current.activeId)return;if(ke!=null&&_e.current.activeId==null)return void(_e.current.activeId=ke);const Ie=setTimeout(()=>{_e.current.activeId=ke},50);return()=>clearTimeout(Ie)},[ke]),{active:ge,activeIndex:I,attributes:be,data:U,rect:G,index:H,newIndex:Ue,items:R,isOver:le,isSorting:ne,isDragging:ae,listeners:ee,node:V,overIndex:N,over:we,setNodeRef:ce,setActivatorNodeRef:se,setDroppableNodeRef:re,setDraggableNodeRef:Fe,transform:ct??it,transition:ct||Xe&&_e.current.newIndex===H?EB:Ee&&!B2(Q)||!S||!ne&&!Be?void 0:Ul.Transition.toString({...S,property:PS})}}({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(OS,{ref:x,value:r,disabled:e,dragging:h,sorting:g,handle:o,renderItem:c,index:i,style:l({index:i,id:r,isDragging:h,isSorting:g,overIndex:y}),onRemove:a?()=>a(r):void 0,transform:v,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:m,"data-index":i,"data-id":r,dragOverlay:!d&&h,...f})}const AB=new $.Color("rgb(33, 115, 70)"),LB="#eee",zB=e=>s.jsx(RB,{...e}),DS=u.memo(u.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:a=[],onSelectedTabIndexChange:l,onTabNameChange:c,onTabMove:d,createScrollStartButton:p=eb,createScrollEndButton:f=tb,createScrollEdgeButton:h=LR,createTabButton:g=zB,createTabDivider:m,editLabelProps:y,disabled:x=!1,disableDrag:v=!1,background:b="white",activeColor:w=AB,borderColor:M=LB,borderWidth:k=1}=e,[j,_]=u.useState(i),[L,T]=u.useState(a),D=u.useCallback(se=>{const J=A.current?.[se]?.closest(".tab-item")??A.current?.[se];J&&U.current?.scrollTo({top:J.offsetTop,left:J.offsetLeft,behavior:"smooth"})},[]);u.useEffect(()=>{D(i)},[i]);const C=u.useCallback((se,J)=>{J!==j&&(_(J),l?.(J)),D(J)},[l,j]),S=u.useCallback((se,J)=>{d?.(se,J)},[d]),R=u.useRef(null),[P,I]=u.useState(-1),z=u.useCallback((se,J)=>{c?.(se,J)},[c]);u.useLayoutEffect(()=>{_(i)},[i]),u.useLayoutEffect(()=>{T(a)},[a]);const A=u.useRef([]),O=u.useRef(null);u.useImperativeHandle(t,()=>Object.assign({startEdit(se){A.current?.[se]?.startEdit()},cancel(se){A.current?.[se]?.cancel()}},O.current),[j,P]);const N=u.useCallback(({value:se,index:J,dragging:ce})=>{const{style:ne,maxLength:Pe,...Ee}=y||{},it=s.jsx(PF,{ref:Ue=>{A.current[J]=Ue},value:se,disabled:x,maxLength:Pe,style:{color:j===J&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...ne},styleHover:{},onSubmit:Ue=>(R.current=!1,I(-1),z(J,Ue)),onCancel:()=>{R.current=!1,I(-1)},onChange:Ue=>{R.current=!0,I(J)},...Ee});return g({onClick:Ue=>C(Ue,J),value:se,index:J,editing:P===J&&R.current,editable:!0,disabled:x,selectedIndex:j,background:b,activeColor:w,borderColor:M,borderWidth:k,dragging:ce,children:it})},[j,z,C,y,x,P,g]),[F,{width:E}]=Wl(),[B,{width:H}]=Wl(),U=u.useRef(null),[Z,G]=u.useState({left:0,top:0,width:0,height:0}),[V,le]=u.useState(null);u.useEffect(()=>{V!==null&&U.current&&U.current.scrollTo({left:V,behavior:"smooth"})},[V]);const re=u.useCallback((se,J=!1)=>{if(!U.current)return 0;let ce=U.current.firstChild.getBoundingClientRect(),ne=U.current.firstChild.firstChild.children,Pe=0;return Pe=J?0:b4.getScrollTo(se,ce.left,ne,!0,Math.max(0,se-200)),le(Pe),Math.max(0,Pe)},[]),ge=u.useCallback((se,J=!1)=>{if(!U.current)return 0;let ce=U.current.firstChild.getBoundingClientRect(),ne=U.current.firstChild.firstChild.children,Pe=0;const Ee=Math.ceil(H-E);return Pe=J?Ee:b4.getScrollTo(se,ce.left,ne,!1,Math.max(0,se+200)),le(Pe),Math.min(Ee,Pe)},[H,E]),Q=u.useRef(null),xe=u.useRef(null),be=u.useCallback(()=>{xe.current&&(clearTimeout(xe.current),xe.current=null,Q.current=null)},[]),Fe=u.useCallback((se,J,ce=260)=>{Q.current=se,xe.current=setTimeout(()=>{const ne=J?re(Q.current||se):ge(Q.current||se);ne!==Q.current?Fe(ne,J,120):be()},ce)},[re,ge,be]);u.useEffect(()=>()=>be(),[be]);const ee=u.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Z.left)<=0||Math.floor(H-E)===0,orientation:yr.Horizontal,onMouseUp:be,onMouseLeave:be,onMouseDown:()=>Fe(U.current.scrollLeft,!0),onClick:se=>re(Math.min(U.current.scrollLeft,V??Number.MAX_SAFE_INTEGER),se.ctrlKey)}),[Z,V,H,E]),ae=u.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(H-E)<=Math.ceil(Z.left),orientation:yr.Horizontal,onMouseUp:be,onMouseLeave:be,onMouseDown:()=>Fe(U.current.scrollLeft,!1),onClick:se=>ge(Math.max(U.current.scrollLeft,V??0),se.ctrlKey)}),[Z,V,H,E]),we=u.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,h?.(ee)]}),[ee,ae,p,f,n,h]);return s.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:Zr("_TabStrip_3x0dp_1",r),ref:O,children:[s.jsx("div",{style:{borderTop:`solid ${M} ${k}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:we}),s.jsx("div",{className:"Tabs",ref:F,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:U,onScroll:se=>{G({left:se.target.scrollLeft,top:se.target.scrollTop,width:se.target.scrollWidth,height:se.target.scrollHeight})},children:s.jsx(OB,{isDisabled:se=>x||v,items:L,strategy:vB,modifiers:[jB],ref:B,renderItem:N,renderDivider:m,onMove:S,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ae)})]})}));DS.displayName="TabStrip";const FB=u.createContext(null),wf=()=>{const e=u.useContext(FB),[t]=u.useState(()=>new $.ThemeCollection);return u.useMemo(()=>e||t,[e])},BB=u.lazy(()=>Promise.resolve().then(()=>require("./D6pPBbRPLTNFSXuO.cjs"))),NB={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},zg=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),a=await i.getNavigationTree(o.uri.toString()),l=e.getPosition();let c={...l};c.lineNumber=1,c.column=1;let d=!1;for(let y=l.lineNumber;y>=1;y--)if(o.getLineContent(y).trim()===""){const x=Sf(a,o.getOffsetAt({lineNumber:y,column:1}),"function");if(!x||VB(x)){d=!0,c.lineNumber=y+1;break}{const v=x.spans[0].start;y=o.getPositionAt(v).lineNumber,c.lineNumber=y}}let p=n,f=!1;!d&&!p.startsWith(`
212
+ `},FF={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function BF(e){let{announcements:t=FF,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=zF}=e;const{announce:i,announcement:a}=function(){const[f,h]=u.useState("");return{announce:u.useCallback(g=>{g!=null&&h(g)},[]),announcement:f}}(),l=n1("DndLiveRegion"),[c,d]=u.useState(!1);if(u.useEffect(()=>{d(!0)},[]),function(f){const h=u.useContext(sS);u.useEffect(()=>{if(!h)throw new Error("useDndMonitor must be used within a children of <DndContext>");return h(f)},[f,h])}(u.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;i(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;i(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!c)return null;const p=u.createElement(u.Fragment,null,u.createElement(AF,{id:o,value:r.draggable}),u.createElement(LF,{id:l,announcement:a}));return n?yo.createPortal(p,n):p}var or;function Zu(){}function r5(e,t){return u.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(or||(or={}));const Ui=Object.freeze({x:0,y:0});function cS(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function NF(e,t){const n=Gu(e);return n?(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%":"0 0"}function dS(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function $F(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function vg(e){let{left:t,top:n,height:o,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+o},{x:t+r,y:n+o}]}function uS(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function wg(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const VF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=wg(t,t.left,t.top),i=[];for(const a of o){const{id:l}=a,c=n.get(l);if(c){const d=cS(wg(c),r);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(dS)};function HF(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-o,l=i-n;if(o<r&&n<i){const c=t.width*t.height,d=e.width*e.height,p=a*l;return Number((p/(c+d-p)).toFixed(4))}return 0}const WF=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const r=[];for(const i of o){const{id:a}=i,l=n.get(a);if(l){const c=HF(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort($F)};function Sg(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ui}const UF=function(){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return n.reduce((r,i)=>({...r,top:r.top+1*i.y,bottom:r.bottom+1*i.y,left:r.left+1*i.x,right:r.right+1*i.x}),{...e})}}();function pS(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const qF={ignoreTransform:!1};function u0(e,t){t===void 0&&(t=qF);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:p}=Fr(e).getComputedStyle(e);d&&(n=function(f,h,g){const m=pS(h);if(!m)return f;const{scaleX:y,scaleY:x,x:v,y:b}=m,w=f.left-v-(1-y)*parseFloat(g),M=f.top-b-(1-x)*parseFloat(g.slice(g.indexOf(" ")+1)),k=y?f.width/y:f.width,j=x?f.height/x:f.height;return{width:k,height:j,top:M,right:w+k,bottom:M+j,left:w}}(n,d,p))}const{top:o,left:r,width:i,height:a,bottom:l,right:c}=n;return{top:o,left:r,width:i,height:a,bottom:l,right:c}}function Cg(e){return u0(e,{ignoreTransform:!0})}function N2(e,t){const n=[];return e?function o(r){if(t!=null&&n.length>=t||!r)return n;if(gf(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!j1(r)||aS(r)||n.includes(r))return n;const i=Fr(e).getComputedStyle(r);return r!==e&&function(c,d){d===void 0&&(d=Fr(c).getComputedStyle(c));const p=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(f=>{const h=d[f];return typeof h=="string"&&p.test(h)})}(r,i)&&n.push(r),a=r,(l=i)===void 0&&(l=Fr(a).getComputedStyle(a)),l.position==="fixed"?n:o(r.parentNode);var a,l}(e):n}function hS(e){const[t]=N2(e,1);return t??null}function i5(e){return z2&&e?d0(e)?e:mf(e)?gf(e)||e===Js(e).scrollingElement?window:j1(e)?e:null:null:null}function fS(e){return d0(e)?e.scrollX:e.scrollLeft}function mS(e){return d0(e)?e.scrollY:e.scrollTop}function Bh(e){return{x:fS(e),y:mS(e)}}var sr;function gS(e){return!(!z2||!e)&&e===document.scrollingElement}function yS(e){const t={x:0,y:0},n=gS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=o.y,isRight:e.scrollLeft>=o.x,maxScroll:o,minScroll:t}}(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(sr||(sr={}));const KF={x:.2,y:.2};function GF(e,t,n,o,r){let{top:i,left:a,right:l,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=KF);const{isTop:d,isBottom:p,isLeft:f,isRight:h}=yS(e),g={x:0,y:0},m={x:0,y:0},y=t.height*r.y,x=t.width*r.x;return!d&&i<=t.top+y?(g.y=sr.Backward,m.y=o*Math.abs((t.top+y-i)/y)):!p&&c>=t.bottom-y&&(g.y=sr.Forward,m.y=o*Math.abs((t.bottom-y-c)/y)),!h&&l>=t.right-x?(g.x=sr.Forward,m.x=o*Math.abs((t.right-x-l)/x)):!f&&a<=t.left+x&&(g.x=sr.Backward,m.x=o*Math.abs((t.left+x-a)/x)),{direction:g,speed:m}}function ZF(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function xS(e){return e.reduce((t,n)=>ks(t,Bh(n)),Ui)}function bS(e,t){if(t===void 0&&(t=u0),!e)return;const{top:n,left:o,bottom:r,right:i}=t(e);hS(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const XF=[["x",["left","right"],function(e){return e.reduce((t,n)=>t+fS(n),0)}],["y",["top","bottom"],function(e){return e.reduce((t,n)=>t+mS(n),0)}]];class Nh{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=N2(n),r=xS(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of XF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const d=l(o),p=r[i]-d;return this.rect[c]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Mc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function a5(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t&&o>t.y}var xi,$n;function kg(e){e.preventDefault()}function YF(e){e.stopPropagation()}(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xi||(xi={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}($n||($n={}));const vS={start:[$n.Space,$n.Enter],cancel:[$n.Esc],end:[$n.Space,$n.Enter,$n.Tab]},JF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $n.Right:return{...n,x:n.x+25};case $n.Left:return{...n,x:n.x-25};case $n.Down:return{...n,y:n.y+25};case $n.Up:return{...n,y:n.y-25}}};class yf{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Mc(Js(n)),this.windowListeners=new Mc(Fr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xi.Resize,this.handleCancel),this.windowListeners.add(xi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&bS(o),n(Ui)}handleKeyDown(t){if(B2(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=vS,coordinateGetter:a=JF,scrollBehavior:l="smooth"}=r,{code:c}=t;if(i.end.includes(c))return void this.handleEnd(t);if(i.cancel.includes(c))return void this.handleCancel(t);const{collisionRect:d}=o.current,p=d?{x:d.left,y:d.top}:Ui;this.referenceCoordinates||(this.referenceCoordinates=p);const f=a(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=o1(f,p),g={x:0,y:0},{scrollableAncestors:m}=o.current;for(const y of m){const x=t.code,{isTop:v,isRight:b,isLeft:w,isBottom:M,maxScroll:k,minScroll:j}=yS(y),_=ZF(y),L={x:Math.min(x===$n.Right?_.right-_.width/2:_.right,Math.max(x===$n.Right?_.left:_.left+_.width/2,f.x)),y:Math.min(x===$n.Down?_.bottom-_.height/2:_.bottom,Math.max(x===$n.Down?_.top:_.top+_.height/2,f.y))},T=x===$n.Right&&!b||x===$n.Left&&!w,D=x===$n.Down&&!M||x===$n.Up&&!v;if(T&&L.x!==f.x){const C=y.scrollLeft+h.x,S=x===$n.Right&&C<=k.x||x===$n.Left&&C>=j.x;if(S&&!h.y)return void y.scrollTo({left:C,behavior:l});g.x=S?y.scrollLeft-C:x===$n.Right?y.scrollLeft-k.x:y.scrollLeft-j.x,g.x&&y.scrollBy({left:-g.x,behavior:l});break}if(D&&L.y!==f.y){const C=y.scrollTop+h.y,S=x===$n.Down&&C<=k.y||x===$n.Up&&C>=j.y;if(S&&!h.x)return void y.scrollTo({top:C,behavior:l});g.y=S?y.scrollTop-C:x===$n.Down?y.scrollTop-k.y:y.scrollTop-j.y,g.y&&y.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,ks(o1(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function Eg(e){return!(!e||!("distance"in e))}function Mg(e){return!(!e||!("delay"in e))}yf.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=vS,onActivation:r}=t,{active:i}=n;const{code:a}=e.nativeEvent;if(o.start.includes(a)){const l=i.activatorNode.current;return!(l&&e.target!==l||(e.preventDefault(),r?.({event:e.nativeEvent}),0))}return!1}}];class xf{constructor(t,n,o){var r;o===void 0&&(o=function(l){const{EventTarget:c}=Fr(l);return l instanceof c?l:Js(l)}(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=Js(a),this.documentListeners=new Mc(this.document),this.listeners=new Mc(o),this.windowListeners=new Mc(Fr(a)),this.initialCoordinates=(r=Gu(i))!=null?r:Ui,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(xi.Resize,this.handleCancel),this.windowListeners.add(xi.DragStart,kg),this.windowListeners.add(xi.VisibilityChange,this.handleCancel),this.windowListeners.add(xi.ContextMenu,kg),this.documentListeners.add(xi.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mg(n))return this.timeoutId=setTimeout(this.handleStart,n.delay),void this.handlePending(n);if(Eg(n))return void this.handlePending(n)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(xi.Click,YF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!r)return;const c=(n=Gu(t))!=null?n:Ui,d=o1(r,c);if(!o&&l){if(Eg(l)){if(l.tolerance!=null&&a5(d,l.tolerance))return this.handleCancel();if(a5(d,l.distance))return this.handleStart()}return Mg(l)&&a5(d,l.tolerance)?this.handleCancel():void this.handlePending(l,d)}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===$n.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const QF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wS extends xf{constructor(t){const{event:n}=t,o=Js(n.target);super(t,QF,o)}}wS.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!(!n.isPrimary||n.button!==0||(o?.({event:n}),0))}}];const eB={move:{name:"mousemove"},end:{name:"mouseup"}};var $h;(function(e){e[e.RightClick=2]="RightClick"})($h||($h={}));class SS extends xf{constructor(t){super(t,eB,Js(t.event.target))}}SS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==$h.RightClick&&(o?.({event:n}),!0)}}];const l5={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class CS extends xf{constructor(t){super(t,l5)}static setup(){return window.addEventListener(l5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(l5.move.name,t)};function t(){}}}var Tc,Xu;CS.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:r}=n;return!(r.length>1||(o?.({event:n}),0))}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Tc||(Tc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Xu||(Xu={}));const tB={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};var r1,Vh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(r1||(r1={})),(Vh||(Vh={})).Optimized="optimized";const Tg=new Map;function Hh(e,t){return dc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Yu(e){let{callback:t,disabled:n}=e;const o=F2(t),r=u.useMemo(()=>{if(n||typeof window>"u"||window.ResizeObserver===void 0)return;const{ResizeObserver:i}=window;return new i(o)},[n]);return u.useEffect(()=>()=>r?.disconnect(),[r]),r}function nB(e){return new Nh(u0(e),e)}function _g(e,t,n){t===void 0&&(t=nB);const[o,r]=u.useState(null);function i(){r(c=>{if(!e)return null;var d;if(e.isConnected===!1)return(d=c??n)!=null?d:null;const p=t(e);return JSON.stringify(c)===JSON.stringify(p)?c:p})}const a=function(c){let{callback:d,disabled:p}=c;const f=F2(d),h=u.useMemo(()=>{if(p||typeof window>"u"||window.MutationObserver===void 0)return;const{MutationObserver:g}=window;return new g(f)},[f,p]);return u.useEffect(()=>()=>h?.disconnect(),[h]),h}({callback(c){if(e)for(const d of c){const{type:p,target:f}=d;if(p==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=Yu({callback:i});return Vi(()=>{i(),e?(l?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[e]),o}const jg=[];function Rg(e,t){t===void 0&&(t=[]);const n=u.useRef(null);return u.useEffect(()=>{n.current=null},t),u.useEffect(()=>{const o=e!==Ui;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?o1(e,n.current):Ui}function Ig(e){return u.useMemo(()=>e?function(t){const n=t.innerWidth,o=t.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}(e):null,[e])}const Pg=[];function kS(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return j1(t)?t:e}const oB=[{sensor:wS,options:{}},{sensor:yf,options:{}}],rB={current:{}},ou={draggable:{measure:Cg},droppable:{measure:Cg,strategy:r1.WhileDragging,frequency:Vh.Optimized},dragOverlay:{measure:u0}};class _c extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const iB={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _c,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Zu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ou,measureDroppableContainers:Zu,windowRect:null,measuringScheduled:!1},ES={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Zu,draggableNodes:new Map,over:null,measureDroppableContainers:Zu},i1=u.createContext(ES),MS=u.createContext(iB);function aB(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _c}}}function lB(e,t){switch(t.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case or.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:n}=t,{id:o}=n,r=new _c(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case or.SetDroppableDisabled:{const{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const a=new _c(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case or.UnregisterDroppable:{const{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;const i=new _c(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function sB(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(i1),i=Ku(o),a=Ku(n?.id);return u.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!B2(i)||document.activeElement===i.target)return;const l=r.get(a);if(!l)return;const{activatorNode:c,node:d}=l;if(!c.current&&!d.current)return;requestAnimationFrame(()=>{for(const p of[c.current,d.current]){if(!p)continue;const f=OF(p);if(f){f.focus();break}}})}},[o,t,r,a,i]),null}function TS(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}const $2=u.createContext({...Ui,scaleX:1,scaleY:1});var Ga;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ga||(Ga={}));const cB=u.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=oB,collisionDetection:p=WF,measuring:f,modifiers:h,...g}=e;const m=u.useReducer(lB,void 0,aB),[y,x]=m,[v,b]=function(){const[oe]=u.useState(()=>new Set),ue=u.useCallback(ie=>(oe.add(ie),()=>oe.delete(ie)),[oe]);return[u.useCallback(ie=>{let{type:pe,event:fe}=ie;oe.forEach(ye=>{var De;return(De=ye[pe])==null?void 0:De.call(ye,fe)})},[oe]),ue]}(),[w,M]=u.useState(Ga.Uninitialized),k=w===Ga.Initialized,{draggable:{active:j,nodes:_,translate:L},droppable:{containers:T}}=y,D=j!=null?_.get(j):null,C=u.useRef({initial:null,translated:null}),S=u.useMemo(()=>{var oe;return j!=null?{id:j,data:(oe=D?.data)!=null?oe:rB,rect:C}:null},[j,D]),R=u.useRef(null),[P,I]=u.useState(null),[z,A]=u.useState(null),O=Ec(g,Object.values(g)),N=n1("DndDescribedBy",i),F=u.useMemo(()=>T.getEnabled(),[T]),E=u.useMemo(()=>({draggable:{...ou.draggable,...B?.draggable},droppable:{...ou.droppable,...B?.droppable},dragOverlay:{...ou.dragOverlay,...B?.dragOverlay}}),[(B=f)==null?void 0:B.draggable,B?.droppable,B?.dragOverlay]);var B;const{droppableRects:H,measureDroppableContainers:U,measuringScheduled:Z}=function(oe,ue){let{dragging:ie,dependencies:pe,config:fe}=ue;const[ye,De]=u.useState(null),{frequency:Ve,measure:Je,strategy:ot}=fe,tt=u.useRef(oe),Lt=function(){switch(ot){case r1.Always:return!1;case r1.BeforeDragging:return ie;default:return!ie}}(),At=Ec(Lt),_t=u.useCallback(function(Qt){Qt===void 0&&(Qt=[]),At.current||De(rn=>rn===null?Qt:rn.concat(Qt.filter(yn=>!rn.includes(yn))))},[At]),Yt=u.useRef(null),Jt=dc(Qt=>{if(Lt&&!ie)return Tg;if(!Qt||Qt===Tg||tt.current!==oe||ye!=null){const rn=new Map;for(let yn of oe){if(!yn)continue;if(ye&&ye.length>0&&!ye.includes(yn.id)&&yn.rect.current){rn.set(yn.id,yn.rect.current);continue}const dn=yn.node.current,kt=dn?new Nh(Je(dn),dn):null;yn.rect.current=kt,kt&&rn.set(yn.id,kt)}return rn}return Qt},[oe,ye,ie,Lt,Je]);return u.useEffect(()=>{tt.current=oe},[oe]),u.useEffect(()=>{Lt||_t()},[ie,Lt]),u.useEffect(()=>{ye&&ye.length>0&&De(null)},[JSON.stringify(ye)]),u.useEffect(()=>{Lt||typeof Ve!="number"||Yt.current!==null||(Yt.current=setTimeout(()=>{_t(),Yt.current=null},Ve))},[Ve,Lt,_t,...pe]),{droppableRects:Jt,measureDroppableContainers:_t,measuringScheduled:ye!=null}}(F,{dragging:k,dependencies:[L.x,L.y],config:E.droppable}),G=function(oe,ue){const ie=ue!=null?oe.get(ue):void 0,pe=ie?ie.node.current:null;return dc(fe=>{var ye;return ue==null?null:(ye=pe??fe)!=null?ye:null},[pe,ue])}(_,j),V=u.useMemo(()=>z?Gu(z):null,[z]),le=function(){const oe=P?.autoScrollEnabled===!1,ue=typeof l=="object"?l.enabled===!1:l===!1,ie=k&&!oe&&!ue;return typeof l=="object"?{...l,enabled:ie}:{enabled:ie}}(),re=(ge=G,Q=E.draggable.measure,Hh(ge,Q));var ge,Q;(function(oe){let{activeNode:ue,measure:ie,initialRect:pe,config:fe=!0}=oe;const ye=u.useRef(!1),{x:De,y:Ve}=typeof fe=="boolean"?{x:fe,y:fe}:fe;Vi(()=>{if(!De&&!Ve||!ue)return void(ye.current=!1);if(ye.current||!pe)return;const Je=ue?.node.current;if(!Je||Je.isConnected===!1)return;const ot=Sg(ie(Je),pe);if(De||(ot.x=0),Ve||(ot.y=0),ye.current=!0,Math.abs(ot.x)>0||Math.abs(ot.y)>0){const tt=hS(Je);tt&&tt.scrollBy({top:ot.y,left:ot.x})}},[ue,De,Ve,pe,ie])})({activeNode:j!=null?_.get(j):null,config:le.layoutShiftCompensation,initialRect:re,measure:E.draggable.measure});const xe=_g(G,E.draggable.measure,re),be=_g(G?G.parentElement:null),Fe=u.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=T.getNodeFor((t=Fe.current.over)==null?void 0:t.id),ae=function(oe){let{measure:ue}=oe;const[ie,pe]=u.useState(null),fe=Yu({callback:u.useCallback(Je=>{for(const{target:ot}of Je)if(j1(ot)){pe(tt=>{const Lt=ue(ot);return tt?{...tt,width:Lt.width,height:Lt.height}:Lt});break}},[ue])}),ye=u.useCallback(Je=>{const ot=kS(Je);fe?.disconnect(),ot&&fe?.observe(ot),pe(ot?ue(ot):null)},[ue,fe]),[De,Ve]=nu(ye);return u.useMemo(()=>({nodeRef:De,rect:ie,setRef:Ve}),[ie,De,Ve])}({measure:E.dragOverlay.measure}),we=(n=ae.nodeRef.current)!=null?n:G,se=k?(o=ae.rect)!=null?o:xe:null,J=!(!ae.nodeRef.current||!ae.rect),ce=Sg(ne=J?null:xe,Hh(ne));var ne;const Pe=Ig(we?Fr(we):null),Ee=function(oe){const ue=u.useRef(oe),ie=dc(pe=>oe?pe&&pe!==jg&&oe&&ue.current&&oe.parentNode===ue.current.parentNode?pe:N2(oe):jg,[oe]);return u.useEffect(()=>{ue.current=oe},[oe]),ie}(k?ee??G:null),it=function(oe,ue){ue===void 0&&(ue=u0);const[ie]=oe,pe=Ig(ie?Fr(ie):null),[fe,ye]=u.useState(Pg);function De(){ye(()=>oe.length?oe.map(Je=>gS(Je)?pe:new Nh(ue(Je),Je)):Pg)}const Ve=Yu({callback:De});return Vi(()=>{Ve?.disconnect(),De(),oe.forEach(Je=>Ve?.observe(Je))},[oe]),fe}(Ee),Ue=TS(h,{transform:{x:L.x-ce.x,y:L.y-ce.y,scaleX:1,scaleY:1},activatorEvent:z,active:S,activeNodeRect:xe,containerNodeRect:be,draggingNodeRect:se,over:Fe.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Ee,scrollableAncestorRects:it,windowRect:Pe}),ke=V?ks(V,L):null,_e=function(oe){const[ue,ie]=u.useState(null),pe=u.useRef(oe),fe=u.useCallback(ye=>{const De=i5(ye.target);De&&ie(Ve=>Ve?(Ve.set(De,Bh(De)),new Map(Ve)):null)},[]);return u.useEffect(()=>{const ye=pe.current;if(oe!==ye){De(ye);const Ve=oe.map(Je=>{const ot=i5(Je);return ot?(ot.addEventListener("scroll",fe,{passive:!0}),[ot,Bh(ot)]):null}).filter(Je=>Je!=null);ie(Ve.length?new Map(Ve):null),pe.current=oe}return()=>{De(oe),De(ye)};function De(Ve){Ve.forEach(Je=>{i5(Je)?.removeEventListener("scroll",fe)})}},[fe,oe]),u.useMemo(()=>oe.length?ue?Array.from(ue.values()).reduce((ye,De)=>ks(ye,De),Ui):xS(oe):Ui,[oe,ue])}(Ee),Xe=Rg(_e),Be=Rg(_e,[xe]),ct=ks(Ue,Xe),et=se?UF(se,Ue):null,he=S&&et?p({active:S,collisionRect:et,droppableRects:H,droppableContainers:F,pointerCoordinates:ke}):null,Ye=uS(he,"id"),[Se,Ie]=u.useState(null),de=function(oe,ue,ie){return{...oe,scaleX:ue&&ie?ue.width/ie.width:1,scaleY:ue&&ie?ue.height/ie.height:1}}(J?Ue:ks(Ue,Be),(r=Se?.rect)!=null?r:null,xe),Oe=u.useRef(null),Le=u.useCallback((oe,ue)=>{let{sensor:ie,options:pe}=ue;if(R.current==null)return;const fe=_.get(R.current);if(!fe)return;const ye=oe.nativeEvent,De=new ie({active:R.current,activeNode:fe,event:ye,options:pe,context:Fe,onAbort(Je){if(!_.get(Je))return;const{onDragAbort:ot}=O.current,tt={id:Je};ot?.(tt),v({type:"onDragAbort",event:tt})},onPending(Je,ot,tt,Lt){if(!_.get(Je))return;const{onDragPending:At}=O.current,_t={id:Je,constraint:ot,initialCoordinates:tt,offset:Lt};At?.(_t),v({type:"onDragPending",event:_t})},onStart(Je){const ot=R.current;if(ot==null)return;const tt=_.get(ot);if(!tt)return;const{onDragStart:Lt}=O.current,At={activatorEvent:ye,active:{id:ot,data:tt.data,rect:C}};yo.unstable_batchedUpdates(()=>{Lt?.(At),M(Ga.Initializing),x({type:or.DragStart,initialCoordinates:Je,active:ot}),v({type:"onDragStart",event:At}),I(Oe.current),A(ye)})},onMove(Je){x({type:or.DragMove,coordinates:Je})},onEnd:Ve(or.DragEnd),onCancel:Ve(or.DragCancel)});function Ve(Je){return async function(){const{active:ot,collisions:tt,over:Lt,scrollAdjustedTranslate:At}=Fe.current;let _t=null;if(ot&&At){const{cancelDrop:Yt}=O.current;_t={activatorEvent:ye,active:ot,collisions:tt,delta:At,over:Lt},Je===or.DragEnd&&typeof Yt=="function"&&await Promise.resolve(Yt(_t))&&(Je=or.DragCancel)}R.current=null,yo.unstable_batchedUpdates(()=>{x({type:Je}),M(Ga.Uninitialized),Ie(null),I(null),A(null),Oe.current=null;const Yt=Je===or.DragEnd?"onDragEnd":"onDragCancel";if(_t){const Jt=O.current[Yt];Jt?.(_t),v({type:Yt,event:_t})}})}}Oe.current=De},[_]),je=u.useCallback((oe,ue)=>(ie,pe)=>{const fe=ie.nativeEvent,ye=_.get(pe);if(R.current!==null||!ye||fe.dndKit||fe.defaultPrevented)return;const De={active:ye};oe(ie,ue.options,De)===!0&&(fe.dndKit={capturedBy:ue.sensor},R.current=pe,Le(ie,ue))},[_,Le]),K=function(oe,ue){return u.useMemo(()=>oe.reduce((ie,pe)=>{const{sensor:fe}=pe;return[...ie,...fe.activators.map(ye=>({eventName:ye.eventName,handler:ue(ye.handler,pe)}))]},[]),[oe,ue])}(d,je);(function(oe){u.useEffect(()=>{if(!z2)return;const ue=oe.map(ie=>{let{sensor:pe}=ie;return pe.setup==null?void 0:pe.setup()});return()=>{for(const ie of ue)ie?.()}},oe.map(ue=>{let{sensor:ie}=ue;return ie}))})(d),Vi(()=>{xe&&w===Ga.Initializing&&M(Ga.Initialized)},[xe,w]),u.useEffect(()=>{const{onDragMove:oe}=O.current,{active:ue,activatorEvent:ie,collisions:pe,over:fe}=Fe.current;if(!ue||!ie)return;const ye={active:ue,activatorEvent:ie,collisions:pe,delta:{x:ct.x,y:ct.y},over:fe};yo.unstable_batchedUpdates(()=>{oe?.(ye),v({type:"onDragMove",event:ye})})},[ct.x,ct.y]),u.useEffect(()=>{const{active:oe,activatorEvent:ue,collisions:ie,droppableContainers:pe,scrollAdjustedTranslate:fe}=Fe.current;if(!oe||R.current==null||!ue||!fe)return;const{onDragOver:ye}=O.current,De=pe.get(Ye),Ve=De&&De.rect.current?{id:De.id,rect:De.rect.current,data:De.data,disabled:De.disabled}:null,Je={active:oe,activatorEvent:ue,collisions:ie,delta:{x:fe.x,y:fe.y},over:Ve};yo.unstable_batchedUpdates(()=>{Ie(Ve),ye?.(Je),v({type:"onDragOver",event:Je})})},[Ye]),Vi(()=>{Fe.current={activatorEvent:z,active:S,activeNode:G,collisionRect:et,collisions:he,droppableRects:H,draggableNodes:_,draggingNode:we,draggingNodeRect:se,droppableContainers:T,over:Se,scrollableAncestors:Ee,scrollAdjustedTranslate:ct},C.current={initial:se,translated:et}},[S,G,he,et,_,we,se,H,T,Se,Ee,ct]),function(oe){let{acceleration:ue,activator:ie=Tc.Pointer,canScroll:pe,draggingRect:fe,enabled:ye,interval:De=5,order:Ve=Xu.TreeOrder,pointerCoordinates:Je,scrollableAncestors:ot,scrollableAncestorRects:tt,delta:Lt,threshold:At}=oe;const _t=function(tn){let{delta:_n,disabled:Nn}=tn;const fn=Ku(_n);return dc(fo=>{if(Nn||!fn||!fo)return tB;const bo=Math.sign(_n.x-fn.x),Fo=Math.sign(_n.y-fn.y);return{x:{[sr.Backward]:fo.x[sr.Backward]||bo===-1,[sr.Forward]:fo.x[sr.Forward]||bo===1},y:{[sr.Backward]:fo.y[sr.Backward]||Fo===-1,[sr.Forward]:fo.y[sr.Forward]||Fo===1}}},[Nn,_n,fn])}({delta:Lt,disabled:!ye}),[Yt,Jt]=function(){const tn=u.useRef(null);return[u.useCallback((_n,Nn)=>{tn.current=setInterval(_n,Nn)},[]),u.useCallback(()=>{tn.current!==null&&(clearInterval(tn.current),tn.current=null)},[])]}(),Qt=u.useRef({x:0,y:0}),rn=u.useRef({x:0,y:0}),yn=u.useMemo(()=>{switch(ie){case Tc.Pointer:return Je?{top:Je.y,bottom:Je.y,left:Je.x,right:Je.x}:null;case Tc.DraggableRect:return fe}},[ie,fe,Je]),dn=u.useRef(null),kt=u.useCallback(()=>{const tn=dn.current;if(!tn)return;const _n=Qt.current.x*rn.current.x,Nn=Qt.current.y*rn.current.y;tn.scrollBy(_n,Nn)},[]),xn=u.useMemo(()=>Ve===Xu.TreeOrder?[...ot].reverse():ot,[Ve,ot]);u.useEffect(()=>{if(ye&&ot.length&&yn){for(const tn of xn){if(pe?.(tn)===!1)continue;const _n=ot.indexOf(tn),Nn=tt[_n];if(!Nn)continue;const{direction:fn,speed:fo}=GF(tn,Nn,yn,ue,At);for(const bo of["x","y"])_t[bo][fn[bo]]||(fo[bo]=0,fn[bo]=0);if(fo.x>0||fo.y>0)return Jt(),dn.current=tn,Yt(kt,De),Qt.current=fo,void(rn.current=fn)}Qt.current={x:0,y:0},rn.current={x:0,y:0},Jt()}else Jt()},[ue,kt,pe,Jt,ye,De,JSON.stringify(yn),JSON.stringify(_t),Yt,ot,xn,tt,JSON.stringify(At)])}({...le,delta:L,draggingRect:et,pointerCoordinates:ke,scrollableAncestors:Ee,scrollableAncestorRects:it});const W=u.useMemo(()=>({active:S,activeNode:G,activeNodeRect:xe,activatorEvent:z,collisions:he,containerNodeRect:be,dragOverlay:ae,draggableNodes:_,droppableContainers:T,droppableRects:H,over:Se,measureDroppableContainers:U,scrollableAncestors:Ee,scrollableAncestorRects:it,measuringConfiguration:E,measuringScheduled:Z,windowRect:Pe}),[S,G,xe,z,he,be,ae,_,T,H,Se,U,Ee,it,E,Z,Pe]),te=u.useMemo(()=>({activatorEvent:z,activators:K,active:S,activeNodeRect:xe,ariaDescribedById:{draggable:N},dispatch:x,draggableNodes:_,over:Se,measureDroppableContainers:U}),[z,K,S,xe,x,N,_,Se,U]);return u.createElement(sS.Provider,{value:b},u.createElement(i1.Provider,{value:te},u.createElement(MS.Provider,{value:W},u.createElement($2.Provider,{value:de},c)),u.createElement(sB,{disabled:a?.restoreFocus===!1})),u.createElement(BF,{...a,hiddenTextDescribedById:N}))}),dB=u.createContext(null),Og="button";function _S(){return u.useContext(MS)}const uB={timeout:25};function pB(e){let{animation:t,children:n}=e;const[o,r]=u.useState(null),[i,a]=u.useState(null),l=Ku(n);return n||o||!l||r(l),Vi(()=>{if(!i)return;const c=o?.key,d=o?.props.id;c!=null&&d!=null?Promise.resolve(t(d,i)).then(()=>{r(null)}):r(null)},[t,o,i]),u.createElement(u.Fragment,null,n,o?u.cloneElement(o,{ref:a}):null)}const hB={x:0,y:0,scaleX:1,scaleY:1};function fB(e){let{children:t}=e;return u.createElement(i1.Provider,{value:ES},u.createElement($2.Provider,{value:hB},t))}const mB={position:"fixed",touchAction:"none"},gB=e=>B2(e)?"transform 250ms ease":void 0,yB=u.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:l,style:c,transform:d,transition:p=gB}=e;if(!l)return null;const f=r?d:{...d,scaleX:1,scaleY:1},h={...mB,width:l.width,height:l.height,top:l.top,left:l.left,transform:Ul.Transform.toString(f),transformOrigin:r&&o?NF(o,l):void 0,transition:typeof p=="function"?p(o):p,...c};return u.createElement(n,{className:a,style:h,ref:t},i)}),jS={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ul.Transform.toString(t)},{transform:Ul.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:o}=t;const r={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[l,c]of Object.entries(i.active))c!==void 0&&(r[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(i!=null&&i.dragOverlay)for(const[l,c]of Object.entries(i.dragOverlay))c!==void 0&&o.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&o.node.classList.add(a.dragOverlay),function(){for(const[l,c]of Object.entries(r))n.node.style.setProperty(l,c);a!=null&&a.active&&n.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};let Dg=0;const xB=u.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:r,transition:i,modifiers:a,wrapperElement:l="div",className:c,zIndex:d=999}=e;const{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:m,droppableContainers:y,dragOverlay:x,over:v,measuringConfiguration:b,scrollableAncestors:w,scrollableAncestorRects:M,windowRect:k}=_S(),j=u.useContext($2),_=(S=f?.id,u.useMemo(()=>{if(S!=null)return Dg++,Dg},[S])),L=TS(a,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:x.rect,over:v,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:M,transform:j,windowRect:k}),T=Hh(h),D=function(R){let{config:P,draggableNodes:I,droppableContainers:z,measuringConfiguration:A}=R;return F2((O,N)=>{if(P===null)return;const F=I.get(O);if(!F)return;const E=F.node.current;if(!E)return;const B=kS(N);if(!B)return;const{transform:H}=Fr(N).getComputedStyle(N),U=pS(H);if(!U)return;const Z=typeof P=="function"?P:function(G){const{duration:V,easing:le,sideEffects:re,keyframes:ge}={...jS,...G};return Q=>{let{active:xe,dragOverlay:be,transform:Fe,...ee}=Q;if(!V)return;const ae=be.rect.left-xe.rect.left,we=be.rect.top-xe.rect.top,se={scaleX:Fe.scaleX!==1?xe.rect.width*Fe.scaleX/be.rect.width:1,scaleY:Fe.scaleY!==1?xe.rect.height*Fe.scaleY/be.rect.height:1},J={x:Fe.x-ae,y:Fe.y-we,...se},ce=ge({...ee,active:xe,dragOverlay:be,transform:{initial:Fe,final:J}}),[ne]=ce,Pe=ce[ce.length-1];if(JSON.stringify(ne)===JSON.stringify(Pe))return;const Ee=re?.({active:xe,dragOverlay:be,...ee}),it=be.node.animate(ce,{duration:V,easing:le,fill:"forwards"});return new Promise(Ue=>{it.onfinish=()=>{Ee?.(),Ue()}})}}(P);return bS(E,A.draggable.measure),Z({active:{id:O,data:F.data,node:E,rect:A.draggable.measure(E)},draggableNodes:I,dragOverlay:{node:N,rect:A.dragOverlay.measure(B)},droppableContainers:z,measuringConfiguration:A,transform:U})})}({config:o,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),C=T?x.setRef:void 0;var S;return u.createElement(fB,null,u.createElement(pB,{animation:D},f&&_?u.createElement(yB,{key:_,id:f.id,ref:C,as:l,activatorEvent:p,adjustScale:t,className:c,transition:i,rect:T,style:{zIndex:d,...r},transform:L},n):null))});function bf(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function bB(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Ed(e){return e!==null&&e>=0}const Md={scaleX:1,scaleY:1},vB=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:a}=e;const l=(t=n[r])!=null?t:o;if(!l)return null;const c=function(d,p,f){const h=d[p],g=d[p-1],m=d[p+1];return h&&(g||m)?f<p?g?h.left-(g.left+g.width):m.left-(h.left+h.width):m?m.left-(h.left+h.width):h.left-(g.left+g.width):0}(n,a,r);if(a===r){const d=n[i];return d?{x:r<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...Md}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Md}:a<r&&a>=i?{x:l.width+c,y:0,...Md}:{x:0,y:0,...Md}},vf=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e;const i=bf(t,o,n),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},RS="Sortable",IS=u.createContext({activeIndex:-1,containerId:RS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vf,disabled:{draggable:!1,droppable:!1}});function wB(e){let{children:t,id:n,items:o,strategy:r=vf,disabled:i=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:p}=_S(),f=n1(RS,n),h=l.rect!==null,g=u.useMemo(()=>o.map(j=>typeof j=="object"&&"id"in j?j.id:j),[o]),m=a!=null,y=a?g.indexOf(a.id):-1,x=d?g.indexOf(d.id):-1,v=u.useRef(g),b=!function(j,_){if(j===_)return!0;if(j.length!==_.length)return!1;for(let L=0;L<j.length;L++)if(j[L]!==_[L])return!1;return!0}(g,v.current),w=x!==-1&&y===-1||b,M=function(j){return typeof j=="boolean"?{draggable:j,droppable:j}:j}(i);Vi(()=>{b&&m&&p(g)},[b,g,m,p]),u.useEffect(()=>{v.current=g},[g]);const k=u.useMemo(()=>({activeIndex:y,containerId:f,disabled:M,disableTransforms:w,items:g,overIndex:x,useDragOverlay:h,sortedRects:bB(g,c),strategy:r}),[y,f,M.draggable,M.droppable,w,g,x,c,h,r]);return u.createElement(IS.Provider,{value:k},t)}const SB=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bf(n,o,r).indexOf(t)},CB=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:d}=e;return!(!d||!o||l!==i&&r===a||!n&&(a===r||t!==c))},kB={duration:200,easing:"ease"},PS="transform",EB=Ul.Transition.toString({property:PS,duration:0,easing:"linear"}),MB={roleDescription:"sortable"};function Ju(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const TB=[$n.Down,$n.Right,$n.Up,$n.Left],_B=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(TB.includes(e.code)){if(e.preventDefault(),!n||!o)return;const p=[];i.getEnabled().forEach(g=>{if(!g||g!=null&&g.disabled)return;const m=r.get(g.id);if(m)switch(e.code){case $n.Down:o.top<m.top&&p.push(g);break;case $n.Up:o.top>m.top&&p.push(g);break;case $n.Left:o.left>m.left&&p.push(g);break;case $n.Right:o.left<m.left&&p.push(g)}});const f=(g=>{let{collisionRect:m,droppableRects:y,droppableContainers:x}=g;const v=vg(m),b=[];for(const w of x){const{id:M}=w,k=y.get(M);if(k){const j=vg(k),_=v.reduce((T,D,C)=>T+cS(j[C],D),0),L=Number((_/4).toFixed(4));b.push({id:M,data:{droppableContainer:w,value:L}})}}return b.sort(dS)})({collisionRect:o,droppableRects:r,droppableContainers:p});let h=uS(f,"id");if(h===a?.id&&f.length>1&&(h=f[1].id),h!=null){const g=i.get(n.id),m=i.get(h),y=m?r.get(m.id):null,x=m?.node.current;if(x&&y&&g&&m){const v=N2(x).some((j,_)=>l[_]!==j),b=Ag(g,m),w=(d=m,!!(Ju(c=g)&&Ju(d)&&Ag(c,d))&&c.data.current.sortable.index<d.data.current.sortable.index),M=v||!b?{x:0,y:0}:{x:w?o.width-y.width:0,y:w?o.height-y.height:0},k={x:y.left,y:y.top};return M.x&&M.y?k:o1(k,M)}}}var c,d};function Ag(e,t){return!(!Ju(e)||!Ju(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const jB=e=>{let{transform:t}=e;return{...t,y:0}},RB=u.memo(u.forwardRef((e,t)=>{const{children:n,style:o,className:r,index:i,editing:a,editable:l,selectedIndex:c,background:d,activeColor:p,borderColor:f,borderWidth:h,dragging:g,...m}=e;return s.jsxs("div",{ref:t,className:Zr(r),style:{...o,display:"flex",flexDirection:"column",background:c===i?"white":d,minHeight:"0px",fontFamily:"inherit",fontSize:"16px",fontWeight:c===i?"700":"400",lineHeight:"1",letterSpacing:"0px",textTransform:"none",minWidth:"unset"},...m,children:[s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},children:[s.jsx("div",{style:{marginLeft:c===i?"0px":"-1px",marginTop:c===i?"0px":"4px",marginBottom:"0px",background:"grey",minWidth:"1px"}}),n,c===i?s.jsx("div",{style:{marginLeft:"0px",marginTop:"0px",marginBottom:"0px",background:"grey",minWidth:"1px"}}):s.jsx(s.Fragment,{})]}),s.jsx("div",{style:{flex:"1 1 100%",background:c===i&&p?p?.toCSS():"none",minHeight:"2px"}})]})})),Fi={Wrapper:"_Wrapper_1wyun_25",fadeIn:"_fadeIn_1wyun_33",dragOverlay:"_dragOverlay_1wyun_37",Item:"_Item_1wyun_47",withHandle:"_withHandle_1wyun_61",dragging:"_dragging_1wyun_66",disabled:"_disabled_1wyun_74"},OS=u.memo(u.forwardRef(({color:e,dragOverlay:t,dragging:n,disabled:o,fadeIn:r,handle:i,height:a,index:l,listeners:c,onRemove:d,renderItem:p,sorting:f,style:h,transition:g,transform:m,value:y,wrapperStyle:x,...v},b)=>{u.useEffect(()=>{if(t)return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=""}},[t]);const w=p?p({dragOverlay:!!t,dragging:!!n,sorting:!!f,index:l,fadeIn:!!r,listeners:c,ref:b,style:h,transform:m,transition:g,value:y}):s.jsx(s.Fragment,{children:y});return s.jsx("div",{className:Zr("tab-item",Fi.Wrapper,r&&Fi.fadeIn,f&&Fi.sorting,t&&Fi.dragOverlay),style:{...x,transition:[g,x?.transition].filter(Boolean).join(", "),"--translate-x":m?`${Math.round(m.x)}px`:void 0,"--translate-y":m?`${Math.round(m.y)}px`:void 0,"--scale-x":m?.scaleX?`${m.scaleX}`:void 0,"--scale-y":m?.scaleY?`${m.scaleY}`:void 0,"--index":l},ref:b,children:s.jsx("div",{className:Zr(Fi.Item,n&&Fi.dragging,i&&Fi.withHandle,t&&Fi.dragOverlay,o&&Fi.disabled,e&&Fi.color,"dragging"),style:h,"data-cypress":"draggable-item",...i?void 0:c,...v,tabIndex:i?void 0:-1,children:w})})})),Lg={Row:"_Row_1kr10_1"},IB=u.memo(u.forwardRef(({children:e,horizontal:t,style:n},o)=>s.jsx("div",{ref:o,style:{...n},className:Zr(Lg.Row,t&&Lg.horizontal),children:e}))),PB={...jS},OB=u.memo(u.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=VF,coordinateGetter:l=_B,dropAnimation:c=PB,getItemStyles:d=()=>({}),getNewIndex:p,handle:f=!1,items:h,onMove:g,isDisabled:m=()=>!1,measuring:y,modifiers:x,renderItem:v,renderDivider:b,reorderItems:w=bf,strategy:M=vf,style:k,useDragOverlay:j=!0,onDragStart:_,wrapperStyle:L=()=>({})}=e,[T,D]=u.useState(()=>h);u.useEffect(()=>{D(h)},[h]);const[C,S]=u.useState(null),R=function(){for(var O=arguments.length,N=new Array(O),F=0;F<O;F++)N[F]=arguments[F];return u.useMemo(()=>[...N].filter(E=>E!=null),[...N])}(r5(SS,{activationConstraint:o}),r5(CS,{activationConstraint:o}),r5(yf,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:l})),P=T.indexOf.bind(T),I=C?P(C):-1,z=[];T.map((O,N)=>{z.push(s.jsx(DB,{id:O,handle:f,index:N,style:d,wrapperStyle:L,disabled:m(O),renderItem:v,animateLayoutChanges:r,useDragOverlay:j,getNewIndex:p},O+"-"+N));const F=b?.({key:"divider-"+N});F&&z.push(F)});const{getPortalContainer:A}=(u.useEffect(()=>{function O(){const N=document.fullscreenElement;if(!N)return;let F=N.querySelector(".fullscreen-portal-root");F||(F=document.createElement("div"),F.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",N.appendChild(F))}return ed++,O(),document.addEventListener("fullscreenchange",O),()=>{document.removeEventListener("fullscreenchange",O),ed--,ed<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(N=>{N.parentNode&&N.parentNode.removeChild(N)}),ed=0)}},[]),{getPortalContainer:YR});return s.jsxs(cB,{sensors:R,collisionDetection:a,onDragStart:O=>{const{active:N}=O;N&&(_?.(O),S(N.id))},autoScroll:{canScroll:O=>!0},onDragEnd:O=>{if(S(null),O.over){const N=P(O.over.id);I!==N&&(D(F=>w(F,I,N)),g?.(I,N))}},onDragCancel:()=>{S(null)},measuring:y,modifiers:x,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...k},className:Zr(n,Fi.Wrapper),children:s.jsx(wB,{items:T,strategy:M,children:s.jsx(IB,{ref:t,children:z})})}),j?yo.createPortal(s.jsx(xB,{adjustScale:i,dropAnimation:c,children:C?s.jsx(OS,{value:T[I],handle:f,renderItem:v,wrapperStyle:L({index:I,isDragging:!0,id:T[I]}),index:I,dragging:!0,style:d({id:T[I],index:I,isSorting:C!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),A()):null]})}));function DB({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:o,id:r,index:i,onRemove:a,style:l,renderItem:c,useDragOverlay:d,wrapperStyle:p}){const{attributes:f,isDragging:h,isSorting:g,listeners:m,overIndex:y,setNodeRef:x,transform:v,transition:b}=function(w){let{animateLayoutChanges:M=CB,attributes:k,disabled:j,data:_,getNewIndex:L=SB,id:T,strategy:D,resizeObserverConfig:C,transition:S=kB}=w;const{items:R,containerId:P,activeIndex:I,disabled:z,disableTransforms:A,sortedRects:O,overIndex:N,useDragOverlay:F,strategy:E}=u.useContext(IS),B=(he=z,typeof(et=j)=="boolean"?{draggable:et,droppable:!1}:{draggable:(Ye=et?.draggable)!=null?Ye:he.draggable,droppable:(Se=et?.droppable)!=null?Se:he.droppable}),H=R.indexOf(T),U=u.useMemo(()=>({sortable:{containerId:P,index:H,items:R},..._}),[P,_,H,R]),Z=u.useMemo(()=>R.slice(R.indexOf(T)),[R,T]),{rect:G,node:V,isOver:le,setNodeRef:re}=function(Ie){let{data:de,disabled:Oe=!1,id:Le,resizeObserverConfig:je}=Ie;const K=n1("Droppable"),{active:W,dispatch:te,over:oe,measureDroppableContainers:ue}=u.useContext(i1),ie=u.useRef({disabled:Oe}),pe=u.useRef(!1),fe=u.useRef(null),ye=u.useRef(null),{disabled:De,updateMeasurementsFor:Ve,timeout:Je}={...uB,...je},ot=Ec(Ve??Le),tt=Yu({callback:u.useCallback(()=>{pe.current?(ye.current!=null&&clearTimeout(ye.current),ye.current=setTimeout(()=>{ue(Array.isArray(ot.current)?ot.current:[ot.current]),ye.current=null},Je)):pe.current=!0},[Je]),disabled:De||!W}),Lt=u.useCallback((Jt,Qt)=>{tt&&(Qt&&(tt.unobserve(Qt),pe.current=!1),Jt&&tt.observe(Jt))},[tt]),[At,_t]=nu(Lt),Yt=Ec(de);return u.useEffect(()=>{tt&&At.current&&(tt.disconnect(),pe.current=!1,tt.observe(At.current))},[At,tt]),u.useEffect(()=>(te({type:or.RegisterDroppable,element:{id:Le,key:K,disabled:Oe,node:At,rect:fe,data:Yt}}),()=>te({type:or.UnregisterDroppable,key:K,id:Le})),[Le]),u.useEffect(()=>{Oe!==ie.current.disabled&&(te({type:or.SetDroppableDisabled,id:Le,key:K,disabled:Oe}),ie.current.disabled=Oe)},[Le,K,Oe,te]),{active:W,rect:fe,isOver:oe?.id===Le,node:At,over:oe,setNodeRef:_t}}({id:T,data:U,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Z,...C}}),{active:ge,activatorEvent:Q,activeNodeRect:xe,attributes:be,setNodeRef:Fe,listeners:ee,isDragging:ae,over:we,setActivatorNodeRef:se,transform:J}=function(Ie){let{id:de,data:Oe,disabled:Le=!1,attributes:je}=Ie;const K=n1("Draggable"),{activators:W,activatorEvent:te,active:oe,activeNodeRect:ue,ariaDescribedById:ie,draggableNodes:pe,over:fe}=u.useContext(i1),{role:ye=Og,roleDescription:De="draggable",tabIndex:Ve=0}=je??{},Je=oe?.id===de,ot=u.useContext(Je?$2:dB),[tt,Lt]=nu(),[At,_t]=nu(),Yt=(Qt=W,rn=de,u.useMemo(()=>Qt.reduce((yn,dn)=>{let{eventName:kt,handler:xn}=dn;return yn[kt]=tn=>{xn(tn,rn)},yn},{}),[Qt,rn])),Jt=Ec(Oe);var Qt,rn;return Vi(()=>(pe.set(de,{id:de,key:K,node:tt,activatorNode:At,data:Jt}),()=>{const yn=pe.get(de);yn&&yn.key===K&&pe.delete(de)}),[pe,de]),{active:oe,activatorEvent:te,activeNodeRect:ue,attributes:u.useMemo(()=>({role:ye,tabIndex:Ve,"aria-disabled":Le,"aria-pressed":!(!Je||ye!==Og)||void 0,"aria-roledescription":De,"aria-describedby":ie.draggable}),[Le,ye,Ve,Je,De,ie.draggable]),isDragging:Je,listeners:Le?void 0:Yt,node:tt,over:fe,setNodeRef:Lt,setActivatorNodeRef:_t,transform:ot}}({id:T,data:U,attributes:{...MB,...k},disabled:B.draggable}),ce=function(){for(var Ie=arguments.length,de=new Array(Ie),Oe=0;Oe<Ie;Oe++)de[Oe]=arguments[Oe];return u.useMemo(()=>Le=>{de.forEach(je=>je(Le))},de)}(re,Fe),ne=!!ge,Pe=ne&&!A&&Ed(I)&&Ed(N),Ee=!F&&ae,it=Pe?(Ee&&Pe?J:null)??(D??E)({rects:O,activeNodeRect:xe,activeIndex:I,overIndex:N,index:H}):null,Ue=Ed(I)&&Ed(N)?L({id:T,items:R,activeIndex:I,overIndex:N}):H,ke=ge?.id,_e=u.useRef({activeId:ke,items:R,newIndex:Ue,containerId:P}),Xe=R!==_e.current.items,Be=M({active:ge,containerId:P,isDragging:ae,isSorting:ne,id:T,index:H,items:R,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:S,wasDragging:_e.current.activeId!=null}),ct=function(Ie){let{disabled:de,index:Oe,node:Le,rect:je}=Ie;const[K,W]=u.useState(null),te=u.useRef(Oe);return Vi(()=>{if(!de&&Oe!==te.current&&Le.current){const oe=je.current;if(oe){const ue=u0(Le.current,{ignoreTransform:!0}),ie={x:oe.left-ue.left,y:oe.top-ue.top,scaleX:oe.width/ue.width,scaleY:oe.height/ue.height};(ie.x||ie.y)&&W(ie)}}Oe!==te.current&&(te.current=Oe)},[de,Oe,Le,je]),u.useEffect(()=>{K&&W(null)},[K]),K}({disabled:!Be,index:H,node:V,rect:G});var et,he,Ye,Se;return u.useEffect(()=>{ne&&_e.current.newIndex!==Ue&&(_e.current.newIndex=Ue),P!==_e.current.containerId&&(_e.current.containerId=P),R!==_e.current.items&&(_e.current.items=R)},[ne,Ue,P,R]),u.useEffect(()=>{if(ke===_e.current.activeId)return;if(ke!=null&&_e.current.activeId==null)return void(_e.current.activeId=ke);const Ie=setTimeout(()=>{_e.current.activeId=ke},50);return()=>clearTimeout(Ie)},[ke]),{active:ge,activeIndex:I,attributes:be,data:U,rect:G,index:H,newIndex:Ue,items:R,isOver:le,isSorting:ne,isDragging:ae,listeners:ee,node:V,overIndex:N,over:we,setNodeRef:ce,setActivatorNodeRef:se,setDroppableNodeRef:re,setDraggableNodeRef:Fe,transform:ct??it,transition:ct||Xe&&_e.current.newIndex===H?EB:Ee&&!B2(Q)||!S||!ne&&!Be?void 0:Ul.Transition.toString({...S,property:PS})}}({id:r,animateLayoutChanges:t,disabled:e,getNewIndex:n});return s.jsx(OS,{ref:x,value:r,disabled:e,dragging:h,sorting:g,handle:o,renderItem:c,index:i,style:l({index:i,id:r,isDragging:h,isSorting:g,overIndex:y}),onRemove:a?()=>a(r):void 0,transform:v,transition:b,wrapperStyle:p({index:i,isDragging:h,id:r}),listeners:m,"data-index":i,"data-id":r,dragOverlay:!d&&h,...f})}const AB=new $.Color("rgb(33, 115, 70)"),LB="#eee",zB=e=>s.jsx(RB,{...e}),DS=u.memo(u.forwardRef((e,t)=>{const{children:n,style:o,className:r,selectedTabIndex:i=0,tabNames:a=[],onSelectedTabIndexChange:l,onTabNameChange:c,onTabMove:d,createScrollStartButton:p=eb,createScrollEndButton:f=tb,createScrollEdgeButton:h=LR,createTabButton:g=zB,createTabDivider:m,editLabelProps:y,disabled:x=!1,disableDrag:v=!1,background:b="white",activeColor:w=AB,borderColor:M=LB,borderWidth:k=1}=e,[j,_]=u.useState(i),[L,T]=u.useState(a),D=u.useCallback(se=>{const J=A.current?.[se]?.closest(".tab-item")??A.current?.[se];J&&U.current?.scrollTo({top:J.offsetTop,left:J.offsetLeft,behavior:"smooth"})},[]);u.useEffect(()=>{D(i)},[i]);const C=u.useCallback((se,J)=>{J!==j&&(_(J),l?.(J)),D(J)},[l,j]),S=u.useCallback((se,J)=>{d?.(se,J)},[d]),R=u.useRef(null),[P,I]=u.useState(-1),z=u.useCallback((se,J)=>{c?.(se,J)},[c]);u.useLayoutEffect(()=>{_(i)},[i]),u.useLayoutEffect(()=>{T(a)},[a]);const A=u.useRef([]),O=u.useRef(null);u.useImperativeHandle(t,()=>Object.assign({startEdit(se){A.current?.[se]?.startEdit()},cancel(se){A.current?.[se]?.cancel()}},O.current),[j,P]);const N=u.useCallback(({value:se,index:J,dragging:ce})=>{const{style:ne,maxLength:Pe,...Ee}=y||{},it=s.jsx(PF,{ref:Ue=>{A.current[J]=Ue},value:se,disabled:x,maxLength:Pe,style:{color:j===J&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...ne},styleHover:{},onSubmit:Ue=>(R.current=!1,I(-1),z(J,Ue)),onCancel:()=>{R.current=!1,I(-1)},onChange:Ue=>{R.current=!0,I(J)},...Ee});return g({onClick:Ue=>C(Ue,J),value:se,index:J,editing:P===J&&R.current,editable:!0,disabled:x,selectedIndex:j,background:b,activeColor:w,borderColor:M,borderWidth:k,dragging:ce,children:it})},[j,z,C,y,x,P,g]),[F,{width:E}]=Wl(),[B,{width:H}]=Wl(),U=u.useRef(null),[Z,G]=u.useState({left:0,top:0,width:0,height:0}),[V,le]=u.useState(null);u.useEffect(()=>{V!==null&&U.current&&U.current.scrollTo({left:V,behavior:"smooth"})},[V]);const re=u.useCallback((se,J=!1)=>{if(!U.current)return 0;let ce=U.current.firstChild.getBoundingClientRect(),ne=U.current.firstChild.firstChild.children,Pe=0;return Pe=J?0:b4.getScrollTo(se,ce.left,ne,!0,Math.max(0,se-200)),le(Pe),Math.max(0,Pe)},[]),ge=u.useCallback((se,J=!1)=>{if(!U.current)return 0;let ce=U.current.firstChild.getBoundingClientRect(),ne=U.current.firstChild.firstChild.children,Pe=0;const Ee=Math.ceil(H-E);return Pe=J?Ee:b4.getScrollTo(se,ce.left,ne,!1,Math.max(0,se+200)),le(Pe),Math.min(Ee,Pe)},[H,E]),Q=u.useRef(null),xe=u.useRef(null),be=u.useCallback(()=>{xe.current&&(clearTimeout(xe.current),xe.current=null,Q.current=null)},[]),Fe=u.useCallback((se,J,ce=260)=>{Q.current=se,xe.current=setTimeout(()=>{const ne=J?re(Q.current||se):ge(Q.current||se);ne!==Q.current?Fe(ne,J,120):be()},ce)},[re,ge,be]);u.useEffect(()=>()=>be(),[be]);const ee=u.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(Z.left)<=0||Math.floor(H-E)===0,orientation:yr.Horizontal,onMouseUp:be,onMouseLeave:be,onMouseDown:()=>Fe(U.current.scrollLeft,!0),onClick:se=>re(Math.min(U.current.scrollLeft,V??Number.MAX_SAFE_INTEGER),se.ctrlKey)}),[Z,V,H,E]),ae=u.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(H-E)<=Math.ceil(Z.left),orientation:yr.Horizontal,onMouseUp:be,onMouseLeave:be,onMouseDown:()=>Fe(U.current.scrollLeft,!1),onClick:se=>ge(Math.max(U.current.scrollLeft,V??0),se.ctrlKey)}),[Z,V,H,E]),we=u.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,h?.(ee)]}),[ee,ae,p,f,n,h]);return s.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:Zr("_TabStrip_3x0dp_1",r),ref:O,children:[s.jsx("div",{style:{borderTop:`solid ${M} ${k}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:we}),s.jsx("div",{className:"Tabs",ref:F,style:{flex:"1 1 100%",display:"flex",position:"relative",overflow:"hidden"},children:s.jsx("div",{style:{position:"relative",overflowY:"hidden",overflowX:"hidden",marginBottom:"3px"},ref:U,onScroll:se=>{G({left:se.target.scrollLeft,top:se.target.scrollTop,width:se.target.scrollWidth,height:se.target.scrollHeight})},children:s.jsx(OB,{isDisabled:se=>x||v,items:L,strategy:vB,modifiers:[jB],ref:B,renderItem:N,renderDivider:m,onMove:S,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ae)})]})}));DS.displayName="TabStrip";const FB=u.createContext(null),wf=()=>{const e=u.useContext(FB),[t]=u.useState(()=>new $.ThemeCollection);return u.useMemo(()=>e||t,[e])},BB=u.lazy(()=>Promise.resolve().then(()=>require("./DzCXPcqV1oKbCcLO.cjs"))),NB={lightbulb:{enabled:!1},tabSize:2,acceptSuggestionOnCommitCharacter:!0,acceptSuggestionOnEnter:"on",accessibilitySupport:"auto",automaticLayout:!0,autoIndent:!1,codeLens:!0,colorDecorators:!0,contextmenu:!0,cursorBlinking:"blink",cursorSmoothCaretAnimation:!1,cursorStyle:"line",disableLayerHinting:!1,disableMonospaceOptimizations:!1,dragAndDrop:!0,glyphMargin:!0,fixedOverflowWidgets:!1,folding:!0,foldingStrategy:"auto",fontLigatures:!1,formatOnPaste:!0,formatOnType:!1,hideCursorInOverviewRuler:!1,highlightActiveIndentGuide:!0,links:!0,lineDecorationsWidth:8,lineNumbersMinChars:3,mouseWheelZoom:!1,multiCursorMergeOverlapping:!0,multiCursorModifier:"alt",overviewRulerBorder:!0,overviewRulerLanes:2,quickSuggestions:!0,quickSuggestionsDelay:100,readOnly:!1,renderControlCharacters:!1,renderFinalNewline:!0,renderIndentGuides:!0,renderLineHighlight:"all",renderWhitespace:"none",revealHorizontalRightPadding:30,roundedSelection:!0,rulers:[],scrollBeyondLastColumn:5,scrollBeyondLastLine:!0,selectOnLineNumbers:!0,selectionClipboard:!0,selectionHighlight:!0,showLightbulbIconMode:!1,showFoldingControls:"mouseover",smoothScrolling:!0,suggestOnTriggerCharacters:!0,wordBasedSuggestions:!0,wordSeparators:`~!@#$%^&*()-=+[{]}|;:'",.<>/?`,wordWrap:"off",wordWrapBreakAfterCharacters:" })]?|&,;",wordWrapBreakBeforeCharacters:"{([+",wordWrapBreakObtrusiveCharacters:".",wordWrapColumn:80,wordWrapMinified:!0,wrappingIndent:"none"},zg=async(e,t,n)=>{const o=e.getModel();if(!o)return;const r=await t.languages.typescript.getTypeScriptWorker(),i=await r(o.uri),a=await i.getNavigationTree(o.uri.toString()),l=e.getPosition();let c={...l};c.lineNumber=1,c.column=1;let d=!1;for(let y=l.lineNumber;y>=1;y--)if(o.getLineContent(y).trim()===""){const x=Sf(a,o.getOffsetAt({lineNumber:y,column:1}),"function");if(!x||VB(x)){d=!0,c.lineNumber=y+1;break}{const v=x.spans[0].start;y=o.getPositionAt(v).lineNumber,c.lineNumber=y}}let p=n,f=!1;!d&&!p.startsWith(`
213
213
  `)&&c.lineNumber>1&&(p=`
214
214
  `+p,f=!0);let h=!1;o.getLineCount()>1&&(p.endsWith(`
215
215
 
216
216
  `)||(p+=`
217
217
 
218
- `,h=!0));const g=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let m=null;o.pushEditOperations([],g,y=>(m=y[0].range,f&&m.startLineNumber++,h&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function $B(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function Wh(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,a=e.getPositionAt(i);r.push({name:o.text,type:$B(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)Wh(e,t,n,i,r);return r}function Sf(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const a=r[i];if(a.start<=t&&t<a.start+a.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const l of e.childItems||[]){const c=Sf(l,t,n,o);if(c)return c}}return null}}function VB(e){return e.kind==="comment"}const HB=u.memo(u.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:a,darkMode:l,loadingPanel:c,autoFocus:d=!0,onStatusChange:p,...f}=e,h=u.useRef(null),g=Te(a,[a]),m=u.useRef(!1),y=u.useMemo(()=>({contains(O){if(!h.current)return;const N=h.current.editor;return N&&N.getDomNode()?.contains(O)},focus(){if(!h.current)return;const O=h.current.editor;return O&&O.getDomNode()?.focus()}}),[]),x=u.useMemo(()=>[new We("help",y,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=u.useMemo(()=>{let O=null;const N=()=>y;return O=r?r.createChildGroup(N,"scriptEditor",!1):new a0(N,"scriptEditor"),O.addCommands(x,!0),O},[r,x]),b=_o(v,["executeSelectedScript"])[0],w=b?.context(),M=Te(O=>{b?.execute(O)},[b]),k=u.useRef(""),[j,_]=u.useState(!1),L=Te(async()=>{if(!h.current)return null;const O=h.current,N=O.editor;if(!N)return null;const F=O.monaco,E=await(async(B,H,U="export")=>{const Z=B.getModel();if(!Z)return null;const G=await H.languages.typescript.getTypeScriptWorker(),V=await G(Z.uri),le=await V.getNavigationTree(Z.uri.toString());let re=null,ge=B.getSelection();const Q=ge.startLineNumber===ge.endLineNumber&&ge.startColumn===ge.endColumn?Z.getLineCount():Math.min(ge.endLineNumber,Z.getLineCount());for(let xe=ge.startLineNumber;!re&&xe<=Q;xe++){const be=Sf(le,Z.getOffsetAt({lineNumber:xe,column:1}),"function",U);be&&(re=be.text)}return re})(N,F);return p?.({message:(E??"").toUpperCase()}),E?{source:N.getValue(),name:E}:null},[p]),T=Te(async(O,N,F)=>{const E=await w.getScripts().createModule({source:F?.getValue(),declarationsOnly:!0}),B=E?E.getFunctions().search():Gt.EmptyArray;E&&(async function(H,U){const Z=[];for(let G=1;G<H.getLineCount()+1;G++){const V={startLineNumber:G,startColumn:1,endLineNumber:G,endColumn:H.getLineLength(G)+1},le=H.getValueInRange(V).indexOf("modelt");le!==-1&&Z.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:V.startLineNumber,startColumn:le+1,endLineNumber:V.startLineNumber,endColumn:le+5})}U.editor.setModelMarkers(H,"owner",Z)}(O,N),async function(H,U,Z,G){const V=await U.languages.typescript.getTypeScriptWorker(),le=await V(H.uri),re=await le.getNavigationTree(H.uri.toString()),ge=Wh(H,U,G,re).map(Q=>{let xe=null,be=null;return Q.type==="formula"?(xe="formula.margin-icon",be="Formula"):Q.type==="macro"?(xe="macro.margin-icon",be="Macro"):Q.type==="autoRun"&&(xe="autorun.margin-icon",be="Auto Run"),{range:new U.Range(Q.lineNumber,1,Q.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:be,stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});R.current&&R.current.clear(),R.current=Z.createDecorationsCollection(ge)}(O,N,F,B))},[w]),D=Te(Gt.debounce(T,580),[]),C=Te(async(O=void 0)=>{if(!h.current||!w)return;const N=h.current.editor.getPosition(),F={cursor:N?N.toString():""};O!==void 0&&(F.message=O),p?.(F);const E=L();w.setSelectedFunction(E)},[w,p]);u.useEffect(()=>{if(!w)return;const O={insertSnippet:F=>{h.current?.editor&&(j?zg(h.current.editor,h.current.monaco,F):k.current=F)}};w.setEditor(O),w.setSelectedFunction(L());const N=w.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!w)return;const F=h.current.editor,E=w?.getScripts().getModules().getByName("scripting"),B=E?.getSource(),H=F.getValue();if((B?.length??0)===H.length&&B===H)return;await w.saveSource(F.getValue());const U=(B?.length??0)!==H.length||B!==H;p?.({dirty:U})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!w)return;const F=h.current.editor,E=w.getScripts().getModules().search()[0]?.getSource()??"";F.setValue(E)}});return()=>{N(),w.setSelectedFunction(null),w.setEditor(null)}},[w,j]),u.useEffect(()=>()=>{if(!h.current?.editor)return;const O=h.current.editor;w?.saveSource(O.getValue())},[]);const S=Te(O=>{const N=h.current;if(!N)return!1;const F=N.editor;return!!F&&(F.focus(),!0)},[]),R=u.useRef(null),P=Te((O,N)=>{h.current={monaco:N,editor:O},_(!0),C("Loading Types");const F=w.getScripts().getModules().search()[0]?.getSource()??"";O.setValue(F),Promise.resolve().then(()=>require("./CcQjGGiCx6Qz7yJ4.cjs")).then(H=>H.c).then(H=>{C(""),H.AutoTypings.create(O,{shareCache:!0,monaco:N,onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(async U=>{const Z=O.getModel();D(Z,N,O)})}),O.addCommand("executeScript",function(H,...U){U?.[0]&&M({functionName:U?.[0]})},""),O.addAction({id:"executeScript",label:"Execute",keybindings:[N.KeyCode.F8],run:async H=>{const U=L();w.setSelectedFunction(U);const Z=await U;M(Z)}}),O.addAction({id:"saveScript",label:"Save Script",keybindings:[N.KeyMod.CtrlCmd|N.KeyCode.KeyS],run:H=>{w?.saveSource(O.getValue()).then(()=>{const U=w?.getScripts().getModules().getByName("scripting"),Z=U?.getSource(),G=O.getValue(),V=(Z?.length??0)!==G.length||Z!==G;p?.({dirty:V})})}}),O.onMouseDown(async H=>{if(H.target.type===N.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=H.target.position.lineNumber,Z=await N.languages.typescript.getTypeScriptWorker(),G=await Z(E.uri),V=await G.getNavigationTree(E.uri.toString()),le=O?.getValue(),re=(await w?.saveSource(le)).getFunctions().search(),ge=Wh(E,N,re,V).find(Q=>Q.lineNumber===U);if(ge){const Q=H.event.browserEvent.button;Q===0?ge.type==="macro"||ge.type==="autoRun"?M({functionName:ge.name}):ge.type==="formula"&&w.quickInsertFunction?.(ge.name):Q===2&&(console.log("Context menu for function:",ge.name),H.event.browserEvent.preventDefault())}}}),O.onDidChangeModelContent(()=>{const H=O.getModel();D(H,N,O)});const E=O.getModel();var B;(B=N).languages.registerInlayHintsProvider("typescript",{provideInlayHints(H,U,Z){const G=[];for(let V=1;V<H.getLineCount()+1;V++){const le={startLineNumber:V,startColumn:1,endLineNumber:V,endColumn:H.getLineLength(V)+1},re="hint",ge=H.getValueInRange(le).indexOf("hint");ge!==-1&&G.push({kind:B.languages.InlayHintKind.Type,position:{lineNumber:le.startLineNumber,column:ge+re.length+1},label:"[hint]"})}return{hints:G,dispose:()=>{}}}}),E.onDidChangeContent(H=>{const U=w?.getScripts().getModules().getByName("scripting"),Z=U?.getSource(),G=O.getValue(),V=(Z?.length??0)!==G.length||Z!==G;p?.({dirty:V})}),O.onDidChangeCursorPosition(H=>{C()})},[w,p]),I=u.useMemo(()=>j?null:c||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[j,c]),z=u.useMemo(()=>{const O=w?.getScripts().getModules().getByName("scripting")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(u.Suspense,{children:s.jsx(BB,{theme:l?"extended-dark":"extended",options:{...NB,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:O,onValidate:N=>{let F=!1;for(let E=0;!F&&E<N?.length;E++)N[E].severity===8&&(F=!0)},beforeMount:N=>{N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),N.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),N.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),N.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let F=!1;try{const B=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),H=N.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),U=N.editor.createModel(B,"typescript",H);N.editor.setModelMarkers(U,"default",[]),F=!0}catch(B){console.warn("cant load types",B)}N.languages.registerLinkProvider("*",{provideLinks:(B,H)=>{const U=[],Z={links:U},G=B.getLinesContent();for(let V=1;V<=G.length;V++){const le=G[V-1],re=N.editor.tokenize(le,"typescript");for(let ge=0;ge<re[0].length;ge++){const Q=re[0]?.[ge];if(Q&&Q.type.startsWith("string")){let xe=Q.offset,be=re[0]?.[ge+1]?.offset??le.length,Fe=new N.Range(V,xe+1,V,be+1),ee=B.getValueInRange(Fe);const ae=ee[0];ae!=="`"&&ae!=="'"&&ae!=='"'||(xe++,ee=ee.substring(1));const we=ee[ee.length-1];we!=="`"&&we!=="'"&&we!=='"'||(xe++,ee=ee.substring(0,ee.length-1));try{w.getRanges(ee)&&U.push({range:{endColumn:be,endLineNumber:V,startColumn:xe,startLineNumber:V},tooltip:`Goto range '${ee}'`,url:`/range/${ee}`})}catch(se){console.warn(se)}}}}return Z}}),N.editor.registerLinkOpener({open(B){if(B?.path?.startsWith("/range/")){try{w.getRanges(B.path.substring(7))?.select()}catch(H){console.warn("invalid range",H)}return!0}return!1}});const E=N.languages.typescript.typescriptDefaults.getCompilerOptions();N.languages.typescript.typescriptDefaults.setCompilerOptions({...E,target:N.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:N.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),k.current&&(await zg(h.current.editor,h.current.monaco,k.current),k.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&N.editor.focus()}),N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),_(!0)})()},onMount:P})}),I]})},[w,v,i,I,l]),A=ir(t,()=>({isScriptEditorElement:()=>!0,focus:O=>{S(O)},close:()=>{g?.()},getEditor:()=>w?.getEditor()}),[w]);return u.useEffect(()=>(d&&requestAnimationFrame(()=>{S()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{A.current?.contains(document.activeElement)&&S()})}),[]),s.jsx("div",{className:Zr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,children:z})})),AS={Preset:"preset",Custom:"custom"},Os={Start:"start",End:"end"},s5={},WB=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(s5[r])return s5[r];const i=((a,l,c,d)=>{if(typeof document>"u"&&!d)return null;const p=d?new d:document.createElement("canvas");p.width=2*c,p.height=2*c;const f=p.getContext("2d");return f?(f.fillStyle=a,f.fillRect(0,0,p.width,p.height),f.fillStyle=l,f.fillRect(0,0,c,c),f.translate(c,c),f.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return s5[r]=i,i},UB={},LS=u.memo(e=>{const{className:t,style:n=jn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:l,renderers:c=UB,children:d,...p}=e,f=d,h=u.useMemo(()=>Object.assign({borderRadius:a,boxShadow:l,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${WB(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return u.isValidElement(d)?u.cloneElement(d,{...f.props}):s.jsx("div",{style:h,...p})}),qB=u.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:l,onFocus:c,style:d=jn.EmptyCssProperties,children:p,alphaWhite:f,alphaGrey:h,darkMode:g,alphaCheckSize:m=7,...y}=e;if(!t)throw new Error("a selectedColor is required");const x=u.useCallback(j=>{r?.(j),j.isDefaultPrevented()||(j.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=u.useCallback(j=>{a?.(j),j.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=u.useCallback(j=>{l?.(j),j.isDefaultPrevented()},[o,l]),w=u.useCallback(j=>{c?.(j),j.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),M=u.useCallback(j=>{i?.(j),j.isDefaultPrevented()||j.keyCode===on.Enter&&n?.(t.toRGBA())},[n,i,t]),k=u.useMemo(()=>t.toRGBA().alpha===1?null:s.jsx(LS,{size:m,white:f,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[f,h,t]);return s.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...y,onClick:x,onKeyDown:M,onMouseOver:v,onMouseLeave:b,onFocus:w,children:[k,s.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),V2=u.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:a,swatchProps:l,defaultButtonSize:c=24,isLarge:d=!1,compareRGB:p=!1,darkMode:f=!1,...h}=e,g=new $.Color({val:r.definition.val,adjs:r.definition.adjs},k=>t(k)),m=p?g.toRGBA().toString():g.toString(),y=n&&(p?n.toRGBA().toString():n.toString())===m,x=o&&(p?o.toRGBA().toString():o.toString())===m,v=[];v.push({[$.IColor.AdjustmentType.Inv]:!0}),v.push({[$.IColor.AdjustmentType.Alpha]:100});const b=g.adjust(v),w=u.useCallback(()=>{i?.(r)},[i,r]),M=u.useCallback(k=>{a?.(k?r:null)},[a,r]);return s.jsx(di,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:s.jsx("div",{style:{width:c*(d?1.2:1)+"px",height:c*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:s.jsxs(qB,{selectedColor:g,title:null,onSelectColor:w,onPreviewColor:M,alphaCheckSize:d?9:void 0,darkMode:f,...l,children:[s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(f).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:y?"1":"0"}}),s.jsx("div",{style:{position:"absolute",width:.33*c*(d?1.2:1)+"px",height:.33*c*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(f).toString(),borderRadius:"50%",opacity:x?"1":"0"}})]})})})}),Td=u.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:l,style:c=jn.EmptyCssProperties,compareRGB:d=!1,darkMode:p,swatchProps:f,...h}=e;let g;if(Array.isArray(o[0]))g=o;else{g=[];for(let b=0;b<o.length;b++)g.push([o[b]])}const m=u.useCallback(b=>{a?.(b)},[a]),y=u.useCallback(b=>{l?.(b)},[l]),x=u.useMemo(()=>{let b=[];for(let w=0;w<g.length;w++){let M=[],k=g[w];for(let _=0;_<k.length;_++){let L=k[_];M.push(s.jsx(V2,{schemeColorLookup:n,colorDef:L,selectedColor:r,previewColor:i,onSelectColorDef:m,onPreviewColorDef:y,swatchProps:f,compareRGB:d,darkMode:p},w+" "+_))}let j=s.jsx(Ae,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:_=>_.shadows[2],borderRadius:"2px",overflow:"hidden"},children:M},""+w);b.push(j)}return b},[g,r,i,m,y]),v=u.useMemo(()=>t?s.jsx(Tn,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:b=>b.palette.text.secondary},children:t}):null,[t]);return s.jsxs(Ae,{style:{...c},children:[v,s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:x})]})}),Bi=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),Ho=(e,t,n,o,r,i)=>{const a=Bi(e,t);o?.push(a);const l=new $.Color({val:a.definition.val,adjs:a.definition.adjs},n),c=l.toString();r?.set(c,l);const d=l.toRGBA().toString();i?.set(d,l)},KB=u.lazy(()=>Promise.resolve().then(()=>require("./Dds58NEqJ0OalWH3.cjs"))),zS=u.memo(u.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:a=!1,previewDebounceTime:l=100,initialPanelType:c,defaultButtonSize:d=24,width:p,onElementLoad:f,onDone:h,onEyeDropStart:g,onEyeDropStop:m,onPreviewColor:y,onPreviewColorImmediate:x,onSelectColor:v,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:M=Os.Start,compareRGB:k=!1,darkMode:j=!1,..._}=e,L=o||n,T=Te(y,[y]),D=Te(x,[x]),C=Te(v,[v]),S=Te(g,[g]),R=Te(m,[m]),[P,I]=u.useState(!1),z=Ki(),A=u.useMemo(()=>i||$.Color.getDefaultSchemeLookup(),[i]),O=u.useMemo(()=>{const ee=new Map,ae=new Map,we=[];Ho("Primary Background","bg1",A,we,ee,ae),Ho("Primary Text","tx1",A,we,ee,ae),Ho("Secondary Background","bg2",A,we,ee,ae),Ho("Secondary Text","tx2",A,we,ee,ae),Ho("Accent 1","accent1",A,we,ee,ae),Ho("Accent 2","accent2",A,we,ee,ae),Ho("Accent 3","accent3",A,we,ee,ae),Ho("Accent 4","accent4",A,we,ee,ae),Ho("Accent 5","accent5",A,we,ee,ae),Ho("Accent 6","accent6",A,we,ee,ae);const se=$.ITheme.buildPalette(we,A,ee,ae),J=[];if(Ho("Dark Red","C00000",A,J,ee,ae),Ho("Red","FF0000",A,J,ee,ae),Ho("Orange","FFC000",A,J,ee,ae),Ho("Yellow","FFFF00",A,J,ee,ae),Ho("Light Green","92D050",A,J,ee,ae),Ho("Green","00B050",A,J,ee,ae),Ho("Light Blue","00B0F0",A,J,ee,ae),Ho("Blue","0070C0",A,J,ee,ae),Ho("Dark Blue","002060",A,J,ee,ae),a?Ho("Purple Is A Fruit","7030A0",A,J,ee,ae):Ho("Transparent","00000000",A,J,ee,ae),b){const Ee=b.toString();ee.set(Ee,b)}const ce=new Map,ne=typeof r=="function"?r():r,Pe=[];for(let Ee=0;ne&&Ee<ne.length;Ee++){const it=ne[Ee].toString();ce.set(it,ne[Ee]),Pe.push({description:"Recent "+(Ee+1),definition:{val:ne[Ee].toString()}})}return{primaryColors:we,modifiedPresets:se,standardColors:J,recentColorsLimited:Pe,mapAllPresets:ee,mapAllPresetsRGB:ae,mapRecent:ce}},[A,r,a,b]);u.useEffect(()=>{f?.()},[]);const[N,F]=u.useState(!1),E=u.useCallback(()=>{F(ee=>!ee)},[]);u.useEffect(()=>{if(c)F(c===AS.Custom);else if(n){let ee=n.toString(),ae=O.mapAllPresets.get(ee);ae||(ee=n.toRGBA().toString(),ae=O.mapAllPresetsRGB.get(ee));const we=O.mapRecent.get(ee);F(!ae&&!we)}},[n,c]);const B=u.useCallback($.CommonUtils.debounce(ee=>{T?.(ee)},l),[T,l]),[H,U]=u.useState();u.useEffect(()=>{U(o||n)},[o,n]);const Z=Te(ee=>{D&&(D(ee),B(ee))},[D]),G=Te(ee=>{Z(ee?new $.Color({val:ee.definition.val,adjs:ee.definition.adjs},A):null)},[A]),V=u.useCallback(ee=>{ee.ctrlKey&&F(!0)},[]),le=Te(ee=>{let ae=!1;if(ee){const we=ee.toString();ae=!O.mapAllPresets.has(we)}C?.(ee,ae)},[C,O]),re=Te(ee=>{const ae=ee?new $.Color({val:ee.definition.val,adjs:ee.definition.adjs},A):null;Promise.resolve(h?.()).then(()=>{le(ae)})},[A,h]),ge=Te(ee=>{Z(ee?new $.Color(ee,A):null)},[A]),Q=u.useMemo(()=>window.EyeDropper===void 0?s.jsx(s.Fragment,{}):s.jsx(Tr,{"aria-label":"eye dropper",size:"small",sx:{color:ee=>ee.palette.text.icon??ee.palette.action.active},onClick:async()=>{I(!0),S?.(),await new EyeDropper().open().then(ee=>{I(!1),R?.();let ae=new $.Color(ee.sRGBHex),we=ae.toString(),se=O.mapAllPresets.get(we);if(se||(we=ae.toRGBA().toString(),se=O.mapAllPresetsRGB.get(we)),!se){const J=ae.toRGBA(),ce=3;let ne=255;O.mapAllPresetsRGB.forEach((Pe,Ee)=>{const it=Pe.toRGBA(),Ue=Math.abs(it.red-J.red)+Math.abs(it.blue-J.blue)+Math.abs(it.green-J.green);Ue<ce&&Ue<ne&&(se=Pe)})}F(!se),Z(se||ae)}).catch(ee=>{I(!1),ee?.name!=="AbortError"&&console.error(ee)})},children:s.jsx(iR,{})}),[O,j]),xe=u.useMemo(()=>{if(!N)return;const ee={opacity:N?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return s.jsx(u.Suspense,{fallback:s.jsx("div",{style:ee,children:s.jsx(Gl,{})}),children:s.jsx(KB,{style:ee,selectedColor:L?L.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:a})})},[N,L]),be=u.useMemo(()=>({onClick:V,alphaGrey:z.palette.text.icon??z.palette.action.active}),[V,z]),Fe=u.useMemo(()=>{if(!b)return null;const ee={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return s.jsx(s.Fragment,{children:s.jsxs(v1,{sx:{display:"flex",color:ae=>ae.palette.text.secondary},onMouseOver:()=>{G(null)},onClick:()=>{re(null)},children:[s.jsx(Ae,{sx:{flex:"none",boxShadow:ae=>ae.shadows[2],borderRadius:ae=>ae.spacing(.5),overflow:"hidden"},children:s.jsx(V2,{schemeColorLookup:A,colorDef:ee,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:d,isLarge:!0,darkMode:j,compareRGB:k,swatchProps:be})}),s.jsx(Tn,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,A,n,o]);return s.jsxs(Ae,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},..._,children:[s.jsxs("div",{style:{position:"relative",display:"flex"},children:[s.jsxs("div",{style:{opacity:N?"0":1},children:[Fe&&M===Os.Start?s.jsxs(s.Fragment,{children:[Fe,s.jsx(wa,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,s.jsx(Td,{title:"Theme Colors",schemeColorLookup:A,colorDefs:O.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsx(Td,{schemeColorLookup:A,colorDefs:O.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Td,{title:"Standard Colors",schemeColorLookup:A,colorDefs:O.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsxs("div",{style:{opacity:O.recentColorsLimited.length===0?"0":void 0,display:O.recentColorsLimited.length===0?"none":void 0},children:[s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Td,{title:"Recent Colors",schemeColorLookup:A,colorDefs:O.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j})]}),Fe&&M===Os.End?s.jsxs(s.Fragment,{children:[s.jsx(wa,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Fe,s.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),xe]}),s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[Q,s.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),s.jsx(zc,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{E()},children:s.jsx("div",N?{children:"Preset"}:{children:"Custom"})}),s.jsx(zc,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{le(H)})},children:"Done"})]})]})})),GB=s.jsx(e=>{const{sx:t,...n}=e;return s.jsxs(Qe,{sx:{overflow:"visible","& .activeColor":{filter:C1},...t},...n,children:[s.jsx("path",{className:"activeColor",opacity:"1",d:"M12 20c4.41 0 8-3.59 8-8s-3.59-8-8-8-8 3.59-8 8 3.59 8 8 8z"}),s.jsx("path",{className:"style_grey",opacity:".3",d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8z"}),s.jsx("path",{className:"activeColor",opacity:".3",d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8z"})]})},{}),Cf=u.memo(u.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=GB,tooltip:i,label:a,onPreviewColor:l,onPreviewColorImmediate:c,onSelectColor:d,variant:p=Ri.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:m=!1,...y}=e,x=Te(l,[l]),v=Te(c,[c]),b=Te(d,[d]),[w,M]=u.useState(()=>{}),k=o||w||n||f?.autoColor,j=u.useRef(!1),_=u.useCallback(()=>{},[]),L=Te(()=>{M(n)},[n]),T=Te(O=>{j.current||(M(O),x?.(O))},[x]),D=Te(O=>{j.current||(M(O),v?.(O))},[v]),C=Te((O,N)=>{j.current||(M(void 0),b?.(O,N))},[b]),S=u.useMemo(()=>s.jsx(Ae,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${k?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${k?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:O=>O.palette.text.icon??O.palette.action.active}},children:typeof r=="function"?r():r}),[k,r,m]),R=Te(O=>{b?.(o,!1)},[b,o]),[P,I]=u.useState(!1),z=u.useCallback(O=>{const{closeFloat:N,closeFloatAll:F}=O;return s.jsx(zS,{...f,selectedColor:n,previewColor:w,onDone:h?F:N,onKeyDown:E=>{E.which===on.Enter&&(h?F():N())},onPreviewColorImmediate:D,onPreviewColor:T,onSelectColor:C,onEyeDropStart:()=>I(!0),onEyeDropStop:()=>I(!1),compareRGB:g,darkMode:m})},[n,w,h,k,f?.autoColor,m]),A={onQuickClick:o?R:void 0,createPopupPanel:z,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:L,onPopupClose:_,tooltip:i||a||"Color",label:a,icon:S,...y};return p===Ri.Toolbar?s.jsx(qi,{ref:t,...A}):s.jsx(k1,{ref:t,...A})})),ru=82,Uh=e=>{const{styleColor:t,length:n=ru,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:l=!1,darkMode:c=!1,...d}=e;return s.jsx(Qe,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...d,children:s.jsx(Jw,{length:n,width:o,dashArray:r,isDouble:a,isAngled:l,className:"activeColor"})})},FS=u.memo(u.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:a,selectedStyle:l,onSelectStyle:c,showNone:d=!0,darkMode:p,sx:f,...h}=e,g=Te(c,[]),m=u.useCallback(b=>{const{popupContainer:w,floatReference:M,closeFloat:k,...j}=b,_=[],L=$.IBorder.BuiltInDefinitionsArray;for(let T=0;T<L.length;T++){const D=L[T];if(D.description==="None"&&!d)continue;const C=s.jsx(Uh,{styleColor:a,length:ru,width:D.width,darkMode:p,dashArray:D.pattern,isDouble:D.description.toLowerCase().includes("double"),isAngled:D.description.toLowerCase().includes("slant")});let S=null;S=o?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{marginRight:"6px"},children:D.description}),s.jsxs(Ae,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[s.jsx("div",{style:{flex:"1 1 100%"}}),C]})]}):D.description==="None"?"None":C,_.push(s.jsx(Gr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:C7(4)},paddingLeft:"16px",background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{description:o?"":D.description},icon:null,disabled:r,onMouseDown:R=>R.preventDefault(),onMouseUp:()=>{k(),g(D.style)},onKeyDown:R=>{R.which===on.Enter&&k()},selected:D.style===l,parentFloat:M,children:S},T))}return s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:_})},[r,d,a,l,p]),y=u.useMemo(()=>{const b=$.IBorder.BuiltInDefinitions.get(l);let w;return w=b.description==="None"?s.jsx(Ae,{sx:{minWidth:`${ru}px`},children:"None"}):s.jsx(Uh,{styleColor:a,length:ru,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),s.jsx(Ae,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:C7()}},children:w})},[l,a]),x=u.useMemo(()=>$.IBorder.BuiltInDefinitions.get(l),[l]),v={disabled:r,icon:y,tooltip:"Border Style: "+x.description,sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...f},createPopupPanel:m,...h};return n===Ri.Toolbar?s.jsx(qi,{...v}):s.jsx(k1,{...v})})),BS=u.memo(u.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=$.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:a=!1,showStylingBefore:l=!0,onSelectBorder:c,onPreviewBorder:d,selectedBorder:p,createTemporaryBorder:f,...h}=e,g=Te(c,[c]),m=Te(d,[d]),[y,x]=u.useState(),[v,b]=u.useState(),w=y??r,M=v??n,k=p||{bottom:{style:r,color:n?.toString()}},j=Te(S=>{const R={},P=S?Object.keys(S):[];let I=!1;for(let H=0;H<P.length;H++)S[P[H]]?.style&&(R[P[H]]={style:S[P[H]].style,color:S[P[H]].color},I||R[P[H]].style===$.IBorder.StrokeStyle.None||(I=!0));P.length<6&&(I=!0);const z=I?R.left:null,A=I?R.top:null,O=I?R.right:null,N=I?R.bottom:null,F=I?R.vertical:null,E=I?R.horizontal:null;let B="";return A||z||(B+="M 3,5 H 5 V 3 H 3 "),A||(B+="M 7,5 H 9 V 3 H 7 "),A||F||(B+="M 11,5 h 2 V 3 h -2 "),A||(B+="M 15,5 h 2 V 3 h -2 "),A||O||(B+="M 19,5 h 2 V 3 h -2 "),z||(B+="M 3,9 H 5 V 7 H 3 "),F||(B+="M 11,9 h 2 V 7 h -2 "),O||(B+="M 19,9 h 2 V 7 h -2 "),E||z||(B+="M 3,13 H 5 V 11 H 3 "),E||(B+="M 7,13 H 9 V 11 H 7 "),E||F||(B+="M 11,13 h 2 v -2 h -2 "),E||O||(B+="M 19,13 h 2 v -2 h -2 "),E||(B+="M 15,13 h 2 v -2 h -2 "),z||(B+="M 3,17 H 5 V 15 H 3 "),F||(B+="M 11,17 h 2 v -2 h -2 "),O||(B+="M 19,17 h 2 v -2 h -2 "),N||z||(B+="M 3,21 H 5 V 19 H 3 "),N||(B+="M 7,21 H 9 V 19 H 7 "),N||F||(B+="M 11,21 h 2 v -2 h -2 "),N||(B+="M 15,21 h 2 v -2 h -2 "),N||O||(B+="M 19,21 h 2 v -2 h -2 "),s.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[s.jsx(Qe,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:s.jsx("path",{d:B})}),s.jsx(Ae,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:C1}},children:s.jsx(ff,{getBorderAt:(H,U)=>{if(!f||P.length===0)return null;const Z=H.rowIndex,G=H.colIndex,V={};return Z===0?(V.top=R.top,V.bottom=R.horizontal):(V.top=R.horizontal,V.bottom=R.bottom),G===0?(V.left=R.left,V.right=R.vertical):(V.left=R.vertical,V.right=R.right),f?.(V)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[M,w,a]),_=u.useCallback((S,R,P)=>{let I=null;if(S&&S.length>0){let z=null;(R||P)&&(z={style:P,color:R?.toString()??null}),I={};for(let A=0;A<S.length;A++)I[S[A]]=z}return I},[]),L=u.useCallback(S=>{g?.(S)},[]),T=u.useCallback(S=>{m?.(S)},[]),D=u.useCallback(S=>{const{closeFloatAll:R,floatReference:P}=S,I=(O,N,F="bottom",E=!1)=>{const B=_(O,M??null,E?$.IBorder.StrokeStyle.None:w??null),H=E?_([],M??null,w??null):B;return s.jsx(ii,{icon:j(H),sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{label:N,simple:!0,placement:F},onClick:()=>{R(),T(B),L(B)}})},z=s.jsxs(s.Fragment,{children:[s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom,$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical],"All Borders","top"),I([$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical],"Inner Borders","top"),I([$.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),I([$.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom],"Outside Borders","top")]}),s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[I([$.IBorder.Edge.Left],"Left Borders"),I([$.IBorder.Edge.Top],"Top Borders"),I([$.IBorder.Edge.Right],"Right Borders"),I([$.IBorder.Edge.Bottom],"Bottom Borders"),I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom,$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical,$.IBorder.Edge.DiagonalUp,$.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),A=s.jsx(s.Fragment,{children:s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[s.jsx(Cf,{variant:Ri.Toolbar,icon:s.jsx($3,{}),selectedColor:w===$.IBorder.StrokeStyle.None?new $.Color("transparent"):M,onPreviewColor:O=>{b(O)},onSelectColor:(O,N)=>{b(O)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||w===$.IBorder.StrokeStyle.None,parentFloat:P,shouldCloseFloatAll:!1}),s.jsx(FS,{selectedStyle:w,onSelectStyle:x,styleColor:M,darkMode:a,variant:Ri.Toolbar,parentFloat:P})]})});return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:O=>O.stopPropagation(),children:[l?A:z,s.jsx(Ft,{orientation:"horizontal"}),l?z:A]})},[w,M,n,o,a]),C=u.useMemo(()=>j(k),[k,a]);return s.jsx(qi,{ref:t,createPopupPanel:D,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:S},R)=>s.jsx(br,{label:"Borders",description:"Set the borders.",disabled:R,children:S}),onQuickClick:()=>{g?.(k)},quickButtonProps:{sx:{}},disabled:i,icon:C,...h})})),NS=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Zt.Toolbar,disabled:a=!1,autoColor:l,autoStrokeStyle:c,schemeLookup:d,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:g,icon:m,label:y,...x}=e,v=_o(n,["formatBorder"]),b=o??v[0],w=b?.context()??null,M=w?.autoColor??l,k=w?.autoStyle??c,j=f??w?.quickBorder,_=g??w?.darkMode,L=p??w?.createTemporaryBorder,T=d??w?.schemeLookup,D=Te(S=>{w?.onBorderSelect&&w.onBorderSelect(S),h?.(S),b?.execute(S,r)},[b,h,r]),C=u.useCallback((S,R)=>{const{children:P,title:I,...z}=S;let A=S.children;return(b?.disabled()||a)&&(A=s.jsx("div",{children:A})),s.jsx(l0,{command:b,placement:i===Zt.Toolbar?"bottom-start":"right-start",disabled:R,...z,children:A})},[b,a]);return s.jsx(BS,{ref:t,autoColor:M,darkMode:_,autoStrokeStyle:k,createTemporaryBorder:L,schemeLookup:T,selectedBorder:j,onSelectBorder:D,createTooltip:C,disabled:a||!b||b.disabled(),...x})})),$S=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("mergeToggle"),icon:ze(s.jsx(k7,{}))}),s.jsx(Ge,{...p,command:d.getCommand("mergeHorizontal"),icon:ze(s.jsx(TP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("mergeVertical"),icon:ze(s.jsx(_P,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:d.getCommand("unmerge"),icon:ze(s.jsx(Ub,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:l,icon:ze(s.jsx(k7,{})),...a})})),VS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("freezeToggle"),icon:ze(s.jsx(PP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("freezeToggleHorizontal"),icon:ze(s.jsx(RP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("freezeToggleVertical"),icon:ze(s.jsx(IP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:d.getCommand("unfreeze"),icon:s.jsx(Ub,{})})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:l,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:s.jsx(jP,{}),...a})})),HS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("find"),icon:ze(s.jsx(q7,{}))}),s.jsx(Ge,{...p,command:d.getCommand("findReplace"),icon:ze(s.jsx(av,{}))}),s.jsx(Ge,{...p,command:d.getCommand("goto"),icon:ze(s.jsx(JO,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:l,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:ze(s.jsx(q7,{})),...a})})),WS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:a=Vz.DefaultFontSizes,disabled:l=!1,parentFloat:c,icon:d,label:p,sx:f,...h}=e;rl(n);const g=()=>n?.state()?.toString()||"11",[m,y]=u.useState(g),x=Te(()=>{const L=parseFloat(m);isNaN(L)?y(g()):parseFloat(g())!==L&&n.execute(L,o)},[g,n,m,o]);u.useEffect(()=>{y(g())},[n?.state()]);const v=u.useMemo(()=>{if(!o)return null;const L={...o};return delete L.beforeExecute,L},[o]),b=_o(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=u.useMemo(()=>b?s.jsxs(Ae,{className:Eo("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[s.jsx(Ge,{command:b[0],commandHook:v,icon:ze(s.jsx(LO,{}))}),s.jsx(Ge,{command:b[1],icon:ze(s.jsx(zO,{}))})]}):null,[b]),M=Ki(),k=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("12.3",Math.round(M.typography.fontSize),M.typography.fontFamily).width}px`,[M]),j=u.useCallback(L=>{const{onMouseDown:T,onMouseUp:D,...C}=L;return s.jsx(Tr,{component:"div",...C,disableRipple:!0,children:s.jsx(Kl,{inputMode:"numeric",disabled:l||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:S=>`1px solid ${S.palette.text.icon??S.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:S=>`1px solid ${S.palette.error.main}`},"::after":{borderBottom:S=>`1px solid ${S.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,width:k,color:S=>S.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:S=>S.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:S=>S.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:m,onFocus:S=>{S.target?.select()},onKeyDown:S=>{if(S.which===on.Enter)g()!==m&&(S.stopPropagation(),S.preventDefault(),x());else if(S.which===on.Escape)g()!==m&&(y(g()),setTimeout(()=>{S.target?.select()},0),S.stopPropagation(),S.preventDefault());else{if(S.key.match("[-]")||S.key.match("[0-9.]")&&(m+S.key).length>4)return S.stopPropagation(),void S.preventDefault();if(S.which===on.Space)return void S.preventDefault()}},onBlur:()=>{x()},onChange:S=>{if(S.target.value.length>4)return S.stopPropagation(),void S.preventDefault();y(S.target.value)}})})},[m,l,n]),_=u.useCallback(L=>{const T=R=>{n?.execute(R,o)},D=n?.state(),C=[];for(let R=0;R<a.length;R++){const P=a[R]===D;C.push(s.jsx(Gr,{selected:P,icon:P?s.jsx(E1,{}):void 0,disabled:l||!n||n.disabled(),onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&T(a[R])},onKeyDown:I=>{I.keyCode!==on.Enter&&I.keyCode!==on.Space||T(a[R])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[R]})},"fontSize-"+R))}const S=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...h,children:[w,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})]});return Bn({...L,children:S})},[l,n?.state(),o]);return s.jsx(qi,{ref:t,sx:{...f},tabIndex:-1,outlined:!0,disabled:l,parentFloat:c,createPopupPanel:_,createTooltip:({children:L},T)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:T||n?.disabled(),children:L}),createQuickButton:j,...h})})),Fg=u.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:a,...l}=e;return s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...a},disabled:n,selected:t,icon:t?s.jsx(E1,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==on.Enter&&c.keyCode!==on.Space||r(i.numberFormat)},...l,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(Tn,{component:"div",children:[i.formatType,i.formatType===$.NumberFormat.Type.Custom?"…":""]}),s.jsx(Tn,{variant:"caption",component:"div",sx:{color:c=>pt(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),US=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:a=!1,parentFloat:l,...c}=e,d=_o(n,["formatNumberFormat"])[0],p=d?.state()?$.NumberFormat.Styles.lookupStyle(d?.state()).formatType:$.NumberFormat.Type.General,f=u.useMemo(()=>{if(!o)return null;const y={...o};return delete y.beforeExecute,y},[o]),h=u.useCallback((y,x)=>{const v=D=>{o?.beforeExecute?.(d,d?.state()),d.execute(D,o),o?.onExecute?.(d,d?.state())},b=d?.context()(),w=$.NumberFormat.Styles.lookupPrimary(),M=[];for(let D=0;D<w.length;D++){let C="";if(b&&!b.isEmpty())try{C=b.getNumberFormat(w[D].numberFormat).displayText}catch(R){console.warn(R)}C===""&&w[D].formatType===$.NumberFormat.Type.General&&(C="No specific format");const S=w[D].formatType===p;M.push(s.jsx(Fg,{selected:S,disabled:a||!d||d.disabled(),formattedValue:C,handleSetFormat:v,format:w[D]},w[D].formatType))}const k={numberFormat:"",formatType:$.NumberFormat.Type.Custom},j=p===$.NumberFormat.Type.Custom,_=s.jsx(Fg,{selected:j,disabled:a||!d||d.disabled(),formattedValue:j?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(d,d?.state()),x.getCommand("formatNumberDialog")?.execute(d?.state()),o?.onExecute?.(d,d?.state())},format:k,sx:{flex:"0",width:"100%"}},$.NumberFormat.Type.Custom),L=s.jsxs(Ae,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:D=>D.stopPropagation(),children:[s.jsx(Ge,{command:x.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:s.jsx(zP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:s.jsx(DP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:s.jsx(OP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(AP,{}))}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(LP,{}))})]}),T=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[L,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:M}),s.jsx(Ft,{orientation:"horizontal"}),_]});return Bn({...y,children:T})},[d?.context(),d?.state(),o,r]),g=Ki(),m=u.useMemo(()=>{const y=$.NumberFormat.Type.MediumTime;return`${$.IFont.getSharedMeasurer()(y,Math.round(g.typography.fontSize),g.typography.fontFamily).width}px`},[g]);return s.jsx(Xn,{ref:t,commands:n,sx:i,outlined:!0,disabled:a,parentFloat:l,createPopupPanel:h,createTooltip:({children:y},x)=>s.jsx(br,{label:d?.label(),description:d?.description(),disabled:x,children:y}),icon:s.jsx(Ae,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:y=>`${Math.round(y.typography.fontSize)}px`,color:y=>y.palette.text.secondary,fontFamily:y=>y.typography.fontFamily,width:m},children:s.jsx(Ae,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),kf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"clear",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("clearAll"),icon:s.jsx(Y4,{})}),s.jsx(Ge,{...p,command:d.getCommand("clearFormats"),icon:ze(s.jsx(_b,{}))}),s.jsx(Ge,{...p,command:d.getCommand("clearContents"),icon:ze(s.jsx(DI,{}))}),s.jsx(Ge,{...p,command:d.getCommand("clearComments")}),s.jsx(Ge,{...p,command:d.getCommand("clearHyperlinks")})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:l,icon:s.jsx(Y4,{}),...a})})),qS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"fill",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("fillDown"),icon:ze(s.jsx(P0,{}))}),s.jsx(Ge,{...p,command:d.getCommand("fillRight"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(270deg)"}}))}),s.jsx(Ge,{...p,command:d.getCommand("fillUp"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(180deg)"}}))}),s.jsx(Ge,{...p,command:d.getCommand("fillLeft"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(90deg)"}}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:l,icon:ze(s.jsx(P0,{})),...a})})),Ef=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:l=!0,showQuickButton:c=!0,variant:d=Zt.Toolbar,...p}=e,f=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=_o(n,f),{singleCommand:g,allDisabled:m}=u.useMemo(()=>{let v=null,b=0;for(let w=0;w<h.length;w++)h[w]&&!h[w]?.disabled()&&(l&&d===Zt.Menuitem&&(v=b===0?h[w]:null),b++);return{singleCommand:v,allDisabled:b===0}},[h]),y=u.useMemo(()=>{const v=new Map;return v.set("insertCellsShiftDown",ze(s.jsx(O7,{}))),v.set("insertCellsShiftRight",ze(s.jsx(O7,{sx:{transform:"rotate(270deg)"}}))),v.set("insertRows",ze(s.jsx(RO,{}))),v.set("insertColumns",ze(s.jsx(D7,{}))),v},[]),x=u.useCallback((v,b)=>{let w=null;const M={variant:Zt.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:b.getCommand("addSheet"),icon:ze(s.jsx(Us,{}))})]}));const k=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...M,command:h[0],icon:y.get(f[0])}),s.jsx(Ge,{...M,command:h[1],icon:y.get(f[1])}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:h[2],icon:y.get(f[2])}),s.jsx(Ge,{...M,command:h[3],icon:y.get(f[3])}),w]});return Bn({...v,children:k})},[i,h,o,r,y]);return g?s.jsx(Ge,{ref:t,variant:d,commandHook:o,disabled:i,command:g,icon:y.get(g.key()),...p}):s.jsx(Xn,{ref:t,variant:d,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||m,tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),s.jsx("br",{}),s.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:x,icon:ze(s.jsx(D7,{})),...p})})),Mf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:l=!0,showQuickButton:c=!0,variant:d=Zt.Toolbar,...p}=e,f=_o(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:g}=u.useMemo(()=>{let x=null,v=0;for(let b=0;b<f.length;b++)f[b]&&!f[b]?.disabled()&&(l&&d===Zt.Menuitem&&(x=v===0?f[b]:null),v++);return{singleCommand:x,allDisabled:v===0}},[f]),m=u.useMemo(()=>{const x=new Map;return x.set("deleteCellsShiftUp",ze(s.jsx(A7,{sx:{transform:"rotate(0deg)"}}))),x.set("deleteCellsShiftLeft",ze(s.jsx(A7,{sx:{transform:"rotate(270deg)"}}))),x.set("deleteRows",ze(s.jsx(IO,{}))),x.set("deleteColumns",ze(s.jsx(L7,{}))),x},[]),y=u.useCallback((x,v)=>{const b={variant:Zt.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let w=null;a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...b,command:v.getCommand("deleteSheet"),icon:ze(s.jsx(Us,{}))})]}));const M=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:m.get("deleteCellsShiftUp")}),s.jsx(Ge,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:m.get("deleteCellsShiftLeft")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...b,command:v.getCommand("deleteRows"),icon:m.get("deleteRows")}),s.jsx(Ge,{...b,command:v.getCommand("deleteColumns"),icon:m.get("deleteColumns")}),w]});return Bn({...x,children:M})},[i,o,r,m]);return h?s.jsx(Ge,{ref:t,variant:d,commandHook:o,disabled:i,command:h,icon:m.get(h.key()),...p}):s.jsx(Xn,{ref:t,variant:d,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),s.jsx("br",{}),s.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:y,icon:ze(s.jsx(L7,{})),...p})})),Qs=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Zt.Toolbar,quickColor:l,panelProps:c,isSplit:d=!1,darkMode:p,icon:f,...h}=e,{autoColor:g,schemeLookup:m,recentColors:y,...x}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");rl(n);const v=n?.context();let b=l??v?.quickColor;d&&!b&&(b=new $.Color("transparent"));const w=g??v?.autoColor,M=m??v?.schemeLookup,k=y??v?.recentColors,j=p??v?.darkMode,_=u.useMemo(()=>({autoColor:w,schemeLookup:M,recentColors:k,darkMode:j,...x}),[w,M,k,j]),L=Te((D,C)=>{D&&C&&v?.addRecentColor&&v.addRecentColor(D),v?.onColorSelect&&v.onColorSelect(D),r?.(D,C),n?.execute(D,o)},[n,r,o,v]),T=u.useCallback((D,C)=>{const{children:S,title:R,...P}=D;let I=D.children;return(n?.disabled()||i)&&(I=s.jsx("div",{children:I})),s.jsx(l0,{command:n,placement:a===Zt.Toolbar?"bottom-start":"right-start",disabled:C,...P,children:I})},[n,i]);return s.jsx(Cf,{ref:t,panelProps:_,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:L,variant:a===Zt.Menuitem?Ri.Menuitem:Ri.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:j,...h})}));Qs.displayName="ColorCommandButton";const KS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=u.useCallback((p,f)=>{const h={variant:Zt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...h,command:f.getCommand("gridlinesToggle")}),s.jsx(Qs,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:s.jsx($3,{}),panelProps:{disableAlpha:!0}}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleGridlinesRows")})]});return Bn({...p,children:g})},[i,o]);return s.jsx(Xn,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:s.jsx(Xs,{command:c[0],scope:"view"}),...l})})),Tf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=d.getCommand("sortCustom"),h=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("sortAscending"),icon:ze(s.jsx(ph,{}))}),s.jsx(Ge,{...p,command:d.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),f?s.jsx(Ge,{...p,command:f,icon:ze(s.jsx(AO,{}))}):null,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(rh,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:ze(s.jsx(qb,{}))})]});return Bn({...c,children:h})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Organize your data so it's easier to analyze."}),s.jsx("br",{}),s.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:l,icon:ze(s.jsx(ph,{})),...a})})),ZB=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(rh,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:ze(s.jsx(qb,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Organize your data so it's easier to analyze."}),s.jsx("br",{}),s.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:l,icon:ze(s.jsx(rh,{})),...a})})),_f=u.memo(u.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:a,scope:l,sx:c,disabled:d,commands:p,...f}=e,h=[n];!r&&i&&h.push("redo");const g=_o(p,h),m=g[0],y=g[1],x=a??m?.context?.()?.undoManager;let v=d;d||(v=!m||m.disabled(),y&&!y.disabled()&&(v=!1));const[b,w]=u.useState(0),M=u.useCallback((k,j)=>{let _=b===0?"Cancel":`${m.label()} ${b} Action${b===1?"":"s"}`,L=!1;x||(L=!0),L||(L=i?!x.hasRedo()&&!x.hasUndo():!x.hasRedo());const T=I=>{m.execute(I)},D=s.jsx(Gr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:L?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&T(b)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==on.Enter&&I.keyCode!==on.Space||T(b)},children:s.jsx(Tn,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:_})});if(L)return D;const C=r?x?.getRedoDescriptions():x?.getUndoDescriptions(),S=[];for(let I=0;I<C.length;I++){const z=C[I];S.push(s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex"},icon:s.jsx(Us,{}),disabled:v,selected:I<b,onMouseEnter:()=>{w(I+1)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&T(I+1)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==on.Enter&&A.keyCode!==on.Space||T(I+1)},children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[s.jsx(Tn,{component:"div",children:z}),s.jsx(Us,{})]})},`action:${I}`))}let R=null;if(!r&&i){const I={scope:"undo",commands:j,variant:Zt.Menuitem,parentFloat:k.floatReference};R=[],R.push(s.jsx(_f,{...I,quickCommand:"redo",isRedo:!0},"nested:redo")),x.hasRedo()&&x.hasUndo()&&R.push(s.jsx(Ft,{orientation:"horizontal"},"action:redo-div"))}const P=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{k.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[R,s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:S}),s.jsx(Ft,{orientation:"horizontal"}),D]});return Bn({...k,children:P})},[m?.context(),m?.state(),l,x,b,v]);return s.jsx(Xn,{ref:t,commands:p,quickCommand:n,scope:l,disabled:v,label:m?.label()??(r?"Redo":"Undo"),tooltip:s.jsx(s.Fragment,{children:s.jsx("span",{children:`${m?.label()??"No"} last actions.`})}),createPopupPanel:M,icon:o??ze(s.jsx(r?wD:vD,{})),selected:!1,...f})})),Ds=$.IFontCollection.getFontList(),GS=new Map;for(let e=0;e<Ds.length;e++)GS.set(Ds[e].fontRef.getFamily(),Ds[e]);const ZS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,icon:l,label:c,...d}=e;rl(n);const p=n?.state(),f=Ki(),h=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("Times New Roman",Math.round(f.typography.fontSize),f.typography.fontFamily).width}px`,[f]),g=u.useCallback(m=>{const y=w=>{n?.execute(w,o)},x=[];for(let w=0;w<Ds.length;w++)x.push({key:Ds[w].fontRef.getFamily(),description:Ds[w].fontRef.getFamily()});GS.get(p)||x.unshift({key:p,description:p});const v=[];for(let w=0;w<x.length;w++){const M=x[w].key===p;v.push(s.jsx(Gr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:M,disabled:i||!n||n.disabled(),icon:M?s.jsx(E1,{}):void 0,onMouseUp:k=>{k.button===0&&y(x[w].key)},onMouseDown:k=>{k.button===0&&k.preventDefault()},onKeyDown:k=>{k.keyCode!==on.Enter&&k.keyCode!==on.Space||y(x[w].key)},children:s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:s.jsx(Tn,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>x[w]?.key},children:x[w].description})})},w+""+x[w].key))}const b=s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:v})});return Bn({...m,children:b})},[i,n?.state()]);return s.jsx(qi,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:g,createTooltip:({children:m},y)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:y,children:m}),icon:s.jsx(Ae,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:m=>`${Math.round(m.typography.fontSize)}px`,fontFamily:m=>m.typography.fontFamily,color:m=>m.palette.text.secondary,width:h},children:s.jsx(Ae,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...d})})),XS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatStrikeThroughToggle",ze(s.jsx(z7,{}))),f.set("formatSuperscriptToggle",ze(s.jsx(FO,{}))),f.set("formatSubscriptToggle",ze(s.jsx(BO,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:"textEffects",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(c)??ze(s.jsx(z7,{})),...a})})),YS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatUnderlinedToggle",ze(s.jsx(Pp,{}))),f.set("formatUnderlinedDoubleToggle",ze(s.jsx(F7,{}))),f.set("formatUnderlinedAccountingToggle",ze(s.jsx(B7,{}))),f.set("formatUnderlinedAccountingDoubleToggle",ze(s.jsx(N7,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:"underline",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:ze(s.jsx(Pp,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ze(s.jsx(F7,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ze(s.jsx(B7,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:ze(s.jsx(N7,{}))})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:d.get(c)??ze(s.jsx(Pp,{})),...a})})),jf=u.memo(u.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:a=!0,disabled:l=!1,...c}=e,d=Te((p,f)=>{const h={variant:Zt.Menuitem,commandHook:r,scope:"paste",disabled:l},g=[];return a&&(g.push(u.createElement(Ge,{...h,command:f.getCommand("paste"),key:"paste",icon:s.jsx(P7,{})})),g.push(s.jsx(Ft,{orientation:"horizontal"},"paste-div"))),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ze(s.jsx(wO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ze(s.jsx(SO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ze(s.jsx(CO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ze(s.jsx(kO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ze(s.jsx(EO,{}))})),Bn({...p,children:g})},[l,r,i,a]);return s.jsx(Xn,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:s.jsx(P7,{}),...c})})),JS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=u.useCallback((p,f)=>{const h={variant:Zt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingRows")})]});return Bn({...p,children:g})},[i,o,r]);return s.jsx(Xn,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:s.jsx(Xs,{command:c[0],scope:"view"}),...l})})),QS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...a}=e,l=u.useCallback(c=>{const d={variant:Zt.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return Bn({...c,children:p})},[i,n,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:l,icon:s.jsx(Xs,{icon:null,label:"Workbook View"}),...a})})),eC=u.memo(u.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:a,sx:l,borderProps:c,disabled:d,...p}=e,f=u.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=u.useMemo(()=>f.getStyle(),[f,a]),g=u.useMemo(()=>h.getFill().toCSS(a?.darkMode??!1),[h]),m=h.getInsets(),y=h.getFont(),x=u.useCallback(()=>h.getBorder(),[h]);return s.jsx(Ae,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:a?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...g},"& .text":{flex:"1 1 100%",...y.toCSS(a?.darkMode??!1,1),boxSizing:"border-box",padding:`${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:y.toCSS().textDecoration,textAlign:$.ITextFrame.toCSSHorizontalTextAlign(f.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...l},...p,children:s.jsx(ff,{getBorderAt:x,darkMode:a?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:s.jsx(Ae,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:s.jsx(Ae,{className:"text",children:n})})})})})),XB=u.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:a,createTemporaryCell:l,parentFloat:c,commands:d,disabled:p,commandHook:f,...h}=e,g=u.useCallback(x=>{const v={variant:Zt.Menuitem,commandHook:f,context:"cellStyle"},b=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...v,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...v,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),s.jsx(Ge,{...v,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===$.IStyle.BuiltInName.Normal})]});return Bn({...x,children:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})})})},[]),m=n?.getName()===o?.getName();let y=s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:x=>`solid ${m?x.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{a?.(n)},...h,children:s.jsx(eC,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:l,bodyStyle:i})},n.getName());return r&&(y=s.jsx(Cv,{label:n.getName(),parentFloat:c,createPopupPanel:g,children:y})),y}),tC=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:a,disabled:l=!1,bodyStyle:c,usePreviewIcon:d=!0,...p}=e;rl(o);const f=o?.context(),h=f?.styles,g=i??f?.named(),m=c??f?.bodyStyle(),y=Te(M=>{a?.(M),o?.execute(M,r)},[o,a,r]),x=u.useCallback((M,k)=>{const j={onSelectNamed:y,styles:h(),parentFloat:M.floatReference},_=h().getCustomNamed(),L=new Map,T=[];for(let A=0;A<_.length;A++)L.set(_[A].getName(),_[A]),h().getNamed(_[A].getName()).getBuiltInID()===null&&T.push(_[A].getName());const D=A=>{let O=L.get(A);return O||(O=h().getNamed(A)),!O||O.isHidden()?null:s.jsx(XB,{namedStyle:O,selectedNamed:g,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...j},A)},C=(A,O,N=!0)=>{const F=[];for(let E=0;E<O.length;E++){const B=D(O[E]);B&&F.push(B)}return F.length===0?null:s.jsxs(Ae,{children:[N?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(Gs,{children:A},A+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:F},A+"-presets")]},A)},S=(A,O)=>{const N=[];for(let F=0;F<O.length;F++){const E=D(O[F]);E&&N.push(E)}return N.length===0?null:s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:N},A+"-presets")},R=[];R.push(C("Custom",T,!1)),R.push(C("Good, Bad and Neutral",[$.IStyle.BuiltInName.Normal,$.IStyle.BuiltInName.Bad,$.IStyle.BuiltInName.Good,$.IStyle.BuiltInName.Neutral],T.length>0)),R.push(C("Data and Model",[$.IStyle.BuiltInName.Calculation,$.IStyle.BuiltInName.CheckCell,$.IStyle.BuiltInName.ExplanatoryText,$.IStyle.BuiltInName.FollowedHyperlink,$.IStyle.BuiltInName.Hyperlink,$.IStyle.BuiltInName.Input,$.IStyle.BuiltInName.LinkedCell,$.IStyle.BuiltInName.Note,$.IStyle.BuiltInName.Output,$.IStyle.BuiltInName.WarningText])),R.push(C("Titles and Headings",[$.IStyle.BuiltInName.Heading1,$.IStyle.BuiltInName.Heading2,$.IStyle.BuiltInName.Heading3,$.IStyle.BuiltInName.Heading4,$.IStyle.BuiltInName.Title,$.IStyle.BuiltInName.Total]));let P=[];var I,z;return P.push(S("Accent 1",[$.IStyle.BuiltInName.Accent1_20,$.IStyle.BuiltInName.Accent1_40,$.IStyle.BuiltInName.Accent1_60,$.IStyle.BuiltInName.Accent1])),P.push(S("Accent 2",[$.IStyle.BuiltInName.Accent2_20,$.IStyle.BuiltInName.Accent2_40,$.IStyle.BuiltInName.Accent2_60,$.IStyle.BuiltInName.Accent2])),P.push(S("Accent 3",[$.IStyle.BuiltInName.Accent3_20,$.IStyle.BuiltInName.Accent3_40,$.IStyle.BuiltInName.Accent3_60,$.IStyle.BuiltInName.Accent3])),P.push(S("Accent 4",[$.IStyle.BuiltInName.Accent4_20,$.IStyle.BuiltInName.Accent4_40,$.IStyle.BuiltInName.Accent4_60,$.IStyle.BuiltInName.Accent4])),P.push(S("Accent 5",[$.IStyle.BuiltInName.Accent5_20,$.IStyle.BuiltInName.Accent5_40,$.IStyle.BuiltInName.Accent5_60,$.IStyle.BuiltInName.Accent5])),P.push(S("Accent 6",[$.IStyle.BuiltInName.Accent6_20,$.IStyle.BuiltInName.Accent6_40,$.IStyle.BuiltInName.Accent6_60,$.IStyle.BuiltInName.Accent6])),R.push((I="Themed Cell Styles",z=P,s.jsxs(Ae,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Gs,{children:I},I+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:z},I+"-presets")]},I))),R.push(C("Number Format",[$.IStyle.BuiltInName.Comma,$.IStyle.BuiltInName.Comma0,$.IStyle.BuiltInName.Currency,$.IStyle.BuiltInName.Currency0,$.IStyle.BuiltInName.Percent])),s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[s.jsx(Ae,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:R}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{variant:Zt.Menuitem,commandState:g,command:k.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:l,icon:ze(s.jsx(HO,{}))})]})},[g,h?.().getTheme(),m]),v=Te(M=>{const k=18/$.IFont.getDeviceScale(),j=f?.createTemporaryCell(M);return j.getStyle().getFont().getSize()<=k?j:j.createTemporaryCell({style:{font:{size:k}}})},[f?.createTemporaryCell]),b=l||!o||o.disabled(),w=u.useMemo(()=>f&&d?s.jsx(eC,{value:g?.getName()??"Custom",cellStyle:g?{named:g.getName()}:void 0,styles:f.styles(),createTemporaryCell:v,bodyStyle:f.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:M=>`1px solid ${M.palette.action.hover}`},borderProps:{}}):ze(s.jsx(Gc,{})),[g,m,b]);return s.jsx(Xn,{ref:t,createPopupPanel:x,outlined:d,commands:n,createTooltip:({children:M},k)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:k,children:M}),selected:!1,disabled:b,label:o?.label(),icon:w,...p})})),nC="_sheetxl-reset_ods65_1",YB=10,Rf=u.memo(u.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:a,disabled:l,className:c,forceThinBorder:d,cellHeight:p=YB,isLive:f=!1,...h}=e,g=Math.ceil(1.3*p),[m,y]=u.useReducer(M=>M+1,0);u.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{y()}})},[o,f]);const x=u.useMemo(()=>{let M=o?.toJSON()??{};const k={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return M&&(M.styleOptions={...M.styleOptions,name:r.getName()}),M.ref=k,new $.Table({initialAnchor:k,json:M,styles:n})},[m,o,r,n]),v=u.useMemo(()=>{const M=[];for(let k=0;k<5;k++)for(let j=0;j<5;j++){const _=x.getStyleAt({colIndex:j,rowIndex:k});M.push(_)}return M},[x]),b=u.useMemo(()=>{const M=(j,_,L)=>{let T=L.getFill().toCSS(i?.darkMode??!1);const D=g-(_<4?1:0),C=p-(j<4?1:0),S=L.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:_*(g-1),top:j*(p-1),width:D,height:C},s.jsx("td",{className:`table-style-fill ${j}-${_}`,style:T,children:s.jsx("div",{className:`table-style-text ${j}-${_}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(D-6)/2,top:(C-1)/2,borderTop:`1px solid ${S}`}})},`${j}-${_}`)},k=[];for(let j=0;j<5;j++){const _=[];for(let L=0;L<5;L++){const T=v[5*j+L];_.push(M(j,L,T))}k.push(s.jsx("tr",{children:_},j))}return k},[x,r,i]),w=u.useCallback((M,k)=>v[k].getBorder()??null,[v]);return s.jsx(Ae,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:l?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...a},...h,children:s.jsx(ff,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(g-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:s.jsx("table",{className:Eo(c,"sheetxl-table-preview",nC),style:{borderCollapse:"collapse",width:5*(g-1)+1,height:5*(p-1)+1},children:s.jsx("tbody",{children:b})})})})})),V0=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},oC=u.memo(u.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:a,style:l,className:c,canvas:d,...p}=e,f=u.useMemo(()=>{const m=n.toJSON(),y={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return m.styleOptions={...m.styleOptions,name:o.getName()},m.ref=y,new $.Table({initialAnchor:y,json:m,styles:r})},[n,o,r]),h=u.useMemo(()=>{const m=[];for(let y=0;y<5;y++)for(let x=0;x<5;x++){const v=f.getStyleAt({colIndex:x,rowIndex:y});m.push(v)}return m},[f]),g=u.useMemo(()=>{let m=d;if(d||(m=document.createElement("canvas")),!m)return null;m.width!==61&&(m.width=61),m.height!==46&&(m.height=46);const y=m.getContext("2d",{alpha:!1});if(!y)return null;const x=12,v=i?.darkMode??!1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const M=h[5*b+w].getFill();let k=i?.fill;M.getType()===$.IFill.Type.Solid?k=M.getColor().toCSS(v,!1):M.getType()===$.IFill.Type.Gradient?k=M.getStops[0]?.color.toCSS(v,!1):M.getType()===$.IFill.Type.Pattern&&(k=M.getForeground().toCSS(v,!1)),y.fillStyle=k;const j=w*x,_=9*b;y.fillRect(j,_,13,10)}y.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const M=h[5*b+w],k=w*x,j=9*b,_=M.getBorder();if(!_.isEmpty()){const D=_.getLeft();D.isNone()||(y.strokeStyle=D.getColor().toCSS(v,!1),V0(y,k,j,k,j+9));const C=_.getTop();C.isNone()||(y.strokeStyle=C.getColor().toCSS(v,!1),V0(y,k,j,k+x,9*b));const S=_.getRight();S.isNone()||(y.strokeStyle=S.getColor().toCSS(v,!1),V0(y,k+x,j,k+x,j+9));const R=_.getBottom();R.isNone()||(y.strokeStyle=R.getColor().toCSS(v,!1),V0(y,k,j+9,k+x,j+9))}y.strokeStyle=M.getFont().getFill().toCSS(v,!1);const L=4,T=2.5;V0(y,w*x+T,9*b+L,w*x+T+7,9*b+L)}return`url(${m.toDataURL()})`},[d,f,o,i]);return s.jsx("div",{ref:t,className:Eo("table-style-preview",c),style:{backgroundImage:g,width:61,height:46,...l},...p})})),rC=u.memo(u.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:a,onShowTotalRowChange:l,showFilterButton:c,onShowFilterButtonChange:d,sx:p,disabled:f,...h}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:g=>`${g.spacing(2)}`,marginRight:g=>`${g.spacing(2)}`},"& .MuiCheckbox-root":{padding:g=>`${g.spacing(.5)}`},...p},...h,ref:t,children:[i&&s.jsx($a,{control:s.jsx(Na,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),l&&s.jsx($a,{control:s.jsx(Na,{checked:a??!1,indeterminate:a==null,onChange:()=>l(!a),disabled:f||a==null}),label:"Total Row",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&s.jsx($a,{control:s.jsx(Na,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>d(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),JB=u.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:a=!0,bodyStyle:l,parentFloat:c,commands:d,disabled:p,commandHook:f,useCanvasPreview:h=!0,canvas:g,...m}=e,y=u.useCallback(w=>{const M={variant:Zt.Menuitem,commandHook:f,context:"table"},k=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...M,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ge,{...M,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]});return Bn({...w,children:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:k})})})},[d]),x=n?.getName()===o,v=u.useMemo(()=>{const w={table:t,tableStyle:n,styles:i,bodyStyle:l};return h?s.jsx(oC,{canvas:g,...w}):s.jsx(Rf,{...w})},[t,n,i,l]);let b=s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${x?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...m,children:v},n.getName());return a&&(b=s.jsx(Cv,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:y,children:b})),b}),iC=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:a,disabled:l=!1,bodyStyle:c,usePreviewIcon:d=!1,...p}=e;rl(o);const f=o?.context(),h=f?.styles,g=i??f?.table?.();let m="insertTable";g&&(m="editTable");const y=u.useMemo(()=>((T,D)=>{const C={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new $.Table({initialAnchor:C,styles:D,json:{name:"PreviewTable",ref:C,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:T}})})(g?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),g?.getStyleOptions()]),x=g??y,[v,b]=u.useState(x);u.useEffect(()=>{b(x)},[x]);const w=c??f?.bodyStyle(),M=Te(T=>{a?.(T),o?.execute({name:T},r)},[o,a,r]),k=u.useRef(null),j=u.useCallback((T,D)=>{const C={onSelectTableStyleName:M,styles:h(),parentFloat:T.floatReference};k.current||(k.current=document.createElement("canvas"));const S=E=>{const B=h().getTableStyle(E);return B?s.jsx(JB,{table:v,tableStyle:B,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:D,commandHook:r,canvas:k.current,...C},E):null},R=(E,B,H=!0)=>{const U=[];for(let Z=0;Z<B.length;Z++){const G=S(B[Z]);G&&U.push(G)}return U.length===0?null:s.jsxs(Ae,{children:[H?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(Gs,{children:E},E+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:U},E+"-presets")]},E)},P=[],I=h().getCustomTableStyles(),z=[];if(I.length>0){for(let E=0;E<I.length;E++)I[E].isShownInTableStyles()&&z.push(I[E].getName());P.push(R("Custom",z,!1))}const A=[];g&&!g.getStyleOptions().name&&A.push(null);for(let E=0;E<21;E++)A.push("TableStyleLight"+(E+1));P.push(R("Light",A,z.length>0));const O=[];for(let E=0;E<28;E++)O.push("TableStyleMedium"+(E+1));P.push(R("Medium",O));const N=[];for(let E=0;E<11;E++)N.push("TableStyleDark"+(E+1));P.push(R("Dark",N));let F=null;return g&&(F=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{variant:Zt.Menuitem,command:D.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:l,icon:ze(s.jsx(_b,{}))})]})),s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:E=>`${E.shape.borderRadius}px`,paddingBottom:E=>`${E.shape.borderRadius}px`},children:[s.jsx(Ae,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:P}),F]})},[h,h?.().getTheme(),w,v]),_=l||!o||o.disabled(),L=u.useMemo(()=>{if(!f||!d)return ze(s.jsx(Gc,{}))},[v,w,_]);return s.jsx(Xn,{ref:t,quickCommand:m,createPopupPanel:j,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:T},D)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:D,children:T}),disabled:_,icon:L,...p})})),gi=[];gi.push(Bi("Primary Background","bg1")),gi.push(Bi("Primary Text","tx1")),gi.push(Bi("Secondary Background","bg2")),gi.push(Bi("Secondary Text","tx2")),gi.push(Bi("Accent 1","accent1")),gi.push(Bi("Accent 2","accent2")),gi.push(Bi("Accent 3","accent3")),gi.push(Bi("Accent 4","accent4")),gi.push(Bi("Accent 5","accent5")),gi.push(Bi("Accent 6","accent6"));const aC=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...l}=e,c=Ki(),d=u.useMemo(()=>{let p=[];for(let f=0;f<gi.length;f++){const h=gi[f];p.push(s.jsx(V2,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:s.jsx(Ae,{sx:{display:"flex",boxShadow:f=>f.shadows[2]},children:p})})},[t,c]);return s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...l,children:s.jsxs(Ae,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[s.jsx(Ae,{sx:{},children:t.getName()}),s.jsxs(Ae,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,s.jsx(Ae,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:s.jsx(di,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:s.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
218
+ `,h=!0));const g=[{range:new t.Range(c.lineNumber,c.column,c.lineNumber,c.column),text:`${p}`}];let m=null;o.pushEditOperations([],g,y=>(m=y[0].range,f&&m.startLineNumber++,h&&m.endLineNumber--,[new t.Selection(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn)])),e.setSelection({startLineNumber:m.endLineNumber,startColumn:m.endColumn,endLineNumber:m.startLineNumber,endColumn:m.startColumn})};function $B(e,t){let n=null;for(let o=0;!n&&o<e.length;o++){const r=e[o];r.getName()===t.text&&(n=r)}return n?n.getContext():"formula"}function Wh(e,t,n,o,r=[]){if(o.kind==="function"&&o.kindModifiers==="export"){const i=o.spans[0].start,a=e.getPositionAt(i);r.push({name:o.text,type:$B(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)Wh(e,t,n,i,r);return r}function Sf(e,t,n="function",o){const r=e.spans;for(let i=0;i<r.length;i++){const a=r[i];if(a.start<=t&&t<a.start+a.length){if(e.kind===n&&(!o||e.kindModifiers===o))return e;for(const l of e.childItems||[]){const c=Sf(l,t,n,o);if(c)return c}}return null}}function VB(e){return e.kind==="comment"}const HB=u.memo(u.forwardRef((e,t)=>{const{className:n,style:o,commands:r,readOnly:i=!1,onClose:a,darkMode:l,loadingPanel:c,autoFocus:d=!0,onStatusChange:p,...f}=e,h=u.useRef(null),g=Te(a,[a]),m=u.useRef(!1),y=u.useMemo(()=>({contains(O){if(!h.current)return;const N=h.current.editor;return N&&N.getDomNode()?.contains(O)},focus(){if(!h.current)return;const O=h.current.editor;return O&&O.getDomNode()?.focus()}}),[]),x=u.useMemo(()=>[new We("help",y,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=u.useMemo(()=>{let O=null;const N=()=>y;return O=r?r.createChildGroup(N,"scriptEditor",!1):new a0(N,"scriptEditor"),O.addCommands(x,!0),O},[r,x]),b=_o(v,["executeSelectedScript"])[0],w=b?.context(),M=Te(O=>{b?.execute(O)},[b]),k=u.useRef(""),[j,_]=u.useState(!1),L=Te(async()=>{if(!h.current)return null;const O=h.current,N=O.editor;if(!N)return null;const F=O.monaco,E=await(async(B,H,U="export")=>{const Z=B.getModel();if(!Z)return null;const G=await H.languages.typescript.getTypeScriptWorker(),V=await G(Z.uri),le=await V.getNavigationTree(Z.uri.toString());let re=null,ge=B.getSelection();const Q=ge.startLineNumber===ge.endLineNumber&&ge.startColumn===ge.endColumn?Z.getLineCount():Math.min(ge.endLineNumber,Z.getLineCount());for(let xe=ge.startLineNumber;!re&&xe<=Q;xe++){const be=Sf(le,Z.getOffsetAt({lineNumber:xe,column:1}),"function",U);be&&(re=be.text)}return re})(N,F);return p?.({message:(E??"").toUpperCase()}),E?{source:N.getValue(),name:E}:null},[p]),T=Te(async(O,N,F)=>{const E=await w.getScripts().createModule({source:F?.getValue(),declarationsOnly:!0}),B=E?E.getFunctions().search():Gt.EmptyArray;E&&(async function(H,U){const Z=[];for(let G=1;G<H.getLineCount()+1;G++){const V={startLineNumber:G,startColumn:1,endLineNumber:G,endColumn:H.getLineLength(G)+1},le=H.getValueInRange(V).indexOf("modelt");le!==-1&&Z.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:V.startLineNumber,startColumn:le+1,endLineNumber:V.startLineNumber,endColumn:le+5})}U.editor.setModelMarkers(H,"owner",Z)}(O,N),async function(H,U,Z,G){const V=await U.languages.typescript.getTypeScriptWorker(),le=await V(H.uri),re=await le.getNavigationTree(H.uri.toString()),ge=Wh(H,U,G,re).map(Q=>{let xe=null,be=null;return Q.type==="formula"?(xe="formula.margin-icon",be="Formula"):Q.type==="macro"?(xe="macro.margin-icon",be="Macro"):Q.type==="autoRun"&&(xe="autorun.margin-icon",be="Auto Run"),{range:new U.Range(Q.lineNumber,1,Q.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:be,stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});R.current&&R.current.clear(),R.current=Z.createDecorationsCollection(ge)}(O,N,F,B))},[w]),D=Te(Gt.debounce(T,580),[]),C=Te(async(O=void 0)=>{if(!h.current||!w)return;const N=h.current.editor.getPosition(),F={cursor:N?N.toString():""};O!==void 0&&(F.message=O),p?.(F);const E=L();w.setSelectedFunction(E)},[w,p]);u.useEffect(()=>{if(!w)return;const O={insertSnippet:F=>{h.current?.editor&&(j?zg(h.current.editor,h.current.monaco,F):k.current=F)}};w.setEditor(O),w.setSelectedFunction(L());const N=w.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!w)return;const F=h.current.editor,E=w?.getScripts().getModules().getByName("scripting"),B=E?.getSource(),H=F.getValue();if((B?.length??0)===H.length&&B===H)return;await w.saveSource(F.getValue());const U=(B?.length??0)!==H.length||B!==H;p?.({dirty:U})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!w)return;const F=h.current.editor,E=w.getScripts().getModules().search()[0]?.getSource()??"";F.setValue(E)}});return()=>{N(),w.setSelectedFunction(null),w.setEditor(null)}},[w,j]),u.useEffect(()=>()=>{if(!h.current?.editor)return;const O=h.current.editor;w?.saveSource(O.getValue())},[]);const S=Te(O=>{const N=h.current;if(!N)return!1;const F=N.editor;return!!F&&(F.focus(),!0)},[]),R=u.useRef(null),P=Te((O,N)=>{h.current={monaco:N,editor:O},_(!0),C("Loading Types");const F=w.getScripts().getModules().search()[0]?.getSource()??"";O.setValue(F),Promise.resolve().then(()=>require("./DCd2rPNFkSHDaRcM.cjs")).then(H=>H.c).then(H=>{C(""),H.AutoTypings.create(O,{shareCache:!0,monaco:N,onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(async U=>{const Z=O.getModel();D(Z,N,O)})}),O.addCommand("executeScript",function(H,...U){U?.[0]&&M({functionName:U?.[0]})},""),O.addAction({id:"executeScript",label:"Execute",keybindings:[N.KeyCode.F8],run:async H=>{const U=L();w.setSelectedFunction(U);const Z=await U;M(Z)}}),O.addAction({id:"saveScript",label:"Save Script",keybindings:[N.KeyMod.CtrlCmd|N.KeyCode.KeyS],run:H=>{w?.saveSource(O.getValue()).then(()=>{const U=w?.getScripts().getModules().getByName("scripting"),Z=U?.getSource(),G=O.getValue(),V=(Z?.length??0)!==G.length||Z!==G;p?.({dirty:V})})}}),O.onMouseDown(async H=>{if(H.target.type===N.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=H.target.position.lineNumber,Z=await N.languages.typescript.getTypeScriptWorker(),G=await Z(E.uri),V=await G.getNavigationTree(E.uri.toString()),le=O?.getValue(),re=(await w?.saveSource(le)).getFunctions().search(),ge=Wh(E,N,re,V).find(Q=>Q.lineNumber===U);if(ge){const Q=H.event.browserEvent.button;Q===0?ge.type==="macro"||ge.type==="autoRun"?M({functionName:ge.name}):ge.type==="formula"&&w.quickInsertFunction?.(ge.name):Q===2&&(console.log("Context menu for function:",ge.name),H.event.browserEvent.preventDefault())}}}),O.onDidChangeModelContent(()=>{const H=O.getModel();D(H,N,O)});const E=O.getModel();var B;(B=N).languages.registerInlayHintsProvider("typescript",{provideInlayHints(H,U,Z){const G=[];for(let V=1;V<H.getLineCount()+1;V++){const le={startLineNumber:V,startColumn:1,endLineNumber:V,endColumn:H.getLineLength(V)+1},re="hint",ge=H.getValueInRange(le).indexOf("hint");ge!==-1&&G.push({kind:B.languages.InlayHintKind.Type,position:{lineNumber:le.startLineNumber,column:ge+re.length+1},label:"[hint]"})}return{hints:G,dispose:()=>{}}}}),E.onDidChangeContent(H=>{const U=w?.getScripts().getModules().getByName("scripting"),Z=U?.getSource(),G=O.getValue(),V=(Z?.length??0)!==G.length||Z!==G;p?.({dirty:V})}),O.onDidChangeCursorPosition(H=>{C()})},[w,p]),I=u.useMemo(()=>j?null:c||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[j,c]),z=u.useMemo(()=>{const O=w?.getScripts().getModules().getByName("scripting")?.getSource()??"";return s.jsxs("div",{style:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:[s.jsx(u.Suspense,{children:s.jsx(BB,{theme:l?"extended-dark":"extended",options:{...NB,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:O,onValidate:N=>{let F=!1;for(let E=0;!F&&E<N?.length;E++)N[E].severity===8&&(F=!0)},beforeMount:N=>{N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),N.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),N.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),N.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let F=!1;try{const B=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),H=N.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),U=N.editor.createModel(B,"typescript",H);N.editor.setModelMarkers(U,"default",[]),F=!0}catch(B){console.warn("cant load types",B)}N.languages.registerLinkProvider("*",{provideLinks:(B,H)=>{const U=[],Z={links:U},G=B.getLinesContent();for(let V=1;V<=G.length;V++){const le=G[V-1],re=N.editor.tokenize(le,"typescript");for(let ge=0;ge<re[0].length;ge++){const Q=re[0]?.[ge];if(Q&&Q.type.startsWith("string")){let xe=Q.offset,be=re[0]?.[ge+1]?.offset??le.length,Fe=new N.Range(V,xe+1,V,be+1),ee=B.getValueInRange(Fe);const ae=ee[0];ae!=="`"&&ae!=="'"&&ae!=='"'||(xe++,ee=ee.substring(1));const we=ee[ee.length-1];we!=="`"&&we!=="'"&&we!=='"'||(xe++,ee=ee.substring(0,ee.length-1));try{w.getRanges(ee)&&U.push({range:{endColumn:be,endLineNumber:V,startColumn:xe,startLineNumber:V},tooltip:`Goto range '${ee}'`,url:`/range/${ee}`})}catch(se){console.warn(se)}}}}return Z}}),N.editor.registerLinkOpener({open(B){if(B?.path?.startsWith("/range/")){try{w.getRanges(B.path.substring(7))?.select()}catch(H){console.warn("invalid range",H)}return!0}return!1}});const E=N.languages.typescript.typescriptDefaults.getCompilerOptions();N.languages.typescript.typescriptDefaults.setCompilerOptions({...E,target:N.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:N.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),k.current&&(await zg(h.current.editor,h.current.monaco,k.current),k.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&N.editor.focus()}),N.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),_(!0)})()},onMount:P})}),I]})},[w,v,i,I,l]),A=ir(t,()=>({isScriptEditorElement:()=>!0,focus:O=>{S(O)},close:()=>{g?.()},getEditor:()=>w?.getEditor()}),[w]);return u.useEffect(()=>(d&&requestAnimationFrame(()=>{S()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{A.current?.contains(document.activeElement)&&S()})}),[]),s.jsx("div",{className:Zr("script-editor","_script-editor_iy654_5",n),style:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,children:z})})),AS={Preset:"preset",Custom:"custom"},Os={Start:"start",End:"end"},s5={},WB=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(s5[r])return s5[r];const i=((a,l,c,d)=>{if(typeof document>"u"&&!d)return null;const p=d?new d:document.createElement("canvas");p.width=2*c,p.height=2*c;const f=p.getContext("2d");return f?(f.fillStyle=a,f.fillRect(0,0,p.width,p.height),f.fillStyle=l,f.fillRect(0,0,c,c),f.translate(c,c),f.fillRect(0,0,c,c),p.toDataURL()):null})(e,t,n,o);return s5[r]=i,i},UB={},LS=u.memo(e=>{const{className:t,style:n=jn.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:l,renderers:c=UB,children:d,...p}=e,f=d,h=u.useMemo(()=>Object.assign({borderRadius:a,boxShadow:l,position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",background:`url(${WB(o,r,i,c?.canvas)}) center left`},n),[o,r,i,c]);return u.isValidElement(d)?u.cloneElement(d,{...f.props}):s.jsx("div",{style:h,...p})}),qB=u.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:l,onFocus:c,style:d=jn.EmptyCssProperties,children:p,alphaWhite:f,alphaGrey:h,darkMode:g,alphaCheckSize:m=7,...y}=e;if(!t)throw new Error("a selectedColor is required");const x=u.useCallback(j=>{r?.(j),j.isDefaultPrevented()||(j.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=u.useCallback(j=>{a?.(j),j.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=u.useCallback(j=>{l?.(j),j.isDefaultPrevented()},[o,l]),w=u.useCallback(j=>{c?.(j),j.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),M=u.useCallback(j=>{i?.(j),j.isDefaultPrevented()||j.keyCode===on.Enter&&n?.(t.toRGBA())},[n,i,t]),k=u.useMemo(()=>t.toRGBA().alpha===1?null:s.jsx(LS,{size:m,white:f,grey:h,style:{position:"absolute",width:"calc(100% - 1.5px)",height:"calc(100% - 1.5px)",top:"0.75px",left:"0.75px"}}),[f,h,t]);return s.jsxs("div",{style:{position:"absolute",height:"100%",width:"100%",top:"0px",left:"0px",cursor:"pointer",outline:"none",...d},tabIndex:0,...y,onClick:x,onKeyDown:M,onMouseOver:v,onMouseLeave:b,onFocus:w,children:[k,s.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),V2=u.memo(e=>{const{schemeColorLookup:t,selectedColor:n,previewColor:o,colorDef:r,onSelectColorDef:i,onPreviewColorDef:a,swatchProps:l,defaultButtonSize:c=24,isLarge:d=!1,compareRGB:p=!1,darkMode:f=!1,...h}=e,g=new $.Color({val:r.definition.val,adjs:r.definition.adjs},k=>t(k)),m=p?g.toRGBA().toString():g.toString(),y=n&&(p?n.toRGBA().toString():n.toString())===m,x=o&&(p?o.toRGBA().toString():o.toString())===m,v=[];v.push({[$.IColor.AdjustmentType.Inv]:!0}),v.push({[$.IColor.AdjustmentType.Alpha]:100});const b=g.adjust(v),w=u.useCallback(()=>{i?.(r)},[i,r]),M=u.useCallback(k=>{a?.(k?r:null)},[a,r]);return s.jsx(di,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:r.description,placement:"bottom-start",children:s.jsx("div",{style:{width:c*(d?1.2:1)+"px",height:c*(d?1.2:1)+"px",position:"relative",boxSizing:"border-box",cursor:"pointer",outline:"none"},...h,children:s.jsxs(qB,{selectedColor:g,title:null,onSelectColor:w,onPreviewColor:M,alphaCheckSize:d?9:void 0,darkMode:f,...l,children:[s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",pointerEvents:"none",borderColor:b.toRGBA(f).toString(),borderWidth:"2px",borderStyle:"solid",boxSizing:"border-box",opacity:y?"1":"0"}}),s.jsx("div",{style:{position:"absolute",width:.33*c*(d?1.2:1)+"px",height:.33*c*(d?1.2:1)+"px",left:"calc(50% - 0.5px)",top:"calc(50% - 0.5px)",transform:"translate(-50%,-50%)",pointerEvents:"none",background:b.toRGBA(f).toString(),borderRadius:"50%",opacity:x?"1":"0"}})]})})})}),Td=u.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:l,style:c=jn.EmptyCssProperties,compareRGB:d=!1,darkMode:p,swatchProps:f,...h}=e;let g;if(Array.isArray(o[0]))g=o;else{g=[];for(let b=0;b<o.length;b++)g.push([o[b]])}const m=u.useCallback(b=>{a?.(b)},[a]),y=u.useCallback(b=>{l?.(b)},[l]),x=u.useMemo(()=>{let b=[];for(let w=0;w<g.length;w++){let M=[],k=g[w];for(let _=0;_<k.length;_++){let L=k[_];M.push(s.jsx(V2,{schemeColorLookup:n,colorDef:L,selectedColor:r,previewColor:i,onSelectColorDef:m,onPreviewColorDef:y,swatchProps:f,compareRGB:d,darkMode:p},w+" "+_))}let j=s.jsx(Ae,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:_=>_.shadows[2],borderRadius:"2px",overflow:"hidden"},children:M},""+w);b.push(j)}return b},[g,r,i,m,y]),v=u.useMemo(()=>t?s.jsx(Tn,{noWrap:!0,component:"div",sx:{display:"flex",flexShrink:"0",paddingLeft:"6px",paddingBottom:"4px",paddingTop:"0px",userSelect:"none",color:b=>b.palette.text.secondary},children:t}):null,[t]);return s.jsxs(Ae,{style:{...c},children:[v,s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:x})]})}),Bi=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),Ho=(e,t,n,o,r,i)=>{const a=Bi(e,t);o?.push(a);const l=new $.Color({val:a.definition.val,adjs:a.definition.adjs},n),c=l.toString();r?.set(c,l);const d=l.toRGBA().toString();i?.set(d,l)},KB=u.lazy(()=>Promise.resolve().then(()=>require("./EoaX6dPoS-Mb-ITO.cjs"))),zS=u.memo(u.forwardRef((e,t)=>{const{selectedColor:n=null,previewColor:o=e.selectedColor??null,recentColors:r,schemeLookup:i,disableAlpha:a=!1,previewDebounceTime:l=100,initialPanelType:c,defaultButtonSize:d=24,width:p,onElementLoad:f,onDone:h,onEyeDropStart:g,onEyeDropStop:m,onPreviewColor:y,onPreviewColorImmediate:x,onSelectColor:v,autoColor:b,autoColorLabel:w="Automatic",autoColorPosition:M=Os.Start,compareRGB:k=!1,darkMode:j=!1,..._}=e,L=o||n,T=Te(y,[y]),D=Te(x,[x]),C=Te(v,[v]),S=Te(g,[g]),R=Te(m,[m]),[P,I]=u.useState(!1),z=Ki(),A=u.useMemo(()=>i||$.Color.getDefaultSchemeLookup(),[i]),O=u.useMemo(()=>{const ee=new Map,ae=new Map,we=[];Ho("Primary Background","bg1",A,we,ee,ae),Ho("Primary Text","tx1",A,we,ee,ae),Ho("Secondary Background","bg2",A,we,ee,ae),Ho("Secondary Text","tx2",A,we,ee,ae),Ho("Accent 1","accent1",A,we,ee,ae),Ho("Accent 2","accent2",A,we,ee,ae),Ho("Accent 3","accent3",A,we,ee,ae),Ho("Accent 4","accent4",A,we,ee,ae),Ho("Accent 5","accent5",A,we,ee,ae),Ho("Accent 6","accent6",A,we,ee,ae);const se=$.ITheme.buildPalette(we,A,ee,ae),J=[];if(Ho("Dark Red","C00000",A,J,ee,ae),Ho("Red","FF0000",A,J,ee,ae),Ho("Orange","FFC000",A,J,ee,ae),Ho("Yellow","FFFF00",A,J,ee,ae),Ho("Light Green","92D050",A,J,ee,ae),Ho("Green","00B050",A,J,ee,ae),Ho("Light Blue","00B0F0",A,J,ee,ae),Ho("Blue","0070C0",A,J,ee,ae),Ho("Dark Blue","002060",A,J,ee,ae),a?Ho("Purple Is A Fruit","7030A0",A,J,ee,ae):Ho("Transparent","00000000",A,J,ee,ae),b){const Ee=b.toString();ee.set(Ee,b)}const ce=new Map,ne=typeof r=="function"?r():r,Pe=[];for(let Ee=0;ne&&Ee<ne.length;Ee++){const it=ne[Ee].toString();ce.set(it,ne[Ee]),Pe.push({description:"Recent "+(Ee+1),definition:{val:ne[Ee].toString()}})}return{primaryColors:we,modifiedPresets:se,standardColors:J,recentColorsLimited:Pe,mapAllPresets:ee,mapAllPresetsRGB:ae,mapRecent:ce}},[A,r,a,b]);u.useEffect(()=>{f?.()},[]);const[N,F]=u.useState(!1),E=u.useCallback(()=>{F(ee=>!ee)},[]);u.useEffect(()=>{if(c)F(c===AS.Custom);else if(n){let ee=n.toString(),ae=O.mapAllPresets.get(ee);ae||(ee=n.toRGBA().toString(),ae=O.mapAllPresetsRGB.get(ee));const we=O.mapRecent.get(ee);F(!ae&&!we)}},[n,c]);const B=u.useCallback($.CommonUtils.debounce(ee=>{T?.(ee)},l),[T,l]),[H,U]=u.useState();u.useEffect(()=>{U(o||n)},[o,n]);const Z=Te(ee=>{D&&(D(ee),B(ee))},[D]),G=Te(ee=>{Z(ee?new $.Color({val:ee.definition.val,adjs:ee.definition.adjs},A):null)},[A]),V=u.useCallback(ee=>{ee.ctrlKey&&F(!0)},[]),le=Te(ee=>{let ae=!1;if(ee){const we=ee.toString();ae=!O.mapAllPresets.has(we)}C?.(ee,ae)},[C,O]),re=Te(ee=>{const ae=ee?new $.Color({val:ee.definition.val,adjs:ee.definition.adjs},A):null;Promise.resolve(h?.()).then(()=>{le(ae)})},[A,h]),ge=Te(ee=>{Z(ee?new $.Color(ee,A):null)},[A]),Q=u.useMemo(()=>window.EyeDropper===void 0?s.jsx(s.Fragment,{}):s.jsx(Tr,{"aria-label":"eye dropper",size:"small",sx:{color:ee=>ee.palette.text.icon??ee.palette.action.active},onClick:async()=>{I(!0),S?.(),await new EyeDropper().open().then(ee=>{I(!1),R?.();let ae=new $.Color(ee.sRGBHex),we=ae.toString(),se=O.mapAllPresets.get(we);if(se||(we=ae.toRGBA().toString(),se=O.mapAllPresetsRGB.get(we)),!se){const J=ae.toRGBA(),ce=3;let ne=255;O.mapAllPresetsRGB.forEach((Pe,Ee)=>{const it=Pe.toRGBA(),Ue=Math.abs(it.red-J.red)+Math.abs(it.blue-J.blue)+Math.abs(it.green-J.green);Ue<ce&&Ue<ne&&(se=Pe)})}F(!se),Z(se||ae)}).catch(ee=>{I(!1),ee?.name!=="AbortError"&&console.error(ee)})},children:s.jsx(iR,{})}),[O,j]),xe=u.useMemo(()=>{if(!N)return;const ee={opacity:N?1:"0",position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box"};return s.jsx(u.Suspense,{fallback:s.jsx("div",{style:ee,children:s.jsx(Gl,{})}),children:s.jsx(KB,{style:ee,selectedColor:L?L.toRGBA().toString():"transparent",onColorChange:ge,disableAlpha:a})})},[N,L]),be=u.useMemo(()=>({onClick:V,alphaGrey:z.palette.text.icon??z.palette.action.active}),[V,z]),Fe=u.useMemo(()=>{if(!b)return null;const ee={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return s.jsx(s.Fragment,{children:s.jsxs(v1,{sx:{display:"flex",color:ae=>ae.palette.text.secondary},onMouseOver:()=>{G(null)},onClick:()=>{re(null)},children:[s.jsx(Ae,{sx:{flex:"none",boxShadow:ae=>ae.shadows[2],borderRadius:ae=>ae.spacing(.5),overflow:"hidden"},children:s.jsx(V2,{schemeColorLookup:A,colorDef:ee,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:d,isLarge:!0,darkMode:j,compareRGB:k,swatchProps:be})}),s.jsx(Tn,{noWrap:!0,component:"div",style:{display:"flex",flex:"1 1 100%",marginLeft:"8px",userSelect:"none"},children:w})]})})},[b,w,A,n,o]);return s.jsxs(Ae,{ref:t,sx:{width:p,outline:"none",padding:"10px 10px",overflow:"hidden",boxSizing:"content-box"},..._,children:[s.jsxs("div",{style:{position:"relative",display:"flex"},children:[s.jsxs("div",{style:{opacity:N?"0":1},children:[Fe&&M===Os.Start?s.jsxs(s.Fragment,{children:[Fe,s.jsx(wa,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,s.jsx(Td,{title:"Theme Colors",schemeColorLookup:A,colorDefs:O.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsx(Td,{schemeColorLookup:A,colorDefs:O.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Td,{title:"Standard Colors",schemeColorLookup:A,colorDefs:O.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j}),s.jsxs("div",{style:{opacity:O.recentColorsLimited.length===0?"0":void 0,display:O.recentColorsLimited.length===0?"none":void 0},children:[s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Td,{title:"Recent Colors",schemeColorLookup:A,colorDefs:O.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:be,onPreviewColorDef:G,onSelectColorDef:re,compareRGB:k,darkMode:j})]}),Fe&&M===Os.End?s.jsxs(s.Fragment,{children:[s.jsx(wa,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),Fe,s.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),xe]}),s.jsx(wa,{light:!0,style:{marginBottom:"10px"}}),s.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-around",gap:"8px",paddingLeft:"2px",paddingRight:"2px"},children:[Q,s.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),s.jsx(zc,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{E()},children:s.jsx("div",N?{children:"Preset"}:{children:"Custom"})}),s.jsx(zc,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{le(H)})},children:"Done"})]})]})})),GB=s.jsx(e=>{const{sx:t,...n}=e;return s.jsxs(Qe,{sx:{overflow:"visible","& .activeColor":{filter:C1},...t},...n,children:[s.jsx("path",{className:"activeColor",opacity:"1",d:"M12 20c4.41 0 8-3.59 8-8s-3.59-8-8-8-8 3.59-8 8 3.59 8 8 8z"}),s.jsx("path",{className:"style_grey",opacity:".3",d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8z"}),s.jsx("path",{className:"activeColor",opacity:".3",d:"M12 22c5.52 0 10-4.48 10-10S17.52 2 12 2 2 6.48 2 12s4.48 10 10 10zm0-18c4.41 0 8 3.59 8 8s-3.59 8-8 8-8-3.59-8-8 3.59-8 8-8z"})]})},{}),Cf=u.memo(u.forwardRef((e,t)=>{const{selectedColor:n,quickColor:o,icon:r=GB,tooltip:i,label:a,onPreviewColor:l,onPreviewColorImmediate:c,onSelectColor:d,variant:p=Ri.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:m=!1,...y}=e,x=Te(l,[l]),v=Te(c,[c]),b=Te(d,[d]),[w,M]=u.useState(()=>{}),k=o||w||n||f?.autoColor,j=u.useRef(!1),_=u.useCallback(()=>{},[]),L=Te(()=>{M(n)},[n]),T=Te(O=>{j.current||(M(O),x?.(O))},[x]),D=Te(O=>{j.current||(M(O),v?.(O))},[v]),C=Te((O,N)=>{j.current||(M(void 0),b?.(O,N))},[b]),S=u.useMemo(()=>s.jsx(Ae,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${k?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${k?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:O=>O.palette.text.icon??O.palette.action.active}},children:typeof r=="function"?r():r}),[k,r,m]),R=Te(O=>{b?.(o,!1)},[b,o]),[P,I]=u.useState(!1),z=u.useCallback(O=>{const{closeFloat:N,closeFloatAll:F}=O;return s.jsx(zS,{...f,selectedColor:n,previewColor:w,onDone:h?F:N,onKeyDown:E=>{E.which===on.Enter&&(h?F():N())},onPreviewColorImmediate:D,onPreviewColor:T,onSelectColor:C,onEyeDropStart:()=>I(!0),onEyeDropStop:()=>I(!1),compareRGB:g,darkMode:m})},[n,w,h,k,f?.autoColor,m]),A={onQuickClick:o?R:void 0,createPopupPanel:z,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:L,onPopupClose:_,tooltip:i||a||"Color",label:a,icon:S,...y};return p===Ri.Toolbar?s.jsx(qi,{ref:t,...A}):s.jsx(k1,{ref:t,...A})})),ru=82,Uh=e=>{const{styleColor:t,length:n=ru,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:l=!1,darkMode:c=!1,...d}=e;return s.jsx(Qe,{sx:{width:`${n}px`,height:`${o}px`,color:"inherit",overflow:"visible","& .activeColor":{stroke:p=>`${t?t.toRGBA(c).toString():p.palette.text.icon??p.palette.action.active}`},"& .style_grey":{stroke:p=>p.palette.text.icon??p.palette.action.active},...i},height:o,width:n,viewBox:`0 0 ${n} ${o}`,...d,children:s.jsx(Jw,{length:n,width:o,dashArray:r,isDouble:a,isAngled:l,className:"activeColor"})})},FS=u.memo(u.forwardRef((e,t)=>{const{variant:n,showLabels:o=!1,disabled:r=!1,createPopupPanel:i,styleColor:a,selectedStyle:l,onSelectStyle:c,showNone:d=!0,darkMode:p,sx:f,...h}=e,g=Te(c,[]),m=u.useCallback(b=>{const{popupContainer:w,floatReference:M,closeFloat:k,...j}=b,_=[],L=$.IBorder.BuiltInDefinitionsArray;for(let T=0;T<L.length;T++){const D=L[T];if(D.description==="None"&&!d)continue;const C=s.jsx(Uh,{styleColor:a,length:ru,width:D.width,darkMode:p,dashArray:D.pattern,isDouble:D.description.toLowerCase().includes("double"),isAngled:D.description.toLowerCase().includes("slant")});let S=null;S=o?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{marginRight:"6px"},children:D.description}),s.jsxs(Ae,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[s.jsx("div",{style:{flex:"1 1 100%"}}),C]})]}):D.description==="None"?"None":C,_.push(s.jsx(Gr,{className:"border-stroke",tabIndex:0,sx:{height:"28px","& svg path.activeColor":{filter:C7(4)},paddingLeft:"16px",background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{description:o?"":D.description},icon:null,disabled:r,onMouseDown:R=>R.preventDefault(),onMouseUp:()=>{k(),g(D.style)},onKeyDown:R=>{R.which===on.Enter&&k()},selected:D.style===l,parentFloat:M,children:S},T))}return s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:_})},[r,d,a,l,p]),y=u.useMemo(()=>{const b=$.IBorder.BuiltInDefinitions.get(l);let w;return w=b.description==="None"?s.jsx(Ae,{sx:{minWidth:`${ru}px`},children:"None"}):s.jsx(Uh,{styleColor:a,length:ru,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),s.jsx(Ae,{className:"border-stroke",sx:{paddingLeft:"12px",marginLeft:"4px",marginRight:"4px",height:"24px",display:"flex",alignItems:"center","& svg path.activeColor":{filter:C7()}},children:w})},[l,a]),x=u.useMemo(()=>$.IBorder.BuiltInDefinitions.get(l),[l]),v={disabled:r,icon:y,tooltip:"Border Style: "+x.description,sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...f},createPopupPanel:m,...h};return n===Ri.Toolbar?s.jsx(qi,{...v}):s.jsx(k1,{...v})})),BS=u.memo(u.forwardRef((e,t)=>{const{autoColor:n=null,schemeLookup:o,autoStrokeStyle:r=$.IBorder.StrokeStyle.Thin,disabled:i=!1,darkMode:a=!1,showStylingBefore:l=!0,onSelectBorder:c,onPreviewBorder:d,selectedBorder:p,createTemporaryBorder:f,...h}=e,g=Te(c,[c]),m=Te(d,[d]),[y,x]=u.useState(),[v,b]=u.useState(),w=y??r,M=v??n,k=p||{bottom:{style:r,color:n?.toString()}},j=Te(S=>{const R={},P=S?Object.keys(S):[];let I=!1;for(let H=0;H<P.length;H++)S[P[H]]?.style&&(R[P[H]]={style:S[P[H]].style,color:S[P[H]].color},I||R[P[H]].style===$.IBorder.StrokeStyle.None||(I=!0));P.length<6&&(I=!0);const z=I?R.left:null,A=I?R.top:null,O=I?R.right:null,N=I?R.bottom:null,F=I?R.vertical:null,E=I?R.horizontal:null;let B="";return A||z||(B+="M 3,5 H 5 V 3 H 3 "),A||(B+="M 7,5 H 9 V 3 H 7 "),A||F||(B+="M 11,5 h 2 V 3 h -2 "),A||(B+="M 15,5 h 2 V 3 h -2 "),A||O||(B+="M 19,5 h 2 V 3 h -2 "),z||(B+="M 3,9 H 5 V 7 H 3 "),F||(B+="M 11,9 h 2 V 7 h -2 "),O||(B+="M 19,9 h 2 V 7 h -2 "),E||z||(B+="M 3,13 H 5 V 11 H 3 "),E||(B+="M 7,13 H 9 V 11 H 7 "),E||F||(B+="M 11,13 h 2 v -2 h -2 "),E||O||(B+="M 19,13 h 2 v -2 h -2 "),E||(B+="M 15,13 h 2 v -2 h -2 "),z||(B+="M 3,17 H 5 V 15 H 3 "),F||(B+="M 11,17 h 2 v -2 h -2 "),O||(B+="M 19,17 h 2 v -2 h -2 "),N||z||(B+="M 3,21 H 5 V 19 H 3 "),N||(B+="M 7,21 H 9 V 19 H 7 "),N||F||(B+="M 11,21 h 2 v -2 h -2 "),N||(B+="M 15,21 h 2 v -2 h -2 "),N||O||(B+="M 19,21 h 2 v -2 h -2 "),s.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[s.jsx(Qe,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:s.jsx("path",{d:B})}),s.jsx(Ae,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:C1}},children:s.jsx(ff,{getBorderAt:(H,U)=>{if(!f||P.length===0)return null;const Z=H.rowIndex,G=H.colIndex,V={};return Z===0?(V.top=R.top,V.bottom=R.horizontal):(V.top=R.horizontal,V.bottom=R.bottom),G===0?(V.left=R.left,V.right=R.vertical):(V.left=R.vertical,V.right=R.right),f?.(V)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[M,w,a]),_=u.useCallback((S,R,P)=>{let I=null;if(S&&S.length>0){let z=null;(R||P)&&(z={style:P,color:R?.toString()??null}),I={};for(let A=0;A<S.length;A++)I[S[A]]=z}return I},[]),L=u.useCallback(S=>{g?.(S)},[]),T=u.useCallback(S=>{m?.(S)},[]),D=u.useCallback(S=>{const{closeFloatAll:R,floatReference:P}=S,I=(O,N,F="bottom",E=!1)=>{const B=_(O,M??null,E?$.IBorder.StrokeStyle.None:w??null),H=E?_([],M??null,w??null):B;return s.jsx(ii,{icon:j(H),sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{label:N,simple:!0,placement:F},onClick:()=>{R(),T(B),L(B)}})},z=s.jsxs(s.Fragment,{children:[s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom,$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical],"All Borders","top"),I([$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical],"Inner Borders","top"),I([$.IBorder.Edge.Horizontal],"Inside Horizontal Borders","top"),I([$.IBorder.Edge.Vertical],"Inside Vertical Borders","top"),I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom],"Outside Borders","top")]}),s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",justifyContent:"center",rowGap:"2px",gap:"2px"},children:[I([$.IBorder.Edge.Left],"Left Borders"),I([$.IBorder.Edge.Top],"Top Borders"),I([$.IBorder.Edge.Right],"Right Borders"),I([$.IBorder.Edge.Bottom],"Bottom Borders"),I([$.IBorder.Edge.Left,$.IBorder.Edge.Top,$.IBorder.Edge.Right,$.IBorder.Edge.Bottom,$.IBorder.Edge.Horizontal,$.IBorder.Edge.Vertical,$.IBorder.Edge.DiagonalUp,$.IBorder.Edge.DiagonalDown],"No Borders","bottom",!0)]})]}),A=s.jsx(s.Fragment,{children:s.jsxs(Ae,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[s.jsx(Cf,{variant:Ri.Toolbar,icon:s.jsx($3,{}),selectedColor:w===$.IBorder.StrokeStyle.None?new $.Color("transparent"):M,onPreviewColor:O=>{b(O)},onSelectColor:(O,N)=>{b(O)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||w===$.IBorder.StrokeStyle.None,parentFloat:P,shouldCloseFloatAll:!1}),s.jsx(FS,{selectedStyle:w,onSelectStyle:x,styleColor:M,darkMode:a,variant:Ri.Toolbar,parentFloat:P})]})});return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:O=>O.stopPropagation(),children:[l?A:z,s.jsx(Ft,{orientation:"horizontal"}),l?z:A]})},[w,M,n,o,a]),C=u.useMemo(()=>j(k),[k,a]);return s.jsx(qi,{ref:t,createPopupPanel:D,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:S},R)=>s.jsx(br,{label:"Borders",description:"Set the borders.",disabled:R,children:S}),onQuickClick:()=>{g?.(k)},quickButtonProps:{sx:{}},disabled:i,icon:C,...h})})),NS=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Zt.Toolbar,disabled:a=!1,autoColor:l,autoStrokeStyle:c,schemeLookup:d,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:g,icon:m,label:y,...x}=e,v=_o(n,["formatBorder"]),b=o??v[0],w=b?.context()??null,M=w?.autoColor??l,k=w?.autoStyle??c,j=f??w?.quickBorder,_=g??w?.darkMode,L=p??w?.createTemporaryBorder,T=d??w?.schemeLookup,D=Te(S=>{w?.onBorderSelect&&w.onBorderSelect(S),h?.(S),b?.execute(S,r)},[b,h,r]),C=u.useCallback((S,R)=>{const{children:P,title:I,...z}=S;let A=S.children;return(b?.disabled()||a)&&(A=s.jsx("div",{children:A})),s.jsx(l0,{command:b,placement:i===Zt.Toolbar?"bottom-start":"right-start",disabled:R,...z,children:A})},[b,a]);return s.jsx(BS,{ref:t,autoColor:M,darkMode:_,autoStrokeStyle:k,createTemporaryBorder:L,schemeLookup:T,selectedBorder:j,onSelectBorder:D,createTooltip:C,disabled:a||!b||b.disabled(),...x})})),$S=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("mergeToggle"),icon:ze(s.jsx(k7,{}))}),s.jsx(Ge,{...p,command:d.getCommand("mergeHorizontal"),icon:ze(s.jsx(TP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("mergeVertical"),icon:ze(s.jsx(_P,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:d.getCommand("unmerge"),icon:ze(s.jsx(Ub,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,quickCommand:"mergeToggle",commandHook:o,scope:r,tooltip:"Combine or split cells.",createPopupPanel:l,icon:ze(s.jsx(k7,{})),...a})})),VS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("freezeToggle"),icon:ze(s.jsx(PP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("freezeToggleHorizontal"),icon:ze(s.jsx(RP,{}))}),s.jsx(Ge,{...p,command:d.getCommand("freezeToggleVertical"),icon:ze(s.jsx(IP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:d.getCommand("unfreeze"),icon:s.jsx(Ub,{})})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:l,quickCommand:"freezeToggle",label:"Freeze Panes",tooltip:"Freeze a portion of the sheet to keep it visible while you scroll through the rest of the sheet.\\n\\nUseful for viewing data in other parts of your worksheet without losing your headers or labels.",icon:s.jsx(jP,{}),...a})})),HS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("find"),icon:ze(s.jsx(q7,{}))}),s.jsx(Ge,{...p,command:d.getCommand("findReplace"),icon:ze(s.jsx(av,{}))}),s.jsx(Ge,{...p,command:d.getCommand("goto"),icon:ze(s.jsx(JO,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:l,label:"Find & Select",tooltip:"Find and replace cells or go to a specific location.",quickCommand:"find",icon:ze(s.jsx(q7,{})),...a})})),WS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,showQuickButtons:r=!!e.commands,commands:i,fontSizes:a=Vz.DefaultFontSizes,disabled:l=!1,parentFloat:c,icon:d,label:p,sx:f,...h}=e;rl(n);const g=()=>n?.state()?.toString()||"11",[m,y]=u.useState(g),x=Te(()=>{const L=parseFloat(m);isNaN(L)?y(g()):parseFloat(g())!==L&&n.execute(L,o)},[g,n,m,o]);u.useEffect(()=>{y(g())},[n?.state()]);const v=u.useMemo(()=>{if(!o)return null;const L={...o};return delete L.beforeExecute,L},[o]),b=_o(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),w=u.useMemo(()=>b?s.jsxs(Ae,{className:Eo("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:L=>L.stopPropagation(),children:[s.jsx(Ge,{command:b[0],commandHook:v,icon:ze(s.jsx(LO,{}))}),s.jsx(Ge,{command:b[1],icon:ze(s.jsx(zO,{}))})]}):null,[b]),M=Ki(),k=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("12.3",Math.round(M.typography.fontSize),M.typography.fontFamily).width}px`,[M]),j=u.useCallback(L=>{const{onMouseDown:T,onMouseUp:D,...C}=L;return s.jsx(Tr,{component:"div",...C,disableRipple:!0,children:s.jsx(Kl,{inputMode:"numeric",disabled:l||!n||n.disabled(),inputProps:{name:"font-input",autoComplete:"off",tabIndex:0,type:"number",maxLength:4,max:409,min:2},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:S=>`1px solid ${S.palette.text.icon??S.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:S=>`1px solid ${S.palette.error.main}`},"::after":{borderBottom:S=>`1px solid ${S.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:S=>`${Math.round(S.typography.fontSize)}px`,width:k,color:S=>S.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:S=>S.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:S=>S.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:m,onFocus:S=>{S.target?.select()},onKeyDown:S=>{if(S.which===on.Enter)g()!==m&&(S.stopPropagation(),S.preventDefault(),x());else if(S.which===on.Escape)g()!==m&&(y(g()),setTimeout(()=>{S.target?.select()},0),S.stopPropagation(),S.preventDefault());else{if(S.key.match("[-]")||S.key.match("[0-9.]")&&(m+S.key).length>4)return S.stopPropagation(),void S.preventDefault();if(S.which===on.Space)return void S.preventDefault()}},onBlur:()=>{x()},onChange:S=>{if(S.target.value.length>4)return S.stopPropagation(),void S.preventDefault();y(S.target.value)}})})},[m,l,n]),_=u.useCallback(L=>{const T=R=>{n?.execute(R,o)},D=n?.state(),C=[];for(let R=0;R<a.length;R++){const P=a[R]===D;C.push(s.jsx(Gr,{selected:P,icon:P?s.jsx(E1,{}):void 0,disabled:l||!n||n.disabled(),onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&T(a[R])},onKeyDown:I=>{I.keyCode!==on.Enter&&I.keyCode!==on.Space||T(a[R])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[R]})},"fontSize-"+R))}const S=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...h,children:[w,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})]});return Bn({...L,children:S})},[l,n?.state(),o]);return s.jsx(qi,{ref:t,sx:{...f},tabIndex:-1,outlined:!0,disabled:l,parentFloat:c,createPopupPanel:_,createTooltip:({children:L},T)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:T||n?.disabled(),children:L}),createQuickButton:j,...h})})),Fg=u.memo(e=>{const{selected:t,disabled:n,formattedValue:o,handleSetFormat:r,format:i,sx:a,...l}=e;return s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex","*":{lineHeight:"1.2"},...a},disabled:n,selected:t,icon:t?s.jsx(E1,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==on.Enter&&c.keyCode!==on.Space||r(i.numberFormat)},...l,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(Tn,{component:"div",children:[i.formatType,i.formatType===$.NumberFormat.Type.Custom?"…":""]}),s.jsx(Tn,{variant:"caption",component:"div",sx:{color:c=>pt(c.palette.text.primary,.6),paddingTop:o&&o.length>0?"1px":void 0,overflow:"hidden",textOverflow:"ellipsis"},children:o&&o.length>0?o:" "})]})})}),US=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,sx:i,disabled:a=!1,parentFloat:l,...c}=e,d=_o(n,["formatNumberFormat"])[0],p=d?.state()?$.NumberFormat.Styles.lookupStyle(d?.state()).formatType:$.NumberFormat.Type.General,f=u.useMemo(()=>{if(!o)return null;const y={...o};return delete y.beforeExecute,y},[o]),h=u.useCallback((y,x)=>{const v=D=>{o?.beforeExecute?.(d,d?.state()),d.execute(D,o),o?.onExecute?.(d,d?.state())},b=d?.context()(),w=$.NumberFormat.Styles.lookupPrimary(),M=[];for(let D=0;D<w.length;D++){let C="";if(b&&!b.isEmpty())try{C=b.getNumberFormat(w[D].numberFormat).displayText}catch(R){console.warn(R)}C===""&&w[D].formatType===$.NumberFormat.Type.General&&(C="No specific format");const S=w[D].formatType===p;M.push(s.jsx(Fg,{selected:S,disabled:a||!d||d.disabled(),formattedValue:C,handleSetFormat:v,format:w[D]},w[D].formatType))}const k={numberFormat:"",formatType:$.NumberFormat.Type.Custom},j=p===$.NumberFormat.Type.Custom,_=s.jsx(Fg,{selected:j,disabled:a||!d||d.disabled(),formattedValue:j?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(d,d?.state()),x.getCommand("formatNumberDialog")?.execute(d?.state()),o?.onExecute?.(d,d?.state())},format:k,sx:{flex:"0",width:"100%"}},$.NumberFormat.Type.Custom),L=s.jsxs(Ae,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:D=>D.stopPropagation(),children:[s.jsx(Ge,{command:x.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:s.jsx(zP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:s.jsx(DP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:s.jsx(OP,{})}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(AP,{}))}),s.jsx(Ge,{command:x.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(LP,{}))})]}),T=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[L,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:M}),s.jsx(Ft,{orientation:"horizontal"}),_]});return Bn({...y,children:T})},[d?.context(),d?.state(),o,r]),g=Ki(),m=u.useMemo(()=>{const y=$.NumberFormat.Type.MediumTime;return`${$.IFont.getSharedMeasurer()(y,Math.round(g.typography.fontSize),g.typography.fontFamily).width}px`},[g]);return s.jsx(Xn,{ref:t,commands:n,sx:i,outlined:!0,disabled:a,parentFloat:l,createPopupPanel:h,createTooltip:({children:y},x)=>s.jsx(br,{label:d?.label(),description:d?.description(),disabled:x,children:y}),icon:s.jsx(Ae,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:y=>`${Math.round(y.typography.fontSize)}px`,color:y=>y.palette.text.secondary,fontFamily:y=>y.typography.fontFamily,width:m},children:s.jsx(Ae,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...c})})),kf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"clear",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("clearAll"),icon:s.jsx(Y4,{})}),s.jsx(Ge,{...p,command:d.getCommand("clearFormats"),icon:ze(s.jsx(_b,{}))}),s.jsx(Ge,{...p,command:d.getCommand("clearContents"),icon:ze(s.jsx(DI,{}))}),s.jsx(Ge,{...p,command:d.getCommand("clearComments")}),s.jsx(Ge,{...p,command:d.getCommand("clearHyperlinks")})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Clear",tooltip:"Clear everything in the cell, or remove just the formatting or contents.",createPopupPanel:l,icon:s.jsx(Y4,{}),...a})})),qS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"fill",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("fillDown"),icon:ze(s.jsx(P0,{}))}),s.jsx(Ge,{...p,command:d.getCommand("fillRight"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(270deg)"}}))}),s.jsx(Ge,{...p,command:d.getCommand("fillUp"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(180deg)"}}))}),s.jsx(Ge,{...p,command:d.getCommand("fillLeft"),icon:ze(s.jsx(P0,{sx:{transform:"rotate(90deg)"}}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,label:"Fill",tooltip:"Fill the selected cells with the value from one of the corners.",createPopupPanel:l,icon:ze(s.jsx(P0,{})),...a})})),Ef=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:l=!0,showQuickButton:c=!0,variant:d=Zt.Toolbar,...p}=e,f=["insertCellsShiftDown","insertCellsShiftRight","insertRows","insertColumns"],h=_o(n,f),{singleCommand:g,allDisabled:m}=u.useMemo(()=>{let v=null,b=0;for(let w=0;w<h.length;w++)h[w]&&!h[w]?.disabled()&&(l&&d===Zt.Menuitem&&(v=b===0?h[w]:null),b++);return{singleCommand:v,allDisabled:b===0}},[h]),y=u.useMemo(()=>{const v=new Map;return v.set("insertCellsShiftDown",ze(s.jsx(O7,{}))),v.set("insertCellsShiftRight",ze(s.jsx(O7,{sx:{transform:"rotate(270deg)"}}))),v.set("insertRows",ze(s.jsx(RO,{}))),v.set("insertColumns",ze(s.jsx(D7,{}))),v},[]),x=u.useCallback((v,b)=>{let w=null;const M={variant:Zt.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:b.getCommand("addSheet"),icon:ze(s.jsx(Us,{}))})]}));const k=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...M,command:h[0],icon:y.get(f[0])}),s.jsx(Ge,{...M,command:h[1],icon:y.get(f[1])}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:h[2],icon:y.get(f[2])}),s.jsx(Ge,{...M,command:h[3],icon:y.get(f[3])}),w]});return Bn({...v,children:k})},[i,h,o,r,y]);return g?s.jsx(Ge,{ref:t,variant:d,commandHook:o,disabled:i,command:g,icon:y.get(g.key()),...p}):s.jsx(Xn,{ref:t,variant:d,quickCommand:"insertCells",commands:n,commandHook:o,scope:r,disabled:i||m,tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Insert new cells, rows or columns to your workbook."}),s.jsx("br",{}),s.jsx("span",{children:"To insert multiple rows or columns at a time, select multiple rows or columns in the sheet and click Insert."})]}),createPopupPanel:x,icon:ze(s.jsx(D7,{})),...p})})),Mf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,disableSheet:a=!1,preferSingleMenu:l=!0,showQuickButton:c=!0,variant:d=Zt.Toolbar,...p}=e,f=_o(n,["deleteCellsShiftUp","deleteCellsShiftLeft","deleteRows","deleteColumns"]),{singleCommand:h,allDisabled:g}=u.useMemo(()=>{let x=null,v=0;for(let b=0;b<f.length;b++)f[b]&&!f[b]?.disabled()&&(l&&d===Zt.Menuitem&&(x=v===0?f[b]:null),v++);return{singleCommand:x,allDisabled:v===0}},[f]),m=u.useMemo(()=>{const x=new Map;return x.set("deleteCellsShiftUp",ze(s.jsx(A7,{sx:{transform:"rotate(0deg)"}}))),x.set("deleteCellsShiftLeft",ze(s.jsx(A7,{sx:{transform:"rotate(270deg)"}}))),x.set("deleteRows",ze(s.jsx(IO,{}))),x.set("deleteColumns",ze(s.jsx(L7,{}))),x},[]),y=u.useCallback((x,v)=>{const b={variant:Zt.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let w=null;a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...b,command:v.getCommand("deleteSheet"),icon:ze(s.jsx(Us,{}))})]}));const M=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:m.get("deleteCellsShiftUp")}),s.jsx(Ge,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:m.get("deleteCellsShiftLeft")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...b,command:v.getCommand("deleteRows"),icon:m.get("deleteRows")}),s.jsx(Ge,{...b,command:v.getCommand("deleteColumns"),icon:m.get("deleteColumns")}),w]});return Bn({...x,children:M})},[i,o,r,m]);return h?s.jsx(Ge,{ref:t,variant:d,commandHook:o,disabled:i,command:h,icon:m.get(h.key()),...p}):s.jsx(Xn,{ref:t,variant:d,quickCommand:"deleteCells",commands:n,commandHook:o,scope:r,disabled:i||g,tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Delete cells, rows, columns or sheets from your workbook."}),s.jsx("br",{}),s.jsx("span",{children:"To delete multiple rows or columns at a time, select multiple rows or columns in the sheet and click Delete."})]}),createPopupPanel:y,icon:ze(s.jsx(L7,{})),...p})})),Qs=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Zt.Toolbar,quickColor:l,panelProps:c,isSplit:d=!1,darkMode:p,icon:f,...h}=e,{autoColor:g,schemeLookup:m,recentColors:y,...x}=c;if(h.selectedColor)throw new Error("Command selectedColor will be used. Do not try to provide one as a direct argument");rl(n);const v=n?.context();let b=l??v?.quickColor;d&&!b&&(b=new $.Color("transparent"));const w=g??v?.autoColor,M=m??v?.schemeLookup,k=y??v?.recentColors,j=p??v?.darkMode,_=u.useMemo(()=>({autoColor:w,schemeLookup:M,recentColors:k,darkMode:j,...x}),[w,M,k,j]),L=Te((D,C)=>{D&&C&&v?.addRecentColor&&v.addRecentColor(D),v?.onColorSelect&&v.onColorSelect(D),r?.(D,C),n?.execute(D,o)},[n,r,o,v]),T=u.useCallback((D,C)=>{const{children:S,title:R,...P}=D;let I=D.children;return(n?.disabled()||i)&&(I=s.jsx("div",{children:I})),s.jsx(l0,{command:n,placement:a===Zt.Toolbar?"bottom-start":"right-start",disabled:C,...P,children:I})},[n,i]);return s.jsx(Cf,{ref:t,panelProps:_,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:L,variant:a===Zt.Menuitem?Ri.Menuitem:Ri.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:j,...h})}));Qs.displayName="ColorCommandButton";const KS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["gridlinesToggle","sheetViewToggleGridlinesColumns","sheetViewToggleGridlinesRows"]),d=u.useCallback((p,f)=>{const h={variant:Zt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...h,command:f.getCommand("gridlinesToggle")}),s.jsx(Qs,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:s.jsx($3,{}),panelProps:{disableAlpha:!0}}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleGridlinesRows")})]});return Bn({...p,children:g})},[i,o]);return s.jsx(Xn,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:d,label:"Gridlines",tooltip:"Configure how the lines between rows and columns in the sheet are displayed.",icon:s.jsx(Xs,{command:c[0],scope:"view"}),...l})})),Tf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=d.getCommand("sortCustom"),h=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:d.getCommand("sortAscending"),icon:ze(s.jsx(ph,{}))}),s.jsx(Ge,{...p,command:d.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),f?s.jsx(Ge,{...p,command:f,icon:ze(s.jsx(AO,{}))}):null,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(rh,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:ze(s.jsx(qb,{}))})]});return Bn({...c,children:h})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Sort",tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Organize your data so it's easier to analyze."}),s.jsx("br",{}),s.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:l,icon:ze(s.jsx(ph,{})),...a})})),ZB=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=u.useCallback((c,d)=>{const p={variant:Zt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(rh,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),s.jsx(Ge,{...p,scope:"filter",command:d.getCommand("autoFilterReapply"),icon:ze(s.jsx(qb,{}))})]});return Bn({...c,children:f})},[i,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,scope:r,disabled:i,label:"Filter",tooltip:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"Organize your data so it's easier to analyze."}),s.jsx("br",{}),s.jsx("span",{children:"You can sort the selected data from smallest to largest or largest to smallest."})]}),createPopupPanel:l,icon:ze(s.jsx(rh,{})),...a})})),_f=u.memo(u.forwardRef((e,t)=>{const{quickCommand:n,icon:o,isRedo:r=!1,nestRedo:i=!0,undoManager:a,scope:l,sx:c,disabled:d,commands:p,...f}=e,h=[n];!r&&i&&h.push("redo");const g=_o(p,h),m=g[0],y=g[1],x=a??m?.context?.()?.undoManager;let v=d;d||(v=!m||m.disabled(),y&&!y.disabled()&&(v=!1));const[b,w]=u.useState(0),M=u.useCallback((k,j)=>{let _=b===0?"Cancel":`${m.label()} ${b} Action${b===1?"":"s"}`,L=!1;x||(L=!0),L||(L=i?!x.hasRedo()&&!x.hasUndo():!x.hasRedo());const T=I=>{m.execute(I)},D=s.jsx(Gr,{sx:{display:"flex",flex:"none",alignItems:"center",justifyContent:"center",padding:L?void 0:"0 0",minWidth:"180px"},icon:null,onMouseEnter:()=>{w(0)},onMouseDown:I=>{I.button===0&&I.preventDefault()},onMouseUp:I=>{I.button===0&&T(b)},onKeyDown:I=>{I.isDefaultPrevented()||I.keyCode!==on.Enter&&I.keyCode!==on.Space||T(b)},children:s.jsx(Tn,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:_})});if(L)return D;const C=r?x?.getRedoDescriptions():x?.getUndoDescriptions(),S=[];for(let I=0;I<C.length;I++){const z=C[I];S.push(s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex"},icon:s.jsx(Us,{}),disabled:v,selected:I<b,onMouseEnter:()=>{w(I+1)},onMouseDown:A=>{A.button===0&&A.preventDefault()},onMouseUp:A=>{A.button===0&&T(I+1)},onKeyDown:A=>{A.isDefaultPrevented()||A.keyCode!==on.Enter&&A.keyCode!==on.Space||T(I+1)},children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[s.jsx(Tn,{component:"div",children:z}),s.jsx(Us,{})]})},`action:${I}`))}let R=null;if(!r&&i){const I={scope:"undo",commands:j,variant:Zt.Menuitem,parentFloat:k.floatReference};R=[],R.push(s.jsx(_f,{...I,quickCommand:"redo",isRedo:!0},"nested:redo")),x.hasRedo()&&x.hasUndo()&&R.push(s.jsx(Ft,{orientation:"horizontal"},"action:redo-div"))}const P=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{k.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[R,s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:S}),s.jsx(Ft,{orientation:"horizontal"}),D]});return Bn({...k,children:P})},[m?.context(),m?.state(),l,x,b,v]);return s.jsx(Xn,{ref:t,commands:p,quickCommand:n,scope:l,disabled:v,label:m?.label()??(r?"Redo":"Undo"),tooltip:s.jsx(s.Fragment,{children:s.jsx("span",{children:`${m?.label()??"No"} last actions.`})}),createPopupPanel:M,icon:o??ze(s.jsx(r?wD:vD,{})),selected:!1,...f})})),Ds=$.IFontCollection.getFontList(),GS=new Map;for(let e=0;e<Ds.length;e++)GS.set(Ds[e].fontRef.getFamily(),Ds[e]);const ZS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,icon:l,label:c,...d}=e;rl(n);const p=n?.state(),f=Ki(),h=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("Times New Roman",Math.round(f.typography.fontSize),f.typography.fontFamily).width}px`,[f]),g=u.useCallback(m=>{const y=w=>{n?.execute(w,o)},x=[];for(let w=0;w<Ds.length;w++)x.push({key:Ds[w].fontRef.getFamily(),description:Ds[w].fontRef.getFamily()});GS.get(p)||x.unshift({key:p,description:p});const v=[];for(let w=0;w<x.length;w++){const M=x[w].key===p;v.push(s.jsx(Gr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:M,disabled:i||!n||n.disabled(),icon:M?s.jsx(E1,{}):void 0,onMouseUp:k=>{k.button===0&&y(x[w].key)},onMouseDown:k=>{k.button===0&&k.preventDefault()},onKeyDown:k=>{k.keyCode!==on.Enter&&k.keyCode!==on.Space||y(x[w].key)},children:s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:s.jsx(Tn,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>x[w]?.key},children:x[w].description})})},w+""+x[w].key))}const b=s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...d,children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:v})});return Bn({...m,children:b})},[i,n?.state()]);return s.jsx(qi,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:g,createTooltip:({children:m},y)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:y,children:m}),icon:s.jsx(Ae,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:m=>`${Math.round(m.typography.fontSize)}px`,fontFamily:m=>m.typography.fontFamily,color:m=>m.palette.text.secondary,width:h},children:s.jsx(Ae,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:p})}),...d})})),XS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatStrikeThroughToggle","formatSuperscriptToggle","formatSubscriptToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatStrikeThroughToggle",ze(s.jsx(z7,{}))),f.set("formatSuperscriptToggle",ze(s.jsx(FO,{}))),f.set("formatSubscriptToggle",ze(s.jsx(BO,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:"textEffects",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),s.jsx(Ge,{...g,command:h.getCommand("formatSubscriptToggle"),icon:d.get("formatSubscriptToggle")})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,quickCommand:c,commands:n,commandHook:o,createPopupPanel:p,label:"Text Effects",tooltip:"Style your text to differentiate it.",icon:d.get(c)??ze(s.jsx(z7,{})),...a})})),YS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["formatUnderlinedToggle","formatUnderlinedDoubleToggle","formatUnderlinedAccountingToggle","formatUnderlinedAccountingDoubleToggle"]),c=u.useMemo(()=>{for(let f=0;f<l.length;f++)if(l[f]?.state())return l[f].key();return l[0]?.key()},[l]),d=u.useMemo(()=>{const f=new Map;return f.set("formatUnderlinedToggle",ze(s.jsx(Pp,{}))),f.set("formatUnderlinedDoubleToggle",ze(s.jsx(F7,{}))),f.set("formatUnderlinedAccountingToggle",ze(s.jsx(B7,{}))),f.set("formatUnderlinedAccountingDoubleToggle",ze(s.jsx(N7,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Zt.Menuitem,commandHook:o,scope:"underline",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:ze(s.jsx(Pp,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ze(s.jsx(F7,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ze(s.jsx(B7,{}))}),s.jsx(Ge,{...g,command:h.getCommand("formatUnderlinedAccountingDoubleToggle"),icon:ze(s.jsx(N7,{}))})]});return Bn({...f,children:m})},[i,o,r]);return s.jsx(Xn,{ref:t,quickCommand:c,commands:n,commandHook:o,label:"Underline",tooltip:"All underline stylings.",createPopupPanel:p,icon:d.get(c)??ze(s.jsx(Pp,{})),...a})})),jf=u.memo(u.forwardRef((e,t)=>{const{command:n,commands:o,commandHook:r,scope:i,includePasteAllInPopup:a=!0,disabled:l=!1,...c}=e,d=Te((p,f)=>{const h={variant:Zt.Menuitem,commandHook:r,scope:"paste",disabled:l},g=[];return a&&(g.push(u.createElement(Ge,{...h,command:f.getCommand("paste"),key:"paste",icon:s.jsx(P7,{})})),g.push(s.jsx(Ft,{orientation:"horizontal"},"paste-div"))),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ze(s.jsx(wO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ze(s.jsx(SO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ze(s.jsx(CO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ze(s.jsx(kO,{}))})),g.push(u.createElement(Ge,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ze(s.jsx(EO,{}))})),Bn({...p,children:g})},[l,r,i,a]);return s.jsx(Xn,{ref:t,commands:o,commandHook:r,scope:i,createPopupPanel:d,label:"Paste",tooltip:"Add content to the clipboard to your document.",quickCommand:"paste",icon:s.jsx(P7,{}),...c})})),JS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,parentFloat:a,...l}=e,c=_o(n,["sheetViewToggleShowHeadings","sheetViewToggleShowHeadingColumns","sheetViewToggleShowHeadingRows"]),d=u.useCallback((p,f)=>{const h={variant:Zt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),s.jsx(Ge,{...h,command:f.getCommand("sheetViewToggleShowHeadingRows")})]});return Bn({...p,children:g})},[i,o,r]);return s.jsx(Xn,{ref:t,parentFloat:a,quickCommand:c[0]?.key(),commands:n,commandHook:o,createPopupPanel:d,label:"Headings",tooltip:"Configure how the column and rows headings in the sheet are displayed.",icon:s.jsx(Xs,{command:c[0],scope:"view"}),...l})})),QS=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r="view",disabled:i=!1,...a}=e,l=u.useCallback(c=>{const d={variant:Zt.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),s.jsx(Ge,{...d,command:n.getCommand("workbookViewToggleShowVerticalScrollBar")})]});return Bn({...c,children:p})},[i,n,o,r]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Workbook View",tooltip:"Options to configure how the workbook is displayed.",createPopupPanel:l,icon:s.jsx(Xs,{icon:null,label:"Workbook View"}),...a})})),eC=u.memo(u.forwardRef((e,t)=>{const{value:n,cellStyle:o,styles:r,createTemporaryCell:i,bodyStyle:a,sx:l,borderProps:c,disabled:d,...p}=e,f=u.useMemo(()=>i({value:n,style:o}),[n,o,i]),h=u.useMemo(()=>f.getStyle(),[f,a]),g=u.useMemo(()=>h.getFill().toCSS(a?.darkMode??!1),[h]),m=h.getInsets(),y=h.getFont(),x=u.useCallback(()=>h.getBorder(),[h]);return s.jsx(Ae,{ref:t,sx:{width:"100px",textOverflow:"ellipsis",display:"flex",alignItems:"stretch",background:a?.fill,filter:d?"grayscale(0.4) opacity(0.8);":"none","& .fill":{flex:"1 1 100%",overflow:"hidden",...g},"& .text":{flex:"1 1 100%",...y.toCSS(a?.darkMode??!1,1),boxSizing:"border-box",padding:`${m.top}px ${m.right}px ${m.bottom}px ${m.left}px`,margin:"0px",outline:"none",resize:"none",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"baseline",textDecoration:y.toCSS().textDecoration,textAlign:$.ITextFrame.toCSSHorizontalTextAlign(f.getRenderHorizontalAlignment()),background:"transparent",maxHeight:"100%",whiteSpace:"pre",wordWrap:"break-word"},...l},...p,children:s.jsx(ff,{getBorderAt:x,darkMode:a?.darkMode??!1,rowCount:1,columnCount:1,style:{display:"flex",flex:"1 1 100%",width:"100%",maxWidth:"100%",justifyContent:"start",alignItems:"stretch",...c?.style},...c,children:s.jsx(Ae,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:s.jsx(Ae,{className:"text",children:n})})})})})),XB=u.memo(e=>{const{styles:t,namedStyle:n,selectedNamed:o,hasContextMenu:r=!0,bodyStyle:i,onSelectNamed:a,createTemporaryCell:l,parentFloat:c,commands:d,disabled:p,commandHook:f,...h}=e,g=u.useCallback(x=>{const v={variant:Zt.Menuitem,commandHook:f,context:"cellStyle"},b=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...v,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...v,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),s.jsx(Ge,{...v,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===$.IStyle.BuiltInName.Normal})]});return Bn({...x,children:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:b})})})},[]),m=n?.getName()===o?.getName();let y=s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:x=>`solid ${m?x.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName(),placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{a?.(n)},...h,children:s.jsx(eC,{value:n.getName(),cellStyle:{named:n.getName()},styles:t,createTemporaryCell:l,bodyStyle:i})},n.getName());return r&&(y=s.jsx(Cv,{label:n.getName(),parentFloat:c,createPopupPanel:g,children:y})),y}),tC=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedNamed:i,onSelectNamed:a,disabled:l=!1,bodyStyle:c,usePreviewIcon:d=!0,...p}=e;rl(o);const f=o?.context(),h=f?.styles,g=i??f?.named(),m=c??f?.bodyStyle(),y=Te(M=>{a?.(M),o?.execute(M,r)},[o,a,r]),x=u.useCallback((M,k)=>{const j={onSelectNamed:y,styles:h(),parentFloat:M.floatReference},_=h().getCustomNamed(),L=new Map,T=[];for(let A=0;A<_.length;A++)L.set(_[A].getName(),_[A]),h().getNamed(_[A].getName()).getBuiltInID()===null&&T.push(_[A].getName());const D=A=>{let O=L.get(A);return O||(O=h().getNamed(A)),!O||O.isHidden()?null:s.jsx(XB,{namedStyle:O,selectedNamed:g,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...j},A)},C=(A,O,N=!0)=>{const F=[];for(let E=0;E<O.length;E++){const B=D(O[E]);B&&F.push(B)}return F.length===0?null:s.jsxs(Ae,{children:[N?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(Gs,{children:A},A+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:F},A+"-presets")]},A)},S=(A,O)=>{const N=[];for(let F=0;F<O.length;F++){const E=D(O[F]);E&&N.push(E)}return N.length===0?null:s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:N},A+"-presets")},R=[];R.push(C("Custom",T,!1)),R.push(C("Good, Bad and Neutral",[$.IStyle.BuiltInName.Normal,$.IStyle.BuiltInName.Bad,$.IStyle.BuiltInName.Good,$.IStyle.BuiltInName.Neutral],T.length>0)),R.push(C("Data and Model",[$.IStyle.BuiltInName.Calculation,$.IStyle.BuiltInName.CheckCell,$.IStyle.BuiltInName.ExplanatoryText,$.IStyle.BuiltInName.FollowedHyperlink,$.IStyle.BuiltInName.Hyperlink,$.IStyle.BuiltInName.Input,$.IStyle.BuiltInName.LinkedCell,$.IStyle.BuiltInName.Note,$.IStyle.BuiltInName.Output,$.IStyle.BuiltInName.WarningText])),R.push(C("Titles and Headings",[$.IStyle.BuiltInName.Heading1,$.IStyle.BuiltInName.Heading2,$.IStyle.BuiltInName.Heading3,$.IStyle.BuiltInName.Heading4,$.IStyle.BuiltInName.Title,$.IStyle.BuiltInName.Total]));let P=[];var I,z;return P.push(S("Accent 1",[$.IStyle.BuiltInName.Accent1_20,$.IStyle.BuiltInName.Accent1_40,$.IStyle.BuiltInName.Accent1_60,$.IStyle.BuiltInName.Accent1])),P.push(S("Accent 2",[$.IStyle.BuiltInName.Accent2_20,$.IStyle.BuiltInName.Accent2_40,$.IStyle.BuiltInName.Accent2_60,$.IStyle.BuiltInName.Accent2])),P.push(S("Accent 3",[$.IStyle.BuiltInName.Accent3_20,$.IStyle.BuiltInName.Accent3_40,$.IStyle.BuiltInName.Accent3_60,$.IStyle.BuiltInName.Accent3])),P.push(S("Accent 4",[$.IStyle.BuiltInName.Accent4_20,$.IStyle.BuiltInName.Accent4_40,$.IStyle.BuiltInName.Accent4_60,$.IStyle.BuiltInName.Accent4])),P.push(S("Accent 5",[$.IStyle.BuiltInName.Accent5_20,$.IStyle.BuiltInName.Accent5_40,$.IStyle.BuiltInName.Accent5_60,$.IStyle.BuiltInName.Accent5])),P.push(S("Accent 6",[$.IStyle.BuiltInName.Accent6_20,$.IStyle.BuiltInName.Accent6_40,$.IStyle.BuiltInName.Accent6_60,$.IStyle.BuiltInName.Accent6])),R.push((I="Themed Cell Styles",z=P,s.jsxs(Ae,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Gs,{children:I},I+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:z},I+"-presets")]},I))),R.push(C("Number Format",[$.IStyle.BuiltInName.Comma,$.IStyle.BuiltInName.Comma0,$.IStyle.BuiltInName.Currency,$.IStyle.BuiltInName.Currency0,$.IStyle.BuiltInName.Percent])),s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[s.jsx(Ae,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:R}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{variant:Zt.Menuitem,commandState:g,command:k.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:l,icon:ze(s.jsx(HO,{}))})]})},[g,h?.().getTheme(),m]),v=Te(M=>{const k=18/$.IFont.getDeviceScale(),j=f?.createTemporaryCell(M);return j.getStyle().getFont().getSize()<=k?j:j.createTemporaryCell({style:{font:{size:k}}})},[f?.createTemporaryCell]),b=l||!o||o.disabled(),w=u.useMemo(()=>f&&d?s.jsx(eC,{value:g?.getName()??"Custom",cellStyle:g?{named:g.getName()}:void 0,styles:f.styles(),createTemporaryCell:v,bodyStyle:f.bodyStyle(),className:"outline-hover",disabled:b,sx:{maxHeight:"24px",height:"24px",marginRight:"2px",outline:M=>`1px solid ${M.palette.action.hover}`},borderProps:{}}):ze(s.jsx(Gc,{})),[g,m,b]);return s.jsx(Xn,{ref:t,createPopupPanel:x,outlined:d,commands:n,createTooltip:({children:M},k)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:k,children:M}),selected:!1,disabled:b,label:o?.label(),icon:w,...p})})),nC="_sheetxl-reset_ods65_1",YB=10,Rf=u.memo(u.forwardRef((e,t)=>{const{styles:n,table:o,tableStyle:r=o?.getStyle()??n.getDefaultTableStyle(),bodyStyle:i,sx:a,disabled:l,className:c,forceThinBorder:d,cellHeight:p=YB,isLive:f=!1,...h}=e,g=Math.ceil(1.3*p),[m,y]=u.useReducer(M=>M+1,0);u.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{y()}})},[o,f]);const x=u.useMemo(()=>{let M=o?.toJSON()??{};const k={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return M&&(M.styleOptions={...M.styleOptions,name:r.getName()}),M.ref=k,new $.Table({initialAnchor:k,json:M,styles:n})},[m,o,r,n]),v=u.useMemo(()=>{const M=[];for(let k=0;k<5;k++)for(let j=0;j<5;j++){const _=x.getStyleAt({colIndex:j,rowIndex:k});M.push(_)}return M},[x]),b=u.useMemo(()=>{const M=(j,_,L)=>{let T=L.getFill().toCSS(i?.darkMode??!1);const D=g-(_<4?1:0),C=p-(j<4?1:0),S=L.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:_*(g-1),top:j*(p-1),width:D,height:C},s.jsx("td",{className:`table-style-fill ${j}-${_}`,style:T,children:s.jsx("div",{className:`table-style-text ${j}-${_}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(D-6)/2,top:(C-1)/2,borderTop:`1px solid ${S}`}})},`${j}-${_}`)},k=[];for(let j=0;j<5;j++){const _=[];for(let L=0;L<5;L++){const T=v[5*j+L];_.push(M(j,L,T))}k.push(s.jsx("tr",{children:_},j))}return k},[x,r,i]),w=u.useCallback((M,k)=>v[k].getBorder()??null,[v]);return s.jsx(Ae,{ref:t,className:"table-format-preview",sx:{background:i?.fill,filter:l?"grayscale(0.4) opacity(0.8);":"none","& .styled-element":{position:"absolute"},...a},...h,children:s.jsx(ff,{getBorderAt:w,rowCount:5,columnCount:5,forceThinBorder:d,width:5*(g-1)+1,height:5*(p-1)+1,darkMode:i?.darkMode??!1,style:{pointerEvents:"none"},children:s.jsx("table",{className:Eo(c,"sheetxl-table-preview",nC),style:{borderCollapse:"collapse",width:5*(g-1)+1,height:5*(p-1)+1},children:s.jsx("tbody",{children:b})})})})})),V0=(e,t,n,o,r)=>{e.beginPath(),e.moveTo(t+.5,n+.5),e.lineTo(o+.5,r+.5),e.stroke()},oC=u.memo(u.forwardRef((e,t)=>{const{table:n,tableStyle:o,styles:r,bodyStyle:i,disabled:a,style:l,className:c,canvas:d,...p}=e,f=u.useMemo(()=>{const m=n.toJSON(),y={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return m.styleOptions={...m.styleOptions,name:o.getName()},m.ref=y,new $.Table({initialAnchor:y,json:m,styles:r})},[n,o,r]),h=u.useMemo(()=>{const m=[];for(let y=0;y<5;y++)for(let x=0;x<5;x++){const v=f.getStyleAt({colIndex:x,rowIndex:y});m.push(v)}return m},[f]),g=u.useMemo(()=>{let m=d;if(d||(m=document.createElement("canvas")),!m)return null;m.width!==61&&(m.width=61),m.height!==46&&(m.height=46);const y=m.getContext("2d",{alpha:!1});if(!y)return null;const x=12,v=i?.darkMode??!1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const M=h[5*b+w].getFill();let k=i?.fill;M.getType()===$.IFill.Type.Solid?k=M.getColor().toCSS(v,!1):M.getType()===$.IFill.Type.Gradient?k=M.getStops[0]?.color.toCSS(v,!1):M.getType()===$.IFill.Type.Pattern&&(k=M.getForeground().toCSS(v,!1)),y.fillStyle=k;const j=w*x,_=9*b;y.fillRect(j,_,13,10)}y.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const M=h[5*b+w],k=w*x,j=9*b,_=M.getBorder();if(!_.isEmpty()){const D=_.getLeft();D.isNone()||(y.strokeStyle=D.getColor().toCSS(v,!1),V0(y,k,j,k,j+9));const C=_.getTop();C.isNone()||(y.strokeStyle=C.getColor().toCSS(v,!1),V0(y,k,j,k+x,9*b));const S=_.getRight();S.isNone()||(y.strokeStyle=S.getColor().toCSS(v,!1),V0(y,k+x,j,k+x,j+9));const R=_.getBottom();R.isNone()||(y.strokeStyle=R.getColor().toCSS(v,!1),V0(y,k,j+9,k+x,j+9))}y.strokeStyle=M.getFont().getFill().toCSS(v,!1);const L=4,T=2.5;V0(y,w*x+T,9*b+L,w*x+T+7,9*b+L)}return`url(${m.toDataURL()})`},[d,f,o,i]);return s.jsx("div",{ref:t,className:Eo("table-style-preview",c),style:{backgroundImage:g,width:61,height:46,...l},...p})})),rC=u.memo(u.forwardRef((e,t)=>{const{styleOptions:n,onStyleOptionsChange:o,showHeaderRow:r,onShowHeaderRowChange:i,showTotalRow:a,onShowTotalRowChange:l,showFilterButton:c,onShowFilterButtonChange:d,sx:p,disabled:f,...h}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flexWrap:"wrap",userSelect:"none",pt:1,pb:1,"& .MuiFormControlLabel-root":{marginLeft:g=>`${g.spacing(2)}`,marginRight:g=>`${g.spacing(2)}`},"& .MuiCheckbox-root":{padding:g=>`${g.spacing(.5)}`},...p},...h,ref:t,children:[i&&s.jsx($a,{control:s.jsx(Na,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),l&&s.jsx($a,{control:s.jsx(Na,{checked:a??!1,indeterminate:a==null,onChange:()=>l(!a),disabled:f||a==null}),label:"Total Row",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),s.jsx($a,{control:s.jsx(Na,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&s.jsx($a,{control:s.jsx(Na,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>d(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),JB=u.memo(e=>{const{table:t,tableStyle:n,selectedTableStyleName:o,onSelectTableStyleName:r,styles:i,hasContextMenu:a=!0,bodyStyle:l,parentFloat:c,commands:d,disabled:p,commandHook:f,useCanvasPreview:h=!0,canvas:g,...m}=e,y=u.useCallback(w=>{const M={variant:Zt.Menuitem,commandHook:f,context:"table"},k=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...M,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ge,{...M,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ze(s.jsx(Gc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...M,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]});return Bn({...w,children:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:k})})})},[d]),x=n?.getName()===o,v=u.useMemo(()=>{const w={table:t,tableStyle:n,styles:i,bodyStyle:l};return h?s.jsx(oC,{canvas:g,...w}):s.jsx(Rf,{...w})},[t,n,i,l]);let b=s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:w=>`solid ${x?w.palette.primary.dark:"transparent"} 1px`},tooltipProps:{label:n.getName()??"None",placement:"bottom-start"},disabled:p,icon:null,onClick:()=>{r?.(n?.getName())},...m,children:v},n.getName());return a&&(b=s.jsx(Cv,{label:t.getStyleOptions().name,parentFloat:c,createPopupPanel:y,children:b})),b}),iC=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,selectedTable:i,onSelectTableStyleName:a,disabled:l=!1,bodyStyle:c,usePreviewIcon:d=!1,...p}=e;rl(o);const f=o?.context(),h=f?.styles,g=i??f?.table?.();let m="insertTable";g&&(m="editTable");const y=u.useMemo(()=>((T,D)=>{const C={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new $.Table({initialAnchor:C,styles:D,json:{name:"PreviewTable",ref:C,description:"PreviewTable",headerRowCount:1,totalsRowCount:0,styleOptions:T}})})(g?.getStyleOptions(),h?.()),[h?.().getDefaultTableStyle(),g?.getStyleOptions()]),x=g??y,[v,b]=u.useState(x);u.useEffect(()=>{b(x)},[x]);const w=c??f?.bodyStyle(),M=Te(T=>{a?.(T),o?.execute({name:T},r)},[o,a,r]),k=u.useRef(null),j=u.useCallback((T,D)=>{const C={onSelectTableStyleName:M,styles:h(),parentFloat:T.floatReference};k.current||(k.current=document.createElement("canvas"));const S=E=>{const B=h().getTableStyle(E);return B?s.jsx(JB,{table:v,tableStyle:B,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:D,commandHook:r,canvas:k.current,...C},E):null},R=(E,B,H=!0)=>{const U=[];for(let Z=0;Z<B.length;Z++){const G=S(B[Z]);G&&U.push(G)}return U.length===0?null:s.jsxs(Ae,{children:[H?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(Gs,{children:E},E+"-header"),s.jsx(Ae,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:U},E+"-presets")]},E)},P=[],I=h().getCustomTableStyles(),z=[];if(I.length>0){for(let E=0;E<I.length;E++)I[E].isShownInTableStyles()&&z.push(I[E].getName());P.push(R("Custom",z,!1))}const A=[];g&&!g.getStyleOptions().name&&A.push(null);for(let E=0;E<21;E++)A.push("TableStyleLight"+(E+1));P.push(R("Light",A,z.length>0));const O=[];for(let E=0;E<28;E++)O.push("TableStyleMedium"+(E+1));P.push(R("Medium",O));const N=[];for(let E=0;E<11;E++)N.push("TableStyleDark"+(E+1));P.push(R("Dark",N));let F=null;return g&&(F=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{variant:Zt.Menuitem,command:D.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:l,icon:ze(s.jsx(_b,{}))})]})),s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:E=>`${E.shape.borderRadius}px`,paddingBottom:E=>`${E.shape.borderRadius}px`},children:[s.jsx(Ae,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:P}),F]})},[h,h?.().getTheme(),w,v]),_=l||!o||o.disabled(),L=u.useMemo(()=>{if(!f||!d)return ze(s.jsx(Gc,{}))},[v,w,_]);return s.jsx(Xn,{ref:t,quickCommand:m,createPopupPanel:j,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:T},D)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:D,children:T}),disabled:_,icon:L,...p})})),gi=[];gi.push(Bi("Primary Background","bg1")),gi.push(Bi("Primary Text","tx1")),gi.push(Bi("Secondary Background","bg2")),gi.push(Bi("Secondary Text","tx2")),gi.push(Bi("Accent 1","accent1")),gi.push(Bi("Accent 2","accent2")),gi.push(Bi("Accent 3","accent3")),gi.push(Bi("Accent 4","accent4")),gi.push(Bi("Accent 5","accent5")),gi.push(Bi("Accent 6","accent6"));const aC=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...l}=e,c=Ki(),d=u.useMemo(()=>{let p=[];for(let f=0;f<gi.length;f++){const h=gi[f];p.push(s.jsx(V2,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:s.jsx(Ae,{sx:{display:"flex",boxShadow:f=>f.shadows[2]},children:p})})},[t,c]);return s.jsx(ii,{sx:{borderRadius:"2px",padding:"2px",margin:"0px 0px",display:"flex",border:p=>`solid ${r?p.palette.text.primary:"transparent"} 1px`,"&:hover:not([disabled])":{border:p=>`solid ${p.palette.text.primary} 1px !important`}},icon:null,...l,children:s.jsxs(Ae,{sx:{border:p=>`solid ${p.palette.divider} 1px`,minWidth:"200px",borderRadius:"2px",padding:"4px 4px",textAlign:"left",display:"flex",gap:"4px",flexDirection:"column",alignItems:"stretch",color:p=>r?p.palette.text.primary:void 0,"&:hover:not([disabled])":{color:p=>p.palette.text.primary}},children:[s.jsx(Ae,{sx:{},children:t.getName()}),s.jsxs(Ae,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,s.jsx(Ae,{sx:{flex:"1 1 100%",textOverflow:"ellipsis",overflow:"hidden",marginTop:"2px",whiteSpace:"pre",fontFamily:()=>t.getFontScheme().getMajorFont()},children:s.jsx(di,{disableInteractive:!0,PopperProps:{style:{pointerEvents:"none"},disablePortal:!0,popperOptions:{strategy:"fixed",modifiers:[{name:"preventOverflow",enabled:!0,options:{boundariesElement:"viewport"}}]}},title:s.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"pre"},children:`The font used for the body.
219
219
  The heading font is '${t.getFontScheme().getMajorFont()}'.`}),placement:"bottom-start",children:s.jsx("div",{children:t.getFontScheme().getMinorFont()})})})]})]})})},lC=u.memo(u.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,sx:i,disabled:a=!1,darkMode:l,...c}=e,d=u.useMemo(()=>{const p=n?.search({selected:o})??[],f=[];if(p.length===0)return s.jsx(Gs,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"6px",paddingBottom:"6px"},children:"No themes"});for(let h=0;h<p.length;h++){const g=p[h],m=o&&g?.getName()===o.getName(),y=p[h+1];y&&y.isCustom()!==g.isCustom()&&f.push(s.jsx(Ft,{orientation:"horizontal",sx:{marginBottom:"4px"}},`divider-${h}`)),f.push(s.jsx(aC,{docTheme:g,onSelectTheme:()=>r(g),isSelected:m,disabled:a,darkMode:l,onMouseDown:x=>{x.button===0&&x.preventDefault()},onMouseUp:x=>{x.button===0&&r(g)},onKeyDown:x=>{x.keyCode!==on.Enter&&x.keyCode!==on.Space||r(g)}},g.getName()))}return f},[o,r,l]);return s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:t,...c,children:s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(Gs,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),s.jsx(Ft,{}),s.jsx(Ae,{sx:{flex:"1 1 100%",overflow:"auto",padding:"6px 16px"},children:d})]})})})),sC=u.memo(u.forwardRef((e,t)=>{const{themes:n,selectedTheme:o,onSelectTheme:r,icon:i,tooltip:a,label:l,variant:c=Ri.Toolbar,darkMode:d,panelProps:p,...f}=e,h=i||ze(s.jsx(ov,{})),g={createPopupPanel:u.useCallback(m=>{const{closeFloatAll:y}=m;return s.jsx(lC,{...p,themes:n,selectedTheme:o,onSelectTheme:r,darkMode:d,onKeyDown:x=>{x.which===on.Enter&&y()}})},[n,o,r,p,d]),tooltip:a||l||"Theme",label:l,icon:h,...f};return c===Ri.Toolbar?s.jsx(qi,{ref:t,...g}):s.jsx(k1,{ref:t,...g})})),cC=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,selectedTheme:r,onSelectTheme:i,disabled:a=!1,darkMode:l,label:c,icon:d,variant:p,...f}=e;rl(n);const h=n?.context()?.themes,g=r||n?.context()?.theme,m=l??n?.context()?.darkMode,y=a||n?.disabled(),x=Te(b=>{i?.(b),n?.execute(b,o)},[i,o]),v=u.useCallback((b,w)=>{const{children:M,title:k,...j}=b;let _=b.children;return(y||w)&&(_=s.jsx("div",{children:_})),s.jsx(l0,{command:n,placement:p===Zt.Toolbar?"bottom-start":"right-start",disabled:y||w,...j,children:_})},[n,y]);return s.jsx(sC,{ref:t,themes:h,selectedTheme:g,onSelectTheme:x,variant:p===Zt.Menuitem?Ri.Menuitem:Ri.Toolbar,createTooltip:v,disabled:y,darkMode:m,icon:ze(s.jsx(ov,{})),...f})})),dC=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["themeMode"])[0],c=l?.state(),d=l?.state()!==null,p=S_("(prefers-color-scheme: dark)"),f=c==="dark"||c===null&&p,h=Te((g,m)=>{const y={variant:Zt.Menuitem,commandHook:o,scope:"appearance",disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...y,command:l,icon:ze(s.jsx(f?G6:Y6,{}))}),s.jsx(Ge,{...y,command:m.getCommand("defaultThemeMode"),icon:ze(s.jsx(p?qO:KO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...y,command:m.getCommand("enableDarkGrid")}),s.jsx(Ge,{...y,command:m.getCommand("enableDarkImages")})]});return Bn({...g,children:x})},[i,l,o,r,p,c,d]);return s.jsx(Xn,{ref:t,quickCommand:"themeMode",commands:n,commandHook:o,createPopupPanel:h,label:"Appearance",tooltip:"Change the light/dark mode to match your viewing preference. This does not affect the view for others.",onQuickClick:()=>{l?.execute(f?"light":"dark",o)},selected:d,icon:ze(s.jsx(f?G6:Y6,{})),...a})})),uC=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,sx:a,...l}=e,c=u.useCallback((d,p)=>{const f={variant:Zt.Menuitem,scope:"help",commandHook:{...o,beforeExecute:(g,m)=>o?.beforeExecute?.(g,m)!==!1&&d.floatReference.closeAll()},disabled:i},h=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...f,command:p.getCommand("showKeyboardShortcuts"),icon:ze(s.jsx(dR,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...f,command:p.getCommand("gotoUrlGithub"),icon:ze(s.jsx(YO,{}))}),s.jsx(Ge,{...f,command:p.getCommand("gotoUrlDiscord"),icon:ze(s.jsx(XO,{}))}),s.jsx(Ge,{...f,command:p.getCommand("gotoUrlDocumentation"),icon:ze(s.jsx(iv,{}))}),s.jsx(Ge,{...f,command:p.getCommand("gotoUrlIssue"),icon:ze(s.jsx(ZO,{}))})]});return Bn({...d,children:h})},[i,o]);return s.jsx(Xn,{ref:t,sx:a,commands:n,disabled:i,commandHook:o,scope:r,label:"Help",tooltip:"Help, feedback, and keyboard shortcuts.",createPopupPanel:c,icon:ze(s.jsx(GO,{sx:{transform:"scale(0.75)"}})),...l})})),If=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,preferSingleMenu:a=!0,showQuickButton:l=!0,variant:c=Zt.Toolbar,...d}=e,p=_o(n,["insertImageFromFile","insertImageFromURL"]),{singleMenuCommand:f,allDisabled:h}=u.useMemo(()=>{let m=null,y=0;for(let x=0;x<p.length;x++)p[x]&&!p[x]?.disabled()&&(a&&c===Zt.Menuitem&&(m=y===0?p[x]:null),y++);return{singleMenuCommand:m,allDisabled:y===0}},[p]),g=u.useCallback((m,y)=>{const x={variant:Zt.Menuitem,commandHook:o,scope:"insertImage",disabled:i},v=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...x,command:y.getCommand("insertImageFromFile"),icon:ze(s.jsx(dd,{}))}),s.jsx(Ge,{...x,command:y.getCommand("insertImageFromURL"),icon:ze(s.jsx(dd,{}))})]});return Bn({...m,children:v})},[i,o,r]);return f?s.jsx(Ge,{ref:t,variant:c,commandHook:o,disabled:i,command:f,icon:ze(s.jsx(dd,{})),...d}):s.jsx(Xn,{ref:t,variant:c,quickCommand:"insertImageFromFile",commands:n,commandHook:o,scope:r,disabled:i||h,tooltip:"Insert a picture from the web to complement your data.",createPopupPanel:g,icon:ze(s.jsx(dd,{})),...d})})),H2=u.memo(u.forwardRef((e,t)=>{const{command:n,...o}=e,r=Wi(),[i,a]=u.useState(!1),[l,c]=u.useState("info");return u.useEffect(()=>{const d=r.getMode();a(d?.key==="copy"||d?.key==="cut"),c(d?.key==="cut"?"warning":"info")},[r]),s.jsx(Ge,{ref:t,command:n,icon:ze(s.jsx(vO,{isWalking:i,themedType:l})),...o})})),QB=u.memo(u.forwardRef((e,t)=>{const{...n}=e;return s.jsx(ca,{ref:t,...n,popupCommandKeys:["quickFormulaSum","quickFormulaAverage","quickFormulaCount","quickFormulaMax","quickFormulaMin",null,"insertFunction"],quickCommand:"quickFormulaSum",popupScope:"quickFormula",label:"Quick Formulas",tooltip:"More quick functions.",icon:o=>{switch(o?.key()){case"quickFormulaSum":return ze(s.jsx(kD,{}));case"insertFunction":return ze(s.jsx(CD,{}));default:return null}}})})),pC=u.createContext(null);pC.displayName="HookFormContext";const hC=()=>u.useContext(pC),Pf=u.memo(u.forwardRef((e,t)=>{const{disabled:n,style:o,className:r,sx:i,defaultInput:a,value:l,formName:c,formOptions:d,onChangeInput:p,onValidate:f,onKeyDown:h,...g}=e,m=hC(),y=c&&m?m.register(c,d):null,[x,v]=u.useState(""),[b,w]=u.useState(""),[M,k]=u.useState(l);u.useEffect(()=>{k(l),w("")},[l]);const j=Te(C=>{let S="";try{k(C),f?.(C),p?.(C)}catch(R){S=R.message??"Invalid Name"}c&&m&&(S?m.setError(c,{message:S}):m.clearErrors(c)),w(S)},[l,f,p]),_=Te(async C=>{C.keyCode===on.Escape&&x!==l&&(j(x),m?.setValue(c,x),m?.clearErrors(c),C.stopPropagation()),h?.(C)},[h,x,l,m]),L=Te(C=>{v(C.target.value??"")},[]),T=Te(C=>{v(""),y?.onBlur(C)},[]),D=u.useCallback(C=>{j(C.target.value),y?.onChange(C)},[y]);return s.jsx(b1,{sx:{paddingTop:C=>C.spacing(1.5),minWidth:135,width:"100%",...i},size:"small",ref:t,className:Eo("named-input",r),...g,children:s.jsx(E3,{label:"Name",placeholder:a,onFocus:L,onBlur:T,inputRef:y?.ref,disabled:n,error:!!b,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:C=>C.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:c,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:C=>C.spacing(1.25),paddingBottom:C=>C.spacing(.75),backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}}},value:M??"",onChange:D,onKeyDownCapture:_,onContextMenu:C=>{C.stopPropagation()}})})}));Pf.displayName="NamedInput";const _d=e=>e===null?"":e.toString(),Of=u.memo(u.forwardRef((e,t)=>{const{formName:n,formOptions:o,disabled:r,style:i,className:a,sx:l,onKeyDown:c,value:d,onChangeInput:p,resolvedAddress:f,...h}=e,g=hC(),m=n&&g?g.register(n,o):null,[y,x]=u.useState(""),[v,b]=u.useState(!1),[w,M]=u.useState(()=>_d(d));u.useEffect(()=>{M(_d(d)),x(""),n&&g&&g.clearErrors(n),b(!1)},[d]);const k=Te(S=>{let R="";try{M(S);const P=_d(d),I=f(S);I.toString()!==P&&p?.(I)}catch{R="Invalid Range"}n&&g&&(R?g.setError(n,{message:R}):g.clearErrors(n)),x(R),b(!0)},[w,p,n,g]),j=Te(async S=>{if(v&&S.keyCode===on.Escape){const R=_d(d);M(R),x(""),b(!1),S.stopPropagation()}c?.(S)},[d,p,c,v]),_=Te(S=>{m?.onBlur(S)},[m]),L=u.useCallback(S=>{k(S.target.value),m?.onChange(S)},[m]),[T,D]=u.useState(!1),C=u.useMemo(()=>s.jsx(Tx,{tabIndex:-1,sx:{display:"flex",position:"relative",flex:"0"},position:"end",children:s.jsx(kv,{disabled:!0,selected:T,onSelectToggle:S=>{D(S)},label:"Select Range",icon:ze(s.jsx(bD,{}))})}),[T]);return s.jsx(b1,{sx:{paddingTop:S=>S.spacing(1.5),minWidth:135,width:"100%",...l},size:"small",ref:t,className:Eo("range-input",a),...h,children:s.jsx(E3,{label:"Range",placeholder:"Enter Range",onBlur:_,disabled:r,error:!!y,inputRef:m?.ref,helperText:y||" ",sx:{"& .MuiFormHelperText-root":{marginTop:S=>S.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",readOnly:r,name:n,sx:{paddingTop:S=>S.spacing(1.25),paddingBottom:S=>S.spacing(.75)}},sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},endAdornment:C},value:w??"",onChange:L,onKeyDownCapture:j,onContextMenu:S=>{S.stopPropagation()}})})}));Of.displayName="RangeInput";const Df=u.memo(u.forwardRef((e,t)=>{const{sheet:n,className:o,debounceDelay:r=220,sx:i,...a}=e,[l,c]=u.useState(()=>n.getView().getZoomScale()),[d,p]=u.useState(null),f=u.useRef(0);cn(n,{onViewChange:()=>{p(!0),f.current===0&&c(n.getView().getZoomScale())}}),u.useEffect(()=>{f.current=0,p(!1),c(n.getView().getZoomScale())},[n]),u.useEffect(()=>{f.current!==0&&$.CommonUtils.debounce(()=>{l===f.current&&(f.current=0,n.getView().update({zoomScale:l}))},r)()},[l,r]);const h=Te(_=>{let L=_;_<100?L=Math.round(_/(10/9)+10):_>100&&(L=Math.round(3*_-200)),f.current=L,p(!0),c(L)},[n]),g=_=>{let L=_;return _<100?L=10/9*(_-10):_>100&&(L=(_+200)/3),L},m=g(l),[y,x]=u.useState(null),v=u.useRef(null),b=u.useCallback(()=>{const _=y;_&&requestAnimationFrame(()=>{v.current?.contains(document.activeElement)&&_.focus()})},[]),w=M4(()=>{h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10)))}),M=M4(()=>h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),k=Ki(),j=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("100%",Math.round(k.typography.fontSize),k.typography.fontFamily).width}px`,[k]);return s.jsxs(Ae,{ref:t,className:Eo(o),sx:{padding:"0px 0px",display:"flex",alignItems:"center",color:_=>_.palette.text.secondary,...i},onFocus:_=>{_.relatedTarget&&!y&&x(_.relatedTarget)},onBlur:_=>{y&&!v?.current?.contains(_.relatedTarget)&&x(null)},onMouseDown:_=>{_.button===0&&_.preventDefault()},onMouseUp:_=>{_.button===0&&b()},...a,children:[s.jsx(di,{disableInteractive:!0,title:"Zoom Out",children:s.jsx(Tr,{sx:{padding:"0","&:hover:not([disabled])":{color:_=>_.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:_=>{_.button!==0?_.preventDefault():w(_)},children:s.jsx(hR,{})})}),s.jsx(kj,{ref:v,sx:{flex:"1 1 100%",padding:"6px 0px !important",marginRight:"2px",marginLeft:"2px","& .MuiSlider-thumb":{height:14,width:6,borderRadius:.75,"&.Mui-focusVisible":{boxShadow:_=>`0px 0px 0px 3px ${xh(_.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:_=>`0px 0px 0px 2px ${xh(_.palette.primary.main,.16)}`}},"& .MuiSlider-mark":{width:"1px",height:"8px"},"& .MuiSlider-markActive":{backgroundColor:"currentColor"},"& .MuiSlider-thumb:not(.MuiSlider-active)":{transition:d?"left 260ms ease-in":"none"}},valueLabelDisplay:"auto",size:"small",track:!1,min:0,step:1,value:m,max:200,marks:[{value:100}],onAnimationEnd:()=>p(!1),onWheel:_=>{h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),_.deltaY<0,10)))},onKeyDown:_=>{_.which===on.Down||_.which===on.Right?(h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),_.preventDefault()):_.which===on.Up||_.which===on.Left?(h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),_.preventDefault()):_.which!==on.Enter&&_.which!==on.Escape||b()},onChange:(_,L)=>{Math.abs(L-100)<3?h(100):h(L)},valueLabelFormat:(_,L)=>`Zoom: ${Math.round(l)}%`}),s.jsx(di,{disableInteractive:!0,title:"Zoom In",children:s.jsx(Tr,{sx:{padding:"0","&:hover:not([disabled])":{color:_=>_.palette.primary.main},"& svg":{width:"12px",height:"12px"}},size:"small",onPointerDown:_=>{_.button!==0?_.preventDefault():M(_)},children:s.jsx(eR,{})})}),s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row"},children:[s.jsx(Ae,{sx:{minWidth:"8px"}}),s.jsx(Tn,{noWrap:!0,component:"div",onClick:()=>{h(100)},sx:{cursor:"pointer",display:"flex",flex:"1 1 100%",fontSize:"0.70rem",marginLeft:"2px",marginRight:"2px",userSelect:"none",justifyContent:"center",width:j},children:s.jsx("div",{children:Math.round(l)+"%"})})]})]})}));Df.displayName="SheetZoomScale";const Af=u.memo(u.forwardRef((e,t)=>{const{sx:n,sheet:o,gridStyle:r,children:i,childrenEnd:a,...l}=e;u.useImperativeHandle(t,()=>({}));const c=u.useRef(null);u.useEffect(()=>{const g=m=>m.preventDefault();return c.current?.addEventListener("wheel",g,{passive:!1}),()=>{c.current?.removeEventListener("wheel",g)}},[]);const d=Wi(),p=u.useMemo(()=>{const g=d.getMode();return g?.description?g.description:"Ready"},[d]),[f,h]=u.useState(!1);return s.jsxs(Ae,{ref:c,sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",overflow:f?"visible":"hidden",boxShadow:`0px -1px 0px ${r.header.edgeStrokeFill}`,...n},onMouseOver:()=>h(!0),onMouseLeave:()=>h(!1),...l,children:[i,s.jsx("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"end",overflow:"hidden"},children:s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:g=>g.palette.text.secondary},variant:"caption",children:p})}),a?s.jsx(Ae,{sx:{display:"flex",alignItems:"center"},children:a}):null,s.jsx(Ft,{style:{marginTop:"6px",marginBottom:"6px"}}),s.jsx(Df,{sx:{paddingLeft:"4px",minWidth:"175px"},sheet:o})]})}));Af.displayName="StatusBar";var Bg,Ng,jd={exports:{}},H0={},W0={exports:{}},$g={},Rd={exports:{}},Wo={},hl={};function Qu(){return Ng||(Ng=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},hl.findInArray=function(e,t){for(let n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]},hl.int=function(e){return parseInt(e,10)},hl.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},hl.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),hl}var Vg,Hg,Ba={};function qh(){if(Hg)return Wo;Hg=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.addClassName=a,Wo.addEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.addEventListener?c.addEventListener(d,p,h):c.attachEvent?c.attachEvent("on"+d,p):c["on"+d]=p},Wo.addUserSelectStyles=function(c){if(!c)return;let d=c.getElementById("react-draggable-style-el");d||(d=c.createElement("style"),d.type="text/css",d.id="react-draggable-style-el",d.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
220
220
  `,d.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
221
- `,c.getElementsByTagName("head")[0].appendChild(d)),c.body&&a(c.body,"react-draggable-transparent-selection")},Wo.createCSSTransform=function(c,d){const p=r(c,d,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},Wo.createSVGTransform=function(c,d){return r(c,d,"")},Wo.getTouch=function(c,d){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>d===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>d===p.identifier)},Wo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},Wo.getTranslation=r,Wo.innerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingTop),d-=(0,e.int)(p.paddingBottom),d},Wo.innerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingLeft),d-=(0,e.int)(p.paddingRight),d},Wo.matchesSelector=o,Wo.matchesSelectorAndParentsTo=function(c,d,p){let f=c;do{if(o(f,d))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},Wo.offsetXYFromParent=function(c,d,p){const f=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect();return{x:(c.clientX+d.scrollLeft-f.left)/p,y:(c.clientY+d.scrollTop-f.top)/p}},Wo.outerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderTopWidth),d+=(0,e.int)(p.borderBottomWidth),d},Wo.outerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderLeftWidth),d+=(0,e.int)(p.borderRightWidth),d},Wo.removeClassName=l,Wo.removeEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(d,p,h):c.detachEvent?c.detachEvent("on"+d,p):c["on"+d]=null},Wo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=Qu(),t=function(c){if(typeof WeakMap=="function")var d=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(f=d){if(f.has(p))return f.get(p);f.set(p,g)}for(const m in p)m!=="default"&&{}.hasOwnProperty.call(p,m)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,m))&&(h.get||h.set)?f(g,m,h):g[m]=p[m]);return g}(c)}(function(){if(Vg)return Ba;Vg=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.browserPrefixToKey=p,Ba.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Ba.default=void 0,Ba.getPrefix=d;const c=["Moz","Webkit","O","ms"];function d(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let g=0;g<c.length;g++)if(p(f,c[g])in h)return c[g];return""}function p(f,h){return h?`${h}${function(g){let m="",y=!0;for(let x=0;x<g.length;x++)y?(m+=g[x].toUpperCase(),y=!1):g[x]==="-"?y=!0:m+=g[x];return m}(f)}`:f}return Ba.default=d(),Ba}());let n="";function o(c,d){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](d)}function r(c,d,p){let{x:f,y:h}=c,g=`translate(${f}${p},${h}${p})`;return d&&(g=`translate(${typeof d.x=="string"?d.x:d.x+p}, ${typeof d.y=="string"?d.y:d.y+p})`+g),g}function i(c){if(c)try{if(c.body&&l(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const d=(c.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function a(c,d){c.classList?c.classList.add(d):c.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(c.className+=` ${d}`)}function l(c,d){c.classList?c.classList.remove(d):c.className=c.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return Wo}var Wg,ta={};function Ug(){if(Wg)return ta;Wg=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},ta.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},ta.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),l=n(o);return a?{node:l,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:l,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},ta.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},ta.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;var l;a=typeof a=="string"?a:{left:(l=a).left,top:l.top,right:l.right,bottom:l.bottom};const c=n(o);if(typeof a=="string"){const{ownerDocument:d}=c,p=d.defaultView;let f;if(f=a==="parent"?c.parentNode:c.getRootNode().querySelector(a),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,g=p.getComputedStyle(c),m=p.getComputedStyle(h);a={left:-c.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(g.marginLeft),top:-c.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(g.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(g.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(g.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},ta.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const l=n(i),c=i.props.offsetParent||l.offsetParent||l.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},ta.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Qu(),t=qh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return ta}var qg,Kg,Gg,Zg,U0={},c5={};function Xg(){return qg||(qg=1,Object.defineProperty(c5,"__esModule",{value:!0}),c5.default=function(){}),c5}function eN(){return Gg||(Gg=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(m){if(typeof WeakMap=="function")var y=new WeakMap;return function(x){if(x&&x.__esModule)return x;var v,b,w={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return w;if(v=y){if(v.has(x))return v.get(x);v.set(x,w)}for(const M in x)M!=="default"&&{}.hasOwnProperty.call(x,M)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,M))&&(b.get||b.set)?v(w,M,b):w[M]=x[M]);return w}(m)}(u),n=p(Xc()),o=p(yo),r=function(){if(Bg)return Rd.exports;function m(x){var v,b,w="";if(typeof x=="string"||typeof x=="number")w+=x;else if(typeof x=="object")if(Array.isArray(x)){var M=x.length;for(v=0;v<M;v++)x[v]&&(b=m(x[v]))&&(w&&(w+=" "),w+=b)}else for(b in x)x[b]&&(w&&(w+=" "),w+=b);return w}function y(){for(var x,v,b=0,w="",M=arguments.length;b<M;b++)(x=arguments[b])&&(v=m(x))&&(w&&(w+=" "),w+=v);return w}return Bg=1,Rd.exports=y,Rd.exports.clsx=y,Rd.exports}(),i=qh(),a=Ug(),l=Qu(),c=p(function(){if(Kg)return U0;Kg=1,Object.defineProperty(U0,"__esModule",{value:!0}),U0.default=void 0;var m=function(C){if(typeof WeakMap=="function")var S=new WeakMap;return function(R){if(R&&R.__esModule)return R;var P,I,z={__proto__:null,default:R};if(R===null||typeof R!="object"&&typeof R!="function")return z;if(P=S){if(P.has(R))return P.get(R);P.set(R,z)}for(const A in R)A!=="default"&&{}.hasOwnProperty.call(R,A)&&((I=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(R,A))&&(I.get||I.set)?P(z,A,I):z[A]=R[A]);return z}(C)}(u),y=k(Xc()),x=k(yo),v=qh(),b=Ug(),w=Qu(),M=k(Xg());function k(C){return C&&C.__esModule?C:{default:C}}function j(C,S,R){return(S=typeof(P=function(I,z){if(typeof I!="object"||!I)return I;var A=I[Symbol.toPrimitive];if(A!==void 0){var O=A.call(I,z);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}(S,"string"))=="symbol"?P:P+"")in C?Object.defineProperty(C,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):C[S]=R,C;var P}const _={start:"touchstart",move:"touchmove",stop:"touchend"},L={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=L,D=class extends m.Component{constructor(){super(...arguments),j(this,"dragging",!1),j(this,"lastX",NaN),j(this,"lastY",NaN),j(this,"touchIdentifier",null),j(this,"mounted",!1),j(this,"handleDragStart",C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&typeof C.button=="number"&&C.button!==0)return!1;const S=this.findDOMNode();if(!S||!S.ownerDocument||!S.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:R}=S;if(this.props.disabled||!(C.target instanceof R.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(C.target,this.props.handle,S)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(C.target,this.props.cancel,S))return;C.type!=="touchstart"||this.props.allowMobileScroll||C.preventDefault();const P=(0,v.getTouchIdentifier)(C);this.touchIdentifier=P;const I=(0,b.getControlPosition)(C,P,this);if(I==null)return;const{x:z,y:A}=I,O=(0,b.createCoreData)(this,z,A);(0,M.default)("DraggableCore: handleDragStart: %j",O),(0,M.default)("calling",this.props.onStart),this.props.onStart(C,O)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(R),this.dragging=!0,this.lastX=z,this.lastY=A,(0,v.addEvent)(R,T.move,this.handleDrag),(0,v.addEvent)(R,T.stop,this.handleDragStop))}),j(this,"handleDrag",C=>{const S=(0,b.getControlPosition)(C,this.touchIdentifier,this);if(S==null)return;let{x:R,y:P}=S;if(Array.isArray(this.props.grid)){let z=R-this.lastX,A=P-this.lastY;if([z,A]=(0,b.snapToGrid)(this.props.grid,z,A),!z&&!A)return;R=this.lastX+z,P=this.lastY+A}const I=(0,b.createCoreData)(this,R,P);if((0,M.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag(C,I)!==!1&&this.mounted!==!1)this.lastX=R,this.lastY=P;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}}),j(this,"handleDragStop",C=>{if(!this.dragging)return;const S=(0,b.getControlPosition)(C,this.touchIdentifier,this);if(S==null)return;let{x:R,y:P}=S;if(Array.isArray(this.props.grid)){let A=R-this.lastX||0,O=P-this.lastY||0;[A,O]=(0,b.snapToGrid)(this.props.grid,A,O),R=this.lastX+A,P=this.lastY+O}const I=(0,b.createCoreData)(this,R,P);if(this.props.onStop(C,I)===!1||this.mounted===!1)return!1;const z=this.findDOMNode();z&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(z.ownerDocument),(0,M.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,z&&((0,M.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(z.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(z.ownerDocument,T.stop,this.handleDragStop))}),j(this,"onMouseDown",C=>(T=L,this.handleDragStart(C))),j(this,"onMouseUp",C=>(T=L,this.handleDragStop(C))),j(this,"onTouchStart",C=>(T=_,this.handleDragStart(C))),j(this,"onTouchEnd",C=>(T=_,this.handleDragStop(C)))}componentDidMount(){this.mounted=!0;const C=this.findDOMNode();C&&(0,v.addEvent)(C,_.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const C=this.findDOMNode();if(C){const{ownerDocument:S}=C;(0,v.removeEvent)(S,L.move,this.handleDrag),(0,v.removeEvent)(S,_.move,this.handleDrag),(0,v.removeEvent)(S,L.stop,this.handleDragStop),(0,v.removeEvent)(S,_.stop,this.handleDragStop),(0,v.removeEvent)(C,_.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(S)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:x.default.findDOMNode(this)}render(){return m.cloneElement(m.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return U0.default=D,j(D,"displayName","DraggableCore"),j(D,"propTypes",{allowAnyClick:y.default.bool,allowMobileScroll:y.default.bool,children:y.default.node.isRequired,disabled:y.default.bool,enableUserSelectHack:y.default.bool,offsetParent:function(C,S){if(C[S]&&C[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:y.default.arrayOf(y.default.number),handle:y.default.string,cancel:y.default.string,nodeRef:y.default.object,onStart:y.default.func,onDrag:y.default.func,onStop:y.default.func,onMouseDown:y.default.func,scale:y.default.number,className:w.dontSetMe,style:w.dontSetMe,transform:w.dontSetMe}),j(D,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),U0}()),d=p(Xg());function p(m){return m&&m.__esModule?m:{default:m}}function f(){return f=Object.assign?Object.assign.bind():function(m){for(var y=1;y<arguments.length;y++){var x=arguments[y];for(var v in x)({}).hasOwnProperty.call(x,v)&&(m[v]=x[v])}return m},f.apply(null,arguments)}function h(m,y,x){return(y=typeof(v=function(b,w){if(typeof b!="object"||!b)return b;var M=b[Symbol.toPrimitive];if(M!==void 0){var k=M.call(b,w);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(y,"string"))=="symbol"?v:v+"")in m?Object.defineProperty(m,y,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[y]=x,m;var v}class g extends t.Component{static getDerivedStateFromProps(y,x){let{position:v}=y,{prevPropsPosition:b}=x;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(y){super(y),h(this,"onDragStart",(x,v)=>{if((0,d.default)("Draggable: onDragStart: %j",v),this.props.onStart(x,(0,a.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(x,v)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",v);const b=(0,a.createDraggableData)(this,v),w={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:k}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[j,_]=(0,a.getBoundPosition)(this,w.x,w.y);w.x=j,w.y=_,w.slackX=this.state.slackX+(M-w.x),w.slackY=this.state.slackY+(k-w.y),b.x=w.x,b.y=w.y,b.deltaX=w.x-this.state.x,b.deltaY=w.y-this.state.y}if(this.props.onDrag(x,b)===!1)return!1;this.setState(w)}),h(this,"onDragStop",(x,v)=>{if(!this.state.dragging||this.props.onStop(x,(0,a.createDraggableData)(this,v))===!1)return!1;(0,d.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:w,y:M}=this.props.position;b.x=w,b.y=M}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},!y.position||y.onDrag||y.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:y,bounds:x,children:v,defaultPosition:b,defaultClassName:w,defaultClassNameDragging:M,defaultClassNameDragged:k,position:j,positionOffset:_,scale:L,...T}=this.props;let D={},C=null;const S=!j||this.state.dragging,R=j||b,P={x:(0,a.canDragX)(this)&&S?this.state.x:R.x,y:(0,a.canDragY)(this)&&S?this.state.y:R.y};this.state.isElementSVG?C=(0,i.createSVGTransform)(P,_):D=(0,i.createCSSTransform)(P,_);const I=(0,r.clsx)(v.props.className||"",w,{[M]:this.state.dragging,[k]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:I,style:{...v.props.style,...D},transform:C}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),h(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}($g)),$g}function fC(){if(Zg)return W0.exports;Zg=1;const{default:e,DraggableCore:t}=eN();return W0.exports=e,W0.exports.default=e,W0.exports.DraggableCore=t,W0.exports}var Yg,Id={},Jg,Qg,q0={};function mC(){if(Jg)return q0;Jg=1,q0.__esModule=!0,q0.resizableProps=void 0;var e,t=(e=Xc())&&e.__esModule?e:{default:e};fC();var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,l=r[0];return l.axis==="both"||l.axis==="y"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,l=r[0];return l.axis==="both"||l.axis==="x"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)}};return q0.resizableProps=n,q0}function ey(){if(Qg)return H0;Qg=1,H0.__esModule=!0,H0.default=void 0;var e=function(h){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=i(void 0);if(g&&g.has(h))return g.get(h);var m={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in h)if(x!=="default"&&Object.prototype.hasOwnProperty.call(h,x)){var v=y?Object.getOwnPropertyDescriptor(h,x):null;v&&(v.get||v.set)?Object.defineProperty(m,x,v):m[x]=h[x]}return m.default=h,g&&g.set(h,m),m}(u),t=fC(),n=function(){if(Yg)return Id;Yg=1,Id.__esModule=!0,Id.cloneElement=function(v,b){return b.style&&v.props.style&&(b.style=y(y({},v.props.style),b.style)),b.className&&v.props.className&&(b.className=v.props.className+" "+b.className),g.default.cloneElement(v,b)};var h,g=(h=u)&&h.__esModule?h:{default:h};function m(v,b){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(v);b&&(M=M.filter(function(k){return Object.getOwnPropertyDescriptor(v,k).enumerable})),w.push.apply(w,M)}return w}function y(v){for(var b=1;b<arguments.length;b++){var w=arguments[b]!=null?arguments[b]:{};b%2?m(Object(w),!0).forEach(function(M){x(v,M,w[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(M){Object.defineProperty(v,M,Object.getOwnPropertyDescriptor(w,M))})}return v}function x(v,b,w){return(b=typeof(M=function(k,j){if(typeof k!="object"||k===null)return k;var _=k[Symbol.toPrimitive];if(_!==void 0){var L=_.call(k,j);if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(k)}(b,"string"))=="symbol"?M:String(M))in v?Object.defineProperty(v,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[b]=w,v;var M}return Id}(),o=mC(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(h){if(typeof WeakMap!="function")return null;var g=new WeakMap,m=new WeakMap;return(i=function(y){return y?m:g})(h)}function a(){return a=Object.assign?Object.assign.bind():function(h){for(var g=1;g<arguments.length;g++){var m=arguments[g];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(h[y]=m[y])}return h},a.apply(this,arguments)}function l(h,g){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);g&&(y=y.filter(function(x){return Object.getOwnPropertyDescriptor(h,x).enumerable})),m.push.apply(m,y)}return m}function c(h){for(var g=1;g<arguments.length;g++){var m=arguments[g]!=null?arguments[g]:{};g%2?l(Object(m),!0).forEach(function(y){d(h,y,m[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):l(Object(m)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(m,y))})}return h}function d(h,g,m){return(g=typeof(y=function(x,v){if(typeof x!="object"||x===null)return x;var b=x[Symbol.toPrimitive];if(b!==void 0){var w=b.call(x,v);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}(g,"string"))=="symbol"?y:String(y))in h?Object.defineProperty(h,g,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[g]=m,h;var y}function p(h,g){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,y){return m.__proto__=y,m})(h,g)}var f=function(h){var g,m;function y(){for(var v,b=arguments.length,w=new Array(b),M=0;M<b;M++)w[M]=arguments[M];return(v=h.call.apply(h,[this].concat(w))||this).handleRefs={},v.lastHandleRect=null,v.slack=null,v}m=h,(g=y).prototype=Object.create(m.prototype),g.prototype.constructor=g,p(g,m);var x=y.prototype;return x.componentWillUnmount=function(){this.resetData()},x.resetData=function(){this.lastHandleRect=this.slack=null},x.runConstraints=function(v,b){var w=this.props,M=w.minConstraints,k=w.maxConstraints,j=w.lockAspectRatio;if(!M&&!k&&!j)return[v,b];if(j){var _=this.props.width/this.props.height,L=v-this.props.width,T=b-this.props.height;Math.abs(L)>Math.abs(T*_)?b=v/_:v=b*_}var D=v,C=b,S=this.slack||[0,0],R=S[0],P=S[1];return v+=R,b+=P,M&&(v=Math.max(M[0],v),b=Math.max(M[1],b)),k&&(v=Math.min(k[0],v),b=Math.min(k[1],b)),this.slack=[R+(D-v),P+(C-b)],[v,b]},x.resizeHandler=function(v,b){var w=this;return function(M,k){var j=k.node,_=k.deltaX,L=k.deltaY;v==="onResizeStart"&&w.resetData();var T=(w.props.axis==="both"||w.props.axis==="x")&&b!=="n"&&b!=="s",D=(w.props.axis==="both"||w.props.axis==="y")&&b!=="e"&&b!=="w";if(T||D){var C=b[0],S=b[b.length-1],R=j.getBoundingClientRect();w.lastHandleRect!=null&&(S==="w"&&(_+=R.left-w.lastHandleRect.left),C==="n"&&(L+=R.top-w.lastHandleRect.top)),w.lastHandleRect=R,S==="w"&&(_=-_),C==="n"&&(L=-L);var P=w.props.width+(T?_/w.props.transformScale:0),I=w.props.height+(D?L/w.props.transformScale:0),z=w.runConstraints(P,I);P=z[0],I=z[1];var A=P!==w.props.width||I!==w.props.height,O=typeof w.props[v]=="function"?w.props[v]:null;O&&!(v==="onResize"&&!A)&&(M.persist==null||M.persist(),O(M,{node:j,size:{width:P,height:I},handle:b})),v==="onResizeStop"&&w.resetData()}}},x.renderResizeHandle=function(v,b){var w=this.props.handle;if(!w)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+v,ref:b});if(typeof w=="function")return w(v,b);var M=c({ref:b},typeof w.type=="string"?{}:{handleAxis:v});return e.cloneElement(w,M)},x.render=function(){var v=this,b=this.props,w=b.children,M=b.className,k=b.draggableOpts;b.width,b.height,b.handle,b.handleSize,b.lockAspectRatio,b.axis,b.minConstraints,b.maxConstraints,b.onResize,b.onResizeStop,b.onResizeStart;var j=b.resizeHandles;b.transformScale;var _=function(L,T){if(L==null)return{};var D,C,S={},R=Object.keys(L);for(C=0;C<R.length;C++)D=R[C],T.indexOf(D)>=0||(S[D]=L[D]);return S}(b,r);return(0,n.cloneElement)(w,c(c({},_),{},{className:(M?M+" ":"")+"react-resizable",children:[].concat(w.props.children,j.map(function(L){var T,D=(T=v.handleRefs[L])!=null?T:v.handleRefs[L]=e.createRef();return e.createElement(t.DraggableCore,a({},k,{nodeRef:D,key:"resizableHandle-"+L,onStop:v.resizeHandler("onResizeStop",L),onStart:v.resizeHandler("onResizeStart",L),onDrag:v.resizeHandler("onResize",L)}),v.renderResizeHandle(L,D))}))}))},y}(e.Component);return H0.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},H0}var ty,ny,K0={},tN=(ny||(ny=1,jd.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},jd.exports.Resizable=ey().default,jd.exports.ResizableBox=function(){if(ty)return K0;ty=1,K0.__esModule=!0,K0.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var m=a(void 0);if(m&&m.has(g))return m.get(g);var y={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(v!=="default"&&Object.prototype.hasOwnProperty.call(g,v)){var b=x?Object.getOwnPropertyDescriptor(g,v):null;b&&(b.get||b.set)?Object.defineProperty(y,v,b):y[v]=g[v]}return y.default=g,m&&m.set(g,y),y}(u),t=i(Xc()),n=i(ey()),o=mC(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(g){return g&&g.__esModule?g:{default:g}}function a(g){if(typeof WeakMap!="function")return null;var m=new WeakMap,y=new WeakMap;return(a=function(x){return x?y:m})(g)}function l(){return l=Object.assign?Object.assign.bind():function(g){for(var m=1;m<arguments.length;m++){var y=arguments[m];for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(g[x]=y[x])}return g},l.apply(this,arguments)}function c(g,m){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);m&&(x=x.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),y.push.apply(y,x)}return y}function d(g){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?c(Object(y),!0).forEach(function(x){p(g,x,y[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):c(Object(y)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(y,x))})}return g}function p(g,m,y){return(m=typeof(x=function(v,b){if(typeof v!="object"||v===null)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var M=w.call(v,b);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}(m,"string"))=="symbol"?x:String(x))in g?Object.defineProperty(g,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[m]=y,g;var x}function f(g,m){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,x){return y.__proto__=x,y})(g,m)}var h=function(g){var m,y;function x(){for(var v,b=arguments.length,w=new Array(b),M=0;M<b;M++)w[M]=arguments[M];return(v=g.call.apply(g,[this].concat(w))||this).state={width:v.props.width,height:v.props.height,propsWidth:v.props.width,propsHeight:v.props.height},v.onResize=function(k,j){var _=j.size;v.props.onResize?(k.persist==null||k.persist(),v.setState(_,function(){return v.props.onResize&&v.props.onResize(k,j)})):v.setState(_)},v}return y=g,(m=x).prototype=Object.create(y.prototype),m.prototype.constructor=m,f(m,y),x.getDerivedStateFromProps=function(v,b){return b.propsWidth!==v.width||b.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null},x.prototype.render=function(){var v=this.props,b=v.handle,w=v.handleSize;v.onResize;var M=v.onResizeStart,k=v.onResizeStop,j=v.draggableOpts,_=v.minConstraints,L=v.maxConstraints,T=v.lockAspectRatio,D=v.axis;v.width,v.height;var C=v.resizeHandles,S=v.style,R=v.transformScale,P=function(I,z){if(I==null)return{};var A,O,N={},F=Object.keys(I);for(O=0;O<F.length;O++)A=F[O],z.indexOf(A)>=0||(N[A]=I[A]);return N}(v,r);return e.createElement(n.default,{axis:D,draggableOpts:j,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:T,maxConstraints:L,minConstraints:_,onResizeStart:M,onResize:this.onResize,onResizeStop:k,resizeHandles:C,transformScale:R,width:this.state.width},e.createElement("div",l({},P,{style:d(d({},S),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},x}(e.Component);return K0.default=h,h.propTypes=d(d({},o.resizableProps),{},{children:t.default.element}),K0}().default),jd.exports);function d5(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var W2=parseInt(u.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=d5(o,t),i=typeof r=="function";n.push(i?r:()=>d5(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)d5(n,t)}};const Lf=u.memo(u.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,readonly:a=!1,disabled:l=!1,commandPopupButtonProps:c,sx:d,notifier:p,...f}=e,[h,g]=u.useState(null),[m,y]=u.useState(()=>r.getSelectedRanges().getCoords()),[x,v]=u.useState(!1),{reference:b}=ha({parentFloat:c?.parentFloat}),[w,M]=u.useState(()=>a||!r.getProtection().isStructureAllowed()),k=()=>h?.text??"",[j,_]=u.useState(k),L=Te(()=>{if(b?.closeAll(),!j){const Z=k();return _(k()),Z}if(k()===j)return j;const B=j.trim().toLowerCase();if(B==="r"||B==="c")return j;try{const Z=r.getRanges(j);if(Z)return Z.toString()}catch{}const H=o.getByName(j);if(H&&H.getRanges())return j;let U=null;try{const Z=r.getRanges(j).getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));U=r.getRanges(Z)}catch{}if(!U){const Z=r.getSelectedRanges().getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));U=r.getRanges(Z)}try{let Z=o.getByName(j);w||Z||(Z=o.addReference(j,U)),Z&&g({text:Z.getName()})}catch(Z){_(k()),p.showMessage?.(Z.message,{type:pa.Error})}return null},[j,o,b,w]),T=Te(()=>{if(r.isClosed())return;const B=[];for(let Z=0;Z<m.length;Z++){const G=m[Z];B.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G})}let H=null;try{H=o.lookupByRanges(B)}catch{}let U=null;U=H?.length>0?H[0].getName():r.getSelectedSheet().getSelectedRange().toString(),g({text:U})},[r,m]),[D,C]=u.useState(()=>o?.search()??null);cn(o,{onCollectionChange(B){C(o.search()),T()},onClose(B){C([])}}),u.useEffect(()=>{_(k())},[h,m]);const[S,R]=u.useState(r?.getSelectedSheet());cn(r,{onProtectionChange:B=>{M(a||!B.getProtection().isStructureAllowed())},onSheetsChange:B=>{R(B?.getSelectedSheet())},onViewChange(B){R(B?.getSelectedSheet())}});const[P,I]=u.useState(null),z=Te($.CommonUtils.debounce(T,P?320:0),[]);cn(S.getSelection(),{onChange:()=>{y(B=>{const H=r.getSelectedRanges().getCoords();return $.CoordUtils.isEqualRangesArrays(H,B)?B:H})},onAdjustingChange:B=>{I(B.getAdjusting())}}),u.useEffect(()=>{if(P){const B=r.getSelectedRange(),H=B.getRowCount(),U=B.getColumnCount();let Z=`${H}R x ${U}C`;if(Z.length>17&&(Z=`${H}x${U}`),H>1||U>1)return void g({text:Z,fontStyle:"italic",justifyContent:"center"})}g({text:r.getSelectedSheet().getSelectedRange().toString()}),z()},[m,r,P]);const A=u.useRef(null),O=u.useCallback(B=>{const{onMouseDown:H,onMouseUp:U,...Z}=B;return s.jsx(Tr,{...Z,sx:{...Z?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:s.jsx(Kl,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:A},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.text.icon??G.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},"::after":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*$.IFont.getDeviceScale(),fontStyle:h?.fontStyle,paddingLeft:G=>G.spacing(.75),paddingRight:G=>G.spacing(.75),boxShadow:"none",flex:"1",color:G=>G.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary}}},value:j,onFocus:G=>{G.target?.select()},onKeyDown:G=>{if(G.which===on.Enter||G.which===on.Tab){let V=j;k()!==j&&(G.stopPropagation(),G.preventDefault(),V=L()),V?N(V):i?.()}else if(G.which===on.Escape)k()!==j?(_(k()),setTimeout(()=>{G.target?.select()},0),G.stopPropagation(),G.preventDefault()):i?.();else if(G.which===on.Space)return void G.stopPropagation()},onBlur:()=>{_(k())},onChange:G=>{_(G.target.value)}})})},[j,h]),N=Te(async B=>{try{b?.closeAll();const H=o.lookupByRanges(B)?.[0];H&&await H?.select(),await r.getRanges(B)?.select()}catch(H){p.showMessage?.(H.message,{type:pa.Error})}},[o,p,r]),F=u.useCallback(B=>{setTimeout(()=>{v(!0)},0);const H={variant:Zt.Menuitem,parentFloat:B.floatReference,commandHook:{...c?.commandHook,beforeExecute:(ge,Q)=>(b?.closeAll(),c?.commandHook?.beforeExecute?.(ge,Q))},scope:c?.scope,commands:c?.commands};let U=o.search({scope:r?.getSelectedSheet().getName()});U=U.sort((ge,Q)=>ge.getType()===Q.getType()?ge.getName().localeCompare(Q.getName()):ge.getType()==="range"?-1:1);const Z=w?null:["editNamedReference","deleteNamedReference"],G=w?null:["editTable",null,"convertTableToRange","deleteTable"],V=[],le=U.length;for(let ge=0;ge<le;ge++){const Q=U[ge],xe=Q.getRanges();if(!xe||Q.isHidden())continue;const be=Q.getType();be!==U[ge-1]?.getType()&&(ge>0&&V.push(s.jsx(Ft,{orientation:"horizontal"},`type-divider-${V.length}`)),V.push(s.jsx(Gs,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:Q.getType()==="reference"?"Ranges":"Tables"},`type-header-${V.length}`))),be==="reference"?V.push(u.createElement(ca,{...H,key:"named-"+V.length,popupCommandKeys:Z,popupScope:"namedItem",scope:"namedItem",commandState:Q,commands:c?.commands,label:Q.getName(),quickCommand:"selectNamed",disabled:!Q.getRanges()||l,icon:Fe=>{switch(Fe.key()){case"editNamedReference":return ze(s.jsx(oD,{}));case"deleteNamedReference":return ze(s.jsx(rD,{}));default:return ze(s.jsx(tD,{}))}}})):be==="table"&&V.push(u.createElement(ca,{...H,key:"namedItem-"+V.length,popupCommandKeys:G,popupScope:"namedItem",scope:"namedItem",commands:c?.commands,commandState:Q,label:Q.getName(),quickCommand:"selectNamed",disabled:!xe||l,icon:Fe=>(Fe.key(),ze(s.jsx(Kc,{})))}))}const re=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[w?null:s.jsx(Ge,{...H,scope:"namedItem",command:c?.commands.getCommand("addNamedReference"),icon:ze(s.jsx(nD,{}))}),V&&V.length>0?s.jsxs(s.Fragment,{children:[w?null:s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:V})]}):null]});return Bn({...B,children:re})},[r,D,o,h,w]),E=ir(t,()=>({focus(B){A.current?.focus(B)}}),[]);return s.jsx(Ae,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...d},ref:W2([E,t]),...f,children:s.jsx(qi,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...d},buttonProps:{sx:{backgroundColor:B=>B.palette.background.paper,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}},tabIndex:-1,outlined:{color:B=>n?B.palette.action.disabled:pt(B.palette.divider,.2)},parentFloat:b,createPopupPanel:F,onPopupOpen:()=>v(!0),onPopupClose:()=>v(!1),createTooltip:({children:B},H)=>s.jsx(br,{title:H||x?"":"Name Box",disabled:H,leaveDelay:0,sx:{opacity:H||x?0:1},children:B}),createQuickButton:O})})}));Lf.displayName="NamedCollectionEditor";const nN=(e,t)=>s.jsx(Lf,{ref:t,...e}),zf=u.memo(u.forwardRef((e,t)=>{const{sx:n,workbook:o,sheetElement:r,gridStyle:i,showNamedCollectionEditor:a=!0,NamedCollectionEditorProps:l,renderNamedCollectionEditor:c=nN,disabled:d,commands:p,...f}=e,[h,g]=u.useState(o?.getSelectedSheet());cn(o,{onSheetsChange:G=>{g(G?.getSelectedSheet())},onViewChange(G){g(G?.getSelectedSheet())}});const[m,y]=u.useState(h.getSelection().getCoords().cell),x=h.getRange(m).getCell(),v=d||!x.isEditAllowed(),b=u.useRef(null),w=u.useMemo(()=>({fontSize:11}),[]);cn(h.getSelection(),{onChange:()=>{y(h.getSelection().getCoords().cell)}}),cn(h,{onProtectionChange(){y(h.getSelection().getCoords().cell)}});const M=b.current?.getLineHeight()??20,[k,j]=u.useState(M),[_,L]=u.useState(5),[T,D]=u.useState(1),C=Te((G,{size:V})=>{G.preventDefault(),G.stopPropagation();const le=Math.floor(V.height/M);j(le*M+1),le>1&&L(le)},[M]),S=Te((G,{size:V})=>{const le=Math.floor(V.height/M);D(le)},[M]),R=Wi(),P=R.getMode();let I=null;P?.key==="edit"&&(I=P.args?.stateAndCoords);const z=u.useMemo(()=>{let G=I?.editState;return G||(G=Yw(()=>h.getRange(m).getCell())),s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:s.jsx(Xw,{ref:b,activeCoords:m,sheet:h,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:m})},defaultTextStyle:w,useRichStyling:!1,disabled:v,onChangeEdit:V=>{if(V.dirty!==void 0){const le={sheet:h,coords:m,editState:V};R.setMode(re=>({...re,args:{...re?.args,stateAndCoords:le}}))}},editState:G,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,I,m,T,r]),A=u.useRef(null),O=u.useMemo(()=>a?c({names:o.getNames(),workbook:o,...l},A):null,[c,l,a,h,o,v]),N=u.useMemo(()=>s.jsxs(Ti,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:G=>`solid ${v?G.palette.action.disabled:pt(G.palette.divider,.2)} 1px`},children:[s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:ze(s.jsx(QO,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||I===null,onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{r.cancelEdit()}}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:ze(s.jsx(eD,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||I===null,onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{r.submitEdit()}}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:ze(s.jsx(SD,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:G=>{G.button===0&&G.preventDefault()}})]}),[v,I]),F=Ki(),[E,B]=u.useState(!1),H=u.useMemo(()=>s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:G=>G.spacing(.5),alignItems:"start"},children:[N,s.jsxs(Ti,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:G=>G.typography.fontFamily,fontSize:11*$.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:G=>`${G.shape.borderRadius}px`,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:G=>`solid ${v?G.palette.action.disabled:pt(G.palette.divider,.2)} 1px`,"& textarea":{color:G=>v?`${G.palette.text.disabled} !important`:G.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>B(!0),onBlur:()=>B(!1),onMouseDown:G=>{G.target?.classList.contains("react-resizable-handle")&&G.preventDefault()},children:[s.jsx(Ae,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:G=>G.spacing(1),paddingRight:G=>G.spacing(1)},children:s.jsx(tN.ResizableBox,{height:k,draggableOpts:{grid:[M,M]},minConstraints:[M,M],maxConstraints:[15*M,15*M],onResize:S,onResizeStop:C,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:z})}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:ze(s.jsx(T>1?sR:Lx,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{const G=T>1?1:_;j(G*M+1),D(G)}}),s.jsx(Ae,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:E?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:G=>G.palette.primary.main,borderRadius:G=>`${G.shape.borderRadius}px`}})]})]}),[N,z,E,T,M]),U=u.useMemo(()=>O||H?!O&&H?H:O&&!H?O:s.jsx(s.Fragment,{children:s.jsx(K5,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${F.palette.text.icon??F.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:O,elementAfter:H})}):null,[O,H]),Z=ir(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>A.current}),[]);return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",gap:G=>G.spacing(.5),...n},ref:Z,...f,children:U})}));zf.displayName="FormulaBar";const Ff=u.memo(u.forwardRef((e,t)=>{const{filter:n,commands:o,disabled:r,sx:i,floatReference:a,...l}=e,c=u.useMemo(()=>({}),[]),d=u.useMemo(()=>({commandHook:{beforeExecute:(h,g)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=u.useMemo(()=>({...c,...d,variant:Zt.Menuitem}),[c,d]),f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:o.getCommand("sortAscending"),icon:ze(s.jsx(ph,{}))}),s.jsx(Ge,{...p,command:o.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:o.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),[]]});return s.jsx(Ae,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...i},...l,children:f})}));Ff.displayName="FilterColumnMenu";const gC=u.memo(u.forwardRef((e,t)=>{const{children:n,className:o,disabled:r,style:i,filter:a,...l}=e,c=ir(t,()=>({isFilters:()=>!0}),[]);return s.jsx("div",{ref:c,className:Eo("filters",o),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...i},...l,children:s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[s.jsx("div",{children:a.getName()}),s.jsx("div",{children:"Filter Widget"})]})})}));gC.displayName="Filters";const Bf=u.memo(u.forwardRef((e,t)=>{const{children:n,sheet:o,style:r,className:i,value:a,index:l,editing:c,editable:d,disabled:p,selectedIndex:f,dragging:h,borderColor:g,borderWidth:m,activeColor:y,background:x="white",tabRadius:v=4,gridTheme:b,...w}=e,[M,k]=u.useState(()=>!!o&&o.getProtection().isLocked()),[j,_]=u.useState(()=>o?o.getTabColor():null);cn(o,{onProtectionChange:()=>{k(o.getProtection().isLocked())},onTabColorChange:()=>{_(o.getTabColor())},onStyleChange:()=>{_(o.getTabColor())}});const L=Ki(),T=f===l;let D=null,C=null;if(j||h){let P=x;j?(C=j.toBlackOrWhite().toCSS(),P=j?.toCSS()):T||(P=L.palette.background.paper),D=s.jsx(Ae,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:T?"50%":"100%",borderRadius:"4px",border:I=>T?`${x} solid 1px`:`${I.palette.divider} solid 1px`,background:T&&j?`linear-gradient(0deg, ${P} 0%, transparent)`:P}})}let S=null;typeof g=="string"?S=g:g?.toCSS&&(S=g.toCSS());const R=T?s.jsx(Ae,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:P=>P.palette.primary.main}}):null;return s.jsx(hw,{theme:T?b??L:L,children:s.jsx(Ae,{ref:t,className:Eo(i),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:h?"grabbing":void 0},...w,children:s.jsx(oI,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?S:"transparent",children:s.jsx(zc,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:h?"grabbing":void 0,color:T?"primary":C||"text.secondary",backgroundColor:T?x:"transparent","&:hover:not([disabled])":{backgroundColor:T?x:"transparent"},"& input":{color:P=>`${P.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:s.jsxs(s.Fragment,{children:[D,s.jsxs(Ae,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,R]}),M?s.jsx(S2,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):s.jsx(Ae,{sx:{minHeight:"22px"}})]})]})},a+":"+l)})})})}));Bf.displayName="SheetTab";const Nf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,index:o,commands:r,scope:i="sheet",disabled:a,floatReference:l,sx:c,className:d,tabStripRef:p,...f}=e,[h,g]=u.useState(n?.getProtection());cn(n,{onProtectionChange:b=>{g(b?.getProtection())}});const m=u.useMemo(()=>({}),[]),y=u.useMemo(()=>({commandHook:{beforeExecute:(b,w)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:i,commandState:o,disabled:a||o===void 0,parentFloat:l}),[a,l]),x=u.useMemo(()=>({...m,...y}),[m,y]),v=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{command:r.getCommand("addSheet"),commandState:o,...x,variant:Zt.Menuitem}),s.jsx(Ge,{command:r.getCommand("deleteSheet"),...x,variant:Zt.Menuitem}),s.jsxs(Gr,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(l.closeAll()).then(()=>{p?.startEdit(o)})},disabled:a||!h.isStructureAllowed(),parentFloat:l,children:["Rename",i!=="sheet"?" Sheet":""]}),s.jsx(Ge,{command:r.getCommand("duplicateSheet"),...x,variant:Zt.Menuitem}),s.jsx(Ge,{command:r?.getCommand("protectionSheetToggle"),...x,variant:Zt.Menuitem,icon:s.jsx(S2,{})}),s.jsx(Qs,{variant:Zt.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:s.jsx($3,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Os.End},parentFloat:l}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{command:r.getCommand("hideSheet"),...x,variant:Zt.Menuitem,icon:ze(s.jsx(rv,{}))})]});return s.jsx(Ae,{ref:t,className:Eo("menu",d),sx:{...c},...f,children:v})}));Nf.displayName="SheetTabMenu";const $f=u.memo(u.forwardRef((e,t)=>{const{workbook:n,gridStyle:o,floatReference:r,closeFloatAll:i,className:a,...l}=e,[c,d]=u.useState(n?.getSheets().search()),[p,f]=u.useState(n?.getProtection());cn(n,{onSheetsChange:g=>{d(g.getSheets().search())},onProtectionChange:g=>{f(g?.getProtection())}});const h=u.useMemo(()=>{const g=[],m=n.getSheets().search({visibility:$.ISheet.Visibility.Hidden}),y=n.getSelectedSheet();for(let x=0;x<m.length;x++){const v=m[x],b=v.getVisibility();if(b===$.ISheet.Visibility.VeryHidden)continue;const w=y===v,M=v.getProtection().isLocked(),k=v.getTabColor(),j=o?.body.fill??"transparent";let _=null,L=null,T=j;k&&(T=k.toCSS(),w||(L=k.toBlackOrWhite().toCSS()),_=s.jsx(Ae,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:w?T:"transparent",borderRadius:"4px",border:`solid 1px ${o.header.edgeStrokeFill}`},children:s.jsx(Ae,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===$.ISheet.Visibility.Hidden?"50%":"100%",border:C=>w?`${j} solid 1.5px`:`${C.palette.divider} solid 1px`,background:w&&k?`linear-gradient(0deg, ${T} 0%, ${j})`:T,borderRadius:"4px"}})}));let D=null;M&&(D=s.jsx(S2,{color:"secondary"})),b!==$.ISheet.Visibility.Visible&&(D=ze(s.jsx(rv,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),D&&(D=s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:D})),g.push(s.jsx(Gr,{disabled:!p.isStructureAllowed()&&b===$.ISheet.Visibility.Hidden,sx:{color:C=>{let S=w?C.palette.primary.main:C.palette.text.secondary;return L&&(S=L),b===$.ISheet.Visibility.Hidden&&(S=pt(S,C.palette.action.disabledOpacity)),S},borderLeft:C=>`${w?C.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?s.jsx(E1,{}):void 0,onMouseDown:C=>C.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(C){console.error(C)}})},children:s.jsxs(s.Fragment,{children:[_,s.jsxs(Ae,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[s.jsxs(Ae,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),s.jsx(Ae,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),D]})]})},""+x))}return g},[n,p,c,r,o]);return s.jsx(Ae,{ref:t,className:Eo("menu",a),...l,children:h})}));$f.displayName="SheetsAllMenu";var oN=function(){},yC=typeof window<"u",rN=yC?u.useLayoutEffect:u.useEffect,oy={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const a1=yC&&window.ResizeObserver!==void 0?function(){var e=u.useState(null),t=e[0],n=e[1],o=u.useState(oy),r=o[0],i=o[1],a=u.useMemo(function(){return new window.ResizeObserver(function(l){if(l[0]){var c=l[0].contentRect,d=c.x,p=c.y,f=c.width,h=c.height,g=c.top,m=c.left,y=c.bottom,x=c.right;i({x:d,y:p,width:f,height:h,top:g,left:m,bottom:y,right:x})}})},[]);return rN(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[oN,oy]};function e2(){return e2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},e2.apply(null,arguments)}function Vf(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Hf(e,t){return(Hf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function xC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hf(e,t)}function ry(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const bC=u.createContext(null);var vC=function(e){return e.scrollTop},uc="unmounted",yl="exited",xl="entering",hs="entered",Kh="exiting",va=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,l=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?l?(a=yl,i.appearStatus=xl):a=hs:a=o.unmountOnExit||o.mountOnEnter?uc:yl,i.state={status:a},i.nextCallback=null,i}xC(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===uc?{status:yl}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==xl&&i!==hs&&(r=xl):i!==xl&&i!==hs||(r=Kh)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===xl){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this);i&&vC(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yl&&this.setState({status:uc})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[yo.findDOMNode(this),a],c=l[0],d=l[1],p=this.getTimeouts(),f=a?p.appear:p.enter;o||i?(this.props.onEnter(c,d),this.safeSetState({status:xl},function(){r.props.onEntering(c,d),r.onTransitionEnd(f,function(){r.safeSetState({status:hs},function(){r.props.onEntered(c,d)})})})):this.safeSetState({status:hs},function(){r.props.onEntered(c)})},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:yo.findDOMNode(this);r?(this.props.onExit(a),this.safeSetState({status:Kh},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:yl},function(){o.props.onExited(a)})})})):this.safeSetState({status:yl},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=l[0],d=l[1];this.props.addEndListener(c,d)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===uc)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=Vf(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return u.createElement(bC.Provider,{value:null},typeof i=="function"?i(o,a):u.cloneElement(u.Children.only(i),a))},t}(u.Component);function cs(){}va.contextType=bC,va.propTypes={},va.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:cs,onEntering:cs,onEntered:cs,onExit:cs,onExiting:cs,onExited:cs},va.UNMOUNTED=uc,va.EXITED=yl,va.ENTERING=xl,va.ENTERED=hs,va.EXITING=Kh;var u5=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=ry(o.className,r):o.setAttribute("class",ry(o.className&&o.className.baseVal||"",r)));var o,r})},Gh=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1];o.removeClasses(p,"exit"),o.addClass(p,f?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(l,c)},o.onEntering=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1]?"appear":"enter";o.addClass(p,f,"active"),o.props.onEntering&&o.props.onEntering(l,c)},o.onEntered=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1]?"appear":"enter";o.removeClasses(p,f),o.addClass(p,f,"done"),o.props.onEntered&&o.props.onEntered(l,c)},o.onExit=function(l){var c=o.resolveArguments(l)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(l)},o.onExiting=function(l){var c=o.resolveArguments(l)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(l)},o.onExited=function(l){var c=o.resolveArguments(l)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(l)},o.resolveArguments=function(l,c){return o.props.nodeRef?[o.props.nodeRef.current,l]:[l,c]},o.getClassNames=function(l){var c=o.props.classNames,d=typeof c=="string",p=d?(d&&c?c+"-":"")+l:c[l];return{baseClassName:p,activeClassName:d?p+"-active":c[l+"Active"],doneClassName:d?p+"-done":c[l+"Done"]}},o}xC(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var a,l,c=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(c+=" "+d),i==="active"&&o&&vC(o),c&&(this.appliedClasses[r][i]=c,l=c,(a=o)&&l&&l.split(" ").forEach(function(p){return m=p,void((g=a).classList?g.classList.add(m):(f=g,h=m,(f.classList?!!h&&f.classList.contains(h):(" "+(f.className.baseVal||f.className)+" ").indexOf(" "+h+" ")!==-1)||(typeof g.className=="string"?g.className=g.className+" "+m:g.setAttribute("class",(g.className&&g.className.baseVal||"")+" "+m))));var f,h,g,m}))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],a=i.base,l=i.active,c=i.done;this.appliedClasses[r]={},a&&u5(o,a),l&&u5(o,l),c&&u5(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Vf(o,["classNames"]);return u.createElement(va,e2({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(u.Component);Gh.defaultProps={classNames:""},Gh.propTypes={};const wC={Light:"light",Dark:"dark"},p5=.12,Zh=(e,t)=>{const n={},o=c=>{const d=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:d,strokeFill:mi(d,p5,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:mi(n.body.fill,p5,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:mi(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:mi(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:mi(c?.fill??n.body.fill,.22,e.palette?.mode),fill:mi(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=mi(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:pt(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:pt(i,.7)},n.headerSelectAll={...n.headerSelect,fill:pt(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:mi(r.fill,p5,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:mi(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:mi(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?pt(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?pt(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const a=t??e,l=a.palette.mode==="dark";return n.selection={fill:a.palette?.primary?.main?pt(a.palette?.primary?.main,.1):void 0,strokeFill:a.palette?.primary?.main},n.selectionInactive={...n.selection,fill:a.palette?.divider?pt(a.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:pt(a.palette.warning.light,.05),strokeFill:a.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=pt(a.palette.action.active,.5),n.colorGrey=a.palette.action.active,n.filterDarkInvert=l?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function SC(e){const{mode:t}=e||{},[n,o]=u.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=iy();if(r)return{themeMode:r,source:"class"}}return{themeMode:ay(),source:"media"}});return u.useEffect(()=>{if(t&&t!==n?.themeMode)return void o({themeMode:t,source:"prop"});const r=()=>{const c=iy();if(c)o({themeMode:c,source:"class"});else{const d=ay();o({themeMode:d,source:"media"})}},i=new MutationObserver(r),a=[document.documentElement,document.body].filter(Boolean);for(const c of a)i.observe(c,{attributes:!0,attributeFilter:["class"]});const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",r),r(),()=>{i.disconnect(),l.removeEventListener("change",r)}},[t]),n}function iy(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function ay(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const l1=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=ir(t,()=>({}),[]),[l,c]=a1(),d=u.useRef(null),p=u.useRef(null),[f,h]=u.useReducer(k=>k+1,0),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),{reference:w}=ha({parentFloat:r,label:"overflow"});u.useLayoutEffect(()=>{p.current={refs:[]};const k=[],j=u.Children.toArray(n);let _=0;j.forEach((L,T)=>{k.push(s.jsx(Ae,{sx:{display:"flex"},ref:D=>{_++,_===j.length&&h();const C={current:null};C.current=D,p.current.refs[T]=C},children:L},T))}),m(k)},[n,c]),u.useLayoutEffect(()=>{if(!g)return;const k=p.current.refs;if(!a.current||!k||k.length===0)return x(null),void b(null);const j=a.current?.getBoundingClientRect(),_=[],L=[];let T=0,D=!1;for(let S=0;!D&&S<k.length;S++){const R=k[S];if(!R)continue;if(!R.current){D=!0;continue}const P=R.current.getBoundingClientRect();T+=P?.width,T>j.width&&(D=!0)}if(!D)return x(null),void b([]);const C=d.current?.getBoundingClientRect();T=0;for(let S=0;S<k.length;S++){const R=k[S];let P=!1;if(R.current){const I=R.current.getBoundingClientRect();T+=I?.width,T<j.width-C.width&&(P=!0)}P?_.push(g[S]):L.push(g[S])}x(_.length>0?_:null),b(L.length>0?L:null)},[n,g,c,w,f]);const M=Te(k=>{const j=[];for(let L=0;L<v.length;L++){let T=u.Children.toArray(v[L]);const D=T[0];T=u.Children.toArray(D.props.children?.props.children??D.props.children);const C=T[0],S={...C.props};S.parentFloat&&(S.parentFloat=k.floatReference);const R=u.cloneElement(C,S);j.push(R)}const _=s.jsx(Ae,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:L=>L.spacing(.5),paddingBottom:L=>L.spacing(.5),paddingLeft:L=>L.spacing(1),paddingRight:L=>L.spacing(1),overflow:"hidden"},children:j});return Bn({...k,children:_})},[v]);return s.jsxs(Ae,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:W2([a,l,t]),...i,children:[s.jsx(Ae,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:y??g}),s.jsx(Ae,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:s.jsx(qi,{createPopupPanel:M,ref:d,parentFloat:w,createTooltip:({children:k},j)=>s.jsx(br,{label:"More",description:"More toolbar options…",disabled:j,children:k}),icon:s.jsx(Wb,{children:s.jsx(pR,{})})})})]})})),CC="https://unpkg.com/@sheetxl/scripting-templates/dist",iN=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DMUSzq5n2k0WNFw6.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./z1aNSOtWsEE21p2H.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CTXKzcsm-W1ujL_U.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],aN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DMUSzq5n2k0WNFw6.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./z1aNSOtWsEE21p2H.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CTXKzcsm-W1ujL_U.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class kC{constructor(t=iN,n=aN){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const a={...o,...o?.typedCreateWorkbookOptions?.[n]};let l;delete a.typedCreateWorkbookOptions;try{l=await i(t,a)}catch(c){throw new Error("Unable to import",{cause:c})}return l}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const a=n;return await this._fromFile(a,t)}case"base64":{let a;if(n&&typeof n=="object"&&"base64"in n)a=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,d]=n.split(",");a=d}else a=n;const l=jR.base64ToArrayBuffer(a),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(l,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let a,l,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const y=n;c=y.input,a=y.init,l=y.timeout}}const d=l||3e4,p=new AbortController,f=setTimeout(()=>p.abort(),d),h=typeof c=="string"?c:c.toString(),g=r||$.TextUtils.getFileNameExtension(h),m=this.getReadFormatTypeForExt(g)||this._readFormatTypes[0];try{const y=await fetch(c,{...a,signal:p.signal});if(clearTimeout(f),!y.ok)throw new Error(`Failed to fetch: ${y.status} ${y.statusText}`);const x=await y.arrayBuffer();if(!m)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(x,m.key,t),title:o||$.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:m}}catch(y){throw clearTimeout(f),y.name==="AbortError"?new Error(`Fetch timeout after ${d}ms: ${h}`):y}}case"buffer":{const a=n,l=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!l)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(a,l.key,t),title:o||"buffer-file",formatType:l}}case"stream":{const a=n.getReader(),l=[];let c=0;try{for(;;){const{done:g,value:m}=await a.read();if(g)break;l.push(m),c+=m.length}}finally{a.releaseLock()}const d=new ArrayBuffer(c),p=new Uint8Array(d);let f=0;for(const g of l)p.set(g,f),f+=g.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(d,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${$.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt($.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${$.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const a=await t.arrayBuffer(),l={...n,...n?.typedCreateWorkbookOptions?.[i.key]};delete l.typedCreateWorkbookOptions;const c=i.handler;if(!c)throw new Error(`Unable to resolve handler for type: ${i?.description??$.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await l.onStart?.(r);const d=await c(a,l);o=new lN(t,d,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=$.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const a=this.getWriteFormats(),l=a.length;for(let p=0;!i&&p<l;p++)(a[p].ext===r||!r&&a[p].isDefault)&&(i=a[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let d=null;try{d=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,f)=>{let h;typeof SharedArrayBuffer<"u"&&f instanceof SharedArrayBuffer?(h=new ArrayBuffer(f.byteLength),new Uint8Array(h).set(new Uint8Array(f))):h=f,function(g,m){const y=URL.createObjectURL(g),x=document.createElement("a");x.style.display="none",x.href=y,x.download=m,document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(y)}(new Blob([h],{type:"application/octet-stream"}),p)})(c,d)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class lN{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const sN=new kC;var ly,sy,cN=function(){if(sy)return ly;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,a="",l=0,c=-1,d=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&d!==1)if(c!==p-1&&d===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var f=a.lastIndexOf("/");if(f!==a.length-1){f===-1?(a="",l=0):l=(a=a.slice(0,f)).length-1-a.lastIndexOf("/"),c=p,d=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=p,d=0;continue}}r&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),l=p-c-1;c=p,d=0}else i===46&&d!==-1?++d:d=-1}return a}sy=1;var n={resolve:function(){for(var o,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var l;a>=0?l=arguments[a]:(o===void 0&&(o=process.cwd()),l=o),e(l),l.length!==0&&(r=l+"/"+r,i=l.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var a=o.length,l=a-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var d=r.length-c,p=l<d?l:d,f=-1,h=0;h<=p;++h){if(h===p){if(d>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else l>p&&(o.charCodeAt(i+h)===47?f=h:h===0&&(f=0));break}var g=o.charCodeAt(i+h);if(g!==r.charCodeAt(c+h))break;g===47&&(f=h)}var m="";for(h=i+f+1;h<=a;++h)h!==a&&o.charCodeAt(h)!==47||(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(c+f):(c+=f,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,a=-1,l=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!l){a=c;break}}else l=!1;return a===-1?i?"/":".":i&&a===1?"//":o.slice(0,a)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,a=0,l=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var d=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var f=o.charCodeAt(i);if(f===47){if(!c){a=i+1;break}}else p===-1&&(c=!1,p=i+1),d>=0&&(f===r.charCodeAt(d)?--d===-1&&(l=i):(d=-1,l=p))}return a===l?l=p:l===-1&&(l=o.length),o.slice(a,l)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){a=i+1;break}}else l===-1&&(c=!1,l=i+1);return l===-1?"":o.slice(a,l)},extname:function(o){e(o);for(var r=-1,i=0,a=-1,l=!0,c=0,d=o.length-1;d>=0;--d){var p=o.charCodeAt(d);if(p!==47)a===-1&&(l=!1,a=d+1),p===46?r===-1?r=d:c!==1&&(c=1):r!==-1&&(c=-1);else if(!l){i=d+1;break}}return r===-1||a===-1||c===0||c===1&&r===a-1&&r===i+1?"":o.slice(r,a)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i=(r=o).dir||r.root,a=r.base||(r.name||"")+(r.ext||""),i?i===r.root?i+a:i+"/"+a:a;var r,i,a},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,a=o.charCodeAt(0),l=a===47;l?(r.root="/",i=1):i=0;for(var c=-1,d=0,p=-1,f=!0,h=o.length-1,g=0;h>=i;--h)if((a=o.charCodeAt(h))!==47)p===-1&&(f=!1,p=h+1),a===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1);else if(!f){d=h+1;break}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===d+1?p!==-1&&(r.base=r.name=d===0&&l?o.slice(1,p):o.slice(d,p)):(d===0&&l?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(d,c),r.base=o.slice(d,p)),r.ext=o.slice(c,p)),d>0?r.dir=o.slice(0,d-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ly=n}();const cy=/^(con|prn|aux|nul|com\d|lpt\d)$/i,dy=/[<>:"/\\|?*\u0000-\u001F]/g,Ml=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:dy,WINDOW_FILENAME_RESERVED_REGEX:cy,isValidWindowsFilename:e=>!(!e||e.length>255||dy.test(e)||cy.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return cN.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),uy=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:kC,IOUtils:Ml,WorkbookIO:sN},Symbol.toStringTag,{value:"Module"})),dN=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},EC=async e=>{const t=Ml.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new $5(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new $5(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(a){throw new Error(`Failed to parse directory: ${a.message}. Ensure the file is valid JSON.`)}const i=r.map(async a=>{try{const l=Ml.relativePath(e,a.path),c=await fetch(l);if(!c.ok)throw new Error(`Failed to fetch file at '${a.path}': ${c.statusText}`);const d=await c.text();let p=a.metadata;return p?.title||(p={title:dN(a),...p}),{path:a.path,content:d,metadata:p}}catch(l){console.error(l.message)}return null});return(await Promise.all(i)).filter(a=>a!==null)},h5={fontSize:"0.8rem",marginRight:"4px"},uN=u.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...a}=e;let l;return l=n.metadata?.icon==="formula"?s.jsx(lv,{sx:h5}):n.metadata?.icon==="macro"?s.jsx(G3,{sx:h5}):s.jsx(zx,{sx:h5}),s.jsx(Gr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:l,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==on.Enter&&c.keyCode!==on.Space||r(n)},...a,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsx(Tn,{component:"div",children:n.metadata?.title??n.path}),s.jsx(Tn,{variant:"caption",component:"div",sx:{color:c=>pt(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),MC=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:a=CC,...l}=e,[c,d]=u.useState([]),[p,f]=u.useState(!0),h=_o(n,["executeSelectedScript"]),g=h[0]?.context?.();u.useEffect(()=>{(async()=>{try{const y=await EC(a);d(y)}catch{}finally{f(!1)}})()},[a]);const m=u.useCallback((y,x)=>{if(p)return s.jsx("div",{children:"Loading..."});const v={variant:Zt.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=k=>{g.getEditor()?.insertSnippet(k.content),y.closeFloat()},w=[];for(let k=0;k<c.length;k++){const j=c[k];j&&w.push(s.jsx(uN,{handleInsert:b,snippet:j},j.path))}const M=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[w.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:w}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(Ge,{...v,key:"help",command:n.getCommand("help"),icon:ze(s.jsx(iv,{}))})]});return Bn({...y,children:M})},[i,o,r,p,g]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:m,icon:ze(s.jsx(MD,{})),...l})})),Wf=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsx(s.Fragment,{children:s.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[s.jsx("div",{children:s.jsx(l1,{parentFloat:o,style:{},children:s.jsx(Ge,{...c,command:n.getCommand("saveScripts"),icon:ze(s.jsx(TD,{}))})})}),s.jsx("div",{style:{flex:"1 1 100%"}}),s.jsx("div",{children:s.jsx(l1,{parentFloat:o,style:{},children:s.jsx(MC,{...c,commands:n})})})]})})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));Wf.displayName="ScriptEditorToolbar";const f5={fontSize:"1rem"},TC=u.memo(u.forwardRef((e,t)=>{const{scriptPath:n=CC,onScriptSelect:o,sx:r=jn.EmptyCssProperties,className:i,buttonMinWidth:a=210,buttonMinHeight:l=80,gap:c=12,...d}=e,[p,f]=u.useState([]),[h,g]=u.useState(!0),[m,y]=u.useState(null);if(u.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{g(!0),y(null);const w=await EC(n);for(let M=0;M<w.length;M++){const k=w[M];k&&b.push(k)}}catch(w){y(w instanceof Error?w.message:"Failed to load scripts"),w instanceof $5||console.error("Error loading scripts:",w)}finally{f(b),g(!1)}})()},[n]),h)return s.jsx(Ae,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Eo(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...r},...d,children:s.jsx(h3,{})});let x=null;m&&(x=s.jsxs(Ae,{display:"flex",justifyContent:"center",alignItems:"center",className:Eo(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...d,children:[s.jsx(Tn,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),s.jsx(Tn,{color:"error",component:"div",children:m})]}));const v=b=>{const w=b.metadata?.icon;return w==="macro"?s.jsx(G3,{sx:f5}):w==="formula"?s.jsx(lv,{sx:f5}):w==="autostart"?s.jsx(zx,{sx:f5}):null};return s.jsxs(Ae,{ref:t,className:Eo(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...r},...d,children:[s.jsxs(Ae,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[s.jsx(Tn,{variant:"h6",gutterBottom:!0,children:"Script Template"}),s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),s.jsx(Ae,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,w)=>s.jsxs(zc,{variant:"outlined",sx:{minWidth:a,minHeight:l,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...w===0&&{borderStyle:"dashed",marginBottom:"8px"},...w===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[s.jsx(Tn,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${w}`))})]}),x]})}));TC.displayName="TemplateSelectPanel";const Uf=u.memo(u.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:a=!1,onClose:l,autoFocusSel:c,autoFocus:d=!0,scripts:p,...f}=e,h=Ki(),[g,m]=u.useState(!1),y=u.useRef(!1),[x,v]=u.useState({message:"Loading",cursor:"",dirty:!1}),[b,w]=u.useState(null);u.useEffect(()=>{let O=!1;return w(null),async function(){if(p&&(await p.start(),!O)){const N=p.getModules().search()[0]?.getSource();w({source:N||null})}}(),()=>{O=!0}},[p]);const M=u.useCallback(O=>{v(N=>({...N,...O}))},[]),k=u.useRef(null),j=u.useRef(null),[_,L]=u.useState(null),T=u.useRef(null),D=Te(O=>{if(_)return _.focus(O),!0;if(c){const N=j.current?.querySelectorAll?.(c);if(N&&N.length>0)return N[0]?.focus?.(O),!0}return j.current?.focus?.(O),!1},[_,c,d]),C=u.useMemo(()=>s.jsx(Gl,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),S=u.useMemo(()=>s.jsx(Ti,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,marginLeft:O=>O.spacing(.5),marginRight:O=>O.spacing(.5),marginTop:O=>O.spacing(1),marginBottom:O=>O.spacing(1)},children:s.jsx(Wf,{commands:i})}),[h,i]),R=u.useMemo(()=>s.jsx(Ae,{className:Eo("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:O=>O.palette.text.secondary},variant:"caption",children:x.message}),s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:O=>O.palette.text.secondary},variant:"caption",children:x.dirty?"Unsaved":""}),s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:O=>O.palette.text.secondary},variant:"caption",children:x.cursor})]})}),[x]),P=u.useMemo(()=>s.jsxs(Ae,{className:Eo("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[S,s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:s.jsx(HB,{ref:j,loadingPanel:C,readOnly:a,onClose:l,autoFocus:d,commands:i,onStatusChange:M,darkMode:h.palette.mode==="dark",...r})}),R]}),[h,i,S,R,g,C,a,r,d,c,l,M]),I=u.useMemo(()=>s.jsx(Mx,{className:Eo({"Mui-selected":y.current}),sx:{display:"flex",color:O=>O.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:O=>`${O.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:O=>O.transitions.duration.shortest/2+"ms"},backgroundColor:O=>pt(O.palette.action.hover,.03),borderBottom:O=>`solid ${pt(O.palette.divider,.2)} 1px`},onPointerDown:O=>{O.isDefaultPrevented()||(O.preventDefault(),D())},children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:O=>O.spacing(.25),marginBottom:O=>O.spacing(.25),marginLeft:O=>O.spacing(1),marginRight:O=>O.spacing(1)},children:[s.jsx(Ae,{sx:{flex:"1 1 100%",paddingLeft:O=>O.spacing(1)},children:"Script (Typescript)"}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:O=>O.palette.text.icon??O.palette.action.active},touchRippleRef:k,onPointerDown:O=>{k.current?.start(O,{center:!1}),O.stopPropagation(),O.preventDefault()},onPointerUp:()=>{j.current?.close()},children:s.jsx(M3,{})})})]})}),[h,g]),z=u.useMemo(()=>{let O;return b===null?null:(b.source===null&&(O=s.jsx(TC,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:N=>{j.current?.getEditor().insertSnippet(N.content),w({source:N.content??""})}})),s.jsxs(Ae,{tabIndex:0,className:Eo("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},onPointerDown:N=>{N.isDefaultPrevented()||j.current?.focus()},children:[I,s.jsxs(Ae,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[P,O]})]}))},[S,P,n,b]),A=ir(t,()=>({isScriptWorkspaceElement:()=>!0,focus:O=>{D(O)}}),[]);return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,onFocus:O=>{m(!0),y.current=!0,A.current?.contains(O.target)&&O.target!==A.current&&L(O.target),O.relatedTarget&&!T.current&&(T.current=O.relatedTarget),f?.onFocus?.(O)},onBlur:O=>{A?.current?.contains(O.relatedTarget)||A?.current===O.relatedTarget||(T.current=null,y.current=!1,m(!1)),f?.onBlur?.(O)},children:z})}));Uf.displayName="ScriptWorkspace";const qf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["executeScript"])[0].context();_o(n,["showScriptEditor"]);const c=u.useCallback((d,p)=>{const f={variant:Zt.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=l?.getScripts(),g=h?.searchFunction({type:"macro"}),m=[];if(g)for(let x=0;x<g.length;x++){const v=g[x];m.push(s.jsx(Ge,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ze(s.jsx(G3,{})),label:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${x}`))}const y=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[m.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:m}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(Ge,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ze(s.jsx(xD,{}))})]});return Bn({...d,children:y})},[i,l,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:ze(s.jsx(ED,{})),...a})})),pN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_o(n,["executeScript","showScriptEditor"]),l=a[0]?.context?.(),c=u.useCallback(d=>{const{commandButtonProps:p,commandPopupProps:f}=d,h=s.jsx(Qs,{...f,command:n.getCommand("formatFontColor"),icon:s.jsx(MP,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=s.jsx(Qs,{...f,command:n.getCommand("formatFillColor"),icon:s.jsx(EP,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Os.End}}),m=n.getCommand("undo")?s.jsx(s.Fragment,{children:s.jsx(_f,{...f,quickCommand:"undo"})}):null,y=n.getCommand("find")?s.jsx(s.Fragment,{children:s.jsx(HS,{...f})}):null;let x=null;const v=l?.getScripts();if(a[1]?.state?.()||v){let b=a[1]?.state?.();const w=v?.searchFunction({type:"macro"});for(let M=0;w&&!b&&M<w?.length;M++)b=!0;b&&(x=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{}),s.jsx(qf,{...f})]}))}return s.jsxs(l1,{parentFloat:o,children:[m,null,m?s.jsx(Ft,{}):null,s.jsx(jf,{...f,command:n.getCommand("paste")}),s.jsx(Ge,{...p,command:n.getCommand("formatPainterToggle"),icon:ze(s.jsx(DO,{}))}),s.jsx(H2,{...p,command:n.getCommand("copy")}),s.jsx(Ft,{}),s.jsx(ZS,{...f,command:n.getCommand("formatFontFamily")}),s.jsx(WS,{...f,command:n.getCommand("formatFontSize")}),s.jsx(Ge,{...p,command:n.getCommand("formatBoldToggle"),icon:s.jsx(OI,{})}),s.jsx(Ge,{...p,command:n.getCommand("formatItalicToggle"),icon:s.jsx(PI,{})}),s.jsx(YS,{...f}),s.jsx(XS,{...f}),h,s.jsx(Ft,{}),g,s.jsx(NS,{...f}),s.jsx($S,{...f}),s.jsx(Ft,{}),s.jsx(Zv,{...f}),s.jsx(Xv,{...f}),s.jsx(Yv,{...f}),s.jsx(Jv,{...f}),s.jsx(Ft,{}),s.jsx(US,{...f}),s.jsx(tC,{command:n.getCommand("formatCellStyle"),...f}),s.jsx(iC,{command:n.getCommand("formatTableStyle"),...f}),s.jsx(Ft,{}),s.jsx(Ef,{...f}),s.jsx(Mf,{...f}),s.jsx(Ft,{}),s.jsx(qS,{...f}),null,s.jsx(kf,{...f}),s.jsx(Tf,{...f}),y,x]})},[n,a]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),hN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(l1,{parentFloat:o,children:[null,s.jsx(Ge,{...c,command:n.getCommand("updateHyperlink"),icon:ze(s.jsx(dh,{}))}),s.jsx(Ge,{...c,command:n.getCommand("updateComments"),icon:ze(s.jsx(uh,{}))}),s.jsx(If,{...d}),s.jsx(Ge,{...c,command:n.getCommand("insertTable"),icon:ze(s.jsx(Kc,{}))})]})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),fN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(l1,{parentFloat:o,children:[s.jsx(VS,{...d}),s.jsx(Ge,{...c,command:n.getCommand("protectionSheetToggle"),icon:s.jsx(S2,{color:"secondary"})}),s.jsx(Ft,{}),s.jsx(KS,{...d}),s.jsx(JS,{...d}),s.jsx(Ft,{}),s.jsx(Ge,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:s.jsx(Xs,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),s.jsx(Ge,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:s.jsx(Xs,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),s.jsx(Ft,{}),s.jsx(QS,{...d}),s.jsx(cC,{command:n.getCommand("selectTheme"),...d}),s.jsx(Ft,{}),s.jsx(qf,{...d,scope:"view"}),s.jsx(Ft,{}),s.jsx(Ge,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ze(n.getCommand("fullScreenToggle").state()?s.jsx(UO,{}):s.jsx(WO,{}))})]})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_C=e=>s.jsx(xN,{...e}),mN=u.memo(e=>{const{sx:t,...n}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${pt(o.palette.primary.main,.35)} solid 2px`}},children:[s.jsx(Pj,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),s.jsx(Ae,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),gN=u.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,a=u.useMemo(()=>{const l=[];for(let c=0;c<t.length;c++)l.push(s.jsx(mN,{label:t[c].label},t[c].label));return l},[t]);return s.jsx(Xj,{value:n,onChange:(l,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:l=>l.spacing(1.5),paddingRight:l=>l.spacing(1.5),paddingTop:l=>l.spacing(0),paddingBottom:l=>l.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:l=>l.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:s.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:a})}),yN=u.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,a=u.useCallback(c=>{o?.(c.target.value)},[o]),l=u.useMemo(()=>{const c=[];for(let d=0;d<t.length;d++){const p=t[d].label;c.push(s.jsx(v1,{value:d,sx:{color:f=>{if(n===d)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return s.jsx(b1,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:s.jsx(w2,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...i,children:l})})}),xN=u.memo(u.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:a,toolbarsProps:l,paletteProps:c={},workbook:d,sx:p,...f}=e,h=u.useMemo(()=>{const k=[],{ref:j,..._}=l?.Home||{};k.push({label:"Home",component:s.jsx(pN,{commands:n,..._})});const{ref:L,...T}=l?.Insert||{};k.push({label:"Insert",component:s.jsx(hN,{commands:n,...T})});const{ref:D,...C}=l?.View||{};return k.push({label:"View",component:s.jsx(fN,{commands:n,...C})}),k},[n]),g=u.useMemo(()=>{const k=[];for(let j=0;j<h.length;j++)k.push(u.cloneElement(h[j].component,{...h[j].component.props,key:h[j].key??h[j].label}));return k},[h]),[m,y]=u.useState(0),x=k=>{y(k)},v=u.useMemo(()=>s.jsx(i?yN:gN,{toolbars:h,value:m,onToolbarChange:x,sx:r}),[h,m,r,i]),{sx:b,...w}=c,M=s.jsx(Ti,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,marginLeft:k=>k.spacing(1),marginRight:k=>k.spacing(1),marginTop:k=>k.spacing(.5),marginBottom:k=>k.spacing(.5),...b},...w,children:g[m]});return s.jsxs(Ae,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:k=>k.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,a?a(M):M]})})),bN=e=>s.jsx(Nf,{...e}),vN=e=>s.jsx($f,{...e}),wN=e=>s.jsx(Bf,{...e}),Kf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:a=!1,readOnly:l=!1,contextMenuProps:c,renderContextMenu:d=bN,sheetsAllProps:p,renderSheetsAll:f=vN,sheetTabProps:h,renderSheetTab:g,background:m="transparent",className:y,notifier:x,sx:v,borderWidth:b,borderColor:w,gridTheme:M,gridStyle:k,...j}=e,[_,L]=u.useState(n?.getSelectedSheetIndex()),[T,D]=u.useState(n?.getSheets().search()),[C,S]=u.useState(n?.getProtection());cn(n,{onViewChange(ee){L(ee?.getSelectedSheetIndex())},onSheetsChange:ee=>{D(ee.getSheets().search())},onProtectionChange:ee=>{S(ee?.getProtection())}});const R=l||!C.isStructureAllowed(),P=u.useMemo(()=>{const ee=[];for(let ae=0;ae<T.length;ae++)ee.push(T[ae].getName());return ee},[T]),I=u.useCallback(ee=>{r?.(ee)!==!1&&(n.getSheetAt(ee).select(),i?.(ee))},[n,r,i]),z=u.useCallback((ee,ae)=>{n.getSheetAt(ee).setName(ae),i?.(ee)},[n,i]),A=u.useCallback((ee,ae)=>{n.getSheetAt(ee).setPosition(ae),i?.(ae)},[n,i]),O=Te(()=>{if(r?.(_)===!1)return;const ee=_+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ee)},[n,r,i,_]),N=u.useMemo(()=>({placement:"top-start"}),[]),F=u.useRef(null),[E,B]=u.useState(!1),H=u.useCallback(ee=>{const{closeFloatAll:ae,floatReference:we}=ee;return f({workbook:n,gridStyle:k,floatReference:we,closeFloatAll:ae,...p})},[f,p,a,n,k]),{reference:U,component:Z}=ha({label:"allSheet",popperProps:N,anchor:F.current,onOpen:()=>B(!0),onClose:()=>B(!1),createPopupPanel:H}),G=u.useRef(null),[V,le]=u.useState(null),re=u.useCallback(ee=>{const{floatReference:ae}=ee;return d?.({workbook:n,index:V?.index,tabStripRef:G.current,commands:o,disabled:a,floatReference:ae,...c})},[d,c,a,n,o,V]),{reference:ge,component:Q}=ha({label:"sheetTab",popperProps:N,anchor:{getBoundingClientRect:()=>new DOMRect(V?.left||0,V?.top||0,0,0)},onClose:()=>le(null),createPopupPanel:re});u.useEffect(()=>{V?ge.open(0):ge.close(0)},[V]);const xe=u.useCallback((ee,ae)=>{ee.preventDefault(),le({left:ee.clientX-2,top:ee.clientY-4,index:ae})},[]),be=Te(ee=>{let ae;try{ae=n?.getSheetAt(ee.index)}catch{}return ae?(g??wN)({sheet:ae,gridTheme:M,onContextMenu:we=>{I(ee.index),xe(we,ee.index)},...ee,...h}):null},[g,h,n,M]),Fe=u.useMemo(()=>R?null:s.jsx(di,{disableInteractive:!0,title:"New sheet",children:s.jsx(Tr,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ee=>ee.palette.primary.main},color:ee=>ee.palette.text.icon??ee.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ee=>{ee.button===0&&ee.preventDefault()},onClick:()=>O(),children:s.jsx(tR,{})})}),[a,R,O]);return s.jsxs(Ae,{ref:t,className:Eo(y),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...j,children:[s.jsx(DS,{ref:G,selectedTabIndex:_,tabNames:P,onSelectedTabIndexChange:I,onTabNameChange:z,onTabMove:A,background:m,borderColor:w,borderWidth:b,activeColor:null,disabled:a,disableDrag:R,createScrollStartButton:jD,createScrollEndButton:RD,createScrollEdgeButton:_D,createTabButton:be,createTabDivider:ee=>{const{key:ae,...we}=ee;return s.jsx(Ft,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:se=>pt(se.palette.divider,.25)},...we},ae)},editLabelProps:{readOnly:R,maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ee=>{n.isValidSheetNameCharacter(ee.key)||ee.preventDefault()},onCancel:()=>{i?.(_)},notifier:x},children:s.jsx(di,{disableInteractive:!0,title:E?"":"List all sheets",children:s.jsx(ii,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:ee=>ee.palette.text.icon??ee.palette.action.active},ref:F,dense:!0,outlined:!1,selected:E,color:"primary","aria-label":"menu",onMouseDown:ee=>{ee.button===0&&ee.preventDefault()},onClick:()=>{E?U.close(0):U.open(0)},icon:s.jsx(uR,{})})})}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,minWidth:"4px"}}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:Fe}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:1,minWidth:"24px"}}),Q,Z]})}));Kf.displayName="WorkbookStrip";const Gf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:a,className:l,...c}=e,[d,p]=u.useReducer(S=>S+1,0),[f,h]=u.useState(n.getSelectedSheet()),[g,m]=u.useState(f.getSelectedRanges()),[y,x]=u.useState(f.getSelectedCell());cn(n,{onSheetsChange(){h(n.getSelectedSheet())}}),cn(f.getSelection(),{onChange(){m(f.getSelectedRanges()),x(f.getSelectedCell())}}),_o(o,[],{onChange:()=>{p()}});const v=u.useMemo(()=>({}),[]),b=u.useMemo(()=>({commandHook:{beforeExecute:(S,R)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),w=u.useMemo(()=>({...v,...b,variant:Zt.Menuitem}),[v,b]),M=u.useMemo(()=>({commands:o,variant:Zt.Menuitem,parentFloat:a,...b}),[o,b,a]),k=[];let j=g.isEntireRows(),_=g.isEntireColumns();g&&(j&&(k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),k.push(u.createElement(Ge,{command:o.getCommand("hideColumns"),...w,icon:ze(s.jsx(TO,{})),key:"context:"+k.length})),k.push(u.createElement(Ge,{command:o.getCommand("unhideColumns"),...w,icon:ze(s.jsx(MO,{})),key:"context:"+k.length}))),_&&(k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),k.push(u.createElement(Ge,{command:o.getCommand("hideRows"),...w,icon:ze(s.jsx(jO,{})),key:"context:"+k.length})),k.push(u.createElement(Ge,{command:o.getCommand("unhideRows"),...w,icon:ze(s.jsx(_O,{})),key:"context:"+k.length}))),(j||_)&&k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),j&&k.push(u.createElement(Ge,{command:o.getCommand("autoFitColumns"),...w,icon:ze(s.jsx(iD,{})),key:"context:"+k.length})),_&&k.push(u.createElement(Ge,{command:o.getCommand("autoFitRows"),...w,icon:ze(s.jsx(aD,{})),key:"context:"+k.length})));const L=[],T=o.getCommand("formatTableStyle"),D=T?.context()?.table();if(rl(T),!j&&!_){if(L.push(s.jsx(Ft,{orientation:"horizontal"},"contextBefore:"+L.length)),y?.getHyperlink())L.push(u.createElement(ca,{...M,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+L.length,quickCommand:"openHyperlink",icon:S=>S.key()==="openHyperlink"?ze(s.jsx(dh,{})):null}));else{const S=o.getCommand("updateHyperlink");L.push(u.createElement(Ge,{command:S,...w,icon:ze(s.jsx(dh,{})),key:"contextBefore:"+L.length}))}if(y?.getComments())L.push(u.createElement(ca,{...M,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+L.length,quickCommand:"updateComments",icon:S=>S.key()==="updateComments"?ze(s.jsx(uh,{})):null}));else{const S=o.getCommand("updateComments");L.push(u.createElement(Ge,{command:S,...w,icon:ze(s.jsx(uh,{})),key:"contextBefore:"+L.length}))}D?L.push(u.createElement(ca,{...M,variant:Zt.Menuitem,key:"contextBefore:"+L.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:D,quickCommand:"editTable",icon:S=>(S.key(),ze(s.jsx(Kc,{})))})):L.push(u.createElement(Ge,{command:o.getCommand("insertTable"),...w,icon:ze(s.jsx(Kc,{})),key:"context:"+k.length})),L.push(u.createElement(If,{...M,key:"contextBefore:"+L.length}))}const C=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{command:o.getCommand("cut"),...w,icon:s.jsx(FP,{})}),s.jsx(H2,{command:o.getCommand("copy"),...w}),s.jsx(jf,{command:o.getCommand("paste"),...M,includePasteAllInPopup:!1}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Tf,{...M}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ef,{commands:o,...M,disableSheet:!0}),s.jsx(Mf,{commands:o,...M,disableSheet:!0}),s.jsx(kf,{...M}),L,k]});return s.jsx(Ae,{ref:t,className:Eo("menu",l),sx:{...i},...c,children:C})}));var py,hy;Gf.displayName="WorkbookContextMenu",function(){if(hy)return py;hy=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof bs=="object"&&bs&&bs.Object===Object&&bs,a=typeof self=="object"&&self&&self.Object===Object&&self,l=i||a||Function("return this")(),c=Object.prototype.toString,d=Math.max,p=Math.min,f=function(){return l.Date.now()};function h(m){var y=typeof m;return!!m&&(y=="object"||y=="function")}function g(m){if(typeof m=="number")return m;if(typeof(y=m)=="symbol"||function(b){return!!b&&typeof b=="object"}(y)&&c.call(y)=="[object Symbol]")return NaN;var y;if(h(m)){var x=typeof m.valueOf=="function"?m.valueOf():m;m=h(x)?x+"":x}if(typeof m!="string")return m===0?m:+m;m=m.replace(e,"");var v=n.test(m);return v||o.test(m)?r(m.slice(2),v?2:8):t.test(m)?NaN:+m}py=function(m,y,x){var v,b,w,M,k,j,_=0,L=!1,T=!1,D=!0;if(typeof m!="function")throw new TypeError("Expected a function");function C(z){var A=v,O=b;return v=b=void 0,_=z,M=m.apply(O,A)}function S(z){var A=z-j;return j===void 0||A>=y||A<0||T&&z-_>=w}function R(){var z,A,O=f();if(S(O))return P(O);k=setTimeout(R,(A=y-((z=O)-j),T?p(A,w-(z-_)):A))}function P(z){return k=void 0,D&&v?C(z):(v=b=void 0,M)}function I(){var z,A=f(),O=S(A);if(v=arguments,b=this,j=A,O){if(k===void 0)return _=z=j,k=setTimeout(R,y),L?C(z):M;if(T)return k=setTimeout(R,y),C(j)}return k===void 0&&(k=setTimeout(R,y)),M}return y=g(y)||0,h(x)&&(L=!!x.leading,w=(T="maxWait"in x)?d(g(x.maxWait)||0,y):w,D="trailing"in x?!!x.trailing:D),I.cancel=function(){k!==void 0&&clearTimeout(k),_=0,v=j=b=k=void 0},I.flush=function(){return k===void 0?M:P(f())},I}}();var fy,my,gy={};my||(my=1,function(){if(fy)return gy;fy=1;var e=u,t=typeof Object.is=="function"?Object.is:function(c,d){return c===d&&(c!==0||1/c==1/d)||c!=c&&d!=d},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function a(c){var d=c.getSnapshot;c=c.value;try{var p=d();return!t(c,p)}catch{return!0}}var l=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,d){return d()}:function(c,d){var p=d(),f=n({inst:{value:p,getSnapshot:d}}),h=f[0].inst,g=f[1];return r(function(){h.value=p,h.getSnapshot=d,a(h)&&g({inst:h})},[c,p,d]),o(function(){return a(h)&&g({inst:h}),c(function(){a(h)&&g({inst:h})})},[c]),i(p),p};gy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l}());var yy,xy,Pd={exports:{}},fs={exports:{}},SN=fs.exports;(function(){if(xy)return Pd.exports;xy=1;for(var e=(yy||(yy=1,function(){var f,h,g,m,y,x;typeof performance<"u"&&performance!==null&&performance.now?fs.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(fs.exports=function(){return(f()-y)/1e6},h=process.hrtime,m=(f=function(){var v;return 1e9*(v=h())[0]+v[1]})(),x=1e9*process.uptime(),y=m-x):Date.now?(fs.exports=function(){return Date.now()-g},g=Date.now()):(fs.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(SN)),fs.exports),t=typeof window>"u"?bs:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],a=0;!r&&a<n.length;a++)r=t[n[a]+"Request"+o],i=t[n[a]+"Cancel"+o]||t[n[a]+"CancelRequest"+o];if(!r||!i){var l=0,c=0,d=[],p=1e3/60;r=function(f){if(d.length===0){var h=e(),g=Math.max(0,p-(h-l));l=g+h,setTimeout(function(){var m=d.slice(0);d.length=0;for(var y=0;y<m.length;y++)if(!m[y].cancelled)try{m[y].callback(l)}catch(x){setTimeout(function(){throw x},0)}},Math.round(g))}return d.push({handle:++c,callback:f,cancelled:!1}),c},i=function(f){for(var h=0;h<d.length;h++)d[h].handle===f&&(d[h].cancelled=!0)}}Pd.exports=function(f){return r.call(t,f)},Pd.exports.cancel=function(){i.apply(t,arguments)},Pd.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i}})();var na={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const jC=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:a,onShowSidebar:l,onNewWorkbook:c=RC}=e,[d,p]=u.useState(t?.getSelectedSheet()),[f,h]=u.useState(t?.getSheets().search()),g=Te(l,[l]),m=Te(c,[c]),y=u.useMemo(()=>[new Tt("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[$e.Ctrl,$e.Shift]}}),new We("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new We("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new We("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new Tt("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[$e.Ctrl]},{key:"F5",modifiers:[$e.Shift]}]}),new Tt("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[$e.Ctrl]},{key:"H",modifiers:[$e.Ctrl,$e.Alt]}]}),new Tt("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[$e.Ctrl]}]}),new Tt("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new Tt("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new Tt("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new Tt("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new Tt("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new We("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new We("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new We("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[$e.Shift]},{key:"F1",modifiers:[$e.Alt,$e.Shift]}]}),new We("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new We("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl]}]}),new We("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl]}]}),new We("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl,$e.Shift]}]}),new We("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl,$e.Shift]}]}),new We("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new We("selectNamed",r,{label:S=>S?.getName()??"Select Named Item",scopedLabels:{namedItem:S=>S?.getName()??"Select"},description:"Select the item."}),new We("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new We("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new We("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new Tt("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[$e.Alt]}}),new Tt("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
221
+ `,c.getElementsByTagName("head")[0].appendChild(d)),c.body&&a(c.body,"react-draggable-transparent-selection")},Wo.createCSSTransform=function(c,d){const p=r(c,d,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:p}},Wo.createSVGTransform=function(c,d){return r(c,d,"")},Wo.getTouch=function(c,d){return c.targetTouches&&(0,e.findInArray)(c.targetTouches,p=>d===p.identifier)||c.changedTouches&&(0,e.findInArray)(c.changedTouches,p=>d===p.identifier)},Wo.getTouchIdentifier=function(c){return c.targetTouches&&c.targetTouches[0]?c.targetTouches[0].identifier:c.changedTouches&&c.changedTouches[0]?c.changedTouches[0].identifier:void 0},Wo.getTranslation=r,Wo.innerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingTop),d-=(0,e.int)(p.paddingBottom),d},Wo.innerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d-=(0,e.int)(p.paddingLeft),d-=(0,e.int)(p.paddingRight),d},Wo.matchesSelector=o,Wo.matchesSelectorAndParentsTo=function(c,d,p){let f=c;do{if(o(f,d))return!0;if(f===p)return!1;f=f.parentNode}while(f);return!1},Wo.offsetXYFromParent=function(c,d,p){const f=d===d.ownerDocument.body?{left:0,top:0}:d.getBoundingClientRect();return{x:(c.clientX+d.scrollLeft-f.left)/p,y:(c.clientY+d.scrollTop-f.top)/p}},Wo.outerHeight=function(c){let d=c.clientHeight;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderTopWidth),d+=(0,e.int)(p.borderBottomWidth),d},Wo.outerWidth=function(c){let d=c.clientWidth;const p=c.ownerDocument.defaultView.getComputedStyle(c);return d+=(0,e.int)(p.borderLeftWidth),d+=(0,e.int)(p.borderRightWidth),d},Wo.removeClassName=l,Wo.removeEvent=function(c,d,p,f){if(!c)return;const h={capture:!0,...f};c.removeEventListener?c.removeEventListener(d,p,h):c.detachEvent?c.detachEvent("on"+d,p):c["on"+d]=null},Wo.scheduleRemoveUserSelectStyles=function(c){window.requestAnimationFrame?window.requestAnimationFrame(()=>{i(c)}):i(c)};var e=Qu(),t=function(c){if(typeof WeakMap=="function")var d=new WeakMap;return function(p){if(p&&p.__esModule)return p;var f,h,g={__proto__:null,default:p};if(p===null||typeof p!="object"&&typeof p!="function")return g;if(f=d){if(f.has(p))return f.get(p);f.set(p,g)}for(const m in p)m!=="default"&&{}.hasOwnProperty.call(p,m)&&((h=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(p,m))&&(h.get||h.set)?f(g,m,h):g[m]=p[m]);return g}(c)}(function(){if(Vg)return Ba;Vg=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.browserPrefixToKey=p,Ba.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Ba.default=void 0,Ba.getPrefix=d;const c=["Moz","Webkit","O","ms"];function d(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const h=window.document?.documentElement?.style;if(!h||f in h)return"";for(let g=0;g<c.length;g++)if(p(f,c[g])in h)return c[g];return""}function p(f,h){return h?`${h}${function(g){let m="",y=!0;for(let x=0;x<g.length;x++)y?(m+=g[x].toUpperCase(),y=!1):g[x]==="-"?y=!0:m+=g[x];return m}(f)}`:f}return Ba.default=d(),Ba}());let n="";function o(c,d){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(p){return(0,e.isFunction)(c[p])})),!!(0,e.isFunction)(c[n])&&c[n](d)}function r(c,d,p){let{x:f,y:h}=c,g=`translate(${f}${p},${h}${p})`;return d&&(g=`translate(${typeof d.x=="string"?d.x:d.x+p}, ${typeof d.y=="string"?d.y:d.y+p})`+g),g}function i(c){if(c)try{if(c.body&&l(c.body,"react-draggable-transparent-selection"),c.selection)c.selection.empty();else{const d=(c.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function a(c,d){c.classList?c.classList.add(d):c.className.match(new RegExp(`(?:^|\\s)${d}(?!\\S)`))||(c.className+=` ${d}`)}function l(c,d){c.classList?c.classList.remove(d):c.className=c.className.replace(new RegExp(`(?:^|\\s)${d}(?!\\S)`,"g"),"")}return Wo}var Wg,ta={};function Ug(){if(Wg)return ta;Wg=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},ta.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},ta.createCoreData=function(o,r,i){const a=!(0,e.isNum)(o.lastX),l=n(o);return a?{node:l,deltaX:0,deltaY:0,lastX:r,lastY:i,x:r,y:i}:{node:l,deltaX:r-o.lastX,deltaY:i-o.lastY,lastX:o.lastX,lastY:o.lastY,x:r,y:i}},ta.createDraggableData=function(o,r){const i=o.props.scale;return{node:r.node,x:o.state.x+r.deltaX/i,y:o.state.y+r.deltaY/i,deltaX:r.deltaX/i,deltaY:r.deltaY/i,lastX:o.state.x,lastY:o.state.y}},ta.getBoundPosition=function(o,r,i){if(!o.props.bounds)return[r,i];let{bounds:a}=o.props;var l;a=typeof a=="string"?a:{left:(l=a).left,top:l.top,right:l.right,bottom:l.bottom};const c=n(o);if(typeof a=="string"){const{ownerDocument:d}=c,p=d.defaultView;let f;if(f=a==="parent"?c.parentNode:c.getRootNode().querySelector(a),!(f instanceof p.HTMLElement))throw new Error('Bounds selector "'+a+'" could not find an element.');const h=f,g=p.getComputedStyle(c),m=p.getComputedStyle(h);a={left:-c.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(g.marginLeft),top:-c.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(g.marginTop),right:(0,t.innerWidth)(h)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(g.marginRight),bottom:(0,t.innerHeight)(h)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(g.marginBottom)}}return(0,e.isNum)(a.right)&&(r=Math.min(r,a.right)),(0,e.isNum)(a.bottom)&&(i=Math.min(i,a.bottom)),(0,e.isNum)(a.left)&&(r=Math.max(r,a.left)),(0,e.isNum)(a.top)&&(i=Math.max(i,a.top)),[r,i]},ta.getControlPosition=function(o,r,i){const a=typeof r=="number"?(0,t.getTouch)(o,r):null;if(typeof r=="number"&&!a)return null;const l=n(i),c=i.props.offsetParent||l.offsetParent||l.ownerDocument.body;return(0,t.offsetXYFromParent)(a||o,c,i.props.scale)},ta.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Qu(),t=qh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return ta}var qg,Kg,Gg,Zg,U0={},c5={};function Xg(){return qg||(qg=1,Object.defineProperty(c5,"__esModule",{value:!0}),c5.default=function(){}),c5}function eN(){return Gg||(Gg=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=function(m){if(typeof WeakMap=="function")var y=new WeakMap;return function(x){if(x&&x.__esModule)return x;var v,b,w={__proto__:null,default:x};if(x===null||typeof x!="object"&&typeof x!="function")return w;if(v=y){if(v.has(x))return v.get(x);v.set(x,w)}for(const M in x)M!=="default"&&{}.hasOwnProperty.call(x,M)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,M))&&(b.get||b.set)?v(w,M,b):w[M]=x[M]);return w}(m)}(u),n=p(Xc()),o=p(yo),r=function(){if(Bg)return Rd.exports;function m(x){var v,b,w="";if(typeof x=="string"||typeof x=="number")w+=x;else if(typeof x=="object")if(Array.isArray(x)){var M=x.length;for(v=0;v<M;v++)x[v]&&(b=m(x[v]))&&(w&&(w+=" "),w+=b)}else for(b in x)x[b]&&(w&&(w+=" "),w+=b);return w}function y(){for(var x,v,b=0,w="",M=arguments.length;b<M;b++)(x=arguments[b])&&(v=m(x))&&(w&&(w+=" "),w+=v);return w}return Bg=1,Rd.exports=y,Rd.exports.clsx=y,Rd.exports}(),i=qh(),a=Ug(),l=Qu(),c=p(function(){if(Kg)return U0;Kg=1,Object.defineProperty(U0,"__esModule",{value:!0}),U0.default=void 0;var m=function(C){if(typeof WeakMap=="function")var S=new WeakMap;return function(R){if(R&&R.__esModule)return R;var P,I,z={__proto__:null,default:R};if(R===null||typeof R!="object"&&typeof R!="function")return z;if(P=S){if(P.has(R))return P.get(R);P.set(R,z)}for(const A in R)A!=="default"&&{}.hasOwnProperty.call(R,A)&&((I=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(R,A))&&(I.get||I.set)?P(z,A,I):z[A]=R[A]);return z}(C)}(u),y=k(Xc()),x=k(yo),v=qh(),b=Ug(),w=Qu(),M=k(Xg());function k(C){return C&&C.__esModule?C:{default:C}}function j(C,S,R){return(S=typeof(P=function(I,z){if(typeof I!="object"||!I)return I;var A=I[Symbol.toPrimitive];if(A!==void 0){var O=A.call(I,z);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}(S,"string"))=="symbol"?P:P+"")in C?Object.defineProperty(C,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):C[S]=R,C;var P}const _={start:"touchstart",move:"touchmove",stop:"touchend"},L={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=L,D=class extends m.Component{constructor(){super(...arguments),j(this,"dragging",!1),j(this,"lastX",NaN),j(this,"lastY",NaN),j(this,"touchIdentifier",null),j(this,"mounted",!1),j(this,"handleDragStart",C=>{if(this.props.onMouseDown(C),!this.props.allowAnyClick&&typeof C.button=="number"&&C.button!==0)return!1;const S=this.findDOMNode();if(!S||!S.ownerDocument||!S.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:R}=S;if(this.props.disabled||!(C.target instanceof R.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(C.target,this.props.handle,S)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(C.target,this.props.cancel,S))return;C.type!=="touchstart"||this.props.allowMobileScroll||C.preventDefault();const P=(0,v.getTouchIdentifier)(C);this.touchIdentifier=P;const I=(0,b.getControlPosition)(C,P,this);if(I==null)return;const{x:z,y:A}=I,O=(0,b.createCoreData)(this,z,A);(0,M.default)("DraggableCore: handleDragStart: %j",O),(0,M.default)("calling",this.props.onStart),this.props.onStart(C,O)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(R),this.dragging=!0,this.lastX=z,this.lastY=A,(0,v.addEvent)(R,T.move,this.handleDrag),(0,v.addEvent)(R,T.stop,this.handleDragStop))}),j(this,"handleDrag",C=>{const S=(0,b.getControlPosition)(C,this.touchIdentifier,this);if(S==null)return;let{x:R,y:P}=S;if(Array.isArray(this.props.grid)){let z=R-this.lastX,A=P-this.lastY;if([z,A]=(0,b.snapToGrid)(this.props.grid,z,A),!z&&!A)return;R=this.lastX+z,P=this.lastY+A}const I=(0,b.createCoreData)(this,R,P);if((0,M.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag(C,I)!==!1&&this.mounted!==!1)this.lastX=R,this.lastY=P;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const z=document.createEvent("MouseEvents");z.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(z)}}),j(this,"handleDragStop",C=>{if(!this.dragging)return;const S=(0,b.getControlPosition)(C,this.touchIdentifier,this);if(S==null)return;let{x:R,y:P}=S;if(Array.isArray(this.props.grid)){let A=R-this.lastX||0,O=P-this.lastY||0;[A,O]=(0,b.snapToGrid)(this.props.grid,A,O),R=this.lastX+A,P=this.lastY+O}const I=(0,b.createCoreData)(this,R,P);if(this.props.onStop(C,I)===!1||this.mounted===!1)return!1;const z=this.findDOMNode();z&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(z.ownerDocument),(0,M.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,z&&((0,M.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(z.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(z.ownerDocument,T.stop,this.handleDragStop))}),j(this,"onMouseDown",C=>(T=L,this.handleDragStart(C))),j(this,"onMouseUp",C=>(T=L,this.handleDragStop(C))),j(this,"onTouchStart",C=>(T=_,this.handleDragStart(C))),j(this,"onTouchEnd",C=>(T=_,this.handleDragStop(C)))}componentDidMount(){this.mounted=!0;const C=this.findDOMNode();C&&(0,v.addEvent)(C,_.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const C=this.findDOMNode();if(C){const{ownerDocument:S}=C;(0,v.removeEvent)(S,L.move,this.handleDrag),(0,v.removeEvent)(S,_.move,this.handleDrag),(0,v.removeEvent)(S,L.stop,this.handleDragStop),(0,v.removeEvent)(S,_.stop,this.handleDragStop),(0,v.removeEvent)(C,_.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(S)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:x.default.findDOMNode(this)}render(){return m.cloneElement(m.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return U0.default=D,j(D,"displayName","DraggableCore"),j(D,"propTypes",{allowAnyClick:y.default.bool,allowMobileScroll:y.default.bool,children:y.default.node.isRequired,disabled:y.default.bool,enableUserSelectHack:y.default.bool,offsetParent:function(C,S){if(C[S]&&C[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:y.default.arrayOf(y.default.number),handle:y.default.string,cancel:y.default.string,nodeRef:y.default.object,onStart:y.default.func,onDrag:y.default.func,onStop:y.default.func,onMouseDown:y.default.func,scale:y.default.number,className:w.dontSetMe,style:w.dontSetMe,transform:w.dontSetMe}),j(D,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),U0}()),d=p(Xg());function p(m){return m&&m.__esModule?m:{default:m}}function f(){return f=Object.assign?Object.assign.bind():function(m){for(var y=1;y<arguments.length;y++){var x=arguments[y];for(var v in x)({}).hasOwnProperty.call(x,v)&&(m[v]=x[v])}return m},f.apply(null,arguments)}function h(m,y,x){return(y=typeof(v=function(b,w){if(typeof b!="object"||!b)return b;var M=b[Symbol.toPrimitive];if(M!==void 0){var k=M.call(b,w);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(y,"string"))=="symbol"?v:v+"")in m?Object.defineProperty(m,y,{value:x,enumerable:!0,configurable:!0,writable:!0}):m[y]=x,m;var v}class g extends t.Component{static getDerivedStateFromProps(y,x){let{position:v}=y,{prevPropsPosition:b}=x;return!v||b&&v.x===b.x&&v.y===b.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:v,prevPropsPosition:b}),{x:v.x,y:v.y,prevPropsPosition:{...v}})}constructor(y){super(y),h(this,"onDragStart",(x,v)=>{if((0,d.default)("Draggable: onDragStart: %j",v),this.props.onStart(x,(0,a.createDraggableData)(this,v))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(x,v)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",v);const b=(0,a.createDraggableData)(this,v),w={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:k}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[j,_]=(0,a.getBoundPosition)(this,w.x,w.y);w.x=j,w.y=_,w.slackX=this.state.slackX+(M-w.x),w.slackY=this.state.slackY+(k-w.y),b.x=w.x,b.y=w.y,b.deltaX=w.x-this.state.x,b.deltaY=w.y-this.state.y}if(this.props.onDrag(x,b)===!1)return!1;this.setState(w)}),h(this,"onDragStop",(x,v)=>{if(!this.state.dragging||this.props.onStop(x,(0,a.createDraggableData)(this,v))===!1)return!1;(0,d.default)("Draggable: onDragStop: %j",v);const b={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:w,y:M}=this.props.position;b.x=w,b.y=M}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:y.position?y.position.x:y.defaultPosition.x,y:y.position?y.position.y:y.defaultPosition.y,prevPropsPosition:{...y.position},slackX:0,slackY:0,isElementSVG:!1},!y.position||y.onDrag||y.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??o.default.findDOMNode(this)}render(){const{axis:y,bounds:x,children:v,defaultPosition:b,defaultClassName:w,defaultClassNameDragging:M,defaultClassNameDragged:k,position:j,positionOffset:_,scale:L,...T}=this.props;let D={},C=null;const S=!j||this.state.dragging,R=j||b,P={x:(0,a.canDragX)(this)&&S?this.state.x:R.x,y:(0,a.canDragY)(this)&&S?this.state.y:R.y};this.state.isElementSVG?C=(0,i.createSVGTransform)(P,_):D=(0,i.createCSSTransform)(P,_);const I=(0,r.clsx)(v.props.className||"",w,{[M]:this.state.dragging,[k]:this.state.dragged});return t.createElement(c.default,f({},T,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(v),{className:I,style:{...v.props.style,...D},transform:C}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),h(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}($g)),$g}function fC(){if(Zg)return W0.exports;Zg=1;const{default:e,DraggableCore:t}=eN();return W0.exports=e,W0.exports.default=e,W0.exports.DraggableCore=t,W0.exports}var Yg,Id={},Jg,Qg,q0={};function mC(){if(Jg)return q0;Jg=1,q0.__esModule=!0,q0.resizableProps=void 0;var e,t=(e=Xc())&&e.__esModule?e:{default:e};fC();var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,l=r[0];return l.axis==="both"||l.axis==="y"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];var a,l=r[0];return l.axis==="both"||l.axis==="x"?(a=t.default.number).isRequired.apply(a,r):t.default.number.apply(t.default,r)}};return q0.resizableProps=n,q0}function ey(){if(Qg)return H0;Qg=1,H0.__esModule=!0,H0.default=void 0;var e=function(h){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var g=i(void 0);if(g&&g.has(h))return g.get(h);var m={},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in h)if(x!=="default"&&Object.prototype.hasOwnProperty.call(h,x)){var v=y?Object.getOwnPropertyDescriptor(h,x):null;v&&(v.get||v.set)?Object.defineProperty(m,x,v):m[x]=h[x]}return m.default=h,g&&g.set(h,m),m}(u),t=fC(),n=function(){if(Yg)return Id;Yg=1,Id.__esModule=!0,Id.cloneElement=function(v,b){return b.style&&v.props.style&&(b.style=y(y({},v.props.style),b.style)),b.className&&v.props.className&&(b.className=v.props.className+" "+b.className),g.default.cloneElement(v,b)};var h,g=(h=u)&&h.__esModule?h:{default:h};function m(v,b){var w=Object.keys(v);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(v);b&&(M=M.filter(function(k){return Object.getOwnPropertyDescriptor(v,k).enumerable})),w.push.apply(w,M)}return w}function y(v){for(var b=1;b<arguments.length;b++){var w=arguments[b]!=null?arguments[b]:{};b%2?m(Object(w),!0).forEach(function(M){x(v,M,w[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(M){Object.defineProperty(v,M,Object.getOwnPropertyDescriptor(w,M))})}return v}function x(v,b,w){return(b=typeof(M=function(k,j){if(typeof k!="object"||k===null)return k;var _=k[Symbol.toPrimitive];if(_!==void 0){var L=_.call(k,j);if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(k)}(b,"string"))=="symbol"?M:String(M))in v?Object.defineProperty(v,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[b]=w,v;var M}return Id}(),o=mC(),r=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(h){if(typeof WeakMap!="function")return null;var g=new WeakMap,m=new WeakMap;return(i=function(y){return y?m:g})(h)}function a(){return a=Object.assign?Object.assign.bind():function(h){for(var g=1;g<arguments.length;g++){var m=arguments[g];for(var y in m)Object.prototype.hasOwnProperty.call(m,y)&&(h[y]=m[y])}return h},a.apply(this,arguments)}function l(h,g){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(h);g&&(y=y.filter(function(x){return Object.getOwnPropertyDescriptor(h,x).enumerable})),m.push.apply(m,y)}return m}function c(h){for(var g=1;g<arguments.length;g++){var m=arguments[g]!=null?arguments[g]:{};g%2?l(Object(m),!0).forEach(function(y){d(h,y,m[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):l(Object(m)).forEach(function(y){Object.defineProperty(h,y,Object.getOwnPropertyDescriptor(m,y))})}return h}function d(h,g,m){return(g=typeof(y=function(x,v){if(typeof x!="object"||x===null)return x;var b=x[Symbol.toPrimitive];if(b!==void 0){var w=b.call(x,v);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(x)}(g,"string"))=="symbol"?y:String(y))in h?Object.defineProperty(h,g,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[g]=m,h;var y}function p(h,g){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,y){return m.__proto__=y,m})(h,g)}var f=function(h){var g,m;function y(){for(var v,b=arguments.length,w=new Array(b),M=0;M<b;M++)w[M]=arguments[M];return(v=h.call.apply(h,[this].concat(w))||this).handleRefs={},v.lastHandleRect=null,v.slack=null,v}m=h,(g=y).prototype=Object.create(m.prototype),g.prototype.constructor=g,p(g,m);var x=y.prototype;return x.componentWillUnmount=function(){this.resetData()},x.resetData=function(){this.lastHandleRect=this.slack=null},x.runConstraints=function(v,b){var w=this.props,M=w.minConstraints,k=w.maxConstraints,j=w.lockAspectRatio;if(!M&&!k&&!j)return[v,b];if(j){var _=this.props.width/this.props.height,L=v-this.props.width,T=b-this.props.height;Math.abs(L)>Math.abs(T*_)?b=v/_:v=b*_}var D=v,C=b,S=this.slack||[0,0],R=S[0],P=S[1];return v+=R,b+=P,M&&(v=Math.max(M[0],v),b=Math.max(M[1],b)),k&&(v=Math.min(k[0],v),b=Math.min(k[1],b)),this.slack=[R+(D-v),P+(C-b)],[v,b]},x.resizeHandler=function(v,b){var w=this;return function(M,k){var j=k.node,_=k.deltaX,L=k.deltaY;v==="onResizeStart"&&w.resetData();var T=(w.props.axis==="both"||w.props.axis==="x")&&b!=="n"&&b!=="s",D=(w.props.axis==="both"||w.props.axis==="y")&&b!=="e"&&b!=="w";if(T||D){var C=b[0],S=b[b.length-1],R=j.getBoundingClientRect();w.lastHandleRect!=null&&(S==="w"&&(_+=R.left-w.lastHandleRect.left),C==="n"&&(L+=R.top-w.lastHandleRect.top)),w.lastHandleRect=R,S==="w"&&(_=-_),C==="n"&&(L=-L);var P=w.props.width+(T?_/w.props.transformScale:0),I=w.props.height+(D?L/w.props.transformScale:0),z=w.runConstraints(P,I);P=z[0],I=z[1];var A=P!==w.props.width||I!==w.props.height,O=typeof w.props[v]=="function"?w.props[v]:null;O&&!(v==="onResize"&&!A)&&(M.persist==null||M.persist(),O(M,{node:j,size:{width:P,height:I},handle:b})),v==="onResizeStop"&&w.resetData()}}},x.renderResizeHandle=function(v,b){var w=this.props.handle;if(!w)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+v,ref:b});if(typeof w=="function")return w(v,b);var M=c({ref:b},typeof w.type=="string"?{}:{handleAxis:v});return e.cloneElement(w,M)},x.render=function(){var v=this,b=this.props,w=b.children,M=b.className,k=b.draggableOpts;b.width,b.height,b.handle,b.handleSize,b.lockAspectRatio,b.axis,b.minConstraints,b.maxConstraints,b.onResize,b.onResizeStop,b.onResizeStart;var j=b.resizeHandles;b.transformScale;var _=function(L,T){if(L==null)return{};var D,C,S={},R=Object.keys(L);for(C=0;C<R.length;C++)D=R[C],T.indexOf(D)>=0||(S[D]=L[D]);return S}(b,r);return(0,n.cloneElement)(w,c(c({},_),{},{className:(M?M+" ":"")+"react-resizable",children:[].concat(w.props.children,j.map(function(L){var T,D=(T=v.handleRefs[L])!=null?T:v.handleRefs[L]=e.createRef();return e.createElement(t.DraggableCore,a({},k,{nodeRef:D,key:"resizableHandle-"+L,onStop:v.resizeHandler("onResizeStop",L),onStart:v.resizeHandler("onResizeStart",L),onDrag:v.resizeHandler("onResize",L)}),v.renderResizeHandle(L,D))}))}))},y}(e.Component);return H0.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},H0}var ty,ny,K0={},tN=(ny||(ny=1,jd.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},jd.exports.Resizable=ey().default,jd.exports.ResizableBox=function(){if(ty)return K0;ty=1,K0.__esModule=!0,K0.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var m=a(void 0);if(m&&m.has(g))return m.get(g);var y={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in g)if(v!=="default"&&Object.prototype.hasOwnProperty.call(g,v)){var b=x?Object.getOwnPropertyDescriptor(g,v):null;b&&(b.get||b.set)?Object.defineProperty(y,v,b):y[v]=g[v]}return y.default=g,m&&m.set(g,y),y}(u),t=i(Xc()),n=i(ey()),o=mC(),r=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(g){return g&&g.__esModule?g:{default:g}}function a(g){if(typeof WeakMap!="function")return null;var m=new WeakMap,y=new WeakMap;return(a=function(x){return x?y:m})(g)}function l(){return l=Object.assign?Object.assign.bind():function(g){for(var m=1;m<arguments.length;m++){var y=arguments[m];for(var x in y)Object.prototype.hasOwnProperty.call(y,x)&&(g[x]=y[x])}return g},l.apply(this,arguments)}function c(g,m){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(g);m&&(x=x.filter(function(v){return Object.getOwnPropertyDescriptor(g,v).enumerable})),y.push.apply(y,x)}return y}function d(g){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?c(Object(y),!0).forEach(function(x){p(g,x,y[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):c(Object(y)).forEach(function(x){Object.defineProperty(g,x,Object.getOwnPropertyDescriptor(y,x))})}return g}function p(g,m,y){return(m=typeof(x=function(v,b){if(typeof v!="object"||v===null)return v;var w=v[Symbol.toPrimitive];if(w!==void 0){var M=w.call(v,b);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}(m,"string"))=="symbol"?x:String(x))in g?Object.defineProperty(g,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[m]=y,g;var x}function f(g,m){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(y,x){return y.__proto__=x,y})(g,m)}var h=function(g){var m,y;function x(){for(var v,b=arguments.length,w=new Array(b),M=0;M<b;M++)w[M]=arguments[M];return(v=g.call.apply(g,[this].concat(w))||this).state={width:v.props.width,height:v.props.height,propsWidth:v.props.width,propsHeight:v.props.height},v.onResize=function(k,j){var _=j.size;v.props.onResize?(k.persist==null||k.persist(),v.setState(_,function(){return v.props.onResize&&v.props.onResize(k,j)})):v.setState(_)},v}return y=g,(m=x).prototype=Object.create(y.prototype),m.prototype.constructor=m,f(m,y),x.getDerivedStateFromProps=function(v,b){return b.propsWidth!==v.width||b.propsHeight!==v.height?{width:v.width,height:v.height,propsWidth:v.width,propsHeight:v.height}:null},x.prototype.render=function(){var v=this.props,b=v.handle,w=v.handleSize;v.onResize;var M=v.onResizeStart,k=v.onResizeStop,j=v.draggableOpts,_=v.minConstraints,L=v.maxConstraints,T=v.lockAspectRatio,D=v.axis;v.width,v.height;var C=v.resizeHandles,S=v.style,R=v.transformScale,P=function(I,z){if(I==null)return{};var A,O,N={},F=Object.keys(I);for(O=0;O<F.length;O++)A=F[O],z.indexOf(A)>=0||(N[A]=I[A]);return N}(v,r);return e.createElement(n.default,{axis:D,draggableOpts:j,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:T,maxConstraints:L,minConstraints:_,onResizeStart:M,onResize:this.onResize,onResizeStop:k,resizeHandles:C,transformScale:R,width:this.state.width},e.createElement("div",l({},P,{style:d(d({},S),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},x}(e.Component);return K0.default=h,h.propTypes=d(d({},o.resizableProps),{},{children:t.default.element}),K0}().default),jd.exports);function d5(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var W2=parseInt(u.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=d5(o,t),i=typeof r=="function";n.push(i?r:()=>d5(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)d5(n,t)}};const Lf=u.memo(u.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,readonly:a=!1,disabled:l=!1,commandPopupButtonProps:c,sx:d,notifier:p,...f}=e,[h,g]=u.useState(null),[m,y]=u.useState(()=>r.getSelectedRanges().getCoords()),[x,v]=u.useState(!1),{reference:b}=ha({parentFloat:c?.parentFloat}),[w,M]=u.useState(()=>a||!r.getProtection().isStructureAllowed()),k=()=>h?.text??"",[j,_]=u.useState(k),L=Te(()=>{if(b?.closeAll(),!j){const Z=k();return _(k()),Z}if(k()===j)return j;const B=j.trim().toLowerCase();if(B==="r"||B==="c")return j;try{const Z=r.getRanges(j);if(Z)return Z.toString()}catch{}const H=o.getByName(j);if(H&&H.getRanges())return j;let U=null;try{const Z=r.getRanges(j).getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));U=r.getRanges(Z)}catch{}if(!U){const Z=r.getSelectedRanges().getCoords().map(G=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G}));U=r.getRanges(Z)}try{let Z=o.getByName(j);w||Z||(Z=o.addReference(j,U)),Z&&g({text:Z.getName()})}catch(Z){_(k()),p.showMessage?.(Z.message,{type:pa.Error})}return null},[j,o,b,w]),T=Te(()=>{if(r.isClosed())return;const B=[];for(let Z=0;Z<m.length;Z++){const G=m[Z];B.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...G})}let H=null;try{H=o.lookupByRanges(B)}catch{}let U=null;U=H?.length>0?H[0].getName():r.getSelectedSheet().getSelectedRange().toString(),g({text:U})},[r,m]),[D,C]=u.useState(()=>o?.search()??null);cn(o,{onCollectionChange(B){C(o.search()),T()},onClose(B){C([])}}),u.useEffect(()=>{_(k())},[h,m]);const[S,R]=u.useState(r?.getSelectedSheet());cn(r,{onProtectionChange:B=>{M(a||!B.getProtection().isStructureAllowed())},onSheetsChange:B=>{R(B?.getSelectedSheet())},onViewChange(B){R(B?.getSelectedSheet())}});const[P,I]=u.useState(null),z=Te($.CommonUtils.debounce(T,P?320:0),[]);cn(S.getSelection(),{onChange:()=>{y(B=>{const H=r.getSelectedRanges().getCoords();return $.CoordUtils.isEqualRangesArrays(H,B)?B:H})},onAdjustingChange:B=>{I(B.getAdjusting())}}),u.useEffect(()=>{if(P){const B=r.getSelectedRange(),H=B.getRowCount(),U=B.getColumnCount();let Z=`${H}R x ${U}C`;if(Z.length>17&&(Z=`${H}x${U}`),H>1||U>1)return void g({text:Z,fontStyle:"italic",justifyContent:"center"})}g({text:r.getSelectedSheet().getSelectedRange().toString()}),z()},[m,r,P]);const A=u.useRef(null),O=u.useCallback(B=>{const{onMouseDown:H,onMouseUp:U,...Z}=B;return s.jsx(Tr,{...Z,sx:{...Z?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:s.jsx(Kl,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:A},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.text.icon??G.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},"::after":{borderBottom:G=>`1px solid ${G.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*$.IFont.getDeviceScale(),fontStyle:h?.fontStyle,paddingLeft:G=>G.spacing(.75),paddingRight:G=>G.spacing(.75),boxShadow:"none",flex:"1",color:G=>G.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:G=>G.palette.text.primary}}},value:j,onFocus:G=>{G.target?.select()},onKeyDown:G=>{if(G.which===on.Enter||G.which===on.Tab){let V=j;k()!==j&&(G.stopPropagation(),G.preventDefault(),V=L()),V?N(V):i?.()}else if(G.which===on.Escape)k()!==j?(_(k()),setTimeout(()=>{G.target?.select()},0),G.stopPropagation(),G.preventDefault()):i?.();else if(G.which===on.Space)return void G.stopPropagation()},onBlur:()=>{_(k())},onChange:G=>{_(G.target.value)}})})},[j,h]),N=Te(async B=>{try{b?.closeAll();const H=o.lookupByRanges(B)?.[0];H&&await H?.select(),await r.getRanges(B)?.select()}catch(H){p.showMessage?.(H.message,{type:pa.Error})}},[o,p,r]),F=u.useCallback(B=>{setTimeout(()=>{v(!0)},0);const H={variant:Zt.Menuitem,parentFloat:B.floatReference,commandHook:{...c?.commandHook,beforeExecute:(ge,Q)=>(b?.closeAll(),c?.commandHook?.beforeExecute?.(ge,Q))},scope:c?.scope,commands:c?.commands};let U=o.search({scope:r?.getSelectedSheet().getName()});U=U.sort((ge,Q)=>ge.getType()===Q.getType()?ge.getName().localeCompare(Q.getName()):ge.getType()==="range"?-1:1);const Z=w?null:["editNamedReference","deleteNamedReference"],G=w?null:["editTable",null,"convertTableToRange","deleteTable"],V=[],le=U.length;for(let ge=0;ge<le;ge++){const Q=U[ge],xe=Q.getRanges();if(!xe||Q.isHidden())continue;const be=Q.getType();be!==U[ge-1]?.getType()&&(ge>0&&V.push(s.jsx(Ft,{orientation:"horizontal"},`type-divider-${V.length}`)),V.push(s.jsx(Gs,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:Q.getType()==="reference"?"Ranges":"Tables"},`type-header-${V.length}`))),be==="reference"?V.push(u.createElement(ca,{...H,key:"named-"+V.length,popupCommandKeys:Z,popupScope:"namedItem",scope:"namedItem",commandState:Q,commands:c?.commands,label:Q.getName(),quickCommand:"selectNamed",disabled:!Q.getRanges()||l,icon:Fe=>{switch(Fe.key()){case"editNamedReference":return ze(s.jsx(oD,{}));case"deleteNamedReference":return ze(s.jsx(rD,{}));default:return ze(s.jsx(tD,{}))}}})):be==="table"&&V.push(u.createElement(ca,{...H,key:"namedItem-"+V.length,popupCommandKeys:G,popupScope:"namedItem",scope:"namedItem",commands:c?.commands,commandState:Q,label:Q.getName(),quickCommand:"selectNamed",disabled:!xe||l,icon:Fe=>(Fe.key(),ze(s.jsx(Kc,{})))}))}const re=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...f,children:[w?null:s.jsx(Ge,{...H,scope:"namedItem",command:c?.commands.getCommand("addNamedReference"),icon:ze(s.jsx(nD,{}))}),V&&V.length>0?s.jsxs(s.Fragment,{children:[w?null:s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:V})]}):null]});return Bn({...B,children:re})},[r,D,o,h,w]),E=ir(t,()=>({focus(B){A.current?.focus(B)}}),[]);return s.jsx(Ae,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...d},ref:W2([E,t]),...f,children:s.jsx(qi,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...d},buttonProps:{sx:{backgroundColor:B=>B.palette.background.paper,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}},tabIndex:-1,outlined:{color:B=>n?B.palette.action.disabled:pt(B.palette.divider,.2)},parentFloat:b,createPopupPanel:F,onPopupOpen:()=>v(!0),onPopupClose:()=>v(!1),createTooltip:({children:B},H)=>s.jsx(br,{title:H||x?"":"Name Box",disabled:H,leaveDelay:0,sx:{opacity:H||x?0:1},children:B}),createQuickButton:O})})}));Lf.displayName="NamedCollectionEditor";const nN=(e,t)=>s.jsx(Lf,{ref:t,...e}),zf=u.memo(u.forwardRef((e,t)=>{const{sx:n,workbook:o,sheetElement:r,gridStyle:i,showNamedCollectionEditor:a=!0,NamedCollectionEditorProps:l,renderNamedCollectionEditor:c=nN,disabled:d,commands:p,...f}=e,[h,g]=u.useState(o?.getSelectedSheet());cn(o,{onSheetsChange:G=>{g(G?.getSelectedSheet())},onViewChange(G){g(G?.getSelectedSheet())}});const[m,y]=u.useState(h.getSelection().getCoords().cell),x=h.getRange(m).getCell(),v=d||!x.isEditAllowed(),b=u.useRef(null),w=u.useMemo(()=>({fontSize:11}),[]);cn(h.getSelection(),{onChange:()=>{y(h.getSelection().getCoords().cell)}}),cn(h,{onProtectionChange(){y(h.getSelection().getCoords().cell)}});const M=b.current?.getLineHeight()??20,[k,j]=u.useState(M),[_,L]=u.useState(5),[T,D]=u.useState(1),C=Te((G,{size:V})=>{G.preventDefault(),G.stopPropagation();const le=Math.floor(V.height/M);j(le*M+1),le>1&&L(le)},[M]),S=Te((G,{size:V})=>{const le=Math.floor(V.height/M);D(le)},[M]),R=Wi(),P=R.getMode();let I=null;P?.key==="edit"&&(I=P.args?.stateAndCoords);const z=u.useMemo(()=>{let G=I?.editState;return G||(G=Yw(()=>h.getRange(m).getCell())),s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",gap:4},children:s.jsx(Xw,{ref:b,activeCoords:m,sheet:h,onFocus:()=>{r?.startEdit({autoFocus:!1,editMode:!0,cell:m})},defaultTextStyle:w,useRichStyling:!1,disabled:v,onChangeEdit:V=>{if(V.dirty!==void 0){const le={sheet:h,coords:m,editState:V};R.setMode(re=>({...re,args:{...re?.args,stateAndCoords:le}}))}},editState:G,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,I,m,T,r]),A=u.useRef(null),O=u.useMemo(()=>a?c({names:o.getNames(),workbook:o,...l},A):null,[c,l,a,h,o,v]),N=u.useMemo(()=>s.jsxs(Ti,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:G=>`solid ${v?G.palette.action.disabled:pt(G.palette.divider,.2)} 1px`},children:[s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"warning","aria-label":"cancel-formula-edit",icon:ze(s.jsx(QO,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||I===null,onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{r.cancelEdit()}}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,color:"primary","aria-label":"commit-formula-edit",icon:ze(s.jsx(eD,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||I===null,onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{r.submitEdit()}}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,disabled:!0,"aria-label":"commit-formula-function",icon:ze(s.jsx(SD,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:G=>{G.button===0&&G.preventDefault()}})]}),[v,I]),F=Ki(),[E,B]=u.useState(!1),H=u.useMemo(()=>s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:G=>G.spacing(.5),alignItems:"start"},children:[N,s.jsxs(Ti,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:G=>G.typography.fontFamily,fontSize:11*$.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:G=>`${G.shape.borderRadius}px`,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:G=>`solid ${v?G.palette.action.disabled:pt(G.palette.divider,.2)} 1px`,"& textarea":{color:G=>v?`${G.palette.text.disabled} !important`:G.palette.text.primary},"& .react-resizable-handle":{width:"100%",height:"8px",backgroundColor:"transparent",boxSizing:"content-box",zIndex:1e3},"& .react-resizable-handle-s":{position:"absolute",bottom:"-10px",cursor:"s-resize"}},onFocus:()=>B(!0),onBlur:()=>B(!1),onMouseDown:G=>{G.target?.classList.contains("react-resizable-handle")&&G.preventDefault()},children:[s.jsx(Ae,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:G=>G.spacing(1),paddingRight:G=>G.spacing(1)},children:s.jsx(tN.ResizableBox,{height:k,draggableOpts:{grid:[M,M]},minConstraints:[M,M],maxConstraints:[15*M,15*M],onResize:S,onResizeStop:C,resizeHandles:["s"],axis:"y",style:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:z})}),s.jsx(ii,{sx:{padding:"0px",margin:"0px 0px",border:"none !important","&.Mui-focusVisible":{border:"none"},"&:hover:not([disabled])":{border:"none"}},dense:!0,outlined:!1,"aria-label":"toggle-expand-formula-edit",icon:ze(s.jsx(T>1?sR:Lx,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:G=>{G.button===0&&G.preventDefault()},onClick:()=>{const G=T>1?1:_;j(G*M+1),D(G)}}),s.jsx(Ae,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:E?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:G=>G.palette.primary.main,borderRadius:G=>`${G.shape.borderRadius}px`}})]})]}),[N,z,E,T,M]),U=u.useMemo(()=>O||H?!O&&H?H:O&&!H?O:s.jsx(s.Fragment,{children:s.jsx(K5,{fixedPane:"before",minBefore:"165px",minAfter:"200px",paneBeforeProps:{style:{alignItems:"flex-start"}},paneAfterProps:{style:{overflow:"visible"}},resizerProps:{style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='6' height='13' viewBox='0 0 6 13' version='1.1' fill='${F.palette.text.icon??F.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='m 4.5961932,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.88365,0 -1.60005,-0.71626 -1.60005,-1.59991 0,-0.88365 0.7164,-1.6000508 1.60005,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60004 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 -0.88365,0 -1.60005,-0.7164 -1.60005,-1.60005 0,-0.88365 0.7164,-1.59991 1.60005,-1.59991 0.88364,0 1.59991,0.71626 1.59991,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center 6.5px",minWidth:"18px"}},elementBefore:O,elementAfter:H})}):null,[O,H]),Z=ir(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>A.current}),[]);return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",gap:G=>G.spacing(.5),...n},ref:Z,...f,children:U})}));zf.displayName="FormulaBar";const Ff=u.memo(u.forwardRef((e,t)=>{const{filter:n,commands:o,disabled:r,sx:i,floatReference:a,...l}=e,c=u.useMemo(()=>({}),[]),d=u.useMemo(()=>({commandHook:{beforeExecute:(h,g)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=u.useMemo(()=>({...c,...d,variant:Zt.Menuitem}),[c,d]),f=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{...p,command:o.getCommand("sortAscending"),icon:ze(s.jsx(ph,{}))}),s.jsx(Ge,{...p,command:o.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:o.getCommand("autoFilterClear"),icon:ze(s.jsx(V3,{}))}),[]]});return s.jsx(Ae,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",display:"flex",flexDirection:"column",...i},...l,children:f})}));Ff.displayName="FilterColumnMenu";const gC=u.memo(u.forwardRef((e,t)=>{const{children:n,className:o,disabled:r,style:i,filter:a,...l}=e,c=ir(t,()=>({isFilters:()=>!0}),[]);return s.jsx("div",{ref:c,className:Eo("filters",o),style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",...i},...l,children:s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",minHeight:"100px",minWidth:"220px",alignItems:"center",border:"grey solid 1px",padding:"4px 4px",overflow:"hidden",flexDirection:"column",justifyContent:"space-evenly",marginTop:"4px",marginBottom:"4px",marginLeft:"16px",marginRight:"16px"},children:[s.jsx("div",{children:a.getName()}),s.jsx("div",{children:"Filter Widget"})]})})}));gC.displayName="Filters";const Bf=u.memo(u.forwardRef((e,t)=>{const{children:n,sheet:o,style:r,className:i,value:a,index:l,editing:c,editable:d,disabled:p,selectedIndex:f,dragging:h,borderColor:g,borderWidth:m,activeColor:y,background:x="white",tabRadius:v=4,gridTheme:b,...w}=e,[M,k]=u.useState(()=>!!o&&o.getProtection().isLocked()),[j,_]=u.useState(()=>o?o.getTabColor():null);cn(o,{onProtectionChange:()=>{k(o.getProtection().isLocked())},onTabColorChange:()=>{_(o.getTabColor())},onStyleChange:()=>{_(o.getTabColor())}});const L=Ki(),T=f===l;let D=null,C=null;if(j||h){let P=x;j?(C=j.toBlackOrWhite().toCSS(),P=j?.toCSS()):T||(P=L.palette.background.paper),D=s.jsx(Ae,{sx:{position:"absolute",boxSizing:"border-box",top:"3px",left:"4px",right:"4.5px",bottom:"1.5px",opacity:T?"50%":"100%",borderRadius:"4px",border:I=>T?`${x} solid 1px`:`${I.palette.divider} solid 1px`,background:T&&j?`linear-gradient(0deg, ${P} 0%, transparent)`:P}})}let S=null;typeof g=="string"?S=g:g?.toCSS&&(S=g.toCSS());const R=T?s.jsx(Ae,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:P=>P.palette.primary.main}}):null;return s.jsx(hw,{theme:T?b??L:L,children:s.jsx(Ae,{ref:t,className:Eo(i),sx:{...r,display:"flex",flexDirection:"column",minHeight:"0px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",lineHeight:"1",textTransform:"none",minWidth:"unset",cursor:h?"grabbing":void 0},...w,children:s.jsx(oI,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?S:"transparent",children:s.jsx(zc,{sx:{textTransform:"none",borderRadius:"0px",minHeight:"0px",paddingLeft:"11px",paddingRight:"12px",paddingTop:"3px",flex:"1 1 100%",paddingBottom:"3px",fontWeight:T?"700":"400",fontSize:"0.85rem",letterSpacing:"0",transition:"none",cursor:h?"grabbing":void 0,color:T?"primary":C||"text.secondary",backgroundColor:T?x:"transparent","&:hover:not([disabled])":{backgroundColor:T?x:"transparent"},"& input":{color:P=>`${P.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:s.jsxs(s.Fragment,{children:[D,s.jsxs(Ae,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,R]}),M?s.jsx(S2,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):s.jsx(Ae,{sx:{minHeight:"22px"}})]})]})},a+":"+l)})})})}));Bf.displayName="SheetTab";const Nf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,index:o,commands:r,scope:i="sheet",disabled:a,floatReference:l,sx:c,className:d,tabStripRef:p,...f}=e,[h,g]=u.useState(n?.getProtection());cn(n,{onProtectionChange:b=>{g(b?.getProtection())}});const m=u.useMemo(()=>({}),[]),y=u.useMemo(()=>({commandHook:{beforeExecute:(b,w)=>l.closeAll(),onExecute(){},onError(){console.log("onError")}},scope:i,commandState:o,disabled:a||o===void 0,parentFloat:l}),[a,l]),x=u.useMemo(()=>({...m,...y}),[m,y]),v=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{command:r.getCommand("addSheet"),commandState:o,...x,variant:Zt.Menuitem}),s.jsx(Ge,{command:r.getCommand("deleteSheet"),...x,variant:Zt.Menuitem}),s.jsxs(Gr,{onMouseDown:b=>{b.button===0&&b.preventDefault()},onMouseUp:()=>{Promise.resolve(l.closeAll()).then(()=>{p?.startEdit(o)})},disabled:a||!h.isStructureAllowed(),parentFloat:l,children:["Rename",i!=="sheet"?" Sheet":""]}),s.jsx(Ge,{command:r.getCommand("duplicateSheet"),...x,variant:Zt.Menuitem}),s.jsx(Ge,{command:r?.getCommand("protectionSheetToggle"),...x,variant:Zt.Menuitem,icon:s.jsx(S2,{})}),s.jsx(Qs,{variant:Zt.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:s.jsx($3,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Os.End},parentFloat:l}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{command:r.getCommand("hideSheet"),...x,variant:Zt.Menuitem,icon:ze(s.jsx(rv,{}))})]});return s.jsx(Ae,{ref:t,className:Eo("menu",d),sx:{...c},...f,children:v})}));Nf.displayName="SheetTabMenu";const $f=u.memo(u.forwardRef((e,t)=>{const{workbook:n,gridStyle:o,floatReference:r,closeFloatAll:i,className:a,...l}=e,[c,d]=u.useState(n?.getSheets().search()),[p,f]=u.useState(n?.getProtection());cn(n,{onSheetsChange:g=>{d(g.getSheets().search())},onProtectionChange:g=>{f(g?.getProtection())}});const h=u.useMemo(()=>{const g=[],m=n.getSheets().search({visibility:$.ISheet.Visibility.Hidden}),y=n.getSelectedSheet();for(let x=0;x<m.length;x++){const v=m[x],b=v.getVisibility();if(b===$.ISheet.Visibility.VeryHidden)continue;const w=y===v,M=v.getProtection().isLocked(),k=v.getTabColor(),j=o?.body.fill??"transparent";let _=null,L=null,T=j;k&&(T=k.toCSS(),w||(L=k.toBlackOrWhite().toCSS()),_=s.jsx(Ae,{sx:{position:"absolute",display:"flex",flexDirection:"column",top:"4px",left:"40px",right:"8px",bottom:"4px",background:w?T:"transparent",borderRadius:"4px",border:`solid 1px ${o.header.edgeStrokeFill}`},children:s.jsx(Ae,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===$.ISheet.Visibility.Hidden?"50%":"100%",border:C=>w?`${j} solid 1.5px`:`${C.palette.divider} solid 1px`,background:w&&k?`linear-gradient(0deg, ${T} 0%, ${j})`:T,borderRadius:"4px"}})}));let D=null;M&&(D=s.jsx(S2,{color:"secondary"})),b!==$.ISheet.Visibility.Visible&&(D=ze(s.jsx(rv,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),D&&(D=s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:D})),g.push(s.jsx(Gr,{disabled:!p.isStructureAllowed()&&b===$.ISheet.Visibility.Hidden,sx:{color:C=>{let S=w?C.palette.primary.main:C.palette.text.secondary;return L&&(S=L),b===$.ISheet.Visibility.Hidden&&(S=pt(S,C.palette.action.disabledOpacity)),S},borderLeft:C=>`${w?C.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?s.jsx(E1,{}):void 0,onMouseDown:C=>C.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(C){console.error(C)}})},children:s.jsxs(s.Fragment,{children:[_,s.jsxs(Ae,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[s.jsxs(Ae,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),s.jsx(Ae,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),D]})]})},""+x))}return g},[n,p,c,r,o]);return s.jsx(Ae,{ref:t,className:Eo("menu",a),...l,children:h})}));$f.displayName="SheetsAllMenu";var oN=function(){},yC=typeof window<"u",rN=yC?u.useLayoutEffect:u.useEffect,oy={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const a1=yC&&window.ResizeObserver!==void 0?function(){var e=u.useState(null),t=e[0],n=e[1],o=u.useState(oy),r=o[0],i=o[1],a=u.useMemo(function(){return new window.ResizeObserver(function(l){if(l[0]){var c=l[0].contentRect,d=c.x,p=c.y,f=c.width,h=c.height,g=c.top,m=c.left,y=c.bottom,x=c.right;i({x:d,y:p,width:f,height:h,top:g,left:m,bottom:y,right:x})}})},[]);return rN(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[oN,oy]};function e2(){return e2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},e2.apply(null,arguments)}function Vf(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Hf(e,t){return(Hf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n})(e,t)}function xC(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hf(e,t)}function ry(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const bC=u.createContext(null);var vC=function(e){return e.scrollTop},uc="unmounted",yl="exited",xl="entering",hs="entered",Kh="exiting",va=function(e){function t(o,r){var i;i=e.call(this,o,r)||this;var a,l=r&&!r.isMounting?o.enter:o.appear;return i.appearStatus=null,o.in?l?(a=yl,i.appearStatus=xl):a=hs:a=o.unmountOnExit||o.mountOnEnter?uc:yl,i.state={status:a},i.nextCallback=null,i}xC(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===uc?{status:yl}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var r=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==xl&&i!==hs&&(r=xl):i!==xl&&i!==hs||(r=Kh)}this.updateStatus(!1,r)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o,r,i,a=this.props.timeout;return o=r=i=a,a!=null&&typeof a!="number"&&(o=a.exit,r=a.enter,i=a.appear!==void 0?a.appear:r),{exit:o,enter:r,appear:i}},n.updateStatus=function(o,r){if(o===void 0&&(o=!1),r!==null)if(this.cancelNextCallback(),r===xl){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this);i&&vC(i)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yl&&this.setState({status:uc})},n.performEnter=function(o){var r=this,i=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[yo.findDOMNode(this),a],c=l[0],d=l[1],p=this.getTimeouts(),f=a?p.appear:p.enter;o||i?(this.props.onEnter(c,d),this.safeSetState({status:xl},function(){r.props.onEntering(c,d),r.onTransitionEnd(f,function(){r.safeSetState({status:hs},function(){r.props.onEntered(c,d)})})})):this.safeSetState({status:hs},function(){r.props.onEntered(c)})},n.performExit=function(){var o=this,r=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:yo.findDOMNode(this);r?(this.props.onExit(a),this.safeSetState({status:Kh},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:yl},function(){o.props.onExited(a)})})})):this.safeSetState({status:yl},function(){o.props.onExited(a)})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,r){r=this.setNextCallback(r),this.setState(o,r)},n.setNextCallback=function(o){var r=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,r.nextCallback=null,o(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},n.onTransitionEnd=function(o,r){this.setNextCallback(r);var i=this.props.nodeRef?this.props.nodeRef.current:yo.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(i&&!a){if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=l[0],d=l[1];this.props.addEndListener(c,d)}o!=null&&setTimeout(this.nextCallback,o)}else setTimeout(this.nextCallback,0)},n.render=function(){var o=this.state.status;if(o===uc)return null;var r=this.props,i=r.children;r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef;var a=Vf(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return u.createElement(bC.Provider,{value:null},typeof i=="function"?i(o,a):u.cloneElement(u.Children.only(i),a))},t}(u.Component);function cs(){}va.contextType=bC,va.propTypes={},va.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:cs,onEntering:cs,onEntered:cs,onExit:cs,onExiting:cs,onExited:cs},va.UNMOUNTED=uc,va.EXITED=yl,va.ENTERING=xl,va.ENTERED=hs,va.EXITING=Kh;var u5=function(e,t){return e&&t&&t.split(" ").forEach(function(n){return r=n,void((o=e).classList?o.classList.remove(r):typeof o.className=="string"?o.className=ry(o.className,r):o.setAttribute("class",ry(o.className&&o.className.baseVal||"",r)));var o,r})},Gh=function(e){function t(){for(var o,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(o=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},o.onEnter=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1];o.removeClasses(p,"exit"),o.addClass(p,f?"appear":"enter","base"),o.props.onEnter&&o.props.onEnter(l,c)},o.onEntering=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1]?"appear":"enter";o.addClass(p,f,"active"),o.props.onEntering&&o.props.onEntering(l,c)},o.onEntered=function(l,c){var d=o.resolveArguments(l,c),p=d[0],f=d[1]?"appear":"enter";o.removeClasses(p,f),o.addClass(p,f,"done"),o.props.onEntered&&o.props.onEntered(l,c)},o.onExit=function(l){var c=o.resolveArguments(l)[0];o.removeClasses(c,"appear"),o.removeClasses(c,"enter"),o.addClass(c,"exit","base"),o.props.onExit&&o.props.onExit(l)},o.onExiting=function(l){var c=o.resolveArguments(l)[0];o.addClass(c,"exit","active"),o.props.onExiting&&o.props.onExiting(l)},o.onExited=function(l){var c=o.resolveArguments(l)[0];o.removeClasses(c,"exit"),o.addClass(c,"exit","done"),o.props.onExited&&o.props.onExited(l)},o.resolveArguments=function(l,c){return o.props.nodeRef?[o.props.nodeRef.current,l]:[l,c]},o.getClassNames=function(l){var c=o.props.classNames,d=typeof c=="string",p=d?(d&&c?c+"-":"")+l:c[l];return{baseClassName:p,activeClassName:d?p+"-active":c[l+"Active"],doneClassName:d?p+"-done":c[l+"Done"]}},o}xC(t,e);var n=t.prototype;return n.addClass=function(o,r,i){var a,l,c=this.getClassNames(r)[i+"ClassName"],d=this.getClassNames("enter").doneClassName;r==="appear"&&i==="done"&&d&&(c+=" "+d),i==="active"&&o&&vC(o),c&&(this.appliedClasses[r][i]=c,l=c,(a=o)&&l&&l.split(" ").forEach(function(p){return m=p,void((g=a).classList?g.classList.add(m):(f=g,h=m,(f.classList?!!h&&f.classList.contains(h):(" "+(f.className.baseVal||f.className)+" ").indexOf(" "+h+" ")!==-1)||(typeof g.className=="string"?g.className=g.className+" "+m:g.setAttribute("class",(g.className&&g.className.baseVal||"")+" "+m))));var f,h,g,m}))},n.removeClasses=function(o,r){var i=this.appliedClasses[r],a=i.base,l=i.active,c=i.done;this.appliedClasses[r]={},a&&u5(o,a),l&&u5(o,l),c&&u5(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Vf(o,["classNames"]);return u.createElement(va,e2({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(u.Component);Gh.defaultProps={classNames:""},Gh.propTypes={};const wC={Light:"light",Dark:"dark"},p5=.12,Zh=(e,t)=>{const n={},o=c=>{const d=c.palette?.background.default??"rgba(255,255,255,1)";return{text:{fontFamily:c.typography?.fontFamily??"Calibri",fontSize:c.typography?.fontSize??8.25,fontWeight:c.typography?.fontWeightRegular??"400",fill:c.palette.mode==="dark"?c.palette?.text?.secondary:c.palette?.text?.primary},fill:d,strokeFill:mi(d,p5,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:mi(n.body.fill,p5,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:mi(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:mi(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:mi(c?.fill??n.body.fill,.22,e.palette?.mode),fill:mi(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=mi(e.palette.mode!=="dark"?e.palette.primary.light:e.palette.primary.main,.055,e.palette?.mode);n.headerSelect={...n.header,strokeFill:e.palette.primary.main,fill:pt(i,.2),text:{...n.header.text,fill:e.palette.primary.main},dividerStrokeFill:pt(i,.7)},n.headerSelectAll={...n.headerSelect,fill:pt(i,.9),text:{...n.headerSelect.text,fill:e.palette.primary.contrastText},edgeStrokeFill:n.headerSelect.strokeFill},n.buttonSurface={...r,strokeFill:mi(r.fill,p5,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:mi(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:mi(r.fill,.328,t.palette?.mode)},n.headerSelection={fill:e.palette?.primary?.main?pt(e.palette?.primary?.main,.1):void 0,strokeFill:e.palette?.primary?.main},n.headerSelectionInactive={...n.headerSelection,fill:e.palette?.divider?pt(e.palette?.divider,.05):void 0,strokeFill:"transparent"};const a=t??e,l=a.palette.mode==="dark";return n.selection={fill:a.palette?.primary?.main?pt(a.palette?.primary?.main,.1):void 0,strokeFill:a.palette?.primary?.main},n.selectionInactive={...n.selection,fill:a.palette?.divider?pt(a.palette?.divider,.05):void 0,strokeFill:"transparent"},n.selectionRemove={...n.selection,fill:pt(a.palette.warning.light,.05),strokeFill:a.palette.warning.dark},t&&(n.body=o(t)),n.colorShadow=pt(a.palette.action.active,.5),n.colorGrey=a.palette.action.active,n.filterDarkInvert=l?"hue-rotate(180deg) invert(1) brightness(95%)":"none",n};function SC(e){const{mode:t}=e||{},[n,o]=u.useState(()=>{if(t==="light"||t==="dark")return{themeMode:t,source:"prop"};if(typeof document<"u"){const r=iy();if(r)return{themeMode:r,source:"class"}}return{themeMode:ay(),source:"media"}});return u.useEffect(()=>{if(t&&t!==n?.themeMode)return void o({themeMode:t,source:"prop"});const r=()=>{const c=iy();if(c)o({themeMode:c,source:"class"});else{const d=ay();o({themeMode:d,source:"media"})}},i=new MutationObserver(r),a=[document.documentElement,document.body].filter(Boolean);for(const c of a)i.observe(c,{attributes:!0,attributeFilter:["class"]});const l=window.matchMedia("(prefers-color-scheme: dark)");return l.addEventListener("change",r),r(),()=>{i.disconnect(),l.removeEventListener("change",r)}},[t]),n}function iy(){if(typeof document>"u")return null;const e=[...Array.from(document.body.classList),...document.documentElement?Array.from(document.documentElement.classList):[]];return e.includes("dark")?"dark":e.includes("light")?"light":null}function ay(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const l1=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=ir(t,()=>({}),[]),[l,c]=a1(),d=u.useRef(null),p=u.useRef(null),[f,h]=u.useReducer(k=>k+1,0),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),{reference:w}=ha({parentFloat:r,label:"overflow"});u.useLayoutEffect(()=>{p.current={refs:[]};const k=[],j=u.Children.toArray(n);let _=0;j.forEach((L,T)=>{k.push(s.jsx(Ae,{sx:{display:"flex"},ref:D=>{_++,_===j.length&&h();const C={current:null};C.current=D,p.current.refs[T]=C},children:L},T))}),m(k)},[n,c]),u.useLayoutEffect(()=>{if(!g)return;const k=p.current.refs;if(!a.current||!k||k.length===0)return x(null),void b(null);const j=a.current?.getBoundingClientRect(),_=[],L=[];let T=0,D=!1;for(let S=0;!D&&S<k.length;S++){const R=k[S];if(!R)continue;if(!R.current){D=!0;continue}const P=R.current.getBoundingClientRect();T+=P?.width,T>j.width&&(D=!0)}if(!D)return x(null),void b([]);const C=d.current?.getBoundingClientRect();T=0;for(let S=0;S<k.length;S++){const R=k[S];let P=!1;if(R.current){const I=R.current.getBoundingClientRect();T+=I?.width,T<j.width-C.width&&(P=!0)}P?_.push(g[S]):L.push(g[S])}x(_.length>0?_:null),b(L.length>0?L:null)},[n,g,c,w,f]);const M=Te(k=>{const j=[];for(let L=0;L<v.length;L++){let T=u.Children.toArray(v[L]);const D=T[0];T=u.Children.toArray(D.props.children?.props.children??D.props.children);const C=T[0],S={...C.props};S.parentFloat&&(S.parentFloat=k.floatReference);const R=u.cloneElement(C,S);j.push(R)}const _=s.jsx(Ae,{className:"overflow-palette-popup-panel",sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",paddingTop:L=>L.spacing(.5),paddingBottom:L=>L.spacing(.5),paddingLeft:L=>L.spacing(1),paddingRight:L=>L.spacing(1),overflow:"hidden"},children:j});return Bn({...k,children:_})},[v]);return s.jsxs(Ae,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:W2([a,l,t]),...i,children:[s.jsx(Ae,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:y??g}),s.jsx(Ae,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:s.jsx(qi,{createPopupPanel:M,ref:d,parentFloat:w,createTooltip:({children:k},j)=>s.jsx(br,{label:"More",description:"More toolbar options…",disabled:j,children:k}),icon:s.jsx(Wb,{children:s.jsx(pR,{})})})})]})})),CC="https://unpkg.com/@sheetxl/scripting-templates/dist",iN=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DIXyMJKaeCGuWxjZ.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DGQrcBvjSGwwoZEv.cjs"))).fromBufferCSV(e,t)},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D9RQ5oYv7U38wSI7.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],aN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DIXyMJKaeCGuWxjZ.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DGQrcBvjSGwwoZEv.cjs"))).toBufferCSV(e,t)},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./D9RQ5oYv7U38wSI7.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class kC{constructor(t=iN,n=aN){this._readFormatTypes=[],this._writeFormatType=[],this._readFormatTypes=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}_detectImportSourceType(t){return t&&typeof t=="object"&&"base64"in t?"base64":t&&typeof t=="object"&&"input"in t?"fetch":typeof t=="string"?t.startsWith("data:")?"base64":(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../"),"fetch"):typeof File<"u"&&t instanceof File?"file":t instanceof ArrayBuffer||ArrayBuffer.isView(t)?"buffer":typeof ReadableStream<"u"&&t instanceof ReadableStream?"stream":null}getReadFormats(){return this._readFormatTypes}getWriteFormats(){return this._writeFormatType}getReadFormatTypeForKey(t){return this._readFormatTypes.find(n=>n.key.includes(t))??null}getReadFormatTypeForExt(t){return t=t.toLowerCase(),this._readFormatTypes.find(n=>n.exts.includes(t))??null}getReadFormatTypeForMimeType(t){return this._readFormatTypes.find(n=>n.mimeType===t)??null}getWriteFormatTypeForExt(t){return t=t.toLowerCase(),this._writeFormatType.find(n=>n.ext===t)??null}getWriteFormatType(t){t=t.toLowerCase();let n=this._writeFormatType.find(o=>o.ext===t)??null;return n||(n=this._writeFormatType.find(o=>o.key.toLowerCase()===t)??null,n||(this._writeFormatType.find(o=>o.mimeType.toLowerCase()===t)??null))}getAllReadFormatTypeAsString(){const t=[];for(let n=0;n<this._readFormatTypes.length;n++)t.push(this._readFormatTypes[n].mimeType);return t}async toArrayBuffer(t,n,o){const r=this.getWriteFormatType(n);if(!r)throw new Error(`Invalid export type for '${n}'.`);try{const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r.description??n}.`);return i(t,o)}catch(i){throw new Error(`Unable to load handler for '${n}.'`,{cause:i})}}async _fromArrayBuffer(t,n,o=null){let r=this.getReadFormatTypeForKey(n)??this.getReadFormatTypeForExt(n)??this.getReadFormatTypeForMimeType(n);if(!t||!r){if(!t)throw new Error("ArrayBuffer must be specified.");if(!n)throw new Error("formatKey must be specified.")}const i=r.handler;if(!i)throw new Error(`Unable to resolve handler for type: ${r?.description??n}.`);const a={...o,...o?.typedCreateWorkbookOptions?.[n]};let l;delete a.typedCreateWorkbookOptions;try{l=await i(t,a)}catch(c){throw new Error("Unable to import",{cause:c})}return l}async read(t){if(!t)throw new Error("'options' must be provided for load.");let n=t.source;if(!n)throw new Error("'options.source' must be provided for load.");const o=t.name,r=t.formatType;typeof n=="function"&&(n=n()),n&&typeof n=="object"&&typeof n.then=="function"&&(n=await Promise.resolve(n));const i=this._detectImportSourceType(n);if(!i)throw new Error("Unable to detect source type from provided input.");switch(i){case"file":{const a=n;return await this._fromFile(a,t)}case"base64":{let a;if(n&&typeof n=="object"&&"base64"in n)a=n.base64;else if(typeof n=="string"&&n.startsWith("data:")){const[,d]=n.split(",");a=d}else a=n;const l=jR.base64ToArrayBuffer(a),c=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!c)throw new Error("No import type available for base64 input.");return{workbook:await this._fromArrayBuffer(l,c.key,t),title:o||"imported-file",formatType:c}}case"fetch":{let a,l,c=null;if(typeof n=="string")c=n;else{if(!n||typeof n!="object"||!("input"in n))throw new Error("Invalid fetch source provided.");{const y=n;c=y.input,a=y.init,l=y.timeout}}const d=l||3e4,p=new AbortController,f=setTimeout(()=>p.abort(),d),h=typeof c=="string"?c:c.toString(),g=r||$.TextUtils.getFileNameExtension(h),m=this.getReadFormatTypeForExt(g)||this._readFormatTypes[0];try{const y=await fetch(c,{...a,signal:p.signal});if(clearTimeout(f),!y.ok)throw new Error(`Failed to fetch: ${y.status} ${y.statusText}`);const x=await y.arrayBuffer();if(!m)throw new Error(`Unable to determine import type for fetched content: ${h}`);return{workbook:await this._fromArrayBuffer(x,m.key,t),title:o||$.TextUtils.getBaseName(h,!0)||"fetched-file",formatType:m}}catch(y){throw clearTimeout(f),y.name==="AbortError"?new Error(`Fetch timeout after ${d}ms: ${h}`):y}}case"buffer":{const a=n,l=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!l)throw new Error("No import type available for buffer input.");return{workbook:await this._fromArrayBuffer(a,l.key,t),title:o||"buffer-file",formatType:l}}case"stream":{const a=n.getReader(),l=[];let c=0;try{for(;;){const{done:g,value:m}=await a.read();if(g)break;l.push(m),c+=m.length}}finally{a.releaseLock()}const d=new ArrayBuffer(c),p=new Uint8Array(d);let f=0;for(const g of l)p.set(g,f),f+=g.length;const h=this.getReadFormatTypeForExt(r)||this._readFormatTypes[0];if(!h)throw new Error("No import type available for stream input.");return{workbook:await this._fromArrayBuffer(d,h.key,t),title:o||"stream-file",formatType:h}}default:throw new Error(`Unsupported source type: ${i}`)}}async _fromFile(t,n=null){let o=null;try{let r="";t?.name&&(r=`${$.TextUtils.getBaseName(t.name)}`);const i=this.getReadFormatTypeForExt($.TextUtils.getFileNameExtension(t?.name));if(!i)throw new Error(`Unknown file type: ${$.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);const a=await t.arrayBuffer(),l={...n,...n?.typedCreateWorkbookOptions?.[i.key]};delete l.typedCreateWorkbookOptions;const c=i.handler;if(!c)throw new Error(`Unable to resolve handler for type: ${i?.description??$.TextUtils.getFileNameExtension(t?.name)??t?.name??"(empty)"}.`);await l.onStart?.(r);const d=await c(a,l);o=new lN(t,d,r,i)}catch(r){throw r}return o}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");if(!n.isIWorkbook)throw new Error("Invalid workbook model provided. Must be an instance of IWorkbook.");const r=$.TextUtils.getFileNameExtension(t);r&&(t=t.slice(0,t.length-r.length-1));let i=null;o?.formatType&&(i=this.getWriteFormatType(o.formatType));const a=this.getWriteFormats(),l=a.length;for(let p=0;!i&&p<l;p++)(a[p].ext===r||!r&&a[p].isDefault)&&(i=a[p]);if(!i)throw new Error(`Unable to determine export type for '${t}'.`);const c=t+"."+i.ext;let d=null;try{d=await this.toArrayBuffer(n,i.key)}catch(p){throw typeof p=="string"?new Error(p):p}try{await(async(p,f)=>{let h;typeof SharedArrayBuffer<"u"&&f instanceof SharedArrayBuffer?(h=new ArrayBuffer(f.byteLength),new Uint8Array(h).set(new Uint8Array(f))):h=f,function(g,m){const y=URL.createObjectURL(g),x=document.createElement("a");x.style.display="none",x.href=y,x.download=m,document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(y)}(new Blob([h],{type:"application/octet-stream"}),p)})(c,d)}catch(p){throw new Error("Unable to write file.",{cause:p})}return!0}}class lN{constructor(t,n,o,r){this.file=t,this.workbook=n,this.title=o,this.formatType=r}get[Symbol.toStringTag](){return"[WorkbookHandle]"}toString(){return`'${this.file.name}' ${this.file.size} (${this.formatType.description})`}}const sN=new kC;var ly,sy,cN=function(){if(sy)return ly;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,r){for(var i,a="",l=0,c=-1,d=0,p=0;p<=o.length;++p){if(p<o.length)i=o.charCodeAt(p);else{if(i===47)break;i=47}if(i===47){if(c!==p-1&&d!==1)if(c!==p-1&&d===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var f=a.lastIndexOf("/");if(f!==a.length-1){f===-1?(a="",l=0):l=(a=a.slice(0,f)).length-1-a.lastIndexOf("/"),c=p,d=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=p,d=0;continue}}r&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),l=p-c-1;c=p,d=0}else i===46&&d!==-1?++d:d=-1}return a}sy=1;var n={resolve:function(){for(var o,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var l;a>=0?l=arguments[a]:(o===void 0&&(o=process.cwd()),l=o),e(l),l.length!==0&&(r=l+"/"+r,i=l.charCodeAt(0)===47)}return r=t(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(o){if(e(o),o.length===0)return".";var r=o.charCodeAt(0)===47,i=o.charCodeAt(o.length-1)===47;return(o=t(o,!r)).length!==0||r||(o="."),o.length>0&&i&&(o+="/"),r?"/"+o:o},isAbsolute:function(o){return e(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(o===void 0?o=i:o+="/"+i)}return o===void 0?".":n.normalize(o)},relative:function(o,r){if(e(o),e(r),o===r||(o=n.resolve(o))===(r=n.resolve(r)))return"";for(var i=1;i<o.length&&o.charCodeAt(i)===47;++i);for(var a=o.length,l=a-i,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var d=r.length-c,p=l<d?l:d,f=-1,h=0;h<=p;++h){if(h===p){if(d>p){if(r.charCodeAt(c+h)===47)return r.slice(c+h+1);if(h===0)return r.slice(c+h)}else l>p&&(o.charCodeAt(i+h)===47?f=h:h===0&&(f=0));break}var g=o.charCodeAt(i+h);if(g!==r.charCodeAt(c+h))break;g===47&&(f=h)}var m="";for(h=i+f+1;h<=a;++h)h!==a&&o.charCodeAt(h)!==47||(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(c+f):(c+=f,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(o){return o},dirname:function(o){if(e(o),o.length===0)return".";for(var r=o.charCodeAt(0),i=r===47,a=-1,l=!0,c=o.length-1;c>=1;--c)if((r=o.charCodeAt(c))===47){if(!l){a=c;break}}else l=!1;return a===-1?i?"/":".":i&&a===1?"//":o.slice(0,a)},basename:function(o,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');e(o);var i,a=0,l=-1,c=!0;if(r!==void 0&&r.length>0&&r.length<=o.length){if(r.length===o.length&&r===o)return"";var d=r.length-1,p=-1;for(i=o.length-1;i>=0;--i){var f=o.charCodeAt(i);if(f===47){if(!c){a=i+1;break}}else p===-1&&(c=!1,p=i+1),d>=0&&(f===r.charCodeAt(d)?--d===-1&&(l=i):(d=-1,l=p))}return a===l?l=p:l===-1&&(l=o.length),o.slice(a,l)}for(i=o.length-1;i>=0;--i)if(o.charCodeAt(i)===47){if(!c){a=i+1;break}}else l===-1&&(c=!1,l=i+1);return l===-1?"":o.slice(a,l)},extname:function(o){e(o);for(var r=-1,i=0,a=-1,l=!0,c=0,d=o.length-1;d>=0;--d){var p=o.charCodeAt(d);if(p!==47)a===-1&&(l=!1,a=d+1),p===46?r===-1?r=d:c!==1&&(c=1):r!==-1&&(c=-1);else if(!l){i=d+1;break}}return r===-1||a===-1||c===0||c===1&&r===a-1&&r===i+1?"":o.slice(r,a)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return i=(r=o).dir||r.root,a=r.base||(r.name||"")+(r.ext||""),i?i===r.root?i+a:i+"/"+a:a;var r,i,a},parse:function(o){e(o);var r={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return r;var i,a=o.charCodeAt(0),l=a===47;l?(r.root="/",i=1):i=0;for(var c=-1,d=0,p=-1,f=!0,h=o.length-1,g=0;h>=i;--h)if((a=o.charCodeAt(h))!==47)p===-1&&(f=!1,p=h+1),a===46?c===-1?c=h:g!==1&&(g=1):c!==-1&&(g=-1);else if(!f){d=h+1;break}return c===-1||p===-1||g===0||g===1&&c===p-1&&c===d+1?p!==-1&&(r.base=r.name=d===0&&l?o.slice(1,p):o.slice(d,p)):(d===0&&l?(r.name=o.slice(1,c),r.base=o.slice(1,p)):(r.name=o.slice(d,c),r.base=o.slice(d,p)),r.ext=o.slice(c,p)),d>0?r.dir=o.slice(0,d-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ly=n}();const cy=/^(con|prn|aux|nul|com\d|lpt\d)$/i,dy=/[<>:"/\\|?*\u0000-\u001F]/g,Ml=Object.freeze(Object.defineProperty({__proto__:null,MAX_WORKBOOK_NAME_SIZE:96,WINDOW_FILENAME_CHAR_RESERVED_REGEX:dy,WINDOW_FILENAME_RESERVED_REGEX:cy,isValidWindowsFilename:e=>!(!e||e.length>255||dy.test(e)||cy.test(e)||e==="."||e===".."),relativePath:(e,t)=>{try{return new URL(t),t}catch{}if(t.startsWith("/")||/^[a-zA-Z]:/.test(t))return t;if(typeof window>"u"||window.document===void 0){if(typeof require<"u"&&typeof process<"u")return cN.Path.resolve(e,t);throw new Error("Unsupported environment")}try{let n=e.startsWith("http")?e:`file:///${e.replace(/\\/g,"/")}`;return n.endsWith("/")||(n+="/"),new URL(t,n).href}catch{const n=document.createElement("a");let o=e;return o.endsWith("/")||(o+="/"),n.href=new URL(t,o).href,n.href}}},Symbol.toStringTag,{value:"Module"})),uy=Object.freeze(Object.defineProperty({__proto__:null,DefaultWorkbookIO:kC,IOUtils:Ml,WorkbookIO:sN},Symbol.toStringTag,{value:"Module"})),dN=e=>{if(e.metadata?.name)return e.metadata.name;let t=(e.path.split("/").pop()||"").replace(/\.[^/.]+$/,"");return e.metadata?.icon==="formula"?t.toUpperCase():(t=t.replace(/([a-z])([A-Z])/g,"$1 $2"),t.replace(/[-_]/g," ").trim().split(/\s+/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "))},EC=async e=>{const t=Ml.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new $5(`Failed to retrieve directory at '${e}': ${n.statusText}`);const o=await n.text();if(o.trim().toLowerCase().startsWith("<!doctype html")||o.trim().toLowerCase().startsWith("<html"))throw new $5(`Failed to retrieve directory at '${e}'`);let r;try{r=JSON.parse(o)}catch(a){throw new Error(`Failed to parse directory: ${a.message}. Ensure the file is valid JSON.`)}const i=r.map(async a=>{try{const l=Ml.relativePath(e,a.path),c=await fetch(l);if(!c.ok)throw new Error(`Failed to fetch file at '${a.path}': ${c.statusText}`);const d=await c.text();let p=a.metadata;return p?.title||(p={title:dN(a),...p}),{path:a.path,content:d,metadata:p}}catch(l){console.error(l.message)}return null});return(await Promise.all(i)).filter(a=>a!==null)},h5={fontSize:"0.8rem",marginRight:"4px"},uN=u.memo(e=>{const{disabled:t,snippet:n,description:o,handleInsert:r,sx:i,...a}=e;let l;return l=n.metadata?.icon==="formula"?s.jsx(lv,{sx:h5}):n.metadata?.icon==="macro"?s.jsx(G3,{sx:h5}):s.jsx(zx,{sx:h5}),s.jsx(Gr,{sx:{maxWidth:"460px",display:"flex","*":{lineHeight:"1.2"},...i},disabled:t,icon:l,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(n)},onKeyDown:c=>{c.keyCode!==on.Enter&&c.keyCode!==on.Space||r(n)},...a,children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsx(Tn,{component:"div",children:n.metadata?.title??n.path}),s.jsx(Tn,{variant:"caption",component:"div",sx:{color:c=>pt(c.palette.text.secondary??c.palette.text.primary,.6),overflow:"hidden",textOverflow:"ellipsis"},children:n.metadata?.summary})]})})}),MC=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,scriptPath:a=CC,...l}=e,[c,d]=u.useState([]),[p,f]=u.useState(!0),h=_o(n,["executeSelectedScript"]),g=h[0]?.context?.();u.useEffect(()=>{(async()=>{try{const y=await EC(a);d(y)}catch{}finally{f(!1)}})()},[a]);const m=u.useCallback((y,x)=>{if(p)return s.jsx("div",{children:"Loading..."});const v={variant:Zt.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=k=>{g.getEditor()?.insertSnippet(k.content),y.closeFloat()},w=[];for(let k=0;k<c.length;k++){const j=c[k];j&&w.push(s.jsx(uN,{handleInsert:b,snippet:j},j.path))}const M=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[w.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:w}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(Ge,{...v,key:"help",command:n.getCommand("help"),icon:ze(s.jsx(iv,{}))})]});return Bn({...y,children:M})},[i,o,r,p,g]);return s.jsx(Xn,{ref:t,commands:n,disabled:i,commandHook:o,scope:r,label:"Insert Script",tooltip:"Inserts a script from a set of templates.",createPopupPanel:m,icon:ze(s.jsx(MD,{})),...l})})),Wf=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsx(s.Fragment,{children:s.jsxs("div",{style:{display:"flex",flex:"1 1 100%"},children:[s.jsx("div",{children:s.jsx(l1,{parentFloat:o,style:{},children:s.jsx(Ge,{...c,command:n.getCommand("saveScripts"),icon:ze(s.jsx(TD,{}))})})}),s.jsx("div",{style:{flex:"1 1 100%"}}),s.jsx("div",{children:s.jsx(l1,{parentFloat:o,style:{},children:s.jsx(MC,{...c,commands:n})})})]})})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));Wf.displayName="ScriptEditorToolbar";const f5={fontSize:"1rem"},TC=u.memo(u.forwardRef((e,t)=>{const{scriptPath:n=CC,onScriptSelect:o,sx:r=jn.EmptyCssProperties,className:i,buttonMinWidth:a=210,buttonMinHeight:l=80,gap:c=12,...d}=e,[p,f]=u.useState([]),[h,g]=u.useState(!0),[m,y]=u.useState(null);if(u.useEffect(()=>{(async()=>{const b=[{path:null,metadata:{title:"Blank Template...",summary:"Start with an empty script."},content:""}];try{g(!0),y(null);const w=await EC(n);for(let M=0;M<w.length;M++){const k=w[M];k&&b.push(k)}}catch(w){y(w instanceof Error?w.message:"Failed to load scripts"),w instanceof $5||console.error("Error loading scripts:",w)}finally{f(b),g(!1)}})()},[n]),h)return s.jsx(Ae,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",className:Eo(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...r},...d,children:s.jsx(h3,{})});let x=null;m&&(x=s.jsxs(Ae,{display:"flex",justifyContent:"center",alignItems:"center",className:Eo(i,"script-select","error-results"),sx:{background:b=>b.palette.error.light,flex:"0",zIndex:1e3,flexDirection:"column",padding:b=>b.spacing(1),border:b=>`1px solid ${b.palette.error.main}`,borderBottomLeftRadius:1,borderBottomRightRadius:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...d,children:[s.jsx(Tn,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),s.jsx(Tn,{color:"error",component:"div",children:m})]}));const v=b=>{const w=b.metadata?.icon;return w==="macro"?s.jsx(G3,{sx:f5}):w==="formula"?s.jsx(lv,{sx:f5}):w==="autostart"?s.jsx(zx,{sx:f5}):null};return s.jsxs(Ae,{ref:t,className:Eo(i,"script-select"),sx:{background:b=>b.palette.background.paper,zIndex:1e3,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,...r},...d,children:[s.jsxs(Ae,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[s.jsx(Tn,{variant:"h6",gutterBottom:!0,children:"Script Template"}),s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Choose from a template to provide a starting point to automate tasks or create user defined functions."}),s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),s.jsx(Ae,{sx:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:`${c}px`,padding:2,paddingLeft:"0px",paddingRight:"0px"},children:p.map((b,w)=>s.jsxs(zc,{variant:"outlined",sx:{minWidth:a,minHeight:l,display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",textAlign:"left",padding:2,textTransform:"none",overflow:"hidden",...w===0&&{borderStyle:"dashed",marginBottom:"8px"},...w===1&&{gridColumn:"1"}},onClick:()=>o?.(b),children:[s.jsxs(Ae,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[s.jsx(Tn,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&s.jsx(Tn,{variant:"body2",component:"div",color:"text.secondary",sx:{overflow:"hidden",display:"flex",flexDirection:"column",textOverflow:"ellipsis",alignItems:"flex-start"},children:b.metadata.summary})]},`${b.path}-${w}`))})]}),x]})}));TC.displayName="TemplateSelectPanel";const Uf=u.memo(u.forwardRef((e,t)=>{const{className:n,sx:o,editorProps:r,commands:i,readOnly:a=!1,onClose:l,autoFocusSel:c,autoFocus:d=!0,scripts:p,...f}=e,h=Ki(),[g,m]=u.useState(!1),y=u.useRef(!1),[x,v]=u.useState({message:"Loading",cursor:"",dirty:!1}),[b,w]=u.useState(null);u.useEffect(()=>{let O=!1;return w(null),async function(){if(p&&(await p.start(),!O)){const N=p.getModules().search()[0]?.getSource();w({source:N||null})}}(),()=>{O=!0}},[p]);const M=u.useCallback(O=>{v(N=>({...N,...O}))},[]),k=u.useRef(null),j=u.useRef(null),[_,L]=u.useState(null),T=u.useRef(null),D=Te(O=>{if(_)return _.focus(O),!0;if(c){const N=j.current?.querySelectorAll?.(c);if(N&&N.length>0)return N[0]?.focus?.(O),!0}return j.current?.focus?.(O),!1},[_,c,d]),C=u.useMemo(()=>s.jsx(Gl,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),S=u.useMemo(()=>s.jsx(Ti,{elevation:1,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,marginLeft:O=>O.spacing(.5),marginRight:O=>O.spacing(.5),marginTop:O=>O.spacing(1),marginBottom:O=>O.spacing(1)},children:s.jsx(Wf,{commands:i})}),[h,i]),R=u.useMemo(()=>s.jsx(Ae,{className:Eo("script-status-panel","status-panel"),sx:{display:"flex",alignItems:"stretch",flexDirection:"row",flex:"0",paddingLeft:"12px",paddingRight:"12px",gap:"8px",paddingTop:"1px",minHeight:"calc(1em + 8px)",margin:0,borderTop:`solid 1px ${h.palette.divider}`},children:s.jsxs("div",{style:{flex:"1 1 100%",display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"center"},children:[s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:O=>O.palette.text.secondary},variant:"caption",children:x.message}),s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:O=>O.palette.text.secondary},variant:"caption",children:x.dirty?"Unsaved":""}),s.jsx(Tn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:O=>O.palette.text.secondary},variant:"caption",children:x.cursor})]})}),[x]),P=u.useMemo(()=>s.jsxs(Ae,{className:Eo("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[S,s.jsx(Ae,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:s.jsx(HB,{ref:j,loadingPanel:C,readOnly:a,onClose:l,autoFocus:d,commands:i,onStatusChange:M,darkMode:h.palette.mode==="dark",...r})}),R]}),[h,i,S,R,g,C,a,r,d,c,l,M]),I=u.useMemo(()=>s.jsx(Mx,{className:Eo({"Mui-selected":y.current}),sx:{display:"flex",color:O=>O.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:O=>`${O.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:O=>O.transitions.duration.shortest/2+"ms"},backgroundColor:O=>pt(O.palette.action.hover,.03),borderBottom:O=>`solid ${pt(O.palette.divider,.2)} 1px`},onPointerDown:O=>{O.isDefaultPrevented()||(O.preventDefault(),D())},children:s.jsxs(Ae,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:O=>O.spacing(.25),marginBottom:O=>O.spacing(.25),marginLeft:O=>O.spacing(1),marginRight:O=>O.spacing(1)},children:[s.jsx(Ae,{sx:{flex:"1 1 100%",paddingLeft:O=>O.spacing(1)},children:"Script (Typescript)"}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:O=>O.palette.text.icon??O.palette.action.active},touchRippleRef:k,onPointerDown:O=>{k.current?.start(O,{center:!1}),O.stopPropagation(),O.preventDefault()},onPointerUp:()=>{j.current?.close()},children:s.jsx(M3,{})})})]})}),[h,g]),z=u.useMemo(()=>{let O;return b===null?null:(b.source===null&&(O=s.jsx(TC,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:N=>{j.current?.getEditor().insertSnippet(N.content),w({source:N.content??""})}})),s.jsxs(Ae,{tabIndex:0,className:Eo("script-workspace",n),sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",alignItems:"stretch",userSelect:"none",flexGrow:0,outline:"none",backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},onPointerDown:N=>{N.isDefaultPrevented()||j.current?.focus()},children:[I,s.jsxs(Ae,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[P,O]})]}))},[S,P,n,b]),A=ir(t,()=>({isScriptWorkspaceElement:()=>!0,focus:O=>{D(O)}}),[]);return s.jsx(Ae,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,onFocus:O=>{m(!0),y.current=!0,A.current?.contains(O.target)&&O.target!==A.current&&L(O.target),O.relatedTarget&&!T.current&&(T.current=O.relatedTarget),f?.onFocus?.(O)},onBlur:O=>{A?.current?.contains(O.relatedTarget)||A?.current===O.relatedTarget||(T.current=null,y.current=!1,m(!1)),f?.onBlur?.(O)},children:z})}));Uf.displayName="ScriptWorkspace";const qf=u.memo(u.forwardRef((e,t)=>{const{commands:n,commandHook:o,scope:r,disabled:i=!1,...a}=e,l=_o(n,["executeScript"])[0].context();_o(n,["showScriptEditor"]);const c=u.useCallback((d,p)=>{const f={variant:Zt.Menuitem,commandHook:o,scope:"scripts",disabled:i,shortcut:null},h=l?.getScripts(),g=h?.searchFunction({type:"macro"}),m=[];if(g)for(let x=0;x<g.length;x++){const v=g[x];m.push(s.jsx(Ge,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ze(s.jsx(G3,{})),label:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${x}`))}const y=s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[m.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ae,{sx:{overflow:"auto",flex:"1 1 100%"},children:m}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(Ge,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ze(s.jsx(xD,{}))})]});return Bn({...d,children:y})},[i,l,o,r]);return s.jsx(Xn,{ref:t,commands:n,commandHook:o,createPopupPanel:c,selected:n.getCommand("showScriptEditor").state(),label:"Macros",tooltip:"Run or manage macros.",quickCommand:"showScriptEditor",icon:ze(s.jsx(ED,{})),...a})})),pN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_o(n,["executeScript","showScriptEditor"]),l=a[0]?.context?.(),c=u.useCallback(d=>{const{commandButtonProps:p,commandPopupProps:f}=d,h=s.jsx(Qs,{...f,command:n.getCommand("formatFontColor"),icon:s.jsx(MP,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=s.jsx(Qs,{...f,command:n.getCommand("formatFillColor"),icon:s.jsx(EP,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Os.End}}),m=n.getCommand("undo")?s.jsx(s.Fragment,{children:s.jsx(_f,{...f,quickCommand:"undo"})}):null,y=n.getCommand("find")?s.jsx(s.Fragment,{children:s.jsx(HS,{...f})}):null;let x=null;const v=l?.getScripts();if(a[1]?.state?.()||v){let b=a[1]?.state?.();const w=v?.searchFunction({type:"macro"});for(let M=0;w&&!b&&M<w?.length;M++)b=!0;b&&(x=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{}),s.jsx(qf,{...f})]}))}return s.jsxs(l1,{parentFloat:o,children:[m,null,m?s.jsx(Ft,{}):null,s.jsx(jf,{...f,command:n.getCommand("paste")}),s.jsx(Ge,{...p,command:n.getCommand("formatPainterToggle"),icon:ze(s.jsx(DO,{}))}),s.jsx(H2,{...p,command:n.getCommand("copy")}),s.jsx(Ft,{}),s.jsx(ZS,{...f,command:n.getCommand("formatFontFamily")}),s.jsx(WS,{...f,command:n.getCommand("formatFontSize")}),s.jsx(Ge,{...p,command:n.getCommand("formatBoldToggle"),icon:s.jsx(OI,{})}),s.jsx(Ge,{...p,command:n.getCommand("formatItalicToggle"),icon:s.jsx(PI,{})}),s.jsx(YS,{...f}),s.jsx(XS,{...f}),h,s.jsx(Ft,{}),g,s.jsx(NS,{...f}),s.jsx($S,{...f}),s.jsx(Ft,{}),s.jsx(Zv,{...f}),s.jsx(Xv,{...f}),s.jsx(Yv,{...f}),s.jsx(Jv,{...f}),s.jsx(Ft,{}),s.jsx(US,{...f}),s.jsx(tC,{command:n.getCommand("formatCellStyle"),...f}),s.jsx(iC,{command:n.getCommand("formatTableStyle"),...f}),s.jsx(Ft,{}),s.jsx(Ef,{...f}),s.jsx(Mf,{...f}),s.jsx(Ft,{}),s.jsx(qS,{...f}),null,s.jsx(kf,{...f}),s.jsx(Tf,{...f}),y,x]})},[n,a]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),hN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(l1,{parentFloat:o,children:[null,s.jsx(Ge,{...c,command:n.getCommand("updateHyperlink"),icon:ze(s.jsx(dh,{}))}),s.jsx(Ge,{...c,command:n.getCommand("updateComments"),icon:ze(s.jsx(uh,{}))}),s.jsx(If,{...d}),s.jsx(Ge,{...c,command:n.getCommand("insertTable"),icon:ze(s.jsx(Kc,{}))})]})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),fN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=Te(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(l1,{parentFloat:o,children:[s.jsx(VS,{...d}),s.jsx(Ge,{...c,command:n.getCommand("protectionSheetToggle"),icon:s.jsx(S2,{color:"secondary"})}),s.jsx(Ft,{}),s.jsx(KS,{...d}),s.jsx(JS,{...d}),s.jsx(Ft,{}),s.jsx(Ge,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:s.jsx(Xs,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),s.jsx(Ge,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:s.jsx(Xs,{command:n.getCommand("sheetViewToggleShowZeros"),scope:"view"})}),s.jsx(Ft,{}),s.jsx(QS,{...d}),s.jsx(cC,{command:n.getCommand("selectTheme"),...d}),s.jsx(Ft,{}),s.jsx(qf,{...d,scope:"view"}),s.jsx(Ft,{}),s.jsx(Ge,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ze(n.getCommand("fullScreenToggle").state()?s.jsx(UO,{}):s.jsx(WO,{}))})]})},[n]);return s.jsx(M1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_C=e=>s.jsx(xN,{...e}),mN=u.memo(e=>{const{sx:t,...n}=e;return s.jsxs(Ae,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${pt(o.palette.primary.main,.35)} solid 2px`}},children:[s.jsx(Pj,{disableRipple:!0,onMouseDown:o=>{o.button===0&&o.preventDefault()},sx:{textTransform:"none",flex:"1 1 100%",fontWeight:o=>o.typography.fontWeightRegular,padding:"2px 6px",minHeight:"0px",minWidth:"0px",marginRight:o=>o.spacing(.5),"&.Mui-selected":{},"&.Mui-focusVisible":{},...t},...n}),s.jsx(Ae,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),gN=u.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,sx:r,...i}=e,a=u.useMemo(()=>{const l=[];for(let c=0;c<t.length;c++)l.push(s.jsx(mN,{label:t[c].label},t[c].label));return l},[t]);return s.jsx(Xj,{value:n,onChange:(l,c)=>{o?.(c)},variant:"scrollable",scrollButtons:!1,sx:{paddingLeft:l=>l.spacing(1.5),paddingRight:l=>l.spacing(1.5),paddingTop:l=>l.spacing(0),paddingBottom:l=>l.spacing(0),minHeight:"26px",alignItems:"center","& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{width:"90%",borderRadius:"4px",minWidth:"4px",backgroundColor:l=>l.palette.primary.main},"& .MuiTab-root":{marginRight:"0px"},...r},TabIndicatorProps:{children:s.jsx("span",{className:"MuiTabs-indicatorSpan"})},...i,children:a})}),yN=u.memo(e=>{const{toolbars:t,value:n,onToolbarChange:o,selectProps:r,...i}=e,a=u.useCallback(c=>{o?.(c.target.value)},[o]),l=u.useMemo(()=>{const c=[];for(let d=0;d<t.length;d++){const p=t[d].label;c.push(s.jsx(v1,{value:d,sx:{color:f=>{if(n===d)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return s.jsx(b1,{sx:{minWidth:"125px",maxWidth:"125px","& .MuiInputBase-root":{paddingLeft:"0px",paddingRight:"0px"},"& .MuiSelect-select":{paddingTop:c=>c.spacing(.5),paddingBottom:c=>c.spacing(.5),paddingLeft:c=>c.spacing(2),color:c=>c.palette.primary.main},"& .MuiSelect-icon":{fill:c=>c.palette.text.icon??c.palette.action.active,"&:hover:not(.Mui-disabled)":{color:c=>c.palette.text.icon??c.palette.action.active}},...r},size:"small",children:s.jsx(w2,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...i,children:l})})}),xN=u.memo(u.forwardRef((e,t)=>{const{commands:n,selectWrapper:o,selectProps:r={},renderCompact:i=!1,paletteWrapper:a,toolbarsProps:l,paletteProps:c={},workbook:d,sx:p,...f}=e,h=u.useMemo(()=>{const k=[],{ref:j,..._}=l?.Home||{};k.push({label:"Home",component:s.jsx(pN,{commands:n,..._})});const{ref:L,...T}=l?.Insert||{};k.push({label:"Insert",component:s.jsx(hN,{commands:n,...T})});const{ref:D,...C}=l?.View||{};return k.push({label:"View",component:s.jsx(fN,{commands:n,...C})}),k},[n]),g=u.useMemo(()=>{const k=[];for(let j=0;j<h.length;j++)k.push(u.cloneElement(h[j].component,{...h[j].component.props,key:h[j].key??h[j].label}));return k},[h]),[m,y]=u.useState(0),x=k=>{y(k)},v=u.useMemo(()=>s.jsx(i?yN:gN,{toolbars:h,value:m,onToolbarChange:x,sx:r}),[h,m,r,i]),{sx:b,...w}=c,M=s.jsx(Ti,{elevation:2,tabIndex:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:1,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,marginLeft:k=>k.spacing(1),marginRight:k=>k.spacing(1),marginTop:k=>k.spacing(.5),marginBottom:k=>k.spacing(.5),...b},...w,children:g[m]});return s.jsxs(Ae,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:k=>k.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,a?a(M):M]})})),bN=e=>s.jsx(Nf,{...e}),vN=e=>s.jsx($f,{...e}),wN=e=>s.jsx(Bf,{...e}),Kf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,commands:o,onBeforeUserChange:r,onUserChange:i,disabled:a=!1,readOnly:l=!1,contextMenuProps:c,renderContextMenu:d=bN,sheetsAllProps:p,renderSheetsAll:f=vN,sheetTabProps:h,renderSheetTab:g,background:m="transparent",className:y,notifier:x,sx:v,borderWidth:b,borderColor:w,gridTheme:M,gridStyle:k,...j}=e,[_,L]=u.useState(n?.getSelectedSheetIndex()),[T,D]=u.useState(n?.getSheets().search()),[C,S]=u.useState(n?.getProtection());cn(n,{onViewChange(ee){L(ee?.getSelectedSheetIndex())},onSheetsChange:ee=>{D(ee.getSheets().search())},onProtectionChange:ee=>{S(ee?.getProtection())}});const R=l||!C.isStructureAllowed(),P=u.useMemo(()=>{const ee=[];for(let ae=0;ae<T.length;ae++)ee.push(T[ae].getName());return ee},[T]),I=u.useCallback(ee=>{r?.(ee)!==!1&&(n.getSheetAt(ee).select(),i?.(ee))},[n,r,i]),z=u.useCallback((ee,ae)=>{n.getSheetAt(ee).setName(ae),i?.(ee)},[n,i]),A=u.useCallback((ee,ae)=>{n.getSheetAt(ee).setPosition(ae),i?.(ae)},[n,i]),O=Te(()=>{if(r?.(_)===!1)return;const ee=_+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ee)},[n,r,i,_]),N=u.useMemo(()=>({placement:"top-start"}),[]),F=u.useRef(null),[E,B]=u.useState(!1),H=u.useCallback(ee=>{const{closeFloatAll:ae,floatReference:we}=ee;return f({workbook:n,gridStyle:k,floatReference:we,closeFloatAll:ae,...p})},[f,p,a,n,k]),{reference:U,component:Z}=ha({label:"allSheet",popperProps:N,anchor:F.current,onOpen:()=>B(!0),onClose:()=>B(!1),createPopupPanel:H}),G=u.useRef(null),[V,le]=u.useState(null),re=u.useCallback(ee=>{const{floatReference:ae}=ee;return d?.({workbook:n,index:V?.index,tabStripRef:G.current,commands:o,disabled:a,floatReference:ae,...c})},[d,c,a,n,o,V]),{reference:ge,component:Q}=ha({label:"sheetTab",popperProps:N,anchor:{getBoundingClientRect:()=>new DOMRect(V?.left||0,V?.top||0,0,0)},onClose:()=>le(null),createPopupPanel:re});u.useEffect(()=>{V?ge.open(0):ge.close(0)},[V]);const xe=u.useCallback((ee,ae)=>{ee.preventDefault(),le({left:ee.clientX-2,top:ee.clientY-4,index:ae})},[]),be=Te(ee=>{let ae;try{ae=n?.getSheetAt(ee.index)}catch{}return ae?(g??wN)({sheet:ae,gridTheme:M,onContextMenu:we=>{I(ee.index),xe(we,ee.index)},...ee,...h}):null},[g,h,n,M]),Fe=u.useMemo(()=>R?null:s.jsx(di,{disableInteractive:!0,title:"New sheet",children:s.jsx(Tr,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ee=>ee.palette.primary.main},color:ee=>ee.palette.text.icon??ee.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ee=>{ee.button===0&&ee.preventDefault()},onClick:()=>O(),children:s.jsx(tR,{})})}),[a,R,O]);return s.jsxs(Ae,{ref:t,className:Eo(y),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...j,children:[s.jsx(DS,{ref:G,selectedTabIndex:_,tabNames:P,onSelectedTabIndexChange:I,onTabNameChange:z,onTabMove:A,background:m,borderColor:w,borderWidth:b,activeColor:null,disabled:a,disableDrag:R,createScrollStartButton:jD,createScrollEndButton:RD,createScrollEdgeButton:_D,createTabButton:be,createTabDivider:ee=>{const{key:ae,...we}=ee;return s.jsx(Ft,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:se=>pt(se.palette.divider,.25)},...we},ae)},editLabelProps:{readOnly:R,maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ee=>{n.isValidSheetNameCharacter(ee.key)||ee.preventDefault()},onCancel:()=>{i?.(_)},notifier:x},children:s.jsx(di,{disableInteractive:!0,title:E?"":"List all sheets",children:s.jsx(ii,{sx:{padding:"0px",ml:.5,mr:0,mt:0,mb:0,"& svg":{transform:"scale(0.8, 1)"},color:ee=>ee.palette.text.icon??ee.palette.action.active},ref:F,dense:!0,outlined:!1,selected:E,color:"primary","aria-label":"menu",onMouseDown:ee=>{ee.button===0&&ee.preventDefault()},onClick:()=>{E?U.close(0):U.open(0)},icon:s.jsx(uR,{})})})}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,minWidth:"4px"}}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:"none",display:"flex",alignItems:"center"},children:Fe}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:1,minWidth:"24px"}}),Q,Z]})}));Kf.displayName="WorkbookStrip";const Gf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,commands:o,disabled:r,sx:i,floatReference:a,className:l,...c}=e,[d,p]=u.useReducer(S=>S+1,0),[f,h]=u.useState(n.getSelectedSheet()),[g,m]=u.useState(f.getSelectedRanges()),[y,x]=u.useState(f.getSelectedCell());cn(n,{onSheetsChange(){h(n.getSelectedSheet())}}),cn(f.getSelection(),{onChange(){m(f.getSelectedRanges()),x(f.getSelectedCell())}}),_o(o,[],{onChange:()=>{p()}});const v=u.useMemo(()=>({}),[]),b=u.useMemo(()=>({commandHook:{beforeExecute:(S,R)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),w=u.useMemo(()=>({...v,...b,variant:Zt.Menuitem}),[v,b]),M=u.useMemo(()=>({commands:o,variant:Zt.Menuitem,parentFloat:a,...b}),[o,b,a]),k=[];let j=g.isEntireRows(),_=g.isEntireColumns();g&&(j&&(k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),k.push(u.createElement(Ge,{command:o.getCommand("hideColumns"),...w,icon:ze(s.jsx(TO,{})),key:"context:"+k.length})),k.push(u.createElement(Ge,{command:o.getCommand("unhideColumns"),...w,icon:ze(s.jsx(MO,{})),key:"context:"+k.length}))),_&&(k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),k.push(u.createElement(Ge,{command:o.getCommand("hideRows"),...w,icon:ze(s.jsx(jO,{})),key:"context:"+k.length})),k.push(u.createElement(Ge,{command:o.getCommand("unhideRows"),...w,icon:ze(s.jsx(_O,{})),key:"context:"+k.length}))),(j||_)&&k.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+k.length)),j&&k.push(u.createElement(Ge,{command:o.getCommand("autoFitColumns"),...w,icon:ze(s.jsx(iD,{})),key:"context:"+k.length})),_&&k.push(u.createElement(Ge,{command:o.getCommand("autoFitRows"),...w,icon:ze(s.jsx(aD,{})),key:"context:"+k.length})));const L=[],T=o.getCommand("formatTableStyle"),D=T?.context()?.table();if(rl(T),!j&&!_){if(L.push(s.jsx(Ft,{orientation:"horizontal"},"contextBefore:"+L.length)),y?.getHyperlink())L.push(u.createElement(ca,{...M,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+L.length,quickCommand:"openHyperlink",icon:S=>S.key()==="openHyperlink"?ze(s.jsx(dh,{})):null}));else{const S=o.getCommand("updateHyperlink");L.push(u.createElement(Ge,{command:S,...w,icon:ze(s.jsx(dh,{})),key:"contextBefore:"+L.length}))}if(y?.getComments())L.push(u.createElement(ca,{...M,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+L.length,quickCommand:"updateComments",icon:S=>S.key()==="updateComments"?ze(s.jsx(uh,{})):null}));else{const S=o.getCommand("updateComments");L.push(u.createElement(Ge,{command:S,...w,icon:ze(s.jsx(uh,{})),key:"contextBefore:"+L.length}))}D?L.push(u.createElement(ca,{...M,variant:Zt.Menuitem,key:"contextBefore:"+L.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:D,quickCommand:"editTable",icon:S=>(S.key(),ze(s.jsx(Kc,{})))})):L.push(u.createElement(Ge,{command:o.getCommand("insertTable"),...w,icon:ze(s.jsx(Kc,{})),key:"context:"+k.length})),L.push(u.createElement(If,{...M,key:"contextBefore:"+L.length}))}const C=s.jsxs(s.Fragment,{children:[s.jsx(Ge,{command:o.getCommand("cut"),...w,icon:s.jsx(FP,{})}),s.jsx(H2,{command:o.getCommand("copy"),...w}),s.jsx(jf,{command:o.getCommand("paste"),...M,includePasteAllInPopup:!1}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Tf,{...M}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ef,{commands:o,...M,disableSheet:!0}),s.jsx(Mf,{commands:o,...M,disableSheet:!0}),s.jsx(kf,{...M}),L,k]});return s.jsx(Ae,{ref:t,className:Eo("menu",l),sx:{...i},...c,children:C})}));var py,hy;Gf.displayName="WorkbookContextMenu",function(){if(hy)return py;hy=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,r=parseInt,i=typeof bs=="object"&&bs&&bs.Object===Object&&bs,a=typeof self=="object"&&self&&self.Object===Object&&self,l=i||a||Function("return this")(),c=Object.prototype.toString,d=Math.max,p=Math.min,f=function(){return l.Date.now()};function h(m){var y=typeof m;return!!m&&(y=="object"||y=="function")}function g(m){if(typeof m=="number")return m;if(typeof(y=m)=="symbol"||function(b){return!!b&&typeof b=="object"}(y)&&c.call(y)=="[object Symbol]")return NaN;var y;if(h(m)){var x=typeof m.valueOf=="function"?m.valueOf():m;m=h(x)?x+"":x}if(typeof m!="string")return m===0?m:+m;m=m.replace(e,"");var v=n.test(m);return v||o.test(m)?r(m.slice(2),v?2:8):t.test(m)?NaN:+m}py=function(m,y,x){var v,b,w,M,k,j,_=0,L=!1,T=!1,D=!0;if(typeof m!="function")throw new TypeError("Expected a function");function C(z){var A=v,O=b;return v=b=void 0,_=z,M=m.apply(O,A)}function S(z){var A=z-j;return j===void 0||A>=y||A<0||T&&z-_>=w}function R(){var z,A,O=f();if(S(O))return P(O);k=setTimeout(R,(A=y-((z=O)-j),T?p(A,w-(z-_)):A))}function P(z){return k=void 0,D&&v?C(z):(v=b=void 0,M)}function I(){var z,A=f(),O=S(A);if(v=arguments,b=this,j=A,O){if(k===void 0)return _=z=j,k=setTimeout(R,y),L?C(z):M;if(T)return k=setTimeout(R,y),C(j)}return k===void 0&&(k=setTimeout(R,y)),M}return y=g(y)||0,h(x)&&(L=!!x.leading,w=(T="maxWait"in x)?d(g(x.maxWait)||0,y):w,D="trailing"in x?!!x.trailing:D),I.cancel=function(){k!==void 0&&clearTimeout(k),_=0,v=j=b=k=void 0},I.flush=function(){return k===void 0?M:P(f())},I}}();var fy,my,gy={};my||(my=1,function(){if(fy)return gy;fy=1;var e=u,t=typeof Object.is=="function"?Object.is:function(c,d){return c===d&&(c!==0||1/c==1/d)||c!=c&&d!=d},n=e.useState,o=e.useEffect,r=e.useLayoutEffect,i=e.useDebugValue;function a(c){var d=c.getSnapshot;c=c.value;try{var p=d();return!t(c,p)}catch{return!0}}var l=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(c,d){return d()}:function(c,d){var p=d(),f=n({inst:{value:p,getSnapshot:d}}),h=f[0].inst,g=f[1];return r(function(){h.value=p,h.getSnapshot=d,a(h)&&g({inst:h})},[c,p,d]),o(function(){return a(h)&&g({inst:h}),c(function(){a(h)&&g({inst:h})})},[c]),i(p),p};gy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l}());var yy,xy,Pd={exports:{}},fs={exports:{}},SN=fs.exports;(function(){if(xy)return Pd.exports;xy=1;for(var e=(yy||(yy=1,function(){var f,h,g,m,y,x;typeof performance<"u"&&performance!==null&&performance.now?fs.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(fs.exports=function(){return(f()-y)/1e6},h=process.hrtime,m=(f=function(){var v;return 1e9*(v=h())[0]+v[1]})(),x=1e9*process.uptime(),y=m-x):Date.now?(fs.exports=function(){return Date.now()-g},g=Date.now()):(fs.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(SN)),fs.exports),t=typeof window>"u"?bs:window,n=["moz","webkit"],o="AnimationFrame",r=t["request"+o],i=t["cancel"+o]||t["cancelRequest"+o],a=0;!r&&a<n.length;a++)r=t[n[a]+"Request"+o],i=t[n[a]+"Cancel"+o]||t[n[a]+"CancelRequest"+o];if(!r||!i){var l=0,c=0,d=[],p=1e3/60;r=function(f){if(d.length===0){var h=e(),g=Math.max(0,p-(h-l));l=g+h,setTimeout(function(){var m=d.slice(0);d.length=0;for(var y=0;y<m.length;y++)if(!m[y].cancelled)try{m[y].callback(l)}catch(x){setTimeout(function(){throw x},0)}},Math.round(g))}return d.push({handle:++c,callback:f,cancelled:!1}),c},i=function(f){for(var h=0;h<d.length;h++)d[h].handle===f&&(d[h].cancelled=!0)}}Pd.exports=function(f){return r.call(t,f)},Pd.exports.cancel=function(){i.apply(t,arguments)},Pd.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i}})();var na={DOM_UNAVAILABLE_ERROR:"DOM is unavailable server-side. Please use this method client-side only.",FULLSCREEN_UNSUPPORTED_ERROR:"Your browser does not support Fullscreen API.",getEventsNames(){if(typeof document>"u")return null;const e=document;return"exitFullscreen"in e?["fullscreenchange","fullscreenerror"]:"webkitExitFullscreen"in e||"webkitCancelFullScreen"in e?["webkitfullscreenchange","webkitfullscreenerror"]:"mozCancelFullScreen"in e?["mozfullscreenchange","mozfullscreenerror"]:"msExitFullscreen"in e?["MSFullscreenChange","MSFullscreenError"]:null},getEventName(e){const t=this.getEventsNames();return t?e==="change"?t[0]:t[1]:null},get fullscreenEnabled(){if(typeof document>"u")return!1;const e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled||!!e.webkitCancelFullScreen||e.mozFullScreenEnabled||e.msFullscreenEnabled||!1},get fullscreenElement(){if(typeof document>"u")return null;const e=document;return e.fullscreenElement||e.webkitFullscreenElement||e.webkitCurrentFullScreenElement||e.mozFullScreenElement||e.msFullscreenElement||null},requestFullscreen(e,t){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const n=e??document.documentElement,o=n.requestFullscreen||n.webkitRequestFullscreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullscreen;if(!o)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return o.call(n,t)},exitFullscreen(){if(typeof document>"u")throw new Error(this.DOM_UNAVAILABLE_ERROR);const e=document,t=e.exitFullscreen||e.webkitExitFullscreen||e.webkitCancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen;if(!t)throw new Error(this.FULLSCREEN_UNSUPPORTED_ERROR);return t.call(e)},on(e,t){const n=this.getEventName(e);n&&document.addEventListener(n,t)},off(e,t){const n=this.getEventName(e);n&&document.removeEventListener(n,t)}};const jC=e=>{const{workbook:t,workbookElement:n,notifier:o,commandTarget:r,commands:i,darkMode:a,onShowSidebar:l,onNewWorkbook:c=RC}=e,[d,p]=u.useState(t?.getSelectedSheet()),[f,h]=u.useState(t?.getSheets().search()),g=Te(l,[l]),m=Te(c,[c]),y=u.useMemo(()=>[new Tt("workbookStatistics",r,{label:"Workbook Statistics",description:"Show the workbook statistics.",shortcut:{key:"G",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("showFormat",r,{label:"Show Format",description:"Open the format pane.",shortcut:{key:"F",modifiers:[$e.Ctrl,$e.Shift]}}),new We("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new We("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new We("modifyCellStyle",r,{label:"Modify Cell Style",scopedLabels:{cellStyle:"Modify"},description:"Update a style with the currently style."}),new Tt("find",r,{label:"Find",description:"Open the Find window.",shortcut:[{key:"F",modifiers:[$e.Ctrl]},{key:"F5",modifiers:[$e.Shift]}]}),new Tt("findReplace",r,{label:"Find & Replace",description:"Open the Find & Replace window.",shortcut:[{key:"H",modifiers:[$e.Ctrl]},{key:"H",modifiers:[$e.Ctrl,$e.Alt]}]}),new Tt("goto",r,{label:"Go To",description:"Open the 'Go To' window.",shortcut:[{key:"G",modifiers:[$e.Ctrl]}]}),new Tt("workbookViewToggleExpandFormulaBar",r,{label:"Toggle Expand Formula bar",description:"Expand or collapse the formula bar.",shortcut:{key:"U",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("workbookViewToggleShowFormulaBar",r,{label:"View Formula bar",scopedLabels:{view:"Formula Bar"},description:"Show or hide the formula bar."}),new Tt("workbookViewToggleShowTabs",r,{label:"View Sheet Tabs",description:"Show or hide the sheet tabs.",scopedLabels:{view:"Sheet Tabs"}}),new Tt("workbookViewToggleShowStatusBar",r,{label:"View Status Bar",description:"Show or hide the status bar.",scopedLabels:{view:"Status Bar"}}),new Tt("workbookViewToggleShowHorizontalScrollBar",r,{label:"View Horizontal Scrollbar",description:"Show or hide the horizontal scrollbar.",scopedLabels:{view:"Horizontal Scrollbar"}}),new Tt("workbookViewToggleShowVerticalScrollBar",r,{label:"View Vertical Scrollbar",description:"Show or hide the vertical scrollbar.",scopedLabels:{view:"Vertical Scrollbar"}}),new We("hideSheet",r,{label:"Hide Sheet",scopedLabels:{sheet:"Hide"},description:"Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs."}),new We("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new We("addSheet",r,{label:"Insert Sheet",scopedLabels:{sheet:"Insert"},description:"Insert sheet before the current sheet.",shortcut:[{key:"F11",modifiers:[$e.Shift]},{key:"F1",modifiers:[$e.Alt,$e.Shift]}]}),new We("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new We("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl]}]}),new We("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl]}]}),new We("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl,$e.Shift]}]}),new We("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl,$e.Shift]}]}),new We("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new We("selectNamed",r,{label:S=>S?.getName()??"Select Named Item",scopedLabels:{namedItem:S=>S?.getName()??"Select"},description:"Select the item."}),new We("addNamedReference",r,{label:"Define Named Reference",scopedLabels:{namedItem:"Define Name…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new We("editNamedReference",r,{label:"Edit Named Reference…",scopedLabels:{namedItem:"Edit…"},description:"Add a new named reference. Names can be used as a substitute for cell references."}),new We("deleteNamedReference",r,{label:"Delete Named Reference",scopedLabels:{namedItem:"Delete"},description:"Remove the named reference."}),new Tt("activeNameBox",r,{label:"Activate Name Box",description:"Move the focus to the name box.",shortcut:{key:"F3",modifiers:[$e.Alt]}}),new Tt("createNamedReferenceFromSelection",r,{label:"Create from Selection",description:"Automatically generate names from the selected cells.",shortcut:{key:"F3",modifiers:[$e.Ctrl,$e.Shift]}}),new Tt("activeNameManager",r,{label:"Activate Name Manager",description:`Create, edit, delete, and find all the names used in the workbook.
222
222
 
223
- Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[$e.Ctrl]}}),new We("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new We("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[$e.Alt]}]},function(S=!0){g?.()}),new We("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new We("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new We("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new We("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[$e.Ctrl]}}),new We("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new We("calculateAll",r,{label:"Calculate Now",description:"Recalculate all formulas.",shortcut:{key:"F9"}}),new Tt("calculate",r,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[$e.Ctrl]}}),new Tt("closeWorkbook",r,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[$e.Ctrl]}}),new Tt("newWorkbook",r,{label:"New Workbook",description:"Create a new workbook in another tab.",shortcut:{key:"N",modifiers:[$e.Ctrl]}})],[]),x=u.useMemo(()=>{let S=null;return S=i?i.createChildGroup(r,"workbook",!1):new a0(r,"workbook"),S.addCommands(y,!0),S},[i,y]),v=Wi(),b=u.useRef(null),w=Te(()=>{let S,R=null;const P=x.getCommand("executeScript");if(P.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!P)return;const I=x.getCommand("executeSelectedScript");if(!I)return;const z={saveSource:async A=>{let O=null,N=null;const F=t.getScripts();try{A&&(N=await o?.showBusy?.("Saving Scripts..."),O=await F.createModule({source:A})),F.addModule("scripts",O,{replace:!0}),N?.()}catch(E){N?.(),console.warn("Unable to compile",E),o?.showError?.(E)}return O},addContainerListener:A=>(M.current=A,()=>{M.current=null}),setSelectedFunction:A=>{S=A??b.current??null,Promise.resolve(S).then(O=>{I.update({disabled:O===null})})},quickInsertFunction:A=>{const O=`=${A.toUpperCase()}(`,N={text:O+")",editMode:!0,initialSelection:{start:O.length,end:O.length+0}};v.setMode(F=>F?.key==="edit"?{...F,args:{...F.args}}:{key:"edit",args:{stateAndCoords:null,start:N}})},getSelectedFunction:()=>S,setEditor:A=>{R=A??null,x.getCommand("showScriptEditor")?.update({state:A!==null})},getEditor:()=>R,getRanges:A=>{try{return t.getRanges(A)}catch{}return null},getScripts:()=>t.getScripts(),isReadOnly:()=>t.getProtection().isStructureAllowed()===!1};I.update({context:z})},[x,t,n,o]),M=u.useRef(null);cn(t,{onBeforeSave:async()=>{await M.current?.onBeforeSave()},onProtectionChange:()=>{M.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),M.current?.onScriptChange()))()}}),cn(t,{onSheetsChange:S=>{h(S.getSheets().search())},onViewChange(S){p(S?.getSelectedSheet())},onProtectionChange:S=>{const R={disabled:!S.getProtection().isStructureAllowed()};x.getCommand("hideSheet").update(R),x.getCommand("deleteSheet").update(R),x.getCommand("addSheet").update(R),x.getCommand("duplicateSheet").update(R),x.getCommand("selectTheme").update(R),x.getCommand("addNamedReference").update(R),x.getCommand("editNamedReference").update(R),x.getCommand("deleteNamedReference").update(R)},onScriptsChange:S=>{w()}});const{isFullscreenAvailable:k,isFullscreenEnabled:j,toggleFullscreen:_}=function(S={}){const{target:R,onChange:P,onError:I,requestFullScreenOptions:z}=S,[A,O]=u.useState(!1),[N,F]=u.useState(null),[E,B]=u.useState(!1),H=u.useCallback(()=>na.requestFullscreen(R?.current||null,z),[R,z]),U=u.useCallback(()=>na.exitFullscreen(),[]),Z=u.useCallback(()=>na.fullscreenElement?U():H(),[H,U]),G=u.useCallback(le=>{const re=na.fullscreenElement;F(re),B(!!re),P?.(le)},[P]),V=u.useCallback(le=>{const re=na.fullscreenElement;F(re),B(!!re),I?.(le)},[I]);return u.useEffect(()=>{O(na.fullscreenEnabled)},[]),u.useEffect(()=>(na.on("change",G),na.on("error",V),()=>{na.off("change",G),na.off("error",V)}),[G,V]),{isFullscreenAvailable:A,fullscreenElement:N,isFullscreenEnabled:E,enableFullscreen:H,disableFullscreen:U,toggleFullscreen:Z}}({target:{current:n??document.body}}),L=wf();u.useEffect(()=>{x.getCommand("selectTheme").update({state:()=>t.getTheme(),context:()=>({theme:t.getTheme(),themes:L,darkMode:a})})},[t?.getTheme(),a]);const T=Te(async function(S,R){let P=null;const I=t.getScripts();if(S?.declaration||S?.functionName){const z=S.declaration?S.declaration.getName():S.functionName;I.searchFunction({name:z}).length>0&&(P=z)}if(P)try{await I.executeMacro(P),b.current=Promise.resolve({source:null,name:P})}catch(z){return void o?.showError?.(z)}},[t,o]);u.useEffect(()=>{x.getCommand("newCellStyle").updateCallback(S=>{o?.showInputOptions?.({initialValue:(()=>{let R=0;for(;;){R++;const P=`Style ${R}`;try{return t.getStyles().validateStyleName(P,!0),P}catch{}}})(),title:x.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInputOption:async(R,P)=>{let I=null;try{t.getStyles().validateStyleName(R,!1)}catch(O){I=O.message}let z=t.getStyles().getNamed(R),A=I;return!A&&z&&(A=`Update style '${z.getName()}'.`),{valid:I===null,message:A}}}).then(({input:R,option:P})=>{const I=t.getSelectedSheet().getSelectedRange();if(P!=="Ok")return;const z=t.getStyles().setNamed({name:R,style:I.getCell().getStyle()});I.updateStyle({named:z.getName()})})}),x.getCommand("deleteCellStyle").updateCallback(S=>{S.delete()}),x.getCommand("modifyCellStyle").updateCallback(({named:S})=>{const R=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:S.getName(),style:R.getCell().getStyle()})}),x.getCommand("hideSheet").updateCallback(S=>{t.getSheetAt(S).setVisibility($.ISheet.Visibility.Hidden)}),x.getCommand("deleteSheet").updateCallback(async S=>{t.getSheetAt(S??t.getSelectedSheetIndex())?.delete()}),x.getCommand("addSheet").updateCallback(S=>{t.getSheets().add({index:S,autoSelect:!0})}),x.getCommand("duplicateSheet").updateCallback(async S=>{(await t.getSheetAt(S??t.getSelectedSheetIndex())?.duplicate())?.select()}),x.getCommand("nextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("previousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectNextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectPreviousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectTheme").updateCallback(S=>{t.setTheme(S)}),x.getCommand("calculateAll").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),x.getCommand("calculate").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),x.getCommand("closeWorkbook").updateCallback(async()=>{await o?.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),x.getCommand("newWorkbook").updateCallback(()=>{m?.()}),x.getCommand("executeScript").updateCallback(T),x.getCommand("executeSelectedScript").updateCallback(T)},[t,o]);const D=Te(async S=>{let R=0,P=null,I="Find & Replace";S?.replace&&!S?.replaceOptions?.maxCount&&(I="Replace All");const z=await o?.showBusy?.(I);try{const A=S?.scope??"sheet";let O=null;const N={from:t.getSelectedSheet().getSelectedCell(),...S.findOptions};if(O=A==="sheet"?t.getSelectedSheet().find(S.findText,N):t.find(S.findText,N),S.replace){const F=t.replace(O,S.replaceText,S.replaceOptions);R=F.count,S.replaceOptions.maxCount&&(P=F.last)}else{let F=O.next();F.done||(R++,P=F.value)}P?.select({autoFocus:!1}),z?.(),!S.replaceOptions.maxCount&&R>1&&o?.showMessage?.(`We replaced ${R} cells.`)}catch(A){z?.(),o?.showError?.(A)}return R},[t,n]),C=Te(S=>{const R={value:S,context:{selection:()=>{const P=t.getSelectedRanges(),I=[];for(let z=0;z<P.getCount();z++){const A=P.at(z).getFixed(!0).getCoords();I.push(A)}return t.getRanges(I)},getNames:()=>t.getNames()},onUpdate:async P=>{try{await P.select()}catch(I){o?.showMessage?.(I.message,{type:pa.Error})}}};return o.showWindow?.("namedDetails",R)},[o,t,n]);return u.useEffect(()=>{const S=(R=!1)=>{const P=t.getSelectedCell(),I={onFindOrReplace:D,onKeyDown:z=>{x.findCommandByEvent(z)!==x.getCommand("find")&&x.findCommandByEvent(z)!==x.getCommand("findReplace")||z.preventDefault()},findOptions:{},findText:P.toTextUnformatted(!0)};I.replace=R,o.showWindow?.("find",I,{disableAutoDestroy:!0})};x.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S()}),x.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S(!0)}),x.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const R={onInputOption:async P=>{try{await t.getRanges(P).select()}catch(I){o?.showMessage?.(I.message,{type:pa.Error})}},onKeyDown:P=>{x.findCommandByEvent(P)===x.getCommand("goto")&&P.preventDefault()},title:x.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(R)}),x.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async R=>{if(R)try{await R.select()}catch(P){o?.showError?.(P)}}),x.getCommand("addNamedReference")?.updateCallback(async function(R){C(null)}),x.getCommand("editNamedReference")?.updateCallback(async function(R){C(R)}),x.getCommand("deleteNamedReference")?.updateCallback(async function(R){R?.delete?.()}),x.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),cn(t?.getView(),{onViewChange:S=>{x.getCommand("workbookViewToggleShowFormulaBar").update({state:S.isShowFormulaBar()}).updateCallback(()=>{S.setShowFormulaBar(!S.isShowFormulaBar())}),x.getCommand("workbookViewToggleShowTabs").update({state:S.isShowTabs()}).updateCallback(()=>{S.setShowTabs(!S.isShowTabs())}),x.getCommand("workbookViewToggleShowStatusBar").update({state:S.isShowStatusBar()}).updateCallback(()=>{S.setShowStatusBar(!S.isShowStatusBar())}),x.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:S.isShowHorizontalScrollbar()}).updateCallback(()=>{S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar())}),x.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:S.isShowVerticalScrollbar()}).updateCallback(()=>{S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar())})}}),u.useEffect(()=>{x.getCommand("fullScreenToggle").update({state:j,disabled:!k}).updateCallback(()=>{_()})},[j,k]),u.useEffect(()=>{const S=t.getProtection().isStructureAllowed();x.getCommand("hideSheet").update({disabled:f.length<=1||!S}),x.getCommand("deleteSheet").update({disabled:f.length<=1||!S})},[f,d]),x},RC=()=>{window.open(window.origin.toString(),"sheetxl-"+$.CommonUtils.uuidV4(),"popup=true")},IC=u.memo(u.forwardRef((e,t)=>{const{movable:n,commands:o,disabled:r,sx:i,floatReference:a,...l}=e;cn(n,{onAnyChange(m){}});const c=u.useMemo(()=>({}),[]),d=u.useMemo(()=>({commandHook:{beforeExecute:(m,y)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=u.useMemo(()=>({variant:Zt.Menuitem,...c,...d}),[c,d]),f=u.useMemo(()=>({commands:o,variant:Zt.Menuitem,parentFloat:a,...d}),[o,d,a]),h=m=>{switch(m?.key()){case"moveToFront":return ze(s.jsx(sD,{}));case"moveForward":return ze(s.jsx(cD,{}));case"moveToBack":return ze(s.jsx(lD,{}));case"moveBackward":return ze(s.jsx(dD,{}));case"toggleLockAspectRatio":return ze(s.jsx(K7,{}));case"formatDrawAlignLeft":return ze(s.jsx(Z7,{}));case"formatDrawAlignCenter":return ze(s.jsx(uD,{}));case"formatDrawAlignRight":return ze(s.jsx(pD,{}));case"formatDrawAlignTop":return ze(s.jsx(hD,{}));case"formatDrawAlignMiddle":return ze(s.jsx(fD,{}));case"formatDrawAlignBottom":return ze(s.jsx(mD,{}));case"formatDrawDistributeHorz":return ze(s.jsx(gD,{}));case"formatDrawDistributeVert":return ze(s.jsx(yD,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ze(s.jsx(G7,{}));default:return null}},g=s.jsxs(s.Fragment,{children:[s.jsx(H2,{command:o.getCommand("copy"),...p,variant:Zt.Menuitem}),[],s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),s.jsx(ca,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ze(s.jsx(K7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:m=>h(m)||ze(s.jsx(Z7,{})),tooltip:"Quickly change the placement of your drawings."}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:m=>h(m)||ze(s.jsx(G7,{})),tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return s.jsx(Ae,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...l,children:g})}));IC.displayName="MovableContextMenu";const CN={fireOnModelChange:!1},m5={flex:"1 1 100%",display:"flex"},kN=e=>s.jsx(Af,{...e}),EN=e=>s.jsx(Kf,{...e}),MN=e=>s.jsx(IC,{...e}),TN=e=>s.jsx(Gf,{...e}),_N=e=>s.jsx(Ff,{...e}),jN=(e,t)=>s.jsx(zf,{ref:t,...e}),PC=e=>s.jsx(Gl,{...e}),RN=(e,t)=>s.jsx(rS,{ref:t,...e}),Zf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,createWorkbookOptions:o,onNewWorkbook:r,onElementLoad:i,notifier:a,autoFocus:l=!1,sx:c,style:d,className:p,onFocus:f,onBlur:h,onKeyDown:g,onRepeatCommandChange:m,commands:y,showFormulaBar:x,formulaBarProps:v,renderFormulaBar:b=jN,showTabs:w,tabsProps:M,renderTabs:k=EN,showStatusBar:j,statusBarProps:_,renderStatusBar:L=kN,toolbarProps:T,renderToolbar:D=_C,contextMenuSx:C,renderContextMenu:S=TN,renderFilterMenu:R=_N,renderMovableMenu:P=MN,renderLoadingPanel:I=PC,loadingPanelProps:z,sheetProps:A,renderSheet:O=RN,showHorizontalScrollbar:N,showVerticalScrollbar:F,gridTheme:E,headersTheme:B,enableDarkImages:H,...U}=e,Z=Ki(),G=wf(),V=u.useMemo(()=>{const Ne={theme:G.getDefaultTheme(),...o};return n??new $.Workbook(Ne)},[n]),le=u.useRef(null),[re,ge]=u.useState(!1),Q=u.useRef(null),xe=u.useMemo(()=>s.jsx(Ae,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:Q}),[]),[be,Fe]=u.useState(!1),[ee,ae]=u.useState(!1),we=u.useCallback(()=>{Fe(!0)},[]),se=u.useRef(null),J=ir(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>V,getSheetElement:()=>le.current,getViewportElement:()=>Q.current,getFormulaBarElement:()=>se.current,focus(){le&&le.current&&le.current.focus()}}),[V]),ce=u.useRef(null);u.useLayoutEffect(()=>{be&&J.current&&(ae(!0),ce.current!==i&&(i?.({source:J.current}),ce.current=i))},[be,J.current]),J.current;const ne=u.useCallback(Ne=>(le.current?.submitEdit(),!0),[]),Pe=u.useCallback(()=>{requestAnimationFrame(()=>{le?.current?.focus()})},[]),[Ee,it]=u.useState(V?.getSelectedSheet()),[Ue,ke]=u.useState(V?.getProtection());cn(V,{onSheetsChange:Ne=>{it(Ne?.getSelectedSheet())},onViewChange(Ne){it(Ne?.getSelectedSheet())},onProtectionChange:Ne=>{ke(Ne?.getProtection())}}),cn(V,{onRequestSelect:async(Ne,yt)=>new Promise(Ht=>{le.current.getSheet()!==yt?le.current.getGridElement()?.onViewChangeOnce(()=>{le.current.getSheet()!==yt&&Ht(!1),Ht(!0)}):Ht(!0)})},CN);const[_e,Xe]=u.useReducer(Ne=>Ne+1,0),Be=V?.getView();cn(Be,{onViewChange:Ne=>{Xe()}});const ct=E??Z,et=u.useMemo(()=>Zh(Z,ct),[Z,ct]),he=B??Z,Ye=u.useMemo(()=>Zh(Z,he),[Z,he]),[Se,Ie]=u.useState(null);u.useCallback(()=>{le.current.focus()},[]);const[de,Oe]=u.useState(!1),Le=u.useRef(null),je=jC({workbook:V,workbookElement:J.current,commandTarget:()=>le.current,notifier:a,commands:y,darkMode:et.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{de?Le.current?.focus():Oe(!0)}}),K=u.useRef(null),[W,te]=u.useState(!1),[oe,ue]=u.useState(null),[ie,pe]=u.useState(gp),[fe,ye]=u.useState($.TypesUtils.EmptyBounds),De=()=>{te(!1),ue(null)},Ve=(Ne,yt,Ht=gp)=>{ye(Ne),pe(Ht),ue(yt),K.current!==null&&K.current.update(),te(!0)},[Je,ot]=u.useState("sheet"),tt=w??Be?.isShowTabs(),Lt=N??Be?.isShowHorizontalScrollbar(),At=x??Be?.isShowFormulaBar(),_t=j??Be?.isShowStatusBar(),Yt=F??Be?.isShowVerticalScrollbar(),Jt=et?.header?.edgeStrokeFill||"rgb(171,171,171)",Qt=u.useMemo(()=>_t?L({sheet:Ee,gridStyle:et,..._}):null,[L,_,_t,et,Ee]),rn=u.useMemo(()=>D({commands:je,workbook:J.current,...T}),[je,D,T,Z]),[yn,{width:dn}]=a1(),kt=dn===0||dn>560,xn=u.useMemo(()=>{if(!tt)return null;let Ne=k({background:et.body.fill,borderWidth:1,borderColor:Jt,gridTheme:ct,gridStyle:et,onBeforeUserChange:ne,onUserChange:Pe,workbook:V,commands:je,sheetTabProps:{},notifier:a,...M});return kt||(Ne=s.jsx("div",{style:{flex:"none",display:"flex"},children:Ne})),Ne},[k,M,a,Z,V,ct,kt,je,tt]),tn=u.useCallback(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;let Ht=null,nn=null,an=null;if(Lt&&(nn=s.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${Jt} 1px`,maxWidth:"100%"},children:s.jsx(qu,{style:{alignItems:"center",borderTop:(yt?6:3)+"px solid transparent",borderBottom:(kt?6:3)+"px solid transparent",borderLeft:(yt?3:0)+"px solid transparent",borderRight:(yt?3:0)+"px solid transparent"},...Ne,endGap:700,sheet:Ee,showCustomScrollButtons:!yt,onShowTooltip:It=>{Ve({x:It.anchor.x,y:It.anchor.y,width:0,height:0},It.display,It.placement)},onCloseTooltip:()=>De()})})),tt&&kt&&(an=xn),tt&&kt&&!Lt&&(an=s.jsxs(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[an,s.jsx(Ae,{sx:{borderTop:`solid ${Jt} 1px`,flex:"1"}})]})),an&&Lt)Ht=s.jsx(K5,{position:V.getView().getTabRatio()/10+"%",onPositionChange:({percent:It})=>{V.getView().setTabRatio(Math.round(10*It))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${Z.palette.text.icon??Z.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${Jt} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:an,elementAfter:nn});else if(Lt)Ht=nn;else{if(!an)return s.jsx(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:_t?null:`solid ${Jt} 1px`}});Ht=an}return s.jsx(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:Ht})},[Ee,ne,V,et,ct,je,tt,Lt,_t,kt]),[_n,Nn]=u.useState(null),fn=u.useMemo(()=>({placement:"right-start",..._n?.popperProps}),[_n?.popperProps]),{reference:fo,component:bo}=ha({label:"contextMenu",popperProps:fn,anchor:_n?.anchor??{getBoundingClientRect:()=>new DOMRect(_n?.clientX||0,_n?.clientY||0)},onClose:()=>Nn(null),createPopupPanel:_n?.createPopupPanel});u.useEffect(()=>{_n?fo.open(0):fo.close(0)},[_n]);const Fo=Te((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),_n&&_n.anchor===Ne.currentTarget?Nn(null):Nn({anchor:Ne.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:Ht=>{const{floatReference:nn}=Ht;return R({filter:yt,commands:je,floatReference:nn,sx:{...C}})}})},[R,C,je,V,_n]),tr=Te(Ne=>{if(Ne.originalEvent?.isDefaultPrevented())return!0;Ne.originalEvent?.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:yt=>{const{floatReference:Ht}=yt;return S({commands:je,workbook:V,floatReference:Ht,sx:{...C}})}})},[S,C,je,V]),_r=Te((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:Ht=>{const{floatReference:nn}=Ht;return P({movable:yt,commands:je,floatReference:nn,sx:{...C}})}})},[P,C,je]);u.useMemo(()=>{const Ne=[new Tt("openContextMenu",()=>le.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[$e.Shift]},{key:"ContextMenu"}]})];je.addCommands(Ne,!0)},[je]),u.useEffect(()=>{je.getCommand("openContextMenu").updateCallback(()=>{const Ne=Ee.getSelection().getCoords().cell;le.current?.getGridElement()?.scrollCellCoordsIntoView(Ne).then(yt=>{requestAnimationFrame(()=>{const Ht=Ee.getView().getZoomScale()/100,nn=Ee.getColumnHeaders().findOffset(Ne.colIndex+1)*Ht,an=Ee.getRowHeaders().findOffset(Ne.rowIndex+1)*Ht,It=le.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};tr({clientX:nn-It.x-yt.left+6,clientY:an-It.y-yt.top+6})})})})},[Ee]);const jr=Te(Ne=>{je?.dispatchToFocusedCommand(Ne)},[je]),ui=Te(()=>{J.current},[V,J.current]),Gi=u.useCallback(()=>{ot("sheet")},[]),pi=u.useCallback(()=>{ot("formulaBar")},[]),pr=Te(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;return s.jsx(qu,{style:{borderLeft:"3px solid transparent",borderRight:"0px solid transparent",borderTop:(yt?3:0)+"px solid transparent",borderBottom:(yt?3:0)+"px solid transparent",width:yt?"13px":void 0},...Ne,sheet:Ee,endGap:700,showCustomScrollButtons:!yt,onShowTooltip:Ht=>{Ve(Ht.anchor,Ht.display,"left")},onCloseTooltip:()=>De()})},[Ee]);u.useEffect(()=>{l&&le&&le.current&&le.current.focus()},[]);const[rt,ft]=u.useState(null),gt=u.useCallback(Ne=>{je?.getCommand("openWorkbook")&&(Ne.type==="dragenter"||Ne.type==="dragover"?Ne.dataTransfer?.types.includes("Files")?Ne.dataTransfer.files[0]?.type?.startsWith("image/")||Ne.dataTransfer.items[0]?.type?.startsWith("image/")||Ne.dataTransfer.types.length===1&&ft("Drop to open"):(Ne.dataTransfer?.types.includes("text/html")||Ne.dataTransfer?.types.includes("text/plain"),Ne.dataTransfer.effectAllowed="none",Ne.dataTransfer.dropEffect="none"):Ne.type==="dragleave"&&ft(null),Ne.preventDefault())},[je]),ut=Te(Ne=>{if(je?.getCommand("openWorkbook")&&(Ne.preventDefault(),Ne.stopPropagation(),ft(null),Ne.dataTransfer.files&&Ne.dataTransfer.files.length>0)){const yt=Ne.dataTransfer.files[0];if(!yt)return;if(yt?.type?.startsWith("image/")){const Ht=le.current?.getGridElement().getViewFromClient(Ne.clientX,Ne.clientY);if(!Ht)return;const nn=Ht.getRelativePointFromClient(Ne.clientX,Ne.clientY),an=Ht.toAbsoluteBounds({...nn,width:0,height:0}),It=Ht.getCellCoordsFromClient(Ne.clientX,Ne.clientY);if(!It)return;je?.getCommand("insertImageFromFile")?.execute({file:yt,options:{bounds:{x:an.x,y:an.y}},goto:{range:{...It}}})}else je?.getCommand("openWorkbook")?.execute(yt)}},[je,rt]),vt=u.useMemo(()=>rt?s.jsx(Ae,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:Ne=>Ne.palette.divider,color:Ne=>Ne.palette.primary.dark},children:s.jsx(Tn,{variant:"h4",children:rt})}):null,[rt]),jt=u.useRef(null),Pt=u.useMemo(()=>s.jsx(Gh,{in:!ee,nodeRef:jt,timeout:500,classNames:"animating",unmountOnExit:!0,children:s.jsx(Ae,{style:{display:"flex",alignItems:"center",justifyContent:"center",left:"0px",top:"0px",width:"100%",height:"100%",pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",boxSizing:"border-box"},children:I({ref:jt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:ee?0:c?.opacity,pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...z}})})}),[ee,I,z]),Rt=u.useMemo(()=>b({sx:{marginTop:Ne=>Ne.spacing(.25),marginLeft:Ne=>Ne.spacing(1),marginRight:Ne=>Ne.spacing(1)},workbook:V,sheetElement:le.current,gridStyle:et,onFocus:pi,...v,NamedCollectionEditorProps:{restoreFocus:Ne=>le.current.focus(Ne),notifier:a,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:je,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},se),[b,v,V,et,je,ee]),zt=u.useCallback(Ne=>{const{movable:yt,...Ht}=Ne,nn={movable:yt,onContextMenuCapture:Pn=>{_r(Pn,yt)},...Ht},an=yt.getContent().getType();let It=null;if(an==="picture")return s.jsx(iS,{loadingPanel:s.jsx(Gl,{transitionDelay:"100",style:{position:"absolute"},sx:{border:Pn=>`solid 1px ${Pn.palette.action.active}`}}),picture:yt.getContent(),description:yt.getDescription()??yt?.getName(),...nn});if(an==="chart"){const Pn={...nn,chart:yt.getContent()};return s.jsx(RF,{...Pn})}if(It=`Float of type '${an}'.`,typeof It=="string"){const Pn={...nn,description:It};It=s.jsx(wF,{...Pn})}return s.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:It},yt.getUUID())},[]),Dt=u.useMemo(()=>O({style:m5,onFocus:Gi,notifier:a,gridStyle:et,headersStyle:Ye,sheet:Ee,commands:je,onSheetContextMenu:tr,onViewportChange:Ne=>{Ie(Ne)},showScrollbars:!1,viewportComponent:xe,onRepeatCommandChange:m,onElementLoad:we,onShowColumnTooltip:Ne=>{Ve(Ne.anchor,Ne.display,gp)},onShowRowTooltip:Ne=>{Ve(Ne.anchor,Ne.display,q5)},onShowTooltip:Ne=>{Ve({x:Ne.anchor.x,y:Ne.anchor.y,width:0,height:0},Ne.display,Ne.placement)},onCloseTooltip:()=>De(),renderMovable:zt,...A,cellRenderProps:{onFilterButtonMouseDown:(Ne,yt)=>{A?.cellRenderProps?.onFilterButtonMouseDown(Ne,yt),Fo(Ne,yt)},...A?.cellRenderProps}},le),[O,je,A,Ee,et,a,m]),gn=u.useMemo(()=>{if(!de)return null;const Ne=!Ue.isStructureAllowed();return s.jsx(Uf,{sx:{marginBottom:yt=>yt.spacing(.5),border:yt=>`solid ${Ne?yt.palette.action.disabled:pt(yt.palette.divider,.2)} 1px`,borderRadius:yt=>`${yt.shape.borderRadius}px`,overflow:"hidden"},onClose:()=>{Oe(!1),requestAnimationFrame(()=>{le.current.focus()})},readOnly:Ne,commands:je,ref:Le,scripts:V.getScripts()})},[de,je,V,a,Ue]),zn=u.useMemo(()=>{const Ne=s.jsx(j3,{style:{...m5,marginRight:gn&&kt?"0px":"6px"},viewport:Se,touchElement:le.current?.getGridElement()?.stage,onScrollViewport:It=>{le.current?.getGridElement()?.scrollTo(It)},showHorizontalScrollbar:Lt||tt,showVerticalScrollbar:Yt,createHorizontalScrollbar:tn,createVerticalScrollbar:pr,children:Dt});let yt=Ne;kt||(yt=s.jsxs(s.Fragment,{children:[Ne,xn]}));let Ht=null,nn=4,an=13;return kt?Ht="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(Ht="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",nn=13,an=4),s.jsx(K5,{fixedPane:"after",position:"40%",minAfter:kt?"280px":"120px",splitDirection:kt?"row":"column",style:m5,ref:yn,resizerProps:{className:"styled-resizer",style:{minWidth:kt?"6px":void 0,minHeight:kt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${nn}' height='${an}' viewBox='0 0 ${nn} ${an}' version='1.1' fill='${Z.palette.text.icon??Z.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${Ht}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:kt?"left center":"top center"}},elementBefore:yt,paneBeforeProps:{style:{flexDirection:"column"}},elementAfter:gn,paneAfterProps:{style:{marginLeft:kt?"0px":"4px",marginRight:kt?"8px":"4px"}}})},[Lt,tt,tn,Yt,Se,gn,Dt,xn,Z,kt]),Cn=u.useMemo(()=>({boxSizing:"border-box",background:Ne=>Ne.palette.mode!=="dark"?et.header.fill:Ne.palette.background.paper,"& *":{...Y3(Z),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${Jt} 1px`},...c}),[c,et]);return s.jsxs(Ti,{className:Eo("sheetxl-workbook","_sheetxl-workbook_1j3lu_5",{"Mui-focusVisible":re},"_sheetxl-theme_4opcr_2",p),sx:Cn,style:d,square:!1,...U,ref:J,onFocus:Ne=>{ge(!0),ui(),f?.(Ne)},onBlur:Ne=>{ge(!1),h?.(Ne)},onKeyDown:Ne=>{jr(Ne),g?.(Ne)},onDragStart:Ne=>{if(Ne.target.src){const yt=new Image;yt.src=Ne.target.src,Ne.dataTransfer.setDragImage(yt,1,1)}},onDragEnter:gt,onDragLeave:gt,onDragOver:gt,onDrop:ut,children:[s.jsxs("div",{className:Eo(nC),style:{flex:"1 1 100%",display:"flex",flexDirection:"column",opacity:ee?void 0:0,"--sxl-app-color-high-contrast":Z.palette.primary.main,"--sxl-app-color-primary":Z.palette.primary.main,"--sxl-app-color-primary-dark":Z.palette.primary.dark,"--sxl-app-color-primary-light":Z.palette.primary.light,"--sxl-app-color-info":Z.palette.info.main,"--sxl-app-color-info-dark":Z.palette.info.dark,"--sxl-app-color-info-light":Z.palette.info.light,"--sxl-app-color-secondary":Z.palette.secondary.main,"--sxl-app-color-secondary-dark":Z.palette.secondary.dark,"--sxl-app-color-secondary-light":Z.palette.secondary.light,"--sxl-app-color-success":Z.palette.success.main,"--sxl-app-color-success-dark":Z.palette.success.dark,"--sxl-app-color-success-light":Z.palette.success.light,"--sxl-app-color-warning":Z.palette.warning.main,"--sxl-app-color-warning-dark":Z.palette.warning.dark,"--sxl-app-color-warning-light":Z.palette.warning.light,"--sxl-app-color-error":Z.palette.error.main,"--sxl-app-color-error-dark":Z.palette.error.dark,"--sxl-app-color-error-light":Z.palette.error.light,"--sxl-app-color-text":Z.palette.text.primary,"--sxl-app-color-text-secondary":Z.palette.text.secondary,"--sxl-app-color-text-disabled":Z.palette.text.disabled,"--sxl-app-color-background":Z.palette.background.paper,"--sxl-app-color-button-surface":Z.palette.grey[600],"--sxl-app-color-shadow":Z.palette.action.focus,"--sxl-app-color-grey":Z.palette.grey[500],"--sxl-app-filter-dark-invert":et.body.darkMode&&H?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":et.body.darkMode?`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`:void 0},children:[rn,At?Rt:null,s.jsx(Ae,{sx:{marginBottom:Ne=>Ne.spacing(.75)}}),zn,Qt,s.jsx(di,{arrow:!0,disableInteractive:!0,open:W,title:s.jsx(Tn,{variant:"subtitle2",component:"div",children:oe}),placement:ie,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:K,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:W?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(fe.x,fe.y,fe.width,fe.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:s.jsx(Ae,{})}),bo,vt]}),Pt]})}));Zf.displayName="WorkbookElement";const IN=(e=!1,t=!1)=>t?null:{"& input:not(:focus):not(:hover)":{color:n=>n.palette.text.secondary},backgroundColor:n=>pt(n.palette.background.paper,.6),borderRadius:n=>`${n.shape.borderRadius}px`,border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:n=>n.palette.background.paper},"&:hover:not([disabled])":{border:n=>`solid ${e?n.palette.text?.primary:n.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:n=>`solid ${n.palette.primary.main} 1px !important`,border:n=>`1px solid ${n.palette?.primary?.main} !important`}},Xf=u.memo(u.forwardRef((e,t)=>{const{sx:n,workbook:o,title:r="",placeHolder:i="Untitled",onTitleChange:a,readOnly:l=!1,hidden:c,...d}=e,[p,f]=u.useState(!1),[h,g]=u.useState(!1),[m,y]=u.useState(r??""),[x,v]=u.useState(""),[b,{width:w}]=a1(),[M,{width:k}]=a1(),[j,_]=u.useState(!1),L=u.useRef(null),T=u.useRef(null),D=ir(t,()=>({requestWorkbookTitle:(C=null,S)=>{T.current={onAccept:C,requestReason:S?.requestReason},S?.selectAll&&L.current?.select(),L.current?.focus(S)},focus:C=>{L.current?.focus(C)}}),[]);return u.useLayoutEffect(()=>{_(r!==m),v(r),y(r)},[r]),u.useEffect(()=>{j&&w!==0&&Gt.debounce(()=>{_(!1)},300)()},[j,w]),u.useEffect(()=>{g(m&&!Ml.isValidWindowsFilename(m))},[m]),c?null:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:j?"0":"1",transition:j?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:W2([D,M,t]),...d,children:s.jsx(br,{label:T.current?.requestReason??"Workbook Name",children:s.jsxs(Ae,{className:Eo({"Mui-focusVisible":p}),sx:{visibility:w===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...IN(!0,l),...n},children:[l?s.jsx(Tn,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:m!==x?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:C=>h?C.palette.error.dark:void 0},children:r??i}):s.jsx(Kl,{sx:{width:`${Math.min(w+3,Math.max(k,D.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:C=>h?C.palette.error.dark:void 0,fontStyle:m!==x?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:l,spellCheck:!1,placeholder:i,onFocus:C=>{f(!0),C.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:L},onBlur:()=>{f(!1),h?y(x):(m!==x&&(a?.(m),m&&T.current?.onAccept?.(m,"blur")),T.current=null)},onChange:C=>{if(C.target.value.length>Ml.MAX_WORKBOOK_NAME_SIZE)return C.stopPropagation(),void C.preventDefault();y(C.target.value)},onKeyDown:C=>{(Ml.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(C.key)||C.target?.value.length>Ml.MAX_WORKBOOK_NAME_SIZE)&&C.preventDefault(),C.which===on.Enter||C.which===on.Tab?(h?y(x):(a?.(m),m&&(T.current?.onAccept?.(m,"keydown"),T.current=null)),C.stopPropagation(),C.preventDefault(),o?.focus()):C.which===on.Escape&&(m===x?o?.focus():(y(x),setTimeout(()=>{C.target?.select()},0)),T.current=null,C.stopPropagation(),C.preventDefault())},value:m}),s.jsx(Ae,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:m!==x?"italic":void 0,fontFamily:C=>C.typography.fontFamily,letterSpacing:"0.00938em"},children:m||i})]})})})}));Xf.displayName="WorkbookTitle";const PN=u.lazy(()=>Promise.resolve().then(()=>require("./DWTMnPR33rKK87Xt.cjs")).then(e=>e.ABtrpK9yMoHh6oPr).then(e=>e.E)),OC=u.memo(u.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,renderLoadingPanel:a,...l}=e;return i&&$.LicenseManager.setLicenseKey(i),u.useMemo(()=>{const c={transitionDelay:"160ms",transparentBackground:!0};return s.jsx(Ae,{sx:n,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},children:a?.(c)??s.jsx(Gl,{...c})})},[n,o,a]),s.jsx(s.Fragment,{children:s.jsx(PN,{...l,className:r,sx:n,renderLoadingPanel:a,style:o,ref:t})})}));OC.displayName="Studio";const ON=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],DN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class DC{constructor(t=ON,n=DN){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const t=[],n=this._readFormatType;for(let o=0;o<n.length;o++)for(let r=0;r<n[o].exts.length;r++)t.push("."+n[o].exts[r]);return t}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");try{return(await Promise.resolve().then(()=>uy)).WorkbookIO.writeFile(t,n,o)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(t,n){let o,r;const i=await n?.showBusy?.(`Opening${t.name?` ${t.name}`:""}...`);try{r=await Promise.resolve().then(()=>uy)}catch(a){throw a}try{return await r.WorkbookIO.read({...t,async onStart(a){await t?.onStart?.(a),o=await n?.showBusy?.(`Opening '${a}'...`)}})}catch(a){throw i?.(),o?.(),a}finally{i?.(),o?.()}}}const AC=new DC;(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-reset_ods65_1{display:block;margin:0;padding:0;line-height:normal}._sheetxl-reset_ods65_1 table,._sheetxl-reset_ods65_1 thead,._sheetxl-reset_ods65_1 tbody,._sheetxl-reset_ods65_1 tfoot,._sheetxl-reset_ods65_1 tr,._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:block;width:auto;height:auto;margin:0;padding:0;border:none;border-collapse:inherit;border-spacing:0;border-color:inherit;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0}._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:inline}html{color:initial}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4{fill:currentColor}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .activeColor{fill:var(--sxl-color-active)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .background{fill:var(--sxl-app-color-background)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .grey{fill:var(--sxl-app-color-grey)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .highContrast{fill:var(--sxl-app-color-high)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info{fill:var(--sxl-app-color-info)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.light{fill:var(--sxl-app-color-info-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.dark{fill:var(--sxl-app-color-info-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary{fill:var(--sxl-app-color-secondary)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.light{fill:var(--sxl-app-color-secondary-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.dark{fill:var(--sxl-app-color-secondary-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success{fill:var(--sxl-app-color-success)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.light{fill:var(--sxl-app-color-success-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.dark{fill:var(--sxl-app-color-success-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning{fill:var(--sxl-app-color-warning)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .light{fill:var(--sxl-app-color-warning-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .dark{fill:var(--sxl-app-color-warning-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error{fill:var(--sxl-app-color-error)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .light{fill:var(--sxl-app-color-error-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .dark{fill:var(--sxl-app-color-error-dark)}._sheetxl-workbook_1j3lu_5{display:flex;position:relative;overflow:hidden;flex-direction:column;width:100%;height:100%;outline:none}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer{background-color:var(--sxl-app-color-grey, grey)}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer:hover,._sheetxl-workbook_1j3lu_5 .splitPane.dragging .styled-resizer{background-color:var(--sxl-app-color-primary, blue)}._card_1a398_7{width:100%}._actionRoot_1a398_11{padding:8px 8px 8px 16px;justify-content:space-between}._icons_1a398_16{margin-left:auto;display:flex;align-items:center}._expand_1a398_22{padding:8px;transform:rotate(0);color:#d32f2f;transition:all .2s ease-in-out}._expandOpen_1a398_29{transform:rotate(180deg)}._stackTraceContainer_1a398_33{padding:16px}._paper_1a398_37{background-color:#fff;padding:16px}._checkIcon_1a398_42{font-size:20px;padding-right:4px}._button_1a398_47{padding:0;text-transform:none}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const LC=Object.freeze(Object.defineProperty({__proto__:null,AppearanceCommandButton:dC,AutoColorPosition:Os,BorderCommandButton:NS,BorderPopupButton:BS,BorderStyleButton:FS,ClearCommandButton:kf,ColorButton:V2,ColorCommandButton:Qs,ColorPanel:zS,ColorPanelType:AS,ColorPopupButton:Cf,DeleteCellsCommandButton:Mf,DocThemeCommandButton:cC,FillCommandButton:qS,FilterColumnMenu:Ff,FilterCommandButton:ZB,Filters:gC,FindCommandButton:HS,FontFamilyCommandButton:ZS,FontSizeCommandButton:WS,FormulaBar:zf,FreezeCommandButton:VS,HelpCommandButton:uC,HorizontalAlignCommandButton:Zv,InsertCellsCommandButton:Ef,InsertImageCommandButton:If,InsertScriptCommandButton:MC,LicenseManager:$.LicenseManager,MergeCommandButton:$S,NamedCollectionEditor:Lf,NamedInput:Pf,NumberFormatCommandButton:US,PasteCommandButton:jf,PresetCellStylesCommandButton:tC,PresetTableStylesCommandButton:iC,QuickFormulaSumCommandPopupButton:QB,RangeInput:Of,RunScriptCommandButton:qf,ScriptEditorToolbar:Wf,ScriptWorkspace:Uf,SheetTab:Bf,SheetTabMenu:Nf,SheetZoomScale:Df,SheetsAllMenu:$f,SortFilterCommandButton:Tf,StatusBar:Af,Studio:OC,StyledStrokeIcon:Uh,TableStyleCanvasPreview:oC,TableStyleOptionsPanel:rC,TableStylePreview:Rf,TextEffectsCommandButton:XS,TextOverflowCommandButton:Yv,TextRotateCommandButton:Jv,ThemeMode:wC,ThemeSelectButton:aC,ThemeSelectPanel:lC,ThemeSelectPopupButton:sC,UnderlineCommandButton:YS,UndoRedoCommandButton:_f,VerticalAlignCommandButton:Xv,ViewGridLinesCommandButton:KS,ViewHeadingsCommandButton:JS,WalkingCopyCommandButton:H2,WorkbookContextMenu:Gf,WorkbookElement:Zf,WorkbookIO:AC,WorkbookStrip:Kf,WorkbookTitle:Xf,WorkbookViewCommandButton:QS,_WorkbookIO:DC,createGridStyleFromMUITheme:Zh,defaultNewWorkbook:RC,renderWorkbookLoadingPanel:PC,useResolvedThemeMode:SC,useWorkbookCommands:jC},Symbol.toStringTag,{value:"Module"})),Xh=new Map,zC=(e,t={})=>{const{message:n,icon:o,customElement:r,hide:i=!1,className:a,cssVars:l={}}=t;if(i)return;const c=typeof e=="string"?document.querySelector(e):e;if(!c)return void console.warn(`Element with selector "${e}" not found for panel.`);let d;if(s1(e),r)d=r;else{d=document.createElement("div"),d.className=a?`sheetxl-panel ${a}`:"sheetxl-panel";const p=Object.entries(l).map(([g,m])=>`--sheetxl-panel-${g}: ${m};`).join(" "),f=`
223
+ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modifiers:[$e.Ctrl]}}),new We("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new We("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[$e.Alt]}]},function(S=!0){g?.()}),new We("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new We("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new We("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new We("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[$e.Ctrl]}}),new We("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new We("calculateAll",r,{label:"Calculate Now",description:"Recalculate all formulas.",shortcut:{key:"F9"}}),new Tt("calculate",r,{label:"Calculate Sheet",description:"Recalculate the formulas on the current sheet.",shortcut:{key:"=",modifiers:[$e.Ctrl]}}),new Tt("closeWorkbook",r,{label:"Close Workbook",description:"Close the workbook.",shortcut:{key:"W",modifiers:[$e.Ctrl]}}),new Tt("newWorkbook",r,{label:"New Workbook",description:"Create a new workbook in another tab.",shortcut:{key:"N",modifiers:[$e.Ctrl]}})],[]),x=u.useMemo(()=>{let S=null;return S=i?i.createChildGroup(r,"workbook",!1):new a0(r,"workbook"),S.addCommands(y,!0),S},[i,y]),v=Wi(),b=u.useRef(null),w=Te(()=>{let S,R=null;const P=x.getCommand("executeScript");if(P.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!P)return;const I=x.getCommand("executeSelectedScript");if(!I)return;const z={saveSource:async A=>{let O=null,N=null;const F=t.getScripts();try{A&&(N=await o?.showBusy?.("Saving Scripts..."),O=await F.createModule({source:A})),F.addModule("scripts",O,{replace:!0}),N?.()}catch(E){N?.(),console.warn("Unable to compile",E),o?.showError?.(E)}return O},addContainerListener:A=>(M.current=A,()=>{M.current=null}),setSelectedFunction:A=>{S=A??b.current??null,Promise.resolve(S).then(O=>{I.update({disabled:O===null})})},quickInsertFunction:A=>{const O=`=${A.toUpperCase()}(`,N={text:O+")",editMode:!0,initialSelection:{start:O.length,end:O.length+0}};v.setMode(F=>F?.key==="edit"?{...F,args:{...F.args}}:{key:"edit",args:{stateAndCoords:null,start:N}})},getSelectedFunction:()=>S,setEditor:A=>{R=A??null,x.getCommand("showScriptEditor")?.update({state:A!==null})},getEditor:()=>R,getRanges:A=>{try{return t.getRanges(A)}catch{}return null},getScripts:()=>t.getScripts(),isReadOnly:()=>t.getProtection().isStructureAllowed()===!1};I.update({context:z})},[x,t,n,o]),M=u.useRef(null);cn(t,{onBeforeSave:async()=>{await M.current?.onBeforeSave()},onProtectionChange:()=>{M.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),M.current?.onScriptChange()))()}}),cn(t,{onSheetsChange:S=>{h(S.getSheets().search())},onViewChange(S){p(S?.getSelectedSheet())},onProtectionChange:S=>{const R={disabled:!S.getProtection().isStructureAllowed()};x.getCommand("hideSheet").update(R),x.getCommand("deleteSheet").update(R),x.getCommand("addSheet").update(R),x.getCommand("duplicateSheet").update(R),x.getCommand("selectTheme").update(R),x.getCommand("addNamedReference").update(R),x.getCommand("editNamedReference").update(R),x.getCommand("deleteNamedReference").update(R)},onScriptsChange:S=>{w()}});const{isFullscreenAvailable:k,isFullscreenEnabled:j,toggleFullscreen:_}=function(S={}){const{target:R,onChange:P,onError:I,requestFullScreenOptions:z}=S,[A,O]=u.useState(!1),[N,F]=u.useState(null),[E,B]=u.useState(!1),H=u.useCallback(()=>na.requestFullscreen(R?.current||null,z),[R,z]),U=u.useCallback(()=>na.exitFullscreen(),[]),Z=u.useCallback(()=>na.fullscreenElement?U():H(),[H,U]),G=u.useCallback(le=>{const re=na.fullscreenElement;F(re),B(!!re),P?.(le)},[P]),V=u.useCallback(le=>{const re=na.fullscreenElement;F(re),B(!!re),I?.(le)},[I]);return u.useEffect(()=>{O(na.fullscreenEnabled)},[]),u.useEffect(()=>(na.on("change",G),na.on("error",V),()=>{na.off("change",G),na.off("error",V)}),[G,V]),{isFullscreenAvailable:A,fullscreenElement:N,isFullscreenEnabled:E,enableFullscreen:H,disableFullscreen:U,toggleFullscreen:Z}}({target:{current:n??document.body}}),L=wf();u.useEffect(()=>{x.getCommand("selectTheme").update({state:()=>t.getTheme(),context:()=>({theme:t.getTheme(),themes:L,darkMode:a})})},[t?.getTheme(),a]);const T=Te(async function(S,R){let P=null;const I=t.getScripts();if(S?.declaration||S?.functionName){const z=S.declaration?S.declaration.getName():S.functionName;I.searchFunction({name:z}).length>0&&(P=z)}if(P)try{await I.executeMacro(P),b.current=Promise.resolve({source:null,name:P})}catch(z){return void o?.showError?.(z)}},[t,o]);u.useEffect(()=>{x.getCommand("newCellStyle").updateCallback(S=>{o?.showInputOptions?.({initialValue:(()=>{let R=0;for(;;){R++;const P=`Style ${R}`;try{return t.getStyles().validateStyleName(P,!0),P}catch{}}})(),title:x.getCommand("newCellStyle")?.label("cellStyle"),description:"Enter a name for the new cell style.",inputLabel:"Style Name",inputProps:{style:{minWidth:"300px"}},options:["Ok","Cancel"],defaultOption:"Ok",onValidateInputOption:async(R,P)=>{let I=null;try{t.getStyles().validateStyleName(R,!1)}catch(O){I=O.message}let z=t.getStyles().getNamed(R),A=I;return!A&&z&&(A=`Update style '${z.getName()}'.`),{valid:I===null,message:A}}}).then(({input:R,option:P})=>{const I=t.getSelectedSheet().getSelectedRange();if(P!=="Ok")return;const z=t.getStyles().setNamed({name:R,style:I.getCell().getStyle()});I.updateStyle({named:z.getName()})})}),x.getCommand("deleteCellStyle").updateCallback(S=>{S.delete()}),x.getCommand("modifyCellStyle").updateCallback(({named:S})=>{const R=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:S.getName(),style:R.getCell().getStyle()})}),x.getCommand("hideSheet").updateCallback(S=>{t.getSheetAt(S).setVisibility($.ISheet.Visibility.Hidden)}),x.getCommand("deleteSheet").updateCallback(async S=>{t.getSheetAt(S??t.getSelectedSheetIndex())?.delete()}),x.getCommand("addSheet").updateCallback(S=>{t.getSheets().add({index:S,autoSelect:!0})}),x.getCommand("duplicateSheet").updateCallback(async S=>{(await t.getSheetAt(S??t.getSelectedSheetIndex())?.duplicate())?.select()}),x.getCommand("nextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("previousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectNextSheet").updateCallback(S=>{t.getNextSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectPreviousSheet").updateCallback(S=>{t.getPreviousSheet(S??t.getSelectedSheetIndex()).select()}),x.getCommand("selectTheme").updateCallback(S=>{t.setTheme(S)}),x.getCommand("calculateAll").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),x.getCommand("calculate").updateCallback(()=>{t.getSelectedSheet().getEntireRange().calculate(!0)}),x.getCommand("closeWorkbook").updateCallback(async()=>{await o?.showOptions({title:"Confirm",description:"This will close the current workbook tab. Do you want to continue?",options:["Close","Cancel"],defaultOption:"Close"})==="Close"&&window.close()}),x.getCommand("newWorkbook").updateCallback(()=>{m?.()}),x.getCommand("executeScript").updateCallback(T),x.getCommand("executeSelectedScript").updateCallback(T)},[t,o]);const D=Te(async S=>{let R=0,P=null,I="Find & Replace";S?.replace&&!S?.replaceOptions?.maxCount&&(I="Replace All");const z=await o?.showBusy?.(I);try{const A=S?.scope??"sheet";let O=null;const N={from:t.getSelectedSheet().getSelectedCell(),...S.findOptions};if(O=A==="sheet"?t.getSelectedSheet().find(S.findText,N):t.find(S.findText,N),S.replace){const F=t.replace(O,S.replaceText,S.replaceOptions);R=F.count,S.replaceOptions.maxCount&&(P=F.last)}else{let F=O.next();F.done||(R++,P=F.value)}P?.select({autoFocus:!1}),z?.(),!S.replaceOptions.maxCount&&R>1&&o?.showMessage?.(`We replaced ${R} cells.`)}catch(A){z?.(),o?.showError?.(A)}return R},[t,n]),C=Te(S=>{const R={value:S,context:{selection:()=>{const P=t.getSelectedRanges(),I=[];for(let z=0;z<P.getCount();z++){const A=P.at(z).getFixed(!0).getCoords();I.push(A)}return t.getRanges(I)},getNames:()=>t.getNames()},onUpdate:async P=>{try{await P.select()}catch(I){o?.showMessage?.(I.message,{type:pa.Error})}}};return o.showWindow?.("namedDetails",R)},[o,t,n]);return u.useEffect(()=>{const S=(R=!1)=>{const P=t.getSelectedCell(),I={onFindOrReplace:D,onKeyDown:z=>{x.findCommandByEvent(z)!==x.getCommand("find")&&x.findCommandByEvent(z)!==x.getCommand("findReplace")||z.preventDefault()},findOptions:{},findText:P.toTextUnformatted(!0)};I.replace=R,o.showWindow?.("find",I,{disableAutoDestroy:!0})};x.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S()}),x.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{S(!0)}),x.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const R={onInputOption:async P=>{try{await t.getRanges(P).select()}catch(I){o?.showMessage?.(I.message,{type:pa.Error})}},onKeyDown:P=>{x.findCommandByEvent(P)===x.getCommand("goto")&&P.preventDefault()},title:x.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(R)}),x.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async R=>{if(R)try{await R.select()}catch(P){o?.showError?.(P)}}),x.getCommand("addNamedReference")?.updateCallback(async function(R){C(null)}),x.getCommand("editNamedReference")?.updateCallback(async function(R){C(R)}),x.getCommand("deleteNamedReference")?.updateCallback(async function(R){R?.delete?.()}),x.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),cn(t?.getView(),{onViewChange:S=>{x.getCommand("workbookViewToggleShowFormulaBar").update({state:S.isShowFormulaBar()}).updateCallback(()=>{S.setShowFormulaBar(!S.isShowFormulaBar())}),x.getCommand("workbookViewToggleShowTabs").update({state:S.isShowTabs()}).updateCallback(()=>{S.setShowTabs(!S.isShowTabs())}),x.getCommand("workbookViewToggleShowStatusBar").update({state:S.isShowStatusBar()}).updateCallback(()=>{S.setShowStatusBar(!S.isShowStatusBar())}),x.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:S.isShowHorizontalScrollbar()}).updateCallback(()=>{S.setShowHorizontalScrollbar(!S.isShowHorizontalScrollbar())}),x.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:S.isShowVerticalScrollbar()}).updateCallback(()=>{S.setShowVerticalScrollbar(!S.isShowVerticalScrollbar())})}}),u.useEffect(()=>{x.getCommand("fullScreenToggle").update({state:j,disabled:!k}).updateCallback(()=>{_()})},[j,k]),u.useEffect(()=>{const S=t.getProtection().isStructureAllowed();x.getCommand("hideSheet").update({disabled:f.length<=1||!S}),x.getCommand("deleteSheet").update({disabled:f.length<=1||!S})},[f,d]),x},RC=()=>{window.open(window.origin.toString(),"sheetxl-"+$.CommonUtils.uuidV4(),"popup=true")},IC=u.memo(u.forwardRef((e,t)=>{const{movable:n,commands:o,disabled:r,sx:i,floatReference:a,...l}=e;cn(n,{onAnyChange(m){}});const c=u.useMemo(()=>({}),[]),d=u.useMemo(()=>({commandHook:{beforeExecute:(m,y)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,parentFloat:a}),[r,a]),p=u.useMemo(()=>({variant:Zt.Menuitem,...c,...d}),[c,d]),f=u.useMemo(()=>({commands:o,variant:Zt.Menuitem,parentFloat:a,...d}),[o,d,a]),h=m=>{switch(m?.key()){case"moveToFront":return ze(s.jsx(sD,{}));case"moveForward":return ze(s.jsx(cD,{}));case"moveToBack":return ze(s.jsx(lD,{}));case"moveBackward":return ze(s.jsx(dD,{}));case"toggleLockAspectRatio":return ze(s.jsx(K7,{}));case"formatDrawAlignLeft":return ze(s.jsx(Z7,{}));case"formatDrawAlignCenter":return ze(s.jsx(uD,{}));case"formatDrawAlignRight":return ze(s.jsx(pD,{}));case"formatDrawAlignTop":return ze(s.jsx(hD,{}));case"formatDrawAlignMiddle":return ze(s.jsx(fD,{}));case"formatDrawAlignBottom":return ze(s.jsx(mD,{}));case"formatDrawDistributeHorz":return ze(s.jsx(gD,{}));case"formatDrawDistributeVert":return ze(s.jsx(yD,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ze(s.jsx(G7,{}));default:return null}},g=s.jsxs(s.Fragment,{children:[s.jsx(H2,{command:o.getCommand("copy"),...p,variant:Zt.Menuitem}),[],s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),s.jsx(ca,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ge,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ze(s.jsx(K7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["formatDrawAlignLeft","formatDrawAlignCenter","formatDrawAlignRight",null,"formatDrawAlignTop","formatDrawAlignMiddle","formatDrawAlignBottom",null,"formatDrawDistributeHorz","formatDrawDistributeVert"],label:"Align",icon:m=>h(m)||ze(s.jsx(Z7,{})),tooltip:"Quickly change the placement of your drawings."}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(ca,{...f,popupCommandKeys:["formatAnchorTypeTwoCell","formatAnchorTypeOneCell","formatAnchorTypeAbsolute"],label:"Sizing",icon:m=>h(m)||ze(s.jsx(G7,{})),tooltip:"Determine how the drawing size will adjust as the cell sizes adjust."}),[]]});return s.jsx(Ae,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...l,children:g})}));IC.displayName="MovableContextMenu";const CN={fireOnModelChange:!1},m5={flex:"1 1 100%",display:"flex"},kN=e=>s.jsx(Af,{...e}),EN=e=>s.jsx(Kf,{...e}),MN=e=>s.jsx(IC,{...e}),TN=e=>s.jsx(Gf,{...e}),_N=e=>s.jsx(Ff,{...e}),jN=(e,t)=>s.jsx(zf,{ref:t,...e}),PC=e=>s.jsx(Gl,{...e}),RN=(e,t)=>s.jsx(rS,{ref:t,...e}),Zf=u.memo(u.forwardRef((e,t)=>{const{workbook:n,createWorkbookOptions:o,onNewWorkbook:r,onElementLoad:i,notifier:a,autoFocus:l=!1,sx:c,style:d,className:p,onFocus:f,onBlur:h,onKeyDown:g,onRepeatCommandChange:m,commands:y,showFormulaBar:x,formulaBarProps:v,renderFormulaBar:b=jN,showTabs:w,tabsProps:M,renderTabs:k=EN,showStatusBar:j,statusBarProps:_,renderStatusBar:L=kN,toolbarProps:T,renderToolbar:D=_C,contextMenuSx:C,renderContextMenu:S=TN,renderFilterMenu:R=_N,renderMovableMenu:P=MN,renderLoadingPanel:I=PC,loadingPanelProps:z,sheetProps:A,renderSheet:O=RN,showHorizontalScrollbar:N,showVerticalScrollbar:F,gridTheme:E,headersTheme:B,enableDarkImages:H,...U}=e,Z=Ki(),G=wf(),V=u.useMemo(()=>{const Ne={theme:G.getDefaultTheme(),...o};return n??new $.Workbook(Ne)},[n]),le=u.useRef(null),[re,ge]=u.useState(!1),Q=u.useRef(null),xe=u.useMemo(()=>s.jsx(Ae,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:Q}),[]),[be,Fe]=u.useState(!1),[ee,ae]=u.useState(!1),we=u.useCallback(()=>{Fe(!0)},[]),se=u.useRef(null),J=ir(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>V,getSheetElement:()=>le.current,getViewportElement:()=>Q.current,getFormulaBarElement:()=>se.current,focus(){le&&le.current&&le.current.focus()}}),[V]),ce=u.useRef(null);u.useLayoutEffect(()=>{be&&J.current&&(ae(!0),ce.current!==i&&(i?.({source:J.current}),ce.current=i))},[be,J.current]),J.current;const ne=u.useCallback(Ne=>(le.current?.submitEdit(),!0),[]),Pe=u.useCallback(()=>{requestAnimationFrame(()=>{le?.current?.focus()})},[]),[Ee,it]=u.useState(V?.getSelectedSheet()),[Ue,ke]=u.useState(V?.getProtection());cn(V,{onSheetsChange:Ne=>{it(Ne?.getSelectedSheet())},onViewChange(Ne){it(Ne?.getSelectedSheet())},onProtectionChange:Ne=>{ke(Ne?.getProtection())}}),cn(V,{onRequestSelect:async(Ne,yt)=>new Promise(Ht=>{le.current.getSheet()!==yt?le.current.getGridElement()?.onViewChangeOnce(()=>{le.current.getSheet()!==yt&&Ht(!1),Ht(!0)}):Ht(!0)})},CN);const[_e,Xe]=u.useReducer(Ne=>Ne+1,0),Be=V?.getView();cn(Be,{onViewChange:Ne=>{Xe()}});const ct=E??Z,et=u.useMemo(()=>Zh(Z,ct),[Z,ct]),he=B??Z,Ye=u.useMemo(()=>Zh(Z,he),[Z,he]),[Se,Ie]=u.useState(null);u.useCallback(()=>{le.current.focus()},[]);const[de,Oe]=u.useState(!1),Le=u.useRef(null),je=jC({workbook:V,workbookElement:J.current,commandTarget:()=>le.current,notifier:a,commands:y,darkMode:et.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{de?Le.current?.focus():Oe(!0)}}),K=u.useRef(null),[W,te]=u.useState(!1),[oe,ue]=u.useState(null),[ie,pe]=u.useState(gp),[fe,ye]=u.useState($.TypesUtils.EmptyBounds),De=()=>{te(!1),ue(null)},Ve=(Ne,yt,Ht=gp)=>{ye(Ne),pe(Ht),ue(yt),K.current!==null&&K.current.update(),te(!0)},[Je,ot]=u.useState("sheet"),tt=w??Be?.isShowTabs(),Lt=N??Be?.isShowHorizontalScrollbar(),At=x??Be?.isShowFormulaBar(),_t=j??Be?.isShowStatusBar(),Yt=F??Be?.isShowVerticalScrollbar(),Jt=et?.header?.edgeStrokeFill||"rgb(171,171,171)",Qt=u.useMemo(()=>_t?L({sheet:Ee,gridStyle:et,..._}):null,[L,_,_t,et,Ee]),rn=u.useMemo(()=>D({commands:je,workbook:J.current,...T}),[je,D,T,Z]),[yn,{width:dn}]=a1(),kt=dn===0||dn>560,xn=u.useMemo(()=>{if(!tt)return null;let Ne=k({background:et.body.fill,borderWidth:1,borderColor:Jt,gridTheme:ct,gridStyle:et,onBeforeUserChange:ne,onUserChange:Pe,workbook:V,commands:je,sheetTabProps:{},notifier:a,...M});return kt||(Ne=s.jsx("div",{style:{flex:"none",display:"flex"},children:Ne})),Ne},[k,M,a,Z,V,ct,kt,je,tt]),tn=u.useCallback(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;let Ht=null,nn=null,an=null;if(Lt&&(nn=s.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${Jt} 1px`,maxWidth:"100%"},children:s.jsx(qu,{style:{alignItems:"center",borderTop:(yt?6:3)+"px solid transparent",borderBottom:(kt?6:3)+"px solid transparent",borderLeft:(yt?3:0)+"px solid transparent",borderRight:(yt?3:0)+"px solid transparent"},...Ne,endGap:700,sheet:Ee,showCustomScrollButtons:!yt,onShowTooltip:It=>{Ve({x:It.anchor.x,y:It.anchor.y,width:0,height:0},It.display,It.placement)},onCloseTooltip:()=>De()})})),tt&&kt&&(an=xn),tt&&kt&&!Lt&&(an=s.jsxs(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[an,s.jsx(Ae,{sx:{borderTop:`solid ${Jt} 1px`,flex:"1"}})]})),an&&Lt)Ht=s.jsx(K5,{position:V.getView().getTabRatio()/10+"%",onPositionChange:({percent:It})=>{V.getView().setTabRatio(Math.round(10*It))},minBefore:"200px",minAfter:"180px",resizerProps:{style:{minWidth:"11px",backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${Z.palette.text.icon??Z.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:"no-repeat",backgroundPosition:"center",borderTop:`solid ${Jt} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:an,elementAfter:nn});else if(Lt)Ht=nn;else{if(!an)return s.jsx(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:_t?null:`solid ${Jt} 1px`}});Ht=an}return s.jsx(Ae,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:Ht})},[Ee,ne,V,et,ct,je,tt,Lt,_t,kt]),[_n,Nn]=u.useState(null),fn=u.useMemo(()=>({placement:"right-start",..._n?.popperProps}),[_n?.popperProps]),{reference:fo,component:bo}=ha({label:"contextMenu",popperProps:fn,anchor:_n?.anchor??{getBoundingClientRect:()=>new DOMRect(_n?.clientX||0,_n?.clientY||0)},onClose:()=>Nn(null),createPopupPanel:_n?.createPopupPanel});u.useEffect(()=>{_n?fo.open(0):fo.close(0)},[_n]);const Fo=Te((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),_n&&_n.anchor===Ne.currentTarget?Nn(null):Nn({anchor:Ne.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:Ht=>{const{floatReference:nn}=Ht;return R({filter:yt,commands:je,floatReference:nn,sx:{...C}})}})},[R,C,je,V,_n]),tr=Te(Ne=>{if(Ne.originalEvent?.isDefaultPrevented())return!0;Ne.originalEvent?.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:yt=>{const{floatReference:Ht}=yt;return S({commands:je,workbook:V,floatReference:Ht,sx:{...C}})}})},[S,C,je,V]),_r=Te((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:Ht=>{const{floatReference:nn}=Ht;return P({movable:yt,commands:je,floatReference:nn,sx:{...C}})}})},[P,C,je]);u.useMemo(()=>{const Ne=[new Tt("openContextMenu",()=>le.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[$e.Shift]},{key:"ContextMenu"}]})];je.addCommands(Ne,!0)},[je]),u.useEffect(()=>{je.getCommand("openContextMenu").updateCallback(()=>{const Ne=Ee.getSelection().getCoords().cell;le.current?.getGridElement()?.scrollCellCoordsIntoView(Ne).then(yt=>{requestAnimationFrame(()=>{const Ht=Ee.getView().getZoomScale()/100,nn=Ee.getColumnHeaders().findOffset(Ne.colIndex+1)*Ht,an=Ee.getRowHeaders().findOffset(Ne.rowIndex+1)*Ht,It=le.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};tr({clientX:nn-It.x-yt.left+6,clientY:an-It.y-yt.top+6})})})})},[Ee]);const jr=Te(Ne=>{je?.dispatchToFocusedCommand(Ne)},[je]),ui=Te(()=>{J.current},[V,J.current]),Gi=u.useCallback(()=>{ot("sheet")},[]),pi=u.useCallback(()=>{ot("formulaBar")},[]),pr=Te(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;return s.jsx(qu,{style:{borderLeft:"3px solid transparent",borderRight:"0px solid transparent",borderTop:(yt?3:0)+"px solid transparent",borderBottom:(yt?3:0)+"px solid transparent",width:yt?"13px":void 0},...Ne,sheet:Ee,endGap:700,showCustomScrollButtons:!yt,onShowTooltip:Ht=>{Ve(Ht.anchor,Ht.display,"left")},onCloseTooltip:()=>De()})},[Ee]);u.useEffect(()=>{l&&le&&le.current&&le.current.focus()},[]);const[rt,ft]=u.useState(null),gt=u.useCallback(Ne=>{je?.getCommand("openWorkbook")&&(Ne.type==="dragenter"||Ne.type==="dragover"?Ne.dataTransfer?.types.includes("Files")?Ne.dataTransfer.files[0]?.type?.startsWith("image/")||Ne.dataTransfer.items[0]?.type?.startsWith("image/")||Ne.dataTransfer.types.length===1&&ft("Drop to open"):(Ne.dataTransfer?.types.includes("text/html")||Ne.dataTransfer?.types.includes("text/plain"),Ne.dataTransfer.effectAllowed="none",Ne.dataTransfer.dropEffect="none"):Ne.type==="dragleave"&&ft(null),Ne.preventDefault())},[je]),ut=Te(Ne=>{if(je?.getCommand("openWorkbook")&&(Ne.preventDefault(),Ne.stopPropagation(),ft(null),Ne.dataTransfer.files&&Ne.dataTransfer.files.length>0)){const yt=Ne.dataTransfer.files[0];if(!yt)return;if(yt?.type?.startsWith("image/")){const Ht=le.current?.getGridElement().getViewFromClient(Ne.clientX,Ne.clientY);if(!Ht)return;const nn=Ht.getRelativePointFromClient(Ne.clientX,Ne.clientY),an=Ht.toAbsoluteBounds({...nn,width:0,height:0}),It=Ht.getCellCoordsFromClient(Ne.clientX,Ne.clientY);if(!It)return;je?.getCommand("insertImageFromFile")?.execute({file:yt,options:{bounds:{x:an.x,y:an.y}},goto:{range:{...It}}})}else je?.getCommand("openWorkbook")?.execute(yt)}},[je,rt]),vt=u.useMemo(()=>rt?s.jsx(Ae,{sx:{position:"absolute",width:"100%",height:"100%",boxSizing:"border-box",pointerEvents:"none",display:"flex",justifyContent:"center",alignItems:"center",background:Ne=>Ne.palette.divider,color:Ne=>Ne.palette.primary.dark},children:s.jsx(Tn,{variant:"h4",children:rt})}):null,[rt]),jt=u.useRef(null),Pt=u.useMemo(()=>s.jsx(Gh,{in:!ee,nodeRef:jt,timeout:500,classNames:"animating",unmountOnExit:!0,children:s.jsx(Ae,{style:{display:"flex",alignItems:"center",justifyContent:"center",left:"0px",top:"0px",width:"100%",height:"100%",pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",boxSizing:"border-box"},children:I({ref:jt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:ee?0:c?.opacity,pointerEvents:ee?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...z}})})}),[ee,I,z]),Rt=u.useMemo(()=>b({sx:{marginTop:Ne=>Ne.spacing(.25),marginLeft:Ne=>Ne.spacing(1),marginRight:Ne=>Ne.spacing(1)},workbook:V,sheetElement:le.current,gridStyle:et,onFocus:pi,...v,NamedCollectionEditorProps:{restoreFocus:Ne=>le.current.focus(Ne),notifier:a,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:je,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},se),[b,v,V,et,je,ee]),zt=u.useCallback(Ne=>{const{movable:yt,...Ht}=Ne,nn={movable:yt,onContextMenuCapture:Pn=>{_r(Pn,yt)},...Ht},an=yt.getContent().getType();let It=null;if(an==="picture")return s.jsx(iS,{loadingPanel:s.jsx(Gl,{transitionDelay:"100",style:{position:"absolute"},sx:{border:Pn=>`solid 1px ${Pn.palette.action.active}`}}),picture:yt.getContent(),description:yt.getDescription()??yt?.getName(),...nn});if(an==="chart"){const Pn={...nn,chart:yt.getContent()};return s.jsx(RF,{...Pn})}if(It=`Float of type '${an}'.`,typeof It=="string"){const Pn={...nn,description:It};It=s.jsx(wF,{...Pn})}return s.jsx("div",{style:{position:"absolute",clipPath:"inset(0px)",display:"flex",alignItems:"stretch",justifyContent:"stretch",pointerEvents:"all"},children:It},yt.getUUID())},[]),Dt=u.useMemo(()=>O({style:m5,onFocus:Gi,notifier:a,gridStyle:et,headersStyle:Ye,sheet:Ee,commands:je,onSheetContextMenu:tr,onViewportChange:Ne=>{Ie(Ne)},showScrollbars:!1,viewportComponent:xe,onRepeatCommandChange:m,onElementLoad:we,onShowColumnTooltip:Ne=>{Ve(Ne.anchor,Ne.display,gp)},onShowRowTooltip:Ne=>{Ve(Ne.anchor,Ne.display,q5)},onShowTooltip:Ne=>{Ve({x:Ne.anchor.x,y:Ne.anchor.y,width:0,height:0},Ne.display,Ne.placement)},onCloseTooltip:()=>De(),renderMovable:zt,...A,cellRenderProps:{onFilterButtonMouseDown:(Ne,yt)=>{A?.cellRenderProps?.onFilterButtonMouseDown(Ne,yt),Fo(Ne,yt)},...A?.cellRenderProps}},le),[O,je,A,Ee,et,a,m]),gn=u.useMemo(()=>{if(!de)return null;const Ne=!Ue.isStructureAllowed();return s.jsx(Uf,{sx:{marginBottom:yt=>yt.spacing(.5),border:yt=>`solid ${Ne?yt.palette.action.disabled:pt(yt.palette.divider,.2)} 1px`,borderRadius:yt=>`${yt.shape.borderRadius}px`,overflow:"hidden"},onClose:()=>{Oe(!1),requestAnimationFrame(()=>{le.current.focus()})},readOnly:Ne,commands:je,ref:Le,scripts:V.getScripts()})},[de,je,V,a,Ue]),zn=u.useMemo(()=>{const Ne=s.jsx(j3,{style:{...m5,marginRight:gn&&kt?"0px":"6px"},viewport:Se,touchElement:le.current?.getGridElement()?.stage,onScrollViewport:It=>{le.current?.getGridElement()?.scrollTo(It)},showHorizontalScrollbar:Lt||tt,showVerticalScrollbar:Yt,createHorizontalScrollbar:tn,createVerticalScrollbar:pr,children:Dt});let yt=Ne;kt||(yt=s.jsxs(s.Fragment,{children:[Ne,xn]}));let Ht=null,nn=4,an=13;return kt?Ht="m 3.6261898,11.36243 c 0,0.88365 -0.71627,1.59991 -1.59991,1.59991 -0.8836498,0 -1.60004965,-0.71626 -1.60004965,-1.59991 0,-0.88365 0.71639985,-1.6000508 1.60004965,-1.6000508 0.88364,0 1.59991,0.7164008 1.59991,1.6000508 m 0,-4.881294 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 -0.8836498,0 -1.60004965,-0.7164 -1.60004965,-1.60004 0,-0.88365 0.71639985,-1.60005 1.60004965,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-4.881226 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 1.14263,3.19996 0.42623015,2.48356 0.42623015,1.59991 0.42623015,0.71626 1.14263,0 2.0262798,0 c 0.88364,0 1.59991,0.71626 1.59991,1.59991":(Ht="M 1.59991,3.62619 C 0.71626,3.62619 0,2.90992 0,2.02628 0,1.1426301 0.71626,0.42623015 1.59991,0.42623015 c 0.88365,0 1.6000508,0.71639995 1.6000508,1.60004985 0,0.88364 -0.7164008,1.59991 -1.6000508,1.59991 m 4.881294,0 c -0.88364,0 -1.60004,-0.71627 -1.60004,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60004,-1.60004985 0.88365,0 1.60005,0.71639995 1.60005,1.60004985 0,0.88364 -0.7164,1.59991 -1.60005,1.59991 m 4.881226,0 c -0.88365,0 -1.60005,-0.71627 -1.60005,-1.59991 0,-0.8836499 0.7164,-1.60004985 1.60005,-1.60004985 0.88365,0 1.59991,0.71639995 1.59991,1.60004985 0,0.88364 -0.71626,1.59991 -1.59991,1.59991",nn=13,an=4),s.jsx(K5,{fixedPane:"after",position:"40%",minAfter:kt?"280px":"120px",splitDirection:kt?"row":"column",style:m5,ref:yn,resizerProps:{className:"styled-resizer",style:{minWidth:kt?"6px":void 0,minHeight:kt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${nn}' height='${an}' viewBox='0 0 ${nn} ${an}' version='1.1' fill='${Z.palette.text.icon??Z.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${Ht}' /%3E%3C/svg%3E%0A")`,maskRepeat:"no-repeat",maskPosition:kt?"left center":"top center"}},elementBefore:yt,paneBeforeProps:{style:{flexDirection:"column"}},elementAfter:gn,paneAfterProps:{style:{marginLeft:kt?"0px":"4px",marginRight:kt?"8px":"4px"}}})},[Lt,tt,tn,Yt,Se,gn,Dt,xn,Z,kt]),Cn=u.useMemo(()=>({boxSizing:"border-box",background:Ne=>Ne.palette.mode!=="dark"?et.header.fill:Ne.palette.background.paper,"& *":{...Y3(Z),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${Jt} 1px`},...c}),[c,et]);return s.jsxs(Ti,{className:Eo("sheetxl-workbook","_sheetxl-workbook_1j3lu_5",{"Mui-focusVisible":re},"_sheetxl-theme_4opcr_2",p),sx:Cn,style:d,square:!1,...U,ref:J,onFocus:Ne=>{ge(!0),ui(),f?.(Ne)},onBlur:Ne=>{ge(!1),h?.(Ne)},onKeyDown:Ne=>{jr(Ne),g?.(Ne)},onDragStart:Ne=>{if(Ne.target.src){const yt=new Image;yt.src=Ne.target.src,Ne.dataTransfer.setDragImage(yt,1,1)}},onDragEnter:gt,onDragLeave:gt,onDragOver:gt,onDrop:ut,children:[s.jsxs("div",{className:Eo(nC),style:{flex:"1 1 100%",display:"flex",flexDirection:"column",opacity:ee?void 0:0,"--sxl-app-color-high-contrast":Z.palette.primary.main,"--sxl-app-color-primary":Z.palette.primary.main,"--sxl-app-color-primary-dark":Z.palette.primary.dark,"--sxl-app-color-primary-light":Z.palette.primary.light,"--sxl-app-color-info":Z.palette.info.main,"--sxl-app-color-info-dark":Z.palette.info.dark,"--sxl-app-color-info-light":Z.palette.info.light,"--sxl-app-color-secondary":Z.palette.secondary.main,"--sxl-app-color-secondary-dark":Z.palette.secondary.dark,"--sxl-app-color-secondary-light":Z.palette.secondary.light,"--sxl-app-color-success":Z.palette.success.main,"--sxl-app-color-success-dark":Z.palette.success.dark,"--sxl-app-color-success-light":Z.palette.success.light,"--sxl-app-color-warning":Z.palette.warning.main,"--sxl-app-color-warning-dark":Z.palette.warning.dark,"--sxl-app-color-warning-light":Z.palette.warning.light,"--sxl-app-color-error":Z.palette.error.main,"--sxl-app-color-error-dark":Z.palette.error.dark,"--sxl-app-color-error-light":Z.palette.error.light,"--sxl-app-color-text":Z.palette.text.primary,"--sxl-app-color-text-secondary":Z.palette.text.secondary,"--sxl-app-color-text-disabled":Z.palette.text.disabled,"--sxl-app-color-background":Z.palette.background.paper,"--sxl-app-color-button-surface":Z.palette.grey[600],"--sxl-app-color-shadow":Z.palette.action.focus,"--sxl-app-color-grey":Z.palette.grey[500],"--sxl-app-filter-dark-invert":et.body.darkMode&&H?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":et.body.darkMode?`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`:void 0},children:[rn,At?Rt:null,s.jsx(Ae,{sx:{marginBottom:Ne=>Ne.spacing(.75)}}),zn,Qt,s.jsx(di,{arrow:!0,disableInteractive:!0,open:W,title:s.jsx(Tn,{variant:"subtitle2",component:"div",children:oe}),placement:ie,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:K,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:W?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(fe.x,fe.y,fe.width,fe.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:s.jsx(Ae,{})}),bo,vt]}),Pt]})}));Zf.displayName="WorkbookElement";const IN=(e=!1,t=!1)=>t?null:{"& input:not(:focus):not(:hover)":{color:n=>n.palette.text.secondary},backgroundColor:n=>pt(n.palette.background.paper,.6),borderRadius:n=>`${n.shape.borderRadius}px`,border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`,"&.Mui-disabled":{border:n=>`solid ${e?n.palette.divider:"transparent"} 1px`},"&:focus-within:not([disabled])":{backgroundColor:n=>n.palette.background.paper},"&:hover:not([disabled])":{border:n=>`solid ${e?n.palette.text?.primary:n.palette.divider} 1px`,backgroundColor:null},"&.Mui-focusVisible":{outline:n=>`solid ${n.palette.primary.main} 1px !important`,border:n=>`1px solid ${n.palette?.primary?.main} !important`}},Xf=u.memo(u.forwardRef((e,t)=>{const{sx:n,workbook:o,title:r="",placeHolder:i="Untitled",onTitleChange:a,readOnly:l=!1,hidden:c,...d}=e,[p,f]=u.useState(!1),[h,g]=u.useState(!1),[m,y]=u.useState(r??""),[x,v]=u.useState(""),[b,{width:w}]=a1(),[M,{width:k}]=a1(),[j,_]=u.useState(!1),L=u.useRef(null),T=u.useRef(null),D=ir(t,()=>({requestWorkbookTitle:(C=null,S)=>{T.current={onAccept:C,requestReason:S?.requestReason},S?.selectAll&&L.current?.select(),L.current?.focus(S)},focus:C=>{L.current?.focus(C)}}),[]);return u.useLayoutEffect(()=>{_(r!==m),v(r),y(r)},[r]),u.useEffect(()=>{j&&w!==0&&Gt.debounce(()=>{_(!1)},300)()},[j,w]),u.useEffect(()=>{g(m&&!Ml.isValidWindowsFilename(m))},[m]),c?null:s.jsx(Ae,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:j?"0":"1",transition:j?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:W2([D,M,t]),...d,children:s.jsx(br,{label:T.current?.requestReason??"Workbook Name",children:s.jsxs(Ae,{className:Eo({"Mui-focusVisible":p}),sx:{visibility:w===0?"hidden":"visible",display:"block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:"12px",paddingRight:"12px",marginLeft:"2px",marginRight:"2px",paddingTop:"2px",paddingBottom:"1px",...IN(!0,l),...n},children:[l?s.jsx(Tn,{variant:"subtitle1",component:"div",sx:{whiteSpace:"nowrap",fontStyle:m!==x?"italic":void 0,userSelect:"none",textOverflow:"ellipsis",lineHeight:"1.4375em",border:"transparent 1px solid",color:C=>h?C.palette.error.dark:void 0},children:r??i}):s.jsx(Kl,{sx:{width:`${Math.min(w+3,Math.max(k,D.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:C=>h?C.palette.error.dark:void 0,fontStyle:m!==x?"italic":void 0,"& input":{paddingTop:"0px",paddingBottom:"0px",textOverflow:"ellipsis"}},disableUnderline:!0,fullWidth:!1,multiline:!1,readOnly:l,spellCheck:!1,placeholder:i,onFocus:C=>{f(!0),C.target?.select()},inputProps:{name:"input-workbook-title",autoComplete:"off",ref:L},onBlur:()=>{f(!1),h?y(x):(m!==x&&(a?.(m),m&&T.current?.onAccept?.(m,"blur")),T.current=null)},onChange:C=>{if(C.target.value.length>Ml.MAX_WORKBOOK_NAME_SIZE)return C.stopPropagation(),void C.preventDefault();y(C.target.value)},onKeyDown:C=>{(Ml.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(C.key)||C.target?.value.length>Ml.MAX_WORKBOOK_NAME_SIZE)&&C.preventDefault(),C.which===on.Enter||C.which===on.Tab?(h?y(x):(a?.(m),m&&(T.current?.onAccept?.(m,"keydown"),T.current=null)),C.stopPropagation(),C.preventDefault(),o?.focus()):C.which===on.Escape&&(m===x?o?.focus():(y(x),setTimeout(()=>{C.target?.select()},0)),T.current=null,C.stopPropagation(),C.preventDefault())},value:m}),s.jsx(Ae,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:m!==x?"italic":void 0,fontFamily:C=>C.typography.fontFamily,letterSpacing:"0.00938em"},children:m||i})]})})})}));Xf.displayName="WorkbookTitle";const PN=u.lazy(()=>Promise.resolve().then(()=>require("./B5Qc3gXLEhscRsFm.cjs")).then(e=>e.DffuCp_514AjqJLT).then(e=>e.E)),OC=u.memo(u.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,renderLoadingPanel:a,...l}=e;return i&&$.LicenseManager.setLicenseKey(i),u.useMemo(()=>{const c={transitionDelay:"160ms",transparentBackground:!0};return s.jsx(Ae,{sx:n,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},children:a?.(c)??s.jsx(Gl,{...c})})},[n,o,a]),s.jsx(s.Fragment,{children:s.jsx(PN,{...l,className:r,sx:n,renderLoadingPanel:a,style:o,ref:t})})}));OC.displayName="Studio";const ON=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],handler:null,isDefault:!0},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:null},{key:"Excel",description:"Excel Workbook",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",exts:["xlsx","xls","xlsm"],handler:null}],DN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",handler:null,isDefault:!0},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:null},{key:"Excel",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",description:"Excel Workbook",ext:"xlsx",tags:["SheetJS Pro"],handler:null}];class DC{constructor(t=ON,n=DN){this._readFormatType=[],this._writeFormatType=[],this._readFormatType=Object.freeze([...t]),this._writeFormatType=Object.freeze([...n])}getReadFormats(){return this._readFormatType}getWriteFormats(){return this._writeFormatType}getAllReadFormatTypeAsString(){const t=[],n=this._readFormatType;for(let o=0;o<n.length;o++)for(let r=0;r<n[o].exts.length;r++)t.push("."+n[o].exts[r]);return t}async writeFile(t,n,o){if(!n||!t)throw new Error("Workbook model or file name must be provided.");try{return(await Promise.resolve().then(()=>uy)).WorkbookIO.writeFile(t,n,o)}catch(r){throw new Error("Unable to load io library",{cause:r})}}async read(t,n){let o,r;const i=await n?.showBusy?.(`Opening${t.name?` ${t.name}`:""}...`);try{r=await Promise.resolve().then(()=>uy)}catch(a){throw a}try{return await r.WorkbookIO.read({...t,async onStart(a){await t?.onStart?.(a),o=await n?.showBusy?.(`Opening '${a}'...`)}})}catch(a){throw i?.(),o?.(),a}finally{i?.(),o?.()}}}const AC=new DC;(function(){try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-reset_ods65_1{display:block;margin:0;padding:0;line-height:normal}._sheetxl-reset_ods65_1 table,._sheetxl-reset_ods65_1 thead,._sheetxl-reset_ods65_1 tbody,._sheetxl-reset_ods65_1 tfoot,._sheetxl-reset_ods65_1 tr,._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:block;width:auto;height:auto;margin:0;padding:0;border:none;border-collapse:inherit;border-spacing:0;border-color:inherit;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0}._sheetxl-reset_ods65_1 th,._sheetxl-reset_ods65_1 td{display:inline}html{color:initial}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4{fill:currentColor}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .activeColor{fill:var(--sxl-color-active)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .background{fill:var(--sxl-app-color-background)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .grey{fill:var(--sxl-app-color-grey)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .highContrast{fill:var(--sxl-app-color-high)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info{fill:var(--sxl-app-color-info)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.light{fill:var(--sxl-app-color-info-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .info.dark{fill:var(--sxl-app-color-info-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary{fill:var(--sxl-app-color-secondary)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.light{fill:var(--sxl-app-color-secondary-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .secondary.dark{fill:var(--sxl-app-color-secondary-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success{fill:var(--sxl-app-color-success)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.light{fill:var(--sxl-app-color-success-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .success.dark{fill:var(--sxl-app-color-success-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning{fill:var(--sxl-app-color-warning)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .light{fill:var(--sxl-app-color-warning-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .warning .dark{fill:var(--sxl-app-color-warning-dark)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error{fill:var(--sxl-app-color-error)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .light{fill:var(--sxl-app-color-error-light)}._sheetxl-theme_4opcr_2 svg._themed_4opcr_4 .error .dark{fill:var(--sxl-app-color-error-dark)}._sheetxl-workbook_1j3lu_5{display:flex;position:relative;overflow:hidden;flex-direction:column;width:100%;height:100%;outline:none}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer{background-color:var(--sxl-app-color-grey, grey)}._sheetxl-workbook_1j3lu_5 .splitPane .styled-resizer:hover,._sheetxl-workbook_1j3lu_5 .splitPane.dragging .styled-resizer{background-color:var(--sxl-app-color-primary, blue)}._card_1a398_7{width:100%}._actionRoot_1a398_11{padding:8px 8px 8px 16px;justify-content:space-between}._icons_1a398_16{margin-left:auto;display:flex;align-items:center}._expand_1a398_22{padding:8px;transform:rotate(0);color:#d32f2f;transition:all .2s ease-in-out}._expandOpen_1a398_29{transform:rotate(180deg)}._stackTraceContainer_1a398_33{padding:16px}._paper_1a398_37{background-color:#fff;padding:16px}._checkIcon_1a398_42{font-size:20px;padding-right:4px}._button_1a398_47{padding:0;text-transform:none}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();const LC=Object.freeze(Object.defineProperty({__proto__:null,AppearanceCommandButton:dC,AutoColorPosition:Os,BorderCommandButton:NS,BorderPopupButton:BS,BorderStyleButton:FS,ClearCommandButton:kf,ColorButton:V2,ColorCommandButton:Qs,ColorPanel:zS,ColorPanelType:AS,ColorPopupButton:Cf,DeleteCellsCommandButton:Mf,DocThemeCommandButton:cC,FillCommandButton:qS,FilterColumnMenu:Ff,FilterCommandButton:ZB,Filters:gC,FindCommandButton:HS,FontFamilyCommandButton:ZS,FontSizeCommandButton:WS,FormulaBar:zf,FreezeCommandButton:VS,HelpCommandButton:uC,HorizontalAlignCommandButton:Zv,InsertCellsCommandButton:Ef,InsertImageCommandButton:If,InsertScriptCommandButton:MC,LicenseManager:$.LicenseManager,MergeCommandButton:$S,NamedCollectionEditor:Lf,NamedInput:Pf,NumberFormatCommandButton:US,PasteCommandButton:jf,PresetCellStylesCommandButton:tC,PresetTableStylesCommandButton:iC,QuickFormulaSumCommandPopupButton:QB,RangeInput:Of,RunScriptCommandButton:qf,ScriptEditorToolbar:Wf,ScriptWorkspace:Uf,SheetTab:Bf,SheetTabMenu:Nf,SheetZoomScale:Df,SheetsAllMenu:$f,SortFilterCommandButton:Tf,StatusBar:Af,Studio:OC,StyledStrokeIcon:Uh,TableStyleCanvasPreview:oC,TableStyleOptionsPanel:rC,TableStylePreview:Rf,TextEffectsCommandButton:XS,TextOverflowCommandButton:Yv,TextRotateCommandButton:Jv,ThemeMode:wC,ThemeSelectButton:aC,ThemeSelectPanel:lC,ThemeSelectPopupButton:sC,UnderlineCommandButton:YS,UndoRedoCommandButton:_f,VerticalAlignCommandButton:Xv,ViewGridLinesCommandButton:KS,ViewHeadingsCommandButton:JS,WalkingCopyCommandButton:H2,WorkbookContextMenu:Gf,WorkbookElement:Zf,WorkbookIO:AC,WorkbookStrip:Kf,WorkbookTitle:Xf,WorkbookViewCommandButton:QS,_WorkbookIO:DC,createGridStyleFromMUITheme:Zh,defaultNewWorkbook:RC,renderWorkbookLoadingPanel:PC,useResolvedThemeMode:SC,useWorkbookCommands:jC},Symbol.toStringTag,{value:"Module"})),Xh=new Map,zC=(e,t={})=>{const{message:n,icon:o,customElement:r,hide:i=!1,className:a,cssVars:l={}}=t;if(i)return;const c=typeof e=="string"?document.querySelector(e):e;if(!c)return void console.warn(`Element with selector "${e}" not found for panel.`);let d;if(s1(e),r)d=r;else{d=document.createElement("div"),d.className=a?`sheetxl-panel ${a}`:"sheetxl-panel";const p=Object.entries(l).map(([g,m])=>`--sheetxl-panel-${g}: ${m};`).join(" "),f=`
224
224
  @keyframes sheetxl-spin {
225
225
  from { transform: rotate(0deg); }
226
226
  to { transform: rotate(360deg); }
@@ -298,4 +298,4 @@ Names can be used as a substitute for cell references.`,shortcut:{key:"F3",modif
298
298
  <svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
299
299
  <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>
300
300
  </svg>
301
- `,className:"error",...t})},Od=new Map;let As;const by=async e=>As||(As=await(async(t,n)=>{try{if(n?.selector&&FC(n?.selector,n?.loading),!t){const{resolveDependencies:o}=await Promise.resolve().then(()=>require("./C2B3wbeahcHlbOBZ.cjs"));t=await o(n?.dependencies)}n?.licenseKey&&await t.StudioMUI.LicenseManager.setLicenseKey(n.licenseKey),n?.selector&&s1(n?.selector)}catch(o){throw n?.selector&&(s1(n.selector),BC(n.selector,{message:`Failed to initialize: ${o instanceof Error?o.message:String(o)}`,...n?.error})),console.error("Failed to initialize:",o),o}return t})({React:u,ReactJSXTransform:YC,ReactDOM:sm,ReactDOMClient:sm,StudioMUI:LC},typeof e=="object"?e:void 0),As),AN={attachStudio:async(e,t)=>(As||(As=await by(e)),(async(n,o,r,i)=>{if(!o)throw new Error("Either a 'selector' or a 'InitializationOptions' must be provided to attach.");const a=typeof o=="string"?o:o.selector||"#sheetxl",l=typeof a=="string"?document.querySelector(a):a;if(!l)throw new Error(`Element with selector "${a}" not found.`);if(Od.has(a)&&Od.get(a)!==null)throw new Error(`SheetXL already attached to "${a}". Detach first if you want to re-attach.`);const c=typeof o=="object"?o:null;FC(a,c?.loading);try{s1(a);const d=n.ReactDOMClient.createRoot(l),p=n.React.createRef(),f=n.StudioMUI[r];let h=null;await new Promise(x=>{d.render(n.React.createElement(f,{...i,ref:v=>{v&&(h=v,x())}}))});const m={runtime:n,root:d};Od.set(a,m);let y=!1;return new Proxy(h,{get(x,v,b){if(y)throw new Error(`SheetXL instance attached to "${a}" has been detached. Cannot access properties.`);return v==="update"?w=>{const M={...i,...w,ref:p};return d.render(n.React.createElement(f,M)),Promise.resolve()}:v==="detach"?()=>(Od.delete(a),d.unmount(),y=!0,Promise.resolve()):Reflect.get(x,v,b)}})}catch(d){throw s1(a),BC(a,{message:`Failed to initialize: ${d instanceof Error?d.message:String(d)}`,...c?.error}),console.error("Failed to initialize:",d),d}})(As,e,"Studio",t)),async initialize(e){await by(e)}};exports.$R=uC,exports.$n=Vn,exports.$t=Ft,exports.AR=()=>{const{showModal:e}=pd();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const a=e(PA,{defaultOption:n,cancelOption:o,...r,onOption(l){r?.onOption?.(l,l===o,l===n),i({input:"",option:l})},onInputOption(l,c){r?.onInputOption?.(l,c),i({input:l,option:c})},onDone:()=>{r?.onDone?.(),a.hide()}})})}},exports.BR=rC,exports.Box=Ae,exports.Bu=pd,exports.CR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),s.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.Checkbox=Na,exports.DM=_C,exports.DR=(e,t)=>{let n=oh({palette:{mode:e?"dark":"light"}}),o={typography:{},palette:{mode:e?"dark":"light",text:{secondary:e?n.palette.text.secondary:pt(n.palette.text.secondary,.75),icon:e?pt(n.palette.text.secondary,.7):pt(n.palette.text.primary,.75)}},components:{MuiDialogTitle:{styleOverrides:{root:{fontWeight:"normal"}}},MuiSelect:{styleOverrides:{iconOutlined:{top:"unset"}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"0px !important",overflow:"hidden",marginLeft:"0px",marginRight:"6px",padding:"1px 1px",border:"solid transparent 1px"}}},MuiMenuItem:{styleOverrides:{root:{paddingTop:"2px",paddingBottom:"2px",marginLeft:"4px",marginRight:"4px",paddingLeft:"6px",paddingRight:"18px",borderRadius:"4px",fontSize:"0.875em","@media (pointer: coarse)":{fontSize:"1em"},"&.Mui-selected":{}}}},MuiDivider:{styleOverrides:{root:{marginTop:"4px !important",marginBottom:"4px !important",marginLeft:"0px",marginRight:"0px"}}},MuiPopper:{styleOverrides:{root:{"& .menu":{marginTop:"4px",marginBottom:"4px",borderRadius:"4px"}}}},SmartInputField:{styleOverrides:{automatic:{transition:"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",color:function(){return n.palette.text.secondary}},dirty:{fontStyle:"italic",color:function(){return n.palette.text.secondary}}}}}},r=o;return t&&(r=cr(o,t)),oh(r)},exports.De=$e,exports.DialogContent=Ex,exports.ER=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),s.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),s.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.F0=pa,exports.Fi=Ja,exports.Fn=Bn,exports.FormControl=b1,exports.FormControlLabel=$a,exports.GC=pw,exports.Go=rr,exports.HR=dC,exports.IR=function(e){var t=e.children,n=e.legacy,o=n!==void 0&&n,r=e.suspense,i=r===void 0||r,a=e.fallback,l=a===void 0?null:a,c=u.useReducer(YD,XD),d=c[0],p=c[1],f=u.useCallback(function(v,b){var w=Ev(b,JD);v?p({type:ki.UPDATE,payload:{id:v,props:w}}):console.error(Lp)},[p]),h=u.useCallback(function(v){v?p({type:ki.HIDE,payload:{id:v}}):console.error(Lp)},[p]),g=u.useCallback(function(v){v?p({type:ki.DESTROY,payload:{id:v}}):console.error(Lp)},[p]),m=u.useCallback(function(v){v?p({type:ki.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),y=u.useCallback(function(v,b,w){var M=Tv(8);return w&&w.rootId&&(M=w.rootId+"."+M),p({type:ki.SHOW,payload:{id:M,component:v,props:b,options:w}}),{id:M,hide:function(){return h(M)},destroy:function(){return g(M)},update:function(k){return f(M,k)}}},[p,h,g,f]),x=i?u.Suspense:u.Fragment;return u.createElement(Mv.Provider,{value:{state:d,updateModal:f,hideModal:h,destroyModal:g,showModal:y,destroyModalsByRootId:m}},t,u.createElement(x,Object.assign({},i&&{fallback:l}),Object.keys(d).map(function(v){var b,w=d[v],M=w.component,k=w.props,j=w.options,_=function(){var L,T;k!=null&&k.onExited&&k.onExited.apply(k,arguments),k!=null&&(L=k.TransitionProps)!=null&&L.onExited&&(T=k.TransitionProps).onExited.apply(T,arguments),g(v)};return b=o?{onExited:_}:{TransitionProps:Er({},k?.TransitionProps,{onExited:_})},u.createElement(M,Object.assign({},k,{key:v,onClose:function(){j&&j.hideOnClose&&h(v),j&&j.destroyOnClose&&j.hideOnClose&&g(v),k&&k.onClose&&k.onClose.apply(k,arguments)}},j&&!j.destroyOnClose&&b))})))},exports.IT=LS,exports.IconButton=Tr,exports.InputAdornment=Tx,exports.InputLabel=_x,exports.JM=Zf,exports.Ji=rl,exports.Jt=Gt,exports.Kn=Xn,exports.L9=Z3,exports.LR=()=>{const{showModal:e}=pd();return t=>new Promise(n=>{const o=e(IA,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.Le=Ge,exports.MR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1z"}),s.jsx("path",{d:"M11 7h2v6h-2zm0 8h2v2h-2z"})]}),exports.MenuItem=v1,exports.Mn=jn,exports.N0=ha,exports.OR=function(){const[e,t]=u.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=pd({disableAutoDestroy:!0});return(a,l,c,d)=>new Promise((p,f)=>{const h={...c,onHide:()=>{const x=e.get(a);c?.onHide?.(),t(v=>(v.delete(a),v)),i(x.id)},onDone:x=>{const v=e.get(a);t(b=>(b.delete(a),b)),c?.onDone?.(x),v&&v.id&&!d?.disableAutoDestroy&&r(v.id)},onShown:x=>{t(v=>{const b=v.get(a);return v.set(a,{...b,element:x}),v}),p(x)},open:!0},g=e.get(a);if(g)return o(g.id,h),void p(g.element);if(!l)return void f("invalid function");const m=u.lazy(l),y=n(m,h,{destroyOnClose:!d?.disableAutoDestroy});t(x=>(x.set(a,{id:y.id,element:null}),x))})},exports.Oe=We,exports.PC=sw,exports.PR=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.Paper=Ti,exports.Px=kv,exports.Qt=Zt,exports.RR=OD,exports.Rc=Xc,exports.SR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),s.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),s.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.Select=w2,exports.SheetXL=AN,exports.StudioMUI=LC,exports.SvgIcon=Qe,exports.T0=Ki,exports.TR=e=>s.jsx(Qe,{...e,children:s.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.TextField=E3,exports.Transition=Ni,exports.Tt=Tt,exports.Typography=Tn,exports.UR=SC,exports.VR=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),s.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),s.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),s.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.Vl=Gl,exports.W1=Kc,exports.WR=wC,exports.Xf=wf,exports.Xn=Lx,exports.Yb=Vb,exports._R=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),s.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),s.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports._o=M3,exports._s=s0,exports.ai=ka,exports.alpha=pt,exports.ar=br,exports.au=e2,exports.b4=Ch,exports.bR=e=>s.jsx(Qe,{...e,children:s.jsx("path",{d:"m 21.230627,10.984379 c -0.103549,0.265939 -0.204749,0.531861 -0.308302,0.80018 -0.244758,0.640136 -0.491882,1.277905 -0.736619,1.918041 -0.296532,0.77195 -0.595423,1.546223 -0.891972,2.31813 -0.256524,0.666043 -0.513056,1.332042 -0.769584,2.000408 -0.122381,0.320068 -0.244757,0.640136 -0.369488,0.960183 -0.0071,0.01647 -0.01412,0.03295 -0.01883,0.04942 0.0306,-0.07531 0.06355,-0.15062 0.09414,-0.22593 -0.05884,0.138855 -0.129439,0.273001 -0.218868,0.393024 0.04942,-0.06354 0.09885,-0.127085 0.148266,-0.190629 -0.05884,0.07531 -0.122381,0.141204 -0.197691,0.200041 0.06354,-0.04942 0.127084,-0.09885 0.190629,-0.148266 -0.05648,0.04001 -0.112965,0.07531 -0.17651,0.103549 0.07531,-0.0306 0.150621,-0.06355 0.225931,-0.09414 -0.08002,0.03295 -0.160037,0.05413 -0.244758,0.06825 0.08237,-0.01177 0.167093,-0.02353 0.249466,-0.03295 -0.17651,0.02354 -0.360077,0.01177 -0.536596,0.01177 H 16.596651 12.981767 8.5974282 4.7848441 c -0.6071714,0 -1.2143859,0.0047 -1.8239241,0 -0.037655,0 -0.07531,-0.0024 -0.115319,-0.0047 0.082372,0.01177 0.1670935,0.02353 0.2494657,0.03295 -0.070602,-0.0094 -0.1388548,-0.02824 -0.204749,-0.05177 0.07531,0.03059 0.1506203,0.06354 0.2259303,0.09414 -0.063545,-0.02824 -0.1247306,-0.06119 -0.1812132,-0.1012 0.063544,0.04942 0.1270848,0.09885 0.1906293,0.148266 -0.063544,-0.04942 -0.120027,-0.105903 -0.1694477,-0.169447 0.080018,0.138854 0.1623858,0.277705 0.2424039,0.416559 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023534,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063544,-0.216514 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.22593 0.1529742,-0.338895 0.2777048,-0.689539 0.4094974,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366189,-1.915717 0.2965322,-0.771949 0.593056,-1.546223 0.8919727,-2.31813 0.2565232,-0.670733 0.5154222,-1.3391 0.7719499,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765505,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.225931 0.058836,-0.131793 0.1270845,-0.256524 0.2141645,-0.371843 -0.049421,0.06354 -0.098846,0.127085 -0.1482661,0.190629 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223576 -0.063544,0.04942 -0.1270845,0.09885 -0.190629,0.148266 0.070602,-0.05413 0.1435581,-0.09649 0.2259303,-0.134146 -0.07531,0.03059 -0.1506203,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670939,0.02353 -0.2494658,0.03295 0.1718016,-0.02118 0.3506609,-0.0094 0.5224799,-0.0094 h 1.1014247 3.6642876 4.441143 3.777253 c 0.569517,0 1.139076,-0.0024 1.708592,0 0.09414,0 0.19063,0.0024 0.284768,0.01412 -0.08237,-0.01177 -0.167094,-0.02353 -0.249466,-0.03295 0.06119,0.0094 0.122381,0.02353 0.178859,0.04472 -0.07531,-0.03059 -0.15062,-0.06354 -0.22593,-0.09414 0.0353,0.01412 0.06589,0.03295 0.09649,0.05413 -0.06354,-0.04942 -0.127084,-0.09885 -0.190629,-0.148267 0.01883,0.01647 0.0353,0.03059 0.04942,0.04942 -0.04942,-0.06354 -0.09885,-0.127085 -0.148266,-0.190629 0.01412,0.01883 0.02589,0.04001 0.03765,0.06354 -0.03059,-0.07531 -0.06354,-0.15062 -0.09414,-0.22593 0.01177,0.03295 0.02118,0.06354 0.02589,0.09885 -0.01177,-0.08237 -0.02353,-0.167094 -0.03295,-0.249466 0.0024,0.04001 0.0024,0.08002 -0.0024,0.122381 0.01177,-0.08237 0.02353,-0.167094 0.03295,-0.249466 -0.01647,0.112965 -0.05177,0.221223 -0.09414,0.32713 0.03059,-0.07531 0.06354,-0.15062 0.09414,-0.22593 -0.0047,0.01412 -0.01177,0.02589 -0.01647,0.04001 -0.06825,0.108258 -0.105904,0.223577 -0.110612,0.350661 -0.02824,0.124731 -0.02353,0.249466 0.01647,0.376551 0.06119,0.218868 0.228284,0.454227 0.433011,0.562459 0.218868,0.115319 0.482458,0.174155 0.72487,0.09414 0.216515,-0.0706 0.468343,-0.214164 0.562459,-0.433011 0.07296,-0.171802 0.162386,-0.348312 0.197691,-0.534229 0.04707,-0.254169 0.05884,-0.449493 0.0071,-0.698963 C 23.085384,10.14653 22.838276,9.83117 22.534673,9.68055 22.233432,9.527576 21.908652,9.485213 21.572124,9.482859 h -0.400086 -2.167511 -3.348932 -3.68077 -3.2453915 -1.96512 c -0.1341464,0 -0.270647,-0.0047 -0.4047895,0.0094 -0.3341874,0.03765 -0.6542509,0.115319 -0.9366854,0.310656 -0.2918244,0.200041 -0.5295376,0.449494 -0.7083882,0.757792 -0.094138,0.160036 -0.1600361,0.336541 -0.2282842,0.508321 -0.2777051,0.724871 -0.5577682,1.449741 -0.8354688,2.172245 -0.4330112,1.127284 -0.866066,2.254612 -1.3014443,3.381896 -0.2894748,0.750734 -0.5789408,1.503835 -0.8660659,2.254612 -0.014121,0.03766 -0.028241,0.07531 -0.044717,0.112965 0.030595,-0.07531 0.063544,-0.15062 0.094138,-0.22593 -0.1200271,0.263585 -0.2000409,0.47071 -0.2118109,0.762525 -0.00471,0.120027 0.014121,0.24005 0.035302,0.355369 0.040009,0.195337 0.1412041,0.353015 0.2659393,0.508322 0.2165145,0.270647 0.5765741,0.491882 0.9178362,0.557768 0.1506203,0.02824 0.3012406,0.04707 0.4542277,0.04707 h 0.5106883 2.3134399 3.3748389 3.6501724 3.139484 1.840407 c 0.256523,0 0.513055,-0.0024 0.764849,-0.07531 0.30124,-0.08708 0.578941,-0.249466 0.800181,-0.473034 0.263585,-0.263585 0.418913,-0.578941 0.557768,-0.920203 0.01883,-0.04942 0.03765,-0.09885 0.05648,-0.148266 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.430688,-1.117903 0.859008,-2.235763 1.289696,-3.353666 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.01412,-0.03766 0.02824,-0.07296 0.04236,-0.110611 0.08237,-0.214165 0.01647,-0.534228 -0.09414,-0.72487 -0.115319,-0.195338 -0.338895,-0.381259 -0.562458,-0.433012 -0.24005,-0.05413 -0.510689,-0.04236 -0.724871,0.09414 -0.209457,0.143558 -0.331833,0.32713 -0.425971,0.567192 z M 17.898048,6.835008 v 3.146542 0.437745 c 0.313006,-0.313006 0.628388,-0.628388 0.941376,-0.941376 H 17.872141 15.462219 12.379196 9.3644251 7.1686842 c -0.6048476,0 -1.2308681,-0.04472 -1.7556719,0.329479 -0.4259712,0.303595 -0.7036976,0.69664 -0.8942966,1.179055 -0.016474,0.04001 -0.030595,0.08237 -0.047071,0.124731 -0.08943,0.232992 -0.1788593,0.465976 -0.2682935,0.698963 -0.3247757,0.844894 -0.6495602,1.68742 -0.9743401,2.532313 -0.3647851,0.948434 -0.7295611,1.899235 -1.0943633,2.847668 -0.2212223,0.571884 -0.4401122,1.146134 -0.6613086,1.718017 -0.011767,0.02824 -0.021181,0.05648 -0.032948,0.08473 0.030595,-0.07531 0.063544,-0.15062 0.094137,-0.22593 -0.1176729,0.258877 -0.1835671,0.44717 -0.2094567,0.729561 -0.01412,0.157682 0.00471,0.329479 0.056483,0.480091 0.5742503,-0.242404 1.1461337,-0.482458 1.7203839,-0.72487 -0.035302,-0.04942 -0.065894,-0.1012 -0.091784,-0.157683 0.030595,0.07531 0.063545,0.150621 0.094137,0.225931 -0.028241,-0.0706 -0.049421,-0.138855 -0.06119,-0.214165 0.011767,0.08237 0.023534,0.167094 0.032948,0.249466 -0.018827,-0.160036 -0.00706,-0.32713 -0.00706,-0.489516 V 17.813782 14.311863 10.0639 6.4019361 c 0,-0.5813076 -0.00471,-1.1649394 0,-1.7462474 0,-0.037655 0.00235,-0.077664 0.00471,-0.115319 -0.011767,0.082372 -0.023535,0.1670938 -0.032948,0.2494657 0.00941,-0.072956 0.028241,-0.1435583 0.056483,-0.2118106 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.2259303 0.028241,-0.065894 0.063544,-0.1270848 0.108257,-0.1859212 -0.049421,0.063544 -0.098845,0.1270845 -0.1482661,0.190629 0.044717,-0.056483 0.094138,-0.1059032 0.1506203,-0.15062 -0.063544,0.049421 -0.1270848,0.098846 -0.1906293,0.1482661 0.058836,-0.042362 0.1200271,-0.077664 0.1859213,-0.1082571 -0.07531,0.030595 -0.1506203,0.063544 -0.2259303,0.094137 0.068248,-0.028241 0.1388545,-0.044717 0.2118106,-0.056483 -0.082372,0.011768 -0.1670935,0.023535 -0.2494658,0.032948 0.1929832,-0.018827 0.3906703,-0.00471 0.5836318,-0.00471 h 1.2473072 2.873532 0.6636754 C 7.9429095,4.60862 7.6722712,4.453292 7.401628,4.2979723 7.8887769,4.938108 8.3736017,5.578244 8.8607503,6.2183797 8.9289983,6.3101637 8.9996049,6.3995929 9.0678531,6.4913809 9.2184733,6.6890719 9.3785094,6.8726392 9.6350456,6.929126 9.7056476,6.9456 9.8186129,6.959721 9.891569,6.962074 h 0.049421 0.642503 2.704105 3.071232 c 0.548343,0 1.099053,-0.00471 1.647397,0 0.03765,0 0.07531,0.00235 0.115319,0.00471 -0.08237,-0.011767 -0.167094,-0.023534 -0.249466,-0.032948 0.07296,0.00941 0.143559,0.028241 0.211811,0.056483 -0.07531,-0.030595 -0.15062,-0.063545 -0.22593,-0.094137 0.06589,0.028241 0.127085,0.063544 0.185921,0.108257 -0.06354,-0.049421 -0.127085,-0.098845 -0.190629,-0.1482661 0.05648,0.044717 0.105903,0.094137 0.15062,0.15062 -0.04942,-0.063545 -0.09885,-0.1270845 -0.148266,-0.190629 0.04236,0.058836 0.07766,0.1200271 0.108257,0.1859213 -0.03059,-0.07531 -0.06354,-0.1506203 -0.09414,-0.2259303 0.02824,0.068248 0.04472,0.1388545 0.05648,0.2118106 -0.01177,-0.082372 -0.02354,-0.1670938 -0.03295,-0.2494658 0.0024,0.032948 0.0047,0.065894 0.0047,0.096492 0.0047,0.2447577 0.1012,0.4918825 0.275351,0.6660425 0.162386,0.1623858 0.430688,0.2871209 0.666043,0.2753509 0.501263,-0.023534 0.9508,-0.4142054 0.941376,-0.9413763 -0.01883,-0.9672827 -0.793123,-1.7415564 -1.760363,-1.7556716 -0.110611,-0.00235 -0.218868,0 -0.32948,0 h -1.795679 -2.525255 -2.311073 c -0.383613,0 -0.769583,-0.00941 -1.1531914,0 H 9.8892086 C 10.159856,5.2346612 10.430495,5.3899892 10.701138,5.5453089 10.183391,4.8651512 9.6679691,4.1850366 9.150223,3.5048786 9.117275,3.4601618 9.0819748,3.415449 9.0490234,3.3707322 9.0419632,3.3636719 9.0372561,3.354258 9.0301959,3.347198 8.8960493,3.1730422 8.7854381,3.0483116 8.5783352,2.9612316 8.4300691,2.8976871 8.4182991,2.8859213 8.2135504,2.8812136 c -0.070602,-0.00235 -0.1388545,0 -0.2094567,0 H 6.80619 3.5984533 c -0.2188681,0 -0.4353783,-0.00471 -0.6542509,0 -0.3271299,0.00471 -0.6731002,0.091784 -0.9460669,0.2800586 -0.3412493,0.2329922 -0.5671925,0.5318615 -0.715446,0.9178366 -0.072956,0.1859213 -0.094137,0.3930238 -0.094137,0.593056 -0.00235,0.4353786 0,0.8707569 0,1.3061785 v 2.6711407 3.372472 3.334817 2.635853 c 0,0.409498 -0.00235,0.818987 0,1.228502 0.00235,0.338895 0.091784,0.70133 0.2894748,0.979031 0.1388545,0.195337 0.3177138,0.37655 0.5624586,0.433011 0.2094567,0.04707 0.4142057,0.03766 0.6119054,-0.04707 0.4071434,-0.171801 0.6989637,-0.663675 0.5460196,-1.110802 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023535,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063545,-0.216514 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.22593 0.1529742,-0.338895 0.2777051,-0.689539 0.4094977,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366186,-1.915717 0.2965325,-0.771949 0.5930563,-1.546223 0.8919727,-2.31813 0.2565235,-0.670733 0.5154225,-1.3391 0.7719502,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765502,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094138,0.22593 0.058837,-0.131793 0.1270848,-0.256523 0.2141648,-0.371843 -0.049421,0.06354 -0.098845,0.127085 -0.1482661,0.19063 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223577 -0.063544,0.04942 -0.1270848,0.09885 -0.1906293,0.148267 0.070602,-0.05413 0.1435584,-0.09649 0.2259303,-0.134147 -0.07531,0.03059 -0.15062,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670936,0.02354 -0.2494658,0.03295 0.1435584,-0.01647 0.2941786,-0.0094 0.4401122,-0.0094 h 0.8731262 2.9394612 3.574862 3.120678 c 0.503631,0 1.004938,0.0071 1.508569,0 h 0.02118 c 0.508321,0 0.941376,-0.430688 0.941376,-0.941376 V 7.2703743 6.8326289 c 0,-0.4918825 -0.433011,-0.9649159 -0.941376,-0.9413759 -0.508322,0.025888 -0.941376,0.4165592 -0.941376,0.9437427 z"})}),exports.bu=xu,exports.cM=Of,exports.capitalize=xt,exports.clsx=Ot,exports.cn=cn,exports.composeClasses=In,exports.createSvgIcon=Kn,exports.darken=Ol,exports.duration=ix,exports.eM=Rf,exports.eR=Xf,exports.fe=Te,exports.gR=({manager:e,commands:t,disabled:n,notifier:o=xu})=>{const r=Te(a=>{try{e?.undo(a)}catch(l){o.showError?.(l)}},[e]),i=Te(a=>{try{e?.redo(a)}catch(l){o.showError?.(l)}},[e]);return u.useMemo(()=>{if(!t)return;const a={contains:c=>!0,focus(){}},l=[new We("undo",a,{label:"Undo",description:T4,shortcut:{key:"z",modifiers:[$e.Ctrl]},disabled:!0},r),new We("redo",a,{label:"Redo",description:_4,shortcut:[{key:"y",modifiers:[$e.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[$e.Alt]}],disabled:!0},i)];t?.addCommands(l,!0)},[t]),u.useEffect(()=>{if(!t)return;const a=()=>{const c=e?.getTopUndoDescription(),d={};var p;t.getCommand("undo").update({disabled:n||!e||!e.hasUndo(),description:c?(p=c,`Undo ${p}`):T4,state:d,context:{undoManager:e}});const f=e?.getTopRedoDescription();t.getCommand("redo").update({disabled:n||!e||!e.hasRedo(),description:f?pI(f):_4,state:d,context:{undoManager:e}})};if(a(),!e)return;const l=e.addListener({onStackChange(){a()}});return()=>l?.()},[e,t,n]),{undo:r,redo:i}},exports.gc=a1,exports.generateUtilityClass=Rn,exports.generateUtilityClasses=Mn,exports.getTransitionProps=Dc,exports.globalCss=sx,exports.gs=a0,exports.h5=W2,exports.internal_mutateStyles=r3,exports.internal_serializeStyles=Mr,exports.ir=xr,exports.kR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),s.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.ka=bs,exports.km=Vf,exports.kn=En,exports.lS=Lv,exports.lighten=Dl,exports.memoTheme=Sn,exports.nk=hw,exports.ns=Xs,exports.q9=J3,exports.qR=AC,exports.rn=on,exports.sM=Pf,exports.styled=Et,exports.styled$1=a2,exports.su=Hf,exports.useDefaultProps=An,exports.useForkRef=Xo,exports.useTheme=i0,exports.useTimeout=vl,exports.vR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),s.jsx("path",{className:"styled secondary_light",d:"M 10.363689,16.028891 10.345659,15.996611 9.4734966,14.37091 8.5619879,16.028912 H 7.3633702 L 8.8418569,13.567063 7.3668314,10.90392 H 8.63729 l 0.018027,0.03581 0.872161,1.729842 0.907731,-1.765668 h 1.198618 l -1.478485,2.616296 1.482266,2.512154 z m 4.665607,0 h -2.953777 v -5.124987 h 1.137804 l -2.54e-4,4.102093 h 1.833979 z m 3.309014,-0.330196 h -2.55e-4 c -0.364996,0.290393 -0.822367,0.439348 -1.288281,0.419821 -0.483409,-0.01051 -0.964575,-0.07059 -1.43568,-0.179494 l -0.319438,-0.06109 0.118416,-0.907988 h 0.06109 c 0.496925,0.07435 0.997838,0.118671 1.500281,0.132932 0.484409,0 0.717711,-0.193763 0.717711,-0.585048 0.0084,-0.126168 -0.05033,-0.247587 -0.154462,-0.319436 -0.217293,-0.125426 -0.451866,-0.218549 -0.696178,-0.276375 -0.450111,-0.10039 -0.871457,-0.302915 -1.230924,-0.592056 -0.250844,-0.261105 -0.380767,-0.61484 -0.358989,-0.976048 -0.03205,-0.442856 0.145944,-0.875173 0.480903,-1.16658 0.372757,-0.27187 0.827876,-0.4063 1.288473,-0.380266 0.468637,0.0088 0.935799,0.05808 1.396139,0.147202 l 0.322941,0.06109 -0.09338,0.922278 h -0.0646 c -0.685413,-0.07536 -1.17709,-0.1149 -1.456957,-0.1149 -0.739246,0 -0.739246,0.35899 -0.739246,0.46663 v -2.53e-4 c -2.54e-4,0.124163 0.06334,0.239575 0.168479,0.305162 0.293896,0.149452 0.601566,0.269614 0.918754,0.35899 0.387778,0.100895 0.747253,0.288643 1.05167,0.548998 0.22756,0.265109 0.339963,0.610077 0.312175,0.958295 0.03504,0.464132 -0.141691,0.919267 -0.480905,1.238164 z m 3.631947,0.330195 v -0.03228 l -0.879468,-1.625958 -0.911511,1.658 -1.1951,2.55e-4 1.482273,-2.461843 -1.475286,-2.663143 h 1.270463 l 0.01803,0.0358 0.872162,1.729842 0.907988,-1.765667 h 1.184331 l -1.478492,2.616295 1.482272,2.512152 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.ve=ze,exports.wR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731423 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605952 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z "}),s.jsx("path",{className:"styled secondary_light",d:"m 7.7187557,5.6810989 h 3.9153913 c 0.116687,0 0.211776,0.096094 0.211776,0.2127813 v 0.8457422 c 0,0.1166881 -0.09489,0.2117769 -0.211776,0.2117769 H 7.7187557 c -0.116688,0 -0.2117768,-0.094892 -0.2117768,-0.2117769 V 5.8938802 c 0,-0.116688 0.094893,-0.2127813 0.2117768,-0.2127813 z M 8.7772903,9.7481656 V 12.094422 H 13.203582 V 9.7481656 Z m 0,3.6164134 v 2.346263 H 13.203582 V 13.364579 Z M 14.473445,12.094422 H 17.03249 V 9.7481656 h -2.559045 z m 2.559045,1.270157 h -2.559045 v 2.346263 h 2.559045 z m 1.270159,-3.8291948 v 7.2330098 c 0,0.116688 -0.09489,0.211766 -0.211767,0.211766 H 7.7185701 c -0.116688,0 -0.2117768,-0.09489 -0.2117768,-0.211766 V 8.6898058 c 0,-0.116688 0.094893,-0.2117769 0.2117768,-0.2117769 H 18.090882 c 0.116688,0 0.211767,0.094893 0.211767,0.2117769 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.xR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),s.jsx("path",{className:"styled secondary_light",d:"m 22.499719,10.752378 -1.867399,5.486926 h -1.267987 l -1.859714,-5.486926 h 1.175769 l 1.02976,3.266027 q 0.03074,0.08453 0.08453,0.315076 0.06148,0.222858 0.122956,0.476455 0.06148,0.245913 0.08453,0.414978 0.02305,-0.169065 0.07685,-0.414978 0.06148,-0.253597 0.122956,-0.476455 0.06148,-0.230544 0.08453,-0.315076 l 1.037444,-3.266027 z m -5.302496,3.965341 q 0,0.730053 -0.530249,1.168085 -0.522565,0.430347 -1.490846,0.430347 -0.868379,0 -1.552323,-0.330445 v -1.083552 q 0.391923,0.169065 0.8069,0.315075 0.422663,0.138326 0.83764,0.138326 0.430348,0 0.607097,-0.16138 0.184435,-0.169065 0.184435,-0.422663 0,-0.207488 -0.146011,-0.353499 -0.138326,-0.146011 -0.376554,-0.268967 -0.238228,-0.130641 -0.545618,-0.276652 -0.19212,-0.09222 -0.414978,-0.215173 -0.222858,-0.130641 -0.430347,-0.315076 -0.199804,-0.192119 -0.330445,-0.461086 -0.130641,-0.268967 -0.130641,-0.645521 0,-0.737738 0.49951,-1.14503 0.49951,-0.414978 1.360204,-0.414978 0.430347,0 0.814586,0.0999 0.391923,0.0999 0.814585,0.284337 l -0.376553,0.906802 q -0.376554,-0.153695 -0.67626,-0.238227 -0.299706,-0.08453 -0.614782,-0.08453 -0.330445,0 -0.507195,0.153695 -0.176749,0.153696 -0.176749,0.399609 0,0.292021 0.261282,0.461086 0.261282,0.169065 0.776162,0.414977 0.422662,0.199804 0.714683,0.414978 0.299706,0.215173 0.461087,0.507195 0.16138,0.292021 0.16138,0.722368 z m -5.801995,-3.073908 q -0.668575,0 -1.022074,0.49951 -0.3535,0.49951 -0.3535,1.367889 0,0.876064 0.322761,1.360205 0.330445,0.476455 1.052813,0.476455 0.33813,0 0.668575,-0.07685 0.33813,-0.07685 0.730053,-0.215174 v 0.975966 q -0.361184,0.14601 -0.714683,0.215173 -0.3535,0.06916 -0.791532,0.06916 -0.845324,0 -1.3986278,-0.345814 -0.5456187,-0.3535 -0.8069009,-0.983651 -0.2612821,-0.637836 -0.2612821,-1.483161 0,-0.829955 0.299706,-1.467791 0.299706,-0.637836 0.868379,-0.99902 0.5763578,-0.361184 1.4063128,-0.361184 0.407293,0 0.814586,0.107587 0.414977,0.0999 0.791531,0.276652 l -0.376554,0.945226 q -0.30739,-0.14601 -0.622466,-0.253597 -0.307391,-0.107587 -0.607097,-0.107587 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.xx=uv,exports.yR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 6.3819062,2.5159671 c -0.4338889,0 -0.7857055,0.3518167 -0.7857055,0.7857177 V 20.587402 c 0,0.433902 0.3518166,0.785718 0.7857055,0.785718 H 18.953342 c 0.433889,0 0.785705,-0.351816 0.785705,-0.785718 V 7.2302615 h -3.928564 c -0.433901,0 -0.785718,-0.3518167 -0.785718,-0.7857178 V 2.5159671 Z m -2.357141,0.7857177 c 0,-1.3018621 1.0552788,-2.35714102 2.357141,-2.35714102 h 9.4285768 c 0.208352,0 0.408296,0.0827447 0.555609,0.23010782 l 4.714283,4.7142821 c 0.147327,0.1473145 0.230107,0.3472578 0.230107,0.55561 V 20.587402 c 0,1.301863 -1.055278,2.357142 -2.35714,2.357142 H 6.3819062 c -1.3018622,0 -2.357141,-1.055279 -2.357141,-2.357142 z"}),s.jsx("path",{className:"styled info",d:"M 13.729115,7.5208126 H 11.903278 V 11.108007 H 8.3163096 v 1.825837 h 3.5869684 v 3.586969 h 1.825837 v -3.586969 h 3.587195 v -1.825837 h -3.587195 z"})]}),exports.yo=Eo,exports.zv=av;
301
+ `,className:"error",...t})},Od=new Map;let As;const by=async e=>As||(As=await(async(t,n)=>{try{if(n?.selector&&FC(n?.selector,n?.loading),!t){const{resolveDependencies:o}=await Promise.resolve().then(()=>require("./nURb18uhj9rScsHa.cjs"));t=await o(n?.dependencies)}n?.licenseKey&&await t.StudioMUI.LicenseManager.setLicenseKey(n.licenseKey),n?.selector&&s1(n?.selector)}catch(o){throw n?.selector&&(s1(n.selector),BC(n.selector,{message:`Failed to initialize: ${o instanceof Error?o.message:String(o)}`,...n?.error})),console.error("Failed to initialize:",o),o}return t})({React:u,ReactJSXTransform:YC,ReactDOM:sm,ReactDOMClient:sm,StudioMUI:LC},typeof e=="object"?e:void 0),As),AN={attachStudio:async(e,t)=>(As||(As=await by(e)),(async(n,o,r,i)=>{if(!o)throw new Error("Either a 'selector' or a 'InitializationOptions' must be provided to attach.");const a=typeof o=="string"?o:o.selector||"#sheetxl",l=typeof a=="string"?document.querySelector(a):a;if(!l)throw new Error(`Element with selector "${a}" not found.`);if(Od.has(a)&&Od.get(a)!==null)throw new Error(`SheetXL already attached to "${a}". Detach first if you want to re-attach.`);const c=typeof o=="object"?o:null;FC(a,c?.loading);try{s1(a);const d=n.ReactDOMClient.createRoot(l),p=n.React.createRef(),f=n.StudioMUI[r];let h=null;await new Promise(x=>{d.render(n.React.createElement(f,{...i,ref:v=>{v&&(h=v,x())}}))});const m={runtime:n,root:d};Od.set(a,m);let y=!1;return new Proxy(h,{get(x,v,b){if(y)throw new Error(`SheetXL instance attached to "${a}" has been detached. Cannot access properties.`);return v==="update"?w=>{const M={...i,...w,ref:p};return d.render(n.React.createElement(f,M)),Promise.resolve()}:v==="detach"?()=>(Od.delete(a),d.unmount(),y=!0,Promise.resolve()):Reflect.get(x,v,b)}})}catch(d){throw s1(a),BC(a,{message:`Failed to initialize: ${d instanceof Error?d.message:String(d)}`,...c?.error}),console.error("Failed to initialize:",d),d}})(As,e,"Studio",t)),async initialize(e){await by(e)}};exports.$R=uC,exports.$n=Vn,exports.$t=Ft,exports.AR=()=>{const{showModal:e}=pd();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const a=e(PA,{defaultOption:n,cancelOption:o,...r,onOption(l){r?.onOption?.(l,l===o,l===n),i({input:"",option:l})},onInputOption(l,c){r?.onInputOption?.(l,c),i({input:l,option:c})},onDone:()=>{r?.onDone?.(),a.hide()}})})}},exports.BR=rC,exports.Box=Ae,exports.Bu=pd,exports.CR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 23.055315,20.559686 -4.63158,-4.63158 -0.33082,0.33083 -1.14286,-1.14286 c 2.70677,-3.57895 2.43609,-8.6917252 -0.81203,-11.9398452 -3.54887,-3.54886972 -9.3233066,-3.54886972 -12.9022566,0 -3.54886969,3.54887 -3.54886969,9.3233052 0,12.9022552 3.24812,3.24812 8.3909766,3.54887 11.9398466,0.81203 l 1.14286,1.14286 -0.33083,0.33082 4.63158,4.63158 c 0.66166,0.66166 1.74436,0.66166 2.43609,0 0.69173,-0.69173 0.69173,-1.77443 0,-2.43609 z m -8.66165,-6.25564 c -2.58647,2.58647 -6.7669166,2.58647 -9.3533766,0 -2.58647,-2.58646 -2.58647,-6.7669152 0,-9.3533752 2.58646,-2.58647 6.7669066,-2.58647 9.3533766,0 2.58647,2.58646 2.58647,6.7669152 0,9.3533752 z"}),s.jsx("path",{className:"styled info",d:"m 13.283605,7.5586508 0.57143,-0.81203 c 0.1203,-0.15037 0.0902,-0.3609 -0.0301,-0.4812 l -0.36091,-0.3609 -0.3609,-0.3609 c -0.1203,-0.1203 -0.33083,-0.15038 -0.4812,-0.0301 l -0.81203,0.57143 c -0.33083,-0.21053 -0.69173,-0.3609 -1.05263,-0.45113 l -0.15038,-0.99248 c -0.0301,-0.18045 -0.18045,-0.30075 -0.3609,-0.30075 H 9.7647762 9.283578 c -0.1804494,0 -0.3308296,0.1203 -0.3608996,0.30075 l -0.18045,0.99248 c -0.39098,0.0902 -0.75188,0.2406 -1.08271,0.45113 l -0.81203,-0.57143 c -0.15037,-0.1203 -0.3609,-0.0902 -0.4812,0.0301 l -0.3609,0.3609 -0.36091,0.3609 c -0.1203,0.1203 -0.15037,0.33083 -0.0301,0.4812 l 0.57143,0.81203 c -0.21053,0.33083 -0.33083,0.69173 -0.45113,1.05264 l -0.96241,0.15037 c -0.18045,0.0301 -0.30075,0.1804494 -0.30075,0.3608988 v 0.4812082 0.4811982 c 0,0.18045 0.1203,0.33083 0.30075,0.3609 l 0.99248,0.18045 c 0.0902,0.36091 0.24061,0.72181 0.45113,1.05264 l -0.57143,0.81203 c -0.1203,0.15037 -0.0902,0.3609 0.0301,0.4812 l 0.3609,0.3609 0.3609,0.3609 c 0.1203,0.1203 0.33083,0.15038 0.48121,0.0301 l 0.81203,-0.57143 c 0.33082,0.21053 0.69173,0.33083 1.05263,0.45113 l 0.15037,0.9624 c 0.0301,0.18045 0.1804605,0.30076 0.3609096,0.30076 h 0.4811982 0.4811988 c 0.18045,0 0.33083,-0.12031 0.3609,-0.30076 l 0.18046,-0.99248 c 0.3609,-0.0902 0.7218,-0.2406 1.02255,-0.42105 l 0.81203,0.57143 c 0.15038,0.1203 0.3609,0.0902 0.48121,-0.0301 l 0.3609,-0.3609 0.3609,-0.3609 c 0.1203,-0.1203 0.15038,-0.33083 0.0301,-0.4812 l -0.57143,-0.81203 c 0.21052,-0.33083 0.3609,-0.69173 0.45112,-1.05264 l 0.99249,-0.15037 c 0.18045,-0.0301 0.30075,-0.18045 0.30075,-0.3609 V 9.6338375 9.1526396 c 0,-0.1804494 -0.1203,-0.3308288 -0.30075,-0.3608988 l -0.99249,-0.18045 c -0.0601,-0.36091 -0.21052,-0.72181 -0.42105,-1.05264 z m -1.38346,3.4285752 c -0.75188,1.203 -2.3157882,1.56391 -3.5187866,0.81203 -1.20301,-0.75188 -1.56391,-2.3157879 -0.81203,-3.5187952 0.75188,-1.20301 2.3157872,-1.56391 3.5187866,-0.81203 1.20301,0.75188 1.56391,2.3458561 0.81203,3.5187952 z"})]}),exports.Checkbox=Na,exports.DM=_C,exports.DR=(e,t)=>{let n=oh({palette:{mode:e?"dark":"light"}}),o={typography:{},palette:{mode:e?"dark":"light",text:{secondary:e?n.palette.text.secondary:pt(n.palette.text.secondary,.75),icon:e?pt(n.palette.text.secondary,.7):pt(n.palette.text.primary,.75)}},components:{MuiDialogTitle:{styleOverrides:{root:{fontWeight:"normal"}}},MuiSelect:{styleOverrides:{iconOutlined:{top:"unset"}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"0px !important",overflow:"hidden",marginLeft:"0px",marginRight:"6px",padding:"1px 1px",border:"solid transparent 1px"}}},MuiMenuItem:{styleOverrides:{root:{paddingTop:"2px",paddingBottom:"2px",marginLeft:"4px",marginRight:"4px",paddingLeft:"6px",paddingRight:"18px",borderRadius:"4px",fontSize:"0.875em","@media (pointer: coarse)":{fontSize:"1em"},"&.Mui-selected":{}}}},MuiDivider:{styleOverrides:{root:{marginTop:"4px !important",marginBottom:"4px !important",marginLeft:"0px",marginRight:"0px"}}},MuiPopper:{styleOverrides:{root:{"& .menu":{marginTop:"4px",marginBottom:"4px",borderRadius:"4px"}}}},SmartInputField:{styleOverrides:{automatic:{transition:"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",color:function(){return n.palette.text.secondary}},dirty:{fontStyle:"italic",color:function(){return n.palette.text.secondary}}}}}},r=o;return t&&(r=cr(o,t)),oh(r)},exports.De=$e,exports.DialogContent=Ex,exports.ER=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 17.055601,3.649384 c 0.231,-0.4871429 0.559428,-0.7307143 0.983714,-0.7307143 0.389714,0 0.691428,0.1854286 0.900428,0.5547143 0.210572,0.3708571 0.315858,0.8752857 0.315858,1.518 0,0.6961429 -0.122572,1.254 -0.369286,1.6767143 -0.245143,0.4211429 -0.573572,0.6317143 -0.985286,0.6317143 -0.372428,0 -0.653714,-0.1964286 -0.843857,-0.5877143 h -0.01257 V 7.1992412 H 16.112743 V 1.0140983 h 0.931858 V 3.649384 h 0.01257 z m -0.02514,1.7285714 a 1.2257143,1.2257143 0 0 0 0.168143,0.6694286 c 0.111568,0.1775714 0.256139,0.2655714 0.430568,0.2655714 0.213714,0 0.377143,-0.1131428 0.493429,-0.3394285 0.117857,-0.2278572 0.177571,-0.55 0.177571,-0.9664286 0,-0.3457143 -0.055,-0.6128572 -0.163429,-0.8077143 -0.105285,-0.1948572 -0.257714,-0.2938572 -0.455714,-0.2938572 -0.188571,0 -0.344143,0.097429 -0.466714,0.2907143 a 1.3922857,1.3922857 0 0 0 -0.183857,0.7542857 z m -3.501146,1.8118572 h 1.012 V 4.5026697 c 0,-1.276 -0.495,-1.9171428 -1.483428,-1.9171428 -0.212143,0 -0.447858,0.037714 -0.707143,0.1147143 a 2.2691429,2.2691429 0 0 0 -0.609715,0.2624285 v 1.045 c 0.372429,-0.319 0.765286,-0.4777143 1.178572,-0.4777143 0.410143,0 0.616,0.2451429 0.616,0.737 l -0.942857,0.1618572 c -0.795143,0.1351428 -1.194286,0.638 -1.194286,1.5101428 0,0.4132858 0.09586,0.7432858 0.287571,0.9915715 a 0.95857143,0.95857143 0 0 0 0.796715,0.3692857 c 0.455714,0 0.799857,-0.2514286 1.032428,-0.7542857 h 0.01414 z m 0.0063,-2.1292857 V 5.3638126 A 1.1785714,1.1785714 0 0 1 13.347029,6.0489554 0.57828571,0.57828571 0 0 1 12.855172,6.3160983 0.43371429,0.43371429 0 0 1 12.509458,6.1668126 0.59714286,0.59714286 0 0 1 12.383744,5.7770983 c 0,-0.3488571 0.172857,-0.5515714 0.521714,-0.6112857 l 0.628571,-0.1052857 z"}),s.jsx("path",{className:"styled info",d:"M 5.3013153,11.534813 1.9698867,8.192384 3.0101724,7.1520983 4.5910295,8.7235269 V 6.3506697 A 2.1842857,2.1842857 0 0 1 6.770601,4.1569554 h 3.685 v 1.4221429 h -3.685 A 0.77,0.77 0 0 0 6.0351724,6.3538126 l 0.011,2.3571428 1.4912857,-1.4834285 1.0308572,1.0308571 -3.2685715,3.276429 z"}),s.jsx("path",{d:"m 9.8270295,19.761241 h -1.012 V 19.116955 H 8.8008867 C 8.5683153,19.619812 8.2241724,19.871241 7.7684581,19.871241 A 0.95857143,0.95857143 0 0 1 6.9717438,19.501955 c -0.1917143,-0.248286 -0.2875714,-0.578286 -0.2875714,-0.99 0,-0.873714 0.3991429,-1.376571 1.1942857,-1.511714 l 0.9428572,-0.161857 c 0,-0.491857 -0.2042858,-0.738572 -0.616,-0.738572 -0.4132858,0 -0.8061429,0.160286 -1.1785715,0.479286 v -1.045 c 0.1492857,-0.099 0.352,-0.187 0.6097143,-0.262429 0.2592857,-0.077 0.495,-0.114714 0.7071429,-0.114714 0.99,0 1.4834285,0.639572 1.4834285,1.917143 z m -1.0057142,-1.826 v -0.303286 l -0.6285715,0.106857 c -0.3488571,0.05814 -0.5232857,0.260857 -0.5232857,0.609715 0,0.157142 0.042429,0.287571 0.1257143,0.389714 a 0.43371429,0.43371429 0 0 0 0.3457143,0.149286 0.57828571,0.57828571 0 0 0 0.4902857,-0.267143 c 0.1257143,-0.182286 0.1885714,-0.408572 0.1885714,-0.685143 z m 4.5602857,1.936 c 0.504428,0 0.892571,-0.09114 1.159714,-0.271857 v -1.115715 a 1.4142857,1.4142857 0 0 1 -0.867428,0.325286 0.97271429,0.97271429 0 0 1 -0.785715,-0.337857 c -0.188571,-0.227857 -0.284428,-0.542143 -0.284428,-0.939714 0,-0.408572 0.099,-0.729143 0.297,-0.961715 a 1.012,1.012 0 0 1 0.810857,-0.350428 c 0.304857,0 0.581428,0.108428 0.829714,0.325286 v -1.177 c -0.202714,-0.141429 -0.531143,-0.210572 -0.983714,-0.210572 -0.655286,0 -1.180143,0.22 -1.573,0.663143 -0.391286,0.44 -0.586143,1.040286 -0.586143,1.804 0,0.66 0.182286,1.200571 0.548429,1.618571 0.364571,0.419572 0.843857,0.628572 1.434714,0.628572 z M 1.9698867,13.585527 3.5413152,12.014098 H 17.684172 l 1.571429,1.571429 v 7.857142 l -1.571429,1.571429 H 3.5413152 L 1.9698867,21.442669 Z m 1.5714285,0 v 7.857142 H 17.684172 V 13.585527 Z M 8.255601,10.44267 9.8270295,8.8712412 H 20.827029 l 1.571429,1.5714288 v 7.857142 l -1.571429,1.571429 V 10.44267 Z"})]}),exports.F0=pa,exports.Fi=Ja,exports.Fn=Bn,exports.FormControl=b1,exports.FormControlLabel=$a,exports.GC=pw,exports.Go=rr,exports.HR=dC,exports.IR=function(e){var t=e.children,n=e.legacy,o=n!==void 0&&n,r=e.suspense,i=r===void 0||r,a=e.fallback,l=a===void 0?null:a,c=u.useReducer(YD,XD),d=c[0],p=c[1],f=u.useCallback(function(v,b){var w=Ev(b,JD);v?p({type:ki.UPDATE,payload:{id:v,props:w}}):console.error(Lp)},[p]),h=u.useCallback(function(v){v?p({type:ki.HIDE,payload:{id:v}}):console.error(Lp)},[p]),g=u.useCallback(function(v){v?p({type:ki.DESTROY,payload:{id:v}}):console.error(Lp)},[p]),m=u.useCallback(function(v){v?p({type:ki.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),y=u.useCallback(function(v,b,w){var M=Tv(8);return w&&w.rootId&&(M=w.rootId+"."+M),p({type:ki.SHOW,payload:{id:M,component:v,props:b,options:w}}),{id:M,hide:function(){return h(M)},destroy:function(){return g(M)},update:function(k){return f(M,k)}}},[p,h,g,f]),x=i?u.Suspense:u.Fragment;return u.createElement(Mv.Provider,{value:{state:d,updateModal:f,hideModal:h,destroyModal:g,showModal:y,destroyModalsByRootId:m}},t,u.createElement(x,Object.assign({},i&&{fallback:l}),Object.keys(d).map(function(v){var b,w=d[v],M=w.component,k=w.props,j=w.options,_=function(){var L,T;k!=null&&k.onExited&&k.onExited.apply(k,arguments),k!=null&&(L=k.TransitionProps)!=null&&L.onExited&&(T=k.TransitionProps).onExited.apply(T,arguments),g(v)};return b=o?{onExited:_}:{TransitionProps:Er({},k?.TransitionProps,{onExited:_})},u.createElement(M,Object.assign({},k,{key:v,onClose:function(){j&&j.hideOnClose&&h(v),j&&j.destroyOnClose&&j.hideOnClose&&g(v),k&&k.onClose&&k.onClose.apply(k,arguments)}},j&&!j.destroyOnClose&&b))})))},exports.IT=LS,exports.IconButton=Tr,exports.InputAdornment=Tx,exports.InputLabel=_x,exports.JM=Zf,exports.Ji=rl,exports.Jt=Gt,exports.Kn=Xn,exports.L9=Z3,exports.LR=()=>{const{showModal:e}=pd();return t=>new Promise(n=>{const o=e(IA,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.Le=Ge,exports.MR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1z"}),s.jsx("path",{d:"M11 7h2v6h-2zm0 8h2v2h-2z"})]}),exports.MenuItem=v1,exports.Mn=jn,exports.N0=ha,exports.OR=function(){const[e,t]=u.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=pd({disableAutoDestroy:!0});return(a,l,c,d)=>new Promise((p,f)=>{const h={...c,onHide:()=>{const x=e.get(a);c?.onHide?.(),t(v=>(v.delete(a),v)),i(x.id)},onDone:x=>{const v=e.get(a);t(b=>(b.delete(a),b)),c?.onDone?.(x),v&&v.id&&!d?.disableAutoDestroy&&r(v.id)},onShown:x=>{t(v=>{const b=v.get(a);return v.set(a,{...b,element:x}),v}),p(x)},open:!0},g=e.get(a);if(g)return o(g.id,h),void p(g.element);if(!l)return void f("invalid function");const m=u.lazy(l),y=n(m,h,{destroyOnClose:!d?.disableAutoDestroy});t(x=>(x.set(a,{id:y.id,element:null}),x))})},exports.Oe=We,exports.PC=sw,exports.PR=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.Paper=Ti,exports.Px=kv,exports.Qt=Zt,exports.RR=OD,exports.Rc=Xc,exports.SR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 10.48227,13.29653 h 1.7802 L 7.50778,0.81713998 H 5.7837 L 1.0312503,13.29653 h 1.7802 l 1.20102,-3.41449 H 9.20941 Z M 4.5198203,8.47224 6.38758,3.28429 C 6.46388,3.08 6.53125,2.79041 6.58962,2.41327 h 0.0404 c 0.0696,0.41306 0.13469,0.70489 0.19306,0.87102 l 1.88571,5.18795 z"}),s.jsx("path",{className:"styled info",d:"M 11.02105,18.09612 C 10.34084,17.97041 9.70105,17.68306 9.17798,17.22061 7.82207,16.02408 7.4786,14.08 8.34064,12.49286 l -1.21,-0.65776 c -1.16959,2.15286 -0.7049,4.79061 1.13592,6.41592 0.77449,0.68245 1.73755,1.09551 2.75224,1.23245 v 0.91816 l 2.40653,-1.67918 -2.40428,-1.67918 z"}),s.jsx("path",{d:"m 22.27023,17.16 c -0.50735,-0.54551 -1.18531,-0.86653 -2.03388,-0.96306 v -0.0314 c 0.68245,-0.22 1.21898,-0.5949 1.60735,-1.1202 0.38837,-0.52531 0.58367,-1.13368 0.58367,-1.82062 0,-0.86428 -0.32775,-1.5602 -0.98326,-2.08326 -0.65551,-0.52306 -1.53102,-0.78572 -2.62653,-0.78572 h -3.66592 v 12.47715 h 3.76245 c 1.20326,0 2.19102,-0.33225 2.96102,-0.99449 0.77,-0.66225 1.15612,-1.52878 1.15612,-2.60408 0,-0.83735 -0.25367,-1.52878 -0.76102,-2.07429 z m -5.50674,-5.39449 h 1.61184 c 1.56919,0 2.35265,0.58816 2.35265,1.76449 0,0.67122 -0.22224,1.19653 -0.66449,1.57592 -0.44224,0.37939 -1.0551,0.56796 -1.83183,0.56796 h -1.46592 z m 3.88817,9.07612 C 20.19145,21.23 19.54043,21.42531 18.6986,21.42531 h -1.93286 v -4.34837 h 1.66796 c 1.93959,0 2.90714,0.71612 2.90714,2.14388 0,0.69142 -0.23122,1.23245 -0.68918,1.62081 z"})]}),exports.Select=w2,exports.SheetXL=AN,exports.StudioMUI=LC,exports.SvgIcon=Qe,exports.T0=Ki,exports.TR=e=>s.jsx(Qe,{...e,children:s.jsx("path",{d:"m 15.678266,1.1001645 h 1.784278 v 5.6910421 l 4.680073,-2.8464352 0.888483,1.617916 -4.687386,2.8500914 4.687386,2.8500922 -0.886654,1.617915 -4.681902,-2.846435 v 5.691042 h -1.784278 v -5.691042 l -4.680073,2.846435 -0.888484,-1.617915 4.687387,-2.8500922 -4.687387,-2.8500914 0.886656,-1.617916 4.681901,2.8464352 z M 1.0310983,15.725393 h 7.3126141 v 7.312614 H 1.0310983 Z"})}),exports.TextField=E3,exports.Transition=Ni,exports.Tt=Tt,exports.Typography=Tn,exports.UR=SC,exports.VR=e=>s.jsxs("svg",{...e,viewBox:"0 0 48 48",children:[s.jsx("path",{d:"M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z",fill:"#547DBE"}),s.jsx("path",{d:"m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z",fill:"#FFFFFF"}),s.jsx("path",{d:"m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z",fill:"#547DBE",fillOpacity:"0.4"}),s.jsx("path",{d:"m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z",strokeWidth:"2.5",stroke:"#EB594D",fill:"#f9CECB"})]}),exports.Vl=Gl,exports.W1=Kc,exports.WR=wC,exports.Xf=wf,exports.Xn=Lx,exports.Yb=Vb,exports._R=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 10.479463,15.147182 H 9.2682944 v -1.181675 h -0.029549 c -0.5268175,0.905987 -1.3022625,1.358912 -2.3263488,1.358912 -0.7533075,0 -1.3441175,-0.199375 -1.7724712,-0.598262 -0.4234175,-0.39875 -0.6351263,-0.927988 -0.6351263,-1.587768 0,-1.413046 0.8320676,-2.235269 2.4962163,-2.466668 l 2.267279,-0.317569 c 0,-1.2850343 -0.5194338,-1.927558 -1.5583013,-1.927558 -0.9108412,0 -1.7330638,0.3101862 -2.4666675,0.930545 V 8.1164215 C 5.9867743,7.6437652 6.8434681,7.4074302 7.8133931,7.4074302 c 1.77738,0 2.6660699,0.94039 2.6660699,2.8211698 z M 9.2682944,11.321616 7.4441369,11.572718 c -0.5612888,0.07877 -0.9847063,0.219093 -1.2702663,0.420956 -0.2855737,0.196942 -0.4283538,0.548969 -0.4283538,1.056097 0,0.369256 0.1304738,0.672058 0.3914213,0.908448 0.26587,0.231275 0.6178975,0.34705 1.0560962,0.34705 0.6006688,0 1.0954763,-0.209275 1.4844363,-0.627756 0.3938825,-0.423417 0.5908238,-0.957619 0.5908238,-1.602604 z"}),s.jsx("path",{d:"m 13.926616,14.054194 h -0.02955 v 1.092988 H 12.685885 V 3.9511339 h 1.211182 v 4.9628976 h 0.02955 c 0.595732,-1.0043963 1.467262,-1.5066013 2.614425,-1.5066013 0.969924,0 1.7281,0.3397213 2.274662,1.0191638 0.551375,0.67452 0.827063,1.580453 0.827063,2.717784 0,1.26533 -0.307725,2.279571 -0.923175,3.042779 -0.61545,0.758175 -1.457363,1.137262 -2.525738,1.137262 -0.999487,0 -1.755201,-0.423362 -2.267238,-1.270225 z m -0.02955,-3.050135 v 1.056083 c 0,0.625295 0.201864,1.157021 0.605591,1.59522 0.408595,0.433207 0.925595,0.649907 1.550945,0.649907 0.733562,0 1.307212,-0.280637 1.720675,-0.841926 0.41855,-0.561275 0.627825,-1.341656 0.627825,-2.34113 0,-0.841913 -0.194563,-1.5016653 -0.583413,-1.9792441 -0.388987,-0.4775787 -0.915887,-0.716375 -1.580562,-0.716375 -0.704,0 -1.270225,0.24618 -1.698538,0.7385263 -0.428353,0.4874375 -0.642523,1.1004128 -0.642523,1.8389388 z"}),s.jsx("path",{d:"m 1.0738031,15.147182 h 1.375 v 2.75 H 21.698803 v -2.75 h 1.375 v 4.125 h -1.375 -19.2499999 -1.375 z"})]}),exports._o=M3,exports._s=s0,exports.ai=ka,exports.alpha=pt,exports.ar=br,exports.au=e2,exports.b4=Ch,exports.bR=e=>s.jsx(Qe,{...e,children:s.jsx("path",{d:"m 21.230627,10.984379 c -0.103549,0.265939 -0.204749,0.531861 -0.308302,0.80018 -0.244758,0.640136 -0.491882,1.277905 -0.736619,1.918041 -0.296532,0.77195 -0.595423,1.546223 -0.891972,2.31813 -0.256524,0.666043 -0.513056,1.332042 -0.769584,2.000408 -0.122381,0.320068 -0.244757,0.640136 -0.369488,0.960183 -0.0071,0.01647 -0.01412,0.03295 -0.01883,0.04942 0.0306,-0.07531 0.06355,-0.15062 0.09414,-0.22593 -0.05884,0.138855 -0.129439,0.273001 -0.218868,0.393024 0.04942,-0.06354 0.09885,-0.127085 0.148266,-0.190629 -0.05884,0.07531 -0.122381,0.141204 -0.197691,0.200041 0.06354,-0.04942 0.127084,-0.09885 0.190629,-0.148266 -0.05648,0.04001 -0.112965,0.07531 -0.17651,0.103549 0.07531,-0.0306 0.150621,-0.06355 0.225931,-0.09414 -0.08002,0.03295 -0.160037,0.05413 -0.244758,0.06825 0.08237,-0.01177 0.167093,-0.02353 0.249466,-0.03295 -0.17651,0.02354 -0.360077,0.01177 -0.536596,0.01177 H 16.596651 12.981767 8.5974282 4.7848441 c -0.6071714,0 -1.2143859,0.0047 -1.8239241,0 -0.037655,0 -0.07531,-0.0024 -0.115319,-0.0047 0.082372,0.01177 0.1670935,0.02353 0.2494657,0.03295 -0.070602,-0.0094 -0.1388548,-0.02824 -0.204749,-0.05177 0.07531,0.03059 0.1506203,0.06354 0.2259303,0.09414 -0.063545,-0.02824 -0.1247306,-0.06119 -0.1812132,-0.1012 0.063544,0.04942 0.1270848,0.09885 0.1906293,0.148266 -0.063544,-0.04942 -0.120027,-0.105903 -0.1694477,-0.169447 0.080018,0.138854 0.1623858,0.277705 0.2424039,0.416559 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023534,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063544,-0.216514 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.22593 0.1529742,-0.338895 0.2777048,-0.689539 0.4094974,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366189,-1.915717 0.2965322,-0.771949 0.593056,-1.546223 0.8919727,-2.31813 0.2565232,-0.670733 0.5154222,-1.3391 0.7719499,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765505,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094137,0.225931 0.058836,-0.131793 0.1270845,-0.256524 0.2141645,-0.371843 -0.049421,0.06354 -0.098846,0.127085 -0.1482661,0.190629 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223576 -0.063544,0.04942 -0.1270845,0.09885 -0.190629,0.148266 0.070602,-0.05413 0.1435581,-0.09649 0.2259303,-0.134146 -0.07531,0.03059 -0.1506203,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670939,0.02353 -0.2494658,0.03295 0.1718016,-0.02118 0.3506609,-0.0094 0.5224799,-0.0094 h 1.1014247 3.6642876 4.441143 3.777253 c 0.569517,0 1.139076,-0.0024 1.708592,0 0.09414,0 0.19063,0.0024 0.284768,0.01412 -0.08237,-0.01177 -0.167094,-0.02353 -0.249466,-0.03295 0.06119,0.0094 0.122381,0.02353 0.178859,0.04472 -0.07531,-0.03059 -0.15062,-0.06354 -0.22593,-0.09414 0.0353,0.01412 0.06589,0.03295 0.09649,0.05413 -0.06354,-0.04942 -0.127084,-0.09885 -0.190629,-0.148267 0.01883,0.01647 0.0353,0.03059 0.04942,0.04942 -0.04942,-0.06354 -0.09885,-0.127085 -0.148266,-0.190629 0.01412,0.01883 0.02589,0.04001 0.03765,0.06354 -0.03059,-0.07531 -0.06354,-0.15062 -0.09414,-0.22593 0.01177,0.03295 0.02118,0.06354 0.02589,0.09885 -0.01177,-0.08237 -0.02353,-0.167094 -0.03295,-0.249466 0.0024,0.04001 0.0024,0.08002 -0.0024,0.122381 0.01177,-0.08237 0.02353,-0.167094 0.03295,-0.249466 -0.01647,0.112965 -0.05177,0.221223 -0.09414,0.32713 0.03059,-0.07531 0.06354,-0.15062 0.09414,-0.22593 -0.0047,0.01412 -0.01177,0.02589 -0.01647,0.04001 -0.06825,0.108258 -0.105904,0.223577 -0.110612,0.350661 -0.02824,0.124731 -0.02353,0.249466 0.01647,0.376551 0.06119,0.218868 0.228284,0.454227 0.433011,0.562459 0.218868,0.115319 0.482458,0.174155 0.72487,0.09414 0.216515,-0.0706 0.468343,-0.214164 0.562459,-0.433011 0.07296,-0.171802 0.162386,-0.348312 0.197691,-0.534229 0.04707,-0.254169 0.05884,-0.449493 0.0071,-0.698963 C 23.085384,10.14653 22.838276,9.83117 22.534673,9.68055 22.233432,9.527576 21.908652,9.485213 21.572124,9.482859 h -0.400086 -2.167511 -3.348932 -3.68077 -3.2453915 -1.96512 c -0.1341464,0 -0.270647,-0.0047 -0.4047895,0.0094 -0.3341874,0.03765 -0.6542509,0.115319 -0.9366854,0.310656 -0.2918244,0.200041 -0.5295376,0.449494 -0.7083882,0.757792 -0.094138,0.160036 -0.1600361,0.336541 -0.2282842,0.508321 -0.2777051,0.724871 -0.5577682,1.449741 -0.8354688,2.172245 -0.4330112,1.127284 -0.866066,2.254612 -1.3014443,3.381896 -0.2894748,0.750734 -0.5789408,1.503835 -0.8660659,2.254612 -0.014121,0.03766 -0.028241,0.07531 -0.044717,0.112965 0.030595,-0.07531 0.063544,-0.15062 0.094138,-0.22593 -0.1200271,0.263585 -0.2000409,0.47071 -0.2118109,0.762525 -0.00471,0.120027 0.014121,0.24005 0.035302,0.355369 0.040009,0.195337 0.1412041,0.353015 0.2659393,0.508322 0.2165145,0.270647 0.5765741,0.491882 0.9178362,0.557768 0.1506203,0.02824 0.3012406,0.04707 0.4542277,0.04707 h 0.5106883 2.3134399 3.3748389 3.6501724 3.139484 1.840407 c 0.256523,0 0.513055,-0.0024 0.764849,-0.07531 0.30124,-0.08708 0.578941,-0.249466 0.800181,-0.473034 0.263585,-0.263585 0.418913,-0.578941 0.557768,-0.920203 0.01883,-0.04942 0.03765,-0.09885 0.05648,-0.148266 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.430688,-1.117903 0.859008,-2.235763 1.289696,-3.353666 0.284767,-0.738986 0.567193,-1.477971 0.851951,-2.216957 0.01412,-0.03766 0.02824,-0.07296 0.04236,-0.110611 0.08237,-0.214165 0.01647,-0.534228 -0.09414,-0.72487 -0.115319,-0.195338 -0.338895,-0.381259 -0.562458,-0.433012 -0.24005,-0.05413 -0.510689,-0.04236 -0.724871,0.09414 -0.209457,0.143558 -0.331833,0.32713 -0.425971,0.567192 z M 17.898048,6.835008 v 3.146542 0.437745 c 0.313006,-0.313006 0.628388,-0.628388 0.941376,-0.941376 H 17.872141 15.462219 12.379196 9.3644251 7.1686842 c -0.6048476,0 -1.2308681,-0.04472 -1.7556719,0.329479 -0.4259712,0.303595 -0.7036976,0.69664 -0.8942966,1.179055 -0.016474,0.04001 -0.030595,0.08237 -0.047071,0.124731 -0.08943,0.232992 -0.1788593,0.465976 -0.2682935,0.698963 -0.3247757,0.844894 -0.6495602,1.68742 -0.9743401,2.532313 -0.3647851,0.948434 -0.7295611,1.899235 -1.0943633,2.847668 -0.2212223,0.571884 -0.4401122,1.146134 -0.6613086,1.718017 -0.011767,0.02824 -0.021181,0.05648 -0.032948,0.08473 0.030595,-0.07531 0.063544,-0.15062 0.094137,-0.22593 -0.1176729,0.258877 -0.1835671,0.44717 -0.2094567,0.729561 -0.01412,0.157682 0.00471,0.329479 0.056483,0.480091 0.5742503,-0.242404 1.1461337,-0.482458 1.7203839,-0.72487 -0.035302,-0.04942 -0.065894,-0.1012 -0.091784,-0.157683 0.030595,0.07531 0.063545,0.150621 0.094137,0.225931 -0.028241,-0.0706 -0.049421,-0.138855 -0.06119,-0.214165 0.011767,0.08237 0.023534,0.167094 0.032948,0.249466 -0.018827,-0.160036 -0.00706,-0.32713 -0.00706,-0.489516 V 17.813782 14.311863 10.0639 6.4019361 c 0,-0.5813076 -0.00471,-1.1649394 0,-1.7462474 0,-0.037655 0.00235,-0.077664 0.00471,-0.115319 -0.011767,0.082372 -0.023535,0.1670938 -0.032948,0.2494657 0.00941,-0.072956 0.028241,-0.1435583 0.056483,-0.2118106 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.2259303 0.028241,-0.065894 0.063544,-0.1270848 0.108257,-0.1859212 -0.049421,0.063544 -0.098845,0.1270845 -0.1482661,0.190629 0.044717,-0.056483 0.094138,-0.1059032 0.1506203,-0.15062 -0.063544,0.049421 -0.1270848,0.098846 -0.1906293,0.1482661 0.058836,-0.042362 0.1200271,-0.077664 0.1859213,-0.1082571 -0.07531,0.030595 -0.1506203,0.063544 -0.2259303,0.094137 0.068248,-0.028241 0.1388545,-0.044717 0.2118106,-0.056483 -0.082372,0.011768 -0.1670935,0.023535 -0.2494658,0.032948 0.1929832,-0.018827 0.3906703,-0.00471 0.5836318,-0.00471 h 1.2473072 2.873532 0.6636754 C 7.9429095,4.60862 7.6722712,4.453292 7.401628,4.2979723 7.8887769,4.938108 8.3736017,5.578244 8.8607503,6.2183797 8.9289983,6.3101637 8.9996049,6.3995929 9.0678531,6.4913809 9.2184733,6.6890719 9.3785094,6.8726392 9.6350456,6.929126 9.7056476,6.9456 9.8186129,6.959721 9.891569,6.962074 h 0.049421 0.642503 2.704105 3.071232 c 0.548343,0 1.099053,-0.00471 1.647397,0 0.03765,0 0.07531,0.00235 0.115319,0.00471 -0.08237,-0.011767 -0.167094,-0.023534 -0.249466,-0.032948 0.07296,0.00941 0.143559,0.028241 0.211811,0.056483 -0.07531,-0.030595 -0.15062,-0.063545 -0.22593,-0.094137 0.06589,0.028241 0.127085,0.063544 0.185921,0.108257 -0.06354,-0.049421 -0.127085,-0.098845 -0.190629,-0.1482661 0.05648,0.044717 0.105903,0.094137 0.15062,0.15062 -0.04942,-0.063545 -0.09885,-0.1270845 -0.148266,-0.190629 0.04236,0.058836 0.07766,0.1200271 0.108257,0.1859213 -0.03059,-0.07531 -0.06354,-0.1506203 -0.09414,-0.2259303 0.02824,0.068248 0.04472,0.1388545 0.05648,0.2118106 -0.01177,-0.082372 -0.02354,-0.1670938 -0.03295,-0.2494658 0.0024,0.032948 0.0047,0.065894 0.0047,0.096492 0.0047,0.2447577 0.1012,0.4918825 0.275351,0.6660425 0.162386,0.1623858 0.430688,0.2871209 0.666043,0.2753509 0.501263,-0.023534 0.9508,-0.4142054 0.941376,-0.9413763 -0.01883,-0.9672827 -0.793123,-1.7415564 -1.760363,-1.7556716 -0.110611,-0.00235 -0.218868,0 -0.32948,0 h -1.795679 -2.525255 -2.311073 c -0.383613,0 -0.769583,-0.00941 -1.1531914,0 H 9.8892086 C 10.159856,5.2346612 10.430495,5.3899892 10.701138,5.5453089 10.183391,4.8651512 9.6679691,4.1850366 9.150223,3.5048786 9.117275,3.4601618 9.0819748,3.415449 9.0490234,3.3707322 9.0419632,3.3636719 9.0372561,3.354258 9.0301959,3.347198 8.8960493,3.1730422 8.7854381,3.0483116 8.5783352,2.9612316 8.4300691,2.8976871 8.4182991,2.8859213 8.2135504,2.8812136 c -0.070602,-0.00235 -0.1388545,0 -0.2094567,0 H 6.80619 3.5984533 c -0.2188681,0 -0.4353783,-0.00471 -0.6542509,0 -0.3271299,0.00471 -0.6731002,0.091784 -0.9460669,0.2800586 -0.3412493,0.2329922 -0.5671925,0.5318615 -0.715446,0.9178366 -0.072956,0.1859213 -0.094137,0.3930238 -0.094137,0.593056 -0.00235,0.4353786 0,0.8707569 0,1.3061785 v 2.6711407 3.372472 3.334817 2.635853 c 0,0.409498 -0.00235,0.818987 0,1.228502 0.00235,0.338895 0.091784,0.70133 0.2894748,0.979031 0.1388545,0.195337 0.3177138,0.37655 0.5624586,0.433011 0.2094567,0.04707 0.4142057,0.03766 0.6119054,-0.04707 0.4071434,-0.171801 0.6989637,-0.663675 0.5460196,-1.110802 -0.011767,-0.0353 -0.021181,-0.0706 -0.025888,-0.105903 0.011767,0.08237 0.023535,0.167094 0.032948,0.249466 -0.00235,-0.04236 -0.00235,-0.08237 0.00235,-0.122381 -0.011767,0.08237 -0.023535,0.167093 -0.032948,0.249465 0.011767,-0.07531 0.032948,-0.145912 0.063545,-0.216514 -0.030595,0.07531 -0.063545,0.15062 -0.094138,0.22593 0.1529742,-0.338895 0.2777051,-0.689539 0.4094977,-1.035492 0.2447577,-0.637769 0.4918825,-1.275581 0.7366186,-1.915717 0.2965325,-0.771949 0.5930563,-1.546223 0.8919727,-2.31813 0.2565235,-0.670733 0.5154225,-1.3391 0.7719502,-2.009833 0.1247306,-0.32713 0.2541693,-0.651884 0.3765502,-0.981398 0.00235,-0.0047 0.00471,-0.0094 0.00471,-0.01412 -0.030595,0.07531 -0.063544,0.15062 -0.094138,0.22593 0.058837,-0.131793 0.1270848,-0.256523 0.2141648,-0.371843 -0.049421,0.06354 -0.098845,0.127085 -0.1482661,0.19063 0.065894,-0.08237 0.1388545,-0.157682 0.2212222,-0.223577 -0.063544,0.04942 -0.1270848,0.09885 -0.1906293,0.148267 0.070602,-0.05413 0.1435584,-0.09649 0.2259303,-0.134147 -0.07531,0.03059 -0.15062,0.06354 -0.2259303,0.09414 0.08943,-0.03766 0.1788593,-0.06119 0.2730013,-0.07531 -0.082372,0.01177 -0.1670936,0.02354 -0.2494658,0.03295 0.1435584,-0.01647 0.2941786,-0.0094 0.4401122,-0.0094 h 0.8731262 2.9394612 3.574862 3.120678 c 0.503631,0 1.004938,0.0071 1.508569,0 h 0.02118 c 0.508321,0 0.941376,-0.430688 0.941376,-0.941376 V 7.2703743 6.8326289 c 0,-0.4918825 -0.433011,-0.9649159 -0.941376,-0.9413759 -0.508322,0.025888 -0.941376,0.4165592 -0.941376,0.9437427 z"})}),exports.bu=xu,exports.cM=Of,exports.capitalize=xt,exports.clsx=Ot,exports.cn=cn,exports.composeClasses=In,exports.createSvgIcon=Kn,exports.darken=Ol,exports.duration=ix,exports.eM=Rf,exports.eR=Xf,exports.fe=Te,exports.gR=({manager:e,commands:t,disabled:n,notifier:o=xu})=>{const r=Te(a=>{try{e?.undo(a)}catch(l){o.showError?.(l)}},[e]),i=Te(a=>{try{e?.redo(a)}catch(l){o.showError?.(l)}},[e]);return u.useMemo(()=>{if(!t)return;const a={contains:c=>!0,focus(){}},l=[new We("undo",a,{label:"Undo",description:T4,shortcut:{key:"z",modifiers:[$e.Ctrl]},disabled:!0},r),new We("redo",a,{label:"Redo",description:_4,shortcut:[{key:"y",modifiers:[$e.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[$e.Alt]}],disabled:!0},i)];t?.addCommands(l,!0)},[t]),u.useEffect(()=>{if(!t)return;const a=()=>{const c=e?.getTopUndoDescription(),d={};var p;t.getCommand("undo").update({disabled:n||!e||!e.hasUndo(),description:c?(p=c,`Undo ${p}`):T4,state:d,context:{undoManager:e}});const f=e?.getTopRedoDescription();t.getCommand("redo").update({disabled:n||!e||!e.hasRedo(),description:f?pI(f):_4,state:d,context:{undoManager:e}})};if(a(),!e)return;const l=e.addListener({onStackChange(){a()}});return()=>l?.()},[e,t,n]),{undo:r,redo:i}},exports.gc=a1,exports.generateUtilityClass=Rn,exports.generateUtilityClasses=Mn,exports.getTransitionProps=Dc,exports.globalCss=sx,exports.gs=a0,exports.h5=W2,exports.internal_mutateStyles=r3,exports.internal_serializeStyles=Mr,exports.ir=xr,exports.kR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 13.825079,18.501033 H 11.95551 L 10.427711,14.46047 H 4.3164615 L 2.8791069,18.501033 H 0.99950668 L 6.5277646,4.0874418 H 8.2767047 Z M 9.8748861,12.942702 7.6133175,6.8013238 C 7.5396037,6.6002808 7.4658898,6.2786458 7.3921947,5.8363818 h -0.040216 c -0.067014,0.408748 -0.1440592,0.730402 -0.2311721,0.964942 l -2.24147,6.1413782 z"}),s.jsx("path",{d:"M 22.999506,18.501033 H 21.35119 v -1.608081 h -0.04023 c -0.716927,1.232869 -1.772388,1.84949 -3.166196,1.84949 -1.025331,0 -1.829278,-0.271538 -2.412346,-0.81424 -0.576274,-0.542701 -0.864411,-1.263184 -0.864411,-2.161075 0,-1.923147 1.132525,-3.042198 3.397275,-3.357133 l 3.085913,-0.432215 c 0,-1.74894 -0.707009,-2.6234182 -2.12084,-2.6234182 -1.239793,0 -2.358694,0.422166 -3.357208,1.2664762 V 8.9322138 c 1.011801,-0.643289 2.177861,-0.964942 3.497936,-0.964942 2.418952,0 3.628428,1.279877 3.628428,3.8396302 z m -1.648316,-5.206529 -2.482766,0.341752 c -0.763899,0.107212 -1.340099,0.298187 -1.728785,0.572925 -0.388687,0.268038 -0.582937,0.74715 -0.582937,1.437429 0,0.502467 0.177595,0.914546 0.532596,1.236237 0.361926,0.314954 0.841001,0.472337 1.437411,0.472337 0.817421,0 1.490932,-0.284637 2.020347,-0.854287 0.535965,-0.576199 0.804134,-1.303326 0.804134,-2.181155 z"})]}),exports.ka=bs,exports.km=Vf,exports.kn=En,exports.lS=Lv,exports.lighten=Dl,exports.memoTheme=Sn,exports.nk=hw,exports.ns=Xs,exports.q9=J3,exports.qR=AC,exports.rn=on,exports.sM=Pf,exports.styled=Et,exports.styled$1=a2,exports.su=Hf,exports.useDefaultProps=An,exports.useForkRef=Xo,exports.useTheme=i0,exports.useTimeout=vl,exports.vR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),s.jsx("path",{className:"styled secondary_light",d:"M 10.363689,16.028891 10.345659,15.996611 9.4734966,14.37091 8.5619879,16.028912 H 7.3633702 L 8.8418569,13.567063 7.3668314,10.90392 H 8.63729 l 0.018027,0.03581 0.872161,1.729842 0.907731,-1.765668 h 1.198618 l -1.478485,2.616296 1.482266,2.512154 z m 4.665607,0 h -2.953777 v -5.124987 h 1.137804 l -2.54e-4,4.102093 h 1.833979 z m 3.309014,-0.330196 h -2.55e-4 c -0.364996,0.290393 -0.822367,0.439348 -1.288281,0.419821 -0.483409,-0.01051 -0.964575,-0.07059 -1.43568,-0.179494 l -0.319438,-0.06109 0.118416,-0.907988 h 0.06109 c 0.496925,0.07435 0.997838,0.118671 1.500281,0.132932 0.484409,0 0.717711,-0.193763 0.717711,-0.585048 0.0084,-0.126168 -0.05033,-0.247587 -0.154462,-0.319436 -0.217293,-0.125426 -0.451866,-0.218549 -0.696178,-0.276375 -0.450111,-0.10039 -0.871457,-0.302915 -1.230924,-0.592056 -0.250844,-0.261105 -0.380767,-0.61484 -0.358989,-0.976048 -0.03205,-0.442856 0.145944,-0.875173 0.480903,-1.16658 0.372757,-0.27187 0.827876,-0.4063 1.288473,-0.380266 0.468637,0.0088 0.935799,0.05808 1.396139,0.147202 l 0.322941,0.06109 -0.09338,0.922278 h -0.0646 c -0.685413,-0.07536 -1.17709,-0.1149 -1.456957,-0.1149 -0.739246,0 -0.739246,0.35899 -0.739246,0.46663 v -2.53e-4 c -2.54e-4,0.124163 0.06334,0.239575 0.168479,0.305162 0.293896,0.149452 0.601566,0.269614 0.918754,0.35899 0.387778,0.100895 0.747253,0.288643 1.05167,0.548998 0.22756,0.265109 0.339963,0.610077 0.312175,0.958295 0.03504,0.464132 -0.141691,0.919267 -0.480905,1.238164 z m 3.631947,0.330195 v -0.03228 l -0.879468,-1.625958 -0.911511,1.658 -1.1951,2.55e-4 1.482273,-2.461843 -1.475286,-2.663143 h 1.270463 l 0.01803,0.0358 0.872162,1.729842 0.907988,-1.765667 h 1.184331 l -1.478492,2.616295 1.482272,2.512152 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.ve=ze,exports.wR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731423 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605952 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z "}),s.jsx("path",{className:"styled secondary_light",d:"m 7.7187557,5.6810989 h 3.9153913 c 0.116687,0 0.211776,0.096094 0.211776,0.2127813 v 0.8457422 c 0,0.1166881 -0.09489,0.2117769 -0.211776,0.2117769 H 7.7187557 c -0.116688,0 -0.2117768,-0.094892 -0.2117768,-0.2117769 V 5.8938802 c 0,-0.116688 0.094893,-0.2127813 0.2117768,-0.2127813 z M 8.7772903,9.7481656 V 12.094422 H 13.203582 V 9.7481656 Z m 0,3.6164134 v 2.346263 H 13.203582 V 13.364579 Z M 14.473445,12.094422 H 17.03249 V 9.7481656 h -2.559045 z m 2.559045,1.270157 h -2.559045 v 2.346263 h 2.559045 z m 1.270159,-3.8291948 v 7.2330098 c 0,0.116688 -0.09489,0.211766 -0.211767,0.211766 H 7.7185701 c -0.116688,0 -0.2117768,-0.09489 -0.2117768,-0.211766 V 8.6898058 c 0,-0.116688 0.094893,-0.2117769 0.2117768,-0.2117769 H 18.090882 c 0.116688,0 0.211767,0.094893 0.211767,0.2117769 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.xR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"M 6.7070312 0.16992188 C 5.4051693 0.16992188 4.3496094 1.2254824 4.3496094 2.5273438 L 4.3496094 7.8164062 L 5.921875 7.8164062 L 5.921875 2.5273438 C 5.921875 2.093443 6.2731425 1.7421875 6.7070312 1.7421875 L 15.349609 1.7421875 L 15.349609 5.6699219 C 15.349609 6.1038229 15.702818 6.4550781 16.136719 6.4550781 L 20.064453 6.4550781 L 20.064453 8.1074219 L 21.636719 8.1074219 L 21.636719 5.6699219 C 21.636719 5.4615699 21.553577 5.2605954 21.40625 5.1132812 L 16.691406 0.40039062 C 16.544093 0.25302252 16.345071 0.16992188 16.136719 0.16992188 L 6.7070312 0.16992188 z M 20.064453 18.873047 L 20.064453 19.8125 C 20.064453 20.246402 19.713186 20.597656 19.279297 20.597656 L 9.1601562 20.597656 L 7.5878906 22.169922 L 19.279297 22.169922 C 20.581159 22.169922 21.636719 21.114363 21.636719 19.8125 L 21.636719 18.873047 L 20.064453 18.873047 z "}),s.jsx("path",{className:"styled secondary_light",d:"m 22.499719,10.752378 -1.867399,5.486926 h -1.267987 l -1.859714,-5.486926 h 1.175769 l 1.02976,3.266027 q 0.03074,0.08453 0.08453,0.315076 0.06148,0.222858 0.122956,0.476455 0.06148,0.245913 0.08453,0.414978 0.02305,-0.169065 0.07685,-0.414978 0.06148,-0.253597 0.122956,-0.476455 0.06148,-0.230544 0.08453,-0.315076 l 1.037444,-3.266027 z m -5.302496,3.965341 q 0,0.730053 -0.530249,1.168085 -0.522565,0.430347 -1.490846,0.430347 -0.868379,0 -1.552323,-0.330445 v -1.083552 q 0.391923,0.169065 0.8069,0.315075 0.422663,0.138326 0.83764,0.138326 0.430348,0 0.607097,-0.16138 0.184435,-0.169065 0.184435,-0.422663 0,-0.207488 -0.146011,-0.353499 -0.138326,-0.146011 -0.376554,-0.268967 -0.238228,-0.130641 -0.545618,-0.276652 -0.19212,-0.09222 -0.414978,-0.215173 -0.222858,-0.130641 -0.430347,-0.315076 -0.199804,-0.192119 -0.330445,-0.461086 -0.130641,-0.268967 -0.130641,-0.645521 0,-0.737738 0.49951,-1.14503 0.49951,-0.414978 1.360204,-0.414978 0.430347,0 0.814586,0.0999 0.391923,0.0999 0.814585,0.284337 l -0.376553,0.906802 q -0.376554,-0.153695 -0.67626,-0.238227 -0.299706,-0.08453 -0.614782,-0.08453 -0.330445,0 -0.507195,0.153695 -0.176749,0.153696 -0.176749,0.399609 0,0.292021 0.261282,0.461086 0.261282,0.169065 0.776162,0.414977 0.422662,0.199804 0.714683,0.414978 0.299706,0.215173 0.461087,0.507195 0.16138,0.292021 0.16138,0.722368 z m -5.801995,-3.073908 q -0.668575,0 -1.022074,0.49951 -0.3535,0.49951 -0.3535,1.367889 0,0.876064 0.322761,1.360205 0.330445,0.476455 1.052813,0.476455 0.33813,0 0.668575,-0.07685 0.33813,-0.07685 0.730053,-0.215174 v 0.975966 q -0.361184,0.14601 -0.714683,0.215173 -0.3535,0.06916 -0.791532,0.06916 -0.845324,0 -1.3986278,-0.345814 -0.5456187,-0.3535 -0.8069009,-0.983651 -0.2612821,-0.637836 -0.2612821,-1.483161 0,-0.829955 0.299706,-1.467791 0.299706,-0.637836 0.868379,-0.99902 0.5763578,-0.361184 1.4063128,-0.361184 0.407293,0 0.814586,0.107587 0.414977,0.0999 0.791531,0.276652 l -0.376554,0.945226 q -0.30739,-0.14601 -0.622466,-0.253597 -0.307391,-0.107587 -0.607097,-0.107587 z M 23.139315,8.7167969 H 7.4504548 c -0.4289405,0 -0.7768148,0.347658 -0.7768148,0.776813 V 17.24011 c 0,0.206119 0.081937,0.403576 0.2275848,0.549445 0.145652,0.145651 0.3433235,0.227367 0.54923,0.227367 H 23.139315 c 0.205907,0 0.403578,-0.08172 0.54923,-0.227367 0.145653,-0.145869 0.227586,-0.343326 0.227586,-0.549445 V 9.4936099 c 0,-0.206121 -0.08194,-0.403577 -0.227586,-0.549446 -0.145652,-0.145652 -0.343323,-0.227367 -0.54923,-0.227367 z"}),s.jsx("path",{className:"styled info",d:"m 8.9270053,19.509881 h -3.3 V 8.5098782 H 3.4270047 V 19.509881 H 0.127005 l 4.3999997,4.4 z"})]}),exports.xx=uv,exports.yR=e=>s.jsxs(Qe,{...e,children:[s.jsx("path",{d:"m 6.3819062,2.5159671 c -0.4338889,0 -0.7857055,0.3518167 -0.7857055,0.7857177 V 20.587402 c 0,0.433902 0.3518166,0.785718 0.7857055,0.785718 H 18.953342 c 0.433889,0 0.785705,-0.351816 0.785705,-0.785718 V 7.2302615 h -3.928564 c -0.433901,0 -0.785718,-0.3518167 -0.785718,-0.7857178 V 2.5159671 Z m -2.357141,0.7857177 c 0,-1.3018621 1.0552788,-2.35714102 2.357141,-2.35714102 h 9.4285768 c 0.208352,0 0.408296,0.0827447 0.555609,0.23010782 l 4.714283,4.7142821 c 0.147327,0.1473145 0.230107,0.3472578 0.230107,0.55561 V 20.587402 c 0,1.301863 -1.055278,2.357142 -2.35714,2.357142 H 6.3819062 c -1.3018622,0 -2.357141,-1.055279 -2.357141,-2.357142 z"}),s.jsx("path",{className:"styled info",d:"M 13.729115,7.5208126 H 11.903278 V 11.108007 H 8.3163096 v 1.825837 h 3.5869684 v 3.586969 h 1.825837 v -3.586969 h 3.587195 v -1.825837 h -3.587195 z"})]}),exports.yo=Eo,exports.zv=av;