diff --git a/assets/packs/data_table/App.js b/assets/packs/data_table/App.js index af3066e1..d8aafec3 100644 --- a/assets/packs/data_table/App.js +++ b/assets/packs/data_table/App.js @@ -120,7 +120,6 @@ export function App({ ctx, data }) { const [columns, setColumns] = useState(columnsInitData); const [colSizes, setColSizes] = useState(columnsInitSize); const [menu, setMenu] = useState(null); - const [showMenu, setShowMenu] = useState(false); const [selection, setSelection] = useState(emptySelection); const [rowMarkerOffset, setRowMarkerOffset] = useState(0); const [hoverRows, setHoverRows] = useState(null); @@ -137,14 +136,8 @@ export function App({ ctx, data }) { const headerItems = hasSummaries && hasEntries ? Math.max(...summariesItems) : 0; const headerHeight = headerTitleSize + headerItems * 22; - const menuHeight = hasSorting ? 140 : 70; const fixedHeight = 440 + headerHeight; - const minRowsToFitMenu = hasSorting ? 3 : 2; - const autoHeight = - totalRows && totalRows < minRowsToFitMenu && menu - ? menuHeight + headerHeight - : null; - const height = totalRows >= 10 && infiniteScroll ? fixedHeight : autoHeight; + const height = totalRows >= 10 && infiniteScroll ? fixedHeight : null; const rowMarkerStartIndex = (content.page - 1) * content.limit + 1; const minColumnWidth = hasSummaries ? 150 : 50; const maxColumnWidth = 1200; @@ -331,7 +324,7 @@ export function App({ ctx, data }) { }; const { layerProps, renderLayer } = useLayer({ - isOpen: showMenu, + isOpen: !!menu, auto: true, placement: "bottom-end", possiblePlacements: ["bottom-end", "bottom-center", "bottom-start"], @@ -447,11 +440,10 @@ export function App({ ctx, data }) { themeOverride: header.id === currentMenu ? themeOverride : null, })); setColumns(newColumns); - setShowMenu(menu ? true : false); }, [menu]); return ( -
+
{showDownload && ( @@ -519,7 +511,7 @@ export function App({ ctx, data }) { onColumnMoved={hasRelocate ? onColumnMoved : undefined} /> )} - {showMenu && + {menu && renderLayer( {"use strict";var he=Y6();q3.createRoot=he.createRoot,q3.hydrateRoot=he.hydrateRoot;var ZV});var Ve=q((BV,Le)=>{"use strict";var an="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Le.exports=an});var pe=q((zV,ve)=>{"use strict";var on=Ve();function de(){}function ue(){}ue.resetWarningCache=de;ve.exports=function(){function e(l,r,s,a,o,n){if(n!==on){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}e.isRequired=e;function t(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ue,resetWarningCache:de};return i.PropTypes=i,i}});var xe=q((FV,Me)=>{Me.exports=pe()();var yV,bV});var fe=q(L7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","react","prop-types"],t);else if(typeof L7!="undefined")t(L7,S1(),xe());else{var i={exports:{}};t(i.exports,e.react,e.propTypes),e.reactSwipe=i.exports}})(L7,function(e,t,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=w;var l=s(t),r=s(i);function s(V){return V&&V.__esModule?V:{default:V}}var a=Object.assign||function(V){for(var u=1;u=0||Object.prototype.hasOwnProperty.call(V,p)&&(d[p]=V[p]);return d}function n(V,u){if(!(V instanceof u))throw new TypeError("Cannot call a class as a function")}var C=function(){function V(u,d){for(var p=0;p0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?V:V.capture}function L(V){if("touches"in V){var u=V.touches[0],d=u.pageX,p=u.pageY;return{x:d,y:p}}var Z=V.screenX,R=V.screenY;return{x:Z,y:R}}var v=function(V){m(u,V);function u(){var d;n(this,u);for(var p=arguments.length,Z=Array(p),R=0;RZ&&this.props.onSwipeRight(1,p),this.movePosition.deltaY<-Z?this.props.onSwipeUp(1,p):this.movePosition.deltaY>Z&&this.props.onSwipeDown(1,p)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(p){this.swiper=p,this.props.innerRef(p)}},{key:"render",value:function(){var p=this.props,Z=p.tagName,R=p.className,x=p.style,N=p.children,E=p.allowMouseEvents,k=p.onSwipeUp,T=p.onSwipeDown,b=p.onSwipeLeft,A=p.onSwipeRight,z=p.onSwipeStart,_=p.onSwipeMove,K=p.onSwipeEnd,J=p.innerRef,C1=p.tolerance,g1=o(p,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return l.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:x},g1),N)}}]),u}(t.Component);v.displayName="ReactSwipe",v.propTypes={tagName:r.default.string,className:r.default.string,style:r.default.object,children:r.default.node,allowMouseEvents:r.default.bool,onSwipeUp:r.default.func,onSwipeDown:r.default.func,onSwipeLeft:r.default.func,onSwipeRight:r.default.func,onSwipeStart:r.default.func,onSwipeMove:r.default.func,onSwipeEnd:r.default.func,innerRef:r.default.func,tolerance:r.default.number.isRequired},v.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=v})});var $3=q(V7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","./react-swipe"],t);else if(typeof V7!="undefined")t(V7,fe());else{var i={exports:{}};t(i.exports,e.reactSwipe),e.index=i.exports}})(V7,function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=l(t);function l(r){return r&&r.__esModule?r:{default:r}}e.default=i.default})});var Ze=q((TV,d7)=>{(function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r="",s=0;s{"use strict";Object.defineProperty(u7,"__esModule",{value:!0});u7.default=void 0;var G4=nn(Ze());function nn(e){return e&&e.__esModule?e:{default:e}}function Cn(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var cn={ROOT:function(t){return(0,G4.default)(Cn({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,G4.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,i){return(0,G4.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(t,i){return(0,G4.default)({thumbs:!t,slider:t,animated:!i})},ITEM:function(t,i,l){return(0,G4.default)({thumb:!t,slide:t,selected:i,previous:l})},ARROW_PREV:function(t){return(0,G4.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,G4.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,G4.default)({dot:!0,selected:t})}};u7.default=cn});var Ee=q(v7=>{"use strict";Object.defineProperty(v7,"__esModule",{value:!0});v7.outerWidth=void 0;var mn=function(t){var i=t.offsetWidth,l=getComputedStyle(t);return i+=parseInt(l.marginLeft)+parseInt(l.marginRight),i};v7.outerWidth=mn});var M7=q(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;var wn=function(t,i,l){var r=t===0?t:t+i,s=l==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",o="("+s.join(",")+")";return a+o};p7.default=wn});var X3=q(x7=>{"use strict";Object.defineProperty(x7,"__esModule",{value:!0});x7.default=void 0;var hn=function(){return window};x7.default=hn});var J3=q(N7=>{"use strict";Object.defineProperty(N7,"__esModule",{value:!0});N7.default=void 0;var L4=Ln(S1()),c5=E7(K3()),gn=Ee(),Ne=E7(M7()),Hn=E7($3()),f7=E7(X3());function E7(e){return e&&e.__esModule?e:{default:e}}function Be(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Be=function(){return e},e}function Ln(e){if(e&&e.__esModule)return e;if(e===null||y9(e)!=="object"&&typeof e!="function")return{default:e};var t=Be();if(t&&t.has(e))return t.get(e);var i={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=l?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}function y9(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y9=function(i){return typeof i}:y9=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},y9(e)}function j3(){return j3=Object.assign||function(e){for(var t=1;t0&&(a=0),C===m&&a<0&&(a=0);var h=r.itemsWrapperRef.clientWidth,w=C+100/(h/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){r.itemsListRef.style[g]=(0,Ne.default)(w,"%",r.props.axis)}),!0}),N0(b0(r),"slideRight",function(s){r.moveTo(r.state.firstItem-(typeof s=="number"?s:1))}),N0(b0(r),"slideLeft",function(s){r.moveTo(r.state.firstItem+(typeof s=="number"?s:1))}),N0(b0(r),"moveTo",function(s){s=s<0?0:s,s=s>=r.state.lastPosition?r.state.lastPosition:s,r.setState({firstItem:s})}),r.state={selectedItem:l.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return dn(i,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,f7.default)().addEventListener("resize",this.updateSizes),(0,f7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,f7.default)().removeEventListener("resize",this.updateSizes),(0,f7.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var s=r;return r>=this.state.lastPosition&&(s=this.state.lastPosition),r1,a=this.state.showArrows&&this.state.firstItem>0,o=this.state.showArrows&&this.state.firstItem{"use strict";Object.defineProperty(R7,"__esModule",{value:!0});R7.default=void 0;var fn=function(){return document};R7.default=fn});var e8=q(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});s4.setPosition=s4.getPosition=s4.isKeyboardEvent=s4.defaultStatusFormatter=s4.noop=void 0;var Zn=S1(),En=Nn(M7());function Nn(e){return e&&e.__esModule?e:{default:e}}var Rn=function(){};s4.noop=Rn;var Bn=function(t,i){return"".concat(t," of ").concat(i)};s4.defaultStatusFormatter=Bn;var zn=function(t){return t?t.hasOwnProperty("key"):!1};s4.isKeyboardEvent=zn;var yn=function(t,i){if(i.infiniteLoop&&++t,t===0)return 0;var l=Zn.Children.count(i.children);if(i.centerMode&&i.axis==="horizontal"){var r=-t*i.centerSlidePercentage,s=l-1;return t&&(t!==s||i.infiniteLoop)?r+=(100-i.centerSlidePercentage)/2:t===s&&(r+=100-i.centerSlidePercentage),r}return-t*100};s4.getPosition=yn;var bn=function(t,i){var l={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){l[r]=(0,En.default)(t,"%",i)}),l};s4.setPosition=bn});var Fe=q(E4=>{"use strict";Object.defineProperty(E4,"__esModule",{value:!0});E4.fadeAnimationHandler=E4.slideStopSwipingHandler=E4.slideSwipeAnimationHandler=E4.slideAnimationHandler=void 0;var be=S1(),Fn=Sn(M7()),Z4=e8();function Sn(e){return e&&e.__esModule?e:{default:e}}function ye(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,l)}return i}function m5(e){for(var t=1;ta);if(o)return s<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?l.itemListStyle=(0,Z4.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):l.itemListStyle=(0,Z4.setPosition)(-(a+2)*100,t.axis):s>a&&(l.itemListStyle=(0,Z4.setPosition)(0,t.axis)),l;var n=(0,Z4.getPosition)(r,t),C=(0,Fn.default)(n,"%",t.axis),c=t.transitionTime+"ms";return l.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},i.swiping||(l.itemListStyle=m5(m5({},l.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),l};E4.slideAnimationHandler=Tn;var Pn=function(t,i,l,r){var s={},a=i.axis==="horizontal",o=be.Children.count(i.children),n=0,C=(0,Z4.getPosition)(l.selectedItem,i),c=i.infiniteLoop?(0,Z4.getPosition)(o-1,i)-100:(0,Z4.getPosition)(o-1,i),m=a?t.x:t.y,h=m;C===n&&m>0&&(h=0),C===c&&m<0&&(h=0);var w=C+100/(l.itemSize/h),g=Math.abs(m)>i.swipeScrollTolerance;return i.infiniteLoop&&g&&(l.selectedItem===0&&w>-100?w-=o*100:l.selectedItem===o-1&&w<-o*100&&(w+=o*100)),(!i.preventMovementUntilSwipeScrollTolerance||g||l.swipeMovementStarted)&&(l.swipeMovementStarted||r({swipeMovementStarted:!0}),s.itemListStyle=(0,Z4.setPosition)(w,i.axis)),g&&!l.cancelClick&&r({cancelClick:!0}),s};E4.slideSwipeAnimationHandler=Pn;var An=function(t,i){var l=(0,Z4.getPosition)(i.selectedItem,t),r=(0,Z4.setPosition)(l,t.axis);return{itemListStyle:r}};E4.slideStopSwipingHandler=An;var Dn=function(t,i){var l=t.transitionTime+"ms",r="ease-in-out",s={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return i.swiping||(s=m5(m5({},s),{},{WebkitTransitionDuration:l,MozTransitionDuration:l,OTransitionDuration:l,transitionDuration:l,msTransitionDuration:l})),{slideStyle:s,selectedStyle:m5(m5({},s),{},{opacity:1,position:"relative"}),prevStyle:m5({},s)}};E4.fadeAnimationHandler=Dn});var Pe=q(F7=>{"use strict";Object.defineProperty(F7,"__esModule",{value:!0});F7.default=void 0;var N2=_n(S1()),In=S9($3()),P4=S9(K3()),On=S9(J3()),B7=S9(ze()),z7=S9(X3()),b9=e8(),y7=Fe();function S9(e){return e&&e.__esModule?e:{default:e}}function Te(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Te=function(){return e},e}function _n(e){if(e&&e.__esModule)return e;if(e===null||F9(e)!=="object"&&typeof e!="function")return{default:e};var t=Te();if(t&&t.has(e))return t.get(e);var i={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=l?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}function F9(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F9=function(i){return typeof i}:F9=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},F9(e)}function t8(){return t8=Object.assign||function(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),m2(H2(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),m2(H2(r),"moveTo",function(a){if(typeof a=="number"){var o=N2.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?o:0),a>o&&(a=r.props.infiniteLoop?0:o),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),m2(H2(r),"onClickNext",function(){r.increment(1)}),m2(H2(r),"onClickPrev",function(){r.decrement(1)}),m2(H2(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),m2(H2(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),m2(H2(r),"changeItem",function(a){return function(o){(!(0,b9.isKeyboardEvent)(o)||o.key==="Enter")&&r.moveTo(a)}}),m2(H2(r),"selectItem",function(a){r.setState(V4({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,N2.Children.toArray(r.props.children)[a.selectedItem])}),m2(H2(r),"getInitialImage",function(){var a=r.props.selectedItem,o=r.itemsRef&&r.itemsRef[a],n=o&&o.getElementsByTagName("img")||[];return n[0]}),m2(H2(r),"getVariableItemHeight",function(a){var o=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&o&&o.children.length){var n=o.children[0].getElementsByTagName("img")||[];if(n.length>0){var C=n[0];if(!C.complete){var c=function w(){r.forceUpdate(),C.removeEventListener("load",w)};C.addEventListener("load",c)}}var m=n[0]||o.children[0],h=m.clientHeight;return h>0?h:null}return null});var s={initialized:!1,previousItem:l.selectedItem,selectedItem:l.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:l.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof l.animationHandler=="function"&&l.animationHandler||l.animationHandler==="fade"&&y7.fadeAnimationHandler||y7.slideAnimationHandler,r.state=V4(V4({},s),r.animationHandler(l,s)),r}return Un(i,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,s){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),s.swiping&&!this.state.swiping&&this.setState(V4({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&N2.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var s=r.getInitialImage();s&&!s.complete?s.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,z7.default)().addEventListener("resize",this.updateSizes),(0,z7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,B7.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,z7.default)().removeEventListener("resize",this.updateSizes),(0,z7.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,B7.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var s=this;return this.props.children?N2.Children.map(this.props.children,function(a,o){var n=o===s.state.selectedItem,C=o===s.state.previousItem,c=n&&s.state.selectedStyle||C&&s.state.prevStyle||s.state.slideStyle||{};s.props.centerMode&&s.props.axis==="horizontal"&&(c=V4(V4({},c),{},{minWidth:s.props.centerSlidePercentage+"%"})),s.state.swiping&&s.state.swipeMovementStarted&&(c=V4(V4({},c),{},{pointerEvents:"none"}));var m={ref:function(w){return s.setItemsRef(w,o)},key:"itemKey"+o+(r?"clone":""),className:P4.default.ITEM(!0,o===s.state.selectedItem,o===s.state.previousItem),onClick:s.handleClickItem.bind(s,o,a),style:c};return N2.default.createElement("li",m,s.props.renderItem(a,{isSelected:o===s.state.selectedItem,isPrevious:o===s.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,s=this.props,a=s.showIndicators,o=s.labels,n=s.renderIndicator,C=s.children;return a?N2.default.createElement("ul",{className:"control-dots"},N2.Children.map(C,function(c,m){return n&&n(r.changeItem(m),m===r.state.selectedItem,m,o.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?N2.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,N2.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||N2.Children.count(this.props.children)===0?null:N2.default.createElement(On.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||N2.Children.count(this.props.children)===0)return null;var s=this.props.swipeable&&N2.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",o=this.props.showArrows&&N2.Children.count(this.props.children)>1,n=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,C=o&&(this.state.selectedItem{"use strict"});var Ie=q(k9=>{"use strict";Object.defineProperty(k9,"__esModule",{value:!0});Object.defineProperty(k9,"Carousel",{enumerable:!0,get:function(){return Xn.default}});Object.defineProperty(k9,"CarouselProps",{enumerable:!0,get:function(){return jn.CarouselProps}});Object.defineProperty(k9,"Thumbs",{enumerable:!0,get:function(){return Yn.default}});var Xn=De(Pe()),jn=Ae(),Yn=De(J3());function De(e){return e&&e.__esModule?e:{default:e}}});var _e=q((XV,Oe)=>{var Qn=o5(),Jn=function(){return Qn.Date.now()};Oe.exports=Jn});var Ue=q((jV,We)=>{var eC=/\s/;function tC(e){for(var t=e.length;t--&&eC.test(e.charAt(t)););return t}We.exports=tC});var qe=q((YV,Ge)=>{var iC=Ue(),lC=/^\s+/;function rC(e){return e&&e.slice(0,iC(e)+1).replace(lC,"")}Ge.exports=rC});var S7=q((QV,Xe)=>{var sC=qe(),$e=N9(),aC=en(),Ke=NaN,oC=/^[-+]0x[0-9a-f]+$/i,nC=/^0b[01]+$/i,CC=/^0o[0-7]+$/i,cC=parseInt;function mC(e){if(typeof e=="number")return e;if(aC(e))return Ke;if($e(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$e(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=sC(e);var i=nC.test(e);return i||CC.test(e)?cC(e.slice(2),i?2:8):oC.test(e)?Ke:+e}Xe.exports=mC});var k7=q((JV,Ye)=>{var wC=N9(),r8=_e(),je=S7(),hC="Expected a function",gC=Math.max,HC=Math.min;function LC(e,t,i){var l,r,s,a,o,n,C=0,c=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(hC);t=je(t)||0,wC(i)&&(c=!!i.leading,m="maxWait"in i,s=m?gC(je(i.maxWait)||0,t):s,h="trailing"in i?!!i.trailing:h);function w(R){var x=l,N=r;return l=r=void 0,C=R,a=e.apply(N,x),a}function g(R){return C=R,o=setTimeout(V,t),c?w(R):a}function L(R){var x=R-n,N=R-C,E=t-x;return m?HC(E,s-N):E}function v(R){var x=R-n,N=R-C;return n===void 0||x>=t||x<0||m&&N>=s}function V(){var R=r8();if(v(R))return u(R);o=setTimeout(V,L(R))}function u(R){return o=void 0,h&&l?w(R):(l=r=void 0,a)}function d(){o!==void 0&&clearTimeout(o),C=0,l=n=r=o=void 0}function p(){return o===void 0?a:u(r8())}function Z(){var R=r8(),x=v(R);if(l=arguments,r=this,n=R,x){if(o===void 0)return g(n);if(m)return clearTimeout(o),o=setTimeout(V,t),w(n)}return o===void 0&&(o=setTimeout(V,t)),a}return Z.cancel=d,Z.flush=p,Z}Ye.exports=LC});var _t=q((Id,Ot)=>{function $C(e,t,i){return e===e&&(i!==void 0&&(e=e<=i?e:i),t!==void 0&&(e=e>=t?e:t)),e}Ot.exports=$C});var G9=q((Od,Wt)=>{var KC=_t(),h8=S7();function XC(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=h8(i),i=i===i?i:0),t!==void 0&&(t=h8(t),t=t===t?t:0),KC(h8(e),t,i)}Wt.exports=XC});var Gt=q((_d,Ut)=>{var jC="__lodash_hash_undefined__";function YC(e){return this.__data__.set(e,jC),this}Ut.exports=YC});var $t=q((Wd,qt)=>{function QC(e){return this.__data__.has(e)}qt.exports=QC});var g8=q((Ud,Kt)=>{var JC=se(),ec=Gt(),tc=$t();function Q7(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new JC;++t{function ic(e,t,i,l){for(var r=e.length,s=i+(l?1:-1);l?s--:++s{function lc(e){return e!==e}Yt.exports=lc});var ei=q(($d,Jt)=>{function rc(e,t,i){for(var l=i-1,r=e.length;++l{var sc=jt(),ac=Qt(),oc=ei();function nc(e,t,i){return t===t?oc(e,t,i):sc(e,ac,i)}ti.exports=nc});var ri=q((Xd,li)=>{var Cc=ii();function cc(e,t){var i=e==null?0:e.length;return!!i&&Cc(e,t,0)>-1}li.exports=cc});var ai=q((jd,si)=>{function mc(e,t,i){for(var l=-1,r=e==null?0:e.length;++l{function wc(e,t){return e.has(t)}oi.exports=wc});var L8=q((Qd,ni)=>{var hc=R9(),gc=o5(),Hc=hc(gc,"Set");ni.exports=Hc});var ci=q((Jd,Ci)=>{function Lc(){}Ci.exports=Lc});var J7=q((eu,mi)=>{function Vc(e){var t=-1,i=Array(e.size);return e.forEach(function(l){i[++t]=l}),i}mi.exports=Vc});var hi=q((tu,wi)=>{var V8=L8(),dc=ci(),uc=J7(),vc=1/0,pc=V8&&1/uc(new V8([,-0]))[1]==vc?function(e){return new V8(e)}:dc;wi.exports=pc});var Hi=q((iu,gi)=>{var Mc=g8(),xc=ri(),fc=ai(),Zc=H8(),Ec=hi(),Nc=J7(),Rc=200;function Bc(e,t,i){var l=-1,r=xc,s=e.length,a=!0,o=[],n=o;if(i)a=!1,r=fc;else if(s>=Rc){var C=t?null:Ec(e);if(C)return Nc(C);a=!1,r=Zc,n=new Mc}else n=t?[]:o;e:for(;++l{var zc=Hi();function yc(e){return e&&e.length?zc(e):[]}Li.exports=yc});var d8=q((ru,di)=>{function bc(e,t){for(var i=-1,l=t.length,r=e.length;++i{var ui=J6(),Fc=ae(),Sc=q5(),vi=ui?ui.isConcatSpreadable:void 0;function kc(e){return Sc(e)||Fc(e)||!!(vi&&e&&e[vi])}pi.exports=kc});var Zi=q((au,fi)=>{var Tc=d8(),Pc=Mi();function xi(e,t,i,l,r){var s=-1,a=e.length;for(i||(i=Pc),r||(r=[]);++s0&&i(o)?t>1?xi(o,t-1,i,l,r):Tc(r,o):l||(r[r.length]=o)}return r}fi.exports=xi});var Ni=q((ou,Ei)=>{var Ac=Zi();function Dc(e){var t=e==null?0:e.length;return t?Ac(e,1):[]}Ei.exports=Dc});var Bi=q((nu,Ri)=>{var Ic=Math.ceil,Oc=Math.max;function _c(e,t,i,l){for(var r=-1,s=Oc(Ic((t-e)/(i||1)),0),a=Array(s);s--;)a[l?s:++r]=e,e+=i;return a}Ri.exports=_c});var e3=q((Cu,zi)=>{var Wc=tn(),Uc=ne();function Gc(e){return e!=null&&Uc(e.length)&&!Wc(e)}zi.exports=Gc});var bi=q((cu,yi)=>{var qc=le(),$c=e3(),Kc=oe(),Xc=N9();function jc(e,t,i){if(!Xc(i))return!1;var l=typeof t;return(l=="number"?$c(i)&&Kc(t,i.length):l=="string"&&t in i)?qc(i[t],e):!1}yi.exports=jc});var ki=q((mu,Si)=>{var Yc=S7(),Fi=1/0,Qc=17976931348623157e292;function Jc(e){if(!e)return e===0?e:0;if(e=Yc(e),e===Fi||e===-Fi){var t=e<0?-1:1;return t*Qc}return e===e?e:0}Si.exports=Jc});var Pi=q((wu,Ti)=>{var em=Bi(),tm=bi(),u8=ki();function im(e){return function(t,i,l){return l&&typeof l!="number"&&tm(t,i,l)&&(i=l=void 0),t=u8(t),i===void 0?(i=t,t=0):i=u8(i),l=l===void 0?t{var lm=Pi(),rm=lm();Ai.exports=rm});var Ki=q((Uu,$i)=>{var Pm=R9(),Am=function(){try{var e=Pm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();$i.exports=Am});var Yi=q((Gu,ji)=>{var Xi=Ki();function Dm(e,t,i){t=="__proto__"&&Xi?Xi(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}ji.exports=Dm});var Ji=q((qu,Qi)=>{function Im(e,t,i,l){for(var r=-1,s=e==null?0:e.length;++r{function Om(e){return function(t,i,l){for(var r=-1,s=Object(t),a=l(t),o=a.length;o--;){var n=a[e?o:++r];if(i(s[n],n,s)===!1)break}return t}}el.exports=Om});var ll=q((Ku,il)=>{var _m=tl(),Wm=_m();il.exports=Wm});var sl=q((Xu,rl)=>{function Um(e,t){for(var i=-1,l=Array(e);++i{function Gm(){return!1}al.exports=Gm});var B8=q((K9,r9)=>{var qm=o5(),$m=ol(),cl=typeof K9=="object"&&K9&&!K9.nodeType&&K9,nl=cl&&typeof r9=="object"&&r9&&!r9.nodeType&&r9,Km=nl&&nl.exports===cl,Cl=Km?qm.Buffer:void 0,Xm=Cl?Cl.isBuffer:void 0,jm=Xm||$m;r9.exports=jm});var wl=q((Yu,ml)=>{var Ym=ee(),Qm=ne(),Jm=te(),ew="[object Arguments]",tw="[object Array]",iw="[object Boolean]",lw="[object Date]",rw="[object Error]",sw="[object Function]",aw="[object Map]",ow="[object Number]",nw="[object Object]",Cw="[object RegExp]",cw="[object Set]",mw="[object String]",ww="[object WeakMap]",hw="[object ArrayBuffer]",gw="[object DataView]",Hw="[object Float32Array]",Lw="[object Float64Array]",Vw="[object Int8Array]",dw="[object Int16Array]",uw="[object Int32Array]",vw="[object Uint8Array]",pw="[object Uint8ClampedArray]",Mw="[object Uint16Array]",xw="[object Uint32Array]",G2={};G2[Hw]=G2[Lw]=G2[Vw]=G2[dw]=G2[uw]=G2[vw]=G2[pw]=G2[Mw]=G2[xw]=!0;G2[ew]=G2[tw]=G2[hw]=G2[iw]=G2[gw]=G2[lw]=G2[rw]=G2[sw]=G2[aw]=G2[ow]=G2[nw]=G2[Cw]=G2[cw]=G2[mw]=G2[ww]=!1;function fw(e){return Jm(e)&&Qm(e.length)&&!!G2[Ym(e)]}ml.exports=fw});var gl=q((Qu,hl)=>{function Zw(e){return function(t){return e(t)}}hl.exports=Zw});var Ll=q((X9,s9)=>{var Ew=Jo(),Hl=typeof X9=="object"&&X9&&!X9.nodeType&&X9,j9=Hl&&typeof s9=="object"&&s9&&!s9.nodeType&&s9,Nw=j9&&j9.exports===Hl,z8=Nw&&Ew.process,Rw=function(){try{var e=j9&&j9.require&&j9.require("util").types;return e||z8&&z8.binding&&z8.binding("util")}catch(t){}}();s9.exports=Rw});var y8=q((Ju,ul)=>{var Bw=wl(),zw=gl(),Vl=Ll(),dl=Vl&&Vl.isTypedArray,yw=dl?zw(dl):Bw;ul.exports=yw});var pl=q((ev,vl)=>{var bw=sl(),Fw=ae(),Sw=q5(),kw=B8(),Tw=oe(),Pw=y8(),Aw=Object.prototype,Dw=Aw.hasOwnProperty;function Iw(e,t){var i=Sw(e),l=!i&&Fw(e),r=!i&&!l&&kw(e),s=!i&&!l&&!r&&Pw(e),a=i||l||r||s,o=a?bw(e.length,String):[],n=o.length;for(var C in e)(t||Dw.call(e,C))&&!(a&&(C=="length"||r&&(C=="offset"||C=="parent")||s&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||Tw(C,n)))&&o.push(C);return o}vl.exports=Iw});var xl=q((tv,Ml)=>{var Ow=Object.prototype;function _w(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Ow;return e===i}Ml.exports=_w});var Zl=q((iv,fl)=>{function Ww(e,t){return function(i){return e(t(i))}}fl.exports=Ww});var Nl=q((lv,El)=>{var Uw=Zl(),Gw=Uw(Object.keys,Object);El.exports=Gw});var Bl=q((rv,Rl)=>{var qw=xl(),$w=Nl(),Kw=Object.prototype,Xw=Kw.hasOwnProperty;function jw(e){if(!qw(e))return $w(e);var t=[];for(var i in Object(e))Xw.call(e,i)&&i!="constructor"&&t.push(i);return t}Rl.exports=jw});var s3=q((sv,zl)=>{var Yw=pl(),Qw=Bl(),Jw=e3();function eh(e){return Jw(e)?Yw(e):Qw(e)}zl.exports=eh});var bl=q((av,yl)=>{var th=ll(),ih=s3();function lh(e,t){return e&&th(e,t,ih)}yl.exports=lh});var Sl=q((ov,Fl)=>{var rh=e3();function sh(e,t){return function(i,l){if(i==null)return i;if(!rh(i))return e(i,l);for(var r=i.length,s=t?r:-1,a=Object(i);(t?s--:++s{var ah=bl(),oh=Sl(),nh=oh(ah);kl.exports=nh});var Al=q((Cv,Pl)=>{var Ch=Tl();function ch(e,t,i,l){return Ch(e,function(r,s,a){t(l,r,i(r),a)}),l}Pl.exports=ch});var Il=q((cv,Dl)=>{var mh=O3();function wh(){this.__data__=new mh,this.size=0}Dl.exports=wh});var _l=q((mv,Ol)=>{function hh(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}Ol.exports=hh});var Ul=q((wv,Wl)=>{function gh(e){return this.__data__.get(e)}Wl.exports=gh});var ql=q((hv,Gl)=>{function Hh(e){return this.__data__.has(e)}Gl.exports=Hh});var Kl=q((gv,$l)=>{var Lh=O3(),Vh=re(),dh=se(),uh=200;function vh(e,t){var i=this.__data__;if(i instanceof Lh){var l=i.__data__;if(!Vh||l.length{var ph=O3(),Mh=Il(),xh=_l(),fh=Ul(),Zh=ql(),Eh=Kl();function a9(e){var t=this.__data__=new ph(e);this.size=t.size}a9.prototype.clear=Mh;a9.prototype.delete=xh;a9.prototype.get=fh;a9.prototype.has=Zh;a9.prototype.set=Eh;Xl.exports=a9});var Yl=q((Lv,jl)=>{function Nh(e,t){for(var i=-1,l=e==null?0:e.length;++i{var Rh=g8(),Bh=Yl(),zh=H8(),yh=1,bh=2;function Fh(e,t,i,l,r,s){var a=i&yh,o=e.length,n=t.length;if(o!=n&&!(a&&n>o))return!1;var C=s.get(e),c=s.get(t);if(C&&c)return C==t&&c==e;var m=-1,h=!0,w=i&bh?new Rh:void 0;for(s.set(e,t),s.set(t,e);++m{var Sh=o5(),kh=Sh.Uint8Array;Jl.exports=kh});var ir=q((uv,tr)=>{function Th(e){var t=-1,i=Array(e.size);return e.forEach(function(l,r){i[++t]=[r,l]}),i}tr.exports=Th});var or=q((vv,ar)=>{var lr=J6(),rr=er(),Ph=le(),Ah=F8(),Dh=ir(),Ih=J7(),Oh=1,_h=2,Wh="[object Boolean]",Uh="[object Date]",Gh="[object Error]",qh="[object Map]",$h="[object Number]",Kh="[object RegExp]",Xh="[object Set]",jh="[object String]",Yh="[object Symbol]",Qh="[object ArrayBuffer]",Jh="[object DataView]",sr=lr?lr.prototype:void 0,S8=sr?sr.valueOf:void 0;function eg(e,t,i,l,r,s,a){switch(i){case Jh:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Qh:return!(e.byteLength!=t.byteLength||!s(new rr(e),new rr(t)));case Wh:case Uh:case $h:return Ph(+e,+t);case Gh:return e.name==t.name&&e.message==t.message;case Kh:case jh:return e==t+"";case qh:var o=Dh;case Xh:var n=l&Oh;if(o||(o=Ih),e.size!=t.size&&!n)return!1;var C=a.get(e);if(C)return C==t;l|=_h,a.set(e,t);var c=Ah(o(e),o(t),l,r,s,a);return a.delete(e),c;case Yh:if(S8)return S8.call(e)==S8.call(t)}return!1}ar.exports=eg});var Cr=q((pv,nr)=>{var tg=d8(),ig=q5();function lg(e,t,i){var l=t(e);return ig(e)?l:tg(l,i(e))}nr.exports=lg});var mr=q((Mv,cr)=>{function rg(e,t){for(var i=-1,l=e==null?0:e.length,r=0,s=[];++i{function sg(){return[]}wr.exports=sg});var Lr=q((fv,Hr)=>{var ag=mr(),og=hr(),ng=Object.prototype,Cg=ng.propertyIsEnumerable,gr=Object.getOwnPropertySymbols,cg=gr?function(e){return e==null?[]:(e=Object(e),ag(gr(e),function(t){return Cg.call(e,t)}))}:og;Hr.exports=cg});var dr=q((Zv,Vr)=>{var mg=Cr(),wg=Lr(),hg=s3();function gg(e){return mg(e,hg,wg)}Vr.exports=gg});var pr=q((Ev,vr)=>{var ur=dr(),Hg=1,Lg=Object.prototype,Vg=Lg.hasOwnProperty;function dg(e,t,i,l,r,s){var a=i&Hg,o=ur(e),n=o.length,C=ur(t),c=C.length;if(n!=c&&!a)return!1;for(var m=n;m--;){var h=o[m];if(!(a?h in t:Vg.call(t,h)))return!1}var w=s.get(e),g=s.get(t);if(w&&g)return w==t&&g==e;var L=!0;s.set(e,t),s.set(t,e);for(var v=a;++m{var ug=R9(),vg=o5(),pg=ug(vg,"DataView");Mr.exports=pg});var Zr=q((Rv,fr)=>{var Mg=R9(),xg=o5(),fg=Mg(xg,"Promise");fr.exports=fg});var Nr=q((Bv,Er)=>{var Zg=R9(),Eg=o5(),Ng=Zg(Eg,"WeakMap");Er.exports=Ng});var kr=q((zv,Sr)=>{var k8=xr(),T8=re(),P8=Zr(),A8=L8(),D8=Nr(),Fr=ee(),o9=ln(),Rr="[object Map]",Rg="[object Object]",Br="[object Promise]",zr="[object Set]",yr="[object WeakMap]",br="[object DataView]",Bg=o9(k8),zg=o9(T8),yg=o9(P8),bg=o9(A8),Fg=o9(D8),p5=Fr;(k8&&p5(new k8(new ArrayBuffer(1)))!=br||T8&&p5(new T8)!=Rr||P8&&p5(P8.resolve())!=Br||A8&&p5(new A8)!=zr||D8&&p5(new D8)!=yr)&&(p5=function(e){var t=Fr(e),i=t==Rg?e.constructor:void 0,l=i?o9(i):"";if(l)switch(l){case Bg:return br;case zg:return Rr;case yg:return Br;case bg:return zr;case Fg:return yr}return t});Sr.exports=p5});var Wr=q((yv,_r)=>{var I8=b8(),Sg=F8(),kg=or(),Tg=pr(),Tr=kr(),Pr=q5(),Ar=B8(),Pg=y8(),Ag=1,Dr="[object Arguments]",Ir="[object Array]",a3="[object Object]",Dg=Object.prototype,Or=Dg.hasOwnProperty;function Ig(e,t,i,l,r,s){var a=Pr(e),o=Pr(t),n=a?Ir:Tr(e),C=o?Ir:Tr(t);n=n==Dr?a3:n,C=C==Dr?a3:C;var c=n==a3,m=C==a3,h=n==C;if(h&&Ar(e)){if(!Ar(t))return!1;a=!0,c=!1}if(h&&!c)return s||(s=new I8),a||Pg(e)?Sg(e,t,i,l,r,s):kg(e,t,n,i,l,r,s);if(!(i&Ag)){var w=c&&Or.call(e,"__wrapped__"),g=m&&Or.call(t,"__wrapped__");if(w||g){var L=w?e.value():e,v=g?t.value():t;return s||(s=new I8),r(L,v,i,l,s)}}return h?(s||(s=new I8),Tg(e,t,i,l,r,s)):!1}_r.exports=Ig});var O8=q((bv,qr)=>{var Og=Wr(),Ur=te();function Gr(e,t,i,l,r){return e===t?!0:e==null||t==null||!Ur(e)&&!Ur(t)?e!==e&&t!==t:Og(e,t,i,l,Gr,r)}qr.exports=Gr});var Kr=q((Fv,$r)=>{var _g=b8(),Wg=O8(),Ug=1,Gg=2;function qg(e,t,i,l){var r=i.length,s=r,a=!l;if(e==null)return!s;for(e=Object(e);r--;){var o=i[r];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r{var $g=N9();function Kg(e){return e===e&&!$g(e)}Xr.exports=Kg});var Yr=q((kv,jr)=>{var Xg=_8(),jg=s3();function Yg(e){for(var t=jg(e),i=t.length;i--;){var l=t[i],r=e[l];t[i]=[l,r,Xg(r)]}return t}jr.exports=Yg});var W8=q((Tv,Qr)=>{function Qg(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}Qr.exports=Qg});var es=q((Pv,Jr)=>{var Jg=Kr(),eH=Yr(),tH=W8();function iH(e){var t=eH(e);return t.length==1&&t[0][2]?tH(t[0][0],t[0][1]):function(i){return i===e||Jg(i,e,t)}}Jr.exports=iH});var U8=q((Av,ts)=>{var lH=rn(),rH=_3();function sH(e,t){t=lH(t,e);for(var i=0,l=t.length;e!=null&&i{var aH=U8();function oH(e,t,i){var l=e==null?void 0:aH(e,t);return l===void 0?i:l}is.exports=oH});var ss=q((Iv,rs)=>{function nH(e,t){return e!=null&&t in Object(e)}rs.exports=nH});var os=q((Ov,as)=>{var CH=ss(),cH=sn();function mH(e,t){return e!=null&&cH(e,t,CH)}as.exports=mH});var Cs=q((_v,ns)=>{var wH=O8(),hH=ls(),gH=os(),HH=ie(),LH=_8(),VH=W8(),dH=_3(),uH=1,vH=2;function pH(e,t){return HH(e)&&LH(t)?VH(dH(e),t):function(i){var l=hH(i,e);return l===void 0&&l===t?gH(i,e):wH(t,l,uH|vH)}}ns.exports=pH});var ms=q((Wv,cs)=>{function MH(e){return e}cs.exports=MH});var hs=q((Uv,ws)=>{function xH(e){return function(t){return t==null?void 0:t[e]}}ws.exports=xH});var Hs=q((Gv,gs)=>{var fH=U8();function ZH(e){return function(t){return fH(t,e)}}gs.exports=ZH});var Vs=q((qv,Ls)=>{var EH=hs(),NH=Hs(),RH=ie(),BH=_3();function zH(e){return RH(e)?EH(BH(e)):NH(e)}Ls.exports=zH});var us=q(($v,ds)=>{var yH=es(),bH=Cs(),FH=ms(),SH=q5(),kH=Vs();function TH(e){return typeof e=="function"?e:e==null?FH:typeof e=="object"?SH(e)?bH(e[0],e[1]):yH(e):kH(e)}ds.exports=TH});var ps=q((Kv,vs)=>{var PH=Ji(),AH=Al(),DH=us(),IH=q5();function OH(e,t){return function(i,l){var r=IH(i)?PH:AH,s=t?t():{};return r(i,e,DH(l,2),s)}}vs.exports=OH});var xs=q((Xv,Ms)=>{var _H=Yi(),WH=ps(),UH=Object.prototype,GH=UH.hasOwnProperty,qH=WH(function(e,t,i){GH.call(e,i)?e[i].push(t):_H(e,i,[t])});Ms.exports=qH});var Wa=q((rZ,_a)=>{var qL=k7(),$L=N9(),KL="Expected a function";function XL(e,t,i){var l=!0,r=!0;if(typeof e!="function")throw new TypeError(KL);return $L(i)&&(l="leading"in i?!!i.leading:l,r="trailing"in i?!!i.trailing:r),qL(e,t,{leading:l,maxWait:t,trailing:r})}_a.exports=XL});var fo=M1(S1()),Zo=M1(ge());var w2=M1(S1());var g5=M1(S1(),1);var He=Q2("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var lt=M1(Ie(),1);var J2=M1(S1(),1),Qe=M1(k7(),1);function n0(e,t,i,l,r=!1){let s=J2.useRef();s.current=t,J2.useEffect(()=>{if(i===null||i.addEventListener===void 0)return;let a=i,o=n=>{var C;(C=s.current)==null||C.call(a,n)};return a.addEventListener(e,o,{passive:l,capture:r}),()=>{a.removeEventListener(e,o,{capture:r})}},[e,i,l,r])}function h5(e,t){return e===void 0?void 0:t}var VC=Math.PI;function s8(e){return e*VC/180}var P7=(e,t,i)=>({x1:e-i/2,y1:t-i/2,x2:e+i/2,y2:t+i/2}),A7=(e,t,i,l,r)=>{switch(e){case"left":return Math.floor(t)+l+r/2;case"center":return Math.floor(t+i/2);case"right":return Math.floor(t+i)-l-r/2}},D7=(e,t,i)=>Math.min(e,t-i*2),I7=(e,t,i)=>i.x1<=e&&e<=i.x2&&i.y1<=t&&t<=i.y2,j5=e=>{var i;let t=(i=e.fgColor)!=null?i:"currentColor";return J2.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J2.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),J2.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Je=e=>{var i;let t=(i=e.fgColor)!=null?i:"currentColor";return J2.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},J2.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function et(e,t,i){let[l,r]=J2.useState(e),s=J2.useRef(!0);J2.useEffect(()=>()=>{s.current=!1},[]);let a=J2.useRef((0,Qe.default)(o=>{s.current&&r(o)},i));return J2.useLayoutEffect(()=>{s.current&&a.current(()=>e())},t),l}var dC="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",uC="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",vC=new RegExp("^[^"+uC+"]*["+dC+"]");function Y5(e){return vC.test(e)?"rtl":"not-rtl"}var T7;function T9(){if(typeof document=="undefined")return 0;if(T7!==void 0)return T7;let e=document.createElement("p");e.style.width="100%",e.style.height="200px";let t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);let i=e.offsetWidth;t.style.overflow="scroll";let l=e.offsetWidth;return i===l&&(l=t.clientWidth),t.remove(),T7=i-l,T7}var w5=Symbol();function tt(e){let t=J2.useRef([w5,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[i,l]=J2.useState(e),[,r]=J2.useState(),s=J2.useCallback(o=>{let n=t.current[0];n!==w5&&(o=typeof o=="function"?o(n):o,o===n)||(n!==w5&&r({}),l(C=>typeof o=="function"?o(n===w5?C:n):o),t.current[0]=w5)},[]),a=J2.useCallback(()=>{t.current[0]=w5,r({})},[]);return[t.current[0]===w5?i:t.current[0],s,a]}function O7(e){if(e.length===0)return"";let t=0,i=0;for(let l of e){if(i+=l.length,i>1e4)break;t++}return e.slice(0,t).join(", ")}function it(e){let t=J2.useRef(e);return a5(e,t.current)||(t.current=e),t.current}var rt=e=>{let{urls:t,canWrite:i,onEditClick:l,renderImage:r}=e,s=t.filter(o=>o!=="");if(s.length===0)return null;let a=s.length>1;return g5.createElement(He,{"data-testid":"GDG-default-image-overlay-editor"},g5.createElement(lt.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},s.map(o=>{var C;let n=(C=r==null?void 0:r(o))!=null?C:g5.createElement("img",{draggable:!1,src:o});return g5.createElement("div",{className:"gdg-centering-container",key:o},n)})),i&&l&&g5.createElement("button",{className:"gdg-edit-icon",onClick:l},g5.createElement(j5,null)))};var a8=M1(S1(),1);function mt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var V5=mt();function pC(e){V5=e}var wt=/[&<>"']/,MC=new RegExp(wt.source,"g"),ht=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,xC=new RegExp(ht.source,"g"),fC={"&":"&","<":"<",">":">",'"':""","'":"'"},st=e=>fC[e];function R0(e,t){if(t){if(wt.test(e))return e.replace(MC,st)}else if(ht.test(e))return e.replace(xC,st);return e}var ZC=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function gt(e){return e.replace(ZC,(t,i)=>(i=i.toLowerCase(),i==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}var EC=/(^|[^\[])\^/g;function S2(e,t){e=typeof e=="string"?e:e.source,t=t||"";let i={replace:(l,r)=>(r=r.source||r,r=r.replace(EC,"$1"),e=e.replace(l,r),i),getRegex:()=>new RegExp(e,t)};return i}var NC=/[^\w:]/g,RC=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function at(e,t,i){if(e){let l;try{l=decodeURIComponent(gt(i)).replace(NC,"").toLowerCase()}catch(r){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}t&&!RC.test(i)&&(i=bC(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(l){return null}return i}var _7={},BC=/^[^:]+:\/*[^/]*$/,zC=/^([^:]+:)[\s\S]*$/,yC=/^([^:]+:\/*[^/]*)[\s\S]*$/;function bC(e,t){_7[" "+e]||(BC.test(e)?_7[" "+e]=e+"/":_7[" "+e]=W7(e,"/",!0)),e=_7[" "+e];let i=e.indexOf(":")===-1;return t.substring(0,2)==="//"?i?t:e.replace(zC,"$1")+t:t.charAt(0)==="/"?i?t:e.replace(yC,"$1")+t:e+t}var U7={exec:function(){}};function ot(e,t){let i=e.replace(/\|/g,(s,a,o)=>{let n=!1,C=a;for(;--C>=0&&o[C]==="\\";)n=!n;return n?"|":" |"}),l=i.split(/ \|/),r=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>t)l.splice(t);else for(;l.length1;)t&1&&(i+=e),t>>=1,e+=e;return i+e}function Ct(e,t,i,l){let r=t.href,s=t.title?R0(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){l.state.inLink=!0;let o={type:"link",raw:i,href:r,title:s,text:a,tokens:l.inlineTokens(a)};return l.state.inLink=!1,o}return{type:"image",raw:i,href:r,title:s,text:R0(a)}}function kC(e,t){let i=e.match(/^(\s+)(?:```)/);if(i===null)return t;let l=i[1];return t.split(` +import{A as sn,B as q5,C as $5,D as c1,E as a5,F as W3,G as R9,H as U3,I as K5,J as S4,K as o5,L as Ce,M as B9,N as l4,O as M2,P as y0,Q as G3,R as b0,S as ce,T as H7,U as me,V as r4,W as we,a as Y6,b as d0,c as l5,d as Q6,e as r5,f as G5,g as Jo,h as s5,i as J6,j as ee,k as te,l as en,m as ie,n as E9,o as tn,p as ln,q as N9,r as le,s as O3,t as re,u as se,v as rn,w as ae,x as oe,y as ne,z as _3}from"./chunk-IM7H4ZGK.js";import{a as B,b as S,c as i0,d as $,e as x1,f as i2,g as F1,h as K2}from"./chunk-37AHYJRG.js";var ge=$(q3=>{"use strict";var he=Y6();q3.createRoot=he.createRoot,q3.hydrateRoot=he.hydrateRoot;var ZV});var Ve=$((BV,Le)=>{"use strict";var an="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Le.exports=an});var pe=$((zV,ve)=>{"use strict";var on=Ve();function de(){}function ue(){}ue.resetWarningCache=de;ve.exports=function(){function e(l,r,s,a,o,n){if(n!==on){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}e.isRequired=e;function t(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ue,resetWarningCache:de};return i.PropTypes=i,i}});var xe=$((FV,Me)=>{Me.exports=pe()();var yV,bV});var fe=$(L7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","react","prop-types"],t);else if(typeof L7!="undefined")t(L7,F1(),xe());else{var i={exports:{}};t(i.exports,e.react,e.propTypes),e.reactSwipe=i.exports}})(L7,function(e,t,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=w;var l=s(t),r=s(i);function s(V){return V&&V.__esModule?V:{default:V}}var a=Object.assign||function(V){for(var u=1;u=0||Object.prototype.hasOwnProperty.call(V,p)&&(d[p]=V[p]);return d}function n(V,u){if(!(V instanceof u))throw new TypeError("Cannot call a class as a function")}var C=function(){function V(u,d){for(var p=0;p0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?V:V.capture}function L(V){if("touches"in V){var u=V.touches[0],d=u.pageX,p=u.pageY;return{x:d,y:p}}var Z=V.screenX,R=V.screenY;return{x:Z,y:R}}var v=function(V){m(u,V);function u(){var d;n(this,u);for(var p=arguments.length,Z=Array(p),R=0;RZ&&this.props.onSwipeRight(1,p),this.movePosition.deltaY<-Z?this.props.onSwipeUp(1,p):this.movePosition.deltaY>Z&&this.props.onSwipeDown(1,p)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(p){this.swiper=p,this.props.innerRef(p)}},{key:"render",value:function(){var p=this.props,Z=p.tagName,R=p.className,x=p.style,N=p.children,E=p.allowMouseEvents,b=p.onSwipeUp,A=p.onSwipeDown,k=p.onSwipeLeft,P=p.onSwipeRight,z=p.onSwipeStart,_=p.onSwipeMove,j=p.onSwipeEnd,a1=p.innerRef,m1=p.tolerance,g1=o(p,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return l.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:x},g1),N)}}]),u}(t.Component);v.displayName="ReactSwipe",v.propTypes={tagName:r.default.string,className:r.default.string,style:r.default.object,children:r.default.node,allowMouseEvents:r.default.bool,onSwipeUp:r.default.func,onSwipeDown:r.default.func,onSwipeLeft:r.default.func,onSwipeRight:r.default.func,onSwipeStart:r.default.func,onSwipeMove:r.default.func,onSwipeEnd:r.default.func,innerRef:r.default.func,tolerance:r.default.number.isRequired},v.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=v})});var $3=$(V7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","./react-swipe"],t);else if(typeof V7!="undefined")t(V7,fe());else{var i={exports:{}};t(i.exports,e.reactSwipe),e.index=i.exports}})(V7,function(e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=l(t);function l(r){return r&&r.__esModule?r:{default:r}}e.default=i.default})});var Ze=$((TV,d7)=>{(function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r="",s=0;s{"use strict";Object.defineProperty(u7,"__esModule",{value:!0});u7.default=void 0;var U4=nn(Ze());function nn(e){return e&&e.__esModule?e:{default:e}}function Cn(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var cn={ROOT:function(t){return(0,U4.default)(Cn({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,U4.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,i){return(0,U4.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(t,i){return(0,U4.default)({thumbs:!t,slider:t,animated:!i})},ITEM:function(t,i,l){return(0,U4.default)({thumb:!t,slide:t,selected:i,previous:l})},ARROW_PREV:function(t){return(0,U4.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,U4.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,U4.default)({dot:!0,selected:t})}};u7.default=cn});var Ee=$(v7=>{"use strict";Object.defineProperty(v7,"__esModule",{value:!0});v7.outerWidth=void 0;var mn=function(t){var i=t.offsetWidth,l=getComputedStyle(t);return i+=parseInt(l.marginLeft)+parseInt(l.marginRight),i};v7.outerWidth=mn});var M7=$(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;var wn=function(t,i,l){var r=t===0?t:t+i,s=l==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",o="("+s.join(",")+")";return a+o};p7.default=wn});var X3=$(x7=>{"use strict";Object.defineProperty(x7,"__esModule",{value:!0});x7.default=void 0;var hn=function(){return window};x7.default=hn});var J3=$(N7=>{"use strict";Object.defineProperty(N7,"__esModule",{value:!0});N7.default=void 0;var h4=Ln(F1()),n5=E7(K3()),gn=Ee(),Ne=E7(M7()),Hn=E7($3()),f7=E7(X3());function E7(e){return e&&e.__esModule?e:{default:e}}function Be(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Be=function(){return e},e}function Ln(e){if(e&&e.__esModule)return e;if(e===null||z9(e)!=="object"&&typeof e!="function")return{default:e};var t=Be();if(t&&t.has(e))return t.get(e);var i={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=l?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}function z9(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z9=function(i){return typeof i}:z9=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},z9(e)}function j3(){return j3=Object.assign||function(e){for(var t=1;t0&&(a=0),C===m&&a<0&&(a=0);var h=r.itemsWrapperRef.clientWidth,w=C+100/(h/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){r.itemsListRef.style[g]=(0,Ne.default)(w,"%",r.props.axis)}),!0}),R0(F0(r),"slideRight",function(s){r.moveTo(r.state.firstItem-(typeof s=="number"?s:1))}),R0(F0(r),"slideLeft",function(s){r.moveTo(r.state.firstItem+(typeof s=="number"?s:1))}),R0(F0(r),"moveTo",function(s){s=s<0?0:s,s=s>=r.state.lastPosition?r.state.lastPosition:s,r.setState({firstItem:s})}),r.state={selectedItem:l.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return dn(i,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,f7.default)().addEventListener("resize",this.updateSizes),(0,f7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,f7.default)().removeEventListener("resize",this.updateSizes),(0,f7.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var s=r;return r>=this.state.lastPosition&&(s=this.state.lastPosition),r1,a=this.state.showArrows&&this.state.firstItem>0,o=this.state.showArrows&&this.state.firstItem{"use strict";Object.defineProperty(R7,"__esModule",{value:!0});R7.default=void 0;var fn=function(){return document};R7.default=fn});var e8=$(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});s4.setPosition=s4.getPosition=s4.isKeyboardEvent=s4.defaultStatusFormatter=s4.noop=void 0;var Zn=F1(),En=Nn(M7());function Nn(e){return e&&e.__esModule?e:{default:e}}var Rn=function(){};s4.noop=Rn;var Bn=function(t,i){return"".concat(t," of ").concat(i)};s4.defaultStatusFormatter=Bn;var zn=function(t){return t?t.hasOwnProperty("key"):!1};s4.isKeyboardEvent=zn;var yn=function(t,i){if(i.infiniteLoop&&++t,t===0)return 0;var l=Zn.Children.count(i.children);if(i.centerMode&&i.axis==="horizontal"){var r=-t*i.centerSlidePercentage,s=l-1;return t&&(t!==s||i.infiniteLoop)?r+=(100-i.centerSlidePercentage)/2:t===s&&(r+=100-i.centerSlidePercentage),r}return-t*100};s4.getPosition=yn;var bn=function(t,i){var l={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){l[r]=(0,En.default)(t,"%",i)}),l};s4.setPosition=bn});var Fe=$(M4=>{"use strict";Object.defineProperty(M4,"__esModule",{value:!0});M4.fadeAnimationHandler=M4.slideStopSwipingHandler=M4.slideSwipeAnimationHandler=M4.slideAnimationHandler=void 0;var be=F1(),Fn=Sn(M7()),p4=e8();function Sn(e){return e&&e.__esModule?e:{default:e}}function ye(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),i.push.apply(i,l)}return i}function C5(e){for(var t=1;ta);if(o)return s<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?l.itemListStyle=(0,p4.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):l.itemListStyle=(0,p4.setPosition)(-(a+2)*100,t.axis):s>a&&(l.itemListStyle=(0,p4.setPosition)(0,t.axis)),l;var n=(0,p4.getPosition)(r,t),C=(0,Fn.default)(n,"%",t.axis),c=t.transitionTime+"ms";return l.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},i.swiping||(l.itemListStyle=C5(C5({},l.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),l};M4.slideAnimationHandler=Tn;var Pn=function(t,i,l,r){var s={},a=i.axis==="horizontal",o=be.Children.count(i.children),n=0,C=(0,p4.getPosition)(l.selectedItem,i),c=i.infiniteLoop?(0,p4.getPosition)(o-1,i)-100:(0,p4.getPosition)(o-1,i),m=a?t.x:t.y,h=m;C===n&&m>0&&(h=0),C===c&&m<0&&(h=0);var w=C+100/(l.itemSize/h),g=Math.abs(m)>i.swipeScrollTolerance;return i.infiniteLoop&&g&&(l.selectedItem===0&&w>-100?w-=o*100:l.selectedItem===o-1&&w<-o*100&&(w+=o*100)),(!i.preventMovementUntilSwipeScrollTolerance||g||l.swipeMovementStarted)&&(l.swipeMovementStarted||r({swipeMovementStarted:!0}),s.itemListStyle=(0,p4.setPosition)(w,i.axis)),g&&!l.cancelClick&&r({cancelClick:!0}),s};M4.slideSwipeAnimationHandler=Pn;var An=function(t,i){var l=(0,p4.getPosition)(i.selectedItem,t),r=(0,p4.setPosition)(l,t.axis);return{itemListStyle:r}};M4.slideStopSwipingHandler=An;var Dn=function(t,i){var l=t.transitionTime+"ms",r="ease-in-out",s={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return i.swiping||(s=C5(C5({},s),{},{WebkitTransitionDuration:l,MozTransitionDuration:l,OTransitionDuration:l,transitionDuration:l,msTransitionDuration:l})),{slideStyle:s,selectedStyle:C5(C5({},s),{},{opacity:1,position:"relative"}),prevStyle:C5({},s)}};M4.fadeAnimationHandler=Dn});var Pe=$(F7=>{"use strict";Object.defineProperty(F7,"__esModule",{value:!0});F7.default=void 0;var R2=_n(F1()),In=F9($3()),k4=F9(K3()),On=F9(J3()),B7=F9(ze()),z7=F9(X3()),y9=e8(),y7=Fe();function F9(e){return e&&e.__esModule?e:{default:e}}function Te(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Te=function(){return e},e}function _n(e){if(e&&e.__esModule)return e;if(e===null||b9(e)!=="object"&&typeof e!="function")return{default:e};var t=Te();if(t&&t.has(e))return t.get(e);var i={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=l?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}function b9(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?b9=function(i){return typeof i}:b9=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},b9(e)}function t8(){return t8=Object.assign||function(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),C2(h2(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),C2(h2(r),"moveTo",function(a){if(typeof a=="number"){var o=R2.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?o:0),a>o&&(a=r.props.infiniteLoop?0:o),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),C2(h2(r),"onClickNext",function(){r.increment(1)}),C2(h2(r),"onClickPrev",function(){r.decrement(1)}),C2(h2(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),C2(h2(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),C2(h2(r),"changeItem",function(a){return function(o){(!(0,y9.isKeyboardEvent)(o)||o.key==="Enter")&&r.moveTo(a)}}),C2(h2(r),"selectItem",function(a){r.setState(g4({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,R2.Children.toArray(r.props.children)[a.selectedItem])}),C2(h2(r),"getInitialImage",function(){var a=r.props.selectedItem,o=r.itemsRef&&r.itemsRef[a],n=o&&o.getElementsByTagName("img")||[];return n[0]}),C2(h2(r),"getVariableItemHeight",function(a){var o=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&o&&o.children.length){var n=o.children[0].getElementsByTagName("img")||[];if(n.length>0){var C=n[0];if(!C.complete){var c=function w(){r.forceUpdate(),C.removeEventListener("load",w)};C.addEventListener("load",c)}}var m=n[0]||o.children[0],h=m.clientHeight;return h>0?h:null}return null});var s={initialized:!1,previousItem:l.selectedItem,selectedItem:l.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:l.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof l.animationHandler=="function"&&l.animationHandler||l.animationHandler==="fade"&&y7.fadeAnimationHandler||y7.slideAnimationHandler,r.state=g4(g4({},s),r.animationHandler(l,s)),r}return Un(i,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,s){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),s.swiping&&!this.state.swiping&&this.setState(g4({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&R2.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var s=r.getInitialImage();s&&!s.complete?s.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,z7.default)().addEventListener("resize",this.updateSizes),(0,z7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,B7.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,z7.default)().removeEventListener("resize",this.updateSizes),(0,z7.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,B7.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var s=this;return this.props.children?R2.Children.map(this.props.children,function(a,o){var n=o===s.state.selectedItem,C=o===s.state.previousItem,c=n&&s.state.selectedStyle||C&&s.state.prevStyle||s.state.slideStyle||{};s.props.centerMode&&s.props.axis==="horizontal"&&(c=g4(g4({},c),{},{minWidth:s.props.centerSlidePercentage+"%"})),s.state.swiping&&s.state.swipeMovementStarted&&(c=g4(g4({},c),{},{pointerEvents:"none"}));var m={ref:function(w){return s.setItemsRef(w,o)},key:"itemKey"+o+(r?"clone":""),className:k4.default.ITEM(!0,o===s.state.selectedItem,o===s.state.previousItem),onClick:s.handleClickItem.bind(s,o,a),style:c};return R2.default.createElement("li",m,s.props.renderItem(a,{isSelected:o===s.state.selectedItem,isPrevious:o===s.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,s=this.props,a=s.showIndicators,o=s.labels,n=s.renderIndicator,C=s.children;return a?R2.default.createElement("ul",{className:"control-dots"},R2.Children.map(C,function(c,m){return n&&n(r.changeItem(m),m===r.state.selectedItem,m,o.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?R2.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,R2.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||R2.Children.count(this.props.children)===0?null:R2.default.createElement(On.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||R2.Children.count(this.props.children)===0)return null;var s=this.props.swipeable&&R2.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",o=this.props.showArrows&&R2.Children.count(this.props.children)>1,n=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,C=o&&(this.state.selectedItem{"use strict"});var Ie=$(S9=>{"use strict";Object.defineProperty(S9,"__esModule",{value:!0});Object.defineProperty(S9,"Carousel",{enumerable:!0,get:function(){return Xn.default}});Object.defineProperty(S9,"CarouselProps",{enumerable:!0,get:function(){return jn.CarouselProps}});Object.defineProperty(S9,"Thumbs",{enumerable:!0,get:function(){return Yn.default}});var Xn=De(Pe()),jn=Ae(),Yn=De(J3());function De(e){return e&&e.__esModule?e:{default:e}}});var _e=$((XV,Oe)=>{var Qn=s5(),Jn=function(){return Qn.Date.now()};Oe.exports=Jn});var Ue=$((jV,We)=>{var eC=/\s/;function tC(e){for(var t=e.length;t--&&eC.test(e.charAt(t)););return t}We.exports=tC});var qe=$((YV,Ge)=>{var iC=Ue(),lC=/^\s+/;function rC(e){return e&&e.slice(0,iC(e)+1).replace(lC,"")}Ge.exports=rC});var S7=$((QV,Xe)=>{var sC=qe(),$e=E9(),aC=en(),Ke=NaN,oC=/^[-+]0x[0-9a-f]+$/i,nC=/^0b[01]+$/i,CC=/^0o[0-7]+$/i,cC=parseInt;function mC(e){if(typeof e=="number")return e;if(aC(e))return Ke;if($e(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=$e(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=sC(e);var i=nC.test(e);return i||CC.test(e)?cC(e.slice(2),i?2:8):oC.test(e)?Ke:+e}Xe.exports=mC});var k7=$((JV,Ye)=>{var wC=E9(),r8=_e(),je=S7(),hC="Expected a function",gC=Math.max,HC=Math.min;function LC(e,t,i){var l,r,s,a,o,n,C=0,c=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(hC);t=je(t)||0,wC(i)&&(c=!!i.leading,m="maxWait"in i,s=m?gC(je(i.maxWait)||0,t):s,h="trailing"in i?!!i.trailing:h);function w(R){var x=l,N=r;return l=r=void 0,C=R,a=e.apply(N,x),a}function g(R){return C=R,o=setTimeout(V,t),c?w(R):a}function L(R){var x=R-n,N=R-C,E=t-x;return m?HC(E,s-N):E}function v(R){var x=R-n,N=R-C;return n===void 0||x>=t||x<0||m&&N>=s}function V(){var R=r8();if(v(R))return u(R);o=setTimeout(V,L(R))}function u(R){return o=void 0,h&&l?w(R):(l=r=void 0,a)}function d(){o!==void 0&&clearTimeout(o),C=0,l=n=r=o=void 0}function p(){return o===void 0?a:u(r8())}function Z(){var R=r8(),x=v(R);if(l=arguments,r=this,n=R,x){if(o===void 0)return g(n);if(m)return clearTimeout(o),o=setTimeout(V,t),w(n)}return o===void 0&&(o=setTimeout(V,t)),a}return Z.cancel=d,Z.flush=p,Z}Ye.exports=LC});var _t=$((Id,Ot)=>{function $C(e,t,i){return e===e&&(i!==void 0&&(e=e<=i?e:i),t!==void 0&&(e=e>=t?e:t)),e}Ot.exports=$C});var U9=$((Od,Wt)=>{var KC=_t(),h8=S7();function XC(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=h8(i),i=i===i?i:0),t!==void 0&&(t=h8(t),t=t===t?t:0),KC(h8(e),t,i)}Wt.exports=XC});var Gt=$((_d,Ut)=>{var jC="__lodash_hash_undefined__";function YC(e){return this.__data__.set(e,jC),this}Ut.exports=YC});var $t=$((Wd,qt)=>{function QC(e){return this.__data__.has(e)}qt.exports=QC});var g8=$((Ud,Kt)=>{var JC=se(),ec=Gt(),tc=$t();function Q7(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new JC;++t{function ic(e,t,i,l){for(var r=e.length,s=i+(l?1:-1);l?s--:++s{function lc(e){return e!==e}Yt.exports=lc});var ei=$(($d,Jt)=>{function rc(e,t,i){for(var l=i-1,r=e.length;++l{var sc=jt(),ac=Qt(),oc=ei();function nc(e,t,i){return t===t?oc(e,t,i):sc(e,ac,i)}ti.exports=nc});var ri=$((Xd,li)=>{var Cc=ii();function cc(e,t){var i=e==null?0:e.length;return!!i&&Cc(e,t,0)>-1}li.exports=cc});var ai=$((jd,si)=>{function mc(e,t,i){for(var l=-1,r=e==null?0:e.length;++l{function wc(e,t){return e.has(t)}oi.exports=wc});var L8=$((Qd,ni)=>{var hc=N9(),gc=s5(),Hc=hc(gc,"Set");ni.exports=Hc});var ci=$((Jd,Ci)=>{function Lc(){}Ci.exports=Lc});var J7=$((eu,mi)=>{function Vc(e){var t=-1,i=Array(e.size);return e.forEach(function(l){i[++t]=l}),i}mi.exports=Vc});var hi=$((tu,wi)=>{var V8=L8(),dc=ci(),uc=J7(),vc=1/0,pc=V8&&1/uc(new V8([,-0]))[1]==vc?function(e){return new V8(e)}:dc;wi.exports=pc});var Hi=$((iu,gi)=>{var Mc=g8(),xc=ri(),fc=ai(),Zc=H8(),Ec=hi(),Nc=J7(),Rc=200;function Bc(e,t,i){var l=-1,r=xc,s=e.length,a=!0,o=[],n=o;if(i)a=!1,r=fc;else if(s>=Rc){var C=t?null:Ec(e);if(C)return Nc(C);a=!1,r=Zc,n=new Mc}else n=t?[]:o;e:for(;++l{var zc=Hi();function yc(e){return e&&e.length?zc(e):[]}Li.exports=yc});var d8=$((ru,di)=>{function bc(e,t){for(var i=-1,l=t.length,r=e.length;++i{var ui=J6(),Fc=ae(),Sc=G5(),vi=ui?ui.isConcatSpreadable:void 0;function kc(e){return Sc(e)||Fc(e)||!!(vi&&e&&e[vi])}pi.exports=kc});var Zi=$((au,fi)=>{var Tc=d8(),Pc=Mi();function xi(e,t,i,l,r){var s=-1,a=e.length;for(i||(i=Pc),r||(r=[]);++s0&&i(o)?t>1?xi(o,t-1,i,l,r):Tc(r,o):l||(r[r.length]=o)}return r}fi.exports=xi});var Ni=$((ou,Ei)=>{var Ac=Zi();function Dc(e){var t=e==null?0:e.length;return t?Ac(e,1):[]}Ei.exports=Dc});var Bi=$((nu,Ri)=>{var Ic=Math.ceil,Oc=Math.max;function _c(e,t,i,l){for(var r=-1,s=Oc(Ic((t-e)/(i||1)),0),a=Array(s);s--;)a[l?s:++r]=e,e+=i;return a}Ri.exports=_c});var e3=$((Cu,zi)=>{var Wc=tn(),Uc=ne();function Gc(e){return e!=null&&Uc(e.length)&&!Wc(e)}zi.exports=Gc});var bi=$((cu,yi)=>{var qc=le(),$c=e3(),Kc=oe(),Xc=E9();function jc(e,t,i){if(!Xc(i))return!1;var l=typeof t;return(l=="number"?$c(i)&&Kc(t,i.length):l=="string"&&t in i)?qc(i[t],e):!1}yi.exports=jc});var ki=$((mu,Si)=>{var Yc=S7(),Fi=1/0,Qc=17976931348623157e292;function Jc(e){if(!e)return e===0?e:0;if(e=Yc(e),e===Fi||e===-Fi){var t=e<0?-1:1;return t*Qc}return e===e?e:0}Si.exports=Jc});var Pi=$((wu,Ti)=>{var em=Bi(),tm=bi(),u8=ki();function im(e){return function(t,i,l){return l&&typeof l!="number"&&tm(t,i,l)&&(i=l=void 0),t=u8(t),i===void 0?(i=t,t=0):i=u8(i),l=l===void 0?t{var lm=Pi(),rm=lm();Ai.exports=rm});var Ki=$((Uu,$i)=>{var Pm=N9(),Am=function(){try{var e=Pm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();$i.exports=Am});var Yi=$((Gu,ji)=>{var Xi=Ki();function Dm(e,t,i){t=="__proto__"&&Xi?Xi(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}ji.exports=Dm});var Ji=$((qu,Qi)=>{function Im(e,t,i,l){for(var r=-1,s=e==null?0:e.length;++r{function Om(e){return function(t,i,l){for(var r=-1,s=Object(t),a=l(t),o=a.length;o--;){var n=a[e?o:++r];if(i(s[n],n,s)===!1)break}return t}}el.exports=Om});var ll=$((Ku,il)=>{var _m=tl(),Wm=_m();il.exports=Wm});var sl=$((Xu,rl)=>{function Um(e,t){for(var i=-1,l=Array(e);++i{function Gm(){return!1}al.exports=Gm});var B8=$(($9,l9)=>{var qm=s5(),$m=ol(),cl=typeof $9=="object"&&$9&&!$9.nodeType&&$9,nl=cl&&typeof l9=="object"&&l9&&!l9.nodeType&&l9,Km=nl&&nl.exports===cl,Cl=Km?qm.Buffer:void 0,Xm=Cl?Cl.isBuffer:void 0,jm=Xm||$m;l9.exports=jm});var wl=$((Yu,ml)=>{var Ym=ee(),Qm=ne(),Jm=te(),ew="[object Arguments]",tw="[object Array]",iw="[object Boolean]",lw="[object Date]",rw="[object Error]",sw="[object Function]",aw="[object Map]",ow="[object Number]",nw="[object Object]",Cw="[object RegExp]",cw="[object Set]",mw="[object String]",ww="[object WeakMap]",hw="[object ArrayBuffer]",gw="[object DataView]",Hw="[object Float32Array]",Lw="[object Float64Array]",Vw="[object Int8Array]",dw="[object Int16Array]",uw="[object Int32Array]",vw="[object Uint8Array]",pw="[object Uint8ClampedArray]",Mw="[object Uint16Array]",xw="[object Uint32Array]",I2={};I2[Hw]=I2[Lw]=I2[Vw]=I2[dw]=I2[uw]=I2[vw]=I2[pw]=I2[Mw]=I2[xw]=!0;I2[ew]=I2[tw]=I2[hw]=I2[iw]=I2[gw]=I2[lw]=I2[rw]=I2[sw]=I2[aw]=I2[ow]=I2[nw]=I2[Cw]=I2[cw]=I2[mw]=I2[ww]=!1;function fw(e){return Jm(e)&&Qm(e.length)&&!!I2[Ym(e)]}ml.exports=fw});var gl=$((Qu,hl)=>{function Zw(e){return function(t){return e(t)}}hl.exports=Zw});var Ll=$((K9,r9)=>{var Ew=Jo(),Hl=typeof K9=="object"&&K9&&!K9.nodeType&&K9,X9=Hl&&typeof r9=="object"&&r9&&!r9.nodeType&&r9,Nw=X9&&X9.exports===Hl,z8=Nw&&Ew.process,Rw=function(){try{var e=X9&&X9.require&&X9.require("util").types;return e||z8&&z8.binding&&z8.binding("util")}catch(t){}}();r9.exports=Rw});var y8=$((Ju,ul)=>{var Bw=wl(),zw=gl(),Vl=Ll(),dl=Vl&&Vl.isTypedArray,yw=dl?zw(dl):Bw;ul.exports=yw});var pl=$((ev,vl)=>{var bw=sl(),Fw=ae(),Sw=G5(),kw=B8(),Tw=oe(),Pw=y8(),Aw=Object.prototype,Dw=Aw.hasOwnProperty;function Iw(e,t){var i=Sw(e),l=!i&&Fw(e),r=!i&&!l&&kw(e),s=!i&&!l&&!r&&Pw(e),a=i||l||r||s,o=a?bw(e.length,String):[],n=o.length;for(var C in e)(t||Dw.call(e,C))&&!(a&&(C=="length"||r&&(C=="offset"||C=="parent")||s&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||Tw(C,n)))&&o.push(C);return o}vl.exports=Iw});var xl=$((tv,Ml)=>{var Ow=Object.prototype;function _w(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Ow;return e===i}Ml.exports=_w});var Zl=$((iv,fl)=>{function Ww(e,t){return function(i){return e(t(i))}}fl.exports=Ww});var Nl=$((lv,El)=>{var Uw=Zl(),Gw=Uw(Object.keys,Object);El.exports=Gw});var Bl=$((rv,Rl)=>{var qw=xl(),$w=Nl(),Kw=Object.prototype,Xw=Kw.hasOwnProperty;function jw(e){if(!qw(e))return $w(e);var t=[];for(var i in Object(e))Xw.call(e,i)&&i!="constructor"&&t.push(i);return t}Rl.exports=jw});var s3=$((sv,zl)=>{var Yw=pl(),Qw=Bl(),Jw=e3();function eh(e){return Jw(e)?Yw(e):Qw(e)}zl.exports=eh});var bl=$((av,yl)=>{var th=ll(),ih=s3();function lh(e,t){return e&&th(e,t,ih)}yl.exports=lh});var Sl=$((ov,Fl)=>{var rh=e3();function sh(e,t){return function(i,l){if(i==null)return i;if(!rh(i))return e(i,l);for(var r=i.length,s=t?r:-1,a=Object(i);(t?s--:++s{var ah=bl(),oh=Sl(),nh=oh(ah);kl.exports=nh});var Al=$((Cv,Pl)=>{var Ch=Tl();function ch(e,t,i,l){return Ch(e,function(r,s,a){t(l,r,i(r),a)}),l}Pl.exports=ch});var Il=$((cv,Dl)=>{var mh=O3();function wh(){this.__data__=new mh,this.size=0}Dl.exports=wh});var _l=$((mv,Ol)=>{function hh(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}Ol.exports=hh});var Ul=$((wv,Wl)=>{function gh(e){return this.__data__.get(e)}Wl.exports=gh});var ql=$((hv,Gl)=>{function Hh(e){return this.__data__.has(e)}Gl.exports=Hh});var Kl=$((gv,$l)=>{var Lh=O3(),Vh=re(),dh=se(),uh=200;function vh(e,t){var i=this.__data__;if(i instanceof Lh){var l=i.__data__;if(!Vh||l.length{var ph=O3(),Mh=Il(),xh=_l(),fh=Ul(),Zh=ql(),Eh=Kl();function s9(e){var t=this.__data__=new ph(e);this.size=t.size}s9.prototype.clear=Mh;s9.prototype.delete=xh;s9.prototype.get=fh;s9.prototype.has=Zh;s9.prototype.set=Eh;Xl.exports=s9});var Yl=$((Lv,jl)=>{function Nh(e,t){for(var i=-1,l=e==null?0:e.length;++i{var Rh=g8(),Bh=Yl(),zh=H8(),yh=1,bh=2;function Fh(e,t,i,l,r,s){var a=i&yh,o=e.length,n=t.length;if(o!=n&&!(a&&n>o))return!1;var C=s.get(e),c=s.get(t);if(C&&c)return C==t&&c==e;var m=-1,h=!0,w=i&bh?new Rh:void 0;for(s.set(e,t),s.set(t,e);++m{var Sh=s5(),kh=Sh.Uint8Array;Jl.exports=kh});var ir=$((uv,tr)=>{function Th(e){var t=-1,i=Array(e.size);return e.forEach(function(l,r){i[++t]=[r,l]}),i}tr.exports=Th});var or=$((vv,ar)=>{var lr=J6(),rr=er(),Ph=le(),Ah=F8(),Dh=ir(),Ih=J7(),Oh=1,_h=2,Wh="[object Boolean]",Uh="[object Date]",Gh="[object Error]",qh="[object Map]",$h="[object Number]",Kh="[object RegExp]",Xh="[object Set]",jh="[object String]",Yh="[object Symbol]",Qh="[object ArrayBuffer]",Jh="[object DataView]",sr=lr?lr.prototype:void 0,S8=sr?sr.valueOf:void 0;function eg(e,t,i,l,r,s,a){switch(i){case Jh:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Qh:return!(e.byteLength!=t.byteLength||!s(new rr(e),new rr(t)));case Wh:case Uh:case $h:return Ph(+e,+t);case Gh:return e.name==t.name&&e.message==t.message;case Kh:case jh:return e==t+"";case qh:var o=Dh;case Xh:var n=l&Oh;if(o||(o=Ih),e.size!=t.size&&!n)return!1;var C=a.get(e);if(C)return C==t;l|=_h,a.set(e,t);var c=Ah(o(e),o(t),l,r,s,a);return a.delete(e),c;case Yh:if(S8)return S8.call(e)==S8.call(t)}return!1}ar.exports=eg});var Cr=$((pv,nr)=>{var tg=d8(),ig=G5();function lg(e,t,i){var l=t(e);return ig(e)?l:tg(l,i(e))}nr.exports=lg});var mr=$((Mv,cr)=>{function rg(e,t){for(var i=-1,l=e==null?0:e.length,r=0,s=[];++i{function sg(){return[]}wr.exports=sg});var Lr=$((fv,Hr)=>{var ag=mr(),og=hr(),ng=Object.prototype,Cg=ng.propertyIsEnumerable,gr=Object.getOwnPropertySymbols,cg=gr?function(e){return e==null?[]:(e=Object(e),ag(gr(e),function(t){return Cg.call(e,t)}))}:og;Hr.exports=cg});var dr=$((Zv,Vr)=>{var mg=Cr(),wg=Lr(),hg=s3();function gg(e){return mg(e,hg,wg)}Vr.exports=gg});var pr=$((Ev,vr)=>{var ur=dr(),Hg=1,Lg=Object.prototype,Vg=Lg.hasOwnProperty;function dg(e,t,i,l,r,s){var a=i&Hg,o=ur(e),n=o.length,C=ur(t),c=C.length;if(n!=c&&!a)return!1;for(var m=n;m--;){var h=o[m];if(!(a?h in t:Vg.call(t,h)))return!1}var w=s.get(e),g=s.get(t);if(w&&g)return w==t&&g==e;var L=!0;s.set(e,t),s.set(t,e);for(var v=a;++m{var ug=N9(),vg=s5(),pg=ug(vg,"DataView");Mr.exports=pg});var Zr=$((Rv,fr)=>{var Mg=N9(),xg=s5(),fg=Mg(xg,"Promise");fr.exports=fg});var Nr=$((Bv,Er)=>{var Zg=N9(),Eg=s5(),Ng=Zg(Eg,"WeakMap");Er.exports=Ng});var kr=$((zv,Sr)=>{var k8=xr(),T8=re(),P8=Zr(),A8=L8(),D8=Nr(),Fr=ee(),a9=ln(),Rr="[object Map]",Rg="[object Object]",Br="[object Promise]",zr="[object Set]",yr="[object WeakMap]",br="[object DataView]",Bg=a9(k8),zg=a9(T8),yg=a9(P8),bg=a9(A8),Fg=a9(D8),u5=Fr;(k8&&u5(new k8(new ArrayBuffer(1)))!=br||T8&&u5(new T8)!=Rr||P8&&u5(P8.resolve())!=Br||A8&&u5(new A8)!=zr||D8&&u5(new D8)!=yr)&&(u5=function(e){var t=Fr(e),i=t==Rg?e.constructor:void 0,l=i?a9(i):"";if(l)switch(l){case Bg:return br;case zg:return Rr;case yg:return Br;case bg:return zr;case Fg:return yr}return t});Sr.exports=u5});var Wr=$((yv,_r)=>{var I8=b8(),Sg=F8(),kg=or(),Tg=pr(),Tr=kr(),Pr=G5(),Ar=B8(),Pg=y8(),Ag=1,Dr="[object Arguments]",Ir="[object Array]",a3="[object Object]",Dg=Object.prototype,Or=Dg.hasOwnProperty;function Ig(e,t,i,l,r,s){var a=Pr(e),o=Pr(t),n=a?Ir:Tr(e),C=o?Ir:Tr(t);n=n==Dr?a3:n,C=C==Dr?a3:C;var c=n==a3,m=C==a3,h=n==C;if(h&&Ar(e)){if(!Ar(t))return!1;a=!0,c=!1}if(h&&!c)return s||(s=new I8),a||Pg(e)?Sg(e,t,i,l,r,s):kg(e,t,n,i,l,r,s);if(!(i&Ag)){var w=c&&Or.call(e,"__wrapped__"),g=m&&Or.call(t,"__wrapped__");if(w||g){var L=w?e.value():e,v=g?t.value():t;return s||(s=new I8),r(L,v,i,l,s)}}return h?(s||(s=new I8),Tg(e,t,i,l,r,s)):!1}_r.exports=Ig});var O8=$((bv,qr)=>{var Og=Wr(),Ur=te();function Gr(e,t,i,l,r){return e===t?!0:e==null||t==null||!Ur(e)&&!Ur(t)?e!==e&&t!==t:Og(e,t,i,l,Gr,r)}qr.exports=Gr});var Kr=$((Fv,$r)=>{var _g=b8(),Wg=O8(),Ug=1,Gg=2;function qg(e,t,i,l){var r=i.length,s=r,a=!l;if(e==null)return!s;for(e=Object(e);r--;){var o=i[r];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++r{var $g=E9();function Kg(e){return e===e&&!$g(e)}Xr.exports=Kg});var Yr=$((kv,jr)=>{var Xg=_8(),jg=s3();function Yg(e){for(var t=jg(e),i=t.length;i--;){var l=t[i],r=e[l];t[i]=[l,r,Xg(r)]}return t}jr.exports=Yg});var W8=$((Tv,Qr)=>{function Qg(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}Qr.exports=Qg});var es=$((Pv,Jr)=>{var Jg=Kr(),eH=Yr(),tH=W8();function iH(e){var t=eH(e);return t.length==1&&t[0][2]?tH(t[0][0],t[0][1]):function(i){return i===e||Jg(i,e,t)}}Jr.exports=iH});var U8=$((Av,ts)=>{var lH=rn(),rH=_3();function sH(e,t){t=lH(t,e);for(var i=0,l=t.length;e!=null&&i{var aH=U8();function oH(e,t,i){var l=e==null?void 0:aH(e,t);return l===void 0?i:l}is.exports=oH});var ss=$((Iv,rs)=>{function nH(e,t){return e!=null&&t in Object(e)}rs.exports=nH});var os=$((Ov,as)=>{var CH=ss(),cH=sn();function mH(e,t){return e!=null&&cH(e,t,CH)}as.exports=mH});var Cs=$((_v,ns)=>{var wH=O8(),hH=ls(),gH=os(),HH=ie(),LH=_8(),VH=W8(),dH=_3(),uH=1,vH=2;function pH(e,t){return HH(e)&&LH(t)?VH(dH(e),t):function(i){var l=hH(i,e);return l===void 0&&l===t?gH(i,e):wH(t,l,uH|vH)}}ns.exports=pH});var ms=$((Wv,cs)=>{function MH(e){return e}cs.exports=MH});var hs=$((Uv,ws)=>{function xH(e){return function(t){return t==null?void 0:t[e]}}ws.exports=xH});var Hs=$((Gv,gs)=>{var fH=U8();function ZH(e){return function(t){return fH(t,e)}}gs.exports=ZH});var Vs=$((qv,Ls)=>{var EH=hs(),NH=Hs(),RH=ie(),BH=_3();function zH(e){return RH(e)?EH(BH(e)):NH(e)}Ls.exports=zH});var us=$(($v,ds)=>{var yH=es(),bH=Cs(),FH=ms(),SH=G5(),kH=Vs();function TH(e){return typeof e=="function"?e:e==null?FH:typeof e=="object"?SH(e)?bH(e[0],e[1]):yH(e):kH(e)}ds.exports=TH});var ps=$((Kv,vs)=>{var PH=Ji(),AH=Al(),DH=us(),IH=G5();function OH(e,t){return function(i,l){var r=IH(i)?PH:AH,s=t?t():{};return r(i,e,DH(l,2),s)}}vs.exports=OH});var xs=$((Xv,Ms)=>{var _H=Yi(),WH=ps(),UH=Object.prototype,GH=UH.hasOwnProperty,qH=WH(function(e,t,i){GH.call(e,i)?e[i].push(t):_H(e,i,[t])});Ms.exports=qH});var Wa=$((rZ,_a)=>{var qL=k7(),$L=E9(),KL="Expected a function";function XL(e,t,i){var l=!0,r=!0;if(typeof e!="function")throw new TypeError(KL);return $L(i)&&(l="leading"in i?!!i.leading:l,r="trailing"in i?!!i.trailing:r),qL(e,t,{leading:l,maxWait:t,trailing:r})}_a.exports=XL});var fo=x1(F1()),Zo=x1(ge());var g2=x1(F1());var w5=x1(F1(),1);var He=K2("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var lt=x1(Ie(),1);var X2=x1(F1(),1),Qe=x1(k7(),1);function a0(e,t,i,l,r=!1){let s=X2.useRef();s.current=t,X2.useEffect(()=>{if(i===null||i.addEventListener===void 0)return;let a=i,o=n=>{var C;(C=s.current)==null||C.call(a,n)};return a.addEventListener(e,o,{passive:l,capture:r}),()=>{a.removeEventListener(e,o,{capture:r})}},[e,i,l,r])}function m5(e,t){return e===void 0?void 0:t}var VC=Math.PI;function s8(e){return e*VC/180}var P7=(e,t,i)=>({x1:e-i/2,y1:t-i/2,x2:e+i/2,y2:t+i/2}),A7=(e,t,i,l,r)=>{switch(e){case"left":return Math.floor(t)+l+r/2;case"center":return Math.floor(t+i/2);case"right":return Math.floor(t+i)-l-r/2}},D7=(e,t,i)=>Math.min(e,t-i*2),I7=(e,t,i)=>i.x1<=e&&e<=i.x2&&i.y1<=t&&t<=i.y2,X5=e=>{var i;let t=(i=e.fgColor)!=null?i:"currentColor";return X2.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},X2.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),X2.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},Je=e=>{var i;let t=(i=e.fgColor)!=null?i:"currentColor";return X2.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},X2.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function et(e,t,i){let[l,r]=X2.useState(e),s=X2.useRef(!0);X2.useEffect(()=>()=>{s.current=!1},[]);let a=X2.useRef((0,Qe.default)(o=>{s.current&&r(o)},i));return X2.useLayoutEffect(()=>{s.current&&a.current(()=>e())},t),l}var dC="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",uC="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",vC=new RegExp("^[^"+uC+"]*["+dC+"]");function j5(e){return vC.test(e)?"rtl":"not-rtl"}var T7;function k9(){if(typeof document=="undefined")return 0;if(T7!==void 0)return T7;let e=document.createElement("p");e.style.width="100%",e.style.height="200px";let t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);let i=e.offsetWidth;t.style.overflow="scroll";let l=e.offsetWidth;return i===l&&(l=t.clientWidth),t.remove(),T7=i-l,T7}var c5=Symbol();function tt(e){let t=X2.useRef([c5,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;let[i,l]=X2.useState(e),[,r]=X2.useState(),s=X2.useCallback(o=>{let n=t.current[0];n!==c5&&(o=typeof o=="function"?o(n):o,o===n)||(n!==c5&&r({}),l(C=>typeof o=="function"?o(n===c5?C:n):o),t.current[0]=c5)},[]),a=X2.useCallback(()=>{t.current[0]=c5,r({})},[]);return[t.current[0]===c5?i:t.current[0],s,a]}function O7(e){if(e.length===0)return"";let t=0,i=0;for(let l of e){if(i+=l.length,i>1e4)break;t++}return e.slice(0,t).join(", ")}function it(e){let t=X2.useRef(e);return r5(e,t.current)||(t.current=e),t.current}var rt=e=>{let{urls:t,canWrite:i,onEditClick:l,renderImage:r}=e,s=t.filter(o=>o!=="");if(s.length===0)return null;let a=s.length>1;return w5.createElement(He,{"data-testid":"GDG-default-image-overlay-editor"},w5.createElement(lt.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},s.map(o=>{var C;let n=(C=r==null?void 0:r(o))!=null?C:w5.createElement("img",{draggable:!1,src:o});return w5.createElement("div",{className:"gdg-centering-container",key:o},n)})),i&&l&&w5.createElement("button",{className:"gdg-edit-icon",onClick:l},w5.createElement(X5,null)))};var a8=x1(F1(),1);function mt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var H5=mt();function pC(e){H5=e}var wt=/[&<>"']/,MC=new RegExp(wt.source,"g"),ht=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,xC=new RegExp(ht.source,"g"),fC={"&":"&","<":"<",">":">",'"':""","'":"'"},st=e=>fC[e];function B0(e,t){if(t){if(wt.test(e))return e.replace(MC,st)}else if(ht.test(e))return e.replace(xC,st);return e}var ZC=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function gt(e){return e.replace(ZC,(t,i)=>(i=i.toLowerCase(),i==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}var EC=/(^|[^\[])\^/g;function y2(e,t){e=typeof e=="string"?e:e.source,t=t||"";let i={replace:(l,r)=>(r=r.source||r,r=r.replace(EC,"$1"),e=e.replace(l,r),i),getRegex:()=>new RegExp(e,t)};return i}var NC=/[^\w:]/g,RC=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function at(e,t,i){if(e){let l;try{l=decodeURIComponent(gt(i)).replace(NC,"").toLowerCase()}catch(r){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}t&&!RC.test(i)&&(i=bC(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(l){return null}return i}var _7={},BC=/^[^:]+:\/*[^/]*$/,zC=/^([^:]+:)[\s\S]*$/,yC=/^([^:]+:\/*[^/]*)[\s\S]*$/;function bC(e,t){_7[" "+e]||(BC.test(e)?_7[" "+e]=e+"/":_7[" "+e]=W7(e,"/",!0)),e=_7[" "+e];let i=e.indexOf(":")===-1;return t.substring(0,2)==="//"?i?t:e.replace(zC,"$1")+t:t.charAt(0)==="/"?i?t:e.replace(yC,"$1")+t:e+t}var U7={exec:function(){}};function ot(e,t){let i=e.replace(/\|/g,(s,a,o)=>{let n=!1,C=a;for(;--C>=0&&o[C]==="\\";)n=!n;return n?"|":" |"}),l=i.split(/ \|/),r=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>t)l.splice(t);else for(;l.length1;)t&1&&(i+=e),t>>=1,e+=e;return i+e}function Ct(e,t,i,l){let r=t.href,s=t.title?B0(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){l.state.inLink=!0;let o={type:"link",raw:i,href:r,title:s,text:a,tokens:l.inlineTokens(a)};return l.state.inLink=!1,o}return{type:"image",raw:i,href:r,title:s,text:B0(a)}}function kC(e,t){let i=e.match(/^(\s+)(?:```)/);if(i===null)return t;let l=i[1];return t.split(` `).map(r=>{let s=r.match(/^\s+/);if(s===null)return r;let[a]=s;return a.length>=l.length?r.slice(l.length):r}).join(` -`)}var P9=class{constructor(t){this.options=t||V5}space(t){let i=this.rules.block.newline.exec(t);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(t){let i=this.rules.block.code.exec(t);if(i){let l=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?l:W7(l,` +`)}var T9=class{constructor(t){this.options=t||H5}space(t){let i=this.rules.block.newline.exec(t);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(t){let i=this.rules.block.code.exec(t);if(i){let l=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?l:W7(l,` `)}}}fences(t){let i=this.rules.block.fences.exec(t);if(i){let l=i[0],r=kC(l,i[3]||"");return{type:"code",raw:l,lang:i[2]?i[2].trim().replace(this.rules.inline._escapes,"$1"):i[2],text:r}}}heading(t){let i=this.rules.block.heading.exec(t);if(i){let l=i[2].trim();if(/#$/.test(l)){let r=W7(l,"#");(this.options.pedantic||!r||/ $/.test(r))&&(l=r.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:l,tokens:this.lexer.inline(l)}}}hr(t){let i=this.rules.block.hr.exec(t);if(i)return{type:"hr",raw:i[0]}}blockquote(t){let i=this.rules.block.blockquote.exec(t);if(i){let l=i[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;let s=this.lexer.blockTokens(l);return this.lexer.state.top=r,{type:"blockquote",raw:i[0],tokens:s,text:l}}}list(t){let i=this.rules.block.list.exec(t);if(i){let l,r,s,a,o,n,C,c,m,h,w,g,L=i[1].trim(),v=L.length>1,V={type:"list",raw:"",ordered:v,start:v?+L.slice(0,-1):"",loose:!1,items:[]};L=v?`\\d{1,9}\\${L.slice(-1)}`:`\\${L}`,this.options.pedantic&&(L=v?L:"[*+-]");let u=new RegExp(`^( {0,3}${L})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(g=!1,!(!(i=u.exec(t))||this.rules.block.hr.test(t)));){if(l=i[0],t=t.substring(l.length),c=i[2].split(` `,1)[0].replace(/^\t+/,p=>" ".repeat(3*p.length)),m=t.split(` `,1)[0],this.options.pedantic?(a=2,w=c.trimLeft()):(a=i[2].search(/[^ ]/),a=a>4?1:a,w=c.slice(a),a+=i[1].length),n=!1,!c&&/^ *$/.test(m)&&(l+=m+` @@ -8,10 +8,10 @@ import{A as sn,B as $5,C as K5,D as n1,E as n5,F as W3,G as B9,H as U3,I as X5,J `,1)[0],m=h,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(m)||x.test(m)||p.test(m)||Z.test(t)));){if(m.search(/[^ ]/)>=a||!m.trim())w+=` `+m.slice(a);else{if(n||c.search(/[^ ]/)>=4||R.test(c)||x.test(c)||Z.test(c))break;w+=` `+m}!n&&!m.trim()&&(n=!0),l+=h+` -`,t=t.substring(h.length+1),c=m.slice(a)}}V.loose||(C?V.loose=!0:/\n *\n *$/.test(l)&&(C=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(w),r&&(s=r[0]!=="[ ] ",w=w.replace(/^\[[ xX]\] +/,""))),V.items.push({type:"list_item",raw:l,task:!!r,checked:s,loose:!1,text:w}),V.raw+=l}V.items[V.items.length-1].raw=l.trimRight(),V.items[V.items.length-1].text=w.trimRight(),V.raw=V.raw.trimRight();let d=V.items.length;for(o=0;oR.type==="space"),Z=p.length>0&&p.some(R=>/\n.*\n/.test(R.raw));V.loose=Z}if(V.loose)for(o=0;o$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline._escapes,"$1"):i[3];return{type:"def",tag:l,raw:i[0],href:r,title:s}}}table(t){let i=this.rules.block.table.exec(t);if(i){let l={type:"table",header:ot(i[1]).map(r=>({text:r})),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(` +`,t=t.substring(h.length+1),c=m.slice(a)}}V.loose||(C?V.loose=!0:/\n *\n *$/.test(l)&&(C=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(w),r&&(s=r[0]!=="[ ] ",w=w.replace(/^\[[ xX]\] +/,""))),V.items.push({type:"list_item",raw:l,task:!!r,checked:s,loose:!1,text:w}),V.raw+=l}V.items[V.items.length-1].raw=l.trimRight(),V.items[V.items.length-1].text=w.trimRight(),V.raw=V.raw.trimRight();let d=V.items.length;for(o=0;oR.type==="space"),Z=p.length>0&&p.some(R=>/\n.*\n/.test(R.raw));V.loose=Z}if(V.loose)for(o=0;o$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline._escapes,"$1"):i[3];return{type:"def",tag:l,raw:i[0],href:r,title:s}}}table(t){let i=this.rules.block.table.exec(t);if(i){let l={type:"table",header:ot(i[1]).map(r=>({text:r})),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(l.header.length===l.align.length){l.raw=i[0];let r=l.align.length,s,a,o,n;for(s=0;s({text:C}));for(r=l.header.length,a=0;a/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):R0(i[0]):i[0]}}link(t){let i=this.rules.inline.link.exec(t);if(i){let l=i[2].trim();if(!this.options.pedantic&&/^$/.test(l))return;let a=W7(l.slice(0,-1),"\\");if((l.length-a.length)%2===0)return}else{let a=FC(i[2],"()");if(a>-1){let n=(i[0].indexOf("!")===0?5:4)+i[1].length+a;i[2]=i[2].substring(0,a),i[0]=i[0].substring(0,n).trim(),i[3]=""}}let r=i[2],s="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a&&(r=a[1],s=a[3])}else s=i[3]?i[3].slice(1,-1):"";return r=r.trim(),/^$/.test(l)?r=r.slice(1):r=r.slice(1,-1)),Ct(i,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},i[0],this.lexer)}}reflink(t,i){let l;if((l=this.rules.inline.reflink.exec(t))||(l=this.rules.inline.nolink.exec(t))){let r=(l[2]||l[1]).replace(/\s+/g," ");if(r=i[r.toLowerCase()],!r){let s=l[0].charAt(0);return{type:"text",raw:s,text:s}}return Ct(l,r,l[0],this.lexer)}}emStrong(t,i,l=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&l.match(/[\p{L}\p{N}]/u))return;let s=r[1]||r[2]||"";if(!s||s&&(l===""||this.rules.inline.punctuation.exec(l))){let a=r[0].length-1,o,n,C=a,c=0,m=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(m.lastIndex=0,i=i.slice(-1*t.length+a);(r=m.exec(i))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(n=o.length,r[3]||r[4]){C+=n;continue}else if((r[5]||r[6])&&a%3&&!((a+n)%3)){c+=n;continue}if(C-=n,C>0)continue;n=Math.min(n,n+C+c);let h=t.slice(0,a+r.index+(r[0].length-o.length)+n);if(Math.min(a,n)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let w=h.slice(2,-2);return{type:"strong",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(t){let i=this.rules.inline.code.exec(t);if(i){let l=i[2].replace(/\n/g," "),r=/[^ ]/.test(l),s=/^ /.test(l)&&/ $/.test(l);return r&&s&&(l=l.substring(1,l.length-1)),l=R0(l,!0),{type:"codespan",raw:i[0],text:l}}}br(t){let i=this.rules.inline.br.exec(t);if(i)return{type:"br",raw:i[0]}}del(t){let i=this.rules.inline.del.exec(t);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(t,i){let l=this.rules.inline.autolink.exec(t);if(l){let r,s;return l[2]==="@"?(r=R0(this.options.mangle?i(l[1]):l[1]),s="mailto:"+r):(r=R0(l[1]),s=r),{type:"link",raw:l[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,i){let l;if(l=this.rules.inline.url.exec(t)){let r,s;if(l[2]==="@")r=R0(this.options.mangle?i(l[0]):l[0]),s="mailto:"+r;else{let a;do a=l[0],l[0]=this.rules.inline._backpedal.exec(l[0])[0];while(a!==l[0]);r=R0(l[0]),l[1]==="www."?s="http://"+l[0]:s=l[0]}return{type:"link",raw:l[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,i){let l=this.rules.inline.text.exec(t);if(l){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):R0(l[0]):l[0]:r=R0(this.options.smartypants?i(l[0]):l[0]),{type:"text",raw:l[0],text:r}}}},D1={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:U7,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};D1._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;D1._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;D1.def=S2(D1.def).replace("label",D1._label).replace("title",D1._title).getRegex();D1.bullet=/(?:[*+-]|\d{1,9}[.)])/;D1.listItemStart=S2(/^( *)(bull) */).replace("bull",D1.bullet).getRegex();D1.list=S2(D1.list).replace(/bull/g,D1.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+D1.def.source+")").getRegex();D1._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";D1._comment=/|$)/;D1.html=S2(D1.html,"i").replace("comment",D1._comment).replace("tag",D1._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();D1.paragraph=S2(D1._paragraph).replace("hr",D1.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D1._tag).getRegex();D1.blockquote=S2(D1.blockquote).replace("paragraph",D1.paragraph).getRegex();D1.normal=B({},D1);D1.gfm=S(B({},D1.normal),{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});D1.gfm.table=S2(D1.gfm.table).replace("hr",D1.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D1._tag).getRegex();D1.gfm.paragraph=S2(D1._paragraph).replace("hr",D1.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",D1.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D1._tag).getRegex();D1.pedantic=S(B({},D1.normal),{html:S2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",D1._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:U7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S2(D1.normal._paragraph).replace("hr",D1.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",D1.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var d1={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:U7,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:U7,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";d1.punctuation=S2(d1.punctuation).replace(/punctuation/g,d1._punctuation).getRegex();d1.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;d1.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;d1._comment=S2(D1._comment).replace("(?:-->|$)","-->").getRegex();d1.emStrong.lDelim=S2(d1.emStrong.lDelim).replace(/punct/g,d1._punctuation).getRegex();d1.emStrong.rDelimAst=S2(d1.emStrong.rDelimAst,"g").replace(/punct/g,d1._punctuation).getRegex();d1.emStrong.rDelimUnd=S2(d1.emStrong.rDelimUnd,"g").replace(/punct/g,d1._punctuation).getRegex();d1._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;d1._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;d1._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;d1.autolink=S2(d1.autolink).replace("scheme",d1._scheme).replace("email",d1._email).getRegex();d1._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;d1.tag=S2(d1.tag).replace("comment",d1._comment).replace("attribute",d1._attribute).getRegex();d1._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;d1._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;d1._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;d1.link=S2(d1.link).replace("label",d1._label).replace("href",d1._href).replace("title",d1._title).getRegex();d1.reflink=S2(d1.reflink).replace("label",d1._label).replace("ref",D1._label).getRegex();d1.nolink=S2(d1.nolink).replace("ref",D1._label).getRegex();d1.reflinkSearch=S2(d1.reflinkSearch,"g").replace("reflink",d1.reflink).replace("nolink",d1.nolink).getRegex();d1.normal=B({},d1);d1.pedantic=S(B({},d1.normal),{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:S2(/^!?\[(label)\]\((.*?)\)/).replace("label",d1._label).getRegex(),reflink:S2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",d1._label).getRegex()});d1.gfm=S(B({},d1.normal),{escape:S2(d1.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),t+="&#"+l+";";return t}var H5=class e{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||V5,this.options.tokenizer=this.options.tokenizer||new P9,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={block:D1.normal,inline:d1.normal};this.options.pedantic?(i.block=D1.pedantic,i.inline=d1.pedantic):this.options.gfm&&(i.block=D1.gfm,this.options.breaks?i.inline=d1.breaks:i.inline=d1.gfm),this.tokenizer.rules=i}static get rules(){return{block:D1,inline:d1}}static lex(t,i){return new e(i).lex(t)}static lexInline(t,i){return new e(i).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:l,tokens:this.lexer.inline(l)}}}text(t){let i=this.rules.block.text.exec(t);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(t){let i=this.rules.inline.escape.exec(t);if(i)return{type:"escape",raw:i[0],text:B0(i[1])}}tag(t){let i=this.rules.inline.tag.exec(t);if(i)return!this.lexer.state.inLink&&/^/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):B0(i[0]):i[0]}}link(t){let i=this.rules.inline.link.exec(t);if(i){let l=i[2].trim();if(!this.options.pedantic&&/^$/.test(l))return;let a=W7(l.slice(0,-1),"\\");if((l.length-a.length)%2===0)return}else{let a=FC(i[2],"()");if(a>-1){let n=(i[0].indexOf("!")===0?5:4)+i[1].length+a;i[2]=i[2].substring(0,a),i[0]=i[0].substring(0,n).trim(),i[3]=""}}let r=i[2],s="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a&&(r=a[1],s=a[3])}else s=i[3]?i[3].slice(1,-1):"";return r=r.trim(),/^$/.test(l)?r=r.slice(1):r=r.slice(1,-1)),Ct(i,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},i[0],this.lexer)}}reflink(t,i){let l;if((l=this.rules.inline.reflink.exec(t))||(l=this.rules.inline.nolink.exec(t))){let r=(l[2]||l[1]).replace(/\s+/g," ");if(r=i[r.toLowerCase()],!r){let s=l[0].charAt(0);return{type:"text",raw:s,text:s}}return Ct(l,r,l[0],this.lexer)}}emStrong(t,i,l=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&l.match(/[\p{L}\p{N}]/u))return;let s=r[1]||r[2]||"";if(!s||s&&(l===""||this.rules.inline.punctuation.exec(l))){let a=r[0].length-1,o,n,C=a,c=0,m=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(m.lastIndex=0,i=i.slice(-1*t.length+a);(r=m.exec(i))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(n=o.length,r[3]||r[4]){C+=n;continue}else if((r[5]||r[6])&&a%3&&!((a+n)%3)){c+=n;continue}if(C-=n,C>0)continue;n=Math.min(n,n+C+c);let h=t.slice(0,a+r.index+(r[0].length-o.length)+n);if(Math.min(a,n)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let w=h.slice(2,-2);return{type:"strong",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(t){let i=this.rules.inline.code.exec(t);if(i){let l=i[2].replace(/\n/g," "),r=/[^ ]/.test(l),s=/^ /.test(l)&&/ $/.test(l);return r&&s&&(l=l.substring(1,l.length-1)),l=B0(l,!0),{type:"codespan",raw:i[0],text:l}}}br(t){let i=this.rules.inline.br.exec(t);if(i)return{type:"br",raw:i[0]}}del(t){let i=this.rules.inline.del.exec(t);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(t,i){let l=this.rules.inline.autolink.exec(t);if(l){let r,s;return l[2]==="@"?(r=B0(this.options.mangle?i(l[1]):l[1]),s="mailto:"+r):(r=B0(l[1]),s=r),{type:"link",raw:l[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,i){let l;if(l=this.rules.inline.url.exec(t)){let r,s;if(l[2]==="@")r=B0(this.options.mangle?i(l[0]):l[0]),s="mailto:"+r;else{let a;do a=l[0],l[0]=this.rules.inline._backpedal.exec(l[0])[0];while(a!==l[0]);r=B0(l[0]),l[1]==="www."?s="http://"+l[0]:s=l[0]}return{type:"link",raw:l[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,i){let l=this.rules.inline.text.exec(t);if(l){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):B0(l[0]):l[0]:r=B0(this.options.smartypants?i(l[0]):l[0]),{type:"text",raw:l[0],text:r}}}},P1={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:U7,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};P1._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;P1._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;P1.def=y2(P1.def).replace("label",P1._label).replace("title",P1._title).getRegex();P1.bullet=/(?:[*+-]|\d{1,9}[.)])/;P1.listItemStart=y2(/^( *)(bull) */).replace("bull",P1.bullet).getRegex();P1.list=y2(P1.list).replace(/bull/g,P1.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+P1.def.source+")").getRegex();P1._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";P1._comment=/|$)/;P1.html=y2(P1.html,"i").replace("comment",P1._comment).replace("tag",P1._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();P1.paragraph=y2(P1._paragraph).replace("hr",P1.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",P1._tag).getRegex();P1.blockquote=y2(P1.blockquote).replace("paragraph",P1.paragraph).getRegex();P1.normal=B({},P1);P1.gfm=S(B({},P1.normal),{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});P1.gfm.table=y2(P1.gfm.table).replace("hr",P1.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",P1._tag).getRegex();P1.gfm.paragraph=y2(P1._paragraph).replace("hr",P1.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",P1.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",P1._tag).getRegex();P1.pedantic=S(B({},P1.normal),{html:y2(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",P1._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:U7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y2(P1.normal._paragraph).replace("hr",P1.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",P1.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V1={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:U7,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:U7,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";V1.punctuation=y2(V1.punctuation).replace(/punctuation/g,V1._punctuation).getRegex();V1.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;V1.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;V1._comment=y2(P1._comment).replace("(?:-->|$)","-->").getRegex();V1.emStrong.lDelim=y2(V1.emStrong.lDelim).replace(/punct/g,V1._punctuation).getRegex();V1.emStrong.rDelimAst=y2(V1.emStrong.rDelimAst,"g").replace(/punct/g,V1._punctuation).getRegex();V1.emStrong.rDelimUnd=y2(V1.emStrong.rDelimUnd,"g").replace(/punct/g,V1._punctuation).getRegex();V1._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;V1._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;V1._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;V1.autolink=y2(V1.autolink).replace("scheme",V1._scheme).replace("email",V1._email).getRegex();V1._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;V1.tag=y2(V1.tag).replace("comment",V1._comment).replace("attribute",V1._attribute).getRegex();V1._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;V1._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;V1._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;V1.link=y2(V1.link).replace("label",V1._label).replace("href",V1._href).replace("title",V1._title).getRegex();V1.reflink=y2(V1.reflink).replace("label",V1._label).replace("ref",P1._label).getRegex();V1.nolink=y2(V1.nolink).replace("ref",P1._label).getRegex();V1.reflinkSearch=y2(V1.reflinkSearch,"g").replace("reflink",V1.reflink).replace("nolink",V1.nolink).getRegex();V1.normal=B({},V1);V1.pedantic=S(B({},V1.normal),{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:y2(/^!?\[(label)\]\((.*?)\)/).replace("label",V1._label).getRegex(),reflink:y2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V1._label).getRegex()});V1.gfm=S(B({},V1.normal),{escape:y2(V1.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),t+="&#"+l+";";return t}var h5=class e{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||H5,this.options.tokenizer=this.options.tokenizer||new T9,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={block:P1.normal,inline:V1.normal};this.options.pedantic?(i.block=P1.pedantic,i.inline=V1.pedantic):this.options.gfm&&(i.block=P1.gfm,this.options.breaks?i.inline=V1.breaks:i.inline=V1.gfm),this.tokenizer.rules=i}static get rules(){return{block:P1,inline:V1}}static lex(t,i){return new e(i).lex(t)}static lexInline(t,i){return new e(i).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` `),this.blockTokens(t,this.tokens);let i;for(;i=this.inlineQueue.shift();)this.inlineTokens(i.src,i.tokens);return this.tokens}blockTokens(t,i=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(o,n,C)=>n+" ".repeat(C.length));let l,r,s,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(l=o.call({lexer:this},t,i))?(t=t.substring(l.raw.length),i.push(l),!0):!1))){if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length),l.raw.length===1&&i.length>0?i[i.length-1].raw+=` `:i.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length),r=i[i.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` `+l.raw,r.text+=` @@ -21,9 +21,9 @@ import{A as sn,B as $5,C as K5,D as n1,E as n5,F as W3,G as B9,H as U3,I as X5,J `+l.raw,r.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(l),a=s.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length),r=i[i.length-1],r&&r.type==="text"?(r.raw+=` `+l.raw,r.text+=` -`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(l);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){let l,r,s,a=t,o,n,C;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+nt("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+"["+nt("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,o.index+o[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(n||(C=""),n=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(l=c.call({lexer:this},t,i))?(t=t.substring(l.raw.length),i.push(l),!0):!1))){if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r=i[i.length-1],r&&l.type==="text"&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length),r=i[i.length-1],r&&l.type==="text"&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(l=this.tokenizer.emStrong(t,a,C)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.autolink(t,ct)){t=t.substring(l.raw.length),i.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t,ct))){t=t.substring(l.raw.length),i.push(l);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0,m=t.slice(1),h;this.options.extensions.startInline.forEach(function(w){h=w.call({lexer:this},m),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(s,TC)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(C=l.raw.slice(-1)),n=!0,r=i[i.length-1],r&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return i}},A9=class{constructor(t){this.options=t||V5}code(t,i,l){let r=(i||"").match(/\S*/)[0];if(this.options.highlight){let s=this.options.highlight(t,r);s!=null&&s!==t&&(l=!0,t=s)}return t=t.replace(/\n$/,"")+` -`,r?'
'+(l?t:R0(t,!0))+`
-`:"
"+(l?t:R0(t,!0))+`
+`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):i.push(l);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){let l,r,s,a=t,o,n,C;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+nt("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+"["+nt("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,o.index+o[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(n||(C=""),n=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(l=c.call({lexer:this},t,i))?(t=t.substring(l.raw.length),i.push(l),!0):!1))){if(l=this.tokenizer.escape(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.tag(t)){t=t.substring(l.raw.length),r=i[i.length-1],r&&l.type==="text"&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(l=this.tokenizer.link(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(l.raw.length),r=i[i.length-1],r&&l.type==="text"&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(l=this.tokenizer.emStrong(t,a,C)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.codespan(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.br(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.del(t)){t=t.substring(l.raw.length),i.push(l);continue}if(l=this.tokenizer.autolink(t,ct)){t=t.substring(l.raw.length),i.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t,ct))){t=t.substring(l.raw.length),i.push(l);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0,m=t.slice(1),h;this.options.extensions.startInline.forEach(function(w){h=w.call({lexer:this},m),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(s,TC)){t=t.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(C=l.raw.slice(-1)),n=!0,r=i[i.length-1],r&&r.type==="text"?(r.raw+=l.raw,r.text+=l.text):i.push(l);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return i}},P9=class{constructor(t){this.options=t||H5}code(t,i,l){let r=(i||"").match(/\S*/)[0];if(this.options.highlight){let s=this.options.highlight(t,r);s!=null&&s!==t&&(l=!0,t=s)}return t=t.replace(/\n$/,"")+` +`,r?'
'+(l?t:B0(t,!0))+`
+`:"
"+(l?t:B0(t,!0))+`
`}blockquote(t){return`
${t}
`}html(t){return t}heading(t,i,l,r){if(this.options.headerIds){let s=this.options.headerPrefix+r.slug(l);return`${t} @@ -41,20 +41,20 @@ ${t} `}tablerow(t){return` ${t} `}tablecell(t,i){let l=i.header?"th":"td";return(i.align?`<${l} align="${i.align}">`:`<${l}>`)+t+` -`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,i,l){if(t=at(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r='
",r}image(t,i,l){if(t=at(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r=`${l}":">",r}text(t){return t}},G7=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,i,l){return""+l}image(t,i,l){return""+l}br(){return""}},q7=class{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,i){let l=t,r=0;if(this.seen.hasOwnProperty(l)){r=this.seen[t];do r++,l=t+"-"+r;while(this.seen.hasOwnProperty(l))}return i||(this.seen[t]=r,this.seen[l]=0),l}slug(t,i={}){let l=this.serialize(t);return this.getNextSafeSlug(l,i.dryrun)}},L5=class e{constructor(t){this.options=t||V5,this.options.renderer=this.options.renderer||new A9,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new G7,this.slugger=new q7}static parse(t,i){return new e(i).parse(t)}static parseInline(t,i){return new e(i).parseInline(t)}parse(t,i=!0){let l="",r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x=t.length;for(r=0;r0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=Z+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=Z+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:Z}):V+=Z),V+=this.parse(u.tokens,v),h+=this.renderer.listitem(V,p,d);l+=this.renderer.list(h,g,L);continue}case"html":{l+=this.renderer.html(w.text);continue}case"paragraph":{l+=this.renderer.paragraph(this.parseInline(w.tokens));continue}case"text":{for(h=w.tokens?this.parseInline(w.tokens):w.text;r+1{if(l.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let r="

An error occurred:

"+R0(l.message+"",!0)+"
";if(t)return Promise.resolve(r);if(i){i(null,r);return}return r}if(t)return Promise.reject(l);if(i){i(l);return}throw l}}function Ht(e,t){return(i,l,r)=>{typeof l=="function"&&(r=l,l=null);let s=B({},l);l=B(B({},A1.defaults),s);let a=PC(l.silent,l.async,r);if(typeof i=="undefined"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(SC(l),l.hooks&&(l.hooks.options=l),r){let o=l.highlight,n;try{l.hooks&&(i=l.hooks.preprocess(i)),n=e(i,l)}catch(m){return a(m)}let C=function(m){let h;if(!m)try{l.walkTokens&&A1.walkTokens(n,l.walkTokens),h=t(n,l),l.hooks&&(h=l.hooks.postprocess(h))}catch(w){m=w}return l.highlight=o,m?a(m):r(null,h)};if(!o||o.length<3||(delete l.highlight,!n.length))return C();let c=0;A1.walkTokens(n,function(m){m.type==="code"&&(c++,setTimeout(()=>{o(m.text,m.lang,function(h,w){if(h)return C(h);w!=null&&w!==m.text&&(m.text=w,m.escaped=!0),c--,c===0&&C()})},0))}),c===0&&C();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(i):i).then(o=>e(o,l)).then(o=>l.walkTokens?Promise.all(A1.walkTokens(o,l.walkTokens)).then(()=>o):o).then(o=>t(o,l)).then(o=>l.hooks?l.hooks.postprocess(o):o).catch(a);try{l.hooks&&(i=l.hooks.preprocess(i));let o=e(i,l);l.walkTokens&&A1.walkTokens(o,l.walkTokens);let n=t(o,l);return l.hooks&&(n=l.hooks.postprocess(n)),n}catch(o){return a(o)}}}function A1(e,t,i){return Ht(H5.lex,L5.parse)(e,t,i)}A1.options=A1.setOptions=function(e){return A1.defaults=B(B({},A1.defaults),e),pC(A1.defaults),A1};A1.getDefaults=mt;A1.defaults=V5;A1.use=function(...e){let t=A1.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(i=>{let l=B({},i);if(l.async=A1.defaults.async||l.async||!1,i.extensions&&(i.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){let s=t.renderers[r.name];s?t.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),l.extensions=t),i.renderer){let r=A1.defaults.renderer||new A9;for(let s in i.renderer){let a=r[s];r[s]=(...o)=>{let n=i.renderer[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.renderer=r}if(i.tokenizer){let r=A1.defaults.tokenizer||new P9;for(let s in i.tokenizer){let a=r[s];r[s]=(...o)=>{let n=i.tokenizer[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.tokenizer=r}if(i.hooks){let r=A1.defaults.hooks||new Q5;for(let s in i.hooks){let a=r[s];Q5.passThroughHooks.has(s)?r[s]=o=>{if(A1.defaults.async)return Promise.resolve(i.hooks[s].call(r,o)).then(C=>a.call(r,C));let n=i.hooks[s].call(r,o);return a.call(r,n)}:r[s]=(...o)=>{let n=i.hooks[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.hooks=r}if(i.walkTokens){let r=A1.defaults.walkTokens;l.walkTokens=function(s){let a=[];return a.push(i.walkTokens.call(this,s)),r&&(a=a.concat(r.call(this,s))),a}}A1.setOptions(l)})};A1.walkTokens=function(e,t){let i=[];for(let l of e)switch(i=i.concat(t.call(A1,l)),l.type){case"table":{for(let r of l.header)i=i.concat(A1.walkTokens(r.tokens,t));for(let r of l.rows)for(let s of r)i=i.concat(A1.walkTokens(s.tokens,t));break}case"list":{i=i.concat(A1.walkTokens(l.items,t));break}default:A1.defaults.extensions&&A1.defaults.extensions.childTokens&&A1.defaults.extensions.childTokens[l.type]?A1.defaults.extensions.childTokens[l.type].forEach(function(r){i=i.concat(A1.walkTokens(l[r],t))}):l.tokens&&(i=i.concat(A1.walkTokens(l.tokens,t)))}return i};A1.parseInline=Ht(H5.lexInline,L5.parseInline);A1.Parser=L5;A1.parser=L5.parse;A1.Renderer=A9;A1.TextRenderer=G7;A1.Lexer=H5;A1.lexer=H5.lex;A1.Tokenizer=P9;A1.Slugger=q7;A1.Hooks=Q5;A1.parse=A1;var sd=A1.options,ad=A1.setOptions,od=A1.use,nd=A1.walkTokens,Cd=A1.parseInline;var cd=L5.parse,md=H5.lex;var Lt=Q2("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});var D9=class extends a8.default.PureComponent{constructor(){super(...arguments);s2(this,"targetElement",null);s2(this,"containerRefHook",i=>{this.targetElement=i,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){let{targetElement:i,props:l}=this;if(i===null)return;let{contents:r,createNode:s}=l,a=A1(r),o=document.createRange();o.selectNodeContents(i),o.deleteContents();let n=s==null?void 0:s(a);if(n===void 0){let c=document.createElement("template");c.innerHTML=a,n=c.content}i.append(n);let C=i.getElementsByTagName("a");for(let c of C)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),a8.default.createElement(Lt,{ref:this.containerRefHook})}};var D0=M1(S1(),1);var Vt=Q2("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),dt=Q2("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),ut=Q2("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});var vt=0,q4=e=>{let g=e,{placeholder:t,value:i,onKeyDown:l,highlight:r,altNewline:s,validatedSelection:a}=g,o=s0(g,["placeholder","value","onKeyDown","highlight","altNewline","validatedSelection"]),{onChange:n,className:C}=o,c=D0.useRef(null),m=i!=null?i:"";d0(n!==void 0,"GrowingEntry must be a controlled input area");let[h]=D0.useState(()=>"input-box-"+(vt=(vt+1)%1e7));D0.useEffect(()=>{let L=c.current;if(L===null||L.disabled)return;let v=m.toString().length;L.focus(),L.setSelectionRange(r?0:v,v)},[]),D0.useLayoutEffect(()=>{var L;if(a!==void 0){let v=typeof a=="number"?[a,null]:a;(L=c.current)==null||L.setSelectionRange(v[0],v[1])}},[a]);let w=D0.useCallback(L=>{L.key==="Enter"&&L.shiftKey&&s===!0||l==null||l(L)},[s,l]);return D0.createElement(ut,{className:"gdg-growing-entry"},D0.createElement(dt,{className:C},m+` -`),D0.createElement(Vt,S(B({},o),{className:(C!=null?C:"")+" gdg-input",id:h,ref:c,onKeyDown:w,value:m,placeholder:t,dir:"auto"})))};var Et=M1(S1(),1);var J5=new Map,e9=new Map,o8=new Map;function pt(){J5.clear(),o8.clear(),e9.clear()}function AC(e,t,i,l,r){var s,a,o;let n=0,C={};for(let m of e)n+=(s=i.get(m))!=null?s:r,C[m]=((a=C[m])!=null?a:0)+1;let c=t-n;for(let m of Object.keys(C)){let h=C[m],w=(o=i.get(m))!=null?o:r,g=w*h/n,L=c*g*l/h,v=w+L;i.set(m,v)}}function DC(e,t){var i;let l=new Map,r=0;for(let C of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(C).width;l.set(C,c),r+=c}let s=r/l.size,a=3,o=(t/s+a)/(a+1),n=l.keys();for(let C of n)l.set(C,((i=l.get(C))!=null?i:s)*o);return l}function I9(e,t,i,l){var r,s;let a=e9.get(i);if(l&&a!==void 0&&a.count>2e4){let C=o8.get(i);if(C===void 0&&(C=DC(e,a.size),o8.set(i,C)),a.count>5e5){let m=0;for(let h of t)m+=(r=C.get(h))!=null?r:a.size;return m*1.01}let c=e.measureText(t);return AC(t,c.width,C,Math.max(.05,1-a.count/2e5),a.size),e9.set(i,{count:a.count+t.length,size:a.size}),c.width}let o=e.measureText(t),n=o.width/t.length;if(((s=a==null?void 0:a.count)!=null?s:0)>2e4)return o.width;if(a===void 0)e9.set(i,{count:t.length,size:n});else{let C=n-a.size,c=t.length/(a.count+t.length),m=a.size+C*c;e9.set(i,{count:a.count+t.length,size:m})}return o.width}function IC(e,t,i,l,r,s,a,o){if(t.length<=1)return t.length;if(ri;){let m=c!==void 0?0:t.lastIndexOf(" ",n-1);m>0?n=m:n--,C=I9(e,t.slice(0,Math.max(0,n)),l,a)}if(t[n]!==" "){let m=0;if(c===void 0)m=t.lastIndexOf(" ",n);else for(let h of c){if(h>n)break;m=h}m>0&&(n=m)}return n}function Mt(e,t,i,l,r,s){let a=`${t}_${i}_${l}px`,o=J5.get(a);if(o!==void 0)return o;if(l<=0)return[];let n=[],C=t.split(` -`),c=e9.get(i),m=c===void 0?t.length:l/c.size*1.5,h=r&&c!==void 0&&c.count>2e4;for(let w of C){let g=I9(e,w.slice(0,Math.max(0,m)),i,h),L=Math.min(w.length,m);if(g<=l)n.push(w);else{for(;g>l;){let v=IC(e,w,l,i,g,L,h,s),V=w.slice(0,Math.max(0,v));w=w.slice(V.length),n.push(V),g=I9(e,w.slice(0,Math.max(0,m)),i,h),L=Math.min(w.length,m)}g>0&&n.push(w)}}return n=n.map((w,g)=>g===0?w.trimEnd():w.trim()),J5.set(a,n),J5.size>500&&J5.delete(J5.keys().next().value),n}function Nt(e,t){return Et.default.useMemo(()=>e.map((i,l)=>({group:i.group,grow:i.grow,hasMenu:i.hasMenu,icon:i.icon,id:i.id,menuIcon:i.menuIcon,overlayIcon:i.overlayIcon,sourceIndex:l,sticky:l=s.x&&i=s.y&&l=t.span[0]&&i.current.cell[0]<=t.span[1]}function K7(e,t){let[i,l]=e;return i>=t.x&&i=t.y&&la)return!1;if(t.span===void 0)return o>=l&&o<=r;let[C,c]=t.span;return C>=l&&C<=r||c>=l&&C<=r||Cr}function zt(e,t,i,l){let r=0;if(i.current===void 0)return r;let s=i.current.range;(l||s.height*s.width>1)&&xt(e,t,s)&&r++;for(let a of i.current.rangeStack)xt(e,t,a)&&r++;return r}function yt(e,t){let i=e;if(t!==void 0){let l=[...e],r=i[t.src];t.src>t.dest?(l.splice(t.src,1),l.splice(t.dest,0,r)):(l.splice(t.dest+1,0,r),l.splice(t.src,1)),l=l.map((s,a)=>S(B({},s),{sticky:e[a].sticky})),i=l}return i}function N4(e,t){let i=0,l=yt(e,t);for(let r=0;r0)for(let C of a)i-=C.width;let o=t,n=r!=null?r:0;for(;n<=i&&o=m)return L}let h=s-C,w=e-(n!=null?n:0);if(typeof a=="number"){let g=Math.floor((w-c)/a)+o;return g>=h?void 0:g}else{let g=c;for(let L=o;L1e4&&(O9={},$7=0),s}function kt(e,t){let i=St(e,void 0,"middle",t);return O9[i]}function M0(e,t){return typeof t!="string"&&(t=t.baseFontFull),WC(e,t)}function ft(e,t){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;let l=e.measureText(i);return e.restore(),l}var Zt=[];function WC(e,t){for(let s of Zt)if(s.key===t)return s.val;let i=ft(e,"alphabetic"),r=-(ft(e,"middle").actualBoundingBoxDescent-i.actualBoundingBoxDescent)+i.actualBoundingBoxAscent/2;return Zt.push({key:t,val:r}),r}function Tt(e,t,i,l,r,s){let{ctx:a,rect:o,theme:n}=e,C=Number.MAX_SAFE_INTEGER,c=500;if(t!==void 0&&(C=i-t,Ci&&(e=e.slice(0,i)),e}function GC(e,t,i,l,r,s,a,o,n,C){let c=o.baseFontFull,m=Mt(e,t,c,r-o.cellHorizontalPadding*2,C!=null?C:!1),h=n8(e,c),w=o.lineHeight*h,g=h+w*(m.length-1),L=g+o.cellVerticalPadding>s;L&&(e.save(),e.rect(i,l,r,s),e.clip());let v=l+s/2-g/2,V=Math.max(l+o.cellVerticalPadding,v);for(let u of m)if(Pt(e,u,i,V,r,h,a,o,n),V+=w,V>l+s)break;L&&e.restore()}function I0(e,t,i,l,r){let{ctx:s,rect:a,theme:o}=e,{x:n,y:C,width:c,height:m}=a;l=l!=null?l:!1,l||(t=UC(t,c));let h=M0(s,o),w=Y5(t)==="rtl";if(i===void 0&&w&&(i="right"),w&&(s.direction="rtl"),t.length>0){let g=!1;i==="right"?(s.textAlign="right",g=!0):i!==void 0&&i!=="left"&&(s.textAlign=i,g=!0),l?GC(s,t,n,C,c,m,h,o,i,r):Pt(s,t,n,C,c,m,h,o,i),g&&(s.textAlign="start"),w&&(s.direction="inherit")}}function x0(e,t,i,l,r,s){typeof s=="number"&&(s={tl:s,tr:s,br:s,bl:s}),s={tl:Math.max(0,Math.min(s.tl,r/2,l/2)),tr:Math.max(0,Math.min(s.tr,r/2,l/2)),bl:Math.max(0,Math.min(s.bl,r/2,l/2)),br:Math.max(0,Math.min(s.br,r/2,l/2))},e.moveTo(t+s.tl,i),e.arcTo(t+l,i,t+l,i+s.tr,s.tr),e.arcTo(t+l,i+r,t+l-s.br,i+r,s.br),e.arcTo(t,i+r,t,i+r-s.bl,s.bl),e.arcTo(t,i,t+s.tl,i,s.tl)}function At(e,t,i){e.arc(t,i-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,i,1.25,0,2*Math.PI,!1),e.arc(t,i+1.25*3.5,1.25,0,2*Math.PI,!1)}function C8(e,t,i){let l=function(o,n){let C=n.x-o.x,c=n.y-o.y,m=Math.sqrt(C*C+c*c),h=C/m,w=c/m;return{x:C,y:n.y-o.y,len:m,nx:h,ny:w,ang:Math.atan2(w,h)}},r,s=t.length,a=t[s-1];for(let o=0;o1?1:h),L=1,v=!1;w<0?g<0?g=Math.PI+g:(g=Math.PI-g,L=-1,v=!0):g>0&&(L=-1,v=!0),r=n.radius!==void 0?n.radius:i;let V=g/2,u=Math.abs(Math.cos(V)*r/Math.sin(V)),d;u>Math.min(c.len/2,m.len/2)?(u=Math.min(c.len/2,m.len/2),d=Math.abs(u*Math.sin(V)/Math.cos(V))):d=r;let p=n.x+m.nx*u,Z=n.y+m.ny*u;p+=-m.ny*d*L,Z+=m.nx*d*L,e.arc(p,Z,d,c.ang+Math.PI/2*L,m.ang-Math.PI/2*L,v),a=n,n=C}e.closePath()}function W9(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g){let L={x:0,y:s+C,width:0,height:0};if(e>=w.length||t>=c||t<-2||e<0)return L;let v=s-r;if(e>=m){let V=a>e?-1:1,u=N4(w);L.x+=u+n;for(let d=a;d!==e;d+=V)L.x+=w[V===1?d:d-1].width*V}else for(let V=0;V0&&d5(w[V-1].group,u)&&w[V-1].sticky===d;){let Z=w[V-1];L.x-=Z.width,L.width+=Z.width,V--}let p=e;for(;p+1i&&(L.width=i-L.x)}}else if(t>=c-h){let V=c-t;for(L.y=l;V>0;){let u=t+V-1;L.height=typeof g=="number"?g:g(u),L.y-=L.height,V--}L.height+=1}else{let V=o>t?-1:1;if(typeof g=="number"){let u=t-o;L.y+=u*g}else for(let u=o;u!==t;u+=V)L.y+=g(u)*V;L.height=(typeof g=="number"?g:g(t))+1}return L}var c8=1<<21;function F0(e,t){return(t+2)*c8+e}function Dt(e){return e%c8}function Y7(e){return Math.floor(e/c8)-2}function t9(e){let t=Dt(e),i=Y7(e);return[t,i]}var U9=class{constructor(){s2(this,"visibleWindow",{x:0,y:0,width:0,height:0});s2(this,"freezeCols",0);s2(this,"freezeRows",[]);s2(this,"isInWindow",t=>{let i=Dt(t),l=Y7(t),r=this.visibleWindow,s=i>=r.x&&i<=r.x+r.width||i=r.y&&l<=r.y+r.height||this.freezeRows.includes(l);return s&&a})}setWindow(t,i,l){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===i&&a5(this.freezeRows,l)||(this.visibleWindow=t,this.freezeCols=i,this.freezeRows=l,this.clearOutOfWindow())}},j7=class extends U9{constructor(){super(...arguments);s2(this,"cache",new Map);s2(this,"setValue",(i,l)=>{this.cache.set(F0(i[0],i[1]),l)});s2(this,"getValue",i=>this.cache.get(F0(i[0],i[1])));s2(this,"clearOutOfWindow",()=>{for(let[i]of this.cache.entries())this.isInWindow(i)||this.cache.delete(i)})}};var z4=class{constructor(t=[]){s2(this,"cells");this.cells=new Set(t.map(i=>F0(i[0],i[1])))}add(t){this.cells.add(F0(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(F0(t[0],t[1]))}remove(t){this.cells.delete(F0(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(let t of this.cells)if(Y7(t)<0)return!0;return!1}hasItemInRectangle(t){for(let i=t.y;i{let w=qC(e,h[l],t,n);return C=Math.max(C,w),w});if(c.length>5&&o){C=0;let h=0;for(let g of c)h+=g;let w=h/c.length;for(let g=0;g=w*2?c[g]=0:C=Math.max(C,c[g])}C=Math.max(C,e.measureText(i.title).width+16+(i.icon===void 0?0:28));let m=Math.max(Math.ceil(s),Math.min(Math.floor(a),Math.ceil(C)));return S(B({},i),{width:m})}function It(e,t,i,l,r,s,a,o,n){let C=O0.useRef(t),c=O0.useRef(i),m=O0.useRef(a);C.current=t,c.current=i,m.current=a;let[h,w]=O0.useMemo(()=>{if(typeof window=="undefined")return[null,null];let u=document.createElement("canvas");return u.style.display="none",u.style.opacity="0",u.style.position="fixed",[u,u.getContext("2d",{alpha:!1})]},[]);O0.useLayoutEffect(()=>(h&&document.documentElement.append(h),()=>{h==null||h.remove()}),[h]);let g=O0.useRef({}),L=O0.useRef(),[v,V]=O0.useState();return O0.useLayoutEffect(()=>{let u=c.current;if(u===void 0||e.every(B9))return;let d=Math.max(1,10-Math.floor(e.length/1e4)),p=0;d1&&(d--,p=1);let Z={x:0,y:0,width:e.length,height:Math.min(C.current,d)},R={x:0,y:C.current-1,width:e.length,height:1};(async()=>{let N=u(Z,n.signal),E=p>0?u(R,n.signal):void 0,k;typeof N=="object"?k=N:k=await U3(N),E!==void 0&&(typeof E=="object"?k=[...k,...E]:k=[...k,...await U3(E)]),L.current=e,V(k)})()},[n.signal,e]),O0.useMemo(()=>{var x;let d=e.every(B9)?e:w===null?e.map(N=>B9(N)?N:S(B({},N),{width:m8})):(w.font=m.current.baseFontFull,e.map((N,E)=>{if(B9(N))return N;if(g.current[N.id]!==void 0)return S(B({},N),{width:g.current[N.id]});if(v===void 0||L.current!==e||N.id===void 0)return S(B({},N),{width:m8});let k=w8(w,a,N,E,v,r,s,!0,o);return g.current[N.id]=k.width,k})),p=0,Z=0,R=[];for(let[N,E]of d.entries())p+=E.width,E.grow!==void 0&&E.grow>0&&(Z+=E.grow,R.push(N));if(p0){let N=[...d],E=l-p,k=E;for(let T=0;T{let t=e.fgColor,i=e.bgColor;return` - ${I2}`},am=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2}`},om=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,i,l){if(t=at(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r='
",r}image(t,i,l){if(t=at(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r=`${l}":">",r}text(t){return t}},G7=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,i,l){return""+l}image(t,i,l){return""+l}br(){return""}},q7=class{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,i){let l=t,r=0;if(this.seen.hasOwnProperty(l)){r=this.seen[t];do r++,l=t+"-"+r;while(this.seen.hasOwnProperty(l))}return i||(this.seen[t]=r,this.seen[l]=0),l}slug(t,i={}){let l=this.serialize(t);return this.getNextSafeSlug(l,i.dryrun)}},g5=class e{constructor(t){this.options=t||H5,this.options.renderer=this.options.renderer||new P9,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new G7,this.slugger=new q7}static parse(t,i){return new e(i).parse(t)}static parseInline(t,i){return new e(i).parseInline(t)}parse(t,i=!0){let l="",r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x=t.length;for(r=0;r0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=Z+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=Z+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:Z}):V+=Z),V+=this.parse(u.tokens,v),h+=this.renderer.listitem(V,p,d);l+=this.renderer.list(h,g,L);continue}case"html":{l+=this.renderer.html(w.text);continue}case"paragraph":{l+=this.renderer.paragraph(this.parseInline(w.tokens));continue}case"text":{for(h=w.tokens?this.parseInline(w.tokens):w.text;r+1{if(l.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let r="

An error occurred:

"+B0(l.message+"",!0)+"
";if(t)return Promise.resolve(r);if(i){i(null,r);return}return r}if(t)return Promise.reject(l);if(i){i(l);return}throw l}}function Ht(e,t){return(i,l,r)=>{typeof l=="function"&&(r=l,l=null);let s=B({},l);l=B(B({},T1.defaults),s);let a=PC(l.silent,l.async,r);if(typeof i=="undefined"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(SC(l),l.hooks&&(l.hooks.options=l),r){let o=l.highlight,n;try{l.hooks&&(i=l.hooks.preprocess(i)),n=e(i,l)}catch(m){return a(m)}let C=function(m){let h;if(!m)try{l.walkTokens&&T1.walkTokens(n,l.walkTokens),h=t(n,l),l.hooks&&(h=l.hooks.postprocess(h))}catch(w){m=w}return l.highlight=o,m?a(m):r(null,h)};if(!o||o.length<3||(delete l.highlight,!n.length))return C();let c=0;T1.walkTokens(n,function(m){m.type==="code"&&(c++,setTimeout(()=>{o(m.text,m.lang,function(h,w){if(h)return C(h);w!=null&&w!==m.text&&(m.text=w,m.escaped=!0),c--,c===0&&C()})},0))}),c===0&&C();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(i):i).then(o=>e(o,l)).then(o=>l.walkTokens?Promise.all(T1.walkTokens(o,l.walkTokens)).then(()=>o):o).then(o=>t(o,l)).then(o=>l.hooks?l.hooks.postprocess(o):o).catch(a);try{l.hooks&&(i=l.hooks.preprocess(i));let o=e(i,l);l.walkTokens&&T1.walkTokens(o,l.walkTokens);let n=t(o,l);return l.hooks&&(n=l.hooks.postprocess(n)),n}catch(o){return a(o)}}}function T1(e,t,i){return Ht(h5.lex,g5.parse)(e,t,i)}T1.options=T1.setOptions=function(e){return T1.defaults=B(B({},T1.defaults),e),pC(T1.defaults),T1};T1.getDefaults=mt;T1.defaults=H5;T1.use=function(...e){let t=T1.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(i=>{let l=B({},i);if(l.async=T1.defaults.async||l.async||!1,i.extensions&&(i.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){let s=t.renderers[r.name];s?t.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),l.extensions=t),i.renderer){let r=T1.defaults.renderer||new P9;for(let s in i.renderer){let a=r[s];r[s]=(...o)=>{let n=i.renderer[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.renderer=r}if(i.tokenizer){let r=T1.defaults.tokenizer||new T9;for(let s in i.tokenizer){let a=r[s];r[s]=(...o)=>{let n=i.tokenizer[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.tokenizer=r}if(i.hooks){let r=T1.defaults.hooks||new Y5;for(let s in i.hooks){let a=r[s];Y5.passThroughHooks.has(s)?r[s]=o=>{if(T1.defaults.async)return Promise.resolve(i.hooks[s].call(r,o)).then(C=>a.call(r,C));let n=i.hooks[s].call(r,o);return a.call(r,n)}:r[s]=(...o)=>{let n=i.hooks[s].apply(r,o);return n===!1&&(n=a.apply(r,o)),n}}l.hooks=r}if(i.walkTokens){let r=T1.defaults.walkTokens;l.walkTokens=function(s){let a=[];return a.push(i.walkTokens.call(this,s)),r&&(a=a.concat(r.call(this,s))),a}}T1.setOptions(l)})};T1.walkTokens=function(e,t){let i=[];for(let l of e)switch(i=i.concat(t.call(T1,l)),l.type){case"table":{for(let r of l.header)i=i.concat(T1.walkTokens(r.tokens,t));for(let r of l.rows)for(let s of r)i=i.concat(T1.walkTokens(s.tokens,t));break}case"list":{i=i.concat(T1.walkTokens(l.items,t));break}default:T1.defaults.extensions&&T1.defaults.extensions.childTokens&&T1.defaults.extensions.childTokens[l.type]?T1.defaults.extensions.childTokens[l.type].forEach(function(r){i=i.concat(T1.walkTokens(l[r],t))}):l.tokens&&(i=i.concat(T1.walkTokens(l.tokens,t)))}return i};T1.parseInline=Ht(h5.lexInline,g5.parseInline);T1.Parser=g5;T1.parser=g5.parse;T1.Renderer=P9;T1.TextRenderer=G7;T1.Lexer=h5;T1.lexer=h5.lex;T1.Tokenizer=T9;T1.Slugger=q7;T1.Hooks=Y5;T1.parse=T1;var sd=T1.options,ad=T1.setOptions,od=T1.use,nd=T1.walkTokens,Cd=T1.parseInline;var cd=g5.parse,md=h5.lex;var Lt=K2("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});var A9=class extends a8.default.PureComponent{constructor(){super(...arguments);i2(this,"targetElement",null);i2(this,"containerRefHook",i=>{this.targetElement=i,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){let{targetElement:i,props:l}=this;if(i===null)return;let{contents:r,createNode:s}=l,a=T1(r),o=document.createRange();o.selectNodeContents(i),o.deleteContents();let n=s==null?void 0:s(a);if(n===void 0){let c=document.createElement("template");c.innerHTML=a,n=c.content}i.append(n);let C=i.getElementsByTagName("a");for(let c of C)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),a8.default.createElement(Lt,{ref:this.containerRefHook})}};var P0=x1(F1(),1);var Vt=K2("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),dt=K2("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),ut=K2("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});var vt=0,G4=e=>{let g=e,{placeholder:t,value:i,onKeyDown:l,highlight:r,altNewline:s,validatedSelection:a}=g,o=i0(g,["placeholder","value","onKeyDown","highlight","altNewline","validatedSelection"]),{onChange:n,className:C}=o,c=P0.useRef(null),m=i!=null?i:"";d0(n!==void 0,"GrowingEntry must be a controlled input area");let[h]=P0.useState(()=>"input-box-"+(vt=(vt+1)%1e7));P0.useEffect(()=>{let L=c.current;if(L===null||L.disabled)return;let v=m.toString().length;L.focus(),L.setSelectionRange(r?0:v,v)},[]),P0.useLayoutEffect(()=>{var L;if(a!==void 0){let v=typeof a=="number"?[a,null]:a;(L=c.current)==null||L.setSelectionRange(v[0],v[1])}},[a]);let w=P0.useCallback(L=>{L.key==="Enter"&&L.shiftKey&&s===!0||l==null||l(L)},[s,l]);return P0.createElement(ut,{className:"gdg-growing-entry"},P0.createElement(dt,{className:C},m+` +`),P0.createElement(Vt,S(B({},o),{className:(C!=null?C:"")+" gdg-input",id:h,ref:c,onKeyDown:w,value:m,placeholder:t,dir:"auto"})))};var Et=x1(F1(),1);var Q5=new Map,J5=new Map,o8=new Map;function pt(){Q5.clear(),o8.clear(),J5.clear()}function AC(e,t,i,l,r){var s,a,o;let n=0,C={};for(let m of e)n+=(s=i.get(m))!=null?s:r,C[m]=((a=C[m])!=null?a:0)+1;let c=t-n;for(let m of Object.keys(C)){let h=C[m],w=(o=i.get(m))!=null?o:r,g=w*h/n,L=c*g*l/h,v=w+L;i.set(m,v)}}function DC(e,t){var i;let l=new Map,r=0;for(let C of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(C).width;l.set(C,c),r+=c}let s=r/l.size,a=3,o=(t/s+a)/(a+1),n=l.keys();for(let C of n)l.set(C,((i=l.get(C))!=null?i:s)*o);return l}function D9(e,t,i,l){var r,s;let a=J5.get(i);if(l&&a!==void 0&&a.count>2e4){let C=o8.get(i);if(C===void 0&&(C=DC(e,a.size),o8.set(i,C)),a.count>5e5){let m=0;for(let h of t)m+=(r=C.get(h))!=null?r:a.size;return m*1.01}let c=e.measureText(t);return AC(t,c.width,C,Math.max(.05,1-a.count/2e5),a.size),J5.set(i,{count:a.count+t.length,size:a.size}),c.width}let o=e.measureText(t),n=o.width/t.length;if(((s=a==null?void 0:a.count)!=null?s:0)>2e4)return o.width;if(a===void 0)J5.set(i,{count:t.length,size:n});else{let C=n-a.size,c=t.length/(a.count+t.length),m=a.size+C*c;J5.set(i,{count:a.count+t.length,size:m})}return o.width}function IC(e,t,i,l,r,s,a,o){if(t.length<=1)return t.length;if(ri;){let m=c!==void 0?0:t.lastIndexOf(" ",n-1);m>0?n=m:n--,C=D9(e,t.slice(0,Math.max(0,n)),l,a)}if(t[n]!==" "){let m=0;if(c===void 0)m=t.lastIndexOf(" ",n);else for(let h of c){if(h>n)break;m=h}m>0&&(n=m)}return n}function Mt(e,t,i,l,r,s){let a=`${t}_${i}_${l}px`,o=Q5.get(a);if(o!==void 0)return o;if(l<=0)return[];let n=[],C=t.split(` +`),c=J5.get(i),m=c===void 0?t.length:l/c.size*1.5,h=r&&c!==void 0&&c.count>2e4;for(let w of C){let g=D9(e,w.slice(0,Math.max(0,m)),i,h),L=Math.min(w.length,m);if(g<=l)n.push(w);else{for(;g>l;){let v=IC(e,w,l,i,g,L,h,s),V=w.slice(0,Math.max(0,v));w=w.slice(V.length),n.push(V),g=D9(e,w.slice(0,Math.max(0,m)),i,h),L=Math.min(w.length,m)}g>0&&n.push(w)}}return n=n.map((w,g)=>g===0?w.trimEnd():w.trim()),Q5.set(a,n),Q5.size>500&&Q5.delete(Q5.keys().next().value),n}function Nt(e,t){return Et.default.useMemo(()=>e.map((i,l)=>({group:i.group,grow:i.grow,hasMenu:i.hasMenu,icon:i.icon,id:i.id,menuIcon:i.menuIcon,overlayIcon:i.overlayIcon,sourceIndex:l,sticky:l=s.x&&i=s.y&&l=t.span[0]&&i.current.cell[0]<=t.span[1]}function K7(e,t){let[i,l]=e;return i>=t.x&&i=t.y&&la)return!1;if(t.span===void 0)return o>=l&&o<=r;let[C,c]=t.span;return C>=l&&C<=r||c>=l&&C<=r||Cr}function zt(e,t,i,l){let r=0;if(i.current===void 0)return r;let s=i.current.range;(l||s.height*s.width>1)&&xt(e,t,s)&&r++;for(let a of i.current.rangeStack)xt(e,t,a)&&r++;return r}function yt(e,t){let i=e;if(t!==void 0){let l=[...e],r=i[t.src];t.src>t.dest?(l.splice(t.src,1),l.splice(t.dest,0,r)):(l.splice(t.dest+1,0,r),l.splice(t.src,1)),l=l.map((s,a)=>S(B({},s),{sticky:e[a].sticky})),i=l}return i}function x4(e,t){let i=0,l=yt(e,t);for(let r=0;r0)for(let C of a)i-=C.width;let o=t,n=r!=null?r:0;for(;n<=i&&o=m)return L}let h=s-C,w=e-(n!=null?n:0);if(typeof a=="number"){let g=Math.floor((w-c)/a)+o;return g>=h?void 0:g}else{let g=c;for(let L=o;L1e4&&(I9={},$7=0),s}function kt(e,t){let i=St(e,void 0,"middle",t);return I9[i]}function f0(e,t){return typeof t!="string"&&(t=t.baseFontFull),WC(e,t)}function ft(e,t){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;let l=e.measureText(i);return e.restore(),l}var Zt=[];function WC(e,t){for(let s of Zt)if(s.key===t)return s.val;let i=ft(e,"alphabetic"),r=-(ft(e,"middle").actualBoundingBoxDescent-i.actualBoundingBoxDescent)+i.actualBoundingBoxAscent/2;return Zt.push({key:t,val:r}),r}function Tt(e,t,i,l,r,s){let{ctx:a,rect:o,theme:n}=e,C=Number.MAX_SAFE_INTEGER,c=500;if(t!==void 0&&(C=i-t,Ci&&(e=e.slice(0,i)),e}function GC(e,t,i,l,r,s,a,o,n,C){let c=o.baseFontFull,m=Mt(e,t,c,r-o.cellHorizontalPadding*2,C!=null?C:!1),h=n8(e,c),w=o.lineHeight*h,g=h+w*(m.length-1),L=g+o.cellVerticalPadding>s;L&&(e.save(),e.rect(i,l,r,s),e.clip());let v=l+s/2-g/2,V=Math.max(l+o.cellVerticalPadding,v);for(let u of m)if(Pt(e,u,i,V,r,h,a,o,n),V+=w,V>l+s)break;L&&e.restore()}function A0(e,t,i,l,r){let{ctx:s,rect:a,theme:o}=e,{x:n,y:C,width:c,height:m}=a;l=l!=null?l:!1,l||(t=UC(t,c));let h=f0(s,o),w=j5(t)==="rtl";if(i===void 0&&w&&(i="right"),w&&(s.direction="rtl"),t.length>0){let g=!1;i==="right"?(s.textAlign="right",g=!0):i!==void 0&&i!=="left"&&(s.textAlign=i,g=!0),l?GC(s,t,n,C,c,m,h,o,i,r):Pt(s,t,n,C,c,m,h,o,i),g&&(s.textAlign="start"),w&&(s.direction="inherit")}}function Z0(e,t,i,l,r,s){typeof s=="number"&&(s={tl:s,tr:s,br:s,bl:s}),s={tl:Math.max(0,Math.min(s.tl,r/2,l/2)),tr:Math.max(0,Math.min(s.tr,r/2,l/2)),bl:Math.max(0,Math.min(s.bl,r/2,l/2)),br:Math.max(0,Math.min(s.br,r/2,l/2))},e.moveTo(t+s.tl,i),e.arcTo(t+l,i,t+l,i+s.tr,s.tr),e.arcTo(t+l,i+r,t+l-s.br,i+r,s.br),e.arcTo(t,i+r,t,i+r-s.bl,s.bl),e.arcTo(t,i,t+s.tl,i,s.tl)}function At(e,t,i){e.arc(t,i-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,i,1.25,0,2*Math.PI,!1),e.arc(t,i+1.25*3.5,1.25,0,2*Math.PI,!1)}function C8(e,t,i){let l=function(o,n){let C=n.x-o.x,c=n.y-o.y,m=Math.sqrt(C*C+c*c),h=C/m,w=c/m;return{x:C,y:n.y-o.y,len:m,nx:h,ny:w,ang:Math.atan2(w,h)}},r,s=t.length,a=t[s-1];for(let o=0;o1?1:h),L=1,v=!1;w<0?g<0?g=Math.PI+g:(g=Math.PI-g,L=-1,v=!0):g>0&&(L=-1,v=!0),r=n.radius!==void 0?n.radius:i;let V=g/2,u=Math.abs(Math.cos(V)*r/Math.sin(V)),d;u>Math.min(c.len/2,m.len/2)?(u=Math.min(c.len/2,m.len/2),d=Math.abs(u*Math.sin(V)/Math.cos(V))):d=r;let p=n.x+m.nx*u,Z=n.y+m.ny*u;p+=-m.ny*d*L,Z+=m.nx*d*L,e.arc(p,Z,d,c.ang+Math.PI/2*L,m.ang-Math.PI/2*L,v),a=n,n=C}e.closePath()}function _9(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g){let L={x:0,y:s+C,width:0,height:0};if(e>=w.length||t>=c||t<-2||e<0)return L;let v=s-r;if(e>=m){let V=a>e?-1:1,u=x4(w);L.x+=u+n;for(let d=a;d!==e;d+=V)L.x+=w[V===1?d:d-1].width*V}else for(let V=0;V0&&L5(w[V-1].group,u)&&w[V-1].sticky===d;){let Z=w[V-1];L.x-=Z.width,L.width+=Z.width,V--}let p=e;for(;p+1i&&(L.width=i-L.x)}}else if(t>=c-h){let V=c-t;for(L.y=l;V>0;){let u=t+V-1;L.height=typeof g=="number"?g:g(u),L.y-=L.height,V--}L.height+=1}else{let V=o>t?-1:1;if(typeof g=="number"){let u=t-o;L.y+=u*g}else for(let u=o;u!==t;u+=V)L.y+=g(u)*V;L.height=(typeof g=="number"?g:g(t))+1}return L}var c8=1<<21;function S0(e,t){return(t+2)*c8+e}function Dt(e){return e%c8}function Y7(e){return Math.floor(e/c8)-2}function e9(e){let t=Dt(e),i=Y7(e);return[t,i]}var W9=class{constructor(){i2(this,"visibleWindow",{x:0,y:0,width:0,height:0});i2(this,"freezeCols",0);i2(this,"freezeRows",[]);i2(this,"isInWindow",t=>{let i=Dt(t),l=Y7(t),r=this.visibleWindow,s=i>=r.x&&i<=r.x+r.width||i=r.y&&l<=r.y+r.height||this.freezeRows.includes(l);return s&&a})}setWindow(t,i,l){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===i&&r5(this.freezeRows,l)||(this.visibleWindow=t,this.freezeCols=i,this.freezeRows=l,this.clearOutOfWindow())}},j7=class extends W9{constructor(){super(...arguments);i2(this,"cache",new Map);i2(this,"setValue",(i,l)=>{this.cache.set(S0(i[0],i[1]),l)});i2(this,"getValue",i=>this.cache.get(S0(i[0],i[1])));i2(this,"clearOutOfWindow",()=>{for(let[i]of this.cache.entries())this.isInWindow(i)||this.cache.delete(i)})}};var E4=class{constructor(t=[]){i2(this,"cells");this.cells=new Set(t.map(i=>S0(i[0],i[1])))}add(t){this.cells.add(S0(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(S0(t[0],t[1]))}remove(t){this.cells.delete(S0(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(let t of this.cells)if(Y7(t)<0)return!0;return!1}hasItemInRectangle(t){for(let i=t.y;i{let w=qC(e,h[l],t,n);return C=Math.max(C,w),w});if(c.length>5&&o){C=0;let h=0;for(let g of c)h+=g;let w=h/c.length;for(let g=0;g=w*2?c[g]=0:C=Math.max(C,c[g])}C=Math.max(C,e.measureText(i.title).width+16+(i.icon===void 0?0:28));let m=Math.max(Math.ceil(s),Math.min(Math.floor(a),Math.ceil(C)));return S(B({},i),{width:m})}function It(e,t,i,l,r,s,a,o,n){let C=D0.useRef(t),c=D0.useRef(i),m=D0.useRef(a);C.current=t,c.current=i,m.current=a;let[h,w]=D0.useMemo(()=>{if(typeof window=="undefined")return[null,null];let u=document.createElement("canvas");return u.style.display="none",u.style.opacity="0",u.style.position="fixed",[u,u.getContext("2d",{alpha:!1})]},[]);D0.useLayoutEffect(()=>(h&&document.documentElement.append(h),()=>{h==null||h.remove()}),[h]);let g=D0.useRef({}),L=D0.useRef(),[v,V]=D0.useState();return D0.useLayoutEffect(()=>{let u=c.current;if(u===void 0||e.every(R9))return;let d=Math.max(1,10-Math.floor(e.length/1e4)),p=0;d1&&(d--,p=1);let Z={x:0,y:0,width:e.length,height:Math.min(C.current,d)},R={x:0,y:C.current-1,width:e.length,height:1};(async()=>{let N=u(Z,n.signal),E=p>0?u(R,n.signal):void 0,b;typeof N=="object"?b=N:b=await U3(N),E!==void 0&&(typeof E=="object"?b=[...b,...E]:b=[...b,...await U3(E)]),L.current=e,V(b)})()},[n.signal,e]),D0.useMemo(()=>{var x;let d=e.every(R9)?e:w===null?e.map(N=>R9(N)?N:S(B({},N),{width:m8})):(w.font=m.current.baseFontFull,e.map((N,E)=>{if(R9(N))return N;if(g.current[N.id]!==void 0)return S(B({},N),{width:g.current[N.id]});if(v===void 0||L.current!==e||N.id===void 0)return S(B({},N),{width:m8});let b=w8(w,a,N,E,v,r,s,!0,o);return g.current[N.id]=b.width,b})),p=0,Z=0,R=[];for(let[N,E]of d.entries())p+=E.width,E.grow!==void 0&&E.grow>0&&(Z+=E.grow,R.push(N));if(p0){let N=[...d],E=l-p,b=E;for(let A=0;A{let t=e.fgColor,i=e.bgColor;return` + ${T2}`},am=e=>{let t=e.fgColor,i=e.bgColor;return` + ${T2}`},om=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} - `},nm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},nm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} -`},Cm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`},Cm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} -`},Di=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`},Di=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} - `},cm=e=>{let t=e.bgColor;return`${I2} + `},cm=e=>{let t=e.bgColor;return`${T2} -`},mm=Di,wm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`},mm=Di,wm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},hm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} @@ -87,71 +87,71 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="

An error - `},gm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},gm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},Hm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} `},Lm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},Vm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},Vm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},dm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},um=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},um=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},vm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},pm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},pm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},Mm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} `},xm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},fm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},fm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} -`},Zm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`},Zm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},Em=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},Nm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},Nm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},Rm=e=>{let t=e.fgColor,i=e.bgColor;return` - ${I2} + ${T2} - `},Bm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} + `},Bm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} -`},zm=e=>{let t=e.fgColor,i=e.bgColor;return`${I2} +`},zm=e=>{let t=e.fgColor,i=e.bgColor;return`${T2} `},ym=e=>{let t=e.fgColor;return` @@ -161,26 +161,26 @@ Please report this to https://github.com/markedjs/marked.`,e){let r="

An error -`},Ii={headerRowID:sm,headerNumber:om,headerCode:am,headerString:nm,headerBoolean:Cm,headerAudioUri:mm,headerVideoUri:wm,headerEmoji:hm,headerImage:gm,headerUri:Di,headerPhone:Hm,headerMarkdown:Lm,headerDate:Vm,headerTime:dm,headerEmail:um,headerReference:vm,headerIfThenElse:pm,headerSingleValue:Mm,headerLookup:xm,headerTextTemplate:fm,headerMath:Zm,headerRollup:Em,headerJoinStrings:Nm,headerSplitString:Rm,headerGeoDistance:Bm,headerArray:zm,rowOwnerOverlay:ym,protectedColumnOverlay:bm,renameIcon:cm};function Fm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var t3=class{constructor(t,i){s2(this,"onSettled");s2(this,"spriteMap",new Map);s2(this,"headerIcons");s2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=Fm(i,o),m=a*Math.ceil(window.devicePixelRatio),h=`${C}_${c}_${m}_${t}`,w=this.spriteMap.get(h);if(w===void 0){let g=this.headerIcons[t];if(g===void 0)return;w=document.createElement("canvas");let L=w.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g({fgColor:c,bgColor:C}))}`,this.spriteMap.set(h,w);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,m,m)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(w,0,0,m,m,r,s,a,a),n<1&&(l.globalAlpha=1)}};var Q8=M1(G9(),1),ks=M1(v8(),1);function i3(e){if(e.length===0)return;let t;for(let i of e)t=Math.min(t!=null?t:i.y,i.y)}function $4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,m=l-s,h=!1;for(;Co&&n(C,c,w,!1,a&&c===l-1)===!0){h=!0;break}C+=w,c++}if(!h){C=i;for(let w=0;w!g.sticky))==null?void 0:h.sourceIndex)!=null?w:0;if(n>m){let g=Math.max(o,m),L=t,v=l;for(let V=s.sourceIndex-1;V>=g;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=n;V++)v+=a[V].width;c={x:L,y:i,width:v,height:r}}if(m>o){let g=Math.min(n,m-1),L=t,v=l;for(let V=s.sourceIndex-1;V>=o;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=g;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Oi(e,t,i,l){if(l==="any")return p8(e,{x:t,y:i,width:1,height:1});if(l==="vertical"&&(t=e.x),l==="horizontal"&&(i=e.y),K7([t,i],e))return;let r=t-e.x,s=e.x+e.width-t,a=i-e.y+1,o=e.y+e.height-i,n=Math.min(l==="vertical"?Number.MAX_SAFE_INTEGER:r,l==="vertical"?Number.MAX_SAFE_INTEGER:s,l==="horizontal"?Number.MAX_SAFE_INTEGER:a,l==="horizontal"?Number.MAX_SAFE_INTEGER:o);return n===o?{x:e.x,y:e.y+e.height,width:e.width,height:i-e.y-e.height+1}:n===a?{x:e.x,y:i,width:e.width,height:e.y-i}:n===s?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function v5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function K4(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function p8(e,t){let i=Math.min(e.x,t.x),l=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-i,s=Math.max(e.y+e.height,t.y+t.height)-l;return{x:i,y:l,width:r,height:s}}function _i(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Wi(e,t,i,l){if(e.x>t||e.y>i||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>i)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=i)return e;let r=-4,s=-4,a=t+4,o=i+4,n=r-e.x,C=e.x+e.width-a,c=s-e.y,m=e.y+e.height-o,h=n>0?e.x+Math.floor(n/l)*l:e.x,w=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,g=c>0?e.y+Math.floor(c/l)*l:e.y,L=m>0?e.y+e.height-Math.floor(m/l)*l:e.y+e.height;return{x:h,y:g,width:w-h,height:L-g}}function Ui(e,t,i,l,r){let[s,a,o,n]=t,[C,c,m,h]=r,{x:w,y:g,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=w+L,d=g+v,p=wo,x=g+v>n,N=w>=s&&ws&&u<=o||wo,E=g>=a&&ga&&d<=n||gn;if(N&&E){let T=Math.max(w,s),b=Math.max(g,a),A=Math.min(u,o),z=Math.min(d,n);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:C,y:c,width:m-C+1,height:h-c+1}})}if(p&&Z){let T=w,b=g,A=Math.min(u,s),z=Math.min(d,a);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let T=Math.max(w,s),b=g,A=Math.min(u,o),z=Math.min(d,a);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:C,y:0,width:m-C+1,height:c+1}})}if(Z&&R){let T=Math.max(w,o),b=g,A=u,z=Math.min(d,a);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:m,y:0,width:i-m+1,height:c+1}})}if(p&&E){let T=w,b=Math.max(g,a),A=Math.min(u,s),z=Math.min(d,n);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:0,y:c,width:C+1,height:h-c+1}})}if(R&&E){let T=Math.max(w,o),b=Math.max(g,a),A=u,z=Math.min(d,n);V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:m,y:c,width:i-m+1,height:h-c+1}})}if(p&&x){let T=w,b=Math.max(g,n),A=Math.min(u,s),z=d;V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:0,y:h,width:C+1,height:l-h+1}})}if(x&&N){let T=Math.max(w,s),b=Math.max(g,n),A=Math.min(u,o),z=d;V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:C,y:h,width:m-C+1,height:l-h+1}})}if(R&&x){let T=Math.max(w,o),b=Math.max(g,n),A=u,z=d;V.push({rect:{x:T,y:b,width:A-T,height:z-b},clip:{x:m,y:h,width:i-m+1,height:l-h+1}})}return V}var Sm={kind:n1.Loading,allowOverlay:!1};function f8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x,N,E,k,T,b,A,z,_,K,J,C1){var Q1;let g1=(Q1=d==null?void 0:d.size)!=null?Q1:Number.MAX_SAFE_INTEGER,w1=performance.now(),$=A.baseFontFull;e.font=$;let r1={ctx:e},a1=[0,0],R1=v>0?a4(n,v,C):0,Q,O1,v1=i3(u);return _0(t,o,s,a,r,(H1,W1,Z2,R2,h2)=>{var L2;let z1=Math.max(0,R2-W1),o2=W1+z1,c2=r+1,J1=H1.width-z1,s1=l-r-1;if(u.length>0){let t1=!1;for(let L1=0;L1{e.save(),e.beginPath(),e.rect(o2,c2,J1,s1),e.clip()},e2=p.columns.hasIndex(H1.sourceIndex),U1=m((L2=H1.group)!=null?L2:"").overrideTheme,b1=H1.themeOverride===void 0&&U1===void 0?A:r4(A,U1,H1.themeOverride),G1=b1.baseFontFull;G1!==$&&($=G1,e.font=G1),k1();let q1;return $4(h2,Z2,l,n,C,v,V,v1,(t1,L1,x1,y1,y2)=>{var f0,o4,k0,T0;if(L1<0||(a1[0]=H1.sourceIndex,a1[1]=L1,d!==void 0&&!d.has(a1)))return;if(u.length>0){let Z1=!1;for(let P2=0;P2c1.span!==void 0&&Z1>=c1.span[0]&&Z1<=c1.span[1]);w0&&!g&&L?k2=0:w0&&L&&(k2=Math.max(k2,1)),G0&&k2++,w0||(B2&&k2++,e2&&!y2&&k2++);let X1=c1.kind===n1.Protected?t0.bgCellMedium:t0.bgCell,g2;if((y1||X1!==A.bgCell)&&(g2=y0(X1,g2)),k2>0||i1){i1&&(g2=y0(t0.bgHeader,g2));for(let Z1=0;Z1C1&&!z2){let Z1=t0.baseFontFull;Z1!==$&&(e.font=Z1,$=Z1),q1=Z8(e,c1,H1.sourceIndex,L1,T2,b2,h1,t1,f1,x1,k2>0,t0,g2!=null?g2:t0.bgCell,x,N,(k0=F2==null?void 0:F2.hoverAmount)!=null?k0:0,k,b,w1,T,q1,z,_,K,J)}return d2&&e.restore(),c1.style==="faded"&&(e.globalAlpha=1),g1--,T1&&(e.restore(),(T0=q1==null?void 0:q1.deprep)==null||T0.call(q1,r1),q1=void 0,k1(),$=G1,e.font=G1),g1<=0}),e.restore(),g1<=0}),Q}var q9=[0,0],$9={x:0,y:0,width:0,height:0},M8=[void 0,()=>{}],x8=!1;function km(){x8=!0}function Z8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x,N){var _,K;let E,k;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],k=v[1][1]);let T;q9[0]=i,q9[1]=l,$9.x=a,$9.y=o,$9.width=n,$9.height=C,M8[0]=R.getValue(q9),M8[1]=J=>R.setValue(q9,J),x8=!1;let b={ctx:e,theme:m,col:i,row:l,cell:t,rect:$9,highlighted:c,cellFillColor:h,hoverAmount:L,frameTime:u,hoverX:E,drawState:M8,hoverY:k,imageLoader:w,spriteManager:g,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:km},A=Tt(b,t.lastUpdated,u,p,r,s),z=x(t);if(z!==void 0){(p==null?void 0:p.renderer)!==z&&((_=p==null?void 0:p.deprep)==null||_.call(p,b),p=void 0);let J=(K=z.drawPrep)==null?void 0:K.call(z,b,p);d!==void 0&&!T4(b.cell)?d(b,()=>z.draw(b,t)):z.draw(b,t),T=J===void 0?void 0:{deprep:J==null?void 0:J.deprep,fillStyle:J==null?void 0:J.fillStyle,font:J==null?void 0:J.font,renderer:z}}return(A||x8)&&(Z==null||Z(q9)),T}function i9(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,m="center",h="square"){var p;let w=Math.floor(r+a/2),g=h==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=D7(c,a,t.cellVerticalPadding),v=L/2,V=A7(m,l,s,t.cellHorizontalPadding,L),u=P7(V,w,L),d=I7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),x0(e,V-L/2,w-L/2,L,L,g),h==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,w-v+L/1.97),e.lineTo(V-v+L/2.42,w-v+L/1.44),e.lineTo(V-v+L/1.29,w-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case $5:case!1:{e.beginPath(),x0(e,V-L/2+.5,w-L/2+.5,L-1,L-1,g),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case K5:{e.beginPath(),x0(e,V-L/2,w-L/2,L,L,g),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),h==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,w),e.lineTo(V+L/3,w),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:s5(i)}}function qi(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=m.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=m.headerFontFull;e.font=R,_0(t,0,s,0,d,(N,E,k,T)=>{var a1,R1,Q;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let b=Math.max(0,T-E);e.save(),e.beginPath(),e.rect(E+b,o,N.width-b,a),e.clip();let A=L((a1=N.group)!=null?a1:"").overrideTheme,z=N.themeOverride===void 0&&A===void 0?m:r4(m,A,N.themeOverride);z.bgHeader!==m.bgHeader&&(e.fillStyle=z.bgHeader,e.fill()),z!==m&&(e.font=z.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),K=n!==void 0||C,J=!K&&Z===-1&&p===N.sourceIndex,C1=K?0:(Q=(R1=w.find(O1=>O1.item[0]===N.sourceIndex&&O1.item[1]===-1))==null?void 0:R1.hoverAmount)!=null?Q:0,g1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,w1=_?z.accentColor:g1?z.bgHeaderHasFocus:z.bgHeader,$=i?o:0,r1=N.sourceIndex===0?0:1;_?(e.fillStyle=w1,e.fillRect(E+r1,$,N.width-r1,a)):(g1||C1>0)&&(e.beginPath(),e.rect(E+r1,$,N.width-r1,a),g1&&(e.fillStyle=z.bgHeaderHasFocus,e.fill()),C1>0&&(e.globalAlpha=C1,e.fillStyle=z.bgHeaderHovered,e.fill(),e.globalAlpha=1)),R8(e,E,$,N.width,a,N,_,z,J,g1,C1,h,V,u),e.restore()}),i&&Tm(e,t,r,s,o,l,m,h,w,g,L,v)}function Tm(e,t,i,l,r,s,a,o,n,C,c,m){var v;let[w,g]=(v=s==null?void 0:s[0])!=null?v:[],L=0;l3(t,i,l,r,(V,u,d,p,Z,R)=>{var T,b;if(m!==void 0&&!m.hasItemInRectangle({x:V[0],y:-2,width:V[1]-V[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(d,p,Z,R),e.clip();let x=c(u),N=(x==null?void 0:x.overrideTheme)===void 0?a:r4(a,x.overrideTheme),E=g===-2&&w!==void 0&&w>=V[0]&&w<=V[1],k=E?N.bgHeaderHovered:N.bgHeader;if(k!==a.bgHeader&&(e.fillStyle=k,e.fill()),e.fillStyle=(T=N.textGroupHeader)!=null?T:N.textHeader,x!==void 0){let A=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,A+8,(r-20)/2,20,N),A+=26),e.fillText(x.name,A+8,r/2+M0(e,a.headerFontFull)),x.actions!==void 0&&E){let z=N8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=z[0].x-10,K=d+Z-_;e.rect(_,0,K,r);let J=e.createLinearGradient(_,0,_+K,0),C1=z0(k,0);J.addColorStop(0,C1),J.addColorStop(10/K,k),J.addColorStop(1,k),e.fillStyle=J,e.fill(),e.globalAlpha=.6;let[g1,w1]=(b=s==null?void 0:s[1])!=null?b:[-1,-1];for(let $=0;$35){let p=h?35:l-35,Z=h?35*.7:l-35*.7,R=p/l,x=Z/l,N=e.createLinearGradient(t,0,t+l,0),E=z0(L,0);N.addColorStop(h?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(h?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(h&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+M0(e,o.headerFontFull)),h&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===W3.Triangle){e.beginPath();let d=w.x+w.width/2-5.5,p=w.y+w.height/2-3;C8(e,[{x:d,y:p},{x:d+11,y:p},{x:d+5.5,y:p+6}],1),e.fillStyle=L,e.fill()}else if(s.menuIcon===W3.Dots){e.beginPath();let d=w.x+w.width/2,p=w.y+w.height/2;At(e,d,p),e.fillStyle=L,e.fill()}else{let d=w.x+(w.width-o.headerIconSize)/2,p=w.y+(w.height-o.headerIconSize)/2;c.drawSprite(s.menuIcon,"normal",e,d,p,o.headerIconSize,o)}}function R8(e,t,i,l,r,s,a,o,n,C,c,m,h,w){let g=Y5(s.title)==="rtl",L=E8(t,i,l,r,g);h!==void 0?h({ctx:e,theme:o,rect:{x:t,y:i,width:l,height:r},column:s,columnIndex:s.sourceIndex,isSelected:a,hoverAmount:c,isHovered:n,hasSelectedCell:C,spriteManager:m,menuBounds:L},()=>Gi(e,t,i,l,r,s,a,o,n,c,m,w,g,L)):Gi(e,t,i,l,r,s,a,o,n,c,m,w,g,L)}var fs=M1(xs(),1);function Zs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){if(V!==void 0||t[t.length-1]!==i[t.length-1])return;let d=i3(v);_0(t,n,a,o,s,(p,Z,R,x,N)=>{if(p!==t[t.length-1])return;Z+=p.width;let E=Math.max(Z,x);E>l||(e.save(),e.beginPath(),e.rect(E,s+1,1e4,r-s-1),e.clip(),$4(N,R,r,C,c,g,L,d,(k,T,b,A)=>{if(!A&&v.length>0&&!v.some(C1=>v5(Z,k,1e4,b,C1.x,C1.y,C1.width,C1.height)))return;let z=h.hasIndex(T),_=w.hasIndex(T);e.beginPath();let K=m==null?void 0:m(T),J=K===void 0?u:r4(u,K);J.bgCell!==u.bgCell&&(e.fillStyle=J.bgCell,e.fillRect(Z,k,1e4,b)),_&&(e.fillStyle=J.bgHeader,e.fillRect(Z,k,1e4,b)),z&&(e.fillStyle=J.accentLight,e.fillRect(Z,k,1e4,b))}),e.restore())})}function Es(e,t,i,l,r,s,a,o,n){var g;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(g=n.horizontalBorderColor)!=null?g:n.borderColor,m=n.borderColor,h=C?N4(t):0,w;if(h!==0&&(w=G3(m,n.bgCell),e.beginPath(),e.moveTo(h+.5,0),e.lineTo(h+.5,l),e.strokeStyle=w,e.stroke()),r>0){let L=m===c&&w!==void 0?w:G3(c,n.bgCell),v=a4(s,r,o);e.beginPath(),e.moveTo(0,l-v+.5),e.lineTo(i,l-v+.5),e.strokeStyle=L,e.stroke()}}var Ns=(e,t,i)=>{let l=0,r=t,s=0,a=i;if(e!==void 0&&e.length>0){l=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let o of e)l=Math.min(l,o.x-1),r=Math.max(r,o.x+o.width+1),s=Math.min(s,o.y-1),a=Math.max(a,o.y+o.height+1)}return{minX:l,maxX:r,minY:s,maxY:a}};function Rs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g){var b;let L=g.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=Ns(o,s,a),p=[],Z=a-a4(w,h,C),R=n,x=i,N=0;for(;R+r=u&&A<=d-1){let _=c==null?void 0:c(x),K=_==null?void 0:_.bgCell;K!==void 0&&K!==L&&x>=w-h&&p.push({x:v,y:A,w:V-v,h:z,color:K})}R+=z,x0)for(let A=0;A=v&&_<=V&&m(A+1)&&p.push({x:_,y:N,w:z.width,h:k,color:K}),E+=z.width}if(p.length===0)return;let T;e.beginPath();for(let A=p.length-1;A>=0;A--){let z=p[A];T===void 0?T=z.color:z.color!==T&&(e.fillStyle=T,e.fill(),e.beginPath(),T=z.color),e.rect(z.x,z.y,z.w,z.h)}T!==void 0&&(e.fillStyle=T,e.fill()),e.beginPath()}function G8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V=!1){var b,A,z;if(n!==void 0){e.beginPath(),e.save(),e.rect(0,0,s,a);for(let _ of n)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}let u=(b=v.horizontalBorderColor)!=null?b:v.borderColor,d=v.borderColor,{minX:p,maxX:Z,minY:R,maxY:x}=Ns(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&J<=Z&&w(_+1)&&N.push({x1:J,y1:Math.max(C,R),x2:J,y2:Math.min(a,x),color:d})}let k=a+.5;for(let _=L-g;_=R&&C1<=x-1){let g1=h==null?void 0:h(K);N.push({x1:p,y1:C1,x2:Z,y2:C1,color:(z=(A=g1==null?void 0:g1.horizontalBorderColor)!=null?A:g1==null?void 0:g1.borderColor)!=null?z:u})}_+=m(K),K++}}let T=(0,fs.default)(N,_=>_.color);for(let _ of Object.keys(T)){e.strokeStyle=_;for(let K of T[_])e.moveTo(K.x1,K.y1),e.lineTo(K.x2,K.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function Bs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){let d=[];e.imageSmoothingEnabled=!1;let p=Math.min(r.cellYOffset,a),Z=Math.max(r.cellYOffset,a),R=0;if(typeof V=="number")R+=(Z-p)*V;else for(let z=p;zr.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let z=x;zr.cellXOffset&&(E=-E),E+=o-r.translateX;let k=N4(v);if(E!==0&&R!==0)return{regions:[]};let T=C>0?a4(h,C,V):0,b=c-k-Math.abs(E),A=m-w-T-Math.abs(R)-1;if(b>150&&A>150){let z={sx:0,sy:0,sw:c*g,sh:m*g,dx:0,dy:0,dw:c*g,dh:m*g};if(R>0?(z.sy=(w+1)*g,z.sh=A*g,z.dy=(R+w+1)*g,z.dh=A*g,d.push({x:0,y:w,width:c,height:R+1})):R<0&&(z.sy=(-R+w+1)*g,z.sh=A*g,z.dy=(w+1)*g,z.dh=A*g,d.push({x:0,y:m+R-T,width:c,height:-R+T})),E>0?(z.sx=k*g,z.sw=b*g,z.dx=(E+k)*g,z.dw=b*g,d.push({x:k-1,y:0,width:E+2,height:m})):E<0&&(z.sx=(k-E)*g,z.sw=b*g,z.dx=k*g,z.dw=b*g,d.push({x:c+E,y:0,width:-E,height:m})),e.setTransform(1,0,0,1,0,0),u){if(k>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=k*g,K=m*g;e.drawImage(t,0,0,_,K,0,0,_,K)}if(T>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(m-T)*g,K=c*g,J=T*g;e.drawImage(t,0,_,K,J,0,_,K,J)}}e.drawImage(t,z.sx,z.sy,z.sw,z.sh,z.dx,z.dy,z.dw,z.dh),e.scale(g,g)}return e.imageSmoothingEnabled=!0,{regions:d}}function zs(e,t,i,l,r,s,a,o,n,C){let c=[];return t!==e.cellXOffset||i!==e.cellYOffset||l!==e.translateX||r!==e.translateY||_0(n,i,l,r,o,(m,h,w,g)=>{if(m.sourceIndex===C){let L=Math.max(h,g)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function ys(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let r;for(let s=0;sx.style!=="no-outline");if(v===void 0||v.length===0)return;let V=N4(o),u=a4(w,h,m),d=[n,0,o.length,w-h],p=[V,0,t,i-u],Z=v.map(x=>{var k;let N=x.range,E=(k=x.style)!=null?k:"dashed";return Ui(N,d,t,i,p).map(T=>{let b=T.rect,A=W9(b.x,b.y,t,i,c,C+c,l,r,s,a,w,n,h,o,m),z=b.width===1&&b.height===1?A:W9(b.x+b.width-1,b.y+b.height-1,t,i,c,C+c,l,r,s,a,w,n,h,o,m);return b.x+b.width>=o.length&&(z.width-=1),b.y+b.height>=w&&(z.height-=1),{color:x.color,style:E,clip:T.clip,rect:Wi({x:A.x,y:A.y,width:z.x+z.width-A.x,height:z.y+z.height-A.y},t,i,8)}})}),R=()=>{e.lineWidth=1;let x=!1;for(let N of Z)for(let E of N)if((E==null?void 0:E.rect)!==void 0&&v5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let k=x,T=!_i(E.clip,E.rect);T&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!x?(e.setLineDash([5,3]),x=!0):(E.style==="solid"||E.style==="solid-outline")&&x&&(e.setLineDash([]),x=!1),e.strokeStyle=E.style==="solid-outline"?y0(y0(E.color,L.borderColor),L.bgCell):z0(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),T&&(e.restore(),x=k)}x&&e.setLineDash([])};return R(),R}function $8(e,t,i,l,r){e.beginPath(),e.moveTo(t,i),e.lineTo(t,l),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function o3(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v){var z;if(c.current===void 0)return;let V=c.current.range,u=c.current.cell,d=[V.x+V.width-1,V.y+V.height-1];if(u[1]>=v&&d[1]>=v||!a.some(_=>_.sourceIndex===u[0]||_.sourceIndex===d[0]))return;let[Z,R]=c.current.cell,x=h(c.current.cell),N=(z=x.span)!=null?z:[Z,Z],E=R>=v-w,k=w>0&&!E?a4(v,w,m)-1:0,T=d[1],b;if(_0(a,l,r,s,C,(_,K,J,C1,g1)=>{if(_.sticky&&Z>_.sourceIndex)return;let w1=_.sourceIndexN[1],r1=_.sourceIndex===d[0];if(!(!r1&&(w1||$)))return $4(g1,J,i,v,m,w,g,void 0,(a1,R1,Q)=>{if(R1!==R&&R1!==T)return;let O1=K,v1=_.width;if(x.span!==void 0){let H1=r3(x.span,K,a1,_.width,Q,_,o),W1=_.sticky?H1[0]:H1[1];W1!==void 0&&(O1=W1.x,v1=W1.width)}return R1===T&&r1&&L&&(b=()=>{var H1,W1;C1>O1&&!_.sticky&&(e.beginPath(),e.rect(C1,0,t-C1,i),e.clip()),e.beginPath(),e.rect(O1+v1-4,a1+Q-4,4,4),e.fillStyle=(W1=(H1=_.themeOverride)==null?void 0:H1.accentColor)!=null?W1:n.accentColor,e.fill()}),b!==void 0}),b!==void 0}),b===void 0)return;let A=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-k),e.clip(),b==null||b(),e.restore()};return A(),A}function $H(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),l3(t,i,s,l,(C,c,m,h,w,g)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(m,h,w,g)}),_0(t,o,s,a,r,(C,c,m,h)=>{let w=Math.max(0,h-c),g=c+w+1,L=C.width-w-1;n.has([C.sourceIndex,-1])&&e.rect(g,l,L,r-l)}),e.clip())}function KH(e,t,i,l,r,s,a,o,n,C){let c=0;return _0(e,s,l,r,i,(m,h,w,g,L)=>($4(L,w,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function K8(e,t){var X1,g2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:m,freezeColumns:h,dragAndDropState:w,theme:g,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:k,getCellContent:T,getGroupDetails:b,getRowThemeOverride:A,isFocused:z,drawHeaderCallback:_,prelightCells:K,drawCellCallback:J,highlightRegions:C1,resizeCol:g1,imageLoader:w1,lastBlitData:$,hoverValues:r1,hyperWrapping:a1,hoverInfo:R1,spriteManager:Q,maxScaleFactor:O1,hasAppendRow:v1,touchMode:Q1,enqueue:H1,renderStateProvider:W1,getCellRenderer:Z2,renderStrategy:R2,bufferACtx:h2,bufferBCtx:z1,damage:o2,minimumCellWidth:c2}=e;if(r===0||s===0)return;let J1=R2==="double-buffer",s1=Math.min(O1,Math.ceil((X1=window.devicePixelRatio)!=null?X1:1)),k1=R2!=="direct"&&ys(e,t),e2=i.canvas;(e2.width!==r*s1||e2.height!==s*s1)&&(e2.width=r*s1,e2.height=s*s1,e2.style.width=r+"px",e2.style.height=s+"px");let U1=l.canvas,b1=m?V+v:v,G1=b1+1;(U1.width!==r*s1||U1.height!==G1*s1)&&(U1.width=r*s1,U1.height=G1*s1,U1.style.width=r+"px",U1.style.height=G1+"px");let q1=h2.canvas,L2=z1.canvas;J1&&(q1.width!==r*s1||q1.height!==s*s1)&&(q1.width=r*s1,q1.height=s*s1,$.current!==void 0&&($.current.aBufferScroll=void 0)),J1&&(L2.width!==r*s1||L2.height!==s*s1)&&(L2.width=r*s1,L2.height=s*s1,$.current!==void 0&&($.current.bBufferScroll=void 0));let t1=$.current;if(k1===!0&&a===(t1==null?void 0:t1.cellXOffset)&&o===(t1==null?void 0:t1.cellYOffset)&&n===(t1==null?void 0:t1.translateX)&&C===(t1==null?void 0:t1.translateY))return;let L1=null;J1&&(L1=i);let x1=l,y1;J1?o2!==void 0?y1=(t1==null?void 0:t1.lastBuffer)==="b"?z1:h2:y1=(t1==null?void 0:t1.lastBuffer)==="b"?h2:z1:y1=i;let y2=y1.canvas,B2=J1?y2===q1?L2:q1:e2,i1=typeof d=="number"?()=>d:d;x1.save(),y1.save(),x1.beginPath(),y1.beginPath(),x1.textBaseline="middle",y1.textBaseline="middle",s1!==1&&(x1.scale(s1,s1),y1.scale(s1,s1));let c1=_9(c,a,r,w,n),h1=[],f1=L&&((g2=x.current)==null?void 0:g2.cell[1])===o&&C===0,T1=!1;if(C1!==void 0){for(let d2 of C1)if(d2.style!=="no-outline"&&d2.range.y===o&&C===0){T1=!0;break}}let z2=()=>{var d2,T2;qi(x1,c1,m,R1,r,n,v,V,w,R,x,g,Q,r1,p,b,o2,_,Q1),G8(x1,c1,o,n,C,r,s,void 0,void 0,V,b1,i1,A,p,E,k,g,!0),x1.beginPath(),x1.moveTo(0,G1-.5),x1.lineTo(r,G1-.5),x1.strokeStyle=y0((T2=(d2=g.headerBottomBorderColor)!=null?d2:g.horizontalBorderColor)!=null?T2:g.borderColor,g.bgHeader),x1.stroke(),T1&&q8(x1,r,s,a,o,n,C,c,h,v,V,d,E,k,C1,g),f1&&o3(x1,r,s,o,n,C,c1,c,g,b1,x,i1,T,E,v1,N,k)};if(o2!==void 0){let d2=c1[c1.length-1].sourceIndex+1,T2=o2.hasItemInRegion([{x:a,y:-2,width:d2,height:2},{x:a,y:o,width:d2,height:300},{x:0,y:o,width:h,height:300},{x:0,y:-2,width:h,height:2},{x:a,y:k-E,width:d2,height:E,when:E>0}]),b2=F2=>{f8(F2,c1,c,s,b1,n,C,o,k,i1,T,b,A,u,z,L,E,v1,h1,o2,x,K,C1,w1,Q,r1,R1,J,a1,g,H1,W1,Z2,Z,c2);let f0=x.current;N&&L&&f0!==void 0&&o2.has(X7(f0.range))&&o3(F2,r,s,o,n,C,c1,c,g,b1,x,i1,T,E,v1,N,k)};T2&&(b2(y1),L1!==null&&(L1.save(),L1.scale(s1,s1),L1.textBaseline="middle",b2(L1),L1.restore()),o2.hasHeader()&&($H(x1,c1,r,V,b1,n,C,o,o2),z2())),y1.restore(),x1.restore();return}if((k1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||f1!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||T1!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&z2(),k1===!0){d0(B2!==void 0&&t1!==void 0);let{regions:d2}=Bs(y1,B2,B2===q1?t1.aBufferScroll:t1.bBufferScroll,B2===q1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,k,b1,s1,c,c1,d,J1);h1=d2}else k1!==!1&&(d0(t1!==void 0),h1=zs(t1,a,o,n,C,r,s,b1,c1,k1));Es(y1,c1,r,s,E,k,p,i1,g);let _2=q8(y1,r,s,a,o,n,C,c,h,v,V,d,E,k,C1,g),e0=L?o3(y1,r,s,o,n,C,c1,c,g,b1,x,i1,T,E,v1,N,k):void 0;if(y1.fillStyle=g.bgCell,h1.length>0){y1.beginPath();for(let d2 of h1)y1.rect(d2.x,d2.y,d2.width,d2.height);y1.clip(),y1.fill(),y1.beginPath()}else y1.fillRect(0,0,r,s);let t0=f8(y1,c1,c,s,b1,n,C,o,k,i1,T,b,A,u,z,L,E,v1,h1,o2,x,K,C1,w1,Q,r1,R1,J,a1,g,H1,W1,Z2,Z,c2);Zs(y1,c1,c,r,s,b1,n,C,o,k,i1,A,x.rows,u,E,v1,h1,o2,g),Rs(y1,c1,o,n,C,r,s,h1,b1,i1,A,p,E,k,g),G8(y1,c1,o,n,C,r,s,h1,t0,V,b1,i1,A,p,E,k,g),_2==null||_2(),e0==null||e0(),R&&_0(c1,0,n,0,b1,(d2,T2)=>{var b2,F2;return d2.sourceIndex===g1?($8(x1,T2+d2.width,0,b1+1,y0((b2=g.resizeIndicatorColor)!=null?b2:g.accentLight,g.bgHeader)),$8(y1,T2+d2.width,b1,s,y0((F2=g.resizeIndicatorColor)!=null?F2:g.accentLight,g.bgCell)),!0):!1}),L1!==null&&(L1.fillStyle=g.bgCell,L1.fillRect(0,0,r,s),L1.drawImage(y1.canvas,0,0));let w0=KH(c1,s,b1,n,C,o,k,i1,E,v1);w1==null||w1.setWindow({x:a,y:o,width:c1.length,height:w0-o},h,Array.from({length:E},(d2,T2)=>k-1-T2));let k2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),G0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);$.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:f1,mustDrawHighlightRingsOnHeader:T1,lastBuffer:J1?y2===q1?"a":"b":void 0,aBufferScroll:y2===q1?[k2,G0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:y2===L2?[k2,G0]:t1==null?void 0:t1.bBufferScroll},y1.restore(),x1.restore()}var X8=M1(G9(),1);var XH=80;function jH(e){let t=e-1;return t*t*t+1}var n3=class{constructor(t){s2(this,"callback");s2(this,"currentHoveredItem");s2(this,"leavingItems",[]);s2(this,"lastAnimationTime");s2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>u5(l.item,t.item))||this.leavingItems.push(t)});s2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>u5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});s2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});s2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});s2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>S(B({},t),{hoverAmount:jH(t.hoverAmount)})));s2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/XH;for(let s of this.leavingItems)s.hoverAmount=(0,X8.default)(s.hoverAmount-l,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,X8.default)(this.currentHoveredItem.hoverAmount+l,0,1));let r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});s2(this,"setHovered",t=>{var i;if(!u5((i=this.currentHoveredItem)==null?void 0:i.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){let l=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:l}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}};var j8=class{constructor(t){s2(this,"fn");s2(this,"val");this.fn=t}get value(){var t;return(t=this.val)!=null?t:this.val=this.fn()}};function Y8(e){return new j8(e)}var bs=Y8(()=>window.navigator.userAgent.includes("Firefox")),n9=Y8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),M5=Y8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var x5=M1(S1(),1);function Fs(e){let t=x5.useRef([]),i=x5.useRef(0),l=x5.useRef(e);l.current=e;let r=x5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(t9);t.current=[],l.current(new z4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return x5.useCallback(s=>{t.current.length===0&&r();let a=F0(s[0],s[1]);t.current.includes(a)||t.current.push(a)},[r])}var y4="header",S0="group-header",C9="out-of-bounds",f5;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(f5||(f5={}));function C3(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}var Ss=6,YH=(e,t)=>{var l;if(e.kind===n1.Custom)return e.copyData;let i=t==null?void 0:t(e);return(l=i==null?void 0:i.getAccessibilityString(e))!=null?l:""},QH=(e,t)=>{var h4,g0,H0,i0,c0,I5,n7,v9,L0,E0;let{width:i,height:l,accessibilityHeight:r,columns:s,cellXOffset:a,cellYOffset:o,headerHeight:n,fillHandle:C=!1,groupHeaderHeight:c,rowHeight:m,rows:h,getCellContent:w,getRowThemeOverride:g,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:k=!0,drawFocusRing:T,onMouseDown:b,onMouseUp:A,onMouseMoveRaw:z,onMouseMove:_,onItemHovered:K,dragAndDropState:J,firstColAccessible:C1,onKeyDown:g1,onKeyUp:w1,highlightRegions:$,canvasRef:r1,onDragStart:a1,onDragEnd:R1,eventTargetRef:Q,isResizing:O1,resizeColumn:v1,isDragging:Q1,isDraggable:H1=!1,allowResize:W1,disabledRows:Z2,hasAppendRow:R2,getGroupDetails:h2,theme:z1,prelightCells:o2,headerIcons:c2,verticalBorder:J1,drawCell:s1,drawHeader:k1,onCellFocused:e2,onDragOverCell:U1,onDrop:b1,onDragLeave:G1,imageWindowLoader:q1,smoothScrollX:L2=!1,smoothScrollY:t1=!1,experimental:L1,getCellRenderer:x1}=e,y1=(h4=e.translateX)!=null?h4:0,y2=(g0=e.translateY)!=null?g0:0,B2=Math.max(R,Math.min(s.length-1,a)),i1=e1.useRef(null),c1=q1,h1=e1.useRef(),[f1,T1]=e1.useState(!1),z2=e1.useRef([]),_2=e1.useRef(),[e0,t0]=e1.useState(),[w0,k2]=e1.useState(),G0=e1.useRef(null),[X1,g2]=e1.useState(),[d2,T2]=e1.useState(!1),b2=e1.useRef(d2);b2.current=d2;let F2=e1.useMemo(()=>new t3(c2,()=>{x4.current=void 0,Q4.current()}),[c2]),f0=v?c+n:n,o4=e1.useRef(-1),k0=((H0=L1==null?void 0:L1.enableFirefoxRescaling)!=null?H0:!1)&&bs.value,T0=((i0=L1==null?void 0:L1.enableSafariRescaling)!=null?i0:!1)&&n9.value;e1.useLayoutEffect(()=>{window.devicePixelRatio===1||!k0&&!T0||(o4.current!==-1&&T1(!0),window.clearTimeout(o4.current),o4.current=window.setTimeout(()=>{T1(!1),o4.current=-1},200))},[o,B2,y1,y2,k0,T0]);let Z1=Nt(s,R),P2=E?N4(Z1,J):0,n2=e1.useCallback((y,j,p1)=>{let u1=y.getBoundingClientRect();if(j>=Z1.length||p1>=h)return;let o1=u1.width/i,Y=W9(j,p1,i,l,c,f0,B2,o,y1,y2,h,R,N,Z1,m);return o1!==1&&(Y.x*=o1,Y.y*=o1,Y.width*=o1,Y.height*=o1),Y.x+=u1.x,Y.y+=u1.y,Y},[i,l,c,f0,B2,o,y1,y2,h,R,N,Z1,m]),E2=e1.useCallback((y,j,p1,u1)=>{var U2,V0;let o1=y.getBoundingClientRect(),Y=o1.width/i,_1=(j-o1.left)/Y,K1=(p1-o1.top)/Y,m1=5,$2=_9(Z1,B2,i,void 0,y1),i2=0,$1=0;u1 instanceof MouseEvent&&(i2=u1.button,$1=u1.buttons);let u2=bt(_1,$2,y1),j1=Ft(K1,l,v,n,c,h,m,o,y2,N),A2=(u1==null?void 0:u1.shiftKey)===!0,l0=(u1==null?void 0:u1.ctrlKey)===!0,X0=(u1==null?void 0:u1.metaKey)===!0,K2=u1!==void 0&&!(u1 instanceof MouseEvent)||(u1==null?void 0:u1.pointerType)==="touch",X2=[_1<0?-1:i<_1?1:0,K1i||K1>l){let v2=_1>i?1:_1<0?-1:0,J0=K1>l?1:K1<0?-1:0,p0=v2*2,e4=J0*2;v2===0&&(p0=u2===-1?f5.EndPadding:f5.Center),J0===0&&(e4=j1===void 0?f5.EndPadding:f5.Center);let j0=!1;if(u2===-1&&j1===-1){let e5=n2(y,Z1.length-1,-1);d0(e5!==void 0),j0=ji&&_1l&&K1=0?(J0=!0,v2=n2(y,p0,j1),d0(v2!==void 0),W2={kind:v&&j1===-2?S0:y4,location:[p0,j1],bounds:v2,group:(U2=Z1[p0].group)!=null?U2:"",isEdge:J0,shiftKey:A2,ctrlKey:l0,metaKey:X0,isTouch:K2,localEventX:j-v2.x,localEventY:p1-v2.y,button:i2,buttons:$1,scrollEdge:X2}):W2={kind:v&&j1===-2?S0:y4,group:(V0=Z1[u2].group)!=null?V0:"",location:[u2,j1],bounds:v2,isEdge:J0,shiftKey:A2,ctrlKey:l0,metaKey:X0,isTouch:K2,localEventX:j-v2.x,localEventY:p1-v2.y,button:i2,buttons:$1,scrollEdge:X2}}else{let v2=n2(y,u2,j1);d0(v2!==void 0);let J0=v2!==void 0&&v2.x+v2.width-j{}),n4=e1.useRef(e0);n4.current=e0;let[C4,P0]=e1.useMemo(()=>{let y=document.createElement("canvas"),j=document.createElement("canvas");return y.style.display="none",y.style.opacity="0",y.style.position="fixed",j.style.display="none",j.style.opacity="0",j.style.position="fixed",[y.getContext("2d",{alpha:!1}),j.getContext("2d",{alpha:!1})]},[]);e1.useLayoutEffect(()=>{if(!(C4===null||P0===null))return document.documentElement.append(C4.canvas),document.documentElement.append(P0.canvas),()=>{C4.canvas.remove(),P0.canvas.remove()}},[C4,P0]);let M4=e1.useMemo(()=>new j7,[]),Y4=k0&&f1?1:T0&&f1?2:5,t7=(L1==null?void 0:L1.disableMinimumCellWidth)===!0?1:10,x4=e1.useRef(),z5=e1.useRef(null),y5=e1.useRef(null),b5=e1.useCallback(()=>{var _1,K1,m1;let y=i1.current,j=G0.current;if(y===null||j===null||(z5.current===null&&(z5.current=y.getContext("2d",{alpha:!1}),y.width=0,y.height=0),y5.current===null&&(y5.current=j.getContext("2d",{alpha:!1}),j.width=0,j.height=0),z5.current===null||y5.current===null||C4===null||P0===null))return;let p1=!1,u1=$2=>{p1=!0,g2($2)},o1=x4.current,Y={headerCanvasCtx:y5.current,canvasCtx:z5.current,bufferACtx:C4,bufferBCtx:P0,width:i,height:l,cellXOffset:B2,cellYOffset:o,translateX:Math.round(y1),translateY:Math.round(y2),mappedColumns:Z1,enableGroups:v,freezeColumns:R,dragAndDropState:J,theme:z1,headerHeight:n,groupHeaderHeight:c,disabledRows:Z2!=null?Z2:x2.empty(),rowHeight:m,verticalBorder:J1,isResizing:O1,resizeCol:v1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:s1,hasAppendRow:R2,overrideCursor:u1,maxScaleFactor:Y4,freezeTrailingRows:N,rows:h,drawFocus:T,getCellContent:w,getGroupDetails:h2!=null?h2:$2=>({name:$2}),getRowThemeOverride:g,drawHeaderCallback:k1,prelightCells:o2,highlightRegions:$,imageLoader:c1,lastBlitData:_2,damage:h1.current,hoverValues:z2.current,hoverInfo:n4.current,spriteManager:F2,scrolling:f1,hyperWrapping:(_1=L1==null?void 0:L1.hyperWrapping)!=null?_1:!1,touchMode:d2,enqueue:h0.current,renderStateProvider:M4,renderStrategy:(K1=L1==null?void 0:L1.renderStrategy)!=null?K1:n9.value?"double-buffer":"single-buffer",getCellRenderer:x1,minimumCellWidth:t7};Y.damage===void 0?(x4.current=Y,K8(Y,o1)):K8(Y,void 0),!p1&&(Y.damage===void 0||Y.damage.has((m1=n4==null?void 0:n4.current)==null?void 0:m1[0]))&&g2(void 0)},[C4,P0,i,l,B2,o,y1,y2,Z1,v,R,J,z1,n,c,Z2,m,J1,O1,R2,v1,p,Z,C,N,h,T,Y4,w,h2,g,s1,k1,o2,$,c1,F2,f1,L1==null?void 0:L1.hyperWrapping,L1==null?void 0:L1.renderStrategy,d2,M4,x1,t7]),Q4=e1.useRef(b5);e1.useLayoutEffect(()=>{b5(),Q4.current=b5},[b5]),e1.useLayoutEffect(()=>{(async()=>{var j;((j=document==null?void 0:document.fonts)==null?void 0:j.ready)!==void 0&&(await document.fonts.ready,x4.current=void 0,Q4.current())})()},[]);let A4=e1.useCallback(y=>{h1.current=y,Q4.current(),h1.current=void 0},[]),i7=Fs(A4);h0.current=i7;let l7=e1.useCallback(y=>{A4(new z4(y.map(j=>j.cell)))},[A4]);c1.setCallback(A4);let[p3,M3]=e1.useState(!1),[F5,S4]=t2!=null?t2:[],x3=F5!==void 0&&S4===-1,f3=F5!==void 0&&S4===-2,r7=!1,S5=!1,a0=X1;if(a0===void 0&&F5!==void 0&&S4!==void 0&&S4>-1&&S4({contain:"strict",display:"block",cursor:k5}),[k5]),h9=e1.useRef("default"),D4=Q==null?void 0:Q.current;D4!=null&&h9.current!==T5.cursor&&(D4.style.cursor=h9.current=T5.cursor);let $0=e1.useCallback((y,j,p1,u1)=>{if(h2===void 0)return;let o1=h2(y);if(o1.actions!==void 0){let Y=N8(j,o1.actions);for(let[_1,K1]of Y.entries())if(K4(K1,p1+j.x,u1+K1.y))return o1.actions[_1]}},[h2]),c4=e1.useCallback((y,j,p1,u1)=>{let o1=s[j];if(!Q1&&!O1&&o1.hasMenu===!0&&!(w0!=null&&w0)){let Y=n2(y,j,-1);d0(Y!==void 0);let _1=E8(Y.x,Y.y,Y.width,Y.height,Y5(o1.title)==="rtl");if(p1>_1.x&&p1<_1.x+_1.width&&u1>_1.y&&u1<_1.y+_1.height)return Y}},[s,n2,w0,Q1,O1]),g9=e1.useRef(0),I4=e1.useRef(),H9=e1.useRef(!1),B0=e1.useCallback(y=>{let j=i1.current,p1=Q==null?void 0:Q.current;if(j===null||y.target!==j&&y.target!==p1)return;H9.current=!0;let u1,o1;if(y instanceof MouseEvent?(u1=y.clientX,o1=y.clientY):(u1=y.touches[0].clientX,o1=y.touches[0].clientY),y.target===p1&&p1!==null){let _1=p1.getBoundingClientRect();if(u1>_1.right||o1>_1.bottom)return}let Y=E2(j,u1,o1,y);I4.current=Y.location,Y.isTouch&&(g9.current=Date.now()),b2.current!==Y.isTouch&&T2(Y.isTouch),!(Y.kind===y4&&c4(j,Y.location[0],u1,o1)!==void 0)&&(Y.kind===S0&&$0(Y.group,Y.bounds,Y.localEventX,Y.localEventY)!==void 0||(b==null||b(Y),!Y.isTouch&&H1!==!0&&H1!==Y.kind&&Y.button<3&&Y.button!==1&&y.preventDefault()))},[Q,H1,E2,$0,c4,b]);n0("touchstart",B0,window,!1),n0("mousedown",B0,window,!1);let P5=e1.useRef(0),L9=e1.useCallback(y=>{var $1,u2;let j=P5.current;P5.current=Date.now();let p1=i1.current;if(H9.current=!1,A===void 0||p1===null)return;let u1=Q==null?void 0:Q.current,o1=y.target!==p1&&y.target!==u1,Y,_1,K1=!0;if(y instanceof MouseEvent){if(Y=y.clientX,_1=y.clientY,K1=y.button<3,y.pointerType==="touch")return}else Y=y.changedTouches[0].clientX,_1=y.changedTouches[0].clientY;let m1=E2(p1,Y,_1,y);m1.isTouch&&g9.current!==0&&Date.now()-g9.current>500&&(m1=S(B({},m1),{isLongTouch:!0})),j!==0&&Date.now()-j<(m1.isTouch?1e3:500)&&(m1=S(B({},m1),{isDoubleClick:!0})),b2.current!==m1.isTouch&&T2(m1.isTouch),!o1&&y.cancelable&&K1&&y.preventDefault();let[$2]=m1.location,i2=c4(p1,$2,Y,_1);if(m1.kind===y4&&i2!==void 0){(m1.button!==0||(($1=I4.current)==null?void 0:$1[0])!==$2||((u2=I4.current)==null?void 0:u2[1])!==-1)&&A(m1,!0);return}else if(m1.kind===S0){let j1=$0(m1.group,m1.bounds,m1.localEventX,m1.localEventY);if(j1!==void 0){m1.button===0&&j1.onClick(m1);return}}A(m1,o1)},[A,Q,E2,c4,$0]);n0("mouseup",L9,window,!1),n0("touchend",L9,window,!1);let s7=e1.useCallback(y=>{var i2,$1;let j=i1.current;if(j===null)return;let p1=Q==null?void 0:Q.current,u1=y.target!==j&&y.target!==p1,o1,Y,_1=!0;y instanceof MouseEvent?(o1=y.clientX,Y=y.clientY,_1=y.button<3):(o1=y.changedTouches[0].clientX,Y=y.changedTouches[0].clientY);let K1=E2(j,o1,Y,y);b2.current!==K1.isTouch&&T2(K1.isTouch),!u1&&y.cancelable&&_1&&y.preventDefault();let[m1]=K1.location,$2=c4(j,m1,o1,Y);if(K1.kind===y4&&$2!==void 0)K1.button===0&&((i2=I4.current)==null?void 0:i2[0])===m1&&(($1=I4.current)==null?void 0:$1[1])===-1&&(L==null||L(m1,$2));else if(K1.kind===S0){let u2=$0(K1.group,K1.bounds,K1.localEventX,K1.localEventY);u2!==void 0&&K1.button===0&&u2.onClick(K1)}},[Q,E2,c4,L,$0]);n0("click",s7,window,!1);let Z3=e1.useCallback(y=>{let j=i1.current,p1=Q==null?void 0:Q.current;if(j===null||y.target!==j&&y.target!==p1||x===void 0)return;let u1=E2(j,y.clientX,y.clientY,y);x(u1,()=>{y.cancelable&&y.preventDefault()})},[Q,E2,x]);n0("contextmenu",Z3,(c0=Q==null?void 0:Q.current)!=null?c0:null,!1);let a7=e1.useCallback(y=>{h1.current=new z4(y.map(j=>j.item)),z2.current=y,Q4.current(),h1.current=void 0},[]),m4=e1.useMemo(()=>new n3(a7),[a7]),k4=e1.useRef(m4);k4.current=m4,e1.useLayoutEffect(()=>{let y=k4.current;if(t2===void 0||t2[1]<0){y.setHovered(t2);return}let j=w(t2,!0),p1=x1(j),u1=p1===void 0&&j.kind===n1.Custom||(p1==null?void 0:p1.needsHover)!==void 0&&(typeof p1.needsHover=="boolean"?p1.needsHover:p1.needsHover(j));y.setHovered(u1?t2:void 0)},[w,x1,t2]);let K0=e1.useRef(),D=e1.useCallback(y=>{var K1;let j=i1.current;if(j===null)return;let p1=Q==null?void 0:Q.current,u1=y.target!==j&&y.target!==p1,o1=E2(j,y.clientX,y.clientY,y);if(o1.kind!=="out-of-bounds"&&u1&&!H9.current&&!o1.isTouch)return;let Y=(m1,$2)=>{t0(i2=>i2===m1||(i2==null?void 0:i2[0][0])===(m1==null?void 0:m1[0][0])&&(i2==null?void 0:i2[0][1])===(m1==null?void 0:m1[0][1])&&((i2==null?void 0:i2[1][0])===(m1==null?void 0:m1[1][0])&&(i2==null?void 0:i2[1][1])===(m1==null?void 0:m1[1][1])||!$2)?i2:m1)};if(!C3(o1,K0.current))g2(void 0),K==null||K(o1),Y(o1.kind===C9?void 0:[o1.location,[o1.localEventX,o1.localEventY]],!0),K0.current=o1;else if(o1.kind==="cell"||o1.kind===y4||o1.kind===S0){let m1=!1,$2=!0;if(o1.kind==="cell"){let $1=w(o1.location),u2=(K1=x1($1))==null?void 0:K1.needsHoverPosition;$2=u2!=null?u2:$1.kind===n1.Custom,m1=$2}else o1.kind===S0&&(m1=!0);let i2=[o1.location,[o1.localEventX,o1.localEventY]];Y(i2,$2),n4.current=i2,m1&&A4(new z4([o1.location]))}let _1=o1.location[0]>=(C1?0:1);k2(o1.kind===y4&&o1.isEdge&&_1&&W1===!0),M3(o1.kind==="cell"&&o1.isFillHandle),z==null||z(y),_(o1)},[Q,E2,C1,W1,z,_,K,w,x1,A4]);n0("mousemove",D,window,!0);let q2=e1.useCallback(y=>{let j=i1.current;if(j===null)return;let p1,u1;Z.current!==void 0&&(p1=n2(j,Z.current.cell[0],Z.current.cell[1]),u1=Z.current.cell),g1==null||g1({bounds:p1,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:u1})},[g1,Z,n2]),J4=e1.useCallback(y=>{let j=i1.current;if(j===null)return;let p1,u1;Z.current!==void 0&&(p1=n2(j,Z.current.cell[0],Z.current.cell[1]),u1=Z.current.cell),w1==null||w1({bounds:p1,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:u1})},[w1,Z,n2]),E3=e1.useCallback(y=>{i1.current=y,r1!==void 0&&(r1.current=y)},[r1]),o7=e1.useCallback(y=>{var $1;let j=i1.current;if(j===null||H1===!1||O1){y.preventDefault();return}let p1,u1,o1=E2(j,y.clientX,y.clientY);if(H1!==!0&&o1.kind!==H1){y.preventDefault();return}let Y=(u2,j1)=>{p1=u2,u1=j1},_1,K1,m1,$2=(u2,j1,A2)=>{_1=u2,K1=j1,m1=A2},i2=!1;if(a1==null||a1(S(B({},o1),{setData:Y,setDragImage:$2,preventDefault:()=>i2=!0,defaultPrevented:()=>i2})),!i2&&p1!==void 0&&u1!==void 0&&y.dataTransfer!==null)if(y.dataTransfer.setData(p1,u1),y.dataTransfer.effectAllowed="copyLink",_1!==void 0&&K1!==void 0&&m1!==void 0)y.dataTransfer.setDragImage(_1,K1,m1);else{let[u2,j1]=o1.location;if(j1!==void 0){let A2=document.createElement("canvas"),l0=n2(j,u2,j1);d0(l0!==void 0);let X0=Math.ceil(($1=window.devicePixelRatio)!=null?$1:1);A2.width=l0.width*X0,A2.height=l0.height*X0;let K2=A2.getContext("2d");K2!==null&&(K2.scale(X0,X0),K2.textBaseline="middle",j1===-1?(K2.font=z1.headerFontFull,K2.fillStyle=z1.bgHeader,K2.fillRect(0,0,A2.width,A2.height),R8(K2,0,0,l0.width,l0.height,Z1[u2],!1,z1,!1,!1,0,F2,k1,!1)):(K2.font=z1.baseFontFull,K2.fillStyle=z1.bgCell,K2.fillRect(0,0,A2.width,A2.height),Z8(K2,w([u2,j1]),0,j1,!1,!1,0,0,l0.width,l0.height,!1,z1,z1.bgCell,c1,F2,1,void 0,!1,0,void 0,void 0,void 0,M4,x1,()=>{}))),A2.style.left="-100%",A2.style.position="absolute",A2.style.width=`${l0.width}px`,A2.style.height=`${l0.height}px`,document.body.append(A2),y.dataTransfer.setDragImage(A2,l0.width/2,l0.height/2),window.setTimeout(()=>{A2.remove()},0)}}else y.preventDefault()},[H1,O1,E2,a1,n2,z1,Z1,F2,k1,w,c1,M4,x1]);n0("dragstart",o7,(I5=Q==null?void 0:Q.current)!=null?I5:null,!1,!1);let V9=e1.useRef(),N3=e1.useCallback(y=>{var m1;let j=i1.current;if(b1!==void 0&&y.preventDefault(),j===null||U1===void 0)return;let p1=E2(j,y.clientX,y.clientY),[u1,o1]=p1.location,Y=u1-(C1?0:1),[_1,K1]=(m1=V9.current)!=null?m1:[];(_1!==Y||K1!==o1)&&(V9.current=[Y,o1],U1([Y,o1],y.dataTransfer))},[C1,E2,U1,b1]);n0("dragover",N3,(n7=Q==null?void 0:Q.current)!=null?n7:null,!1,!1);let d9=e1.useCallback(()=>{V9.current=void 0,R1==null||R1()},[R1]);n0("dragend",d9,(v9=Q==null?void 0:Q.current)!=null?v9:null,!1,!1);let W=e1.useCallback(y=>{let j=i1.current;if(j===null||b1===void 0)return;y.preventDefault();let p1=E2(j,y.clientX,y.clientY),[u1,o1]=p1.location,Y=u1-(C1?0:1);b1([Y,o1],y.dataTransfer)},[C1,E2,b1]);n0("drop",W,(L0=Q==null?void 0:Q.current)!=null?L0:null,!1,!1);let Z0=e1.useCallback(()=>{G1==null||G1()},[G1]);n0("dragleave",Z0,(E0=Q==null?void 0:Q.current)!=null?E0:null,!1,!1);let o0=e1.useRef(Z);o0.current=Z;let A5=e1.useRef(null),u9=e1.useCallback(y=>{var j;i1.current===null||!i1.current.contains(document.activeElement)||(y===null&&o0.current.current!==void 0?(j=r1==null?void 0:r1.current)==null||j.focus({preventScroll:!0}):y!==null&&y.focus({preventScroll:!0}),A5.current=y)},[r1]);e1.useImperativeHandle(t,()=>({focus:()=>{var j;let y=A5.current;y===null||!document.contains(y)?(j=r1==null?void 0:r1.current)==null||j.focus({preventScroll:!0}):y.focus({preventScroll:!0})},getBounds:(y,j)=>{if(!(r1===void 0||r1.current===null))return n2(r1.current,y!=null?y:0,j!=null?j:-1)},damage:l7}),[r1,l7,n2]);let O4=e1.useRef(),A0=et(()=>{var K1,m1,$2,i2;if(i<50||(L1==null?void 0:L1.disableAccessibilityTree)===!0)return null;let y=_9(Z1,B2,i,J,y1),j=C1?0:-1;!C1&&((K1=y[0])==null?void 0:K1.sourceIndex)===0&&(y=y.slice(1));let[p1,u1]=($2=(m1=Z.current)==null?void 0:m1.cell)!=null?$2:[],o1=(i2=Z.current)==null?void 0:i2.range,Y=y.map($1=>$1.sourceIndex),_1=(0,ks.default)(o,Math.min(h,o+r));return p1!==void 0&&u1!==void 0&&!(Y.includes(p1)&&_1.includes(u1))&&u9(null),e1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":h+1,"aria-multiselectable":"true","aria-colcount":Z1.length+j},e1.createElement("thead",{role:"rowgroup"},e1.createElement("tr",{role:"row","aria-rowindex":1},y.map($1=>e1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex($1.sourceIndex),"aria-colindex":$1.sourceIndex+1+j,tabIndex:-1,onFocus:u2=>{if(u2.target!==A5.current)return e2==null?void 0:e2([$1.sourceIndex,-1])},key:$1.sourceIndex},$1.title)))),e1.createElement("tbody",{role:"rowgroup"},_1.map($1=>e1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex($1),key:$1,"aria-rowindex":$1+2},y.map(u2=>{let j1=u2.sourceIndex,A2=F0(j1,$1),l0=p1===j1&&u1===$1,X0=o1!==void 0&&j1>=o1.x&&j1=o1.y&&$1{let U2=r1==null?void 0:r1.current;if(U2!=null)return g1==null?void 0:g1({bounds:n2(U2,j1,$1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:X2})},onFocusCapture:U2=>{var V0,v2;if(!(U2.target===A5.current||((V0=O4.current)==null?void 0:V0[0])===j1&&((v2=O4.current)==null?void 0:v2[1])===$1))return O4.current=X2,e2==null?void 0:e2(X2)},ref:l0?u9:void 0,tabIndex:-1},YH(W2,x1))})))))},[i,Z1,B2,J,y1,h,o,r,Z,u9,w,r1,g1,n2,e2],200),w4=R===0||!E?0:B2>R?1:(0,Q8.default)(-y1/100,0,1),R3=-o*32+y2,D5=k?(0,Q8.default)(-R3/100,0,1):0,B3=e1.useMemo(()=>{if(!w4&&!D5)return null;let y={position:"absolute",top:0,left:P2,width:i-P2,height:l,opacity:w4,pointerEvents:"none",transition:L2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},j={position:"absolute",top:f0,left:0,width:i,height:l,opacity:D5,pointerEvents:"none",transition:t1?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return e1.createElement(e1.Fragment,null,w4>0&&e1.createElement("div",{id:"shadow-x",style:y}),D5>0&&e1.createElement("div",{id:"shadow-y",style:j}))},[w4,D5,P2,i,L2,f0,l,t1]),z3=e1.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return e1.createElement(e1.Fragment,null,e1.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:q2,onKeyUp:J4,onFocus:u,onBlur:d,ref:E3,style:T5},A0),e1.createElement("canvas",{ref:G0,style:z3}),B3)},Ts=e1.memo(e1.forwardRef(QH));function Y9(e,t,i,l){var r;return(0,Ps.default)(Math.round(t-((r=e.growOffset)!=null?r:0)),Math.ceil(i),Math.floor(l))}var JH=e=>{var J1;let[t,i]=O2.useState(),[l,r]=O2.useState(),[s,a]=O2.useState(),[o,n]=O2.useState(),[C,c]=O2.useState(!1),[m,h]=O2.useState(),[w,g]=O2.useState(),[L,v]=O2.useState(),[V,u]=O2.useState(!1),[d,p]=O2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:k,gridRef:T,maxColumnWidth:b,minColumnWidth:A,onRowMoved:z,lockColumns:_,onColumnProposeMove:K,onMouseDown:J,onMouseUp:C1,onItemHovered:g1,onDragStart:w1,canvasRef:$}=e,r1=((J1=N!=null?N:k)!=null?J1:E)!==void 0,{columns:a1,selection:R1}=e,Q=R1.columns,O1=O2.useCallback(s1=>{let[k1,e2]=s1.location;s!==void 0&&o!==k1&&k1>=_?(c(!0),n(k1)):w!==void 0&&e2!==void 0?(u(!0),v(Math.max(0,e2))):l===void 0&&!C&&!V&&(g1==null||g1(s1))},[s,w,o,g1,_,l,C,V]),v1=x!==void 0,Q1=O2.useCallback(s1=>{var k1,e2;if(s1.button===0){let[U1,b1]=s1.location;if(s1.kind==="out-of-bounds"&&s1.isEdge&&r1){let G1=(k1=T==null?void 0:T.current)==null?void 0:k1.getBounds(a1.length-1,-1);G1!==void 0&&(i(G1.x),r(a1.length-1))}else if(s1.kind==="header"&&U1>=_){let G1=$==null?void 0:$.current;if(s1.isEdge&&r1&&G1){i(s1.bounds.x),r(U1);let L2=G1.getBoundingClientRect().width/G1.offsetWidth,t1=s1.bounds.width/L2;E==null||E(a1[U1],t1,U1,t1+((e2=a1[U1].growOffset)!=null?e2:0))}else s1.kind==="header"&&v1&&(h(s1.bounds.x),a(U1))}else s1.kind==="cell"&&_>0&&U1===0&&b1!==void 0&&z!==void 0&&(p(s1.bounds.y),g(b1))}J==null||J(s1)},[J,r1,_,z,T,a1,v1,E,$]),H1=O2.useCallback((s1,k1)=>{C||V||Z==null||Z(s1,k1)},[C,V,Z]),W1=O2.useRef(-1),Z2=O2.useCallback(()=>{W1.current=-1,g(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),h(void 0),c(!1),r(void 0),i(void 0)},[]),R2=O2.useCallback((s1,k1)=>{var e2,U1,b1;if(s1.button===0){if(l!==void 0){if((Q==null?void 0:Q.hasIndex(l))===!0)for(let q1 of Q){if(q1===l)continue;let L2=a1[q1],t1=Y9(L2,W1.current,A,b);N==null||N(L2,t1,q1,t1+((e2=L2.growOffset)!=null?e2:0))}let G1=Y9(a1[l],W1.current,A,b);if(k==null||k(a1[l],G1,l,G1+((U1=a1[l].growOffset)!=null?U1:0)),Q.hasIndex(l))for(let q1 of Q){if(q1===l)continue;let L2=a1[q1],t1=Y9(L2,W1.current,A,b);k==null||k(L2,t1,q1,t1+((b1=L2.growOffset)!=null?b1:0))}}Z2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),w!==void 0&&L!==void 0&&(z==null||z(w,L))}C1==null||C1(s1,k1)},[C1,l,s,o,w,L,Q,k,a1,A,b,N,x,z,Z2]),h2=O2.useMemo(()=>{if(!(s===void 0||o===void 0)&&s!==o&&(K==null?void 0:K(s,o))!==!1)return{src:s,dest:o}},[s,o,K]),z1=O2.useCallback(s1=>{var e2,U1;let k1=$==null?void 0:$.current;if(s!==void 0&&m!==void 0)Math.abs(s1.clientX-m)>20&&c(!0);else if(w!==void 0&&d!==void 0)Math.abs(s1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&k1){let G1=k1.getBoundingClientRect().width/k1.offsetWidth,q1=(s1.clientX-t)/G1,L2=a1[l],t1=Y9(L2,q1,A,b);if(N==null||N(L2,t1,l,t1+((e2=L2.growOffset)!=null?e2:0)),W1.current=q1,(Q==null?void 0:Q.first())===l)for(let L1 of Q){if(L1===l)continue;let x1=a1[L1],y1=Y9(x1,W1.current,A,b);N==null||N(x1,y1,L1,y1+((U1=x1.growOffset)!=null?U1:0))}}},[s,m,w,d,l,t,a1,A,b,N,Q,$]),o2=O2.useCallback((s1,k1)=>{if(w===void 0||L===void 0)return R(s1,k1);let[e2,U1]=s1;return U1===L?U1=w:(U1>L&&(U1-=1),U1>=w&&(U1+=1)),R([e2,U1],k1)},[w,L,R]),c2=O2.useCallback(s1=>{w1==null||w1(s1),s1.defaultPrevented()||Z2()},[Z2,w1]);return O2.createElement(Ts,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:l,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:o2,isResizing:l!==void 0,onHeaderMenuClick:H1,isDragging:C,onItemHovered:O1,onDragStart:c2,onMouseDown:Q1,allowResize:r1,onMouseUp:R2,dragAndDropState:h2,onMouseMoveRaw:z1,ref:T})},As=JH;var V2=M1(S1(),1);var c9=M1(S1(),1);function Ds(e){let t=(0,c9.useRef)(null),[i,l]=(0,c9.useState)({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return(0,c9.useLayoutEffect)(()=>{let r=a=>{for(let o of a){let{width:n,height:C}=o&&o.contentRect||{};l(c=>c.width===n&&c.height===C?c:{width:n,height:C})}},s=new window.ResizeObserver(r);return t.current&&s.observe(t.current,void 0),()=>{s.disconnect()}},[t.current]),B({ref:t},i)}var X4=M1(S1(),1),eL=(e,t,i)=>{let l=(0,X4.useRef)(null),r=(0,X4.useRef)(null),s=(0,X4.useRef)(null),a=(0,X4.useRef)(0),o=(0,X4.useRef)(t);o.current=t;let n=i.current;(0,X4.useEffect)(()=>{let C=()=>{var h,w;if(r.current===!1&&n!==null){let g=[n.scrollLeft,n.scrollTop];if(((h=s.current)==null?void 0:h[0])===g[0]&&((w=s.current)==null?void 0:w[1])===g[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(g[0],g[1]),s.current=g;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},m=h=>{h.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let h=n;return h.addEventListener("touchstart",c),h.addEventListener("touchend",m),()=>{h.removeEventListener("touchstart",c),h.removeEventListener("touchend",m),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},Is=eL;var tL=()=>e=>e.isSafari?"scroll":"auto",iL=Q2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[tL()]}});function lL(e){let[t,i]=V2.useState(!1),l=typeof window=="undefined"?null:window,r=V2.useRef(0);return n0("touchstart",V2.useCallback(()=>{window.clearTimeout(r.current),i(!0)},[]),l,!0,!1),n0("touchend",V2.useCallback(s=>{s.touches.length===0&&(r.current=window.setTimeout(()=>i(!1),e))},[e]),l,!0,!1),t}var Os=e=>{var a1,R1,Q,O1;let{children:t,clientHeight:i,scrollHeight:l,scrollWidth:r,update:s,draggable:a,className:o,preventDiagonalScrolling:n=!1,paddingBottom:C=0,paddingRight:c=0,rightElement:m,rightElementProps:h,kineticScrollPerfHack:w=!1,scrollRef:g,initialSize:L}=e,v=[],V=(a1=h==null?void 0:h.sticky)!=null?a1:!1,u=(R1=h==null?void 0:h.fill)!=null?R1:!1,d=V2.useRef(0),p=V2.useRef(0),Z=V2.useRef(null),R=typeof window=="undefined"?1:window.devicePixelRatio,x=V2.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),N=V2.useRef(null),E=lL(200),[k,T]=V2.useState(!0),b=V2.useRef(0);V2.useLayoutEffect(()=>{if(!k||E||x.current.lockDirection===void 0)return;let v1=Z.current;if(v1===null)return;let[Q1,H1]=x.current.lockDirection;Q1!==void 0?v1.scrollLeft=Q1:H1!==void 0&&(v1.scrollTop=H1),x.current.lockDirection=void 0},[E,k]);let A=V2.useCallback((v1,Q1)=>{var e2,U1,b1,G1;let H1=Z.current;if(H1===null)return;Q1=Q1!=null?Q1:H1.scrollTop,v1=v1!=null?v1:H1.scrollLeft;let W1=x.current.scrollTop,Z2=x.current.scrollLeft,R2=v1-Z2,h2=Q1-W1;E&&R2!==0&&h2!==0&&(Math.abs(R2)>3||Math.abs(h2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(R2)0&&(Math.abs(s1)>2e3||J1===0||J1===k1)&&l>H1.scrollHeight+5){let q1=J1/k1,L2=(l-c2)*q1;d.current=L2-J1}z1!==void 0&&(window.clearTimeout(b.current),T(!1),b.current=window.setTimeout(()=>T(!0),200)),s({x:v1,y:J1+d.current,width:o2-c,height:c2-C,paddingRight:(G1=(b1=N.current)==null?void 0:b1.clientWidth)!=null?G1:0})},[C,c,l,s,n,E]);Is(w&&n9.value,A,Z);let z=V2.useRef(A);z.current=A;let _=V2.useRef(),K=V2.useRef(!1);V2.useLayoutEffect(()=>{K.current?A():K.current=!0},[A,C,c]);let J=V2.useCallback(v1=>{Z.current=v1,g!==void 0&&(g.current=v1)},[g]),C1=0,g1=0;for(v.push(V2.createElement("div",{key:C1++,style:{width:r,height:0}}));g1z.current(),0),_.current={width:$,height:r1}),($!=null?$:0)===0||(r1!=null?r1:0)===0?V2.createElement("div",{ref:w1}):V2.createElement("div",{ref:w1},V2.createElement(iL,{isSafari:n9.value},V2.createElement("div",{className:"dvn-underlay"},t),V2.createElement("div",{ref:J,style:_.current,draggable:a,onDragStart:v1=>{a||(v1.stopPropagation(),v1.preventDefault())},className:"dvn-scroller "+(o!=null?o:""),onScroll:()=>A()},V2.createElement("div",{className:"dvn-scroll-inner"+(m===void 0?" dvn-hidden":"")},V2.createElement("div",{className:"dvn-stack"},v),m!==void 0&&V2.createElement(V2.Fragment,null,!u&&V2.createElement("div",{className:"dvn-spacer"}),V2.createElement("div",{ref:N,style:{height:r1,maxHeight:i-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:u?1:void 0,right:V?c!=null?c:0:void 0,pointerEvents:"auto"}},m))))))};var rL=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:m,onVisibleRegionChanged:h,scrollRef:w,preventDiagonalScrolling:g,rightElement:L,rightElementProps:v,overscrollX:V,overscrollY:u,initialSize:d,smoothScrollX:p=!1,smoothScrollY:Z=!1,isDraggable:R}=e,{paddingRight:x,paddingBottom:N}=n!=null?n:{},[E,k]=c,T=W0.useRef(),b=W0.useRef(),A=W0.useRef(),z=W0.useRef(),_=C+Math.max(0,V!=null?V:0),K=a?r+s:r;if(typeof l=="number")K+=i*l;else for(let w1=0;w1{var Z2,R2,h2;if(J.current===void 0)return;let w1=B({},J.current),$=0,r1=w1.x<0?-w1.x:0,a1=0,R1=0;w1.x=w1.x<0?0:w1.x;let Q=0;for(let z1=0;z1=o2+z1.width)$+=z1.width,R1++,a1++;else if(w1.x>o2)$+=z1.width,p?r1+=o2-w1.x:R1++,a1++;else if(w1.x+w1.width>o2)$+=z1.width,a1++;else break}let O1=0,v1=0,Q1=0;if(typeof l=="number")Z?(v1=Math.floor(w1.y/l),O1=v1*l-w1.y):v1=Math.ceil(w1.y/l),Q1=Math.ceil(w1.height/l)+v1,O1<0&&Q1++;else{let z1=0;for(let o2=0;o2=z1+c2)z1+=c2,v1++,Q1++;else if(w1.y>J1)z1+=c2,Z?O1+=J1-w1.y:v1++,Q1++;else if(w1.y+w1.height>c2/2+z1)z1+=c2,Q1++;else break}}let H1={x:R1,y:v1,width:a1-R1,height:Q1-v1},W1=T.current;(W1===void 0||W1.y!==H1.y||W1.x!==H1.x||W1.height!==H1.height||W1.width!==H1.width||b.current!==r1||A.current!==O1||w1.width!==((Z2=z.current)==null?void 0:Z2[0])||w1.height!==((R2=z.current)==null?void 0:R2[1]))&&(h==null||h({x:R1,y:v1,width:a1-R1,height:Q1-v1},w1.width,w1.height,(h2=w1.paddingRight)!=null?h2:0,r1,O1),T.current=H1,b.current=r1,A.current=O1,z.current=[w1.width,w1.height])},[t,l,i,h,o,p,Z]),g1=W0.useCallback(w1=>{J.current=w1,C1()},[C1]);return W0.useEffect(()=>{C1()},[C1]),W0.createElement(Os,{scrollRef:w,className:m,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:g,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:K+(N!=null?N:0),clientHeight:k,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:g1,initialSize:d},W0.createElement(As,{eventTargetRef:w,width:E,height:k,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))},_s=rL;var Ws=Q2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var sL=I1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},I1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),aL=I1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},I1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),oL=I1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},I1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),nL=10,CL=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:m=!1,onSearchClose:h}=e,[w]=I1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[g,L]=I1.useState(""),v=a!=null?a:g,V=I1.useCallback($=>{L($),n==null||n($)},[n]),[u,d]=I1.useState(),p=I1.useRef(u);p.current=u,I1.useEffect(()=>{o!==void 0&&(o.length>0?d($=>{var r1;return{rowsSearched:l,results:o.length,selectedIndex:(r1=$==null?void 0:$.selectedIndex)!=null?r1:-1}}):d(void 0))},[l,o]);let Z=I1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=I1.useRef(),[x,N]=I1.useState([]),E=o!=null?o:x,k=I1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),T=I1.useRef(i);T.current=i;let b=I1.useCallback($=>{let r1=new RegExp($.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),a1=T.current,R1=Math.min(10,l),Q=0;d(void 0),N([]);let O1=[],v1=async()=>{var J1,s1;if(C===void 0)return;let Q1=performance.now(),H1=l-Q,W1=C({x:0,y:a1,width:r.length,height:Math.min(R1,H1,l-a1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let Z2=!1;for(let[k1,e2]of W1.entries())for(let[U1,b1]of e2.entries()){let G1;switch(b1.kind){case n1.Text:case n1.Number:G1=b1.displayData;break;case n1.Uri:case n1.Markdown:G1=b1.data;break;case n1.Boolean:G1=typeof b1.data=="boolean"?b1.data.toString():void 0;break;case n1.Image:case n1.Bubble:G1=b1.data.join("\u{1F433}");break;case n1.Custom:G1=b1.copyData;break}G1!==void 0&&r1.test(G1)&&(O1.push([U1,k1+a1]),Z2=!0)}let R2=performance.now();Z2&&N([...O1]),Q+=W1.length,d0(Q<=l);let h2=(s1=(J1=p.current)==null?void 0:J1.selectedIndex)!=null?s1:-1;d({results:O1.length,rowsSearched:Q,selectedIndex:h2}),c==null||c(O1,h2),a1+R1>=l?a1=0:a1+=R1;let z1=R2-Q1,o2=Math.max(z1,1),c2=nL/o2;R1=Math.ceil(R1*c2),Q{var $;h==null||h(),d(void 0),N([]),c==null||c([],-1),k(),($=t==null?void 0:t.current)==null||$.focus()},[k,t,h,c]),z=I1.useCallback($=>{V($.target.value),o===void 0&&($.target.value===""?(d(void 0),N([]),k()):b($.target.value))},[b,k,V,o]);I1.useEffect(()=>{m&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[m,s,V]);let _=I1.useCallback($=>{var a1;if((a1=$==null?void 0:$.stopPropagation)==null||a1.call($),u===void 0)return;let r1=(u.selectedIndex+1)%u.results;d(S(B({},u),{selectedIndex:r1})),c==null||c(E,r1)},[u,c,E]),K=I1.useCallback($=>{var a1;if((a1=$==null?void 0:$.stopPropagation)==null||a1.call($),u===void 0)return;let r1=(u.selectedIndex-1)%u.results;r1<0&&(r1+=u.results),d(S(B({},u),{selectedIndex:r1})),c==null||c(E,r1)},[c,E,u]),J=I1.useCallback($=>{($.ctrlKey||$.metaKey)&&$.nativeEvent.code==="KeyF"||$.key==="Escape"?(A(),$.stopPropagation(),$.preventDefault()):$.key==="Enter"&&($.shiftKey?K():_())},[A,_,K]);I1.useEffect(()=>()=>{k()},[k]);let[C1,g1]=I1.useState(!1);I1.useEffect(()=>{if(m)g1(!0);else{let $=setTimeout(()=>g1(!1),150);return()=>clearTimeout($)}},[m]);let w1=I1.useMemo(()=>{var Q,O1,v1;if(!m&&!C1)return null;let $;u!==void 0&&($=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&($=`${u.selectedIndex+1} of ${$}`));let r1=Q1=>{Q1.stopPropagation()},R1={width:`${Math.floor(((Q=u==null?void 0:u.rowsSearched)!=null?Q:0)/l*100)}%`};return I1.createElement(Ws,{className:m?"":"out",onMouseDown:r1,onMouseMove:r1,onMouseUp:r1,onClick:r1},I1.createElement("div",{className:"gdg-search-bar-inner"},I1.createElement("input",{id:w,"aria-hidden":!m,"data-testid":"search-input",ref:s,onChange:z,value:v,tabIndex:m?void 0:-1,onKeyDownCapture:J}),I1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:K,disabled:((O1=u==null?void 0:u.results)!=null?O1:0)===0},sL),I1.createElement("button",{"aria-label":"Next Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:_,disabled:((v1=u==null?void 0:u.results)!=null?v1:0)===0},aL),h!==void 0&&I1.createElement("button",{"aria-label":"Close Search","aria-hidden":!m,"data-testid":"search-close-button",tabIndex:m?void 0:-1,onClick:A},oL)),u!==void 0?I1.createElement(I1.Fragment,null,I1.createElement("div",{className:"gdg-search-status"},I1.createElement("div",{"data-testid":"search-result-area"},$)),I1.createElement("div",{className:"gdg-search-progress",style:R1})):I1.createElement("div",{className:"gdg-search-status"},I1.createElement("label",{htmlFor:w},"Type to search")))},[m,C1,u,l,w,s,z,v,J,K,_,h,A]);return I1.createElement(I1.Fragment,null,I1.createElement(_s,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),w1)},Us=CL;var c3=M1(S1(),1);var cL=()=>e=>Math.max(16,e.targetHeight-10),mL=Q2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[cL(),"px"]}}),Gs=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=c3.default.useState(i);return c3.default.createElement(we,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:l},c3.default.createElement(mL,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:l,onFocus:n=>n.target.setSelectionRange(0,a.length),onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"?s(a):n.key==="Escape"&&l()},autoFocus:!0}))};function wL(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function a2(e,t,i){let l=qs(e,t);return l&&(i.didMatch=!0),l}function qs(e,t){if(e.length===0)return!1;if(e.includes("|")){let n=e.split("|");for(let C of n)if(qs(C,t))return!0;return!1}let i=!1,l=!1,r=!1,s=!1,a=e.split("+"),o=a.pop();if(!wL(o,t))return!1;if(a[0]==="any")return!0;for(let n of a)switch(n){case"ctrl":i=!0;break;case"shift":l=!0;break;case"alt":r=!0;break;case"meta":s=!0;break;case"primary":M5.value?s=!0:i=!0;break}return t.altKey===r&&t.ctrlKey===i&&t.shiftKey===l&&t.metaKey===s}var m3=M1(S1(),1);function $s(e,t,i,l,r,s){let a=m3.default.useCallback((C,c,m,h)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=S(B({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let w=i==="mixed"&&(m||h==="drag"),g=l==="mixed"&&w,L=r==="mixed"&&w,v={current:C===void 0?void 0:S(B({},C),{rangeStack:h==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:g?e.columns:x2.empty(),rows:L?e.rows:x2.empty()};m&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=S(B({},v),{current:S(B({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=m3.default.useCallback((C,c,m)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let h;if(r==="exclusive"&&C.length>0)h={current:void 0,columns:x2.empty(),rows:C};else{let w=m&&i==="mixed",g=m&&l==="mixed";h={current:w?e.current:void 0,columns:g?e.columns:x2.empty(),rows:C}}t(h,!1)},[l,e,i,r,t]),n=m3.default.useCallback((C,c,m)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let h;if(l==="exclusive"&&C.length>0)h={current:void 0,rows:x2.empty(),columns:C};else{let w=m&&i==="mixed",g=m&&r==="mixed";h={current:w?e.current:void 0,rows:g?e.rows:x2.empty(),columns:C}}t(h,!1)},[l,e,i,r,t]);return[a,o,n]}var J8=M1(S1(),1);function Ks(e,t,i,l,r){let s=J8.useCallback(C=>{var c;if(e===!0){let m=[];for(let h=C.y;h=r?w.push({kind:n1.Loading,allowOverlay:!1}):w.push(t([g,h]));m.push(w)}return m}return(c=e==null?void 0:e(C,l.signal))!=null?c:[]},[l.signal,t,e,r]),a=e!==void 0?s:void 0,o=J8.useCallback(C=>{if(a===void 0)return[];let c=S(B({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let m=a(c,l.signal);return typeof m=="function"?async()=>(await m()).map(h=>[{kind:n1.Loading,allowOverlay:!1},...h]):m.map(h=>[{kind:n1.Loading,allowOverlay:!1},...h])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function hL(e){var t,i;if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case n1.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===K5?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case n1.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case n1.Image:case n1.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case n1.Drilldown:return{formatted:e.data.map(l=>l.text),rawValue:e.data.map(l=>l.text),format:"string-array"};case n1.Text:return{formatted:(t=e.displayData)!=null?t:e.data,rawValue:e.data,format:"string"};case n1.Uri:return{formatted:(i=e.displayData)!=null?i:e.data,rawValue:e.data,format:"url"};case n1.Markdown:case n1.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case n1.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case n1.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case n1.Protected:return{formatted:"************",rawValue:"",format:"string"};default:s5(e)}}function gL(e,t){return e.map((l,r)=>{let s=t[r];return l.map(a=>a.span!==void 0&&a.span[0]!==s?{formatted:"",rawValue:"",format:"string"}:hL(a))})}function Xs(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function HL(e){var i,l;let t=[];for(let r of e){let s=[];for(let a of r)a.format==="url"?s.push((l=(i=a.rawValue)==null?void 0:i.toString())!=null?l:""):a.format==="string-array"?s.push(a.formatted.map(o=>Xs(o,!0)).join(",")):s.push(Xs(a.formatted,!1));t.push(s.join(" "))}return t.join(` +`},Ii={headerRowID:sm,headerNumber:om,headerCode:am,headerString:nm,headerBoolean:Cm,headerAudioUri:mm,headerVideoUri:wm,headerEmoji:hm,headerImage:gm,headerUri:Di,headerPhone:Hm,headerMarkdown:Lm,headerDate:Vm,headerTime:dm,headerEmail:um,headerReference:vm,headerIfThenElse:pm,headerSingleValue:Mm,headerLookup:xm,headerTextTemplate:fm,headerMath:Zm,headerRollup:Em,headerJoinStrings:Nm,headerSplitString:Rm,headerGeoDistance:Bm,headerArray:zm,rowOwnerOverlay:ym,protectedColumnOverlay:bm,renameIcon:cm};function Fm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var t3=class{constructor(t,i){i2(this,"onSettled");i2(this,"spriteMap",new Map);i2(this,"headerIcons");i2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=Fm(i,o),m=a*Math.ceil(window.devicePixelRatio),h=`${C}_${c}_${m}_${t}`,w=this.spriteMap.get(h);if(w===void 0){let g=this.headerIcons[t];if(g===void 0)return;w=document.createElement("canvas");let L=w.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(g({fgColor:c,bgColor:C}))}`,this.spriteMap.set(h,w);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,m,m)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(w,0,0,m,m,r,s,a,a),n<1&&(l.globalAlpha=1)}};var Q8=x1(U9(),1),ks=x1(v8(),1);function i3(e){if(e.length===0)return;let t;for(let i of e)t=Math.min(t!=null?t:i.y,i.y)}function q4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,m=l-s,h=!1;for(;Co&&n(C,c,w,!1,a&&c===l-1)===!0){h=!0;break}C+=w,c++}if(!h){C=i;for(let w=0;w!g.sticky))==null?void 0:h.sourceIndex)!=null?w:0;if(n>m){let g=Math.max(o,m),L=t,v=l;for(let V=s.sourceIndex-1;V>=g;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=n;V++)v+=a[V].width;c={x:L,y:i,width:v,height:r}}if(m>o){let g=Math.min(n,m-1),L=t,v=l;for(let V=s.sourceIndex-1;V>=o;V--)L-=a[V].width,v+=a[V].width;for(let V=s.sourceIndex+1;V<=g;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Oi(e,t,i,l){if(l==="any")return p8(e,{x:t,y:i,width:1,height:1});if(l==="vertical"&&(t=e.x),l==="horizontal"&&(i=e.y),K7([t,i],e))return;let r=t-e.x,s=e.x+e.width-t,a=i-e.y+1,o=e.y+e.height-i,n=Math.min(l==="vertical"?Number.MAX_SAFE_INTEGER:r,l==="vertical"?Number.MAX_SAFE_INTEGER:s,l==="horizontal"?Number.MAX_SAFE_INTEGER:a,l==="horizontal"?Number.MAX_SAFE_INTEGER:o);return n===o?{x:e.x,y:e.y+e.height,width:e.width,height:i-e.y-e.height+1}:n===a?{x:e.x,y:i,width:e.width,height:e.y-i}:n===s?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function d5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function $4(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function p8(e,t){let i=Math.min(e.x,t.x),l=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-i,s=Math.max(e.y+e.height,t.y+t.height)-l;return{x:i,y:l,width:r,height:s}}function _i(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Wi(e,t,i,l){if(e.x>t||e.y>i||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>i)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=i)return e;let r=-4,s=-4,a=t+4,o=i+4,n=r-e.x,C=e.x+e.width-a,c=s-e.y,m=e.y+e.height-o,h=n>0?e.x+Math.floor(n/l)*l:e.x,w=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,g=c>0?e.y+Math.floor(c/l)*l:e.y,L=m>0?e.y+e.height-Math.floor(m/l)*l:e.y+e.height;return{x:h,y:g,width:w-h,height:L-g}}function Ui(e,t,i,l,r){let[s,a,o,n]=t,[C,c,m,h]=r,{x:w,y:g,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=w+L,d=g+v,p=wo,x=g+v>n,N=w>=s&&ws&&u<=o||wo,E=g>=a&&ga&&d<=n||gn;if(N&&E){let A=Math.max(w,s),k=Math.max(g,a),P=Math.min(u,o),z=Math.min(d,n);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:C,y:c,width:m-C+1,height:h-c+1}})}if(p&&Z){let A=w,k=g,P=Math.min(u,s),z=Math.min(d,a);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let A=Math.max(w,s),k=g,P=Math.min(u,o),z=Math.min(d,a);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:C,y:0,width:m-C+1,height:c+1}})}if(Z&&R){let A=Math.max(w,o),k=g,P=u,z=Math.min(d,a);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:m,y:0,width:i-m+1,height:c+1}})}if(p&&E){let A=w,k=Math.max(g,a),P=Math.min(u,s),z=Math.min(d,n);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:0,y:c,width:C+1,height:h-c+1}})}if(R&&E){let A=Math.max(w,o),k=Math.max(g,a),P=u,z=Math.min(d,n);V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:m,y:c,width:i-m+1,height:h-c+1}})}if(p&&x){let A=w,k=Math.max(g,n),P=Math.min(u,s),z=d;V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:0,y:h,width:C+1,height:l-h+1}})}if(x&&N){let A=Math.max(w,s),k=Math.max(g,n),P=Math.min(u,o),z=d;V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:C,y:h,width:m-C+1,height:l-h+1}})}if(R&&x){let A=Math.max(w,o),k=Math.max(g,n),P=u,z=d;V.push({rect:{x:A,y:k,width:P-A,height:z-k},clip:{x:m,y:h,width:i-m+1,height:l-h+1}})}return V}var Sm={kind:c1.Loading,allowOverlay:!1};function f8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x,N,E,b,A,k,P,z,_,j,a1,m1){var K1;let g1=(K1=d==null?void 0:d.size)!=null?K1:Number.MAX_SAFE_INTEGER,h1=performance.now(),K=P.baseFontFull;e.font=K;let s1={ctx:e},n1=[0,0],N1=v>0?a4(n,v,C):0,e1,A1,u1=i3(u);return I0(t,o,s,a,r,(H1,W1,Z2,B2,V2)=>{var m2;let B1=Math.max(0,B2-W1),r2=W1+B1,c2=r+1,Y1=H1.width-B1,o1=l-r-1;if(u.length>0){let t1=!1;for(let U=0;U{e.save(),e.beginPath(),e.rect(r2,c2,Y1,o1),e.clip()},Q1=p.columns.hasIndex(H1.sourceIndex),U1=m((m2=H1.group)!=null?m2:"").overrideTheme,y1=H1.themeOverride===void 0&&U1===void 0?P:r4(P,U1,H1.themeOverride),G1=y1.baseFontFull;G1!==K&&(K=G1,e.font=G1),S1();let O1;return q4(V2,Z2,l,n,C,v,V,u1,(t1,U,l1,Y,f1)=>{var M0,Y0,h0,n0;if(U<0||(n1[0]=H1.sourceIndex,n1[1]=U,d!==void 0&&!d.has(n1)))return;if(u.length>0){let M1=!1;for(let F2=0;F2z1.span!==void 0&&M1>=z1.span[0]&&M1<=z1.span[1]);w0&&!g&&L?j2=0:w0&&L&&(j2=Math.max(j2,1)),j0&&j2++,w0||(p1&&j2++,Q1&&!f1&&j2++);let s2=z1.kind===c1.Protected?m0.bgCellMedium:m0.bgCell,w2;if((Y||s2!==P.bgCell)&&(w2=b0(s2,w2)),j2>0||I1){I1&&(w2=b0(m0.bgHeader,w2));for(let M1=0;M1m1&&!Y2){let M1=m0.baseFontFull;M1!==K&&(e.font=M1,K=M1),O1=Z8(e,z1,H1.sourceIndex,U,O2,b2,f2,t1,N2,l1,j2>0,m0,w2!=null?w2:m0.bgCell,x,N,(h0=E2==null?void 0:E2.hoverAmount)!=null?h0:0,b,k,h1,A,O1,z,_,j,a1)}return d2&&e.restore(),z1.style==="faded"&&(e.globalAlpha=1),g1--,p0&&(e.restore(),(n0=O1==null?void 0:O1.deprep)==null||n0.call(O1,s1),O1=void 0,S1(),K=G1,e.font=G1),g1<=0}),e.restore(),g1<=0}),e1}var G9=[0,0],q9={x:0,y:0,width:0,height:0},M8=[void 0,()=>{}],x8=!1;function km(){x8=!0}function Z8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u,d,p,Z,R,x,N){var _,j;let E,b;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],b=v[1][1]);let A;G9[0]=i,G9[1]=l,q9.x=a,q9.y=o,q9.width=n,q9.height=C,M8[0]=R.getValue(G9),M8[1]=a1=>R.setValue(G9,a1),x8=!1;let k={ctx:e,theme:m,col:i,row:l,cell:t,rect:q9,highlighted:c,cellFillColor:h,hoverAmount:L,frameTime:u,hoverX:E,drawState:M8,hoverY:b,imageLoader:w,spriteManager:g,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:km},P=Tt(k,t.lastUpdated,u,p,r,s),z=x(t);if(z!==void 0){(p==null?void 0:p.renderer)!==z&&((_=p==null?void 0:p.deprep)==null||_.call(p,k),p=void 0);let a1=(j=z.drawPrep)==null?void 0:j.call(z,k,p);d!==void 0&&!S4(k.cell)?d(k,()=>z.draw(k,t)):z.draw(k,t),A=a1===void 0?void 0:{deprep:a1==null?void 0:a1.deprep,fillStyle:a1==null?void 0:a1.fillStyle,font:a1==null?void 0:a1.font,renderer:z}}return(P||x8)&&(Z==null||Z(G9)),A}function t9(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,m="center",h="square"){var p;let w=Math.floor(r+a/2),g=h==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=D7(c,a,t.cellVerticalPadding),v=L/2,V=A7(m,l,s,t.cellHorizontalPadding,L),u=P7(V,w,L),d=I7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),Z0(e,V-L/2,w-L/2,L,L,g),h==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,w-v+L/1.97),e.lineTo(V-v+L/2.42,w-v+L/1.44),e.lineTo(V-v+L/1.29,w-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case q5:case!1:{e.beginPath(),Z0(e,V-L/2+.5,w-L/2+.5,L-1,L-1,g),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case $5:{e.beginPath(),Z0(e,V-L/2,w-L/2,L,L,g),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),h==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,w),e.lineTo(V+L/3,w),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:l5(i)}}function qi(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=m.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=m.headerFontFull;e.font=R,I0(t,0,s,0,d,(N,E,b,A)=>{var n1,N1,e1;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let k=Math.max(0,A-E);e.save(),e.beginPath(),e.rect(E+k,o,N.width-k,a),e.clip();let P=L((n1=N.group)!=null?n1:"").overrideTheme,z=N.themeOverride===void 0&&P===void 0?m:r4(m,P,N.themeOverride);z.bgHeader!==m.bgHeader&&(e.fillStyle=z.bgHeader,e.fill()),z!==m&&(e.font=z.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),j=n!==void 0||C,a1=!j&&Z===-1&&p===N.sourceIndex,m1=j?0:(e1=(N1=w.find(A1=>A1.item[0]===N.sourceIndex&&A1.item[1]===-1))==null?void 0:N1.hoverAmount)!=null?e1:0,g1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,h1=_?z.accentColor:g1?z.bgHeaderHasFocus:z.bgHeader,K=i?o:0,s1=N.sourceIndex===0?0:1;_?(e.fillStyle=h1,e.fillRect(E+s1,K,N.width-s1,a)):(g1||m1>0)&&(e.beginPath(),e.rect(E+s1,K,N.width-s1,a),g1&&(e.fillStyle=z.bgHeaderHasFocus,e.fill()),m1>0&&(e.globalAlpha=m1,e.fillStyle=z.bgHeaderHovered,e.fill(),e.globalAlpha=1)),R8(e,E,K,N.width,a,N,_,z,a1,g1,m1,h,V,u),e.restore()}),i&&Tm(e,t,r,s,o,l,m,h,w,g,L,v)}function Tm(e,t,i,l,r,s,a,o,n,C,c,m){var v;let[w,g]=(v=s==null?void 0:s[0])!=null?v:[],L=0;l3(t,i,l,r,(V,u,d,p,Z,R)=>{var A,k;if(m!==void 0&&!m.hasItemInRectangle({x:V[0],y:-2,width:V[1]-V[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(d,p,Z,R),e.clip();let x=c(u),N=(x==null?void 0:x.overrideTheme)===void 0?a:r4(a,x.overrideTheme),E=g===-2&&w!==void 0&&w>=V[0]&&w<=V[1],b=E?N.bgHeaderHovered:N.bgHeader;if(b!==a.bgHeader&&(e.fillStyle=b,e.fill()),e.fillStyle=(A=N.textGroupHeader)!=null?A:N.textHeader,x!==void 0){let P=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,P+8,(r-20)/2,20,N),P+=26),e.fillText(x.name,P+8,r/2+f0(e,a.headerFontFull)),x.actions!==void 0&&E){let z=N8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=z[0].x-10,j=d+Z-_;e.rect(_,0,j,r);let a1=e.createLinearGradient(_,0,_+j,0),m1=y0(b,0);a1.addColorStop(0,m1),a1.addColorStop(10/j,b),a1.addColorStop(1,b),e.fillStyle=a1,e.fill(),e.globalAlpha=.6;let[g1,h1]=(k=s==null?void 0:s[1])!=null?k:[-1,-1];for(let K=0;K35){let p=h?35:l-35,Z=h?35*.7:l-35*.7,R=p/l,x=Z/l,N=e.createLinearGradient(t,0,t+l,0),E=y0(L,0);N.addColorStop(h?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(h?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(h&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+f0(e,o.headerFontFull)),h&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===W3.Triangle){e.beginPath();let d=w.x+w.width/2-5.5,p=w.y+w.height/2-3;C8(e,[{x:d,y:p},{x:d+11,y:p},{x:d+5.5,y:p+6}],1),e.fillStyle=L,e.fill()}else if(s.menuIcon===W3.Dots){e.beginPath();let d=w.x+w.width/2,p=w.y+w.height/2;At(e,d,p),e.fillStyle=L,e.fill()}else{let d=w.x+(w.width-o.headerIconSize)/2,p=w.y+(w.height-o.headerIconSize)/2;c.drawSprite(s.menuIcon,"normal",e,d,p,o.headerIconSize,o)}}function R8(e,t,i,l,r,s,a,o,n,C,c,m,h,w){let g=j5(s.title)==="rtl",L=E8(t,i,l,r,g);h!==void 0?h({ctx:e,theme:o,rect:{x:t,y:i,width:l,height:r},column:s,columnIndex:s.sourceIndex,isSelected:a,hoverAmount:c,isHovered:n,hasSelectedCell:C,spriteManager:m,menuBounds:L},()=>Gi(e,t,i,l,r,s,a,o,n,c,m,w,g,L)):Gi(e,t,i,l,r,s,a,o,n,c,m,w,g,L)}var fs=x1(xs(),1);function Zs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){if(V!==void 0||t[t.length-1]!==i[t.length-1])return;let d=i3(v);I0(t,n,a,o,s,(p,Z,R,x,N)=>{if(p!==t[t.length-1])return;Z+=p.width;let E=Math.max(Z,x);E>l||(e.save(),e.beginPath(),e.rect(E,s+1,1e4,r-s-1),e.clip(),q4(N,R,r,C,c,g,L,d,(b,A,k,P)=>{if(!P&&v.length>0&&!v.some(m1=>d5(Z,b,1e4,k,m1.x,m1.y,m1.width,m1.height)))return;let z=h.hasIndex(A),_=w.hasIndex(A);e.beginPath();let j=m==null?void 0:m(A),a1=j===void 0?u:r4(u,j);a1.bgCell!==u.bgCell&&(e.fillStyle=a1.bgCell,e.fillRect(Z,b,1e4,k)),_&&(e.fillStyle=a1.bgHeader,e.fillRect(Z,b,1e4,k)),z&&(e.fillStyle=a1.accentLight,e.fillRect(Z,b,1e4,k))}),e.restore())})}function Es(e,t,i,l,r,s,a,o,n){var g;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(g=n.horizontalBorderColor)!=null?g:n.borderColor,m=n.borderColor,h=C?x4(t):0,w;if(h!==0&&(w=G3(m,n.bgCell),e.beginPath(),e.moveTo(h+.5,0),e.lineTo(h+.5,l),e.strokeStyle=w,e.stroke()),r>0){let L=m===c&&w!==void 0?w:G3(c,n.bgCell),v=a4(s,r,o);e.beginPath(),e.moveTo(0,l-v+.5),e.lineTo(i,l-v+.5),e.strokeStyle=L,e.stroke()}}var Ns=(e,t,i)=>{let l=0,r=t,s=0,a=i;if(e!==void 0&&e.length>0){l=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(let o of e)l=Math.min(l,o.x-1),r=Math.max(r,o.x+o.width+1),s=Math.min(s,o.y-1),a=Math.max(a,o.y+o.height+1)}return{minX:l,maxX:r,minY:s,maxY:a}};function Rs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g){var k;let L=g.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=Ns(o,s,a),p=[],Z=a-a4(w,h,C),R=n,x=i,N=0;for(;R+r=u&&P<=d-1){let _=c==null?void 0:c(x),j=_==null?void 0:_.bgCell;j!==void 0&&j!==L&&x>=w-h&&p.push({x:v,y:P,w:V-v,h:z,color:j})}R+=z,x0)for(let P=0;P=v&&_<=V&&m(P+1)&&p.push({x:_,y:N,w:z.width,h:b,color:j}),E+=z.width}if(p.length===0)return;let A;e.beginPath();for(let P=p.length-1;P>=0;P--){let z=p[P];A===void 0?A=z.color:z.color!==A&&(e.fillStyle=A,e.fill(),e.beginPath(),A=z.color),e.rect(z.x,z.y,z.w,z.h)}A!==void 0&&(e.fillStyle=A,e.fill()),e.beginPath()}function G8(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V=!1){var k,P,z;if(n!==void 0){e.beginPath(),e.save(),e.rect(0,0,s,a);for(let _ of n)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}let u=(k=v.horizontalBorderColor)!=null?k:v.borderColor,d=v.borderColor,{minX:p,maxX:Z,minY:R,maxY:x}=Ns(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&a1<=Z&&w(_+1)&&N.push({x1:a1,y1:Math.max(C,R),x2:a1,y2:Math.min(a,x),color:d})}let b=a+.5;for(let _=L-g;_=R&&m1<=x-1){let g1=h==null?void 0:h(j);N.push({x1:p,y1:m1,x2:Z,y2:m1,color:(z=(P=g1==null?void 0:g1.horizontalBorderColor)!=null?P:g1==null?void 0:g1.borderColor)!=null?z:u})}_+=m(j),j++}}let A=(0,fs.default)(N,_=>_.color);for(let _ of Object.keys(A)){e.strokeStyle=_;for(let j of A[_])e.moveTo(j.x1,j.y1),e.lineTo(j.x2,j.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function Bs(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v,V,u){let d=[];e.imageSmoothingEnabled=!1;let p=Math.min(r.cellYOffset,a),Z=Math.max(r.cellYOffset,a),R=0;if(typeof V=="number")R+=(Z-p)*V;else for(let z=p;zr.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let z=x;zr.cellXOffset&&(E=-E),E+=o-r.translateX;let b=x4(v);if(E!==0&&R!==0)return{regions:[]};let A=C>0?a4(h,C,V):0,k=c-b-Math.abs(E),P=m-w-A-Math.abs(R)-1;if(k>150&&P>150){let z={sx:0,sy:0,sw:c*g,sh:m*g,dx:0,dy:0,dw:c*g,dh:m*g};if(R>0?(z.sy=(w+1)*g,z.sh=P*g,z.dy=(R+w+1)*g,z.dh=P*g,d.push({x:0,y:w,width:c,height:R+1})):R<0&&(z.sy=(-R+w+1)*g,z.sh=P*g,z.dy=(w+1)*g,z.dh=P*g,d.push({x:0,y:m+R-A,width:c,height:-R+A})),E>0?(z.sx=b*g,z.sw=k*g,z.dx=(E+b)*g,z.dw=k*g,d.push({x:b-1,y:0,width:E+2,height:m})):E<0&&(z.sx=(b-E)*g,z.sw=k*g,z.dx=b*g,z.dw=k*g,d.push({x:c+E,y:0,width:-E,height:m})),e.setTransform(1,0,0,1,0,0),u){if(b>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=b*g,j=m*g;e.drawImage(t,0,0,_,j,0,0,_,j)}if(A>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(m-A)*g,j=c*g,a1=A*g;e.drawImage(t,0,_,j,a1,0,_,j,a1)}}e.drawImage(t,z.sx,z.sy,z.sw,z.sh,z.dx,z.dy,z.dw,z.dh),e.scale(g,g)}return e.imageSmoothingEnabled=!0,{regions:d}}function zs(e,t,i,l,r,s,a,o,n,C){let c=[];return t!==e.cellXOffset||i!==e.cellYOffset||l!==e.translateX||r!==e.translateY||I0(n,i,l,r,o,(m,h,w,g)=>{if(m.sourceIndex===C){let L=Math.max(h,g)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function ys(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let r;for(let s=0;sx.style!=="no-outline");if(v===void 0||v.length===0)return;let V=x4(o),u=a4(w,h,m),d=[n,0,o.length,w-h],p=[V,0,t,i-u],Z=v.map(x=>{var b;let N=x.range,E=(b=x.style)!=null?b:"dashed";return Ui(N,d,t,i,p).map(A=>{let k=A.rect,P=_9(k.x,k.y,t,i,c,C+c,l,r,s,a,w,n,h,o,m),z=k.width===1&&k.height===1?P:_9(k.x+k.width-1,k.y+k.height-1,t,i,c,C+c,l,r,s,a,w,n,h,o,m);return k.x+k.width>=o.length&&(z.width-=1),k.y+k.height>=w&&(z.height-=1),{color:x.color,style:E,clip:A.clip,rect:Wi({x:P.x,y:P.y,width:z.x+z.width-P.x,height:z.y+z.height-P.y},t,i,8)}})}),R=()=>{e.lineWidth=1;let x=!1;for(let N of Z)for(let E of N)if((E==null?void 0:E.rect)!==void 0&&d5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let b=x,A=!_i(E.clip,E.rect);A&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!x?(e.setLineDash([5,3]),x=!0):(E.style==="solid"||E.style==="solid-outline")&&x&&(e.setLineDash([]),x=!1),e.strokeStyle=E.style==="solid-outline"?b0(b0(E.color,L.borderColor),L.bgCell):y0(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),A&&(e.restore(),x=b)}x&&e.setLineDash([])};return R(),R}function $8(e,t,i,l,r){e.beginPath(),e.moveTo(t,i),e.lineTo(t,l),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function o3(e,t,i,l,r,s,a,o,n,C,c,m,h,w,g,L,v){var z;if(c.current===void 0)return;let V=c.current.range,u=c.current.cell,d=[V.x+V.width-1,V.y+V.height-1];if(u[1]>=v&&d[1]>=v||!a.some(_=>_.sourceIndex===u[0]||_.sourceIndex===d[0]))return;let[Z,R]=c.current.cell,x=h(c.current.cell),N=(z=x.span)!=null?z:[Z,Z],E=R>=v-w,b=w>0&&!E?a4(v,w,m)-1:0,A=d[1],k;if(I0(a,l,r,s,C,(_,j,a1,m1,g1)=>{if(_.sticky&&Z>_.sourceIndex)return;let h1=_.sourceIndexN[1],s1=_.sourceIndex===d[0];if(!(!s1&&(h1||K)))return q4(g1,a1,i,v,m,w,g,void 0,(n1,N1,e1)=>{if(N1!==R&&N1!==A)return;let A1=j,u1=_.width;if(x.span!==void 0){let H1=r3(x.span,j,n1,_.width,e1,_,o),W1=_.sticky?H1[0]:H1[1];W1!==void 0&&(A1=W1.x,u1=W1.width)}return N1===A&&s1&&L&&(k=()=>{var H1,W1;m1>A1&&!_.sticky&&(e.beginPath(),e.rect(m1,0,t-m1,i),e.clip()),e.beginPath(),e.rect(A1+u1-4,n1+e1-4,4,4),e.fillStyle=(W1=(H1=_.themeOverride)==null?void 0:H1.accentColor)!=null?W1:n.accentColor,e.fill()}),k!==void 0}),k!==void 0}),k===void 0)return;let P=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-b),e.clip(),k==null||k(),e.restore()};return P(),P}function $H(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),l3(t,i,s,l,(C,c,m,h,w,g)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(m,h,w,g)}),I0(t,o,s,a,r,(C,c,m,h)=>{let w=Math.max(0,h-c),g=c+w+1,L=C.width-w-1;n.has([C.sourceIndex,-1])&&e.rect(g,l,L,r-l)}),e.clip())}function KH(e,t,i,l,r,s,a,o,n,C){let c=0;return I0(e,s,l,r,i,(m,h,w,g,L)=>(q4(L,w,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function K8(e,t){var s2,w2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:m,freezeColumns:h,dragAndDropState:w,theme:g,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:b,getCellContent:A,getGroupDetails:k,getRowThemeOverride:P,isFocused:z,drawHeaderCallback:_,prelightCells:j,drawCellCallback:a1,highlightRegions:m1,resizeCol:g1,imageLoader:h1,lastBlitData:K,hoverValues:s1,hyperWrapping:n1,hoverInfo:N1,spriteManager:e1,maxScaleFactor:A1,hasAppendRow:u1,touchMode:K1,enqueue:H1,renderStateProvider:W1,getCellRenderer:Z2,renderStrategy:B2,bufferACtx:V2,bufferBCtx:B1,damage:r2,minimumCellWidth:c2}=e;if(r===0||s===0)return;let Y1=B2==="double-buffer",o1=Math.min(A1,Math.ceil((s2=window.devicePixelRatio)!=null?s2:1)),S1=B2!=="direct"&&ys(e,t),Q1=i.canvas;(Q1.width!==r*o1||Q1.height!==s*o1)&&(Q1.width=r*o1,Q1.height=s*o1,Q1.style.width=r+"px",Q1.style.height=s+"px");let U1=l.canvas,y1=m?V+v:v,G1=y1+1;(U1.width!==r*o1||U1.height!==G1*o1)&&(U1.width=r*o1,U1.height=G1*o1,U1.style.width=r+"px",U1.style.height=G1+"px");let O1=V2.canvas,m2=B1.canvas;Y1&&(O1.width!==r*o1||O1.height!==s*o1)&&(O1.width=r*o1,O1.height=s*o1,K.current!==void 0&&(K.current.aBufferScroll=void 0)),Y1&&(m2.width!==r*o1||m2.height!==s*o1)&&(m2.width=r*o1,m2.height=s*o1,K.current!==void 0&&(K.current.bBufferScroll=void 0));let t1=K.current;if(S1===!0&&a===(t1==null?void 0:t1.cellXOffset)&&o===(t1==null?void 0:t1.cellYOffset)&&n===(t1==null?void 0:t1.translateX)&&C===(t1==null?void 0:t1.translateY))return;let U=null;Y1&&(U=i);let l1=l,Y;Y1?r2!==void 0?Y=(t1==null?void 0:t1.lastBuffer)==="b"?B1:V2:Y=(t1==null?void 0:t1.lastBuffer)==="b"?V2:B1:Y=i;let f1=Y.canvas,p1=Y1?f1===O1?m2:O1:Q1,I1=typeof d=="number"?()=>d:d;l1.save(),Y.save(),l1.beginPath(),Y.beginPath(),l1.textBaseline="middle",Y.textBaseline="middle",o1!==1&&(l1.scale(o1,o1),Y.scale(o1,o1));let z1=O9(c,a,r,w,n),f2=[],N2=L&&((w2=x.current)==null?void 0:w2.cell[1])===o&&C===0,p0=!1;if(m1!==void 0){for(let d2 of m1)if(d2.style!=="no-outline"&&d2.range.y===o&&C===0){p0=!0;break}}let Y2=()=>{var d2,O2;qi(l1,z1,m,N1,r,n,v,V,w,R,x,g,e1,s1,p,k,r2,_,K1),G8(l1,z1,o,n,C,r,s,void 0,void 0,V,y1,I1,P,p,E,b,g,!0),l1.beginPath(),l1.moveTo(0,G1-.5),l1.lineTo(r,G1-.5),l1.strokeStyle=b0((O2=(d2=g.headerBottomBorderColor)!=null?d2:g.horizontalBorderColor)!=null?O2:g.borderColor,g.bgHeader),l1.stroke(),p0&&q8(l1,r,s,a,o,n,C,c,h,v,V,d,E,b,m1,g),N2&&o3(l1,r,s,o,n,C,z1,c,g,y1,x,I1,A,E,u1,N,b)};if(r2!==void 0){let d2=z1[z1.length-1].sourceIndex+1,O2=r2.hasItemInRegion([{x:a,y:-2,width:d2,height:2},{x:a,y:o,width:d2,height:300},{x:0,y:o,width:h,height:300},{x:0,y:-2,width:h,height:2},{x:a,y:b-E,width:d2,height:E,when:E>0}]),b2=E2=>{f8(E2,z1,c,s,y1,n,C,o,b,I1,A,k,P,u,z,L,E,u1,f2,r2,x,j,m1,h1,e1,s1,N1,a1,n1,g,H1,W1,Z2,Z,c2);let M0=x.current;N&&L&&M0!==void 0&&r2.has(X7(M0.range))&&o3(E2,r,s,o,n,C,z1,c,g,y1,x,I1,A,E,u1,N,b)};O2&&(b2(Y),U!==null&&(U.save(),U.scale(o1,o1),U.textBaseline="middle",b2(U),U.restore()),r2.hasHeader()&&($H(l1,z1,r,V,y1,n,C,o,r2),Y2())),Y.restore(),l1.restore();return}if((S1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||N2!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||p0!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&Y2(),S1===!0){d0(p1!==void 0&&t1!==void 0);let{regions:d2}=Bs(Y,p1,p1===O1?t1.aBufferScroll:t1.bBufferScroll,p1===O1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,b,y1,o1,c,z1,d,Y1);f2=d2}else S1!==!1&&(d0(t1!==void 0),f2=zs(t1,a,o,n,C,r,s,y1,z1,S1));Es(Y,z1,r,s,E,b,p,I1,g);let l0=q8(Y,r,s,a,o,n,C,c,h,v,V,d,E,b,m1,g),Q2=L?o3(Y,r,s,o,n,C,z1,c,g,y1,x,I1,A,E,u1,N,b):void 0;if(Y.fillStyle=g.bgCell,f2.length>0){Y.beginPath();for(let d2 of f2)Y.rect(d2.x,d2.y,d2.width,d2.height);Y.clip(),Y.fill(),Y.beginPath()}else Y.fillRect(0,0,r,s);let m0=f8(Y,z1,c,s,y1,n,C,o,b,I1,A,k,P,u,z,L,E,u1,f2,r2,x,j,m1,h1,e1,s1,N1,a1,n1,g,H1,W1,Z2,Z,c2);Zs(Y,z1,c,r,s,y1,n,C,o,b,I1,P,x.rows,u,E,u1,f2,r2,g),Rs(Y,z1,o,n,C,r,s,f2,y1,I1,P,p,E,b,g),G8(Y,z1,o,n,C,r,s,f2,m0,V,y1,I1,P,p,E,b,g),l0==null||l0(),Q2==null||Q2(),R&&I0(z1,0,n,0,y1,(d2,O2)=>{var b2,E2;return d2.sourceIndex===g1?($8(l1,O2+d2.width,0,y1+1,b0((b2=g.resizeIndicatorColor)!=null?b2:g.accentLight,g.bgHeader)),$8(Y,O2+d2.width,y1,s,b0((E2=g.resizeIndicatorColor)!=null?E2:g.accentLight,g.bgCell)),!0):!1}),U!==null&&(U.fillStyle=g.bgCell,U.fillRect(0,0,r,s),U.drawImage(Y.canvas,0,0));let w0=KH(z1,s,y1,n,C,o,b,I1,E,u1);h1==null||h1.setWindow({x:a,y:o,width:z1.length,height:w0-o},h,Array.from({length:E},(d2,O2)=>b-1-O2));let j2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),j0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);K.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:N2,mustDrawHighlightRingsOnHeader:p0,lastBuffer:Y1?f1===O1?"a":"b":void 0,aBufferScroll:f1===O1?[j2,j0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:f1===m2?[j2,j0]:t1==null?void 0:t1.bBufferScroll},Y.restore(),l1.restore()}var X8=x1(U9(),1);var XH=80;function jH(e){let t=e-1;return t*t*t+1}var n3=class{constructor(t){i2(this,"callback");i2(this,"currentHoveredItem");i2(this,"leavingItems",[]);i2(this,"lastAnimationTime");i2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>V5(l.item,t.item))||this.leavingItems.push(t)});i2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>V5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});i2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});i2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});i2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>S(B({},t),{hoverAmount:jH(t.hoverAmount)})));i2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/XH;for(let s of this.leavingItems)s.hoverAmount=(0,X8.default)(s.hoverAmount-l,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,X8.default)(this.currentHoveredItem.hoverAmount+l,0,1));let r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});i2(this,"setHovered",t=>{var i;if(!V5((i=this.currentHoveredItem)==null?void 0:i.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){let l=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:l}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}};var j8=class{constructor(t){i2(this,"fn");i2(this,"val");this.fn=t}get value(){var t;return(t=this.val)!=null?t:this.val=this.fn()}};function Y8(e){return new j8(e)}var bs=Y8(()=>window.navigator.userAgent.includes("Firefox")),o9=Y8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),v5=Y8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var p5=x1(F1(),1);function Fs(e){let t=p5.useRef([]),i=p5.useRef(0),l=p5.useRef(e);l.current=e;let r=p5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(e9);t.current=[],l.current(new E4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return p5.useCallback(s=>{t.current.length===0&&r();let a=S0(s[0],s[1]);t.current.includes(a)||t.current.push(a)},[r])}var N4="header",k0="group-header",n9="out-of-bounds",M5;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(M5||(M5={}));function C3(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}var Ss=6,YH=(e,t)=>{var l;if(e.kind===c1.Custom)return e.copyData;let i=t==null?void 0:t(e);return(l=i==null?void 0:i.getAccessibilityString(e))!=null?l:""},QH=(e,t)=>{var c4,g0,H0,J2,C0,D5,n7,u9,L0,N0;let{width:i,height:l,accessibilityHeight:r,columns:s,cellXOffset:a,cellYOffset:o,headerHeight:n,fillHandle:C=!1,groupHeaderHeight:c,rowHeight:m,rows:h,getCellContent:w,getRowThemeOverride:g,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:b=!0,drawFocusRing:A,onMouseDown:k,onMouseUp:P,onMouseMoveRaw:z,onMouseMove:_,onItemHovered:j,dragAndDropState:a1,firstColAccessible:m1,onKeyDown:g1,onKeyUp:h1,highlightRegions:K,canvasRef:s1,onDragStart:n1,onDragEnd:N1,eventTargetRef:e1,isResizing:A1,resizeColumn:u1,isDragging:K1,isDraggable:H1=!1,allowResize:W1,disabledRows:Z2,hasAppendRow:B2,getGroupDetails:V2,theme:B1,prelightCells:r2,headerIcons:c2,verticalBorder:Y1,drawCell:o1,drawHeader:S1,onCellFocused:Q1,onDragOverCell:U1,onDrop:y1,onDragLeave:G1,imageWindowLoader:O1,smoothScrollX:m2=!1,smoothScrollY:t1=!1,experimental:U,getCellRenderer:l1}=e,Y=(c4=e.translateX)!=null?c4:0,f1=(g0=e.translateY)!=null?g0:0,p1=Math.max(R,Math.min(s.length-1,a)),I1=i1.useRef(null),z1=O1,f2=i1.useRef(),[N2,p0]=i1.useState(!1),Y2=i1.useRef([]),l0=i1.useRef(),[Q2,m0]=i1.useState(),[w0,j2]=i1.useState(),j0=i1.useRef(null),[s2,w2]=i1.useState(),[d2,O2]=i1.useState(!1),b2=i1.useRef(d2);b2.current=d2;let E2=i1.useMemo(()=>new t3(c2,()=>{u4.current=void 0,j4.current()}),[c2]),M0=v?c+n:n,Y0=i1.useRef(-1),h0=((H0=U==null?void 0:U.enableFirefoxRescaling)!=null?H0:!1)&&bs.value,n0=((J2=U==null?void 0:U.enableSafariRescaling)!=null?J2:!1)&&o9.value;i1.useLayoutEffect(()=>{window.devicePixelRatio===1||!h0&&!n0||(Y0.current!==-1&&p0(!0),window.clearTimeout(Y0.current),Y0.current=window.setTimeout(()=>{p0(!1),Y0.current=-1},200))},[o,p1,Y,f1,h0,n0]);let M1=Nt(s,R),F2=E?x4(M1,a1):0,o2=i1.useCallback((y,Q,v1)=>{let d1=y.getBoundingClientRect();if(Q>=M1.length||v1>=h)return;let C1=d1.width/i,J=_9(Q,v1,i,l,c,M0,p1,o,Y,f1,h,R,N,M1,m);return C1!==1&&(J.x*=C1,J.y*=C1,J.width*=C1,J.height*=C1),J.x+=d1.x,J.y+=d1.y,J},[i,l,c,M0,p1,o,Y,f1,h,R,N,M1,m]),z2=i1.useCallback((y,Q,v1,d1)=>{var D2,V0;let C1=y.getBoundingClientRect(),J=C1.width/i,_1=(Q-C1.left)/J,$1=(v1-C1.top)/J,w1=5,W2=O9(M1,p1,i,void 0,Y),J1=0,q1=0;d1 instanceof MouseEvent&&(J1=d1.button,q1=d1.buttons);let L2=bt(_1,W2,Y),X1=Ft($1,l,v,n,c,h,m,o,f1,N),S2=(d1==null?void 0:d1.shiftKey)===!0,e0=(d1==null?void 0:d1.ctrlKey)===!0,q0=(d1==null?void 0:d1.metaKey)===!0,U2=d1!==void 0&&!(d1 instanceof MouseEvent)||(d1==null?void 0:d1.pointerType)==="touch",G2=[_1<0?-1:i<_1?1:0,$1i||$1>l){let u2=_1>i?1:_1<0?-1:0,J0=$1>l?1:$1<0?-1:0,x0=u2*2,e4=J0*2;u2===0&&(x0=L2===-1?M5.EndPadding:M5.Center),J0===0&&(e4=X1===void 0?M5.EndPadding:M5.Center);let $0=!1;if(L2===-1&&X1===-1){let Q4=o2(y,M1.length-1,-1);d0(Q4!==void 0),$0=Qi&&_1l&&$1=0?(J0=!0,u2=o2(y,x0,X1),d0(u2!==void 0),A2={kind:v&&X1===-2?k0:N4,location:[x0,X1],bounds:u2,group:(D2=M1[x0].group)!=null?D2:"",isEdge:J0,shiftKey:S2,ctrlKey:e0,metaKey:q0,isTouch:U2,localEventX:Q-u2.x,localEventY:v1-u2.y,button:J1,buttons:q1,scrollEdge:G2}):A2={kind:v&&X1===-2?k0:N4,group:(V0=M1[L2].group)!=null?V0:"",location:[L2,X1],bounds:u2,isEdge:J0,shiftKey:S2,ctrlKey:e0,metaKey:q0,isTouch:U2,localEventX:Q-u2.x,localEventY:v1-u2.y,button:J1,buttons:q1,scrollEdge:G2}}else{let u2=o2(y,L2,X1);d0(u2!==void 0);let J0=u2!==void 0&&u2.x+u2.width-Q{}),T4=i1.useRef(Q2);T4.current=Q2;let[z4,y4]=i1.useMemo(()=>{let y=document.createElement("canvas"),Q=document.createElement("canvas");return y.style.display="none",y.style.opacity="0",y.style.position="fixed",Q.style.display="none",Q.style.opacity="0",Q.style.position="fixed",[y.getContext("2d",{alpha:!1}),Q.getContext("2d",{alpha:!1})]},[]);i1.useLayoutEffect(()=>{if(!(z4===null||y4===null))return document.documentElement.append(z4.canvas),document.documentElement.append(y4.canvas),()=>{z4.canvas.remove(),y4.canvas.remove()}},[z4,y4]);let R5=i1.useMemo(()=>new j7,[]),e7=h0&&N2?1:n0&&N2?2:5,t7=(U==null?void 0:U.disableMinimumCellWidth)===!0?1:10,u4=i1.useRef(),B5=i1.useRef(null),z5=i1.useRef(null),y5=i1.useCallback(()=>{var _1,$1,w1;let y=I1.current,Q=j0.current;if(y===null||Q===null||(B5.current===null&&(B5.current=y.getContext("2d",{alpha:!1}),y.width=0,y.height=0),z5.current===null&&(z5.current=Q.getContext("2d",{alpha:!1}),Q.width=0,Q.height=0),B5.current===null||z5.current===null||z4===null||y4===null))return;let v1=!1,d1=W2=>{v1=!0,w2(W2)},C1=u4.current,J={headerCanvasCtx:z5.current,canvasCtx:B5.current,bufferACtx:z4,bufferBCtx:y4,width:i,height:l,cellXOffset:p1,cellYOffset:o,translateX:Math.round(Y),translateY:Math.round(f1),mappedColumns:M1,enableGroups:v,freezeColumns:R,dragAndDropState:a1,theme:B1,headerHeight:n,groupHeaderHeight:c,disabledRows:Z2!=null?Z2:M2.empty(),rowHeight:m,verticalBorder:Y1,isResizing:A1,resizeCol:u1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:o1,hasAppendRow:B2,overrideCursor:d1,maxScaleFactor:e7,freezeTrailingRows:N,rows:h,drawFocus:A,getCellContent:w,getGroupDetails:V2!=null?V2:W2=>({name:W2}),getRowThemeOverride:g,drawHeaderCallback:S1,prelightCells:r2,highlightRegions:K,imageLoader:z1,lastBlitData:l0,damage:f2.current,hoverValues:Y2.current,hoverInfo:T4.current,spriteManager:E2,scrolling:N2,hyperWrapping:(_1=U==null?void 0:U.hyperWrapping)!=null?_1:!1,touchMode:d2,enqueue:Q0.current,renderStateProvider:R5,renderStrategy:($1=U==null?void 0:U.renderStrategy)!=null?$1:o9.value?"double-buffer":"single-buffer",getCellRenderer:l1,minimumCellWidth:t7};J.damage===void 0?(u4.current=J,K8(J,C1)):K8(J,void 0),!v1&&(J.damage===void 0||J.damage.has((w1=T4==null?void 0:T4.current)==null?void 0:w1[0]))&&w2(void 0)},[z4,y4,i,l,p1,o,Y,f1,M1,v,R,a1,B1,n,c,Z2,m,Y1,A1,B2,u1,p,Z,C,N,h,A,e7,w,V2,g,o1,S1,r2,K,z1,E2,N2,U==null?void 0:U.hyperWrapping,U==null?void 0:U.renderStrategy,d2,R5,l1,t7]),j4=i1.useRef(y5);i1.useLayoutEffect(()=>{y5(),j4.current=y5},[y5]),i1.useLayoutEffect(()=>{(async()=>{var Q;((Q=document==null?void 0:document.fonts)==null?void 0:Q.ready)!==void 0&&(await document.fonts.ready,u4.current=void 0,j4.current())})()},[]);let P4=i1.useCallback(y=>{f2.current=y,j4.current(),f2.current=void 0},[]),i7=Fs(P4);Q0.current=i7;let l7=i1.useCallback(y=>{P4(new E4(y.map(Q=>Q.cell)))},[P4]);z1.setCallback(P4);let[p3,M3]=i1.useState(!1),[b5,b4]=n2!=null?n2:[],x3=b5!==void 0&&b4===-1,f3=b5!==void 0&&b4===-2,r7=!1,F5=!1,r0=s2;if(r0===void 0&&b5!==void 0&&b4!==void 0&&b4>-1&&b4({contain:"strict",display:"block",cursor:S5}),[S5]),w9=i1.useRef("default"),A4=e1==null?void 0:e1.current;A4!=null&&w9.current!==k5.cursor&&(A4.style.cursor=w9.current=k5.cursor);let U0=i1.useCallback((y,Q,v1,d1)=>{if(V2===void 0)return;let C1=V2(y);if(C1.actions!==void 0){let J=N8(Q,C1.actions);for(let[_1,$1]of J.entries())if($4($1,v1+Q.x,d1+$1.y))return C1.actions[_1]}},[V2]),o4=i1.useCallback((y,Q,v1,d1)=>{let C1=s[Q];if(!K1&&!A1&&C1.hasMenu===!0&&!(w0!=null&&w0)){let J=o2(y,Q,-1);d0(J!==void 0);let _1=E8(J.x,J.y,J.width,J.height,j5(C1.title)==="rtl");if(v1>_1.x&&v1<_1.x+_1.width&&d1>_1.y&&d1<_1.y+_1.height)return J}},[s,o2,w0,K1,A1]),h9=i1.useRef(0),D4=i1.useRef(),g9=i1.useRef(!1),z0=i1.useCallback(y=>{let Q=I1.current,v1=e1==null?void 0:e1.current;if(Q===null||y.target!==Q&&y.target!==v1)return;g9.current=!0;let d1,C1;if(y instanceof MouseEvent?(d1=y.clientX,C1=y.clientY):(d1=y.touches[0].clientX,C1=y.touches[0].clientY),y.target===v1&&v1!==null){let _1=v1.getBoundingClientRect();if(d1>_1.right||C1>_1.bottom)return}let J=z2(Q,d1,C1,y);D4.current=J.location,J.isTouch&&(h9.current=Date.now()),b2.current!==J.isTouch&&O2(J.isTouch),!(J.kind===N4&&o4(Q,J.location[0],d1,C1)!==void 0)&&(J.kind===k0&&U0(J.group,J.bounds,J.localEventX,J.localEventY)!==void 0||(k==null||k(J),!J.isTouch&&H1!==!0&&H1!==J.kind&&J.button<3&&J.button!==1&&y.preventDefault()))},[e1,H1,z2,U0,o4,k]);a0("touchstart",z0,window,!1),a0("mousedown",z0,window,!1);let T5=i1.useRef(0),H9=i1.useCallback(y=>{var q1,L2;let Q=T5.current;T5.current=Date.now();let v1=I1.current;if(g9.current=!1,P===void 0||v1===null)return;let d1=e1==null?void 0:e1.current,C1=y.target!==v1&&y.target!==d1,J,_1,$1=!0;if(y instanceof MouseEvent){if(J=y.clientX,_1=y.clientY,$1=y.button<3,y.pointerType==="touch")return}else J=y.changedTouches[0].clientX,_1=y.changedTouches[0].clientY;let w1=z2(v1,J,_1,y);w1.isTouch&&h9.current!==0&&Date.now()-h9.current>500&&(w1=S(B({},w1),{isLongTouch:!0})),Q!==0&&Date.now()-Q<(w1.isTouch?1e3:500)&&(w1=S(B({},w1),{isDoubleClick:!0})),b2.current!==w1.isTouch&&O2(w1.isTouch),!C1&&y.cancelable&&$1&&y.preventDefault();let[W2]=w1.location,J1=o4(v1,W2,J,_1);if(w1.kind===N4&&J1!==void 0){(w1.button!==0||((q1=D4.current)==null?void 0:q1[0])!==W2||((L2=D4.current)==null?void 0:L2[1])!==-1)&&P(w1,!0);return}else if(w1.kind===k0){let X1=U0(w1.group,w1.bounds,w1.localEventX,w1.localEventY);if(X1!==void 0){w1.button===0&&X1.onClick(w1);return}}P(w1,C1)},[P,e1,z2,o4,U0]);a0("mouseup",H9,window,!1),a0("touchend",H9,window,!1);let s7=i1.useCallback(y=>{var J1,q1;let Q=I1.current;if(Q===null)return;let v1=e1==null?void 0:e1.current,d1=y.target!==Q&&y.target!==v1,C1,J,_1=!0;y instanceof MouseEvent?(C1=y.clientX,J=y.clientY,_1=y.button<3):(C1=y.changedTouches[0].clientX,J=y.changedTouches[0].clientY);let $1=z2(Q,C1,J,y);b2.current!==$1.isTouch&&O2($1.isTouch),!d1&&y.cancelable&&_1&&y.preventDefault();let[w1]=$1.location,W2=o4(Q,w1,C1,J);if($1.kind===N4&&W2!==void 0)$1.button===0&&((J1=D4.current)==null?void 0:J1[0])===w1&&((q1=D4.current)==null?void 0:q1[1])===-1&&(L==null||L(w1,W2));else if($1.kind===k0){let L2=U0($1.group,$1.bounds,$1.localEventX,$1.localEventY);L2!==void 0&&$1.button===0&&L2.onClick($1)}},[e1,z2,o4,L,U0]);a0("click",s7,window,!1);let Z3=i1.useCallback(y=>{let Q=I1.current,v1=e1==null?void 0:e1.current;if(Q===null||y.target!==Q&&y.target!==v1||x===void 0)return;let d1=z2(Q,y.clientX,y.clientY,y);x(d1,()=>{y.cancelable&&y.preventDefault()})},[e1,z2,x]);a0("contextmenu",Z3,(C0=e1==null?void 0:e1.current)!=null?C0:null,!1);let a7=i1.useCallback(y=>{f2.current=new E4(y.map(Q=>Q.item)),Y2.current=y,j4.current(),f2.current=void 0},[]),n4=i1.useMemo(()=>new n3(a7),[a7]),F4=i1.useRef(n4);F4.current=n4,i1.useLayoutEffect(()=>{let y=F4.current;if(n2===void 0||n2[1]<0){y.setHovered(n2);return}let Q=w(n2,!0),v1=l1(Q),d1=v1===void 0&&Q.kind===c1.Custom||(v1==null?void 0:v1.needsHover)!==void 0&&(typeof v1.needsHover=="boolean"?v1.needsHover:v1.needsHover(Q));y.setHovered(d1?n2:void 0)},[w,l1,n2]);let G0=i1.useRef(),D=i1.useCallback(y=>{var $1;let Q=I1.current;if(Q===null)return;let v1=e1==null?void 0:e1.current,d1=y.target!==Q&&y.target!==v1,C1=z2(Q,y.clientX,y.clientY,y);if(C1.kind!=="out-of-bounds"&&d1&&!g9.current&&!C1.isTouch)return;let J=(w1,W2)=>{m0(J1=>J1===w1||(J1==null?void 0:J1[0][0])===(w1==null?void 0:w1[0][0])&&(J1==null?void 0:J1[0][1])===(w1==null?void 0:w1[0][1])&&((J1==null?void 0:J1[1][0])===(w1==null?void 0:w1[1][0])&&(J1==null?void 0:J1[1][1])===(w1==null?void 0:w1[1][1])||!W2)?J1:w1)};if(!C3(C1,G0.current))w2(void 0),j==null||j(C1),J(C1.kind===n9?void 0:[C1.location,[C1.localEventX,C1.localEventY]],!0),G0.current=C1;else if(C1.kind==="cell"||C1.kind===N4||C1.kind===k0){let w1=!1,W2=!0;if(C1.kind==="cell"){let q1=w(C1.location),L2=($1=l1(q1))==null?void 0:$1.needsHoverPosition;W2=L2!=null?L2:q1.kind===c1.Custom,w1=W2}else C1.kind===k0&&(w1=!0);let J1=[C1.location,[C1.localEventX,C1.localEventY]];J(J1,W2),T4.current=J1,w1&&P4(new E4([C1.location]))}let _1=C1.location[0]>=(m1?0:1);j2(C1.kind===N4&&C1.isEdge&&_1&&W1===!0),M3(C1.kind==="cell"&&C1.isFillHandle),z==null||z(y),_(C1)},[e1,z2,m1,W1,z,_,j,w,l1,P4]);a0("mousemove",D,window,!0);let _2=i1.useCallback(y=>{let Q=I1.current;if(Q===null)return;let v1,d1;Z.current!==void 0&&(v1=o2(Q,Z.current.cell[0],Z.current.cell[1]),d1=Z.current.cell),g1==null||g1({bounds:v1,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:d1})},[g1,Z,o2]),Y4=i1.useCallback(y=>{let Q=I1.current;if(Q===null)return;let v1,d1;Z.current!==void 0&&(v1=o2(Q,Z.current.cell[0],Z.current.cell[1]),d1=Z.current.cell),h1==null||h1({bounds:v1,stopPropagation:()=>y.stopPropagation(),preventDefault:()=>y.preventDefault(),cancel:()=>{},ctrlKey:y.ctrlKey,metaKey:y.metaKey,shiftKey:y.shiftKey,altKey:y.altKey,key:y.key,keyCode:y.keyCode,rawEvent:y,location:d1})},[h1,Z,o2]),E3=i1.useCallback(y=>{I1.current=y,s1!==void 0&&(s1.current=y)},[s1]),o7=i1.useCallback(y=>{var q1;let Q=I1.current;if(Q===null||H1===!1||A1){y.preventDefault();return}let v1,d1,C1=z2(Q,y.clientX,y.clientY);if(H1!==!0&&C1.kind!==H1){y.preventDefault();return}let J=(L2,X1)=>{v1=L2,d1=X1},_1,$1,w1,W2=(L2,X1,S2)=>{_1=L2,$1=X1,w1=S2},J1=!1;if(n1==null||n1(S(B({},C1),{setData:J,setDragImage:W2,preventDefault:()=>J1=!0,defaultPrevented:()=>J1})),!J1&&v1!==void 0&&d1!==void 0&&y.dataTransfer!==null)if(y.dataTransfer.setData(v1,d1),y.dataTransfer.effectAllowed="copyLink",_1!==void 0&&$1!==void 0&&w1!==void 0)y.dataTransfer.setDragImage(_1,$1,w1);else{let[L2,X1]=C1.location;if(X1!==void 0){let S2=document.createElement("canvas"),e0=o2(Q,L2,X1);d0(e0!==void 0);let q0=Math.ceil((q1=window.devicePixelRatio)!=null?q1:1);S2.width=e0.width*q0,S2.height=e0.height*q0;let U2=S2.getContext("2d");U2!==null&&(U2.scale(q0,q0),U2.textBaseline="middle",X1===-1?(U2.font=B1.headerFontFull,U2.fillStyle=B1.bgHeader,U2.fillRect(0,0,S2.width,S2.height),R8(U2,0,0,e0.width,e0.height,M1[L2],!1,B1,!1,!1,0,E2,S1,!1)):(U2.font=B1.baseFontFull,U2.fillStyle=B1.bgCell,U2.fillRect(0,0,S2.width,S2.height),Z8(U2,w([L2,X1]),0,X1,!1,!1,0,0,e0.width,e0.height,!1,B1,B1.bgCell,z1,E2,1,void 0,!1,0,void 0,void 0,void 0,R5,l1,()=>{}))),S2.style.left="-100%",S2.style.position="absolute",S2.style.width=`${e0.width}px`,S2.style.height=`${e0.height}px`,document.body.append(S2),y.dataTransfer.setDragImage(S2,e0.width/2,e0.height/2),window.setTimeout(()=>{S2.remove()},0)}}else y.preventDefault()},[H1,A1,z2,n1,o2,B1,M1,E2,S1,w,z1,R5,l1]);a0("dragstart",o7,(D5=e1==null?void 0:e1.current)!=null?D5:null,!1,!1);let L9=i1.useRef(),N3=i1.useCallback(y=>{var w1;let Q=I1.current;if(y1!==void 0&&y.preventDefault(),Q===null||U1===void 0)return;let v1=z2(Q,y.clientX,y.clientY),[d1,C1]=v1.location,J=d1-(m1?0:1),[_1,$1]=(w1=L9.current)!=null?w1:[];(_1!==J||$1!==C1)&&(L9.current=[J,C1],U1([J,C1],y.dataTransfer))},[m1,z2,U1,y1]);a0("dragover",N3,(n7=e1==null?void 0:e1.current)!=null?n7:null,!1,!1);let V9=i1.useCallback(()=>{L9.current=void 0,N1==null||N1()},[N1]);a0("dragend",V9,(u9=e1==null?void 0:e1.current)!=null?u9:null,!1,!1);let W=i1.useCallback(y=>{let Q=I1.current;if(Q===null||y1===void 0)return;y.preventDefault();let v1=z2(Q,y.clientX,y.clientY),[d1,C1]=v1.location,J=d1-(m1?0:1);y1([J,C1],y.dataTransfer)},[m1,z2,y1]);a0("drop",W,(L0=e1==null?void 0:e1.current)!=null?L0:null,!1,!1);let E0=i1.useCallback(()=>{G1==null||G1()},[G1]);a0("dragleave",E0,(N0=e1==null?void 0:e1.current)!=null?N0:null,!1,!1);let s0=i1.useRef(Z);s0.current=Z;let P5=i1.useRef(null),d9=i1.useCallback(y=>{var Q;I1.current===null||!I1.current.contains(document.activeElement)||(y===null&&s0.current.current!==void 0?(Q=s1==null?void 0:s1.current)==null||Q.focus({preventScroll:!0}):y!==null&&y.focus({preventScroll:!0}),P5.current=y)},[s1]);i1.useImperativeHandle(t,()=>({focus:()=>{var Q;let y=P5.current;y===null||!document.contains(y)?(Q=s1==null?void 0:s1.current)==null||Q.focus({preventScroll:!0}):y.focus({preventScroll:!0})},getBounds:(y,Q)=>{if(!(s1===void 0||s1.current===null))return o2(s1.current,y!=null?y:0,Q!=null?Q:-1)},damage:l7}),[s1,l7,o2]);let I4=i1.useRef(),T0=et(()=>{var $1,w1,W2,J1;if(i<50||(U==null?void 0:U.disableAccessibilityTree)===!0)return null;let y=O9(M1,p1,i,a1,Y),Q=m1?0:-1;!m1&&(($1=y[0])==null?void 0:$1.sourceIndex)===0&&(y=y.slice(1));let[v1,d1]=(W2=(w1=Z.current)==null?void 0:w1.cell)!=null?W2:[],C1=(J1=Z.current)==null?void 0:J1.range,J=y.map(q1=>q1.sourceIndex),_1=(0,ks.default)(o,Math.min(h,o+r));return v1!==void 0&&d1!==void 0&&!(J.includes(v1)&&_1.includes(d1))&&d9(null),i1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":h+1,"aria-multiselectable":"true","aria-colcount":M1.length+Q},i1.createElement("thead",{role:"rowgroup"},i1.createElement("tr",{role:"row","aria-rowindex":1},y.map(q1=>i1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex(q1.sourceIndex),"aria-colindex":q1.sourceIndex+1+Q,tabIndex:-1,onFocus:L2=>{if(L2.target!==P5.current)return Q1==null?void 0:Q1([q1.sourceIndex,-1])},key:q1.sourceIndex},q1.title)))),i1.createElement("tbody",{role:"rowgroup"},_1.map(q1=>i1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex(q1),key:q1,"aria-rowindex":q1+2},y.map(L2=>{let X1=L2.sourceIndex,S2=S0(X1,q1),e0=v1===X1&&d1===q1,q0=C1!==void 0&&X1>=C1.x&&X1=C1.y&&q1{let D2=s1==null?void 0:s1.current;if(D2!=null)return g1==null?void 0:g1({bounds:o2(D2,X1,q1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:G2})},onFocusCapture:D2=>{var V0,u2;if(!(D2.target===P5.current||((V0=I4.current)==null?void 0:V0[0])===X1&&((u2=I4.current)==null?void 0:u2[1])===q1))return I4.current=G2,Q1==null?void 0:Q1(G2)},ref:e0?d9:void 0,tabIndex:-1},YH(A2,l1))})))))},[i,M1,p1,a1,Y,h,o,r,Z,d9,w,s1,g1,o2,Q1],200),C4=R===0||!E?0:p1>R?1:(0,Q8.default)(-Y/100,0,1),R3=-o*32+f1,A5=b?(0,Q8.default)(-R3/100,0,1):0,B3=i1.useMemo(()=>{if(!C4&&!A5)return null;let y={position:"absolute",top:0,left:F2,width:i-F2,height:l,opacity:C4,pointerEvents:"none",transition:m2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},Q={position:"absolute",top:M0,left:0,width:i,height:l,opacity:A5,pointerEvents:"none",transition:t1?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return i1.createElement(i1.Fragment,null,C4>0&&i1.createElement("div",{id:"shadow-x",style:y}),A5>0&&i1.createElement("div",{id:"shadow-y",style:Q}))},[C4,A5,F2,i,m2,M0,l,t1]),z3=i1.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return i1.createElement(i1.Fragment,null,i1.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:_2,onKeyUp:Y4,onFocus:u,onBlur:d,ref:E3,style:k5},T0),i1.createElement("canvas",{ref:j0,style:z3}),B3)},Ts=i1.memo(i1.forwardRef(QH));function j9(e,t,i,l){var r;return(0,Ps.default)(Math.round(t-((r=e.growOffset)!=null?r:0)),Math.ceil(i),Math.floor(l))}var JH=e=>{var Y1;let[t,i]=P2.useState(),[l,r]=P2.useState(),[s,a]=P2.useState(),[o,n]=P2.useState(),[C,c]=P2.useState(!1),[m,h]=P2.useState(),[w,g]=P2.useState(),[L,v]=P2.useState(),[V,u]=P2.useState(!1),[d,p]=P2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:b,gridRef:A,maxColumnWidth:k,minColumnWidth:P,onRowMoved:z,lockColumns:_,onColumnProposeMove:j,onMouseDown:a1,onMouseUp:m1,onItemHovered:g1,onDragStart:h1,canvasRef:K}=e,s1=((Y1=N!=null?N:b)!=null?Y1:E)!==void 0,{columns:n1,selection:N1}=e,e1=N1.columns,A1=P2.useCallback(o1=>{let[S1,Q1]=o1.location;s!==void 0&&o!==S1&&S1>=_?(c(!0),n(S1)):w!==void 0&&Q1!==void 0?(u(!0),v(Math.max(0,Q1))):l===void 0&&!C&&!V&&(g1==null||g1(o1))},[s,w,o,g1,_,l,C,V]),u1=x!==void 0,K1=P2.useCallback(o1=>{var S1,Q1;if(o1.button===0){let[U1,y1]=o1.location;if(o1.kind==="out-of-bounds"&&o1.isEdge&&s1){let G1=(S1=A==null?void 0:A.current)==null?void 0:S1.getBounds(n1.length-1,-1);G1!==void 0&&(i(G1.x),r(n1.length-1))}else if(o1.kind==="header"&&U1>=_){let G1=K==null?void 0:K.current;if(o1.isEdge&&s1&&G1){i(o1.bounds.x),r(U1);let m2=G1.getBoundingClientRect().width/G1.offsetWidth,t1=o1.bounds.width/m2;E==null||E(n1[U1],t1,U1,t1+((Q1=n1[U1].growOffset)!=null?Q1:0))}else o1.kind==="header"&&u1&&(h(o1.bounds.x),a(U1))}else o1.kind==="cell"&&_>0&&U1===0&&y1!==void 0&&z!==void 0&&(p(o1.bounds.y),g(y1))}a1==null||a1(o1)},[a1,s1,_,z,A,n1,u1,E,K]),H1=P2.useCallback((o1,S1)=>{C||V||Z==null||Z(o1,S1)},[C,V,Z]),W1=P2.useRef(-1),Z2=P2.useCallback(()=>{W1.current=-1,g(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),h(void 0),c(!1),r(void 0),i(void 0)},[]),B2=P2.useCallback((o1,S1)=>{var Q1,U1,y1;if(o1.button===0){if(l!==void 0){if((e1==null?void 0:e1.hasIndex(l))===!0)for(let O1 of e1){if(O1===l)continue;let m2=n1[O1],t1=j9(m2,W1.current,P,k);N==null||N(m2,t1,O1,t1+((Q1=m2.growOffset)!=null?Q1:0))}let G1=j9(n1[l],W1.current,P,k);if(b==null||b(n1[l],G1,l,G1+((U1=n1[l].growOffset)!=null?U1:0)),e1.hasIndex(l))for(let O1 of e1){if(O1===l)continue;let m2=n1[O1],t1=j9(m2,W1.current,P,k);b==null||b(m2,t1,O1,t1+((y1=m2.growOffset)!=null?y1:0))}}Z2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),w!==void 0&&L!==void 0&&(z==null||z(w,L))}m1==null||m1(o1,S1)},[m1,l,s,o,w,L,e1,b,n1,P,k,N,x,z,Z2]),V2=P2.useMemo(()=>{if(!(s===void 0||o===void 0)&&s!==o&&(j==null?void 0:j(s,o))!==!1)return{src:s,dest:o}},[s,o,j]),B1=P2.useCallback(o1=>{var Q1,U1;let S1=K==null?void 0:K.current;if(s!==void 0&&m!==void 0)Math.abs(o1.clientX-m)>20&&c(!0);else if(w!==void 0&&d!==void 0)Math.abs(o1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&S1){let G1=S1.getBoundingClientRect().width/S1.offsetWidth,O1=(o1.clientX-t)/G1,m2=n1[l],t1=j9(m2,O1,P,k);if(N==null||N(m2,t1,l,t1+((Q1=m2.growOffset)!=null?Q1:0)),W1.current=O1,(e1==null?void 0:e1.first())===l)for(let U of e1){if(U===l)continue;let l1=n1[U],Y=j9(l1,W1.current,P,k);N==null||N(l1,Y,U,Y+((U1=l1.growOffset)!=null?U1:0))}}},[s,m,w,d,l,t,n1,P,k,N,e1,K]),r2=P2.useCallback((o1,S1)=>{if(w===void 0||L===void 0)return R(o1,S1);let[Q1,U1]=o1;return U1===L?U1=w:(U1>L&&(U1-=1),U1>=w&&(U1+=1)),R([Q1,U1],S1)},[w,L,R]),c2=P2.useCallback(o1=>{h1==null||h1(o1),o1.defaultPrevented()||Z2()},[Z2,h1]);return P2.createElement(Ts,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:l,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,width:e.width,getCellContent:r2,isResizing:l!==void 0,onHeaderMenuClick:H1,isDragging:C,onItemHovered:A1,onDragStart:c2,onMouseDown:K1,allowResize:s1,onMouseUp:B2,dragAndDropState:V2,onMouseMoveRaw:B1,ref:A})},As=JH;var H2=x1(F1(),1);var C9=x1(F1(),1);function Ds(e){let t=(0,C9.useRef)(null),[i,l]=(0,C9.useState)({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return(0,C9.useLayoutEffect)(()=>{let r=a=>{for(let o of a){let{width:n,height:C}=o&&o.contentRect||{};l(c=>c.width===n&&c.height===C?c:{width:n,height:C})}},s=new window.ResizeObserver(r);return t.current&&s.observe(t.current,void 0),()=>{s.disconnect()}},[t.current]),B({ref:t},i)}var K4=x1(F1(),1),eL=(e,t,i)=>{let l=(0,K4.useRef)(null),r=(0,K4.useRef)(null),s=(0,K4.useRef)(null),a=(0,K4.useRef)(0),o=(0,K4.useRef)(t);o.current=t;let n=i.current;(0,K4.useEffect)(()=>{let C=()=>{var h,w;if(r.current===!1&&n!==null){let g=[n.scrollLeft,n.scrollTop];if(((h=s.current)==null?void 0:h[0])===g[0]&&((w=s.current)==null?void 0:w[1])===g[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(g[0],g[1]),s.current=g;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},m=h=>{h.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let h=n;return h.addEventListener("touchstart",c),h.addEventListener("touchend",m),()=>{h.removeEventListener("touchstart",c),h.removeEventListener("touchend",m),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},Is=eL;var tL=()=>e=>e.isSafari?"scroll":"auto",iL=K2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[tL()]}});function lL(e){let[t,i]=H2.useState(!1),l=typeof window=="undefined"?null:window,r=H2.useRef(0);return a0("touchstart",H2.useCallback(()=>{window.clearTimeout(r.current),i(!0)},[]),l,!0,!1),a0("touchend",H2.useCallback(s=>{s.touches.length===0&&(r.current=window.setTimeout(()=>i(!1),e))},[e]),l,!0,!1),t}var Os=e=>{var n1,N1,e1,A1;let{children:t,clientHeight:i,scrollHeight:l,scrollWidth:r,update:s,draggable:a,className:o,preventDiagonalScrolling:n=!1,paddingBottom:C=0,paddingRight:c=0,rightElement:m,rightElementProps:h,kineticScrollPerfHack:w=!1,scrollRef:g,initialSize:L}=e,v=[],V=(n1=h==null?void 0:h.sticky)!=null?n1:!1,u=(N1=h==null?void 0:h.fill)!=null?N1:!1,d=H2.useRef(0),p=H2.useRef(0),Z=H2.useRef(null),R=typeof window=="undefined"?1:window.devicePixelRatio,x=H2.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),N=H2.useRef(null),E=lL(200),[b,A]=H2.useState(!0),k=H2.useRef(0);H2.useLayoutEffect(()=>{if(!b||E||x.current.lockDirection===void 0)return;let u1=Z.current;if(u1===null)return;let[K1,H1]=x.current.lockDirection;K1!==void 0?u1.scrollLeft=K1:H1!==void 0&&(u1.scrollTop=H1),x.current.lockDirection=void 0},[E,b]);let P=H2.useCallback((u1,K1)=>{var Q1,U1,y1,G1;let H1=Z.current;if(H1===null)return;K1=K1!=null?K1:H1.scrollTop,u1=u1!=null?u1:H1.scrollLeft;let W1=x.current.scrollTop,Z2=x.current.scrollLeft,B2=u1-Z2,V2=K1-W1;E&&B2!==0&&V2!==0&&(Math.abs(B2)>3||Math.abs(V2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(B2)0&&(Math.abs(o1)>2e3||Y1===0||Y1===S1)&&l>H1.scrollHeight+5){let O1=Y1/S1,m2=(l-c2)*O1;d.current=m2-Y1}B1!==void 0&&(window.clearTimeout(k.current),A(!1),k.current=window.setTimeout(()=>A(!0),200)),s({x:u1,y:Y1+d.current,width:r2-c,height:c2-C,paddingRight:(G1=(y1=N.current)==null?void 0:y1.clientWidth)!=null?G1:0})},[C,c,l,s,n,E]);Is(w&&o9.value,P,Z);let z=H2.useRef(P);z.current=P;let _=H2.useRef(),j=H2.useRef(!1);H2.useLayoutEffect(()=>{j.current?P():j.current=!0},[P,C,c]);let a1=H2.useCallback(u1=>{Z.current=u1,g!==void 0&&(g.current=u1)},[g]),m1=0,g1=0;for(v.push(H2.createElement("div",{key:m1++,style:{width:r,height:0}}));g1z.current(),0),_.current={width:K,height:s1}),(K!=null?K:0)===0||(s1!=null?s1:0)===0?H2.createElement("div",{ref:h1}):H2.createElement("div",{ref:h1},H2.createElement(iL,{isSafari:o9.value},H2.createElement("div",{className:"dvn-underlay"},t),H2.createElement("div",{ref:a1,style:_.current,draggable:a,onDragStart:u1=>{a||(u1.stopPropagation(),u1.preventDefault())},className:"dvn-scroller "+(o!=null?o:""),onScroll:()=>P()},H2.createElement("div",{className:"dvn-scroll-inner"+(m===void 0?" dvn-hidden":"")},H2.createElement("div",{className:"dvn-stack"},v),m!==void 0&&H2.createElement(H2.Fragment,null,!u&&H2.createElement("div",{className:"dvn-spacer"}),H2.createElement("div",{ref:N,style:{height:s1,maxHeight:i-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:u?1:void 0,right:V?c!=null?c:0:void 0,pointerEvents:"auto"}},m))))))};var rL=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:m,onVisibleRegionChanged:h,scrollRef:w,preventDiagonalScrolling:g,rightElement:L,rightElementProps:v,overscrollX:V,overscrollY:u,initialSize:d,smoothScrollX:p=!1,smoothScrollY:Z=!1,isDraggable:R}=e,{paddingRight:x,paddingBottom:N}=n!=null?n:{},[E,b]=c,A=O0.useRef(),k=O0.useRef(),P=O0.useRef(),z=O0.useRef(),_=C+Math.max(0,V!=null?V:0),j=a?r+s:r;if(typeof l=="number")j+=i*l;else for(let h1=0;h1{var Z2,B2,V2;if(a1.current===void 0)return;let h1=B({},a1.current),K=0,s1=h1.x<0?-h1.x:0,n1=0,N1=0;h1.x=h1.x<0?0:h1.x;let e1=0;for(let B1=0;B1=r2+B1.width)K+=B1.width,N1++,n1++;else if(h1.x>r2)K+=B1.width,p?s1+=r2-h1.x:N1++,n1++;else if(h1.x+h1.width>r2)K+=B1.width,n1++;else break}let A1=0,u1=0,K1=0;if(typeof l=="number")Z?(u1=Math.floor(h1.y/l),A1=u1*l-h1.y):u1=Math.ceil(h1.y/l),K1=Math.ceil(h1.height/l)+u1,A1<0&&K1++;else{let B1=0;for(let r2=0;r2=B1+c2)B1+=c2,u1++,K1++;else if(h1.y>Y1)B1+=c2,Z?A1+=Y1-h1.y:u1++,K1++;else if(h1.y+h1.height>c2/2+B1)B1+=c2,K1++;else break}}let H1={x:N1,y:u1,width:n1-N1,height:K1-u1},W1=A.current;(W1===void 0||W1.y!==H1.y||W1.x!==H1.x||W1.height!==H1.height||W1.width!==H1.width||k.current!==s1||P.current!==A1||h1.width!==((Z2=z.current)==null?void 0:Z2[0])||h1.height!==((B2=z.current)==null?void 0:B2[1]))&&(h==null||h({x:N1,y:u1,width:n1-N1,height:K1-u1},h1.width,h1.height,(V2=h1.paddingRight)!=null?V2:0,s1,A1),A.current=H1,k.current=s1,P.current=A1,z.current=[h1.width,h1.height])},[t,l,i,h,o,p,Z]),g1=O0.useCallback(h1=>{a1.current=h1,m1()},[m1]);return O0.useEffect(()=>{m1()},[m1]),O0.createElement(Os,{scrollRef:w,className:m,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:g,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:j+(N!=null?N:0),clientHeight:b,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:g1,initialSize:d},O0.createElement(As,{eventTargetRef:w,width:E,height:b,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}))},_s=rL;var Ws=K2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var sL=D1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},D1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),aL=D1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},D1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),oL=D1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},D1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),nL=10,CL=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:m=!1,onSearchClose:h}=e,[w]=D1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[g,L]=D1.useState(""),v=a!=null?a:g,V=D1.useCallback(K=>{L(K),n==null||n(K)},[n]),[u,d]=D1.useState(),p=D1.useRef(u);p.current=u,D1.useEffect(()=>{o!==void 0&&(o.length>0?d(K=>{var s1;return{rowsSearched:l,results:o.length,selectedIndex:(s1=K==null?void 0:K.selectedIndex)!=null?s1:-1}}):d(void 0))},[l,o]);let Z=D1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=D1.useRef(),[x,N]=D1.useState([]),E=o!=null?o:x,b=D1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),A=D1.useRef(i);A.current=i;let k=D1.useCallback(K=>{let s1=new RegExp(K.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),n1=A.current,N1=Math.min(10,l),e1=0;d(void 0),N([]);let A1=[],u1=async()=>{var Y1,o1;if(C===void 0)return;let K1=performance.now(),H1=l-e1,W1=C({x:0,y:n1,width:r.length,height:Math.min(N1,H1,l-n1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let Z2=!1;for(let[S1,Q1]of W1.entries())for(let[U1,y1]of Q1.entries()){let G1;switch(y1.kind){case c1.Text:case c1.Number:G1=y1.displayData;break;case c1.Uri:case c1.Markdown:G1=y1.data;break;case c1.Boolean:G1=typeof y1.data=="boolean"?y1.data.toString():void 0;break;case c1.Image:case c1.Bubble:G1=y1.data.join("\u{1F433}");break;case c1.Custom:G1=y1.copyData;break}G1!==void 0&&s1.test(G1)&&(A1.push([U1,S1+n1]),Z2=!0)}let B2=performance.now();Z2&&N([...A1]),e1+=W1.length,d0(e1<=l);let V2=(o1=(Y1=p.current)==null?void 0:Y1.selectedIndex)!=null?o1:-1;d({results:A1.length,rowsSearched:e1,selectedIndex:V2}),c==null||c(A1,V2),n1+N1>=l?n1=0:n1+=N1;let B1=B2-K1,r2=Math.max(B1,1),c2=nL/r2;N1=Math.ceil(N1*c2),e1{var K;h==null||h(),d(void 0),N([]),c==null||c([],-1),b(),(K=t==null?void 0:t.current)==null||K.focus()},[b,t,h,c]),z=D1.useCallback(K=>{V(K.target.value),o===void 0&&(K.target.value===""?(d(void 0),N([]),b()):k(K.target.value))},[k,b,V,o]);D1.useEffect(()=>{m&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[m,s,V]);let _=D1.useCallback(K=>{var n1;if((n1=K==null?void 0:K.stopPropagation)==null||n1.call(K),u===void 0)return;let s1=(u.selectedIndex+1)%u.results;d(S(B({},u),{selectedIndex:s1})),c==null||c(E,s1)},[u,c,E]),j=D1.useCallback(K=>{var n1;if((n1=K==null?void 0:K.stopPropagation)==null||n1.call(K),u===void 0)return;let s1=(u.selectedIndex-1)%u.results;s1<0&&(s1+=u.results),d(S(B({},u),{selectedIndex:s1})),c==null||c(E,s1)},[c,E,u]),a1=D1.useCallback(K=>{(K.ctrlKey||K.metaKey)&&K.nativeEvent.code==="KeyF"||K.key==="Escape"?(P(),K.stopPropagation(),K.preventDefault()):K.key==="Enter"&&(K.shiftKey?j():_())},[P,_,j]);D1.useEffect(()=>()=>{b()},[b]);let[m1,g1]=D1.useState(!1);D1.useEffect(()=>{if(m)g1(!0);else{let K=setTimeout(()=>g1(!1),150);return()=>clearTimeout(K)}},[m]);let h1=D1.useMemo(()=>{var e1,A1,u1;if(!m&&!m1)return null;let K;u!==void 0&&(K=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&(K=`${u.selectedIndex+1} of ${K}`));let s1=K1=>{K1.stopPropagation()},N1={width:`${Math.floor(((e1=u==null?void 0:u.rowsSearched)!=null?e1:0)/l*100)}%`};return D1.createElement(Ws,{className:m?"":"out",onMouseDown:s1,onMouseMove:s1,onMouseUp:s1,onClick:s1},D1.createElement("div",{className:"gdg-search-bar-inner"},D1.createElement("input",{id:w,"aria-hidden":!m,"data-testid":"search-input",ref:s,onChange:z,value:v,tabIndex:m?void 0:-1,onKeyDownCapture:a1}),D1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:j,disabled:((A1=u==null?void 0:u.results)!=null?A1:0)===0},sL),D1.createElement("button",{"aria-label":"Next Result","aria-hidden":!m,tabIndex:m?void 0:-1,onClick:_,disabled:((u1=u==null?void 0:u.results)!=null?u1:0)===0},aL),h!==void 0&&D1.createElement("button",{"aria-label":"Close Search","aria-hidden":!m,"data-testid":"search-close-button",tabIndex:m?void 0:-1,onClick:P},oL)),u!==void 0?D1.createElement(D1.Fragment,null,D1.createElement("div",{className:"gdg-search-status"},D1.createElement("div",{"data-testid":"search-result-area"},K)),D1.createElement("div",{className:"gdg-search-progress",style:N1})):D1.createElement("div",{className:"gdg-search-status"},D1.createElement("label",{htmlFor:w},"Type to search")))},[m,m1,u,l,w,s,z,v,a1,j,_,h,P]);return D1.createElement(D1.Fragment,null,D1.createElement(_s,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY}),h1)},Us=CL;var c3=x1(F1(),1);var cL=()=>e=>Math.max(16,e.targetHeight-10),mL=K2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[cL(),"px"]}}),Gs=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=c3.default.useState(i);return c3.default.createElement(we,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:l},c3.default.createElement(mL,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:l,onFocus:n=>n.target.setSelectionRange(0,a.length),onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"?s(a):n.key==="Escape"&&l()},autoFocus:!0}))};function wL(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function l2(e,t,i){let l=qs(e,t);return l&&(i.didMatch=!0),l}function qs(e,t){if(e.length===0)return!1;if(e.includes("|")){let n=e.split("|");for(let C of n)if(qs(C,t))return!0;return!1}let i=!1,l=!1,r=!1,s=!1,a=e.split("+"),o=a.pop();if(!wL(o,t))return!1;if(a[0]==="any")return!0;for(let n of a)switch(n){case"ctrl":i=!0;break;case"shift":l=!0;break;case"alt":r=!0;break;case"meta":s=!0;break;case"primary":v5.value?s=!0:i=!0;break}return t.altKey===r&&t.ctrlKey===i&&t.shiftKey===l&&t.metaKey===s}var m3=x1(F1(),1);function $s(e,t,i,l,r,s){let a=m3.default.useCallback((C,c,m,h)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=S(B({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let w=i==="mixed"&&(m||h==="drag"),g=l==="mixed"&&w,L=r==="mixed"&&w,v={current:C===void 0?void 0:S(B({},C),{rangeStack:h==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:g?e.columns:M2.empty(),rows:L?e.rows:M2.empty()};m&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=S(B({},v),{current:S(B({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=m3.default.useCallback((C,c,m)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let h;if(r==="exclusive"&&C.length>0)h={current:void 0,columns:M2.empty(),rows:C};else{let w=m&&i==="mixed",g=m&&l==="mixed";h={current:w?e.current:void 0,columns:g?e.columns:M2.empty(),rows:C}}t(h,!1)},[l,e,i,r,t]),n=m3.default.useCallback((C,c,m)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let h;if(l==="exclusive"&&C.length>0)h={current:void 0,rows:M2.empty(),columns:C};else{let w=m&&i==="mixed",g=m&&r==="mixed";h={current:w?e.current:void 0,rows:g?e.rows:M2.empty(),columns:C}}t(h,!1)},[l,e,i,r,t]);return[a,o,n]}var J8=x1(F1(),1);function Ks(e,t,i,l,r){let s=J8.useCallback(C=>{var c;if(e===!0){let m=[];for(let h=C.y;h=r?w.push({kind:c1.Loading,allowOverlay:!1}):w.push(t([g,h]));m.push(w)}return m}return(c=e==null?void 0:e(C,l.signal))!=null?c:[]},[l.signal,t,e,r]),a=e!==void 0?s:void 0,o=J8.useCallback(C=>{if(a===void 0)return[];let c=S(B({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let m=a(c,l.signal);return typeof m=="function"?async()=>(await m()).map(h=>[{kind:c1.Loading,allowOverlay:!1},...h]):m.map(h=>[{kind:c1.Loading,allowOverlay:!1},...h])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function hL(e){var t,i;if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case c1.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===$5?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case c1.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case c1.Image:case c1.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case c1.Drilldown:return{formatted:e.data.map(l=>l.text),rawValue:e.data.map(l=>l.text),format:"string-array"};case c1.Text:return{formatted:(t=e.displayData)!=null?t:e.data,rawValue:e.data,format:"string"};case c1.Uri:return{formatted:(i=e.displayData)!=null?i:e.data,rawValue:e.data,format:"url"};case c1.Markdown:case c1.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case c1.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case c1.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case c1.Protected:return{formatted:"************",rawValue:"",format:"string"};default:l5(e)}}function gL(e,t){return e.map((l,r)=>{let s=t[r];return l.map(a=>a.span!==void 0&&a.span[0]!==s?{formatted:"",rawValue:"",format:"string"}:hL(a))})}function Xs(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function HL(e){var i,l;let t=[];for(let r of e){let s=[];for(let a of r)a.format==="url"?s.push((l=(i=a.rawValue)==null?void 0:i.toString())!=null?l:""):a.format==="string-array"?s.push(a.formatted.map(o=>Xs(o,!0)).join(",")):s.push(Xs(a.formatted,!1));t.push(s.join(" "))}return t.join(` `)}function e6(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function js(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function LL(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function VL(e){var i,l;let t=[];t.push('',"");for(let r of e){t.push("");for(let s of r){let a=`gdg-format="${s.format}"`;s.format==="url"?t.push(``):s.format==="string-array"?t.push(``):t.push(``)}t.push("")}return t.push("
${e6(s.formatted)}
    ${s.formatted.map((o,n)=>`
  1. `+e6(o)+"
  2. ").join("")}
${e6(s.formatted)}
"),t.join("")}function Ys(e,t){let i=gL(e,t),l=HL(i),r=VL(i);return{textPlain:l,textHtml:r}}function t6(e){var a,o,n,C,c,m;let t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");let i=t.querySelector("table");if(i===null)return;let l=[i],r=[],s;for(;l.length>0;){let h=l.pop();if(h===void 0)break;if(h instanceof HTMLTableElement||h.nodeName==="TBODY")l.push(...[...h.children].reverse());else if(h instanceof HTMLTableRowElement)s!==void 0&&r.push(s),s=[],l.push(...[...h.children].reverse());else if(h instanceof HTMLTableCellElement){let w=h.cloneNode(!0),L=w.children.length===1&&w.children[0].nodeName==="P"?w.children[0]:null,v=(L==null?void 0:L.children.length)===1&&L.children[0].nodeName==="FONT",V=w.querySelectorAll("br");for(let p of V)p.replaceWith(` `);let u=w.getAttribute("gdg-raw-value"),d=(a=w.getAttribute("gdg-format"))!=null?a:"string";if(w.querySelector("a")!==null)s==null||s.push({rawValue:(n=(o=w.querySelector("a"))==null?void 0:o.getAttribute("href"))!=null?n:"",formatted:(C=w.textContent)!=null?C:"",format:d});else if(w.querySelector("ol")!==null){let p=w.querySelectorAll("li");s==null||s.push({rawValue:[...p].map(Z=>{var R;return(R=Z.getAttribute("gdg-raw-value"))!=null?R:""}),formatted:[...p].map(Z=>{var R;return(R=Z.textContent)!=null?R:""}),format:"string-array"})}else if(u!==null)s==null||s.push({rawValue:LL(u),formatted:(c=w.textContent)!=null?c:"",format:d});else{let p=(m=w.textContent)!=null?m:"";v&&(p=p.replace(/\n(?!\n)/g,"")),s==null||s.push({rawValue:p!=null?p:"",formatted:p!=null?p:"",format:d})}}}return s!==void 0&&r.push(s),r}function Js(e,t,i,l,r){var o,n;let s=e;if(l==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if((e==null?void 0:e.current)===void 0)break;let C=(o=e.current)==null?void 0:o.range,c=[];if(C.width>2){let w=t({x:C.x,y:C.y,width:1,height:C.height},r.signal);if(typeof w=="function")return s;c.push(...w);let g=t({x:C.x+C.width-1,y:C.y,width:1,height:C.height},r.signal);if(typeof g=="function")return s;c.push(...g)}else{let w=t({x:C.x,y:C.y,width:C.width,height:C.height},r.signal);if(typeof w=="function")return s;c.push(...w)}let m=C.x-i,h=C.x+C.width-1-i;for(let w of c)for(let g of w)g.span!==void 0&&(m=Math.min(g.span[0],m),h=Math.max(g.span[1],h));m===C.x-i&&h===C.x+C.width-1-i?a=!0:e={current:{cell:(n=e.current.cell)!=null?n:[0,0],range:{x:m+i,y:C.y,width:h-m+1,height:C.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function Qs(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function ea(e){let t;(function(o){o[o.None=0]="None",o[o.inString=1]="inString",o[o.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));let i=[],l=[],r=0,s=t.None;e=e.replace(/\r\n/g,` `);let a=0;for(let o of e){switch(s){case t.None:o===" "||o===` `?(l.push(e.slice(r,a)),r=a+1,o===` `&&(i.push(l),l=[])):o==='"'&&(s=t.inString);break;case t.inString:o==='"'&&(s=t.inStringPostQuote);break;case t.inStringPostQuote:o==='"'?s=t.inString:((o===" "||o===` `)&&(l.push(Qs(e.slice(r,a))),r=a+1,o===` -`&&(i.push(l),l=[])),s=t.None);break}a++}return ro.map(n=>({rawValue:n,formatted:n,format:"string"})))}function i6(e,t,i){var o;let l=Ys(e,t),r=n=>{var C;(C=window.navigator.clipboard)==null||C.writeText(n)},s=(n,C)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([C],{type:"text/html"})})]),!0)},a=(n,C)=>{var c,m;try{if(i===void 0||i.clipboardData===null)throw new Error("No clipboard data");(c=i==null?void 0:i.clipboardData)==null||c.setData("text/plain",n),(m=i==null?void 0:i.clipboardData)==null||m.setData("text/html",C)}catch(h){s(n,C)||r(n)}};((o=window.navigator.clipboard)==null?void 0:o.write)!==void 0||(i==null?void 0:i.clipboardData)!==void 0?a(l.textPlain,l.textHtml):r(l.textPlain),i==null||i.preventDefault()}function w3(e){return e!==!0}var ia=M1(S1(),1);function ta(e){return typeof e=="string"?e:`${e}px`}var dL=()=>e=>e.innerWidth,uL=()=>e=>e.innerHeight,vL=Q2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[dL()],"wmyidgi-1":[uL()]}}),la=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=s0(s,["inWidth","inHeight","children"]);return ia.createElement(vL,B({innerHeight:ta(i),innerWidth:ta(t)},r),l)};var l6=M1(S1(),1),pL=2,ML=1300;function ra(e,t,i){let l=l6.default.useRef(0),[r,s]=e!=null?e:[0,0];l6.default.useEffect(()=>{if(r===0&&s===0){l.current=0;return}let a=!1,o=0,n=C=>{var c;if(!a){if(o===0)o=C;else{let m=C-o;l.current=Math.min(1,l.current+m/ML);let h=l.current**1.618*m*pL;(c=t.current)==null||c.scrollBy(r*h,s*h),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var sa=M1(S1(),1);function aa({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,m,h,w]=sa.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let g=o/16,L=e,v=H7();return[typeof L=="number"?L*g:p=>Math.ceil(L(p)*g),Math.ceil(t*g),Math.ceil(i*g),S(B({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*g,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*g,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*g}),Math.ceil((r!=null?r:0)*g),Math.ceil((s!=null?s:0)*g)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:m,overscrollX:h,overscrollY:w}}var na=M1(S1(),1);var j4={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function C2(e,t){return e===!0?t:e===!1?"":e}function oa(e){let t=M5.value;return{activateCell:C2(e.activateCell," |Enter|shift+Enter"),clear:C2(e.clear,"any+Escape"),closeOverlay:C2(e.closeOverlay,"any+Escape"),acceptOverlayDown:C2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:C2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:C2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:C2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:C2(e.delete,t?"Backspace|Delete":"Delete"),downFill:C2(e.downFill,"primary+_68"),scrollToSelectedCell:C2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:C2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:C2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:C2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:C2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:C2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:C2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:C2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:C2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:C2(e.goToFirstCell,"primary+Home"),goToFirstColumn:C2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:C2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:C2(e.goToLastCell,"primary+End"),goToLastColumn:C2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:C2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:C2(e.goToNextPage,"PageDown"),goToPreviousPage:C2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:C2(e.rightFill,"primary+_82"),search:C2(e.search,"primary+f"),selectAll:C2(e.selectAll,"primary+a"),selectColumn:C2(e.selectColumn,"ctrl+ "),selectGrowDown:C2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:C2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:C2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:C2(e.selectGrowUp,"shift+ArrowUp"),selectRow:C2(e.selectRow,"shift+ "),selectToFirstCell:C2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:C2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:C2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:C2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:C2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:C2(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ca(e){let t=it(e);return na.default.useMemo(()=>{var l,r,s,a,o,n,C,c,m,h,w,g;if(t===void 0)return oa(j4);let i=S(B({},t),{goToNextPage:(r=(l=t==null?void 0:t.goToNextPage)!=null?l:t==null?void 0:t.pageDown)!=null?r:j4.goToNextPage,goToPreviousPage:(a=(s=t==null?void 0:t.goToPreviousPage)!=null?s:t==null?void 0:t.pageUp)!=null?a:j4.goToPreviousPage,goToFirstCell:(n=(o=t==null?void 0:t.goToFirstCell)!=null?o:t==null?void 0:t.first)!=null?n:j4.goToFirstCell,goToLastCell:(c=(C=t==null?void 0:t.goToLastCell)!=null?C:t==null?void 0:t.last)!=null?c:j4.goToLastCell,selectToFirstCell:(h=(m=t==null?void 0:t.selectToFirstCell)!=null?m:t==null?void 0:t.first)!=null?h:j4.selectToFirstCell,selectToLastCell:(g=(w=t==null?void 0:t.selectToLastCell)!=null?w:t==null?void 0:t.last)!=null?g:j4.selectToLastCell});return oa(B(B({},j4),i))},[t])}var xL=O.lazy(async()=>await import("./data-grid-overlay-editor-CQGGTG2D.js")),fL=0;function ZL(e){return(0,ca.default)((0,s6.default)((0,s6.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,E5.default)(((l=(i=t.span)==null?void 0:i[0])!=null?l:0)+1,((s=(r=t.span)==null?void 0:r[1])!=null?s:0)+1)})))}function h3(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:S(B({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>S(B({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var r6={kind:n1.Loading,allowOverlay:!1},g3={columns:x2.empty(),rows:x2.empty(),current:void 0},EL=(e,t)=>{var A6,D6,I6,O6,_6,W6,U6,G6,q6,$6,K6,X6,j6;let[i,l]=O.useState(g3),[r,s]=O.useState(),a=O.useRef(null),o=O.useRef(null),[n,C]=O.useState(),c=O.useRef(null),m=O.useRef(),h=typeof window=="undefined"?null:window,{imageEditorOverride:w,getRowThemeOverride:g,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:k,drawCell:T,editorBloom:b,onHeaderClicked:A,onColumnProposeMove:z,spanRangeBehavior:_="default",onGroupHeaderClicked:K,onCellContextMenu:J,className:C1,onHeaderContextMenu:g1,getCellsForSelection:w1,onGroupHeaderContextMenu:$,onGroupHeaderRenamed:r1,onCellEdited:a1,onCellsEdited:R1,onSearchResultsChanged:Q,searchResults:O1,onSearchValueChange:v1,searchValue:Q1,onKeyDown:H1,onKeyUp:W1,keybindings:Z2,editOnType:R2=!0,onRowAppended:h2,onColumnMoved:z1,validateCell:o2,highlightRegions:c2,rangeSelect:J1="rect",columnSelect:s1="multi",rowSelect:k1="multi",rangeSelectionBlending:e2="exclusive",columnSelectionBlending:U1="exclusive",rowSelectionBlending:b1="exclusive",onDelete:G1,onDragStart:q1,onMouseMove:L2,onPaste:t1,copyHeaders:L1=!1,freezeColumns:x1=0,cellActivationBehavior:y1="second-click",rowSelectionMode:y2="auto",onHeaderMenuClick:B2,getGroupDetails:i1,onSearchClose:c1,onItemHovered:h1,onSelectionCleared:f1,showSearch:T1,onVisibleRegionChanged:z2,gridSelection:_2,onGridSelectionChange:e0,minColumnWidth:t0=50,maxColumnWidth:w0=500,maxColumnAutoWidth:k2,provideEditor:G0,trailingRowOptions:X1,freezeTrailingRows:g2=0,allowedFillDirections:d2="orthogonal",scrollOffsetX:T2,scrollOffsetY:b2,verticalBorder:F2,onDragOverCell:f0,onDrop:o4,onColumnResize:k0,onColumnResizeEnd:T0,onColumnResizeStart:Z1,customRenderers:P2,fillHandle:n2,drawFocusRing:E2=!0,experimental:t2,fixedShadowX:h0,fixedShadowY:n4,headerIcons:C4,imageWindowLoader:P0,initialSize:M4,isDraggable:Y4,onDragLeave:t7,onRowMoved:x4,overscrollX:z5,overscrollY:y5,preventDiagonalScrolling:b5,rightElement:Q4,rightElementProps:A4,trapFocus:i7=!1,smoothScrollX:l7,smoothScrollY:p3,scaleToRem:M3=!1,rowHeight:F5=34,headerHeight:S4=36,groupHeaderHeight:x3=S4,theme:f3,isOutsideClick:r7,renderers:S5}=e,a0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,q0=(D6=(A6=a0==null?void 0:a0.kind)!=null?A6:e.rowMarkers)!=null?D6:"none",k5=(I6=a0==null?void 0:a0.width)!=null?I6:e.rowMarkerWidth,T5=(_6=(O6=a0==null?void 0:a0.startIndex)!=null?O6:e.rowMarkerStartIndex)!=null?_6:1,h9=(W6=a0==null?void 0:a0.theme)!=null?W6:e.rowMarkerTheme,D4=(U6=a0==null?void 0:a0.checkboxStyle)!=null?U6:"square",$0=Math.max(t0,20),c4=Math.max(w0,$0),g9=Math.max(k2!=null?k2:c4,$0),I4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),H9=O.useMemo(()=>Number.parseFloat(I4.fontSize),[I4]),{rowHeight:B0,headerHeight:P5,groupHeaderHeight:L9,theme:s7,overscrollX:Z3,overscrollY:a7}=aa({groupHeaderHeight:x3,headerHeight:S4,overscrollX:z5,overscrollY:y5,remSize:H9,rowHeight:F5,scaleToRem:M3,theme:f3}),m4=Ca(Z2),k4=k5!=null?k5:d>1e4?48:d>1e3?44:d>100?36:32,K0=q0!=="none",D=K0?1:0,q2=h2!==void 0,J4=(X1==null?void 0:X1.sticky)===!0,[E3,o7]=O.useState(!1),V9=T1!=null?T1:E3,N3=O.useCallback(()=>{c1!==void 0?c1():o7(!1)},[c1]),d9=O.useMemo(()=>_2===void 0?void 0:h3(_2,D),[_2,D]),W=d9!=null?d9:i,Z0=O.useRef();Z0.current===void 0&&(Z0.current=new AbortController),O.useEffect(()=>()=>Z0==null?void 0:Z0.current.abort(),[]);let[o0,A5]=Ks(w1,p,D,Z0.current,d),u9=O.useCallback((H,f,M)=>{if(o2===void 0)return!0;let F=[H[0]-D,H[1]];return o2==null?void 0:o2(F,f,M)},[D,o2]),O4=O.useRef(_2),A0=O.useCallback((H,f)=>{f&&(H=Js(H,o0,D,_,Z0.current)),e0!==void 0?(O4.current=h3(H,-D),e0(O4.current)):l(H)},[e0,o0,D,_]),w4=h5(k0,O.useCallback((H,f,M,F)=>{k0==null||k0(u[M-D],f,M-D,F)},[k0,D,u])),R3=h5(T0,O.useCallback((H,f,M,F)=>{T0==null||T0(u[M-D],f,M-D,F)},[T0,D,u])),D5=h5(Z1,O.useCallback((H,f,M,F)=>{Z1==null||Z1(u[M-D],f,M-D,F)},[Z1,D,u])),B3=h5(k,O.useCallback((H,f)=>{var M;return(M=k==null?void 0:k(S(B({},H),{columnIndex:H.columnIndex-D}),f))!=null?M:!1},[k,D])),z3=h5(T,O.useCallback((H,f)=>{var M;return(M=T==null?void 0:T(S(B({},H),{col:H.col-D}),f))!=null?M:!1},[T,D])),h4=O.useCallback(H=>{if(G1!==void 0){let f=G1(h3(H,-D));return typeof f=="boolean"?f:h3(f,D)}return!0},[G1,D]),[g0,H0,i0]=$s(W,A0,e2,U1,b1,J1),c0=O.useMemo(()=>r4(H7(),s7),[s7]),[I5,n7]=O.useState([0,0,0]),v9=O.useMemo(()=>{if(S5===void 0)return{};let H={};for(let f of S5)H[f.kind]=f;return H},[S5]),L0=O.useCallback(H=>H.kind!==n1.Custom?v9[H.kind]:P2==null?void 0:P2.find(f=>f.isMatch(H)),[P2,v9]),{sizedColumns:E0,nonGrowWidth:y}=It(u,d,A5,I5[0]-(D===0?0:k4)-I5[2],$0,g9,c0,L0,Z0.current);q0!=="none"&&(y+=k4);let j=O.useMemo(()=>E0.some(H=>H.group!==void 0),[E0]),p1=j?P5+L9:P5,u1=W.rows.length,o1=q0==="none"?void 0:u1===0?!1:u1===d?!0:void 0,Y=O.useMemo(()=>q0==="none"?E0:[{title:"",width:k4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:h9,rowMarker:D4,rowMarkerChecked:o1},...E0],[q0,E0,k4,h9,D4,o1]),[_1,K1]=O.useMemo(()=>[b2!==void 0&&typeof B0=="number"?Math.floor(b2/B0):0,b2!==void 0&&typeof B0=="number"?-(b2%B0):0],[b2,B0]),m1=O.useRef({height:1,width:1,x:0,y:0}),$2=O.useMemo(()=>{var H,f;return{x:m1.current.x,y:_1,width:(H=m1.current.width)!=null?H:1,height:(f=m1.current.height)!=null?f:1,ty:K1}},[K1,_1]),i2=O.useRef(!1),[$1,u2,j1]=tt($2);m1.current=$1;let A2=((G6=$1.height)!=null?G6:1)>1;O.useLayoutEffect(()=>{if(b2!==void 0&&c.current!==null&&A2){if(c.current.scrollTop===b2)return;c.current.scrollTop=b2,c.current.scrollTop!==b2&&j1(),i2.current=!0}},[b2,A2,j1]);let l0=((q6=$1.width)!=null?q6:1)>1;O.useLayoutEffect(()=>{if(T2!==void 0&&c.current!==null&&l0){if(c.current.scrollLeft===T2)return;c.current.scrollLeft=T2,c.current.scrollLeft!==T2&&j1(),i2.current=!0}},[T2,l0,j1]);let X0=$1.x+D,K2=$1.y,X2=O.useRef(null),W2=O.useCallback(H=>{var f;H===!0?(f=X2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=X2.current)==null||M.focus()})},[]),U2=q2?d+1:d,V0=O.useCallback(H=>{let f=D===0?H:H.map(F=>S(B({},F),{location:[F.location[0]-D,F.location[1]]})),M=R1==null?void 0:R1(f);if(M!==!0)for(let F of f)a1==null||a1(F.location,F.value);return M},[a1,R1,D]),[v2,J0]=O.useState(),p0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,e4=E2?($6=W.current)==null?void 0:$6.cell:void 0,j0=e4==null?void 0:e4[0],_4=e4==null?void 0:e4[1],e5=O.useMemo(()=>{var f,M;if((c2===void 0||c2.length===0)&&((M=(f=p0!=null?p0:j0)!=null?f:_4)!=null?M:v2)===void 0)return;let H=[];if(c2!==void 0)for(let F of c2){let P=Y.length-F.range.x-D;P>0&&H.push({color:F.color,range:S(B({},F.range),{x:F.range.x+D,width:Math.min(P,F.range.width)}),style:F.style})}return v2!==void 0&&H.push({color:z0(c0.accentColor,0),range:v2,style:"dashed"}),p0!==void 0&&H.push({color:z0(c0.accentColor,.5),range:p0,style:"solid-outline"}),j0!==void 0&&_4!==void 0&&H.push({color:c0.accentColor,range:{x:j0,y:_4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[v2,p0,j0,_4,c2,Y.length,c0.accentColor,D]),Z6=O.useRef(Y);Z6.current=Y;let Y0=O.useCallback(([H,f],M=!1)=>{var U,I,G,X,l1,V1,B1,P1,E1,F1;let F=q2&&f===U2-1;if(H===0&&K0)return F?r6:{kind:l4.Marker,allowOverlay:!1,checkboxStyle:D4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:q0==="clickable-number"?"number":q0,row:T5+f,drawHandle:x4!==void 0,cursor:q0==="clickable-number"?"pointer":void 0};if(F){let p2=H===D&&(U=X1==null?void 0:X1.hint)!=null?U:"",N1=Z6.current[H];if(((I=N1==null?void 0:N1.trailingRowOptions)==null?void 0:I.disabled)===!0)return r6;{let r2=(X=(G=N1==null?void 0:N1.trailingRowOptions)==null?void 0:G.hint)!=null?X:p2,M2=(V1=(l1=N1==null?void 0:N1.trailingRowOptions)==null?void 0:l1.addIcon)!=null?V1:X1==null?void 0:X1.addIcon;return{kind:l4.NewRow,hint:r2,allowOverlay:!1,icon:M2}}}else{let l2=H-D;if(M||(t2==null?void 0:t2.strict)===!0){let N1=m1.current,r2=N1.x>l2||l2>N1.x+N1.width||N1.y>f||f>N1.y+N1.height||f>=b3.current,M2=l2===((P1=(B1=N1.extras)==null?void 0:B1.selected)==null?void 0:P1[0])&&f===((E1=N1.extras)==null?void 0:E1.selected[1]),D2=!1;if(((F1=N1.extras)==null?void 0:F1.freezeRegions)!==void 0){for(let j2 of N1.extras.freezeRegions)if(K4(j2,l2,f)){D2=!0;break}}if(r2&&!M2&&!D2)return r6}let p2=p([l2,f]);return D!==0&&p2.span!==void 0&&(p2=S(B({},p2),{span:[p2.span[0]+D,p2.span[1]+D]})),p2}},[q2,U2,K0,D4,W==null?void 0:W.rows,q0,T5,x4,D,X1==null?void 0:X1.hint,X1==null?void 0:X1.addIcon,t2==null?void 0:t2.strict,p]),y3=O.useCallback(H=>{var M,F;let f=(M=i1==null?void 0:i1(H))!=null?M:{name:H};return r1!==void 0&&H!==""&&(f={icon:f.icon,name:f.name,overrideTheme:f.overrideTheme,actions:[...(F=f.actions)!=null?F:[],{title:"Rename",icon:"renameIcon",onClick:P=>S3({group:f.name,bounds:P.bounds})}]}),f},[i1,r1]),C7=O.useCallback(H=>{var G;let[f,M]=H.cell,F=Y[f],P=(F==null?void 0:F.group)!==void 0?(G=y3(F.group))==null?void 0:G.overrideTheme:void 0,U=F==null?void 0:F.themeOverride,I=g==null?void 0:g(M);s(S(B({},H),{theme:r4(c0,P,U,I,H.content.themeOverride)}))},[g,Y,y3,c0]),O5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,P]=W.current.cell,U=Y0([F,P]);if(U.kind!==n1.Boolean&&U.allowOverlay){let G=U;if(M!==void 0)switch(G.kind){case n1.Number:{let X=Q6(()=>M==="-"?-0:Number.parseFloat(M),0);G=S(B({},G),{data:Number.isNaN(X)?0:X});break}case n1.Text:case n1.Markdown:case n1.Uri:G=S(B({},G),{data:M});break}C7({target:H,content:G,initialValue:M,cell:[F,P],highlight:M===void 0,forceEditMode:M!==void 0})}else U.kind===n1.Boolean&&f&&U.readonly!==!0&&(V0([{location:W.current.cell,value:S(B({},U),{data:w3(U.data)})}]),(I=X2.current)==null||I.damage([{cell:W.current.cell}]))},[Y0,W,V0,C7]),E6=O.useCallback((H,f)=>{var P;let M=(P=X2.current)==null?void 0:P.getBounds(H,f);if(M===void 0||c.current===null)return;let F=Y0([H,f]);F.allowOverlay&&C7({target:M,content:F,initialValue:void 0,highlight:!0,cell:[H,f],forceEditMode:!0})},[Y0,C7]),r0=O.useCallback((H,f,M="both",F=0,P=0,U=void 0)=>{var I;if(c.current!==null){let G=X2.current,X=o.current,l1=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,V1=typeof f!="number"?f.unit==="cell"?f.amount:void 0:f,B1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,P1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if(G!==null&&X!==null){let E1={x:0,y:0,width:0,height:0},F1=0,l2=0;if((l1!==void 0||V1!==void 0)&&(E1=(I=G.getBounds((l1!=null?l1:0)+D,V1!=null?V1:0))!=null?I:E1,E1.width===0||E1.height===0))return;let p2=X.getBoundingClientRect(),N1=p2.width/X.offsetWidth;if(B1!==void 0&&(E1=S(B({},E1),{x:B1-p2.left-c.current.scrollLeft,width:1})),P1!==void 0&&(E1=S(B({},E1),{y:P1+p2.top-c.current.scrollTop,height:1})),E1!==void 0){let r2={x:E1.x-F,y:E1.y-P,width:E1.width+2*F,height:E1.height+2*P},M2=0;for(let I3=0;I30&&(D2=a4(U2,j2,B0));let f2=M2*N1+p2.left+D*k4*N1,Y2=p2.right,H4=p2.top+p1*N1,f4=p2.bottom-D2*N1,l5=E1.width+F*2;switch(U==null?void 0:U.hAlign){case"start":Y2=f2+l5;break;case"end":f2=Y2-l5;break;case"center":f2=Math.floor((f2+Y2)/2)-l5/2,Y2=f2+l5;break}let r5=E1.height+P*2;switch(U==null?void 0:U.vAlign){case"start":f4=H4+r5;break;case"end":H4=f4-r5;break;case"center":H4=Math.floor((H4+f4)/2)-r5/2,f4=H4+r5;break}f2>r2.x?F1=r2.x-f2:Y2r2.y?l2=r2.y-H4:f4=U2-j2)&&(l2=0),(F1!==0||l2!==0)&&(N1!==1&&(F1/=N1,l2/=N1),c.current.scrollTo(F1+c.current.scrollLeft,l2+c.current.scrollTop))}}}},[D,g2,k4,p1,x1,E0,U2,J4,B0]),N6=O.useRef(E6),R6=O.useRef(p),b3=O.useRef(d);N6.current=E6,R6.current=p,b3.current=d;let _5=O.useCallback(async(H,f=!0)=>{var X;let M=Y[H];if(((X=M==null?void 0:M.trailingRowOptions)==null?void 0:X.disabled)===!0)return;let F=h2==null?void 0:h2(),P,U=!0;F!==void 0&&(P=await F,P==="top"&&(U=!1),typeof P=="number"&&(U=!1));let I=0,G=()=>{if(b3.current<=d){I<500&&window.setTimeout(G,I),I=50+I*2;return}let l1=typeof P=="number"?P:U?d:0;g7.current(H-D,l1),g0({cell:[H,l1],range:{x:H,y:l1,width:1,height:1}},!1,!1,"edit");let V1=R6.current([H-D,l1]);V1.allowOverlay&&C5(V1)&&V1.readonly!==!0&&f&&window.setTimeout(()=>{N6.current(H,l1)},0)};G()},[Y,h2,D,d,g0]),c7=O.useCallback(H=>{var M,F,P;let f=(P=(F=(M=E0[H])==null?void 0:M.trailingRowOptions)==null?void 0:F.targetColumn)!=null?P:X1==null?void 0:X1.targetColumn;if(typeof f=="number")return f+(K0?1:0);if(typeof f=="object"){let U=u.indexOf(f);if(U>=0)return U+(K0?1:0)}},[E0,u,K0,X1==null?void 0:X1.targetColumn]),W4=O.useRef(),W5=O.useRef(),p9=O.useCallback((H,f)=>{var P;let[M,F]=f;return r4(c0,(P=Y[M])==null?void 0:P.themeOverride,g==null?void 0:g(F),H.themeOverride)},[g,Y,c0]),M9=O.useCallback(H=>{var V1,B1,P1,E1;let f=M5.value?H.metaKey:H.ctrlKey,M=f&&k1==="multi",F=f&&s1==="multi",[P,U]=H.location,I=W.columns,G=W.rows,[X,l1]=(B1=(V1=W.current)==null?void 0:V1.cell)!=null?B1:[];if(H.kind==="cell"){if(W5.current=void 0,t5.current=[P,U],P===0&&K0){if(q2===!0&&U===d||q0==="number"||k1==="none")return;let F1=Y0(H.location);if(F1.kind!==l4.Marker)return;if(x4!==void 0){let N1=L0(F1);d0((N1==null?void 0:N1.kind)===l4.Marker);let r2=(P1=N1==null?void 0:N1.onClick)==null?void 0:P1.call(N1,S(B({},H),{cell:F1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:p9(F1,H.location),preventDefault:()=>{}}));if(r2===void 0||r2.checked===F1.checked)return}s(void 0),W2();let l2=G.hasIndex(U),p2=W4.current;if(k1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&p2!==void 0&&G.hasIndex(p2)){let N1=[Math.min(p2,U),Math.max(p2,U)+1];M||y2==="multi"?H0(void 0,N1,!0):H0(x2.fromSingleSelection(N1),void 0,M)}else M||H.isTouch||y2==="multi"?l2?H0(G.remove(U),void 0,!0):(H0(void 0,U,!0),W4.current=U):l2&&G.length===1?H0(x2.empty(),void 0,f):(H0(x2.fromSingleSelection(U),void 0,f),W4.current=U)}else if(P>=D&&q2&&U===d){let F1=c7(P);_5(F1!=null?F1:P)}else if(X!==P||l1!==U){let F1=Y0(H.location),l2=L0(F1);if((l2==null?void 0:l2.onSelect)!==void 0){let r2=!1;if(l2.onSelect(S(B({},H),{cell:F1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>r2=!0,theme:p9(F1,H.location)})),r2)return}let p2=J4&&U===d,N1=J4&&W!==void 0&&((E1=W.current)==null?void 0:E1.cell[1])===d;if((H.shiftKey||H.isLongTouch===!0)&&X!==void 0&&l1!==void 0&&W.current!==void 0&&!N1){if(p2)return;let r2=Math.min(P,X),M2=Math.max(P,X),D2=Math.min(U,l1),j2=Math.max(U,l1);g0(S(B({},W.current),{range:{x:r2,y:D2,width:M2-r2+1,height:j2-D2+1}}),!0,f,"click"),W4.current=void 0,W2()}else g0({cell:[P,U],range:{x:P,y:U,width:1,height:1}},!0,f,"click"),W4.current=void 0,s(void 0),W2()}}else if(H.kind==="header")if(t5.current=[P,U],s(void 0),K0&&P===0)W4.current=void 0,W5.current=void 0,k1==="multi"&&(G.length!==d?H0(x2.fromSingleSelection([0,d]),void 0,f):H0(x2.empty(),void 0,f),W2());else{let F1=W5.current;if(s1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&F1!==void 0&&I.hasIndex(F1)){let l2=[Math.min(F1,P),Math.max(F1,P)+1];F?i0(void 0,l2,f):i0(x2.fromSingleSelection(l2),void 0,f)}else F?(I.hasIndex(P)?i0(I.remove(P),void 0,f):i0(void 0,P,f),W5.current=P):s1!=="none"&&(i0(x2.fromSingleSelection(P),void 0,f),W5.current=P);W4.current=void 0,W2()}else H.kind===S0?t5.current=[P,U]:H.kind===C9&&!H.isMaybeScrollbar&&(A0(g3,!1),s(void 0),W2(),f1==null||f1(),W4.current=void 0,W5.current=void 0)},[_5,s1,W2,L0,c7,Y0,W,K0,J4,f1,x4,D,q0,k1,y2,d,g0,A0,i0,H0,q2,p9]),x9=O.useRef(!1),t5=O.useRef(),B6=O.useRef($1),t4=O.useRef(),Eo=O.useCallback(H=>{if(U5.current=!1,B6.current=m1.current,H.button!==0&&H.button!==1){t4.current=void 0;return}let f=performance.now();t4.current={button:H.button,time:f,location:H.location},(H==null?void 0:H.kind)==="header"&&(x9.current=!0);let M=H.kind==="cell"&&H.isFillHandle;!M&&H.kind!=="cell"&&H.isEdge||(C({previousSelection:W,fillHandle:M}),t5.current=void 0,!H.isTouch&&H.button===0&&!M?M9(H):!H.isTouch&&H.button===1&&(t5.current=H.location))},[W,M9]),[F3,S3]=O.useState(),z6=O.useCallback(H=>{if(H.kind!==S0||s1!=="multi")return;let f=M5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=D&&d5(P.group,Y[G].group);G--)U--;for(let G=M+1;G{if(o0!==void 0&&w4!==void 0){let f=m1.current.y,M=m1.current.height,F=o0({x:H,y:f,width:1,height:Math.min(M,d-f)},Z0.current.signal);typeof F!="object"&&(F=await F());let P=E0[H-D],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=c0.baseFontFull;let G=w8(I,c0,P,0,F,$0,c4,!1,L0);w4==null||w4(P,G.width,H,G.width)}}},[E0,o0,c4,c0,$0,w4,D,d,L0]),[No,k3]=O.useState(),G5=O.useCallback(async(H,f)=>{var G,X;let M=(G=H.current)==null?void 0:G.range;if(M===void 0||o0===void 0||f.current===void 0)return;let F=f.current.range;if(x!==void 0){let l1=!1;if(x({fillDestination:S(B({},F),{x:F.x-D}),patternSource:S(B({},M),{x:M.x-D}),preventDefault:()=>l1=!0}),l1)return}let P=o0(M,Z0.current.signal);typeof P!="object"&&(P=await P());let U=P,I=[];for(let l1=0;l1({cell:l1.location})))},[o0,V0,x,D]),y6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=S(B({},W),{current:S(B({},W.current),{range:S(B({},W.current.range),{width:1})})});G5(H,W)},[G5,W]),b6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=S(B({},W),{current:S(B({},W.current),{range:S(B({},W.current.range),{height:1})})});G5(H,W)},[G5,W]),Ro=O.useCallback((H,f)=>{var V1,B1,P1;let M=n;if(C(void 0),J0(void 0),k3(void 0),x9.current=!1,f)return;if((M==null?void 0:M.fillHandle)===!0&&W.current!==void 0&&((V1=M.previousSelection)==null?void 0:V1.current)!==void 0){if(v2===void 0)return;let E1=S(B({},W),{current:S(B({},W.current),{range:p8(M.previousSelection.current.range,v2)})});G5(M.previousSelection,E1),A0(E1,!0);return}let[F,P]=H.location,[U,I]=(B1=t5.current)!=null?B1:[],G=()=>{U5.current=!0},X=E1=>{var l2,p2,N1,r2;let F1=E1.isTouch||U===F&&I===P;if(F1&&(Z==null||Z([F-D,P],S(B({},E1),{preventDefault:G}))),E1.button===1)return!U5.current;if(!U5.current){let M2=Y0(H.location),D2=L0(M2);if(D2!==void 0&&D2.onClick!==void 0&&F1){let f2=D2.onClick(S(B({},E1),{cell:M2,posX:E1.localEventX,posY:E1.localEventY,bounds:E1.bounds,theme:p9(M2,H.location),preventDefault:G}));f2!==void 0&&!T4(f2)&&X5(f2)&&(V0([{location:E1.location,value:f2}]),(l2=X2.current)==null||l2.damage([{cell:E1.location}]))}if(U5.current||W.current===void 0)return!1;let j2=!1;switch((p2=M2.activationBehaviorOverride)!=null?p2:y1){case"double-click":case"second-click":{if(((r2=(N1=M==null?void 0:M.previousSelection)==null?void 0:N1.current)==null?void 0:r2.cell)===void 0)break;let[f2,Y2]=W.current.cell,[H4,f4]=M.previousSelection.current.cell;j2=F===f2&&F===H4&&P===Y2&&P===f4&&(E1.isDoubleClick===!0||y1==="second-click");break}case"single-click":{j2=!0;break}}if(j2)return R==null||R([F-D,P]),O5(E1.bounds,!1),!0}return!1},l1=H.location[0]-D;if(H.isTouch){let E1=m1.current,F1=B6.current;if(E1.x!==F1.x||E1.y!==F1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&u5((P1=W.current)==null?void 0:P1.cell,H.location)){J==null||J([l1,H.location[1]],S(B({},H),{preventDefault:G}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){g1==null||g1(l1,S(B({},H),{preventDefault:G}));return}else if(H.kind===S0){if(l1<0)return;$==null||$(l1,S(B({},H),{preventDefault:G}));return}}H.kind==="cell"?X(H)||M9(H):H.kind===S0?K==null||K(l1,S(B({},H),{preventDefault:G})):(H.kind===y4&&(A==null||A(l1,S(B({},H),{preventDefault:G}))),M9(H));return}if(H.kind==="header"){if(l1<0)return;H.isEdge?H.isDoubleClick===!0&&m7(F):H.button===0&&F===U&&P===I&&(A==null||A(l1,S(B({},H),{preventDefault:G})))}if(H.kind===S0){if(l1<0)return;H.button===0&&F===U&&P===I&&(K==null||K(l1,S(B({},H),{preventDefault:G})),U5.current||z6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),t5.current=void 0},[n,W,D,v2,G5,A0,Z,Y0,L0,y1,p9,V0,R,O5,J,g1,$,M9,K,A,m7,z6]),Bo=O.useCallback(H=>{let f=S(B({},H),{location:[H.location[0]-D,H.location[1]]});L2==null||L2(f),n!==void 0&&H.buttons===0&&(C(void 0),J0(void 0),k3(void 0),x9.current=!1),k3(M=>{var F,P;return x9.current?[H.scrollEdge[0],0]:H.scrollEdge[0]===(M==null?void 0:M[0])&&H.scrollEdge[1]===M[1]?M:n===void 0||((P=(F=t4.current)==null?void 0:F.location[0])!=null?P:0){B2==null||B2(H-D,f)},[B2,D]),i4=(K6=W==null?void 0:W.current)==null?void 0:K6.cell,yo=O.useCallback((H,f,M,F,P,U)=>{i2.current=!1;let I=i4;I!==void 0&&(I=[I[0]-D,I[1]]);let G=x1===0?void 0:{x:0,y:H.y,width:x1,height:H.height},X=[];G!==void 0&&X.push(G),g2>0&&(X.push({x:H.x-D,y:d-g2,width:H.width,height:g2}),x1>0&&X.push({x:0,y:d-g2,width:x1,height:g2}));let l1={x:H.x-D,y:H.y,width:H.width,height:q2&&H.y+H.height>=d?H.height-1:H.height,tx:P,ty:U,extras:{selected:I,freezeRegion:G,freezeRegions:X}};m1.current=l1,u2(l1),n7([f,M,F]),z2==null||z2(l1,l1.tx,l1.ty,l1.extras)},[i4,D,q2,d,x1,g2,u2,z2]),bo=h5(z1,O.useCallback((H,f)=>{z1==null||z1(H-D,f-D),s1!=="none"&&i0(x2.fromSingleSelection(f),void 0,!0)},[s1,z1,D,i0])),T3=O.useRef(!1),Fo=O.useCallback(H=>{if(H.location[0]===0&&D>0){H.preventDefault();return}q1==null||q1(S(B({},H),{location:[H.location[0]-D,H.location[1]]})),H.defaultPrevented()||(T3.current=!0),C(void 0)},[q1,D]),So=O.useCallback(()=>{T3.current=!1},[]),P3=O.useRef(),A3=O.useCallback(H=>{var f,M,F;if(!C3(H,P3.current)&&(P3.current=H,!(((f=t4==null?void 0:t4.current)==null?void 0:f.button)!==void 0&&t4.current.button>=1))){if(H.buttons!==0&&n!==void 0&&((M=t4.current)==null?void 0:M.location[0])===0&&H.location[0]===0&&D===1&&k1==="multi"&&n.previousSelection&&!n.previousSelection.rows.hasIndex(t4.current.location[1])&&W.rows.hasIndex(t4.current.location[1])){let P=Math.min(t4.current.location[1],H.location[1]),U=Math.max(t4.current.location[1],H.location[1])+1;H0(x2.fromSingleSelection([P,U]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!T3.current&&!x9.current&&(J1==="rect"||J1==="multi-rect")){let[P,U]=W.current.cell,[I,G]=H.location;if(G<0&&(G=m1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;G=Math.min(G,q2?d-1:d);let l1=Oi(X,I,G,d2);J0(l1)}else{if(q2&&U===d)return;if(q2&&G===d)if(H.kind===C9)G--;else return;I=Math.max(I,D);let V1=I-P,B1=G-U,P1={x:V1>=0?P:I,y:B1>=0?U:G,width:Math.abs(V1)+1,height:Math.abs(B1)+1};g0(S(B({},W.current),{range:P1}),!0,!1,"drag")}}h1==null||h1(S(B({},H),{location:[H.location[0]-D,H.location[1]]}))}},[d2,n,D,k1,W,J1,h1,H0,q2,d,g0]),ko=O.useCallback(()=>{var I,G,X;let H=P3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,P]=H.location,U=m1.current;f===-1?F=(X=(G=(I=U.extras)==null?void 0:I.freezeRegion)==null?void 0:G.x)!=null?X:U.x:f===1&&(F=U.x+U.width),M===-1?P=Math.max(0,U.y):M===1&&(P=Math.min(d-1,U.y+U.height)),F=(0,Z5.default)(F,0,Y.length-1),P=(0,Z5.default)(P,0,d-1),A3(S(B({},H),{location:[F,P]}))},[Y.length,A3,d]);ra(No,c,ko);let g4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,P]=W.current.cell,U=W.current.range,I=U.x,G=U.x+U.width,X=U.y,l1=U.y+U.height;if(M!==0)switch(M){case 2:{l1=d,X=P,r0(0,l1,"vertical");break}case-2:{X=0,l1=P+1,r0(0,X,"vertical");break}case 1:{XP+1?(l1--,r0(0,l1,"vertical")):(X=Math.max(0,X-1),r0(0,X,"vertical"));break}default:s5(M)}if(f!==0)if(f===2)G=Y.length,I=F,r0(G-1-D,0,"horizontal");else if(f===-2)I=D,G=F+1,r0(I-D,0,"horizontal");else{let V1=[];if(o0!==void 0){let B1=o0({x:I,y:X,width:G-I-D,height:l1-X},Z0.current.signal);typeof B1=="object"&&(V1=ZL(B1))}if(f===1){let B1=!1;if(I0){let P1=(0,E5.default)(I+1,F+1).find(E1=>!V1.includes(E1-D));P1!==void 0&&(I=P1,B1=!0)}else I++,B1=!0;B1&&r0(I,0,"horizontal")}B1||(G=Math.min(Y.length,G+1),r0(G-1-D,0,"horizontal"))}else if(f===-1){let B1=!1;if(G>F+1){if(V1.length>0){let P1=(0,E5.default)(G-1,F,-1).find(E1=>!V1.includes(E1-D));P1!==void 0&&(G=P1,B1=!0)}else G--,B1=!0;B1&&r0(G-D,0,"horizontal")}B1||(I=Math.max(D,I-1),r0(I-D,0,"horizontal"))}else s5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:G-I,height:l1-X}},!0,!1,"keyboard-select")},[o0,W,Y.length,D,d,r0,g0]),U4=O.useCallback((H,f,M,F)=>{let P=U2-(M?0:1);if(H=(0,Z5.default)(H,D,E0.length-1+D),f=(0,Z5.default)(f,0,P),H===(i4==null?void 0:i4[0])&&f===(i4==null?void 0:i4[1]))return!1;if(F&&W.current!==void 0){let U=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&U.push(W.current.range),A0(S(B({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:U}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return m.current!==void 0&&m.current[0]===H&&m.current[1]===f&&(m.current=void 0),r0(H-D,f),!0},[U2,D,E0.length,i4,W,r0,A0,g0]),To=O.useCallback((H,f)=>{(r==null?void 0:r.cell)!==void 0&&H!==void 0&&X5(H)&&(V0([{location:r.cell,value:H}]),window.requestAnimationFrame(()=>{var P;(P=X2.current)==null||P.damage([{cell:r.cell}])})),W2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let P=W.current.cell[1]===U2-1&&H!==void 0;U4((0,Z5.default)(W.current.cell[0]+M,0,Y.length-1),(0,Z5.default)(W.current.cell[1]+F,0,U2-1),P,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,W2,W,N,V0,U2,U4,Y.length]),Po=O.useMemo(()=>`gdg-overlay-${fL++}`,[]),i5=O.useCallback(H=>{var M,F,P,U;W2();let f=[];for(let I=H.x;I({cell:I.location})))},[W2,p,L0,V0,D]),f9=r!==void 0,F6=O.useCallback(H=>{var E1,F1,l2,p2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,P=W.columns,U=W.rows,I=m4;if(!f9&&a2(I.clear,H,M))A0(g3,!1),f1==null||f1();else if(!f9&&a2(I.selectAll,H,M))A0({columns:x2.empty(),rows:x2.empty(),current:{cell:(F1=(E1=W.current)==null?void 0:E1.cell)!=null?F1:[D,0],range:{x:D,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(a2(I.search,H,M))(l2=a==null?void 0:a.current)==null||l2.focus({preventScroll:!0}),o7(!0);else if(a2(I.delete,H,M)){let N1=(p2=h4==null?void 0:h4(W))!=null?p2:!0;if(N1!==!1){let r2=N1===!0?W:N1;if(r2.current!==void 0){i5(r2.current.range);for(let M2 of r2.current.rangeStack)i5(M2)}for(let M2 of r2.rows)i5({x:D,y:M2,width:u.length,height:1});for(let M2 of r2.columns)i5({x:M2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[G,X]=W.current.cell,l1=!1,V1=!1;a2(I.scrollToSelectedCell,H,M)?g7.current(G-D,X):s1!=="none"&&a2(I.selectColumn,H,M)?P.hasIndex(G)?i0(P.remove(G),void 0,!0):s1==="single"?i0(x2.fromSingleSelection(G),void 0,!0):i0(void 0,G,!0):k1!=="none"&&a2(I.selectRow,H,M)?U.hasIndex(X)?H0(U.remove(X),void 0,!0):k1==="single"?H0(x2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!f9&&F!==void 0&&a2(I.activateCell,H,M)?X===d&&q2?window.setTimeout(()=>{let N1=c7(G);_5(N1!=null?N1:G)},0):(R==null||R([G-D,X]),O5(F,!0)):W.current.range.height>1&&a2(I.downFill,H,M)?b6():W.current.range.width>1&&a2(I.rightFill,H,M)?y6():a2(I.goToNextPage,H,M)?X+=Math.max(1,m1.current.height-4):a2(I.goToPreviousPage,H,M)?X-=Math.max(1,m1.current.height-4):a2(I.goToFirstCell,H,M)?(s(void 0),X=0,G=0):a2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,G=Number.MAX_SAFE_INTEGER):a2(I.selectToFirstCell,H,M)?(s(void 0),g4([-2,-2])):a2(I.selectToLastCell,H,M)?(s(void 0),g4([2,2])):f9?(a2(I.closeOverlay,H,M)&&s(void 0),a2(I.acceptOverlayDown,H,M)&&(s(void 0),X++),a2(I.acceptOverlayUp,H,M)&&(s(void 0),X--),a2(I.acceptOverlayLeft,H,M)&&(s(void 0),G--),a2(I.acceptOverlayRight,H,M)&&(s(void 0),G++)):(a2(I.goDownCell,H,M)?X+=1:a2(I.goUpCell,H,M)?X-=1:a2(I.goRightCell,H,M)?G+=1:a2(I.goLeftCell,H,M)?G-=1:a2(I.goDownCellRetainSelection,H,M)?(X+=1,l1=!0):a2(I.goUpCellRetainSelection,H,M)?(X-=1,l1=!0):a2(I.goRightCellRetainSelection,H,M)?(G+=1,l1=!0):a2(I.goLeftCellRetainSelection,H,M)?(G-=1,l1=!0):a2(I.goToLastRow,H,M)?X=d-1:a2(I.goToFirstRow,H,M)?X=Number.MIN_SAFE_INTEGER:a2(I.goToLastColumn,H,M)?G=Number.MAX_SAFE_INTEGER:a2(I.goToFirstColumn,H,M)?G=Number.MIN_SAFE_INTEGER:(J1==="rect"||J1==="multi-rect")&&(a2(I.selectGrowDown,H,M)?g4([0,1]):a2(I.selectGrowUp,H,M)?g4([0,-1]):a2(I.selectGrowRight,H,M)?g4([1,0]):a2(I.selectGrowLeft,H,M)?g4([-1,0]):a2(I.selectToLastRow,H,M)?g4([0,2]):a2(I.selectToFirstRow,H,M)?g4([0,-2]):a2(I.selectToLastColumn,H,M)?g4([2,0]):a2(I.selectToFirstColumn,H,M)&&g4([-2,0])),V1=M.didMatch);let B1=U4(G,X,!1,l1),P1=M.didMatch;return P1&&(B1||!V1||i7)&&f(),P1},[f9,W,m4,s1,k1,J1,D,d,U4,A0,f1,u.length,h4,i7,i5,i0,H0,q2,c7,_5,R,O5,b6,y6,g4]),Z9=O.useCallback(H=>{let f=!1;if(H1!==void 0&&H1(S(B({},H),{cancel:()=>{f=!0}})),f||F6(H)||W.current===void 0)return;let[M,F]=W.current.cell,P=m1.current;if(R2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&C5(p([M-D,Math.max(0,Math.min(F,d-1))]))){if((!q2||F!==d)&&(P.y>F||F>P.y+P.height||P.x>M||M>P.x+P.width))return;O5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[R2,H1,F6,W,p,D,d,q2,O5]),Ao=O.useCallback((H,f)=>{let M=H.location[0]-D;if(H.kind==="header"&&(g1==null||g1(M,S(B({},H),{preventDefault:f}))),H.kind===S0){if(M<0)return;$==null||$(M,S(B({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,P]=H.location;J==null||J([M,P],S(B({},H),{preventDefault:f})),Rt(W,H.location)||U4(F,P,!1,!1)}},[W,J,$,g1,D,U4]),D3=O.useCallback(async H=>{var I,G,X,l1,V1,B1;if(!m4.paste)return;function f(P1,E1,F1,l2){var N1,r2,M2,D2;let p2=typeof F1=="object"?(N1=F1==null?void 0:F1.join(` -`))!=null?N1:"":(r2=F1==null?void 0:F1.toString())!=null?r2:"";if(!T4(P1)&&C5(P1)&&P1.readonly!==!0){let j2=E==null?void 0:E(p2,P1);if(j2!==void 0&&X5(j2))return{location:E1,value:j2};let f2=L0(P1);if(f2===void 0)return;if(f2.kind===n1.Custom){d0(P1.kind===n1.Custom);let Y2=(M2=f2.onPaste)==null?void 0:M2.call(f2,p2,P1.data);return Y2===void 0?void 0:{location:E1,value:S(B({},P1),{data:Y2})}}else{let Y2=(D2=f2.onPaste)==null?void 0:D2.call(f2,p2,P1,{formatted:l2,formattedString:typeof l2=="string"?l2:l2==null?void 0:l2.join(` -`),rawValue:F1});return Y2===void 0?void 0:(d0(Y2.kind===P1.kind),{location:E1,value:Y2})}}}let M=W.columns,F=W.rows,P=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||((G=o.current)==null?void 0:G.contains(document.activeElement))===!0,U;if(W.current!==void 0?U=[W.current.range.x,W.current.range.y]:M.length===1?U=[(X=M.first())!=null?X:0,0]:F.length===1&&(U=[D,(l1=F.first())!=null?l1:0]),P&&U!==void 0){let P1,E1,F1="text/plain",l2="text/html";if(navigator.clipboard.read!==void 0){let M2=await navigator.clipboard.read();for(let D2 of M2){if(D2.types.includes(l2)){let f2=await(await D2.getType(l2)).text(),Y2=t6(f2);if(Y2!==void 0){P1=Y2;break}}D2.types.includes(F1)&&(E1=await(await D2.getType(F1)).text())}}else if(navigator.clipboard.readText!==void 0)E1=await navigator.clipboard.readText();else if(H!==void 0&&(H==null?void 0:H.clipboardData)!==null){if(H.clipboardData.types.includes(l2)){let M2=H.clipboardData.getData(l2);P1=t6(M2)}P1===void 0&&H.clipboardData.types.includes(F1)&&(E1=H.clipboardData.getData(F1))}else return;let[p2,N1]=U,r2=[];do{if(t1===void 0){let M2=Y0(U),D2=(V1=E1!=null?E1:P1==null?void 0:P1.map(f2=>f2.map(Y2=>Y2.rawValue).join(" ")).join(" "))!=null?V1:"",j2=f(M2,U,D2,void 0);j2!==void 0&&r2.push(j2);break}if(P1===void 0){if(E1===void 0)return;P1=ea(E1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([U[0]-D,U[1]],P1.map(M2=>M2.map(D2=>{var j2,f2;return(f2=(j2=D2.rawValue)==null?void 0:j2.toString())!=null?f2:""}))))!==!0)return;for(let[M2,D2]of P1.entries()){if(M2+N1>=d)break;for(let[j2,f2]of D2.entries()){let Y2=[j2+p2,M2+N1],[H4,f4]=Y2;if(H4>=Y.length||f4>=U2)continue;let l5=Y0(Y2),r5=f(l5,Y2,f2.rawValue,f2.formatted);r5!==void 0&&r2.push(r5)}}}while(!1);V0(r2),(B1=X2.current)==null||B1.damage(r2.map(M2=>({cell:M2.location})))}},[E,L0,Y0,W,m4.paste,Y.length,V0,U2,t1,D,d]);n0("paste",D3,h,!1,!0);let E9=O.useCallback(async(H,f)=>{var I,G;if(!m4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||((G=o.current)==null?void 0:G.contains(document.activeElement))===!0,F=W.columns,P=W.rows,U=(X,l1)=>{if(!L1)i6(X,l1,H);else{let V1=l1.map(B1=>({kind:n1.Text,data:u[B1].title,displayData:u[B1].title,allowOverlay:!1}));i6([V1,...X],l1,H)}};if(M&&o0!==void 0){if(W.current!==void 0){let X=o0(W.current.range,Z0.current.signal);typeof X!="object"&&(X=await X()),U(X,(0,E5.default)(W.current.range.x-D,W.current.range.x+W.current.range.width-D))}else if(P!==void 0&&P.length>0){let l1=[...P].map(V1=>{let B1=o0({x:D,y:V1,width:u.length,height:1},Z0.current.signal);return typeof B1=="object"?B1[0]:B1().then(P1=>P1[0])});if(l1.some(V1=>V1 instanceof Promise)){let V1=await Promise.all(l1);U(V1,(0,E5.default)(u.length))}else U(l1,(0,E5.default)(u.length))}else if(F.length>0){let X=[],l1=[];for(let V1 of F){let B1=o0({x:V1,y:0,width:1,height:d},Z0.current.signal);typeof B1!="object"&&(B1=await B1()),X.push(B1),l1.push(V1-D)}if(X.length===1)U(X[0],l1);else{let V1=X.reduce((B1,P1)=>B1.map((E1,F1)=>[...E1,...P1[F1]]));U(V1,l1)}}}},[u,o0,W,m4.copy,D,d,L1]);n0("copy",E9,h,!1,!1);let Do=O.useCallback(async H=>{var M,F;if(!(!m4.cut||!(((M=c.current)==null?void 0:M.contains(document.activeElement))===!0||((F=o.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await E9(H),W.current!==void 0)){let P={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:x2.empty(),columns:x2.empty()},U=h4==null?void 0:h4(P);if(U===!1||(P=U===!0?P:U,P.current===void 0))return;i5(P.current.range)}},[i5,W,m4.cut,E9,h4]);n0("cut",Do,h,!1,!1);let Io=O.useCallback((H,f)=>{if(Q!==void 0){D!==0&&(H=H.map(P=>[P[0]-D,P[1]])),Q(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];m.current!==void 0&&m.current[0]===M&&m.current[1]===F||(m.current=[M,F],U4(M,F,!1,!1))},[Q,D,U4]),[w7,h7]=(j6=(X6=_2==null?void 0:_2.current)==null?void 0:X6.cell)!=null?j6:[],g7=O.useRef(r0);g7.current=r0,O.useLayoutEffect(()=>{var H,f,M,F;!i2.current&&w7!==void 0&&h7!==void 0&&(w7!==((f=(H=O4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||h7!==((F=(M=O4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&g7.current(w7,h7),i2.current=!1},[w7,h7]);let S6=W.current!==void 0&&(W.current.cell[0]>=Y.length||W.current.cell[1]>=U2);O.useLayoutEffect(()=>{S6&&A0(g3,!1)},[S6,A0]);let Oo=O.useMemo(()=>q2===!0&&(X1==null?void 0:X1.tint)===!0?x2.fromSingleSelection(U2-1):x2.empty(),[U2,q2,X1==null?void 0:X1.tint]),_o=O.useCallback(H=>{var f;return typeof F2=="boolean"?F2:(f=F2==null?void 0:F2(H-D))!=null?f:!0},[D,F2]),Wo=O.useMemo(()=>{if(F3===void 0||o.current===null)return null;let{bounds:H,group:f}=F3,M=o.current.getBoundingClientRect();return O.createElement(Gs,{bounds:H,group:f,canvasBounds:M,onClose:()=>S3(void 0),onFinish:F=>{S3(void 0),r1==null||r1(f,F)}})},[r1,F3]),Uo=Math.min(Y.length,x1+(K0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>_5(H+D,f),updateCells:H=>{var f;return D!==0&&(H=H.map(M=>({cell:[M.cell[0]+D,M.cell[1]]}))),(f=X2.current)==null?void 0:f.damage(H)},getBounds:(H,f)=>{var M;if(!((o==null?void 0:o.current)===null||(c==null?void 0:c.current)===null)){if(H===void 0&&f===void 0){let F=o.current.getBoundingClientRect(),P=F.width/c.current.clientWidth;return{x:F.x-c.current.scrollLeft*P,y:F.y-c.current.scrollTop*P,width:c.current.scrollWidth*P,height:c.current.scrollHeight*P}}return(M=X2.current)==null?void 0:M.getBounds((H!=null?H:0)+D,f)}},focus:()=>{var H;return(H=X2.current)==null?void 0:H.focus()},emit:async H=>{switch(H){case"delete":Z9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Z9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Z9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await E9(void 0,!0);break;case"paste":await D3();break}},scrollTo:r0,remeasureColumns:H=>{for(let f of H)m7(f+D)}}),[_5,m7,E9,Z9,D3,D,r0]);let[k6,T6]=i4!=null?i4:[],Go=O.useCallback(H=>{let[f,M]=H;if(M===-1){s1!=="none"&&(i0(x2.fromSingleSelection(f),void 0,!1),W2());return}k6===f&&T6===M||(g0({cell:H,range:{x:f,y:M,width:1,height:1}},!0,!1,"keyboard-nav"),r0(f,M))},[s1,W2,r0,k6,T6,g0,i0]),[qo,$o]=O.useState(!1),P6=O.useRef((0,ma.default)(H=>{$o(H)},5)),Ko=O.useCallback(()=>{P6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[D,K2],range:{x:D,y:K2,width:1,height:1}},!0,!1,"keyboard-select")},[K2,W,n,D,g0]),Xo=O.useCallback(()=>{P6.current(!1)},[]),[jo,Yo]=O.useMemo(()=>{var P;let H,f=(P=t2==null?void 0:t2.scrollbarWidthOverride)!=null?P:T9(),M=d+(q2?1:0);if(typeof B0=="number")H=p1+M*B0;else{let U=0,I=Math.min(M,10);for(let G=0;GI.width+U,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[Y,t2==null?void 0:t2.scrollbarWidthOverride,B0,d,q2,p1]),Qo=O.useMemo(()=>ce(c0),[c0]);return O.createElement(me.Provider,{value:c0},O.createElement(la,{style:Qo,className:C1,inWidth:v!=null?v:jo,inHeight:V!=null?V:Yo},O.createElement(Us,{fillHandle:n2,drawFocusRing:E2,experimental:t2,fixedShadowX:h0,fixedShadowY:n4,getRowThemeOverride:g,headerIcons:C4,imageWindowLoader:P0,initialSize:M4,isDraggable:Y4,onDragLeave:t7,onRowMoved:x4,overscrollX:Z3,overscrollY:a7,preventDiagonalScrolling:b5,rightElement:Q4,rightElementProps:A4,smoothScrollX:l7,smoothScrollY:p3,className:C1,enableGroups:j,onCanvasFocused:Ko,onCanvasBlur:Xo,canvasRef:o,onContextMenu:Ao,theme:c0,cellXOffset:X0,cellYOffset:K2,accessibilityHeight:$1.height,onDragEnd:So,columns:Y,nonGrowWidth:y,drawHeader:B3,onColumnProposeMove:z,drawCell:z3,disabledRows:Oo,freezeColumns:Uo,lockColumns:D,firstColAccessible:D===0,getCellContent:Y0,minColumnWidth:$0,maxColumnWidth:c4,searchInputRef:a,showSearch:V9,onSearchClose:N3,highlightRegions:e5,getCellsForSelection:o0,getGroupDetails:y3,headerHeight:P5,isFocused:qo,groupHeaderHeight:j?L9:0,freezeTrailingRows:g2+(q2&&(X1==null?void 0:X1.sticky)===!0?1:0),hasAppendRow:q2,onColumnResize:w4,onColumnResizeEnd:R3,onColumnResizeStart:D5,onCellFocused:Go,onColumnMoved:bo,onDragStart:Fo,onHeaderMenuClick:zo,onItemHovered:A3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Bo,onKeyDown:Z9,onKeyUp:W1,onMouseDown:Eo,onMouseUp:Ro,onDragOverCell:f0,onDrop:o4,onSearchResultsChanged:Io,onVisibleRegionChanged:yo,clientSize:I5,rowHeight:B0,searchResults:O1,searchValue:Q1,onSearchValueChange:v1,rows:U2,scrollRef:c,selection:W,translateX:$1.tx,translateY:$1.ty,verticalBorder:_o,gridRef:X2,getCellRenderer:L0}),Wo,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(xL,S(B({},r),{validateCell:u9,bloom:b,id:Po,getCellRenderer:L0,className:(t2==null?void 0:t2.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:G0,imageEditorOverride:w,onFinishEditing:To,markdownDivCreateNode:L,isOutsideClick:r7})))))},wa=O.forwardRef(EL);var ha=20,ga={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:"false"},kind:n1.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>{var t;return NL(e,e.cell.data,z9(e.cell),(t=e.cell.maxSize)!=null?t:ha)},onDelete:e=>S(B({},e),{data:!1}),onClick:e=>{var v,V;let{cell:t,posX:i,posY:l,bounds:r,theme:s}=e,{width:a,height:o,x:n,y:C}=r,c=(v=t.maxSize)!=null?v:ha,m=Math.floor(r.y+o/2),h=D7(c,o,s.cellVerticalPadding),w=A7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,h),g=P7(w,m,h),L=I7(n+i,C+l,g);if(z9(t)&&L)return S(B({},t),{data:w3(t.data)})},onPaste:(e,t)=>{let i=$5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=K5),i===t.data?void 0:S(B({},t),{data:i})}};function NL(e,t,i,l){if(!i&&t===$5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:m}}=e,{x:h,y:w,width:g,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===$5&&(V*=s),V!==0&&(r.globalAlpha=V,i9(r,a,t,h,w,g,L,n,C,c,l,m),r.globalAlpha=1)}var Va=M1(S1(),1);var H3=M1(S1(),1);var Ha=Q2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var RL=e=>{let{bubbles:t}=e;return H3.createElement(Ha,null,t.map((i,l)=>H3.createElement("div",{key:l,className:"boe-bubble"},i)),H3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},La=RL;var da={getAccessibilityString:e=>O7(e.data),kind:n1.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r).width+l+20,0)+2*i.cellHorizontalPadding-4,draw:e=>zL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return Va.createElement(La,{bubbles:t.data})},onPaste:()=>{}},BL=4;function zL(e,t){var L;let{rect:i,theme:l,ctx:r,highlighted:s}=e,{x:a,y:o,width:n,height:C}=i,c=20,m=8,h=BL,w=a+l.cellHorizontalPadding,g=[];for(let v of t){if(w>a+n)break;let V=R4(v,r,l.baseFontFull).width;g.push({x:w,width:V}),w+=V+m*2+h}r.beginPath();for(let v of g)x0(r,v.x,o+(C-c)/2,v.width+m*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of g.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+m,o+C/2+M0(r,l))}var va=M1(S1(),1);var Q9=M1(S1(),1);var yL=Q2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),bL=e=>{let{drilldowns:t}=e;return Q9.createElement(yL,null,t.map((i,l)=>Q9.createElement("div",{key:l,className:"doe-bubble"},i.img!==void 0&&Q9.createElement("img",{src:i.img}),Q9.createElement("div",null,i.text))))},ua=bL;var pa={getAccessibilityString:e=>O7(e.data.map(t=>t.text)),kind:n1.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r.text).width+l+20+(r.img!==void 0?18:0),0)+2*i.cellHorizontalPadding-4,draw:e=>kL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return va.createElement(ua,{drilldowns:t.data})},onPaste:()=>{}},FL=4,a6={};function SL(e,t,i,l){let r=Math.ceil(window.devicePixelRatio),s=5,a=i-s*2,o=4,n=i*r,C=l+s,c=l*3,m=(c+s*2)*r,h=`${e},${t},${r},${i}`;if(a6[h]!==void 0)return{el:a6[h],height:n,width:m,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let w=document.createElement("canvas"),g=w.getContext("2d");return g===null?null:(w.width=m,w.height=n,g.scale(r,r),a6[h]=w,g.beginPath(),x0(g,s,s,c,a,l),g.shadowColor="rgba(24, 25, 34, 0.4)",g.shadowBlur=1,g.fillStyle=e,g.fill(),g.shadowColor="rgba(24, 25, 34, 0.3)",g.shadowOffsetY=1,g.shadowBlur=5,g.fillStyle=e,g.fill(),g.shadowOffsetY=0,g.shadowBlur=0,g.shadowBlur=0,g.beginPath(),x0(g,s+.5,s+.5,c,a,l),g.strokeStyle=t,g.lineWidth=1,g.stroke(),{el:w,height:n,width:m,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function kL(e,t){var Z,R;let{rect:i,theme:l,ctx:r,imageLoader:s,col:a,row:o}=e,{x:n,width:C}=i,c=l.baseFontFull,m=n8(r,c),h=Math.min(i.height,Math.max(16,Math.ceil(m*l.lineHeight)*2)),w=Math.floor(i.y+(i.height-h)/2),g=h-10,L=8,v=FL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=SL(l.bgCell,l.drilldownBorder,h,u),p=[];for(let x of t){if(V>n+C)break;let E=R4(x.text,r,c).width,k=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(k=g-8+4);let T=E+k+L*2;p.push({x:V,width:T}),V+=T+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:k,width:T,dpr:b,padding:A}=d,z=k/b,_=A/b;for(let K of p){let J=Math.floor(K.x),C1=Math.floor(K.width),g1=C1-(z-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,k,N,J-_,w,z,h),g1>0&&r.drawImage(x,k,0,E,N,J+(z-_),w,g1,h),r.drawImage(x,T-k,0,k,N,J+C1-(z-_),w,z,h),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],k=N.x+L;if(E.img!==void 0){let T=s.loadOrGetImage(E.img,a,o);if(T!==void 0){let b=g-8,A=0,z=0,_=T.width,K=T.height;_>K?(A+=(_-K)/2,_=K):K>_&&(z+=(K-_)/2,K=_),r.beginPath(),x0(r,k,w+h/2-b/2,b,b,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(T,A,z,_,K,k,w+h/2-b/2,b,b),r.restore(),k+=b+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,k,w+h/2+M0(r,l))}}var Ma=M1(S1(),1);var xa={getAccessibilityString:e=>e.data.join(", "),kind:n1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return TL(e,(t=e.cell.displayData)!=null?t:e.cell.data,(l=(i=e.cell.rounding)!=null?i:e.theme.roundingRadius)!=null?l:4,e.cell.contentAlign)},measure:(e,t)=>t.data.length*50,onDelete:e=>S(B({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:rt;return Ma.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(S(B({},t),{data:[s]}))}})},onPaste:(e,t)=>{e=e.trim();let l=e.split(",").map(r=>{try{return new URL(r),r}catch(s){return}}).filter(r=>r!==void 0);if(!(l.length===t.data.length&&l.every((r,s)=>r===t.data[s])))return S(B({},t),{data:l})}},o6=4;function TL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:m,height:h,width:w}=r,g=h-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),x0(n,V,m+o.cellVerticalPadding,d,g,i),n.save(),n.clip()),n.drawImage(u,V,m+o.cellVerticalPadding,d,g),i>0&&n.restore(),V+=d+o6}}function PL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var fa={getAccessibilityString:()=>"",kind:n1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,m;let{cell:t,col:i,row:l,ctx:r,rect:s,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let o=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(o+=Math.round(PL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);x0(r,s.x+n,s.y+(s.height-C)/2,o,C,(m=a.roundingRadius)!=null?m:3),r.fillStyle=z0(a.textDark,.1),r.fill()},onPaste:()=>{}};var Ea=M1(S1(),1);var u0=M1(S1(),1);var AL=()=>e=>e.targetWidth,n6=Q2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[AL(),"px"]}});var Za=e=>{let{value:t,onChange:i,forceEditMode:l,createNode:r,targetRect:s,onFinish:a,validatedSelection:o}=e,n=t.data,C=t.readonly===!0,[c,m]=u0.useState(n===""||l),h=u0.useCallback(()=>{m(g=>!g)},[]),w=n?"gdg-ml-6":"";return c?u0.createElement(n6,{targetWidth:s.width-20},u0.createElement(q4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:g=>{g.key==="Enter"&&g.stopPropagation()},onChange:i}),u0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${w}`,onClick:()=>a(t)},u0.createElement(Je,null))):u0.createElement(n6,{targetWidth:s.width},u0.createElement(D9,{contents:n,createNode:r}),!C&&u0.createElement(u0.Fragment,null,u0.createElement("div",{className:"spacer"}),u0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${w}`,onClick:h},u0.createElement(j5,null))),u0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var Na={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:n1.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:B4,measure:(e,t,i)=>{let l=t.data.split(` -`)[0];return e.measureText(l).width+2*i.cellHorizontalPadding},draw:e=>I0(e,e.cell.data,e.cell.contentAlign),onDelete:e=>S(B({},e),{data:""}),provideEditor:()=>e=>{let{onChange:t,value:i,target:l,onFinishedEditing:r,markdownDivCreateNode:s,forceEditMode:a,validatedSelection:o}=e;return Ea.createElement(Za,{onFinish:r,targetRect:l,value:i,validatedSelection:o,onChange:n=>t(S(B({},i),{data:n.target.value})),forceEditMode:a,createNode:s})},onPaste:(e,t)=>e===t.data?void 0:S(B({},t),{data:e})};var Ra={getAccessibilityString:e=>e.row.toString(),kind:l4.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:DL,measure:()=>44,draw:e=>OL(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:i,posX:l,posY:r}=e,{width:s,height:a}=t,o=i.drawHandle?7+(s-7)/2:s/2,n=a/2;if(Math.abs(l-o)<=10&&Math.abs(r-n)<=10)return S(B({},i),{checked:!i.checked})},onPaste:()=>{}};function DL(e,t){let{ctx:i,theme:l}=e,r=l.markerFontFull,s=t!=null?t:{};return(s==null?void 0:s.font)!==r&&(i.font=r,s.font=r),s.deprep=IL,i.textAlign="center",s}function IL(e){let{ctx:t}=e;t.textAlign="start"}function OL(e,t,i,l,r,s){let{ctx:a,rect:o,hoverAmount:n,theme:C}=e,{x:c,y:m,width:h,height:w}=o,g=i?1:l==="checkbox-visible"?.6+.4*n:n;if(l!=="number"&&g>0){a.globalAlpha=g;let L=7*(i?n:1);if(i9(a,C,i,r?c+L:c,m,r?h-L:h,w,!0,void 0,void 0,18,"center",s),r){a.globalAlpha=n,a.beginPath();for(let v of[3,6])for(let V of[-5,-1,3])a.rect(c+v,m+w/2+V,2,2);a.fillStyle=C.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(l==="number"||l==="both"&&!i){let L=t.toString(),v=C.markerFontFull,V=c+h/2;l==="both"&&n!==0&&(a.globalAlpha=1-n),a.fillStyle=C.textLight,a.font=v,a.fillText(L,V,m+w/2+M0(a,v)),n!==0&&(a.globalAlpha=1)}}var Ba={getAccessibilityString:()=>"",kind:l4.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_L(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _L(e,t,i){let{ctx:l,rect:r,hoverAmount:s,theme:a,spriteManager:o}=e,{x:n,y:C,width:c,height:m}=r;l.beginPath(),l.globalAlpha=s,l.rect(n+1,C+1,c,m-2),l.fillStyle=a.bgHeaderHovered,l.fill(),l.globalAlpha=1,l.beginPath();let h=t!=="",w=0;if(i!==void 0){let L=m-8,v=n+8/2,V=C+8/2;o.drawSprite(i,"normal",l,v,V,L,a,h?1:s),w=L}else{w=24;let g=12,L=h?g:s*g,v=h?0:(1-s)*g*.5,V=a.cellHorizontalPadding+4;L>0&&(l.moveTo(n+V+v,C+m/2),l.lineTo(n+V+v+L,C+m/2),l.moveTo(n+V+v+L*.5,C+m/2-L*.5),l.lineTo(n+V+v+L*.5,C+m/2+L*.5),l.lineWidth=2,l.strokeStyle=a.bgIconHeader,l.lineCap="round",l.stroke())}l.fillStyle=a.textMedium,l.fillText(t,w+n+a.cellHorizontalPadding+.5,C+m/2+M0(l,a)),l.beginPath()}var N5=M1(S1(),1);var WL=N5.lazy(async()=>await import("./number-overlay-editor-T75KSM4Z.js")),za={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:n1.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:B4,draw:e=>I0(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.displayData).width+i.cellHorizontalPadding*2,onDelete:e=>S(B({},e),{data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return N5.createElement(N5.Suspense,{fallback:null},N5.createElement(WL,{highlight:t,disabled:l.readonly===!0,value:l.data,fixedDecimals:l.fixedDecimals,allowNegative:l.allowNegative,thousandSeparator:l.thousandSeparator,decimalSeparator:l.decimalSeparator,validatedSelection:r,onChange:s=>{var a;return i(S(B({},l),{data:Number.isNaN((a=s.floatValue)!=null?a:0)?0:s.floatValue}))}}))},onPaste:(e,t,i)=>{var r;let l=typeof i.rawValue=="number"?i.rawValue:Number.parseFloat(typeof i.rawValue=="string"?i.rawValue:e);if(!(Number.isNaN(l)||t.data===l))return S(B({},t),{data:l,displayData:(r=i.formattedString)!=null?r:t.displayData})}};var ya={getAccessibilityString:()=>"",measure:()=>108,kind:n1.Protected,needsHover:!1,needsHoverPosition:!1,draw:UL,onPaste:()=>{}};function UL(e){let{ctx:t,theme:i,rect:l}=e,{x:r,y:s,height:a}=l;t.beginPath();let o=2.5,n=r+i.cellHorizontalPadding+o,C=s+a/2,c=Math.cos(s8(30))*o,m=Math.sin(s8(30))*o;for(let h=0;h<12;h++)t.moveTo(n,C-o),t.lineTo(n,C+o),t.moveTo(n+c,C-m),t.lineTo(n-c,C+m),t.moveTo(n-c,C-m),t.lineTo(n+c,C+m),n+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=i.textLight,t.stroke()}var ba=M1(S1(),1);var Fa={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:n1.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>B4(e,t,e.theme.textLight),draw:e=>I0(e,e.cell.data,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.data).width+i.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return ba.default.createElement(q4,{highlight:t,autoFocus:l.readonly!==!0,disabled:l.readonly!==!1,value:l.data,validatedSelection:r,onChange:s=>i(S(B({},l),{data:s.target.value}))})},onPaste:()=>{}};var Sa=M1(S1(),1);var ka={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:n1.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:B4,useLabel:!0,draw:e=>{var h;let{cell:t,hoverAmount:i,hyperWrapping:l,ctx:r,rect:s,theme:a,overrideCursor:o}=e,{displayData:n,contentAlign:C,hoverEffect:c,allowWrapping:m}=t;if(c===!0&&i>0){r.textBaseline="alphabetic";let w=a.cellHorizontalPadding,g=a.cellVerticalPadding,L=R4(n,r,a.baseFontFull,"alphabetic"),v=s.height-g,V=Math.min(v,L.actualBoundingBoxAscent*2.5);r.beginPath(),x0(r,s.x+w/2,s.y+(s.height-V)/2+1,L.width+w*3,V-1,(h=a.roundingRadius)!=null?h:4),r.globalAlpha=i,r.fillStyle=z0(a.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=a.textDark,r.textBaseline="middle",o==null||o("text")}I0(e,n,C,m,l)},measure:(e,t,i)=>{let l=t.displayData.split(` -`,t.allowWrapping===!0?void 0:1),r=0;for(let s of l)r=Math.max(r,e.measureText(s).width);return r+2*i.cellHorizontalPadding},onDelete:e=>S(B({},e),{data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:i,onChange:l,value:r,validatedSelection:s}=t;return Sa.createElement(q4,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:i,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:s,onChange:a=>l(S(B({},r),{data:a.target.value}))})}}),onPaste:(e,t,i)=>{var l;return e===t.data?void 0:S(B({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Da=M1(S1(),1);var d4=M1(S1(),1);var Ta=Q2("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1});var GL=e=>{let{uri:t,onChange:i,forceEditMode:l,readonly:r,validatedSelection:s,preview:a}=e,[o,n]=d4.useState(!r&&(t===""||l)),C=d4.useCallback(()=>{n(!0)},[]);return o?d4.createElement(q4,{validatedSelection:s,highlight:!0,autoFocus:!0,value:t,onChange:i}):d4.createElement(Ta,null,d4.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&d4.createElement("div",{className:"gdg-edit-icon",onClick:C},d4.createElement(j5,null)),d4.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Pa=GL;function Aa(e,t,i,l){let r=i.cellHorizontalPadding,s=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,o=e.actualBoundingBoxAscent;return l==="right"?r=t.width-a-i.cellHorizontalPadding:l==="center"&&(r=t.width/2-a/2),{x:r,y:s,width:a,height:o}}var Ia={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:n1.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:B4,draw:e=>{var c;let{cell:t,theme:i,overrideCursor:l,hoverX:r,hoverY:s,rect:a,ctx:o}=e,n=(c=t.displayData)!=null?c:t.data,C=t.hoverEffect===!0;if(l!==void 0&&C&&r!==void 0&&s!==void 0){let m=R4(n,o,i.baseFontFull),h=Aa(m,a,i,t.contentAlign),{x:w,y:g,width:L,height:v}=h;if(r>=w-4&&r<=w-4+L+8&&s>=g-4&&s<=g-4+v+8){let V=M0(o,i.baseFontFull);l("pointer");let u=5,d=g-V;o.beginPath(),o.moveTo(a.x+w,Math.floor(a.y+d+v+u)+.5),o.lineTo(a.x+w+L,Math.floor(a.y+d+v+u)+.5),o.strokeStyle=i.linkColor,o.stroke(),o.save(),o.fillStyle=e.cellFillColor,I0(S(B({},e),{rect:S(B({},a),{x:a.x-1})}),n,t.contentAlign),I0(S(B({},e),{rect:S(B({},a),{x:a.x-2})}),n,t.contentAlign),I0(S(B({},e),{rect:S(B({},a),{x:a.x+1})}),n,t.contentAlign),I0(S(B({},e),{rect:S(B({},a),{x:a.x+2})}),n,t.contentAlign),o.restore()}}o.fillStyle=C?i.linkColor:i.textDark,I0(e,n,t.contentAlign)},onClick:e=>{var c;let{cell:t,bounds:i,posX:l,posY:r,theme:s}=e,a=(c=t.displayData)!=null?c:t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let o=kt(a,s.baseFontFull);if(o===void 0)return;let n=Aa(o,i,s,t.contentAlign);K4({x:n.x-4,y:n.y-4,width:n.width+8,height:n.height+8},l,r)&&t.onClickUri(e)},measure:(e,t,i)=>{var l;return e.measureText((l=t.displayData)!=null?l:t.data).width+i.cellHorizontalPadding*2},onDelete:e=>S(B({},e),{data:""}),provideEditor:e=>t=>{var a;let{onChange:i,value:l,forceEditMode:r,validatedSelection:s}=t;return Da.createElement(Pa,{forceEditMode:l.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:l.data,preview:(a=l.displayData)!=null?a:l.data,validatedSelection:s,readonly:l.readonly===!0,onChange:o=>i(S(B({},l),{data:o.target.value}))})},onPaste:(e,t,i)=>{var l;return e===t.data?void 0:S(B({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Oa=[Ra,Ba,ga,da,pa,xa,fa,Na,za,ya,Fa,ka,Ia];var Ua=M1(Wa(),1);var C6=[],c6=class extends U9{constructor(){super(...arguments);s2(this,"imageLoaded",()=>{});s2(this,"loadedLocations",[]);s2(this,"cache",{});s2(this,"sendLoaded",(0,Ua.default)(()=>{this.imageLoaded(new z4(this.loadedLocations)),this.loadedLocations=[]},20));s2(this,"clearOutOfWindow",()=>{let i=Object.keys(this.cache);for(let l of i){let r=this.cache[l],s=!1;for(let a=0;a{n||(n=!0,C6.length<12?C6.unshift(o):a||(o.src=""))}},c=new Promise(h=>o.addEventListener("load",()=>h(null)));requestAnimationFrame(async()=>{try{o.src=i,await c,await o.decode();let h=this.cache[s];if(h!==void 0&&!n){h.img=o;for(let w of h.cells)this.loadedLocations.push(t9(w));a=!0,this.sendLoaded()}}catch(h){C.cancel()}}),this.cache[s]=C}loadOrGetImage(i,l,r){let s=i,a=this.cache[s];if(a!==void 0){let o=F0(l,r);return a.cells.includes(o)||a.cells.push(o),a.img}else this.loadImage(i,l,r,s)}},Ga=c6;var jL=(e,t)=>{let i=R5.useMemo(()=>B(B({},Ii),e.headerIcons),[e.headerIcons]),l=R5.useMemo(()=>{var r;return(r=e.imageWindowLoader)!=null?r:new Ga},[e.imageWindowLoader]);return R5.createElement(wa,S(B({},e),{renderers:Oa,headerIcons:i,ref:t,imageWindowLoader:l}))},m6=R5.forwardRef(jL);var Y1=M1(S1()),ro=M1(Y6());function qa(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,l=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ka(e){var t=(0,Y1.useRef)(null);function i(l){!l||l===t.current||(t.current=l,e(l))}return i}function JL(e){var t=(0,Y1.useRef)(e);return(0,Y1.useMemo)(function(){function i(r){typeof r=="function"?t.current=r(t.current):t.current=r}function l(){return t.current}return[l,i]},[])}function eV(){var e=(0,Y1.useRef)([]);return(0,Y1.useMemo)(function(){function t(){return e.current.length>0}function i(){for(var r=w9(e.current),s;!(s=r()).done;){var a=s.value;a()}e.current=[]}function l(r){e.current.push(r)}return{hasEventSubscriptions:t,removeAllEventSubscriptions:i,addEventSubscription:l}},[])}var w6=typeof window!="undefined"?Y1.useLayoutEffect:Y1.useEffect;function tV(e,t){var i=(0,Y1.useRef)(e);return t?(i.current=e,i):(i.current=null,i)}function J9(e){return parseFloat(e.replace("px",""))}function g6(e,t,i){return ei?i:e}function Xa(e){return e!=null}function ja(){for(var e=arguments.length,t=new Array(e),i=0;io.map(n=>({rawValue:n,formatted:n,format:"string"})))}function i6(e,t,i){var o;let l=Ys(e,t),r=n=>{var C;(C=window.navigator.clipboard)==null||C.writeText(n)},s=(n,C)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([n],{type:"text/plain"}),"text/html":new Blob([C],{type:"text/html"})})]),!0)},a=(n,C)=>{var c,m;try{if(i===void 0||i.clipboardData===null)throw new Error("No clipboard data");(c=i==null?void 0:i.clipboardData)==null||c.setData("text/plain",n),(m=i==null?void 0:i.clipboardData)==null||m.setData("text/html",C)}catch(h){s(n,C)||r(n)}};((o=window.navigator.clipboard)==null?void 0:o.write)!==void 0||(i==null?void 0:i.clipboardData)!==void 0?a(l.textPlain,l.textHtml):r(l.textPlain),i==null||i.preventDefault()}function w3(e){return e!==!0}var ia=x1(F1(),1);function ta(e){return typeof e=="string"?e:`${e}px`}var dL=()=>e=>e.innerWidth,uL=()=>e=>e.innerHeight,vL=K2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[dL()],"wmyidgi-1":[uL()]}}),la=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=i0(s,["inWidth","inHeight","children"]);return ia.createElement(vL,B({innerHeight:ta(i),innerWidth:ta(t)},r),l)};var l6=x1(F1(),1),pL=2,ML=1300;function ra(e,t,i){let l=l6.default.useRef(0),[r,s]=e!=null?e:[0,0];l6.default.useEffect(()=>{if(r===0&&s===0){l.current=0;return}let a=!1,o=0,n=C=>{var c;if(!a){if(o===0)o=C;else{let m=C-o;l.current=Math.min(1,l.current+m/ML);let h=l.current**1.618*m*pL;(c=t.current)==null||c.scrollBy(r*h,s*h),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var sa=x1(F1(),1);function aa({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,m,h,w]=sa.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let g=o/16,L=e,v=H7();return[typeof L=="number"?L*g:p=>Math.ceil(L(p)*g),Math.ceil(t*g),Math.ceil(i*g),S(B({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*g,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*g,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*g}),Math.ceil((r!=null?r:0)*g),Math.ceil((s!=null?s:0)*g)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:m,overscrollX:h,overscrollY:w}}var na=x1(F1(),1);var X4={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function a2(e,t){return e===!0?t:e===!1?"":e}function oa(e){let t=v5.value;return{activateCell:a2(e.activateCell," |Enter|shift+Enter"),clear:a2(e.clear,"any+Escape"),closeOverlay:a2(e.closeOverlay,"any+Escape"),acceptOverlayDown:a2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:a2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:a2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:a2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:a2(e.delete,t?"Backspace|Delete":"Delete"),downFill:a2(e.downFill,"primary+_68"),scrollToSelectedCell:a2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:a2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:a2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:a2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:a2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:a2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:a2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:a2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:a2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:a2(e.goToFirstCell,"primary+Home"),goToFirstColumn:a2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:a2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:a2(e.goToLastCell,"primary+End"),goToLastColumn:a2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:a2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:a2(e.goToNextPage,"PageDown"),goToPreviousPage:a2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:a2(e.rightFill,"primary+_82"),search:a2(e.search,"primary+f"),selectAll:a2(e.selectAll,"primary+a"),selectColumn:a2(e.selectColumn,"ctrl+ "),selectGrowDown:a2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:a2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:a2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:a2(e.selectGrowUp,"shift+ArrowUp"),selectRow:a2(e.selectRow,"shift+ "),selectToFirstCell:a2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:a2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:a2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:a2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:a2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:a2(e.selectToLastRow,"primary+shift+ArrowDown")}}function Ca(e){let t=it(e);return na.default.useMemo(()=>{var l,r,s,a,o,n,C,c,m,h,w,g;if(t===void 0)return oa(X4);let i=S(B({},t),{goToNextPage:(r=(l=t==null?void 0:t.goToNextPage)!=null?l:t==null?void 0:t.pageDown)!=null?r:X4.goToNextPage,goToPreviousPage:(a=(s=t==null?void 0:t.goToPreviousPage)!=null?s:t==null?void 0:t.pageUp)!=null?a:X4.goToPreviousPage,goToFirstCell:(n=(o=t==null?void 0:t.goToFirstCell)!=null?o:t==null?void 0:t.first)!=null?n:X4.goToFirstCell,goToLastCell:(c=(C=t==null?void 0:t.goToLastCell)!=null?C:t==null?void 0:t.last)!=null?c:X4.goToLastCell,selectToFirstCell:(h=(m=t==null?void 0:t.selectToFirstCell)!=null?m:t==null?void 0:t.first)!=null?h:X4.selectToFirstCell,selectToLastCell:(g=(w=t==null?void 0:t.selectToLastCell)!=null?w:t==null?void 0:t.last)!=null?g:X4.selectToLastCell});return oa(B(B({},X4),i))},[t])}var xL=O.lazy(async()=>await import("./data-grid-overlay-editor-CQGGTG2D.js")),fL=0;function ZL(e){return(0,ca.default)((0,s6.default)((0,s6.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,f5.default)(((l=(i=t.span)==null?void 0:i[0])!=null?l:0)+1,((s=(r=t.span)==null?void 0:r[1])!=null?s:0)+1)})))}function h3(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:S(B({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>S(B({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var r6={kind:c1.Loading,allowOverlay:!1},g3={columns:M2.empty(),rows:M2.empty(),current:void 0},EL=(e,t)=>{var A6,D6,I6,O6,_6,W6,U6,G6,q6,$6,K6,X6,j6;let[i,l]=O.useState(g3),[r,s]=O.useState(),a=O.useRef(null),o=O.useRef(null),[n,C]=O.useState(),c=O.useRef(null),m=O.useRef(),h=typeof window=="undefined"?null:window,{imageEditorOverride:w,getRowThemeOverride:g,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:b,drawCell:A,editorBloom:k,onHeaderClicked:P,onColumnProposeMove:z,spanRangeBehavior:_="default",onGroupHeaderClicked:j,onCellContextMenu:a1,className:m1,onHeaderContextMenu:g1,getCellsForSelection:h1,onGroupHeaderContextMenu:K,onGroupHeaderRenamed:s1,onCellEdited:n1,onCellsEdited:N1,onSearchResultsChanged:e1,searchResults:A1,onSearchValueChange:u1,searchValue:K1,onKeyDown:H1,onKeyUp:W1,keybindings:Z2,editOnType:B2=!0,onRowAppended:V2,onColumnMoved:B1,validateCell:r2,highlightRegions:c2,rangeSelect:Y1="rect",columnSelect:o1="multi",rowSelect:S1="multi",rangeSelectionBlending:Q1="exclusive",columnSelectionBlending:U1="exclusive",rowSelectionBlending:y1="exclusive",onDelete:G1,onDragStart:O1,onMouseMove:m2,onPaste:t1,copyHeaders:U=!1,freezeColumns:l1=0,cellActivationBehavior:Y="second-click",rowSelectionMode:f1="auto",onHeaderMenuClick:p1,getGroupDetails:I1,onSearchClose:z1,onItemHovered:f2,onSelectionCleared:N2,showSearch:p0,onVisibleRegionChanged:Y2,gridSelection:l0,onGridSelectionChange:Q2,minColumnWidth:m0=50,maxColumnWidth:w0=500,maxColumnAutoWidth:j2,provideEditor:j0,trailingRowOptions:s2,freezeTrailingRows:w2=0,allowedFillDirections:d2="orthogonal",scrollOffsetX:O2,scrollOffsetY:b2,verticalBorder:E2,onDragOverCell:M0,onDrop:Y0,onColumnResize:h0,onColumnResizeEnd:n0,onColumnResizeStart:M1,customRenderers:F2,fillHandle:o2,drawFocusRing:z2=!0,experimental:n2,fixedShadowX:Q0,fixedShadowY:T4,headerIcons:z4,imageWindowLoader:y4,initialSize:R5,isDraggable:e7,onDragLeave:t7,onRowMoved:u4,overscrollX:B5,overscrollY:z5,preventDiagonalScrolling:y5,rightElement:j4,rightElementProps:P4,trapFocus:i7=!1,smoothScrollX:l7,smoothScrollY:p3,scaleToRem:M3=!1,rowHeight:b5=34,headerHeight:b4=36,groupHeaderHeight:x3=b4,theme:f3,isOutsideClick:r7,renderers:F5}=e,r0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,W0=(D6=(A6=r0==null?void 0:r0.kind)!=null?A6:e.rowMarkers)!=null?D6:"none",S5=(I6=r0==null?void 0:r0.width)!=null?I6:e.rowMarkerWidth,k5=(_6=(O6=r0==null?void 0:r0.startIndex)!=null?O6:e.rowMarkerStartIndex)!=null?_6:1,w9=(W6=r0==null?void 0:r0.theme)!=null?W6:e.rowMarkerTheme,A4=(U6=r0==null?void 0:r0.checkboxStyle)!=null?U6:"square",U0=Math.max(m0,20),o4=Math.max(w0,U0),h9=Math.max(j2!=null?j2:o4,U0),D4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),g9=O.useMemo(()=>Number.parseFloat(D4.fontSize),[D4]),{rowHeight:z0,headerHeight:T5,groupHeaderHeight:H9,theme:s7,overscrollX:Z3,overscrollY:a7}=aa({groupHeaderHeight:x3,headerHeight:b4,overscrollX:B5,overscrollY:z5,remSize:g9,rowHeight:b5,scaleToRem:M3,theme:f3}),n4=Ca(Z2),F4=S5!=null?S5:d>1e4?48:d>1e3?44:d>100?36:32,G0=W0!=="none",D=G0?1:0,_2=V2!==void 0,Y4=(s2==null?void 0:s2.sticky)===!0,[E3,o7]=O.useState(!1),L9=p0!=null?p0:E3,N3=O.useCallback(()=>{z1!==void 0?z1():o7(!1)},[z1]),V9=O.useMemo(()=>l0===void 0?void 0:h3(l0,D),[l0,D]),W=V9!=null?V9:i,E0=O.useRef();E0.current===void 0&&(E0.current=new AbortController),O.useEffect(()=>()=>E0==null?void 0:E0.current.abort(),[]);let[s0,P5]=Ks(h1,p,D,E0.current,d),d9=O.useCallback((H,f,M)=>{if(r2===void 0)return!0;let F=[H[0]-D,H[1]];return r2==null?void 0:r2(F,f,M)},[D,r2]),I4=O.useRef(l0),T0=O.useCallback((H,f)=>{f&&(H=Js(H,s0,D,_,E0.current)),Q2!==void 0?(I4.current=h3(H,-D),Q2(I4.current)):l(H)},[Q2,s0,D,_]),C4=m5(h0,O.useCallback((H,f,M,F)=>{h0==null||h0(u[M-D],f,M-D,F)},[h0,D,u])),R3=m5(n0,O.useCallback((H,f,M,F)=>{n0==null||n0(u[M-D],f,M-D,F)},[n0,D,u])),A5=m5(M1,O.useCallback((H,f,M,F)=>{M1==null||M1(u[M-D],f,M-D,F)},[M1,D,u])),B3=m5(b,O.useCallback((H,f)=>{var M;return(M=b==null?void 0:b(S(B({},H),{columnIndex:H.columnIndex-D}),f))!=null?M:!1},[b,D])),z3=m5(A,O.useCallback((H,f)=>{var M;return(M=A==null?void 0:A(S(B({},H),{col:H.col-D}),f))!=null?M:!1},[A,D])),c4=O.useCallback(H=>{if(G1!==void 0){let f=G1(h3(H,-D));return typeof f=="boolean"?f:h3(f,D)}return!0},[G1,D]),[g0,H0,J2]=$s(W,T0,Q1,U1,y1,Y1),C0=O.useMemo(()=>r4(H7(),s7),[s7]),[D5,n7]=O.useState([0,0,0]),u9=O.useMemo(()=>{if(F5===void 0)return{};let H={};for(let f of F5)H[f.kind]=f;return H},[F5]),L0=O.useCallback(H=>H.kind!==c1.Custom?u9[H.kind]:F2==null?void 0:F2.find(f=>f.isMatch(H)),[F2,u9]),{sizedColumns:N0,nonGrowWidth:y}=It(u,d,P5,D5[0]-(D===0?0:F4)-D5[2],U0,h9,C0,L0,E0.current);W0!=="none"&&(y+=F4);let Q=O.useMemo(()=>N0.some(H=>H.group!==void 0),[N0]),v1=Q?T5+H9:T5,d1=W.rows.length,C1=W0==="none"?void 0:d1===0?!1:d1===d?!0:void 0,J=O.useMemo(()=>W0==="none"?N0:[{title:"",width:F4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:w9,rowMarker:A4,rowMarkerChecked:C1},...N0],[W0,N0,F4,w9,A4,C1]),[_1,$1]=O.useMemo(()=>[b2!==void 0&&typeof z0=="number"?Math.floor(b2/z0):0,b2!==void 0&&typeof z0=="number"?-(b2%z0):0],[b2,z0]),w1=O.useRef({height:1,width:1,x:0,y:0}),W2=O.useMemo(()=>{var H,f;return{x:w1.current.x,y:_1,width:(H=w1.current.width)!=null?H:1,height:(f=w1.current.height)!=null?f:1,ty:$1}},[$1,_1]),J1=O.useRef(!1),[q1,L2,X1]=tt(W2);w1.current=q1;let S2=((G6=q1.height)!=null?G6:1)>1;O.useLayoutEffect(()=>{if(b2!==void 0&&c.current!==null&&S2){if(c.current.scrollTop===b2)return;c.current.scrollTop=b2,c.current.scrollTop!==b2&&X1(),J1.current=!0}},[b2,S2,X1]);let e0=((q6=q1.width)!=null?q6:1)>1;O.useLayoutEffect(()=>{if(O2!==void 0&&c.current!==null&&e0){if(c.current.scrollLeft===O2)return;c.current.scrollLeft=O2,c.current.scrollLeft!==O2&&X1(),J1.current=!0}},[O2,e0,X1]);let q0=q1.x+D,U2=q1.y,G2=O.useRef(null),A2=O.useCallback(H=>{var f;H===!0?(f=G2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=G2.current)==null||M.focus()})},[]),D2=_2?d+1:d,V0=O.useCallback(H=>{let f=D===0?H:H.map(F=>S(B({},F),{location:[F.location[0]-D,F.location[1]]})),M=N1==null?void 0:N1(f);if(M!==!0)for(let F of f)n1==null||n1(F.location,F.value);return M},[n1,N1,D]),[u2,J0]=O.useState(),x0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,e4=z2?($6=W.current)==null?void 0:$6.cell:void 0,$0=e4==null?void 0:e4[0],O4=e4==null?void 0:e4[1],Q4=O.useMemo(()=>{var f,M;if((c2===void 0||c2.length===0)&&((M=(f=x0!=null?x0:$0)!=null?f:O4)!=null?M:u2)===void 0)return;let H=[];if(c2!==void 0)for(let F of c2){let T=J.length-F.range.x-D;T>0&&H.push({color:F.color,range:S(B({},F.range),{x:F.range.x+D,width:Math.min(T,F.range.width)}),style:F.style})}return u2!==void 0&&H.push({color:y0(C0.accentColor,0),range:u2,style:"dashed"}),x0!==void 0&&H.push({color:y0(C0.accentColor,.5),range:x0,style:"solid-outline"}),$0!==void 0&&O4!==void 0&&H.push({color:C0.accentColor,range:{x:$0,y:O4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[u2,x0,$0,O4,c2,J.length,C0.accentColor,D]),Z6=O.useRef(J);Z6.current=J;let K0=O.useCallback(([H,f],M=!1)=>{var G,I,q,X,r1,L1,R1,k1,Z1,b1;let F=_2&&f===D2-1;if(H===0&&G0)return F?r6:{kind:l4.Marker,allowOverlay:!1,checkboxStyle:A4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:W0==="clickable-number"?"number":W0,row:k5+f,drawHandle:u4!==void 0,cursor:W0==="clickable-number"?"pointer":void 0};if(F){let v2=H===D&&(G=s2==null?void 0:s2.hint)!=null?G:"",E1=Z6.current[H];if(((I=E1==null?void 0:E1.trailingRowOptions)==null?void 0:I.disabled)===!0)return r6;{let t2=(X=(q=E1==null?void 0:E1.trailingRowOptions)==null?void 0:q.hint)!=null?X:v2,p2=(L1=(r1=E1==null?void 0:E1.trailingRowOptions)==null?void 0:r1.addIcon)!=null?L1:s2==null?void 0:s2.addIcon;return{kind:l4.NewRow,hint:t2,allowOverlay:!1,icon:p2}}}else{let e2=H-D;if(M||(n2==null?void 0:n2.strict)===!0){let E1=w1.current,t2=E1.x>e2||e2>E1.x+E1.width||E1.y>f||f>E1.y+E1.height||f>=b3.current,p2=e2===((k1=(R1=E1.extras)==null?void 0:R1.selected)==null?void 0:k1[0])&&f===((Z1=E1.extras)==null?void 0:Z1.selected[1]),k2=!1;if(((b1=E1.extras)==null?void 0:b1.freezeRegions)!==void 0){for(let q2 of E1.extras.freezeRegions)if($4(q2,e2,f)){k2=!0;break}}if(t2&&!p2&&!k2)return r6}let v2=p([e2,f]);return D!==0&&v2.span!==void 0&&(v2=S(B({},v2),{span:[v2.span[0]+D,v2.span[1]+D]})),v2}},[_2,D2,G0,A4,W==null?void 0:W.rows,W0,k5,u4,D,s2==null?void 0:s2.hint,s2==null?void 0:s2.addIcon,n2==null?void 0:n2.strict,p]),y3=O.useCallback(H=>{var M,F;let f=(M=I1==null?void 0:I1(H))!=null?M:{name:H};return s1!==void 0&&H!==""&&(f={icon:f.icon,name:f.name,overrideTheme:f.overrideTheme,actions:[...(F=f.actions)!=null?F:[],{title:"Rename",icon:"renameIcon",onClick:T=>S3({group:f.name,bounds:T.bounds})}]}),f},[I1,s1]),C7=O.useCallback(H=>{var q;let[f,M]=H.cell,F=J[f],T=(F==null?void 0:F.group)!==void 0?(q=y3(F.group))==null?void 0:q.overrideTheme:void 0,G=F==null?void 0:F.themeOverride,I=g==null?void 0:g(M);s(S(B({},H),{theme:r4(C0,T,G,I,H.content.themeOverride)}))},[g,J,y3,C0]),I5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,T]=W.current.cell,G=K0([F,T]);if(G.kind!==c1.Boolean&&G.allowOverlay){let q=G;if(M!==void 0)switch(q.kind){case c1.Number:{let X=Q6(()=>M==="-"?-0:Number.parseFloat(M),0);q=S(B({},q),{data:Number.isNaN(X)?0:X});break}case c1.Text:case c1.Markdown:case c1.Uri:q=S(B({},q),{data:M});break}C7({target:H,content:q,initialValue:M,cell:[F,T],highlight:M===void 0,forceEditMode:M!==void 0})}else G.kind===c1.Boolean&&f&&G.readonly!==!0&&(V0([{location:W.current.cell,value:S(B({},G),{data:w3(G.data)})}]),(I=G2.current)==null||I.damage([{cell:W.current.cell}]))},[K0,W,V0,C7]),E6=O.useCallback((H,f)=>{var T;let M=(T=G2.current)==null?void 0:T.getBounds(H,f);if(M===void 0||c.current===null)return;let F=K0([H,f]);F.allowOverlay&&C7({target:M,content:F,initialValue:void 0,highlight:!0,cell:[H,f],forceEditMode:!0})},[K0,C7]),t0=O.useCallback((H,f,M="both",F=0,T=0,G=void 0)=>{var I;if(c.current!==null){let q=G2.current,X=o.current,r1=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,L1=typeof f!="number"?f.unit==="cell"?f.amount:void 0:f,R1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,k1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if(q!==null&&X!==null){let Z1={x:0,y:0,width:0,height:0},b1=0,e2=0;if((r1!==void 0||L1!==void 0)&&(Z1=(I=q.getBounds((r1!=null?r1:0)+D,L1!=null?L1:0))!=null?I:Z1,Z1.width===0||Z1.height===0))return;let v2=X.getBoundingClientRect(),E1=v2.width/X.offsetWidth;if(R1!==void 0&&(Z1=S(B({},Z1),{x:R1-v2.left-c.current.scrollLeft,width:1})),k1!==void 0&&(Z1=S(B({},Z1),{y:k1+v2.top-c.current.scrollTop,height:1})),Z1!==void 0){let t2={x:Z1.x-F,y:Z1.y-T,width:Z1.width+2*F,height:Z1.height+2*T},p2=0;for(let I3=0;I30&&(k2=a4(D2,q2,z0));let x2=p2*E1+v2.left+D*F4*E1,$2=v2.right,w4=v2.top+v1*E1,v4=v2.bottom-k2*E1,t5=Z1.width+F*2;switch(G==null?void 0:G.hAlign){case"start":$2=x2+t5;break;case"end":x2=$2-t5;break;case"center":x2=Math.floor((x2+$2)/2)-t5/2,$2=x2+t5;break}let i5=Z1.height+T*2;switch(G==null?void 0:G.vAlign){case"start":v4=w4+i5;break;case"end":w4=v4-i5;break;case"center":w4=Math.floor((w4+v4)/2)-i5/2,v4=w4+i5;break}x2>t2.x?b1=t2.x-x2:$2t2.y?e2=t2.y-w4:v4=D2-q2)&&(e2=0),(b1!==0||e2!==0)&&(E1!==1&&(b1/=E1,e2/=E1),c.current.scrollTo(b1+c.current.scrollLeft,e2+c.current.scrollTop))}}}},[D,w2,F4,v1,l1,N0,D2,Y4,z0]),N6=O.useRef(E6),R6=O.useRef(p),b3=O.useRef(d);N6.current=E6,R6.current=p,b3.current=d;let O5=O.useCallback(async(H,f=!0)=>{var X;let M=J[H];if(((X=M==null?void 0:M.trailingRowOptions)==null?void 0:X.disabled)===!0)return;let F=V2==null?void 0:V2(),T,G=!0;F!==void 0&&(T=await F,T==="top"&&(G=!1),typeof T=="number"&&(G=!1));let I=0,q=()=>{if(b3.current<=d){I<500&&window.setTimeout(q,I),I=50+I*2;return}let r1=typeof T=="number"?T:G?d:0;g7.current(H-D,r1),g0({cell:[H,r1],range:{x:H,y:r1,width:1,height:1}},!1,!1,"edit");let L1=R6.current([H-D,r1]);L1.allowOverlay&&o5(L1)&&L1.readonly!==!0&&f&&window.setTimeout(()=>{N6.current(H,r1)},0)};q()},[J,V2,D,d,g0]),c7=O.useCallback(H=>{var M,F,T;let f=(T=(F=(M=N0[H])==null?void 0:M.trailingRowOptions)==null?void 0:F.targetColumn)!=null?T:s2==null?void 0:s2.targetColumn;if(typeof f=="number")return f+(G0?1:0);if(typeof f=="object"){let G=u.indexOf(f);if(G>=0)return G+(G0?1:0)}},[N0,u,G0,s2==null?void 0:s2.targetColumn]),_4=O.useRef(),_5=O.useRef(),v9=O.useCallback((H,f)=>{var T;let[M,F]=f;return r4(C0,(T=J[M])==null?void 0:T.themeOverride,g==null?void 0:g(F),H.themeOverride)},[g,J,C0]),p9=O.useCallback(H=>{var L1,R1,k1,Z1;let f=v5.value?H.metaKey:H.ctrlKey,M=f&&S1==="multi",F=f&&o1==="multi",[T,G]=H.location,I=W.columns,q=W.rows,[X,r1]=(R1=(L1=W.current)==null?void 0:L1.cell)!=null?R1:[];if(H.kind==="cell"){if(_5.current=void 0,J4.current=[T,G],T===0&&G0){if(_2===!0&&G===d||W0==="number"||S1==="none")return;let b1=K0(H.location);if(b1.kind!==l4.Marker)return;if(u4!==void 0){let E1=L0(b1);d0((E1==null?void 0:E1.kind)===l4.Marker);let t2=(k1=E1==null?void 0:E1.onClick)==null?void 0:k1.call(E1,S(B({},H),{cell:b1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:v9(b1,H.location),preventDefault:()=>{}}));if(t2===void 0||t2.checked===b1.checked)return}s(void 0),A2();let e2=q.hasIndex(G),v2=_4.current;if(S1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&v2!==void 0&&q.hasIndex(v2)){let E1=[Math.min(v2,G),Math.max(v2,G)+1];M||f1==="multi"?H0(void 0,E1,!0):H0(M2.fromSingleSelection(E1),void 0,M)}else M||H.isTouch||f1==="multi"?e2?H0(q.remove(G),void 0,!0):(H0(void 0,G,!0),_4.current=G):e2&&q.length===1?H0(M2.empty(),void 0,f):(H0(M2.fromSingleSelection(G),void 0,f),_4.current=G)}else if(T>=D&&_2&&G===d){let b1=c7(T);O5(b1!=null?b1:T)}else if(X!==T||r1!==G){let b1=K0(H.location),e2=L0(b1);if((e2==null?void 0:e2.onSelect)!==void 0){let t2=!1;if(e2.onSelect(S(B({},H),{cell:b1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>t2=!0,theme:v9(b1,H.location)})),t2)return}let v2=Y4&&G===d,E1=Y4&&W!==void 0&&((Z1=W.current)==null?void 0:Z1.cell[1])===d;if((H.shiftKey||H.isLongTouch===!0)&&X!==void 0&&r1!==void 0&&W.current!==void 0&&!E1){if(v2)return;let t2=Math.min(T,X),p2=Math.max(T,X),k2=Math.min(G,r1),q2=Math.max(G,r1);g0(S(B({},W.current),{range:{x:t2,y:k2,width:p2-t2+1,height:q2-k2+1}}),!0,f,"click"),_4.current=void 0,A2()}else g0({cell:[T,G],range:{x:T,y:G,width:1,height:1}},!0,f,"click"),_4.current=void 0,s(void 0),A2()}}else if(H.kind==="header")if(J4.current=[T,G],s(void 0),G0&&T===0)_4.current=void 0,_5.current=void 0,S1==="multi"&&(q.length!==d?H0(M2.fromSingleSelection([0,d]),void 0,f):H0(M2.empty(),void 0,f),A2());else{let b1=_5.current;if(o1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&b1!==void 0&&I.hasIndex(b1)){let e2=[Math.min(b1,T),Math.max(b1,T)+1];F?J2(void 0,e2,f):J2(M2.fromSingleSelection(e2),void 0,f)}else F?(I.hasIndex(T)?J2(I.remove(T),void 0,f):J2(void 0,T,f),_5.current=T):o1!=="none"&&(J2(M2.fromSingleSelection(T),void 0,f),_5.current=T);_4.current=void 0,A2()}else H.kind===k0?J4.current=[T,G]:H.kind===n9&&!H.isMaybeScrollbar&&(T0(g3,!1),s(void 0),A2(),N2==null||N2(),_4.current=void 0,_5.current=void 0)},[O5,o1,A2,L0,c7,K0,W,G0,Y4,N2,u4,D,W0,S1,f1,d,g0,T0,J2,H0,_2,v9]),M9=O.useRef(!1),J4=O.useRef(),B6=O.useRef(q1),t4=O.useRef(),Eo=O.useCallback(H=>{if(W5.current=!1,B6.current=w1.current,H.button!==0&&H.button!==1){t4.current=void 0;return}let f=performance.now();t4.current={button:H.button,time:f,location:H.location},(H==null?void 0:H.kind)==="header"&&(M9.current=!0);let M=H.kind==="cell"&&H.isFillHandle;!M&&H.kind!=="cell"&&H.isEdge||(C({previousSelection:W,fillHandle:M}),J4.current=void 0,!H.isTouch&&H.button===0&&!M?p9(H):!H.isTouch&&H.button===1&&(J4.current=H.location))},[W,p9]),[F3,S3]=O.useState(),z6=O.useCallback(H=>{if(H.kind!==k0||o1!=="multi")return;let f=v5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=D&&L5(T.group,J[q].group);q--)G--;for(let q=M+1;q{if(s0!==void 0&&C4!==void 0){let f=w1.current.y,M=w1.current.height,F=s0({x:H,y:f,width:1,height:Math.min(M,d-f)},E0.current.signal);typeof F!="object"&&(F=await F());let T=N0[H-D],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=C0.baseFontFull;let q=w8(I,C0,T,0,F,U0,o4,!1,L0);C4==null||C4(T,q.width,H,q.width)}}},[N0,s0,o4,C0,U0,C4,D,d,L0]),[No,k3]=O.useState(),U5=O.useCallback(async(H,f)=>{var q,X;let M=(q=H.current)==null?void 0:q.range;if(M===void 0||s0===void 0||f.current===void 0)return;let F=f.current.range;if(x!==void 0){let r1=!1;if(x({fillDestination:S(B({},F),{x:F.x-D}),patternSource:S(B({},M),{x:M.x-D}),preventDefault:()=>r1=!0}),r1)return}let T=s0(M,E0.current.signal);typeof T!="object"&&(T=await T());let G=T,I=[];for(let r1=0;r1({cell:r1.location})))},[s0,V0,x,D]),y6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=S(B({},W),{current:S(B({},W.current),{range:S(B({},W.current.range),{width:1})})});U5(H,W)},[U5,W]),b6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=S(B({},W),{current:S(B({},W.current),{range:S(B({},W.current.range),{height:1})})});U5(H,W)},[U5,W]),Ro=O.useCallback((H,f)=>{var L1,R1,k1;let M=n;if(C(void 0),J0(void 0),k3(void 0),M9.current=!1,f)return;if((M==null?void 0:M.fillHandle)===!0&&W.current!==void 0&&((L1=M.previousSelection)==null?void 0:L1.current)!==void 0){if(u2===void 0)return;let Z1=S(B({},W),{current:S(B({},W.current),{range:p8(M.previousSelection.current.range,u2)})});U5(M.previousSelection,Z1),T0(Z1,!0);return}let[F,T]=H.location,[G,I]=(R1=J4.current)!=null?R1:[],q=()=>{W5.current=!0},X=Z1=>{var e2,v2,E1,t2;let b1=Z1.isTouch||G===F&&I===T;if(b1&&(Z==null||Z([F-D,T],S(B({},Z1),{preventDefault:q}))),Z1.button===1)return!W5.current;if(!W5.current){let p2=K0(H.location),k2=L0(p2);if(k2!==void 0&&k2.onClick!==void 0&&b1){let x2=k2.onClick(S(B({},Z1),{cell:p2,posX:Z1.localEventX,posY:Z1.localEventY,bounds:Z1.bounds,theme:v9(p2,H.location),preventDefault:q}));x2!==void 0&&!S4(x2)&&K5(x2)&&(V0([{location:Z1.location,value:x2}]),(e2=G2.current)==null||e2.damage([{cell:Z1.location}]))}if(W5.current||W.current===void 0)return!1;let q2=!1;switch((v2=p2.activationBehaviorOverride)!=null?v2:Y){case"double-click":case"second-click":{if(((t2=(E1=M==null?void 0:M.previousSelection)==null?void 0:E1.current)==null?void 0:t2.cell)===void 0)break;let[x2,$2]=W.current.cell,[w4,v4]=M.previousSelection.current.cell;q2=F===x2&&F===w4&&T===$2&&T===v4&&(Z1.isDoubleClick===!0||Y==="second-click");break}case"single-click":{q2=!0;break}}if(q2)return R==null||R([F-D,T]),I5(Z1.bounds,!1),!0}return!1},r1=H.location[0]-D;if(H.isTouch){let Z1=w1.current,b1=B6.current;if(Z1.x!==b1.x||Z1.y!==b1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&V5((k1=W.current)==null?void 0:k1.cell,H.location)){a1==null||a1([r1,H.location[1]],S(B({},H),{preventDefault:q}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){g1==null||g1(r1,S(B({},H),{preventDefault:q}));return}else if(H.kind===k0){if(r1<0)return;K==null||K(r1,S(B({},H),{preventDefault:q}));return}}H.kind==="cell"?X(H)||p9(H):H.kind===k0?j==null||j(r1,S(B({},H),{preventDefault:q})):(H.kind===N4&&(P==null||P(r1,S(B({},H),{preventDefault:q}))),p9(H));return}if(H.kind==="header"){if(r1<0)return;H.isEdge?H.isDoubleClick===!0&&m7(F):H.button===0&&F===G&&T===I&&(P==null||P(r1,S(B({},H),{preventDefault:q})))}if(H.kind===k0){if(r1<0)return;H.button===0&&F===G&&T===I&&(j==null||j(r1,S(B({},H),{preventDefault:q})),W5.current||z6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),J4.current=void 0},[n,W,D,u2,U5,T0,Z,K0,L0,Y,v9,V0,R,I5,a1,g1,K,p9,j,P,m7,z6]),Bo=O.useCallback(H=>{let f=S(B({},H),{location:[H.location[0]-D,H.location[1]]});m2==null||m2(f),n!==void 0&&H.buttons===0&&(C(void 0),J0(void 0),k3(void 0),M9.current=!1),k3(M=>{var F,T;return M9.current?[H.scrollEdge[0],0]:H.scrollEdge[0]===(M==null?void 0:M[0])&&H.scrollEdge[1]===M[1]?M:n===void 0||((T=(F=t4.current)==null?void 0:F.location[0])!=null?T:0){p1==null||p1(H-D,f)},[p1,D]),i4=(K6=W==null?void 0:W.current)==null?void 0:K6.cell,yo=O.useCallback((H,f,M,F,T,G)=>{J1.current=!1;let I=i4;I!==void 0&&(I=[I[0]-D,I[1]]);let q=l1===0?void 0:{x:0,y:H.y,width:l1,height:H.height},X=[];q!==void 0&&X.push(q),w2>0&&(X.push({x:H.x-D,y:d-w2,width:H.width,height:w2}),l1>0&&X.push({x:0,y:d-w2,width:l1,height:w2}));let r1={x:H.x-D,y:H.y,width:H.width,height:_2&&H.y+H.height>=d?H.height-1:H.height,tx:T,ty:G,extras:{selected:I,freezeRegion:q,freezeRegions:X}};w1.current=r1,L2(r1),n7([f,M,F]),Y2==null||Y2(r1,r1.tx,r1.ty,r1.extras)},[i4,D,_2,d,l1,w2,L2,Y2]),bo=m5(B1,O.useCallback((H,f)=>{B1==null||B1(H-D,f-D),o1!=="none"&&J2(M2.fromSingleSelection(f),void 0,!0)},[o1,B1,D,J2])),T3=O.useRef(!1),Fo=O.useCallback(H=>{if(H.location[0]===0&&D>0){H.preventDefault();return}O1==null||O1(S(B({},H),{location:[H.location[0]-D,H.location[1]]})),H.defaultPrevented()||(T3.current=!0),C(void 0)},[O1,D]),So=O.useCallback(()=>{T3.current=!1},[]),P3=O.useRef(),A3=O.useCallback(H=>{var f,M,F;if(!C3(H,P3.current)&&(P3.current=H,!(((f=t4==null?void 0:t4.current)==null?void 0:f.button)!==void 0&&t4.current.button>=1))){if(H.buttons!==0&&n!==void 0&&((M=t4.current)==null?void 0:M.location[0])===0&&H.location[0]===0&&D===1&&S1==="multi"&&n.previousSelection&&!n.previousSelection.rows.hasIndex(t4.current.location[1])&&W.rows.hasIndex(t4.current.location[1])){let T=Math.min(t4.current.location[1],H.location[1]),G=Math.max(t4.current.location[1],H.location[1])+1;H0(M2.fromSingleSelection([T,G]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!T3.current&&!M9.current&&(Y1==="rect"||Y1==="multi-rect")){let[T,G]=W.current.cell,[I,q]=H.location;if(q<0&&(q=w1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;q=Math.min(q,_2?d-1:d);let r1=Oi(X,I,q,d2);J0(r1)}else{if(_2&&G===d)return;if(_2&&q===d)if(H.kind===n9)q--;else return;I=Math.max(I,D);let L1=I-T,R1=q-G,k1={x:L1>=0?T:I,y:R1>=0?G:q,width:Math.abs(L1)+1,height:Math.abs(R1)+1};g0(S(B({},W.current),{range:k1}),!0,!1,"drag")}}f2==null||f2(S(B({},H),{location:[H.location[0]-D,H.location[1]]}))}},[d2,n,D,S1,W,Y1,f2,H0,_2,d,g0]),ko=O.useCallback(()=>{var I,q,X;let H=P3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,T]=H.location,G=w1.current;f===-1?F=(X=(q=(I=G.extras)==null?void 0:I.freezeRegion)==null?void 0:q.x)!=null?X:G.x:f===1&&(F=G.x+G.width),M===-1?T=Math.max(0,G.y):M===1&&(T=Math.min(d-1,G.y+G.height)),F=(0,x5.default)(F,0,J.length-1),T=(0,x5.default)(T,0,d-1),A3(S(B({},H),{location:[F,T]}))},[J.length,A3,d]);ra(No,c,ko);let m4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,T]=W.current.cell,G=W.current.range,I=G.x,q=G.x+G.width,X=G.y,r1=G.y+G.height;if(M!==0)switch(M){case 2:{r1=d,X=T,t0(0,r1,"vertical");break}case-2:{X=0,r1=T+1,t0(0,X,"vertical");break}case 1:{XT+1?(r1--,t0(0,r1,"vertical")):(X=Math.max(0,X-1),t0(0,X,"vertical"));break}default:l5(M)}if(f!==0)if(f===2)q=J.length,I=F,t0(q-1-D,0,"horizontal");else if(f===-2)I=D,q=F+1,t0(I-D,0,"horizontal");else{let L1=[];if(s0!==void 0){let R1=s0({x:I,y:X,width:q-I-D,height:r1-X},E0.current.signal);typeof R1=="object"&&(L1=ZL(R1))}if(f===1){let R1=!1;if(I0){let k1=(0,f5.default)(I+1,F+1).find(Z1=>!L1.includes(Z1-D));k1!==void 0&&(I=k1,R1=!0)}else I++,R1=!0;R1&&t0(I,0,"horizontal")}R1||(q=Math.min(J.length,q+1),t0(q-1-D,0,"horizontal"))}else if(f===-1){let R1=!1;if(q>F+1){if(L1.length>0){let k1=(0,f5.default)(q-1,F,-1).find(Z1=>!L1.includes(Z1-D));k1!==void 0&&(q=k1,R1=!0)}else q--,R1=!0;R1&&t0(q-D,0,"horizontal")}R1||(I=Math.max(D,I-1),t0(I-D,0,"horizontal"))}else l5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:q-I,height:r1-X}},!0,!1,"keyboard-select")},[s0,W,J.length,D,d,t0,g0]),W4=O.useCallback((H,f,M,F)=>{let T=D2-(M?0:1);if(H=(0,x5.default)(H,D,N0.length-1+D),f=(0,x5.default)(f,0,T),H===(i4==null?void 0:i4[0])&&f===(i4==null?void 0:i4[1]))return!1;if(F&&W.current!==void 0){let G=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&G.push(W.current.range),T0(S(B({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:G}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return m.current!==void 0&&m.current[0]===H&&m.current[1]===f&&(m.current=void 0),t0(H-D,f),!0},[D2,D,N0.length,i4,W,t0,T0,g0]),To=O.useCallback((H,f)=>{(r==null?void 0:r.cell)!==void 0&&H!==void 0&&K5(H)&&(V0([{location:r.cell,value:H}]),window.requestAnimationFrame(()=>{var T;(T=G2.current)==null||T.damage([{cell:r.cell}])})),A2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let T=W.current.cell[1]===D2-1&&H!==void 0;W4((0,x5.default)(W.current.cell[0]+M,0,J.length-1),(0,x5.default)(W.current.cell[1]+F,0,D2-1),T,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,A2,W,N,V0,D2,W4,J.length]),Po=O.useMemo(()=>`gdg-overlay-${fL++}`,[]),e5=O.useCallback(H=>{var M,F,T,G;A2();let f=[];for(let I=H.x;I({cell:I.location})))},[A2,p,L0,V0,D]),x9=r!==void 0,F6=O.useCallback(H=>{var Z1,b1,e2,v2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,T=W.columns,G=W.rows,I=n4;if(!x9&&l2(I.clear,H,M))T0(g3,!1),N2==null||N2();else if(!x9&&l2(I.selectAll,H,M))T0({columns:M2.empty(),rows:M2.empty(),current:{cell:(b1=(Z1=W.current)==null?void 0:Z1.cell)!=null?b1:[D,0],range:{x:D,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(l2(I.search,H,M))(e2=a==null?void 0:a.current)==null||e2.focus({preventScroll:!0}),o7(!0);else if(l2(I.delete,H,M)){let E1=(v2=c4==null?void 0:c4(W))!=null?v2:!0;if(E1!==!1){let t2=E1===!0?W:E1;if(t2.current!==void 0){e5(t2.current.range);for(let p2 of t2.current.rangeStack)e5(p2)}for(let p2 of t2.rows)e5({x:D,y:p2,width:u.length,height:1});for(let p2 of t2.columns)e5({x:p2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[q,X]=W.current.cell,r1=!1,L1=!1;l2(I.scrollToSelectedCell,H,M)?g7.current(q-D,X):o1!=="none"&&l2(I.selectColumn,H,M)?T.hasIndex(q)?J2(T.remove(q),void 0,!0):o1==="single"?J2(M2.fromSingleSelection(q),void 0,!0):J2(void 0,q,!0):S1!=="none"&&l2(I.selectRow,H,M)?G.hasIndex(X)?H0(G.remove(X),void 0,!0):S1==="single"?H0(M2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!x9&&F!==void 0&&l2(I.activateCell,H,M)?X===d&&_2?window.setTimeout(()=>{let E1=c7(q);O5(E1!=null?E1:q)},0):(R==null||R([q-D,X]),I5(F,!0)):W.current.range.height>1&&l2(I.downFill,H,M)?b6():W.current.range.width>1&&l2(I.rightFill,H,M)?y6():l2(I.goToNextPage,H,M)?X+=Math.max(1,w1.current.height-4):l2(I.goToPreviousPage,H,M)?X-=Math.max(1,w1.current.height-4):l2(I.goToFirstCell,H,M)?(s(void 0),X=0,q=0):l2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,q=Number.MAX_SAFE_INTEGER):l2(I.selectToFirstCell,H,M)?(s(void 0),m4([-2,-2])):l2(I.selectToLastCell,H,M)?(s(void 0),m4([2,2])):x9?(l2(I.closeOverlay,H,M)&&s(void 0),l2(I.acceptOverlayDown,H,M)&&(s(void 0),X++),l2(I.acceptOverlayUp,H,M)&&(s(void 0),X--),l2(I.acceptOverlayLeft,H,M)&&(s(void 0),q--),l2(I.acceptOverlayRight,H,M)&&(s(void 0),q++)):(l2(I.goDownCell,H,M)?X+=1:l2(I.goUpCell,H,M)?X-=1:l2(I.goRightCell,H,M)?q+=1:l2(I.goLeftCell,H,M)?q-=1:l2(I.goDownCellRetainSelection,H,M)?(X+=1,r1=!0):l2(I.goUpCellRetainSelection,H,M)?(X-=1,r1=!0):l2(I.goRightCellRetainSelection,H,M)?(q+=1,r1=!0):l2(I.goLeftCellRetainSelection,H,M)?(q-=1,r1=!0):l2(I.goToLastRow,H,M)?X=d-1:l2(I.goToFirstRow,H,M)?X=Number.MIN_SAFE_INTEGER:l2(I.goToLastColumn,H,M)?q=Number.MAX_SAFE_INTEGER:l2(I.goToFirstColumn,H,M)?q=Number.MIN_SAFE_INTEGER:(Y1==="rect"||Y1==="multi-rect")&&(l2(I.selectGrowDown,H,M)?m4([0,1]):l2(I.selectGrowUp,H,M)?m4([0,-1]):l2(I.selectGrowRight,H,M)?m4([1,0]):l2(I.selectGrowLeft,H,M)?m4([-1,0]):l2(I.selectToLastRow,H,M)?m4([0,2]):l2(I.selectToFirstRow,H,M)?m4([0,-2]):l2(I.selectToLastColumn,H,M)?m4([2,0]):l2(I.selectToFirstColumn,H,M)&&m4([-2,0])),L1=M.didMatch);let R1=W4(q,X,!1,r1),k1=M.didMatch;return k1&&(R1||!L1||i7)&&f(),k1},[x9,W,n4,o1,S1,Y1,D,d,W4,T0,N2,u.length,c4,i7,e5,J2,H0,_2,c7,O5,R,I5,b6,y6,m4]),f9=O.useCallback(H=>{let f=!1;if(H1!==void 0&&H1(S(B({},H),{cancel:()=>{f=!0}})),f||F6(H)||W.current===void 0)return;let[M,F]=W.current.cell,T=w1.current;if(B2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&o5(p([M-D,Math.max(0,Math.min(F,d-1))]))){if((!_2||F!==d)&&(T.y>F||F>T.y+T.height||T.x>M||M>T.x+T.width))return;I5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[B2,H1,F6,W,p,D,d,_2,I5]),Ao=O.useCallback((H,f)=>{let M=H.location[0]-D;if(H.kind==="header"&&(g1==null||g1(M,S(B({},H),{preventDefault:f}))),H.kind===k0){if(M<0)return;K==null||K(M,S(B({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,T]=H.location;a1==null||a1([M,T],S(B({},H),{preventDefault:f})),Rt(W,H.location)||W4(F,T,!1,!1)}},[W,a1,K,g1,D,W4]),D3=O.useCallback(async H=>{var I,q,X,r1,L1,R1;if(!n4.paste)return;function f(k1,Z1,b1,e2){var E1,t2,p2,k2;let v2=typeof b1=="object"?(E1=b1==null?void 0:b1.join(` +`))!=null?E1:"":(t2=b1==null?void 0:b1.toString())!=null?t2:"";if(!S4(k1)&&o5(k1)&&k1.readonly!==!0){let q2=E==null?void 0:E(v2,k1);if(q2!==void 0&&K5(q2))return{location:Z1,value:q2};let x2=L0(k1);if(x2===void 0)return;if(x2.kind===c1.Custom){d0(k1.kind===c1.Custom);let $2=(p2=x2.onPaste)==null?void 0:p2.call(x2,v2,k1.data);return $2===void 0?void 0:{location:Z1,value:S(B({},k1),{data:$2})}}else{let $2=(k2=x2.onPaste)==null?void 0:k2.call(x2,v2,k1,{formatted:e2,formattedString:typeof e2=="string"?e2:e2==null?void 0:e2.join(` +`),rawValue:b1});return $2===void 0?void 0:(d0($2.kind===k1.kind),{location:Z1,value:$2})}}}let M=W.columns,F=W.rows,T=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||((q=o.current)==null?void 0:q.contains(document.activeElement))===!0,G;if(W.current!==void 0?G=[W.current.range.x,W.current.range.y]:M.length===1?G=[(X=M.first())!=null?X:0,0]:F.length===1&&(G=[D,(r1=F.first())!=null?r1:0]),T&&G!==void 0){let k1,Z1,b1="text/plain",e2="text/html";if(navigator.clipboard.read!==void 0){let p2=await navigator.clipboard.read();for(let k2 of p2){if(k2.types.includes(e2)){let x2=await(await k2.getType(e2)).text(),$2=t6(x2);if($2!==void 0){k1=$2;break}}k2.types.includes(b1)&&(Z1=await(await k2.getType(b1)).text())}}else if(navigator.clipboard.readText!==void 0)Z1=await navigator.clipboard.readText();else if(H!==void 0&&(H==null?void 0:H.clipboardData)!==null){if(H.clipboardData.types.includes(e2)){let p2=H.clipboardData.getData(e2);k1=t6(p2)}k1===void 0&&H.clipboardData.types.includes(b1)&&(Z1=H.clipboardData.getData(b1))}else return;let[v2,E1]=G,t2=[];do{if(t1===void 0){let p2=K0(G),k2=(L1=Z1!=null?Z1:k1==null?void 0:k1.map(x2=>x2.map($2=>$2.rawValue).join(" ")).join(" "))!=null?L1:"",q2=f(p2,G,k2,void 0);q2!==void 0&&t2.push(q2);break}if(k1===void 0){if(Z1===void 0)return;k1=ea(Z1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([G[0]-D,G[1]],k1.map(p2=>p2.map(k2=>{var q2,x2;return(x2=(q2=k2.rawValue)==null?void 0:q2.toString())!=null?x2:""}))))!==!0)return;for(let[p2,k2]of k1.entries()){if(p2+E1>=d)break;for(let[q2,x2]of k2.entries()){let $2=[q2+v2,p2+E1],[w4,v4]=$2;if(w4>=J.length||v4>=D2)continue;let t5=K0($2),i5=f(t5,$2,x2.rawValue,x2.formatted);i5!==void 0&&t2.push(i5)}}}while(!1);V0(t2),(R1=G2.current)==null||R1.damage(t2.map(p2=>({cell:p2.location})))}},[E,L0,K0,W,n4.paste,J.length,V0,D2,t1,D,d]);a0("paste",D3,h,!1,!0);let Z9=O.useCallback(async(H,f)=>{var I,q;if(!n4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||((q=o.current)==null?void 0:q.contains(document.activeElement))===!0,F=W.columns,T=W.rows,G=(X,r1)=>{if(!U)i6(X,r1,H);else{let L1=r1.map(R1=>({kind:c1.Text,data:u[R1].title,displayData:u[R1].title,allowOverlay:!1}));i6([L1,...X],r1,H)}};if(M&&s0!==void 0){if(W.current!==void 0){let X=s0(W.current.range,E0.current.signal);typeof X!="object"&&(X=await X()),G(X,(0,f5.default)(W.current.range.x-D,W.current.range.x+W.current.range.width-D))}else if(T!==void 0&&T.length>0){let r1=[...T].map(L1=>{let R1=s0({x:D,y:L1,width:u.length,height:1},E0.current.signal);return typeof R1=="object"?R1[0]:R1().then(k1=>k1[0])});if(r1.some(L1=>L1 instanceof Promise)){let L1=await Promise.all(r1);G(L1,(0,f5.default)(u.length))}else G(r1,(0,f5.default)(u.length))}else if(F.length>0){let X=[],r1=[];for(let L1 of F){let R1=s0({x:L1,y:0,width:1,height:d},E0.current.signal);typeof R1!="object"&&(R1=await R1()),X.push(R1),r1.push(L1-D)}if(X.length===1)G(X[0],r1);else{let L1=X.reduce((R1,k1)=>R1.map((Z1,b1)=>[...Z1,...k1[b1]]));G(L1,r1)}}}},[u,s0,W,n4.copy,D,d,U]);a0("copy",Z9,h,!1,!1);let Do=O.useCallback(async H=>{var M,F;if(!(!n4.cut||!(((M=c.current)==null?void 0:M.contains(document.activeElement))===!0||((F=o.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await Z9(H),W.current!==void 0)){let T={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:M2.empty(),columns:M2.empty()},G=c4==null?void 0:c4(T);if(G===!1||(T=G===!0?T:G,T.current===void 0))return;e5(T.current.range)}},[e5,W,n4.cut,Z9,c4]);a0("cut",Do,h,!1,!1);let Io=O.useCallback((H,f)=>{if(e1!==void 0){D!==0&&(H=H.map(T=>[T[0]-D,T[1]])),e1(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];m.current!==void 0&&m.current[0]===M&&m.current[1]===F||(m.current=[M,F],W4(M,F,!1,!1))},[e1,D,W4]),[w7,h7]=(j6=(X6=l0==null?void 0:l0.current)==null?void 0:X6.cell)!=null?j6:[],g7=O.useRef(t0);g7.current=t0,O.useLayoutEffect(()=>{var H,f,M,F;!J1.current&&w7!==void 0&&h7!==void 0&&(w7!==((f=(H=I4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||h7!==((F=(M=I4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&g7.current(w7,h7),J1.current=!1},[w7,h7]);let S6=W.current!==void 0&&(W.current.cell[0]>=J.length||W.current.cell[1]>=D2);O.useLayoutEffect(()=>{S6&&T0(g3,!1)},[S6,T0]);let Oo=O.useMemo(()=>_2===!0&&(s2==null?void 0:s2.tint)===!0?M2.fromSingleSelection(D2-1):M2.empty(),[D2,_2,s2==null?void 0:s2.tint]),_o=O.useCallback(H=>{var f;return typeof E2=="boolean"?E2:(f=E2==null?void 0:E2(H-D))!=null?f:!0},[D,E2]),Wo=O.useMemo(()=>{if(F3===void 0||o.current===null)return null;let{bounds:H,group:f}=F3,M=o.current.getBoundingClientRect();return O.createElement(Gs,{bounds:H,group:f,canvasBounds:M,onClose:()=>S3(void 0),onFinish:F=>{S3(void 0),s1==null||s1(f,F)}})},[s1,F3]),Uo=Math.min(J.length,l1+(G0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>O5(H+D,f),updateCells:H=>{var f;return D!==0&&(H=H.map(M=>({cell:[M.cell[0]+D,M.cell[1]]}))),(f=G2.current)==null?void 0:f.damage(H)},getBounds:(H,f)=>{var M;if(!((o==null?void 0:o.current)===null||(c==null?void 0:c.current)===null)){if(H===void 0&&f===void 0){let F=o.current.getBoundingClientRect(),T=F.width/c.current.clientWidth;return{x:F.x-c.current.scrollLeft*T,y:F.y-c.current.scrollTop*T,width:c.current.scrollWidth*T,height:c.current.scrollHeight*T}}return(M=G2.current)==null?void 0:M.getBounds((H!=null?H:0)+D,f)}},focus:()=>{var H;return(H=G2.current)==null?void 0:H.focus()},emit:async H=>{switch(H){case"delete":f9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":f9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":f9({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Z9(void 0,!0);break;case"paste":await D3();break}},scrollTo:t0,remeasureColumns:H=>{for(let f of H)m7(f+D)}}),[O5,m7,Z9,f9,D3,D,t0]);let[k6,T6]=i4!=null?i4:[],Go=O.useCallback(H=>{let[f,M]=H;if(M===-1){o1!=="none"&&(J2(M2.fromSingleSelection(f),void 0,!1),A2());return}k6===f&&T6===M||(g0({cell:H,range:{x:f,y:M,width:1,height:1}},!0,!1,"keyboard-nav"),t0(f,M))},[o1,A2,t0,k6,T6,g0,J2]),[qo,$o]=O.useState(!1),P6=O.useRef((0,ma.default)(H=>{$o(H)},5)),Ko=O.useCallback(()=>{P6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[D,U2],range:{x:D,y:U2,width:1,height:1}},!0,!1,"keyboard-select")},[U2,W,n,D,g0]),Xo=O.useCallback(()=>{P6.current(!1)},[]),[jo,Yo]=O.useMemo(()=>{var T;let H,f=(T=n2==null?void 0:n2.scrollbarWidthOverride)!=null?T:k9(),M=d+(_2?1:0);if(typeof z0=="number")H=v1+M*z0;else{let G=0,I=Math.min(M,10);for(let q=0;qI.width+G,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[J,n2==null?void 0:n2.scrollbarWidthOverride,z0,d,_2,v1]),Qo=O.useMemo(()=>ce(C0),[C0]);return O.createElement(me.Provider,{value:C0},O.createElement(la,{style:Qo,className:m1,inWidth:v!=null?v:jo,inHeight:V!=null?V:Yo},O.createElement(Us,{fillHandle:o2,drawFocusRing:z2,experimental:n2,fixedShadowX:Q0,fixedShadowY:T4,getRowThemeOverride:g,headerIcons:z4,imageWindowLoader:y4,initialSize:R5,isDraggable:e7,onDragLeave:t7,onRowMoved:u4,overscrollX:Z3,overscrollY:a7,preventDiagonalScrolling:y5,rightElement:j4,rightElementProps:P4,smoothScrollX:l7,smoothScrollY:p3,className:m1,enableGroups:Q,onCanvasFocused:Ko,onCanvasBlur:Xo,canvasRef:o,onContextMenu:Ao,theme:C0,cellXOffset:q0,cellYOffset:U2,accessibilityHeight:q1.height,onDragEnd:So,columns:J,nonGrowWidth:y,drawHeader:B3,onColumnProposeMove:z,drawCell:z3,disabledRows:Oo,freezeColumns:Uo,lockColumns:D,firstColAccessible:D===0,getCellContent:K0,minColumnWidth:U0,maxColumnWidth:o4,searchInputRef:a,showSearch:L9,onSearchClose:N3,highlightRegions:Q4,getCellsForSelection:s0,getGroupDetails:y3,headerHeight:T5,isFocused:qo,groupHeaderHeight:Q?H9:0,freezeTrailingRows:w2+(_2&&(s2==null?void 0:s2.sticky)===!0?1:0),hasAppendRow:_2,onColumnResize:C4,onColumnResizeEnd:R3,onColumnResizeStart:A5,onCellFocused:Go,onColumnMoved:bo,onDragStart:Fo,onHeaderMenuClick:zo,onItemHovered:A3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Bo,onKeyDown:f9,onKeyUp:W1,onMouseDown:Eo,onMouseUp:Ro,onDragOverCell:M0,onDrop:Y0,onSearchResultsChanged:Io,onVisibleRegionChanged:yo,clientSize:D5,rowHeight:z0,searchResults:A1,searchValue:K1,onSearchValueChange:u1,rows:D2,scrollRef:c,selection:W,translateX:q1.tx,translateY:q1.ty,verticalBorder:_o,gridRef:G2,getCellRenderer:L0}),Wo,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(xL,S(B({},r),{validateCell:d9,bloom:k,id:Po,getCellRenderer:L0,className:(n2==null?void 0:n2.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:j0,imageEditorOverride:w,onFinishEditing:To,markdownDivCreateNode:L,isOutsideClick:r7})))))},wa=O.forwardRef(EL);var ha=20,ga={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:"false"},kind:c1.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>{var t;return NL(e,e.cell.data,B9(e.cell),(t=e.cell.maxSize)!=null?t:ha)},onDelete:e=>S(B({},e),{data:!1}),onClick:e=>{var v,V;let{cell:t,posX:i,posY:l,bounds:r,theme:s}=e,{width:a,height:o,x:n,y:C}=r,c=(v=t.maxSize)!=null?v:ha,m=Math.floor(r.y+o/2),h=D7(c,o,s.cellVerticalPadding),w=A7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,h),g=P7(w,m,h),L=I7(n+i,C+l,g);if(B9(t)&&L)return S(B({},t),{data:w3(t.data)})},onPaste:(e,t)=>{let i=q5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=$5),i===t.data?void 0:S(B({},t),{data:i})}};function NL(e,t,i,l){if(!i&&t===q5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:m}}=e,{x:h,y:w,width:g,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===q5&&(V*=s),V!==0&&(r.globalAlpha=V,t9(r,a,t,h,w,g,L,n,C,c,l,m),r.globalAlpha=1)}var Va=x1(F1(),1);var H3=x1(F1(),1);var Ha=K2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var RL=e=>{let{bubbles:t}=e;return H3.createElement(Ha,null,t.map((i,l)=>H3.createElement("div",{key:l,className:"boe-bubble"},i)),H3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},La=RL;var da={getAccessibilityString:e=>O7(e.data),kind:c1.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r).width+l+20,0)+2*i.cellHorizontalPadding-4,draw:e=>zL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return Va.createElement(La,{bubbles:t.data})},onPaste:()=>{}},BL=4;function zL(e,t){var L;let{rect:i,theme:l,ctx:r,highlighted:s}=e,{x:a,y:o,width:n,height:C}=i,c=20,m=8,h=BL,w=a+l.cellHorizontalPadding,g=[];for(let v of t){if(w>a+n)break;let V=f4(v,r,l.baseFontFull).width;g.push({x:w,width:V}),w+=V+m*2+h}r.beginPath();for(let v of g)Z0(r,v.x,o+(C-c)/2,v.width+m*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of g.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+m,o+C/2+f0(r,l))}var va=x1(F1(),1);var Y9=x1(F1(),1);var yL=K2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),bL=e=>{let{drilldowns:t}=e;return Y9.createElement(yL,null,t.map((i,l)=>Y9.createElement("div",{key:l,className:"doe-bubble"},i.img!==void 0&&Y9.createElement("img",{src:i.img}),Y9.createElement("div",null,i.text))))},ua=bL;var pa={getAccessibilityString:e=>O7(e.data.map(t=>t.text)),kind:c1.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,i)=>t.data.reduce((l,r)=>e.measureText(r.text).width+l+20+(r.img!==void 0?18:0),0)+2*i.cellHorizontalPadding-4,draw:e=>kL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return va.createElement(ua,{drilldowns:t.data})},onPaste:()=>{}},FL=4,a6={};function SL(e,t,i,l){let r=Math.ceil(window.devicePixelRatio),s=5,a=i-s*2,o=4,n=i*r,C=l+s,c=l*3,m=(c+s*2)*r,h=`${e},${t},${r},${i}`;if(a6[h]!==void 0)return{el:a6[h],height:n,width:m,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let w=document.createElement("canvas"),g=w.getContext("2d");return g===null?null:(w.width=m,w.height=n,g.scale(r,r),a6[h]=w,g.beginPath(),Z0(g,s,s,c,a,l),g.shadowColor="rgba(24, 25, 34, 0.4)",g.shadowBlur=1,g.fillStyle=e,g.fill(),g.shadowColor="rgba(24, 25, 34, 0.3)",g.shadowOffsetY=1,g.shadowBlur=5,g.fillStyle=e,g.fill(),g.shadowOffsetY=0,g.shadowBlur=0,g.shadowBlur=0,g.beginPath(),Z0(g,s+.5,s+.5,c,a,l),g.strokeStyle=t,g.lineWidth=1,g.stroke(),{el:w,height:n,width:m,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function kL(e,t){var Z,R;let{rect:i,theme:l,ctx:r,imageLoader:s,col:a,row:o}=e,{x:n,width:C}=i,c=l.baseFontFull,m=n8(r,c),h=Math.min(i.height,Math.max(16,Math.ceil(m*l.lineHeight)*2)),w=Math.floor(i.y+(i.height-h)/2),g=h-10,L=8,v=FL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=SL(l.bgCell,l.drilldownBorder,h,u),p=[];for(let x of t){if(V>n+C)break;let E=f4(x.text,r,c).width,b=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(b=g-8+4);let A=E+b+L*2;p.push({x:V,width:A}),V+=A+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:b,width:A,dpr:k,padding:P}=d,z=b/k,_=P/k;for(let j of p){let a1=Math.floor(j.x),m1=Math.floor(j.width),g1=m1-(z-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,b,N,a1-_,w,z,h),g1>0&&r.drawImage(x,b,0,E,N,a1+(z-_),w,g1,h),r.drawImage(x,A-b,0,b,N,a1+m1-(z-_),w,z,h),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],b=N.x+L;if(E.img!==void 0){let A=s.loadOrGetImage(E.img,a,o);if(A!==void 0){let k=g-8,P=0,z=0,_=A.width,j=A.height;_>j?(P+=(_-j)/2,_=j):j>_&&(z+=(j-_)/2,j=_),r.beginPath(),Z0(r,b,w+h/2-k/2,k,k,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(A,P,z,_,j,b,w+h/2-k/2,k,k),r.restore(),b+=k+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,b,w+h/2+f0(r,l))}}var Ma=x1(F1(),1);var xa={getAccessibilityString:e=>e.data.join(", "),kind:c1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return TL(e,(t=e.cell.displayData)!=null?t:e.cell.data,(l=(i=e.cell.rounding)!=null?i:e.theme.roundingRadius)!=null?l:4,e.cell.contentAlign)},measure:(e,t)=>t.data.length*50,onDelete:e=>S(B({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:rt;return Ma.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(S(B({},t),{data:[s]}))}})},onPaste:(e,t)=>{e=e.trim();let l=e.split(",").map(r=>{try{return new URL(r),r}catch(s){return}}).filter(r=>r!==void 0);if(!(l.length===t.data.length&&l.every((r,s)=>r===t.data[s])))return S(B({},t),{data:l})}},o6=4;function TL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:m,height:h,width:w}=r,g=h-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),Z0(n,V,m+o.cellVerticalPadding,d,g,i),n.save(),n.clip()),n.drawImage(u,V,m+o.cellVerticalPadding,d,g),i>0&&n.restore(),V+=d+o6}}function PL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var fa={getAccessibilityString:()=>"",kind:c1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,m;let{cell:t,col:i,row:l,ctx:r,rect:s,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let o=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(o+=Math.round(PL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);Z0(r,s.x+n,s.y+(s.height-C)/2,o,C,(m=a.roundingRadius)!=null?m:3),r.fillStyle=y0(a.textDark,.1),r.fill()},onPaste:()=>{}};var Ea=x1(F1(),1);var u0=x1(F1(),1);var AL=()=>e=>e.targetWidth,n6=K2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[AL(),"px"]}});var Za=e=>{let{value:t,onChange:i,forceEditMode:l,createNode:r,targetRect:s,onFinish:a,validatedSelection:o}=e,n=t.data,C=t.readonly===!0,[c,m]=u0.useState(n===""||l),h=u0.useCallback(()=>{m(g=>!g)},[]),w=n?"gdg-ml-6":"";return c?u0.createElement(n6,{targetWidth:s.width-20},u0.createElement(G4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:g=>{g.key==="Enter"&&g.stopPropagation()},onChange:i}),u0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${w}`,onClick:()=>a(t)},u0.createElement(Je,null))):u0.createElement(n6,{targetWidth:s.width},u0.createElement(A9,{contents:n,createNode:r}),!C&&u0.createElement(u0.Fragment,null,u0.createElement("div",{className:"spacer"}),u0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${w}`,onClick:h},u0.createElement(X5,null))),u0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var Na={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Z4,measure:(e,t,i)=>{let l=t.data.split(` +`)[0];return e.measureText(l).width+2*i.cellHorizontalPadding},draw:e=>A0(e,e.cell.data,e.cell.contentAlign),onDelete:e=>S(B({},e),{data:""}),provideEditor:()=>e=>{let{onChange:t,value:i,target:l,onFinishedEditing:r,markdownDivCreateNode:s,forceEditMode:a,validatedSelection:o}=e;return Ea.createElement(Za,{onFinish:r,targetRect:l,value:i,validatedSelection:o,onChange:n=>t(S(B({},i),{data:n.target.value})),forceEditMode:a,createNode:s})},onPaste:(e,t)=>e===t.data?void 0:S(B({},t),{data:e})};var Ra={getAccessibilityString:e=>e.row.toString(),kind:l4.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:DL,measure:()=>44,draw:e=>OL(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{let{bounds:t,cell:i,posX:l,posY:r}=e,{width:s,height:a}=t,o=i.drawHandle?7+(s-7)/2:s/2,n=a/2;if(Math.abs(l-o)<=10&&Math.abs(r-n)<=10)return S(B({},i),{checked:!i.checked})},onPaste:()=>{}};function DL(e,t){let{ctx:i,theme:l}=e,r=l.markerFontFull,s=t!=null?t:{};return(s==null?void 0:s.font)!==r&&(i.font=r,s.font=r),s.deprep=IL,i.textAlign="center",s}function IL(e){let{ctx:t}=e;t.textAlign="start"}function OL(e,t,i,l,r,s){let{ctx:a,rect:o,hoverAmount:n,theme:C}=e,{x:c,y:m,width:h,height:w}=o,g=i?1:l==="checkbox-visible"?.6+.4*n:n;if(l!=="number"&&g>0){a.globalAlpha=g;let L=7*(i?n:1);if(t9(a,C,i,r?c+L:c,m,r?h-L:h,w,!0,void 0,void 0,18,"center",s),r){a.globalAlpha=n,a.beginPath();for(let v of[3,6])for(let V of[-5,-1,3])a.rect(c+v,m+w/2+V,2,2);a.fillStyle=C.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(l==="number"||l==="both"&&!i){let L=t.toString(),v=C.markerFontFull,V=c+h/2;l==="both"&&n!==0&&(a.globalAlpha=1-n),a.fillStyle=C.textLight,a.font=v,a.fillText(L,V,m+w/2+f0(a,v)),n!==0&&(a.globalAlpha=1)}}var Ba={getAccessibilityString:()=>"",kind:l4.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_L(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _L(e,t,i){let{ctx:l,rect:r,hoverAmount:s,theme:a,spriteManager:o}=e,{x:n,y:C,width:c,height:m}=r;l.beginPath(),l.globalAlpha=s,l.rect(n+1,C+1,c,m-2),l.fillStyle=a.bgHeaderHovered,l.fill(),l.globalAlpha=1,l.beginPath();let h=t!=="",w=0;if(i!==void 0){let L=m-8,v=n+8/2,V=C+8/2;o.drawSprite(i,"normal",l,v,V,L,a,h?1:s),w=L}else{w=24;let g=12,L=h?g:s*g,v=h?0:(1-s)*g*.5,V=a.cellHorizontalPadding+4;L>0&&(l.moveTo(n+V+v,C+m/2),l.lineTo(n+V+v+L,C+m/2),l.moveTo(n+V+v+L*.5,C+m/2-L*.5),l.lineTo(n+V+v+L*.5,C+m/2+L*.5),l.lineWidth=2,l.strokeStyle=a.bgIconHeader,l.lineCap="round",l.stroke())}l.fillStyle=a.textMedium,l.fillText(t,w+n+a.cellHorizontalPadding+.5,C+m/2+f0(l,a)),l.beginPath()}var Z5=x1(F1(),1);var WL=Z5.lazy(async()=>await import("./number-overlay-editor-T75KSM4Z.js")),za={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Number,needsHover:!1,needsHoverPosition:!1,useLabel:!0,drawPrep:Z4,draw:e=>A0(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.displayData).width+i.cellHorizontalPadding*2,onDelete:e=>S(B({},e),{data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return Z5.createElement(Z5.Suspense,{fallback:null},Z5.createElement(WL,{highlight:t,disabled:l.readonly===!0,value:l.data,fixedDecimals:l.fixedDecimals,allowNegative:l.allowNegative,thousandSeparator:l.thousandSeparator,decimalSeparator:l.decimalSeparator,validatedSelection:r,onChange:s=>{var a;return i(S(B({},l),{data:Number.isNaN((a=s.floatValue)!=null?a:0)?0:s.floatValue}))}}))},onPaste:(e,t,i)=>{var r;let l=typeof i.rawValue=="number"?i.rawValue:Number.parseFloat(typeof i.rawValue=="string"?i.rawValue:e);if(!(Number.isNaN(l)||t.data===l))return S(B({},t),{data:l,displayData:(r=i.formattedString)!=null?r:t.displayData})}};var ya={getAccessibilityString:()=>"",measure:()=>108,kind:c1.Protected,needsHover:!1,needsHoverPosition:!1,draw:UL,onPaste:()=>{}};function UL(e){let{ctx:t,theme:i,rect:l}=e,{x:r,y:s,height:a}=l;t.beginPath();let o=2.5,n=r+i.cellHorizontalPadding+o,C=s+a/2,c=Math.cos(s8(30))*o,m=Math.sin(s8(30))*o;for(let h=0;h<12;h++)t.moveTo(n,C-o),t.lineTo(n,C+o),t.moveTo(n+c,C-m),t.lineTo(n-c,C+m),t.moveTo(n-c,C-m),t.lineTo(n+c,C+m),n+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=i.textLight,t.stroke()}var ba=x1(F1(),1);var Fa={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Z4(e,t,e.theme.textLight),draw:e=>A0(e,e.cell.data,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.data).width+i.cellHorizontalPadding*2,provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return ba.default.createElement(G4,{highlight:t,autoFocus:l.readonly!==!0,disabled:l.readonly!==!1,value:l.data,validatedSelection:r,onChange:s=>i(S(B({},l),{data:s.target.value}))})},onPaste:()=>{}};var Sa=x1(F1(),1);var ka={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Z4,useLabel:!0,draw:e=>{var h;let{cell:t,hoverAmount:i,hyperWrapping:l,ctx:r,rect:s,theme:a,overrideCursor:o}=e,{displayData:n,contentAlign:C,hoverEffect:c,allowWrapping:m}=t;if(c===!0&&i>0){r.textBaseline="alphabetic";let w=a.cellHorizontalPadding,g=a.cellVerticalPadding,L=f4(n,r,a.baseFontFull,"alphabetic"),v=s.height-g,V=Math.min(v,L.actualBoundingBoxAscent*2.5);r.beginPath(),Z0(r,s.x+w/2,s.y+(s.height-V)/2+1,L.width+w*3,V-1,(h=a.roundingRadius)!=null?h:4),r.globalAlpha=i,r.fillStyle=y0(a.textDark,.1),r.fill(),r.globalAlpha=1,r.fillStyle=a.textDark,r.textBaseline="middle",o==null||o("text")}A0(e,n,C,m,l)},measure:(e,t,i)=>{let l=t.displayData.split(` +`,t.allowWrapping===!0?void 0:1),r=0;for(let s of l)r=Math.max(r,e.measureText(s).width);return r+2*i.cellHorizontalPadding},onDelete:e=>S(B({},e),{data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:i,onChange:l,value:r,validatedSelection:s}=t;return Sa.createElement(G4,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:i,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:s,onChange:a=>l(S(B({},r),{data:a.target.value}))})}}),onPaste:(e,t,i)=>{var l;return e===t.data?void 0:S(B({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Da=x1(F1(),1);var H4=x1(F1(),1);var Ta=K2("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1});var GL=e=>{let{uri:t,onChange:i,forceEditMode:l,readonly:r,validatedSelection:s,preview:a}=e,[o,n]=H4.useState(!r&&(t===""||l)),C=H4.useCallback(()=>{n(!0)},[]);return o?H4.createElement(G4,{validatedSelection:s,highlight:!0,autoFocus:!0,value:t,onChange:i}):H4.createElement(Ta,null,H4.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&H4.createElement("div",{className:"gdg-edit-icon",onClick:C},H4.createElement(X5,null)),H4.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Pa=GL;function Aa(e,t,i,l){let r=i.cellHorizontalPadding,s=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,o=e.actualBoundingBoxAscent;return l==="right"?r=t.width-a-i.cellHorizontalPadding:l==="center"&&(r=t.width/2-a/2),{x:r,y:s,width:a,height:o}}var Ia={getAccessibilityString:e=>{var t,i;return(i=(t=e.data)==null?void 0:t.toString())!=null?i:""},kind:c1.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:Z4,draw:e=>{var c;let{cell:t,theme:i,overrideCursor:l,hoverX:r,hoverY:s,rect:a,ctx:o}=e,n=(c=t.displayData)!=null?c:t.data,C=t.hoverEffect===!0;if(l!==void 0&&C&&r!==void 0&&s!==void 0){let m=f4(n,o,i.baseFontFull),h=Aa(m,a,i,t.contentAlign),{x:w,y:g,width:L,height:v}=h;if(r>=w-4&&r<=w-4+L+8&&s>=g-4&&s<=g-4+v+8){let V=f0(o,i.baseFontFull);l("pointer");let u=5,d=g-V;o.beginPath(),o.moveTo(a.x+w,Math.floor(a.y+d+v+u)+.5),o.lineTo(a.x+w+L,Math.floor(a.y+d+v+u)+.5),o.strokeStyle=i.linkColor,o.stroke(),o.save(),o.fillStyle=e.cellFillColor,A0(S(B({},e),{rect:S(B({},a),{x:a.x-1})}),n,t.contentAlign),A0(S(B({},e),{rect:S(B({},a),{x:a.x-2})}),n,t.contentAlign),A0(S(B({},e),{rect:S(B({},a),{x:a.x+1})}),n,t.contentAlign),A0(S(B({},e),{rect:S(B({},a),{x:a.x+2})}),n,t.contentAlign),o.restore()}}o.fillStyle=C?i.linkColor:i.textDark,A0(e,n,t.contentAlign)},onClick:e=>{var c;let{cell:t,bounds:i,posX:l,posY:r,theme:s}=e,a=(c=t.displayData)!=null?c:t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return;let o=kt(a,s.baseFontFull);if(o===void 0)return;let n=Aa(o,i,s,t.contentAlign);$4({x:n.x-4,y:n.y-4,width:n.width+8,height:n.height+8},l,r)&&t.onClickUri(e)},measure:(e,t,i)=>{var l;return e.measureText((l=t.displayData)!=null?l:t.data).width+i.cellHorizontalPadding*2},onDelete:e=>S(B({},e),{data:""}),provideEditor:e=>t=>{var a;let{onChange:i,value:l,forceEditMode:r,validatedSelection:s}=t;return Da.createElement(Pa,{forceEditMode:l.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:l.data,preview:(a=l.displayData)!=null?a:l.data,validatedSelection:s,readonly:l.readonly===!0,onChange:o=>i(S(B({},l),{data:o.target.value}))})},onPaste:(e,t,i)=>{var l;return e===t.data?void 0:S(B({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Oa=[Ra,Ba,ga,da,pa,xa,fa,Na,za,ya,Fa,ka,Ia];var Ua=x1(Wa(),1);var C6=[],c6=class extends W9{constructor(){super(...arguments);i2(this,"imageLoaded",()=>{});i2(this,"loadedLocations",[]);i2(this,"cache",{});i2(this,"sendLoaded",(0,Ua.default)(()=>{this.imageLoaded(new E4(this.loadedLocations)),this.loadedLocations=[]},20));i2(this,"clearOutOfWindow",()=>{let i=Object.keys(this.cache);for(let l of i){let r=this.cache[l],s=!1;for(let a=0;a{n||(n=!0,C6.length<12?C6.unshift(o):a||(o.src=""))}},c=new Promise(h=>o.addEventListener("load",()=>h(null)));requestAnimationFrame(async()=>{try{o.src=i,await c,await o.decode();let h=this.cache[s];if(h!==void 0&&!n){h.img=o;for(let w of h.cells)this.loadedLocations.push(e9(w));a=!0,this.sendLoaded()}}catch(h){C.cancel()}}),this.cache[s]=C}loadOrGetImage(i,l,r){let s=i,a=this.cache[s];if(a!==void 0){let o=S0(l,r);return a.cells.includes(o)||a.cells.push(o),a.img}else this.loadImage(i,l,r,s)}},Ga=c6;var jL=(e,t)=>{let i=E5.useMemo(()=>B(B({},Ii),e.headerIcons),[e.headerIcons]),l=E5.useMemo(()=>{var r;return(r=e.imageWindowLoader)!=null?r:new Ga},[e.imageWindowLoader]);return E5.createElement(wa,S(B({},e),{renderers:Oa,headerIcons:i,ref:t,imageWindowLoader:l}))},m6=E5.forwardRef(jL);var j1=x1(F1()),ro=x1(Y6());function qa(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,l=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ka(e){var t=(0,j1.useRef)(null);function i(l){!l||l===t.current||(t.current=l,e(l))}return i}function JL(e){var t=(0,j1.useRef)(e);return(0,j1.useMemo)(function(){function i(r){typeof r=="function"?t.current=r(t.current):t.current=r}function l(){return t.current}return[l,i]},[])}function eV(){var e=(0,j1.useRef)([]);return(0,j1.useMemo)(function(){function t(){return e.current.length>0}function i(){for(var r=m9(e.current),s;!(s=r()).done;){var a=s.value;a()}e.current=[]}function l(r){e.current.push(r)}return{hasEventSubscriptions:t,removeAllEventSubscriptions:i,addEventSubscription:l}},[])}var w6=typeof window!="undefined"?j1.useLayoutEffect:j1.useEffect;function tV(e,t){var i=(0,j1.useRef)(e);return t?(i.current=e,i):(i.current=null,i)}function Q9(e){return parseFloat(e.replace("px",""))}function g6(e,t,i){return ei?i:e}function Xa(e){return e!=null}function ja(){for(var e=arguments.length,t=new Array(e),i=0;i=0})}},{key:"negativeSides",get:function(){var i=this;return Object.fromEntries(V3.filter(function(l){return i[l]<0}).map(function(l){return[l,i[l]]}))}}]),e}();function Ya(){for(var e=arguments.length,t=new Array(e),i=0;iu?u-R:0;L[Z.prop]=g6(R+l+x,V,u),L[Z.opposite.prop]=L[Z.prop]+s.factor(n[h])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=v4.create(L);return l===0&&(this._cachedLayerBounds=N),N},t.getLayerCollisionBounds=function(){var l=this.offsets.container;return this.getLayerBounds().mapSides(function(r,s){return s-=r.factor(l)}).merge(function(r){var s=r.width,a=r.height;return{width:s+l*2,height:a+l*2}})},t.getContainerOffsets=function(l){if(this._cachedContainerOffsets&&!l)return this._cachedContainerOffsets;var r=this.subjectsBounds.merge({layer:l||this.getLayerCollisionBounds()}),s=L6.mergeSmallestSides(r.layerOffsetsToScrollContainers);return l||(this._cachedContainerOffsets=s),s},d3(e,[{key:"type",get:function(){return this.primary.prop+"-"+(this.secondary.prop==="center"?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var l=this.secondary.isHorizontal,r=this.subjectsBounds,s=r.triggerHasBiggerWidth,a=r.triggerHasBiggerHeight;return l&&s||!l&&a}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var l=this.getLayerBounds(),r=this.getContainerOffsets(l),s=r.negativeSides;for(var a in s)s[a]=-s[a];return l.substract(s).surface}},{key:"secondaryOffsetSide",get:function(){var l,r,s=this,a=this.getContainerOffsets(),o=(l=(r=Object.entries(a.negativeSides).map(function(C){var c=C[0],m=C[1];return[v0[c],m]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var m=C[1],h=c[1];return h-m}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),Qa=function(e){YL(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;return i.getLayerBounds=function(){var r=this.subjectsBounds,s=r.trigger,a=r.layer,o=v4.empty();return o.top=s.top+s.height/2-a.height/2,o.bottom=o.top+a.height,o.left=s.left+s.width/2-a.width/2,o.right=o.left+a.width,o.width=o.right-o.left,o.height=o.bottom-o.top,o},t}(oo);function mV(e,t,i){var l=e.layer,r=e.trigger,s=e.arrow,a=t.primary.oppositeSizeProp,o=t.primary.isHorizontal?["top","bottom"]:["left","right"],n=o[0],C=o[1],c=l[n]+l[a]/2-r[n]-s[a]/2-i,m=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(m>0?-m:0)}var Ja={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function wV(e,t,i){var l;if(t.primary.isCenter)return Ja;var r=e.layer,s=e.trigger,a=e.arrow,o=t.primary.oppositeSizeProp,n=s[o]>r[o],C=i+a[o]/2,c=r[o]-a[o]/2-i,m=mV(e,t,i),h=t.primary.prop,w=t.primary.oppositeCssProp,g=n?r[o]/2+m:s[w]+s[o]/2-r[w];return Q0({},Ja,(l={},l[h]="100%",l[w]=g6(g,C,c),l))}var eo=function(){function e(i,l,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=i,this.config=l,this.subjectsBounds=r}e.getSidesFromPlacementType=function(l){var r=l.split("-"),s=r[0],a=r[1],o=v0[s],n;return a==="center"?n=C0.center:o.isHorizontal?n=a==="start"?C0.top:C0.bottom:n=a==="start"?C0.left:C0.right,[o,n]},e.create=function(l,r){var s={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function a(o){o===void 0&&(o=r.placement);var n=e.getSidesFromPlacementType(o),C=n[0],c=n[1],m=v0[C.isHorizontal?r.preferY:r.preferX],h=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function w(L,v){return new oo(L,v,l,r.layerDimensions,s)}var g=[];return g[0]=w(C,c),g[1]=w(C,c.isCenter?m:C0.center),g[2]=w(C,C0[(c.opposite.isCenter?m.opposite:c.opposite).prop]),g[3]=w(m,h?C:C0[C.opposite.prop]),g[4]=w(m,C0.center),g[5]=w(m,h?C0[C.opposite.prop]:C),g[6]=w(v0[m.opposite.prop],h?C:C0[C.opposite.prop]),g[7]=w(v0[m.opposite.prop],C0.center),g[8]=w(v0[m.opposite.prop],h?C0[C.opposite.prop]:C),g[9]=w(v0[C.opposite.prop],c),g[10]=w(v0[C.opposite.prop],c.isCenter?m:C0.center),g[11]=w(v0[C.opposite.prop],C0[(c.opposite.isCenter?m.opposite:c.opposite).prop]),g=g.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),g}return r.placement==="center"?new e([new Qa(C0.center,C0.center,l,r.layerDimensions,s)].concat(a(r.preferY+"-"+r.preferX)),r,l):new e(a(),r,l)};var t=e.prototype;return t.filterPlacementsBySide=function(l){return this.placements.filter(function(r){return r.primary===l})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(l){return l.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){var l=this.placements.map(function(s){return{placement:s,surface:s.visibleSurface}}).sort(function(s,a){return a.surface-s.surface}),r=l[0].placement;return r},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(l){var r=this.config,s=r.auto,a=r.snap;if(!s||a||l instanceof Qa)return 0;var o=this.filterPlacementsBySide(l.primary),n=o.indexOf(l)===0;if(n&&l.fitsContainer)return 0;var C=o.find(function(L){return!L.fitsContainer});if(!C)return 0;var c=C.secondaryOffsetSide;if(!c)return 0;var m=l.getContainerOffsets(),h=l.secondary,w;l.triggerIsBigger||C===l?w=c.isPush?-1:1:w=h===C0.left||[C0.top,C0.center].includes(h)&&c.isPush?-1:1;var g=m[c.prop];return g*w},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=wV(this.subjectsBounds.merge({layer:l}),r,this.config.arrowOffset),C=this.config.overflowContainer?Q0({},o,{position:"fixed",top:l.top,left:l.left}):Q0({},o,{position:"absolute",top:l.top-this.subjectsBounds.parent.top+s.top-a.top,left:l.left-this.subjectsBounds.parent.left+s.left-a.left});return{arrow:n,layer:C}},t.getHasDisappeared=function(l){var r=this.config.overflowContainer?this.subjectsBounds.trigger:l,s=L6.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(r,!0)),a=Object.entries(s.negativeSides),o=a.some(function(n){var C=n[0],c=n[1],m=v0[C];return c<=-r[m.sizeProp]});return o?"full":s.allSidesArePositive?null:"partial"},t.result=function(l,r){var s=this.findSuitablePlacement(),a=this.getSecondaryOffset(s),o=s.getLayerBounds(a),n=this.getStyles(o,s,l,r),C=s.primary.prop;return{styles:n,layerSide:C,placement:s,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),hV=function(){function e(i,l){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=l,Object.assign(this,i)}e.create=function(l,r,s,a,o,n,C,c){var m=v4.fromWindow(l);return new e({layer:v4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?v4.create(H6(c())):v4.fromElement(s),arrow:o?v4.fromElement(o):v4.empty(),parent:a?v4.fromElement(a):m,window:m,scrollContainers:[m].concat(n.map(function(h){return v4.fromElement(h,{withScrollbars:!1})}))},C)};var t=e.prototype;return t.merge=function(l){return new e(Q0({},this,l),this.overflowContainer)},t.offsetsToScrollContainers=function(l,r){r===void 0&&(r=!1);var s=this.overflowContainer&&!r?[this.window]:this.scrollContainers;return s.map(function(a){return a.offsetsTo(l)})},d3(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),to=null;var u4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:oV,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function no(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?u4.overflowContainer:r,a=e.environment,o=a===void 0?typeof window!="undefined"?window:void 0:a,n=e.ResizeObserver,C=e.placement,c=C===void 0?u4.placement:C,m=e.possiblePlacements,h=m===void 0?u4.possiblePlacements:m,w=e.preferX,g=w===void 0?u4.preferX:w,L=e.preferY,v=L===void 0?u4.preferY:L,V=e.auto,u=V===void 0?u4.auto:V,d=e.snap,p=d===void 0?u4.snap:d,Z=e.triggerOffset,R=Z===void 0?u4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?u4.containerOffset:x,E=e.arrowOffset,k=E===void 0?u4.arrowOffset:E,T=e.container,b=T===void 0?u4.container:T,A=e.layerDimensions,z=A===void 0?null:A,_=e.onDisappear,K=e.onOutsideClick,J=e.onParentClose,C1=e.trigger,g1=(0,Y1.useState)(function(){return{layerSide:c==="center"?"center":eo.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),w1=g1[0],$=g1[1],r1=(0,Y1.useRef)(null),a1=tV(w1,l),R1=(0,Y1.useRef)({cancelled:!1});(0,Y1.useEffect)(function(){return function(){R1.current.cancelled=!0}},[]);var Q=(0,Y1.useCallback)(function(c2,J1,s1){var k1=c2.arrow,e2=c2.layer,U1=c2.scrollContainers,b1=c2.trigger,G1=U1[0],q1=hV.create(o,e2,b1,G1,k1,U1,s,C1==null?void 0:C1.getBounds),L2={placement:c,possiblePlacements:h,auto:u,layerDimensions:z,arrowOffset:k,containerOffset:N,triggerOffset:R,preferX:g,preferY:v,snap:p,overflowContainer:s},t1=eo.create(q1,L2).result(J1,s1),L1=t1.hasDisappeared,x1=t1.layerSide,y1=t1.styles,y2={layerSide:x1,styles:y1};if(!a1.current||gV(a1.current,y2)){a1.current=y2,R1.current.cancelled=!0;var B2={cancelled:!1};R1.current=B2,Promise.resolve().then(function(){B2.cancelled||$(y2)})}Xa(L1)&&Xa(_)&&_(L1)},[k,u,N,o,z,_,s,c,h,g,v,p,R,a1,C1]),O1=lV({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:Q,triggerOption:C1}),v1=O1.triggerRef,Q1=O1.layerRef,H1=O1.arrowRef,W1=O1.closestScrollContainer,Z2=aV({isOpen:l,onOutsideClick:K,onParentClose:J}),R2=Z2.closeOnOutsideClickRefs,h2=Z2.registrations,z1={triggerProps:C1?{}:{ref:ja(v1,R2.trigger,r1)},layerProps:{ref:ja(Q1,R2.layer),style:w1.styles.layer},arrowProps:{ref:H1,style:w1.styles.arrow,layerSide:w1.layerSide},layerSide:w1.layerSide,triggerBounds:l?C1?C1.getBounds():(t=r1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(c2){return typeof document!="undefined"?(0,ro.createPortal)((0,Y1.createElement)(rV,{registrations:h2,children:c2}),s||!W1?HV(b):W1):null}};return z1}function gV(e,t){if(e.layerSide!==t.layerSide)return!0;for(var i=["position","top","left","right","bottom"],l=0,r=i;l=0})}},{key:"negativeSides",get:function(){var i=this;return Object.fromEntries(V3.filter(function(l){return i[l]<0}).map(function(l){return[l,i[l]]}))}}]),e}();function Ya(){for(var e=arguments.length,t=new Array(e),i=0;iu?u-R:0;L[Z.prop]=g6(R+l+x,V,u),L[Z.opposite.prop]=L[Z.prop]+s.factor(n[h])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=V4.create(L);return l===0&&(this._cachedLayerBounds=N),N},t.getLayerCollisionBounds=function(){var l=this.offsets.container;return this.getLayerBounds().mapSides(function(r,s){return s-=r.factor(l)}).merge(function(r){var s=r.width,a=r.height;return{width:s+l*2,height:a+l*2}})},t.getContainerOffsets=function(l){if(this._cachedContainerOffsets&&!l)return this._cachedContainerOffsets;var r=this.subjectsBounds.merge({layer:l||this.getLayerCollisionBounds()}),s=L6.mergeSmallestSides(r.layerOffsetsToScrollContainers);return l||(this._cachedContainerOffsets=s),s},d3(e,[{key:"type",get:function(){return this.primary.prop+"-"+(this.secondary.prop==="center"?"center":["bottom","right"].includes(this.secondary.prop)?"end":"start")}},{key:"triggerIsBigger",get:function(){var l=this.secondary.isHorizontal,r=this.subjectsBounds,s=r.triggerHasBiggerWidth,a=r.triggerHasBiggerHeight;return l&&s||!l&&a}},{key:"fitsContainer",get:function(){return this.getContainerOffsets().allSidesArePositive}},{key:"visibleSurface",get:function(){var l=this.getLayerBounds(),r=this.getContainerOffsets(l),s=r.negativeSides;for(var a in s)s[a]=-s[a];return l.substract(s).surface}},{key:"secondaryOffsetSide",get:function(){var l,r,s=this,a=this.getContainerOffsets(),o=(l=(r=Object.entries(a.negativeSides).map(function(C){var c=C[0],m=C[1];return[v0[c],m]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var m=C[1],h=c[1];return h-m}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),Qa=function(e){YL(t,e);function t(){return e.apply(this,arguments)||this}var i=t.prototype;return i.getLayerBounds=function(){var r=this.subjectsBounds,s=r.trigger,a=r.layer,o=V4.empty();return o.top=s.top+s.height/2-a.height/2,o.bottom=o.top+a.height,o.left=s.left+s.width/2-a.width/2,o.right=o.left+a.width,o.width=o.right-o.left,o.height=o.bottom-o.top,o},t}(oo);function mV(e,t,i){var l=e.layer,r=e.trigger,s=e.arrow,a=t.primary.oppositeSizeProp,o=t.primary.isHorizontal?["top","bottom"]:["left","right"],n=o[0],C=o[1],c=l[n]+l[a]/2-r[n]-s[a]/2-i,m=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(m>0?-m:0)}var Ja={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function wV(e,t,i){var l;if(t.primary.isCenter)return Ja;var r=e.layer,s=e.trigger,a=e.arrow,o=t.primary.oppositeSizeProp,n=s[o]>r[o],C=i+a[o]/2,c=r[o]-a[o]/2-i,m=mV(e,t,i),h=t.primary.prop,w=t.primary.oppositeCssProp,g=n?r[o]/2+m:s[w]+s[o]/2-r[w];return X0({},Ja,(l={},l[h]="100%",l[w]=g6(g,C,c),l))}var eo=function(){function e(i,l,r){this.placements=void 0,this.config=void 0,this.subjectsBounds=void 0,this.placements=i,this.config=l,this.subjectsBounds=r}e.getSidesFromPlacementType=function(l){var r=l.split("-"),s=r[0],a=r[1],o=v0[s],n;return a==="center"?n=o0.center:o.isHorizontal?n=a==="start"?o0.top:o0.bottom:n=a==="start"?o0.left:o0.right,[o,n]},e.create=function(l,r){var s={arrow:r.arrowOffset,container:r.containerOffset,trigger:r.triggerOffset};function a(o){o===void 0&&(o=r.placement);var n=e.getSidesFromPlacementType(o),C=n[0],c=n[1],m=v0[C.isHorizontal?r.preferY:r.preferX],h=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function w(L,v){return new oo(L,v,l,r.layerDimensions,s)}var g=[];return g[0]=w(C,c),g[1]=w(C,c.isCenter?m:o0.center),g[2]=w(C,o0[(c.opposite.isCenter?m.opposite:c.opposite).prop]),g[3]=w(m,h?C:o0[C.opposite.prop]),g[4]=w(m,o0.center),g[5]=w(m,h?o0[C.opposite.prop]:C),g[6]=w(v0[m.opposite.prop],h?C:o0[C.opposite.prop]),g[7]=w(v0[m.opposite.prop],o0.center),g[8]=w(v0[m.opposite.prop],h?o0[C.opposite.prop]:C),g[9]=w(v0[C.opposite.prop],c),g[10]=w(v0[C.opposite.prop],c.isCenter?m:o0.center),g[11]=w(v0[C.opposite.prop],o0[(c.opposite.isCenter?m.opposite:c.opposite).prop]),g=g.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),g}return r.placement==="center"?new e([new Qa(o0.center,o0.center,l,r.layerDimensions,s)].concat(a(r.preferY+"-"+r.preferX)),r,l):new e(a(),r,l)};var t=e.prototype;return t.filterPlacementsBySide=function(l){return this.placements.filter(function(r){return r.primary===l})},t.findFirstPlacementThatFits=function(){return this.placements.find(function(l){return l.fitsContainer})},t.placementWithBiggestVisibleSurface=function(){var l=this.placements.map(function(s){return{placement:s,surface:s.visibleSurface}}).sort(function(s,a){return a.surface-s.surface}),r=l[0].placement;return r},t.findSuitablePlacement=function(){return this.config.auto?this.findFirstPlacementThatFits()||this.placementWithBiggestVisibleSurface():this.placements[0]},t.getSecondaryOffset=function(l){var r=this.config,s=r.auto,a=r.snap;if(!s||a||l instanceof Qa)return 0;var o=this.filterPlacementsBySide(l.primary),n=o.indexOf(l)===0;if(n&&l.fitsContainer)return 0;var C=o.find(function(L){return!L.fitsContainer});if(!C)return 0;var c=C.secondaryOffsetSide;if(!c)return 0;var m=l.getContainerOffsets(),h=l.secondary,w;l.triggerIsBigger||C===l?w=c.isPush?-1:1:w=h===o0.left||[o0.top,o0.center].includes(h)&&c.isPush?-1:1;var g=m[c.prop];return g*w},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=wV(this.subjectsBounds.merge({layer:l}),r,this.config.arrowOffset),C=this.config.overflowContainer?X0({},o,{position:"fixed",top:l.top,left:l.left}):X0({},o,{position:"absolute",top:l.top-this.subjectsBounds.parent.top+s.top-a.top,left:l.left-this.subjectsBounds.parent.left+s.left-a.left});return{arrow:n,layer:C}},t.getHasDisappeared=function(l){var r=this.config.overflowContainer?this.subjectsBounds.trigger:l,s=L6.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(r,!0)),a=Object.entries(s.negativeSides),o=a.some(function(n){var C=n[0],c=n[1],m=v0[C];return c<=-r[m.sizeProp]});return o?"full":s.allSidesArePositive?null:"partial"},t.result=function(l,r){var s=this.findSuitablePlacement(),a=this.getSecondaryOffset(s),o=s.getLayerBounds(a),n=this.getStyles(o,s,l,r),C=s.primary.prop;return{styles:n,layerSide:C,placement:s,layerBounds:o,hasDisappeared:this.getHasDisappeared(o)}},e}(),hV=function(){function e(i,l){this.overflowContainer=void 0,this.trigger=void 0,this.layer=void 0,this.arrow=void 0,this.parent=void 0,this.window=void 0,this.scrollContainers=void 0,this.overflowContainer=l,Object.assign(this,i)}e.create=function(l,r,s,a,o,n,C,c){var m=V4.fromWindow(l);return new e({layer:V4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?V4.create(H6(c())):V4.fromElement(s),arrow:o?V4.fromElement(o):V4.empty(),parent:a?V4.fromElement(a):m,window:m,scrollContainers:[m].concat(n.map(function(h){return V4.fromElement(h,{withScrollbars:!1})}))},C)};var t=e.prototype;return t.merge=function(l){return new e(X0({},this,l),this.overflowContainer)},t.offsetsToScrollContainers=function(l,r){r===void 0&&(r=!1);var s=this.overflowContainer&&!r?[this.window]:this.scrollContainers;return s.map(function(a){return a.offsetsTo(l)})},d3(e,[{key:"layerOffsetsToScrollContainers",get:function(){return this.offsetsToScrollContainers(this.layer)}},{key:"triggerHasBiggerWidth",get:function(){return this.trigger.width>this.layer.width}},{key:"triggerHasBiggerHeight",get:function(){return this.trigger.height>this.layer.height}}]),e}(),to=null;var L4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:oV,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function no(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?L4.overflowContainer:r,a=e.environment,o=a===void 0?typeof window!="undefined"?window:void 0:a,n=e.ResizeObserver,C=e.placement,c=C===void 0?L4.placement:C,m=e.possiblePlacements,h=m===void 0?L4.possiblePlacements:m,w=e.preferX,g=w===void 0?L4.preferX:w,L=e.preferY,v=L===void 0?L4.preferY:L,V=e.auto,u=V===void 0?L4.auto:V,d=e.snap,p=d===void 0?L4.snap:d,Z=e.triggerOffset,R=Z===void 0?L4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?L4.containerOffset:x,E=e.arrowOffset,b=E===void 0?L4.arrowOffset:E,A=e.container,k=A===void 0?L4.container:A,P=e.layerDimensions,z=P===void 0?null:P,_=e.onDisappear,j=e.onOutsideClick,a1=e.onParentClose,m1=e.trigger,g1=(0,j1.useState)(function(){return{layerSide:c==="center"?"center":eo.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),h1=g1[0],K=g1[1],s1=(0,j1.useRef)(null),n1=tV(h1,l),N1=(0,j1.useRef)({cancelled:!1});(0,j1.useEffect)(function(){return function(){N1.current.cancelled=!0}},[]);var e1=(0,j1.useCallback)(function(c2,Y1,o1){var S1=c2.arrow,Q1=c2.layer,U1=c2.scrollContainers,y1=c2.trigger,G1=U1[0],O1=hV.create(o,Q1,y1,G1,S1,U1,s,m1==null?void 0:m1.getBounds),m2={placement:c,possiblePlacements:h,auto:u,layerDimensions:z,arrowOffset:b,containerOffset:N,triggerOffset:R,preferX:g,preferY:v,snap:p,overflowContainer:s},t1=eo.create(O1,m2).result(Y1,o1),U=t1.hasDisappeared,l1=t1.layerSide,Y=t1.styles,f1={layerSide:l1,styles:Y};if(!n1.current||gV(n1.current,f1)){n1.current=f1,N1.current.cancelled=!0;var p1={cancelled:!1};N1.current=p1,Promise.resolve().then(function(){p1.cancelled||K(f1)})}Xa(U)&&Xa(_)&&_(U)},[b,u,N,o,z,_,s,c,h,g,v,p,R,n1,m1]),A1=lV({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:e1,triggerOption:m1}),u1=A1.triggerRef,K1=A1.layerRef,H1=A1.arrowRef,W1=A1.closestScrollContainer,Z2=aV({isOpen:l,onOutsideClick:j,onParentClose:a1}),B2=Z2.closeOnOutsideClickRefs,V2=Z2.registrations,B1={triggerProps:m1?{}:{ref:ja(u1,B2.trigger,s1)},layerProps:{ref:ja(K1,B2.layer),style:h1.styles.layer},arrowProps:{ref:H1,style:h1.styles.arrow,layerSide:h1.layerSide},layerSide:h1.layerSide,triggerBounds:l?m1?m1.getBounds():(t=s1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(c2){return typeof document!="undefined"?(0,ro.createPortal)((0,j1.createElement)(rV,{registrations:V2,children:c2}),s||!W1?HV(k):W1):null}};return B1}function gV(e,t){if(e.layerSide!==t.layerSide)return!0;for(var i=["position","top","left","right","bottom"],l=0,r=i;l{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"}))};var co=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))};var mo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))};var wo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))};var ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M13 12H16L12 16L8 12H11V8H13V12ZM15 4H5V20H19V8H15V4ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"}))};var go=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"}))};var Ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M11 2C15.968 2 20 6.032 20 11C20 15.968 15.968 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2ZM11 18C14.8675 18 18 14.8675 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18ZM19.4853 18.0711L22.3137 20.8995L20.8995 22.3137L18.0711 19.4853L19.4853 18.0711Z"}))};var Lo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M19 3L23 8H20V20H18V8H15L19 3ZM14 18V20H3V18H14ZM14 11V13H3V11H14ZM12 4V6H3V4H12Z"}))},Vo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return m0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),m0.default.createElement("path",{d:"M20 4V16H23L19 21L15 16H18V4H20ZM12 18V20H3V18H12ZM14 11V13H3V11H14ZM14 4V6H3V4H14Z"}))};var uo=M1(S1());function e7(i){var l=i,{children:e}=l,t=s0(l,["children"]);return uo.default.createElement("div",S(B({},t),{className:"flex cursor-pointer items-center justify-start gap-1 p-1 text-sm text-gray-700 hover:bg-gray-100"}),e)}function d6({layerProps:e,selectAllCurrent:t,hasSorting:i,orderBy:l}){return U0.default.createElement("div",B({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),U0.default.createElement("button",{className:"mb-1.5 flex w-full justify-center rounded-lg border border-gray-200 bg-gray-100 px-3 py-1.5 text-sm font-medium leading-none text-gray-700 hover:bg-gray-200",onClick:t},"Select this column"),i&&U0.default.createElement(U0.default.Fragment,null,U0.default.createElement(e7,{onClick:()=>l("asc")},U0.default.createElement(Lo,{size:14}),U0.default.createElement("span",null,"Sort: ascending")),U0.default.createElement(e7,{onClick:()=>l("desc")},U0.default.createElement(Vo,{size:14}),U0.default.createElement("span",null,"Sort: descending")),U0.default.createElement(e7,{onClick:()=>l("none")},U0.default.createElement(Co,{size:14}),U0.default.createElement("span",null,"Sort: none"))))}var b4=M1(S1());function u6({page:e,maxPage:t,onPrev:i,onNext:l,rows:r}){return b4.default.createElement("div",{className:"flex gap-3"},b4.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:i,disabled:e===1},b4.default.createElement(mo,{size:16}),b4.default.createElement("span",null,"Prev")),b4.default.createElement("div",{className:"rounded-lg border border-gray-400 px-2 py-1 text-xs font-semibold text-gray-500"},b4.default.createElement("span",null,e," of ",t||"?")),b4.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:l,disabled:e===t||r===0},b4.default.createElement("span",null,"Next"),b4.default.createElement(wo,{size:16})))}var p4=M1(S1());var vo=[10,20,50,100];function v6({limit:e,totalRows:t,onChange:i}){return p4.default.createElement("div",null,p4.default.createElement("form",null,p4.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),p4.default.createElement("div",{class:"relative inline-block"},p4.default.createElement("select",{className:"appearance-none rounded-lg border border-gray-400 bg-white px-2 py-1 pr-7 text-xs font-medium text-gray-500 focus:outline-none",value:e,onChange:l=>i(parseInt(l.target.value))},!vo.includes(e)&&p4.default.createElement("option",{key:e,value:e.toString()},e),vo.map(l=>p4.default.createElement("option",{key:l,value:l.toString()},l)),t?p4.default.createElement("option",{value:t},"All"):null),p4.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},p4.default.createElement(co,{size:16})))))}var v3=M1(S1());var po=M1(S1());function B5(i){var l=i,{children:e}=l,t=s0(l,["children"]);return po.default.createElement("button",S(B({},t),{className:"align-center flex cursor-pointer items-center rounded-full p-1 leading-none text-gray-500 hover:text-gray-900 focus:bg-gray-100 focus:outline-none disabled:cursor-default disabled:text-gray-300"}),e)}function p6({toggleSearch:e}){return v3.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},v3.default.createElement(B5,{"aria-label":"search",onClick:e},v3.default.createElement(Ho,{size:16})))}var M6=M1(S1());function x6({onRefetch:e}){return M6.default.createElement(B5,{"aria-label":"refresh",onClick:e},M6.default.createElement(go,null))}var F4=M1(S1());function f6({supportedFormats:e,onDownload:t}){let i=(0,F4.useRef)();return F4.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},F4.default.createElement(B5,{onClick:l=>i.current.click()},F4.default.createElement("div",{className:"relative"},F4.default.createElement(ho,{size:18}),F4.default.createElement("select",{className:"absolute inset-0 cursor-pointer opacity-0",ref:i,value:"",onChange:l=>t(l.target.value)},F4.default.createElement("option",{disabled:!0,value:""},"Export to"),e.map(l=>F4.default.createElement("option",{key:l},l))))))}var LV={arrowUp:({fgColor:e,bgColor:t})=>` + `,document.body.appendChild(t))}return t}var lo;(function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"})(lo||(lo={}));var u3=x1(F1());function V6({data:e,totalRows:t}){return u3.default.createElement("div",{className:"flex items-baseline"},u3.default.createElement("h2",{className:"text-md font-semibold leading-none text-gray-800"},e.name),u3.default.createElement("span",{className:"ml-2.5 text-xs leading-none"},t||"?"," ",t===1?"entry":"entries"),t{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"}))};var co=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))};var mo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"}))};var wo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"}))};var ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M13 12H16L12 16L8 12H11V8H13V12ZM15 4H5V20H19V8H15V4ZM3 2.9918C3 2.44405 3.44749 2 3.9985 2H16L20.9997 7L21 20.9925C21 21.5489 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5447 3 21.0082V2.9918Z"}))};var go=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"}))};var Ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M11 2C15.968 2 20 6.032 20 11C20 15.968 15.968 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2ZM11 18C14.8675 18 18 14.8675 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18ZM19.4853 18.0711L22.3137 20.8995L20.8995 22.3137L18.0711 19.4853L19.4853 18.0711Z"}))};var Lo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M19 3L23 8H20V20H18V8H15L19 3ZM14 18V20H3V18H14ZM14 11V13H3V11H14ZM12 4V6H3V4H12Z"}))},Vo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=i0(s,["color","size","className"]);return c0.default.createElement("svg",S(B({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),c0.default.createElement("path",{d:"M20 4V16H23L19 21L15 16H18V4H20ZM12 18V20H3V18H12ZM14 11V13H3V11H14ZM14 4V6H3V4H14Z"}))};var uo=x1(F1());function J9(i){var l=i,{children:e}=l,t=i0(l,["children"]);return uo.default.createElement("div",S(B({},t),{className:"flex cursor-pointer items-center justify-start gap-1 p-1 text-sm text-gray-700 hover:bg-gray-100"}),e)}function d6({layerProps:e,selectAllCurrent:t,hasSorting:i,orderBy:l}){return _0.default.createElement("div",B({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),_0.default.createElement("button",{className:"mb-1.5 flex w-full justify-center rounded-lg border border-gray-200 bg-gray-100 px-3 py-1.5 text-sm font-medium leading-none text-gray-700 hover:bg-gray-200",onClick:t},"Select this column"),i&&_0.default.createElement(_0.default.Fragment,null,_0.default.createElement(J9,{onClick:()=>l("asc")},_0.default.createElement(Lo,{size:14}),_0.default.createElement("span",null,"Sort: ascending")),_0.default.createElement(J9,{onClick:()=>l("desc")},_0.default.createElement(Vo,{size:14}),_0.default.createElement("span",null,"Sort: descending")),_0.default.createElement(J9,{onClick:()=>l("none")},_0.default.createElement(Co,{size:14}),_0.default.createElement("span",null,"Sort: none"))))}var R4=x1(F1());function u6({page:e,maxPage:t,onPrev:i,onNext:l,rows:r}){return R4.default.createElement("div",{className:"flex gap-3"},R4.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:i,disabled:e===1},R4.default.createElement(mo,{size:16}),R4.default.createElement("span",null,"Prev")),R4.default.createElement("div",{className:"rounded-lg border border-gray-400 px-2 py-1 text-xs font-semibold text-gray-500"},R4.default.createElement("span",null,e," of ",t||"?")),R4.default.createElement("button",{className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-800 focus:outline-none disabled:pointer-events-none disabled:text-gray-300",onClick:l,disabled:e===t||r===0},R4.default.createElement("span",null,"Next"),R4.default.createElement(wo,{size:16})))}var d4=x1(F1());var vo=[10,20,50,100];function v6({limit:e,totalRows:t,onChange:i}){return d4.default.createElement("div",null,d4.default.createElement("form",null,d4.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),d4.default.createElement("div",{class:"relative inline-block"},d4.default.createElement("select",{className:"appearance-none rounded-lg border border-gray-400 bg-white px-2 py-1 pr-7 text-xs font-medium text-gray-500 focus:outline-none",value:e,onChange:l=>i(parseInt(l.target.value))},!vo.includes(e)&&d4.default.createElement("option",{key:e,value:e.toString()},e),vo.map(l=>d4.default.createElement("option",{key:l,value:l.toString()},l)),t?d4.default.createElement("option",{value:t},"All"):null),d4.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},d4.default.createElement(co,{size:16})))))}var v3=x1(F1());var po=x1(F1());function N5(i){var l=i,{children:e}=l,t=i0(l,["children"]);return po.default.createElement("button",S(B({},t),{className:"align-center flex cursor-pointer items-center rounded-full p-1 leading-none text-gray-500 hover:text-gray-900 focus:bg-gray-100 focus:outline-none disabled:cursor-default disabled:text-gray-300"}),e)}function p6({toggleSearch:e}){return v3.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},v3.default.createElement(N5,{"aria-label":"search",onClick:e},v3.default.createElement(Ho,{size:16})))}var M6=x1(F1());function x6({onRefetch:e}){return M6.default.createElement(N5,{"aria-label":"refresh",onClick:e},M6.default.createElement(go,null))}var B4=x1(F1());function f6({supportedFormats:e,onDownload:t}){let i=(0,B4.useRef)();return B4.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},B4.default.createElement(N5,{onClick:l=>i.current.click()},B4.default.createElement("div",{className:"relative"},B4.default.createElement(ho,{size:18}),B4.default.createElement("select",{className:"absolute inset-0 cursor-pointer opacity-0",ref:i,value:"",onChange:l=>t(l.target.value)},B4.default.createElement("option",{disabled:!0,value:""},"Export to"),e.map(l=>B4.default.createElement("option",{key:l},l))))))}var LV={arrowUp:({fgColor:e,bgColor:t})=>` `,arrowDown:({fgColor:e,bgColor:t})=>` @@ -193,7 +193,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 19H8V21H7C5.34315 21 4 19.6569 4 18ZM20 14.3V18C20 19.6569 18.6569 21 17 21H16V19H17C17.5523 19 18 18.5523 18 18V13.9C18 13.0142 18.5759 12.2628 19.3738 12C18.5759 11.7372 18 10.9858 18 10.1V6C18 5.44772 17.5523 5 17 5H16V3H17C18.6569 3 20 4.34315 20 6V9.7C20 10.5284 20.6716 11.2 21.5 11.2H22V12.8H21.5C20.6716 12.8 20 13.4716 20 - 14.3Z">`},VV={text:n5.HeaderString,number:n5.HeaderNumber,uri:n5.HeaderUri,date:n5.HeaderDate,list:n5.HeaderArray,struct:"curlyBraces"},dV={text:n1.Text,number:n1.Number,uri:n1.Uri,date:n1.Text,list:n1.Text,struct:n1.Text},Mo={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function xo({ctx:e,data:t}){var y1,y2,B2;let i=[],l=[],r=i1=>i1.map(h1=>{let f1=h1.summary,T1=h1.label,z2=h1.key;return l.push({[T1]:250}),f1&&i.push(f1.keys.length),{title:T1,id:z2,type:h1.type,icon:VV[h1.type]||n5.HeaderString,hasMenu:h1.type!=="list",summary:f1}}),s=r(t.content.columns),a=t.features.includes("refetch"),o=t.features.includes("export"),n=t.content.columns.length!==0,C=i.length>0,c=t.features.includes("sorting"),m=t.features.includes("relocate"),h=o?(y1=t.export)==null?void 0:y1.formats:null,w=o&&h,g={rows:x2.empty(),columns:x2.empty()},[L,v]=(0,w2.useState)(t.content),[V,u]=(0,w2.useState)(!1),[d,p]=(0,w2.useState)(s),[Z,R]=(0,w2.useState)(l),[x,N]=(0,w2.useState)(null),[E,k]=(0,w2.useState)(!1),[T,b]=(0,w2.useState)(g),[A,z]=(0,w2.useState)(0),[_,K]=(0,w2.useState)(null),J=L.total_rows,C1=n&&J>0,g1=t.features.includes("pagination")&&(J===null||J>0),w1=L.limit===J,$=44,r1=C&&C1?Math.max(...i):0,a1=$+r1*22,R1=c?140:70,Q=440+a1,v1=J&&J<(c?3:2)&&x?R1+a1:null,Q1=J>=10&&w1?Q:v1,H1=(L.page-1)*L.limit+1,W1=C?150:50,Z2=1200,R2=t.content.columns.length===1?800:350,h2=L.page_length,z1=(0,w2.useCallback)((i1,c1)=>{let{ctx:h1,theme:f1,rect:T1,column:z2,menuBounds:_2,isHovered:e0,isSelected:t0,spriteManager:w0}=i1;if(z2.sourceIndex===0)return!0;h1.rect(T1.x,T1.y,T1.width,T1.height);let k2=10,G0=19,X1=t0?f1.textHeaderSelected:f1.textHeader,g2=t0?f1.accentLight:f1.textDark,d2=z2.hasMenu===!0&&e0,T2=L.columns[z2.sourceIndex-1].summary,b2=!!T2,F2=35,f0=T1.width-F2,o4=T1.width-F2*.7,k0=f0/T1.width,T0=o4/T1.width,Z1=h1.createLinearGradient(T1.x,0,T1.x+T1.width,0),P2=z0(X1,0),n2=M0(h1,`${f1.headerFontStyle} ${f1.fontFamily}`);if(Z1.addColorStop(0,X1),Z1.addColorStop(k0,X1),Z1.addColorStop(T0,P2),Z1.addColorStop(1,P2),h1.fillStyle=d2?Z1:X1,z2.icon){let E2=t0?"selected":z2.style==="highlight"?"special":"normal",t2=f1.headerIconSize;w0.drawSprite(z2.icon,E2,h1,T1.x+k2,T1.y+k2,t2,f1),z2.overlayIcon&&w0.drawSprite(z2.overlayIcon,t0?"selected":"special",h1,T1.x+k2+G0/2,T1.y+k2+G0/2,G0,f1)}if(h1.fillText(z2.title,_2.x-T1.width+f1.headerIconSize*2.5+14,b2?T1.y+k2+f1.headerIconSize/2+n2:_2.y+_2.height/2+n2),b2){let E2=Object.fromEntries(T2.keys.map((P0,M4)=>[P0,T2.values[M4]])),t2=13,h0=t2+k2,n4=`${t2}px ${f1.fontFamily}`,C4=`bold ${n4}`;h1.fillStyle=g2,Object.entries(E2).forEach(([P0,M4],Y4)=>{h1.font=C4,h1.fillText(`${P0}:`,T1.x+h0/2,T1.y+h0*(Y4+1)+h0),h1.font=n4,h1.fillText(M4,T1.x+h1.measureText(P0).width+h0,T1.y+h0*(Y4+1)+h0)})}if(d2){h1.fillStyle=Z1;let E2=_2.x+_2.width/2-k2*1.5,t2=f1.headerIconSize/2-2,h0=new Path2D("M12 16l-6-6h12z");h1.translate(E2,t2),h1.fill(h0)}},[L]),o2=(0,w2.useCallback)(([i1,c1])=>{let h1=dV[L.columns[i1].type]||n1.Text,T1=L.data_orientation==="columns"?L.data[i1][c1]:L.data[c1][i1];return{kind:h1,data:T1,displayData:T1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),c2=()=>{u(!V)},J1=i1=>{let c1=i1!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:c1,direction:i1!=null?i1:"asc"}),N(null)},s1=()=>{e.pushEvent("show_page",{page:L.page-1}),b(S(B({},g),{columns:T.columns}))},k1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(S(B({},g),{columns:T.columns}))},e2=()=>{let i1=S(B({},g),{columns:x2.fromSingleSelection(x.column)});b(i1),N(null)},{layerProps:U1,renderLayer:b1}=no({isOpen:E,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var i1,c1,h1,f1,T1,z2,_2,e0;return{left:(i1=x==null?void 0:x.bounds.x)!=null?i1:0,top:(c1=x==null?void 0:x.bounds.y)!=null?c1:0,width:(h1=x==null?void 0:x.bounds.width)!=null?h1:0,height:(f1=x==null?void 0:x.bounds.height)!=null?f1:0,right:((T1=x==null?void 0:x.bounds.x)!=null?T1:0)+((z2=x==null?void 0:x.bounds.width)!=null?z2:0),bottom:((_2=x==null?void 0:x.bounds.y)!=null?_2:0)+((e0=x==null?void 0:x.bounds.height)!=null?e0:0)}}}}),G1=(0,w2.useCallback)((i1,c1)=>{R(h1=>S(B({},h1),{[i1.title]:c1}))},[]),q1=(0,w2.useCallback)((i1,c1)=>{e.pushEvent("relocate",{from_index:i1,to_index:c1}),N(null),b(g)},[]),L2=(0,w2.useCallback)((i1,c1)=>{let{summary:h1,id:f1,type:T1}=d[i1];h1||N({column:i1,bounds:c1,columnKey:f1,columnType:T1})},[d]),t1=(0,w2.useCallback)((i1,{bounds:c1})=>{let{id:h1,type:f1}=d[i1];N({column:i1,bounds:c1,columnKey:h1,columnType:f1})},[d]),L1=(0,w2.useCallback)(i1=>{let[c1,h1]=i1.location;h1===-1&&c1===-1&&i1.kind==="header"?K([...Array.from({length:h2},(f1,T1)=>T1)]):c1===-1&&i1.kind==="cell"?K([h1]):K(null)},[h2]),x1=(0,w2.useCallback)(i1=>_!=null&&_.includes(i1)?{bgCell:Mo.bgHeaderHovered}:null,[_]);return(0,w2.useEffect)(()=>{var i1;((i1=T.rows)==null?void 0:i1.items.length)>0?z(1):z(0)},[T]),(0,w2.useEffect)(()=>{e.handleEvent("update_content",i1=>{let c1=r(i1.columns);p(c1),v(i1)}),e.handleEvent("download_content",([i1,c1])=>{let h1=new Blob([c1],{type:i1.type}),f1=document.createElement("a");f1.href=window.URL.createObjectURL(h1),f1.download=`${i1.filename}-${+new Date}${i1.format}`,f1.click()})},[]),(0,w2.useEffect)(()=>{var h1;let i1=((h1=L.order)==null?void 0:h1.direction)==="asc"?"arrowUp":"arrowDown",c1=d.map(f1=>{var T1;return S(B({},f1),{overlayIcon:f1.id===((T1=L.order)==null?void 0:T1.key)?i1:null})});p(c1)},[(y2=L.order)==null?void 0:y2.direction,(B2=L.order)==null?void 0:B2.key]),(0,w2.useEffect)(()=>{let i1=d.map(c1=>S(B({},c1),{width:Z[c1.title]}));p(i1)},[Z]),(0,w2.useEffect)(()=>{let i1=x==null?void 0:x.columnKey,c1={bgHeader:"#F0F5F9"},h1=d.map(f1=>S(B({},f1),{themeOverride:f1.id===i1?c1:null}));p(h1),k(!!x)},[x]),w2.default.createElement("div",{className:"p-3 font-sans"},w2.default.createElement("div",{className:"mb-6 flex items-center gap-3"},w2.default.createElement(V6,{data:t,totalRows:J}),w&&w2.default.createElement(f6,{supportedFormats:h,onDownload:i1=>e.pushEvent("download",{format:i1})}),w2.default.createElement("div",{className:"grow"}),a&&w2.default.createElement(x6,{onRefetch:()=>e.pushEvent("refetch")}),w2.default.createElement(p6,{toggleSearch:c2}),w2.default.createElement(v6,{limit:L.limit,totalRows:J,onChange:i1=>e.pushEvent("limit",{limit:i1})}),g1&&w2.default.createElement(u6,{page:L.page,maxPage:L.max_page,onPrev:s1,onNext:k1,rows:h2})),n&&w2.default.createElement(m6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:Mo,getCellContent:o2,columns:d,rows:h2,width:"100%",height:Q1,rowHeight:44,headerHeight:a1,drawHeader:z1,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:L2,onHeaderClicked:t1,showSearch:V,getCellsForSelection:!0,onSearchClose:c2,headerIcons:LV,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:G1,columnSelect:"none",gridSelection:T,onGridSelectionChange:i1=>b(i1),rowMarkerStartIndex:H1,minColumnWidth:W1,maxColumnWidth:Z2,maxColumnAutoWidth:R2,fillHandle:!0,onItemHovered:L1,getRowThemeOverride:x1,onColumnMoved:m?q1:void 0}),E&&b1(w2.default.createElement(d6,{layerProps:U1,menu:x,orderBy:J1,selectAllCurrent:e2,hasSorting:c})),!n&&w2.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),w2.default.createElement("div",{id:"portal"}))}async function cE(e,t){await e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("main.css"),(0,Zo.createRoot)(e.root).render(fo.default.createElement(xo,{ctx:e,data:t}))}export{cE as init}; + 14.3Z">`},VV={text:a5.HeaderString,number:a5.HeaderNumber,uri:a5.HeaderUri,date:a5.HeaderDate,list:a5.HeaderArray,struct:"curlyBraces"},dV={text:c1.Text,number:c1.Number,uri:c1.Uri,date:c1.Text,list:c1.Text,struct:c1.Text},Mo={fontFamily:"JetBrains Mono",bgHeader:"white",textDark:"#61758a",textHeader:"#304254",headerFontStyle:"bold 14px",baseFontStyle:"14px",borderColor:"#E1E8F0",horizontalBorderColor:"#E1E8F0",accentColor:"#3E64FF",accentLight:"#ECF0FF",bgHeaderHovered:"#F0F5F9",bgHeaderHasFocus:"#E1E8F0",bgSearchResult:"#FFF7EC",headerIconSize:22};function xo({ctx:e,data:t}){var O1,m2,t1;let i=[],l=[],r=U=>U.map(Y=>{let f1=Y.summary,p1=Y.label,I1=Y.key;return l.push({[p1]:250}),f1&&i.push(f1.keys.length),{title:p1,id:I1,type:Y.type,icon:VV[Y.type]||a5.HeaderString,hasMenu:Y.type!=="list",summary:f1}}),s=r(t.content.columns),a=t.features.includes("refetch"),o=t.features.includes("export"),n=t.content.columns.length!==0,C=i.length>0,c=t.features.includes("sorting"),m=t.features.includes("relocate"),h=o?(O1=t.export)==null?void 0:O1.formats:null,w=o&&h,g={rows:M2.empty(),columns:M2.empty()},[L,v]=(0,g2.useState)(t.content),[V,u]=(0,g2.useState)(!1),[d,p]=(0,g2.useState)(s),[Z,R]=(0,g2.useState)(l),[x,N]=(0,g2.useState)(null),[E,b]=(0,g2.useState)(g),[A,k]=(0,g2.useState)(0),[P,z]=(0,g2.useState)(null),_=L.total_rows,j=n&&_>0,a1=t.features.includes("pagination")&&(_===null||_>0),m1=L.limit===_,g1=44,h1=C&&j?Math.max(...i):0,K=g1+h1*22,s1=440+K,n1=_>=10&&m1?s1:null,N1=(L.page-1)*L.limit+1,e1=C?150:50,A1=1200,u1=t.content.columns.length===1?800:350,K1=L.page_length,H1=(0,g2.useCallback)((U,l1)=>{let{ctx:Y,theme:f1,rect:p1,column:I1,menuBounds:z1,isHovered:f2,isSelected:N2,spriteManager:p0}=U;if(I1.sourceIndex===0)return!0;Y.rect(p1.x,p1.y,p1.width,p1.height);let Y2=10,l0=19,Q2=N2?f1.textHeaderSelected:f1.textHeader,m0=N2?f1.accentLight:f1.textDark,w0=I1.hasMenu===!0&&f2,j2=L.columns[I1.sourceIndex-1].summary,j0=!!j2,s2=35,w2=p1.width-s2,d2=p1.width-s2*.7,O2=w2/p1.width,b2=d2/p1.width,E2=Y.createLinearGradient(p1.x,0,p1.x+p1.width,0),M0=y0(Q2,0),Y0=f0(Y,`${f1.headerFontStyle} ${f1.fontFamily}`);if(E2.addColorStop(0,Q2),E2.addColorStop(O2,Q2),E2.addColorStop(b2,M0),E2.addColorStop(1,M0),Y.fillStyle=w0?E2:Q2,I1.icon){let h0=N2?"selected":I1.style==="highlight"?"special":"normal",n0=f1.headerIconSize;p0.drawSprite(I1.icon,h0,Y,p1.x+Y2,p1.y+Y2,n0,f1),I1.overlayIcon&&p0.drawSprite(I1.overlayIcon,N2?"selected":"special",Y,p1.x+Y2+l0/2,p1.y+Y2+l0/2,l0,f1)}if(Y.fillText(I1.title,z1.x-p1.width+f1.headerIconSize*2.5+14,j0?p1.y+Y2+f1.headerIconSize/2+Y0:z1.y+z1.height/2+Y0),j0){let h0=Object.fromEntries(j2.keys.map((z2,n2)=>[z2,j2.values[n2]])),n0=13,M1=n0+Y2,F2=`${n0}px ${f1.fontFamily}`,o2=`bold ${F2}`;Y.fillStyle=m0,Object.entries(h0).forEach(([z2,n2],Q0)=>{Y.font=o2,Y.fillText(`${z2}:`,p1.x+M1/2,p1.y+M1*(Q0+1)+M1),Y.font=F2,Y.fillText(n2,p1.x+Y.measureText(z2).width+M1,p1.y+M1*(Q0+1)+M1)})}if(w0){Y.fillStyle=E2;let h0=z1.x+z1.width/2-Y2*1.5,n0=f1.headerIconSize/2-2,M1=new Path2D("M12 16l-6-6h12z");Y.translate(h0,n0),Y.fill(M1)}},[L]),W1=(0,g2.useCallback)(([U,l1])=>{let Y=dV[L.columns[U].type]||c1.Text,p1=L.data_orientation==="columns"?L.data[U][l1]:L.data[l1][U];return{kind:Y,data:p1,displayData:p1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),Z2=()=>{u(!V)},B2=U=>{let l1=U!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:l1,direction:U!=null?U:"asc"}),N(null)},V2=()=>{e.pushEvent("show_page",{page:L.page-1}),b(S(B({},g),{columns:E.columns}))},B1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(S(B({},g),{columns:E.columns}))},r2=()=>{let U=S(B({},g),{columns:M2.fromSingleSelection(x.column)});b(U),N(null)},{layerProps:c2,renderLayer:Y1}=no({isOpen:!!x,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var U,l1,Y,f1,p1,I1,z1,f2;return{left:(U=x==null?void 0:x.bounds.x)!=null?U:0,top:(l1=x==null?void 0:x.bounds.y)!=null?l1:0,width:(Y=x==null?void 0:x.bounds.width)!=null?Y:0,height:(f1=x==null?void 0:x.bounds.height)!=null?f1:0,right:((p1=x==null?void 0:x.bounds.x)!=null?p1:0)+((I1=x==null?void 0:x.bounds.width)!=null?I1:0),bottom:((z1=x==null?void 0:x.bounds.y)!=null?z1:0)+((f2=x==null?void 0:x.bounds.height)!=null?f2:0)}}}}),o1=(0,g2.useCallback)((U,l1)=>{R(Y=>S(B({},Y),{[U.title]:l1}))},[]),S1=(0,g2.useCallback)((U,l1)=>{e.pushEvent("relocate",{from_index:U,to_index:l1}),N(null),b(g)},[]),Q1=(0,g2.useCallback)((U,l1)=>{let{summary:Y,id:f1,type:p1}=d[U];Y||N({column:U,bounds:l1,columnKey:f1,columnType:p1})},[d]),U1=(0,g2.useCallback)((U,{bounds:l1})=>{let{id:Y,type:f1}=d[U];N({column:U,bounds:l1,columnKey:Y,columnType:f1})},[d]),y1=(0,g2.useCallback)(U=>{let[l1,Y]=U.location;Y===-1&&l1===-1&&U.kind==="header"?z([...Array.from({length:K1},(f1,p1)=>p1)]):l1===-1&&U.kind==="cell"?z([Y]):z(null)},[K1]),G1=(0,g2.useCallback)(U=>P!=null&&P.includes(U)?{bgCell:Mo.bgHeaderHovered}:null,[P]);return(0,g2.useEffect)(()=>{var U;((U=E.rows)==null?void 0:U.items.length)>0?k(1):k(0)},[E]),(0,g2.useEffect)(()=>{e.handleEvent("update_content",U=>{let l1=r(U.columns);p(l1),v(U)}),e.handleEvent("download_content",([U,l1])=>{let Y=new Blob([l1],{type:U.type}),f1=document.createElement("a");f1.href=window.URL.createObjectURL(Y),f1.download=`${U.filename}-${+new Date}${U.format}`,f1.click()})},[]),(0,g2.useEffect)(()=>{var Y;let U=((Y=L.order)==null?void 0:Y.direction)==="asc"?"arrowUp":"arrowDown",l1=d.map(f1=>{var p1;return S(B({},f1),{overlayIcon:f1.id===((p1=L.order)==null?void 0:p1.key)?U:null})});p(l1)},[(m2=L.order)==null?void 0:m2.direction,(t1=L.order)==null?void 0:t1.key]),(0,g2.useEffect)(()=>{let U=d.map(l1=>S(B({},l1),{width:Z[l1.title]}));p(U)},[Z]),(0,g2.useEffect)(()=>{let U=x==null?void 0:x.columnKey,l1={bgHeader:"#F0F5F9"},Y=d.map(f1=>S(B({},f1),{themeOverride:f1.id===U?l1:null}));p(Y)},[x]),g2.default.createElement("div",{className:"p-3 font-sans",style:x?{minHeight:260}:{}},g2.default.createElement("div",{className:"mb-6 flex items-center gap-3"},g2.default.createElement(V6,{data:t,totalRows:_}),w&&g2.default.createElement(f6,{supportedFormats:h,onDownload:U=>e.pushEvent("download",{format:U})}),g2.default.createElement("div",{className:"grow"}),a&&g2.default.createElement(x6,{onRefetch:()=>e.pushEvent("refetch")}),g2.default.createElement(p6,{toggleSearch:Z2}),g2.default.createElement(v6,{limit:L.limit,totalRows:_,onChange:U=>e.pushEvent("limit",{limit:U})}),a1&&g2.default.createElement(u6,{page:L.page,maxPage:L.max_page,onPrev:V2,onNext:B1,rows:K1})),n&&g2.default.createElement(m6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:Mo,getCellContent:W1,columns:d,rows:K1,width:"100%",height:n1,rowHeight:44,headerHeight:K,drawHeader:H1,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:Q1,onHeaderClicked:U1,showSearch:V,getCellsForSelection:!0,onSearchClose:Z2,headerIcons:LV,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:o1,columnSelect:"none",gridSelection:E,onGridSelectionChange:U=>b(U),rowMarkerStartIndex:N1,minColumnWidth:e1,maxColumnWidth:A1,maxColumnAutoWidth:u1,fillHandle:!0,onItemHovered:y1,getRowThemeOverride:G1,onColumnMoved:m?S1:void 0}),x&&Y1(g2.default.createElement(d6,{layerProps:c2,menu:x,orderBy:B2,selectAllCurrent:r2,hasSorting:c})),!n&&g2.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),g2.default.createElement("div",{id:"portal"}))}async function cE(e,t){await e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("main.css"),(0,Zo.createRoot)(e.root).render(fo.default.createElement(xo,{ctx:e,data:t}))}export{cE as init}; /*! Bundled license information: classnames/index.js: