From 743586b2e1ff2ed00b097ef7677d791cfb7e521a Mon Sep 17 00:00:00 2001 From: Cristine Guadelupe Date: Thu, 2 May 2024 20:56:32 +0800 Subject: [PATCH] Extracting components (#423) --- assets/data_table/src/App.js | 183 ++-------------------- assets/data_table/src/DataInfo.js | 15 ++ assets/data_table/src/DownloadExported.js | 30 ++++ assets/data_table/src/HeaderMenu.js | 40 +++++ assets/data_table/src/HeaderMenuItem.js | 12 ++ assets/data_table/src/IconButton.js | 12 ++ assets/data_table/src/LimitSelect.js | 28 ++++ assets/data_table/src/Pagination.js | 30 ++++ assets/data_table/src/RefetchButton.js | 11 ++ assets/data_table/src/SearchButton.js | 13 ++ lib/assets/data_table/build/main.js | 110 ++++++------- 11 files changed, 255 insertions(+), 229 deletions(-) create mode 100644 assets/data_table/src/DataInfo.js create mode 100644 assets/data_table/src/DownloadExported.js create mode 100644 assets/data_table/src/HeaderMenu.js create mode 100644 assets/data_table/src/HeaderMenuItem.js create mode 100644 assets/data_table/src/IconButton.js create mode 100644 assets/data_table/src/LimitSelect.js create mode 100644 assets/data_table/src/Pagination.js create mode 100644 assets/data_table/src/RefetchButton.js create mode 100644 assets/data_table/src/SearchButton.js diff --git a/assets/data_table/src/App.js b/assets/data_table/src/App.js index 6df76fac..b963dcad 100644 --- a/assets/data_table/src/App.js +++ b/assets/data_table/src/App.js @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useRef, useState } from "react"; +import React, { useCallback, useEffect, useState } from "react"; import DataEditor, { GridCellKind, GridColumnIcon, @@ -6,18 +6,14 @@ import DataEditor, { withAlpha, getMiddleCenterBias, } from "@glideapps/glide-data-grid"; -import { - RiRefreshLine, - RiArrowLeftSLine, - RiArrowRightSLine, - RiSearch2Line, - RiSortAsc, - RiSortDesc, - RiAlignJustify, - RiFileDownloadLine, - RiArrowDownSLine, -} from "@remixicon/react"; import { useLayer } from "react-laag"; +import DataInfo from "./DataInfo"; +import HeaderMenu from "./HeaderMenu"; +import Pagination from "./Pagination"; +import LimitSelect from "./LimitSelect"; +import SearchButton from "./SearchButton"; +import RefetchButton from "./RefetchButton"; +import DownloadExported from "./DownloadExported"; const customHeaderIcons = { arrowUp: ({ @@ -460,15 +456,7 @@ export function App({ ctx, data }) { return (
-
-

- {data.name} -

- - {totalRows || "?"} {totalRows === 1 ? "entry" : "entries"} - - {totalRows < data.content.total_rows} -
+ {showDownload && ( ); } - -function DownloadExported({ supportedFormats, onDownload }) { - const selectRef = useRef(); - - return ( - - selectRef.current.click()}> -
- - -
-
-
- ); -} - -function RefetchButton({ onRefetch }) { - return ( - - - - ); -} - -function SearchButton({ toggleSearch }) { - return ( - - - - - - ); -} - -function IconButton({ children, ...props }) { - return ( - - ); -} - -function LimitSelect({ limit, totalRows, onChange }) { - return ( -
-
- -
- -
- -
-
-
-
- ); -} - -function Pagination({ page, maxPage, onPrev, onNext, rows }) { - return ( -
- -
- - {page} of {maxPage || "?"} - -
- -
- ); -} - -function HeaderMenu({ layerProps, selectAllCurrent, hasSorting, orderBy }) { - return ( -
- - {hasSorting && ( - <> - orderBy("asc")}> - - Sort: ascending - - orderBy("desc")}> - - Sort: descending - - orderBy("none")}> - - Sort: none - - - )} -
- ); -} - -function HeaderMenuItem({ children, ...props }) { - return ( -
- {children} -
- ); -} diff --git a/assets/data_table/src/DataInfo.js b/assets/data_table/src/DataInfo.js new file mode 100644 index 00000000..79871d8e --- /dev/null +++ b/assets/data_table/src/DataInfo.js @@ -0,0 +1,15 @@ +import React from "react"; + +export default function DataInfo({ data, totalRows }) { + return ( +
+

+ {data.name} +

+ + {totalRows || "?"} {totalRows === 1 ? "entry" : "entries"} + + {totalRows < data.content.total_rows} +
+ ); +} diff --git a/assets/data_table/src/DownloadExported.js b/assets/data_table/src/DownloadExported.js new file mode 100644 index 00000000..c5a0f700 --- /dev/null +++ b/assets/data_table/src/DownloadExported.js @@ -0,0 +1,30 @@ +import React, { useRef } from "react"; +import { RiFileDownloadLine } from "@remixicon/react"; +import IconButton from "./IconButton"; + +export default function DownloadExported({ supportedFormats, onDownload }) { + const selectRef = useRef(); + + return ( + + selectRef.current.click()}> +
+ + +
+
+
+ ); +} diff --git a/assets/data_table/src/HeaderMenu.js b/assets/data_table/src/HeaderMenu.js new file mode 100644 index 00000000..35618e83 --- /dev/null +++ b/assets/data_table/src/HeaderMenu.js @@ -0,0 +1,40 @@ +import React from "react"; +import { RiSortAsc, RiSortDesc, RiAlignJustify } from "@remixicon/react"; +import HeaderMenuItem from "./HeaderMenuItem"; + +export default function HeaderMenu({ + layerProps, + selectAllCurrent, + hasSorting, + orderBy, +}) { + return ( +
+ + {hasSorting && ( + <> + orderBy("asc")}> + + Sort: ascending + + orderBy("desc")}> + + Sort: descending + + orderBy("none")}> + + Sort: none + + + )} +
+ ); +} diff --git a/assets/data_table/src/HeaderMenuItem.js b/assets/data_table/src/HeaderMenuItem.js new file mode 100644 index 00000000..467cd615 --- /dev/null +++ b/assets/data_table/src/HeaderMenuItem.js @@ -0,0 +1,12 @@ +import React from "react"; + +export default function HeaderMenuItem({ children, ...props }) { + return ( +
+ {children} +
+ ); +} diff --git a/assets/data_table/src/IconButton.js b/assets/data_table/src/IconButton.js new file mode 100644 index 00000000..d789a2fa --- /dev/null +++ b/assets/data_table/src/IconButton.js @@ -0,0 +1,12 @@ +import React from "react"; + +export default function IconButton({ children, ...props }) { + return ( + + ); +} diff --git a/assets/data_table/src/LimitSelect.js b/assets/data_table/src/LimitSelect.js new file mode 100644 index 00000000..fc39f8ad --- /dev/null +++ b/assets/data_table/src/LimitSelect.js @@ -0,0 +1,28 @@ +import React from "react"; +import { RiArrowDownSLine } from "@remixicon/react"; + +export default function LimitSelect({ limit, totalRows, onChange }) { + return ( +
+
+ +
+ +
+ +
+
+
+
+ ); +} diff --git a/assets/data_table/src/Pagination.js b/assets/data_table/src/Pagination.js new file mode 100644 index 00000000..a6c0f8a0 --- /dev/null +++ b/assets/data_table/src/Pagination.js @@ -0,0 +1,30 @@ +import React from "react"; +import { RiArrowLeftSLine, RiArrowRightSLine } from "@remixicon/react"; + +export default function Pagination({ page, maxPage, onPrev, onNext, rows }) { + return ( +
+ +
+ + {page} of {maxPage || "?"} + +
+ +
+ ); +} diff --git a/assets/data_table/src/RefetchButton.js b/assets/data_table/src/RefetchButton.js new file mode 100644 index 00000000..1ed53cc4 --- /dev/null +++ b/assets/data_table/src/RefetchButton.js @@ -0,0 +1,11 @@ +import React from "react"; +import { RiRefreshLine } from "@remixicon/react"; +import IconButton from "./IconButton"; + +export default function RefetchButton({ onRefetch }) { + return ( + + + + ); +} diff --git a/assets/data_table/src/SearchButton.js b/assets/data_table/src/SearchButton.js new file mode 100644 index 00000000..16d3c6af --- /dev/null +++ b/assets/data_table/src/SearchButton.js @@ -0,0 +1,13 @@ +import React from "react"; +import { RiSearch2Line } from "@remixicon/react"; +import IconButton from "./IconButton"; + +export default function SearchButton({ toggleSearch }) { + return ( + + + + + + ); +} diff --git a/lib/assets/data_table/build/main.js b/lib/assets/data_table/build/main.js index fcf5391c..d353d7c3 100644 --- a/lib/assets/data_table/build/main.js +++ b/lib/assets/data_table/build/main.js @@ -1,7 +1,7 @@ -import{A as Ao,B as O5,C as _5,D as c1,E as a5,F as k3,G as x9,H as T3,I as W5,J as F4,K as o5,L as X6,M as f9,N as l4,O as x2,P as z0,Q as P3,R as y0,S as j6,T as C7,U as Y6,V as r4,W as Q6,a as P6,b as d0,c as l5,d as D6,e as r5,f as I5,g as So,h as s5,i as A6,j as I6,k as O6,l as ko,m as _6,n as p9,o as To,p as Po,q as M9,r as W6,s as F3,t as q6,u as $6,v as Do,w as U6,x as G6,y as K6,z as S3}from"./chunk-7E2MHSGD.js";import{a as y,b as P,c as o0,d as U,e as F1,f as c2,g as Y1,h as X2}from"./chunk-2HCNYJTW.js";var ee=U(D3=>{"use strict";var J6=P6();D3.createRoot=J6.createRoot,D3.hydrateRoot=J6.hydrateRoot;var hV});var le=U((LV,ie)=>{"use strict";var Io="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";ie.exports=Io});var oe=U((VV,ae)=>{"use strict";var Oo=le();function re(){}function se(){}se.resetWarningCache=re;ae.exports=function(){function e(l,r,s,a,o,n){if(n!==Oo){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:se,resetWarningCache:re};return i.PropTypes=i,i}});var Ce=U((vV,ne)=>{ne.exports=oe()();var dV,uV});var ce=U(c7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","react","prop-types"],t);else if(typeof c7!="undefined")t(c7,Y1(),Ce());else{var i={exports:{}};t(i.exports,e.react,e.propTypes),e.reactSwipe=i.exports}})(c7,function(e,t,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=m;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 g?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){h(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,S=p.onSwipeUp,k=p.onSwipeDown,b=p.onSwipeLeft,D=p.onSwipeRight,B=p.onSwipeStart,_=p.onSwipeMove,K=p.onSwipeEnd,Q=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 A3=U(m7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","./react-swipe"],t);else if(typeof m7!="undefined")t(m7,ce());else{var i={exports:{}};t(i.exports,e.reactSwipe),e.index=i.exports}})(m7,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 me=U((xV,h7)=>{(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function i(){for(var l=[],r=0;r{"use strict";Object.defineProperty(w7,"__esModule",{value:!0});w7.default=void 0;var W4=_o(me());function _o(e){return e&&e.__esModule?e:{default:e}}function Wo(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var qo={ROOT:function(t){return(0,W4.default)(Wo({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,W4.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,i){return(0,W4.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(t,i){return(0,W4.default)({thumbs:!t,slider:t,animated:!i})},ITEM:function(t,i,l){return(0,W4.default)({thumb:!t,slide:t,selected:i,previous:l})},ARROW_PREV:function(t){return(0,W4.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,W4.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,W4.default)({dot:!0,selected:t})}};w7.default=qo});var he=U(g7=>{"use strict";Object.defineProperty(g7,"__esModule",{value:!0});g7.outerWidth=void 0;var $o=function(t){var i=t.offsetWidth,l=getComputedStyle(t);return i+=parseInt(l.marginLeft)+parseInt(l.marginRight),i};g7.outerWidth=$o});var L7=U(H7=>{"use strict";Object.defineProperty(H7,"__esModule",{value:!0});H7.default=void 0;var Uo=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};H7.default=Uo});var O3=U(V7=>{"use strict";Object.defineProperty(V7,"__esModule",{value:!0});V7.default=void 0;var Go=function(){return window};V7.default=Go});var $3=U(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;var g4=jo(Y1()),n5=v7(I3()),Ko=he(),we=v7(L7()),Xo=v7(A3()),d7=v7(O3());function v7(e){return e&&e.__esModule?e:{default:e}}function He(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return He=function(){return e},e}function jo(e){if(e&&e.__esModule)return e;if(e===null||Z9(e)!=="object"&&typeof e!="function")return{default:e};var t=He();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 _3(){return _3=Object.assign||function(e){for(var t=1;t0&&(a=0),C===h&&a<0&&(a=0);var g=r.itemsWrapperRef.clientWidth,m=C+100/(g/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(w){r.itemsListRef.style[w]=(0,we.default)(m,"%",r.props.axis)}),!0}),R0(b0(r),"slideRight",function(s){r.moveTo(r.state.firstItem-(typeof s=="number"?s:1))}),R0(b0(r),"slideLeft",function(s){r.moveTo(r.state.firstItem+(typeof s=="number"?s:1))}),R0(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 Qo(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,d7.default)().addEventListener("resize",this.updateSizes),(0,d7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,d7.default)().removeEventListener("resize",this.updateSizes),(0,d7.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(M7,"__esModule",{value:!0});M7.default=void 0;var sn=function(){return document};M7.default=sn});var U3=U(s4=>{"use strict";Object.defineProperty(s4,"__esModule",{value:!0});s4.setPosition=s4.getPosition=s4.isKeyboardEvent=s4.defaultStatusFormatter=s4.noop=void 0;var an=Y1(),on=nn(L7());function nn(e){return e&&e.__esModule?e:{default:e}}var Cn=function(){};s4.noop=Cn;var cn=function(t,i){return"".concat(t," of ").concat(i)};s4.defaultStatusFormatter=cn;var mn=function(t){return t?t.hasOwnProperty("key"):!1};s4.isKeyboardEvent=mn;var hn=function(t,i){if(i.infiniteLoop&&++t,t===0)return 0;var l=an.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=hn;var wn=function(t,i){var l={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){l[r]=(0,on.default)(t,"%",i)}),l};s4.setPosition=wn});var ue=U(f4=>{"use strict";Object.defineProperty(f4,"__esModule",{value:!0});f4.fadeAnimationHandler=f4.slideStopSwipingHandler=f4.slideSwipeAnimationHandler=f4.slideAnimationHandler=void 0;var de=Y1(),gn=Hn(L7()),x4=U3();function Hn(e){return e&&e.__esModule?e:{default:e}}function Ve(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,x4.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):l.itemListStyle=(0,x4.setPosition)(-(a+2)*100,t.axis):s>a&&(l.itemListStyle=(0,x4.setPosition)(0,t.axis)),l;var n=(0,x4.getPosition)(r,t),C=(0,gn.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};f4.slideAnimationHandler=Vn;var dn=function(t,i,l,r){var s={},a=i.axis==="horizontal",o=de.Children.count(i.children),n=0,C=(0,x4.getPosition)(l.selectedItem,i),c=i.infiniteLoop?(0,x4.getPosition)(o-1,i)-100:(0,x4.getPosition)(o-1,i),h=a?t.x:t.y,g=h;C===n&&h>0&&(g=0),C===c&&h<0&&(g=0);var m=C+100/(l.itemSize/g),w=Math.abs(h)>i.swipeScrollTolerance;return i.infiniteLoop&&w&&(l.selectedItem===0&&m>-100?m-=o*100:l.selectedItem===o-1&&m<-o*100&&(m+=o*100)),(!i.preventMovementUntilSwipeScrollTolerance||w||l.swipeMovementStarted)&&(l.swipeMovementStarted||r({swipeMovementStarted:!0}),s.itemListStyle=(0,x4.setPosition)(m,i.axis)),w&&!l.cancelClick&&r({cancelClick:!0}),s};f4.slideSwipeAnimationHandler=dn;var un=function(t,i){var l=(0,x4.getPosition)(i.selectedItem,t),r=(0,x4.setPosition)(l,t.axis);return{itemListStyle:r}};f4.slideStopSwipingHandler=un;var vn=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)}};f4.fadeAnimationHandler=vn});var xe=U(N7=>{"use strict";Object.defineProperty(N7,"__esModule",{value:!0});N7.default=void 0;var B2=xn(Y1()),pn=R9(A3()),S4=R9(I3()),Mn=R9($3()),x7=R9(Le()),f7=R9(O3()),E9=U3(),Z7=ue();function R9(e){return e&&e.__esModule?e:{default:e}}function Me(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Me=function(){return e},e}function xn(e){if(e&&e.__esModule)return e;if(e===null||N9(e)!=="object"&&typeof e!="function")return{default:e};var t=Me();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 N9(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N9=function(i){return typeof i}:N9=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},N9(e)}function G3(){return G3=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))}),h2(g2(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))}),h2(g2(r),"moveTo",function(a){if(typeof a=="number"){var o=B2.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()}}),h2(g2(r),"onClickNext",function(){r.increment(1)}),h2(g2(r),"onClickPrev",function(){r.decrement(1)}),h2(g2(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),h2(g2(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),h2(g2(r),"changeItem",function(a){return function(o){(!(0,E9.isKeyboardEvent)(o)||o.key==="Enter")&&r.moveTo(a)}}),h2(g2(r),"selectItem",function(a){r.setState(H4({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,B2.Children.toArray(r.props.children)[a.selectedItem])}),h2(g2(r),"getInitialImage",function(){var a=r.props.selectedItem,o=r.itemsRef&&r.itemsRef[a],n=o&&o.getElementsByTagName("img")||[];return n[0]}),h2(g2(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 m(){r.forceUpdate(),C.removeEventListener("load",m)};C.addEventListener("load",c)}}var h=n[0]||o.children[0],g=h.clientHeight;return g>0?g: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"&&Z7.fadeAnimationHandler||Z7.slideAnimationHandler,r.state=H4(H4({},s),r.animationHandler(l,s)),r}return Zn(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(H4({},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&&B2.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,f7.default)().addEventListener("resize",this.updateSizes),(0,f7.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,x7.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,f7.default)().removeEventListener("resize",this.updateSizes),(0,f7.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,x7.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?B2.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=H4(H4({},c),{},{minWidth:s.props.centerSlidePercentage+"%"})),s.state.swiping&&s.state.swipeMovementStarted&&(c=H4(H4({},c),{},{pointerEvents:"none"}));var h={ref:function(m){return s.setItemsRef(m,o)},key:"itemKey"+o+(r?"clone":""),className:S4.default.ITEM(!0,o===s.state.selectedItem,o===s.state.previousItem),onClick:s.handleClickItem.bind(s,o,a),style:c};return B2.default.createElement("li",h,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?B2.default.createElement("ul",{className:"control-dots"},B2.Children.map(C,function(c,h){return n&&n(r.changeItem(h),h===r.state.selectedItem,h,o.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?B2.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,B2.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||B2.Children.count(this.props.children)===0?null:B2.default.createElement(Mn.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||B2.Children.count(this.props.children)===0)return null;var s=this.props.swipeable&&B2.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",o=this.props.showArrows&&B2.Children.count(this.props.children)>1,n=o&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,C=o&&(this.state.selectedItem{"use strict"});var Ee=U(B9=>{"use strict";Object.defineProperty(B9,"__esModule",{value:!0});Object.defineProperty(B9,"Carousel",{enumerable:!0,get:function(){return zn.default}});Object.defineProperty(B9,"CarouselProps",{enumerable:!0,get:function(){return yn.CarouselProps}});Object.defineProperty(B9,"Thumbs",{enumerable:!0,get:function(){return bn.default}});var zn=Ze(xe()),yn=fe(),bn=Ze($3());function Ze(e){return e&&e.__esModule?e:{default:e}}});var Re=U((TV,Ne)=>{var Fn=s5(),Sn=function(){return Fn.Date.now()};Ne.exports=Sn});var ze=U((PV,Be)=>{var kn=/\s/;function Tn(e){for(var t=e.length;t--&&kn.test(e.charAt(t)););return t}Be.exports=Tn});var be=U((DV,ye)=>{var Pn=ze(),Dn=/^\s+/;function An(e){return e&&e.slice(0,Pn(e)+1).replace(Dn,"")}ye.exports=An});var R7=U((AV,ke)=>{var In=be(),Fe=p9(),On=ko(),Se=NaN,_n=/^[-+]0x[0-9a-f]+$/i,Wn=/^0b[01]+$/i,qn=/^0o[0-7]+$/i,$n=parseInt;function Un(e){if(typeof e=="number")return e;if(On(e))return Se;if(Fe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Fe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=In(e);var i=Wn.test(e);return i||qn.test(e)?$n(e.slice(2),i?2:8):_n.test(e)?Se:+e}ke.exports=Un});var B7=U((IV,Pe)=>{var Gn=p9(),j3=Re(),Te=R7(),Kn="Expected a function",Xn=Math.max,jn=Math.min;function Yn(e,t,i){var l,r,s,a,o,n,C=0,c=!1,h=!1,g=!0;if(typeof e!="function")throw new TypeError(Kn);t=Te(t)||0,Gn(i)&&(c=!!i.leading,h="maxWait"in i,s=h?Xn(Te(i.maxWait)||0,t):s,g="trailing"in i?!!i.trailing:g);function m(R){var x=l,N=r;return l=r=void 0,C=R,a=e.apply(N,x),a}function w(R){return C=R,o=setTimeout(V,t),c?m(R):a}function L(R){var x=R-n,N=R-C,E=t-x;return h?jn(E,s-N):E}function v(R){var x=R-n,N=R-C;return n===void 0||x>=t||x<0||h&&N>=s}function V(){var R=j3();if(v(R))return u(R);o=setTimeout(V,L(R))}function u(R){return o=void 0,g&&l?m(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(j3())}function Z(){var R=j3(),x=v(R);if(l=arguments,r=this,n=R,x){if(o===void 0)return w(n);if(h)return clearTimeout(o),o=setTimeout(V,t),m(n)}return o===void 0&&(o=setTimeout(V,t)),a}return Z.cancel=d,Z.flush=p,Z}Pe.exports=Yn});var Et=U((Ed,Zt)=>{function RC(e,t,i){return e===e&&(i!==void 0&&(e=e<=i?e:i),t!==void 0&&(e=e>=t?e:t)),e}Zt.exports=RC});var A9=U((Nd,Nt)=>{var BC=Et(),s8=R7();function zC(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=s8(i),i=i===i?i:0),t!==void 0&&(t=s8(t),t=t===t?t:0),BC(s8(e),t,i)}Nt.exports=zC});var Bt=U((Rd,Rt)=>{var yC="__lodash_hash_undefined__";function bC(e){return this.__data__.set(e,yC),this}Rt.exports=bC});var yt=U((Bd,zt)=>{function FC(e){return this.__data__.has(e)}zt.exports=FC});var a8=U((zd,bt)=>{var SC=$6(),kC=Bt(),TC=yt();function U7(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new SC;++t{function PC(e,t,i,l){for(var r=e.length,s=i+(l?1:-1);l?s--:++s{function DC(e){return e!==e}kt.exports=DC});var Dt=U((Fd,Pt)=>{function AC(e,t,i){for(var l=i-1,r=e.length;++l{var IC=St(),OC=Tt(),_C=Dt();function WC(e,t,i){return t===t?_C(e,t,i):IC(e,OC,i)}At.exports=WC});var _t=U((kd,Ot)=>{var qC=It();function $C(e,t){var i=e==null?0:e.length;return!!i&&qC(e,t,0)>-1}Ot.exports=$C});var qt=U((Td,Wt)=>{function UC(e,t,i){for(var l=-1,r=e==null?0:e.length;++l{function GC(e,t){return e.has(t)}$t.exports=GC});var n8=U((Dd,Ut)=>{var KC=M9(),XC=s5(),jC=KC(XC,"Set");Ut.exports=jC});var Kt=U((Ad,Gt)=>{function YC(){}Gt.exports=YC});var G7=U((Id,Xt)=>{function QC(e){var t=-1,i=Array(e.size);return e.forEach(function(l){i[++t]=l}),i}Xt.exports=QC});var Yt=U((Od,jt)=>{var C8=n8(),JC=Kt(),ec=G7(),tc=1/0,ic=C8&&1/ec(new C8([,-0]))[1]==tc?function(e){return new C8(e)}:JC;jt.exports=ic});var Jt=U((_d,Qt)=>{var lc=a8(),rc=_t(),sc=qt(),ac=o8(),oc=Yt(),nc=G7(),Cc=200;function cc(e,t,i){var l=-1,r=rc,s=e.length,a=!0,o=[],n=o;if(i)a=!1,r=sc;else if(s>=Cc){var C=t?null:oc(e);if(C)return nc(C);a=!1,r=ac,n=new lc}else n=t?[]:o;e:for(;++l{var mc=Jt();function hc(e){return e&&e.length?mc(e):[]}ei.exports=hc});var c8=U((qd,ii)=>{function wc(e,t){for(var i=-1,l=t.length,r=e.length;++i{var li=A6(),gc=U6(),Hc=I5(),ri=li?li.isConcatSpreadable:void 0;function Lc(e){return Hc(e)||gc(e)||!!(ri&&e&&e[ri])}si.exports=Lc});var Ci=U((Ud,ni)=>{var Vc=c8(),dc=ai();function oi(e,t,i,l,r){var s=-1,a=e.length;for(i||(i=dc),r||(r=[]);++s0&&i(o)?t>1?oi(o,t-1,i,l,r):Vc(r,o):l||(r[r.length]=o)}return r}ni.exports=oi});var mi=U((Gd,ci)=>{var uc=Ci();function vc(e){var t=e==null?0:e.length;return t?uc(e,1):[]}ci.exports=vc});var wi=U((Kd,hi)=>{var pc=Math.ceil,Mc=Math.max;function xc(e,t,i,l){for(var r=-1,s=Mc(pc((t-e)/(i||1)),0),a=Array(s);s--;)a[l?s:++r]=e,e+=i;return a}hi.exports=xc});var K7=U((Xd,gi)=>{var fc=To(),Zc=K6();function Ec(e){return e!=null&&Zc(e.length)&&!fc(e)}gi.exports=Ec});var Li=U((jd,Hi)=>{var Nc=W6(),Rc=K7(),Bc=G6(),zc=p9();function yc(e,t,i){if(!zc(i))return!1;var l=typeof t;return(l=="number"?Rc(i)&&Bc(t,i.length):l=="string"&&t in i)?Nc(i[t],e):!1}Hi.exports=yc});var ui=U((Yd,di)=>{var bc=R7(),Vi=1/0,Fc=17976931348623157e292;function Sc(e){if(!e)return e===0?e:0;if(e=bc(e),e===Vi||e===-Vi){var t=e<0?-1:1;return t*Fc}return e===e?e:0}di.exports=Sc});var pi=U((Qd,vi)=>{var kc=wi(),Tc=Li(),m8=ui();function Pc(e){return function(t,i,l){return l&&typeof l!="number"&&Tc(t,i,l)&&(i=l=void 0),t=m8(t),i===void 0?(i=t,t=0):i=m8(i),l=l===void 0?t{var Dc=pi(),Ac=Dc();Mi.exports=Ac});var bi=U((zu,yi)=>{var dm=M9(),um=function(){try{var e=dm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();yi.exports=um});var ki=U((yu,Si)=>{var Fi=bi();function vm(e,t,i){t=="__proto__"&&Fi?Fi(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}Si.exports=vm});var Pi=U((bu,Ti)=>{function pm(e,t,i,l){for(var r=-1,s=e==null?0:e.length;++r{function Mm(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}}Di.exports=Mm});var Oi=U((Su,Ii)=>{var xm=Ai(),fm=xm();Ii.exports=fm});var Wi=U((ku,_i)=>{function Zm(e,t){for(var i=-1,l=Array(e);++i{function Em(){return!1}qi.exports=Em});var p8=U((_9,Q5)=>{var Nm=s5(),Rm=$i(),Ki=typeof _9=="object"&&_9&&!_9.nodeType&&_9,Ui=Ki&&typeof Q5=="object"&&Q5&&!Q5.nodeType&&Q5,Bm=Ui&&Ui.exports===Ki,Gi=Bm?Nm.Buffer:void 0,zm=Gi?Gi.isBuffer:void 0,ym=zm||Rm;Q5.exports=ym});var ji=U((Pu,Xi)=>{var bm=I6(),Fm=K6(),Sm=O6(),km="[object Arguments]",Tm="[object Array]",Pm="[object Boolean]",Dm="[object Date]",Am="[object Error]",Im="[object Function]",Om="[object Map]",_m="[object Number]",Wm="[object Object]",qm="[object RegExp]",$m="[object Set]",Um="[object String]",Gm="[object WeakMap]",Km="[object ArrayBuffer]",Xm="[object DataView]",jm="[object Float32Array]",Ym="[object Float64Array]",Qm="[object Int8Array]",Jm="[object Int16Array]",eh="[object Int32Array]",th="[object Uint8Array]",ih="[object Uint8ClampedArray]",lh="[object Uint16Array]",rh="[object Uint32Array]",_2={};_2[jm]=_2[Ym]=_2[Qm]=_2[Jm]=_2[eh]=_2[th]=_2[ih]=_2[lh]=_2[rh]=!0;_2[km]=_2[Tm]=_2[Km]=_2[Pm]=_2[Xm]=_2[Dm]=_2[Am]=_2[Im]=_2[Om]=_2[_m]=_2[Wm]=_2[qm]=_2[$m]=_2[Um]=_2[Gm]=!1;function sh(e){return Sm(e)&&Fm(e.length)&&!!_2[bm(e)]}Xi.exports=sh});var Qi=U((Du,Yi)=>{function ah(e){return function(t){return e(t)}}Yi.exports=ah});var el=U((W9,J5)=>{var oh=So(),Ji=typeof W9=="object"&&W9&&!W9.nodeType&&W9,q9=Ji&&typeof J5=="object"&&J5&&!J5.nodeType&&J5,nh=q9&&q9.exports===Ji,M8=nh&&oh.process,Ch=function(){try{var e=q9&&q9.require&&q9.require("util").types;return e||M8&&M8.binding&&M8.binding("util")}catch(t){}}();J5.exports=Ch});var x8=U((Au,ll)=>{var ch=ji(),mh=Qi(),tl=el(),il=tl&&tl.isTypedArray,hh=il?mh(il):ch;ll.exports=hh});var sl=U((Iu,rl)=>{var wh=Wi(),gh=U6(),Hh=I5(),Lh=p8(),Vh=G6(),dh=x8(),uh=Object.prototype,vh=uh.hasOwnProperty;function ph(e,t){var i=Hh(e),l=!i&&gh(e),r=!i&&!l&&Lh(e),s=!i&&!l&&!r&&dh(e),a=i||l||r||s,o=a?wh(e.length,String):[],n=o.length;for(var C in e)(t||vh.call(e,C))&&!(a&&(C=="length"||r&&(C=="offset"||C=="parent")||s&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||Vh(C,n)))&&o.push(C);return o}rl.exports=ph});var ol=U((Ou,al)=>{var Mh=Object.prototype;function xh(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Mh;return e===i}al.exports=xh});var Cl=U((_u,nl)=>{function fh(e,t){return function(i){return e(t(i))}}nl.exports=fh});var ml=U((Wu,cl)=>{var Zh=Cl(),Eh=Zh(Object.keys,Object);cl.exports=Eh});var wl=U((qu,hl)=>{var Nh=ol(),Rh=ml(),Bh=Object.prototype,zh=Bh.hasOwnProperty;function yh(e){if(!Nh(e))return Rh(e);var t=[];for(var i in Object(e))zh.call(e,i)&&i!="constructor"&&t.push(i);return t}hl.exports=yh});var J7=U(($u,gl)=>{var bh=sl(),Fh=wl(),Sh=K7();function kh(e){return Sh(e)?bh(e):Fh(e)}gl.exports=kh});var Ll=U((Uu,Hl)=>{var Th=Oi(),Ph=J7();function Dh(e,t){return e&&Th(e,t,Ph)}Hl.exports=Dh});var dl=U((Gu,Vl)=>{var Ah=K7();function Ih(e,t){return function(i,l){if(i==null)return i;if(!Ah(i))return e(i,l);for(var r=i.length,s=t?r:-1,a=Object(i);(t?s--:++s{var Oh=Ll(),_h=dl(),Wh=_h(Oh);ul.exports=Wh});var Ml=U((Xu,pl)=>{var qh=vl();function $h(e,t,i,l){return qh(e,function(r,s,a){t(l,r,i(r),a)}),l}pl.exports=$h});var fl=U((ju,xl)=>{var Uh=F3();function Gh(){this.__data__=new Uh,this.size=0}xl.exports=Gh});var El=U((Yu,Zl)=>{function Kh(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}Zl.exports=Kh});var Rl=U((Qu,Nl)=>{function Xh(e){return this.__data__.get(e)}Nl.exports=Xh});var zl=U((Ju,Bl)=>{function jh(e){return this.__data__.has(e)}Bl.exports=jh});var bl=U((ev,yl)=>{var Yh=F3(),Qh=q6(),Jh=$6(),ew=200;function tw(e,t){var i=this.__data__;if(i instanceof Yh){var l=i.__data__;if(!Qh||l.length{var iw=F3(),lw=fl(),rw=El(),sw=Rl(),aw=zl(),ow=bl();function e9(e){var t=this.__data__=new iw(e);this.size=t.size}e9.prototype.clear=lw;e9.prototype.delete=rw;e9.prototype.get=sw;e9.prototype.has=aw;e9.prototype.set=ow;Fl.exports=e9});var kl=U((iv,Sl)=>{function nw(e,t){for(var i=-1,l=e==null?0:e.length;++i{var Cw=a8(),cw=kl(),mw=o8(),hw=1,ww=2;function gw(e,t,i,l,r,s){var a=i&hw,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 h=-1,g=!0,m=i&ww?new Cw:void 0;for(s.set(e,t),s.set(t,e);++h{var Hw=s5(),Lw=Hw.Uint8Array;Pl.exports=Lw});var Il=U((sv,Al)=>{function Vw(e){var t=-1,i=Array(e.size);return e.forEach(function(l,r){i[++t]=[r,l]}),i}Al.exports=Vw});var $l=U((av,ql)=>{var Ol=A6(),_l=Dl(),dw=W6(),uw=Z8(),vw=Il(),pw=G7(),Mw=1,xw=2,fw="[object Boolean]",Zw="[object Date]",Ew="[object Error]",Nw="[object Map]",Rw="[object Number]",Bw="[object RegExp]",zw="[object Set]",yw="[object String]",bw="[object Symbol]",Fw="[object ArrayBuffer]",Sw="[object DataView]",Wl=Ol?Ol.prototype:void 0,E8=Wl?Wl.valueOf:void 0;function kw(e,t,i,l,r,s,a){switch(i){case Sw:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Fw:return!(e.byteLength!=t.byteLength||!s(new _l(e),new _l(t)));case fw:case Zw:case Rw:return dw(+e,+t);case Ew:return e.name==t.name&&e.message==t.message;case Bw:case yw:return e==t+"";case Nw:var o=vw;case zw:var n=l&Mw;if(o||(o=pw),e.size!=t.size&&!n)return!1;var C=a.get(e);if(C)return C==t;l|=xw,a.set(e,t);var c=uw(o(e),o(t),l,r,s,a);return a.delete(e),c;case bw:if(E8)return E8.call(e)==E8.call(t)}return!1}ql.exports=kw});var Gl=U((ov,Ul)=>{var Tw=c8(),Pw=I5();function Dw(e,t,i){var l=t(e);return Pw(e)?l:Tw(l,i(e))}Ul.exports=Dw});var Xl=U((nv,Kl)=>{function Aw(e,t){for(var i=-1,l=e==null?0:e.length,r=0,s=[];++i{function Iw(){return[]}jl.exports=Iw});var er=U((cv,Jl)=>{var Ow=Xl(),_w=Yl(),Ww=Object.prototype,qw=Ww.propertyIsEnumerable,Ql=Object.getOwnPropertySymbols,$w=Ql?function(e){return e==null?[]:(e=Object(e),Ow(Ql(e),function(t){return qw.call(e,t)}))}:_w;Jl.exports=$w});var ir=U((mv,tr)=>{var Uw=Gl(),Gw=er(),Kw=J7();function Xw(e){return Uw(e,Kw,Gw)}tr.exports=Xw});var sr=U((hv,rr)=>{var lr=ir(),jw=1,Yw=Object.prototype,Qw=Yw.hasOwnProperty;function Jw(e,t,i,l,r,s){var a=i&jw,o=lr(e),n=o.length,C=lr(t),c=C.length;if(n!=c&&!a)return!1;for(var h=n;h--;){var g=o[h];if(!(a?g in t:Qw.call(t,g)))return!1}var m=s.get(e),w=s.get(t);if(m&&w)return m==t&&w==e;var L=!0;s.set(e,t),s.set(t,e);for(var v=a;++h{var eg=M9(),tg=s5(),ig=eg(tg,"DataView");ar.exports=ig});var Cr=U((gv,nr)=>{var lg=M9(),rg=s5(),sg=lg(rg,"Promise");nr.exports=sg});var mr=U((Hv,cr)=>{var ag=M9(),og=s5(),ng=ag(og,"WeakMap");cr.exports=ng});var ur=U((Lv,dr)=>{var N8=or(),R8=q6(),B8=Cr(),z8=n8(),y8=mr(),Vr=I6(),t9=Po(),hr="[object Map]",Cg="[object Object]",wr="[object Promise]",gr="[object Set]",Hr="[object WeakMap]",Lr="[object DataView]",cg=t9(N8),mg=t9(R8),hg=t9(B8),wg=t9(z8),gg=t9(y8),L5=Vr;(N8&&L5(new N8(new ArrayBuffer(1)))!=Lr||R8&&L5(new R8)!=hr||B8&&L5(B8.resolve())!=wr||z8&&L5(new z8)!=gr||y8&&L5(new y8)!=Hr)&&(L5=function(e){var t=Vr(e),i=t==Cg?e.constructor:void 0,l=i?t9(i):"";if(l)switch(l){case cg:return Lr;case mg:return hr;case hg:return wr;case wg:return gr;case gg:return Hr}return t});dr.exports=L5});var Nr=U((Vv,Er)=>{var b8=f8(),Hg=Z8(),Lg=$l(),Vg=sr(),vr=ur(),pr=I5(),Mr=p8(),dg=x8(),ug=1,xr="[object Arguments]",fr="[object Array]",e3="[object Object]",vg=Object.prototype,Zr=vg.hasOwnProperty;function pg(e,t,i,l,r,s){var a=pr(e),o=pr(t),n=a?fr:vr(e),C=o?fr:vr(t);n=n==xr?e3:n,C=C==xr?e3:C;var c=n==e3,h=C==e3,g=n==C;if(g&&Mr(e)){if(!Mr(t))return!1;a=!0,c=!1}if(g&&!c)return s||(s=new b8),a||dg(e)?Hg(e,t,i,l,r,s):Lg(e,t,n,i,l,r,s);if(!(i&ug)){var m=c&&Zr.call(e,"__wrapped__"),w=h&&Zr.call(t,"__wrapped__");if(m||w){var L=m?e.value():e,v=w?t.value():t;return s||(s=new b8),r(L,v,i,l,s)}}return g?(s||(s=new b8),Vg(e,t,i,l,r,s)):!1}Er.exports=pg});var F8=U((dv,zr)=>{var Mg=Nr(),Rr=O6();function Br(e,t,i,l,r){return e===t?!0:e==null||t==null||!Rr(e)&&!Rr(t)?e!==e&&t!==t:Mg(e,t,i,l,Br,r)}zr.exports=Br});var br=U((uv,yr)=>{var xg=f8(),fg=F8(),Zg=1,Eg=2;function Ng(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 Rg=p9();function Bg(e){return e===e&&!Rg(e)}Fr.exports=Bg});var kr=U((pv,Sr)=>{var zg=S8(),yg=J7();function bg(e){for(var t=yg(e),i=t.length;i--;){var l=t[i],r=e[l];t[i]=[l,r,zg(r)]}return t}Sr.exports=bg});var k8=U((Mv,Tr)=>{function Fg(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}Tr.exports=Fg});var Dr=U((xv,Pr)=>{var Sg=br(),kg=kr(),Tg=k8();function Pg(e){var t=kg(e);return t.length==1&&t[0][2]?Tg(t[0][0],t[0][1]):function(i){return i===e||Sg(i,e,t)}}Pr.exports=Pg});var T8=U((fv,Ar)=>{var Dg=Do(),Ag=S3();function Ig(e,t){t=Dg(t,e);for(var i=0,l=t.length;e!=null&&i{var Og=T8();function _g(e,t,i){var l=e==null?void 0:Og(e,t);return l===void 0?i:l}Ir.exports=_g});var Wr=U((Ev,_r)=>{function Wg(e,t){return e!=null&&t in Object(e)}_r.exports=Wg});var $r=U((Nv,qr)=>{var qg=Wr(),$g=Ao();function Ug(e,t){return e!=null&&$g(e,t,qg)}qr.exports=Ug});var Gr=U((Rv,Ur)=>{var Gg=F8(),Kg=Or(),Xg=$r(),jg=_6(),Yg=S8(),Qg=k8(),Jg=S3(),eH=1,tH=2;function iH(e,t){return jg(e)&&Yg(t)?Qg(Jg(e),t):function(i){var l=Kg(i,e);return l===void 0&&l===t?Xg(i,e):Gg(t,l,eH|tH)}}Ur.exports=iH});var Xr=U((Bv,Kr)=>{function lH(e){return e}Kr.exports=lH});var Yr=U((zv,jr)=>{function rH(e){return function(t){return t==null?void 0:t[e]}}jr.exports=rH});var Jr=U((yv,Qr)=>{var sH=T8();function aH(e){return function(t){return sH(t,e)}}Qr.exports=aH});var ts=U((bv,es)=>{var oH=Yr(),nH=Jr(),CH=_6(),cH=S3();function mH(e){return CH(e)?oH(cH(e)):nH(e)}es.exports=mH});var ls=U((Fv,is)=>{var hH=Dr(),wH=Gr(),gH=Xr(),HH=I5(),LH=ts();function VH(e){return typeof e=="function"?e:e==null?gH:typeof e=="object"?HH(e)?wH(e[0],e[1]):hH(e):LH(e)}is.exports=VH});var ss=U((Sv,rs)=>{var dH=Pi(),uH=Ml(),vH=ls(),pH=I5();function MH(e,t){return function(i,l){var r=pH(i)?dH:uH,s=t?t():{};return r(i,e,vH(l,2),s)}}rs.exports=MH});var os=U((kv,as)=>{var xH=ki(),fH=ss(),ZH=Object.prototype,EH=ZH.hasOwnProperty,NH=fH(function(e,t,i){EH.call(e,i)?e[i].push(t):xH(e,i,[t])});as.exports=NH});var Na=U((qf,Ea)=>{var NL=B7(),RL=p9(),BL="Expected a function";function zL(e,t,i){var l=!0,r=!0;if(typeof e!="function")throw new TypeError(BL);return RL(i)&&(l="leading"in i?!!i.leading:l,r="trailing"in i?!!i.trailing:r),NL(e,t,{leading:l,maxWait:t,trailing:r})}Ea.exports=zL});var ro=F1(Y1()),so=F1(ee());var i1=F1(Y1());var h5=F1(Y1(),1);var te=X2("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var We=F1(Ee(),1);var j2=F1(Y1(),1),De=F1(B7(),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 m5(e,t){return e===void 0?void 0:t}var Qn=Math.PI;function Y3(e){return e*Qn/180}var y7=(e,t,i)=>({x1:e-i/2,y1:t-i/2,x2:e+i/2,y2:t+i/2}),b7=(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}},F7=(e,t,i)=>Math.min(e,t-i*2),S7=(e,t,i)=>i.x1<=e&&e<=i.x2&&i.y1<=t&&t<=i.y2,q5=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"}))},Ae=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 Ie(e,t,i){let[l,r]=j2.useState(e),s=j2.useRef(!0);j2.useEffect(()=>()=>{s.current=!1},[]);let a=j2.useRef((0,De.default)(o=>{s.current&&r(o)},i));return j2.useLayoutEffect(()=>{s.current&&a.current(()=>e())},t),l}var Jn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",eC="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",tC=new RegExp("^[^"+eC+"]*["+Jn+"]");function $5(e){return tC.test(e)?"rtl":"not-rtl"}var z7;function z9(){if(typeof document=="undefined")return 0;if(z7!==void 0)return z7;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(),z7=i-l,z7}var c5=Symbol();function Oe(e){let t=j2.useRef([c5,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!==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=j2.useCallback(()=>{t.current[0]=c5,r({})},[]);return[t.current[0]===c5?i:t.current[0],s,a]}function k7(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 _e(e){let t=j2.useRef(e);return r5(e,t.current)||(t.current=e),t.current}var qe=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 h5.createElement(te,{"data-testid":"GDG-default-image-overlay-editor"},h5.createElement(We.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:h5.createElement("img",{draggable:!1,src:o});return h5.createElement("div",{className:"gdg-centering-container",key:o},n)})),i&&l&&h5.createElement("button",{className:"gdg-edit-icon",onClick:l},h5.createElement(q5,null)))};var Q3=F1(Y1(),1);function Ye(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var U5=Ye();function iC(e){U5=e}var lC=/[&<>"']/,rC=/[&<>"']/g,sC=/[<>"']|&(?!#?\w+;)/,aC=/[<>"']|&(?!#?\w+;)/g,oC={"&":"&","<":"<",">":">",'"':""","'":"'"},$e=e=>oC[e];function u0(e,t){if(t){if(lC.test(e))return e.replace(rC,$e)}else if(sC.test(e))return e.replace(aC,$e);return e}var nC=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Qe(e){return e.replace(nC,(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 CC=/(^|[^\[])\^/g;function b2(e,t){e=typeof e=="string"?e:e.source,t=t||"";let i={replace:(l,r)=>(r=r.source||r,r=r.replace(CC,"$1"),e=e.replace(l,r),i),getRegex:()=>new RegExp(e,t)};return i}var cC=/[^\w:]/g,mC=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ue(e,t,i){if(e){let l;try{l=decodeURIComponent(Qe(i)).replace(cC,"").toLowerCase()}catch(r){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}t&&!mC.test(i)&&(i=HC(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(l){return null}return i}var T7={},hC=/^[^:]+:\/*[^/]*$/,wC=/^([^:]+:)[\s\S]*$/,gC=/^([^:]+:\/*[^/]*)[\s\S]*$/;function HC(e,t){T7[" "+e]||(hC.test(e)?T7[" "+e]=e+"/":T7[" "+e]=P7(e,"/",!0)),e=T7[" "+e];let i=e.indexOf(":")===-1;return t.substring(0,2)==="//"?i?t:e.replace(wC,"$1")+t:t.charAt(0)==="/"?i?t:e.replace(gC,"$1")+t:e+t}var D7={exec:function(){}};function L4(e){let t=1,i,l;for(;t{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 Xe(e,t,i,l){let r=t.href,s=t.title?u0(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:u0(a)}}function VC(e,t){let i=e.match(/^(\s+)(?:```)/);if(i===null)return t;let l=i[1];return t.split(` +import{A as tn,B as U5,C as G5,D as C1,E as c5,F as W3,G as R9,H as q3,I as K5,J as P4,K as m5,L as Ce,M as B9,N as s4,O as x2,P as z0,Q as $3,R as y0,S as ce,T as H7,U as me,V as a4,W as he,a as Y6,b as d0,c as o5,d as Q6,e as n5,f as $5,g as jo,h as C5,i as J6,j as ee,k as te,l as Yo,m as ie,n as E9,o as Qo,p as Jo,q as N9,r as le,s as O3,t as re,u as se,v as en,w as ae,x as oe,y as ne,z as _3}from"./chunk-7E2MHSGD.js";import{a as y,b as T,c as s0,d as U,e as x1,f as C2,g as k1,h as X2}from"./chunk-2HCNYJTW.js";var ge=U(U3=>{"use strict";var we=Y6();U3.createRoot=we.createRoot,U3.hydrateRoot=we.hydrateRoot;var MV});var Ve=U((EV,Le)=>{"use strict";var ln="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Le.exports=ln});var pe=U((NV,ve)=>{"use strict";var rn=Ve();function de(){}function ue(){}ue.resetWarningCache=de;ve.exports=function(){function e(l,r,s,a,o,n){if(n!==rn){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=U((zV,Me)=>{Me.exports=pe()();var RV,BV});var fe=U(L7=>{(function(e,t){if(typeof define=="function"&&define.amd)define(["exports","react","prop-types"],t);else if(typeof L7!="undefined")t(L7,k1(),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=m;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 g?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){h(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,S=p.onSwipeUp,k=p.onSwipeDown,b=p.onSwipeLeft,D=p.onSwipeRight,B=p.onSwipeStart,_=p.onSwipeMove,K=p.onSwipeEnd,J=p.innerRef,c1=p.tolerance,w1=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},w1),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 G3=U(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=U((FV,d7)=>{(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function i(){for(var l=[],r=0;r{"use strict";Object.defineProperty(u7,"__esModule",{value:!0});u7.default=void 0;var G4=sn(Ze());function sn(e){return e&&e.__esModule?e:{default:e}}function an(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var on={ROOT:function(t){return(0,G4.default)(an({"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=on});var Ee=U(v7=>{"use strict";Object.defineProperty(v7,"__esModule",{value:!0});v7.outerWidth=void 0;var nn=function(t){var i=t.offsetWidth,l=getComputedStyle(t);return i+=parseInt(l.marginLeft)+parseInt(l.marginRight),i};v7.outerWidth=nn});var M7=U(p7=>{"use strict";Object.defineProperty(p7,"__esModule",{value:!0});p7.default=void 0;var Cn=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=Cn});var X3=U(x7=>{"use strict";Object.defineProperty(x7,"__esModule",{value:!0});x7.default=void 0;var cn=function(){return window};x7.default=cn});var J3=U(N7=>{"use strict";Object.defineProperty(N7,"__esModule",{value:!0});N7.default=void 0;var L4=wn(k1()),h5=E7(K3()),mn=Ee(),Ne=E7(M7()),hn=E7(G3()),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 wn(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===h&&a<0&&(a=0);var g=r.itemsWrapperRef.clientWidth,m=C+100/(g/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(w){r.itemsListRef.style[w]=(0,Ne.default)(m,"%",r.props.axis)}),!0}),R0(b0(r),"slideRight",function(s){r.moveTo(r.state.firstItem-(typeof s=="number"?s:1))}),R0(b0(r),"slideLeft",function(s){r.moveTo(r.state.firstItem+(typeof s=="number"?s:1))}),R0(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 Hn(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 pn=function(){return document};R7.default=pn});var e8=U(o4=>{"use strict";Object.defineProperty(o4,"__esModule",{value:!0});o4.setPosition=o4.getPosition=o4.isKeyboardEvent=o4.defaultStatusFormatter=o4.noop=void 0;var Mn=k1(),xn=fn(M7());function fn(e){return e&&e.__esModule?e:{default:e}}var Zn=function(){};o4.noop=Zn;var En=function(t,i){return"".concat(t," of ").concat(i)};o4.defaultStatusFormatter=En;var Nn=function(t){return t?t.hasOwnProperty("key"):!1};o4.isKeyboardEvent=Nn;var Rn=function(t,i){if(i.infiniteLoop&&++t,t===0)return 0;var l=Mn.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};o4.getPosition=Rn;var Bn=function(t,i){var l={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){l[r]=(0,xn.default)(t,"%",i)}),l};o4.setPosition=Bn});var Fe=U(E4=>{"use strict";Object.defineProperty(E4,"__esModule",{value:!0});E4.fadeAnimationHandler=E4.slideStopSwipingHandler=E4.slideSwipeAnimationHandler=E4.slideAnimationHandler=void 0;var be=k1(),zn=yn(M7()),Z4=e8();function yn(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 w5(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,zn.default)(n,"%",t.axis),c=t.transitionTime+"ms";return l.itemListStyle={WebkitTransform:C,msTransform:C,OTransform:C,transform:C},i.swiping||(l.itemListStyle=w5(w5({},l.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),l};E4.slideAnimationHandler=Fn;var Sn=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),h=a?t.x:t.y,g=h;C===n&&h>0&&(g=0),C===c&&h<0&&(g=0);var m=C+100/(l.itemSize/g),w=Math.abs(h)>i.swipeScrollTolerance;return i.infiniteLoop&&w&&(l.selectedItem===0&&m>-100?m-=o*100:l.selectedItem===o-1&&m<-o*100&&(m+=o*100)),(!i.preventMovementUntilSwipeScrollTolerance||w||l.swipeMovementStarted)&&(l.swipeMovementStarted||r({swipeMovementStarted:!0}),s.itemListStyle=(0,Z4.setPosition)(m,i.axis)),w&&!l.cancelClick&&r({cancelClick:!0}),s};E4.slideSwipeAnimationHandler=Sn;var kn=function(t,i){var l=(0,Z4.getPosition)(i.selectedItem,t),r=(0,Z4.setPosition)(l,t.axis);return{itemListStyle:r}};E4.slideStopSwipingHandler=kn;var Tn=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=w5(w5({},s),{},{WebkitTransitionDuration:l,MozTransitionDuration:l,OTransitionDuration:l,transitionDuration:l,msTransitionDuration:l})),{slideStyle:s,selectedStyle:w5(w5({},s),{},{opacity:1,position:"relative"}),prevStyle:w5({},s)}};E4.fadeAnimationHandler=Tn});var Pe=U(F7=>{"use strict";Object.defineProperty(F7,"__esModule",{value:!0});F7.default=void 0;var B2=An(k1()),Pn=F9(G3()),D4=F9(K3()),Dn=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 An(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))}),m2(g2(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(g2(r),"moveTo",function(a){if(typeof a=="number"){var o=B2.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(g2(r),"onClickNext",function(){r.increment(1)}),m2(g2(r),"onClickPrev",function(){r.decrement(1)}),m2(g2(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),m2(g2(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),m2(g2(r),"changeItem",function(a){return function(o){(!(0,y9.isKeyboardEvent)(o)||o.key==="Enter")&&r.moveTo(a)}}),m2(g2(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,B2.Children.toArray(r.props.children)[a.selectedItem])}),m2(g2(r),"getInitialImage",function(){var a=r.props.selectedItem,o=r.itemsRef&&r.itemsRef[a],n=o&&o.getElementsByTagName("img")||[];return n[0]}),m2(g2(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 m(){r.forceUpdate(),C.removeEventListener("load",m)};C.addEventListener("load",c)}}var h=n[0]||o.children[0],g=h.clientHeight;return g>0?g: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 On(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&&B2.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?B2.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 h={ref:function(m){return s.setItemsRef(m,o)},key:"itemKey"+o+(r?"clone":""),className:D4.default.ITEM(!0,o===s.state.selectedItem,o===s.state.previousItem),onClick:s.handleClickItem.bind(s,o,a),style:c};return B2.default.createElement("li",h,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?B2.default.createElement("ul",{className:"control-dots"},B2.Children.map(C,function(c,h){return n&&n(r.changeItem(h),h===r.state.selectedItem,h,o.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?B2.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,B2.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||B2.Children.count(this.props.children)===0?null:B2.default.createElement(Dn.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||B2.Children.count(this.props.children)===0)return null;var s=this.props.swipeable&&B2.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",o=this.props.showArrows&&B2.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=U(S9=>{"use strict";Object.defineProperty(S9,"__esModule",{value:!0});Object.defineProperty(S9,"Carousel",{enumerable:!0,get:function(){return Un.default}});Object.defineProperty(S9,"CarouselProps",{enumerable:!0,get:function(){return Gn.CarouselProps}});Object.defineProperty(S9,"Thumbs",{enumerable:!0,get:function(){return Kn.default}});var Un=Ae(Pe()),Gn=De(),Kn=Ae(J3());function Ae(e){return e&&e.__esModule?e:{default:e}}});var _e=U((UV,Oe)=>{var Xn=C5(),jn=function(){return Xn.Date.now()};Oe.exports=jn});var qe=U((GV,We)=>{var Yn=/\s/;function Qn(e){for(var t=e.length;t--&&Yn.test(e.charAt(t)););return t}We.exports=Qn});var Ue=U((KV,$e)=>{var Jn=qe(),eC=/^\s+/;function tC(e){return e&&e.slice(0,Jn(e)+1).replace(eC,"")}$e.exports=tC});var S7=U((XV,Xe)=>{var iC=Ue(),Ge=E9(),lC=Yo(),Ke=NaN,rC=/^[-+]0x[0-9a-f]+$/i,sC=/^0b[01]+$/i,aC=/^0o[0-7]+$/i,oC=parseInt;function nC(e){if(typeof e=="number")return e;if(lC(e))return Ke;if(Ge(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ge(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iC(e);var i=sC.test(e);return i||aC.test(e)?oC(e.slice(2),i?2:8):rC.test(e)?Ke:+e}Xe.exports=nC});var k7=U((jV,Ye)=>{var CC=E9(),r8=_e(),je=S7(),cC="Expected a function",mC=Math.max,hC=Math.min;function wC(e,t,i){var l,r,s,a,o,n,C=0,c=!1,h=!1,g=!0;if(typeof e!="function")throw new TypeError(cC);t=je(t)||0,CC(i)&&(c=!!i.leading,h="maxWait"in i,s=h?mC(je(i.maxWait)||0,t):s,g="trailing"in i?!!i.trailing:g);function m(R){var x=l,N=r;return l=r=void 0,C=R,a=e.apply(N,x),a}function w(R){return C=R,o=setTimeout(V,t),c?m(R):a}function L(R){var x=R-n,N=R-C,E=t-x;return h?hC(E,s-N):E}function v(R){var x=R-n,N=R-C;return n===void 0||x>=t||x<0||h&&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,g&&l?m(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 w(n);if(h)return clearTimeout(o),o=setTimeout(V,t),m(n)}return o===void 0&&(o=setTimeout(V,t)),a}return Z.cancel=d,Z.flush=p,Z}Ye.exports=wC});var It=U((Td,At)=>{function qC(e,t,i){return e===e&&(i!==void 0&&(e=e<=i?e:i),t!==void 0&&(e=e>=t?e:t)),e}At.exports=qC});var q9=U((Pd,Ot)=>{var $C=It(),w8=S7();function UC(e,t,i){return i===void 0&&(i=t,t=void 0),i!==void 0&&(i=w8(i),i=i===i?i:0),t!==void 0&&(t=w8(t),t=t===t?t:0),$C(w8(e),t,i)}Ot.exports=UC});var Wt=U((Dd,_t)=>{var GC="__lodash_hash_undefined__";function KC(e){return this.__data__.set(e,GC),this}_t.exports=KC});var $t=U((Ad,qt)=>{function XC(e){return this.__data__.has(e)}qt.exports=XC});var g8=U((Id,Ut)=>{var jC=se(),YC=Wt(),QC=$t();function Q7(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new jC;++t{function JC(e,t,i,l){for(var r=e.length,s=i+(l?1:-1);l?s--:++s{function ec(e){return e!==e}Xt.exports=ec});var Qt=U((Wd,Yt)=>{function tc(e,t,i){for(var l=i-1,r=e.length;++l{var ic=Kt(),lc=jt(),rc=Qt();function sc(e,t,i){return t===t?rc(e,t,i):ic(e,lc,i)}Jt.exports=sc});var ii=U(($d,ti)=>{var ac=ei();function oc(e,t){var i=e==null?0:e.length;return!!i&&ac(e,t,0)>-1}ti.exports=oc});var ri=U((Ud,li)=>{function nc(e,t,i){for(var l=-1,r=e==null?0:e.length;++l{function Cc(e,t){return e.has(t)}si.exports=Cc});var L8=U((Kd,ai)=>{var cc=N9(),mc=C5(),hc=cc(mc,"Set");ai.exports=hc});var ni=U((Xd,oi)=>{function wc(){}oi.exports=wc});var J7=U((jd,Ci)=>{function gc(e){var t=-1,i=Array(e.size);return e.forEach(function(l){i[++t]=l}),i}Ci.exports=gc});var mi=U((Yd,ci)=>{var V8=L8(),Hc=ni(),Lc=J7(),Vc=1/0,dc=V8&&1/Lc(new V8([,-0]))[1]==Vc?function(e){return new V8(e)}:Hc;ci.exports=dc});var wi=U((Qd,hi)=>{var uc=g8(),vc=ii(),pc=ri(),Mc=H8(),xc=mi(),fc=J7(),Zc=200;function Ec(e,t,i){var l=-1,r=vc,s=e.length,a=!0,o=[],n=o;if(i)a=!1,r=pc;else if(s>=Zc){var C=t?null:xc(e);if(C)return fc(C);a=!1,r=Mc,n=new uc}else n=t?[]:o;e:for(;++l{var Nc=wi();function Rc(e){return e&&e.length?Nc(e):[]}gi.exports=Rc});var d8=U((eu,Li)=>{function Bc(e,t){for(var i=-1,l=t.length,r=e.length;++i{var Vi=J6(),zc=ae(),yc=$5(),di=Vi?Vi.isConcatSpreadable:void 0;function bc(e){return yc(e)||zc(e)||!!(di&&e&&e[di])}ui.exports=bc});var xi=U((iu,Mi)=>{var Fc=d8(),Sc=vi();function pi(e,t,i,l,r){var s=-1,a=e.length;for(i||(i=Sc),r||(r=[]);++s0&&i(o)?t>1?pi(o,t-1,i,l,r):Fc(r,o):l||(r[r.length]=o)}return r}Mi.exports=pi});var Zi=U((lu,fi)=>{var kc=xi();function Tc(e){var t=e==null?0:e.length;return t?kc(e,1):[]}fi.exports=Tc});var Ni=U((ru,Ei)=>{var Pc=Math.ceil,Dc=Math.max;function Ac(e,t,i,l){for(var r=-1,s=Dc(Pc((t-e)/(i||1)),0),a=Array(s);s--;)a[l?s:++r]=e,e+=i;return a}Ei.exports=Ac});var e3=U((su,Ri)=>{var Ic=Qo(),Oc=ne();function _c(e){return e!=null&&Oc(e.length)&&!Ic(e)}Ri.exports=_c});var zi=U((au,Bi)=>{var Wc=le(),qc=e3(),$c=oe(),Uc=E9();function Gc(e,t,i){if(!Uc(i))return!1;var l=typeof t;return(l=="number"?qc(i)&&$c(t,i.length):l=="string"&&t in i)?Wc(i[t],e):!1}Bi.exports=Gc});var Fi=U((ou,bi)=>{var Kc=S7(),yi=1/0,Xc=17976931348623157e292;function jc(e){if(!e)return e===0?e:0;if(e=Kc(e),e===yi||e===-yi){var t=e<0?-1:1;return t*Xc}return e===e?e:0}bi.exports=jc});var ki=U((nu,Si)=>{var Yc=Ni(),Qc=zi(),u8=Fi();function Jc(e){return function(t,i,l){return l&&typeof l!="number"&&Qc(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 em=ki(),tm=em();Ti.exports=tm});var Ui=U((Iu,$i)=>{var Sm=N9(),km=function(){try{var e=Sm(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();$i.exports=km});var Xi=U((Ou,Ki)=>{var Gi=Ui();function Tm(e,t,i){t=="__proto__"&&Gi?Gi(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}Ki.exports=Tm});var Yi=U((_u,ji)=>{function Pm(e,t,i,l){for(var r=-1,s=e==null?0:e.length;++r{function Dm(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}}Qi.exports=Dm});var tl=U((qu,el)=>{var Am=Ji(),Im=Am();el.exports=Im});var ll=U(($u,il)=>{function Om(e,t){for(var i=-1,l=Array(e);++i{function _m(){return!1}rl.exports=_m});var B8=U((G9,l9)=>{var Wm=C5(),qm=sl(),nl=typeof G9=="object"&&G9&&!G9.nodeType&&G9,al=nl&&typeof l9=="object"&&l9&&!l9.nodeType&&l9,$m=al&&al.exports===nl,ol=$m?Wm.Buffer:void 0,Um=ol?ol.isBuffer:void 0,Gm=Um||qm;l9.exports=Gm});var cl=U((Gu,Cl)=>{var Km=ee(),Xm=ne(),jm=te(),Ym="[object Arguments]",Qm="[object Array]",Jm="[object Boolean]",eh="[object Date]",th="[object Error]",ih="[object Function]",lh="[object Map]",rh="[object Number]",sh="[object Object]",ah="[object RegExp]",oh="[object Set]",nh="[object String]",Ch="[object WeakMap]",ch="[object ArrayBuffer]",mh="[object DataView]",hh="[object Float32Array]",wh="[object Float64Array]",gh="[object Int8Array]",Hh="[object Int16Array]",Lh="[object Int32Array]",Vh="[object Uint8Array]",dh="[object Uint8ClampedArray]",uh="[object Uint16Array]",vh="[object Uint32Array]",_2={};_2[hh]=_2[wh]=_2[gh]=_2[Hh]=_2[Lh]=_2[Vh]=_2[dh]=_2[uh]=_2[vh]=!0;_2[Ym]=_2[Qm]=_2[ch]=_2[Jm]=_2[mh]=_2[eh]=_2[th]=_2[ih]=_2[lh]=_2[rh]=_2[sh]=_2[ah]=_2[oh]=_2[nh]=_2[Ch]=!1;function ph(e){return jm(e)&&Xm(e.length)&&!!_2[Km(e)]}Cl.exports=ph});var hl=U((Ku,ml)=>{function Mh(e){return function(t){return e(t)}}ml.exports=Mh});var gl=U((K9,r9)=>{var xh=jo(),wl=typeof K9=="object"&&K9&&!K9.nodeType&&K9,X9=wl&&typeof r9=="object"&&r9&&!r9.nodeType&&r9,fh=X9&&X9.exports===wl,z8=fh&&xh.process,Zh=function(){try{var e=X9&&X9.require&&X9.require("util").types;return e||z8&&z8.binding&&z8.binding("util")}catch(t){}}();r9.exports=Zh});var y8=U((Xu,Vl)=>{var Eh=cl(),Nh=hl(),Hl=gl(),Ll=Hl&&Hl.isTypedArray,Rh=Ll?Nh(Ll):Eh;Vl.exports=Rh});var ul=U((ju,dl)=>{var Bh=ll(),zh=ae(),yh=$5(),bh=B8(),Fh=oe(),Sh=y8(),kh=Object.prototype,Th=kh.hasOwnProperty;function Ph(e,t){var i=yh(e),l=!i&&zh(e),r=!i&&!l&&bh(e),s=!i&&!l&&!r&&Sh(e),a=i||l||r||s,o=a?Bh(e.length,String):[],n=o.length;for(var C in e)(t||Th.call(e,C))&&!(a&&(C=="length"||r&&(C=="offset"||C=="parent")||s&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||Fh(C,n)))&&o.push(C);return o}dl.exports=Ph});var pl=U((Yu,vl)=>{var Dh=Object.prototype;function Ah(e){var t=e&&e.constructor,i=typeof t=="function"&&t.prototype||Dh;return e===i}vl.exports=Ah});var xl=U((Qu,Ml)=>{function Ih(e,t){return function(i){return e(t(i))}}Ml.exports=Ih});var Zl=U((Ju,fl)=>{var Oh=xl(),_h=Oh(Object.keys,Object);fl.exports=_h});var Nl=U((ev,El)=>{var Wh=pl(),qh=Zl(),$h=Object.prototype,Uh=$h.hasOwnProperty;function Gh(e){if(!Wh(e))return qh(e);var t=[];for(var i in Object(e))Uh.call(e,i)&&i!="constructor"&&t.push(i);return t}El.exports=Gh});var s3=U((tv,Rl)=>{var Kh=ul(),Xh=Nl(),jh=e3();function Yh(e){return jh(e)?Kh(e):Xh(e)}Rl.exports=Yh});var zl=U((iv,Bl)=>{var Qh=tl(),Jh=s3();function ew(e,t){return e&&Qh(e,t,Jh)}Bl.exports=ew});var bl=U((lv,yl)=>{var tw=e3();function iw(e,t){return function(i,l){if(i==null)return i;if(!tw(i))return e(i,l);for(var r=i.length,s=t?r:-1,a=Object(i);(t?s--:++s{var lw=zl(),rw=bl(),sw=rw(lw);Fl.exports=sw});var Tl=U((sv,kl)=>{var aw=Sl();function ow(e,t,i,l){return aw(e,function(r,s,a){t(l,r,i(r),a)}),l}kl.exports=ow});var Dl=U((av,Pl)=>{var nw=O3();function Cw(){this.__data__=new nw,this.size=0}Pl.exports=Cw});var Il=U((ov,Al)=>{function cw(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}Al.exports=cw});var _l=U((nv,Ol)=>{function mw(e){return this.__data__.get(e)}Ol.exports=mw});var ql=U((Cv,Wl)=>{function hw(e){return this.__data__.has(e)}Wl.exports=hw});var Ul=U((cv,$l)=>{var ww=O3(),gw=re(),Hw=se(),Lw=200;function Vw(e,t){var i=this.__data__;if(i instanceof ww){var l=i.__data__;if(!gw||l.length{var dw=O3(),uw=Dl(),vw=Il(),pw=_l(),Mw=ql(),xw=Ul();function s9(e){var t=this.__data__=new dw(e);this.size=t.size}s9.prototype.clear=uw;s9.prototype.delete=vw;s9.prototype.get=pw;s9.prototype.has=Mw;s9.prototype.set=xw;Gl.exports=s9});var Xl=U((hv,Kl)=>{function fw(e,t){for(var i=-1,l=e==null?0:e.length;++i{var Zw=g8(),Ew=Xl(),Nw=H8(),Rw=1,Bw=2;function zw(e,t,i,l,r,s){var a=i&Rw,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 h=-1,g=!0,m=i&Bw?new Zw:void 0;for(s.set(e,t),s.set(t,e);++h{var yw=C5(),bw=yw.Uint8Array;Yl.exports=bw});var er=U((Hv,Jl)=>{function Fw(e){var t=-1,i=Array(e.size);return e.forEach(function(l,r){i[++t]=[r,l]}),i}Jl.exports=Fw});var sr=U((Lv,rr)=>{var tr=J6(),ir=Ql(),Sw=le(),kw=F8(),Tw=er(),Pw=J7(),Dw=1,Aw=2,Iw="[object Boolean]",Ow="[object Date]",_w="[object Error]",Ww="[object Map]",qw="[object Number]",$w="[object RegExp]",Uw="[object Set]",Gw="[object String]",Kw="[object Symbol]",Xw="[object ArrayBuffer]",jw="[object DataView]",lr=tr?tr.prototype:void 0,S8=lr?lr.valueOf:void 0;function Yw(e,t,i,l,r,s,a){switch(i){case jw:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Xw:return!(e.byteLength!=t.byteLength||!s(new ir(e),new ir(t)));case Iw:case Ow:case qw:return Sw(+e,+t);case _w:return e.name==t.name&&e.message==t.message;case $w:case Gw:return e==t+"";case Ww:var o=Tw;case Uw:var n=l&Dw;if(o||(o=Pw),e.size!=t.size&&!n)return!1;var C=a.get(e);if(C)return C==t;l|=Aw,a.set(e,t);var c=kw(o(e),o(t),l,r,s,a);return a.delete(e),c;case Kw:if(S8)return S8.call(e)==S8.call(t)}return!1}rr.exports=Yw});var or=U((Vv,ar)=>{var Qw=d8(),Jw=$5();function eg(e,t,i){var l=t(e);return Jw(e)?l:Qw(l,i(e))}ar.exports=eg});var Cr=U((dv,nr)=>{function tg(e,t){for(var i=-1,l=e==null?0:e.length,r=0,s=[];++i{function ig(){return[]}cr.exports=ig});var gr=U((vv,wr)=>{var lg=Cr(),rg=mr(),sg=Object.prototype,ag=sg.propertyIsEnumerable,hr=Object.getOwnPropertySymbols,og=hr?function(e){return e==null?[]:(e=Object(e),lg(hr(e),function(t){return ag.call(e,t)}))}:rg;wr.exports=og});var Lr=U((pv,Hr)=>{var ng=or(),Cg=gr(),cg=s3();function mg(e){return ng(e,cg,Cg)}Hr.exports=mg});var ur=U((Mv,dr)=>{var Vr=Lr(),hg=1,wg=Object.prototype,gg=wg.hasOwnProperty;function Hg(e,t,i,l,r,s){var a=i&hg,o=Vr(e),n=o.length,C=Vr(t),c=C.length;if(n!=c&&!a)return!1;for(var h=n;h--;){var g=o[h];if(!(a?g in t:gg.call(t,g)))return!1}var m=s.get(e),w=s.get(t);if(m&&w)return m==t&&w==e;var L=!0;s.set(e,t),s.set(t,e);for(var v=a;++h{var Lg=N9(),Vg=C5(),dg=Lg(Vg,"DataView");vr.exports=dg});var xr=U((fv,Mr)=>{var ug=N9(),vg=C5(),pg=ug(vg,"Promise");Mr.exports=pg});var Zr=U((Zv,fr)=>{var Mg=N9(),xg=C5(),fg=Mg(xg,"WeakMap");fr.exports=fg});var Fr=U((Ev,br)=>{var k8=pr(),T8=re(),P8=xr(),D8=L8(),A8=Zr(),yr=ee(),a9=Jo(),Er="[object Map]",Zg="[object Object]",Nr="[object Promise]",Rr="[object Set]",Br="[object WeakMap]",zr="[object DataView]",Eg=a9(k8),Ng=a9(T8),Rg=a9(P8),Bg=a9(D8),zg=a9(A8),v5=yr;(k8&&v5(new k8(new ArrayBuffer(1)))!=zr||T8&&v5(new T8)!=Er||P8&&v5(P8.resolve())!=Nr||D8&&v5(new D8)!=Rr||A8&&v5(new A8)!=Br)&&(v5=function(e){var t=yr(e),i=t==Zg?e.constructor:void 0,l=i?a9(i):"";if(l)switch(l){case Eg:return zr;case Ng:return Er;case Rg:return Nr;case Bg:return Rr;case zg:return Br}return t});br.exports=v5});var Or=U((Nv,Ir)=>{var I8=b8(),yg=F8(),bg=sr(),Fg=ur(),Sr=Fr(),kr=$5(),Tr=B8(),Sg=y8(),kg=1,Pr="[object Arguments]",Dr="[object Array]",a3="[object Object]",Tg=Object.prototype,Ar=Tg.hasOwnProperty;function Pg(e,t,i,l,r,s){var a=kr(e),o=kr(t),n=a?Dr:Sr(e),C=o?Dr:Sr(t);n=n==Pr?a3:n,C=C==Pr?a3:C;var c=n==a3,h=C==a3,g=n==C;if(g&&Tr(e)){if(!Tr(t))return!1;a=!0,c=!1}if(g&&!c)return s||(s=new I8),a||Sg(e)?yg(e,t,i,l,r,s):bg(e,t,n,i,l,r,s);if(!(i&kg)){var m=c&&Ar.call(e,"__wrapped__"),w=h&&Ar.call(t,"__wrapped__");if(m||w){var L=m?e.value():e,v=w?t.value():t;return s||(s=new I8),r(L,v,i,l,s)}}return g?(s||(s=new I8),Fg(e,t,i,l,r,s)):!1}Ir.exports=Pg});var O8=U((Rv,qr)=>{var Dg=Or(),_r=te();function Wr(e,t,i,l,r){return e===t?!0:e==null||t==null||!_r(e)&&!_r(t)?e!==e&&t!==t:Dg(e,t,i,l,Wr,r)}qr.exports=Wr});var Ur=U((Bv,$r)=>{var Ag=b8(),Ig=O8(),Og=1,_g=2;function Wg(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 qg=E9();function $g(e){return e===e&&!qg(e)}Gr.exports=$g});var Xr=U((yv,Kr)=>{var Ug=_8(),Gg=s3();function Kg(e){for(var t=Gg(e),i=t.length;i--;){var l=t[i],r=e[l];t[i]=[l,r,Ug(r)]}return t}Kr.exports=Kg});var W8=U((bv,jr)=>{function Xg(e,t){return function(i){return i==null?!1:i[e]===t&&(t!==void 0||e in Object(i))}}jr.exports=Xg});var Qr=U((Fv,Yr)=>{var jg=Ur(),Yg=Xr(),Qg=W8();function Jg(e){var t=Yg(e);return t.length==1&&t[0][2]?Qg(t[0][0],t[0][1]):function(i){return i===e||jg(i,e,t)}}Yr.exports=Jg});var q8=U((Sv,Jr)=>{var eH=en(),tH=_3();function iH(e,t){t=eH(t,e);for(var i=0,l=t.length;e!=null&&i{var lH=q8();function rH(e,t,i){var l=e==null?void 0:lH(e,t);return l===void 0?i:l}es.exports=rH});var ls=U((Tv,is)=>{function sH(e,t){return e!=null&&t in Object(e)}is.exports=sH});var ss=U((Pv,rs)=>{var aH=ls(),oH=tn();function nH(e,t){return e!=null&&oH(e,t,aH)}rs.exports=nH});var os=U((Dv,as)=>{var CH=O8(),cH=ts(),mH=ss(),hH=ie(),wH=_8(),gH=W8(),HH=_3(),LH=1,VH=2;function dH(e,t){return hH(e)&&wH(t)?gH(HH(e),t):function(i){var l=cH(i,e);return l===void 0&&l===t?mH(i,e):CH(t,l,LH|VH)}}as.exports=dH});var Cs=U((Av,ns)=>{function uH(e){return e}ns.exports=uH});var ms=U((Iv,cs)=>{function vH(e){return function(t){return t==null?void 0:t[e]}}cs.exports=vH});var ws=U((Ov,hs)=>{var pH=q8();function MH(e){return function(t){return pH(t,e)}}hs.exports=MH});var Hs=U((_v,gs)=>{var xH=ms(),fH=ws(),ZH=ie(),EH=_3();function NH(e){return ZH(e)?xH(EH(e)):fH(e)}gs.exports=NH});var Vs=U((Wv,Ls)=>{var RH=Qr(),BH=os(),zH=Cs(),yH=$5(),bH=Hs();function FH(e){return typeof e=="function"?e:e==null?zH:typeof e=="object"?yH(e)?BH(e[0],e[1]):RH(e):bH(e)}Ls.exports=FH});var us=U((qv,ds)=>{var SH=Yi(),kH=Tl(),TH=Vs(),PH=$5();function DH(e,t){return function(i,l){var r=PH(i)?SH:kH,s=t?t():{};return r(i,e,TH(l,2),s)}}ds.exports=DH});var ps=U(($v,vs)=>{var AH=Xi(),IH=us(),OH=Object.prototype,_H=OH.hasOwnProperty,WH=IH(function(e,t,i){_H.call(e,i)?e[i].push(t):AH(e,i,[t])});vs.exports=WH});var Oa=U((eZ,Ia)=>{var WL=k7(),qL=E9(),$L="Expected a function";function UL(e,t,i){var l=!0,r=!0;if(typeof e!="function")throw new TypeError($L);return qL(i)&&(l="leading"in i?!!i.leading:l,r="trailing"in i?!!i.trailing:r),WL(e,t,{leading:l,maxWait:t,trailing:r})}Ia.exports=UL});var po=x1(k1()),Mo=x1(ge());var h2=x1(k1());var L5=x1(k1(),1);var He=X2("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var lt=x1(Ie(),1);var j2=x1(k1(),1),Qe=x1(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 gC=Math.PI;function s8(e){return e*gC/180}var P7=(e,t,i)=>({x1:e-i/2,y1:t-i/2,x2:e+i/2,y2:t+i/2}),D7=(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}},A7=(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 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 HC="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",LC="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",VC=new RegExp("^[^"+LC+"]*["+HC+"]");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 g5=Symbol();function tt(e){let t=j2.useRef([g5,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!==g5&&(o=typeof o=="function"?o(n):o,o===n)||(n!==g5&&r({}),l(C=>typeof o=="function"?o(n===g5?C:n):o),t.current[0]=g5)},[]),a=j2.useCallback(()=>{t.current[0]=g5,r({})},[]);return[t.current[0]===g5?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 n5(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 L5.createElement(He,{"data-testid":"GDG-default-image-overlay-editor"},L5.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:L5.createElement("img",{draggable:!1,src:o});return L5.createElement("div",{className:"gdg-centering-container",key:o},n)})),i&&l&&L5.createElement("button",{className:"gdg-edit-icon",onClick:l},L5.createElement(X5,null)))};var a8=x1(k1(),1);function mt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}var Y5=mt();function dC(e){Y5=e}var uC=/[&<>"']/,vC=/[&<>"']/g,pC=/[<>"']|&(?!#?\w+;)/,MC=/[<>"']|&(?!#?\w+;)/g,xC={"&":"&","<":"<",">":">",'"':""","'":"'"},st=e=>xC[e];function u0(e,t){if(t){if(uC.test(e))return e.replace(vC,st)}else if(pC.test(e))return e.replace(MC,st);return e}var fC=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ht(e){return e.replace(fC,(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 ZC=/(^|[^\[])\^/g;function b2(e,t){e=typeof e=="string"?e:e.source,t=t||"";let i={replace:(l,r)=>(r=r.source||r,r=r.replace(ZC,"$1"),e=e.replace(l,r),i),getRegex:()=>new RegExp(e,t)};return i}var EC=/[^\w:]/g,NC=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function at(e,t,i){if(e){let l;try{l=decodeURIComponent(ht(i)).replace(EC,"").toLowerCase()}catch(r){return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}t&&!NC.test(i)&&(i=yC(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(l){return null}return i}var _7={},RC=/^[^:]+:\/*[^/]*$/,BC=/^([^:]+:)[\s\S]*$/,zC=/^([^:]+:\/*[^/]*)[\s\S]*$/;function yC(e,t){_7[" "+e]||(RC.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(BC,"$1")+t:t.charAt(0)==="/"?i?t:e.replace(zC,"$1")+t:e+t}var q7={exec:function(){}};function d4(e){let t=1,i,l;for(;t{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?u0(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:u0(a)}}function FC(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 y9=class{constructor(t){this.options=t||U5}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:P7(l,` -`)}}}fences(t){let i=this.rules.block.fences.exec(t);if(i){let l=i[0],r=VC(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=P7(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,"");return{type:"blockquote",raw:i[0],tokens:this.lexer.blockTokens(l,[]),text:l}}}list(t){let i=this.rules.block.list.exec(t);if(i){let l,r,s,a,o,n,C,c,h,g,m,w,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&&(w=!1,!(!(i=u.exec(t))||this.rules.block.hr.test(t)));){if(l=i[0],t=t.substring(l.length),c=i[2].split(` +`)}var T9=class{constructor(t){this.options=t||Y5}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=FC(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,"");return{type:"blockquote",raw:i[0],tokens:this.lexer.blockTokens(l,[]),text:l}}}list(t){let i=this.rules.block.list.exec(t);if(i){let l,r,s,a,o,n,C,c,h,g,m,w,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&&(w=!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],h=t.split(` `,1)[0],this.options.pedantic?(a=2,m=c.trimLeft()):(a=i[2].search(/[^ ]/),a=a>4?1:a,m=c.slice(a),a+=i[1].length),n=!1,!c&&/^ *$/.test(h)&&(l+=h+` `,t=t.substring(h.length+1),w=!0),!w){let p=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),Z=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),x=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;t&&(g=t.split(` @@ -9,10 +9,10 @@ import{A as Ao,B as O5,C as _5,D as c1,E as a5,F as k3,G as x9,H as T3,I as W5,J `+c.slice(a);else if(!n)m+=` `+c;else break;!n&&!c.trim()&&(n=!0),l+=g+` `,t=t.substring(g.length+1)}}V.loose||(C?V.loose=!0:/\n *\n *$/.test(l)&&(C=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(m),r&&(s=r[0]!=="[ ] ",m=m.replace(/^\[[ xX]\] +/,""))),V.items.push({type:"list_item",raw:l,task:!!r,checked:s,loose:!1,text:m}),V.raw+=l}V.items[V.items.length-1].raw=l.trimRight(),V.items[V.items.length-1].text=m.trimRight(),V.raw=V.raw.trimRight();let d=V.items.length;for(o=0;oR.type==="space"),Z=p.every(R=>{let x=R.raw.split(""),N=0;for(let E of x)if(E===` -`&&(N+=1),N>1)return!0;return!1});!V.loose&&p.length&&Z&&(V.loose=!0,V.items[o].loose=!0)}return V}}html(t){let i=this.rules.block.html.exec(t);if(i){let l={type:"html",raw:i[0],pre:!this.options.sanitizer&&(i[1]==="pre"||i[1]==="script"||i[1]==="style"),text:i[0]};if(this.options.sanitize){let r=this.options.sanitizer?this.options.sanitizer(i[0]):u0(i[0]);l.type="paragraph",l.text=r,l.tokens=this.lexer.inline(r)}return l}}def(t){let i=this.rules.block.def.exec(t);if(i)return i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),{type:"def",tag:i[1].toLowerCase().replace(/\s+/g," "),raw:i[0],href:i[2]?i[2].replace(this.rules.inline._escapes,"$1"):i[2],title:i[3]?i[3].replace(this.rules.inline._escapes,"$1"):i[3]}}table(t){let i=this.rules.block.table.exec(t);if(i){let l={type:"table",header:Ge(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]):u0(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=P7(l.slice(0,-1),"\\");if((l.length-a.length)%2===0)return}else{let a=LC(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)),Xe(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||!r.href){let s=l[0].charAt(0);return{type:"text",raw:s,text:s}}return Xe(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,h=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,i=i.slice(-1*t.length+a);(r=h.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 g=t.slice(0,a+r.index+(r[0].length-o.length)+n);if(Math.min(a,n)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}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=u0(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=u0(this.options.mangle?i(l[1]):l[1]),s="mailto:"+r):(r=u0(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=u0(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=u0(l[0]),l[1]==="www."?s="http://"+r:s=r}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]):u0(l[0]):l[0]:r=u0(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 *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:D7,lheading:/^([^\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=b2(D1.def).replace("label",D1._label).replace("title",D1._title).getRegex();D1.bullet=/(?:[*+-]|\d{1,9}[.)])/;D1.listItemStart=b2(/^( *)(bull) */).replace("bull",D1.bullet).getRegex();D1.list=b2(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=b2(D1.html,"i").replace("comment",D1._comment).replace("tag",D1._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();D1.paragraph=b2(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=b2(D1.blockquote).replace("paragraph",D1.paragraph).getRegex();D1.normal=L4({},D1);D1.gfm=L4({},D1.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});D1.gfm.table=b2(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=b2(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=L4({},D1.normal,{html:b2(`^ *(?: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:D7,paragraph:b2(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 u1={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:D7,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:D7,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";u1.punctuation=b2(u1.punctuation).replace(/punctuation/g,u1._punctuation).getRegex();u1.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;u1.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;u1._comment=b2(D1._comment).replace("(?:-->|$)","-->").getRegex();u1.emStrong.lDelim=b2(u1.emStrong.lDelim).replace(/punct/g,u1._punctuation).getRegex();u1.emStrong.rDelimAst=b2(u1.emStrong.rDelimAst,"g").replace(/punct/g,u1._punctuation).getRegex();u1.emStrong.rDelimUnd=b2(u1.emStrong.rDelimUnd,"g").replace(/punct/g,u1._punctuation).getRegex();u1._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;u1._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;u1._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])?)+(?![-_])/;u1.autolink=b2(u1.autolink).replace("scheme",u1._scheme).replace("email",u1._email).getRegex();u1._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;u1.tag=b2(u1.tag).replace("comment",u1._comment).replace("attribute",u1._attribute).getRegex();u1._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;u1._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;u1._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;u1.link=b2(u1.link).replace("label",u1._label).replace("href",u1._href).replace("title",u1._title).getRegex();u1.reflink=b2(u1.reflink).replace("label",u1._label).replace("ref",D1._label).getRegex();u1.nolink=b2(u1.nolink).replace("ref",D1._label).getRegex();u1.reflinkSearch=b2(u1.reflinkSearch,"g").replace("reflink",u1.reflink).replace("nolink",u1.nolink).getRegex();u1.normal=L4({},u1);u1.pedantic=L4({},u1.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:b2(/^!?\[(label)\]\((.*?)\)/).replace("label",u1._label).getRegex(),reflink:b2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",u1._label).getRegex()});u1.gfm=L4({},u1.normal,{escape:b2(u1.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 q4=class e{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||U5,this.options.tokenizer=this.options.tokenizer||new y9,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:u1.normal};this.options.pedantic?(i.block=D1.pedantic,i.inline=u1.pedantic):this.options.gfm&&(i.block=D1.gfm,this.options.breaks?i.inline=u1.breaks:i.inline=u1.gfm),this.tokenizer.rules=i}static get rules(){return{block:D1,inline:u1}}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,` +`&&(N+=1),N>1)return!0;return!1});!V.loose&&p.length&&Z&&(V.loose=!0,V.items[o].loose=!0)}return V}}html(t){let i=this.rules.block.html.exec(t);if(i){let l={type:"html",raw:i[0],pre:!this.options.sanitizer&&(i[1]==="pre"||i[1]==="script"||i[1]==="style"),text:i[0]};if(this.options.sanitize){let r=this.options.sanitizer?this.options.sanitizer(i[0]):u0(i[0]);l.type="paragraph",l.text=r,l.tokens=this.lexer.inline(r)}return l}}def(t){let i=this.rules.block.def.exec(t);if(i)return i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),{type:"def",tag:i[1].toLowerCase().replace(/\s+/g," "),raw:i[0],href:i[2]?i[2].replace(this.rules.inline._escapes,"$1"):i[2],title:i[3]?i[3].replace(this.rules.inline._escapes,"$1"):i[3]}}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]):u0(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=bC(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||!r.href){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,h=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,i=i.slice(-1*t.length+a);(r=h.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 g=t.slice(0,a+r.index+(r[0].length-o.length)+n);if(Math.min(a,n)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}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=u0(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=u0(this.options.mangle?i(l[1]):l[1]),s="mailto:"+r):(r=u0(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=u0(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=u0(l[0]),l[1]==="www."?s="http://"+r:s=r}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]):u0(l[0]):l[0]:r=u0(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 *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:q7,lheading:/^([^\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=b2(D1.def).replace("label",D1._label).replace("title",D1._title).getRegex();D1.bullet=/(?:[*+-]|\d{1,9}[.)])/;D1.listItemStart=b2(/^( *)(bull) */).replace("bull",D1.bullet).getRegex();D1.list=b2(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=b2(D1.html,"i").replace("comment",D1._comment).replace("tag",D1._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();D1.paragraph=b2(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=b2(D1.blockquote).replace("paragraph",D1.paragraph).getRegex();D1.normal=d4({},D1);D1.gfm=d4({},D1.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});D1.gfm.table=b2(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=b2(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=d4({},D1.normal,{html:b2(`^ *(?: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:q7,paragraph:b2(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:q7,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:q7,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";d1.punctuation=b2(d1.punctuation).replace(/punctuation/g,d1._punctuation).getRegex();d1.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;d1.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;d1._comment=b2(D1._comment).replace("(?:-->|$)","-->").getRegex();d1.emStrong.lDelim=b2(d1.emStrong.lDelim).replace(/punct/g,d1._punctuation).getRegex();d1.emStrong.rDelimAst=b2(d1.emStrong.rDelimAst,"g").replace(/punct/g,d1._punctuation).getRegex();d1.emStrong.rDelimUnd=b2(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=b2(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=b2(d1.tag).replace("comment",d1._comment).replace("attribute",d1._attribute).getRegex();d1._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;d1._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;d1._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;d1.link=b2(d1.link).replace("label",d1._label).replace("href",d1._href).replace("title",d1._title).getRegex();d1.reflink=b2(d1.reflink).replace("label",d1._label).replace("ref",D1._label).getRegex();d1.nolink=b2(d1.nolink).replace("ref",D1._label).getRegex();d1.reflinkSearch=b2(d1.reflinkSearch,"g").replace("reflink",d1.reflink).replace("nolink",d1.nolink).getRegex();d1.normal=d4({},d1);d1.pedantic=d4({},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:b2(/^!?\[(label)\]\((.*?)\)/).replace("label",d1._label).getRegex(),reflink:b2(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",d1._label).getRegex()});d1.gfm=d4({},d1.normal,{escape:b2(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 K4=class e{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Y5,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: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,` `),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+=` @@ -22,7 +22,7 @@ import{A as Ao,B as O5,C as _5,D as c1,E as a5,F as k3,G as x9,H as T3,I as W5,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)+"["+Ke("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)+"["+Ke("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,je)){t=t.substring(l.raw.length),i.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(t,je))){t=t.substring(l.raw.length),i.push(l);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0,h=t.slice(1),g;this.options.extensions.startInline.forEach(function(m){g=m.call({lexer:this},h),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(s,dC)){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}},b9=class{constructor(t){this.options=t||U5}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$/,"")+` +`+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,h=t.slice(1),g;this.options.extensions.startInline.forEach(function(m){g=m.call({lexer:this},h),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(l=this.tokenizer.inlineText(s,SC)){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||Y5}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:u0(t,!0))+`
`:"
"+(l?t:u0(t,!0))+`
`}blockquote(t){return`
@@ -42,21 +42,21 @@ ${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=Ue(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r='",r}image(t,i,l){if(t=Ue(this.options.sanitize,this.options.baseUrl,t),t===null)return l;let r=`${l}":">",r}text(t){return t}},A7=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""}},I7=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)}},k4=class e{constructor(t){this.options=t||U5,this.options.renderer=this.options.renderer||new b9,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new A7,this.slugger=new I7}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,h,g,m,w,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),g+=this.renderer.listitem(V,p,d);l+=this.renderer.list(g,w,L);continue}case"html":{l+=this.renderer.html(m.text);continue}case"paragraph":{l+=this.renderer.paragraph(this.parseInline(m.tokens));continue}case"text":{for(g=m.tokens?this.parseInline(m.tokens):m.text;r+1{r(n.text,n.lang,function(C,c){if(C)return a(C);c!=null&&c!==n.text&&(n.text=c,n.escaped=!0),o--,o===0&&a()})},0))}),o===0&&a();return}function l(r){if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An error occurred:

"+u0(r.message+"",!0)+"
";throw r}try{let r=q4.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(O1.walkTokens(r,t.walkTokens)).then(()=>k4.parse(r,t)).catch(l);O1.walkTokens(r,t.walkTokens)}return k4.parse(r,t)}catch(r){l(r)}}O1.options=O1.setOptions=function(e){return L4(O1.defaults,e),iC(O1.defaults),O1};O1.getDefaults=Ye;O1.defaults=U5;O1.use=function(...e){let t=L4({},...e),i=O1.defaults.extensions||{renderers:{},childTokens:{}},l;e.forEach(r=>{if(r.extensions&&(l=!0,r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){let a=i.renderers?i.renderers[s.name]:null;a?i.renderers[s.name]=function(...o){let n=s.renderer.apply(this,o);return n===!1&&(n=a.apply(this,o)),n}:i.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");i[s.level]?i[s.level].unshift(s.tokenizer):i[s.level]=[s.tokenizer],s.start&&(s.level==="block"?i.startBlock?i.startBlock.push(s.start):i.startBlock=[s.start]:s.level==="inline"&&(i.startInline?i.startInline.push(s.start):i.startInline=[s.start]))}s.childTokens&&(i.childTokens[s.name]=s.childTokens)})),r.renderer){let s=O1.defaults.renderer||new b9;for(let a in r.renderer){let o=s[a];s[a]=(...n)=>{let C=r.renderer[a].apply(s,n);return C===!1&&(C=o.apply(s,n)),C}}t.renderer=s}if(r.tokenizer){let s=O1.defaults.tokenizer||new y9;for(let a in r.tokenizer){let o=s[a];s[a]=(...n)=>{let C=r.tokenizer[a].apply(s,n);return C===!1&&(C=o.apply(s,n)),C}}t.tokenizer=s}if(r.walkTokens){let s=O1.defaults.walkTokens;t.walkTokens=function(a){let o=[];return o.push(r.walkTokens.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}l&&(t.extensions=i),O1.setOptions(t)})};O1.walkTokens=function(e,t){let i=[];for(let l of e)switch(i=i.concat(t.call(O1,l)),l.type){case"table":{for(let r of l.header)i=i.concat(O1.walkTokens(r.tokens,t));for(let r of l.rows)for(let s of r)i=i.concat(O1.walkTokens(s.tokens,t));break}case"list":{i=i.concat(O1.walkTokens(l.items,t));break}default:O1.defaults.extensions&&O1.defaults.extensions.childTokens&&O1.defaults.extensions.childTokens[l.type]?O1.defaults.extensions.childTokens[l.type].forEach(function(r){i=i.concat(O1.walkTokens(l[r],t))}):l.tokens&&(i=i.concat(O1.walkTokens(l.tokens,t)))}return i};O1.parseInline=function(e,t){if(typeof e=="undefined"||e===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof e!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=L4({},O1.defaults,t||{}),Je(t);try{let i=q4.lexInline(e,t);return t.walkTokens&&O1.walkTokens(i,t.walkTokens),k4.parseInline(i,t)}catch(i){if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An error occurred:

"+u0(i.message+"",!0)+"
";throw i}};O1.Parser=k4;O1.parser=k4.parse;O1.Renderer=b9;O1.TextRenderer=A7;O1.Lexer=q4;O1.lexer=q4.lex;O1.Tokenizer=y9;O1.Slugger=I7;O1.parse=O1;var UV=O1.options,GV=O1.setOptions,KV=O1.use,XV=O1.walkTokens,jV=O1.parseInline;var YV=k4.parse,QV=q4.lex;var et=X2("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});var F9=class extends Q3.default.PureComponent{constructor(){super(...arguments);c2(this,"targetElement",null);c2(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=O1(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(),Q3.default.createElement(et,{ref:this.containerRefHook})}};var A0=F1(Y1(),1);var tt=X2("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),it=X2("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),lt=X2("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});var rt=0,$4=e=>{let w=e,{placeholder:t,value:i,onKeyDown:l,highlight:r,altNewline:s,validatedSelection:a}=w,o=o0(w,["placeholder","value","onKeyDown","highlight","altNewline","validatedSelection"]),{onChange:n,className:C}=o,c=A0.useRef(null),h=i!=null?i:"";d0(n!==void 0,"GrowingEntry must be a controlled input area");let[g]=A0.useState(()=>"input-box-"+(rt=(rt+1)%1e7));A0.useEffect(()=>{let L=c.current;if(L===null||L.disabled)return;let v=h.toString().length;L.focus(),L.setSelectionRange(r?0:v,v)},[]),A0.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 m=A0.useCallback(L=>{L.key==="Enter"&&L.shiftKey&&s===!0||l==null||l(L)},[s,l]);return A0.createElement(lt,{className:"gdg-growing-entry"},A0.createElement(it,{className:C},h+` -`),A0.createElement(tt,P(y({},o),{className:(C!=null?C:"")+" gdg-input",id:g,ref:c,onKeyDown:m,value:h,placeholder:t,dir:"auto"})))};var ct=F1(Y1(),1);var G5=new Map,K5=new Map,J3=new Map;function st(){G5.clear(),J3.clear(),K5.clear()}function uC(e,t,i,l,r){var s,a,o;let n=0,C={};for(let h of e)n+=(s=i.get(h))!=null?s:r,C[h]=((a=C[h])!=null?a:0)+1;let c=t-n;for(let h of Object.keys(C)){let g=C[h],m=(o=i.get(h))!=null?o:r,w=m*g/n,L=c*w*l/g,v=m+L;i.set(h,v)}}function vC(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 S9(e,t,i,l){var r,s;let a=K5.get(i);if(l&&a!==void 0&&a.count>2e4){let C=J3.get(i);if(C===void 0&&(C=vC(e,a.size),J3.set(i,C)),a.count>5e5){let h=0;for(let g of t)h+=(r=C.get(g))!=null?r:a.size;return h*1.01}let c=e.measureText(t);return uC(t,c.width,C,Math.max(.05,1-a.count/2e5),a.size),K5.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)K5.set(i,{count:t.length,size:n});else{let C=n-a.size,c=t.length/(a.count+t.length),h=a.size+C*c;K5.set(i,{count:a.count+t.length,size:h})}return o.width}function pC(e,t,i,l,r,s,a,o){if(t.length<=1)return t.length;if(ri;){let h=c!==void 0?0:t.lastIndexOf(" ",n-1);h>0?n=h:n--,C=S9(e,t.slice(0,Math.max(0,n)),l,a)}if(t[n]!==" "){let h=0;if(c===void 0)h=t.lastIndexOf(" ",n);else for(let g of c){if(g>n)break;h=g}h>0&&(n=h)}return n}function at(e,t,i,l,r,s){let a=`${t}_${i}_${l}px`,o=G5.get(a);if(o!==void 0)return o;if(l<=0)return[];let n=[],C=t.split(` -`),c=K5.get(i),h=c===void 0?t.length:l/c.size*1.5,g=r&&c!==void 0&&c.count>2e4;for(let m of C){let w=S9(e,m.slice(0,Math.max(0,h)),i,g),L=Math.min(m.length,h);if(w<=l)n.push(m);else{for(;w>l;){let v=pC(e,m,l,i,w,L,g,s),V=m.slice(0,Math.max(0,v));m=m.slice(V.length),n.push(V),w=S9(e,m.slice(0,Math.max(0,h)),i,g),L=Math.min(m.length,h)}w>0&&n.push(m)}}return n=n.map((m,w)=>w===0?m.trimEnd():m.trim()),G5.set(a,n),G5.size>500&&G5.delete(G5.keys().next().value),n}function mt(e,t){return ct.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 _7(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 gt(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)&&ot(e,t,s)&&r++;for(let a of i.current.rangeStack)ot(e,t,a)&&r++;return r}function Ht(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)=>P(y({},s),{sticky:e[a].sticky})),i=l}return i}function Z4(e,t){let i=0,l=Ht(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=h)return L}let g=s-C,m=e-(n!=null?n:0);if(typeof a=="number"){let w=Math.floor((m-c)/a)+o;return w>=g?void 0:w}else{let w=c;for(let L=o;L1e4&&(k9={},O7=0),s}function ut(e,t){let i=dt(e,void 0,"middle",t);return k9[i]}function x0(e,t){return typeof t!="string"&&(t=t.baseFontFull),fC(e,t)}function nt(e,t){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;let l=e.measureText(i);return e.restore(),l}var Ct=[];function fC(e,t){for(let s of Ct)if(s.key===t)return s.val;let i=nt(e,"alphabetic"),r=-(nt(e,"middle").actualBoundingBoxDescent-i.actualBoundingBoxDescent)+i.actualBoundingBoxAscent/2;return Ct.push({key:t,val:r}),r}function vt(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 EC(e,t,i,l,r,s,a,o,n,C){let c=o.baseFontFull,h=at(e,t,c,r-o.cellHorizontalPadding*2,C!=null?C:!1),g=e8(e,c),m=o.lineHeight*g,w=g+m*(h.length-1),L=w+o.cellVerticalPadding>s;L&&(e.save(),e.rect(i,l,r,s),e.clip());let v=l+s/2-w/2,V=Math.max(l+o.cellVerticalPadding,v);for(let u of h)if(pt(e,u,i,V,r,g,a,o,n),V+=m,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:h}=a;l=l!=null?l:!1,l||(t=ZC(t,c));let g=x0(s,o),m=$5(t)==="rtl";if(i===void 0&&m&&(i="right"),m&&(s.direction="rtl"),t.length>0){let w=!1;i==="right"?(s.textAlign="right",w=!0):i!==void 0&&i!=="left"&&(s.textAlign=i,w=!0),l?EC(s,t,n,C,c,h,g,o,i,r):pt(s,t,n,C,c,h,g,o,i),w&&(s.textAlign="start"),m&&(s.direction="inherit")}}function f0(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 Mt(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 t8(e,t,i){let l=function(o,n){let C=n.x-o.x,c=n.y-o.y,h=Math.sqrt(C*C+c*c),g=C/h,m=c/h;return{x:C,y:n.y-o.y,len:h,nx:g,ny:m,ang:Math.atan2(m,g)}},r,s=t.length,a=t[s-1];for(let o=0;o1?1:g),L=1,v=!1;m<0?w<0?w=Math.PI+w:(w=Math.PI-w,L=-1,v=!0):w>0&&(L=-1,v=!0),r=n.radius!==void 0?n.radius:i;let V=w/2,u=Math.abs(Math.cos(V)*r/Math.sin(V)),d;u>Math.min(c.len/2,h.len/2)?(u=Math.min(c.len/2,h.len/2),d=Math.abs(u*Math.sin(V)/Math.cos(V))):d=r;let p=n.x+h.nx*u,Z=n.y+h.ny*u;p+=-h.ny*d*L,Z+=h.nx*d*L,e.arc(p,Z,d,c.ang+Math.PI/2*L,h.ang-Math.PI/2*L,v),a=n,n=C}e.closePath()}function P9(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w){let L={x:0,y:s+C,width:0,height:0};if(e>=m.length||t>=c||t<-2||e<0)return L;let v=s-r;if(e>=h){let V=a>e?-1:1,u=Z4(m);L.x+=u+n;for(let d=a;d!==e;d+=V)L.x+=m[V===1?d:d-1].width*V}else for(let V=0;V0&&w5(m[V-1].group,u)&&m[V-1].sticky===d;){let Z=m[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-g){let V=c-t;for(L.y=l;V>0;){let u=t+V-1;L.height=typeof w=="number"?w:w(u),L.y-=L.height,V--}L.height+=1}else{let V=o>t?-1:1;if(typeof w=="number"){let u=t-o;L.y+=u*w}else for(let u=o;u!==t;u+=V)L.y+=w(u)*V;L.height=(typeof w=="number"?w:w(t))+1}return L}var i8=1<<21;function F0(e,t){return(t+2)*i8+e}function xt(e){return e%i8}function $7(e){return Math.floor(e/i8)-2}function X5(e){let t=xt(e),i=$7(e);return[t,i]}var D9=class{constructor(){c2(this,"visibleWindow",{x:0,y:0,width:0,height:0});c2(this,"freezeCols",0);c2(this,"freezeRows",[]);c2(this,"isInWindow",t=>{let i=xt(t),l=$7(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())}},q7=class extends D9{constructor(){super(...arguments);c2(this,"cache",new Map);c2(this,"setValue",(i,l)=>{this.cache.set(F0(i[0],i[1]),l)});c2(this,"getValue",i=>this.cache.get(F0(i[0],i[1])));c2(this,"clearOutOfWindow",()=>{for(let[i]of this.cache.entries())this.isInWindow(i)||this.cache.delete(i)})}};var R4=class{constructor(t=[]){c2(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($7(t)<0)return!0;return!1}hasItemInRectangle(t){for(let i=t.y;i{let m=NC(e,g[l],t,n);return C=Math.max(C,m),m});if(c.length>5&&o){C=0;let g=0;for(let w of c)g+=w;let m=g/c.length;for(let w=0;w=m*2?c[w]=0:C=Math.max(C,c[w])}C=Math.max(C,e.measureText(i.title).width+16+(i.icon===void 0?0:28));let h=Math.max(Math.ceil(s),Math.min(Math.floor(a),Math.ceil(C)));return P(y({},i),{width:h})}function ft(e,t,i,l,r,s,a,o,n){let C=O0.useRef(t),c=O0.useRef(i),h=O0.useRef(a);C.current=t,c.current=i,h.current=a;let[g,m]=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(()=>(g&&document.documentElement.append(g),()=>{g==null||g.remove()}),[g]);let w=O0.useRef({}),L=O0.useRef(),[v,V]=O0.useState();return O0.useLayoutEffect(()=>{let u=c.current;if(u===void 0||e.every(x9))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,S;typeof N=="object"?S=N:S=await T3(N),E!==void 0&&(typeof E=="object"?S=[...S,...E]:S=[...S,...await T3(E)]),L.current=e,V(S)})()},[n.signal,e]),O0.useMemo(()=>{var x;let d=e.every(x9)?e:m===null?e.map(N=>x9(N)?N:P(y({},N),{width:l8})):(m.font=h.current.baseFontFull,e.map((N,E)=>{if(x9(N))return N;if(w.current[N.id]!==void 0)return P(y({},N),{width:w.current[N.id]});if(v===void 0||L.current!==e||N.id===void 0)return P(y({},N),{width:l8});let S=r8(m,a,N,E,v,r,s,!0,o);return w.current[N.id]=S.width,S})),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,S=E;for(let k=0;k{let t=e.fgColor,i=e.bgColor;return` - ${P2}`},Oc=e=>{let t=e.fgColor,i=e.bgColor;return` - ${P2}`},_c=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`}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}},$7=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""}},U7=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)}},A4=class e{constructor(t){this.options=t||Y5,this.options.renderer=this.options.renderer||new P9,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new $7,this.slugger=new U7}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,h,g,m,w,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),g+=this.renderer.listitem(V,p,d);l+=this.renderer.list(g,w,L);continue}case"html":{l+=this.renderer.html(m.text);continue}case"paragraph":{l+=this.renderer.paragraph(this.parseInline(m.tokens));continue}case"text":{for(g=m.tokens?this.parseInline(m.tokens):m.text;r+1{r(n.text,n.lang,function(C,c){if(C)return a(C);c!=null&&c!==n.text&&(n.text=c,n.escaped=!0),o--,o===0&&a()})},0))}),o===0&&a();return}function l(r){if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An error occurred:

"+u0(r.message+"",!0)+"
";throw r}try{let r=K4.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(O1.walkTokens(r,t.walkTokens)).then(()=>A4.parse(r,t)).catch(l);O1.walkTokens(r,t.walkTokens)}return A4.parse(r,t)}catch(r){l(r)}}O1.options=O1.setOptions=function(e){return d4(O1.defaults,e),dC(O1.defaults),O1};O1.getDefaults=mt;O1.defaults=Y5;O1.use=function(...e){let t=d4({},...e),i=O1.defaults.extensions||{renderers:{},childTokens:{}},l;e.forEach(r=>{if(r.extensions&&(l=!0,r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){let a=i.renderers?i.renderers[s.name]:null;a?i.renderers[s.name]=function(...o){let n=s.renderer.apply(this,o);return n===!1&&(n=a.apply(this,o)),n}:i.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");i[s.level]?i[s.level].unshift(s.tokenizer):i[s.level]=[s.tokenizer],s.start&&(s.level==="block"?i.startBlock?i.startBlock.push(s.start):i.startBlock=[s.start]:s.level==="inline"&&(i.startInline?i.startInline.push(s.start):i.startInline=[s.start]))}s.childTokens&&(i.childTokens[s.name]=s.childTokens)})),r.renderer){let s=O1.defaults.renderer||new P9;for(let a in r.renderer){let o=s[a];s[a]=(...n)=>{let C=r.renderer[a].apply(s,n);return C===!1&&(C=o.apply(s,n)),C}}t.renderer=s}if(r.tokenizer){let s=O1.defaults.tokenizer||new T9;for(let a in r.tokenizer){let o=s[a];s[a]=(...n)=>{let C=r.tokenizer[a].apply(s,n);return C===!1&&(C=o.apply(s,n)),C}}t.tokenizer=s}if(r.walkTokens){let s=O1.defaults.walkTokens;t.walkTokens=function(a){let o=[];return o.push(r.walkTokens.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}l&&(t.extensions=i),O1.setOptions(t)})};O1.walkTokens=function(e,t){let i=[];for(let l of e)switch(i=i.concat(t.call(O1,l)),l.type){case"table":{for(let r of l.header)i=i.concat(O1.walkTokens(r.tokens,t));for(let r of l.rows)for(let s of r)i=i.concat(O1.walkTokens(s.tokens,t));break}case"list":{i=i.concat(O1.walkTokens(l.items,t));break}default:O1.defaults.extensions&&O1.defaults.extensions.childTokens&&O1.defaults.extensions.childTokens[l.type]?O1.defaults.extensions.childTokens[l.type].forEach(function(r){i=i.concat(O1.walkTokens(l[r],t))}):l.tokens&&(i=i.concat(O1.walkTokens(l.tokens,t)))}return i};O1.parseInline=function(e,t){if(typeof e=="undefined"||e===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof e!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=d4({},O1.defaults,t||{}),wt(t);try{let i=K4.lexInline(e,t);return t.walkTokens&&O1.walkTokens(i,t.walkTokens),A4.parseInline(i,t)}catch(i){if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An error occurred:

"+u0(i.message+"",!0)+"
";throw i}};O1.Parser=A4;O1.parser=A4.parse;O1.Renderer=P9;O1.TextRenderer=$7;O1.Lexer=K4;O1.lexer=K4.lex;O1.Tokenizer=T9;O1.Slugger=U7;O1.parse=O1;var id=O1.options,ld=O1.setOptions,rd=O1.use,sd=O1.walkTokens,ad=O1.parseInline;var od=A4.parse,nd=K4.lex;var gt=X2("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});var D9=class extends a8.default.PureComponent{constructor(){super(...arguments);C2(this,"targetElement",null);C2(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=O1(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(gt,{ref:this.containerRefHook})}};var A0=x1(k1(),1);var Ht=X2("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Lt=X2("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Vt=X2("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});var dt=0,X4=e=>{let w=e,{placeholder:t,value:i,onKeyDown:l,highlight:r,altNewline:s,validatedSelection:a}=w,o=s0(w,["placeholder","value","onKeyDown","highlight","altNewline","validatedSelection"]),{onChange:n,className:C}=o,c=A0.useRef(null),h=i!=null?i:"";d0(n!==void 0,"GrowingEntry must be a controlled input area");let[g]=A0.useState(()=>"input-box-"+(dt=(dt+1)%1e7));A0.useEffect(()=>{let L=c.current;if(L===null||L.disabled)return;let v=h.toString().length;L.focus(),L.setSelectionRange(r?0:v,v)},[]),A0.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 m=A0.useCallback(L=>{L.key==="Enter"&&L.shiftKey&&s===!0||l==null||l(L)},[s,l]);return A0.createElement(Vt,{className:"gdg-growing-entry"},A0.createElement(Lt,{className:C},h+` +`),A0.createElement(Ht,T(y({},o),{className:(C!=null?C:"")+" gdg-input",id:g,ref:c,onKeyDown:m,value:h,placeholder:t,dir:"auto"})))};var ft=x1(k1(),1);var Q5=new Map,J5=new Map,o8=new Map;function ut(){Q5.clear(),o8.clear(),J5.clear()}function kC(e,t,i,l,r){var s,a,o;let n=0,C={};for(let h of e)n+=(s=i.get(h))!=null?s:r,C[h]=((a=C[h])!=null?a:0)+1;let c=t-n;for(let h of Object.keys(C)){let g=C[h],m=(o=i.get(h))!=null?o:r,w=m*g/n,L=c*w*l/g,v=m+L;i.set(h,v)}}function TC(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 A9(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=TC(e,a.size),o8.set(i,C)),a.count>5e5){let h=0;for(let g of t)h+=(r=C.get(g))!=null?r:a.size;return h*1.01}let c=e.measureText(t);return kC(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),h=a.size+C*c;J5.set(i,{count:a.count+t.length,size:h})}return o.width}function PC(e,t,i,l,r,s,a,o){if(t.length<=1)return t.length;if(ri;){let h=c!==void 0?0:t.lastIndexOf(" ",n-1);h>0?n=h:n--,C=A9(e,t.slice(0,Math.max(0,n)),l,a)}if(t[n]!==" "){let h=0;if(c===void 0)h=t.lastIndexOf(" ",n);else for(let g of c){if(g>n)break;h=g}h>0&&(n=h)}return n}function vt(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),h=c===void 0?t.length:l/c.size*1.5,g=r&&c!==void 0&&c.count>2e4;for(let m of C){let w=A9(e,m.slice(0,Math.max(0,h)),i,g),L=Math.min(m.length,h);if(w<=l)n.push(m);else{for(;w>l;){let v=PC(e,m,l,i,w,L,g,s),V=m.slice(0,Math.max(0,v));m=m.slice(V.length),n.push(V),w=A9(e,m.slice(0,Math.max(0,h)),i,g),L=Math.min(m.length,h)}w>0&&n.push(m)}}return n=n.map((m,w)=>w===0?m.trimEnd():m.trim()),Q5.set(a,n),Q5.size>500&&Q5.delete(Q5.keys().next().value),n}function Zt(e,t){return ft.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 Rt(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)&&pt(e,t,s)&&r++;for(let a of i.current.rangeStack)pt(e,t,a)&&r++;return r}function Bt(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)=>T(y({},s),{sticky:e[a].sticky})),i=l}return i}function N4(e,t){let i=0,l=Bt(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=h)return L}let g=s-C,m=e-(n!=null?n:0);if(typeof a=="number"){let w=Math.floor((m-c)/a)+o;return w>=g?void 0:w}else{let w=c;for(let L=o;L1e4&&(I9={},G7=0),s}function Ft(e,t){let i=bt(e,void 0,"middle",t);return I9[i]}function x0(e,t){return typeof t!="string"&&(t=t.baseFontFull),IC(e,t)}function Mt(e,t){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;let l=e.measureText(i);return e.restore(),l}var xt=[];function IC(e,t){for(let s of xt)if(s.key===t)return s.val;let i=Mt(e,"alphabetic"),r=-(Mt(e,"middle").actualBoundingBoxDescent-i.actualBoundingBoxDescent)+i.actualBoundingBoxAscent/2;return xt.push({key:t,val:r}),r}function St(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 _C(e,t,i,l,r,s,a,o,n,C){let c=o.baseFontFull,h=vt(e,t,c,r-o.cellHorizontalPadding*2,C!=null?C:!1),g=n8(e,c),m=o.lineHeight*g,w=g+m*(h.length-1),L=w+o.cellVerticalPadding>s;L&&(e.save(),e.rect(i,l,r,s),e.clip());let v=l+s/2-w/2,V=Math.max(l+o.cellVerticalPadding,v);for(let u of h)if(kt(e,u,i,V,r,g,a,o,n),V+=m,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:h}=a;l=l!=null?l:!1,l||(t=OC(t,c));let g=x0(s,o),m=j5(t)==="rtl";if(i===void 0&&m&&(i="right"),m&&(s.direction="rtl"),t.length>0){let w=!1;i==="right"?(s.textAlign="right",w=!0):i!==void 0&&i!=="left"&&(s.textAlign=i,w=!0),l?_C(s,t,n,C,c,h,g,o,i,r):kt(s,t,n,C,c,h,g,o,i),w&&(s.textAlign="start"),m&&(s.direction="inherit")}}function f0(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 Tt(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,h=Math.sqrt(C*C+c*c),g=C/h,m=c/h;return{x:C,y:n.y-o.y,len:h,nx:g,ny:m,ang:Math.atan2(m,g)}},r,s=t.length,a=t[s-1];for(let o=0;o1?1:g),L=1,v=!1;m<0?w<0?w=Math.PI+w:(w=Math.PI-w,L=-1,v=!0):w>0&&(L=-1,v=!0),r=n.radius!==void 0?n.radius:i;let V=w/2,u=Math.abs(Math.cos(V)*r/Math.sin(V)),d;u>Math.min(c.len/2,h.len/2)?(u=Math.min(c.len/2,h.len/2),d=Math.abs(u*Math.sin(V)/Math.cos(V))):d=r;let p=n.x+h.nx*u,Z=n.y+h.ny*u;p+=-h.ny*d*L,Z+=h.nx*d*L,e.arc(p,Z,d,c.ang+Math.PI/2*L,h.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,h,g,m,w){let L={x:0,y:s+C,width:0,height:0};if(e>=m.length||t>=c||t<-2||e<0)return L;let v=s-r;if(e>=h){let V=a>e?-1:1,u=N4(m);L.x+=u+n;for(let d=a;d!==e;d+=V)L.x+=m[V===1?d:d-1].width*V}else for(let V=0;V0&&V5(m[V-1].group,u)&&m[V-1].sticky===d;){let Z=m[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-g){let V=c-t;for(L.y=l;V>0;){let u=t+V-1;L.height=typeof w=="number"?w:w(u),L.y-=L.height,V--}L.height+=1}else{let V=o>t?-1:1;if(typeof w=="number"){let u=t-o;L.y+=u*w}else for(let u=o;u!==t;u+=V)L.y+=w(u)*V;L.height=(typeof w=="number"?w:w(t))+1}return L}var c8=1<<21;function F0(e,t){return(t+2)*c8+e}function Pt(e){return e%c8}function Y7(e){return Math.floor(e/c8)-2}function e9(e){let t=Pt(e),i=Y7(e);return[t,i]}var W9=class{constructor(){C2(this,"visibleWindow",{x:0,y:0,width:0,height:0});C2(this,"freezeCols",0);C2(this,"freezeRows",[]);C2(this,"isInWindow",t=>{let i=Pt(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&&n5(this.freezeRows,l)||(this.visibleWindow=t,this.freezeCols=i,this.freezeRows=l,this.clearOutOfWindow())}},j7=class extends W9{constructor(){super(...arguments);C2(this,"cache",new Map);C2(this,"setValue",(i,l)=>{this.cache.set(F0(i[0],i[1]),l)});C2(this,"getValue",i=>this.cache.get(F0(i[0],i[1])));C2(this,"clearOutOfWindow",()=>{for(let[i]of this.cache.entries())this.isInWindow(i)||this.cache.delete(i)})}};var z4=class{constructor(t=[]){C2(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 m=WC(e,g[l],t,n);return C=Math.max(C,m),m});if(c.length>5&&o){C=0;let g=0;for(let w of c)g+=w;let m=g/c.length;for(let w=0;w=m*2?c[w]=0:C=Math.max(C,c[w])}C=Math.max(C,e.measureText(i.title).width+16+(i.icon===void 0?0:28));let h=Math.max(Math.ceil(s),Math.min(Math.floor(a),Math.ceil(C)));return T(y({},i),{width:h})}function Dt(e,t,i,l,r,s,a,o,n){let C=O0.useRef(t),c=O0.useRef(i),h=O0.useRef(a);C.current=t,c.current=i,h.current=a;let[g,m]=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(()=>(g&&document.documentElement.append(g),()=>{g==null||g.remove()}),[g]);let w=O0.useRef({}),L=O0.useRef(),[v,V]=O0.useState();return O0.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,S;typeof N=="object"?S=N:S=await q3(N),E!==void 0&&(typeof E=="object"?S=[...S,...E]:S=[...S,...await q3(E)]),L.current=e,V(S)})()},[n.signal,e]),O0.useMemo(()=>{var x;let d=e.every(R9)?e:m===null?e.map(N=>R9(N)?N:T(y({},N),{width:m8})):(m.font=h.current.baseFontFull,e.map((N,E)=>{if(R9(N))return N;if(w.current[N.id]!==void 0)return T(y({},N),{width:w.current[N.id]});if(v===void 0||L.current!==e||N.id===void 0)return T(y({},N),{width:m8});let S=h8(m,a,N,E,v,r,s,!0,o);return w.current[N.id]=S.width,S})),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,S=E;for(let k=0;k{let t=e.fgColor,i=e.bgColor;return` + ${P2}`},lm=e=>{let t=e.fgColor,i=e.bgColor;return` + ${P2}`},rm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} - `},Wc=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},sm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},qc=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`},am=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} An d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z" fill="${t}" /> -`},xi=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`},Pi=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} - `},$c=e=>{let t=e.bgColor;return`${P2} + `},om=e=>{let t=e.bgColor;return`${P2} -`},Uc=xi,Gc=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`},nm=Pi,Cm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},Kc=e=>{let t=e.fgColor,i=e.bgColor;return` +`},cm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} @@ -89,100 +89,100 @@ Please report this to https://github.com/markedjs/marked.`,t.silent)return"

An - `},Xc=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},mm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},jc=e=>{let t=e.fgColor,i=e.bgColor;return` +`},hm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},Yc=e=>{let t=e.fgColor,i=e.bgColor;return` + `},wm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},Qc=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},gm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},Jc=e=>{let t=e.fgColor,i=e.bgColor;return` +`},Hm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},em=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},Lm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},tm=e=>{let t=e.fgColor,i=e.bgColor;return` +`},Vm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},im=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},dm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},lm=e=>{let t=e.fgColor,i=e.bgColor;return` +`},um=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},rm=e=>{let t=e.fgColor,i=e.bgColor;return` + `},vm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},sm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},pm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},am=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`},Mm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},om=e=>{let t=e.fgColor,i=e.bgColor;return` +`},xm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},nm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},fm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},Cm=e=>{let t=e.fgColor,i=e.bgColor;return` +`},Zm=e=>{let t=e.fgColor,i=e.bgColor;return` ${P2} - `},cm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} + `},Em=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},mm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} +`},Nm=e=>{let t=e.fgColor,i=e.bgColor;return`${P2} -`},hm=e=>{let t=e.fgColor;return` +`},Rm=e=>{let t=e.fgColor;return` - `},wm=e=>{let t=e.fgColor;return` + `},Bm=e=>{let t=e.fgColor;return` -`},fi={headerRowID:Ic,headerNumber:_c,headerCode:Oc,headerString:Wc,headerBoolean:qc,headerAudioUri:Uc,headerVideoUri:Gc,headerEmoji:Kc,headerImage:Xc,headerUri:xi,headerPhone:jc,headerMarkdown:Yc,headerDate:Qc,headerTime:Jc,headerEmail:em,headerReference:tm,headerIfThenElse:im,headerSingleValue:lm,headerLookup:rm,headerTextTemplate:sm,headerMath:am,headerRollup:om,headerJoinStrings:nm,headerSplitString:Cm,headerGeoDistance:cm,headerArray:mm,rowOwnerOverlay:hm,protectedColumnOverlay:wm,renameIcon:$c};function gm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var X7=class{constructor(t,i){c2(this,"onSettled");c2(this,"spriteMap",new Map);c2(this,"headerIcons");c2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=gm(i,o),h=a*Math.ceil(window.devicePixelRatio),g=`${C}_${c}_${h}_${t}`,m=this.spriteMap.get(g);if(m===void 0){let w=this.headerIcons[t];if(w===void 0)return;m=document.createElement("canvas");let L=m.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w({fgColor:c,bgColor:C}))}`,this.spriteMap.set(g,m);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(m,0,0,h,h,r,s,a,a),n<1&&(l.globalAlpha=1)}};var q8=F1(A9(),1),us=F1(h8(),1);function j7(e){if(e.length===0)return;let t;for(let i of e)t=Math.min(t!=null?t:i.y,i.y)}function U4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,h=l-s,g=!1;for(;Co&&n(C,c,m,!1,a&&c===l-1)===!0){g=!0;break}C+=m,c++}if(!g){C=i;for(let m=0;m!w.sticky))==null?void 0:g.sourceIndex)!=null?m:0;if(n>h){let w=Math.max(o,h),L=t,v=l;for(let V=s.sourceIndex-1;V>=w;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(h>o){let w=Math.min(n,h-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<=w;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Zi(e,t,i,l){if(l==="any")return w8(e,{x:t,y:i,width:1,height:1});if(l==="vertical"&&(t=e.x),l==="horizontal"&&(i=e.y),_7([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 H5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function G4(e,t,i){return t>=e.x&&t<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function w8(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 Ei(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 Ni(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,h=e.y+e.height-o,g=n>0?e.x+Math.floor(n/l)*l:e.x,m=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,w=c>0?e.y+Math.floor(c/l)*l:e.y,L=h>0?e.y+e.height-Math.floor(h/l)*l:e.y+e.height;return{x:g,y:w,width:m-g,height:L-w}}function Ri(e,t,i,l,r){let[s,a,o,n]=t,[C,c,h,g]=r,{x:m,y:w,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=m+L,d=w+v,p=mo,x=w+v>n,N=m>=s&&ms&&u<=o||mo,E=w>=a&&wa&&d<=n||wn;if(N&&E){let k=Math.max(m,s),b=Math.max(w,a),D=Math.min(u,o),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:c,width:h-C+1,height:g-c+1}})}if(p&&Z){let k=m,b=w,D=Math.min(u,s),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let k=Math.max(m,s),b=w,D=Math.min(u,o),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:0,width:h-C+1,height:c+1}})}if(Z&&R){let k=Math.max(m,o),b=w,D=u,B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:0,width:i-h+1,height:c+1}})}if(p&&E){let k=m,b=Math.max(w,a),D=Math.min(u,s),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:c,width:C+1,height:g-c+1}})}if(R&&E){let k=Math.max(m,o),b=Math.max(w,a),D=u,B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:c,width:i-h+1,height:g-c+1}})}if(p&&x){let k=m,b=Math.max(w,n),D=Math.min(u,s),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:g,width:C+1,height:l-g+1}})}if(x&&N){let k=Math.max(m,s),b=Math.max(w,n),D=Math.min(u,o),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:g,width:h-C+1,height:l-g+1}})}if(R&&x){let k=Math.max(m,o),b=Math.max(w,n),D=u,B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:g,width:i-h+1,height:l-g+1}})}return V}var Hm={kind:c1.Loading,allowOverlay:!1};function L8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N,E,S,k,b,D,B,_,K,Q,m1){var e2;let g1=(e2=d==null?void 0:d.size)!=null?e2:Number.MAX_SAFE_INTEGER,w1=performance.now(),G=D.baseFontFull;e.font=G;let s1={ctx:e},o1=[0,0],R1=v>0?a4(n,v,C):0,J,I1,p1=j7(u);return _0(t,o,s,a,r,(H1,W1,E2,Z2,u2)=>{var H2;let y1=Math.max(0,Z2-W1),t2=W1+y1,w2=r+1,i2=H1.width-y1,a1=l-r-1;if(u.length>0){let t1=!1;for(let L1=0;L1{e.save(),e.beginPath(),e.rect(t2,w2,i2,a1),e.clip()},l2=p.columns.hasIndex(H1.sourceIndex),q1=h((H2=H1.group)!=null?H2:"").overrideTheme,S1=H1.themeOverride===void 0&&q1===void 0?D:r4(D,q1,H1.themeOverride),$1=S1.baseFontFull;$1!==G&&(G=$1,e.font=$1),T1();let U1;return U4(u2,E2,l,n,C,v,V,p1,(t1,L1,f1,b1,z2)=>{var Z0,o4,T0,m0;if(L1<0||(o1[0]=H1.sourceIndex,o1[1]=L1,d!==void 0&&!d.has(o1)))return;if(u.length>0){let B1=!1;for(let S2=0;S2l1.span!==void 0&&B1>=l1.span[0]&&B1<=l1.span[1]);Y2&&!w&&L?J2=0:Y2&&L&&(J2=Math.max(J2,1)),k0&&J2++,Y2||(n1&&J2++,l2&&!z2&&J2++);let C2=l1.kind===c1.Protected?c0.bgCellMedium:c0.bgCell,m2;if((b1||C2!==D.bgCell)&&(m2=y0(C2,m2)),J2>0||V1){V1&&(m2=y0(c0.bgHeader,m2));for(let B1=0;B1m1&&!Q2){let B1=c0.baseFontFull;B1!==G&&(e.font=B1,G=B1),U1=V8(e,l1,H1.sourceIndex,L1,A2,y2,M1,t1,Z1,f1,J2>0,c0,m2!=null?m2:c0.bgCell,x,N,(T0=F2==null?void 0:F2.hoverAmount)!=null?T0:0,S,b,w1,k,U1,B,_,K,Q)}return L2&&e.restore(),l1.style==="faded"&&(e.globalAlpha=1),g1--,R2&&(e.restore(),(m0=U1==null?void 0:U1.deprep)==null||m0.call(U1,s1),U1=void 0,T1(),G=$1,e.font=$1),g1<=0}),e.restore(),g1<=0}),J}var I9=[0,0],O9={x:0,y:0,width:0,height:0},g8=[void 0,()=>{}],H8=!1;function Lm(){H8=!0}function V8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N){var _,K;let E,S;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],S=v[1][1]);let k;I9[0]=i,I9[1]=l,O9.x=a,O9.y=o,O9.width=n,O9.height=C,g8[0]=R.getValue(I9),g8[1]=Q=>R.setValue(I9,Q),H8=!1;let b={ctx:e,theme:h,col:i,row:l,cell:t,rect:O9,highlighted:c,cellFillColor:g,hoverAmount:L,frameTime:u,hoverX:E,drawState:g8,hoverY:S,imageLoader:m,spriteManager:w,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:Lm},D=vt(b,t.lastUpdated,u,p,r,s),B=x(t);if(B!==void 0){(p==null?void 0:p.renderer)!==B&&((_=p==null?void 0:p.deprep)==null||_.call(p,b),p=void 0);let Q=(K=B.drawPrep)==null?void 0:K.call(B,b,p);d!==void 0&&!F4(b.cell)?d(b,()=>B.draw(b,t)):B.draw(b,t),k=Q===void 0?void 0:{deprep:Q==null?void 0:Q.deprep,fillStyle:Q==null?void 0:Q.fillStyle,font:Q==null?void 0:Q.font,renderer:B}}return(D||H8)&&(Z==null||Z(I9)),k}function j5(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,h="center",g="square"){var p;let m=Math.floor(r+a/2),w=g==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=F7(c,a,t.cellVerticalPadding),v=L/2,V=b7(h,l,s,t.cellHorizontalPadding,L),u=y7(V,m,L),d=S7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),g==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,m-v+L/1.97),e.lineTo(V-v+L/2.42,m-v+L/1.44),e.lineTo(V-v+L/1.29,m-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case O5:case!1:{e.beginPath(),f0(e,V-L/2+.5,m-L/2+.5,L-1,L-1,w),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case _5:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),g==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,m),e.lineTo(V+L/3,m),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:l5(i)}}function zi(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=h.headerFontFull;e.font=R,_0(t,0,s,0,d,(N,E,S,k)=>{var o1,R1,J;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let b=Math.max(0,k-E);e.save(),e.beginPath(),e.rect(E+b,o,N.width-b,a),e.clip();let D=L((o1=N.group)!=null?o1:"").overrideTheme,B=N.themeOverride===void 0&&D===void 0?h:r4(h,D,N.themeOverride);B.bgHeader!==h.bgHeader&&(e.fillStyle=B.bgHeader,e.fill()),B!==h&&(e.font=B.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),K=n!==void 0||C,Q=!K&&Z===-1&&p===N.sourceIndex,m1=K?0:(J=(R1=m.find(I1=>I1.item[0]===N.sourceIndex&&I1.item[1]===-1))==null?void 0:R1.hoverAmount)!=null?J:0,g1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,w1=_?B.accentColor:g1?B.bgHeaderHasFocus:B.bgHeader,G=i?o:0,s1=N.sourceIndex===0?0:1;_?(e.fillStyle=w1,e.fillRect(E+s1,G,N.width-s1,a)):(g1||m1>0)&&(e.beginPath(),e.rect(E+s1,G,N.width-s1,a),g1&&(e.fillStyle=B.bgHeaderHasFocus,e.fill()),m1>0&&(e.globalAlpha=m1,e.fillStyle=B.bgHeaderHovered,e.fill(),e.globalAlpha=1)),v8(e,E,G,N.width,a,N,_,B,Q,g1,m1,g,V,u),e.restore()}),i&&Vm(e,t,r,s,o,l,h,g,m,w,L,v)}function Vm(e,t,i,l,r,s,a,o,n,C,c,h){var v;let[m,w]=(v=s==null?void 0:s[0])!=null?v:[],L=0;Y7(t,i,l,r,(V,u,d,p,Z,R)=>{var k,b;if(h!==void 0&&!h.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=w===-2&&m!==void 0&&m>=V[0]&&m<=V[1],S=E?N.bgHeaderHovered:N.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=(k=N.textGroupHeader)!=null?k:N.textHeader,x!==void 0){let D=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,D+8,(r-20)/2,20,N),D+=26),e.fillText(x.name,D+8,r/2+x0(e,a.headerFontFull)),x.actions!==void 0&&E){let B=u8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=B[0].x-10,K=d+Z-_;e.rect(_,0,K,r);let Q=e.createLinearGradient(_,0,_+K,0),m1=z0(S,0);Q.addColorStop(0,m1),Q.addColorStop(10/K,S),Q.addColorStop(1,S),e.fillStyle=Q,e.fill(),e.globalAlpha=.6;let[g1,w1]=(b=s==null?void 0:s[1])!=null?b:[-1,-1];for(let G=0;G35){let p=g?35:l-35,Z=g?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(g?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(g?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(g&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+x0(e,o.headerFontFull)),g&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===k3.Triangle){e.beginPath();let d=m.x+m.width/2-5.5,p=m.y+m.height/2-3;t8(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===k3.Dots){e.beginPath();let d=m.x+m.width/2,p=m.y+m.height/2;Mt(e,d,p),e.fillStyle=L,e.fill()}else{let d=m.x+(m.width-o.headerIconSize)/2,p=m.y+(m.height-o.headerIconSize)/2;c.drawSprite(s.menuIcon,"normal",e,d,p,o.headerIconSize,o)}}function v8(e,t,i,l,r,s,a,o,n,C,c,h,g,m){let w=$5(s.title)==="rtl",L=d8(t,i,l,r,w);g!==void 0?g({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:h,menuBounds:L},()=>Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)):Bi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)}var ns=F1(os(),1);function Cs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){if(V!==void 0||t[t.length-1]!==i[t.length-1])return;let d=j7(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(),U4(N,R,r,C,c,w,L,d,(S,k,b,D)=>{if(!D&&v.length>0&&!v.some(m1=>H5(Z,S,1e4,b,m1.x,m1.y,m1.width,m1.height)))return;let B=g.hasIndex(k),_=m.hasIndex(k);e.beginPath();let K=h==null?void 0:h(k),Q=K===void 0?u:r4(u,K);Q.bgCell!==u.bgCell&&(e.fillStyle=Q.bgCell,e.fillRect(Z,S,1e4,b)),_&&(e.fillStyle=Q.bgHeader,e.fillRect(Z,S,1e4,b)),B&&(e.fillStyle=Q.accentLight,e.fillRect(Z,S,1e4,b))}),e.restore())})}function cs(e,t,i,l,r,s,a,o,n){var w;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(w=n.horizontalBorderColor)!=null?w:n.borderColor,h=n.borderColor,g=C?Z4(t):0,m;if(g!==0&&(m=P3(h,n.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,l),e.strokeStyle=m,e.stroke()),r>0){let L=h===c&&m!==void 0?m:P3(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 ms=(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 hs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w){var b;let L=w.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=ms(o,s,a),p=[],Z=a-a4(m,g,C),R=n,x=i,N=0;for(;R+r=u&&D<=d-1){let _=c==null?void 0:c(x),K=_==null?void 0:_.bgCell;K!==void 0&&K!==L&&x>=m-g&&p.push({x:v,y:D,w:V-v,h:B,color:K})}R+=B,x0)for(let D=0;D=v&&_<=V&&h(D+1)&&p.push({x:_,y:N,w:B.width,h:S,color:K}),E+=B.width}if(p.length===0)return;let k;e.beginPath();for(let D=p.length-1;D>=0;D--){let B=p[D];k===void 0?k=B.color:B.color!==k&&(e.fillStyle=k,e.fill(),e.beginPath(),k=B.color),e.rect(B.x,B.y,B.w,B.h)}k!==void 0&&(e.fillStyle=k,e.fill()),e.beginPath()}function P8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V=!1){var b,D,B;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}=ms(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&Q<=Z&&m(_+1)&&N.push({x1:Q,y1:Math.max(C,R),x2:Q,y2:Math.min(a,x),color:d})}let S=a+.5;for(let _=L-w;_=R&&m1<=x-1){let g1=g==null?void 0:g(K);N.push({x1:p,y1:m1,x2:Z,y2:m1,color:(B=(D=g1==null?void 0:g1.horizontalBorderColor)!=null?D:g1==null?void 0:g1.borderColor)!=null?B:u})}_+=h(K),K++}}let k=(0,ns.default)(N,_=>_.color);for(let _ of Object.keys(k)){e.strokeStyle=_;for(let K of k[_])e.moveTo(K.x1,K.y1),e.lineTo(K.x2,K.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function ws(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,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 B=p;Br.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let B=x;Br.cellXOffset&&(E=-E),E+=o-r.translateX;let S=Z4(v);if(E!==0&&R!==0)return{regions:[]};let k=C>0?a4(g,C,V):0,b=c-S-Math.abs(E),D=h-m-k-Math.abs(R)-1;if(b>150&&D>150){let B={sx:0,sy:0,sw:c*w,sh:h*w,dx:0,dy:0,dw:c*w,dh:h*w};if(R>0?(B.sy=(m+1)*w,B.sh=D*w,B.dy=(R+m+1)*w,B.dh=D*w,d.push({x:0,y:m,width:c,height:R+1})):R<0&&(B.sy=(-R+m+1)*w,B.sh=D*w,B.dy=(m+1)*w,B.dh=D*w,d.push({x:0,y:h+R-k,width:c,height:-R+k})),E>0?(B.sx=S*w,B.sw=b*w,B.dx=(E+S)*w,B.dw=b*w,d.push({x:S-1,y:0,width:E+2,height:h})):E<0&&(B.sx=(S-E)*w,B.sw=b*w,B.dx=S*w,B.dw=b*w,d.push({x:c+E,y:0,width:-E,height:h})),e.setTransform(1,0,0,1,0,0),u){if(S>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=S*w,K=h*w;e.drawImage(t,0,0,_,K,0,0,_,K)}if(k>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(h-k)*w,K=c*w,Q=k*w;e.drawImage(t,0,_,K,Q,0,_,K,Q)}}e.drawImage(t,B.sx,B.sy,B.sw,B.sh,B.dx,B.dy,B.dw,B.dh),e.scale(w,w)}return e.imageSmoothingEnabled=!0,{regions:d}}function gs(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,(h,g,m,w)=>{if(h.sourceIndex===C){let L=Math.max(g,w)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function Hs(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=Z4(o),u=a4(m,g,h),d=[n,0,o.length,m-g],p=[V,0,t,i-u],Z=v.map(x=>{var S;let N=x.range,E=(S=x.style)!=null?S:"dashed";return Ri(N,d,t,i,p).map(k=>{let b=k.rect,D=P9(b.x,b.y,t,i,c,C+c,l,r,s,a,m,n,g,o,h),B=b.width===1&&b.height===1?D:P9(b.x+b.width-1,b.y+b.height-1,t,i,c,C+c,l,r,s,a,m,n,g,o,h);return b.x+b.width>=o.length&&(B.width-=1),b.y+b.height>=m&&(B.height-=1),{color:x.color,style:E,clip:k.clip,rect:Ni({x:D.x,y:D.y,width:B.x+B.width-D.x,height:B.y+B.height-D.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&&H5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let S=x,k=!Ei(E.clip,E.rect);k&&(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),k&&(e.restore(),x=S)}x&&e.setLineDash([])};return R(),R}function A8(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 t3(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v){var B;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=g(c.current.cell),N=(B=x.span)!=null?B:[Z,Z],E=R>=v-m,S=m>0&&!E?a4(v,m,h)-1:0,k=d[1],b;if(_0(a,l,r,s,C,(_,K,Q,m1,g1)=>{if(_.sticky&&Z>_.sourceIndex)return;let w1=_.sourceIndexN[1],s1=_.sourceIndex===d[0];if(!(!s1&&(w1||G)))return U4(g1,Q,i,v,h,m,w,void 0,(o1,R1,J)=>{if(R1!==R&&R1!==k)return;let I1=K,p1=_.width;if(x.span!==void 0){let H1=Q7(x.span,K,o1,_.width,J,_,o),W1=_.sticky?H1[0]:H1[1];W1!==void 0&&(I1=W1.x,p1=W1.width)}return R1===k&&s1&&L&&(b=()=>{var H1,W1;m1>I1&&!_.sticky&&(e.beginPath(),e.rect(m1,0,t-m1,i),e.clip()),e.beginPath(),e.rect(I1+p1-4,o1+J-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 D=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-S),e.clip(),b==null||b(),e.restore()};return D(),D}function RH(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),Y7(t,i,s,l,(C,c,h,g,m,w)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(h,g,m,w)}),_0(t,o,s,a,r,(C,c,h,g)=>{let m=Math.max(0,g-c),w=c+m+1,L=C.width-m-1;n.has([C.sourceIndex,-1])&&e.rect(w,l,L,r-l)}),e.clip())}function BH(e,t,i,l,r,s,a,o,n,C){let c=0;return _0(e,s,l,r,i,(h,g,m,w,L)=>(U4(L,m,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function I8(e,t){var C2,m2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:h,freezeColumns:g,dragAndDropState:m,theme:w,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:S,getCellContent:k,getGroupDetails:b,getRowThemeOverride:D,isFocused:B,drawHeaderCallback:_,prelightCells:K,drawCellCallback:Q,highlightRegions:m1,resizeCol:g1,imageLoader:w1,lastBlitData:G,hoverValues:s1,hyperWrapping:o1,hoverInfo:R1,spriteManager:J,maxScaleFactor:I1,hasAppendRow:p1,touchMode:e2,enqueue:H1,renderStateProvider:W1,getCellRenderer:E2,renderStrategy:Z2,bufferACtx:u2,bufferBCtx:y1,damage:t2,minimumCellWidth:w2}=e;if(r===0||s===0)return;let i2=Z2==="double-buffer",a1=Math.min(I1,Math.ceil((C2=window.devicePixelRatio)!=null?C2:1)),T1=Z2!=="direct"&&Hs(e,t),l2=i.canvas;(l2.width!==r*a1||l2.height!==s*a1)&&(l2.width=r*a1,l2.height=s*a1,l2.style.width=r+"px",l2.style.height=s+"px");let q1=l.canvas,S1=h?V+v:v,$1=S1+1;(q1.width!==r*a1||q1.height!==$1*a1)&&(q1.width=r*a1,q1.height=$1*a1,q1.style.width=r+"px",q1.style.height=$1+"px");let U1=u2.canvas,H2=y1.canvas;i2&&(U1.width!==r*a1||U1.height!==s*a1)&&(U1.width=r*a1,U1.height=s*a1,G.current!==void 0&&(G.current.aBufferScroll=void 0)),i2&&(H2.width!==r*a1||H2.height!==s*a1)&&(H2.width=r*a1,H2.height=s*a1,G.current!==void 0&&(G.current.bBufferScroll=void 0));let t1=G.current;if(T1===!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;i2&&(L1=i);let f1=l,b1;i2?t2!==void 0?b1=(t1==null?void 0:t1.lastBuffer)==="b"?y1:u2:b1=(t1==null?void 0:t1.lastBuffer)==="b"?u2:y1:b1=i;let z2=b1.canvas,n1=i2?z2===U1?H2:U1:l2,V1=typeof d=="number"?()=>d:d;f1.save(),b1.save(),f1.beginPath(),b1.beginPath(),f1.textBaseline="middle",b1.textBaseline="middle",a1!==1&&(f1.scale(a1,a1),b1.scale(a1,a1));let l1=T9(c,a,r,m,n),M1=[],Z1=L&&((m2=x.current)==null?void 0:m2.cell[1])===o&&C===0,R2=!1;if(m1!==void 0){for(let L2 of m1)if(L2.style!=="no-outline"&&L2.range.y===o&&C===0){R2=!0;break}}let Q2=()=>{var L2,A2;zi(f1,l1,h,R1,r,n,v,V,m,R,x,w,J,s1,p,b,t2,_,e2),P8(f1,l1,o,n,C,r,s,void 0,void 0,V,S1,V1,D,p,E,S,w,!0),f1.beginPath(),f1.moveTo(0,$1-.5),f1.lineTo(r,$1-.5),f1.strokeStyle=y0((A2=(L2=w.headerBottomBorderColor)!=null?L2:w.horizontalBorderColor)!=null?A2:w.borderColor,w.bgHeader),f1.stroke(),R2&&D8(f1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),Z1&&t3(f1,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S)};if(t2!==void 0){let L2=l1[l1.length-1].sourceIndex+1,A2=t2.hasItemInRegion([{x:a,y:-2,width:L2,height:2},{x:a,y:o,width:L2,height:300},{x:0,y:o,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:S-E,width:L2,height:E,when:E>0}]),y2=F2=>{L8(F2,l1,c,s,S1,n,C,o,S,V1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);let Z0=x.current;N&&L&&Z0!==void 0&&t2.has(W7(Z0.range))&&t3(F2,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S)};A2&&(y2(b1),L1!==null&&(L1.save(),L1.scale(a1,a1),L1.textBaseline="middle",y2(L1),L1.restore()),t2.hasHeader()&&(RH(f1,l1,r,V,S1,n,C,o,t2),Q2())),b1.restore(),f1.restore();return}if((T1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||Z1!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||R2!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&Q2(),T1===!0){d0(n1!==void 0&&t1!==void 0);let{regions:L2}=ws(b1,n1,n1===U1?t1.aBufferScroll:t1.bBufferScroll,n1===U1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,S,S1,a1,c,l1,d,i2);M1=L2}else T1!==!1&&(d0(t1!==void 0),M1=gs(t1,a,o,n,C,r,s,S1,l1,T1));cs(b1,l1,r,s,E,S,p,V1,w);let e0=D8(b1,r,s,a,o,n,C,c,g,v,V,d,E,S,m1,w),t0=L?t3(b1,r,s,o,n,C,l1,c,w,S1,x,V1,k,E,p1,N,S):void 0;if(b1.fillStyle=w.bgCell,M1.length>0){b1.beginPath();for(let L2 of M1)b1.rect(L2.x,L2.y,L2.width,L2.height);b1.clip(),b1.fill(),b1.beginPath()}else b1.fillRect(0,0,r,s);let c0=L8(b1,l1,c,s,S1,n,C,o,S,V1,k,b,D,u,B,L,E,p1,M1,t2,x,K,m1,w1,J,s1,R1,Q,o1,w,H1,W1,E2,Z,w2);Cs(b1,l1,c,r,s,S1,n,C,o,S,V1,D,x.rows,u,E,p1,M1,t2,w),hs(b1,l1,o,n,C,r,s,M1,S1,V1,D,p,E,S,w),P8(b1,l1,o,n,C,r,s,M1,c0,V,S1,V1,D,p,E,S,w),e0==null||e0(),t0==null||t0(),R&&_0(l1,0,n,0,S1,(L2,A2)=>{var y2,F2;return L2.sourceIndex===g1?(A8(f1,A2+L2.width,0,S1+1,y0((y2=w.resizeIndicatorColor)!=null?y2:w.accentLight,w.bgHeader)),A8(b1,A2+L2.width,S1,s,y0((F2=w.resizeIndicatorColor)!=null?F2:w.accentLight,w.bgCell)),!0):!1}),L1!==null&&(L1.fillStyle=w.bgCell,L1.fillRect(0,0,r,s),L1.drawImage(b1.canvas,0,0));let Y2=BH(l1,s,S1,n,C,o,S,V1,E,p1);w1==null||w1.setWindow({x:a,y:o,width:l1.length,height:Y2-o},g,Array.from({length:E},(L2,A2)=>S-1-A2));let J2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),k0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);G.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:Z1,mustDrawHighlightRingsOnHeader:R2,lastBuffer:i2?z2===U1?"a":"b":void 0,aBufferScroll:z2===U1?[J2,k0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:z2===H2?[J2,k0]:t1==null?void 0:t1.bBufferScroll},b1.restore(),f1.restore()}var O8=F1(A9(),1);var zH=80;function yH(e){let t=e-1;return t*t*t+1}var i3=class{constructor(t){c2(this,"callback");c2(this,"currentHoveredItem");c2(this,"leavingItems",[]);c2(this,"lastAnimationTime");c2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>g5(l.item,t.item))||this.leavingItems.push(t)});c2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>g5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});c2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});c2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});c2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>P(y({},t),{hoverAmount:yH(t.hoverAmount)})));c2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/zH;for(let s of this.leavingItems)s.hoverAmount=(0,O8.default)(s.hoverAmount-l,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=(0,O8.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});c2(this,"setHovered",t=>{var i;if(!g5((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 _8=class{constructor(t){c2(this,"fn");c2(this,"val");this.fn=t}get value(){var t;return(t=this.val)!=null?t:this.val=this.fn()}};function W8(e){return new _8(e)}var Ls=W8(()=>window.navigator.userAgent.includes("Firefox")),i9=W8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),V5=W8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var d5=F1(Y1(),1);function Vs(e){let t=d5.useRef([]),i=d5.useRef(0),l=d5.useRef(e);l.current=e;let r=d5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(X5);t.current=[],l.current(new R4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return d5.useCallback(s=>{t.current.length===0&&r();let a=F0(s[0],s[1]);t.current.includes(a)||t.current.push(a)},[r])}var B4="header",S0="group-header",l9="out-of-bounds",u5;(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"})(u5||(u5={}));function l3(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 ds=6,bH=(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:""},FH=(e,t)=>{var m4,g0,H0,i0,h0,S5,i7,g9,L0,N0;let{width:i,height:l,accessibilityHeight:r,columns:s,cellXOffset:a,cellYOffset:o,headerHeight:n,fillHandle:C=!1,groupHeaderHeight:c,rowHeight:h,rows:g,getCellContent:m,getRowThemeOverride:w,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:S=!0,drawFocusRing:k,onMouseDown:b,onMouseUp:D,onMouseMoveRaw:B,onMouseMove:_,onItemHovered:K,dragAndDropState:Q,firstColAccessible:m1,onKeyDown:g1,onKeyUp:w1,highlightRegions:G,canvasRef:s1,onDragStart:o1,onDragEnd:R1,eventTargetRef:J,isResizing:I1,resizeColumn:p1,isDragging:e2,isDraggable:H1=!1,allowResize:W1,disabledRows:E2,hasAppendRow:Z2,getGroupDetails:u2,theme:y1,prelightCells:t2,headerIcons:w2,verticalBorder:i2,drawCell:a1,drawHeader:T1,onCellFocused:l2,onDragOverCell:q1,onDrop:S1,onDragLeave:$1,imageWindowLoader:U1,smoothScrollX:H2=!1,smoothScrollY:t1=!1,experimental:L1,getCellRenderer:f1}=e,b1=(m4=e.translateX)!=null?m4:0,z2=(g0=e.translateY)!=null?g0:0,n1=Math.max(R,Math.min(s.length-1,a)),V1=e1.useRef(null),l1=U1,M1=e1.useRef(),[Z1,R2]=e1.useState(!1),Q2=e1.useRef([]),e0=e1.useRef(),[t0,c0]=e1.useState(),[Y2,J2]=e1.useState(),k0=e1.useRef(null),[C2,m2]=e1.useState(),[L2,A2]=e1.useState(!1),y2=e1.useRef(L2);y2.current=L2;let F2=e1.useMemo(()=>new X7(w2,()=>{p4.current=void 0,j4.current()}),[w2]),Z0=v?c+n:n,o4=e1.useRef(-1),T0=((H0=L1==null?void 0:L1.enableFirefoxRescaling)!=null?H0:!1)&&Ls.value,m0=((i0=L1==null?void 0:L1.enableSafariRescaling)!=null?i0:!1)&&i9.value;e1.useLayoutEffect(()=>{window.devicePixelRatio===1||!T0&&!m0||(o4.current!==-1&&R2(!0),window.clearTimeout(o4.current),o4.current=window.setTimeout(()=>{R2(!1),o4.current=-1},200))},[o,n1,b1,z2,T0,m0]);let B1=mt(s,R),S2=E?Z4(B1,Q):0,X1=e1.useCallback((z,j,x1)=>{let v1=z.getBoundingClientRect();if(j>=B1.length||x1>=g)return;let C1=v1.width/i,Y=P9(j,x1,i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h);return C1!==1&&(Y.x*=C1,Y.y*=C1,Y.width*=C1,Y.height*=C1),Y.x+=v1.x,Y.y+=v1.y,Y},[i,l,c,Z0,n1,o,b1,z2,g,R,N,B1,h]),N2=e1.useCallback((z,j,x1,v1)=>{var O2,V0;let C1=z.getBoundingClientRect(),Y=C1.width/i,_1=(j-C1.left)/Y,K1=(x1-C1.top)/Y,h1=5,q2=T9(B1,n1,i,void 0,b1),r2=0,G1=0;v1 instanceof MouseEvent&&(r2=v1.button,G1=v1.buttons);let d2=Lt(_1,q2,b1),Q1=Vt(K1,l,v,n,c,g,h,o,z2,N),k2=(v1==null?void 0:v1.shiftKey)===!0,l0=(v1==null?void 0:v1.ctrlKey)===!0,K0=(v1==null?void 0:v1.metaKey)===!0,$2=v1!==void 0&&!(v1 instanceof MouseEvent)||(v1==null?void 0:v1.pointerType)==="touch",U2=[_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,M0=v2*2,e4=J0*2;v2===0&&(M0=d2===-1?u5.EndPadding:u5.Center),J0===0&&(e4=Q1===void 0?u5.EndPadding:u5.Center);let X0=!1;if(d2===-1&&Q1===-1){let Q4=X1(z,B1.length-1,-1);d0(Q4!==void 0),X0=ji&&_1l&&K1=0?(J0=!0,v2=X1(z,M0,Q1),d0(v2!==void 0),I2={kind:v&&Q1===-2?S0:B4,location:[M0,Q1],bounds:v2,group:(O2=B1[M0].group)!=null?O2:"",isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}):I2={kind:v&&Q1===-2?S0:B4,group:(V0=B1[d2].group)!=null?V0:"",location:[d2,Q1],bounds:v2,isEdge:J0,shiftKey:k2,ctrlKey:l0,metaKey:K0,isTouch:$2,localEventX:j-v2.x,localEventY:x1-v2.y,button:r2,buttons:G1,scrollEdge:U2}}else{let v2=X1(z,d2,Q1);d0(v2!==void 0);let J0=v2!==void 0&&v2.x+v2.width-j{}),v4=e1.useRef(t0);v4.current=t0;let[P0,q0]=e1.useMemo(()=>{let z=document.createElement("canvas"),j=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",j.style.display="none",j.style.opacity="0",j.style.position="fixed",[z.getContext("2d",{alpha:!1}),j.getContext("2d",{alpha:!1})]},[]);e1.useLayoutEffect(()=>{if(!(P0===null||q0===null))return document.documentElement.append(P0.canvas),document.documentElement.append(q0.canvas),()=>{P0.canvas.remove(),q0.canvas.remove()}},[P0,q0]);let z4=e1.useMemo(()=>new q7,[]),K9=T0&&Z1?1:m0&&Z1?2:5,X9=(L1==null?void 0:L1.disableMinimumCellWidth)===!0?1:10,p4=e1.useRef(),f5=e1.useRef(null),Z5=e1.useRef(null),E5=e1.useCallback(()=>{var _1,K1,h1;let z=V1.current,j=k0.current;if(z===null||j===null||(f5.current===null&&(f5.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),Z5.current===null&&(Z5.current=j.getContext("2d",{alpha:!1}),j.width=0,j.height=0),f5.current===null||Z5.current===null||P0===null||q0===null))return;let x1=!1,v1=q2=>{x1=!0,m2(q2)},C1=p4.current,Y={headerCanvasCtx:Z5.current,canvasCtx:f5.current,bufferACtx:P0,bufferBCtx:q0,width:i,height:l,cellXOffset:n1,cellYOffset:o,translateX:Math.round(b1),translateY:Math.round(z2),mappedColumns:B1,enableGroups:v,freezeColumns:R,dragAndDropState:Q,theme:y1,headerHeight:n,groupHeaderHeight:c,disabledRows:E2!=null?E2:x2.empty(),rowHeight:h,verticalBorder:i2,isResizing:I1,resizeCol:p1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:a1,hasAppendRow:Z2,overrideCursor:v1,maxScaleFactor:K9,freezeTrailingRows:N,rows:g,drawFocus:k,getCellContent:m,getGroupDetails:u2!=null?u2:q2=>({name:q2}),getRowThemeOverride:w,drawHeaderCallback:T1,prelightCells:t2,highlightRegions:G,imageLoader:l1,lastBlitData:e0,damage:M1.current,hoverValues:Q2.current,hoverInfo:v4.current,spriteManager:F2,scrolling:Z1,hyperWrapping:(_1=L1==null?void 0:L1.hyperWrapping)!=null?_1:!1,touchMode:L2,enqueue:Q0.current,renderStateProvider:z4,renderStrategy:(K1=L1==null?void 0:L1.renderStrategy)!=null?K1:i9.value?"double-buffer":"single-buffer",getCellRenderer:f1,minimumCellWidth:X9};Y.damage===void 0?(p4.current=Y,I8(Y,C1)):I8(Y,void 0),!x1&&(Y.damage===void 0||Y.damage.has((h1=v4==null?void 0:v4.current)==null?void 0:h1[0]))&&m2(void 0)},[P0,q0,i,l,n1,o,b1,z2,B1,v,R,Q,y1,n,c,E2,h,i2,I1,Z2,p1,p,Z,C,N,g,k,K9,m,u2,w,a1,T1,t2,G,l1,F2,Z1,L1==null?void 0:L1.hyperWrapping,L1==null?void 0:L1.renderStrategy,L2,z4,f1,X9]),j4=e1.useRef(E5);e1.useLayoutEffect(()=>{E5(),j4.current=E5},[E5]),e1.useLayoutEffect(()=>{(async()=>{var j;((j=document==null?void 0:document.fonts)==null?void 0:j.ready)!==void 0&&(await document.fonts.ready,p4.current=void 0,j4.current())})()},[]);let T4=e1.useCallback(z=>{M1.current=z,j4.current(),M1.current=void 0},[]),j9=Vs(T4);Q0.current=j9;let Y9=e1.useCallback(z=>{T4(new R4(z.map(j=>j.cell)))},[T4]);l1.setCallback(T4);let[w3,g3]=e1.useState(!1),[N5,y4]=j1!=null?j1:[],H3=N5!==void 0&&y4===-1,L3=N5!==void 0&&y4===-2,Q9=!1,R5=!1,s0=C2;if(s0===void 0&&N5!==void 0&&y4!==void 0&&y4>-1&&y4({contain:"strict",display:"block",cursor:B5}),[B5]),o9=e1.useRef("default"),P4=J==null?void 0:J.current;P4!=null&&o9.current!==z5.cursor&&(P4.style.cursor=o9.current=z5.cursor);let U0=e1.useCallback((z,j,x1,v1)=>{if(u2===void 0)return;let C1=u2(z);if(C1.actions!==void 0){let Y=u8(j,C1.actions);for(let[_1,K1]of Y.entries())if(G4(K1,x1+j.x,v1+K1.y))return C1.actions[_1]}},[u2]),n4=e1.useCallback((z,j,x1,v1)=>{let C1=s[j];if(!e2&&!I1&&C1.hasMenu===!0&&!(Y2!=null&&Y2)){let Y=X1(z,j,-1);d0(Y!==void 0);let _1=d8(Y.x,Y.y,Y.width,Y.height,$5(C1.title)==="rtl");if(x1>_1.x&&x1<_1.x+_1.width&&v1>_1.y&&v1<_1.y+_1.height)return Y}},[s,X1,Y2,e2,I1]),n9=e1.useRef(0),D4=e1.useRef(),C9=e1.useRef(!1),B0=e1.useCallback(z=>{let j=V1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1)return;C9.current=!0;let v1,C1;if(z instanceof MouseEvent?(v1=z.clientX,C1=z.clientY):(v1=z.touches[0].clientX,C1=z.touches[0].clientY),z.target===x1&&x1!==null){let _1=x1.getBoundingClientRect();if(v1>_1.right||C1>_1.bottom)return}let Y=N2(j,v1,C1,z);D4.current=Y.location,Y.isTouch&&(n9.current=Date.now()),y2.current!==Y.isTouch&&A2(Y.isTouch),!(Y.kind===B4&&n4(j,Y.location[0],v1,C1)!==void 0)&&(Y.kind===S0&&U0(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&&z.preventDefault()))},[J,H1,N2,U0,n4,b]);n0("touchstart",B0,window,!1),n0("mousedown",B0,window,!1);let y5=e1.useRef(0),c9=e1.useCallback(z=>{var G1,d2;let j=y5.current;y5.current=Date.now();let x1=V1.current;if(C9.current=!1,D===void 0||x1===null)return;let v1=J==null?void 0:J.current,C1=z.target!==x1&&z.target!==v1,Y,_1,K1=!0;if(z instanceof MouseEvent){if(Y=z.clientX,_1=z.clientY,K1=z.button<3,z.pointerType==="touch")return}else Y=z.changedTouches[0].clientX,_1=z.changedTouches[0].clientY;let h1=N2(x1,Y,_1,z);h1.isTouch&&n9.current!==0&&Date.now()-n9.current>500&&(h1=P(y({},h1),{isLongTouch:!0})),j!==0&&Date.now()-j<(h1.isTouch?1e3:500)&&(h1=P(y({},h1),{isDoubleClick:!0})),y2.current!==h1.isTouch&&A2(h1.isTouch),!C1&&z.cancelable&&K1&&z.preventDefault();let[q2]=h1.location,r2=n4(x1,q2,Y,_1);if(h1.kind===B4&&r2!==void 0){(h1.button!==0||((G1=D4.current)==null?void 0:G1[0])!==q2||((d2=D4.current)==null?void 0:d2[1])!==-1)&&D(h1,!0);return}else if(h1.kind===S0){let Q1=U0(h1.group,h1.bounds,h1.localEventX,h1.localEventY);if(Q1!==void 0){h1.button===0&&Q1.onClick(h1);return}}D(h1,C1)},[D,J,N2,n4,U0]);n0("mouseup",c9,window,!1),n0("touchend",c9,window,!1);let J9=e1.useCallback(z=>{var r2,G1;let j=V1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1,Y,_1=!0;z instanceof MouseEvent?(C1=z.clientX,Y=z.clientY,_1=z.button<3):(C1=z.changedTouches[0].clientX,Y=z.changedTouches[0].clientY);let K1=N2(j,C1,Y,z);y2.current!==K1.isTouch&&A2(K1.isTouch),!v1&&z.cancelable&&_1&&z.preventDefault();let[h1]=K1.location,q2=n4(j,h1,C1,Y);if(K1.kind===B4&&q2!==void 0)K1.button===0&&((r2=D4.current)==null?void 0:r2[0])===h1&&((G1=D4.current)==null?void 0:G1[1])===-1&&(L==null||L(h1,q2));else if(K1.kind===S0){let d2=U0(K1.group,K1.bounds,K1.localEventX,K1.localEventY);d2!==void 0&&K1.button===0&&d2.onClick(K1)}},[J,N2,n4,L,U0]);n0("click",J9,window,!1);let V3=e1.useCallback(z=>{let j=V1.current,x1=J==null?void 0:J.current;if(j===null||z.target!==j&&z.target!==x1||x===void 0)return;let v1=N2(j,z.clientX,z.clientY,z);x(v1,()=>{z.cancelable&&z.preventDefault()})},[J,N2,x]);n0("contextmenu",V3,(h0=J==null?void 0:J.current)!=null?h0:null,!1);let e7=e1.useCallback(z=>{M1.current=new R4(z.map(j=>j.item)),Q2.current=z,j4.current(),M1.current=void 0},[]),C4=e1.useMemo(()=>new i3(e7),[e7]),b4=e1.useRef(C4);b4.current=C4,e1.useLayoutEffect(()=>{let z=b4.current;if(j1===void 0||j1[1]<0){z.setHovered(j1);return}let j=m(j1,!0),x1=f1(j),v1=x1===void 0&&j.kind===c1.Custom||(x1==null?void 0:x1.needsHover)!==void 0&&(typeof x1.needsHover=="boolean"?x1.needsHover:x1.needsHover(j));z.setHovered(v1?j1:void 0)},[m,f1,j1]);let G0=e1.useRef(),A=e1.useCallback(z=>{var K1;let j=V1.current;if(j===null)return;let x1=J==null?void 0:J.current,v1=z.target!==j&&z.target!==x1,C1=N2(j,z.clientX,z.clientY,z);if(C1.kind!=="out-of-bounds"&&v1&&!C9.current&&!C1.isTouch)return;let Y=(h1,q2)=>{c0(r2=>r2===h1||(r2==null?void 0:r2[0][0])===(h1==null?void 0:h1[0][0])&&(r2==null?void 0:r2[0][1])===(h1==null?void 0:h1[0][1])&&((r2==null?void 0:r2[1][0])===(h1==null?void 0:h1[1][0])&&(r2==null?void 0:r2[1][1])===(h1==null?void 0:h1[1][1])||!q2)?r2:h1)};if(!l3(C1,G0.current))m2(void 0),K==null||K(C1),Y(C1.kind===l9?void 0:[C1.location,[C1.localEventX,C1.localEventY]],!0),G0.current=C1;else if(C1.kind==="cell"||C1.kind===B4||C1.kind===S0){let h1=!1,q2=!0;if(C1.kind==="cell"){let G1=m(C1.location),d2=(K1=f1(G1))==null?void 0:K1.needsHoverPosition;q2=d2!=null?d2:G1.kind===c1.Custom,h1=q2}else C1.kind===S0&&(h1=!0);let r2=[C1.location,[C1.localEventX,C1.localEventY]];Y(r2,q2),v4.current=r2,h1&&T4(new R4([C1.location]))}let _1=C1.location[0]>=(m1?0:1);J2(C1.kind===B4&&C1.isEdge&&_1&&W1===!0),g3(C1.kind==="cell"&&C1.isFillHandle),B==null||B(z),_(C1)},[J,N2,m1,W1,B,_,K,m,f1,T4]);n0("mousemove",A,window,!0);let W2=e1.useCallback(z=>{let j=V1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),g1==null||g1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[g1,Z,X1]),Y4=e1.useCallback(z=>{let j=V1.current;if(j===null)return;let x1,v1;Z.current!==void 0&&(x1=X1(j,Z.current.cell[0],Z.current.cell[1]),v1=Z.current.cell),w1==null||w1({bounds:x1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:v1})},[w1,Z,X1]),d3=e1.useCallback(z=>{V1.current=z,s1!==void 0&&(s1.current=z)},[s1]),t7=e1.useCallback(z=>{var G1;let j=V1.current;if(j===null||H1===!1||I1){z.preventDefault();return}let x1,v1,C1=N2(j,z.clientX,z.clientY);if(H1!==!0&&C1.kind!==H1){z.preventDefault();return}let Y=(d2,Q1)=>{x1=d2,v1=Q1},_1,K1,h1,q2=(d2,Q1,k2)=>{_1=d2,K1=Q1,h1=k2},r2=!1;if(o1==null||o1(P(y({},C1),{setData:Y,setDragImage:q2,preventDefault:()=>r2=!0,defaultPrevented:()=>r2})),!r2&&x1!==void 0&&v1!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(x1,v1),z.dataTransfer.effectAllowed="copyLink",_1!==void 0&&K1!==void 0&&h1!==void 0)z.dataTransfer.setDragImage(_1,K1,h1);else{let[d2,Q1]=C1.location;if(Q1!==void 0){let k2=document.createElement("canvas"),l0=X1(j,d2,Q1);d0(l0!==void 0);let K0=Math.ceil((G1=window.devicePixelRatio)!=null?G1:1);k2.width=l0.width*K0,k2.height=l0.height*K0;let $2=k2.getContext("2d");$2!==null&&($2.scale(K0,K0),$2.textBaseline="middle",Q1===-1?($2.font=y1.headerFontFull,$2.fillStyle=y1.bgHeader,$2.fillRect(0,0,k2.width,k2.height),v8($2,0,0,l0.width,l0.height,B1[d2],!1,y1,!1,!1,0,F2,T1,!1)):($2.font=y1.baseFontFull,$2.fillStyle=y1.bgCell,$2.fillRect(0,0,k2.width,k2.height),V8($2,m([d2,Q1]),0,Q1,!1,!1,0,0,l0.width,l0.height,!1,y1,y1.bgCell,l1,F2,1,void 0,!1,0,void 0,void 0,void 0,z4,f1,()=>{}))),k2.style.left="-100%",k2.style.position="absolute",k2.style.width=`${l0.width}px`,k2.style.height=`${l0.height}px`,document.body.append(k2),z.dataTransfer.setDragImage(k2,l0.width/2,l0.height/2),window.setTimeout(()=>{k2.remove()},0)}}else z.preventDefault()},[H1,I1,N2,o1,X1,y1,B1,F2,T1,m,l1,z4,f1]);n0("dragstart",t7,(S5=J==null?void 0:J.current)!=null?S5:null,!1,!1);let m9=e1.useRef(),u3=e1.useCallback(z=>{var h1;let j=V1.current;if(S1!==void 0&&z.preventDefault(),j===null||q1===void 0)return;let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1),[_1,K1]=(h1=m9.current)!=null?h1:[];(_1!==Y||K1!==C1)&&(m9.current=[Y,C1],q1([Y,C1],z.dataTransfer))},[m1,N2,q1,S1]);n0("dragover",u3,(i7=J==null?void 0:J.current)!=null?i7:null,!1,!1);let h9=e1.useCallback(()=>{m9.current=void 0,R1==null||R1()},[R1]);n0("dragend",h9,(g9=J==null?void 0:J.current)!=null?g9:null,!1,!1);let W=e1.useCallback(z=>{let j=V1.current;if(j===null||S1===void 0)return;z.preventDefault();let x1=N2(j,z.clientX,z.clientY),[v1,C1]=x1.location,Y=v1-(m1?0:1);S1([Y,C1],z.dataTransfer)},[m1,N2,S1]);n0("drop",W,(L0=J==null?void 0:J.current)!=null?L0:null,!1,!1);let E0=e1.useCallback(()=>{$1==null||$1()},[$1]);n0("dragleave",E0,(N0=J==null?void 0:J.current)!=null?N0:null,!1,!1);let a0=e1.useRef(Z);a0.current=Z;let b5=e1.useRef(null),w9=e1.useCallback(z=>{var j;V1.current===null||!V1.current.contains(document.activeElement)||(z===null&&a0.current.current!==void 0?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),b5.current=z)},[s1]);e1.useImperativeHandle(t,()=>({focus:()=>{var j;let z=b5.current;z===null||!document.contains(z)?(j=s1==null?void 0:s1.current)==null||j.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,j)=>{if(!(s1===void 0||s1.current===null))return X1(s1.current,z!=null?z:0,j!=null?j:-1)},damage:Y9}),[s1,Y9,X1]);let A4=e1.useRef(),D0=Ie(()=>{var K1,h1,q2,r2;if(i<50||(L1==null?void 0:L1.disableAccessibilityTree)===!0)return null;let z=T9(B1,n1,i,Q,b1),j=m1?0:-1;!m1&&((K1=z[0])==null?void 0:K1.sourceIndex)===0&&(z=z.slice(1));let[x1,v1]=(q2=(h1=Z.current)==null?void 0:h1.cell)!=null?q2:[],C1=(r2=Z.current)==null?void 0:r2.range,Y=z.map(G1=>G1.sourceIndex),_1=(0,us.default)(o,Math.min(g,o+r));return x1!==void 0&&v1!==void 0&&!(Y.includes(x1)&&_1.includes(v1))&&w9(null),e1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":B1.length+j},e1.createElement("thead",{role:"rowgroup"},e1.createElement("tr",{role:"row","aria-rowindex":1},z.map(G1=>e1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex(G1.sourceIndex),"aria-colindex":G1.sourceIndex+1+j,tabIndex:-1,onFocus:d2=>{if(d2.target!==b5.current)return l2==null?void 0:l2([G1.sourceIndex,-1])},key:G1.sourceIndex},G1.title)))),e1.createElement("tbody",{role:"rowgroup"},_1.map(G1=>e1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex(G1),key:G1,"aria-rowindex":G1+2},z.map(d2=>{let Q1=d2.sourceIndex,k2=F0(Q1,G1),l0=x1===Q1&&v1===G1,K0=C1!==void 0&&Q1>=C1.x&&Q1=C1.y&&G1{let O2=s1==null?void 0:s1.current;if(O2!=null)return g1==null?void 0:g1({bounds:X1(O2,Q1,G1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:U2})},onFocusCapture:O2=>{var V0,v2;if(!(O2.target===b5.current||((V0=A4.current)==null?void 0:V0[0])===Q1&&((v2=A4.current)==null?void 0:v2[1])===G1))return A4.current=U2,l2==null?void 0:l2(U2)},ref:l0?w9:void 0,tabIndex:-1},bH(I2,f1))})))))},[i,B1,n1,Q,b1,g,o,r,Z,w9,m,s1,g1,X1,l2],200),c4=R===0||!E?0:n1>R?1:(0,q8.default)(-b1/100,0,1),v3=-o*32+z2,F5=S?(0,q8.default)(-v3/100,0,1):0,p3=e1.useMemo(()=>{if(!c4&&!F5)return null;let z={position:"absolute",top:0,left:S2,width:i-S2,height:l,opacity:c4,pointerEvents:"none",transition:H2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},j={position:"absolute",top:Z0,left:0,width:i,height:l,opacity:F5,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,c4>0&&e1.createElement("div",{id:"shadow-x",style:z}),F5>0&&e1.createElement("div",{id:"shadow-y",style:j}))},[c4,F5,S2,i,H2,Z0,l,t1]),M3=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:W2,onKeyUp:Y4,onFocus:u,onBlur:d,ref:d3,style:z5},D0),e1.createElement("canvas",{ref:k0,style:M3}),p3)},vs=e1.memo(e1.forwardRef(FH));function $9(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 SH=e=>{var i2;let[t,i]=D2.useState(),[l,r]=D2.useState(),[s,a]=D2.useState(),[o,n]=D2.useState(),[C,c]=D2.useState(!1),[h,g]=D2.useState(),[m,w]=D2.useState(),[L,v]=D2.useState(),[V,u]=D2.useState(!1),[d,p]=D2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:S,gridRef:k,maxColumnWidth:b,minColumnWidth:D,onRowMoved:B,lockColumns:_,onColumnProposeMove:K,onMouseDown:Q,onMouseUp:m1,onItemHovered:g1,onDragStart:w1,canvasRef:G}=e,s1=((i2=N!=null?N:S)!=null?i2:E)!==void 0,{columns:o1,selection:R1}=e,J=R1.columns,I1=D2.useCallback(a1=>{let[T1,l2]=a1.location;s!==void 0&&o!==T1&&T1>=_?(c(!0),n(T1)):m!==void 0&&l2!==void 0?(u(!0),v(Math.max(0,l2))):l===void 0&&!C&&!V&&(g1==null||g1(a1))},[s,m,o,g1,_,l,C,V]),p1=x!==void 0,e2=D2.useCallback(a1=>{var T1,l2;if(a1.button===0){let[q1,S1]=a1.location;if(a1.kind==="out-of-bounds"&&a1.isEdge&&s1){let $1=(T1=k==null?void 0:k.current)==null?void 0:T1.getBounds(o1.length-1,-1);$1!==void 0&&(i($1.x),r(o1.length-1))}else if(a1.kind==="header"&&q1>=_){let $1=G==null?void 0:G.current;if(a1.isEdge&&s1&&$1){i(a1.bounds.x),r(q1);let H2=$1.getBoundingClientRect().width/$1.offsetWidth,t1=a1.bounds.width/H2;E==null||E(o1[q1],t1,q1,t1+((l2=o1[q1].growOffset)!=null?l2:0))}else a1.kind==="header"&&p1&&(g(a1.bounds.x),a(q1))}else a1.kind==="cell"&&_>0&&q1===0&&S1!==void 0&&B!==void 0&&(p(a1.bounds.y),w(S1))}Q==null||Q(a1)},[Q,s1,_,B,k,o1,p1,E,G]),H1=D2.useCallback((a1,T1)=>{C||V||Z==null||Z(a1,T1)},[C,V,Z]),W1=D2.useRef(-1),E2=D2.useCallback(()=>{W1.current=-1,w(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),g(void 0),c(!1),r(void 0),i(void 0)},[]),Z2=D2.useCallback((a1,T1)=>{var l2,q1,S1;if(a1.button===0){if(l!==void 0){if((J==null?void 0:J.hasIndex(l))===!0)for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);N==null||N(H2,t1,U1,t1+((l2=H2.growOffset)!=null?l2:0))}let $1=$9(o1[l],W1.current,D,b);if(S==null||S(o1[l],$1,l,$1+((q1=o1[l].growOffset)!=null?q1:0)),J.hasIndex(l))for(let U1 of J){if(U1===l)continue;let H2=o1[U1],t1=$9(H2,W1.current,D,b);S==null||S(H2,t1,U1,t1+((S1=H2.growOffset)!=null?S1:0))}}E2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),m!==void 0&&L!==void 0&&(B==null||B(m,L))}m1==null||m1(a1,T1)},[m1,l,s,o,m,L,J,S,o1,D,b,N,x,B,E2]),u2=D2.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]),y1=D2.useCallback(a1=>{var l2,q1;let T1=G==null?void 0:G.current;if(s!==void 0&&h!==void 0)Math.abs(a1.clientX-h)>20&&c(!0);else if(m!==void 0&&d!==void 0)Math.abs(a1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&T1){let $1=T1.getBoundingClientRect().width/T1.offsetWidth,U1=(a1.clientX-t)/$1,H2=o1[l],t1=$9(H2,U1,D,b);if(N==null||N(H2,t1,l,t1+((l2=H2.growOffset)!=null?l2:0)),W1.current=U1,(J==null?void 0:J.first())===l)for(let L1 of J){if(L1===l)continue;let f1=o1[L1],b1=$9(f1,W1.current,D,b);N==null||N(f1,b1,L1,b1+((q1=f1.growOffset)!=null?q1:0))}}},[s,h,m,d,l,t,o1,D,b,N,J,G]),t2=D2.useCallback((a1,T1)=>{if(m===void 0||L===void 0)return R(a1,T1);let[l2,q1]=a1;return q1===L?q1=m:(q1>L&&(q1-=1),q1>=m&&(q1+=1)),R([l2,q1],T1)},[m,L,R]),w2=D2.useCallback(a1=>{w1==null||w1(a1),a1.defaultPrevented()||E2()},[E2,w1]);return D2.createElement(vs,{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:t2,isResizing:l!==void 0,onHeaderMenuClick:H1,isDragging:C,onItemHovered:I1,onDragStart:w2,onMouseDown:e2,allowResize:s1,onMouseUp:Z2,dragAndDropState:u2,onMouseMoveRaw:y1,ref:k})},Ms=SH;var V2=F1(Y1(),1);var r9=F1(Y1(),1);function xs(e){let t=(0,r9.useRef)(null),[i,l]=(0,r9.useState)({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return(0,r9.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]),y({ref:t},i)}var K4=F1(Y1(),1),kH=(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 g,m;if(r.current===!1&&n!==null){let w=[n.scrollLeft,n.scrollTop];if(((g=s.current)==null?void 0:g[0])===w[0]&&((m=s.current)==null?void 0:m[1])===w[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(w[0],w[1]),s.current=w;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},h=g=>{g.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let g=n;return g.addEventListener("touchstart",c),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",h),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},fs=kH;var TH=()=>e=>e.isSafari?"scroll":"auto",PH=X2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[TH()]}});function DH(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 Zs=e=>{var o1,R1,J,I1;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:h,rightElementProps:g,kineticScrollPerfHack:m=!1,scrollRef:w,initialSize:L}=e,v=[],V=(o1=g==null?void 0:g.sticky)!=null?o1:!1,u=(R1=g==null?void 0:g.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=DH(200),[S,k]=V2.useState(!0),b=V2.useRef(0);V2.useLayoutEffect(()=>{if(!S||E||x.current.lockDirection===void 0)return;let p1=Z.current;if(p1===null)return;let[e2,H1]=x.current.lockDirection;e2!==void 0?p1.scrollLeft=e2:H1!==void 0&&(p1.scrollTop=H1),x.current.lockDirection=void 0},[E,S]);let D=V2.useCallback((p1,e2)=>{var l2,q1,S1,$1;let H1=Z.current;if(H1===null)return;e2=e2!=null?e2:H1.scrollTop,p1=p1!=null?p1:H1.scrollLeft;let W1=x.current.scrollTop,E2=x.current.scrollLeft,Z2=p1-E2,u2=e2-W1;E&&Z2!==0&&u2!==0&&(Math.abs(Z2)>3||Math.abs(u2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Z2)0&&(Math.abs(a1)>2e3||i2===0||i2===T1)&&l>H1.scrollHeight+5){let U1=i2/T1,H2=(l-w2)*U1;d.current=H2-i2}y1!==void 0&&(window.clearTimeout(b.current),k(!1),b.current=window.setTimeout(()=>k(!0),200)),s({x:p1,y:i2+d.current,width:t2-c,height:w2-C,paddingRight:($1=(S1=N.current)==null?void 0:S1.clientWidth)!=null?$1:0})},[C,c,l,s,n,E]);fs(m&&i9.value,D,Z);let B=V2.useRef(D);B.current=D;let _=V2.useRef(),K=V2.useRef(!1);V2.useLayoutEffect(()=>{K.current?D():K.current=!0},[D,C,c]);let Q=V2.useCallback(p1=>{Z.current=p1,w!==void 0&&(w.current=p1)},[w]),m1=0,g1=0;for(v.push(V2.createElement("div",{key:m1++,style:{width:r,height:0}}));g1B.current(),0),_.current={width:G,height:s1}),(G!=null?G:0)===0||(s1!=null?s1:0)===0?V2.createElement("div",{ref:w1}):V2.createElement("div",{ref:w1},V2.createElement(PH,{isSafari:i9.value},V2.createElement("div",{className:"dvn-underlay"},t),V2.createElement("div",{ref:Q,style:_.current,draggable:a,onDragStart:p1=>{a||(p1.stopPropagation(),p1.preventDefault())},className:"dvn-scroller "+(o!=null?o:""),onScroll:()=>D()},V2.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},V2.createElement("div",{className:"dvn-stack"},v),h!==void 0&&V2.createElement(V2.Fragment,null,!u&&V2.createElement("div",{className:"dvn-spacer"}),V2.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"}},h))))))};var AH=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:h,onVisibleRegionChanged:g,scrollRef:m,preventDiagonalScrolling:w,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,S]=c,k=W0.useRef(),b=W0.useRef(),D=W0.useRef(),B=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 E2,Z2,u2;if(Q.current===void 0)return;let w1=y({},Q.current),G=0,s1=w1.x<0?-w1.x:0,o1=0,R1=0;w1.x=w1.x<0?0:w1.x;let J=0;for(let y1=0;y1=t2+y1.width)G+=y1.width,R1++,o1++;else if(w1.x>t2)G+=y1.width,p?s1+=t2-w1.x:R1++,o1++;else if(w1.x+w1.width>t2)G+=y1.width,o1++;else break}let I1=0,p1=0,e2=0;if(typeof l=="number")Z?(p1=Math.floor(w1.y/l),I1=p1*l-w1.y):p1=Math.ceil(w1.y/l),e2=Math.ceil(w1.height/l)+p1,I1<0&&e2++;else{let y1=0;for(let t2=0;t2=y1+w2)y1+=w2,p1++,e2++;else if(w1.y>i2)y1+=w2,Z?I1+=i2-w1.y:p1++,e2++;else if(w1.y+w1.height>w2/2+y1)y1+=w2,e2++;else break}}let H1={x:R1,y:p1,width:o1-R1,height:e2-p1},W1=k.current;(W1===void 0||W1.y!==H1.y||W1.x!==H1.x||W1.height!==H1.height||W1.width!==H1.width||b.current!==s1||D.current!==I1||w1.width!==((E2=B.current)==null?void 0:E2[0])||w1.height!==((Z2=B.current)==null?void 0:Z2[1]))&&(g==null||g({x:R1,y:p1,width:o1-R1,height:e2-p1},w1.width,w1.height,(u2=w1.paddingRight)!=null?u2:0,s1,I1),k.current=H1,b.current=s1,D.current=I1,B.current=[w1.width,w1.height])},[t,l,i,g,o,p,Z]),g1=W0.useCallback(w1=>{Q.current=w1,m1()},[m1]);return W0.useEffect(()=>{m1()},[m1]),W0.createElement(Zs,{scrollRef:m,className:h,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:w,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:K+(N!=null?N:0),clientHeight:S,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:g1,initialSize:d},W0.createElement(Ms,{eventTargetRef:m,width:E,height:S,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}))},Es=AH;var Ns=X2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var IH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),OH=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),_H=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),WH=10,qH=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:h=!1,onSearchClose:g}=e,[m]=A1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[w,L]=A1.useState(""),v=a!=null?a:w,V=A1.useCallback(G=>{L(G),n==null||n(G)},[n]),[u,d]=A1.useState(),p=A1.useRef(u);p.current=u,A1.useEffect(()=>{o!==void 0&&(o.length>0?d(G=>{var s1;return{rowsSearched:l,results:o.length,selectedIndex:(s1=G==null?void 0:G.selectedIndex)!=null?s1:-1}}):d(void 0))},[l,o]);let Z=A1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=A1.useRef(),[x,N]=A1.useState([]),E=o!=null?o:x,S=A1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),k=A1.useRef(i);k.current=i;let b=A1.useCallback(G=>{let s1=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),o1=k.current,R1=Math.min(10,l),J=0;d(void 0),N([]);let I1=[],p1=async()=>{var i2,a1;if(C===void 0)return;let e2=performance.now(),H1=l-J,W1=C({x:0,y:o1,width:r.length,height:Math.min(R1,H1,l-o1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let E2=!1;for(let[T1,l2]of W1.entries())for(let[q1,S1]of l2.entries()){let $1;switch(S1.kind){case c1.Text:case c1.Number:$1=S1.displayData;break;case c1.Uri:case c1.Markdown:$1=S1.data;break;case c1.Boolean:$1=typeof S1.data=="boolean"?S1.data.toString():void 0;break;case c1.Image:case c1.Bubble:$1=S1.data.join("\u{1F433}");break;case c1.Custom:$1=S1.copyData;break}$1!==void 0&&s1.test($1)&&(I1.push([q1,T1+o1]),E2=!0)}let Z2=performance.now();E2&&N([...I1]),J+=W1.length,d0(J<=l);let u2=(a1=(i2=p.current)==null?void 0:i2.selectedIndex)!=null?a1:-1;d({results:I1.length,rowsSearched:J,selectedIndex:u2}),c==null||c(I1,u2),o1+R1>=l?o1=0:o1+=R1;let y1=Z2-e2,t2=Math.max(y1,1),w2=WH/t2;R1=Math.ceil(R1*w2),J{var G;g==null||g(),d(void 0),N([]),c==null||c([],-1),S(),(G=t==null?void 0:t.current)==null||G.focus()},[S,t,g,c]),B=A1.useCallback(G=>{V(G.target.value),o===void 0&&(G.target.value===""?(d(void 0),N([]),S()):b(G.target.value))},[b,S,V,o]);A1.useEffect(()=>{h&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[h,s,V]);let _=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex+1)%u.results;d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[u,c,E]),K=A1.useCallback(G=>{var o1;if((o1=G==null?void 0:G.stopPropagation)==null||o1.call(G),u===void 0)return;let s1=(u.selectedIndex-1)%u.results;s1<0&&(s1+=u.results),d(P(y({},u),{selectedIndex:s1})),c==null||c(E,s1)},[c,E,u]),Q=A1.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(D(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?K():_())},[D,_,K]);A1.useEffect(()=>()=>{S()},[S]);let[m1,g1]=A1.useState(!1);A1.useEffect(()=>{if(h)g1(!0);else{let G=setTimeout(()=>g1(!1),150);return()=>clearTimeout(G)}},[h]);let w1=A1.useMemo(()=>{var J,I1,p1;if(!h&&!m1)return null;let G;u!==void 0&&(G=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&(G=`${u.selectedIndex+1} of ${G}`));let s1=e2=>{e2.stopPropagation()},R1={width:`${Math.floor(((J=u==null?void 0:u.rowsSearched)!=null?J:0)/l*100)}%`};return A1.createElement(Ns,{className:h?"":"out",onMouseDown:s1,onMouseMove:s1,onMouseUp:s1,onClick:s1},A1.createElement("div",{className:"gdg-search-bar-inner"},A1.createElement("input",{id:m,"aria-hidden":!h,"data-testid":"search-input",ref:s,onChange:B,value:v,tabIndex:h?void 0:-1,onKeyDownCapture:Q}),A1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:K,disabled:((I1=u==null?void 0:u.results)!=null?I1:0)===0},IH),A1.createElement("button",{"aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:_,disabled:((p1=u==null?void 0:u.results)!=null?p1:0)===0},OH),g!==void 0&&A1.createElement("button",{"aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:D},_H)),u!==void 0?A1.createElement(A1.Fragment,null,A1.createElement("div",{className:"gdg-search-status"},A1.createElement("div",{"data-testid":"search-result-area"},G)),A1.createElement("div",{className:"gdg-search-progress",style:R1})):A1.createElement("div",{className:"gdg-search-status"},A1.createElement("label",{htmlFor:m},"Type to search")))},[h,m1,u,l,m,s,B,v,Q,K,_,g,D]);return A1.createElement(A1.Fragment,null,A1.createElement(Es,{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)},Rs=qH;var r3=F1(Y1(),1);var $H=()=>e=>Math.max(16,e.targetHeight-10),UH=X2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[$H(),"px"]}}),Bs=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=r3.default.useState(i);return r3.default.createElement(Q6,{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},r3.default.createElement(UH,{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 GH(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 o2(e,t,i){let l=zs(e,t);return l&&(i.didMatch=!0),l}function zs(e,t){if(e.length===0)return!1;if(e.includes("|")){let n=e.split("|");for(let C of n)if(zs(C,t))return!0;return!1}let i=!1,l=!1,r=!1,s=!1,a=e.split("+"),o=a.pop();if(!GH(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 s3=F1(Y1(),1);function ys(e,t,i,l,r,s){let a=s3.default.useCallback((C,c,h,g)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=P(y({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let m=i==="mixed"&&(h||g==="drag"),w=l==="mixed"&&m,L=r==="mixed"&&m,v={current:C===void 0?void 0:P(y({},C),{rangeStack:g==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:w?e.columns:x2.empty(),rows:L?e.rows:x2.empty()};h&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=P(y({},v),{current:P(y({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let g;if(r==="exclusive"&&C.length>0)g={current:void 0,columns:x2.empty(),rows:C};else{let m=h&&i==="mixed",w=h&&l==="mixed";g={current:m?e.current:void 0,columns:w?e.columns:x2.empty(),rows:C}}t(g,!1)},[l,e,i,r,t]),n=s3.default.useCallback((C,c,h)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let g;if(l==="exclusive"&&C.length>0)g={current:void 0,rows:x2.empty(),columns:C};else{let m=h&&i==="mixed",w=h&&r==="mixed";g={current:m?e.current:void 0,rows:w?e.rows:x2.empty(),columns:C}}t(g,!1)},[l,e,i,r,t]);return[a,o,n]}var $8=F1(Y1(),1);function bs(e,t,i,l,r){let s=$8.useCallback(C=>{var c;if(e===!0){let h=[];for(let g=C.y;g=r?m.push({kind:c1.Loading,allowOverlay:!1}):m.push(t([w,g]));h.push(m)}return h}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=$8.useCallback(C=>{if(a===void 0)return[];let c=P(y({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let h=a(c,l.signal);return typeof h=="function"?async()=>(await h()).map(g=>[{kind:c1.Loading,allowOverlay:!1},...g]):h.map(g=>[{kind:c1.Loading,allowOverlay:!1},...g])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function KH(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 XH(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"}:KH(a))})}function Fs(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function jH(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=>Fs(o,!0)).join(",")):s.push(Fs(a.formatted,!1));t.push(s.join(" "))}return t.join(` -`)}function U8(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>" ".repeat(t.length))}function Ss(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function YH(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function QH(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("
${U8(s.formatted)}
    ${s.formatted.map((o,n)=>`
  1. `+U8(o)+"
  2. ").join("")}
${U8(s.formatted)}
"),t.join("")}function ks(e,t){let i=XH(e,t),l=jH(i),r=QH(i);return{textPlain:l,textHtml:r}}function G8(e){var a,o,n,C,c,h;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 g=l.pop();if(g===void 0)break;if(g instanceof HTMLTableElement||g.nodeName==="TBODY")l.push(...[...g.children].reverse());else if(g instanceof HTMLTableRowElement)s!==void 0&&r.push(s),s=[],l.push(...[...g.children].reverse());else if(g instanceof HTMLTableCellElement){let m=g.cloneNode(!0),L=m.children.length===1&&m.children[0].nodeName==="P"?m.children[0]:null,v=(L==null?void 0:L.children.length)===1&&L.children[0].nodeName==="FONT",V=m.querySelectorAll("br");for(let p of V)p.replaceWith(` -`);let u=m.getAttribute("gdg-raw-value"),d=(a=m.getAttribute("gdg-format"))!=null?a:"string";if(m.querySelector("a")!==null)s==null||s.push({rawValue:(n=(o=m.querySelector("a"))==null?void 0:o.getAttribute("href"))!=null?n:"",formatted:(C=m.textContent)!=null?C:"",format:d});else if(m.querySelector("ol")!==null){let p=m.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:YH(u),formatted:(c=m.textContent)!=null?c:"",format:d});else{let p=(h=m.textContent)!=null?h:"";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 Ps(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 m=t({x:C.x,y:C.y,width:1,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m);let w=t({x:C.x+C.width-1,y:C.y,width:1,height:C.height},r.signal);if(typeof w=="function")return s;c.push(...w)}else{let m=t({x:C.x,y:C.y,width:C.width,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m)}let h=C.x-i,g=C.x+C.width-1-i;for(let m of c)for(let w of m)w.span!==void 0&&(h=Math.min(w.span[0],h),g=Math.max(w.span[1],g));h===C.x-i&&g===C.x+C.width-1-i?a=!0:e={current:{cell:(n=e.current.cell)!=null?n:[0,0],range:{x:h+i,y:C.y,width:g-h+1,height:C.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function Ts(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Ds(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,` +`},Di={headerRowID:im,headerNumber:rm,headerCode:lm,headerString:sm,headerBoolean:am,headerAudioUri:nm,headerVideoUri:Cm,headerEmoji:cm,headerImage:mm,headerUri:Pi,headerPhone:hm,headerMarkdown:wm,headerDate:gm,headerTime:Hm,headerEmail:Lm,headerReference:Vm,headerIfThenElse:dm,headerSingleValue:um,headerLookup:vm,headerTextTemplate:pm,headerMath:Mm,headerRollup:xm,headerJoinStrings:fm,headerSplitString:Zm,headerGeoDistance:Em,headerArray:Nm,rowOwnerOverlay:Rm,protectedColumnOverlay:Bm,renameIcon:om};function zm(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}var t3=class{constructor(t,i){C2(this,"onSettled");C2(this,"spriteMap",new Map);C2(this,"headerIcons");C2(this,"inFlight",0);this.onSettled=i,this.headerIcons=t!=null?t:{}}drawSprite(t,i,l,r,s,a,o,n=1){let[C,c]=zm(i,o),h=a*Math.ceil(window.devicePixelRatio),g=`${C}_${c}_${h}_${t}`,m=this.spriteMap.get(g);if(m===void 0){let w=this.headerIcons[t];if(w===void 0)return;m=document.createElement("canvas");let L=m.getContext("2d");if(L===null)return;let v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w({fgColor:c,bgColor:C}))}`,this.spriteMap.set(g,m);let V=v.decode();if(V===void 0)return;this.inFlight++,V.then(()=>{L.drawImage(v,0,0,h,h)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else n<1&&(l.globalAlpha=n),l.drawImage(m,0,0,h,h,r,s,a,a),n<1&&(l.globalAlpha=1)}};var Q8=x1(q9(),1),Fs=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 j4(e,t,i,l,r,s,a,o,n){o=o!=null?o:t;let C=t,c=e,h=l-s,g=!1;for(;Co&&n(C,c,m,!1,a&&c===l-1)===!0){g=!0;break}C+=m,c++}if(!g){C=i;for(let m=0;m!w.sticky))==null?void 0:g.sourceIndex)!=null?m:0;if(n>h){let w=Math.max(o,h),L=t,v=l;for(let V=s.sourceIndex-1;V>=w;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(h>o){let w=Math.min(n,h-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<=w;V++)v+=a[V].width;C={x:L,y:i,width:v,height:r}}return[C,c]}function Ai(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 u5(e,t,i,l,r,s,a,o){return e<=r+a&&r<=e+i&&t<=s+o&&s<=t+l}function Y4(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 Ii(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 Oi(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,h=e.y+e.height-o,g=n>0?e.x+Math.floor(n/l)*l:e.x,m=C>0?e.x+e.width-Math.floor(C/l)*l:e.x+e.width,w=c>0?e.y+Math.floor(c/l)*l:e.y,L=h>0?e.y+e.height-Math.floor(h/l)*l:e.y+e.height;return{x:g,y:w,width:m-g,height:L-w}}function _i(e,t,i,l,r){let[s,a,o,n]=t,[C,c,h,g]=r,{x:m,y:w,width:L,height:v}=e,V=[];if(L<=0||v<=0)return V;let u=m+L,d=w+v,p=mo,x=w+v>n,N=m>=s&&ms&&u<=o||mo,E=w>=a&&wa&&d<=n||wn;if(N&&E){let k=Math.max(m,s),b=Math.max(w,a),D=Math.min(u,o),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:c,width:h-C+1,height:g-c+1}})}if(p&&Z){let k=m,b=w,D=Math.min(u,s),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:0,width:C+1,height:c+1}})}if(Z&&N){let k=Math.max(m,s),b=w,D=Math.min(u,o),B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:0,width:h-C+1,height:c+1}})}if(Z&&R){let k=Math.max(m,o),b=w,D=u,B=Math.min(d,a);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:0,width:i-h+1,height:c+1}})}if(p&&E){let k=m,b=Math.max(w,a),D=Math.min(u,s),B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:c,width:C+1,height:g-c+1}})}if(R&&E){let k=Math.max(m,o),b=Math.max(w,a),D=u,B=Math.min(d,n);V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:c,width:i-h+1,height:g-c+1}})}if(p&&x){let k=m,b=Math.max(w,n),D=Math.min(u,s),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:0,y:g,width:C+1,height:l-g+1}})}if(x&&N){let k=Math.max(m,s),b=Math.max(w,n),D=Math.min(u,o),B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:C,y:g,width:h-C+1,height:l-g+1}})}if(R&&x){let k=Math.max(m,o),b=Math.max(w,n),D=u,B=d;V.push({rect:{x:k,y:b,width:D-k,height:B-b},clip:{x:h,y:g,width:i-h+1,height:l-g+1}})}return V}var ym={kind:C1.Loading,allowOverlay:!1};function f8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N,E,S,k,b,D,B,_,K,J,c1){var J1;let w1=(J1=d==null?void 0:d.size)!=null?J1:Number.MAX_SAFE_INTEGER,h1=performance.now(),G=D.baseFontFull;e.font=G;let r1={ctx:e},a1=[0,0],R1=v>0?n4(n,v,C):0,Q,I1,v1=i3(u);return _0(t,o,s,a,r,(g1,W1,E2,Z2,u2)=>{var H2;let y1=Math.max(0,Z2-W1),e2=W1+y1,w2=r+1,t2=g1.width-y1,s1=l-r-1;if(u.length>0){let t1=!1;for(let H1=0;H1{e.save(),e.beginPath(),e.rect(e2,w2,t2,s1),e.clip()},i2=p.columns.hasIndex(g1.sourceIndex),q1=h((H2=g1.group)!=null?H2:"").overrideTheme,F1=g1.themeOverride===void 0&&q1===void 0?D:a4(D,q1,g1.themeOverride),$1=F1.baseFontFull;$1!==G&&(G=$1,e.font=$1),T1();let U1;return j4(u2,E2,l,n,C,v,V,v1,(t1,H1,f1,b1,z2)=>{var Z0,C4,T0,m0;if(H1<0||(a1[0]=g1.sourceIndex,a1[1]=H1,d!==void 0&&!d.has(a1)))return;if(u.length>0){let B1=!1;for(let S2=0;S2i1.span!==void 0&&B1>=i1.span[0]&&B1<=i1.span[1]);Y2&&!w&&L?J2=0:Y2&&L&&(J2=Math.max(J2,1)),k0&&J2++,Y2||(o1&&J2++,i2&&!z2&&J2++);let n2=i1.kind===C1.Protected?c0.bgCellMedium:c0.bgCell,c2;if((b1||n2!==D.bgCell)&&(c2=y0(n2,c2)),J2>0||L1){L1&&(c2=y0(c0.bgHeader,c2));for(let B1=0;B1c1&&!Q2){let B1=c0.baseFontFull;B1!==G&&(e.font=B1,G=B1),U1=Z8(e,i1,g1.sourceIndex,H1,A2,y2,p1,t1,Z1,f1,J2>0,c0,c2!=null?c2:c0.bgCell,x,N,(T0=F2==null?void 0:F2.hoverAmount)!=null?T0:0,S,b,h1,k,U1,B,_,K,J)}return L2&&e.restore(),i1.style==="faded"&&(e.globalAlpha=1),w1--,R2&&(e.restore(),(m0=U1==null?void 0:U1.deprep)==null||m0.call(U1,r1),U1=void 0,T1(),G=$1,e.font=$1),w1<=0}),e.restore(),w1<=0}),Q}var $9=[0,0],U9={x:0,y:0,width:0,height:0},M8=[void 0,()=>{}],x8=!1;function bm(){x8=!0}function Z8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u,d,p,Z,R,x,N){var _,K;let E,S;v!==void 0&&v[0][0]===i&&v[0][1]===l&&(E=v[1][0],S=v[1][1]);let k;$9[0]=i,$9[1]=l,U9.x=a,U9.y=o,U9.width=n,U9.height=C,M8[0]=R.getValue($9),M8[1]=J=>R.setValue($9,J),x8=!1;let b={ctx:e,theme:h,col:i,row:l,cell:t,rect:U9,highlighted:c,cellFillColor:g,hoverAmount:L,frameTime:u,hoverX:E,drawState:M8,hoverY:S,imageLoader:m,spriteManager:w,hyperWrapping:V,overrideCursor:E!==void 0?N:void 0,requestAnimationFrame:bm},D=St(b,t.lastUpdated,u,p,r,s),B=x(t);if(B!==void 0){(p==null?void 0:p.renderer)!==B&&((_=p==null?void 0:p.deprep)==null||_.call(p,b),p=void 0);let J=(K=B.drawPrep)==null?void 0:K.call(B,b,p);d!==void 0&&!P4(b.cell)?d(b,()=>B.draw(b,t)):B.draw(b,t),k=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:B}}return(D||x8)&&(Z==null||Z($9)),k}function t9(e,t,i,l,r,s,a,o,n=-20,C=-20,c=32,h="center",g="square"){var p;let m=Math.floor(r+a/2),w=g==="circle"?1e4:(p=t.roundingRadius)!=null?p:4,L=A7(c,a,t.cellVerticalPadding),v=L/2,V=D7(h,l,s,t.cellHorizontalPadding,L),u=P7(V,m,L),d=I7(l+n,r+C,u);switch(i){case!0:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),g==="circle"&&(v*=.8,L*=.8),e.fillStyle=o?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(V-v+L/4.23,m-v+L/1.97),e.lineTo(V-v+L/2.42,m-v+L/1.44),e.lineTo(V-v+L/1.29,m-v+L/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case U5:case!1:{e.beginPath(),f0(e,V-L/2+.5,m-L/2+.5,L-1,L-1,w),e.lineWidth=1,e.strokeStyle=d?t.textDark:t.textMedium,e.stroke();break}case G5:{e.beginPath(),f0(e,V-L/2,m-L/2,L,L,w),e.fillStyle=d?t.textMedium:t.textLight,e.fill(),g==="circle"&&(v*=.8,L*=.8),e.beginPath(),e.moveTo(V-L/3,m),e.lineTo(V+L/3,m),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:o5(i)}}function qi(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V,u){var x;let d=a+o;if(d<=0)return;e.fillStyle=h.bgHeader,e.fillRect(0,0,r,d);let[p,Z]=(x=l==null?void 0:l[0])!=null?x:[],R=h.headerFontFull;e.font=R,_0(t,0,s,0,d,(N,E,S,k)=>{var a1,R1,Q;if(v!==void 0&&!v.has([N.sourceIndex,-1]))return;let b=Math.max(0,k-E);e.save(),e.beginPath(),e.rect(E+b,o,N.width-b,a),e.clip();let D=L((a1=N.group)!=null?a1:"").overrideTheme,B=N.themeOverride===void 0&&D===void 0?h:a4(h,D,N.themeOverride);B.bgHeader!==h.bgHeader&&(e.fillStyle=B.bgHeader,e.fill()),B!==h&&(e.font=B.baseFontFull);let _=c.columns.hasIndex(N.sourceIndex),K=n!==void 0||C,J=!K&&Z===-1&&p===N.sourceIndex,c1=K?0:(Q=(R1=m.find(I1=>I1.item[0]===N.sourceIndex&&I1.item[1]===-1))==null?void 0:R1.hoverAmount)!=null?Q:0,w1=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===N.sourceIndex,h1=_?B.accentColor:w1?B.bgHeaderHasFocus:B.bgHeader,G=i?o:0,r1=N.sourceIndex===0?0:1;_?(e.fillStyle=h1,e.fillRect(E+r1,G,N.width-r1,a)):(w1||c1>0)&&(e.beginPath(),e.rect(E+r1,G,N.width-r1,a),w1&&(e.fillStyle=B.bgHeaderHasFocus,e.fill()),c1>0&&(e.globalAlpha=c1,e.fillStyle=B.bgHeaderHovered,e.fill(),e.globalAlpha=1)),R8(e,E,G,N.width,a,N,_,B,J,w1,c1,g,V,u),e.restore()}),i&&Fm(e,t,r,s,o,l,h,g,m,w,L,v)}function Fm(e,t,i,l,r,s,a,o,n,C,c,h){var v;let[m,w]=(v=s==null?void 0:s[0])!=null?v:[],L=0;l3(t,i,l,r,(V,u,d,p,Z,R)=>{var k,b;if(h!==void 0&&!h.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:a4(a,x.overrideTheme),E=w===-2&&m!==void 0&&m>=V[0]&&m<=V[1],S=E?N.bgHeaderHovered:N.bgHeader;if(S!==a.bgHeader&&(e.fillStyle=S,e.fill()),e.fillStyle=(k=N.textGroupHeader)!=null?k:N.textHeader,x!==void 0){let D=d;if(x.icon!==void 0&&(o.drawSprite(x.icon,"normal",e,D+8,(r-20)/2,20,N),D+=26),e.fillText(x.name,D+8,r/2+x0(e,a.headerFontFull)),x.actions!==void 0&&E){let B=N8({x:d,y:p,width:Z,height:R},x.actions);e.beginPath();let _=B[0].x-10,K=d+Z-_;e.rect(_,0,K,r);let J=e.createLinearGradient(_,0,_+K,0),c1=z0(S,0);J.addColorStop(0,c1),J.addColorStop(10/K,S),J.addColorStop(1,S),e.fillStyle=J,e.fill(),e.globalAlpha=.6;let[w1,h1]=(b=s==null?void 0:s[1])!=null?b:[-1,-1];for(let G=0;G35){let p=g?35:l-35,Z=g?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(g?1:0,L),N.addColorStop(R,L),N.addColorStop(x,E),N.addColorStop(g?0:1,E),e.fillStyle=N}else e.fillStyle=L;if(g&&(e.textAlign="right"),e.fillText(s.title,u,i+r/2+x0(e,o.headerFontFull)),g&&(e.textAlign="left"),v&&s.hasMenu===!0)if(s.menuIcon===void 0||s.menuIcon===W3.Triangle){e.beginPath();let d=m.x+m.width/2-5.5,p=m.y+m.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=m.x+m.width/2,p=m.y+m.height/2;Tt(e,d,p),e.fillStyle=L,e.fill()}else{let d=m.x+(m.width-o.headerIconSize)/2,p=m.y+(m.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,h,g,m){let w=j5(s.title)==="rtl",L=E8(t,i,l,r,w);g!==void 0?g({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:h,menuBounds:L},()=>Wi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)):Wi(e,t,i,l,r,s,a,o,n,c,h,m,w,L)}var Ms=x1(ps(),1);function xs(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,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(),j4(N,R,r,C,c,w,L,d,(S,k,b,D)=>{if(!D&&v.length>0&&!v.some(c1=>u5(Z,S,1e4,b,c1.x,c1.y,c1.width,c1.height)))return;let B=g.hasIndex(k),_=m.hasIndex(k);e.beginPath();let K=h==null?void 0:h(k),J=K===void 0?u:a4(u,K);J.bgCell!==u.bgCell&&(e.fillStyle=J.bgCell,e.fillRect(Z,S,1e4,b)),_&&(e.fillStyle=J.bgHeader,e.fillRect(Z,S,1e4,b)),B&&(e.fillStyle=J.accentLight,e.fillRect(Z,S,1e4,b))}),e.restore())})}function fs(e,t,i,l,r,s,a,o,n){var w;let C=!1;for(let L of t)if(!L.sticky){C=a(L.sourceIndex);break}let c=(w=n.horizontalBorderColor)!=null?w:n.borderColor,h=n.borderColor,g=C?N4(t):0,m;if(g!==0&&(m=$3(h,n.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,l),e.strokeStyle=m,e.stroke()),r>0){let L=h===c&&m!==void 0?m:$3(c,n.bgCell),v=n4(s,r,o);e.beginPath(),e.moveTo(0,l-v+.5),e.lineTo(i,l-v+.5),e.strokeStyle=L,e.stroke()}}var Zs=(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 Es(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w){var b;let L=w.bgCell,{minX:v,maxX:V,minY:u,maxY:d}=Zs(o,s,a),p=[],Z=a-n4(m,g,C),R=n,x=i,N=0;for(;R+r=u&&D<=d-1){let _=c==null?void 0:c(x),K=_==null?void 0:_.bgCell;K!==void 0&&K!==L&&x>=m-g&&p.push({x:v,y:D,w:V-v,h:B,color:K})}R+=B,x0)for(let D=0;D=v&&_<=V&&h(D+1)&&p.push({x:_,y:N,w:B.width,h:S,color:K}),E+=B.width}if(p.length===0)return;let k;e.beginPath();for(let D=p.length-1;D>=0;D--){let B=p[D];k===void 0?k=B.color:B.color!==k&&(e.fillStyle=k,e.fill(),e.beginPath(),k=B.color),e.rect(B.x,B.y,B.w,B.h)}k!==void 0&&(e.fillStyle=k,e.fill()),e.beginPath()}function $8(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,L,v,V=!1){var b,D,B;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}=Zs(o,s,a),N=[];e.beginPath();let E=.5;for(let _=0;_=p&&J<=Z&&m(_+1)&&N.push({x1:J,y1:Math.max(C,R),x2:J,y2:Math.min(a,x),color:d})}let S=a+.5;for(let _=L-w;_=R&&c1<=x-1){let w1=g==null?void 0:g(K);N.push({x1:p,y1:c1,x2:Z,y2:c1,color:(B=(D=w1==null?void 0:w1.horizontalBorderColor)!=null?D:w1==null?void 0:w1.borderColor)!=null?B:u})}_+=h(K),K++}}let k=(0,Ms.default)(N,_=>_.color);for(let _ of Object.keys(k)){e.strokeStyle=_;for(let K of k[_])e.moveTo(K.x1,K.y1),e.lineTo(K.x2,K.y2);e.stroke(),e.beginPath()}n!==void 0&&e.restore()}function Ns(e,t,i,l,r,s,a,o,n,C,c,h,g,m,w,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 B=p;Br.cellYOffset&&(R=-R),R+=n-r.translateY;let x=Math.min(r.cellXOffset,s),N=Math.max(r.cellXOffset,s),E=0;for(let B=x;Br.cellXOffset&&(E=-E),E+=o-r.translateX;let S=N4(v);if(E!==0&&R!==0)return{regions:[]};let k=C>0?n4(g,C,V):0,b=c-S-Math.abs(E),D=h-m-k-Math.abs(R)-1;if(b>150&&D>150){let B={sx:0,sy:0,sw:c*w,sh:h*w,dx:0,dy:0,dw:c*w,dh:h*w};if(R>0?(B.sy=(m+1)*w,B.sh=D*w,B.dy=(R+m+1)*w,B.dh=D*w,d.push({x:0,y:m,width:c,height:R+1})):R<0&&(B.sy=(-R+m+1)*w,B.sh=D*w,B.dy=(m+1)*w,B.dh=D*w,d.push({x:0,y:h+R-k,width:c,height:-R+k})),E>0?(B.sx=S*w,B.sw=b*w,B.dx=(E+S)*w,B.dw=b*w,d.push({x:S-1,y:0,width:E+2,height:h})):E<0&&(B.sx=(S-E)*w,B.sw=b*w,B.dx=S*w,B.dw=b*w,d.push({x:c+E,y:0,width:-E,height:h})),e.setTransform(1,0,0,1,0,0),u){if(S>0&&E!==0&&R===0&&(l===void 0||(i==null?void 0:i[1])!==!1)){let _=S*w,K=h*w;e.drawImage(t,0,0,_,K,0,0,_,K)}if(k>0&&E===0&&R!==0&&(l===void 0||(i==null?void 0:i[0])!==!1)){let _=(h-k)*w,K=c*w,J=k*w;e.drawImage(t,0,_,K,J,0,_,K,J)}}e.drawImage(t,B.sx,B.sy,B.sw,B.sh,B.dx,B.dy,B.dw,B.dh),e.scale(w,w)}return e.imageSmoothingEnabled=!0,{regions:d}}function Rs(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,(h,g,m,w)=>{if(h.sourceIndex===C){let L=Math.max(g,w)+1;return c.push({x:L,y:0,width:s-L,height:a}),!0}}),c}function Bs(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=n4(m,g,h),d=[n,0,o.length,m-g],p=[V,0,t,i-u],Z=v.map(x=>{var S;let N=x.range,E=(S=x.style)!=null?S:"dashed";return _i(N,d,t,i,p).map(k=>{let b=k.rect,D=_9(b.x,b.y,t,i,c,C+c,l,r,s,a,m,n,g,o,h),B=b.width===1&&b.height===1?D:_9(b.x+b.width-1,b.y+b.height-1,t,i,c,C+c,l,r,s,a,m,n,g,o,h);return b.x+b.width>=o.length&&(B.width-=1),b.y+b.height>=m&&(B.height-=1),{color:x.color,style:E,clip:k.clip,rect:Oi({x:D.x,y:D.y,width:B.x+B.width-D.x,height:B.y+B.height-D.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&&u5(0,0,t,i,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){let S=x,k=!Ii(E.clip,E.rect);k&&(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),k&&(e.restore(),x=S)}x&&e.setLineDash([])};return R(),R}function G8(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,h,g,m,w,L,v){var B;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=g(c.current.cell),N=(B=x.span)!=null?B:[Z,Z],E=R>=v-m,S=m>0&&!E?n4(v,m,h)-1:0,k=d[1],b;if(_0(a,l,r,s,C,(_,K,J,c1,w1)=>{if(_.sticky&&Z>_.sourceIndex)return;let h1=_.sourceIndexN[1],r1=_.sourceIndex===d[0];if(!(!r1&&(h1||G)))return j4(w1,J,i,v,h,m,w,void 0,(a1,R1,Q)=>{if(R1!==R&&R1!==k)return;let I1=K,v1=_.width;if(x.span!==void 0){let g1=r3(x.span,K,a1,_.width,Q,_,o),W1=_.sticky?g1[0]:g1[1];W1!==void 0&&(I1=W1.x,v1=W1.width)}return R1===k&&r1&&L&&(b=()=>{var g1,W1;c1>I1&&!_.sticky&&(e.beginPath(),e.rect(c1,0,t-c1,i),e.clip()),e.beginPath(),e.rect(I1+v1-4,a1+Q-4,4,4),e.fillStyle=(W1=(g1=_.themeOverride)==null?void 0:g1.accentColor)!=null?W1:n.accentColor,e.fill()}),b!==void 0}),b!==void 0}),b===void 0)return;let D=()=>{e.save(),e.beginPath(),e.rect(0,C,t,i-C-S),e.clip(),b==null||b(),e.restore()};return D(),D}function qH(e,t,i,l,r,s,a,o,n){n===void 0||n.size===0||(e.beginPath(),l3(t,i,s,l,(C,c,h,g,m,w)=>{n.hasItemInRectangle({x:C[0],y:-2,width:C[1]-C[0]+1,height:1})&&e.rect(h,g,m,w)}),_0(t,o,s,a,r,(C,c,h,g)=>{let m=Math.max(0,g-c),w=c+m+1,L=C.width-m-1;n.has([C.sourceIndex,-1])&&e.rect(w,l,L,r-l)}),e.clip())}function $H(e,t,i,l,r,s,a,o,n,C){let c=0;return _0(e,s,l,r,i,(h,g,m,w,L)=>(j4(L,m,t,a,o,n,C,void 0,(v,V,u,d)=>{d||(c=Math.max(V,c))}),!0)),c}function K8(e,t){var n2,c2;let{canvasCtx:i,headerCanvasCtx:l,width:r,height:s,cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mappedColumns:c,enableGroups:h,freezeColumns:g,dragAndDropState:m,theme:w,drawFocus:L,headerHeight:v,groupHeaderHeight:V,disabledRows:u,rowHeight:d,verticalBorder:p,overrideCursor:Z,isResizing:R,selection:x,fillHandle:N,freezeTrailingRows:E,rows:S,getCellContent:k,getGroupDetails:b,getRowThemeOverride:D,isFocused:B,drawHeaderCallback:_,prelightCells:K,drawCellCallback:J,highlightRegions:c1,resizeCol:w1,imageLoader:h1,lastBlitData:G,hoverValues:r1,hyperWrapping:a1,hoverInfo:R1,spriteManager:Q,maxScaleFactor:I1,hasAppendRow:v1,touchMode:J1,enqueue:g1,renderStateProvider:W1,getCellRenderer:E2,renderStrategy:Z2,bufferACtx:u2,bufferBCtx:y1,damage:e2,minimumCellWidth:w2}=e;if(r===0||s===0)return;let t2=Z2==="double-buffer",s1=Math.min(I1,Math.ceil((n2=window.devicePixelRatio)!=null?n2:1)),T1=Z2!=="direct"&&Bs(e,t),i2=i.canvas;(i2.width!==r*s1||i2.height!==s*s1)&&(i2.width=r*s1,i2.height=s*s1,i2.style.width=r+"px",i2.style.height=s+"px");let q1=l.canvas,F1=h?V+v:v,$1=F1+1;(q1.width!==r*s1||q1.height!==$1*s1)&&(q1.width=r*s1,q1.height=$1*s1,q1.style.width=r+"px",q1.style.height=$1+"px");let U1=u2.canvas,H2=y1.canvas;t2&&(U1.width!==r*s1||U1.height!==s*s1)&&(U1.width=r*s1,U1.height=s*s1,G.current!==void 0&&(G.current.aBufferScroll=void 0)),t2&&(H2.width!==r*s1||H2.height!==s*s1)&&(H2.width=r*s1,H2.height=s*s1,G.current!==void 0&&(G.current.bBufferScroll=void 0));let t1=G.current;if(T1===!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 H1=null;t2&&(H1=i);let f1=l,b1;t2?e2!==void 0?b1=(t1==null?void 0:t1.lastBuffer)==="b"?y1:u2:b1=(t1==null?void 0:t1.lastBuffer)==="b"?u2:y1:b1=i;let z2=b1.canvas,o1=t2?z2===U1?H2:U1:i2,L1=typeof d=="number"?()=>d:d;f1.save(),b1.save(),f1.beginPath(),b1.beginPath(),f1.textBaseline="middle",b1.textBaseline="middle",s1!==1&&(f1.scale(s1,s1),b1.scale(s1,s1));let i1=O9(c,a,r,m,n),p1=[],Z1=L&&((c2=x.current)==null?void 0:c2.cell[1])===o&&C===0,R2=!1;if(c1!==void 0){for(let L2 of c1)if(L2.style!=="no-outline"&&L2.range.y===o&&C===0){R2=!0;break}}let Q2=()=>{var L2,A2;qi(f1,i1,h,R1,r,n,v,V,m,R,x,w,Q,r1,p,b,e2,_,J1),$8(f1,i1,o,n,C,r,s,void 0,void 0,V,F1,L1,D,p,E,S,w,!0),f1.beginPath(),f1.moveTo(0,$1-.5),f1.lineTo(r,$1-.5),f1.strokeStyle=y0((A2=(L2=w.headerBottomBorderColor)!=null?L2:w.horizontalBorderColor)!=null?A2:w.borderColor,w.bgHeader),f1.stroke(),R2&&U8(f1,r,s,a,o,n,C,c,g,v,V,d,E,S,c1,w),Z1&&o3(f1,r,s,o,n,C,i1,c,w,F1,x,L1,k,E,v1,N,S)};if(e2!==void 0){let L2=i1[i1.length-1].sourceIndex+1,A2=e2.hasItemInRegion([{x:a,y:-2,width:L2,height:2},{x:a,y:o,width:L2,height:300},{x:0,y:o,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:a,y:S-E,width:L2,height:E,when:E>0}]),y2=F2=>{f8(F2,i1,c,s,F1,n,C,o,S,L1,k,b,D,u,B,L,E,v1,p1,e2,x,K,c1,h1,Q,r1,R1,J,a1,w,g1,W1,E2,Z,w2);let Z0=x.current;N&&L&&Z0!==void 0&&e2.has(X7(Z0.range))&&o3(F2,r,s,o,n,C,i1,c,w,F1,x,L1,k,E,v1,N,S)};A2&&(y2(b1),H1!==null&&(H1.save(),H1.scale(s1,s1),H1.textBaseline="middle",y2(H1),H1.restore()),e2.hasHeader()&&(qH(f1,i1,r,V,F1,n,C,o,e2),Q2())),b1.restore(),f1.restore();return}if((T1!==!0||a!==(t1==null?void 0:t1.cellXOffset)||n!==(t1==null?void 0:t1.translateX)||Z1!==(t1==null?void 0:t1.mustDrawFocusOnHeader)||R2!==(t1==null?void 0:t1.mustDrawHighlightRingsOnHeader))&&Q2(),T1===!0){d0(o1!==void 0&&t1!==void 0);let{regions:L2}=Ns(b1,o1,o1===U1?t1.aBufferScroll:t1.bBufferScroll,o1===U1?t1.bBufferScroll:t1.aBufferScroll,t1,a,o,n,C,E,r,s,S,F1,s1,c,i1,d,t2);p1=L2}else T1!==!1&&(d0(t1!==void 0),p1=Rs(t1,a,o,n,C,r,s,F1,i1,T1));fs(b1,i1,r,s,E,S,p,L1,w);let e0=U8(b1,r,s,a,o,n,C,c,g,v,V,d,E,S,c1,w),t0=L?o3(b1,r,s,o,n,C,i1,c,w,F1,x,L1,k,E,v1,N,S):void 0;if(b1.fillStyle=w.bgCell,p1.length>0){b1.beginPath();for(let L2 of p1)b1.rect(L2.x,L2.y,L2.width,L2.height);b1.clip(),b1.fill(),b1.beginPath()}else b1.fillRect(0,0,r,s);let c0=f8(b1,i1,c,s,F1,n,C,o,S,L1,k,b,D,u,B,L,E,v1,p1,e2,x,K,c1,h1,Q,r1,R1,J,a1,w,g1,W1,E2,Z,w2);xs(b1,i1,c,r,s,F1,n,C,o,S,L1,D,x.rows,u,E,v1,p1,e2,w),Es(b1,i1,o,n,C,r,s,p1,F1,L1,D,p,E,S,w),$8(b1,i1,o,n,C,r,s,p1,c0,V,F1,L1,D,p,E,S,w),e0==null||e0(),t0==null||t0(),R&&_0(i1,0,n,0,F1,(L2,A2)=>{var y2,F2;return L2.sourceIndex===w1?(G8(f1,A2+L2.width,0,F1+1,y0((y2=w.resizeIndicatorColor)!=null?y2:w.accentLight,w.bgHeader)),G8(b1,A2+L2.width,F1,s,y0((F2=w.resizeIndicatorColor)!=null?F2:w.accentLight,w.bgCell)),!0):!1}),H1!==null&&(H1.fillStyle=w.bgCell,H1.fillRect(0,0,r,s),H1.drawImage(b1.canvas,0,0));let Y2=$H(i1,s,F1,n,C,o,S,L1,E,v1);h1==null||h1.setWindow({x:a,y:o,width:i1.length,height:Y2-o},g,Array.from({length:E},(L2,A2)=>S-1-A2));let J2=t1!==void 0&&(a!==t1.cellXOffset||n!==t1.translateX),k0=t1!==void 0&&(o!==t1.cellYOffset||C!==t1.translateY);G.current={cellXOffset:a,cellYOffset:o,translateX:n,translateY:C,mustDrawFocusOnHeader:Z1,mustDrawHighlightRingsOnHeader:R2,lastBuffer:t2?z2===U1?"a":"b":void 0,aBufferScroll:z2===U1?[J2,k0]:t1==null?void 0:t1.aBufferScroll,bBufferScroll:z2===H2?[J2,k0]:t1==null?void 0:t1.bBufferScroll},b1.restore(),f1.restore()}var X8=x1(q9(),1);var UH=80;function GH(e){let t=e-1;return t*t*t+1}var n3=class{constructor(t){C2(this,"callback");C2(this,"currentHoveredItem");C2(this,"leavingItems",[]);C2(this,"lastAnimationTime");C2(this,"addToLeavingItems",t=>{this.leavingItems.some(l=>d5(l.item,t.item))||this.leavingItems.push(t)});C2(this,"removeFromLeavingItems",t=>{var l;let i=this.leavingItems.find(r=>d5(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==i),(l=i==null?void 0:i.hoverAmount)!=null?l:0});C2(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});C2(this,"shouldStep",()=>{let t=this.leavingItems.length>0,i=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||i});C2(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>T(y({},t),{hoverAmount:GH(t.hoverAmount)})));C2(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{let l=(t-this.lastAnimationTime)/UH;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});C2(this,"setHovered",t=>{var i;if(!d5((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){C2(this,"fn");C2(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 zs=Y8(()=>window.navigator.userAgent.includes("Firefox")),o9=Y8(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),p5=Y8(()=>window.navigator.platform.toLowerCase().startsWith("mac"));var M5=x1(k1(),1);function ys(e){let t=M5.useRef([]),i=M5.useRef(0),l=M5.useRef(e);l.current=e;let r=M5.useCallback(()=>{let s=()=>window.requestAnimationFrame(a),a=()=>{let o=t.current.map(e9);t.current=[],l.current(new z4(o)),t.current.length>0?i.current++:i.current=0};window.requestAnimationFrame(i.current>600?s:a)},[]);return M5.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",n9="out-of-bounds",x5;(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"})(x5||(x5={}));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 bs=6,KH=(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:""},XH=(e,t)=>{var w4,g0,H0,i0,h0,A5,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:h,rows:g,getCellContent:m,getRowThemeOverride:w,onHeaderMenuClick:L,enableGroups:v,isFilling:V,onCanvasFocused:u,onCanvasBlur:d,isFocused:p,selection:Z,freezeColumns:R,onContextMenu:x,freezeTrailingRows:N,fixedShadowX:E=!0,fixedShadowY:S=!0,drawFocusRing:k,onMouseDown:b,onMouseUp:D,onMouseMoveRaw:B,onMouseMove:_,onItemHovered:K,dragAndDropState:J,firstColAccessible:c1,onKeyDown:w1,onKeyUp:h1,highlightRegions:G,canvasRef:r1,onDragStart:a1,onDragEnd:R1,eventTargetRef:Q,isResizing:I1,resizeColumn:v1,isDragging:J1,isDraggable:g1=!1,allowResize:W1,disabledRows:E2,hasAppendRow:Z2,getGroupDetails:u2,theme:y1,prelightCells:e2,headerIcons:w2,verticalBorder:t2,drawCell:s1,drawHeader:T1,onCellFocused:i2,onDragOverCell:q1,onDrop:F1,onDragLeave:$1,imageWindowLoader:U1,smoothScrollX:H2=!1,smoothScrollY:t1=!1,experimental:H1,getCellRenderer:f1}=e,b1=(w4=e.translateX)!=null?w4:0,z2=(g0=e.translateY)!=null?g0:0,o1=Math.max(R,Math.min(s.length-1,a)),L1=e1.useRef(null),i1=U1,p1=e1.useRef(),[Z1,R2]=e1.useState(!1),Q2=e1.useRef([]),e0=e1.useRef(),[t0,c0]=e1.useState(),[Y2,J2]=e1.useState(),k0=e1.useRef(null),[n2,c2]=e1.useState(),[L2,A2]=e1.useState(!1),y2=e1.useRef(L2);y2.current=L2;let F2=e1.useMemo(()=>new t3(w2,()=>{x4.current=void 0,e5.current()}),[w2]),Z0=v?c+n:n,C4=e1.useRef(-1),T0=((H0=H1==null?void 0:H1.enableFirefoxRescaling)!=null?H0:!1)&&zs.value,m0=((i0=H1==null?void 0:H1.enableSafariRescaling)!=null?i0:!1)&&o9.value;e1.useLayoutEffect(()=>{window.devicePixelRatio===1||!T0&&!m0||(C4.current!==-1&&R2(!0),window.clearTimeout(C4.current),C4.current=window.setTimeout(()=>{R2(!1),C4.current=-1},200))},[o,o1,b1,z2,T0,m0]);let B1=Zt(s,R),S2=E?N4(B1,J):0,X1=e1.useCallback((z,j,M1)=>{let u1=z.getBoundingClientRect();if(j>=B1.length||M1>=g)return;let n1=u1.width/i,Y=_9(j,M1,i,l,c,Z0,o1,o,b1,z2,g,R,N,B1,h);return n1!==1&&(Y.x*=n1,Y.y*=n1,Y.width*=n1,Y.height*=n1),Y.x+=u1.x,Y.y+=u1.y,Y},[i,l,c,Z0,o1,o,b1,z2,g,R,N,B1,h]),N2=e1.useCallback((z,j,M1,u1)=>{var O2,V0;let n1=z.getBoundingClientRect(),Y=n1.width/i,_1=(j-n1.left)/Y,K1=(M1-n1.top)/Y,m1=5,q2=O9(B1,o1,i,void 0,b1),l2=0,G1=0;u1 instanceof MouseEvent&&(l2=u1.button,G1=u1.buttons);let d2=zt(_1,q2,b1),Y1=yt(K1,l,v,n,c,g,h,o,z2,N),k2=(u1==null?void 0:u1.shiftKey)===!0,l0=(u1==null?void 0:u1.ctrlKey)===!0,X0=(u1==null?void 0:u1.metaKey)===!0,$2=u1!==void 0&&!(u1 instanceof MouseEvent)||(u1==null?void 0:u1.pointerType)==="touch",U2=[_1<0?-1:i<_1?1:0,K1i||K1>l){let v2=_1>i?1:_1<0?-1:0,t4=K1>l?1:K1<0?-1:0,M0=v2*2,i4=t4*2;v2===0&&(M0=d2===-1?x5.EndPadding:x5.Center),t4===0&&(i4=Y1===void 0?x5.EndPadding:x5.Center);let j0=!1;if(d2===-1&&Y1===-1){let i5=X1(z,B1.length-1,-1);d0(i5!==void 0),j0=ji&&_1l&&K1=0?(t4=!0,v2=X1(z,M0,Y1),d0(v2!==void 0),I2={kind:v&&Y1===-2?S0:y4,location:[M0,Y1],bounds:v2,group:(O2=B1[M0].group)!=null?O2:"",isEdge:t4,shiftKey:k2,ctrlKey:l0,metaKey:X0,isTouch:$2,localEventX:j-v2.x,localEventY:M1-v2.y,button:l2,buttons:G1,scrollEdge:U2}):I2={kind:v&&Y1===-2?S0:y4,group:(V0=B1[d2].group)!=null?V0:"",location:[d2,Y1],bounds:v2,isEdge:t4,shiftKey:k2,ctrlKey:l0,metaKey:X0,isTouch:$2,localEventX:j-v2.x,localEventY:M1-v2.y,button:l2,buttons:G1,scrollEdge:U2}}else{let v2=X1(z,d2,Y1);d0(v2!==void 0);let t4=v2!==void 0&&v2.x+v2.width-j{}),M4=e1.useRef(t0);M4.current=t0;let[P0,$0]=e1.useMemo(()=>{let z=document.createElement("canvas"),j=document.createElement("canvas");return z.style.display="none",z.style.opacity="0",z.style.position="fixed",j.style.display="none",j.style.opacity="0",j.style.position="fixed",[z.getContext("2d",{alpha:!1}),j.getContext("2d",{alpha:!1})]},[]);e1.useLayoutEffect(()=>{if(!(P0===null||$0===null))return document.documentElement.append(P0.canvas),document.documentElement.append($0.canvas),()=>{P0.canvas.remove(),$0.canvas.remove()}},[P0,$0]);let S4=e1.useMemo(()=>new j7,[]),e7=T0&&Z1?1:m0&&Z1?2:5,t7=(H1==null?void 0:H1.disableMinimumCellWidth)===!0?1:10,x4=e1.useRef(),B5=e1.useRef(null),z5=e1.useRef(null),y5=e1.useCallback(()=>{var _1,K1,m1;let z=L1.current,j=k0.current;if(z===null||j===null||(B5.current===null&&(B5.current=z.getContext("2d",{alpha:!1}),z.width=0,z.height=0),z5.current===null&&(z5.current=j.getContext("2d",{alpha:!1}),j.width=0,j.height=0),B5.current===null||z5.current===null||P0===null||$0===null))return;let M1=!1,u1=q2=>{M1=!0,c2(q2)},n1=x4.current,Y={headerCanvasCtx:z5.current,canvasCtx:B5.current,bufferACtx:P0,bufferBCtx:$0,width:i,height:l,cellXOffset:o1,cellYOffset:o,translateX:Math.round(b1),translateY:Math.round(z2),mappedColumns:B1,enableGroups:v,freezeColumns:R,dragAndDropState:J,theme:y1,headerHeight:n,groupHeaderHeight:c,disabledRows:E2!=null?E2:x2.empty(),rowHeight:h,verticalBorder:t2,isResizing:I1,resizeCol:v1,isFocused:p,selection:Z,fillHandle:C,drawCellCallback:s1,hasAppendRow:Z2,overrideCursor:u1,maxScaleFactor:e7,freezeTrailingRows:N,rows:g,drawFocus:k,getCellContent:m,getGroupDetails:u2!=null?u2:q2=>({name:q2}),getRowThemeOverride:w,drawHeaderCallback:T1,prelightCells:e2,highlightRegions:G,imageLoader:i1,lastBlitData:e0,damage:p1.current,hoverValues:Q2.current,hoverInfo:M4.current,spriteManager:F2,scrolling:Z1,hyperWrapping:(_1=H1==null?void 0:H1.hyperWrapping)!=null?_1:!1,touchMode:L2,enqueue:e4.current,renderStateProvider:S4,renderStrategy:(K1=H1==null?void 0:H1.renderStrategy)!=null?K1:o9.value?"double-buffer":"single-buffer",getCellRenderer:f1,minimumCellWidth:t7};Y.damage===void 0?(x4.current=Y,K8(Y,n1)):K8(Y,void 0),!M1&&(Y.damage===void 0||Y.damage.has((m1=M4==null?void 0:M4.current)==null?void 0:m1[0]))&&c2(void 0)},[P0,$0,i,l,o1,o,b1,z2,B1,v,R,J,y1,n,c,E2,h,t2,I1,Z2,v1,p,Z,C,N,g,k,e7,m,u2,w,s1,T1,e2,G,i1,F2,Z1,H1==null?void 0:H1.hyperWrapping,H1==null?void 0:H1.renderStrategy,L2,S4,f1,t7]),e5=e1.useRef(y5);e1.useLayoutEffect(()=>{y5(),e5.current=y5},[y5]),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,e5.current())})()},[]);let I4=e1.useCallback(z=>{p1.current=z,e5.current(),p1.current=void 0},[]),i7=ys(I4);e4.current=i7;let l7=e1.useCallback(z=>{I4(new z4(z.map(j=>j.cell)))},[I4]);i1.setCallback(I4);let[p3,M3]=e1.useState(!1),[b5,k4]=j1!=null?j1:[],x3=b5!==void 0&&k4===-1,f3=b5!==void 0&&k4===-2,r7=!1,F5=!1,a0=n2;if(a0===void 0&&b5!==void 0&&k4!==void 0&&k4>-1&&k4({contain:"strict",display:"block",cursor:S5}),[S5]),h9=e1.useRef("default"),O4=Q==null?void 0:Q.current;O4!=null&&h9.current!==k5.cursor&&(O4.style.cursor=h9.current=k5.cursor);let G0=e1.useCallback((z,j,M1,u1)=>{if(u2===void 0)return;let n1=u2(z);if(n1.actions!==void 0){let Y=N8(j,n1.actions);for(let[_1,K1]of Y.entries())if(Y4(K1,M1+j.x,u1+K1.y))return n1.actions[_1]}},[u2]),c4=e1.useCallback((z,j,M1,u1)=>{let n1=s[j];if(!J1&&!I1&&n1.hasMenu===!0&&!(Y2!=null&&Y2)){let Y=X1(z,j,-1);d0(Y!==void 0);let _1=E8(Y.x,Y.y,Y.width,Y.height,j5(n1.title)==="rtl");if(M1>_1.x&&M1<_1.x+_1.width&&u1>_1.y&&u1<_1.y+_1.height)return Y}},[s,X1,Y2,J1,I1]),w9=e1.useRef(0),_4=e1.useRef(),g9=e1.useRef(!1),B0=e1.useCallback(z=>{let j=L1.current,M1=Q==null?void 0:Q.current;if(j===null||z.target!==j&&z.target!==M1)return;g9.current=!0;let u1,n1;if(z instanceof MouseEvent?(u1=z.clientX,n1=z.clientY):(u1=z.touches[0].clientX,n1=z.touches[0].clientY),z.target===M1&&M1!==null){let _1=M1.getBoundingClientRect();if(u1>_1.right||n1>_1.bottom)return}let Y=N2(j,u1,n1,z);_4.current=Y.location,Y.isTouch&&(w9.current=Date.now()),y2.current!==Y.isTouch&&A2(Y.isTouch),!(Y.kind===y4&&c4(j,Y.location[0],u1,n1)!==void 0)&&(Y.kind===S0&&G0(Y.group,Y.bounds,Y.localEventX,Y.localEventY)!==void 0||(b==null||b(Y),!Y.isTouch&&g1!==!0&&g1!==Y.kind&&Y.button<3&&Y.button!==1&&z.preventDefault()))},[Q,g1,N2,G0,c4,b]);n0("touchstart",B0,window,!1),n0("mousedown",B0,window,!1);let T5=e1.useRef(0),H9=e1.useCallback(z=>{var G1,d2;let j=T5.current;T5.current=Date.now();let M1=L1.current;if(g9.current=!1,D===void 0||M1===null)return;let u1=Q==null?void 0:Q.current,n1=z.target!==M1&&z.target!==u1,Y,_1,K1=!0;if(z instanceof MouseEvent){if(Y=z.clientX,_1=z.clientY,K1=z.button<3,z.pointerType==="touch")return}else Y=z.changedTouches[0].clientX,_1=z.changedTouches[0].clientY;let m1=N2(M1,Y,_1,z);m1.isTouch&&w9.current!==0&&Date.now()-w9.current>500&&(m1=T(y({},m1),{isLongTouch:!0})),j!==0&&Date.now()-j<(m1.isTouch?1e3:500)&&(m1=T(y({},m1),{isDoubleClick:!0})),y2.current!==m1.isTouch&&A2(m1.isTouch),!n1&&z.cancelable&&K1&&z.preventDefault();let[q2]=m1.location,l2=c4(M1,q2,Y,_1);if(m1.kind===y4&&l2!==void 0){(m1.button!==0||((G1=_4.current)==null?void 0:G1[0])!==q2||((d2=_4.current)==null?void 0:d2[1])!==-1)&&D(m1,!0);return}else if(m1.kind===S0){let Y1=G0(m1.group,m1.bounds,m1.localEventX,m1.localEventY);if(Y1!==void 0){m1.button===0&&Y1.onClick(m1);return}}D(m1,n1)},[D,Q,N2,c4,G0]);n0("mouseup",H9,window,!1),n0("touchend",H9,window,!1);let s7=e1.useCallback(z=>{var l2,G1;let j=L1.current;if(j===null)return;let M1=Q==null?void 0:Q.current,u1=z.target!==j&&z.target!==M1,n1,Y,_1=!0;z instanceof MouseEvent?(n1=z.clientX,Y=z.clientY,_1=z.button<3):(n1=z.changedTouches[0].clientX,Y=z.changedTouches[0].clientY);let K1=N2(j,n1,Y,z);y2.current!==K1.isTouch&&A2(K1.isTouch),!u1&&z.cancelable&&_1&&z.preventDefault();let[m1]=K1.location,q2=c4(j,m1,n1,Y);if(K1.kind===y4&&q2!==void 0)K1.button===0&&((l2=_4.current)==null?void 0:l2[0])===m1&&((G1=_4.current)==null?void 0:G1[1])===-1&&(L==null||L(m1,q2));else if(K1.kind===S0){let d2=G0(K1.group,K1.bounds,K1.localEventX,K1.localEventY);d2!==void 0&&K1.button===0&&d2.onClick(K1)}},[Q,N2,c4,L,G0]);n0("click",s7,window,!1);let Z3=e1.useCallback(z=>{let j=L1.current,M1=Q==null?void 0:Q.current;if(j===null||z.target!==j&&z.target!==M1||x===void 0)return;let u1=N2(j,z.clientX,z.clientY,z);x(u1,()=>{z.cancelable&&z.preventDefault()})},[Q,N2,x]);n0("contextmenu",Z3,(h0=Q==null?void 0:Q.current)!=null?h0:null,!1);let a7=e1.useCallback(z=>{p1.current=new z4(z.map(j=>j.item)),Q2.current=z,e5.current(),p1.current=void 0},[]),m4=e1.useMemo(()=>new n3(a7),[a7]),T4=e1.useRef(m4);T4.current=m4,e1.useLayoutEffect(()=>{let z=T4.current;if(j1===void 0||j1[1]<0){z.setHovered(j1);return}let j=m(j1,!0),M1=f1(j),u1=M1===void 0&&j.kind===C1.Custom||(M1==null?void 0:M1.needsHover)!==void 0&&(typeof M1.needsHover=="boolean"?M1.needsHover:M1.needsHover(j));z.setHovered(u1?j1:void 0)},[m,f1,j1]);let K0=e1.useRef(),A=e1.useCallback(z=>{var K1;let j=L1.current;if(j===null)return;let M1=Q==null?void 0:Q.current,u1=z.target!==j&&z.target!==M1,n1=N2(j,z.clientX,z.clientY,z);if(n1.kind!=="out-of-bounds"&&u1&&!g9.current&&!n1.isTouch)return;let Y=(m1,q2)=>{c0(l2=>l2===m1||(l2==null?void 0:l2[0][0])===(m1==null?void 0:m1[0][0])&&(l2==null?void 0:l2[0][1])===(m1==null?void 0:m1[0][1])&&((l2==null?void 0:l2[1][0])===(m1==null?void 0:m1[1][0])&&(l2==null?void 0:l2[1][1])===(m1==null?void 0:m1[1][1])||!q2)?l2:m1)};if(!C3(n1,K0.current))c2(void 0),K==null||K(n1),Y(n1.kind===n9?void 0:[n1.location,[n1.localEventX,n1.localEventY]],!0),K0.current=n1;else if(n1.kind==="cell"||n1.kind===y4||n1.kind===S0){let m1=!1,q2=!0;if(n1.kind==="cell"){let G1=m(n1.location),d2=(K1=f1(G1))==null?void 0:K1.needsHoverPosition;q2=d2!=null?d2:G1.kind===C1.Custom,m1=q2}else n1.kind===S0&&(m1=!0);let l2=[n1.location,[n1.localEventX,n1.localEventY]];Y(l2,q2),M4.current=l2,m1&&I4(new z4([n1.location]))}let _1=n1.location[0]>=(c1?0:1);J2(n1.kind===y4&&n1.isEdge&&_1&&W1===!0),M3(n1.kind==="cell"&&n1.isFillHandle),B==null||B(z),_(n1)},[Q,N2,c1,W1,B,_,K,m,f1,I4]);n0("mousemove",A,window,!0);let W2=e1.useCallback(z=>{let j=L1.current;if(j===null)return;let M1,u1;Z.current!==void 0&&(M1=X1(j,Z.current.cell[0],Z.current.cell[1]),u1=Z.current.cell),w1==null||w1({bounds:M1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:u1})},[w1,Z,X1]),t5=e1.useCallback(z=>{let j=L1.current;if(j===null)return;let M1,u1;Z.current!==void 0&&(M1=X1(j,Z.current.cell[0],Z.current.cell[1]),u1=Z.current.cell),h1==null||h1({bounds:M1,stopPropagation:()=>z.stopPropagation(),preventDefault:()=>z.preventDefault(),cancel:()=>{},ctrlKey:z.ctrlKey,metaKey:z.metaKey,shiftKey:z.shiftKey,altKey:z.altKey,key:z.key,keyCode:z.keyCode,rawEvent:z,location:u1})},[h1,Z,X1]),E3=e1.useCallback(z=>{L1.current=z,r1!==void 0&&(r1.current=z)},[r1]),o7=e1.useCallback(z=>{var G1;let j=L1.current;if(j===null||g1===!1||I1){z.preventDefault();return}let M1,u1,n1=N2(j,z.clientX,z.clientY);if(g1!==!0&&n1.kind!==g1){z.preventDefault();return}let Y=(d2,Y1)=>{M1=d2,u1=Y1},_1,K1,m1,q2=(d2,Y1,k2)=>{_1=d2,K1=Y1,m1=k2},l2=!1;if(a1==null||a1(T(y({},n1),{setData:Y,setDragImage:q2,preventDefault:()=>l2=!0,defaultPrevented:()=>l2})),!l2&&M1!==void 0&&u1!==void 0&&z.dataTransfer!==null)if(z.dataTransfer.setData(M1,u1),z.dataTransfer.effectAllowed="copyLink",_1!==void 0&&K1!==void 0&&m1!==void 0)z.dataTransfer.setDragImage(_1,K1,m1);else{let[d2,Y1]=n1.location;if(Y1!==void 0){let k2=document.createElement("canvas"),l0=X1(j,d2,Y1);d0(l0!==void 0);let X0=Math.ceil((G1=window.devicePixelRatio)!=null?G1:1);k2.width=l0.width*X0,k2.height=l0.height*X0;let $2=k2.getContext("2d");$2!==null&&($2.scale(X0,X0),$2.textBaseline="middle",Y1===-1?($2.font=y1.headerFontFull,$2.fillStyle=y1.bgHeader,$2.fillRect(0,0,k2.width,k2.height),R8($2,0,0,l0.width,l0.height,B1[d2],!1,y1,!1,!1,0,F2,T1,!1)):($2.font=y1.baseFontFull,$2.fillStyle=y1.bgCell,$2.fillRect(0,0,k2.width,k2.height),Z8($2,m([d2,Y1]),0,Y1,!1,!1,0,0,l0.width,l0.height,!1,y1,y1.bgCell,i1,F2,1,void 0,!1,0,void 0,void 0,void 0,S4,f1,()=>{}))),k2.style.left="-100%",k2.style.position="absolute",k2.style.width=`${l0.width}px`,k2.style.height=`${l0.height}px`,document.body.append(k2),z.dataTransfer.setDragImage(k2,l0.width/2,l0.height/2),window.setTimeout(()=>{k2.remove()},0)}}else z.preventDefault()},[g1,I1,N2,a1,X1,y1,B1,F2,T1,m,i1,S4,f1]);n0("dragstart",o7,(A5=Q==null?void 0:Q.current)!=null?A5:null,!1,!1);let L9=e1.useRef(),N3=e1.useCallback(z=>{var m1;let j=L1.current;if(F1!==void 0&&z.preventDefault(),j===null||q1===void 0)return;let M1=N2(j,z.clientX,z.clientY),[u1,n1]=M1.location,Y=u1-(c1?0:1),[_1,K1]=(m1=L9.current)!=null?m1:[];(_1!==Y||K1!==n1)&&(L9.current=[Y,n1],q1([Y,n1],z.dataTransfer))},[c1,N2,q1,F1]);n0("dragover",N3,(n7=Q==null?void 0:Q.current)!=null?n7:null,!1,!1);let V9=e1.useCallback(()=>{L9.current=void 0,R1==null||R1()},[R1]);n0("dragend",V9,(u9=Q==null?void 0:Q.current)!=null?u9:null,!1,!1);let W=e1.useCallback(z=>{let j=L1.current;if(j===null||F1===void 0)return;z.preventDefault();let M1=N2(j,z.clientX,z.clientY),[u1,n1]=M1.location,Y=u1-(c1?0:1);F1([Y,n1],z.dataTransfer)},[c1,N2,F1]);n0("drop",W,(L0=Q==null?void 0:Q.current)!=null?L0:null,!1,!1);let E0=e1.useCallback(()=>{$1==null||$1()},[$1]);n0("dragleave",E0,(N0=Q==null?void 0:Q.current)!=null?N0:null,!1,!1);let o0=e1.useRef(Z);o0.current=Z;let P5=e1.useRef(null),d9=e1.useCallback(z=>{var j;L1.current===null||!L1.current.contains(document.activeElement)||(z===null&&o0.current.current!==void 0?(j=r1==null?void 0:r1.current)==null||j.focus({preventScroll:!0}):z!==null&&z.focus({preventScroll:!0}),P5.current=z)},[r1]);e1.useImperativeHandle(t,()=>({focus:()=>{var j;let z=P5.current;z===null||!document.contains(z)?(j=r1==null?void 0:r1.current)==null||j.focus({preventScroll:!0}):z.focus({preventScroll:!0})},getBounds:(z,j)=>{if(!(r1===void 0||r1.current===null))return X1(r1.current,z!=null?z:0,j!=null?j:-1)},damage:l7}),[r1,l7,X1]);let W4=e1.useRef(),D0=et(()=>{var K1,m1,q2,l2;if(i<50||(H1==null?void 0:H1.disableAccessibilityTree)===!0)return null;let z=O9(B1,o1,i,J,b1),j=c1?0:-1;!c1&&((K1=z[0])==null?void 0:K1.sourceIndex)===0&&(z=z.slice(1));let[M1,u1]=(q2=(m1=Z.current)==null?void 0:m1.cell)!=null?q2:[],n1=(l2=Z.current)==null?void 0:l2.range,Y=z.map(G1=>G1.sourceIndex),_1=(0,Fs.default)(o,Math.min(g,o+r));return M1!==void 0&&u1!==void 0&&!(Y.includes(M1)&&_1.includes(u1))&&d9(null),e1.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":B1.length+j},e1.createElement("thead",{role:"rowgroup"},e1.createElement("tr",{role:"row","aria-rowindex":1},z.map(G1=>e1.createElement("th",{role:"columnheader","aria-selected":Z.columns.hasIndex(G1.sourceIndex),"aria-colindex":G1.sourceIndex+1+j,tabIndex:-1,onFocus:d2=>{if(d2.target!==P5.current)return i2==null?void 0:i2([G1.sourceIndex,-1])},key:G1.sourceIndex},G1.title)))),e1.createElement("tbody",{role:"rowgroup"},_1.map(G1=>e1.createElement("tr",{role:"row","aria-selected":Z.rows.hasIndex(G1),key:G1,"aria-rowindex":G1+2},z.map(d2=>{let Y1=d2.sourceIndex,k2=F0(Y1,G1),l0=M1===Y1&&u1===G1,X0=n1!==void 0&&Y1>=n1.x&&Y1=n1.y&&G1{let O2=r1==null?void 0:r1.current;if(O2!=null)return w1==null?void 0:w1({bounds:X1(O2,Y1,G1),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:U2})},onFocusCapture:O2=>{var V0,v2;if(!(O2.target===P5.current||((V0=W4.current)==null?void 0:V0[0])===Y1&&((v2=W4.current)==null?void 0:v2[1])===G1))return W4.current=U2,i2==null?void 0:i2(U2)},ref:l0?d9:void 0,tabIndex:-1},KH(I2,f1))})))))},[i,B1,o1,J,b1,g,o,r,Z,d9,m,r1,w1,X1,i2],200),h4=R===0||!E?0:o1>R?1:(0,Q8.default)(-b1/100,0,1),R3=-o*32+z2,D5=S?(0,Q8.default)(-R3/100,0,1):0,B3=e1.useMemo(()=>{if(!h4&&!D5)return null;let z={position:"absolute",top:0,left:S2,width:i-S2,height:l,opacity:h4,pointerEvents:"none",transition:H2?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},j={position:"absolute",top:Z0,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,h4>0&&e1.createElement("div",{id:"shadow-x",style:z}),D5>0&&e1.createElement("div",{id:"shadow-y",style:j}))},[h4,D5,S2,i,H2,Z0,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:W2,onKeyUp:t5,onFocus:u,onBlur:d,ref:E3,style:k5},D0),e1.createElement("canvas",{ref:k0,style:z3}),B3)},Ss=e1.memo(e1.forwardRef(XH));function j9(e,t,i,l){var r;return(0,ks.default)(Math.round(t-((r=e.growOffset)!=null?r:0)),Math.ceil(i),Math.floor(l))}var jH=e=>{var t2;let[t,i]=D2.useState(),[l,r]=D2.useState(),[s,a]=D2.useState(),[o,n]=D2.useState(),[C,c]=D2.useState(!1),[h,g]=D2.useState(),[m,w]=D2.useState(),[L,v]=D2.useState(),[V,u]=D2.useState(!1),[d,p]=D2.useState(),{onHeaderMenuClick:Z,getCellContent:R,onColumnMoved:x,onColumnResize:N,onColumnResizeStart:E,onColumnResizeEnd:S,gridRef:k,maxColumnWidth:b,minColumnWidth:D,onRowMoved:B,lockColumns:_,onColumnProposeMove:K,onMouseDown:J,onMouseUp:c1,onItemHovered:w1,onDragStart:h1,canvasRef:G}=e,r1=((t2=N!=null?N:S)!=null?t2:E)!==void 0,{columns:a1,selection:R1}=e,Q=R1.columns,I1=D2.useCallback(s1=>{let[T1,i2]=s1.location;s!==void 0&&o!==T1&&T1>=_?(c(!0),n(T1)):m!==void 0&&i2!==void 0?(u(!0),v(Math.max(0,i2))):l===void 0&&!C&&!V&&(w1==null||w1(s1))},[s,m,o,w1,_,l,C,V]),v1=x!==void 0,J1=D2.useCallback(s1=>{var T1,i2;if(s1.button===0){let[q1,F1]=s1.location;if(s1.kind==="out-of-bounds"&&s1.isEdge&&r1){let $1=(T1=k==null?void 0:k.current)==null?void 0:T1.getBounds(a1.length-1,-1);$1!==void 0&&(i($1.x),r(a1.length-1))}else if(s1.kind==="header"&&q1>=_){let $1=G==null?void 0:G.current;if(s1.isEdge&&r1&&$1){i(s1.bounds.x),r(q1);let H2=$1.getBoundingClientRect().width/$1.offsetWidth,t1=s1.bounds.width/H2;E==null||E(a1[q1],t1,q1,t1+((i2=a1[q1].growOffset)!=null?i2:0))}else s1.kind==="header"&&v1&&(g(s1.bounds.x),a(q1))}else s1.kind==="cell"&&_>0&&q1===0&&F1!==void 0&&B!==void 0&&(p(s1.bounds.y),w(F1))}J==null||J(s1)},[J,r1,_,B,k,a1,v1,E,G]),g1=D2.useCallback((s1,T1)=>{C||V||Z==null||Z(s1,T1)},[C,V,Z]),W1=D2.useRef(-1),E2=D2.useCallback(()=>{W1.current=-1,w(void 0),v(void 0),p(void 0),u(!1),a(void 0),n(void 0),g(void 0),c(!1),r(void 0),i(void 0)},[]),Z2=D2.useCallback((s1,T1)=>{var i2,q1,F1;if(s1.button===0){if(l!==void 0){if((Q==null?void 0:Q.hasIndex(l))===!0)for(let U1 of Q){if(U1===l)continue;let H2=a1[U1],t1=j9(H2,W1.current,D,b);N==null||N(H2,t1,U1,t1+((i2=H2.growOffset)!=null?i2:0))}let $1=j9(a1[l],W1.current,D,b);if(S==null||S(a1[l],$1,l,$1+((q1=a1[l].growOffset)!=null?q1:0)),Q.hasIndex(l))for(let U1 of Q){if(U1===l)continue;let H2=a1[U1],t1=j9(H2,W1.current,D,b);S==null||S(H2,t1,U1,t1+((F1=H2.growOffset)!=null?F1:0))}}E2(),s!==void 0&&o!==void 0&&(x==null||x(s,o)),m!==void 0&&L!==void 0&&(B==null||B(m,L))}c1==null||c1(s1,T1)},[c1,l,s,o,m,L,Q,S,a1,D,b,N,x,B,E2]),u2=D2.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]),y1=D2.useCallback(s1=>{var i2,q1;let T1=G==null?void 0:G.current;if(s!==void 0&&h!==void 0)Math.abs(s1.clientX-h)>20&&c(!0);else if(m!==void 0&&d!==void 0)Math.abs(s1.clientY-d)>20&&u(!0);else if(l!==void 0&&t!==void 0&&T1){let $1=T1.getBoundingClientRect().width/T1.offsetWidth,U1=(s1.clientX-t)/$1,H2=a1[l],t1=j9(H2,U1,D,b);if(N==null||N(H2,t1,l,t1+((i2=H2.growOffset)!=null?i2:0)),W1.current=U1,(Q==null?void 0:Q.first())===l)for(let H1 of Q){if(H1===l)continue;let f1=a1[H1],b1=j9(f1,W1.current,D,b);N==null||N(f1,b1,H1,b1+((q1=f1.growOffset)!=null?q1:0))}}},[s,h,m,d,l,t,a1,D,b,N,Q,G]),e2=D2.useCallback((s1,T1)=>{if(m===void 0||L===void 0)return R(s1,T1);let[i2,q1]=s1;return q1===L?q1=m:(q1>L&&(q1-=1),q1>=m&&(q1+=1)),R([i2,q1],T1)},[m,L,R]),w2=D2.useCallback(s1=>{h1==null||h1(s1),s1.defaultPrevented()||E2()},[E2,h1]);return D2.createElement(Ss,{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:e2,isResizing:l!==void 0,onHeaderMenuClick:g1,isDragging:C,onItemHovered:I1,onDragStart:w2,onMouseDown:J1,allowResize:r1,onMouseUp:Z2,dragAndDropState:u2,onMouseMoveRaw:y1,ref:k})},Ts=jH;var V2=x1(k1(),1);var C9=x1(k1(),1);function Ps(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]),y({ref:t},i)}var Q4=x1(k1(),1),YH=(e,t,i)=>{let l=(0,Q4.useRef)(null),r=(0,Q4.useRef)(null),s=(0,Q4.useRef)(null),a=(0,Q4.useRef)(0),o=(0,Q4.useRef)(t);o.current=t;let n=i.current;(0,Q4.useEffect)(()=>{let C=()=>{var g,m;if(r.current===!1&&n!==null){let w=[n.scrollLeft,n.scrollTop];if(((g=s.current)==null?void 0:g[0])===w[0]&&((m=s.current)==null?void 0:m[1])===w[1])if(a.current>10){s.current=null,r.current=null;return}else a.current++;else a.current=0,o.current(w[0],w[1]),s.current=w;l.current=window.setTimeout(C,8.333333333333334)}},c=()=>{r.current=!0,s.current=null,l.current!==null&&(window.clearTimeout(l.current),l.current=null)},h=g=>{g.touches.length===0&&(r.current=!1,a.current=0,l.current=window.setTimeout(C,8.333333333333334))};if(e&&n!==null){let g=n;return g.addEventListener("touchstart",c),g.addEventListener("touchend",h),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",h),l.current!==null&&window.clearTimeout(l.current)}}},[e,n])},Ds=YH;var QH=()=>e=>e.isSafari?"scroll":"auto",JH=X2("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[QH()]}});function eL(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 As=e=>{var a1,R1,Q,I1;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:h,rightElementProps:g,kineticScrollPerfHack:m=!1,scrollRef:w,initialSize:L}=e,v=[],V=(a1=g==null?void 0:g.sticky)!=null?a1:!1,u=(R1=g==null?void 0:g.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=eL(200),[S,k]=V2.useState(!0),b=V2.useRef(0);V2.useLayoutEffect(()=>{if(!S||E||x.current.lockDirection===void 0)return;let v1=Z.current;if(v1===null)return;let[J1,g1]=x.current.lockDirection;J1!==void 0?v1.scrollLeft=J1:g1!==void 0&&(v1.scrollTop=g1),x.current.lockDirection=void 0},[E,S]);let D=V2.useCallback((v1,J1)=>{var i2,q1,F1,$1;let g1=Z.current;if(g1===null)return;J1=J1!=null?J1:g1.scrollTop,v1=v1!=null?v1:g1.scrollLeft;let W1=x.current.scrollTop,E2=x.current.scrollLeft,Z2=v1-E2,u2=J1-W1;E&&Z2!==0&&u2!==0&&(Math.abs(Z2)>3||Math.abs(u2)>3)&&n&&x.current.lockDirection===void 0&&(x.current.lockDirection=Math.abs(Z2)0&&(Math.abs(s1)>2e3||t2===0||t2===T1)&&l>g1.scrollHeight+5){let U1=t2/T1,H2=(l-w2)*U1;d.current=H2-t2}y1!==void 0&&(window.clearTimeout(b.current),k(!1),b.current=window.setTimeout(()=>k(!0),200)),s({x:v1,y:t2+d.current,width:e2-c,height:w2-C,paddingRight:($1=(F1=N.current)==null?void 0:F1.clientWidth)!=null?$1:0})},[C,c,l,s,n,E]);Ds(m&&o9.value,D,Z);let B=V2.useRef(D);B.current=D;let _=V2.useRef(),K=V2.useRef(!1);V2.useLayoutEffect(()=>{K.current?D():K.current=!0},[D,C,c]);let J=V2.useCallback(v1=>{Z.current=v1,w!==void 0&&(w.current=v1)},[w]),c1=0,w1=0;for(v.push(V2.createElement("div",{key:c1++,style:{width:r,height:0}}));w1B.current(),0),_.current={width:G,height:r1}),(G!=null?G:0)===0||(r1!=null?r1:0)===0?V2.createElement("div",{ref:h1}):V2.createElement("div",{ref:h1},V2.createElement(JH,{isSafari:o9.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:()=>D()},V2.createElement("div",{className:"dvn-scroll-inner"+(h===void 0?" dvn-hidden":"")},V2.createElement("div",{className:"dvn-stack"},v),h!==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"}},h))))))};var tL=e=>{let{columns:t,rows:i,rowHeight:l,headerHeight:r,groupHeaderHeight:s,enableGroups:a,freezeColumns:o,experimental:n,nonGrowWidth:C,clientSize:c,className:h,onVisibleRegionChanged:g,scrollRef:m,preventDiagonalScrolling:w,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,S]=c,k=W0.useRef(),b=W0.useRef(),D=W0.useRef(),B=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 h1=0;h1{var E2,Z2,u2;if(J.current===void 0)return;let h1=y({},J.current),G=0,r1=h1.x<0?-h1.x:0,a1=0,R1=0;h1.x=h1.x<0?0:h1.x;let Q=0;for(let y1=0;y1=e2+y1.width)G+=y1.width,R1++,a1++;else if(h1.x>e2)G+=y1.width,p?r1+=e2-h1.x:R1++,a1++;else if(h1.x+h1.width>e2)G+=y1.width,a1++;else break}let I1=0,v1=0,J1=0;if(typeof l=="number")Z?(v1=Math.floor(h1.y/l),I1=v1*l-h1.y):v1=Math.ceil(h1.y/l),J1=Math.ceil(h1.height/l)+v1,I1<0&&J1++;else{let y1=0;for(let e2=0;e2=y1+w2)y1+=w2,v1++,J1++;else if(h1.y>t2)y1+=w2,Z?I1+=t2-h1.y:v1++,J1++;else if(h1.y+h1.height>w2/2+y1)y1+=w2,J1++;else break}}let g1={x:R1,y:v1,width:a1-R1,height:J1-v1},W1=k.current;(W1===void 0||W1.y!==g1.y||W1.x!==g1.x||W1.height!==g1.height||W1.width!==g1.width||b.current!==r1||D.current!==I1||h1.width!==((E2=B.current)==null?void 0:E2[0])||h1.height!==((Z2=B.current)==null?void 0:Z2[1]))&&(g==null||g({x:R1,y:v1,width:a1-R1,height:J1-v1},h1.width,h1.height,(u2=h1.paddingRight)!=null?u2:0,r1,I1),k.current=g1,b.current=r1,D.current=I1,B.current=[h1.width,h1.height])},[t,l,i,g,o,p,Z]),w1=W0.useCallback(h1=>{J.current=h1,c1()},[c1]);return W0.useEffect(()=>{c1()},[c1]),W0.createElement(As,{scrollRef:m,className:h,kineticScrollPerfHack:n==null?void 0:n.kineticScrollPerfHack,preventDiagonalScrolling:w,draggable:R===!0||typeof R=="string",scrollWidth:_+(x!=null?x:0),scrollHeight:K+(N!=null?N:0),clientHeight:S,rightElement:L,paddingBottom:N,paddingRight:x,rightElementProps:v,update:w1,initialSize:d},W0.createElement(Ts,{eventTargetRef:m,width:E,height:S,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}))},Is=tL;var Os=X2("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1});var iL=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),lL=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),rL=A1.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},A1.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),sL=10,aL=e=>{let{canvasRef:t,cellYOffset:i,rows:l,columns:r,searchInputRef:s,searchValue:a,searchResults:o,onSearchValueChange:n,getCellsForSelection:C,onSearchResultsChanged:c,showSearch:h=!1,onSearchClose:g}=e,[m]=A1.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[w,L]=A1.useState(""),v=a!=null?a:w,V=A1.useCallback(G=>{L(G),n==null||n(G)},[n]),[u,d]=A1.useState(),p=A1.useRef(u);p.current=u,A1.useEffect(()=>{o!==void 0&&(o.length>0?d(G=>{var r1;return{rowsSearched:l,results:o.length,selectedIndex:(r1=G==null?void 0:G.selectedIndex)!=null?r1:-1}}):d(void 0))},[l,o]);let Z=A1.useRef();Z.current===void 0&&(Z.current=new AbortController);let R=A1.useRef(),[x,N]=A1.useState([]),E=o!=null?o:x,S=A1.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,Z.current.abort())},[]),k=A1.useRef(i);k.current=i;let b=A1.useCallback(G=>{let r1=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i"),a1=k.current,R1=Math.min(10,l),Q=0;d(void 0),N([]);let I1=[],v1=async()=>{var t2,s1;if(C===void 0)return;let J1=performance.now(),g1=l-Q,W1=C({x:0,y:a1,width:r.length,height:Math.min(R1,g1,l-a1)},Z.current.signal);typeof W1=="function"&&(W1=await W1());let E2=!1;for(let[T1,i2]of W1.entries())for(let[q1,F1]of i2.entries()){let $1;switch(F1.kind){case C1.Text:case C1.Number:$1=F1.displayData;break;case C1.Uri:case C1.Markdown:$1=F1.data;break;case C1.Boolean:$1=typeof F1.data=="boolean"?F1.data.toString():void 0;break;case C1.Image:case C1.Bubble:$1=F1.data.join("\u{1F433}");break;case C1.Custom:$1=F1.copyData;break}$1!==void 0&&r1.test($1)&&(I1.push([q1,T1+a1]),E2=!0)}let Z2=performance.now();E2&&N([...I1]),Q+=W1.length,d0(Q<=l);let u2=(s1=(t2=p.current)==null?void 0:t2.selectedIndex)!=null?s1:-1;d({results:I1.length,rowsSearched:Q,selectedIndex:u2}),c==null||c(I1,u2),a1+R1>=l?a1=0:a1+=R1;let y1=Z2-J1,e2=Math.max(y1,1),w2=sL/e2;R1=Math.ceil(R1*w2),Q{var G;g==null||g(),d(void 0),N([]),c==null||c([],-1),S(),(G=t==null?void 0:t.current)==null||G.focus()},[S,t,g,c]),B=A1.useCallback(G=>{V(G.target.value),o===void 0&&(G.target.value===""?(d(void 0),N([]),S()):b(G.target.value))},[b,S,V,o]);A1.useEffect(()=>{h&&s.current!==null&&(V(""),s.current.focus({preventScroll:!0}))},[h,s,V]);let _=A1.useCallback(G=>{var a1;if((a1=G==null?void 0:G.stopPropagation)==null||a1.call(G),u===void 0)return;let r1=(u.selectedIndex+1)%u.results;d(T(y({},u),{selectedIndex:r1})),c==null||c(E,r1)},[u,c,E]),K=A1.useCallback(G=>{var a1;if((a1=G==null?void 0:G.stopPropagation)==null||a1.call(G),u===void 0)return;let r1=(u.selectedIndex-1)%u.results;r1<0&&(r1+=u.results),d(T(y({},u),{selectedIndex:r1})),c==null||c(E,r1)},[c,E,u]),J=A1.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(D(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?K():_())},[D,_,K]);A1.useEffect(()=>()=>{S()},[S]);let[c1,w1]=A1.useState(!1);A1.useEffect(()=>{if(h)w1(!0);else{let G=setTimeout(()=>w1(!1),150);return()=>clearTimeout(G)}},[h]);let h1=A1.useMemo(()=>{var Q,I1,v1;if(!h&&!c1)return null;let G;u!==void 0&&(G=u.results>=1e3?"over 1000":`${u.results} result${u.results!==1?"s":""}`,u.selectedIndex>=0&&(G=`${u.selectedIndex+1} of ${G}`));let r1=J1=>{J1.stopPropagation()},R1={width:`${Math.floor(((Q=u==null?void 0:u.rowsSearched)!=null?Q:0)/l*100)}%`};return A1.createElement(Os,{className:h?"":"out",onMouseDown:r1,onMouseMove:r1,onMouseUp:r1,onClick:r1},A1.createElement("div",{className:"gdg-search-bar-inner"},A1.createElement("input",{id:m,"aria-hidden":!h,"data-testid":"search-input",ref:s,onChange:B,value:v,tabIndex:h?void 0:-1,onKeyDownCapture:J}),A1.createElement("button",{"aria-label":"Previous Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:K,disabled:((I1=u==null?void 0:u.results)!=null?I1:0)===0},iL),A1.createElement("button",{"aria-label":"Next Result","aria-hidden":!h,tabIndex:h?void 0:-1,onClick:_,disabled:((v1=u==null?void 0:u.results)!=null?v1:0)===0},lL),g!==void 0&&A1.createElement("button",{"aria-label":"Close Search","aria-hidden":!h,"data-testid":"search-close-button",tabIndex:h?void 0:-1,onClick:D},rL)),u!==void 0?A1.createElement(A1.Fragment,null,A1.createElement("div",{className:"gdg-search-status"},A1.createElement("div",{"data-testid":"search-result-area"},G)),A1.createElement("div",{className:"gdg-search-progress",style:R1})):A1.createElement("div",{className:"gdg-search-status"},A1.createElement("label",{htmlFor:m},"Type to search")))},[h,c1,u,l,m,s,B,v,J,K,_,g,D]);return A1.createElement(A1.Fragment,null,A1.createElement(Is,{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)},_s=aL;var c3=x1(k1(),1);var oL=()=>e=>Math.max(16,e.targetHeight-10),nL=X2("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[oL(),"px"]}}),Ws=e=>{let{bounds:t,group:i,onClose:l,canvasBounds:r,onFinish:s}=e,[a,o]=c3.default.useState(i);return c3.default.createElement(he,{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(nL,{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 CL(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(!CL(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":p5.value?s=!0:i=!0;break}return t.altKey===r&&t.ctrlKey===i&&t.shiftKey===l&&t.metaKey===s}var m3=x1(k1(),1);function $s(e,t,i,l,r,s){let a=m3.default.useCallback((C,c,h,g)=>{var u,d;(s==="cell"||s==="multi-cell")&&C!==void 0&&(C=T(y({},C),{range:{x:C.cell[0],y:C.cell[1],width:1,height:1}}));let m=i==="mixed"&&(h||g==="drag"),w=l==="mixed"&&m,L=r==="mixed"&&m,v={current:C===void 0?void 0:T(y({},C),{rangeStack:g==="drag"?(d=(u=e.current)==null?void 0:u.rangeStack)!=null?d:[]:[]}),columns:w?e.columns:x2.empty(),rows:L?e.rows:x2.empty()};h&&(s==="multi-rect"||s==="multi-cell")&&v.current!==void 0&&e.current!==void 0&&(v=T(y({},v),{current:T(y({},v.current),{rangeStack:[...e.current.rangeStack,e.current.range]})})),t(v,c)},[l,e,i,s,r,t]),o=m3.default.useCallback((C,c,h)=>{C=C!=null?C:e.rows,c!==void 0&&(C=C.add(c));let g;if(r==="exclusive"&&C.length>0)g={current:void 0,columns:x2.empty(),rows:C};else{let m=h&&i==="mixed",w=h&&l==="mixed";g={current:m?e.current:void 0,columns:w?e.columns:x2.empty(),rows:C}}t(g,!1)},[l,e,i,r,t]),n=m3.default.useCallback((C,c,h)=>{C=C!=null?C:e.columns,c!==void 0&&(C=C.add(c));let g;if(l==="exclusive"&&C.length>0)g={current:void 0,rows:x2.empty(),columns:C};else{let m=h&&i==="mixed",w=h&&r==="mixed";g={current:m?e.current:void 0,rows:w?e.rows:x2.empty(),columns:C}}t(g,!1)},[l,e,i,r,t]);return[a,o,n]}var J8=x1(k1(),1);function Us(e,t,i,l,r){let s=J8.useCallback(C=>{var c;if(e===!0){let h=[];for(let g=C.y;g=r?m.push({kind:C1.Loading,allowOverlay:!1}):m.push(t([w,g]));h.push(m)}return h}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=T(y({},C),{x:C.x-i});if(c.x<0){c.x=0,c.width--;let h=a(c,l.signal);return typeof h=="function"?async()=>(await h()).map(g=>[{kind:C1.Loading,allowOverlay:!1},...g]):h.map(g=>[{kind:C1.Loading,allowOverlay:!1},...g])}return a(c,l.signal)},[l.signal,a,i]);return[e!==void 0?o:void 0,a]}function cL(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===G5?"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:o5(e)}}function mL(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"}:cL(a))})}function Gs(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=>Gs(o,!0)).join(",")):s.push(Gs(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 Ks(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(//g,">")+'"'}function wL(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function gL(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 Xs(e,t){let i=mL(e,t),l=hL(i),r=gL(i);return{textPlain:l,textHtml:r}}function t6(e){var a,o,n,C,c,h;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 g=l.pop();if(g===void 0)break;if(g instanceof HTMLTableElement||g.nodeName==="TBODY")l.push(...[...g.children].reverse());else if(g instanceof HTMLTableRowElement)s!==void 0&&r.push(s),s=[],l.push(...[...g.children].reverse());else if(g instanceof HTMLTableCellElement){let m=g.cloneNode(!0),L=m.children.length===1&&m.children[0].nodeName==="P"?m.children[0]:null,v=(L==null?void 0:L.children.length)===1&&L.children[0].nodeName==="FONT",V=m.querySelectorAll("br");for(let p of V)p.replaceWith(` +`);let u=m.getAttribute("gdg-raw-value"),d=(a=m.getAttribute("gdg-format"))!=null?a:"string";if(m.querySelector("a")!==null)s==null||s.push({rawValue:(n=(o=m.querySelector("a"))==null?void 0:o.getAttribute("href"))!=null?n:"",formatted:(C=m.textContent)!=null?C:"",format:d});else if(m.querySelector("ol")!==null){let p=m.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:wL(u),formatted:(c=m.textContent)!=null?c:"",format:d});else{let p=(h=m.textContent)!=null?h:"";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 Ys(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 m=t({x:C.x,y:C.y,width:1,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m);let w=t({x:C.x+C.width-1,y:C.y,width:1,height:C.height},r.signal);if(typeof w=="function")return s;c.push(...w)}else{let m=t({x:C.x,y:C.y,width:C.width,height:C.height},r.signal);if(typeof m=="function")return s;c.push(...m)}let h=C.x-i,g=C.x+C.width-1-i;for(let m of c)for(let w of m)w.span!==void 0&&(h=Math.min(w.span[0],h),g=Math.max(w.span[1],g));h===C.x-i&&g===C.x+C.width-1-i?a=!0:e={current:{cell:(n=e.current.cell)!=null?n:[0,0],range:{x:h+i,y:C.y,width:g-h+1,height:C.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function js(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Qs(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(Ts(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 K8(e,t,i){var o;let l=ks(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,h;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),(h=i==null?void 0:i.clipboardData)==null||h.setData("text/html",C)}catch(g){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 a3(e){return e!==!0}var Is=F1(Y1(),1);function As(e){return typeof e=="string"?e:`${e}px`}var JH=()=>e=>e.innerWidth,eL=()=>e=>e.innerHeight,tL=X2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[JH()],"wmyidgi-1":[eL()]}}),Os=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=o0(s,["inWidth","inHeight","children"]);return Is.createElement(tL,y({innerHeight:As(i),innerWidth:As(t)},r),l)};var X8=F1(Y1(),1),iL=2,lL=1300;function _s(e,t,i){let l=X8.default.useRef(0),[r,s]=e!=null?e:[0,0];X8.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 h=C-o;l.current=Math.min(1,l.current+h/lL);let g=l.current**1.618*h*iL;(c=t.current)==null||c.scrollBy(r*g,s*g),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var Ws=F1(Y1(),1);function qs({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,h,g,m]=Ws.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let w=o/16,L=e,v=C7();return[typeof L=="number"?L*w:p=>Math.ceil(L(p)*w),Math.ceil(t*w),Math.ceil(i*w),P(y({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*w,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*w,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*w}),Math.ceil((r!=null?r:0)*w),Math.ceil((s!=null?s:0)*w)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:h,overscrollX:g,overscrollY:m}}var Us=F1(Y1(),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 n2(e,t){return e===!0?t:e===!1?"":e}function $s(e){let t=V5.value;return{activateCell:n2(e.activateCell," |Enter|shift+Enter"),clear:n2(e.clear,"any+Escape"),closeOverlay:n2(e.closeOverlay,"any+Escape"),acceptOverlayDown:n2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:n2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:n2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:n2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:n2(e.delete,t?"Backspace|Delete":"Delete"),downFill:n2(e.downFill,"primary+_68"),scrollToSelectedCell:n2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:n2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:n2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:n2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:n2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:n2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:n2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:n2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:n2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:n2(e.goToFirstCell,"primary+Home"),goToFirstColumn:n2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:n2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:n2(e.goToLastCell,"primary+End"),goToLastColumn:n2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:n2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:n2(e.goToNextPage,"PageDown"),goToPreviousPage:n2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:n2(e.rightFill,"primary+_82"),search:n2(e.search,"primary+f"),selectAll:n2(e.selectAll,"primary+a"),selectColumn:n2(e.selectColumn,"ctrl+ "),selectGrowDown:n2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:n2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:n2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:n2(e.selectGrowUp,"shift+ArrowUp"),selectRow:n2(e.selectRow,"shift+ "),selectToFirstCell:n2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:n2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:n2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:n2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:n2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:n2(e.selectToLastRow,"primary+shift+ArrowDown")}}function Gs(e){let t=_e(e);return Us.default.useMemo(()=>{var l,r,s,a,o,n,C,c,h,g,m,w;if(t===void 0)return $s(X4);let i=P(y({},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:(g=(h=t==null?void 0:t.selectToFirstCell)!=null?h:t==null?void 0:t.first)!=null?g:X4.selectToFirstCell,selectToLastCell:(w=(m=t==null?void 0:t.selectToLastCell)!=null?m:t==null?void 0:t.last)!=null?w:X4.selectToLastCell});return $s(y(y({},X4),i))},[t])}var rL=O.lazy(async()=>await import("./data-grid-overlay-editor-LA45TJRM.js")),sL=0;function aL(e){return(0,Ks.default)((0,Y8.default)((0,Y8.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,p5.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 o3(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:P(y({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>P(y({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var j8={kind:c1.Loading,allowOverlay:!1},n3={columns:x2.empty(),rows:x2.empty(),current:void 0},oL=(e,t)=>{var f6,Z6,E6,N6,R6,B6,z6,y6,b6,F6,S6,k6,T6;let[i,l]=O.useState(n3),[r,s]=O.useState(),a=O.useRef(null),o=O.useRef(null),[n,C]=O.useState(),c=O.useRef(null),h=O.useRef(),g=typeof window=="undefined"?null:window,{imageEditorOverride:m,getRowThemeOverride:w,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:S,drawCell:k,editorBloom:b,onHeaderClicked:D,onColumnProposeMove:B,spanRangeBehavior:_="default",onGroupHeaderClicked:K,onCellContextMenu:Q,className:m1,onHeaderContextMenu:g1,getCellsForSelection:w1,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:s1,onCellEdited:o1,onCellsEdited:R1,onSearchResultsChanged:J,searchResults:I1,onSearchValueChange:p1,searchValue:e2,onKeyDown:H1,onKeyUp:W1,keybindings:E2,editOnType:Z2=!0,onRowAppended:u2,onColumnMoved:y1,validateCell:t2,highlightRegions:w2,rangeSelect:i2="rect",columnSelect:a1="multi",rowSelect:T1="multi",rangeSelectionBlending:l2="exclusive",columnSelectionBlending:q1="exclusive",rowSelectionBlending:S1="exclusive",onDelete:$1,onDragStart:U1,onMouseMove:H2,onPaste:t1,copyHeaders:L1=!1,freezeColumns:f1=0,cellActivationBehavior:b1="second-click",rowSelectionMode:z2="auto",onHeaderMenuClick:n1,getGroupDetails:V1,onSearchClose:l1,onItemHovered:M1,onSelectionCleared:Z1,showSearch:R2,onVisibleRegionChanged:Q2,gridSelection:e0,onGridSelectionChange:t0,minColumnWidth:c0=50,maxColumnWidth:Y2=500,maxColumnAutoWidth:J2,provideEditor:k0,trailingRowOptions:C2,freezeTrailingRows:m2=0,allowedFillDirections:L2="orthogonal",scrollOffsetX:A2,scrollOffsetY:y2,verticalBorder:F2,onDragOverCell:Z0,onDrop:o4,onColumnResize:T0,onColumnResizeEnd:m0,onColumnResizeStart:B1,customRenderers:S2,fillHandle:X1,drawFocusRing:N2=!0,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:f5,overscrollY:Z5,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,trapFocus:j9=!1,smoothScrollX:Y9,smoothScrollY:w3,scaleToRem:g3=!1,rowHeight:N5=34,headerHeight:y4=36,groupHeaderHeight:H3=y4,theme:L3,isOutsideClick:Q9,renderers:R5}=e,s0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,$0=(Z6=(f6=s0==null?void 0:s0.kind)!=null?f6:e.rowMarkers)!=null?Z6:"none",B5=(E6=s0==null?void 0:s0.width)!=null?E6:e.rowMarkerWidth,z5=(R6=(N6=s0==null?void 0:s0.startIndex)!=null?N6:e.rowMarkerStartIndex)!=null?R6:1,o9=(B6=s0==null?void 0:s0.theme)!=null?B6:e.rowMarkerTheme,P4=(z6=s0==null?void 0:s0.checkboxStyle)!=null?z6:"square",U0=Math.max(c0,20),n4=Math.max(Y2,U0),n9=Math.max(J2!=null?J2:n4,U0),D4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),C9=O.useMemo(()=>Number.parseFloat(D4.fontSize),[D4]),{rowHeight:B0,headerHeight:y5,groupHeaderHeight:c9,theme:J9,overscrollX:V3,overscrollY:e7}=qs({groupHeaderHeight:H3,headerHeight:y4,overscrollX:f5,overscrollY:Z5,remSize:C9,rowHeight:N5,scaleToRem:g3,theme:L3}),C4=Gs(E2),b4=B5!=null?B5:d>1e4?48:d>1e3?44:d>100?36:32,G0=$0!=="none",A=G0?1:0,W2=u2!==void 0,Y4=(C2==null?void 0:C2.sticky)===!0,[d3,t7]=O.useState(!1),m9=R2!=null?R2:d3,u3=O.useCallback(()=>{l1!==void 0?l1():t7(!1)},[l1]),h9=O.useMemo(()=>e0===void 0?void 0:o3(e0,A),[e0,A]),W=h9!=null?h9:i,E0=O.useRef();E0.current===void 0&&(E0.current=new AbortController),O.useEffect(()=>()=>E0==null?void 0:E0.current.abort(),[]);let[a0,b5]=bs(w1,p,A,E0.current,d),w9=O.useCallback((H,f,M)=>{if(t2===void 0)return!0;let F=[H[0]-A,H[1]];return t2==null?void 0:t2(F,f,M)},[A,t2]),A4=O.useRef(e0),D0=O.useCallback((H,f)=>{f&&(H=Ps(H,a0,A,_,E0.current)),t0!==void 0?(A4.current=o3(H,-A),t0(A4.current)):l(H)},[t0,a0,A,_]),c4=m5(T0,O.useCallback((H,f,M,F)=>{T0==null||T0(u[M-A],f,M-A,F)},[T0,A,u])),v3=m5(m0,O.useCallback((H,f,M,F)=>{m0==null||m0(u[M-A],f,M-A,F)},[m0,A,u])),F5=m5(B1,O.useCallback((H,f,M,F)=>{B1==null||B1(u[M-A],f,M-A,F)},[B1,A,u])),p3=m5(S,O.useCallback((H,f)=>{var M;return(M=S==null?void 0:S(P(y({},H),{columnIndex:H.columnIndex-A}),f))!=null?M:!1},[S,A])),M3=m5(k,O.useCallback((H,f)=>{var M;return(M=k==null?void 0:k(P(y({},H),{col:H.col-A}),f))!=null?M:!1},[k,A])),m4=O.useCallback(H=>{if($1!==void 0){let f=$1(o3(H,-A));return typeof f=="boolean"?f:o3(f,A)}return!0},[$1,A]),[g0,H0,i0]=ys(W,D0,l2,q1,S1,i2),h0=O.useMemo(()=>r4(C7(),J9),[J9]),[S5,i7]=O.useState([0,0,0]),g9=O.useMemo(()=>{if(R5===void 0)return{};let H={};for(let f of R5)H[f.kind]=f;return H},[R5]),L0=O.useCallback(H=>H.kind!==c1.Custom?g9[H.kind]:S2==null?void 0:S2.find(f=>f.isMatch(H)),[S2,g9]),{sizedColumns:N0,nonGrowWidth:z}=ft(u,d,b5,S5[0]-(A===0?0:b4)-S5[2],U0,n9,h0,L0,E0.current);$0!=="none"&&(z+=b4);let j=O.useMemo(()=>N0.some(H=>H.group!==void 0),[N0]),x1=j?y5+c9:y5,v1=W.rows.length,C1=$0==="none"?void 0:v1===0?!1:v1===d?!0:void 0,Y=O.useMemo(()=>$0==="none"?N0:[{title:"",width:b4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:o9,rowMarker:P4,rowMarkerChecked:C1},...N0],[$0,N0,b4,o9,P4,C1]),[_1,K1]=O.useMemo(()=>[y2!==void 0&&typeof B0=="number"?Math.floor(y2/B0):0,y2!==void 0&&typeof B0=="number"?-(y2%B0):0],[y2,B0]),h1=O.useRef({height:1,width:1,x:0,y:0}),q2=O.useMemo(()=>{var H,f;return{x:h1.current.x,y:_1,width:(H=h1.current.width)!=null?H:1,height:(f=h1.current.height)!=null?f:1,ty:K1}},[K1,_1]),r2=O.useRef(!1),[G1,d2,Q1]=Oe(q2);h1.current=G1;let k2=((y6=G1.height)!=null?y6:1)>1;O.useLayoutEffect(()=>{if(y2!==void 0&&c.current!==null&&k2){if(c.current.scrollTop===y2)return;c.current.scrollTop=y2,c.current.scrollTop!==y2&&Q1(),r2.current=!0}},[y2,k2,Q1]);let l0=((b6=G1.width)!=null?b6:1)>1;O.useLayoutEffect(()=>{if(A2!==void 0&&c.current!==null&&l0){if(c.current.scrollLeft===A2)return;c.current.scrollLeft=A2,c.current.scrollLeft!==A2&&Q1(),r2.current=!0}},[A2,l0,Q1]);let K0=G1.x+A,$2=G1.y,U2=O.useRef(null),I2=O.useCallback(H=>{var f;H===!0?(f=U2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=U2.current)==null||M.focus()})},[]),O2=W2?d+1:d,V0=O.useCallback(H=>{let f=A===0?H:H.map(F=>P(y({},F),{location:[F.location[0]-A,F.location[1]]})),M=R1==null?void 0:R1(f);if(M!==!0)for(let F of f)o1==null||o1(F.location,F.value);return M},[o1,R1,A]),[v2,J0]=O.useState(),M0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,e4=N2?(F6=W.current)==null?void 0:F6.cell:void 0,X0=e4==null?void 0:e4[0],I4=e4==null?void 0:e4[1],Q4=O.useMemo(()=>{var f,M;if((w2===void 0||w2.length===0)&&((M=(f=M0!=null?M0:X0)!=null?f:I4)!=null?M:v2)===void 0)return;let H=[];if(w2!==void 0)for(let F of w2){let T=Y.length-F.range.x-A;T>0&&H.push({color:F.color,range:P(y({},F.range),{x:F.range.x+A,width:Math.min(T,F.range.width)}),style:F.style})}return v2!==void 0&&H.push({color:z0(h0.accentColor,0),range:v2,style:"dashed"}),M0!==void 0&&H.push({color:z0(h0.accentColor,.5),range:M0,style:"solid-outline"}),X0!==void 0&&I4!==void 0&&H.push({color:h0.accentColor,range:{x:X0,y:I4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[v2,M0,X0,I4,w2,Y.length,h0.accentColor,A]),m6=O.useRef(Y);m6.current=Y;let j0=O.useCallback(([H,f],M=!1)=>{var q,I,$,X,r1,d1,z1,P1,E1,k1;let F=W2&&f===O2-1;if(H===0&&G0)return F?j8:{kind:l4.Marker,allowOverlay:!1,checkboxStyle:P4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:$0==="clickable-number"?"number":$0,row:z5+f,drawHandle:p4!==void 0,cursor:$0==="clickable-number"?"pointer":void 0};if(F){let p2=H===A&&(q=C2==null?void 0:C2.hint)!=null?q:"",N1=m6.current[H];if(((I=N1==null?void 0:N1.trailingRowOptions)==null?void 0:I.disabled)===!0)return j8;{let a2=(X=($=N1==null?void 0:N1.trailingRowOptions)==null?void 0:$.hint)!=null?X:p2,M2=(d1=(r1=N1==null?void 0:N1.trailingRowOptions)==null?void 0:r1.addIcon)!=null?d1:C2==null?void 0:C2.addIcon;return{kind:l4.NewRow,hint:a2,allowOverlay:!1,icon:M2}}}else{let s2=H-A;if(M||(j1==null?void 0:j1.strict)===!0){let N1=h1.current,a2=N1.x>s2||s2>N1.x+N1.width||N1.y>f||f>N1.y+N1.height||f>=f3.current,M2=s2===((P1=(z1=N1.extras)==null?void 0:z1.selected)==null?void 0:P1[0])&&f===((E1=N1.extras)==null?void 0:E1.selected[1]),T2=!1;if(((k1=N1.extras)==null?void 0:k1.freezeRegions)!==void 0){for(let G2 of N1.extras.freezeRegions)if(G4(G2,s2,f)){T2=!0;break}}if(a2&&!M2&&!T2)return j8}let p2=p([s2,f]);return A!==0&&p2.span!==void 0&&(p2=P(y({},p2),{span:[p2.span[0]+A,p2.span[1]+A]})),p2}},[W2,O2,G0,P4,W==null?void 0:W.rows,$0,z5,p4,A,C2==null?void 0:C2.hint,C2==null?void 0:C2.addIcon,j1==null?void 0:j1.strict,p]),x3=O.useCallback(H=>{var M,F;let f=(M=V1==null?void 0:V1(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=>E3({group:f.name,bounds:T.bounds})}]}),f},[V1,s1]),l7=O.useCallback(H=>{var $;let[f,M]=H.cell,F=Y[f],T=(F==null?void 0:F.group)!==void 0?($=x3(F.group))==null?void 0:$.overrideTheme:void 0,q=F==null?void 0:F.themeOverride,I=w==null?void 0:w(M);s(P(y({},H),{theme:r4(h0,T,q,I,H.content.themeOverride)}))},[w,Y,x3,h0]),k5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,T]=W.current.cell,q=j0([F,T]);if(q.kind!==c1.Boolean&&q.allowOverlay){let $=q;if(M!==void 0)switch($.kind){case c1.Number:{let X=D6(()=>M==="-"?-0:Number.parseFloat(M),0);$=P(y({},$),{data:Number.isNaN(X)?0:X});break}case c1.Text:case c1.Markdown:case c1.Uri:$=P(y({},$),{data:M});break}l7({target:H,content:$,initialValue:M,cell:[F,T],highlight:M===void 0,forceEditMode:M!==void 0})}else q.kind===c1.Boolean&&f&&q.readonly!==!0&&(V0([{location:W.current.cell,value:P(y({},q),{data:a3(q.data)})}]),(I=U2.current)==null||I.damage([{cell:W.current.cell}]))},[j0,W,V0,l7]),h6=O.useCallback((H,f)=>{var T;let M=(T=U2.current)==null?void 0:T.getBounds(H,f);if(M===void 0||c.current===null)return;let F=j0([H,f]);F.allowOverlay&&l7({target:M,content:F,initialValue:void 0,highlight:!0,cell:[H,f],forceEditMode:!0})},[j0,l7]),r0=O.useCallback((H,f,M="both",F=0,T=0,q=void 0)=>{var I;if(c.current!==null){let $=U2.current,X=o.current,r1=typeof H!="number"?H.unit==="cell"?H.amount:void 0:H,d1=typeof f!="number"?f.unit==="cell"?f.amount:void 0:f,z1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,P1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if($!==null&&X!==null){let E1={x:0,y:0,width:0,height:0},k1=0,s2=0;if((r1!==void 0||d1!==void 0)&&(E1=(I=$.getBounds((r1!=null?r1:0)+A,d1!=null?d1:0))!=null?I:E1,E1.width===0||E1.height===0))return;let p2=X.getBoundingClientRect(),N1=p2.width/X.offsetWidth;if(z1!==void 0&&(E1=P(y({},E1),{x:z1-p2.left-c.current.scrollLeft,width:1})),P1!==void 0&&(E1=P(y({},E1),{y:P1+p2.top-c.current.scrollTop,height:1})),E1!==void 0){let a2={x:E1.x-F,y:E1.y-T,width:E1.width+2*F,height:E1.height+2*T},M2=0;for(let b3=0;b30&&(T2=a4(O2,G2,B0));let f2=M2*N1+p2.left+A*b4*N1,K2=p2.right,w4=p2.top+x1*N1,M4=p2.bottom-T2*N1,t5=E1.width+F*2;switch(q==null?void 0:q.hAlign){case"start":K2=f2+t5;break;case"end":f2=K2-t5;break;case"center":f2=Math.floor((f2+K2)/2)-t5/2,K2=f2+t5;break}let i5=E1.height+T*2;switch(q==null?void 0:q.vAlign){case"start":M4=w4+i5;break;case"end":w4=M4-i5;break;case"center":w4=Math.floor((w4+M4)/2)-i5/2,M4=w4+i5;break}f2>a2.x?k1=a2.x-f2:K2a2.y?s2=a2.y-w4:M4=O2-G2)&&(s2=0),(k1!==0||s2!==0)&&(N1!==1&&(k1/=N1,s2/=N1),c.current.scrollTo(k1+c.current.scrollLeft,s2+c.current.scrollTop))}}}},[A,m2,b4,x1,f1,N0,O2,Y4,B0]),w6=O.useRef(h6),g6=O.useRef(p),f3=O.useRef(d);w6.current=h6,g6.current=p,f3.current=d;let T5=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=u2==null?void 0:u2(),T,q=!0;F!==void 0&&(T=await F,T==="top"&&(q=!1),typeof T=="number"&&(q=!1));let I=0,$=()=>{if(f3.current<=d){I<500&&window.setTimeout($,I),I=50+I*2;return}let r1=typeof T=="number"?T:q?d:0;n7.current(H-A,r1),g0({cell:[H,r1],range:{x:H,y:r1,width:1,height:1}},!1,!1,"edit");let d1=g6.current([H-A,r1]);d1.allowOverlay&&o5(d1)&&d1.readonly!==!0&&f&&window.setTimeout(()=>{w6.current(H,r1)},0)};$()},[Y,u2,A,d,g0]),r7=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:C2==null?void 0:C2.targetColumn;if(typeof f=="number")return f+(G0?1:0);if(typeof f=="object"){let q=u.indexOf(f);if(q>=0)return q+(G0?1:0)}},[N0,u,G0,C2==null?void 0:C2.targetColumn]),O4=O.useRef(),P5=O.useRef(),H9=O.useCallback((H,f)=>{var T;let[M,F]=f;return r4(h0,(T=Y[M])==null?void 0:T.themeOverride,w==null?void 0:w(F),H.themeOverride)},[w,Y,h0]),L9=O.useCallback(H=>{var d1,z1,P1,E1;let f=V5.value?H.metaKey:H.ctrlKey,M=f&&T1==="multi",F=f&&a1==="multi",[T,q]=H.location,I=W.columns,$=W.rows,[X,r1]=(z1=(d1=W.current)==null?void 0:d1.cell)!=null?z1:[];if(H.kind==="cell"){if(P5.current=void 0,J4.current=[T,q],T===0&&G0){if(W2===!0&&q===d||$0==="number"||T1==="none")return;let k1=j0(H.location);if(k1.kind!==l4.Marker)return;if(p4!==void 0){let N1=L0(k1);d0((N1==null?void 0:N1.kind)===l4.Marker);let a2=(P1=N1==null?void 0:N1.onClick)==null?void 0:P1.call(N1,P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:H9(k1,H.location),preventDefault:()=>{}}));if(a2===void 0||a2.checked===k1.checked)return}s(void 0),I2();let s2=$.hasIndex(q),p2=O4.current;if(T1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&p2!==void 0&&$.hasIndex(p2)){let N1=[Math.min(p2,q),Math.max(p2,q)+1];M||z2==="multi"?H0(void 0,N1,!0):H0(x2.fromSingleSelection(N1),void 0,M)}else M||H.isTouch||z2==="multi"?s2?H0($.remove(q),void 0,!0):(H0(void 0,q,!0),O4.current=q):s2&&$.length===1?H0(x2.empty(),void 0,f):(H0(x2.fromSingleSelection(q),void 0,f),O4.current=q)}else if(T>=A&&W2&&q===d){let k1=r7(T);T5(k1!=null?k1:T)}else if(X!==T||r1!==q){let k1=j0(H.location),s2=L0(k1);if((s2==null?void 0:s2.onSelect)!==void 0){let a2=!1;if(s2.onSelect(P(y({},H),{cell:k1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>a2=!0,theme:H9(k1,H.location)})),a2)return}let p2=Y4&&q===d,N1=Y4&&W!==void 0&&((E1=W.current)==null?void 0:E1.cell[1])===d;if((H.shiftKey||H.isLongTouch===!0)&&X!==void 0&&r1!==void 0&&W.current!==void 0&&!N1){if(p2)return;let a2=Math.min(T,X),M2=Math.max(T,X),T2=Math.min(q,r1),G2=Math.max(q,r1);g0(P(y({},W.current),{range:{x:a2,y:T2,width:M2-a2+1,height:G2-T2+1}}),!0,f,"click"),O4.current=void 0,I2()}else g0({cell:[T,q],range:{x:T,y:q,width:1,height:1}},!0,f,"click"),O4.current=void 0,s(void 0),I2()}}else if(H.kind==="header")if(J4.current=[T,q],s(void 0),G0&&T===0)O4.current=void 0,P5.current=void 0,T1==="multi"&&($.length!==d?H0(x2.fromSingleSelection([0,d]),void 0,f):H0(x2.empty(),void 0,f),I2());else{let k1=P5.current;if(a1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&k1!==void 0&&I.hasIndex(k1)){let s2=[Math.min(k1,T),Math.max(k1,T)+1];F?i0(void 0,s2,f):i0(x2.fromSingleSelection(s2),void 0,f)}else F?(I.hasIndex(T)?i0(I.remove(T),void 0,f):i0(void 0,T,f),P5.current=T):a1!=="none"&&(i0(x2.fromSingleSelection(T),void 0,f),P5.current=T);O4.current=void 0,I2()}else H.kind===S0?J4.current=[T,q]:H.kind===l9&&!H.isMaybeScrollbar&&(D0(n3,!1),s(void 0),I2(),Z1==null||Z1(),O4.current=void 0,P5.current=void 0)},[T5,a1,I2,L0,r7,j0,W,G0,Y4,Z1,p4,A,$0,T1,z2,d,g0,D0,i0,H0,W2,H9]),V9=O.useRef(!1),J4=O.useRef(),H6=O.useRef(G1),t4=O.useRef(),ao=O.useCallback(H=>{if(D5.current=!1,H6.current=h1.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"&&(V9.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?L9(H):!H.isTouch&&H.button===1&&(J4.current=H.location))},[W,L9]),[Z3,E3]=O.useState(),L6=O.useCallback(H=>{if(H.kind!==S0||a1!=="multi")return;let f=V5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=A&&w5(T.group,Y[$].group);$--)q--;for(let $=M+1;${if(a0!==void 0&&c4!==void 0){let f=h1.current.y,M=h1.current.height,F=a0({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-A],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=h0.baseFontFull;let $=r8(I,h0,T,0,F,U0,n4,!1,L0);c4==null||c4(T,$.width,H,$.width)}}},[N0,a0,n4,h0,U0,c4,A,d,L0]),[oo,N3]=O.useState(),A5=O.useCallback(async(H,f)=>{var $,X;let M=($=H.current)==null?void 0:$.range;if(M===void 0||a0===void 0||f.current===void 0)return;let F=f.current.range;if(x!==void 0){let r1=!1;if(x({fillDestination:P(y({},F),{x:F.x-A}),patternSource:P(y({},M),{x:M.x-A}),preventDefault:()=>r1=!0}),r1)return}let T=a0(M,E0.current.signal);typeof T!="object"&&(T=await T());let q=T,I=[];for(let r1=0;r1({cell:r1.location})))},[a0,V0,x,A]),V6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{width:1})})});A5(H,W)},[A5,W]),d6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=P(y({},W),{current:P(y({},W.current),{range:P(y({},W.current.range),{height:1})})});A5(H,W)},[A5,W]),no=O.useCallback((H,f)=>{var d1,z1,P1;let M=n;if(C(void 0),J0(void 0),N3(void 0),V9.current=!1,f)return;if((M==null?void 0:M.fillHandle)===!0&&W.current!==void 0&&((d1=M.previousSelection)==null?void 0:d1.current)!==void 0){if(v2===void 0)return;let E1=P(y({},W),{current:P(y({},W.current),{range:w8(M.previousSelection.current.range,v2)})});A5(M.previousSelection,E1),D0(E1,!0);return}let[F,T]=H.location,[q,I]=(z1=J4.current)!=null?z1:[],$=()=>{D5.current=!0},X=E1=>{var s2,p2,N1,a2;let k1=E1.isTouch||q===F&&I===T;if(k1&&(Z==null||Z([F-A,T],P(y({},E1),{preventDefault:$}))),E1.button===1)return!D5.current;if(!D5.current){let M2=j0(H.location),T2=L0(M2);if(T2!==void 0&&T2.onClick!==void 0&&k1){let f2=T2.onClick(P(y({},E1),{cell:M2,posX:E1.localEventX,posY:E1.localEventY,bounds:E1.bounds,theme:H9(M2,H.location),preventDefault:$}));f2!==void 0&&!F4(f2)&&W5(f2)&&(V0([{location:E1.location,value:f2}]),(s2=U2.current)==null||s2.damage([{cell:E1.location}]))}if(D5.current||W.current===void 0)return!1;let G2=!1;switch((p2=M2.activationBehaviorOverride)!=null?p2:b1){case"double-click":case"second-click":{if(((a2=(N1=M==null?void 0:M.previousSelection)==null?void 0:N1.current)==null?void 0:a2.cell)===void 0)break;let[f2,K2]=W.current.cell,[w4,M4]=M.previousSelection.current.cell;G2=F===f2&&F===w4&&T===K2&&T===M4&&(E1.isDoubleClick===!0||b1==="second-click");break}case"single-click":{G2=!0;break}}if(G2)return R==null||R([F-A,T]),k5(E1.bounds,!1),!0}return!1},r1=H.location[0]-A;if(H.isTouch){let E1=h1.current,k1=H6.current;if(E1.x!==k1.x||E1.y!==k1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&g5((P1=W.current)==null?void 0:P1.cell,H.location)){Q==null||Q([r1,H.location[1]],P(y({},H),{preventDefault:$}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){g1==null||g1(r1,P(y({},H),{preventDefault:$}));return}else if(H.kind===S0){if(r1<0)return;G==null||G(r1,P(y({},H),{preventDefault:$}));return}}H.kind==="cell"?X(H)||L9(H):H.kind===S0?K==null||K(r1,P(y({},H),{preventDefault:$})):(H.kind===B4&&(D==null||D(r1,P(y({},H),{preventDefault:$}))),L9(H));return}if(H.kind==="header"){if(r1<0)return;H.isEdge?H.isDoubleClick===!0&&s7(F):H.button===0&&F===q&&T===I&&(D==null||D(r1,P(y({},H),{preventDefault:$})))}if(H.kind===S0){if(r1<0)return;H.button===0&&F===q&&T===I&&(K==null||K(r1,P(y({},H),{preventDefault:$})),D5.current||L6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),J4.current=void 0},[n,W,A,v2,A5,D0,Z,j0,L0,b1,H9,V0,R,k5,Q,g1,G,L9,K,D,s7,L6]),Co=O.useCallback(H=>{let f=P(y({},H),{location:[H.location[0]-A,H.location[1]]});H2==null||H2(f),n!==void 0&&H.buttons===0&&(C(void 0),J0(void 0),N3(void 0),V9.current=!1),N3(M=>{var F,T;return V9.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){n1==null||n1(H-A,f)},[n1,A]),i4=(S6=W==null?void 0:W.current)==null?void 0:S6.cell,mo=O.useCallback((H,f,M,F,T,q)=>{r2.current=!1;let I=i4;I!==void 0&&(I=[I[0]-A,I[1]]);let $=f1===0?void 0:{x:0,y:H.y,width:f1,height:H.height},X=[];$!==void 0&&X.push($),m2>0&&(X.push({x:H.x-A,y:d-m2,width:H.width,height:m2}),f1>0&&X.push({x:0,y:d-m2,width:f1,height:m2}));let r1={x:H.x-A,y:H.y,width:H.width,height:W2&&H.y+H.height>=d?H.height-1:H.height,tx:T,ty:q,extras:{selected:I,freezeRegion:$,freezeRegions:X}};h1.current=r1,d2(r1),i7([f,M,F]),Q2==null||Q2(r1,r1.tx,r1.ty,r1.extras)},[i4,A,W2,d,f1,m2,d2,Q2]),ho=m5(y1,O.useCallback((H,f)=>{y1==null||y1(H-A,f-A),a1!=="none"&&i0(x2.fromSingleSelection(f),void 0,!0)},[a1,y1,A,i0])),R3=O.useRef(!1),wo=O.useCallback(H=>{if(H.location[0]===0&&A>0){H.preventDefault();return}U1==null||U1(P(y({},H),{location:[H.location[0]-A,H.location[1]]})),H.defaultPrevented()||(R3.current=!0),C(void 0)},[U1,A]),go=O.useCallback(()=>{R3.current=!1},[]),B3=O.useRef(),z3=O.useCallback(H=>{var f,M,F;if(!l3(H,B3.current)&&(B3.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&&A===1&&T1==="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]),q=Math.max(t4.current.location[1],H.location[1])+1;H0(x2.fromSingleSelection([T,q]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!R3.current&&!V9.current&&(i2==="rect"||i2==="multi-rect")){let[T,q]=W.current.cell,[I,$]=H.location;if($<0&&($=h1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;$=Math.min($,W2?d-1:d);let r1=Zi(X,I,$,L2);J0(r1)}else{if(W2&&q===d)return;if(W2&&$===d)if(H.kind===l9)$--;else return;I=Math.max(I,A);let d1=I-T,z1=$-q,P1={x:d1>=0?T:I,y:z1>=0?q:$,width:Math.abs(d1)+1,height:Math.abs(z1)+1};g0(P(y({},W.current),{range:P1}),!0,!1,"drag")}}M1==null||M1(P(y({},H),{location:[H.location[0]-A,H.location[1]]}))}},[L2,n,A,T1,W,i2,M1,H0,W2,d,g0]),Ho=O.useCallback(()=>{var I,$,X;let H=B3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,T]=H.location,q=h1.current;f===-1?F=(X=($=(I=q.extras)==null?void 0:I.freezeRegion)==null?void 0:$.x)!=null?X:q.x:f===1&&(F=q.x+q.width),M===-1?T=Math.max(0,q.y):M===1&&(T=Math.min(d-1,q.y+q.height)),F=(0,v5.default)(F,0,Y.length-1),T=(0,v5.default)(T,0,d-1),z3(P(y({},H),{location:[F,T]}))},[Y.length,z3,d]);_s(oo,c,Ho);let h4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,T]=W.current.cell,q=W.current.range,I=q.x,$=q.x+q.width,X=q.y,r1=q.y+q.height;if(M!==0)switch(M){case 2:{r1=d,X=T,r0(0,r1,"vertical");break}case-2:{X=0,r1=T+1,r0(0,X,"vertical");break}case 1:{XT+1?(r1--,r0(0,r1,"vertical")):(X=Math.max(0,X-1),r0(0,X,"vertical"));break}default:l5(M)}if(f!==0)if(f===2)$=Y.length,I=F,r0($-1-A,0,"horizontal");else if(f===-2)I=A,$=F+1,r0(I-A,0,"horizontal");else{let d1=[];if(a0!==void 0){let z1=a0({x:I,y:X,width:$-I-A,height:r1-X},E0.current.signal);typeof z1=="object"&&(d1=aL(z1))}if(f===1){let z1=!1;if(I0){let P1=(0,p5.default)(I+1,F+1).find(E1=>!d1.includes(E1-A));P1!==void 0&&(I=P1,z1=!0)}else I++,z1=!0;z1&&r0(I,0,"horizontal")}z1||($=Math.min(Y.length,$+1),r0($-1-A,0,"horizontal"))}else if(f===-1){let z1=!1;if($>F+1){if(d1.length>0){let P1=(0,p5.default)($-1,F,-1).find(E1=>!d1.includes(E1-A));P1!==void 0&&($=P1,z1=!0)}else $--,z1=!0;z1&&r0($-A,0,"horizontal")}z1||(I=Math.max(A,I-1),r0(I-A,0,"horizontal"))}else l5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:$-I,height:r1-X}},!0,!1,"keyboard-select")},[a0,W,Y.length,A,d,r0,g0]),_4=O.useCallback((H,f,M,F)=>{let T=O2-(M?0:1);if(H=(0,v5.default)(H,A,N0.length-1+A),f=(0,v5.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 q=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&q.push(W.current.range),D0(P(y({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:q}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===H&&h.current[1]===f&&(h.current=void 0),r0(H-A,f),!0},[O2,A,N0.length,i4,W,r0,D0,g0]),Lo=O.useCallback((H,f)=>{(r==null?void 0:r.cell)!==void 0&&H!==void 0&&W5(H)&&(V0([{location:r.cell,value:H}]),window.requestAnimationFrame(()=>{var T;(T=U2.current)==null||T.damage([{cell:r.cell}])})),I2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let T=W.current.cell[1]===O2-1&&H!==void 0;_4((0,v5.default)(W.current.cell[0]+M,0,Y.length-1),(0,v5.default)(W.current.cell[1]+F,0,O2-1),T,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,I2,W,N,V0,O2,_4,Y.length]),Vo=O.useMemo(()=>`gdg-overlay-${sL++}`,[]),e5=O.useCallback(H=>{var M,F,T,q;I2();let f=[];for(let I=H.x;I({cell:I.location})))},[I2,p,L0,V0,A]),d9=r!==void 0,u6=O.useCallback(H=>{var E1,k1,s2,p2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,T=W.columns,q=W.rows,I=C4;if(!d9&&o2(I.clear,H,M))D0(n3,!1),Z1==null||Z1();else if(!d9&&o2(I.selectAll,H,M))D0({columns:x2.empty(),rows:x2.empty(),current:{cell:(k1=(E1=W.current)==null?void 0:E1.cell)!=null?k1:[A,0],range:{x:A,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(o2(I.search,H,M))(s2=a==null?void 0:a.current)==null||s2.focus({preventScroll:!0}),t7(!0);else if(o2(I.delete,H,M)){let N1=(p2=m4==null?void 0:m4(W))!=null?p2:!0;if(N1!==!1){let a2=N1===!0?W:N1;if(a2.current!==void 0){e5(a2.current.range);for(let M2 of a2.current.rangeStack)e5(M2)}for(let M2 of a2.rows)e5({x:A,y:M2,width:u.length,height:1});for(let M2 of a2.columns)e5({x:M2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[$,X]=W.current.cell,r1=!1,d1=!1;o2(I.scrollToSelectedCell,H,M)?n7.current($-A,X):a1!=="none"&&o2(I.selectColumn,H,M)?T.hasIndex($)?i0(T.remove($),void 0,!0):a1==="single"?i0(x2.fromSingleSelection($),void 0,!0):i0(void 0,$,!0):T1!=="none"&&o2(I.selectRow,H,M)?q.hasIndex(X)?H0(q.remove(X),void 0,!0):T1==="single"?H0(x2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!d9&&F!==void 0&&o2(I.activateCell,H,M)?X===d&&W2?window.setTimeout(()=>{let N1=r7($);T5(N1!=null?N1:$)},0):(R==null||R([$-A,X]),k5(F,!0)):W.current.range.height>1&&o2(I.downFill,H,M)?d6():W.current.range.width>1&&o2(I.rightFill,H,M)?V6():o2(I.goToNextPage,H,M)?X+=Math.max(1,h1.current.height-4):o2(I.goToPreviousPage,H,M)?X-=Math.max(1,h1.current.height-4):o2(I.goToFirstCell,H,M)?(s(void 0),X=0,$=0):o2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER):o2(I.selectToFirstCell,H,M)?(s(void 0),h4([-2,-2])):o2(I.selectToLastCell,H,M)?(s(void 0),h4([2,2])):d9?(o2(I.closeOverlay,H,M)&&s(void 0),o2(I.acceptOverlayDown,H,M)&&(s(void 0),X++),o2(I.acceptOverlayUp,H,M)&&(s(void 0),X--),o2(I.acceptOverlayLeft,H,M)&&(s(void 0),$--),o2(I.acceptOverlayRight,H,M)&&(s(void 0),$++)):(o2(I.goDownCell,H,M)?X+=1:o2(I.goUpCell,H,M)?X-=1:o2(I.goRightCell,H,M)?$+=1:o2(I.goLeftCell,H,M)?$-=1:o2(I.goDownCellRetainSelection,H,M)?(X+=1,r1=!0):o2(I.goUpCellRetainSelection,H,M)?(X-=1,r1=!0):o2(I.goRightCellRetainSelection,H,M)?($+=1,r1=!0):o2(I.goLeftCellRetainSelection,H,M)?($-=1,r1=!0):o2(I.goToLastRow,H,M)?X=d-1:o2(I.goToFirstRow,H,M)?X=Number.MIN_SAFE_INTEGER:o2(I.goToLastColumn,H,M)?$=Number.MAX_SAFE_INTEGER:o2(I.goToFirstColumn,H,M)?$=Number.MIN_SAFE_INTEGER:(i2==="rect"||i2==="multi-rect")&&(o2(I.selectGrowDown,H,M)?h4([0,1]):o2(I.selectGrowUp,H,M)?h4([0,-1]):o2(I.selectGrowRight,H,M)?h4([1,0]):o2(I.selectGrowLeft,H,M)?h4([-1,0]):o2(I.selectToLastRow,H,M)?h4([0,2]):o2(I.selectToFirstRow,H,M)?h4([0,-2]):o2(I.selectToLastColumn,H,M)?h4([2,0]):o2(I.selectToFirstColumn,H,M)&&h4([-2,0])),d1=M.didMatch);let z1=_4($,X,!1,r1),P1=M.didMatch;return P1&&(z1||!d1||j9)&&f(),P1},[d9,W,C4,a1,T1,i2,A,d,_4,D0,Z1,u.length,m4,j9,e5,i0,H0,W2,r7,T5,R,k5,d6,V6,h4]),u9=O.useCallback(H=>{let f=!1;if(H1!==void 0&&H1(P(y({},H),{cancel:()=>{f=!0}})),f||u6(H)||W.current===void 0)return;let[M,F]=W.current.cell,T=h1.current;if(Z2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&o5(p([M-A,Math.max(0,Math.min(F,d-1))]))){if((!W2||F!==d)&&(T.y>F||F>T.y+T.height||T.x>M||M>T.x+T.width))return;k5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[Z2,H1,u6,W,p,A,d,W2,k5]),uo=O.useCallback((H,f)=>{let M=H.location[0]-A;if(H.kind==="header"&&(g1==null||g1(M,P(y({},H),{preventDefault:f}))),H.kind===S0){if(M<0)return;G==null||G(M,P(y({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,T]=H.location;Q==null||Q([M,T],P(y({},H),{preventDefault:f})),ht(W,H.location)||_4(F,T,!1,!1)}},[W,Q,G,g1,A,_4]),y3=O.useCallback(async H=>{var I,$,X,r1,d1,z1;if(!C4.paste)return;function f(P1,E1,k1,s2){var N1,a2,M2,T2;let p2=typeof k1=="object"?(N1=k1==null?void 0:k1.join(` -`))!=null?N1:"":(a2=k1==null?void 0:k1.toString())!=null?a2:"";if(!F4(P1)&&o5(P1)&&P1.readonly!==!0){let G2=E==null?void 0:E(p2,P1);if(G2!==void 0&&W5(G2))return{location:E1,value:G2};let f2=L0(P1);if(f2===void 0)return;if(f2.kind===c1.Custom){d0(P1.kind===c1.Custom);let K2=(M2=f2.onPaste)==null?void 0:M2.call(f2,p2,P1.data);return K2===void 0?void 0:{location:E1,value:P(y({},P1),{data:K2})}}else{let K2=(T2=f2.onPaste)==null?void 0:T2.call(f2,p2,P1,{formatted:s2,formattedString:typeof s2=="string"?s2:s2==null?void 0:s2.join(` -`),rawValue:k1});return K2===void 0?void 0:(d0(K2.kind===P1.kind),{location:E1,value:K2})}}}let M=W.columns,F=W.rows,T=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,q;if(W.current!==void 0?q=[W.current.range.x,W.current.range.y]:M.length===1?q=[(X=M.first())!=null?X:0,0]:F.length===1&&(q=[A,(r1=F.first())!=null?r1:0]),T&&q!==void 0){let P1,E1,k1="text/plain",s2="text/html";if(navigator.clipboard.read!==void 0){let M2=await navigator.clipboard.read();for(let T2 of M2){if(T2.types.includes(s2)){let f2=await(await T2.getType(s2)).text(),K2=G8(f2);if(K2!==void 0){P1=K2;break}}T2.types.includes(k1)&&(E1=await(await T2.getType(k1)).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(s2)){let M2=H.clipboardData.getData(s2);P1=G8(M2)}P1===void 0&&H.clipboardData.types.includes(k1)&&(E1=H.clipboardData.getData(k1))}else return;let[p2,N1]=q,a2=[];do{if(t1===void 0){let M2=j0(q),T2=(d1=E1!=null?E1:P1==null?void 0:P1.map(f2=>f2.map(K2=>K2.rawValue).join(" ")).join(" "))!=null?d1:"",G2=f(M2,q,T2,void 0);G2!==void 0&&a2.push(G2);break}if(P1===void 0){if(E1===void 0)return;P1=Ds(E1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([q[0]-A,q[1]],P1.map(M2=>M2.map(T2=>{var G2,f2;return(f2=(G2=T2.rawValue)==null?void 0:G2.toString())!=null?f2:""}))))!==!0)return;for(let[M2,T2]of P1.entries()){if(M2+N1>=d)break;for(let[G2,f2]of T2.entries()){let K2=[G2+p2,M2+N1],[w4,M4]=K2;if(w4>=Y.length||M4>=O2)continue;let t5=j0(K2),i5=f(t5,K2,f2.rawValue,f2.formatted);i5!==void 0&&a2.push(i5)}}}while(!1);V0(a2),(z1=U2.current)==null||z1.damage(a2.map(M2=>({cell:M2.location})))}},[E,L0,j0,W,C4.paste,Y.length,V0,O2,t1,A,d]);n0("paste",y3,g,!1,!0);let v9=O.useCallback(async(H,f)=>{var I,$;if(!C4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,F=W.columns,T=W.rows,q=(X,r1)=>{if(!L1)K8(X,r1,H);else{let d1=r1.map(z1=>({kind:c1.Text,data:u[z1].title,displayData:u[z1].title,allowOverlay:!1}));K8([d1,...X],r1,H)}};if(M&&a0!==void 0){if(W.current!==void 0){let X=a0(W.current.range,E0.current.signal);typeof X!="object"&&(X=await X()),q(X,(0,p5.default)(W.current.range.x-A,W.current.range.x+W.current.range.width-A))}else if(T!==void 0&&T.length>0){let r1=[...T].map(d1=>{let z1=a0({x:A,y:d1,width:u.length,height:1},E0.current.signal);return typeof z1=="object"?z1[0]:z1().then(P1=>P1[0])});if(r1.some(d1=>d1 instanceof Promise)){let d1=await Promise.all(r1);q(d1,(0,p5.default)(u.length))}else q(r1,(0,p5.default)(u.length))}else if(F.length>0){let X=[],r1=[];for(let d1 of F){let z1=a0({x:d1,y:0,width:1,height:d},E0.current.signal);typeof z1!="object"&&(z1=await z1()),X.push(z1),r1.push(d1-A)}if(X.length===1)q(X[0],r1);else{let d1=X.reduce((z1,P1)=>z1.map((E1,k1)=>[...E1,...P1[k1]]));q(d1,r1)}}}},[u,a0,W,C4.copy,A,d,L1]);n0("copy",v9,g,!1,!1);let vo=O.useCallback(async H=>{var M,F;if(!(!C4.cut||!(((M=c.current)==null?void 0:M.contains(document.activeElement))===!0||((F=o.current)==null?void 0:F.contains(document.activeElement))===!0))&&(await v9(H),W.current!==void 0)){let T={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:x2.empty(),columns:x2.empty()},q=m4==null?void 0:m4(T);if(q===!1||(T=q===!0?T:q,T.current===void 0))return;e5(T.current.range)}},[e5,W,C4.cut,v9,m4]);n0("cut",vo,g,!1,!1);let po=O.useCallback((H,f)=>{if(J!==void 0){A!==0&&(H=H.map(T=>[T[0]-A,T[1]])),J(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];h.current!==void 0&&h.current[0]===M&&h.current[1]===F||(h.current=[M,F],_4(M,F,!1,!1))},[J,A,_4]),[a7,o7]=(T6=(k6=e0==null?void 0:e0.current)==null?void 0:k6.cell)!=null?T6:[],n7=O.useRef(r0);n7.current=r0,O.useLayoutEffect(()=>{var H,f,M,F;!r2.current&&a7!==void 0&&o7!==void 0&&(a7!==((f=(H=A4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||o7!==((F=(M=A4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&n7.current(a7,o7),r2.current=!1},[a7,o7]);let v6=W.current!==void 0&&(W.current.cell[0]>=Y.length||W.current.cell[1]>=O2);O.useLayoutEffect(()=>{v6&&D0(n3,!1)},[v6,D0]);let Mo=O.useMemo(()=>W2===!0&&(C2==null?void 0:C2.tint)===!0?x2.fromSingleSelection(O2-1):x2.empty(),[O2,W2,C2==null?void 0:C2.tint]),xo=O.useCallback(H=>{var f;return typeof F2=="boolean"?F2:(f=F2==null?void 0:F2(H-A))!=null?f:!0},[A,F2]),fo=O.useMemo(()=>{if(Z3===void 0||o.current===null)return null;let{bounds:H,group:f}=Z3,M=o.current.getBoundingClientRect();return O.createElement(Bs,{bounds:H,group:f,canvasBounds:M,onClose:()=>E3(void 0),onFinish:F=>{E3(void 0),s1==null||s1(f,F)}})},[s1,Z3]),Zo=Math.min(Y.length,f1+(G0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>T5(H+A,f),updateCells:H=>{var f;return A!==0&&(H=H.map(M=>({cell:[M.cell[0]+A,M.cell[1]]}))),(f=U2.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=U2.current)==null?void 0:M.getBounds((H!=null?H:0)+A,f)}},focus:()=>{var H;return(H=U2.current)==null?void 0:H.focus()},emit:async H=>{switch(H){case"delete":u9({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":u9({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":u9({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 v9(void 0,!0);break;case"paste":await y3();break}},scrollTo:r0,remeasureColumns:H=>{for(let f of H)s7(f+A)}}),[T5,s7,v9,u9,y3,A,r0]);let[p6,M6]=i4!=null?i4:[],Eo=O.useCallback(H=>{let[f,M]=H;if(M===-1){a1!=="none"&&(i0(x2.fromSingleSelection(f),void 0,!1),I2());return}p6===f&&M6===M||(g0({cell:H,range:{x:f,y:M,width:1,height:1}},!0,!1,"keyboard-nav"),r0(f,M))},[a1,I2,r0,p6,M6,g0,i0]),[No,Ro]=O.useState(!1),x6=O.useRef((0,Xs.default)(H=>{Ro(H)},5)),Bo=O.useCallback(()=>{x6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[A,$2],range:{x:A,y:$2,width:1,height:1}},!0,!1,"keyboard-select")},[$2,W,n,A,g0]),zo=O.useCallback(()=>{x6.current(!1)},[]),[yo,bo]=O.useMemo(()=>{var T;let H,f=(T=j1==null?void 0:j1.scrollbarWidthOverride)!=null?T:z9(),M=d+(W2?1:0);if(typeof B0=="number")H=x1+M*B0;else{let q=0,I=Math.min(M,10);for(let $=0;$I.width+q,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[Y,j1==null?void 0:j1.scrollbarWidthOverride,B0,d,W2,x1]),Fo=O.useMemo(()=>j6(h0),[h0]);return O.createElement(Y6.Provider,{value:h0},O.createElement(Os,{style:Fo,className:m1,inWidth:v!=null?v:yo,inHeight:V!=null?V:bo},O.createElement(Rs,{fillHandle:X1,drawFocusRing:N2,experimental:j1,fixedShadowX:Q0,fixedShadowY:v4,getRowThemeOverride:w,headerIcons:P0,imageWindowLoader:q0,initialSize:z4,isDraggable:K9,onDragLeave:X9,onRowMoved:p4,overscrollX:V3,overscrollY:e7,preventDiagonalScrolling:E5,rightElement:j4,rightElementProps:T4,smoothScrollX:Y9,smoothScrollY:w3,className:m1,enableGroups:j,onCanvasFocused:Bo,onCanvasBlur:zo,canvasRef:o,onContextMenu:uo,theme:h0,cellXOffset:K0,cellYOffset:$2,accessibilityHeight:G1.height,onDragEnd:go,columns:Y,nonGrowWidth:z,drawHeader:p3,onColumnProposeMove:B,drawCell:M3,disabledRows:Mo,freezeColumns:Zo,lockColumns:A,firstColAccessible:A===0,getCellContent:j0,minColumnWidth:U0,maxColumnWidth:n4,searchInputRef:a,showSearch:m9,onSearchClose:u3,highlightRegions:Q4,getCellsForSelection:a0,getGroupDetails:x3,headerHeight:y5,isFocused:No,groupHeaderHeight:j?c9:0,freezeTrailingRows:m2+(W2&&(C2==null?void 0:C2.sticky)===!0?1:0),hasAppendRow:W2,onColumnResize:c4,onColumnResizeEnd:v3,onColumnResizeStart:F5,onCellFocused:Eo,onColumnMoved:ho,onDragStart:wo,onHeaderMenuClick:co,onItemHovered:z3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Co,onKeyDown:u9,onKeyUp:W1,onMouseDown:ao,onMouseUp:no,onDragOverCell:Z0,onDrop:o4,onSearchResultsChanged:po,onVisibleRegionChanged:mo,clientSize:S5,rowHeight:B0,searchResults:I1,searchValue:e2,onSearchValueChange:p1,rows:O2,scrollRef:c,selection:W,translateX:G1.tx,translateY:G1.ty,verticalBorder:xo,gridRef:U2,getCellRenderer:L0}),fo,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(rL,P(y({},r),{validateCell:w9,bloom:b,id:Vo,getCellRenderer:L0,className:(j1==null?void 0:j1.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:k0,imageEditorOverride:m,onFinishEditing:Lo,markdownDivCreateNode:L,isOutsideClick:Q9})))))},js=O.forwardRef(oL);var Ys=20,Qs={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,f9(e.cell),(t=e.cell.maxSize)!=null?t:Ys)},onDelete:e=>P(y({},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:Ys,h=Math.floor(r.y+o/2),g=F7(c,o,s.cellVerticalPadding),m=b7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,g),w=y7(m,h,g),L=S7(n+i,C+l,w);if(f9(t)&&L)return P(y({},t),{data:a3(t.data)})},onPaste:(e,t)=>{let i=O5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=_5),i===t.data?void 0:P(y({},t),{data:i})}};function nL(e,t,i,l){if(!i&&t===O5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:h}}=e,{x:g,y:m,width:w,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===O5&&(V*=s),V!==0&&(r.globalAlpha=V,j5(r,a,t,g,m,w,L,n,C,c,l,h),r.globalAlpha=1)}var ta=F1(Y1(),1);var C3=F1(Y1(),1);var Js=X2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var CL=e=>{let{bubbles:t}=e;return C3.createElement(Js,null,t.map((i,l)=>C3.createElement("div",{key:l,className:"boe-bubble"},i)),C3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ea=CL;var ia={getAccessibilityString:e=>k7(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=>mL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ta.createElement(ea,{bubbles:t.data})},onPaste:()=>{}},cL=4;function mL(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,h=8,g=cL,m=a+l.cellHorizontalPadding,w=[];for(let v of t){if(m>a+n)break;let V=E4(v,r,l.baseFontFull).width;w.push({x:m,width:V}),m+=V+h*2+g}r.beginPath();for(let v of w)f0(r,v.x,o+(C-c)/2,v.width+h*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of w.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+h,o+C/2+x0(r,l))}var ra=F1(Y1(),1);var U9=F1(Y1(),1);var hL=X2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),wL=e=>{let{drilldowns:t}=e;return U9.createElement(hL,null,t.map((i,l)=>U9.createElement("div",{key:l,className:"doe-bubble"},i.img!==void 0&&U9.createElement("img",{src:i.img}),U9.createElement("div",null,i.text))))},la=wL;var sa={getAccessibilityString:e=>k7(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=>LL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return ra.createElement(la,{drilldowns:t.data})},onPaste:()=>{}},gL=4,Q8={};function HL(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,h=(c+s*2)*r,g=`${e},${t},${r},${i}`;if(Q8[g]!==void 0)return{el:Q8[g],height:n,width:h,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let m=document.createElement("canvas"),w=m.getContext("2d");return w===null?null:(m.width=h,m.height=n,w.scale(r,r),Q8[g]=m,w.beginPath(),f0(w,s,s,c,a,l),w.shadowColor="rgba(24, 25, 34, 0.4)",w.shadowBlur=1,w.fillStyle=e,w.fill(),w.shadowColor="rgba(24, 25, 34, 0.3)",w.shadowOffsetY=1,w.shadowBlur=5,w.fillStyle=e,w.fill(),w.shadowOffsetY=0,w.shadowBlur=0,w.shadowBlur=0,w.beginPath(),f0(w,s+.5,s+.5,c,a,l),w.strokeStyle=t,w.lineWidth=1,w.stroke(),{el:m,height:n,width:h,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function LL(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,h=e8(r,c),g=Math.min(i.height,Math.max(16,Math.ceil(h*l.lineHeight)*2)),m=Math.floor(i.y+(i.height-g)/2),w=g-10,L=8,v=gL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=HL(l.bgCell,l.drilldownBorder,g,u),p=[];for(let x of t){if(V>n+C)break;let E=E4(x.text,r,c).width,S=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(S=w-8+4);let k=E+S+L*2;p.push({x:V,width:k}),V+=k+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:S,width:k,dpr:b,padding:D}=d,B=S/b,_=D/b;for(let K of p){let Q=Math.floor(K.x),m1=Math.floor(K.width),g1=m1-(B-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,S,N,Q-_,m,B,g),g1>0&&r.drawImage(x,S,0,E,N,Q+(B-_),m,g1,g),r.drawImage(x,k-S,0,S,N,Q+m1-(B-_),m,B,g),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],S=N.x+L;if(E.img!==void 0){let k=s.loadOrGetImage(E.img,a,o);if(k!==void 0){let b=w-8,D=0,B=0,_=k.width,K=k.height;_>K?(D+=(_-K)/2,_=K):K>_&&(B+=(K-_)/2,K=_),r.beginPath(),f0(r,S,m+g/2-b/2,b,b,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(k,D,B,_,K,S,m+g/2-b/2,b,b),r.restore(),S+=b+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,S,m+g/2+x0(r,l))}}var aa=F1(Y1(),1);var oa={getAccessibilityString:e=>e.data.join(", "),kind:c1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return VL(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=>P(y({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:qe;return aa.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(P(y({},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 P(y({},t),{data:l})}},J8=4;function VL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:h,height:g,width:m}=r,w=g-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),f0(n,V,h+o.cellVerticalPadding,d,w,i),n.save(),n.clip()),n.drawImage(u,V,h+o.cellVerticalPadding,d,w),i>0&&n.restore(),V+=d+J8}}function dL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var na={getAccessibilityString:()=>"",kind:c1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,h;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(dL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);f0(r,s.x+n,s.y+(s.height-C)/2,o,C,(h=a.roundingRadius)!=null?h:3),r.fillStyle=z0(a.textDark,.1),r.fill()},onPaste:()=>{}};var ca=F1(Y1(),1);var v0=F1(Y1(),1);var uL=()=>e=>e.targetWidth,e6=X2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[uL(),"px"]}});var Ca=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,h]=v0.useState(n===""||l),g=v0.useCallback(()=>{h(w=>!w)},[]),m=n?"gdg-ml-6":"";return c?v0.createElement(e6,{targetWidth:s.width-20},v0.createElement($4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:i}),v0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${m}`,onClick:()=>a(t)},v0.createElement(Ae,null))):v0.createElement(e6,{targetWidth:s.width},v0.createElement(F9,{contents:n,createNode:r}),!C&&v0.createElement(v0.Fragment,null,v0.createElement("div",{className:"spacer"}),v0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${m}`,onClick:g},v0.createElement(q5,null))),v0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var ma={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:N4,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=>P(y({},e),{data:""}),provideEditor:()=>e=>{let{onChange:t,value:i,target:l,onFinishedEditing:r,markdownDivCreateNode:s,forceEditMode:a,validatedSelection:o}=e;return ca.createElement(Ca,{onFinish:r,targetRect:l,value:i,validatedSelection:o,onChange:n=>t(P(y({},i),{data:n.target.value})),forceEditMode:a,createNode:s})},onPaste:(e,t)=>e===t.data?void 0:P(y({},t),{data:e})};var ha={getAccessibilityString:e=>e.row.toString(),kind:l4.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:vL,measure:()=>44,draw:e=>ML(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 P(y({},i),{checked:!i.checked})},onPaste:()=>{}};function vL(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=pL,i.textAlign="center",s}function pL(e){let{ctx:t}=e;t.textAlign="start"}function ML(e,t,i,l,r,s){let{ctx:a,rect:o,hoverAmount:n,theme:C}=e,{x:c,y:h,width:g,height:m}=o,w=i?1:l==="checkbox-visible"?.6+.4*n:n;if(l!=="number"&&w>0){a.globalAlpha=w;let L=7*(i?n:1);if(j5(a,C,i,r?c+L:c,h,r?g-L:g,m,!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,h+m/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+g/2;l==="both"&&n!==0&&(a.globalAlpha=1-n),a.fillStyle=C.textLight,a.font=v,a.fillText(L,V,h+m/2+x0(a,v)),n!==0&&(a.globalAlpha=1)}}var wa={getAccessibilityString:()=>"",kind:l4.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>xL(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function xL(e,t,i){let{ctx:l,rect:r,hoverAmount:s,theme:a,spriteManager:o}=e,{x:n,y:C,width:c,height:h}=r;l.beginPath(),l.globalAlpha=s,l.rect(n+1,C+1,c,h-2),l.fillStyle=a.bgHeaderHovered,l.fill(),l.globalAlpha=1,l.beginPath();let g=t!=="",m=0;if(i!==void 0){let L=h-8,v=n+8/2,V=C+8/2;o.drawSprite(i,"normal",l,v,V,L,a,g?1:s),m=L}else{m=24;let w=12,L=g?w:s*w,v=g?0:(1-s)*w*.5,V=a.cellHorizontalPadding+4;L>0&&(l.moveTo(n+V+v,C+h/2),l.lineTo(n+V+v+L,C+h/2),l.moveTo(n+V+v+L*.5,C+h/2-L*.5),l.lineTo(n+V+v+L*.5,C+h/2+L*.5),l.lineWidth=2,l.strokeStyle=a.bgIconHeader,l.lineCap="round",l.stroke())}l.fillStyle=a.textMedium,l.fillText(t,m+n+a.cellHorizontalPadding+.5,C+h/2+x0(l,a)),l.beginPath()}var M5=F1(Y1(),1);var fL=M5.lazy(async()=>await import("./number-overlay-editor-CU4RMYZF.js")),ga={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:N4,draw:e=>I0(e,e.cell.displayData,e.cell.contentAlign),measure:(e,t,i)=>e.measureText(t.displayData).width+i.cellHorizontalPadding*2,onDelete:e=>P(y({},e),{data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return M5.createElement(M5.Suspense,{fallback:null},M5.createElement(fL,{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(P(y({},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 P(y({},t),{data:l,displayData:(r=i.formattedString)!=null?r:t.displayData})}};var Ha={getAccessibilityString:()=>"",measure:()=>108,kind:c1.Protected,needsHover:!1,needsHoverPosition:!1,draw:ZL,onPaste:()=>{}};function ZL(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(Y3(30))*o,h=Math.sin(Y3(30))*o;for(let g=0;g<12;g++)t.moveTo(n,C-o),t.lineTo(n,C+o),t.moveTo(n+c,C-h),t.lineTo(n-c,C+h),t.moveTo(n-c,C-h),t.lineTo(n+c,C+h),n+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=i.textLight,t.stroke()}var La=F1(Y1(),1);var Va={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)=>N4(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 La.default.createElement($4,{highlight:t,autoFocus:l.readonly!==!0,disabled:l.readonly!==!1,value:l.data,validatedSelection:r,onChange:s=>i(P(y({},l),{data:s.target.value}))})},onPaste:()=>{}};var da=F1(Y1(),1);var ua={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:N4,useLabel:!0,draw:e=>{var g;let{cell:t,hoverAmount:i,hyperWrapping:l,ctx:r,rect:s,theme:a,overrideCursor:o}=e,{displayData:n,contentAlign:C,hoverEffect:c,allowWrapping:h}=t;if(c===!0&&i>0){r.textBaseline="alphabetic";let m=a.cellHorizontalPadding,w=a.cellVerticalPadding,L=E4(n,r,a.baseFontFull,"alphabetic"),v=s.height-w,V=Math.min(v,L.actualBoundingBoxAscent*2.5);r.beginPath(),f0(r,s.x+m/2,s.y+(s.height-V)/2+1,L.width+m*3,V-1,(g=a.roundingRadius)!=null?g: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,h,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=>P(y({},e),{data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:i,onChange:l,value:r,validatedSelection:s}=t;return da.createElement($4,{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(P(y({},r),{data:a.target.value}))})}}),onPaste:(e,t,i)=>{var l;return e===t.data?void 0:P(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var xa=F1(Y1(),1);var V4=F1(Y1(),1);var va=X2("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1});var EL=e=>{let{uri:t,onChange:i,forceEditMode:l,readonly:r,validatedSelection:s,preview:a}=e,[o,n]=V4.useState(!r&&(t===""||l)),C=V4.useCallback(()=>{n(!0)},[]);return o?V4.createElement($4,{validatedSelection:s,highlight:!0,autoFocus:!0,value:t,onChange:i}):V4.createElement(va,null,V4.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&V4.createElement("div",{className:"gdg-edit-icon",onClick:C},V4.createElement(q5,null)),V4.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},pa=EL;function Ma(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 fa={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:N4,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 h=E4(n,o,i.baseFontFull),g=Ma(h,a,i,t.contentAlign),{x:m,y:w,width:L,height:v}=g;if(r>=m-4&&r<=m-4+L+8&&s>=w-4&&s<=w-4+v+8){let V=x0(o,i.baseFontFull);l("pointer");let u=5,d=w-V;o.beginPath(),o.moveTo(a.x+m,Math.floor(a.y+d+v+u)+.5),o.lineTo(a.x+m+L,Math.floor(a.y+d+v+u)+.5),o.strokeStyle=i.linkColor,o.stroke(),o.save(),o.fillStyle=e.cellFillColor,I0(P(y({},e),{rect:P(y({},a),{x:a.x-1})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},a),{x:a.x-2})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},a),{x:a.x+1})}),n,t.contentAlign),I0(P(y({},e),{rect:P(y({},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=ut(a,s.baseFontFull);if(o===void 0)return;let n=Ma(o,i,s,t.contentAlign);G4({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=>P(y({},e),{data:""}),provideEditor:e=>t=>{var a;let{onChange:i,value:l,forceEditMode:r,validatedSelection:s}=t;return xa.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(P(y({},l),{data:o.target.value}))})},onPaste:(e,t,i)=>{var l;return e===t.data?void 0:P(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Za=[ha,wa,Qs,ia,sa,oa,na,ma,ga,Ha,Va,ua,fa];var Ra=F1(Na(),1);var t6=[],i6=class extends D9{constructor(){super(...arguments);c2(this,"imageLoaded",()=>{});c2(this,"loadedLocations",[]);c2(this,"cache",{});c2(this,"sendLoaded",(0,Ra.default)(()=>{this.imageLoaded(new R4(this.loadedLocations)),this.loadedLocations=[]},20));c2(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,t6.length<12?t6.unshift(o):a||(o.src=""))}},c=new Promise(g=>o.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{o.src=i,await c,await o.decode();let g=this.cache[s];if(g!==void 0&&!n){g.img=o;for(let m of g.cells)this.loadedLocations.push(X5(m));a=!0,this.sendLoaded()}}catch(g){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)}},Ba=i6;var yL=(e,t)=>{let i=x5.useMemo(()=>y(y({},fi),e.headerIcons),[e.headerIcons]),l=x5.useMemo(()=>{var r;return(r=e.imageWindowLoader)!=null?r:new Ba},[e.imageWindowLoader]);return x5.createElement(js,P(y({},e),{renderers:Za,headerIcons:i,ref:t,imageWindowLoader:l}))},l6=x5.forwardRef(yL);var w0=F1(Y1(),1);var za=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"}))};var ya=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 ba=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 Fa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 Sa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 ka=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 Ta=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 Pa=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M19 3L23 8H20V20H18V8H15L19 3ZM14 18V20H3V18H14ZM14 11V13H3V11H14ZM12 4V6H3V4H12Z"}))},Da=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=o0(s,["color","size","className"]);return w0.default.createElement("svg",P(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M20 4V16H23L19 21L15 16H18V4H20ZM12 18V20H3V18H12ZM14 11V13H3V11H14ZM14 4V6H3V4H14Z"}))};var J1=F1(Y1()),Ya=F1(P6());function Aa(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 Oa(e){var t=(0,J1.useRef)(null);function i(l){!l||l===t.current||(t.current=l,e(l))}return i}function SL(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 kL(){var e=(0,J1.useRef)([]);return(0,J1.useMemo)(function(){function t(){return e.current.length>0}function i(){for(var r=a9(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 r6=typeof window!="undefined"?J1.useLayoutEffect:J1.useEffect;function TL(e,t){var i=(0,J1.useRef)(e);return t?(i.current=e,i):(i.current=null,i)}function G9(e){return parseFloat(e.replace("px",""))}function a6(e,t,i){return ei?i:e}function _a(e){return e!=null}function Wa(){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=Xs(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,h;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),(h=i==null?void 0:i.clipboardData)==null||h.setData("text/html",C)}catch(g){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 h3(e){return e!==!0}var ea=x1(k1(),1);function Js(e){return typeof e=="string"?e:`${e}px`}var HL=()=>e=>e.innerWidth,LL=()=>e=>e.innerHeight,VL=X2("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[HL()],"wmyidgi-1":[LL()]}}),ta=e=>{let s=e,{inWidth:t,inHeight:i,children:l}=s,r=s0(s,["inWidth","inHeight","children"]);return ea.createElement(VL,y({innerHeight:Js(i),innerWidth:Js(t)},r),l)};var l6=x1(k1(),1),dL=2,uL=1300;function ia(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 h=C-o;l.current=Math.min(1,l.current+h/uL);let g=l.current**1.618*h*dL;(c=t.current)==null||c.scrollBy(r*g,s*g),o=C,i==null||i()}window.requestAnimationFrame(n)}};return window.requestAnimationFrame(n),()=>{a=!0}},[t,r,s,i])}var la=x1(k1(),1);function ra({rowHeight:e,headerHeight:t,groupHeaderHeight:i,theme:l,overscrollX:r,overscrollY:s,scaleToRem:a,remSize:o}){let[n,C,c,h,g,m]=la.default.useMemo(()=>{var V,u,d;if(!a||o===16)return[e,t,i,l,r,s];let w=o/16,L=e,v=H7();return[typeof L=="number"?L*w:p=>Math.ceil(L(p)*w),Math.ceil(t*w),Math.ceil(i*w),T(y({},l),{headerIconSize:((V=l==null?void 0:l.headerIconSize)!=null?V:v.headerIconSize)*w,cellHorizontalPadding:((u=l==null?void 0:l.cellHorizontalPadding)!=null?u:v.cellHorizontalPadding)*w,cellVerticalPadding:((d=l==null?void 0:l.cellVerticalPadding)!=null?d:v.cellVerticalPadding)*w}),Math.ceil((r!=null?r:0)*w),Math.ceil((s!=null?s:0)*w)]},[i,t,r,s,o,e,a,l]);return{rowHeight:n,headerHeight:C,groupHeaderHeight:c,theme:h,overscrollX:g,overscrollY:m}}var aa=x1(k1(),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 o2(e,t){return e===!0?t:e===!1?"":e}function sa(e){let t=p5.value;return{activateCell:o2(e.activateCell," |Enter|shift+Enter"),clear:o2(e.clear,"any+Escape"),closeOverlay:o2(e.closeOverlay,"any+Escape"),acceptOverlayDown:o2(e.acceptOverlayDown,"Enter"),acceptOverlayUp:o2(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:o2(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:o2(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:o2(e.delete,t?"Backspace|Delete":"Delete"),downFill:o2(e.downFill,"primary+_68"),scrollToSelectedCell:o2(e.scrollToSelectedCell,"primary+Enter"),goDownCell:o2(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:o2(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:o2(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:o2(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:o2(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:o2(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:o2(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:o2(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:o2(e.goToFirstCell,"primary+Home"),goToFirstColumn:o2(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:o2(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:o2(e.goToLastCell,"primary+End"),goToLastColumn:o2(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:o2(e.goToLastRow,"primary+ArrowDown"),goToNextPage:o2(e.goToNextPage,"PageDown"),goToPreviousPage:o2(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:o2(e.rightFill,"primary+_82"),search:o2(e.search,"primary+f"),selectAll:o2(e.selectAll,"primary+a"),selectColumn:o2(e.selectColumn,"ctrl+ "),selectGrowDown:o2(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:o2(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:o2(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:o2(e.selectGrowUp,"shift+ArrowUp"),selectRow:o2(e.selectRow,"shift+ "),selectToFirstCell:o2(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:o2(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:o2(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:o2(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:o2(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:o2(e.selectToLastRow,"primary+shift+ArrowDown")}}function oa(e){let t=it(e);return aa.default.useMemo(()=>{var l,r,s,a,o,n,C,c,h,g,m,w;if(t===void 0)return sa(J4);let i=T(y({},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:(g=(h=t==null?void 0:t.selectToFirstCell)!=null?h:t==null?void 0:t.first)!=null?g:J4.selectToFirstCell,selectToLastCell:(w=(m=t==null?void 0:t.selectToLastCell)!=null?m:t==null?void 0:t.last)!=null?w:J4.selectToLastCell});return sa(y(y({},J4),i))},[t])}var vL=O.lazy(async()=>await import("./data-grid-overlay-editor-LA45TJRM.js")),pL=0;function ML(e){return(0,na.default)((0,s6.default)((0,s6.default)(e).filter(t=>t.span!==void 0).map(t=>{var i,l,r,s;return(0,Z5.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 w3(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:T(y({},e.current.range),{x:e.current.range.x+t}),rangeStack:e.current.rangeStack.map(i=>T(y({},i),{x:i.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}var r6={kind:C1.Loading,allowOverlay:!1},g3={columns:x2.empty(),rows:x2.empty(),current:void 0},xL=(e,t)=>{var D6,A6,I6,O6,_6,W6,q6,$6,U6,G6,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),h=O.useRef(),g=typeof window=="undefined"?null:window,{imageEditorOverride:m,getRowThemeOverride:w,markdownDivCreateNode:L,width:v,height:V,columns:u,rows:d,getCellContent:p,onCellClicked:Z,onCellActivated:R,onFillPattern:x,onFinishedEditing:N,coercePasteValue:E,drawHeader:S,drawCell:k,editorBloom:b,onHeaderClicked:D,onColumnProposeMove:B,spanRangeBehavior:_="default",onGroupHeaderClicked:K,onCellContextMenu:J,className:c1,onHeaderContextMenu:w1,getCellsForSelection:h1,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:r1,onCellEdited:a1,onCellsEdited:R1,onSearchResultsChanged:Q,searchResults:I1,onSearchValueChange:v1,searchValue:J1,onKeyDown:g1,onKeyUp:W1,keybindings:E2,editOnType:Z2=!0,onRowAppended:u2,onColumnMoved:y1,validateCell:e2,highlightRegions:w2,rangeSelect:t2="rect",columnSelect:s1="multi",rowSelect:T1="multi",rangeSelectionBlending:i2="exclusive",columnSelectionBlending:q1="exclusive",rowSelectionBlending:F1="exclusive",onDelete:$1,onDragStart:U1,onMouseMove:H2,onPaste:t1,copyHeaders:H1=!1,freezeColumns:f1=0,cellActivationBehavior:b1="second-click",rowSelectionMode:z2="auto",onHeaderMenuClick:o1,getGroupDetails:L1,onSearchClose:i1,onItemHovered:p1,onSelectionCleared:Z1,showSearch:R2,onVisibleRegionChanged:Q2,gridSelection:e0,onGridSelectionChange:t0,minColumnWidth:c0=50,maxColumnWidth:Y2=500,maxColumnAutoWidth:J2,provideEditor:k0,trailingRowOptions:n2,freezeTrailingRows:c2=0,allowedFillDirections:L2="orthogonal",scrollOffsetX:A2,scrollOffsetY:y2,verticalBorder:F2,onDragOverCell:Z0,onDrop:C4,onColumnResize:T0,onColumnResizeEnd:m0,onColumnResizeStart:B1,customRenderers:S2,fillHandle:X1,drawFocusRing:N2=!0,experimental:j1,fixedShadowX:e4,fixedShadowY:M4,headerIcons:P0,imageWindowLoader:$0,initialSize:S4,isDraggable:e7,onDragLeave:t7,onRowMoved:x4,overscrollX:B5,overscrollY:z5,preventDiagonalScrolling:y5,rightElement:e5,rightElementProps:I4,trapFocus:i7=!1,smoothScrollX:l7,smoothScrollY:p3,scaleToRem:M3=!1,rowHeight:b5=34,headerHeight:k4=36,groupHeaderHeight:x3=k4,theme:f3,isOutsideClick:r7,renderers:F5}=e,a0=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,U0=(A6=(D6=a0==null?void 0:a0.kind)!=null?D6:e.rowMarkers)!=null?A6:"none",S5=(I6=a0==null?void 0:a0.width)!=null?I6:e.rowMarkerWidth,k5=(_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,O4=(q6=a0==null?void 0:a0.checkboxStyle)!=null?q6:"square",G0=Math.max(c0,20),c4=Math.max(Y2,G0),w9=Math.max(J2!=null?J2:c4,G0),_4=O.useMemo(()=>typeof window=="undefined"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),g9=O.useMemo(()=>Number.parseFloat(_4.fontSize),[_4]),{rowHeight:B0,headerHeight:T5,groupHeaderHeight:H9,theme:s7,overscrollX:Z3,overscrollY:a7}=ra({groupHeaderHeight:x3,headerHeight:k4,overscrollX:B5,overscrollY:z5,remSize:g9,rowHeight:b5,scaleToRem:M3,theme:f3}),m4=oa(E2),T4=S5!=null?S5:d>1e4?48:d>1e3?44:d>100?36:32,K0=U0!=="none",A=K0?1:0,W2=u2!==void 0,t5=(n2==null?void 0:n2.sticky)===!0,[E3,o7]=O.useState(!1),L9=R2!=null?R2:E3,N3=O.useCallback(()=>{i1!==void 0?i1():o7(!1)},[i1]),V9=O.useMemo(()=>e0===void 0?void 0:w3(e0,A),[e0,A]),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[o0,P5]=Us(h1,p,A,E0.current,d),d9=O.useCallback((H,f,M)=>{if(e2===void 0)return!0;let F=[H[0]-A,H[1]];return e2==null?void 0:e2(F,f,M)},[A,e2]),W4=O.useRef(e0),D0=O.useCallback((H,f)=>{f&&(H=Ys(H,o0,A,_,E0.current)),t0!==void 0?(W4.current=w3(H,-A),t0(W4.current)):l(H)},[t0,o0,A,_]),h4=H5(T0,O.useCallback((H,f,M,F)=>{T0==null||T0(u[M-A],f,M-A,F)},[T0,A,u])),R3=H5(m0,O.useCallback((H,f,M,F)=>{m0==null||m0(u[M-A],f,M-A,F)},[m0,A,u])),D5=H5(B1,O.useCallback((H,f,M,F)=>{B1==null||B1(u[M-A],f,M-A,F)},[B1,A,u])),B3=H5(S,O.useCallback((H,f)=>{var M;return(M=S==null?void 0:S(T(y({},H),{columnIndex:H.columnIndex-A}),f))!=null?M:!1},[S,A])),z3=H5(k,O.useCallback((H,f)=>{var M;return(M=k==null?void 0:k(T(y({},H),{col:H.col-A}),f))!=null?M:!1},[k,A])),w4=O.useCallback(H=>{if($1!==void 0){let f=$1(w3(H,-A));return typeof f=="boolean"?f:w3(f,A)}return!0},[$1,A]),[g0,H0,i0]=$s(W,D0,i2,q1,F1,t2),h0=O.useMemo(()=>a4(H7(),s7),[s7]),[A5,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]:S2==null?void 0:S2.find(f=>f.isMatch(H)),[S2,u9]),{sizedColumns:N0,nonGrowWidth:z}=Dt(u,d,P5,A5[0]-(A===0?0:T4)-A5[2],G0,w9,h0,L0,E0.current);U0!=="none"&&(z+=T4);let j=O.useMemo(()=>N0.some(H=>H.group!==void 0),[N0]),M1=j?T5+H9:T5,u1=W.rows.length,n1=U0==="none"?void 0:u1===0?!1:u1===d?!0:void 0,Y=O.useMemo(()=>U0==="none"?N0:[{title:"",width:T4,icon:void 0,hasMenu:!1,style:"normal",themeOverride:h9,rowMarker:O4,rowMarkerChecked:n1},...N0],[U0,N0,T4,h9,O4,n1]),[_1,K1]=O.useMemo(()=>[y2!==void 0&&typeof B0=="number"?Math.floor(y2/B0):0,y2!==void 0&&typeof B0=="number"?-(y2%B0):0],[y2,B0]),m1=O.useRef({height:1,width:1,x:0,y:0}),q2=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]),l2=O.useRef(!1),[G1,d2,Y1]=tt(q2);m1.current=G1;let k2=(($6=G1.height)!=null?$6:1)>1;O.useLayoutEffect(()=>{if(y2!==void 0&&c.current!==null&&k2){if(c.current.scrollTop===y2)return;c.current.scrollTop=y2,c.current.scrollTop!==y2&&Y1(),l2.current=!0}},[y2,k2,Y1]);let l0=((U6=G1.width)!=null?U6:1)>1;O.useLayoutEffect(()=>{if(A2!==void 0&&c.current!==null&&l0){if(c.current.scrollLeft===A2)return;c.current.scrollLeft=A2,c.current.scrollLeft!==A2&&Y1(),l2.current=!0}},[A2,l0,Y1]);let X0=G1.x+A,$2=G1.y,U2=O.useRef(null),I2=O.useCallback(H=>{var f;H===!0?(f=U2.current)==null||f.focus():window.requestAnimationFrame(()=>{var M;(M=U2.current)==null||M.focus()})},[]),O2=W2?d+1:d,V0=O.useCallback(H=>{let f=A===0?H:H.map(F=>T(y({},F),{location:[F.location[0]-A,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,A]),[v2,t4]=O.useState(),M0=W.current!==void 0&&W.current.range.width*W.current.range.height>1?W.current.range:void 0,i4=N2?(G6=W.current)==null?void 0:G6.cell:void 0,j0=i4==null?void 0:i4[0],q4=i4==null?void 0:i4[1],i5=O.useMemo(()=>{var f,M;if((w2===void 0||w2.length===0)&&((M=(f=M0!=null?M0:j0)!=null?f:q4)!=null?M:v2)===void 0)return;let H=[];if(w2!==void 0)for(let F of w2){let P=Y.length-F.range.x-A;P>0&&H.push({color:F.color,range:T(y({},F.range),{x:F.range.x+A,width:Math.min(P,F.range.width)}),style:F.style})}return v2!==void 0&&H.push({color:z0(h0.accentColor,0),range:v2,style:"dashed"}),M0!==void 0&&H.push({color:z0(h0.accentColor,.5),range:M0,style:"solid-outline"}),j0!==void 0&&q4!==void 0&&H.push({color:h0.accentColor,range:{x:j0,y:q4,width:1,height:1},style:"solid-outline"}),H.length>0?H:void 0},[v2,M0,j0,q4,w2,Y.length,h0.accentColor,A]),Z6=O.useRef(Y);Z6.current=Y;let Y0=O.useCallback(([H,f],M=!1)=>{var q,I,$,X,l1,V1,z1,P1,E1,S1;let F=W2&&f===O2-1;if(H===0&&K0)return F?r6:{kind:s4.Marker,allowOverlay:!1,checkboxStyle:O4,checked:(W==null?void 0:W.rows.hasIndex(f))===!0,markerKind:U0==="clickable-number"?"number":U0,row:k5+f,drawHandle:x4!==void 0,cursor:U0==="clickable-number"?"pointer":void 0};if(F){let p2=H===A&&(q=n2==null?void 0:n2.hint)!=null?q:"",N1=Z6.current[H];if(((I=N1==null?void 0:N1.trailingRowOptions)==null?void 0:I.disabled)===!0)return r6;{let s2=(X=($=N1==null?void 0:N1.trailingRowOptions)==null?void 0:$.hint)!=null?X:p2,M2=(V1=(l1=N1==null?void 0:N1.trailingRowOptions)==null?void 0:l1.addIcon)!=null?V1:n2==null?void 0:n2.addIcon;return{kind:s4.NewRow,hint:s2,allowOverlay:!1,icon:M2}}}else{let r2=H-A;if(M||(j1==null?void 0:j1.strict)===!0){let N1=m1.current,s2=N1.x>r2||r2>N1.x+N1.width||N1.y>f||f>N1.y+N1.height||f>=b3.current,M2=r2===((P1=(z1=N1.extras)==null?void 0:z1.selected)==null?void 0:P1[0])&&f===((E1=N1.extras)==null?void 0:E1.selected[1]),T2=!1;if(((S1=N1.extras)==null?void 0:S1.freezeRegions)!==void 0){for(let G2 of N1.extras.freezeRegions)if(Y4(G2,r2,f)){T2=!0;break}}if(s2&&!M2&&!T2)return r6}let p2=p([r2,f]);return A!==0&&p2.span!==void 0&&(p2=T(y({},p2),{span:[p2.span[0]+A,p2.span[1]+A]})),p2}},[W2,O2,K0,O4,W==null?void 0:W.rows,U0,k5,x4,A,n2==null?void 0:n2.hint,n2==null?void 0:n2.addIcon,j1==null?void 0:j1.strict,p]),y3=O.useCallback(H=>{var M,F;let f=(M=L1==null?void 0:L1(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},[L1,r1]),C7=O.useCallback(H=>{var $;let[f,M]=H.cell,F=Y[f],P=(F==null?void 0:F.group)!==void 0?($=y3(F.group))==null?void 0:$.overrideTheme:void 0,q=F==null?void 0:F.themeOverride,I=w==null?void 0:w(M);s(T(y({},H),{theme:a4(h0,P,q,I,H.content.themeOverride)}))},[w,Y,y3,h0]),I5=O.useCallback((H,f,M)=>{var I;if(W.current===void 0)return;let[F,P]=W.current.cell,q=Y0([F,P]);if(q.kind!==C1.Boolean&&q.allowOverlay){let $=q;if(M!==void 0)switch($.kind){case C1.Number:{let X=Q6(()=>M==="-"?-0:Number.parseFloat(M),0);$=T(y({},$),{data:Number.isNaN(X)?0:X});break}case C1.Text:case C1.Markdown:case C1.Uri:$=T(y({},$),{data:M});break}C7({target:H,content:$,initialValue:M,cell:[F,P],highlight:M===void 0,forceEditMode:M!==void 0})}else q.kind===C1.Boolean&&f&&q.readonly!==!0&&(V0([{location:W.current.cell,value:T(y({},q),{data:h3(q.data)})}]),(I=U2.current)==null||I.damage([{cell:W.current.cell}]))},[Y0,W,V0,C7]),E6=O.useCallback((H,f)=>{var P;let M=(P=U2.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,q=void 0)=>{var I;if(c.current!==null){let $=U2.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,z1=typeof H!="number"&&H.unit==="px"?H.amount:void 0,P1=typeof f!="number"&&f.unit==="px"?f.amount:void 0;if($!==null&&X!==null){let E1={x:0,y:0,width:0,height:0},S1=0,r2=0;if((l1!==void 0||V1!==void 0)&&(E1=(I=$.getBounds((l1!=null?l1:0)+A,V1!=null?V1:0))!=null?I:E1,E1.width===0||E1.height===0))return;let p2=X.getBoundingClientRect(),N1=p2.width/X.offsetWidth;if(z1!==void 0&&(E1=T(y({},E1),{x:z1-p2.left-c.current.scrollLeft,width:1})),P1!==void 0&&(E1=T(y({},E1),{y:P1+p2.top-c.current.scrollTop,height:1})),E1!==void 0){let s2={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&&(T2=n4(O2,G2,B0));let f2=M2*N1+p2.left+A*T4*N1,K2=p2.right,H4=p2.top+M1*N1,f4=p2.bottom-T2*N1,s5=E1.width+F*2;switch(q==null?void 0:q.hAlign){case"start":K2=f2+s5;break;case"end":f2=K2-s5;break;case"center":f2=Math.floor((f2+K2)/2)-s5/2,K2=f2+s5;break}let a5=E1.height+P*2;switch(q==null?void 0:q.vAlign){case"start":f4=H4+a5;break;case"end":H4=f4-a5;break;case"center":H4=Math.floor((H4+f4)/2)-a5/2,f4=H4+a5;break}f2>s2.x?S1=s2.x-f2:K2s2.y?r2=s2.y-H4:f4=O2-G2)&&(r2=0),(S1!==0||r2!==0)&&(N1!==1&&(S1/=N1,r2/=N1),c.current.scrollTo(S1+c.current.scrollLeft,r2+c.current.scrollTop))}}}},[A,c2,T4,M1,f1,N0,O2,t5,B0]),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=Y[H];if(((X=M==null?void 0:M.trailingRowOptions)==null?void 0:X.disabled)===!0)return;let F=u2==null?void 0:u2(),P,q=!0;F!==void 0&&(P=await F,P==="top"&&(q=!1),typeof P=="number"&&(q=!1));let I=0,$=()=>{if(b3.current<=d){I<500&&window.setTimeout($,I),I=50+I*2;return}let l1=typeof P=="number"?P:q?d:0;g7.current(H-A,l1),g0({cell:[H,l1],range:{x:H,y:l1,width:1,height:1}},!1,!1,"edit");let V1=R6.current([H-A,l1]);V1.allowOverlay&&m5(V1)&&V1.readonly!==!0&&f&&window.setTimeout(()=>{N6.current(H,l1)},0)};$()},[Y,u2,A,d,g0]),c7=O.useCallback(H=>{var M,F,P;let f=(P=(F=(M=N0[H])==null?void 0:M.trailingRowOptions)==null?void 0:F.targetColumn)!=null?P:n2==null?void 0:n2.targetColumn;if(typeof f=="number")return f+(K0?1:0);if(typeof f=="object"){let q=u.indexOf(f);if(q>=0)return q+(K0?1:0)}},[N0,u,K0,n2==null?void 0:n2.targetColumn]),$4=O.useRef(),_5=O.useRef(),v9=O.useCallback((H,f)=>{var P;let[M,F]=f;return a4(h0,(P=Y[M])==null?void 0:P.themeOverride,w==null?void 0:w(F),H.themeOverride)},[w,Y,h0]),p9=O.useCallback(H=>{var V1,z1,P1,E1;let f=p5.value?H.metaKey:H.ctrlKey,M=f&&T1==="multi",F=f&&s1==="multi",[P,q]=H.location,I=W.columns,$=W.rows,[X,l1]=(z1=(V1=W.current)==null?void 0:V1.cell)!=null?z1:[];if(H.kind==="cell"){if(_5.current=void 0,l5.current=[P,q],P===0&&K0){if(W2===!0&&q===d||U0==="number"||T1==="none")return;let S1=Y0(H.location);if(S1.kind!==s4.Marker)return;if(x4!==void 0){let N1=L0(S1);d0((N1==null?void 0:N1.kind)===s4.Marker);let s2=(P1=N1==null?void 0:N1.onClick)==null?void 0:P1.call(N1,T(y({},H),{cell:S1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,theme:v9(S1,H.location),preventDefault:()=>{}}));if(s2===void 0||s2.checked===S1.checked)return}s(void 0),I2();let r2=$.hasIndex(q),p2=$4.current;if(T1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&p2!==void 0&&$.hasIndex(p2)){let N1=[Math.min(p2,q),Math.max(p2,q)+1];M||z2==="multi"?H0(void 0,N1,!0):H0(x2.fromSingleSelection(N1),void 0,M)}else M||H.isTouch||z2==="multi"?r2?H0($.remove(q),void 0,!0):(H0(void 0,q,!0),$4.current=q):r2&&$.length===1?H0(x2.empty(),void 0,f):(H0(x2.fromSingleSelection(q),void 0,f),$4.current=q)}else if(P>=A&&W2&&q===d){let S1=c7(P);O5(S1!=null?S1:P)}else if(X!==P||l1!==q){let S1=Y0(H.location),r2=L0(S1);if((r2==null?void 0:r2.onSelect)!==void 0){let s2=!1;if(r2.onSelect(T(y({},H),{cell:S1,posX:H.localEventX,posY:H.localEventY,bounds:H.bounds,preventDefault:()=>s2=!0,theme:v9(S1,H.location)})),s2)return}let p2=t5&&q===d,N1=t5&&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 s2=Math.min(P,X),M2=Math.max(P,X),T2=Math.min(q,l1),G2=Math.max(q,l1);g0(T(y({},W.current),{range:{x:s2,y:T2,width:M2-s2+1,height:G2-T2+1}}),!0,f,"click"),$4.current=void 0,I2()}else g0({cell:[P,q],range:{x:P,y:q,width:1,height:1}},!0,f,"click"),$4.current=void 0,s(void 0),I2()}}else if(H.kind==="header")if(l5.current=[P,q],s(void 0),K0&&P===0)$4.current=void 0,_5.current=void 0,T1==="multi"&&($.length!==d?H0(x2.fromSingleSelection([0,d]),void 0,f):H0(x2.empty(),void 0,f),I2());else{let S1=_5.current;if(s1==="multi"&&(H.shiftKey||H.isLongTouch===!0)&&S1!==void 0&&I.hasIndex(S1)){let r2=[Math.min(S1,P),Math.max(S1,P)+1];F?i0(void 0,r2,f):i0(x2.fromSingleSelection(r2),void 0,f)}else F?(I.hasIndex(P)?i0(I.remove(P),void 0,f):i0(void 0,P,f),_5.current=P):s1!=="none"&&(i0(x2.fromSingleSelection(P),void 0,f),_5.current=P);$4.current=void 0,I2()}else H.kind===S0?l5.current=[P,q]:H.kind===n9&&!H.isMaybeScrollbar&&(D0(g3,!1),s(void 0),I2(),Z1==null||Z1(),$4.current=void 0,_5.current=void 0)},[O5,s1,I2,L0,c7,Y0,W,K0,t5,Z1,x4,A,U0,T1,z2,d,g0,D0,i0,H0,W2,v9]),M9=O.useRef(!1),l5=O.useRef(),B6=O.useRef(G1),l4=O.useRef(),xo=O.useCallback(H=>{if(W5.current=!1,B6.current=m1.current,H.button!==0&&H.button!==1){l4.current=void 0;return}let f=performance.now();l4.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}),l5.current=void 0,!H.isTouch&&H.button===0&&!M?p9(H):!H.isTouch&&H.button===1&&(l5.current=H.location))},[W,p9]),[F3,S3]=O.useState(),z6=O.useCallback(H=>{if(H.kind!==S0||s1!=="multi")return;let f=p5.value?H.metaKey:H.ctrlKey,[M]=H.location,F=W.columns;if(M=A&&V5(P.group,Y[$].group);$--)q--;for(let $=M+1;${if(o0!==void 0&&h4!==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)},E0.current.signal);typeof F!="object"&&(F=await F());let P=N0[H-A],I=document.createElement("canvas").getContext("2d",{alpha:!1});if(I!==null){I.font=h0.baseFontFull;let $=h8(I,h0,P,0,F,G0,c4,!1,L0);h4==null||h4(P,$.width,H,$.width)}}},[N0,o0,c4,h0,G0,h4,A,d,L0]),[fo,k3]=O.useState(),q5=O.useCallback(async(H,f)=>{var $,X;let M=($=H.current)==null?void 0:$.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:T(y({},F),{x:F.x-A}),patternSource:T(y({},M),{x:M.x-A}),preventDefault:()=>l1=!0}),l1)return}let P=o0(M,E0.current.signal);typeof P!="object"&&(P=await P());let q=P,I=[];for(let l1=0;l1({cell:l1.location})))},[o0,V0,x,A]),y6=O.useCallback(()=>{if(W.current===void 0||W.current.range.width<=1)return;let H=T(y({},W),{current:T(y({},W.current),{range:T(y({},W.current.range),{width:1})})});q5(H,W)},[q5,W]),b6=O.useCallback(()=>{if(W.current===void 0||W.current.range.height<=1)return;let H=T(y({},W),{current:T(y({},W.current),{range:T(y({},W.current.range),{height:1})})});q5(H,W)},[q5,W]),Zo=O.useCallback((H,f)=>{var V1,z1,P1;let M=n;if(C(void 0),t4(void 0),k3(void 0),M9.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=T(y({},W),{current:T(y({},W.current),{range:p8(M.previousSelection.current.range,v2)})});q5(M.previousSelection,E1),D0(E1,!0);return}let[F,P]=H.location,[q,I]=(z1=l5.current)!=null?z1:[],$=()=>{W5.current=!0},X=E1=>{var r2,p2,N1,s2;let S1=E1.isTouch||q===F&&I===P;if(S1&&(Z==null||Z([F-A,P],T(y({},E1),{preventDefault:$}))),E1.button===1)return!W5.current;if(!W5.current){let M2=Y0(H.location),T2=L0(M2);if(T2!==void 0&&T2.onClick!==void 0&&S1){let f2=T2.onClick(T(y({},E1),{cell:M2,posX:E1.localEventX,posY:E1.localEventY,bounds:E1.bounds,theme:v9(M2,H.location),preventDefault:$}));f2!==void 0&&!P4(f2)&&K5(f2)&&(V0([{location:E1.location,value:f2}]),(r2=U2.current)==null||r2.damage([{cell:E1.location}]))}if(W5.current||W.current===void 0)return!1;let G2=!1;switch((p2=M2.activationBehaviorOverride)!=null?p2:b1){case"double-click":case"second-click":{if(((s2=(N1=M==null?void 0:M.previousSelection)==null?void 0:N1.current)==null?void 0:s2.cell)===void 0)break;let[f2,K2]=W.current.cell,[H4,f4]=M.previousSelection.current.cell;G2=F===f2&&F===H4&&P===K2&&P===f4&&(E1.isDoubleClick===!0||b1==="second-click");break}case"single-click":{G2=!0;break}}if(G2)return R==null||R([F-A,P]),I5(E1.bounds,!1),!0}return!1},l1=H.location[0]-A;if(H.isTouch){let E1=m1.current,S1=B6.current;if(E1.x!==S1.x||E1.y!==S1.y)return;if(H.isLongTouch===!0){if(H.kind==="cell"&&d5((P1=W.current)==null?void 0:P1.cell,H.location)){J==null||J([l1,H.location[1]],T(y({},H),{preventDefault:$}));return}else if(H.kind==="header"&&W.columns.hasIndex(F)){w1==null||w1(l1,T(y({},H),{preventDefault:$}));return}else if(H.kind===S0){if(l1<0)return;G==null||G(l1,T(y({},H),{preventDefault:$}));return}}H.kind==="cell"?X(H)||p9(H):H.kind===S0?K==null||K(l1,T(y({},H),{preventDefault:$})):(H.kind===y4&&(D==null||D(l1,T(y({},H),{preventDefault:$}))),p9(H));return}if(H.kind==="header"){if(l1<0)return;H.isEdge?H.isDoubleClick===!0&&m7(F):H.button===0&&F===q&&P===I&&(D==null||D(l1,T(y({},H),{preventDefault:$})))}if(H.kind===S0){if(l1<0)return;H.button===0&&F===q&&P===I&&(K==null||K(l1,T(y({},H),{preventDefault:$})),W5.current||z6(H))}H.kind==="cell"&&(H.button===0||H.button===1)&&X(H),l5.current=void 0},[n,W,A,v2,q5,D0,Z,Y0,L0,b1,v9,V0,R,I5,J,w1,G,p9,K,D,m7,z6]),Eo=O.useCallback(H=>{let f=T(y({},H),{location:[H.location[0]-A,H.location[1]]});H2==null||H2(f),n!==void 0&&H.buttons===0&&(C(void 0),t4(void 0),k3(void 0),M9.current=!1),k3(M=>{var F,P;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||((P=(F=l4.current)==null?void 0:F.location[0])!=null?P:0){o1==null||o1(H-A,f)},[o1,A]),r4=(K6=W==null?void 0:W.current)==null?void 0:K6.cell,Ro=O.useCallback((H,f,M,F,P,q)=>{l2.current=!1;let I=r4;I!==void 0&&(I=[I[0]-A,I[1]]);let $=f1===0?void 0:{x:0,y:H.y,width:f1,height:H.height},X=[];$!==void 0&&X.push($),c2>0&&(X.push({x:H.x-A,y:d-c2,width:H.width,height:c2}),f1>0&&X.push({x:0,y:d-c2,width:f1,height:c2}));let l1={x:H.x-A,y:H.y,width:H.width,height:W2&&H.y+H.height>=d?H.height-1:H.height,tx:P,ty:q,extras:{selected:I,freezeRegion:$,freezeRegions:X}};m1.current=l1,d2(l1),n7([f,M,F]),Q2==null||Q2(l1,l1.tx,l1.ty,l1.extras)},[r4,A,W2,d,f1,c2,d2,Q2]),Bo=H5(y1,O.useCallback((H,f)=>{y1==null||y1(H-A,f-A),s1!=="none"&&i0(x2.fromSingleSelection(f),void 0,!0)},[s1,y1,A,i0])),T3=O.useRef(!1),zo=O.useCallback(H=>{if(H.location[0]===0&&A>0){H.preventDefault();return}U1==null||U1(T(y({},H),{location:[H.location[0]-A,H.location[1]]})),H.defaultPrevented()||(T3.current=!0),C(void 0)},[U1,A]),yo=O.useCallback(()=>{T3.current=!1},[]),P3=O.useRef(),D3=O.useCallback(H=>{var f,M,F;if(!C3(H,P3.current)&&(P3.current=H,!(((f=l4==null?void 0:l4.current)==null?void 0:f.button)!==void 0&&l4.current.button>=1))){if(H.buttons!==0&&n!==void 0&&((M=l4.current)==null?void 0:M.location[0])===0&&H.location[0]===0&&A===1&&T1==="multi"&&n.previousSelection&&!n.previousSelection.rows.hasIndex(l4.current.location[1])&&W.rows.hasIndex(l4.current.location[1])){let P=Math.min(l4.current.location[1],H.location[1]),q=Math.max(l4.current.location[1],H.location[1])+1;H0(x2.fromSingleSelection([P,q]),void 0,!1)}if(H.buttons!==0&&n!==void 0&&W.current!==void 0&&!T3.current&&!M9.current&&(t2==="rect"||t2==="multi-rect")){let[P,q]=W.current.cell,[I,$]=H.location;if($<0&&($=m1.current.y),n.fillHandle===!0&&((F=n.previousSelection)==null?void 0:F.current)!==void 0){let X=n.previousSelection.current.range;$=Math.min($,W2?d-1:d);let l1=Ai(X,I,$,L2);t4(l1)}else{if(W2&&q===d)return;if(W2&&$===d)if(H.kind===n9)$--;else return;I=Math.max(I,A);let V1=I-P,z1=$-q,P1={x:V1>=0?P:I,y:z1>=0?q:$,width:Math.abs(V1)+1,height:Math.abs(z1)+1};g0(T(y({},W.current),{range:P1}),!0,!1,"drag")}}p1==null||p1(T(y({},H),{location:[H.location[0]-A,H.location[1]]}))}},[L2,n,A,T1,W,t2,p1,H0,W2,d,g0]),bo=O.useCallback(()=>{var I,$,X;let H=P3.current;if(H===void 0)return;let[f,M]=H.scrollEdge,[F,P]=H.location,q=m1.current;f===-1?F=(X=($=(I=q.extras)==null?void 0:I.freezeRegion)==null?void 0:$.x)!=null?X:q.x:f===1&&(F=q.x+q.width),M===-1?P=Math.max(0,q.y):M===1&&(P=Math.min(d-1,q.y+q.height)),F=(0,f5.default)(F,0,Y.length-1),P=(0,f5.default)(P,0,d-1),D3(T(y({},H),{location:[F,P]}))},[Y.length,D3,d]);ia(fo,c,bo);let g4=O.useCallback(H=>{if(W.current===void 0)return;let[f,M]=H,[F,P]=W.current.cell,q=W.current.range,I=q.x,$=q.x+q.width,X=q.y,l1=q.y+q.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:o5(M)}if(f!==0)if(f===2)$=Y.length,I=F,r0($-1-A,0,"horizontal");else if(f===-2)I=A,$=F+1,r0(I-A,0,"horizontal");else{let V1=[];if(o0!==void 0){let z1=o0({x:I,y:X,width:$-I-A,height:l1-X},E0.current.signal);typeof z1=="object"&&(V1=ML(z1))}if(f===1){let z1=!1;if(I0){let P1=(0,Z5.default)(I+1,F+1).find(E1=>!V1.includes(E1-A));P1!==void 0&&(I=P1,z1=!0)}else I++,z1=!0;z1&&r0(I,0,"horizontal")}z1||($=Math.min(Y.length,$+1),r0($-1-A,0,"horizontal"))}else if(f===-1){let z1=!1;if($>F+1){if(V1.length>0){let P1=(0,Z5.default)($-1,F,-1).find(E1=>!V1.includes(E1-A));P1!==void 0&&($=P1,z1=!0)}else $--,z1=!0;z1&&r0($-A,0,"horizontal")}z1||(I=Math.max(A,I-1),r0(I-A,0,"horizontal"))}else o5(f)}g0({cell:W.current.cell,range:{x:I,y:X,width:$-I,height:l1-X}},!0,!1,"keyboard-select")},[o0,W,Y.length,A,d,r0,g0]),U4=O.useCallback((H,f,M,F)=>{let P=O2-(M?0:1);if(H=(0,f5.default)(H,A,N0.length-1+A),f=(0,f5.default)(f,0,P),H===(r4==null?void 0:r4[0])&&f===(r4==null?void 0:r4[1]))return!1;if(F&&W.current!==void 0){let q=[...W.current.rangeStack];(W.current.range.width>1||W.current.range.height>1)&&q.push(W.current.range),D0(T(y({},W),{current:{cell:[H,f],range:{x:H,y:f,width:1,height:1},rangeStack:q}}),!0)}else g0({cell:[H,f],range:{x:H,y:f,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===H&&h.current[1]===f&&(h.current=void 0),r0(H-A,f),!0},[O2,A,N0.length,r4,W,r0,D0,g0]),Fo=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 P;(P=U2.current)==null||P.damage([{cell:r.cell}])})),I2(!0),s(void 0);let[M,F]=f;if(W.current!==void 0&&(M!==0||F!==0)){let P=W.current.cell[1]===O2-1&&H!==void 0;U4((0,f5.default)(W.current.cell[0]+M,0,Y.length-1),(0,f5.default)(W.current.cell[1]+F,0,O2-1),P,!1)}N==null||N(H,f)},[r==null?void 0:r.cell,I2,W,N,V0,O2,U4,Y.length]),So=O.useMemo(()=>`gdg-overlay-${pL++}`,[]),r5=O.useCallback(H=>{var M,F,P,q;I2();let f=[];for(let I=H.x;I({cell:I.location})))},[I2,p,L0,V0,A]),x9=r!==void 0,F6=O.useCallback(H=>{var E1,S1,r2,p2;let f=()=>{H.stopPropagation(),H.preventDefault()},M={didMatch:!1},{bounds:F}=H,P=W.columns,q=W.rows,I=m4;if(!x9&&a2(I.clear,H,M))D0(g3,!1),Z1==null||Z1();else if(!x9&&a2(I.selectAll,H,M))D0({columns:x2.empty(),rows:x2.empty(),current:{cell:(S1=(E1=W.current)==null?void 0:E1.cell)!=null?S1:[A,0],range:{x:A,y:0,width:u.length,height:d},rangeStack:[]}},!1);else if(a2(I.search,H,M))(r2=a==null?void 0:a.current)==null||r2.focus({preventScroll:!0}),o7(!0);else if(a2(I.delete,H,M)){let N1=(p2=w4==null?void 0:w4(W))!=null?p2:!0;if(N1!==!1){let s2=N1===!0?W:N1;if(s2.current!==void 0){r5(s2.current.range);for(let M2 of s2.current.rangeStack)r5(M2)}for(let M2 of s2.rows)r5({x:A,y:M2,width:u.length,height:1});for(let M2 of s2.columns)r5({x:M2,y:0,width:1,height:d})}}if(M.didMatch)return f(),!0;if(W.current===void 0)return!1;let[$,X]=W.current.cell,l1=!1,V1=!1;a2(I.scrollToSelectedCell,H,M)?g7.current($-A,X):s1!=="none"&&a2(I.selectColumn,H,M)?P.hasIndex($)?i0(P.remove($),void 0,!0):s1==="single"?i0(x2.fromSingleSelection($),void 0,!0):i0(void 0,$,!0):T1!=="none"&&a2(I.selectRow,H,M)?q.hasIndex(X)?H0(q.remove(X),void 0,!0):T1==="single"?H0(x2.fromSingleSelection(X),void 0,!0):H0(void 0,X,!0):!x9&&F!==void 0&&a2(I.activateCell,H,M)?X===d&&W2?window.setTimeout(()=>{let N1=c7($);O5(N1!=null?N1:$)},0):(R==null||R([$-A,X]),I5(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,$=0):a2(I.goToLastCell,H,M)?(s(void 0),X=Number.MAX_SAFE_INTEGER,$=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])):x9?(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),$--),a2(I.acceptOverlayRight,H,M)&&(s(void 0),$++)):(a2(I.goDownCell,H,M)?X+=1:a2(I.goUpCell,H,M)?X-=1:a2(I.goRightCell,H,M)?$+=1:a2(I.goLeftCell,H,M)?$-=1:a2(I.goDownCellRetainSelection,H,M)?(X+=1,l1=!0):a2(I.goUpCellRetainSelection,H,M)?(X-=1,l1=!0):a2(I.goRightCellRetainSelection,H,M)?($+=1,l1=!0):a2(I.goLeftCellRetainSelection,H,M)?($-=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)?$=Number.MAX_SAFE_INTEGER:a2(I.goToFirstColumn,H,M)?$=Number.MIN_SAFE_INTEGER:(t2==="rect"||t2==="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 z1=U4($,X,!1,l1),P1=M.didMatch;return P1&&(z1||!V1||i7)&&f(),P1},[x9,W,m4,s1,T1,t2,A,d,U4,D0,Z1,u.length,w4,i7,r5,i0,H0,W2,c7,O5,R,I5,b6,y6,g4]),f9=O.useCallback(H=>{let f=!1;if(g1!==void 0&&g1(T(y({},H),{cancel:()=>{f=!0}})),f||F6(H)||W.current===void 0)return;let[M,F]=W.current.cell,P=m1.current;if(Z2&&!H.metaKey&&!H.ctrlKey&&W.current!==void 0&&H.key.length===1&&/[ -~]/g.test(H.key)&&H.bounds!==void 0&&m5(p([M-A,Math.max(0,Math.min(F,d-1))]))){if((!W2||F!==d)&&(P.y>F||F>P.y+P.height||P.x>M||M>P.x+P.width))return;I5(H.bounds,!0,H.key),H.stopPropagation(),H.preventDefault()}},[Z2,g1,F6,W,p,A,d,W2,I5]),ko=O.useCallback((H,f)=>{let M=H.location[0]-A;if(H.kind==="header"&&(w1==null||w1(M,T(y({},H),{preventDefault:f}))),H.kind===S0){if(M<0)return;G==null||G(M,T(y({},H),{preventDefault:f}))}if(H.kind==="cell"){let[F,P]=H.location;J==null||J([M,P],T(y({},H),{preventDefault:f})),Et(W,H.location)||U4(F,P,!1,!1)}},[W,J,G,w1,A,U4]),A3=O.useCallback(async H=>{var I,$,X,l1,V1,z1;if(!m4.paste)return;function f(P1,E1,S1,r2){var N1,s2,M2,T2;let p2=typeof S1=="object"?(N1=S1==null?void 0:S1.join(` +`))!=null?N1:"":(s2=S1==null?void 0:S1.toString())!=null?s2:"";if(!P4(P1)&&m5(P1)&&P1.readonly!==!0){let G2=E==null?void 0:E(p2,P1);if(G2!==void 0&&K5(G2))return{location:E1,value:G2};let f2=L0(P1);if(f2===void 0)return;if(f2.kind===C1.Custom){d0(P1.kind===C1.Custom);let K2=(M2=f2.onPaste)==null?void 0:M2.call(f2,p2,P1.data);return K2===void 0?void 0:{location:E1,value:T(y({},P1),{data:K2})}}else{let K2=(T2=f2.onPaste)==null?void 0:T2.call(f2,p2,P1,{formatted:r2,formattedString:typeof r2=="string"?r2:r2==null?void 0:r2.join(` +`),rawValue:S1});return K2===void 0?void 0:(d0(K2.kind===P1.kind),{location:E1,value:K2})}}}let M=W.columns,F=W.rows,P=((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,q;if(W.current!==void 0?q=[W.current.range.x,W.current.range.y]:M.length===1?q=[(X=M.first())!=null?X:0,0]:F.length===1&&(q=[A,(l1=F.first())!=null?l1:0]),P&&q!==void 0){let P1,E1,S1="text/plain",r2="text/html";if(navigator.clipboard.read!==void 0){let M2=await navigator.clipboard.read();for(let T2 of M2){if(T2.types.includes(r2)){let f2=await(await T2.getType(r2)).text(),K2=t6(f2);if(K2!==void 0){P1=K2;break}}T2.types.includes(S1)&&(E1=await(await T2.getType(S1)).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(r2)){let M2=H.clipboardData.getData(r2);P1=t6(M2)}P1===void 0&&H.clipboardData.types.includes(S1)&&(E1=H.clipboardData.getData(S1))}else return;let[p2,N1]=q,s2=[];do{if(t1===void 0){let M2=Y0(q),T2=(V1=E1!=null?E1:P1==null?void 0:P1.map(f2=>f2.map(K2=>K2.rawValue).join(" ")).join(" "))!=null?V1:"",G2=f(M2,q,T2,void 0);G2!==void 0&&s2.push(G2);break}if(P1===void 0){if(E1===void 0)return;P1=Qs(E1)}if(t1===!1||typeof t1=="function"&&(t1==null?void 0:t1([q[0]-A,q[1]],P1.map(M2=>M2.map(T2=>{var G2,f2;return(f2=(G2=T2.rawValue)==null?void 0:G2.toString())!=null?f2:""}))))!==!0)return;for(let[M2,T2]of P1.entries()){if(M2+N1>=d)break;for(let[G2,f2]of T2.entries()){let K2=[G2+p2,M2+N1],[H4,f4]=K2;if(H4>=Y.length||f4>=O2)continue;let s5=Y0(K2),a5=f(s5,K2,f2.rawValue,f2.formatted);a5!==void 0&&s2.push(a5)}}}while(!1);V0(s2),(z1=U2.current)==null||z1.damage(s2.map(M2=>({cell:M2.location})))}},[E,L0,Y0,W,m4.paste,Y.length,V0,O2,t1,A,d]);n0("paste",A3,g,!1,!0);let Z9=O.useCallback(async(H,f)=>{var I,$;if(!m4.copy)return;let M=f===!0||((I=c.current)==null?void 0:I.contains(document.activeElement))===!0||(($=o.current)==null?void 0:$.contains(document.activeElement))===!0,F=W.columns,P=W.rows,q=(X,l1)=>{if(!H1)i6(X,l1,H);else{let V1=l1.map(z1=>({kind:C1.Text,data:u[z1].title,displayData:u[z1].title,allowOverlay:!1}));i6([V1,...X],l1,H)}};if(M&&o0!==void 0){if(W.current!==void 0){let X=o0(W.current.range,E0.current.signal);typeof X!="object"&&(X=await X()),q(X,(0,Z5.default)(W.current.range.x-A,W.current.range.x+W.current.range.width-A))}else if(P!==void 0&&P.length>0){let l1=[...P].map(V1=>{let z1=o0({x:A,y:V1,width:u.length,height:1},E0.current.signal);return typeof z1=="object"?z1[0]:z1().then(P1=>P1[0])});if(l1.some(V1=>V1 instanceof Promise)){let V1=await Promise.all(l1);q(V1,(0,Z5.default)(u.length))}else q(l1,(0,Z5.default)(u.length))}else if(F.length>0){let X=[],l1=[];for(let V1 of F){let z1=o0({x:V1,y:0,width:1,height:d},E0.current.signal);typeof z1!="object"&&(z1=await z1()),X.push(z1),l1.push(V1-A)}if(X.length===1)q(X[0],l1);else{let V1=X.reduce((z1,P1)=>z1.map((E1,S1)=>[...E1,...P1[S1]]));q(V1,l1)}}}},[u,o0,W,m4.copy,A,d,H1]);n0("copy",Z9,g,!1,!1);let To=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 Z9(H),W.current!==void 0)){let P={current:{cell:W.current.cell,range:W.current.range,rangeStack:[]},rows:x2.empty(),columns:x2.empty()},q=w4==null?void 0:w4(P);if(q===!1||(P=q===!0?P:q,P.current===void 0))return;r5(P.current.range)}},[r5,W,m4.cut,Z9,w4]);n0("cut",To,g,!1,!1);let Po=O.useCallback((H,f)=>{if(Q!==void 0){A!==0&&(H=H.map(P=>[P[0]-A,P[1]])),Q(H,f);return}if(H.length===0||f===-1)return;let[M,F]=H[f];h.current!==void 0&&h.current[0]===M&&h.current[1]===F||(h.current=[M,F],U4(M,F,!1,!1))},[Q,A,U4]),[h7,w7]=(j6=(X6=e0==null?void 0:e0.current)==null?void 0:X6.cell)!=null?j6:[],g7=O.useRef(r0);g7.current=r0,O.useLayoutEffect(()=>{var H,f,M,F;!l2.current&&h7!==void 0&&w7!==void 0&&(h7!==((f=(H=W4.current)==null?void 0:H.current)==null?void 0:f.cell[0])||w7!==((F=(M=W4.current)==null?void 0:M.current)==null?void 0:F.cell[1]))&&g7.current(h7,w7),l2.current=!1},[h7,w7]);let S6=W.current!==void 0&&(W.current.cell[0]>=Y.length||W.current.cell[1]>=O2);O.useLayoutEffect(()=>{S6&&D0(g3,!1)},[S6,D0]);let Do=O.useMemo(()=>W2===!0&&(n2==null?void 0:n2.tint)===!0?x2.fromSingleSelection(O2-1):x2.empty(),[O2,W2,n2==null?void 0:n2.tint]),Ao=O.useCallback(H=>{var f;return typeof F2=="boolean"?F2:(f=F2==null?void 0:F2(H-A))!=null?f:!0},[A,F2]),Io=O.useMemo(()=>{if(F3===void 0||o.current===null)return null;let{bounds:H,group:f}=F3,M=o.current.getBoundingClientRect();return O.createElement(Ws,{bounds:H,group:f,canvasBounds:M,onClose:()=>S3(void 0),onFinish:F=>{S3(void 0),r1==null||r1(f,F)}})},[r1,F3]),Oo=Math.min(Y.length,f1+(K0?1:0));O.useImperativeHandle(t,()=>({appendRow:(H,f)=>O5(H+A,f),updateCells:H=>{var f;return A!==0&&(H=H.map(M=>({cell:[M.cell[0]+A,M.cell[1]]}))),(f=U2.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=U2.current)==null?void 0:M.getBounds((H!=null?H:0)+A,f)}},focus:()=>{var H;return(H=U2.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 A3();break}},scrollTo:r0,remeasureColumns:H=>{for(let f of H)m7(f+A)}}),[O5,m7,Z9,f9,A3,A,r0]);let[k6,T6]=r4!=null?r4:[],_o=O.useCallback(H=>{let[f,M]=H;if(M===-1){s1!=="none"&&(i0(x2.fromSingleSelection(f),void 0,!1),I2());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,I2,r0,k6,T6,g0,i0]),[Wo,qo]=O.useState(!1),P6=O.useRef((0,Ca.default)(H=>{qo(H)},5)),$o=O.useCallback(()=>{P6.current(!0),W.current===void 0&&W.columns.length===0&&W.rows.length===0&&n===void 0&&g0({cell:[A,$2],range:{x:A,y:$2,width:1,height:1}},!0,!1,"keyboard-select")},[$2,W,n,A,g0]),Uo=O.useCallback(()=>{P6.current(!1)},[]),[Go,Ko]=O.useMemo(()=>{var P;let H,f=(P=j1==null?void 0:j1.scrollbarWidthOverride)!=null?P:k9(),M=d+(W2?1:0);if(typeof B0=="number")H=M1+M*B0;else{let q=0,I=Math.min(M,10);for(let $=0;$I.width+q,0)+f;return[`${Math.min(1e5,F)}px`,`${Math.min(1e5,H)}px`]},[Y,j1==null?void 0:j1.scrollbarWidthOverride,B0,d,W2,M1]),Xo=O.useMemo(()=>ce(h0),[h0]);return O.createElement(me.Provider,{value:h0},O.createElement(ta,{style:Xo,className:c1,inWidth:v!=null?v:Go,inHeight:V!=null?V:Ko},O.createElement(_s,{fillHandle:X1,drawFocusRing:N2,experimental:j1,fixedShadowX:e4,fixedShadowY:M4,getRowThemeOverride:w,headerIcons:P0,imageWindowLoader:$0,initialSize:S4,isDraggable:e7,onDragLeave:t7,onRowMoved:x4,overscrollX:Z3,overscrollY:a7,preventDiagonalScrolling:y5,rightElement:e5,rightElementProps:I4,smoothScrollX:l7,smoothScrollY:p3,className:c1,enableGroups:j,onCanvasFocused:$o,onCanvasBlur:Uo,canvasRef:o,onContextMenu:ko,theme:h0,cellXOffset:X0,cellYOffset:$2,accessibilityHeight:G1.height,onDragEnd:yo,columns:Y,nonGrowWidth:z,drawHeader:B3,onColumnProposeMove:B,drawCell:z3,disabledRows:Do,freezeColumns:Oo,lockColumns:A,firstColAccessible:A===0,getCellContent:Y0,minColumnWidth:G0,maxColumnWidth:c4,searchInputRef:a,showSearch:L9,onSearchClose:N3,highlightRegions:i5,getCellsForSelection:o0,getGroupDetails:y3,headerHeight:T5,isFocused:Wo,groupHeaderHeight:j?H9:0,freezeTrailingRows:c2+(W2&&(n2==null?void 0:n2.sticky)===!0?1:0),hasAppendRow:W2,onColumnResize:h4,onColumnResizeEnd:R3,onColumnResizeStart:D5,onCellFocused:_o,onColumnMoved:Bo,onDragStart:zo,onHeaderMenuClick:No,onItemHovered:D3,isFilling:(n==null?void 0:n.fillHandle)===!0,onMouseMove:Eo,onKeyDown:f9,onKeyUp:W1,onMouseDown:xo,onMouseUp:Zo,onDragOverCell:Z0,onDrop:C4,onSearchResultsChanged:Po,onVisibleRegionChanged:Ro,clientSize:A5,rowHeight:B0,searchResults:I1,searchValue:J1,onSearchValueChange:v1,rows:O2,scrollRef:c,selection:W,translateX:G1.tx,translateY:G1.ty,verticalBorder:Ao,gridRef:U2,getCellRenderer:L0}),Io,r!==void 0&&O.createElement(O.Suspense,{fallback:null},O.createElement(vL,T(y({},r),{validateCell:d9,bloom:b,id:So,getCellRenderer:L0,className:(j1==null?void 0:j1.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:k0,imageEditorOverride:m,onFinishEditing:Fo,markdownDivCreateNode:L,isOutsideClick:r7})))))},ca=O.forwardRef(xL);var ma=20,ha={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 fL(e,e.cell.data,B9(e.cell),(t=e.cell.maxSize)!=null?t:ma)},onDelete:e=>T(y({},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:ma,h=Math.floor(r.y+o/2),g=A7(c,o,s.cellVerticalPadding),m=D7((V=t.contentAlign)!=null?V:"center",n,a,s.cellHorizontalPadding,g),w=P7(m,h,g),L=I7(n+i,C+l,w);if(B9(t)&&L)return T(y({},t),{data:h3(t.data)})},onPaste:(e,t)=>{let i=U5;return e.toLowerCase()==="true"?i=!0:e.toLowerCase()==="false"?i=!1:e.toLowerCase()==="indeterminate"&&(i=G5),i===t.data?void 0:T(y({},t),{data:i})}};function fL(e,t,i,l){if(!i&&t===U5)return;let{ctx:r,hoverAmount:s,theme:a,rect:o,highlighted:n,hoverX:C,hoverY:c,cell:{contentAlign:h}}=e,{x:g,y:m,width:w,height:L}=o,v=.35,V=i?1-v+v*s:.4;t===U5&&(V*=s),V!==0&&(r.globalAlpha=V,t9(r,a,t,g,m,w,L,n,C,c,l,h),r.globalAlpha=1)}var Ha=x1(k1(),1);var H3=x1(k1(),1);var wa=X2("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1});var ZL=e=>{let{bubbles:t}=e;return H3.createElement(wa,null,t.map((i,l)=>H3.createElement("div",{key:l,className:"boe-bubble"},i)),H3.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ga=ZL;var La={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=>NL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return Ha.createElement(ga,{bubbles:t.data})},onPaste:()=>{}},EL=4;function NL(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,h=8,g=EL,m=a+l.cellHorizontalPadding,w=[];for(let v of t){if(m>a+n)break;let V=R4(v,r,l.baseFontFull).width;w.push({x:m,width:V}),m+=V+h*2+g}r.beginPath();for(let v of w)f0(r,v.x,o+(C-c)/2,v.width+h*2,c,(L=l.roundingRadius)!=null?L:c/2);r.fillStyle=s?l.bgBubbleSelected:l.bgBubble,r.fill();for(let[v,V]of w.entries())r.beginPath(),r.fillStyle=l.textBubble,r.fillText(t[v],V.x+h,o+C/2+x0(r,l))}var da=x1(k1(),1);var Y9=x1(k1(),1);var RL=X2("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),BL=e=>{let{drilldowns:t}=e;return Y9.createElement(RL,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))))},Va=BL;var ua={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=>bL(e,e.cell.data),provideEditor:()=>e=>{let{value:t}=e;return da.createElement(Va,{drilldowns:t.data})},onPaste:()=>{}},zL=4,a6={};function yL(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,h=(c+s*2)*r,g=`${e},${t},${r},${i}`;if(a6[g]!==void 0)return{el:a6[g],height:n,width:h,middleWidth:o*r,sideWidth:C*r,padding:s*r,dpr:r};let m=document.createElement("canvas"),w=m.getContext("2d");return w===null?null:(m.width=h,m.height=n,w.scale(r,r),a6[g]=m,w.beginPath(),f0(w,s,s,c,a,l),w.shadowColor="rgba(24, 25, 34, 0.4)",w.shadowBlur=1,w.fillStyle=e,w.fill(),w.shadowColor="rgba(24, 25, 34, 0.3)",w.shadowOffsetY=1,w.shadowBlur=5,w.fillStyle=e,w.fill(),w.shadowOffsetY=0,w.shadowBlur=0,w.shadowBlur=0,w.beginPath(),f0(w,s+.5,s+.5,c,a,l),w.strokeStyle=t,w.lineWidth=1,w.stroke(),{el:m,height:n,width:h,sideWidth:C*r,middleWidth:l*r,padding:s*r,dpr:r})}function bL(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,h=n8(r,c),g=Math.min(i.height,Math.max(16,Math.ceil(h*l.lineHeight)*2)),m=Math.floor(i.y+(i.height-g)/2),w=g-10,L=8,v=zL,V=n+l.cellHorizontalPadding,u=(Z=l.roundingRadius)!=null?Z:6,d=yL(l.bgCell,l.drilldownBorder,g,u),p=[];for(let x of t){if(V>n+C)break;let E=R4(x.text,r,c).width,S=0;x.img!==void 0&&s.loadOrGetImage(x.img,a,o)!==void 0&&(S=w-8+4);let k=E+S+L*2;p.push({x:V,width:k}),V+=k+v}if(d!==null){let{el:x,height:N,middleWidth:E,sideWidth:S,width:k,dpr:b,padding:D}=d,B=S/b,_=D/b;for(let K of p){let J=Math.floor(K.x),c1=Math.floor(K.width),w1=c1-(B-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(x,0,0,S,N,J-_,m,B,g),w1>0&&r.drawImage(x,S,0,E,N,J+(B-_),m,w1,g),r.drawImage(x,k-S,0,S,N,J+c1-(B-_),m,B,g),r.imageSmoothingEnabled=!0}}r.beginPath();for(let[x,N]of p.entries()){let E=t[x],S=N.x+L;if(E.img!==void 0){let k=s.loadOrGetImage(E.img,a,o);if(k!==void 0){let b=w-8,D=0,B=0,_=k.width,K=k.height;_>K?(D+=(_-K)/2,_=K):K>_&&(B+=(K-_)/2,K=_),r.beginPath(),f0(r,S,m+g/2-b/2,b,b,(R=l.roundingRadius)!=null?R:3),r.save(),r.clip(),r.drawImage(k,D,B,_,K,S,m+g/2-b/2,b,b),r.restore(),S+=b+4}}r.beginPath(),r.fillStyle=l.textBubble,r.fillText(E.text,S,m+g/2+x0(r,l))}}var va=x1(k1(),1);var pa={getAccessibilityString:e=>e.data.join(", "),kind:C1.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>{var t,i,l;return FL(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=>T(y({},e),{data:[]}),provideEditor:()=>e=>{let{value:t,onFinishedEditing:i,imageEditorOverride:l}=e,r=l!=null?l:rt;return va.createElement(r,{urls:t.data,canWrite:t.readonly!==!1,onCancel:i,onChange:s=>{i(T(y({},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 T(y({},t),{data:l})}},o6=4;function FL(e,t,i,l){let{rect:r,col:s,row:a,theme:o,ctx:n,imageLoader:C}=e,{x:c,y:h,height:g,width:m}=r,w=g-o.cellVerticalPadding*2,L=[],v=0;for(let u=0;u0&&(n.beginPath(),f0(n,V,h+o.cellVerticalPadding,d,w,i),n.save(),n.clip()),n.drawImage(u,V,h+o.cellVerticalPadding,d,w),i>0&&n.restore(),V+=d+o6}}function SL(e,t){let i=e*49632+t*325176;return i^=i<<13,i^=i>>17,i^=i<<5,i/4294967295*2}var Ma={getAccessibilityString:()=>"",kind:C1.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{var c,h;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(SL(i,l)*t.skeletonWidthVariability));let n=a.cellHorizontalPadding,C=(c=t.skeletonHeight)!=null?c:Math.min(18,s.height-2*a.cellVerticalPadding);f0(r,s.x+n,s.y+(s.height-C)/2,o,C,(h=a.roundingRadius)!=null?h:3),r.fillStyle=z0(a.textDark,.1),r.fill()},onPaste:()=>{}};var fa=x1(k1(),1);var v0=x1(k1(),1);var kL=()=>e=>e.targetWidth,n6=X2("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[kL(),"px"]}});var xa=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,h]=v0.useState(n===""||l),g=v0.useCallback(()=>{h(w=>!w)},[]),m=n?"gdg-ml-6":"";return c?v0.createElement(n6,{targetWidth:s.width-20},v0.createElement(X4,{autoFocus:!0,highlight:!1,validatedSelection:o,value:n,onKeyDown:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:i}),v0.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${m}`,onClick:()=>a(t)},v0.createElement(Je,null))):v0.createElement(n6,{targetWidth:s.width},v0.createElement(D9,{contents:n,createNode:r}),!C&&v0.createElement(v0.Fragment,null,v0.createElement("div",{className:"spacer"}),v0.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${m}`,onClick:g},v0.createElement(X5,null))),v0.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))};var Za={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: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=>T(y({},e),{data:""}),provideEditor:()=>e=>{let{onChange:t,value:i,target:l,onFinishedEditing:r,markdownDivCreateNode:s,forceEditMode:a,validatedSelection:o}=e;return fa.createElement(xa,{onFinish:r,targetRect:l,value:i,validatedSelection:o,onChange:n=>t(T(y({},i),{data:n.target.value})),forceEditMode:a,createNode:s})},onPaste:(e,t)=>e===t.data?void 0:T(y({},t),{data:e})};var Ea={getAccessibilityString:e=>e.row.toString(),kind:s4.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:TL,measure:()=>44,draw:e=>DL(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 T(y({},i),{checked:!i.checked})},onPaste:()=>{}};function TL(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=PL,i.textAlign="center",s}function PL(e){let{ctx:t}=e;t.textAlign="start"}function DL(e,t,i,l,r,s){let{ctx:a,rect:o,hoverAmount:n,theme:C}=e,{x:c,y:h,width:g,height:m}=o,w=i?1:l==="checkbox-visible"?.6+.4*n:n;if(l!=="number"&&w>0){a.globalAlpha=w;let L=7*(i?n:1);if(t9(a,C,i,r?c+L:c,h,r?g-L:g,m,!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,h+m/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+g/2;l==="both"&&n!==0&&(a.globalAlpha=1-n),a.fillStyle=C.textLight,a.font=v,a.fillText(L,V,h+m/2+x0(a,v)),n!==0&&(a.globalAlpha=1)}}var Na={getAccessibilityString:()=>"",kind:s4.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>AL(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function AL(e,t,i){let{ctx:l,rect:r,hoverAmount:s,theme:a,spriteManager:o}=e,{x:n,y:C,width:c,height:h}=r;l.beginPath(),l.globalAlpha=s,l.rect(n+1,C+1,c,h-2),l.fillStyle=a.bgHeaderHovered,l.fill(),l.globalAlpha=1,l.beginPath();let g=t!=="",m=0;if(i!==void 0){let L=h-8,v=n+8/2,V=C+8/2;o.drawSprite(i,"normal",l,v,V,L,a,g?1:s),m=L}else{m=24;let w=12,L=g?w:s*w,v=g?0:(1-s)*w*.5,V=a.cellHorizontalPadding+4;L>0&&(l.moveTo(n+V+v,C+h/2),l.lineTo(n+V+v+L,C+h/2),l.moveTo(n+V+v+L*.5,C+h/2-L*.5),l.lineTo(n+V+v+L*.5,C+h/2+L*.5),l.lineWidth=2,l.strokeStyle=a.bgIconHeader,l.lineCap="round",l.stroke())}l.fillStyle=a.textMedium,l.fillText(t,m+n+a.cellHorizontalPadding+.5,C+h/2+x0(l,a)),l.beginPath()}var E5=x1(k1(),1);var IL=E5.lazy(async()=>await import("./number-overlay-editor-CU4RMYZF.js")),Ra={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: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=>T(y({},e),{data:void 0}),provideEditor:()=>e=>{let{isHighlighted:t,onChange:i,value:l,validatedSelection:r}=e;return E5.createElement(E5.Suspense,{fallback:null},E5.createElement(IL,{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(T(y({},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 T(y({},t),{data:l,displayData:(r=i.formattedString)!=null?r:t.displayData})}};var Ba={getAccessibilityString:()=>"",measure:()=>108,kind:C1.Protected,needsHover:!1,needsHoverPosition:!1,draw:OL,onPaste:()=>{}};function OL(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,h=Math.sin(s8(30))*o;for(let g=0;g<12;g++)t.moveTo(n,C-o),t.lineTo(n,C+o),t.moveTo(n+c,C-h),t.lineTo(n-c,C+h),t.moveTo(n-c,C-h),t.lineTo(n+c,C+h),n+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=i.textLight,t.stroke()}var za=x1(k1(),1);var ya={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)=>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 za.default.createElement(X4,{highlight:t,autoFocus:l.readonly!==!0,disabled:l.readonly!==!1,value:l.data,validatedSelection:r,onChange:s=>i(T(y({},l),{data:s.target.value}))})},onPaste:()=>{}};var ba=x1(k1(),1);var Fa={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:B4,useLabel:!0,draw:e=>{var g;let{cell:t,hoverAmount:i,hyperWrapping:l,ctx:r,rect:s,theme:a,overrideCursor:o}=e,{displayData:n,contentAlign:C,hoverEffect:c,allowWrapping:h}=t;if(c===!0&&i>0){r.textBaseline="alphabetic";let m=a.cellHorizontalPadding,w=a.cellVerticalPadding,L=R4(n,r,a.baseFontFull,"alphabetic"),v=s.height-w,V=Math.min(v,L.actualBoundingBoxAscent*2.5);r.beginPath(),f0(r,s.x+m/2,s.y+(s.height-V)/2+1,L.width+m*3,V-1,(g=a.roundingRadius)!=null?g: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,h,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=>T(y({},e),{data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{let{isHighlighted:i,onChange:l,value:r,validatedSelection:s}=t;return ba.createElement(X4,{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(T(y({},r),{data:a.target.value}))})}}),onPaste:(e,t,i)=>{var l;return e===t.data?void 0:T(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Pa=x1(k1(),1);var u4=x1(k1(),1);var Sa=X2("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1});var _L=e=>{let{uri:t,onChange:i,forceEditMode:l,readonly:r,validatedSelection:s,preview:a}=e,[o,n]=u4.useState(!r&&(t===""||l)),C=u4.useCallback(()=>{n(!0)},[]);return o?u4.createElement(X4,{validatedSelection:s,highlight:!0,autoFocus:!0,value:t,onChange:i}):u4.createElement(Sa,null,u4.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&u4.createElement("div",{className:"gdg-edit-icon",onClick:C},u4.createElement(X5,null)),u4.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},ka=_L;function Ta(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 Da={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: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 h=R4(n,o,i.baseFontFull),g=Ta(h,a,i,t.contentAlign),{x:m,y:w,width:L,height:v}=g;if(r>=m-4&&r<=m-4+L+8&&s>=w-4&&s<=w-4+v+8){let V=x0(o,i.baseFontFull);l("pointer");let u=5,d=w-V;o.beginPath(),o.moveTo(a.x+m,Math.floor(a.y+d+v+u)+.5),o.lineTo(a.x+m+L,Math.floor(a.y+d+v+u)+.5),o.strokeStyle=i.linkColor,o.stroke(),o.save(),o.fillStyle=e.cellFillColor,I0(T(y({},e),{rect:T(y({},a),{x:a.x-1})}),n,t.contentAlign),I0(T(y({},e),{rect:T(y({},a),{x:a.x-2})}),n,t.contentAlign),I0(T(y({},e),{rect:T(y({},a),{x:a.x+1})}),n,t.contentAlign),I0(T(y({},e),{rect:T(y({},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=Ft(a,s.baseFontFull);if(o===void 0)return;let n=Ta(o,i,s,t.contentAlign);Y4({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=>T(y({},e),{data:""}),provideEditor:e=>t=>{var a;let{onChange:i,value:l,forceEditMode:r,validatedSelection:s}=t;return Pa.createElement(ka,{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(T(y({},l),{data:o.target.value}))})},onPaste:(e,t,i)=>{var l;return e===t.data?void 0:T(y({},t),{data:e,displayData:(l=i.formattedString)!=null?l:t.displayData})}};var Aa=[Ea,Na,ha,La,ua,pa,Ma,Za,Ra,Ba,ya,Fa,Da];var _a=x1(Oa(),1);var C6=[],c6=class extends W9{constructor(){super(...arguments);C2(this,"imageLoaded",()=>{});C2(this,"loadedLocations",[]);C2(this,"cache",{});C2(this,"sendLoaded",(0,_a.default)(()=>{this.imageLoaded(new z4(this.loadedLocations)),this.loadedLocations=[]},20));C2(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(g=>o.addEventListener("load",()=>g(null)));requestAnimationFrame(async()=>{try{o.src=i,await c,await o.decode();let g=this.cache[s];if(g!==void 0&&!n){g.img=o;for(let m of g.cells)this.loadedLocations.push(e9(m));a=!0,this.sendLoaded()}}catch(g){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)}},Wa=c6;var GL=(e,t)=>{let i=N5.useMemo(()=>y(y({},Di),e.headerIcons),[e.headerIcons]),l=N5.useMemo(()=>{var r;return(r=e.imageWindowLoader)!=null?r:new Wa},[e.imageWindowLoader]);return N5.createElement(ca,T(y({},e),{renderers:Aa,headerIcons:i,ref:t,imageWindowLoader:l}))},m6=N5.forwardRef(GL);var Q1=x1(k1()),io=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 Ua(e){var t=(0,Q1.useRef)(null);function i(l){!l||l===t.current||(t.current=l,e(l))}return i}function jL(e){var t=(0,Q1.useRef)(e);return(0,Q1.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 YL(){var e=(0,Q1.useRef)([]);return(0,Q1.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 h6=typeof window!="undefined"?Q1.useLayoutEffect:Q1.useEffect;function QL(e,t){var i=(0,Q1.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 Ga(e){return e!=null}function Ka(){for(var e=arguments.length,t=new Array(e),i=0;i=0})}},{key:"negativeSides",get:function(){var i=this;return Object.fromEntries(m3.filter(function(l){return i[l]<0}).map(function(l){return[l,i[l]]}))}}]),e}();function qa(){for(var e=arguments.length,t=new Array(e),i=0;iu?u-R:0;L[Z.prop]=a6(R+l+x,V,u),L[Z.opposite.prop]=L[Z.prop]+s.factor(n[g])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=u4.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=n6.mergeSmallestSides(r.layerOffsetsToScrollContainers);return l||(this._cachedContainerOffsets=s),s},h3(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],h=C[1];return[p0[c],h]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var h=C[1],g=c[1];return g-h}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),$a=function(e){bL(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=u4.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}(eo);function UL(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,h=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(h>0?-h:0)}var Ua={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function GL(e,t,i){var l;if(t.primary.isCenter)return Ua;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,h=UL(e,t,i),g=t.primary.prop,m=t.primary.oppositeCssProp,w=n?r[o]/2+h:s[m]+s[o]/2-r[m];return Y0({},Ua,(l={},l[g]="100%",l[m]=a6(w,C,c),l))}var Ga=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=p0[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],h=p0[C.isHorizontal?r.preferY:r.preferX],g=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function m(L,v){return new eo(L,v,l,r.layerDimensions,s)}var w=[];return w[0]=m(C,c),w[1]=m(C,c.isCenter?h:C0.center),w[2]=m(C,C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w[3]=m(h,g?C:C0[C.opposite.prop]),w[4]=m(h,C0.center),w[5]=m(h,g?C0[C.opposite.prop]:C),w[6]=m(p0[h.opposite.prop],g?C:C0[C.opposite.prop]),w[7]=m(p0[h.opposite.prop],C0.center),w[8]=m(p0[h.opposite.prop],g?C0[C.opposite.prop]:C),w[9]=m(p0[C.opposite.prop],c),w[10]=m(p0[C.opposite.prop],c.isCenter?h:C0.center),w[11]=m(p0[C.opposite.prop],C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w=w.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),w}return r.placement==="center"?new e([new $a(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 $a)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 h=l.getContainerOffsets(),g=l.secondary,m;l.triggerIsBigger||C===l?m=c.isPush?-1:1:m=g===C0.left||[C0.top,C0.center].includes(g)&&c.isPush?-1:1;var w=h[c.prop];return w*m},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=GL(this.subjectsBounds.merge({layer:l}),r,this.config.arrowOffset),C=this.config.overflowContainer?Y0({},o,{position:"fixed",top:l.top,left:l.left}):Y0({},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=n6.mergeSmallestSides(this.subjectsBounds.offsetsToScrollContainers(r,!0)),a=Object.entries(s.negativeSides),o=a.some(function(n){var C=n[0],c=n[1],h=p0[C];return c<=-r[h.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}(),KL=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 h=u4.fromWindow(l);return new e({layer:u4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?u4.create(o6(c())):u4.fromElement(s),arrow:o?u4.fromElement(o):u4.empty(),parent:a?u4.fromElement(a):h,window:h,scrollContainers:[h].concat(n.map(function(g){return u4.fromElement(g,{withScrollbars:!1})}))},C)};var t=e.prototype;return t.merge=function(l){return new e(Y0({},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)})},h3(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}(),Ka=null;var d4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:_L,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function to(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?d4.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?d4.placement:C,h=e.possiblePlacements,g=h===void 0?d4.possiblePlacements:h,m=e.preferX,w=m===void 0?d4.preferX:m,L=e.preferY,v=L===void 0?d4.preferY:L,V=e.auto,u=V===void 0?d4.auto:V,d=e.snap,p=d===void 0?d4.snap:d,Z=e.triggerOffset,R=Z===void 0?d4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?d4.containerOffset:x,E=e.arrowOffset,S=E===void 0?d4.arrowOffset:E,k=e.container,b=k===void 0?d4.container:k,D=e.layerDimensions,B=D===void 0?null:D,_=e.onDisappear,K=e.onOutsideClick,Q=e.onParentClose,m1=e.trigger,g1=(0,J1.useState)(function(){return{layerSide:c==="center"?"center":Ga.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),w1=g1[0],G=g1[1],s1=(0,J1.useRef)(null),o1=TL(w1,l),R1=(0,J1.useRef)({cancelled:!1});(0,J1.useEffect)(function(){return function(){R1.current.cancelled=!0}},[]);var J=(0,J1.useCallback)(function(w2,i2,a1){var T1=w2.arrow,l2=w2.layer,q1=w2.scrollContainers,S1=w2.trigger,$1=q1[0],U1=KL.create(o,l2,S1,$1,T1,q1,s,m1==null?void 0:m1.getBounds),H2={placement:c,possiblePlacements:g,auto:u,layerDimensions:B,arrowOffset:S,containerOffset:N,triggerOffset:R,preferX:w,preferY:v,snap:p,overflowContainer:s},t1=Ga.create(U1,H2).result(i2,a1),L1=t1.hasDisappeared,f1=t1.layerSide,b1=t1.styles,z2={layerSide:f1,styles:b1};if(!o1.current||XL(o1.current,z2)){o1.current=z2,R1.current.cancelled=!0;var n1={cancelled:!1};R1.current=n1,Promise.resolve().then(function(){n1.cancelled||G(z2)})}_a(L1)&&_a(_)&&_(L1)},[S,u,N,o,B,_,s,c,g,w,v,p,R,o1,m1]),I1=DL({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:J,triggerOption:m1}),p1=I1.triggerRef,e2=I1.layerRef,H1=I1.arrowRef,W1=I1.closestScrollContainer,E2=OL({isOpen:l,onOutsideClick:K,onParentClose:Q}),Z2=E2.closeOnOutsideClickRefs,u2=E2.registrations,y1={triggerProps:m1?{}:{ref:Wa(p1,Z2.trigger,s1)},layerProps:{ref:Wa(e2,Z2.layer),style:w1.styles.layer},arrowProps:{ref:H1,style:w1.styles.arrow,layerSide:w1.layerSide},layerSide:w1.layerSide,triggerBounds:l?m1?m1.getBounds():(t=s1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(w2){return typeof document!="undefined"?(0,Ya.createPortal)((0,J1.createElement)(AL,{registrations:u2,children:w2}),s||!W1?jL(b):W1):null}};return y1}function XL(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 Xa(){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[g])}L.width=L.right-L.left,L.height=L.bottom-L.top;var N=p4.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],h=C[1];return[p0[c],h]}).filter(function(C){var c=C[0];return s.primary.isOppositeDirection(c)}).sort(function(C,c){var h=C[1],g=c[1];return g-h}))==null?void 0:r[0])!=null?l:[],n=o[0];return n||null}}]),e}(),ja=function(e){KL(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=p4.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}(so);function nV(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,h=l[C]-l[a]/2-r[C]+s[a]/2+i;return(c<0?-c:0)+(h>0?-h:0)}var Ya={position:"absolute",willChange:"top, left",left:null,right:null,top:null,bottom:null};function CV(e,t,i){var l;if(t.primary.isCenter)return Ya;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,h=nV(e,t,i),g=t.primary.prop,m=t.primary.oppositeCssProp,w=n?r[o]/2+h:s[m]+s[o]/2-r[m];return Q0({},Ya,(l={},l[g]="100%",l[m]=g6(w,C,c),l))}var Qa=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=p0[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],h=p0[C.isHorizontal?r.preferY:r.preferX],g=!C.isHorizontal&&l.triggerHasBiggerWidth||C.isHorizontal&&l.triggerHasBiggerHeight;function m(L,v){return new so(L,v,l,r.layerDimensions,s)}var w=[];return w[0]=m(C,c),w[1]=m(C,c.isCenter?h:C0.center),w[2]=m(C,C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w[3]=m(h,g?C:C0[C.opposite.prop]),w[4]=m(h,C0.center),w[5]=m(h,g?C0[C.opposite.prop]:C),w[6]=m(p0[h.opposite.prop],g?C:C0[C.opposite.prop]),w[7]=m(p0[h.opposite.prop],C0.center),w[8]=m(p0[h.opposite.prop],g?C0[C.opposite.prop]:C),w[9]=m(p0[C.opposite.prop],c),w[10]=m(p0[C.opposite.prop],c.isCenter?h:C0.center),w[11]=m(p0[C.opposite.prop],C0[(c.opposite.isCenter?h.opposite:c.opposite).prop]),w=w.filter(function(L){return L.type===r.placement||r.possiblePlacements.includes(L.type)}),w}return r.placement==="center"?new e([new ja(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 ja)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 h=l.getContainerOffsets(),g=l.secondary,m;l.triggerIsBigger||C===l?m=c.isPush?-1:1:m=g===C0.left||[C0.top,C0.center].includes(g)&&c.isPush?-1:1;var w=h[c.prop];return w*m},t.getStyles=function(l,r,s,a){var o={willChange:"top, left, width, height"},n=CV(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],h=p0[C];return c<=-r[h.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}(),cV=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 h=p4.fromWindow(l);return new e({layer:p4.fromElement(r,{environment:l,withTransform:!1}),trigger:c?p4.create(H6(c())):p4.fromElement(s),arrow:o?p4.fromElement(o):p4.empty(),parent:a?p4.fromElement(a):h,window:h,scrollContainers:[h].concat(n.map(function(g){return p4.fromElement(g,{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}(),Ja=null;var v4={auto:!1,arrowOffset:0,containerOffset:10,triggerOffset:0,overflowContainer:!0,placement:"top-center",possiblePlacements:rV,preferX:"right",preferY:"bottom",snap:!1,container:void 0,trigger:void 0};function ao(e){var t,i=e.isOpen,l=i===void 0?!1:i,r=e.overflowContainer,s=r===void 0?v4.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?v4.placement:C,h=e.possiblePlacements,g=h===void 0?v4.possiblePlacements:h,m=e.preferX,w=m===void 0?v4.preferX:m,L=e.preferY,v=L===void 0?v4.preferY:L,V=e.auto,u=V===void 0?v4.auto:V,d=e.snap,p=d===void 0?v4.snap:d,Z=e.triggerOffset,R=Z===void 0?v4.triggerOffset:Z,x=e.containerOffset,N=x===void 0?v4.containerOffset:x,E=e.arrowOffset,S=E===void 0?v4.arrowOffset:E,k=e.container,b=k===void 0?v4.container:k,D=e.layerDimensions,B=D===void 0?null:D,_=e.onDisappear,K=e.onOutsideClick,J=e.onParentClose,c1=e.trigger,w1=(0,Q1.useState)(function(){return{layerSide:c==="center"?"center":Qa.getSidesFromPlacementType(c)[0].prop,styles:{layer:{position:s?"fixed":"absolute",top:0,left:0},arrow:{position:"absolute",top:0,left:0}}}}),h1=w1[0],G=w1[1],r1=(0,Q1.useRef)(null),a1=QL(h1,l),R1=(0,Q1.useRef)({cancelled:!1});(0,Q1.useEffect)(function(){return function(){R1.current.cancelled=!0}},[]);var Q=(0,Q1.useCallback)(function(w2,t2,s1){var T1=w2.arrow,i2=w2.layer,q1=w2.scrollContainers,F1=w2.trigger,$1=q1[0],U1=cV.create(o,i2,F1,$1,T1,q1,s,c1==null?void 0:c1.getBounds),H2={placement:c,possiblePlacements:g,auto:u,layerDimensions:B,arrowOffset:S,containerOffset:N,triggerOffset:R,preferX:w,preferY:v,snap:p,overflowContainer:s},t1=Qa.create(U1,H2).result(t2,s1),H1=t1.hasDisappeared,f1=t1.layerSide,b1=t1.styles,z2={layerSide:f1,styles:b1};if(!a1.current||mV(a1.current,z2)){a1.current=z2,R1.current.cancelled=!0;var o1={cancelled:!1};R1.current=o1,Promise.resolve().then(function(){o1.cancelled||G(z2)})}Ga(H1)&&Ga(_)&&_(H1)},[S,u,N,o,B,_,s,c,g,w,v,p,R,a1,c1]),I1=eV({ResizeObserverPolyfill:n,environment:o,enabled:l,overflowContainer:s,onChange:Q,triggerOption:c1}),v1=I1.triggerRef,J1=I1.layerRef,g1=I1.arrowRef,W1=I1.closestScrollContainer,E2=lV({isOpen:l,onOutsideClick:K,onParentClose:J}),Z2=E2.closeOnOutsideClickRefs,u2=E2.registrations,y1={triggerProps:c1?{}:{ref:Ka(v1,Z2.trigger,r1)},layerProps:{ref:Ka(J1,Z2.layer),style:h1.styles.layer},arrowProps:{ref:g1,style:h1.styles.arrow,layerSide:h1.layerSide},layerSide:h1.layerSide,triggerBounds:l?c1?c1.getBounds():(t=r1.current)==null?void 0:t.getBoundingClientRect():null,renderLayer:function(w2){return typeof document!="undefined"?(0,io.createPortal)((0,Q1.createElement)(tV,{registrations:u2,children:w2}),s||!W1?hV(b):W1):null}};return y1}function mV(e,t){if(e.layerSide!==t.layerSide)return!0;for(var i=["position","top","left","right","bottom"],l=0,r=i;l` + `,document.body.appendChild(t))}return t}var to;(function(e){e[e.ENTERING=0]="ENTERING",e[e.LEAVING=1]="LEAVING",e[e.IDLE=2]="IDLE"})(to||(to={}));var u3=x1(k1());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=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"}))};var no=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 Co=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 co=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 mo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 wo=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.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 go=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M19 3L23 8H20V20H18V8H15L19 3ZM14 18V20H3V18H14ZM14 11V13H3V11H14ZM12 4V6H3V4H12Z"}))},Ho=r=>{var s=r,{color:e="currentColor",size:t=24,className:i}=s,l=s0(s,["color","size","className"]);return w0.default.createElement("svg",T(y({viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e},l),{className:"remixicon "+(i||"")}),w0.default.createElement("path",{d:"M20 4V16H23L19 21L15 16H18V4H20ZM12 18V20H3V18H12ZM14 11V13H3V11H14ZM14 4V6H3V4H14Z"}))};var Lo=x1(k1());function J9(i){var l=i,{children:e}=l,t=s0(l,["children"]);return Lo.default.createElement("div",T(y({},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 q0.default.createElement("div",y({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),q0.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&&q0.default.createElement(q0.default.Fragment,null,q0.default.createElement(J9,{onClick:()=>l("asc")},q0.default.createElement(go,{size:14}),q0.default.createElement("span",null,"Sort: ascending")),q0.default.createElement(J9,{onClick:()=>l("desc")},q0.default.createElement(Ho,{size:14}),q0.default.createElement("span",null,"Sort: descending")),q0.default.createElement(J9,{onClick:()=>l("none")},q0.default.createElement(oo,{size:14}),q0.default.createElement("span",null,"Sort: none"))))}var b4=x1(k1());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(Co,{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(co,{size:16})))}var J0=x1(k1());function v6({limit:e,totalRows:t,onChange:i}){return J0.default.createElement("div",null,J0.default.createElement("form",null,J0.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),J0.default.createElement("div",{class:"relative inline-block"},J0.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))},J0.default.createElement("option",{value:"10"},"10"),J0.default.createElement("option",{value:"20"},"20"),J0.default.createElement("option",{value:"50"},"50"),J0.default.createElement("option",{value:"100"},"100"),t?J0.default.createElement("option",{value:t},"All"):null),J0.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},J0.default.createElement(no,{size:16})))))}var v3=x1(k1());var Vo=x1(k1());function R5(i){var l=i,{children:e}=l,t=s0(l,["children"]);return Vo.default.createElement("button",T(y({},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(R5,{"aria-label":"search",onClick:e},v3.default.createElement(wo,{size:16})))}var M6=x1(k1());function x6({onRefetch:e}){return M6.default.createElement(R5,{"aria-label":"refresh",onClick:e},M6.default.createElement(ho,null))}var F4=x1(k1());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(R5,{onClick:l=>i.current.click()},F4.default.createElement("div",{className:"relative"},F4.default.createElement(mo,{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 wV={arrowUp:({fgColor:e,bgColor:t})=>` `,arrowDown:({fgColor:e,bgColor:t})=>` @@ -195,7 +195,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">
`},QL={text:a5.HeaderString,number:a5.HeaderNumber,uri:a5.HeaderUri,date:a5.HeaderDate,list:a5.HeaderArray,struct:"curlyBraces"},JL={text:c1.Text,number:c1.Number,uri:c1.Uri,date:c1.Text,list:c1.Text,struct:c1.Text},io={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 lo({ctx:e,data:t}){var f1,b1,z2;let i=[],l=[],r=n1=>n1.map(l1=>{let M1=l1.summary,Z1=l1.label,R2=l1.key;return l.push({[Z1]:250}),M1&&i.push(M1.keys.length),{title:Z1,id:R2,type:l1.type,icon:QL[l1.type]||a5.HeaderString,hasMenu:l1.type!=="list",summary:M1}}),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"),h=t.features.includes("relocate"),g=o?(f1=t.export)==null?void 0:f1.formats:null,m=o&&g,w={rows:x2.empty(),columns:x2.empty()},[L,v]=(0,i1.useState)(t.content),[V,u]=(0,i1.useState)(!1),[d,p]=(0,i1.useState)(s),[Z,R]=(0,i1.useState)(l),[x,N]=(0,i1.useState)(null),[E,S]=(0,i1.useState)(!1),[k,b]=(0,i1.useState)(w),[D,B]=(0,i1.useState)(0),[_,K]=(0,i1.useState)(null),Q=L.total_rows,m1=n&&Q>0,g1=t.features.includes("pagination")&&(Q===null||Q>0),w1=L.limit===Q,G=44,s1=C&&m1?Math.max(...i):0,o1=G+s1*22,R1=c?140:70,J=440+o1,p1=Q&&Q<(c?3:2)&&x?R1+o1:null,e2=Q>=10&&w1?J:p1,H1=(L.page-1)*L.limit+1,W1=C?150:50,E2=t.content.columns.length===1?800:350,Z2=L.page_length,u2=(0,i1.useCallback)((n1,V1)=>{let{ctx:l1,theme:M1,rect:Z1,column:R2,menuBounds:Q2,isHovered:e0,isSelected:t0,spriteManager:c0}=n1;if(R2.sourceIndex===0)return!0;if(!m1)return!1;l1.rect(Z1.x,Z1.y,Z1.width,Z1.height);let Y2=10,J2=19,k0=t0?M1.textHeaderSelected:M1.textHeader,C2=t0?M1.accentLight:M1.textDark,m2=R2.hasMenu===!0&&e0,L2=L.columns[R2.sourceIndex-1].summary,A2=!!L2,y2=35,F2=Z1.width-y2,Z0=Z1.width-y2*.7,o4=F2/Z1.width,T0=Z0/Z1.width,m0=l1.createLinearGradient(Z1.x,0,Z1.x+Z1.width,0),B1=z0(k0,0),S2=x0(l1,`${M1.headerFontStyle} ${M1.fontFamily}`);if(m0.addColorStop(0,k0),m0.addColorStop(o4,k0),m0.addColorStop(T0,B1),m0.addColorStop(1,B1),l1.fillStyle=m2?m0:k0,R2.icon){let X1=t0?"selected":R2.style==="highlight"?"special":"normal",N2=M1.headerIconSize;c0.drawSprite(R2.icon,X1,l1,Z1.x+Y2,Z1.y+Y2,N2,M1),R2.overlayIcon&&c0.drawSprite(R2.overlayIcon,t0?"selected":"special",l1,Z1.x+Y2+J2/2,Z1.y+Y2+J2/2,J2,M1)}if(l1.fillText(R2.title,Q2.x-Z1.width+M1.headerIconSize*2.5+14,A2?Z1.y+Y2+M1.headerIconSize/2+S2:Q2.y+Q2.height/2+S2),A2){let X1=Object.fromEntries(L2.keys.map((P0,q0)=>[P0,L2.values[q0]])),N2=13,j1=N2+Y2,Q0=`${N2}px ${M1.fontFamily}`,v4=`bold ${Q0}`;l1.fillStyle=C2,Object.entries(X1).forEach(([P0,q0],z4)=>{l1.font=v4,l1.fillText(`${P0}:`,Z1.x+j1/2,Z1.y+j1*(z4+1)+j1),l1.font=Q0,l1.fillText(q0,Z1.x+l1.measureText(P0).width+j1,Z1.y+j1*(z4+1)+j1)})}if(m2){l1.fillStyle=m0;let X1=Q2.x+Q2.width/2-Y2*1.5,N2=M1.headerIconSize/2-2,j1=new Path2D("M12 16l-6-6h12z");l1.translate(X1,N2),l1.fill(j1)}},[L]),y1=(0,i1.useCallback)(([n1,V1])=>{let l1=JL[L.columns[n1].type]||c1.Text,Z1=L.data_orientation==="columns"?L.data[n1][V1]:L.data[V1][n1];return{kind:l1,data:Z1,displayData:Z1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),t2=()=>{u(!V)},w2=n1=>{let V1=n1!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:V1,direction:n1!=null?n1:"asc"}),N(null)},i2=()=>{e.pushEvent("show_page",{page:L.page-1}),b(P(y({},w),{columns:k.columns}))},a1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(P(y({},w),{columns:k.columns}))},T1=()=>{let n1=P(y({},w),{columns:x2.fromSingleSelection(x.column)});b(n1),N(null)},{layerProps:l2,renderLayer:q1}=to({isOpen:E,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var n1,V1,l1,M1,Z1,R2,Q2,e0;return{left:(n1=x==null?void 0:x.bounds.x)!=null?n1:0,top:(V1=x==null?void 0:x.bounds.y)!=null?V1:0,width:(l1=x==null?void 0:x.bounds.width)!=null?l1:0,height:(M1=x==null?void 0:x.bounds.height)!=null?M1:0,right:((Z1=x==null?void 0:x.bounds.x)!=null?Z1:0)+((R2=x==null?void 0:x.bounds.width)!=null?R2:0),bottom:((Q2=x==null?void 0:x.bounds.y)!=null?Q2:0)+((e0=x==null?void 0:x.bounds.height)!=null?e0:0)}}}}),S1=(0,i1.useCallback)((n1,V1)=>{R(l1=>P(y({},l1),{[n1.title]:V1}))},[]),$1=(0,i1.useCallback)((n1,V1)=>{e.pushEvent("relocate",{from_index:n1,to_index:V1}),N(null),b(w)},[]),U1=(0,i1.useCallback)((n1,V1)=>{let{summary:l1,id:M1,type:Z1}=d[n1];l1||N({column:n1,bounds:V1,columnKey:M1,columnType:Z1})},[d]),H2=(0,i1.useCallback)((n1,{bounds:V1})=>{let{id:l1,type:M1}=d[n1];N({column:n1,bounds:V1,columnKey:l1,columnType:M1})},[d]),t1=(0,i1.useCallback)(n1=>{let[V1,l1]=n1.location;l1===-1&&V1===-1&&n1.kind==="header"?K([...Array.from({length:Z2},(M1,Z1)=>Z1)]):V1===-1&&n1.kind==="cell"?K([l1]):K(null)},[Z2]),L1=(0,i1.useCallback)(n1=>_!=null&&_.includes(n1)?{bgCell:io.bgHeaderHovered}:null,[_]);return(0,i1.useEffect)(()=>{var n1;((n1=k.rows)==null?void 0:n1.items.length)>0?B(1):B(0)},[k]),(0,i1.useEffect)(()=>{e.handleEvent("update_content",n1=>{let V1=r(n1.columns);p(V1),v(n1)}),e.handleEvent("download_content",([n1,V1])=>{let l1=new Blob([V1],{type:n1.type}),M1=document.createElement("a");M1.href=window.URL.createObjectURL(l1),M1.download=`${n1.filename}-${+new Date}${n1.format}`,M1.click()})},[]),(0,i1.useEffect)(()=>{var l1;let n1=((l1=L.order)==null?void 0:l1.direction)==="asc"?"arrowUp":"arrowDown",V1=d.map(M1=>{var Z1;return P(y({},M1),{overlayIcon:M1.id===((Z1=L.order)==null?void 0:Z1.key)?n1:null})});p(V1)},[(b1=L.order)==null?void 0:b1.direction,(z2=L.order)==null?void 0:z2.key]),(0,i1.useEffect)(()=>{let n1=d.map(V1=>P(y({},V1),{width:Z[V1.title]}));p(n1)},[Z]),(0,i1.useEffect)(()=>{let n1=x==null?void 0:x.columnKey,V1={bgHeader:"#F0F5F9"},l1=d.map(M1=>P(y({},M1),{themeOverride:M1.id===n1?V1:null}));p(l1),S(!!x)},[x]),i1.default.createElement("div",{className:"p-3 font-sans"},i1.default.createElement("div",{className:"mb-6 flex items-center gap-3"},i1.default.createElement("div",{className:"flex items-baseline"},i1.default.createElement("h2",{className:"text-md font-semibold leading-none text-gray-800"},t.name),i1.default.createElement("span",{className:"ml-2.5 text-xs leading-none"},Q||"?"," ",Q===1?"entry":"entries"),Qe.pushEvent("download",{format:n1})}),i1.default.createElement("div",{className:"grow"}),a&&i1.default.createElement(tV,{onRefetch:()=>e.pushEvent("refetch")}),i1.default.createElement(iV,{toggleSearch:t2}),i1.default.createElement(lV,{limit:L.limit,totalRows:Q,onChange:n1=>e.pushEvent("limit",{limit:n1})}),g1&&i1.default.createElement(rV,{page:L.page,maxPage:L.max_page,onPrev:i2,onNext:a1,rows:Z2})),n&&i1.default.createElement(l6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:io,getCellContent:y1,columns:d,rows:Z2,width:"100%",height:e2,rowHeight:44,headerHeight:o1,drawHeader:u2,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:U1,onHeaderClicked:H2,showSearch:V,getCellsForSelection:!0,onSearchClose:t2,headerIcons:YL,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:S1,columnSelect:"none",gridSelection:k,onGridSelectionChange:n1=>b(n1),rowMarkerStartIndex:H1,minColumnWidth:W1,maxColumnAutoWidth:E2,fillHandle:!0,onItemHovered:t1,getRowThemeOverride:L1,onColumnMoved:h?$1:void 0}),E&&q1(i1.default.createElement(sV,{layerProps:l2,menu:x,orderBy:w2,selectAllCurrent:T1,hasSorting:c})),!n&&i1.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),i1.default.createElement("div",{id:"portal"}))}function eV({supportedFormats:e,onDownload:t}){let i=(0,i1.useRef)();return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Export to"},i1.default.createElement(c6,{onClick:l=>i.current.click()},i1.default.createElement("div",{className:"relative"},i1.default.createElement(Sa,{size:18}),i1.default.createElement("select",{className:"absolute inset-0 cursor-pointer opacity-0",ref:i,value:"",onChange:l=>t(l.target.value)},i1.default.createElement("option",{disabled:!0,value:""},"Export to"),e.map(l=>i1.default.createElement("option",{key:l},l))))))}function tV({onRefetch:e}){return i1.default.createElement(c6,{"aria-label":"refresh",onClick:e},i1.default.createElement(ka,null))}function iV({toggleSearch:e}){return i1.default.createElement("span",{className:"tooltip right","data-tooltip":"Current page search"},i1.default.createElement(c6,{"aria-label":"search",onClick:e},i1.default.createElement(Ta,{size:16})))}function c6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("button",P(y({},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 lV({limit:e,totalRows:t,onChange:i}){return i1.default.createElement("div",null,i1.default.createElement("form",null,i1.default.createElement("label",{className:"p-1 text-xs font-medium text-gray-500"},"Show"),i1.default.createElement("div",{class:"relative inline-block"},i1.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))},i1.default.createElement("option",{value:"10"},"10"),i1.default.createElement("option",{value:"20"},"20"),i1.default.createElement("option",{value:"50"},"50"),i1.default.createElement("option",{value:"100"},"100"),t?i1.default.createElement("option",{value:t},"All"):null),i1.default.createElement("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-500"},i1.default.createElement(ya,{size:16})))))}function rV({page:e,maxPage:t,onPrev:i,onNext:l,rows:r}){return i1.default.createElement("div",{className:"flex gap-3"},i1.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},i1.default.createElement(ba,{size:16}),i1.default.createElement("span",null,"Prev")),i1.default.createElement("div",{className:"rounded-lg border border-gray-400 px-2 py-1 text-xs font-semibold text-gray-500"},i1.default.createElement("span",null,e," of ",t||"?")),i1.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},i1.default.createElement("span",null,"Next"),i1.default.createElement(Fa,{size:16})))}function sV({layerProps:e,selectAllCurrent:t,hasSorting:i,orderBy:l}){return i1.default.createElement("div",y({className:"flex w-48 flex-col rounded-b-md border border-gray-200 bg-white p-2 font-sans shadow-lg"},e),i1.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&&i1.default.createElement(i1.default.Fragment,null,i1.default.createElement(C6,{onClick:()=>l("asc")},i1.default.createElement(Pa,{size:14}),i1.default.createElement("span",null,"Sort: ascending")),i1.default.createElement(C6,{onClick:()=>l("desc")},i1.default.createElement(Da,{size:14}),i1.default.createElement("span",null,"Sort: descending")),i1.default.createElement(C6,{onClick:()=>l("none")},i1.default.createElement(za,{size:14}),i1.default.createElement("span",null,"Sort: none"))))}function C6(i){var l=i,{children:e}=l,t=o0(l,["children"]);return i1.default.createElement("div",P(y({},t),{className:"flex cursor-pointer items-center justify-start gap-1 p-1 text-sm text-gray-700 hover:bg-gray-100"}),e)}function MZ(e,t){e.importCSS("main.css"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,so.createRoot)(e.root).render(ro.default.createElement(lo,{ctx:e,data:t}))}export{MZ as init}; + 14.3Z">
`},gV={text:c5.HeaderString,number:c5.HeaderNumber,uri:c5.HeaderUri,date:c5.HeaderDate,list:c5.HeaderArray,struct:"curlyBraces"},HV={text:C1.Text,number:C1.Number,uri:C1.Uri,date:C1.Text,list:C1.Text,struct:C1.Text},uo={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 vo({ctx:e,data:t}){var f1,b1,z2;let i=[],l=[],r=o1=>o1.map(i1=>{let p1=i1.summary,Z1=i1.label,R2=i1.key;return l.push({[Z1]:250}),p1&&i.push(p1.keys.length),{title:Z1,id:R2,type:i1.type,icon:gV[i1.type]||c5.HeaderString,hasMenu:i1.type!=="list",summary:p1}}),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"),h=t.features.includes("relocate"),g=o?(f1=t.export)==null?void 0:f1.formats:null,m=o&&g,w={rows:x2.empty(),columns:x2.empty()},[L,v]=(0,h2.useState)(t.content),[V,u]=(0,h2.useState)(!1),[d,p]=(0,h2.useState)(s),[Z,R]=(0,h2.useState)(l),[x,N]=(0,h2.useState)(null),[E,S]=(0,h2.useState)(!1),[k,b]=(0,h2.useState)(w),[D,B]=(0,h2.useState)(0),[_,K]=(0,h2.useState)(null),J=L.total_rows,c1=n&&J>0,w1=t.features.includes("pagination")&&(J===null||J>0),h1=L.limit===J,G=44,r1=C&&c1?Math.max(...i):0,a1=G+r1*22,R1=c?140:70,Q=440+a1,v1=J&&J<(c?3:2)&&x?R1+a1:null,J1=J>=10&&h1?Q:v1,g1=(L.page-1)*L.limit+1,W1=C?150:50,E2=t.content.columns.length===1?800:350,Z2=L.page_length,u2=(0,h2.useCallback)((o1,L1)=>{let{ctx:i1,theme:p1,rect:Z1,column:R2,menuBounds:Q2,isHovered:e0,isSelected:t0,spriteManager:c0}=o1;if(R2.sourceIndex===0)return!0;if(!c1)return!1;i1.rect(Z1.x,Z1.y,Z1.width,Z1.height);let Y2=10,J2=19,k0=t0?p1.textHeaderSelected:p1.textHeader,n2=t0?p1.accentLight:p1.textDark,c2=R2.hasMenu===!0&&e0,L2=L.columns[R2.sourceIndex-1].summary,A2=!!L2,y2=35,F2=Z1.width-y2,Z0=Z1.width-y2*.7,C4=F2/Z1.width,T0=Z0/Z1.width,m0=i1.createLinearGradient(Z1.x,0,Z1.x+Z1.width,0),B1=z0(k0,0),S2=x0(i1,`${p1.headerFontStyle} ${p1.fontFamily}`);if(m0.addColorStop(0,k0),m0.addColorStop(C4,k0),m0.addColorStop(T0,B1),m0.addColorStop(1,B1),i1.fillStyle=c2?m0:k0,R2.icon){let X1=t0?"selected":R2.style==="highlight"?"special":"normal",N2=p1.headerIconSize;c0.drawSprite(R2.icon,X1,i1,Z1.x+Y2,Z1.y+Y2,N2,p1),R2.overlayIcon&&c0.drawSprite(R2.overlayIcon,t0?"selected":"special",i1,Z1.x+Y2+J2/2,Z1.y+Y2+J2/2,J2,p1)}if(i1.fillText(R2.title,Q2.x-Z1.width+p1.headerIconSize*2.5+14,A2?Z1.y+Y2+p1.headerIconSize/2+S2:Q2.y+Q2.height/2+S2),A2){let X1=Object.fromEntries(L2.keys.map((P0,$0)=>[P0,L2.values[$0]])),N2=13,j1=N2+Y2,e4=`${N2}px ${p1.fontFamily}`,M4=`bold ${e4}`;i1.fillStyle=n2,Object.entries(X1).forEach(([P0,$0],S4)=>{i1.font=M4,i1.fillText(`${P0}:`,Z1.x+j1/2,Z1.y+j1*(S4+1)+j1),i1.font=e4,i1.fillText($0,Z1.x+i1.measureText(P0).width+j1,Z1.y+j1*(S4+1)+j1)})}if(c2){i1.fillStyle=m0;let X1=Q2.x+Q2.width/2-Y2*1.5,N2=p1.headerIconSize/2-2,j1=new Path2D("M12 16l-6-6h12z");i1.translate(X1,N2),i1.fill(j1)}},[L]),y1=(0,h2.useCallback)(([o1,L1])=>{let i1=HV[L.columns[o1].type]||C1.Text,Z1=L.data_orientation==="columns"?L.data[o1][L1]:L.data[L1][o1];return{kind:i1,data:Z1,displayData:Z1,allowOverlay:!0,allowWrapping:!1,readonly:!0}},[L]),e2=()=>{u(!V)},w2=o1=>{let L1=o1!=="none"?x.columnKey:null;e.pushEvent("order_by",{key:L1,direction:o1!=null?o1:"asc"}),N(null)},t2=()=>{e.pushEvent("show_page",{page:L.page-1}),b(T(y({},w),{columns:k.columns}))},s1=()=>{e.pushEvent("show_page",{page:L.page+1}),b(T(y({},w),{columns:k.columns}))},T1=()=>{let o1=T(y({},w),{columns:x2.fromSingleSelection(x.column)});b(o1),N(null)},{layerProps:i2,renderLayer:q1}=ao({isOpen:E,auto:!0,placement:"bottom-end",possiblePlacements:["bottom-end","bottom-center","bottom-start"],triggerOffset:0,onOutsideClick:()=>N(null),trigger:{getBounds:()=>{var o1,L1,i1,p1,Z1,R2,Q2,e0;return{left:(o1=x==null?void 0:x.bounds.x)!=null?o1:0,top:(L1=x==null?void 0:x.bounds.y)!=null?L1:0,width:(i1=x==null?void 0:x.bounds.width)!=null?i1:0,height:(p1=x==null?void 0:x.bounds.height)!=null?p1:0,right:((Z1=x==null?void 0:x.bounds.x)!=null?Z1:0)+((R2=x==null?void 0:x.bounds.width)!=null?R2:0),bottom:((Q2=x==null?void 0:x.bounds.y)!=null?Q2:0)+((e0=x==null?void 0:x.bounds.height)!=null?e0:0)}}}}),F1=(0,h2.useCallback)((o1,L1)=>{R(i1=>T(y({},i1),{[o1.title]:L1}))},[]),$1=(0,h2.useCallback)((o1,L1)=>{e.pushEvent("relocate",{from_index:o1,to_index:L1}),N(null),b(w)},[]),U1=(0,h2.useCallback)((o1,L1)=>{let{summary:i1,id:p1,type:Z1}=d[o1];i1||N({column:o1,bounds:L1,columnKey:p1,columnType:Z1})},[d]),H2=(0,h2.useCallback)((o1,{bounds:L1})=>{let{id:i1,type:p1}=d[o1];N({column:o1,bounds:L1,columnKey:i1,columnType:p1})},[d]),t1=(0,h2.useCallback)(o1=>{let[L1,i1]=o1.location;i1===-1&&L1===-1&&o1.kind==="header"?K([...Array.from({length:Z2},(p1,Z1)=>Z1)]):L1===-1&&o1.kind==="cell"?K([i1]):K(null)},[Z2]),H1=(0,h2.useCallback)(o1=>_!=null&&_.includes(o1)?{bgCell:uo.bgHeaderHovered}:null,[_]);return(0,h2.useEffect)(()=>{var o1;((o1=k.rows)==null?void 0:o1.items.length)>0?B(1):B(0)},[k]),(0,h2.useEffect)(()=>{e.handleEvent("update_content",o1=>{let L1=r(o1.columns);p(L1),v(o1)}),e.handleEvent("download_content",([o1,L1])=>{let i1=new Blob([L1],{type:o1.type}),p1=document.createElement("a");p1.href=window.URL.createObjectURL(i1),p1.download=`${o1.filename}-${+new Date}${o1.format}`,p1.click()})},[]),(0,h2.useEffect)(()=>{var i1;let o1=((i1=L.order)==null?void 0:i1.direction)==="asc"?"arrowUp":"arrowDown",L1=d.map(p1=>{var Z1;return T(y({},p1),{overlayIcon:p1.id===((Z1=L.order)==null?void 0:Z1.key)?o1:null})});p(L1)},[(b1=L.order)==null?void 0:b1.direction,(z2=L.order)==null?void 0:z2.key]),(0,h2.useEffect)(()=>{let o1=d.map(L1=>T(y({},L1),{width:Z[L1.title]}));p(o1)},[Z]),(0,h2.useEffect)(()=>{let o1=x==null?void 0:x.columnKey,L1={bgHeader:"#F0F5F9"},i1=d.map(p1=>T(y({},p1),{themeOverride:p1.id===o1?L1:null}));p(i1),S(!!x)},[x]),h2.default.createElement("div",{className:"p-3 font-sans"},h2.default.createElement("div",{className:"mb-6 flex items-center gap-3"},h2.default.createElement(V6,{data:t,totalRows:J}),m&&h2.default.createElement(f6,{supportedFormats:g,onDownload:o1=>e.pushEvent("download",{format:o1})}),h2.default.createElement("div",{className:"grow"}),a&&h2.default.createElement(x6,{onRefetch:()=>e.pushEvent("refetch")}),h2.default.createElement(p6,{toggleSearch:e2}),h2.default.createElement(v6,{limit:L.limit,totalRows:J,onChange:o1=>e.pushEvent("limit",{limit:o1})}),w1&&h2.default.createElement(u6,{page:L.page,maxPage:L.max_page,onPrev:t2,onNext:s1,rows:Z2})),n&&h2.default.createElement(m6,{className:"max-w-full rounded-lg shadow-[0_2px_10px_rgb(0,0,0,0.15)]",theme:uo,getCellContent:y1,columns:d,rows:Z2,width:"100%",height:J1,rowHeight:44,headerHeight:a1,drawHeader:u2,verticalBorder:!1,rowMarkers:"clickable-number",rowMarkerWidth:32,onHeaderMenuClick:U1,onHeaderClicked:H2,showSearch:V,getCellsForSelection:!0,onSearchClose:e2,headerIcons:wV,overscrollX:100,isDraggable:!1,smoothScrollX:!0,smoothScrollY:!0,onColumnResize:F1,columnSelect:"none",gridSelection:k,onGridSelectionChange:o1=>b(o1),rowMarkerStartIndex:g1,minColumnWidth:W1,maxColumnAutoWidth:E2,fillHandle:!0,onItemHovered:t1,getRowThemeOverride:H1,onColumnMoved:h?$1:void 0}),E&&q1(h2.default.createElement(d6,{layerProps:i2,menu:x,orderBy:w2,selectAllCurrent:T1,hasSorting:c})),!n&&h2.default.createElement("p",{className:"text-sm text-gray-700"},"No data"),h2.default.createElement("div",{id:"portal"}))}function aE(e,t){e.importCSS("main.css"),e.importCSS("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap"),e.importCSS("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"),(0,Mo.createRoot)(e.root).render(po.default.createElement(vo,{ctx:e,data:t}))}export{aE as init}; /*! Bundled license information: classnames/index.js: