@sheetxl/studio-vanilla 0.3.22 → 0.3.23

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/{Cj0QfkfoOkk5h2fI.cjs → 1YHhQAyuEBCdnxLq.cjs} +8 -8
  2. package/browser/cjs/{BVSgRPnwULlPvK0r.cjs → 9UJAgr17pC52FvNS.cjs} +1 -1
  3. package/browser/cjs/{C9ZfdCWfTjjXvpcL.cjs → B6jW4__3xi32ba5Z.cjs} +1 -1
  4. package/browser/cjs/{CXZ8i2VBM0munm-5.cjs → B8jcrNkTeVeivhoT.cjs} +2 -2
  5. package/browser/cjs/{xN1Qr58oMus531lJ.cjs → BRgJMarh4Bp58iM3.cjs} +2 -2
  6. package/browser/cjs/{KQ0ZDDyov-OELoWW.cjs → BV-ZJjmj_rGxcdgT.cjs} +2 -2
  7. package/browser/cjs/{Al2MQV8lh0riUNcV.cjs → BV0L9gP18W00UBzV.cjs} +2 -2
  8. package/browser/cjs/{Ditw9NZuBwrMozqm.cjs → BZzMK8bX8rQGjjSF.cjs} +1 -1
  9. package/browser/cjs/{CkhwVXE_ZUol5dJX.cjs → BclC9iWDSimHqVjL.cjs} +1 -1
  10. package/browser/cjs/{CHCyNo_BuuFCMXQB.cjs → BfF2oDUTv3b16mah.cjs} +2 -2
  11. package/browser/cjs/{DMB1rgM6a7YNSt5g.cjs → BvyNLM_Rh4usHxN8.cjs} +3 -3
  12. package/browser/cjs/{C0B7RJBThZ716zNn.cjs → CYXbh4ysBOipBqkj.cjs} +2 -2
  13. package/browser/cjs/{CUVgrmwYs_rPCnQo.cjs → Ck8EsgvaXxoWGWIo.cjs} +1 -1
  14. package/browser/cjs/{BcRAST0JeKEYbVo0.cjs → CnnLV8wvpNYrxBu8.cjs} +2 -2
  15. package/browser/cjs/{ChRojgd8XOaHbumL.cjs → CrvRa0OxpqstjOap.cjs} +3 -3
  16. package/browser/cjs/{BqFWpXnn-Mp8QJv3.cjs → CzvztZ4uxzxXxoJz.cjs} +1 -1
  17. package/browser/cjs/{E7YmtCLyNmiYVNWk.cjs → D2EeD2h3tDPA2kQP.cjs} +2 -2
  18. package/browser/cjs/{DmY_aQOOM0o5JVCU.cjs → DH0zi_Wry2AW6ZUU.cjs} +2 -2
  19. package/browser/cjs/{CCt310aPAkQrCxMS.cjs → DN04BBJX0G6Imvov.cjs} +1 -1
  20. package/browser/cjs/{YCo0jVF3gVFbhr47.cjs → FG67s6xYNluXdXvC.cjs} +6 -6
  21. package/browser/cjs/{f8iOur27WgxcCHu-.cjs → GIDXrrerjDR3B4EL.cjs} +2 -2
  22. package/browser/cjs/{BMnHJCYgczQeK7yj.cjs → Y4LVpioiIg6LVL0s.cjs} +1 -1
  23. package/browser/cjs/{l9_2SrMnTqLmsbOI.cjs → cAwpZ8WIPtGrZO6Z.cjs} +2 -2
  24. package/browser/cjs/index.cjs +2 -2
  25. package/browser/cjs/{QxpNuD32ALFmzlQy.cjs → s3GJkzAMIO6cYaSZ.cjs} +2 -2
  26. package/browser/cjs/{_LVZ0BveWOPpuZsg.cjs → t1zHQhUwG57XvWD1.cjs} +1 -1
  27. package/browser/cjs/{H07xNhSJd2mcr1hH.cjs → x3raNMkDfaCh0EE2.cjs} +2 -2
  28. package/browser/esm/{C4M4jeGZlVNRXm7h.mjs → -7YvwD_KW5dr0aQz.mjs} +2 -2
  29. package/{cdn/assets/B7VWV3mOfVfjQ8X_.js → browser/esm/2HfJU0aTT_Bt_C1k.mjs} +1 -1
  30. package/{cdn/assets/BepUubffj0mlwFa8.js → browser/esm/2x8k8K3PHoeCES5p.mjs} +1 -1
  31. package/browser/esm/{BzetCqLkU-ujyIa6.mjs → 79HTk8jodiQmQUBc.mjs} +1 -1
  32. package/browser/esm/{zWKltfCDHYd4idZe.mjs → B4oAHUD6p4G0iY0R.mjs} +3 -3
  33. package/browser/esm/{lbG2RsgOXyjZDEHl.mjs → BFEM5mApBCpmpVAr.mjs} +2 -2
  34. package/browser/esm/{NYl5Mtir4jBrX2Bf.mjs → Ba9xIFo2LyMdmGdT.mjs} +9 -9
  35. package/browser/esm/{DxAzbHPPjbApuIHy.mjs → BamlWP9tk7WuccNw.mjs} +1 -1
  36. package/browser/esm/{CDTxR4UuGL9hnyVm.mjs → Bxg6YZDSS6nuda9A.mjs} +5 -5
  37. package/browser/esm/{Bvm2NyEPClGdqKUy.mjs → C89TgIJ8wXM2zzi2.mjs} +2 -2
  38. package/browser/esm/{wVEbagpoPypbPgaY.mjs → CB7Nv3qsvLLOgCdi.mjs} +2 -2
  39. package/browser/esm/{CtuS8IiktfVft3-2.mjs → CTmlmL1xPxBY8Tlb.mjs} +2 -2
  40. package/browser/esm/{CgzfkkQm1-RgpYTA.mjs → C_RhbWkUPDzsDUSf.mjs} +1 -1
  41. package/browser/esm/{CIBfk61itqbRwite.mjs → CcrZdLwOlOP1_7C3.mjs} +2 -2
  42. package/browser/esm/{BM2ehWzirJGaipOU.mjs → CdLBlYIKGmFRx-71.mjs} +2 -2
  43. package/browser/esm/{6YmaJQdzRwhSVre4.mjs → D6SD1ZzY1e4yCRcj.mjs} +2 -2
  44. package/browser/esm/{wMHJqt8d8wuiEVt2.mjs → DAmWOxulMtL8YgeT.mjs} +1 -1
  45. package/browser/esm/{D069ZkZcG2gmg_7b.mjs → DE_K645GFpnL4ivw.mjs} +2 -2
  46. package/browser/esm/{0xjpAK3cwaMDV9ws.mjs → DLVmdsRKR3ocWEKQ.mjs} +4 -4
  47. package/browser/esm/{DVxbvTeHj5K4gMz3.mjs → DOw5s5gYeGN5hpDW.mjs} +1 -1
  48. package/browser/esm/{6D2H1sekqHDpLAP2.mjs → DhLjmvRs0NY_DZ3N.mjs} +6 -6
  49. package/browser/esm/{CdwVMHLVwbc0N19K.mjs → M2yggAbKlXnck1iP.mjs} +1 -1
  50. package/browser/esm/{DRg3GYJp7n-7FntR.mjs → ecAisjqAr4L--qoT.mjs} +2 -2
  51. package/browser/esm/index.mjs +2 -2
  52. package/browser/esm/{nvKJNEHHbBbZi85h.mjs → wDyitzkk-GLjBpKt.mjs} +3 -3
  53. package/browser/esm/{Dv-8RclwSH75AIHF.mjs → ykhbZtJZIjlAsmGI.mjs} +3 -3
  54. package/{cdn/assets/COdBjdGqn91UmCCl.js → browser/esm/z-hGrI35JHwTNTP_.mjs} +1 -1
  55. package/{browser/esm/B7VWV3mOfVfjQ8X_.mjs → cdn/assets/2HfJU0aTT_Bt_C1k.js} +1 -1
  56. package/{browser/esm/BepUubffj0mlwFa8.mjs → cdn/assets/2x8k8K3PHoeCES5p.js} +1 -1
  57. package/cdn/assets/{v9aUpZNQZTrvBVet.js → 4VblEpfT-PyAhsmR.js} +3 -3
  58. package/cdn/assets/{BzetCqLkU-ujyIa6.js → 79HTk8jodiQmQUBc.js} +1 -1
  59. package/cdn/assets/{kMP2DXQetalQAH6M.js → A1oHO70eKwm5DSq-.js} +2 -2
  60. package/cdn/assets/{DFnL9mT0Hl0cfYz6.js → B7RWhXxDehW7byde.js} +2 -2
  61. package/cdn/assets/{D3wtm9FlDiRQjj3B.js → BIfGXJcA1j3ynEgV.js} +3 -3
  62. package/cdn/assets/{DxAzbHPPjbApuIHy.js → BamlWP9tk7WuccNw.js} +1 -1
  63. package/cdn/assets/{CWsqA3Ll7AHX8Cva.js → CMuuO5WoKrQkwzyW.js} +6 -6
  64. package/cdn/assets/{Dqun-FbiLuvYAcjR.js → CRMhlvk60mWCKMAw.js} +2 -2
  65. package/cdn/assets/{DmewHFj3UXIGNvdL.js → CZGBrCOe8WBKcNj2.js} +2 -2
  66. package/cdn/assets/{CgzfkkQm1-RgpYTA.js → C_RhbWkUPDzsDUSf.js} +1 -1
  67. package/cdn/assets/{CG959UTjainIaPYP.js → CbqFTEgiQd1ugRvP.js} +2 -2
  68. package/cdn/assets/{DAj1Q2yb4fGOaolT.js → CouiAwxaYXEQB9xs.js} +2 -2
  69. package/cdn/assets/{DnOus5r53uarKXp6.js → CpUY6_QTzTzIBkUj.js} +8 -8
  70. package/cdn/assets/{DDm2BJ8TWhuyN1dy.js → Cv23kIrKRqUAx7-8.js} +5 -5
  71. package/cdn/assets/{DO3PWmAnZ8dSCKfV.js → CwG8s2nD00TiULpr.js} +2 -2
  72. package/cdn/assets/{XGZ2FihiQ4pNoB_c.js → D-WM3iaA-HrrxXg1.js} +2 -2
  73. package/cdn/assets/{BKBJ22OMfNFNhzuu.js → D0SKJ4ubhxGJJ73M.js} +4 -4
  74. package/cdn/assets/{wMHJqt8d8wuiEVt2.js → DAmWOxulMtL8YgeT.js} +1 -1
  75. package/cdn/assets/{BJhR94jgdT6uDwwg.js → DFxHkp-72ByBi6CY.js} +3 -3
  76. package/cdn/assets/{DVxbvTeHj5K4gMz3.js → DOw5s5gYeGN5hpDW.js} +1 -1
  77. package/cdn/assets/{Bc4ewZ0Tq_pVS6At.js → DkbJje9GbsmAU3p5.js} +2 -2
  78. package/cdn/assets/{C9nsjsZPMlLGZmmb.js → DvpoYWUaPeQoTmTt.js} +2 -2
  79. package/cdn/assets/{CdwVMHLVwbc0N19K.js → M2yggAbKlXnck1iP.js} +1 -1
  80. package/{browser/esm/COdBjdGqn91UmCCl.mjs → cdn/assets/z-hGrI35JHwTNTP_.js} +1 -1
  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.3.22
2
+ * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.3.23
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 th(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(iR,{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(oR,{sx:{fontSize:"0.875rem"}})})]}),s.jsxs(Le,{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(Le,{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(Mn,{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(Le,{sx:{display:"flex",alignItems:"flex-start",gap:1,py:.25,pl:1,"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.05)"}},children:[!n&&s.jsx(Mn,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.5,minWidth:"20px",textAlign:"right",userSelect:"none"},children:p+1}),s.jsxs(Le,{sx:{flex:1,overflow:"hidden"},children:[s.jsx(Mn,{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(Mn,{variant:"caption",component:"div",sx:{fontSize:"0.625rem",opacity:.6,fontStyle:"italic"},children:d.location})]})]},`stack-${p}`)),c&&s.jsxs(Mn,{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(aR,{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(Le,{sx:{display:"flex",flexDirection:"column",maxWidth:"500px",width:"100%"},children:[s.jsx(Mn,{variant:"caption",component:"div",sx:{fontSize:"0.875rem",lineHeight:1.43,mb:1},children:d.message}),d.cause?s.jsxs(Mn,{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(Mn,{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(Le,{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(Le,{sx:{display:"flex",flex:"1 1 100%",height:"100%",alignItems:"center",justifyContent:"center",boxSizing:"border-box",position:"relative"},children:[s.jsx(Le,{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(Mi,{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(Le,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:d=>d.spacing(2),width:"100%",maxWidth:"600px"},children:s.jsxs(Le,{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(aT,{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(Le,{ref:t,sx:{display:"flex",flexDirection:"row",marginLeft:"4px",gap:"2px",...o},...r,children:i})}));var ph="top",qd="bottom",hh="right",hv="left",LD=[ph,qd,hh,hv],fv="viewport",P0="popper";function Cl(e){return e?(e.nodeName||"").toLowerCase():null}function Ia(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ms(e){return e instanceof Ia(e).Element||e instanceof Element}function Ts(e){return e instanceof Ia(e).HTMLElement||e instanceof HTMLElement}function fh(e){return typeof ShadowRoot<"u"&&(e instanceof Ia(e).ShadowRoot||e instanceof ShadowRoot)}var bc=Math.max,Q7=Math.min,e8=Math.round;function mh(){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(mh())}function X3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&Ts(e)&&(r=e.offsetWidth>0&&e8(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&e8(o.height)/e.offsetHeight||1);var a=(Ms(e)?Ia(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 Ga(e){return Ia(e).getComputedStyle(e)}function zD(e){return["table","td","th"].indexOf(Cl(e))>=0}function _s(e){return((Ms(e)?e.ownerDocument:e.document)||window.document).documentElement}function Tu(e){return Cl(e)==="html"?e:e.assignedSlot||e.parentNode||(fh(e)?e.host:null)||_s(e)}function t8(e){return Ts(e)&&Ga(e).position!=="fixed"?e.offsetParent:null}function gv(e){var t=Ia(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function n8(e){return X3(_s(e)).left+gv(e).scrollLeft}function yv(e){var t=Ga(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(Cl(e))>=0?e.ownerDocument.body:Ts(e)&&yv(e)?e:xv(Tu(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=Ia(o),a=r?[i].concat(i.visualViewport||[],yv(o)?o:[]):o,l=t.concat(a);return r?l:l.concat(bv(Tu(a)))}function gh(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?gh(function(o,r){var i=Ia(o),a=_s(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)):Ms(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):gh(function(o){var r,i=_s(o),a=gv(o),l=(r=o.ownerDocument)==null?void 0:r.body,c=bc(i.scrollWidth,i.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=bc(i.scrollHeight,i.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),p=-a.scrollLeft+n8(o),f=-a.scrollTop;return Ga(l||i).direction==="rtl"&&(p+=bc(i.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:p,y:f}}(_s(e)))}const FD={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,E=v.strategy,C=E===void 0?g.strategy:E,R=v.boundary,_=R===void 0?"clippingParents":R,L=v.rootBoundary,T=L===void 0?fv:L,j=v.elementContext,S=j===void 0?P0:j,k=v.altBoundary,P=k!==void 0&&k,O=v.padding,I=O===void 0?0:O,z=(x=typeof I!="number"?I:(y=I,LD.reduce(function(ne,oe){return ne[oe]=y,ne},{})),Object.assign({},{top:0,right:0,bottom:0,left:0},x)),A=S===P0?"reference":P0,D=g.rects.popper,F=g.elements[P?A:S],B=function(ne,oe,ye,de){var xe=oe==="clippingParents"?function(ce){var Se=bv(Tu(ce)),ie=["absolute","fixed"].indexOf(Ga(ce).position)>=0&&Ts(ce)?function(Y){for(var le=Ia(Y),ee=t8(Y);ee&&zD(ee)&&Ga(ee).position==="static";)ee=t8(ee);return ee&&(Cl(ee)==="html"||Cl(ee)==="body"&&Ga(ee).position==="static")?le:ee||function(Pe){var Te=/firefox/i.test(mh());if(/Trident/i.test(mh())&&Ts(Pe)&&Ga(Pe).position==="fixed")return null;var rt=Tu(Pe);for(fh(rt)&&(rt=rt.host);Ts(rt)&&["html","body"].indexOf(Cl(rt))<0;){var Ve=Ga(rt);if(Ve.transform!=="none"||Ve.perspective!=="none"||Ve.contain==="paint"||["transform","perspective"].indexOf(Ve.willChange)!==-1||Te&&Ve.willChange==="filter"||Te&&Ve.filter&&Ve.filter!=="none")return rt;rt=rt.parentNode}return null}(Y)||le}(ce):ce;return Ms(ie)?Se.filter(function(Y){return Ms(Y)&&function(le,ee){var Pe=ee.getRootNode&&ee.getRootNode();if(le.contains(ee))return!0;if(Pe&&fh(Pe)){var Te=ee;do{if(Te&&le.isSameNode(Te))return!0;Te=Te.parentNode||Te.host}while(Te)}return!1}(Y,ie)&&Cl(Y)!=="body"}):[]}(ne):[].concat(oe),we=[].concat(xe,[ye]),ve=we[0],re=we.reduce(function(ce,Se){var ie=o8(ne,Se,de);return ce.top=bc(ie.top,ce.top),ce.right=Q7(ie.right,ce.right),ce.bottom=Q7(ie.bottom,ce.bottom),ce.left=bc(ie.left,ce.left),ce},o8(ne,ve,de));return re.width=re.right-re.left,re.height=re.bottom-re.top,re.x=re.left,re.y=re.top,re}(Ms(F)?F:F.contextElement||_s(g.elements.popper),_,T,C),M=X3(g.elements.reference),N=function(ne){var oe,ye=ne.reference,de=ne.element,xe=ne.placement,we=xe?xe.split("-")[0]:null,ve=xe?xe.split("-")[1]:null,re=ye.x+ye.width/2-de.width/2,ce=ye.y+ye.height/2-de.height/2;switch(we){case ph:oe={x:re,y:ye.y-de.height};break;case qd:oe={x:re,y:ye.y+ye.height};break;case hh:oe={x:ye.x+ye.width,y:ce};break;case hv:oe={x:ye.x-de.width,y:ce};break;default:oe={x:ye.x,y:ye.y}}var Se=we?["top","bottom"].indexOf(we)>=0?"x":"y":null;if(Se!=null){var ie=Se==="y"?"height":"width";switch(ve){case"start":oe[Se]=oe[Se]-(ye[ie]/2-de[ie]/2);break;case"end":oe[Se]=oe[Se]+(ye[ie]/2-de[ie]/2)}}return oe}({reference:M,element:D,placement:w}),V=gh(Object.assign({},D,N)),U=S===P0?V:M,J={top:B.top-U.top+z.top,bottom:U.bottom-B.bottom+z.bottom,left:B.left-U.left+z.left,right:U.right-B.right+z.right},X=g.modifiersData.offset;if(S===P0&&X){var H=X[w];Object.keys(J).forEach(function(ne){var oe=[hh,qd].indexOf(ne)>=0?1:-1,ye=[ph,qd].indexOf(ne)>=0?"y":"x";J[ne]+=H[ye]*oe})}return J}(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}}},BD=[0,2],vv=u.memo(u.forwardRef((e,t)=>{const{sx:n,open:o,children:r,label:i,offsets:a=BD,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=B3(),v={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:F}){const{height:B}=F.modifiersData.maxSize;F.styles.popper.maxHeight=B-10+"px"}},b=u.useMemo(()=>{const F=[{name:"offset",options:{offset:a}},{name:"flip",enabled:!0,options:{rootBoundary:"document"}}];return m&&F.unshift(FD,v),F},[m,a]),[w,E]=u.useState(!1),C=u.useRef(null),R=Cn(()=>{d?.(P.current,C.current)},[p]),_=Cn(p,[p]),L=Cn(f,[f]),T=Cn(h,[h]),j=Cn(()=>{E(!1),g?.()},[g]),[S,k]=u.useState(!1),P=u.useRef(null),O=u.useRef(!0),I=u.useMemo(()=>({onFirstUpdate:()=>{O.current&&(k(!0),R?.(),O.current=!1)}}),[o,w]);u.useEffect(()=>{o&&S?_?.():!o&&w&&T?.(),o&&E(o)},[o,S]);const z=u.useMemo(()=>({getBoundingClientRect:()=>c?new DOMRect(c?.left||0,c?.top||0,0,0):l.getBoundingClientRect()}),[c,l]);u.useImperativeHandle(t,()=>({instance:()=>C.current,element:()=>P.current}),[]);const{getPortalContainer:A}=W3(),D=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(x3,{ref:P,popperRef:C,container:A,anchorEl:z,open:w,role:void 0,popperOptions:I,transition:!0,sx:D,placement:"bottom-start",modifiers:b,...y,children:({TransitionProps:F,placement:B,...M})=>{const{in:N,onEnter:V,onExited:U,...J}=F??{};return s.jsx(zc,{...J,in:o,onEnter:()=>{V?.(),L()},onExited:()=>{U?.(),j()},timeout:{enter:x.transitions.duration.shorter,exit:0},style:{transformOrigin:B==="bottom-start"?"left top":"center bottom"},children:typeof r=="function"?r({TransitionProps:F,placement:B,...M}):r||{}})}})}));vv.displayName="ExhibitPopper";const ji={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(Le,{className:rr("menu",a),sx:{display:"flex",flexDirection:"column",...l},...c,children:i})},r8=(e,t,n)=>s.jsx(tR,{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"}),ND=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,$D=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,yh=function(e,t=null){if(!e)return e;e=e.replace(ND,function(o,r,i,a){return r+r+i+i+a+a});let n=$D.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},fi=function(e,t=.2,n="light"){if(!e)return e;let o=n!=="dark";return t<0&&(o=!o,t*=-1),e=yh(e),o?Pl(e,Math.max(0,Math.min(1,1*t))):Ol(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:fi(e.palette.background.paper,.05,e?.palette.mode),thumb:fi(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=Cn(p,[p]),b=Cn(f,[f]),w=Cn(h,[h]),E=Cn(g,[g]),[C,R]=u.useState(),_=u.useRef(null),L=Cn((j,S)=>{R(j),d?.(_.current,S)},[d]),T=u.useMemo(()=>{const j={popupContainer:C,floatReference:a,children:m,...x},S=l(j);return s.jsx(Mi,{elevation:8,ref:_,sx:{display:"flex",overflow:"auto",outline:"none","&.MuiPaper-root":k=>Y3(k)},tabIndex:0,children:S})},[l,m,C,a]);return s.jsx(vv,{ref:t,anchorEl:o,anchorPosition:r,label:i,open:n,onMount:L,onOpening:w,onOpen:E,onClosing:v,onClose:b,...c,children:T})}));wv.displayName="ExhibitFloatPanel";const $a=new Map;let Op=null;const Va=new Map;let Sa=null;const Dp=(e=null,t,n,o)=>(Sa&&(Sa.fn.clear(),Sa=null),e===0?t:(e===null&&(e=120),Sa={fn:To.debounce(()=>t(),e),setReferences:n,isClose:o},Sa.fn)),Sv=(e,t)=>{if(t===null)return;e.add(t);const n=$a.get(t.key);if(!n)return;const o=Va.get(n);o&&Sv(e,o)},i8=e=>{const t=new Set;return Sv(t,e),t},pa=e=>{const{anchor:t,label:n=null,parentFloat:o=null,onOpen:r,onClose:i,popperProps:a,createPopupPanel:l=Bn}=e??{},c=Cn(r,[r]),d=Cn(i,[i]),[p,f]=u.useState(null),[h,g]=u.useState(!1),[m,y]=u.useState(!1),x=u.useMemo(()=>o===null?(Op===null&&(Op={key:{label:"root"},isRoot:!0,parent:null,open:()=>null,close:H=>null,closeChild:H=>null,onChildVisible:()=>{},onChildHidden:()=>{},closeAll:()=>z(0),floatElement:()=>null,anchorElement:()=>null}),Op):o,[]),v=u.useMemo(()=>({label:n}),[]),b=u.useRef(null),w=u.useRef(t);u.useEffect(()=>{w.current=t},[t]);const E=H=>{const ne=$a.get(H);let oe=null;return ne&&(oe=Va.get(ne)?.close(0)),oe},C=()=>E(F.key),[R,_]=u.useState(),L=()=>{if(!p)return void k();const H=new Promise((ne,oe)=>{_(ye=>({resolve:ne,reject:oe}))});return C(),$a.delete(x.key),f(!1),H};u.useEffect(()=>{R&&(R.resolve(),_(null))},[h,m,R]);const T=u.useCallback(()=>{let H=x;for(;H.parent;)H=H.parent;return E(H.key)},[]),j=()=>{if(p)return void k();x&&Va.get(x.key)?.open(0);const H=$a.get(x.key);H&&H!==v&&Va.get(H)?.close(0),requestAnimationFrame(()=>{$a.set(x.key,F.key),f(!0)})},[S,k]=u.useReducer(H=>H+1,0),P=u.useCallback(H=>l===null?null:l({closeFloat:z,closeFloatAll:D,...H}),[l]),O=l===null,I=Cn((H=120)=>Dp(H,j,new Set([F]),!1)(),[j]),z=Cn((H=60)=>Dp(H,L,i8(F),!0)(),[L]),A=Cn((H=360)=>Dp(H,C,i8((ne=>{const oe=$a.get(ne.key);return oe&&Va.get(oe)||null})(F)),!0)(),[C]),D=Cn(T,[T]),F=u.useMemo(()=>({key:v,isRoot:!1,label:n,parent:x,onChildVisible:()=>{y(!0)},onChildHidden:()=>{y(!1)},open:I,close:z,closeChild:A,closeAll:D,floatElement:()=>b.current,anchorElement:()=>w.current}),[]);u.useEffect(()=>{Va.set(v,F)},[F]),u.useEffect(()=>()=>{Va.delete(v),z(0)},[]),u.useEffect(()=>{p&&!O&&(g(!0),x.onChildVisible())},[p,O]);const B=u.useCallback(H=>{H.which===xr.Escape&&(H.preventDefault(),H.stopPropagation(),z(0))},[]),M=u.useRef(null),N=u.useCallback(()=>{const H=M.current,ne=b.current;H&&ne&&(requestAnimationFrame(()=>{(ne.contains(document.activeElement)||document.activeElement===document.body)&&H.focus()}),M.current=null),d?.()},[]),V=u.useCallback(H=>{b.current=H,H.addEventListener("focus",oe=>{M.current=oe.relatedTarget},{once:!0,passive:!0});const ne=document.activeElement;requestAnimationFrame(()=>{ne===document.activeElement&&H.focus()})},[]),[U,J]=u.useState();u.useEffect(()=>{O&&(p?c?.():p===!1&&d?.()),J(h?s.jsx(wv,{floatReference:F,open:p,label:n,anchorEl:t,onOpening:()=>{c?.(),x.onChildVisible()},onClosing:N,onClose:()=>{g(!1),x.onChildHidden()},onMount:V,popperProps:{onKeyDown:B,onMouseEnter:H=>{p&&Sa?.isClose&&Sa.setReferences.has(F)&&(Sa.fn.clear(),Sa=null,F.closeChild())},...a},createPopupPanel:P}):null)},[h,p,n,O,a,P,S]);const X=Cn(H=>{if($a.size===0)return;let ne=!1;$a.forEach(oe=>{const ye=Va.get(oe);!ne&&ye&&(ye.floatElement()?.contains?.(H.target)&&(ne=!0),ye.anchorElement()?.contains?.(H.target)&&(ne=!0))}),ne||T()},[T]);return u.useEffect(()=>{if(!p||!x.isRoot)return;const H=ne=>{X(ne)};return document.addEventListener("mousedown",H),document.addEventListener("touchstart",H),document.addEventListener("focus",H),()=>{document.removeEventListener("mousedown",H),document.removeEventListener("touchstart",H),document.removeEventListener("focus",H)}},[p,x]),{component:U,reference:F}},VD=u.memo(u.forwardRef((e,t)=>{const{nestedChildren:n,variant:o,disabled:r=!1,createPopupPanel:i,...a}=e,l={disabled:r,createPopupPanel:Cn(c=>{if(!n||n.length===0)return null;const{popupContainer:d,floatReference:p,...f}=c,h=[];for(let g=0;g<n.length;g++){const m=n[g];m&&h.push(s.jsx(VD,{parentFloat:p,...f,...m},g))}return s.jsxs(Le,{ref:t,sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},children:["Children here",h,s.jsx(Gr,{parentFloat:p,children:"Close other children"})]})},[n]),...a};return s.jsx(o===ji.Toolbar?Ui:C1,{...l})})),HD={placement:"right-start"},Cv=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,createPopupPanel:i,popperProps:a=HD,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=Cn(i,[i]),[h,g]=u.useState(null),{reference:m,component:y}=pa({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}=W3();return s.jsx(_j,{ref:t,slotProps:{...n,popper:{container:r,...n?.popper||{}}},...o})});di.displayName="SimpleTooltip";const O0=u.memo(e=>{const{modifier:t,sx:n,...o}=e;return s.jsx(Le,{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(Le,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center","& *":{fontWeight:"500"}},children:t})})}),WD=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(Le,{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(O0,{modifier:t?"^":s.jsx("div",{style:{paddingRight:"1px"},children:WD})},"ctrl")),r.push("+")),o?.alt&&(r.push(s.jsx(O0,{modifier:t?"⌥":"Alt"},"alt")),r.push("+")),o?.shift&&(r.push(s.jsx(O0,{modifier:t?"⇧":s.jsx("div",{style:{paddingRight:"1px"},children:"Shift"})},"shift")),r.push("+")),o?.meta&&(r.push(s.jsx(O0,{modifier:t?s.jsx("div",{style:{paddingTop:"1px"},children:"⌘"}):"Meta"},"meta")),r.push("+")),r.push(s.jsx(O0,{modifier:eO.toPrettyKeyCode(e.key)},"character")),s.jsx(Le,{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(Le,{sx:{maxWidth:`${l}px`},ref:t,children:[s.jsxs(Le,{sx:{display:"flex",flexDirection:"row",marginBottom:a?"4px":"0px"},children:[s.jsx(Mn,{variant:"subtitle1",component:"div",flex:"1 1 100%",children:o}),i?s.jsx(pv,{chips:i}):null,m?s.jsx(Le,{sx:{marginLeft:"8px"}},"leadingSpace"):s.jsx(s.Fragment,{}),m]}),a?s.jsx(Mn,{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})})})),M2=s.jsx(Hs,{}),UD=ze(s.jsx(j3,{})),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 E=b;r||(E=To.mergeContentful(b,w));const C=u.useMemo(()=>{let _=typeof l=="function"?l():l;return _===null?_:_||(a===void 0?M2:UD)},[l,a]);let R=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:E,edge:"end",...y,children:[C,d]});if(c)if(c.simple&&c.label&&!c.disabled){const{label:_,description:L,maxWidth:T,shortcut:j,useModifierSymbols:S,componentDisabled:k,simple:P,chips:O,ref:I,...z}=c;R=s.jsx(di,{disableInteractive:!0,title:_??"",...z,children:s.jsx(Le,{sx:{display:"flex"},children:R})})}else R=s.jsx(br,{children:R,...c});return R})),qD=e=>e.icon,Gr=u.memo(u.forwardRef((e,t)=>{const{icon:n=M2,renderIcon:o=qD,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,E]=u.useState(!1),[C,R]=u.useState(!1),_=u.useMemo(()=>{const T=o?.({icon:n,disabled:h,selected:l});return T?s.jsx(O_,{className:rr({"Mui-focusVisible":w,"Mui-hovered":C}),sx:{"& .MuiSvgIcon-root":{color:j=>v?void 0:j.palette.text.icon??j.palette.action.active},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{"& .MuiSvgIcon-root":{color:j=>j.palette.text.primary}}},children:T}):null},[o,h,n,w,C,v,l]);let L=s.jsxs(b1,{ref:t,disabled:h,onMouseOver:T=>{d?.(T),T.isDefaultPrevented()||R(!0)},onMouseOut:T=>{p?.(T),T.isDefaultPrevented()||R(!1)},onMouseEnter:T=>{f?.(T),T.isDefaultPrevented()||r?.closeChild()},TouchRippleProps:{center:!1},className:rr({"Mui-focusVisible":w,"Mui-hovered":C},i),onFocus:T=>{a?.(T),E(!0)},onBlur:T=>{c?.(T),E(!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})),qs=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(Mn,{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})})})),Ui=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:E,primary:C,children:R,sx:_,className:L,...T}=e,j=B3(),S=u.useMemo(()=>{const re=(ce,Se,ie,Y=ie)=>{const le=typeof o=="boolean"?null:o[ce];return typeof le=="function"?le(Se):le||(o?ie:Y)};return{outline:{color:ce=>re("color",ce,ce.palette.divider,"transparent"),hoverColor:ce=>re("hoverColor",ce,ce.palette.text?.primary,ce.palette.divider),focusColor:ce=>re("focusColor",ce,ce.palette?.primary?.main)},active:j.palette.mode==="dark"?j.palette.text.secondary:j.palette.text.primary,text:j.palette.text.icon??j.palette.action.active}},[o,j]),[k,P]=u.useState(!1),[O,I]=u.useState(!1),[z,A]=u.useState(!1),D=u.useRef(null),F=u.useRef(null),B=pa({anchor:D.current,label:r,createPopupPanel:c,parentFloat:l,popperProps:d?.popperProps,onClose:()=>{P(!1),f?.()},onOpen:()=>{P(!0),p?.()}}),M=Cn(re=>{a?.(re),B.reference.close(0)},[a,B]),N=Cn(()=>{k?B.reference.close(0):B.reference.open(0)},[k,B,l,r]),V=u.useMemo(()=>{const re={"&.bordered":{borderWidth:"1px",borderRadius:"0px",borderTopStyle:"solid",borderBottomStyle:"solid",borderColor:ee=>S.outline.color(ee),"&.Mui-focusVisible":{border:ee=>`1px solid ${S.outline.focusColor(ee)} !important`},"&:hover:not(.Mui-disabled, [disabled])":{borderColor:()=>w?"transparent":void 0,backgroundColor:()=>w?"transparent":void 0},"&.Mui-hovered:not(.Mui-disabled, [disabled])":{borderColor:ee=>S.outline.hoverColor(ee)},"&.Mui-selected:not(.Mui-disabled, [disabled])":{borderColor:ee=>S.outline.hoverColor(ee)},"&.left":{borderTopLeftRadius:ee=>`${ee.shape.borderRadius}px`,borderBottomLeftRadius:ee=>`${ee.shape.borderRadius}px`,borderLeftStyle:"solid"},"&.hard-right":{borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:ee=>S.outline.color(ee)},"&.right":{borderTopRightRadius:ee=>`${ee.shape.borderRadius}px`,borderBottomRightRadius:ee=>`${ee.shape.borderRadius}px`,borderRightStyle:"solid"},"&.divider":{borderLeftWidth:"0px !important"}},"& .MuiTouchRipple-child":{borderRadius:ee=>`${ee.shape.borderRadius}px !important`}},ce={"&.Mui-selected":{backgroundColor:ee=>pt(ee.palette.primary.main,ee.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:ee=>pt(ee.palette.primary.main,ee.palette.action.selectedOpacity+ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ee=>pt(ee.palette.primary.main,ee.palette.action.selectedOpacity)}}}},Se={maxHeight:"100%","&.Mui-selected":{backgroundColor:ee=>pt(ee.palette.text.icon??ee.palette.action.active,ee.palette.action.selectedOpacity),"&:hover:not(.Mui-disabled)":{backgroundColor:ee=>pt(ee.palette.text.icon??ee.palette.action.active,ee.palette.action.selectedOpacity+ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ee=>pt(ee.palette.text.icon??ee.palette.action.active,ee.palette.action.selectedOpacity)}}},"&:hover:not(.Mui-disabled, [disabled])":{color:ee=>ee.palette.text.primary},backgroundColor:()=>w?"transparent":void 0,color:ee=>ee.palette.text.icon,"&.Mui-disabled path.styled":{filter:"grayscale(65%)",opacity:".8"},padding:()=>n?"2px 3px":"7px",marginRight:"0"},ie=To.mergeContentful(Se,re),Y=To.mergeContentful(ie,ce),le=To.mergeContentful(Se,re);return{quickButtonStyling:ie,openQuickButtonStyling:Y,compoundStyling:le,openCompoundStyling:To.mergeContentful(le,ce)}},[S,w]),U=Cn(re=>{const{children:ce,ref:Se,...ie}=re;return s.jsx(di,{ref:Se,...ie,disableInteractive:!0,children:ce})},[]),J=a||g,X=J&&(h?.tooltip||h?.createTooltip),H=re=>{const{tooltip:ce,createTooltip:Se,sx:ie,...Y}=re;let le=s.jsx(Tr,{sx:{...ie},component:"div",...Y});return X&&(le=(Se??U)({title:k?"":ce??m,children:s.jsx("div",{children:le})},k)),le},ne={onKeyDown:re=>{re.keyCode===xr.Space?N():re.keyCode===xr.F4||re.keyCode===xr.Down?B.reference.open(0):re.keyCode===xr.Up&&B.reference.close(0)}};let oe=s.jsx(s.Fragment,{});const ye=u.useMemo(()=>typeof x=="function"?x():x,[x]);if(J){let re=k?V.openQuickButtonStyling:V.quickButtonStyling;const ce=(g||H)({tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseEnter:()=>{B.reference.parent.closeChild()},onMouseDown:ie=>{ie.button===0&&(ie.preventDefault(),M(ie))},touchRippleRef:E,children:ye,...h,className:rr({"Mui-focusVisible":O||k,"Mui-selected":i,"Mui-hovered":z||k,"Mui-disabled":v,bordered:!0,left:!0,"hard-right":!0},h?.className),sx:{...V.quickButtonStyling,height:"100%",...h?.sx}});let Se=r8(!0,n,k);X&&(Se=(y??U)({title:k?"":m,children:Se},k)),oe=s.jsxs(s.Fragment,{children:[ce,s.jsx(Tr,{ref:F,component:"div",className:rr({"Mui-selected":k,"Mui-hovered":z||k,"Mui-disabled":v,"Mui-focusVisible":O||k,bordered:!0,right:!0,divider:!0}),sx:{paddingLeft:(n?0:2)+"px",paddingRight:(n?0:2)+"px",width:()=>"1em",...V.quickButtonStyling,...re},TouchRippleProps:{center:!1},tabIndex:-1,disabled:v,size:"small",edge:"end",onMouseDown:ie=>{ie.button===0&&(ie.preventDefault(),N())},children:Se})]})}else{let re=k?V.openCompoundStyling:V.compoundStyling;oe=s.jsx(ii,{ref:F,tabIndex:-1,disabled:v,size:"small",icon:ye,className:rr({"Mui-selected":k||i,"Mui-hovered":z,"Mui-disabled":v,"Mui-focusVisible":O||k,bordered:!0,left:!0,right:!0}),sx:{...V.quickButtonStyling,...re},onMouseDown:ce=>{ce.button===0&&(ce.preventDefault(),N())},children:r8(!1,n,k)})}const{className:de,sx:xe,...we}=b;let ve=s.jsx(Le,{onFocus:()=>I(!0),onBlur:()=>I(!1),onMouseOver:()=>A(!0),onMouseOut:()=>A(!1),...ne,"aria-label":"split button",ref:D,tabIndex:v?void 0:0,className:rr(de,"split-button-root",{"Mui-focusVisible":O||k,"Mui-selected":k||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:re=>`${re.shape.borderRadius}px`,"&.Mui-focusVisible":{outline:re=>`solid ${re.palette.primary.main} 1px`,zIndex:2},...xe},...we,children:oe});return X||(ve=(y??U)({title:k?"":m,children:ve},k)),s.jsxs(Le,{className:rr(L,"popupIconButton"),ref:t,...T,sx:{zIndex:O||k?2:void 0,display:"flex",alignItems:"center",..._},children:[ve,B.component]})}));Ui.displayName="ExhibitPopupIconButton";const KD={},C1=u.memo(u.forwardRef((e,t)=>{const{selected:n=!1,label:o,onQuickClick:r,parentFloat:i,createPopupPanel:a,popupProps:l=KD,onPopupOpen:c,onPopupClose:d,quickButtonProps:p,createQuickButton:f,tooltip:h="",createTooltip:g,icon:m,disabled:y,touchRippleRef:x,primary:v,children:b,sx:w,...E}=e,[C,R]=u.useState(!1),[_,L]=u.useState(!1),[T,j]=u.useState(!1),[S,k]=u.useState(!1),P=u.useRef(null),O=u.useRef(null),I=u.useMemo(()=>{if(!l)return;const{popperProps:X}=l;return{placement:"right-start",offsets:[-4,-2],...X}},[l]),z=pa({anchor:P.current,label:o,createPopupPanel:a,parentFloat:i,popperProps:I,onClose:()=>{R(!1),d?.()},onOpen:()=>{R(!0),c?.()}}),A=Cn(X=>{X.button===0&&(r?.(X),z.reference.close(0))},[r]),D=s.jsx(Ax,{sx:{transform:()=>{}}}),F={"&.Mui-selected":{color:X=>X.palette.text.primary,"& svg * ":{color:X=>X.palette.text.primary}}},B=u.useCallback(X=>{const{children:H,ref:ne,...oe}=X;return s.jsx(di,{ref:ne,...oe,disableInteractive:!0,children:H})},[]),M=r||f,N=X=>{const{tooltip:H,createTooltip:ne,...oe}=X;return s.jsx(Gr,{icon:m,className:rr({"Mui-hovered":T}),sx:{flex:"1 1 100%",...F},...oe,children:o})},V={onFocus:()=>{L(!0)},onBlur:()=>L(!1),onMouseOver:()=>{j(!0)},onMouseLeave:()=>{j(!1)},onMouseEnter:()=>{z.reference.open()},onMouseDown:X=>{X.button===0&&X.preventDefault()}};let U=s.jsx(s.Fragment,{});if(M){const X=(f||N)({tabIndex:-1,disabled:y,onMouseEnter:()=>{z.reference.parent.closeChild()},onMouseDown:H=>{H.button===0&&(H.preventDefault(),A(H))},className:rr("quick-left",{},p?.className),...p});U=s.jsxs(s.Fragment,{children:[X,s.jsx(va,{sx:{ml:"0px",mr:"0px"},orientation:"vertical",variant:"middle",flexItem:!0}),s.jsx(b1,{ref:O,className:rr({"Mui-selected":C,"Mui-hovered":T}),sx:{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px",paddingLeft:"0px",paddingRight:"0px",marginLeft:"0px",color:H=>v?void 0:H.palette.text.secondary,"&.Mui-hovered:not(.Mui-disabled, [disabled])":{color:H=>H.palette.text.primary},...F},tabIndex:-1,disabled:y,...V,children:s.jsx(Le,{className:"expand-icon",sx:{flex:"none",display:"flex",border:"1px solid transparent",paddingTop:"1px",paddingBottom:"1px",color:H=>v?void 0:H.palette.text.icon??H.palette.action.active},onMouseOver:H=>{H.preventDefault(),k(!0)},onMouseLeave:()=>{k(!1)},onClick:H=>{H.preventDefault(),C?z.reference.close():z.reference.open()},children:D})})]})}else U=s.jsxs(Gr,{ref:O,tabIndex:-1,disabled:y,icon:m,className:rr({"Mui-selected":C||n,"Mui-hovered":T}),sx:{flex:"1 1 100%",paddingRight:"0px",...F},onClick:X=>{X.preventDefault(),C?z.reference.close():z.reference.open()},...V,children:[s.jsx("div",{style:{flex:"1 1 100%"},children:o}),s.jsx(Le,{className:"expand-icon2",sx:{flex:"none",display:"flex",color:X=>v?void 0:X.palette.text.icon??X.palette.action.active},children:D})]});let J=s.jsx(Le,{"aria-label":"split button",ref:P,tabIndex:y?void 0:0,className:rr({"Mui-disabled":y,"Mui-selected":C,"Mui-focusVisible":_||C,"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},...E,children:U});return M&&!S&&(p?.tooltip||p?.createTooltip)&&(J=(p?.createTooltip??B)({title:C?"":J??p?.tooltip,children:J},C)),s.jsxs(Le,{ref:t,sx:{zIndex:_||C?2:void 0,display:"flex"," .tooltip-wrapper":{display:"flex",flex:"1 1 100%"}},children:[J,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})})})),k1=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(Hs,{})),c||(c=s.jsx(j3,{})),c=ze(c),s.jsx(Le,{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 Ci,os,GD={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);(os=Ci||(Ci={})).SHOW="SHOW",os.HIDE="HIDE",os.UPDATE="UPDATE",os.DESTROY="DESTROY",os.DESTROY_BY_ROOT_ID="DESTROY_BY_ROOT_ID",os.UNKNOWN="UNKNOWN";var ZD={};function XD(e,t){switch(t.type){case Ci.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 Ci.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 Ci.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 Ci.DESTROY:var m=t.payload.id,y=Er({},e);return delete y[m],y;case Ci.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 Ap="[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("")},YD=["open"],JD=["showModal","destroyModalsByRootId"],a8={disableAutoDestroy:!1};function ud(e){e===void 0&&(e=a8);var t=Er({},a8,e).disableAutoDestroy,n=u.useContext(Mv)||GD,o=n.showModal,r=n.destroyModalsByRootId,i=Ev(n,JD),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])"],_u=_v.join(","),jv=typeof Element>"u",jl=jv?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Kd=!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},ju=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(ju(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(_u));return t&&jl.call(e,_u)&&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(!ju(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{jl.call(a,_u)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var d=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),p=!ju(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))},Za=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},QD=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},Ru=function(e,t){return!(t.disabled||ju(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=jl.call(r,"details>summary:first-of-type")?r.parentElement:r;if(jl.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=Kd(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&&Kd(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 E,C,R;w=!((C=b=(E=v=Kd(b))===null||E===void 0?void 0:E.host)===null||C===void 0||(R=C.ownerDocument)===null||R===void 0||!R.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!!jl.call(i,"fieldset[disabled] *")||!l.contains(r)}return!0}i=i.parentElement}return!1}(t));var n,o},xh=function(e,t){return!(Ov(o=n=t)&&o.type==="radio"&&!function(r){if(!r.name)return!0;var i,a=r.form||Kd(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)||Za(t)<0||!Ru(e,t));var n,o},eA=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},tA=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=Za(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(QD).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:xh.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:eA}):Rv(e,t.includeContainer,xh.bind(null,t)),tA(n)},Av=function(e,t){return(t=t||{}).getShadowRoot?Iv([e],t.includeContainer,{filter:Ru.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Rv(e,t.includeContainer,Ru.bind(null,t))},ml=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return jl.call(e,_u)!==!1&&xh(t,e)},nA=_v.concat("iframe").join(","),Gd=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return jl.call(e,nA)!==!1&&Ru(t,e)};const oA=Object.freeze(Object.defineProperty({__proto__:null,focusable:Av,getTabIndex:Za,isFocusable:Gd,isTabbable:ml,tabbable:Dv},Symbol.toStringTag,{value:"Module"}));function Lp(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 rA(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){rA(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 vc=function(e){return e?.key==="Tab"||e?.keyCode===9},iA=function(e){return vc(e)&&!e.shiftKey},aA=function(e){return vc(e)&&e.shiftKey},d8=function(e){return setTimeout(e,0)},D0=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},pd=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},lA=[];const sA=Object.freeze(Object.defineProperty({__proto__:null,createFocusTrap:function(e,t){var n,o=t?.document||document,r=t?.trapStack||lA,i=c8({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:iA,isKeyBackward:aA},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l=function(T,j,S){return T&&T[j]!==void 0?T[j]:i[S||j]},c=function(T,j){var S=typeof j?.composedPath=="function"?j.composedPath():void 0;return a.containerGroups.findIndex(function(k){var P=k.container,O=k.tabbableNodes;return P.contains(T)||S?.includes(P)||O.find(function(I){return I===T})})},d=function(T){var j,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=S.hasFallback,P=k!==void 0&&k,O=S.params,I=O===void 0?[]:O,z=i[T];if(typeof z=="function"&&(z=z.apply(void 0,function(D){if(Array.isArray(D))return Lp(D)}(j=I)||function(D){if(typeof Symbol<"u"&&D[Symbol.iterator]!=null||D["@@iterator"]!=null)return Array.from(D)}(j)||function(D,F){if(D){if(typeof D=="string")return Lp(D,F);var B={}.toString.call(D).slice(8,-1);return B==="Object"&&D.constructor&&(B=D.constructor.name),B==="Map"||B==="Set"?Array.from(D):B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B)?Lp(D,F):void 0}}(j)||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(D){throw new Error("`".concat(T,'` appears to be an invalid selector; error="').concat(D.message,'"'))}if(!A&&!P)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&&!Gd(T,i.tabbableOptions))if(c(o.activeElement)>=0)T=o.activeElement;else{var j=a.tabbableGroups[0];T=j&&j.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 j=Dv(T,i.tabbableOptions),S=Av(T,i.tabbableOptions),k=j.length>0?j[0]:void 0,P=j.length>0?j[j.length-1]:void 0,O=S.find(function(A){return ml(A)}),I=S.slice().reverse().find(function(A){return ml(A)}),z=!!j.find(function(A){return Za(A)>0});return{container:T,tabbableNodes:j,focusableNodes:S,posTabIndexesFound:z,firstTabbableNode:k,lastTabbableNode:P,firstDomTabbableNode:O,lastDomTabbableNode:I,nextTabbableNode:function(A){var D=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],F=j.indexOf(A);return F<0?D?S.slice(S.indexOf(A)+1).find(function(B){return ml(B)}):S.slice(0,S.indexOf(A)).reverse().find(function(B){return ml(B)}):j[F+(D?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 j=T.activeElement;if(j)return j.shadowRoot&&j.shadowRoot.activeElement!==null?h(j.shadowRoot):j},g=function(T){var j;T!==!1&&T!==h(document)&&(T&&T.focus?(T.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=T,(j=T).tagName&&j.tagName.toLowerCase()==="input"&&typeof j.select=="function"&&T.select()):g(p()))},m=function(T){var j=d("setReturnFocus",{params:[T]});return j||j!==!1&&T},y=function(T){var j=T.target,S=T.event,k=T.isBackward,P=k!==void 0&&k;j=j||pd(S),f();var O=null;if(a.tabbableGroups.length>0){var I=c(j,S),z=I>=0?a.containerGroups[I]:void 0;if(I<0)O=P?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(P){var A=a.tabbableGroups.findIndex(function(V){var U=V.firstTabbableNode;return j===U});if(A<0&&(z.container===j||Gd(j,i.tabbableOptions)&&!ml(j,i.tabbableOptions)&&!z.nextTabbableNode(j,!1))&&(A=I),A>=0){var D=A===0?a.tabbableGroups.length-1:A-1,F=a.tabbableGroups[D];O=Za(j)>=0?F.lastTabbableNode:F.lastDomTabbableNode}else vc(S)||(O=z.nextTabbableNode(j,!1))}else{var B=a.tabbableGroups.findIndex(function(V){var U=V.lastTabbableNode;return j===U});if(B<0&&(z.container===j||Gd(j,i.tabbableOptions)&&!ml(j,i.tabbableOptions)&&!z.nextTabbableNode(j))&&(B=I),B>=0){var M=B===a.tabbableGroups.length-1?0:B+1,N=a.tabbableGroups[M];O=Za(j)>=0?N.firstTabbableNode:N.firstDomTabbableNode}else vc(S)||(O=z.nextTabbableNode(j))}}else O=d("fallbackFocus");return O},x=function(T){var j=pd(T);c(j,T)>=0||(D0(i.clickOutsideDeactivates,T)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):D0(i.allowOutsideClick,T)||T.preventDefault())},v=function(T){var j=pd(T),S=c(j,T)>=0;if(S||j instanceof Document)S&&(a.mostRecentlyFocusedNode=j);else{var k;T.stopImmediatePropagation();var P=!0;if(a.mostRecentlyFocusedNode)if(Za(a.mostRecentlyFocusedNode)>0){var O=c(a.mostRecentlyFocusedNode),I=a.containerGroups[O].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&&(k=I[z+1],P=!1):z-1>=0&&(k=I[z-1],P=!1))}}else a.containerGroups.some(function(A){return A.tabbableNodes.some(function(D){return Za(D)>0})})||(P=!1);else P=!1;P&&(k=y({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),g(k||a.mostRecentlyFocusedNode||p())}a.recentNavEvent=void 0},b=function(T){(i.isKeyForward(T)||i.isKeyBackward(T))&&function(j){var S=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=j;var k=y({event:j,isBackward:S});k&&(vc(j)&&j.preventDefault(),g(k))}(T,i.isKeyBackward(T))},w=function(T){var j;((j=T)==null?void 0:j.key)!=="Escape"&&j?.key!=="Esc"&&j?.keyCode!==27||D0(i.escapeDeactivates,T)===!1||(T.preventDefault(),n.deactivate())},E=function(T){var j=pd(T);c(j,T)>=0||D0(i.clickOutsideDeactivates,T)||D0(i.allowOutsideClick,T)||(T.preventDefault(),T.stopImmediatePropagation())},C=function(){if(a.active)return function(T,j){if(T.length>0){var S=T[T.length-1];S!==j&&S._setPausedState(!0)}var k=T.indexOf(j);k===-1||T.splice(k,1),T.push(j)}(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",E,{capture:!0,passive:!1}),o.addEventListener("keydown",b,{capture:!0,passive:!1}),o.addEventListener("keydown",w),n},R=function(){if(a.active)return o.removeEventListener("focusin",v,!0),o.removeEventListener("mousedown",x,!0),o.removeEventListener("touchstart",x,!0),o.removeEventListener("click",E,!0),o.removeEventListener("keydown",b,!0),o.removeEventListener("keydown",w),n},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(function(T){T.some(function(j){return Array.from(j.removedNodes).some(function(S){return S===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 j=l(T,"onActivate"),S=l(T,"onPostActivate"),k=l(T,"checkCanFocusTrap");k||f(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=h(o),j?.();var P=function(){k&&f(),C(),L(),S?.()};return k?(k(a.containers.concat()).then(P,P),this):(P(),this)},deactivate:function(T){if(!a.active)return this;var j,S,k,P=c8({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},T);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,R(),a.active=!1,a.paused=!1,L(),S=n,(k=(j=r).indexOf(S))!==-1&&j.splice(k,1),j.length>0&&!j[j.length-1]._isManuallyPaused()&&j[j.length-1]._setPausedState(!1);var O=l(P,"onDeactivate"),I=l(P,"onPostDeactivate"),z=l(P,"checkCanReturnFocus"),A=l(P,"returnFocus","returnFocusOnDeactivate");O?.();var D=function(){d8(function(){A&&g(m(a.nodeFocusedBeforeActivation)),I?.()})};return A&&z?(z(m(a.nodeFocusedBeforeActivation)).then(D,D),this):(D(),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 j=[].concat(T).filter(Boolean);return a.containers=j.map(function(S){return typeof S=="string"?o.querySelector(S):S}),a.active&&f(),L(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(T,j){if(a.paused===T)return this;if(a.paused=T,T){var S=l(j,"onPause"),k=l(j,"onPostPause");S?.(),R(),L(),k?.()}else{var P=l(j,"onUnpause"),O=l(j,"onPostUnpause");P?.(),f(),C(),L(),O?.()}return this}}}),n.updateContainerElements(e),n}},Symbol.toStringTag,{value:"Module"})),cA=Rb(sA),dA=Rb(oA);var u8,p8,uA=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=eh(),l=cA.createFocusTrap,c=dA.isFocusable,d=function(f){function h(y){var x,v,b,w;(function(R,_){if(!(R instanceof _))throw new TypeError("Cannot call a class as a function")})(this,h),function(R,_,L){(_=r(_))in R?Object.defineProperty(R,_,{value:L,enumerable:!0,configurable:!0,writable:!0}):R[_]=L}((v=this,w=[y],b=n(b=h),x=function(R,_){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}(R)}(v,t()?Reflect.construct(b,w||[],n(v).constructor):b.apply(v,w))),"getNodeForOption",function(R){var _,L=(_=this.internalOptions[R])!==null&&_!==void 0?_:this.originalOptions[R];if(typeof L=="function"){for(var T=arguments.length,j=new Array(T>1?T-1:0),S=1;S<T;S++)j[S-1]=arguments[S];L=L.apply(void 0,j)}if(L===!0&&(L=void 0),!L){if(L===void 0||L===!1)return L;throw new Error("`".concat(R,"` was specified but was not a node, or did not return a node"))}var k,P=L;if(typeof L=="string"&&!(P=(k=this.getDocument())===null||k===void 0?void 0:k.querySelector(L)))throw new Error("`".concat(R,"` as selector refers to no known node"));return P}),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 E=y.focusTrapOptions;for(var C in E)Object.prototype.hasOwnProperty.call(E,C)&&(C!=="returnFocusOnDeactivate"&&C!=="onDeactivate"&&C!=="onPostDeactivate"&&C!=="checkCanReturnFocus"&&C!=="clickOutsideDeactivates"?x.internalOptions[C]=E[C]:x.originalOptions[C]=E[C]);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,E=w!==void 0&&w;b&&v.focus({preventScroll:E}),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 pA=jb(uA);var h8,f8,A0={exports:{}},m8={},hd={exports:{}},$o={},cl={};function Iu(){return f8||(f8=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.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.`)},cl.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]},cl.int=function(e){return parseInt(e,10)},cl.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},cl.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),cl}var g8,y8,Aa={};function bh(){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=Iu(),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 Aa;g8=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.browserPrefixToKey=p,Aa.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Aa.default=void 0,Aa.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 Aa.default=d(),Aa}());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,Yi={};function b8(){if(x8)return Yi;x8=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Yi.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Yi.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}},Yi.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}},Yi.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]},Yi.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)},Yi.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Iu(),t=bh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Yi}var v8,w8,S8,C8,L0={},zp={};function k8(){return v8||(v8=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.default=function(){}),zp}var hA=function(){if(C8)return A0.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,E,C={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return C;if(w=v){if(w.has(b))return w.get(b);w.set(b,C)}for(const R in b)R!=="default"&&{}.hasOwnProperty.call(b,R)&&((E=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,R))&&(E.get||E.set)?w(C,R,E):C[R]=b[R]);return C}(x)}(u),r=h(eh()),i=h(yo),a=function(){if(h8)return hd.exports;function x(b){var w,E,C="";if(typeof b=="string"||typeof b=="number")C+=b;else if(typeof b=="object")if(Array.isArray(b)){var R=b.length;for(w=0;w<R;w++)b[w]&&(E=x(b[w]))&&(C&&(C+=" "),C+=E)}else for(E in b)b[E]&&(C&&(C+=" "),C+=E);return C}function v(){for(var b,w,E=0,C="",R=arguments.length;E<R;E++)(b=arguments[E])&&(w=x(b))&&(C&&(C+=" "),C+=w);return C}return h8=1,hd.exports=v,hd.exports.clsx=v,hd.exports}(),l=bh(),c=b8(),d=Iu(),p=h(function(){if(w8)return L0;w8=1,Object.defineProperty(L0,"__esModule",{value:!0}),L0.default=void 0;var x=function(P){if(typeof WeakMap=="function")var O=new WeakMap;return function(I){if(I&&I.__esModule)return I;var z,A,D={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return D;if(z=O){if(z.has(I))return z.get(I);z.set(I,D)}for(const F in I)F!=="default"&&{}.hasOwnProperty.call(I,F)&&((A=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,F))&&(A.get||A.set)?z(D,F,A):D[F]=I[F]);return D}(P)}(u),v=_(eh()),b=_(yo),w=bh(),E=b8(),C=Iu(),R=_(k8());function _(P){return P&&P.__esModule?P:{default:P}}function L(P,O,I){return(O=typeof(z=function(A){if(typeof A!="object"||!A)return A;var D=A[Symbol.toPrimitive];if(D!==void 0){var F=D.call(A,"string");if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(O))=="symbol"?z:z+"")in P?Object.defineProperty(P,O,{value:I,enumerable:!0,configurable:!0,writable:!0}):P[O]=I,P;var z}const T={start:"touchstart",move:"touchmove",stop:"touchend"},j={start:"mousedown",move:"mousemove",stop:"mouseup"};let S=j,k=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",P=>{if(this.props.onMouseDown(P),!this.props.allowAnyClick&&typeof P.button=="number"&&P.button!==0)return!1;const O=this.findDOMNode();if(!O||!O.ownerDocument||!O.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:I}=O;if(this.props.disabled||!(P.target instanceof I.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(P.target,this.props.handle,O)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(P.target,this.props.cancel,O))return;P.type!=="touchstart"||this.props.allowMobileScroll||P.preventDefault();const z=(0,w.getTouchIdentifier)(P);this.touchIdentifier=z;const A=(0,E.getControlPosition)(P,z,this);if(A==null)return;const{x:D,y:F}=A,B=(0,E.createCoreData)(this,D,F);(0,R.default)("DraggableCore: handleDragStart: %j",B),(0,R.default)("calling",this.props.onStart),this.props.onStart(P,B)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(I),this.dragging=!0,this.lastX=D,this.lastY=F,(0,w.addEvent)(I,S.move,this.handleDrag),(0,w.addEvent)(I,S.stop,this.handleDragStop))}),L(this,"handleDrag",P=>{const O=(0,E.getControlPosition)(P,this.touchIdentifier,this);if(O==null)return;let{x:I,y:z}=O;if(Array.isArray(this.props.grid)){let D=I-this.lastX,F=z-this.lastY;if([D,F]=(0,E.snapToGrid)(this.props.grid,D,F),!D&&!F)return;I=this.lastX+D,z=this.lastY+F}const A=(0,E.createCoreData)(this,I,z);if((0,R.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(P,A)!==!1&&this.mounted!==!1)this.lastX=I,this.lastY=z;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const D=document.createEvent("MouseEvents");D.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(D)}}),L(this,"handleDragStop",P=>{if(!this.dragging)return;const O=(0,E.getControlPosition)(P,this.touchIdentifier,this);if(O==null)return;let{x:I,y:z}=O;if(Array.isArray(this.props.grid)){let F=I-this.lastX||0,B=z-this.lastY||0;[F,B]=(0,E.snapToGrid)(this.props.grid,F,B),I=this.lastX+F,z=this.lastY+B}const A=(0,E.createCoreData)(this,I,z);if(this.props.onStop(P,A)===!1||this.mounted===!1)return!1;const D=this.findDOMNode();D&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(D.ownerDocument),(0,R.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,D&&((0,R.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(D.ownerDocument,S.move,this.handleDrag),(0,w.removeEvent)(D.ownerDocument,S.stop,this.handleDragStop))}),L(this,"onMouseDown",P=>(S=j,this.handleDragStart(P))),L(this,"onMouseUp",P=>(S=j,this.handleDragStop(P))),L(this,"onTouchStart",P=>(S=T,this.handleDragStart(P))),L(this,"onTouchEnd",P=>(S=T,this.handleDragStop(P)))}componentDidMount(){this.mounted=!0;const P=this.findDOMNode();P&&(0,w.addEvent)(P,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const P=this.findDOMNode();if(P){const{ownerDocument:O}=P;(0,w.removeEvent)(O,j.move,this.handleDrag),(0,w.removeEvent)(O,T.move,this.handleDrag),(0,w.removeEvent)(O,j.stop,this.handleDragStop),(0,w.removeEvent)(O,T.stop,this.handleDragStop),(0,w.removeEvent)(P,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(O)}}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 L0.default=k,L(k,"displayName","DraggableCore"),L(k,"propTypes",{allowAnyClick:v.default.bool,allowMobileScroll:v.default.bool,children:v.default.node.isRequired,disabled:v.default.bool,enableUserSelectHack:v.default.bool,offsetParent:function(P,O){if(P[O]&&P[O].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:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),L(k,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),L0}()),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(E){if(typeof E!="object"||!E)return E;var C=E[Symbol.toPrimitive];if(C!==void 0){var R=C.call(E,"string");if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(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:E}=b;return!w||E&&w.x===E.x&&w.y===E.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:E}),{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 E=(0,c.createDraggableData)(this,w),C={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:_}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[L,T]=(0,c.getBoundPosition)(this,C.x,C.y);C.x=L,C.y=T,C.slackX=this.state.slackX+(R-C.x),C.slackY=this.state.slackY+(_-C.y),E.x=C.x,E.y=C.y,E.deltaX=C.x-this.state.x,E.deltaY=C.y-this.state.y}if(this.props.onDrag(b,E)===!1)return!1;this.setState(C)}),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 E={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:R}=this.props.position;E.x=C,E.y=R}this.setState(E)}),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:E,defaultClassName:C,defaultClassNameDragging:R,defaultClassNameDragged:_,position:L,positionOffset:T,scale:j,...S}=this.props;let k={},P=null;const O=!L||this.state.dragging,I=L||E,z={x:(0,c.canDragX)(this)&&O?this.state.x:I.x,y:(0,c.canDragY)(this)&&O?this.state.y:I.y};this.state.isElementSVG?P=(0,l.createSVGTransform)(z,T):k=(0,l.createCSSTransform)(z,T);const A=(0,a.clsx)(w.props.className||"",C,{[R]:this.state.dragging,[_]:this.state.dragged});return o.createElement(p.default,g({},S,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(w),{className:A,style:{...w.props.style,...k},transform:P}))}}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 A0.exports=e,A0.exports.default=e,A0.exports.DraggableCore=t,A0.exports}();const fA=jb(hA),E8={x:0,y:0},mA=u.memo(u.forwardRef((e,t)=>{const{defaultPosition:n=E8,PaperComponent:o=Mi,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(fA,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:m,bounds:f??".MuiModal-root",onStop:r,onStart:(b,w)=>{const E=b;v({x:(E.clientX??E.touches?.[0]?.clientX)-w.x,y:(E.clientY??E.touches?.[0]?.clientY)-w.y})},onDrag:(b,w)=>{const E=b,C=E.clientX??E.touches?.[0]?.clientX,R=E.clientY??E.touches?.[0]?.clientY;g({x:C-x.x,y:R-x.y})},children:s.jsx(o,{ref:G3([p,t]),...d})})})),gA={x:"50",y:"50"},Lv=u.memo(e=>{const t=function({props:le,name:ee}){return function({props:Pe,name:Te,defaultTheme:rt,themeId:Ve}){let Ee=function(Re=iP){return function(Xe=null){const Be=G.useContext(Qs);return Be&&(ct=Be,Object.keys(ct).length!==0)?Be:Xe;var ct}(Re)}(rt);return Ee=Ee[Ve]||Ee,xP({theme:Ee,name:Te,props:Pe})}({props:le,name:ee,defaultTheme:F3,themeId:R3})}({props:e,name:"MuiDialog"}),n=B3(),o={enter:.66*n.transitions.duration.enteringScreen,exit:.66*n.transitions.duration.leavingScreen},{title:r="SheetXL",key:i="draggable-window",onCancel:a,onDone:l,onShow:c,onShown:d,onHide:p,refWindow:f,open:h,autoFocusSel:g,children:m,TransitionComponent:y=Sx,TransitionProps:x,transitionDuration:v=o,BackdropComponent:b=Cx,BackdropProps:w,PaperComponent:E=Mi,PaperProps:C,onBackdropClick:R,sx:_,className:L,onMouseDown:T,initialPosition:j=gA,isModal:S=!1,...k}=t,P=u.useRef(null),[O,I]=u.useState(null),[z,A]=u.useState(!1),[D,F]=u.useState(!1),B=u.useRef(null),[M,N]=Y7(),V=u.useRef(null),[U,J]=Y7(),X=u.useRef(null);u.useEffect(()=>{O&&A(h)},[h,O]);const H=Cn(()=>{a?.(),A(!1)},[a]);u.useEffect(()=>{if(N.width===0&&N.height===0||O)return;const le=X.current?.getBoundingClientRect(),ee=N.height-le.height,Pe=N.width-le.width;let Te=.5*Pe,rt=.5*ee;typeof j?.x=="number"?Te=j.x:typeof j?.x=="string"&&(Te=Pe*(parseFloat(j.x)/100)),typeof j?.y=="number"?rt=j.y:typeof j?.y=="string"&&(rt=ee*(parseFloat(j.y)/100)),I({x:Te,y:rt})},[N,J]);const[ne,oe]=u.useState(!1),[ye,de]=u.useState(null),[xe,we]=u.useState(null),ve=Cn(le=>{if(ye)return ye.focus(le),!0;if(g){const ee=V.current?.querySelectorAll?.(g);if(ee&&ee.length>0)return ee[0]?.focus?.(le),!0}return V.current?.focus?.(le),!1},[ye,g]),re=E2(f,()=>({focus:le=>{ve(le)}}),[]),ce={...x,onExited:le=>{l?.(null),x?.onExited?.(le)},onExit:le=>{const ee=xe;ee&&requestAnimationFrame(()=>{re.current?.contains(document.activeElement)&&ee.focus()}),p?.(),F(!1),x?.onExit?.(le)},onEntered:(le,ee)=>{c?.(),x?.onEntered?.(le,ee)},onEntering:(le,ee)=>{F(!0),d?.(re.current)}};u.useEffect(()=>{D&&ve()},[D]);const Se=s.jsx(pA,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:P,active:D,children:s.jsx(y,{in:z,timeout:v,role:"presentation",...ce,children:s.jsx(Le,{className:"MuiDialog-container",ref:V,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:le=>{le.which===xr.Escape&&(H(),B.current?.start(le,{center:!1}),setTimeout(()=>B.current?.stop(le),180)),le.stopPropagation()},children:s.jsxs(mA,{className:rr({"Mui-focusVisible":ne},L),sx:{"& *":le=>Y3(le),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:le=>`solid ${pt(le.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:le=>`solid ${pt(le.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",..._},defaultPosition:O,ref:X,titleSize:J,rootSize:N,PaperComponent:E,...k,...C,children:[r?s.jsx(Mx,{className:rr({"Mui-selected":ne},"draggable-title"),sx:{cursor:"move",display:"flex",color:le=>le.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:le=>`${le.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:le=>le.transitions.duration.shortest/2+"ms"},backgroundColor:le=>pt(le.palette.action.hover,.03)},ref:U,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:le=>le.spacing(1),marginLeft:le=>le.spacing(1),marginRight:le=>le.spacing(1)},children:[s.jsx(Le,{sx:{flex:"1 1 100%",paddingLeft:le=>le.spacing(1)},children:r}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:le=>le.palette.text.icon??le.palette.action.active},touchRippleRef:B,onPointerDown:le=>{B.current?.start(le,{center:!1}),le.stopPropagation(),le.preventDefault()},onPointerUp:H,children:s.jsx(E3,{})})})]})}):null,m]})})})});let ie=null;S&&(ie=s.jsx(b,{...w,open:z,onMouseDown:le=>{H(),w?.onMouseDown?.(le)},onClick:le=>{R?.(le),w?.onClick?.(le)},sx:{pointerEvents:"auto",...w?.sx}}));const{getPortalContainer:Y}=W3();return yo.createPortal(s.jsxs(Le,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:G3([re,M]),onPointerDown:le=>{ne&&(le.target===V.current||le.target.tabIndex<0)&&V.current?.contains(document.activeElement)},onContextMenu:le=>{le.isPropagationStopped()||le.preventDefault()},onFocus:le=>{!ne&&(le.target===V.current||le.target.tabIndex<0)&&setTimeout(()=>{ve()},100),P.current?.focusTrap?.unpause(),oe(!0),V.current?.contains(le.target)&&le.target!==V.current&&de(le.target),le.relatedTarget&&!xe&&we(le.relatedTarget)},onBlur:le=>{re?.current?.contains(le.relatedTarget)||(we(null),P.current?.focusTrap?.pause(),oe(!1))},children:[ie,Se]}),Y(),i+"")});var Ei=typeof window<"u"?window:{screen:{},navigator:{}},Ks=(Ei.matchMedia||function(){return{matches:!1}}).bind(Ei),yA={get passive(){return!0}},M8=function(){};Ei.addEventListener&&Ei.addEventListener("p",M8,yA),Ei.removeEventListener&&Ei.removeEventListener("p",M8,!1);var Q3="ontouchstart"in Ei,xA=Q3||"TouchEvent"in Ei&&Ks("(any-pointer: coarse)").matches,T8=(Ei.navigator.maxTouchPoints||0)>0||xA,zv=Ei.navigator.userAgent||"",bA=Ks("(pointer: coarse)").matches&&/iPad|Macintosh/.test(zv)&&Math.min(Ei.screen.width||0,Ei.screen.height||0)>=768,Fv=(Ks("(pointer: coarse)").matches||!Ks("(pointer: fine)").matches&&Q3)&&!/Windows.*Firefox/.test(zv),vA=Ks("(any-pointer: fine)").matches||Ks("(any-hover: hover)").matches||bA||!Q3,_8=!T8||!vA&&Fv?T8?"touchOnly":"mouseOnly":"hybrid",wA=_8==="mouseOnly"?"mouse":_8==="touchOnly"||Fv?"touch":"mouse",wc=e=>e.type==="checkbox",kl=e=>e instanceof Date,Lr=e=>e==null;const Bv=e=>typeof e=="object";var Zo=e=>!Lr(e)&&!Array.isArray(e)&&Bv(e)&&!kl(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 T2=e=>/^\w*$/.test(e),Jo=e=>e===void 0,vh=e=>Array.isArray(e)?e.filter(Boolean):[],tf=e=>vh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Gt=(e,t,n)=>{if(!t||!Zo(e))return n;const o=(T2(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},na=e=>typeof e=="boolean",xo=(e,t,n)=>{let o=-1;const r=T2(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",nc="all",j8="pattern",R8="required",Vv=u.createContext(null);Vv.displayName="HookFormContext";const SA=e=>{const{children:t,...n}=e;return u.createElement(Vv.Provider,{value:n},t)},CA=typeof window<"u"?G.useLayoutEffect:G.useEffect;var la=e=>typeof e=="string",kA=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},oc=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=[]}}},wh=e=>Lr(e)||!Bv(e);function Ua(e,t){if(wh(e)||wh(t))return e===t;if(kl(e)&&kl(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(kl(i)&&kl(a)||Zo(i)&&Zo(a)||Array.isArray(i)&&Array.isArray(a)?!Ua(i,a):i!==a)return!1}}return!0}var $r=e=>Zo(e)&&!Object.keys(e).length,nf=e=>e.type==="file",Ni=e=>typeof e=="function",Pu=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",Fp=e=>Pu(e)&&e.isConnected;function nr(e,t){const n=Array.isArray(t)?t:T2(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(Ni(e[t]))return!0;return!1};function Ou(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])?[]:{},Ou(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)||wh(n[r])?n[r]=Array.isArray(e[r])?Ou(e[r],[]):{...Ou(e[r])}:Uv(e[r],Lr(t)?{}:t[r],n[r]):n[r]=!Ua(e[r],t[r]);return n}var z0=(e,t)=>Uv(e,t,Ou(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&&la(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):wc(t)?qv(e.refs).value:Kv(Jo(t.value)?e.ref.value:t.value,e)}var Du=e=>e instanceof RegExp,F0=e=>Jo(e)?e:Du(e)?e.source:Zo(e)?Du(e.value)?e.value.source:e.value:e,L8=e=>({isOnSubmit:!e||e===$v,isOnBlur:e==="onBlur",isOnChange:e===Nv,isOnAll:e===nc,isOnTouch:e==="onTouched"});const z8="AsyncFunction";var EA=e=>!!e&&!!e.validate&&!!(Ni(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 Sc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Gt(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(Sc(l,t))break}else if(Zo(l)&&Sc(l,t))break}}};function B8(e,t,n){const o=Gt(e,n);if(o||T2(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Gt(t,i),l=Gt(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 MA=(e,t,n)=>{const o=oc(Gt(e,n));return xo(o,"root",t[n]),xo(e,n,o),e},Zd=e=>la(e);function N8(e,t,n="validate"){if(Zd(e)||Array.isArray(e)&&e.every(Zd)||na(e)&&!e)return{type:n,message:Zd(e)?e:"",ref:t}}var rs=e=>Zo(e)&&!Du(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=Gt(n,y);if(!v||t.has(y))return{};const w=l?l[0]:a,E=k=>{r&&w.reportValidity&&(w.setCustomValidity(na(k)?"":k||""),w.reportValidity())},C={},R=of(a),_=wc(a),L=R||_,T=(x||nf(a))&&Jo(a.value)&&Jo(b)||Pu(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,j=kA.bind(null,y,o,C),S=(k,P,O,I="maxLength",z="minLength")=>{const A=k?P:O;C[y]={type:k?I:z,message:A,ref:a,...j(k?I:z,A)}};if(i?!Array.isArray(b)||!b.length:c&&(!L&&(T||Lr(b))||na(b)&&!b||_&&!qv(l).isValid||R&&!Gv(l).isValid)){const{value:k,message:P}=Zd(c)?{value:!!c,message:c}:rs(c);if(k&&(C[y]={type:R8,message:P,ref:w,...j(R8,P)},!o))return E(P),C}if(!(T||Lr(f)&&Lr(h))){let k,P;const O=rs(h),I=rs(f);if(Lr(b)||isNaN(b)){const z=a.valueAsDate||new Date(b),A=B=>new Date(new Date().toDateString()+" "+B),D=a.type=="time",F=a.type=="week";la(O.value)&&b&&(k=D?A(b)>A(O.value):F?b>O.value:z>new Date(O.value)),la(I.value)&&b&&(P=D?A(b)<A(I.value):F?b<I.value:z<new Date(I.value))}else{const z=a.valueAsNumber||b&&+b;Lr(O.value)||(k=z>O.value),Lr(I.value)||(P=z<I.value)}if((k||P)&&(S(!!k,O.message,I.message,"max","min"),!o))return E(C[y].message),C}if((d||p)&&!T&&(la(b)||i&&Array.isArray(b))){const k=rs(d),P=rs(p),O=!Lr(k.value)&&b.length>+k.value,I=!Lr(P.value)&&b.length<+P.value;if((O||I)&&(S(O,k.message,P.message),!o))return E(C[y].message),C}if(g&&!T&&la(b)){const{value:k,message:P}=rs(g);if(Du(k)&&!b.match(k)&&(C[y]={type:j8,message:P,ref:a,...j(j8,P)},!o))return E(P),C}if(m){if(Ni(m)){const k=N8(await m(b,n),w);if(k&&(C[y]={...k,...j("validate",k.message)},!o))return E(k.message),C}else if(Zo(m)){let k={};for(const P in m){if(!$r(k)&&!o)break;const O=N8(await m[P](b,n),w,P);O&&(k={...O,...j(P,O.message)},E(O.message),o&&(C[y]=k))}if(!$r(k)&&(C[y]={ref:w,...k},!o))return C}}return E(!0),C};const TA={mode:$v,reValidateMode:Nv,shouldFocusError:!0},_A=["Ok","Cancel"],Sh=e=>{const{description:t,icon:n,onCancel:o,onOption:r,onDone:i,onValidateOption:a,createOptionsButton:l,options:c=_A,autoFocusSel:d=".defaultOption",defaultOption:p=c[0],cancelOption:f="Cancel",children:h,...g}=e,m=function(j={}){const S=u.useRef(void 0),k=u.useRef(void 0),[P,O]=u.useState({isDirty:!1,isValidating:!1,isLoading:Ni(j.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:j.errors||{},disabled:j.disabled||!1,isReady:!1,defaultValues:Ni(j.defaultValues)?void 0:j.defaultValues});if(!S.current)if(j.formControl)S.current={...j.formControl,formState:P},j.defaultValues&&!Ni(j.defaultValues)&&j.formControl.reset(j.defaultValues,j.resetOptions);else{const{formControl:z,...A}=function(D={}){let F={...TA,...D},B={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ni(F.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:F.errors||{},disabled:F.disabled||!1};const M={};let N,V=(Zo(F.defaultValues)||Zo(F.values))&&Cr(F.defaultValues||F.values)||{},U=F.shouldUnregister?{}:Cr(V),J={action:!1,mount:!1,watch:!1},X={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},H=0;const ne={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let oe={...ne};const ye={array:I8(),state:I8()},de=F.criteriaMode===nc,xe=async W=>{if(!F.disabled&&(ne.isValid||oe.isValid||W)){const Q=F.resolver?$r((await ce()).errors):await Se(M,!0);Q!==B.isValid&&ye.state.next({isValid:Q})}},we=(W,Q)=>{!F.disabled&&(ne.isValidating||ne.validatingFields||oe.isValidating||oe.validatingFields)&&((W||Array.from(X.mount)).forEach(K=>{K&&(Q?xo(B.validatingFields,K,Q):nr(B.validatingFields,K))}),ye.state.next({validatingFields:B.validatingFields,isValidating:!$r(B.validatingFields)}))},ve=(W,Q,K,se)=>{const te=Gt(M,W);if(te){const ae=Gt(U,W,Jo(K)?Gt(V,W):K);Jo(ae)||se&&se.defaultChecked||Q?xo(U,W,Q?ae:A8(te._f)):le(W,ae),J.mount&&xe()}},re=(W,Q,K,se,te)=>{let ae=!1,pe=!1;const me={name:W};if(!F.disabled){if(!K||se){(ne.isDirty||oe.isDirty)&&(pe=B.isDirty,B.isDirty=me.isDirty=ie(),ae=pe!==me.isDirty);const fe=Ua(Gt(V,W),Q);pe=!!Gt(B.dirtyFields,W),fe?nr(B.dirtyFields,W):xo(B.dirtyFields,W,!0),me.dirtyFields=B.dirtyFields,ae=ae||(ne.dirtyFields||oe.dirtyFields)&&pe!==!fe}if(K){const fe=Gt(B.touchedFields,W);fe||(xo(B.touchedFields,W,K),me.touchedFields=B.touchedFields,ae=ae||(ne.touchedFields||oe.touchedFields)&&fe!==K)}ae&&te&&ye.state.next(me)}return ae?me:{}},ce=async W=>{we(W,!0);const Q=await F.resolver(U,F.context,((K,se,te,ae)=>{const pe={};for(const me of K){const fe=Gt(se,me);fe&&xo(pe,me,fe._f)}return{criteriaMode:te,names:[...K],fields:pe,shouldUseNativeValidation:ae}})(W||X.mount,M,F.criteriaMode,F.shouldUseNativeValidation));return we(W),Q},Se=async(W,Q,K={valid:!0})=>{for(const se in W){const te=W[se];if(te){const{_f:ae,...pe}=te;if(ae){const me=X.array.has(ae.name),fe=te._f&&EA(te._f);fe&&ne.validatingFields&&we([se],!0);const je=await $8(te,X.disabled,U,de,F.shouldUseNativeValidation&&!Q,me);if(fe&&ne.validatingFields&&we([se]),je[ae.name]&&(K.valid=!1,Q))break;!Q&&(Gt(je,ae.name)?me?MA(B.errors,je,ae.name):xo(B.errors,ae.name,je[ae.name]):nr(B.errors,ae.name))}!$r(pe)&&await Se(pe,Q,K)}}return K.valid},ie=(W,Q)=>!F.disabled&&(W&&Q&&xo(U,W,Q),!Ua(Ee(),V)),Y=(W,Q,K)=>{return se=W,te=X,ae={...J.mount?U:Jo(Q)?V:la(W)?{[W]:Q}:Q},pe=K,me=Q,la(se)?(pe&&te.watch.add(se),Gt(ae,se,me)):Array.isArray(se)?se.map(fe=>(pe&&te.watch.add(fe),Gt(ae,fe))):(pe&&(te.watchAll=!0),ae);var se,te,ae,pe,me},le=(W,Q,K={})=>{const se=Gt(M,W);let te=Q;if(se){const ae=se._f;ae&&(!ae.disabled&&xo(U,W,Kv(Q,ae)),te=Pu(ae.ref)&&Lr(Q)?"":Q,Hv(ae.ref)?[...ae.ref.options].forEach(pe=>pe.selected=te.includes(pe.value)):ae.refs?wc(ae.ref)?ae.refs.forEach(pe=>{pe.defaultChecked&&pe.disabled||(Array.isArray(te)?pe.checked=!!te.find(me=>me===pe.value):pe.checked=te===pe.value||!!te)}):ae.refs.forEach(pe=>pe.checked=pe.value===te):nf(ae.ref)?ae.ref.value="":(ae.ref.value=te,ae.ref.type||ye.state.next({name:W,values:Cr(U)})))}(K.shouldDirty||K.shouldTouch)&&re(W,te,K.shouldTouch,K.shouldDirty,!0),K.shouldValidate&&Ve(W)},ee=(W,Q,K)=>{for(const se in Q){if(!Q.hasOwnProperty(se))return;const te=Q[se],ae=W+"."+se,pe=Gt(M,ae);(X.array.has(W)||Zo(te)||pe&&!pe._f)&&!kl(te)?ee(ae,te,K):le(ae,te,K)}},Pe=(W,Q,K={})=>{const se=Gt(M,W),te=X.array.has(W),ae=Cr(Q);xo(U,W,ae),te?(ye.array.next({name:W,values:Cr(U)}),(ne.isDirty||ne.dirtyFields||oe.isDirty||oe.dirtyFields)&&K.shouldDirty&&ye.state.next({name:W,dirtyFields:z0(V,U),isDirty:ie(W,ae)})):!se||se._f||Lr(ae)?le(W,ae,K):ee(W,ae,K),F8(W,X)&&ye.state.next({...B}),ye.state.next({name:J.mount?W:void 0,values:Cr(U)})},Te=async W=>{J.mount=!0;const Q=W.target;let K=Q.name,se=!0;const te=Gt(M,K),ae=Fe=>{se=Number.isNaN(Fe)||kl(Fe)&&isNaN(Fe.getTime())||Ua(Fe,Gt(U,K,Fe))},pe=L8(F.mode),me=L8(F.reValidateMode);if(te){let Fe,Ge;const et=Q.type?A8(te._f):Zo(je=W)&&je.target?wc(je.target)?je.target.checked:je.target.value:je,tt=W.type==="blur"||W.type==="focusout",it=!((fe=te._f).mount&&(fe.required||fe.min||fe.max||fe.maxLength||fe.minLength||fe.pattern||fe.validate)||F.resolver||Gt(B.errors,K)||te._f.deps)||(($t,nn,Zt,Tn,pn)=>!pn.isOnAll&&(!Zt&&pn.isOnTouch?!(nn||$t):(Zt?Tn.isOnBlur:pn.isOnBlur)?!$t:!(Zt?Tn.isOnChange:pn.isOnChange)||$t))(tt,Gt(B.touchedFields,K),B.isSubmitted,me,pe),At=F8(K,X,tt);xo(U,K,et),tt?(te._f.onBlur&&te._f.onBlur(W),N&&N(0)):te._f.onChange&&te._f.onChange(W);const Lt=re(K,et,tt),_t=!$r(Lt)||At;if(!tt&&ye.state.next({name:K,type:W.type,values:Cr(U)}),it)return(ne.isValid||oe.isValid)&&(F.mode==="onBlur"?tt&&xe():tt||xe()),_t&&ye.state.next({name:K,...At?{}:Lt});if(!tt&&At&&ye.state.next({...B}),F.resolver){const{errors:$t}=await ce([K]);if(ae(et),se){const nn=B8(B.errors,M,K),Zt=B8($t,M,nn.name||K);Fe=Zt.error,K=Zt.name,Ge=$r($t)}}else we([K],!0),Fe=(await $8(te,X.disabled,U,de,F.shouldUseNativeValidation))[K],we([K]),ae(et),se&&(Fe?Ge=!1:(ne.isValid||oe.isValid)&&(Ge=await Se(M,!0)));se&&(te._f.deps&&Ve(te._f.deps),(($t,nn,Zt,Tn)=>{const pn=Gt(B.errors,$t),En=(ne.isValid||oe.isValid)&&na(nn)&&B.isValid!==nn;var kt;if(F.delayError&&Zt?(kt=()=>{return on=$t,mn=Zt,xo(B.errors,on,mn),void ye.state.next({errors:B.errors});var on,mn},N=on=>{clearTimeout(H),H=setTimeout(kt,on)},N(F.delayError)):(clearTimeout(H),N=null,Zt?xo(B.errors,$t,Zt):nr(B.errors,$t)),(Zt?!Ua(pn,Zt):pn)||!$r(Tn)||En){const on={...Tn,...En&&na(nn)?{isValid:nn}:{},errors:B.errors,name:$t};B={...B,...on},ye.state.next(on)}})(K,Ge,Fe,Lt))}var fe,je},rt=(W,Q)=>{if(Gt(B.errors,Q)&&W.focus)return W.focus(),1},Ve=async(W,Q={})=>{let K,se;const te=oc(W);if(F.resolver){const ae=await(async pe=>{const{errors:me}=await ce(pe);if(pe)for(const fe of pe){const je=Gt(me,fe);je?xo(B.errors,fe,je):nr(B.errors,fe)}else B.errors=me;return me})(Jo(W)?W:te);K=$r(ae),se=W?!te.some(pe=>Gt(ae,pe)):K}else W?(se=(await Promise.all(te.map(async ae=>{const pe=Gt(M,ae);return await Se(pe&&pe._f?{[ae]:pe}:pe)}))).every(Boolean),(se||B.isValid)&&xe()):se=K=await Se(M);return ye.state.next({...!la(W)||(ne.isValid||oe.isValid)&&K!==B.isValid?{}:{name:W},...F.resolver||!W?{isValid:K}:{},errors:B.errors}),Q.shouldFocus&&!se&&Sc(M,rt,W?te:X.mount),se},Ee=W=>{const Q={...J.mount?U:V};return Jo(W)?Q:la(W)?Gt(Q,W):W.map(K=>Gt(Q,K))},Re=(W,Q)=>({invalid:!!Gt((Q||B).errors,W),isDirty:!!Gt((Q||B).dirtyFields,W),error:Gt((Q||B).errors,W),isValidating:!!Gt(B.validatingFields,W),isTouched:!!Gt((Q||B).touchedFields,W)}),Xe=(W,Q,K)=>{const se=(Gt(M,W,{_f:{}})._f||{}).ref,te=Gt(B.errors,W)||{},{ref:ae,message:pe,type:me,...fe}=te;xo(B.errors,W,{...fe,...Q,ref:se}),ye.state.next({name:W,errors:B.errors,isValid:!1}),K&&K.shouldFocus&&se&&se.focus&&se.focus()},Be=W=>ye.state.subscribe({next:Q=>{var K,se,te;K=W.name,se=Q.name,te=W.exact,K&&se&&K!==se&&!oc(K).some(ae=>ae&&(te?ae===se:ae.startsWith(se)||se.startsWith(ae)))||!((ae,pe,me,fe)=>{me(ae);const{name:je,...Fe}=ae;return $r(Fe)||Object.keys(Fe).length>=Object.keys(pe).length||Object.keys(Fe).find(Ge=>pe[Ge]===(!fe||nc))})(Q,W.formState||ne,De,W.reRenderRoot)||W.callback({values:{...U},...B,...Q})}}).unsubscribe,ct=(W,Q={})=>{for(const K of W?oc(W):X.mount)X.mount.delete(K),X.array.delete(K),Q.keepValue||(nr(M,K),nr(U,K)),!Q.keepError&&nr(B.errors,K),!Q.keepDirty&&nr(B.dirtyFields,K),!Q.keepTouched&&nr(B.touchedFields,K),!Q.keepIsValidating&&nr(B.validatingFields,K),!F.shouldUnregister&&!Q.keepDefaultValue&&nr(V,K);ye.state.next({values:Cr(U)}),ye.state.next({...B,...Q.keepDirty?{isDirty:ie()}:{}}),!Q.keepIsValid&&xe()},Qe=({disabled:W,name:Q})=>{(na(W)&&J.mount||W||X.disabled.has(Q))&&(W?X.disabled.add(Q):X.disabled.delete(Q))},he=(W,Q={})=>{let K=Gt(M,W);const se=na(Q.disabled)||na(F.disabled);return xo(M,W,{...K||{},_f:{...K&&K._f?K._f:{ref:{name:W}},name:W,mount:!0,...Q}}),X.mount.add(W),K?Qe({disabled:na(Q.disabled)?Q.disabled:F.disabled,name:W}):ve(W,!0,Q.value),{...se?{disabled:Q.disabled||F.disabled}:{},...F.progressive?{required:!!Q.required,min:F0(Q.min),max:F0(Q.max),minLength:F0(Q.minLength),maxLength:F0(Q.maxLength),pattern:F0(Q.pattern)}:{},name:W,onChange:Te,onBlur:Te,ref:te=>{if(te){he(W,Q),K=Gt(M,W);const je=Jo(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,Fe=of(fe=je)||wc(fe),Ge=K._f.refs||[];if(Fe?Ge.find(et=>et===je):je===K._f.ref)return;xo(M,W,{_f:{...K._f,...Fe?{refs:[...Ge.filter(Fp),je,...Array.isArray(Gt(V,W))?[{}]:[]],ref:{type:je.type,name:W}}:{ref:je}}}),ve(W,!1,void 0,je)}else K=Gt(M,W,{}),K._f&&(K._f.mount=!1),(F.shouldUnregister||Q.shouldUnregister)&&(ae=X.array,pe=W,!ae.has((me=pe).substring(0,me.search(/\.\d+(\.|$)/))||me)||!J.action)&&X.unMount.add(W);var ae,pe,me,fe}}},Ye=()=>F.shouldFocusError&&Sc(M,rt,X.mount),ke=(W,Q)=>async K=>{let se;K&&(K.preventDefault&&K.preventDefault(),K.persist&&K.persist());let te=Cr(U);if(ye.state.next({isSubmitting:!0}),F.resolver){const{errors:ae,values:pe}=await ce();B.errors=ae,te=pe}else await Se(M);if(X.disabled.size)for(const ae of X.disabled)xo(te,ae,void 0);if(nr(B.errors,"root"),$r(B.errors)){ye.state.next({errors:{}});try{await W(te,K)}catch(ae){se=ae}}else Q&&await Q({...B.errors},K),Ye(),setTimeout(Ye);if(ye.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$r(B.errors)&&!se,submitCount:B.submitCount+1,errors:B.errors}),se)throw se},Ie=(W,Q={})=>{const K=W?Cr(W):V,se=Cr(K),te=$r(W),ae=te?V:se;if(Q.keepDefaultValues||(V=K),!Q.keepValues){if(Q.keepDirtyValues){const pe=new Set([...X.mount,...Object.keys(z0(V,U))]);for(const me of Array.from(pe))Gt(B.dirtyFields,me)?xo(ae,me,Gt(U,me)):Pe(me,Gt(ae,me))}else{if(ef&&Jo(W))for(const pe of X.mount){const me=Gt(M,pe);if(me&&me._f){const fe=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(Pu(fe)){const je=fe.closest("form");if(je){je.reset();break}}}}for(const pe of X.mount)Pe(pe,Gt(ae,pe))}U=Cr(ae),ye.array.next({values:{...ae}}),ye.state.next({values:{...ae}})}X={mount:Q.keepDirtyValues?X.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},J.mount=!ne.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,J.watch=!!F.shouldUnregister,ye.state.next({submitCount:Q.keepSubmitCount?B.submitCount:0,isDirty:!te&&(Q.keepDirty?B.isDirty:!(!Q.keepDefaultValues||Ua(W,V))),isSubmitted:!!Q.keepIsSubmitted&&B.isSubmitted,dirtyFields:te?{}:Q.keepDirtyValues?Q.keepDefaultValues&&U?z0(V,U):B.dirtyFields:Q.keepDefaultValues&&W?z0(V,W):Q.keepDirty?B.dirtyFields:{},touchedFields:Q.keepTouched?B.touchedFields:{},errors:Q.keepErrors?B.errors:{},isSubmitSuccessful:!!Q.keepIsSubmitSuccessful&&B.isSubmitSuccessful,isSubmitting:!1})},ue=(W,Q)=>Ie(Ni(W)?W(U):W,Q),De=W=>{B={...B,...W}},Ae={control:{register:he,unregister:ct,getFieldState:Re,handleSubmit:ke,setError:Xe,_subscribe:Be,_runSchema:ce,_focusError:Ye,_getWatch:Y,_getDirty:ie,_setValid:xe,_setFieldArray:(W,Q=[],K,se,te=!0,ae=!0)=>{if(se&&K&&!F.disabled){if(J.action=!0,ae&&Array.isArray(Gt(M,W))){const fe=K(Gt(M,W),se.argA,se.argB);te&&xo(M,W,fe)}if(ae&&Array.isArray(Gt(B.errors,W))){const fe=K(Gt(B.errors,W),se.argA,se.argB);te&&xo(B.errors,W,fe),pe=B.errors,!vh(Gt(pe,me=W)).length&&nr(pe,me)}if((ne.touchedFields||oe.touchedFields)&&ae&&Array.isArray(Gt(B.touchedFields,W))){const fe=K(Gt(B.touchedFields,W),se.argA,se.argB);te&&xo(B.touchedFields,W,fe)}(ne.dirtyFields||oe.dirtyFields)&&(B.dirtyFields=z0(V,U)),ye.state.next({name:W,isDirty:ie(W,Q),dirtyFields:B.dirtyFields,errors:B.errors,isValid:B.isValid})}else xo(U,W,Q);var pe,me},_setDisabledField:Qe,_setErrors:W=>{B.errors=W,ye.state.next({errors:B.errors,isValid:!1})},_getFieldArray:W=>vh(Gt(J.mount?U:V,W,F.shouldUnregister?Gt(V,W,[]):[])),_reset:Ie,_resetDefaultValues:()=>Ni(F.defaultValues)&&F.defaultValues().then(W=>{ue(W,F.resetOptions),ye.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const W of X.unMount){const Q=Gt(M,W);Q&&(Q._f.refs?Q._f.refs.every(K=>!Fp(K)):!Fp(Q._f.ref))&&ct(W)}X.unMount=new Set},_disableForm:W=>{na(W)&&(ye.state.next({disabled:W}),Sc(M,(Q,K)=>{const se=Gt(M,K);se&&(Q.disabled=se._f.disabled||W,Array.isArray(se._f.refs)&&se._f.refs.forEach(te=>{te.disabled=se._f.disabled||W}))},0,!1))},_subjects:ye,_proxyFormState:ne,get _fields(){return M},get _formValues(){return U},get _state(){return J},set _state(W){J=W},get _defaultValues(){return V},get _names(){return X},set _names(W){X=W},get _formState(){return B},get _options(){return F},set _options(W){F={...F,...W}}},subscribe:W=>(J.mount=!0,oe={...oe,...W.formState},Be({...W,formState:oe})),trigger:Ve,register:he,handleSubmit:ke,watch:(W,Q)=>Ni(W)?ye.state.subscribe({next:K=>W(Y(void 0,Q),K)}):Y(W,Q,!0),setValue:Pe,getValues:Ee,reset:ue,resetField:(W,Q={})=>{Gt(M,W)&&(Jo(Q.defaultValue)?Pe(W,Cr(Gt(V,W))):(Pe(W,Q.defaultValue),xo(V,W,Cr(Q.defaultValue))),Q.keepTouched||nr(B.touchedFields,W),Q.keepDirty||(nr(B.dirtyFields,W),B.isDirty=Q.defaultValue?ie(W,Cr(Gt(V,W))):ie()),Q.keepError||(nr(B.errors,W),ne.isValid&&xe()),ye.state.next({...B}))},clearErrors:W=>{W&&oc(W).forEach(Q=>nr(B.errors,Q)),ye.state.next({errors:W?B.errors:{}})},unregister:ct,setError:Xe,setFocus:(W,Q={})=>{const K=Gt(M,W),se=K&&K._f;if(se){const te=se.refs?se.refs[0]:se.ref;te.focus&&(te.focus(),Q.shouldSelect&&Ni(te.select)&&te.select())}},getFieldState:Re};return{...Ae,formControl:Ae}}(j);S.current={...A,formState:P}}const I=S.current.control;return I._options=j,CA(()=>{const z=I._subscribe({formState:I._proxyFormState,callback:()=>O({...I._formState}),reRenderRoot:!0});return O(A=>({...A,isReady:!0})),I._formState.isReady=!0,z},[I]),u.useEffect(()=>I._disableForm(j.disabled),[I,j.disabled]),u.useEffect(()=>{j.mode&&(I._options.mode=j.mode),j.reValidateMode&&(I._options.reValidateMode=j.reValidateMode)},[I,j.mode,j.reValidateMode]),u.useEffect(()=>{j.errors&&(I._setErrors(j.errors),I._focusError())},[I,j.errors]),u.useEffect(()=>{j.shouldUnregister&&I._subjects.state.next({values:I._getWatch()})},[I,j.shouldUnregister]),u.useEffect(()=>{if(I._proxyFormState.isDirty){const z=I._getDirty();z!==P.isDirty&&I._subjects.state.next({isDirty:z})}},[I,P.isDirty]),u.useEffect(()=>{j.values&&!Ua(j.values,k.current)?(I._reset(j.values,I._options.resetOptions),k.current=j.values,O(z=>({...z}))):I._resetDefaultValues()},[I,j.values]),u.useEffect(()=>{I._state.mount||(I._setValid(),I._state.mount=!0),I._state.watch&&(I._state.watch=!1,I._subjects.state.next({...I._formState})),I._removeUnmounted()}),S.current.formState=((z,A,D,F=!0)=>{const B={defaultValues:A._defaultValues};for(const M in z)Object.defineProperty(B,M,{get:()=>{const N=M;return A._proxyFormState[N]!==nc&&(A._proxyFormState[N]=!F||nc),z[N]}});return B})(P,I),S.current}({shouldUseNativeValidation:!1}),{handleSubmit:y,formState:x}=m,v=u.useRef(null),b=u.useRef(null),w=u.useRef(null),E=Cn(async j=>{let S;try{if(S=await Promise.resolve(a?.(j))??!0,S!==!0)return;await Promise.resolve(r?.(j,j===f,j===p)),i?.(j)}catch{}},[r,i,a,f,p]),C=Cn((j,S)=>{setTimeout(()=>{E(p)},180)},[E]),R=Cn(()=>{r?.(f,!0,!1),o?.(),i?.(null)},[r,f,o,i]),_=x&&(Object.keys(x.errors).length>0||x.disabled||x.isSubmitted),L=Cn((j,S)=>{const k=j===f,P={className:S?"defaultOption":"action",type:S?"submit":"button",style:{minWidth:"75px"},onClick:()=>{k?R():S||E(j)}};if(l)return l(j,P,S);const O={className:S?"defaultOption":"action",variant:S?"contained":"outlined",size:"small",disabled:!k&&_,color:"primary",...P};if(S||k){const I=S?v:b;O.touchRippleRef=I,O.onPointerDown=z=>{I.current?.start(z,{center:!1}),z.stopPropagation(),z.preventDefault()}}return s.jsx(Lc,{...O,children:s.jsx("div",{style:{paddingTop:"3px"},children:j})},`action:${j}`)},[c,p,f,l,x]),T=u.useMemo(()=>{const j=[];for(let S=0;S<c.length;S++){const k=c[S],P=p?k===p:S===0;j.push(L(k,P))}return j},[c,p,x]);return s.jsx(Lv,{onCancel:R,initialPosition:{y:wA==="touch"?"15":"35"},onDone:i,autoFocusSel:d,isModal:!0,PaperProps:{},...g,children:s.jsx(SA,{...m,children:s.jsxs("form",{ref:w,onSubmit:y(C),children:[s.jsx(Ex,{dividers:!0,onKeyDown:j=>{if(j.isDefaultPrevented())return;j.stopPropagation();let S=null,k=null;const P=j.which===xr.Escape&&f;if(P)S=f,k=b;else{if(_)return;j.which===xr.Enter&&(S=p??c[0],k=v)}S&&(k.current?.start(j,{center:!1}),setTimeout(()=>{k.current?.stop(j),P&&E(S)},180))},children:s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:j=>j.spacing(n||t?1.5:0)},children:[s.jsxs(Le,{sx:{display:"flex",flexDirection:"column"},children:[n,t]}),h]})}),s.jsx(YT,{sx:{paddingTop:j=>j.spacing(1),paddingBottom:j=>j.spacing(1),paddingLeft:j=>j.spacing(1),paddingRight:j=>j.spacing(1),backgroundColor:j=>pt(j.palette.action.hover,.03)},children:T})]})})})},jA=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:Sh,default:Sh},Symbol.toStringTag,{value:"Module"})),RA=u.lazy(()=>Promise.resolve().then(()=>jA)),IA=u.lazy(()=>Promise.resolve().then(()=>require("./E7YmtCLyNmiYVNWk.cjs"))),a0=u.memo(u.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return U3(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})})})),qe=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,labelOverride:l,disabled:c=!1,variant:d=Si.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...g}=e,m=u.useRef(null),y=u.useRef(!1),x=u.useMemo(()=>{const L={onExecute(T,j){o?.onExecute?.(T,j),y.current||(m.current?.start({center:!1}),setTimeout(()=>m.current?.stop({}),180)),y.current=!1},onError(T,j,S){o?.onError(T,j,S)}};return o?.beforeExecute&&(L.beforeExecute=o.beforeExecute),L},[o]),v=U3(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]),E=u.useCallback(L=>{L.keyCode!==xr.Enter&&L.keyCode!==xr.Space||n?.execute(f,o)},[v,o,f]),C=u.useMemo(()=>a||d===Si.Toolbar||n?.state()?typeof a=="function"?a(n):a:M2,[v,a]),R=u.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:d===Si.Toolbar?C:s.jsx(k1,{selected:n?.state()??!1,children:C}),touchRippleRef:m,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:w,onKeyDown:E}),[v,o,c,C]);let _;return _=d===Si.Menuitem?s.jsx(Gr,{...g,chips:n?.tags(),...R,children:l??n?.label(r,i)}):s.jsx(ii,{...g,...R}),(l||n?.label())&&((n.disabled()||c)&&(_=s.jsx("div",{children:_})),_=s.jsx(a0,{command:n,placement:d===Si.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:_})),_})),PA=u.memo(u.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=M2,label:i,variant:a=Si.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,j){c?.onError(L,T,j)}};return c?.beforeExecute&&(_.beforeExecute=c.beforeExecute),_},[c]),g=U3(n,h),m=()=>n?.state()?.toString()||"0",[y,x]=u.useState(m),v=Cn(()=>{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]),E=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(ql,{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]),C={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 R;return R=a===Si.Menuitem?s.jsxs(Gr,{...d,chips:n?.tags(),...C,children:[w,E]}):s.jsx(ii,{...d,...C}),n?.label()&&((n.disabled()||l)&&(R=s.jsx("div",{children:R})),R=s.jsx(a0,{command:n,placement:a===Si.Toolbar?"bottom-start":"right-start",children:R})),R})),Xn=u.memo(u.forwardRef((e,t)=>{const{variant:n=Si.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 j={onExecute(S,k){l?.onExecute?.(S,k),v.current||(x.current?.start({center:!1}),setTimeout(()=>x.current?.stop({}),180)),v.current=!1},onError(S,k,P){l?.onError(S,k,P)}};return l?.beforeExecute&&(j.beforeExecute=l.beforeExecute),j},[l]),w=q3(i,[o],null,[o]),E=w[0],{label:C,icon:R}=u.useMemo(()=>{let j=null;d&&(j=typeof d=="function"?d(E):d),j||(j=E?.label?.(m));let S=null;return p&&(S=typeof p=="function"?p(E):p),S||(S=E?.icon?.()),{label:j,icon:S}},[w,d,p]),_={disabled:c,scope:m,touchRippleRef:x,onQuickClick:r,tooltip:h,label:C,icon:R};(C||h)&&(_.createTooltip=({children:j},S)=>s.jsx(br,{label:C,description:h,disabled:S,children:j}));const L=Cn(j=>f?.(j,i),[f,w]),T=Cn(j=>E?.execute(a,b),[E]);return E?(_.quickButtonProps={},_.quickButtonProps.createTooltip=({children:j,placement:S},k)=>s.jsx(a0,{command:E,placement:S??n===Si.Toolbar?"bottom-start":"right-start",disabled:k,children:j}),_.disabled=_.disabled??E?.disabled(),r||(_.onQuickClick=T)):o&&(_.onQuickClick=()=>{}),_.selected=g??E?.state(),_.createPopupPanel=L,n===Si.Toolbar?s.jsx(Ui,{...y,..._,ref:t}):s.jsx(C1,{...y,..._,ref:t})}));Xn.displayName="CommandPopupButton";const Gs=e=>{const{command:t,label:n,scope:o,icon:r=s.jsx(j3,{}),sx:i,...a}=e;return s.jsxs(Le,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:l=>l.typography.subtitle2.fontSize,...i},...a,children:[r?ze(r):null,s.jsx(Mn,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:l=>l.spacing(.25),paddingRight:l=>l.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},E1=u.memo(u.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:l,...c}=e,d=E2(t,()=>({}),[]),[p,f]=u.useState(null),{reference:h}=pa({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,j)=>_?.beforeExecute?.(T,j)!==!1&&h.closeAll(),onExecute(T,j){_?.onExecute?.(T,j),g()},onError(T,j,S){_?.onError?.(T,j,S)}},...L}},[h,r]),x=u.useMemo(()=>({...m,...y}),[m,y]),[v,b]=u.useReducer(_=>_+1,0);q3(o,[],{onChange:()=>{b()}});const w=u.useMemo(()=>({commands:o,parentFloat:h,...y}),[v,x,h,r]);let E=0;m.dense||(E+=2),m.outlined&&E++;let C=2;m.dense||(C=4);const R=u.useMemo(()=>a({commands:o,commandButtonProps:x,commandPopupProps:{commands:o,...w,...r}}),[v,x,w,a]);return s.jsx(Dj,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${C}px`,paddingBottom:`${C}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:`${C}px`,columnGap:`${E}px`,alignItems:"center",maxWidth:"100%"},children:R})})}));E1.displayName="CommandToolbar";const OA=e=>{const{key:t,...n}=e;return s.jsx(qe,{...n},t)},sa=u.memo(u.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o,scope:r,commands:i,icon:a,quickCommand:l,popupScope:c=l,commandState:d,commandHook:p,disabled:f=!1,...h}=e;q3(i,[l,...n]);const g=u.useCallback((m,y)=>{const x={variant:Si.Menuitem,commandHook:p,commandState:d,icon:a,scope:c,disabled:f},v=[];for(let b=0;b<n?.length;b++){const w=n[b];if(w===null||w==="-"){v.push(s.jsx(Ft,{orientation:"horizontal"},`element-${v.length}`));continue}const E=y.getCommand(w),C={key:`${w}-${v.length}`,command:E,...x},R=o?.(C)??OA(C);R&&v.push(R)}return Bn({...m,children:v})},[f,p,d,c,n,a,o]);return s.jsx(Xn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:d,scope:r,quickCommand:l,icon:a,createPopupPanel:g,...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(sR,{}))),g.set("formatAlignJustifyToggle",ze(s.jsx(yc,{}))),g.set("formatAlignCenterContinuousToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignFillToggle",ze(s.jsx(yc,{}))),g.set("formatAlignDistributedHorizontalToggle",ze(s.jsx(yc,{}))),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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...y,command:m.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...y,command:m.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=s.jsxs(Le,{sx:{className:Eo("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[s.jsx(qe,{command:m.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(PO,{}))}),s.jsx(qe,{command:m.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(IO,{}))})]}),b=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{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(NO,{}))),f.set("formatAlignMiddleToggle",ze(s.jsx($O,{}))),f.set("formatAlignBottomToggle",ze(s.jsx(U7,{}))),f.set("formatAlignJustifyVerticalToggle",ze(s.jsx(yc,{}))),f.set("formatAlignDistributedVerticalToggle",ze(s.jsx(yc,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),s.jsx(qe,{...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(_I,{}))),f.set("formatTextOverflowClipToggle",ze(s.jsx(jI,{}))),f.set("formatTextOverflowShrinkToggle",ze(s.jsx(RI,{}))),f},[]),p=_e((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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(()=>{for(let h=0;h<l.length;h++)if(l[h]?.state())return l[h].key();return l[1]?.key()},[l]),d=u.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ze(s.jsx(dd,{}))),h.set("formatTextRotate315",ze(s.jsx(dd,{}))),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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},y=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...m,command:g.getCommand("formatTextRotate0"),icon:ze(s.jsx(BO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate315"),icon:ze(s.jsx(dd,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate45"),icon:ze(s.jsx($7,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate90"),icon:ze(s.jsx(V7,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate270"),icon:ze(s.jsx(H7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(PA,{...m,command:g.getCommand("formatTextRotateCustom"),icon:ze(s.jsx(W7,{})),label:"Custom"})]});return Bn({...h,children:y})},[i,o,r]),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(dd,{})),...a})}));function Nl(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 Ya="$$material";var ys=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 Ca(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(G.isValidElement(e)||Qv.isValidElementType(e)||!Ca(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 Ca(e)&&Ca(t)&&Object.keys(t).forEach(r=>{G.isValidElement(t[r])||Qv.isValidElementType(t[r])?o[r]=t[r]:Ca(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&Ca(e[r])?o[r]=ai(e[r],t[r],n):n.clone?o[r]=Ca(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 tl(e){if(e.type)return e;if(e.charAt(0)==="#")return tl(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(Nl(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(Nl(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const rc=(e,t)=>{try{return(n=>{const o=tl(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function _2(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=tl(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])),_2({type:l,values:c})}function Ch(e){let t=(e=tl(e)).type==="hsl"||e.type==="hsla"?tl(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 fd(e,t,n){try{return function(o,r){return o=tl(o),r=rf(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,_2(o)}(e,t)}catch{return e}}function af(e,t){if(e=tl(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 _2(e)}function po(e,t,n){try{return af(e,t)}catch{return e}}function lf(e,t){if(e=tl(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 _2(e)}function ho(e,t,n){try{return lf(e,t)}catch{return e}}function md(e,t,n){try{return function(o,r=.15){return Ch(o)>.5?af(o,r):lf(o,r)}(e,t)}catch{return e}}const Gc={black:"#000",white:"#fff"},DA={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:Gc.white,default:Gc.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 AA=nw();function ow(){return{text:{primary:Gc.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:Gc.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=Ch(y),b=Ch(x);return(Math.max(v,b)+.05)/(Math.min(v,b)+.05)}(m,G8.text.primary)>=n?G8.text.primary:AA.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(Nl(11,y?` (${y})`:"",x));if(typeof m.main!="string")throw new Error(Nl(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:{...Gc},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:DA,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...g},r)}var X8,Y8,Bp,J8,Q8,e9={exports:{}};function LA(){if(J8)return Bp;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,Bp=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},Bp}function Zc(){return Q8||(Q8=1,e9.exports=LA()()),e9.exports}function Cc(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 j2={xs:0,sm:600,md:900,lg:1200,xl:1536},n9={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${j2[e]}px)`},zA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:j2[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ja(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:zA,a);d&&(i[d]=n(t[a],a))}else if(Object.keys(r.values||j2).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(Nl(7));return e.charAt(0).toUpperCase()+e.slice(1)}function R2(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 Au(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:R2(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=R2(a.theme,o)||{};return ja(a,l,d=>{let p=Au(c,r,d);return d===p&&typeof d=="string"&&(p=Au(c,r,`${t}${d==="default"?"":rw(d)}`,d)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const FA={m:"margin",p:"padding"},BA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},r9={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},NA=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=FA[o],a=BA[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 M1(e,t,n,o){const r=R2(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 M1(e,"spacing",8)}function T1(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]=T1(p,f),h),{})}(NA(a),l);return ja(r,r[a],c)}(e,t,o,n)).reduce(Cc,{})}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 $A={borderRadius:4};function Lu(...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]?Cc(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function vi(e){return typeof e!="number"?e:`${e}px solid`}function Pi(e,t){return qo({prop:e,themeKey:"borders",transform:t})}const VA=Pi("border",vi),HA=Pi("borderTop",vi),WA=Pi("borderRight",vi),UA=Pi("borderBottom",vi),qA=Pi("borderLeft",vi),KA=Pi("borderColor"),GA=Pi("borderTopColor"),ZA=Pi("borderRightColor"),XA=Pi("borderBottomColor"),YA=Pi("borderLeftColor"),JA=Pi("outline",vi),QA=Pi("outlineColor"),Xd=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=M1(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:T1(t,o)});return ja(e,e.borderRadius,n)}return null};Xd.propTypes={},Xd.filterProps=["borderRadius"],Lu(VA,HA,WA,UA,qA,KA,GA,ZA,XA,YA,Xd,JA,QA);const zu=e=>{if(e.gap!==void 0&&e.gap!==null){const t=M1(e.theme,"spacing",8),n=o=>({gap:T1(t,o)});return ja(e,e.gap,n)}return null};zu.propTypes={},zu.filterProps=["gap"];const Fu=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=M1(e.theme,"spacing",8),n=o=>({columnGap:T1(t,o)});return ja(e,e.columnGap,n)}return null};Fu.propTypes={},Fu.filterProps=["columnGap"];const Yd=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=M1(e.theme,"spacing",8),n=o=>({rowGap:T1(t,o)});return ja(e,e.rowGap,n)}return null};function js(e,t){return t==="grey"?t:e}function ti(e){return e<=1&&e!==0?100*e+"%":e}Yd.propTypes={},Yd.filterProps=["rowGap"],Lu(zu,Fu,Yd,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"})),Lu(qo({prop:"color",themeKey:"palette",transform:js}),qo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:js}),qo({prop:"backgroundColor",themeKey:"palette",transform:js}));const eL=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]||j2[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ti(n)}};return ja(e,e.maxWidth,t)}return null};df.filterProps=["maxWidth"];const tL=qo({prop:"minWidth",transform:ti}),nL=qo({prop:"height",transform:ti}),oL=qo({prop:"maxHeight",transform:ti}),rL=qo({prop:"minHeight",transform:ti});qo({prop:"size",cssProperty:"width",transform:ti}),qo({prop:"size",cssProperty:"height",transform:ti}),Lu(eL,df,tL,nL,oL,rL,qo({prop:"boxSizing"}));const I2={border:{themeKey:"borders",transform:vi},borderTop:{themeKey:"borders",transform:vi},borderRight:{themeKey:"borders",transform:vi},borderBottom:{themeKey:"borders",transform:vi},borderLeft:{themeKey:"borders",transform:vi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:vi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Xd},color:{themeKey:"palette",transform:js},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:js},backgroundColor:{themeKey:"palette",transform:js},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:zu},rowGap:{style:Yd},columnGap:{style:Fu},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"}},l0=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=R2(o,c)||{};return p?p(i):ja(i,n,h=>{let g=Au(f,d,h);return h===g&&typeof h=="string"&&(g=Au(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??I2;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=Cc(h,e(g,m,r,a));else{const x=ja({theme:r},m,v=>({[g]:v}));(function(...v){const b=v.reduce((E,C)=>E.concat(Object.keys(C)),[]),w=new Set(b);return v.every(E=>w.size===Object.keys(E).length)})(x,m)?h[g]=t({sx:m,theme:r,nested:!0}):h=Cc(h,x)}else h=Cc(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 iL(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 E=Object.keys(w).map(C=>({key:C,val:w[C]}))||[];return E.sort((C,R)=>C.val-R.val),E.reduce((C,R)=>({...C,[R.key]:R.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,E){const C=y.indexOf(E);return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f}) and (max-width:${(C!==-1&&typeof p[y[C]]=="number"?p[y[C]]:E)-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 E=y.indexOf(w);return E===0?x(y[1]):E===y.length-1?v(y[E]):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:{...$A,...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=iL,c=t.reduce((d,p)=>ai(d,p),c),c.unstable_sxConfig={...I2,...a?.unstable_sxConfig},c.unstable_sx=function(d){return l0({sx:d,theme:this})},c}l0.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 Np(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 aL(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,E)=>{return{fontFamily:n,fontWeight:x,fontSize:g(v),lineHeight:b,...n===l9?{letterSpacing:(C=w/v,Math.round(1e5*C)/1e5+"em")}:{},...E,...d};var C},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 lL=["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)],sL={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)"},cL={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function s9(e){return`${Math.round(e)}ms`}function dL(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function uL(e){const t={...sL,...e.easing},n={...cL,...e.duration};return{getAutoHeightDuration:dL,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 pL={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function hL(e){return Ca(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];!hL(l)||a.startsWith("unstable_")?delete o[a]:Ca(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=Iu(),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 Aa;g8=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.browserPrefixToKey=p,Aa.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Aa.default=void 0,Aa.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 Aa.default=d(),Aa}());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,Yi={};function b8(){if(x8)return Yi;x8=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},Yi.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},Yi.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}},Yi.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}},Yi.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]},Yi.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)},Yi.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Iu(),t=bh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return Yi}var v8,w8,S8,C8,L0={},zp={};function k8(){return v8||(v8=1,Object.defineProperty(zp,"__esModule",{value:!0}),zp.default=function(){}),zp}var hA=function(){if(C8)return A0.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,E,C={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return C;if(w=v){if(w.has(b))return w.get(b);w.set(b,C)}for(const R in b)R!=="default"&&{}.hasOwnProperty.call(b,R)&&((E=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,R))&&(E.get||E.set)?w(C,R,E):C[R]=b[R]);return C}(x)}(u),r=h(eh()),i=h(yo),a=function(){if(h8)return hd.exports;function x(b){var w,E,C="";if(typeof b=="string"||typeof b=="number")C+=b;else if(typeof b=="object")if(Array.isArray(b)){var R=b.length;for(w=0;w<R;w++)b[w]&&(E=x(b[w]))&&(C&&(C+=" "),C+=E)}else for(E in b)b[E]&&(C&&(C+=" "),C+=E);return C}function v(){for(var b,w,E=0,C="",R=arguments.length;E<R;E++)(b=arguments[E])&&(w=x(b))&&(C&&(C+=" "),C+=w);return C}return h8=1,hd.exports=v,hd.exports.clsx=v,hd.exports}(),l=bh(),c=b8(),d=Iu(),p=h(function(){if(w8)return L0;w8=1,Object.defineProperty(L0,"__esModule",{value:!0}),L0.default=void 0;var x=function(P){if(typeof WeakMap=="function")var O=new WeakMap;return function(I){if(I&&I.__esModule)return I;var z,A,D={__proto__:null,default:I};if(I===null||typeof I!="object"&&typeof I!="function")return D;if(z=O){if(z.has(I))return z.get(I);z.set(I,D)}for(const F in I)F!=="default"&&{}.hasOwnProperty.call(I,F)&&((A=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(I,F))&&(A.get||A.set)?z(D,F,A):D[F]=I[F]);return D}(P)}(u),v=_(eh()),b=_(yo),w=bh(),E=b8(),C=Iu(),R=_(k8());function _(P){return P&&P.__esModule?P:{default:P}}function L(P,O,I){return(O=typeof(z=function(A){if(typeof A!="object"||!A)return A;var D=A[Symbol.toPrimitive];if(D!==void 0){var F=D.call(A,"string");if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(O))=="symbol"?z:z+"")in P?Object.defineProperty(P,O,{value:I,enumerable:!0,configurable:!0,writable:!0}):P[O]=I,P;var z}const T={start:"touchstart",move:"touchmove",stop:"touchend"},j={start:"mousedown",move:"mousemove",stop:"mouseup"};let S=j,k=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",P=>{if(this.props.onMouseDown(P),!this.props.allowAnyClick&&typeof P.button=="number"&&P.button!==0)return!1;const O=this.findDOMNode();if(!O||!O.ownerDocument||!O.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:I}=O;if(this.props.disabled||!(P.target instanceof I.defaultView.Node)||this.props.handle&&!(0,w.matchesSelectorAndParentsTo)(P.target,this.props.handle,O)||this.props.cancel&&(0,w.matchesSelectorAndParentsTo)(P.target,this.props.cancel,O))return;P.type!=="touchstart"||this.props.allowMobileScroll||P.preventDefault();const z=(0,w.getTouchIdentifier)(P);this.touchIdentifier=z;const A=(0,E.getControlPosition)(P,z,this);if(A==null)return;const{x:D,y:F}=A,B=(0,E.createCoreData)(this,D,F);(0,R.default)("DraggableCore: handleDragStart: %j",B),(0,R.default)("calling",this.props.onStart),this.props.onStart(P,B)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,w.addUserSelectStyles)(I),this.dragging=!0,this.lastX=D,this.lastY=F,(0,w.addEvent)(I,S.move,this.handleDrag),(0,w.addEvent)(I,S.stop,this.handleDragStop))}),L(this,"handleDrag",P=>{const O=(0,E.getControlPosition)(P,this.touchIdentifier,this);if(O==null)return;let{x:I,y:z}=O;if(Array.isArray(this.props.grid)){let D=I-this.lastX,F=z-this.lastY;if([D,F]=(0,E.snapToGrid)(this.props.grid,D,F),!D&&!F)return;I=this.lastX+D,z=this.lastY+F}const A=(0,E.createCoreData)(this,I,z);if((0,R.default)("DraggableCore: handleDrag: %j",A),this.props.onDrag(P,A)!==!1&&this.mounted!==!1)this.lastX=I,this.lastY=z;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const D=document.createEvent("MouseEvents");D.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(D)}}),L(this,"handleDragStop",P=>{if(!this.dragging)return;const O=(0,E.getControlPosition)(P,this.touchIdentifier,this);if(O==null)return;let{x:I,y:z}=O;if(Array.isArray(this.props.grid)){let F=I-this.lastX||0,B=z-this.lastY||0;[F,B]=(0,E.snapToGrid)(this.props.grid,F,B),I=this.lastX+F,z=this.lastY+B}const A=(0,E.createCoreData)(this,I,z);if(this.props.onStop(P,A)===!1||this.mounted===!1)return!1;const D=this.findDOMNode();D&&this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(D.ownerDocument),(0,R.default)("DraggableCore: handleDragStop: %j",A),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,D&&((0,R.default)("DraggableCore: Removing handlers"),(0,w.removeEvent)(D.ownerDocument,S.move,this.handleDrag),(0,w.removeEvent)(D.ownerDocument,S.stop,this.handleDragStop))}),L(this,"onMouseDown",P=>(S=j,this.handleDragStart(P))),L(this,"onMouseUp",P=>(S=j,this.handleDragStop(P))),L(this,"onTouchStart",P=>(S=T,this.handleDragStart(P))),L(this,"onTouchEnd",P=>(S=T,this.handleDragStop(P)))}componentDidMount(){this.mounted=!0;const P=this.findDOMNode();P&&(0,w.addEvent)(P,T.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const P=this.findDOMNode();if(P){const{ownerDocument:O}=P;(0,w.removeEvent)(O,j.move,this.handleDrag),(0,w.removeEvent)(O,T.move,this.handleDrag),(0,w.removeEvent)(O,j.stop,this.handleDragStop),(0,w.removeEvent)(O,T.stop,this.handleDragStop),(0,w.removeEvent)(P,T.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,w.scheduleRemoveUserSelectStyles)(O)}}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 L0.default=k,L(k,"displayName","DraggableCore"),L(k,"propTypes",{allowAnyClick:v.default.bool,allowMobileScroll:v.default.bool,children:v.default.node.isRequired,disabled:v.default.bool,enableUserSelectHack:v.default.bool,offsetParent:function(P,O){if(P[O]&&P[O].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:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),L(k,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),L0}()),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(E){if(typeof E!="object"||!E)return E;var C=E[Symbol.toPrimitive];if(C!==void 0){var R=C.call(E,"string");if(typeof R!="object")return R;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(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:E}=b;return!w||E&&w.x===E.x&&w.y===E.y?null:((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:w,prevPropsPosition:E}),{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 E=(0,c.createDraggableData)(this,w),C={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:_}=C;C.x+=this.state.slackX,C.y+=this.state.slackY;const[L,T]=(0,c.getBoundPosition)(this,C.x,C.y);C.x=L,C.y=T,C.slackX=this.state.slackX+(R-C.x),C.slackY=this.state.slackY+(_-C.y),E.x=C.x,E.y=C.y,E.deltaX=C.x-this.state.x,E.deltaY=C.y-this.state.y}if(this.props.onDrag(b,E)===!1)return!1;this.setState(C)}),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 E={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:C,y:R}=this.props.position;E.x=C,E.y=R}this.setState(E)}),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:E,defaultClassName:C,defaultClassNameDragging:R,defaultClassNameDragged:_,position:L,positionOffset:T,scale:j,...S}=this.props;let k={},P=null;const O=!L||this.state.dragging,I=L||E,z={x:(0,c.canDragX)(this)&&O?this.state.x:I.x,y:(0,c.canDragY)(this)&&O?this.state.y:I.y};this.state.isElementSVG?P=(0,l.createSVGTransform)(z,T):k=(0,l.createCSSTransform)(z,T);const A=(0,a.clsx)(w.props.className||"",C,{[R]:this.state.dragging,[_]:this.state.dragged});return o.createElement(p.default,g({},S,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),o.cloneElement(o.Children.only(w),{className:A,style:{...w.props.style,...k},transform:P}))}}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 A0.exports=e,A0.exports.default=e,A0.exports.DraggableCore=t,A0.exports}();const fA=jb(hA),E8={x:0,y:0},mA=u.memo(u.forwardRef((e,t)=>{const{defaultPosition:n=E8,PaperComponent:o=Mi,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(fA,{nodeRef:p,handle:a,cancel:'[class*="MuiDialogContent-root"]',position:m,bounds:f??".MuiModal-root",onStop:r,onStart:(b,w)=>{const E=b;v({x:(E.clientX??E.touches?.[0]?.clientX)-w.x,y:(E.clientY??E.touches?.[0]?.clientY)-w.y})},onDrag:(b,w)=>{const E=b,C=E.clientX??E.touches?.[0]?.clientX,R=E.clientY??E.touches?.[0]?.clientY;g({x:C-x.x,y:R-x.y})},children:s.jsx(o,{ref:G3([p,t]),...d})})})),gA={x:"50",y:"50"},Lv=u.memo(e=>{const t=function({props:le,name:ee}){return function({props:Pe,name:Te,defaultTheme:rt,themeId:Ve}){let Ee=function(Re=iP){return function(Xe=null){const Be=G.useContext(Qs);return Be&&(ct=Be,Object.keys(ct).length!==0)?Be:Xe;var ct}(Re)}(rt);return Ee=Ee[Ve]||Ee,xP({theme:Ee,name:Te,props:Pe})}({props:le,name:ee,defaultTheme:F3,themeId:R3})}({props:e,name:"MuiDialog"}),n=B3(),o={enter:.66*n.transitions.duration.enteringScreen,exit:.66*n.transitions.duration.leavingScreen},{title:r="SheetXL",key:i="draggable-window",onCancel:a,onDone:l,onShow:c,onShown:d,onHide:p,refWindow:f,open:h,autoFocusSel:g,children:m,TransitionComponent:y=Sx,TransitionProps:x,transitionDuration:v=o,BackdropComponent:b=Cx,BackdropProps:w,PaperComponent:E=Mi,PaperProps:C,onBackdropClick:R,sx:_,className:L,onMouseDown:T,initialPosition:j=gA,isModal:S=!1,...k}=t,P=u.useRef(null),[O,I]=u.useState(null),[z,A]=u.useState(!1),[D,F]=u.useState(!1),B=u.useRef(null),[M,N]=Y7(),V=u.useRef(null),[U,J]=Y7(),X=u.useRef(null);u.useEffect(()=>{O&&A(h)},[h,O]);const H=Cn(()=>{a?.(),A(!1)},[a]);u.useEffect(()=>{if(N.width===0&&N.height===0||O)return;const le=X.current?.getBoundingClientRect(),ee=N.height-le.height,Pe=N.width-le.width;let Te=.5*Pe,rt=.5*ee;typeof j?.x=="number"?Te=j.x:typeof j?.x=="string"&&(Te=Pe*(parseFloat(j.x)/100)),typeof j?.y=="number"?rt=j.y:typeof j?.y=="string"&&(rt=ee*(parseFloat(j.y)/100)),I({x:Te,y:rt})},[N,J]);const[ne,oe]=u.useState(!1),[ye,de]=u.useState(null),[xe,we]=u.useState(null),ve=Cn(le=>{if(ye)return ye.focus(le),!0;if(g){const ee=V.current?.querySelectorAll?.(g);if(ee&&ee.length>0)return ee[0]?.focus?.(le),!0}return V.current?.focus?.(le),!1},[ye,g]),re=E2(f,()=>({focus:le=>{ve(le)}}),[]),ce={...x,onExited:le=>{l?.(null),x?.onExited?.(le)},onExit:le=>{const ee=xe;ee&&requestAnimationFrame(()=>{re.current?.contains(document.activeElement)&&ee.focus()}),p?.(),F(!1),x?.onExit?.(le)},onEntered:(le,ee)=>{c?.(),x?.onEntered?.(le,ee)},onEntering:(le,ee)=>{F(!0),d?.(re.current)}};u.useEffect(()=>{D&&ve()},[D]);const Se=s.jsx(pA,{focusTrapOptions:{escapeDeactivates:!1,allowOutsideClick:!0,initialFocus:!1},ref:P,active:D,children:s.jsx(y,{in:z,timeout:v,role:"presentation",...ce,children:s.jsx(Le,{className:"MuiDialog-container",ref:V,tabIndex:0,sx:{outline:"none",position:"relative"},onKeyDown:le=>{le.which===xr.Escape&&(H(),B.current?.start(le,{center:!1}),setTimeout(()=>B.current?.stop(le),180)),le.stopPropagation()},children:s.jsxs(mA,{className:rr({"Mui-focusVisible":ne},L),sx:{"& *":le=>Y3(le),pointerEvents:"auto",userSelect:"none","&:hover:not([disabled]):not(.Mui-focusVisible)":{outline:le=>`solid ${pt(le.palette.text?.primary,.2)} 1px`},"&.Mui-focusVisible":{outline:le=>`solid ${pt(le.palette.text?.primary,.2)} 1px`},position:"absolute",maxWidth:"100%",..._},defaultPosition:O,ref:X,titleSize:J,rootSize:N,PaperComponent:E,...k,...C,children:[r?s.jsx(Mx,{className:rr({"Mui-selected":ne},"draggable-title"),sx:{cursor:"move",display:"flex",color:le=>le.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:le=>`${le.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:le=>le.transitions.duration.shortest/2+"ms"},backgroundColor:le=>pt(le.palette.action.hover,.03)},ref:U,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:le=>le.spacing(1),marginLeft:le=>le.spacing(1),marginRight:le=>le.spacing(1)},children:[s.jsx(Le,{sx:{flex:"1 1 100%",paddingLeft:le=>le.spacing(1)},children:r}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:le=>le.palette.text.icon??le.palette.action.active},touchRippleRef:B,onPointerDown:le=>{B.current?.start(le,{center:!1}),le.stopPropagation(),le.preventDefault()},onPointerUp:H,children:s.jsx(E3,{})})})]})}):null,m]})})})});let ie=null;S&&(ie=s.jsx(b,{...w,open:z,onMouseDown:le=>{H(),w?.onMouseDown?.(le)},onClick:le=>{R?.(le),w?.onClick?.(le)},sx:{pointerEvents:"auto",...w?.sx}}));const{getPortalContainer:Y}=W3();return yo.createPortal(s.jsxs(Le,{className:"MuiModal-root",sx:{position:"fixed",zIndex:"1300",right:"0",bottom:"0",top:"0",left:"0",outline:"0",display:"block",pointerEvents:"none"},ref:G3([re,M]),onPointerDown:le=>{ne&&(le.target===V.current||le.target.tabIndex<0)&&V.current?.contains(document.activeElement)},onContextMenu:le=>{le.isPropagationStopped()||le.preventDefault()},onFocus:le=>{!ne&&(le.target===V.current||le.target.tabIndex<0)&&setTimeout(()=>{ve()},100),P.current?.focusTrap?.unpause(),oe(!0),V.current?.contains(le.target)&&le.target!==V.current&&de(le.target),le.relatedTarget&&!xe&&we(le.relatedTarget)},onBlur:le=>{re?.current?.contains(le.relatedTarget)||(we(null),P.current?.focusTrap?.pause(),oe(!1))},children:[ie,Se]}),Y(),i+"")});var Ei=typeof window<"u"?window:{screen:{},navigator:{}},Ks=(Ei.matchMedia||function(){return{matches:!1}}).bind(Ei),yA={get passive(){return!0}},M8=function(){};Ei.addEventListener&&Ei.addEventListener("p",M8,yA),Ei.removeEventListener&&Ei.removeEventListener("p",M8,!1);var Q3="ontouchstart"in Ei,xA=Q3||"TouchEvent"in Ei&&Ks("(any-pointer: coarse)").matches,T8=(Ei.navigator.maxTouchPoints||0)>0||xA,zv=Ei.navigator.userAgent||"",bA=Ks("(pointer: coarse)").matches&&/iPad|Macintosh/.test(zv)&&Math.min(Ei.screen.width||0,Ei.screen.height||0)>=768,Fv=(Ks("(pointer: coarse)").matches||!Ks("(pointer: fine)").matches&&Q3)&&!/Windows.*Firefox/.test(zv),vA=Ks("(any-pointer: fine)").matches||Ks("(any-hover: hover)").matches||bA||!Q3,_8=!T8||!vA&&Fv?T8?"touchOnly":"mouseOnly":"hybrid",wA=_8==="mouseOnly"?"mouse":_8==="touchOnly"||Fv?"touch":"mouse",wc=e=>e.type==="checkbox",kl=e=>e instanceof Date,Lr=e=>e==null;const Bv=e=>typeof e=="object";var Zo=e=>!Lr(e)&&!Array.isArray(e)&&Bv(e)&&!kl(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 T2=e=>/^\w*$/.test(e),Jo=e=>e===void 0,vh=e=>Array.isArray(e)?e.filter(Boolean):[],tf=e=>vh(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Gt=(e,t,n)=>{if(!t||!Zo(e))return n;const o=(T2(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},na=e=>typeof e=="boolean",xo=(e,t,n)=>{let o=-1;const r=T2(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",nc="all",j8="pattern",R8="required",Vv=u.createContext(null);Vv.displayName="HookFormContext";const SA=e=>{const{children:t,...n}=e;return u.createElement(Vv.Provider,{value:n},t)},CA=typeof window<"u"?G.useLayoutEffect:G.useEffect;var la=e=>typeof e=="string",kA=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},oc=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=[]}}},wh=e=>Lr(e)||!Bv(e);function Ua(e,t){if(wh(e)||wh(t))return e===t;if(kl(e)&&kl(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(kl(i)&&kl(a)||Zo(i)&&Zo(a)||Array.isArray(i)&&Array.isArray(a)?!Ua(i,a):i!==a)return!1}}return!0}var $r=e=>Zo(e)&&!Object.keys(e).length,nf=e=>e.type==="file",Ni=e=>typeof e=="function",Pu=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",Fp=e=>Pu(e)&&e.isConnected;function nr(e,t){const n=Array.isArray(t)?t:T2(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(Ni(e[t]))return!0;return!1};function Ou(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])?[]:{},Ou(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)||wh(n[r])?n[r]=Array.isArray(e[r])?Ou(e[r],[]):{...Ou(e[r])}:Uv(e[r],Lr(t)?{}:t[r],n[r]):n[r]=!Ua(e[r],t[r]);return n}var z0=(e,t)=>Uv(e,t,Ou(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&&la(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):wc(t)?qv(e.refs).value:Kv(Jo(t.value)?e.ref.value:t.value,e)}var Du=e=>e instanceof RegExp,F0=e=>Jo(e)?e:Du(e)?e.source:Zo(e)?Du(e.value)?e.value.source:e.value:e,L8=e=>({isOnSubmit:!e||e===$v,isOnBlur:e==="onBlur",isOnChange:e===Nv,isOnAll:e===nc,isOnTouch:e==="onTouched"});const z8="AsyncFunction";var EA=e=>!!e&&!!e.validate&&!!(Ni(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 Sc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Gt(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(Sc(l,t))break}else if(Zo(l)&&Sc(l,t))break}}};function B8(e,t,n){const o=Gt(e,n);if(o||T2(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),a=Gt(t,i),l=Gt(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 MA=(e,t,n)=>{const o=oc(Gt(e,n));return xo(o,"root",t[n]),xo(e,n,o),e},Zd=e=>la(e);function N8(e,t,n="validate"){if(Zd(e)||Array.isArray(e)&&e.every(Zd)||na(e)&&!e)return{type:n,message:Zd(e)?e:"",ref:t}}var rs=e=>Zo(e)&&!Du(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=Gt(n,y);if(!v||t.has(y))return{};const w=l?l[0]:a,E=k=>{r&&w.reportValidity&&(w.setCustomValidity(na(k)?"":k||""),w.reportValidity())},C={},R=of(a),_=wc(a),L=R||_,T=(x||nf(a))&&Jo(a.value)&&Jo(b)||Pu(a)&&a.value===""||b===""||Array.isArray(b)&&!b.length,j=kA.bind(null,y,o,C),S=(k,P,O,I="maxLength",z="minLength")=>{const A=k?P:O;C[y]={type:k?I:z,message:A,ref:a,...j(k?I:z,A)}};if(i?!Array.isArray(b)||!b.length:c&&(!L&&(T||Lr(b))||na(b)&&!b||_&&!qv(l).isValid||R&&!Gv(l).isValid)){const{value:k,message:P}=Zd(c)?{value:!!c,message:c}:rs(c);if(k&&(C[y]={type:R8,message:P,ref:w,...j(R8,P)},!o))return E(P),C}if(!(T||Lr(f)&&Lr(h))){let k,P;const O=rs(h),I=rs(f);if(Lr(b)||isNaN(b)){const z=a.valueAsDate||new Date(b),A=B=>new Date(new Date().toDateString()+" "+B),D=a.type=="time",F=a.type=="week";la(O.value)&&b&&(k=D?A(b)>A(O.value):F?b>O.value:z>new Date(O.value)),la(I.value)&&b&&(P=D?A(b)<A(I.value):F?b<I.value:z<new Date(I.value))}else{const z=a.valueAsNumber||b&&+b;Lr(O.value)||(k=z>O.value),Lr(I.value)||(P=z<I.value)}if((k||P)&&(S(!!k,O.message,I.message,"max","min"),!o))return E(C[y].message),C}if((d||p)&&!T&&(la(b)||i&&Array.isArray(b))){const k=rs(d),P=rs(p),O=!Lr(k.value)&&b.length>+k.value,I=!Lr(P.value)&&b.length<+P.value;if((O||I)&&(S(O,k.message,P.message),!o))return E(C[y].message),C}if(g&&!T&&la(b)){const{value:k,message:P}=rs(g);if(Du(k)&&!b.match(k)&&(C[y]={type:j8,message:P,ref:a,...j(j8,P)},!o))return E(P),C}if(m){if(Ni(m)){const k=N8(await m(b,n),w);if(k&&(C[y]={...k,...j("validate",k.message)},!o))return E(k.message),C}else if(Zo(m)){let k={};for(const P in m){if(!$r(k)&&!o)break;const O=N8(await m[P](b,n),w,P);O&&(k={...O,...j(P,O.message)},E(O.message),o&&(C[y]=k))}if(!$r(k)&&(C[y]={ref:w,...k},!o))return C}}return E(!0),C};const TA={mode:$v,reValidateMode:Nv,shouldFocusError:!0},_A=["Ok","Cancel"],Sh=e=>{const{description:t,icon:n,onCancel:o,onOption:r,onDone:i,onValidateOption:a,createOptionsButton:l,options:c=_A,autoFocusSel:d=".defaultOption",defaultOption:p=c[0],cancelOption:f="Cancel",children:h,...g}=e,m=function(j={}){const S=u.useRef(void 0),k=u.useRef(void 0),[P,O]=u.useState({isDirty:!1,isValidating:!1,isLoading:Ni(j.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:j.errors||{},disabled:j.disabled||!1,isReady:!1,defaultValues:Ni(j.defaultValues)?void 0:j.defaultValues});if(!S.current)if(j.formControl)S.current={...j.formControl,formState:P},j.defaultValues&&!Ni(j.defaultValues)&&j.formControl.reset(j.defaultValues,j.resetOptions);else{const{formControl:z,...A}=function(D={}){let F={...TA,...D},B={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ni(F.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:F.errors||{},disabled:F.disabled||!1};const M={};let N,V=(Zo(F.defaultValues)||Zo(F.values))&&Cr(F.defaultValues||F.values)||{},U=F.shouldUnregister?{}:Cr(V),J={action:!1,mount:!1,watch:!1},X={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},H=0;const ne={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let oe={...ne};const ye={array:I8(),state:I8()},de=F.criteriaMode===nc,xe=async W=>{if(!F.disabled&&(ne.isValid||oe.isValid||W)){const Q=F.resolver?$r((await ce()).errors):await Se(M,!0);Q!==B.isValid&&ye.state.next({isValid:Q})}},we=(W,Q)=>{!F.disabled&&(ne.isValidating||ne.validatingFields||oe.isValidating||oe.validatingFields)&&((W||Array.from(X.mount)).forEach(K=>{K&&(Q?xo(B.validatingFields,K,Q):nr(B.validatingFields,K))}),ye.state.next({validatingFields:B.validatingFields,isValidating:!$r(B.validatingFields)}))},ve=(W,Q,K,se)=>{const te=Gt(M,W);if(te){const ae=Gt(U,W,Jo(K)?Gt(V,W):K);Jo(ae)||se&&se.defaultChecked||Q?xo(U,W,Q?ae:A8(te._f)):le(W,ae),J.mount&&xe()}},re=(W,Q,K,se,te)=>{let ae=!1,pe=!1;const me={name:W};if(!F.disabled){if(!K||se){(ne.isDirty||oe.isDirty)&&(pe=B.isDirty,B.isDirty=me.isDirty=ie(),ae=pe!==me.isDirty);const fe=Ua(Gt(V,W),Q);pe=!!Gt(B.dirtyFields,W),fe?nr(B.dirtyFields,W):xo(B.dirtyFields,W,!0),me.dirtyFields=B.dirtyFields,ae=ae||(ne.dirtyFields||oe.dirtyFields)&&pe!==!fe}if(K){const fe=Gt(B.touchedFields,W);fe||(xo(B.touchedFields,W,K),me.touchedFields=B.touchedFields,ae=ae||(ne.touchedFields||oe.touchedFields)&&fe!==K)}ae&&te&&ye.state.next(me)}return ae?me:{}},ce=async W=>{we(W,!0);const Q=await F.resolver(U,F.context,((K,se,te,ae)=>{const pe={};for(const me of K){const fe=Gt(se,me);fe&&xo(pe,me,fe._f)}return{criteriaMode:te,names:[...K],fields:pe,shouldUseNativeValidation:ae}})(W||X.mount,M,F.criteriaMode,F.shouldUseNativeValidation));return we(W),Q},Se=async(W,Q,K={valid:!0})=>{for(const se in W){const te=W[se];if(te){const{_f:ae,...pe}=te;if(ae){const me=X.array.has(ae.name),fe=te._f&&EA(te._f);fe&&ne.validatingFields&&we([se],!0);const je=await $8(te,X.disabled,U,de,F.shouldUseNativeValidation&&!Q,me);if(fe&&ne.validatingFields&&we([se]),je[ae.name]&&(K.valid=!1,Q))break;!Q&&(Gt(je,ae.name)?me?MA(B.errors,je,ae.name):xo(B.errors,ae.name,je[ae.name]):nr(B.errors,ae.name))}!$r(pe)&&await Se(pe,Q,K)}}return K.valid},ie=(W,Q)=>!F.disabled&&(W&&Q&&xo(U,W,Q),!Ua(Ee(),V)),Y=(W,Q,K)=>{return se=W,te=X,ae={...J.mount?U:Jo(Q)?V:la(W)?{[W]:Q}:Q},pe=K,me=Q,la(se)?(pe&&te.watch.add(se),Gt(ae,se,me)):Array.isArray(se)?se.map(fe=>(pe&&te.watch.add(fe),Gt(ae,fe))):(pe&&(te.watchAll=!0),ae);var se,te,ae,pe,me},le=(W,Q,K={})=>{const se=Gt(M,W);let te=Q;if(se){const ae=se._f;ae&&(!ae.disabled&&xo(U,W,Kv(Q,ae)),te=Pu(ae.ref)&&Lr(Q)?"":Q,Hv(ae.ref)?[...ae.ref.options].forEach(pe=>pe.selected=te.includes(pe.value)):ae.refs?wc(ae.ref)?ae.refs.forEach(pe=>{pe.defaultChecked&&pe.disabled||(Array.isArray(te)?pe.checked=!!te.find(me=>me===pe.value):pe.checked=te===pe.value||!!te)}):ae.refs.forEach(pe=>pe.checked=pe.value===te):nf(ae.ref)?ae.ref.value="":(ae.ref.value=te,ae.ref.type||ye.state.next({name:W,values:Cr(U)})))}(K.shouldDirty||K.shouldTouch)&&re(W,te,K.shouldTouch,K.shouldDirty,!0),K.shouldValidate&&Ve(W)},ee=(W,Q,K)=>{for(const se in Q){if(!Q.hasOwnProperty(se))return;const te=Q[se],ae=W+"."+se,pe=Gt(M,ae);(X.array.has(W)||Zo(te)||pe&&!pe._f)&&!kl(te)?ee(ae,te,K):le(ae,te,K)}},Pe=(W,Q,K={})=>{const se=Gt(M,W),te=X.array.has(W),ae=Cr(Q);xo(U,W,ae),te?(ye.array.next({name:W,values:Cr(U)}),(ne.isDirty||ne.dirtyFields||oe.isDirty||oe.dirtyFields)&&K.shouldDirty&&ye.state.next({name:W,dirtyFields:z0(V,U),isDirty:ie(W,ae)})):!se||se._f||Lr(ae)?le(W,ae,K):ee(W,ae,K),F8(W,X)&&ye.state.next({...B}),ye.state.next({name:J.mount?W:void 0,values:Cr(U)})},Te=async W=>{J.mount=!0;const Q=W.target;let K=Q.name,se=!0;const te=Gt(M,K),ae=Fe=>{se=Number.isNaN(Fe)||kl(Fe)&&isNaN(Fe.getTime())||Ua(Fe,Gt(U,K,Fe))},pe=L8(F.mode),me=L8(F.reValidateMode);if(te){let Fe,Ge;const et=Q.type?A8(te._f):Zo(je=W)&&je.target?wc(je.target)?je.target.checked:je.target.value:je,tt=W.type==="blur"||W.type==="focusout",it=!((fe=te._f).mount&&(fe.required||fe.min||fe.max||fe.maxLength||fe.minLength||fe.pattern||fe.validate)||F.resolver||Gt(B.errors,K)||te._f.deps)||(($t,nn,Zt,Tn,pn)=>!pn.isOnAll&&(!Zt&&pn.isOnTouch?!(nn||$t):(Zt?Tn.isOnBlur:pn.isOnBlur)?!$t:!(Zt?Tn.isOnChange:pn.isOnChange)||$t))(tt,Gt(B.touchedFields,K),B.isSubmitted,me,pe),At=F8(K,X,tt);xo(U,K,et),tt?(te._f.onBlur&&te._f.onBlur(W),N&&N(0)):te._f.onChange&&te._f.onChange(W);const Lt=re(K,et,tt),_t=!$r(Lt)||At;if(!tt&&ye.state.next({name:K,type:W.type,values:Cr(U)}),it)return(ne.isValid||oe.isValid)&&(F.mode==="onBlur"?tt&&xe():tt||xe()),_t&&ye.state.next({name:K,...At?{}:Lt});if(!tt&&At&&ye.state.next({...B}),F.resolver){const{errors:$t}=await ce([K]);if(ae(et),se){const nn=B8(B.errors,M,K),Zt=B8($t,M,nn.name||K);Fe=Zt.error,K=Zt.name,Ge=$r($t)}}else we([K],!0),Fe=(await $8(te,X.disabled,U,de,F.shouldUseNativeValidation))[K],we([K]),ae(et),se&&(Fe?Ge=!1:(ne.isValid||oe.isValid)&&(Ge=await Se(M,!0)));se&&(te._f.deps&&Ve(te._f.deps),(($t,nn,Zt,Tn)=>{const pn=Gt(B.errors,$t),En=(ne.isValid||oe.isValid)&&na(nn)&&B.isValid!==nn;var kt;if(F.delayError&&Zt?(kt=()=>{return on=$t,mn=Zt,xo(B.errors,on,mn),void ye.state.next({errors:B.errors});var on,mn},N=on=>{clearTimeout(H),H=setTimeout(kt,on)},N(F.delayError)):(clearTimeout(H),N=null,Zt?xo(B.errors,$t,Zt):nr(B.errors,$t)),(Zt?!Ua(pn,Zt):pn)||!$r(Tn)||En){const on={...Tn,...En&&na(nn)?{isValid:nn}:{},errors:B.errors,name:$t};B={...B,...on},ye.state.next(on)}})(K,Ge,Fe,Lt))}var fe,je},rt=(W,Q)=>{if(Gt(B.errors,Q)&&W.focus)return W.focus(),1},Ve=async(W,Q={})=>{let K,se;const te=oc(W);if(F.resolver){const ae=await(async pe=>{const{errors:me}=await ce(pe);if(pe)for(const fe of pe){const je=Gt(me,fe);je?xo(B.errors,fe,je):nr(B.errors,fe)}else B.errors=me;return me})(Jo(W)?W:te);K=$r(ae),se=W?!te.some(pe=>Gt(ae,pe)):K}else W?(se=(await Promise.all(te.map(async ae=>{const pe=Gt(M,ae);return await Se(pe&&pe._f?{[ae]:pe}:pe)}))).every(Boolean),(se||B.isValid)&&xe()):se=K=await Se(M);return ye.state.next({...!la(W)||(ne.isValid||oe.isValid)&&K!==B.isValid?{}:{name:W},...F.resolver||!W?{isValid:K}:{},errors:B.errors}),Q.shouldFocus&&!se&&Sc(M,rt,W?te:X.mount),se},Ee=W=>{const Q={...J.mount?U:V};return Jo(W)?Q:la(W)?Gt(Q,W):W.map(K=>Gt(Q,K))},Re=(W,Q)=>({invalid:!!Gt((Q||B).errors,W),isDirty:!!Gt((Q||B).dirtyFields,W),error:Gt((Q||B).errors,W),isValidating:!!Gt(B.validatingFields,W),isTouched:!!Gt((Q||B).touchedFields,W)}),Xe=(W,Q,K)=>{const se=(Gt(M,W,{_f:{}})._f||{}).ref,te=Gt(B.errors,W)||{},{ref:ae,message:pe,type:me,...fe}=te;xo(B.errors,W,{...fe,...Q,ref:se}),ye.state.next({name:W,errors:B.errors,isValid:!1}),K&&K.shouldFocus&&se&&se.focus&&se.focus()},Be=W=>ye.state.subscribe({next:Q=>{var K,se,te;K=W.name,se=Q.name,te=W.exact,K&&se&&K!==se&&!oc(K).some(ae=>ae&&(te?ae===se:ae.startsWith(se)||se.startsWith(ae)))||!((ae,pe,me,fe)=>{me(ae);const{name:je,...Fe}=ae;return $r(Fe)||Object.keys(Fe).length>=Object.keys(pe).length||Object.keys(Fe).find(Ge=>pe[Ge]===(!fe||nc))})(Q,W.formState||ne,De,W.reRenderRoot)||W.callback({values:{...U},...B,...Q})}}).unsubscribe,ct=(W,Q={})=>{for(const K of W?oc(W):X.mount)X.mount.delete(K),X.array.delete(K),Q.keepValue||(nr(M,K),nr(U,K)),!Q.keepError&&nr(B.errors,K),!Q.keepDirty&&nr(B.dirtyFields,K),!Q.keepTouched&&nr(B.touchedFields,K),!Q.keepIsValidating&&nr(B.validatingFields,K),!F.shouldUnregister&&!Q.keepDefaultValue&&nr(V,K);ye.state.next({values:Cr(U)}),ye.state.next({...B,...Q.keepDirty?{isDirty:ie()}:{}}),!Q.keepIsValid&&xe()},Qe=({disabled:W,name:Q})=>{(na(W)&&J.mount||W||X.disabled.has(Q))&&(W?X.disabled.add(Q):X.disabled.delete(Q))},he=(W,Q={})=>{let K=Gt(M,W);const se=na(Q.disabled)||na(F.disabled);return xo(M,W,{...K||{},_f:{...K&&K._f?K._f:{ref:{name:W}},name:W,mount:!0,...Q}}),X.mount.add(W),K?Qe({disabled:na(Q.disabled)?Q.disabled:F.disabled,name:W}):ve(W,!0,Q.value),{...se?{disabled:Q.disabled||F.disabled}:{},...F.progressive?{required:!!Q.required,min:F0(Q.min),max:F0(Q.max),minLength:F0(Q.minLength),maxLength:F0(Q.maxLength),pattern:F0(Q.pattern)}:{},name:W,onChange:Te,onBlur:Te,ref:te=>{if(te){he(W,Q),K=Gt(M,W);const je=Jo(te.value)&&te.querySelectorAll&&te.querySelectorAll("input,select,textarea")[0]||te,Fe=of(fe=je)||wc(fe),Ge=K._f.refs||[];if(Fe?Ge.find(et=>et===je):je===K._f.ref)return;xo(M,W,{_f:{...K._f,...Fe?{refs:[...Ge.filter(Fp),je,...Array.isArray(Gt(V,W))?[{}]:[]],ref:{type:je.type,name:W}}:{ref:je}}}),ve(W,!1,void 0,je)}else K=Gt(M,W,{}),K._f&&(K._f.mount=!1),(F.shouldUnregister||Q.shouldUnregister)&&(ae=X.array,pe=W,!ae.has((me=pe).substring(0,me.search(/\.\d+(\.|$)/))||me)||!J.action)&&X.unMount.add(W);var ae,pe,me,fe}}},Ye=()=>F.shouldFocusError&&Sc(M,rt,X.mount),ke=(W,Q)=>async K=>{let se;K&&(K.preventDefault&&K.preventDefault(),K.persist&&K.persist());let te=Cr(U);if(ye.state.next({isSubmitting:!0}),F.resolver){const{errors:ae,values:pe}=await ce();B.errors=ae,te=pe}else await Se(M);if(X.disabled.size)for(const ae of X.disabled)xo(te,ae,void 0);if(nr(B.errors,"root"),$r(B.errors)){ye.state.next({errors:{}});try{await W(te,K)}catch(ae){se=ae}}else Q&&await Q({...B.errors},K),Ye(),setTimeout(Ye);if(ye.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$r(B.errors)&&!se,submitCount:B.submitCount+1,errors:B.errors}),se)throw se},Ie=(W,Q={})=>{const K=W?Cr(W):V,se=Cr(K),te=$r(W),ae=te?V:se;if(Q.keepDefaultValues||(V=K),!Q.keepValues){if(Q.keepDirtyValues){const pe=new Set([...X.mount,...Object.keys(z0(V,U))]);for(const me of Array.from(pe))Gt(B.dirtyFields,me)?xo(ae,me,Gt(U,me)):Pe(me,Gt(ae,me))}else{if(ef&&Jo(W))for(const pe of X.mount){const me=Gt(M,pe);if(me&&me._f){const fe=Array.isArray(me._f.refs)?me._f.refs[0]:me._f.ref;if(Pu(fe)){const je=fe.closest("form");if(je){je.reset();break}}}}for(const pe of X.mount)Pe(pe,Gt(ae,pe))}U=Cr(ae),ye.array.next({values:{...ae}}),ye.state.next({values:{...ae}})}X={mount:Q.keepDirtyValues?X.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},J.mount=!ne.isValid||!!Q.keepIsValid||!!Q.keepDirtyValues,J.watch=!!F.shouldUnregister,ye.state.next({submitCount:Q.keepSubmitCount?B.submitCount:0,isDirty:!te&&(Q.keepDirty?B.isDirty:!(!Q.keepDefaultValues||Ua(W,V))),isSubmitted:!!Q.keepIsSubmitted&&B.isSubmitted,dirtyFields:te?{}:Q.keepDirtyValues?Q.keepDefaultValues&&U?z0(V,U):B.dirtyFields:Q.keepDefaultValues&&W?z0(V,W):Q.keepDirty?B.dirtyFields:{},touchedFields:Q.keepTouched?B.touchedFields:{},errors:Q.keepErrors?B.errors:{},isSubmitSuccessful:!!Q.keepIsSubmitSuccessful&&B.isSubmitSuccessful,isSubmitting:!1})},ue=(W,Q)=>Ie(Ni(W)?W(U):W,Q),De=W=>{B={...B,...W}},Ae={control:{register:he,unregister:ct,getFieldState:Re,handleSubmit:ke,setError:Xe,_subscribe:Be,_runSchema:ce,_focusError:Ye,_getWatch:Y,_getDirty:ie,_setValid:xe,_setFieldArray:(W,Q=[],K,se,te=!0,ae=!0)=>{if(se&&K&&!F.disabled){if(J.action=!0,ae&&Array.isArray(Gt(M,W))){const fe=K(Gt(M,W),se.argA,se.argB);te&&xo(M,W,fe)}if(ae&&Array.isArray(Gt(B.errors,W))){const fe=K(Gt(B.errors,W),se.argA,se.argB);te&&xo(B.errors,W,fe),pe=B.errors,!vh(Gt(pe,me=W)).length&&nr(pe,me)}if((ne.touchedFields||oe.touchedFields)&&ae&&Array.isArray(Gt(B.touchedFields,W))){const fe=K(Gt(B.touchedFields,W),se.argA,se.argB);te&&xo(B.touchedFields,W,fe)}(ne.dirtyFields||oe.dirtyFields)&&(B.dirtyFields=z0(V,U)),ye.state.next({name:W,isDirty:ie(W,Q),dirtyFields:B.dirtyFields,errors:B.errors,isValid:B.isValid})}else xo(U,W,Q);var pe,me},_setDisabledField:Qe,_setErrors:W=>{B.errors=W,ye.state.next({errors:B.errors,isValid:!1})},_getFieldArray:W=>vh(Gt(J.mount?U:V,W,F.shouldUnregister?Gt(V,W,[]):[])),_reset:Ie,_resetDefaultValues:()=>Ni(F.defaultValues)&&F.defaultValues().then(W=>{ue(W,F.resetOptions),ye.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const W of X.unMount){const Q=Gt(M,W);Q&&(Q._f.refs?Q._f.refs.every(K=>!Fp(K)):!Fp(Q._f.ref))&&ct(W)}X.unMount=new Set},_disableForm:W=>{na(W)&&(ye.state.next({disabled:W}),Sc(M,(Q,K)=>{const se=Gt(M,K);se&&(Q.disabled=se._f.disabled||W,Array.isArray(se._f.refs)&&se._f.refs.forEach(te=>{te.disabled=se._f.disabled||W}))},0,!1))},_subjects:ye,_proxyFormState:ne,get _fields(){return M},get _formValues(){return U},get _state(){return J},set _state(W){J=W},get _defaultValues(){return V},get _names(){return X},set _names(W){X=W},get _formState(){return B},get _options(){return F},set _options(W){F={...F,...W}}},subscribe:W=>(J.mount=!0,oe={...oe,...W.formState},Be({...W,formState:oe})),trigger:Ve,register:he,handleSubmit:ke,watch:(W,Q)=>Ni(W)?ye.state.subscribe({next:K=>W(Y(void 0,Q),K)}):Y(W,Q,!0),setValue:Pe,getValues:Ee,reset:ue,resetField:(W,Q={})=>{Gt(M,W)&&(Jo(Q.defaultValue)?Pe(W,Cr(Gt(V,W))):(Pe(W,Q.defaultValue),xo(V,W,Cr(Q.defaultValue))),Q.keepTouched||nr(B.touchedFields,W),Q.keepDirty||(nr(B.dirtyFields,W),B.isDirty=Q.defaultValue?ie(W,Cr(Gt(V,W))):ie()),Q.keepError||(nr(B.errors,W),ne.isValid&&xe()),ye.state.next({...B}))},clearErrors:W=>{W&&oc(W).forEach(Q=>nr(B.errors,Q)),ye.state.next({errors:W?B.errors:{}})},unregister:ct,setError:Xe,setFocus:(W,Q={})=>{const K=Gt(M,W),se=K&&K._f;if(se){const te=se.refs?se.refs[0]:se.ref;te.focus&&(te.focus(),Q.shouldSelect&&Ni(te.select)&&te.select())}},getFieldState:Re};return{...Ae,formControl:Ae}}(j);S.current={...A,formState:P}}const I=S.current.control;return I._options=j,CA(()=>{const z=I._subscribe({formState:I._proxyFormState,callback:()=>O({...I._formState}),reRenderRoot:!0});return O(A=>({...A,isReady:!0})),I._formState.isReady=!0,z},[I]),u.useEffect(()=>I._disableForm(j.disabled),[I,j.disabled]),u.useEffect(()=>{j.mode&&(I._options.mode=j.mode),j.reValidateMode&&(I._options.reValidateMode=j.reValidateMode)},[I,j.mode,j.reValidateMode]),u.useEffect(()=>{j.errors&&(I._setErrors(j.errors),I._focusError())},[I,j.errors]),u.useEffect(()=>{j.shouldUnregister&&I._subjects.state.next({values:I._getWatch()})},[I,j.shouldUnregister]),u.useEffect(()=>{if(I._proxyFormState.isDirty){const z=I._getDirty();z!==P.isDirty&&I._subjects.state.next({isDirty:z})}},[I,P.isDirty]),u.useEffect(()=>{j.values&&!Ua(j.values,k.current)?(I._reset(j.values,I._options.resetOptions),k.current=j.values,O(z=>({...z}))):I._resetDefaultValues()},[I,j.values]),u.useEffect(()=>{I._state.mount||(I._setValid(),I._state.mount=!0),I._state.watch&&(I._state.watch=!1,I._subjects.state.next({...I._formState})),I._removeUnmounted()}),S.current.formState=((z,A,D,F=!0)=>{const B={defaultValues:A._defaultValues};for(const M in z)Object.defineProperty(B,M,{get:()=>{const N=M;return A._proxyFormState[N]!==nc&&(A._proxyFormState[N]=!F||nc),z[N]}});return B})(P,I),S.current}({shouldUseNativeValidation:!1}),{handleSubmit:y,formState:x}=m,v=u.useRef(null),b=u.useRef(null),w=u.useRef(null),E=Cn(async j=>{let S;try{if(S=await Promise.resolve(a?.(j))??!0,S!==!0)return;await Promise.resolve(r?.(j,j===f,j===p)),i?.(j)}catch{}},[r,i,a,f,p]),C=Cn((j,S)=>{setTimeout(()=>{E(p)},180)},[E]),R=Cn(()=>{r?.(f,!0,!1),o?.(),i?.(null)},[r,f,o,i]),_=x&&(Object.keys(x.errors).length>0||x.disabled||x.isSubmitted),L=Cn((j,S)=>{const k=j===f,P={className:S?"defaultOption":"action",type:S?"submit":"button",style:{minWidth:"75px"},onClick:()=>{k?R():S||E(j)}};if(l)return l(j,P,S);const O={className:S?"defaultOption":"action",variant:S?"contained":"outlined",size:"small",disabled:!k&&_,color:"primary",...P};if(S||k){const I=S?v:b;O.touchRippleRef=I,O.onPointerDown=z=>{I.current?.start(z,{center:!1}),z.stopPropagation(),z.preventDefault()}}return s.jsx(Lc,{...O,children:s.jsx("div",{style:{paddingTop:"3px"},children:j})},`action:${j}`)},[c,p,f,l,x]),T=u.useMemo(()=>{const j=[];for(let S=0;S<c.length;S++){const k=c[S],P=p?k===p:S===0;j.push(L(k,P))}return j},[c,p,x]);return s.jsx(Lv,{onCancel:R,initialPosition:{y:wA==="touch"?"15":"35"},onDone:i,autoFocusSel:d,isModal:!0,PaperProps:{},...g,children:s.jsx(SA,{...m,children:s.jsxs("form",{ref:w,onSubmit:y(C),children:[s.jsx(Ex,{dividers:!0,onKeyDown:j=>{if(j.isDefaultPrevented())return;j.stopPropagation();let S=null,k=null;const P=j.which===xr.Escape&&f;if(P)S=f,k=b;else{if(_)return;j.which===xr.Enter&&(S=p??c[0],k=v)}S&&(k.current?.start(j,{center:!1}),setTimeout(()=>{k.current?.stop(j),P&&E(S)},180))},children:s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",whiteSpace:"pre-wrap",rowGap:j=>j.spacing(n||t?1.5:0)},children:[s.jsxs(Le,{sx:{display:"flex",flexDirection:"column"},children:[n,t]}),h]})}),s.jsx(YT,{sx:{paddingTop:j=>j.spacing(1),paddingBottom:j=>j.spacing(1),paddingLeft:j=>j.spacing(1),paddingRight:j=>j.spacing(1),backgroundColor:j=>pt(j.palette.action.hover,.03)},children:T})]})})})},jA=Object.freeze(Object.defineProperty({__proto__:null,OptionsDialog:Sh,default:Sh},Symbol.toStringTag,{value:"Module"})),RA=u.lazy(()=>Promise.resolve().then(()=>jA)),IA=u.lazy(()=>Promise.resolve().then(()=>require("./D2EeD2h3tDPA2kQP.cjs"))),a0=u.memo(u.forwardRef((e,t)=>{const{command:n,disabled:o=!1,shortcut:r,children:i,...a}=e;return U3(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})})})),qe=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,scope:r,context:i,icon:a,labelOverride:l,disabled:c=!1,variant:d=Si.Toolbar,shortcut:p,commandState:f,tooltipProps:h,...g}=e,m=u.useRef(null),y=u.useRef(!1),x=u.useMemo(()=>{const L={onExecute(T,j){o?.onExecute?.(T,j),y.current||(m.current?.start({center:!1}),setTimeout(()=>m.current?.stop({}),180)),y.current=!1},onError(T,j,S){o?.onError(T,j,S)}};return o?.beforeExecute&&(L.beforeExecute=o.beforeExecute),L},[o]),v=U3(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]),E=u.useCallback(L=>{L.keyCode!==xr.Enter&&L.keyCode!==xr.Space||n?.execute(f,o)},[v,o,f]),C=u.useMemo(()=>a||d===Si.Toolbar||n?.state()?typeof a=="function"?a(n):a:M2,[v,a]),R=u.useMemo(()=>({tabIndex:0,ref:t,selected:n?.state(),icon:d===Si.Toolbar?C:s.jsx(k1,{selected:n?.state()??!1,children:C}),touchRippleRef:m,disabled:c||!n||n.disabled(),onMouseDown:b,onMouseUp:w,onKeyDown:E}),[v,o,c,C]);let _;return _=d===Si.Menuitem?s.jsx(Gr,{...g,chips:n?.tags(),...R,children:l??n?.label(r,i)}):s.jsx(ii,{...g,...R}),(l||n?.label())&&((n.disabled()||c)&&(_=s.jsx("div",{children:_})),_=s.jsx(a0,{command:n,placement:d===Si.Toolbar?"bottom-start":"right-start",shortcut:p,...h,children:_})),_})),PA=u.memo(u.forwardRef((e,t)=>{const{command:n,scope:o,icon:r=M2,label:i,variant:a=Si.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,j){c?.onError(L,T,j)}};return c?.beforeExecute&&(_.beforeExecute=c.beforeExecute),_},[c]),g=U3(n,h),m=()=>n?.state()?.toString()||"0",[y,x]=u.useState(m),v=Cn(()=>{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]),E=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(ql,{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]),C={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 R;return R=a===Si.Menuitem?s.jsxs(Gr,{...d,chips:n?.tags(),...C,children:[w,E]}):s.jsx(ii,{...d,...C}),n?.label()&&((n.disabled()||l)&&(R=s.jsx("div",{children:R})),R=s.jsx(a0,{command:n,placement:a===Si.Toolbar?"bottom-start":"right-start",children:R})),R})),Xn=u.memo(u.forwardRef((e,t)=>{const{variant:n=Si.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 j={onExecute(S,k){l?.onExecute?.(S,k),v.current||(x.current?.start({center:!1}),setTimeout(()=>x.current?.stop({}),180)),v.current=!1},onError(S,k,P){l?.onError(S,k,P)}};return l?.beforeExecute&&(j.beforeExecute=l.beforeExecute),j},[l]),w=q3(i,[o],null,[o]),E=w[0],{label:C,icon:R}=u.useMemo(()=>{let j=null;d&&(j=typeof d=="function"?d(E):d),j||(j=E?.label?.(m));let S=null;return p&&(S=typeof p=="function"?p(E):p),S||(S=E?.icon?.()),{label:j,icon:S}},[w,d,p]),_={disabled:c,scope:m,touchRippleRef:x,onQuickClick:r,tooltip:h,label:C,icon:R};(C||h)&&(_.createTooltip=({children:j},S)=>s.jsx(br,{label:C,description:h,disabled:S,children:j}));const L=Cn(j=>f?.(j,i),[f,w]),T=Cn(j=>E?.execute(a,b),[E]);return E?(_.quickButtonProps={},_.quickButtonProps.createTooltip=({children:j,placement:S},k)=>s.jsx(a0,{command:E,placement:S??n===Si.Toolbar?"bottom-start":"right-start",disabled:k,children:j}),_.disabled=_.disabled??E?.disabled(),r||(_.onQuickClick=T)):o&&(_.onQuickClick=()=>{}),_.selected=g??E?.state(),_.createPopupPanel=L,n===Si.Toolbar?s.jsx(Ui,{...y,..._,ref:t}):s.jsx(C1,{...y,..._,ref:t})}));Xn.displayName="CommandPopupButton";const Gs=e=>{const{command:t,label:n,scope:o,icon:r=s.jsx(j3,{}),sx:i,...a}=e;return s.jsxs(Le,{sx:{display:"flex",flexDirection:"row",textTransform:"none",alignItems:"center",fontSize:l=>l.typography.subtitle2.fontSize,...i},...a,children:[r?ze(r):null,s.jsx(Mn,{component:"div",sx:{whiteSpace:"nowrap",lineHeight:"1",paddingLeft:l=>l.spacing(.25),paddingRight:l=>l.spacing(.25),fontSize:"inherit"},children:t?.label(o)||n})]})},E1=u.memo(u.forwardRef((e,t)=>{const{sx:n,commands:o,commandButtonProps:r,parentFloat:i,createToolbarPalette:a,children:l,...c}=e,d=E2(t,()=>({}),[]),[p,f]=u.useState(null),{reference:h}=pa({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,j)=>_?.beforeExecute?.(T,j)!==!1&&h.closeAll(),onExecute(T,j){_?.onExecute?.(T,j),g()},onError(T,j,S){_?.onError?.(T,j,S)}},...L}},[h,r]),x=u.useMemo(()=>({...m,...y}),[m,y]),[v,b]=u.useReducer(_=>_+1,0);q3(o,[],{onChange:()=>{b()}});const w=u.useMemo(()=>({commands:o,parentFloat:h,...y}),[v,x,h,r]);let E=0;m.dense||(E+=2),m.outlined&&E++;let C=2;m.dense||(C=4);const R=u.useMemo(()=>a({commands:o,commandButtonProps:x,commandPopupProps:{commands:o,...w,...r}}),[v,x,w,a]);return s.jsx(Dj,{variant:"dense",sx:{minHeight:"unset",height:"unset",paddingTop:`${C}px`,paddingBottom:`${C}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:`${C}px`,columnGap:`${E}px`,alignItems:"center",maxWidth:"100%"},children:R})})}));E1.displayName="CommandToolbar";const OA=e=>{const{key:t,...n}=e;return s.jsx(qe,{...n},t)},sa=u.memo(u.forwardRef((e,t)=>{const{popupCommandKeys:n,renderCommandButton:o,scope:r,commands:i,icon:a,quickCommand:l,popupScope:c=l,commandState:d,commandHook:p,disabled:f=!1,...h}=e;q3(i,[l,...n]);const g=u.useCallback((m,y)=>{const x={variant:Si.Menuitem,commandHook:p,commandState:d,icon:a,scope:c,disabled:f},v=[];for(let b=0;b<n?.length;b++){const w=n[b];if(w===null||w==="-"){v.push(s.jsx(Ft,{orientation:"horizontal"},`element-${v.length}`));continue}const E=y.getCommand(w),C={key:`${w}-${v.length}`,command:E,...x},R=o?.(C)??OA(C);R&&v.push(R)}return Bn({...m,children:v})},[f,p,d,c,n,a,o]);return s.jsx(Xn,{ref:t,commands:i,disabled:f,commandHook:p,commandState:d,scope:r,quickCommand:l,icon:a,createPopupPanel:g,...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(sR,{}))),g.set("formatAlignJustifyToggle",ze(s.jsx(yc,{}))),g.set("formatAlignCenterContinuousToggle",ze(s.jsx(Z6,{}))),g.set("formatAlignFillToggle",ze(s.jsx(yc,{}))),g.set("formatAlignDistributedHorizontalToggle",ze(s.jsx(yc,{}))),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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...y,command:m.getCommand("formatAlignLeftToggle"),icon:p.get("formatAlignLeftToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignCenterToggle"),icon:p.get("formatAlignCenterToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignRightToggle"),icon:p.get("formatAlignRightToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignJustifyToggle"),icon:p.get("formatAlignJustifyToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...y,command:m.getCommand("formatAlignCenterContinuousToggle"),icon:p.get("formatAlignCenterContinuousToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignFillToggle"),icon:p.get("formatAlignFillToggle")}),s.jsx(qe,{...y,command:m.getCommand("formatAlignDistributedHorizontalToggle"),icon:p.get("formatAlignDistributedHorizontalToggle")})]}),v=s.jsxs(Le,{sx:{className:Eo("quick-buttons"),display:"flex",alignItems:"center",justifyContent:"center"},onClick:w=>w.stopPropagation(),children:[s.jsx(qe,{command:m.getCommand("formatIndentDecrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(PO,{}))}),s.jsx(qe,{command:m.getCommand("formatIndentIncrease"),commandHook:f,scope:r,disabled:i,icon:ze(s.jsx(IO,{}))})]}),b=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...l,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{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(NO,{}))),f.set("formatAlignMiddleToggle",ze(s.jsx($O,{}))),f.set("formatAlignBottomToggle",ze(s.jsx(U7,{}))),f.set("formatAlignJustifyVerticalToggle",ze(s.jsx(yc,{}))),f.set("formatAlignDistributedVerticalToggle",ze(s.jsx(yc,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatAlignTopToggle"),icon:d.get("formatAlignTopToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatAlignMiddleToggle"),icon:d.get("formatAlignMiddleToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatAlignBottomToggle"),icon:d.get("formatAlignBottomToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...g,command:h.getCommand("formatAlignJustifyVerticalToggle"),icon:d.get("formatAlignJustifyVerticalToggle")}),s.jsx(qe,{...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(_I,{}))),f.set("formatTextOverflowClipToggle",ze(s.jsx(jI,{}))),f.set("formatTextOverflowShrinkToggle",ze(s.jsx(RI,{}))),f},[]),p=_e((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:r,disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowVisibleToggle"),icon:d.get("formatTextOverflowVisibleToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowWrapToggle"),icon:d.get("formatTextOverflowWrapToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatTextOverflowClipToggle"),icon:d.get("formatTextOverflowClipToggle")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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(()=>{for(let h=0;h<l.length;h++)if(l[h]?.state())return l[h].key();return l[1]?.key()},[l]),d=u.useMemo(()=>{const h=new Map;return h.set("formatTextRotate0",ze(s.jsx(dd,{}))),h.set("formatTextRotate315",ze(s.jsx(dd,{}))),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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},y=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...m,command:g.getCommand("formatTextRotate0"),icon:ze(s.jsx(BO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate315"),icon:ze(s.jsx(dd,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate45"),icon:ze(s.jsx($7,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate90"),icon:ze(s.jsx(V7,{}))}),s.jsx(qe,{...m,command:g.getCommand("formatTextRotate270"),icon:ze(s.jsx(H7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(PA,{...m,command:g.getCommand("formatTextRotateCustom"),icon:ze(s.jsx(W7,{})),label:"Custom"})]});return Bn({...h,children:y})},[i,o,r]),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(dd,{})),...a})}));function Nl(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 Ya="$$material";var ys=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 Ca(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(G.isValidElement(e)||Qv.isValidElementType(e)||!Ca(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 Ca(e)&&Ca(t)&&Object.keys(t).forEach(r=>{G.isValidElement(t[r])||Qv.isValidElementType(t[r])?o[r]=t[r]:Ca(t[r])&&Object.prototype.hasOwnProperty.call(e,r)&&Ca(e[r])?o[r]=ai(e[r],t[r],n):n.clone?o[r]=Ca(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 tl(e){if(e.type)return e;if(e.charAt(0)==="#")return tl(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(Nl(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(Nl(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const rc=(e,t)=>{try{return(n=>{const o=tl(n);return o.values.slice(0,3).map((r,i)=>o.type.includes("hsl")&&i!==0?`${r}%`:r).join(" ")})(e)}catch{return e}};function _2(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=tl(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])),_2({type:l,values:c})}function Ch(e){let t=(e=tl(e)).type==="hsl"||e.type==="hsla"?tl(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 fd(e,t,n){try{return function(o,r){return o=tl(o),r=rf(r),o.type!=="rgb"&&o.type!=="hsl"||(o.type+="a"),o.type==="color"?o.values[3]=`/${r}`:o.values[3]=r,_2(o)}(e,t)}catch{return e}}function af(e,t){if(e=tl(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 _2(e)}function po(e,t,n){try{return af(e,t)}catch{return e}}function lf(e,t){if(e=tl(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 _2(e)}function ho(e,t,n){try{return lf(e,t)}catch{return e}}function md(e,t,n){try{return function(o,r=.15){return Ch(o)>.5?af(o,r):lf(o,r)}(e,t)}catch{return e}}const Gc={black:"#000",white:"#fff"},DA={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:Gc.white,default:Gc.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 AA=nw();function ow(){return{text:{primary:Gc.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:Gc.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=Ch(y),b=Ch(x);return(Math.max(v,b)+.05)/(Math.min(v,b)+.05)}(m,G8.text.primary)>=n?G8.text.primary:AA.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(Nl(11,y?` (${y})`:"",x));if(typeof m.main!="string")throw new Error(Nl(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:{...Gc},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:DA,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:o,...g},r)}var X8,Y8,Bp,J8,Q8,e9={exports:{}};function LA(){if(J8)return Bp;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,Bp=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},Bp}function Zc(){return Q8||(Q8=1,e9.exports=LA()()),e9.exports}function Cc(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 j2={xs:0,sm:600,md:900,lg:1200,xl:1536},n9={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${j2[e]}px)`},zA={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:j2[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ja(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:zA,a);d&&(i[d]=n(t[a],a))}else if(Object.keys(r.values||j2).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(Nl(7));return e.charAt(0).toUpperCase()+e.slice(1)}function R2(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 Au(e,t,n,o=n){let r;return r=typeof e=="function"?e(n):Array.isArray(e)?e[n]||o:R2(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=R2(a.theme,o)||{};return ja(a,l,d=>{let p=Au(c,r,d);return d===p&&typeof d=="string"&&(p=Au(c,r,`${t}${d==="default"?"":rw(d)}`,d)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}const FA={m:"margin",p:"padding"},BA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},r9={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},NA=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=FA[o],a=BA[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 M1(e,t,n,o){const r=R2(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 M1(e,"spacing",8)}function T1(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]=T1(p,f),h),{})}(NA(a),l);return ja(r,r[a],c)}(e,t,o,n)).reduce(Cc,{})}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 $A={borderRadius:4};function Lu(...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]?Cc(r,t[i](o)):r,{});return n.propTypes={},n.filterProps=e.reduce((o,r)=>o.concat(r.filterProps),[]),n}function vi(e){return typeof e!="number"?e:`${e}px solid`}function Pi(e,t){return qo({prop:e,themeKey:"borders",transform:t})}const VA=Pi("border",vi),HA=Pi("borderTop",vi),WA=Pi("borderRight",vi),UA=Pi("borderBottom",vi),qA=Pi("borderLeft",vi),KA=Pi("borderColor"),GA=Pi("borderTopColor"),ZA=Pi("borderRightColor"),XA=Pi("borderBottomColor"),YA=Pi("borderLeftColor"),JA=Pi("outline",vi),QA=Pi("outlineColor"),Xd=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=M1(e.theme,"shape.borderRadius",4),n=o=>({borderRadius:T1(t,o)});return ja(e,e.borderRadius,n)}return null};Xd.propTypes={},Xd.filterProps=["borderRadius"],Lu(VA,HA,WA,UA,qA,KA,GA,ZA,XA,YA,Xd,JA,QA);const zu=e=>{if(e.gap!==void 0&&e.gap!==null){const t=M1(e.theme,"spacing",8),n=o=>({gap:T1(t,o)});return ja(e,e.gap,n)}return null};zu.propTypes={},zu.filterProps=["gap"];const Fu=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=M1(e.theme,"spacing",8),n=o=>({columnGap:T1(t,o)});return ja(e,e.columnGap,n)}return null};Fu.propTypes={},Fu.filterProps=["columnGap"];const Yd=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=M1(e.theme,"spacing",8),n=o=>({rowGap:T1(t,o)});return ja(e,e.rowGap,n)}return null};function js(e,t){return t==="grey"?t:e}function ti(e){return e<=1&&e!==0?100*e+"%":e}Yd.propTypes={},Yd.filterProps=["rowGap"],Lu(zu,Fu,Yd,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"})),Lu(qo({prop:"color",themeKey:"palette",transform:js}),qo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:js}),qo({prop:"backgroundColor",themeKey:"palette",transform:js}));const eL=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]||j2[n];return o?e.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ti(n)}};return ja(e,e.maxWidth,t)}return null};df.filterProps=["maxWidth"];const tL=qo({prop:"minWidth",transform:ti}),nL=qo({prop:"height",transform:ti}),oL=qo({prop:"maxHeight",transform:ti}),rL=qo({prop:"minHeight",transform:ti});qo({prop:"size",cssProperty:"width",transform:ti}),qo({prop:"size",cssProperty:"height",transform:ti}),Lu(eL,df,tL,nL,oL,rL,qo({prop:"boxSizing"}));const I2={border:{themeKey:"borders",transform:vi},borderTop:{themeKey:"borders",transform:vi},borderRight:{themeKey:"borders",transform:vi},borderBottom:{themeKey:"borders",transform:vi},borderLeft:{themeKey:"borders",transform:vi},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:vi},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Xd},color:{themeKey:"palette",transform:js},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:js},backgroundColor:{themeKey:"palette",transform:js},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:zu},rowGap:{style:Yd},columnGap:{style:Fu},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"}},l0=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=R2(o,c)||{};return p?p(i):ja(i,n,h=>{let g=Au(f,d,h);return h===g&&typeof h=="string"&&(g=Au(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??I2;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=Cc(h,e(g,m,r,a));else{const x=ja({theme:r},m,v=>({[g]:v}));(function(...v){const b=v.reduce((E,C)=>E.concat(Object.keys(C)),[]),w=new Set(b);return v.every(E=>w.size===Object.keys(E).length)})(x,m)?h[g]=t({sx:m,theme:r,nested:!0}):h=Cc(h,x)}else h=Cc(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 iL(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 E=Object.keys(w).map(C=>({key:C,val:w[C]}))||[];return E.sort((C,R)=>C.val-R.val),E.reduce((C,R)=>({...C,[R.key]:R.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,E){const C=y.indexOf(E);return`@media (min-width:${typeof p[w]=="number"?p[w]:w}${f}) and (max-width:${(C!==-1&&typeof p[y[C]]=="number"?p[y[C]]:E)-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 E=y.indexOf(w);return E===0?x(y[1]):E===y.length-1?v(y[E]):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:{...$A,...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=iL,c=t.reduce((d,p)=>ai(d,p),c),c.unstable_sxConfig={...I2,...a?.unstable_sxConfig},c.unstable_sx=function(d){return l0({sx:d,theme:this})},c}l0.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 Np(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 aL(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,E)=>{return{fontFamily:n,fontWeight:x,fontSize:g(v),lineHeight:b,...n===l9?{letterSpacing:(C=w/v,Math.round(1e5*C)/1e5+"em")}:{},...E,...d};var C},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 lL=["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)],sL={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)"},cL={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function s9(e){return`${Math.round(e)}ms`}function dL(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function uL(e){const t={...sL,...e.easing},n={...cL,...e.duration};return{getAutoHeightDuration:dL,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 pL={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function hL(e){return Ca(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];!hL(l)||a.startsWith("unstable_")?delete o[a]:Ca(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:Up,Perm
195
195
 
196
196
  The formatting is not applied.`,shortcut:{key:"V",modifiers:[$e.Ctrl,$e.Shift]}}),new He("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 He("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 He("pasteTranspose",A,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new He("pasteLinks",A,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];m.addCommands(D,!0)},[m,f]),u.useEffect(()=>{if(!m)return;const A={disabled:!h.getProtection().isFormatCellsAllowed()};m.getCommand("pasteValues").updateCallback(D=>I.paste({...iF,...D})).update(A),m.getCommand("pasteFormats").updateCallback((D,F)=>I.paste({...aF,description:F.label(),...D})).update(A),m.getCommand("pasteFormulas").updateCallback((D,F)=>I.paste({...lF,description:F.label(),...D})).update(A),m.getCommand("pasteTranspose").updateCallback((D,F)=>I.paste({...sF,description:F.label(),...D})).update(A),m.getCommand("pasteLinks").updateCallback((D,F)=>I.paste({...cF,description:F.label(),...D})).update(A),m.getCommand("cut").update(A),m.getCommand("paste").update(A)},[h,m]);const z=u.useMemo(()=>{if(!S||!T.current)return;const A=S.key;if(A!=="copy"&&A!=="cut"&&A!=="formatPainter")return;const D=T.current.getItem();if(D.getSource()!==h)return;const F=T.current.isCut?.(),B=F?C:E,M=F?w:b,N=D.getCoords(),V=N?[N]:null;return V&&V.length!==0?U=>{const J=[];for(let X=0;X<V.length;X++){const H=V[X],ne=U.toClipBounds(U.getRangeCoordsBounds(H,{top:0,left:0,right:1,bottom:1}),Rr);ne&&(J.push(L({range:H,key:`copy-selection-background-${X}`,x:ne.x,y:ne.y,width:Math.max(ne.width,0),height:Math.max(ne.height,0),stroke:B,strokeWidth:2})),J.push(L({range:H,key:`copy-selection-foreground-${X}`,x:ne.x+(ne.width<=2?-1:0),y:ne.y,width:Math.max(ne.width,3),height:Math.max(ne.height,3),stroke:M,strokeWidth:2,isAnimatedStroke:!0})))}return J}:null},[S,h,g,b,E,w,C]);return{...I,clipboard:O,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 sn(r?.getSelection(),{onChange(f){}}),u.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),uF={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},pF={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},hF={key:"dragCopy",description:"Drag selection to copy cell contents."},fF={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},fg=(e,t)=>t.ctrlKey&&t.shiftKey?fF:t.ctrlKey?hF:t.shiftKey?pF:uF,mF={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},gF=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=_e(l,[l]),v=_e(c,[c]),[b,w]=u.useState(()=>d?.getSelection().getCoords()),E=_e(de=>{Go.isEqualSelectionCoords(de,b)||d&&d.getSelection().updateCoords(de)},[d,b]),C=Hi(),R=u.useRef(null),[_,L]=u.useState(d?.getProtection().isLocked()),[T,j]=u.useState(d?.getView().getMovableSelection().length>0),S=_n.detectIt().primaryInput==="touch",k=!S&&h,P=g!==null||T,O=_e(de=>{const xe=Go.cellToRange(de);if(d.isClosed())return xe;const we=d.getRange(xe,{excludeHidden:!0}).getMerges();return we.length===0?xe:we[0]},[d]),I=_e((de,xe,we,ve,re,ce)=>{const Se=d.getSelectedRange().getExtended(ve,de).getCoords();switch(ve){case $.IRange.Direction.Up:return Se.rowStart;case $.IRange.Direction.Down:return Se.rowEnd;case $.IRange.Direction.Left:return Se.colStart;case $.IRange.Direction.Right:return Se.colEnd}},[d]),z=_e(()=>{const de=d.getUsedRange()?.getCoords(),xe=d.getRowHeaders().getUsedRange()?.getCoords(),we=d.getColumnHeaders().getUsedRange()?.getCoords();return{...de,colEnd:Math.max(de?.colEnd??0,we?.max??0),rowEnd:Math.max(de?.rowEnd??0,xe?.max??0)}},[d]),A=_e((de,xe)=>d.getRowHeaders().hiddenHeadersAt(de,xe),[d]),D=_e((de,xe)=>d.getColumnHeaders().hiddenHeadersAt(de,xe),[d]),F=_e(de=>d.getRange(de,{excludeHidden:!0}).getMerges(),[d]),B=_e(de=>{d?.getSelection().setAdjusting(de)},[d]),M=_e(async()=>{d?.getSelection().setAdjusting(null),C.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),C.setMode(null))},[C,b,d,o]),N=u.useMemo(()=>{const de=C.getMode();return de?.key==="cut"||de?.key==="copy"},[C]);sn(d?.getView(),{onMovableSelectionChange:()=>{j(d.getView().getMovableSelection().length>0)}}),sn(d?.getSelection(),{onChange(de){const xe=d.getSelection().getCoords();w(xe)}}),sn(d,{onProtectionChange:()=>{L(d.getProtection().isLocked())}});const{body:V={}}=f||{},U=n.getLayout(),J=!(k&&b.ranges.length<=1&&g===null&&!_&&(!C.getMode()||N)),{overlay:X,onPointerDown:H}=Ww({gridRef:p,commands:o,layout:U,getCellCoordsAsRangeCoords:O,selection:b,fillHandleBorderColor:V.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:J,disableMoveDrag:S||!(h&&b.ranges.length<=1&&g===null&&!_),disableTouchSelection:P,onSelectionChange:E,onSelectionDragStart:B,onSelectionDragEnd:M,onMoveDragStart:(de,xe,we)=>{C.setMode(fg(0,we))},onMoveDragUpdate:(de,xe,we)=>{C.setMode(fg(0,we))},onMoveDragEnd:(de,xe)=>{C.setMode(null)},onMoveDragDone:async(de,xe,we)=>{if(Go.isEqualRanges(de,xe))return;const ve=d.getRange(xe);if(a?.showOptions){const Y=ve.getDifferences(de);let le=!1;for(let ee=0;!le&&ee<Y.getCount();ee++)le=Y.at(ee).isContentful();if(le&&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 re=!we.ctrlKey,ce=we.shiftKey,Se=ce?re?"Insert Moved Cells":"Insert Copied Cells":re?"Move Cells":"Copy Cells",ie=await a?.showBusy?.(Se);try{const Y=d.getRange(de);await ve.doBatch(async()=>{ce?await ve.insertFrom(de,{isCut:re,undoRange:Y}):await ve.copyFrom(de,{isCut:re,undoRange:Y}),Y.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0}),ve.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0})},{description:Se,autoSelect:!0})}catch(Y){a?.showError?.(Y)}finally{ie?.()}},contentfulCellFinder:I,hiddenRowsAt:A,hiddenColumnsAt:D,mergedRanges:F,getDataCoords:z,canSelectionSpanMergedCells:de=>{const xe=d.getRange(de);return xe.isEntireColumns()||xe.isEntireRows()},onFill:async(de,xe)=>{const we="Auto Fill",ve=await a?.showBusy?.(we);try{await d.doBatch(()=>{d.getRange(de).autoFill(xe),d.getRange(xe).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(re){a?.showError?.(re)}finally{R.current=null,ve?.()}},onFillPreview:(de,xe,we)=>{if(p.current&&x){C.setMode(mF);try{R.current?.direction!==we&&(R.current=null,d.getRange(de).autoFill(xe,{previewOnly:ee=>{R.current={callback:ee,direction:we}}}));const ve=R.current?.callback?.(xe);if(!ve||ve.isEmpty())return;const re=ve.toText();if(!re)return;const ce=Go.cellToRange(ve.getCoords()),Se=n.getRelativePointFromClient(0,0);let ie=0,Y=0,le=fp;if(we===$.IRange.Direction.Down){ie=U.getColOffset(ce.colEnd+1)-Se.x;const ee=U.getRowOffset(ce.rowEnd),Pe=U.getRowOffset(ce.rowEnd+1);Y=Pe-(Pe-ee)/2-Se.y,le=U5}else if(we===$.IRange.Direction.Right){Y=U.getRowOffset(ce.rowEnd+1)-Se.y;const ee=U.getColOffset(ce.colEnd),Pe=U.getColOffset(ce.colEnd+1);ie=Pe-(Pe-ee)/2-Se.x,le=fp}else if(we===$.IRange.Direction.Up){ie=U.getColOffset(ce.colEnd+1)-Se.x;const ee=U.getRowOffset(ce.rowStart),Pe=U.getRowOffset(ce.rowStart+1);Y=Pe-(Pe-ee)/2-Se.y,le=U5}else if(we===$.IRange.Direction.Left){Y=U.getRowOffset(ce.rowEnd+1)-Se.y;const ee=U.getColOffset(ce.colStart),Pe=U.getColOffset(ce.colStart+1);ie=Pe-(Pe-ee)/2-Se.x,le=fp}x({anchor:{x:ie,y:Y},display:re,placement:le})}catch(ve){a?.showError?.(ve)}}},onFillDone:()=>{R.current=null,C.setMode(null),v?.()}}),ne=_e(de=>{H(_n.createSyntheticEvent(de))},[H,g]);u.useEffect(()=>{const de=n?.getStage();if(de)return de.addEventListener("pointerdown",ne),()=>{de.removeEventListener("pointerdown",ne)}},[n?.getStage()]);const oe=ir(t,()=>({}),[]),ye=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:s0([oe,ye]),...m,children:X(n)})})),Cd=Object.freeze({x:0,y:0,width:0,height:0}),yF={fireOnModelChange:!1},xF=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(Cd),[w,E]=u.useState(null),[C,R]=u.useState(!1),_=u.useRef(null);u.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const j=o.toViewBounds(T);b(j??Cd),f(j??Cd)},[o?.getBounds()]),sn(r,{onBoundsChange:T=>{const j=T.getBounds();if(!j)return;const S=o.toViewBounds(j);b(S??Cd),f(S)},onSelectionChange:()=>{const T=Xt.hasFocus(_.current,!0);!C&&!T||r.isSelected()||d()}}),sn(r,{onRequestFocus:()=>Xt.whenFocus(_.current,!0)},yF),u.useEffect(()=>{const T=_.current;return i(T),()=>{a(T)}},[]);const L=u.useMemo(()=>{if(!v)return null;let{width:T,height:j}=v;return y({view:o,movable:r,disabled:m,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:j},onHide:l,onShow:c})},[o,r,v.width,v.height,m,p]);return s.jsx("div",{className:"movable",tabIndex:0,ref:s0([_,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 j=T.shiftKey||T.ctrlKey,S=r.isSelected(),k=T.currentTarget;j&&S?r.unselect():(S&&!j||await r.select({addToSelection:j}),h(T.nativeEvent,k),k.focus())},onFocus:T=>{T.relatedTarget&&!w&&E(T.relatedTarget),R(!0)},onBlur:T=>{w&&!_?.current?.contains(T.relatedTarget)&&E(null),T.relatedTarget&&R(!1)},...x,children:L})})),bF=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=_e(y,[y]),w=_e(l,[l]),E=_e(c,[c]),[C,R]=u.useState([]),[_,L]=u.useState(!1),[T,j]=u.useState(!1),S=u.useRef(!0),k=u.useRef(new Map),P=u.useRef(new Map),O=u.useRef(new Map),I=u.useRef(new Map),z=u.useRef(new Map),A=u.useRef({onRequestFocus:Ee=>(we(Ee),null)}),D=u.useRef(null),F=u.useRef(null),B=u.useRef(null),[M,N]=u.useReducer(Ee=>Ee+1,0);u.useLayoutEffect(()=>{N()},[n,o]),sn(o,{onCollectionChange:()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Re=z.current;Re.forEach(Be=>{Be()}),Re.clear();const Xe=A.current;for(let Be=0;Be<Ee.length;Be++){const ct=Ee[Be];if(ct.isClosed())continue;const Qe=ct.addListeners(Xe);Re.set(ct,Qe)}N()},onInvalidated:()=>{N()}}),sn(r,{onMovableSelectionChange(Ee){U(),N()}});const V=u.useCallback((Ee,Re)=>{const Xe=O.current.get(Ee);B.current&&(B.current.getTargets().forEach(Be=>{if(Be===Xe)return Be.style.left=Re.x+"px",Be.style.top=Re.y+"px",Be.style.width=Re.width+"px",void(Be.style.height=Re.height+"px")}),B.current.updateRect())},[]),U=()=>{const Ee=[],Re=r.getMovableSelection();Re.forEach(Xe=>{const Be=O.current.get(Xe);Be&&Re.indexOf(Xe)!==-1&&Ee.push(Be)}),R(Xe=>Xt.isEqualArrays(Xe,Ee)?Xe:Ee)},J=u.useRef(null),X=u.useMemo(()=>new Promise(Ee=>{J.current=Ee}),[]),H=u.useRef(null),ne=_e(async(Ee,Re)=>{H.current=Re,await(async()=>!(!await X.then()||!B.current))()&&H.current===Re&&B.current.dragStart(Ee,Re)},[C]),[oe,ye]=u.useState(!1),de=u.useRef(null),xe=u.useRef(null),we=_e(async(Ee=null)=>{if(Ee||(Ee=r.getMovableSelection()[0]),!Ee)return w?.(),!1;const Re=O.current.get(Ee);Re?(await Xt.whenFocus(Re),Re.focus(),xe.current=Re,de.current=null):de.current=Ee},[r]);u.useEffect(()=>{oe&&C.length>0&&xe.current!==C[0]&&we(),S.current&&(b?.(),S.current=!1)},[C]);const ve=u.useMemo(()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(Ee.length===0&&k.current.size===0)return null;const Re=(he,Ye,ke,Ie=!0)=>{const ue=he.isSelected(),De={tabIndex:ke,view:n,movable:he,onRefLoad:Ae=>{de.current===he&&(Ae.focus(),xe.current=Ae,de.current=null),O.current.set(he,Ae),P.current.set(Ae,he),Ye.rendered=!0,U()},onRefUnload:Ae=>{O.current.delete(he),P.current.delete(Ae),Ye.rendered=!1,U()},onUnFocus:w,onHide:Ae=>{Ye.onHide=Ae},onShow:Ae=>{Ye.onShow=Ae},isDragging:ue&&(T||_),disabled:d,renderMovable:i,updateFrameBounds:Ae=>{V(he,Ae)},dragStart:ne,onMouseUp:()=>{if(H.current=null,F.current){L(!1),j(!1);let Ae=!1;I.current?.forEach(W=>{Xt.isEqualBounds(W.movable.getBounds(),W.startBounds)||(Ae=!0)}),Ae?ce():Se()}},style:{opacity:Ie?_&&ue?.7:void 0:0,zIndex:_&&ue?he.getZIndex()+Ee.length:void 0,pointerEvents:Ie?void 0:"none",cursor:T&&ue?"grabbing":d||p?"initial":"move",boxShadow:!ue||T&&!_?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(xF,{...De},`movable-${he.getUUID()}`)},Xe=k.current,Be=new Map,ct=[];for(let he=0;he<Ee.length;he++){const Ye=Ee[he];if(Ye.isClosed())continue;let ke=Xe.get(Ye);ke||(ke={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Ie,ue)=>{if(!ue||ue.shown===!0)return;ue.shown=!0;const De=++ue.visibilityRequestId;requestAnimationFrame(()=>{const Ae=k.current.get(Ie);Ae&&De===ue.visibilityRequestId&&(ue.onShow?.(Ie),Ae.shown=!0)})},doHide:async(Ie,ue)=>{if(!ue||ue?.shown===!1)return;ue.shown=!1;const De=++ue.visibilityRequestId,Ae=await Promise.resolve(ue.onHide?.(Ie));De===ue.visibilityRequestId&&Ae!==!1&&(ue.shown=!1,k.current.delete(Ie),N())},visibilityRequestId:0}),ke.frame=Re(Ye,ke,he,!0),ct.push(ke.frame),ke.doShow(Ye,ke),Xe.delete(Ye),Be.set(Ye,ke)}const Qe=[];return r.getMovableSelection().forEach(he=>{const Ye=Xe.get(he);Ye&&(Ye.frame=Re(he,Ye,-1,!1),Qe.push(Ye.frame),Xe.delete(he),Be.set(he,Ye))}),Xe.forEach((he,Ye)=>{he.frame=Re(Ye,he,-1,!1),Qe.push(he.frame),he.doHide(Ye,he),Xe.delete(Ye),Be.set(Ye,he)}),k.current=Be,U(),[...Qe,...ct]},[M,n,i,d,p,f,_,T]),re=_e((Ee,Re)=>{const Xe=`${Re} ${C.length===1?$.TextUtils.capitalize(P.current?.get(C[0]).getContent().getType()):"Drawings"}`;F.current&&(console.warn(`Transaction ${F.current.getDescription()} is being replaced by ${Xe}`),F.current.rollback(),F.current=null),F.current=a.beginCommit({description:Xe}),I.current.clear();for(let Be=0;Be<C.length;Be++){const ct=C[Be],Qe=P.current?.get(ct);Qe?I.current.set(ct,{movable:Qe,startBounds:n.toViewBounds(Qe.getBounds())}):console.warn("invalid element",Qe)}},[a,n,C]),ce=u.useCallback(()=>{if(!F.current)return;const Ee=[];I.current?.forEach(Re=>{Ee.push(Re.movable)}),F.current.commit({viewAfter:{view:r,movableSelection:Ee}}),I.current.clear(),F.current=null},[]),Se=u.useCallback(()=>{F.current&&(F.current.rollback(),F.current=null)},[]),ie=u.useRef(null);u.useEffect(()=>{ie.current&&(ie.current.onscroll=Ee=>{Ee.preventDefault(),Ee.srcElement.scrollTop=0,Ee.srcElement.scrollLeft=0})},[ie.current]);const Y=ir(t,()=>({isMovableArea:()=>!0,focusMovable:we,focus:()=>{we()}}),[r]),[le,ee]=u.useState(null),Pe=u.useRef(!1),Te=u.useRef(!1),rt=u.useRef(!1);u.useEffect(()=>{if(d||C.length===0||rt.current||Pe.current)return;if(Te.current)return void requestAnimationFrame(()=>{B.current&&D.current&&B.current.refTargets.length>0&&(rt.current=!0,J.current?.(!0)),R([...C])});Pe.current=!0;const Ee=u.lazy(async()=>{try{const Re=await Promise.resolve().then(()=>require("./BVSgRPnwULlPvK0r.cjs"));return Pe.current=!1,Te.current=!0,R([...C]),Re}catch(Re){return console.warn(Re),J.current?.(!1),null}});ee(Ee)},[C,d,p,f]);const Ve=u.useMemo(()=>!le||d?null:s.jsx(u.Suspense,{children:s.jsx(le,{className:Zr({dragging:_||T,resizing:_,moving:T}),container:null,ref:B,target:B.current?C:[],draggable:!d&&!p,resizable:!d&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:Ee=>{re(Ee.target,"Resize")},onResize:Ee=>{if(!F.current)return Ee.stopDrag(),void N();L(!0);const Re=Ee.direction[0]!==0&&Ee.direction[1]!==0;let Xe=0,Be=0;for(let ct=0;ct<C.length;ct++){const Qe=C[ct],he=I.current.get(Qe),Ye=P.current.get(Qe);if(!he||!Ye){console.warn("invalid element");continue}let ke=Ee.dist[0],Ie=Ee.dist[1],ue=Ee.drag.dist[0],De=Ee.drag.dist[1],Ae=he.startBounds.width,W=he.startBounds.height;ct===0?(Xe=Ae,Be=W):(ke*=Ae/Xe,ue*=Ae/Xe,Ie*=W/Be,De*=W/Be);const Q={...he.startBounds};if(Q.width=Math.max(0,Ae+ke),Q.height=Math.max(0,W+Ie),Ee.direction[0]===-1&&(Q.width=Math.max(0,Math.min(he.startBounds.x+Ae,Ae-ue))),Ee.direction[1]===-1&&(Q.height=Math.max(0,Math.min(he.startBounds.y+W,W-De))),Re&&(Ye.isLockAspectRatio()||Ee.inputEvent?.shiftKey)){const K=Ae/W,se=Q.width/Q.height;se>K?Q.height=Q.width/K:se<K&&(Q.width=Q.height*K)}Ee.direction[0]===-1&&(Q.x=Math.max(0,Math.min(he.startBounds.x+Ae,he.startBounds.x+Ae-Q.width))),Ee.direction[1]===-1&&(Q.y=Math.min(he.startBounds.y+W,he.startBounds.y+W-Q.height)),he.movable.setBounds(n.toAbsoluteBounds(Q))}},onResizeEnd:Ee=>{L(!1),ce()},onDragStart:Ee=>{re(Ee.target,"Move")},onDrag:Ee=>{if(!F.current)return Ee.stopDrag(),void N();j(!0);for(let Re=0;Re<C.length;Re++){const Xe=C[Re],Be=I.current.get(Xe);Be?Be.movable.setBounds(n.toAbsoluteBounds({...Be.startBounds,x:Be.startBounds.x+Ee.translate[0],y:Be.startBounds.y+Ee.translate[1]})):console.warn("invalid element")}},onDragEnd:Ee=>{},onMouseUp:Ee=>{}})}),[M,le,C,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:s0([Y,ie]),...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:D,style:{position:"absolute",pointerEvents:"auto"},onFocus:Ee=>{E?.(),ye(!0)},onBlur:Ee=>{ye(!1)},onKeyDownCapture:Ee=>{if(Ee.isDefaultPrevented())return;const Re=Ee.nativeEvent.ctrlKey,Xe=Ee.nativeEvent.altKey,Be=Ee.nativeEvent.shiftKey;if(Ee.which===tn.Escape){const ke=r.getMovableSelection();let Ie=[...ke];return C.forEach(ue=>{if(Ie.length===0)return;const De=P.current.get(ue);let Ae=Ie.indexOf(De);Ie.splice(Ae,1)}),Ie.length!==ke.length&&r.selectMovables(Ie),Ie.length===0&&w?.(),void Ee.preventDefault()}const ct=.1,Qe=ke=>{o.updateSelected(Ie=>{Ie.setRotation(Ie.getRotation()+ke)},"Rotate")},he=(ke,Ie=!0)=>{o.updateSelected(ue=>{const De=ue.getBounds();let Ae=1+ke;Ie||(Ae=1/Ae);const W=Math.sqrt(Math.pow(De.width,2)+Math.pow(De.height,2)),Q=Math.atan2(De.height,De.width),K=Ae*W;if(K<10)return;const se=K*Math.cos(Q),te=K*Math.sin(Q),ae={x:De.x+(De.width-se)/2,y:De.y+(De.height-te)/2,width:se,height:te};ue.setBounds(ae)},"Resize")},Ye=ke=>{o.updateSelected(Ie=>{const ue=Ie.getBounds(),De={x:ue.x+(ke.x??0),y:ue.y+(ke.y??0),width:ue.width+(ke.width??0),height:ue.height+(ke.height??0)};Ie.setBounds(De)},"Nudge")};if(Ee.which===tn.Delete)o.updateSelected(ke=>{ke.delete()},"Delete"),Ee.preventDefault();else if(Ee.key==="a"&&Re){const ke=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(ke,!0),Ee.preventDefault()}else Ee.key==="ArrowLeft"?(Be?he(ct,!1):Xe?Qe(-10):Ye({x:Re?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowRight"?(Be?he(ct,!0):Xe?Qe(10):Ye({x:Re?10:1}),Ee.preventDefault()):Ee.key==="ArrowUp"?(Be?he(ct,!0):Ye({y:Re?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowDown"&&(Be?he(ct,!1):Ye({y:Re?10:1}),Ee.preventDefault())},children:[ve,Ve]})})})})),as=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},vF=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}]=Hl();return s.jsx("div",{...d,ref:s0([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})})})})),wF=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,E=Hi();u.useRef(E.getMode()).current=E.getMode();const C=_e(async(I,z,A=null,D=!0)=>{const F=async()=>{const B=await Promise.resolve(w?.showBusy?.(I.label()));try{await z();const M=A??I?.label?.();if(b){let N=null;I&&M!==!1&&(N=new Tt(I.key(),v,{label:M,description:M},F)),b(N)}B?.(),D&&E.setMode(null)}catch(M){B?.(),w?.showError?.(M)}};await F()},[b,w]),[R,_]=u.useReducer(I=>I+1,0),L=_e((I,z,A)=>{if(!m)return;const D=m.getMovableSelection();if(D.length===0)return;let F="Drawings";if(D.length===1){const M=D[0];F=$.TextUtils.capitalize(M.getContent().getType())??"Drawing"}const B=`${I.label()} ${F}`;C(I,()=>{let M=null;y&&(M=y.beginCommit(B));const N=m.getMovableSelection();if(N.length===0)return;const V=A?.(N);for(let U=0;U<N.length;U++){const J=N[U];z(J,V)}M?.commit()})},[m,y]),[T,j]=u.useState(m.getMovableSelection()[0]??null),[S,k]=u.useState(!T||T?.isProtected()),P=u.useMemo(()=>[new He("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 He("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 He("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 He("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 He("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 He("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 He("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 He("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 He("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){L(this,(I,z)=>{I.setBounds({x:z.x})},as)}),new He("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})},as)}),new He("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})},as)}),new He("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){L(this,(I,z)=>{I.setBounds({y:z.y})},as)}),new He("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})},as)}),new He("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})},as)}),new He("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 He("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 He("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new He("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new He("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new He("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new He("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new He("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new He("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[m,T]);u.useEffect(()=>{},[E]);const O=u.useMemo(()=>{let I=null;return I=x?x.createChildGroup(v,"movable",!1):new r0(v,"movable"),I.addCommands(P,!0),I},[x,P]);return sn(T,{onAnyChange:()=>{O.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===$.IAnchored.Type.TwoCell}),O.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===$.IAnchored.Type.OneCell}),O.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),O.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),O.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:I=>{k(I.isProtected())},onDelete:()=>{}}),sn(m,{onMovableSelectionChange:()=>{const I=m.getMovableSelection()[0]??null;j(I),k(!I||I.isProtected()),_()}}),sn(g,{onCollectionChange:()=>{_()}}),u.useEffect(()=>{const I={disabled:S};O.getCommand("formatAnchorTypeTwoCell").update(I),O.getCommand("formatAnchorTypeOneCell").update(I),O.getCommand("formatAnchorTypeAbsolute").update(I),O.getCommand("toggleLockAspectRatio").update(I);const z=g.getCount(),A=m.getMovableSelection(),D=S||z<=1||A.length===0;let F={disabled:D},B=F;if(!D&&A.length===1){const V=A[0];V.getZIndex()===0&&(F={disabled:!0}),V.getZIndex()===z-1&&(B={disabled:!0})}O.getCommand("moveToFront").update(B),O.getCommand("moveForward").update(B),O.getCommand("moveToBack").update(F),O.getCommand("moveBackward").update(F);const M={disabled:S||A.length<=1};O.getCommand("formatDrawAlignLeft").update(M),O.getCommand("formatDrawAlignCenter").update(M),O.getCommand("formatDrawAlignRight").update(M),O.getCommand("formatDrawAlignTop").update(M),O.getCommand("formatDrawAlignMiddle").update(M),O.getCommand("formatDrawAlignBottom").update(M),O.getCommand("formatDrawFlipHorz").update(M),O.getCommand("formatDrawFlipVert").update(M),O.getCommand("formatDrawGroup").update(M),O.getCommand("formatDrawUngroup").update(M),O.getCommand("formatDrawSwapShapes").update(M),O.getCommand("formatDrawSwapShapesHorz").update(M),O.getCommand("formatDrawSwapShapesVert").update(M);const N={disabled:S||A.length<=2};O.getCommand("formatDrawDistributeHorz").update(N),O.getCommand("formatDrawDistributeVert").update(N)},[R,S,R]),O}({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(bF,{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})),SF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:l,commands:c,notifier:d=yu}=e,p=Hi(),[f,h]=u.useState(null),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),[w,E]=u.useState(null);u.useLayoutEffect(()=>{if(y===null)return b(null),void E(null);const A=()=>{const D=o.getRange(y).getCell(),F=D.getStyle();let B,M=F.getFill()?.toCSS(r.body.darkMode);M.background!=="none"&&M.background!=="transparent"||(M=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),M.background!=="none"&&M.background!=="transparent"||(M={background:r.body.fill}),b({style:M}),D&&!D.getFormula()&&(B=D?.getRenderHorizontalAlignment()),E(B??"left")};return A(),o.getRange(y).addListener(()=>{A()})},[o,y,r?.body]);const C=_e(()=>{let A=g.editState.dirty??"";if(g.editState.dirty!==void 0){const D=$.TextUtils.clampString(A);try{const F=g.sheet.getRange(g.coords),B=`Typing '${D}' into ${F.toString()}`;return F.setValue(A,{description:B,autoFit:!0}),x(null),m(null),p.setMode(null),l(null),!0}catch(F){throw d.showError(new Error(`Unable to enter '${D}'.`,{cause:F})),F}}},[o,g,d]),R=_e(A=>o.getRange(A).getCell().getExtrusions()??Go.cellToRange(A),[o]);_e(A=>{let D=$.IRange.Orientation.Row,F=!1;A!==$.IRange.Direction.Up&&A!==$.IRange.Direction.Down||(D=$.IRange.Orientation.Column),A!==$.IRange.Direction.Left&&A!==$.IRange.Direction.Up||(F=!0),o.getSelection().traverse(D,F)},[o]);const _=u.useCallback((A,D)=>{if(i)return i(A,D);if(!o)return null;const{ref:F,...B}=A;return s.jsx(Xw,{ref:F,...B,sheet:o,bodyStyle:r?.body,activeCoords:D,commands:c,onChangeEdit:M=>{const N={sheet:o,coords:D,editState:M};p.setMode(V=>({...V,description:N.editState.editMode?"Edit":"Enter",args:{...V?.args,stateAndCoords:N}}))},editState:g.editState})},[o,v,i,g,y]),{overlay:L,startEdit:T,submitEdit:j,cancelEdit:S,onKeyboardEventNative:k,onPointerEventNative:P}=(A=>{const{view:D,canEdit:F=yz,getCellEditor:B,onBeforeStartEdit:M,onStartEdit:N,onSubmitEdit:V,onCancelEdit:U,onDoneEdit:J,isEditorStartKeyEvent:X=xz,isEditorStartPointerEvent:H=bz,containerProps:ne,borderStrokeFill:oe,borderStrokeWidth:ye=2,getRangeCoords:de=null,activeCoords:xe,alignment:we=lc.Left}=A,[ve,re]=u.useState(!1),[ce,Se]=u.useState(void 0),ie=wt((K,se,te,ae,pe,me)=>{if(!se)return null;const fe=pe?.(se,K),je=K.getRangeCoordsBounds(fe),Fe=K.toClipBounds(je),Ge=je,et=K.getZoom();if(!Fe)return null;te&&(te*=et),ae&&(ae*=et);let tt=Ge,it=!1;if(te!==void 0){let _t={...fe},$t=0;for(;!it&&tt.width<=te&&$t<20;){$t++,$t>19&&console.warn("max width reached");const nn=K.getTotalRangeCoords(),Zt=K.getLayout();me===lc.Left?_t.colEnd+1<nn.colEnd?_t.colEnd=Zt.getColIndex(tt.x+te):it=!0:me===lc.Right?_t.colStart-1>=0?_t.colStart=Zt.getColIndex(tt.x-(te-tt.width)):it=!0:me===lc.Center&&_t.colEnd+1<nn.colEnd&&_t.colStart-1>=0?(_t.colStart=Zt.getColIndex(tt.x-(te-tt.width)/2),_t.colEnd=Zt.getColIndex(tt.x+tt.width+(te-tt.width)/2)):it=!0,it||(tt=K.getRangeCoordsBounds(_t))}}tt.height=Ge.height,ae!==void 0&&(tt.height=Math.max(ae+1,Ge.height));const{width:At,height:Lt}=K.getViewportSize();return{x:tt.x??0,y:tt.y??0,height:Math.min(Lt-tt.y,tt.height)+1,width:Math.min(At-tt.x,tt.width)+1}},[we]),Y=wt(F,[F]),le=u.useCallback(()=>{D?.getStage()?.focus()},[D]),ee=u.useRef(null),Pe=wt(K=>{M?.(K),Ye(),re(!0),ee.current=null},[M]),Te=wt(K=>{N?.(K.coords)},[N]),rt=wt(K=>{K.isSubmitted||K.isCancelled||(Re.current.isEditorClosed=!0,le(),K.isCancelled=!0,U?.(K.coords),Ye())},[U]),Ve=wt(K=>{if(K.isSubmitted||K.isCancelled)return!1;try{return ee.current=K.coords,K.isEditorClosing=!0,K.isSubmitted=!0,K.isEditorSubmitted||(K.isEditorSubmitted=!0,K.editorRefs[0]?.submitEdit?.()),K.coords,V?.(K.coords),K.isEditorClosed=!0,le(),Ye(),!0}catch(se){throw K.isEditorClosing=!1,K.isSubmitted=!1,se}},[V]),Ee=wt(K=>{re(!1),J?.(K.coords),Ye()},[J]),Re=u.useRef(null),Xe=u.useRef(null),Be=u.useRef(null),ct=u.useRef([]),[Qe,he]=u.useReducer(K=>K+1,0),Ye=u.useCallback(K=>{K&&ct.current.push(K),he()},[]),ke=wt(K=>{if(K.defaultPrevented||K.isSynthetic||!D)return;const se=D?.getCellCoordsFromClient(K.clientX,K.clientY);se&&Ye({eventType:"pointer",event:K,coords:se})},[D]),Ie=wt(K=>{const se=K.nativeEvent;ke(se)},[D]),ue=wt(K=>{if(K.defaultPrevented||K.isSynthetic||!D?.getStage())return;const se=Xe.current;X(K,se)&&(K.stopPropagation(),K.preventDefault()),K.key,Ye({eventType:"keyboard",event:K,coords:se})},[D]);u.useLayoutEffect(()=>{const K=(ae,pe)=>{const me=pe?.cell??ae;if(!me)return null;const fe=me;if(!Y(me))return null;Pe?.(me);const je=Qo.uuidV4();pe=Object.freeze({autoFocus:!0,...pe}),Be.current=me;const Fe={coords:fe,startEvent:pe,uuid:je,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:Ge=>{Fe.isMounted||(Fe.isMounted=!0,Ye())},onUnmount:Ge=>{if(Fe.editorRefs.length===0){const et=()=>{Fe.isMounted=!1,Ye()};if(document.activeElement!==document.body)et();else{const tt=it=>{it.defaultPrevented||it.target!==document.body||ue(it)};window.addEventListener("keydown",tt,!0),D.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",tt),et()},{once:!0}),le()}}}};return Fe};if(ct.current.length<=0&&!Re.current)return;const se=ct.current[0];$9(se),(ae=>{const pe=[],me=ae?.length??0;for(let fe=0;fe<me;fe++){const je=ae[fe];pe.push($9(je))}})(ct.current),Re.current,Re.current;let te=Re.current;if(Re.current){if(Re.current.isDone)Re.current=null;else if(Re.current.isSubmitted||Re.current.isCancelled){if(Re.current.isMounted)return;Re.current.isDone||(Ee(Re.current),Re.current.isDone=!0)}}if(se){if(se.eventType==="start"){const ae=se,pe=ae.startEvent?.cell??Xe.current;Re.current&&Vt.isEqualCells(Re.current.coords,pe)||(Re.current=K(pe,ae.startEvent))}else if(se.eventType==="keyboard"){const ae=se.event;if(Re.current){let pe=!1;switch(ae.which){case 37:case 39:case 38:case 40:case 13:case 9:pe=!0}if(!pe){Re.current.events.push(se);for(let me=0;me<Re.current.editorRefsDispatchEditorEvent.length;me++)Re.current.editorRefsDispatchEditorEvent[me](se)}}else if(X(ae,se.coords)){const pe=K(Xe.current,void 0);pe&&pe.events.push(se),Re.current=pe}}else if(se.eventType==="pointer"){const ae=se.event;if(Re.current){Re.current.events.push(se);for(let pe=0;pe<Re.current.editorRefsDispatchEditorEvent.length;pe++)Re.current.editorRefsDispatchEditorEvent[pe](se)}else{const pe=se?.coords??Xe.current,me=H(ae,pe);if(me){let fe;typeof fe!="boolean"&&(fe=me);const je=K(pe,fe);je&&je.events.push(se),Re.current=je}}}else if(se.eventType==="submit"){if(Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;Ve(Re.current)}}else if(se.eventType==="cancel"){if(Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;rt(Re.current)}}else if(se.eventType==="coordsChange"){const ae=se;if(Xe.current=ae.activeCoords,Re.current,Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;try{Ve(Re.current)}catch{}}}}ct.current.length>0&&(ct.current.shift(),Ye()),ct.current.length===0&&(!Re.current||Re.current.isEditorClosing||Re.current.isEditorClosed?!Re.current&&te&&le():Re.current.isMounted&&!Re.current.isStarted&&(Re.current.isStarted=!0,Re.current.startEvent.autoFocus&&(typeof Re.current.startEvent.autoFocus=="string"?Re.current.editorRefs[0]?.autoFocus(Re.current.startEvent.autoFocus):Re.current.editorRefs[0]?.autoFocus()),Te?.(Re.current),requestAnimationFrame(()=>{D&&Re.current?.coords&&D.scrollCellCoordsIntoView(Re.current.coords)})))},[Qe]),u.useEffect(()=>{Be.current=xe;const K=Re.current?.coords;Vt.isEqualCells(K,xe)||(Re.current&&(Re.current.isEditorClosing=!0),Ye({eventType:"coordsChange",activeCoords:xe}))},[xe]);const De=u.useCallback(K=>{ue(K.nativeEvent)},[]),{width:Ae=0,height:W=0}=ce??{width:0,height:0},Q=wt(B,[B]);return{overlay:wt(K=>{if(!Re.current||Re.current.isEditorClosed)return Re.current,null;Re.current.coords;let se=ie(K,Re.current.coords,Ae,W,de,we),te=!0;se&&se.width!==0&&se.height!==0||(se={x:0,y:0,width:Ae,height:Ae},te=!1);const ae=K.getZoom(),pe={containerBounds:{x:0,y:0,width:se.width/ae,height:se.height/ae},setNaturalDimensions:Se,zoom:ae};return s.jsx(vz,{session:Re.current,refLatestCoords:Be,handleSubmitEdit:Ve,handleCancelEdit:rt,cellBounds:se,borderStrokeWidth:ye,borderStrokeFill:oe,isInBounds:te,getCellEditor:Q,propsEditor:pe,alignment:we,...ne},"editor:"+Re.current.uuid)},[B,de,Qe,Ae,W,we,ye,oe]),startEdit:u.useCallback(K=>{Ye({eventType:"start",startEvent:K})},[]),submitEdit:u.useCallback(()=>{Ye({eventType:"submit"})},[]),cancelEdit:u.useCallback(()=>{Ye({eventType:"cancel"})},[]),onKeyboardEvent:De,onPointerEvent:Ie,onKeyboardEventNative:ue,onPointerEventNative:ke,isEditing:ve}})({view:n,activeCoords:f,getCellEditor:_,canEdit:()=>{const A=!o.getProtection().isLocked();return A||a(),A},onBeforeStartEdit:A=>{const D=Yw(()=>o.getRange(A).getCell()),F={sheet:o,coords:A,editState:Object.freeze(D)};p.setMode({key:"edit",args:{stateAndCoords:F}}),m(F)},onStartEdit:A=>{x(A),l(A)},onSubmitEdit:C,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:R});sn(o.getSelection(),{onChange(A){h(o.getSelection().getCoords().cell)}});const O=_e(A=>{P(A),y&&j()},[P,S,y]),I=u.useCallback(A=>{P(A)},[P]),z=u.useCallback(A=>{k(A)},[k]);return u.useEffect(()=>{const A=n?.getStage();if(A)return A.addEventListener("pointerdown",O),A.addEventListener("dblclick",I),A.addEventListener("keydown",z),()=>{A.removeEventListener("pointerdown",O),A.removeEventListener("dblclick",I),A.removeEventListener("keydown",z)}},[n?.getStage()]),u.useEffect(()=>{const A=p.getMode(),D=A?.key;D==="edit"||D==="enter"?g?A.args?.cancel?S():A.args?.submit?j():m(A.args?.stateAndCoords):T(A.args?.start):y&&S()},[p]),L(n,t)})),nS="white",oS="black",CF=`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`,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 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`,EF=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=_e(()=>{if(o.getTables().getCount()>0){i(!0);const C=o.getTables().search({address:n.getVisibleRangeCoords()});l(C.length>0?C:null)}else i(!1),l(null)},[o,n]),y=_e(C=>{C.preventDefault(),C.stopPropagation();const R=n.getCellCoordsFromClient(C.clientX,C.clientY),_=o.getTables().search({address:R});_.length===1&&_[0].select()},[n,o]),x=_e(C=>{C.preventDefault(),C.stopPropagation();const R=n.getCellCoordsFromClient(C.clientX,C.clientY),_=o.getTables().search({address:R});if(_.length===1){const L=_[0].getRange().getCoords(),T={colStart:L.colStart,rowStart:R.rowIndex,colEnd:L.colEnd,rowEnd:R.rowIndex};o.getRange(T).select()}},[n,o]),v=_e(()=>{if(!r)return;const C=o.getTables().search({address:n.getVisibleRangeCoords()});l(C.length>0?C:null)},[o,r,n]);sn(o?.getSelection(),{onChange(C){d(o.getSelection().getCoords().cell)}}),sn(p,{onAnyChange(C){m(),v()}}),sn(h,{onAnyChange(C){v()}}),sn(o,{onTablesChange(C){m(),v()},onInvalidated(C){m(),v()}});const b=u.useMemo(()=>Xt.debounce(Xt.throttle(v,300),300),[]);u.useEffect(()=>{b()},[n]),u.useEffect(()=>{let C=null;if(a)for(let R=0;R<a.length&&!C;R++){const _=a[R],L=_.getRange().getCoords();$.CoordUtils.isCellWithinRange(c,L)&&(C=_)}f(C)},[c,a]);const w=_e(C=>{let R=null;if(a)for(let _=0;_<a.length;_++){const L=a[_],T=L.getRange().getCoords();let j=n.getRangeCoordsBounds(T);const S=n.getRelativePointFromClient(C.clientX,C.clientY),k=S.x,P=S.y;if(k>=j.x&&k<=j.x+j.width&&P>=j.y&&P<=j.y+j.height){const O=n.getViewportSize();k<=0||P<=0||k>=O.width||P>=O.height||(R=L)}}g(R)},[n,a]);if(u.useEffect(()=>{const C=n?.getStage();if(C&&a)return C.addEventListener("mousemove",w),C.addEventListener("mouseleave",w),()=>{C.removeEventListener("mousemove",w),C.removeEventListener("mouseleave",w)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const E=[];for(let C=0;C<a.length;C++){const R=a[C];if(R.isClosed())continue;const _=R===h,L=R===p,T=R.getRange().getCoords(),j=n.getRangeCoordsBounds(T);let S;if(_||L){const k=R.getStyle().getProperties(),P=k.headerRow?.fill?.background??k.wholeTable?.border?.top?.color?.toString();if(P&&o){const O=o.getStyles().parseColor(P);O&&(S=O.toCSS())}S||(S="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}E.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:j.height,pointerEvents:"all",cursor:CF},onMouseDown:x},`table-select-row-${R.getName()}`)),E.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:Math.min(16,j.height),pointerEvents:"all",cursor:kF},onMouseDown:y},`table-select-${R.getName()}`)),E.push(s.jsx(O2,{x:j.x,y:j.y,width:j.width,height:j.height,range:T,strokeWidth:L?.5:0,stroke:S??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:_?`${S} 0px 0px 1px 1px`:void 0}},`table-outline-${R.getName()}`))}return E})),MF=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=_e(()=>{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(()=>Xt.debounce(Xt.throttle(p,80),80),[]);if(sn(o?.getSelection(),{onChange(x){f()}}),sn(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&&!Xt.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(O2,{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})),TF={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=Xt.mergeContentful(e.body,i);return n.body=Xt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=Xt.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=Xt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Xt.mergeContentful(n.header,i),n.headerSelect=Xt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Xt.mergeContentful(n.headerSelect,i),n.headerSelectAll=Xt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Xt.mergeContentful(n.headerSelectAll,i),n},_F={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:E,onFocus:C,onBlur:R,style:_=_n.EmptyCssProperties,notifier:L,onShowTooltip:T,onShowColumnTooltip:j,onShowRowTooltip:S,onCloseTooltip:k,gridProps:P,cellRenderProps:O,...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),[D,{width:F,height:B}]=Hl(),M=_e(T,[T]),N=_e(j,[j]),V=_e(S,[S]),U=_e(k,[k]),J=u.useRef(!1);u.useLayoutEffect(()=>{J.current=!0},[n]);const X=n?.getStyles(),H=u.useMemo(()=>gg(o,X),[o,X]),ne=u.useMemo(()=>gg(r,X),[r,X]),{body:oe={},buttonSurface:ye={}}=H,{header:de={},headerSelect:xe={},headerSelectAll:we={}}=ne,ve=u.useRef(null),[re,ce]=u.useState(()=>n?.getView()),Se=(re?.getZoomScale()??100)/100,ie=u.useMemo(()=>({vertical:re.isShowColumnGridlines()&&Se>=.4,horizontal:re.isShowRowGridlines()&&Se>=.4}),[re?.isShowColumnGridlines(),re?.isShowRowGridlines(),Se]),Y=u.useMemo(()=>{if(re?.getGridLineColor())return{strokeDasharray:"1,1"}},[re?.getGridLineColor(),H]),le=a??re?.isShowColumnHeaders(),ee=c??re?.isShowRowHeaders(),[Pe,Te]=u.useState({width:0,height:0}),rt=u.useMemo(()=>{let Ze=40,be=20;const St=n?.getStyles().getNormal().getFont();if(Pe.width>0&&Pe.height>0){const q=St?.toCSS()?.fontFamily??H.header.text.fontFamily,Ce=St?.getSize()??H.header.text.fontSize,Z=$.IFont.getSharedMeasurer()(""+Pe.height,Math.ceil(Ce*$.IFont.getDeviceScale()),q);Ze=Z.width,be=Z.lineHeight}return{width:Math.round(Ze+5),height:Math.round(be+3)}},[Pe,H?.header.text,n]),Ve=ee?Se*rt.width:de.edgeStrokeWidth,Ee=le?Se*rt.height:de.edgeStrokeWidth,Re=Math.max(F,(n?.getColumnHeaders().getDefaultSize()??rt.width)+Ve+1),Xe=Math.max(B,(n?.getRowHeaders().getDefaultSize()??rt.height)+Ee+1),Be=u.useRef(new Map),ct=u.useRef(null),Qe=()=>({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(()=>Qe()),[ke,Ie]=u.useState(!1),[ue,De]=u.useState(null),Ae=!0,W=H.selection?.strokeFill,Q=u.useCallback(()=>pr.current,[]),[K,se]=u.useState(),te=_e(Ze=>{se(Ze),n&&n.getView()&&n.getView().setTopLeft(Ze?{left:Ze.left,top:Ze.top}:null),h?.(Ze)},[n,h]),ae=u.useRef(null);u.useEffect(()=>{if(!K||!n)return;const Ze=n.getRangeAtBounds({x:K.left,y:K.top,width:K.width,height:K.height});ae.current?.(),ae.current=Ze.addListener(()=>{const be=Ze.getCoords();ve?.current?.invalidate(be)})},[K,n]);const[pe,me]=u.useState(()=>n?.getView().getTopLeft()),fe=_e(Ze=>{const be=Go.cellToRange(Ze);if(n.isClosed())return be;const St=n.getRange(be,{excludeHidden:!0}).getMerges();return St.length===0?be:St[0]},[n]),je=Ze=>{if(!Ze||Ze.coords.colIndex===0&&Ze.coords.rowIndex===0)return null;const be={};return Ze.coords.colIndex>0&&(be[zo.Left]={index:Ze.coords.colIndex,scrollOffset:Ze.topLeft.left}),Ze.coords.rowIndex>0&&(be[zo.Top]={index:Ze.coords.rowIndex,scrollOffset:Ze.topLeft.top}),be},[Fe,Ge]=u.useState(()=>je(n.getView().getFreezePanes())),et=Hi(),tt=u.useCallback(()=>ve.current,[]),it=_e(Ze=>{et.setMode(be=>be?.key==="edit"?{...be,args:{...be.args}}:{key:"edit",args:{stateAndCoords:null,start:Ze}})},[]),At=_e(()=>K,[K]),Lt=function(Ze){const{sheet:be,onRepeatCommandChange:St,bodyStyle:q,commands:Ce,target:Z,notifier:ge,onStartEdit:We,getViewport:mt}=Ze,[Ue,Ut]=u.useState(null),[Mt,Bt]=u.useState(null),qt=u.useRef(null),fn=_e(We,[We]),Ht=_e(mt,[mt]),[Nt,io]=u.useState(),[Ct,an]=u.useState(()=>be?.getStyles().parseColor($.IColor.Scheme.Bg2)),[go,dn]=u.useState(()=>be?.getStyles().getNormal().getFont().getFill()),Kt=Hi();u.useRef(Kt.getMode()).current=Kt.getMode();const vo=hb(),[Bo,Kl]=u.useState(Xt.EmptyArray),Gl=u.useCallback(()=>{if(qt.current!==be)return;const Me=be.getSelectedRanges();let ot=null;Bo.length>0&&Go.isCellWithinRange(Ue,Bo[0].getRange().getCoords())&&(ot=Bo[0]);const dt=be?.getSelectedCell(),Ke=dt?.getCoords()??null;yo.unstable_batchedUpdates(()=>{W2(ot),Ut(Ke),Bt(Me)})},[be,Bo,Mt,Ue]),H2=u.useCallback(Xt.debounce(Gl,210),[Gl]);u.useEffect(()=>{qt.current=be,Gl()},[be]);const ar=_e(()=>be.getRange(Ue).getCell(),[be,Ue]),wo=_e(async(Me,ot,dt=null,Ke=!1,ht=!0)=>{const bt=Me?.label?.(),yn=async()=>{const un=await Promise.resolve(ht&&ge?.showBusy?.(bt??"Busy..."));try{await be.doBatch(async()=>ot(be),bt),Ke&&Kt.setMode(null),un&&un()}catch(ao){if(un&&un(),!ao)return;ge?.showError?.(ao)}},xn=[];let ln=!1;const Sn=async()=>(xn.push(yn),(async()=>{if(!ln){for(ln=!0;xn.length>0;){const un=xn.shift();un&&await un()}ln=!1}})());if(St){let un=null;if(dt!==!1&&Me){const ao=dt??bt;un=new Tt(Me.key(),Z,{label:ao,description:ao},Sn)}St(un)}return Sn()},[be,St,ge]),Jt=_e((Me,ot,dt=!1,Ke)=>wo(Me,ht=>{const bt=ht.getSelectedRanges();dt&&bt.updateStyle(null,Ke),bt.updateStyle(ot,Ke),bt.autoFit({expandOnly:$.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[be]),Yf=_e((Me,ot,dt)=>{wo(Me,Ke=>{let ht=ot;(dt||ot?.address)&&(ht=ht??{},!dt&&ot?.address?.startsWith("#")?dt=ot?.address.substring(1):dt&&(ht.displayText=dt)),Ke.getSelectedRange().setHyperlink(ht)})},[be]),Jf=_e((Me,ot)=>{wo(Me,dt=>{dt.getSelectedRange().setComments(ot)})},[be]),u0=_e((Me,ot)=>{wo(Me,dt=>{dt.getSelectedRanges().clear(ot)})},[be]),rl=_e(async(Me,ot,dt=!1,Ke=!1)=>wo(Me,async ht=>{let bt=ht.getSelectedRanges();dt&&(ot===$.IRange.Orientation.Row?bt=bt.getEntireRows(Ke):ot===$.IRange.Orientation.Column&&(bt=bt.getEntireColumns(Ke)));let yn=null;const xn=Kt.getMode()?.key;if(xn==="copy"||xn==="cut"){const ln=await vo.getClipboard().readReference();ln&&ln.getItemType()==="range"&&(yn=ln.getItem(),yn.getCoords()||(yn=null))}if(yn){const ln=await bt.insertFrom(yn,{...yn.getMarkOptions(),orientation:ot,autoSelect:!0});!ln||ln.isEntireRows()||ln.isEntireColumns()||ln.autoFit({orientations:$.IRange.Orientations.Row,minContent:!0}),Kt.setMode(null)}else bt.insert(ot,{autoSelect:!0})},"Insert Cells",!1),[Kt]),[ha,W2]=u.useState(null),BC=_e(Me=>be.getStyles().setDefaultTableStyle(Me),[be]),NC=_e(Me=>{be.getStyles().getTableStyle(Me)?.delete()},[be]),p0=_e((Me,ot)=>{wo(Me,async dt=>{const Ke=dt.getSelectedRange(),ht=dt.getSelectedCell().getCoords();let bt=null,yn=0;const xn=ht.rowIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex}).getExtended($.IRange.Direction.Up):null;xn&&dt.getRange({colStart:ht.colIndex,rowStart:xn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:xn.getCoords().rowStart}).isContentful()&&(bt=$.IRange.Direction.Up,yn=ht.rowIndex-xn.getCoords().rowEnd);const ln=ht.colIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex-1}).getExtended($.IRange.Direction.Left):null;if(ln&&dt.getRange({colStart:ln.getCoords().colStart,rowStart:ht.rowIndex,colEnd:ln.getCoords().colStart,rowEnd:ht.rowIndex}).isContentful()){const un=ht.colIndex-ln.getCoords().colEnd;(un<yn||!bt)&&(bt=$.IRange.Direction.Left,yn=un)}let Sn=null;if(bt===$.IRange.Direction.Up){if(Sn={...xn.getCoords()},(Sn.rowEnd===ht.rowIndex||!dt.getRange({colIndex:ht.colIndex,rowIndex:ht.rowIndex-1}).isContentful())&&Sn.rowStart>0&&dt.getRange({colIndex:ht.colIndex,rowIndex:Sn.rowStart-1}).isContentful()){const un=xn.getExtended($.IRange.Direction.Up);Sn={colStart:ht.colIndex,rowStart:un.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:xn.getCoords().rowEnd}}Sn.rowEnd=ht.rowIndex-1}else if(bt===$.IRange.Direction.Left){if(Sn={...ln.getCoords()},(Sn.colEnd===ht.colIndex||!dt.getRange({colIndex:ht.colIndex-1,rowIndex:ht.rowIndex}).isContentful())&&Sn.colStart>0&&dt.getRange({colIndex:Sn.colStart-1,rowIndex:ht.rowIndex}).isContentful()){const un=ln.getExtended($.IRange.Direction.Left);Sn={colStart:un.getCoords().colStart,rowStart:ht.rowIndex,colEnd:un.getCoords().colEnd,rowEnd:ht.rowIndex}}Sn.colEnd=ht.colIndex-1}if(Ke.size!==1&&bt){const un=Ke.getCoords(),ao=Ke.startIncrementalUpdates({orientation:$.IRange.Orientation.Column}),jo={...Sn},wr=un.rowStart,Di=un.rowEnd,Ai=un.colStart,Li=un.colEnd,Nr=bt===$.IRange.Direction.Up;for(let fr=Ai;fr<=Li;fr++){jo.colStart=Nr?fr:Sn.colStart+(fr-Ai),jo.colEnd=Nr?fr:Sn.colEnd+(fr-Ai);for(let No=wr;No<=Di;No++){jo.rowStart=Nr?Sn.rowStart+(No-wr):No,jo.rowEnd=Nr?Sn.rowEnd+(No-wr):No;const Dn=dt.getRange(jo).toString();ao.pushAt(No,fr,`=${ot}(${Dn})`)}}ao.apply()}else{const un=Sn?dt.getRange(Sn).toString():"",ao=`=${ot}(`;fn?.({text:`${ao}${un})`,editMode:!0,initialSelection:{start:ao.length,end:ao.length+un.length}})}},!1)},[be]),j1=_e((Me,ot,dt=!1,Ke=!0)=>{wo(Me,async ht=>{let bt=null;if(ha)return void ha.updateStyleOptions(ot);{const ln=ht.getSelectedRanges().getFixed(!0),Sn=ht.getSelectedRange().getDefaultSortCriteria();let un={ranges:ln,hasHeader:Sn?.options?.hasHeader??!1};bt=Ke?new Promise((ao,jo)=>{const wr={tableOptions:un,onCancel:()=>{jo()},onDone:Di=>{ao(Di)},context:{getNames:()=>ht.getNames()}};ge.showWindow?.("tableNew",wr)}):{option:"Ok",tableOptions:un}}const yn=await Promise.resolve(bt);if(yn?.option!=="Ok")throw null;const xn=await Promise.resolve(ge?.showBusy?.(Me.label()));try{await ht.getTables().add(yn.tableOptions.ranges.at(0),{styleName:ot?.name,clearFormatting:dt,hasHeader:yn.tableOptions.hasHeader}).getRange().select()}catch(ln){xn(),ge?.showError?.(ln)}xn()},!1,!0,!1)},[ha]),Qf=_e(()=>q,[q]),em=_e(Me=>({styles:()=>be.getStyles(),table:()=>Me,bodyStyle:Qf,getNames:()=>be.getNames()}),[be]),$C=_e(async(Me,ot,dt,Ke=!0)=>{let ht=null;if(!ot){let bt=be.getSelectedRange();bt.size===1&&(bt=bt.getSurrounding());let yn=be.getTables().search({address:be.getSelectedRange()});yn.length>0&&(ot=yn[0]),await bt.select()}if(ot){if(Ke){try{dt&&await ot.select()}catch{}ht=new Promise(async(bt,yn)=>{Me.update({context:em(ot)});const xn={command:Me,commands:Oe,notifier:ge,onDone:Sn=>{bt(Sn)}},ln=await ge.showWindow?.("tableDetails",xn,{disableAutoDestroy:!0});setTimeout(()=>{ln.focus()},180)})}Promise.resolve(ht).then(bt=>{},bt=>{ge?.showError?.(bt)})}},[ge]),tm=_e(async(Me,ot,dt=!1)=>{let Ke=null;if(ot)ot.isITable?Ke=ot:ot.getValue()&&(Ke=ot.getValue());else{const ht=be.getTables().search({address:be.getSelectedRange()});ht.length>0&&(Ke=ht[0])}if(Ke){if(!dt){const ht=Ke.getRange().getCoords(),bt=(ht.colEnd-ht.colStart+1)*(ht.rowEnd-ht.rowStart+1);if(bt>1e4&&await ge?.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 He("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 He("pasteTranspose",A,{label:"Paste Transpose",scopedLabels:{paste:"Transpose"},description:"Paste with the rows and columns flipped."}),new He("pasteLinks",A,{label:"Paste Links",scopedLabels:{paste:"Links"},description:"Paste as formula references to the original cells."})];m.addCommands(D,!0)},[m,f]),u.useEffect(()=>{if(!m)return;const A={disabled:!h.getProtection().isFormatCellsAllowed()};m.getCommand("pasteValues").updateCallback(D=>I.paste({...iF,...D})).update(A),m.getCommand("pasteFormats").updateCallback((D,F)=>I.paste({...aF,description:F.label(),...D})).update(A),m.getCommand("pasteFormulas").updateCallback((D,F)=>I.paste({...lF,description:F.label(),...D})).update(A),m.getCommand("pasteTranspose").updateCallback((D,F)=>I.paste({...sF,description:F.label(),...D})).update(A),m.getCommand("pasteLinks").updateCallback((D,F)=>I.paste({...cF,description:F.label(),...D})).update(A),m.getCommand("cut").update(A),m.getCommand("paste").update(A)},[h,m]);const z=u.useMemo(()=>{if(!S||!T.current)return;const A=S.key;if(A!=="copy"&&A!=="cut"&&A!=="formatPainter")return;const D=T.current.getItem();if(D.getSource()!==h)return;const F=T.current.isCut?.(),B=F?C:E,M=F?w:b,N=D.getCoords(),V=N?[N]:null;return V&&V.length!==0?U=>{const J=[];for(let X=0;X<V.length;X++){const H=V[X],ne=U.toClipBounds(U.getRangeCoordsBounds(H,{top:0,left:0,right:1,bottom:1}),Rr);ne&&(J.push(L({range:H,key:`copy-selection-background-${X}`,x:ne.x,y:ne.y,width:Math.max(ne.width,0),height:Math.max(ne.height,0),stroke:B,strokeWidth:2})),J.push(L({range:H,key:`copy-selection-foreground-${X}`,x:ne.x+(ne.width<=2?-1:0),y:ne.y,width:Math.max(ne.width,3),height:Math.max(ne.height,3),stroke:M,strokeWidth:2,isAnimatedStroke:!0})))}return J}:null},[S,h,g,b,E,w,C]);return{...I,clipboard:O,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 sn(r?.getSelection(),{onChange(f){}}),u.useEffect(()=>{n?.getStage()},[n?.getStage()]),p&&n?p(n):null})),uF={key:"dragCut",description:"Drag selection to move cell contents.",cursor:"move"},pF={key:"dragCutInsert",description:"Drag selection to insert cell contents.",cursor:"copy"},hF={key:"dragCopy",description:"Drag selection to copy cell contents."},fF={key:"dragCopyInsert",description:"Drag selection to insert copied cell contents.",cursor:"move"},fg=(e,t)=>t.ctrlKey&&t.shiftKey?fF:t.ctrlKey?hF:t.shiftKey?pF:uF,mF={key:"fill",description:"Drag selection to extend series or fill.",cursor:"crosshair"},gF=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=_e(l,[l]),v=_e(c,[c]),[b,w]=u.useState(()=>d?.getSelection().getCoords()),E=_e(de=>{Go.isEqualSelectionCoords(de,b)||d&&d.getSelection().updateCoords(de)},[d,b]),C=Hi(),R=u.useRef(null),[_,L]=u.useState(d?.getProtection().isLocked()),[T,j]=u.useState(d?.getView().getMovableSelection().length>0),S=_n.detectIt().primaryInput==="touch",k=!S&&h,P=g!==null||T,O=_e(de=>{const xe=Go.cellToRange(de);if(d.isClosed())return xe;const we=d.getRange(xe,{excludeHidden:!0}).getMerges();return we.length===0?xe:we[0]},[d]),I=_e((de,xe,we,ve,re,ce)=>{const Se=d.getSelectedRange().getExtended(ve,de).getCoords();switch(ve){case $.IRange.Direction.Up:return Se.rowStart;case $.IRange.Direction.Down:return Se.rowEnd;case $.IRange.Direction.Left:return Se.colStart;case $.IRange.Direction.Right:return Se.colEnd}},[d]),z=_e(()=>{const de=d.getUsedRange()?.getCoords(),xe=d.getRowHeaders().getUsedRange()?.getCoords(),we=d.getColumnHeaders().getUsedRange()?.getCoords();return{...de,colEnd:Math.max(de?.colEnd??0,we?.max??0),rowEnd:Math.max(de?.rowEnd??0,xe?.max??0)}},[d]),A=_e((de,xe)=>d.getRowHeaders().hiddenHeadersAt(de,xe),[d]),D=_e((de,xe)=>d.getColumnHeaders().hiddenHeadersAt(de,xe),[d]),F=_e(de=>d.getRange(de,{excludeHidden:!0}).getMerges(),[d]),B=_e(de=>{d?.getSelection().setAdjusting(de)},[d]),M=_e(async()=>{d?.getSelection().setAdjusting(null),C.getMode()?.key==="formatPainter"&&(await o?.getCommand("pasteFormats")?.execute({}),C.setMode(null))},[C,b,d,o]),N=u.useMemo(()=>{const de=C.getMode();return de?.key==="cut"||de?.key==="copy"},[C]);sn(d?.getView(),{onMovableSelectionChange:()=>{j(d.getView().getMovableSelection().length>0)}}),sn(d?.getSelection(),{onChange(de){const xe=d.getSelection().getCoords();w(xe)}}),sn(d,{onProtectionChange:()=>{L(d.getProtection().isLocked())}});const{body:V={}}=f||{},U=n.getLayout(),J=!(k&&b.ranges.length<=1&&g===null&&!_&&(!C.getMode()||N)),{overlay:X,onPointerDown:H}=Ww({gridRef:p,commands:o,layout:U,getCellCoordsAsRangeCoords:O,selection:b,fillHandleBorderColor:V.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:J,disableMoveDrag:S||!(h&&b.ranges.length<=1&&g===null&&!_),disableTouchSelection:P,onSelectionChange:E,onSelectionDragStart:B,onSelectionDragEnd:M,onMoveDragStart:(de,xe,we)=>{C.setMode(fg(0,we))},onMoveDragUpdate:(de,xe,we)=>{C.setMode(fg(0,we))},onMoveDragEnd:(de,xe)=>{C.setMode(null)},onMoveDragDone:async(de,xe,we)=>{if(Go.isEqualRanges(de,xe))return;const ve=d.getRange(xe);if(a?.showOptions){const Y=ve.getDifferences(de);let le=!1;for(let ee=0;!le&&ee<Y.getCount();ee++)le=Y.at(ee).isContentful();if(le&&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 re=!we.ctrlKey,ce=we.shiftKey,Se=ce?re?"Insert Moved Cells":"Insert Copied Cells":re?"Move Cells":"Copy Cells",ie=await a?.showBusy?.(Se);try{const Y=d.getRange(de);await ve.doBatch(async()=>{ce?await ve.insertFrom(de,{isCut:re,undoRange:Y}):await ve.copyFrom(de,{isCut:re,undoRange:Y}),Y.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0}),ve.autoFit({skipCustomSize:!0,orientations:$.IRange.Orientations.Row,minContent:!0})},{description:Se,autoSelect:!0})}catch(Y){a?.showError?.(Y)}finally{ie?.()}},contentfulCellFinder:I,hiddenRowsAt:A,hiddenColumnsAt:D,mergedRanges:F,getDataCoords:z,canSelectionSpanMergedCells:de=>{const xe=d.getRange(de);return xe.isEntireColumns()||xe.isEntireRows()},onFill:async(de,xe)=>{const we="Auto Fill",ve=await a?.showBusy?.(we);try{await d.doBatch(()=>{d.getRange(de).autoFill(xe),d.getRange(xe).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},{description:we,autoSelect:!0})}catch(re){a?.showError?.(re)}finally{R.current=null,ve?.()}},onFillPreview:(de,xe,we)=>{if(p.current&&x){C.setMode(mF);try{R.current?.direction!==we&&(R.current=null,d.getRange(de).autoFill(xe,{previewOnly:ee=>{R.current={callback:ee,direction:we}}}));const ve=R.current?.callback?.(xe);if(!ve||ve.isEmpty())return;const re=ve.toText();if(!re)return;const ce=Go.cellToRange(ve.getCoords()),Se=n.getRelativePointFromClient(0,0);let ie=0,Y=0,le=fp;if(we===$.IRange.Direction.Down){ie=U.getColOffset(ce.colEnd+1)-Se.x;const ee=U.getRowOffset(ce.rowEnd),Pe=U.getRowOffset(ce.rowEnd+1);Y=Pe-(Pe-ee)/2-Se.y,le=U5}else if(we===$.IRange.Direction.Right){Y=U.getRowOffset(ce.rowEnd+1)-Se.y;const ee=U.getColOffset(ce.colEnd),Pe=U.getColOffset(ce.colEnd+1);ie=Pe-(Pe-ee)/2-Se.x,le=fp}else if(we===$.IRange.Direction.Up){ie=U.getColOffset(ce.colEnd+1)-Se.x;const ee=U.getRowOffset(ce.rowStart),Pe=U.getRowOffset(ce.rowStart+1);Y=Pe-(Pe-ee)/2-Se.y,le=U5}else if(we===$.IRange.Direction.Left){Y=U.getRowOffset(ce.rowEnd+1)-Se.y;const ee=U.getColOffset(ce.colStart),Pe=U.getColOffset(ce.colStart+1);ie=Pe-(Pe-ee)/2-Se.x,le=fp}x({anchor:{x:ie,y:Y},display:re,placement:le})}catch(ve){a?.showError?.(ve)}}},onFillDone:()=>{R.current=null,C.setMode(null),v?.()}}),ne=_e(de=>{H(_n.createSyntheticEvent(de))},[H,g]);u.useEffect(()=>{const de=n?.getStage();if(de)return de.addEventListener("pointerdown",ne),()=>{de.removeEventListener("pointerdown",ne)}},[n?.getStage()]);const oe=ir(t,()=>({}),[]),ye=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:s0([oe,ye]),...m,children:X(n)})})),Cd=Object.freeze({x:0,y:0,width:0,height:0}),yF={fireOnModelChange:!1},xF=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(Cd),[w,E]=u.useState(null),[C,R]=u.useState(!1),_=u.useRef(null);u.useLayoutEffect(()=>{if(r.isClosed())return;const T=r.getBounds();if(!T)return;const j=o.toViewBounds(T);b(j??Cd),f(j??Cd)},[o?.getBounds()]),sn(r,{onBoundsChange:T=>{const j=T.getBounds();if(!j)return;const S=o.toViewBounds(j);b(S??Cd),f(S)},onSelectionChange:()=>{const T=Xt.hasFocus(_.current,!0);!C&&!T||r.isSelected()||d()}}),sn(r,{onRequestFocus:()=>Xt.whenFocus(_.current,!0)},yF),u.useEffect(()=>{const T=_.current;return i(T),()=>{a(T)}},[]);const L=u.useMemo(()=>{if(!v)return null;let{width:T,height:j}=v;return y({view:o,movable:r,disabled:m,isDragging:p,style:{position:"relative",left:0,top:0,width:T,height:j},onHide:l,onShow:c})},[o,r,v.width,v.height,m,p]);return s.jsx("div",{className:"movable",tabIndex:0,ref:s0([_,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 j=T.shiftKey||T.ctrlKey,S=r.isSelected(),k=T.currentTarget;j&&S?r.unselect():(S&&!j||await r.select({addToSelection:j}),h(T.nativeEvent,k),k.focus())},onFocus:T=>{T.relatedTarget&&!w&&E(T.relatedTarget),R(!0)},onBlur:T=>{w&&!_?.current?.contains(T.relatedTarget)&&E(null),T.relatedTarget&&R(!1)},...x,children:L})})),bF=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=_e(y,[y]),w=_e(l,[l]),E=_e(c,[c]),[C,R]=u.useState([]),[_,L]=u.useState(!1),[T,j]=u.useState(!1),S=u.useRef(!0),k=u.useRef(new Map),P=u.useRef(new Map),O=u.useRef(new Map),I=u.useRef(new Map),z=u.useRef(new Map),A=u.useRef({onRequestFocus:Ee=>(we(Ee),null)}),D=u.useRef(null),F=u.useRef(null),B=u.useRef(null),[M,N]=u.useReducer(Ee=>Ee+1,0);u.useLayoutEffect(()=>{N()},[n,o]),sn(o,{onCollectionChange:()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0}),Re=z.current;Re.forEach(Be=>{Be()}),Re.clear();const Xe=A.current;for(let Be=0;Be<Ee.length;Be++){const ct=Ee[Be];if(ct.isClosed())continue;const Qe=ct.addListeners(Xe);Re.set(ct,Qe)}N()},onInvalidated:()=>{N()}}),sn(r,{onMovableSelectionChange(Ee){U(),N()}});const V=u.useCallback((Ee,Re)=>{const Xe=O.current.get(Ee);B.current&&(B.current.getTargets().forEach(Be=>{if(Be===Xe)return Be.style.left=Re.x+"px",Be.style.top=Re.y+"px",Be.style.width=Re.width+"px",void(Be.style.height=Re.height+"px")}),B.current.updateRect())},[]),U=()=>{const Ee=[],Re=r.getMovableSelection();Re.forEach(Xe=>{const Be=O.current.get(Xe);Be&&Re.indexOf(Xe)!==-1&&Ee.push(Be)}),R(Xe=>Xt.isEqualArrays(Xe,Ee)?Xe:Ee)},J=u.useRef(null),X=u.useMemo(()=>new Promise(Ee=>{J.current=Ee}),[]),H=u.useRef(null),ne=_e(async(Ee,Re)=>{H.current=Re,await(async()=>!(!await X.then()||!B.current))()&&H.current===Re&&B.current.dragStart(Ee,Re)},[C]),[oe,ye]=u.useState(!1),de=u.useRef(null),xe=u.useRef(null),we=_e(async(Ee=null)=>{if(Ee||(Ee=r.getMovableSelection()[0]),!Ee)return w?.(),!1;const Re=O.current.get(Ee);Re?(await Xt.whenFocus(Re),Re.focus(),xe.current=Re,de.current=null):de.current=Ee},[r]);u.useEffect(()=>{oe&&C.length>0&&xe.current!==C[0]&&we(),S.current&&(b?.(),S.current=!1)},[C]);const ve=u.useMemo(()=>{const Ee=o.search({address:n.getVisibleRangeCoords(),excludeHidden:!0});if(Ee.length===0&&k.current.size===0)return null;const Re=(he,Ye,ke,Ie=!0)=>{const ue=he.isSelected(),De={tabIndex:ke,view:n,movable:he,onRefLoad:Ae=>{de.current===he&&(Ae.focus(),xe.current=Ae,de.current=null),O.current.set(he,Ae),P.current.set(Ae,he),Ye.rendered=!0,U()},onRefUnload:Ae=>{O.current.delete(he),P.current.delete(Ae),Ye.rendered=!1,U()},onUnFocus:w,onHide:Ae=>{Ye.onHide=Ae},onShow:Ae=>{Ye.onShow=Ae},isDragging:ue&&(T||_),disabled:d,renderMovable:i,updateFrameBounds:Ae=>{V(he,Ae)},dragStart:ne,onMouseUp:()=>{if(H.current=null,F.current){L(!1),j(!1);let Ae=!1;I.current?.forEach(W=>{Xt.isEqualBounds(W.movable.getBounds(),W.startBounds)||(Ae=!0)}),Ae?ce():Se()}},style:{opacity:Ie?_&&ue?.7:void 0:0,zIndex:_&&ue?he.getZIndex()+Ee.length:void 0,pointerEvents:Ie?void 0:"none",cursor:T&&ue?"grabbing":d||p?"initial":"move",boxShadow:!ue||T&&!_?void 0:"1px 1px 2px 2px rgba(0,0,0,.15)"}};return s.jsx(xF,{...De},`movable-${he.getUUID()}`)},Xe=k.current,Be=new Map,ct=[];for(let he=0;he<Ee.length;he++){const Ye=Ee[he];if(Ye.isClosed())continue;let ke=Xe.get(Ye);ke||(ke={frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(Ie,ue)=>{if(!ue||ue.shown===!0)return;ue.shown=!0;const De=++ue.visibilityRequestId;requestAnimationFrame(()=>{const Ae=k.current.get(Ie);Ae&&De===ue.visibilityRequestId&&(ue.onShow?.(Ie),Ae.shown=!0)})},doHide:async(Ie,ue)=>{if(!ue||ue?.shown===!1)return;ue.shown=!1;const De=++ue.visibilityRequestId,Ae=await Promise.resolve(ue.onHide?.(Ie));De===ue.visibilityRequestId&&Ae!==!1&&(ue.shown=!1,k.current.delete(Ie),N())},visibilityRequestId:0}),ke.frame=Re(Ye,ke,he,!0),ct.push(ke.frame),ke.doShow(Ye,ke),Xe.delete(Ye),Be.set(Ye,ke)}const Qe=[];return r.getMovableSelection().forEach(he=>{const Ye=Xe.get(he);Ye&&(Ye.frame=Re(he,Ye,-1,!1),Qe.push(Ye.frame),Xe.delete(he),Be.set(he,Ye))}),Xe.forEach((he,Ye)=>{he.frame=Re(Ye,he,-1,!1),Qe.push(he.frame),he.doHide(Ye,he),Xe.delete(Ye),Be.set(Ye,he)}),k.current=Be,U(),[...Qe,...ct]},[M,n,i,d,p,f,_,T]),re=_e((Ee,Re)=>{const Xe=`${Re} ${C.length===1?$.TextUtils.capitalize(P.current?.get(C[0]).getContent().getType()):"Drawings"}`;F.current&&(console.warn(`Transaction ${F.current.getDescription()} is being replaced by ${Xe}`),F.current.rollback(),F.current=null),F.current=a.beginCommit({description:Xe}),I.current.clear();for(let Be=0;Be<C.length;Be++){const ct=C[Be],Qe=P.current?.get(ct);Qe?I.current.set(ct,{movable:Qe,startBounds:n.toViewBounds(Qe.getBounds())}):console.warn("invalid element",Qe)}},[a,n,C]),ce=u.useCallback(()=>{if(!F.current)return;const Ee=[];I.current?.forEach(Re=>{Ee.push(Re.movable)}),F.current.commit({viewAfter:{view:r,movableSelection:Ee}}),I.current.clear(),F.current=null},[]),Se=u.useCallback(()=>{F.current&&(F.current.rollback(),F.current=null)},[]),ie=u.useRef(null);u.useEffect(()=>{ie.current&&(ie.current.onscroll=Ee=>{Ee.preventDefault(),Ee.srcElement.scrollTop=0,Ee.srcElement.scrollLeft=0})},[ie.current]);const Y=ir(t,()=>({isMovableArea:()=>!0,focusMovable:we,focus:()=>{we()}}),[r]),[le,ee]=u.useState(null),Pe=u.useRef(!1),Te=u.useRef(!1),rt=u.useRef(!1);u.useEffect(()=>{if(d||C.length===0||rt.current||Pe.current)return;if(Te.current)return void requestAnimationFrame(()=>{B.current&&D.current&&B.current.refTargets.length>0&&(rt.current=!0,J.current?.(!0)),R([...C])});Pe.current=!0;const Ee=u.lazy(async()=>{try{const Re=await Promise.resolve().then(()=>require("./9UJAgr17pC52FvNS.cjs"));return Pe.current=!1,Te.current=!0,R([...C]),Re}catch(Re){return console.warn(Re),J.current?.(!1),null}});ee(Ee)},[C,d,p,f]);const Ve=u.useMemo(()=>!le||d?null:s.jsx(u.Suspense,{children:s.jsx(le,{className:Zr({dragging:_||T,resizing:_,moving:T}),container:null,ref:B,target:B.current?C:[],draggable:!d&&!p,resizable:!d&&!f,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:m,onResizeStart:Ee=>{re(Ee.target,"Resize")},onResize:Ee=>{if(!F.current)return Ee.stopDrag(),void N();L(!0);const Re=Ee.direction[0]!==0&&Ee.direction[1]!==0;let Xe=0,Be=0;for(let ct=0;ct<C.length;ct++){const Qe=C[ct],he=I.current.get(Qe),Ye=P.current.get(Qe);if(!he||!Ye){console.warn("invalid element");continue}let ke=Ee.dist[0],Ie=Ee.dist[1],ue=Ee.drag.dist[0],De=Ee.drag.dist[1],Ae=he.startBounds.width,W=he.startBounds.height;ct===0?(Xe=Ae,Be=W):(ke*=Ae/Xe,ue*=Ae/Xe,Ie*=W/Be,De*=W/Be);const Q={...he.startBounds};if(Q.width=Math.max(0,Ae+ke),Q.height=Math.max(0,W+Ie),Ee.direction[0]===-1&&(Q.width=Math.max(0,Math.min(he.startBounds.x+Ae,Ae-ue))),Ee.direction[1]===-1&&(Q.height=Math.max(0,Math.min(he.startBounds.y+W,W-De))),Re&&(Ye.isLockAspectRatio()||Ee.inputEvent?.shiftKey)){const K=Ae/W,se=Q.width/Q.height;se>K?Q.height=Q.width/K:se<K&&(Q.width=Q.height*K)}Ee.direction[0]===-1&&(Q.x=Math.max(0,Math.min(he.startBounds.x+Ae,he.startBounds.x+Ae-Q.width))),Ee.direction[1]===-1&&(Q.y=Math.min(he.startBounds.y+W,he.startBounds.y+W-Q.height)),he.movable.setBounds(n.toAbsoluteBounds(Q))}},onResizeEnd:Ee=>{L(!1),ce()},onDragStart:Ee=>{re(Ee.target,"Move")},onDrag:Ee=>{if(!F.current)return Ee.stopDrag(),void N();j(!0);for(let Re=0;Re<C.length;Re++){const Xe=C[Re],Be=I.current.get(Xe);Be?Be.movable.setBounds(n.toAbsoluteBounds({...Be.startBounds,x:Be.startBounds.x+Ee.translate[0],y:Be.startBounds.y+Ee.translate[1]})):console.warn("invalid element")}},onDragEnd:Ee=>{},onMouseUp:Ee=>{}})}),[M,le,C,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:s0([Y,ie]),...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:D,style:{position:"absolute",pointerEvents:"auto"},onFocus:Ee=>{E?.(),ye(!0)},onBlur:Ee=>{ye(!1)},onKeyDownCapture:Ee=>{if(Ee.isDefaultPrevented())return;const Re=Ee.nativeEvent.ctrlKey,Xe=Ee.nativeEvent.altKey,Be=Ee.nativeEvent.shiftKey;if(Ee.which===tn.Escape){const ke=r.getMovableSelection();let Ie=[...ke];return C.forEach(ue=>{if(Ie.length===0)return;const De=P.current.get(ue);let Ae=Ie.indexOf(De);Ie.splice(Ae,1)}),Ie.length!==ke.length&&r.selectMovables(Ie),Ie.length===0&&w?.(),void Ee.preventDefault()}const ct=.1,Qe=ke=>{o.updateSelected(Ie=>{Ie.setRotation(Ie.getRotation()+ke)},"Rotate")},he=(ke,Ie=!0)=>{o.updateSelected(ue=>{const De=ue.getBounds();let Ae=1+ke;Ie||(Ae=1/Ae);const W=Math.sqrt(Math.pow(De.width,2)+Math.pow(De.height,2)),Q=Math.atan2(De.height,De.width),K=Ae*W;if(K<10)return;const se=K*Math.cos(Q),te=K*Math.sin(Q),ae={x:De.x+(De.width-se)/2,y:De.y+(De.height-te)/2,width:se,height:te};ue.setBounds(ae)},"Resize")},Ye=ke=>{o.updateSelected(Ie=>{const ue=Ie.getBounds(),De={x:ue.x+(ke.x??0),y:ue.y+(ke.y??0),width:ue.width+(ke.width??0),height:ue.height+(ke.height??0)};Ie.setBounds(De)},"Nudge")};if(Ee.which===tn.Delete)o.updateSelected(ke=>{ke.delete()},"Delete"),Ee.preventDefault();else if(Ee.key==="a"&&Re){const ke=r.getMovableSelection();r.selectMovables(o.search(),!0),r.selectMovables(ke,!0),Ee.preventDefault()}else Ee.key==="ArrowLeft"?(Be?he(ct,!1):Xe?Qe(-10):Ye({x:Re?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowRight"?(Be?he(ct,!0):Xe?Qe(10):Ye({x:Re?10:1}),Ee.preventDefault()):Ee.key==="ArrowUp"?(Be?he(ct,!0):Ye({y:Re?-10:-1}),Ee.preventDefault()):Ee.key==="ArrowDown"&&(Be?he(ct,!1):Ye({y:Re?10:1}),Ee.preventDefault())},children:[ve,Ve]})})})})),as=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},vF=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}]=Hl();return s.jsx("div",{...d,ref:s0([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})})})})),wF=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,E=Hi();u.useRef(E.getMode()).current=E.getMode();const C=_e(async(I,z,A=null,D=!0)=>{const F=async()=>{const B=await Promise.resolve(w?.showBusy?.(I.label()));try{await z();const M=A??I?.label?.();if(b){let N=null;I&&M!==!1&&(N=new Tt(I.key(),v,{label:M,description:M},F)),b(N)}B?.(),D&&E.setMode(null)}catch(M){B?.(),w?.showError?.(M)}};await F()},[b,w]),[R,_]=u.useReducer(I=>I+1,0),L=_e((I,z,A)=>{if(!m)return;const D=m.getMovableSelection();if(D.length===0)return;let F="Drawings";if(D.length===1){const M=D[0];F=$.TextUtils.capitalize(M.getContent().getType())??"Drawing"}const B=`${I.label()} ${F}`;C(I,()=>{let M=null;y&&(M=y.beginCommit(B));const N=m.getMovableSelection();if(N.length===0)return;const V=A?.(N);for(let U=0;U<N.length;U++){const J=N[U];z(J,V)}M?.commit()})},[m,y]),[T,j]=u.useState(m.getMovableSelection()[0]??null),[S,k]=u.useState(!T||T?.isProtected()),P=u.useMemo(()=>[new He("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 He("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 He("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 He("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 He("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 He("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 He("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 He("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 He("formatDrawAlignLeft",v,{label:"Align Left",description:"Align the selected drawings to the left."},function(){L(this,(I,z)=>{I.setBounds({x:z.x})},as)}),new He("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})},as)}),new He("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})},as)}),new He("formatDrawAlignTop",v,{label:"Align Top",description:"Align the selected drawings to the top."},function(){L(this,(I,z)=>{I.setBounds({y:z.y})},as)}),new He("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})},as)}),new He("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})},as)}),new He("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 He("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 He("formatDrawFlipHorz",v,{label:"Flip Horizontally",description:"Flip the selected drawings horizontally."}),new He("formatDrawFlipVert",v,{label:"Flip Vertically",description:"Flip the selected drawings vertically."}),new He("formatDrawGroup",v,{label:"Group",description:"Group the selected drawings into a single drawing."}),new He("formatDrawUngroup",v,{label:"Ungroup",description:"Break the group of a drawing into individual drawings."}),new He("formatDrawSwapShapes",v,{label:"Swap Shapes",description:"Swap the positions of the swap."}),new He("formatDrawSwapShapesHorz",v,{label:"Swap Shapes Horizontally",description:"Swap the positions of the swap horizontally."}),new He("formatDrawSwapShapesVert",v,{label:"Swap Shapes Vertically",description:"Swap the positions of the swap vertically."})],[m,T]);u.useEffect(()=>{},[E]);const O=u.useMemo(()=>{let I=null;return I=x?x.createChildGroup(v,"movable",!1):new r0(v,"movable"),I.addCommands(P,!0),I},[x,P]);return sn(T,{onAnyChange:()=>{O.getCommand("formatAnchorTypeTwoCell").update({state:T?.getAnchorType()===$.IAnchored.Type.TwoCell}),O.getCommand("formatAnchorTypeOneCell").update({state:T?.getAnchorType()===$.IAnchored.Type.OneCell}),O.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),O.getCommand("formatAnchorTypeAbsolute").update({state:T?.getAnchorType()===$.IAnchored.Type.Absolute}),O.getCommand("toggleLockAspectRatio").update({state:T?.isLockAspectRatio()})},onProtectedChange:I=>{k(I.isProtected())},onDelete:()=>{}}),sn(m,{onMovableSelectionChange:()=>{const I=m.getMovableSelection()[0]??null;j(I),k(!I||I.isProtected()),_()}}),sn(g,{onCollectionChange:()=>{_()}}),u.useEffect(()=>{const I={disabled:S};O.getCommand("formatAnchorTypeTwoCell").update(I),O.getCommand("formatAnchorTypeOneCell").update(I),O.getCommand("formatAnchorTypeAbsolute").update(I),O.getCommand("toggleLockAspectRatio").update(I);const z=g.getCount(),A=m.getMovableSelection(),D=S||z<=1||A.length===0;let F={disabled:D},B=F;if(!D&&A.length===1){const V=A[0];V.getZIndex()===0&&(F={disabled:!0}),V.getZIndex()===z-1&&(B={disabled:!0})}O.getCommand("moveToFront").update(B),O.getCommand("moveForward").update(B),O.getCommand("moveToBack").update(F),O.getCommand("moveBackward").update(F);const M={disabled:S||A.length<=1};O.getCommand("formatDrawAlignLeft").update(M),O.getCommand("formatDrawAlignCenter").update(M),O.getCommand("formatDrawAlignRight").update(M),O.getCommand("formatDrawAlignTop").update(M),O.getCommand("formatDrawAlignMiddle").update(M),O.getCommand("formatDrawAlignBottom").update(M),O.getCommand("formatDrawFlipHorz").update(M),O.getCommand("formatDrawFlipVert").update(M),O.getCommand("formatDrawGroup").update(M),O.getCommand("formatDrawUngroup").update(M),O.getCommand("formatDrawSwapShapes").update(M),O.getCommand("formatDrawSwapShapesHorz").update(M),O.getCommand("formatDrawSwapShapesVert").update(M);const N={disabled:S||A.length<=2};O.getCommand("formatDrawDistributeHorz").update(N),O.getCommand("formatDrawDistributeVert").update(N)},[R,S,R]),O}({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(bF,{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})),SF=u.memo(u.forwardRef((e,t)=>{const{view:n,sheet:o,gridStyle:r,getCellEditor:i,showProtectedError:a,setEditingCoords:l,commands:c,notifier:d=yu}=e,p=Hi(),[f,h]=u.useState(null),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),[w,E]=u.useState(null);u.useLayoutEffect(()=>{if(y===null)return b(null),void E(null);const A=()=>{const D=o.getRange(y).getCell(),F=D.getStyle();let B,M=F.getFill()?.toCSS(r.body.darkMode);M.background!=="none"&&M.background!=="transparent"||(M=o.getStyles().getNormal().getFill().toCSS(r.body.darkMode)),M.background!=="none"&&M.background!=="transparent"||(M={background:r.body.fill}),b({style:M}),D&&!D.getFormula()&&(B=D?.getRenderHorizontalAlignment()),E(B??"left")};return A(),o.getRange(y).addListener(()=>{A()})},[o,y,r?.body]);const C=_e(()=>{let A=g.editState.dirty??"";if(g.editState.dirty!==void 0){const D=$.TextUtils.clampString(A);try{const F=g.sheet.getRange(g.coords),B=`Typing '${D}' into ${F.toString()}`;return F.setValue(A,{description:B,autoFit:!0}),x(null),m(null),p.setMode(null),l(null),!0}catch(F){throw d.showError(new Error(`Unable to enter '${D}'.`,{cause:F})),F}}},[o,g,d]),R=_e(A=>o.getRange(A).getCell().getExtrusions()??Go.cellToRange(A),[o]);_e(A=>{let D=$.IRange.Orientation.Row,F=!1;A!==$.IRange.Direction.Up&&A!==$.IRange.Direction.Down||(D=$.IRange.Orientation.Column),A!==$.IRange.Direction.Left&&A!==$.IRange.Direction.Up||(F=!0),o.getSelection().traverse(D,F)},[o]);const _=u.useCallback((A,D)=>{if(i)return i(A,D);if(!o)return null;const{ref:F,...B}=A;return s.jsx(Xw,{ref:F,...B,sheet:o,bodyStyle:r?.body,activeCoords:D,commands:c,onChangeEdit:M=>{const N={sheet:o,coords:D,editState:M};p.setMode(V=>({...V,description:N.editState.editMode?"Edit":"Enter",args:{...V?.args,stateAndCoords:N}}))},editState:g.editState})},[o,v,i,g,y]),{overlay:L,startEdit:T,submitEdit:j,cancelEdit:S,onKeyboardEventNative:k,onPointerEventNative:P}=(A=>{const{view:D,canEdit:F=yz,getCellEditor:B,onBeforeStartEdit:M,onStartEdit:N,onSubmitEdit:V,onCancelEdit:U,onDoneEdit:J,isEditorStartKeyEvent:X=xz,isEditorStartPointerEvent:H=bz,containerProps:ne,borderStrokeFill:oe,borderStrokeWidth:ye=2,getRangeCoords:de=null,activeCoords:xe,alignment:we=lc.Left}=A,[ve,re]=u.useState(!1),[ce,Se]=u.useState(void 0),ie=wt((K,se,te,ae,pe,me)=>{if(!se)return null;const fe=pe?.(se,K),je=K.getRangeCoordsBounds(fe),Fe=K.toClipBounds(je),Ge=je,et=K.getZoom();if(!Fe)return null;te&&(te*=et),ae&&(ae*=et);let tt=Ge,it=!1;if(te!==void 0){let _t={...fe},$t=0;for(;!it&&tt.width<=te&&$t<20;){$t++,$t>19&&console.warn("max width reached");const nn=K.getTotalRangeCoords(),Zt=K.getLayout();me===lc.Left?_t.colEnd+1<nn.colEnd?_t.colEnd=Zt.getColIndex(tt.x+te):it=!0:me===lc.Right?_t.colStart-1>=0?_t.colStart=Zt.getColIndex(tt.x-(te-tt.width)):it=!0:me===lc.Center&&_t.colEnd+1<nn.colEnd&&_t.colStart-1>=0?(_t.colStart=Zt.getColIndex(tt.x-(te-tt.width)/2),_t.colEnd=Zt.getColIndex(tt.x+tt.width+(te-tt.width)/2)):it=!0,it||(tt=K.getRangeCoordsBounds(_t))}}tt.height=Ge.height,ae!==void 0&&(tt.height=Math.max(ae+1,Ge.height));const{width:At,height:Lt}=K.getViewportSize();return{x:tt.x??0,y:tt.y??0,height:Math.min(Lt-tt.y,tt.height)+1,width:Math.min(At-tt.x,tt.width)+1}},[we]),Y=wt(F,[F]),le=u.useCallback(()=>{D?.getStage()?.focus()},[D]),ee=u.useRef(null),Pe=wt(K=>{M?.(K),Ye(),re(!0),ee.current=null},[M]),Te=wt(K=>{N?.(K.coords)},[N]),rt=wt(K=>{K.isSubmitted||K.isCancelled||(Re.current.isEditorClosed=!0,le(),K.isCancelled=!0,U?.(K.coords),Ye())},[U]),Ve=wt(K=>{if(K.isSubmitted||K.isCancelled)return!1;try{return ee.current=K.coords,K.isEditorClosing=!0,K.isSubmitted=!0,K.isEditorSubmitted||(K.isEditorSubmitted=!0,K.editorRefs[0]?.submitEdit?.()),K.coords,V?.(K.coords),K.isEditorClosed=!0,le(),Ye(),!0}catch(se){throw K.isEditorClosing=!1,K.isSubmitted=!1,se}},[V]),Ee=wt(K=>{re(!1),J?.(K.coords),Ye()},[J]),Re=u.useRef(null),Xe=u.useRef(null),Be=u.useRef(null),ct=u.useRef([]),[Qe,he]=u.useReducer(K=>K+1,0),Ye=u.useCallback(K=>{K&&ct.current.push(K),he()},[]),ke=wt(K=>{if(K.defaultPrevented||K.isSynthetic||!D)return;const se=D?.getCellCoordsFromClient(K.clientX,K.clientY);se&&Ye({eventType:"pointer",event:K,coords:se})},[D]),Ie=wt(K=>{const se=K.nativeEvent;ke(se)},[D]),ue=wt(K=>{if(K.defaultPrevented||K.isSynthetic||!D?.getStage())return;const se=Xe.current;X(K,se)&&(K.stopPropagation(),K.preventDefault()),K.key,Ye({eventType:"keyboard",event:K,coords:se})},[D]);u.useLayoutEffect(()=>{const K=(ae,pe)=>{const me=pe?.cell??ae;if(!me)return null;const fe=me;if(!Y(me))return null;Pe?.(me);const je=Qo.uuidV4();pe=Object.freeze({autoFocus:!0,...pe}),Be.current=me;const Fe={coords:fe,startEvent:pe,uuid:je,isMounted:!1,isStarted:!1,isSubmitted:!1,isEditorSubmitted:!1,isEditorClosing:!1,isEditorClosed:!1,isCancelled:!1,events:[],editorRefsDispatchEditorEvent:[],editorRefs:[],onMount:Ge=>{Fe.isMounted||(Fe.isMounted=!0,Ye())},onUnmount:Ge=>{if(Fe.editorRefs.length===0){const et=()=>{Fe.isMounted=!1,Ye()};if(document.activeElement!==document.body)et();else{const tt=it=>{it.defaultPrevented||it.target!==document.body||ue(it)};window.addEventListener("keydown",tt,!0),D.getStage()?.addEventListener("focusin",()=>{window.removeEventListener("keydown",tt),et()},{once:!0}),le()}}}};return Fe};if(ct.current.length<=0&&!Re.current)return;const se=ct.current[0];$9(se),(ae=>{const pe=[],me=ae?.length??0;for(let fe=0;fe<me;fe++){const je=ae[fe];pe.push($9(je))}})(ct.current),Re.current,Re.current;let te=Re.current;if(Re.current){if(Re.current.isDone)Re.current=null;else if(Re.current.isSubmitted||Re.current.isCancelled){if(Re.current.isMounted)return;Re.current.isDone||(Ee(Re.current),Re.current.isDone=!0)}}if(se){if(se.eventType==="start"){const ae=se,pe=ae.startEvent?.cell??Xe.current;Re.current&&Vt.isEqualCells(Re.current.coords,pe)||(Re.current=K(pe,ae.startEvent))}else if(se.eventType==="keyboard"){const ae=se.event;if(Re.current){let pe=!1;switch(ae.which){case 37:case 39:case 38:case 40:case 13:case 9:pe=!0}if(!pe){Re.current.events.push(se);for(let me=0;me<Re.current.editorRefsDispatchEditorEvent.length;me++)Re.current.editorRefsDispatchEditorEvent[me](se)}}else if(X(ae,se.coords)){const pe=K(Xe.current,void 0);pe&&pe.events.push(se),Re.current=pe}}else if(se.eventType==="pointer"){const ae=se.event;if(Re.current){Re.current.events.push(se);for(let pe=0;pe<Re.current.editorRefsDispatchEditorEvent.length;pe++)Re.current.editorRefsDispatchEditorEvent[pe](se)}else{const pe=se?.coords??Xe.current,me=H(ae,pe);if(me){let fe;typeof fe!="boolean"&&(fe=me);const je=K(pe,fe);je&&je.events.push(se),Re.current=je}}}else if(se.eventType==="submit"){if(Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;Ve(Re.current)}}else if(se.eventType==="cancel"){if(Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;rt(Re.current)}}else if(se.eventType==="coordsChange"){const ae=se;if(Xe.current=ae.activeCoords,Re.current,Re.current&&!Re.current.isSubmitted&&!Re.current.isCancelled){if(!Re.current.isMounted)return;try{Ve(Re.current)}catch{}}}}ct.current.length>0&&(ct.current.shift(),Ye()),ct.current.length===0&&(!Re.current||Re.current.isEditorClosing||Re.current.isEditorClosed?!Re.current&&te&&le():Re.current.isMounted&&!Re.current.isStarted&&(Re.current.isStarted=!0,Re.current.startEvent.autoFocus&&(typeof Re.current.startEvent.autoFocus=="string"?Re.current.editorRefs[0]?.autoFocus(Re.current.startEvent.autoFocus):Re.current.editorRefs[0]?.autoFocus()),Te?.(Re.current),requestAnimationFrame(()=>{D&&Re.current?.coords&&D.scrollCellCoordsIntoView(Re.current.coords)})))},[Qe]),u.useEffect(()=>{Be.current=xe;const K=Re.current?.coords;Vt.isEqualCells(K,xe)||(Re.current&&(Re.current.isEditorClosing=!0),Ye({eventType:"coordsChange",activeCoords:xe}))},[xe]);const De=u.useCallback(K=>{ue(K.nativeEvent)},[]),{width:Ae=0,height:W=0}=ce??{width:0,height:0},Q=wt(B,[B]);return{overlay:wt(K=>{if(!Re.current||Re.current.isEditorClosed)return Re.current,null;Re.current.coords;let se=ie(K,Re.current.coords,Ae,W,de,we),te=!0;se&&se.width!==0&&se.height!==0||(se={x:0,y:0,width:Ae,height:Ae},te=!1);const ae=K.getZoom(),pe={containerBounds:{x:0,y:0,width:se.width/ae,height:se.height/ae},setNaturalDimensions:Se,zoom:ae};return s.jsx(vz,{session:Re.current,refLatestCoords:Be,handleSubmitEdit:Ve,handleCancelEdit:rt,cellBounds:se,borderStrokeWidth:ye,borderStrokeFill:oe,isInBounds:te,getCellEditor:Q,propsEditor:pe,alignment:we,...ne},"editor:"+Re.current.uuid)},[B,de,Qe,Ae,W,we,ye,oe]),startEdit:u.useCallback(K=>{Ye({eventType:"start",startEvent:K})},[]),submitEdit:u.useCallback(()=>{Ye({eventType:"submit"})},[]),cancelEdit:u.useCallback(()=>{Ye({eventType:"cancel"})},[]),onKeyboardEvent:De,onPointerEvent:Ie,onKeyboardEventNative:ue,onPointerEventNative:ke,isEditing:ve}})({view:n,activeCoords:f,getCellEditor:_,canEdit:()=>{const A=!o.getProtection().isLocked();return A||a(),A},onBeforeStartEdit:A=>{const D=Yw(()=>o.getRange(A).getCell()),F={sheet:o,coords:A,editState:Object.freeze(D)};p.setMode({key:"edit",args:{stateAndCoords:F}}),m(F)},onStartEdit:A=>{x(A),l(A)},onSubmitEdit:C,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:R});sn(o.getSelection(),{onChange(A){h(o.getSelection().getCoords().cell)}});const O=_e(A=>{P(A),y&&j()},[P,S,y]),I=u.useCallback(A=>{P(A)},[P]),z=u.useCallback(A=>{k(A)},[k]);return u.useEffect(()=>{const A=n?.getStage();if(A)return A.addEventListener("pointerdown",O),A.addEventListener("dblclick",I),A.addEventListener("keydown",z),()=>{A.removeEventListener("pointerdown",O),A.removeEventListener("dblclick",I),A.removeEventListener("keydown",z)}},[n?.getStage()]),u.useEffect(()=>{const A=p.getMode(),D=A?.key;D==="edit"||D==="enter"?g?A.args?.cancel?S():A.args?.submit?j():m(A.args?.stateAndCoords):T(A.args?.start):y&&S()},[p]),L(n,t)})),nS="white",oS="black",CF=`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`,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 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`,EF=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=_e(()=>{if(o.getTables().getCount()>0){i(!0);const C=o.getTables().search({address:n.getVisibleRangeCoords()});l(C.length>0?C:null)}else i(!1),l(null)},[o,n]),y=_e(C=>{C.preventDefault(),C.stopPropagation();const R=n.getCellCoordsFromClient(C.clientX,C.clientY),_=o.getTables().search({address:R});_.length===1&&_[0].select()},[n,o]),x=_e(C=>{C.preventDefault(),C.stopPropagation();const R=n.getCellCoordsFromClient(C.clientX,C.clientY),_=o.getTables().search({address:R});if(_.length===1){const L=_[0].getRange().getCoords(),T={colStart:L.colStart,rowStart:R.rowIndex,colEnd:L.colEnd,rowEnd:R.rowIndex};o.getRange(T).select()}},[n,o]),v=_e(()=>{if(!r)return;const C=o.getTables().search({address:n.getVisibleRangeCoords()});l(C.length>0?C:null)},[o,r,n]);sn(o?.getSelection(),{onChange(C){d(o.getSelection().getCoords().cell)}}),sn(p,{onAnyChange(C){m(),v()}}),sn(h,{onAnyChange(C){v()}}),sn(o,{onTablesChange(C){m(),v()},onInvalidated(C){m(),v()}});const b=u.useMemo(()=>Xt.debounce(Xt.throttle(v,300),300),[]);u.useEffect(()=>{b()},[n]),u.useEffect(()=>{let C=null;if(a)for(let R=0;R<a.length&&!C;R++){const _=a[R],L=_.getRange().getCoords();$.CoordUtils.isCellWithinRange(c,L)&&(C=_)}f(C)},[c,a]);const w=_e(C=>{let R=null;if(a)for(let _=0;_<a.length;_++){const L=a[_],T=L.getRange().getCoords();let j=n.getRangeCoordsBounds(T);const S=n.getRelativePointFromClient(C.clientX,C.clientY),k=S.x,P=S.y;if(k>=j.x&&k<=j.x+j.width&&P>=j.y&&P<=j.y+j.height){const O=n.getViewportSize();k<=0||P<=0||k>=O.width||P>=O.height||(R=L)}}g(R)},[n,a]);if(u.useEffect(()=>{const C=n?.getStage();if(C&&a)return C.addEventListener("mousemove",w),C.addEventListener("mouseleave",w),()=>{C.removeEventListener("mousemove",w),C.removeEventListener("mouseleave",w)}},[a,n?.getStage()]),!n||!a||a.length===0)return null;const E=[];for(let C=0;C<a.length;C++){const R=a[C];if(R.isClosed())continue;const _=R===h,L=R===p,T=R.getRange().getCoords(),j=n.getRangeCoordsBounds(T);let S;if(_||L){const k=R.getStyle().getProperties(),P=k.headerRow?.fill?.background??k.wholeTable?.border?.top?.color?.toString();if(P&&o){const O=o.getStyles().parseColor(P);O&&(S=O.toCSS())}S||(S="var(--sxl-app-color-shadow, rgba(0,0,0,.15))")}E.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:j.height,pointerEvents:"all",cursor:CF},onMouseDown:x},`table-select-row-${R.getName()}`)),E.push(s.jsx("div",{style:{position:"absolute",left:j.x,top:j.y,width:Math.min(16,j.width),height:Math.min(16,j.height),pointerEvents:"all",cursor:kF},onMouseDown:y},`table-select-${R.getName()}`)),E.push(s.jsx(O2,{x:j.x,y:j.y,width:j.width,height:j.height,range:T,strokeWidth:L?.5:0,stroke:S??"var(--sxl-app-color-grey, grey)",style:{willChange:"box-shadow",transition:"box-shadow 80ms ease-in-out",boxShadow:_?`${S} 0px 0px 1px 1px`:void 0}},`table-outline-${R.getName()}`))}return E})),MF=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=_e(()=>{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(()=>Xt.debounce(Xt.throttle(p,80),80),[]);if(sn(o?.getSelection(),{onChange(x){f()}}),sn(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&&!Xt.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(O2,{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})),TF={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=Xt.mergeContentful(e.body,i);return n.body=Xt.mergeContentful({fill:"#fff",strokeFill:"#dad8d6",strokeWidth:.5,text:{fontWeight:"400",fontStyle:"normal",fill:"#040404"}},a),n.buttonSurface=Xt.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=Xt.mergeContentful(n.body,{edgeStrokeFill:"rgb(171, 171, 171)",fill:"#f0f0f0",strokeShadow:void 0,edgeStrokeWidth:1},e.header),n.header=Xt.mergeContentful(n.header,i),n.headerSelect=Xt.mergeContentful(n.header,{fill:"rgba(16, 124, 65, 0.1)",text:{fill:n.headerSelection.strokeFill,fontWeight:"700"}},e.headerSelect),n.headerSelect=Xt.mergeContentful(n.headerSelect,i),n.headerSelectAll=Xt.mergeContentful(n.headerSelect,{},e.headerSelectAll),n.headerSelectAll=Xt.mergeContentful(n.headerSelectAll,i),n},_F={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:E,onFocus:C,onBlur:R,style:_=_n.EmptyCssProperties,notifier:L,onShowTooltip:T,onShowColumnTooltip:j,onShowRowTooltip:S,onCloseTooltip:k,gridProps:P,cellRenderProps:O,...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),[D,{width:F,height:B}]=Hl(),M=_e(T,[T]),N=_e(j,[j]),V=_e(S,[S]),U=_e(k,[k]),J=u.useRef(!1);u.useLayoutEffect(()=>{J.current=!0},[n]);const X=n?.getStyles(),H=u.useMemo(()=>gg(o,X),[o,X]),ne=u.useMemo(()=>gg(r,X),[r,X]),{body:oe={},buttonSurface:ye={}}=H,{header:de={},headerSelect:xe={},headerSelectAll:we={}}=ne,ve=u.useRef(null),[re,ce]=u.useState(()=>n?.getView()),Se=(re?.getZoomScale()??100)/100,ie=u.useMemo(()=>({vertical:re.isShowColumnGridlines()&&Se>=.4,horizontal:re.isShowRowGridlines()&&Se>=.4}),[re?.isShowColumnGridlines(),re?.isShowRowGridlines(),Se]),Y=u.useMemo(()=>{if(re?.getGridLineColor())return{strokeDasharray:"1,1"}},[re?.getGridLineColor(),H]),le=a??re?.isShowColumnHeaders(),ee=c??re?.isShowRowHeaders(),[Pe,Te]=u.useState({width:0,height:0}),rt=u.useMemo(()=>{let Ze=40,be=20;const St=n?.getStyles().getNormal().getFont();if(Pe.width>0&&Pe.height>0){const q=St?.toCSS()?.fontFamily??H.header.text.fontFamily,Ce=St?.getSize()??H.header.text.fontSize,Z=$.IFont.getSharedMeasurer()(""+Pe.height,Math.ceil(Ce*$.IFont.getDeviceScale()),q);Ze=Z.width,be=Z.lineHeight}return{width:Math.round(Ze+5),height:Math.round(be+3)}},[Pe,H?.header.text,n]),Ve=ee?Se*rt.width:de.edgeStrokeWidth,Ee=le?Se*rt.height:de.edgeStrokeWidth,Re=Math.max(F,(n?.getColumnHeaders().getDefaultSize()??rt.width)+Ve+1),Xe=Math.max(B,(n?.getRowHeaders().getDefaultSize()??rt.height)+Ee+1),Be=u.useRef(new Map),ct=u.useRef(null),Qe=()=>({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(()=>Qe()),[ke,Ie]=u.useState(!1),[ue,De]=u.useState(null),Ae=!0,W=H.selection?.strokeFill,Q=u.useCallback(()=>pr.current,[]),[K,se]=u.useState(),te=_e(Ze=>{se(Ze),n&&n.getView()&&n.getView().setTopLeft(Ze?{left:Ze.left,top:Ze.top}:null),h?.(Ze)},[n,h]),ae=u.useRef(null);u.useEffect(()=>{if(!K||!n)return;const Ze=n.getRangeAtBounds({x:K.left,y:K.top,width:K.width,height:K.height});ae.current?.(),ae.current=Ze.addListener(()=>{const be=Ze.getCoords();ve?.current?.invalidate(be)})},[K,n]);const[pe,me]=u.useState(()=>n?.getView().getTopLeft()),fe=_e(Ze=>{const be=Go.cellToRange(Ze);if(n.isClosed())return be;const St=n.getRange(be,{excludeHidden:!0}).getMerges();return St.length===0?be:St[0]},[n]),je=Ze=>{if(!Ze||Ze.coords.colIndex===0&&Ze.coords.rowIndex===0)return null;const be={};return Ze.coords.colIndex>0&&(be[zo.Left]={index:Ze.coords.colIndex,scrollOffset:Ze.topLeft.left}),Ze.coords.rowIndex>0&&(be[zo.Top]={index:Ze.coords.rowIndex,scrollOffset:Ze.topLeft.top}),be},[Fe,Ge]=u.useState(()=>je(n.getView().getFreezePanes())),et=Hi(),tt=u.useCallback(()=>ve.current,[]),it=_e(Ze=>{et.setMode(be=>be?.key==="edit"?{...be,args:{...be.args}}:{key:"edit",args:{stateAndCoords:null,start:Ze}})},[]),At=_e(()=>K,[K]),Lt=function(Ze){const{sheet:be,onRepeatCommandChange:St,bodyStyle:q,commands:Ce,target:Z,notifier:ge,onStartEdit:We,getViewport:mt}=Ze,[Ue,Ut]=u.useState(null),[Mt,Bt]=u.useState(null),qt=u.useRef(null),fn=_e(We,[We]),Ht=_e(mt,[mt]),[Nt,io]=u.useState(),[Ct,an]=u.useState(()=>be?.getStyles().parseColor($.IColor.Scheme.Bg2)),[go,dn]=u.useState(()=>be?.getStyles().getNormal().getFont().getFill()),Kt=Hi();u.useRef(Kt.getMode()).current=Kt.getMode();const vo=hb(),[Bo,Kl]=u.useState(Xt.EmptyArray),Gl=u.useCallback(()=>{if(qt.current!==be)return;const Me=be.getSelectedRanges();let ot=null;Bo.length>0&&Go.isCellWithinRange(Ue,Bo[0].getRange().getCoords())&&(ot=Bo[0]);const dt=be?.getSelectedCell(),Ke=dt?.getCoords()??null;yo.unstable_batchedUpdates(()=>{W2(ot),Ut(Ke),Bt(Me)})},[be,Bo,Mt,Ue]),H2=u.useCallback(Xt.debounce(Gl,210),[Gl]);u.useEffect(()=>{qt.current=be,Gl()},[be]);const ar=_e(()=>be.getRange(Ue).getCell(),[be,Ue]),wo=_e(async(Me,ot,dt=null,Ke=!1,ht=!0)=>{const bt=Me?.label?.(),yn=async()=>{const un=await Promise.resolve(ht&&ge?.showBusy?.(bt??"Busy..."));try{await be.doBatch(async()=>ot(be),bt),Ke&&Kt.setMode(null),un&&un()}catch(ao){if(un&&un(),!ao)return;ge?.showError?.(ao)}},xn=[];let ln=!1;const Sn=async()=>(xn.push(yn),(async()=>{if(!ln){for(ln=!0;xn.length>0;){const un=xn.shift();un&&await un()}ln=!1}})());if(St){let un=null;if(dt!==!1&&Me){const ao=dt??bt;un=new Tt(Me.key(),Z,{label:ao,description:ao},Sn)}St(un)}return Sn()},[be,St,ge]),Jt=_e((Me,ot,dt=!1,Ke)=>wo(Me,ht=>{const bt=ht.getSelectedRanges();dt&&bt.updateStyle(null,Ke),bt.updateStyle(ot,Ke),bt.autoFit({expandOnly:$.IRange.Orientation.Column,minContent:!0,skipCustomSize:!0})}),[be]),Yf=_e((Me,ot,dt)=>{wo(Me,Ke=>{let ht=ot;(dt||ot?.address)&&(ht=ht??{},!dt&&ot?.address?.startsWith("#")?dt=ot?.address.substring(1):dt&&(ht.displayText=dt)),Ke.getSelectedRange().setHyperlink(ht)})},[be]),Jf=_e((Me,ot)=>{wo(Me,dt=>{dt.getSelectedRange().setComments(ot)})},[be]),u0=_e((Me,ot)=>{wo(Me,dt=>{dt.getSelectedRanges().clear(ot)})},[be]),rl=_e(async(Me,ot,dt=!1,Ke=!1)=>wo(Me,async ht=>{let bt=ht.getSelectedRanges();dt&&(ot===$.IRange.Orientation.Row?bt=bt.getEntireRows(Ke):ot===$.IRange.Orientation.Column&&(bt=bt.getEntireColumns(Ke)));let yn=null;const xn=Kt.getMode()?.key;if(xn==="copy"||xn==="cut"){const ln=await vo.getClipboard().readReference();ln&&ln.getItemType()==="range"&&(yn=ln.getItem(),yn.getCoords()||(yn=null))}if(yn){const ln=await bt.insertFrom(yn,{...yn.getMarkOptions(),orientation:ot,autoSelect:!0});!ln||ln.isEntireRows()||ln.isEntireColumns()||ln.autoFit({orientations:$.IRange.Orientations.Row,minContent:!0}),Kt.setMode(null)}else bt.insert(ot,{autoSelect:!0})},"Insert Cells",!1),[Kt]),[ha,W2]=u.useState(null),BC=_e(Me=>be.getStyles().setDefaultTableStyle(Me),[be]),NC=_e(Me=>{be.getStyles().getTableStyle(Me)?.delete()},[be]),p0=_e((Me,ot)=>{wo(Me,async dt=>{const Ke=dt.getSelectedRange(),ht=dt.getSelectedCell().getCoords();let bt=null,yn=0;const xn=ht.rowIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex}).getExtended($.IRange.Direction.Up):null;xn&&dt.getRange({colStart:ht.colIndex,rowStart:xn.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:xn.getCoords().rowStart}).isContentful()&&(bt=$.IRange.Direction.Up,yn=ht.rowIndex-xn.getCoords().rowEnd);const ln=ht.colIndex>0?dt.getRange({rowIndex:ht.rowIndex,colIndex:ht.colIndex-1}).getExtended($.IRange.Direction.Left):null;if(ln&&dt.getRange({colStart:ln.getCoords().colStart,rowStart:ht.rowIndex,colEnd:ln.getCoords().colStart,rowEnd:ht.rowIndex}).isContentful()){const un=ht.colIndex-ln.getCoords().colEnd;(un<yn||!bt)&&(bt=$.IRange.Direction.Left,yn=un)}let Sn=null;if(bt===$.IRange.Direction.Up){if(Sn={...xn.getCoords()},(Sn.rowEnd===ht.rowIndex||!dt.getRange({colIndex:ht.colIndex,rowIndex:ht.rowIndex-1}).isContentful())&&Sn.rowStart>0&&dt.getRange({colIndex:ht.colIndex,rowIndex:Sn.rowStart-1}).isContentful()){const un=xn.getExtended($.IRange.Direction.Up);Sn={colStart:ht.colIndex,rowStart:un.getCoords().rowStart,colEnd:ht.colIndex,rowEnd:xn.getCoords().rowEnd}}Sn.rowEnd=ht.rowIndex-1}else if(bt===$.IRange.Direction.Left){if(Sn={...ln.getCoords()},(Sn.colEnd===ht.colIndex||!dt.getRange({colIndex:ht.colIndex-1,rowIndex:ht.rowIndex}).isContentful())&&Sn.colStart>0&&dt.getRange({colIndex:Sn.colStart-1,rowIndex:ht.rowIndex}).isContentful()){const un=ln.getExtended($.IRange.Direction.Left);Sn={colStart:un.getCoords().colStart,rowStart:ht.rowIndex,colEnd:un.getCoords().colEnd,rowEnd:ht.rowIndex}}Sn.colEnd=ht.colIndex-1}if(Ke.size!==1&&bt){const un=Ke.getCoords(),ao=Ke.startIncrementalUpdates({orientation:$.IRange.Orientation.Column}),jo={...Sn},wr=un.rowStart,Di=un.rowEnd,Ai=un.colStart,Li=un.colEnd,Nr=bt===$.IRange.Direction.Up;for(let fr=Ai;fr<=Li;fr++){jo.colStart=Nr?fr:Sn.colStart+(fr-Ai),jo.colEnd=Nr?fr:Sn.colEnd+(fr-Ai);for(let No=wr;No<=Di;No++){jo.rowStart=Nr?Sn.rowStart+(No-wr):No,jo.rowEnd=Nr?Sn.rowEnd+(No-wr):No;const Dn=dt.getRange(jo).toString();ao.pushAt(No,fr,`=${ot}(${Dn})`)}}ao.apply()}else{const un=Sn?dt.getRange(Sn).toString():"",ao=`=${ot}(`;fn?.({text:`${ao}${un})`,editMode:!0,initialSelection:{start:ao.length,end:ao.length+un.length}})}},!1)},[be]),j1=_e((Me,ot,dt=!1,Ke=!0)=>{wo(Me,async ht=>{let bt=null;if(ha)return void ha.updateStyleOptions(ot);{const ln=ht.getSelectedRanges().getFixed(!0),Sn=ht.getSelectedRange().getDefaultSortCriteria();let un={ranges:ln,hasHeader:Sn?.options?.hasHeader??!1};bt=Ke?new Promise((ao,jo)=>{const wr={tableOptions:un,onCancel:()=>{jo()},onDone:Di=>{ao(Di)},context:{getNames:()=>ht.getNames()}};ge.showWindow?.("tableNew",wr)}):{option:"Ok",tableOptions:un}}const yn=await Promise.resolve(bt);if(yn?.option!=="Ok")throw null;const xn=await Promise.resolve(ge?.showBusy?.(Me.label()));try{await ht.getTables().add(yn.tableOptions.ranges.at(0),{styleName:ot?.name,clearFormatting:dt,hasHeader:yn.tableOptions.hasHeader}).getRange().select()}catch(ln){xn(),ge?.showError?.(ln)}xn()},!1,!0,!1)},[ha]),Qf=_e(()=>q,[q]),em=_e(Me=>({styles:()=>be.getStyles(),table:()=>Me,bodyStyle:Qf,getNames:()=>be.getNames()}),[be]),$C=_e(async(Me,ot,dt,Ke=!0)=>{let ht=null;if(!ot){let bt=be.getSelectedRange();bt.size===1&&(bt=bt.getSurrounding());let yn=be.getTables().search({address:be.getSelectedRange()});yn.length>0&&(ot=yn[0]),await bt.select()}if(ot){if(Ke){try{dt&&await ot.select()}catch{}ht=new Promise(async(bt,yn)=>{Me.update({context:em(ot)});const xn={command:Me,commands:Oe,notifier:ge,onDone:Sn=>{bt(Sn)}},ln=await ge.showWindow?.("tableDetails",xn,{disableAutoDestroy:!0});setTimeout(()=>{ln.focus()},180)})}Promise.resolve(ht).then(bt=>{},bt=>{ge?.showError?.(bt)})}},[ge]),tm=_e(async(Me,ot,dt=!1)=>{let Ke=null;if(ot)ot.isITable?Ke=ot:ot.getValue()&&(Ke=ot.getValue());else{const ht=be.getTables().search({address:be.getSelectedRange()});ht.length>0&&(Ke=ht[0])}if(Ke){if(!dt){const ht=Ke.getRange().getCoords(),bt=(ht.colEnd-ht.colStart+1)*(ht.rowEnd-ht.rowStart+1);if(bt>1e4&&await ge?.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?Ke.delete():Ke.convertToRange()},!1,!0)}},[ge]),U2=_e((Me,ot,dt)=>{wo(Me,async Ke=>{let ht=Ke.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 yn=Ke.getSelection().getCoords().cell;let xn=bt.getDefaultSortCriteria($.IRange.Orientation.Row,yn);if(!xn){if(dt)throw new Error("Invalid sort selection. Sort requires a single range with data.");return}let ln=xn.options;if(dt&&(ln=new Promise((un,ao)=>{const jo={range:bt,options:xn.options,cell:yn,onCancel:()=>{ao()},onDone:wr=>{wr?un(wr.options):ao()}};ge.showWindow?.("sort",jo)})),ln=await Promise.resolve(ln),!ln)return;const Sn=await Promise.resolve(ge?.showBusy?.(Me.label()));try{bt.doBatch(()=>{const un={...ln,...ot};bt.sort(un),bt.autoFit({orientations:un?.orientation===$.IRange.Orientation.Column?$.IRange.Orientations.Column:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})},Me?.label?.())}catch(un){Sn(),ge?.showError?.(un)}Sn()},!1,!1,!1)},[ge]),VC=_e(()=>{console.log("compactedSelection");const Me=be.getSelection().getCoords(),ot=be.getSelectedRanges().getFlattened().getCoords(),dt=(()=>{const bt=new Blob(["console.log('hello from worker');"],{type:"application/javascript"}),yn=URL.createObjectURL(bt),xn=new Worker(yn);return URL.revokeObjectURL(yn),xn})();setTimeout(()=>{dt.terminate(),console.log("Worker terminated")},5e3);let Ke=-1;for(let bt=0;Ke===-1&&bt<ot.length;bt++)Go.isCellWithinRange(Me.cell,ot[bt])&&(Ke=bt);if(Go.isEqualRangesArrays(Me.ranges,ot))return;const ht={cell:Me.cell,ranges:ot,rangeIndex:Ke};be.getSelection().updateCoords(ht)},[be]),HC=_e(()=>{console.log("selectComments")},[be]),nm=_e(async(Me=!1,ot=!1)=>{let dt=null;if(ot)dt=be.getEntireRange();else{const Ke=be.getSelectedRange();if(Ke.isEntireRange()){const ht=be.getSelection().getCoords().cell,bt=be.getRange(ht);dt=bt.getSurrounding(),dt.isEntireRange()&&(dt=bt)}else dt=Ke.getSurrounding({contentOnly:Me})}dt&&await dt.select()},[be]),h0=_e((Me,ot,dt)=>{wo(Me,async Ke=>{let ht=Ke.getSelectedRanges();dt&&(ot===$.IRange.Orientation.Row?ht=ht.getEntireRows():ot===$.IRange.Orientation.Column&&(ht=ht.getEntireColumns())),ht.delete(ot)},"Delete Cells")},[be]);_e(async Me=>{let ot=null;const dt=Ht(),Ke=Math.min(dt.width-8,480),ht=Math.min(dt.height-8,288);try{be.getSelectedRanges(),ot=await be.getMovables().add({bounds:{x:dt.left+(dt.width-Ke)/2,y:dt.top+(dt.height-ht)/2,width:Ke,height:ht},type:"chart",json:Me.template}),ot.select(),Kt.setMode(null)}catch(bt){ge?.showError?.(bt)}return ot},[be,ge]);const om=_e(async(Me,ot,dt)=>{const Ke=await ge?.showBusy?.(Me.label());try{const ht=await be.getMovables().addImage(ot,{autoSelect:!0,...dt});return Ke(),Kt.setMode(null),ht}catch(ht){Ke();let bt=ht;typeof bt!="string"&&(console.warn(ht),bt="Unable to resolve image."),ge?.showMessage?.(bt,{type:ua.Error})}},[be,ge]),R1=_e((Me,ot)=>{wo(Me,async dt=>{const Ke=dt.getSelectedRanges();Ke.doBatch(()=>{const ht=ot===$.IRange.Direction.Up||ot===$.IRange.Direction.Down,bt=Ke.getCoords().slice().sort(Go.createRangeComparator(ht?$.IRange.Orientation.Row:$.IRange.Orientation.Column));for(let yn=0;yn<bt.length;yn++){const xn=bt[yn];let ln=xn;const Sn=dt.getRange(ln).getMerges();let un=0,ao=0;if(Sn.length>0){const jo=Sn[0];un=jo.rowEnd-jo.rowStart,ao=jo.colEnd-jo.colStart}ot===$.IRange.Direction.Left?ln={...xn,colStart:xn.colEnd+ao}:ot===$.IRange.Direction.Right?ln={...xn,colEnd:xn.colStart+ao}:ot===$.IRange.Direction.Up?ln={...xn,rowStart:xn.rowEnd+un}:ot===$.IRange.Direction.Down&&(ln={...xn,rowEnd:xn.rowStart+un}),dt.getRange(ln).autoFill(xn,{filler:$.AutoFill.Types.Copy}),dt.getRange(xn).autoFit({orientations:$.IRange.Orientations.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:Me.label()})})},[ge]),WC=_e(()=>{let Me=null;const ot=be.getSelectedCell().getCoords();if(ot?.rowIndex>0){const dt=be.getRange({rowIndex:ot.rowIndex-1,colIndex:ot.colIndex}).getCell();dt&&(Me=dt.toTextUnformatted(!0))}fn?.({text:Me})},[be]),[f0,UC]=u.useReducer(Me=>Me+1,0),[I1,Zl]=u.useReducer(Me=>Me+1,0),rm=u.useMemo(()=>[new He("gridlinesToggle",Z,{label:"Gridlines",scopedLabels:{view:"Gridlines"},description:"Toggle whether the lines between rows and columns in the sheet are displayed."}),new He("sheetViewToggleGridlinesRows",Z,{label:"Row Gridlines",scopedLabels:{view:"Row Gridlines",gridlines:"Rows"},description:"Toggle whether the lines between rows in the sheet are displayed."}),new He("sheetViewToggleGridlinesColumns",Z,{label:"Column Gridlines",scopedLabels:{view:"Columns Gridlines",gridlines:"Columns"},description:"Toggle whether the lines between columns in the sheet are displayed."}),new He("sheetViewFormatGridlinesColor",Z,{label:"Gridlines Color",description:"Color the rows and column gridlines."}),new He("sheetViewToggleShowHeadings",Z,{label:"Headings",scopedLabels:{view:"Headings"},description:"Toggle whether the row and column headings are displayed."}),new He("sheetViewToggleShowHeadingRows",Z,{label:"Row Headings",scopedLabels:{view:"Row Headings",headings:"Rows"},description:"Toggle whether the row headings are displayed."}),new He("sheetViewToggleShowHeadingColumns",Z,{label:"Column Headings",scopedLabels:{view:"Columns Headings",headings:"Columns"},description:"Toggle whether the column headings are displayed."}),new He("sheetViewToggleShowHeadingsNumeric",Z,{label:"Numeric Headers",description:"Toggle whether cell headings show numbers or A1 conventions.",shortcut:{key:"h",modifiers:[$e.Ctrl,$e.Shift]}}),new He("sheetViewToggleFormulaView",Z,{label:"Show Formulas",description:"Toggle whether cells show formula or values.",shortcut:[{key:"`",modifiers:[$e.Ctrl]},{key:"`",modifiers:[$e.Ctrl,$e.Shift]}]}),new He("sheetViewToggleShowZeros",Z,{label:"Show Zeros",description:"Toggle whether cell with zero value shows '0' or blank."}),new Tt("selectComments",Z,{label:"Select Comments",description:"Select the cells with comments.",shortcut:{key:"O",modifiers:[$e.Ctrl,$e.Shift]}},()=>HC()),new He("selectAll",Z,{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",Z,{label:"Select Region",description:"Select the closest data.",shortcut:{key:"*",modifiers:[$e.Ctrl,$e.Shift]}},()=>nm(!0,!1)),new Tt("breakSelection",Z,{label:"Select Visible",description:"Break the selection based on hidden rows and columns.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl,$e.Alt]}},()=>VC()),new Tt("formatTextRotate0",Z,{label:"No Text Rotation",description:"Remove all text rotation."}),new Tt("formatTextRotate45",Z,{label:"Angle Clockwise",description:"Angle text 45 degrees downward."}),new Tt("formatTextRotate90",Z,{label:"Rotate Text Down",description:"Angle your text so that it aligns with the left."}),new Tt("formatTextRotate270",Z,{label:"Rotate Text Up",description:"Angle your text so that it aligns with the right."}),new Tt("formatTextRotate315",Z,{label:"Angle Counterclockwise",description:"Angle text 45 degrees upward."}),new He("formatTextRotateCustom",Z,{label:"Custom Text Rotation",description:"Angle your text using a custom angle."}),new Tt("formatTextRotateVertical",Z,{label:"Vertical Text",description:"Stack text vertically."}),new Tt("sortAscending",Z,{label:"Sort Ascending",scopedLabels:{sort:"Ascending"},description:"Lowest to Highest."},function(){U2(this,{reverse:!1},!1)}),new Tt("sortDescending",Z,{label:"Sort Descending",scopedLabels:{sort:"Descending"},description:"Highest to Lowest."},function(){U2(this,{reverse:!0},!1)}),new Tt("sortCustom",Z,{label:"Custom Sort…",scopedLabels:{sort:"Custom…"},description:"Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts."},function(){U2(this,{},!0)}),new He("protectionSheetToggle",Z,{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 He("formatSheetTabColor",Z,{label:"Tab Color",description:"Color the tab to help differentiate for other sheets."}),new He("formatCellStyle",Z,{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){Jt(this,{named:Me.getName()},!0)}),new He("formatTableStyle",Z,{label:"Format as Table",scopedLabels:{table:"Apply (Keep Styles)"},description:"Create a table or apply style to the current table."},function(Me){j1(this,Me)}),new He("formatTableStyleClearCellStyles",Z,{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){j1(this,Me,!0)}),new He("formatTableStyleClearTableStyle",Z,{label:"Clear Table Style",scopedLabels:{table:"Clear Style"},description:"Remove all the styling that is specific for the table."},function(){j1(this,{name:null},!0)}),new He("setDefaultTableStyle",Z,{label:"Set Default Table Style",scopedLabels:{table:"Set As Default"},description:"Sets the default table style used when a table is inserted."},BC),new He("deleteTableStyle",Z,{label:"Delete Table Style",scopedLabels:{table:"Delete"},description:"Remove the current table style."},NC),new He("formatBorder",Z,{label:"Border",description:"Create an outline border."},function(Me){Jt(this,{border:Me})}),new He("formatFillColor",Z,{label:"Fill Color",description:"Color the background of the cells to make them stand out."},function(Me){Jt(this,{fill:Me})}),new He("formatFontColor",Z,{label:"Font Color",description:"Change the color of your text."},function(Me){Jt(this,{font:{fill:Me}})}),new He("formatBoldToggle",Z,{label:"Bold",description:"Toggle bold formatting of text.",shortcut:[{key:"B",modifiers:[$e.Ctrl]},{key:"2",modifiers:[$e.Ctrl]}]}),new He("formatItalicToggle",Z,{label:"Italic",description:"Toggle italic formatting of text.",shortcut:[{key:"I",modifiers:[$e.Ctrl]},{key:"3",modifiers:[$e.Ctrl]}]}),new He("formatUnderlinedToggle",Z,{label:"Underline",scopedLabels:{underline:"Single"},description:"Underline the text.",shortcut:[{key:"u",modifiers:[$e.Ctrl]},{key:"4",modifiers:[$e.Ctrl]}]}),new He("formatUnderlinedDoubleToggle",Z,{label:"Double Underline",scopedLabels:{underline:"Double"},description:"Double underline the text."}),new He("formatUnderlinedAccountingToggle",Z,{label:"Accounting Underline",scopedLabels:{underline:"Accounting"},description:"Use accounting underline for the text."}),new He("formatUnderlinedAccountingDoubleToggle",Z,{label:"Double Accounting Underline",scopedLabels:{underline:"Double Accounting"},description:"Use accounting double underline the text."}),new He("formatStrikeThroughToggle",Z,{label:"Strikethrough",description:"Toggle strike-through formatting of text.",shortcut:{key:"5",modifiers:[$e.Ctrl]}}),new He("formatSuperscriptToggle",Z,{label:"Superscript",description:"Format your text to be smaller and sit at the top of the line."}),new He("formatSubscriptToggle",Z,{label:"Subscript",description:"Format your text to be smaller and sit at the bottom of the line."}),new He("formatAlignTopToggle",Z,{label:"Align Top",description:"Align text to the top."}),new He("formatTextOverflowVisibleToggle",Z,{label:"Overflow Text",description:"Overflow text to the next cells."}),new He("formatTextOverflowWrapToggle",Z,{label:"Wrap Text",description:"Wrap text with the existing cell and increase the height as required."}),new He("formatTextOverflowClipToggle",Z,{label:"Clip Text",description:"Clip text that falls outside of the existing cell."}),new He("formatTextOverflowShrinkToggle",Z,{label:"Shrink Text",description:"Shrink the text font to fit within existing cell."}),new He("formatTextOverflowEllipsisToggle",Z,{label:"Ellipsis Text",description:"Add a trailing '…' to the text to indicate text is partially hidden."}),new He("formatAlignMiddleToggle",Z,{label:"Align Middle",description:"Align text so that it is centered between the top and bottom of the cell."}),new He("formatAlignBottomToggle",Z,{label:"Align Bottom",description:"Align text to the bottom."}),new He("formatAlignJustifyVerticalToggle",Z,{label:"Justify Vertically",description:"Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell."}),new He("formatAlignDistributedVerticalToggle",Z,{label:"Distribute Vertically",description:"Justify your content vertically."}),new He("formatAlignLeftToggle",Z,{label:"Align Left",description:"Align your content to the left."}),new He("formatAlignCenterToggle",Z,{label:"Align Center",description:"Center your content."}),new He("formatAlignRightToggle",Z,{label:"Align Right",description:"Align your content to the right."}),new He("formatAlignJustifyToggle",Z,{label:"Align Justify",description:"Justify your content."}),new He("formatAlignCenterContinuousToggle",Z,{label:"Center Across",description:"Center your content across multiple cells."}),new He("formatAlignFillToggle",Z,{label:"Fill Across",description:"Repeat the value to fill the entire cell."}),new He("formatAlignDistributedHorizontalToggle",Z,{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",Z,{label:"Increase Font Size",description:"Make your text a bit bigger.",shortcut:{key:">",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,Me=>({font:{size:zh(Me.getFont().getSize(),!0)}}))}),new Tt("formatFontSizeDecrease",Z,{label:"Decrease Font Size",description:"Make your text a bit smaller.",shortcut:{key:"<",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,Me=>({font:{size:zh(Me.getFont().getSize(),!1)}}))}),new He("formatFontFamily",Z,{label:"Font",description:"Select the font your text."},function(Me){Jt(this,{font:{family:Me}})}),new He("formatFontSize",Z,{label:"Font Size",description:"Change the size of your text."},function(Me){Jt(this,{font:{size:Me}})}),new He("formatNumberDialog",Z,{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,ot){const dt=this,Ke={initialValue:Me??ot.state(),context:ot.context(),onInputOption:(ht,bt)=>{Jt(dt,{numberFormat:ht})}};ge.showWindow?.("numberFormat",Ke)}),new He("formatNumberFormat",Z,{label:"Number Format",description:"Choose the format for your cells, such as percentage, currency, date or time."},function(Me){Jt(this,{numberFormat:Me})}),new He("formatNumberFormatGeneralStyle",Z,{label:"General Style",description:"Remove all specific formatting.",shortcut:{key:"Backquote",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:$.NumberFormat.Type.General})}),new He("formatNumberFormatNumberStyle",Z,{label:"Number Style",description:"Format as number with two decimals and comma.",shortcut:{key:"1",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:"#,##0.00"})}),new He("formatNumberFormatTimeStyle",Z,{label:"Time Style",description:"Format as time with hour and minute, and AM or PM.",shortcut:{key:"2",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:"h:mm AM/PM"})}),new He("formatNumberFormatDateStyle",Z,{label:"Date Style",description:"Format as date with day, month, and year.",shortcut:{key:"3",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:"d-mmm-yy"})}),new He("formatNumberFormatAccountingStyle",Z,{label:"Accounting Style",description:"Format as Dollars, Euros, or other currency.",shortcut:{key:"4",modifiers:[$e.Ctrl,$e.Shift]}},function(Me){Jt(this,{numberFormat:Me??'_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)'})}),new He("formatNumberFormatPercentStyle",Z,{label:"Percent Style",description:"Format as a percent with no decimal places.",shortcut:{key:"5",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:"0%"})}),new He("formatNumberFormatScientificStyle",Z,{label:"Scientific Style",description:"Format as a scientific number with two decimal places .",shortcut:{key:"6",modifiers:[$e.Ctrl,$e.Shift]}},function(){Jt(this,{numberFormat:"0.00E+00"})}),new He("formatNumberFormatCommaStyle",Z,{label:"Comma Style",description:"Format with a thousands separator.",shortcut:{key:",",modifiers:[$e.Ctrl]}},function(){Jt(this,{numberFormat:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)'})}),new He("formatNumberFormatIncreaseDecimal",Z,{label:"Increase Decimal",description:"Show more decimal places for a more precise value."},function(){Jt(this,Me=>({numberFormat:$.NumberFormat.Parser.adjustDecimalPlaces(Me.getNumberFormat(),1)}))}),new He("formatNumberFormatDecreaseDecimal",Z,{label:"Decrease Decimal",description:"Show few decimal places."},function(){Jt(this,Me=>({numberFormat:$.NumberFormat.Parser.adjustDecimalPlaces(Me.getNumberFormat(),-1)}))}),new He("displayPlaceholdersToggle",Z,{label:"Display Placeholders",description:"Switch between hiding objects, displaying objects, and displaying placeholders for objects.",shortcut:{key:"6",modifiers:[$e.Ctrl]}}),new Tt("noOp",Z,{label:"Do nothing",description:"Do Nothing.",shortcut:{key:"7",modifiers:[$e.Ctrl]}},function(){}),new He("displayOutlineSymbolsToggle",Z,{label:"Display Outline Symbols",description:"Display or hide the outline symbols.",shortcut:{key:"8",modifiers:[$e.Ctrl]}}),new He("hideRows",Z,{label:"Hide Rows",description:"Hide the rows.",shortcut:{key:"9",modifiers:[$e.Ctrl]}}),new He("unhideRows",Z,{label:"Unhide Rows",description:"Unhide the rows.",shortcut:{key:"(",modifiers:[$e.Ctrl,$e.Shift]}}),new He("hideColumns",Z,{label:"Hide Columns",description:"Hide the columns.",shortcut:[{key:"0",modifiers:[$e.Ctrl]},{key:"0",modifiers:[$e.Ctrl,$e.Alt]}]}),new He("unhideColumns",Z,{label:"Unhide Columns",description:"Unhide the columns.",shortcut:{key:")",modifiers:[$e.Ctrl,$e.Shift]}}),new He("quickFormulaSum",Z,{label:"Quick Sum",scopedLabels:{quickFormula:"Sum"},description:"Quick sum of the cells.",shortcut:{key:"=",modifiers:[$e.Alt]}},function(){p0(this,"SUM")}),new He("quickFormulaAverage",Z,{label:"Quick Average",scopedLabels:{quickFormula:"Average"},description:"Quick average of the cells."},function(){p0(this,"AVERAGE")}),new He("quickFormulaCount",Z,{label:"Quick Count",scopedLabels:{quickFormula:"Count Numbers"},description:"Quick count of the cells."},function(){p0(this,"COUNT")}),new He("quickFormulaMax",Z,{label:"Quick Max",scopedLabels:{quickFormula:"Max"},description:"Quick maximum of the cells."},function(){p0(this,"MAX")}),new He("quickFormulaMin",Z,{label:"Quick Min",scopedLabels:{quickFormula:"Min"},description:"Quick minimum of the cells."},function(){p0(this,"MIN")}),new He("startEditCurrentTime",Z,{label:"Current Time",description:"Insert the current time.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl,$e.Shift]}},function(){fn?.({text:be.createTemporaryCell({value:e1(),style:{numberFormat:"Medium Time"}}).toText()})}),new He("startEditCurrentDate",Z,{label:"Current Date",description:"Insert the current date.",shortcut:{key:"Semicolon",modifiers:[$e.Ctrl]}},function(){fn?.({text:be.createTemporaryCell({value:e1(),style:{numberFormat:"Short Date"}}).toText()})}),new Tt("sheetZoomOut",Z,{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",Z,{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",Z,{label:"Zoom 100%",description:"Zoom document to 100%.",shortcut:{key:"o",modifiers:[$e.Ctrl,$e.Alt]}}),new He("insertFunction",Z,{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,ot){console.log("insertFunction")}),new He("updateHyperlink",Z,{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,ot){const dt=this,Ke={context:ot.context(),onUpdateHyperlink:(ht,bt)=>{Yf(dt,ht,bt)}};ge.showWindow?.("hyperlink",Ke)}),new He("openHyperlink",Z,{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,ot)=>{const dt=ot.context()();if(!dt)return;const Ke=dt.getHyperlink();if(Ke)try{await Ke.open()}catch(ht){ge?.showError?.(ht)}}),new He("deleteHyperlink",Z,{label:"Delete Link",scopedLabels:{hyperlink:"Delete"},description:"Remove the hyperlink.",context:()=>ar},function(Me,ot){Yf(this,null,null)}),new Tt("insertNote",Z,{label:"Insert Note",scopedLabels:{contextMenu:"Insert Note…",insert:"Note"},shortcut:{key:"F2",modifiers:[$e.Shift]},description:"Add a note to the cell."},(Me,ot)=>{var dt,Ke;dt=ge,Ke=ot.label(),dt?.showMessage?.(s.jsxs("p",{style:{marginTop:"0px",marginBottom:"0px"},children:[Ke," 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 He("updateComments",Z,{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,ot){const dt=this,Ke={context:ot.context(),onUpdateComments:ht=>{Jf(dt,ht)}};ge.showWindow?.("comments",Ke)}),new He("deleteComments",Z,{label:"Delete Comments",description:"Remove any comments.",context:()=>ar},function(Me,ot){Jf(this,null)}),new He("insertImageFromFile",Z,{label:"Insert Image",scopedLabels:{contextMenu:"Insert Image…",insert:"Image…",insertImage:"From Device…"},description:"Insert a picture from your device."},async function(Me=null){let ot=null,dt=null;typeof Me=="string"?dt=Me:ot=Me?.file?Me.file:Me,(ot||(ot=await Xt.openFileDialog(dt??"image/*"),ot))&&await om(this,{file:ot},Me?.options)}),new He("insertImageFromURL",Z,{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 ot=await ge?.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(ot.option!=="Insert")return;Me=ot.input}Me&&om(this,{fetch:Me})}),new Tt("insertTable",Z,{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(){j1(this)}),new He("editTable",Z,{label:"Edit Table…",scopedLabels:{table:"Edit…",namedItem:"Edit…"},description:"Edit the table to adjust formatting, sorting, filtering, or other advanced features."},function(Me){let ot=null,dt=!1;Me.isITable?ot=Me:Me.getValue()&&(ot=Me.getValue(),dt=!0),$C(this,ot,dt)}),new He("deleteTable",Z,{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
- `},zF={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 FF(e){let{announcements:t=zF,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=LF}=e;const{announce:i,announcement:a}=function(){const[f,h]=u.useState("");return{announce:u.useCallback(g=>{g!=null&&h(g)},[]),announcement:f}}(),l=t1("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(DF,{id:o,value:r.draggable}),u.createElement(AF,{id:l,announcement:a}));return n?yo.createPortal(p,n):p}var or;function Ku(){}function o5(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 Wi=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 BF(e,t){const n=qu(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 NF(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 $F=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 VF(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 HF=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=VF(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(NF)};function Sg(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Wi}const WF=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 UF={ignoreTransform:!1};function d0(e,t){t===void 0&&(t=UF);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),E=f.top-b-(1-x)*parseFloat(g.slice(g.indexOf(" ")+1)),C=y?f.width/y:f.width,R=x?f.height/x:f.height;return{width:C,height:R,top:E,right:w+C,bottom:E+R,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 d0(e,{ignoreTransform:!0})}function F2(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(!_1(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]=F2(e,1);return t??null}function r5(e){return A2&&e?c0(e)?e:mf(e)?gf(e)||e===Xs(e).scrollingElement?window:_1(e)?e:null:null:null}function fS(e){return c0(e)?e.scrollX:e.scrollLeft}function mS(e){return c0(e)?e.scrollY:e.scrollTop}function Fh(e){return{x:fS(e),y:mS(e)}}var sr;function gS(e){return!(!A2||!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 qF={x:.2,y:.2};function KF(e,t,n,o,r){let{top:i,left:a,right:l,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=qF);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 GF(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)=>Ss(t,Fh(n)),Wi)}function bS(e,t){if(t===void 0&&(t=d0),!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 ZF=[["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 Bh{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=F2(n),r=xS(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of ZF)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 Ec{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 i5(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 yi,$n;function kg(e){e.preventDefault()}function XF(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"})(yi||(yi={})),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]},YF=(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 Ec(Xs(n)),this.windowListeners=new Ec(Fr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yi.Resize,this.handleCancel),this.windowListeners.add(yi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&bS(o),n(Wi)}handleKeyDown(t){if(z2(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=vS,coordinateGetter:a=YF,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}:Wi;this.referenceCoordinates||(this.referenceCoordinates=p);const f=a(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=n1(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:E,maxScroll:C,minScroll:R}=yS(y),_=GF(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,j=x===$n.Down&&!E||x===$n.Up&&!v;if(T&&L.x!==f.x){const S=y.scrollLeft+h.x,k=x===$n.Right&&S<=C.x||x===$n.Left&&S>=R.x;if(k&&!h.y)return void y.scrollTo({left:S,behavior:l});g.x=k?y.scrollLeft-S:x===$n.Right?y.scrollLeft-C.x:y.scrollLeft-R.x,g.x&&y.scrollBy({left:-g.x,behavior:l});break}if(j&&L.y!==f.y){const S=y.scrollTop+h.y,k=x===$n.Down&&S<=C.y||x===$n.Up&&S>=R.y;if(k&&!h.x)return void y.scrollTo({top:S,behavior:l});g.y=k?y.scrollTop-S:x===$n.Down?y.scrollTop-C.y:y.scrollTop-R.y,g.y&&y.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ss(n1(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:Xs(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=Xs(a),this.documentListeners=new Ec(this.document),this.listeners=new Ec(o),this.windowListeners=new Ec(Fr(a)),this.initialCoordinates=(r=qu(i))!=null?r:Wi,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(yi.Resize,this.handleCancel),this.windowListeners.add(yi.DragStart,kg),this.windowListeners.add(yi.VisibilityChange,this.handleCancel),this.windowListeners.add(yi.ContextMenu,kg),this.documentListeners.add(yi.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(yi.Click,XF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yi.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=qu(t))!=null?n:Wi,d=n1(r,c);if(!o&&l){if(Eg(l)){if(l.tolerance!=null&&i5(d,l.tolerance))return this.handleCancel();if(i5(d,l.distance))return this.handleStart()}return Mg(l)&&i5(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 JF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wS extends xf{constructor(t){const{event:n}=t,o=Xs(n.target);super(t,JF,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 QF={move:{name:"mousemove"},end:{name:"mouseup"}};var Nh;(function(e){e[e.RightClick=2]="RightClick"})(Nh||(Nh={}));class SS extends xf{constructor(t){super(t,QF,Xs(t.event.target))}}SS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==Nh.RightClick&&(o?.({event:n}),!0)}}];const a5={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class CS extends xf{constructor(t){super(t,a5)}static setup(){return window.addEventListener(a5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(a5.move.name,t)};function t(){}}}var Mc,Gu;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"}(Mc||(Mc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Gu||(Gu={}));const eB={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};var o1,$h;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(o1||(o1={})),($h||($h={})).Optimized="optimized";const Tg=new Map;function Vh(e,t){return cc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zu(e){let{callback:t,disabled:n}=e;const o=L2(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 tB(e){return new Bh(d0(e),e)}function _g(e,t,n){t===void 0&&(t=tB);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=L2(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=Zu({callback:i});return $i(()=>{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!==Wi;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?n1(e,n.current):Wi}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 _1(t)?t:e}const nB=[{sensor:wS,options:{}},{sensor:yf,options:{}}],oB={current:{}},nu={draggable:{measure:Cg},droppable:{measure:Cg,strategy:o1.WhileDragging,frequency:$h.Optimized},dragOverlay:{measure:d0}};class Tc 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 rB={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ku},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nu,measureDroppableContainers:Ku,windowRect:null,measuringScheduled:!1},ES={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ku,draggableNodes:new Map,over:null,measureDroppableContainers:Ku},r1=u.createContext(ES),MS=u.createContext(rB);function iB(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tc}}}function aB(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 Tc(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 Tc(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 Tc(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function lB(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(r1),i=Uu(o),a=Uu(n?.id);return u.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!z2(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=PF(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 B2=u.createContext({...Wi,scaleX:1,scaleY:1});var Ka;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ka||(Ka={}));const sB=u.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=nB,collisionDetection:p=HF,measuring:f,modifiers:h,...g}=e;const m=u.useReducer(aB,void 0,iB),[y,x]=m,[v,b]=function(){const[te]=u.useState(()=>new Set),ae=u.useCallback(pe=>(te.add(pe),()=>te.delete(pe)),[te]);return[u.useCallback(pe=>{let{type:me,event:fe}=pe;te.forEach(je=>{var Fe;return(Fe=je[me])==null?void 0:Fe.call(je,fe)})},[te]),ae]}(),[w,E]=u.useState(Ka.Uninitialized),C=w===Ka.Initialized,{draggable:{active:R,nodes:_,translate:L},droppable:{containers:T}}=y,j=R!=null?_.get(R):null,S=u.useRef({initial:null,translated:null}),k=u.useMemo(()=>{var te;return R!=null?{id:R,data:(te=j?.data)!=null?te:oB,rect:S}:null},[R,j]),P=u.useRef(null),[O,I]=u.useState(null),[z,A]=u.useState(null),D=kc(g,Object.values(g)),F=t1("DndDescribedBy",i),B=u.useMemo(()=>T.getEnabled(),[T]),M=u.useMemo(()=>({draggable:{...nu.draggable,...N?.draggable},droppable:{...nu.droppable,...N?.droppable},dragOverlay:{...nu.dragOverlay,...N?.dragOverlay}}),[(N=f)==null?void 0:N.draggable,N?.droppable,N?.dragOverlay]);var N;const{droppableRects:V,measureDroppableContainers:U,measuringScheduled:J}=function(te,ae){let{dragging:pe,dependencies:me,config:fe}=ae;const[je,Fe]=u.useState(null),{frequency:Ge,measure:et,strategy:tt}=fe,it=u.useRef(te),At=function(){switch(tt){case o1.Always:return!1;case o1.BeforeDragging:return pe;default:return!pe}}(),Lt=kc(At),_t=u.useCallback(function(Zt){Zt===void 0&&(Zt=[]),Lt.current||Fe(Tn=>Tn===null?Zt:Tn.concat(Zt.filter(pn=>!Tn.includes(pn))))},[Lt]),$t=u.useRef(null),nn=cc(Zt=>{if(At&&!pe)return Tg;if(!Zt||Zt===Tg||it.current!==te||je!=null){const Tn=new Map;for(let pn of te){if(!pn)continue;if(je&&je.length>0&&!je.includes(pn.id)&&pn.rect.current){Tn.set(pn.id,pn.rect.current);continue}const En=pn.node.current,kt=En?new Bh(et(En),En):null;pn.rect.current=kt,kt&&Tn.set(pn.id,kt)}return Tn}return Zt},[te,je,pe,At,et]);return u.useEffect(()=>{it.current=te},[te]),u.useEffect(()=>{At||_t()},[pe,At]),u.useEffect(()=>{je&&je.length>0&&Fe(null)},[JSON.stringify(je)]),u.useEffect(()=>{At||typeof Ge!="number"||$t.current!==null||($t.current=setTimeout(()=>{_t(),$t.current=null},Ge))},[Ge,At,_t,...me]),{droppableRects:nn,measureDroppableContainers:_t,measuringScheduled:je!=null}}(B,{dragging:C,dependencies:[L.x,L.y],config:M.droppable}),X=function(te,ae){const pe=ae!=null?te.get(ae):void 0,me=pe?pe.node.current:null;return cc(fe=>{var je;return ae==null?null:(je=me??fe)!=null?je:null},[me,ae])}(_,R),H=u.useMemo(()=>z?qu(z):null,[z]),ne=function(){const te=O?.autoScrollEnabled===!1,ae=typeof l=="object"?l.enabled===!1:l===!1,pe=C&&!te&&!ae;return typeof l=="object"?{...l,enabled:pe}:{enabled:pe}}(),oe=(ye=X,de=M.draggable.measure,Vh(ye,de));var ye,de;(function(te){let{activeNode:ae,measure:pe,initialRect:me,config:fe=!0}=te;const je=u.useRef(!1),{x:Fe,y:Ge}=typeof fe=="boolean"?{x:fe,y:fe}:fe;$i(()=>{if(!Fe&&!Ge||!ae)return void(je.current=!1);if(je.current||!me)return;const et=ae?.node.current;if(!et||et.isConnected===!1)return;const tt=Sg(pe(et),me);if(Fe||(tt.x=0),Ge||(tt.y=0),je.current=!0,Math.abs(tt.x)>0||Math.abs(tt.y)>0){const it=hS(et);it&&it.scrollBy({top:tt.y,left:tt.x})}},[ae,Fe,Ge,me,pe])})({activeNode:R!=null?_.get(R):null,config:ne.layoutShiftCompensation,initialRect:oe,measure:M.draggable.measure});const xe=_g(X,M.draggable.measure,oe),we=_g(X?X.parentElement:null),ve=u.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=T.getNodeFor((t=ve.current.over)==null?void 0:t.id),ce=function(te){let{measure:ae}=te;const[pe,me]=u.useState(null),fe=Zu({callback:u.useCallback(et=>{for(const{target:tt}of et)if(_1(tt)){me(it=>{const At=ae(tt);return it?{...it,width:At.width,height:At.height}:At});break}},[ae])}),je=u.useCallback(et=>{const tt=kS(et);fe?.disconnect(),tt&&fe?.observe(tt),me(tt?ae(tt):null)},[ae,fe]),[Fe,Ge]=tu(je);return u.useMemo(()=>({nodeRef:Fe,rect:pe,setRef:Ge}),[pe,Fe,Ge])}({measure:M.dragOverlay.measure}),Se=(n=ce.nodeRef.current)!=null?n:X,ie=C?(o=ce.rect)!=null?o:xe:null,Y=!(!ce.nodeRef.current||!ce.rect),le=Sg(ee=Y?null:xe,Vh(ee));var ee;const Pe=Ig(Se?Fr(Se):null),Te=function(te){const ae=u.useRef(te),pe=cc(me=>te?me&&me!==jg&&te&&ae.current&&te.parentNode===ae.current.parentNode?me:F2(te):jg,[te]);return u.useEffect(()=>{ae.current=te},[te]),pe}(C?re??X:null),rt=function(te,ae){ae===void 0&&(ae=d0);const[pe]=te,me=Ig(pe?Fr(pe):null),[fe,je]=u.useState(Pg);function Fe(){je(()=>te.length?te.map(et=>gS(et)?me:new Bh(ae(et),et)):Pg)}const Ge=Zu({callback:Fe});return $i(()=>{Ge?.disconnect(),Fe(),te.forEach(et=>Ge?.observe(et))},[te]),fe}(Te),Ve=TS(h,{transform:{x:L.x-le.x,y:L.y-le.y,scaleX:1,scaleY:1},activatorEvent:z,active:k,activeNodeRect:xe,containerNodeRect:we,draggingNodeRect:ie,over:ve.current.over,overlayNodeRect:ce.rect,scrollableAncestors:Te,scrollableAncestorRects:rt,windowRect:Pe}),Ee=H?Ss(H,L):null,Re=function(te){const[ae,pe]=u.useState(null),me=u.useRef(te),fe=u.useCallback(je=>{const Fe=r5(je.target);Fe&&pe(Ge=>Ge?(Ge.set(Fe,Fh(Fe)),new Map(Ge)):null)},[]);return u.useEffect(()=>{const je=me.current;if(te!==je){Fe(je);const Ge=te.map(et=>{const tt=r5(et);return tt?(tt.addEventListener("scroll",fe,{passive:!0}),[tt,Fh(tt)]):null}).filter(et=>et!=null);pe(Ge.length?new Map(Ge):null),me.current=te}return()=>{Fe(te),Fe(je)};function Fe(Ge){Ge.forEach(et=>{r5(et)?.removeEventListener("scroll",fe)})}},[fe,te]),u.useMemo(()=>te.length?ae?Array.from(ae.values()).reduce((je,Fe)=>Ss(je,Fe),Wi):xS(te):Wi,[te,ae])}(Te),Xe=Rg(Re),Be=Rg(Re,[xe]),ct=Ss(Ve,Xe),Qe=ie?WF(ie,Ve):null,he=k&&Qe?p({active:k,collisionRect:Qe,droppableRects:V,droppableContainers:B,pointerCoordinates:Ee}):null,Ye=uS(he,"id"),[ke,Ie]=u.useState(null),ue=function(te,ae,pe){return{...te,scaleX:ae&&pe?ae.width/pe.width:1,scaleY:ae&&pe?ae.height/pe.height:1}}(Y?Ve:Ss(Ve,Be),(r=ke?.rect)!=null?r:null,xe),De=u.useRef(null),Ae=u.useCallback((te,ae)=>{let{sensor:pe,options:me}=ae;if(P.current==null)return;const fe=_.get(P.current);if(!fe)return;const je=te.nativeEvent,Fe=new pe({active:P.current,activeNode:fe,event:je,options:me,context:ve,onAbort(et){if(!_.get(et))return;const{onDragAbort:tt}=D.current,it={id:et};tt?.(it),v({type:"onDragAbort",event:it})},onPending(et,tt,it,At){if(!_.get(et))return;const{onDragPending:Lt}=D.current,_t={id:et,constraint:tt,initialCoordinates:it,offset:At};Lt?.(_t),v({type:"onDragPending",event:_t})},onStart(et){const tt=P.current;if(tt==null)return;const it=_.get(tt);if(!it)return;const{onDragStart:At}=D.current,Lt={activatorEvent:je,active:{id:tt,data:it.data,rect:S}};yo.unstable_batchedUpdates(()=>{At?.(Lt),E(Ka.Initializing),x({type:or.DragStart,initialCoordinates:et,active:tt}),v({type:"onDragStart",event:Lt}),I(De.current),A(je)})},onMove(et){x({type:or.DragMove,coordinates:et})},onEnd:Ge(or.DragEnd),onCancel:Ge(or.DragCancel)});function Ge(et){return async function(){const{active:tt,collisions:it,over:At,scrollAdjustedTranslate:Lt}=ve.current;let _t=null;if(tt&&Lt){const{cancelDrop:$t}=D.current;_t={activatorEvent:je,active:tt,collisions:it,delta:Lt,over:At},et===or.DragEnd&&typeof $t=="function"&&await Promise.resolve($t(_t))&&(et=or.DragCancel)}P.current=null,yo.unstable_batchedUpdates(()=>{x({type:et}),E(Ka.Uninitialized),Ie(null),I(null),A(null),De.current=null;const $t=et===or.DragEnd?"onDragEnd":"onDragCancel";if(_t){const nn=D.current[$t];nn?.(_t),v({type:$t,event:_t})}})}}De.current=Fe},[_]),W=u.useCallback((te,ae)=>(pe,me)=>{const fe=pe.nativeEvent,je=_.get(me);if(P.current!==null||!je||fe.dndKit||fe.defaultPrevented)return;const Fe={active:je};te(pe,ae.options,Fe)===!0&&(fe.dndKit={capturedBy:ae.sensor},P.current=me,Ae(pe,ae))},[_,Ae]),Q=function(te,ae){return u.useMemo(()=>te.reduce((pe,me)=>{const{sensor:fe}=me;return[...pe,...fe.activators.map(je=>({eventName:je.eventName,handler:ae(je.handler,me)}))]},[]),[te,ae])}(d,W);(function(te){u.useEffect(()=>{if(!A2)return;const ae=te.map(pe=>{let{sensor:me}=pe;return me.setup==null?void 0:me.setup()});return()=>{for(const pe of ae)pe?.()}},te.map(ae=>{let{sensor:pe}=ae;return pe}))})(d),$i(()=>{xe&&w===Ka.Initializing&&E(Ka.Initialized)},[xe,w]),u.useEffect(()=>{const{onDragMove:te}=D.current,{active:ae,activatorEvent:pe,collisions:me,over:fe}=ve.current;if(!ae||!pe)return;const je={active:ae,activatorEvent:pe,collisions:me,delta:{x:ct.x,y:ct.y},over:fe};yo.unstable_batchedUpdates(()=>{te?.(je),v({type:"onDragMove",event:je})})},[ct.x,ct.y]),u.useEffect(()=>{const{active:te,activatorEvent:ae,collisions:pe,droppableContainers:me,scrollAdjustedTranslate:fe}=ve.current;if(!te||P.current==null||!ae||!fe)return;const{onDragOver:je}=D.current,Fe=me.get(Ye),Ge=Fe&&Fe.rect.current?{id:Fe.id,rect:Fe.rect.current,data:Fe.data,disabled:Fe.disabled}:null,et={active:te,activatorEvent:ae,collisions:pe,delta:{x:fe.x,y:fe.y},over:Ge};yo.unstable_batchedUpdates(()=>{Ie(Ge),je?.(et),v({type:"onDragOver",event:et})})},[Ye]),$i(()=>{ve.current={activatorEvent:z,active:k,activeNode:X,collisionRect:Qe,collisions:he,droppableRects:V,draggableNodes:_,draggingNode:Se,draggingNodeRect:ie,droppableContainers:T,over:ke,scrollableAncestors:Te,scrollAdjustedTranslate:ct},S.current={initial:ie,translated:Qe}},[k,X,he,Qe,_,Se,ie,V,T,ke,Te,ct]),function(te){let{acceleration:ae,activator:pe=Mc.Pointer,canScroll:me,draggingRect:fe,enabled:je,interval:Fe=5,order:Ge=Gu.TreeOrder,pointerCoordinates:et,scrollableAncestors:tt,scrollableAncestorRects:it,delta:At,threshold:Lt}=te;const _t=function(mn){let{delta:Ln,disabled:Nn}=mn;const hn=Uu(Ln);return cc(fo=>{if(Nn||!hn||!fo)return eB;const bo=Math.sign(Ln.x-hn.x),Fo=Math.sign(Ln.y-hn.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,Ln,hn])}({delta:At,disabled:!je}),[$t,nn]=function(){const mn=u.useRef(null);return[u.useCallback((Ln,Nn)=>{mn.current=setInterval(Ln,Nn)},[]),u.useCallback(()=>{mn.current!==null&&(clearInterval(mn.current),mn.current=null)},[])]}(),Zt=u.useRef({x:0,y:0}),Tn=u.useRef({x:0,y:0}),pn=u.useMemo(()=>{switch(pe){case Mc.Pointer:return et?{top:et.y,bottom:et.y,left:et.x,right:et.x}:null;case Mc.DraggableRect:return fe}},[pe,fe,et]),En=u.useRef(null),kt=u.useCallback(()=>{const mn=En.current;if(!mn)return;const Ln=Zt.current.x*Tn.current.x,Nn=Zt.current.y*Tn.current.y;mn.scrollBy(Ln,Nn)},[]),on=u.useMemo(()=>Ge===Gu.TreeOrder?[...tt].reverse():tt,[Ge,tt]);u.useEffect(()=>{if(je&&tt.length&&pn){for(const mn of on){if(me?.(mn)===!1)continue;const Ln=tt.indexOf(mn),Nn=it[Ln];if(!Nn)continue;const{direction:hn,speed:fo}=KF(mn,Nn,pn,ae,Lt);for(const bo of["x","y"])_t[bo][hn[bo]]||(fo[bo]=0,hn[bo]=0);if(fo.x>0||fo.y>0)return nn(),En.current=mn,$t(kt,Fe),Zt.current=fo,void(Tn.current=hn)}Zt.current={x:0,y:0},Tn.current={x:0,y:0},nn()}else nn()},[ae,kt,me,nn,je,Fe,JSON.stringify(pn),JSON.stringify(_t),$t,tt,on,it,JSON.stringify(Lt)])}({...ne,delta:L,draggingRect:Qe,pointerCoordinates:Ee,scrollableAncestors:Te,scrollableAncestorRects:rt});const K=u.useMemo(()=>({active:k,activeNode:X,activeNodeRect:xe,activatorEvent:z,collisions:he,containerNodeRect:we,dragOverlay:ce,draggableNodes:_,droppableContainers:T,droppableRects:V,over:ke,measureDroppableContainers:U,scrollableAncestors:Te,scrollableAncestorRects:rt,measuringConfiguration:M,measuringScheduled:J,windowRect:Pe}),[k,X,xe,z,he,we,ce,_,T,V,ke,U,Te,rt,M,J,Pe]),se=u.useMemo(()=>({activatorEvent:z,activators:Q,active:k,activeNodeRect:xe,ariaDescribedById:{draggable:F},dispatch:x,draggableNodes:_,over:ke,measureDroppableContainers:U}),[z,Q,k,xe,x,F,_,ke,U]);return u.createElement(sS.Provider,{value:b},u.createElement(r1.Provider,{value:se},u.createElement(MS.Provider,{value:K},u.createElement(B2.Provider,{value:ue},c)),u.createElement(lB,{disabled:a?.restoreFocus===!1})),u.createElement(FF,{...a,hiddenTextDescribedById:F}))}),cB=u.createContext(null),Og="button";function _S(){return u.useContext(MS)}const dB={timeout:25};function uB(e){let{animation:t,children:n}=e;const[o,r]=u.useState(null),[i,a]=u.useState(null),l=Uu(n);return n||o||!l||r(l),$i(()=>{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 pB={x:0,y:0,scaleX:1,scaleY:1};function hB(e){let{children:t}=e;return u.createElement(r1.Provider,{value:ES},u.createElement(B2.Provider,{value:pB},t))}const fB={position:"fixed",touchAction:"none"},mB=e=>z2(e)?"transform 250ms ease":void 0,gB=u.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:l,style:c,transform:d,transition:p=mB}=e;if(!l)return null;const f=r?d:{...d,scaleX:1,scaleY:1},h={...fB,width:l.width,height:l.height,top:l.top,left:l.left,transform:Wl.Transform.toString(f),transformOrigin:r&&o?BF(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:Wl.Transform.toString(t)},{transform:Wl.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 yB=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:E,windowRect:C}=_S(),R=u.useContext(B2),_=(k=f?.id,u.useMemo(()=>{if(k!=null)return Dg++,Dg},[k])),L=TS(a,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:x.rect,over:v,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:E,transform:R,windowRect:C}),T=Vh(h),j=function(P){let{config:O,draggableNodes:I,droppableContainers:z,measuringConfiguration:A}=P;return L2((D,F)=>{if(O===null)return;const B=I.get(D);if(!B)return;const M=B.node.current;if(!M)return;const N=kS(F);if(!N)return;const{transform:V}=Fr(F).getComputedStyle(F),U=pS(V);if(!U)return;const J=typeof O=="function"?O:function(X){const{duration:H,easing:ne,sideEffects:oe,keyframes:ye}={...jS,...X};return de=>{let{active:xe,dragOverlay:we,transform:ve,...re}=de;if(!H)return;const ce=we.rect.left-xe.rect.left,Se=we.rect.top-xe.rect.top,ie={scaleX:ve.scaleX!==1?xe.rect.width*ve.scaleX/we.rect.width:1,scaleY:ve.scaleY!==1?xe.rect.height*ve.scaleY/we.rect.height:1},Y={x:ve.x-ce,y:ve.y-Se,...ie},le=ye({...re,active:xe,dragOverlay:we,transform:{initial:ve,final:Y}}),[ee]=le,Pe=le[le.length-1];if(JSON.stringify(ee)===JSON.stringify(Pe))return;const Te=oe?.({active:xe,dragOverlay:we,...re}),rt=we.node.animate(le,{duration:H,easing:ne,fill:"forwards"});return new Promise(Ve=>{rt.onfinish=()=>{Te?.(),Ve()}})}}(O);return bS(M,A.draggable.measure),J({active:{id:D,data:B.data,node:M,rect:A.draggable.measure(M)},draggableNodes:I,dragOverlay:{node:F,rect:A.dragOverlay.measure(N)},droppableContainers:z,measuringConfiguration:A,transform:U})})}({config:o,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),S=T?x.setRef:void 0;var k;return u.createElement(hB,null,u.createElement(uB,{animation:j},f&&_?u.createElement(gB,{key:_,id:f.id,ref:S,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 xB(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function kd(e){return e!==null&&e>=0}const Ed={scaleX:1,scaleY:1},bB=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,...Ed}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Ed}:a<r&&a>=i?{x:l.width+c,y:0,...Ed}:{x:0,y:0,...Ed}},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 vB(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=t1(RS,n),h=l.rect!==null,g=u.useMemo(()=>o.map(R=>typeof R=="object"&&"id"in R?R.id:R),[o]),m=a!=null,y=a?g.indexOf(a.id):-1,x=d?g.indexOf(d.id):-1,v=u.useRef(g),b=!function(R,_){if(R===_)return!0;if(R.length!==_.length)return!1;for(let L=0;L<R.length;L++)if(R[L]!==_[L])return!1;return!0}(g,v.current),w=x!==-1&&y===-1||b,E=function(R){return typeof R=="boolean"?{draggable:R,droppable:R}:R}(i);$i(()=>{b&&m&&p(g)},[b,g,m,p]),u.useEffect(()=>{v.current=g},[g]);const C=u.useMemo(()=>({activeIndex:y,containerId:f,disabled:E,disableTransforms:w,items:g,overIndex:x,useDragOverlay:h,sortedRects:xB(g,c),strategy:r}),[y,f,E.draggable,E.droppable,w,g,x,c,h,r]);return u.createElement(IS.Provider,{value:C},t)}const wB=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bf(n,o,r).indexOf(t)},SB=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))},CB={duration:200,easing:"ease"},PS="transform",kB=Wl.Transition.toString({property:PS,duration:0,easing:"linear"}),EB={roleDescription:"sortable"};function Xu(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 MB=[$n.Down,$n.Right,$n.Up,$n.Left],TB=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(MB.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:E}=w,C=y.get(E);if(C){const R=vg(C),_=v.reduce((T,j,S)=>T+cS(R[S],j),0),L=Number((_/4).toFixed(4));b.push({id:E,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=F2(x).some((R,_)=>l[_]!==R),b=Ag(g,m),w=(d=m,!!(Xu(c=g)&&Xu(d)&&Ag(c,d))&&c.data.current.sortable.index<d.data.current.sortable.index),E=v||!b?{x:0,y:0}:{x:w?o.width-y.width:0,y:w?o.height-y.height:0},C={x:y.left,y:y.top};return E.x&&E.y?C:n1(C,E)}}}var c,d};function Ag(e,t){return!(!Xu(e)||!Xu(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const _B=e=>{let{transform:t}=e;return{...t,y:0}},jB=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"}})]})})),zi={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",zi.Wrapper,r&&zi.fadeIn,f&&zi.sorting,t&&zi.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(zi.Item,n&&zi.dragging,i&&zi.withHandle,t&&zi.dragOverlay,o&&zi.disabled,e&&zi.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"},RB=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}))),IB={...jS},PB=u.memo(u.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=$F,coordinateGetter:l=TB,dropAnimation:c=IB,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:E=vf,style:C,useDragOverlay:R=!0,onDragStart:_,wrapperStyle:L=()=>({})}=e,[T,j]=u.useState(()=>h);u.useEffect(()=>{j(h)},[h]);const[S,k]=u.useState(null),P=function(){for(var D=arguments.length,F=new Array(D),B=0;B<D;B++)F[B]=arguments[B];return u.useMemo(()=>[...F].filter(M=>M!=null),[...F])}(o5(SS,{activationConstraint:o}),o5(CS,{activationConstraint:o}),o5(yf,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:l})),O=T.indexOf.bind(T),I=S?O(S):-1,z=[];T.map((D,F)=>{z.push(s.jsx(OB,{id:D,handle:f,index:F,style:d,wrapperStyle:L,disabled:m(D),renderItem:v,animateLayoutChanges:r,useDragOverlay:R,getNewIndex:p},D+"-"+F));const B=b?.({key:"divider-"+F});B&&z.push(B)});const{getPortalContainer:A}=(u.useEffect(()=>{function D(){const F=document.fullscreenElement;if(!F)return;let B=F.querySelector(".fullscreen-portal-root");B||(B=document.createElement("div"),B.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",F.appendChild(B))}return Q1++,D(),document.addEventListener("fullscreenchange",D),()=>{document.removeEventListener("fullscreenchange",D),Q1--,Q1<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(F=>{F.parentNode&&F.parentNode.removeChild(F)}),Q1=0)}},[]),{getPortalContainer:XR});return s.jsxs(sB,{sensors:P,collisionDetection:a,onDragStart:D=>{const{active:F}=D;F&&(_?.(D),k(F.id))},autoScroll:{canScroll:D=>!0},onDragEnd:D=>{if(k(null),D.over){const F=O(D.over.id);I!==F&&(j(B=>w(B,I,F)),g?.(I,F))}},onDragCancel:()=>{k(null)},measuring:y,modifiers:x,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...C},className:Zr(n,zi.Wrapper),children:s.jsx(vB,{items:T,strategy:E,children:s.jsx(RB,{ref:t,children:z})})}),R?yo.createPortal(s.jsx(yB,{adjustScale:i,dropAnimation:c,children:S?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:S!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),A()):null]})}));function OB({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:E=SB,attributes:C,disabled:R,data:_,getNewIndex:L=wB,id:T,strategy:j,resizeObserverConfig:S,transition:k=CB}=w;const{items:P,containerId:O,activeIndex:I,disabled:z,disableTransforms:A,sortedRects:D,overIndex:F,useDragOverlay:B,strategy:M}=u.useContext(IS),N=(he=z,typeof(Qe=R)=="boolean"?{draggable:Qe,droppable:!1}:{draggable:(Ye=Qe?.draggable)!=null?Ye:he.draggable,droppable:(ke=Qe?.droppable)!=null?ke:he.droppable}),V=P.indexOf(T),U=u.useMemo(()=>({sortable:{containerId:O,index:V,items:P},..._}),[O,_,V,P]),J=u.useMemo(()=>P.slice(P.indexOf(T)),[P,T]),{rect:X,node:H,isOver:ne,setNodeRef:oe}=function(Ie){let{data:ue,disabled:De=!1,id:Ae,resizeObserverConfig:W}=Ie;const Q=t1("Droppable"),{active:K,dispatch:se,over:te,measureDroppableContainers:ae}=u.useContext(r1),pe=u.useRef({disabled:De}),me=u.useRef(!1),fe=u.useRef(null),je=u.useRef(null),{disabled:Fe,updateMeasurementsFor:Ge,timeout:et}={...dB,...W},tt=kc(Ge??Ae),it=Zu({callback:u.useCallback(()=>{me.current?(je.current!=null&&clearTimeout(je.current),je.current=setTimeout(()=>{ae(Array.isArray(tt.current)?tt.current:[tt.current]),je.current=null},et)):me.current=!0},[et]),disabled:Fe||!K}),At=u.useCallback((nn,Zt)=>{it&&(Zt&&(it.unobserve(Zt),me.current=!1),nn&&it.observe(nn))},[it]),[Lt,_t]=tu(At),$t=kc(ue);return u.useEffect(()=>{it&&Lt.current&&(it.disconnect(),me.current=!1,it.observe(Lt.current))},[Lt,it]),u.useEffect(()=>(se({type:or.RegisterDroppable,element:{id:Ae,key:Q,disabled:De,node:Lt,rect:fe,data:$t}}),()=>se({type:or.UnregisterDroppable,key:Q,id:Ae})),[Ae]),u.useEffect(()=>{De!==pe.current.disabled&&(se({type:or.SetDroppableDisabled,id:Ae,key:Q,disabled:De}),pe.current.disabled=De)},[Ae,Q,De,se]),{active:K,rect:fe,isOver:te?.id===Ae,node:Lt,over:te,setNodeRef:_t}}({id:T,data:U,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:J,...S}}),{active:ye,activatorEvent:de,activeNodeRect:xe,attributes:we,setNodeRef:ve,listeners:re,isDragging:ce,over:Se,setActivatorNodeRef:ie,transform:Y}=function(Ie){let{id:ue,data:De,disabled:Ae=!1,attributes:W}=Ie;const Q=t1("Draggable"),{activators:K,activatorEvent:se,active:te,activeNodeRect:ae,ariaDescribedById:pe,draggableNodes:me,over:fe}=u.useContext(r1),{role:je=Og,roleDescription:Fe="draggable",tabIndex:Ge=0}=W??{},et=te?.id===ue,tt=u.useContext(et?B2:cB),[it,At]=tu(),[Lt,_t]=tu(),$t=(Zt=K,Tn=ue,u.useMemo(()=>Zt.reduce((pn,En)=>{let{eventName:kt,handler:on}=En;return pn[kt]=mn=>{on(mn,Tn)},pn},{}),[Zt,Tn])),nn=kc(De);var Zt,Tn;return $i(()=>(me.set(ue,{id:ue,key:Q,node:it,activatorNode:Lt,data:nn}),()=>{const pn=me.get(ue);pn&&pn.key===Q&&me.delete(ue)}),[me,ue]),{active:te,activatorEvent:se,activeNodeRect:ae,attributes:u.useMemo(()=>({role:je,tabIndex:Ge,"aria-disabled":Ae,"aria-pressed":!(!et||je!==Og)||void 0,"aria-roledescription":Fe,"aria-describedby":pe.draggable}),[Ae,je,Ge,et,Fe,pe.draggable]),isDragging:et,listeners:Ae?void 0:$t,node:it,over:fe,setNodeRef:At,setActivatorNodeRef:_t,transform:tt}}({id:T,data:U,attributes:{...EB,...C},disabled:N.draggable}),le=function(){for(var Ie=arguments.length,ue=new Array(Ie),De=0;De<Ie;De++)ue[De]=arguments[De];return u.useMemo(()=>Ae=>{ue.forEach(W=>W(Ae))},ue)}(oe,ve),ee=!!ye,Pe=ee&&!A&&kd(I)&&kd(F),Te=!B&&ce,rt=Pe?(Te&&Pe?Y:null)??(j??M)({rects:D,activeNodeRect:xe,activeIndex:I,overIndex:F,index:V}):null,Ve=kd(I)&&kd(F)?L({id:T,items:P,activeIndex:I,overIndex:F}):V,Ee=ye?.id,Re=u.useRef({activeId:Ee,items:P,newIndex:Ve,containerId:O}),Xe=P!==Re.current.items,Be=E({active:ye,containerId:O,isDragging:ce,isSorting:ee,id:T,index:V,items:P,newIndex:Re.current.newIndex,previousItems:Re.current.items,previousContainerId:Re.current.containerId,transition:k,wasDragging:Re.current.activeId!=null}),ct=function(Ie){let{disabled:ue,index:De,node:Ae,rect:W}=Ie;const[Q,K]=u.useState(null),se=u.useRef(De);return $i(()=>{if(!ue&&De!==se.current&&Ae.current){const te=W.current;if(te){const ae=d0(Ae.current,{ignoreTransform:!0}),pe={x:te.left-ae.left,y:te.top-ae.top,scaleX:te.width/ae.width,scaleY:te.height/ae.height};(pe.x||pe.y)&&K(pe)}}De!==se.current&&(se.current=De)},[ue,De,Ae,W]),u.useEffect(()=>{Q&&K(null)},[Q]),Q}({disabled:!Be,index:V,node:H,rect:X});var Qe,he,Ye,ke;return u.useEffect(()=>{ee&&Re.current.newIndex!==Ve&&(Re.current.newIndex=Ve),O!==Re.current.containerId&&(Re.current.containerId=O),P!==Re.current.items&&(Re.current.items=P)},[ee,Ve,O,P]),u.useEffect(()=>{if(Ee===Re.current.activeId)return;if(Ee!=null&&Re.current.activeId==null)return void(Re.current.activeId=Ee);const Ie=setTimeout(()=>{Re.current.activeId=Ee},50);return()=>clearTimeout(Ie)},[Ee]),{active:ye,activeIndex:I,attributes:we,data:U,rect:X,index:V,newIndex:Ve,items:P,isOver:ne,isSorting:ee,isDragging:ce,listeners:re,node:H,overIndex:F,over:Se,setNodeRef:le,setActivatorNodeRef:ie,setDroppableNodeRef:oe,setDraggableNodeRef:ve,transform:ct??rt,transition:ct||Xe&&Re.current.newIndex===V?kB:Te&&!z2(de)||!k||!ee&&!Be?void 0:Wl.Transition.toString({...k,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 DB=new $.Color("rgb(33, 115, 70)"),AB="#eee",LB=e=>s.jsx(jB,{...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=AR,createTabButton:g=LB,createTabDivider:m,editLabelProps:y,disabled:x=!1,disableDrag:v=!1,background:b="white",activeColor:w=DB,borderColor:E=AB,borderWidth:C=1}=e,[R,_]=u.useState(i),[L,T]=u.useState(a),j=u.useCallback(ie=>{const Y=A.current?.[ie]?.closest(".tab-item")??A.current?.[ie];Y&&U.current?.scrollTo({top:Y.offsetTop,left:Y.offsetLeft,behavior:"smooth"})},[]);u.useEffect(()=>{j(i)},[i]);const S=u.useCallback((ie,Y)=>{Y!==R&&(_(Y),l?.(Y)),j(Y)},[l,R]),k=u.useCallback((ie,Y)=>{d?.(ie,Y)},[d]),P=u.useRef(null),[O,I]=u.useState(-1),z=u.useCallback((ie,Y)=>{c?.(ie,Y)},[c]);u.useLayoutEffect(()=>{_(i)},[i]),u.useLayoutEffect(()=>{T(a)},[a]);const A=u.useRef([]),D=u.useRef(null);u.useImperativeHandle(t,()=>Object.assign({startEdit(ie){A.current?.[ie]?.startEdit()},cancel(ie){A.current?.[ie]?.cancel()}},D.current),[R,O]);const F=u.useCallback(({value:ie,index:Y,dragging:le})=>{const{style:ee,maxLength:Pe,...Te}=y||{},rt=s.jsx(IF,{ref:Ve=>{A.current[Y]=Ve},value:ie,disabled:x,maxLength:Pe,style:{color:R===Y&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...ee},styleHover:{},onSubmit:Ve=>(P.current=!1,I(-1),z(Y,Ve)),onCancel:()=>{P.current=!1,I(-1)},onChange:Ve=>{P.current=!0,I(Y)},...Te});return g({onClick:Ve=>S(Ve,Y),value:ie,index:Y,editing:O===Y&&P.current,editable:!0,disabled:x,selectedIndex:R,background:b,activeColor:w,borderColor:E,borderWidth:C,dragging:le,children:rt})},[R,z,S,y,x,O,g]),[B,{width:M}]=Hl(),[N,{width:V}]=Hl(),U=u.useRef(null),[J,X]=u.useState({left:0,top:0,width:0,height:0}),[H,ne]=u.useState(null);u.useEffect(()=>{H!==null&&U.current&&U.current.scrollTo({left:H,behavior:"smooth"})},[H]);const oe=u.useCallback((ie,Y=!1)=>{if(!U.current)return 0;let le=U.current.firstChild.getBoundingClientRect(),ee=U.current.firstChild.firstChild.children,Pe=0;return Pe=Y?0:b4.getScrollTo(ie,le.left,ee,!0,Math.max(0,ie-200)),ne(Pe),Math.max(0,Pe)},[]),ye=u.useCallback((ie,Y=!1)=>{if(!U.current)return 0;let le=U.current.firstChild.getBoundingClientRect(),ee=U.current.firstChild.firstChild.children,Pe=0;const Te=Math.ceil(V-M);return Pe=Y?Te:b4.getScrollTo(ie,le.left,ee,!1,Math.max(0,ie+200)),ne(Pe),Math.min(Te,Pe)},[V,M]),de=u.useRef(null),xe=u.useRef(null),we=u.useCallback(()=>{xe.current&&(clearTimeout(xe.current),xe.current=null,de.current=null)},[]),ve=u.useCallback((ie,Y,le=260)=>{de.current=ie,xe.current=setTimeout(()=>{const ee=Y?oe(de.current||ie):ye(de.current||ie);ee!==de.current?ve(ee,Y,120):we()},le)},[oe,ye,we]);u.useEffect(()=>()=>we(),[we]);const re=u.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(J.left)<=0||Math.floor(V-M)===0,orientation:yr.Horizontal,onMouseUp:we,onMouseLeave:we,onMouseDown:()=>ve(U.current.scrollLeft,!0),onClick:ie=>oe(Math.min(U.current.scrollLeft,H??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[J,H,V,M]),ce=u.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(V-M)<=Math.ceil(J.left),orientation:yr.Horizontal,onMouseUp:we,onMouseLeave:we,onMouseDown:()=>ve(U.current.scrollLeft,!1),onClick:ie=>ye(Math.max(U.current.scrollLeft,H??0),ie.ctrlKey)}),[J,H,V,M]),Se=u.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,h?.(re)]}),[re,ce,p,f,n,h]);return s.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:Zr("_TabStrip_3x0dp_1",r),ref:D,children:[s.jsx("div",{style:{borderTop:`solid ${E} ${C}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),s.jsx("div",{className:"Tabs",ref:B,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:ie=>{X({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:s.jsx(PB,{isDisabled:ie=>x||v,items:L,strategy:bB,modifiers:[_B],ref:N,renderItem:F,renderDivider:m,onMove:k,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ce)})]})}));DS.displayName="TabStrip";const zB=u.createContext(null),wf=()=>{const e=u.useContext(zB),[t]=u.useState(()=>new $.ThemeCollection);return u.useMemo(()=>e||t,[e])},FB=u.lazy(()=>Promise.resolve().then(()=>require("./BqFWpXnn-Mp8QJv3.cjs"))),BB={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||$B(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
+ `},zF={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 FF(e){let{announcements:t=zF,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=LF}=e;const{announce:i,announcement:a}=function(){const[f,h]=u.useState("");return{announce:u.useCallback(g=>{g!=null&&h(g)},[]),announcement:f}}(),l=t1("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(DF,{id:o,value:r.draggable}),u.createElement(AF,{id:l,announcement:a}));return n?yo.createPortal(p,n):p}var or;function Ku(){}function o5(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 Wi=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 BF(e,t){const n=qu(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 NF(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 $F=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 VF(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 HF=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=VF(l,t);c>0&&r.push({id:a,data:{droppableContainer:i,value:c}})}}return r.sort(NF)};function Sg(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Wi}const WF=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 UF={ignoreTransform:!1};function d0(e,t){t===void 0&&(t=UF);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),E=f.top-b-(1-x)*parseFloat(g.slice(g.indexOf(" ")+1)),C=y?f.width/y:f.width,R=x?f.height/x:f.height;return{width:C,height:R,top:E,right:w+C,bottom:E+R,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 d0(e,{ignoreTransform:!0})}function F2(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(!_1(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]=F2(e,1);return t??null}function r5(e){return A2&&e?c0(e)?e:mf(e)?gf(e)||e===Xs(e).scrollingElement?window:_1(e)?e:null:null:null}function fS(e){return c0(e)?e.scrollX:e.scrollLeft}function mS(e){return c0(e)?e.scrollY:e.scrollTop}function Fh(e){return{x:fS(e),y:mS(e)}}var sr;function gS(e){return!(!A2||!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 qF={x:.2,y:.2};function KF(e,t,n,o,r){let{top:i,left:a,right:l,bottom:c}=n;o===void 0&&(o=10),r===void 0&&(r=qF);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 GF(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)=>Ss(t,Fh(n)),Wi)}function bS(e,t){if(t===void 0&&(t=d0),!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 ZF=[["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 Bh{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=F2(n),r=xS(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,a,l]of ZF)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 Ec{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 i5(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 yi,$n;function kg(e){e.preventDefault()}function XF(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"})(yi||(yi={})),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]},YF=(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 Ec(Xs(n)),this.windowListeners=new Ec(Fr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yi.Resize,this.handleCancel),this.windowListeners.add(yi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&bS(o),n(Wi)}handleKeyDown(t){if(z2(t)){const{active:n,context:o,options:r}=this.props,{keyboardCodes:i=vS,coordinateGetter:a=YF,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}:Wi;this.referenceCoordinates||(this.referenceCoordinates=p);const f=a(t,{active:n,context:o.current,currentCoordinates:p});if(f){const h=n1(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:E,maxScroll:C,minScroll:R}=yS(y),_=GF(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,j=x===$n.Down&&!E||x===$n.Up&&!v;if(T&&L.x!==f.x){const S=y.scrollLeft+h.x,k=x===$n.Right&&S<=C.x||x===$n.Left&&S>=R.x;if(k&&!h.y)return void y.scrollTo({left:S,behavior:l});g.x=k?y.scrollLeft-S:x===$n.Right?y.scrollLeft-C.x:y.scrollLeft-R.x,g.x&&y.scrollBy({left:-g.x,behavior:l});break}if(j&&L.y!==f.y){const S=y.scrollTop+h.y,k=x===$n.Down&&S<=C.y||x===$n.Up&&S>=R.y;if(k&&!h.x)return void y.scrollTo({top:S,behavior:l});g.y=k?y.scrollTop-S:x===$n.Down?y.scrollTop-C.y:y.scrollTop-R.y,g.y&&y.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ss(n1(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:Xs(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=Xs(a),this.documentListeners=new Ec(this.document),this.listeners=new Ec(o),this.windowListeners=new Ec(Fr(a)),this.initialCoordinates=(r=qu(i))!=null?r:Wi,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(yi.Resize,this.handleCancel),this.windowListeners.add(yi.DragStart,kg),this.windowListeners.add(yi.VisibilityChange,this.handleCancel),this.windowListeners.add(yi.ContextMenu,kg),this.documentListeners.add(yi.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(yi.Click,XF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yi.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=qu(t))!=null?n:Wi,d=n1(r,c);if(!o&&l){if(Eg(l)){if(l.tolerance!=null&&i5(d,l.tolerance))return this.handleCancel();if(i5(d,l.distance))return this.handleStart()}return Mg(l)&&i5(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 JF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class wS extends xf{constructor(t){const{event:n}=t,o=Xs(n.target);super(t,JF,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 QF={move:{name:"mousemove"},end:{name:"mouseup"}};var Nh;(function(e){e[e.RightClick=2]="RightClick"})(Nh||(Nh={}));class SS extends xf{constructor(t){super(t,QF,Xs(t.event.target))}}SS.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button!==Nh.RightClick&&(o?.({event:n}),!0)}}];const a5={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class CS extends xf{constructor(t){super(t,a5)}static setup(){return window.addEventListener(a5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(a5.move.name,t)};function t(){}}}var Mc,Gu;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"}(Mc||(Mc={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Gu||(Gu={}));const eB={x:{[sr.Backward]:!1,[sr.Forward]:!1},y:{[sr.Backward]:!1,[sr.Forward]:!1}};var o1,$h;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(o1||(o1={})),($h||($h={})).Optimized="optimized";const Tg=new Map;function Vh(e,t){return cc(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zu(e){let{callback:t,disabled:n}=e;const o=L2(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 tB(e){return new Bh(d0(e),e)}function _g(e,t,n){t===void 0&&(t=tB);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=L2(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=Zu({callback:i});return $i(()=>{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!==Wi;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?n1(e,n.current):Wi}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 _1(t)?t:e}const nB=[{sensor:wS,options:{}},{sensor:yf,options:{}}],oB={current:{}},nu={draggable:{measure:Cg},droppable:{measure:Cg,strategy:o1.WhileDragging,frequency:$h.Optimized},dragOverlay:{measure:d0}};class Tc 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 rB={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ku},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:nu,measureDroppableContainers:Ku,windowRect:null,measuringScheduled:!1},ES={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ku,draggableNodes:new Map,over:null,measureDroppableContainers:Ku},r1=u.createContext(ES),MS=u.createContext(rB);function iB(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tc}}}function aB(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 Tc(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 Tc(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 Tc(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function lB(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:r}=u.useContext(r1),i=Uu(o),a=Uu(n?.id);return u.useEffect(()=>{if(!t&&!o&&i&&a!=null){if(!z2(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=PF(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 B2=u.createContext({...Wi,scaleX:1,scaleY:1});var Ka;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ka||(Ka={}));const sB=u.memo(function(e){var t,n,o,r;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=nB,collisionDetection:p=HF,measuring:f,modifiers:h,...g}=e;const m=u.useReducer(aB,void 0,iB),[y,x]=m,[v,b]=function(){const[te]=u.useState(()=>new Set),ae=u.useCallback(pe=>(te.add(pe),()=>te.delete(pe)),[te]);return[u.useCallback(pe=>{let{type:me,event:fe}=pe;te.forEach(je=>{var Fe;return(Fe=je[me])==null?void 0:Fe.call(je,fe)})},[te]),ae]}(),[w,E]=u.useState(Ka.Uninitialized),C=w===Ka.Initialized,{draggable:{active:R,nodes:_,translate:L},droppable:{containers:T}}=y,j=R!=null?_.get(R):null,S=u.useRef({initial:null,translated:null}),k=u.useMemo(()=>{var te;return R!=null?{id:R,data:(te=j?.data)!=null?te:oB,rect:S}:null},[R,j]),P=u.useRef(null),[O,I]=u.useState(null),[z,A]=u.useState(null),D=kc(g,Object.values(g)),F=t1("DndDescribedBy",i),B=u.useMemo(()=>T.getEnabled(),[T]),M=u.useMemo(()=>({draggable:{...nu.draggable,...N?.draggable},droppable:{...nu.droppable,...N?.droppable},dragOverlay:{...nu.dragOverlay,...N?.dragOverlay}}),[(N=f)==null?void 0:N.draggable,N?.droppable,N?.dragOverlay]);var N;const{droppableRects:V,measureDroppableContainers:U,measuringScheduled:J}=function(te,ae){let{dragging:pe,dependencies:me,config:fe}=ae;const[je,Fe]=u.useState(null),{frequency:Ge,measure:et,strategy:tt}=fe,it=u.useRef(te),At=function(){switch(tt){case o1.Always:return!1;case o1.BeforeDragging:return pe;default:return!pe}}(),Lt=kc(At),_t=u.useCallback(function(Zt){Zt===void 0&&(Zt=[]),Lt.current||Fe(Tn=>Tn===null?Zt:Tn.concat(Zt.filter(pn=>!Tn.includes(pn))))},[Lt]),$t=u.useRef(null),nn=cc(Zt=>{if(At&&!pe)return Tg;if(!Zt||Zt===Tg||it.current!==te||je!=null){const Tn=new Map;for(let pn of te){if(!pn)continue;if(je&&je.length>0&&!je.includes(pn.id)&&pn.rect.current){Tn.set(pn.id,pn.rect.current);continue}const En=pn.node.current,kt=En?new Bh(et(En),En):null;pn.rect.current=kt,kt&&Tn.set(pn.id,kt)}return Tn}return Zt},[te,je,pe,At,et]);return u.useEffect(()=>{it.current=te},[te]),u.useEffect(()=>{At||_t()},[pe,At]),u.useEffect(()=>{je&&je.length>0&&Fe(null)},[JSON.stringify(je)]),u.useEffect(()=>{At||typeof Ge!="number"||$t.current!==null||($t.current=setTimeout(()=>{_t(),$t.current=null},Ge))},[Ge,At,_t,...me]),{droppableRects:nn,measureDroppableContainers:_t,measuringScheduled:je!=null}}(B,{dragging:C,dependencies:[L.x,L.y],config:M.droppable}),X=function(te,ae){const pe=ae!=null?te.get(ae):void 0,me=pe?pe.node.current:null;return cc(fe=>{var je;return ae==null?null:(je=me??fe)!=null?je:null},[me,ae])}(_,R),H=u.useMemo(()=>z?qu(z):null,[z]),ne=function(){const te=O?.autoScrollEnabled===!1,ae=typeof l=="object"?l.enabled===!1:l===!1,pe=C&&!te&&!ae;return typeof l=="object"?{...l,enabled:pe}:{enabled:pe}}(),oe=(ye=X,de=M.draggable.measure,Vh(ye,de));var ye,de;(function(te){let{activeNode:ae,measure:pe,initialRect:me,config:fe=!0}=te;const je=u.useRef(!1),{x:Fe,y:Ge}=typeof fe=="boolean"?{x:fe,y:fe}:fe;$i(()=>{if(!Fe&&!Ge||!ae)return void(je.current=!1);if(je.current||!me)return;const et=ae?.node.current;if(!et||et.isConnected===!1)return;const tt=Sg(pe(et),me);if(Fe||(tt.x=0),Ge||(tt.y=0),je.current=!0,Math.abs(tt.x)>0||Math.abs(tt.y)>0){const it=hS(et);it&&it.scrollBy({top:tt.y,left:tt.x})}},[ae,Fe,Ge,me,pe])})({activeNode:R!=null?_.get(R):null,config:ne.layoutShiftCompensation,initialRect:oe,measure:M.draggable.measure});const xe=_g(X,M.draggable.measure,oe),we=_g(X?X.parentElement:null),ve=u.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:V,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),re=T.getNodeFor((t=ve.current.over)==null?void 0:t.id),ce=function(te){let{measure:ae}=te;const[pe,me]=u.useState(null),fe=Zu({callback:u.useCallback(et=>{for(const{target:tt}of et)if(_1(tt)){me(it=>{const At=ae(tt);return it?{...it,width:At.width,height:At.height}:At});break}},[ae])}),je=u.useCallback(et=>{const tt=kS(et);fe?.disconnect(),tt&&fe?.observe(tt),me(tt?ae(tt):null)},[ae,fe]),[Fe,Ge]=tu(je);return u.useMemo(()=>({nodeRef:Fe,rect:pe,setRef:Ge}),[pe,Fe,Ge])}({measure:M.dragOverlay.measure}),Se=(n=ce.nodeRef.current)!=null?n:X,ie=C?(o=ce.rect)!=null?o:xe:null,Y=!(!ce.nodeRef.current||!ce.rect),le=Sg(ee=Y?null:xe,Vh(ee));var ee;const Pe=Ig(Se?Fr(Se):null),Te=function(te){const ae=u.useRef(te),pe=cc(me=>te?me&&me!==jg&&te&&ae.current&&te.parentNode===ae.current.parentNode?me:F2(te):jg,[te]);return u.useEffect(()=>{ae.current=te},[te]),pe}(C?re??X:null),rt=function(te,ae){ae===void 0&&(ae=d0);const[pe]=te,me=Ig(pe?Fr(pe):null),[fe,je]=u.useState(Pg);function Fe(){je(()=>te.length?te.map(et=>gS(et)?me:new Bh(ae(et),et)):Pg)}const Ge=Zu({callback:Fe});return $i(()=>{Ge?.disconnect(),Fe(),te.forEach(et=>Ge?.observe(et))},[te]),fe}(Te),Ve=TS(h,{transform:{x:L.x-le.x,y:L.y-le.y,scaleX:1,scaleY:1},activatorEvent:z,active:k,activeNodeRect:xe,containerNodeRect:we,draggingNodeRect:ie,over:ve.current.over,overlayNodeRect:ce.rect,scrollableAncestors:Te,scrollableAncestorRects:rt,windowRect:Pe}),Ee=H?Ss(H,L):null,Re=function(te){const[ae,pe]=u.useState(null),me=u.useRef(te),fe=u.useCallback(je=>{const Fe=r5(je.target);Fe&&pe(Ge=>Ge?(Ge.set(Fe,Fh(Fe)),new Map(Ge)):null)},[]);return u.useEffect(()=>{const je=me.current;if(te!==je){Fe(je);const Ge=te.map(et=>{const tt=r5(et);return tt?(tt.addEventListener("scroll",fe,{passive:!0}),[tt,Fh(tt)]):null}).filter(et=>et!=null);pe(Ge.length?new Map(Ge):null),me.current=te}return()=>{Fe(te),Fe(je)};function Fe(Ge){Ge.forEach(et=>{r5(et)?.removeEventListener("scroll",fe)})}},[fe,te]),u.useMemo(()=>te.length?ae?Array.from(ae.values()).reduce((je,Fe)=>Ss(je,Fe),Wi):xS(te):Wi,[te,ae])}(Te),Xe=Rg(Re),Be=Rg(Re,[xe]),ct=Ss(Ve,Xe),Qe=ie?WF(ie,Ve):null,he=k&&Qe?p({active:k,collisionRect:Qe,droppableRects:V,droppableContainers:B,pointerCoordinates:Ee}):null,Ye=uS(he,"id"),[ke,Ie]=u.useState(null),ue=function(te,ae,pe){return{...te,scaleX:ae&&pe?ae.width/pe.width:1,scaleY:ae&&pe?ae.height/pe.height:1}}(Y?Ve:Ss(Ve,Be),(r=ke?.rect)!=null?r:null,xe),De=u.useRef(null),Ae=u.useCallback((te,ae)=>{let{sensor:pe,options:me}=ae;if(P.current==null)return;const fe=_.get(P.current);if(!fe)return;const je=te.nativeEvent,Fe=new pe({active:P.current,activeNode:fe,event:je,options:me,context:ve,onAbort(et){if(!_.get(et))return;const{onDragAbort:tt}=D.current,it={id:et};tt?.(it),v({type:"onDragAbort",event:it})},onPending(et,tt,it,At){if(!_.get(et))return;const{onDragPending:Lt}=D.current,_t={id:et,constraint:tt,initialCoordinates:it,offset:At};Lt?.(_t),v({type:"onDragPending",event:_t})},onStart(et){const tt=P.current;if(tt==null)return;const it=_.get(tt);if(!it)return;const{onDragStart:At}=D.current,Lt={activatorEvent:je,active:{id:tt,data:it.data,rect:S}};yo.unstable_batchedUpdates(()=>{At?.(Lt),E(Ka.Initializing),x({type:or.DragStart,initialCoordinates:et,active:tt}),v({type:"onDragStart",event:Lt}),I(De.current),A(je)})},onMove(et){x({type:or.DragMove,coordinates:et})},onEnd:Ge(or.DragEnd),onCancel:Ge(or.DragCancel)});function Ge(et){return async function(){const{active:tt,collisions:it,over:At,scrollAdjustedTranslate:Lt}=ve.current;let _t=null;if(tt&&Lt){const{cancelDrop:$t}=D.current;_t={activatorEvent:je,active:tt,collisions:it,delta:Lt,over:At},et===or.DragEnd&&typeof $t=="function"&&await Promise.resolve($t(_t))&&(et=or.DragCancel)}P.current=null,yo.unstable_batchedUpdates(()=>{x({type:et}),E(Ka.Uninitialized),Ie(null),I(null),A(null),De.current=null;const $t=et===or.DragEnd?"onDragEnd":"onDragCancel";if(_t){const nn=D.current[$t];nn?.(_t),v({type:$t,event:_t})}})}}De.current=Fe},[_]),W=u.useCallback((te,ae)=>(pe,me)=>{const fe=pe.nativeEvent,je=_.get(me);if(P.current!==null||!je||fe.dndKit||fe.defaultPrevented)return;const Fe={active:je};te(pe,ae.options,Fe)===!0&&(fe.dndKit={capturedBy:ae.sensor},P.current=me,Ae(pe,ae))},[_,Ae]),Q=function(te,ae){return u.useMemo(()=>te.reduce((pe,me)=>{const{sensor:fe}=me;return[...pe,...fe.activators.map(je=>({eventName:je.eventName,handler:ae(je.handler,me)}))]},[]),[te,ae])}(d,W);(function(te){u.useEffect(()=>{if(!A2)return;const ae=te.map(pe=>{let{sensor:me}=pe;return me.setup==null?void 0:me.setup()});return()=>{for(const pe of ae)pe?.()}},te.map(ae=>{let{sensor:pe}=ae;return pe}))})(d),$i(()=>{xe&&w===Ka.Initializing&&E(Ka.Initialized)},[xe,w]),u.useEffect(()=>{const{onDragMove:te}=D.current,{active:ae,activatorEvent:pe,collisions:me,over:fe}=ve.current;if(!ae||!pe)return;const je={active:ae,activatorEvent:pe,collisions:me,delta:{x:ct.x,y:ct.y},over:fe};yo.unstable_batchedUpdates(()=>{te?.(je),v({type:"onDragMove",event:je})})},[ct.x,ct.y]),u.useEffect(()=>{const{active:te,activatorEvent:ae,collisions:pe,droppableContainers:me,scrollAdjustedTranslate:fe}=ve.current;if(!te||P.current==null||!ae||!fe)return;const{onDragOver:je}=D.current,Fe=me.get(Ye),Ge=Fe&&Fe.rect.current?{id:Fe.id,rect:Fe.rect.current,data:Fe.data,disabled:Fe.disabled}:null,et={active:te,activatorEvent:ae,collisions:pe,delta:{x:fe.x,y:fe.y},over:Ge};yo.unstable_batchedUpdates(()=>{Ie(Ge),je?.(et),v({type:"onDragOver",event:et})})},[Ye]),$i(()=>{ve.current={activatorEvent:z,active:k,activeNode:X,collisionRect:Qe,collisions:he,droppableRects:V,draggableNodes:_,draggingNode:Se,draggingNodeRect:ie,droppableContainers:T,over:ke,scrollableAncestors:Te,scrollAdjustedTranslate:ct},S.current={initial:ie,translated:Qe}},[k,X,he,Qe,_,Se,ie,V,T,ke,Te,ct]),function(te){let{acceleration:ae,activator:pe=Mc.Pointer,canScroll:me,draggingRect:fe,enabled:je,interval:Fe=5,order:Ge=Gu.TreeOrder,pointerCoordinates:et,scrollableAncestors:tt,scrollableAncestorRects:it,delta:At,threshold:Lt}=te;const _t=function(mn){let{delta:Ln,disabled:Nn}=mn;const hn=Uu(Ln);return cc(fo=>{if(Nn||!hn||!fo)return eB;const bo=Math.sign(Ln.x-hn.x),Fo=Math.sign(Ln.y-hn.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,Ln,hn])}({delta:At,disabled:!je}),[$t,nn]=function(){const mn=u.useRef(null);return[u.useCallback((Ln,Nn)=>{mn.current=setInterval(Ln,Nn)},[]),u.useCallback(()=>{mn.current!==null&&(clearInterval(mn.current),mn.current=null)},[])]}(),Zt=u.useRef({x:0,y:0}),Tn=u.useRef({x:0,y:0}),pn=u.useMemo(()=>{switch(pe){case Mc.Pointer:return et?{top:et.y,bottom:et.y,left:et.x,right:et.x}:null;case Mc.DraggableRect:return fe}},[pe,fe,et]),En=u.useRef(null),kt=u.useCallback(()=>{const mn=En.current;if(!mn)return;const Ln=Zt.current.x*Tn.current.x,Nn=Zt.current.y*Tn.current.y;mn.scrollBy(Ln,Nn)},[]),on=u.useMemo(()=>Ge===Gu.TreeOrder?[...tt].reverse():tt,[Ge,tt]);u.useEffect(()=>{if(je&&tt.length&&pn){for(const mn of on){if(me?.(mn)===!1)continue;const Ln=tt.indexOf(mn),Nn=it[Ln];if(!Nn)continue;const{direction:hn,speed:fo}=KF(mn,Nn,pn,ae,Lt);for(const bo of["x","y"])_t[bo][hn[bo]]||(fo[bo]=0,hn[bo]=0);if(fo.x>0||fo.y>0)return nn(),En.current=mn,$t(kt,Fe),Zt.current=fo,void(Tn.current=hn)}Zt.current={x:0,y:0},Tn.current={x:0,y:0},nn()}else nn()},[ae,kt,me,nn,je,Fe,JSON.stringify(pn),JSON.stringify(_t),$t,tt,on,it,JSON.stringify(Lt)])}({...ne,delta:L,draggingRect:Qe,pointerCoordinates:Ee,scrollableAncestors:Te,scrollableAncestorRects:rt});const K=u.useMemo(()=>({active:k,activeNode:X,activeNodeRect:xe,activatorEvent:z,collisions:he,containerNodeRect:we,dragOverlay:ce,draggableNodes:_,droppableContainers:T,droppableRects:V,over:ke,measureDroppableContainers:U,scrollableAncestors:Te,scrollableAncestorRects:rt,measuringConfiguration:M,measuringScheduled:J,windowRect:Pe}),[k,X,xe,z,he,we,ce,_,T,V,ke,U,Te,rt,M,J,Pe]),se=u.useMemo(()=>({activatorEvent:z,activators:Q,active:k,activeNodeRect:xe,ariaDescribedById:{draggable:F},dispatch:x,draggableNodes:_,over:ke,measureDroppableContainers:U}),[z,Q,k,xe,x,F,_,ke,U]);return u.createElement(sS.Provider,{value:b},u.createElement(r1.Provider,{value:se},u.createElement(MS.Provider,{value:K},u.createElement(B2.Provider,{value:ue},c)),u.createElement(lB,{disabled:a?.restoreFocus===!1})),u.createElement(FF,{...a,hiddenTextDescribedById:F}))}),cB=u.createContext(null),Og="button";function _S(){return u.useContext(MS)}const dB={timeout:25};function uB(e){let{animation:t,children:n}=e;const[o,r]=u.useState(null),[i,a]=u.useState(null),l=Uu(n);return n||o||!l||r(l),$i(()=>{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 pB={x:0,y:0,scaleX:1,scaleY:1};function hB(e){let{children:t}=e;return u.createElement(r1.Provider,{value:ES},u.createElement(B2.Provider,{value:pB},t))}const fB={position:"fixed",touchAction:"none"},mB=e=>z2(e)?"transform 250ms ease":void 0,gB=u.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:r,children:i,className:a,rect:l,style:c,transform:d,transition:p=mB}=e;if(!l)return null;const f=r?d:{...d,scaleX:1,scaleY:1},h={...fB,width:l.width,height:l.height,top:l.top,left:l.left,transform:Wl.Transform.toString(f),transformOrigin:r&&o?BF(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:Wl.Transform.toString(t)},{transform:Wl.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 yB=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:E,windowRect:C}=_S(),R=u.useContext(B2),_=(k=f?.id,u.useMemo(()=>{if(k!=null)return Dg++,Dg},[k])),L=TS(a,{activatorEvent:p,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:x.rect,over:v,overlayNodeRect:x.rect,scrollableAncestors:w,scrollableAncestorRects:E,transform:R,windowRect:C}),T=Vh(h),j=function(P){let{config:O,draggableNodes:I,droppableContainers:z,measuringConfiguration:A}=P;return L2((D,F)=>{if(O===null)return;const B=I.get(D);if(!B)return;const M=B.node.current;if(!M)return;const N=kS(F);if(!N)return;const{transform:V}=Fr(F).getComputedStyle(F),U=pS(V);if(!U)return;const J=typeof O=="function"?O:function(X){const{duration:H,easing:ne,sideEffects:oe,keyframes:ye}={...jS,...X};return de=>{let{active:xe,dragOverlay:we,transform:ve,...re}=de;if(!H)return;const ce=we.rect.left-xe.rect.left,Se=we.rect.top-xe.rect.top,ie={scaleX:ve.scaleX!==1?xe.rect.width*ve.scaleX/we.rect.width:1,scaleY:ve.scaleY!==1?xe.rect.height*ve.scaleY/we.rect.height:1},Y={x:ve.x-ce,y:ve.y-Se,...ie},le=ye({...re,active:xe,dragOverlay:we,transform:{initial:ve,final:Y}}),[ee]=le,Pe=le[le.length-1];if(JSON.stringify(ee)===JSON.stringify(Pe))return;const Te=oe?.({active:xe,dragOverlay:we,...re}),rt=we.node.animate(le,{duration:H,easing:ne,fill:"forwards"});return new Promise(Ve=>{rt.onfinish=()=>{Te?.(),Ve()}})}}(O);return bS(M,A.draggable.measure),J({active:{id:D,data:B.data,node:M,rect:A.draggable.measure(M)},draggableNodes:I,dragOverlay:{node:F,rect:A.dragOverlay.measure(N)},droppableContainers:z,measuringConfiguration:A,transform:U})})}({config:o,draggableNodes:m,droppableContainers:y,measuringConfiguration:b}),S=T?x.setRef:void 0;var k;return u.createElement(hB,null,u.createElement(uB,{animation:j},f&&_?u.createElement(gB,{key:_,id:f.id,ref:S,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 xB(e,t){return e.reduce((n,o,r)=>{const i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function kd(e){return e!==null&&e>=0}const Ed={scaleX:1,scaleY:1},bB=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,...Ed}:null}return a>r&&a<=i?{x:-l.width-c,y:0,...Ed}:a<r&&a>=i?{x:l.width+c,y:0,...Ed}:{x:0,y:0,...Ed}},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 vB(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=t1(RS,n),h=l.rect!==null,g=u.useMemo(()=>o.map(R=>typeof R=="object"&&"id"in R?R.id:R),[o]),m=a!=null,y=a?g.indexOf(a.id):-1,x=d?g.indexOf(d.id):-1,v=u.useRef(g),b=!function(R,_){if(R===_)return!0;if(R.length!==_.length)return!1;for(let L=0;L<R.length;L++)if(R[L]!==_[L])return!1;return!0}(g,v.current),w=x!==-1&&y===-1||b,E=function(R){return typeof R=="boolean"?{draggable:R,droppable:R}:R}(i);$i(()=>{b&&m&&p(g)},[b,g,m,p]),u.useEffect(()=>{v.current=g},[g]);const C=u.useMemo(()=>({activeIndex:y,containerId:f,disabled:E,disableTransforms:w,items:g,overIndex:x,useDragOverlay:h,sortedRects:xB(g,c),strategy:r}),[y,f,E.draggable,E.droppable,w,g,x,c,h,r]);return u.createElement(IS.Provider,{value:C},t)}const wB=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return bf(n,o,r).indexOf(t)},SB=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))},CB={duration:200,easing:"ease"},PS="transform",kB=Wl.Transition.toString({property:PS,duration:0,easing:"linear"}),EB={roleDescription:"sortable"};function Xu(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 MB=[$n.Down,$n.Right,$n.Up,$n.Left],TB=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(MB.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:E}=w,C=y.get(E);if(C){const R=vg(C),_=v.reduce((T,j,S)=>T+cS(R[S],j),0),L=Number((_/4).toFixed(4));b.push({id:E,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=F2(x).some((R,_)=>l[_]!==R),b=Ag(g,m),w=(d=m,!!(Xu(c=g)&&Xu(d)&&Ag(c,d))&&c.data.current.sortable.index<d.data.current.sortable.index),E=v||!b?{x:0,y:0}:{x:w?o.width-y.width:0,y:w?o.height-y.height:0},C={x:y.left,y:y.top};return E.x&&E.y?C:n1(C,E)}}}var c,d};function Ag(e,t){return!(!Xu(e)||!Xu(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}const _B=e=>{let{transform:t}=e;return{...t,y:0}},jB=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"}})]})})),zi={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",zi.Wrapper,r&&zi.fadeIn,f&&zi.sorting,t&&zi.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(zi.Item,n&&zi.dragging,i&&zi.withHandle,t&&zi.dragOverlay,o&&zi.disabled,e&&zi.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"},RB=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}))),IB={...jS},PB=u.memo(u.forwardRef((e,t)=>{const{className:n,activationConstraint:o,animateLayoutChanges:r,adjustScale:i=!1,collisionDetection:a=$F,coordinateGetter:l=TB,dropAnimation:c=IB,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:E=vf,style:C,useDragOverlay:R=!0,onDragStart:_,wrapperStyle:L=()=>({})}=e,[T,j]=u.useState(()=>h);u.useEffect(()=>{j(h)},[h]);const[S,k]=u.useState(null),P=function(){for(var D=arguments.length,F=new Array(D),B=0;B<D;B++)F[B]=arguments[B];return u.useMemo(()=>[...F].filter(M=>M!=null),[...F])}(o5(SS,{activationConstraint:o}),o5(CS,{activationConstraint:o}),o5(yf,{scrollBehavior:"Cypress"in window?"auto":void 0,coordinateGetter:l})),O=T.indexOf.bind(T),I=S?O(S):-1,z=[];T.map((D,F)=>{z.push(s.jsx(OB,{id:D,handle:f,index:F,style:d,wrapperStyle:L,disabled:m(D),renderItem:v,animateLayoutChanges:r,useDragOverlay:R,getNewIndex:p},D+"-"+F));const B=b?.({key:"divider-"+F});B&&z.push(B)});const{getPortalContainer:A}=(u.useEffect(()=>{function D(){const F=document.fullscreenElement;if(!F)return;let B=F.querySelector(".fullscreen-portal-root");B||(B=document.createElement("div"),B.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",F.appendChild(B))}return Q1++,D(),document.addEventListener("fullscreenchange",D),()=>{document.removeEventListener("fullscreenchange",D),Q1--,Q1<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(F=>{F.parentNode&&F.parentNode.removeChild(F)}),Q1=0)}},[]),{getPortalContainer:XR});return s.jsxs(sB,{sensors:P,collisionDetection:a,onDragStart:D=>{const{active:F}=D;F&&(_?.(D),k(F.id))},autoScroll:{canScroll:D=>!0},onDragEnd:D=>{if(k(null),D.over){const F=O(D.over.id);I!==F&&(j(B=>w(B,I,F)),g?.(I,F))}},onDragCancel:()=>{k(null)},measuring:y,modifiers:x,children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",boxSizing:"border-box",...C},className:Zr(n,zi.Wrapper),children:s.jsx(vB,{items:T,strategy:E,children:s.jsx(RB,{ref:t,children:z})})}),R?yo.createPortal(s.jsx(yB,{adjustScale:i,dropAnimation:c,children:S?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:S!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0}):null}),A()):null]})}));function OB({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:E=SB,attributes:C,disabled:R,data:_,getNewIndex:L=wB,id:T,strategy:j,resizeObserverConfig:S,transition:k=CB}=w;const{items:P,containerId:O,activeIndex:I,disabled:z,disableTransforms:A,sortedRects:D,overIndex:F,useDragOverlay:B,strategy:M}=u.useContext(IS),N=(he=z,typeof(Qe=R)=="boolean"?{draggable:Qe,droppable:!1}:{draggable:(Ye=Qe?.draggable)!=null?Ye:he.draggable,droppable:(ke=Qe?.droppable)!=null?ke:he.droppable}),V=P.indexOf(T),U=u.useMemo(()=>({sortable:{containerId:O,index:V,items:P},..._}),[O,_,V,P]),J=u.useMemo(()=>P.slice(P.indexOf(T)),[P,T]),{rect:X,node:H,isOver:ne,setNodeRef:oe}=function(Ie){let{data:ue,disabled:De=!1,id:Ae,resizeObserverConfig:W}=Ie;const Q=t1("Droppable"),{active:K,dispatch:se,over:te,measureDroppableContainers:ae}=u.useContext(r1),pe=u.useRef({disabled:De}),me=u.useRef(!1),fe=u.useRef(null),je=u.useRef(null),{disabled:Fe,updateMeasurementsFor:Ge,timeout:et}={...dB,...W},tt=kc(Ge??Ae),it=Zu({callback:u.useCallback(()=>{me.current?(je.current!=null&&clearTimeout(je.current),je.current=setTimeout(()=>{ae(Array.isArray(tt.current)?tt.current:[tt.current]),je.current=null},et)):me.current=!0},[et]),disabled:Fe||!K}),At=u.useCallback((nn,Zt)=>{it&&(Zt&&(it.unobserve(Zt),me.current=!1),nn&&it.observe(nn))},[it]),[Lt,_t]=tu(At),$t=kc(ue);return u.useEffect(()=>{it&&Lt.current&&(it.disconnect(),me.current=!1,it.observe(Lt.current))},[Lt,it]),u.useEffect(()=>(se({type:or.RegisterDroppable,element:{id:Ae,key:Q,disabled:De,node:Lt,rect:fe,data:$t}}),()=>se({type:or.UnregisterDroppable,key:Q,id:Ae})),[Ae]),u.useEffect(()=>{De!==pe.current.disabled&&(se({type:or.SetDroppableDisabled,id:Ae,key:Q,disabled:De}),pe.current.disabled=De)},[Ae,Q,De,se]),{active:K,rect:fe,isOver:te?.id===Ae,node:Lt,over:te,setNodeRef:_t}}({id:T,data:U,disabled:N.droppable,resizeObserverConfig:{updateMeasurementsFor:J,...S}}),{active:ye,activatorEvent:de,activeNodeRect:xe,attributes:we,setNodeRef:ve,listeners:re,isDragging:ce,over:Se,setActivatorNodeRef:ie,transform:Y}=function(Ie){let{id:ue,data:De,disabled:Ae=!1,attributes:W}=Ie;const Q=t1("Draggable"),{activators:K,activatorEvent:se,active:te,activeNodeRect:ae,ariaDescribedById:pe,draggableNodes:me,over:fe}=u.useContext(r1),{role:je=Og,roleDescription:Fe="draggable",tabIndex:Ge=0}=W??{},et=te?.id===ue,tt=u.useContext(et?B2:cB),[it,At]=tu(),[Lt,_t]=tu(),$t=(Zt=K,Tn=ue,u.useMemo(()=>Zt.reduce((pn,En)=>{let{eventName:kt,handler:on}=En;return pn[kt]=mn=>{on(mn,Tn)},pn},{}),[Zt,Tn])),nn=kc(De);var Zt,Tn;return $i(()=>(me.set(ue,{id:ue,key:Q,node:it,activatorNode:Lt,data:nn}),()=>{const pn=me.get(ue);pn&&pn.key===Q&&me.delete(ue)}),[me,ue]),{active:te,activatorEvent:se,activeNodeRect:ae,attributes:u.useMemo(()=>({role:je,tabIndex:Ge,"aria-disabled":Ae,"aria-pressed":!(!et||je!==Og)||void 0,"aria-roledescription":Fe,"aria-describedby":pe.draggable}),[Ae,je,Ge,et,Fe,pe.draggable]),isDragging:et,listeners:Ae?void 0:$t,node:it,over:fe,setNodeRef:At,setActivatorNodeRef:_t,transform:tt}}({id:T,data:U,attributes:{...EB,...C},disabled:N.draggable}),le=function(){for(var Ie=arguments.length,ue=new Array(Ie),De=0;De<Ie;De++)ue[De]=arguments[De];return u.useMemo(()=>Ae=>{ue.forEach(W=>W(Ae))},ue)}(oe,ve),ee=!!ye,Pe=ee&&!A&&kd(I)&&kd(F),Te=!B&&ce,rt=Pe?(Te&&Pe?Y:null)??(j??M)({rects:D,activeNodeRect:xe,activeIndex:I,overIndex:F,index:V}):null,Ve=kd(I)&&kd(F)?L({id:T,items:P,activeIndex:I,overIndex:F}):V,Ee=ye?.id,Re=u.useRef({activeId:Ee,items:P,newIndex:Ve,containerId:O}),Xe=P!==Re.current.items,Be=E({active:ye,containerId:O,isDragging:ce,isSorting:ee,id:T,index:V,items:P,newIndex:Re.current.newIndex,previousItems:Re.current.items,previousContainerId:Re.current.containerId,transition:k,wasDragging:Re.current.activeId!=null}),ct=function(Ie){let{disabled:ue,index:De,node:Ae,rect:W}=Ie;const[Q,K]=u.useState(null),se=u.useRef(De);return $i(()=>{if(!ue&&De!==se.current&&Ae.current){const te=W.current;if(te){const ae=d0(Ae.current,{ignoreTransform:!0}),pe={x:te.left-ae.left,y:te.top-ae.top,scaleX:te.width/ae.width,scaleY:te.height/ae.height};(pe.x||pe.y)&&K(pe)}}De!==se.current&&(se.current=De)},[ue,De,Ae,W]),u.useEffect(()=>{Q&&K(null)},[Q]),Q}({disabled:!Be,index:V,node:H,rect:X});var Qe,he,Ye,ke;return u.useEffect(()=>{ee&&Re.current.newIndex!==Ve&&(Re.current.newIndex=Ve),O!==Re.current.containerId&&(Re.current.containerId=O),P!==Re.current.items&&(Re.current.items=P)},[ee,Ve,O,P]),u.useEffect(()=>{if(Ee===Re.current.activeId)return;if(Ee!=null&&Re.current.activeId==null)return void(Re.current.activeId=Ee);const Ie=setTimeout(()=>{Re.current.activeId=Ee},50);return()=>clearTimeout(Ie)},[Ee]),{active:ye,activeIndex:I,attributes:we,data:U,rect:X,index:V,newIndex:Ve,items:P,isOver:ne,isSorting:ee,isDragging:ce,listeners:re,node:H,overIndex:F,over:Se,setNodeRef:le,setActivatorNodeRef:ie,setDroppableNodeRef:oe,setDraggableNodeRef:ve,transform:ct??rt,transition:ct||Xe&&Re.current.newIndex===V?kB:Te&&!z2(de)||!k||!ee&&!Be?void 0:Wl.Transition.toString({...k,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 DB=new $.Color("rgb(33, 115, 70)"),AB="#eee",LB=e=>s.jsx(jB,{...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=AR,createTabButton:g=LB,createTabDivider:m,editLabelProps:y,disabled:x=!1,disableDrag:v=!1,background:b="white",activeColor:w=DB,borderColor:E=AB,borderWidth:C=1}=e,[R,_]=u.useState(i),[L,T]=u.useState(a),j=u.useCallback(ie=>{const Y=A.current?.[ie]?.closest(".tab-item")??A.current?.[ie];Y&&U.current?.scrollTo({top:Y.offsetTop,left:Y.offsetLeft,behavior:"smooth"})},[]);u.useEffect(()=>{j(i)},[i]);const S=u.useCallback((ie,Y)=>{Y!==R&&(_(Y),l?.(Y)),j(Y)},[l,R]),k=u.useCallback((ie,Y)=>{d?.(ie,Y)},[d]),P=u.useRef(null),[O,I]=u.useState(-1),z=u.useCallback((ie,Y)=>{c?.(ie,Y)},[c]);u.useLayoutEffect(()=>{_(i)},[i]),u.useLayoutEffect(()=>{T(a)},[a]);const A=u.useRef([]),D=u.useRef(null);u.useImperativeHandle(t,()=>Object.assign({startEdit(ie){A.current?.[ie]?.startEdit()},cancel(ie){A.current?.[ie]?.cancel()}},D.current),[R,O]);const F=u.useCallback(({value:ie,index:Y,dragging:le})=>{const{style:ee,maxLength:Pe,...Te}=y||{},rt=s.jsx(IF,{ref:Ve=>{A.current[Y]=Ve},value:ie,disabled:x,maxLength:Pe,style:{color:R===Y&&w?w?.toRGBA().toString():"inherit",flex:"1 1 100%",paddingTop:"1px",paddingBottom:"1px",...ee},styleHover:{},onSubmit:Ve=>(P.current=!1,I(-1),z(Y,Ve)),onCancel:()=>{P.current=!1,I(-1)},onChange:Ve=>{P.current=!0,I(Y)},...Te});return g({onClick:Ve=>S(Ve,Y),value:ie,index:Y,editing:O===Y&&P.current,editable:!0,disabled:x,selectedIndex:R,background:b,activeColor:w,borderColor:E,borderWidth:C,dragging:le,children:rt})},[R,z,S,y,x,O,g]),[B,{width:M}]=Hl(),[N,{width:V}]=Hl(),U=u.useRef(null),[J,X]=u.useState({left:0,top:0,width:0,height:0}),[H,ne]=u.useState(null);u.useEffect(()=>{H!==null&&U.current&&U.current.scrollTo({left:H,behavior:"smooth"})},[H]);const oe=u.useCallback((ie,Y=!1)=>{if(!U.current)return 0;let le=U.current.firstChild.getBoundingClientRect(),ee=U.current.firstChild.firstChild.children,Pe=0;return Pe=Y?0:b4.getScrollTo(ie,le.left,ee,!0,Math.max(0,ie-200)),ne(Pe),Math.max(0,Pe)},[]),ye=u.useCallback((ie,Y=!1)=>{if(!U.current)return 0;let le=U.current.firstChild.getBoundingClientRect(),ee=U.current.firstChild.firstChild.children,Pe=0;const Te=Math.ceil(V-M);return Pe=Y?Te:b4.getScrollTo(ie,le.left,ee,!1,Math.max(0,ie+200)),ne(Pe),Math.min(Te,Pe)},[V,M]),de=u.useRef(null),xe=u.useRef(null),we=u.useCallback(()=>{xe.current&&(clearTimeout(xe.current),xe.current=null,de.current=null)},[]),ve=u.useCallback((ie,Y,le=260)=>{de.current=ie,xe.current=setTimeout(()=>{const ee=Y?oe(de.current||ie):ye(de.current||ie);ee!==de.current?ve(ee,Y,120):we()},le)},[oe,ye,we]);u.useEffect(()=>()=>we(),[we]);const re=u.useMemo(()=>({style:{marginLeft:"4px",marginRight:"6px"},disabled:Math.floor(J.left)<=0||Math.floor(V-M)===0,orientation:yr.Horizontal,onMouseUp:we,onMouseLeave:we,onMouseDown:()=>ve(U.current.scrollLeft,!0),onClick:ie=>oe(Math.min(U.current.scrollLeft,H??Number.MAX_SAFE_INTEGER),ie.ctrlKey)}),[J,H,V,M]),ce=u.useMemo(()=>({style:{marginLeft:"6px",marginRight:"4px"},disabled:Math.floor(V-M)<=Math.ceil(J.left),orientation:yr.Horizontal,onMouseUp:we,onMouseLeave:we,onMouseDown:()=>ve(U.current.scrollLeft,!1),onClick:ie=>ye(Math.max(U.current.scrollLeft,H??0),ie.ctrlKey)}),[J,H,V,M]),Se=u.useMemo(()=>s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{minWidth:"16px"}}),n,h?.(re)]}),[re,ce,p,f,n,h]);return s.jsxs("div",{style:{...o,display:"flex",alignItems:"stretch"},className:Zr("_TabStrip_3x0dp_1",r),ref:D,children:[s.jsx("div",{style:{borderTop:`solid ${E} ${C}px`,position:"absolute",width:"100%"}}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:Se}),s.jsx("div",{className:"Tabs",ref:B,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:ie=>{X({left:ie.target.scrollLeft,top:ie.target.scrollTop,width:ie.target.scrollWidth,height:ie.target.scrollHeight})},children:s.jsx(PB,{isDisabled:ie=>x||v,items:L,strategy:bB,modifiers:[_B],ref:N,renderItem:F,renderDivider:m,onMove:k,activationConstraint:{distance:15}})})}),s.jsx("div",{style:{flex:"none",display:"flex",alignItems:"center"},children:h(ce)})]})}));DS.displayName="TabStrip";const zB=u.createContext(null),wf=()=>{const e=u.useContext(zB),[t]=u.useState(()=>new $.ThemeCollection);return u.useMemo(()=>e||t,[e])},FB=u.lazy(()=>Promise.resolve().then(()=>require("./CzvztZ4uxzxXxoJz.cjs"))),BB={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||$B(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 NB(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 Hh(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:NB(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)Hh(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 $B(e){return e.kind==="comment"}const VB=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=_e(a,[a]),m=u.useRef(!1),y=u.useMemo(()=>({contains(D){if(!h.current)return;const F=h.current.editor;return F&&F.getDomNode()?.contains(D)},focus(){if(!h.current)return;const D=h.current.editor;return D&&D.getDomNode()?.focus()}}),[]),x=u.useMemo(()=>[new He("help",y,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=u.useMemo(()=>{let D=null;const F=()=>y;return D=r?r.createChildGroup(F,"scriptEditor",!1):new r0(F,"scriptEditor"),D.addCommands(x,!0),D},[r,x]),b=_o(v,["executeSelectedScript"])[0],w=b?.context(),E=_e(D=>{b?.execute(D)},[b]),C=u.useRef(""),[R,_]=u.useState(!1),L=_e(async()=>{if(!h.current)return null;const D=h.current,F=D.editor;if(!F)return null;const B=D.monaco,M=await(async(N,V,U="export")=>{const J=N.getModel();if(!J)return null;const X=await V.languages.typescript.getTypeScriptWorker(),H=await X(J.uri),ne=await H.getNavigationTree(J.uri.toString());let oe=null,ye=N.getSelection();const de=ye.startLineNumber===ye.endLineNumber&&ye.startColumn===ye.endColumn?J.getLineCount():Math.min(ye.endLineNumber,J.getLineCount());for(let xe=ye.startLineNumber;!oe&&xe<=de;xe++){const we=Sf(ne,J.getOffsetAt({lineNumber:xe,column:1}),"function",U);we&&(oe=we.text)}return oe})(F,B);return p?.({message:(M??"").toUpperCase()}),M?{source:F.getValue(),name:M}:null},[p]),T=_e(async(D,F,B)=>{const M=await w.getScripts().createModule({source:B?.getValue(),declarationsOnly:!0}),N=M?M.getFunctions().search():Xt.EmptyArray;M&&(async function(V,U){const J=[];for(let X=1;X<V.getLineCount()+1;X++){const H={startLineNumber:X,startColumn:1,endLineNumber:X,endColumn:V.getLineLength(X)+1},ne=V.getValueInRange(H).indexOf("modelt");ne!==-1&&J.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:H.startLineNumber,startColumn:ne+1,endLineNumber:H.startLineNumber,endColumn:ne+5})}U.editor.setModelMarkers(V,"owner",J)}(D,F),async function(V,U,J,X){const H=await U.languages.typescript.getTypeScriptWorker(),ne=await H(V.uri),oe=await ne.getNavigationTree(V.uri.toString()),ye=Hh(V,U,X,oe).map(de=>{let xe=null,we=null;return de.type==="formula"?(xe="formula.margin-icon",we="Formula"):de.type==="macro"?(xe="macro.margin-icon",we="Macro"):de.type==="autoRun"&&(xe="autorun.margin-icon",we="Auto Run"),{range:new U.Range(de.lineNumber,1,de.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:we,stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=J.createDecorationsCollection(ye)}(D,F,B,N))},[w]),j=_e(Xt.debounce(T,580),[]),S=_e(async(D=void 0)=>{if(!h.current||!w)return;const F=h.current.editor.getPosition(),B={cursor:F?F.toString():""};D!==void 0&&(B.message=D),p?.(B);const M=L();w.setSelectedFunction(M)},[w,p]);u.useEffect(()=>{if(!w)return;const D={insertSnippet:B=>{h.current?.editor&&(R?zg(h.current.editor,h.current.monaco,B):C.current=B)}};w.setEditor(D),w.setSelectedFunction(L());const F=w.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!w)return;const B=h.current.editor,M=w?.getScripts().getModules().getByName("scripting"),N=M?.getSource(),V=B.getValue();if((N?.length??0)===V.length&&N===V)return;await w.saveSource(B.getValue());const U=(N?.length??0)!==V.length||N!==V;p?.({dirty:U})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!w)return;const B=h.current.editor,M=w.getScripts().getModules().search()[0]?.getSource()??"";B.setValue(M)}});return()=>{F(),w.setSelectedFunction(null),w.setEditor(null)}},[w,R]),u.useEffect(()=>()=>{if(!h.current?.editor)return;const D=h.current.editor;w?.saveSource(D.getValue())},[]);const k=_e(D=>{const F=h.current;if(!F)return!1;const B=F.editor;return!!B&&(B.focus(),!0)},[]),P=u.useRef(null),O=_e((D,F)=>{h.current={monaco:F,editor:D},_(!0),S("Loading Types");const B=w.getScripts().getModules().search()[0]?.getSource()??"";D.setValue(B),Promise.resolve().then(()=>require("./Ditw9NZuBwrMozqm.cjs")).then(V=>V.c).then(V=>{S(""),V.AutoTypings.create(D,{shareCache:!0,monaco:F,onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(async U=>{const J=D.getModel();j(J,F,D)})}),D.addCommand("executeScript",function(V,...U){U?.[0]&&E({functionName:U?.[0]})},""),D.addAction({id:"executeScript",label:"Execute",keybindings:[F.KeyCode.F8],run:async V=>{const U=L();w.setSelectedFunction(U);const J=await U;E(J)}}),D.addAction({id:"saveScript",label:"Save Script",keybindings:[F.KeyMod.CtrlCmd|F.KeyCode.KeyS],run:V=>{w?.saveSource(D.getValue()).then(()=>{const U=w?.getScripts().getModules().getByName("scripting"),J=U?.getSource(),X=D.getValue(),H=(J?.length??0)!==X.length||J!==X;p?.({dirty:H})})}}),D.onMouseDown(async V=>{if(V.target.type===F.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=V.target.position.lineNumber,J=await F.languages.typescript.getTypeScriptWorker(),X=await J(M.uri),H=await X.getNavigationTree(M.uri.toString()),ne=D?.getValue(),oe=(await w?.saveSource(ne)).getFunctions().search(),ye=Hh(M,F,oe,H).find(de=>de.lineNumber===U);if(ye){const de=V.event.browserEvent.button;de===0?ye.type==="macro"||ye.type==="autoRun"?E({functionName:ye.name}):ye.type==="formula"&&w.quickInsertFunction?.(ye.name):de===2&&(console.log("Context menu for function:",ye.name),V.event.browserEvent.preventDefault())}}}),D.onDidChangeModelContent(()=>{const V=D.getModel();j(V,F,D)});const M=D.getModel();var N;(N=F).languages.registerInlayHintsProvider("typescript",{provideInlayHints(V,U,J){const X=[];for(let H=1;H<V.getLineCount()+1;H++){const ne={startLineNumber:H,startColumn:1,endLineNumber:H,endColumn:V.getLineLength(H)+1},oe="hint",ye=V.getValueInRange(ne).indexOf("hint");ye!==-1&&X.push({kind:N.languages.InlayHintKind.Type,position:{lineNumber:ne.startLineNumber,column:ye+oe.length+1},label:"[hint]"})}return{hints:X,dispose:()=>{}}}}),M.onDidChangeContent(V=>{const U=w?.getScripts().getModules().getByName("scripting"),J=U?.getSource(),X=D.getValue(),H=(J?.length??0)!==X.length||J!==X;p?.({dirty:H})}),D.onDidChangeCursorPosition(V=>{S()})},[w,p]),I=u.useMemo(()=>R?null:c||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[R,c]),z=u.useMemo(()=>{const D=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(FB,{theme:l?"extended-dark":"extended",options:{...BB,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:D,onValidate:F=>{let B=!1;for(let M=0;!B&&M<F?.length;M++)F[M].severity===8&&(B=!0)},beforeMount:F=>{F.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),F.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),F.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),F.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let B=!1;try{const N=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),V=F.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),U=F.editor.createModel(N,"typescript",V);F.editor.setModelMarkers(U,"default",[]),B=!0}catch(N){console.warn("cant load types",N)}F.languages.registerLinkProvider("*",{provideLinks:(N,V)=>{const U=[],J={links:U},X=N.getLinesContent();for(let H=1;H<=X.length;H++){const ne=X[H-1],oe=F.editor.tokenize(ne,"typescript");for(let ye=0;ye<oe[0].length;ye++){const de=oe[0]?.[ye];if(de&&de.type.startsWith("string")){let xe=de.offset,we=oe[0]?.[ye+1]?.offset??ne.length,ve=new F.Range(H,xe+1,H,we+1),re=N.getValueInRange(ve);const ce=re[0];ce!=="`"&&ce!=="'"&&ce!=='"'||(xe++,re=re.substring(1));const Se=re[re.length-1];Se!=="`"&&Se!=="'"&&Se!=='"'||(xe++,re=re.substring(0,re.length-1));try{w.getRanges(re)&&U.push({range:{endColumn:we,endLineNumber:H,startColumn:xe,startLineNumber:H},tooltip:`Goto range '${re}'`,url:`/range/${re}`})}catch(ie){console.warn(ie)}}}}return J}}),F.editor.registerLinkOpener({open(N){if(N?.path?.startsWith("/range/")){try{w.getRanges(N.path.substring(7))?.select()}catch(V){console.warn("invalid range",V)}return!0}return!1}});const M=F.languages.typescript.typescriptDefaults.getCompilerOptions();F.languages.typescript.typescriptDefaults.setCompilerOptions({...M,target:F.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:F.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),C.current&&(await zg(h.current.editor,h.current.monaco,C.current),C.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&F.editor.focus()}),F.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),_(!0)})()},onMount:O})}),I]})},[w,v,i,I,l]),A=ir(t,()=>({isScriptEditorElement:()=>!0,focus:D=>{k(D)},close:()=>{g?.()},getEditor:()=>w?.getEditor()}),[w]);return u.useEffect(()=>(d&&requestAnimationFrame(()=>{k()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{A.current?.contains(document.activeElement)&&k()})}),[]),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"},Is={Start:"start",End:"end"},l5={},HB=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(l5[r])return l5[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 l5[r]=i,i},WB={},LS=u.memo(e=>{const{className:t,style:n=_n.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:l,renderers:c=WB,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(${HB(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})}),UB=u.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:l,onFocus:c,style:d=_n.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(R=>{r?.(R),R.isDefaultPrevented()||(R.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=u.useCallback(R=>{a?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=u.useCallback(R=>{l?.(R),R.isDefaultPrevented()},[o,l]),w=u.useCallback(R=>{c?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),E=u.useCallback(R=>{i?.(R),R.isDefaultPrevented()||R.keyCode===tn.Enter&&n?.(t.toRGBA())},[n,i,t]),C=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:E,onMouseOver:v,onMouseLeave:b,onFocus:w,children:[C,s.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),N2=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},C=>t(C)),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]),E=u.useCallback(C=>{a?.(C?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(UB,{selectedColor:g,title:null,onSelectColor:w,onPreviewColor:E,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"}})]})})})}),Md=u.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:l,style:c=_n.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 E=[],C=g[w];for(let _=0;_<C.length;_++){let L=C[_];E.push(s.jsx(N2,{schemeColorLookup:n,colorDef:L,selectedColor:r,previewColor:i,onSelectColorDef:m,onPreviewColorDef:y,swatchProps:f,compareRGB:d,darkMode:p},w+" "+_))}let R=s.jsx(Le,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:_=>_.shadows[2],borderRadius:"2px",overflow:"hidden"},children:E},""+w);b.push(R)}return b},[g,r,i,m,y]),v=u.useMemo(()=>t?s.jsx(Mn,{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(Le,{style:{...c},children:[v,s.jsx(Le,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:x})]})}),Fi=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),Ho=(e,t,n,o,r,i)=>{const a=Fi(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)},qB=u.lazy(()=>Promise.resolve().then(()=>require("./H07xNhSJd2mcr1hH.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:E=Is.Start,compareRGB:C=!1,darkMode:R=!1,..._}=e,L=o||n,T=_e(y,[y]),j=_e(x,[x]),S=_e(v,[v]),k=_e(g,[g]),P=_e(m,[m]),[O,I]=u.useState(!1),z=qi(),A=u.useMemo(()=>i||$.Color.getDefaultSchemeLookup(),[i]),D=u.useMemo(()=>{const re=new Map,ce=new Map,Se=[];Ho("Primary Background","bg1",A,Se,re,ce),Ho("Primary Text","tx1",A,Se,re,ce),Ho("Secondary Background","bg2",A,Se,re,ce),Ho("Secondary Text","tx2",A,Se,re,ce),Ho("Accent 1","accent1",A,Se,re,ce),Ho("Accent 2","accent2",A,Se,re,ce),Ho("Accent 3","accent3",A,Se,re,ce),Ho("Accent 4","accent4",A,Se,re,ce),Ho("Accent 5","accent5",A,Se,re,ce),Ho("Accent 6","accent6",A,Se,re,ce);const ie=$.ITheme.buildPalette(Se,A,re,ce),Y=[];if(Ho("Dark Red","C00000",A,Y,re,ce),Ho("Red","FF0000",A,Y,re,ce),Ho("Orange","FFC000",A,Y,re,ce),Ho("Yellow","FFFF00",A,Y,re,ce),Ho("Light Green","92D050",A,Y,re,ce),Ho("Green","00B050",A,Y,re,ce),Ho("Light Blue","00B0F0",A,Y,re,ce),Ho("Blue","0070C0",A,Y,re,ce),Ho("Dark Blue","002060",A,Y,re,ce),a?Ho("Purple Is A Fruit","7030A0",A,Y,re,ce):Ho("Transparent","00000000",A,Y,re,ce),b){const Te=b.toString();re.set(Te,b)}const le=new Map,ee=typeof r=="function"?r():r,Pe=[];for(let Te=0;ee&&Te<ee.length;Te++){const rt=ee[Te].toString();le.set(rt,ee[Te]),Pe.push({description:"Recent "+(Te+1),definition:{val:ee[Te].toString()}})}return{primaryColors:Se,modifiedPresets:ie,standardColors:Y,recentColorsLimited:Pe,mapAllPresets:re,mapAllPresetsRGB:ce,mapRecent:le}},[A,r,a,b]);u.useEffect(()=>{f?.()},[]);const[F,B]=u.useState(!1),M=u.useCallback(()=>{B(re=>!re)},[]);u.useEffect(()=>{if(c)B(c===AS.Custom);else if(n){let re=n.toString(),ce=D.mapAllPresets.get(re);ce||(re=n.toRGBA().toString(),ce=D.mapAllPresetsRGB.get(re));const Se=D.mapRecent.get(re);B(!ce&&!Se)}},[n,c]);const N=u.useCallback($.CommonUtils.debounce(re=>{T?.(re)},l),[T,l]),[V,U]=u.useState();u.useEffect(()=>{U(o||n)},[o,n]);const J=_e(re=>{j&&(j(re),N(re))},[j]),X=_e(re=>{J(re?new $.Color({val:re.definition.val,adjs:re.definition.adjs},A):null)},[A]),H=u.useCallback(re=>{re.ctrlKey&&B(!0)},[]),ne=_e(re=>{let ce=!1;if(re){const Se=re.toString();ce=!D.mapAllPresets.has(Se)}S?.(re,ce)},[S,D]),oe=_e(re=>{const ce=re?new $.Color({val:re.definition.val,adjs:re.definition.adjs},A):null;Promise.resolve(h?.()).then(()=>{ne(ce)})},[A,h]),ye=_e(re=>{J(re?new $.Color(re,A):null)},[A]),de=u.useMemo(()=>window.EyeDropper===void 0?s.jsx(s.Fragment,{}):s.jsx(Tr,{"aria-label":"eye dropper",size:"small",sx:{color:re=>re.palette.text.icon??re.palette.action.active},onClick:async()=>{I(!0),k?.(),await new EyeDropper().open().then(re=>{I(!1),P?.();let ce=new $.Color(re.sRGBHex),Se=ce.toString(),ie=D.mapAllPresets.get(Se);if(ie||(Se=ce.toRGBA().toString(),ie=D.mapAllPresetsRGB.get(Se)),!ie){const Y=ce.toRGBA(),le=3;let ee=255;D.mapAllPresetsRGB.forEach((Pe,Te)=>{const rt=Pe.toRGBA(),Ve=Math.abs(rt.red-Y.red)+Math.abs(rt.blue-Y.blue)+Math.abs(rt.green-Y.green);Ve<le&&Ve<ee&&(ie=Pe)})}B(!ie),J(ie||ce)}).catch(re=>{I(!1),re?.name!=="AbortError"&&console.error(re)})},children:s.jsx(rR,{})}),[D,R]),xe=u.useMemo(()=>{if(!F)return;const re={opacity:F?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:re,children:s.jsx(i0,{})}),children:s.jsx(qB,{style:re,selectedColor:L?L.toRGBA().toString():"transparent",onColorChange:ye,disableAlpha:a})})},[F,L]),we=u.useMemo(()=>({onClick:H,alphaGrey:z.palette.text.icon??z.palette.action.active}),[H,z]),ve=u.useMemo(()=>{if(!b)return null;const re={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return s.jsx(s.Fragment,{children:s.jsxs(b1,{sx:{display:"flex",color:ce=>ce.palette.text.secondary},onMouseOver:()=>{X(null)},onClick:()=>{oe(null)},children:[s.jsx(Le,{sx:{flex:"none",boxShadow:ce=>ce.shadows[2],borderRadius:ce=>ce.spacing(.5),overflow:"hidden"},children:s.jsx(N2,{schemeColorLookup:A,colorDef:re,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:d,isLarge:!0,darkMode:R,compareRGB:C,swatchProps:we})}),s.jsx(Mn,{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(Le,{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:F?"0":1},children:[ve&&E===Is.Start?s.jsxs(s.Fragment,{children:[ve,s.jsx(va,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,s.jsx(Md,{title:"Theme Colors",schemeColorLookup:A,colorDefs:D.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsx(Md,{schemeColorLookup:A,colorDefs:D.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsx(va,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Md,{title:"Standard Colors",schemeColorLookup:A,colorDefs:D.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsxs("div",{style:{opacity:D.recentColorsLimited.length===0?"0":void 0,display:D.recentColorsLimited.length===0?"none":void 0},children:[s.jsx(va,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Md,{title:"Recent Colors",schemeColorLookup:A,colorDefs:D.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R})]}),ve&&E===Is.End?s.jsxs(s.Fragment,{children:[s.jsx(va,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ve,s.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),xe]}),s.jsx(va,{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:[de,s.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),s.jsx(Lc,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{M()},children:s.jsx("div",F?{children:"Preset"}:{children:"Custom"})}),s.jsx(Lc,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{ne(V)})},children:"Done"})]})]})})),KB=s.jsx(e=>{const{sx:t,...n}=e;return s.jsxs(Je,{sx:{overflow:"visible","& .activeColor":{filter:S1},...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=KB,tooltip:i,label:a,onPreviewColor:l,onPreviewColorImmediate:c,onSelectColor:d,variant:p=ji.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:m=!1,...y}=e,x=_e(l,[l]),v=_e(c,[c]),b=_e(d,[d]),[w,E]=u.useState(()=>{}),C=o||w||n||f?.autoColor,R=r,_=u.useRef(!1),L=u.useCallback(()=>{},[]),T=_e(()=>{E(n)},[n]),j=_e(F=>{_.current||(E(F),x?.(F))},[x]),S=_e(F=>{_.current||(E(F),v?.(F))},[v]),k=_e((F,B)=>{_.current||(E(void 0),b?.(F,B))},[b]),P=u.useMemo(()=>s.jsx(Le,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${C?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${C?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:F=>F.palette.text.icon??F.palette.action.active}},children:R}),[C,R,m]),O=_e(F=>{b?.(o,!1)},[b,o]),[I,z]=u.useState(!1),A=u.useCallback(F=>{const{closeFloat:B,closeFloatAll:M}=F;return s.jsx(zS,{...f,selectedColor:n,previewColor:w,onDone:h?M:B,onKeyDown:N=>{N.which===tn.Enter&&(h?M():B())},onPreviewColorImmediate:S,onPreviewColor:j,onSelectColor:k,onEyeDropStart:()=>z(!0),onEyeDropStop:()=>z(!1),compareRGB:g,darkMode:m})},[n,w,h,C,f?.autoColor,m]),D={onQuickClick:o?O:void 0,createPopupPanel:A,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:T,onPopupClose:L,tooltip:i||a||"Color",label:a,icon:P,...y};return p===ji.Toolbar?s.jsx(Ui,{ref:t,...D}):s.jsx(C1,{ref:t,...D})})),ou=82,Wh=e=>{const{styleColor:t,length:n=ou,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:l=!1,darkMode:c=!1,...d}=e;return s.jsx(Je,{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=_e(c,[]),m=u.useCallback(b=>{const{popupContainer:w,floatReference:E,closeFloat:C,...R}=b,_=[],L=$.IBorder.BuiltInDefinitionsArray;for(let T=0;T<L.length;T++){const j=L[T];if(j.description==="None"&&!d)continue;const S=s.jsx(Wh,{styleColor:a,length:ou,width:j.width,darkMode:p,dashArray:j.pattern,isDouble:j.description.toLowerCase().includes("double"),isAngled:j.description.toLowerCase().includes("slant")});let k=null;k=o?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{marginRight:"6px"},children:j.description}),s.jsxs(Le,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[s.jsx("div",{style:{flex:"1 1 100%"}}),S]})]}):j.description==="None"?"None":S,_.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?"":j.description},icon:null,disabled:r,onMouseDown:P=>P.preventDefault(),onMouseUp:()=>{C(),g(j.style)},onKeyDown:P=>{P.which===tn.Enter&&C()},selected:j.style===l,parentFloat:E,children:k},T))}return s.jsx(Le,{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(Le,{sx:{minWidth:`${ou}px`},children:"None"}):s.jsx(Wh,{styleColor:a,length:ou,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),s.jsx(Le,{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===ji.Toolbar?s.jsx(Ui,{...v}):s.jsx(C1,{...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=_e(c,[c]),m=_e(d,[d]),[y,x]=u.useState(),[v,b]=u.useState(),w=y??r,E=v??n,C=p||{bottom:{style:r,color:n?.toString()}},R=_e(k=>{const P={},O=k?Object.keys(k):[];let I=!1;for(let V=0;V<O.length;V++)k[O[V]]?.style&&(P[O[V]]={style:k[O[V]].style,color:k[O[V]].color},I||P[O[V]].style===$.IBorder.StrokeStyle.None||(I=!0));O.length<6&&(I=!0);const z=I?P.left:null,A=I?P.top:null,D=I?P.right:null,F=I?P.bottom:null,B=I?P.vertical:null,M=I?P.horizontal:null;let N="";return A||z||(N+="M 3,5 H 5 V 3 H 3 "),A||(N+="M 7,5 H 9 V 3 H 7 "),A||B||(N+="M 11,5 h 2 V 3 h -2 "),A||(N+="M 15,5 h 2 V 3 h -2 "),A||D||(N+="M 19,5 h 2 V 3 h -2 "),z||(N+="M 3,9 H 5 V 7 H 3 "),B||(N+="M 11,9 h 2 V 7 h -2 "),D||(N+="M 19,9 h 2 V 7 h -2 "),M||z||(N+="M 3,13 H 5 V 11 H 3 "),M||(N+="M 7,13 H 9 V 11 H 7 "),M||B||(N+="M 11,13 h 2 v -2 h -2 "),M||D||(N+="M 19,13 h 2 v -2 h -2 "),M||(N+="M 15,13 h 2 v -2 h -2 "),z||(N+="M 3,17 H 5 V 15 H 3 "),B||(N+="M 11,17 h 2 v -2 h -2 "),D||(N+="M 19,17 h 2 v -2 h -2 "),F||z||(N+="M 3,21 H 5 V 19 H 3 "),F||(N+="M 7,21 H 9 V 19 H 7 "),F||B||(N+="M 11,21 h 2 v -2 h -2 "),F||(N+="M 15,21 h 2 v -2 h -2 "),F||D||(N+="M 19,21 h 2 v -2 h -2 "),s.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[s.jsx(Je,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:s.jsx("path",{d:N})}),s.jsx(Le,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:S1}},children:s.jsx(ff,{getBorderAt:(V,U)=>{if(!f||O.length===0)return null;const J=V.rowIndex,X=V.colIndex,H={};return J===0?(H.top=P.top,H.bottom=P.horizontal):(H.top=P.horizontal,H.bottom=P.bottom),X===0?(H.left=P.left,H.right=P.vertical):(H.left=P.vertical,H.right=P.right),f?.(H)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[E,w,a]),_=u.useCallback((k,P,O)=>{let I=null;if(k&&k.length>0){let z=null;(P||O)&&(z={style:O,color:P?.toString()??null}),I={};for(let A=0;A<k.length;A++)I[k[A]]=z}return I},[]),L=u.useCallback(k=>{g?.(k)},[]),T=u.useCallback(k=>{m?.(k)},[]),j=u.useCallback(k=>{const{closeFloatAll:P,floatReference:O}=k,I=(D,F,B="bottom",M=!1)=>{const N=_(D,E??null,M?$.IBorder.StrokeStyle.None:w??null),V=M?_([],E??null,w??null):N;return s.jsx(ii,{icon:R(V),sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{label:F,simple:!0,placement:B},onClick:()=>{P(),T(N),L(N)}})},z=s.jsxs(s.Fragment,{children:[s.jsxs(Le,{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(Le,{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(Le,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[s.jsx(Cf,{variant:ji.Toolbar,icon:s.jsx(N3,{}),selectedColor:w===$.IBorder.StrokeStyle.None?new $.Color("transparent"):E,onPreviewColor:D=>{b(D)},onSelectColor:(D,F)=>{b(D)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||w===$.IBorder.StrokeStyle.None,parentFloat:O,shouldCloseFloatAll:!1}),s.jsx(FS,{selectedStyle:w,onSelectStyle:x,styleColor:E,darkMode:a,variant:ji.Toolbar,parentFloat:O})]})});return s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:D=>D.stopPropagation(),children:[l?A:z,s.jsx(Ft,{orientation:"horizontal"}),l?z:A]})},[w,E,n,o,a]),S=u.useMemo(()=>R(C),[C,a]);return s.jsx(Ui,{ref:t,createPopupPanel:j,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:k},P)=>s.jsx(br,{label:"Borders",description:"Set the borders.",disabled:P,children:k}),onQuickClick:()=>{g?.(C)},quickButtonProps:{sx:{}},disabled:i,icon:S,...h})})),NS=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Yt.Toolbar,disabled:a=!1,autoColor:l,autoStrokeStyle:c,schemeLookup:d,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:g,...m}=e,y=_o(n,["formatBorder"]),x=o??y[0],v=x?.context()??null,b=v?.autoColor??l,w=v?.autoStyle??c,E=f??v?.quickBorder,C=g??v?.darkMode,R=p??v?.createTemporaryBorder,_=d??v?.schemeLookup,L=_e(j=>{v?.onBorderSelect&&v.onBorderSelect(j),h?.(j),x?.execute(j,r)},[x,h,r]),T=u.useCallback((j,S)=>{const{children:k,title:P,...O}=j;let I=j.children;return(x?.disabled()||a)&&(I=s.jsx("div",{children:I})),s.jsx(a0,{command:x,placement:i===Yt.Toolbar?"bottom-start":"right-start",disabled:S,...O,children:I})},[x,a]);return s.jsx(BS,{ref:t,autoColor:b,darkMode:C,autoStrokeStyle:w,createTemporaryBorder:R,schemeLookup:_,selectedBorder:E,onSelectBorder:L,createTooltip:T,disabled:a||!x||x.disabled(),...m})})),$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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("mergeToggle"),icon:ze(s.jsx(k7,{}))}),s.jsx(qe,{...p,command:d.getCommand("mergeHorizontal"),icon:ze(s.jsx(MP,{}))}),s.jsx(qe,{...p,command:d.getCommand("mergeVertical"),icon:ze(s.jsx(TP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("freezeToggle"),icon:ze(s.jsx(IP,{}))}),s.jsx(qe,{...p,command:d.getCommand("freezeToggleHorizontal"),icon:ze(s.jsx(jP,{}))}),s.jsx(qe,{...p,command:d.getCommand("freezeToggleVertical"),icon:ze(s.jsx(RP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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(_P,{}),...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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("find"),icon:ze(s.jsx(q7,{}))}),s.jsx(qe,{...p,command:d.getCommand("findReplace"),icon:ze(s.jsx(av,{}))}),s.jsx(qe,{...p,command:d.getCommand("goto"),icon:ze(s.jsx(YO,{}))})]});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=$z.DefaultFontSizes,disabled:l=!1,parentFloat:c,sx:d,...p}=e;ol(n);const f=()=>n?.state()?.toString()||"11",[h,g]=u.useState(f),m=_e(()=>{const R=parseFloat(h);isNaN(R)?g(f()):parseFloat(f())!==R&&n.execute(R,o)},[f,n,h,o]);u.useEffect(()=>{g(f())},[n?.state()]);const y=u.useMemo(()=>{if(!o)return null;const R={...o};return delete R.beforeExecute,R},[o]),x=_o(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),v=u.useMemo(()=>x?s.jsxs(Le,{className:Eo("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:R=>R.stopPropagation(),children:[s.jsx(qe,{command:x[0],commandHook:y,icon:ze(s.jsx(AO,{}))}),s.jsx(qe,{command:x[1],icon:ze(s.jsx(LO,{}))})]}):null,[x]),b=qi(),w=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("12.3",Math.round(b.typography.fontSize),b.typography.fontFamily).width}px`,[b]),E=u.useCallback(R=>{const{onMouseDown:_,onMouseUp:L,...T}=R;return s.jsx(Tr,{component:"div",...T,disableRipple:!0,children:s.jsx(ql,{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:j=>`1px solid ${j.palette.text.icon??j.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:j=>`1px solid ${j.palette.error.main}`},"::after":{borderBottom:j=>`1px solid ${j.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:j=>`${Math.round(j.typography.fontSize)}px`,width:w,color:j=>j.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:j=>j.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:j=>j.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:h,onFocus:j=>{j.target?.select()},onKeyDown:j=>{if(j.which===tn.Enter)f()!==h&&(j.stopPropagation(),j.preventDefault(),m());else if(j.which===tn.Escape)f()!==h&&(g(f()),setTimeout(()=>{j.target?.select()},0),j.stopPropagation(),j.preventDefault());else{if(j.key.match("[-]")||j.key.match("[0-9.]")&&(h+j.key).length>4)return j.stopPropagation(),void j.preventDefault();if(j.which===tn.Space)return void j.preventDefault()}},onBlur:()=>{m()},onChange:j=>{if(j.target.value.length>4)return j.stopPropagation(),void j.preventDefault();g(j.target.value)}})})},[h,l,n]),C=u.useCallback(R=>{const _=S=>{n?.execute(S,o)},L=n?.state(),T=[];for(let S=0;S<a.length;S++){const k=a[S]===L;T.push(s.jsx(Gr,{selected:k,icon:k?s.jsx(k1,{}):void 0,disabled:l||!n||n.disabled(),onMouseDown:P=>{P.button===0&&P.preventDefault()},onMouseUp:P=>{P.button===0&&_(a[S])},onKeyDown:P=>{P.keyCode!==tn.Enter&&P.keyCode!==tn.Space||_(a[S])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[S]})},"fontSize-"+S))}const j=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})]});return Bn({...R,children:j})},[l,n?.state(),o]);return s.jsx(Ui,{ref:t,sx:{...d},tabIndex:-1,outlined:!0,disabled:l,parentFloat:c,createPopupPanel:C,createTooltip:({children:R},_)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:_||n?.disabled(),children:R}),createQuickButton:E,...p})})),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(k1,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==tn.Enter&&c.keyCode!==tn.Space||r(i.numberFormat)},...l,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(Mn,{component:"div",children:[i.formatType,i.formatType===$.NumberFormat.Type.Custom?"…":""]}),s.jsx(Mn,{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=j=>{o?.beforeExecute?.(d,d?.state()),d.execute(j,o),o?.onExecute?.(d,d?.state())},b=d?.context()(),w=$.NumberFormat.Styles.lookupPrimary(),E=[];for(let j=0;j<w.length;j++){let S="";if(b&&!b.isEmpty())try{S=b.getNumberFormat(w[j].numberFormat).displayText}catch(P){console.warn(P)}S===""&&w[j].formatType===$.NumberFormat.Type.General&&(S="No specific format");const k=w[j].formatType===p;E.push(s.jsx(Fg,{selected:k,disabled:a||!d||d.disabled(),formattedValue:S,handleSetFormat:v,format:w[j]},w[j].formatType))}const C={numberFormat:"",formatType:$.NumberFormat.Type.Custom},R=p===$.NumberFormat.Type.Custom,_=s.jsx(Fg,{selected:R,disabled:a||!d||d.disabled(),formattedValue:R?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(d,d?.state()),x.getCommand("formatNumberDialog")?.execute(d?.state()),o?.onExecute?.(d,d?.state())},format:C,sx:{flex:"0",width:"100%"}},$.NumberFormat.Type.Custom),L=s.jsxs(Le,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:j=>j.stopPropagation(),children:[s.jsx(qe,{command:x.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:s.jsx(LP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:s.jsx(OP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:s.jsx(PP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(DP,{}))}),s.jsx(qe,{command:x.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(AP,{}))})]}),T=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[L,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:E}),s.jsx(Ft,{orientation:"horizontal"}),_]});return Bn({...y,children:T})},[d?.context(),d?.state(),o,r]),g=qi(),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(Le,{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(Le,{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:Yt.Menuitem,commandHook:o,scope:"clear",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("clearAll"),icon:s.jsx(Y4,{})}),s.jsx(qe,{...p,command:d.getCommand("clearFormats"),icon:ze(s.jsx(_b,{}))}),s.jsx(qe,{...p,command:d.getCommand("clearContents"),icon:ze(s.jsx(OI,{}))}),s.jsx(qe,{...p,command:d.getCommand("clearComments")}),s.jsx(qe,{...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:Yt.Menuitem,commandHook:o,scope:"fill",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("fillDown"),icon:ze(s.jsx(I0,{}))}),s.jsx(qe,{...p,command:d.getCommand("fillRight"),icon:ze(s.jsx(I0,{sx:{transform:"rotate(270deg)"}}))}),s.jsx(qe,{...p,command:d.getCommand("fillUp"),icon:ze(s.jsx(I0,{sx:{transform:"rotate(180deg)"}}))}),s.jsx(qe,{...p,command:d.getCommand("fillLeft"),icon:ze(s.jsx(I0,{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(I0,{})),...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=Yt.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===Yt.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(jO,{}))),v.set("insertColumns",ze(s.jsx(D7,{}))),v},[]),x=u.useCallback((v,b)=>{let w=null;const E={variant:Yt.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:b.getCommand("addSheet"),icon:ze(s.jsx(Hs,{}))})]}));const C=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...E,command:h[0],icon:y.get(f[0])}),s.jsx(qe,{...E,command:h[1],icon:y.get(f[1])}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:h[2],icon:y.get(f[2])}),s.jsx(qe,{...E,command:h[3],icon:y.get(f[3])}),w]});return Bn({...v,children:C})},[i,h,o,r,y]);return g?s.jsx(qe,{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=Yt.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===Yt.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(RO,{}))),x.set("deleteColumns",ze(s.jsx(L7,{}))),x},[]),y=u.useCallback((x,v)=>{const b={variant:Yt.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let w=null;a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...b,command:v.getCommand("deleteSheet"),icon:ze(s.jsx(Hs,{}))})]}));const E=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:m.get("deleteCellsShiftUp")}),s.jsx(qe,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:m.get("deleteCellsShiftLeft")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...b,command:v.getCommand("deleteRows"),icon:m.get("deleteRows")}),s.jsx(qe,{...b,command:v.getCommand("deleteColumns"),icon:m.get("deleteColumns")}),w]});return Bn({...x,children:E})},[i,o,r,m]);return h?s.jsx(qe,{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})})),Ys=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Yt.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");ol(n);const v=n?.context();let b=l??v?.quickColor;d&&!b&&(b=new $.Color("transparent"));const w=g??v?.autoColor,E=m??v?.schemeLookup,C=y??v?.recentColors,R=p??v?.darkMode,_=u.useMemo(()=>({autoColor:w,schemeLookup:E,recentColors:C,darkMode:R,...x}),[w,E,C,R]),L=_e((j,S)=>{j&&S&&v?.addRecentColor&&v.addRecentColor(j),v?.onColorSelect&&v.onColorSelect(j),r?.(j,S),n?.execute(j,o)},[n,r,o,v]),T=u.useCallback((j,S)=>{const{children:k,title:P,...O}=j;let I=j.children;return(n?.disabled()||i)&&(I=s.jsx("div",{children:I})),s.jsx(a0,{command:n,placement:a===Yt.Toolbar?"bottom-start":"right-start",disabled:S,...O,children:I})},[n,i]);return s.jsx(Cf,{ref:t,panelProps:_,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:L,variant:a===Yt.Menuitem?ji.Menuitem:ji.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:R,...h})}));Ys.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:Yt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...h,command:f.getCommand("gridlinesToggle")}),s.jsx(Ys,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:s.jsx(N3,{}),panelProps:{disableAlpha:!0}}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),s.jsx(qe,{...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(Gs,{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:Yt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=d.getCommand("sortCustom"),h=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("sortAscending"),icon:ze(s.jsx(uh,{}))}),s.jsx(qe,{...p,command:d.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),f?s.jsx(qe,{...p,command:f,icon:ze(s.jsx(DO,{}))}):null,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(oh,{}))}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),s.jsx(qe,{...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(uh,{})),...a})})),GB=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:Yt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(oh,{}))}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),s.jsx(qe,{...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(oh,{})),...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),E=u.useCallback((C,R)=>{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)},j=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!==tn.Enter&&I.keyCode!==tn.Space||T(b)},children:s.jsx(Mn,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:_})});if(L)return j;const S=r?x?.getRedoDescriptions():x?.getUndoDescriptions(),k=[];for(let I=0;I<S.length;I++){const z=S[I];k.push(s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex"},icon:s.jsx(Hs,{}),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!==tn.Enter&&A.keyCode!==tn.Space||T(I+1)},children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[s.jsx(Mn,{component:"div",children:z}),s.jsx(Hs,{})]})},`action:${I}`))}let P=null;if(!r&&i){const I={scope:"undo",commands:R,variant:Yt.Menuitem,parentFloat:C.floatReference};P=[],P.push(s.jsx(_f,{...I,quickCommand:"redo",isRedo:!0},"nested:redo")),x.hasRedo()&&x.hasUndo()&&P.push(s.jsx(Ft,{orientation:"horizontal"},"action:redo-div"))}const O=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{C.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[P,s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),s.jsx(Ft,{orientation:"horizontal"}),j]});return Bn({...C,children:O})},[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:E,icon:o??ze(s.jsx(r?vD:bD,{})),selected:!1,...f})})),Ps=$.IFontCollection.getFontList(),GS=new Map;for(let e=0;e<Ps.length;e++)GS.set(Ps[e].fontRef.getFamily(),Ps[e]);const ZS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,...l}=e;ol(n);const c=n?.state(),d=qi(),p=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("Times New Roman",Math.round(d.typography.fontSize),d.typography.fontFamily).width}px`,[d]),f=u.useCallback(h=>{const g=v=>{n?.execute(v,o)},m=[];for(let v=0;v<Ps.length;v++)m.push({key:Ps[v].fontRef.getFamily(),description:Ps[v].fontRef.getFamily()});GS.get(c)||m.unshift({key:c,description:c});const y=[];for(let v=0;v<m.length;v++){const b=m[v].key===c;y.push(s.jsx(Gr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:b,disabled:i||!n||n.disabled(),icon:b?s.jsx(k1,{}):void 0,onMouseUp:w=>{w.button===0&&g(m[v].key)},onMouseDown:w=>{w.button===0&&w.preventDefault()},onKeyDown:w=>{w.keyCode!==tn.Enter&&w.keyCode!==tn.Space||g(m[v].key)},children:s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:s.jsx(Mn,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>m[v]?.key},children:m[v].description})})},v+""+m[v].key))}const x=s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...l,children:s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})});return Bn({...h,children:x})},[i,n?.state()]);return s.jsx(Ui,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:f,createTooltip:({children:h},g)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:g,children:h}),icon:s.jsx(Le,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:p},children:s.jsx(Le,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:c})}),...l})})),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(zO,{}))),f.set("formatSubscriptToggle",ze(s.jsx(FO,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:"textEffects",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),s.jsx(qe,{...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(Ip,{}))),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:Yt.Menuitem,commandHook:o,scope:"underline",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:ze(s.jsx(Ip,{}))}),s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ze(s.jsx(F7,{}))}),s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ze(s.jsx(B7,{}))}),s.jsx(qe,{...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(Ip,{})),...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=_e((p,f)=>{const h={variant:Yt.Menuitem,commandHook:r,scope:"paste",disabled:l},g=[];return a&&(g.push(u.createElement(qe,{...h,command:f.getCommand("paste"),key:"paste",icon:s.jsx(P7,{})})),g.push(s.jsx(Ft,{orientation:"horizontal"},"paste-div"))),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ze(s.jsx(vO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ze(s.jsx(wO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ze(s.jsx(SO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ze(s.jsx(CO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ze(s.jsx(kO,{}))})),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:Yt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),s.jsx(qe,{...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(Gs,{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:Yt.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),s.jsx(qe,{...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(Gs,{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(Le,{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(Le,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:s.jsx(Le,{className:"text",children:n})})})})})),ZB=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:Yt.Menuitem,commandHook:f,context:"cellStyle"},b=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...v,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...v,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),s.jsx(qe,{...v,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===$.IStyle.BuiltInName.Normal})]});return Bn({...x,children:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Le,{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;ol(o);const f=o?.context(),h=f?.styles,g=i??f?.named(),m=c??f?.bodyStyle(),y=_e(E=>{a?.(E),o?.execute(E,r)},[o,a,r]),x=u.useCallback((E,C)=>{const R={onSelectNamed:y,styles:h(),parentFloat:E.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 j=A=>{let D=L.get(A);return D||(D=h().getNamed(A)),!D||D.isHidden()?null:s.jsx(ZB,{namedStyle:D,selectedNamed:g,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...R},A)},S=(A,D,F=!0)=>{const B=[];for(let M=0;M<D.length;M++){const N=j(D[M]);N&&B.push(N)}return B.length===0?null:s.jsxs(Le,{children:[F?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(qs,{children:A},A+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:B},A+"-presets")]},A)},k=(A,D)=>{const F=[];for(let B=0;B<D.length;B++){const M=j(D[B]);M&&F.push(M)}return F.length===0?null:s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:F},A+"-presets")},P=[];P.push(S("Custom",T,!1)),P.push(S("Good, Bad and Neutral",[$.IStyle.BuiltInName.Normal,$.IStyle.BuiltInName.Bad,$.IStyle.BuiltInName.Good,$.IStyle.BuiltInName.Neutral],T.length>0)),P.push(S("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])),P.push(S("Titles and Headings",[$.IStyle.BuiltInName.Heading1,$.IStyle.BuiltInName.Heading2,$.IStyle.BuiltInName.Heading3,$.IStyle.BuiltInName.Heading4,$.IStyle.BuiltInName.Title,$.IStyle.BuiltInName.Total]));let O=[];var I,z;return O.push(k("Accent 1",[$.IStyle.BuiltInName.Accent1_20,$.IStyle.BuiltInName.Accent1_40,$.IStyle.BuiltInName.Accent1_60,$.IStyle.BuiltInName.Accent1])),O.push(k("Accent 2",[$.IStyle.BuiltInName.Accent2_20,$.IStyle.BuiltInName.Accent2_40,$.IStyle.BuiltInName.Accent2_60,$.IStyle.BuiltInName.Accent2])),O.push(k("Accent 3",[$.IStyle.BuiltInName.Accent3_20,$.IStyle.BuiltInName.Accent3_40,$.IStyle.BuiltInName.Accent3_60,$.IStyle.BuiltInName.Accent3])),O.push(k("Accent 4",[$.IStyle.BuiltInName.Accent4_20,$.IStyle.BuiltInName.Accent4_40,$.IStyle.BuiltInName.Accent4_60,$.IStyle.BuiltInName.Accent4])),O.push(k("Accent 5",[$.IStyle.BuiltInName.Accent5_20,$.IStyle.BuiltInName.Accent5_40,$.IStyle.BuiltInName.Accent5_60,$.IStyle.BuiltInName.Accent5])),O.push(k("Accent 6",[$.IStyle.BuiltInName.Accent6_20,$.IStyle.BuiltInName.Accent6_40,$.IStyle.BuiltInName.Accent6_60,$.IStyle.BuiltInName.Accent6])),P.push((I="Themed Cell Styles",z=O,s.jsxs(Le,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qs,{children:I},I+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:z},I+"-presets")]},I))),P.push(S("Number Format",[$.IStyle.BuiltInName.Comma,$.IStyle.BuiltInName.Comma0,$.IStyle.BuiltInName.Currency,$.IStyle.BuiltInName.Currency0,$.IStyle.BuiltInName.Percent])),s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[s.jsx(Le,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:P}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{variant:Yt.Menuitem,commandState:g,command:C.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:l,icon:ze(s.jsx(VO,{}))})]})},[g,h?.().getTheme(),m]),v=_e(E=>{const C=18/$.IFont.getDeviceScale(),R=f?.createTemporaryCell(E);return R.getStyle().getFont().getSize()<=C?R:R.createTemporaryCell({style:{font:{size:C}}})},[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:E=>`1px solid ${E.palette.action.hover}`},borderProps:{}}):ze(s.jsx(Kc,{})),[g,m,b]);return s.jsx(Xn,{ref:t,createPopupPanel:x,outlined:d,commands:n,createTooltip:({children:E},C)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:C,children:E}),selected:!1,disabled:b,label:o?.label(),icon:w,...p})})),nC="_sheetxl-reset_ods65_1",XB=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=XB,isLive:f=!1,...h}=e,g=Math.ceil(1.3*p),[m,y]=u.useReducer(E=>E+1,0);u.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{y()}})},[o,f]);const x=u.useMemo(()=>{let E=o?.toJSON()??{};const C={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return E&&(E.styleOptions={...E.styleOptions,name:r.getName()}),E.ref=C,new $.Table({initialAnchor:C,json:E,styles:n})},[m,o,r,n]),v=u.useMemo(()=>{const E=[];for(let C=0;C<5;C++)for(let R=0;R<5;R++){const _=x.getStyleAt({colIndex:R,rowIndex:C});E.push(_)}return E},[x]),b=u.useMemo(()=>{const E=(R,_,L)=>{let T=L.getFill().toCSS(i?.darkMode??!1);const j=g-(_<4?1:0),S=p-(R<4?1:0),k=L.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:_*(g-1),top:R*(p-1),width:j,height:S},s.jsx("td",{className:`table-style-fill ${R}-${_}`,style:T,children:s.jsx("div",{className:`table-style-text ${R}-${_}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(j-6)/2,top:(S-1)/2,borderTop:`1px solid ${k}`}})},`${R}-${_}`)},C=[];for(let R=0;R<5;R++){const _=[];for(let L=0;L<5;L++){const T=v[5*R+L];_.push(E(R,L,T))}C.push(s.jsx("tr",{children:_},R))}return C},[x,r,i]),w=u.useCallback((E,C)=>v[C].getBorder()??null,[v]);return s.jsx(Le,{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})})})})})),$0=(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 E=h[5*b+w].getFill();let C=i?.fill;E.getType()===$.IFill.Type.Solid?C=E.getColor().toCSS(v,!1):E.getType()===$.IFill.Type.Gradient?C=E.getStops[0]?.color.toCSS(v,!1):E.getType()===$.IFill.Type.Pattern&&(C=E.getForeground().toCSS(v,!1)),y.fillStyle=C;const R=w*x,_=9*b;y.fillRect(R,_,13,10)}y.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const E=h[5*b+w],C=w*x,R=9*b,_=E.getBorder();if(!_.isEmpty()){const j=_.getLeft();j.isNone()||(y.strokeStyle=j.getColor().toCSS(v,!1),$0(y,C,R,C,R+9));const S=_.getTop();S.isNone()||(y.strokeStyle=S.getColor().toCSS(v,!1),$0(y,C,R,C+x,9*b));const k=_.getRight();k.isNone()||(y.strokeStyle=k.getColor().toCSS(v,!1),$0(y,C+x,R,C+x,R+9));const P=_.getBottom();P.isNone()||(y.strokeStyle=P.getColor().toCSS(v,!1),$0(y,C,R+9,C+x,R+9))}y.strokeStyle=E.getFont().getFill().toCSS(v,!1);const L=4,T=2.5;$0(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(Le,{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(Na,{control:s.jsx(Ba,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),l&&s.jsx(Na,{control:s.jsx(Ba,{checked:a??!1,indeterminate:a==null,onChange:()=>l(!a),disabled:f||a==null}),label:"Total Row",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&s.jsx(Na,{control:s.jsx(Ba,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>d(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),YB=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 E={variant:Yt.Menuitem,commandHook:f,context:"table"},C=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...E,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(qe,{...E,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]});return Bn({...w,children:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})})})},[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;ol(o);const f=o?.context(),h=f?.styles,g=i??f?.table?.();let m="insertTable";g&&(m="editTable");const y=u.useMemo(()=>((T,j)=>{const S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new $.Table({initialAnchor:S,styles:j,json:{name:"PreviewTable",ref:S,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(),E=_e(T=>{a?.(T),o?.execute({name:T},r)},[o,a,r]),C=u.useRef(null),R=u.useCallback((T,j)=>{const S={onSelectTableStyleName:E,styles:h(),parentFloat:T.floatReference};C.current||(C.current=document.createElement("canvas"));const k=M=>{const N=h().getTableStyle(M);return N?s.jsx(YB,{table:v,tableStyle:N,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:j,commandHook:r,canvas:C.current,...S},M):null},P=(M,N,V=!0)=>{const U=[];for(let J=0;J<N.length;J++){const X=k(N[J]);X&&U.push(X)}return U.length===0?null:s.jsxs(Le,{children:[V?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(qs,{children:M},M+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:U},M+"-presets")]},M)},O=[],I=h().getCustomTableStyles(),z=[];if(I.length>0){for(let M=0;M<I.length;M++)I[M].isShownInTableStyles()&&z.push(I[M].getName());O.push(P("Custom",z,!1))}const A=[];g&&!g.getStyleOptions().name&&A.push(null);for(let M=0;M<21;M++)A.push("TableStyleLight"+(M+1));O.push(P("Light",A,z.length>0));const D=[];for(let M=0;M<28;M++)D.push("TableStyleMedium"+(M+1));O.push(P("Medium",D));const F=[];for(let M=0;M<11;M++)F.push("TableStyleDark"+(M+1));O.push(P("Dark",F));let B=null;return g&&(B=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{variant:Yt.Menuitem,command:j.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:l,icon:ze(s.jsx(_b,{}))})]})),s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:M=>`${M.shape.borderRadius}px`,paddingBottom:M=>`${M.shape.borderRadius}px`},children:[s.jsx(Le,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:O}),B]})},[h,h?.().getTheme(),w,v]),_=l||!o||o.disabled(),L=u.useMemo(()=>{if(!f||!d)return ze(s.jsx(Kc,{}))},[v,w,_]);return s.jsx(Xn,{ref:t,quickCommand:m,createPopupPanel:R,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:T},j)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:j,children:T}),disabled:_,icon:L,...p})})),mi=[];mi.push(Fi("Primary Background","bg1")),mi.push(Fi("Primary Text","tx1")),mi.push(Fi("Secondary Background","bg2")),mi.push(Fi("Secondary Text","tx2")),mi.push(Fi("Accent 1","accent1")),mi.push(Fi("Accent 2","accent2")),mi.push(Fi("Accent 3","accent3")),mi.push(Fi("Accent 4","accent4")),mi.push(Fi("Accent 5","accent5")),mi.push(Fi("Accent 6","accent6"));const aC=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...l}=e,c=qi(),d=u.useMemo(()=>{let p=[];for(let f=0;f<mi.length;f++){const h=mi[f];p.push(s.jsx(N2,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:s.jsx(Le,{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(Le,{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(Le,{sx:{},children:t.getName()}),s.jsxs(Le,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,s.jsx(Le,{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 NB(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 Hh(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:NB(n,o),lineNumber:a.lineNumber})}if(o.childItems)for(const i of o.childItems)Hh(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 $B(e){return e.kind==="comment"}const VB=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=_e(a,[a]),m=u.useRef(!1),y=u.useMemo(()=>({contains(D){if(!h.current)return;const F=h.current.editor;return F&&F.getDomNode()?.contains(D)},focus(){if(!h.current)return;const D=h.current.editor;return D&&D.getDomNode()?.focus()}}),[]),x=u.useMemo(()=>[new He("help",y,{label:"Script Commands",description:"Open Editor Commands",shortcut:{key:"F1"}},()=>{})],[]),v=u.useMemo(()=>{let D=null;const F=()=>y;return D=r?r.createChildGroup(F,"scriptEditor",!1):new r0(F,"scriptEditor"),D.addCommands(x,!0),D},[r,x]),b=_o(v,["executeSelectedScript"])[0],w=b?.context(),E=_e(D=>{b?.execute(D)},[b]),C=u.useRef(""),[R,_]=u.useState(!1),L=_e(async()=>{if(!h.current)return null;const D=h.current,F=D.editor;if(!F)return null;const B=D.monaco,M=await(async(N,V,U="export")=>{const J=N.getModel();if(!J)return null;const X=await V.languages.typescript.getTypeScriptWorker(),H=await X(J.uri),ne=await H.getNavigationTree(J.uri.toString());let oe=null,ye=N.getSelection();const de=ye.startLineNumber===ye.endLineNumber&&ye.startColumn===ye.endColumn?J.getLineCount():Math.min(ye.endLineNumber,J.getLineCount());for(let xe=ye.startLineNumber;!oe&&xe<=de;xe++){const we=Sf(ne,J.getOffsetAt({lineNumber:xe,column:1}),"function",U);we&&(oe=we.text)}return oe})(F,B);return p?.({message:(M??"").toUpperCase()}),M?{source:F.getValue(),name:M}:null},[p]),T=_e(async(D,F,B)=>{const M=await w.getScripts().createModule({source:B?.getValue(),declarationsOnly:!0}),N=M?M.getFunctions().search():Xt.EmptyArray;M&&(async function(V,U){const J=[];for(let X=1;X<V.getLineCount()+1;X++){const H={startLineNumber:X,startColumn:1,endLineNumber:X,endColumn:V.getLineLength(X)+1},ne=V.getValueInRange(H).indexOf("modelt");ne!==-1&&J.push({message:"found 'modelt'",resource:"https://www.sheetxl.com",severity:U.MarkerSeverity.Hint,startLineNumber:H.startLineNumber,startColumn:ne+1,endLineNumber:H.startLineNumber,endColumn:ne+5})}U.editor.setModelMarkers(V,"owner",J)}(D,F),async function(V,U,J,X){const H=await U.languages.typescript.getTypeScriptWorker(),ne=await H(V.uri),oe=await ne.getNavigationTree(V.uri.toString()),ye=Hh(V,U,X,oe).map(de=>{let xe=null,we=null;return de.type==="formula"?(xe="formula.margin-icon",we="Formula"):de.type==="macro"?(xe="macro.margin-icon",we="Macro"):de.type==="autoRun"&&(xe="autorun.margin-icon",we="Auto Run"),{range:new U.Range(de.lineNumber,1,de.lineNumber,1),options:{isWholeLine:!1,glyphMarginClassName:xe,glyphMarginHoverMessage:we,stickiness:U.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}});P.current&&P.current.clear(),P.current=J.createDecorationsCollection(ye)}(D,F,B,N))},[w]),j=_e(Xt.debounce(T,580),[]),S=_e(async(D=void 0)=>{if(!h.current||!w)return;const F=h.current.editor.getPosition(),B={cursor:F?F.toString():""};D!==void 0&&(B.message=D),p?.(B);const M=L();w.setSelectedFunction(M)},[w,p]);u.useEffect(()=>{if(!w)return;const D={insertSnippet:B=>{h.current?.editor&&(R?zg(h.current.editor,h.current.monaco,B):C.current=B)}};w.setEditor(D),w.setSelectedFunction(L());const F=w.addContainerListener({onBeforeSave:async()=>{if(!h.current?.editor||!w)return;const B=h.current.editor,M=w?.getScripts().getModules().getByName("scripting"),N=M?.getSource(),V=B.getValue();if((N?.length??0)===V.length&&N===V)return;await w.saveSource(B.getValue());const U=(N?.length??0)!==V.length||N!==V;p?.({dirty:U})},onReadonlyChange(){},onScriptChange:async()=>{if(!h.current?.editor||!w)return;const B=h.current.editor,M=w.getScripts().getModules().search()[0]?.getSource()??"";B.setValue(M)}});return()=>{F(),w.setSelectedFunction(null),w.setEditor(null)}},[w,R]),u.useEffect(()=>()=>{if(!h.current?.editor)return;const D=h.current.editor;w?.saveSource(D.getValue())},[]);const k=_e(D=>{const F=h.current;if(!F)return!1;const B=F.editor;return!!B&&(B.focus(),!0)},[]),P=u.useRef(null),O=_e((D,F)=>{h.current={monaco:F,editor:D},_(!0),S("Loading Types");const B=w.getScripts().getModules().search()[0]?.getSource()??"";D.setValue(B),Promise.resolve().then(()=>require("./BZzMK8bX8rQGjjSF.cjs")).then(V=>V.c).then(V=>{S(""),V.AutoTypings.create(D,{shareCache:!0,monaco:F,onError:U=>{U==="Not implemented yet"&&(U="Compile Errors"),console.warn("Error compiling types",U)}}).then(async U=>{const J=D.getModel();j(J,F,D)})}),D.addCommand("executeScript",function(V,...U){U?.[0]&&E({functionName:U?.[0]})},""),D.addAction({id:"executeScript",label:"Execute",keybindings:[F.KeyCode.F8],run:async V=>{const U=L();w.setSelectedFunction(U);const J=await U;E(J)}}),D.addAction({id:"saveScript",label:"Save Script",keybindings:[F.KeyMod.CtrlCmd|F.KeyCode.KeyS],run:V=>{w?.saveSource(D.getValue()).then(()=>{const U=w?.getScripts().getModules().getByName("scripting"),J=U?.getSource(),X=D.getValue(),H=(J?.length??0)!==X.length||J!==X;p?.({dirty:H})})}}),D.onMouseDown(async V=>{if(V.target.type===F.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const U=V.target.position.lineNumber,J=await F.languages.typescript.getTypeScriptWorker(),X=await J(M.uri),H=await X.getNavigationTree(M.uri.toString()),ne=D?.getValue(),oe=(await w?.saveSource(ne)).getFunctions().search(),ye=Hh(M,F,oe,H).find(de=>de.lineNumber===U);if(ye){const de=V.event.browserEvent.button;de===0?ye.type==="macro"||ye.type==="autoRun"?E({functionName:ye.name}):ye.type==="formula"&&w.quickInsertFunction?.(ye.name):de===2&&(console.log("Context menu for function:",ye.name),V.event.browserEvent.preventDefault())}}}),D.onDidChangeModelContent(()=>{const V=D.getModel();j(V,F,D)});const M=D.getModel();var N;(N=F).languages.registerInlayHintsProvider("typescript",{provideInlayHints(V,U,J){const X=[];for(let H=1;H<V.getLineCount()+1;H++){const ne={startLineNumber:H,startColumn:1,endLineNumber:H,endColumn:V.getLineLength(H)+1},oe="hint",ye=V.getValueInRange(ne).indexOf("hint");ye!==-1&&X.push({kind:N.languages.InlayHintKind.Type,position:{lineNumber:ne.startLineNumber,column:ye+oe.length+1},label:"[hint]"})}return{hints:X,dispose:()=>{}}}}),M.onDidChangeContent(V=>{const U=w?.getScripts().getModules().getByName("scripting"),J=U?.getSource(),X=D.getValue(),H=(J?.length??0)!==X.length||J!==X;p?.({dirty:H})}),D.onDidChangeCursorPosition(V=>{S()})},[w,p]),I=u.useMemo(()=>R?null:c||s.jsx("div",{style:{position:"absolute",width:"100%",height:"100%"},children:"Loading..."}),[R,c]),z=u.useMemo(()=>{const D=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(FB,{theme:l?"extended-dark":"extended",options:{...BB,fixedOverflowWidgets:!0,readOnly:i},language:"typescript",value:D,onValidate:F=>{let B=!1;for(let M=0;!B&&M<F?.length;M++)F[M].severity===8&&(B=!0)},beforeMount:F=>{F.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),F.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0}),F.editor.defineTheme("extended",{base:"vs",inherit:!0,rules:[],colors:{}}),F.editor.defineTheme("extended-dark",{base:"vs-dark",inherit:!0,rules:[],colors:{}}),(async()=>{let B=!1;try{const N=await(async()=>await(await fetch("https://cdn.jsdelivr.net/npm/@sheetxl/sdk/types/scripting.d.ts")).text())(),V=F.Uri.parse('inmemory://model/"sheetxl-models".d.ts'),U=F.editor.createModel(N,"typescript",V);F.editor.setModelMarkers(U,"default",[]),B=!0}catch(N){console.warn("cant load types",N)}F.languages.registerLinkProvider("*",{provideLinks:(N,V)=>{const U=[],J={links:U},X=N.getLinesContent();for(let H=1;H<=X.length;H++){const ne=X[H-1],oe=F.editor.tokenize(ne,"typescript");for(let ye=0;ye<oe[0].length;ye++){const de=oe[0]?.[ye];if(de&&de.type.startsWith("string")){let xe=de.offset,we=oe[0]?.[ye+1]?.offset??ne.length,ve=new F.Range(H,xe+1,H,we+1),re=N.getValueInRange(ve);const ce=re[0];ce!=="`"&&ce!=="'"&&ce!=='"'||(xe++,re=re.substring(1));const Se=re[re.length-1];Se!=="`"&&Se!=="'"&&Se!=='"'||(xe++,re=re.substring(0,re.length-1));try{w.getRanges(re)&&U.push({range:{endColumn:we,endLineNumber:H,startColumn:xe,startLineNumber:H},tooltip:`Goto range '${re}'`,url:`/range/${re}`})}catch(ie){console.warn(ie)}}}}return J}}),F.editor.registerLinkOpener({open(N){if(N?.path?.startsWith("/range/")){try{w.getRanges(N.path.substring(7))?.select()}catch(V){console.warn("invalid range",V)}return!0}return!1}});const M=F.languages.typescript.typescriptDefaults.getCompilerOptions();F.languages.typescript.typescriptDefaults.setCompilerOptions({...M,target:F.languages.typescript.ScriptTarget.ES2020,lib:["webworker","es2020","esnext.asynciterable"],downlevelIteration:!0,moduleResolution:F.languages.typescript.ModuleResolutionKind.Classic,baseUrl:"inmemory://model/",allowNonTsExtensions:!0}),C.current&&(await zg(h.current.editor,h.current.monaco,C.current),C.current=null),m.current&&requestAnimationFrame(async()=>{m.current&&F.editor.focus()}),F.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1}),_(!0)})()},onMount:O})}),I]})},[w,v,i,I,l]),A=ir(t,()=>({isScriptEditorElement:()=>!0,focus:D=>{k(D)},close:()=>{g?.()},getEditor:()=>w?.getEditor()}),[w]);return u.useEffect(()=>(d&&requestAnimationFrame(()=>{k()}),()=>{h.current?.editor&&requestAnimationFrame(()=>{A.current?.contains(document.activeElement)&&k()})}),[]),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"},Is={Start:"start",End:"end"},l5={},HB=(e,t,n,o)=>{const r=e+"-"+t+"-"+n+(o?"-server":"");if(l5[r])return l5[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 l5[r]=i,i},WB={},LS=u.memo(e=>{const{className:t,style:n=_n.EmptyCssProperties,white:o="transparent",grey:r="grey",size:i=8,borderRadius:a,boxShadow:l,renderers:c=WB,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(${HB(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})}),UB=u.memo(e=>{const{selectedColor:t,onSelectColor:n,onPreviewColor:o,onClick:r,onKeyDown:i,onMouseOver:a,onMouseLeave:l,onFocus:c,style:d=_n.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(R=>{r?.(R),R.isDefaultPrevented()||(R.ctrlKey?o?.(t.toRGBA()):n?.(t.toRGBA()))},[n,o,r,t]),v=u.useCallback(R=>{a?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,a,t]),b=u.useCallback(R=>{l?.(R),R.isDefaultPrevented()},[o,l]),w=u.useCallback(R=>{c?.(R),R.isDefaultPrevented()||o?.(t.toRGBA())},[o,c,t]),E=u.useCallback(R=>{i?.(R),R.isDefaultPrevented()||R.keyCode===tn.Enter&&n?.(t.toRGBA())},[n,i,t]),C=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:E,onMouseOver:v,onMouseLeave:b,onFocus:w,children:[C,s.jsx("div",{style:{position:"absolute",top:"0px",left:"0px",height:"100%",width:"100%",background:t.toCSS(g)},children:p})]})}),N2=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},C=>t(C)),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]),E=u.useCallback(C=>{a?.(C?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(UB,{selectedColor:g,title:null,onSelectColor:w,onPreviewColor:E,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"}})]})})})}),Md=u.memo(e=>{const{title:t,schemeColorLookup:n,colorDefs:o,selectedColor:r,previewColor:i,onSelectColorDef:a,onPreviewColorDef:l,style:c=_n.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 E=[],C=g[w];for(let _=0;_<C.length;_++){let L=C[_];E.push(s.jsx(N2,{schemeColorLookup:n,colorDef:L,selectedColor:r,previewColor:i,onSelectColorDef:m,onPreviewColorDef:y,swatchProps:f,compareRGB:d,darkMode:p},w+" "+_))}let R=s.jsx(Le,{className:"button-col",sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",boxShadow:_=>_.shadows[2],borderRadius:"2px",overflow:"hidden"},children:E},""+w);b.push(R)}return b},[g,r,i,m,y]),v=u.useMemo(()=>t?s.jsx(Mn,{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(Le,{style:{...c},children:[v,s.jsx(Le,{sx:{display:"flex",flexDirection:"row",gap:"6px",marginBottom:"14px",flexWrap:"wrap",justifyContent:"flex-start"},...h,children:x})]})}),Fi=(e,t)=>({description:e,definition:{val:t,adjs:[]}}),Ho=(e,t,n,o,r,i)=>{const a=Fi(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)},qB=u.lazy(()=>Promise.resolve().then(()=>require("./x3raNMkDfaCh0EE2.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:E=Is.Start,compareRGB:C=!1,darkMode:R=!1,..._}=e,L=o||n,T=_e(y,[y]),j=_e(x,[x]),S=_e(v,[v]),k=_e(g,[g]),P=_e(m,[m]),[O,I]=u.useState(!1),z=qi(),A=u.useMemo(()=>i||$.Color.getDefaultSchemeLookup(),[i]),D=u.useMemo(()=>{const re=new Map,ce=new Map,Se=[];Ho("Primary Background","bg1",A,Se,re,ce),Ho("Primary Text","tx1",A,Se,re,ce),Ho("Secondary Background","bg2",A,Se,re,ce),Ho("Secondary Text","tx2",A,Se,re,ce),Ho("Accent 1","accent1",A,Se,re,ce),Ho("Accent 2","accent2",A,Se,re,ce),Ho("Accent 3","accent3",A,Se,re,ce),Ho("Accent 4","accent4",A,Se,re,ce),Ho("Accent 5","accent5",A,Se,re,ce),Ho("Accent 6","accent6",A,Se,re,ce);const ie=$.ITheme.buildPalette(Se,A,re,ce),Y=[];if(Ho("Dark Red","C00000",A,Y,re,ce),Ho("Red","FF0000",A,Y,re,ce),Ho("Orange","FFC000",A,Y,re,ce),Ho("Yellow","FFFF00",A,Y,re,ce),Ho("Light Green","92D050",A,Y,re,ce),Ho("Green","00B050",A,Y,re,ce),Ho("Light Blue","00B0F0",A,Y,re,ce),Ho("Blue","0070C0",A,Y,re,ce),Ho("Dark Blue","002060",A,Y,re,ce),a?Ho("Purple Is A Fruit","7030A0",A,Y,re,ce):Ho("Transparent","00000000",A,Y,re,ce),b){const Te=b.toString();re.set(Te,b)}const le=new Map,ee=typeof r=="function"?r():r,Pe=[];for(let Te=0;ee&&Te<ee.length;Te++){const rt=ee[Te].toString();le.set(rt,ee[Te]),Pe.push({description:"Recent "+(Te+1),definition:{val:ee[Te].toString()}})}return{primaryColors:Se,modifiedPresets:ie,standardColors:Y,recentColorsLimited:Pe,mapAllPresets:re,mapAllPresetsRGB:ce,mapRecent:le}},[A,r,a,b]);u.useEffect(()=>{f?.()},[]);const[F,B]=u.useState(!1),M=u.useCallback(()=>{B(re=>!re)},[]);u.useEffect(()=>{if(c)B(c===AS.Custom);else if(n){let re=n.toString(),ce=D.mapAllPresets.get(re);ce||(re=n.toRGBA().toString(),ce=D.mapAllPresetsRGB.get(re));const Se=D.mapRecent.get(re);B(!ce&&!Se)}},[n,c]);const N=u.useCallback($.CommonUtils.debounce(re=>{T?.(re)},l),[T,l]),[V,U]=u.useState();u.useEffect(()=>{U(o||n)},[o,n]);const J=_e(re=>{j&&(j(re),N(re))},[j]),X=_e(re=>{J(re?new $.Color({val:re.definition.val,adjs:re.definition.adjs},A):null)},[A]),H=u.useCallback(re=>{re.ctrlKey&&B(!0)},[]),ne=_e(re=>{let ce=!1;if(re){const Se=re.toString();ce=!D.mapAllPresets.has(Se)}S?.(re,ce)},[S,D]),oe=_e(re=>{const ce=re?new $.Color({val:re.definition.val,adjs:re.definition.adjs},A):null;Promise.resolve(h?.()).then(()=>{ne(ce)})},[A,h]),ye=_e(re=>{J(re?new $.Color(re,A):null)},[A]),de=u.useMemo(()=>window.EyeDropper===void 0?s.jsx(s.Fragment,{}):s.jsx(Tr,{"aria-label":"eye dropper",size:"small",sx:{color:re=>re.palette.text.icon??re.palette.action.active},onClick:async()=>{I(!0),k?.(),await new EyeDropper().open().then(re=>{I(!1),P?.();let ce=new $.Color(re.sRGBHex),Se=ce.toString(),ie=D.mapAllPresets.get(Se);if(ie||(Se=ce.toRGBA().toString(),ie=D.mapAllPresetsRGB.get(Se)),!ie){const Y=ce.toRGBA(),le=3;let ee=255;D.mapAllPresetsRGB.forEach((Pe,Te)=>{const rt=Pe.toRGBA(),Ve=Math.abs(rt.red-Y.red)+Math.abs(rt.blue-Y.blue)+Math.abs(rt.green-Y.green);Ve<le&&Ve<ee&&(ie=Pe)})}B(!ie),J(ie||ce)}).catch(re=>{I(!1),re?.name!=="AbortError"&&console.error(re)})},children:s.jsx(rR,{})}),[D,R]),xe=u.useMemo(()=>{if(!F)return;const re={opacity:F?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:re,children:s.jsx(i0,{})}),children:s.jsx(qB,{style:re,selectedColor:L?L.toRGBA().toString():"transparent",onColorChange:ye,disableAlpha:a})})},[F,L]),we=u.useMemo(()=>({onClick:H,alphaGrey:z.palette.text.icon??z.palette.action.active}),[H,z]),ve=u.useMemo(()=>{if(!b)return null;const re={description:w,definition:{val:b.getVal(),adjs:b.getAdjustments()}};return s.jsx(s.Fragment,{children:s.jsxs(b1,{sx:{display:"flex",color:ce=>ce.palette.text.secondary},onMouseOver:()=>{X(null)},onClick:()=>{oe(null)},children:[s.jsx(Le,{sx:{flex:"none",boxShadow:ce=>ce.shadows[2],borderRadius:ce=>ce.spacing(.5),overflow:"hidden"},children:s.jsx(N2,{schemeColorLookup:A,colorDef:re,selectedColor:n===null?b:n,previewColor:o===null?b:o,defaultButtonSize:d,isLarge:!0,darkMode:R,compareRGB:C,swatchProps:we})}),s.jsx(Mn,{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(Le,{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:F?"0":1},children:[ve&&E===Is.Start?s.jsxs(s.Fragment,{children:[ve,s.jsx(va,{light:!0,style:{marginTop:"2px",marginBottom:"10px"}})]}):null,s.jsx(Md,{title:"Theme Colors",schemeColorLookup:A,colorDefs:D.primaryColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsx(Md,{schemeColorLookup:A,colorDefs:D.modifiedPresets,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsx(va,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Md,{title:"Standard Colors",schemeColorLookup:A,colorDefs:D.standardColors,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R}),s.jsxs("div",{style:{opacity:D.recentColorsLimited.length===0?"0":void 0,display:D.recentColorsLimited.length===0?"none":void 0},children:[s.jsx(va,{light:!0,style:{marginBottom:"10px"}}),s.jsx(Md,{title:"Recent Colors",schemeColorLookup:A,colorDefs:D.recentColorsLimited,selectedColor:n,previewColor:o===void 0?n:o,swatchProps:we,onPreviewColorDef:X,onSelectColorDef:oe,compareRGB:C,darkMode:R})]}),ve&&E===Is.End?s.jsxs(s.Fragment,{children:[s.jsx(va,{light:!0,sx:{marginTop:"2px",marginBottom:"2px"}}),ve,s.jsx("div",{style:{marginBottom:"2px"}})]}):null]}),xe]}),s.jsx(va,{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:[de,s.jsx("div",{style:{flex:"1 1 100%",background:"pink"}}),s.jsx(Lc,{style:{minWidth:"75px",maxWidth:"75px"},value:"check",variant:"outlined",size:"small",onClick:()=>{M()},children:s.jsx("div",F?{children:"Preset"}:{children:"Custom"})}),s.jsx(Lc,{variant:"contained",size:"small",style:{minWidth:"75px"},onClick:()=>{Promise.resolve(h?.()).then(()=>{ne(V)})},children:"Done"})]})]})})),KB=s.jsx(e=>{const{sx:t,...n}=e;return s.jsxs(Je,{sx:{overflow:"visible","& .activeColor":{filter:S1},...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=KB,tooltip:i,label:a,onPreviewColor:l,onPreviewColorImmediate:c,onSelectColor:d,variant:p=ji.Toolbar,panelProps:f,shouldCloseFloatAll:h=!0,compareRGB:g=!1,darkMode:m=!1,...y}=e,x=_e(l,[l]),v=_e(c,[c]),b=_e(d,[d]),[w,E]=u.useState(()=>{}),C=o||w||n||f?.autoColor,R=r,_=u.useRef(!1),L=u.useCallback(()=>{},[]),T=_e(()=>{E(n)},[n]),j=_e(F=>{_.current||(E(F),x?.(F))},[x]),S=_e(F=>{_.current||(E(F),v?.(F))},[v]),k=_e((F,B)=>{_.current||(E(void 0),b?.(F,B))},[b]),P=u.useMemo(()=>s.jsx(Le,{sx:{width:"24px",height:"24px",color:"inherit","--sxl-color-active":`${C?.toCSS(m)??"transparent"}`,"& .activeColor":{fill:`${C?.toCSS(m)??"transparent"}`},"& .style_grey":{fill:F=>F.palette.text.icon??F.palette.action.active}},children:R}),[C,R,m]),O=_e(F=>{b?.(o,!1)},[b,o]),[I,z]=u.useState(!1),A=u.useCallback(F=>{const{closeFloat:B,closeFloatAll:M}=F;return s.jsx(zS,{...f,selectedColor:n,previewColor:w,onDone:h?M:B,onKeyDown:N=>{N.which===tn.Enter&&(h?M():B())},onPreviewColorImmediate:S,onPreviewColor:j,onSelectColor:k,onEyeDropStart:()=>z(!0),onEyeDropStop:()=>z(!1),compareRGB:g,darkMode:m})},[n,w,h,C,f?.autoColor,m]),D={onQuickClick:o?O:void 0,createPopupPanel:A,popupProps:{popperProps:{resizeOnOverflow:!1}},onPopupOpen:T,onPopupClose:L,tooltip:i||a||"Color",label:a,icon:P,...y};return p===ji.Toolbar?s.jsx(Ui,{ref:t,...D}):s.jsx(C1,{ref:t,...D})})),ou=82,Wh=e=>{const{styleColor:t,length:n=ou,width:o=1,dashArray:r=null,sx:i,isDouble:a=!1,isAngled:l=!1,darkMode:c=!1,...d}=e;return s.jsx(Je,{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=_e(c,[]),m=u.useCallback(b=>{const{popupContainer:w,floatReference:E,closeFloat:C,...R}=b,_=[],L=$.IBorder.BuiltInDefinitionsArray;for(let T=0;T<L.length;T++){const j=L[T];if(j.description==="None"&&!d)continue;const S=s.jsx(Wh,{styleColor:a,length:ou,width:j.width,darkMode:p,dashArray:j.pattern,isDouble:j.description.toLowerCase().includes("double"),isAngled:j.description.toLowerCase().includes("slant")});let k=null;k=o?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{marginRight:"6px"},children:j.description}),s.jsxs(Le,{sx:{marginLeft:"6px",marginRight:"6px",display:"flex",alignItems:"center",flex:"1 1 100%"},children:[s.jsx("div",{style:{flex:"1 1 100%"}}),S]})]}):j.description==="None"?"None":S,_.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?"":j.description},icon:null,disabled:r,onMouseDown:P=>P.preventDefault(),onMouseUp:()=>{C(),g(j.style)},onKeyDown:P=>{P.which===tn.Enter&&C()},selected:j.style===l,parentFloat:E,children:k},T))}return s.jsx(Le,{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(Le,{sx:{minWidth:`${ou}px`},children:"None"}):s.jsx(Wh,{styleColor:a,length:ou,width:b.width,dashArray:b.pattern,darkMode:p,isDouble:b.description.toLowerCase().includes("double"),isAngled:b.description.toLowerCase().includes("slant")}),s.jsx(Le,{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===ji.Toolbar?s.jsx(Ui,{...v}):s.jsx(C1,{...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=_e(c,[c]),m=_e(d,[d]),[y,x]=u.useState(),[v,b]=u.useState(),w=y??r,E=v??n,C=p||{bottom:{style:r,color:n?.toString()}},R=_e(k=>{const P={},O=k?Object.keys(k):[];let I=!1;for(let V=0;V<O.length;V++)k[O[V]]?.style&&(P[O[V]]={style:k[O[V]].style,color:k[O[V]].color},I||P[O[V]].style===$.IBorder.StrokeStyle.None||(I=!0));O.length<6&&(I=!0);const z=I?P.left:null,A=I?P.top:null,D=I?P.right:null,F=I?P.bottom:null,B=I?P.vertical:null,M=I?P.horizontal:null;let N="";return A||z||(N+="M 3,5 H 5 V 3 H 3 "),A||(N+="M 7,5 H 9 V 3 H 7 "),A||B||(N+="M 11,5 h 2 V 3 h -2 "),A||(N+="M 15,5 h 2 V 3 h -2 "),A||D||(N+="M 19,5 h 2 V 3 h -2 "),z||(N+="M 3,9 H 5 V 7 H 3 "),B||(N+="M 11,9 h 2 V 7 h -2 "),D||(N+="M 19,9 h 2 V 7 h -2 "),M||z||(N+="M 3,13 H 5 V 11 H 3 "),M||(N+="M 7,13 H 9 V 11 H 7 "),M||B||(N+="M 11,13 h 2 v -2 h -2 "),M||D||(N+="M 19,13 h 2 v -2 h -2 "),M||(N+="M 15,13 h 2 v -2 h -2 "),z||(N+="M 3,17 H 5 V 15 H 3 "),B||(N+="M 11,17 h 2 v -2 h -2 "),D||(N+="M 19,17 h 2 v -2 h -2 "),F||z||(N+="M 3,21 H 5 V 19 H 3 "),F||(N+="M 7,21 H 9 V 19 H 7 "),F||B||(N+="M 11,21 h 2 v -2 h -2 "),F||(N+="M 15,21 h 2 v -2 h -2 "),F||D||(N+="M 19,21 h 2 v -2 h -2 "),s.jsxs("div",{style:{width:"24px",height:"24px",position:"relative"},children:[s.jsx(Je,{sx:{position:"absolute",top:"0px",left:"0px","& path":{opacity:"0.8",transform:"translate(-0.5px, -0.5px)"}},children:s.jsx("path",{d:N})}),s.jsx(Le,{sx:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"-1px",left:"-1px","& svg path":{filter:S1}},children:s.jsx(ff,{getBorderAt:(V,U)=>{if(!f||O.length===0)return null;const J=V.rowIndex,X=V.colIndex,H={};return J===0?(H.top=P.top,H.bottom=P.horizontal):(H.top=P.horizontal,H.bottom=P.bottom),X===0?(H.left=P.left,H.right=P.vertical):(H.left=P.vertical,H.right=P.right),f?.(H)},width:18,height:18,darkMode:a,style:{top:"0px",left:"0px",width:"18px",height:"18px",minWidth:"18px",minHeight:"18px",position:"relative"}})})]})},[E,w,a]),_=u.useCallback((k,P,O)=>{let I=null;if(k&&k.length>0){let z=null;(P||O)&&(z={style:O,color:P?.toString()??null}),I={};for(let A=0;A<k.length;A++)I[k[A]]=z}return I},[]),L=u.useCallback(k=>{g?.(k)},[]),T=u.useCallback(k=>{m?.(k)},[]),j=u.useCallback(k=>{const{closeFloatAll:P,floatReference:O}=k,I=(D,F,B="bottom",M=!1)=>{const N=_(D,E??null,M?$.IBorder.StrokeStyle.None:w??null),V=M?_([],E??null,w??null):N;return s.jsx(ii,{icon:R(V),sx:{background:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},tooltipProps:{label:F,simple:!0,placement:B},onClick:()=>{P(),T(N),L(N)}})},z=s.jsxs(s.Fragment,{children:[s.jsxs(Le,{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(Le,{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(Le,{sx:{display:"flex",padding:"6px 16px",flexDirection:"row",gap:"6px"},children:[s.jsx(Cf,{variant:ji.Toolbar,icon:s.jsx(N3,{}),selectedColor:w===$.IBorder.StrokeStyle.None?new $.Color("transparent"):E,onPreviewColor:D=>{b(D)},onSelectColor:(D,F)=>{b(D)},darkMode:a,tooltip:"Border Color",panelProps:{disableAlpha:!0,autoColor:n,schemeLookup:o},disabled:i||w===$.IBorder.StrokeStyle.None,parentFloat:O,shouldCloseFloatAll:!1}),s.jsx(FS,{selectedStyle:w,onSelectStyle:x,styleColor:E,darkMode:a,variant:ji.Toolbar,parentFloat:O})]})});return s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",paddingTop:"4px",paddingBottom:"4px"},onClick:D=>D.stopPropagation(),children:[l?A:z,s.jsx(Ft,{orientation:"horizontal"}),l?z:A]})},[w,E,n,o,a]),S=u.useMemo(()=>R(C),[C,a]);return s.jsx(Ui,{ref:t,createPopupPanel:j,popupProps:{popperProps:{resizeOnOverflow:!1}},createTooltip:({children:k},P)=>s.jsx(br,{label:"Borders",description:"Set the borders.",disabled:P,children:k}),onQuickClick:()=>{g?.(C)},quickButtonProps:{sx:{}},disabled:i,icon:S,...h})})),NS=u.memo(u.forwardRef((e,t)=>{const{commands:n,command:o,commandHook:r,variant:i=Yt.Toolbar,disabled:a=!1,autoColor:l,autoStrokeStyle:c,schemeLookup:d,createTemporaryBorder:p,selectedBorder:f,onSelectBorder:h,darkMode:g,...m}=e,y=_o(n,["formatBorder"]),x=o??y[0],v=x?.context()??null,b=v?.autoColor??l,w=v?.autoStyle??c,E=f??v?.quickBorder,C=g??v?.darkMode,R=p??v?.createTemporaryBorder,_=d??v?.schemeLookup,L=_e(j=>{v?.onBorderSelect&&v.onBorderSelect(j),h?.(j),x?.execute(j,r)},[x,h,r]),T=u.useCallback((j,S)=>{const{children:k,title:P,...O}=j;let I=j.children;return(x?.disabled()||a)&&(I=s.jsx("div",{children:I})),s.jsx(a0,{command:x,placement:i===Yt.Toolbar?"bottom-start":"right-start",disabled:S,...O,children:I})},[x,a]);return s.jsx(BS,{ref:t,autoColor:b,darkMode:C,autoStrokeStyle:w,createTemporaryBorder:R,schemeLookup:_,selectedBorder:E,onSelectBorder:L,createTooltip:T,disabled:a||!x||x.disabled(),...m})})),$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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("mergeToggle"),icon:ze(s.jsx(k7,{}))}),s.jsx(qe,{...p,command:d.getCommand("mergeHorizontal"),icon:ze(s.jsx(MP,{}))}),s.jsx(qe,{...p,command:d.getCommand("mergeVertical"),icon:ze(s.jsx(TP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("freezeToggle"),icon:ze(s.jsx(IP,{}))}),s.jsx(qe,{...p,command:d.getCommand("freezeToggleHorizontal"),icon:ze(s.jsx(jP,{}))}),s.jsx(qe,{...p,command:d.getCommand("freezeToggleVertical"),icon:ze(s.jsx(RP,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...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(_P,{}),...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:Yt.Menuitem,commandHook:o,scope:r,disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("find"),icon:ze(s.jsx(q7,{}))}),s.jsx(qe,{...p,command:d.getCommand("findReplace"),icon:ze(s.jsx(av,{}))}),s.jsx(qe,{...p,command:d.getCommand("goto"),icon:ze(s.jsx(YO,{}))})]});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=$z.DefaultFontSizes,disabled:l=!1,parentFloat:c,sx:d,...p}=e;ol(n);const f=()=>n?.state()?.toString()||"11",[h,g]=u.useState(f),m=_e(()=>{const R=parseFloat(h);isNaN(R)?g(f()):parseFloat(f())!==R&&n.execute(R,o)},[f,n,h,o]);u.useEffect(()=>{g(f())},[n?.state()]);const y=u.useMemo(()=>{if(!o)return null;const R={...o};return delete R.beforeExecute,R},[o]),x=_o(i,["formatFontSizeIncrease","formatFontSizeDecrease"]),v=u.useMemo(()=>x?s.jsxs(Le,{className:Eo("quick-buttons",{}),sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:R=>R.stopPropagation(),children:[s.jsx(qe,{command:x[0],commandHook:y,icon:ze(s.jsx(AO,{}))}),s.jsx(qe,{command:x[1],icon:ze(s.jsx(LO,{}))})]}):null,[x]),b=qi(),w=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("12.3",Math.round(b.typography.fontSize),b.typography.fontFamily).width}px`,[b]),E=u.useCallback(R=>{const{onMouseDown:_,onMouseUp:L,...T}=R;return s.jsx(Tr,{component:"div",...T,disableRipple:!0,children:s.jsx(ql,{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:j=>`1px solid ${j.palette.text.icon??j.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:j=>`1px solid ${j.palette.error.main}`},"::after":{borderBottom:j=>`1px solid ${j.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:j=>`${Math.round(j.typography.fontSize)}px`,width:w,color:j=>j.palette.text.secondary,input:{padding:"0 0",textAlign:"center",MozAppearance:"textfield","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:j=>j.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:j=>j.palette.text.primary}},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:"0"},minHeight:"24px"},value:h,onFocus:j=>{j.target?.select()},onKeyDown:j=>{if(j.which===tn.Enter)f()!==h&&(j.stopPropagation(),j.preventDefault(),m());else if(j.which===tn.Escape)f()!==h&&(g(f()),setTimeout(()=>{j.target?.select()},0),j.stopPropagation(),j.preventDefault());else{if(j.key.match("[-]")||j.key.match("[0-9.]")&&(h+j.key).length>4)return j.stopPropagation(),void j.preventDefault();if(j.which===tn.Space)return void j.preventDefault()}},onBlur:()=>{m()},onChange:j=>{if(j.target.value.length>4)return j.stopPropagation(),void j.preventDefault();g(j.target.value)}})})},[h,l,n]),C=u.useCallback(R=>{const _=S=>{n?.execute(S,o)},L=n?.state(),T=[];for(let S=0;S<a.length;S++){const k=a[S]===L;T.push(s.jsx(Gr,{selected:k,icon:k?s.jsx(k1,{}):void 0,disabled:l||!n||n.disabled(),onMouseDown:P=>{P.button===0&&P.preventDefault()},onMouseUp:P=>{P.button===0&&_(a[S])},onKeyDown:P=>{P.keyCode!==tn.Enter&&P.keyCode!==tn.Space||_(a[S])},sx:{paddingTop:"4px",paddingBottom:"4px"},children:s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",justifyContent:"end"},children:a[S]})},"fontSize-"+S))}const j=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[v,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:T})]});return Bn({...R,children:j})},[l,n?.state(),o]);return s.jsx(Ui,{ref:t,sx:{...d},tabIndex:-1,outlined:!0,disabled:l,parentFloat:c,createPopupPanel:C,createTooltip:({children:R},_)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:_||n?.disabled(),children:R}),createQuickButton:E,...p})})),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(k1,{}):void 0,onMouseDown:c=>{c.button===0&&c.preventDefault()},onMouseUp:c=>{c.button===0&&r(i.numberFormat)},onKeyDown:c=>{c.keyCode!==tn.Enter&&c.keyCode!==tn.Space||r(i.numberFormat)},...l,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsxs(Mn,{component:"div",children:[i.formatType,i.formatType===$.NumberFormat.Type.Custom?"…":""]}),s.jsx(Mn,{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=j=>{o?.beforeExecute?.(d,d?.state()),d.execute(j,o),o?.onExecute?.(d,d?.state())},b=d?.context()(),w=$.NumberFormat.Styles.lookupPrimary(),E=[];for(let j=0;j<w.length;j++){let S="";if(b&&!b.isEmpty())try{S=b.getNumberFormat(w[j].numberFormat).displayText}catch(P){console.warn(P)}S===""&&w[j].formatType===$.NumberFormat.Type.General&&(S="No specific format");const k=w[j].formatType===p;E.push(s.jsx(Fg,{selected:k,disabled:a||!d||d.disabled(),formattedValue:S,handleSetFormat:v,format:w[j]},w[j].formatType))}const C={numberFormat:"",formatType:$.NumberFormat.Type.Custom},R=p===$.NumberFormat.Type.Custom,_=s.jsx(Fg,{selected:R,disabled:a||!d||d.disabled(),formattedValue:R?b.getNumberFormat().displayText:"",handleSetFormat:()=>{o?.beforeExecute?.(d,d?.state()),x.getCommand("formatNumberDialog")?.execute(d?.state()),o?.onExecute?.(d,d?.state())},format:C,sx:{flex:"0",width:"100%"}},$.NumberFormat.Type.Custom),L=s.jsxs(Le,{className:"quick-buttons",sx:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:j=>j.stopPropagation(),children:[s.jsx(qe,{command:x.getCommand("formatNumberFormatAccountingStyle"),commandHook:f,scope:r,icon:s.jsx(LP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatPercentStyle"),commandHook:f,scope:r,icon:s.jsx(OP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatCommaStyle"),commandHook:f,scope:r,icon:s.jsx(PP,{})}),s.jsx(qe,{command:x.getCommand("formatNumberFormatIncreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(DP,{}))}),s.jsx(qe,{command:x.getCommand("formatNumberFormatDecreaseDecimal"),commandHook:f,scope:r,icon:ze(s.jsx(AP,{}))})]}),T=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...c,children:[L,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:E}),s.jsx(Ft,{orientation:"horizontal"}),_]});return Bn({...y,children:T})},[d?.context(),d?.state(),o,r]),g=qi(),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(Le,{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(Le,{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:Yt.Menuitem,commandHook:o,scope:"clear",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("clearAll"),icon:s.jsx(Y4,{})}),s.jsx(qe,{...p,command:d.getCommand("clearFormats"),icon:ze(s.jsx(_b,{}))}),s.jsx(qe,{...p,command:d.getCommand("clearContents"),icon:ze(s.jsx(OI,{}))}),s.jsx(qe,{...p,command:d.getCommand("clearComments")}),s.jsx(qe,{...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:Yt.Menuitem,commandHook:o,scope:"fill",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("fillDown"),icon:ze(s.jsx(I0,{}))}),s.jsx(qe,{...p,command:d.getCommand("fillRight"),icon:ze(s.jsx(I0,{sx:{transform:"rotate(270deg)"}}))}),s.jsx(qe,{...p,command:d.getCommand("fillUp"),icon:ze(s.jsx(I0,{sx:{transform:"rotate(180deg)"}}))}),s.jsx(qe,{...p,command:d.getCommand("fillLeft"),icon:ze(s.jsx(I0,{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(I0,{})),...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=Yt.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===Yt.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(jO,{}))),v.set("insertColumns",ze(s.jsx(D7,{}))),v},[]),x=u.useCallback((v,b)=>{let w=null;const E={variant:Yt.Menuitem,commandHook:o,scope:"insertCells",disabled:i};a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:b.getCommand("addSheet"),icon:ze(s.jsx(Hs,{}))})]}));const C=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...E,command:h[0],icon:y.get(f[0])}),s.jsx(qe,{...E,command:h[1],icon:y.get(f[1])}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:h[2],icon:y.get(f[2])}),s.jsx(qe,{...E,command:h[3],icon:y.get(f[3])}),w]});return Bn({...v,children:C})},[i,h,o,r,y]);return g?s.jsx(qe,{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=Yt.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===Yt.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(RO,{}))),x.set("deleteColumns",ze(s.jsx(L7,{}))),x},[]),y=u.useCallback((x,v)=>{const b={variant:Yt.Menuitem,commandHook:o,scope:"deleteCells",disabled:i};let w=null;a||(w=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...b,command:v.getCommand("deleteSheet"),icon:ze(s.jsx(Hs,{}))})]}));const E=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...b,command:v.getCommand("deleteCellsShiftUp"),icon:m.get("deleteCellsShiftUp")}),s.jsx(qe,{...b,command:v.getCommand("deleteCellsShiftLeft"),icon:m.get("deleteCellsShiftLeft")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...b,command:v.getCommand("deleteRows"),icon:m.get("deleteRows")}),s.jsx(qe,{...b,command:v.getCommand("deleteColumns"),icon:m.get("deleteColumns")}),w]});return Bn({...x,children:E})},[i,o,r,m]);return h?s.jsx(qe,{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})})),Ys=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,onSelectColor:r,disabled:i=!1,variant:a=Yt.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");ol(n);const v=n?.context();let b=l??v?.quickColor;d&&!b&&(b=new $.Color("transparent"));const w=g??v?.autoColor,E=m??v?.schemeLookup,C=y??v?.recentColors,R=p??v?.darkMode,_=u.useMemo(()=>({autoColor:w,schemeLookup:E,recentColors:C,darkMode:R,...x}),[w,E,C,R]),L=_e((j,S)=>{j&&S&&v?.addRecentColor&&v.addRecentColor(j),v?.onColorSelect&&v.onColorSelect(j),r?.(j,S),n?.execute(j,o)},[n,r,o,v]),T=u.useCallback((j,S)=>{const{children:k,title:P,...O}=j;let I=j.children;return(n?.disabled()||i)&&(I=s.jsx("div",{children:I})),s.jsx(a0,{command:n,placement:a===Yt.Toolbar?"bottom-start":"right-start",disabled:S,...O,children:I})},[n,i]);return s.jsx(Cf,{ref:t,panelProps:_,icon:f,quickColor:b,selectedColor:n?.state(),onSelectColor:L,variant:a===Yt.Menuitem?ji.Menuitem:ji.Toolbar,createTooltip:T,label:n?.label(),disabled:i||!n||n.disabled(),compareRGB:!0,darkMode:R,...h})}));Ys.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:Yt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...h,command:f.getCommand("gridlinesToggle")}),s.jsx(Ys,{...h,command:f.getCommand("sheetViewFormatGridlinesColor"),icon:s.jsx(N3,{}),panelProps:{disableAlpha:!0}}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleGridlinesColumns")}),s.jsx(qe,{...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(Gs,{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:Yt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=d.getCommand("sortCustom"),h=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:d.getCommand("sortAscending"),icon:ze(s.jsx(uh,{}))}),s.jsx(qe,{...p,command:d.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),f?s.jsx(qe,{...p,command:f,icon:ze(s.jsx(DO,{}))}):null,s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(oh,{}))}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),s.jsx(qe,{...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(uh,{})),...a})})),GB=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:Yt.Menuitem,commandHook:o,scope:"sort",disabled:i},f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterToggle"),icon:ze(s.jsx(oh,{}))}),s.jsx(qe,{...p,scope:"filter",command:d.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),s.jsx(qe,{...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(oh,{})),...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),E=u.useCallback((C,R)=>{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)},j=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!==tn.Enter&&I.keyCode!==tn.Space||T(b)},children:s.jsx(Mn,{component:"div",variant:"caption",sx:{fontSize:"0.875rem",letterSpacing:"0.01071em"},children:_})});if(L)return j;const S=r?x?.getRedoDescriptions():x?.getUndoDescriptions(),k=[];for(let I=0;I<S.length;I++){const z=S[I];k.push(s.jsx(Gr,{sx:{maxWidth:"360px",display:"flex"},icon:s.jsx(Hs,{}),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!==tn.Enter&&A.keyCode!==tn.Space||T(I+1)},children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"row",alignItems:"center",overflow:"hidden"},children:[s.jsx(Mn,{component:"div",children:z}),s.jsx(Hs,{})]})},`action:${I}`))}let P=null;if(!r&&i){const I={scope:"undo",commands:R,variant:Yt.Menuitem,parentFloat:C.floatReference};P=[],P.push(s.jsx(_f,{...I,quickCommand:"redo",isRedo:!0},"nested:redo")),x.hasRedo()&&x.hasUndo()&&P.push(s.jsx(Ft,{orientation:"horizontal"},"action:redo-div"))}const O=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},onClick:()=>{C.closeFloatAll()},onMouseLeave:()=>{w(0)},children:[P,s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:k}),s.jsx(Ft,{orientation:"horizontal"}),j]});return Bn({...C,children:O})},[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:E,icon:o??ze(s.jsx(r?vD:bD,{})),selected:!1,...f})})),Ps=$.IFontCollection.getFontList(),GS=new Map;for(let e=0;e<Ps.length;e++)GS.set(Ps[e].fontRef.getFamily(),Ps[e]);const ZS=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,sx:r,disabled:i=!1,parentFloat:a,...l}=e;ol(n);const c=n?.state(),d=qi(),p=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("Times New Roman",Math.round(d.typography.fontSize),d.typography.fontFamily).width}px`,[d]),f=u.useCallback(h=>{const g=v=>{n?.execute(v,o)},m=[];for(let v=0;v<Ps.length;v++)m.push({key:Ps[v].fontRef.getFamily(),description:Ps[v].fontRef.getFamily()});GS.get(c)||m.unshift({key:c,description:c});const y=[];for(let v=0;v<m.length;v++){const b=m[v].key===c;y.push(s.jsx(Gr,{sx:{display:"flex",paddingTop:"4px",paddingBottom:"4px"},selected:b,disabled:i||!n||n.disabled(),icon:b?s.jsx(k1,{}):void 0,onMouseUp:w=>{w.button===0&&g(m[v].key)},onMouseDown:w=>{w.button===0&&w.preventDefault()},onKeyDown:w=>{w.keyCode!==tn.Enter&&w.keyCode!==tn.Space||g(m[v].key)},children:s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:s.jsx(Mn,{component:"div",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:()=>m[v]?.key},children:m[v].description})})},v+""+m[v].key))}const x=s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},...l,children:s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:y})});return Bn({...h,children:x})},[i,n?.state()]);return s.jsx(Ui,{ref:t,sx:{...r},outlined:!0,disabled:i,parentFloat:a,createPopupPanel:f,createTooltip:({children:h},g)=>s.jsx(br,{label:n?.label(),description:n?.description(),disabled:g,children:h}),icon:s.jsx(Le,{sx:{display:"flex",paddingLeft:"4px",paddingRight:"4px",fontSize:h=>`${Math.round(h.typography.fontSize)}px`,fontFamily:h=>h.typography.fontFamily,color:h=>h.palette.text.secondary,width:p},children:s.jsx(Le,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre"},children:c})}),...l})})),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(zO,{}))),f.set("formatSubscriptToggle",ze(s.jsx(FO,{}))),f},[]),p=u.useCallback((f,h)=>{const g={variant:Yt.Menuitem,commandHook:o,scope:"textEffects",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatStrikeThroughToggle"),icon:d.get("formatStrikeThroughToggle")}),s.jsx(qe,{...g,command:h.getCommand("formatSuperscriptToggle"),icon:d.get("formatSuperscriptToggle")}),s.jsx(qe,{...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(Ip,{}))),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:Yt.Menuitem,commandHook:o,scope:"underline",disabled:i},m=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedToggle"),icon:ze(s.jsx(Ip,{}))}),s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedDoubleToggle"),icon:ze(s.jsx(F7,{}))}),s.jsx(qe,{...g,command:h.getCommand("formatUnderlinedAccountingToggle"),commandHook:o,icon:ze(s.jsx(B7,{}))}),s.jsx(qe,{...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(Ip,{})),...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=_e((p,f)=>{const h={variant:Yt.Menuitem,commandHook:r,scope:"paste",disabled:l},g=[];return a&&(g.push(u.createElement(qe,{...h,command:f.getCommand("paste"),key:"paste",icon:s.jsx(P7,{})})),g.push(s.jsx(Ft,{orientation:"horizontal"},"paste-div"))),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteValues"),key:"pasteValues",icon:ze(s.jsx(vO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteFormats"),key:"pasteFormats",icon:ze(s.jsx(wO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteFormulas"),key:"pasteFormulas",icon:ze(s.jsx(SO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteTranspose"),key:"pasteTranspose",icon:ze(s.jsx(CO,{}))})),g.push(u.createElement(qe,{...h,command:f.getCommand("pasteLinks"),key:"pasteLinks",icon:ze(s.jsx(kO,{}))})),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:Yt.Menuitem,parentFloat:p.floatReference,commandHook:o,scope:r,disabled:i},g=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadings")}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadingsNumeric")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...h,command:f.getCommand("sheetViewToggleShowHeadingColumns")}),s.jsx(qe,{...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(Gs,{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:Yt.Menuitem,parentFloat:c.floatReference,commandHook:o,scope:r,disabled:i},p=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowFormulaBar")}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowTabs")}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowStatusBar")}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...d,command:n.getCommand("workbookViewToggleShowHorizontalScrollBar")}),s.jsx(qe,{...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(Gs,{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(Le,{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(Le,{className:"fill",sx:{paddingLeft:"4px",paddingRight:"4px",marginLeft:"-1px",marginTop:"-1px",marginRight:"-1px",marginBottom:"-1px",overflow:"hidden",display:"flex",alignItems:"center"},children:s.jsx(Le,{className:"text",children:n})})})})})),ZB=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:Yt.Menuitem,commandHook:f,context:"cellStyle"},b=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...v,sx:{fontWeight:550},command:d.getCommand("formatCellStyle"),commandState:n,disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...v,command:d.getCommand("modifyCellStyle"),commandState:{named:n}}),s.jsx(qe,{...v,command:d.getCommand("deleteCellStyle"),commandState:n,disabled:p||n?.getName()===$.IStyle.BuiltInName.Normal})]});return Bn({...x,children:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Le,{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;ol(o);const f=o?.context(),h=f?.styles,g=i??f?.named(),m=c??f?.bodyStyle(),y=_e(E=>{a?.(E),o?.execute(E,r)},[o,a,r]),x=u.useCallback((E,C)=>{const R={onSelectNamed:y,styles:h(),parentFloat:E.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 j=A=>{let D=L.get(A);return D||(D=h().getNamed(A)),!D||D.isHidden()?null:s.jsx(ZB,{namedStyle:D,selectedNamed:g,bodyStyle:f.bodyStyle(),createTemporaryCell:f.createTemporaryCell,commands:n,commandHook:r,...R},A)},S=(A,D,F=!0)=>{const B=[];for(let M=0;M<D.length;M++){const N=j(D[M]);N&&B.push(N)}return B.length===0?null:s.jsxs(Le,{children:[F?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(qs,{children:A},A+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"646px",maxWidth:"100%"},children:B},A+"-presets")]},A)},k=(A,D)=>{const F=[];for(let B=0;B<D.length;B++){const M=j(D[B]);M&&F.push(M)}return F.length===0?null:s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",flexDirection:"column",flex:"0 0 0%"},children:F},A+"-presets")},P=[];P.push(S("Custom",T,!1)),P.push(S("Good, Bad and Neutral",[$.IStyle.BuiltInName.Normal,$.IStyle.BuiltInName.Bad,$.IStyle.BuiltInName.Good,$.IStyle.BuiltInName.Neutral],T.length>0)),P.push(S("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])),P.push(S("Titles and Headings",[$.IStyle.BuiltInName.Heading1,$.IStyle.BuiltInName.Heading2,$.IStyle.BuiltInName.Heading3,$.IStyle.BuiltInName.Heading4,$.IStyle.BuiltInName.Title,$.IStyle.BuiltInName.Total]));let O=[];var I,z;return O.push(k("Accent 1",[$.IStyle.BuiltInName.Accent1_20,$.IStyle.BuiltInName.Accent1_40,$.IStyle.BuiltInName.Accent1_60,$.IStyle.BuiltInName.Accent1])),O.push(k("Accent 2",[$.IStyle.BuiltInName.Accent2_20,$.IStyle.BuiltInName.Accent2_40,$.IStyle.BuiltInName.Accent2_60,$.IStyle.BuiltInName.Accent2])),O.push(k("Accent 3",[$.IStyle.BuiltInName.Accent3_20,$.IStyle.BuiltInName.Accent3_40,$.IStyle.BuiltInName.Accent3_60,$.IStyle.BuiltInName.Accent3])),O.push(k("Accent 4",[$.IStyle.BuiltInName.Accent4_20,$.IStyle.BuiltInName.Accent4_40,$.IStyle.BuiltInName.Accent4_60,$.IStyle.BuiltInName.Accent4])),O.push(k("Accent 5",[$.IStyle.BuiltInName.Accent5_20,$.IStyle.BuiltInName.Accent5_40,$.IStyle.BuiltInName.Accent5_60,$.IStyle.BuiltInName.Accent5])),O.push(k("Accent 6",[$.IStyle.BuiltInName.Accent6_20,$.IStyle.BuiltInName.Accent6_40,$.IStyle.BuiltInName.Accent6_60,$.IStyle.BuiltInName.Accent6])),P.push((I="Themed Cell Styles",z=O,s.jsxs(Le,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qs,{children:I},I+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",flexWrap:"wrap",alignItems:"start",flexDirection:"row"},children:z},I+"-presets")]},I))),P.push(S("Number Format",[$.IStyle.BuiltInName.Comma,$.IStyle.BuiltInName.Comma0,$.IStyle.BuiltInName.Currency,$.IStyle.BuiltInName.Currency0,$.IStyle.BuiltInName.Percent])),s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:A=>`${A.shape.borderRadius}px`,paddingBottom:A=>`${A.shape.borderRadius}px`},children:[s.jsx(Le,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",paddingTop:"6px",paddingBottom:"0px",paddingLeft:"16px",paddingRight:"16px"},children:P}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{variant:Yt.Menuitem,commandState:g,command:C.getCommand("newCellStyle"),context:"styles",commandHook:r,disabled:l,icon:ze(s.jsx(VO,{}))})]})},[g,h?.().getTheme(),m]),v=_e(E=>{const C=18/$.IFont.getDeviceScale(),R=f?.createTemporaryCell(E);return R.getStyle().getFont().getSize()<=C?R:R.createTemporaryCell({style:{font:{size:C}}})},[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:E=>`1px solid ${E.palette.action.hover}`},borderProps:{}}):ze(s.jsx(Kc,{})),[g,m,b]);return s.jsx(Xn,{ref:t,createPopupPanel:x,outlined:d,commands:n,createTooltip:({children:E},C)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:C,children:E}),selected:!1,disabled:b,label:o?.label(),icon:w,...p})})),nC="_sheetxl-reset_ods65_1",XB=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=XB,isLive:f=!1,...h}=e,g=Math.ceil(1.3*p),[m,y]=u.useReducer(E=>E+1,0);u.useEffect(()=>{if(f&&o)return o.addListeners({onAnyChange:()=>{y()}})},[o,f]);const x=u.useMemo(()=>{let E=o?.toJSON()??{};const C={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return E&&(E.styleOptions={...E.styleOptions,name:r.getName()}),E.ref=C,new $.Table({initialAnchor:C,json:E,styles:n})},[m,o,r,n]),v=u.useMemo(()=>{const E=[];for(let C=0;C<5;C++)for(let R=0;R<5;R++){const _=x.getStyleAt({colIndex:R,rowIndex:C});E.push(_)}return E},[x]),b=u.useMemo(()=>{const E=(R,_,L)=>{let T=L.getFill().toCSS(i?.darkMode??!1);const j=g-(_<4?1:0),S=p-(R<4?1:0),k=L.getFont().getFill().toCSS(i?.darkMode??!1);return T={...T,position:"absolute",boxSizing:"border-box",left:_*(g-1),top:R*(p-1),width:j,height:S},s.jsx("td",{className:`table-style-fill ${R}-${_}`,style:T,children:s.jsx("div",{className:`table-style-text ${R}-${_}`,style:{position:"absolute",boxSizing:"border-box",width:"6px",left:(j-6)/2,top:(S-1)/2,borderTop:`1px solid ${k}`}})},`${R}-${_}`)},C=[];for(let R=0;R<5;R++){const _=[];for(let L=0;L<5;L++){const T=v[5*R+L];_.push(E(R,L,T))}C.push(s.jsx("tr",{children:_},R))}return C},[x,r,i]),w=u.useCallback((E,C)=>v[C].getBorder()??null,[v]);return s.jsx(Le,{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})})})})})),$0=(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 E=h[5*b+w].getFill();let C=i?.fill;E.getType()===$.IFill.Type.Solid?C=E.getColor().toCSS(v,!1):E.getType()===$.IFill.Type.Gradient?C=E.getStops[0]?.color.toCSS(v,!1):E.getType()===$.IFill.Type.Pattern&&(C=E.getForeground().toCSS(v,!1)),y.fillStyle=C;const R=w*x,_=9*b;y.fillRect(R,_,13,10)}y.lineWidth=1;for(let b=0;b<5;b++)for(let w=0;w<5;w++){const E=h[5*b+w],C=w*x,R=9*b,_=E.getBorder();if(!_.isEmpty()){const j=_.getLeft();j.isNone()||(y.strokeStyle=j.getColor().toCSS(v,!1),$0(y,C,R,C,R+9));const S=_.getTop();S.isNone()||(y.strokeStyle=S.getColor().toCSS(v,!1),$0(y,C,R,C+x,9*b));const k=_.getRight();k.isNone()||(y.strokeStyle=k.getColor().toCSS(v,!1),$0(y,C+x,R,C+x,R+9));const P=_.getBottom();P.isNone()||(y.strokeStyle=P.getColor().toCSS(v,!1),$0(y,C,R+9,C+x,R+9))}y.strokeStyle=E.getFont().getFill().toCSS(v,!1);const L=4,T=2.5;$0(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(Le,{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(Na,{control:s.jsx(Ba,{checked:r??!1,indeterminate:r==null,onChange:()=>i(!r),disabled:f||r==null}),label:"Header Row",labelPlacement:"end"}),l&&s.jsx(Na,{control:s.jsx(Ba,{checked:a??!1,indeterminate:a==null,onChange:()=>l(!a),disabled:f||a==null}),label:"Total Row",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showRowStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showRowStripes:!n?.showRowStripes})}}),label:"Banded Rows",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showFirstColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showFirstColumn:!n?.showFirstColumn})}}),label:"First Column",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showLastColumn??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showLastColumn:!n?.showLastColumn})}}),label:"Last Column",labelPlacement:"end"}),s.jsx(Na,{control:s.jsx(Ba,{checked:n?.showColumnStripes??!1,indeterminate:!n,disabled:f||!n,onChange:()=>{o?.({...n,showColumnStripes:!n?.showColumnStripes})}}),label:"Banded Columns",labelPlacement:"end"}),d&&s.jsx(Na,{control:s.jsx(Ba,{checked:c??!1,indeterminate:c==null,disabled:f||!n||c==null,onChange:()=>d(!c)}),label:"Filter Button",labelPlacement:"end"})]})})),YB=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 E={variant:Yt.Menuitem,commandHook:f,context:"table"},C=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...E,command:d.getCommand("formatTableStyleClearCellStyles"),commandState:n,disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(qe,{...E,sx:{fontWeight:550},command:d.getCommand("formatTableStyle"),commandState:{name:n.getName()},disabled:p,icon:ze(s.jsx(Kc,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:d.getCommand("setDefaultTableStyle"),commandState:n.getName(),disabled:p}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...E,command:d.getCommand("deleteTableStyle"),commandState:n?.getName(),disabled:p||!n||n.isBuiltIn()})]});return Bn({...w,children:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:C})})})},[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;ol(o);const f=o?.context(),h=f?.styles,g=i??f?.table?.();let m="insertTable";g&&(m="editTable");const y=u.useMemo(()=>((T,j)=>{const S={rowStart:0,colStart:0,rowEnd:4,colEnd:4};return new $.Table({initialAnchor:S,styles:j,json:{name:"PreviewTable",ref:S,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(),E=_e(T=>{a?.(T),o?.execute({name:T},r)},[o,a,r]),C=u.useRef(null),R=u.useCallback((T,j)=>{const S={onSelectTableStyleName:E,styles:h(),parentFloat:T.floatReference};C.current||(C.current=document.createElement("canvas"));const k=M=>{const N=h().getTableStyle(M);return N?s.jsx(YB,{table:v,tableStyle:N,selectedTableStyleName:v.getStyleOptions().name,bodyStyle:f.bodyStyle(),commands:j,commandHook:r,canvas:C.current,...S},M):null},P=(M,N,V=!0)=>{const U=[];for(let J=0;J<N.length;J++){const X=k(N[J]);X&&U.push(X)}return U.length===0?null:s.jsxs(Le,{children:[V?s.jsx(Ft,{orientation:"horizontal"}):null,s.jsx(qs,{children:M},M+"-header"),s.jsx(Le,{sx:{display:"flex",gap:"2px",marginBottom:"6px",flexWrap:"wrap",width:"481px",maxWidth:"100%"},children:U},M+"-presets")]},M)},O=[],I=h().getCustomTableStyles(),z=[];if(I.length>0){for(let M=0;M<I.length;M++)I[M].isShownInTableStyles()&&z.push(I[M].getName());O.push(P("Custom",z,!1))}const A=[];g&&!g.getStyleOptions().name&&A.push(null);for(let M=0;M<21;M++)A.push("TableStyleLight"+(M+1));O.push(P("Light",A,z.length>0));const D=[];for(let M=0;M<28;M++)D.push("TableStyleMedium"+(M+1));O.push(P("Medium",D));const F=[];for(let M=0;M<11;M++)F.push("TableStyleDark"+(M+1));O.push(P("Dark",F));let B=null;return g&&(B=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{variant:Yt.Menuitem,command:j.getCommand("formatTableStyleClearTableStyle"),commandHook:r,disabled:l,icon:ze(s.jsx(_b,{}))})]})),s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",paddingTop:M=>`${M.shape.borderRadius}px`,paddingBottom:M=>`${M.shape.borderRadius}px`},children:[s.jsx(Le,{onContextMenu:()=>{},sx:{display:"flex",flexDirection:"column",padding:"6px 16px"},children:O}),B]})},[h,h?.().getTheme(),w,v]),_=l||!o||o.disabled(),L=u.useMemo(()=>{if(!f||!d)return ze(s.jsx(Kc,{}))},[v,w,_]);return s.jsx(Xn,{ref:t,quickCommand:m,createPopupPanel:R,commands:n,label:o?.label(),commandState:g,commandHook:r,selected:g!==null,createTooltip:({children:T},j)=>s.jsx(br,{label:o?.label(),description:o?.description(),disabled:j,children:T}),disabled:_,icon:L,...p})})),mi=[];mi.push(Fi("Primary Background","bg1")),mi.push(Fi("Primary Text","tx1")),mi.push(Fi("Secondary Background","bg2")),mi.push(Fi("Secondary Text","tx2")),mi.push(Fi("Accent 1","accent1")),mi.push(Fi("Accent 2","accent2")),mi.push(Fi("Accent 3","accent3")),mi.push(Fi("Accent 4","accent4")),mi.push(Fi("Accent 5","accent5")),mi.push(Fi("Accent 6","accent6"));const aC=e=>{const{docTheme:t,onSelectTheme:n,darkMode:o,isSelected:r,outlined:i,sx:a,...l}=e,c=qi(),d=u.useMemo(()=>{let p=[];for(let f=0;f<mi.length;f++){const h=mi[f];p.push(s.jsx(N2,{schemeColorLookup:t.schemeLookup(),colorDef:h,darkMode:o,selectedColor:null},f+"-colorDef"))}return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",flex:"none"},children:s.jsx(Le,{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(Le,{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(Le,{sx:{},children:t.getName()}),s.jsxs(Le,{sx:{paddingTop:"6px",paddingLeft:"12px",paddingRight:"12px",display:"flex",flexDirection:"column",alignItems:"stretch"},children:[d,s.jsx(Le,{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(qs,{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!==tn.Enter&&x.keyCode!==tn.Space||r(g)}},g.getName()))}return f},[o,r,l]);return s.jsx(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%"},ref:t,...c,children:s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(qs,{sx:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"4px",paddingBottom:"2px"},children:"Themes"}),s.jsx(Ft,{}),s.jsx(Le,{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=ji.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===tn.Enter&&y()}})},[n,o,r,p,d]),tooltip:a||l||"Theme",label:l,icon:h,...f};return c===ji.Toolbar?s.jsx(Ui,{ref:t,...g}):s.jsx(C1,{ref:t,...g})})),cC=u.memo(u.forwardRef((e,t)=>{const{command:n,commandHook:o,selectedTheme:r,onSelectTheme:i,disabled:a=!1,darkMode:l,variant:c,...d}=e;ol(n);const p=n?.context()?.themes,f=r||n?.context()?.theme,h=l??n?.context()?.darkMode,g=_e(y=>{i?.(y),n?.execute(y,o)},[i,o]),m=u.useCallback((y,x)=>{const{children:v,title:b,...w}=y;let E=y.children;return(n?.disabled()||a)&&(E=s.jsx("div",{children:E})),s.jsx(a0,{command:n,placement:c===Yt.Toolbar?"bottom-start":"right-start",disabled:x,...w,children:E})},[n,a]);return s.jsx(sC,{ref:t,themes:p,selectedTheme:f,onSelectTheme:g,variant:c===Yt.Menuitem?ji.Menuitem:ji.Toolbar,createTooltip:m,disabled:a,darkMode:h,icon:ze(s.jsx(ov,{})),...d})})),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=w_("(prefers-color-scheme: dark)"),f=c==="dark"||c===null&&p,h=_e((g,m)=>{const y={variant:Yt.Menuitem,commandHook:o,scope:"appearance",disabled:i},x=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...y,command:l,icon:ze(s.jsx(f?G6:Y6,{}))}),s.jsx(qe,{...y,command:m.getCommand("defaultThemeMode"),icon:ze(s.jsx(p?UO:qO,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...y,command:m.getCommand("forceLightGrid")}),s.jsx(qe,{...y,command:m.getCommand("forceLightImages")})]});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:Yt.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(qe,{...f,command:p.getCommand("showKeyboardShortcuts"),icon:ze(s.jsx(cR,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...f,command:p.getCommand("gotoUrlGithub"),icon:ze(s.jsx(XO,{}))}),s.jsx(qe,{...f,command:p.getCommand("gotoUrlDiscord"),icon:ze(s.jsx(ZO,{}))}),s.jsx(qe,{...f,command:p.getCommand("gotoUrlDocumentation"),icon:ze(s.jsx(iv,{}))}),s.jsx(qe,{...f,command:p.getCommand("gotoUrlIssue"),icon:ze(s.jsx(GO,{}))})]});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(KO,{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=Yt.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===Yt.Menuitem&&(m=y===0?p[x]:null),y++);return{singleMenuCommand:m,allDisabled:y===0}},[p]),g=u.useCallback((m,y)=>{const x={variant:Yt.Menuitem,commandHook:o,scope:"insertImage",disabled:i},v=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...x,command:y.getCommand("insertImageFromFile"),icon:ze(s.jsx(cd,{}))}),s.jsx(qe,{...x,command:y.getCommand("insertImageFromURL"),icon:ze(s.jsx(cd,{}))})]});return Bn({...m,children:v})},[i,o,r]);return f?s.jsx(qe,{ref:t,variant:c,commandHook:o,disabled:i,command:f,icon:ze(s.jsx(cd,{})),...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(cd,{})),...d})})),$2=u.memo(u.forwardRef((e,t)=>{const{command:n,...o}=e,r=Hi(),[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(qe,{ref:t,command:n,icon:ze(s.jsx(bO,{isWalking:i,themedType:l})),...o})})),JB=u.memo(u.forwardRef((e,t)=>{const{...n}=e;return s.jsx(sa,{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(CD,{}));case"insertFunction":return ze(s.jsx(SD,{}));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(""),[E,C]=u.useState(l);u.useEffect(()=>{C(l),w("")},[l]);const R=_e(S=>{let k="";try{C(S),f?.(S),p?.(S)}catch(P){k=P.message??"Invalid Name"}c&&m&&(k?m.setError(c,{message:k}):m.clearErrors(c)),w(k)},[l,f,p]),_=_e(async S=>{S.keyCode===tn.Escape&&x!==l&&(R(x),m?.setValue(c,x),m?.clearErrors(c),S.stopPropagation()),h?.(S)},[h,x,l,m]),L=_e(S=>{v(S.target.value??"")},[]),T=_e(S=>{v(""),y?.onBlur(S)},[]),j=u.useCallback(S=>{R(S.target.value),y?.onChange(S)},[y]);return s.jsx(x1,{sx:{paddingTop:S=>S.spacing(1.5),minWidth:135,width:"100%",...i},size:"small",ref:t,className:Eo("named-input",r),...g,children:s.jsx(k3,{label:"Name",placeholder:a,onFocus:L,onBlur:T,inputRef:y?.ref,disabled:n,error:!!b,helperText:b||" ",sx:{"& .MuiFormHelperText-root":{marginTop:S=>S.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",name:c,spellCheck:!1,autoComplete:"off",readOnly:n,sx:{paddingTop:S=>S.spacing(1.25),paddingBottom:S=>S.spacing(.75),backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}}},value:E??"",onChange:j,onKeyDownCapture:_,onContextMenu:S=>{S.stopPropagation()}})})}));Pf.displayName="NamedInput";const Td=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,E]=u.useState(()=>Td(d));u.useEffect(()=>{E(Td(d)),x(""),n&&g&&g.clearErrors(n),b(!1)},[d]);const C=_e(k=>{let P="";try{E(k);const O=Td(d),I=f(k);I.toString()!==O&&p?.(I)}catch{P="Invalid Range"}n&&g&&(P?g.setError(n,{message:P}):g.clearErrors(n)),x(P),b(!0)},[w,p,n,g]),R=_e(async k=>{if(v&&k.keyCode===tn.Escape){const P=Td(d);E(P),x(""),b(!1),k.stopPropagation()}c?.(k)},[d,p,c,v]),_=_e(k=>{m?.onBlur(k)},[m]),L=u.useCallback(k=>{C(k.target.value),m?.onChange(k)},[m]),[T,j]=u.useState(!1),S=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:k=>{j(k)},label:"Select Range",icon:ze(s.jsx(xD,{}))})}),[T]);return s.jsx(x1,{sx:{paddingTop:k=>k.spacing(1.5),minWidth:135,width:"100%",...l},size:"small",ref:t,className:Eo("range-input",a),...h,children:s.jsx(k3,{label:"Range",placeholder:"Enter Range",onBlur:_,disabled:r,error:!!y,inputRef:m?.ref,helperText:y||" ",sx:{"& .MuiFormHelperText-root":{marginTop:k=>k.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{spellCheck:!1,autoComplete:"off",readOnly:r,name:n,sx:{paddingTop:k=>k.spacing(1.25),paddingBottom:k=>k.spacing(.75)}},sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},endAdornment:S},value:w??"",onChange:L,onKeyDownCapture:R,onContextMenu:k=>{k.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);sn(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=_e(_=>{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)))}),E=M4(()=>h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10)))),C=qi(),R=u.useMemo(()=>`${$.IFont.getSharedMeasurer()("100%",Math.round(C.typography.fontSize),C.typography.fontFamily).width}px`,[C]);return s.jsxs(Le,{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(pR,{})})}),s.jsx(Cj,{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 ${yh(_.palette.primary.main,.16)}`},"&:focus, &:hover, &.Mui-active":{boxShadow:_=>`0px 0px 0px 2px ${yh(_.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===tn.Down||_.which===tn.Right?(h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!0,10))),_.preventDefault()):_.which===tn.Up||_.which===tn.Left?(h(g($.CommonUtils.findNextStep(n.getView().getZoomScale(),!1,10))),_.preventDefault()):_.which!==tn.Enter&&_.which!==tn.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():E(_)},children:s.jsx(Qj,{})})}),s.jsxs(Le,{sx:{display:"flex",flexDirection:"row"},children:[s.jsx(Le,{sx:{minWidth:"8px"}}),s.jsx(Mn,{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:R},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=Hi(),p=u.useMemo(()=>{const g=d.getMode();return g?.description?g.description:"Ready"},[d]),[f,h]=u.useState(!1);return s.jsxs(Le,{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(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",color:g=>g.palette.text.secondary},variant:"caption",children:p})}),a?s.jsx(Le,{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,_d={exports:{}},V0={},H0={exports:{}},$g={},jd={exports:{}},Wo={},pl={};function Yu(){return Ng||(Ng=1,Object.defineProperty(pl,"__esModule",{value:!0}),pl.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.`)},pl.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]},pl.int=function(e){return parseInt(e,10)},pl.isFunction=function(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"},pl.isNum=function(e){return typeof e=="number"&&!isNaN(e)}),pl}var Vg,Hg,Fa={};function Uh(){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=Yu(),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 Fa;Vg=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.browserPrefixToKey=p,Fa.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Fa.default=void 0,Fa.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 Fa.default=d(),Fa}());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,ea={};function Ug(){if(Wg)return ea;Wg=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},ea.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},ea.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}},ea.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}},ea.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]},ea.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)},ea.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Yu(),t=Uh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return ea}var qg,Kg,Gg,Zg,W0={},s5={};function Xg(){return qg||(qg=1,Object.defineProperty(s5,"__esModule",{value:!0}),s5.default=function(){}),s5}function QB(){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 E in x)E!=="default"&&{}.hasOwnProperty.call(x,E)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,E))&&(b.get||b.set)?v(w,E,b):w[E]=x[E]);return w}(m)}(u),n=p(Zc()),o=p(yo),r=function(){if(Bg)return jd.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 E=x.length;for(v=0;v<E;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="",E=arguments.length;b<E;b++)(x=arguments[b])&&(v=m(x))&&(w&&(w+=" "),w+=v);return w}return Bg=1,jd.exports=y,jd.exports.clsx=y,jd.exports}(),i=Uh(),a=Ug(),l=Yu(),c=p(function(){if(Kg)return W0;Kg=1,Object.defineProperty(W0,"__esModule",{value:!0}),W0.default=void 0;var m=function(S){if(typeof WeakMap=="function")var k=new WeakMap;return function(P){if(P&&P.__esModule)return P;var O,I,z={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return z;if(O=k){if(O.has(P))return O.get(P);O.set(P,z)}for(const A in P)A!=="default"&&{}.hasOwnProperty.call(P,A)&&((I=(O=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,A))&&(I.get||I.set)?O(z,A,I):z[A]=P[A]);return z}(S)}(u),y=C(Zc()),x=C(yo),v=Uh(),b=Ug(),w=Yu(),E=C(Xg());function C(S){return S&&S.__esModule?S:{default:S}}function R(S,k,P){return(k=typeof(O=function(I,z){if(typeof I!="object"||!I)return I;var A=I[Symbol.toPrimitive];if(A!==void 0){var D=A.call(I,z);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}(k,"string"))=="symbol"?O:O+"")in S?Object.defineProperty(S,k,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[k]=P,S;var O}const _={start:"touchstart",move:"touchmove",stop:"touchend"},L={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=L,j=class extends m.Component{constructor(){super(...arguments),R(this,"dragging",!1),R(this,"lastX",NaN),R(this,"lastY",NaN),R(this,"touchIdentifier",null),R(this,"mounted",!1),R(this,"handleDragStart",S=>{if(this.props.onMouseDown(S),!this.props.allowAnyClick&&typeof S.button=="number"&&S.button!==0)return!1;const k=this.findDOMNode();if(!k||!k.ownerDocument||!k.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:P}=k;if(this.props.disabled||!(S.target instanceof P.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(S.target,this.props.handle,k)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(S.target,this.props.cancel,k))return;S.type!=="touchstart"||this.props.allowMobileScroll||S.preventDefault();const O=(0,v.getTouchIdentifier)(S);this.touchIdentifier=O;const I=(0,b.getControlPosition)(S,O,this);if(I==null)return;const{x:z,y:A}=I,D=(0,b.createCoreData)(this,z,A);(0,E.default)("DraggableCore: handleDragStart: %j",D),(0,E.default)("calling",this.props.onStart),this.props.onStart(S,D)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(P),this.dragging=!0,this.lastX=z,this.lastY=A,(0,v.addEvent)(P,T.move,this.handleDrag),(0,v.addEvent)(P,T.stop,this.handleDragStop))}),R(this,"handleDrag",S=>{const k=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(k==null)return;let{x:P,y:O}=k;if(Array.isArray(this.props.grid)){let z=P-this.lastX,A=O-this.lastY;if([z,A]=(0,b.snapToGrid)(this.props.grid,z,A),!z&&!A)return;P=this.lastX+z,O=this.lastY+A}const I=(0,b.createCoreData)(this,P,O);if((0,E.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag(S,I)!==!1&&this.mounted!==!1)this.lastX=P,this.lastY=O;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)}}),R(this,"handleDragStop",S=>{if(!this.dragging)return;const k=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(k==null)return;let{x:P,y:O}=k;if(Array.isArray(this.props.grid)){let A=P-this.lastX||0,D=O-this.lastY||0;[A,D]=(0,b.snapToGrid)(this.props.grid,A,D),P=this.lastX+A,O=this.lastY+D}const I=(0,b.createCoreData)(this,P,O);if(this.props.onStop(S,I)===!1||this.mounted===!1)return!1;const z=this.findDOMNode();z&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(z.ownerDocument),(0,E.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,z&&((0,E.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(z.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(z.ownerDocument,T.stop,this.handleDragStop))}),R(this,"onMouseDown",S=>(T=L,this.handleDragStart(S))),R(this,"onMouseUp",S=>(T=L,this.handleDragStop(S))),R(this,"onTouchStart",S=>(T=_,this.handleDragStart(S))),R(this,"onTouchEnd",S=>(T=_,this.handleDragStop(S)))}componentDidMount(){this.mounted=!0;const S=this.findDOMNode();S&&(0,v.addEvent)(S,_.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const S=this.findDOMNode();if(S){const{ownerDocument:k}=S;(0,v.removeEvent)(k,L.move,this.handleDrag),(0,v.removeEvent)(k,_.move,this.handleDrag),(0,v.removeEvent)(k,L.stop,this.handleDragStop),(0,v.removeEvent)(k,_.stop,this.handleDragStop),(0,v.removeEvent)(S,_.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(k)}}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 W0.default=j,R(j,"displayName","DraggableCore"),R(j,"propTypes",{allowAnyClick:y.default.bool,allowMobileScroll:y.default.bool,children:y.default.node.isRequired,disabled:y.default.bool,enableUserSelectHack:y.default.bool,offsetParent:function(S,k){if(S[k]&&S[k].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}),R(j,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),W0}()),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 E=b[Symbol.toPrimitive];if(E!==void 0){var C=E.call(b,w);if(typeof C!="object")return C;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:E,y:C}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[R,_]=(0,a.getBoundPosition)(this,w.x,w.y);w.x=R,w.y=_,w.slackX=this.state.slackX+(E-w.x),w.slackY=this.state.slackY+(C-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:E}=this.props.position;b.x=w,b.y=E}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:E,defaultClassNameDragged:C,position:R,positionOffset:_,scale:L,...T}=this.props;let j={},S=null;const k=!R||this.state.dragging,P=R||b,O={x:(0,a.canDragX)(this)&&k?this.state.x:P.x,y:(0,a.canDragY)(this)&&k?this.state.y:P.y};this.state.isElementSVG?S=(0,i.createSVGTransform)(O,_):j=(0,i.createCSSTransform)(O,_);const I=(0,r.clsx)(v.props.className||"",w,{[E]:this.state.dragging,[C]: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,...j},transform:S}))}}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 H0.exports;Zg=1;const{default:e,DraggableCore:t}=QB();return H0.exports=e,H0.exports.default=e,H0.exports.DraggableCore=t,H0.exports}var Yg,Rd={},Jg,Qg,U0={};function mC(){if(Jg)return U0;Jg=1,U0.__esModule=!0,U0.resizableProps=void 0;var e,t=(e=Zc())&&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 U0.resizableProps=n,U0}function ey(){if(Qg)return V0;Qg=1,V0.__esModule=!0,V0.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 Rd;Yg=1,Rd.__esModule=!0,Rd.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 E=Object.getOwnPropertySymbols(v);b&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),w.push.apply(w,E)}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(E){x(v,E,w[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(E){Object.defineProperty(v,E,Object.getOwnPropertyDescriptor(w,E))})}return v}function x(v,b,w){return(b=typeof(E=function(C,R){if(typeof C!="object"||C===null)return C;var _=C[Symbol.toPrimitive];if(_!==void 0){var L=_.call(C,R);if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(b,"string"))=="symbol"?E:String(E))in v?Object.defineProperty(v,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[b]=w,v;var E}return Rd}(),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),E=0;E<b;E++)w[E]=arguments[E];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,E=w.minConstraints,C=w.maxConstraints,R=w.lockAspectRatio;if(!E&&!C&&!R)return[v,b];if(R){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 j=v,S=b,k=this.slack||[0,0],P=k[0],O=k[1];return v+=P,b+=O,E&&(v=Math.max(E[0],v),b=Math.max(E[1],b)),C&&(v=Math.min(C[0],v),b=Math.min(C[1],b)),this.slack=[P+(j-v),O+(S-b)],[v,b]},x.resizeHandler=function(v,b){var w=this;return function(E,C){var R=C.node,_=C.deltaX,L=C.deltaY;v==="onResizeStart"&&w.resetData();var T=(w.props.axis==="both"||w.props.axis==="x")&&b!=="n"&&b!=="s",j=(w.props.axis==="both"||w.props.axis==="y")&&b!=="e"&&b!=="w";if(T||j){var S=b[0],k=b[b.length-1],P=R.getBoundingClientRect();w.lastHandleRect!=null&&(k==="w"&&(_+=P.left-w.lastHandleRect.left),S==="n"&&(L+=P.top-w.lastHandleRect.top)),w.lastHandleRect=P,k==="w"&&(_=-_),S==="n"&&(L=-L);var O=w.props.width+(T?_/w.props.transformScale:0),I=w.props.height+(j?L/w.props.transformScale:0),z=w.runConstraints(O,I);O=z[0],I=z[1];var A=O!==w.props.width||I!==w.props.height,D=typeof w.props[v]=="function"?w.props[v]:null;D&&!(v==="onResize"&&!A)&&(E.persist==null||E.persist(),D(E,{node:R,size:{width:O,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 E=c({ref:b},typeof w.type=="string"?{}:{handleAxis:v});return e.cloneElement(w,E)},x.render=function(){var v=this,b=this.props,w=b.children,E=b.className,C=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 R=b.resizeHandles;b.transformScale;var _=function(L,T){if(L==null)return{};var j,S,k={},P=Object.keys(L);for(S=0;S<P.length;S++)j=P[S],T.indexOf(j)>=0||(k[j]=L[j]);return k}(b,r);return(0,n.cloneElement)(w,c(c({},_),{},{className:(E?E+" ":"")+"react-resizable",children:[].concat(w.props.children,R.map(function(L){var T,j=(T=v.handleRefs[L])!=null?T:v.handleRefs[L]=e.createRef();return e.createElement(t.DraggableCore,a({},C,{nodeRef:j,key:"resizableHandle-"+L,onStop:v.resizeHandler("onResizeStop",L),onStart:v.resizeHandler("onResizeStart",L),onDrag:v.resizeHandler("onResize",L)}),v.renderResizeHandle(L,j))}))}))},y}(e.Component);return V0.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},V0}var ty,ny,q0={},eN=(ny||(ny=1,_d.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},_d.exports.Resizable=ey().default,_d.exports.ResizableBox=function(){if(ty)return q0;ty=1,q0.__esModule=!0,q0.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(Zc()),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 E=w.call(v,b);if(typeof E!="object")return E;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),E=0;E<b;E++)w[E]=arguments[E];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(C,R){var _=R.size;v.props.onResize?(C.persist==null||C.persist(),v.setState(_,function(){return v.props.onResize&&v.props.onResize(C,R)})):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 E=v.onResizeStart,C=v.onResizeStop,R=v.draggableOpts,_=v.minConstraints,L=v.maxConstraints,T=v.lockAspectRatio,j=v.axis;v.width,v.height;var S=v.resizeHandles,k=v.style,P=v.transformScale,O=function(I,z){if(I==null)return{};var A,D,F={},B=Object.keys(I);for(D=0;D<B.length;D++)A=B[D],z.indexOf(A)>=0||(F[A]=I[A]);return F}(v,r);return e.createElement(n.default,{axis:j,draggableOpts:R,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:T,maxConstraints:L,minConstraints:_,onResizeStart:E,onResize:this.onResize,onResizeStop:C,resizeHandles:S,transformScale:P,width:this.state.width},e.createElement("div",l({},O,{style:d(d({},k),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},x}(e.Component);return q0.default=h,h.propTypes=d(d({},o.resizableProps),{},{children:t.default.element}),q0}().default),_d.exports);function c5(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var V2=parseInt(u.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=c5(o,t),i=typeof r=="function";n.push(i?r:()=>c5(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)c5(n,t)}};const Lf=u.memo(u.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,disabled:a=!1,commandPopupButtonProps:l,sx:c,notifier:d,...p}=e,[f,h]=u.useState(null),[g,m]=u.useState(()=>r.getSelectedRanges().getCoords()),[y,x]=u.useState(!1),{reference:v}=pa({parentFloat:l?.parentFloat}),b=()=>f?.text??"",[w,E]=u.useState(b),C=_e(()=>{if(v?.closeAll(),!w){const N=b();return E(b()),N}if(b()===w)return w;const F=w.trim().toLowerCase();if(F==="r"||F==="c")return w;try{const N=r.getRanges(w);if(N)return N.toString()}catch{}const B=o.getByName(w);if(B&&B.getRanges())return w;let M=null;try{const N=r.getRanges(w).getCoords().map(V=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V}));M=r.getRanges(N)}catch{}if(!M){const N=r.getSelectedRanges().getCoords().map(V=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V}));M=r.getRanges(N)}try{let N=o.getByName(w);N||(N=o.addReference(w,M)),h({text:N.getName()})}catch(N){E(b()),d.showMessage?.(N.message,{type:ua.Error})}return null},[w,o,v]),R=_e(()=>{if(r.isClosed())return;const F=[];for(let N=0;N<g.length;N++){const V=g[N];F.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V})}let B=null;try{B=o.lookupByRanges(F)}catch{}let M=null;M=B?.length>0?B[0].getName():r.getSelectedSheet().getSelectedRange().toString(),h({text:M})},[r,g]),[_,L]=u.useState(()=>o?.search()??null);sn(o,{onCollectionChange(F){L(o.search()),R()},onClose(F){L([])}}),u.useEffect(()=>{E(b())},[f,g]);const[T,j]=u.useState(r?.getSelectedSheet());sn(r,{onSheetsChange:F=>{j(F?.getSelectedSheet())},onViewChange(F){j(F?.getSelectedSheet())}});const[S,k]=u.useState(null),P=_e($.CommonUtils.debounce(R,S?320:0),[]);sn(T.getSelection(),{onChange:()=>{m(F=>{const B=r.getSelectedRanges().getCoords();return $.CoordUtils.isEqualRangesArrays(B,F)?F:B})},onAdjustingChange:F=>{k(F.getAdjusting())}}),u.useEffect(()=>{if(S){const F=r.getSelectedRange(),B=F.getRowCount(),M=F.getColumnCount();let N=`${B}R x ${M}C`;if(N.length>17&&(N=`${B}x${M}`),B>1||M>1)return void h({text:N,fontStyle:"italic",justifyContent:"center"})}h({text:r.getSelectedSheet().getSelectedRange().toString()}),P()},[g,r,S]);const O=u.useRef(null),I=u.useCallback(F=>{const{onMouseDown:B,onMouseUp:M,...N}=F;return s.jsx(Tr,{...N,sx:{...N?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:s.jsx(ql,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:O},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:V=>`1px solid ${V.palette.text.icon??V.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:V=>`1px solid ${V.palette.primary.main}`},"::after":{borderBottom:V=>`1px solid ${V.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*$.IFont.getDeviceScale(),fontStyle:f?.fontStyle,paddingLeft:V=>V.spacing(.75),paddingRight:V=>V.spacing(.75),boxShadow:"none",flex:"1",color:V=>V.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:V=>V.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:V=>V.palette.text.primary}}},value:w,onFocus:V=>{V.target?.select()},onKeyDown:V=>{if(V.which===tn.Enter||V.which===tn.Tab){let U=w;b()!==w&&(V.stopPropagation(),V.preventDefault(),U=C()),U?z(U):i?.()}else if(V.which===tn.Escape)b()!==w?(E(b()),setTimeout(()=>{V.target?.select()},0),V.stopPropagation(),V.preventDefault()):i?.();else if(V.which===tn.Space)return void V.stopPropagation()},onBlur:()=>{E(b())},onChange:V=>{E(V.target.value)}})})},[w,f]),z=_e(async F=>{try{v?.closeAll();const B=o.lookupByRanges(F)?.[0];B&&await B?.select(),await r.getRanges(F)?.select()}catch(B){d.showMessage?.(B.message,{type:ua.Error})}},[o,d,r]),A=u.useCallback(F=>{setTimeout(()=>{x(!0)},0);const B={variant:Yt.Menuitem,parentFloat:F.floatReference,commandHook:{...l?.commandHook,beforeExecute:(U,J)=>(v?.closeAll(),l?.commandHook?.beforeExecute?.(U,J))},scope:l?.scope,commands:l?.commands};let M=o.search({scope:r?.getSelectedSheet().getName()});M=M.sort((U,J)=>U.getType()===J.getType()?U.getName().localeCompare(J.getName()):U.getType()==="range"?-1:1);const N=[];for(let U=0;U<M.length;U++){const J=M[U],X=J.getRanges();if(!X||J.isHidden())continue;const H=J.getType();H!==M[U-1]?.getType()&&(U>0&&N.push(s.jsx(Ft,{orientation:"horizontal"},`type-divider-${N.length}`)),N.push(s.jsx(qs,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:J.getType()==="reference"?"Ranges":"Tables"},`type-header-${N.length}`))),H==="reference"?N.push(u.createElement(sa,{...B,key:"named-"+N.length,popupCommandKeys:["editNamedReference","deleteNamedReference"],popupScope:"namedItem",scope:"namedItem",commandState:J,commands:l?.commands,label:J.getName(),quickCommand:"selectNamed",disabled:!J.getRanges()||a,icon:ne=>{switch(ne.key()){case"editNamedReference":return ze(s.jsx(nD,{}));case"deleteNamedReference":return ze(s.jsx(oD,{}));default:return ze(s.jsx(eD,{}))}}})):H==="table"&&N.push(u.createElement(sa,{...B,key:"namedItem-"+N.length,popupCommandKeys:["editTable",null,"convertTableToRange","deleteTable"],popupScope:"namedItem",scope:"namedItem",commands:l?.commands,commandState:J,label:J.getName(),quickCommand:"selectNamed",disabled:!X||a,icon:ne=>(ne.key(),ze(s.jsx(qc,{})))}))}const V=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[s.jsx(qe,{...B,scope:"namedItem",command:l?.commands.getCommand("addNamedReference"),icon:ze(s.jsx(tD,{}))}),N&&N.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:N})]}):null]});return Bn({...F,children:V})},[r,_,o,f]),D=ir(t,()=>({focus(F){O.current?.focus(F)}}),[]);return s.jsx(Le,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:V2([D,t]),...p,children:s.jsx(Ui,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...c},buttonProps:{sx:{backgroundColor:F=>F.palette.background.paper,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}},tabIndex:-1,outlined:{color:F=>n?F.palette.action.disabled:pt(F.palette.divider,.2)},parentFloat:v,createPopupPanel:A,onPopupOpen:()=>x(!0),onPopupClose:()=>x(!1),createTooltip:({children:F},B)=>s.jsx(br,{title:B||y?"":"Name Box",disabled:B,leaveDelay:0,sx:{opacity:B||y?0:1},children:F}),createQuickButton:I})})}));Lf.displayName="NamedCollectionEditor";const tN=(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=tN,disabled:d,commands:p,...f}=e,[h,g]=u.useState(o?.getSelectedSheet());sn(o,{onSheetsChange:X=>{g(X?.getSelectedSheet())},onViewChange(X){g(X?.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}),[]);sn(h.getSelection(),{onChange:()=>{y(h.getSelection().getCoords().cell)}}),sn(h,{onProtectionChange(){y(h.getSelection().getCoords().cell)}});const E=b.current?.getLineHeight()??20,[C,R]=u.useState(E),[_,L]=u.useState(5),[T,j]=u.useState(1),S=_e((X,{size:H})=>{X.preventDefault(),X.stopPropagation();const ne=Math.floor(H.height/E);R(ne*E+1),ne>1&&L(ne)},[E]),k=_e((X,{size:H})=>{const ne=Math.floor(H.height/E);j(ne)},[E]),P=Hi(),O=P.getMode();let I=null;O?.key==="edit"&&(I=O.args?.stateAndCoords);const z=u.useMemo(()=>{let X=I?.editState;return X||(X=Yw(()=>h.getRange(m).getCell())),s.jsx(Le,{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:H=>{if(H.dirty!==void 0){const ne={sheet:h,coords:m,editState:H};P.setMode(oe=>({...oe,args:{...oe?.args,stateAndCoords:ne}}))}},editState:X,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,I,m,T,r]),A=u.useRef(null),D=u.useMemo(()=>a?c({names:o.getNames(),workbook:o,...l},A):null,[c,l,a,h,o,v]),F=u.useMemo(()=>s.jsxs(Mi,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:X=>`solid ${v?X.palette.action.disabled:pt(X.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(JO,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||I===null,onMouseDown:X=>{X.button===0&&X.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(QO,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||I===null,onMouseDown:X=>{X.button===0&&X.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(wD,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:X=>{X.button===0&&X.preventDefault()}})]}),[v,I]),B=qi(),[M,N]=u.useState(!1),V=u.useMemo(()=>s.jsxs(Le,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:X=>X.spacing(.5),alignItems:"start"},children:[F,s.jsxs(Mi,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:X=>X.typography.fontFamily,fontSize:11*$.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:X=>`${X.shape.borderRadius}px`,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:X=>`solid ${v?X.palette.action.disabled:pt(X.palette.divider,.2)} 1px`,"& textarea":{color:X=>v?`${X.palette.text.disabled} !important`:X.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:()=>N(!0),onBlur:()=>N(!1),onMouseDown:X=>{X.target?.classList.contains("react-resizable-handle")&&X.preventDefault()},children:[s.jsx(Le,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:X=>X.spacing(1),paddingRight:X=>X.spacing(1)},children:s.jsx(eN.ResizableBox,{height:C,draggableOpts:{grid:[E,E]},minConstraints:[E,E],maxConstraints:[15*E,15*E],onResize:k,onResizeStop:S,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?lR:Lx,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:X=>{X.button===0&&X.preventDefault()},onClick:()=>{const X=T>1?1:_;R(X*E+1),j(X)}}),s.jsx(Le,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:M?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:X=>X.palette.primary.main,borderRadius:X=>`${X.shape.borderRadius}px`}})]})]}),[F,z,M,T,E]),U=u.useMemo(()=>D||V?!D&&V?V:D&&!V?D:s.jsx(s.Fragment,{children:s.jsx(q5,{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='${B.palette.text.icon??B.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:D,elementAfter:V})}):null,[D,V]),J=ir(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>A.current}),[]);return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",gap:X=>X.spacing(.5),...n},ref:J,...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:Yt.Menuitem}),[c,d]),f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:o.getCommand("sortAscending"),icon:ze(s.jsx(uh,{}))}),s.jsx(qe,{...p,command:o.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,command:o.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),[]]});return s.jsx(Le,{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,[E,C]=u.useState(()=>!!o&&o.getProtection().isLocked()),[R,_]=u.useState(()=>o?o.getTabColor():null);sn(o,{onProtectionChange:()=>{C(o.getProtection().isLocked())},onTabColorChange:()=>{_(o.getTabColor())},onStyleChange:()=>{_(o.getTabColor())}});const L=qi(),T=f===l;let j=null,S=null;if(R||h){let O=x;R?(S=R.toBlackOrWhite().toCSS(),O=R?.toCSS()):T||(O=L.palette.background.paper),j=s.jsx(Le,{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&&R?`linear-gradient(0deg, ${O} 0%, transparent)`:O}})}let k=null;typeof g=="string"?k=g:g?.toCSS&&(k=g.toCSS());const P=T?s.jsx(Le,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:O=>O.palette.primary.main}}):null;return s.jsx(hw,{theme:T?b??L:L,children:s.jsx(Le,{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(nI,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?k:"transparent",children:s.jsx(Lc,{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":S||"text.secondary",backgroundColor:T?x:"transparent","&:hover:not([disabled])":{backgroundColor:T?x:"transparent"},"& input":{color:O=>`${O.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:s.jsxs(s.Fragment,{children:[j,s.jsxs(Le,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,P]}),E?s.jsx(v2,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):s.jsx(Le,{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());sn(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(qe,{command:r.getCommand("addSheet"),commandState:o,...x,variant:Yt.Menuitem}),s.jsx(qe,{command:r.getCommand("deleteSheet"),...x,variant:Yt.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(qe,{command:r.getCommand("duplicateSheet"),...x,variant:Yt.Menuitem}),s.jsx(qe,{command:r?.getCommand("protectionSheetToggle"),...x,variant:Yt.Menuitem,icon:s.jsx(v2,{})}),s.jsx(Ys,{variant:Yt.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:s.jsx(N3,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Is.End},parentFloat:l}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{command:r.getCommand("hideSheet"),...x,variant:Yt.Menuitem,icon:ze(s.jsx(rv,{}))})]});return s.jsx(Le,{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());sn(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,E=v.getProtection().isLocked(),C=v.getTabColor(),R=o?.body.fill??"transparent";let _=null,L=null,T=R;C&&(T=C.toCSS(),w||(L=C.toBlackOrWhite().toCSS()),_=s.jsx(Le,{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(Le,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===$.ISheet.Visibility.Hidden?"50%":"100%",border:S=>w?`${R} solid 1.5px`:`${S.palette.divider} solid 1px`,background:w&&C?`linear-gradient(0deg, ${T} 0%, ${R})`:T,borderRadius:"4px"}})}));let j=null;E&&(j=s.jsx(v2,{color:"secondary"})),b!==$.ISheet.Visibility.Visible&&(j=ze(s.jsx(rv,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),j&&(j=s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:j})),g.push(s.jsx(Gr,{disabled:!p.isStructureAllowed()&&b===$.ISheet.Visibility.Hidden,sx:{color:S=>{let k=w?S.palette.primary.main:S.palette.text.secondary;return L&&(k=L),b===$.ISheet.Visibility.Hidden&&(k=pt(k,S.palette.action.disabledOpacity)),k},borderLeft:S=>`${w?S.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?s.jsx(k1,{}):void 0,onMouseDown:S=>S.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(S){console.error(S)}})},children:s.jsxs(s.Fragment,{children:[_,s.jsxs(Le,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[s.jsxs(Le,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),s.jsx(Le,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),j]})]})},""+x))}return g},[n,p,c,r,o]);return s.jsx(Le,{ref:t,className:Eo("menu",a),...l,children:h})}));$f.displayName="SheetsAllMenu";var nN=function(){},yC=typeof window<"u",oN=yC?u.useLayoutEffect:u.useEffect,oy={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const i1=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 oN(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[nN,oy]};function Ju(){return Ju=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},Ju.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},dc="unmounted",gl="exited",yl="entering",us="entered",qh="exiting",ba=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=gl,i.appearStatus=yl):a=us:a=o.unmountOnExit||o.mountOnEnter?dc:gl,i.state={status:a},i.nextCallback=null,i}xC(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===dc?{status:gl}: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!==yl&&i!==us&&(r=yl):i!==yl&&i!==us||(r=qh)}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===yl){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===gl&&this.setState({status:dc})},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:yl},function(){r.props.onEntering(c,d),r.onTransitionEnd(f,function(){r.safeSetState({status:us},function(){r.props.onEntered(c,d)})})})):this.safeSetState({status:us},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:qh},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:gl},function(){o.props.onExited(a)})})})):this.safeSetState({status:gl},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===dc)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 ls(){}ba.contextType=bC,ba.propTypes={},ba.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ls,onEntering:ls,onEntered:ls,onExit:ls,onExiting:ls,onExited:ls},ba.UNMOUNTED=dc,ba.EXITED=gl,ba.ENTERING=yl,ba.ENTERED=us,ba.EXITING=qh;var d5=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})},Kh=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&&d5(o,a),l&&d5(o,l),c&&d5(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Vf(o,["classNames"]);return u.createElement(ba,Ju({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(u.Component);Kh.defaultProps={classNames:""},Kh.propTypes={};const wC={Light:"light",Dark:"dark"},u5=.12,Gh=(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:fi(d,u5,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:fi(n.body.fill,u5,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:fi(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:fi(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:fi(c?.fill??n.body.fill,.22,e.palette?.mode),fill:fi(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=fi(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:fi(r.fill,u5,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:fi(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:fi(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 a1=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=ir(t,()=>({}),[]),[l,c]=i1(),d=u.useRef(null),p=u.useRef(null),[f,h]=u.useReducer(C=>C+1,0),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),{reference:w}=pa({parentFloat:r,label:"overflow"});u.useLayoutEffect(()=>{p.current={refs:[]};const C=[],R=u.Children.toArray(n);let _=0;R.forEach((L,T)=>{C.push(s.jsx(Le,{sx:{display:"flex"},ref:j=>{_++,_===R.length&&h();const S={current:null};S.current=j,p.current.refs[T]=S},children:L},T))}),m(C)},[n,c]),u.useLayoutEffect(()=>{if(!g)return;const C=p.current.refs;if(!a.current||!C||C.length===0)return x(null),void b(null);const R=a.current?.getBoundingClientRect(),_=[],L=[];let T=0,j=!1;for(let k=0;!j&&k<C.length;k++){const P=C[k];if(!P)continue;if(!P.current){j=!0;continue}const O=P.current.getBoundingClientRect();T+=O?.width,T>R.width&&(j=!0)}if(!j)return x(null),void b([]);const S=d.current?.getBoundingClientRect();T=0;for(let k=0;k<C.length;k++){const P=C[k];let O=!1;if(P.current){const I=P.current.getBoundingClientRect();T+=I?.width,T<R.width-S.width&&(O=!0)}O?_.push(g[k]):L.push(g[k])}x(_.length>0?_:null),b(L.length>0?L:null)},[n,g,c,w,f]);const E=_e(C=>{const R=[];for(let L=0;L<v.length;L++){let T=u.Children.toArray(v[L]);const j=T[0];T=u.Children.toArray(j.props.children?.props.children??j.props.children);const S=T[0],k={...S.props};k.parentFloat&&(k.parentFloat=C.floatReference);const P=u.cloneElement(S,k);R.push(P)}const _=s.jsx(Le,{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:R});return Bn({...C,children:_})},[v]);return s.jsxs(Le,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:V2([a,l,t]),...i,children:[s.jsx(Le,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:y??g}),s.jsx(Le,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:s.jsx(Ui,{createPopupPanel:E,ref:d,parentFloat:w,createTooltip:({children:C},R)=>s.jsx(br,{label:"More",description:"More toolbar options…",disabled:R,children:C}),icon:s.jsx(Wb,{children:s.jsx(uR,{})})})})]})})),CC="https://unpkg.com/@sheetxl/scripting-templates/dist",rN=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CCt310aPAkQrCxMS.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./QxpNuD32ALFmzlQy.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("./DMB1rgM6a7YNSt5g.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],iN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./CCt310aPAkQrCxMS.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./QxpNuD32ALFmzlQy.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("./DMB1rgM6a7YNSt5g.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class kC{constructor(t=rN,n=iN){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?.typedConstructorOptions?.[n]};let l;delete a.typedConstructorOptions;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=_R.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?.typedConstructorOptions?.[i.key]};delete l.typedConstructorOptions;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 aN(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;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 aN{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 lN=new kC;var ly,sy,sN=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,El=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 sN.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:El,WorkbookIO:lN},Symbol.toStringTag,{value:"Module"})),cN=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=El.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new N5(`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 N5(`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=El.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:cN(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)},p5={fontSize:"0.8rem",marginRight:"4px"},dN=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:p5}):n.metadata?.icon==="macro"?s.jsx(K3,{sx:p5}):s.jsx(zx,{sx:p5}),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!==tn.Enter&&c.keyCode!==tn.Space||r(n)},...a,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsx(Mn,{component:"div",children:n.metadata?.title??n.path}),s.jsx(Mn,{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:Yt.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=C=>{g.getEditor()?.insertSnippet(C.content),y.closeFloat()},w=[];for(let C=0;C<c.length;C++){const R=c[C];R&&w.push(s.jsx(dN,{handleInsert:b,snippet:R},R.path))}const E=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[w.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:w}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(qe,{...v,key:"help",command:n.getCommand("help"),icon:ze(s.jsx(iv,{}))})]});return Bn({...y,children:E})},[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(ED,{})),...l})})),Wf=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(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(a1,{parentFloat:o,style:{},children:s.jsx(qe,{...c,command:n.getCommand("saveScripts"),icon:ze(s.jsx(MD,{}))})})}),s.jsx("div",{style:{flex:"1 1 100%"}}),s.jsx("div",{children:s.jsx(a1,{parentFloat:o,style:{},children:s.jsx(MC,{...c,commands:n})})})]})})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));Wf.displayName="ScriptEditorToolbar";const h5={fontSize:"1rem"},TC=u.memo(u.forwardRef((e,t)=>{const{scriptPath:n=CC,onScriptSelect:o,sx:r=_n.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 E=0;E<w.length;E++){const C=w[E];C&&b.push(C)}}catch(w){y(w instanceof Error?w.message:"Failed to load scripts"),w instanceof N5||console.error("Error loading scripts:",w)}finally{f(b),g(!1)}})()},[n]),h)return s.jsx(Le,{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(p3,{})});let x=null;m&&(x=s.jsxs(Le,{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(Mn,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),s.jsx(Mn,{color:"error",component:"div",children:m})]}));const v=b=>{const w=b.metadata?.icon;return w==="macro"?s.jsx(K3,{sx:h5}):w==="formula"?s.jsx(lv,{sx:h5}):w==="autostart"?s.jsx(zx,{sx:h5}):null};return s.jsxs(Le,{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(Le,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[s.jsx(Mn,{variant:"h6",gutterBottom:!0,children:"Script Template"}),s.jsx(Mn,{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(Mn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),s.jsx(Le,{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(Lc,{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(Le,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[s.jsx(Mn,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&s.jsx(Mn,{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=qi(),[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 D=!1;return w(null),async function(){if(p&&(await p.start(),!D)){const F=p.getModules().search()[0]?.getSource();w({source:F||null})}}(),()=>{D=!0}},[p]);const E=u.useCallback(D=>{v(F=>({...F,...D}))},[]),C=u.useRef(null),R=u.useRef(null),[_,L]=u.useState(null),T=u.useRef(null),j=_e(D=>{if(_)return _.focus(D),!0;if(c){const F=R.current?.querySelectorAll?.(c);if(F&&F.length>0)return F[0]?.focus?.(D),!0}return R.current?.focus?.(D),!1},[_,c,d]),S=u.useMemo(()=>s.jsx(i0,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),k=u.useMemo(()=>s.jsx(Mi,{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:D=>D.spacing(.5),marginRight:D=>D.spacing(.5),marginTop:D=>D.spacing(1),marginBottom:D=>D.spacing(1)},children:s.jsx(Wf,{commands:i})}),[h,i]),P=u.useMemo(()=>s.jsx(Le,{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(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:D=>D.palette.text.secondary},variant:"caption",children:x.message}),s.jsx(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:D=>D.palette.text.secondary},variant:"caption",children:x.dirty?"Unsaved":""}),s.jsx(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:D=>D.palette.text.secondary},variant:"caption",children:x.cursor})]})}),[x]),O=u.useMemo(()=>s.jsxs(Le,{className:Eo("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[k,s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:s.jsx(VB,{ref:R,loadingPanel:S,readOnly:a,onClose:l,autoFocus:d,commands:i,onStatusChange:E,darkMode:h.palette.mode==="dark",...r})}),P]}),[h,i,k,P,g,S,a,r,d,c,l,E]),I=u.useMemo(()=>s.jsx(Mx,{className:Eo({"Mui-selected":y.current}),sx:{display:"flex",color:D=>D.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:D=>`${D.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:D=>D.transitions.duration.shortest/2+"ms"},backgroundColor:D=>pt(D.palette.action.hover,.03),borderBottom:D=>`solid ${pt(D.palette.divider,.2)} 1px`},onPointerDown:D=>{D.isDefaultPrevented()||(D.preventDefault(),j())},children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:D=>D.spacing(.25),marginBottom:D=>D.spacing(.25),marginLeft:D=>D.spacing(1),marginRight:D=>D.spacing(1)},children:[s.jsx(Le,{sx:{flex:"1 1 100%",paddingLeft:D=>D.spacing(1)},children:"Script (Typescript)"}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:D=>D.palette.text.icon??D.palette.action.active},touchRippleRef:C,onPointerDown:D=>{C.current?.start(D,{center:!1}),D.stopPropagation(),D.preventDefault()},onPointerUp:()=>{R.current?.close()},children:s.jsx(E3,{})})})]})}),[h,g]),z=u.useMemo(()=>{let D;return b===null?null:(b.source===null&&(D=s.jsx(TC,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:F=>{R.current?.getEditor().insertSnippet(F.content),w({source:F.content??""})}})),s.jsxs(Le,{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:F=>{F.isDefaultPrevented()||R.current?.focus()},children:[I,s.jsxs(Le,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[O,D]})]}))},[k,O,n,b]),A=ir(t,()=>({isScriptWorkspaceElement:()=>!0,focus:D=>{j(D)}}),[]);return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,onFocus:D=>{m(!0),y.current=!0,A.current?.contains(D.target)&&D.target!==A.current&&L(D.target),D.relatedTarget&&!T.current&&(T.current=D.relatedTarget),f?.onFocus?.(D)},onBlur:D=>{A?.current?.contains(D.relatedTarget)||A?.current===D.relatedTarget||(T.current=null,y.current=!1,m(!1)),f?.onBlur?.(D)},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:Yt.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(qe,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ze(s.jsx(K3,{})),labelOverride:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${x}`))}const y=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[m.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:m}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(qe,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ze(s.jsx(yD,{}))})]});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(kD,{})),...a})})),uN=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(Ys,{...f,command:n.getCommand("formatFontColor"),icon:s.jsx(EP,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=s.jsx(Ys,{...f,command:n.getCommand("formatFillColor"),icon:s.jsx(kP,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Is.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 E=0;w&&!b&&E<w?.length;E++)b=!0;b&&(x=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{}),s.jsx(qf,{...f})]}))}return s.jsxs(a1,{parentFloat:o,children:[m,null,m?s.jsx(Ft,{}):null,s.jsx(jf,{...f,command:n.getCommand("paste")}),s.jsx(qe,{...p,command:n.getCommand("formatPainterToggle"),icon:ze(s.jsx(OO,{}))}),s.jsx($2,{...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(qe,{...p,command:n.getCommand("formatBoldToggle"),icon:s.jsx(PI,{})}),s.jsx(qe,{...p,command:n.getCommand("formatItalicToggle"),icon:s.jsx(II,{})}),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(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),pN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(a1,{parentFloat:o,children:[null,s.jsx(qe,{...c,command:n.getCommand("updateHyperlink"),icon:ze(s.jsx(ch,{}))}),s.jsx(qe,{...c,command:n.getCommand("updateComments"),icon:ze(s.jsx(dh,{}))}),s.jsx(If,{...d}),s.jsx(qe,{...c,command:n.getCommand("insertTable"),icon:ze(s.jsx(qc,{}))})]})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),hN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(a1,{parentFloat:o,children:[s.jsx(VS,{...d}),s.jsx(qe,{...c,command:n.getCommand("protectionSheetToggle"),icon:s.jsx(v2,{color:"secondary"})}),s.jsx(Ft,{}),s.jsx(KS,{...d}),s.jsx(JS,{...d}),s.jsx(Ft,{}),s.jsx(qe,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:s.jsx(Gs,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),s.jsx(qe,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:s.jsx(Gs,{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(qe,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ze(n.getCommand("fullScreenToggle").state()?s.jsx(WO,{}):s.jsx(HO,{}))})]})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_C=e=>s.jsx(yN,{...e}),fN=u.memo(e=>{const{sx:t,...n}=e;return s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${pt(o.palette.primary.main,.35)} solid 2px`}},children:[s.jsx(Ij,{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(Le,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),mN=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(fN,{label:t[c].label},t[c].label));return l},[t]);return s.jsx(Zj,{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})}),gN=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(b1,{value:d,sx:{color:f=>{if(n===d)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return s.jsx(x1,{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(b2,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...i,children:l})})}),yN=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 C=[],{ref:R,..._}=l?.Home||{};C.push({label:"Home",component:s.jsx(uN,{commands:n,..._})});const{ref:L,...T}=l?.Insert||{};C.push({label:"Insert",component:s.jsx(pN,{commands:n,...T})});const{ref:j,...S}=l?.View||{};return C.push({label:"View",component:s.jsx(hN,{commands:n,...S})}),C},[n]),g=u.useMemo(()=>{const C=[];for(let R=0;R<h.length;R++)C.push(u.cloneElement(h[R].component,{...h[R].component.props,key:h[R].key??h[R].label}));return C},[h]),[m,y]=u.useState(0),x=C=>{y(C)},v=u.useMemo(()=>s.jsx(i?gN:mN,{toolbars:h,value:m,onToolbarChange:x,sx:r}),[h,m,r,i]),{sx:b,...w}=c,E=s.jsx(Mi,{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:C=>C.spacing(1),marginRight:C=>C.spacing(1),marginTop:C=>C.spacing(.5),marginBottom:C=>C.spacing(.5),...b},...w,children:g[m]});return s.jsxs(Le,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:C=>C.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,a?a(E):E]})})),xN=e=>s.jsx(Nf,{...e}),bN=e=>s.jsx($f,{...e}),vN=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=xN,sheetsAllProps:p,renderSheetsAll:f=bN,sheetTabProps:h,renderSheetTab:g,background:m="transparent",className:y,notifier:x,sx:v,borderWidth:b,borderColor:w,gridTheme:E,gridStyle:C,...R}=e,[_,L]=u.useState(n?.getSelectedSheetIndex()),[T,j]=u.useState(n?.getSheets().search()),[S,k]=u.useState(n?.getProtection());sn(n,{onViewChange(ve){L(ve?.getSelectedSheetIndex())},onSheetsChange:ve=>{j(ve.getSheets().search())},onProtectionChange:ve=>{k(ve?.getProtection())}});const P=u.useMemo(()=>{const ve=[];for(let re=0;re<T.length;re++)ve.push(T[re].getName());return ve},[T]),O=u.useCallback(ve=>{r?.(ve)!==!1&&(n.getSheetAt(ve).select(),i?.(ve))},[n,r,i]),I=u.useCallback((ve,re)=>{n.getSheetAt(ve).setName(re),i?.(ve)},[n,i]),z=u.useCallback((ve,re)=>{n.getSheetAt(ve).setPosition(re),i?.(re)},[n,i]),A=_e(()=>{if(r?.(_)===!1)return;const ve=_+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ve)},[n,r,i,_]),D=u.useMemo(()=>({placement:"top-start"}),[]),F=u.useRef(null),[B,M]=u.useState(!1),N=u.useCallback(ve=>{const{closeFloatAll:re,floatReference:ce}=ve;return f({workbook:n,gridStyle:C,floatReference:ce,closeFloatAll:re,...p})},[f,p,a,n,C]),{reference:V,component:U}=pa({label:"allSheet",popperProps:D,anchor:F.current,onOpen:()=>M(!0),onClose:()=>M(!1),createPopupPanel:N}),J=u.useRef(null),[X,H]=u.useState(null),ne=u.useCallback(ve=>{const{floatReference:re}=ve;return d?.({workbook:n,index:X?.index,tabStripRef:J.current,commands:o,disabled:a,floatReference:re,...c})},[d,c,a,n,o,X]),{reference:oe,component:ye}=pa({label:"sheetTab",popperProps:D,anchor:{getBoundingClientRect:()=>new DOMRect(X?.left||0,X?.top||0,0,0)},onClose:()=>H(null),createPopupPanel:ne});u.useEffect(()=>{X?oe.open(0):oe.close(0)},[X]);const de=u.useCallback((ve,re)=>{ve.preventDefault(),H({left:ve.clientX-2,top:ve.clientY-4,index:re})},[]),xe=_e(ve=>{let re;try{re=n?.getSheetAt(ve.index)}catch{}return re?(g??vN)({sheet:re,gridTheme:E,onContextMenu:ce=>{O(ve.index),de(ce,ve.index)},...ve,...h}):null},[g,h,n,E]),we=u.useMemo(()=>l||!S?.isStructureAllowed()?null:s.jsx(di,{disableInteractive:!0,title:"New sheet",children:s.jsx(Tr,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ve=>ve.palette.primary.main},color:ve=>ve.palette.text.icon??ve.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ve=>{ve.button===0&&ve.preventDefault()},onClick:()=>A(),children:s.jsx(eR,{})})}),[l,a,S,A]);return s.jsxs(Le,{ref:t,className:Eo(y),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...R,children:[s.jsx(DS,{ref:J,selectedTabIndex:_,tabNames:P,onSelectedTabIndexChange:O,onTabNameChange:I,onTabMove:z,background:m,borderColor:w,borderWidth:b,activeColor:null,disabled:a,disableDrag:l||!S.isStructureAllowed(),createScrollStartButton:_D,createScrollEndButton:jD,createScrollEdgeButton:TD,createTabButton:xe,createTabDivider:ve=>{const{key:re,...ce}=ve;return s.jsx(Ft,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Se=>pt(Se.palette.divider,.25)},...ce},re)},editLabelProps:{maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ve=>{n.isValidSheetNameCharacter(ve.key)||ve.preventDefault()},onCancel:()=>{i?.(_)},notifier:x},children:s.jsx(di,{disableInteractive:!0,title:B?"":"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:ve=>ve.palette.text.icon??ve.palette.action.active},ref:F,dense:!0,outlined:!1,selected:B,color:"primary","aria-label":"menu",onMouseDown:ve=>{ve.button===0&&ve.preventDefault()},onClick:()=>{B?V.close(0):V.open(0)},icon:s.jsx(dR,{})})})}),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:we}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:1,minWidth:"24px"}}),ye,U]})}));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(k=>k+1,0),[f,h]=u.useState(n.getSelectedSheet()),[g,m]=u.useState(f.getSelectedRanges()),[y,x]=u.useState(f.getSelectedCell());sn(n,{onSheetsChange(){h(n.getSelectedSheet())}}),sn(f.getSelection(),{onChange(){m(f.getSelectedRanges()),x(f.getSelectedCell())}}),_o(o,[],{onChange:()=>{p()}});const v=u.useMemo(()=>({}),[]),b=u.useMemo(()=>({commandHook:{beforeExecute:(k,P)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),w=u.useMemo(()=>({...v,...b,variant:Yt.Menuitem}),[v,b]),E=u.useMemo(()=>({commands:o,variant:Yt.Menuitem,parentFloat:a,...b}),[o,b,a]),C=[];let R=g.isEntireRows(),_=g.isEntireColumns();g&&(R&&(C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),C.push(u.createElement(qe,{command:o.getCommand("hideColumns"),...w,icon:ze(s.jsx(MO,{})),key:"context:"+C.length})),C.push(u.createElement(qe,{command:o.getCommand("unhideColumns"),...w,icon:ze(s.jsx(EO,{})),key:"context:"+C.length}))),_&&(C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),C.push(u.createElement(qe,{command:o.getCommand("hideRows"),...w,icon:ze(s.jsx(_O,{})),key:"context:"+C.length})),C.push(u.createElement(qe,{command:o.getCommand("unhideRows"),...w,icon:ze(s.jsx(TO,{})),key:"context:"+C.length}))),(R||_)&&C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),R&&C.push(u.createElement(qe,{command:o.getCommand("autoFitColumns"),...w,icon:ze(s.jsx(rD,{})),key:"context:"+C.length})),_&&C.push(u.createElement(qe,{command:o.getCommand("autoFitRows"),...w,icon:ze(s.jsx(iD,{})),key:"context:"+C.length})));const L=[],T=o.getCommand("formatTableStyle"),j=T?.context()?.table();if(ol(T),!R&&!_){if(L.push(s.jsx(Ft,{orientation:"horizontal"},"contextBefore:"+L.length)),y?.getHyperlink())L.push(u.createElement(sa,{...E,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+L.length,quickCommand:"openHyperlink",icon:k=>k.key()==="openHyperlink"?ze(s.jsx(ch,{})):null}));else{const k=o.getCommand("updateHyperlink");L.push(u.createElement(qe,{command:k,...w,icon:ze(s.jsx(ch,{})),key:"contextBefore:"+L.length}))}if(y?.getComments())L.push(u.createElement(sa,{...E,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+L.length,quickCommand:"updateComments",icon:k=>k.key()==="updateComments"?ze(s.jsx(dh,{})):null}));else{const k=o.getCommand("updateComments");L.push(u.createElement(qe,{command:k,...w,icon:ze(s.jsx(dh,{})),key:"contextBefore:"+L.length}))}j?L.push(u.createElement(sa,{...E,variant:Yt.Menuitem,key:"contextBefore:"+L.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:j,quickCommand:"editTable",icon:k=>(k.key(),ze(s.jsx(qc,{})))})):L.push(u.createElement(qe,{command:o.getCommand("insertTable"),...w,icon:ze(s.jsx(qc,{})),key:"context:"+C.length})),L.push(u.createElement(If,{...E,key:"contextBefore:"+L.length}))}const S=s.jsxs(s.Fragment,{children:[s.jsx(qe,{command:o.getCommand("cut"),...w,icon:s.jsx(zP,{})}),s.jsx($2,{command:o.getCommand("copy"),...w}),s.jsx(jf,{command:o.getCommand("paste"),...E,includePasteAllInPopup:!1}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Tf,{...E}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ef,{commands:o,...E,disableSheet:!0}),s.jsx(Mf,{commands:o,...E,disableSheet:!0}),s.jsx(kf,{...E}),L,C]});return s.jsx(Le,{ref:t,className:Eo("menu",l),sx:{...i},...c,children:S})}));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 ys=="object"&&ys&&ys.Object===Object&&ys,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,E,C,R,_=0,L=!1,T=!1,j=!0;if(typeof m!="function")throw new TypeError("Expected a function");function S(z){var A=v,D=b;return v=b=void 0,_=z,E=m.apply(D,A)}function k(z){var A=z-R;return R===void 0||A>=y||A<0||T&&z-_>=w}function P(){var z,A,D=f();if(k(D))return O(D);C=setTimeout(P,(A=y-((z=D)-R),T?p(A,w-(z-_)):A))}function O(z){return C=void 0,j&&v?S(z):(v=b=void 0,E)}function I(){var z,A=f(),D=k(A);if(v=arguments,b=this,R=A,D){if(C===void 0)return _=z=R,C=setTimeout(P,y),L?S(z):E;if(T)return C=setTimeout(P,y),S(R)}return C===void 0&&(C=setTimeout(P,y)),E}return y=g(y)||0,h(x)&&(L=!!x.leading,w=(T="maxWait"in x)?d(g(x.maxWait)||0,y):w,j="trailing"in x?!!x.trailing:j),I.cancel=function(){C!==void 0&&clearTimeout(C),_=0,v=R=b=C=void 0},I.flush=function(){return C===void 0?E:O(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,Id={exports:{}},ps={exports:{}},wN=ps.exports;(function(){if(xy)return Id.exports;xy=1;for(var e=(yy||(yy=1,function(){var f,h,g,m,y,x;typeof performance<"u"&&performance!==null&&performance.now?ps.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ps.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?(ps.exports=function(){return Date.now()-g},g=Date.now()):(ps.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(wN)),ps.exports),t=typeof window>"u"?ys: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)}}Id.exports=function(f){return r.call(t,f)},Id.exports.cancel=function(){i.apply(t,arguments)},Id.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i}})();var ta={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=_e(l,[l]),m=_e(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 He("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new He("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new He("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 He("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 He("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new He("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 He("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new He("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl]}]}),new He("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl]}]}),new He("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl,$e.Shift]}]}),new He("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl,$e.Shift]}]}),new He("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new He("selectNamed",r,{label:k=>k?.getName()??"Select Named Item",scopedLabels:{namedItem:k=>k?.getName()??"Select"},description:"Select the item."}),new He("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 He("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 He("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=Yu(),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 Fa;Vg=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.browserPrefixToKey=p,Fa.browserPrefixToStyle=function(f,h){return h?`-${h.toLowerCase()}-${f}`:f},Fa.default=void 0,Fa.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 Fa.default=d(),Fa}());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,ea={};function Ug(){if(Wg)return ea;Wg=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.canDragX=function(o){return o.props.axis==="both"||o.props.axis==="x"},ea.canDragY=function(o){return o.props.axis==="both"||o.props.axis==="y"},ea.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}},ea.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}},ea.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]},ea.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)},ea.snapToGrid=function(o,r,i){return[Math.round(r/o[0])*o[0],Math.round(i/o[1])*o[1]]};var e=Yu(),t=Uh();function n(o){const r=o.findDOMNode();if(!r)throw new Error("<DraggableCore>: Unmounted during event!");return r}return ea}var qg,Kg,Gg,Zg,W0={},s5={};function Xg(){return qg||(qg=1,Object.defineProperty(s5,"__esModule",{value:!0}),s5.default=function(){}),s5}function QB(){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 E in x)E!=="default"&&{}.hasOwnProperty.call(x,E)&&((b=(v=Object.defineProperty)&&Object.getOwnPropertyDescriptor(x,E))&&(b.get||b.set)?v(w,E,b):w[E]=x[E]);return w}(m)}(u),n=p(Zc()),o=p(yo),r=function(){if(Bg)return jd.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 E=x.length;for(v=0;v<E;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="",E=arguments.length;b<E;b++)(x=arguments[b])&&(v=m(x))&&(w&&(w+=" "),w+=v);return w}return Bg=1,jd.exports=y,jd.exports.clsx=y,jd.exports}(),i=Uh(),a=Ug(),l=Yu(),c=p(function(){if(Kg)return W0;Kg=1,Object.defineProperty(W0,"__esModule",{value:!0}),W0.default=void 0;var m=function(S){if(typeof WeakMap=="function")var k=new WeakMap;return function(P){if(P&&P.__esModule)return P;var O,I,z={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return z;if(O=k){if(O.has(P))return O.get(P);O.set(P,z)}for(const A in P)A!=="default"&&{}.hasOwnProperty.call(P,A)&&((I=(O=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,A))&&(I.get||I.set)?O(z,A,I):z[A]=P[A]);return z}(S)}(u),y=C(Zc()),x=C(yo),v=Uh(),b=Ug(),w=Yu(),E=C(Xg());function C(S){return S&&S.__esModule?S:{default:S}}function R(S,k,P){return(k=typeof(O=function(I,z){if(typeof I!="object"||!I)return I;var A=I[Symbol.toPrimitive];if(A!==void 0){var D=A.call(I,z);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}(k,"string"))=="symbol"?O:O+"")in S?Object.defineProperty(S,k,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[k]=P,S;var O}const _={start:"touchstart",move:"touchmove",stop:"touchend"},L={start:"mousedown",move:"mousemove",stop:"mouseup"};let T=L,j=class extends m.Component{constructor(){super(...arguments),R(this,"dragging",!1),R(this,"lastX",NaN),R(this,"lastY",NaN),R(this,"touchIdentifier",null),R(this,"mounted",!1),R(this,"handleDragStart",S=>{if(this.props.onMouseDown(S),!this.props.allowAnyClick&&typeof S.button=="number"&&S.button!==0)return!1;const k=this.findDOMNode();if(!k||!k.ownerDocument||!k.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:P}=k;if(this.props.disabled||!(S.target instanceof P.defaultView.Node)||this.props.handle&&!(0,v.matchesSelectorAndParentsTo)(S.target,this.props.handle,k)||this.props.cancel&&(0,v.matchesSelectorAndParentsTo)(S.target,this.props.cancel,k))return;S.type!=="touchstart"||this.props.allowMobileScroll||S.preventDefault();const O=(0,v.getTouchIdentifier)(S);this.touchIdentifier=O;const I=(0,b.getControlPosition)(S,O,this);if(I==null)return;const{x:z,y:A}=I,D=(0,b.createCoreData)(this,z,A);(0,E.default)("DraggableCore: handleDragStart: %j",D),(0,E.default)("calling",this.props.onStart),this.props.onStart(S,D)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&(0,v.addUserSelectStyles)(P),this.dragging=!0,this.lastX=z,this.lastY=A,(0,v.addEvent)(P,T.move,this.handleDrag),(0,v.addEvent)(P,T.stop,this.handleDragStop))}),R(this,"handleDrag",S=>{const k=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(k==null)return;let{x:P,y:O}=k;if(Array.isArray(this.props.grid)){let z=P-this.lastX,A=O-this.lastY;if([z,A]=(0,b.snapToGrid)(this.props.grid,z,A),!z&&!A)return;P=this.lastX+z,O=this.lastY+A}const I=(0,b.createCoreData)(this,P,O);if((0,E.default)("DraggableCore: handleDrag: %j",I),this.props.onDrag(S,I)!==!1&&this.mounted!==!1)this.lastX=P,this.lastY=O;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)}}),R(this,"handleDragStop",S=>{if(!this.dragging)return;const k=(0,b.getControlPosition)(S,this.touchIdentifier,this);if(k==null)return;let{x:P,y:O}=k;if(Array.isArray(this.props.grid)){let A=P-this.lastX||0,D=O-this.lastY||0;[A,D]=(0,b.snapToGrid)(this.props.grid,A,D),P=this.lastX+A,O=this.lastY+D}const I=(0,b.createCoreData)(this,P,O);if(this.props.onStop(S,I)===!1||this.mounted===!1)return!1;const z=this.findDOMNode();z&&this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(z.ownerDocument),(0,E.default)("DraggableCore: handleDragStop: %j",I),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,z&&((0,E.default)("DraggableCore: Removing handlers"),(0,v.removeEvent)(z.ownerDocument,T.move,this.handleDrag),(0,v.removeEvent)(z.ownerDocument,T.stop,this.handleDragStop))}),R(this,"onMouseDown",S=>(T=L,this.handleDragStart(S))),R(this,"onMouseUp",S=>(T=L,this.handleDragStop(S))),R(this,"onTouchStart",S=>(T=_,this.handleDragStart(S))),R(this,"onTouchEnd",S=>(T=_,this.handleDragStop(S)))}componentDidMount(){this.mounted=!0;const S=this.findDOMNode();S&&(0,v.addEvent)(S,_.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const S=this.findDOMNode();if(S){const{ownerDocument:k}=S;(0,v.removeEvent)(k,L.move,this.handleDrag),(0,v.removeEvent)(k,_.move,this.handleDrag),(0,v.removeEvent)(k,L.stop,this.handleDragStop),(0,v.removeEvent)(k,_.stop,this.handleDragStop),(0,v.removeEvent)(S,_.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,v.scheduleRemoveUserSelectStyles)(k)}}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 W0.default=j,R(j,"displayName","DraggableCore"),R(j,"propTypes",{allowAnyClick:y.default.bool,allowMobileScroll:y.default.bool,children:y.default.node.isRequired,disabled:y.default.bool,enableUserSelectHack:y.default.bool,offsetParent:function(S,k){if(S[k]&&S[k].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}),R(j,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),W0}()),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 E=b[Symbol.toPrimitive];if(E!==void 0){var C=E.call(b,w);if(typeof C!="object")return C;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:E,y:C}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[R,_]=(0,a.getBoundPosition)(this,w.x,w.y);w.x=R,w.y=_,w.slackX=this.state.slackX+(E-w.x),w.slackY=this.state.slackY+(C-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:E}=this.props.position;b.x=w,b.y=E}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:E,defaultClassNameDragged:C,position:R,positionOffset:_,scale:L,...T}=this.props;let j={},S=null;const k=!R||this.state.dragging,P=R||b,O={x:(0,a.canDragX)(this)&&k?this.state.x:P.x,y:(0,a.canDragY)(this)&&k?this.state.y:P.y};this.state.isElementSVG?S=(0,i.createSVGTransform)(O,_):j=(0,i.createCSSTransform)(O,_);const I=(0,r.clsx)(v.props.className||"",w,{[E]:this.state.dragging,[C]: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,...j},transform:S}))}}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 H0.exports;Zg=1;const{default:e,DraggableCore:t}=QB();return H0.exports=e,H0.exports.default=e,H0.exports.DraggableCore=t,H0.exports}var Yg,Rd={},Jg,Qg,U0={};function mC(){if(Jg)return U0;Jg=1,U0.__esModule=!0,U0.resizableProps=void 0;var e,t=(e=Zc())&&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 U0.resizableProps=n,U0}function ey(){if(Qg)return V0;Qg=1,V0.__esModule=!0,V0.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 Rd;Yg=1,Rd.__esModule=!0,Rd.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 E=Object.getOwnPropertySymbols(v);b&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),w.push.apply(w,E)}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(E){x(v,E,w[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):m(Object(w)).forEach(function(E){Object.defineProperty(v,E,Object.getOwnPropertyDescriptor(w,E))})}return v}function x(v,b,w){return(b=typeof(E=function(C,R){if(typeof C!="object"||C===null)return C;var _=C[Symbol.toPrimitive];if(_!==void 0){var L=_.call(C,R);if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(C)}(b,"string"))=="symbol"?E:String(E))in v?Object.defineProperty(v,b,{value:w,enumerable:!0,configurable:!0,writable:!0}):v[b]=w,v;var E}return Rd}(),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),E=0;E<b;E++)w[E]=arguments[E];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,E=w.minConstraints,C=w.maxConstraints,R=w.lockAspectRatio;if(!E&&!C&&!R)return[v,b];if(R){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 j=v,S=b,k=this.slack||[0,0],P=k[0],O=k[1];return v+=P,b+=O,E&&(v=Math.max(E[0],v),b=Math.max(E[1],b)),C&&(v=Math.min(C[0],v),b=Math.min(C[1],b)),this.slack=[P+(j-v),O+(S-b)],[v,b]},x.resizeHandler=function(v,b){var w=this;return function(E,C){var R=C.node,_=C.deltaX,L=C.deltaY;v==="onResizeStart"&&w.resetData();var T=(w.props.axis==="both"||w.props.axis==="x")&&b!=="n"&&b!=="s",j=(w.props.axis==="both"||w.props.axis==="y")&&b!=="e"&&b!=="w";if(T||j){var S=b[0],k=b[b.length-1],P=R.getBoundingClientRect();w.lastHandleRect!=null&&(k==="w"&&(_+=P.left-w.lastHandleRect.left),S==="n"&&(L+=P.top-w.lastHandleRect.top)),w.lastHandleRect=P,k==="w"&&(_=-_),S==="n"&&(L=-L);var O=w.props.width+(T?_/w.props.transformScale:0),I=w.props.height+(j?L/w.props.transformScale:0),z=w.runConstraints(O,I);O=z[0],I=z[1];var A=O!==w.props.width||I!==w.props.height,D=typeof w.props[v]=="function"?w.props[v]:null;D&&!(v==="onResize"&&!A)&&(E.persist==null||E.persist(),D(E,{node:R,size:{width:O,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 E=c({ref:b},typeof w.type=="string"?{}:{handleAxis:v});return e.cloneElement(w,E)},x.render=function(){var v=this,b=this.props,w=b.children,E=b.className,C=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 R=b.resizeHandles;b.transformScale;var _=function(L,T){if(L==null)return{};var j,S,k={},P=Object.keys(L);for(S=0;S<P.length;S++)j=P[S],T.indexOf(j)>=0||(k[j]=L[j]);return k}(b,r);return(0,n.cloneElement)(w,c(c({},_),{},{className:(E?E+" ":"")+"react-resizable",children:[].concat(w.props.children,R.map(function(L){var T,j=(T=v.handleRefs[L])!=null?T:v.handleRefs[L]=e.createRef();return e.createElement(t.DraggableCore,a({},C,{nodeRef:j,key:"resizableHandle-"+L,onStop:v.resizeHandler("onResizeStop",L),onStart:v.resizeHandler("onResizeStart",L),onDrag:v.resizeHandler("onResize",L)}),v.renderResizeHandle(L,j))}))}))},y}(e.Component);return V0.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},V0}var ty,ny,q0={},eN=(ny||(ny=1,_d.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},_d.exports.Resizable=ey().default,_d.exports.ResizableBox=function(){if(ty)return q0;ty=1,q0.__esModule=!0,q0.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(Zc()),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 E=w.call(v,b);if(typeof E!="object")return E;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),E=0;E<b;E++)w[E]=arguments[E];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(C,R){var _=R.size;v.props.onResize?(C.persist==null||C.persist(),v.setState(_,function(){return v.props.onResize&&v.props.onResize(C,R)})):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 E=v.onResizeStart,C=v.onResizeStop,R=v.draggableOpts,_=v.minConstraints,L=v.maxConstraints,T=v.lockAspectRatio,j=v.axis;v.width,v.height;var S=v.resizeHandles,k=v.style,P=v.transformScale,O=function(I,z){if(I==null)return{};var A,D,F={},B=Object.keys(I);for(D=0;D<B.length;D++)A=B[D],z.indexOf(A)>=0||(F[A]=I[A]);return F}(v,r);return e.createElement(n.default,{axis:j,draggableOpts:R,handle:b,handleSize:w,height:this.state.height,lockAspectRatio:T,maxConstraints:L,minConstraints:_,onResizeStart:E,onResize:this.onResize,onResizeStop:C,resizeHandles:S,transformScale:P,width:this.state.width},e.createElement("div",l({},O,{style:d(d({},k),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},x}(e.Component);return q0.default=h,h.propTypes=d(d({},o.resizableProps),{},{children:t.default.element}),q0}().default),_d.exports);function c5(e,t){if(typeof e=="function")return e(t);e&&(e.current=t)}var V2=parseInt(u.version.split(".")[0],10)>=19?function(e){return t=>{const n=[];for(const o of e){const r=c5(o,t),i=typeof r=="function";n.push(i?r:()=>c5(o,null))}return()=>{for(const o of n)o()}}}:function(e){return t=>{for(const n of e)c5(n,t)}};const Lf=u.memo(u.forwardRef((e,t)=>{const{disabled:n,names:o,workbook:r,restoreFocus:i,disabled:a=!1,commandPopupButtonProps:l,sx:c,notifier:d,...p}=e,[f,h]=u.useState(null),[g,m]=u.useState(()=>r.getSelectedRanges().getCoords()),[y,x]=u.useState(!1),{reference:v}=pa({parentFloat:l?.parentFloat}),b=()=>f?.text??"",[w,E]=u.useState(b),C=_e(()=>{if(v?.closeAll(),!w){const N=b();return E(b()),N}if(b()===w)return w;const F=w.trim().toLowerCase();if(F==="r"||F==="c")return w;try{const N=r.getRanges(w);if(N)return N.toString()}catch{}const B=o.getByName(w);if(B&&B.getRanges())return w;let M=null;try{const N=r.getRanges(w).getCoords().map(V=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V}));M=r.getRanges(N)}catch{}if(!M){const N=r.getSelectedRanges().getCoords().map(V=>({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V}));M=r.getRanges(N)}try{let N=o.getByName(w);N||(N=o.addReference(w,M)),h({text:N.getName()})}catch(N){E(b()),d.showMessage?.(N.message,{type:ua.Error})}return null},[w,o,v]),R=_e(()=>{if(r.isClosed())return;const F=[];for(let N=0;N<g.length;N++){const V=g[N];F.push({$colEnd:!0,$rowEnd:!0,$colStart:!0,$rowStart:!0,...V})}let B=null;try{B=o.lookupByRanges(F)}catch{}let M=null;M=B?.length>0?B[0].getName():r.getSelectedSheet().getSelectedRange().toString(),h({text:M})},[r,g]),[_,L]=u.useState(()=>o?.search()??null);sn(o,{onCollectionChange(F){L(o.search()),R()},onClose(F){L([])}}),u.useEffect(()=>{E(b())},[f,g]);const[T,j]=u.useState(r?.getSelectedSheet());sn(r,{onSheetsChange:F=>{j(F?.getSelectedSheet())},onViewChange(F){j(F?.getSelectedSheet())}});const[S,k]=u.useState(null),P=_e($.CommonUtils.debounce(R,S?320:0),[]);sn(T.getSelection(),{onChange:()=>{m(F=>{const B=r.getSelectedRanges().getCoords();return $.CoordUtils.isEqualRangesArrays(B,F)?F:B})},onAdjustingChange:F=>{k(F.getAdjusting())}}),u.useEffect(()=>{if(S){const F=r.getSelectedRange(),B=F.getRowCount(),M=F.getColumnCount();let N=`${B}R x ${M}C`;if(N.length>17&&(N=`${B}x${M}`),B>1||M>1)return void h({text:N,fontStyle:"italic",justifyContent:"center"})}h({text:r.getSelectedSheet().getSelectedRange().toString()}),P()},[g,r,S]);const O=u.useRef(null),I=u.useCallback(F=>{const{onMouseDown:B,onMouseUp:M,...N}=F;return s.jsx(Tr,{...N,sx:{...N?.sx,display:"flex",flex:"1 1 100%"},disableRipple:!0,children:s.jsx(ql,{inputMode:"text",inputProps:{tabIndex:0,name:"input-named-range",maxLength:255,className:"input",autoFocus:!1,spellCheck:!1,autoComplete:"off",ref:O},sx:{"&::before":{borderBottom:"1px solid transparent"},"&:hover:not(.Mui-disabled):not(.Mui-focused):not(.Mui-error):before":{borderBottom:V=>`1px solid ${V.palette.text.icon??V.palette.action.active}`},"&:hover:not(.Mui-disabled):not(.Mui-error):before":{borderBottom:V=>`1px solid ${V.palette.primary.main}`},"::after":{borderBottom:V=>`1px solid ${V.palette.primary.main}`},paddingTop:"0px",paddingBottom:"0px",fontSize:11*$.IFont.getDeviceScale(),fontStyle:f?.fontStyle,paddingLeft:V=>V.spacing(.75),paddingRight:V=>V.spacing(.75),boxShadow:"none",flex:"1",color:V=>V.palette.text.secondary,input:{padding:"0",textAlign:"left","&:hover:not(.Mui-disabled):not(.Mui-error)":{color:V=>V.palette.text.primary},"&:focus:not(.Mui-disabled):not(.Mui-error)":{color:V=>V.palette.text.primary}}},value:w,onFocus:V=>{V.target?.select()},onKeyDown:V=>{if(V.which===tn.Enter||V.which===tn.Tab){let U=w;b()!==w&&(V.stopPropagation(),V.preventDefault(),U=C()),U?z(U):i?.()}else if(V.which===tn.Escape)b()!==w?(E(b()),setTimeout(()=>{V.target?.select()},0),V.stopPropagation(),V.preventDefault()):i?.();else if(V.which===tn.Space)return void V.stopPropagation()},onBlur:()=>{E(b())},onChange:V=>{E(V.target.value)}})})},[w,f]),z=_e(async F=>{try{v?.closeAll();const B=o.lookupByRanges(F)?.[0];B&&await B?.select(),await r.getRanges(F)?.select()}catch(B){d.showMessage?.(B.message,{type:ua.Error})}},[o,d,r]),A=u.useCallback(F=>{setTimeout(()=>{x(!0)},0);const B={variant:Yt.Menuitem,parentFloat:F.floatReference,commandHook:{...l?.commandHook,beforeExecute:(U,J)=>(v?.closeAll(),l?.commandHook?.beforeExecute?.(U,J))},scope:l?.scope,commands:l?.commands};let M=o.search({scope:r?.getSelectedSheet().getName()});M=M.sort((U,J)=>U.getType()===J.getType()?U.getName().localeCompare(J.getName()):U.getType()==="range"?-1:1);const N=[];for(let U=0;U<M.length;U++){const J=M[U],X=J.getRanges();if(!X||J.isHidden())continue;const H=J.getType();H!==M[U-1]?.getType()&&(U>0&&N.push(s.jsx(Ft,{orientation:"horizontal"},`type-divider-${N.length}`)),N.push(s.jsx(qs,{variant:"subtitle2",sx:{paddingLeft:"16px"},children:J.getType()==="reference"?"Ranges":"Tables"},`type-header-${N.length}`))),H==="reference"?N.push(u.createElement(sa,{...B,key:"named-"+N.length,popupCommandKeys:["editNamedReference","deleteNamedReference"],popupScope:"namedItem",scope:"namedItem",commandState:J,commands:l?.commands,label:J.getName(),quickCommand:"selectNamed",disabled:!J.getRanges()||a,icon:ne=>{switch(ne.key()){case"editNamedReference":return ze(s.jsx(nD,{}));case"deleteNamedReference":return ze(s.jsx(oD,{}));default:return ze(s.jsx(eD,{}))}}})):H==="table"&&N.push(u.createElement(sa,{...B,key:"namedItem-"+N.length,popupCommandKeys:["editTable",null,"convertTableToRange","deleteTable"],popupScope:"namedItem",scope:"namedItem",commands:l?.commands,commandState:J,label:J.getName(),quickCommand:"selectNamed",disabled:!X||a,icon:ne=>(ne.key(),ze(s.jsx(qc,{})))}))}const V=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},...p,children:[s.jsx(qe,{...B,scope:"namedItem",command:l?.commands.getCommand("addNamedReference"),icon:ze(s.jsx(tD,{}))}),N&&N.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:N})]}):null]});return Bn({...F,children:V})},[r,_,o,f]),D=ir(t,()=>({focus(F){O.current?.focus(F)}}),[]);return s.jsx(Le,{className:"outer",sx:{minWidth:120,flex:"1 1 100%",display:"flex",alignItems:"center",justifyContent:"start",...c},ref:V2([D,t]),...p,children:s.jsx(Ui,{className:"outer-button",sx:{display:"flex",flex:"1 1 100%","& .tooltip-wrapper":{display:"flex",flex:"1 1 100%",width:"100%",height:"27px"},...c},buttonProps:{sx:{backgroundColor:F=>F.palette.background.paper,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`}},tabIndex:-1,outlined:{color:F=>n?F.palette.action.disabled:pt(F.palette.divider,.2)},parentFloat:v,createPopupPanel:A,onPopupOpen:()=>x(!0),onPopupClose:()=>x(!1),createTooltip:({children:F},B)=>s.jsx(br,{title:B||y?"":"Name Box",disabled:B,leaveDelay:0,sx:{opacity:B||y?0:1},children:F}),createQuickButton:I})})}));Lf.displayName="NamedCollectionEditor";const tN=(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=tN,disabled:d,commands:p,...f}=e,[h,g]=u.useState(o?.getSelectedSheet());sn(o,{onSheetsChange:X=>{g(X?.getSelectedSheet())},onViewChange(X){g(X?.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}),[]);sn(h.getSelection(),{onChange:()=>{y(h.getSelection().getCoords().cell)}}),sn(h,{onProtectionChange(){y(h.getSelection().getCoords().cell)}});const E=b.current?.getLineHeight()??20,[C,R]=u.useState(E),[_,L]=u.useState(5),[T,j]=u.useState(1),S=_e((X,{size:H})=>{X.preventDefault(),X.stopPropagation();const ne=Math.floor(H.height/E);R(ne*E+1),ne>1&&L(ne)},[E]),k=_e((X,{size:H})=>{const ne=Math.floor(H.height/E);j(ne)},[E]),P=Hi(),O=P.getMode();let I=null;O?.key==="edit"&&(I=O.args?.stateAndCoords);const z=u.useMemo(()=>{let X=I?.editState;return X||(X=Yw(()=>h.getRange(m).getCell())),s.jsx(Le,{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:H=>{if(H.dirty!==void 0){const ne={sheet:h,coords:m,editState:H};P.setMode(oe=>({...oe,args:{...oe?.args,stateAndCoords:ne}}))}},editState:X,commands:p,onCancelEdit:()=>{r?.cancelEdit(),r?.focus()},onSubmitEdit:()=>{r?.submitEdit(),r?.focus()},linesVisible:T})})},[h,I,m,T,r]),A=u.useRef(null),D=u.useMemo(()=>a?c({names:o.getNames(),workbook:o,...l},A):null,[c,l,a,h,o,v]),F=u.useMemo(()=>s.jsxs(Mi,{elevation:0,sx:{display:"flex",alignItems:"center",userSelect:"none",flexGrow:0,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:X=>`solid ${v?X.palette.action.disabled:pt(X.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(JO,{})),tooltipProps:{label:"Cancel",simple:!0},disabled:v||I===null,onMouseDown:X=>{X.button===0&&X.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(QO,{})),tooltipProps:{label:"Enter",simple:!0},disabled:v||I===null,onMouseDown:X=>{X.button===0&&X.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(wD,{sx:{transform:"scale(0.85)"}})),tooltipProps:{label:"Insert Function",simple:!0},onMouseDown:X=>{X.button===0&&X.preventDefault()}})]}),[v,I]),B=qi(),[M,N]=u.useState(!1),V=u.useMemo(()=>s.jsxs(Le,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",gap:X=>X.spacing(.5),alignItems:"start"},children:[F,s.jsxs(Mi,{elevation:0,sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",fontFamily:X=>X.typography.fontFamily,fontSize:11*$.IFont.getDeviceScale(),"& .editor-placement":{top:"2px !important"},boxShadow:"none",borderRadius:X=>`${X.shape.borderRadius}px`,backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`,border:X=>`solid ${v?X.palette.action.disabled:pt(X.palette.divider,.2)} 1px`,"& textarea":{color:X=>v?`${X.palette.text.disabled} !important`:X.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:()=>N(!0),onBlur:()=>N(!1),onMouseDown:X=>{X.target?.classList.contains("react-resizable-handle")&&X.preventDefault()},children:[s.jsx(Le,{className:"formula-editor",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",alignSelf:"baseline",paddingLeft:X=>X.spacing(1),paddingRight:X=>X.spacing(1)},children:s.jsx(eN.ResizableBox,{height:C,draggableOpts:{grid:[E,E]},minConstraints:[E,E],maxConstraints:[15*E,15*E],onResize:k,onResizeStop:S,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?lR:Lx,{})),tooltipProps:{label:(T>1?"Collapse":"Expand")+" Formula Bar",simple:!0},onMouseDown:X=>{X.button===0&&X.preventDefault()},onClick:()=>{const X=T>1?1:_;R(X*E+1),j(X)}}),s.jsx(Le,{sx:{position:"absolute",width:"100%",height:"2px",bottom:"0",willChange:"opacity",transition:"opacity 60ms ease-in",opacity:M?1:0,borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:X=>X.palette.primary.main,borderRadius:X=>`${X.shape.borderRadius}px`}})]})]}),[F,z,M,T,E]),U=u.useMemo(()=>D||V?!D&&V?V:D&&!V?D:s.jsx(s.Fragment,{children:s.jsx(q5,{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='${B.palette.text.icon??B.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:D,elementAfter:V})}):null,[D,V]),J=ir(t,()=>({isFormulaBarElement:()=>!0,getNamedCollectionEditorElement:()=>A.current}),[]);return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",gap:X=>X.spacing(.5),...n},ref:J,...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:Yt.Menuitem}),[c,d]),f=s.jsxs(s.Fragment,{children:[s.jsx(qe,{...p,command:o.getCommand("sortAscending"),icon:ze(s.jsx(uh,{}))}),s.jsx(qe,{...p,command:o.getCommand("sortDescending"),icon:ze(s.jsx(nv,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,command:o.getCommand("autoFilterClear"),icon:ze(s.jsx($3,{}))}),[]]});return s.jsx(Le,{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,[E,C]=u.useState(()=>!!o&&o.getProtection().isLocked()),[R,_]=u.useState(()=>o?o.getTabColor():null);sn(o,{onProtectionChange:()=>{C(o.getProtection().isLocked())},onTabColorChange:()=>{_(o.getTabColor())},onStyleChange:()=>{_(o.getTabColor())}});const L=qi(),T=f===l;let j=null,S=null;if(R||h){let O=x;R?(S=R.toBlackOrWhite().toCSS(),O=R?.toCSS()):T||(O=L.palette.background.paper),j=s.jsx(Le,{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&&R?`linear-gradient(0deg, ${O} 0%, transparent)`:O}})}let k=null;typeof g=="string"?k=g:g?.toCSS&&(k=g.toCSS());const P=T?s.jsx(Le,{sx:{width:"100%",borderRadius:"4px",minWidth:"4px",height:"2px",backgroundColor:O=>O.palette.primary.main}}):null;return s.jsx(hw,{theme:T?b??L:L,children:s.jsx(Le,{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(nI,{style:{flex:"1 1 100%",display:"flex",flexDirection:"row"},radius:v,strokeColor:T?k:"transparent",children:s.jsx(Lc,{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":S||"text.secondary",backgroundColor:T?x:"transparent","&:hover:not([disabled])":{backgroundColor:T?x:"transparent"},"& input":{color:O=>`${O.palette.text.primary}`,textAlign:"center",fontWeight:"500"},marginTop:"0px",minWidth:"unset"},disabled:p,disableRipple:c,component:"div",children:s.jsxs(s.Fragment,{children:[j,s.jsxs(Le,{sx:{zIndex:"1",display:"flex",flexDirection:"row",alignItems:"center"},children:[s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"1px",lineHeight:"1",marginTop:T?void 0:"1px"},children:[n,P]}),E?s.jsx(v2,{sx:{scale:"0.80",marginLeft:"2px",width:"22px",height:"22px"},color:"secondary"}):s.jsx(Le,{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());sn(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(qe,{command:r.getCommand("addSheet"),commandState:o,...x,variant:Yt.Menuitem}),s.jsx(qe,{command:r.getCommand("deleteSheet"),...x,variant:Yt.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(qe,{command:r.getCommand("duplicateSheet"),...x,variant:Yt.Menuitem}),s.jsx(qe,{command:r?.getCommand("protectionSheetToggle"),...x,variant:Yt.Menuitem,icon:s.jsx(v2,{})}),s.jsx(Ys,{variant:Yt.Menuitem,command:r.getCommand("formatSheetTabColor"),icon:s.jsx(N3,{}),panelProps:{disableAlpha:!0,autoColorLabel:"No Tab Color",autoColorPosition:Is.End},parentFloat:l}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{command:r.getCommand("hideSheet"),...x,variant:Yt.Menuitem,icon:ze(s.jsx(rv,{}))})]});return s.jsx(Le,{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());sn(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,E=v.getProtection().isLocked(),C=v.getTabColor(),R=o?.body.fill??"transparent";let _=null,L=null,T=R;C&&(T=C.toCSS(),w||(L=C.toBlackOrWhite().toCSS()),_=s.jsx(Le,{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(Le,{sx:{flex:"1 1 100%",boxSizing:"content-box",opacity:w||b===$.ISheet.Visibility.Hidden?"50%":"100%",border:S=>w?`${R} solid 1.5px`:`${S.palette.divider} solid 1px`,background:w&&C?`linear-gradient(0deg, ${T} 0%, ${R})`:T,borderRadius:"4px"}})}));let j=null;E&&(j=s.jsx(v2,{color:"secondary"})),b!==$.ISheet.Visibility.Visible&&(j=ze(s.jsx(rv,{style:{opacity:p.isStructureAllowed()?1:.7},color:"secondary"}))),j&&(j=s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",alignItems:"center",ml:"16px","& *":{lineHeight:"1em",fontSize:"1.3em"}},children:j})),g.push(s.jsx(Gr,{disabled:!p.isStructureAllowed()&&b===$.ISheet.Visibility.Hidden,sx:{color:S=>{let k=w?S.palette.primary.main:S.palette.text.secondary;return L&&(k=L),b===$.ISheet.Visibility.Hidden&&(k=pt(k,S.palette.action.disabledOpacity)),k},borderLeft:S=>`${w?S.palette.primary.main:"transparent"} solid 2px`,paddingLeft:"4px",fontWeight:w?"700":"400","&:hover":{fontWeight:"700"}},icon:w?s.jsx(k1,{}):void 0,onMouseDown:S=>S.preventDefault(),onMouseUp:()=>{Promise.resolve(r.closeAll()).then(()=>{try{v.select()}catch(S){console.error(S)}})},children:s.jsxs(s.Fragment,{children:[_,s.jsxs(Le,{sx:{paddingRight:"0px",paddingLeft:"4px",display:"flex",flexDirection:"row",flex:"1 1 100%",overflow:"hidden",alignItems:"center",zIndex:2},children:[s.jsxs(Le,{className:"sheet-name",sx:{display:"flex",flexDirection:"column",paddingLeft:"8px",paddingRight:"8px",alignItems:"center"},children:[v.getName(),s.jsx(Le,{sx:{height:"0px",opacity:"0",fontWeight:"700"},children:v.getName()})]}),j]})]})},""+x))}return g},[n,p,c,r,o]);return s.jsx(Le,{ref:t,className:Eo("menu",a),...l,children:h})}));$f.displayName="SheetsAllMenu";var nN=function(){},yC=typeof window<"u",oN=yC?u.useLayoutEffect:u.useEffect,oy={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const i1=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 oN(function(){if(t)return a.observe(t),function(){a.disconnect()}},[t]),[n,r]}:function(){return[nN,oy]};function Ju(){return Ju=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},Ju.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},dc="unmounted",gl="exited",yl="entering",us="entered",qh="exiting",ba=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=gl,i.appearStatus=yl):a=us:a=o.unmountOnExit||o.mountOnEnter?dc:gl,i.state={status:a},i.nextCallback=null,i}xC(t,e),t.getDerivedStateFromProps=function(o,r){return o.in&&r.status===dc?{status:gl}: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!==yl&&i!==us&&(r=yl):i!==yl&&i!==us||(r=qh)}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===yl){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===gl&&this.setState({status:dc})},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:yl},function(){r.props.onEntering(c,d),r.onTransitionEnd(f,function(){r.safeSetState({status:us},function(){r.props.onEntered(c,d)})})})):this.safeSetState({status:us},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:qh},function(){o.props.onExiting(a),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:gl},function(){o.props.onExited(a)})})})):this.safeSetState({status:gl},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===dc)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 ls(){}ba.contextType=bC,ba.propTypes={},ba.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ls,onEntering:ls,onEntered:ls,onExit:ls,onExiting:ls,onExited:ls},ba.UNMOUNTED=dc,ba.EXITED=gl,ba.ENTERING=yl,ba.ENTERED=us,ba.EXITING=qh;var d5=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})},Kh=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&&d5(o,a),l&&d5(o,l),c&&d5(o,c)},n.render=function(){var o=this.props;o.classNames;var r=Vf(o,["classNames"]);return u.createElement(ba,Ju({},r,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(u.Component);Kh.defaultProps={classNames:""},Kh.propTypes={};const wC={Light:"light",Dark:"dark"},u5=.12,Gh=(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:fi(d,u5,c.palette?.mode),darkMode:c.palette.mode==="dark"}},r=o(t);n.body=o(e),n.header={...n.body,strokeFill:fi(n.body.fill,u5,e.palette?.mode),fill:t&&e.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?n.body.fill:fi(n.body.fill,.055,e.palette?.mode),edgeStrokeFill:e.palette.mode==="dark"?n.body.strokeFill:fi(n.body.fill,.328,e.palette?.mode)},n.headerHover=c=>({...n.header,strokeFill:fi(c?.fill??n.body.fill,.22,e.palette?.mode),fill:fi(c?.fill??n.header.fill,.065,e.palette?.mode),text:{...c?.text,fontWeight:e.typography?.fontWeightBold}});const i=fi(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:fi(r.fill,u5,t.palette?.mode),fill:t&&t.palette.mode==="dark"&&t.palette.mode!==e.palette.mode?r.fill:fi(r.fill,.055,t.palette?.mode),edgeStrokeFill:t.palette.mode==="dark"?r.strokeFill:fi(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 a1=u.memo(u.forwardRef((e,t)=>{const{children:n,sx:o,parentFloat:r,...i}=e,a=ir(t,()=>({}),[]),[l,c]=i1(),d=u.useRef(null),p=u.useRef(null),[f,h]=u.useReducer(C=>C+1,0),[g,m]=u.useState(null),[y,x]=u.useState(null),[v,b]=u.useState(null),{reference:w}=pa({parentFloat:r,label:"overflow"});u.useLayoutEffect(()=>{p.current={refs:[]};const C=[],R=u.Children.toArray(n);let _=0;R.forEach((L,T)=>{C.push(s.jsx(Le,{sx:{display:"flex"},ref:j=>{_++,_===R.length&&h();const S={current:null};S.current=j,p.current.refs[T]=S},children:L},T))}),m(C)},[n,c]),u.useLayoutEffect(()=>{if(!g)return;const C=p.current.refs;if(!a.current||!C||C.length===0)return x(null),void b(null);const R=a.current?.getBoundingClientRect(),_=[],L=[];let T=0,j=!1;for(let k=0;!j&&k<C.length;k++){const P=C[k];if(!P)continue;if(!P.current){j=!0;continue}const O=P.current.getBoundingClientRect();T+=O?.width,T>R.width&&(j=!0)}if(!j)return x(null),void b([]);const S=d.current?.getBoundingClientRect();T=0;for(let k=0;k<C.length;k++){const P=C[k];let O=!1;if(P.current){const I=P.current.getBoundingClientRect();T+=I?.width,T<R.width-S.width&&(O=!0)}O?_.push(g[k]):L.push(g[k])}x(_.length>0?_:null),b(L.length>0?L:null)},[n,g,c,w,f]);const E=_e(C=>{const R=[];for(let L=0;L<v.length;L++){let T=u.Children.toArray(v[L]);const j=T[0];T=u.Children.toArray(j.props.children?.props.children??j.props.children);const S=T[0],k={...S.props};k.parentFloat&&(k.parentFloat=C.floatReference);const P=u.cloneElement(S,k);R.push(P)}const _=s.jsx(Le,{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:R});return Bn({...C,children:_})},[v]);return s.jsxs(Le,{className:"overflow-palette",sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",width:"100%",maxWidth:"100%",...o},ref:V2([a,l,t]),...i,children:[s.jsx(Le,{sx:{flexDirection:"row",display:"flex",maxWidth:"100%",flex:"1 1 100%"},children:y??g}),s.jsx(Le,{sx:{display:v!==null&&v.length===0?"none":"flex",flex:"1 1 0"},children:s.jsx(Ui,{createPopupPanel:E,ref:d,parentFloat:w,createTooltip:({children:C},R)=>s.jsx(br,{label:"More",description:"More toolbar options…",disabled:R,children:C}),icon:s.jsx(Wb,{children:s.jsx(uR,{})})})})]})})),CC="https://unpkg.com/@sheetxl/scripting-templates/dist",rN=[{key:"SheetXL",description:"SheetXL",mimeType:".sxl",exts:["sxl"],isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DN04BBJX0G6Imvov.cjs"))).fromBufferJSON(e,t)},{key:"CSV",description:"Comma Delimited",mimeType:"text/csv",exts:["csv"],handler:async(e,t)=>(await Promise.resolve().then(()=>require("./s3GJkzAMIO6cYaSZ.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("./BvyNLM_Rh4usHxN8.cjs")).then(n=>n.i)).fromBufferXLSX(e,t)}],iN=[{key:"SheetXL",mimeType:"application/vnd.sheetxl.sheet",description:"SheetXL",ext:"sxl",isDefault:!0,handler:async(e,t)=>(await Promise.resolve().then(()=>require("./DN04BBJX0G6Imvov.cjs"))).toBufferJSON(e,t)},{key:"CSV",mimeType:"text/csv",description:"Comma Delimited",ext:"csv",handler:async(e,t)=>(await Promise.resolve().then(()=>require("./s3GJkzAMIO6cYaSZ.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("./BvyNLM_Rh4usHxN8.cjs")).then(n=>n.i)).toBufferXLSX(e,t)}];class kC{constructor(t=rN,n=iN){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?.typedConstructorOptions?.[n]};let l;delete a.typedConstructorOptions;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=_R.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?.typedConstructorOptions?.[i.key]};delete l.typedConstructorOptions;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 aN(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;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 aN{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 lN=new kC;var ly,sy,sN=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,El=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 sN.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:El,WorkbookIO:lN},Symbol.toStringTag,{value:"Module"})),cN=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=El.relativePath(e,"./manifest.json"),n=await fetch(t);if(!n.ok)throw new N5(`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 N5(`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=El.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:cN(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)},p5={fontSize:"0.8rem",marginRight:"4px"},dN=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:p5}):n.metadata?.icon==="macro"?s.jsx(K3,{sx:p5}):s.jsx(zx,{sx:p5}),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!==tn.Enter&&c.keyCode!==tn.Space||r(n)},...a,children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden"},children:[s.jsx(Mn,{component:"div",children:n.metadata?.title??n.path}),s.jsx(Mn,{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:Yt.Menuitem,commandHook:o,scope:"scripts",disabled:i},b=C=>{g.getEditor()?.insertSnippet(C.content),y.closeFloat()},w=[];for(let C=0;C<c.length;C++){const R=c[C];R&&w.push(s.jsx(dN,{handleInsert:b,snippet:R},R.path))}const E=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[w.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:w}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(qe,{...v,key:"help",command:n.getCommand("help"),icon:ze(s.jsx(iv,{}))})]});return Bn({...y,children:E})},[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(ED,{})),...l})})),Wf=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(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(a1,{parentFloat:o,style:{},children:s.jsx(qe,{...c,command:n.getCommand("saveScripts"),icon:ze(s.jsx(MD,{}))})})}),s.jsx("div",{style:{flex:"1 1 100%"}}),s.jsx("div",{children:s.jsx(a1,{parentFloat:o,style:{},children:s.jsx(MC,{...c,commands:n})})})]})})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})}));Wf.displayName="ScriptEditorToolbar";const h5={fontSize:"1rem"},TC=u.memo(u.forwardRef((e,t)=>{const{scriptPath:n=CC,onScriptSelect:o,sx:r=_n.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 E=0;E<w.length;E++){const C=w[E];C&&b.push(C)}}catch(w){y(w instanceof Error?w.message:"Failed to load scripts"),w instanceof N5||console.error("Error loading scripts:",w)}finally{f(b),g(!1)}})()},[n]),h)return s.jsx(Le,{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(p3,{})});let x=null;m&&(x=s.jsxs(Le,{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(Mn,{color:"error",variant:"h6",component:"div",gutterBottom:!0,children:"Error loading Templates"}),s.jsx(Mn,{color:"error",component:"div",children:m})]}));const v=b=>{const w=b.metadata?.icon;return w==="macro"?s.jsx(K3,{sx:h5}):w==="formula"?s.jsx(lv,{sx:h5}):w==="autostart"?s.jsx(zx,{sx:h5}):null};return s.jsxs(Le,{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(Le,{p:3,className:"script-select-content",sx:{overflow:"auto",flex:"1 1 auto"},children:[s.jsx(Mn,{variant:"h6",gutterBottom:!0,children:"Script Template"}),s.jsx(Mn,{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(Mn,{variant:"body2",component:"div",color:"text.secondary",gutterBottom:!0,children:"Templates provide a foundation to customize and meet your specific needs."}),s.jsx(Le,{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(Lc,{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(Le,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:.5},children:[s.jsx(Mn,{variant:"subtitle2",component:"div",children:b.metadata?.title||b.path.split("/").pop()?.replace(/\.\w+$/,"")||"Untitled"}),v(b)]}),b.metadata?.summary&&s.jsx(Mn,{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=qi(),[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 D=!1;return w(null),async function(){if(p&&(await p.start(),!D)){const F=p.getModules().search()[0]?.getSource();w({source:F||null})}}(),()=>{D=!0}},[p]);const E=u.useCallback(D=>{v(F=>({...F,...D}))},[]),C=u.useRef(null),R=u.useRef(null),[_,L]=u.useState(null),T=u.useRef(null),j=_e(D=>{if(_)return _.focus(D),!0;if(c){const F=R.current?.querySelectorAll?.(c);if(F&&F.length>0)return F[0]?.focus?.(D),!0}return R.current?.focus?.(D),!1},[_,c,d]),S=u.useMemo(()=>s.jsx(i0,{transitionDelay:"160ms",style:{position:"absolute",width:"100%",height:"100%"},transparentBackground:!1}),[]),k=u.useMemo(()=>s.jsx(Mi,{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:D=>D.spacing(.5),marginRight:D=>D.spacing(.5),marginTop:D=>D.spacing(1),marginBottom:D=>D.spacing(1)},children:s.jsx(Wf,{commands:i})}),[h,i]),P=u.useMemo(()=>s.jsx(Le,{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(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"1 1 100%",color:D=>D.palette.text.secondary},variant:"caption",children:x.message}),s.jsx(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",color:D=>D.palette.text.secondary},variant:"caption",children:x.dirty?"Unsaved":""}),s.jsx(Mn,{component:"div",sx:{userSelect:"none",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis",flex:"none",marginLeft:"8px",minWidth:"90px",display:"flex",justifyContent:"end",color:D=>D.palette.text.secondary},variant:"caption",children:x.cursor})]})}),[x]),O=u.useMemo(()=>s.jsxs(Le,{className:Eo("script-editor-content"),sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"column",boxSizing:"border-box"},children:[k,s.jsx(Le,{sx:{display:"flex",flex:"1 1 100%",width:"100%",flexDirection:"row",position:"relative",boxSizing:"border-box"},children:s.jsx(VB,{ref:R,loadingPanel:S,readOnly:a,onClose:l,autoFocus:d,commands:i,onStatusChange:E,darkMode:h.palette.mode==="dark",...r})}),P]}),[h,i,k,P,g,S,a,r,d,c,l,E]),I=u.useMemo(()=>s.jsx(Mx,{className:Eo({"Mui-selected":y.current}),sx:{display:"flex",color:D=>D.palette.text.secondary,boxSizing:"border-box",padding:"0 0",transitionProperty:"opacity",transitionDuration:D=>`${D.transitions.duration.shortest}ms`,opacity:.7,"&.Mui-selected":{opacity:1,transitionDuration:D=>D.transitions.duration.shortest/2+"ms"},backgroundColor:D=>pt(D.palette.action.hover,.03),borderBottom:D=>`solid ${pt(D.palette.divider,.2)} 1px`},onPointerDown:D=>{D.isDefaultPrevented()||(D.preventDefault(),j())},children:s.jsxs(Le,{sx:{display:"flex",flex:"1 1 10%",flexDirection:"row",alignItems:"center",marginTop:D=>D.spacing(.25),marginBottom:D=>D.spacing(.25),marginLeft:D=>D.spacing(1),marginRight:D=>D.spacing(1)},children:[s.jsx(Le,{sx:{flex:"1 1 100%",paddingLeft:D=>D.spacing(1)},children:"Script (Typescript)"}),s.jsx(br,{label:"Close",children:s.jsx(Tr,{"aria-label":"close",sx:{color:D=>D.palette.text.icon??D.palette.action.active},touchRippleRef:C,onPointerDown:D=>{C.current?.start(D,{center:!1}),D.stopPropagation(),D.preventDefault()},onPointerUp:()=>{R.current?.close()},children:s.jsx(E3,{})})})]})}),[h,g]),z=u.useMemo(()=>{let D;return b===null?null:(b.source===null&&(D=s.jsx(TC,{sx:{display:"flex",flex:"1 1 100%",flexDirection:"column",overflow:"hidden",position:"absolute",boxSizing:"border-box",width:"100%",height:"100%"},onScriptSelect:F=>{R.current?.getEditor().insertSnippet(F.content),w({source:F.content??""})}})),s.jsxs(Le,{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:F=>{F.isDefaultPrevented()||R.current?.focus()},children:[I,s.jsxs(Le,{sx:{flex:"1 1 100%",position:"relative",display:"flex"},children:[O,D]})]}))},[k,O,n,b]),A=ir(t,()=>({isScriptWorkspaceElement:()=>!0,focus:D=>{j(D)}}),[]);return s.jsx(Le,{sx:{display:"flex",flexDirection:"row",flex:"1 1 100%",position:"relative",...o},ref:A,...f,onFocus:D=>{m(!0),y.current=!0,A.current?.contains(D.target)&&D.target!==A.current&&L(D.target),D.relatedTarget&&!T.current&&(T.current=D.relatedTarget),f?.onFocus?.(D)},onBlur:D=>{A?.current?.contains(D.relatedTarget)||A?.current===D.relatedTarget||(T.current=null,y.current=!1,m(!1)),f?.onBlur?.(D)},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:Yt.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(qe,{...f,command:p.getCommand("executeScript"),commandState:{declaration:v},tooltipProps:{description:`Execute ${v.getName()??"script"}`},icon:ze(s.jsx(K3,{})),labelOverride:v.getName()??`Script '${v.getName()}'`},`script-${v.getName()}-${x}`))}const y=s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",flex:"1 1 100%",overflow:"hidden"},children:[m.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Le,{sx:{overflow:"auto",flex:"1 1 100%"},children:m}),s.jsx(Ft,{orientation:"horizontal"})]}):null,u.createElement(qe,{...f,key:"show-editor",command:p.getCommand("showScriptEditor"),icon:ze(s.jsx(yD,{}))})]});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(kD,{})),...a})})),uN=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(Ys,{...f,command:n.getCommand("formatFontColor"),icon:s.jsx(EP,{}),isSplit:!0,panelProps:{disableAlpha:!0}}),g=s.jsx(Ys,{...f,command:n.getCommand("formatFillColor"),icon:s.jsx(kP,{}),isSplit:!0,panelProps:{disableAlpha:!0,autoColorLabel:"No Fill",autoColorPosition:Is.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 E=0;w&&!b&&E<w?.length;E++)b=!0;b&&(x=s.jsxs(s.Fragment,{children:[s.jsx(Ft,{}),s.jsx(qf,{...f})]}))}return s.jsxs(a1,{parentFloat:o,children:[m,null,m?s.jsx(Ft,{}):null,s.jsx(jf,{...f,command:n.getCommand("paste")}),s.jsx(qe,{...p,command:n.getCommand("formatPainterToggle"),icon:ze(s.jsx(OO,{}))}),s.jsx($2,{...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(qe,{...p,command:n.getCommand("formatBoldToggle"),icon:s.jsx(PI,{})}),s.jsx(qe,{...p,command:n.getCommand("formatItalicToggle"),icon:s.jsx(II,{})}),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(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:c,...i})})),pN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(a1,{parentFloat:o,children:[null,s.jsx(qe,{...c,command:n.getCommand("updateHyperlink"),icon:ze(s.jsx(ch,{}))}),s.jsx(qe,{...c,command:n.getCommand("updateComments"),icon:ze(s.jsx(dh,{}))}),s.jsx(If,{...d}),s.jsx(qe,{...c,command:n.getCommand("insertTable"),icon:ze(s.jsx(qc,{}))})]})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),hN=u.memo(u.forwardRef((e,t)=>{const{commands:n,parentFloat:o,commandButtonProps:r,...i}=e,a=_e(l=>{const{commandButtonProps:c,commandPopupProps:d}=l;return s.jsxs(a1,{parentFloat:o,children:[s.jsx(VS,{...d}),s.jsx(qe,{...c,command:n.getCommand("protectionSheetToggle"),icon:s.jsx(v2,{color:"secondary"})}),s.jsx(Ft,{}),s.jsx(KS,{...d}),s.jsx(JS,{...d}),s.jsx(Ft,{}),s.jsx(qe,{...c,command:n.getCommand("sheetViewToggleFormulaView"),scope:"view",icon:s.jsx(Gs,{command:n.getCommand("sheetViewToggleFormulaView"),scope:"view"})}),s.jsx(qe,{...c,command:n.getCommand("sheetViewToggleShowZeros"),scope:"view",icon:s.jsx(Gs,{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(qe,{...c,command:n.getCommand("fullScreenToggle"),scope:"view",icon:()=>ze(n.getCommand("fullScreenToggle").state()?s.jsx(WO,{}):s.jsx(HO,{}))})]})},[n]);return s.jsx(E1,{ref:t,commands:n,parentFloat:o,commandButtonProps:r,createToolbarPalette:a,...i})})),_C=e=>s.jsx(yN,{...e}),fN=u.memo(e=>{const{sx:t,...n}=e;return s.jsxs(Le,{sx:{display:"flex",flexDirection:"column",position:"relative","&:hover:not([disabled]) .indicator":{borderBottom:o=>`${pt(o.palette.primary.main,.35)} solid 2px`}},children:[s.jsx(Ij,{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(Le,{className:"indicator",sx:{width:"90%",borderRadius:"4px",minWidth:"4px",position:"absolute",bottom:"0",alignSelf:"center",display:"flex"}})]})}),mN=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(fN,{label:t[c].label},t[c].label));return l},[t]);return s.jsx(Zj,{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})}),gN=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(b1,{value:d,sx:{color:f=>{if(n===d)return f.palette.primary.main}},children:p},p))}return c},[t,n]);return s.jsx(x1,{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(b2,{value:n,onChange:a,variant:"outlined",sx:{backgroundImage:`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`},...i,children:l})})}),yN=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 C=[],{ref:R,..._}=l?.Home||{};C.push({label:"Home",component:s.jsx(uN,{commands:n,..._})});const{ref:L,...T}=l?.Insert||{};C.push({label:"Insert",component:s.jsx(pN,{commands:n,...T})});const{ref:j,...S}=l?.View||{};return C.push({label:"View",component:s.jsx(hN,{commands:n,...S})}),C},[n]),g=u.useMemo(()=>{const C=[];for(let R=0;R<h.length;R++)C.push(u.cloneElement(h[R].component,{...h[R].component.props,key:h[R].key??h[R].label}));return C},[h]),[m,y]=u.useState(0),x=C=>{y(C)},v=u.useMemo(()=>s.jsx(i?gN:mN,{toolbars:h,value:m,onToolbarChange:x,sx:r}),[h,m,r,i]),{sx:b,...w}=c,E=s.jsx(Mi,{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:C=>C.spacing(1),marginRight:C=>C.spacing(1),marginTop:C=>C.spacing(.5),marginBottom:C=>C.spacing(.5),...b},...w,children:g[m]});return s.jsxs(Le,{ref:t,className:"toolbarWrappers",sx:{display:"flex",flexDirection:"column",paddingTop:C=>C.spacing(.5),"*":{userSelect:"none"},...p},...f,children:[o?o(v):v,a?a(E):E]})})),xN=e=>s.jsx(Nf,{...e}),bN=e=>s.jsx($f,{...e}),vN=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=xN,sheetsAllProps:p,renderSheetsAll:f=bN,sheetTabProps:h,renderSheetTab:g,background:m="transparent",className:y,notifier:x,sx:v,borderWidth:b,borderColor:w,gridTheme:E,gridStyle:C,...R}=e,[_,L]=u.useState(n?.getSelectedSheetIndex()),[T,j]=u.useState(n?.getSheets().search()),[S,k]=u.useState(n?.getProtection());sn(n,{onViewChange(ve){L(ve?.getSelectedSheetIndex())},onSheetsChange:ve=>{j(ve.getSheets().search())},onProtectionChange:ve=>{k(ve?.getProtection())}});const P=u.useMemo(()=>{const ve=[];for(let re=0;re<T.length;re++)ve.push(T[re].getName());return ve},[T]),O=u.useCallback(ve=>{r?.(ve)!==!1&&(n.getSheetAt(ve).select(),i?.(ve))},[n,r,i]),I=u.useCallback((ve,re)=>{n.getSheetAt(ve).setName(re),i?.(ve)},[n,i]),z=u.useCallback((ve,re)=>{n.getSheetAt(ve).setPosition(re),i?.(re)},[n,i]),A=_e(()=>{if(r?.(_)===!1)return;const ve=_+1;n.getSheets().add({name:void 0,autoSelect:!0}),i?.(ve)},[n,r,i,_]),D=u.useMemo(()=>({placement:"top-start"}),[]),F=u.useRef(null),[B,M]=u.useState(!1),N=u.useCallback(ve=>{const{closeFloatAll:re,floatReference:ce}=ve;return f({workbook:n,gridStyle:C,floatReference:ce,closeFloatAll:re,...p})},[f,p,a,n,C]),{reference:V,component:U}=pa({label:"allSheet",popperProps:D,anchor:F.current,onOpen:()=>M(!0),onClose:()=>M(!1),createPopupPanel:N}),J=u.useRef(null),[X,H]=u.useState(null),ne=u.useCallback(ve=>{const{floatReference:re}=ve;return d?.({workbook:n,index:X?.index,tabStripRef:J.current,commands:o,disabled:a,floatReference:re,...c})},[d,c,a,n,o,X]),{reference:oe,component:ye}=pa({label:"sheetTab",popperProps:D,anchor:{getBoundingClientRect:()=>new DOMRect(X?.left||0,X?.top||0,0,0)},onClose:()=>H(null),createPopupPanel:ne});u.useEffect(()=>{X?oe.open(0):oe.close(0)},[X]);const de=u.useCallback((ve,re)=>{ve.preventDefault(),H({left:ve.clientX-2,top:ve.clientY-4,index:re})},[]),xe=_e(ve=>{let re;try{re=n?.getSheetAt(ve.index)}catch{}return re?(g??vN)({sheet:re,gridTheme:E,onContextMenu:ce=>{O(ve.index),de(ce,ve.index)},...ve,...h}):null},[g,h,n,E]),we=u.useMemo(()=>l||!S?.isStructureAllowed()?null:s.jsx(di,{disableInteractive:!0,title:"New sheet",children:s.jsx(Tr,{disabled:a,component:"div",sx:{padding:"0","&:hover:not([disabled])":{color:ve=>ve.palette.primary.main},color:ve=>ve.palette.text.icon??ve.palette.action.active,"& svg":{width:"18px",height:"18px"}},"aria-label":"addTab",size:"small",onMouseDown:ve=>{ve.button===0&&ve.preventDefault()},onClick:()=>A(),children:s.jsx(eR,{})})}),[l,a,S,A]);return s.jsxs(Le,{ref:t,className:Eo(y),sx:{position:"relative",display:"flex",alignItems:"stretch",flex:"1 1 100%",maxWidth:"100%",...v},...R,children:[s.jsx(DS,{ref:J,selectedTabIndex:_,tabNames:P,onSelectedTabIndexChange:O,onTabNameChange:I,onTabMove:z,background:m,borderColor:w,borderWidth:b,activeColor:null,disabled:a,disableDrag:l||!S.isStructureAllowed(),createScrollStartButton:_D,createScrollEndButton:jD,createScrollEdgeButton:TD,createTabButton:xe,createTabDivider:ve=>{const{key:re,...ce}=ve;return s.jsx(Ft,{sx:{marginLeft:"-1px",marginRight:"0px",marginTop:"6px",marginBottom:"6px",background:Se=>pt(Se.palette.divider,.25)},...ce},re)},editLabelProps:{maxLength:31,styleHover:{fontWeight:"700"},onKeyPress:ve=>{n.isValidSheetNameCharacter(ve.key)||ve.preventDefault()},onCancel:()=>{i?.(_)},notifier:x},children:s.jsx(di,{disableInteractive:!0,title:B?"":"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:ve=>ve.palette.text.icon??ve.palette.action.active},ref:F,dense:!0,outlined:!1,selected:B,color:"primary","aria-label":"menu",onMouseDown:ve=>{ve.button===0&&ve.preventDefault()},onClick:()=>{B?V.close(0):V.open(0)},icon:s.jsx(dR,{})})})}),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:we}),s.jsx("div",{style:{borderTop:`solid ${w} ${b}px`,flex:1,minWidth:"24px"}}),ye,U]})}));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(k=>k+1,0),[f,h]=u.useState(n.getSelectedSheet()),[g,m]=u.useState(f.getSelectedRanges()),[y,x]=u.useState(f.getSelectedCell());sn(n,{onSheetsChange(){h(n.getSelectedSheet())}}),sn(f.getSelection(),{onChange(){m(f.getSelectedRanges()),x(f.getSelectedCell())}}),_o(o,[],{onChange:()=>{p()}});const v=u.useMemo(()=>({}),[]),b=u.useMemo(()=>({commandHook:{beforeExecute:(k,P)=>a.closeAll(),onExecute(){},onError(){console.log("onError")}},disabled:r,scope:"contextMenu",parentFloat:a}),[r,a]),w=u.useMemo(()=>({...v,...b,variant:Yt.Menuitem}),[v,b]),E=u.useMemo(()=>({commands:o,variant:Yt.Menuitem,parentFloat:a,...b}),[o,b,a]),C=[];let R=g.isEntireRows(),_=g.isEntireColumns();g&&(R&&(C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),C.push(u.createElement(qe,{command:o.getCommand("hideColumns"),...w,icon:ze(s.jsx(MO,{})),key:"context:"+C.length})),C.push(u.createElement(qe,{command:o.getCommand("unhideColumns"),...w,icon:ze(s.jsx(EO,{})),key:"context:"+C.length}))),_&&(C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),C.push(u.createElement(qe,{command:o.getCommand("hideRows"),...w,icon:ze(s.jsx(_O,{})),key:"context:"+C.length})),C.push(u.createElement(qe,{command:o.getCommand("unhideRows"),...w,icon:ze(s.jsx(TO,{})),key:"context:"+C.length}))),(R||_)&&C.push(s.jsx(Ft,{orientation:"horizontal"},"context:"+C.length)),R&&C.push(u.createElement(qe,{command:o.getCommand("autoFitColumns"),...w,icon:ze(s.jsx(rD,{})),key:"context:"+C.length})),_&&C.push(u.createElement(qe,{command:o.getCommand("autoFitRows"),...w,icon:ze(s.jsx(iD,{})),key:"context:"+C.length})));const L=[],T=o.getCommand("formatTableStyle"),j=T?.context()?.table();if(ol(T),!R&&!_){if(L.push(s.jsx(Ft,{orientation:"horizontal"},"contextBefore:"+L.length)),y?.getHyperlink())L.push(u.createElement(sa,{...E,popupCommandKeys:["updateHyperlink","deleteHyperlink"],popupScope:"hyperlink",key:"contextBefore:action"+L.length,quickCommand:"openHyperlink",icon:k=>k.key()==="openHyperlink"?ze(s.jsx(ch,{})):null}));else{const k=o.getCommand("updateHyperlink");L.push(u.createElement(qe,{command:k,...w,icon:ze(s.jsx(ch,{})),key:"contextBefore:"+L.length}))}if(y?.getComments())L.push(u.createElement(sa,{...E,popupCommandKeys:["deleteComments"],key:"contextBefore:action"+L.length,quickCommand:"updateComments",icon:k=>k.key()==="updateComments"?ze(s.jsx(dh,{})):null}));else{const k=o.getCommand("updateComments");L.push(u.createElement(qe,{command:k,...w,icon:ze(s.jsx(dh,{})),key:"contextBefore:"+L.length}))}j?L.push(u.createElement(sa,{...E,variant:Yt.Menuitem,key:"contextBefore:"+L.length,popupCommandKeys:["convertTableToRange","deleteTable"],popupScope:"table",scope:"context",commandState:j,quickCommand:"editTable",icon:k=>(k.key(),ze(s.jsx(qc,{})))})):L.push(u.createElement(qe,{command:o.getCommand("insertTable"),...w,icon:ze(s.jsx(qc,{})),key:"context:"+C.length})),L.push(u.createElement(If,{...E,key:"contextBefore:"+L.length}))}const S=s.jsxs(s.Fragment,{children:[s.jsx(qe,{command:o.getCommand("cut"),...w,icon:s.jsx(zP,{})}),s.jsx($2,{command:o.getCommand("copy"),...w}),s.jsx(jf,{command:o.getCommand("paste"),...E,includePasteAllInPopup:!1}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Tf,{...E}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(Ef,{commands:o,...E,disableSheet:!0}),s.jsx(Mf,{commands:o,...E,disableSheet:!0}),s.jsx(kf,{...E}),L,C]});return s.jsx(Le,{ref:t,className:Eo("menu",l),sx:{...i},...c,children:S})}));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 ys=="object"&&ys&&ys.Object===Object&&ys,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,E,C,R,_=0,L=!1,T=!1,j=!0;if(typeof m!="function")throw new TypeError("Expected a function");function S(z){var A=v,D=b;return v=b=void 0,_=z,E=m.apply(D,A)}function k(z){var A=z-R;return R===void 0||A>=y||A<0||T&&z-_>=w}function P(){var z,A,D=f();if(k(D))return O(D);C=setTimeout(P,(A=y-((z=D)-R),T?p(A,w-(z-_)):A))}function O(z){return C=void 0,j&&v?S(z):(v=b=void 0,E)}function I(){var z,A=f(),D=k(A);if(v=arguments,b=this,R=A,D){if(C===void 0)return _=z=R,C=setTimeout(P,y),L?S(z):E;if(T)return C=setTimeout(P,y),S(R)}return C===void 0&&(C=setTimeout(P,y)),E}return y=g(y)||0,h(x)&&(L=!!x.leading,w=(T="maxWait"in x)?d(g(x.maxWait)||0,y):w,j="trailing"in x?!!x.trailing:j),I.cancel=function(){C!==void 0&&clearTimeout(C),_=0,v=R=b=C=void 0},I.flush=function(){return C===void 0?E:O(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,Id={exports:{}},ps={exports:{}},wN=ps.exports;(function(){if(xy)return Id.exports;xy=1;for(var e=(yy||(yy=1,function(){var f,h,g,m,y,x;typeof performance<"u"&&performance!==null&&performance.now?ps.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(ps.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?(ps.exports=function(){return Date.now()-g},g=Date.now()):(ps.exports=function(){return new Date().getTime()-g},g=new Date().getTime())}.call(wN)),ps.exports),t=typeof window>"u"?ys: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)}}Id.exports=function(f){return r.call(t,f)},Id.exports.cancel=function(){i.apply(t,arguments)},Id.exports.polyfill=function(f){f||(f=t),f.requestAnimationFrame=r,f.cancelAnimationFrame=i}})();var ta={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=_e(l,[l]),m=_e(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 He("newCellStyle",r,{label:"New Cell Style…",scopedLabels:{cellStyle:"New Cell Style"},description:"Create a new named style can can be quickly used later."}),new He("deleteCellStyle",r,{label:"Delete Cell Style",scopedLabels:{cellStyle:"Delete"},description:"Remove a named style that is no longer needed."}),new He("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 He("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 He("deleteSheet",r,{label:"Delete Sheet",scopedLabels:{sheet:"Delete"},description:"Delete the sheet and all the data."}),new He("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 He("duplicateSheet",r,{label:"Duplicate Sheet",description:"Duplicate the current sheet.",scopedLabels:{sheet:"Duplicate"}}),new He("nextSheet",r,{label:"Next Sheet",scopedLabels:{sheet:"Next"},description:"Activate the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl]}]}),new He("previousSheet",r,{label:"Previous Sheet",scopedLabels:{sheet:"Previous"},description:"Activate the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl]}]}),new He("selectNextSheet",r,{label:"Select Next Sheet",scopedLabels:{sheet:"Select Next"},description:"Select the next sheet.",shortcut:[{key:"PageDown",modifiers:[$e.Ctrl,$e.Shift]}]}),new He("selectPreviousSheet",r,{label:"Select Previous Sheet",scopedLabels:{sheet:"Select Previous"},description:"Select the previous sheet.",shortcut:[{key:"PageUp",modifiers:[$e.Ctrl,$e.Shift]}]}),new He("selectTheme",r,{label:"Theme",description:"Select a theme that coveys a style suitable for your data."}),new He("selectNamed",r,{label:k=>k?.getName()??"Select Named Item",scopedLabels:{namedItem:k=>k?.getName()??"Select"},description:"Select the item."}),new He("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 He("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 He("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 He("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new He("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[$e.Alt]}]},function(k=!0){g?.()}),new He("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new He("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new He("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new He("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[$e.Ctrl]}}),new He("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new He("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 k=null;return k=i?i.createChildGroup(r,"workbook",!1):new r0(r,"workbook"),k.addCommands(y,!0),k},[i,y]),v=Hi(),b=u.useRef(null),w=_e(()=>{let k,P=null;const O=x.getCommand("executeScript");if(O.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!O)return;const I=x.getCommand("executeSelectedScript");if(!I)return;const z={saveSource:async A=>{let D=null,F=null;const B=t.getScripts();try{A&&(F=await o?.showBusy?.("Saving Scripts..."),D=await B.createModule({source:A})),B.addModule("scripts",D,{replace:!0}),F?.()}catch(M){F?.(),console.warn("Unable to compile",M),o?.showError?.(M)}return D},addContainerListener:A=>(E.current=A,()=>{E.current=null}),setSelectedFunction:A=>{k=A??b.current??null,Promise.resolve(k).then(D=>{I.update({disabled:D===null})})},quickInsertFunction:A=>{const D=`=${A.toUpperCase()}(`,F={text:D+")",editMode:!0,initialSelection:{start:D.length,end:D.length+0}};v.setMode(B=>B?.key==="edit"?{...B,args:{...B.args}}:{key:"edit",args:{stateAndCoords:null,start:F}})},getSelectedFunction:()=>k,setEditor:A=>{P=A??null,x.getCommand("showScriptEditor")?.update({state:A!==null})},getEditor:()=>P,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]),E=u.useRef(null);sn(t,{onBeforeSave:async()=>{await E.current?.onBeforeSave()},onProtectionChange:()=>{E.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),E.current?.onScriptChange()))()}}),sn(t,{onSheetsChange:k=>{h(k.getSheets().search())},onViewChange(k){p(k?.getSelectedSheet())},onProtectionChange:k=>{const P={disabled:!k.getProtection().isStructureAllowed()};x.getCommand("hideSheet").update(P),x.getCommand("deleteSheet").update(P),x.getCommand("addSheet").update(P),x.getCommand("duplicateSheet").update(P)},onScriptsChange:k=>{w()}});const{isFullscreenAvailable:C,isFullscreenEnabled:R,toggleFullscreen:_}=function(k={}){const{target:P,onChange:O,onError:I,requestFullScreenOptions:z}=k,[A,D]=u.useState(!1),[F,B]=u.useState(null),[M,N]=u.useState(!1),V=u.useCallback(()=>ta.requestFullscreen(P?.current||null,z),[P,z]),U=u.useCallback(()=>ta.exitFullscreen(),[]),J=u.useCallback(()=>ta.fullscreenElement?U():V(),[V,U]),X=u.useCallback(ne=>{const oe=ta.fullscreenElement;B(oe),N(!!oe),O?.(ne)},[O]),H=u.useCallback(ne=>{const oe=ta.fullscreenElement;B(oe),N(!!oe),I?.(ne)},[I]);return u.useEffect(()=>{D(ta.fullscreenEnabled)},[]),u.useEffect(()=>(ta.on("change",X),ta.on("error",H),()=>{ta.off("change",X),ta.off("error",H)}),[X,H]),{isFullscreenAvailable:A,fullscreenElement:F,isFullscreenEnabled:M,enableFullscreen:V,disableFullscreen:U,toggleFullscreen:J}}({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=_e(async function(k,P){let O=null;const I=t.getScripts();if(k?.declaration||k?.functionName){const z=k.declaration?k.declaration.getName():k.functionName;I.searchFunction({name:z}).length>0&&(O=z)}if(O)try{await I.executeMacro(O),b.current=Promise.resolve({source:null,name:O})}catch(z){return void o?.showError?.(z)}},[t,o]);u.useEffect(()=>{x.getCommand("newCellStyle").updateCallback(k=>{o?.showInputOptions?.({initialValue:(()=>{let P=0;for(;;){P++;const O=`Style ${P}`;try{return t.getStyles().validateStyleName(O,!0),O}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(P,O)=>{let I=null;try{t.getStyles().validateStyleName(P,!1)}catch(D){I=D.message}let z=t.getStyles().getNamed(P),A=I;return!A&&z&&(A=`Update style '${z.getName()}'.`),{valid:I===null,message:A}}}).then(({input:P,option:O})=>{const I=t.getSelectedSheet().getSelectedRange();if(O!=="Ok")return;const z=t.getStyles().setNamed({name:P,style:I.getCell().getStyle()});I.updateStyle({named:z.getName()})})}),x.getCommand("deleteCellStyle").updateCallback(k=>{k.delete()}),x.getCommand("modifyCellStyle").updateCallback(({named:k})=>{const P=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:k.getName(),style:P.getCell().getStyle()})}),x.getCommand("hideSheet").updateCallback(k=>{t.getSheetAt(k).setVisibility($.ISheet.Visibility.Hidden)}),x.getCommand("deleteSheet").updateCallback(async k=>{t.getSheetAt(k??t.getSelectedSheetIndex())?.delete()}),x.getCommand("addSheet").updateCallback(k=>{t.getSheets().add({index:k,autoSelect:!0})}),x.getCommand("duplicateSheet").updateCallback(async k=>{(await t.getSheetAt(k??t.getSelectedSheetIndex())?.duplicate())?.select()}),x.getCommand("nextSheet").updateCallback(k=>{t.getNextSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("previousSheet").updateCallback(k=>{t.getPreviousSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectNextSheet").updateCallback(k=>{t.getNextSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectPreviousSheet").updateCallback(k=>{t.getPreviousSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectTheme").updateCallback(k=>{t.setTheme(k)}),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 j=_e(async k=>{let P=0,O=null,I="Find & Replace";k?.replace&&!k?.replaceOptions?.maxCount&&(I="Replace All");const z=await o?.showBusy?.(I);try{const A=k?.scope??"sheet";let D=null;const F={from:t.getSelectedSheet().getSelectedCell(),...k.findOptions};if(D=A==="sheet"?t.getSelectedSheet().find(k.findText,F):t.find(k.findText,F),k.replace){const B=t.replace(D,k.replaceText,k.replaceOptions);P=B.count,k.replaceOptions.maxCount&&(O=B.last)}else{let B=D.next();B.done||(P++,O=B.value)}O?.select({autoFocus:!1}),z?.(),!k.replaceOptions.maxCount&&P>1&&o?.showMessage?.(`We replaced ${P} cells.`)}catch(A){z?.(),o?.showError?.(A)}return P},[t,n]),S=_e(k=>{const P={value:k,context:{selection:()=>{const O=t.getSelectedRanges(),I=[];for(let z=0;z<O.getCount();z++){const A=O.at(z).getFixed(!0).getCoords();I.push(A)}return t.getRanges(I)},getNames:()=>t.getNames()},onUpdate:async O=>{try{await O.select()}catch(I){o?.showMessage?.(I.message,{type:ua.Error})}}};return o.showWindow?.("namedDetails",P)},[o,t,n]);return u.useEffect(()=>{const k=(P=!1)=>{const O=t.getSelectedCell(),I={onFindOrReplace:j,onKeyDown:z=>{x.findCommandByEvent(z)!==x.getCommand("find")&&x.findCommandByEvent(z)!==x.getCommand("findReplace")||z.preventDefault()},findOptions:{},findText:O.toTextUnformatted(!0)};I.replace=P,o.showWindow?.("find",I,{disableAutoDestroy:!0})};x.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{k()}),x.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{k(!0)}),x.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const P={onInputOption:async O=>{try{await t.getRanges(O).select()}catch(I){o?.showMessage?.(I.message,{type:ua.Error})}},onKeyDown:O=>{x.findCommandByEvent(O)===x.getCommand("goto")&&O.preventDefault()},title:x.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(P)}),x.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async P=>{if(P)try{await P.select()}catch(O){o?.showError?.(O)}}),x.getCommand("addNamedReference")?.updateCallback(async function(P){S(null)}),x.getCommand("editNamedReference")?.updateCallback(async function(P){S(P)}),x.getCommand("deleteNamedReference")?.updateCallback(async function(P){P?.delete?.()}),x.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),sn(t?.getView(),{onViewChange:k=>{x.getCommand("workbookViewToggleShowFormulaBar").update({state:k.isShowFormulaBar()}).updateCallback(()=>{k.setShowFormulaBar(!k.isShowFormulaBar())}),x.getCommand("workbookViewToggleShowTabs").update({state:k.isShowTabs()}).updateCallback(()=>{k.setShowTabs(!k.isShowTabs())}),x.getCommand("workbookViewToggleShowStatusBar").update({state:k.isShowStatusBar()}).updateCallback(()=>{k.setShowStatusBar(!k.isShowStatusBar())}),x.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:k.isShowHorizontalScrollbar()}).updateCallback(()=>{k.setShowHorizontalScrollbar(!k.isShowHorizontalScrollbar())}),x.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:k.isShowVerticalScrollbar()}).updateCallback(()=>{k.setShowVerticalScrollbar(!k.isShowVerticalScrollbar())})}}),u.useEffect(()=>{x.getCommand("fullScreenToggle").update({state:R,disabled:!C}).updateCallback(()=>{_()})},[R,C]),u.useEffect(()=>{const k=t.getProtection().isStructureAllowed();x.getCommand("hideSheet").update({disabled:f.length<=1||!k}),x.getCommand("deleteSheet").update({disabled:f.length<=1||!k})},[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;sn(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:Yt.Menuitem,...c,...d}),[c,d]),f=u.useMemo(()=>({commands:o,variant:Yt.Menuitem,parentFloat:a,...d}),[o,d,a]),h=m=>{switch(m?.key()){case"moveToFront":return ze(s.jsx(lD,{}));case"moveForward":return ze(s.jsx(sD,{}));case"moveToBack":return ze(s.jsx(aD,{}));case"moveBackward":return ze(s.jsx(cD,{}));case"toggleLockAspectRatio":return ze(s.jsx(K7,{}));case"formatDrawAlignLeft":return ze(s.jsx(Z7,{}));case"formatDrawAlignCenter":return ze(s.jsx(dD,{}));case"formatDrawAlignRight":return ze(s.jsx(uD,{}));case"formatDrawAlignTop":return ze(s.jsx(pD,{}));case"formatDrawAlignMiddle":return ze(s.jsx(hD,{}));case"formatDrawAlignBottom":return ze(s.jsx(fD,{}));case"formatDrawDistributeHorz":return ze(s.jsx(mD,{}));case"formatDrawDistributeVert":return ze(s.jsx(gD,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ze(s.jsx(G7,{}));default:return null}},g=s.jsxs(s.Fragment,{children:[s.jsx($2,{command:o.getCommand("copy"),...p,variant:Yt.Menuitem}),[],s.jsx(Ft,{orientation:"horizontal"}),s.jsx(sa,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),s.jsx(sa,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ze(s.jsx(K7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(sa,{...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(sa,{...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(Le,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...l,children:g})}));IC.displayName="MovableContextMenu";const SN={fireOnModelChange:!1},f5={flex:"1 1 100%",display:"flex"},CN=e=>s.jsx(Af,{...e}),kN=e=>s.jsx(Kf,{...e}),EN=e=>s.jsx(IC,{...e}),MN=e=>s.jsx(Gf,{...e}),TN=e=>s.jsx(Ff,{...e}),_N=(e,t)=>s.jsx(zf,{ref:t,...e}),jN=e=>s.jsx(i0,{...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=_N,showTabs:w,tabsProps:E,renderTabs:C=kN,showStatusBar:R,statusBarProps:_,renderStatusBar:L=CN,toolbarProps:T,renderToolbar:j=_C,contextMenuSx:S,renderContextMenu:k=MN,renderFilterMenu:P=TN,renderMovableMenu:O=EN,renderLoadingPanel:I=jN,loadingPanelProps:z,sheetProps:A,renderSheet:D=RN,showHorizontalScrollbar:F,showVerticalScrollbar:B,gridTheme:M,headersTheme:N,forceLightImages:V,...U}=e,J=qi(),X=wf(),H=u.useMemo(()=>{const Ne={theme:X.getDefaultTheme(),...o};return n??new $.Workbook(Ne)},[n]),ne=u.useRef(null),[oe,ye]=u.useState(!1),de=u.useRef(null),xe=u.useMemo(()=>s.jsx(Le,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:de}),[]),[we,ve]=u.useState(!1),[re,ce]=u.useState(!1),Se=u.useCallback(()=>{ve(!0)},[]),ie=u.useRef(null),Y=ir(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>H,getSheetElement:()=>ne.current,getViewportElement:()=>de.current,getFormulaBarElement:()=>ie.current,focus(){ne&&ne.current&&ne.current.focus()}}),[H]),le=u.useRef(null);u.useLayoutEffect(()=>{we&&Y.current&&(ce(!0),le.current!==i&&(i?.({source:Y.current}),le.current=i))},[we,Y.current]),Y.current;const ee=u.useCallback(Ne=>(ne.current?.submitEdit(),!0),[]),Pe=u.useCallback(()=>{requestAnimationFrame(()=>{ne?.current?.focus()})},[]),[Te,rt]=u.useState(H?.getSelectedSheet()),[Ve,Ee]=u.useState(H?.getProtection());sn(H,{onSheetsChange:Ne=>{rt(Ne?.getSelectedSheet())},onViewChange(Ne){rt(Ne?.getSelectedSheet())},onProtectionChange:Ne=>{Ee(Ne?.getProtection())}}),sn(H,{onRequestSelect:async(Ne,yt)=>new Promise(Wt=>{ne.current.getSheet()!==yt?ne.current.getGridElement()?.onViewChangeOnce(()=>{ne.current.getSheet()!==yt&&Wt(!1),Wt(!0)}):Wt(!0)})},SN);const[Re,Xe]=u.useReducer(Ne=>Ne+1,0),Be=H?.getView();sn(Be,{onViewChange:Ne=>{Xe()}});const ct=M??J,Qe=u.useMemo(()=>Gh(J,ct),[J,ct]),he=N??J,Ye=u.useMemo(()=>Gh(J,he),[J,he]),[ke,Ie]=u.useState(null);u.useCallback(()=>{ne.current.focus()},[]);const[ue,De]=u.useState(!1),Ae=u.useRef(null),W=jC({workbook:H,workbookElement:Y.current,commandTarget:()=>ne.current,notifier:a,commands:y,darkMode:Qe.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{ue?Ae.current?.focus():De(!0)}}),Q=u.useRef(null),[K,se]=u.useState(!1),[te,ae]=u.useState(null),[pe,me]=u.useState(mp),[fe,je]=u.useState($.TypesUtils.EmptyBounds),Fe=()=>{se(!1),ae(null)},Ge=(Ne,yt,Wt=mp)=>{je(Ne),me(Wt),ae(yt),Q.current!==null&&Q.current.update(),se(!0)},[et,tt]=u.useState("sheet"),it=w??Be?.isShowTabs(),At=F??Be?.isShowHorizontalScrollbar(),Lt=x??Be?.isShowFormulaBar(),_t=R??Be?.isShowStatusBar(),$t=B??Be?.isShowVerticalScrollbar(),nn=Qe?.header?.edgeStrokeFill||"rgb(171,171,171)",Zt=u.useMemo(()=>_t?L({sheet:Te,gridStyle:Qe,..._}):null,[L,_,_t,Qe,Te]),Tn=u.useMemo(()=>j({commands:W,workbook:Y.current,...T}),[W,j,T,J]),[pn,{width:En}]=i1(),kt=En===0||En>560,on=u.useMemo(()=>{if(!it)return null;let Ne=C({background:Qe.body.fill,borderWidth:1,borderColor:nn,gridTheme:ct,gridStyle:Qe,onBeforeUserChange:ee,onUserChange:Pe,workbook:H,commands:W,sheetTabProps:{},notifier:a,...E});return kt||(Ne=s.jsx("div",{style:{flex:"none",display:"flex"},children:Ne})),Ne},[C,E,a,J,H,ct,kt,W,it]),mn=u.useCallback(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;let Wt=null,en=null,rn=null;if(At&&(en=s.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${nn} 1px`,maxWidth:"100%"},children:s.jsx(Wu,{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:Te,showCustomScrollButtons:!yt,onShowTooltip:It=>{Ge({x:It.anchor.x,y:It.anchor.y,width:0,height:0},It.display,It.placement)},onCloseTooltip:()=>Fe()})})),it&&kt&&(rn=on),it&&kt&&!At&&(rn=s.jsxs(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[rn,s.jsx(Le,{sx:{borderTop:`solid ${nn} 1px`,flex:"1"}})]})),rn&&At)Wt=s.jsx(q5,{position:H.getView().getTabRatio()/10+"%",onPositionChange:({percent:It})=>{H.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='${J.palette.text.icon??J.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 ${nn} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:rn,elementAfter:en});else if(At)Wt=en;else{if(!rn)return s.jsx(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:_t?null:`solid ${nn} 1px`}});Wt=rn}return s.jsx(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:Wt})},[Te,ee,H,Qe,ct,W,it,At,_t,kt]),[Ln,Nn]=u.useState(null),hn=u.useMemo(()=>({placement:"right-start",...Ln?.popperProps}),[Ln?.popperProps]),{reference:fo,component:bo}=pa({label:"contextMenu",popperProps:hn,anchor:Ln?.anchor??{getBoundingClientRect:()=>new DOMRect(Ln?.clientX||0,Ln?.clientY||0)},onClose:()=>Nn(null),createPopupPanel:Ln?.createPopupPanel});u.useEffect(()=>{Ln?fo.open(0):fo.close(0)},[Ln]);const Fo=_e((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Ln&&Ln.anchor===Ne.currentTarget?Nn(null):Nn({anchor:Ne.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:Wt=>{const{floatReference:en}=Wt;return P({filter:yt,commands:W,floatReference:en,sx:{...S}})}})},[P,S,W,H,Ln]),tr=_e(Ne=>{if(Ne.originalEvent?.isDefaultPrevented())return!0;Ne.originalEvent?.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:yt=>{const{floatReference:Wt}=yt;return k({commands:W,workbook:H,floatReference:Wt,sx:{...S}})}})},[k,S,W,H]),_r=_e((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:Wt=>{const{floatReference:en}=Wt;return O({movable:yt,commands:W,floatReference:en,sx:{...S}})}})},[O,S,W]);u.useMemo(()=>{const Ne=[new Tt("openContextMenu",()=>ne.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[$e.Shift]},{key:"ContextMenu"}]})];W.addCommands(Ne,!0)},[W]),u.useEffect(()=>{W.getCommand("openContextMenu").updateCallback(()=>{const Ne=Te.getSelection().getCoords().cell;ne.current?.getGridElement()?.scrollCellCoordsIntoView(Ne).then(yt=>{requestAnimationFrame(()=>{const Wt=Te.getView().getZoomScale()/100,en=Te.getColumnHeaders().findOffset(Ne.colIndex+1)*Wt,rn=Te.getRowHeaders().findOffset(Ne.rowIndex+1)*Wt,It=ne.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};tr({clientX:en-It.x-yt.left+6,clientY:rn-It.y-yt.top+6})})})})},[Te]);const jr=_e(Ne=>{W?.dispatchToFocusedCommand(Ne)},[W]),ui=_e(()=>{Y.current},[H,Y.current]),Ki=u.useCallback(()=>{tt("sheet")},[]),pi=u.useCallback(()=>{tt("formulaBar")},[]),pr=_e(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;return s.jsx(Wu,{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:Te,endGap:700,showCustomScrollButtons:!yt,onShowTooltip:Wt=>{Ge(Wt.anchor,Wt.display,"left")},onCloseTooltip:()=>Fe()})},[Te]);u.useEffect(()=>{l&&ne&&ne.current&&ne.current.focus()},[]);const[nt,ft]=u.useState(null),gt=u.useCallback(Ne=>{W?.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())},[W]),ut=_e(Ne=>{if(W?.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 Wt=ne.current?.getGridElement().getViewFromClient(Ne.clientX,Ne.clientY);if(!Wt)return;const en=Wt.getRelativePointFromClient(Ne.clientX,Ne.clientY),rn=Wt.toAbsoluteBounds({...en,width:0,height:0}),It=Wt.getCellCoordsFromClient(Ne.clientX,Ne.clientY);if(!It)return;W?.getCommand("insertImageFromFile")?.execute({file:yt,options:{bounds:{x:rn.x,y:rn.y}},goto:{range:{...It}}})}else W?.getCommand("openWorkbook")?.execute(yt)}},[W,nt]),vt=u.useMemo(()=>nt?s.jsx(Le,{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(Mn,{variant:"h4",children:nt})}):null,[nt]),jt=u.useRef(null),Pt=u.useMemo(()=>s.jsx(Kh,{in:!re,nodeRef:jt,timeout:500,classNames:"animating",unmountOnExit:!0,children:I({ref:jt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:re?0:c?.opacity,pointerEvents:re?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...z}})}),[re,I,z]),Rt=u.useMemo(()=>b({sx:{marginTop:Ne=>Ne.spacing(.25),marginLeft:Ne=>Ne.spacing(1),marginRight:Ne=>Ne.spacing(1)},workbook:H,sheetElement:ne.current,gridStyle:Qe,onFocus:pi,...v,NamedCollectionEditorProps:{restoreFocus:Ne=>ne.current.focus(Ne),notifier:a,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:W,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},ie),[b,v,H,Qe,W,re]),zt=u.useCallback(Ne=>{const{movable:yt,...Wt}=Ne,en={movable:yt,onContextMenuCapture:In=>{_r(In,yt)},...Wt},rn=yt.getContent().getType();let It=null;if(rn==="picture")return s.jsx(iS,{loadingPanel:s.jsx(i0,{transitionDelay:"100",style:{position:"absolute"},sx:{border:In=>`solid 1px ${In.palette.action.active}`}}),picture:yt.getContent(),description:yt.getDescription()??yt?.getName(),...en});if(rn==="chart"){const In={...en,chart:yt.getContent()};return s.jsx(jF,{...In})}if(It=`Float of type '${rn}'.`,typeof It=="string"){const In={...en,description:It};It=s.jsx(vF,{...In})}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(()=>D({style:f5,onFocus:Ki,notifier:a,gridStyle:Qe,headersStyle:Ye,sheet:Te,commands:W,onSheetContextMenu:tr,onViewportChange:Ne=>{Ie(Ne)},showScrollbars:!1,viewportComponent:xe,onRepeatCommandChange:m,onElementLoad:Se,onShowColumnTooltip:Ne=>{Ge(Ne.anchor,Ne.display,mp)},onShowRowTooltip:Ne=>{Ge(Ne.anchor,Ne.display,U5)},onShowTooltip:Ne=>{Ge({x:Ne.anchor.x,y:Ne.anchor.y,width:0,height:0},Ne.display,Ne.placement)},onCloseTooltip:()=>Fe(),renderMovable:zt,...A,cellRenderProps:{onFilterButtonMouseDown:(Ne,yt)=>{A?.cellRenderProps?.onFilterButtonMouseDown(Ne,yt),Fo(Ne,yt)},...A?.cellRenderProps}},ne),[D,W,A,Te,Qe,a,m]),gn=u.useMemo(()=>{if(!ue)return null;const Ne=!Ve.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:()=>{De(!1),requestAnimationFrame(()=>{ne.current.focus()})},readOnly:Ne,commands:W,ref:Ae,scripts:H.getScripts()})},[ue,W,H,a,Ve]),zn=u.useMemo(()=>{const Ne=s.jsx(_3,{style:{...f5,marginRight:gn&&kt?"0px":"6px"},viewport:ke,touchElement:ne.current?.getGridElement()?.stage,onScrollViewport:It=>{ne.current?.getGridElement()?.scrollTo(It)},showHorizontalScrollbar:At||it,showVerticalScrollbar:$t,createHorizontalScrollbar:mn,createVerticalScrollbar:pr,children:Dt});let yt=Ne;kt||(yt=s.jsxs(s.Fragment,{children:[Ne,on]}));let Wt=null,en=4,rn=13;return kt?Wt="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":(Wt="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",en=13,rn=4),s.jsx(q5,{fixedPane:"after",position:"40%",minAfter:kt?"280px":"120px",splitDirection:kt?"row":"column",style:f5,ref:pn,resizerProps:{className:"styled-resizer",style:{minWidth:kt?"6px":void 0,minHeight:kt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${en}' height='${rn}' viewBox='0 0 ${en} ${rn}' version='1.1' fill='${J.palette.text.icon??J.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${Wt}' /%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"}}})},[At,it,mn,$t,ke,gn,Dt,on,J,kt]),wn=u.useMemo(()=>({boxSizing:"border-box",background:Ne=>Ne.palette.mode!=="dark"?Qe.header.fill:Ne.palette.background.paper,"& *":{...Y3(J),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${nn} 1px`},...c}),[c,Qe]);return s.jsxs(Mi,{className:Eo("sheetxl-workbook","_sheetxl-workbook_1j3lu_5",{"Mui-focusVisible":oe},"_sheetxl-theme_4opcr_2",p),sx:wn,style:d,square:!1,...U,ref:Y,onFocus:Ne=>{ye(!0),ui(),f?.(Ne)},onBlur:Ne=>{ye(!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:re?void 0:0,"--sxl-app-color-high-contrast":J.palette.primary.main,"--sxl-app-color-primary":J.palette.primary.main,"--sxl-app-color-primary-dark":J.palette.primary.dark,"--sxl-app-color-primary-light":J.palette.primary.light,"--sxl-app-color-info":J.palette.info.main,"--sxl-app-color-info-dark":J.palette.info.dark,"--sxl-app-color-info-light":J.palette.info.light,"--sxl-app-color-secondary":J.palette.secondary.main,"--sxl-app-color-secondary-dark":J.palette.secondary.dark,"--sxl-app-color-secondary-light":J.palette.secondary.light,"--sxl-app-color-success":J.palette.success.main,"--sxl-app-color-success-dark":J.palette.success.dark,"--sxl-app-color-success-light":J.palette.success.light,"--sxl-app-color-warning":J.palette.warning.main,"--sxl-app-color-warning-dark":J.palette.warning.dark,"--sxl-app-color-warning-light":J.palette.warning.light,"--sxl-app-color-error":J.palette.error.main,"--sxl-app-color-error-dark":J.palette.error.dark,"--sxl-app-color-error-light":J.palette.error.light,"--sxl-app-color-text":J.palette.text.primary,"--sxl-app-color-text-secondary":J.palette.text.secondary,"--sxl-app-color-text-disabled":J.palette.text.disabled,"--sxl-app-color-background":J.palette.background.paper,"--sxl-app-color-button-surface":J.palette.grey[600],"--sxl-app-color-shadow":J.palette.action.focus,"--sxl-app-color-grey":J.palette.grey[500],"--sxl-app-filter-dark-invert":Qe.body.darkMode&&!V?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":Qe.body.darkMode?`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`:void 0},children:[Tn,Lt?Rt:null,s.jsx(Le,{sx:{marginBottom:Ne=>Ne.spacing(.75)}}),zn,Zt,s.jsx(di,{arrow:!0,disableInteractive:!0,open:K,title:s.jsx(Mn,{variant:"subtitle2",component:"div",children:te}),placement:pe,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:Q,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:K?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(fe.x,fe.y,fe.width,fe.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:s.jsx(Le,{})}),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}]=i1(),[E,{width:C}]=i1(),[R,_]=u.useState(!1),L=u.useRef(null),T=u.useRef(null),j=ir(t,()=>({requestWorkbookTitle:(S=null,k)=>{T.current={onAccept:S,requestReason:k?.requestReason},k?.selectAll&&L.current?.select(),L.current?.focus(k)},focus:S=>{L.current?.focus(S)}}),[]);return u.useLayoutEffect(()=>{_(r!==m),v(r),y(r)},[r]),u.useEffect(()=>{R&&w!==0&&Xt.debounce(()=>{_(!1)},300)()},[R,w]),u.useEffect(()=>{g(m&&!El.isValidWindowsFilename(m))},[m]),c?null:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:R?"0":"1",transition:R?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:V2([j,E,t]),...d,children:s.jsx(br,{label:T.current?.requestReason??"Workbook Name",children:s.jsxs(Le,{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(Mn,{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:S=>h?S.palette.error.dark:void 0},children:r??i}):s.jsx(ql,{sx:{width:`${Math.min(w+3,Math.max(C,j.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:S=>h?S.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:S=>{f(!0),S.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:S=>{if(S.target.value.length>El.MAX_WORKBOOK_NAME_SIZE)return S.stopPropagation(),void S.preventDefault();y(S.target.value)},onKeyDown:S=>{(El.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(S.key)||S.target?.value.length>El.MAX_WORKBOOK_NAME_SIZE)&&S.preventDefault(),S.which===tn.Enter||S.which===tn.Tab?(h?y(x):(a?.(m),m&&(T.current?.onAccept?.(m,"keydown"),T.current=null)),S.stopPropagation(),S.preventDefault(),o?.focus()):S.which===tn.Escape&&(m===x?o?.focus():(y(x),setTimeout(()=>{S.target?.select()},0)),T.current=null,S.stopPropagation(),S.preventDefault())},value:m}),s.jsx(Le,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:m!==x?"italic":void 0,fontFamily:S=>S.typography.fontFamily,letterSpacing:"0.00938em"},children:m||i})]})})})}));Xf.displayName="WorkbookTitle";const PN=u.lazy(()=>Promise.resolve().then(()=>require("./YCo0jVF3gVFbhr47.cjs")).then(e=>e.D4VWSzyCBRsx1YLa).then(e=>e.E)),PC=u.memo(u.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,...a}=e;return i&&$.LicenseManager.setLicenseKey(i),s.jsx(s.Fragment,{children:s.jsx(PN,{...a,className:r,sx:n,style:o,ref:t})})}));PC.displayName="StandaloneWorkbook";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 OC{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 DC=new OC;(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 AC=Object.freeze(Object.defineProperty({__proto__:null,AppearanceCommandButton:dC,AutoColorPosition:Is,BorderCommandButton:NS,BorderPopupButton:BS,BorderStyleButton:FS,ClearCommandButton:kf,ColorButton:N2,ColorCommandButton:Ys,ColorPanel:zS,ColorPanelType:AS,ColorPopupButton:Cf,DeleteCellsCommandButton:Mf,DocThemeCommandButton:cC,FillCommandButton:qS,FilterColumnMenu:Ff,FilterCommandButton:GB,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:JB,RangeInput:Of,RunScriptCommandButton:qf,ScriptEditorToolbar:Wf,ScriptWorkspace:Uf,SheetTab:Bf,SheetTabMenu:Nf,SheetZoomScale:Df,SheetsAllMenu:$f,SortFilterCommandButton:Tf,StandaloneWorkbook:PC,StatusBar:Af,StyledStrokeIcon:Wh,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:$2,WorkbookContextMenu:Gf,WorkbookElement:Zf,WorkbookIO:DC,WorkbookStrip:Kf,WorkbookTitle:Xf,WorkbookViewCommandButton:QS,_WorkbookIO:OC,createGridStyleFromMUITheme:Gh,defaultNewWorkbook:RC,useResolvedThemeMode:SC,useWorkbookCommands:jC},Symbol.toStringTag,{value:"Module"})),Zh=new Map,LC=(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(l1(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 He("fullScreenToggle",r,{label:"FullScreen",description:"Toggle showing the workbook using the full screen.",shortcut:{key:"F11"}}),new He("showScriptEditor",r,{label:"Scripts",scopedLabels:{scripts:"Script Editor…"},description:"Show the script editor.",shortcut:[{key:"F11",modifiers:[$e.Alt]}]},function(k=!0){g?.()}),new He("executeScript",r,{label:"Run Script",description:"Run the selected or last executed script.",shortcut:{key:"F8"}}),new He("executeSelectedScript",r,{label:"Run Script",description:"Run the selected script.",shortcut:{key:"F8"}}),new He("saveScripts",r,{label:"Save Script",description:"Save the current scripts."}),new He("maximumWorkbookToggle",r,{label:"Maximize",description:"Toggle showing the workbook maximized.",shortcut:{key:"F10",modifiers:[$e.Ctrl]}}),new He("spellCheck",r,{label:"Spell Check",description:"Check the workbook for spelling mistakes.",shortcut:{key:"F7"}}),new He("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 k=null;return k=i?i.createChildGroup(r,"workbook",!1):new r0(r,"workbook"),k.addCommands(y,!0),k},[i,y]),v=Hi(),b=u.useRef(null),w=_e(()=>{let k,P=null;const O=x.getCommand("executeScript");if(O.update({disabled:!1,context:{getScripts:()=>t.getScripts()}}),!O)return;const I=x.getCommand("executeSelectedScript");if(!I)return;const z={saveSource:async A=>{let D=null,F=null;const B=t.getScripts();try{A&&(F=await o?.showBusy?.("Saving Scripts..."),D=await B.createModule({source:A})),B.addModule("scripts",D,{replace:!0}),F?.()}catch(M){F?.(),console.warn("Unable to compile",M),o?.showError?.(M)}return D},addContainerListener:A=>(E.current=A,()=>{E.current=null}),setSelectedFunction:A=>{k=A??b.current??null,Promise.resolve(k).then(D=>{I.update({disabled:D===null})})},quickInsertFunction:A=>{const D=`=${A.toUpperCase()}(`,F={text:D+")",editMode:!0,initialSelection:{start:D.length,end:D.length+0}};v.setMode(B=>B?.key==="edit"?{...B,args:{...B.args}}:{key:"edit",args:{stateAndCoords:null,start:F}})},getSelectedFunction:()=>k,setEditor:A=>{P=A??null,x.getCommand("showScriptEditor")?.update({state:A!==null})},getEditor:()=>P,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]),E=u.useRef(null);sn(t,{onBeforeSave:async()=>{await E.current?.onBeforeSave()},onProtectionChange:()=>{E.current?.onReadonlyChange()},onLoad:()=>{(async()=>(await t.getCalculation().start(),t.getScripts().start(),E.current?.onScriptChange()))()}}),sn(t,{onSheetsChange:k=>{h(k.getSheets().search())},onViewChange(k){p(k?.getSelectedSheet())},onProtectionChange:k=>{const P={disabled:!k.getProtection().isStructureAllowed()};x.getCommand("hideSheet").update(P),x.getCommand("deleteSheet").update(P),x.getCommand("addSheet").update(P),x.getCommand("duplicateSheet").update(P)},onScriptsChange:k=>{w()}});const{isFullscreenAvailable:C,isFullscreenEnabled:R,toggleFullscreen:_}=function(k={}){const{target:P,onChange:O,onError:I,requestFullScreenOptions:z}=k,[A,D]=u.useState(!1),[F,B]=u.useState(null),[M,N]=u.useState(!1),V=u.useCallback(()=>ta.requestFullscreen(P?.current||null,z),[P,z]),U=u.useCallback(()=>ta.exitFullscreen(),[]),J=u.useCallback(()=>ta.fullscreenElement?U():V(),[V,U]),X=u.useCallback(ne=>{const oe=ta.fullscreenElement;B(oe),N(!!oe),O?.(ne)},[O]),H=u.useCallback(ne=>{const oe=ta.fullscreenElement;B(oe),N(!!oe),I?.(ne)},[I]);return u.useEffect(()=>{D(ta.fullscreenEnabled)},[]),u.useEffect(()=>(ta.on("change",X),ta.on("error",H),()=>{ta.off("change",X),ta.off("error",H)}),[X,H]),{isFullscreenAvailable:A,fullscreenElement:F,isFullscreenEnabled:M,enableFullscreen:V,disableFullscreen:U,toggleFullscreen:J}}({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=_e(async function(k,P){let O=null;const I=t.getScripts();if(k?.declaration||k?.functionName){const z=k.declaration?k.declaration.getName():k.functionName;I.searchFunction({name:z}).length>0&&(O=z)}if(O)try{await I.executeMacro(O),b.current=Promise.resolve({source:null,name:O})}catch(z){return void o?.showError?.(z)}},[t,o]);u.useEffect(()=>{x.getCommand("newCellStyle").updateCallback(k=>{o?.showInputOptions?.({initialValue:(()=>{let P=0;for(;;){P++;const O=`Style ${P}`;try{return t.getStyles().validateStyleName(O,!0),O}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(P,O)=>{let I=null;try{t.getStyles().validateStyleName(P,!1)}catch(D){I=D.message}let z=t.getStyles().getNamed(P),A=I;return!A&&z&&(A=`Update style '${z.getName()}'.`),{valid:I===null,message:A}}}).then(({input:P,option:O})=>{const I=t.getSelectedSheet().getSelectedRange();if(O!=="Ok")return;const z=t.getStyles().setNamed({name:P,style:I.getCell().getStyle()});I.updateStyle({named:z.getName()})})}),x.getCommand("deleteCellStyle").updateCallback(k=>{k.delete()}),x.getCommand("modifyCellStyle").updateCallback(({named:k})=>{const P=t.getSelectedSheet().getSelectedRange();t.getStyles().setNamed({name:k.getName(),style:P.getCell().getStyle()})}),x.getCommand("hideSheet").updateCallback(k=>{t.getSheetAt(k).setVisibility($.ISheet.Visibility.Hidden)}),x.getCommand("deleteSheet").updateCallback(async k=>{t.getSheetAt(k??t.getSelectedSheetIndex())?.delete()}),x.getCommand("addSheet").updateCallback(k=>{t.getSheets().add({index:k,autoSelect:!0})}),x.getCommand("duplicateSheet").updateCallback(async k=>{(await t.getSheetAt(k??t.getSelectedSheetIndex())?.duplicate())?.select()}),x.getCommand("nextSheet").updateCallback(k=>{t.getNextSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("previousSheet").updateCallback(k=>{t.getPreviousSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectNextSheet").updateCallback(k=>{t.getNextSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectPreviousSheet").updateCallback(k=>{t.getPreviousSheet(k??t.getSelectedSheetIndex()).select()}),x.getCommand("selectTheme").updateCallback(k=>{t.setTheme(k)}),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 j=_e(async k=>{let P=0,O=null,I="Find & Replace";k?.replace&&!k?.replaceOptions?.maxCount&&(I="Replace All");const z=await o?.showBusy?.(I);try{const A=k?.scope??"sheet";let D=null;const F={from:t.getSelectedSheet().getSelectedCell(),...k.findOptions};if(D=A==="sheet"?t.getSelectedSheet().find(k.findText,F):t.find(k.findText,F),k.replace){const B=t.replace(D,k.replaceText,k.replaceOptions);P=B.count,k.replaceOptions.maxCount&&(O=B.last)}else{let B=D.next();B.done||(P++,O=B.value)}O?.select({autoFocus:!1}),z?.(),!k.replaceOptions.maxCount&&P>1&&o?.showMessage?.(`We replaced ${P} cells.`)}catch(A){z?.(),o?.showError?.(A)}return P},[t,n]),S=_e(k=>{const P={value:k,context:{selection:()=>{const O=t.getSelectedRanges(),I=[];for(let z=0;z<O.getCount();z++){const A=O.at(z).getFixed(!0).getCoords();I.push(A)}return t.getRanges(I)},getNames:()=>t.getNames()},onUpdate:async O=>{try{await O.select()}catch(I){o?.showMessage?.(I.message,{type:ua.Error})}}};return o.showWindow?.("namedDetails",P)},[o,t,n]);return u.useEffect(()=>{const k=(P=!1)=>{const O=t.getSelectedCell(),I={onFindOrReplace:j,onKeyDown:z=>{x.findCommandByEvent(z)!==x.getCommand("find")&&x.findCommandByEvent(z)!==x.getCommand("findReplace")||z.preventDefault()},findOptions:{},findText:O.toTextUnformatted(!0)};I.replace=P,o.showWindow?.("find",I,{disableAutoDestroy:!0})};x.getCommand("find")?.update({disabled:!o?.showWindow}).updateCallback(()=>{k()}),x.getCommand("findReplace")?.update({disabled:!o?.showWindow}).updateCallback(()=>{k(!0)}),x.getCommand("goto")?.update({disabled:!o}).updateCallback(()=>{const P={onInputOption:async O=>{try{await t.getRanges(O).select()}catch(I){o?.showMessage?.(I.message,{type:ua.Error})}},onKeyDown:O=>{x.findCommandByEvent(O)===x.getCommand("goto")&&O.preventDefault()},title:x.getCommand("goto")?.label(),inputLabel:"Location",options:["Go To"]};o?.showInputOptions?.(P)}),x.getCommand("selectNamed")?.update({disabled:!o}).updateCallback(async P=>{if(P)try{await P.select()}catch(O){o?.showError?.(O)}}),x.getCommand("addNamedReference")?.updateCallback(async function(P){S(null)}),x.getCommand("editNamedReference")?.updateCallback(async function(P){S(P)}),x.getCommand("deleteNamedReference")?.updateCallback(async function(P){P?.delete?.()}),x.getCommand("activeNameBox")?.updateCallback(async function(){n?.getFormulaBarElement()?.getNamedCollectionEditorElement()?.focus()})},[n,t,o]),sn(t?.getView(),{onViewChange:k=>{x.getCommand("workbookViewToggleShowFormulaBar").update({state:k.isShowFormulaBar()}).updateCallback(()=>{k.setShowFormulaBar(!k.isShowFormulaBar())}),x.getCommand("workbookViewToggleShowTabs").update({state:k.isShowTabs()}).updateCallback(()=>{k.setShowTabs(!k.isShowTabs())}),x.getCommand("workbookViewToggleShowStatusBar").update({state:k.isShowStatusBar()}).updateCallback(()=>{k.setShowStatusBar(!k.isShowStatusBar())}),x.getCommand("workbookViewToggleShowHorizontalScrollBar").update({state:k.isShowHorizontalScrollbar()}).updateCallback(()=>{k.setShowHorizontalScrollbar(!k.isShowHorizontalScrollbar())}),x.getCommand("workbookViewToggleShowVerticalScrollBar").update({state:k.isShowVerticalScrollbar()}).updateCallback(()=>{k.setShowVerticalScrollbar(!k.isShowVerticalScrollbar())})}}),u.useEffect(()=>{x.getCommand("fullScreenToggle").update({state:R,disabled:!C}).updateCallback(()=>{_()})},[R,C]),u.useEffect(()=>{const k=t.getProtection().isStructureAllowed();x.getCommand("hideSheet").update({disabled:f.length<=1||!k}),x.getCommand("deleteSheet").update({disabled:f.length<=1||!k})},[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;sn(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:Yt.Menuitem,...c,...d}),[c,d]),f=u.useMemo(()=>({commands:o,variant:Yt.Menuitem,parentFloat:a,...d}),[o,d,a]),h=m=>{switch(m?.key()){case"moveToFront":return ze(s.jsx(lD,{}));case"moveForward":return ze(s.jsx(sD,{}));case"moveToBack":return ze(s.jsx(aD,{}));case"moveBackward":return ze(s.jsx(cD,{}));case"toggleLockAspectRatio":return ze(s.jsx(K7,{}));case"formatDrawAlignLeft":return ze(s.jsx(Z7,{}));case"formatDrawAlignCenter":return ze(s.jsx(dD,{}));case"formatDrawAlignRight":return ze(s.jsx(uD,{}));case"formatDrawAlignTop":return ze(s.jsx(pD,{}));case"formatDrawAlignMiddle":return ze(s.jsx(hD,{}));case"formatDrawAlignBottom":return ze(s.jsx(fD,{}));case"formatDrawDistributeHorz":return ze(s.jsx(mD,{}));case"formatDrawDistributeVert":return ze(s.jsx(gD,{}));case"formatAnchorTypeTwoCell":case"formatAnchorTypeOneCell":case"formatAnchorTypeAbsolute":return ze(s.jsx(G7,{}));default:return null}},g=s.jsxs(s.Fragment,{children:[s.jsx($2,{command:o.getCommand("copy"),...p,variant:Yt.Menuitem}),[],s.jsx(Ft,{orientation:"horizontal"}),s.jsx(sa,{...f,popupCommandKeys:["moveToFront","moveForward"],quickCommand:"moveToFront",icon:h}),s.jsx(sa,{...f,popupCommandKeys:["moveToBack","moveBackward"],quickCommand:"moveToBack",icon:h}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(qe,{...p,command:o.getCommand("toggleLockAspectRatio"),icon:ze(s.jsx(K7,{}))}),s.jsx(Ft,{orientation:"horizontal"}),s.jsx(sa,{...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(sa,{...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(Le,{ref:t,sx:{paddingTop:"4px",paddingBottom:"4px",...i},...l,children:g})}));IC.displayName="MovableContextMenu";const SN={fireOnModelChange:!1},f5={flex:"1 1 100%",display:"flex"},CN=e=>s.jsx(Af,{...e}),kN=e=>s.jsx(Kf,{...e}),EN=e=>s.jsx(IC,{...e}),MN=e=>s.jsx(Gf,{...e}),TN=e=>s.jsx(Ff,{...e}),_N=(e,t)=>s.jsx(zf,{ref:t,...e}),jN=e=>s.jsx(i0,{...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=_N,showTabs:w,tabsProps:E,renderTabs:C=kN,showStatusBar:R,statusBarProps:_,renderStatusBar:L=CN,toolbarProps:T,renderToolbar:j=_C,contextMenuSx:S,renderContextMenu:k=MN,renderFilterMenu:P=TN,renderMovableMenu:O=EN,renderLoadingPanel:I=jN,loadingPanelProps:z,sheetProps:A,renderSheet:D=RN,showHorizontalScrollbar:F,showVerticalScrollbar:B,gridTheme:M,headersTheme:N,forceLightImages:V,...U}=e,J=qi(),X=wf(),H=u.useMemo(()=>{const Ne={theme:X.getDefaultTheme(),...o};return n??new $.Workbook(Ne)},[n]),ne=u.useRef(null),[oe,ye]=u.useState(!1),de=u.useRef(null),xe=u.useMemo(()=>s.jsx(Le,{className:"sheetxl-viewport",sx:{width:"100%",height:"100%",boxSizing:"border-box",position:"absolute",pointerEvents:"none !important","& > :first-of-type":{position:"relative"}},ref:de}),[]),[we,ve]=u.useState(!1),[re,ce]=u.useState(!1),Se=u.useCallback(()=>{ve(!0)},[]),ie=u.useRef(null),Y=ir(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>H,getSheetElement:()=>ne.current,getViewportElement:()=>de.current,getFormulaBarElement:()=>ie.current,focus(){ne&&ne.current&&ne.current.focus()}}),[H]),le=u.useRef(null);u.useLayoutEffect(()=>{we&&Y.current&&(ce(!0),le.current!==i&&(i?.({source:Y.current}),le.current=i))},[we,Y.current]),Y.current;const ee=u.useCallback(Ne=>(ne.current?.submitEdit(),!0),[]),Pe=u.useCallback(()=>{requestAnimationFrame(()=>{ne?.current?.focus()})},[]),[Te,rt]=u.useState(H?.getSelectedSheet()),[Ve,Ee]=u.useState(H?.getProtection());sn(H,{onSheetsChange:Ne=>{rt(Ne?.getSelectedSheet())},onViewChange(Ne){rt(Ne?.getSelectedSheet())},onProtectionChange:Ne=>{Ee(Ne?.getProtection())}}),sn(H,{onRequestSelect:async(Ne,yt)=>new Promise(Wt=>{ne.current.getSheet()!==yt?ne.current.getGridElement()?.onViewChangeOnce(()=>{ne.current.getSheet()!==yt&&Wt(!1),Wt(!0)}):Wt(!0)})},SN);const[Re,Xe]=u.useReducer(Ne=>Ne+1,0),Be=H?.getView();sn(Be,{onViewChange:Ne=>{Xe()}});const ct=M??J,Qe=u.useMemo(()=>Gh(J,ct),[J,ct]),he=N??J,Ye=u.useMemo(()=>Gh(J,he),[J,he]),[ke,Ie]=u.useState(null);u.useCallback(()=>{ne.current.focus()},[]);const[ue,De]=u.useState(!1),Ae=u.useRef(null),W=jC({workbook:H,workbookElement:Y.current,commandTarget:()=>ne.current,notifier:a,commands:y,darkMode:Qe.body.darkMode,onNewWorkbook:r,onShowSidebar:()=>{ue?Ae.current?.focus():De(!0)}}),Q=u.useRef(null),[K,se]=u.useState(!1),[te,ae]=u.useState(null),[pe,me]=u.useState(mp),[fe,je]=u.useState($.TypesUtils.EmptyBounds),Fe=()=>{se(!1),ae(null)},Ge=(Ne,yt,Wt=mp)=>{je(Ne),me(Wt),ae(yt),Q.current!==null&&Q.current.update(),se(!0)},[et,tt]=u.useState("sheet"),it=w??Be?.isShowTabs(),At=F??Be?.isShowHorizontalScrollbar(),Lt=x??Be?.isShowFormulaBar(),_t=R??Be?.isShowStatusBar(),$t=B??Be?.isShowVerticalScrollbar(),nn=Qe?.header?.edgeStrokeFill||"rgb(171,171,171)",Zt=u.useMemo(()=>_t?L({sheet:Te,gridStyle:Qe,..._}):null,[L,_,_t,Qe,Te]),Tn=u.useMemo(()=>j({commands:W,workbook:Y.current,...T}),[W,j,T,J]),[pn,{width:En}]=i1(),kt=En===0||En>560,on=u.useMemo(()=>{if(!it)return null;let Ne=C({background:Qe.body.fill,borderWidth:1,borderColor:nn,gridTheme:ct,gridStyle:Qe,onBeforeUserChange:ee,onUserChange:Pe,workbook:H,commands:W,sheetTabProps:{},notifier:a,...E});return kt||(Ne=s.jsx("div",{style:{flex:"none",display:"flex"},children:Ne})),Ne},[C,E,a,J,H,ct,kt,W,it]),mn=u.useCallback(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;let Wt=null,en=null,rn=null;if(At&&(en=s.jsx("div",{style:{display:"flex",flex:"1 1 100%",borderTop:`solid ${nn} 1px`,maxWidth:"100%"},children:s.jsx(Wu,{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:Te,showCustomScrollButtons:!yt,onShowTooltip:It=>{Ge({x:It.anchor.x,y:It.anchor.y,width:0,height:0},It.display,It.placement)},onCloseTooltip:()=>Fe()})})),it&&kt&&(rn=on),it&&kt&&!At&&(rn=s.jsxs(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:[rn,s.jsx(Le,{sx:{borderTop:`solid ${nn} 1px`,flex:"1"}})]})),rn&&At)Wt=s.jsx(q5,{position:H.getView().getTabRatio()/10+"%",onPositionChange:({percent:It})=>{H.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='${J.palette.text.icon??J.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 ${nn} 1px`,borderBottom:"solid 3px transparent"}},elementBefore:rn,elementAfter:en});else if(At)Wt=en;else{if(!rn)return s.jsx(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center",height:"1px",borderTop:_t?null:`solid ${nn} 1px`}});Wt=rn}return s.jsx(Le,{sx:{display:"flex",flex:"1",position:"relative",alignContent:"center"},children:Wt})},[Te,ee,H,Qe,ct,W,it,At,_t,kt]),[Ln,Nn]=u.useState(null),hn=u.useMemo(()=>({placement:"right-start",...Ln?.popperProps}),[Ln?.popperProps]),{reference:fo,component:bo}=pa({label:"contextMenu",popperProps:hn,anchor:Ln?.anchor??{getBoundingClientRect:()=>new DOMRect(Ln?.clientX||0,Ln?.clientY||0)},onClose:()=>Nn(null),createPopupPanel:Ln?.createPopupPanel});u.useEffect(()=>{Ln?fo.open(0):fo.close(0)},[Ln]);const Fo=_e((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Ln&&Ln.anchor===Ne.currentTarget?Nn(null):Nn({anchor:Ne.currentTarget,popperProps:{offsets:[-4,2]},createPopupPanel:Wt=>{const{floatReference:en}=Wt;return P({filter:yt,commands:W,floatReference:en,sx:{...S}})}})},[P,S,W,H,Ln]),tr=_e(Ne=>{if(Ne.originalEvent?.isDefaultPrevented())return!0;Ne.originalEvent?.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:yt=>{const{floatReference:Wt}=yt;return k({commands:W,workbook:H,floatReference:Wt,sx:{...S}})}})},[k,S,W,H]),_r=_e((Ne,yt)=>{if(Ne?.isDefaultPrevented())return!0;Ne.preventDefault(),Nn({clientX:Ne.clientX,clientY:Ne.clientY,createPopupPanel:Wt=>{const{floatReference:en}=Wt;return O({movable:yt,commands:W,floatReference:en,sx:{...S}})}})},[O,S,W]);u.useMemo(()=>{const Ne=[new Tt("openContextMenu",()=>ne.current,{label:"Context Menu",description:"Open the context menu.",shortcut:[{key:"F10",modifiers:[$e.Shift]},{key:"ContextMenu"}]})];W.addCommands(Ne,!0)},[W]),u.useEffect(()=>{W.getCommand("openContextMenu").updateCallback(()=>{const Ne=Te.getSelection().getCoords().cell;ne.current?.getGridElement()?.scrollCellCoordsIntoView(Ne).then(yt=>{requestAnimationFrame(()=>{const Wt=Te.getView().getZoomScale()/100,en=Te.getColumnHeaders().findOffset(Ne.colIndex+1)*Wt,rn=Te.getRowHeaders().findOffset(Ne.rowIndex+1)*Wt,It=ne.current?.getGridElement()?.getRelativePointFromClient(0,0)||{x:0,y:0};tr({clientX:en-It.x-yt.left+6,clientY:rn-It.y-yt.top+6})})})})},[Te]);const jr=_e(Ne=>{W?.dispatchToFocusedCommand(Ne)},[W]),ui=_e(()=>{Y.current},[H,Y.current]),Ki=u.useCallback(()=>{tt("sheet")},[]),pi=u.useCallback(()=>{tt("formulaBar")},[]),pr=_e(Ne=>{const yt=$.CommonUtils.getOS()===$.CommonUtils.OSType.Firefox;return s.jsx(Wu,{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:Te,endGap:700,showCustomScrollButtons:!yt,onShowTooltip:Wt=>{Ge(Wt.anchor,Wt.display,"left")},onCloseTooltip:()=>Fe()})},[Te]);u.useEffect(()=>{l&&ne&&ne.current&&ne.current.focus()},[]);const[nt,ft]=u.useState(null),gt=u.useCallback(Ne=>{W?.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())},[W]),ut=_e(Ne=>{if(W?.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 Wt=ne.current?.getGridElement().getViewFromClient(Ne.clientX,Ne.clientY);if(!Wt)return;const en=Wt.getRelativePointFromClient(Ne.clientX,Ne.clientY),rn=Wt.toAbsoluteBounds({...en,width:0,height:0}),It=Wt.getCellCoordsFromClient(Ne.clientX,Ne.clientY);if(!It)return;W?.getCommand("insertImageFromFile")?.execute({file:yt,options:{bounds:{x:rn.x,y:rn.y}},goto:{range:{...It}}})}else W?.getCommand("openWorkbook")?.execute(yt)}},[W,nt]),vt=u.useMemo(()=>nt?s.jsx(Le,{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(Mn,{variant:"h4",children:nt})}):null,[nt]),jt=u.useRef(null),Pt=u.useMemo(()=>s.jsx(Kh,{in:!re,nodeRef:jt,timeout:500,classNames:"animating",unmountOnExit:!0,children:I({ref:jt,transitionDelay:"0",transparentBackground:!1,sx:{opacity:re?0:c?.opacity,pointerEvents:re?"none":c?.pointerEvents,position:"absolute",left:"0px",top:"0px",width:"100%",height:"100%",...z}})}),[re,I,z]),Rt=u.useMemo(()=>b({sx:{marginTop:Ne=>Ne.spacing(.25),marginLeft:Ne=>Ne.spacing(1),marginRight:Ne=>Ne.spacing(1)},workbook:H,sheetElement:ne.current,gridStyle:Qe,onFocus:pi,...v,NamedCollectionEditorProps:{restoreFocus:Ne=>ne.current.focus(Ne),notifier:a,...v?.NamedCollectionEditorProps,commandPopupButtonProps:{commands:W,...v?.NamedCollectionEditorProps?.commandPopupButtonProps}}},ie),[b,v,H,Qe,W,re]),zt=u.useCallback(Ne=>{const{movable:yt,...Wt}=Ne,en={movable:yt,onContextMenuCapture:In=>{_r(In,yt)},...Wt},rn=yt.getContent().getType();let It=null;if(rn==="picture")return s.jsx(iS,{loadingPanel:s.jsx(i0,{transitionDelay:"100",style:{position:"absolute"},sx:{border:In=>`solid 1px ${In.palette.action.active}`}}),picture:yt.getContent(),description:yt.getDescription()??yt?.getName(),...en});if(rn==="chart"){const In={...en,chart:yt.getContent()};return s.jsx(jF,{...In})}if(It=`Float of type '${rn}'.`,typeof It=="string"){const In={...en,description:It};It=s.jsx(vF,{...In})}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(()=>D({style:f5,onFocus:Ki,notifier:a,gridStyle:Qe,headersStyle:Ye,sheet:Te,commands:W,onSheetContextMenu:tr,onViewportChange:Ne=>{Ie(Ne)},showScrollbars:!1,viewportComponent:xe,onRepeatCommandChange:m,onElementLoad:Se,onShowColumnTooltip:Ne=>{Ge(Ne.anchor,Ne.display,mp)},onShowRowTooltip:Ne=>{Ge(Ne.anchor,Ne.display,U5)},onShowTooltip:Ne=>{Ge({x:Ne.anchor.x,y:Ne.anchor.y,width:0,height:0},Ne.display,Ne.placement)},onCloseTooltip:()=>Fe(),renderMovable:zt,...A,cellRenderProps:{onFilterButtonMouseDown:(Ne,yt)=>{A?.cellRenderProps?.onFilterButtonMouseDown(Ne,yt),Fo(Ne,yt)},...A?.cellRenderProps}},ne),[D,W,A,Te,Qe,a,m]),gn=u.useMemo(()=>{if(!ue)return null;const Ne=!Ve.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:()=>{De(!1),requestAnimationFrame(()=>{ne.current.focus()})},readOnly:Ne,commands:W,ref:Ae,scripts:H.getScripts()})},[ue,W,H,a,Ve]),zn=u.useMemo(()=>{const Ne=s.jsx(_3,{style:{...f5,marginRight:gn&&kt?"0px":"6px"},viewport:ke,touchElement:ne.current?.getGridElement()?.stage,onScrollViewport:It=>{ne.current?.getGridElement()?.scrollTo(It)},showHorizontalScrollbar:At||it,showVerticalScrollbar:$t,createHorizontalScrollbar:mn,createVerticalScrollbar:pr,children:Dt});let yt=Ne;kt||(yt=s.jsxs(s.Fragment,{children:[Ne,on]}));let Wt=null,en=4,rn=13;return kt?Wt="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":(Wt="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",en=13,rn=4),s.jsx(q5,{fixedPane:"after",position:"40%",minAfter:kt?"280px":"120px",splitDirection:kt?"row":"column",style:f5,ref:pn,resizerProps:{className:"styled-resizer",style:{minWidth:kt?"6px":void 0,minHeight:kt?void 0:"6px",maskImage:`url("data:image/svg+xml,%3Csvg width='${en}' height='${rn}' viewBox='0 0 ${en} ${rn}' version='1.1' fill='${J.palette.text.icon??J.palette.action.active}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='${Wt}' /%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"}}})},[At,it,mn,$t,ke,gn,Dt,on,J,kt]),wn=u.useMemo(()=>({boxSizing:"border-box",background:Ne=>Ne.palette.mode!=="dark"?Qe.header.fill:Ne.palette.background.paper,"& *":{...Y3(J),fontWeight:400},"&.Mui-focusVisible":{},"& .viewport-overlay":{borderRight:`solid ${nn} 1px`},...c}),[c,Qe]);return s.jsxs(Mi,{className:Eo("sheetxl-workbook","_sheetxl-workbook_1j3lu_5",{"Mui-focusVisible":oe},"_sheetxl-theme_4opcr_2",p),sx:wn,style:d,square:!1,...U,ref:Y,onFocus:Ne=>{ye(!0),ui(),f?.(Ne)},onBlur:Ne=>{ye(!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:re?void 0:0,"--sxl-app-color-high-contrast":J.palette.primary.main,"--sxl-app-color-primary":J.palette.primary.main,"--sxl-app-color-primary-dark":J.palette.primary.dark,"--sxl-app-color-primary-light":J.palette.primary.light,"--sxl-app-color-info":J.palette.info.main,"--sxl-app-color-info-dark":J.palette.info.dark,"--sxl-app-color-info-light":J.palette.info.light,"--sxl-app-color-secondary":J.palette.secondary.main,"--sxl-app-color-secondary-dark":J.palette.secondary.dark,"--sxl-app-color-secondary-light":J.palette.secondary.light,"--sxl-app-color-success":J.palette.success.main,"--sxl-app-color-success-dark":J.palette.success.dark,"--sxl-app-color-success-light":J.palette.success.light,"--sxl-app-color-warning":J.palette.warning.main,"--sxl-app-color-warning-dark":J.palette.warning.dark,"--sxl-app-color-warning-light":J.palette.warning.light,"--sxl-app-color-error":J.palette.error.main,"--sxl-app-color-error-dark":J.palette.error.dark,"--sxl-app-color-error-light":J.palette.error.light,"--sxl-app-color-text":J.palette.text.primary,"--sxl-app-color-text-secondary":J.palette.text.secondary,"--sxl-app-color-text-disabled":J.palette.text.disabled,"--sxl-app-color-background":J.palette.background.paper,"--sxl-app-color-button-surface":J.palette.grey[600],"--sxl-app-color-shadow":J.palette.action.focus,"--sxl-app-color-grey":J.palette.grey[500],"--sxl-app-filter-dark-invert":Qe.body.darkMode&&!V?"hue-rotate(180deg) invert(1) brightness(95%)":"none","--sxl-app-image-background":Qe.body.darkMode?`linear-gradient(${pt("#fff",Vn(5))}, ${pt("#fff",Vn(5))})`:void 0},children:[Tn,Lt?Rt:null,s.jsx(Le,{sx:{marginBottom:Ne=>Ne.spacing(.75)}}),zn,Zt,s.jsx(di,{arrow:!0,disableInteractive:!0,open:K,title:s.jsx(Mn,{variant:"subtitle2",component:"div",children:te}),placement:pe,TransitionProps:{timeout:{exit:0}},PopperProps:{popperRef:Q,sx:{"& .MuiTooltip-tooltip":{padding:"2px 6px","& .MuiTooltip-arrow":{display:K?"visible":"none"}}},anchorEl:{getBoundingClientRect:()=>new DOMRect(fe.x,fe.y,fe.width,fe.height)},modifiers:[{name:"offset",options:{offset:[0,0]}}]},children:s.jsx(Le,{})}),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}]=i1(),[E,{width:C}]=i1(),[R,_]=u.useState(!1),L=u.useRef(null),T=u.useRef(null),j=ir(t,()=>({requestWorkbookTitle:(S=null,k)=>{T.current={onAccept:S,requestReason:k?.requestReason},k?.selectAll&&L.current?.select(),L.current?.focus(k)},focus:S=>{L.current?.focus(S)}}),[]);return u.useLayoutEffect(()=>{_(r!==m),v(r),y(r)},[r]),u.useEffect(()=>{R&&w!==0&&Xt.debounce(()=>{_(!1)},300)()},[R,w]),u.useEffect(()=>{g(m&&!El.isValidWindowsFilename(m))},[m]),c?null:s.jsx(Le,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",opacity:R?"0":"1",transition:R?void 0:"opacity .25s ease-in","& .tooltip-wrapper":{maxWidth:"100%"}},ref:V2([j,E,t]),...d,children:s.jsx(br,{label:T.current?.requestReason??"Workbook Name",children:s.jsxs(Le,{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(Mn,{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:S=>h?S.palette.error.dark:void 0},children:r??i}):s.jsx(ql,{sx:{width:`${Math.min(w+3,Math.max(C,j.current?.getBoundingClientRect()?.width))}px`,overflow:"hidden",whiteSpace:"nowrap",fontWeight:"600",maxWidth:"100%",border:"none",padding:"0px",margin:"0px",color:S=>h?S.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:S=>{f(!0),S.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:S=>{if(S.target.value.length>El.MAX_WORKBOOK_NAME_SIZE)return S.stopPropagation(),void S.preventDefault();y(S.target.value)},onKeyDown:S=>{(El.WINDOW_FILENAME_CHAR_RESERVED_REGEX.test(S.key)||S.target?.value.length>El.MAX_WORKBOOK_NAME_SIZE)&&S.preventDefault(),S.which===tn.Enter||S.which===tn.Tab?(h?y(x):(a?.(m),m&&(T.current?.onAccept?.(m,"keydown"),T.current=null)),S.stopPropagation(),S.preventDefault(),o?.focus()):S.which===tn.Escape&&(m===x?o?.focus():(y(x),setTimeout(()=>{S.target?.select()},0)),T.current=null,S.stopPropagation(),S.preventDefault())},value:m}),s.jsx(Le,{ref:b,sx:{position:"absolute",visibility:"hidden",top:"-9999px",fontWeight:"600 !important",whiteSpace:"pre",fontStyle:m!==x?"italic":void 0,fontFamily:S=>S.typography.fontFamily,letterSpacing:"0.00938em"},children:m||i})]})})})}));Xf.displayName="WorkbookTitle";const PN=u.lazy(()=>Promise.resolve().then(()=>require("./FG67s6xYNluXdXvC.cjs")).then(e=>e.BRa_Zmk0947GsWKY).then(e=>e.E)),PC=u.memo(u.forwardRef((e,t)=>{const{sx:n,style:o,className:r,licenseKey:i,...a}=e;return i&&$.LicenseManager.setLicenseKey(i),s.jsx(s.Fragment,{children:s.jsx(PN,{...a,className:r,sx:n,style:o,ref:t})})}));PC.displayName="StandaloneWorkbook";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 OC{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 DC=new OC;(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 AC=Object.freeze(Object.defineProperty({__proto__:null,AppearanceCommandButton:dC,AutoColorPosition:Is,BorderCommandButton:NS,BorderPopupButton:BS,BorderStyleButton:FS,ClearCommandButton:kf,ColorButton:N2,ColorCommandButton:Ys,ColorPanel:zS,ColorPanelType:AS,ColorPopupButton:Cf,DeleteCellsCommandButton:Mf,DocThemeCommandButton:cC,FillCommandButton:qS,FilterColumnMenu:Ff,FilterCommandButton:GB,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:JB,RangeInput:Of,RunScriptCommandButton:qf,ScriptEditorToolbar:Wf,ScriptWorkspace:Uf,SheetTab:Bf,SheetTabMenu:Nf,SheetZoomScale:Df,SheetsAllMenu:$f,SortFilterCommandButton:Tf,StandaloneWorkbook:PC,StatusBar:Af,StyledStrokeIcon:Wh,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:$2,WorkbookContextMenu:Gf,WorkbookElement:Zf,WorkbookIO:DC,WorkbookStrip:Kf,WorkbookTitle:Xf,WorkbookViewCommandButton:QS,_WorkbookIO:OC,createGridStyleFromMUITheme:Gh,defaultNewWorkbook:RC,useResolvedThemeMode:SC,useWorkbookCommands:jC},Symbol.toStringTag,{value:"Module"})),Zh=new Map,LC=(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(l1(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})},Pd=new Map;let Os;const by=async e=>Os||(Os=await(async(t,n)=>{try{if(n?.selector&&zC(n?.selector,n?.loading),!t){const{resolveDependencies:o}=await Promise.resolve().then(()=>require("./f8iOur27WgxcCHu-.cjs"));t=await o(n?.dependencies)}n?.licenseKey&&await t.StudioMUI.LicenseManager.setLicenseKey(n.licenseKey),n?.selector&&l1(n?.selector)}catch(o){throw n?.selector&&(l1(n.selector),FC(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:XC,ReactDOM:sm,ReactDOMClient:sm,StudioMUI:AC},typeof e=="object"?e:void 0),Os),AN={attachWorkbook:async(e,t)=>(Os||(Os=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(Pd.has(a)&&Pd.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;zC(a,c?.loading);try{l1(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};Pd.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 E={...i,...w,ref:p};return d.render(n.React.createElement(f,E)),Promise.resolve()}:v==="detach"?()=>(Pd.delete(a),d.unmount(),y=!0,Promise.resolve()):Reflect.get(x,v,b)}})}catch(d){throw l1(a),FC(a,{message:`Failed to initialize: ${d instanceof Error?d.message:String(d)}`,...c?.error}),console.error("Failed to initialize:",d),d}})(Os,e,"StandaloneWorkbook",t)),async initialize(e){await by(e)}};exports.$R=uC,exports.$n=Vn,exports.$t=Ft,exports.AR=()=>{const{showModal:e}=ud();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const a=e(IA,{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=Le,exports.Bu=ud,exports.CR=e=>s.jsxs(Je,{...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=Ba,exports.DM=_C,exports.DR=(e,t)=>{let n=nh({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)),nh(r)},exports.DialogContent=Ex,exports.E0=qi,exports.ER=e=>s.jsxs(Je,{...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.Fn=Bn,exports.FormControl=x1,exports.FormControlLabel=Na,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(XD,ZD),d=c[0],p=c[1],f=u.useCallback(function(v,b){var w=Ev(b,YD);v?p({type:Ci.UPDATE,payload:{id:v,props:w}}):console.error(Ap)},[p]),h=u.useCallback(function(v){v?p({type:Ci.HIDE,payload:{id:v}}):console.error(Ap)},[p]),g=u.useCallback(function(v){v?p({type:Ci.DESTROY,payload:{id:v}}):console.error(Ap)},[p]),m=u.useCallback(function(v){v?p({type:Ci.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),y=u.useCallback(function(v,b,w){var E=Tv(8);return w&&w.rootId&&(E=w.rootId+"."+E),p({type:Ci.SHOW,payload:{id:E,component:v,props:b,options:w}}),{id:E,hide:function(){return h(E)},destroy:function(){return g(E)},update:function(C){return f(E,C)}}},[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],E=w.component,C=w.props,R=w.options,_=function(){var L,T;C!=null&&C.onExited&&C.onExited.apply(C,arguments),C!=null&&(L=C.TransitionProps)!=null&&L.onExited&&(T=C.TransitionProps).onExited.apply(T,arguments),g(v)};return b=o?{onExited:_}:{TransitionProps:Er({},C?.TransitionProps,{onExited:_})},u.createElement(E,Object.assign({},C,{key:v,onClose:function(){R&&R.hideOnClose&&h(v),R&&R.destroyOnClose&&R.hideOnClose&&g(v),C&&C.onClose&&C.onClose.apply(C,arguments)}},R&&!R.destroyOnClose&&b))})))},exports.IT=LS,exports.IconButton=Tr,exports.Ie=He,exports.InputAdornment=Tx,exports.InputLabel=_x,exports.JM=Zf,exports.Jt=Xt,exports.Kn=Xn,exports.L9=Z3,exports.LR=()=>{const{showModal:e}=ud();return t=>new Promise(n=>{const o=e(RA,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.MR=e=>s.jsxs(Je,{...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=b1,exports.Mn=_n,exports.N0=pa,exports.NR=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.OR=function(){const[e,t]=u.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=ud({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=qe,exports.PC=sw,exports.PR=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.Paper=Mi,exports.Px=kv,exports.Qt=Yt,exports.RR=PD,exports.Re=$e,exports.SR=e=>s.jsxs(Je,{...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.Sa=ys,exports.Select=b2,exports.SheetXL=AN,exports.StudioMUI=AC,exports.SvgIcon=Je,exports.TR=e=>s.jsx(Je,{...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.Tc=Zc,exports.TextField=k3,exports.Transition=Bi,exports.Tt=Tt,exports.Typography=Mn,exports.UR=SC,exports.WR=wC,exports.Xf=wf,exports.Xn=Lx,exports.Yb=Vb,exports.Yi=ol,exports._R=e=>s.jsxs(Je,{...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=E3,exports.alpha=pt,exports.ar=br,exports.au=Hf,exports.b4=Sh,exports.bR=e=>s.jsx(Je,{...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.bs=i0,exports.cM=Of,exports.capitalize=xt,exports.clsx=Ot,exports.cn=sn,exports.composeClasses=Rn,exports.createSvgIcon=Kn,exports.darken=Pl,exports.duration=ix,exports.eM=Rf,exports.eR=Xf,exports.es=Gs,exports.fc=i1,exports.fs=r0,exports.gR=({manager:e,commands:t,disabled:n,notifier:o=yu})=>{const r=_e(a=>{try{e?.undo(a)}catch(l){o.showError?.(l)}},[e]),i=_e(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 He("undo",a,{label:"Undo",description:T4,shortcut:{key:"z",modifiers:[$e.Ctrl]},disabled:!0},r),new He("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?uI(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.generateUtilityClass=jn,exports.generateUtilityClasses=kn,exports.getTransitionProps=Oc,exports.globalCss=sx,exports.h5=V2,exports.internal_mutateStyles=o3,exports.internal_serializeStyles=Mr,exports.ir=xr,exports.j1=qc,exports.kR=e=>s.jsxs(Je,{...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.km=Vf,exports.kn=Cn,exports.ks=l0,exports.lS=Lv,exports.li=Ca,exports.lighten=Ol,exports.lu=Ju,exports.me=_e,exports.memoTheme=vn,exports.nk=hw,exports.q9=J3,exports.qR=DC,exports.rn=tn,exports.sM=Pf,exports.styled=Et,exports.styled$1=r2,exports.useDefaultProps=An,exports.useForkRef=Xo,exports.useTheme=o0,exports.useTimeout=bl,exports.vR=e=>s.jsxs(Je,{...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(Je,{...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(Je,{...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(Je,{...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.yu=yu,exports.z0=ua,exports.zi=Ya,exports.zv=av;
301
+ `,className:"error",...t})},Pd=new Map;let Os;const by=async e=>Os||(Os=await(async(t,n)=>{try{if(n?.selector&&zC(n?.selector,n?.loading),!t){const{resolveDependencies:o}=await Promise.resolve().then(()=>require("./GIDXrrerjDR3B4EL.cjs"));t=await o(n?.dependencies)}n?.licenseKey&&await t.StudioMUI.LicenseManager.setLicenseKey(n.licenseKey),n?.selector&&l1(n?.selector)}catch(o){throw n?.selector&&(l1(n.selector),FC(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:XC,ReactDOM:sm,ReactDOMClient:sm,StudioMUI:AC},typeof e=="object"?e:void 0),Os),AN={attachWorkbook:async(e,t)=>(Os||(Os=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(Pd.has(a)&&Pd.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;zC(a,c?.loading);try{l1(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};Pd.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 E={...i,...w,ref:p};return d.render(n.React.createElement(f,E)),Promise.resolve()}:v==="detach"?()=>(Pd.delete(a),d.unmount(),y=!0,Promise.resolve()):Reflect.get(x,v,b)}})}catch(d){throw l1(a),FC(a,{message:`Failed to initialize: ${d instanceof Error?d.message:String(d)}`,...c?.error}),console.error("Failed to initialize:",d),d}})(Os,e,"StandaloneWorkbook",t)),async initialize(e){await by(e)}};exports.$R=uC,exports.$n=Vn,exports.$t=Ft,exports.AR=()=>{const{showModal:e}=ud();return t=>{const{defaultOption:n=t.options?.[0],cancelOption:o="Cancel",...r}=t;return new Promise(i=>{const a=e(IA,{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=Le,exports.Bu=ud,exports.CR=e=>s.jsxs(Je,{...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=Ba,exports.DM=_C,exports.DR=(e,t)=>{let n=nh({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)),nh(r)},exports.DialogContent=Ex,exports.E0=qi,exports.ER=e=>s.jsxs(Je,{...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.Fn=Bn,exports.FormControl=x1,exports.FormControlLabel=Na,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(XD,ZD),d=c[0],p=c[1],f=u.useCallback(function(v,b){var w=Ev(b,YD);v?p({type:Ci.UPDATE,payload:{id:v,props:w}}):console.error(Ap)},[p]),h=u.useCallback(function(v){v?p({type:Ci.HIDE,payload:{id:v}}):console.error(Ap)},[p]),g=u.useCallback(function(v){v?p({type:Ci.DESTROY,payload:{id:v}}):console.error(Ap)},[p]),m=u.useCallback(function(v){v?p({type:Ci.DESTROY_BY_ROOT_ID,payload:{rootId:v}}):console.error("[ERROR]: Modal root ID is missing")},[p]),y=u.useCallback(function(v,b,w){var E=Tv(8);return w&&w.rootId&&(E=w.rootId+"."+E),p({type:Ci.SHOW,payload:{id:E,component:v,props:b,options:w}}),{id:E,hide:function(){return h(E)},destroy:function(){return g(E)},update:function(C){return f(E,C)}}},[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],E=w.component,C=w.props,R=w.options,_=function(){var L,T;C!=null&&C.onExited&&C.onExited.apply(C,arguments),C!=null&&(L=C.TransitionProps)!=null&&L.onExited&&(T=C.TransitionProps).onExited.apply(T,arguments),g(v)};return b=o?{onExited:_}:{TransitionProps:Er({},C?.TransitionProps,{onExited:_})},u.createElement(E,Object.assign({},C,{key:v,onClose:function(){R&&R.hideOnClose&&h(v),R&&R.destroyOnClose&&R.hideOnClose&&g(v),C&&C.onClose&&C.onClose.apply(C,arguments)}},R&&!R.destroyOnClose&&b))})))},exports.IT=LS,exports.IconButton=Tr,exports.Ie=He,exports.InputAdornment=Tx,exports.InputLabel=_x,exports.JM=Zf,exports.Jt=Xt,exports.Kn=Xn,exports.L9=Z3,exports.LR=()=>{const{showModal:e}=ud();return t=>new Promise(n=>{const o=e(RA,{...t,onOption(r){t?.onOption?.(r,r===t.cancelOption,r===t.defaultOption),n(r)},onDone:()=>{t?.onDone?.(),o.hide()}})})},exports.MR=e=>s.jsxs(Je,{...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=b1,exports.Mn=_n,exports.N0=pa,exports.NR=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.OR=function(){const[e,t]=u.useState(()=>new Map),{showModal:n,updateModal:o,destroyModal:r,hideModal:i}=ud({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=qe,exports.PC=sw,exports.PR=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e},exports.Paper=Mi,exports.Px=kv,exports.Qt=Yt,exports.RR=PD,exports.Re=$e,exports.SR=e=>s.jsxs(Je,{...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.Sa=ys,exports.Select=b2,exports.SheetXL=AN,exports.StudioMUI=AC,exports.SvgIcon=Je,exports.TR=e=>s.jsx(Je,{...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.Tc=Zc,exports.TextField=k3,exports.Transition=Bi,exports.Tt=Tt,exports.Typography=Mn,exports.UR=SC,exports.WR=wC,exports.Xf=wf,exports.Xn=Lx,exports.Yb=Vb,exports.Yi=ol,exports._R=e=>s.jsxs(Je,{...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=E3,exports.alpha=pt,exports.ar=br,exports.au=Hf,exports.b4=Sh,exports.bR=e=>s.jsx(Je,{...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.bs=i0,exports.cM=Of,exports.capitalize=xt,exports.clsx=Ot,exports.cn=sn,exports.composeClasses=Rn,exports.createSvgIcon=Kn,exports.darken=Pl,exports.duration=ix,exports.eM=Rf,exports.eR=Xf,exports.es=Gs,exports.fc=i1,exports.fs=r0,exports.gR=({manager:e,commands:t,disabled:n,notifier:o=yu})=>{const r=_e(a=>{try{e?.undo(a)}catch(l){o.showError?.(l)}},[e]),i=_e(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 He("undo",a,{label:"Undo",description:T4,shortcut:{key:"z",modifiers:[$e.Ctrl]},disabled:!0},r),new He("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?uI(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.generateUtilityClass=jn,exports.generateUtilityClasses=kn,exports.getTransitionProps=Oc,exports.globalCss=sx,exports.h5=V2,exports.internal_mutateStyles=o3,exports.internal_serializeStyles=Mr,exports.ir=xr,exports.j1=qc,exports.kR=e=>s.jsxs(Je,{...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.km=Vf,exports.kn=Cn,exports.ks=l0,exports.lS=Lv,exports.li=Ca,exports.lighten=Ol,exports.lu=Ju,exports.me=_e,exports.memoTheme=vn,exports.nk=hw,exports.q9=J3,exports.qR=DC,exports.rn=tn,exports.sM=Pf,exports.styled=Et,exports.styled$1=r2,exports.useDefaultProps=An,exports.useForkRef=Xo,exports.useTheme=o0,exports.useTimeout=bl,exports.vR=e=>s.jsxs(Je,{...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(Je,{...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(Je,{...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(Je,{...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.yu=yu,exports.z0=ua,exports.zi=Ya,exports.zv=av;