@sheetxl/utils-react 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -11
- package/README.md +7 -7
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/index.mjs +33 -33
- package/node/assets/style.css +1 -1
- package/node/esm/index.mjs +22 -22
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Repository Licensing
|
|
2
|
-
|
|
3
|
-
SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
|
|
4
|
-
|
|
5
|
-
For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
|
|
6
|
-
|
|
7
|
-
Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
|
|
8
|
-
|
|
9
|
-
For more details on commercial licensing, please visit our website:
|
|
10
|
-
|
|
11
|
-
https://www.sheetxl.com/licensing-pricing
|
|
1
|
+
# Repository Licensing
|
|
2
|
+
|
|
3
|
+
SheetXL contains a mix of open-source and commercially licensed packages. Each package is individually licensed and contains its own license file.
|
|
4
|
+
|
|
5
|
+
For the specific terms and conditions applicable to a package, please see the `LICENSE.md` file located in that package's root directory.
|
|
6
|
+
|
|
7
|
+
Generally, packages intended for public distribution (such as CLIs, adapters, and vanilla wrappers) are licensed under the MIT license. All other core packages are proprietary and require a commercial license for use.
|
|
8
|
+
|
|
9
|
+
For more details on commercial licensing, please visit our website:
|
|
10
|
+
|
|
11
|
+
https://www.sheetxl.com/licensing-pricing
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# React Utilities
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
Collection of React components available for all [SheetXL](https://www.sheetxl.com) projects.
|
|
6
|
-
|
|
7
|
-
This package will generally not be used by itself but rather as a dependency of other packages.
|
|
1
|
+
# React Utilities
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Collection of React components available for all [SheetXL](https://www.sheetxl.com) projects.
|
|
6
|
+
|
|
7
|
+
This package will generally not be used by itself but rather as a dependency of other packages.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
"use strict";/**
|
|
3
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.
|
|
3
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.4
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
7
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),l=require("react"),K=require("@sheetxl/utils"),Gt=require("react-dom/client"),Jt=require("react-dom"),W={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ee={Horizontal:"horizontal",Vertical:"vertical"};function gt(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=gt(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function _e(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=gt(t))&&(o&&(o+=" "),o+=e);return o}var Qt=function(){},yt=typeof window<"u",en=yt?l.useLayoutEffect:l.useEffect,ot={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const he=yt&&window.ResizeObserver!==void 0?function(){var t=l.useState(null),e=t[0],n=t[1],o=l.useState(ot),i=o[0],r=o[1],s=l.useMemo(function(){return new window.ResizeObserver(function(c){if(c[0]){var a=c[0].contentRect,u=a.x,h=a.y,d=a.width,p=a.height,S=a.top,C=a.left,E=a.bottom,b=a.right;r({x:u,y:h,width:d,height:p,top:S,left:C,bottom:E,right:b})}})},[]);return en(function(){if(e)return s.observe(e),function(){s.disconnect()}},[e]),[n,i]}:function(){return[Qt,ot]},L=(t,e)=>{const n=l.useCallback((...r)=>t?.(...r),e),o=l.useRef(null);o.current=n;const i=l.useCallback((...r)=>o.current?.(...r),[]);if(o.current)return i},vt=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z":"m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z";return v.jsx("div",{style:{paddingBottom:"0px",paddingRight:"0px",paddingLeft:i?"0px":"3px",paddingTop:i?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${i?"vertical":"horizontal"} single-button start`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},xt=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z":"m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z";return v.jsx("div",{style:{paddingLeft:"0px",paddingTop:"0px",paddingRight:i?"0px":"3px",paddingBottom:i?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${i?"vertical":"horizontal"} single-button end`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},Oe=(t,e,n,o,i=0)=>{for(let r=0;r<n.length;r++){const s=n[r].getBoundingClientRect();let c=s.left-e,a=c+s.width;if(o){if(c<t&&a>=t)return c}else if(Math.ceil(a)>Math.ceil(t)+2)return a}return i},tn=Object.freeze(Object.defineProperty({__proto__:null,getScrollTo:Oe},Symbol.toStringTag,{value:"Module"})),nn="_sheetxl-scrollbar_18qzf_11",ze=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,totalSize:o=0,viewportSize:i=0,style:r,className:s,orientation:c=ee.Vertical,onScrollOffset:a,onScroll:u,showCustomScrollButtons:h=!1,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:p=260,scrollButtonAdditionalRepeatDelay:S=120,createScrollStartButton:C=vt,createScrollEndButton:E=xt,...b}=t,B=L(u,[u]),_=l.useRef(null),[x,{width:g,height:z}]=he(),[k,{width:j,height:H}]=he(),y=c===ee.Vertical,w=y?"top":"left",R=y?"scrollTop":"scrollLeft",f=y?z:g,M=y?H:j,[m,T]=l.useState(null);l.useEffect(()=>{m!==null&&_.current&&_.current.scrollTo({behavior:"smooth",[w]:m})},[m,y]);const P=l.useCallback(($,ne=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),oe=te.children,re=ne?0:Oe($,ce[w],oe,!0,Math.max(0,$-d));return T(re),Math.max(0,re)},[]),X=l.useCallback(($,ne=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),oe=te.children,re=Math.ceil(M-f),ye=ne?re:Oe($,ce[w],oe,!1,Math.max(0,$+d));return T(ye),Math.min(re,ye)},[M,f]),F=l.useRef(null),I=l.useCallback($=>{F.current=n;const ne=$.target[R];a(ne,i,o),B?.($)},[a,i,o,n]);l.useEffect(()=>{const $=F.current;F.current=null,n!==$&&(_.current[R]=n)},[n,R]);const N=l.useRef(null),A=l.useRef(null),V=l.useCallback(()=>{N.current&&(clearTimeout(N.current),N.current=null,A.current=null)},[]),U=l.useCallback(($,ne,te,ce=p)=>{A.current=$,N.current=setTimeout(()=>{const oe=te?P(A.current||$):X(A.current||$);oe!==A.current?U(oe,!1,te,S):V()},ne?0:ce)},[P,X,V]);l.useEffect(()=>()=>V(),[V]);const J=n,de=l.useMemo(()=>{if(!h)return null;const $={orientation:c,disabled:Math.floor(J)<=0||Math.floor(M-f)===0,onMouseUp:V,onMouseLeave:V,onMouseDown:()=>U(J,!0,!0)};return C?.($)},[h,c,J,m,M,f]),fe=l.useMemo(()=>{if(!h)return null;const $={orientation:c,disabled:Math.floor(M-f)<=Math.ceil(J),onMouseUp:V,onMouseLeave:V,onMouseDown:()=>U(J,!0,!1)};return E?.($)},[h,c,J,m,M,f]);return v.jsxs("div",{ref:e,style:{display:"flex",flex:"1",flexDirection:y?"column":"row",padding:"0",...r},className:_e(nn,s),...b,children:[de,v.jsx("div",{className:"pseudo-scrollbar",style:{flex:"1 1 100%",display:"flex",boxSizing:"content-box",flexDirection:y?"column":"row",justifyContent:"center",alignItems:"center"},ref:x,children:v.jsx("div",{tabIndex:-1,style:{flex:"1 1 100%",overflowY:y?"scroll":"hidden",overflowX:y?"hidden":"scroll",position:"relative",willChange:"transform"},onScroll:I,ref:_,children:v.jsx("div",{ref:k,style:{position:"absolute",height:y?o-i+(z??0):1,width:y?1:o-i+(g??0)},className:"scrollbar-viewport"})})}),fe]})}));ze.displayName="Scrollbar";let it=Date.now,rt=1e3,ae={},on=1;const ve=t=>{let e=ae[t]!==null;return e&&(ae[t]=null),e},st=(t,e,n,o=0,i)=>{let r=it(),s=r,c=0,a=0,u=on++;if(u%20==0){const d={};for(let p in ae)d[p]=!0;ae=d}const h=function(d){const p=d!==!0,S=it();if(!ae[u]||e&&!e(u))return ae[u]=null,void n(60-a/((S-r)/rt),u,!1);if(p){const E=Math.round((S-s)/16.666666666666668)-1;for(let b=0;b<Math.min(E,4);b++)h(!0),a++}o&&(c=(S-r)/o,c>1&&(c=1));const C=i?i(c):c;t(C,S,p)!==!1&&c!==1||!p?p&&(s=S,requestAnimationFrame(h)):(ae[u]=null,n(60-a/((S-r)/rt),u,c===1||o===void 0))};return ae[u]=!0,requestAnimationFrame(h),u};var rn=function(){},sn=function(t){return Math.pow(t-1,3)+1},ln=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},bt=function(t,e){for(var n in this.__callback=t,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:rn,penetrationDeceleration:.03,penetrationAcceleration:.08},e)this.options[n]=e[n]};bt.prototype={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(t,e,n,o){t!==null&&(this.__clientWidth=t),e!==null&&(this.__clientHeight=e),n!==null&&(this.__contentWidth=n),o!==null&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(t,e){this.__clientLeft=t||0,this.__clientTop=e||0},setSnapSize:function(t,e){this.__snapWidth=t,this.__snapHeight=e},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}},getPoint:function(t,e){var n=this.getValues();return{left:t/n.zoom,top:e/n.zoom}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(t,e,n,o,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1);var r=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),o===void 0&&(o=this.__clientHeight/2),t=Math.max(Math.min(t,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(t);var s=t/r,c=s*(this.__scrollLeft+n)-n,a=s*(this.__scrollTop+o)-o;c>this.__maxScrollLeft?c=this.__maxScrollLeft:c<0&&(c=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(c,a,t,e)},zoomBy:function(t,e,n,o,i){this.zoomTo(this.__zoomLevel*t,e,n,o,i)},scrollTo:function(t,e,n,o){if(this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1),o!==void 0&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");t*=o,e*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX?this.options.paging?t=Math.round(t/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(t=Math.round(t/this.__snapWidth)*this.__snapWidth):t=this.__scrollLeft,this.options.scrollingY?this.options.paging?e=Math.round(e/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(e=Math.round(e/this.__snapHeight)*this.__snapHeight):e=this.__scrollTop,t=Math.max(Math.min(this.__maxScrollLeft,t),0),e=Math.max(Math.min(this.__maxScrollTop,e),0),t===this.__scrollLeft&&e===this.__scrollTop&&(n=!1),this.__publish(t,e,o,n)},scrollBy:function(t,e,n){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(t||0),i+(e||0),n)},doMouseZoom:function(t,e,n,o){var i=t>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(t,e){if(t.length===void 0)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);var n,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(ve(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var i=t.length===1;i?(n=t[0].pageX,o=t[0].pageY):(n=Math.abs(t[0].pageX+t[1].pageX)/2,o=Math.abs(t[0].pageY+t[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=o,this.__lastTouchMove=e,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,this.__positions=[]},doTouchMove:function(t,e,n){if(t.length===void 0)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){var o,i;t.length===2?(o=Math.abs(t[0].pageX+t[1].pageX)/2,i=Math.abs(t[0].pageY+t[1].pageY)/2):(o=t[0].pageX,i=t[0].pageY);var r=this.__positions;if(this.__isDragging){var s=o-this.__lastTouchLeft,c=i-this.__lastTouchTop,a=this.__scrollLeft,u=this.__scrollTop,h=this.__zoomLevel;if(n!==void 0&&this.options.zooming){var d=h;if(h=h/this.__lastScale*n,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var p=o-this.__clientLeft,S=i-this.__clientTop;a=(p+a)*h/d-p,u=(S+u)*h/d-S,this.__computeScrollMax(h)}}if(this.__enableScrollX){a-=s*this.options.speedMultiplier;var C=this.__maxScrollLeft;(a>C||a<0)&&(this.options.bouncing?a+=s/2*this.options.speedMultiplier:a=a>C?C:0)}if(this.__enableScrollY){u-=c*this.options.speedMultiplier;var E=this.__maxScrollTop;(u>E||u<0)&&(this.options.bouncing?u+=c/2*this.options.speedMultiplier:u=u>E?E:0)}r.length>60&&r.splice(0,30),r.push(a,u,e),this.__publish(a,u,h)}else{var b=this.options.locking?3:0,B=Math.abs(o-this.__initialTouchLeft),_=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&B>=b,this.__enableScrollY=this.options.scrollingY&&_>=b,r.push(this.__scrollLeft,this.__scrollTop,e),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(B>=5||_>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=i,this.__lastTouchMove=e,this.__lastScale=n}},doTouchEnd:function(t){if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&t-this.__lastTouchMove<=100){for(var e=this.__positions,n=e.length-1,o=n,i=n;i>0&&e[i]>this.__lastTouchMove-100;i-=3)o=i;if(o!==n){var r=e[n]-e[o],s=this.__scrollLeft-e[o-2],c=this.__scrollTop-e[o-1];this.__decelerationVelocityX=s/r*(1e3/60),this.__decelerationVelocityY=c/r*(1e3/60);var a=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>a||Math.abs(this.__decelerationVelocityY)>a)&&this.__startDeceleration(t)}else this.options.scrollingComplete()}else t-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}},__publish:function(t,e,n,o){var i=this.__isAnimating;if(i&&(ve(i),this.__isAnimating=!1),o&&this.options.animating){this.__scheduledLeft=t,this.__scheduledTop=e,this.__scheduledZoom=n;var r=this.__scrollLeft,s=this.__scrollTop,c=this.__zoomLevel,a=t-r,u=e-s,h=n-c,d=function(C,E,b){b&&(this.__scrollLeft=r+a*C,this.__scrollTop=s+u*C,this.__zoomLevel=c+h*C,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),p=function(C){return this.__isAnimating===C}.bind(this),S=function(C,E,b){E===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||b)&&this.options.scrollingComplete(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=st(d,p,S,this.options.animationDuration,i?sn:ln)}else this.__scheduledLeft=this.__scrollLeft=t,this.__scheduledTop=this.__scrollTop=e,this.__scheduledZoom=this.__zoomLevel=n,this.__callback&&this.__callback(t,e,n),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))},__computeScrollMax:function(t){t===void 0&&(t=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*t-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*t-this.__clientHeight,0)},__startDeceleration:function(t){if(this.options.paging){var e=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),n=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),o=this.__clientWidth,i=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(e/o)*o,this.__minDecelerationScrollTop=Math.floor(n/i)*i,this.__maxDecelerationScrollLeft=Math.ceil(e/o)*o,this.__maxDecelerationScrollTop=Math.ceil(n/i)*i}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;var r=function(u,h,d){this.__stepThroughDeceleration(d)}.bind(this),s=this.options.snapping?4:.1,c=function(){var u=Math.abs(this.__decelerationVelocityX)>=s||Math.abs(this.__decelerationVelocityY)>=s;return u||(this.__didDecelerationComplete=!0),u}.bind(this),a=function(u,h,d){this.__isDecelerating=!1,this.__didDecelerationComplete&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=st(r,c,a)},__stepThroughDeceleration:function(t){var e=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,e),this.__minDecelerationScrollLeft);o!==e&&(e=o,this.__decelerationVelocityX=0);var i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,this.__decelerationVelocityY=0)}if(t?this.__publish(e,n,this.__zoomLevel):(this.__scrollLeft=e,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){var r=0,s=0,c=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;e<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-e:e>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-e),n<this.__minDecelerationScrollTop?s=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(s=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*c:this.__decelerationVelocityX=r*a),s!==0&&(s*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=s*c:this.__decelerationVelocityY=s*a)}}};var Z=typeof window<"u"?window:{screen:{},navigator:{}},ge=(Z.matchMedia||function(){return{matches:!1}}).bind(Z),wt=!1,an={get passive(){return wt=!0}},lt=function(){};Z.addEventListener&&Z.addEventListener("p",lt,an),Z.removeEventListener&&Z.removeEventListener("p",lt,!1);var cn=wt,un="PointerEvent"in Z,We="ontouchstart"in Z,St=We||"TouchEvent"in Z&&ge("(any-pointer: coarse)").matches,at=(Z.navigator.maxTouchPoints||0)>0||St,Ct=Z.navigator.userAgent||"",hn=ge("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Ct)&&Math.min(Z.screen.width||0,Z.screen.height||0)>=768,Et=(ge("(pointer: coarse)").matches||!ge("(pointer: fine)").matches&&We)&&!/Windows.*Firefox/.test(Ct),dn=ge("(any-pointer: fine)").matches||ge("(any-hover: hover)").matches||hn||!We,Ke=!at||!dn&&Et?at?"touchOnly":"mouseOnly":"hybrid",fn=Ke==="mouseOnly"?"mouse":Ke==="touchOnly"||Et?"touch":"mouse";const pn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:Ke,primaryInput:fn,supportsPassiveEvents:cn,supportsPointerEvents:un,supportsTouchEvents:St},Symbol.toStringTag,{value:"Module"})),_n=new Set(["INPUT","TEXTAREA","SELECT"]),Lt={};function He(){return pn}const Mt=t=>t==="BracketLeft"?"[":t==="BracketRight"?"]":K.CommonUtils.camelToPrettyCase(t),mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Lt,boundPixel:function(t,e=!1,n=0){return t},createSyntheticEvent:t=>{let e=!1,n=!1;return{nativeEvent:t,currentTarget:t.currentTarget,target:t.target,bubbles:t.bubbles,cancelable:t.cancelable,defaultPrevented:t.defaultPrevented,eventPhase:t.eventPhase,isTrusted:t.isTrusted,preventDefault:()=>{e=!0,t.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{n=!0,t.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:t.timeStamp,type:t.type}},detectIt:He,focusableNodeNames:_n,toPrettyKeyCode:Mt},Symbol.toStringTag,{value:"Module"})),gn=[];function Ue(t,e,n=gn){const o=l.useRef(null);return l.useImperativeHandle(t,()=>{if(!o.current)return;const i=o.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const s=Object.keys(r),c=s.length;for(let a=0;a<c;a++){const u=s[a],h=r[u];Object.defineProperty(i,u,{value:h,writable:!0,configurable:!0,enumerable:!0})}return i},n),o}const Ve=t=>v.jsx(ze,{...t}),Tt=({width:t,height:e})=>v.jsx("div",{className:"corner",style:{minWidth:`${t}px`,width:`${t}px`,minHeight:`${e}px`,height:`${e}px`}}),Dt=l.memo(l.forwardRef((t,e)=>{const{children:n,viewport:o,onScrollViewport:i,showHorizontalScrollbar:r=!0,showVerticalScrollbar:s=!0,createScrollCorner:c=Tt,createHorizontalScrollbar:a=Ve,createVerticalScrollbar:u=Ve,style:h,touchElement:d,disableTouch:p,...S}=t,C=L(i,[i]),E=Ue(e,()=>({isScrollPane:()=>!0}),[]),b=l.useRef(null);l.useEffect(()=>{b.current&&(b.current.__scrollTop===o?.top&&b.current.__scrollLeft!==!o?.left||b.current?.scrollTo(o?.left,o?.top,!1))},[o?.left,o?.top,d]);const B=l.useCallback((f,M)=>{C?.({left:f,top:M})},[]),_=l.useCallback(f=>{b.current?.doTouchStart(f.touches,f.timeStamp)},[]),x=l.useCallback(f=>{f.preventDefault(),b.current?.doTouchMove(f.touches,f.timeStamp)},[]),g=l.useCallback(f=>{b.current?.doTouchEnd(f.timeStamp)},[]),z=l.useCallback(({containerWidth:f,containerHeight:M,totalWidth:m,totalHeight:T})=>{b.current.setDimensions(f,M,m,T)},[]);l.useEffect(()=>{const f=d??E.current;if(!p&&He().supportsTouchEvents&&f&&o){if(!b.current){const M={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};b.current=new bt(B,M)}He().supportsTouchEvents&&(f.addEventListener("touchstart",_),f.addEventListener("touchend",g),f.addEventListener("touchmove",x)),z({containerWidth:o?.width,containerHeight:o?.height,totalWidth:o?.totalWidth,totalHeight:o?.totalHeight})}return()=>{f?.removeEventListener("touchstart",_),f?.removeEventListener("touchend",g),f?.removeEventListener("touchmove",x)}},[o?.width,o?.height,o?.totalWidth,o?.totalHeight,p,d]);const[k,{width:j}]=he(),[H,{height:y}]=he(),w=l.useMemo(()=>{const f=u({orientation:ee.Vertical,offset:o?.top,viewportSize:o?.height,totalSize:o?.totalHeight,onScrollOffset:M=>{C?.({top:M})}});return v.jsx("div",{style:{display:"flex",flex:"0"},ref:k,children:f})},[u,o?.top,o?.height,o?.totalHeight]),R=l.useMemo(()=>{const f=a({orientation:ee.Horizontal,offset:o?.left,viewportSize:o?.width,totalSize:o?.totalWidth,onScrollOffset:M=>C?.({left:M})});return v.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${j}px)`},children:v.jsx("div",{ref:H,className:"sizer",children:f})}),s?c({width:j,height:y}):v.jsx(v.Fragment,{})]})},[a,o?.left,o?.width,o?.totalWidth,s,c,j,y]);return v.jsx("div",{style:{position:"relative",display:"flex",minWidth:s?`${j}px`:void 0,minHeight:r?`${y}px`:void 0,...h},...S,ref:E,children:v.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[v.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:n}),s?w:v.jsx(v.Fragment,{})]}),r?R:v.jsx(v.Fragment,{})]})})}));Dt.displayName="ScrollPane";const Fe={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"},ct=new Set,Ae={showMessage:(t,e)=>{if(e?.onceKey){if(ct.has(e.onceKey))return;ct.add(e.onceKey)}let n=console.log;e?.type!==Fe.Warning&&e?.type!==Fe.Error||(n=console.warn),n(t)},showBusy:(t,e)=>new Promise(n=>{n(()=>{})}),showError:t=>{console.error(t)}},ut=()=>{const t=document.fullscreenElement;return t?t.querySelector(".fullscreen-portal-root")||t:document.body};let Se=0;const yn=100,vn=100,xn=1e6,bn=100,wn=50,Pt=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,viewportSize:o=0,totalSize:i=0,minSize:r=0,endGap:s=yn,endScrollIncrement:c=vn,style:a=Lt,onMouseDown:u,onScrollOffset:h,onScroll:d,scaleLimit:p=xn,scaleFactor:S=bn,precisionFactor:C=wn,...E}=t;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const b=L(u,[u]),B=()=>({offset:n,totalSize:p===0?i:Math.min(i??0,Math.max(r??0,(n??0)+(o??0))+(s??0))}),[_,x]=l.useState(B),g=p!==0&&_.totalSize>p?S:1,z=g/C,k=Math.ceil(_.totalSize/g),j=Math.ceil(_.offset/g),H=Math.ceil(o/g),y=l.useCallback(P=>{},[]),[w,R]=l.useState(!1),f=l.useRef(null);l.useLayoutEffect(()=>{if(!w){f.current={propTotalSize:i,propViewportSize:o,propOffset:n};const P=B();x(P)}},[i,o,n,w,r,s,c]);const M=L((P,X,F)=>{const I=f.current;f.current=null,I&&I.propTotalSize===i&&I.propViewportSize===o&&I.propOffset===n||(Math.abs(P-j)<z&&(P=j),h?.(P*g,j,H))},[h,g,z,j,H]),m=l.useCallback(P=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",m),R(!1)},[]),T=l.useCallback(P=>{b?.(P),R(!0),document.addEventListener("mousemove",y,{passive:!0}),document.addEventListener("mouseup",m,{passive:!0})},[y,m]);return v.jsx(ze,{ref:e,style:{...a},...E,offset:j,totalSize:k,viewportSize:H,onMouseDown:T,onScrollOffset:M})}));Pt.displayName="VirtualScrollbar";function Be(t,e){if(typeof t=="function")return t(e);t&&(t.current=e)}var Pe=parseInt(l.version.split(".")[0],10)>=19?function(t){return e=>{const n=[];for(const o of t){const i=Be(o,e),r=typeof i=="function";n.push(r?i:()=>Be(o,null))}return()=>{for(const o of n)o()}}}:function(t){return e=>{for(const n of t)Be(n,e)}};const Sn=l.memo(l.forwardRef((t,e)=>{const{refFocusStart:n,...o}=t,i=l.useRef(null),r=l.useCallback(()=>{if(n)return void n?.current?.focus();const s=i.current.parentElement.children;let c=[];for(let a=0;a<s.length&&s[a]!==i.current;a++){const u=s[a].getAttribute("tabindex");if(u==null||u==="-1"||s[a].getAttribute("disabled")==="true")continue;const h=s[a];h.focus&&c.push({tabindex:parseInt(u),child:h})}c.length!==0&&(c.sort(function(a,u){return a.tabindex-u.tabindex}),c[0].child.focus())},[n]);return v.jsx("div",{tabIndex:0,ref:Pe([i,e]),onFocus:r,...o})})),Cn=l.memo(l.forwardRef((t,e)=>{const{className:n,style:o,children:i,radius:r=4,strokeWidth:s=1,strokeColor:c="grey",...a}=t,[u,{width:h,height:d}]=he(),p=l.useRef(null),S=(B,_=0)=>{const x=B/2,g=d-x+_;return function(z,k,j=!1){if(k===0)return z;function H(m,T,P){let X=T.x-m.x,F=T.y-m.y,I=Math.sqrt(X*X+F*F);return y(m,T,Math.min(1,P/I))}function y(m,T,P){return{x:m.x+(T.x-m.x)*P,y:m.y+(T.y-m.y)*P}}function w(m,T){m.length>2&&(m[m.length-2]=T.x,m[m.length-1]=T.y)}function R(m){return{x:parseFloat(m[m.length-2]),y:parseFloat(m[m.length-1])}}let f=z.split(/[,\s]/).reduce(function(m,T){let P=T.match("([a-zA-Z])(.+)");return P?(m.push(P[1]),m.push(P[2])):m.push(T),m},[]).reduce(function(m,T){return parseFloat(T)==T&&m.length?m[m.length-1].push(T):m.push([T]),m},[]),M=[];if(f.length>1){let m=R(f[0]),T=null;f[f.length-1][0]==="Z"&&f[0].length>2&&(T=["L",m.x,m.y],f[f.length-1]=T),M.push(f[0]);for(let P=1;P<f.length;P++){let X=M[M.length-1],F=f[P],I=F===T?f[1]:f[P+1];if(I&&X&&X.length>2&&F[0]==="L"&&I.length>2&&I[0]==="L"){let N,A,V=R(X),U=R(F),J=R(I);j?(N=y(U,X.origPoint||V,k),A=y(U,I.origPoint||J,k)):(N=H(U,V,k),A=H(U,J,k)),w(F,N),F.origPoint=U,M.push(F);let de=y(N,U,.5),fe=y(U,A,.5),$=["C",de.x,de.y,fe.x,fe.y,A.x,A.y];$.origPoint=U,M.push($)}else M.push(F)}if(T){let P=R(M[M.length-1]);M.push(["Z"]),w(M[0],P)}}else M=f;return M.reduce(function(m,T){return m+T.join(" ")+" "},"")}(`${`M 0 ${x} L ${r-.5} ${x} L ${r-.5} ${g} L ${2*r} ${g}`} ${`L ${h-2*r} ${g}`} ${`M ${h-2*r} ${g} L ${h-r} ${g} L ${h-r} ${x} L ${h} ${x}`}`,r)},C=l.useMemo(()=>S(s),[h,d,r,s]),E=l.useMemo(()=>{if(r===0)return;const B=r/2;return S(r)+`L ${h} 0 L 0 0 L 0 ${B}`},[C,r,s]),b=l.useMemo(()=>({style:{clipPath:`path('${E}')`}}),[E]);return v.jsxs("div",{className:n,style:{display:"flex",flexDirection:"row",...o},...a,ref:Pe([p,u,e]),children:[l.isValidElement(i)?l.cloneElement(i,b):v.jsx(v.Fragment,{}),v.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:h,height:d,viewBox:`0 0 ${h} ${d}`,children:v.jsx("path",{d:C,stroke:c,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:s})})]})})),En={},kt=t=>{const{onPointerDown:e,style:n,splitDirection:o,paddingBefore:i=0,paddingAfter:r=0,disabled:s,key:c,hitAreaProps:a=En,...u}=t,h=o==="row",{style:d,className:p,...S}=a;return v.jsx("div",{style:{...n,position:"relative"},...u,children:v.jsx("div",{className:_e("hit-box",p),style:{left:(h?-i:0)+"px",width:`calc(100% + ${h?i+r:0}px)`,top:(h?0:-i)+"px",height:`calc(100% + ${h?0:i+r}px)`,position:"absolute",...d},onPointerDown:s?void 0:e,...S})},c)},Ce={},ue=(t,e,n=!0)=>t===null?null:t.pixels!==null?n?t.pixels:e-t.pixels:(n?t.percent:100-t.percent)/100*e,Ee=(t,e=!0)=>t?.percent?`${e?t.percent:100-t.percent}%`:t?.pixels?`${t.pixels}px`:void 0,le=(t,e)=>{if(t==null)return null;const n={percent:null,pixels:null};let o=e;return typeof t=="string"&&((t=t.trim().toLowerCase()).endsWith("px")?(t=t.substring(0,t.length-2),o=!1):t.endsWith("%")&&(t=t.substring(0,t.length-1),o=!0),t=parseFloat(t)),o?n.percent=t:n.pixels=t,Object.freeze(n)},Ln=l.memo(l.forwardRef((t,e)=>{const{elementBefore:n,elementAfter:o,splitDirection:i="row",fixedPane:r=null,position:s,onPositionChange:c,minBefore:a,maxBefore:u,minAfter:h,maxAfter:d,children:p,className:S,style:C,disabled:E=!1,onDragStart:b,onDragResize:B,onDragFinish:_,resizerProps:x=Ce,paneProps:g=Ce,paneBeforeProps:z=Ce,paneAfterProps:k=Ce,createResizer:j=kt}=t;if(p)throw new Error("Use elementBefore and elementAfter instead of children.");const H=l.useMemo(()=>l.isValidElement(o)&&l.isValidElement(n),[o,n]),y=l.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const O=D===null;return{fixedPaneOffset:D,isPercent:O,minBefore:le(a,O),maxBefore:le(u,O),minAfter:le(h,O),maxAfter:le(d,O)}},[a,u,h,d]),w=L(c,[c]),[R,f]=l.useState(()=>le(s,r===null));l.useEffect(()=>{f(le(s,r===null))},[s,r]);const[M,{width:m,height:T}]=he(),[P,{width:X,height:F}]=he(),I=i==="row"?X:F,N=i==="row"?m:T,A=l.useMemo(()=>((D,O,q,Y)=>{const ie=[null,null],Q=[null,null];if(D||(D={percent:Y.fixedPaneOffset===null?50:null,pixels:Y.fixedPaneOffset===null?null:0}),O===0)return D?.pixels!=null?Y.fixedPaneOffset!==1?(ie[0]=D?.pixels,Q[1]=100):(ie[1]=D?.pixels-q,Q[0]=100):D?.percent!=null&&(Y.fixedPaneOffset!==1?(Q[0]=D?.percent,Q[1]=100-D?.percent):(Q[1]=D?.percent,Q[0]=100-D?.percent)),{percents:Q,pixels:ie,minBefore:Ee(Y.minBefore,!0),maxBefore:Ee(Y.maxBefore,!0),minAfter:Ee(Y.minAfter),maxAfter:Ee(Y.maxAfter)};let se=ue(D,O,Y.fixedPaneOffset!==1),G=O-q,et=ue(Y.minBefore,G,!0)??0,qt=ue(Y.maxBefore,G,!0)??G,we=0,Re=0,tt=0,nt=G;we=(ue(Y.maxAfter,O,!1)??q)-q,Re=ue(Y.minAfter,O,!1)??O,tt=Math.max(et,we),nt=Math.min(qt,Re),se=Math.max(tt,Math.min(se,nt)),Re=Math.min(G-se,ue(Y.maxAfter,G-se,!0)??G),we=Math.min(G-se,ue(Y.minAfter,G-se,!0)??G),ie[0]=se,ie[1]=G-ie[0];const Zt=Math.max(0,Math.min(100,se/G*100));return Q[0]=Zt,Q[1]=100-Q[0],{percents:Q,pixels:ie,minBefore:`${et}px`,minAfter:`${we}px`,maxBefore:`${ie[0]}px`,maxAfter:`${ie[1]}px`}})(R,N,I,y),[y,R,N,I,i]),[V,U]=l.useState(!1),J=L(b,[b]),de=L(B,[B]),fe=L(_,[_]),$=l.useRef(null),ne=l.useRef(null),te=l.useRef(null),{style:ce,className:oe,...re}=g,ye={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",display:"flex",overflow:"hidden",...ce},{className:Bt,style:jt,...$t}=z,{className:Ot,style:Kt,...Ht}=k,Vt={flex:"1 1 100%",width:"100%",...C,flexDirection:i,display:"flex"},{className:Xe,style:qe,onPointerDown:Ze,...Ge}=x,Ft=L(D=>{const O=le(D,r===null);f(O)},[r]),xe=L(D=>{if(E||!V)return;const O=Qe.current?.getBoundingClientRect();let q=0;q=i==="row"?(D.clientX??D.touches?.[0]?.clientX)-O.x:(D.clientY??D.touches?.[0]?.clientY)-O.y,q=Math.max(0,Math.min(N,q)),y.fixedPaneOffset===1&&(q=N-q),s&&R.pixels===q||f({pixels:q,percent:null}),de?.(q),D.stopPropagation(),D.preventDefault()},[y,i,E,V,R,N]),Je=L(D=>{if(document.removeEventListener("pointermove",xe),document.removeEventListener("touchmove",xe),document.removeEventListener("pointerup",Je),!!V&&(U(!1),!!R)){if(fe(R.pixels),!le(s,r===null)||R.pixels!==s){const O={...R};O.percent===null&&(O.percent=O.pixels/N*100),w(O)}D.stopPropagation(),D.preventDefault()}},[R,V,s,r,N]),It=L(D=>{Ze?.(D),D.defaultPrevented||E||V||(U(!0),J(),document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("pointerup",Je,{passive:!1}))},[Ze]),Qe=Ue(e,()=>({setPosition:Ft,isSplitPane:()=>!0}),[]),Nt=l.useMemo(()=>H?j?.({key:"resizer",ref:Pe([P,ne]),className:_e("resizer",Xe),onPointerDownCapture:It,style:{cursor:E?void 0:i==="row"?"ew-resize":"ns-resize",minWidth:i==="row"?"2px":void 0,minHeight:i!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...qe},splitDirection:i,disabled:E,...Ge}):null,[H,Xe,Ge,i,qe,E]),be=i==="row"?"Width":"Height",Wt={...ye,...jt,flex:y.fixedPaneOffset===0&&A?.pixels[0]!==null?`0 0 ${Math.round(A?.pixels[0])}px`:`1 1 ${Math.round(A?.percents[0]??100)}%`,[`min${be}`]:A?.minBefore,[`max${be}`]:o?A?.maxBefore:"100%"},Ut={...ye,...Kt,flex:y.fixedPaneOffset===1&&A?.pixels[1]!==null?`0 0 ${Math.round(A?.pixels[1])}px`:`1 1 ${Math.round(A?.percents[1]??100)}%`,[`min${be}`]:A?.minAfter,[`max${be}`]:n?A?.maxAfter:"100%"},Yt=l.useMemo(()=>n?v.jsx("div",{ref:$,className:_e("before",oe,Bt),style:Wt,...re,...$t,children:n},"before"):null,[n,g,z,y,A]),Xt=l.useMemo(()=>o?v.jsx("div",{ref:te,className:_e("after",oe,Ot),style:Ut,...re,...Ht,children:o},"after"):null,[o,g,k,y,A]);return v.jsxs("div",{ref:Pe([M,Qe]),className:_e("splitPane",i==="row"?"vertical":"horizontal",{dragging:V},S),style:Vt,children:[Yt,Nt,Xt]})}));function ht(t){if(!t)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:n,onPointerMoveOrWait:o,processTouch:i=!1,consumeTouch:r=!0}=t,s=L(e,[e]),c=L(n,[n]),a=L(o,[o]),u=l.useRef(!1),h=t?.timerInitial??230,d=t?.timerContinuous??h/2,p=l.useRef(null),S=l.useRef(null),C=l.useRef(null),E=l.useRef(null),b=l.useCallback(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),B=l.useCallback(w=>{E.current=setTimeout(()=>{window.requestAnimationFrame(()=>{u.current!==!1&&a?.(S.current,C.current,p.current)}),B(d)},w??h)},[]);l.useEffect(()=>()=>b(),[]);const _=i?"pointer":"mouse",x=l.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),g=L(w=>{document.removeEventListener(`${_}move`,j),document.removeEventListener(`${_}up`,g),document.removeEventListener("keydown",H),document.removeEventListener("keyup",y),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",z),b(),window.requestAnimationFrame(()=>{u.current!==!1&&(u.current=!1,c?.(w,C.current,p.current),C.current=null)})},[]),z=l.useCallback(()=>{u.current!==!1&&(u.current=!1,g(S.current))},[]),k=L(()=>{b(),B(d),window.requestAnimationFrame(()=>{u.current!==!1&&a?.(S.current,C.current,p.current)})},[d]),j=L(w=>{S.current=w,k()},[]),H=L(w=>{C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},k()},[]),y=L(w=>{C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},k()},[d]);return L(w=>{w.isDefaultPrevented()||(C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},s(w,C.current)!==!1&&(p.current=w,S.current=w.nativeEvent,document.addEventListener(`${_}up`,g,{passive:!1}),document.addEventListener(`${_}move`,j,{passive:!1}),document.addEventListener("keydown",H,{passive:!1}),document.addEventListener("keyup",y,{passive:!1}),window.addEventListener("blur",z,{passive:!0}),i&&r&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),u.current=!0,B(h)))},[h,i])}const Mn=({initValue:t,useHookBody:e,applyStateChange:n})=>{const o=l.useRef(t);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const i=e();return l.useLayoutEffect(()=>{o.current!==i&&(o.current=i,n(i))},[n,i]),null},Ie=t=>{console&&console.warn&&console.warn(t)},je=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let Tn=1,Ne=!1,zt=!1;const Te=[],me=[],ke=()=>{me.forEach(t=>t())},Dn=({automaticContainerInternalUseOnly:t})=>{const[e,n]=l.useState([]),o=l.useRef([]);return o.current=e,t||Ne!==!1||(zt=!0),l.useEffect(()=>{let i=!0;function r(){if(i)return me[0]!==r?(t||Ne!==!0||Ie("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void n(s=>[])):void n([...Te])}return me.push(r),ke(),()=>{i=!1,o.current?.length>0&&Ie("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),me.splice(me.indexOf(r),1),ke()}},[t]),v.jsx(v.Fragment,{children:e.map(({hook:i,key:r})=>l.createElement(Mn,{...i,key:r}))})},Pn=t=>{const e=Tn++;return Te.push({hook:t,key:e}),me.length===0&&zt===!1&&(Ne=!0,(n=>{if(je.document&&je.document.createElement){const o=je.document.createElement("div");Gt.createRoot(o).render(v.jsx(n,{automaticContainerInternalUseOnly:!0}))}else Ie("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(Dn)),ke(),()=>{Te.splice(Te.findIndex(n=>n.key===e),1),ke()}},Rt=(t,e,n={})=>{let o,i,r=!1,s=!1,c=[],{unmountIfNoConsumers:a=!1}=n;const u=d=>{var p;i=d,p=()=>c.forEach(S=>S(d)),Jt.unstable_batchedUpdates(p)},h=()=>(s||(i=typeof t=="function"?t():t,s=!0),i);return()=>{const[d,p]=l.useState(h);return l.useEffect(()=>(r||(r=!0,o=Pn({initValue:t,useHookBody:e,applyStateChange:u})),c.push(p),i!==d&&p(i),()=>{c.splice(c.indexOf(p),1),c.length===0&&a&&(o(),r=!1)}),[]),d}};let At=()=>{console.warn("You must call useEditMode before setting its state.")};const kn=Rt(null,()=>{const[t,e]=l.useState(null);return At=e,t});class De{constructor(e,n,o,i){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=n,this._applyProps(o||{}),this._callback=i,i===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,n){if(typeof e=="function"){const o=n??this._context;return e(typeof o=="function"?o():o)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,n){const o=this._scopedLabels?.[e]||this._label;let i=null;if(typeof o=="function"){const r=n??this._context;i=o(typeof r=="function"?r():r)}else i=o;return i}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,n){if(!this.disabled()&&this._callback){try{let o=!0;if(n?.beforeExecute&&(o=n?.beforeExecute(this,e)),await Promise.resolve(o)===!1)return!1;const i=this._callback.bind(this)(e,this);if(await Promise.resolve(i)===!1)return!1;n?.onExecute?.(this,e),this._notifyExecute(e)}catch(o){return console.warn(o),n?.onError(this,o,e),this._notifyError(e,o),!1}return!0}}addPropertyListener(e,n=!1){if(!e)throw new Error("listener must be specified");const o=this._listenersProperties;return o.add(e),n&&e({},this),()=>{o.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const n=this._listenersExecute;return n.add(e),function(){n.delete(e)}}_notifyExecute(e){const n=this;this._listenersExecute.forEach(o=>{o.onExecute(n,e)})}_notifyError(e,n){const o=this;this._listenersExecute.forEach(i=>{i.onError?.(o,e,n)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const n=this._applyProps(e);return Object.keys(n).length>0&&this._notifyPropertyChange(n),this}_notifyPropertyChange(e){const n=this;this._listenersProperties.forEach(o=>{o(e,n)})}_applyProps(e){let n={},o=this;return Object.keys(e).forEach(i=>{let r=e[i];o["_"+i]!==r&&(o["_"+i]=n[i]=r)}),n}}class Le extends De{}class Ye{constructor(e,n){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=K.CommonUtils.uuidV4(),this._target=e,this._groupKey=n??null,this._root=this,this._nodes=new Map,this._nodes.set(n,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const o=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(i,r)=>{const s=o._root._listenersByKey,c=r.key(),a=s.get(c);a&&o._notifyCommands(a,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,n=!1){const o=this._root._focused;let i=o,r=o===this;for(;!r&&i;)i===this&&(r=!0),i=i._parent;return(r?o:this)._getCommand(e)}createChildGroup(e,n,o){let i;if(!o){let c=this;for(;c&&!i;){let a=c._nodes.get(n);a&&(i=a),c=c._parent}}i||(i=new Ye(e,n),i._parent=this,i._root=this._root,i._unListenersByCommand=null,i._listenersByKey=null,i._commandsPropertyListener=null);const r=(c,a)=>{!c.has(n)||o?c.set(n,a):o===void 0&&console.warn("commandGroup already registered",n)};r(this._root._nodes,i);let s=this._parent;for(;s;)r(this._nodes,i),s=s._parent;return this._children.set(n,i),this._notify("onGroupChange"),i}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,n=void 0){const o=this._commandsByKey,i=this._commandsByShortcut,r=this._root._commandsPropertyListener,s=this._root._unListenersByCommand;for(let c=0;c<e.length;c++){const a=e[c],u=a.key();if(o.has(u)&&!n){n===void 0&&console.warn("command already registered",u);continue}o.set(u,a);let h=s.get(a);h&&(h(),s.delete(a));const d=a.addPropertyListener(r);s.set(a,d);const p=a.shortcut();if(!p)continue;const S=Array.isArray(p)?p:[p];for(let C=0;C<S.length;C++){const E=pe(S[C]),b=i.get(E);b&&!n&&n===void 0&&console.warn(`Shortcut already registered: ${E}, ${u}, ${b}.`),i.set(E,u)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,n=[];const o=this._groupKey;for(;e;)n.push(e._nodes),e._nodes.delete(o),e=e._parent;e=this._parent;const i=r=>{r._children.forEach(s=>{for(let c=0;c<n.length;c++)s._nodes.delete(n[c]);i(s)})};i(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,n){this._addCommands(e,n),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let n=this;if(e&&(n=this._nodes.get(e),!n))return void console.warn("group not found",e);let o=this._root._focused??this._root;for(;o;)o=o._parent;this._root._focused!==n&&(this._root._focused=n,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const n=[];e.altKey&&n.push(W.Alt),e.shiftKey&&n.push(W.Shift),e.ctrlKey&&n.push(W.Ctrl),e.metaKey&&n.push(W.Meta);let o=pe({key:e.code,modifiers:n});const i=this._commandsByShortcut;let r=i.get(o);r||(o=pe({key:e.key,modifiers:n}),r=i.get(o)),!r&&e.code.startsWith("Digit")&&(o=pe({key:e.code.substring(5,e.code.length),modifiers:n}),r=this._commandsByShortcut.get(o)),!r&&e.code.startsWith("Key")&&(r=pe({key:e.code.substring(3,e.code.length),modifiers:n}),r=i.get(o));let s=null;return r&&(s=this._commandsByKey.get(r),s&&s.disabled()&&(s=null),!s||s.target()&&s.target().contains(e.target)||(s=null)),s||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const n=this.getActive();if(!n||e.isDefaultPrevented())return!1;const o=n.findCommandByEvent?.(e);return!!o&&(o.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,n){const o=this._listeners,i=n?.keys,r=this._root._listenersByKey;if(i&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let s=null;if(i)for(let c=0;c<i.length;c++){const a=i[c];if(!a)continue;let u=r.get(a);u||(u=new Set,r.set(a,u)),s||(s=[]),s.push(u),u.add(e)}return o.add(e),()=>{if(s)for(let c=0;c<s.length;c++)s[c].delete(e);o.delete(e)}}_notifyCommands(e,n,o){const i=this;setTimeout(()=>{e.forEach(r=>{r[n]?.(i,o)})},0)}_notify(e,n){const o=this;setTimeout(()=>{o._listeners.forEach(i=>{i[e]?.(o,n)}),o._parent&&o._parent._notify(e,n)},0)}getAllCommands(){const e=[],n=this._groupKey;return this._commandsByKey.forEach(o=>{e.push({command:o,groupKey:n})}),this._children.forEach(o=>{e.push(...o.getAllCommands())}),e}}const zn=K.CommonUtils.getOS()===K.CommonUtils.OSType.MacOS||K.CommonUtils.getOS()===K.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Rn=K.CommonUtils.getOS()===K.CommonUtils.OSType.MacOS||K.CommonUtils.getOS()===K.CommonUtils.OSType.IOS?"⌘":"^",pe=(t,e=!1)=>{const n={};for(let i=0;t.modifiers&&i<t.modifiers.length;i++)n[t.modifiers[i]]=!0;let o="";return(n?.[W.Ctrl]||n?.[W.Meta])&&(o+=(o.length>0?"+":"")+(e?Rn:zn)),n?.[W.Alt]&&(o+=e?"⌥":"Alt"),n?.[W.Shift]&&(o+=(o.length>0?"+":"")+(e?"⇧":"Shift")),o+=(o.length>0?"+":"")+Mt(t.key),o},Me=(t,e)=>{const n=[];if(e)for(let o=0;o<e.length;o++){const i=e[o],r=i?t?.getCommand(i):null;n.push(r)}return n},dt=Rt({setClipboard:t=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>K.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[t,e]=l.useState(K.InternalClipboard.Global);return{setClipboard:n=>e(n),getClipboard:()=>t,refNativeCopy:l.useRef(null),refNativeLastKey:l.useRef(null)}});let $e=!1,An=0;var Bn=typeof document<"u"?l.useLayoutEffect:l.useEffect;const ft=()=>"sheetxl-ui-"+An++,pt=l.useId,jn=pt??function(){const[t,e]=l.useState(()=>$e?ft():void 0);return Bn(()=>{t==null&&e(ft())},[]),l.useEffect(()=>{$e||($e=!0)},[]),t},_t="Undo the last action.",mt="Repeat the last action or undo the redo.",$n=t=>`Redo ${t}`;exports.Command=De,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=Ye,exports.DefaultNotifier=Ae,exports.FocusKeyNavigation=Sn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=W,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotificationType=Fe,exports.ReactUtils=mn,exports.RoundedTab=Cn,exports.ScrollPane=Dt,exports.ScrollUtils=tn,exports.Scrollbar=ze,exports.ScrollbarOrientation=ee,exports.SimpleCommand=Le,exports.SplitPane=Ln,exports.SplitPaneResizer=kt,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.VirtualScrollbar=Pt,exports.defaultCreateScrollCorner=Tt,exports.defaultCreateScrollEdgeButton=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"rotate(90) ":"";return v.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${i?"vertical":"horizontal"} edge`,...o,children:v.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:v.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:t.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=xt,exports.defaultCreateScrollStartButton=vt,exports.defaultCreateScrollbar=Ve,exports.getDevicePixelRatio=function(t){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:n=3,round:o=!0}=t||{},i=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,o?Math.floor(i):i),n)},exports.getPortalContainer=ut,exports.toShortcutString=pe,exports.useCallbackRef=L,exports.useCommand=function(t,e=null){const n=l.useRef(e);n.current=e;const[o,i]=l.useReducer(s=>s+1,0),r=l.useMemo(()=>Array.isArray(t)?t:[t],[t]);return l.useEffect(()=>{if(!r||r.length===0)return;const s=(u,h)=>{n.current?.onChange?.(h),i()};let c=null;e&&(c={onExecute(u,h){n.current?.onExecute?.(u,h)},onError(u,h,d){n.current?.onError?.(u,h,d)}});const a=new Set;for(let u=0;u<r.length;u++)a.add(r[u]?.addPropertyListener(K.CommonUtils.debounce(s,0),!0)),e&&a.add(r[u]?.addExecuteListener(c));return()=>{a.forEach(u=>{u?.()})}},[t]),o},exports.useCommands=function(t,e=null,n=null,o){const i=l.useRef(n);i.current=n,e&&!Array.isArray(e)&&(e=[e]);const[r,s]=l.useState(Me(t,e)),c=o?[...o,t]:[t];return l.useEffect(()=>{const a={onGroupChange:()=>{const p=Me(t,e);s(p),i.current?.onChange?.(this)}};let u;e&&e.length>0&&(u={keys:e},a.onCommandChange=(p,S)=>{i.current?.onChange?.(t),s(Me(t,e))});const h=t?.addListener(a,u),d=Me(t,e);return s(d),i.current?.onChange&&i.current?.onChange(t),()=>{h?.()}},c),r},exports.useCopyPaste=t=>{const{source:e,target:n,onPaste:o,onClipboardUpdate:i,notifier:r=Ae,commands:s}=t,c=L(i,[i]),a=L(o,[o]),{getClipboard:u,refNativeCopy:h}=dt(),d=u();l.useMemo(()=>{const _=e?.element,x=n?.element??e?.element;if(!s)return;const g=[new Le("cut",_,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",shortcut:{key:"X",modifiers:[W.Ctrl]}}),new Le("copy",_,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",shortcut:{key:"C",modifiers:[W.Ctrl]}}),new Le("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",shortcut:[{key:"V",modifiers:[W.Ctrl]},{key:"F8",modifiers:[W.Ctrl]}]})];s?.addCommands(g,!0)},[s]);const p=L(async _=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(_),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(g){throw g}},[e,r]),S=L(async _=>{const x=e?.element?.();if(x){h.current={sourceElement:x,args:_};try{await p(_)}catch(g){r?.showError?.(g)}}},[e?.element,r]),C=l.useCallback(()=>{S({isCut:!0})},[]),E=L(async(_,x,g)=>{try{if(await _.doPaste(x,g)===!1)return;a?.(x,g)}catch(z){r?.showError?.(z)}},[a]),b=L(async(_,x,g)=>{const z=n?.element?.();if(z&&await K.CommonUtils.whenFocus(z),!_&&!x)return;const k=await r?.showBusy?.("Pasting...");if(x)try{return await E(n,x,g),void k?.()}catch(y){k?.(),r?.showError?.(y)}let j,H=n.importFromExternal;H||(H=(y,w)=>({getItemType:()=>"text",toText:()=>_.text,isClipboardItem:!0}));try{j=await H(_,{isCut:!1})}catch(y){k?.(),r?.showError?.(y)}if(j)try{const y=await Promise.resolve(j);await E(n,y,g),k?.()}catch(y){k?.(),r?.showError?.(y)}else k?.()},[E,n,r]),B=L(async _=>{if(n?.element)try{const x=await d.readReference();if(x)return void await b(null,x,_);const g=[];g[0]=await K.ClipboardUtils.readStringFromClipboard(d,K.MimeType.plain),g[1]=await K.ClipboardUtils.readHTMLFromClipboard(d,K.MimeType.html),g[2]=await K.ClipboardUtils.readBlobFromClipboard(d,K.MimeType.png);const z={text:g[0]??null,html:g[1]??null,image:g[2]??null};await b(z,null,_)}catch(x){if(x?.message==="Document is not focused.")return;r?.showError?.(x)}},[b,n?.element,r]);return L(async _=>{},[e?.element]),L(async _=>{},[n?.element,b,r]),l.useEffect(()=>{if(!d)return;const _=async z=>{const k=await d.readReference();c?.(k)},x=z=>{r?.showMessage?.(K.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},g=z=>{r?.showMessage?.(K.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",_),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",g),()=>{d.removeEventListener("clipboardchange",_),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",g)}},[d,r]),l.useEffect(()=>{},[p,b,e,n]),l.useEffect(()=>{s?.getCommand("cut")?.updateCallback(C).update({disabled:!e||!n}),s?.getCommand("copy")?.updateCallback(S).update({disabled:!e}),s?.getCommand("paste")?.updateCallback(B).update({disabled:!n})},[e,n,s]),{paste:B,copy:S,clipboard:d}},exports.useDevicePixelRatio=function(t){const[e,n]=l.useState(typeof window<"u"?window.devicePixelRatio:1),o=l.useRef(null);return l.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const i=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",i,{once:!0,passive:!0}),n(window.devicePixelRatio),o.current={mediaMatcher:r,listener:i}};return i(),()=>{o.current&&o.current.mediaMatcher.removeEventListener("change",o.current.listener)}},[t]),e},exports.useEditMode=()=>{const t=kn();return l.useMemo(()=>({setMode:e=>{At(n=>(typeof e=="function"&&(e=e(n)),e?.onModeChange?.(e??null),e))},getMode:()=>t}),[t])},exports.useFullscreenPortal=function(){return l.useEffect(()=>{function t(){const e=document.fullscreenElement;if(!e)return;let n=e.querySelector(".fullscreen-portal-root");n||(n=document.createElement("div"),n.className="fullscreen-portal-root _fullscreen-portal-root_5qk7s_7",e.appendChild(n))}return Se++,t(),document.addEventListener("fullscreenchange",t),()=>{document.removeEventListener("fullscreenchange",t),Se--,Se<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),Se=0)}},[]),{getPortalContainer:ut}},exports.useGlobalClipboard=dt,exports.useId=jn,exports.useImperativeElement=Ue,exports.useMouseDownAndHoldListener=function(t,e){return ht({onPointerDown:t,onPointerMoveOrWait:(n,o,i)=>{t?.(i)},...e})},exports.useOnClickOrFocusAway=function(t,e,n){const o=L(e,[e]);l.useEffect(()=>{const i=r=>{t.current&&!t.current.contains(r.target)&&o(r)};return n&&n.mouseEvents===!1||(document.addEventListener("mousedown",i),document.addEventListener("touchstart",i)),n&&n.focusEvents===!1||document.addEventListener("focus",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i),document.removeEventListener("focus",i)}},[t])},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(t,e=!0){const n=l.useRef(t);l.useEffect(()=>{if(e){const o=Object.entries(t).reduce((i,[r,s])=>(n.current[r]!==s&&(i[r]=[n.current[r],s]),i),{});Object.keys(o).length>0&&console.log("Changed props:",o)}n.current=t})},exports.useUndoManager=({manager:t,commands:e,disabled:n,notifier:o=Ae})=>{const i=L(s=>{try{t?.undo(s)}catch(c){o.showError?.(c)}},[t]),r=L(s=>{try{t?.redo(s)}catch(c){o.showError?.(c)}},[t]);return l.useMemo(()=>{if(!e)return;const s={contains:a=>!0,focus(){}},c=[new De("undo",s,{label:"Undo",description:_t,shortcut:{key:"z",modifiers:[W.Ctrl]},disabled:!0},i),new De("redo",s,{label:"Redo",description:mt,shortcut:[{key:"y",modifiers:[W.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[W.Alt]}],disabled:!0},r)];e?.addCommands(c,!0)},[e]),l.useEffect(()=>{if(!e)return;const s=()=>{const a=t?.getTopUndoDescription(),u={};var h;e.getCommand("undo").update({disabled:n||!t||!t.hasUndo(),description:a?(h=a,`Undo ${h}`):_t,state:u,context:{undoManager:t}});const d=t?.getTopRedoDescription();e.getCommand("redo").update({disabled:n||!t||!t.hasRedo(),description:d?$n(d):mt,state:u,context:{undoManager:t}})};if(s(),!t)return;const c=t.addListener({onStackChange(){s()}});return()=>c?.()},[t,e,n]),{undo:i,redo:r}};
|
|
7
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),l=require("react"),K=require("@sheetxl/utils"),Gt=require("react-dom/client"),Jt=require("react-dom"),W={Shift:"shift",Alt:"alt",Ctrl:"ctrl",Meta:"meta"},ee={Horizontal:"horizontal",Vertical:"vertical"};function gt(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=gt(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function _e(){for(var t,e,n=0,o="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=gt(t))&&(o&&(o+=" "),o+=e);return o}var Qt=function(){},yt=typeof window<"u",en=yt?l.useLayoutEffect:l.useEffect,ot={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const he=yt&&window.ResizeObserver!==void 0?function(){var t=l.useState(null),e=t[0],n=t[1],o=l.useState(ot),i=o[0],r=o[1],s=l.useMemo(function(){return new window.ResizeObserver(function(c){if(c[0]){var a=c[0].contentRect,u=a.x,h=a.y,d=a.width,p=a.height,S=a.top,C=a.left,E=a.bottom,b=a.right;r({x:u,y:h,width:d,height:p,top:S,left:C,bottom:E,right:b})}})},[]);return en(function(){if(e)return s.observe(e),function(){s.disconnect()}},[e]),[n,i]}:function(){return[Qt,ot]},L=(t,e)=>{const n=l.useCallback((...r)=>t?.(...r),e),o=l.useRef(null);o.current=n;const i=l.useCallback((...r)=>o.current?.(...r),[]);if(o.current)return i},vt=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"m 3.7274761,0.68060577 1.11969,1.93863003 1.12075,1.93912 c 0.0895,0.155 0.12152,0.33658 0.0904,0.51283 -0.0311,0.17625 -0.12336,0.33591 -0.26054,0.45091 -0.13715,0.11495 -0.31044,0.17793 -0.4894,0.17781 H 0.83095614 c -0.20186,0 -0.39542,-0.0802 -0.53814,-0.2229 -0.14272,-0.14272 -0.22291,-0.33629 -0.22291,-0.53814 -3e-4,-0.13308 0.0347,-0.26385 0.10147,-0.379 l 1.11872996,-1.94066 1.11921,-1.93864003 c 0.13594,-0.23541 0.38717,-0.38047 0.65905,-0.38047 0.27188,0 0.52311,0.14506 0.65905,0.38047 z":"m 0.75051,2.3424298 1.93863,-1.11969 1.93912,-1.12075 c 0.155,-0.0895 0.33658,-0.12152 0.51283,-0.0904 0.17625,0.0311 0.33591,0.12336 0.45091,0.26054 0.11495,0.13715 0.17793,0.31044 0.17781,0.4894 v 4.47742 c 0,0.20186 -0.0802,0.39542 -0.2229,0.53814 -0.14272,0.14272 -0.33629,0.22291 -0.53814,0.22291 -0.13308,3e-4 -0.26385,-0.0347 -0.379,-0.10147 L 2.68911,4.7797998 0.75047,3.6605898 C 0.51506,3.5246498 0.37,3.2734198 0.37,3.0015398 c 0,-0.27188 0.14506,-0.52311 0.38047,-0.65905 z";return v.jsx("div",{style:{paddingBottom:"0px",paddingRight:"0px",paddingLeft:i?"0px":"3px",paddingTop:i?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${i?"vertical":"horizontal"} single-button start`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},xt=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"M 2.412334,5.319396 1.292644,3.3807659 0.17189405,1.4416459 c -0.0895,-0.155 -0.12152,-0.33658 -0.0904,-0.51282998 0.0311,-0.17625 0.12336,-0.33591 0.26054,-0.45091 0.13715,-0.11495 0.31044,-0.17793 0.4894,-0.17781 H 5.308854 c 0.20186,0 0.39542,0.0802 0.53814,0.2229 0.14272,0.14272 0.22291,0.33629 0.22291,0.53813998 3e-4,0.13308 -0.0347,0.26385 -0.10147,0.379 l -1.11873,1.94066 -1.11921,1.9386401 c -0.13594,0.23541 -0.38717,0.38047 -0.65905,0.38047 -0.27188,0 -0.52311,-0.14506 -0.65905,-0.38047 z":"m 5.3893002,3.6575719 -1.9386301,1.11969 -1.93912,1.12075 c -0.155,0.0895 -0.33658,0.12152 -0.51282997,0.0904 -0.17625,-0.0311 -0.33591,-0.12336 -0.45091,-0.26054 -0.11495,-0.13715 -0.17793,-0.31044 -0.17781,-0.4894 V 0.76105195 c 0,-0.20186 0.0802,-0.39542 0.2229,-0.53814 C 0.73562013,0.08019195 0.92919013,1.9467784e-6 1.1310401,1.9467784e-6 1.2641201,-2.9805322e-4 1.3948901,0.03470195 1.5100401,0.10147195 l 1.94066,1.11872995 1.9386401,1.11921 c 0.23541,0.13594 0.38047,0.38717 0.38047,0.65905 0,0.27188 -0.14506,0.52311 -0.38047,0.65905 z";return v.jsx("div",{style:{paddingLeft:"0px",paddingTop:"0px",paddingRight:i?"0px":"3px",paddingBottom:i?"3px":"0px",display:"flex",alignItems:"center",justifyContent:"center",...e},...o,children:v.jsx("button",{style:{padding:"0",display:"flex",alignItems:"center",justifyContent:"center",border:"none"},className:`scrollbar-button ${i?"vertical":"horizontal"} single-button end`,children:v.jsx("svg",{width:"9",height:"9",viewBox:"0 0 6 6",style:{opacity:"inherit"},children:v.jsx("path",{d:r})})})})},Oe=(t,e,n,o,i=0)=>{for(let r=0;r<n.length;r++){const s=n[r].getBoundingClientRect();let c=s.left-e,a=c+s.width;if(o){if(c<t&&a>=t)return c}else if(Math.ceil(a)>Math.ceil(t)+2)return a}return i},tn=Object.freeze(Object.defineProperty({__proto__:null,getScrollTo:Oe},Symbol.toStringTag,{value:"Module"})),nn="_sheetxl-scrollbar_eblx4_6",ze=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,totalSize:o=0,viewportSize:i=0,style:r,className:s,orientation:c=ee.Vertical,onScrollOffset:a,onScroll:u,showCustomScrollButtons:h=!1,scrollButtonIncrement:d=200,scrollButtonInitialRepeatDelay:p=260,scrollButtonAdditionalRepeatDelay:S=120,createScrollStartButton:C=vt,createScrollEndButton:E=xt,...b}=t,B=L(u,[u]),_=l.useRef(null),[x,{width:g,height:z}]=he(),[k,{width:j,height:H}]=he(),y=c===ee.Vertical,w=y?"top":"left",R=y?"scrollTop":"scrollLeft",f=y?z:g,M=y?H:j,[m,T]=l.useState(null);l.useEffect(()=>{m!==null&&_.current&&_.current.scrollTo({behavior:"smooth",[w]:m})},[m,y]);const P=l.useCallback(($,ne=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),oe=te.children,re=ne?0:Oe($,ce[w],oe,!0,Math.max(0,$-d));return T(re),Math.max(0,re)},[]),X=l.useCallback(($,ne=!1)=>{if(!_.current)return 0;const te=_.current.querySelector(".scrollbar-viewport"),ce=te.getBoundingClientRect(),oe=te.children,re=Math.ceil(M-f),ye=ne?re:Oe($,ce[w],oe,!1,Math.max(0,$+d));return T(ye),Math.min(re,ye)},[M,f]),F=l.useRef(null),I=l.useCallback($=>{F.current=n;const ne=$.target[R];a(ne,i,o),B?.($)},[a,i,o,n]);l.useEffect(()=>{const $=F.current;F.current=null,n!==$&&(_.current[R]=n)},[n,R]);const N=l.useRef(null),A=l.useRef(null),V=l.useCallback(()=>{N.current&&(clearTimeout(N.current),N.current=null,A.current=null)},[]),U=l.useCallback(($,ne,te,ce=p)=>{A.current=$,N.current=setTimeout(()=>{const oe=te?P(A.current||$):X(A.current||$);oe!==A.current?U(oe,!1,te,S):V()},ne?0:ce)},[P,X,V]);l.useEffect(()=>()=>V(),[V]);const J=n,de=l.useMemo(()=>{if(!h)return null;const $={orientation:c,disabled:Math.floor(J)<=0||Math.floor(M-f)===0,onMouseUp:V,onMouseLeave:V,onMouseDown:()=>U(J,!0,!0)};return C?.($)},[h,c,J,m,M,f]),fe=l.useMemo(()=>{if(!h)return null;const $={orientation:c,disabled:Math.floor(M-f)<=Math.ceil(J),onMouseUp:V,onMouseLeave:V,onMouseDown:()=>U(J,!0,!1)};return E?.($)},[h,c,J,m,M,f]);return v.jsxs("div",{ref:e,style:{display:"flex",flex:"1",flexDirection:y?"column":"row",padding:"0",...r},className:_e(nn,s),...b,children:[de,v.jsx("div",{className:"pseudo-scrollbar",style:{flex:"1 1 100%",display:"flex",boxSizing:"content-box",flexDirection:y?"column":"row",justifyContent:"center",alignItems:"center"},ref:x,children:v.jsx("div",{tabIndex:-1,style:{flex:"1 1 100%",overflowY:y?"scroll":"hidden",overflowX:y?"hidden":"scroll",position:"relative",willChange:"transform"},onScroll:I,ref:_,children:v.jsx("div",{ref:k,style:{position:"absolute",height:y?o-i+(z??0):1,width:y?1:o-i+(g??0)},className:"scrollbar-viewport"})})}),fe]})}));ze.displayName="Scrollbar";let it=Date.now,rt=1e3,ae={},on=1;const ve=t=>{let e=ae[t]!==null;return e&&(ae[t]=null),e},st=(t,e,n,o=0,i)=>{let r=it(),s=r,c=0,a=0,u=on++;if(u%20==0){const d={};for(let p in ae)d[p]=!0;ae=d}const h=function(d){const p=d!==!0,S=it();if(!ae[u]||e&&!e(u))return ae[u]=null,void n(60-a/((S-r)/rt),u,!1);if(p){const E=Math.round((S-s)/16.666666666666668)-1;for(let b=0;b<Math.min(E,4);b++)h(!0),a++}o&&(c=(S-r)/o,c>1&&(c=1));const C=i?i(c):c;t(C,S,p)!==!1&&c!==1||!p?p&&(s=S,requestAnimationFrame(h)):(ae[u]=null,n(60-a/((S-r)/rt),u,c===1||o===void 0))};return ae[u]=!0,requestAnimationFrame(h),u};var rn=function(){},sn=function(t){return Math.pow(t-1,3)+1},ln=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},bt=function(t,e){for(var n in this.__callback=t,this.options={scrollingX:!0,scrollingY:!0,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:rn,penetrationDeceleration:.03,penetrationAcceleration:.08},e)this.options[n]=e[n]};bt.prototype={__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,setDimensions:function(t,e,n,o){t!==null&&(this.__clientWidth=t),e!==null&&(this.__clientHeight=e),n!==null&&(this.__contentWidth=n),o!==null&&(this.__contentHeight=o),this.__computeScrollMax(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0)},setPosition:function(t,e){this.__clientLeft=t||0,this.__clientTop=e||0},setSnapSize:function(t,e){this.__snapWidth=t,this.__snapHeight=e},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,right:this.__scrollLeft+this.__clientWidth/this.__zoomLevel,bottom:this.__scrollTop+this.__clientHeight/this.__zoomLevel,zoom:this.__zoomLevel}},getPoint:function(t,e){var n=this.getValues();return{left:t/n.zoom,top:e/n.zoom}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(t,e,n,o,i){if(!this.options.zooming)throw new Error("Zooming is not enabled!");i&&(this.__zoomComplete=i),this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1);var r=this.__zoomLevel;n===void 0&&(n=this.__clientWidth/2),o===void 0&&(o=this.__clientHeight/2),t=Math.max(Math.min(t,this.options.maxZoom),this.options.minZoom),this.__computeScrollMax(t);var s=t/r,c=s*(this.__scrollLeft+n)-n,a=s*(this.__scrollTop+o)-o;c>this.__maxScrollLeft?c=this.__maxScrollLeft:c<0&&(c=0),a>this.__maxScrollTop?a=this.__maxScrollTop:a<0&&(a=0),this.__publish(c,a,t,e)},zoomBy:function(t,e,n,o,i){this.zoomTo(this.__zoomLevel*t,e,n,o,i)},scrollTo:function(t,e,n,o){if(this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1),o!==void 0&&o!==this.__zoomLevel){if(!this.options.zooming)throw new Error("Zooming is not enabled!");t*=o,e*=o,this.__computeScrollMax(o)}else o=this.__zoomLevel;this.options.scrollingX?this.options.paging?t=Math.round(t/this.__clientWidth)*this.__clientWidth:this.options.snapping&&(t=Math.round(t/this.__snapWidth)*this.__snapWidth):t=this.__scrollLeft,this.options.scrollingY?this.options.paging?e=Math.round(e/this.__clientHeight)*this.__clientHeight:this.options.snapping&&(e=Math.round(e/this.__snapHeight)*this.__snapHeight):e=this.__scrollTop,t=Math.max(Math.min(this.__maxScrollLeft,t),0),e=Math.max(Math.min(this.__maxScrollTop,e),0),t===this.__scrollLeft&&e===this.__scrollTop&&(n=!1),this.__publish(t,e,o,n)},scrollBy:function(t,e,n){var o=this.__isAnimating?this.__scheduledLeft:this.__scrollLeft,i=this.__isAnimating?this.__scheduledTop:this.__scrollTop;this.scrollTo(o+(t||0),i+(e||0),n)},doMouseZoom:function(t,e,n,o){var i=t>0?.97:1.03;return this.zoomTo(this.__zoomLevel*i,!1,n-this.__clientLeft,o-this.__clientTop)},doTouchStart:function(t,e){if(t.length===void 0)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);var n,o;this.__interruptedAnimation=!0,this.__isDecelerating&&(ve(this.__isDecelerating),this.__isDecelerating=!1,this.__interruptedAnimation=!0),this.__isAnimating&&(ve(this.__isAnimating),this.__isAnimating=!1,this.__interruptedAnimation=!0);var i=t.length===1;i?(n=t[0].pageX,o=t[0].pageY):(n=Math.abs(t[0].pageX+t[1].pageX)/2,o=Math.abs(t[0].pageY+t[1].pageY)/2),this.__initialTouchLeft=n,this.__initialTouchTop=o,this.__zoomLevelStart=this.__zoomLevel,this.__lastTouchLeft=n,this.__lastTouchTop=o,this.__lastTouchMove=e,this.__lastScale=1,this.__enableScrollX=!i&&this.options.scrollingX,this.__enableScrollY=!i&&this.options.scrollingY,this.__isTracking=!0,this.__didDecelerationComplete=!1,this.__isDragging=!i,this.__isSingleTouch=i,this.__positions=[]},doTouchMove:function(t,e,n){if(t.length===void 0)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),typeof e!="number")throw new Error("Invalid timestamp value: "+e);if(this.__isTracking){var o,i;t.length===2?(o=Math.abs(t[0].pageX+t[1].pageX)/2,i=Math.abs(t[0].pageY+t[1].pageY)/2):(o=t[0].pageX,i=t[0].pageY);var r=this.__positions;if(this.__isDragging){var s=o-this.__lastTouchLeft,c=i-this.__lastTouchTop,a=this.__scrollLeft,u=this.__scrollTop,h=this.__zoomLevel;if(n!==void 0&&this.options.zooming){var d=h;if(h=h/this.__lastScale*n,d!==(h=Math.max(Math.min(h,this.options.maxZoom),this.options.minZoom))){var p=o-this.__clientLeft,S=i-this.__clientTop;a=(p+a)*h/d-p,u=(S+u)*h/d-S,this.__computeScrollMax(h)}}if(this.__enableScrollX){a-=s*this.options.speedMultiplier;var C=this.__maxScrollLeft;(a>C||a<0)&&(this.options.bouncing?a+=s/2*this.options.speedMultiplier:a=a>C?C:0)}if(this.__enableScrollY){u-=c*this.options.speedMultiplier;var E=this.__maxScrollTop;(u>E||u<0)&&(this.options.bouncing?u+=c/2*this.options.speedMultiplier:u=u>E?E:0)}r.length>60&&r.splice(0,30),r.push(a,u,e),this.__publish(a,u,h)}else{var b=this.options.locking?3:0,B=Math.abs(o-this.__initialTouchLeft),_=Math.abs(i-this.__initialTouchTop);this.__enableScrollX=this.options.scrollingX&&B>=b,this.__enableScrollY=this.options.scrollingY&&_>=b,r.push(this.__scrollLeft,this.__scrollTop,e),this.__isDragging=(this.__enableScrollX||this.__enableScrollY)&&(B>=5||_>=5),this.__isDragging&&(this.__interruptedAnimation=!1)}this.__lastTouchLeft=o,this.__lastTouchTop=i,this.__lastTouchMove=e,this.__lastScale=n}},doTouchEnd:function(t){if(t instanceof Date&&(t=t.valueOf()),typeof t!="number")throw new Error("Invalid timestamp value: "+t);if(this.__isTracking){if(this.__isTracking=!1,this.__isDragging)if(this.__isDragging=!1,this.__isSingleTouch&&this.options.animating&&t-this.__lastTouchMove<=100){for(var e=this.__positions,n=e.length-1,o=n,i=n;i>0&&e[i]>this.__lastTouchMove-100;i-=3)o=i;if(o!==n){var r=e[n]-e[o],s=this.__scrollLeft-e[o-2],c=this.__scrollTop-e[o-1];this.__decelerationVelocityX=s/r*(1e3/60),this.__decelerationVelocityY=c/r*(1e3/60);var a=this.options.paging||this.options.snapping?4:1;(Math.abs(this.__decelerationVelocityX)>a||Math.abs(this.__decelerationVelocityY)>a)&&this.__startDeceleration(t)}else this.options.scrollingComplete()}else t-this.__lastTouchMove>100&&this.options.scrollingComplete();this.__isDecelerating||((this.__interruptedAnimation||this.__isDragging)&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,!0,this.__zoomLevel)),this.__positions.length=0}},__publish:function(t,e,n,o){var i=this.__isAnimating;if(i&&(ve(i),this.__isAnimating=!1),o&&this.options.animating){this.__scheduledLeft=t,this.__scheduledTop=e,this.__scheduledZoom=n;var r=this.__scrollLeft,s=this.__scrollTop,c=this.__zoomLevel,a=t-r,u=e-s,h=n-c,d=function(C,E,b){b&&(this.__scrollLeft=r+a*C,this.__scrollTop=s+u*C,this.__zoomLevel=c+h*C,this.__callback&&this.__callback(this.__scrollLeft,this.__scrollTop,this.__zoomLevel))}.bind(this),p=function(C){return this.__isAnimating===C}.bind(this),S=function(C,E,b){E===this.__isAnimating&&(this.__isAnimating=!1),(this.__didDecelerationComplete||b)&&this.options.scrollingComplete(),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))}.bind(this);this.__isAnimating=st(d,p,S,this.options.animationDuration,i?sn:ln)}else this.__scheduledLeft=this.__scrollLeft=t,this.__scheduledTop=this.__scrollTop=e,this.__scheduledZoom=this.__zoomLevel=n,this.__callback&&this.__callback(t,e,n),this.options.zooming&&(this.__computeScrollMax(),this.__zoomComplete&&(this.__zoomComplete(),this.__zoomComplete=null))},__computeScrollMax:function(t){t===void 0&&(t=this.__zoomLevel),this.__maxScrollLeft=Math.max(this.__contentWidth*t-this.__clientWidth,0),this.__maxScrollTop=Math.max(this.__contentHeight*t-this.__clientHeight,0)},__startDeceleration:function(t){if(this.options.paging){var e=Math.max(Math.min(this.__scrollLeft,this.__maxScrollLeft),0),n=Math.max(Math.min(this.__scrollTop,this.__maxScrollTop),0),o=this.__clientWidth,i=this.__clientHeight;this.__minDecelerationScrollLeft=Math.floor(e/o)*o,this.__minDecelerationScrollTop=Math.floor(n/i)*i,this.__maxDecelerationScrollLeft=Math.ceil(e/o)*o,this.__maxDecelerationScrollTop=Math.ceil(n/i)*i}else this.__minDecelerationScrollLeft=0,this.__minDecelerationScrollTop=0,this.__maxDecelerationScrollLeft=this.__maxScrollLeft,this.__maxDecelerationScrollTop=this.__maxScrollTop;var r=function(u,h,d){this.__stepThroughDeceleration(d)}.bind(this),s=this.options.snapping?4:.1,c=function(){var u=Math.abs(this.__decelerationVelocityX)>=s||Math.abs(this.__decelerationVelocityY)>=s;return u||(this.__didDecelerationComplete=!0),u}.bind(this),a=function(u,h,d){this.__isDecelerating=!1,this.__didDecelerationComplete&&this.options.scrollingComplete(),this.scrollTo(this.__scrollLeft,this.__scrollTop,this.options.snapping)}.bind(this);this.__isDecelerating=st(r,c,a)},__stepThroughDeceleration:function(t){var e=this.__scrollLeft+this.__decelerationVelocityX,n=this.__scrollTop+this.__decelerationVelocityY;if(!this.options.bouncing){var o=Math.max(Math.min(this.__maxDecelerationScrollLeft,e),this.__minDecelerationScrollLeft);o!==e&&(e=o,this.__decelerationVelocityX=0);var i=Math.max(Math.min(this.__maxDecelerationScrollTop,n),this.__minDecelerationScrollTop);i!==n&&(n=i,this.__decelerationVelocityY=0)}if(t?this.__publish(e,n,this.__zoomLevel):(this.__scrollLeft=e,this.__scrollTop=n),!this.options.paging&&(this.__decelerationVelocityX*=.95,this.__decelerationVelocityY*=.95),this.options.bouncing){var r=0,s=0,c=this.options.penetrationDeceleration,a=this.options.penetrationAcceleration;e<this.__minDecelerationScrollLeft?r=this.__minDecelerationScrollLeft-e:e>this.__maxDecelerationScrollLeft&&(r=this.__maxDecelerationScrollLeft-e),n<this.__minDecelerationScrollTop?s=this.__minDecelerationScrollTop-n:n>this.__maxDecelerationScrollTop&&(s=this.__maxDecelerationScrollTop-n),r!==0&&(r*this.__decelerationVelocityX<=0?this.__decelerationVelocityX+=r*c:this.__decelerationVelocityX=r*a),s!==0&&(s*this.__decelerationVelocityY<=0?this.__decelerationVelocityY+=s*c:this.__decelerationVelocityY=s*a)}}};var Z=typeof window<"u"?window:{screen:{},navigator:{}},ge=(Z.matchMedia||function(){return{matches:!1}}).bind(Z),wt=!1,an={get passive(){return wt=!0}},lt=function(){};Z.addEventListener&&Z.addEventListener("p",lt,an),Z.removeEventListener&&Z.removeEventListener("p",lt,!1);var cn=wt,un="PointerEvent"in Z,We="ontouchstart"in Z,St=We||"TouchEvent"in Z&&ge("(any-pointer: coarse)").matches,at=(Z.navigator.maxTouchPoints||0)>0||St,Ct=Z.navigator.userAgent||"",hn=ge("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Ct)&&Math.min(Z.screen.width||0,Z.screen.height||0)>=768,Et=(ge("(pointer: coarse)").matches||!ge("(pointer: fine)").matches&&We)&&!/Windows.*Firefox/.test(Ct),dn=ge("(any-pointer: fine)").matches||ge("(any-hover: hover)").matches||hn||!We,Ke=!at||!dn&&Et?at?"touchOnly":"mouseOnly":"hybrid",fn=Ke==="mouseOnly"?"mouse":Ke==="touchOnly"||Et?"touch":"mouse";const pn=Object.freeze(Object.defineProperty({__proto__:null,deviceType:Ke,primaryInput:fn,supportsPassiveEvents:cn,supportsPointerEvents:un,supportsTouchEvents:St},Symbol.toStringTag,{value:"Module"})),_n=new Set(["INPUT","TEXTAREA","SELECT"]),Lt={};function He(){return pn}const Mt=t=>t==="BracketLeft"?"[":t==="BracketRight"?"]":K.CommonUtils.camelToPrettyCase(t),mn=Object.freeze(Object.defineProperty({__proto__:null,EmptyCssProperties:Lt,boundPixel:function(t,e=!1,n=0){return t},createSyntheticEvent:t=>{let e=!1,n=!1;return{nativeEvent:t,currentTarget:t.currentTarget,target:t.target,bubbles:t.bubbles,cancelable:t.cancelable,defaultPrevented:t.defaultPrevented,eventPhase:t.eventPhase,isTrusted:t.isTrusted,preventDefault:()=>{e=!0,t.preventDefault()},isDefaultPrevented:()=>e,stopPropagation:()=>{n=!0,t.stopPropagation()},isPropagationStopped:()=>n,persist:()=>{},timeStamp:t.timeStamp,type:t.type}},detectIt:He,focusableNodeNames:_n,toPrettyKeyCode:Mt},Symbol.toStringTag,{value:"Module"})),gn=[];function Ue(t,e,n=gn){const o=l.useRef(null);return l.useImperativeHandle(t,()=>{if(!o.current)return;const i=o.current,r=e?.();if(!r||typeof r!="object")throw new Error("attributes must return a plain object of values");const s=Object.keys(r),c=s.length;for(let a=0;a<c;a++){const u=s[a],h=r[u];Object.defineProperty(i,u,{value:h,writable:!0,configurable:!0,enumerable:!0})}return i},n),o}const Ve=t=>v.jsx(ze,{...t}),Tt=({width:t,height:e})=>v.jsx("div",{className:"corner",style:{minWidth:`${t}px`,width:`${t}px`,minHeight:`${e}px`,height:`${e}px`}}),Dt=l.memo(l.forwardRef((t,e)=>{const{children:n,viewport:o,onScrollViewport:i,showHorizontalScrollbar:r=!0,showVerticalScrollbar:s=!0,createScrollCorner:c=Tt,createHorizontalScrollbar:a=Ve,createVerticalScrollbar:u=Ve,style:h,touchElement:d,disableTouch:p,...S}=t,C=L(i,[i]),E=Ue(e,()=>({isScrollPane:()=>!0}),[]),b=l.useRef(null);l.useEffect(()=>{b.current&&(b.current.__scrollTop===o?.top&&b.current.__scrollLeft!==!o?.left||b.current?.scrollTo(o?.left,o?.top,!1))},[o?.left,o?.top,d]);const B=l.useCallback((f,M)=>{C?.({left:f,top:M})},[]),_=l.useCallback(f=>{b.current?.doTouchStart(f.touches,f.timeStamp)},[]),x=l.useCallback(f=>{f.preventDefault(),b.current?.doTouchMove(f.touches,f.timeStamp)},[]),g=l.useCallback(f=>{b.current?.doTouchEnd(f.timeStamp)},[]),z=l.useCallback(({containerWidth:f,containerHeight:M,totalWidth:m,totalHeight:T})=>{b.current.setDimensions(f,M,m,T)},[]);l.useEffect(()=>{const f=d??E.current;if(!p&&He().supportsTouchEvents&&f&&o){if(!b.current){const M={scrollingX:!0,scrollingY:!0,decelerationRate:.95,penetrationAcceleration:.08};b.current=new bt(B,M)}He().supportsTouchEvents&&(f.addEventListener("touchstart",_),f.addEventListener("touchend",g),f.addEventListener("touchmove",x)),z({containerWidth:o?.width,containerHeight:o?.height,totalWidth:o?.totalWidth,totalHeight:o?.totalHeight})}return()=>{f?.removeEventListener("touchstart",_),f?.removeEventListener("touchend",g),f?.removeEventListener("touchmove",x)}},[o?.width,o?.height,o?.totalWidth,o?.totalHeight,p,d]);const[k,{width:j}]=he(),[H,{height:y}]=he(),w=l.useMemo(()=>{const f=u({orientation:ee.Vertical,offset:o?.top,viewportSize:o?.height,totalSize:o?.totalHeight,onScrollOffset:M=>{C?.({top:M})}});return v.jsx("div",{style:{display:"flex",flex:"0"},ref:k,children:f})},[u,o?.top,o?.height,o?.totalHeight]),R=l.useMemo(()=>{const f=a({orientation:ee.Horizontal,offset:o?.left,viewportSize:o?.width,totalSize:o?.totalWidth,onScrollOffset:M=>C?.({left:M})});return v.jsxs("div",{style:{display:"flex",flex:"none",flexDirection:"row",alignItems:"stretch",justifyContent:"center"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",flexDirection:"column",width:`calc(100% - ${j}px)`},children:v.jsx("div",{ref:H,className:"sizer",children:f})}),s?c({width:j,height:y}):v.jsx(v.Fragment,{})]})},[a,o?.left,o?.width,o?.totalWidth,s,c,j,y]);return v.jsx("div",{style:{position:"relative",display:"flex",minWidth:s?`${j}px`:void 0,minHeight:r?`${y}px`:void 0,...h},...S,ref:E,children:v.jsxs("div",{style:{position:"relative",width:"100%",flex:"1 1 100%",display:"flex",flexDirection:"column",boxSizing:"border-box"},children:[v.jsxs("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:[v.jsx("div",{style:{display:"flex",flex:"1 1 100%",overflow:"hidden"},children:n}),s?w:v.jsx(v.Fragment,{})]}),r?R:v.jsx(v.Fragment,{})]})})}));Dt.displayName="ScrollPane";const Fe={Default:"default",Error:"error",Success:"success",Warning:"warning",Info:"info"},ct=new Set,Ae={showMessage:(t,e)=>{if(e?.onceKey){if(ct.has(e.onceKey))return;ct.add(e.onceKey)}let n=console.log;e?.type!==Fe.Warning&&e?.type!==Fe.Error||(n=console.warn),n(t)},showBusy:(t,e)=>new Promise(n=>{n(()=>{})}),showError:t=>{console.error(t)}},ut=()=>{const t=document.fullscreenElement;return t?t.querySelector(".fullscreen-portal-root")||t:document.body};let Se=0;const yn=100,vn=100,xn=1e6,bn=100,wn=50,Pt=l.memo(l.forwardRef((t,e)=>{const{offset:n=0,viewportSize:o=0,totalSize:i=0,minSize:r=0,endGap:s=yn,endScrollIncrement:c=vn,style:a=Lt,onMouseDown:u,onScrollOffset:h,onScroll:d,scaleLimit:p=xn,scaleFactor:S=bn,precisionFactor:C=wn,...E}=t;d&&console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");const b=L(u,[u]),B=()=>({offset:n,totalSize:p===0?i:Math.min(i??0,Math.max(r??0,(n??0)+(o??0))+(s??0))}),[_,x]=l.useState(B),g=p!==0&&_.totalSize>p?S:1,z=g/C,k=Math.ceil(_.totalSize/g),j=Math.ceil(_.offset/g),H=Math.ceil(o/g),y=l.useCallback(P=>{},[]),[w,R]=l.useState(!1),f=l.useRef(null);l.useLayoutEffect(()=>{if(!w){f.current={propTotalSize:i,propViewportSize:o,propOffset:n};const P=B();x(P)}},[i,o,n,w,r,s,c]);const M=L((P,X,F)=>{const I=f.current;f.current=null,I&&I.propTotalSize===i&&I.propViewportSize===o&&I.propOffset===n||(Math.abs(P-j)<z&&(P=j),h?.(P*g,j,H))},[h,g,z,j,H]),m=l.useCallback(P=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",m),R(!1)},[]),T=l.useCallback(P=>{b?.(P),R(!0),document.addEventListener("mousemove",y,{passive:!0}),document.addEventListener("mouseup",m,{passive:!0})},[y,m]);return v.jsx(ze,{ref:e,style:{...a},...E,offset:j,totalSize:k,viewportSize:H,onMouseDown:T,onScrollOffset:M})}));Pt.displayName="VirtualScrollbar";function Be(t,e){if(typeof t=="function")return t(e);t&&(t.current=e)}var Pe=parseInt(l.version.split(".")[0],10)>=19?function(t){return e=>{const n=[];for(const o of t){const i=Be(o,e),r=typeof i=="function";n.push(r?i:()=>Be(o,null))}return()=>{for(const o of n)o()}}}:function(t){return e=>{for(const n of t)Be(n,e)}};const Sn=l.memo(l.forwardRef((t,e)=>{const{refFocusStart:n,...o}=t,i=l.useRef(null),r=l.useCallback(()=>{if(n)return void n?.current?.focus();const s=i.current.parentElement.children;let c=[];for(let a=0;a<s.length&&s[a]!==i.current;a++){const u=s[a].getAttribute("tabindex");if(u==null||u==="-1"||s[a].getAttribute("disabled")==="true")continue;const h=s[a];h.focus&&c.push({tabindex:parseInt(u),child:h})}c.length!==0&&(c.sort(function(a,u){return a.tabindex-u.tabindex}),c[0].child.focus())},[n]);return v.jsx("div",{tabIndex:0,ref:Pe([i,e]),onFocus:r,...o})})),Cn=l.memo(l.forwardRef((t,e)=>{const{className:n,style:o,children:i,radius:r=4,strokeWidth:s=1,strokeColor:c="grey",...a}=t,[u,{width:h,height:d}]=he(),p=l.useRef(null),S=(B,_=0)=>{const x=B/2,g=d-x+_;return function(z,k,j=!1){if(k===0)return z;function H(m,T,P){let X=T.x-m.x,F=T.y-m.y,I=Math.sqrt(X*X+F*F);return y(m,T,Math.min(1,P/I))}function y(m,T,P){return{x:m.x+(T.x-m.x)*P,y:m.y+(T.y-m.y)*P}}function w(m,T){m.length>2&&(m[m.length-2]=T.x,m[m.length-1]=T.y)}function R(m){return{x:parseFloat(m[m.length-2]),y:parseFloat(m[m.length-1])}}let f=z.split(/[,\s]/).reduce(function(m,T){let P=T.match("([a-zA-Z])(.+)");return P?(m.push(P[1]),m.push(P[2])):m.push(T),m},[]).reduce(function(m,T){return parseFloat(T)==T&&m.length?m[m.length-1].push(T):m.push([T]),m},[]),M=[];if(f.length>1){let m=R(f[0]),T=null;f[f.length-1][0]==="Z"&&f[0].length>2&&(T=["L",m.x,m.y],f[f.length-1]=T),M.push(f[0]);for(let P=1;P<f.length;P++){let X=M[M.length-1],F=f[P],I=F===T?f[1]:f[P+1];if(I&&X&&X.length>2&&F[0]==="L"&&I.length>2&&I[0]==="L"){let N,A,V=R(X),U=R(F),J=R(I);j?(N=y(U,X.origPoint||V,k),A=y(U,I.origPoint||J,k)):(N=H(U,V,k),A=H(U,J,k)),w(F,N),F.origPoint=U,M.push(F);let de=y(N,U,.5),fe=y(U,A,.5),$=["C",de.x,de.y,fe.x,fe.y,A.x,A.y];$.origPoint=U,M.push($)}else M.push(F)}if(T){let P=R(M[M.length-1]);M.push(["Z"]),w(M[0],P)}}else M=f;return M.reduce(function(m,T){return m+T.join(" ")+" "},"")}(`${`M 0 ${x} L ${r-.5} ${x} L ${r-.5} ${g} L ${2*r} ${g}`} ${`L ${h-2*r} ${g}`} ${`M ${h-2*r} ${g} L ${h-r} ${g} L ${h-r} ${x} L ${h} ${x}`}`,r)},C=l.useMemo(()=>S(s),[h,d,r,s]),E=l.useMemo(()=>{if(r===0)return;const B=r/2;return S(r)+`L ${h} 0 L 0 0 L 0 ${B}`},[C,r,s]),b=l.useMemo(()=>({style:{clipPath:`path('${E}')`}}),[E]);return v.jsxs("div",{className:n,style:{display:"flex",flexDirection:"row",...o},...a,ref:Pe([p,u,e]),children:[l.isValidElement(i)?l.cloneElement(i,b):v.jsx(v.Fragment,{}),v.jsx("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},width:h,height:d,viewBox:`0 0 ${h} ${d}`,children:v.jsx("path",{d:C,stroke:c,fill:"none",vectorEffect:"non-scaling-stroke",strokeWidth:s})})]})})),En={},kt=t=>{const{onPointerDown:e,style:n,splitDirection:o,paddingBefore:i=0,paddingAfter:r=0,disabled:s,key:c,hitAreaProps:a=En,...u}=t,h=o==="row",{style:d,className:p,...S}=a;return v.jsx("div",{style:{...n,position:"relative"},...u,children:v.jsx("div",{className:_e("hit-box",p),style:{left:(h?-i:0)+"px",width:`calc(100% + ${h?i+r:0}px)`,top:(h?0:-i)+"px",height:`calc(100% + ${h?0:i+r}px)`,position:"absolute",...d},onPointerDown:s?void 0:e,...S})},c)},Ce={},ue=(t,e,n=!0)=>t===null?null:t.pixels!==null?n?t.pixels:e-t.pixels:(n?t.percent:100-t.percent)/100*e,Ee=(t,e=!0)=>t?.percent?`${e?t.percent:100-t.percent}%`:t?.pixels?`${t.pixels}px`:void 0,le=(t,e)=>{if(t==null)return null;const n={percent:null,pixels:null};let o=e;return typeof t=="string"&&((t=t.trim().toLowerCase()).endsWith("px")?(t=t.substring(0,t.length-2),o=!1):t.endsWith("%")&&(t=t.substring(0,t.length-1),o=!0),t=parseFloat(t)),o?n.percent=t:n.pixels=t,Object.freeze(n)},Ln=l.memo(l.forwardRef((t,e)=>{const{elementBefore:n,elementAfter:o,splitDirection:i="row",fixedPane:r=null,position:s,onPositionChange:c,minBefore:a,maxBefore:u,minAfter:h,maxAfter:d,children:p,className:S,style:C,disabled:E=!1,onDragStart:b,onDragResize:B,onDragFinish:_,resizerProps:x=Ce,paneProps:g=Ce,paneBeforeProps:z=Ce,paneAfterProps:k=Ce,createResizer:j=kt}=t;if(p)throw new Error("Use elementBefore and elementAfter instead of children.");const H=l.useMemo(()=>l.isValidElement(o)&&l.isValidElement(n),[o,n]),y=l.useMemo(()=>{let D=null;r&&(r==="before"?D=0:r==="after"&&(D=1));const O=D===null;return{fixedPaneOffset:D,isPercent:O,minBefore:le(a,O),maxBefore:le(u,O),minAfter:le(h,O),maxAfter:le(d,O)}},[a,u,h,d]),w=L(c,[c]),[R,f]=l.useState(()=>le(s,r===null));l.useEffect(()=>{f(le(s,r===null))},[s,r]);const[M,{width:m,height:T}]=he(),[P,{width:X,height:F}]=he(),I=i==="row"?X:F,N=i==="row"?m:T,A=l.useMemo(()=>((D,O,q,Y)=>{const ie=[null,null],Q=[null,null];if(D||(D={percent:Y.fixedPaneOffset===null?50:null,pixels:Y.fixedPaneOffset===null?null:0}),O===0)return D?.pixels!=null?Y.fixedPaneOffset!==1?(ie[0]=D?.pixels,Q[1]=100):(ie[1]=D?.pixels-q,Q[0]=100):D?.percent!=null&&(Y.fixedPaneOffset!==1?(Q[0]=D?.percent,Q[1]=100-D?.percent):(Q[1]=D?.percent,Q[0]=100-D?.percent)),{percents:Q,pixels:ie,minBefore:Ee(Y.minBefore,!0),maxBefore:Ee(Y.maxBefore,!0),minAfter:Ee(Y.minAfter),maxAfter:Ee(Y.maxAfter)};let se=ue(D,O,Y.fixedPaneOffset!==1),G=O-q,et=ue(Y.minBefore,G,!0)??0,qt=ue(Y.maxBefore,G,!0)??G,we=0,Re=0,tt=0,nt=G;we=(ue(Y.maxAfter,O,!1)??q)-q,Re=ue(Y.minAfter,O,!1)??O,tt=Math.max(et,we),nt=Math.min(qt,Re),se=Math.max(tt,Math.min(se,nt)),Re=Math.min(G-se,ue(Y.maxAfter,G-se,!0)??G),we=Math.min(G-se,ue(Y.minAfter,G-se,!0)??G),ie[0]=se,ie[1]=G-ie[0];const Zt=Math.max(0,Math.min(100,se/G*100));return Q[0]=Zt,Q[1]=100-Q[0],{percents:Q,pixels:ie,minBefore:`${et}px`,minAfter:`${we}px`,maxBefore:`${ie[0]}px`,maxAfter:`${ie[1]}px`}})(R,N,I,y),[y,R,N,I,i]),[V,U]=l.useState(!1),J=L(b,[b]),de=L(B,[B]),fe=L(_,[_]),$=l.useRef(null),ne=l.useRef(null),te=l.useRef(null),{style:ce,className:oe,...re}=g,ye={minWidth:0,minHeight:0,maxWidth:"100%",maxHeight:"100%",display:"flex",overflow:"hidden",...ce},{className:Bt,style:jt,...$t}=z,{className:Ot,style:Kt,...Ht}=k,Vt={flex:"1 1 100%",width:"100%",...C,flexDirection:i,display:"flex"},{className:Xe,style:qe,onPointerDown:Ze,...Ge}=x,Ft=L(D=>{const O=le(D,r===null);f(O)},[r]),xe=L(D=>{if(E||!V)return;const O=Qe.current?.getBoundingClientRect();let q=0;q=i==="row"?(D.clientX??D.touches?.[0]?.clientX)-O.x:(D.clientY??D.touches?.[0]?.clientY)-O.y,q=Math.max(0,Math.min(N,q)),y.fixedPaneOffset===1&&(q=N-q),s&&R.pixels===q||f({pixels:q,percent:null}),de?.(q),D.stopPropagation(),D.preventDefault()},[y,i,E,V,R,N]),Je=L(D=>{if(document.removeEventListener("pointermove",xe),document.removeEventListener("touchmove",xe),document.removeEventListener("pointerup",Je),!!V&&(U(!1),!!R)){if(fe(R.pixels),!le(s,r===null)||R.pixels!==s){const O={...R};O.percent===null&&(O.percent=O.pixels/N*100),w(O)}D.stopPropagation(),D.preventDefault()}},[R,V,s,r,N]),It=L(D=>{Ze?.(D),D.defaultPrevented||E||V||(U(!0),J(),document.addEventListener("pointermove",xe,{passive:!1}),document.addEventListener("touchmove",xe,{passive:!1}),document.addEventListener("pointerup",Je,{passive:!1}))},[Ze]),Qe=Ue(e,()=>({setPosition:Ft,isSplitPane:()=>!0}),[]),Nt=l.useMemo(()=>H?j?.({key:"resizer",ref:Pe([P,ne]),className:_e("resizer",Xe),onPointerDownCapture:It,style:{cursor:E?void 0:i==="row"?"ew-resize":"ns-resize",minWidth:i==="row"?"2px":void 0,minHeight:i!=="row"?"2px":void 0,boxSizing:"border-box",pointerEvents:"all",zIndex:1,...qe},splitDirection:i,disabled:E,...Ge}):null,[H,Xe,Ge,i,qe,E]),be=i==="row"?"Width":"Height",Wt={...ye,...jt,flex:y.fixedPaneOffset===0&&A?.pixels[0]!==null?`0 0 ${Math.round(A?.pixels[0])}px`:`1 1 ${Math.round(A?.percents[0]??100)}%`,[`min${be}`]:A?.minBefore,[`max${be}`]:o?A?.maxBefore:"100%"},Ut={...ye,...Kt,flex:y.fixedPaneOffset===1&&A?.pixels[1]!==null?`0 0 ${Math.round(A?.pixels[1])}px`:`1 1 ${Math.round(A?.percents[1]??100)}%`,[`min${be}`]:A?.minAfter,[`max${be}`]:n?A?.maxAfter:"100%"},Yt=l.useMemo(()=>n?v.jsx("div",{ref:$,className:_e("before",oe,Bt),style:Wt,...re,...$t,children:n},"before"):null,[n,g,z,y,A]),Xt=l.useMemo(()=>o?v.jsx("div",{ref:te,className:_e("after",oe,Ot),style:Ut,...re,...Ht,children:o},"after"):null,[o,g,k,y,A]);return v.jsxs("div",{ref:Pe([M,Qe]),className:_e("splitPane",i==="row"?"vertical":"horizontal",{dragging:V},S),style:Vt,children:[Yt,Nt,Xt]})}));function ht(t){if(!t)throw new Error("must have a PointerHandlerOptions");const{onPointerDown:e,onPointerUp:n,onPointerMoveOrWait:o,processTouch:i=!1,consumeTouch:r=!0}=t,s=L(e,[e]),c=L(n,[n]),a=L(o,[o]),u=l.useRef(!1),h=t?.timerInitial??230,d=t?.timerContinuous??h/2,p=l.useRef(null),S=l.useRef(null),C=l.useRef(null),E=l.useRef(null),b=l.useCallback(()=>{E.current&&(clearTimeout(E.current),E.current=null)},[]),B=l.useCallback(w=>{E.current=setTimeout(()=>{window.requestAnimationFrame(()=>{u.current!==!1&&a?.(S.current,C.current,p.current)}),B(d)},w??h)},[]);l.useEffect(()=>()=>b(),[]);const _=i?"pointer":"mouse",x=l.useCallback(w=>{w.stopPropagation(),w.stopImmediatePropagation(),w.preventDefault()},[]),g=L(w=>{document.removeEventListener(`${_}move`,j),document.removeEventListener(`${_}up`,g),document.removeEventListener("keydown",H),document.removeEventListener("keyup",y),document.removeEventListener("touchstart",x,{capture:!0}),document.removeEventListener("touchmove",x,{capture:!0}),window.removeEventListener("blur",z),b(),window.requestAnimationFrame(()=>{u.current!==!1&&(u.current=!1,c?.(w,C.current,p.current),C.current=null)})},[]),z=l.useCallback(()=>{u.current!==!1&&(u.current=!1,g(S.current))},[]),k=L(()=>{b(),B(d),window.requestAnimationFrame(()=>{u.current!==!1&&a?.(S.current,C.current,p.current)})},[d]),j=L(w=>{S.current=w,k()},[]),H=L(w=>{C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},k()},[]),y=L(w=>{C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},k()},[d]);return L(w=>{w.isDefaultPrevented()||(C.current={ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,altKey:w.altKey,metaKey:w.metaKey},s(w,C.current)!==!1&&(p.current=w,S.current=w.nativeEvent,document.addEventListener(`${_}up`,g,{passive:!1}),document.addEventListener(`${_}move`,j,{passive:!1}),document.addEventListener("keydown",H,{passive:!1}),document.addEventListener("keyup",y,{passive:!1}),window.addEventListener("blur",z,{passive:!0}),i&&r&&(document.addEventListener("touchstart",x,{passive:!1,capture:!0}),document.addEventListener("touchmove",x,{passive:!1,capture:!0})),u.current=!0,B(h)))},[h,i])}const Mn=({initValue:t,useHookBody:e,applyStateChange:n})=>{const o=l.useRef(t);if(typeof e!="function")throw new Error("function expected as hook body parameter. got "+typeof e);const i=e();return l.useLayoutEffect(()=>{o.current!==i&&(o.current=i,n(i))},[n,i]),null},Ie=t=>{console&&console.warn&&console.warn(t)},je=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||void 0;let Tn=1,Ne=!1,zt=!1;const Te=[],me=[],ke=()=>{me.forEach(t=>t())},Dn=({automaticContainerInternalUseOnly:t})=>{const[e,n]=l.useState([]),o=l.useRef([]);return o.current=e,t||Ne!==!1||(zt=!0),l.useEffect(()=>{let i=!0;function r(){if(i)return me[0]!==r?(t||Ne!==!0||Ie("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."),void n(s=>[])):void n([...Te])}return me.push(r),ke(),()=>{i=!1,o.current?.length>0&&Ie("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"),me.splice(me.indexOf(r),1),ke()}},[t]),v.jsx(v.Fragment,{children:e.map(({hook:i,key:r})=>l.createElement(Mn,{...i,key:r}))})},Pn=t=>{const e=Tn++;return Te.push({hook:t,key:e}),me.length===0&&zt===!1&&(Ne=!0,(n=>{if(je.document&&je.document.createElement){const o=je.document.createElement("div");Gt.createRoot(o).render(v.jsx(n,{automaticContainerInternalUseOnly:!0}))}else Ie("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.")})(Dn)),ke(),()=>{Te.splice(Te.findIndex(n=>n.key===e),1),ke()}},Rt=(t,e,n={})=>{let o,i,r=!1,s=!1,c=[],{unmountIfNoConsumers:a=!1}=n;const u=d=>{var p;i=d,p=()=>c.forEach(S=>S(d)),Jt.unstable_batchedUpdates(p)},h=()=>(s||(i=typeof t=="function"?t():t,s=!0),i);return()=>{const[d,p]=l.useState(h);return l.useEffect(()=>(r||(r=!0,o=Pn({initValue:t,useHookBody:e,applyStateChange:u})),c.push(p),i!==d&&p(i),()=>{c.splice(c.indexOf(p),1),c.length===0&&a&&(o(),r=!1)}),[]),d}};let At=()=>{console.warn("You must call useEditMode before setting its state.")};const kn=Rt(null,()=>{const[t,e]=l.useState(null);return At=e,t});class De{constructor(e,n,o,i){this._listenersProperties=new Set,this._listenersExecute=new Set,this._key=e,this._target=n,this._applyProps(o||{}),this._callback=i,i===void 0&&(this._callback=()=>{console.log(`implement: ${this.label()} : ${this.description()}`)})}key(){return this._key}_resolve(e,n){if(typeof e=="function"){const o=n??this._context;return e(typeof o=="function"?o():o)}return e}target(){return typeof this._target=="function"?this._target():this._target}label(e,n){const o=this._scopedLabels?.[e]||this._label;let i=null;if(typeof o=="function"){const r=n??this._context;i=o(typeof r=="function"?r():r)}else i=o;return i}description(e){return this._resolve(this._description,e)}tags(e){return this._resolve(this._tags,e)}icon(e){return this._resolve(this._icon,e)}shortcut(){return this._resolve(this._shortcut)}disabled(){return this._resolve(this._disabled)||!this._callback}state(){return this._resolve(this._state)}context(){return typeof this._context=="function"?this._context():this._context}async execute(e,n){if(!this.disabled()&&this._callback){try{let o=!0;if(n?.beforeExecute&&(o=n?.beforeExecute(this,e)),await Promise.resolve(o)===!1)return!1;const i=this._callback.bind(this)(e,this);if(await Promise.resolve(i)===!1)return!1;n?.onExecute?.(this,e),this._notifyExecute(e)}catch(o){return console.warn(o),n?.onError(this,o,e),this._notifyError(e,o),!1}return!0}}addPropertyListener(e,n=!1){if(!e)throw new Error("listener must be specified");const o=this._listenersProperties;return o.add(e),n&&e({},this),()=>{o.delete(e)}}addExecuteListener(e){if(!e)throw new Error("listener must be specified");const n=this._listenersExecute;return n.add(e),function(){n.delete(e)}}_notifyExecute(e){const n=this;this._listenersExecute.forEach(o=>{o.onExecute(n,e)})}_notifyError(e,n){const o=this;this._listenersExecute.forEach(i=>{i.onError?.(o,e,n)})}updateCallback(e){return this._callback=e||null,this}update(e){if(!e)return;const n=this._applyProps(e);return Object.keys(n).length>0&&this._notifyPropertyChange(n),this}_notifyPropertyChange(e){const n=this;this._listenersProperties.forEach(o=>{o(e,n)})}_applyProps(e){let n={},o=this;return Object.keys(e).forEach(i=>{let r=e[i];o["_"+i]!==r&&(o["_"+i]=n[i]=r)}),n}}class Le extends De{}class Ye{constructor(e,n){this._target=null,this._groupKey=null,this._root=null,this._parent=null,this._uuid=K.CommonUtils.uuidV4(),this._target=e,this._groupKey=n??null,this._root=this,this._nodes=new Map,this._nodes.set(n,this),this._children=new Map,this._listeners=new Set,this._commandsByKey=new Map,this._commandsByShortcut=new Map;const o=this;this._unListenersByCommand=new Map,this._listenersByKey=new Map,this._commandsPropertyListener=(i,r)=>{const s=o._root._listenersByKey,c=r.key(),a=s.get(c);a&&o._notifyCommands(a,"onCommandChange",r)}}_getCommand(e){return this._commandsByKey.get(e)||(this._parent?._getCommand(e)??null)}getCommand(e,n=!1){const o=this._root._focused;let i=o,r=o===this;for(;!r&&i;)i===this&&(r=!0),i=i._parent;return(r?o:this)._getCommand(e)}createChildGroup(e,n,o){let i;if(!o){let c=this;for(;c&&!i;){let a=c._nodes.get(n);a&&(i=a),c=c._parent}}i||(i=new Ye(e,n),i._parent=this,i._root=this._root,i._unListenersByCommand=null,i._listenersByKey=null,i._commandsPropertyListener=null);const r=(c,a)=>{!c.has(n)||o?c.set(n,a):o===void 0&&console.warn("commandGroup already registered",n)};r(this._root._nodes,i);let s=this._parent;for(;s;)r(this._nodes,i),s=s._parent;return this._children.set(n,i),this._notify("onGroupChange"),i}getKey(){return this._groupKey}getGroup(e){return this._nodes.get(e)}_addCommands(e,n=void 0){const o=this._commandsByKey,i=this._commandsByShortcut,r=this._root._commandsPropertyListener,s=this._root._unListenersByCommand;for(let c=0;c<e.length;c++){const a=e[c],u=a.key();if(o.has(u)&&!n){n===void 0&&console.warn("command already registered",u);continue}o.set(u,a);let h=s.get(a);h&&(h(),s.delete(a));const d=a.addPropertyListener(r);s.set(a,d);const p=a.shortcut();if(!p)continue;const S=Array.isArray(p)?p:[p];for(let C=0;C<S.length;C++){const E=pe(S[C]),b=i.get(E);b&&!n&&n===void 0&&console.warn(`Shortcut already registered: ${E}, ${u}, ${b}.`),i.set(E,u)}}}removeFromParent(){if(!this._parent)return;let e=this._parent,n=[];const o=this._groupKey;for(;e;)n.push(e._nodes),e._nodes.delete(o),e=e._parent;e=this._parent;const i=r=>{r._children.forEach(s=>{for(let c=0;c<n.length;c++)s._nodes.delete(n[c]);i(s)})};i(this),this._parent=null,this._notify("onGroupChange")}addCommands(e,n){this._addCommands(e,n),this._notify("onGroupChange")}getActive(){return this._root._focused??this._root}activate(e){let n=this;if(e&&(n=this._nodes.get(e),!n))return void console.warn("group not found",e);let o=this._root._focused??this._root;for(;o;)o=o._parent;this._root._focused!==n&&(this._root._focused=n,this._notify("onGroupChange"),this._notify("onActiveChange"))}findCommandByEvent(e){const n=[];e.altKey&&n.push(W.Alt),e.shiftKey&&n.push(W.Shift),e.ctrlKey&&n.push(W.Ctrl),e.metaKey&&n.push(W.Meta);let o=pe({key:e.code,modifiers:n});const i=this._commandsByShortcut;let r=i.get(o);r||(o=pe({key:e.key,modifiers:n}),r=i.get(o)),!r&&e.code.startsWith("Digit")&&(o=pe({key:e.code.substring(5,e.code.length),modifiers:n}),r=this._commandsByShortcut.get(o)),!r&&e.code.startsWith("Key")&&(r=pe({key:e.code.substring(3,e.code.length),modifiers:n}),r=i.get(o));let s=null;return r&&(s=this._commandsByKey.get(r),s&&s.disabled()&&(s=null),!s||s.target()&&s.target().contains(e.target)||(s=null)),s||(this._parent?.findCommandByEvent(e)??null)}dispatchToFocusedCommand(e){const n=this.getActive();if(!n||e.isDefaultPrevented())return!1;const o=n.findCommandByEvent?.(e);return!!o&&(o.execute(),e.preventDefault(),!0)}getRoot(){return this._parent?this._parent.getRoot():this}getParent(){return this._parent}addListener(e,n){const o=this._listeners,i=n?.keys,r=this._root._listenersByKey;if(i&&!e.onCommandChange)throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");let s=null;if(i)for(let c=0;c<i.length;c++){const a=i[c];if(!a)continue;let u=r.get(a);u||(u=new Set,r.set(a,u)),s||(s=[]),s.push(u),u.add(e)}return o.add(e),()=>{if(s)for(let c=0;c<s.length;c++)s[c].delete(e);o.delete(e)}}_notifyCommands(e,n,o){const i=this;setTimeout(()=>{e.forEach(r=>{r[n]?.(i,o)})},0)}_notify(e,n){const o=this;setTimeout(()=>{o._listeners.forEach(i=>{i[e]?.(o,n)}),o._parent&&o._parent._notify(e,n)},0)}getAllCommands(){const e=[],n=this._groupKey;return this._commandsByKey.forEach(o=>{e.push({command:o,groupKey:n})}),this._children.forEach(o=>{e.push(...o.getAllCommands())}),e}}const zn=K.CommonUtils.getOS()===K.CommonUtils.OSType.MacOS||K.CommonUtils.getOS()===K.CommonUtils.OSType.IOS?"Cmd":"Ctrl",Rn=K.CommonUtils.getOS()===K.CommonUtils.OSType.MacOS||K.CommonUtils.getOS()===K.CommonUtils.OSType.IOS?"⌘":"^",pe=(t,e=!1)=>{const n={};for(let i=0;t.modifiers&&i<t.modifiers.length;i++)n[t.modifiers[i]]=!0;let o="";return(n?.[W.Ctrl]||n?.[W.Meta])&&(o+=(o.length>0?"+":"")+(e?Rn:zn)),n?.[W.Alt]&&(o+=e?"⌥":"Alt"),n?.[W.Shift]&&(o+=(o.length>0?"+":"")+(e?"⇧":"Shift")),o+=(o.length>0?"+":"")+Mt(t.key),o},Me=(t,e)=>{const n=[];if(e)for(let o=0;o<e.length;o++){const i=e[o],r=i?t?.getCommand(i):null;n.push(r)}return n},dt=Rt({setClipboard:t=>{throw new Error("This is only available via the useClipboard.")},getClipboard:()=>K.InternalClipboard.Global,refNativeCopy:{current:null},refNativeLastKey:{current:null}},()=>{const[t,e]=l.useState(K.InternalClipboard.Global);return{setClipboard:n=>e(n),getClipboard:()=>t,refNativeCopy:l.useRef(null),refNativeLastKey:l.useRef(null)}});let $e=!1,An=0;var Bn=typeof document<"u"?l.useLayoutEffect:l.useEffect;const ft=()=>"sheetxl-ui-"+An++,pt=l.useId,jn=pt??function(){const[t,e]=l.useState(()=>$e?ft():void 0);return Bn(()=>{t==null&&e(ft())},[]),l.useEffect(()=>{$e||($e=!0)},[]),t},_t="Undo the last action.",mt="Repeat the last action or undo the redo.",$n=t=>`Redo ${t}`;exports.Command=De,exports.CommandButtonType={Toolbar:"toolbar",Menuitem:"menuitem"},exports.CommandGroup=Ye,exports.DefaultNotifier=Ae,exports.FocusKeyNavigation=Sn,exports.HorizontalAlignment={General:"general",Left:"left",Right:"right",Center:"center",Justify:"justify",Fill:"fill",Distributed:"distributed",CenterContinuous:"centerContinuous"},exports.KeyCodes={BackSpace:8,Tab:9,Clear:12,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,Space:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Delete:46,Digit_8:56,Y:89,Z:90,Meta:91,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NumLock:144,ScrollLock:145,BackSlash:220,Slash:191,BracketRight:221,BracketLeft:219},exports.KeyModifiers=W,exports.MouseButtonCodes={Left:1,Middle:2,Right:3},exports.NotificationType=Fe,exports.ReactUtils=mn,exports.RoundedTab=Cn,exports.ScrollPane=Dt,exports.ScrollUtils=tn,exports.Scrollbar=ze,exports.ScrollbarOrientation=ee,exports.SimpleCommand=Le,exports.SplitPane=Ln,exports.SplitPaneResizer=kt,exports.ToolTipPlacement={BottomEnd:"bottom-end",BottomStart:"bottom-start",Bottom:"bottom",LeftEnd:"left-end",LeftStart:"left-start",Left:"left",RightEnd:"right-end",RightStart:"right-start",Right:"right",TopEnd:"top-end",TopStart:"top-start",Top:"top"},exports.VirtualScrollbar=Pt,exports.defaultCreateScrollCorner=Tt,exports.defaultCreateScrollEdgeButton=t=>{const{style:e,orientation:n=ee.Vertical,...o}=t,i=n===ee.Vertical,r=i?"rotate(90) ":"";return v.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",transition:"fill-opacity 1s",zIndex:1,width:"24px",height:"24px",...e},className:`scrollbar-button ${i?"vertical":"horizontal"} edge`,...o,children:v.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",transform:r,children:v.jsx("path",{style:{transition:"opacity 240ms ease 0s",opacity:t.disabled?0:1},d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"})})})},exports.defaultCreateScrollEndButton=xt,exports.defaultCreateScrollStartButton=vt,exports.defaultCreateScrollbar=Ve,exports.getDevicePixelRatio=function(t){if(typeof window>"u")return 1;const{defaultDpr:e=1,maxDpr:n=3,round:o=!0}=t||{},i=typeof window<"u"&&typeof window.devicePixelRatio=="number"?window.devicePixelRatio:e;return Math.min(Math.max(1,o?Math.floor(i):i),n)},exports.getPortalContainer=ut,exports.toShortcutString=pe,exports.useCallbackRef=L,exports.useCommand=function(t,e=null){const n=l.useRef(e);n.current=e;const[o,i]=l.useReducer(s=>s+1,0),r=l.useMemo(()=>Array.isArray(t)?t:[t],[t]);return l.useEffect(()=>{if(!r||r.length===0)return;const s=(u,h)=>{n.current?.onChange?.(h),i()};let c=null;e&&(c={onExecute(u,h){n.current?.onExecute?.(u,h)},onError(u,h,d){n.current?.onError?.(u,h,d)}});const a=new Set;for(let u=0;u<r.length;u++)a.add(r[u]?.addPropertyListener(K.CommonUtils.debounce(s,0),!0)),e&&a.add(r[u]?.addExecuteListener(c));return()=>{a.forEach(u=>{u?.()})}},[t]),o},exports.useCommands=function(t,e=null,n=null,o){const i=l.useRef(n);i.current=n,e&&!Array.isArray(e)&&(e=[e]);const[r,s]=l.useState(Me(t,e)),c=o?[...o,t]:[t];return l.useEffect(()=>{const a={onGroupChange:()=>{const p=Me(t,e);s(p),i.current?.onChange?.(this)}};let u;e&&e.length>0&&(u={keys:e},a.onCommandChange=(p,S)=>{i.current?.onChange?.(t),s(Me(t,e))});const h=t?.addListener(a,u),d=Me(t,e);return s(d),i.current?.onChange&&i.current?.onChange(t),()=>{h?.()}},c),r},exports.useCopyPaste=t=>{const{source:e,target:n,onPaste:o,onClipboardUpdate:i,notifier:r=Ae,commands:s}=t,c=L(i,[i]),a=L(o,[o]),{getClipboard:u,refNativeCopy:h}=dt(),d=u();l.useMemo(()=>{const _=e?.element,x=n?.element??e?.element;if(!s)return;const g=[new Le("cut",_,{label:"Cut",description:"Remove the selection and put it on the clipboard so you can paste it somewhere else.",shortcut:{key:"X",modifiers:[W.Ctrl]}}),new Le("copy",_,{label:"Copy",description:"Put a copy of the selection on the clipboard so you can paste it somewhere else.",shortcut:{key:"C",modifiers:[W.Ctrl]}}),new Le("paste",x,{label:"Paste",description:"Add content on the clipboard to your document.",shortcut:[{key:"V",modifiers:[W.Ctrl]},{key:"F8",modifiers:[W.Ctrl]}]})];s?.addCommands(g,!0)},[s]);const p=L(async _=>{if(!e?.element)return;let x=null;try{x=e.doCopy?.(_),typeof x=="string"?await d.writeText(x):await d.writeReference(x)}catch(g){throw g}},[e,r]),S=L(async _=>{const x=e?.element?.();if(x){h.current={sourceElement:x,args:_};try{await p(_)}catch(g){r?.showError?.(g)}}},[e?.element,r]),C=l.useCallback(()=>{S({isCut:!0})},[]),E=L(async(_,x,g)=>{try{if(await _.doPaste(x,g)===!1)return;a?.(x,g)}catch(z){r?.showError?.(z)}},[a]),b=L(async(_,x,g)=>{const z=n?.element?.();if(z&&await K.CommonUtils.whenFocus(z),!_&&!x)return;const k=await r?.showBusy?.("Pasting...");if(x)try{return await E(n,x,g),void k?.()}catch(y){k?.(),r?.showError?.(y)}let j,H=n.importFromExternal;H||(H=(y,w)=>({getItemType:()=>"text",toText:()=>_.text,isClipboardItem:!0}));try{j=await H(_,{isCut:!1})}catch(y){k?.(),r?.showError?.(y)}if(j)try{const y=await Promise.resolve(j);await E(n,y,g),k?.()}catch(y){k?.(),r?.showError?.(y)}else k?.()},[E,n,r]),B=L(async _=>{if(n?.element)try{const x=await d.readReference();if(x)return void await b(null,x,_);const g=[];g[0]=await K.ClipboardUtils.readStringFromClipboard(d,K.MimeType.plain),g[1]=await K.ClipboardUtils.readHTMLFromClipboard(d,K.MimeType.html),g[2]=await K.ClipboardUtils.readBlobFromClipboard(d,K.MimeType.png);const z={text:g[0]??null,html:g[1]??null,image:g[2]??null};await b(z,null,_)}catch(x){if(x?.message==="Document is not focused.")return;r?.showError?.(x)}},[b,n?.element,r]);return L(async _=>{},[e?.element]),L(async _=>{},[n?.element,b,r]),l.useEffect(()=>{if(!d)return;const _=async z=>{const k=await d.readReference();c?.(k)},x=z=>{r?.showMessage?.(K.InternalClipboard.ErrorMessages.PermsRead,{onceKey:"clipboard.features"})},g=z=>{r?.showMessage?.(K.InternalClipboard.ErrorMessages.PermsWrite,{onceKey:"clipboard.features"})};return d.addEventListener("clipboardchange",_),d.addEventListener("clipboarderrorread",x),d.addEventListener("clipboarderrorwrite",g),()=>{d.removeEventListener("clipboardchange",_),d.removeEventListener("clipboarderrorread",x),d.removeEventListener("clipboarderrorwrite",g)}},[d,r]),l.useEffect(()=>{},[p,b,e,n]),l.useEffect(()=>{s?.getCommand("cut")?.updateCallback(C).update({disabled:!e||!n}),s?.getCommand("copy")?.updateCallback(S).update({disabled:!e}),s?.getCommand("paste")?.updateCallback(B).update({disabled:!n})},[e,n,s]),{paste:B,copy:S,clipboard:d}},exports.useDevicePixelRatio=function(t){const[e,n]=l.useState(typeof window<"u"?window.devicePixelRatio:1),o=l.useRef(null);return l.useEffect(()=>{if(!(typeof window<"u"&&"matchMedia"in window))return;const i=()=>{const r=window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);r.addEventListener("change",i,{once:!0,passive:!0}),n(window.devicePixelRatio),o.current={mediaMatcher:r,listener:i}};return i(),()=>{o.current&&o.current.mediaMatcher.removeEventListener("change",o.current.listener)}},[t]),e},exports.useEditMode=()=>{const t=kn();return l.useMemo(()=>({setMode:e=>{At(n=>(typeof e=="function"&&(e=e(n)),e?.onModeChange?.(e??null),e))},getMode:()=>t}),[t])},exports.useFullscreenPortal=function(){return l.useEffect(()=>{function t(){const e=document.fullscreenElement;if(!e)return;let n=e.querySelector(".fullscreen-portal-root");n||(n=document.createElement("div"),n.className="fullscreen-portal-root _fullscreen-portal-root_1mjsr_4",e.appendChild(n))}return Se++,t(),document.addEventListener("fullscreenchange",t),()=>{document.removeEventListener("fullscreenchange",t),Se--,Se<=0&&(document.querySelectorAll(".fullscreen-portal-root").forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),Se=0)}},[]),{getPortalContainer:ut}},exports.useGlobalClipboard=dt,exports.useId=jn,exports.useImperativeElement=Ue,exports.useMouseDownAndHoldListener=function(t,e){return ht({onPointerDown:t,onPointerMoveOrWait:(n,o,i)=>{t?.(i)},...e})},exports.useOnClickOrFocusAway=function(t,e,n){const o=L(e,[e]);l.useEffect(()=>{const i=r=>{t.current&&!t.current.contains(r.target)&&o(r)};return n&&n.mouseEvents===!1||(document.addEventListener("mousedown",i),document.addEventListener("touchstart",i)),n&&n.focusEvents===!1||document.addEventListener("focus",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i),document.removeEventListener("focus",i)}},[t])},exports.useSynchronizedPointerHandler=ht,exports.useTraceUpdate=function(t,e=!0){const n=l.useRef(t);l.useEffect(()=>{if(e){const o=Object.entries(t).reduce((i,[r,s])=>(n.current[r]!==s&&(i[r]=[n.current[r],s]),i),{});Object.keys(o).length>0&&console.log("Changed props:",o)}n.current=t})},exports.useUndoManager=({manager:t,commands:e,disabled:n,notifier:o=Ae})=>{const i=L(s=>{try{t?.undo(s)}catch(c){o.showError?.(c)}},[t]),r=L(s=>{try{t?.redo(s)}catch(c){o.showError?.(c)}},[t]);return l.useMemo(()=>{if(!e)return;const s={contains:a=>!0,focus(){}},c=[new De("undo",s,{label:"Undo",description:_t,shortcut:{key:"z",modifiers:[W.Ctrl]},disabled:!0},i),new De("redo",s,{label:"Redo",description:mt,shortcut:[{key:"y",modifiers:[W.Ctrl]},{key:"F4"},{key:"Enter",modifiers:[W.Alt]}],disabled:!0},r)];e?.addCommands(c,!0)},[e]),l.useEffect(()=>{if(!e)return;const s=()=>{const a=t?.getTopUndoDescription(),u={};var h;e.getCommand("undo").update({disabled:n||!t||!t.hasUndo(),description:a?(h=a,`Undo ${h}`):_t,state:u,context:{undoManager:t}});const d=t?.getTopRedoDescription();e.getCommand("redo").update({disabled:n||!t||!t.hasRedo(),description:d?$n(d):mt,state:u,context:{undoManager:t}})};if(s(),!t)return;const c=t.addListener({onStackChange(){s()}});return()=>c?.()},[t,e,n]),{undo:i,redo:r}};
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
import { jsx as L, jsxs as bt, Fragment as Mt } from "react/jsx-runtime";
|
|
3
3
|
import ft, { useLayoutEffect as Vt, useEffect as V, useState as Q, useMemo as N, useCallback as R, useRef as k, memo as St, forwardRef as Lt, useImperativeHandle as en, version as nn, createElement as on, useReducer as rn } from "react";
|
|
4
4
|
import { CommonUtils as et, ClipboardUtils as It, MimeType as Nt, InternalClipboard as Kt } from "@sheetxl/utils";
|
|
5
5
|
import { createRoot as sn } from "react-dom/client";
|
|
6
6
|
import { unstable_batchedUpdates as ln } from "react-dom";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.4
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -65,7 +65,7 @@ const mt = Ce && window.ResizeObserver !== void 0 ? function() {
|
|
|
65
65
|
} else if (Math.ceil(l) > Math.ceil(e) + 2) return l;
|
|
66
66
|
}
|
|
67
67
|
return i;
|
|
68
|
-
}, io = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ut }, Symbol.toStringTag, { value: "Module" })), dn = "_sheetxl-
|
|
68
|
+
}, io = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: Ut }, Symbol.toStringTag, { value: "Module" })), dn = "_sheetxl-scrollbar_eblx4_6", te = St(Lt((e, t) => {
|
|
69
69
|
const { offset: n = 0, totalSize: o = 0, viewportSize: i = 0, style: r, className: s, orientation: a = rt.Vertical, onScrollOffset: l, onScroll: c, showCustomScrollButtons: h = !1, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: p = 260, scrollButtonAdditionalRepeatDelay: w = 120, createScrollStartButton: b = hn, createScrollEndButton: S = un, ...v } = e, $ = T(c, [c]), _ = k(null), [y, { width: m, height: z }] = mt(), [P, { width: O, height: F }] = mt(), g = a === rt.Vertical, x = g ? "top" : "left", A = g ? "scrollTop" : "scrollLeft", d = g ? z : m, C = g ? F : O, [f, E] = Q(null);
|
|
70
70
|
V(() => {
|
|
71
71
|
f !== null && _.current && _.current.scrollTo({ behavior: "smooth", [x]: f });
|
|
@@ -87,22 +87,22 @@ const mt = Ce && window.ResizeObserver !== void 0 ? function() {
|
|
|
87
87
|
const K = W.current;
|
|
88
88
|
W.current = null, n !== K && (_.current[A] = n);
|
|
89
89
|
}, [n, A]);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
}, []),
|
|
93
|
-
B.current = K,
|
|
90
|
+
const j = k(null), B = k(null), I = R(() => {
|
|
91
|
+
j.current && (clearTimeout(j.current), j.current = null, B.current = null);
|
|
92
|
+
}, []), X = R((K, st, it, pt = p) => {
|
|
93
|
+
B.current = K, j.current = setTimeout(() => {
|
|
94
94
|
const lt = it ? D(B.current || K) : G(B.current || K);
|
|
95
|
-
lt !== B.current ?
|
|
95
|
+
lt !== B.current ? X(lt, !1, it, w) : I();
|
|
96
96
|
}, st ? 0 : pt);
|
|
97
97
|
}, [D, G, I]);
|
|
98
98
|
V(() => () => I(), [I]);
|
|
99
99
|
const nt = n, gt = N(() => {
|
|
100
100
|
if (!h) return null;
|
|
101
|
-
const K = { orientation: a, disabled: Math.floor(nt) <= 0 || Math.floor(C - d) === 0, onMouseUp: I, onMouseLeave: I, onMouseDown: () =>
|
|
101
|
+
const K = { orientation: a, disabled: Math.floor(nt) <= 0 || Math.floor(C - d) === 0, onMouseUp: I, onMouseLeave: I, onMouseDown: () => X(nt, !0, !0) };
|
|
102
102
|
return b?.(K);
|
|
103
103
|
}, [h, a, nt, f, C, d]), yt = N(() => {
|
|
104
104
|
if (!h) return null;
|
|
105
|
-
const K = { orientation: a, disabled: Math.floor(C - d) <= Math.ceil(nt), onMouseUp: I, onMouseLeave: I, onMouseDown: () =>
|
|
105
|
+
const K = { orientation: a, disabled: Math.floor(C - d) <= Math.ceil(nt), onMouseUp: I, onMouseLeave: I, onMouseDown: () => X(nt, !0, !1) };
|
|
106
106
|
return S?.(K);
|
|
107
107
|
}, [h, a, nt, f, C, d]);
|
|
108
108
|
return bt("div", { ref: t, style: { display: "flex", flex: "1", flexDirection: g ? "column" : "row", padding: "0", ...r }, className: vt(dn, s), ...v, children: [gt, L("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: g ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: y, children: L("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: g ? "scroll" : "hidden", overflowX: g ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: Y, ref: _, children: L("div", { ref: P, style: { position: "absolute", height: g ? o - i + (z ?? 0) : 1, width: g ? 1 : o - i + (m ?? 0) }, className: "scrollbar-viewport" }) }) }), yt] });
|
|
@@ -371,7 +371,7 @@ function so() {
|
|
|
371
371
|
const t = document.fullscreenElement;
|
|
372
372
|
if (!t) return;
|
|
373
373
|
let n = t.querySelector(".fullscreen-portal-root");
|
|
374
|
-
n || (n = document.createElement("div"), n.className = "fullscreen-portal-root _fullscreen-portal-
|
|
374
|
+
n || (n = document.createElement("div"), n.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t.appendChild(n));
|
|
375
375
|
}
|
|
376
376
|
return kt++, e(), document.addEventListener("fullscreenchange", e), () => {
|
|
377
377
|
document.removeEventListener("fullscreenchange", e), kt--, kt <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t) => {
|
|
@@ -470,10 +470,10 @@ const ao = St(Lt((e, t) => {
|
|
|
470
470
|
for (let D = 1; D < d.length; D++) {
|
|
471
471
|
let G = C[C.length - 1], W = d[D], Y = W === E ? d[1] : d[D + 1];
|
|
472
472
|
if (Y && G && G.length > 2 && W[0] === "L" && Y.length > 2 && Y[0] === "L") {
|
|
473
|
-
let
|
|
474
|
-
O ? (
|
|
475
|
-
let gt = g(
|
|
476
|
-
K.origPoint =
|
|
473
|
+
let j, B, I = A(G), X = A(W), nt = A(Y);
|
|
474
|
+
O ? (j = g(X, G.origPoint || I, P), B = g(X, Y.origPoint || nt, P)) : (j = F(X, I, P), B = F(X, nt, P)), x(W, j), W.origPoint = X, C.push(W);
|
|
475
|
+
let gt = g(j, X, 0.5), yt = g(X, B, 0.5), K = ["C", gt.x, gt.y, yt.x, yt.y, B.x, B.y];
|
|
476
|
+
K.origPoint = X, C.push(K);
|
|
477
477
|
} else C.push(W);
|
|
478
478
|
}
|
|
479
479
|
if (E) {
|
|
@@ -511,32 +511,32 @@ const ao = St(Lt((e, t) => {
|
|
|
511
511
|
V(() => {
|
|
512
512
|
d(ut(s, r === null));
|
|
513
513
|
}, [s, r]);
|
|
514
|
-
const [C, { width: f, height: E }] = mt(), [D, { width: G, height: W }] = mt(), Y = i === "row" ? G : W,
|
|
514
|
+
const [C, { width: f, height: E }] = mt(), [D, { width: G, height: W }] = mt(), Y = i === "row" ? G : W, j = i === "row" ? f : E, B = N(() => ((M, H, q, U) => {
|
|
515
515
|
const at = [null, null], ot = [null, null];
|
|
516
516
|
if (M || (M = { percent: U.fixedPaneOffset === null ? 50 : null, pixels: U.fixedPaneOffset === null ? null : 0 }), H === 0) return M?.pixels != null ? U.fixedPaneOffset !== 1 ? (at[0] = M?.pixels, ot[1] = 100) : (at[1] = M?.pixels - q, ot[0] = 100) : M?.percent != null && (U.fixedPaneOffset !== 1 ? (ot[0] = M?.percent, ot[1] = 100 - M?.percent) : (ot[1] = M?.percent, ot[0] = 100 - M?.percent)), { percents: ot, pixels: at, minBefore: Bt(U.minBefore, !0), maxBefore: Bt(U.maxBefore, !0), minAfter: Bt(U.minAfter), maxAfter: Bt(U.maxAfter) };
|
|
517
517
|
let ht = _t(M, H, U.fixedPaneOffset !== 1), tt = H - q, ae = _t(U.minBefore, tt, !0) ?? 0, Qe = _t(U.maxBefore, tt, !0) ?? tt, zt = 0, Ft = 0, ce = 0, he = tt;
|
|
518
518
|
zt = (_t(U.maxAfter, H, !1) ?? q) - q, Ft = _t(U.minAfter, H, !1) ?? H, ce = Math.max(ae, zt), he = Math.min(Qe, Ft), ht = Math.max(ce, Math.min(ht, he)), Ft = Math.min(tt - ht, _t(U.maxAfter, tt - ht, !0) ?? tt), zt = Math.min(tt - ht, _t(U.minAfter, tt - ht, !0) ?? tt), at[0] = ht, at[1] = tt - at[0];
|
|
519
519
|
const tn = Math.max(0, Math.min(100, ht / tt * 100));
|
|
520
520
|
return ot[0] = tn, ot[1] = 100 - ot[0], { percents: ot, pixels: at, minBefore: `${ae}px`, minAfter: `${zt}px`, maxBefore: `${at[0]}px`, maxAfter: `${at[1]}px` };
|
|
521
|
-
})(A,
|
|
521
|
+
})(A, j, Y, g), [g, A, j, Y, i]), [I, X] = Q(!1), nt = T(v, [v]), gt = T($, [$]), yt = T(_, [_]), K = k(null), st = k(null), it = k(null), { style: pt, className: lt, ...ct } = m, Ct = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...pt }, { className: Re, style: Ve, ...Fe } = z, { className: Ie, style: Ne, ...We } = P, Ye = { flex: "1 1 100%", width: "100%", ...b, flexDirection: i, display: "flex" }, { className: ne, style: oe, onPointerDown: ie, ...re } = y, je = T((M) => {
|
|
522
522
|
const H = ut(M, r === null);
|
|
523
523
|
d(H);
|
|
524
524
|
}, [r]), Dt = T((M) => {
|
|
525
525
|
if (S || !I) return;
|
|
526
526
|
const H = le.current?.getBoundingClientRect();
|
|
527
527
|
let q = 0;
|
|
528
|
-
q = i === "row" ? (M.clientX ?? M.touches?.[0]?.clientX) - H.x : (M.clientY ?? M.touches?.[0]?.clientY) - H.y, q = Math.max(0, Math.min(
|
|
529
|
-
}, [g, i, S, I, A,
|
|
530
|
-
if (document.removeEventListener("pointermove", Dt), document.removeEventListener("touchmove", Dt), document.removeEventListener("pointerup", se), !!I && (
|
|
528
|
+
q = i === "row" ? (M.clientX ?? M.touches?.[0]?.clientX) - H.x : (M.clientY ?? M.touches?.[0]?.clientY) - H.y, q = Math.max(0, Math.min(j, q)), g.fixedPaneOffset === 1 && (q = j - q), s && A.pixels === q || d({ pixels: q, percent: null }), gt?.(q), M.stopPropagation(), M.preventDefault();
|
|
529
|
+
}, [g, i, S, I, A, j]), se = T((M) => {
|
|
530
|
+
if (document.removeEventListener("pointermove", Dt), document.removeEventListener("touchmove", Dt), document.removeEventListener("pointerup", se), !!I && (X(!1), !!A)) {
|
|
531
531
|
if (yt(A.pixels), !ut(s, r === null) || A.pixels !== s) {
|
|
532
532
|
const H = { ...A };
|
|
533
|
-
H.percent === null && (H.percent = H.pixels /
|
|
533
|
+
H.percent === null && (H.percent = H.pixels / j * 100), x(H);
|
|
534
534
|
}
|
|
535
535
|
M.stopPropagation(), M.preventDefault();
|
|
536
536
|
}
|
|
537
|
-
}, [A, I, s, r,
|
|
538
|
-
ie?.(M), M.defaultPrevented || S || I || (
|
|
539
|
-
}, [ie]), le = Ae(t, () => ({ setPosition:
|
|
537
|
+
}, [A, I, s, r, j]), Xe = T((M) => {
|
|
538
|
+
ie?.(M), M.defaultPrevented || S || I || (X(!0), nt(), document.addEventListener("pointermove", Dt, { passive: !1 }), document.addEventListener("touchmove", Dt, { passive: !1 }), document.addEventListener("pointerup", se, { passive: !1 }));
|
|
539
|
+
}, [ie]), le = Ae(t, () => ({ setPosition: je, isSplitPane: () => !0 }), []), Ue = N(() => F ? O?.({ key: "resizer", ref: Ht([D, st]), className: vt("resizer", ne), onPointerDownCapture: Xe, style: { cursor: S ? void 0 : i === "row" ? "ew-resize" : "ns-resize", minWidth: i === "row" ? "2px" : void 0, minHeight: i !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...oe }, splitDirection: i, disabled: S, ...re }) : null, [F, ne, re, i, oe, S]), Pt = i === "row" ? "Width" : "Height", Ze = { ...Ct, ...Ve, flex: g.fixedPaneOffset === 0 && B?.pixels[0] !== null ? `0 0 ${Math.round(B?.pixels[0])}px` : `1 1 ${Math.round(B?.percents[0] ?? 100)}%`, [`min${Pt}`]: B?.minBefore, [`max${Pt}`]: o ? B?.maxBefore : "100%" }, Ge = { ...Ct, ...Ne, flex: g.fixedPaneOffset === 1 && B?.pixels[1] !== null ? `0 0 ${Math.round(B?.pixels[1])}px` : `1 1 ${Math.round(B?.percents[1] ?? 100)}%`, [`min${Pt}`]: B?.minAfter, [`max${Pt}`]: n ? B?.maxAfter : "100%" }, qe = N(() => n ? L("div", { ref: K, className: vt("before", lt, Re), style: Ze, ...ct, ...Fe, children: n }, "before") : null, [n, m, z, g, B]), Je = N(() => o ? L("div", { ref: it, className: vt("after", lt, Ie), style: Ge, ...ct, ...We, children: o }, "after") : null, [o, m, P, g, B]);
|
|
540
540
|
return bt("div", { ref: Ht([C, le]), className: vt("splitPane", i === "row" ? "vertical" : "horizontal", { dragging: I }, w), style: Ye, children: [qe, Ue, Je] });
|
|
541
541
|
}));
|
|
542
542
|
function uo(e) {
|
|
@@ -777,7 +777,7 @@ class Qt {
|
|
|
777
777
|
}), n;
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
-
class
|
|
780
|
+
class jt extends Qt {
|
|
781
781
|
}
|
|
782
782
|
class He {
|
|
783
783
|
constructor(t, n) {
|
|
@@ -1000,7 +1000,7 @@ const vo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Yn = Oe({ setClipboard:
|
|
|
1000
1000
|
N(() => {
|
|
1001
1001
|
const _ = t?.element, y = n?.element ?? t?.element;
|
|
1002
1002
|
if (!s) return;
|
|
1003
|
-
const m = [new
|
|
1003
|
+
const m = [new jt("cut", _, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", shortcut: { key: "X", modifiers: [Z.Ctrl] } }), new jt("copy", _, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", shortcut: { key: "C", modifiers: [Z.Ctrl] } }), new jt("paste", y, { label: "Paste", description: "Add content on the clipboard to your document.", shortcut: [{ key: "V", modifiers: [Z.Ctrl] }, { key: "F8", modifiers: [Z.Ctrl] }] })];
|
|
1004
1004
|
s?.addCommands(m, !0);
|
|
1005
1005
|
}, [s]);
|
|
1006
1006
|
const p = T(async (_) => {
|
|
@@ -1096,14 +1096,14 @@ function bo(e, t = !0) {
|
|
|
1096
1096
|
n.current = e;
|
|
1097
1097
|
});
|
|
1098
1098
|
}
|
|
1099
|
-
let
|
|
1100
|
-
var
|
|
1101
|
-
const xe = () => "sheetxl-ui-" +
|
|
1102
|
-
const [e, t] = ft.useState(() =>
|
|
1103
|
-
return
|
|
1099
|
+
let Xt = !1, jn = 0;
|
|
1100
|
+
var Xn = typeof document < "u" ? Vt : V;
|
|
1101
|
+
const xe = () => "sheetxl-ui-" + jn++, be = ft.useId, wo = be ?? function() {
|
|
1102
|
+
const [e, t] = ft.useState(() => Xt ? xe() : void 0);
|
|
1103
|
+
return Xn(() => {
|
|
1104
1104
|
e == null && t(xe());
|
|
1105
1105
|
}, []), ft.useEffect(() => {
|
|
1106
|
-
|
|
1106
|
+
Xt || (Xt = !0);
|
|
1107
1107
|
}, []), e;
|
|
1108
1108
|
}, we = "Undo the last action.", Se = "Repeat the last action or undo the redo.", Un = (e) => `Redo ${e}`, So = ({ manager: e, commands: t, disabled: n, notifier: o = Be }) => {
|
|
1109
1109
|
const i = T((s) => {
|
|
@@ -1157,7 +1157,7 @@ export {
|
|
|
1157
1157
|
io as ScrollUtils,
|
|
1158
1158
|
te as Scrollbar,
|
|
1159
1159
|
rt as ScrollbarOrientation,
|
|
1160
|
-
|
|
1160
|
+
jt as SimpleCommand,
|
|
1161
1161
|
ho as SplitPane,
|
|
1162
1162
|
On as SplitPaneResizer,
|
|
1163
1163
|
lo as ToolTipPlacement,
|
package/node/assets/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._sheetxl-
|
|
1
|
+
._sheetxl-scrollbar_eblx4_6 ::-webkit-scrollbar-button{background:transparent}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.3.4
|
|
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.
|
|
@@ -36,7 +36,7 @@ const C = { General: "general", Left: "left", Right: "right", Center: "center",
|
|
|
36
36
|
} else if (Math.ceil(l2) > Math.ceil(e2) + 2) return l2;
|
|
37
37
|
}
|
|
38
38
|
return i2;
|
|
39
|
-
}, $ = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: B }, Symbol.toStringTag, { value: "Module" })), K = "_sheetxl-
|
|
39
|
+
}, $ = Object.freeze(Object.defineProperty({ __proto__: null, getScrollTo: B }, Symbol.toStringTag, { value: "Module" })), K = "_sheetxl-scrollbar_eblx4_6", O = s(l((n2, o2) => {
|
|
40
40
|
const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: u2 = 0, style: d2, className: _2, orientation: p2 = D.Vertical, onScrollOffset: g2, onScroll: y2, showCustomScrollButtons: v2 = false, scrollButtonIncrement: x2 = 200, scrollButtonInitialRepeatDelay: b2 = 260, scrollButtonAdditionalRepeatDelay: w2 = 120, createScrollStartButton: S2 = z, createScrollEndButton: L2 = k, ...C2 } = n2, E2 = P(y2, [y2]), T2 = r(null), [M2, { width: A2, height: $2 }] = f(), [O2, { width: V2, height: H2 }] = f(), W2 = p2 === D.Vertical, N2 = W2 ? "top" : "left", R2 = W2 ? "scrollTop" : "scrollLeft", F2 = W2 ? $2 : A2, I2 = W2 ? H2 : V2, [Y2, X2] = a(null);
|
|
41
41
|
c(() => {
|
|
42
42
|
null !== Y2 && T2.current && T2.current.scrollTo({ behavior: "smooth", [N2]: Y2 });
|
|
@@ -49,7 +49,7 @@ const C = { General: "general", Left: "left", Right: "right", Center: "center",
|
|
|
49
49
|
if (!T2.current) return 0;
|
|
50
50
|
const n3 = T2.current.querySelector(".scrollbar-viewport"), o3 = n3.getBoundingClientRect(), i2 = n3.children, r2 = Math.ceil(I2 - F2), s3 = t2 ? r2 : B(e2, o3[N2], i2, false, Math.max(0, e2 + x2));
|
|
51
51
|
return X2(s3), Math.min(r2, s3);
|
|
52
|
-
}, [I2, F2]), Z2 = r(null),
|
|
52
|
+
}, [I2, F2]), Z2 = r(null), G2 = i((e2) => {
|
|
53
53
|
Z2.current = s2;
|
|
54
54
|
const t2 = e2.target[R2];
|
|
55
55
|
g2(t2, u2, l2), E2?.(e2);
|
|
@@ -58,10 +58,10 @@ const C = { General: "general", Left: "left", Right: "right", Center: "center",
|
|
|
58
58
|
const e2 = Z2.current;
|
|
59
59
|
Z2.current = null, s2 !== e2 && (T2.current[R2] = s2);
|
|
60
60
|
}, [s2, R2]);
|
|
61
|
-
const
|
|
62
|
-
|
|
61
|
+
const q2 = r(null), J2 = r(null), Q2 = i(() => {
|
|
62
|
+
q2.current && (clearTimeout(q2.current), q2.current = null, J2.current = null);
|
|
63
63
|
}, []), ee2 = i((e2, t2, n3, o3 = b2) => {
|
|
64
|
-
J2.current = e2,
|
|
64
|
+
J2.current = e2, q2.current = setTimeout(() => {
|
|
65
65
|
const t3 = n3 ? j2(J2.current || e2) : U2(J2.current || e2);
|
|
66
66
|
t3 !== J2.current ? ee2(t3, false, n3, w2) : Q2();
|
|
67
67
|
}, t2 ? 0 : o3);
|
|
@@ -76,7 +76,7 @@ const C = { General: "general", Left: "left", Right: "right", Center: "center",
|
|
|
76
76
|
const e2 = { orientation: p2, disabled: Math.floor(I2 - F2) <= Math.ceil(te2), onMouseUp: Q2, onMouseLeave: Q2, onMouseDown: () => ee2(te2, true, false) };
|
|
77
77
|
return L2?.(e2);
|
|
78
78
|
}, [v2, p2, te2, Y2, I2, F2]);
|
|
79
|
-
return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: W2 ? "column" : "row", padding: "0", ...d2 }, className: m(K, _2), ...C2, children: [ne2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: W2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: W2 ? "scroll" : "hidden", overflowX: W2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll:
|
|
79
|
+
return t("div", { ref: o2, style: { display: "flex", flex: "1", flexDirection: W2 ? "column" : "row", padding: "0", ...d2 }, className: m(K, _2), ...C2, children: [ne2, e("div", { className: "pseudo-scrollbar", style: { flex: "1 1 100%", display: "flex", boxSizing: "content-box", flexDirection: W2 ? "column" : "row", justifyContent: "center", alignItems: "center" }, ref: M2, children: e("div", { tabIndex: -1, style: { flex: "1 1 100%", overflowY: W2 ? "scroll" : "hidden", overflowX: W2 ? "hidden" : "scroll", position: "relative", willChange: "transform" }, onScroll: G2, ref: T2, children: e("div", { ref: O2, style: { position: "absolute", height: W2 ? l2 - u2 + ($2 ?? 0) : 1, width: W2 ? 1 : l2 - u2 + (A2 ?? 0) }, className: "scrollbar-viewport" }) }) }), oe2] });
|
|
80
80
|
}));
|
|
81
81
|
O.displayName = "Scrollbar";
|
|
82
82
|
let V = Date.now, H = 1e3, W = {}, N = 1;
|
|
@@ -245,10 +245,10 @@ j.prototype = { __isSingleTouch: false, __isTracking: false, __didDecelerationCo
|
|
|
245
245
|
}
|
|
246
246
|
} };
|
|
247
247
|
const U = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), Z = {};
|
|
248
|
-
function
|
|
248
|
+
function G() {
|
|
249
249
|
return b;
|
|
250
250
|
}
|
|
251
|
-
const
|
|
251
|
+
const q = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : g.camelToPrettyCase(e2), J = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: Z, boundPixel: function(e2, t2 = false, n2 = 0) {
|
|
252
252
|
return e2;
|
|
253
253
|
}, createSyntheticEvent: (e2) => {
|
|
254
254
|
let t2 = false, n2 = false;
|
|
@@ -258,7 +258,7 @@ const G = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : g.c
|
|
|
258
258
|
n2 = true, e2.stopPropagation();
|
|
259
259
|
}, isPropagationStopped: () => n2, persist: () => {
|
|
260
260
|
}, timeStamp: e2.timeStamp, type: e2.type };
|
|
261
|
-
}, detectIt:
|
|
261
|
+
}, detectIt: G, focusableNodeNames: U, toPrettyKeyCode: q }, Symbol.toStringTag, { value: "Module" })), Q = [];
|
|
262
262
|
function ee(e2, t2, n2 = Q) {
|
|
263
263
|
const o2 = r(null);
|
|
264
264
|
return u(e2, () => {
|
|
@@ -291,12 +291,12 @@ const te = (t2) => e(O, { ...t2 }), ne = ({ width: t2, height: n2 }) => e("div",
|
|
|
291
291
|
}, []);
|
|
292
292
|
c(() => {
|
|
293
293
|
const e2 = v2 ?? S2.current;
|
|
294
|
-
if (!x2 &&
|
|
294
|
+
if (!x2 && G().supportsTouchEvents && e2 && a2) {
|
|
295
295
|
if (!L2.current) {
|
|
296
296
|
const e3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
297
297
|
L2.current = new j(C2, e3);
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
G().supportsTouchEvents && (e2.addEventListener("touchstart", E2), e2.addEventListener("touchend", M2), e2.addEventListener("touchmove", T2)), z2({ containerWidth: a2?.width, containerHeight: a2?.height, totalWidth: a2?.totalWidth, totalHeight: a2?.totalHeight });
|
|
300
300
|
}
|
|
301
301
|
return () => {
|
|
302
302
|
e2?.removeEventListener("touchstart", E2), e2?.removeEventListener("touchend", M2), e2?.removeEventListener("touchmove", T2);
|
|
@@ -337,7 +337,7 @@ function ce() {
|
|
|
337
337
|
const e3 = document.fullscreenElement;
|
|
338
338
|
if (!e3) return;
|
|
339
339
|
let t2 = e3.querySelector(".fullscreen-portal-root");
|
|
340
|
-
t2 || (t2 = document.createElement("div"), t2.className = "fullscreen-portal-root _fullscreen-portal-
|
|
340
|
+
t2 || (t2 = document.createElement("div"), t2.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", e3.appendChild(t2));
|
|
341
341
|
}
|
|
342
342
|
return ae++, e2(), document.addEventListener("fullscreenchange", e2), () => {
|
|
343
343
|
document.removeEventListener("fullscreenchange", e2), ae--, ae <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((e3) => {
|
|
@@ -465,7 +465,7 @@ const ye = s(l((i2, s2) => {
|
|
|
465
465
|
h2 = (we(o2.maxAfter, t2, false) ?? n3) - n3, u3 = we(o2.minAfter, t2, false) ?? t2, d3 = Math.max(a2, h2), _3 = Math.min(c2, u3), s3 = Math.max(d3, Math.min(s3, _3)), u3 = Math.min(l3 - s3, we(o2.maxAfter, l3 - s3, true) ?? l3), h2 = Math.min(l3 - s3, we(o2.minAfter, l3 - s3, true) ?? l3), i3[0] = s3, i3[1] = l3 - i3[0];
|
|
466
466
|
const p3 = Math.max(0, Math.min(100, s3 / l3 * 100));
|
|
467
467
|
return r2[0] = p3, r2[1] = 100 - r2[0], { percents: r2, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
|
|
468
|
-
})(V2, j2, X2, K2), [K2, V2, j2, X2, u2]), [Z2,
|
|
468
|
+
})(V2, j2, X2, K2), [K2, V2, j2, X2, u2]), [Z2, G2] = a(false), q2 = P(E2, [E2]), J2 = P(T2, [T2]), Q2 = P(M2, [M2]), te2 = r(null), ne2 = r(null), oe2 = r(null), { style: ie2, className: re2, ...se2 } = z2, le2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", display: "flex", overflow: "hidden", ...ie2 }, { className: ae2, style: ce2, ...he2 } = k2, { className: ue2, style: de2, ..._e2 } = A2, pe2 = { flex: "1 1 100%", width: "100%", ...L2, flexDirection: u2, display: "flex" }, { className: me2, style: fe2, onPointerDown: ge2, ...ye2 } = D2, ve2 = P((e2) => {
|
|
469
469
|
const t2 = Le(e2, null === d2);
|
|
470
470
|
H2(t2);
|
|
471
471
|
}, [d2]), Ce2 = P((e2) => {
|
|
@@ -475,7 +475,7 @@ const ye = s(l((i2, s2) => {
|
|
|
475
475
|
n3 = "row" === u2 ? (e2.clientX ?? e2.touches?.[0]?.clientX) - t2.x : (e2.clientY ?? e2.touches?.[0]?.clientY) - t2.y, n3 = Math.max(0, Math.min(j2, n3)), 1 === K2.fixedPaneOffset && (n3 = j2 - n3), _2 && V2.pixels === n3 || H2({ pixels: n3, percent: null }), J2?.(n3), e2.stopPropagation(), e2.preventDefault();
|
|
476
476
|
}, [K2, u2, C2, Z2, V2, j2]), Ee2 = P((e2) => {
|
|
477
477
|
if (document.removeEventListener("pointermove", Ce2), document.removeEventListener("touchmove", Ce2), document.removeEventListener("pointerup", Ee2), !Z2) return;
|
|
478
|
-
if (
|
|
478
|
+
if (G2(false), !V2) return;
|
|
479
479
|
Q2(V2.pixels);
|
|
480
480
|
if (!Le(_2, null === d2) || V2.pixels !== _2) {
|
|
481
481
|
const e3 = { ...V2 };
|
|
@@ -483,7 +483,7 @@ const ye = s(l((i2, s2) => {
|
|
|
483
483
|
}
|
|
484
484
|
e2.stopPropagation(), e2.preventDefault();
|
|
485
485
|
}, [V2, Z2, _2, d2, j2]), Te2 = P((e2) => {
|
|
486
|
-
ge2?.(e2), e2.defaultPrevented || C2 || Z2 || (
|
|
486
|
+
ge2?.(e2), e2.defaultPrevented || C2 || Z2 || (G2(true), q2(), document.addEventListener("pointermove", Ce2, { passive: false }), document.addEventListener("touchmove", Ce2, { passive: false }), document.addEventListener("pointerup", Ee2, { passive: false }));
|
|
487
487
|
}, [ge2]), Me2 = ee(i2, () => ({ setPosition: ve2, isSplitPane: () => true }), []), De2 = h(() => $2 ? B2?.({ key: "resizer", ref: w([F2, ne2]), className: m("resizer", me2), onPointerDownCapture: Te2, style: { cursor: C2 ? void 0 : "row" === u2 ? "ew-resize" : "ns-resize", minWidth: "row" === u2 ? "2px" : void 0, minHeight: "row" !== u2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...fe2 }, splitDirection: u2, disabled: C2, ...ye2 }) : null, [$2, me2, ye2, u2, fe2, C2]), Pe2 = "row" === u2 ? "Width" : "Height", ze2 = { ...le2, ...ce2, flex: 0 === K2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Pe2}`]: U2?.minBefore, [`max${Pe2}`]: l2 ? U2?.maxBefore : "100%" }, ke2 = { ...le2, ...de2, flex: 1 === K2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Pe2}`]: U2?.minAfter, [`max${Pe2}`]: s2 ? U2?.maxAfter : "100%" }, Ae2 = h(() => s2 ? e("div", { ref: te2, className: m("before", re2, ae2), style: ze2, ...se2, ...he2, children: s2 }, "before") : null, [s2, z2, k2, K2, U2]), Be2 = h(() => l2 ? e("div", { ref: oe2, className: m("after", re2, ue2), style: ke2, ...se2, ..._e2, children: l2 }, "after") : null, [l2, z2, A2, K2, U2]);
|
|
488
488
|
return t("div", { ref: w([W2, Me2]), className: m("splitPane", "row" === u2 ? "vertical" : "horizontal", { dragging: Z2 }, S2), style: pe2, children: [Ae2, De2, Be2] });
|
|
489
489
|
}));
|
|
@@ -790,7 +790,7 @@ class Ue {
|
|
|
790
790
|
if (!u2) continue;
|
|
791
791
|
const d2 = Array.isArray(u2) ? u2 : [u2];
|
|
792
792
|
for (let e3 = 0; e3 < d2.length; e3++) {
|
|
793
|
-
const n3 =
|
|
793
|
+
const n3 = qe(d2[e3]), i3 = o2.get(n3);
|
|
794
794
|
i3 && !t2 && void 0 === t2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
|
|
795
795
|
}
|
|
796
796
|
}
|
|
@@ -825,10 +825,10 @@ class Ue {
|
|
|
825
825
|
findCommandByEvent(e2) {
|
|
826
826
|
const t2 = [];
|
|
827
827
|
e2.altKey && t2.push(E.Alt), e2.shiftKey && t2.push(E.Shift), e2.ctrlKey && t2.push(E.Ctrl), e2.metaKey && t2.push(E.Meta);
|
|
828
|
-
let n2 =
|
|
828
|
+
let n2 = qe({ key: e2.code, modifiers: t2 });
|
|
829
829
|
const o2 = this._commandsByShortcut;
|
|
830
830
|
let i2 = o2.get(n2);
|
|
831
|
-
i2 || (n2 =
|
|
831
|
+
i2 || (n2 = qe({ key: e2.key, modifiers: t2 }), i2 = o2.get(n2)), !i2 && e2.code.startsWith("Digit") && (n2 = qe({ key: e2.code.substring(5, e2.code.length), modifiers: t2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && e2.code.startsWith("Key") && (i2 = qe({ key: e2.code.substring(3, e2.code.length), modifiers: t2 }), i2 = o2.get(n2));
|
|
832
832
|
let r2 = null;
|
|
833
833
|
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(e2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(e2) ?? null);
|
|
834
834
|
}
|
|
@@ -887,11 +887,11 @@ class Ue {
|
|
|
887
887
|
}), e2;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
const Ze = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "Cmd" : "Ctrl",
|
|
890
|
+
const Ze = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "Cmd" : "Ctrl", Ge = g.getOS() === g.OSType.MacOS || g.getOS() === g.OSType.IOS ? "⌘" : "^", qe = (e2, t2 = false) => {
|
|
891
891
|
const n2 = {};
|
|
892
892
|
for (let t3 = 0; e2.modifiers && t3 < e2.modifiers.length; t3++) n2[e2.modifiers[t3]] = true;
|
|
893
893
|
let o2 = "";
|
|
894
|
-
return (n2?.[E.Ctrl] || n2?.[E.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ?
|
|
894
|
+
return (n2?.[E.Ctrl] || n2?.[E.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? Ge : Ze)), n2?.[E.Alt] && (o2 += t2 ? "⌥" : "Alt"), n2?.[E.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (t2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + q(e2.key), o2;
|
|
895
895
|
};
|
|
896
896
|
function Je(e2, t2 = null) {
|
|
897
897
|
const n2 = r(t2);
|
|
@@ -1124,7 +1124,7 @@ export {
|
|
|
1124
1124
|
te as defaultCreateScrollbar,
|
|
1125
1125
|
Te as getDevicePixelRatio,
|
|
1126
1126
|
le as getPortalContainer,
|
|
1127
|
-
|
|
1127
|
+
qe as toShortcutString,
|
|
1128
1128
|
P as useCallbackRef,
|
|
1129
1129
|
Je as useCommand,
|
|
1130
1130
|
et as useCommands,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-react",
|
|
3
3
|
"description": "Utils React - Utilities for React capabilities needed for all SheetXL components.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.4",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"tiny-invariant": "^1.3.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@sheetxl/utils": "^0.3.
|
|
37
|
+
"@sheetxl/utils": "^0.3.4",
|
|
38
38
|
"react": "^19.1.0",
|
|
39
39
|
"react-dom": "^19.1.0"
|
|
40
40
|
}
|