streamlit-nightly 1.42.1.dev20250209__py2.py3-none-any.whl → 1.42.1.dev20250211__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/config.py +9 -0
- streamlit/proto/NewSession_pb2.py +16 -16
- streamlit/proto/NewSession_pb2.pyi +12 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.D9415avj.js → FileDownload.esm.Cynb6pHv.js} +1 -1
- streamlit/static/static/js/{FileDropzone.Cd515bsy.js → FileDropzone.CVp7XX9M.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.BBpErIGP.js → FormClearHelper.0-LU4kzK.js} +1 -1
- streamlit/static/static/js/{Hooks.CeSTXIj2.js → Hooks.CO99RwN4.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BU5Td5cJ.js → InputInstructions.BM7jV9sg.js} +1 -1
- streamlit/static/static/js/{ProgressBar.J2QhvKtD.js → ProgressBar.B-igBN-q.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.BbbrvJaa.js → RenderInPortalIfExists.BbrAiS4q.js} +1 -1
- streamlit/static/static/js/{Toolbar.D-hUr0RX.js → Toolbar.B4UnlLJR.js} +1 -1
- streamlit/static/static/js/{base-input.CNkkCv4B.js → base-input.BdySl3Wo.js} +4 -4
- streamlit/static/static/js/{createSuper.DHhKMTIx.js → createSuper.CT9j4pwt.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.CRylpesE.js → data-grid-overlay-editor.CTNOILgF.js} +1 -1
- streamlit/static/static/js/{downloader.D_08g5mI.js → downloader.BI10Ut1s.js} +1 -1
- streamlit/static/static/js/{es6.B-Rq6ajt.js → es6.D57lNoID.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CFL3MAVr.js → iframeResizer.contentWindow.Dp7tzCKc.js} +1 -1
- streamlit/static/static/js/{index.BlcNB-sY.js → index.2ZU4u6uf.js} +1 -1
- streamlit/static/static/js/{index.D9M0iUu5.js → index.6gMd28--.js} +1 -1
- streamlit/static/static/js/index.BIbTzsBv.js +1 -0
- streamlit/static/static/js/index.BJr-0rbs.js +1 -0
- streamlit/static/static/js/index.B_RT9XEh.js +1 -0
- streamlit/static/static/js/index.Bd1tyA5C.js +1 -0
- streamlit/static/static/js/{index.DwWMkgFE.js → index.BsGCnWXN.js} +1 -1
- streamlit/static/static/js/index.Bv9SpIsp.js +1 -0
- streamlit/static/static/js/index.BvzG4uRR.js +2 -0
- streamlit/static/static/js/index.CMeUNbsd.js +1 -0
- streamlit/static/static/js/{index.BCYuLMdi.js → index.CNzGrsa-.js} +3 -3
- streamlit/static/static/js/index.CQdVmKGZ.js +1 -0
- streamlit/static/static/js/index.CQe0cVuu.js +1 -0
- streamlit/static/static/js/{index.BqePTNWb.js → index.CQy70Tuh.js} +2 -2
- streamlit/static/static/js/index.Ce593GKt.js +1 -0
- streamlit/static/static/js/{index.BVbWPXFU.js → index.CuMSXAh1.js} +1 -1
- streamlit/static/static/js/index.Cv4f0quN.js +1 -0
- streamlit/static/static/js/index.CxuOpTfE.js +1 -0
- streamlit/static/static/js/{index.CEWcZMdD.js → index.D-W0WnPg.js} +2 -2
- streamlit/static/static/js/{index.C-_AHUSz.js → index.D6cby_GK.js} +2 -2
- streamlit/static/static/js/{index.D94jjl7_.js → index.D7RSv6ey.js} +61 -61
- streamlit/static/static/js/{index.B9q8XlSH.js → index.DG8N1agE.js} +2 -2
- streamlit/static/static/js/{index.CMcCB4vg.js → index.DHeMuZWt.js} +15 -15
- streamlit/static/static/js/{index.BevO9CYu.js → index.DHlZQRJ2.js} +2 -2
- streamlit/static/static/js/{index.9wBA4A4f.js → index.DIuYZOo1.js} +19 -19
- streamlit/static/static/js/index.DKChIiWS.js +1 -0
- streamlit/static/static/js/{index.Bw9RDCaH.js → index.DVQA7678.js} +1 -1
- streamlit/static/static/js/{index.CuNiy4LB.js → index.DVZLDFTf.js} +1 -1
- streamlit/static/static/js/{index.B0xfT3p4.js → index.DWawEgfs.js} +2 -2
- streamlit/static/static/js/index.Do-aY-b0.js +1 -0
- streamlit/static/static/js/{index.zzxJWhBg.js → index.E-uCquNT.js} +1 -1
- streamlit/static/static/js/{index.JSS70wsq.js → index.EY84KFkO.js} +2 -2
- streamlit/static/static/js/{index.DYHaq5Cw.js → index.MyWIyUAB.js} +13 -13
- streamlit/static/static/js/{index.B2evntzQ.js → index.NyidZo79.js} +1 -1
- streamlit/static/static/js/index.SZrBXA0x.js +1 -0
- streamlit/static/static/js/index.fiZSFOKl.js +1 -0
- streamlit/static/static/js/{index.-SmXSkUY.js → index.i3_Oogic.js} +1 -1
- streamlit/static/static/js/{input.Dbc83Str.js → input.BLlUQSRv.js} +2 -2
- streamlit/static/static/js/{memory.BzHgTb9i.js → memory.D5yzKxGm.js} +1 -1
- streamlit/static/static/js/{mergeWith.BCa1_PWb.js → mergeWith.BSbf2-C9.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CtUWknLp.js → number-overlay-editor.DSD8puEB.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DGVrr2j8.js → possibleConstructorReturn.BazPwu8U.js} +1 -1
- streamlit/static/static/js/{sandbox.C20zasAf.js → sandbox.EiD3ZISo.js} +1 -1
- streamlit/static/static/js/{textarea.BeRVLTOp.js → textarea.Dpen_LA2.js} +2 -2
- streamlit/static/static/js/{timepicker.DyU-jgSC.js → timepicker.Bcj6rh3c.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.D4FxxWIg.js → toConsumableArray.l-Pgl8gO.js} +1 -1
- streamlit/static/static/js/{uniqueId.CAAlIP1-.js → uniqueId.D9pvJLzq.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.C207Y3_O.js → useBasicWidgetState.BWe8Pksb.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CsqRc0X0.js → useOnInputChange.CcKPFKqO.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.DwHjQb3H.js → withFullScreenWrapper.DG7rb1Mv.js} +1 -1
- {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/RECORD +74 -74
- streamlit/static/static/js/index.B-4MHYvl.js +0 -1
- streamlit/static/static/js/index.BA5ubsQA.js +0 -1
- streamlit/static/static/js/index.BNrZwkh1.js +0 -1
- streamlit/static/static/js/index.BpmrfDoR.js +0 -2
- streamlit/static/static/js/index.CEj-S3PF.js +0 -1
- streamlit/static/static/js/index.CFtAnwvU.js +0 -1
- streamlit/static/static/js/index.CQ_wmqnz.js +0 -1
- streamlit/static/static/js/index.CvADzqCD.js +0 -1
- streamlit/static/static/js/index.DPs04g4h.js +0 -1
- streamlit/static/static/js/index.DWIf4xZP.js +0 -1
- streamlit/static/static/js/index.DfCewjMv.js +0 -1
- streamlit/static/static/js/index.DgwklVRJ.js +0 -1
- streamlit/static/static/js/index.Yr32ts47.js +0 -1
- streamlit/static/static/js/index.i2uLxrqv.js +0 -1
- streamlit/static/static/js/index.joQNIDux.js +0 -1
- streamlit/static/static/js/index.pzjWTi64.js +0 -1
- {streamlit_nightly-1.42.1.dev20250209.data → streamlit_nightly-1.42.1.dev20250211.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.1.dev20250209.dist-info → streamlit_nightly-1.42.1.dev20250211.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.
|
2
|
-
var Uf=Object.defineProperty;var Xf=(e,t,n)=>t in e?Uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ft=(e,t,n)=>Xf(e,typeof t!="symbol"?t+"":t,n);import{r as h,E as dc,_ as Je,g as Mi,c as Yf,R as te,i as is,p as Gf,d as Bs,e as jf,f as qf,h as fc,t as hc,l as Kf,m as gc,o as Zf,q as Jf,s as Qf,u as eh,v as th,a as dr,w as Ws,x as Vl,n as fo,y as Da,j as Jt,z as Hr,F as nh,D as Vo,A as mc,B as pc,C as wr,G as vc,H as bc,I as rh,J as ih,K as Qe,L as wc,M as Ms,N as xt,O as Zr,Q as oh,S as Nl,T as yc,U as ah,V as sh,W as lh,X as Rs,Y as Cc,Z as uh,$ as ch,a0 as dh,a1 as fh,a2 as hh,a3 as gh,a4 as mh,a5 as ph,a6 as vh,a7 as bh,a8 as wh,a9 as Sc,aa as yh,ab as Ch,ac as Sh,ad as xh,ae as kh,af as Mh,ag as Rh,ah as Eh,ai as Ih,aj as Th,ak as Dh,al as Oh,am as Us,an as Yn,ao as Ph,ap as qi,aq as _h,k as Lh,ar as Fh,as as Be,b as xc,at as kc,au as Ah,av as Hh,aw as zh,ax as $h,ay as Vh,az as os,aA as Nh,aB as Bh,aC as as,aD as Wh,aE as Uh,aF as Xh,aG as Yh}from"./index.9wBA4A4f.js";import{u as Gh}from"./FormClearHelper.BBpErIGP.js";import{w as jh,u as qh,E as Kh}from"./withFullScreenWrapper.DwHjQb3H.js";import{T as Zh,a as Wi}from"./Toolbar.D-hUr0RX.js";import{m as Jh}from"./mergeWith.BCa1_PWb.js";import{s as Qh}from"./sprintf.C-r3gIuM.js";import{c as eg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Sr,a as Xs,C as tg}from"./toConsumableArray.D4FxxWIg.js";import{_ as ng,a as rg,b as ig}from"./possibleConstructorReturn.DGVrr2j8.js";import{_ as og}from"./createSuper.DHhKMTIx.js";import{D as ag,F as sg}from"./FileDownload.esm.D9415avj.js";var Mc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(dc,Je({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Mc.displayName="Add";var Rc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(dc,Je({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Rc.displayName="Search";function Ec(e="This should not happen"){throw new Error(e)}function An(e,t="Assertion failed"){if(!e)return Ec(t)}function ao(e,t){return Ec(t??"Hell froze over")}function lg(e,t){try{return e()}catch{return t}}const Bl=Object.prototype.hasOwnProperty;function xi(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&xi(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Bl.call(e,n)&&++i&&!Bl.call(t,n)||!(n in t)||!xi(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var ug=Object.prototype,cg=ug.hasOwnProperty;function dg(e,t){return e!=null&&cg.call(e,t)}var fg=dg,hg=fg,gg=Yf;function mg(e,t){return e!=null&&gg(e,t,hg)}var pg=mg;const vg=Mi(pg),ca=null,Ys=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Wl;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Wl||(Wl={}));var da;(function(e){e.Triangle="triangle",e.Dots="dots"})(da||(da={}));function No(e){return"width"in e&&typeof e.width=="number"}async function Ul(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function wi(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Ki(e){if(!vi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function bg(e){return vg(e,"editor")}function Gs(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));function wg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let Xl;const yr=class yr{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new yr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=wg([...this.items,n]);return new yr(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const u=[];s<i&&u.push([s,i]),r<l&&u.push([r,l]),n.splice(o,1,...u)}}return new yr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};ft(yr,"empty",()=>Xl??(Xl=new yr([]))),ft(yr,"fromSingleSelection",t=>yr.empty().add(t));let yt=yr;var yg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Yl=yg,Cg=e=>e.toUpperCase()===e,Sg=e=>t=>e.indexOf(t)===-1,Ic=(e,t)=>{const n={};return Object.keys(e).filter(Sg(t)).forEach(i=>{n[i]=e[i]}),n};function xg(e,t,n){const i=Ic(t,n);if(!e){const r=typeof is=="function"?{default:is}:is;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var kg=(e,t)=>{};function Mg(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Cg(s[0])):n.propsAsIs,c=xg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Yl(n.class,c.className||l):Yl(c.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],y=b[0],w=b[1]||"",S=typeof y=="function"?y(o):y;kg(S,n.name),f[`--${p}`]=`${S}${w}`}const g=c.style||{},m=Object.keys(g);m.length>0&&m.forEach(p=>{f[p]=g[p]}),c.style=f}return e.__linaria&&e!==s?(c.as=s,te.createElement(e,c)):te.createElement(s,c)},r=te.forwardRef?te.forwardRef(i):o=>{const a=Ic(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var pn=Mg;const Rg=pn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Tc={},Oa={},js={},ss={},Gl;function Eg(){return Gl||(Gl=1,function(e){(function(t,n){n(e,h,Gf)})(Bs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(w){return w&&w.__esModule?w:{default:w}}var s=Object.assign||function(w){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(w[C]=M[C])}return w};function l(w,S){var M={};for(var C in w)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(M[C]=w[C]);return M}function u(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function w(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&w(S.prototype,M),C&&w(S,C),S}}();function d(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function f(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var g=!1;function m(w){g=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return g?w:w.capture}function b(w){if("touches"in w){var S=w.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=w.screenX,R=w.screenY;return{x,y:R}}var y=function(w){f(S,w);function S(){var M;u(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,L=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:L},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(ss)),ss}(function(e){(function(t,n){n(e,Eg())})(Bs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(js);var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var _r=Ig(jf);function Ig(e){return e&&e.__esModule?e:{default:e}}function Tg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dg={ROOT:function(t){return(0,_r.default)(Tg({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};ho.default=Dg;var go={},Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.outerWidth=void 0;var Og=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Pa.outerWidth=Og;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var Pg=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=Pg;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.default=void 0;var _g=function(){return window};mo.default=_g;Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var rr=Ag(h),jr=_a(ho),Lg=Pa,jl=_a(Ri),Fg=_a(js),Bo=_a(mo);function _a(e){return e&&e.__esModule?e:{default:e}}function Dc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Dc=function(){return e},e}function Ag(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=Dc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function Es(){return Es=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Es.apply(this,arguments)}function Hg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $g(e,t,n){return t&&zg(e.prototype,t),e}function Vg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Is(e,t)}function Is(e,t){return Is=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Is(e,t)}function Ng(e){var t=Wg();return function(){var i=fa(e),r;if(t){var o=fa(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Bg(this,r)}}function Bg(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:Rn(e)}function Rn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function fa(e){return fa=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fa(e)}function wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ug=function(t){return t.hasOwnProperty("key")},qs=function(e){Vg(n,e);var t=Ng(n);function n(i){var r;return Hg(this,n),r=t.call(this,i),wn(Rn(r),"itemsWrapperRef",void 0),wn(Rn(r),"itemsListRef",void 0),wn(Rn(r),"thumbsRef",void 0),wn(Rn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),wn(Rn(r),"setItemsListRef",function(o){r.itemsListRef=o}),wn(Rn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),wn(Rn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=rr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,Lg.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),u=l<o,c=u?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:u?r.getFirstItem(f.selectedItem):0,lastPosition:c,showArrows:u}})}}),wn(Rn(r),"handleClickItem",function(o,a,s){if(!Ug(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),wn(Rn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),wn(Rn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),wn(Rn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=rr.Children.count(r.props.children),u=-(r.state.firstItem*100)/r.state.visibleItems,c=Math.max(l-r.state.visibleItems,0),d=-c*100/r.state.visibleItems;u===s&&a>0&&(a=0),u===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,g=u+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,jl.default)(g,"%",r.props.axis)}),!0}),wn(Rn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),wn(Rn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),wn(Rn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return $g(n,[{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,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(c){return r.setThumbsRef(c,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return rr.default.createElement("li",Es({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=rr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},u=-this.state.firstItem*(this.state.itemSize||0),c=(0,jl.default)(u,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},rr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},rr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},rr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?rr.default.createElement(Fg.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):rr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(g){return r.setItemsListRef(g)},style:l},this.renderItems()),rr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(rr.Component);go.default=qs;wn(qs,"displayName","Thumbs");wn(qs,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var La={};Object.defineProperty(La,"__esModule",{value:!0});La.default=void 0;var Xg=function(){return document};La.default=Xg;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.setPosition=zn.getPosition=zn.isKeyboardEvent=zn.defaultStatusFormatter=zn.noop=void 0;var Yg=h,Gg=jg(Ri);function jg(e){return e&&e.__esModule?e:{default:e}}var qg=function(){};zn.noop=qg;var Kg=function(t,n){return"".concat(t," of ").concat(n)};zn.defaultStatusFormatter=Kg;var Zg=function(t){return t?t.hasOwnProperty("key"):!1};zn.isKeyboardEvent=Zg;var Jg=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=Yg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};zn.getPosition=Jg;var Qg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,Gg.default)(t,"%",n)}),i};zn.setPosition=Qg;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.fadeAnimationHandler=hr.slideStopSwipingHandler=hr.slideSwipeAnimationHandler=hr.slideAnimationHandler=void 0;var Oc=h,em=tm(Ri),gr=zn;function tm(e){return e&&e.__esModule?e:{default:e}}function ql(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ql(Object(n),!0).forEach(function(i){nm(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ql(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function nm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rm=function(t,n){var i={},r=n.selectedItem,o=r,a=Oc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,gr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,gr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,gr.setPosition)(0,t.axis)),i;var l=(0,gr.getPosition)(r,t),u=(0,em.default)(l,"%",t.axis),c=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:u,msTransform:u,OTransform:u,transform:u},n.swiping||(i.itemListStyle=Qr(Qr({},i.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),i};hr.slideAnimationHandler=rm;var im=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=Oc.Children.count(n.children),l=0,u=(0,gr.getPosition)(i.selectedItem,n),c=n.infiniteLoop?(0,gr.getPosition)(s-1,n)-100:(0,gr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;u===l&&d>0&&(f=0),u===c&&d<0&&(f=0);var g=u+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&g>-100?g-=s*100:i.selectedItem===s-1&&g<-s*100&&(g+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,gr.setPosition)(g,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};hr.slideSwipeAnimationHandler=im;var om=function(t,n){var i=(0,gr.getPosition)(n.selectedItem,t),r=(0,gr.setPosition)(i,t.axis);return{itemListStyle:r}};hr.slideStopSwipingHandler=om;var am=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={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 n.swiping||(o=Qr(Qr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Qr(Qr({},o),{},{opacity:1,position:"relative"}),prevStyle:Qr({},o)}};hr.fadeAnimationHandler=am;Object.defineProperty(Oa,"__esModule",{value:!0});Oa.default=void 0;var Ht=um(h),sm=po(js),Cr=po(ho),lm=po(go),Wo=po(La),Uo=po(mo),Zi=zn,ha=hr;function po(e){return e&&e.__esModule?e:{default:e}}function Pc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Pc=function(){return e},e}function um(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=Pc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function Ts(){return Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ts.apply(this,arguments)}function Kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kl(Object(n),!0).forEach(function(i){gt(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function cm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dm(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fm(e,t,n){return t&&dm(e.prototype,t),e}function hm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ds(e,t)}function Ds(e,t){return Ds=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ds(e,t)}function gm(e){var t=pm();return function(){var i=ga(e),r;if(t){var o=ga(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return mm(this,r)}}function mm(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:vt(e)}function vt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ga(e){return ga=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ga(e)}function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ks=function(e){hm(n,e);var t=gm(n);function n(i){var r;cm(this,n),r=t.call(this,i),gt(vt(r),"thumbsRef",void 0),gt(vt(r),"carouselWrapperRef",void 0),gt(vt(r),"listRef",void 0),gt(vt(r),"itemsRef",void 0),gt(vt(r),"timer",void 0),gt(vt(r),"animationHandler",void 0),gt(vt(r),"setThumbsRef",function(a){r.thumbsRef=a}),gt(vt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),gt(vt(r),"setListRef",function(a){r.listRef=a}),gt(vt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),gt(vt(r),"autoPlay",function(){Ht.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),gt(vt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),gt(vt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),gt(vt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),gt(vt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),gt(vt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,Wo.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,Wo.default)().activeElement)):!1}),gt(vt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",u={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},c=l?u.ArrowRight:u.ArrowDown,d=l?u.ArrowLeft:u.ArrowUp;c===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),gt(vt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),gt(vt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),gt(vt(r),"handleClickItem",function(a,s){if(Ht.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),gt(vt(r),"handleOnChange",function(a,s){Ht.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),gt(vt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),gt(vt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),gt(vt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),gt(vt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(vt(r)));return r.setState(ir({},l)),!!Object.keys(l).length}),gt(vt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),gt(vt(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))}),gt(vt(r),"moveTo",function(a){if(typeof a=="number"){var s=Ht.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),gt(vt(r),"onClickNext",function(){r.increment(1)}),gt(vt(r),"onClickPrev",function(){r.decrement(1)}),gt(vt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),gt(vt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),gt(vt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),gt(vt(r),"selectItem",function(a){r.setState(ir({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,Ht.Children.toArray(r.props.children)[a.selectedItem])}),gt(vt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),gt(vt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var u=l[0];if(!u.complete){var c=function g(){r.forceUpdate(),u.removeEventListener("load",g)};u.addEventListener("load",c)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ha.fadeAnimationHandler||ha.slideAnimationHandler,r.state=ir(ir({},o),r.animationHandler(i,o)),r}return fm(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(ir({},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&&Ht.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.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,Uo.default)().addEventListener("resize",this.updateSizes),(0,Uo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Wo.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Uo.default)().removeEventListener("resize",this.updateSizes),(0,Uo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Wo.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 o=this;return this.props.children?Ht.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,u=s===o.state.previousItem,c=l&&o.state.selectedStyle||u&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=ir(ir({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=ir(ir({},c),{},{pointerEvents:"none"}));var d={ref:function(g){return o.setItemsRef(g,s)},key:"itemKey"+s+(r?"clone":""),className:Cr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:c};return Ht.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,u=o.children;return a?Ht.default.createElement("ul",{className:"control-dots"},Ht.Children.map(u,function(c,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?Ht.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,Ht.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||Ht.Children.count(this.props.children)===0?null:Ht.default.createElement(lm.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||Ht.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&Ht.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&Ht.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,u=s&&(this.state.selectedItem<Ht.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),d=c.shift(),f=c.pop(),g={className:Cr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(g.onSwipeLeft=this.onSwipeForward,g.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else g.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,g.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,g.style=ir(ir({},g.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return Ht.default.createElement("div",{"aria-label":this.props.ariaLabel,className:Cr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},Ht.default.createElement("div",{className:Cr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),Ht.default.createElement("div",{className:Cr.default.WRAPPER(!0,this.props.axis),style:m},o?Ht.default.createElement(sm.default,Ts({tagName:"ul",innerRef:this.setListRef},g,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):Ht.default.createElement("ul",{className:Cr.default.SLIDER(!0,this.state.swiping),ref:function(y){return r.setListRef(y)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,u,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(Ht.default.Component);Oa.default=Ks;gt(Ks,"displayName","Carousel");gt(Ks,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return Ht.default.createElement("button",{type:"button","aria-label":i,className:Cr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return Ht.default.createElement("button",{type:"button","aria-label":i,className:Cr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return Ht.default.createElement("li",{className:Cr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=Ht.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=Ht.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ha.slideSwipeAnimationHandler,stopSwipingHandler:ha.slideStopSwipingHandler});var vm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Oa),n=vm,i=r(go);function r(o){return o&&o.__esModule?o:{default:o}}})(Tc);var bm=qf,wm=function(){return bm.Date.now()},ym=wm,Cm=fc,ls=ym,Zl=hc,Sm="Expected a function",xm=Math.max,km=Math.min;function Mm(e,t,n){var i,r,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(Sm);t=Zl(t)||0,Cm(n)&&(c=!!n.leading,d="maxWait"in n,o=d?xm(Zl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function g(x){var R=i,I=r;return i=r=void 0,u=x,a=e.apply(I,R),a}function m(x){return u=x,s=setTimeout(y,t),c?g(x):a}function p(x){var R=x-l,I=x-u,E=t-R;return d?km(E,o-I):E}function b(x){var R=x-l,I=x-u;return l===void 0||R>=t||R<0||d&&I>=o}function y(){var x=ls();if(b(x))return w(x);s=setTimeout(y,p(x))}function w(x){return s=void 0,f&&i?g(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),u=0,i=l=r=s=void 0}function M(){return s===void 0?a:w(ls())}function C(){var x=ls(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(y,t),g(l)}return s===void 0&&(s=setTimeout(y,t)),a}return C.cancel=S,C.flush=M,C}var _c=Mm;const Lc=Mi(_c);function mn(e,t,n,i,r=!1){const o=h.useRef();o.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var u;(u=o.current)==null||u.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Jr(e,t){return e===void 0?void 0:t}const Rm=Math.PI;function Jl(e){return e*Rm/180}const Fc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ac=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Hc=(e,t,n)=>Math.min(e,t-n*2),zc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Zs=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.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"}),h.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"}))},Em=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Im(e,t,n){const[i,r]=h.useState(e),o=h.useRef(!0);h.useEffect(()=>()=>{o.current=!1},[]);const a=h.useRef(Lc(s=>{o.current&&r(s)},n));return h.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const Tm="֑-߿יִ-﷽ﹰ-ﻼ",Dm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Om=new RegExp("^[^"+Dm+"]*["+Tm+"]");function Js(e){return Om.test(e)?"rtl":"not-rtl"}let Xo;function Os(){if(typeof document>"u")return 0;if(Xo!==void 0)return Xo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const 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);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Xo=n-i,Xo}const qr=Symbol();function Pm(e){const t=h.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=h.useState(e),[,r]=h.useState(),o=h.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(u=>typeof s=="function"?s(l===qr?u:l):s),t.current[0]=qr)},[]),a=h.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function $c(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function _m(e){const t=h.useRef(e);return xi(e,t.current)||(t.current=e),t.current}const Lm=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return h.createElement(Rg,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(Tc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??h.createElement("img",{draggable:!1,src:s});return h.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&h.createElement("button",{className:"gdg-edit-icon",onClick:i},h.createElement(Zs,null)))};function Vc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ni=Vc();function Fm(e){ni=e}const Nc=/[&<>"']/,Am=new RegExp(Nc.source,"g"),Bc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Hm=new RegExp(Bc.source,"g"),zm={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql=e=>zm[e];function yn(e,t){if(t){if(Nc.test(e))return e.replace(Am,Ql)}else if(Bc.test(e))return e.replace(Hm,Ql);return e}const $m=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Wc(e){return e.replace($m,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Vm=/(^|[^\[])\^/g;function Wt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Vm,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Nm=/[^\w:]/g,Bm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function eu(e,t,n){if(e){let i;try{i=decodeURIComponent(Wc(n)).replace(Nm,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Bm.test(n)&&(n=Ym(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Yo={},Wm=/^[^:]+:\/*[^/]*$/,Um=/^([^:]+:)[\s\S]*$/,Xm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ym(e,t){Yo[" "+e]||(Wm.test(e)?Yo[" "+e]=e+"/":Yo[" "+e]=aa(e,"/",!0)),e=Yo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Um,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Xm,"$1")+t:e+t}const ma={exec:function(){}};function tu(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function aa(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function Gm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function jm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function nu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ru(e,t,n,i){const r=t.href,o=t.title?yn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:yn(a)}}function qm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.CTNOILgF.js","./index.DIuYZOo1.js","../css/index.DpJG_94W.css","./FormClearHelper.0-LU4kzK.js","./withFullScreenWrapper.DG7rb1Mv.js","./Toolbar.B4UnlLJR.js","./mergeWith.BSbf2-C9.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.l-Pgl8gO.js","./possibleConstructorReturn.BazPwu8U.js","./createSuper.CT9j4pwt.js","./FileDownload.esm.Cynb6pHv.js","./number-overlay-editor.DSD8puEB.js","./es6.D57lNoID.js"])))=>i.map(i=>d[i]);
|
2
|
+
var Uf=Object.defineProperty;var Xf=(e,t,n)=>t in e?Uf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ft=(e,t,n)=>Xf(e,typeof t!="symbol"?t+"":t,n);import{r as h,E as dc,_ as Je,g as Mi,c as Yf,R as te,i as is,p as Gf,d as Bs,e as jf,f as qf,h as fc,t as hc,l as Kf,m as gc,o as Zf,q as Jf,s as Qf,u as eh,v as th,a as fr,w as Ws,x as Vl,n as fo,y as Da,j as Jt,z as Hr,F as nh,D as Vo,A as mc,B as pc,C as or,G as vc,H as bc,I as rh,J as ih,K as Qe,L as wc,M as Ms,N as xt,O as Zr,Q as oh,S as Nl,T as yc,U as ah,V as sh,W as lh,X as Rs,Y as Cc,Z as uh,$ as ch,a0 as dh,a1 as fh,a2 as hh,a3 as gh,a4 as mh,a5 as ph,a6 as vh,a7 as bh,a8 as wh,a9 as Sc,aa as yh,ab as Ch,ac as Sh,ad as xh,ae as kh,af as Mh,ag as Rh,ah as Eh,ai as Ih,aj as Th,ak as Dh,al as Oh,am as Us,an as Yn,ao as Ph,ap as qi,aq as _h,k as Lh,ar as Fh,as as Be,b as xc,at as kc,au as Ah,av as Hh,aw as zh,ax as $h,ay as Vh,az as os,aA as Nh,aB as Bh,aC as as,aD as Wh,aE as Uh,aF as Xh,aG as Yh}from"./index.DIuYZOo1.js";import{u as Gh}from"./FormClearHelper.0-LU4kzK.js";import{w as jh,u as qh,E as Kh}from"./withFullScreenWrapper.DG7rb1Mv.js";import{T as Zh,a as Wi}from"./Toolbar.B4UnlLJR.js";import{m as Jh}from"./mergeWith.BSbf2-C9.js";import{s as Qh}from"./sprintf.C-r3gIuM.js";import{c as eg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Sr,a as Xs,C as tg}from"./toConsumableArray.l-Pgl8gO.js";import{_ as ng,a as rg,b as ig}from"./possibleConstructorReturn.BazPwu8U.js";import{_ as og}from"./createSuper.CT9j4pwt.js";import{D as ag,F as sg}from"./FileDownload.esm.Cynb6pHv.js";var Mc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(dc,Je({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Mc.displayName="Add";var Rc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(dc,Je({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});Rc.displayName="Search";function Ec(e="This should not happen"){throw new Error(e)}function An(e,t="Assertion failed"){if(!e)return Ec(t)}function ao(e,t){return Ec(t??"Hell froze over")}function lg(e,t){try{return e()}catch{return t}}const Bl=Object.prototype.hasOwnProperty;function xi(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&xi(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Bl.call(e,n)&&++i&&!Bl.call(t,n)||!(n in t)||!xi(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var ug=Object.prototype,cg=ug.hasOwnProperty;function dg(e,t){return e!=null&&cg.call(e,t)}var fg=dg,hg=fg,gg=Yf;function mg(e,t){return e!=null&&gg(e,t,hg)}var pg=mg;const vg=Mi(pg),ca=null,Ys=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Wl;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Wl||(Wl={}));var da;(function(e){e.Triangle="triangle",e.Dots="dots"})(da||(da={}));function No(e){return"width"in e&&typeof e.width=="number"}async function Ul(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function wi(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Ki(e){if(!vi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function bg(e){return vg(e,"editor")}function Gs(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));function wg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let Xl;const yr=class yr{constructor(t){ft(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new yr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=wg([...this.items,n]);return new yr(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const u=[];s<i&&u.push([s,i]),r<l&&u.push([r,l]),n.splice(o,1,...u)}}return new yr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};ft(yr,"empty",()=>Xl??(Xl=new yr([]))),ft(yr,"fromSingleSelection",t=>yr.empty().add(t));let yt=yr;var yg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Yl=yg,Cg=e=>e.toUpperCase()===e,Sg=e=>t=>e.indexOf(t)===-1,Ic=(e,t)=>{const n={};return Object.keys(e).filter(Sg(t)).forEach(i=>{n[i]=e[i]}),n};function xg(e,t,n){const i=Ic(t,n);if(!e){const r=typeof is=="function"?{default:is}:is;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var kg=(e,t)=>{};function Mg(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Cg(s[0])):n.propsAsIs,c=xg(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Yl(n.class,c.className||l):Yl(c.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],y=b[0],w=b[1]||"",S=typeof y=="function"?y(o):y;kg(S,n.name),f[`--${p}`]=`${S}${w}`}const g=c.style||{},m=Object.keys(g);m.length>0&&m.forEach(p=>{f[p]=g[p]}),c.style=f}return e.__linaria&&e!==s?(c.as=s,te.createElement(e,c)):te.createElement(s,c)},r=te.forwardRef?te.forwardRef(i):o=>{const a=Ic(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var pn=Mg;const Rg=pn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Tc={},Oa={},js={},ss={},Gl;function Eg(){return Gl||(Gl=1,function(e){(function(t,n){n(e,h,Gf)})(Bs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(w){return w&&w.__esModule?w:{default:w}}var s=Object.assign||function(w){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(w[C]=M[C])}return w};function l(w,S){var M={};for(var C in w)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(M[C]=w[C]);return M}function u(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function w(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&w(S.prototype,M),C&&w(S,C),S}}();function d(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function f(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var g=!1;function m(w){g=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return g?w:w.capture}function b(w){if("touches"in w){var S=w.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=w.screenX,R=w.screenY;return{x,y:R}}var y=function(w){f(S,w);function S(){var M;u(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,L=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:L},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(ss)),ss}(function(e){(function(t,n){n(e,Eg())})(Bs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(js);var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var _r=Ig(jf);function Ig(e){return e&&e.__esModule?e:{default:e}}function Tg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dg={ROOT:function(t){return(0,_r.default)(Tg({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};ho.default=Dg;var go={},Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.outerWidth=void 0;var Og=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Pa.outerWidth=Og;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var Pg=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=Pg;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.default=void 0;var _g=function(){return window};mo.default=_g;Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var rr=Ag(h),jr=_a(ho),Lg=Pa,jl=_a(Ri),Fg=_a(js),Bo=_a(mo);function _a(e){return e&&e.__esModule?e:{default:e}}function Dc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Dc=function(){return e},e}function Ag(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=Dc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function Es(){return Es=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Es.apply(this,arguments)}function Hg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $g(e,t,n){return t&&zg(e.prototype,t),e}function Vg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Is(e,t)}function Is(e,t){return Is=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Is(e,t)}function Ng(e){var t=Wg();return function(){var i=fa(e),r;if(t){var o=fa(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Bg(this,r)}}function Bg(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:Rn(e)}function Rn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function fa(e){return fa=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},fa(e)}function wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ug=function(t){return t.hasOwnProperty("key")},qs=function(e){Vg(n,e);var t=Ng(n);function n(i){var r;return Hg(this,n),r=t.call(this,i),wn(Rn(r),"itemsWrapperRef",void 0),wn(Rn(r),"itemsListRef",void 0),wn(Rn(r),"thumbsRef",void 0),wn(Rn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),wn(Rn(r),"setItemsListRef",function(o){r.itemsListRef=o}),wn(Rn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),wn(Rn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=rr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,Lg.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),u=l<o,c=u?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:u?r.getFirstItem(f.selectedItem):0,lastPosition:c,showArrows:u}})}}),wn(Rn(r),"handleClickItem",function(o,a,s){if(!Ug(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),wn(Rn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),wn(Rn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),wn(Rn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=rr.Children.count(r.props.children),u=-(r.state.firstItem*100)/r.state.visibleItems,c=Math.max(l-r.state.visibleItems,0),d=-c*100/r.state.visibleItems;u===s&&a>0&&(a=0),u===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,g=u+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,jl.default)(g,"%",r.props.axis)}),!0}),wn(Rn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),wn(Rn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),wn(Rn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return $g(n,[{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,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(c){return r.setThumbsRef(c,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return rr.default.createElement("li",Es({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=rr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},u=-this.state.firstItem*(this.state.itemSize||0),c=(0,jl.default)(u,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},rr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},rr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},rr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?rr.default.createElement(Fg.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):rr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(g){return r.setItemsListRef(g)},style:l},this.renderItems()),rr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(rr.Component);go.default=qs;wn(qs,"displayName","Thumbs");wn(qs,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var La={};Object.defineProperty(La,"__esModule",{value:!0});La.default=void 0;var Xg=function(){return document};La.default=Xg;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.setPosition=zn.getPosition=zn.isKeyboardEvent=zn.defaultStatusFormatter=zn.noop=void 0;var Yg=h,Gg=jg(Ri);function jg(e){return e&&e.__esModule?e:{default:e}}var qg=function(){};zn.noop=qg;var Kg=function(t,n){return"".concat(t," of ").concat(n)};zn.defaultStatusFormatter=Kg;var Zg=function(t){return t?t.hasOwnProperty("key"):!1};zn.isKeyboardEvent=Zg;var Jg=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=Yg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};zn.getPosition=Jg;var Qg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,Gg.default)(t,"%",n)}),i};zn.setPosition=Qg;var gr={};Object.defineProperty(gr,"__esModule",{value:!0});gr.fadeAnimationHandler=gr.slideStopSwipingHandler=gr.slideSwipeAnimationHandler=gr.slideAnimationHandler=void 0;var Oc=h,em=tm(Ri),mr=zn;function tm(e){return e&&e.__esModule?e:{default:e}}function ql(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ql(Object(n),!0).forEach(function(i){nm(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ql(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function nm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rm=function(t,n){var i={},r=n.selectedItem,o=r,a=Oc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,mr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,mr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,mr.setPosition)(0,t.axis)),i;var l=(0,mr.getPosition)(r,t),u=(0,em.default)(l,"%",t.axis),c=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:u,msTransform:u,OTransform:u,transform:u},n.swiping||(i.itemListStyle=Qr(Qr({},i.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),i};gr.slideAnimationHandler=rm;var im=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=Oc.Children.count(n.children),l=0,u=(0,mr.getPosition)(i.selectedItem,n),c=n.infiniteLoop?(0,mr.getPosition)(s-1,n)-100:(0,mr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;u===l&&d>0&&(f=0),u===c&&d<0&&(f=0);var g=u+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&g>-100?g-=s*100:i.selectedItem===s-1&&g<-s*100&&(g+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,mr.setPosition)(g,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};gr.slideSwipeAnimationHandler=im;var om=function(t,n){var i=(0,mr.getPosition)(n.selectedItem,t),r=(0,mr.setPosition)(i,t.axis);return{itemListStyle:r}};gr.slideStopSwipingHandler=om;var am=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={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 n.swiping||(o=Qr(Qr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Qr(Qr({},o),{},{opacity:1,position:"relative"}),prevStyle:Qr({},o)}};gr.fadeAnimationHandler=am;Object.defineProperty(Oa,"__esModule",{value:!0});Oa.default=void 0;var Ht=um(h),sm=po(js),Cr=po(ho),lm=po(go),Wo=po(La),Uo=po(mo),Zi=zn,ha=gr;function po(e){return e&&e.__esModule?e:{default:e}}function Pc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Pc=function(){return e},e}function um(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=Pc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function Ts(){return Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ts.apply(this,arguments)}function Kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kl(Object(n),!0).forEach(function(i){gt(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function cm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dm(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fm(e,t,n){return t&&dm(e.prototype,t),e}function hm(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ds(e,t)}function Ds(e,t){return Ds=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ds(e,t)}function gm(e){var t=pm();return function(){var i=ga(e),r;if(t){var o=ga(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return mm(this,r)}}function mm(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:vt(e)}function vt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pm(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ga(e){return ga=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ga(e)}function gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ks=function(e){hm(n,e);var t=gm(n);function n(i){var r;cm(this,n),r=t.call(this,i),gt(vt(r),"thumbsRef",void 0),gt(vt(r),"carouselWrapperRef",void 0),gt(vt(r),"listRef",void 0),gt(vt(r),"itemsRef",void 0),gt(vt(r),"timer",void 0),gt(vt(r),"animationHandler",void 0),gt(vt(r),"setThumbsRef",function(a){r.thumbsRef=a}),gt(vt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),gt(vt(r),"setListRef",function(a){r.listRef=a}),gt(vt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),gt(vt(r),"autoPlay",function(){Ht.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),gt(vt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),gt(vt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),gt(vt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),gt(vt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),gt(vt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,Wo.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,Wo.default)().activeElement)):!1}),gt(vt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",u={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},c=l?u.ArrowRight:u.ArrowDown,d=l?u.ArrowLeft:u.ArrowUp;c===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),gt(vt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),gt(vt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),gt(vt(r),"handleClickItem",function(a,s){if(Ht.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),gt(vt(r),"handleOnChange",function(a,s){Ht.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),gt(vt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),gt(vt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),gt(vt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),gt(vt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(vt(r)));return r.setState(ir({},l)),!!Object.keys(l).length}),gt(vt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),gt(vt(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))}),gt(vt(r),"moveTo",function(a){if(typeof a=="number"){var s=Ht.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),gt(vt(r),"onClickNext",function(){r.increment(1)}),gt(vt(r),"onClickPrev",function(){r.decrement(1)}),gt(vt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),gt(vt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),gt(vt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),gt(vt(r),"selectItem",function(a){r.setState(ir({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,Ht.Children.toArray(r.props.children)[a.selectedItem])}),gt(vt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),gt(vt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var u=l[0];if(!u.complete){var c=function g(){r.forceUpdate(),u.removeEventListener("load",g)};u.addEventListener("load",c)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ha.fadeAnimationHandler||ha.slideAnimationHandler,r.state=ir(ir({},o),r.animationHandler(i,o)),r}return fm(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(ir({},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&&Ht.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.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,Uo.default)().addEventListener("resize",this.updateSizes),(0,Uo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Wo.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Uo.default)().removeEventListener("resize",this.updateSizes),(0,Uo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Wo.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 o=this;return this.props.children?Ht.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,u=s===o.state.previousItem,c=l&&o.state.selectedStyle||u&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=ir(ir({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=ir(ir({},c),{},{pointerEvents:"none"}));var d={ref:function(g){return o.setItemsRef(g,s)},key:"itemKey"+s+(r?"clone":""),className:Cr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:c};return Ht.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,u=o.children;return a?Ht.default.createElement("ul",{className:"control-dots"},Ht.Children.map(u,function(c,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?Ht.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,Ht.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||Ht.Children.count(this.props.children)===0?null:Ht.default.createElement(lm.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||Ht.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&Ht.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&Ht.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,u=s&&(this.state.selectedItem<Ht.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),d=c.shift(),f=c.pop(),g={className:Cr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(g.onSwipeLeft=this.onSwipeForward,g.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else g.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,g.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,g.style=ir(ir({},g.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return Ht.default.createElement("div",{"aria-label":this.props.ariaLabel,className:Cr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},Ht.default.createElement("div",{className:Cr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),Ht.default.createElement("div",{className:Cr.default.WRAPPER(!0,this.props.axis),style:m},o?Ht.default.createElement(sm.default,Ts({tagName:"ul",innerRef:this.setListRef},g,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):Ht.default.createElement("ul",{className:Cr.default.SLIDER(!0,this.state.swiping),ref:function(y){return r.setListRef(y)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,u,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(Ht.default.Component);Oa.default=Ks;gt(Ks,"displayName","Carousel");gt(Ks,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return Ht.default.createElement("button",{type:"button","aria-label":i,className:Cr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return Ht.default.createElement("button",{type:"button","aria-label":i,className:Cr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return Ht.default.createElement("li",{className:Cr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=Ht.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=Ht.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ha.slideSwipeAnimationHandler,stopSwipingHandler:ha.slideStopSwipingHandler});var vm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Oa),n=vm,i=r(go);function r(o){return o&&o.__esModule?o:{default:o}}})(Tc);var bm=qf,wm=function(){return bm.Date.now()},ym=wm,Cm=fc,ls=ym,Zl=hc,Sm="Expected a function",xm=Math.max,km=Math.min;function Mm(e,t,n){var i,r,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(Sm);t=Zl(t)||0,Cm(n)&&(c=!!n.leading,d="maxWait"in n,o=d?xm(Zl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function g(x){var R=i,I=r;return i=r=void 0,u=x,a=e.apply(I,R),a}function m(x){return u=x,s=setTimeout(y,t),c?g(x):a}function p(x){var R=x-l,I=x-u,E=t-R;return d?km(E,o-I):E}function b(x){var R=x-l,I=x-u;return l===void 0||R>=t||R<0||d&&I>=o}function y(){var x=ls();if(b(x))return w(x);s=setTimeout(y,p(x))}function w(x){return s=void 0,f&&i?g(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),u=0,i=l=r=s=void 0}function M(){return s===void 0?a:w(ls())}function C(){var x=ls(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(y,t),g(l)}return s===void 0&&(s=setTimeout(y,t)),a}return C.cancel=S,C.flush=M,C}var _c=Mm;const Lc=Mi(_c);function mn(e,t,n,i,r=!1){const o=h.useRef();o.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var u;(u=o.current)==null||u.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Jr(e,t){return e===void 0?void 0:t}const Rm=Math.PI;function Jl(e){return e*Rm/180}const Fc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ac=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Hc=(e,t,n)=>Math.min(e,t-n*2),zc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Zs=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.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"}),h.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"}))},Em=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Im(e,t,n){const[i,r]=h.useState(e),o=h.useRef(!0);h.useEffect(()=>()=>{o.current=!1},[]);const a=h.useRef(Lc(s=>{o.current&&r(s)},n));return h.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const Tm="֑-߿יִ-﷽ﹰ-ﻼ",Dm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Om=new RegExp("^[^"+Dm+"]*["+Tm+"]");function Js(e){return Om.test(e)?"rtl":"not-rtl"}let Xo;function Os(){if(typeof document>"u")return 0;if(Xo!==void 0)return Xo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const 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);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Xo=n-i,Xo}const qr=Symbol();function Pm(e){const t=h.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=h.useState(e),[,r]=h.useState(),o=h.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(u=>typeof s=="function"?s(l===qr?u:l):s),t.current[0]=qr)},[]),a=h.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function $c(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function _m(e){const t=h.useRef(e);return xi(e,t.current)||(t.current=e),t.current}const Lm=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return h.createElement(Rg,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(Tc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??h.createElement("img",{draggable:!1,src:s});return h.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&h.createElement("button",{className:"gdg-edit-icon",onClick:i},h.createElement(Zs,null)))};function Vc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ni=Vc();function Fm(e){ni=e}const Nc=/[&<>"']/,Am=new RegExp(Nc.source,"g"),Bc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Hm=new RegExp(Bc.source,"g"),zm={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql=e=>zm[e];function yn(e,t){if(t){if(Nc.test(e))return e.replace(Am,Ql)}else if(Bc.test(e))return e.replace(Hm,Ql);return e}const $m=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Wc(e){return e.replace($m,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Vm=/(^|[^\[])\^/g;function Wt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Vm,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Nm=/[^\w:]/g,Bm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function eu(e,t,n){if(e){let i;try{i=decodeURIComponent(Wc(n)).replace(Nm,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Bm.test(n)&&(n=Ym(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Yo={},Wm=/^[^:]+:\/*[^/]*$/,Um=/^([^:]+:)[\s\S]*$/,Xm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ym(e,t){Yo[" "+e]||(Wm.test(e)?Yo[" "+e]=e+"/":Yo[" "+e]=aa(e,"/",!0)),e=Yo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Um,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Xm,"$1")+t:e+t}const ma={exec:function(){}};function tu(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function aa(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function Gm(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function jm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function nu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ru(e,t,n,i){const r=t.href,o=t.title?yn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:yn(a)}}function qm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
|
3
3
|
`).map(r=>{const o=r.match(/^\s+/);if(o===null)return r;const[a]=o;return a.length>=i.length?r.slice(i.length):r}).join(`
|
4
4
|
`)}class Qs{constructor(t){this.options=t||ni}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:aa(i,`
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=qm(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=aa(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:o,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,o,a,s,l,u,c,d,f,g,m,p=n[1].trim();const b=p.length>1,y={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const w=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=w.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(`
|
@@ -46,8 +46,8 @@ ${t}</tr>
|
|
46
46
|
`+(g.tokens?this.parseInline(g.tokens):g.text);i+=n?this.renderer.paragraph(f):f;continue}default:{const I='Token with "'+g.type+'" type was not found.';if(this.options.silent){console.error(I);return}else throw new Error(I)}}}return i}parseInline(t,n){n=n||this.renderer;let i="",r,o,a;const s=t.length;for(r=0;r<s;r++){if(o=t[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(a=this.options.extensions.renderers[o.type].call({parser:this},o),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){i+=a||"";continue}switch(o.type){case"escape":{i+=n.text(o.text);break}case"html":{i+=n.html(o.text);break}case"link":{i+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{i+=n.image(o.href,o.title,o.text);break}case"strong":{i+=n.strong(this.parseInline(o.tokens,n));break}case"em":{i+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{i+=n.codespan(o.text);break}case"br":{i+=n.br();break}case"del":{i+=n.del(this.parseInline(o.tokens,n));break}case"text":{i+=n.text(o.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return i}}class pa{constructor(t){this.options=t||ni}preprocess(t){return t}postprocess(t){return t}}ft(pa,"passThroughHooks",new Set(["preprocess","postprocess"]));function Zm(e,t,n){return i=>{if(i.message+=`
|
47
47
|
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+yn(i.message+"",!0)+"</pre>";if(t)return Promise.resolve(r);if(n){n(null,r);return}return r}if(t)return Promise.reject(i);if(n){n(i);return}throw i}}function Yc(e,t){return(n,i,r)=>{typeof i=="function"&&(r=i,i=null);const o={...i};i={...Ze.defaults,...o};const a=Zm(i.silent,i.async,r);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(jm(i),i.hooks&&(i.hooks.options=i),r){const s=i.highlight;let l;try{i.hooks&&(n=i.hooks.preprocess(n)),l=e(n,i)}catch(d){return a(d)}const u=function(d){let f;if(!d)try{i.walkTokens&&Ze.walkTokens(l,i.walkTokens),f=t(l,i),i.hooks&&(f=i.hooks.postprocess(f))}catch(g){d=g}return i.highlight=s,d?a(d):r(null,f)};if(!s||s.length<3||(delete i.highlight,!l.length))return u();let c=0;Ze.walkTokens(l,function(d){d.type==="code"&&(c++,setTimeout(()=>{s(d.text,d.lang,function(f,g){if(f)return u(f);g!=null&&g!==d.text&&(d.text=g,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(s=>e(s,i)).then(s=>i.walkTokens?Promise.all(Ze.walkTokens(s,i.walkTokens)).then(()=>s):s).then(s=>t(s,i)).then(s=>i.hooks?i.hooks.postprocess(s):s).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&Ze.walkTokens(s,i.walkTokens);let l=t(s,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(s){return a(s)}}}function Ze(e,t,n){return Yc(zr.lex,$r.parse)(e,t,n)}Ze.options=Ze.setOptions=function(e){return Ze.defaults={...Ze.defaults,...e},Fm(Ze.defaults),Ze};Ze.getDefaults=Vc;Ze.defaults=ni;Ze.use=function(...e){const t=Ze.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const i={...n};if(i.async=Ze.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let s=r.renderer.apply(this,a);return s===!1&&(s=o.apply(this,a)),s}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=Ze.defaults.renderer||new el;for(const o in n.renderer){const a=r[o];r[o]=(...s)=>{let l=n.renderer[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.renderer=r}if(n.tokenizer){const r=Ze.defaults.tokenizer||new Qs;for(const o in n.tokenizer){const a=r[o];r[o]=(...s)=>{let l=n.tokenizer[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.tokenizer=r}if(n.hooks){const r=Ze.defaults.hooks||new pa;for(const o in n.hooks){const a=r[o];pa.passThroughHooks.has(o)?r[o]=s=>{if(Ze.defaults.async)return Promise.resolve(n.hooks[o].call(r,s)).then(u=>a.call(r,u));const l=n.hooks[o].call(r,s);return a.call(r,l)}:r[o]=(...s)=>{let l=n.hooks[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.hooks=r}if(n.walkTokens){const r=Ze.defaults.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.walkTokens.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}Ze.setOptions(i)})};Ze.walkTokens=function(e,t){let n=[];for(const i of e)switch(n=n.concat(t.call(Ze,i)),i.type){case"table":{for(const r of i.header)n=n.concat(Ze.walkTokens(r.tokens,t));for(const r of i.rows)for(const o of r)n=n.concat(Ze.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ze.walkTokens(i.items,t));break}default:Ze.defaults.extensions&&Ze.defaults.extensions.childTokens&&Ze.defaults.extensions.childTokens[i.type]?Ze.defaults.extensions.childTokens[i.type].forEach(function(r){n=n.concat(Ze.walkTokens(i[r],t))}):i.tokens&&(n=n.concat(Ze.walkTokens(i.tokens,t)))}return n};Ze.parseInline=Yc(zr.lexInline,$r.parseInline);Ze.Parser=$r;Ze.parser=$r.parse;Ze.Renderer=el;Ze.TextRenderer=Uc;Ze.Lexer=zr;Ze.lexer=zr.lex;Ze.Tokenizer=Qs;Ze.Slugger=Xc;Ze.Hooks=pa;Ze.parse=Ze;Ze.options;Ze.setOptions;Ze.use;Ze.walkTokens;Ze.parseInline;$r.parse;zr.lex;const Jm=pn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Qm extends te.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:i}=this;if(n===null)return;const{contents:r,createNode:o}=i,a=Ze(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let l=o==null?void 0:o(a);if(l===void 0){const c=document.createElement("template");c.innerHTML=a,l=c.content}n.append(l);const u=n.getElementsByTagName("a");for(const c of u)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),te.createElement(Jm,{ref:this.containerRefHook})}}const ep=pn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),tp=pn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),np=pn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let ou=0;const Ei=e=>{const{placeholder:t,value:n,onKeyDown:i,highlight:r,altNewline:o,validatedSelection:a,...s}=e,{onChange:l,className:u}=s,c=h.useRef(null),d=n??"";An(l!==void 0,"GrowingEntry must be a controlled input area");const[f]=h.useState(()=>"input-box-"+(ou=(ou+1)%1e7));h.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(r?0:p,p)},[]),h.useLayoutEffect(()=>{var m;if(a!==void 0){const p=typeof a=="number"?[a,null]:a;(m=c.current)==null||m.setSelectionRange(p[0],p[1])}},[a]);const g=h.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||i==null||i(m)},[o,i]);return h.createElement(np,{className:"gdg-growing-entry"},h.createElement(tp,{className:u},d+`
|
48
48
|
`),h.createElement(ep,{...s,className:(u??"")+" gdg-input",id:f,ref:c,onKeyDown:g,value:d,placeholder:t,dir:"auto"}))},us={};let Lr=null;function rp(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function va(e){const t=e.toLowerCase().trim();if(us[t]!==void 0)return us[t];Lr=Lr||rp(),Lr.style.color="#000",Lr.style.color=t;const n=getComputedStyle(Lr).color;Lr.style.color="#fff",Lr.style.color=t;const i=getComputedStyle(Lr).color;if(i!==n)return[0,0,0,1];let r=i.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return r.length<4&&r.push(1),r=r.map(o=>Number.isNaN(o)?0:o),us[t]=r,r}function ti(e,t){const[n,i,r]=va(e);return`rgba(${n}, ${i}, ${r}, ${t})`}const au=new Map;function su(e,t){const n=`${e}-${t}`,i=au.get(n);if(i!==void 0)return i;const r=Hn(e,t);return au.set(n,r),r}function Hn(e,t){if(t===void 0)return e;const[n,i,r,o]=va(e);if(o===1)return e;const[a,s,l,u]=va(t),c=o+u*(1-o),d=(o*n+u*a*(1-o))/c,f=(o*i+u*s*(1-o))/c,g=(o*r+u*l*(1-o))/c;return`rgba(${d}, ${f}, ${g}, ${c})`}var bi=new Map,yi=new Map,Ps=new Map;function ip(){bi.clear(),Ps.clear(),yi.clear()}function op(e,t,n,i,r){var o,a,s;let l=0,u={};for(let d of e)l+=(o=n.get(d))!=null?o:r,u[d]=((a=u[d])!=null?a:0)+1;let c=t-l;for(let d of Object.keys(u)){let f=u[d],g=(s=n.get(d))!=null?s:r,m=g*f/l,p=c*m*i/f,b=g+p;n.set(d,b)}}function ap(e,t){var n;let i=new Map,r=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;i.set(u,c),r+=c}let o=r/i.size,a=3,s=(t/o+a)/(a+1),l=i.keys();for(let u of l)i.set(u,((n=i.get(u))!=null?n:o)*s);return i}function to(e,t,n,i){var r,o;let a=yi.get(n);if(i&&a!==void 0&&a.count>2e4){let u=Ps.get(n);if(u===void 0&&(u=ap(e,a.size),Ps.set(n,u)),a.count>5e5){let d=0;for(let f of t)d+=(r=u.get(f))!=null?r:a.size;return d*1.01}let c=e.measureText(t);return op(t,c.width,u,Math.max(.05,1-a.count/2e5),a.size),yi.set(n,{count:a.count+t.length,size:a.size}),c.width}let s=e.measureText(t),l=s.width/t.length;if(((o=a==null?void 0:a.count)!=null?o:0)>2e4)return s.width;if(a===void 0)yi.set(n,{count:t.length,size:l});else{let u=l-a.size,c=t.length/(a.count+t.length),d=a.size+u*c;yi.set(n,{count:a.count+t.length,size:d})}return s.width}function sp(e,t,n,i,r,o,a,s){if(t.length<=1)return t.length;if(r<n)return-1;let l=Math.floor(n/r*o),u=to(e,t.slice(0,Math.max(0,l)),i,a);if(u!==n)if(u<n){for(;u<n;)l++,u=to(e,t.slice(0,Math.max(0,l)),i,a);l--}else for(;u>n;){let c=t.lastIndexOf(" ",l-1);c>0?l=c:l--,u=to(e,t.slice(0,Math.max(0,l)),i,a)}if(t[l]!==" "){let c=0;c=t.lastIndexOf(" ",l),c>0&&(l=c)}return l}function lp(e,t,n,i,r,o){let a=`${t}_${n}_${i}px`,s=bi.get(a);if(s!==void 0)return s;if(i<=0)return[];let l=[],u=t.split(`
|
49
|
-
`),c=yi.get(n),d=c===void 0?t.length:i/c.size*1.5,f=r&&c!==void 0&&c.count>2e4;for(let g of u){let m=to(e,g.slice(0,Math.max(0,d)),n,f),p=Math.min(g.length,d);if(m<=i)l.push(g);else{for(;m>i;){let b=sp(e,g,i,n,m,p,f),y=g.slice(0,Math.max(0,b));g=g.slice(y.length),l.push(y),m=to(e,g.slice(0,Math.max(0,d)),n,f),p=Math.min(g.length,d)}m>0&&l.push(g)}}return l=l.map((g,m)=>m===0?g.trimEnd():g.trim()),bi.set(a,l),bi.size>500&&bi.delete(bi.keys().next().value),l}function up(e,t){return te.useMemo(()=>e.map((n,i)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:i,sticky:i<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function cp(e,t){const[n,i]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(i))return!0;if(e.current!==void 0){if(no(e.current.cell,t))return!0;const r=[e.current.range,...e.current.rangeStack];for(const o of r)if(n>=o.x&&n<o.x+o.width&&i>=o.y&&i<o.y+o.height)return!0}return!1}function so(e,t){return(e??"")===(t??"")}function dp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Gc(e,t){const[n,i]=e;return n>=t.x&&n<t.x+t.width&&i>=t.y&&i<t.y+t.height}function no(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function jc(e){return[e.x+e.width-1,e.y+e.height-1]}function lu(e,t,n){const i=n.x,r=n.x+n.width-1,o=n.y,a=n.y+n.height-1,[s,l]=e;if(l<o||l>a)return!1;if(t.span===void 0)return s>=i&&s<=r;const[u,c]=t.span;return u>=i&&u<=r||c>=i&&u<=r||u<i&&c>r}function fp(e,t,n,i){let r=0;if(n.current===void 0)return r;const o=n.current.range;(i||o.height*o.width>1)&&lu(e,t,o)&&r++;for(const a of n.current.rangeStack)lu(e,t,a)&&r++;return r}function qc(e,t){let n=e;if(t!==void 0){let i=[...e];const r=n[t.src];t.src>t.dest?(i.splice(t.src,1),i.splice(t.dest,0,r)):(i.splice(t.dest+1,0,r),i.splice(t.src,1)),i=i.map((o,a)=>({...o,sticky:e[a].sticky})),n=i}return n}function ki(e,t){let n=0;const i=qc(e,t);for(let r=0;r<i.length;r++){const o=i[r];if(o.sticky)n+=o.width;else break}return n}function ri(e,t,n){if(typeof n=="number")return t*n;{let i=0;for(let r=e-t;r<e;r++)i+=n(r);return i}}function _s(e,t,n,i,r){const o=qc(e,i),a=[];for(const u of o)if(u.sticky)a.push(u);else break;if(a.length>0)for(const u of a)n-=u.width;let s=t,l=r??0;for(;l<=n&&s<o.length;)l+=o[s].width,s++;for(let u=t;u<s;u++){const c=o[u];c.sticky||a.push(c)}return a}function hp(e,t,n){let i=0;for(const r of t){const o=r.sticky?i:i+(n??0);if(e<=o+r.width)return r.sourceIndex;i+=r.width}return-1}function gp(e,t,n,i,r,o,a,s,l,u){const c=i+r;if(n&&e<=r)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,b=typeof a=="number"?a:a(p);if(d-=b,e>=d)return p}const f=o-u,g=e-(l??0);if(typeof a=="number"){const m=Math.floor((g-c)/a)+s;return m>=f?void 0:m}else{let m=c;for(let p=s;p<f;p++){const b=a(p);if(g<=m+b)return p;m+=b}return}}let sa=0,ro={};const mp=typeof window>"u";async function pp(){var e;mp||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,sa=0,ro={},ip())}pp();function Kc(e,t,n,i){return`${e}_${i??(t==null?void 0:t.font)}_${n}`}function ii(e,t,n,i="middle"){const r=Kc(e,t,i,n);let o=ro[r];return o===void 0&&(o=t.measureText(e),ro[r]=o,sa++),sa>1e4&&(ro={},sa=0),o}function Zc(e,t){const n=Kc(e,void 0,"middle",t);return ro[n]}function
|
50
|
-
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function yp(e,t,n,i,r,o,a,s,l,u){const c=s.baseFontFull,d=lp(e,t,c,r-s.cellHorizontalPadding*2,u??!1),f=ed(e,c),g=s.lineHeight*f,m=f+g*(d.length-1),p=m+s.cellVerticalPadding>o;p&&(e.save(),e.rect(n,i,r,o),e.clip());const b=i+o/2-m/2;let y=Math.max(i+s.cellVerticalPadding,b);for(const w of d)if(Qc(e,w,n,y,r,f,a,s,l),y+=g,y>i+o)break;p&&e.restore()}function fr(e,t,n,i,r){const{ctx:o,rect:a,theme:s}=e,{x:l,y:u,width:c,height:d}=a;i=i??!1,i||(t=wp(t,c));const f=pr(o,s),g=Js(t)==="rtl";if(n===void 0&&g&&(n="right"),g&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),i?yp(o,t,l,u,c,d,f,s,n,r):Qc(o,t,l,u,c,d,f,s,n),m&&(o.textAlign="start"),g&&(o.direction="inherit")}}function mr(e,t,n,i,r,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,r/2,i/2)),tr:Math.max(0,Math.min(o.tr,r/2,i/2)),bl:Math.max(0,Math.min(o.bl,r/2,i/2)),br:Math.max(0,Math.min(o.br,r/2,i/2))},e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Cp(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function Sp(e,t,n){const i=function(s,l){const u=l.x-s.x,c=l.y-s.y,d=Math.sqrt(u*u+c*c),f=u/d,g=c/d;return{x:u,y:l.y-s.y,len:d,nx:f,ny:g,ang:Math.atan2(g,f)}};let r;const o=t.length;let a=t[o-1];for(let s=0;s<o;s++){let l=t[s%o];const u=t[(s+1)%o],c=i(l,a),d=i(l,u),f=c.nx*d.ny-c.ny*d.nx,g=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(f<-1?-1:f>1?1:f),p=1,b=!1;g<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,b=!0):m>0&&(p=-1,b=!0),r=l.radius!==void 0?l.radius:n;const y=m/2;let w=Math.abs(Math.cos(y)*r/Math.sin(y)),S;w>Math.min(c.len/2,d.len/2)?(w=Math.min(c.len/2,d.len/2),S=Math.abs(w*Math.sin(y)/Math.cos(y))):S=r;let M=l.x+d.nx*w,C=l.y+d.ny*w;M+=-d.ny*S*p,C+=d.nx*S*p,e.arc(M,C,S,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,b),a=l,l=u}e.closePath()}function Ls(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m){const p={x:0,y:o+u,width:0,height:0};if(e>=g.length||t>=c||t<-2||e<0)return p;const b=o-r;if(e>=d){const y=a>e?-1:1,w=ki(g);p.x+=w+l;for(let S=a;S!==e;S+=y)p.x+=g[y===1?S:S-1].width*y}else for(let y=0;y<e;y++)p.x+=g[y].width;if(p.width=g[e].width+1,t===-1)p.y=r,p.height=b;else if(t===-2){p.y=0,p.height=r;let y=e;const w=g[e].group,S=g[e].sticky;for(;y>0&&so(g[y-1].group,w)&&g[y-1].sticky===S;){const C=g[y-1];p.x-=C.width,p.width+=C.width,y--}let M=e;for(;M+1<g.length&&so(g[M+1].group,w)&&g[M+1].sticky===S;){const C=g[M+1];p.width+=C.width,M++}if(!S){const C=ki(g),x=p.x-C;x<0&&(p.x-=x,p.width+=x),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-f){let y=c-t;for(p.y=i;y>0;){const w=t+y-1;p.height=typeof m=="number"?m:m(w),p.y-=p.height,y--}p.height+=1}else{const y=s>t?-1:1;if(typeof m=="number"){const w=t-s;p.y+=w*m}else for(let w=s;w!==t;w+=y)p.y+=m(w)*y;p.height=(typeof m=="number"?m:m(t))+1}return p}const tl=1<<21;function or(e,t){return(t+2)*tl+e}function td(e){return e%tl}function nl(e){return Math.floor(e/tl)-2}function rl(e){const t=td(e),n=nl(e);return[t,n]}class nd{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=td(t),i=nl(t),r=this.visibleWindow,o=n>=r.x&&n<=r.x+r.width||n<this.freezeCols,a=i>=r.y&&i<=r.y+r.height||this.freezeRows.includes(i);return o&&a})}setWindow(t,n,i){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&xi(this.freezeRows,i)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=i,this.clearOutOfWindow())}}class xp extends nd{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,i)=>{this.cache.set(or(n[0],n[1]),i)});ft(this,"getValue",n=>this.cache.get(or(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class io{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>or(n[0],n[1])))}add(t){this.cells.add(or(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(or(t[0],t[1]))}remove(t){this.cells.delete(or(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(nl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let i=t.x;i<t.x+t.width;i++)if(this.cells.has(or(i,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield rl(t)}}function kp(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const rd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4};function id(){return rd}const od=te.createContext(rd);function Mp(){return te.useContext(od)}function xr(e,...t){const n={...e};for(const i of t)if(i!==void 0)for(const r in i)i.hasOwnProperty(r)&&(r==="bgCell"?n[r]=Hn(i[r],n[r]):n[r]=i[r]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Fs=150;function Rp(e,t,n,i){var o;const r=i(t);return((o=r==null?void 0:r.measure)==null?void 0:o.call(r,e,t,n))??Fs}function ad(e,t,n,i,r,o,a,s,l){let u=0;const c=r===void 0?[]:r.map(f=>{const g=Rp(e,f[i],t,l);return u=Math.max(u,g),g});if(c.length>5&&s){u=0;let f=0;for(const m of c)f+=m;const g=f/c.length;for(let m=0;m<c.length;m++)c[m]>=g*2?c[m]=0:u=Math.max(u,c[m])}u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const d=Math.max(Math.ceil(o),Math.min(Math.floor(a),Math.ceil(u)));return{...n,width:d}}function Ep(e,t,n,i,r,o,a,s,l){const u=h.useRef(t),c=h.useRef(n),d=h.useRef(a);u.current=t,c.current=n,d.current=a;const[f,g]=h.useMemo(()=>{if(typeof window>"u")return[null,null];const w=document.createElement("canvas");return w.style.display="none",w.style.opacity="0",w.style.position="fixed",[w,w.getContext("2d",{alpha:!1})]},[]);h.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f==null||f.remove()}),[f]);const m=h.useRef({}),p=h.useRef(),[b,y]=h.useState();return h.useLayoutEffect(()=>{const w=c.current;if(w===void 0||e.every(No))return;let S=Math.max(1,10-Math.floor(e.length/1e4)),M=0;S<u.current&&S>1&&(S--,M=1);const C={x:0,y:0,width:e.length,height:Math.min(u.current,S)},x={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=w(C,l.signal),E=M>0?w(x,l.signal):void 0;let L;typeof I=="object"?L=I:L=await Ul(I),E!==void 0&&(typeof E=="object"?L=[...L,...E]:L=[...L,...await Ul(E)]),p.current=e,y(L)})()},[l.signal,e]),h.useMemo(()=>{let S=e.every(No)?e:g===null?e.map(R=>No(R)?R:{...R,width:Fs}):(g.font=d.current.baseFontFull,e.map((R,I)=>{if(No(R))return R;if(m.current[R.id]!==void 0)return{...R,width:m.current[R.id]};if(b===void 0||p.current!==e||R.id===void 0)return{...R,width:Fs};const E=ad(g,a,R,I,b,r,o,!0,s);return m.current[R.id]=E.width,E})),M=0,C=0;const x=[];for(const[R,I]of S.entries())M+=I.width,I.grow!==void 0&&I.grow>0&&(C+=I.grow,x.push(R));if(M<i&&x.length>0){const R=[...S],I=i-M;let E=I;for(let L=0;L<x.length;L++){const z=x[L],_=(S[z].grow??0)/C,F=L===x.length-1?E:Math.min(E,Math.floor(I*_));R[z]={...S[z],growOffset:F,width:S[z].width+F},E-=F}S=R}return{sizedColumns:S,nonGrowWidth:M}},[i,e,g,b,a,r,o,s])}function Ip(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}var Tp=Ip,Dp=Tp,cs=hc;function Op(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=cs(n),n=n===n?n:0),t!==void 0&&(t=cs(t),t=t===t?t:0),Dp(cs(e),t,n)}var Pp=Op;const Xn=Mi(Pp);function _p(){}var Lp=_p,ds=Kf,Fp=Lp,Ap=gc,Hp=1/0,zp=ds&&1/Ap(new ds([,-0]))[1]==Hp?function(e){return new ds(e)}:Fp,$p=zp,Vp=Zf,Np=Jf,Bp=Qf,Wp=eh,Up=$p,Xp=gc,Yp=200;function Gp(e,t,n){var i=-1,r=Np,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=Bp;else if(o>=Yp){var u=t?null:Up(e);if(u)return Xp(u);a=!1,r=Wp,l=new Vp}else l=t?[]:s;e:for(;++i<o;){var c=e[i],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else r(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var jp=Gp,qp=jp;function Kp(e){return e&&e.length?qp(e):[]}var Zp=Kp;const Jp=Mi(Zp),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',Qp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
49
|
+
`),c=yi.get(n),d=c===void 0?t.length:i/c.size*1.5,f=r&&c!==void 0&&c.count>2e4;for(let g of u){let m=to(e,g.slice(0,Math.max(0,d)),n,f),p=Math.min(g.length,d);if(m<=i)l.push(g);else{for(;m>i;){let b=sp(e,g,i,n,m,p,f),y=g.slice(0,Math.max(0,b));g=g.slice(y.length),l.push(y),m=to(e,g.slice(0,Math.max(0,d)),n,f),p=Math.min(g.length,d)}m>0&&l.push(g)}}return l=l.map((g,m)=>m===0?g.trimEnd():g.trim()),bi.set(a,l),bi.size>500&&bi.delete(bi.keys().next().value),l}function up(e,t){return te.useMemo(()=>e.map((n,i)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:i,sticky:i<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function cp(e,t){const[n,i]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(i))return!0;if(e.current!==void 0){if(no(e.current.cell,t))return!0;const r=[e.current.range,...e.current.rangeStack];for(const o of r)if(n>=o.x&&n<o.x+o.width&&i>=o.y&&i<o.y+o.height)return!0}return!1}function so(e,t){return(e??"")===(t??"")}function dp(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Gc(e,t){const[n,i]=e;return n>=t.x&&n<t.x+t.width&&i>=t.y&&i<t.y+t.height}function no(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function jc(e){return[e.x+e.width-1,e.y+e.height-1]}function lu(e,t,n){const i=n.x,r=n.x+n.width-1,o=n.y,a=n.y+n.height-1,[s,l]=e;if(l<o||l>a)return!1;if(t.span===void 0)return s>=i&&s<=r;const[u,c]=t.span;return u>=i&&u<=r||c>=i&&u<=r||u<i&&c>r}function fp(e,t,n,i){let r=0;if(n.current===void 0)return r;const o=n.current.range;(i||o.height*o.width>1)&&lu(e,t,o)&&r++;for(const a of n.current.rangeStack)lu(e,t,a)&&r++;return r}function qc(e,t){let n=e;if(t!==void 0){let i=[...e];const r=n[t.src];t.src>t.dest?(i.splice(t.src,1),i.splice(t.dest,0,r)):(i.splice(t.dest+1,0,r),i.splice(t.src,1)),i=i.map((o,a)=>({...o,sticky:e[a].sticky})),n=i}return n}function ki(e,t){let n=0;const i=qc(e,t);for(let r=0;r<i.length;r++){const o=i[r];if(o.sticky)n+=o.width;else break}return n}function ri(e,t,n){if(typeof n=="number")return t*n;{let i=0;for(let r=e-t;r<e;r++)i+=n(r);return i}}function _s(e,t,n,i,r){const o=qc(e,i),a=[];for(const u of o)if(u.sticky)a.push(u);else break;if(a.length>0)for(const u of a)n-=u.width;let s=t,l=r??0;for(;l<=n&&s<o.length;)l+=o[s].width,s++;for(let u=t;u<s;u++){const c=o[u];c.sticky||a.push(c)}return a}function hp(e,t,n){let i=0;for(const r of t){const o=r.sticky?i:i+(n??0);if(e<=o+r.width)return r.sourceIndex;i+=r.width}return-1}function gp(e,t,n,i,r,o,a,s,l,u){const c=i+r;if(n&&e<=r)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,b=typeof a=="number"?a:a(p);if(d-=b,e>=d)return p}const f=o-u,g=e-(l??0);if(typeof a=="number"){const m=Math.floor((g-c)/a)+s;return m>=f?void 0:m}else{let m=c;for(let p=s;p<f;p++){const b=a(p);if(g<=m+b)return p;m+=b}return}}let sa=0,ro={};const mp=typeof window>"u";async function pp(){var e;mp||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,sa=0,ro={},ip())}pp();function Kc(e,t,n,i){return`${e}_${i??(t==null?void 0:t.font)}_${n}`}function ii(e,t,n,i="middle"){const r=Kc(e,t,i,n);let o=ro[r];return o===void 0&&(o=t.measureText(e),ro[r]=o,sa++),sa>1e4&&(ro={},sa=0),o}function Zc(e,t){const n=Kc(e,void 0,"middle",t);return ro[n]}function vr(e,t){return typeof t!="string"&&(t=t.baseFontFull),vp(e,t)}function uu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const i=e.measureText(n);return e.restore(),i}const cu=[];function vp(e,t){for(const o of cu)if(o.key===t)return o.val;const n=uu(e,"alphabetic"),r=-(uu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return cu.push({key:t,val:r}),r}function bp(e,t,n,i,r,o){const{ctx:a,rect:s,theme:l}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;a.globalAlpha=d,a.fillStyle=l.bgSearchResult,a.fillRect(s.x+1,s.y+1,s.width-(r?2:1),s.height-(o?2:1)),a.globalAlpha=1,i!==void 0&&(i.fillStyle=l.bgSearchResult)}return u<c}function vo(e,t,n){const{ctx:i,theme:r}=e,o=t??{},a=n??r.textDark;return a!==o.fillStyle&&(i.fillStyle=a,o.fillStyle=a),o}function Jc(e,t,n){const{rect:i,ctx:r,theme:o}=e;r.fillStyle=o.textDark,hr({ctx:r,rect:i,theme:o},t,n)}function Qc(e,t,n,i,r,o,a,s,l){l==="right"?e.fillText(t,n+r-(s.cellHorizontalPadding+.5),i+o/2+a):l==="center"?e.fillText(t,n+r/2,i+o/2+a):e.fillText(t,n+s.cellHorizontalPadding+.5,i+o/2+a)}function ed(e,t){const n=ii("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function wp(e,t){e.includes(`
|
50
|
+
`)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function yp(e,t,n,i,r,o,a,s,l,u){const c=s.baseFontFull,d=lp(e,t,c,r-s.cellHorizontalPadding*2,u??!1),f=ed(e,c),g=s.lineHeight*f,m=f+g*(d.length-1),p=m+s.cellVerticalPadding>o;p&&(e.save(),e.rect(n,i,r,o),e.clip());const b=i+o/2-m/2;let y=Math.max(i+s.cellVerticalPadding,b);for(const w of d)if(Qc(e,w,n,y,r,f,a,s,l),y+=g,y>i+o)break;p&&e.restore()}function hr(e,t,n,i,r){const{ctx:o,rect:a,theme:s}=e,{x:l,y:u,width:c,height:d}=a;i=i??!1,i||(t=wp(t,c));const f=vr(o,s),g=Js(t)==="rtl";if(n===void 0&&g&&(n="right"),g&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),i?yp(o,t,l,u,c,d,f,s,n,r):Qc(o,t,l,u,c,d,f,s,n),m&&(o.textAlign="start"),g&&(o.direction="inherit")}}function pr(e,t,n,i,r,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,r/2,i/2)),tr:Math.max(0,Math.min(o.tr,r/2,i/2)),bl:Math.max(0,Math.min(o.bl,r/2,i/2)),br:Math.max(0,Math.min(o.br,r/2,i/2))},e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Cp(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function Sp(e,t,n){const i=function(s,l){const u=l.x-s.x,c=l.y-s.y,d=Math.sqrt(u*u+c*c),f=u/d,g=c/d;return{x:u,y:l.y-s.y,len:d,nx:f,ny:g,ang:Math.atan2(g,f)}};let r;const o=t.length;let a=t[o-1];for(let s=0;s<o;s++){let l=t[s%o];const u=t[(s+1)%o],c=i(l,a),d=i(l,u),f=c.nx*d.ny-c.ny*d.nx,g=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(f<-1?-1:f>1?1:f),p=1,b=!1;g<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,b=!0):m>0&&(p=-1,b=!0),r=l.radius!==void 0?l.radius:n;const y=m/2;let w=Math.abs(Math.cos(y)*r/Math.sin(y)),S;w>Math.min(c.len/2,d.len/2)?(w=Math.min(c.len/2,d.len/2),S=Math.abs(w*Math.sin(y)/Math.cos(y))):S=r;let M=l.x+d.nx*w,C=l.y+d.ny*w;M+=-d.ny*S*p,C+=d.nx*S*p,e.arc(M,C,S,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,b),a=l,l=u}e.closePath()}function Ls(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m){const p={x:0,y:o+u,width:0,height:0};if(e>=g.length||t>=c||t<-2||e<0)return p;const b=o-r;if(e>=d){const y=a>e?-1:1,w=ki(g);p.x+=w+l;for(let S=a;S!==e;S+=y)p.x+=g[y===1?S:S-1].width*y}else for(let y=0;y<e;y++)p.x+=g[y].width;if(p.width=g[e].width+1,t===-1)p.y=r,p.height=b;else if(t===-2){p.y=0,p.height=r;let y=e;const w=g[e].group,S=g[e].sticky;for(;y>0&&so(g[y-1].group,w)&&g[y-1].sticky===S;){const C=g[y-1];p.x-=C.width,p.width+=C.width,y--}let M=e;for(;M+1<g.length&&so(g[M+1].group,w)&&g[M+1].sticky===S;){const C=g[M+1];p.width+=C.width,M++}if(!S){const C=ki(g),x=p.x-C;x<0&&(p.x-=x,p.width+=x),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-f){let y=c-t;for(p.y=i;y>0;){const w=t+y-1;p.height=typeof m=="number"?m:m(w),p.y-=p.height,y--}p.height+=1}else{const y=s>t?-1:1;if(typeof m=="number"){const w=t-s;p.y+=w*m}else for(let w=s;w!==t;w+=y)p.y+=m(w)*y;p.height=(typeof m=="number"?m:m(t))+1}return p}const tl=1<<21;function ar(e,t){return(t+2)*tl+e}function td(e){return e%tl}function nl(e){return Math.floor(e/tl)-2}function rl(e){const t=td(e),n=nl(e);return[t,n]}class nd{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=td(t),i=nl(t),r=this.visibleWindow,o=n>=r.x&&n<=r.x+r.width||n<this.freezeCols,a=i>=r.y&&i<=r.y+r.height||this.freezeRows.includes(i);return o&&a})}setWindow(t,n,i){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&xi(this.freezeRows,i)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=i,this.clearOutOfWindow())}}class xp extends nd{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,i)=>{this.cache.set(ar(n[0],n[1]),i)});ft(this,"getValue",n=>this.cache.get(ar(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class io{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>ar(n[0],n[1])))}add(t){this.cells.add(ar(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(ar(t[0],t[1]))}remove(t){this.cells.delete(ar(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(nl(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let i=t.x;i<t.x+t.width;i++)if(this.cells.has(ar(i,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield rl(t)}}function kp(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const rd={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4};function id(){return rd}const od=te.createContext(rd);function Mp(){return te.useContext(od)}function xr(e,...t){const n={...e};for(const i of t)if(i!==void 0)for(const r in i)i.hasOwnProperty(r)&&(r==="bgCell"?n[r]=Hn(i[r],n[r]):n[r]=i[r]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Fs=150;function Rp(e,t,n,i){var o;const r=i(t);return((o=r==null?void 0:r.measure)==null?void 0:o.call(r,e,t,n))??Fs}function ad(e,t,n,i,r,o,a,s,l){let u=0;const c=r===void 0?[]:r.map(f=>{const g=Rp(e,f[i],t,l);return u=Math.max(u,g),g});if(c.length>5&&s){u=0;let f=0;for(const m of c)f+=m;const g=f/c.length;for(let m=0;m<c.length;m++)c[m]>=g*2?c[m]=0:u=Math.max(u,c[m])}u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const d=Math.max(Math.ceil(o),Math.min(Math.floor(a),Math.ceil(u)));return{...n,width:d}}function Ep(e,t,n,i,r,o,a,s,l){const u=h.useRef(t),c=h.useRef(n),d=h.useRef(a);u.current=t,c.current=n,d.current=a;const[f,g]=h.useMemo(()=>{if(typeof window>"u")return[null,null];const w=document.createElement("canvas");return w.style.display="none",w.style.opacity="0",w.style.position="fixed",[w,w.getContext("2d",{alpha:!1})]},[]);h.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f==null||f.remove()}),[f]);const m=h.useRef({}),p=h.useRef(),[b,y]=h.useState();return h.useLayoutEffect(()=>{const w=c.current;if(w===void 0||e.every(No))return;let S=Math.max(1,10-Math.floor(e.length/1e4)),M=0;S<u.current&&S>1&&(S--,M=1);const C={x:0,y:0,width:e.length,height:Math.min(u.current,S)},x={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=w(C,l.signal),E=M>0?w(x,l.signal):void 0;let L;typeof I=="object"?L=I:L=await Ul(I),E!==void 0&&(typeof E=="object"?L=[...L,...E]:L=[...L,...await Ul(E)]),p.current=e,y(L)})()},[l.signal,e]),h.useMemo(()=>{let S=e.every(No)?e:g===null?e.map(R=>No(R)?R:{...R,width:Fs}):(g.font=d.current.baseFontFull,e.map((R,I)=>{if(No(R))return R;if(m.current[R.id]!==void 0)return{...R,width:m.current[R.id]};if(b===void 0||p.current!==e||R.id===void 0)return{...R,width:Fs};const E=ad(g,a,R,I,b,r,o,!0,s);return m.current[R.id]=E.width,E})),M=0,C=0;const x=[];for(const[R,I]of S.entries())M+=I.width,I.grow!==void 0&&I.grow>0&&(C+=I.grow,x.push(R));if(M<i&&x.length>0){const R=[...S],I=i-M;let E=I;for(let L=0;L<x.length;L++){const z=x[L],_=(S[z].grow??0)/C,F=L===x.length-1?E:Math.min(E,Math.floor(I*_));R[z]={...S[z],growOffset:F,width:S[z].width+F},E-=F}S=R}return{sizedColumns:S,nonGrowWidth:M}},[i,e,g,b,a,r,o,s])}function Ip(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}var Tp=Ip,Dp=Tp,cs=hc;function Op(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=cs(n),n=n===n?n:0),t!==void 0&&(t=cs(t),t=t===t?t:0),Dp(cs(e),t,n)}var Pp=Op;const Xn=Mi(Pp);function _p(){}var Lp=_p,ds=Kf,Fp=Lp,Ap=gc,Hp=1/0,zp=ds&&1/Ap(new ds([,-0]))[1]==Hp?function(e){return new ds(e)}:Fp,$p=zp,Vp=Zf,Np=Jf,Bp=Qf,Wp=eh,Up=$p,Xp=gc,Yp=200;function Gp(e,t,n){var i=-1,r=Np,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=Bp;else if(o>=Yp){var u=t?null:Up(e);if(u)return Xp(u);a=!1,r=Wp,l=new Vp}else l=t?[]:s;e:for(;++i<o;){var c=e[i],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else r(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var jp=Gp,qp=jp;function Kp(e){return e&&e.length?qp(e):[]}var Zp=Kp;const Jp=Mi(Zp),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',Qp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
51
51
|
${Yt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},e0=e=>{const t=e.fgColor,n=e.bgColor;return`
|
52
52
|
${Yt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},t0=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
53
53
|
<path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
|
@@ -162,18 +162,18 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
|
|
162
162
|
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
163
163
|
<path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
164
164
|
</svg>
|
165
|
-
`},E0={headerRowID:Qp,headerNumber:t0,headerCode:e0,headerString:n0,headerBoolean:r0,headerAudioUri:o0,headerVideoUri:a0,headerEmoji:s0,headerImage:l0,headerUri:sd,headerPhone:u0,headerMarkdown:c0,headerDate:d0,headerTime:f0,headerEmail:h0,headerReference:g0,headerIfThenElse:m0,headerSingleValue:p0,headerLookup:v0,headerTextTemplate:b0,headerMath:w0,headerRollup:y0,headerJoinStrings:C0,headerSplitString:S0,headerGeoDistance:x0,headerArray:k0,rowOwnerOverlay:M0,protectedColumnOverlay:R0,renameIcon:i0};function I0(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class T0{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,i,r,o,a,s,l=1){const[u,c]=I0(n,s),d=a*Math.ceil(window.devicePixelRatio),f=`${u}_${c}_${d}_${t}`;let g=this.spriteMap.get(f);if(g===void 0){const m=this.headerIcons[t];if(m===void 0)return;g=document.createElement("canvas");const p=g.getContext("2d");if(p===null)return;const b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(f,g);const y=b.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{p.drawImage(b,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(i.globalAlpha=l),i.drawImage(g,0,0,d,d,r,o,a,a),l<1&&(i.globalAlpha=1)}}function ld(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Fa(e,t,n,i,r,o,a,s,l){s=s??t;let u=t,c=e;const d=i-o;let f=!1;for(;u<n&&c<d;){const g=r(c);if(u+g>s&&l(u,c,g,!1,a&&c===i-1)===!0){f=!0;break}u+=g,c++}if(!f){u=n;for(let g=0;g<o;g++){c=i-1-g;const m=r(c);u-=m,l(u,c,m,!0,a&&c===i-1)}}}function Vr(e,t,n,i,r,o){let a=0,s=0;const l=r+i;for(const u of e){const c=u.sticky?s:a+n;if(o(u,c,l,u.sticky?0:s,t)===!0)break;a+=u.width,s+=u.sticky?u.width:0}}function ud(e,t,n,i,r){let o=0,a=0;for(let s=0;s<e.length;s++){const l=e[s];let u=s+1,c=l.width;for(l.sticky&&(a+=c);u<e.length&&so(e[u].group,l.group)&&e[u].sticky===e[s].sticky;){const p=e[u];c+=p.width,u++,s++,p.sticky&&(a+=p.width)}const d=l.sticky?0:n,f=o+d,g=l.sticky?0:Math.max(0,a-f),m=Math.min(c-g,t-(f+g));r([l.sourceIndex,e[u-1].sourceIndex],l.group??"",f+g,0,m,i),o+=c}}function cd(e,t,n,i,r,o,a){var f;const[s,l]=e;let u,c;const d=((f=a.find(g=>!g.sticky))==null?void 0:f.sourceIndex)??0;if(l>d){const g=Math.max(s,d);let m=t,p=i;for(let b=o.sourceIndex-1;b>=g;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=l;b++)p+=a[b].width;c={x:m,y:n,width:p,height:r}}if(d>s){const g=Math.min(l,d-1);let m=t,p=i;for(let b=o.sourceIndex-1;b>=s;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=g;b++)p+=a[b].width;u={x:m,y:n,width:p,height:r}}return[u,c]}function D0(e,t,n,i){if(i==="any")return dd(e,{x:t,y:n,width:1,height:1});if(i==="vertical"&&(t=e.x),i==="horizontal"&&(n=e.y),Gc([t,n],e))return;const r=t-e.x,o=e.x+e.width-t,a=n-e.y+1,s=e.y+e.height-n,l=Math.min(i==="vertical"?Number.MAX_SAFE_INTEGER:r,i==="vertical"?Number.MAX_SAFE_INTEGER:o,i==="horizontal"?Number.MAX_SAFE_INTEGER:a,i==="horizontal"?Number.MAX_SAFE_INTEGER:s);return l===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===a?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{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 lo(e,t,n,i,r,o,a,s){return e<=r+a&&r<=e+n&&t<=o+s&&o<=t+i}function ei(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function dd(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-i;return{x:n,y:i,width:r,height:o}}function O0(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 P0(e,t,n,i){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const r=-4,o=-4,a=t+4,s=n+4,l=r-e.x,u=e.x+e.width-a,c=o-e.y,d=e.y+e.height-s,f=l>0?e.x+Math.floor(l/i)*i:e.x,g=u>0?e.x+e.width-Math.floor(u/i)*i:e.x+e.width,m=c>0?e.y+Math.floor(c/i)*i:e.y,p=d>0?e.y+e.height-Math.floor(d/i)*i:e.y+e.height;return{x:f,y:m,width:g-f,height:p-m}}function _0(e,t,n,i,r){const[o,a,s,l]=t,[u,c,d,f]=r,{x:g,y:m,width:p,height:b}=e,y=[];if(p<=0||b<=0)return y;const w=g+p,S=m+b,M=g<o,C=m<a,x=g+p>s,R=m+b>l,I=g>=o&&g<s||w>o&&w<=s||g<o&&w>s,E=m>=a&&m<l||S>a&&S<=l||m<a&&S>l;if(I&&E){const z=Math.max(g,o),_=Math.max(m,a),F=Math.min(w,s),P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:c,width:d-u+1,height:f-c+1}})}if(M&&C){const z=g,_=m,F=Math.min(w,o),P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:0,width:u+1,height:c+1}})}if(C&&I){const z=Math.max(g,o),_=m,F=Math.min(w,s),P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(C&&x){const z=Math.max(g,s),_=m,F=w,P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(M&&E){const z=g,_=Math.max(m,a),F=Math.min(w,o),P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:c,width:u+1,height:f-c+1}})}if(x&&E){const z=Math.max(g,s),_=Math.max(m,a),F=w,P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:c,width:n-d+1,height:f-c+1}})}if(M&&R){const z=g,_=Math.max(m,l),F=Math.min(w,o),P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:f,width:u+1,height:i-f+1}})}if(R&&I){const z=Math.max(g,o),_=Math.max(m,l),F=Math.min(w,s),P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:f,width:d-u+1,height:i-f+1}})}if(x&&R){const z=Math.max(g,s),_=Math.max(m,l),F=w,P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:f,width:n-d+1,height:i-f+1}})}return y}const L0={kind:Z.Loading,allowOverlay:!1};function du(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w,S,M,C,x,R,I,E,L,z,_,F,P,ne,Q,oe,de){let xe=(S==null?void 0:S.size)??Number.MAX_SAFE_INTEGER;const ae=performance.now();let G=F.baseFontFull;e.font=G;const se={ctx:e},ie=[0,0],be=b>0?ri(l,b,u):0;let we,j;const O=ld(w);return Vr(t,s,o,a,r,(k,N,re,Oe,Ve)=>{const he=Math.max(0,Oe-N),tt=N+he,ke=r+1,Dt=k.width-he,bt=i-r-1;if(w.length>0){let De=!1;for(let Ae=0;Ae<w.length;Ae++){const nt=w[Ae];if(lo(tt,ke,Dt,bt,nt.x,nt.y,nt.width,nt.height)){De=!0;break}}if(!De)return}const rt=()=>{e.save(),e.beginPath(),e.rect(tt,ke,Dt,bt),e.clip()},J=M.columns.hasIndex(k.sourceIndex),it=d(k.group??"").overrideTheme,ce=k.themeOverride===void 0&&it===void 0?F:xr(F,it,k.themeOverride),le=ce.baseFontFull;le!==G&&(G=le,e.font=le),rt();let me;return Fa(Ve,re,i,l,u,b,y,O,(De,Ae,nt,ge,Re)=>{var gn,vn,hn;if(Ae<0||(ie[0]=k.sourceIndex,ie[1]=Ae,S!==void 0&&!S.has(ie)))return;if(w.length>0){let ot=!1;for(let Gt=0;Gt<w.length;Gt++){const At=w[Gt];if(lo(N,De,k.width,nt,At.x,At.y,At.width,At.height)){ot=!0;break}}if(!ot)return}const lt=M.rows.hasIndex(Ae),He=g.hasIndex(Ae),et=Ae<l?c(ie):L0;let wt=N,dt=k.width,ze=!1,Pt=!1;if(et.span!==void 0){const[ot,Gt]=et.span,At=`${Ae},${ot},${Gt},${k.sticky}`;if(j===void 0&&(j=new Set),j.has(At)){xe--;return}else{const on=cd(et.span,N,De,k.width,nt,k,n),It=k.sticky?on[0]:on[1];if(!k.sticky&&on[0]!==void 0&&(Pt=!0),It!==void 0){wt=It.x,dt=It.width,j.add(At),e.restore(),me=void 0,e.save(),e.beginPath();const $t=Math.max(0,Oe-It.x);e.rect(It.x+$t,De,It.width-$t,nt),we===void 0&&(we=[]),we.push({x:It.x+$t,y:De,width:It.width-$t,height:nt}),e.clip(),ze=!0}}}const _t=f==null?void 0:f(Ae),mt=Re&&((gn=k.trailingRowOptions)==null?void 0:gn.themeOverride)!==void 0?(vn=k.trailingRowOptions)==null?void 0:vn.themeOverride:void 0,Lt=et.themeOverride===void 0&&_t===void 0&&mt===void 0?ce:xr(ce,_t,mt,et.themeOverride);e.beginPath();const rn=dp(ie,et,M);let zt=fp(ie,et,M,p);const Cn=et.span!==void 0&&M.columns.some(ot=>et.span!==void 0&&ot>=et.span[0]&&ot<=et.span[1]);rn&&!m&&p?zt=0:rn&&p&&(zt=Math.max(zt,1)),Cn&&zt++,rn||(lt&&zt++,J&&!Re&&zt++);const Ut=et.kind===Z.Protected?Lt.bgCellMedium:Lt.bgCell;let kt;if((ge||Ut!==F.bgCell)&&(kt=Hn(Ut,kt)),zt>0||He){He&&(kt=Hn(Lt.bgHeader,kt));for(let ot=0;ot<zt;ot++)kt=Hn(Lt.accentLight,kt)}else if(C!==void 0){for(const ot of C)if(ot[0]===k.sourceIndex&&ot[1]===Ae){kt=Hn(Lt.bgSearchResult,kt);break}}if(x!==void 0)for(let ot=0;ot<x.length;ot++){const Gt=x[ot],At=Gt.range;Gt.style!=="solid-outline"&&At.x<=k.sourceIndex&&k.sourceIndex<At.x+At.width&&At.y<=Ae&&Ae<At.y+At.height&&(kt=Hn(Gt.color,kt))}let Pn=!1;if(S!==void 0){const ot=De+1,At=(ge?ot+nt-1:Math.min(ot+nt-1,i-be))-ot;(At!==nt-1||wt+1<=Oe)&&(Pn=!0,e.save(),e.beginPath(),e.rect(wt+1,ot,dt-1,At),e.clip()),kt=kt===void 0?Lt.bgCell:Hn(kt,Lt.bgCell)}const Sn=k.sourceIndex===n.length-1,Pe=Ae===l-1;kt!==void 0&&(e.fillStyle=kt,me!==void 0&&(me.fillStyle=kt),S!==void 0?e.fillRect(wt+1,De+1,dt-(Sn?2:1),nt-(Pe?2:1)):e.fillRect(wt,De,dt,nt)),et.style==="faded"&&(e.globalAlpha=.6);let Ft;for(let ot=0;ot<E.length;ot++){const Gt=E[ot];if(Gt.item[0]===k.sourceIndex&&Gt.item[1]===Ae){Ft=Gt;break}}if(dt>de&&!Pt){const ot=Lt.baseFontFull;ot!==G&&(e.font=ot,G=ot),me=fd(e,et,k.sourceIndex,Ae,Sn,Pe,wt,De,dt,nt,zt>0,Lt,kt??Lt.bgCell,R,I,(Ft==null?void 0:Ft.hoverAmount)??0,L,_,ae,z,me,P,ne,Q,oe)}return Pn&&e.restore(),et.style==="faded"&&(e.globalAlpha=1),xe--,ze&&(e.restore(),(hn=me==null?void 0:me.deprep)==null||hn.call(me,se),me=void 0,rt(),G=le,e.font=le),xe<=0}),e.restore(),xe<=0}),we}const Ui=[0,0],Xi={x:0,y:0,width:0,height:0},fs=[void 0,()=>{}];let As=!1;function F0(){As=!0}function fd(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w,S,M,C,x,R,I){var ne,Q;let E,L;b!==void 0&&b[0][0]===n&&b[0][1]===i&&(E=b[1][0],L=b[1][1]);let z;Ui[0]=n,Ui[1]=i,Xi.x=a,Xi.y=s,Xi.width=l,Xi.height=u,fs[0]=x.getValue(Ui),fs[1]=oe=>x.setValue(Ui,oe),As=!1;const _={ctx:e,theme:d,col:n,row:i,cell:t,rect:Xi,highlighted:c,cellFillColor:f,hoverAmount:p,frameTime:w,hoverX:E,drawState:fs,hoverY:L,imageLoader:g,spriteManager:m,hyperWrapping:y,overrideCursor:E!==void 0?I:void 0,requestAnimationFrame:F0},F=bp(_,t.lastUpdated,w,M,r,o),P=R(t);if(P!==void 0){(M==null?void 0:M.renderer)!==P&&((ne=M==null?void 0:M.deprep)==null||ne.call(M,_),M=void 0);const oe=(Q=P.drawPrep)==null?void 0:Q.call(P,_,M);S!==void 0&&!wi(_.cell)?S(_,()=>P.draw(_,t)):P.draw(_,t),z=oe===void 0?void 0:{deprep:oe==null?void 0:oe.deprep,fillStyle:oe==null?void 0:oe.fillStyle,font:oe==null?void 0:oe.font,renderer:P}}return(F||As)&&(C==null||C(Ui)),z}function il(e,t,n,i,r,o,a,s,l=-20,u=-20,c=32,d="center",f="square"){const g=Math.floor(r+a/2),m=f==="circle"?1e4:t.roundingRadius??4;let p=Hc(c,a,t.cellVerticalPadding),b=p/2;const y=Ac(d,i,o,t.cellHorizontalPadding,p),w=Fc(y,g,p),S=zc(i+l,r+u,w);switch(n){case!0:{e.beginPath(),mr(e,y-p/2,g-p/2,p,p,m),f==="circle"&&(b*=.8,p*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-b+p/4.23,g-b+p/1.97),e.lineTo(y-b+p/2.42,g-b+p/1.44),e.lineTo(y-b+p/1.29,g-b+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ca:case!1:{e.beginPath(),mr(e,y-p/2+.5,g-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=S?t.textDark:t.textMedium,e.stroke();break}case Ys:{e.beginPath(),mr(e,y-p/2,g-p/2,p,p,m),e.fillStyle=S?t.textMedium:t.textLight,e.fill(),f==="circle"&&(b*=.8,p*=.8),e.beginPath(),e.moveTo(y-p/3,g),e.lineTo(y+p/3,g),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:ao()}}function A0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){var E,L,z,_;const S=a+s;if(S<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,r,S);const M=(E=i==null?void 0:i[0])==null?void 0:E[0],C=(L=i==null?void 0:i[0])==null?void 0:L[1],x=(z=i==null?void 0:i[1])==null?void 0:z[0],R=(_=i==null?void 0:i[1])==null?void 0:_[1],I=d.headerFontFull;e.font=I,Vr(t,0,o,0,S,(F,P,ne,Q)=>{var k;if(b!==void 0&&!b.has([F.sourceIndex,-1]))return;const oe=Math.max(0,Q-P);e.save(),e.beginPath(),e.rect(P+oe,s,F.width-oe,a),e.clip();const de=p(F.group??"").overrideTheme,xe=F.themeOverride===void 0&&de===void 0?d:xr(d,de,F.themeOverride);xe.bgHeader!==d.bgHeader&&(e.fillStyle=xe.bgHeader,e.fill()),xe!==d&&(e.font=xe.baseFontFull);const ae=c.columns.hasIndex(F.sourceIndex),G=l!==void 0||u,se=!G&&C===-1&&M===F.sourceIndex,ie=G?0:((k=g.find(N=>N.item[0]===F.sourceIndex&&N.item[1]===-1))==null?void 0:k.hoverAmount)??0,be=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===F.sourceIndex,we=ae?xe.accentColor:be?xe.bgHeaderHasFocus:xe.bgHeader,j=n?s:0,O=F.sourceIndex===0?0:1;ae?(e.fillStyle=we,e.fillRect(P+O,j,F.width-O,a)):(be||ie>0)&&(e.beginPath(),e.rect(P+O,j,F.width-O,a),be&&(e.fillStyle=xe.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=xe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),md(e,P,j,F.width,a,F,ae,xe,se,se?x:void 0,se?R:void 0,be,ie,f,y,w),e.restore()}),n&&H0(e,t,r,o,s,i,d,f,g,m,p,b)}function H0(e,t,n,i,r,o,a,s,l,u,c,d){const[g,m]=(o==null?void 0:o[0])??[];let p=0;ud(t,n,i,r,(b,y,w,S,M,C)=>{if(d!==void 0&&!d.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(w,S,M,C),e.clip();const x=c(y),R=(x==null?void 0:x.overrideTheme)===void 0?a:xr(a,x.overrideTheme),I=m===-2&&g!==void 0&&g>=b[0]&&g<=b[1],E=I?R.bgHeaderHovered:R.bgHeader;if(E!==a.bgHeader&&(e.fillStyle=E,e.fill()),e.fillStyle=R.textGroupHeader??R.textHeader,x!==void 0){let L=w;if(x.icon!==void 0&&(s.drawSprite(x.icon,"normal",e,L+8,(r-20)/2,20,R),L+=26),e.fillText(x.name,L+8,r/2+pr(e,a.headerFontFull)),x.actions!==void 0&&I){const z=hd({x:w,y:S,width:M,height:C},x.actions);e.beginPath();const _=z[0].x-10,F=w+M-_;e.rect(_,0,F,r);const P=e.createLinearGradient(_,0,_+F,0),ne=ti(E,0);P.addColorStop(0,ne),P.addColorStop(10/F,E),P.addColorStop(1,E),e.fillStyle=P,e.fill(),e.globalAlpha=.6;const[Q,oe]=(o==null?void 0:o[1])??[-1,-1];for(let de=0;de<x.actions.length;de++){const xe=x.actions[de],ae=z[de],G=ei(ae,Q+w,oe);G&&(e.globalAlpha=1),s.drawSprite(xe.icon,"normal",e,ae.x+ae.width/2-10,ae.y+ae.height/2-10,20,R),G&&(e.globalAlpha=.6)}e.globalAlpha=1}}w!==0&&u(b[0])&&(e.beginPath(),e.moveTo(w+.5,0),e.lineTo(w+.5,r),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=w+M}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,r),e.moveTo(0,r+.5),e.lineTo(n,r+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const Go=30;function z0(e,t,n,i,r){return{x:e+n-Go,y:Math.max(t,t+i/2-Go/2),width:Go,height:Math.min(Go,i)}}function hd(e,t){const n=[];let i=e.x+e.width-26*t.length;const r=e.y+e.height/2-13,o=26,a=26;for(let s=0;s<t.length;s++)n.push({x:i,y:r,width:a,height:o}),i+=26;return n}function Yi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function gd(e,t,n,i,r,o,a,s){var y;const l=a.cellHorizontalPadding,u=a.headerIconSize,c=z0(n,i,r,o);let d=n+l;const f=t.icon===void 0?void 0:{x:d,y:i+(o-u)/2,width:u,height:u},g=f===void 0||t.overlayIcon===void 0?void 0:{x:f.x+9,y:f.y+6,width:18,height:18};f!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:i,width:r-d,height:o};let p;if(t.indicatorIcon!==void 0){const w=e===void 0?((y=Zc(t.title,a.headerFontFull))==null?void 0:y.width)??0:ii(t.title,e,a.headerFontFull).width;m.width=w,d+=w+l,p={x:d,y:i+(o-u)/2,width:u,height:u}}const b=n+r/2;return{menuBounds:Yi(c,b,s),iconBounds:Yi(f,b,s),iconOverlayBounds:Yi(g,b,s),textBounds:Yi(m,b,s),indicatorIconBounds:Yi(p,b,s)}}function fu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const w=o.rowMarkerChecked;w!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const S=o.headerRowMarkerTheme!==void 0?xr(s,o.headerRowMarkerTheme):s;il(e,S,w,t,n,i,r,!1,void 0,void 0,18,"center",o.rowMarker),w!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=a?s.textHeaderSelected:s.textHeader,y=o.hasMenu===!0&&(l||g&&a)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let w=a?"selected":"normal";o.style==="highlight"&&(w=a?"selected":"special"),f.drawSprite(o.icon,w,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,s),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&f.drawSprite(o.overlayIcon,a?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,s)}if(y&&i>35){const S=m?35:i-35,M=m?35*.7:i-35*.7,C=S/i,x=M/i,R=e.createLinearGradient(t,0,t+i,0),I=ti(b,0);R.addColorStop(m?1:0,b),R.addColorStop(C,b),R.addColorStop(x,I),R.addColorStop(m?0:1,I),e.fillStyle=R}else e.fillStyle=b;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+r/2+pr(e,s.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!y||!lo(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let w=a?"selected":"normal";o.style==="highlight"&&(w=a?"selected":"special"),f.drawSprite(o.indicatorIcon,w,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,s)}if(y&&p.menuBounds!==void 0){const w=p.menuBounds,S=u!==void 0&&c!==void 0&&ei(w,u+t,c+n);if(S||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===da.Triangle){e.beginPath();const M=w.x+w.width/2-5.5,C=w.y+w.height/2-3;Sp(e,[{x:M,y:C},{x:M+11,y:C},{x:M+5.5,y:C+6}],1),e.fillStyle=b,e.fill()}else if(o.menuIcon===da.Dots){e.beginPath();const M=w.x+w.width/2,C=w.y+w.height/2;Cp(e,M,C),e.fillStyle=b,e.fill()}else{const M=w.x+(w.width-s.headerIconSize)/2,C=w.y+(w.height-s.headerIconSize)/2;f.drawSprite(o.menuIcon,"normal",e,M,C,s.headerIconSize,s)}S||(e.globalAlpha=1)}}function md(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){const b=Js(o.title)==="rtl",y=gd(e,o,t,n,i,r,s,b);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:i,height:r},column:o,columnIndex:o.sourceIndex,isSelected:a,hoverAmount:f,isHovered:l,hasSelectedCell:d,spriteManager:g,menuBounds:(y==null?void 0:y.menuBounds)??{x:0,y:0,height:0,width:0}},()=>fu(e,t,n,i,r,o,a,s,l,u,c,f,g,p,b,y)):fu(e,t,n,i,r,o,a,s,l,u,c,f,g,p,b,y)}function $0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const S=ld(b);Vr(t,l,a,s,o,(M,C,x,R,I)=>{if(M!==t[t.length-1])return;C+=M.width;const E=Math.max(C,R);E>i||(e.save(),e.beginPath(),e.rect(E,o+1,1e4,r-o-1),e.clip(),Fa(I,x,r,u,c,m,p,S,(L,z,_,F)=>{if(!F&&b.length>0&&!b.some(de=>lo(C,L,1e4,_,de.x,de.y,de.width,de.height)))return;const P=f.hasIndex(z),ne=g.hasIndex(z);e.beginPath();const Q=d==null?void 0:d(z),oe=Q===void 0?w:xr(w,Q);oe.bgCell!==w.bgCell&&(e.fillStyle=oe.bgCell,e.fillRect(C,L,1e4,_)),ne&&(e.fillStyle=oe.bgHeader,e.fillRect(C,L,1e4,_)),P&&(e.fillStyle=oe.accentLight,e.fillRect(C,L,1e4,_))}),e.restore())})}function V0(e,t,n,i,r,o,a,s,l){let u=!1;for(const m of t)if(!m.sticky){u=a(m.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,f=u?ki(t):0;let g;if(f!==0&&(g=su(d,l.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,i),e.strokeStyle=g,e.stroke()),r>0){const m=d===c&&g!==void 0?g:su(c,l.bgCell),p=ri(o,r,s);e.beginPath(),e.moveTo(0,i-p+.5),e.lineTo(n,i-p+.5),e.strokeStyle=m,e.stroke()}}const pd=(e,t,n)=>{let i=0,r=t,o=0,a=n;if(e!==void 0&&e.length>0){i=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const s of e)i=Math.min(i,s.x-1),r=Math.max(r,s.x+s.width+1),o=Math.min(o,s.y-1),a=Math.max(a,s.y+s.height+1)}return{minX:i,maxX:r,minY:o,maxY:a}};function N0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m){var _;const p=m.bgCell,{minX:b,maxX:y,minY:w,maxY:S}=pd(s,o,a),M=[],C=a-ri(g,f,u);let x=l,R=n,I=0;for(;x+r<C;){const F=x+r,P=u(R);if(F>=w&&F<=S-1){const ne=c==null?void 0:c(R),Q=ne==null?void 0:ne.bgCell;Q!==void 0&&Q!==p&&R>=g-f&&M.push({x:b,y:F,w:y-b,h:P,color:Q})}x+=P,R<g-f&&(I=x),R++}let E=0;const L=Math.min(C,S)-I;if(L>0)for(let F=0;F<t.length;F++){const P=t[F];if(P.width===0)continue;const ne=P.sticky?E:E+i,Q=(_=P.themeOverride)==null?void 0:_.bgCell;Q!==void 0&&Q!==p&&ne>=b&&ne<=y&&d(F+1)&&M.push({x:ne,y:I,w:P.width,h:L,color:Q}),E+=P.width}if(M.length===0)return;let z;e.beginPath();for(let F=M.length-1;F>=0;F--){const P=M[F];z===void 0?z=P.color:P.color!==z&&(e.fillStyle=z,e.fill(),e.beginPath(),z=P.color),e.rect(P.x,P.y,P.w,P.h)}z!==void 0&&(e.fillStyle=z,e.fill()),e.beginPath()}function hu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,a);for(const _ of l)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}const w=b.horizontalBorderColor??b.borderColor,S=b.borderColor,{minX:M,maxX:C,minY:x,maxY:R}=pd(s,o,a),I=[];e.beginPath();let E=.5;for(let _=0;_<t.length;_++){const F=t[_];if(F.width===0)continue;E+=F.width;const P=F.sticky?E:E+i;P>=M&&P<=C&&g(_+1)&&I.push({x1:P,y1:Math.max(u,x),x2:P,y2:Math.min(a,R),color:S})}let L=a+.5;for(let _=p-m;_<p;_++){const F=d(_);L-=F,I.push({x1:M,y1:L,x2:C,y2:L,color:w})}if(y!==!0){let _=c+.5,F=n;const P=L;for(;_+r<P;){const ne=_+r;if(ne>=x&&ne<=R-1){const Q=f==null?void 0:f(F);I.push({x1:M,y1:ne,x2:C,y2:ne,color:(Q==null?void 0:Q.horizontalBorderColor)??(Q==null?void 0:Q.borderColor)??w})}_+=d(F),F++}}const z=th(I,_=>_.color);for(const _ of Object.keys(z)){e.strokeStyle=_;for(const F of z[_])e.moveTo(F.x1,F.y1),e.lineTo(F.x2,F.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function B0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){const S=[];e.imageSmoothingEnabled=!1;const M=Math.min(r.cellYOffset,a),C=Math.max(r.cellYOffset,a);let x=0;if(typeof y=="number")x+=(C-M)*y;else for(let P=M;P<C;P++)x+=y(P);a>r.cellYOffset&&(x=-x),x+=l-r.translateY;const R=Math.min(r.cellXOffset,o),I=Math.max(r.cellXOffset,o);let E=0;for(let P=R;P<I;P++)E+=p[P].width;o>r.cellXOffset&&(E=-E),E+=s-r.translateX;const L=ki(b);if(E!==0&&x!==0)return{regions:[]};const z=u>0?ri(f,u,y):0,_=c-L-Math.abs(E),F=d-g-z-Math.abs(x)-1;if(_>150&&F>150){const P={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(x>0?(P.sy=(g+1)*m,P.sh=F*m,P.dy=(x+g+1)*m,P.dh=F*m,S.push({x:0,y:g,width:c,height:x+1})):x<0&&(P.sy=(-x+g+1)*m,P.sh=F*m,P.dy=(g+1)*m,P.dh=F*m,S.push({x:0,y:d+x-z,width:c,height:-x+z})),E>0?(P.sx=L*m,P.sw=_*m,P.dx=(E+L)*m,P.dw=_*m,S.push({x:L-1,y:0,width:E+2,height:d})):E<0&&(P.sx=(L-E)*m,P.sw=_*m,P.dx=L*m,P.dw=_*m,S.push({x:c+E,y:0,width:-E,height:d})),e.setTransform(1,0,0,1,0,0),w){if(L>0&&E!==0&&x===0&&(i===void 0||(n==null?void 0:n[1])!==!1)){const ne=L*m,Q=d*m;e.drawImage(t,0,0,ne,Q,0,0,ne,Q)}if(z>0&&E===0&&x!==0&&(i===void 0||(n==null?void 0:n[0])!==!1)){const ne=(d-z)*m,Q=c*m,oe=z*m;e.drawImage(t,0,ne,Q,oe,0,ne,Q,oe)}}e.drawImage(t,P.sx,P.sy,P.sw,P.sh,P.dx,P.dy,P.dw,P.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:S}}function W0(e,t,n,i,r,o,a,s,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||i!==e.translateX||r!==e.translateY||Vr(l,n,i,r,s,(d,f,g,m)=>{if(d.sourceIndex===u){const p=Math.max(f,m)+1;return c.push({x:p,y:0,width:o-p,height:a}),!0}}),c}function U0(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 n;for(let i=0;i<e.mappedColumns.length;i++){const r=e.mappedColumns[i],o=t.mappedColumns[i];if(xi(r,o))continue;if(n!==void 0||r.width===o.width)return!1;const{width:a,...s}=r,{width:l,...u}=o;if(!xi(s,u))return!1;n=i}return n===void 0?!0:n}return!0}function gu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){const b=m==null?void 0:m.filter(R=>R.style!=="no-outline");if(b===void 0||b.length===0)return;const y=ki(s),w=ri(g,f,d),S=[l,0,s.length,g-f],M=[y,0,t,n-w],C=b.map(R=>{const I=R.range,E=R.style??"dashed";return _0(I,S,t,n,M).map(L=>{const z=L.rect,_=Ls(z.x,z.y,t,n,c,u+c,i,r,o,a,g,l,f,s,d),F=z.width===1&&z.height===1?_:Ls(z.x+z.width-1,z.y+z.height-1,t,n,c,u+c,i,r,o,a,g,l,f,s,d);return z.x+z.width>=s.length&&(F.width-=1),z.y+z.height>=g&&(F.height-=1),{color:R.color,style:E,clip:L.clip,rect:P0({x:_.x,y:_.y,width:F.x+F.width-_.x,height:F.y+F.height-_.y},t,n,8)}})}),x=()=>{e.lineWidth=1;let R=!1;for(const I of C)for(const E of I)if((E==null?void 0:E.rect)!==void 0&&lo(0,0,t,n,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){const L=R,z=!O0(E.clip,E.rect);z&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!R?(e.setLineDash([5,3]),R=!0):(E.style==="solid"||E.style==="solid-outline")&&R&&(e.setLineDash([]),R=!1),e.strokeStyle=E.style==="solid-outline"?Hn(Hn(E.color,p.borderColor),p.bgCell):ti(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),z&&(e.restore(),R=L)}R&&e.setLineDash([])};return x(),x}function mu(e,t,n,i,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function hs(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b){if(c.current===void 0)return;const y=c.current.range,w=c.current.cell,S=[y.x+y.width-1,y.y+y.height-1];if(w[1]>=b&&S[1]>=b||!a.some(P=>P.sourceIndex===w[0]||P.sourceIndex===S[0]))return;const[C,x]=c.current.cell,R=f(c.current.cell),I=R.span??[C,C],E=x>=b-g,L=g>0&&!E?ri(b,g,d)-1:0,z=S[1];let _;if(Vr(a,i,r,o,u,(P,ne,Q,oe,de)=>{if(P.sticky&&C>P.sourceIndex)return;const xe=P.sourceIndex<I[0],ae=P.sourceIndex>I[1],G=P.sourceIndex===S[0];if(!(!G&&(xe||ae)))return Fa(de,Q,n,b,d,g,m,void 0,(se,ie,be)=>{if(ie!==x&&ie!==z)return;let we=ne,j=P.width;if(R.span!==void 0){const k=cd(R.span,ne,se,P.width,be,P,s),N=P.sticky?k[0]:k[1];N!==void 0&&(we=N.x,j=N.width)}return ie===z&&G&&p&&(_=()=>{var k;oe>we&&!P.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip()),e.beginPath(),e.rect(we+j-4,se+be-4,4,4),e.fillStyle=((k=P.themeOverride)==null?void 0:k.accentColor)??l.accentColor,e.fill()}),_!==void 0}),_!==void 0}),_===void 0)return;const F=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-L),e.clip(),_==null||_(),e.restore()};return F(),F}function X0(e,t,n,i,r,o,a,s,l){l===void 0||l.size===0||(e.beginPath(),ud(t,n,o,i,(u,c,d,f,g,m)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,f,g,m)}),Vr(t,s,o,a,r,(u,c,d,f)=>{const g=Math.max(0,f-c),m=c+g+1,p=u.width-g-1;l.has([u.sourceIndex,-1])&&e.rect(m,i,p,r-i)}),e.clip())}function Y0(e,t,n,i,r,o,a,s,l,u){let c=0;return Vr(e,o,i,r,n,(d,f,g,m,p)=>(Fa(p,g,t,a,s,l,u,void 0,(b,y,w,S)=>{S||(c=Math.max(y,c))}),!0)),c}function pu(e,t){var Sn;const{canvasCtx:n,headerCanvasCtx:i,width:r,height:o,cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:f,dragAndDropState:g,theme:m,drawFocus:p,headerHeight:b,groupHeaderHeight:y,disabledRows:w,rowHeight:S,verticalBorder:M,overrideCursor:C,isResizing:x,selection:R,fillHandle:I,freezeTrailingRows:E,rows:L,getCellContent:z,getGroupDetails:_,getRowThemeOverride:F,isFocused:P,drawHeaderCallback:ne,prelightCells:Q,drawCellCallback:oe,highlightRegions:de,resizeCol:xe,imageLoader:ae,lastBlitData:G,hoverValues:se,hyperWrapping:ie,hoverInfo:be,spriteManager:we,maxScaleFactor:j,hasAppendRow:O,touchMode:k,enqueue:N,renderStateProvider:re,getCellRenderer:Oe,renderStrategy:Ve,bufferACtx:he,bufferBCtx:tt,damage:ke,minimumCellWidth:Dt,resizeIndicator:bt}=e;if(r===0||o===0)return;const rt=Ve==="double-buffer",J=Math.min(j,Math.ceil(window.devicePixelRatio??1)),it=Ve!=="direct"&&U0(e,t),ce=n.canvas;(ce.width!==r*J||ce.height!==o*J)&&(ce.width=r*J,ce.height=o*J,ce.style.width=r+"px",ce.style.height=o+"px");const le=i.canvas,me=d?y+b:b,De=me+1;(le.width!==r*J||le.height!==De*J)&&(le.width=r*J,le.height=De*J,le.style.width=r+"px",le.style.height=De+"px");const Ae=he.canvas,nt=tt.canvas;rt&&(Ae.width!==r*J||Ae.height!==o*J)&&(Ae.width=r*J,Ae.height=o*J,G.current!==void 0&&(G.current.aBufferScroll=void 0)),rt&&(nt.width!==r*J||nt.height!==o*J)&&(nt.width=r*J,nt.height=o*J,G.current!==void 0&&(G.current.bBufferScroll=void 0));const ge=G.current;if(it===!0&&a===(ge==null?void 0:ge.cellXOffset)&&s===(ge==null?void 0:ge.cellYOffset)&&l===(ge==null?void 0:ge.translateX)&&u===(ge==null?void 0:ge.translateY))return;let Re=null;rt&&(Re=n);const lt=i;let He;rt?ke!==void 0?He=(ge==null?void 0:ge.lastBuffer)==="b"?tt:he:He=(ge==null?void 0:ge.lastBuffer)==="b"?he:tt:He=n;const et=He.canvas,wt=rt?et===Ae?nt:Ae:ce,dt=typeof S=="number"?()=>S:S;lt.save(),He.save(),lt.beginPath(),He.beginPath(),lt.textBaseline="middle",He.textBaseline="middle",J!==1&&(lt.scale(J,J),He.scale(J,J));const ze=_s(c,a,r,g,l);let Pt=[];const _t=p&&((Sn=R.current)==null?void 0:Sn.cell[1])===s&&u===0;let mt=!1;if(de!==void 0){for(const Pe of de)if(Pe.style!=="no-outline"&&Pe.range.y===s&&u===0){mt=!0;break}}const Lt=()=>{A0(lt,ze,d,be,r,l,b,y,g,x,R,m,we,se,M,_,ke,ne,k),hu(lt,ze,s,l,u,r,o,void 0,void 0,y,me,dt,F,M,E,L,m,!0),lt.beginPath(),lt.moveTo(0,De-.5),lt.lineTo(r,De-.5),lt.strokeStyle=Hn(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),lt.stroke(),mt&&gu(lt,r,o,a,s,l,u,c,f,b,y,S,E,L,de,m),_t&&hs(lt,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L)};if(ke!==void 0){const Pe=ze[ze.length-1].sourceIndex+1,Ft=ke.hasItemInRegion([{x:a,y:-2,width:Pe,height:2},{x:a,y:s,width:Pe,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:a,y:L-E,width:Pe,height:E,when:E>0}]),gn=vn=>{du(vn,ze,c,o,me,l,u,s,L,dt,z,_,F,w,P,p,E,O,Pt,ke,R,Q,de,ae,we,se,be,oe,ie,m,N,re,Oe,C,Dt);const hn=R.current;I&&p&&hn!==void 0&&ke.has(jc(hn.range))&&hs(vn,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L)};Ft&&(gn(He),Re!==null&&(Re.save(),Re.scale(J,J),Re.textBaseline="middle",gn(Re),Re.restore()),ke.hasHeader()&&(X0(lt,ze,r,y,me,l,u,s,ke),Lt())),He.restore(),lt.restore();return}if((it!==!0||a!==(ge==null?void 0:ge.cellXOffset)||l!==(ge==null?void 0:ge.translateX)||_t!==(ge==null?void 0:ge.mustDrawFocusOnHeader)||mt!==(ge==null?void 0:ge.mustDrawHighlightRingsOnHeader))&&Lt(),it===!0){An(wt!==void 0&&ge!==void 0);const{regions:Pe}=B0(He,wt,wt===Ae?ge.aBufferScroll:ge.bBufferScroll,wt===Ae?ge.bBufferScroll:ge.aBufferScroll,ge,a,s,l,u,E,r,o,L,me,J,c,ze,S,rt);Pt=Pe}else it!==!1&&(An(ge!==void 0),Pt=W0(ge,a,s,l,u,r,o,me,ze,it));V0(He,ze,r,o,E,L,M,dt,m);const rn=gu(He,r,o,a,s,l,u,c,f,b,y,S,E,L,de,m),zt=p?hs(He,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L):void 0;if(He.fillStyle=m.bgCell,Pt.length>0){He.beginPath();for(const Pe of Pt)He.rect(Pe.x,Pe.y,Pe.width,Pe.height);He.clip(),He.fill(),He.beginPath()}else He.fillRect(0,0,r,o);const Cn=du(He,ze,c,o,me,l,u,s,L,dt,z,_,F,w,P,p,E,O,Pt,ke,R,Q,de,ae,we,se,be,oe,ie,m,N,re,Oe,C,Dt);$0(He,ze,c,r,o,me,l,u,s,L,dt,F,R.rows,w,E,O,Pt,ke,m),N0(He,ze,s,l,u,r,o,Pt,me,dt,F,M,E,L,m),hu(He,ze,s,l,u,r,o,Pt,Cn,y,me,dt,F,M,E,L,m),rn==null||rn(),zt==null||zt(),x&&bt!=="none"&&Vr(ze,0,l,0,me,(Pe,Ft)=>Pe.sourceIndex===xe?(mu(lt,Ft+Pe.width,0,me+1,Hn(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),bt==="full"&&mu(He,Ft+Pe.width,me,o,Hn(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Re!==null&&(Re.fillStyle=m.bgCell,Re.fillRect(0,0,r,o),Re.drawImage(He.canvas,0,0));const Ut=Y0(ze,o,me,l,u,s,L,dt,E,O);ae==null||ae.setWindow({x:a,y:s,width:ze.length,height:Ut-s},f,Array.from({length:E},(Pe,Ft)=>L-1-Ft));const kt=ge!==void 0&&(a!==ge.cellXOffset||l!==ge.translateX),Pn=ge!==void 0&&(s!==ge.cellYOffset||u!==ge.translateY);G.current={cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mustDrawFocusOnHeader:_t,mustDrawHighlightRingsOnHeader:mt,lastBuffer:rt?et===Ae?"a":"b":void 0,aBufferScroll:et===Ae?[kt,Pn]:ge==null?void 0:ge.aBufferScroll,bBufferScroll:et===nt?[kt,Pn]:ge==null?void 0:ge.bBufferScroll},He.restore(),lt.restore()}const G0=80;function j0(e){const t=e-1;return t*t*t+1}class q0{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(i=>no(i.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(i=>no(i.item,t));return this.leavingItems=this.leavingItems.filter(i=>i!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:j0(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const i=(t-this.lastAnimationTime)/G0;for(const o of this.leavingItems)o.hoverAmount=Xn(o.hoverAmount-i,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Xn(this.currentHoveredItem.hoverAmount+i,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!no((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const i=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:i}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class K0{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ol(e){return new K0(e)}const Z0=ol(()=>window.navigator.userAgent.includes("Firefox")),ba=ol(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),wa=ol(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function J0(e){const t=h.useRef([]),n=h.useRef(0),i=h.useRef(e);i.current=e;const r=h.useCallback(()=>{const o=()=>window.requestAnimationFrame(a),a=()=>{const s=t.current.map(rl);t.current=[],i.current(new io(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:a)},[]);return h.useCallback(o=>{t.current.length===0&&r();const a=or(o[0],o[1]);t.current.includes(a)||t.current.push(a)},[r])}const Ar="header",Gn="group-header",ya="out-of-bounds";var Ci;(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"})(Ci||(Ci={}));function vd(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])}const vu=6,Q0=(e,t)=>{if(e.kind===Z.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},ev=(e,t)=>{const{width:n,height:i,accessibilityHeight:r,columns:o,cellXOffset:a,cellYOffset:s,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:f,getCellContent:g,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:b,enableGroups:y,isFilling:w,onCanvasFocused:S,onCanvasBlur:M,isFocused:C,selection:x,freezeColumns:R,onContextMenu:I,freezeTrailingRows:E,fixedShadowX:L=!0,fixedShadowY:z=!0,drawFocusRing:_,onMouseDown:F,onMouseUp:P,onMouseMoveRaw:ne,onMouseMove:Q,onItemHovered:oe,dragAndDropState:de,firstColAccessible:xe,onKeyDown:ae,onKeyUp:G,highlightRegions:se,canvasRef:ie,onDragStart:be,onDragEnd:we,eventTargetRef:j,isResizing:O,resizeColumn:k,isDragging:N,isDraggable:re=!1,allowResize:Oe,disabledRows:Ve,hasAppendRow:he,getGroupDetails:tt,theme:ke,prelightCells:Dt,headerIcons:bt,verticalBorder:rt,drawCell:J,drawHeader:it,onCellFocused:ce,onDragOverCell:le,onDrop:me,onDragLeave:De,imageWindowLoader:Ae,smoothScrollX:nt=!1,smoothScrollY:ge=!1,experimental:Re,getCellRenderer:lt,resizeIndicator:He="full"}=e,et=e.translateX??0,wt=e.translateY??0,dt=Math.max(R,Math.min(o.length-1,a)),ze=h.useRef(null),Pt=h.useRef(window),_t=Pt.current,mt=Ae,Lt=h.useRef(),[rn,zt]=h.useState(!1),Cn=h.useRef([]),Ut=h.useRef(),[kt,Pn]=h.useState(),[Sn,Pe]=h.useState(),Ft=h.useRef(null),[gn,vn]=h.useState(),[hn,ot]=h.useState(!1),Gt=h.useRef(hn);Gt.current=hn;const At=h.useMemo(()=>new T0(bt,()=>{xn.current=void 0,$n.current()}),[bt]),on=y?c+l:l,It=h.useRef(-1),$t=((Re==null?void 0:Re.enableFirefoxRescaling)??!1)&&Z0.value,Ge=((Re==null?void 0:Re.enableSafariRescaling)??!1)&&ba.value;h.useLayoutEffect(()=>{window.devicePixelRatio===1||!$t&&!Ge||(It.current!==-1&&zt(!0),window.clearTimeout(It.current),It.current=window.setTimeout(()=>{zt(!1),It.current=-1},200))},[s,dt,et,wt,$t,Ge]);const Nt=up(o,R),Bt=L?ki(Nt,de):0,fe=h.useCallback((H,ee,ye)=>{const Ce=H.getBoundingClientRect();if(ee>=Nt.length||ye>=f)return;const ue=Ce.width/n,Me=Ls(ee,ye,n,i,c,on,dt,s,et,wt,f,R,E,Nt,d);return ue!==1&&(Me.x*=ue,Me.y*=ue,Me.width*=ue,Me.height*=ue),Me.x+=Ce.x,Me.y+=Ce.y,Me},[n,i,c,on,dt,s,et,wt,f,R,E,Nt,d]),Ne=h.useCallback((H,ee,ye,Ce)=>{const ue=H.getBoundingClientRect(),Me=ue.width/n,at=(ee-ue.left)/Me,st=(ye-ue.top)/Me,Ie=5,Mt=_s(Nt,dt,n,void 0,et);let Se=0,Ke=0;Ce instanceof MouseEvent&&(Se=Ce.button,Ke=Ce.buttons);const We=hp(at,Mt,et),ht=gp(st,i,y,l,c,f,d,s,wt,E),cn=(Ce==null?void 0:Ce.shiftKey)===!0,Tn=(Ce==null?void 0:Ce.ctrlKey)===!0,Ct=(Ce==null?void 0:Ce.metaKey)===!0,Zt=Ce!==void 0&&!(Ce instanceof MouseEvent)||(Ce==null?void 0:Ce.pointerType)==="touch",Jn=[at<0?-1:n<at?1:0,st<on?-1:i<st?1:0];let kn;if(We===-1||st<0||at<0||ht===void 0||at>n||st>i){const Tt=at>n?1:at<0?-1:0,Dn=st>i?1:st<0?-1:0;let Ln=Tt*2,St=Dn*2;Tt===0&&(Ln=We===-1?Ci.EndPadding:Ci.Center),Dn===0&&(St=ht===void 0?Ci.EndPadding:Ci.Center);let tn=!1;if(We===-1&&ht===-1){const Dr=fe(H,Nt.length-1,-1);An(Dr!==void 0),tn=ee<Dr.x+Dr.width+Ie}const Tr=at>n&&at<n+Os()||st>i&&st<i+Os();kn={kind:ya,location:[We!==-1?We:at<0?0:Nt.length-1,ht??f-1],region:[Ln,St],shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isEdge:tn,isTouch:Zt,button:Se,buttons:Ke,scrollEdge:Jn,isMaybeScrollbar:Tr}}else if(ht<=-1){let Tt=fe(H,We,ht);An(Tt!==void 0);let Dn=Tt!==void 0&&Tt.x+Tt.width-ee<=Ie;const Ln=We-1;ee-Tt.x<=Ie&&Ln>=0?(Dn=!0,Tt=fe(H,Ln,ht),An(Tt!==void 0),kn={kind:y&&ht===-2?Gn:Ar,location:[Ln,ht],bounds:Tt,group:Nt[Ln].group??"",isEdge:Dn,shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}):kn={kind:y&&ht===-2?Gn:Ar,group:Nt[We].group??"",location:[We,ht],bounds:Tt,isEdge:Dn,shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}}else{const Tt=fe(H,We,ht);An(Tt!==void 0);const Dn=Tt!==void 0&&Tt.x+Tt.width-ee<Ie;let Ln=!1;if(u&&x.current!==void 0){const St=jc(x.current.range),tn=fe(H,St[0],St[1]);if(tn!==void 0){const Tr=tn.x+tn.width-2,Dr=tn.y+tn.height-2;Ln=Math.abs(Tr-ee)<vu&&Math.abs(Dr-ye)<vu}}kn={kind:"cell",location:[We,ht],bounds:Tt,isEdge:Dn,shiftKey:cn,ctrlKey:Tn,isFillHandle:Ln,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}}return kn},[n,Nt,dt,et,i,y,l,c,f,d,s,wt,E,fe,u,x,on]),[Kt]=kt??[],En=h.useRef(()=>{}),ln=h.useRef(kt);ln.current=kt;const[A,je]=h.useMemo(()=>{const H=document.createElement("canvas"),ee=document.createElement("canvas");return H.style.display="none",H.style.opacity="0",H.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[H.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);h.useLayoutEffect(()=>{if(!(A===null||je===null))return document.documentElement.append(A.canvas),document.documentElement.append(je.canvas),()=>{A.canvas.remove(),je.canvas.remove()}},[A,je]);const $e=h.useMemo(()=>new xp,[]),Ot=$t&&rn?1:Ge&&rn?2:5,un=(Re==null?void 0:Re.disableMinimumCellWidth)===!0?1:10,xn=h.useRef(),qn=h.useRef(null),_n=h.useRef(null),Qt=h.useCallback(()=>{var at;const H=ze.current,ee=Ft.current;if(H===null||ee===null||(qn.current===null&&(qn.current=H.getContext("2d",{alpha:!1}),H.width=0,H.height=0),_n.current===null&&(_n.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),qn.current===null||_n.current===null||A===null||je===null))return;let ye=!1;const Ce=st=>{ye=!0,vn(st)},ue=xn.current,Me={headerCanvasCtx:_n.current,canvasCtx:qn.current,bufferACtx:A,bufferBCtx:je,width:n,height:i,cellXOffset:dt,cellYOffset:s,translateX:Math.round(et),translateY:Math.round(wt),mappedColumns:Nt,enableGroups:y,freezeColumns:R,dragAndDropState:de,theme:ke,headerHeight:l,groupHeaderHeight:c,disabledRows:Ve??yt.empty(),rowHeight:d,verticalBorder:rt,isResizing:O,resizeCol:k,isFocused:C,selection:x,fillHandle:u,drawCellCallback:J,hasAppendRow:he,overrideCursor:Ce,maxScaleFactor:Ot,freezeTrailingRows:E,rows:f,drawFocus:_,getCellContent:g,getGroupDetails:tt??(st=>({name:st})),getRowThemeOverride:m,drawHeaderCallback:it,prelightCells:Dt,highlightRegions:se,imageLoader:mt,lastBlitData:Ut,damage:Lt.current,hoverValues:Cn.current,hoverInfo:ln.current,spriteManager:At,scrolling:rn,hyperWrapping:(Re==null?void 0:Re.hyperWrapping)??!1,touchMode:hn,enqueue:En.current,renderStateProvider:$e,renderStrategy:(Re==null?void 0:Re.renderStrategy)??(ba.value?"double-buffer":"single-buffer"),getCellRenderer:lt,minimumCellWidth:un,resizeIndicator:He};Me.damage===void 0?(xn.current=Me,pu(Me,ue)):pu(Me,void 0),!ye&&(Me.damage===void 0||Me.damage.has((at=ln==null?void 0:ln.current)==null?void 0:at[0]))&&vn(void 0)},[A,je,n,i,dt,s,et,wt,Nt,y,R,de,ke,l,c,Ve,d,rt,O,he,k,C,x,u,E,f,_,Ot,g,tt,m,J,it,Dt,se,mt,At,rn,Re==null?void 0:Re.hyperWrapping,Re==null?void 0:Re.renderStrategy,hn,$e,lt,un,He]),$n=h.useRef(Qt);h.useLayoutEffect(()=>{Qt(),$n.current=Qt},[Qt]),h.useLayoutEffect(()=>{(async()=>{var ee;((ee=document==null?void 0:document.fonts)==null?void 0:ee.ready)!==void 0&&(await document.fonts.ready,xn.current=void 0,$n.current())})()},[]);const Kn=h.useCallback(H=>{Lt.current=H,$n.current(),Lt.current=void 0},[]),$a=J0(Kn);En.current=$a;const wo=h.useCallback(H=>{Kn(new io(H.map(ee=>ee.cell)))},[Kn]);mt.setCallback(Kn);const[yo,Va]=h.useState(!1),[oi,Rr]=Kt??[],Ii=oi!==void 0&&Rr===-1,Na=oi!==void 0&&Rr===-2;let Ti=!1,Di=!1,Nr=gn;if(Nr===void 0&&oi!==void 0&&Rr!==void 0&&Rr>-1&&Rr<f){const H=g([oi,Rr],!0);Ti=H.kind===jn.NewRow||H.kind===jn.Marker&&H.markerKind!=="number",Di=H.kind===Z.Boolean&&Gs(H),Nr=H.cursor}const In=N?"grabbing":(Sn??!1)||O?"col-resize":yo||w?"crosshair":Nr!==void 0?Nr:Ii||Ti||Di||Na?"pointer":"default",Oi=h.useMemo(()=>({contain:"strict",display:"block",cursor:In}),[In]),Pi=h.useRef("default"),ai=j==null?void 0:j.current;ai!=null&&Pi.current!==Oi.cursor&&(ai.style.cursor=Pi.current=Oi.cursor);const vr=h.useCallback((H,ee,ye,Ce)=>{if(tt===void 0)return;const ue=tt(H);if(ue.actions!==void 0){const Me=hd(ee,ue.actions);for(const[at,st]of Me.entries())if(ei(st,ye+ee.x,Ce+st.y))return ue.actions[at]}},[tt]),br=h.useCallback((H,ee,ye,Ce)=>{const ue=Nt[ee];if(!N&&!O&&!(Sn??!1)){const Me=fe(H,ee,-1);An(Me!==void 0);const at=gd(void 0,ue,Me.x,Me.y,Me.width,Me.height,ke,Js(ue.title)==="rtl");if(ue.hasMenu===!0&&at.menuBounds!==void 0&&ei(at.menuBounds,ye,Ce))return{area:"menu",bounds:at.menuBounds};if(ue.indicatorIcon!==void 0&&at.indicatorIconBounds!==void 0&&ei(at.indicatorIconBounds,ye,Ce))return{area:"indicator",bounds:at.indicatorIconBounds}}},[Nt,fe,Sn,N,O,ke]),si=h.useRef(0),ar=h.useRef(),sr=h.useRef(!1),Br=h.useCallback(H=>{const ee=ze.current,ye=j==null?void 0:j.current;if(ee===null||H.target!==ee&&H.target!==ye)return;sr.current=!0;let Ce,ue;if(H instanceof MouseEvent?(Ce=H.clientX,ue=H.clientY):(Ce=H.touches[0].clientX,ue=H.touches[0].clientY),H.target===ye&&ye!==null){const at=ye.getBoundingClientRect();if(Ce>at.right||ue>at.bottom)return}const Me=Ne(ee,Ce,ue,H);ar.current=Me.location,Me.isTouch&&(si.current=Date.now()),Gt.current!==Me.isTouch&&ot(Me.isTouch),!(Me.kind===Ar&&br(ee,Me.location[0],Ce,ue)!==void 0)&&(Me.kind===Gn&&vr(Me.group,Me.bounds,Me.localEventX,Me.localEventY)!==void 0||(F==null||F(Me),!Me.isTouch&&re!==!0&&re!==Me.kind&&Me.button<3&&Me.button!==1&&H.preventDefault()))},[j,re,Ne,vr,br,F]);mn("touchstart",Br,_t,!1),mn("mousedown",Br,_t,!1);const Co=h.useRef(0),_i=h.useCallback(H=>{var Ke,We;const ee=Co.current;Co.current=Date.now();const ye=ze.current;if(sr.current=!1,P===void 0||ye===null)return;const Ce=j==null?void 0:j.current,ue=H.target!==ye&&H.target!==Ce;let Me,at,st=!0;if(H instanceof MouseEvent){if(Me=H.clientX,at=H.clientY,st=H.button<3,H.pointerType==="touch")return}else Me=H.changedTouches[0].clientX,at=H.changedTouches[0].clientY;let Ie=Ne(ye,Me,at,H);Ie.isTouch&&si.current!==0&&Date.now()-si.current>500&&(Ie={...Ie,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ie.isTouch?1e3:500)&&(Ie={...Ie,isDoubleClick:!0}),Gt.current!==Ie.isTouch&&ot(Ie.isTouch),!ue&&H.cancelable&&st&&H.preventDefault();const[Mt]=Ie.location,Se=br(ye,Mt,Me,at);if(Ie.kind===Ar&&Se!==void 0){(Ie.button!==0||((Ke=ar.current)==null?void 0:Ke[0])!==Mt||((We=ar.current)==null?void 0:We[1])!==-1)&&P(Ie,!0);return}else if(Ie.kind===Gn){const ht=vr(Ie.group,Ie.bounds,Ie.localEventX,Ie.localEventY);if(ht!==void 0){Ie.button===0&&ht.onClick(Ie);return}}P(Ie,ue)},[P,j,Ne,br,vr]);mn("mouseup",_i,_t,!1),mn("touchend",_i,_t,!1);const qe=h.useCallback(H=>{var Mt,Se;const ee=ze.current;if(ee===null)return;const ye=j==null?void 0:j.current,Ce=H.target!==ee&&H.target!==ye;let ue,Me,at=!0;H instanceof MouseEvent?(ue=H.clientX,Me=H.clientY,at=H.button<3):(ue=H.changedTouches[0].clientX,Me=H.changedTouches[0].clientY);const st=Ne(ee,ue,Me,H);Gt.current!==st.isTouch&&ot(st.isTouch),!Ce&&H.cancelable&&at&&H.preventDefault();const[Ie]=st.location;if(st.kind===Ar){const Ke=br(ee,Ie,ue,Me);Ke!==void 0&&st.button===0&&((Mt=ar.current)==null?void 0:Mt[0])===Ie&&((Se=ar.current)==null?void 0:Se[1])===-1&&(Ke.area==="menu"?p==null||p(Ie,Ke.bounds):Ke.area==="indicator"&&(b==null||b(Ie,Ke.bounds)))}else if(st.kind===Gn){const Ke=vr(st.group,st.bounds,st.localEventX,st.localEventY);Ke!==void 0&&st.button===0&&Ke.onClick(st)}},[j,Ne,br,p,b,vr]);mn("click",qe,_t,!1);const So=h.useCallback(H=>{const ee=ze.current,ye=j==null?void 0:j.current;if(ee===null||H.target!==ee&&H.target!==ye||I===void 0)return;const Ce=Ne(ee,H.clientX,H.clientY,H);I(Ce,()=>{H.cancelable&&H.preventDefault()})},[j,Ne,I]);mn("contextmenu",So,(j==null?void 0:j.current)??null,!1);const xo=h.useCallback(H=>{Lt.current=new io(H.map(ee=>ee.item)),Cn.current=H,$n.current(),Lt.current=void 0},[]),Vn=h.useMemo(()=>new q0(xo),[xo]),ko=h.useRef(Vn);ko.current=Vn,h.useLayoutEffect(()=>{const H=ko.current;if(Kt===void 0||Kt[1]<0){H.setHovered(Kt);return}const ee=g(Kt,!0),ye=lt(ee),Ce=ye===void 0&&ee.kind===Z.Custom||(ye==null?void 0:ye.needsHover)!==void 0&&(typeof ye.needsHover=="boolean"?ye.needsHover:ye.needsHover(ee));H.setHovered(Ce?Kt:void 0)},[g,lt,Kt]);const Zn=h.useRef(),Li=h.useCallback(H=>{var st;const ee=ze.current;if(ee===null)return;const ye=j==null?void 0:j.current,Ce=H.target!==ee&&H.target!==ye,ue=Ne(ee,H.clientX,H.clientY,H);if(ue.kind!=="out-of-bounds"&&Ce&&!sr.current&&!ue.isTouch)return;const Me=(Ie,Mt)=>{Pn(Se=>Se===Ie||(Se==null?void 0:Se[0][0])===(Ie==null?void 0:Ie[0][0])&&(Se==null?void 0:Se[0][1])===(Ie==null?void 0:Ie[0][1])&&((Se==null?void 0:Se[1][0])===(Ie==null?void 0:Ie[1][0])&&(Se==null?void 0:Se[1][1])===(Ie==null?void 0:Ie[1][1])||!Mt)?Se:Ie)};if(!vd(ue,Zn.current))vn(void 0),oe==null||oe(ue),Me(ue.kind===ya?void 0:[ue.location,[ue.localEventX,ue.localEventY]],!0),Zn.current=ue;else if(ue.kind==="cell"||ue.kind===Ar||ue.kind===Gn){let Ie=!1,Mt=!0;if(ue.kind==="cell"){const Ke=g(ue.location);Mt=((st=lt(Ke))==null?void 0:st.needsHoverPosition)??Ke.kind===Z.Custom,Ie=Mt}else Ie=!0;const Se=[ue.location,[ue.localEventX,ue.localEventY]];Me(Se,Mt),ln.current=Se,Ie&&Kn(new io([ue.location]))}const at=ue.location[0]>=(xe?0:1);Pe(ue.kind===Ar&&ue.isEdge&&at&&Oe===!0),Va(ue.kind==="cell"&&ue.isFillHandle),ne==null||ne(H),Q(ue)},[j,Ne,xe,Oe,ne,Q,oe,g,lt,Kn]);mn("mousemove",Li,_t,!0);const Mo=h.useCallback(H=>{const ee=ze.current;if(ee===null)return;let ye,Ce;x.current!==void 0&&(ye=fe(ee,x.current.cell[0],x.current.cell[1]),Ce=x.current.cell),ae==null||ae({bounds:ye,stopPropagation:()=>H.stopPropagation(),preventDefault:()=>H.preventDefault(),cancel:()=>{},ctrlKey:H.ctrlKey,metaKey:H.metaKey,shiftKey:H.shiftKey,altKey:H.altKey,key:H.key,keyCode:H.keyCode,rawEvent:H,location:Ce})},[ae,x,fe]),Ro=h.useCallback(H=>{const ee=ze.current;if(ee===null)return;let ye,Ce;x.current!==void 0&&(ye=fe(ee,x.current.cell[0],x.current.cell[1]),Ce=x.current.cell),G==null||G({bounds:ye,stopPropagation:()=>H.stopPropagation(),preventDefault:()=>H.preventDefault(),cancel:()=>{},ctrlKey:H.ctrlKey,metaKey:H.metaKey,shiftKey:H.shiftKey,altKey:H.altKey,key:H.key,keyCode:H.keyCode,rawEvent:H,location:Ce})},[G,x,fe]),Ba=h.useCallback(H=>{if(ze.current=H,ie!==void 0&&(ie.current=H),H===null)Pt.current=window;else{const ee=H.getRootNode();ee===document&&(Pt.current=window),Pt.current=ee}},[ie]),Wa=h.useCallback(H=>{const ee=ze.current;if(ee===null||re===!1||O){H.preventDefault();return}let ye,Ce;const ue=Ne(ee,H.clientX,H.clientY);if(re!==!0&&ue.kind!==re){H.preventDefault();return}const Me=(Ke,We)=>{ye=Ke,Ce=We};let at,st,Ie;const Mt=(Ke,We,ht)=>{at=Ke,st=We,Ie=ht};let Se=!1;if(be==null||be({...ue,setData:Me,setDragImage:Mt,preventDefault:()=>Se=!0,defaultPrevented:()=>Se}),!Se&&ye!==void 0&&Ce!==void 0&&H.dataTransfer!==null)if(H.dataTransfer.setData(ye,Ce),H.dataTransfer.effectAllowed="copyLink",at!==void 0&&st!==void 0&&Ie!==void 0)H.dataTransfer.setDragImage(at,st,Ie);else{const[Ke,We]=ue.location;if(We!==void 0){const ht=document.createElement("canvas"),cn=fe(ee,Ke,We);An(cn!==void 0);const Tn=Math.ceil(window.devicePixelRatio??1);ht.width=cn.width*Tn,ht.height=cn.height*Tn;const Ct=ht.getContext("2d");Ct!==null&&(Ct.scale(Tn,Tn),Ct.textBaseline="middle",We===-1?(Ct.font=ke.headerFontFull,Ct.fillStyle=ke.bgHeader,Ct.fillRect(0,0,ht.width,ht.height),md(Ct,0,0,cn.width,cn.height,Nt[Ke],!1,ke,!1,void 0,void 0,!1,0,At,it,!1)):(Ct.font=ke.baseFontFull,Ct.fillStyle=ke.bgCell,Ct.fillRect(0,0,ht.width,ht.height),fd(Ct,g([Ke,We]),0,We,!1,!1,0,0,cn.width,cn.height,!1,ke,ke.bgCell,mt,At,1,void 0,!1,0,void 0,void 0,void 0,$e,lt,()=>{}))),ht.style.left="-100%",ht.style.position="absolute",ht.style.width=`${cn.width}px`,ht.style.height=`${cn.height}px`,document.body.append(ht),H.dataTransfer.setDragImage(ht,cn.width/2,cn.height/2),window.setTimeout(()=>{ht.remove()},0)}}else H.preventDefault()},[re,O,Ne,be,fe,ke,Nt,At,it,g,mt,$e,lt]);mn("dragstart",Wa,(j==null?void 0:j.current)??null,!1,!1);const Nn=h.useRef(),Er=h.useCallback(H=>{const ee=ze.current;if(me!==void 0&&H.preventDefault(),ee===null||le===void 0)return;const ye=Ne(ee,H.clientX,H.clientY),[Ce,ue]=ye.location,Me=Ce-(xe?0:1),[at,st]=Nn.current??[];(at!==Me||st!==ue)&&(Nn.current=[Me,ue],le([Me,ue],H.dataTransfer))},[xe,Ne,le,me]);mn("dragover",Er,(j==null?void 0:j.current)??null,!1,!1);const Bn=h.useCallback(()=>{Nn.current=void 0,we==null||we()},[we]);mn("dragend",Bn,(j==null?void 0:j.current)??null,!1,!1);const B=h.useCallback(H=>{const ee=ze.current;if(ee===null||me===void 0)return;H.preventDefault();const ye=Ne(ee,H.clientX,H.clientY),[Ce,ue]=ye.location,Me=Ce-(xe?0:1);me([Me,ue],H.dataTransfer)},[xe,Ne,me]);mn("drop",B,(j==null?void 0:j.current)??null,!1,!1);const qt=h.useCallback(()=>{De==null||De()},[De]);mn("dragleave",qt,(j==null?void 0:j.current)??null,!1,!1);const Ir=h.useRef(x);Ir.current=x;const li=h.useRef(null),ui=h.useCallback(H=>{var ee;ze.current===null||!ze.current.contains(document.activeElement)||(H===null&&Ir.current.current!==void 0?(ee=ie==null?void 0:ie.current)==null||ee.focus({preventScroll:!0}):H!==null&&H.focus({preventScroll:!0}),li.current=H)},[ie]);h.useImperativeHandle(t,()=>({focus:()=>{var ee;const H=li.current;H===null||!document.contains(H)?(ee=ie==null?void 0:ie.current)==null||ee.focus({preventScroll:!0}):H.focus({preventScroll:!0})},getBounds:(H,ee)=>{if(!(ie===void 0||ie.current===null))return fe(ie.current,H??0,ee??-1)},damage:wo}),[ie,wo,fe]);const Fi=h.useRef(),Ua=Im(()=>{var st,Ie,Mt;if(n<50||(Re==null?void 0:Re.disableAccessibilityTree)===!0)return null;let H=_s(Nt,dt,n,de,et);const ee=xe?0:-1;!xe&&((st=H[0])==null?void 0:st.sourceIndex)===0&&(H=H.slice(1));const[ye,Ce]=((Ie=x.current)==null?void 0:Ie.cell)??[],ue=(Mt=x.current)==null?void 0:Mt.range,Me=H.map(Se=>Se.sourceIndex),at=dr(s,Math.min(f,s+r));return ye!==void 0&&Ce!==void 0&&!(Me.includes(ye)&&at.includes(Ce))&&ui(null),h.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":f+1,"aria-multiselectable":"true","aria-colcount":Nt.length+ee},h.createElement("thead",{role:"rowgroup"},h.createElement("tr",{role:"row","aria-rowindex":1},H.map(Se=>h.createElement("th",{role:"columnheader","aria-selected":x.columns.hasIndex(Se.sourceIndex),"aria-colindex":Se.sourceIndex+1+ee,tabIndex:-1,onFocus:Ke=>{if(Ke.target!==li.current)return ce==null?void 0:ce([Se.sourceIndex,-1])},key:Se.sourceIndex},Se.title)))),h.createElement("tbody",{role:"rowgroup"},at.map(Se=>h.createElement("tr",{role:"row","aria-selected":x.rows.hasIndex(Se),key:Se,"aria-rowindex":Se+2},H.map(Ke=>{const We=Ke.sourceIndex,ht=or(We,Se),cn=ye===We&&Ce===Se,Tn=ue!==void 0&&We>=ue.x&&We<ue.x+ue.width&&Se>=ue.y&&Se<ue.y+ue.height,Ct=`glide-cell-${We}-${Se}`,Zt=[We,Se],Jn=g(Zt,!0);return h.createElement("td",{key:ht,role:"gridcell","aria-colindex":We+1+ee,"aria-selected":Tn,"aria-readonly":wi(Jn)||!Ki(Jn),id:Ct,"data-testid":Ct,onClick:()=>{const kn=ie==null?void 0:ie.current;if(kn!=null)return ae==null?void 0:ae({bounds:fe(kn,We,Se),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Zt})},onFocusCapture:kn=>{var Tt,Dn;if(!(kn.target===li.current||((Tt=Fi.current)==null?void 0:Tt[0])===We&&((Dn=Fi.current)==null?void 0:Dn[1])===Se))return Fi.current=Zt,ce==null?void 0:ce(Zt)},ref:cn?ui:void 0,tabIndex:-1},Q0(Jn,lt))})))))},[n,Nt,dt,de,et,f,s,r,x,ui,g,ie,ae,fe,ce],200),Ai=R===0||!L?0:dt>R?1:Xn(-et/100,0,1),U=-s*32+wt,dn=z?Xn(-U/100,0,1):0,fn=h.useMemo(()=>{if(!Ai&&!dn)return null;const H={position:"absolute",top:0,left:Bt,width:n-Bt,height:i,opacity:Ai,pointerEvents:"none",transition:nt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:on,left:0,width:n,height:i,opacity:dn,pointerEvents:"none",transition:ge?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return h.createElement(h.Fragment,null,Ai>0&&h.createElement("div",{id:"shadow-x",style:H}),dn>0&&h.createElement("div",{id:"shadow-y",style:ee}))},[Ai,dn,Bt,n,nt,on,i,ge]),Xa=h.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return h.createElement(h.Fragment,null,h.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Mo,onKeyUp:Ro,onFocus:S,onBlur:M,ref:Ba,style:Oi},Ua),h.createElement("canvas",{ref:Ft,style:Xa}),fn)},tv=h.memo(h.forwardRef(ev));function Gi(e,t,n,i){return Xn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(i))}const nv=e=>{const[t,n]=h.useState(),[i,r]=h.useState(),[o,a]=h.useState(),[s,l]=h.useState(),[u,c]=h.useState(!1),[d,f]=h.useState(),[g,m]=h.useState(),[p,b]=h.useState(),[y,w]=h.useState(!1),[S,M]=h.useState(),{onHeaderMenuClick:C,onHeaderIndicatorClick:x,getCellContent:R,onColumnMoved:I,onColumnResize:E,onColumnResizeStart:L,onColumnResizeEnd:z,gridRef:_,maxColumnWidth:F,minColumnWidth:P,onRowMoved:ne,lockColumns:Q,onColumnProposeMove:oe,onMouseDown:de,onMouseUp:xe,onItemHovered:ae,onDragStart:G,canvasRef:se}=e,ie=(E??z??L)!==void 0,{columns:be,selection:we}=e,j=we.columns,O=h.useCallback(J=>{const[it,ce]=J.location;o!==void 0&&s!==it&&it>=Q?(c(!0),l(it)):g!==void 0&&ce!==void 0?(w(!0),b(Math.max(0,ce))):i===void 0&&!u&&!y&&(ae==null||ae(J))},[o,g,s,ae,Q,i,u,y]),k=I!==void 0,N=h.useCallback(J=>{var it;if(J.button===0){const[ce,le]=J.location;if(J.kind==="out-of-bounds"&&J.isEdge&&ie){const me=(it=_==null?void 0:_.current)==null?void 0:it.getBounds(be.length-1,-1);me!==void 0&&(n(me.x),r(be.length-1))}else if(J.kind==="header"&&ce>=Q){const me=se==null?void 0:se.current;if(J.isEdge&&ie&&me){n(J.bounds.x),r(ce);const Ae=me.getBoundingClientRect().width/me.offsetWidth,nt=J.bounds.width/Ae;L==null||L(be[ce],nt,ce,nt+(be[ce].growOffset??0))}else J.kind==="header"&&k&&(f(J.bounds.x),a(ce))}else J.kind==="cell"&&Q>0&&ce===0&&le!==void 0&&ne!==void 0&&(M(J.bounds.y),m(le))}de==null||de(J)},[de,ie,Q,ne,_,be,k,L,se]),re=h.useCallback((J,it)=>{u||y||C==null||C(J,it)},[u,y,C]),Oe=h.useCallback((J,it)=>{u||y||x==null||x(J,it)},[u,y,x]),Ve=h.useRef(-1),he=h.useCallback(()=>{Ve.current=-1,m(void 0),b(void 0),M(void 0),w(!1),a(void 0),l(void 0),f(void 0),c(!1),r(void 0),n(void 0)},[]),tt=h.useCallback((J,it)=>{if(J.button===0){if(i!==void 0){if((j==null?void 0:j.hasIndex(i))===!0)for(const le of j){if(le===i)continue;const me=be[le],De=Gi(me,Ve.current,P,F);E==null||E(me,De,le,De+(me.growOffset??0))}const ce=Gi(be[i],Ve.current,P,F);if(z==null||z(be[i],ce,i,ce+(be[i].growOffset??0)),j.hasIndex(i))for(const le of j){if(le===i)continue;const me=be[le],De=Gi(me,Ve.current,P,F);z==null||z(me,De,le,De+(me.growOffset??0))}}he(),o!==void 0&&s!==void 0&&(I==null||I(o,s)),g!==void 0&&p!==void 0&&(ne==null||ne(g,p))}xe==null||xe(J,it)},[xe,i,o,s,g,p,j,z,be,P,F,E,I,ne,he]),ke=h.useMemo(()=>{if(!(o===void 0||s===void 0)&&o!==s&&(oe==null?void 0:oe(o,s))!==!1)return{src:o,dest:s}},[o,s,oe]),Dt=h.useCallback(J=>{const it=se==null?void 0:se.current;if(o!==void 0&&d!==void 0)Math.abs(J.clientX-d)>20&&c(!0);else if(g!==void 0&&S!==void 0)Math.abs(J.clientY-S)>20&&w(!0);else if(i!==void 0&&t!==void 0&&it){const le=it.getBoundingClientRect().width/it.offsetWidth,me=(J.clientX-t)/le,De=be[i],Ae=Gi(De,me,P,F);if(E==null||E(De,Ae,i,Ae+(De.growOffset??0)),Ve.current=me,(j==null?void 0:j.first())===i)for(const nt of j){if(nt===i)continue;const ge=be[nt],Re=Gi(ge,Ve.current,P,F);E==null||E(ge,Re,nt,Re+(ge.growOffset??0))}}},[o,d,g,S,i,t,be,P,F,E,j,se]),bt=h.useCallback((J,it)=>{if(g===void 0||p===void 0)return R(J,it);let[ce,le]=J;return le===p?le=g:(le>p&&(le-=1),le>=g&&(le+=1)),R([ce,le],it)},[g,p,R]),rt=h.useCallback(J=>{G==null||G(J),J.defaultPrevented()||he()},[he,G]);return h.createElement(tv,{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:i,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,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:bt,isResizing:i!==void 0,onHeaderMenuClick:re,onHeaderIndicatorClick:Oe,isDragging:u,onItemHovered:O,onDragStart:rt,onMouseDown:N,allowResize:ie,onMouseUp:tt,dragAndDropState:ke,onMouseMoveRaw:Dt,ref:_})};function rv(e){const t=h.useRef(null),[n,i]=h.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return h.useLayoutEffect(()=>{const r=a=>{for(const s of a){const{width:l,height:u}=s&&s.contentRect||{};i(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(r);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const iv=(e,t,n)=>{const i=h.useRef(null),r=h.useRef(null),o=h.useRef(null),a=h.useRef(0),s=h.useRef(t);s.current=t;const l=n.current;h.useEffect(()=>{const u=()=>{var f,g;if(r.current===!1&&l!==null){const m=[l.scrollLeft,l.scrollTop];if(((f=o.current)==null?void 0:f[0])===m[0]&&((g=o.current)==null?void 0:g[1])===m[1])if(a.current>10){o.current=null,r.current=null;return}else a.current++;else a.current=0,s.current(m[0],m[1]),o.current=m;i.current=window.setTimeout(u,8.333333333333334)}},c=()=>{r.current=!0,o.current=null,i.current!==null&&(window.clearTimeout(i.current),i.current=null)},d=f=>{f.touches.length===0&&(r.current=!1,a.current=0,i.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const f=l;return f.addEventListener("touchstart",c),f.addEventListener("touchend",d),()=>{f.removeEventListener("touchstart",c),f.removeEventListener("touchend",d),i.current!==null&&window.clearTimeout(i.current)}}},[e,l])},ov=()=>e=>e.isSafari?"scroll":"auto",av=pn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[ov()]}});function sv(e){const[t,n]=h.useState(!1),i=typeof window>"u"?null:window,r=h.useRef(0);return mn("touchstart",h.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),i,!0,!1),mn("touchend",h.useCallback(o=>{o.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),i,!0,!1),t}const lv=e=>{var ie,be;const{children:t,clientHeight:n,scrollHeight:i,scrollWidth:r,update:o,draggable:a,className:s,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:g=!1,scrollRef:m,initialSize:p}=e,b=[],y=(f==null?void 0:f.sticky)??!1,w=(f==null?void 0:f.fill)??!1,S=h.useRef(0),M=h.useRef(0),C=h.useRef(null),x=typeof window>"u"?1:window.devicePixelRatio,R=h.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),I=h.useRef(null),E=sv(200),[L,z]=h.useState(!0),_=h.useRef(0);h.useLayoutEffect(()=>{if(!L||E||R.current.lockDirection===void 0)return;const we=C.current;if(we===null)return;const[j,O]=R.current.lockDirection;j!==void 0?we.scrollLeft=j:O!==void 0&&(we.scrollTop=O),R.current.lockDirection=void 0},[E,L]);const F=h.useCallback((we,j)=>{var rt;const O=C.current;if(O===null)return;j=j??O.scrollTop,we=we??O.scrollLeft;const k=R.current.scrollTop,N=R.current.scrollLeft,re=we-N,Oe=j-k;E&&re!==0&&Oe!==0&&(Math.abs(re)>3||Math.abs(Oe)>3)&&l&&R.current.lockDirection===void 0&&(R.current.lockDirection=Math.abs(re)<Math.abs(Oe)?[N,void 0]:[void 0,k]);const Ve=R.current.lockDirection;we=(Ve==null?void 0:Ve[0])??we,j=(Ve==null?void 0:Ve[1])??j,R.current.scrollLeft=we,R.current.scrollTop=j;const he=O.clientWidth,tt=O.clientHeight,ke=j,Dt=M.current-ke,bt=O.scrollHeight-tt;if(M.current=ke,bt>0&&(Math.abs(Dt)>2e3||ke===0||ke===bt)&&i>O.scrollHeight+5){const J=ke/bt,it=(i-tt)*J;S.current=it-ke}Ve!==void 0&&(window.clearTimeout(_.current),z(!1),_.current=window.setTimeout(()=>z(!0),200)),o({x:we,y:ke+S.current,width:he-c,height:tt-u,paddingRight:((rt=I.current)==null?void 0:rt.clientWidth)??0})},[u,c,i,o,l,E]);iv(g&&ba.value,F,C);const P=h.useRef(F);P.current=F;const ne=h.useRef(),Q=h.useRef(!1);h.useLayoutEffect(()=>{Q.current?F():Q.current=!0},[F,u,c]);const oe=h.useCallback(we=>{C.current=we,m!==void 0&&(m.current=we)},[m]);let de=0,xe=0;for(b.push(h.createElement("div",{key:de++,style:{width:r,height:0}}));xe<i;){const we=Math.min(5e6,i-xe);b.push(h.createElement("div",{key:de++,style:{width:0,height:we}})),xe+=we}const{ref:ae,width:G,height:se}=rv(p);return typeof window<"u"&&(((ie=ne.current)==null?void 0:ie.height)!==se||((be=ne.current)==null?void 0:be.width)!==G)&&(window.setTimeout(()=>P.current(),0),ne.current={width:G,height:se}),(G??0)===0||(se??0)===0?h.createElement("div",{ref:ae}):h.createElement("div",{ref:ae},h.createElement(av,{isSafari:ba.value},h.createElement("div",{className:"dvn-underlay"},t),h.createElement("div",{ref:oe,style:ne.current,draggable:a,onDragStart:we=>{a||(we.stopPropagation(),we.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>F()},h.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},h.createElement("div",{className:"dvn-stack"},b),d!==void 0&&h.createElement(h.Fragment,null,!w&&h.createElement("div",{className:"dvn-spacer"}),h.createElement("div",{ref:I,style:{height:se,maxHeight:n-Math.ceil(x%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:w?1:void 0,right:y?c??0:void 0,pointerEvents:"auto"}},d))))))},uv=e=>{const{columns:t,rows:n,rowHeight:i,headerHeight:r,groupHeaderHeight:o,enableGroups:a,freezeColumns:s,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:f,scrollRef:g,preventDiagonalScrolling:m,rightElement:p,rightElementProps:b,overscrollX:y,overscrollY:w,initialSize:S,smoothScrollX:M=!1,smoothScrollY:C=!1,isDraggable:x}=e,{paddingRight:R,paddingBottom:I}=l??{},[E,L]=c,z=h.useRef(),_=h.useRef(),F=h.useRef(),P=h.useRef(),ne=u+Math.max(0,y??0);let Q=a?r+o:r;if(typeof i=="number")Q+=n*i;else for(let ae=0;ae<n;ae++)Q+=i(ae);w!==void 0&&(Q+=w);const oe=h.useRef(),de=h.useCallback(()=>{var Oe,Ve;if(oe.current===void 0)return;const ae={...oe.current};let G=0,se=ae.x<0?-ae.x:0,ie=0,be=0;ae.x=ae.x<0?0:ae.x;let we=0;for(let he=0;he<s;he++)we+=t[he].width;for(const he of t){const tt=G-we;if(ae.x>=tt+he.width)G+=he.width,be++,ie++;else if(ae.x>tt)G+=he.width,M?se+=tt-ae.x:be++,ie++;else if(ae.x+ae.width>tt)G+=he.width,ie++;else break}let j=0,O=0,k=0;if(typeof i=="number")C?(O=Math.floor(ae.y/i),j=O*i-ae.y):O=Math.ceil(ae.y/i),k=Math.ceil(ae.height/i)+O,j<0&&k++;else{let he=0;for(let tt=0;tt<n;tt++){const ke=i(tt),Dt=he+(C?0:ke/2);if(ae.y>=he+ke)he+=ke,O++,k++;else if(ae.y>Dt)he+=ke,C?j+=Dt-ae.y:O++,k++;else if(ae.y+ae.height>ke/2+he)he+=ke,k++;else break}}const N={x:be,y:O,width:ie-be,height:k-O},re=z.current;(re===void 0||re.y!==N.y||re.x!==N.x||re.height!==N.height||re.width!==N.width||_.current!==se||F.current!==j||ae.width!==((Oe=P.current)==null?void 0:Oe[0])||ae.height!==((Ve=P.current)==null?void 0:Ve[1]))&&(f==null||f({x:be,y:O,width:ie-be,height:k-O},ae.width,ae.height,ae.paddingRight??0,se,j),z.current=N,_.current=se,F.current=j,P.current=[ae.width,ae.height])},[t,i,n,f,s,M,C]),xe=h.useCallback(ae=>{oe.current=ae,de()},[de]);return h.useEffect(()=>{de()},[de]),h.createElement(lv,{scrollRef:g,className:d,kineticScrollPerfHack:l==null?void 0:l.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:x===!0||typeof x=="string",scrollWidth:ne+(R??0),scrollHeight:Q+(I??0),clientHeight:L,rightElement:p,paddingBottom:I,paddingRight:R,rightElementProps:b,update:xe,initialSize:S},h.createElement(nv,{eventTargetRef:g,width:E,height:L,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,onHeaderIndicatorClick:e.onHeaderIndicatorClick,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,resizeIndicator:e.resizeIndicator}))},cv=pn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),dv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),fv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),hv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),gv=10,mv=e=>{const{canvasRef:t,cellYOffset:n,rows:i,columns:r,searchInputRef:o,searchValue:a,searchResults:s,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:f}=e,[g]=h.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=h.useState(""),b=a??m,y=h.useCallback(G=>{p(G),l==null||l(G)},[l]),[w,S]=h.useState(),M=h.useRef(w);M.current=w,h.useEffect(()=>{s!==void 0&&(s.length>0?S(G=>({rowsSearched:i,results:s.length,selectedIndex:(G==null?void 0:G.selectedIndex)??-1})):S(void 0))},[i,s]);const C=h.useRef();C.current===void 0&&(C.current=new AbortController);const x=h.useRef(),[R,I]=h.useState([]),E=s??R,L=h.useCallback(()=>{x.current!==void 0&&(window.cancelAnimationFrame(x.current),x.current=void 0,C.current.abort())},[]),z=h.useRef(n);z.current=n;const _=h.useCallback(G=>{const se=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ie=z.current,be=Math.min(10,i),we=0;S(void 0),I([]);const j=[],O=async()=>{var bt;if(u===void 0)return;const k=performance.now(),N=i-we;let re=u({x:0,y:ie,width:r.length,height:Math.min(be,N,i-ie)},C.current.signal);typeof re=="function"&&(re=await re());let Oe=!1;for(const[rt,J]of re.entries())for(const[it,ce]of J.entries()){let le;switch(ce.kind){case Z.Text:case Z.Number:le=ce.displayData;break;case Z.Uri:case Z.Markdown:le=ce.data;break;case Z.Boolean:le=typeof ce.data=="boolean"?ce.data.toString():void 0;break;case Z.Image:case Z.Bubble:le=ce.data.join("🐳");break;case Z.Custom:le=ce.copyData;break}le!==void 0&&se.test(le)&&(j.push([it,rt+ie]),Oe=!0)}const Ve=performance.now();Oe&&I([...j]),we+=re.length,An(we<=i);const he=((bt=M.current)==null?void 0:bt.selectedIndex)??-1;S({results:j.length,rowsSearched:we,selectedIndex:he}),c==null||c(j,he),ie+be>=i?ie=0:ie+=be;const tt=Ve-k,ke=Math.max(tt,1),Dt=gv/ke;be=Math.ceil(be*Dt),we<i&&j.length<1e3&&(x.current=window.requestAnimationFrame(O))};L(),x.current=window.requestAnimationFrame(O)},[L,r.length,u,c,i]),F=h.useCallback(()=>{var G;f==null||f(),S(void 0),I([]),c==null||c([],-1),L(),(G=t==null?void 0:t.current)==null||G.focus()},[L,t,f,c]),P=h.useCallback(G=>{y(G.target.value),s===void 0&&(G.target.value===""?(S(void 0),I([]),L()):_(G.target.value))},[_,L,y,s]);h.useEffect(()=>{d&&o.current!==null&&(y(""),o.current.focus({preventScroll:!0}))},[d,o,y]);const ne=h.useCallback(G=>{var ie;if((ie=G==null?void 0:G.stopPropagation)==null||ie.call(G),w===void 0)return;const se=(w.selectedIndex+1)%w.results;S({...w,selectedIndex:se}),c==null||c(E,se)},[w,c,E]),Q=h.useCallback(G=>{var ie;if((ie=G==null?void 0:G.stopPropagation)==null||ie.call(G),w===void 0)return;let se=(w.selectedIndex-1)%w.results;se<0&&(se+=w.results),S({...w,selectedIndex:se}),c==null||c(E,se)},[c,E,w]),oe=h.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(F(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?Q():ne())},[F,ne,Q]);h.useEffect(()=>()=>{L()},[L]);const[de,xe]=h.useState(!1);h.useEffect(()=>{if(d)xe(!0);else{const G=setTimeout(()=>xe(!1),150);return()=>clearTimeout(G)}},[d]);const ae=h.useMemo(()=>{if(!d&&!de)return null;let G;w!==void 0&&(G=w.results>=1e3?"over 1000":`${w.results} result${w.results!==1?"s":""}`,w.selectedIndex>=0&&(G=`${w.selectedIndex+1} of ${G}`));const se=we=>{we.stopPropagation()},be={width:`${Math.floor(((w==null?void 0:w.rowsSearched)??0)/i*100)}%`};return h.createElement(cv,{className:d?"":"out",onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},h.createElement("div",{className:"gdg-search-bar-inner"},h.createElement("input",{id:g,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:P,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:oe}),h.createElement("button",{"aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:Q,disabled:((w==null?void 0:w.results)??0)===0},dv),h.createElement("button",{"aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ne,disabled:((w==null?void 0:w.results)??0)===0},fv),f!==void 0&&h.createElement("button",{"aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:F},hv)),w!==void 0?h.createElement(h.Fragment,null,h.createElement("div",{className:"gdg-search-status"},h.createElement("div",{"data-testid":"search-result-area"},G)),h.createElement("div",{className:"gdg-search-progress",style:be})):h.createElement("div",{className:"gdg-search-status"},h.createElement("label",{htmlFor:g},"Type to search")))},[d,de,w,i,g,o,P,b,oe,Q,ne,f,F]);return h.createElement(h.Fragment,null,h.createElement(uv,{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,onHeaderIndicatorClick:e.onHeaderIndicatorClick,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,resizeIndicator:e.resizeIndicator}),ae)};class pv extends h.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",h.createRef());ft(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let i=n.target;for(;i!==null;){if(i.classList.contains("click-outside-ignore"))return;i=i.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:i,...r}=this.props;return h.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const vv=()=>e=>Math.max(16,e.targetHeight-10),bv=pn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[vv(),"px"]}}),wv=e=>{const{bounds:t,group:n,onClose:i,canvasBounds:r,onFinish:o}=e,[a,s]=te.useState(n);return te.createElement(pv,{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:i},te.createElement(bv,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:i,onFocus:l=>l.target.setSelectionRange(0,a.length),onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(a):l.key==="Escape"&&i()},autoFocus:!0}))};function yv(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 ut(e,t,n){const i=bd(e,t);return i&&(n.didMatch=!0),i}function bd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(bd(u,t))return!0;return!1}let n=!1,i=!1,r=!1,o=!1;const a=e.split("+"),s=a.pop();if(!yv(s,t))return!1;if(a[0]==="any")return!0;for(const l of a)switch(l){case"ctrl":n=!0;break;case"shift":i=!0;break;case"alt":r=!0;break;case"meta":o=!0;break;case"primary":wa.value?o=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===i&&t.metaKey===o}function Cv(e,t,n,i,r,o,a){const s=te.useCallback((c,d,f,g)=>{var S;(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!a&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(f||g==="drag"),p=i==="mixed"&&m,b=r==="mixed"&&m;let y={current:c===void 0?void 0:{...c,rangeStack:g==="drag"?((S=e.current)==null?void 0:S.rangeStack)??[]:[]},columns:p?e.columns:yt.empty(),rows:b?e.rows:yt.empty()};f&&(o==="multi-rect"||o==="multi-cell")&&y.current!==void 0&&e.current!==void 0&&(y={...y,current:{...y.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(y,d)},[i,e,n,o,a,r,t]),l=te.useCallback((c,d,f)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let g;if(r==="exclusive"&&c.length>0)g={current:void 0,columns:yt.empty(),rows:c};else{const m=f&&n==="mixed",p=f&&i==="mixed";g={current:m?e.current:void 0,columns:p?e.columns:yt.empty(),rows:c}}t(g,!1)},[i,e,n,r,t]),u=te.useCallback((c,d,f)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let g;if(i==="exclusive"&&c.length>0)g={current:void 0,rows:yt.empty(),columns:c};else{const m=f&&n==="mixed",p=f&&r==="mixed";g={current:m?e.current:void 0,rows:p?e.rows:yt.empty(),columns:c}}t(g,!1)},[i,e,n,r,t]);return[s,l,u]}function Sv(e,t,n,i,r){const o=h.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const f=[];for(let g=u.x;g<u.x+u.width;g++)g<0||d>=r?f.push({kind:Z.Loading,allowOverlay:!1}):f.push(t([g,d]));c.push(f)}return c}return(e==null?void 0:e(u,i.signal))??[]},[i.signal,t,e,r]),a=e!==void 0?o:void 0,s=h.useCallback(u=>{if(a===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=a(c,i.signal);return typeof d=="function"?async()=>(await d()).map(f=>[{kind:Z.Loading,allowOverlay:!1},...f]):d.map(f=>[{kind:Z.Loading,allowOverlay:!1},...f])}return a(c,i.signal)},[i.signal,a,n]);return[e!==void 0?s:void 0,a]}function xv(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Ys?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:ao()}}function kv(e,t){return e.map((i,r)=>{const o=t[r];return i.map(a=>a.span!==void 0&&a.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:xv(a))})}function bu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Mv(e){var n;const t=[];for(const i of e){const r=[];for(const o of i)o.format==="url"?r.push(((n=o.rawValue)==null?void 0:n.toString())??""):o.format==="string-array"?r.push(o.formatted.map(a=>bu(a,!0)).join(",")):r.push(bu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
|
165
|
+
`},E0={headerRowID:Qp,headerNumber:t0,headerCode:e0,headerString:n0,headerBoolean:r0,headerAudioUri:o0,headerVideoUri:a0,headerEmoji:s0,headerImage:l0,headerUri:sd,headerPhone:u0,headerMarkdown:c0,headerDate:d0,headerTime:f0,headerEmail:h0,headerReference:g0,headerIfThenElse:m0,headerSingleValue:p0,headerLookup:v0,headerTextTemplate:b0,headerMath:w0,headerRollup:y0,headerJoinStrings:C0,headerSplitString:S0,headerGeoDistance:x0,headerArray:k0,rowOwnerOverlay:M0,protectedColumnOverlay:R0,renameIcon:i0};function I0(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class T0{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,i,r,o,a,s,l=1){const[u,c]=I0(n,s),d=a*Math.ceil(window.devicePixelRatio),f=`${u}_${c}_${d}_${t}`;let g=this.spriteMap.get(f);if(g===void 0){const m=this.headerIcons[t];if(m===void 0)return;g=document.createElement("canvas");const p=g.getContext("2d");if(p===null)return;const b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(f,g);const y=b.decode();if(y===void 0)return;this.inFlight++,y.then(()=>{p.drawImage(b,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(i.globalAlpha=l),i.drawImage(g,0,0,d,d,r,o,a,a),l<1&&(i.globalAlpha=1)}}function ld(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Fa(e,t,n,i,r,o,a,s,l){s=s??t;let u=t,c=e;const d=i-o;let f=!1;for(;u<n&&c<d;){const g=r(c);if(u+g>s&&l(u,c,g,!1,a&&c===i-1)===!0){f=!0;break}u+=g,c++}if(!f){u=n;for(let g=0;g<o;g++){c=i-1-g;const m=r(c);u-=m,l(u,c,m,!0,a&&c===i-1)}}}function Vr(e,t,n,i,r,o){let a=0,s=0;const l=r+i;for(const u of e){const c=u.sticky?s:a+n;if(o(u,c,l,u.sticky?0:s,t)===!0)break;a+=u.width,s+=u.sticky?u.width:0}}function ud(e,t,n,i,r){let o=0,a=0;for(let s=0;s<e.length;s++){const l=e[s];let u=s+1,c=l.width;for(l.sticky&&(a+=c);u<e.length&&so(e[u].group,l.group)&&e[u].sticky===e[s].sticky;){const p=e[u];c+=p.width,u++,s++,p.sticky&&(a+=p.width)}const d=l.sticky?0:n,f=o+d,g=l.sticky?0:Math.max(0,a-f),m=Math.min(c-g,t-(f+g));r([l.sourceIndex,e[u-1].sourceIndex],l.group??"",f+g,0,m,i),o+=c}}function cd(e,t,n,i,r,o,a){var f;const[s,l]=e;let u,c;const d=((f=a.find(g=>!g.sticky))==null?void 0:f.sourceIndex)??0;if(l>d){const g=Math.max(s,d);let m=t,p=i;for(let b=o.sourceIndex-1;b>=g;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=l;b++)p+=a[b].width;c={x:m,y:n,width:p,height:r}}if(d>s){const g=Math.min(l,d-1);let m=t,p=i;for(let b=o.sourceIndex-1;b>=s;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=g;b++)p+=a[b].width;u={x:m,y:n,width:p,height:r}}return[u,c]}function D0(e,t,n,i){if(i==="any")return dd(e,{x:t,y:n,width:1,height:1});if(i==="vertical"&&(t=e.x),i==="horizontal"&&(n=e.y),Gc([t,n],e))return;const r=t-e.x,o=e.x+e.width-t,a=n-e.y+1,s=e.y+e.height-n,l=Math.min(i==="vertical"?Number.MAX_SAFE_INTEGER:r,i==="vertical"?Number.MAX_SAFE_INTEGER:o,i==="horizontal"?Number.MAX_SAFE_INTEGER:a,i==="horizontal"?Number.MAX_SAFE_INTEGER:s);return l===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===a?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{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 lo(e,t,n,i,r,o,a,s){return e<=r+a&&r<=e+n&&t<=o+s&&o<=t+i}function ei(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function dd(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-i;return{x:n,y:i,width:r,height:o}}function O0(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 P0(e,t,n,i){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const r=-4,o=-4,a=t+4,s=n+4,l=r-e.x,u=e.x+e.width-a,c=o-e.y,d=e.y+e.height-s,f=l>0?e.x+Math.floor(l/i)*i:e.x,g=u>0?e.x+e.width-Math.floor(u/i)*i:e.x+e.width,m=c>0?e.y+Math.floor(c/i)*i:e.y,p=d>0?e.y+e.height-Math.floor(d/i)*i:e.y+e.height;return{x:f,y:m,width:g-f,height:p-m}}function _0(e,t,n,i,r){const[o,a,s,l]=t,[u,c,d,f]=r,{x:g,y:m,width:p,height:b}=e,y=[];if(p<=0||b<=0)return y;const w=g+p,S=m+b,M=g<o,C=m<a,x=g+p>s,R=m+b>l,I=g>=o&&g<s||w>o&&w<=s||g<o&&w>s,E=m>=a&&m<l||S>a&&S<=l||m<a&&S>l;if(I&&E){const z=Math.max(g,o),_=Math.max(m,a),F=Math.min(w,s),P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:c,width:d-u+1,height:f-c+1}})}if(M&&C){const z=g,_=m,F=Math.min(w,o),P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:0,width:u+1,height:c+1}})}if(C&&I){const z=Math.max(g,o),_=m,F=Math.min(w,s),P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(C&&x){const z=Math.max(g,s),_=m,F=w,P=Math.min(S,a);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(M&&E){const z=g,_=Math.max(m,a),F=Math.min(w,o),P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:c,width:u+1,height:f-c+1}})}if(x&&E){const z=Math.max(g,s),_=Math.max(m,a),F=w,P=Math.min(S,l);y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:c,width:n-d+1,height:f-c+1}})}if(M&&R){const z=g,_=Math.max(m,l),F=Math.min(w,o),P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:0,y:f,width:u+1,height:i-f+1}})}if(R&&I){const z=Math.max(g,o),_=Math.max(m,l),F=Math.min(w,s),P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:u,y:f,width:d-u+1,height:i-f+1}})}if(x&&R){const z=Math.max(g,s),_=Math.max(m,l),F=w,P=S;y.push({rect:{x:z,y:_,width:F-z,height:P-_},clip:{x:d,y:f,width:n-d+1,height:i-f+1}})}return y}const L0={kind:Z.Loading,allowOverlay:!1};function du(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w,S,M,C,x,R,I,E,L,z,_,F,P,ne,Q,oe,de){let xe=(S==null?void 0:S.size)??Number.MAX_SAFE_INTEGER;const ae=performance.now();let G=F.baseFontFull;e.font=G;const se={ctx:e},ie=[0,0],be=b>0?ri(l,b,u):0;let we,j;const O=ld(w);return Vr(t,s,o,a,r,(k,N,re,Oe,Ve)=>{const he=Math.max(0,Oe-N),tt=N+he,ke=r+1,Dt=k.width-he,bt=i-r-1;if(w.length>0){let De=!1;for(let Ae=0;Ae<w.length;Ae++){const nt=w[Ae];if(lo(tt,ke,Dt,bt,nt.x,nt.y,nt.width,nt.height)){De=!0;break}}if(!De)return}const rt=()=>{e.save(),e.beginPath(),e.rect(tt,ke,Dt,bt),e.clip()},J=M.columns.hasIndex(k.sourceIndex),it=d(k.group??"").overrideTheme,ce=k.themeOverride===void 0&&it===void 0?F:xr(F,it,k.themeOverride),le=ce.baseFontFull;le!==G&&(G=le,e.font=le),rt();let me;return Fa(Ve,re,i,l,u,b,y,O,(De,Ae,nt,ge,Re)=>{var gn,vn,hn;if(Ae<0||(ie[0]=k.sourceIndex,ie[1]=Ae,S!==void 0&&!S.has(ie)))return;if(w.length>0){let ot=!1;for(let Gt=0;Gt<w.length;Gt++){const At=w[Gt];if(lo(N,De,k.width,nt,At.x,At.y,At.width,At.height)){ot=!0;break}}if(!ot)return}const lt=M.rows.hasIndex(Ae),He=g.hasIndex(Ae),et=Ae<l?c(ie):L0;let wt=N,dt=k.width,ze=!1,Pt=!1;if(et.span!==void 0){const[ot,Gt]=et.span,At=`${Ae},${ot},${Gt},${k.sticky}`;if(j===void 0&&(j=new Set),j.has(At)){xe--;return}else{const on=cd(et.span,N,De,k.width,nt,k,n),It=k.sticky?on[0]:on[1];if(!k.sticky&&on[0]!==void 0&&(Pt=!0),It!==void 0){wt=It.x,dt=It.width,j.add(At),e.restore(),me=void 0,e.save(),e.beginPath();const $t=Math.max(0,Oe-It.x);e.rect(It.x+$t,De,It.width-$t,nt),we===void 0&&(we=[]),we.push({x:It.x+$t,y:De,width:It.width-$t,height:nt}),e.clip(),ze=!0}}}const _t=f==null?void 0:f(Ae),mt=Re&&((gn=k.trailingRowOptions)==null?void 0:gn.themeOverride)!==void 0?(vn=k.trailingRowOptions)==null?void 0:vn.themeOverride:void 0,Lt=et.themeOverride===void 0&&_t===void 0&&mt===void 0?ce:xr(ce,_t,mt,et.themeOverride);e.beginPath();const rn=dp(ie,et,M);let zt=fp(ie,et,M,p);const Cn=et.span!==void 0&&M.columns.some(ot=>et.span!==void 0&&ot>=et.span[0]&&ot<=et.span[1]);rn&&!m&&p?zt=0:rn&&p&&(zt=Math.max(zt,1)),Cn&&zt++,rn||(lt&&zt++,J&&!Re&&zt++);const Ut=et.kind===Z.Protected?Lt.bgCellMedium:Lt.bgCell;let kt;if((ge||Ut!==F.bgCell)&&(kt=Hn(Ut,kt)),zt>0||He){He&&(kt=Hn(Lt.bgHeader,kt));for(let ot=0;ot<zt;ot++)kt=Hn(Lt.accentLight,kt)}else if(C!==void 0){for(const ot of C)if(ot[0]===k.sourceIndex&&ot[1]===Ae){kt=Hn(Lt.bgSearchResult,kt);break}}if(x!==void 0)for(let ot=0;ot<x.length;ot++){const Gt=x[ot],At=Gt.range;Gt.style!=="solid-outline"&&At.x<=k.sourceIndex&&k.sourceIndex<At.x+At.width&&At.y<=Ae&&Ae<At.y+At.height&&(kt=Hn(Gt.color,kt))}let Pn=!1;if(S!==void 0){const ot=De+1,At=(ge?ot+nt-1:Math.min(ot+nt-1,i-be))-ot;(At!==nt-1||wt+1<=Oe)&&(Pn=!0,e.save(),e.beginPath(),e.rect(wt+1,ot,dt-1,At),e.clip()),kt=kt===void 0?Lt.bgCell:Hn(kt,Lt.bgCell)}const Sn=k.sourceIndex===n.length-1,Pe=Ae===l-1;kt!==void 0&&(e.fillStyle=kt,me!==void 0&&(me.fillStyle=kt),S!==void 0?e.fillRect(wt+1,De+1,dt-(Sn?2:1),nt-(Pe?2:1)):e.fillRect(wt,De,dt,nt)),et.style==="faded"&&(e.globalAlpha=.6);let Ft;for(let ot=0;ot<E.length;ot++){const Gt=E[ot];if(Gt.item[0]===k.sourceIndex&&Gt.item[1]===Ae){Ft=Gt;break}}if(dt>de&&!Pt){const ot=Lt.baseFontFull;ot!==G&&(e.font=ot,G=ot),me=fd(e,et,k.sourceIndex,Ae,Sn,Pe,wt,De,dt,nt,zt>0,Lt,kt??Lt.bgCell,R,I,(Ft==null?void 0:Ft.hoverAmount)??0,L,_,ae,z,me,P,ne,Q,oe)}return Pn&&e.restore(),et.style==="faded"&&(e.globalAlpha=1),xe--,ze&&(e.restore(),(hn=me==null?void 0:me.deprep)==null||hn.call(me,se),me=void 0,rt(),G=le,e.font=le),xe<=0}),e.restore(),xe<=0}),we}const Ui=[0,0],Xi={x:0,y:0,width:0,height:0},fs=[void 0,()=>{}];let As=!1;function F0(){As=!0}function fd(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w,S,M,C,x,R,I){var ne,Q;let E,L;b!==void 0&&b[0][0]===n&&b[0][1]===i&&(E=b[1][0],L=b[1][1]);let z;Ui[0]=n,Ui[1]=i,Xi.x=a,Xi.y=s,Xi.width=l,Xi.height=u,fs[0]=x.getValue(Ui),fs[1]=oe=>x.setValue(Ui,oe),As=!1;const _={ctx:e,theme:d,col:n,row:i,cell:t,rect:Xi,highlighted:c,cellFillColor:f,hoverAmount:p,frameTime:w,hoverX:E,drawState:fs,hoverY:L,imageLoader:g,spriteManager:m,hyperWrapping:y,overrideCursor:E!==void 0?I:void 0,requestAnimationFrame:F0},F=bp(_,t.lastUpdated,w,M,r,o),P=R(t);if(P!==void 0){(M==null?void 0:M.renderer)!==P&&((ne=M==null?void 0:M.deprep)==null||ne.call(M,_),M=void 0);const oe=(Q=P.drawPrep)==null?void 0:Q.call(P,_,M);S!==void 0&&!wi(_.cell)?S(_,()=>P.draw(_,t)):P.draw(_,t),z=oe===void 0?void 0:{deprep:oe==null?void 0:oe.deprep,fillStyle:oe==null?void 0:oe.fillStyle,font:oe==null?void 0:oe.font,renderer:P}}return(F||As)&&(C==null||C(Ui)),z}function il(e,t,n,i,r,o,a,s,l=-20,u=-20,c=32,d="center",f="square"){const g=Math.floor(r+a/2),m=f==="circle"?1e4:t.roundingRadius??4;let p=Hc(c,a,t.cellVerticalPadding),b=p/2;const y=Ac(d,i,o,t.cellHorizontalPadding,p),w=Fc(y,g,p),S=zc(i+l,r+u,w);switch(n){case!0:{e.beginPath(),pr(e,y-p/2,g-p/2,p,p,m),f==="circle"&&(b*=.8,p*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(y-b+p/4.23,g-b+p/1.97),e.lineTo(y-b+p/2.42,g-b+p/1.44),e.lineTo(y-b+p/1.29,g-b+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ca:case!1:{e.beginPath(),pr(e,y-p/2+.5,g-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=S?t.textDark:t.textMedium,e.stroke();break}case Ys:{e.beginPath(),pr(e,y-p/2,g-p/2,p,p,m),e.fillStyle=S?t.textMedium:t.textLight,e.fill(),f==="circle"&&(b*=.8,p*=.8),e.beginPath(),e.moveTo(y-p/3,g),e.lineTo(y+p/3,g),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:ao()}}function A0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){var E,L,z,_;const S=a+s;if(S<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,r,S);const M=(E=i==null?void 0:i[0])==null?void 0:E[0],C=(L=i==null?void 0:i[0])==null?void 0:L[1],x=(z=i==null?void 0:i[1])==null?void 0:z[0],R=(_=i==null?void 0:i[1])==null?void 0:_[1],I=d.headerFontFull;e.font=I,Vr(t,0,o,0,S,(F,P,ne,Q)=>{var k;if(b!==void 0&&!b.has([F.sourceIndex,-1]))return;const oe=Math.max(0,Q-P);e.save(),e.beginPath(),e.rect(P+oe,s,F.width-oe,a),e.clip();const de=p(F.group??"").overrideTheme,xe=F.themeOverride===void 0&&de===void 0?d:xr(d,de,F.themeOverride);xe.bgHeader!==d.bgHeader&&(e.fillStyle=xe.bgHeader,e.fill()),xe!==d&&(e.font=xe.baseFontFull);const ae=c.columns.hasIndex(F.sourceIndex),G=l!==void 0||u,se=!G&&C===-1&&M===F.sourceIndex,ie=G?0:((k=g.find(N=>N.item[0]===F.sourceIndex&&N.item[1]===-1))==null?void 0:k.hoverAmount)??0,be=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===F.sourceIndex,we=ae?xe.accentColor:be?xe.bgHeaderHasFocus:xe.bgHeader,j=n?s:0,O=F.sourceIndex===0?0:1;ae?(e.fillStyle=we,e.fillRect(P+O,j,F.width-O,a)):(be||ie>0)&&(e.beginPath(),e.rect(P+O,j,F.width-O,a),be&&(e.fillStyle=xe.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=xe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),md(e,P,j,F.width,a,F,ae,xe,se,se?x:void 0,se?R:void 0,be,ie,f,y,w),e.restore()}),n&&H0(e,t,r,o,s,i,d,f,g,m,p,b)}function H0(e,t,n,i,r,o,a,s,l,u,c,d){const[g,m]=(o==null?void 0:o[0])??[];let p=0;ud(t,n,i,r,(b,y,w,S,M,C)=>{if(d!==void 0&&!d.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(w,S,M,C),e.clip();const x=c(y),R=(x==null?void 0:x.overrideTheme)===void 0?a:xr(a,x.overrideTheme),I=m===-2&&g!==void 0&&g>=b[0]&&g<=b[1],E=I?R.bgHeaderHovered:R.bgHeader;if(E!==a.bgHeader&&(e.fillStyle=E,e.fill()),e.fillStyle=R.textGroupHeader??R.textHeader,x!==void 0){let L=w;if(x.icon!==void 0&&(s.drawSprite(x.icon,"normal",e,L+8,(r-20)/2,20,R),L+=26),e.fillText(x.name,L+8,r/2+vr(e,a.headerFontFull)),x.actions!==void 0&&I){const z=hd({x:w,y:S,width:M,height:C},x.actions);e.beginPath();const _=z[0].x-10,F=w+M-_;e.rect(_,0,F,r);const P=e.createLinearGradient(_,0,_+F,0),ne=ti(E,0);P.addColorStop(0,ne),P.addColorStop(10/F,E),P.addColorStop(1,E),e.fillStyle=P,e.fill(),e.globalAlpha=.6;const[Q,oe]=(o==null?void 0:o[1])??[-1,-1];for(let de=0;de<x.actions.length;de++){const xe=x.actions[de],ae=z[de],G=ei(ae,Q+w,oe);G&&(e.globalAlpha=1),s.drawSprite(xe.icon,"normal",e,ae.x+ae.width/2-10,ae.y+ae.height/2-10,20,R),G&&(e.globalAlpha=.6)}e.globalAlpha=1}}w!==0&&u(b[0])&&(e.beginPath(),e.moveTo(w+.5,0),e.lineTo(w+.5,r),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=w+M}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,r),e.moveTo(0,r+.5),e.lineTo(n,r+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const Go=30;function z0(e,t,n,i,r){return{x:e+n-Go,y:Math.max(t,t+i/2-Go/2),width:Go,height:Math.min(Go,i)}}function hd(e,t){const n=[];let i=e.x+e.width-26*t.length;const r=e.y+e.height/2-13,o=26,a=26;for(let s=0;s<t.length;s++)n.push({x:i,y:r,width:a,height:o}),i+=26;return n}function Yi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function gd(e,t,n,i,r,o,a,s){var y;const l=a.cellHorizontalPadding,u=a.headerIconSize,c=z0(n,i,r,o);let d=n+l;const f=t.icon===void 0?void 0:{x:d,y:i+(o-u)/2,width:u,height:u},g=f===void 0||t.overlayIcon===void 0?void 0:{x:f.x+9,y:f.y+6,width:18,height:18};f!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:i,width:r-d,height:o};let p;if(t.indicatorIcon!==void 0){const w=e===void 0?((y=Zc(t.title,a.headerFontFull))==null?void 0:y.width)??0:ii(t.title,e,a.headerFontFull).width;m.width=w,d+=w+l,p={x:d,y:i+(o-u)/2,width:u,height:u}}const b=n+r/2;return{menuBounds:Yi(c,b,s),iconBounds:Yi(f,b,s),iconOverlayBounds:Yi(g,b,s),textBounds:Yi(m,b,s),indicatorIconBounds:Yi(p,b,s)}}function fu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const w=o.rowMarkerChecked;w!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const S=o.headerRowMarkerTheme!==void 0?xr(s,o.headerRowMarkerTheme):s;il(e,S,w,t,n,i,r,!1,void 0,void 0,18,"center",o.rowMarker),w!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=a?s.textHeaderSelected:s.textHeader,y=o.hasMenu===!0&&(l||g&&a)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let w=a?"selected":"normal";o.style==="highlight"&&(w=a?"selected":"special"),f.drawSprite(o.icon,w,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,s),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&f.drawSprite(o.overlayIcon,a?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,s)}if(y&&i>35){const S=m?35:i-35,M=m?35*.7:i-35*.7,C=S/i,x=M/i,R=e.createLinearGradient(t,0,t+i,0),I=ti(b,0);R.addColorStop(m?1:0,b),R.addColorStop(C,b),R.addColorStop(x,I),R.addColorStop(m?0:1,I),e.fillStyle=R}else e.fillStyle=b;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+r/2+vr(e,s.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!y||!lo(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let w=a?"selected":"normal";o.style==="highlight"&&(w=a?"selected":"special"),f.drawSprite(o.indicatorIcon,w,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,s)}if(y&&p.menuBounds!==void 0){const w=p.menuBounds,S=u!==void 0&&c!==void 0&&ei(w,u+t,c+n);if(S||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===da.Triangle){e.beginPath();const M=w.x+w.width/2-5.5,C=w.y+w.height/2-3;Sp(e,[{x:M,y:C},{x:M+11,y:C},{x:M+5.5,y:C+6}],1),e.fillStyle=b,e.fill()}else if(o.menuIcon===da.Dots){e.beginPath();const M=w.x+w.width/2,C=w.y+w.height/2;Cp(e,M,C),e.fillStyle=b,e.fill()}else{const M=w.x+(w.width-s.headerIconSize)/2,C=w.y+(w.height-s.headerIconSize)/2;f.drawSprite(o.menuIcon,"normal",e,M,C,s.headerIconSize,s)}S||(e.globalAlpha=1)}}function md(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){const b=Js(o.title)==="rtl",y=gd(e,o,t,n,i,r,s,b);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:i,height:r},column:o,columnIndex:o.sourceIndex,isSelected:a,hoverAmount:f,isHovered:l,hasSelectedCell:d,spriteManager:g,menuBounds:(y==null?void 0:y.menuBounds)??{x:0,y:0,height:0,width:0}},()=>fu(e,t,n,i,r,o,a,s,l,u,c,f,g,p,b,y)):fu(e,t,n,i,r,o,a,s,l,u,c,f,g,p,b,y)}function $0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){if(y!==void 0||t[t.length-1]!==n[t.length-1])return;const S=ld(b);Vr(t,l,a,s,o,(M,C,x,R,I)=>{if(M!==t[t.length-1])return;C+=M.width;const E=Math.max(C,R);E>i||(e.save(),e.beginPath(),e.rect(E,o+1,1e4,r-o-1),e.clip(),Fa(I,x,r,u,c,m,p,S,(L,z,_,F)=>{if(!F&&b.length>0&&!b.some(de=>lo(C,L,1e4,_,de.x,de.y,de.width,de.height)))return;const P=f.hasIndex(z),ne=g.hasIndex(z);e.beginPath();const Q=d==null?void 0:d(z),oe=Q===void 0?w:xr(w,Q);oe.bgCell!==w.bgCell&&(e.fillStyle=oe.bgCell,e.fillRect(C,L,1e4,_)),ne&&(e.fillStyle=oe.bgHeader,e.fillRect(C,L,1e4,_)),P&&(e.fillStyle=oe.accentLight,e.fillRect(C,L,1e4,_))}),e.restore())})}function V0(e,t,n,i,r,o,a,s,l){let u=!1;for(const m of t)if(!m.sticky){u=a(m.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,f=u?ki(t):0;let g;if(f!==0&&(g=su(d,l.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,i),e.strokeStyle=g,e.stroke()),r>0){const m=d===c&&g!==void 0?g:su(c,l.bgCell),p=ri(o,r,s);e.beginPath(),e.moveTo(0,i-p+.5),e.lineTo(n,i-p+.5),e.strokeStyle=m,e.stroke()}}const pd=(e,t,n)=>{let i=0,r=t,o=0,a=n;if(e!==void 0&&e.length>0){i=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const s of e)i=Math.min(i,s.x-1),r=Math.max(r,s.x+s.width+1),o=Math.min(o,s.y-1),a=Math.max(a,s.y+s.height+1)}return{minX:i,maxX:r,minY:o,maxY:a}};function N0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m){var _;const p=m.bgCell,{minX:b,maxX:y,minY:w,maxY:S}=pd(s,o,a),M=[],C=a-ri(g,f,u);let x=l,R=n,I=0;for(;x+r<C;){const F=x+r,P=u(R);if(F>=w&&F<=S-1){const ne=c==null?void 0:c(R),Q=ne==null?void 0:ne.bgCell;Q!==void 0&&Q!==p&&R>=g-f&&M.push({x:b,y:F,w:y-b,h:P,color:Q})}x+=P,R<g-f&&(I=x),R++}let E=0;const L=Math.min(C,S)-I;if(L>0)for(let F=0;F<t.length;F++){const P=t[F];if(P.width===0)continue;const ne=P.sticky?E:E+i,Q=(_=P.themeOverride)==null?void 0:_.bgCell;Q!==void 0&&Q!==p&&ne>=b&&ne<=y&&d(F+1)&&M.push({x:ne,y:I,w:P.width,h:L,color:Q}),E+=P.width}if(M.length===0)return;let z;e.beginPath();for(let F=M.length-1;F>=0;F--){const P=M[F];z===void 0?z=P.color:P.color!==z&&(e.fillStyle=z,e.fill(),e.beginPath(),z=P.color),e.rect(P.x,P.y,P.w,P.h)}z!==void 0&&(e.fillStyle=z,e.fill()),e.beginPath()}function hu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,a);for(const _ of l)e.rect(_.x+1,_.y+1,_.width-1,_.height-1);e.clip("evenodd")}const w=b.horizontalBorderColor??b.borderColor,S=b.borderColor,{minX:M,maxX:C,minY:x,maxY:R}=pd(s,o,a),I=[];e.beginPath();let E=.5;for(let _=0;_<t.length;_++){const F=t[_];if(F.width===0)continue;E+=F.width;const P=F.sticky?E:E+i;P>=M&&P<=C&&g(_+1)&&I.push({x1:P,y1:Math.max(u,x),x2:P,y2:Math.min(a,R),color:S})}let L=a+.5;for(let _=p-m;_<p;_++){const F=d(_);L-=F,I.push({x1:M,y1:L,x2:C,y2:L,color:w})}if(y!==!0){let _=c+.5,F=n;const P=L;for(;_+r<P;){const ne=_+r;if(ne>=x&&ne<=R-1){const Q=f==null?void 0:f(F);I.push({x1:M,y1:ne,x2:C,y2:ne,color:(Q==null?void 0:Q.horizontalBorderColor)??(Q==null?void 0:Q.borderColor)??w})}_+=d(F),F++}}const z=th(I,_=>_.color);for(const _ of Object.keys(z)){e.strokeStyle=_;for(const F of z[_])e.moveTo(F.x1,F.y1),e.lineTo(F.x2,F.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function B0(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b,y,w){const S=[];e.imageSmoothingEnabled=!1;const M=Math.min(r.cellYOffset,a),C=Math.max(r.cellYOffset,a);let x=0;if(typeof y=="number")x+=(C-M)*y;else for(let P=M;P<C;P++)x+=y(P);a>r.cellYOffset&&(x=-x),x+=l-r.translateY;const R=Math.min(r.cellXOffset,o),I=Math.max(r.cellXOffset,o);let E=0;for(let P=R;P<I;P++)E+=p[P].width;o>r.cellXOffset&&(E=-E),E+=s-r.translateX;const L=ki(b);if(E!==0&&x!==0)return{regions:[]};const z=u>0?ri(f,u,y):0,_=c-L-Math.abs(E),F=d-g-z-Math.abs(x)-1;if(_>150&&F>150){const P={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(x>0?(P.sy=(g+1)*m,P.sh=F*m,P.dy=(x+g+1)*m,P.dh=F*m,S.push({x:0,y:g,width:c,height:x+1})):x<0&&(P.sy=(-x+g+1)*m,P.sh=F*m,P.dy=(g+1)*m,P.dh=F*m,S.push({x:0,y:d+x-z,width:c,height:-x+z})),E>0?(P.sx=L*m,P.sw=_*m,P.dx=(E+L)*m,P.dw=_*m,S.push({x:L-1,y:0,width:E+2,height:d})):E<0&&(P.sx=(L-E)*m,P.sw=_*m,P.dx=L*m,P.dw=_*m,S.push({x:c+E,y:0,width:-E,height:d})),e.setTransform(1,0,0,1,0,0),w){if(L>0&&E!==0&&x===0&&(i===void 0||(n==null?void 0:n[1])!==!1)){const ne=L*m,Q=d*m;e.drawImage(t,0,0,ne,Q,0,0,ne,Q)}if(z>0&&E===0&&x!==0&&(i===void 0||(n==null?void 0:n[0])!==!1)){const ne=(d-z)*m,Q=c*m,oe=z*m;e.drawImage(t,0,ne,Q,oe,0,ne,Q,oe)}}e.drawImage(t,P.sx,P.sy,P.sw,P.sh,P.dx,P.dy,P.dw,P.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:S}}function W0(e,t,n,i,r,o,a,s,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||i!==e.translateX||r!==e.translateY||Vr(l,n,i,r,s,(d,f,g,m)=>{if(d.sourceIndex===u){const p=Math.max(f,m)+1;return c.push({x:p,y:0,width:o-p,height:a}),!0}}),c}function U0(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 n;for(let i=0;i<e.mappedColumns.length;i++){const r=e.mappedColumns[i],o=t.mappedColumns[i];if(xi(r,o))continue;if(n!==void 0||r.width===o.width)return!1;const{width:a,...s}=r,{width:l,...u}=o;if(!xi(s,u))return!1;n=i}return n===void 0?!0:n}return!0}function gu(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p){const b=m==null?void 0:m.filter(R=>R.style!=="no-outline");if(b===void 0||b.length===0)return;const y=ki(s),w=ri(g,f,d),S=[l,0,s.length,g-f],M=[y,0,t,n-w],C=b.map(R=>{const I=R.range,E=R.style??"dashed";return _0(I,S,t,n,M).map(L=>{const z=L.rect,_=Ls(z.x,z.y,t,n,c,u+c,i,r,o,a,g,l,f,s,d),F=z.width===1&&z.height===1?_:Ls(z.x+z.width-1,z.y+z.height-1,t,n,c,u+c,i,r,o,a,g,l,f,s,d);return z.x+z.width>=s.length&&(F.width-=1),z.y+z.height>=g&&(F.height-=1),{color:R.color,style:E,clip:L.clip,rect:P0({x:_.x,y:_.y,width:F.x+F.width-_.x,height:F.y+F.height-_.y},t,n,8)}})}),x=()=>{e.lineWidth=1;let R=!1;for(const I of C)for(const E of I)if((E==null?void 0:E.rect)!==void 0&&lo(0,0,t,n,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){const L=R,z=!O0(E.clip,E.rect);z&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!R?(e.setLineDash([5,3]),R=!0):(E.style==="solid"||E.style==="solid-outline")&&R&&(e.setLineDash([]),R=!1),e.strokeStyle=E.style==="solid-outline"?Hn(Hn(E.color,p.borderColor),p.bgCell):ti(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),z&&(e.restore(),R=L)}R&&e.setLineDash([])};return x(),x}function mu(e,t,n,i,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function hs(e,t,n,i,r,o,a,s,l,u,c,d,f,g,m,p,b){if(c.current===void 0)return;const y=c.current.range,w=c.current.cell,S=[y.x+y.width-1,y.y+y.height-1];if(w[1]>=b&&S[1]>=b||!a.some(P=>P.sourceIndex===w[0]||P.sourceIndex===S[0]))return;const[C,x]=c.current.cell,R=f(c.current.cell),I=R.span??[C,C],E=x>=b-g,L=g>0&&!E?ri(b,g,d)-1:0,z=S[1];let _;if(Vr(a,i,r,o,u,(P,ne,Q,oe,de)=>{if(P.sticky&&C>P.sourceIndex)return;const xe=P.sourceIndex<I[0],ae=P.sourceIndex>I[1],G=P.sourceIndex===S[0];if(!(!G&&(xe||ae)))return Fa(de,Q,n,b,d,g,m,void 0,(se,ie,be)=>{if(ie!==x&&ie!==z)return;let we=ne,j=P.width;if(R.span!==void 0){const k=cd(R.span,ne,se,P.width,be,P,s),N=P.sticky?k[0]:k[1];N!==void 0&&(we=N.x,j=N.width)}return ie===z&&G&&p&&(_=()=>{var k;oe>we&&!P.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip()),e.beginPath(),e.rect(we+j-4,se+be-4,4,4),e.fillStyle=((k=P.themeOverride)==null?void 0:k.accentColor)??l.accentColor,e.fill()}),_!==void 0}),_!==void 0}),_===void 0)return;const F=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-L),e.clip(),_==null||_(),e.restore()};return F(),F}function X0(e,t,n,i,r,o,a,s,l){l===void 0||l.size===0||(e.beginPath(),ud(t,n,o,i,(u,c,d,f,g,m)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,f,g,m)}),Vr(t,s,o,a,r,(u,c,d,f)=>{const g=Math.max(0,f-c),m=c+g+1,p=u.width-g-1;l.has([u.sourceIndex,-1])&&e.rect(m,i,p,r-i)}),e.clip())}function Y0(e,t,n,i,r,o,a,s,l,u){let c=0;return Vr(e,o,i,r,n,(d,f,g,m,p)=>(Fa(p,g,t,a,s,l,u,void 0,(b,y,w,S)=>{S||(c=Math.max(y,c))}),!0)),c}function pu(e,t){var Sn;const{canvasCtx:n,headerCanvasCtx:i,width:r,height:o,cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:f,dragAndDropState:g,theme:m,drawFocus:p,headerHeight:b,groupHeaderHeight:y,disabledRows:w,rowHeight:S,verticalBorder:M,overrideCursor:C,isResizing:x,selection:R,fillHandle:I,freezeTrailingRows:E,rows:L,getCellContent:z,getGroupDetails:_,getRowThemeOverride:F,isFocused:P,drawHeaderCallback:ne,prelightCells:Q,drawCellCallback:oe,highlightRegions:de,resizeCol:xe,imageLoader:ae,lastBlitData:G,hoverValues:se,hyperWrapping:ie,hoverInfo:be,spriteManager:we,maxScaleFactor:j,hasAppendRow:O,touchMode:k,enqueue:N,renderStateProvider:re,getCellRenderer:Oe,renderStrategy:Ve,bufferACtx:he,bufferBCtx:tt,damage:ke,minimumCellWidth:Dt,resizeIndicator:bt}=e;if(r===0||o===0)return;const rt=Ve==="double-buffer",J=Math.min(j,Math.ceil(window.devicePixelRatio??1)),it=Ve!=="direct"&&U0(e,t),ce=n.canvas;(ce.width!==r*J||ce.height!==o*J)&&(ce.width=r*J,ce.height=o*J,ce.style.width=r+"px",ce.style.height=o+"px");const le=i.canvas,me=d?y+b:b,De=me+1;(le.width!==r*J||le.height!==De*J)&&(le.width=r*J,le.height=De*J,le.style.width=r+"px",le.style.height=De+"px");const Ae=he.canvas,nt=tt.canvas;rt&&(Ae.width!==r*J||Ae.height!==o*J)&&(Ae.width=r*J,Ae.height=o*J,G.current!==void 0&&(G.current.aBufferScroll=void 0)),rt&&(nt.width!==r*J||nt.height!==o*J)&&(nt.width=r*J,nt.height=o*J,G.current!==void 0&&(G.current.bBufferScroll=void 0));const ge=G.current;if(it===!0&&a===(ge==null?void 0:ge.cellXOffset)&&s===(ge==null?void 0:ge.cellYOffset)&&l===(ge==null?void 0:ge.translateX)&&u===(ge==null?void 0:ge.translateY))return;let Re=null;rt&&(Re=n);const lt=i;let He;rt?ke!==void 0?He=(ge==null?void 0:ge.lastBuffer)==="b"?tt:he:He=(ge==null?void 0:ge.lastBuffer)==="b"?he:tt:He=n;const et=He.canvas,wt=rt?et===Ae?nt:Ae:ce,dt=typeof S=="number"?()=>S:S;lt.save(),He.save(),lt.beginPath(),He.beginPath(),lt.textBaseline="middle",He.textBaseline="middle",J!==1&&(lt.scale(J,J),He.scale(J,J));const ze=_s(c,a,r,g,l);let Pt=[];const _t=p&&((Sn=R.current)==null?void 0:Sn.cell[1])===s&&u===0;let mt=!1;if(de!==void 0){for(const Pe of de)if(Pe.style!=="no-outline"&&Pe.range.y===s&&u===0){mt=!0;break}}const Lt=()=>{A0(lt,ze,d,be,r,l,b,y,g,x,R,m,we,se,M,_,ke,ne,k),hu(lt,ze,s,l,u,r,o,void 0,void 0,y,me,dt,F,M,E,L,m,!0),lt.beginPath(),lt.moveTo(0,De-.5),lt.lineTo(r,De-.5),lt.strokeStyle=Hn(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),lt.stroke(),mt&&gu(lt,r,o,a,s,l,u,c,f,b,y,S,E,L,de,m),_t&&hs(lt,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L)};if(ke!==void 0){const Pe=ze[ze.length-1].sourceIndex+1,Ft=ke.hasItemInRegion([{x:a,y:-2,width:Pe,height:2},{x:a,y:s,width:Pe,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:a,y:L-E,width:Pe,height:E,when:E>0}]),gn=vn=>{du(vn,ze,c,o,me,l,u,s,L,dt,z,_,F,w,P,p,E,O,Pt,ke,R,Q,de,ae,we,se,be,oe,ie,m,N,re,Oe,C,Dt);const hn=R.current;I&&p&&hn!==void 0&&ke.has(jc(hn.range))&&hs(vn,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L)};Ft&&(gn(He),Re!==null&&(Re.save(),Re.scale(J,J),Re.textBaseline="middle",gn(Re),Re.restore()),ke.hasHeader()&&(X0(lt,ze,r,y,me,l,u,s,ke),Lt())),He.restore(),lt.restore();return}if((it!==!0||a!==(ge==null?void 0:ge.cellXOffset)||l!==(ge==null?void 0:ge.translateX)||_t!==(ge==null?void 0:ge.mustDrawFocusOnHeader)||mt!==(ge==null?void 0:ge.mustDrawHighlightRingsOnHeader))&&Lt(),it===!0){An(wt!==void 0&&ge!==void 0);const{regions:Pe}=B0(He,wt,wt===Ae?ge.aBufferScroll:ge.bBufferScroll,wt===Ae?ge.bBufferScroll:ge.aBufferScroll,ge,a,s,l,u,E,r,o,L,me,J,c,ze,S,rt);Pt=Pe}else it!==!1&&(An(ge!==void 0),Pt=W0(ge,a,s,l,u,r,o,me,ze,it));V0(He,ze,r,o,E,L,M,dt,m);const rn=gu(He,r,o,a,s,l,u,c,f,b,y,S,E,L,de,m),zt=p?hs(He,r,o,s,l,u,ze,c,m,me,R,dt,z,E,O,I,L):void 0;if(He.fillStyle=m.bgCell,Pt.length>0){He.beginPath();for(const Pe of Pt)He.rect(Pe.x,Pe.y,Pe.width,Pe.height);He.clip(),He.fill(),He.beginPath()}else He.fillRect(0,0,r,o);const Cn=du(He,ze,c,o,me,l,u,s,L,dt,z,_,F,w,P,p,E,O,Pt,ke,R,Q,de,ae,we,se,be,oe,ie,m,N,re,Oe,C,Dt);$0(He,ze,c,r,o,me,l,u,s,L,dt,F,R.rows,w,E,O,Pt,ke,m),N0(He,ze,s,l,u,r,o,Pt,me,dt,F,M,E,L,m),hu(He,ze,s,l,u,r,o,Pt,Cn,y,me,dt,F,M,E,L,m),rn==null||rn(),zt==null||zt(),x&&bt!=="none"&&Vr(ze,0,l,0,me,(Pe,Ft)=>Pe.sourceIndex===xe?(mu(lt,Ft+Pe.width,0,me+1,Hn(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),bt==="full"&&mu(He,Ft+Pe.width,me,o,Hn(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Re!==null&&(Re.fillStyle=m.bgCell,Re.fillRect(0,0,r,o),Re.drawImage(He.canvas,0,0));const Ut=Y0(ze,o,me,l,u,s,L,dt,E,O);ae==null||ae.setWindow({x:a,y:s,width:ze.length,height:Ut-s},f,Array.from({length:E},(Pe,Ft)=>L-1-Ft));const kt=ge!==void 0&&(a!==ge.cellXOffset||l!==ge.translateX),Pn=ge!==void 0&&(s!==ge.cellYOffset||u!==ge.translateY);G.current={cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mustDrawFocusOnHeader:_t,mustDrawHighlightRingsOnHeader:mt,lastBuffer:rt?et===Ae?"a":"b":void 0,aBufferScroll:et===Ae?[kt,Pn]:ge==null?void 0:ge.aBufferScroll,bBufferScroll:et===nt?[kt,Pn]:ge==null?void 0:ge.bBufferScroll},He.restore(),lt.restore()}const G0=80;function j0(e){const t=e-1;return t*t*t+1}class q0{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(i=>no(i.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(i=>no(i.item,t));return this.leavingItems=this.leavingItems.filter(i=>i!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:j0(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const i=(t-this.lastAnimationTime)/G0;for(const o of this.leavingItems)o.hoverAmount=Xn(o.hoverAmount-i,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Xn(this.currentHoveredItem.hoverAmount+i,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!no((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const i=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:i}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class K0{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ol(e){return new K0(e)}const Z0=ol(()=>window.navigator.userAgent.includes("Firefox")),ba=ol(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),wa=ol(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function J0(e){const t=h.useRef([]),n=h.useRef(0),i=h.useRef(e);i.current=e;const r=h.useCallback(()=>{const o=()=>window.requestAnimationFrame(a),a=()=>{const s=t.current.map(rl);t.current=[],i.current(new io(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:a)},[]);return h.useCallback(o=>{t.current.length===0&&r();const a=ar(o[0],o[1]);t.current.includes(a)||t.current.push(a)},[r])}const Ar="header",Gn="group-header",ya="out-of-bounds";var Ci;(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"})(Ci||(Ci={}));function vd(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])}const vu=6,Q0=(e,t)=>{if(e.kind===Z.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},ev=(e,t)=>{const{width:n,height:i,accessibilityHeight:r,columns:o,cellXOffset:a,cellYOffset:s,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:f,getCellContent:g,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:b,enableGroups:y,isFilling:w,onCanvasFocused:S,onCanvasBlur:M,isFocused:C,selection:x,freezeColumns:R,onContextMenu:I,freezeTrailingRows:E,fixedShadowX:L=!0,fixedShadowY:z=!0,drawFocusRing:_,onMouseDown:F,onMouseUp:P,onMouseMoveRaw:ne,onMouseMove:Q,onItemHovered:oe,dragAndDropState:de,firstColAccessible:xe,onKeyDown:ae,onKeyUp:G,highlightRegions:se,canvasRef:ie,onDragStart:be,onDragEnd:we,eventTargetRef:j,isResizing:O,resizeColumn:k,isDragging:N,isDraggable:re=!1,allowResize:Oe,disabledRows:Ve,hasAppendRow:he,getGroupDetails:tt,theme:ke,prelightCells:Dt,headerIcons:bt,verticalBorder:rt,drawCell:J,drawHeader:it,onCellFocused:ce,onDragOverCell:le,onDrop:me,onDragLeave:De,imageWindowLoader:Ae,smoothScrollX:nt=!1,smoothScrollY:ge=!1,experimental:Re,getCellRenderer:lt,resizeIndicator:He="full"}=e,et=e.translateX??0,wt=e.translateY??0,dt=Math.max(R,Math.min(o.length-1,a)),ze=h.useRef(null),Pt=h.useRef(window),_t=Pt.current,mt=Ae,Lt=h.useRef(),[rn,zt]=h.useState(!1),Cn=h.useRef([]),Ut=h.useRef(),[kt,Pn]=h.useState(),[Sn,Pe]=h.useState(),Ft=h.useRef(null),[gn,vn]=h.useState(),[hn,ot]=h.useState(!1),Gt=h.useRef(hn);Gt.current=hn;const At=h.useMemo(()=>new T0(bt,()=>{xn.current=void 0,$n.current()}),[bt]),on=y?c+l:l,It=h.useRef(-1),$t=((Re==null?void 0:Re.enableFirefoxRescaling)??!1)&&Z0.value,Ge=((Re==null?void 0:Re.enableSafariRescaling)??!1)&&ba.value;h.useLayoutEffect(()=>{window.devicePixelRatio===1||!$t&&!Ge||(It.current!==-1&&zt(!0),window.clearTimeout(It.current),It.current=window.setTimeout(()=>{zt(!1),It.current=-1},200))},[s,dt,et,wt,$t,Ge]);const Nt=up(o,R),Bt=L?ki(Nt,de):0,fe=h.useCallback((H,ee,ye)=>{const Ce=H.getBoundingClientRect();if(ee>=Nt.length||ye>=f)return;const ue=Ce.width/n,Me=Ls(ee,ye,n,i,c,on,dt,s,et,wt,f,R,E,Nt,d);return ue!==1&&(Me.x*=ue,Me.y*=ue,Me.width*=ue,Me.height*=ue),Me.x+=Ce.x,Me.y+=Ce.y,Me},[n,i,c,on,dt,s,et,wt,f,R,E,Nt,d]),Ne=h.useCallback((H,ee,ye,Ce)=>{const ue=H.getBoundingClientRect(),Me=ue.width/n,at=(ee-ue.left)/Me,st=(ye-ue.top)/Me,Ie=5,Mt=_s(Nt,dt,n,void 0,et);let Se=0,Ke=0;Ce instanceof MouseEvent&&(Se=Ce.button,Ke=Ce.buttons);const We=hp(at,Mt,et),ht=gp(st,i,y,l,c,f,d,s,wt,E),cn=(Ce==null?void 0:Ce.shiftKey)===!0,Tn=(Ce==null?void 0:Ce.ctrlKey)===!0,Ct=(Ce==null?void 0:Ce.metaKey)===!0,Zt=Ce!==void 0&&!(Ce instanceof MouseEvent)||(Ce==null?void 0:Ce.pointerType)==="touch",Jn=[at<0?-1:n<at?1:0,st<on?-1:i<st?1:0];let kn;if(We===-1||st<0||at<0||ht===void 0||at>n||st>i){const Tt=at>n?1:at<0?-1:0,Dn=st>i?1:st<0?-1:0;let Ln=Tt*2,St=Dn*2;Tt===0&&(Ln=We===-1?Ci.EndPadding:Ci.Center),Dn===0&&(St=ht===void 0?Ci.EndPadding:Ci.Center);let tn=!1;if(We===-1&&ht===-1){const Dr=fe(H,Nt.length-1,-1);An(Dr!==void 0),tn=ee<Dr.x+Dr.width+Ie}const Tr=at>n&&at<n+Os()||st>i&&st<i+Os();kn={kind:ya,location:[We!==-1?We:at<0?0:Nt.length-1,ht??f-1],region:[Ln,St],shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isEdge:tn,isTouch:Zt,button:Se,buttons:Ke,scrollEdge:Jn,isMaybeScrollbar:Tr}}else if(ht<=-1){let Tt=fe(H,We,ht);An(Tt!==void 0);let Dn=Tt!==void 0&&Tt.x+Tt.width-ee<=Ie;const Ln=We-1;ee-Tt.x<=Ie&&Ln>=0?(Dn=!0,Tt=fe(H,Ln,ht),An(Tt!==void 0),kn={kind:y&&ht===-2?Gn:Ar,location:[Ln,ht],bounds:Tt,group:Nt[Ln].group??"",isEdge:Dn,shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}):kn={kind:y&&ht===-2?Gn:Ar,group:Nt[We].group??"",location:[We,ht],bounds:Tt,isEdge:Dn,shiftKey:cn,ctrlKey:Tn,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}}else{const Tt=fe(H,We,ht);An(Tt!==void 0);const Dn=Tt!==void 0&&Tt.x+Tt.width-ee<Ie;let Ln=!1;if(u&&x.current!==void 0){const St=jc(x.current.range),tn=fe(H,St[0],St[1]);if(tn!==void 0){const Tr=tn.x+tn.width-2,Dr=tn.y+tn.height-2;Ln=Math.abs(Tr-ee)<vu&&Math.abs(Dr-ye)<vu}}kn={kind:"cell",location:[We,ht],bounds:Tt,isEdge:Dn,shiftKey:cn,ctrlKey:Tn,isFillHandle:Ln,metaKey:Ct,isTouch:Zt,localEventX:ee-Tt.x,localEventY:ye-Tt.y,button:Se,buttons:Ke,scrollEdge:Jn}}return kn},[n,Nt,dt,et,i,y,l,c,f,d,s,wt,E,fe,u,x,on]),[Kt]=kt??[],En=h.useRef(()=>{}),ln=h.useRef(kt);ln.current=kt;const[A,je]=h.useMemo(()=>{const H=document.createElement("canvas"),ee=document.createElement("canvas");return H.style.display="none",H.style.opacity="0",H.style.position="fixed",ee.style.display="none",ee.style.opacity="0",ee.style.position="fixed",[H.getContext("2d",{alpha:!1}),ee.getContext("2d",{alpha:!1})]},[]);h.useLayoutEffect(()=>{if(!(A===null||je===null))return document.documentElement.append(A.canvas),document.documentElement.append(je.canvas),()=>{A.canvas.remove(),je.canvas.remove()}},[A,je]);const $e=h.useMemo(()=>new xp,[]),Ot=$t&&rn?1:Ge&&rn?2:5,un=(Re==null?void 0:Re.disableMinimumCellWidth)===!0?1:10,xn=h.useRef(),qn=h.useRef(null),_n=h.useRef(null),Qt=h.useCallback(()=>{var at;const H=ze.current,ee=Ft.current;if(H===null||ee===null||(qn.current===null&&(qn.current=H.getContext("2d",{alpha:!1}),H.width=0,H.height=0),_n.current===null&&(_n.current=ee.getContext("2d",{alpha:!1}),ee.width=0,ee.height=0),qn.current===null||_n.current===null||A===null||je===null))return;let ye=!1;const Ce=st=>{ye=!0,vn(st)},ue=xn.current,Me={headerCanvasCtx:_n.current,canvasCtx:qn.current,bufferACtx:A,bufferBCtx:je,width:n,height:i,cellXOffset:dt,cellYOffset:s,translateX:Math.round(et),translateY:Math.round(wt),mappedColumns:Nt,enableGroups:y,freezeColumns:R,dragAndDropState:de,theme:ke,headerHeight:l,groupHeaderHeight:c,disabledRows:Ve??yt.empty(),rowHeight:d,verticalBorder:rt,isResizing:O,resizeCol:k,isFocused:C,selection:x,fillHandle:u,drawCellCallback:J,hasAppendRow:he,overrideCursor:Ce,maxScaleFactor:Ot,freezeTrailingRows:E,rows:f,drawFocus:_,getCellContent:g,getGroupDetails:tt??(st=>({name:st})),getRowThemeOverride:m,drawHeaderCallback:it,prelightCells:Dt,highlightRegions:se,imageLoader:mt,lastBlitData:Ut,damage:Lt.current,hoverValues:Cn.current,hoverInfo:ln.current,spriteManager:At,scrolling:rn,hyperWrapping:(Re==null?void 0:Re.hyperWrapping)??!1,touchMode:hn,enqueue:En.current,renderStateProvider:$e,renderStrategy:(Re==null?void 0:Re.renderStrategy)??(ba.value?"double-buffer":"single-buffer"),getCellRenderer:lt,minimumCellWidth:un,resizeIndicator:He};Me.damage===void 0?(xn.current=Me,pu(Me,ue)):pu(Me,void 0),!ye&&(Me.damage===void 0||Me.damage.has((at=ln==null?void 0:ln.current)==null?void 0:at[0]))&&vn(void 0)},[A,je,n,i,dt,s,et,wt,Nt,y,R,de,ke,l,c,Ve,d,rt,O,he,k,C,x,u,E,f,_,Ot,g,tt,m,J,it,Dt,se,mt,At,rn,Re==null?void 0:Re.hyperWrapping,Re==null?void 0:Re.renderStrategy,hn,$e,lt,un,He]),$n=h.useRef(Qt);h.useLayoutEffect(()=>{Qt(),$n.current=Qt},[Qt]),h.useLayoutEffect(()=>{(async()=>{var ee;((ee=document==null?void 0:document.fonts)==null?void 0:ee.ready)!==void 0&&(await document.fonts.ready,xn.current=void 0,$n.current())})()},[]);const Kn=h.useCallback(H=>{Lt.current=H,$n.current(),Lt.current=void 0},[]),$a=J0(Kn);En.current=$a;const wo=h.useCallback(H=>{Kn(new io(H.map(ee=>ee.cell)))},[Kn]);mt.setCallback(Kn);const[yo,Va]=h.useState(!1),[oi,Rr]=Kt??[],Ii=oi!==void 0&&Rr===-1,Na=oi!==void 0&&Rr===-2;let Ti=!1,Di=!1,Nr=gn;if(Nr===void 0&&oi!==void 0&&Rr!==void 0&&Rr>-1&&Rr<f){const H=g([oi,Rr],!0);Ti=H.kind===jn.NewRow||H.kind===jn.Marker&&H.markerKind!=="number",Di=H.kind===Z.Boolean&&Gs(H),Nr=H.cursor}const In=N?"grabbing":(Sn??!1)||O?"col-resize":yo||w?"crosshair":Nr!==void 0?Nr:Ii||Ti||Di||Na?"pointer":"default",Oi=h.useMemo(()=>({contain:"strict",display:"block",cursor:In}),[In]),Pi=h.useRef("default"),ai=j==null?void 0:j.current;ai!=null&&Pi.current!==Oi.cursor&&(ai.style.cursor=Pi.current=Oi.cursor);const br=h.useCallback((H,ee,ye,Ce)=>{if(tt===void 0)return;const ue=tt(H);if(ue.actions!==void 0){const Me=hd(ee,ue.actions);for(const[at,st]of Me.entries())if(ei(st,ye+ee.x,Ce+st.y))return ue.actions[at]}},[tt]),wr=h.useCallback((H,ee,ye,Ce)=>{const ue=Nt[ee];if(!N&&!O&&!(Sn??!1)){const Me=fe(H,ee,-1);An(Me!==void 0);const at=gd(void 0,ue,Me.x,Me.y,Me.width,Me.height,ke,Js(ue.title)==="rtl");if(ue.hasMenu===!0&&at.menuBounds!==void 0&&ei(at.menuBounds,ye,Ce))return{area:"menu",bounds:at.menuBounds};if(ue.indicatorIcon!==void 0&&at.indicatorIconBounds!==void 0&&ei(at.indicatorIconBounds,ye,Ce))return{area:"indicator",bounds:at.indicatorIconBounds}}},[Nt,fe,Sn,N,O,ke]),si=h.useRef(0),sr=h.useRef(),lr=h.useRef(!1),Br=h.useCallback(H=>{const ee=ze.current,ye=j==null?void 0:j.current;if(ee===null||H.target!==ee&&H.target!==ye)return;lr.current=!0;let Ce,ue;if(H instanceof MouseEvent?(Ce=H.clientX,ue=H.clientY):(Ce=H.touches[0].clientX,ue=H.touches[0].clientY),H.target===ye&&ye!==null){const at=ye.getBoundingClientRect();if(Ce>at.right||ue>at.bottom)return}const Me=Ne(ee,Ce,ue,H);sr.current=Me.location,Me.isTouch&&(si.current=Date.now()),Gt.current!==Me.isTouch&&ot(Me.isTouch),!(Me.kind===Ar&&wr(ee,Me.location[0],Ce,ue)!==void 0)&&(Me.kind===Gn&&br(Me.group,Me.bounds,Me.localEventX,Me.localEventY)!==void 0||(F==null||F(Me),!Me.isTouch&&re!==!0&&re!==Me.kind&&Me.button<3&&Me.button!==1&&H.preventDefault()))},[j,re,Ne,br,wr,F]);mn("touchstart",Br,_t,!1),mn("mousedown",Br,_t,!1);const Co=h.useRef(0),_i=h.useCallback(H=>{var Ke,We;const ee=Co.current;Co.current=Date.now();const ye=ze.current;if(lr.current=!1,P===void 0||ye===null)return;const Ce=j==null?void 0:j.current,ue=H.target!==ye&&H.target!==Ce;let Me,at,st=!0;if(H instanceof MouseEvent){if(Me=H.clientX,at=H.clientY,st=H.button<3,H.pointerType==="touch")return}else Me=H.changedTouches[0].clientX,at=H.changedTouches[0].clientY;let Ie=Ne(ye,Me,at,H);Ie.isTouch&&si.current!==0&&Date.now()-si.current>500&&(Ie={...Ie,isLongTouch:!0}),ee!==0&&Date.now()-ee<(Ie.isTouch?1e3:500)&&(Ie={...Ie,isDoubleClick:!0}),Gt.current!==Ie.isTouch&&ot(Ie.isTouch),!ue&&H.cancelable&&st&&H.preventDefault();const[Mt]=Ie.location,Se=wr(ye,Mt,Me,at);if(Ie.kind===Ar&&Se!==void 0){(Ie.button!==0||((Ke=sr.current)==null?void 0:Ke[0])!==Mt||((We=sr.current)==null?void 0:We[1])!==-1)&&P(Ie,!0);return}else if(Ie.kind===Gn){const ht=br(Ie.group,Ie.bounds,Ie.localEventX,Ie.localEventY);if(ht!==void 0){Ie.button===0&&ht.onClick(Ie);return}}P(Ie,ue)},[P,j,Ne,wr,br]);mn("mouseup",_i,_t,!1),mn("touchend",_i,_t,!1);const qe=h.useCallback(H=>{var Mt,Se;const ee=ze.current;if(ee===null)return;const ye=j==null?void 0:j.current,Ce=H.target!==ee&&H.target!==ye;let ue,Me,at=!0;H instanceof MouseEvent?(ue=H.clientX,Me=H.clientY,at=H.button<3):(ue=H.changedTouches[0].clientX,Me=H.changedTouches[0].clientY);const st=Ne(ee,ue,Me,H);Gt.current!==st.isTouch&&ot(st.isTouch),!Ce&&H.cancelable&&at&&H.preventDefault();const[Ie]=st.location;if(st.kind===Ar){const Ke=wr(ee,Ie,ue,Me);Ke!==void 0&&st.button===0&&((Mt=sr.current)==null?void 0:Mt[0])===Ie&&((Se=sr.current)==null?void 0:Se[1])===-1&&(Ke.area==="menu"?p==null||p(Ie,Ke.bounds):Ke.area==="indicator"&&(b==null||b(Ie,Ke.bounds)))}else if(st.kind===Gn){const Ke=br(st.group,st.bounds,st.localEventX,st.localEventY);Ke!==void 0&&st.button===0&&Ke.onClick(st)}},[j,Ne,wr,p,b,br]);mn("click",qe,_t,!1);const So=h.useCallback(H=>{const ee=ze.current,ye=j==null?void 0:j.current;if(ee===null||H.target!==ee&&H.target!==ye||I===void 0)return;const Ce=Ne(ee,H.clientX,H.clientY,H);I(Ce,()=>{H.cancelable&&H.preventDefault()})},[j,Ne,I]);mn("contextmenu",So,(j==null?void 0:j.current)??null,!1);const xo=h.useCallback(H=>{Lt.current=new io(H.map(ee=>ee.item)),Cn.current=H,$n.current(),Lt.current=void 0},[]),Vn=h.useMemo(()=>new q0(xo),[xo]),ko=h.useRef(Vn);ko.current=Vn,h.useLayoutEffect(()=>{const H=ko.current;if(Kt===void 0||Kt[1]<0){H.setHovered(Kt);return}const ee=g(Kt,!0),ye=lt(ee),Ce=ye===void 0&&ee.kind===Z.Custom||(ye==null?void 0:ye.needsHover)!==void 0&&(typeof ye.needsHover=="boolean"?ye.needsHover:ye.needsHover(ee));H.setHovered(Ce?Kt:void 0)},[g,lt,Kt]);const Zn=h.useRef(),Li=h.useCallback(H=>{var st;const ee=ze.current;if(ee===null)return;const ye=j==null?void 0:j.current,Ce=H.target!==ee&&H.target!==ye,ue=Ne(ee,H.clientX,H.clientY,H);if(ue.kind!=="out-of-bounds"&&Ce&&!lr.current&&!ue.isTouch)return;const Me=(Ie,Mt)=>{Pn(Se=>Se===Ie||(Se==null?void 0:Se[0][0])===(Ie==null?void 0:Ie[0][0])&&(Se==null?void 0:Se[0][1])===(Ie==null?void 0:Ie[0][1])&&((Se==null?void 0:Se[1][0])===(Ie==null?void 0:Ie[1][0])&&(Se==null?void 0:Se[1][1])===(Ie==null?void 0:Ie[1][1])||!Mt)?Se:Ie)};if(!vd(ue,Zn.current))vn(void 0),oe==null||oe(ue),Me(ue.kind===ya?void 0:[ue.location,[ue.localEventX,ue.localEventY]],!0),Zn.current=ue;else if(ue.kind==="cell"||ue.kind===Ar||ue.kind===Gn){let Ie=!1,Mt=!0;if(ue.kind==="cell"){const Ke=g(ue.location);Mt=((st=lt(Ke))==null?void 0:st.needsHoverPosition)??Ke.kind===Z.Custom,Ie=Mt}else Ie=!0;const Se=[ue.location,[ue.localEventX,ue.localEventY]];Me(Se,Mt),ln.current=Se,Ie&&Kn(new io([ue.location]))}const at=ue.location[0]>=(xe?0:1);Pe(ue.kind===Ar&&ue.isEdge&&at&&Oe===!0),Va(ue.kind==="cell"&&ue.isFillHandle),ne==null||ne(H),Q(ue)},[j,Ne,xe,Oe,ne,Q,oe,g,lt,Kn]);mn("mousemove",Li,_t,!0);const Mo=h.useCallback(H=>{const ee=ze.current;if(ee===null)return;let ye,Ce;x.current!==void 0&&(ye=fe(ee,x.current.cell[0],x.current.cell[1]),Ce=x.current.cell),ae==null||ae({bounds:ye,stopPropagation:()=>H.stopPropagation(),preventDefault:()=>H.preventDefault(),cancel:()=>{},ctrlKey:H.ctrlKey,metaKey:H.metaKey,shiftKey:H.shiftKey,altKey:H.altKey,key:H.key,keyCode:H.keyCode,rawEvent:H,location:Ce})},[ae,x,fe]),Ro=h.useCallback(H=>{const ee=ze.current;if(ee===null)return;let ye,Ce;x.current!==void 0&&(ye=fe(ee,x.current.cell[0],x.current.cell[1]),Ce=x.current.cell),G==null||G({bounds:ye,stopPropagation:()=>H.stopPropagation(),preventDefault:()=>H.preventDefault(),cancel:()=>{},ctrlKey:H.ctrlKey,metaKey:H.metaKey,shiftKey:H.shiftKey,altKey:H.altKey,key:H.key,keyCode:H.keyCode,rawEvent:H,location:Ce})},[G,x,fe]),Ba=h.useCallback(H=>{if(ze.current=H,ie!==void 0&&(ie.current=H),H===null)Pt.current=window;else{const ee=H.getRootNode();ee===document&&(Pt.current=window),Pt.current=ee}},[ie]),Wa=h.useCallback(H=>{const ee=ze.current;if(ee===null||re===!1||O){H.preventDefault();return}let ye,Ce;const ue=Ne(ee,H.clientX,H.clientY);if(re!==!0&&ue.kind!==re){H.preventDefault();return}const Me=(Ke,We)=>{ye=Ke,Ce=We};let at,st,Ie;const Mt=(Ke,We,ht)=>{at=Ke,st=We,Ie=ht};let Se=!1;if(be==null||be({...ue,setData:Me,setDragImage:Mt,preventDefault:()=>Se=!0,defaultPrevented:()=>Se}),!Se&&ye!==void 0&&Ce!==void 0&&H.dataTransfer!==null)if(H.dataTransfer.setData(ye,Ce),H.dataTransfer.effectAllowed="copyLink",at!==void 0&&st!==void 0&&Ie!==void 0)H.dataTransfer.setDragImage(at,st,Ie);else{const[Ke,We]=ue.location;if(We!==void 0){const ht=document.createElement("canvas"),cn=fe(ee,Ke,We);An(cn!==void 0);const Tn=Math.ceil(window.devicePixelRatio??1);ht.width=cn.width*Tn,ht.height=cn.height*Tn;const Ct=ht.getContext("2d");Ct!==null&&(Ct.scale(Tn,Tn),Ct.textBaseline="middle",We===-1?(Ct.font=ke.headerFontFull,Ct.fillStyle=ke.bgHeader,Ct.fillRect(0,0,ht.width,ht.height),md(Ct,0,0,cn.width,cn.height,Nt[Ke],!1,ke,!1,void 0,void 0,!1,0,At,it,!1)):(Ct.font=ke.baseFontFull,Ct.fillStyle=ke.bgCell,Ct.fillRect(0,0,ht.width,ht.height),fd(Ct,g([Ke,We]),0,We,!1,!1,0,0,cn.width,cn.height,!1,ke,ke.bgCell,mt,At,1,void 0,!1,0,void 0,void 0,void 0,$e,lt,()=>{}))),ht.style.left="-100%",ht.style.position="absolute",ht.style.width=`${cn.width}px`,ht.style.height=`${cn.height}px`,document.body.append(ht),H.dataTransfer.setDragImage(ht,cn.width/2,cn.height/2),window.setTimeout(()=>{ht.remove()},0)}}else H.preventDefault()},[re,O,Ne,be,fe,ke,Nt,At,it,g,mt,$e,lt]);mn("dragstart",Wa,(j==null?void 0:j.current)??null,!1,!1);const Nn=h.useRef(),Er=h.useCallback(H=>{const ee=ze.current;if(me!==void 0&&H.preventDefault(),ee===null||le===void 0)return;const ye=Ne(ee,H.clientX,H.clientY),[Ce,ue]=ye.location,Me=Ce-(xe?0:1),[at,st]=Nn.current??[];(at!==Me||st!==ue)&&(Nn.current=[Me,ue],le([Me,ue],H.dataTransfer))},[xe,Ne,le,me]);mn("dragover",Er,(j==null?void 0:j.current)??null,!1,!1);const Bn=h.useCallback(()=>{Nn.current=void 0,we==null||we()},[we]);mn("dragend",Bn,(j==null?void 0:j.current)??null,!1,!1);const B=h.useCallback(H=>{const ee=ze.current;if(ee===null||me===void 0)return;H.preventDefault();const ye=Ne(ee,H.clientX,H.clientY),[Ce,ue]=ye.location,Me=Ce-(xe?0:1);me([Me,ue],H.dataTransfer)},[xe,Ne,me]);mn("drop",B,(j==null?void 0:j.current)??null,!1,!1);const qt=h.useCallback(()=>{De==null||De()},[De]);mn("dragleave",qt,(j==null?void 0:j.current)??null,!1,!1);const Ir=h.useRef(x);Ir.current=x;const li=h.useRef(null),ui=h.useCallback(H=>{var ee;ze.current===null||!ze.current.contains(document.activeElement)||(H===null&&Ir.current.current!==void 0?(ee=ie==null?void 0:ie.current)==null||ee.focus({preventScroll:!0}):H!==null&&H.focus({preventScroll:!0}),li.current=H)},[ie]);h.useImperativeHandle(t,()=>({focus:()=>{var ee;const H=li.current;H===null||!document.contains(H)?(ee=ie==null?void 0:ie.current)==null||ee.focus({preventScroll:!0}):H.focus({preventScroll:!0})},getBounds:(H,ee)=>{if(!(ie===void 0||ie.current===null))return fe(ie.current,H??0,ee??-1)},damage:wo}),[ie,wo,fe]);const Fi=h.useRef(),Ua=Im(()=>{var st,Ie,Mt;if(n<50||(Re==null?void 0:Re.disableAccessibilityTree)===!0)return null;let H=_s(Nt,dt,n,de,et);const ee=xe?0:-1;!xe&&((st=H[0])==null?void 0:st.sourceIndex)===0&&(H=H.slice(1));const[ye,Ce]=((Ie=x.current)==null?void 0:Ie.cell)??[],ue=(Mt=x.current)==null?void 0:Mt.range,Me=H.map(Se=>Se.sourceIndex),at=fr(s,Math.min(f,s+r));return ye!==void 0&&Ce!==void 0&&!(Me.includes(ye)&&at.includes(Ce))&&ui(null),h.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":f+1,"aria-multiselectable":"true","aria-colcount":Nt.length+ee},h.createElement("thead",{role:"rowgroup"},h.createElement("tr",{role:"row","aria-rowindex":1},H.map(Se=>h.createElement("th",{role:"columnheader","aria-selected":x.columns.hasIndex(Se.sourceIndex),"aria-colindex":Se.sourceIndex+1+ee,tabIndex:-1,onFocus:Ke=>{if(Ke.target!==li.current)return ce==null?void 0:ce([Se.sourceIndex,-1])},key:Se.sourceIndex},Se.title)))),h.createElement("tbody",{role:"rowgroup"},at.map(Se=>h.createElement("tr",{role:"row","aria-selected":x.rows.hasIndex(Se),key:Se,"aria-rowindex":Se+2},H.map(Ke=>{const We=Ke.sourceIndex,ht=ar(We,Se),cn=ye===We&&Ce===Se,Tn=ue!==void 0&&We>=ue.x&&We<ue.x+ue.width&&Se>=ue.y&&Se<ue.y+ue.height,Ct=`glide-cell-${We}-${Se}`,Zt=[We,Se],Jn=g(Zt,!0);return h.createElement("td",{key:ht,role:"gridcell","aria-colindex":We+1+ee,"aria-selected":Tn,"aria-readonly":wi(Jn)||!Ki(Jn),id:Ct,"data-testid":Ct,onClick:()=>{const kn=ie==null?void 0:ie.current;if(kn!=null)return ae==null?void 0:ae({bounds:fe(kn,We,Se),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Zt})},onFocusCapture:kn=>{var Tt,Dn;if(!(kn.target===li.current||((Tt=Fi.current)==null?void 0:Tt[0])===We&&((Dn=Fi.current)==null?void 0:Dn[1])===Se))return Fi.current=Zt,ce==null?void 0:ce(Zt)},ref:cn?ui:void 0,tabIndex:-1},Q0(Jn,lt))})))))},[n,Nt,dt,de,et,f,s,r,x,ui,g,ie,ae,fe,ce],200),Ai=R===0||!L?0:dt>R?1:Xn(-et/100,0,1),U=-s*32+wt,dn=z?Xn(-U/100,0,1):0,fn=h.useMemo(()=>{if(!Ai&&!dn)return null;const H={position:"absolute",top:0,left:Bt,width:n-Bt,height:i,opacity:Ai,pointerEvents:"none",transition:nt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},ee={position:"absolute",top:on,left:0,width:n,height:i,opacity:dn,pointerEvents:"none",transition:ge?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return h.createElement(h.Fragment,null,Ai>0&&h.createElement("div",{id:"shadow-x",style:H}),dn>0&&h.createElement("div",{id:"shadow-y",style:ee}))},[Ai,dn,Bt,n,nt,on,i,ge]),Xa=h.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return h.createElement(h.Fragment,null,h.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Mo,onKeyUp:Ro,onFocus:S,onBlur:M,ref:Ba,style:Oi},Ua),h.createElement("canvas",{ref:Ft,style:Xa}),fn)},tv=h.memo(h.forwardRef(ev));function Gi(e,t,n,i){return Xn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(i))}const nv=e=>{const[t,n]=h.useState(),[i,r]=h.useState(),[o,a]=h.useState(),[s,l]=h.useState(),[u,c]=h.useState(!1),[d,f]=h.useState(),[g,m]=h.useState(),[p,b]=h.useState(),[y,w]=h.useState(!1),[S,M]=h.useState(),{onHeaderMenuClick:C,onHeaderIndicatorClick:x,getCellContent:R,onColumnMoved:I,onColumnResize:E,onColumnResizeStart:L,onColumnResizeEnd:z,gridRef:_,maxColumnWidth:F,minColumnWidth:P,onRowMoved:ne,lockColumns:Q,onColumnProposeMove:oe,onMouseDown:de,onMouseUp:xe,onItemHovered:ae,onDragStart:G,canvasRef:se}=e,ie=(E??z??L)!==void 0,{columns:be,selection:we}=e,j=we.columns,O=h.useCallback(J=>{const[it,ce]=J.location;o!==void 0&&s!==it&&it>=Q?(c(!0),l(it)):g!==void 0&&ce!==void 0?(w(!0),b(Math.max(0,ce))):i===void 0&&!u&&!y&&(ae==null||ae(J))},[o,g,s,ae,Q,i,u,y]),k=I!==void 0,N=h.useCallback(J=>{var it;if(J.button===0){const[ce,le]=J.location;if(J.kind==="out-of-bounds"&&J.isEdge&&ie){const me=(it=_==null?void 0:_.current)==null?void 0:it.getBounds(be.length-1,-1);me!==void 0&&(n(me.x),r(be.length-1))}else if(J.kind==="header"&&ce>=Q){const me=se==null?void 0:se.current;if(J.isEdge&&ie&&me){n(J.bounds.x),r(ce);const Ae=me.getBoundingClientRect().width/me.offsetWidth,nt=J.bounds.width/Ae;L==null||L(be[ce],nt,ce,nt+(be[ce].growOffset??0))}else J.kind==="header"&&k&&(f(J.bounds.x),a(ce))}else J.kind==="cell"&&Q>0&&ce===0&&le!==void 0&&ne!==void 0&&(M(J.bounds.y),m(le))}de==null||de(J)},[de,ie,Q,ne,_,be,k,L,se]),re=h.useCallback((J,it)=>{u||y||C==null||C(J,it)},[u,y,C]),Oe=h.useCallback((J,it)=>{u||y||x==null||x(J,it)},[u,y,x]),Ve=h.useRef(-1),he=h.useCallback(()=>{Ve.current=-1,m(void 0),b(void 0),M(void 0),w(!1),a(void 0),l(void 0),f(void 0),c(!1),r(void 0),n(void 0)},[]),tt=h.useCallback((J,it)=>{if(J.button===0){if(i!==void 0){if((j==null?void 0:j.hasIndex(i))===!0)for(const le of j){if(le===i)continue;const me=be[le],De=Gi(me,Ve.current,P,F);E==null||E(me,De,le,De+(me.growOffset??0))}const ce=Gi(be[i],Ve.current,P,F);if(z==null||z(be[i],ce,i,ce+(be[i].growOffset??0)),j.hasIndex(i))for(const le of j){if(le===i)continue;const me=be[le],De=Gi(me,Ve.current,P,F);z==null||z(me,De,le,De+(me.growOffset??0))}}he(),o!==void 0&&s!==void 0&&(I==null||I(o,s)),g!==void 0&&p!==void 0&&(ne==null||ne(g,p))}xe==null||xe(J,it)},[xe,i,o,s,g,p,j,z,be,P,F,E,I,ne,he]),ke=h.useMemo(()=>{if(!(o===void 0||s===void 0)&&o!==s&&(oe==null?void 0:oe(o,s))!==!1)return{src:o,dest:s}},[o,s,oe]),Dt=h.useCallback(J=>{const it=se==null?void 0:se.current;if(o!==void 0&&d!==void 0)Math.abs(J.clientX-d)>20&&c(!0);else if(g!==void 0&&S!==void 0)Math.abs(J.clientY-S)>20&&w(!0);else if(i!==void 0&&t!==void 0&&it){const le=it.getBoundingClientRect().width/it.offsetWidth,me=(J.clientX-t)/le,De=be[i],Ae=Gi(De,me,P,F);if(E==null||E(De,Ae,i,Ae+(De.growOffset??0)),Ve.current=me,(j==null?void 0:j.first())===i)for(const nt of j){if(nt===i)continue;const ge=be[nt],Re=Gi(ge,Ve.current,P,F);E==null||E(ge,Re,nt,Re+(ge.growOffset??0))}}},[o,d,g,S,i,t,be,P,F,E,j,se]),bt=h.useCallback((J,it)=>{if(g===void 0||p===void 0)return R(J,it);let[ce,le]=J;return le===p?le=g:(le>p&&(le-=1),le>=g&&(le+=1)),R([ce,le],it)},[g,p,R]),rt=h.useCallback(J=>{G==null||G(J),J.defaultPrevented()||he()},[he,G]);return h.createElement(tv,{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:i,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,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:bt,isResizing:i!==void 0,onHeaderMenuClick:re,onHeaderIndicatorClick:Oe,isDragging:u,onItemHovered:O,onDragStart:rt,onMouseDown:N,allowResize:ie,onMouseUp:tt,dragAndDropState:ke,onMouseMoveRaw:Dt,ref:_})};function rv(e){const t=h.useRef(null),[n,i]=h.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return h.useLayoutEffect(()=>{const r=a=>{for(const s of a){const{width:l,height:u}=s&&s.contentRect||{};i(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(r);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const iv=(e,t,n)=>{const i=h.useRef(null),r=h.useRef(null),o=h.useRef(null),a=h.useRef(0),s=h.useRef(t);s.current=t;const l=n.current;h.useEffect(()=>{const u=()=>{var f,g;if(r.current===!1&&l!==null){const m=[l.scrollLeft,l.scrollTop];if(((f=o.current)==null?void 0:f[0])===m[0]&&((g=o.current)==null?void 0:g[1])===m[1])if(a.current>10){o.current=null,r.current=null;return}else a.current++;else a.current=0,s.current(m[0],m[1]),o.current=m;i.current=window.setTimeout(u,8.333333333333334)}},c=()=>{r.current=!0,o.current=null,i.current!==null&&(window.clearTimeout(i.current),i.current=null)},d=f=>{f.touches.length===0&&(r.current=!1,a.current=0,i.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const f=l;return f.addEventListener("touchstart",c),f.addEventListener("touchend",d),()=>{f.removeEventListener("touchstart",c),f.removeEventListener("touchend",d),i.current!==null&&window.clearTimeout(i.current)}}},[e,l])},ov=()=>e=>e.isSafari?"scroll":"auto",av=pn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[ov()]}});function sv(e){const[t,n]=h.useState(!1),i=typeof window>"u"?null:window,r=h.useRef(0);return mn("touchstart",h.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),i,!0,!1),mn("touchend",h.useCallback(o=>{o.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),i,!0,!1),t}const lv=e=>{var ie,be;const{children:t,clientHeight:n,scrollHeight:i,scrollWidth:r,update:o,draggable:a,className:s,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:g=!1,scrollRef:m,initialSize:p}=e,b=[],y=(f==null?void 0:f.sticky)??!1,w=(f==null?void 0:f.fill)??!1,S=h.useRef(0),M=h.useRef(0),C=h.useRef(null),x=typeof window>"u"?1:window.devicePixelRatio,R=h.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),I=h.useRef(null),E=sv(200),[L,z]=h.useState(!0),_=h.useRef(0);h.useLayoutEffect(()=>{if(!L||E||R.current.lockDirection===void 0)return;const we=C.current;if(we===null)return;const[j,O]=R.current.lockDirection;j!==void 0?we.scrollLeft=j:O!==void 0&&(we.scrollTop=O),R.current.lockDirection=void 0},[E,L]);const F=h.useCallback((we,j)=>{var rt;const O=C.current;if(O===null)return;j=j??O.scrollTop,we=we??O.scrollLeft;const k=R.current.scrollTop,N=R.current.scrollLeft,re=we-N,Oe=j-k;E&&re!==0&&Oe!==0&&(Math.abs(re)>3||Math.abs(Oe)>3)&&l&&R.current.lockDirection===void 0&&(R.current.lockDirection=Math.abs(re)<Math.abs(Oe)?[N,void 0]:[void 0,k]);const Ve=R.current.lockDirection;we=(Ve==null?void 0:Ve[0])??we,j=(Ve==null?void 0:Ve[1])??j,R.current.scrollLeft=we,R.current.scrollTop=j;const he=O.clientWidth,tt=O.clientHeight,ke=j,Dt=M.current-ke,bt=O.scrollHeight-tt;if(M.current=ke,bt>0&&(Math.abs(Dt)>2e3||ke===0||ke===bt)&&i>O.scrollHeight+5){const J=ke/bt,it=(i-tt)*J;S.current=it-ke}Ve!==void 0&&(window.clearTimeout(_.current),z(!1),_.current=window.setTimeout(()=>z(!0),200)),o({x:we,y:ke+S.current,width:he-c,height:tt-u,paddingRight:((rt=I.current)==null?void 0:rt.clientWidth)??0})},[u,c,i,o,l,E]);iv(g&&ba.value,F,C);const P=h.useRef(F);P.current=F;const ne=h.useRef(),Q=h.useRef(!1);h.useLayoutEffect(()=>{Q.current?F():Q.current=!0},[F,u,c]);const oe=h.useCallback(we=>{C.current=we,m!==void 0&&(m.current=we)},[m]);let de=0,xe=0;for(b.push(h.createElement("div",{key:de++,style:{width:r,height:0}}));xe<i;){const we=Math.min(5e6,i-xe);b.push(h.createElement("div",{key:de++,style:{width:0,height:we}})),xe+=we}const{ref:ae,width:G,height:se}=rv(p);return typeof window<"u"&&(((ie=ne.current)==null?void 0:ie.height)!==se||((be=ne.current)==null?void 0:be.width)!==G)&&(window.setTimeout(()=>P.current(),0),ne.current={width:G,height:se}),(G??0)===0||(se??0)===0?h.createElement("div",{ref:ae}):h.createElement("div",{ref:ae},h.createElement(av,{isSafari:ba.value},h.createElement("div",{className:"dvn-underlay"},t),h.createElement("div",{ref:oe,style:ne.current,draggable:a,onDragStart:we=>{a||(we.stopPropagation(),we.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>F()},h.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},h.createElement("div",{className:"dvn-stack"},b),d!==void 0&&h.createElement(h.Fragment,null,!w&&h.createElement("div",{className:"dvn-spacer"}),h.createElement("div",{ref:I,style:{height:se,maxHeight:n-Math.ceil(x%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:w?1:void 0,right:y?c??0:void 0,pointerEvents:"auto"}},d))))))},uv=e=>{const{columns:t,rows:n,rowHeight:i,headerHeight:r,groupHeaderHeight:o,enableGroups:a,freezeColumns:s,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:f,scrollRef:g,preventDiagonalScrolling:m,rightElement:p,rightElementProps:b,overscrollX:y,overscrollY:w,initialSize:S,smoothScrollX:M=!1,smoothScrollY:C=!1,isDraggable:x}=e,{paddingRight:R,paddingBottom:I}=l??{},[E,L]=c,z=h.useRef(),_=h.useRef(),F=h.useRef(),P=h.useRef(),ne=u+Math.max(0,y??0);let Q=a?r+o:r;if(typeof i=="number")Q+=n*i;else for(let ae=0;ae<n;ae++)Q+=i(ae);w!==void 0&&(Q+=w);const oe=h.useRef(),de=h.useCallback(()=>{var Oe,Ve;if(oe.current===void 0)return;const ae={...oe.current};let G=0,se=ae.x<0?-ae.x:0,ie=0,be=0;ae.x=ae.x<0?0:ae.x;let we=0;for(let he=0;he<s;he++)we+=t[he].width;for(const he of t){const tt=G-we;if(ae.x>=tt+he.width)G+=he.width,be++,ie++;else if(ae.x>tt)G+=he.width,M?se+=tt-ae.x:be++,ie++;else if(ae.x+ae.width>tt)G+=he.width,ie++;else break}let j=0,O=0,k=0;if(typeof i=="number")C?(O=Math.floor(ae.y/i),j=O*i-ae.y):O=Math.ceil(ae.y/i),k=Math.ceil(ae.height/i)+O,j<0&&k++;else{let he=0;for(let tt=0;tt<n;tt++){const ke=i(tt),Dt=he+(C?0:ke/2);if(ae.y>=he+ke)he+=ke,O++,k++;else if(ae.y>Dt)he+=ke,C?j+=Dt-ae.y:O++,k++;else if(ae.y+ae.height>ke/2+he)he+=ke,k++;else break}}const N={x:be,y:O,width:ie-be,height:k-O},re=z.current;(re===void 0||re.y!==N.y||re.x!==N.x||re.height!==N.height||re.width!==N.width||_.current!==se||F.current!==j||ae.width!==((Oe=P.current)==null?void 0:Oe[0])||ae.height!==((Ve=P.current)==null?void 0:Ve[1]))&&(f==null||f({x:be,y:O,width:ie-be,height:k-O},ae.width,ae.height,ae.paddingRight??0,se,j),z.current=N,_.current=se,F.current=j,P.current=[ae.width,ae.height])},[t,i,n,f,s,M,C]),xe=h.useCallback(ae=>{oe.current=ae,de()},[de]);return h.useEffect(()=>{de()},[de]),h.createElement(lv,{scrollRef:g,className:d,kineticScrollPerfHack:l==null?void 0:l.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:x===!0||typeof x=="string",scrollWidth:ne+(R??0),scrollHeight:Q+(I??0),clientHeight:L,rightElement:p,paddingBottom:I,paddingRight:R,rightElementProps:b,update:xe,initialSize:S},h.createElement(nv,{eventTargetRef:g,width:E,height:L,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,onHeaderIndicatorClick:e.onHeaderIndicatorClick,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,resizeIndicator:e.resizeIndicator}))},cv=pn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),dv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),fv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),hv=h.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},h.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),gv=10,mv=e=>{const{canvasRef:t,cellYOffset:n,rows:i,columns:r,searchInputRef:o,searchValue:a,searchResults:s,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:f}=e,[g]=h.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=h.useState(""),b=a??m,y=h.useCallback(G=>{p(G),l==null||l(G)},[l]),[w,S]=h.useState(),M=h.useRef(w);M.current=w,h.useEffect(()=>{s!==void 0&&(s.length>0?S(G=>({rowsSearched:i,results:s.length,selectedIndex:(G==null?void 0:G.selectedIndex)??-1})):S(void 0))},[i,s]);const C=h.useRef();C.current===void 0&&(C.current=new AbortController);const x=h.useRef(),[R,I]=h.useState([]),E=s??R,L=h.useCallback(()=>{x.current!==void 0&&(window.cancelAnimationFrame(x.current),x.current=void 0,C.current.abort())},[]),z=h.useRef(n);z.current=n;const _=h.useCallback(G=>{const se=new RegExp(G.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ie=z.current,be=Math.min(10,i),we=0;S(void 0),I([]);const j=[],O=async()=>{var bt;if(u===void 0)return;const k=performance.now(),N=i-we;let re=u({x:0,y:ie,width:r.length,height:Math.min(be,N,i-ie)},C.current.signal);typeof re=="function"&&(re=await re());let Oe=!1;for(const[rt,J]of re.entries())for(const[it,ce]of J.entries()){let le;switch(ce.kind){case Z.Text:case Z.Number:le=ce.displayData;break;case Z.Uri:case Z.Markdown:le=ce.data;break;case Z.Boolean:le=typeof ce.data=="boolean"?ce.data.toString():void 0;break;case Z.Image:case Z.Bubble:le=ce.data.join("🐳");break;case Z.Custom:le=ce.copyData;break}le!==void 0&&se.test(le)&&(j.push([it,rt+ie]),Oe=!0)}const Ve=performance.now();Oe&&I([...j]),we+=re.length,An(we<=i);const he=((bt=M.current)==null?void 0:bt.selectedIndex)??-1;S({results:j.length,rowsSearched:we,selectedIndex:he}),c==null||c(j,he),ie+be>=i?ie=0:ie+=be;const tt=Ve-k,ke=Math.max(tt,1),Dt=gv/ke;be=Math.ceil(be*Dt),we<i&&j.length<1e3&&(x.current=window.requestAnimationFrame(O))};L(),x.current=window.requestAnimationFrame(O)},[L,r.length,u,c,i]),F=h.useCallback(()=>{var G;f==null||f(),S(void 0),I([]),c==null||c([],-1),L(),(G=t==null?void 0:t.current)==null||G.focus()},[L,t,f,c]),P=h.useCallback(G=>{y(G.target.value),s===void 0&&(G.target.value===""?(S(void 0),I([]),L()):_(G.target.value))},[_,L,y,s]);h.useEffect(()=>{d&&o.current!==null&&(y(""),o.current.focus({preventScroll:!0}))},[d,o,y]);const ne=h.useCallback(G=>{var ie;if((ie=G==null?void 0:G.stopPropagation)==null||ie.call(G),w===void 0)return;const se=(w.selectedIndex+1)%w.results;S({...w,selectedIndex:se}),c==null||c(E,se)},[w,c,E]),Q=h.useCallback(G=>{var ie;if((ie=G==null?void 0:G.stopPropagation)==null||ie.call(G),w===void 0)return;let se=(w.selectedIndex-1)%w.results;se<0&&(se+=w.results),S({...w,selectedIndex:se}),c==null||c(E,se)},[c,E,w]),oe=h.useCallback(G=>{(G.ctrlKey||G.metaKey)&&G.nativeEvent.code==="KeyF"||G.key==="Escape"?(F(),G.stopPropagation(),G.preventDefault()):G.key==="Enter"&&(G.shiftKey?Q():ne())},[F,ne,Q]);h.useEffect(()=>()=>{L()},[L]);const[de,xe]=h.useState(!1);h.useEffect(()=>{if(d)xe(!0);else{const G=setTimeout(()=>xe(!1),150);return()=>clearTimeout(G)}},[d]);const ae=h.useMemo(()=>{if(!d&&!de)return null;let G;w!==void 0&&(G=w.results>=1e3?"over 1000":`${w.results} result${w.results!==1?"s":""}`,w.selectedIndex>=0&&(G=`${w.selectedIndex+1} of ${G}`));const se=we=>{we.stopPropagation()},be={width:`${Math.floor(((w==null?void 0:w.rowsSearched)??0)/i*100)}%`};return h.createElement(cv,{className:d?"":"out",onMouseDown:se,onMouseMove:se,onMouseUp:se,onClick:se},h.createElement("div",{className:"gdg-search-bar-inner"},h.createElement("input",{id:g,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:P,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:oe}),h.createElement("button",{"aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:Q,disabled:((w==null?void 0:w.results)??0)===0},dv),h.createElement("button",{"aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ne,disabled:((w==null?void 0:w.results)??0)===0},fv),f!==void 0&&h.createElement("button",{"aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:F},hv)),w!==void 0?h.createElement(h.Fragment,null,h.createElement("div",{className:"gdg-search-status"},h.createElement("div",{"data-testid":"search-result-area"},G)),h.createElement("div",{className:"gdg-search-progress",style:be})):h.createElement("div",{className:"gdg-search-status"},h.createElement("label",{htmlFor:g},"Type to search")))},[d,de,w,i,g,o,P,b,oe,Q,ne,f,F]);return h.createElement(h.Fragment,null,h.createElement(uv,{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,onHeaderIndicatorClick:e.onHeaderIndicatorClick,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,resizeIndicator:e.resizeIndicator}),ae)};class pv extends h.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",h.createRef());ft(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let i=n.target;for(;i!==null;){if(i.classList.contains("click-outside-ignore"))return;i=i.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:i,...r}=this.props;return h.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const vv=()=>e=>Math.max(16,e.targetHeight-10),bv=pn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[vv(),"px"]}}),wv=e=>{const{bounds:t,group:n,onClose:i,canvasBounds:r,onFinish:o}=e,[a,s]=te.useState(n);return te.createElement(pv,{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:i},te.createElement(bv,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:i,onFocus:l=>l.target.setSelectionRange(0,a.length),onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(a):l.key==="Escape"&&i()},autoFocus:!0}))};function yv(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 ut(e,t,n){const i=bd(e,t);return i&&(n.didMatch=!0),i}function bd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(bd(u,t))return!0;return!1}let n=!1,i=!1,r=!1,o=!1;const a=e.split("+"),s=a.pop();if(!yv(s,t))return!1;if(a[0]==="any")return!0;for(const l of a)switch(l){case"ctrl":n=!0;break;case"shift":i=!0;break;case"alt":r=!0;break;case"meta":o=!0;break;case"primary":wa.value?o=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===i&&t.metaKey===o}function Cv(e,t,n,i,r,o,a){const s=te.useCallback((c,d,f,g)=>{var S;(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!a&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(f||g==="drag"),p=i==="mixed"&&m,b=r==="mixed"&&m;let y={current:c===void 0?void 0:{...c,rangeStack:g==="drag"?((S=e.current)==null?void 0:S.rangeStack)??[]:[]},columns:p?e.columns:yt.empty(),rows:b?e.rows:yt.empty()};f&&(o==="multi-rect"||o==="multi-cell")&&y.current!==void 0&&e.current!==void 0&&(y={...y,current:{...y.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(y,d)},[i,e,n,o,a,r,t]),l=te.useCallback((c,d,f)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let g;if(r==="exclusive"&&c.length>0)g={current:void 0,columns:yt.empty(),rows:c};else{const m=f&&n==="mixed",p=f&&i==="mixed";g={current:m?e.current:void 0,columns:p?e.columns:yt.empty(),rows:c}}t(g,!1)},[i,e,n,r,t]),u=te.useCallback((c,d,f)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let g;if(i==="exclusive"&&c.length>0)g={current:void 0,rows:yt.empty(),columns:c};else{const m=f&&n==="mixed",p=f&&r==="mixed";g={current:m?e.current:void 0,rows:p?e.rows:yt.empty(),columns:c}}t(g,!1)},[i,e,n,r,t]);return[s,l,u]}function Sv(e,t,n,i,r){const o=h.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const f=[];for(let g=u.x;g<u.x+u.width;g++)g<0||d>=r?f.push({kind:Z.Loading,allowOverlay:!1}):f.push(t([g,d]));c.push(f)}return c}return(e==null?void 0:e(u,i.signal))??[]},[i.signal,t,e,r]),a=e!==void 0?o:void 0,s=h.useCallback(u=>{if(a===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=a(c,i.signal);return typeof d=="function"?async()=>(await d()).map(f=>[{kind:Z.Loading,allowOverlay:!1},...f]):d.map(f=>[{kind:Z.Loading,allowOverlay:!1},...f])}return a(c,i.signal)},[i.signal,a,n]);return[e!==void 0?s:void 0,a]}function xv(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===Ys?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:ao()}}function kv(e,t){return e.map((i,r)=>{const o=t[r];return i.map(a=>a.span!==void 0&&a.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:xv(a))})}function bu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function Mv(e){var n;const t=[];for(const i of e){const r=[];for(const o of i)o.format==="url"?r.push(((n=o.rawValue)==null?void 0:n.toString())??""):o.format==="string-array"?r.push(o.formatted.map(a=>bu(a,!0)).join(",")):r.push(bu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
|
166
166
|
`)}function gs(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function wu(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function Rv(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function Ev(e){var n;const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const i of e){t.push("<tr>");for(const r of i){const o=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${o}><a href="${r.rawValue}">${gs(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((a,s)=>`<li gdg-raw-value=${wu(r.rawValue[s])}>`+gs(a)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${wu(((n=r.rawValue)==null?void 0:n.toString())??"")} ${o}>${gs(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function Iv(e,t){const n=kv(e,t),i=Mv(n),r=Ev(n);return{textPlain:i,textHtml:r}}function yu(e){var a;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const i=[n],r=[];let o;for(;i.length>0;){const s=i.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")i.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)o!==void 0&&r.push(o),o=[],i.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const l=s.cloneNode(!0),c=l.children.length===1&&l.children[0].nodeName==="P"?l.children[0]:null,d=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",f=l.querySelectorAll("br");for(const p of f)p.replaceWith(`
|
167
167
|
`);const g=l.getAttribute("gdg-raw-value"),m=l.getAttribute("gdg-format")??"string";if(l.querySelector("a")!==null)o==null||o.push({rawValue:((a=l.querySelector("a"))==null?void 0:a.getAttribute("href"))??"",formatted:l.textContent??"",format:m});else if(l.querySelector("ol")!==null){const p=l.querySelectorAll("li");o==null||o.push({rawValue:[...p].map(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...p].map(b=>b.textContent??""),format:"string-array"})}else if(g!==null)o==null||o.push({rawValue:Rv(g),formatted:l.textContent??"",format:m});else{let p=l.textContent??"";d&&(p=p.replace(/\n(?!\n)/g,"")),o==null||o.push({rawValue:p??"",formatted:p??"",format:m})}}}return o!==void 0&&r.push(o),r}function Tv(e,t,n,i,r){var s;const o=e;if(i==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if((e==null?void 0:e.current)===void 0)break;const l=(s=e.current)==null?void 0:s.range,u=[];if(l.width>2){const f=t({x:l.x,y:l.y,width:1,height:l.height},r.signal);if(typeof f=="function")return o;u.push(...f);const g=t({x:l.x+l.width-1,y:l.y,width:1,height:l.height},r.signal);if(typeof g=="function")return o;u.push(...g)}else{const f=t({x:l.x,y:l.y,width:l.width,height:l.height},r.signal);if(typeof f=="function")return o;u.push(...f)}let c=l.x-n,d=l.x+l.width-1-n;for(const f of u)for(const g of f)g.span!==void 0&&(c=Math.min(g.span[0],c),d=Math.max(g.span[1],d));c===l.x-n&&d===l.x+l.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:l.y,width:d-c+1,height:l.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function Cu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function Dv(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let i=[],r=0,o=t.None;e=e.replace(/\r\n/g,`
|
168
168
|
`);let a=0;for(const s of e){switch(o){case t.None:s===" "||s===`
|
169
169
|
`?(i.push(e.slice(r,a)),r=a+1,s===`
|
170
170
|
`&&(n.push(i),i=[])):s==='"'&&(o=t.inString);break;case t.inString:s==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?o=t.inString:((s===" "||s===`
|
171
171
|
`)&&(i.push(Cu(e.slice(r,a))),r=a+1,s===`
|
172
|
-
`&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(Cu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Su(e,t,n){var s;const i=Iv(e,t),r=l=>{var u;(u=window.navigator.clipboard)==null||u.writeText(l)},o=(l,u)=>{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([l],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(l,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(l,u)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function wd(e){return e!==!0}function xu(e){return typeof e=="string"?e:`${e}px`}const Ov=()=>e=>e.innerWidth,Pv=()=>e=>e.innerHeight,_v=pn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Ov()],"wmyidgi-1":[Pv()]}}),Lv=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return h.createElement(_v,{innerHeight:xu(n),innerWidth:xu(t),...r},i)},Fv=2,Av=1300;function Hv(e,t,n){const i=te.useRef(0),[r,o]=e??[0,0];te.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=u=>{var c;if(!a){if(s===0)s=u;else{const d=u-s;i.current=Math.min(1,i.current+d/Av);const f=i.current**1.618*d*Fv;(c=t.current)==null||c.scrollBy(r*f,o*f),s=u,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function zv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,u,c,d,f,g]=te.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=id();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:g}}const Fr={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 ct(e,t){return e===!0?t:e===!1?"":e}function ku(e){const t=wa.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function $v(e){const t=_m(e);return te.useMemo(()=>{if(t===void 0)return ku(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return ku({...Fr,...n})},[t])}function Vv(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function al(e,t){const n=[];function i(a,s,l=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:s;i(a.subGroups[c],d,l||a.isCollapsed)}}const r=Vv(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function Ca(e,t){if(t===void 0||al.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Nv(e,t,n,i){const r=te.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]),o=te.useMemo(()=>r===void 0?t:r.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[r,t]),a=te.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=Ca(u,r);return c?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=te.useCallback(u=>{if(r===void 0)return u;let c=u;for(const d of r){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[r]),l=Jr(i??(e==null?void 0:e.themeOverride),te.useCallback(u=>{if(e===void 0)return i==null?void 0:i(u,u,u);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=Ca(u,r);return c?e.themeOverride:i==null?void 0:i(u,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function Bv(e,t){const n=te.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]);return{getRowGroupingForPath:Cd,updateRowGroupingByPath:yd,mapper:te.useCallback(i=>{if(typeof i=="number")return Ca(i,n);const r=Ca(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function yd(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:yd(o.subGroups??[],r,n)}:o)}function Cd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:Cd(e[n].subGroups??[],i)}function Wv(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function Uv(e,t,n,i,r){const[o,a]=h.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=h.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,u,c]=Pm(s),d=h.useRef(r);d.current=r;const f=Wv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),g=(l.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&g){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,g,c,f]);const m=(l.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:l,setVisibleRegion:u,scrollRef:f}}const Xv=h.lazy(async()=>await Ws(()=>import("./data-grid-overlay-editor.CRylpesE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Yv=0;function Gv(e){return Jp(Vl(Vl(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return dr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function jo(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:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const qo={kind:Z.Loading,allowOverlay:!1},Ko={columns:yt.empty(),rows:yt.empty(),current:void 0},jv=(e,t)=>{var Hl,zl,$l;const[n,i]=h.useState(Ko),[r,o]=h.useState(),a=h.useRef(null),s=h.useRef(null),[l,u]=h.useState(),c=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:g,markdownDivCreateNode:m,width:p,height:b,columns:y,rows:w,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:L,editorBloom:z,onHeaderClicked:_,onColumnProposeMove:F,rangeSelectionColumnSpanning:P=!0,spanRangeBehavior:ne="default",onGroupHeaderClicked:Q,onCellContextMenu:oe,className:de,onHeaderContextMenu:xe,getCellsForSelection:ae,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:se,onCellEdited:ie,onCellsEdited:be,onSearchResultsChanged:we,searchResults:j,onSearchValueChange:O,searchValue:k,onKeyDown:N,onKeyUp:re,keybindings:Oe,editOnType:Ve=!0,onRowAppended:he,onColumnMoved:tt,validateCell:ke,highlightRegions:Dt,rangeSelect:bt="rect",columnSelect:rt="multi",rowSelect:J="multi",rangeSelectionBlending:it="exclusive",columnSelectionBlending:ce="exclusive",rowSelectionBlending:le="exclusive",onDelete:me,onDragStart:De,onMouseMove:Ae,onPaste:nt,copyHeaders:ge=!1,freezeColumns:Re=0,cellActivationBehavior:lt="second-click",rowSelectionMode:He="auto",onHeaderMenuClick:et,onHeaderIndicatorClick:wt,getGroupDetails:dt,rowGrouping:ze,onSearchClose:Pt,onItemHovered:_t,onSelectionCleared:mt,showSearch:Lt,onVisibleRegionChanged:rn,gridSelection:zt,onGridSelectionChange:Cn,minColumnWidth:Ut=50,maxColumnWidth:kt=500,maxColumnAutoWidth:Pn,provideEditor:Sn,trailingRowOptions:Pe,freezeTrailingRows:Ft=0,allowedFillDirections:gn="orthogonal",scrollOffsetX:vn,scrollOffsetY:hn,verticalBorder:ot,onDragOverCell:Gt,onDrop:At,onColumnResize:on,onColumnResizeEnd:It,onColumnResizeStart:$t,customRenderers:Ge,fillHandle:Nt,experimental:Bt,fixedShadowX:fe,fixedShadowY:Ne,headerIcons:Kt,imageWindowLoader:En,initialSize:ln,isDraggable:A,onDragLeave:je,onRowMoved:$e,overscrollX:Ot,overscrollY:un,preventDiagonalScrolling:xn,rightElement:qn,rightElementProps:_n,trapFocus:Qt=!1,smoothScrollX:$n,smoothScrollY:Kn,scaleToRem:$a=!1,rowHeight:wo=34,headerHeight:yo=36,groupHeaderHeight:Va=yo,theme:oi,isOutsideClick:Rr,renderers:Ii,resizeIndicator:Na,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,In=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,ai=(en==null?void 0:en.theme)??e.rowMarkerTheme,vr=en==null?void 0:en.headerTheme,br=en==null?void 0:en.headerAlwaysVisible,si=J!=="multi",ar=(en==null?void 0:en.checkboxStyle)??"square",sr=Math.max(Ut,20),Br=Math.max(kt,sr),Co=Math.max(Pn??Br,sr),_i=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:qe,rowNumberMapper:So,rowHeight:xo,getRowThemeOverride:Vn}=Nv(ze,w,wo,g),ko=h.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:Zn,headerHeight:Li,groupHeaderHeight:Mo,theme:Ro,overscrollX:Ba,overscrollY:Wa}=zv({groupHeaderHeight:Va,headerHeight:yo,overscrollX:Ot,overscrollY:un,remSize:ko,rowHeight:xo,scaleToRem:$a,theme:oi}),Nn=$v(Oe),Er=Oi??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=In!=="none",B=Bn?1:0,qt=he!==void 0,Ir=(Pe==null?void 0:Pe.sticky)===!0,[li,ui]=h.useState(!1),Fi=Lt??li,Ua=h.useCallback(()=>{Pt!==void 0?Pt():ui(!1)},[Pt]),U=h.useMemo(()=>zt===void 0?void 0:jo(zt,B),[zt,B])??n,dn=h.useRef();dn.current===void 0&&(dn.current=new AbortController),h.useEffect(()=>()=>dn==null?void 0:dn.current.abort(),[]);const[fn,Xa]=Sv(ae,S,B,dn.current,qe),H=h.useCallback((v,D,T)=>{if(ke===void 0)return!0;const V=[v[0]-B,v[1]];return ke==null?void 0:ke(V,D,T)},[B,ke]),ee=h.useRef(zt),ye=h.useCallback((v,D)=>{D&&(v=Tv(v,fn,B,ne,dn.current)),Cn!==void 0?(ee.current=jo(v,-B),Cn(ee.current)):i(v)},[Cn,fn,B,ne]),Ce=Jr(on,h.useCallback((v,D,T,V)=>{on==null||on(y[T-B],D,T-B,V)},[on,B,y])),ue=Jr(It,h.useCallback((v,D,T,V)=>{It==null||It(y[T-B],D,T-B,V)},[It,B,y])),Me=Jr($t,h.useCallback((v,D,T,V)=>{$t==null||$t(y[T-B],D,T-B,V)},[$t,B,y])),at=Jr(E,h.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),st=Jr(L,h.useCallback((v,D)=>(L==null?void 0:L({...v,col:v.col-B},D))??!1,[L,B])),Ie=h.useCallback(v=>{if(me!==void 0){const D=me(jo(v,-B));return typeof D=="boolean"?D:jo(D,B)}return!0},[me,B]),[Mt,Se,Ke]=Cv(U,ye,it,ce,le,bt,P),We=h.useMemo(()=>xr(id(),Ro),[Ro]),[ht,cn]=h.useState([0,0,0]),Tn=h.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),Ct=h.useCallback(v=>v.kind!==Z.Custom?Tn[v.kind]:Ge==null?void 0:Ge.find(D=>D.isMatch(v)),[Ge,Tn]);let{sizedColumns:Zt,nonGrowWidth:Jn}=Ep(y,qe,Xa,ht[0]-(B===0?0:Er)-ht[2],sr,Co,We,Ct,dn.current);In!=="none"&&(Jn+=Er);const kn=h.useMemo(()=>Zt.some(v=>v.group!==void 0),[Zt]),Tt=kn?Li+Mo:Li,Dn=U.rows.length,Ln=In==="none"?void 0:Dn===0?!1:Dn===qe?!0:void 0,St=h.useMemo(()=>In==="none"?Zt:[{title:"",width:Er,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ai,rowMarker:ar,rowMarkerChecked:Ln,headerRowMarkerTheme:vr,headerRowMarkerAlwaysVisible:br,headerRowMarkerDisabled:si},...Zt],[In,Zt,Er,ai,ar,Ln,vr,br,si]),tn=h.useRef({height:1,width:1,x:0,y:0}),Tr=h.useRef(!1),{setVisibleRegion:Dr,visibleRegion:Wr,scrollRef:Xt}=Uv(vn,hn,Zn,tn,()=>Tr.current=!0);tn.current=Wr;const gf=Wr.x+B,Eo=Wr.y,On=h.useRef(null),Mn=h.useCallback(v=>{var D;v===!0?(D=On.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=On.current)==null||T.focus()})},[]),bn=qt?qe+1:qe,Wn=h.useCallback(v=>{const D=B===0?v:v.map(V=>({...V,location:[V.location[0]-B,V.location[1]]})),T=be==null?void 0:be(D);if(T!==!0)for(const V of D)ie==null||ie(V.location,V.value);return T},[ie,be,B]),[Ur,Ya]=h.useState(),Io=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ci=Nr?(Hl=U.current)==null?void 0:Hl.cell:void 0,To=ci==null?void 0:ci[0],Do=ci==null?void 0:ci[1],mf=h.useMemo(()=>{if((Dt===void 0||Dt.length===0)&&(Io??To??Do??Ur)===void 0)return;const v=[];if(Dt!==void 0)for(const D of Dt){const T=St.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ti(We.accentColor,0),range:Ur,style:"dashed"}),Io!==void 0&&v.push({color:ti(We.accentColor,.5),range:Io,style:"solid-outline"}),To!==void 0&&Do!==void 0&&v.push({color:We.accentColor,range:{x:To,y:Do,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Io,To,Do,Dt,St.length,We.accentColor,B]),xl=h.useRef(St);xl.current=St;const Fn=h.useCallback(([v,D],T=!1)=>{var Y,W,X,q,K,pe,_e;const V=qt&&D===bn-1;if(v===0&&Bn){if(V)return qo;const ve=So(D);return ve===void 0?qo:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ar,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:In==="clickable-number"?"number":In,row:Pi+ve,drawHandle:$e!==void 0,cursor:In==="clickable-number"?"pointer":void 0}}else if(V){const Fe=v===B?(Pe==null?void 0:Pe.hint)??"":"",Te=xl.current[v];if(((Y=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Y.disabled)===!0)return qo;{const pt=((W=Te==null?void 0:Te.trailingRowOptions)==null?void 0:W.hint)??Fe,Ue=((X=Te==null?void 0:Te.trailingRowOptions)==null?void 0:X.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:jn.NewRow,hint:pt,allowOverlay:!1,icon:Ue}}}else{const ve=v-B;if(T||(Bt==null?void 0:Bt.strict)===!0){const Te=tn.current,pt=Te.x>ve||ve>Te.x+Te.width||Te.y>D||D>Te.y+Te.height||D>=ja.current,Ue=ve===((K=(q=Te.extras)==null?void 0:q.selected)==null?void 0:K[0])&&D===((pe=Te.extras)==null?void 0:pe.selected[1]);let Le=!1;if(((_e=Te.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const Rt of Te.extras.freezeRegions)if(ei(Rt,ve,D)){Le=!0;break}}if(pt&&!Ue&&!Le)return qo}let Fe=S([ve,D]);return B!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+B,Fe.span[1]+B]}),Fe}},[qt,bn,Bn,So,ar,U==null?void 0:U.rows,In,Pi,$e,B,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Bt==null?void 0:Bt.strict,S]),Ga=h.useCallback(v=>{let D=(dt==null?void 0:dt(v))??{name:v};return se!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ka({group:D.name,bounds:T.bounds})}]}),D},[dt,se]),Oo=h.useCallback(v=>{var X;const[D,T]=v.cell,V=St[D],$=(V==null?void 0:V.group)!==void 0?(X=Ga(V.group))==null?void 0:X.overrideTheme:void 0,Y=V==null?void 0:V.themeOverride,W=Vn==null?void 0:Vn(T);o({...v,theme:xr(We,$,Y,W,v.content.themeOverride)})},[Vn,St,Ga,We]),di=h.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[V,$]=U.current.cell,Y=Fn([V,$]);if(Y.kind!==Z.Boolean&&Y.allowOverlay){let X=Y;if(T!==void 0)switch(X.kind){case Z.Number:{const q=lg(()=>T==="-"?-0:Number.parseFloat(T),0);X={...X,data:Number.isNaN(q)?0:q};break}case Z.Text:case Z.Markdown:case Z.Uri:X={...X,data:T};break}Oo({target:v,content:X,initialValue:T,cell:[V,$],highlight:T===void 0,forceEditMode:T!==void 0})}else Y.kind===Z.Boolean&&D&&Y.readonly!==!0&&(Wn([{location:U.current.cell,value:{...Y,data:wd(Y.data)}}]),(W=On.current)==null||W.damage([{cell:U.current.cell}]))},[Fn,U,Wn,Oo]),kl=h.useCallback((v,D)=>{var $;const T=($=On.current)==null?void 0:$.getBounds(v,D);if(T===void 0||Xt.current===null)return;const V=Fn([v,D]);V.allowOverlay&&Oo({target:T,content:V,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Fn,Xt,Oo]),an=h.useCallback((v,D,T="both",V=0,$=0,Y=void 0)=>{if(Xt.current!==null){const W=On.current,X=s.current,q=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,pe=typeof v!="number"&&v.unit==="px"?v.amount:void 0,_e=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&X!==null){let ve={x:0,y:0,width:0,height:0},Fe=0,Te=0;if((q!==void 0||K!==void 0)&&(ve=W.getBounds((q??0)+B,K??0)??ve,ve.width===0||ve.height===0))return;const pt=X.getBoundingClientRect(),Ue=pt.width/X.offsetWidth;if(pe!==void 0&&(ve={...ve,x:pe-pt.left-Xt.current.scrollLeft,width:1}),_e!==void 0&&(ve={...ve,y:_e+pt.top-Xt.current.scrollTop,height:1}),ve!==void 0){const Le={x:ve.x-V,y:ve.y-$,width:ve.width+2*V,height:ve.height+2*$};let Rt=0;for(let rs=0;rs<Re;rs++)Rt+=Zt[rs].width;let jt=0;const sn=Ft+(Ir?1:0);sn>0&&(jt=ri(bn,sn,Zn));let tr=Rt*Ue+pt.left+B*Er*Ue,ur=pt.right,nr=pt.top+Tt*Ue,cr=pt.bottom-jt*Ue;const zo=ve.width+V*2;switch(Y==null?void 0:Y.hAlign){case"start":ur=tr+zo;break;case"end":tr=ur-zo;break;case"center":tr=Math.floor((tr+ur)/2)-zo/2,ur=tr+zo;break}const $o=ve.height+$*2;switch(Y==null?void 0:Y.vAlign){case"start":cr=nr+$o;break;case"end":nr=cr-$o;break;case"center":nr=Math.floor((nr+cr)/2)-$o/2,cr=nr+$o;break}tr>Le.x?Fe=Le.x-tr:ur<Le.x+Le.width&&(Fe=Le.x+Le.width-ur),nr>Le.y?Te=Le.y-nr:cr<Le.y+Le.height&&(Te=Le.y+Le.height-cr),T==="vertical"||typeof v=="number"&&v<Re?Fe=0:(T==="horizontal"||typeof D=="number"&&D>=bn-sn)&&(Te=0),(Fe!==0||Te!==0)&&(Ue!==1&&(Fe/=Ue,Te/=Ue),Xt.current.scrollTo(Fe+Xt.current.scrollLeft,Te+Xt.current.scrollTop))}}}},[B,Ft,Er,Xt,Tt,Re,Zt,bn,Ir,Zn]),Ml=h.useRef(kl),Rl=h.useRef(S),ja=h.useRef(qe);Ml.current=kl,Rl.current=S,ja.current=qe;const fi=h.useCallback(async(v,D=!0)=>{var q;const T=St[v];if(((q=T==null?void 0:T.trailingRowOptions)==null?void 0:q.disabled)===!0)return;const V=he==null?void 0:he();let $,Y=!0;V!==void 0&&($=await V,$==="top"&&(Y=!1),typeof $=="number"&&(Y=!1));let W=0;const X=()=>{if(ja.current<=qe){W<500&&window.setTimeout(X,W),W=50+W*2;return}const K=typeof $=="number"?$:Y?qe:0;Ho.current(v-B,K),Mt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const pe=Rl.current([v-B,K]);pe.allowOverlay&&Ki(pe)&&pe.readonly!==!0&&D&&window.setTimeout(()=>{Ml.current(v,K)},0)};X()},[St,he,B,qe,Mt]),Po=h.useCallback(v=>{var T,V;const D=((V=(T=Zt[v])==null?void 0:T.trailingRowOptions)==null?void 0:V.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof D=="number")return D+(Bn?1:0);if(typeof D=="object"){const $=y.indexOf(D);if($>=0)return $+(Bn?1:0)}},[Zt,y,Bn,Pe==null?void 0:Pe.targetColumn]),Or=h.useRef(),hi=h.useRef(),Hi=h.useCallback((v,D)=>{var $;const[T,V]=D;return xr(We,($=St[T])==null?void 0:$.themeOverride,Vn==null?void 0:Vn(V),v.themeOverride)},[Vn,St,We]),{mapper:Xr}=Bv(ze,w),Qn=ze==null?void 0:ze.navigationBehavior,zi=h.useCallback(v=>{var pe,_e,ve;const D=wa.value?v.metaKey:v.ctrlKey,T=D&&J==="multi",V=D&&rt==="multi",[$,Y]=v.location,W=U.columns,X=U.rows,[q,K]=((pe=U.current)==null?void 0:pe.cell)??[];if(v.kind==="cell"){if(hi.current=void 0,Yr.current=[$,Y],$===0&&Bn){if(qt===!0&&Y===qe||In==="number"||J==="none")return;const Fe=Fn(v.location);if(Fe.kind!==jn.Marker)return;if($e!==void 0){const Ue=Ct(Fe);An((Ue==null?void 0:Ue.kind)===jn.Marker);const Le=(_e=Ue==null?void 0:Ue.onClick)==null?void 0:_e.call(Ue,{...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(Fe,v.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),Mn();const Te=X.hasIndex(Y),pt=Or.current;if(J==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&pt!==void 0&&X.hasIndex(pt)){const Ue=[Math.min(pt,Y),Math.max(pt,Y)+1];T||He==="multi"?Se(void 0,Ue,!0):Se(yt.fromSingleSelection(Ue),void 0,T)}else J==="multi"&&(T||v.isTouch||He==="multi")?Te?Se(X.remove(Y),void 0,!0):(Se(void 0,Y,!0),Or.current=Y):Te&&X.length===1?Se(yt.empty(),void 0,D):(Se(yt.fromSingleSelection(Y),void 0,D),Or.current=Y)}else if($>=B&&qt&&Y===qe){const Fe=Po($);fi(Fe??$)}else if(q!==$||K!==Y){const Fe=Fn(v.location),Te=Ct(Fe);if((Te==null?void 0:Te.onSelect)!==void 0){let Le=!1;if(Te.onSelect({...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Le=!0,theme:Hi(Fe,v.location)}),Le)return}if(Qn==="block"&&Xr(Y).isGroupHeader)return;const pt=Ir&&Y===qe,Ue=Ir&&U!==void 0&&((ve=U.current)==null?void 0:ve.cell[1])===qe;if((v.shiftKey||v.isLongTouch===!0)&&q!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(pt)return;const Le=Math.min($,q),Rt=Math.max($,q),jt=Math.min(Y,K),sn=Math.max(Y,K);Mt({...U.current,range:{x:Le,y:jt,width:Rt-Le+1,height:sn-jt+1}},!0,D,"click"),Or.current=void 0,Mn()}else Mt({cell:[$,Y],range:{x:$,y:Y,width:1,height:1}},!0,D,"click"),Or.current=void 0,o(void 0),Mn()}}else if(v.kind==="header")if(Yr.current=[$,Y],o(void 0),Bn&&$===0)Or.current=void 0,hi.current=void 0,J==="multi"&&(X.length!==qe?Se(yt.fromSingleSelection([0,qe]),void 0,D):Se(yt.empty(),void 0,D),Mn());else{const Fe=hi.current;if(rt==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Fe!==void 0&&W.hasIndex(Fe)){const Te=[Math.min(Fe,$),Math.max(Fe,$)+1];V?Ke(void 0,Te,D):Ke(yt.fromSingleSelection(Te),void 0,D)}else V?(W.hasIndex($)?Ke(W.remove($),void 0,D):Ke(void 0,$,D),hi.current=$):rt!=="none"&&(Ke(yt.fromSingleSelection($),void 0,D),hi.current=$);Or.current=void 0,Mn()}else v.kind===Gn?Yr.current=[$,Y]:v.kind===ya&&!v.isMaybeScrollbar&&(ye(Ko,!1),o(void 0),Mn(),mt==null||mt(),Or.current=void 0,hi.current=void 0)},[J,rt,U,Bn,B,qt,qe,In,Fn,$e,Mn,He,Ct,Hi,Se,Po,fi,Qn,Xr,Ir,Mt,Ke,ye,mt]),$i=h.useRef(!1),Yr=h.useRef(),El=h.useRef(Wr),Un=h.useRef(),pf=h.useCallback(v=>{if(gi.current=!1,El.current=tn.current,v.button!==0&&v.button!==1){Un.current=void 0;return}const D=performance.now();Un.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(u({previousSelection:U,fillHandle:T}),Yr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Yr.current=v.location))},[U,zi]),[qa,Ka]=h.useState(),Il=h.useCallback(v=>{if(v.kind!==Gn||rt!=="multi")return;const D=wa.value?v.metaKey:v.ctrlKey,[T]=v.location,V=U.columns;if(T<B)return;const $=St[T];let Y=T,W=T;for(let X=T-1;X>=B&&so($.group,St[X].group);X--)Y--;for(let X=T+1;X<St.length&&so($.group,St[X].group);X++)W++;if(Mn(),D)if(V.hasAll([Y,W+1])){let X=V;for(let q=Y;q<=W;q++)X=X.remove(q);Ke(X,void 0,D)}else Ke(void 0,[Y,W+1],D);else Ke(yt.fromSingleSelection([Y,W+1]),void 0,D)},[rt,Mn,U.columns,St,B,Ke]),gi=h.useRef(!1),_o=h.useCallback(async v=>{if(fn!==void 0&&Ce!==void 0){const D=tn.current.y,T=tn.current.height;let V=fn({x:v,y:D,width:1,height:Math.min(T,qe-D)},dn.current.signal);typeof V!="object"&&(V=await V());const $=Zt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const X=ad(W,We,$,0,V,sr,Br,!1,Ct);Ce==null||Ce($,X.width,v,X.width)}}},[Zt,fn,Br,We,sr,Ce,B,qe,Ct]),[vf,Za]=h.useState(),mi=h.useCallback(async(v,D)=>{var X,q;const T=(X=v.current)==null?void 0:X.range;if(T===void 0||fn===void 0||D.current===void 0)return;const V=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...V,x:V.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let $=fn(T,dn.current.signal);typeof $!="object"&&($=await $());const Y=$,W=[];for(let K=0;K<V.width;K++)for(let pe=0;pe<V.height;pe++){const _e=[V.x+K,V.y+pe];if(Gc(_e,T))continue;const ve=Y[pe%T.height][K%T.width];wi(ve)||!Ki(ve)||W.push({location:_e,value:{...ve}})}Wn(W),(q=On.current)==null||q.damage(W.map(K=>({cell:K.location})))},[fn,Wn,x,B]),Tl=h.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};mi(v,U)},[mi,U]),Dl=h.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};mi(v,U)},[mi,U]),bf=h.useCallback((v,D)=>{var pe,_e;const T=l;if(u(void 0),Ya(void 0),Za(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((pe=T.previousSelection)==null?void 0:pe.current)!==void 0){if(Ur===void 0)return;const ve={...U,current:{...U.current,range:dd(T.previousSelection.current.range,Ur)}};mi(T.previousSelection,ve),ye(ve,!0);return}const[V,$]=v.location,[Y,W]=Yr.current??[],X=()=>{gi.current=!0},q=ve=>{var Te,pt,Ue;const Fe=ve.isTouch||Y===V&&W===$;if(Fe&&(M==null||M([V-B,$],{...ve,preventDefault:X})),ve.button===1)return!gi.current;if(!gi.current){const Le=Fn(v.location),Rt=Ct(Le);if(Rt!==void 0&&Rt.onClick!==void 0&&Fe){const sn=Rt.onClick({...ve,cell:Le,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Hi(Le,v.location),preventDefault:X});sn!==void 0&&!wi(sn)&&vi(sn)&&(Wn([{location:ve.location,value:sn}]),(Te=On.current)==null||Te.damage([{cell:ve.location}]))}if(gi.current||U.current===void 0)return!1;let jt=!1;switch(Le.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((Ue=(pt=T==null?void 0:T.previousSelection)==null?void 0:pt.current)==null?void 0:Ue.cell)===void 0)break;const[sn,tr]=U.current.cell,[ur,nr]=T.previousSelection.current.cell;jt=V===sn&&V===ur&&$===tr&&$===nr&&(ve.isDoubleClick===!0||lt==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return C==null||C([V-B,$]),di(ve.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const ve=tn.current,Fe=El.current;if(ve.x!==Fe.x||ve.y!==Fe.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((_e=U.current)==null?void 0:_e.cell,v.location)){oe==null||oe([K,v.location[1]],{...v,preventDefault:X});return}else if(v.kind==="header"&&U.columns.hasIndex(V)){xe==null||xe(K,{...v,preventDefault:X});return}else if(v.kind===Gn){if(K<0)return;G==null||G(K,{...v,preventDefault:X});return}}v.kind==="cell"?q(v)||zi(v):v.kind===Gn?Q==null||Q(K,{...v,preventDefault:X}):(v.kind===Ar&&(_==null||_(K,{...v,preventDefault:X})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&_o(V):v.button===0&&V===Y&&$===W&&(_==null||_(K,{...v,preventDefault:X}))}if(v.kind===Gn){if(K<0)return;v.button===0&&V===Y&&$===W&&(Q==null||Q(K,{...v,preventDefault:X}),gi.current||Il(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&q(v),Yr.current=void 0},[l,U,B,Ur,mi,ye,M,Fn,Ct,lt,Hi,Wn,C,di,oe,xe,G,zi,Q,_,_o,Il]),wf=h.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};Ae==null||Ae(D),l!==void 0&&v.buttons===0&&(u(void 0),Ya(void 0),Za(void 0),$i.current=!1),Za(T=>{var V;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((V=Un.current)==null?void 0:V.location[0])??0)<B?void 0:v.scrollEdge})},[l,Ae,B]),yf=h.useCallback((v,D)=>{et==null||et(v-B,D)},[et,B]),Cf=h.useCallback((v,D)=>{wt==null||wt(v-B,D)},[wt,B]),lr=(zl=U==null?void 0:U.current)==null?void 0:zl.cell,Sf=h.useCallback((v,D,T,V,$,Y)=>{Tr.current=!1;let W=lr;W!==void 0&&(W=[W[0]-B,W[1]]);const X=Re===0?void 0:{x:0,y:v.y,width:Re,height:v.height},q=[];X!==void 0&&q.push(X),Ft>0&&(q.push({x:v.x-B,y:qe-Ft,width:v.width,height:Ft}),Re>0&&q.push({x:0,y:qe-Ft,width:Re,height:Ft}));const K={x:v.x-B,y:v.y,width:v.width,height:qt&&v.y+v.height>=qe?v.height-1:v.height,tx:$,ty:Y,extras:{selected:W,freezeRegion:X,freezeRegions:q}};tn.current=K,Dr(K),cn([D,T,V]),rn==null||rn(K,K.tx,K.ty,K.extras)},[lr,B,qt,qe,Re,Ft,Dr,rn]),xf=Jr(tt,h.useCallback((v,D)=>{tt==null||tt(v-B,D-B),rt!=="none"&&Ke(yt.fromSingleSelection(D),void 0,!0)},[rt,tt,B,Ke])),Ja=h.useRef(!1),kf=h.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}De==null||De({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(Ja.current=!0),u(void 0)},[De,B]),Mf=h.useCallback(()=>{Ja.current=!1},[]),Ol=ze==null?void 0:ze.selectionBehavior,Lo=h.useCallback(v=>{if(Ol!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:V}=Xr(v);if(D)return[v,v];const $=T[T.length-1],Y=v-$,W=v+V-$-1;return[Y,W]},[Xr,Ol]),Qa=h.useRef(),es=h.useCallback(v=>{var D,T,V;if(!vd(v,Qa.current)&&(Qa.current=v,!(((D=Un==null?void 0:Un.current)==null?void 0:D.button)!==void 0&&Un.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Un.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&J==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Un.current.location[1])&&U.rows.hasIndex(Un.current.location[1])){const $=Math.min(Un.current.location[1],v.location[1]),Y=Math.max(Un.current.location[1],v.location[1])+1;Se(yt.fromSingleSelection([$,Y]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!Ja.current&&!$i.current&&(bt==="rect"||bt==="multi-rect")){const[$,Y]=U.current.cell;let[W,X]=v.location;if(X<0&&(X=tn.current.y),l.fillHandle===!0&&((V=l.previousSelection)==null?void 0:V.current)!==void 0){const q=l.previousSelection.current.range;X=Math.min(X,qt?qe-1:qe);const K=D0(q,W,X,gn);Ya(K)}else{if(qt&&Y===qe)return;if(qt&&X===qe)if(v.kind===ya)X--;else return;W=Math.max(W,B);const pe=Lo(Y);X=pe===void 0?X:Xn(X,pe[0],pe[1]);const _e=W-$,ve=X-Y,Fe={x:_e>=0?$:W,y:ve>=0?Y:X,width:Math.abs(_e)+1,height:Math.abs(ve)+1};Mt({...U.current,range:Fe},!0,!1,"drag")}}_t==null||_t({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,J,U,bt,_t,Se,qt,qe,gn,Lo,Mt]),Rf=h.useCallback(()=>{var W,X;const v=Qa.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[V,$]=v.location;const Y=tn.current;D===-1?V=((X=(W=Y.extras)==null?void 0:W.freezeRegion)==null?void 0:X.x)??Y.x:D===1&&(V=Y.x+Y.width),T===-1?$=Math.max(0,Y.y):T===1&&($=Math.min(qe-1,Y.y+Y.height)),V=Xn(V,0,St.length-1),$=Xn($,0,qe-1),es({...v,location:[V,$]})},[St.length,es,qe]);Hv(vf,Xt,Rf);const er=h.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[V,$]=U.current.cell,Y=U.current.range;let W=Y.x,X=Y.x+Y.width,q=Y.y,K=Y.y+Y.height;const[pe,_e]=Lo($)??[0,qe-1],ve=_e+1;if(T!==0)switch(T){case 2:{K=ve,q=$,an(0,K,"vertical");break}case-2:{q=pe,K=$+1,an(0,q,"vertical");break}case 1:{q<$?(q++,an(0,q,"vertical")):(K=Math.min(ve,K+1),an(0,K,"vertical"));break}case-1:{K>$+1?(K--,an(0,K,"vertical")):(q=Math.max(pe,q-1),an(0,q,"vertical"));break}default:ao()}if(D!==0)if(D===2)X=St.length,W=V,an(X-1-B,0,"horizontal");else if(D===-2)W=B,X=V+1,an(W-B,0,"horizontal");else{let Fe=[];if(fn!==void 0){const Te=fn({x:W,y:q,width:X-W-B,height:K-q},dn.current.signal);typeof Te=="object"&&(Fe=Gv(Te))}if(D===1){let Te=!1;if(W<V){if(Fe.length>0){const pt=dr(W+1,V+1).find(Ue=>!Fe.includes(Ue-B));pt!==void 0&&(W=pt,Te=!0)}else W++,Te=!0;Te&&an(W,0,"horizontal")}Te||(X=Math.min(St.length,X+1),an(X-1-B,0,"horizontal"))}else if(D===-1){let Te=!1;if(X>V+1){if(Fe.length>0){const pt=dr(X-1,V,-1).find(Ue=>!Fe.includes(Ue-B));pt!==void 0&&(X=pt,Te=!0)}else X--,Te=!0;Te&&an(X-B,0,"horizontal")}Te||(W=Math.max(B,W-1),an(W-B,0,"horizontal"))}else ao()}Mt({cell:U.current.cell,range:{x:W,y:q,width:X-W,height:K-q}},!0,!1,"keyboard-select")},[fn,Lo,U,St.length,B,qe,an,Mt]),ts=h.useRef(Ti);ts.current=Ti;const Pr=h.useCallback((v,D,T,V)=>{const $=bn-(T?0:1);v=Xn(v,B,Zt.length-1+B),D=Xn(D,0,$);const Y=lr==null?void 0:lr[0],W=lr==null?void 0:lr[1];if(v===Y&&D===W)return!1;if(V&&U.current!==void 0){const X=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&X.push(U.current.range),ye({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:X}},!0)}else Mt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===v&&c.current[1]===D&&(c.current=void 0),ts.current&&an(v-B,D),!0},[bn,B,Zt.length,lr,U,an,ye,Mt]),Ef=h.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&vi(v)&&(Wn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var $;($=On.current)==null||$.damage([{cell:r.cell}])})),Mn(!0),o(void 0);const[T,V]=D;if(U.current!==void 0&&(T!==0||V!==0)){const $=U.current.cell[1]===bn-1&&v!==void 0;Pr(Xn(U.current.cell[0]+T,0,St.length-1),Xn(U.current.cell[1]+V,0,bn-1),$,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Mn,U,R,Wn,bn,Pr,St.length]),If=h.useMemo(()=>`gdg-overlay-${Yv++}`,[]),Gr=h.useCallback(v=>{var T,V,$,Y;Mn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let X=v.y;X<v.y+v.height;X++){const q=S([W-B,X]);if(!q.allowOverlay&&q.kind!==Z.Boolean)continue;let K;if(q.kind===Z.Custom){const pe=Ct(q),_e=(T=pe==null?void 0:pe.provideEditor)==null?void 0:T.call(pe,q);(pe==null?void 0:pe.onDelete)!==void 0?K=pe.onDelete(q):bg(_e)&&(K=(V=_e==null?void 0:_e.deletedValue)==null?void 0:V.call(_e,q))}else if(vi(q)&&q.allowOverlay||q.kind===Z.Boolean){const pe=Ct(q);K=($=pe==null?void 0:pe.onDelete)==null?void 0:$.call(pe,q)}K!==void 0&&!wi(K)&&vi(K)&&D.push({location:[W,X],value:K})}Wn(D),(Y=On.current)==null||Y.damage(D.map(W=>({cell:W.location})))},[Mn,S,Ct,Wn,B]),Vi=r!==void 0,Pl=h.useCallback(v=>{var pt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:V}=v,$=U.columns,Y=U.rows,W=Nn;if(!Vi&&ut(W.clear,v,T))ye(Ko,!1),mt==null||mt();else if(!Vi&&ut(W.selectAll,v,T))ye({columns:yt.empty(),rows:yt.empty(),current:{cell:((pt=U.current)==null?void 0:pt.cell)??[B,0],range:{x:B,y:0,width:y.length,height:qe},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),ui(!0);else if(ut(W.delete,v,T)){const Le=(Ie==null?void 0:Ie(U))??!0;if(Le!==!1){const Rt=Le===!0?U:Le;if(Rt.current!==void 0){Gr(Rt.current.range);for(const jt of Rt.current.rangeStack)Gr(jt)}for(const jt of Rt.rows)Gr({x:B,y:jt,width:y.length,height:1});for(const jt of Rt.columns)Gr({x:jt,y:0,width:1,height:qe})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[X,q]=U.current.cell;const[,K]=U.current.cell;let pe=!1,_e=!1;if(ut(W.scrollToSelectedCell,v,T)?Ho.current(X-B,q):rt!=="none"&&ut(W.selectColumn,v,T)?$.hasIndex(X)?Ke($.remove(X),void 0,!0):rt==="single"?Ke(yt.fromSingleSelection(X),void 0,!0):Ke(void 0,X,!0):J!=="none"&&ut(W.selectRow,v,T)?Y.hasIndex(q)?Se(Y.remove(q),void 0,!0):J==="single"?Se(yt.fromSingleSelection(q),void 0,!0):Se(void 0,q,!0):!Vi&&V!==void 0&&ut(W.activateCell,v,T)?q===qe&&qt?window.setTimeout(()=>{const Le=Po(X);fi(Le??X)},0):(C==null||C([X-B,q]),di(V,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?Dl():U.current.range.width>1&&ut(W.rightFill,v,T)?Tl():ut(W.goToNextPage,v,T)?q+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?q-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),q=0,X=0):ut(W.goToLastCell,v,T)?(o(void 0),q=Number.MAX_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),er([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),er([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),q++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),q--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),X--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),X++)):(ut(W.goDownCell,v,T)?q+=1:ut(W.goUpCell,v,T)?q-=1:ut(W.goRightCell,v,T)?X+=1:ut(W.goLeftCell,v,T)?X-=1:ut(W.goDownCellRetainSelection,v,T)?(q+=1,pe=!0):ut(W.goUpCellRetainSelection,v,T)?(q-=1,pe=!0):ut(W.goRightCellRetainSelection,v,T)?(X+=1,pe=!0):ut(W.goLeftCellRetainSelection,v,T)?(X-=1,pe=!0):ut(W.goToLastRow,v,T)?q=qe-1:ut(W.goToFirstRow,v,T)?q=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?X=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?X=Number.MIN_SAFE_INTEGER:(bt==="rect"||bt==="multi-rect")&&(ut(W.selectGrowDown,v,T)?er([0,1]):ut(W.selectGrowUp,v,T)?er([0,-1]):ut(W.selectGrowRight,v,T)?er([1,0]):ut(W.selectGrowLeft,v,T)?er([-1,0]):ut(W.selectToLastRow,v,T)?er([0,2]):ut(W.selectToFirstRow,v,T)?er([0,-2]):ut(W.selectToLastColumn,v,T)?er([2,0]):ut(W.selectToFirstColumn,v,T)&&er([-2,0])),_e=T.didMatch),Qn!==void 0&&Qn!=="normal"&&q!==K){const Le=Qn==="skip-up"||Qn==="skip"||Qn==="block",Rt=Qn==="skip-down"||Qn==="skip"||Qn==="block",jt=q<K;if(jt&&Le){for(;q>=0&&Xr(q).isGroupHeader;)q--;q<0&&(q=K)}else if(!jt&&Rt){for(;q<qe&&Xr(q).isGroupHeader;)q++;q>=qe&&(q=K)}}const Fe=Pr(X,q,!1,pe),Te=T.didMatch;return Te&&(Fe||!_e||Qt)&&D(),Te},[Qn,Vi,U,Nn,rt,J,bt,B,Xr,qe,Pr,ye,mt,y.length,Ie,Qt,Gr,Ke,Se,qt,Po,fi,C,di,Dl,Tl,er]),Ni=h.useCallback(v=>{let D=!1;if(N!==void 0&&N({...v,cancel:()=>{D=!0}}),D||Pl(v)||U.current===void 0)return;const[T,V]=U.current.cell,$=tn.current;if(Ve&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(V,qe-1))]))){if((!qt||V!==qe)&&($.y>V||V>$.y+$.height||$.x>T||T>$.x+$.width))return;di(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ve,N,Pl,U,S,B,qe,qt,di]),Tf=h.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(xe==null||xe(T,{...v,preventDefault:D})),v.kind===Gn){if(T<0)return;G==null||G(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[V,$]=v.location;oe==null||oe([T,$],{...v,preventDefault:D}),cp(U,v.location)||Pr(V,$,!1,!1)}},[U,oe,G,xe,B,Pr]),ns=h.useCallback(async v=>{var W,X,q;if(!Nn.paste)return;function D(K,pe,_e,ve){var Te,pt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
|
172
|
+
`&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(Cu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Su(e,t,n){var s;const i=Iv(e,t),r=l=>{var u;(u=window.navigator.clipboard)==null||u.writeText(l)},o=(l,u)=>{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([l],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(l,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(l,u)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function wd(e){return e!==!0}function xu(e){return typeof e=="string"?e:`${e}px`}const Ov=()=>e=>e.innerWidth,Pv=()=>e=>e.innerHeight,_v=pn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Ov()],"wmyidgi-1":[Pv()]}}),Lv=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return h.createElement(_v,{innerHeight:xu(n),innerWidth:xu(t),...r},i)},Fv=2,Av=1300;function Hv(e,t,n){const i=te.useRef(0),[r,o]=e??[0,0];te.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=u=>{var c;if(!a){if(s===0)s=u;else{const d=u-s;i.current=Math.min(1,i.current+d/Av);const f=i.current**1.618*d*Fv;(c=t.current)==null||c.scrollBy(r*f,o*f),s=u,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function zv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,u,c,d,f,g]=te.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=id();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:g}}const Fr={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 ct(e,t){return e===!0?t:e===!1?"":e}function ku(e){const t=wa.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function $v(e){const t=_m(e);return te.useMemo(()=>{if(t===void 0)return ku(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return ku({...Fr,...n})},[t])}function Vv(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function al(e,t){const n=[];function i(a,s,l=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:s;i(a.subGroups[c],d,l||a.isCollapsed)}}const r=Vv(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function Ca(e,t){if(t===void 0||al.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Nv(e,t,n,i){const r=te.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]),o=te.useMemo(()=>r===void 0?t:r.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[r,t]),a=te.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=Ca(u,r);return c?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=te.useCallback(u=>{if(r===void 0)return u;let c=u;for(const d of r){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[r]),l=Jr(i??(e==null?void 0:e.themeOverride),te.useCallback(u=>{if(e===void 0)return i==null?void 0:i(u,u,u);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=Ca(u,r);return c?e.themeOverride:i==null?void 0:i(u,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function Bv(e,t){const n=te.useMemo(()=>e===void 0?void 0:al(e,t),[e,t]);return{getRowGroupingForPath:Cd,updateRowGroupingByPath:yd,mapper:te.useCallback(i=>{if(typeof i=="number")return Ca(i,n);const r=Ca(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function yd(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:yd(o.subGroups??[],r,n)}:o)}function Cd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:Cd(e[n].subGroups??[],i)}function Wv(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function Uv(e,t,n,i,r){const[o,a]=h.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=h.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,u,c]=Pm(s),d=h.useRef(r);d.current=r;const f=Wv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),g=(l.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&g){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,g,c,f]);const m=(l.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:l,setVisibleRegion:u,scrollRef:f}}const Xv=h.lazy(async()=>await Ws(()=>import("./data-grid-overlay-editor.CTNOILgF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let Yv=0;function Gv(e){return Jp(Vl(Vl(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return fr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function jo(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:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const qo={kind:Z.Loading,allowOverlay:!1},Ko={columns:yt.empty(),rows:yt.empty(),current:void 0},jv=(e,t)=>{var Hl,zl,$l;const[n,i]=h.useState(Ko),[r,o]=h.useState(),a=h.useRef(null),s=h.useRef(null),[l,u]=h.useState(),c=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:g,markdownDivCreateNode:m,width:p,height:b,columns:y,rows:w,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:L,editorBloom:z,onHeaderClicked:_,onColumnProposeMove:F,rangeSelectionColumnSpanning:P=!0,spanRangeBehavior:ne="default",onGroupHeaderClicked:Q,onCellContextMenu:oe,className:de,onHeaderContextMenu:xe,getCellsForSelection:ae,onGroupHeaderContextMenu:G,onGroupHeaderRenamed:se,onCellEdited:ie,onCellsEdited:be,onSearchResultsChanged:we,searchResults:j,onSearchValueChange:O,searchValue:k,onKeyDown:N,onKeyUp:re,keybindings:Oe,editOnType:Ve=!0,onRowAppended:he,onColumnMoved:tt,validateCell:ke,highlightRegions:Dt,rangeSelect:bt="rect",columnSelect:rt="multi",rowSelect:J="multi",rangeSelectionBlending:it="exclusive",columnSelectionBlending:ce="exclusive",rowSelectionBlending:le="exclusive",onDelete:me,onDragStart:De,onMouseMove:Ae,onPaste:nt,copyHeaders:ge=!1,freezeColumns:Re=0,cellActivationBehavior:lt="second-click",rowSelectionMode:He="auto",onHeaderMenuClick:et,onHeaderIndicatorClick:wt,getGroupDetails:dt,rowGrouping:ze,onSearchClose:Pt,onItemHovered:_t,onSelectionCleared:mt,showSearch:Lt,onVisibleRegionChanged:rn,gridSelection:zt,onGridSelectionChange:Cn,minColumnWidth:Ut=50,maxColumnWidth:kt=500,maxColumnAutoWidth:Pn,provideEditor:Sn,trailingRowOptions:Pe,freezeTrailingRows:Ft=0,allowedFillDirections:gn="orthogonal",scrollOffsetX:vn,scrollOffsetY:hn,verticalBorder:ot,onDragOverCell:Gt,onDrop:At,onColumnResize:on,onColumnResizeEnd:It,onColumnResizeStart:$t,customRenderers:Ge,fillHandle:Nt,experimental:Bt,fixedShadowX:fe,fixedShadowY:Ne,headerIcons:Kt,imageWindowLoader:En,initialSize:ln,isDraggable:A,onDragLeave:je,onRowMoved:$e,overscrollX:Ot,overscrollY:un,preventDiagonalScrolling:xn,rightElement:qn,rightElementProps:_n,trapFocus:Qt=!1,smoothScrollX:$n,smoothScrollY:Kn,scaleToRem:$a=!1,rowHeight:wo=34,headerHeight:yo=36,groupHeaderHeight:Va=yo,theme:oi,isOutsideClick:Rr,renderers:Ii,resizeIndicator:Na,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,In=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,ai=(en==null?void 0:en.theme)??e.rowMarkerTheme,br=en==null?void 0:en.headerTheme,wr=en==null?void 0:en.headerAlwaysVisible,si=J!=="multi",sr=(en==null?void 0:en.checkboxStyle)??"square",lr=Math.max(Ut,20),Br=Math.max(kt,lr),Co=Math.max(Pn??Br,lr),_i=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:qe,rowNumberMapper:So,rowHeight:xo,getRowThemeOverride:Vn}=Nv(ze,w,wo,g),ko=h.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:Zn,headerHeight:Li,groupHeaderHeight:Mo,theme:Ro,overscrollX:Ba,overscrollY:Wa}=zv({groupHeaderHeight:Va,headerHeight:yo,overscrollX:Ot,overscrollY:un,remSize:ko,rowHeight:xo,scaleToRem:$a,theme:oi}),Nn=$v(Oe),Er=Oi??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=In!=="none",B=Bn?1:0,qt=he!==void 0,Ir=(Pe==null?void 0:Pe.sticky)===!0,[li,ui]=h.useState(!1),Fi=Lt??li,Ua=h.useCallback(()=>{Pt!==void 0?Pt():ui(!1)},[Pt]),U=h.useMemo(()=>zt===void 0?void 0:jo(zt,B),[zt,B])??n,dn=h.useRef();dn.current===void 0&&(dn.current=new AbortController),h.useEffect(()=>()=>dn==null?void 0:dn.current.abort(),[]);const[fn,Xa]=Sv(ae,S,B,dn.current,qe),H=h.useCallback((v,D,T)=>{if(ke===void 0)return!0;const V=[v[0]-B,v[1]];return ke==null?void 0:ke(V,D,T)},[B,ke]),ee=h.useRef(zt),ye=h.useCallback((v,D)=>{D&&(v=Tv(v,fn,B,ne,dn.current)),Cn!==void 0?(ee.current=jo(v,-B),Cn(ee.current)):i(v)},[Cn,fn,B,ne]),Ce=Jr(on,h.useCallback((v,D,T,V)=>{on==null||on(y[T-B],D,T-B,V)},[on,B,y])),ue=Jr(It,h.useCallback((v,D,T,V)=>{It==null||It(y[T-B],D,T-B,V)},[It,B,y])),Me=Jr($t,h.useCallback((v,D,T,V)=>{$t==null||$t(y[T-B],D,T-B,V)},[$t,B,y])),at=Jr(E,h.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),st=Jr(L,h.useCallback((v,D)=>(L==null?void 0:L({...v,col:v.col-B},D))??!1,[L,B])),Ie=h.useCallback(v=>{if(me!==void 0){const D=me(jo(v,-B));return typeof D=="boolean"?D:jo(D,B)}return!0},[me,B]),[Mt,Se,Ke]=Cv(U,ye,it,ce,le,bt,P),We=h.useMemo(()=>xr(id(),Ro),[Ro]),[ht,cn]=h.useState([0,0,0]),Tn=h.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),Ct=h.useCallback(v=>v.kind!==Z.Custom?Tn[v.kind]:Ge==null?void 0:Ge.find(D=>D.isMatch(v)),[Ge,Tn]);let{sizedColumns:Zt,nonGrowWidth:Jn}=Ep(y,qe,Xa,ht[0]-(B===0?0:Er)-ht[2],lr,Co,We,Ct,dn.current);In!=="none"&&(Jn+=Er);const kn=h.useMemo(()=>Zt.some(v=>v.group!==void 0),[Zt]),Tt=kn?Li+Mo:Li,Dn=U.rows.length,Ln=In==="none"?void 0:Dn===0?!1:Dn===qe?!0:void 0,St=h.useMemo(()=>In==="none"?Zt:[{title:"",width:Er,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ai,rowMarker:sr,rowMarkerChecked:Ln,headerRowMarkerTheme:br,headerRowMarkerAlwaysVisible:wr,headerRowMarkerDisabled:si},...Zt],[In,Zt,Er,ai,sr,Ln,br,wr,si]),tn=h.useRef({height:1,width:1,x:0,y:0}),Tr=h.useRef(!1),{setVisibleRegion:Dr,visibleRegion:Wr,scrollRef:Xt}=Uv(vn,hn,Zn,tn,()=>Tr.current=!0);tn.current=Wr;const gf=Wr.x+B,Eo=Wr.y,On=h.useRef(null),Mn=h.useCallback(v=>{var D;v===!0?(D=On.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=On.current)==null||T.focus()})},[]),bn=qt?qe+1:qe,Wn=h.useCallback(v=>{const D=B===0?v:v.map(V=>({...V,location:[V.location[0]-B,V.location[1]]})),T=be==null?void 0:be(D);if(T!==!0)for(const V of D)ie==null||ie(V.location,V.value);return T},[ie,be,B]),[Ur,Ya]=h.useState(),Io=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ci=Nr?(Hl=U.current)==null?void 0:Hl.cell:void 0,To=ci==null?void 0:ci[0],Do=ci==null?void 0:ci[1],mf=h.useMemo(()=>{if((Dt===void 0||Dt.length===0)&&(Io??To??Do??Ur)===void 0)return;const v=[];if(Dt!==void 0)for(const D of Dt){const T=St.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ti(We.accentColor,0),range:Ur,style:"dashed"}),Io!==void 0&&v.push({color:ti(We.accentColor,.5),range:Io,style:"solid-outline"}),To!==void 0&&Do!==void 0&&v.push({color:We.accentColor,range:{x:To,y:Do,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Io,To,Do,Dt,St.length,We.accentColor,B]),xl=h.useRef(St);xl.current=St;const Fn=h.useCallback(([v,D],T=!1)=>{var Y,W,X,q,K,pe,_e;const V=qt&&D===bn-1;if(v===0&&Bn){if(V)return qo;const ve=So(D);return ve===void 0?qo:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:sr,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:In==="clickable-number"?"number":In,row:Pi+ve,drawHandle:$e!==void 0,cursor:In==="clickable-number"?"pointer":void 0}}else if(V){const Fe=v===B?(Pe==null?void 0:Pe.hint)??"":"",Te=xl.current[v];if(((Y=Te==null?void 0:Te.trailingRowOptions)==null?void 0:Y.disabled)===!0)return qo;{const pt=((W=Te==null?void 0:Te.trailingRowOptions)==null?void 0:W.hint)??Fe,Ue=((X=Te==null?void 0:Te.trailingRowOptions)==null?void 0:X.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:jn.NewRow,hint:pt,allowOverlay:!1,icon:Ue}}}else{const ve=v-B;if(T||(Bt==null?void 0:Bt.strict)===!0){const Te=tn.current,pt=Te.x>ve||ve>Te.x+Te.width||Te.y>D||D>Te.y+Te.height||D>=ja.current,Ue=ve===((K=(q=Te.extras)==null?void 0:q.selected)==null?void 0:K[0])&&D===((pe=Te.extras)==null?void 0:pe.selected[1]);let Le=!1;if(((_e=Te.extras)==null?void 0:_e.freezeRegions)!==void 0){for(const Rt of Te.extras.freezeRegions)if(ei(Rt,ve,D)){Le=!0;break}}if(pt&&!Ue&&!Le)return qo}let Fe=S([ve,D]);return B!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+B,Fe.span[1]+B]}),Fe}},[qt,bn,Bn,So,sr,U==null?void 0:U.rows,In,Pi,$e,B,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Bt==null?void 0:Bt.strict,S]),Ga=h.useCallback(v=>{let D=(dt==null?void 0:dt(v))??{name:v};return se!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ka({group:D.name,bounds:T.bounds})}]}),D},[dt,se]),Oo=h.useCallback(v=>{var X;const[D,T]=v.cell,V=St[D],$=(V==null?void 0:V.group)!==void 0?(X=Ga(V.group))==null?void 0:X.overrideTheme:void 0,Y=V==null?void 0:V.themeOverride,W=Vn==null?void 0:Vn(T);o({...v,theme:xr(We,$,Y,W,v.content.themeOverride)})},[Vn,St,Ga,We]),di=h.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[V,$]=U.current.cell,Y=Fn([V,$]);if(Y.kind!==Z.Boolean&&Y.allowOverlay){let X=Y;if(T!==void 0)switch(X.kind){case Z.Number:{const q=lg(()=>T==="-"?-0:Number.parseFloat(T),0);X={...X,data:Number.isNaN(q)?0:q};break}case Z.Text:case Z.Markdown:case Z.Uri:X={...X,data:T};break}Oo({target:v,content:X,initialValue:T,cell:[V,$],highlight:T===void 0,forceEditMode:T!==void 0})}else Y.kind===Z.Boolean&&D&&Y.readonly!==!0&&(Wn([{location:U.current.cell,value:{...Y,data:wd(Y.data)}}]),(W=On.current)==null||W.damage([{cell:U.current.cell}]))},[Fn,U,Wn,Oo]),kl=h.useCallback((v,D)=>{var $;const T=($=On.current)==null?void 0:$.getBounds(v,D);if(T===void 0||Xt.current===null)return;const V=Fn([v,D]);V.allowOverlay&&Oo({target:T,content:V,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Fn,Xt,Oo]),an=h.useCallback((v,D,T="both",V=0,$=0,Y=void 0)=>{if(Xt.current!==null){const W=On.current,X=s.current,q=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,pe=typeof v!="number"&&v.unit==="px"?v.amount:void 0,_e=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&X!==null){let ve={x:0,y:0,width:0,height:0},Fe=0,Te=0;if((q!==void 0||K!==void 0)&&(ve=W.getBounds((q??0)+B,K??0)??ve,ve.width===0||ve.height===0))return;const pt=X.getBoundingClientRect(),Ue=pt.width/X.offsetWidth;if(pe!==void 0&&(ve={...ve,x:pe-pt.left-Xt.current.scrollLeft,width:1}),_e!==void 0&&(ve={...ve,y:_e+pt.top-Xt.current.scrollTop,height:1}),ve!==void 0){const Le={x:ve.x-V,y:ve.y-$,width:ve.width+2*V,height:ve.height+2*$};let Rt=0;for(let rs=0;rs<Re;rs++)Rt+=Zt[rs].width;let jt=0;const sn=Ft+(Ir?1:0);sn>0&&(jt=ri(bn,sn,Zn));let tr=Rt*Ue+pt.left+B*Er*Ue,cr=pt.right,nr=pt.top+Tt*Ue,dr=pt.bottom-jt*Ue;const zo=ve.width+V*2;switch(Y==null?void 0:Y.hAlign){case"start":cr=tr+zo;break;case"end":tr=cr-zo;break;case"center":tr=Math.floor((tr+cr)/2)-zo/2,cr=tr+zo;break}const $o=ve.height+$*2;switch(Y==null?void 0:Y.vAlign){case"start":dr=nr+$o;break;case"end":nr=dr-$o;break;case"center":nr=Math.floor((nr+dr)/2)-$o/2,dr=nr+$o;break}tr>Le.x?Fe=Le.x-tr:cr<Le.x+Le.width&&(Fe=Le.x+Le.width-cr),nr>Le.y?Te=Le.y-nr:dr<Le.y+Le.height&&(Te=Le.y+Le.height-dr),T==="vertical"||typeof v=="number"&&v<Re?Fe=0:(T==="horizontal"||typeof D=="number"&&D>=bn-sn)&&(Te=0),(Fe!==0||Te!==0)&&(Ue!==1&&(Fe/=Ue,Te/=Ue),Xt.current.scrollTo(Fe+Xt.current.scrollLeft,Te+Xt.current.scrollTop))}}}},[B,Ft,Er,Xt,Tt,Re,Zt,bn,Ir,Zn]),Ml=h.useRef(kl),Rl=h.useRef(S),ja=h.useRef(qe);Ml.current=kl,Rl.current=S,ja.current=qe;const fi=h.useCallback(async(v,D=!0)=>{var q;const T=St[v];if(((q=T==null?void 0:T.trailingRowOptions)==null?void 0:q.disabled)===!0)return;const V=he==null?void 0:he();let $,Y=!0;V!==void 0&&($=await V,$==="top"&&(Y=!1),typeof $=="number"&&(Y=!1));let W=0;const X=()=>{if(ja.current<=qe){W<500&&window.setTimeout(X,W),W=50+W*2;return}const K=typeof $=="number"?$:Y?qe:0;Ho.current(v-B,K),Mt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const pe=Rl.current([v-B,K]);pe.allowOverlay&&Ki(pe)&&pe.readonly!==!0&&D&&window.setTimeout(()=>{Ml.current(v,K)},0)};X()},[St,he,B,qe,Mt]),Po=h.useCallback(v=>{var T,V;const D=((V=(T=Zt[v])==null?void 0:T.trailingRowOptions)==null?void 0:V.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof D=="number")return D+(Bn?1:0);if(typeof D=="object"){const $=y.indexOf(D);if($>=0)return $+(Bn?1:0)}},[Zt,y,Bn,Pe==null?void 0:Pe.targetColumn]),Or=h.useRef(),hi=h.useRef(),Hi=h.useCallback((v,D)=>{var $;const[T,V]=D;return xr(We,($=St[T])==null?void 0:$.themeOverride,Vn==null?void 0:Vn(V),v.themeOverride)},[Vn,St,We]),{mapper:Xr}=Bv(ze,w),Qn=ze==null?void 0:ze.navigationBehavior,zi=h.useCallback(v=>{var pe,_e,ve;const D=wa.value?v.metaKey:v.ctrlKey,T=D&&J==="multi",V=D&&rt==="multi",[$,Y]=v.location,W=U.columns,X=U.rows,[q,K]=((pe=U.current)==null?void 0:pe.cell)??[];if(v.kind==="cell"){if(hi.current=void 0,Yr.current=[$,Y],$===0&&Bn){if(qt===!0&&Y===qe||In==="number"||J==="none")return;const Fe=Fn(v.location);if(Fe.kind!==jn.Marker)return;if($e!==void 0){const Ue=Ct(Fe);An((Ue==null?void 0:Ue.kind)===jn.Marker);const Le=(_e=Ue==null?void 0:Ue.onClick)==null?void 0:_e.call(Ue,{...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(Fe,v.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Fe.checked)return}o(void 0),Mn();const Te=X.hasIndex(Y),pt=Or.current;if(J==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&pt!==void 0&&X.hasIndex(pt)){const Ue=[Math.min(pt,Y),Math.max(pt,Y)+1];T||He==="multi"?Se(void 0,Ue,!0):Se(yt.fromSingleSelection(Ue),void 0,T)}else J==="multi"&&(T||v.isTouch||He==="multi")?Te?Se(X.remove(Y),void 0,!0):(Se(void 0,Y,!0),Or.current=Y):Te&&X.length===1?Se(yt.empty(),void 0,D):(Se(yt.fromSingleSelection(Y),void 0,D),Or.current=Y)}else if($>=B&&qt&&Y===qe){const Fe=Po($);fi(Fe??$)}else if(q!==$||K!==Y){const Fe=Fn(v.location),Te=Ct(Fe);if((Te==null?void 0:Te.onSelect)!==void 0){let Le=!1;if(Te.onSelect({...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Le=!0,theme:Hi(Fe,v.location)}),Le)return}if(Qn==="block"&&Xr(Y).isGroupHeader)return;const pt=Ir&&Y===qe,Ue=Ir&&U!==void 0&&((ve=U.current)==null?void 0:ve.cell[1])===qe;if((v.shiftKey||v.isLongTouch===!0)&&q!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(pt)return;const Le=Math.min($,q),Rt=Math.max($,q),jt=Math.min(Y,K),sn=Math.max(Y,K);Mt({...U.current,range:{x:Le,y:jt,width:Rt-Le+1,height:sn-jt+1}},!0,D,"click"),Or.current=void 0,Mn()}else Mt({cell:[$,Y],range:{x:$,y:Y,width:1,height:1}},!0,D,"click"),Or.current=void 0,o(void 0),Mn()}}else if(v.kind==="header")if(Yr.current=[$,Y],o(void 0),Bn&&$===0)Or.current=void 0,hi.current=void 0,J==="multi"&&(X.length!==qe?Se(yt.fromSingleSelection([0,qe]),void 0,D):Se(yt.empty(),void 0,D),Mn());else{const Fe=hi.current;if(rt==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Fe!==void 0&&W.hasIndex(Fe)){const Te=[Math.min(Fe,$),Math.max(Fe,$)+1];V?Ke(void 0,Te,D):Ke(yt.fromSingleSelection(Te),void 0,D)}else V?(W.hasIndex($)?Ke(W.remove($),void 0,D):Ke(void 0,$,D),hi.current=$):rt!=="none"&&(Ke(yt.fromSingleSelection($),void 0,D),hi.current=$);Or.current=void 0,Mn()}else v.kind===Gn?Yr.current=[$,Y]:v.kind===ya&&!v.isMaybeScrollbar&&(ye(Ko,!1),o(void 0),Mn(),mt==null||mt(),Or.current=void 0,hi.current=void 0)},[J,rt,U,Bn,B,qt,qe,In,Fn,$e,Mn,He,Ct,Hi,Se,Po,fi,Qn,Xr,Ir,Mt,Ke,ye,mt]),$i=h.useRef(!1),Yr=h.useRef(),El=h.useRef(Wr),Un=h.useRef(),pf=h.useCallback(v=>{if(gi.current=!1,El.current=tn.current,v.button!==0&&v.button!==1){Un.current=void 0;return}const D=performance.now();Un.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(u({previousSelection:U,fillHandle:T}),Yr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Yr.current=v.location))},[U,zi]),[qa,Ka]=h.useState(),Il=h.useCallback(v=>{if(v.kind!==Gn||rt!=="multi")return;const D=wa.value?v.metaKey:v.ctrlKey,[T]=v.location,V=U.columns;if(T<B)return;const $=St[T];let Y=T,W=T;for(let X=T-1;X>=B&&so($.group,St[X].group);X--)Y--;for(let X=T+1;X<St.length&&so($.group,St[X].group);X++)W++;if(Mn(),D)if(V.hasAll([Y,W+1])){let X=V;for(let q=Y;q<=W;q++)X=X.remove(q);Ke(X,void 0,D)}else Ke(void 0,[Y,W+1],D);else Ke(yt.fromSingleSelection([Y,W+1]),void 0,D)},[rt,Mn,U.columns,St,B,Ke]),gi=h.useRef(!1),_o=h.useCallback(async v=>{if(fn!==void 0&&Ce!==void 0){const D=tn.current.y,T=tn.current.height;let V=fn({x:v,y:D,width:1,height:Math.min(T,qe-D)},dn.current.signal);typeof V!="object"&&(V=await V());const $=Zt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const X=ad(W,We,$,0,V,lr,Br,!1,Ct);Ce==null||Ce($,X.width,v,X.width)}}},[Zt,fn,Br,We,lr,Ce,B,qe,Ct]),[vf,Za]=h.useState(),mi=h.useCallback(async(v,D)=>{var X,q;const T=(X=v.current)==null?void 0:X.range;if(T===void 0||fn===void 0||D.current===void 0)return;const V=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...V,x:V.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let $=fn(T,dn.current.signal);typeof $!="object"&&($=await $());const Y=$,W=[];for(let K=0;K<V.width;K++)for(let pe=0;pe<V.height;pe++){const _e=[V.x+K,V.y+pe];if(Gc(_e,T))continue;const ve=Y[pe%T.height][K%T.width];wi(ve)||!Ki(ve)||W.push({location:_e,value:{...ve}})}Wn(W),(q=On.current)==null||q.damage(W.map(K=>({cell:K.location})))},[fn,Wn,x,B]),Tl=h.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};mi(v,U)},[mi,U]),Dl=h.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};mi(v,U)},[mi,U]),bf=h.useCallback((v,D)=>{var pe,_e;const T=l;if(u(void 0),Ya(void 0),Za(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((pe=T.previousSelection)==null?void 0:pe.current)!==void 0){if(Ur===void 0)return;const ve={...U,current:{...U.current,range:dd(T.previousSelection.current.range,Ur)}};mi(T.previousSelection,ve),ye(ve,!0);return}const[V,$]=v.location,[Y,W]=Yr.current??[],X=()=>{gi.current=!0},q=ve=>{var Te,pt,Ue;const Fe=ve.isTouch||Y===V&&W===$;if(Fe&&(M==null||M([V-B,$],{...ve,preventDefault:X})),ve.button===1)return!gi.current;if(!gi.current){const Le=Fn(v.location),Rt=Ct(Le);if(Rt!==void 0&&Rt.onClick!==void 0&&Fe){const sn=Rt.onClick({...ve,cell:Le,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Hi(Le,v.location),preventDefault:X});sn!==void 0&&!wi(sn)&&vi(sn)&&(Wn([{location:ve.location,value:sn}]),(Te=On.current)==null||Te.damage([{cell:ve.location}]))}if(gi.current||U.current===void 0)return!1;let jt=!1;switch(Le.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((Ue=(pt=T==null?void 0:T.previousSelection)==null?void 0:pt.current)==null?void 0:Ue.cell)===void 0)break;const[sn,tr]=U.current.cell,[cr,nr]=T.previousSelection.current.cell;jt=V===sn&&V===cr&&$===tr&&$===nr&&(ve.isDoubleClick===!0||lt==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return C==null||C([V-B,$]),di(ve.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const ve=tn.current,Fe=El.current;if(ve.x!==Fe.x||ve.y!==Fe.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((_e=U.current)==null?void 0:_e.cell,v.location)){oe==null||oe([K,v.location[1]],{...v,preventDefault:X});return}else if(v.kind==="header"&&U.columns.hasIndex(V)){xe==null||xe(K,{...v,preventDefault:X});return}else if(v.kind===Gn){if(K<0)return;G==null||G(K,{...v,preventDefault:X});return}}v.kind==="cell"?q(v)||zi(v):v.kind===Gn?Q==null||Q(K,{...v,preventDefault:X}):(v.kind===Ar&&(_==null||_(K,{...v,preventDefault:X})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&_o(V):v.button===0&&V===Y&&$===W&&(_==null||_(K,{...v,preventDefault:X}))}if(v.kind===Gn){if(K<0)return;v.button===0&&V===Y&&$===W&&(Q==null||Q(K,{...v,preventDefault:X}),gi.current||Il(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&q(v),Yr.current=void 0},[l,U,B,Ur,mi,ye,M,Fn,Ct,lt,Hi,Wn,C,di,oe,xe,G,zi,Q,_,_o,Il]),wf=h.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};Ae==null||Ae(D),l!==void 0&&v.buttons===0&&(u(void 0),Ya(void 0),Za(void 0),$i.current=!1),Za(T=>{var V;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((V=Un.current)==null?void 0:V.location[0])??0)<B?void 0:v.scrollEdge})},[l,Ae,B]),yf=h.useCallback((v,D)=>{et==null||et(v-B,D)},[et,B]),Cf=h.useCallback((v,D)=>{wt==null||wt(v-B,D)},[wt,B]),ur=(zl=U==null?void 0:U.current)==null?void 0:zl.cell,Sf=h.useCallback((v,D,T,V,$,Y)=>{Tr.current=!1;let W=ur;W!==void 0&&(W=[W[0]-B,W[1]]);const X=Re===0?void 0:{x:0,y:v.y,width:Re,height:v.height},q=[];X!==void 0&&q.push(X),Ft>0&&(q.push({x:v.x-B,y:qe-Ft,width:v.width,height:Ft}),Re>0&&q.push({x:0,y:qe-Ft,width:Re,height:Ft}));const K={x:v.x-B,y:v.y,width:v.width,height:qt&&v.y+v.height>=qe?v.height-1:v.height,tx:$,ty:Y,extras:{selected:W,freezeRegion:X,freezeRegions:q}};tn.current=K,Dr(K),cn([D,T,V]),rn==null||rn(K,K.tx,K.ty,K.extras)},[ur,B,qt,qe,Re,Ft,Dr,rn]),xf=Jr(tt,h.useCallback((v,D)=>{tt==null||tt(v-B,D-B),rt!=="none"&&Ke(yt.fromSingleSelection(D),void 0,!0)},[rt,tt,B,Ke])),Ja=h.useRef(!1),kf=h.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}De==null||De({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(Ja.current=!0),u(void 0)},[De,B]),Mf=h.useCallback(()=>{Ja.current=!1},[]),Ol=ze==null?void 0:ze.selectionBehavior,Lo=h.useCallback(v=>{if(Ol!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:V}=Xr(v);if(D)return[v,v];const $=T[T.length-1],Y=v-$,W=v+V-$-1;return[Y,W]},[Xr,Ol]),Qa=h.useRef(),es=h.useCallback(v=>{var D,T,V;if(!vd(v,Qa.current)&&(Qa.current=v,!(((D=Un==null?void 0:Un.current)==null?void 0:D.button)!==void 0&&Un.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Un.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&J==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Un.current.location[1])&&U.rows.hasIndex(Un.current.location[1])){const $=Math.min(Un.current.location[1],v.location[1]),Y=Math.max(Un.current.location[1],v.location[1])+1;Se(yt.fromSingleSelection([$,Y]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!Ja.current&&!$i.current&&(bt==="rect"||bt==="multi-rect")){const[$,Y]=U.current.cell;let[W,X]=v.location;if(X<0&&(X=tn.current.y),l.fillHandle===!0&&((V=l.previousSelection)==null?void 0:V.current)!==void 0){const q=l.previousSelection.current.range;X=Math.min(X,qt?qe-1:qe);const K=D0(q,W,X,gn);Ya(K)}else{if(qt&&Y===qe)return;if(qt&&X===qe)if(v.kind===ya)X--;else return;W=Math.max(W,B);const pe=Lo(Y);X=pe===void 0?X:Xn(X,pe[0],pe[1]);const _e=W-$,ve=X-Y,Fe={x:_e>=0?$:W,y:ve>=0?Y:X,width:Math.abs(_e)+1,height:Math.abs(ve)+1};Mt({...U.current,range:Fe},!0,!1,"drag")}}_t==null||_t({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,J,U,bt,_t,Se,qt,qe,gn,Lo,Mt]),Rf=h.useCallback(()=>{var W,X;const v=Qa.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[V,$]=v.location;const Y=tn.current;D===-1?V=((X=(W=Y.extras)==null?void 0:W.freezeRegion)==null?void 0:X.x)??Y.x:D===1&&(V=Y.x+Y.width),T===-1?$=Math.max(0,Y.y):T===1&&($=Math.min(qe-1,Y.y+Y.height)),V=Xn(V,0,St.length-1),$=Xn($,0,qe-1),es({...v,location:[V,$]})},[St.length,es,qe]);Hv(vf,Xt,Rf);const er=h.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[V,$]=U.current.cell,Y=U.current.range;let W=Y.x,X=Y.x+Y.width,q=Y.y,K=Y.y+Y.height;const[pe,_e]=Lo($)??[0,qe-1],ve=_e+1;if(T!==0)switch(T){case 2:{K=ve,q=$,an(0,K,"vertical");break}case-2:{q=pe,K=$+1,an(0,q,"vertical");break}case 1:{q<$?(q++,an(0,q,"vertical")):(K=Math.min(ve,K+1),an(0,K,"vertical"));break}case-1:{K>$+1?(K--,an(0,K,"vertical")):(q=Math.max(pe,q-1),an(0,q,"vertical"));break}default:ao()}if(D!==0)if(D===2)X=St.length,W=V,an(X-1-B,0,"horizontal");else if(D===-2)W=B,X=V+1,an(W-B,0,"horizontal");else{let Fe=[];if(fn!==void 0){const Te=fn({x:W,y:q,width:X-W-B,height:K-q},dn.current.signal);typeof Te=="object"&&(Fe=Gv(Te))}if(D===1){let Te=!1;if(W<V){if(Fe.length>0){const pt=fr(W+1,V+1).find(Ue=>!Fe.includes(Ue-B));pt!==void 0&&(W=pt,Te=!0)}else W++,Te=!0;Te&&an(W,0,"horizontal")}Te||(X=Math.min(St.length,X+1),an(X-1-B,0,"horizontal"))}else if(D===-1){let Te=!1;if(X>V+1){if(Fe.length>0){const pt=fr(X-1,V,-1).find(Ue=>!Fe.includes(Ue-B));pt!==void 0&&(X=pt,Te=!0)}else X--,Te=!0;Te&&an(X-B,0,"horizontal")}Te||(W=Math.max(B,W-1),an(W-B,0,"horizontal"))}else ao()}Mt({cell:U.current.cell,range:{x:W,y:q,width:X-W,height:K-q}},!0,!1,"keyboard-select")},[fn,Lo,U,St.length,B,qe,an,Mt]),ts=h.useRef(Ti);ts.current=Ti;const Pr=h.useCallback((v,D,T,V)=>{const $=bn-(T?0:1);v=Xn(v,B,Zt.length-1+B),D=Xn(D,0,$);const Y=ur==null?void 0:ur[0],W=ur==null?void 0:ur[1];if(v===Y&&D===W)return!1;if(V&&U.current!==void 0){const X=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&X.push(U.current.range),ye({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:X}},!0)}else Mt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===v&&c.current[1]===D&&(c.current=void 0),ts.current&&an(v-B,D),!0},[bn,B,Zt.length,ur,U,an,ye,Mt]),Ef=h.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&vi(v)&&(Wn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var $;($=On.current)==null||$.damage([{cell:r.cell}])})),Mn(!0),o(void 0);const[T,V]=D;if(U.current!==void 0&&(T!==0||V!==0)){const $=U.current.cell[1]===bn-1&&v!==void 0;Pr(Xn(U.current.cell[0]+T,0,St.length-1),Xn(U.current.cell[1]+V,0,bn-1),$,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Mn,U,R,Wn,bn,Pr,St.length]),If=h.useMemo(()=>`gdg-overlay-${Yv++}`,[]),Gr=h.useCallback(v=>{var T,V,$,Y;Mn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let X=v.y;X<v.y+v.height;X++){const q=S([W-B,X]);if(!q.allowOverlay&&q.kind!==Z.Boolean)continue;let K;if(q.kind===Z.Custom){const pe=Ct(q),_e=(T=pe==null?void 0:pe.provideEditor)==null?void 0:T.call(pe,q);(pe==null?void 0:pe.onDelete)!==void 0?K=pe.onDelete(q):bg(_e)&&(K=(V=_e==null?void 0:_e.deletedValue)==null?void 0:V.call(_e,q))}else if(vi(q)&&q.allowOverlay||q.kind===Z.Boolean){const pe=Ct(q);K=($=pe==null?void 0:pe.onDelete)==null?void 0:$.call(pe,q)}K!==void 0&&!wi(K)&&vi(K)&&D.push({location:[W,X],value:K})}Wn(D),(Y=On.current)==null||Y.damage(D.map(W=>({cell:W.location})))},[Mn,S,Ct,Wn,B]),Vi=r!==void 0,Pl=h.useCallback(v=>{var pt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:V}=v,$=U.columns,Y=U.rows,W=Nn;if(!Vi&&ut(W.clear,v,T))ye(Ko,!1),mt==null||mt();else if(!Vi&&ut(W.selectAll,v,T))ye({columns:yt.empty(),rows:yt.empty(),current:{cell:((pt=U.current)==null?void 0:pt.cell)??[B,0],range:{x:B,y:0,width:y.length,height:qe},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),ui(!0);else if(ut(W.delete,v,T)){const Le=(Ie==null?void 0:Ie(U))??!0;if(Le!==!1){const Rt=Le===!0?U:Le;if(Rt.current!==void 0){Gr(Rt.current.range);for(const jt of Rt.current.rangeStack)Gr(jt)}for(const jt of Rt.rows)Gr({x:B,y:jt,width:y.length,height:1});for(const jt of Rt.columns)Gr({x:jt,y:0,width:1,height:qe})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[X,q]=U.current.cell;const[,K]=U.current.cell;let pe=!1,_e=!1;if(ut(W.scrollToSelectedCell,v,T)?Ho.current(X-B,q):rt!=="none"&&ut(W.selectColumn,v,T)?$.hasIndex(X)?Ke($.remove(X),void 0,!0):rt==="single"?Ke(yt.fromSingleSelection(X),void 0,!0):Ke(void 0,X,!0):J!=="none"&&ut(W.selectRow,v,T)?Y.hasIndex(q)?Se(Y.remove(q),void 0,!0):J==="single"?Se(yt.fromSingleSelection(q),void 0,!0):Se(void 0,q,!0):!Vi&&V!==void 0&&ut(W.activateCell,v,T)?q===qe&&qt?window.setTimeout(()=>{const Le=Po(X);fi(Le??X)},0):(C==null||C([X-B,q]),di(V,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?Dl():U.current.range.width>1&&ut(W.rightFill,v,T)?Tl():ut(W.goToNextPage,v,T)?q+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?q-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),q=0,X=0):ut(W.goToLastCell,v,T)?(o(void 0),q=Number.MAX_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),er([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),er([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),q++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),q--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),X--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),X++)):(ut(W.goDownCell,v,T)?q+=1:ut(W.goUpCell,v,T)?q-=1:ut(W.goRightCell,v,T)?X+=1:ut(W.goLeftCell,v,T)?X-=1:ut(W.goDownCellRetainSelection,v,T)?(q+=1,pe=!0):ut(W.goUpCellRetainSelection,v,T)?(q-=1,pe=!0):ut(W.goRightCellRetainSelection,v,T)?(X+=1,pe=!0):ut(W.goLeftCellRetainSelection,v,T)?(X-=1,pe=!0):ut(W.goToLastRow,v,T)?q=qe-1:ut(W.goToFirstRow,v,T)?q=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?X=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?X=Number.MIN_SAFE_INTEGER:(bt==="rect"||bt==="multi-rect")&&(ut(W.selectGrowDown,v,T)?er([0,1]):ut(W.selectGrowUp,v,T)?er([0,-1]):ut(W.selectGrowRight,v,T)?er([1,0]):ut(W.selectGrowLeft,v,T)?er([-1,0]):ut(W.selectToLastRow,v,T)?er([0,2]):ut(W.selectToFirstRow,v,T)?er([0,-2]):ut(W.selectToLastColumn,v,T)?er([2,0]):ut(W.selectToFirstColumn,v,T)&&er([-2,0])),_e=T.didMatch),Qn!==void 0&&Qn!=="normal"&&q!==K){const Le=Qn==="skip-up"||Qn==="skip"||Qn==="block",Rt=Qn==="skip-down"||Qn==="skip"||Qn==="block",jt=q<K;if(jt&&Le){for(;q>=0&&Xr(q).isGroupHeader;)q--;q<0&&(q=K)}else if(!jt&&Rt){for(;q<qe&&Xr(q).isGroupHeader;)q++;q>=qe&&(q=K)}}const Fe=Pr(X,q,!1,pe),Te=T.didMatch;return Te&&(Fe||!_e||Qt)&&D(),Te},[Qn,Vi,U,Nn,rt,J,bt,B,Xr,qe,Pr,ye,mt,y.length,Ie,Qt,Gr,Ke,Se,qt,Po,fi,C,di,Dl,Tl,er]),Ni=h.useCallback(v=>{let D=!1;if(N!==void 0&&N({...v,cancel:()=>{D=!0}}),D||Pl(v)||U.current===void 0)return;const[T,V]=U.current.cell,$=tn.current;if(Ve&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(V,qe-1))]))){if((!qt||V!==qe)&&($.y>V||V>$.y+$.height||$.x>T||T>$.x+$.width))return;di(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ve,N,Pl,U,S,B,qe,qt,di]),Tf=h.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(xe==null||xe(T,{...v,preventDefault:D})),v.kind===Gn){if(T<0)return;G==null||G(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[V,$]=v.location;oe==null||oe([T,$],{...v,preventDefault:D}),cp(U,v.location)||Pr(V,$,!1,!1)}},[U,oe,G,xe,B,Pr]),ns=h.useCallback(async v=>{var W,X,q;if(!Nn.paste)return;function D(K,pe,_e,ve){var Te,pt;const Fe=typeof _e=="object"?(_e==null?void 0:_e.join(`
|
173
173
|
`))??"":(_e==null?void 0:_e.toString())??"";if(!wi(K)&&Ki(K)&&K.readonly!==!0){const Ue=I==null?void 0:I(Fe,K);if(Ue!==void 0&&vi(Ue))return{location:pe,value:Ue};const Le=Ct(K);if(Le===void 0)return;if(Le.kind===Z.Custom){An(K.kind===Z.Custom);const Rt=(Te=Le.onPaste)==null?void 0:Te.call(Le,Fe,K.data);return Rt===void 0?void 0:{location:pe,value:{...K,data:Rt}}}else{const Rt=(pt=Le.onPaste)==null?void 0:pt.call(Le,Fe,K,{formatted:ve,formattedString:typeof ve=="string"?ve:ve==null?void 0:ve.join(`
|
174
|
-
`),rawValue:_e});return Rt===void 0?void 0:(An(Rt.kind===K.kind),{location:pe,value:Rt})}}}const T=U.columns,V=U.rows,$=((W=Xt.current)==null?void 0:W.contains(document.activeElement))===!0||((X=s.current)==null?void 0:X.contains(document.activeElement))===!0;let Y;if(U.current!==void 0?Y=[U.current.range.x,U.current.range.y]:T.length===1?Y=[T.first()??0,0]:V.length===1&&(Y=[B,V.first()??0]),$&&Y!==void 0){let K,pe;const _e="text/plain",ve="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Le of Ue){if(Le.types.includes(ve)){const jt=await(await Le.getType(ve)).text(),sn=yu(jt);if(sn!==void 0){K=sn;break}}Le.types.includes(_e)&&(pe=await(await Le.getType(_e)).text())}}else if(navigator.clipboard.readText!==void 0)pe=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(ve)){const Ue=v.clipboardData.getData(ve);K=yu(Ue)}K===void 0&&v.clipboardData.types.includes(_e)&&(pe=v.clipboardData.getData(_e))}else return;const[Fe,Te]=Y,pt=[];do{if(nt===void 0){const Ue=Fn(Y),Le=pe??(K==null?void 0:K.map(jt=>jt.map(sn=>sn.rawValue).join(" ")).join(" "))??"",Rt=D(Ue,Y,Le,void 0);Rt!==void 0&&pt.push(Rt);break}if(K===void 0){if(pe===void 0)return;K=Dv(pe)}if(nt===!1||typeof nt=="function"&&(nt==null?void 0:nt([Y[0]-B,Y[1]],K.map(Ue=>Ue.map(Le=>{var Rt;return((Rt=Le.rawValue)==null?void 0:Rt.toString())??""}))))!==!0)return;for(const[Ue,Le]of K.entries()){if(Ue+Te>=qe)break;for(const[Rt,jt]of Le.entries()){const sn=[Rt+Fe,Ue+Te],[tr,ur]=sn;if(tr>=St.length||ur>=bn)continue;const nr=Fn(sn),cr=D(nr,sn,jt.rawValue,jt.formatted);cr!==void 0&&pt.push(cr)}}}while(!1);Wn(pt),(q=On.current)==null||q.damage(pt.map(Ue=>({cell:Ue.location})))}},[I,Ct,Fn,U,Nn.paste,Xt,St.length,Wn,bn,nt,B,qe]);mn("paste",ns,d,!1,!0);const Bi=h.useCallback(async(v,D)=>{var W,X;if(!Nn.copy)return;const T=D===!0||((W=Xt.current)==null?void 0:W.contains(document.activeElement))===!0||((X=s.current)==null?void 0:X.contains(document.activeElement))===!0,V=U.columns,$=U.rows,Y=(q,K)=>{if(!ge)Su(q,K,v);else{const pe=K.map(_e=>({kind:Z.Text,data:y[_e].title,displayData:y[_e].title,allowOverlay:!1}));Su([pe,...q],K,v)}};if(T&&fn!==void 0){if(U.current!==void 0){let q=fn(U.current.range,dn.current.signal);typeof q!="object"&&(q=await q()),Y(q,dr(U.current.range.x-B,U.current.range.x+U.current.range.width-B))}else if($!==void 0&&$.length>0){const K=[...$].map(pe=>{const _e=fn({x:B,y:pe,width:y.length,height:1},dn.current.signal);return typeof _e=="object"?_e[0]:_e().then(ve=>ve[0])});if(K.some(pe=>pe instanceof Promise)){const pe=await Promise.all(K);Y(pe,dr(y.length))}else Y(K,dr(y.length))}else if(V.length>0){const q=[],K=[];for(const pe of V){let _e=fn({x:pe,y:0,width:1,height:qe},dn.current.signal);typeof _e!="object"&&(_e=await _e()),q.push(_e),K.push(pe-B)}if(q.length===1)Y(q[0],K);else{const pe=q.reduce((_e,ve)=>_e.map((Fe,Te)=>[...Fe,...ve[Te]]));Y(pe,K)}}}},[y,fn,U,Nn.copy,B,Xt,qe,ge]);mn("copy",Bi,d,!1,!1);const Df=h.useCallback(async v=>{var T,V;if(!(!Nn.cut||!(((T=Xt.current)==null?void 0:T.contains(document.activeElement))===!0||((V=s.current)==null?void 0:V.contains(document.activeElement))===!0))&&(await Bi(v),U.current!==void 0)){let $={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const Y=Ie==null?void 0:Ie($);if(Y===!1||($=Y===!0?$:Y,$.current===void 0))return;Gr($.current.range)}},[Gr,U,Nn.cut,Bi,Xt,Ie]);mn("cut",Df,d,!1,!1);const Of=h.useCallback((v,D)=>{if(we!==void 0){B!==0&&(v=v.map($=>[$[0]-B,$[1]])),we(v,D);return}if(v.length===0||D===-1)return;const[T,V]=v[D];c.current!==void 0&&c.current[0]===T&&c.current[1]===V||(c.current=[T,V],Pr(T,V,!1,!1))},[we,B,Pr]),[Fo,Ao]=(($l=zt==null?void 0:zt.current)==null?void 0:$l.cell)??[],Ho=h.useRef(an);Ho.current=an,h.useLayoutEffect(()=>{var v,D,T,V;ts.current&&!Tr.current&&Fo!==void 0&&Ao!==void 0&&(Fo!==((D=(v=ee.current)==null?void 0:v.current)==null?void 0:D.cell[0])||Ao!==((V=(T=ee.current)==null?void 0:T.current)==null?void 0:V.cell[1]))&&Ho.current(Fo,Ao),Tr.current=!1},[Fo,Ao]);const _l=U.current!==void 0&&(U.current.cell[0]>=St.length||U.current.cell[1]>=bn);h.useLayoutEffect(()=>{_l&&ye(Ko,!1)},[_l,ye]);const Pf=h.useMemo(()=>qt===!0&&(Pe==null?void 0:Pe.tint)===!0?yt.fromSingleSelection(bn-1):yt.empty(),[bn,qt,Pe==null?void 0:Pe.tint]),_f=h.useCallback(v=>typeof ot=="boolean"?ot:(ot==null?void 0:ot(v-B))??!0,[B,ot]),Lf=h.useMemo(()=>{if(qa===void 0||s.current===null)return null;const{bounds:v,group:D}=qa,T=s.current.getBoundingClientRect();return h.createElement(wv,{bounds:v,group:D,canvasBounds:T,onClose:()=>Ka(void 0),onFinish:V=>{Ka(void 0),se==null||se(D,V)}})},[se,qa]),Ff=Math.min(St.length,Re+(Bn?1:0));h.useImperativeHandle(t,()=>({appendRow:(v,D)=>fi(v+B,D),updateCells:v=>{var D;return B!==0&&(v=v.map(T=>({cell:[T.cell[0]+B,T.cell[1]]}))),(D=On.current)==null?void 0:D.damage(v)},getBounds:(v,D)=>{var T;if(!((s==null?void 0:s.current)===null||(Xt==null?void 0:Xt.current)===null)){if(v===void 0&&D===void 0){const V=s.current.getBoundingClientRect(),$=V.width/Xt.current.clientWidth;return{x:V.x-Xt.current.scrollLeft*$,y:V.y-Xt.current.scrollTop*$,width:Xt.current.scrollWidth*$,height:Xt.current.scrollHeight*$}}return(T=On.current)==null?void 0:T.getBounds((v??0)+B,D)}},focus:()=>{var v;return(v=On.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":Ni({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":Ni({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":Ni({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 Bi(void 0,!0);break;case"paste":await ns();break}},scrollTo:an,remeasureColumns:v=>{for(const D of v)_o(D+B)}}),[fi,_o,Xt,Bi,Ni,ns,B,an]);const[Ll,Fl]=lr??[],Af=h.useCallback(v=>{const[D,T]=v;if(T===-1){rt!=="none"&&(Ke(yt.fromSingleSelection(D),void 0,!1),Mn());return}Ll===D&&Fl===T||(Mt({cell:v,range:{x:D,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),an(D,T))},[rt,Mn,an,Ll,Fl,Mt,Ke]),[Hf,zf]=h.useState(!1),Al=h.useRef(Lc(v=>{zf(v)},5)),$f=h.useCallback(()=>{Al.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&l===void 0&&Mt({cell:[B,Eo],range:{x:B,y:Eo,width:1,height:1}},!0,!1,"keyboard-select")},[Eo,U,l,B,Mt]),Vf=h.useCallback(()=>{Al.current(!1)},[]),[Nf,Bf]=h.useMemo(()=>{let v;const D=(Bt==null?void 0:Bt.scrollbarWidthOverride)??Os(),T=qe+(qt?1:0);if(typeof Zn=="number")v=Tt+T*Zn;else{let $=0;const Y=Math.min(T,10);for(let W=0;W<Y;W++)$+=Zn(W);$=Math.floor($/Y),v=Tt+T*$}v+=D;const V=St.reduce(($,Y)=>Y.width+$,0)+D;return[`${Math.min(1e5,V)}px`,`${Math.min(1e5,v)}px`]},[St,Bt==null?void 0:Bt.scrollbarWidthOverride,Zn,qe,qt,Tt]),Wf=h.useMemo(()=>kp(We),[We]);return h.createElement(od.Provider,{value:We},h.createElement(Lv,{style:Wf,className:de,inWidth:p??Nf,inHeight:b??Bf},h.createElement(mv,{fillHandle:Nt,drawFocusRing:Nr,experimental:Bt,fixedShadowX:fe,fixedShadowY:Ne,getRowThemeOverride:Vn,headerIcons:Kt,imageWindowLoader:En,initialSize:ln,isDraggable:A,onDragLeave:je,onRowMoved:$e,overscrollX:Ba,overscrollY:Wa,preventDiagonalScrolling:xn,rightElement:qn,rightElementProps:_n,smoothScrollX:$n,smoothScrollY:Kn,className:de,enableGroups:kn,onCanvasFocused:$f,onCanvasBlur:Vf,canvasRef:s,onContextMenu:Tf,theme:We,cellXOffset:gf,cellYOffset:Eo,accessibilityHeight:Wr.height,onDragEnd:Mf,columns:St,nonGrowWidth:Jn,drawHeader:at,onColumnProposeMove:F,drawCell:st,disabledRows:Pf,freezeColumns:Ff,lockColumns:B,firstColAccessible:B===0,getCellContent:Fn,minColumnWidth:sr,maxColumnWidth:Br,searchInputRef:a,showSearch:Fi,onSearchClose:Ua,highlightRegions:mf,getCellsForSelection:fn,getGroupDetails:Ga,headerHeight:Li,isFocused:Hf,groupHeaderHeight:kn?Mo:0,freezeTrailingRows:Ft+(qt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:qt,onColumnResize:Ce,onColumnResizeEnd:ue,onColumnResizeStart:Me,onCellFocused:Af,onColumnMoved:xf,onDragStart:kf,onHeaderMenuClick:yf,onHeaderIndicatorClick:Cf,onItemHovered:es,isFilling:(l==null?void 0:l.fillHandle)===!0,onMouseMove:wf,onKeyDown:Ni,onKeyUp:re,onMouseDown:pf,onMouseUp:bf,onDragOverCell:Gt,onDrop:At,onSearchResultsChanged:Of,onVisibleRegionChanged:Sf,clientSize:ht,rowHeight:Zn,searchResults:j,searchValue:k,onSearchValueChange:O,rows:bn,scrollRef:Xt,selection:U,translateX:Wr.tx,translateY:Wr.ty,verticalBorder:_f,gridRef:On,getCellRenderer:Ct,resizeIndicator:Na}),Lf,r!==void 0&&h.createElement(h.Suspense,{fallback:null},h.createElement(Xv,{...r,validateCell:H,bloom:z,id:If,getCellRenderer:Ct,className:(Bt==null?void 0:Bt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:Sn,imageEditorOverride:f,onFinishEditing:Ef,markdownDivCreateNode:m,isOutsideClick:Rr}))))},qv=h.forwardRef(jv),Sd=20;function Mu(e){const{cell:t,posX:n,posY:i,bounds:r,theme:o}=e,{width:a,height:s,x:l,y:u}=r,c=t.maxSize??Sd,d=Math.floor(r.y+s/2),f=Hc(c,s,o.cellVerticalPadding),g=Ac(t.contentAlign??"center",l,a,o.cellHorizontalPadding,f),m=Fc(g,d,f),p=zc(l+n,u+i,m);return Gs(t)&&p}const Kv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Zv(e,e.cell.data,Gs(e.cell),e.cell.maxSize??Sd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Mu(e)&&e.preventDefault()},onClick:e=>{if(Mu(e))return{...e.cell,data:wd(e.cell.data)}},onPaste:(e,t)=>{let n=ca;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ys),n===t.data?void 0:{...t,data:n}}};function Zv(e,t,n,i,r){if(!n&&t===ca)return;const{ctx:o,hoverAmount:a,theme:s,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:g,y:m,width:p,height:b}=l;let y=!1;if(r>0){let w=n?1-r+r*a:.4;if(t===ca&&(w*=a),w===0)return;w<1&&(y=!0,o.globalAlpha=w)}il(o,s,t,g,m,p,b,u,c,d,i,f),y&&(o.globalAlpha=1)}const Jv=pn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Qv=e=>{const{bubbles:t}=e;return h.createElement(Jv,null,t.map((n,i)=>h.createElement("div",{key:i,className:"boe-bubble"},n)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},e1={getAccessibilityString:e=>$c(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r).width+i+20,0)+2*n.cellHorizontalPadding-4,draw:e=>n1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(Qv,{bubbles:t.data})},onPaste:()=>{}},t1=4;function n1(e,t){const{rect:n,theme:i,ctx:r,highlighted:o}=e,{x:a,y:s,width:l,height:u}=n,c=20,d=8,f=t1;let g=a+i.cellHorizontalPadding;const m=[];for(const p of t){if(g>a+l)break;const b=ii(p,r,i.baseFontFull).width;m.push({x:g,width:b}),g+=b+d*2+f}r.beginPath();for(const p of m)mr(r,p.x,s+(u-c)/2,p.width+d*2,c,i.roundingRadius??c/2);r.fillStyle=o?i.bgBubbleSelected:i.bgBubble,r.fill();for(const[p,b]of m.entries())r.beginPath(),r.fillStyle=i.textBubble,r.fillText(t[p],b.x+d,s+u/2+pr(r,i))}const r1=pn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),i1=e=>{const{drilldowns:t}=e;return h.createElement(r1,null,t.map((n,i)=>h.createElement("div",{key:i,className:"doe-bubble"},n.img!==void 0&&h.createElement("img",{src:n.img}),h.createElement("div",null,n.text))))},o1={getAccessibilityString:e=>$c(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r.text).width+i+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>l1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(i1,{drilldowns:t.data})},onPaste:()=>{}},a1=4,ms={};function s1(e,t,n,i){const r=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,s=4,l=n*r,u=i+o,c=i*3,d=(c+o*2)*r,f=`${e},${t},${r},${n}`;if(ms[f]!==void 0)return{el:ms[f],height:l,width:d,middleWidth:s*r,sideWidth:u*r,padding:o*r,dpr:r};const g=document.createElement("canvas"),m=g.getContext("2d");return m===null?null:(g.width=d,g.height=l,m.scale(r,r),ms[f]=g,m.beginPath(),mr(m,o,o,c,a,i),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),mr(m,o+.5,o+.5,c,a,i),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:g,height:l,width:d,sideWidth:u*r,middleWidth:i*r,padding:o*r,dpr:r})}function l1(e,t){const{rect:n,theme:i,ctx:r,imageLoader:o,col:a,row:s}=e,{x:l,width:u}=n,c=i.baseFontFull,d=ed(r,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*i.lineHeight)*2)),g=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,b=a1;let y=l+i.cellHorizontalPadding;const w=i.roundingRadius??6,S=s1(i.bgCell,i.drilldownBorder,f,w),M=[];for(const C of t){if(y>l+u)break;const R=ii(C.text,r,c).width;let I=0;C.img!==void 0&&o.loadOrGetImage(C.img,a,s)!==void 0&&(I=m-8+4);const E=R+I+p*2;M.push({x:y,width:E}),y+=E+b}if(S!==null){const{el:C,height:x,middleWidth:R,sideWidth:I,width:E,dpr:L,padding:z}=S,_=I/L,F=z/L;for(const P of M){const ne=Math.floor(P.x),Q=Math.floor(P.width),oe=Q-(_-F)*2;r.imageSmoothingEnabled=!1,r.drawImage(C,0,0,I,x,ne-F,g,_,f),oe>0&&r.drawImage(C,I,0,R,x,ne+(_-F),g,oe,f),r.drawImage(C,E-I,0,I,x,ne+Q-(_-F),g,_,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[C,x]of M.entries()){const R=t[C];let I=x.x+p;if(R.img!==void 0){const E=o.loadOrGetImage(R.img,a,s);if(E!==void 0){const L=m-8;let z=0,_=0,F=E.width,P=E.height;F>P?(z+=(F-P)/2,F=P):P>F&&(_+=(P-F)/2,P=F),r.beginPath(),mr(r,I,g+f/2-L/2,L,L,i.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,z,_,F,P,I,g+f/2-L/2,L,L),r.restore(),I+=L+4}}r.beginPath(),r.fillStyle=i.textBubble,r.fillText(R.text,I,g+f/2+pr(r,i))}}const u1={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>c1(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:i}=e,r=i??Lm;return h.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const i=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(i.length===t.data.length&&i.every((r,o)=>r===t.data[o])))return{...t,data:i}}},ps=4;function c1(e,t,n,i){const{rect:r,col:o,row:a,theme:s,ctx:l,imageLoader:u}=e,{x:c,y:d,height:f,width:g}=r,m=f-s.cellVerticalPadding*2,p=[];let b=0;for(let w=0;w<t.length;w++){const S=t[w];if(S.length===0)continue;const M=u.loadOrGetImage(S,o,a);if(M!==void 0){p[w]=M;const C=M.width*(m/M.height);b+=C+ps}}if(b===0)return;b-=ps;let y=c+s.cellHorizontalPadding;i==="right"?y=Math.floor(c+g-s.cellHorizontalPadding-b):i==="center"&&(y=Math.floor(c+g/2-b/2));for(const w of p){if(w===void 0)continue;const S=w.width*(m/w.height);n>0&&(l.beginPath(),mr(l,y,d+s.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(w,y,d+s.cellVerticalPadding,S,m),n>0&&l.restore(),y+=S+ps}}function d1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const f1={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:i,ctx:r,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(d1(n,i)*t.skeletonWidthVariability));const l=a.cellHorizontalPadding;s+l*2>=o.width&&(s=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);mr(r,o.x+l,o.y+(o.height-u)/2,s,u,a.roundingRadius??3),r.fillStyle=ti(a.textDark,.1),r.fill()},onPaste:()=>{}},h1=()=>e=>e.targetWidth,Ru=pn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[h1(),"px"]}}),g1=e=>{const{value:t,onChange:n,forceEditMode:i,createNode:r,targetRect:o,onFinish:a,validatedSelection:s}=e,l=t.data,u=t.readonly===!0,[c,d]=h.useState(l===""||i),f=h.useCallback(()=>{d(m=>!m)},[]),g=l?"gdg-ml-6":"";return c?h.createElement(Ru,{targetWidth:o.width-20},h.createElement(Ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),h.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>a(t)},h.createElement(Em,null))):h.createElement(Ru,{targetWidth:o.width},h.createElement(Qm,{contents:l,createNode:r}),!u&&h.createElement(h.Fragment,null,h.createElement("div",{className:"spacer"}),h.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:f},h.createElement(Zs,null))),h.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},m1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:vo,measure:(e,t,n)=>{const i=t.data.split(`
|
175
|
-
`)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>
|
176
|
-
`,t.allowWrapping===!0?void 0:1);let r=0;for(const o of i)r=Math.max(r,e.measureText(o).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:i,value:r,validatedSelection:o}=t;return h.createElement(Ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:o,onChange:a=>i({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},T1=pn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),D1=e=>{const{uri:t,onChange:n,forceEditMode:i,readonly:r,validatedSelection:o,preview:a}=e,[s,l]=h.useState(!r&&(t===""||i)),u=h.useCallback(()=>{l(!0)},[]);return s?h.createElement(Ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):h.createElement(T1,null,h.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&h.createElement("div",{className:"gdg-edit-icon",onClick:u},h.createElement(Zs,null)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function kd(e,t,n,i){let r=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return i==="right"?r=t.width-a-n.cellHorizontalPadding:i==="center"&&(r=t.width/2-a/2),{x:r,y:o,width:a,height:s}}function Eu(e){const{cell:t,bounds:n,posX:i,posY:r,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Zc(a,o.baseFontFull);if(s===void 0)return!1;const l=kd(s,n,o,t.contentAlign);return ei({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},i,r)}const O1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:vo,draw:e=>{const{cell:t,theme:n,overrideCursor:i,hoverX:r,hoverY:o,rect:a,ctx:s}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(i!==void 0&&u&&r!==void 0&&o!==void 0){const c=ii(l,s,n.baseFontFull),d=kd(c,a,n,t.contentAlign),{x:f,y:g,width:m,height:p}=d;if(r>=f-4&&r<=f-4+m+8&&o>=g-4&&o<=g-4+p+8){const b=
|
174
|
+
`),rawValue:_e});return Rt===void 0?void 0:(An(Rt.kind===K.kind),{location:pe,value:Rt})}}}const T=U.columns,V=U.rows,$=((W=Xt.current)==null?void 0:W.contains(document.activeElement))===!0||((X=s.current)==null?void 0:X.contains(document.activeElement))===!0;let Y;if(U.current!==void 0?Y=[U.current.range.x,U.current.range.y]:T.length===1?Y=[T.first()??0,0]:V.length===1&&(Y=[B,V.first()??0]),$&&Y!==void 0){let K,pe;const _e="text/plain",ve="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Le of Ue){if(Le.types.includes(ve)){const jt=await(await Le.getType(ve)).text(),sn=yu(jt);if(sn!==void 0){K=sn;break}}Le.types.includes(_e)&&(pe=await(await Le.getType(_e)).text())}}else if(navigator.clipboard.readText!==void 0)pe=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(ve)){const Ue=v.clipboardData.getData(ve);K=yu(Ue)}K===void 0&&v.clipboardData.types.includes(_e)&&(pe=v.clipboardData.getData(_e))}else return;const[Fe,Te]=Y,pt=[];do{if(nt===void 0){const Ue=Fn(Y),Le=pe??(K==null?void 0:K.map(jt=>jt.map(sn=>sn.rawValue).join(" ")).join(" "))??"",Rt=D(Ue,Y,Le,void 0);Rt!==void 0&&pt.push(Rt);break}if(K===void 0){if(pe===void 0)return;K=Dv(pe)}if(nt===!1||typeof nt=="function"&&(nt==null?void 0:nt([Y[0]-B,Y[1]],K.map(Ue=>Ue.map(Le=>{var Rt;return((Rt=Le.rawValue)==null?void 0:Rt.toString())??""}))))!==!0)return;for(const[Ue,Le]of K.entries()){if(Ue+Te>=qe)break;for(const[Rt,jt]of Le.entries()){const sn=[Rt+Fe,Ue+Te],[tr,cr]=sn;if(tr>=St.length||cr>=bn)continue;const nr=Fn(sn),dr=D(nr,sn,jt.rawValue,jt.formatted);dr!==void 0&&pt.push(dr)}}}while(!1);Wn(pt),(q=On.current)==null||q.damage(pt.map(Ue=>({cell:Ue.location})))}},[I,Ct,Fn,U,Nn.paste,Xt,St.length,Wn,bn,nt,B,qe]);mn("paste",ns,d,!1,!0);const Bi=h.useCallback(async(v,D)=>{var W,X;if(!Nn.copy)return;const T=D===!0||((W=Xt.current)==null?void 0:W.contains(document.activeElement))===!0||((X=s.current)==null?void 0:X.contains(document.activeElement))===!0,V=U.columns,$=U.rows,Y=(q,K)=>{if(!ge)Su(q,K,v);else{const pe=K.map(_e=>({kind:Z.Text,data:y[_e].title,displayData:y[_e].title,allowOverlay:!1}));Su([pe,...q],K,v)}};if(T&&fn!==void 0){if(U.current!==void 0){let q=fn(U.current.range,dn.current.signal);typeof q!="object"&&(q=await q()),Y(q,fr(U.current.range.x-B,U.current.range.x+U.current.range.width-B))}else if($!==void 0&&$.length>0){const K=[...$].map(pe=>{const _e=fn({x:B,y:pe,width:y.length,height:1},dn.current.signal);return typeof _e=="object"?_e[0]:_e().then(ve=>ve[0])});if(K.some(pe=>pe instanceof Promise)){const pe=await Promise.all(K);Y(pe,fr(y.length))}else Y(K,fr(y.length))}else if(V.length>0){const q=[],K=[];for(const pe of V){let _e=fn({x:pe,y:0,width:1,height:qe},dn.current.signal);typeof _e!="object"&&(_e=await _e()),q.push(_e),K.push(pe-B)}if(q.length===1)Y(q[0],K);else{const pe=q.reduce((_e,ve)=>_e.map((Fe,Te)=>[...Fe,...ve[Te]]));Y(pe,K)}}}},[y,fn,U,Nn.copy,B,Xt,qe,ge]);mn("copy",Bi,d,!1,!1);const Df=h.useCallback(async v=>{var T,V;if(!(!Nn.cut||!(((T=Xt.current)==null?void 0:T.contains(document.activeElement))===!0||((V=s.current)==null?void 0:V.contains(document.activeElement))===!0))&&(await Bi(v),U.current!==void 0)){let $={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const Y=Ie==null?void 0:Ie($);if(Y===!1||($=Y===!0?$:Y,$.current===void 0))return;Gr($.current.range)}},[Gr,U,Nn.cut,Bi,Xt,Ie]);mn("cut",Df,d,!1,!1);const Of=h.useCallback((v,D)=>{if(we!==void 0){B!==0&&(v=v.map($=>[$[0]-B,$[1]])),we(v,D);return}if(v.length===0||D===-1)return;const[T,V]=v[D];c.current!==void 0&&c.current[0]===T&&c.current[1]===V||(c.current=[T,V],Pr(T,V,!1,!1))},[we,B,Pr]),[Fo,Ao]=(($l=zt==null?void 0:zt.current)==null?void 0:$l.cell)??[],Ho=h.useRef(an);Ho.current=an,h.useLayoutEffect(()=>{var v,D,T,V;ts.current&&!Tr.current&&Fo!==void 0&&Ao!==void 0&&(Fo!==((D=(v=ee.current)==null?void 0:v.current)==null?void 0:D.cell[0])||Ao!==((V=(T=ee.current)==null?void 0:T.current)==null?void 0:V.cell[1]))&&Ho.current(Fo,Ao),Tr.current=!1},[Fo,Ao]);const _l=U.current!==void 0&&(U.current.cell[0]>=St.length||U.current.cell[1]>=bn);h.useLayoutEffect(()=>{_l&&ye(Ko,!1)},[_l,ye]);const Pf=h.useMemo(()=>qt===!0&&(Pe==null?void 0:Pe.tint)===!0?yt.fromSingleSelection(bn-1):yt.empty(),[bn,qt,Pe==null?void 0:Pe.tint]),_f=h.useCallback(v=>typeof ot=="boolean"?ot:(ot==null?void 0:ot(v-B))??!0,[B,ot]),Lf=h.useMemo(()=>{if(qa===void 0||s.current===null)return null;const{bounds:v,group:D}=qa,T=s.current.getBoundingClientRect();return h.createElement(wv,{bounds:v,group:D,canvasBounds:T,onClose:()=>Ka(void 0),onFinish:V=>{Ka(void 0),se==null||se(D,V)}})},[se,qa]),Ff=Math.min(St.length,Re+(Bn?1:0));h.useImperativeHandle(t,()=>({appendRow:(v,D)=>fi(v+B,D),updateCells:v=>{var D;return B!==0&&(v=v.map(T=>({cell:[T.cell[0]+B,T.cell[1]]}))),(D=On.current)==null?void 0:D.damage(v)},getBounds:(v,D)=>{var T;if(!((s==null?void 0:s.current)===null||(Xt==null?void 0:Xt.current)===null)){if(v===void 0&&D===void 0){const V=s.current.getBoundingClientRect(),$=V.width/Xt.current.clientWidth;return{x:V.x-Xt.current.scrollLeft*$,y:V.y-Xt.current.scrollTop*$,width:Xt.current.scrollWidth*$,height:Xt.current.scrollHeight*$}}return(T=On.current)==null?void 0:T.getBounds((v??0)+B,D)}},focus:()=>{var v;return(v=On.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":Ni({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":Ni({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":Ni({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 Bi(void 0,!0);break;case"paste":await ns();break}},scrollTo:an,remeasureColumns:v=>{for(const D of v)_o(D+B)}}),[fi,_o,Xt,Bi,Ni,ns,B,an]);const[Ll,Fl]=ur??[],Af=h.useCallback(v=>{const[D,T]=v;if(T===-1){rt!=="none"&&(Ke(yt.fromSingleSelection(D),void 0,!1),Mn());return}Ll===D&&Fl===T||(Mt({cell:v,range:{x:D,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),an(D,T))},[rt,Mn,an,Ll,Fl,Mt,Ke]),[Hf,zf]=h.useState(!1),Al=h.useRef(Lc(v=>{zf(v)},5)),$f=h.useCallback(()=>{Al.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&l===void 0&&Mt({cell:[B,Eo],range:{x:B,y:Eo,width:1,height:1}},!0,!1,"keyboard-select")},[Eo,U,l,B,Mt]),Vf=h.useCallback(()=>{Al.current(!1)},[]),[Nf,Bf]=h.useMemo(()=>{let v;const D=(Bt==null?void 0:Bt.scrollbarWidthOverride)??Os(),T=qe+(qt?1:0);if(typeof Zn=="number")v=Tt+T*Zn;else{let $=0;const Y=Math.min(T,10);for(let W=0;W<Y;W++)$+=Zn(W);$=Math.floor($/Y),v=Tt+T*$}v+=D;const V=St.reduce(($,Y)=>Y.width+$,0)+D;return[`${Math.min(1e5,V)}px`,`${Math.min(1e5,v)}px`]},[St,Bt==null?void 0:Bt.scrollbarWidthOverride,Zn,qe,qt,Tt]),Wf=h.useMemo(()=>kp(We),[We]);return h.createElement(od.Provider,{value:We},h.createElement(Lv,{style:Wf,className:de,inWidth:p??Nf,inHeight:b??Bf},h.createElement(mv,{fillHandle:Nt,drawFocusRing:Nr,experimental:Bt,fixedShadowX:fe,fixedShadowY:Ne,getRowThemeOverride:Vn,headerIcons:Kt,imageWindowLoader:En,initialSize:ln,isDraggable:A,onDragLeave:je,onRowMoved:$e,overscrollX:Ba,overscrollY:Wa,preventDiagonalScrolling:xn,rightElement:qn,rightElementProps:_n,smoothScrollX:$n,smoothScrollY:Kn,className:de,enableGroups:kn,onCanvasFocused:$f,onCanvasBlur:Vf,canvasRef:s,onContextMenu:Tf,theme:We,cellXOffset:gf,cellYOffset:Eo,accessibilityHeight:Wr.height,onDragEnd:Mf,columns:St,nonGrowWidth:Jn,drawHeader:at,onColumnProposeMove:F,drawCell:st,disabledRows:Pf,freezeColumns:Ff,lockColumns:B,firstColAccessible:B===0,getCellContent:Fn,minColumnWidth:lr,maxColumnWidth:Br,searchInputRef:a,showSearch:Fi,onSearchClose:Ua,highlightRegions:mf,getCellsForSelection:fn,getGroupDetails:Ga,headerHeight:Li,isFocused:Hf,groupHeaderHeight:kn?Mo:0,freezeTrailingRows:Ft+(qt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:qt,onColumnResize:Ce,onColumnResizeEnd:ue,onColumnResizeStart:Me,onCellFocused:Af,onColumnMoved:xf,onDragStart:kf,onHeaderMenuClick:yf,onHeaderIndicatorClick:Cf,onItemHovered:es,isFilling:(l==null?void 0:l.fillHandle)===!0,onMouseMove:wf,onKeyDown:Ni,onKeyUp:re,onMouseDown:pf,onMouseUp:bf,onDragOverCell:Gt,onDrop:At,onSearchResultsChanged:Of,onVisibleRegionChanged:Sf,clientSize:ht,rowHeight:Zn,searchResults:j,searchValue:k,onSearchValueChange:O,rows:bn,scrollRef:Xt,selection:U,translateX:Wr.tx,translateY:Wr.ty,verticalBorder:_f,gridRef:On,getCellRenderer:Ct,resizeIndicator:Na}),Lf,r!==void 0&&h.createElement(h.Suspense,{fallback:null},h.createElement(Xv,{...r,validateCell:H,bloom:z,id:If,getCellRenderer:Ct,className:(Bt==null?void 0:Bt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:Sn,imageEditorOverride:f,onFinishEditing:Ef,markdownDivCreateNode:m,isOutsideClick:Rr}))))},qv=h.forwardRef(jv),Sd=20;function Mu(e){const{cell:t,posX:n,posY:i,bounds:r,theme:o}=e,{width:a,height:s,x:l,y:u}=r,c=t.maxSize??Sd,d=Math.floor(r.y+s/2),f=Hc(c,s,o.cellVerticalPadding),g=Ac(t.contentAlign??"center",l,a,o.cellHorizontalPadding,f),m=Fc(g,d,f),p=zc(l+n,u+i,m);return Gs(t)&&p}const Kv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>Zv(e,e.cell.data,Gs(e.cell),e.cell.maxSize??Sd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Mu(e)&&e.preventDefault()},onClick:e=>{if(Mu(e))return{...e.cell,data:wd(e.cell.data)}},onPaste:(e,t)=>{let n=ca;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ys),n===t.data?void 0:{...t,data:n}}};function Zv(e,t,n,i,r){if(!n&&t===ca)return;const{ctx:o,hoverAmount:a,theme:s,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:g,y:m,width:p,height:b}=l;let y=!1;if(r>0){let w=n?1-r+r*a:.4;if(t===ca&&(w*=a),w===0)return;w<1&&(y=!0,o.globalAlpha=w)}il(o,s,t,g,m,p,b,u,c,d,i,f),y&&(o.globalAlpha=1)}const Jv=pn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Qv=e=>{const{bubbles:t}=e;return h.createElement(Jv,null,t.map((n,i)=>h.createElement("div",{key:i,className:"boe-bubble"},n)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},e1={getAccessibilityString:e=>$c(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r).width+i+20,0)+2*n.cellHorizontalPadding-4,draw:e=>n1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(Qv,{bubbles:t.data})},onPaste:()=>{}},t1=4;function n1(e,t){const{rect:n,theme:i,ctx:r,highlighted:o}=e,{x:a,y:s,width:l,height:u}=n,c=20,d=8,f=t1;let g=a+i.cellHorizontalPadding;const m=[];for(const p of t){if(g>a+l)break;const b=ii(p,r,i.baseFontFull).width;m.push({x:g,width:b}),g+=b+d*2+f}r.beginPath();for(const p of m)pr(r,p.x,s+(u-c)/2,p.width+d*2,c,i.roundingRadius??c/2);r.fillStyle=o?i.bgBubbleSelected:i.bgBubble,r.fill();for(const[p,b]of m.entries())r.beginPath(),r.fillStyle=i.textBubble,r.fillText(t[p],b.x+d,s+u/2+vr(r,i))}const r1=pn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),i1=e=>{const{drilldowns:t}=e;return h.createElement(r1,null,t.map((n,i)=>h.createElement("div",{key:i,className:"doe-bubble"},n.img!==void 0&&h.createElement("img",{src:n.img}),h.createElement("div",null,n.text))))},o1={getAccessibilityString:e=>$c(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r.text).width+i+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>l1(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(i1,{drilldowns:t.data})},onPaste:()=>{}},a1=4,ms={};function s1(e,t,n,i){const r=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,s=4,l=n*r,u=i+o,c=i*3,d=(c+o*2)*r,f=`${e},${t},${r},${n}`;if(ms[f]!==void 0)return{el:ms[f],height:l,width:d,middleWidth:s*r,sideWidth:u*r,padding:o*r,dpr:r};const g=document.createElement("canvas"),m=g.getContext("2d");return m===null?null:(g.width=d,g.height=l,m.scale(r,r),ms[f]=g,m.beginPath(),pr(m,o,o,c,a,i),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),pr(m,o+.5,o+.5,c,a,i),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:g,height:l,width:d,sideWidth:u*r,middleWidth:i*r,padding:o*r,dpr:r})}function l1(e,t){const{rect:n,theme:i,ctx:r,imageLoader:o,col:a,row:s}=e,{x:l,width:u}=n,c=i.baseFontFull,d=ed(r,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*i.lineHeight)*2)),g=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,b=a1;let y=l+i.cellHorizontalPadding;const w=i.roundingRadius??6,S=s1(i.bgCell,i.drilldownBorder,f,w),M=[];for(const C of t){if(y>l+u)break;const R=ii(C.text,r,c).width;let I=0;C.img!==void 0&&o.loadOrGetImage(C.img,a,s)!==void 0&&(I=m-8+4);const E=R+I+p*2;M.push({x:y,width:E}),y+=E+b}if(S!==null){const{el:C,height:x,middleWidth:R,sideWidth:I,width:E,dpr:L,padding:z}=S,_=I/L,F=z/L;for(const P of M){const ne=Math.floor(P.x),Q=Math.floor(P.width),oe=Q-(_-F)*2;r.imageSmoothingEnabled=!1,r.drawImage(C,0,0,I,x,ne-F,g,_,f),oe>0&&r.drawImage(C,I,0,R,x,ne+(_-F),g,oe,f),r.drawImage(C,E-I,0,I,x,ne+Q-(_-F),g,_,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[C,x]of M.entries()){const R=t[C];let I=x.x+p;if(R.img!==void 0){const E=o.loadOrGetImage(R.img,a,s);if(E!==void 0){const L=m-8;let z=0,_=0,F=E.width,P=E.height;F>P?(z+=(F-P)/2,F=P):P>F&&(_+=(P-F)/2,P=F),r.beginPath(),pr(r,I,g+f/2-L/2,L,L,i.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,z,_,F,P,I,g+f/2-L/2,L,L),r.restore(),I+=L+4}}r.beginPath(),r.fillStyle=i.textBubble,r.fillText(R.text,I,g+f/2+vr(r,i))}}const u1={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>c1(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:i}=e,r=i??Lm;return h.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const i=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(i.length===t.data.length&&i.every((r,o)=>r===t.data[o])))return{...t,data:i}}},ps=4;function c1(e,t,n,i){const{rect:r,col:o,row:a,theme:s,ctx:l,imageLoader:u}=e,{x:c,y:d,height:f,width:g}=r,m=f-s.cellVerticalPadding*2,p=[];let b=0;for(let w=0;w<t.length;w++){const S=t[w];if(S.length===0)continue;const M=u.loadOrGetImage(S,o,a);if(M!==void 0){p[w]=M;const C=M.width*(m/M.height);b+=C+ps}}if(b===0)return;b-=ps;let y=c+s.cellHorizontalPadding;i==="right"?y=Math.floor(c+g-s.cellHorizontalPadding-b):i==="center"&&(y=Math.floor(c+g/2-b/2));for(const w of p){if(w===void 0)continue;const S=w.width*(m/w.height);n>0&&(l.beginPath(),pr(l,y,d+s.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(w,y,d+s.cellVerticalPadding,S,m),n>0&&l.restore(),y+=S+ps}}function d1(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const f1={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:i,ctx:r,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(d1(n,i)*t.skeletonWidthVariability));const l=a.cellHorizontalPadding;s+l*2>=o.width&&(s=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);pr(r,o.x+l,o.y+(o.height-u)/2,s,u,a.roundingRadius??3),r.fillStyle=ti(a.textDark,.1),r.fill()},onPaste:()=>{}},h1=()=>e=>e.targetWidth,Ru=pn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[h1(),"px"]}}),g1=e=>{const{value:t,onChange:n,forceEditMode:i,createNode:r,targetRect:o,onFinish:a,validatedSelection:s}=e,l=t.data,u=t.readonly===!0,[c,d]=h.useState(l===""||i),f=h.useCallback(()=>{d(m=>!m)},[]),g=l?"gdg-ml-6":"";return c?h.createElement(Ru,{targetWidth:o.width-20},h.createElement(Ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),h.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>a(t)},h.createElement(Em,null))):h.createElement(Ru,{targetWidth:o.width},h.createElement(Qm,{contents:l,createNode:r}),!u&&h.createElement(h.Fragment,null,h.createElement("div",{className:"spacer"}),h.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:f},h.createElement(Zs,null))),h.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},m1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:vo,measure:(e,t,n)=>{const i=t.data.split(`
|
175
|
+
`)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>hr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return h.createElement(g1,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},p1={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:v1,measure:()=>44,draw:e=>w1(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function v1(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=b1,n.textAlign="center",o}function b1(e){const{ctx:t}=e;t.textAlign="start"}function w1(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:u}=e,{x:c,y:d,width:f,height:g}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(il(a,u,n,r?c+p:c,d,r?f-p:f,g,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])a.rect(c+b,d+g/2+y,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=u.markerFontFull,y=c+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=u.textLight,a.font=b,a.fillText(p,y,d+g/2+vr(a,b)),l!==0&&(a.globalAlpha=1)}}const y1={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>C1(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function C1(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:u,width:c,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,u+1,c,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let g=0;if(n!==void 0){const p=d-8,b=l+8/2,y=u+8/2;s.drawSprite(n,"normal",i,b,y,p,a,f?1:o),g=p}else{g=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,y=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+y+b,u+d/2),i.lineTo(l+y+b+p,u+d/2),i.moveTo(l+y+b+p*.5,u+d/2-p*.5),i.lineTo(l+y+b+p*.5,u+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,g+l+a.cellHorizontalPadding+.5,u+d/2+vr(i,a)),i.beginPath()}function xd(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=S1(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),pr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ti(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function S1(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ii(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,u=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:s.width+o*3,height:u-1}}const x1=h.lazy(async()=>await Ws(()=>import("./number-overlay-editor.DSD8puEB.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),k1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:vo,draw:e=>{const{hoverAmount:t,cell:n,ctx:i,theme:r,rect:o,overrideCursor:a}=e,{hoverEffect:s,displayData:l,hoverEffectTheme:u}=n;s===!0&&t>0&&xd(i,r,u,l,o,t,a),hr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return h.createElement(h.Suspense,{fallback:null},h.createElement(x1,{highlight:t,disabled:i.readonly===!0,value:i.data,fixedDecimals:i.fixedDecimals,allowNegative:i.allowNegative,thousandSeparator:i.thousandSeparator,decimalSeparator:i.decimalSeparator,validatedSelection:r,onChange:o=>n({...i,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const i=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(i)||t.data===i))return{...t,data:i,displayData:n.formattedString??t.displayData}}},M1={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:R1,onPaste:()=>{}};function R1(e){const{ctx:t,theme:n,rect:i}=e,{x:r,y:o,height:a}=i;t.beginPath();const s=2.5;let l=r+n.cellHorizontalPadding+s;const u=o+a/2,c=Math.cos(Jl(30))*s,d=Math.sin(Jl(30))*s;for(let f=0;f<12;f++)t.moveTo(l,u-s),t.lineTo(l,u+s),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const E1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>vo(e,t,e.theme.textLight),draw:e=>hr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return te.createElement(Ei,{highlight:t,autoFocus:i.readonly!==!0,disabled:i.readonly!==!1,value:i.data,validatedSelection:r,onChange:o=>n({...i,data:o.target.value})})},onPaste:()=>{}},I1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:vo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:i,ctx:r,rect:o,theme:a,overrideCursor:s}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&xd(r,a,f,l,o,n,s),hr(e,l,u,d,i)},measure:(e,t,n)=>{const i=t.displayData.split(`
|
176
|
+
`,t.allowWrapping===!0?void 0:1);let r=0;for(const o of i)r=Math.max(r,e.measureText(o).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:i,value:r,validatedSelection:o}=t;return h.createElement(Ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:o,onChange:a=>i({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},T1=pn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),D1=e=>{const{uri:t,onChange:n,forceEditMode:i,readonly:r,validatedSelection:o,preview:a}=e,[s,l]=h.useState(!r&&(t===""||i)),u=h.useCallback(()=>{l(!0)},[]);return s?h.createElement(Ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):h.createElement(T1,null,h.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&h.createElement("div",{className:"gdg-edit-icon",onClick:u},h.createElement(Zs,null)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function kd(e,t,n,i){let r=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return i==="right"?r=t.width-a-n.cellHorizontalPadding:i==="center"&&(r=t.width/2-a/2),{x:r,y:o,width:a,height:s}}function Eu(e){const{cell:t,bounds:n,posX:i,posY:r,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Zc(a,o.baseFontFull);if(s===void 0)return!1;const l=kd(s,n,o,t.contentAlign);return ei({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},i,r)}const O1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:vo,draw:e=>{const{cell:t,theme:n,overrideCursor:i,hoverX:r,hoverY:o,rect:a,ctx:s}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(i!==void 0&&u&&r!==void 0&&o!==void 0){const c=ii(l,s,n.baseFontFull),d=kd(c,a,n,t.contentAlign),{x:f,y:g,width:m,height:p}=d;if(r>=f-4&&r<=f-4+m+8&&o>=g-4&&o<=g-4+p+8){const b=vr(s,n.baseFontFull);i("pointer");const y=5,w=g-b;s.beginPath(),s.moveTo(a.x+f,Math.floor(a.y+w+p+y)+.5),s.lineTo(a.x+f+m,Math.floor(a.y+w+p+y)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,hr({...e,rect:{...a,x:a.x-1}},l,t.contentAlign),hr({...e,rect:{...a,x:a.x-2}},l,t.contentAlign),hr({...e,rect:{...a,x:a.x+1}},l,t.contentAlign),hr({...e,rect:{...a,x:a.x+2}},l,t.contentAlign),s.restore()}}s.fillStyle=u?n.linkColor:n.textDark,hr(e,l,t.contentAlign)},onSelect:e=>{Eu(e)&&e.preventDefault()},onClick:e=>{var i;const{cell:t}=e;Eu(e)&&((i=t.onClickUri)==null||i.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:i,forceEditMode:r,validatedSelection:o}=t;return h.createElement(D1,{forceEditMode:i.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:i.data,preview:i.displayData??i.data,validatedSelection:o,readonly:i.readonly===!0,onChange:a=>n({...i,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},P1=[p1,y1,Kv,e1,o1,u1,f1,m1,k1,M1,E1,I1,O1];var _1=_c,L1=fc,F1="Expected a function";function A1(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(F1);return L1(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),_1(e,t,{leading:i,maxWait:t,trailing:r})}var H1=A1;const z1=Mi(H1),vs=[];class $1 extends nd{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",z1(()=>{this.imageLoaded(new io(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const i of n){const r=this.cache[i];let o=!1;for(let a=0;a<r.cells.length;a++){const s=r.cells[a];if(this.isInWindow(s)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[i])}})}setCallback(n){this.imageLoaded=n}loadImage(n,i,r,o){let a=!1;const s=vs.pop()??new Image;let l=!1;const u={img:void 0,cells:[ar(i,r)],url:n,cancel:()=>{l||(l=!0,vs.length<12?vs.unshift(s):a||(s.src=""))}},c=new Promise(d=>s.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{s.src=n,await c,await s.decode();const d=this.cache[o];if(d!==void 0&&!l){d.img=s;for(const f of d.cells)this.loadedLocations.push(rl(f));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,i,r){const o=n,a=this.cache[o];if(a!==void 0){const s=ar(i,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,i,r,o)}}const V1=(e,t)=>{const n=h.useMemo(()=>({...E0,...e.headerIcons}),[e.headerIcons]),i=h.useMemo(()=>e.imageWindowLoader??new $1,[e.imageWindowLoader]);return h.createElement(qv,{...e,renderers:P1,headerIcons:n,ref:t,imageWindowLoader:i})},N1=h.forwardRef(V1);function Iu(e,t){const n=h.useRef(null),i=h.useRef(),r=h.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return h.useEffect(()=>r,[r]),{debouncedCallback:h.useCallback((...a)=>{i.current=a,r(),n.current=setTimeout(()=>{i.current&&(e(...i.current),i.current=void 0)},t)},[e,t,r]),cancel:r}}const Tu=fo("div",{target:"eau1w2s0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}})),B1=fo("div",{target:"eau1w2s1"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Zo=fo("div",{target:"eau1w2s2"})(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer","&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth})),W1=fo("div",{target:"eau1w2s3"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs}));function U1({top:e,left:t,isColumnPinned:n,onPinColumn:i,onUnpinColumn:r,onCloseMenu:o,onSortColumn:a}){const s=Da(),{colors:l,fontSizes:u,radii:c,fontWeights:d}=s;h.useEffect(()=>{function g(p){p.preventDefault()}const m=()=>{document.removeEventListener("wheel",g),document.removeEventListener("touchmove",g)};return document.addEventListener("wheel",g,{passive:!1}),document.addEventListener("touchmove",g,{passive:!1}),()=>{m()}},[]);const f=te.useCallback(()=>{o()},[o]);return Jt(bc,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Hr(B1,{children:[a&&Hr(nh,{children:[Hr(Zo,{onClick:()=>{a("asc"),f()},role:"menuitem",children:[Jt(Vo,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Hr(Zo,{onClick:()=>{a("desc"),f()},role:"menuitem",children:[Jt(Vo,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Jt(W1,{})]}),n&&Hr(Zo,{onClick:()=>{r(),f()},children:[Jt(Vo,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Hr(Zo,{onClick:()=>{i(),f()},children:[Jt(Vo,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]})]}),placement:mc.bottomRight,accessibilityType:pc.menu,showArrow:!1,popoverMargin:or("0.375rem"),onClickOutside:f,onEsc:f,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`,backgroundColor:vc(s)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:d.normal,borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Jt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const X1=h.memo(U1);var Y1={exports:{}};/*! Moment Duration Format v2.2.2
|
177
177
|
* https://github.com/jsmreese/moment-duration-format
|
178
178
|
* Date: 2018-02-16
|
179
179
|
*
|
@@ -188,10 +188,10 @@ Error: ${C.toString()}`);if(s.timezone){try{C=Ou(C,s.timezone)}catch(x){return V
|
|
188
188
|
Error: ${x}`)}M=C.utcOffset()}try{S=Du(C,s.format||n)}catch(x){return Vt(C.toISOString(),`Failed to format the date for rendering with: ${s.format}.
|
189
189
|
Error: ${x}`)}w=Du(C,n)}return{...d,copyData:w,isMissingValue:Qe(y),data:{...d.data,date:y,displayDate:S,timezoneOffset:M}}},getCellValue(p){var b;return Qe((b=p==null?void 0:p.data)==null?void 0:b.date)?null:o(p.data.date)}}}function cl(e){var r,o,a;let t="YYYY-MM-DD HH:mm:ss";((r=e.columnTypeOptions)==null?void 0:r.step)>=60?t="YYYY-MM-DD HH:mm":((o=e.columnTypeOptions)==null?void 0:o.step)<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=oh(e.arrowType),i=xt(n)||xt((a=e==null?void 0:e.columnTypeOptions)==null?void 0:a.timezone);return ul("datetime",e,i?t+"Z":t,1,"datetime-local",s=>i?s.toISOString():s.toISOString().replace("Z",""),n)}cl.isEditableType=!0;function dl(e){var n,i;let t="HH:mm:ss";return((n=e.columnTypeOptions)==null?void 0:n.step)>=60?t="HH:mm":((i=e.columnTypeOptions)==null?void 0:i.step)<1&&(t="HH:mm:ss.SSS"),ul("time",e,t,1,"time",r=>r.toISOString().split("T")[1].replace("Z",""))}dl.isEditableType=!0;function fl(e){return ul("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}fl.isEditableType=!0;function Od(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const i=xt(n)?[Et(n)]:[];return{...t,data:i,isMissingValue:!xt(n),displayData:i}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}Od.isEditableType=!1;function Pd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.
|
190
190
|
Error: ${a}`}let i;if(!Qe(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch{i=void 0}const r={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},o=a=>{if(Qe(a))return!e.isRequired;const s=Et(a);return!(t.max_chars&&s.length>t.max_chars||n instanceof RegExp&&n.test(s)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:o,getCell(a,s){if(Qe(a))return{...r,data:null,isMissingValue:!0,onClickUri:()=>{}};const l=a;if(typeof n=="string")return Vt(Et(l),n);if(s&&o(l)===!1)return Vt(Et(l),"Invalid input.");let u="";return l&&(i!==void 0?u=eb(i,l):u=t.display_text||l),{...r,data:l,displayData:u,isMissingValue:Qe(l),onClickUri:c=>{window.open(l.startsWith("www.")?`https://${l}`:l,"_blank","noopener,noreferrer"),c.preventDefault()},copyData:l}},getCellValue(a){return Qe(a.data)?null:a.data}}}Pd.isEditableType=!0;function hl(e){const t={kind:Z.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const i=Qe(n)?[]:Md(n);return{...t,data:i,isMissingValue:Qe(n),copyData:Qe(n)?"":Et(i.map(r=>typeof r=="string"&&r.includes(",")?r.replace(/,/g," "):r))}},getCellValue(n){return Qe(n.data)||Aa(n)?null:n.data}}}hl.isEditableType=!1;function gl(e){const t=bo({step:yc(e.arrowType)?1:void 0,min_value:ah(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(sh(e.arrowType)||lh(e.arrowType)),i=Qe(t.min_value)||t.min_value<0,r=xt(t.step)&&!Number.isNaN(t.step)?Ed(t.step):void 0,o={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:i,fixedDecimals:r,thousandSeparator:""},a=s=>{let l=uo(s);if(Qe(l))return!e.isRequired;if(Number.isNaN(l))return!1;let u=!1;return xt(t.max_value)&&l>t.max_value&&(l=t.max_value,u=!0),xt(t.min_value)&&l<t.min_value?!1:u?l:!0};return{...e,kind:"number",sortMode:"smart",validateInput:a,getCell(s,l){if(l===!0){const d=a(s);if(d===!1)return Vt(Et(s),"Invalid input.");typeof d=="number"&&(s=d)}let u=uo(s),c="";if(xt(u)){if(Number.isNaN(u))return Vt(Et(s),"The value cannot be interpreted as a number.");if(xt(r)&&(u=J1(u,r)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Vt(Et(s),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Rs(u,e.arrowType):c=Sa(u,t.format,r)}catch(d){return Vt(Et(u),xt(t.format)?`Failed to format the number based on the provided format configuration: (${t.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}}return{...o,data:u,displayData:c,isMissingValue:Qe(u),copyData:Qe(u)?"":Et(u)}},getCellValue(s){return s.data===void 0?null:s.data}}}gl.isEditableType=!0;function co(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const i=xt(n)?Et(n):null,r=xt(i)?xa(i):"";return{...t,data:i,displayData:r,isMissingValue:Qe(n)}}catch(i){return Vt(Et(n),`The value cannot be interpreted as a string. Error: ${i}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}co.isEditableType=!1;function _d(e){const t=yc(e.arrowType),n=bo({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=Sa(n.max_value,n.format)}catch{i=Et(n.max_value)}const r=Qe(n.step)||Number.isNaN(n.step)?void 0:Ed(n.step),o={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(a){if(Qe(a))return Hs();if(Qe(n.min_value)||Qe(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Vt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(Qe(n.step)||Number.isNaN(n.step))return Vt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const s=uo(a);if(Number.isNaN(s)||Qe(s))return Vt(Et(a),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return Vt(Et(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let l="";try{l=Sa(s,n.format,r)}catch(c){return Vt(Et(s),xt(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${c}`:`Failed to format the number. Error: ${c}`)}const u=Math.min(n.max_value,Math.max(n.min_value,s));return{...o,isMissingValue:Qe(a),copyData:String(s),data:{...o.data,value:u,label:l}}},getCellValue(a){var s,l;return a.kind===Z.Loading||((s=a.data)==null?void 0:s.value)===void 0?null:(l=a.data)==null?void 0:l.value}}}_d.isEditableType=!1;function ml(e){let t="string";const n=bo({options:Cc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),i=new Set(n.options.map(o=>typeof o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const r={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...n.options.filter(o=>o!==null&&o!=="").map(o=>Et(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,a){let s=null;return xt(o)&&o!==""&&(s=Et(o)),a&&!r.data.allowedValues.includes(s)?Vt(Et(s),"The value is not part of the allowed options."):{...r,isMissingValue:s===null,copyData:s||"",data:{...r.data,value:s}}},getCellValue(o){var a,s,l,u,c;return Qe((a=o.data)==null?void 0:a.value)||((s=o.data)==null?void 0:s.value)===""?null:t==="number"?uo((l=o.data)==null?void 0:l.value)??null:t==="boolean"?Rd((u=o.data)==null?void 0:u.value)??null:(c=o.data)==null?void 0:c.value}}}ml.isEditableType=!0;function pl(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
|
191
|
-
Error: ${o}`}const i={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=o=>{if(Qe(o))return!e.isRequired;let a=Et(o),s=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(a)===!1?!1:s?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(o,a){if(typeof n=="string")return Vt(Et(o),n);if(a){const s=r(o);if(s===!1)return Vt(Et(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=xt(o)?Et(o):null,l=xt(s)?xa(s):"";return{...i,isMissingValue:Qe(s),data:s,displayData:l}}catch(s){return Vt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}pl.isEditableType=!0;const Pu=fo("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),ib=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Jt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Jt(Pu,{src:t})}):Jt(Pu,{src:t})},_u=new Map(Object.entries({object:co,text:pl,checkbox:ll,selectbox:ml,list:hl,number:gl,link:Pd,datetime:cl,date:fl,time:dl,line_chart:Id,bar_chart:Td,area_chart:Dd,image:Od,progress:_d})),ob=[];var ab=uh,sb=ch,lb=dh,ub=fh,cb=hh,db=gh,fb=mh,hb=ph,gb="[object Map]",mb="[object Set]",pb=Object.prototype,vb=pb.hasOwnProperty;function bb(e){if(e==null)return!0;if(cb(e)&&(ub(e)||typeof e=="string"||typeof e.splice=="function"||db(e)||hb(e)||lb(e)))return!e.length;var t=sb(e);if(t==gb||t==mb)return!e.size;if(fb(e))return!ab(e).length;for(var n in e)if(vb.call(e,n))return!1;return!0}var wb=bb;const yb=Mi(wb);function Lu(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=i.exec(n);if(r)return r[1].trim()}function Cb(e,t,n){const i={},r=Lu(t,"color",n);r&&(i.textDark=r);const o=Lu(t,"background-color",n);return o&&(i.bgCell=o),o==="yellow"&&r===void 0&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}function Sb(e){return Sh(e)||xh(e)?pl:kh(e)?cl:Sc(e)?dl:Mh(e)?fl:Rh(e)||Eh(e)?co:Cc(e)?ll:Ih(e)?gl:Th(e)?ml:Dh(e)?hl:co}function Ld(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(i=>i!=="").join(" / "):void 0;return{title:t,group:n}}function vl(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function xb(e,t){const n=e.columnNames.map(s=>s[t]),{title:i,group:r}=Ld(n),o=e.columnTypes[t];let a=!0;return Oh(o)&&(a=!1),vl({id:`_index-${t}`,indexNumber:t,name:i,title:i,group:r,isEditable:a,arrowType:o,isIndex:!0,isPinned:!0})}function kb(e,t){const n=e.columnNames.map(a=>a[t]),{title:i,group:r}=Ld(n),o=e.columnTypes[t];return vl({id:`_column-${i}-${t}`,indexNumber:t,name:i,isEditable:!0,title:i,arrowType:o,group:r})}function Fd(){return vl({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:vh.INDEX,arrowField:new bh("",new wh,!0),pandasType:void 0}})}function Mb(e){const t=[],{dimensions:n}=e,i=n.numIndexColumns,r=n.numDataColumns;if(i===0&&r===0)return t.push(Fd()),t;for(let o=0;o<i;o++)t.push(xb(e,o));for(let o=0;o<r;o++)t.push(kb(e,o+i));return t}function Rb(e,t,n,i=void 0){var o,a,s,l,u,c;let r;if(e.kind==="object")r=e.getCell(xt(t.content)?xa(Rs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&xt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;Sc(e.arrowType)&&xt((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?d=yh(t.content,t.field):d=Zr.utc(Number(t.content)).toDate(),r=e.getCell(d)}else if(Ch(e.arrowType)){const d=Qe(t.content)?null:Rs(t.content,t.contentType);r=e.getCell(d)}else r=e.getCell(t.content);if(Si(r))return r;if(!e.isEditable){if(n&&xt(n==null?void 0:n.displayContent)){const d=xa(n.displayContent);r.kind===Z.Text?r={...r,displayData:d}:r.kind===Z.Number&&Qe((s=e.columnTypeOptions)==null?void 0:s.format)?r={...r,displayData:d}:r.kind===Z.Uri&&Qe((l=e.columnTypeOptions)==null?void 0:l.display_text)?r={...r,displayData:d}:r.kind===Z.Custom&&((u=r.data)==null?void 0:u.kind)==="date-picker-cell"&&Qe((c=e.columnTypeOptions)==null?void 0:c.format)&&(r={...r,data:{...r.data,displayDate:d}})}i&&(n!=null&&n.cssId)&&(r=Cb(r,n.cssId,i))}return r}const la="_index",Fu="_pos:",Au={small:75,medium:200,large:400},Ad=Us.getLogger("useColumnLoader");function Eb(e){if(!Qe(e)){if(typeof e=="number")return e;if(e in Au)return Au[e]}}const Qo=(e,t)=>Jh(e,t,(i,r)=>{if(Ph(r))return r});function Ib(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(la)&&(n=Qo(n,t.get(la)??{})),t.has(`${Fu}${e.indexNumber}`)&&(n=Qo(n,t.get(`${Fu}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==la&&(n=Qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Qo(n,t.get(e.id)??{})),yb(n)?e:wc({...e},{title:n.label,width:Eb(n.width),isEditable:xt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function Tb(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Ad.error(t),new Map}}function Db(e){var i;const t=(i=e.columnTypeOptions)==null?void 0:i.type;let n;return xt(t)&&(_u.has(t)?n=_u.get(t):Ad.warn(`Unknown column type configured in column configuration: ${t}`)),Qe(n)&&(n=Sb(e.arrowType)),n}function Ob(e,t,n,i){const r=Da(),o=te.useMemo(()=>Tb(e.columns),[e.columns]),[a,s]=te.useState(o);te.useEffect(()=>{s(o)},[o]);const l=e.useContainerWidth||xt(e.width)&&e.width>0;return{columns:te.useMemo(()=>{const c=Mb(t).map(m=>{let p={...m,...Ib(m,a),isStretched:l};const b=Db(p);return(e.editingMode===Yn.EditingMode.READ_ONLY||n||b.isEditableType===!1)&&(p={...p,isEditable:!1}),e.editingMode!==Yn.EditingMode.READ_ONLY&&p.isEditable==!0&&(p={...p,icon:"editable"},p.isRequired&&e.editingMode===Yn.EditingMode.DYNAMIC&&(p={...p,isHidden:!1})),b(p,r)}).filter(m=>!m.isHidden),d=[],f=[];i!=null&&i.length?(c.forEach(m=>{m.isIndex&&!i.includes(m.name)&&!i.includes(m.id)&&m.isPinned!==!1&&d.push(m)}),i.forEach(m=>{const p=c.find(b=>b.name===m||b.id===m);p&&(p.isPinned?d.push(p):f.push(p))})):c.forEach(m=>{m.isPinned?d.push(m):f.push(m)});const g=[...d,...f];return g.length>0?g:[co(Fd())]},[t,a,l,n,e.editingMode,i,r]),setColumnConfigMapping:s}}function oo(e){return e.isIndex?la:Qe(e.name)?"":e.name}class ea{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const i={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,s)=>{const l={};o.forEach((u,c,d)=>{const f=n.get(c);f&&(l[oo(f)]=f.getCellValue(u))}),i.edited_rows[a]=l}),this.addedRows.forEach(o=>{const a={};let s=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const f=d.getCellValue(l);d.isRequired&&d.isEditable&&Aa(l)&&(s=!0),xt(f)&&(a[oo(d)]=f)}}),s||i.added_rows.push(a)}),i.deleted_rows=this.deletedRows,JSON.stringify(i,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const i=JSON.parse(t),r=new Map;n.forEach(a=>{r.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(oo(a),a)}),Object.keys(i.edited_rows).forEach(a=>{const s=Number(a),l=i.edited_rows[a];Object.keys(l).forEach(u=>{var f;const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(f=this.editedCells.get(s))==null||f.set(d.indexNumber,g))}})}),i.added_rows.forEach(a=>{const s=new Map;n.forEach(l=>{s.set(l.indexNumber,l.getCell(null))}),Object.keys(a).forEach(l=>{const u=a[l],c=o.get(l);if(c){const d=c.getCell(u);d&&s.set(c.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=i.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const i=this.editedCells.get(n);if(i!==void 0)return i.get(t)}setCell(t,n,i){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,i)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,i)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,i)=>i-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Qe(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,i)=>n-i)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let i=0;i<this.deletedRows.length&&!(this.deletedRows[i]>n);i++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}function Pb(e,t,n,i,r,o){const a=te.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??i*2),0)>n*.6,[e,n,i]),s=t||a?0:e.filter(c=>c.isPinned).length,l=te.useCallback(c=>{o(d=>{const f=new Map(d),g=f.get(c);return f.set(c,{...g||{},pinned:!1}),f}),r(!0,!1)},[r,o]);return{pinColumn:te.useCallback(c=>{o(d=>{const f=new Map(d),g=f.get(c);return f.set(c,{...g||{},pinned:!0}),f}),r(!0,!1)},[r,o]),unpinColumn:l,freezeColumns:s}}function _b(e,t,n,i,r){return{onColumnMoved:te.useCallback((a,s)=>{const l=[...e],[u]=l.splice(a,1);l.splice(s,0,u),s<t&&!u.isPinned?n(u.id):s>=t&&u.isPinned&&i(u.id),r(l.map(c=>c.id))},[e,t,n,i,r])}}function Lb(e){const[t,n]=h.useState(()=>new Map),i=te.useCallback((o,a,s,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:te.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:i}}function Fb(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(i=>i.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Hu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function Ab(e,t){return e=Hu(e),t=Hu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function Hb(e,t){return e>t?1:e===t?0:-1}function zb(e){const{sort:t,rows:n,getCellContent:i}=e;let r=t===void 0?void 0:e.columns.findIndex(u=>t.column===u||u.id!==void 0&&t.column.id===u.id);r===-1&&(r=void 0);const o=(t==null?void 0:t.direction)??"asc",a=h.useMemo(()=>{if(r===void 0)return;const u=new Array(n),c=[r,0];for(let f=0;f<n;f++)c[1]=f,u[f]=Fb(i(c));let d;return(t==null?void 0:t.mode)==="raw"?d=dr(n).sort((f,g)=>Hb(u[f],u[g])):(t==null?void 0:t.mode)==="smart"?d=dr(n).sort((f,g)=>Ab(u[f],u[g])):d=dr(n).sort((f,g)=>u[f].localeCompare(u[g])),o==="desc"&&d.reverse(),d},[i,n,t==null?void 0:t.mode,o,r]),s=h.useCallback(u=>a===void 0?u:a[u],[a]),l=h.useCallback(([u,c])=>a===void 0?i([u,c]):(c=a[c],i([u,c])),[i,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:l}}function $b(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function Vb(e,t,n){const[i,r]=te.useState(),{getCellContent:o,getOriginalIndex:a}=zb({columns:t.map(u=>zs(u)),getCellContent:n,rows:e,sort:i}),s=te.useMemo(()=>$b(t,i),[t,i]),l=te.useCallback((u,c,d)=>{const f=s[u];let g;c==="auto"?(g="asc",i&&i.column.id===f.id&&(i.direction==="asc"?g="desc":g=void 0)):g=c,g===void 0||d&&g===(i==null?void 0:i.direction)?r(void 0):r({column:zs(f),direction:g,mode:f.sortMode})},[i,s]);return{columns:s,sortColumn:l,getOriginalIndex:a,getCellContent:o}}const Nb={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:i,rect:r,hoverAmount:o,hoverX:a}=e;let{values:s,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:f}=t.data;const[g,m]=l;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-g)/(m-g))));const p=i.cellHorizontalPadding,b=p+r.x,y=r.y+3,w=r.height-6,S=r.width-p*2,M=m-g,C=m<=0?y:g>=0?y+w:y+w*(m/M);if(!f&&g<=0&&m>=0&&(n.beginPath(),n.moveTo(b,C),n.lineTo(b+S,C),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const x=2,R=(s.length-1)*x,I=(S-R)/s.length;let E=b;for(const L of s){const z=y+w-L*w;n.moveTo(E,C),n.lineTo(E+I,C),n.lineTo(E+I,z),n.lineTo(E,z),E+=I+x}n.fillStyle=t.data.color??i.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),R=s.map((E,L)=>({x:b+x*L,y:y+w-E*w}));n.moveTo(R[0].x,R[0].y);let I=0;if(R.length>2)for(I=1;I<R.length-2;I++){const E=(R[I].x+R[I+1].x)/2,L=(R[I].y+R[I+1].y)/2;n.quadraticCurveTo(R[I].x,R[I].y,E,L)}if(n.quadraticCurveTo(R[I].x,R[I].y,R[I+1].x,R[I+1].y),n.strokeStyle=u??i.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(r.x+r.width-p,C),n.lineTo(r.x+p,C),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const E=n.createLinearGradient(0,y,0,y+w*1.4);E.addColorStop(0,u??i.accentColor);const[L,z,_]=va(u??i.accentColor);E.addColorStop(1,`rgba(${L}, ${z}, ${_}, 0)`),n.fillStyle=E,n.fill(),n.globalAlpha=1}if(a!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const E=Math.min(s.length-1,Math.max(0,Math.round((a-p)/x)));n.moveTo(b+E*x,r.y+1),n.lineTo(b+E*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.save(),n.font=`8px ${i.fontFamily}`,n.fillStyle=i.textMedium,n.textBaseline="top",n.fillText(d[E],b,r.y+i.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function zu(e,t,n,i,r,o){if(!(i<=0||r<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,i,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,i/2),tr:Math.min(o.tr,r/2,i/2),bl:Math.min(o.bl,r/2,i/2),br:Math.min(o.br,r/2,i/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function $u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$u(Object(n),!0).forEach(function(i){qi(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$u(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Mr(e,t){if(e==null)return{};var n,i,r=_h(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Wb(e){var t=e.defaultInputValue,n=t===void 0?"":t,i=e.defaultMenuIsOpen,r=i===void 0?!1:i,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=Mr(e,Bb),p=h.useState(s!==void 0?s:n),b=Sr(p,2),y=b[0],w=b[1],S=h.useState(l!==void 0?l:r),M=Sr(S,2),C=M[0],x=M[1],R=h.useState(g!==void 0?g:a),I=Sr(R,2),E=I[0],L=I[1],z=h.useCallback(function(de,xe){typeof u=="function"&&u(de,xe),L(de)},[u]),_=h.useCallback(function(de,xe){var ae;typeof c=="function"&&(ae=c(de,xe)),w(ae!==void 0?ae:de)},[c]),F=h.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),P=h.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),ne=s!==void 0?s:y,Q=l!==void 0?l:C,oe=g!==void 0?g:E;return Xe(Xe({},m),{},{inputValue:ne,menuIsOpen:Q,onChange:z,onInputChange:_,onMenuClose:P,onMenuOpen:F,value:oe})}function Ub(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Xb=Math.min,Yb=Math.max,ka=Math.round,ta=Math.floor,Ma=e=>({x:e,y:e});function Gb(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function Ha(){return typeof window<"u"}function Hd(e){return $d(e)?(e.nodeName||"").toLowerCase():"#document"}function kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zd(e){var t;return(t=($d(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $d(e){return Ha()?e instanceof Node||e instanceof kr(e).Node:!1}function jb(e){return Ha()?e instanceof Element||e instanceof kr(e).Element:!1}function bl(e){return Ha()?e instanceof HTMLElement||e instanceof kr(e).HTMLElement:!1}function Vu(e){return!Ha()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kr(e).ShadowRoot}function Vd(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=wl(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function qb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Kb(e){return["html","body","#document"].includes(Hd(e))}function wl(e){return kr(e).getComputedStyle(e)}function Zb(e){if(Hd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vu(e)&&e.host||zd(e);return Vu(t)?t.host:t}function Nd(e){const t=Zb(e);return Kb(t)?e.ownerDocument?e.ownerDocument.body:e.body:bl(t)&&Vd(t)?t:Nd(t)}function Ra(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Nd(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=kr(r);if(o){const s=$s(a);return t.concat(a,a.visualViewport||[],Vd(r)?r:[],s&&n?Ra(s):[])}return t.concat(r,Ra(r,[],n))}function $s(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jb(e){const t=wl(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=bl(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=ka(n)!==o||ka(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function yl(e){return jb(e)?e:e.contextElement}function Nu(e){const t=yl(e);if(!bl(t))return Ma(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Jb(t);let a=(o?ka(n.width):n.width)/i,s=(o?ka(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Qb=Ma(0);function ew(e){const t=kr(e);return!qb()||!t.visualViewport?Qb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tw(e,t,n){return!1}function Bu(e,t,n,i){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),o=yl(e);let a=Ma(1);t&&(a=Nu(e));const s=tw()?ew(o):Ma(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,c=r.width/a.x,d=r.height/a.y;if(o){const f=kr(o),g=i;let m=f,p=$s(m);for(;p&&i&&g!==m;){const b=Nu(p),y=p.getBoundingClientRect(),w=wl(p),S=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*b.x,M=y.top+(p.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=S,u+=M,m=kr(p),p=$s(m)}}return Gb({width:c,height:d,x:l,y:u})}function nw(e,t){let n=null,i;const r=zd(e);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const g=ta(c),m=ta(r.clientWidth-(u+d)),p=ta(r.clientHeight-(c+f)),b=ta(u),w={rootMargin:-g+"px "+-m+"px "+-p+"px "+-b+"px",threshold:Yb(0,Xb(1,l))||1};let S=!0;function M(C){const x=C[0].intersectionRatio;if(x!==l){if(!S)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(M,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,w)}n.observe(e)}return a(!0),o}function rw(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=yl(e),c=r||o?[...u?Ra(u):[],...Ra(t)]:[];c.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=u&&s?nw(u,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let m,p=l?Bu(e):null;l&&b();function b(){const y=Bu(e);p&&(y.x!==p.x||y.y!==p.y||y.width!==p.width||y.height!==p.height)&&n(),p=y,m=requestAnimationFrame(b)}return n(),()=>{var y;c.forEach(w=>{r&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Vs=h.useLayoutEffect,iw=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ea=function(){};function ow(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function aw(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=[].concat(i);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(ow(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Wu=function(t){return mw(t)?t.filter(Boolean):Fh(t)==="object"&&t!==null?[t]:[]},Bd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Mr(t,iw);return Xe({},n)},nn=function(t,n,i){var r=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:r(i??{},a(n,t),s)}};function za(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function sw(e){return za(e)?window.innerHeight:e.clientHeight}function Wd(e){return za(e)?window.pageYOffset:e.scrollTop}function Ia(e,t){if(za(e)){window.scrollTo(0,t);return}e.scrollTop=t}function lw(e){var t=getComputedStyle(e),n=t.position==="absolute",i=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&i.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function uw(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function na(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ea,r=Wd(e),o=t-r,a=10,s=0;function l(){s+=a;var u=uw(s,r,o,n);Ia(e,u),s<n?window.requestAnimationFrame(l):i(e)}l()}function Uu(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.offsetHeight/3;i.bottom+r>n.bottom?Ia(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r<n.top&&Ia(e,Math.max(t.offsetTop-r,0))}function cw(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Xu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function dw(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ud=!1,fw={get passive(){return Ud=!0}},ra=typeof window<"u"?window:{};ra.addEventListener&&ra.removeEventListener&&(ra.addEventListener("p",Ea,fw),ra.removeEventListener("p",Ea,!1));var hw=Ud;function gw(e){return e!=null}function mw(e){return Array.isArray(e)}function ia(e,t,n){return e?t:n}var pw=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var s=Sr(a,1),l=s[0];return!i.includes(l)});return o.reduce(function(a,s){var l=Sr(s,2),u=l[0],c=l[1];return a[u]=c,a},{})},vw=["children","innerProps"],bw=["children","innerProps"];function ww(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=lw(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,w=a?window.innerHeight:sw(l),S=Wd(l),M=parseInt(getComputedStyle(n).marginBottom,10),C=parseInt(getComputedStyle(n).marginTop,10),x=y-C,R=w-p,I=x+S,E=d-S-p,L=g-w+S+M,z=S+p-C,_=160;switch(r){case"auto":case"bottom":if(R>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&na(l,L,_),{placement:"bottom",maxHeight:t};if(!a&&E>=i||a&&R>=i){o&&na(l,L,_);var F=a?R-M:E-M;return{placement:"bottom",maxHeight:F}}if(r==="auto"||a){var P=t,ne=a?x:I;return ne>=i&&(P=Math.min(ne-M-s,t)),{placement:"top",maxHeight:P}}if(r==="bottom")return o&&Ia(l,L),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!a)return o&&na(l,z,_),{placement:"top",maxHeight:t};if(!a&&I>=i||a&&x>=i){var Q=t;return(!a&&I>=i||a&&x>=i)&&(Q=a?x-C:I-C),o&&na(l,z,_),{placement:"top",maxHeight:Q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function yw(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Xd=function(t){return t==="auto"?"bottom":t},Cw=function(t,n){var i,r=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return Xe((i={label:"menu"},qi(i,yw(r),"100%"),qi(i,"position","absolute"),qi(i,"width","100%"),qi(i,"zIndex",1),i),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Yd=h.createContext(null),Sw=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,u=h.useContext(Yd)||{},c=u.setPortalPlacement,d=h.useRef(null),f=h.useState(r),g=Sr(f,2),m=g[0],p=g[1],b=h.useState(null),y=Sr(b,2),w=y[0],S=y[1],M=l.spacing.controlHeight;return Vs(function(){var C=d.current;if(C){var x=a==="fixed",R=s&&!x,I=ww({maxHeight:r,menuEl:C,minHeight:i,placement:o,shouldScroll:R,isFixedPosition:x,controlHeight:M});p(I.maxHeight),S(I.placement),c==null||c(I.placement)}},[r,o,a,s,i,c,M]),n({ref:d,placerProps:Xe(Xe({},t),{},{placement:w||Xd(o),maxHeight:m})})},xw=function(t){var n=t.children,i=t.innerRef,r=t.innerProps;return Be("div",Je({},nn(t,"menu",{menu:!0}),{ref:i},r),n)},kw=xw,Mw=function(t,n){var i=t.maxHeight,r=t.theme.spacing.baseUnit;return Xe({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Rw=function(t){var n=t.children,i=t.innerProps,r=t.innerRef,o=t.isMulti;return Be("div",Je({},nn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),n)},Gd=function(t,n){var i=t.theme,r=i.spacing.baseUnit,o=i.colors;return Xe({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Ew=Gd,Iw=Gd,Tw=function(t){var n=t.children,i=n===void 0?"No options":n,r=t.innerProps,o=Mr(t,vw);return Be("div",Je({},nn(Xe(Xe({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Dw=function(t){var n=t.children,i=n===void 0?"Loading...":n,r=t.innerProps,o=Mr(t,bw);return Be("div",Je({},nn(Xe(Xe({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},Ow=function(t){var n=t.rect,i=t.offset,r=t.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},Pw=function(t){var n=t.appendTo,i=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=h.useRef(null),u=h.useRef(null),c=h.useState(Xd(a)),d=Sr(c,2),f=d[0],g=d[1],m=h.useMemo(function(){return{setPortalPlacement:g}},[]),p=h.useState(null),b=Sr(p,2),y=b[0],w=b[1],S=h.useCallback(function(){if(r){var R=cw(r),I=s==="fixed"?0:window.pageYOffset,E=R[f]+I;(E!==(y==null?void 0:y.offset)||R.left!==(y==null?void 0:y.rect.left)||R.width!==(y==null?void 0:y.rect.width))&&w({offset:E,rect:R})}},[r,s,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);Vs(function(){S()},[S]);var M=h.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=rw(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);Vs(function(){M()},[M]);var C=h.useCallback(function(R){l.current=R,M()},[M]);if(!n&&s!=="fixed"||!y)return null;var x=Be("div",Je({ref:C},nn(Xe(Xe({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Be(Yd.Provider,{value:m},n?xc.createPortal(x,n):x)},_w=function(t){var n=t.isDisabled,i=t.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Lw=function(t){var n=t.children,i=t.innerProps,r=t.isDisabled,o=t.isRtl;return Be("div",Je({},nn(t,"container",{"--is-disabled":r,"--is-rtl":o}),i),n)},Fw=function(t,n){var i=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Xe({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},Aw=function(t){var n=t.children,i=t.innerProps,r=t.isMulti,o=t.hasValue;return Be("div",Je({},nn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),n)},Hw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zw=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"indicatorsContainer",{indicators:!0}),i),n)},Yu,$w=["size"],Vw=["innerProps","isRtl","size"],Nw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},jd=function(t){var n=t.size,i=Mr(t,$w);return Be("svg",Je({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Nw},i))},Cl=function(t){return Be(jd,Je({size:20},t),Be("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},qd=function(t){return Be(jd,Je({size:20},t),Be("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Kd=function(t,n){var i=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Xe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?a.neutral60:a.neutral20,padding:o*2,":hover":{color:i?a.neutral80:a.neutral40}})},Bw=Kd,Ww=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||Be(qd,null))},Uw=Kd,Xw=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||Be(Cl,null))},Yw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Xe({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},Gw=function(t){var n=t.innerProps;return Be("span",Je({},n,nn(t,"indicatorSeparator",{"indicator-separator":!0})))},jw=Lh(Yu||(Yu=Ub([`
|
191
|
+
Error: ${o}`}const i={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=o=>{if(Qe(o))return!e.isRequired;let a=Et(o),s=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(a)===!1?!1:s?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(o,a){if(typeof n=="string")return Vt(Et(o),n);if(a){const s=r(o);if(s===!1)return Vt(Et(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=xt(o)?Et(o):null,l=xt(s)?xa(s):"";return{...i,isMissingValue:Qe(s),data:s,displayData:l}}catch(s){return Vt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}pl.isEditableType=!0;const Pu=fo("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),ib=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?Jt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:Jt(Pu,{src:t})}):Jt(Pu,{src:t})},_u=new Map(Object.entries({object:co,text:pl,checkbox:ll,selectbox:ml,list:hl,number:gl,link:Pd,datetime:cl,date:fl,time:dl,line_chart:Id,bar_chart:Td,area_chart:Dd,image:Od,progress:_d})),ob=[];var ab=uh,sb=ch,lb=dh,ub=fh,cb=hh,db=gh,fb=mh,hb=ph,gb="[object Map]",mb="[object Set]",pb=Object.prototype,vb=pb.hasOwnProperty;function bb(e){if(e==null)return!0;if(cb(e)&&(ub(e)||typeof e=="string"||typeof e.splice=="function"||db(e)||hb(e)||lb(e)))return!e.length;var t=sb(e);if(t==gb||t==mb)return!e.size;if(fb(e))return!ab(e).length;for(var n in e)if(vb.call(e,n))return!1;return!0}var wb=bb;const yb=Mi(wb);function Lu(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=i.exec(n);if(r)return r[1].trim()}function Cb(e,t,n){const i={},r=Lu(t,"color",n);r&&(i.textDark=r);const o=Lu(t,"background-color",n);return o&&(i.bgCell=o),o==="yellow"&&r===void 0&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}function Sb(e){return Sh(e)||xh(e)?pl:kh(e)?cl:Sc(e)?dl:Mh(e)?fl:Rh(e)||Eh(e)?co:Cc(e)?ll:Ih(e)?gl:Th(e)?ml:Dh(e)?hl:co}function Ld(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(i=>i!=="").join(" / "):void 0;return{title:t,group:n}}function vl(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function xb(e,t){const n=e.columnNames.map(s=>s[t]),{title:i,group:r}=Ld(n),o=e.columnTypes[t];let a=!0;return Oh(o)&&(a=!1),vl({id:`_index-${t}`,indexNumber:t,name:i,title:i,group:r,isEditable:a,arrowType:o,isIndex:!0,isPinned:!0})}function kb(e,t){const n=e.columnNames.map(a=>a[t]),{title:i,group:r}=Ld(n),o=e.columnTypes[t];return vl({id:`_column-${i}-${t}`,indexNumber:t,name:i,isEditable:!0,title:i,arrowType:o,group:r})}function Fd(){return vl({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:vh.INDEX,arrowField:new bh("",new wh,!0),pandasType:void 0}})}function Mb(e){const t=[],{dimensions:n}=e,i=n.numIndexColumns,r=n.numDataColumns;if(i===0&&r===0)return t.push(Fd()),t;for(let o=0;o<i;o++)t.push(xb(e,o));for(let o=0;o<r;o++)t.push(kb(e,o+i));return t}function Rb(e,t,n,i=void 0){var o,a,s,l,u,c;let r;if(e.kind==="object")r=e.getCell(xt(t.content)?xa(Rs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&xt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;Sc(e.arrowType)&&xt((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?d=yh(t.content,t.field):d=Zr.utc(Number(t.content)).toDate(),r=e.getCell(d)}else if(Ch(e.arrowType)){const d=Qe(t.content)?null:Rs(t.content,t.contentType);r=e.getCell(d)}else r=e.getCell(t.content);if(Si(r))return r;if(!e.isEditable){if(n&&xt(n==null?void 0:n.displayContent)){const d=xa(n.displayContent);r.kind===Z.Text?r={...r,displayData:d}:r.kind===Z.Number&&Qe((s=e.columnTypeOptions)==null?void 0:s.format)?r={...r,displayData:d}:r.kind===Z.Uri&&Qe((l=e.columnTypeOptions)==null?void 0:l.display_text)?r={...r,displayData:d}:r.kind===Z.Custom&&((u=r.data)==null?void 0:u.kind)==="date-picker-cell"&&Qe((c=e.columnTypeOptions)==null?void 0:c.format)&&(r={...r,data:{...r.data,displayDate:d}})}i&&(n!=null&&n.cssId)&&(r=Cb(r,n.cssId,i))}return r}const la="_index",Fu="_pos:",Au={small:75,medium:200,large:400},Ad=Us.getLogger("useColumnLoader");function Eb(e){if(!Qe(e)){if(typeof e=="number")return e;if(e in Au)return Au[e]}}const Qo=(e,t)=>Jh(e,t,(i,r)=>{if(Ph(r))return r});function Ib(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(la)&&(n=Qo(n,t.get(la)??{})),t.has(`${Fu}${e.indexNumber}`)&&(n=Qo(n,t.get(`${Fu}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==la&&(n=Qo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Qo(n,t.get(e.id)??{})),yb(n)?e:wc({...e},{title:n.label,width:Eb(n.width),isEditable:xt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function Tb(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Ad.error(t),new Map}}function Db(e){var i;const t=(i=e.columnTypeOptions)==null?void 0:i.type;let n;return xt(t)&&(_u.has(t)?n=_u.get(t):Ad.warn(`Unknown column type configured in column configuration: ${t}`)),Qe(n)&&(n=Sb(e.arrowType)),n}function Ob(e,t,n,i){const r=Da(),o=te.useMemo(()=>Tb(e.columns),[e.columns]),[a,s]=te.useState(o);te.useEffect(()=>{s(o)},[o]);const l=e.useContainerWidth||xt(e.width)&&e.width>0;return{columns:te.useMemo(()=>{const c=Mb(t).map(m=>{let p={...m,...Ib(m,a),isStretched:l};const b=Db(p);return(e.editingMode===Yn.EditingMode.READ_ONLY||n||b.isEditableType===!1)&&(p={...p,isEditable:!1}),e.editingMode!==Yn.EditingMode.READ_ONLY&&p.isEditable==!0&&(p={...p,icon:"editable"},p.isRequired&&e.editingMode===Yn.EditingMode.DYNAMIC&&(p={...p,isHidden:!1})),b(p,r)}).filter(m=>!m.isHidden),d=[],f=[];i!=null&&i.length?(c.forEach(m=>{m.isIndex&&!i.includes(m.name)&&!i.includes(m.id)&&m.isPinned!==!1&&d.push(m)}),i.forEach(m=>{const p=c.find(b=>b.name===m||b.id===m);p&&(p.isPinned?d.push(p):f.push(p))})):c.forEach(m=>{m.isPinned?d.push(m):f.push(m)});const g=[...d,...f];return g.length>0?g:[co(Fd())]},[t,a,l,n,e.editingMode,i,r]),setColumnConfigMapping:s}}function oo(e){return e.isIndex?la:Qe(e.name)?"":e.name}class ea{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const i={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,s)=>{const l={};o.forEach((u,c,d)=>{const f=n.get(c);f&&(l[oo(f)]=f.getCellValue(u))}),i.edited_rows[a]=l}),this.addedRows.forEach(o=>{const a={};let s=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const f=d.getCellValue(l);d.isRequired&&d.isEditable&&Aa(l)&&(s=!0),xt(f)&&(a[oo(d)]=f)}}),s||i.added_rows.push(a)}),i.deleted_rows=this.deletedRows,JSON.stringify(i,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const i=JSON.parse(t),r=new Map;n.forEach(a=>{r.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(oo(a),a)}),Object.keys(i.edited_rows).forEach(a=>{const s=Number(a),l=i.edited_rows[a];Object.keys(l).forEach(u=>{var f;const c=l[u],d=o.get(u);if(d){const g=d.getCell(c);g&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(f=this.editedCells.get(s))==null||f.set(d.indexNumber,g))}})}),i.added_rows.forEach(a=>{const s=new Map;n.forEach(l=>{s.set(l.indexNumber,l.getCell(null))}),Object.keys(a).forEach(l=>{const u=a[l],c=o.get(l);if(c){const d=c.getCell(u);d&&s.set(c.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=i.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const i=this.editedCells.get(n);if(i!==void 0)return i.get(t)}setCell(t,n,i){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,i)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,i)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,i)=>i-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Qe(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,i)=>n-i)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let i=0;i<this.deletedRows.length&&!(this.deletedRows[i]>n);i++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}function Pb(e,t,n,i,r,o){const a=te.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??i*2),0)>n*.6,[e,n,i]),s=t||a?0:e.filter(c=>c.isPinned).length,l=te.useCallback(c=>{o(d=>{const f=new Map(d),g=f.get(c);return f.set(c,{...g||{},pinned:!1}),f}),r(!0,!1)},[r,o]);return{pinColumn:te.useCallback(c=>{o(d=>{const f=new Map(d),g=f.get(c);return f.set(c,{...g||{},pinned:!0}),f}),r(!0,!1)},[r,o]),unpinColumn:l,freezeColumns:s}}function _b(e,t,n,i,r){return{onColumnMoved:te.useCallback((a,s)=>{const l=[...e],[u]=l.splice(a,1);l.splice(s,0,u),s<t&&!u.isPinned?n(u.id):s>=t&&u.isPinned&&i(u.id),r(l.map(c=>c.id))},[e,t,n,i,r])}}function Lb(e){const[t,n]=h.useState(()=>new Map),i=te.useCallback((o,a,s,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:te.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:i}}function Fb(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(i=>i.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Hu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function Ab(e,t){return e=Hu(e),t=Hu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function Hb(e,t){return e>t?1:e===t?0:-1}function zb(e){const{sort:t,rows:n,getCellContent:i}=e;let r=t===void 0?void 0:e.columns.findIndex(u=>t.column===u||u.id!==void 0&&t.column.id===u.id);r===-1&&(r=void 0);const o=(t==null?void 0:t.direction)??"asc",a=h.useMemo(()=>{if(r===void 0)return;const u=new Array(n),c=[r,0];for(let f=0;f<n;f++)c[1]=f,u[f]=Fb(i(c));let d;return(t==null?void 0:t.mode)==="raw"?d=fr(n).sort((f,g)=>Hb(u[f],u[g])):(t==null?void 0:t.mode)==="smart"?d=fr(n).sort((f,g)=>Ab(u[f],u[g])):d=fr(n).sort((f,g)=>u[f].localeCompare(u[g])),o==="desc"&&d.reverse(),d},[i,n,t==null?void 0:t.mode,o,r]),s=h.useCallback(u=>a===void 0?u:a[u],[a]),l=h.useCallback(([u,c])=>a===void 0?i([u,c]):(c=a[c],i([u,c])),[i,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:l}}function $b(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function Vb(e,t,n){const[i,r]=te.useState(),{getCellContent:o,getOriginalIndex:a}=zb({columns:t.map(u=>zs(u)),getCellContent:n,rows:e,sort:i}),s=te.useMemo(()=>$b(t,i),[t,i]),l=te.useCallback((u,c,d)=>{const f=s[u];let g;c==="auto"?(g="asc",i&&i.column.id===f.id&&(i.direction==="asc"?g="desc":g=void 0)):g=c,g===void 0||d&&g===(i==null?void 0:i.direction)?r(void 0):r({column:zs(f),direction:g,mode:f.sortMode})},[i,s]);return{columns:s,sortColumn:l,getOriginalIndex:a,getCellContent:o}}const Nb={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:i,rect:r,hoverAmount:o,hoverX:a}=e;let{values:s,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:f}=t.data;const[g,m]=l;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-g)/(m-g))));const p=i.cellHorizontalPadding,b=p+r.x,y=r.y+3,w=r.height-6,S=r.width-p*2,M=m-g,C=m<=0?y:g>=0?y+w:y+w*(m/M);if(!f&&g<=0&&m>=0&&(n.beginPath(),n.moveTo(b,C),n.lineTo(b+S,C),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const x=2,R=(s.length-1)*x,I=(S-R)/s.length;let E=b;for(const L of s){const z=y+w-L*w;n.moveTo(E,C),n.lineTo(E+I,C),n.lineTo(E+I,z),n.lineTo(E,z),E+=I+x}n.fillStyle=t.data.color??i.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),R=s.map((E,L)=>({x:b+x*L,y:y+w-E*w}));n.moveTo(R[0].x,R[0].y);let I=0;if(R.length>2)for(I=1;I<R.length-2;I++){const E=(R[I].x+R[I+1].x)/2,L=(R[I].y+R[I+1].y)/2;n.quadraticCurveTo(R[I].x,R[I].y,E,L)}if(n.quadraticCurveTo(R[I].x,R[I].y,R[I+1].x,R[I+1].y),n.strokeStyle=u??i.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(r.x+r.width-p,C),n.lineTo(r.x+p,C),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const E=n.createLinearGradient(0,y,0,y+w*1.4);E.addColorStop(0,u??i.accentColor);const[L,z,_]=va(u??i.accentColor);E.addColorStop(1,`rgba(${L}, ${z}, ${_}, 0)`),n.fillStyle=E,n.fill(),n.globalAlpha=1}if(a!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const E=Math.min(s.length-1,Math.max(0,Math.round((a-p)/x)));n.moveTo(b+E*x,r.y+1),n.lineTo(b+E*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.save(),n.font=`8px ${i.fontFamily}`,n.fillStyle=i.textMedium,n.textBaseline="top",n.fillText(d[E],b,r.y+i.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function zu(e,t,n,i,r,o){if(!(i<=0||r<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,i,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,i/2),tr:Math.min(o.tr,r/2,i/2),bl:Math.min(o.bl,r/2,i/2),br:Math.min(o.br,r/2,i/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function $u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$u(Object(n),!0).forEach(function(i){qi(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$u(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Mr(e,t){if(e==null)return{};var n,i,r=_h(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Wb(e){var t=e.defaultInputValue,n=t===void 0?"":t,i=e.defaultMenuIsOpen,r=i===void 0?!1:i,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=Mr(e,Bb),p=h.useState(s!==void 0?s:n),b=Sr(p,2),y=b[0],w=b[1],S=h.useState(l!==void 0?l:r),M=Sr(S,2),C=M[0],x=M[1],R=h.useState(g!==void 0?g:a),I=Sr(R,2),E=I[0],L=I[1],z=h.useCallback(function(de,xe){typeof u=="function"&&u(de,xe),L(de)},[u]),_=h.useCallback(function(de,xe){var ae;typeof c=="function"&&(ae=c(de,xe)),w(ae!==void 0?ae:de)},[c]),F=h.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),P=h.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),ne=s!==void 0?s:y,Q=l!==void 0?l:C,oe=g!==void 0?g:E;return Xe(Xe({},m),{},{inputValue:ne,menuIsOpen:Q,onChange:z,onInputChange:_,onMenuClose:P,onMenuOpen:F,value:oe})}function Ub(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const Xb=Math.min,Yb=Math.max,ka=Math.round,ta=Math.floor,Ma=e=>({x:e,y:e});function Gb(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function Ha(){return typeof window<"u"}function Hd(e){return $d(e)?(e.nodeName||"").toLowerCase():"#document"}function kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zd(e){var t;return(t=($d(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $d(e){return Ha()?e instanceof Node||e instanceof kr(e).Node:!1}function jb(e){return Ha()?e instanceof Element||e instanceof kr(e).Element:!1}function bl(e){return Ha()?e instanceof HTMLElement||e instanceof kr(e).HTMLElement:!1}function Vu(e){return!Ha()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kr(e).ShadowRoot}function Vd(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=wl(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function qb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Kb(e){return["html","body","#document"].includes(Hd(e))}function wl(e){return kr(e).getComputedStyle(e)}function Zb(e){if(Hd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vu(e)&&e.host||zd(e);return Vu(t)?t.host:t}function Nd(e){const t=Zb(e);return Kb(t)?e.ownerDocument?e.ownerDocument.body:e.body:bl(t)&&Vd(t)?t:Nd(t)}function Ra(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Nd(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=kr(r);if(o){const s=$s(a);return t.concat(a,a.visualViewport||[],Vd(r)?r:[],s&&n?Ra(s):[])}return t.concat(r,Ra(r,[],n))}function $s(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jb(e){const t=wl(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=bl(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=ka(n)!==o||ka(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function yl(e){return jb(e)?e:e.contextElement}function Nu(e){const t=yl(e);if(!bl(t))return Ma(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Jb(t);let a=(o?ka(n.width):n.width)/i,s=(o?ka(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Qb=Ma(0);function ew(e){const t=kr(e);return!qb()||!t.visualViewport?Qb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tw(e,t,n){return!1}function Bu(e,t,n,i){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),o=yl(e);let a=Ma(1);t&&(a=Nu(e));const s=tw()?ew(o):Ma(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,c=r.width/a.x,d=r.height/a.y;if(o){const f=kr(o),g=i;let m=f,p=$s(m);for(;p&&i&&g!==m;){const b=Nu(p),y=p.getBoundingClientRect(),w=wl(p),S=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*b.x,M=y.top+(p.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=S,u+=M,m=kr(p),p=$s(m)}}return Gb({width:c,height:d,x:l,y:u})}function nw(e,t){let n=null,i;const r=zd(e);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const g=ta(c),m=ta(r.clientWidth-(u+d)),p=ta(r.clientHeight-(c+f)),b=ta(u),w={rootMargin:-g+"px "+-m+"px "+-p+"px "+-b+"px",threshold:Yb(0,Xb(1,l))||1};let S=!0;function M(C){const x=C[0].intersectionRatio;if(x!==l){if(!S)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(M,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,w)}n.observe(e)}return a(!0),o}function rw(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=yl(e),c=r||o?[...u?Ra(u):[],...Ra(t)]:[];c.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=u&&s?nw(u,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let m,p=l?Bu(e):null;l&&b();function b(){const y=Bu(e);p&&(y.x!==p.x||y.y!==p.y||y.width!==p.width||y.height!==p.height)&&n(),p=y,m=requestAnimationFrame(b)}return n(),()=>{var y;c.forEach(w=>{r&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Vs=h.useLayoutEffect,iw=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ea=function(){};function ow(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function aw(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=[].concat(i);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(ow(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Wu=function(t){return mw(t)?t.filter(Boolean):Fh(t)==="object"&&t!==null?[t]:[]},Bd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Mr(t,iw);return Xe({},n)},nn=function(t,n,i){var r=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:r(i??{},a(n,t),s)}};function za(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function sw(e){return za(e)?window.innerHeight:e.clientHeight}function Wd(e){return za(e)?window.pageYOffset:e.scrollTop}function Ia(e,t){if(za(e)){window.scrollTo(0,t);return}e.scrollTop=t}function lw(e){var t=getComputedStyle(e),n=t.position==="absolute",i=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&i.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function uw(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function na(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ea,r=Wd(e),o=t-r,a=10,s=0;function l(){s+=a;var u=uw(s,r,o,n);Ia(e,u),s<n?window.requestAnimationFrame(l):i(e)}l()}function Uu(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.offsetHeight/3;i.bottom+r>n.bottom?Ia(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r<n.top&&Ia(e,Math.max(t.offsetTop-r,0))}function cw(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Xu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function dw(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ud=!1,fw={get passive(){return Ud=!0}},ra=typeof window<"u"?window:{};ra.addEventListener&&ra.removeEventListener&&(ra.addEventListener("p",Ea,fw),ra.removeEventListener("p",Ea,!1));var hw=Ud;function gw(e){return e!=null}function mw(e){return Array.isArray(e)}function ia(e,t,n){return e?t:n}var pw=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var s=Sr(a,1),l=s[0];return!i.includes(l)});return o.reduce(function(a,s){var l=Sr(s,2),u=l[0],c=l[1];return a[u]=c,a},{})},vw=["children","innerProps"],bw=["children","innerProps"];function ww(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=lw(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,w=a?window.innerHeight:sw(l),S=Wd(l),M=parseInt(getComputedStyle(n).marginBottom,10),C=parseInt(getComputedStyle(n).marginTop,10),x=y-C,R=w-p,I=x+S,E=d-S-p,L=g-w+S+M,z=S+p-C,_=160;switch(r){case"auto":case"bottom":if(R>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&na(l,L,_),{placement:"bottom",maxHeight:t};if(!a&&E>=i||a&&R>=i){o&&na(l,L,_);var F=a?R-M:E-M;return{placement:"bottom",maxHeight:F}}if(r==="auto"||a){var P=t,ne=a?x:I;return ne>=i&&(P=Math.min(ne-M-s,t)),{placement:"top",maxHeight:P}}if(r==="bottom")return o&&Ia(l,L),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!a)return o&&na(l,z,_),{placement:"top",maxHeight:t};if(!a&&I>=i||a&&x>=i){var Q=t;return(!a&&I>=i||a&&x>=i)&&(Q=a?x-C:I-C),o&&na(l,z,_),{placement:"top",maxHeight:Q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function yw(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Xd=function(t){return t==="auto"?"bottom":t},Cw=function(t,n){var i,r=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return Xe((i={label:"menu"},qi(i,yw(r),"100%"),qi(i,"position","absolute"),qi(i,"width","100%"),qi(i,"zIndex",1),i),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Yd=h.createContext(null),Sw=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,u=h.useContext(Yd)||{},c=u.setPortalPlacement,d=h.useRef(null),f=h.useState(r),g=Sr(f,2),m=g[0],p=g[1],b=h.useState(null),y=Sr(b,2),w=y[0],S=y[1],M=l.spacing.controlHeight;return Vs(function(){var C=d.current;if(C){var x=a==="fixed",R=s&&!x,I=ww({maxHeight:r,menuEl:C,minHeight:i,placement:o,shouldScroll:R,isFixedPosition:x,controlHeight:M});p(I.maxHeight),S(I.placement),c==null||c(I.placement)}},[r,o,a,s,i,c,M]),n({ref:d,placerProps:Xe(Xe({},t),{},{placement:w||Xd(o),maxHeight:m})})},xw=function(t){var n=t.children,i=t.innerRef,r=t.innerProps;return Be("div",Je({},nn(t,"menu",{menu:!0}),{ref:i},r),n)},kw=xw,Mw=function(t,n){var i=t.maxHeight,r=t.theme.spacing.baseUnit;return Xe({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Rw=function(t){var n=t.children,i=t.innerProps,r=t.innerRef,o=t.isMulti;return Be("div",Je({},nn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),n)},Gd=function(t,n){var i=t.theme,r=i.spacing.baseUnit,o=i.colors;return Xe({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Ew=Gd,Iw=Gd,Tw=function(t){var n=t.children,i=n===void 0?"No options":n,r=t.innerProps,o=Mr(t,vw);return Be("div",Je({},nn(Xe(Xe({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Dw=function(t){var n=t.children,i=n===void 0?"Loading...":n,r=t.innerProps,o=Mr(t,bw);return Be("div",Je({},nn(Xe(Xe({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},Ow=function(t){var n=t.rect,i=t.offset,r=t.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},Pw=function(t){var n=t.appendTo,i=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=h.useRef(null),u=h.useRef(null),c=h.useState(Xd(a)),d=Sr(c,2),f=d[0],g=d[1],m=h.useMemo(function(){return{setPortalPlacement:g}},[]),p=h.useState(null),b=Sr(p,2),y=b[0],w=b[1],S=h.useCallback(function(){if(r){var R=cw(r),I=s==="fixed"?0:window.pageYOffset,E=R[f]+I;(E!==(y==null?void 0:y.offset)||R.left!==(y==null?void 0:y.rect.left)||R.width!==(y==null?void 0:y.rect.width))&&w({offset:E,rect:R})}},[r,s,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);Vs(function(){S()},[S]);var M=h.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=rw(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);Vs(function(){M()},[M]);var C=h.useCallback(function(R){l.current=R,M()},[M]);if(!n&&s!=="fixed"||!y)return null;var x=Be("div",Je({ref:C},nn(Xe(Xe({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Be(Yd.Provider,{value:m},n?xc.createPortal(x,n):x)},_w=function(t){var n=t.isDisabled,i=t.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Lw=function(t){var n=t.children,i=t.innerProps,r=t.isDisabled,o=t.isRtl;return Be("div",Je({},nn(t,"container",{"--is-disabled":r,"--is-rtl":o}),i),n)},Fw=function(t,n){var i=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Xe({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},Aw=function(t){var n=t.children,i=t.innerProps,r=t.isMulti,o=t.hasValue;return Be("div",Je({},nn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),n)},Hw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zw=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"indicatorsContainer",{indicators:!0}),i),n)},Yu,$w=["size"],Vw=["innerProps","isRtl","size"],Nw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},jd=function(t){var n=t.size,i=Mr(t,$w);return Be("svg",Je({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Nw},i))},Cl=function(t){return Be(jd,Je({size:20},t),Be("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},qd=function(t){return Be(jd,Je({size:20},t),Be("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Kd=function(t,n){var i=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Xe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?a.neutral60:a.neutral20,padding:o*2,":hover":{color:i?a.neutral80:a.neutral40}})},Bw=Kd,Ww=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||Be(qd,null))},Uw=Kd,Xw=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||Be(Cl,null))},Yw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Xe({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},Gw=function(t){var n=t.innerProps;return Be("span",Je({},n,nn(t,"indicatorSeparator",{"indicator-separator":!0})))},jw=Lh(Yu||(Yu=Ub([`
|
192
192
|
0%, 80%, 100% { opacity: 0; }
|
193
193
|
40% { opacity: 1; }
|
194
|
-
`]))),qw=function(t,n){var i=t.isFocused,r=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return Xe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?a.neutral60:a.neutral20,padding:s*2})},bs=function(t){var n=t.delay,i=t.offset;return Be("span",{css:kc({animation:"".concat(jw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Kw=function(t){var n=t.innerProps,i=t.isRtl,r=t.size,o=r===void 0?4:r,a=Mr(t,Vw);return Be("div",Je({},nn(Xe(Xe({},a),{},{innerProps:n,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Be(bs,{delay:0,offset:i}),Be(bs,{delay:160,offset:!0}),Be(bs,{delay:320,offset:!i}))},Zw=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return Xe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?a.neutral5:a.neutral0,borderColor:i?a.neutral10:r?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Jw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return Be("div",Je({ref:o},nn(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":s}),a,{"aria-disabled":i||void 0}),n)},Qw=Jw,ey=["data"],ty=function(t,n){var i=t.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},ny=function(t){var n=t.children,i=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Be("div",Je({},nn(t,"group",{group:!0}),l),Be(a,Je({},s,{selectProps:d,theme:c,getStyles:r,getClassNames:o,cx:i}),u),Be("div",null,n))},ry=function(t,n){var i=t.theme,r=i.colors,o=i.spacing;return Xe({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},iy=function(t){var n=Bd(t);n.data;var i=Mr(n,ey);return Be("div",Je({},nn(t,"groupHeading",{"group-heading":!0}),i))},oy=ny,ay=["innerRef","isDisabled","isHidden","inputClassName"],sy=function(t,n){var i=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,s=o.colors;return Xe(Xe({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},ly),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},Zd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},ly={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Xe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Zd)},uy=function(t){return Xe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Zd)},cy=function(t){var n=t.cx,i=t.value,r=Bd(t),o=r.innerRef,a=r.isDisabled,s=r.isHidden,l=r.inputClassName,u=Mr(r,ay);return Be("div",Je({},nn(t,"input",{"input-container":!0}),{"data-value":i||""}),Be("input",Je({className:n({input:!0},l),ref:o,style:uy(s),disabled:a},u)))},dy=cy,fy=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors;return Xe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},hy=function(t,n){var i=t.theme,r=i.borderRadius,o=i.colors,a=t.cropWithEllipsis;return Xe({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},gy=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors,s=t.isFocused;return Xe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Jd=function(t){var n=t.children,i=t.innerProps;return Be("div",i,n)},my=Jd,py=Jd;function vy(e){var t=e.children,n=e.innerProps;return Be("div",Je({role:"button"},n),t||Be(Cl,{size:14}))}var by=function(t){var n=t.children,i=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,u=i.Container,c=i.Label,d=i.Remove;return Be(u,{data:r,innerProps:Xe(Xe({},nn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},Be(c,{data:r,innerProps:Xe({},nn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Be(d,{data:r,innerProps:Xe(Xe({},nn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},wy=by,yy=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return Xe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},Cy=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return Be("div",Je({},nn(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":i},s),n)},Sy=Cy,xy=function(t,n){var i=t.theme,r=i.spacing,o=i.colors;return Xe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},ky=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"placeholder",{placeholder:!0}),i),n)},My=ky,Ry=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return Xe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ey=function(t){var n=t.children,i=t.isDisabled,r=t.innerProps;return Be("div",Je({},nn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},Iy=Ey,Qd={ClearIndicator:Xw,Control:Qw,DropdownIndicator:Ww,DownChevron:qd,CrossIcon:Cl,Group:oy,GroupHeading:iy,IndicatorsContainer:zw,IndicatorSeparator:Gw,Input:dy,LoadingIndicator:Kw,Menu:kw,MenuList:Rw,MenuPortal:Pw,LoadingMessage:Dw,NoOptionsMessage:Tw,MultiValue:wy,MultiValueContainer:my,MultiValueLabel:py,MultiValueRemove:vy,Option:Sy,Placeholder:My,SelectContainer:Lw,SingleValue:Iy,ValueContainer:Aw},Ty=function(t){return Xe(Xe({},Qd),t.components)},Gu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dy(e,t){return!!(e===t||Gu(e)&&Gu(t))}function Oy(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dy(e[n],t[n]))return!1;return!0}function Py(e,t){t===void 0&&(t=Oy);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return i.clear=function(){n=null},i}var _y={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Ly=function(t){return Be("span",Je({css:_y},t))},ju=Ly,Fy={guidance:function(t){var n=t.isSearchable,i=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,i=t.label,r=i===void 0?"":i,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,i=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(d(s,i),".");if(n==="menu"&&c){var f=l?" disabled":"",g="".concat(u?" selected":"").concat(f);return"".concat(a).concat(g,", ").concat(d(r,i),".")}return""},onFilter:function(t){var n=t.inputValue,i=t.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Ay=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,b=l.isSearchable,y=l.menuIsOpen,w=l.options,S=l.screenReaderStatus,M=l.tabSelectsValue,C=l.isLoading,x=l["aria-label"],R=l["aria-live"],I=h.useMemo(function(){return Xe(Xe({},Fy),d||{})},[d]),E=h.useMemo(function(){var ne="";if(n&&I.onChange){var Q=n.option,oe=n.options,de=n.removedValue,xe=n.removedValues,ae=n.value,G=function(k){return Array.isArray(k)?null:k},se=de||Q||G(ae),ie=se?f(se):"",be=oe||xe||void 0,we=be?be.map(f):[],j=Xe({isDisabled:se&&p(se,s),label:ie,labels:we},n);ne=I.onChange(j)}return ne},[n,I,p,s,f]),L=h.useMemo(function(){var ne="",Q=i||r,oe=!!(i&&s&&s.includes(i));if(Q&&I.onFocus){var de={focused:Q,label:f(Q),isDisabled:p(Q,s),isSelected:oe,options:o,context:Q===i?"menu":"value",selectValue:s,isAppleDevice:c};ne=I.onFocus(de)}return ne},[i,r,f,p,I,o,s,c]),z=h.useMemo(function(){var ne="";if(y&&w.length&&!C&&I.onFilter){var Q=S({count:o.length});ne=I.onFilter({inputValue:g,resultsMessage:Q})}return ne},[o,g,y,I,w,S,C]),_=(n==null?void 0:n.action)==="initial-input-focus",F=h.useMemo(function(){var ne="";if(I.guidance){var Q=r?"value":y?"menu":"input";ne=I.guidance({"aria-label":x,context:Q,isDisabled:i&&p(i,s),isMulti:m,isSearchable:b,tabSelectsValue:M,isInitialFocus:_})}return ne},[x,i,r,m,p,b,y,I,s,M,_]),P=Be(h.Fragment,null,Be("span",{id:"aria-selection"},E),Be("span",{id:"aria-focused"},L),Be("span",{id:"aria-results"},z),Be("span",{id:"aria-guidance"},F));return Be(h.Fragment,null,Be(ju,{id:u},_&&P),Be(ju,{"aria-live":R,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!_&&P))},Hy=Ay,Ns=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],zy=new RegExp("["+Ns.map(function(e){return e.letters}).join("")+"]","g"),ef={};for(var ws=0;ws<Ns.length;ws++)for(var ys=Ns[ws],Cs=0;Cs<ys.letters.length;Cs++)ef[ys.letters[Cs]]=ys.base;var tf=function(t){return t.replace(zy,function(n){return ef[n]})},$y=Py(tf),qu=function(t){return t.replace(/^\s+|\s+$/g,"")},Vy=function(t){return"".concat(t.label," ").concat(t.value)},Ny=function(t){return function(n,i){if(n.data.__isNew__)return!0;var r=Xe({ignoreCase:!0,ignoreAccents:!0,stringify:Vy,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,s=r.stringify,l=r.trim,u=r.matchFrom,c=l?qu(i):i,d=l?qu(s(n)):s(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=$y(c),d=tf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},By=["innerRef"];function Wy(e){var t=e.innerRef,n=Mr(e,By),i=pw(n,"onExited","in","enter","exit","appear");return Be("input",Je({ref:t},i,{css:kc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Uy=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Xy(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=h.useRef(!1),s=h.useRef(!1),l=h.useRef(0),u=h.useRef(null),c=h.useCallback(function(b,y){if(u.current!==null){var w=u.current,S=w.scrollTop,M=w.scrollHeight,C=w.clientHeight,x=u.current,R=y>0,I=M-C-S,E=!1;I>y&&a.current&&(i&&i(b),a.current=!1),R&&s.current&&(o&&o(b),s.current=!1),R&&y>I?(n&&!a.current&&n(b),x.scrollTop=M,E=!0,a.current=!0):!R&&-y>S&&(r&&!s.current&&r(b),x.scrollTop=0,E=!0,s.current=!0),E&&Uy(b)}},[n,i,r,o]),d=h.useCallback(function(b){c(b,b.deltaY)},[c]),f=h.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),g=h.useCallback(function(b){var y=l.current-b.changedTouches[0].clientY;c(b,y)},[c]),m=h.useCallback(function(b){if(b){var y=hw?{passive:!1}:!1;b.addEventListener("wheel",d,y),b.addEventListener("touchstart",f,y),b.addEventListener("touchmove",g,y)}},[g,f,d]),p=h.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",g,!1))},[g,f,d]);return h.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var Ku=["boxSizing","height","overflow","paddingRight","position"],Zu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ju(e){e.preventDefault()}function Qu(e){e.stopPropagation()}function ec(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function tc(){return"ontouchstart"in window||navigator.maxTouchPoints}var nc=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,pi={capture:!1,passive:!1};function Yy(e){var t=e.isEnabled,n=e.accountForScrollbars,i=n===void 0?!0:n,r=h.useRef({}),o=h.useRef(null),a=h.useCallback(function(l){if(nc){var u=document.body,c=u&&u.style;if(i&&Ku.forEach(function(m){var p=c&&c[m];r.current[m]=p}),i&&ji<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+d||0;Object.keys(Zu).forEach(function(m){var p=Zu[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(g,"px"))}u&&tc()&&(u.addEventListener("touchmove",Ju,pi),l&&(l.addEventListener("touchstart",ec,pi),l.addEventListener("touchmove",Qu,pi))),ji+=1}},[i]),s=h.useCallback(function(l){if(nc){var u=document.body,c=u&&u.style;ji=Math.max(ji-1,0),i&&ji<1&&Ku.forEach(function(d){var f=r.current[d];c&&(c[d]=f)}),u&&tc()&&(u.removeEventListener("touchmove",Ju,pi),l&&(l.removeEventListener("touchstart",ec,pi),l.removeEventListener("touchmove",Qu,pi)))}},[i]);return h.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var Gy=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function qy(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,r=i===void 0?!0:i,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=Xy({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=Yy({isEnabled:n}),d=function(g){u(g),c(g)};return Be(h.Fragment,null,n&&Be("div",{onClick:Gy,css:jy}),t(d))}var Ky={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Zy=function(t){var n=t.name,i=t.onFocus;return Be("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Ky,value:"",onChange:function(){}})},Jy=Zy;function Sl(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Qy(){return Sl(/^iPhone/i)}function nf(){return Sl(/^Mac/i)}function eC(){return Sl(/^iPad/i)||nf()&&navigator.maxTouchPoints>1}function tC(){return Qy()||eC()}function nC(){return nf()||tC()}var rC=function(t){return t.label},iC=function(t){return t.label},oC=function(t){return t.value},aC=function(t){return!!t.isDisabled},sC={clearIndicator:Uw,container:_w,control:Zw,dropdownIndicator:Bw,group:ty,groupHeading:ry,indicatorsContainer:Hw,indicatorSeparator:Yw,input:sy,loadingIndicator:qw,loadingMessage:Iw,menu:Cw,menuList:Mw,menuPortal:Ow,multiValue:fy,multiValueLabel:hy,multiValueRemove:gy,noOptionsMessage:Ew,option:yy,placeholder:xy,singleValue:Ry,valueContainer:Fw},lC={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},uC=4,rf=4,cC=38,dC=rf*2,fC={baseUnit:rf,controlHeight:cC,menuGutter:dC},Ss={borderRadius:uC,colors:lC,spacing:fC},hC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Xu(),captureMenuScroll:!Xu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ny(),formatGroupLabel:rC,getOptionLabel:iC,getOptionValue:oC,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:aC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!dw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function rc(e,t,n,i){var r=sf(e,t,n),o=lf(e,t,n),a=af(e,t),s=Ta(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:s,index:i}}function ua(e,t){return e.options.map(function(n,i){if("options"in n){var r=n.options.map(function(a,s){return rc(e,a,t,s)}).filter(function(a){return oc(e,a)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=rc(e,n,t,i);return oc(e,o)?o:void 0}).filter(gw)}function of(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Xs(n.options.map(function(i){return i.data}))):t.push(n.data),t},[])}function ic(e,t){return e.reduce(function(n,i){return i.type==="group"?n.push.apply(n,Xs(i.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(t,"-").concat(i.index)}),n},[])}function gC(e,t){return of(ua(e,t))}function oc(e,t){var n=e.inputValue,i=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,s=t.value;return(!cf(e)||!o)&&uf(e,{label:a,value:s,data:r},i)}function mC(e,t){var n=e.focusedValue,i=e.selectValue,r=i.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function pC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var xs=function(t,n){var i,r=(i=t.find(function(o){return o.data===n}))===null||i===void 0?void 0:i.id;return r||null},af=function(t,n){return t.getOptionLabel(n)},Ta=function(t,n){return t.getOptionValue(n)};function sf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function lf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var i=Ta(e,t);return n.some(function(r){return Ta(e,r)===i})}function uf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var cf=function(t){var n=t.hideSelectedOptions,i=t.isMulti;return n===void 0?i:n},vC=1,df=function(e){ng(n,e);var t=og(n);function n(i){var r;if(rg(this,n),r=t.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=nC(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var c=r.props,d=c.onChange,f=c.name;u.name=f,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,c){var d=r.props,f=d.closeMenuOnSelect,g=d.isMulti,m=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:c})},r.selectOption=function(l){var u=r.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,g=r.state.selectValue,m=d&&r.isOptionSelected(l,g),p=r.isOptionDisabled(l,g);if(m){var b=r.getOptionValue(l);r.setValue(g.filter(function(y){return r.getOptionValue(y)!==b}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(Xs(g),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,c=r.state.selectValue,d=r.getOptionValue(l),f=c.filter(function(m){return r.getOptionValue(m)!==d}),g=ia(u,f,f[0]||null);r.onChange(g,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(ia(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=ia(l,d,d[0]||null);c&&r.onChange(f,{action:"pop-value",removedValue:c})},r.getFocusedOptionId=function(l){return xs(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return ic(ua(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return aw.apply(void 0,[r.props.classNamePrefix].concat(u))},r.getOptionLabel=function(l){return af(r.props,l)},r.getOptionValue=function(l){return Ta(r.props,l)},r.getStyles=function(l,u){var c=r.props.unstyled,d=sC[l](u,c);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,u):d},r.getClassNames=function(l,u){var c,d;return(c=(d=r.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Ty(r.props)},r.buildCategorizedOptions=function(){return ua(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return of(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,u){r.setState({ariaSelection:Xe({value:l},u)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():u&&r.openMenu("first"):(u&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var u=r.props,c=u.isMulti,d=u.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&za(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-r.initialTouchX),f=Math.abs(c.clientY-r.initialTouchY),g=5;r.userIsDragging=d>g||f>g}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,c=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),c=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:c>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return cf(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,g=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,y=u.onKeyDown,w=u.tabSelectsValue,S=u.openMenuOnFocus,M=r.state,C=M.focusedOption,x=M.focusedValue,R=M.selectValue;if(!p&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||g)return;r.focusValue("previous");break;case"ArrowRight":if(!c||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(x)r.removeValue(x);else{if(!d)return;c?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!w||!C||S&&r.isOptionSelected(C,R))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(b){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(g)return;if(!b){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++vC),r.state.selectValue=Wu(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),s=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[s],r.state.focusedOptionId=xs(o,a[s])}return r}return ig(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Uu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&s&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Uu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(r){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),r==="up"?l=u>0?u-1:s.length-1:r==="down"?l=(u+1)%s.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):r==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ss):Xe(Xe({},Ss),this.props.theme):Ss}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,g=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return sf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return lf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return uf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,s=r.inputId,l=r.inputValue,u=r.tabIndex,c=r.form,d=r.menuIsOpen,f=r.required,g=this.getComponents(),m=g.Input,p=this.state,b=p.inputIsHidden,y=p.ariaSelection,w=this.commonProps,S=s||this.getElementId("input"),M=Xe(Xe(Xe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?h.createElement(m,Je({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},M)):h.createElement(Wy,Je({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ea,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},M))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,b=g.isMulti,y=g.inputValue,w=g.placeholder,S=this.state,M=S.selectValue,C=S.focusedValue,x=S.isFocused;if(!this.hasValue()||!m)return y?null:h.createElement(d,Je({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return M.map(function(I,E){var L=I===C,z="".concat(r.getOptionLabel(I),"-").concat(r.getOptionValue(I));return h.createElement(a,Je({},f,{components:{Container:s,Label:l,Remove:u},isFocused:L,isDisabled:p,key:z,index:E,removeProps:{onClick:function(){return r.removeValue(I)},onTouchEnd:function(){return r.removeValue(I)},onMouseDown:function(F){F.preventDefault()}},data:I}),r.formatOptionLabel(I,"value"))});if(y)return null;var R=M[0];return h.createElement(c,Je({},f,{data:R,isDisabled:p}),this.formatOptionLabel(R,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return h.createElement(a,Je({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,y=b.captureMenuScroll,w=b.inputValue,S=b.isLoading,M=b.loadingMessage,C=b.minMenuHeight,x=b.maxMenuHeight,R=b.menuIsOpen,I=b.menuPlacement,E=b.menuPosition,L=b.menuPortalTarget,z=b.menuShouldBlockScroll,_=b.menuShouldScrollIntoView,F=b.noOptionsMessage,P=b.onMenuScrollToTop,ne=b.onMenuScrollToBottom;if(!R)return null;var Q=function(ie,be){var we=ie.type,j=ie.data,O=ie.isDisabled,k=ie.isSelected,N=ie.label,re=ie.value,Oe=p===j,Ve=O?void 0:function(){return r.onOptionHover(j)},he=O?void 0:function(){return r.selectOption(j)},tt="".concat(r.getElementId("option"),"-").concat(be),ke={id:tt,onClick:he,onMouseMove:Ve,onMouseOver:Ve,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:k};return h.createElement(g,Je({},m,{innerProps:ke,data:j,isDisabled:O,isSelected:k,key:tt,label:N,type:we,value:re,isFocused:Oe,innerRef:Oe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(ie.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var ie=se.data,be=se.options,we=se.index,j="".concat(r.getElementId("group"),"-").concat(we),O="".concat(j,"-heading");return h.createElement(a,Je({},m,{key:j,data:ie,options:be,Heading:s,headingProps:{id:O,data:se.data},label:r.formatGroupLabel(se.data)}),se.options.map(function(k){return Q(k,"".concat(we,"-").concat(k.index))}))}else if(se.type==="option")return Q(se,"".concat(se.index))});else if(S){var de=M({inputValue:w});if(de===null)return null;oe=h.createElement(d,m,de)}else{var xe=F({inputValue:w});if(xe===null)return null;oe=h.createElement(f,m,xe)}var ae={minMenuHeight:C,maxMenuHeight:x,menuPlacement:I,menuPosition:E,menuShouldScrollIntoView:_},G=h.createElement(Sw,Je({},m,ae),function(se){var ie=se.ref,be=se.placerProps,we=be.placement,j=be.maxHeight;return h.createElement(l,Je({},m,ae,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:we}),h.createElement(qy,{captureEnabled:y,onTopArrive:P,onBottomArrive:ne,lockEnabled:z},function(O){return h.createElement(u,Je({},m,{innerRef:function(N){r.getMenuListRef(N),O(N)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:j,focusedOption:p}),oe)}))});return L||E==="fixed"?h.createElement(c,Je({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:I,menuPosition:E}),G):G}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return h.createElement(Jy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var f=d.map(function(p){return r.getOptionValue(p)}).join(a);return h.createElement("input",{name:u,type:"hidden",value:f})}else{var g=d.length>0?d.map(function(p,b){return h.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:r.getOptionValue(p)})}):h.createElement("input",{name:u,type:"hidden",value:""});return h.createElement("div",null,g)}else{var m=d[0]?this.getOptionValue(d[0]):"";return h.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return h.createElement(Hy,Je({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,s=r.SelectContainer,l=r.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,g=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return h.createElement(s,Je({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),h.createElement(o,Je({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),h.createElement(l,Je({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),h.createElement(a,Je({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,g=r.options,m=r.value,p=r.menuIsOpen,b=r.inputValue,y=r.isMulti,w=Wu(m),S={};if(a&&(m!==a.value||g!==a.options||p!==a.menuIsOpen||b!==a.inputValue)){var M=p?gC(r,w):[],C=p?ic(ua(r,w),"".concat(f,"-option")):[],x=s?mC(o,w):null,R=pC(o,M),I=xs(C,R);S={selectValue:w,focusedOption:R,focusedOptionId:I,focusableOptionsWithIds:C,focusedValue:x,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},L=u,z=c&&d;return c&&!z&&(L={value:ia(y,w,w[0]||null),options:w,action:"initial-input-focus"},z=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Xe(Xe(Xe({},S),E),{},{prevProps:r,ariaSelection:L,prevWasFocused:z})}}]),n}(h.Component);df.defaultProps=hC;Ah();Hh();zh();$h();Vh();var bC=h.forwardRef(function(e,t){var n=Wb(e);return h.createElement(df,Je({ref:t},n))}),wC=bC;const yC=e=>{const{Menu:t}=Qd,{children:n,...i}=e;return h.createElement(t,{...i},n)},CC=pn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),SC=pn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),xC=pn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),kC=e=>{const{value:t,onFinishedEditing:n,initialValue:i}=e,{allowedValues:r,value:o}=t.data,[a,s]=h.useState(o),[l,u]=h.useState(i??""),c=Mp(),d=h.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?h.createElement(xC,null,h.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):h.createElement(CC,null,h.createElement(wC,{className:"glide-select",inputValue:l,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:g})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:g?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...f[":active"],color:c.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>h.createElement(SC,null,h.createElement(yC,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(g=>window.requestAnimationFrame(g)),n({...t,data:{...t.data,value:f.value}}))}}))},MC={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{value:o}=t.data,a=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),s=typeof a=="string"?a:(a==null?void 0:a.label)??"";return s&&(n.fillStyle=i.textDark,n.fillText(s,r.x+i.cellHorizontalPadding,r.y+r.height/2+pr(n,i))),!0},measure:(e,t,n)=>{const{value:i}=t.data;return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:kC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Kr=6,RC={marginRight:8},EC={display:"flex",alignItems:"center",flexGrow:1},IC={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{min:o,max:a,value:s,label:l,measureLabel:u}=t.data,c=r.x+i.cellHorizontalPadding,d=r.y+r.height/2,f=a-o,g=(s-o)/f;n.save();let m=0;l!==void 0&&(n.font=`12px ${i.fontFamily}`,m=ii(u??l,n,`12px ${i.fontFamily}`).width+i.cellHorizontalPadding);const p=r.width-i.cellHorizontalPadding*2-m;if(p>=Kr){const b=n.createLinearGradient(c,d,c+p,d);b.addColorStop(0,i.accentColor),b.addColorStop(g,i.accentColor),b.addColorStop(g,i.bgBubble),b.addColorStop(1,i.bgBubble),n.beginPath(),n.fillStyle=b,zu(n,c,d-Kr/2,p,Kr,Kr/2),n.fill(),n.beginPath(),zu(n,c+.5,d-Kr/2+.5,p-1,Kr-1,(Kr-1)/2),n.strokeStyle=i.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=i.textDark,n.fillText(l,r.x+r.width-i.cellHorizontalPadding,d+pr(n,`12px ${i.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,i=t.value.toString(),r=t.min.toString(),o=t.max.toString(),a=t.step.toString(),s=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return h.createElement("label",{style:EC},h.createElement("input",{style:RC,type:"range",value:i,min:r,max:o,step:a,onChange:s,disabled:n}),i)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},TC=pn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ks=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},DC=e=>{const t=e.value.data,{format:n,displayDate:i}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ks(n,t.min):t.min,a=t.max instanceof Date?ks(n,t.max):t.max;let s=t.date;const l=t.timezoneOffset?t.timezoneOffset*60*1e3:0;l&&s&&(s=new Date(s.getTime()+l));const u=ks(n,s);return e.value.readonly?te.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:i??"",onChange:()=>{}}):te.createElement(TC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:r,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-l)}})}})},OC={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Jc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:i}=t.data;return e.measureText(i).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:DC}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},PC="None";function ac(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const _C=e=>{const{cell:t,theme:n,ctx:i}=e;Jc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},PC,t.contentAlign),i.fillStyle=n.textDark};function LC(e){const t=te.useCallback((i,r)=>{const{cell:o,theme:a,ctx:s,rect:l}=i,u=i.col;if(Si(o))ac(s,l,a);else if(Aa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?r():_C(i),c.isRequired&&c.isEditable&&ac(s,l,a);return}r()},[e]),n=te.useMemo(()=>[Nb,MC,IC,OC,...ob],[]);return{drawCell:t,customRenderers:n}}function FC(){const e=Da();return te.useMemo(()=>{const n={editable:r=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${r.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:os(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:os(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${e.fontSizes.sm}`,baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:os(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(wr(e.spacing.sm)),cellVerticalPadding:Math.round(wr("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(wr("25rem")),minColumnWidth:Math.round(wr("3.125rem")),maxColumnWidth:Math.round(wr("62.5rem")),maxColumnAutoWidth:Math.round(wr("31.25rem")),defaultRowHeight:Math.round(wr("2.1875rem")),defaultHeaderHeight:Math.round(wr("2.1875rem")),bgRowHovered:Nh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const AC=Us.getLogger("useDataEditor");function HC(e,t,n,i,r,o,a,s,l){const u=te.useCallback(([p,b],y)=>{const w=e[p];if(!w.isEditable)return;const S=w.indexNumber,M=n.current.getOriginalRowIndex(r(b)),C=i([p,b]),x=w.getCellValue(C),R=w.getCellValue(y);if(!Si(C)&&R===x)return;const I=w.getCell(R,!0);Si(I)?AC.warn(`Not applying the cell edit since it causes this error:
|
194
|
+
`]))),qw=function(t,n){var i=t.isFocused,r=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return Xe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?a.neutral60:a.neutral20,padding:s*2})},bs=function(t){var n=t.delay,i=t.offset;return Be("span",{css:kc({animation:"".concat(jw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Kw=function(t){var n=t.innerProps,i=t.isRtl,r=t.size,o=r===void 0?4:r,a=Mr(t,Vw);return Be("div",Je({},nn(Xe(Xe({},a),{},{innerProps:n,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Be(bs,{delay:0,offset:i}),Be(bs,{delay:160,offset:!0}),Be(bs,{delay:320,offset:!i}))},Zw=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return Xe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?a.neutral5:a.neutral0,borderColor:i?a.neutral10:r?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Jw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return Be("div",Je({ref:o},nn(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":s}),a,{"aria-disabled":i||void 0}),n)},Qw=Jw,ey=["data"],ty=function(t,n){var i=t.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},ny=function(t){var n=t.children,i=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Be("div",Je({},nn(t,"group",{group:!0}),l),Be(a,Je({},s,{selectProps:d,theme:c,getStyles:r,getClassNames:o,cx:i}),u),Be("div",null,n))},ry=function(t,n){var i=t.theme,r=i.colors,o=i.spacing;return Xe({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},iy=function(t){var n=Bd(t);n.data;var i=Mr(n,ey);return Be("div",Je({},nn(t,"groupHeading",{"group-heading":!0}),i))},oy=ny,ay=["innerRef","isDisabled","isHidden","inputClassName"],sy=function(t,n){var i=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,s=o.colors;return Xe(Xe({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},ly),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},Zd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},ly={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Xe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Zd)},uy=function(t){return Xe({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Zd)},cy=function(t){var n=t.cx,i=t.value,r=Bd(t),o=r.innerRef,a=r.isDisabled,s=r.isHidden,l=r.inputClassName,u=Mr(r,ay);return Be("div",Je({},nn(t,"input",{"input-container":!0}),{"data-value":i||""}),Be("input",Je({className:n({input:!0},l),ref:o,style:uy(s),disabled:a},u)))},dy=cy,fy=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors;return Xe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},hy=function(t,n){var i=t.theme,r=i.borderRadius,o=i.colors,a=t.cropWithEllipsis;return Xe({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},gy=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors,s=t.isFocused;return Xe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Jd=function(t){var n=t.children,i=t.innerProps;return Be("div",i,n)},my=Jd,py=Jd;function vy(e){var t=e.children,n=e.innerProps;return Be("div",Je({role:"button"},n),t||Be(Cl,{size:14}))}var by=function(t){var n=t.children,i=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,u=i.Container,c=i.Label,d=i.Remove;return Be(u,{data:r,innerProps:Xe(Xe({},nn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},Be(c,{data:r,innerProps:Xe({},nn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Be(d,{data:r,innerProps:Xe(Xe({},nn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},wy=by,yy=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return Xe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},Cy=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return Be("div",Je({},nn(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":i},s),n)},Sy=Cy,xy=function(t,n){var i=t.theme,r=i.spacing,o=i.colors;return Xe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},ky=function(t){var n=t.children,i=t.innerProps;return Be("div",Je({},nn(t,"placeholder",{placeholder:!0}),i),n)},My=ky,Ry=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return Xe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ey=function(t){var n=t.children,i=t.isDisabled,r=t.innerProps;return Be("div",Je({},nn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},Iy=Ey,Qd={ClearIndicator:Xw,Control:Qw,DropdownIndicator:Ww,DownChevron:qd,CrossIcon:Cl,Group:oy,GroupHeading:iy,IndicatorsContainer:zw,IndicatorSeparator:Gw,Input:dy,LoadingIndicator:Kw,Menu:kw,MenuList:Rw,MenuPortal:Pw,LoadingMessage:Dw,NoOptionsMessage:Tw,MultiValue:wy,MultiValueContainer:my,MultiValueLabel:py,MultiValueRemove:vy,Option:Sy,Placeholder:My,SelectContainer:Lw,SingleValue:Iy,ValueContainer:Aw},Ty=function(t){return Xe(Xe({},Qd),t.components)},Gu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dy(e,t){return!!(e===t||Gu(e)&&Gu(t))}function Oy(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dy(e[n],t[n]))return!1;return!0}function Py(e,t){t===void 0&&(t=Oy);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return i.clear=function(){n=null},i}var _y={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Ly=function(t){return Be("span",Je({css:_y},t))},ju=Ly,Fy={guidance:function(t){var n=t.isSearchable,i=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,i=t.label,r=i===void 0?"":i,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,i=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(d(s,i),".");if(n==="menu"&&c){var f=l?" disabled":"",g="".concat(u?" selected":"").concat(f);return"".concat(a).concat(g,", ").concat(d(r,i),".")}return""},onFilter:function(t){var n=t.inputValue,i=t.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Ay=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,b=l.isSearchable,y=l.menuIsOpen,w=l.options,S=l.screenReaderStatus,M=l.tabSelectsValue,C=l.isLoading,x=l["aria-label"],R=l["aria-live"],I=h.useMemo(function(){return Xe(Xe({},Fy),d||{})},[d]),E=h.useMemo(function(){var ne="";if(n&&I.onChange){var Q=n.option,oe=n.options,de=n.removedValue,xe=n.removedValues,ae=n.value,G=function(k){return Array.isArray(k)?null:k},se=de||Q||G(ae),ie=se?f(se):"",be=oe||xe||void 0,we=be?be.map(f):[],j=Xe({isDisabled:se&&p(se,s),label:ie,labels:we},n);ne=I.onChange(j)}return ne},[n,I,p,s,f]),L=h.useMemo(function(){var ne="",Q=i||r,oe=!!(i&&s&&s.includes(i));if(Q&&I.onFocus){var de={focused:Q,label:f(Q),isDisabled:p(Q,s),isSelected:oe,options:o,context:Q===i?"menu":"value",selectValue:s,isAppleDevice:c};ne=I.onFocus(de)}return ne},[i,r,f,p,I,o,s,c]),z=h.useMemo(function(){var ne="";if(y&&w.length&&!C&&I.onFilter){var Q=S({count:o.length});ne=I.onFilter({inputValue:g,resultsMessage:Q})}return ne},[o,g,y,I,w,S,C]),_=(n==null?void 0:n.action)==="initial-input-focus",F=h.useMemo(function(){var ne="";if(I.guidance){var Q=r?"value":y?"menu":"input";ne=I.guidance({"aria-label":x,context:Q,isDisabled:i&&p(i,s),isMulti:m,isSearchable:b,tabSelectsValue:M,isInitialFocus:_})}return ne},[x,i,r,m,p,b,y,I,s,M,_]),P=Be(h.Fragment,null,Be("span",{id:"aria-selection"},E),Be("span",{id:"aria-focused"},L),Be("span",{id:"aria-results"},z),Be("span",{id:"aria-guidance"},F));return Be(h.Fragment,null,Be(ju,{id:u},_&&P),Be(ju,{"aria-live":R,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!_&&P))},Hy=Ay,Ns=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],zy=new RegExp("["+Ns.map(function(e){return e.letters}).join("")+"]","g"),ef={};for(var ws=0;ws<Ns.length;ws++)for(var ys=Ns[ws],Cs=0;Cs<ys.letters.length;Cs++)ef[ys.letters[Cs]]=ys.base;var tf=function(t){return t.replace(zy,function(n){return ef[n]})},$y=Py(tf),qu=function(t){return t.replace(/^\s+|\s+$/g,"")},Vy=function(t){return"".concat(t.label," ").concat(t.value)},Ny=function(t){return function(n,i){if(n.data.__isNew__)return!0;var r=Xe({ignoreCase:!0,ignoreAccents:!0,stringify:Vy,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,s=r.stringify,l=r.trim,u=r.matchFrom,c=l?qu(i):i,d=l?qu(s(n)):s(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=$y(c),d=tf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},By=["innerRef"];function Wy(e){var t=e.innerRef,n=Mr(e,By),i=pw(n,"onExited","in","enter","exit","appear");return Be("input",Je({ref:t},i,{css:kc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Uy=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Xy(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=h.useRef(!1),s=h.useRef(!1),l=h.useRef(0),u=h.useRef(null),c=h.useCallback(function(b,y){if(u.current!==null){var w=u.current,S=w.scrollTop,M=w.scrollHeight,C=w.clientHeight,x=u.current,R=y>0,I=M-C-S,E=!1;I>y&&a.current&&(i&&i(b),a.current=!1),R&&s.current&&(o&&o(b),s.current=!1),R&&y>I?(n&&!a.current&&n(b),x.scrollTop=M,E=!0,a.current=!0):!R&&-y>S&&(r&&!s.current&&r(b),x.scrollTop=0,E=!0,s.current=!0),E&&Uy(b)}},[n,i,r,o]),d=h.useCallback(function(b){c(b,b.deltaY)},[c]),f=h.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),g=h.useCallback(function(b){var y=l.current-b.changedTouches[0].clientY;c(b,y)},[c]),m=h.useCallback(function(b){if(b){var y=hw?{passive:!1}:!1;b.addEventListener("wheel",d,y),b.addEventListener("touchstart",f,y),b.addEventListener("touchmove",g,y)}},[g,f,d]),p=h.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",g,!1))},[g,f,d]);return h.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var Ku=["boxSizing","height","overflow","paddingRight","position"],Zu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ju(e){e.preventDefault()}function Qu(e){e.stopPropagation()}function ec(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function tc(){return"ontouchstart"in window||navigator.maxTouchPoints}var nc=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,pi={capture:!1,passive:!1};function Yy(e){var t=e.isEnabled,n=e.accountForScrollbars,i=n===void 0?!0:n,r=h.useRef({}),o=h.useRef(null),a=h.useCallback(function(l){if(nc){var u=document.body,c=u&&u.style;if(i&&Ku.forEach(function(m){var p=c&&c[m];r.current[m]=p}),i&&ji<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+d||0;Object.keys(Zu).forEach(function(m){var p=Zu[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(g,"px"))}u&&tc()&&(u.addEventListener("touchmove",Ju,pi),l&&(l.addEventListener("touchstart",ec,pi),l.addEventListener("touchmove",Qu,pi))),ji+=1}},[i]),s=h.useCallback(function(l){if(nc){var u=document.body,c=u&&u.style;ji=Math.max(ji-1,0),i&&ji<1&&Ku.forEach(function(d){var f=r.current[d];c&&(c[d]=f)}),u&&tc()&&(u.removeEventListener("touchmove",Ju,pi),l&&(l.removeEventListener("touchstart",ec,pi),l.removeEventListener("touchmove",Qu,pi)))}},[i]);return h.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var Gy=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function qy(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,r=i===void 0?!0:i,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=Xy({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=Yy({isEnabled:n}),d=function(g){u(g),c(g)};return Be(h.Fragment,null,n&&Be("div",{onClick:Gy,css:jy}),t(d))}var Ky={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Zy=function(t){var n=t.name,i=t.onFocus;return Be("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Ky,value:"",onChange:function(){}})},Jy=Zy;function Sl(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Qy(){return Sl(/^iPhone/i)}function nf(){return Sl(/^Mac/i)}function eC(){return Sl(/^iPad/i)||nf()&&navigator.maxTouchPoints>1}function tC(){return Qy()||eC()}function nC(){return nf()||tC()}var rC=function(t){return t.label},iC=function(t){return t.label},oC=function(t){return t.value},aC=function(t){return!!t.isDisabled},sC={clearIndicator:Uw,container:_w,control:Zw,dropdownIndicator:Bw,group:ty,groupHeading:ry,indicatorsContainer:Hw,indicatorSeparator:Yw,input:sy,loadingIndicator:qw,loadingMessage:Iw,menu:Cw,menuList:Mw,menuPortal:Ow,multiValue:fy,multiValueLabel:hy,multiValueRemove:gy,noOptionsMessage:Ew,option:yy,placeholder:xy,singleValue:Ry,valueContainer:Fw},lC={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},uC=4,rf=4,cC=38,dC=rf*2,fC={baseUnit:rf,controlHeight:cC,menuGutter:dC},Ss={borderRadius:uC,colors:lC,spacing:fC},hC={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Xu(),captureMenuScroll:!Xu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Ny(),formatGroupLabel:rC,getOptionLabel:iC,getOptionValue:oC,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:aC,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!dw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function rc(e,t,n,i){var r=sf(e,t,n),o=lf(e,t,n),a=af(e,t),s=Ta(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:s,index:i}}function ua(e,t){return e.options.map(function(n,i){if("options"in n){var r=n.options.map(function(a,s){return rc(e,a,t,s)}).filter(function(a){return oc(e,a)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=rc(e,n,t,i);return oc(e,o)?o:void 0}).filter(gw)}function of(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Xs(n.options.map(function(i){return i.data}))):t.push(n.data),t},[])}function ic(e,t){return e.reduce(function(n,i){return i.type==="group"?n.push.apply(n,Xs(i.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(t,"-").concat(i.index)}),n},[])}function gC(e,t){return of(ua(e,t))}function oc(e,t){var n=e.inputValue,i=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,s=t.value;return(!cf(e)||!o)&&uf(e,{label:a,value:s,data:r},i)}function mC(e,t){var n=e.focusedValue,i=e.selectValue,r=i.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function pC(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var xs=function(t,n){var i,r=(i=t.find(function(o){return o.data===n}))===null||i===void 0?void 0:i.id;return r||null},af=function(t,n){return t.getOptionLabel(n)},Ta=function(t,n){return t.getOptionValue(n)};function sf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function lf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var i=Ta(e,t);return n.some(function(r){return Ta(e,r)===i})}function uf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var cf=function(t){var n=t.hideSelectedOptions,i=t.isMulti;return n===void 0?i:n},vC=1,df=function(e){ng(n,e);var t=og(n);function n(i){var r;if(rg(this,n),r=t.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=nC(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var c=r.props,d=c.onChange,f=c.name;u.name=f,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,c){var d=r.props,f=d.closeMenuOnSelect,g=d.isMulti,m=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:c})},r.selectOption=function(l){var u=r.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,g=r.state.selectValue,m=d&&r.isOptionSelected(l,g),p=r.isOptionDisabled(l,g);if(m){var b=r.getOptionValue(l);r.setValue(g.filter(function(y){return r.getOptionValue(y)!==b}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(Xs(g),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,c=r.state.selectValue,d=r.getOptionValue(l),f=c.filter(function(m){return r.getOptionValue(m)!==d}),g=ia(u,f,f[0]||null);r.onChange(g,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(ia(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=ia(l,d,d[0]||null);c&&r.onChange(f,{action:"pop-value",removedValue:c})},r.getFocusedOptionId=function(l){return xs(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return ic(ua(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return aw.apply(void 0,[r.props.classNamePrefix].concat(u))},r.getOptionLabel=function(l){return af(r.props,l)},r.getOptionValue=function(l){return Ta(r.props,l)},r.getStyles=function(l,u){var c=r.props.unstyled,d=sC[l](u,c);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,u):d},r.getClassNames=function(l,u){var c,d;return(c=(d=r.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Ty(r.props)},r.buildCategorizedOptions=function(){return ua(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return of(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,u){r.setState({ariaSelection:Xe({value:l},u)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():u&&r.openMenu("first"):(u&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var u=r.props,c=u.isMulti,d=u.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&za(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-r.initialTouchX),f=Math.abs(c.clientY-r.initialTouchY),g=5;r.userIsDragging=d>g||f>g}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,c=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),c=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:c>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return cf(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,g=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,y=u.onKeyDown,w=u.tabSelectsValue,S=u.openMenuOnFocus,M=r.state,C=M.focusedOption,x=M.focusedValue,R=M.selectValue;if(!p&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||g)return;r.focusValue("previous");break;case"ArrowRight":if(!c||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(x)r.removeValue(x);else{if(!d)return;c?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!w||!C||S&&r.isOptionSelected(C,R))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(b){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(g)return;if(!b){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++vC),r.state.selectValue=Wu(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),s=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[s],r.state.focusedOptionId=xs(o,a[s])}return r}return ig(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Uu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&s&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Uu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(r){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),r==="up"?l=u>0?u-1:s.length-1:r==="down"?l=(u+1)%s.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):r==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ss):Xe(Xe({},Ss),this.props.theme):Ss}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,g=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return sf(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return lf(this.props,r,o)}},{key:"filterOption",value:function(r,o){return uf(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,s=r.inputId,l=r.inputValue,u=r.tabIndex,c=r.form,d=r.menuIsOpen,f=r.required,g=this.getComponents(),m=g.Input,p=this.state,b=p.inputIsHidden,y=p.ariaSelection,w=this.commonProps,S=s||this.getElementId("input"),M=Xe(Xe(Xe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?h.createElement(m,Je({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},M)):h.createElement(Wy,Je({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ea,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},M))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,b=g.isMulti,y=g.inputValue,w=g.placeholder,S=this.state,M=S.selectValue,C=S.focusedValue,x=S.isFocused;if(!this.hasValue()||!m)return y?null:h.createElement(d,Je({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return M.map(function(I,E){var L=I===C,z="".concat(r.getOptionLabel(I),"-").concat(r.getOptionValue(I));return h.createElement(a,Je({},f,{components:{Container:s,Label:l,Remove:u},isFocused:L,isDisabled:p,key:z,index:E,removeProps:{onClick:function(){return r.removeValue(I)},onTouchEnd:function(){return r.removeValue(I)},onMouseDown:function(F){F.preventDefault()}},data:I}),r.formatOptionLabel(I,"value"))});if(y)return null;var R=M[0];return h.createElement(c,Je({},f,{data:R,isDisabled:p}),this.formatOptionLabel(R,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return h.createElement(a,Je({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Je({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,y=b.captureMenuScroll,w=b.inputValue,S=b.isLoading,M=b.loadingMessage,C=b.minMenuHeight,x=b.maxMenuHeight,R=b.menuIsOpen,I=b.menuPlacement,E=b.menuPosition,L=b.menuPortalTarget,z=b.menuShouldBlockScroll,_=b.menuShouldScrollIntoView,F=b.noOptionsMessage,P=b.onMenuScrollToTop,ne=b.onMenuScrollToBottom;if(!R)return null;var Q=function(ie,be){var we=ie.type,j=ie.data,O=ie.isDisabled,k=ie.isSelected,N=ie.label,re=ie.value,Oe=p===j,Ve=O?void 0:function(){return r.onOptionHover(j)},he=O?void 0:function(){return r.selectOption(j)},tt="".concat(r.getElementId("option"),"-").concat(be),ke={id:tt,onClick:he,onMouseMove:Ve,onMouseOver:Ve,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:k};return h.createElement(g,Je({},m,{innerProps:ke,data:j,isDisabled:O,isSelected:k,key:tt,label:N,type:we,value:re,isFocused:Oe,innerRef:Oe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(ie.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var ie=se.data,be=se.options,we=se.index,j="".concat(r.getElementId("group"),"-").concat(we),O="".concat(j,"-heading");return h.createElement(a,Je({},m,{key:j,data:ie,options:be,Heading:s,headingProps:{id:O,data:se.data},label:r.formatGroupLabel(se.data)}),se.options.map(function(k){return Q(k,"".concat(we,"-").concat(k.index))}))}else if(se.type==="option")return Q(se,"".concat(se.index))});else if(S){var de=M({inputValue:w});if(de===null)return null;oe=h.createElement(d,m,de)}else{var xe=F({inputValue:w});if(xe===null)return null;oe=h.createElement(f,m,xe)}var ae={minMenuHeight:C,maxMenuHeight:x,menuPlacement:I,menuPosition:E,menuShouldScrollIntoView:_},G=h.createElement(Sw,Je({},m,ae),function(se){var ie=se.ref,be=se.placerProps,we=be.placement,j=be.maxHeight;return h.createElement(l,Je({},m,ae,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:we}),h.createElement(qy,{captureEnabled:y,onTopArrive:P,onBottomArrive:ne,lockEnabled:z},function(O){return h.createElement(u,Je({},m,{innerRef:function(N){r.getMenuListRef(N),O(N)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:j,focusedOption:p}),oe)}))});return L||E==="fixed"?h.createElement(c,Je({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:I,menuPosition:E}),G):G}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return h.createElement(Jy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var f=d.map(function(p){return r.getOptionValue(p)}).join(a);return h.createElement("input",{name:u,type:"hidden",value:f})}else{var g=d.length>0?d.map(function(p,b){return h.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:r.getOptionValue(p)})}):h.createElement("input",{name:u,type:"hidden",value:""});return h.createElement("div",null,g)}else{var m=d[0]?this.getOptionValue(d[0]):"";return h.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return h.createElement(Hy,Je({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,s=r.SelectContainer,l=r.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,g=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return h.createElement(s,Je({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),h.createElement(o,Je({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),h.createElement(l,Je({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),h.createElement(a,Je({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,g=r.options,m=r.value,p=r.menuIsOpen,b=r.inputValue,y=r.isMulti,w=Wu(m),S={};if(a&&(m!==a.value||g!==a.options||p!==a.menuIsOpen||b!==a.inputValue)){var M=p?gC(r,w):[],C=p?ic(ua(r,w),"".concat(f,"-option")):[],x=s?mC(o,w):null,R=pC(o,M),I=xs(C,R);S={selectValue:w,focusedOption:R,focusedOptionId:I,focusableOptionsWithIds:C,focusedValue:x,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},L=u,z=c&&d;return c&&!z&&(L={value:ia(y,w,w[0]||null),options:w,action:"initial-input-focus"},z=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Xe(Xe(Xe({},S),E),{},{prevProps:r,ariaSelection:L,prevWasFocused:z})}}]),n}(h.Component);df.defaultProps=hC;Ah();Hh();zh();$h();Vh();var bC=h.forwardRef(function(e,t){var n=Wb(e);return h.createElement(df,Je({ref:t},n))}),wC=bC;const yC=e=>{const{Menu:t}=Qd,{children:n,...i}=e;return h.createElement(t,{...i},n)},CC=pn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),SC=pn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),xC=pn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),kC=e=>{const{value:t,onFinishedEditing:n,initialValue:i}=e,{allowedValues:r,value:o}=t.data,[a,s]=h.useState(o),[l,u]=h.useState(i??""),c=Mp(),d=h.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?h.createElement(xC,null,h.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):h.createElement(CC,null,h.createElement(wC,{className:"glide-select",inputValue:l,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:g})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:g?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...f[":active"],color:c.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>h.createElement(SC,null,h.createElement(yC,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(g=>window.requestAnimationFrame(g)),n({...t,data:{...t.data,value:f.value}}))}}))},MC={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{value:o}=t.data,a=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),s=typeof a=="string"?a:(a==null?void 0:a.label)??"";return s&&(n.fillStyle=i.textDark,n.fillText(s,r.x+i.cellHorizontalPadding,r.y+r.height/2+vr(n,i))),!0},measure:(e,t,n)=>{const{value:i}=t.data;return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:kC,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Kr=6,RC={marginRight:8},EC={display:"flex",alignItems:"center",flexGrow:1},IC={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{min:o,max:a,value:s,label:l,measureLabel:u}=t.data,c=r.x+i.cellHorizontalPadding,d=r.y+r.height/2,f=a-o,g=(s-o)/f;n.save();let m=0;l!==void 0&&(n.font=`12px ${i.fontFamily}`,m=ii(u??l,n,`12px ${i.fontFamily}`).width+i.cellHorizontalPadding);const p=r.width-i.cellHorizontalPadding*2-m;if(p>=Kr){const b=n.createLinearGradient(c,d,c+p,d);b.addColorStop(0,i.accentColor),b.addColorStop(g,i.accentColor),b.addColorStop(g,i.bgBubble),b.addColorStop(1,i.bgBubble),n.beginPath(),n.fillStyle=b,zu(n,c,d-Kr/2,p,Kr,Kr/2),n.fill(),n.beginPath(),zu(n,c+.5,d-Kr/2+.5,p-1,Kr-1,(Kr-1)/2),n.strokeStyle=i.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=i.textDark,n.fillText(l,r.x+r.width-i.cellHorizontalPadding,d+vr(n,`12px ${i.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,i=t.value.toString(),r=t.min.toString(),o=t.max.toString(),a=t.step.toString(),s=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return h.createElement("label",{style:EC},h.createElement("input",{style:RC,type:"range",value:i,min:r,max:o,step:a,onChange:s,disabled:n}),i)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},TC=pn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ks=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},DC=e=>{const t=e.value.data,{format:n,displayDate:i}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ks(n,t.min):t.min,a=t.max instanceof Date?ks(n,t.max):t.max;let s=t.date;const l=t.timezoneOffset?t.timezoneOffset*60*1e3:0;l&&s&&(s=new Date(s.getTime()+l));const u=ks(n,s);return e.value.readonly?te.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:i??"",onChange:()=>{}}):te.createElement(TC,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:r,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-l)}})}})},OC={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Jc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:i}=t.data;return e.measureText(i).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:DC}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},PC="None";function ac(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const _C=e=>{const{cell:t,theme:n,ctx:i}=e;Jc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},PC,t.contentAlign),i.fillStyle=n.textDark};function LC(e){const t=te.useCallback((i,r)=>{const{cell:o,theme:a,ctx:s,rect:l}=i,u=i.col;if(Si(o))ac(s,l,a);else if(Aa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?r():_C(i),c.isRequired&&c.isEditable&&ac(s,l,a);return}r()},[e]),n=te.useMemo(()=>[Nb,MC,IC,OC,...ob],[]);return{drawCell:t,customRenderers:n}}function FC(){const e=Da();return te.useMemo(()=>{const n={editable:r=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${r.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:os(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:os(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${or(e.fontSizes.sm)}px`,baseFontStyle:`${or(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:os(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(or(e.spacing.sm)),cellVerticalPadding:Math.round(or("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(or("25rem")),minColumnWidth:Math.round(or("3.125rem")),maxColumnWidth:Math.round(or("62.5rem")),maxColumnAutoWidth:Math.round(or("31.25rem")),defaultRowHeight:Math.round(or("2.1875rem")),defaultHeaderHeight:Math.round(or("2.1875rem")),bgRowHovered:Nh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const AC=Us.getLogger("useDataEditor");function HC(e,t,n,i,r,o,a,s,l){const u=te.useCallback(([p,b],y)=>{const w=e[p];if(!w.isEditable)return;const S=w.indexNumber,M=n.current.getOriginalRowIndex(r(b)),C=i([p,b]),x=w.getCellValue(C),R=w.getCellValue(y);if(!Si(C)&&R===x)return;const I=w.getCell(R,!0);Si(I)?AC.warn(`Not applying the cell edit since it causes this error:
|
195
195
|
${I.data}`):(n.current.setCell(S,M,{...I,lastUpdated:performance.now()}),s())},[e,n,r,i,s]),c=te.useCallback(()=>{if(t)return;const p=new Map;e.forEach(b=>{p.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=te.useCallback(()=>{t||(c(),s())},[c,s,t]),f=te.useCallback(p=>{var b;if(p.rows.length>0){if(t)return!0;const y=p.rows.toArray().map(w=>n.current.getOriginalRowIndex(r(w)));return n.current.deleteRows(y),a(),l(),s(),!1}if((b=p.current)!=null&&b.range){const y=[],w=p.current.range;for(let S=w.y;S<w.y+w.height;S++)for(let M=w.x;M<w.x+w.width;M++){const C=e[M];C.isEditable&&!C.isRequired&&(y.push({cell:[M,S]}),u([M,S],C.getCell(null)))}return y.length>0&&(s(),o(y)),!1}return!0},[e,n,t,o,r,s,u,l,a]),g=te.useCallback((p,b)=>{const[y,w]=p,S=[];for(let M=0;M<b.length;M++){const C=b[M];if(M+w>=n.current.getNumRows()){if(t)break;c()}for(let x=0;x<C.length;x++){const R=C[x],I=M+w,E=x+y;if(E>=e.length)break;const L=e[E];if(L.isEditable){const z=L.getCell(R,!0);if(xt(z)&&!Si(z)){const _=L.indexNumber,F=n.current.getOriginalRowIndex(r(I)),P=L.getCellValue(i([E,I]));L.getCellValue(z)!==P&&(n.current.setCell(_,F,{...z,lastUpdated:performance.now()}),S.push({cell:[E,I]}))}}}S.length>0&&(s(),o(S))}return!1},[e,n,t,r,i,c,s,o]),m=te.useCallback((p,b)=>{const y=p[0];if(y>=e.length)return!0;const w=e[y];if(w.validateInput){const S=w.validateInput(w.getCellValue(b));return S===!0||S===!1?S:w.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:g,onRowAppended:d,onDelete:f,validateCell:m}}const ff=",",Ji='"',zC='"',hf=`
|
196
|
-
`,$C="\uFEFF",VC=new RegExp(`[${[ff,Ji,hf].join("")}]`),sc=Us.getLogger("useDataExporter");function lc(e){return e.map(t=>NC(t)).join(ff)+hf}function NC(e){if(Qe(e))return"";const t=Et(e);return VC.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),zC+Ji)}${Ji}`:t}async function uc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode($C));const o=n.map(a=>a.name);await e.write(r.encode(lc(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,u,c)=>{s.push(l.getCellValue(t([u,a])))}),await e.write(r.encode(lc(s)))}await e.close()}function BC(e,t,n,i){return{exportToCsv:te.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ws(()=>import("./es6.
|
197
|
-
Error: ${f}`)}},[t,n,e,i])}}function UC(e){const[t,n]=te.useState(void 0),i=te.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:te.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:i}}function XC(e,t,n,i,r){const[o,a]=te.useState({columns:yt.empty(),rows:yt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Yn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Yn.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Yn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Yn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Yn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Yn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,g=o.current!==void 0,m=te.useCallback(b=>{const y=!as(b.rows.toArray(),o.rows.toArray()),w=!as(b.columns.toArray(),o.columns.toArray()),S=!as(b.current,o.current);let M=s&&y||u&&w,C=b;if((s||u)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),w&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,u,r,i]),p=te.useCallback((b=!1,y=!1)=>{const w={columns:y?o.columns:yt.empty(),rows:b?o.rows:yt.empty(),current:void 0};a(w),(!b&&s||!y&&u)&&r(w)},[o,s,u,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:g,clearSelection:p,processSelectionChange:m}}function YC(e,t,n,i,r,o,a){const s=t.defaultRowHeight,l=t.defaultHeaderHeight+s+2*t.tableBorderWidth,u=i?2:1,c=e.editingMode===Yn.EditingMode.DYNAMIC?1:0,d=n+c;let f=Math.max(d*s+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),g=Math.min(f,t.defaultTableHeight);e.height&&(g=Math.max(e.height,l),f=Math.max(e.height,f)),o&&(g=Math.min(g,o),f=Math.min(f,o),e.height||(g=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(r,m);let b,y=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),y=Math.min(Math.max(e.width,y),p));const[w,S]=te.useState({width:b||"100%",height:g});return te.useLayoutEffect(()=>{e.useContainerWidth&&w.width==="100%"&&S(M=>({...M,width:p}))},[p]),te.useLayoutEffect(()=>{S(M=>({...M,width:b||"100%"}))},[b]),te.useLayoutEffect(()=>{S(M=>({...M,height:g}))},[g,n]),te.useLayoutEffect(()=>{if(a){const M=e.useContainerWidth||xt(e.width)&&e.width>0;S({width:M?y:"100%",height:f})}else S({width:b||"100%",height:g})},[a]),{minHeight:l,maxHeight:f,minWidth:m,maxWidth:y,rowHeight:s,resizableSize:w,setResizableSize:S}}const GC=600,jC="⚠️ Please fill out this cell.";function qC(e,t){const[n,i]=te.useState(),r=te.useRef(null),o=te.useCallback(s=>{if(clearTimeout(r.current),r.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const l=s.location[0],u=s.location[1];let c;if(l<0||l>=e.length)return;const d=e[l];if(s.kind==="header"&&xt(d))c=d.help;else if(s.kind==="cell"){const f=t([l,u]);Si(f)?c=f.errorDetails:d.isRequired&&d.isEditable&&Aa(f)?c=jC:q1(f)&&(c=f.tooltip)}c&&(r.current=setTimeout(()=>{c&&i({content:c,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},GC))}},[e,t,i,r]),a=te.useCallback(()=>{i(void 0)},[i]);return{tooltip:n,clearTooltip:a,onItemHovered:o}}function KC({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=te.useState(!0),a=Da(),{colors:s,fontSizes:l,radii:u,fontWeights:c}=a,d=te.useCallback(()=>{o(!1),i()},[i,o]);return Jt(bc,{content:Jt(Wh,{"data-testid":"stDataFrameTooltipContent",children:Jt(Uh,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:mc.top,accessibilityType:pc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:vc(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:Jt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const cc=150,ZC=15e4,oa=6;function JC({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:u,height:c}=qh(Kh),d=te.useRef(null),f=te.useRef(null),g=te.useRef(null),m=FC(),{getRowThemeOverride:p,onItemHovered:b}=UC(m),{libConfig:{enforceDownloadInNewTab:y=!1}}=te.useContext(Xh),[w,S]=te.useState(!0),[M,C]=te.useState(!1),[x,R]=te.useState(!1),[I,E]=te.useState(!1),[L,z]=te.useState(),_=te.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),F=te.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Qe(e.editingMode)&&(e.editingMode=Yn.EditingMode.READ_ONLY);const{READ_ONLY:P,DYNAMIC:ne}=Yn.EditingMode,Q=t.dimensions,oe=Math.max(0,Q.numDataRows),de=oe===0&&!(e.editingMode===ne&&Q.numDataColumns>0),xe=oe>ZC,ae=!xe&&!de&&e.editingMode!==ne,G=te.useRef(new ea(oe)),[se,ie]=te.useState(G.current.getNumRows());te.useEffect(()=>{G.current=new ea(oe),ie(G.current.getNumRows())},[oe]);const be=te.useCallback(()=>{G.current=new ea(oe),ie(G.current.getNumRows())},[oe]),[we,j]=te.useState(e.columnOrder),{columns:O,setColumnConfigMapping:k}=Ob(e,t,n,we);te.useEffect(()=>{if(e.editingMode===P)return;const fe=i.getStringValue({id:e.id,formId:e.formId});fe&&(G.current.fromJson(fe,O),ie(G.current.getNumRows()))},[]);const{getCellContent:N}=WC(t,O,se,G),{columns:re,sortColumn:Oe,getOriginalIndex:Ve,getCellContent:he}=Vb(oe,O,N),tt=te.useCallback(fe=>{const Ne={selection:{rows:[],columns:[]}};Ne.selection.rows=fe.rows.toArray().map(ln=>Ve(ln)),Ne.selection.columns=fe.columns.toArray().map(ln=>oo(re[ln]));const Kt=JSON.stringify(Ne),En=i.getStringValue({id:e.id,formId:e.formId});(En===void 0||En!==Kt)&&i.setStringValue({id:e.id,formId:e.formId},Kt,{fromUi:!0},o)},[re,e.id,e.formId,i,o,Ve]),{debouncedCallback:ke}=Iu(tt,cc),{gridSelection:Dt,isRowSelectionActivated:bt,isMultiRowSelectionActivated:rt,isColumnSelectionActivated:J,isMultiColumnSelectionActivated:it,isRowSelected:ce,isColumnSelected:le,isCellSelected:me,clearSelection:De,processSelectionChange:Ae}=XC(e,de,n,re,ke);te.useEffect(()=>{De(!0,!0)},[a]);const nt=te.useCallback(fe=>{var Ne;(Ne=f.current)==null||Ne.updateCells(fe)},[]);te.useEffect(()=>{var Ne,Kt,En,ln;if(!bt&&!J)return;const fe=i.getStringValue({id:e.id,formId:e.formId});if(fe){const A=re.map(un=>oo(un)),je=JSON.parse(fe);let $e=yt.empty(),Ot=yt.empty();(Kt=(Ne=je.selection)==null?void 0:Ne.rows)==null||Kt.forEach(un=>{$e=$e.add(un)}),(ln=(En=je.selection)==null?void 0:En.columns)==null||ln.forEach(un=>{Ot=Ot.add(A.indexOf(un))}),($e.length>0||Ot.length>0)&&Ae({rows:$e,columns:Ot,current:void 0})}},[]);const ge=te.useCallback(()=>{se!==G.current.getNumRows()&&ie(G.current.getNumRows())},[se]),Re=te.useCallback(()=>{const fe=G.current.toJson(re);let Ne=i.getStringValue({id:e.id,formId:e.formId});Ne===void 0&&(Ne=new ea(0).toJson([])),fe!==Ne&&i.setStringValue({id:e.id,formId:e.formId},fe,{fromUi:!0},o)},[re,e.id,e.formId,i,o]),{debouncedCallback:lt}=Iu(Re,cc),{exportToCsv:He}=BC(he,re,se,y),{onCellEdited:et,onPaste:wt,onRowAppended:dt,onDelete:ze,validateCell:Pt}=HC(re,e.editingMode!==ne,G,he,Ve,nt,ge,lt,De),{tooltip:_t,clearTooltip:mt,onItemHovered:Lt}=qC(re,he),{drawCell:rn,customRenderers:zt}=LC(re),Cn=h.useCallback(fe=>({...fe,hasMenu:!de}),[de]),Ut=te.useMemo(()=>re.map(fe=>Cn(zs(fe))),[re,Cn]),{columns:kt,onColumnResize:Pn}=Lb(Ut),Sn=t.dimensions.numHeaderRows>1,{minHeight:Pe,maxHeight:Ft,minWidth:gn,maxWidth:vn,rowHeight:hn,resizableSize:ot,setResizableSize:Gt}=YC(e,m,se,Sn,u,c,a),At=te.useCallback(([fe,Ne])=>({...K1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(re.length-1,0)]}),[re,m.glideTheme.textLight]),on=te.useCallback(()=>{be(),De()},[be,De]);Gh({element:e,widgetMgr:i,onFormCleared:on});const It=!de&&e.editingMode===ne&&!n,{pinColumn:$t,unpinColumn:Ge,freezeColumns:Nt}=Pb(re,de,u,m.minColumnWidth,De,k),{onColumnMoved:Bt}=_b(re,Nt,$t,Ge,j);return te.useEffect(()=>{setTimeout(()=>{var fe,Ne;if(g.current&&f.current){const Kt=(Ne=(fe=g.current)==null?void 0:fe.querySelector(".dvn-stack"))==null?void 0:Ne.getBoundingClientRect();Kt&&(R(Kt.height>g.current.clientHeight),E(Kt.width>g.current.clientWidth))}},1)},[ot,se,kt]),Hr(Tu,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:F,ref:g,onMouseDown:fe=>{if(g.current&&F){const Ne=g.current.getBoundingClientRect();I&&Ne.height-(oa+1)<fe.clientY-Ne.top&&fe.stopPropagation(),x&&Ne.width-(oa+1)<fe.clientX-Ne.left&&fe.stopPropagation()}},onBlur:fe=>{!w&&!_&&!fe.currentTarget.contains(fe.relatedTarget)&&De(!0,!0)},children:[Hr(Zh,{isFullScreen:a,disableFullscreenMode:r,locked:ce&&!bt||me||_&&w,onExpand:s,onCollapse:l,target:Tu,children:[(bt&&ce||J&&le)&&Jt(Wi,{label:"Clear selection",icon:tg,onClick:()=>{De(),mt()}}),It&&ce&&Jt(Wi,{label:"Delete row(s)",icon:ag,onClick:()=>{ze&&(ze(Dt),mt())}}),It&&!ce&&Jt(Wi,{label:"Add row",icon:Mc,onClick:()=>{dt&&(S(!0),dt(),mt())}}),!xe&&!de&&Jt(Wi,{label:"Download as CSV",icon:sg,onClick:()=>He()}),!de&&Jt(Wi,{label:"Search",icon:Rc,onClick:()=>{M?C(!1):(S(!0),C(!0)),mt()}})]}),Jt(Yh,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:ot,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Pe,maxHeight:Ft,minWidth:gn,maxWidth:vn,size:ot,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,hn],snapGap:hn/3,onResizeStop:(fe,Ne,Kt,En)=>{if(d.current){const ln=2*m.tableBorderWidth;Gt({width:d.current.size.width,height:Ft-d.current.size.height===ln?d.current.size.height+ln:d.current.size.height})}},children:Jt(N1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:kt,rows:de?1:se,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:hn,headerHeight:m.defaultHeaderHeight,getCellContent:de?At:he,onColumnResize:_?void 0:Pn,resizeIndicator:"header",freezeColumns:Nt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:_?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:J?void 0:Bt,onItemHovered:fe=>{b==null||b(fe),Lt==null||Lt(fe)},keybindings:{downFill:!0},onKeyDown:fe=>{(fe.ctrlKey||fe.metaKey)&&fe.key==="f"&&(C(Ne=>!Ne),fe.stopPropagation(),fe.preventDefault())},showSearch:M,onSearchClose:()=>{C(!1),mt()},onHeaderClicked:(fe,Ne)=>{!ae||J||(bt&&ce?De():De(!0,!0),Oe(fe,"auto"))},gridSelection:Dt,onGridSelectionChange:fe=>{(w||_)&&(Ae(fe),_t!==void 0&&mt())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:fe=>{fe.kind==="out-of-bounds"&&w?S(!1):fe.kind!=="out-of-bounds"&&!w&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...F&&{paddingBottom:I?-oa:void 0,paddingRight:x?-oa:void 0}},drawCell:rn,customRenderers:zt,imageEditorOverride:ib,headerIcons:m.headerIcons,validateCell:Pt,onHeaderMenuClick:(fe,Ne)=>{z({columnIdx:fe,headerBounds:Ne})},onPaste:!1,...bt&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:rt?"multi":"auto",rowSelect:n?"none":rt?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...J&&{columnSelect:n?"none":it?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!de&&e.editingMode!==P&&!n&&{fillHandle:!_,onCellEdited:et,onPaste:wt,onDelete:ze},...!de&&e.editingMode===ne&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:dt,onHeaderClicked:void 0}})}),_t&&_t.content&&Jt(KC,{top:_t.top,left:_t.left,content:_t.content,clearTooltip:mt}),L&&xc.createPortal(Jt(X1,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,onCloseMenu:()=>z(void 0),onSortColumn:ae?fe=>{De(!0,!0),Oe(L.columnIdx,fe,!0)}:void 0,isColumnPinned:O[L.columnIdx].isPinned,onUnpinColumn:()=>{Ge(O[L.columnIdx].id)},onPinColumn:()=>{$t(O[L.columnIdx].id)}}),document.querySelector("#portal"))]})}const QC=jh(JC),fS=Object.freeze(Object.defineProperty({__proto__:null,default:QC},Symbol.toStringTag,{value:"Module"}));export{pv as C,od as T,wi as a,bg as b,fS as c,vi as i,kp as m,pn as s};
|
196
|
+
`,$C="\uFEFF",VC=new RegExp(`[${[ff,Ji,hf].join("")}]`),sc=Us.getLogger("useDataExporter");function lc(e){return e.map(t=>NC(t)).join(ff)+hf}function NC(e){if(Qe(e))return"";const t=Et(e);return VC.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),zC+Ji)}${Ji}`:t}async function uc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode($C));const o=n.map(a=>a.name);await e.write(r.encode(lc(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,u,c)=>{s.push(l.getCellValue(t([u,a])))}),await e.write(r.encode(lc(s)))}await e.close()}function BC(e,t,n,i){return{exportToCsv:te.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ws(()=>import("./es6.D57lNoID.js").then(c=>c.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await uc(u,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{sc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",s);let l="";const u=new WritableStream({write:async g=>{l+=new TextDecoder("utf-8").decode(g)},close:async()=>{}});await uc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=eg({enforceDownloadInNewTab:i,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(l){sc.error("Failed to export data as CSV",l)}}},[t,n,e,i])}}function WC(e,t,n,i){return{getCellContent:te.useCallback(([o,a])=>{var d;if(o>t.length-1)return Vt("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return Vt("Row index out of bounds","This error should never happen. Please report this bug.");const s=t[o],l=s.indexNumber,u=i.current.getOriginalRowIndex(a),c=i.current.isAddedRow(u);if(s.isEditable||c){const f=i.current.getCell(l,u);if(xt(f))return f;if(c)return Vt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}try{const f=e.getCell(u,l),g=Bh(e,u,l);return Rb(s,f,g,(d=e.styler)==null?void 0:d.cssStyles)}catch(f){return Vt("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
+
Error: ${f}`)}},[t,n,e,i])}}function UC(e){const[t,n]=te.useState(void 0),i=te.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:te.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:i}}function XC(e,t,n,i,r){const[o,a]=te.useState({columns:yt.empty(),rows:yt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Yn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Yn.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Yn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Yn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Yn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Yn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,g=o.current!==void 0,m=te.useCallback(b=>{const y=!as(b.rows.toArray(),o.rows.toArray()),w=!as(b.columns.toArray(),o.columns.toArray()),S=!as(b.current,o.current);let M=s&&y||u&&w,C=b;if((s||u)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),w&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,u,r,i]),p=te.useCallback((b=!1,y=!1)=>{const w={columns:y?o.columns:yt.empty(),rows:b?o.rows:yt.empty(),current:void 0};a(w),(!b&&s||!y&&u)&&r(w)},[o,s,u,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:g,clearSelection:p,processSelectionChange:m}}function YC(e,t,n,i,r,o,a){const s=t.defaultRowHeight,l=t.defaultHeaderHeight+s+2*t.tableBorderWidth,u=i?2:1,c=e.editingMode===Yn.EditingMode.DYNAMIC?1:0,d=n+c;let f=Math.max(d*s+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),g=Math.min(f,t.defaultTableHeight);e.height&&(g=Math.max(e.height,l),f=Math.max(e.height,f)),o&&(g=Math.min(g,o),f=Math.min(f,o),e.height||(g=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(r,m);let b,y=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),y=Math.min(Math.max(e.width,y),p));const[w,S]=te.useState({width:b||"100%",height:g});return te.useLayoutEffect(()=>{e.useContainerWidth&&w.width==="100%"&&S(M=>({...M,width:p}))},[p]),te.useLayoutEffect(()=>{S(M=>({...M,width:b||"100%"}))},[b]),te.useLayoutEffect(()=>{S(M=>({...M,height:g}))},[g,n]),te.useLayoutEffect(()=>{if(a){const M=e.useContainerWidth||xt(e.width)&&e.width>0;S({width:M?y:"100%",height:f})}else S({width:b||"100%",height:g})},[a]),{minHeight:l,maxHeight:f,minWidth:m,maxWidth:y,rowHeight:s,resizableSize:w,setResizableSize:S}}const GC=600,jC="⚠️ Please fill out this cell.";function qC(e,t){const[n,i]=te.useState(),r=te.useRef(null),o=te.useCallback(s=>{if(clearTimeout(r.current),r.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const l=s.location[0],u=s.location[1];let c;if(l<0||l>=e.length)return;const d=e[l];if(s.kind==="header"&&xt(d))c=d.help;else if(s.kind==="cell"){const f=t([l,u]);Si(f)?c=f.errorDetails:d.isRequired&&d.isEditable&&Aa(f)?c=jC:q1(f)&&(c=f.tooltip)}c&&(r.current=setTimeout(()=>{c&&i({content:c,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},GC))}},[e,t,i,r]),a=te.useCallback(()=>{i(void 0)},[i]);return{tooltip:n,clearTooltip:a,onItemHovered:o}}function KC({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=te.useState(!0),a=Da(),{colors:s,fontSizes:l,radii:u,fontWeights:c}=a,d=te.useCallback(()=>{o(!1),i()},[i,o]);return Jt(bc,{content:Jt(Wh,{"data-testid":"stDataFrameTooltipContent",children:Jt(Uh,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:mc.top,accessibilityType:pc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:vc(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:Jt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const cc=150,ZC=15e4,oa=6;function JC({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:u,height:c}=qh(Kh),d=te.useRef(null),f=te.useRef(null),g=te.useRef(null),m=FC(),{getRowThemeOverride:p,onItemHovered:b}=UC(m),{libConfig:{enforceDownloadInNewTab:y=!1}}=te.useContext(Xh),[w,S]=te.useState(!0),[M,C]=te.useState(!1),[x,R]=te.useState(!1),[I,E]=te.useState(!1),[L,z]=te.useState(),_=te.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),F=te.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Qe(e.editingMode)&&(e.editingMode=Yn.EditingMode.READ_ONLY);const{READ_ONLY:P,DYNAMIC:ne}=Yn.EditingMode,Q=t.dimensions,oe=Math.max(0,Q.numDataRows),de=oe===0&&!(e.editingMode===ne&&Q.numDataColumns>0),xe=oe>ZC,ae=!xe&&!de&&e.editingMode!==ne,G=te.useRef(new ea(oe)),[se,ie]=te.useState(G.current.getNumRows());te.useEffect(()=>{G.current=new ea(oe),ie(G.current.getNumRows())},[oe]);const be=te.useCallback(()=>{G.current=new ea(oe),ie(G.current.getNumRows())},[oe]),[we,j]=te.useState(e.columnOrder),{columns:O,setColumnConfigMapping:k}=Ob(e,t,n,we);te.useEffect(()=>{if(e.editingMode===P)return;const fe=i.getStringValue({id:e.id,formId:e.formId});fe&&(G.current.fromJson(fe,O),ie(G.current.getNumRows()))},[]);const{getCellContent:N}=WC(t,O,se,G),{columns:re,sortColumn:Oe,getOriginalIndex:Ve,getCellContent:he}=Vb(oe,O,N),tt=te.useCallback(fe=>{const Ne={selection:{rows:[],columns:[]}};Ne.selection.rows=fe.rows.toArray().map(ln=>Ve(ln)),Ne.selection.columns=fe.columns.toArray().map(ln=>oo(re[ln]));const Kt=JSON.stringify(Ne),En=i.getStringValue({id:e.id,formId:e.formId});(En===void 0||En!==Kt)&&i.setStringValue({id:e.id,formId:e.formId},Kt,{fromUi:!0},o)},[re,e.id,e.formId,i,o,Ve]),{debouncedCallback:ke}=Iu(tt,cc),{gridSelection:Dt,isRowSelectionActivated:bt,isMultiRowSelectionActivated:rt,isColumnSelectionActivated:J,isMultiColumnSelectionActivated:it,isRowSelected:ce,isColumnSelected:le,isCellSelected:me,clearSelection:De,processSelectionChange:Ae}=XC(e,de,n,re,ke);te.useEffect(()=>{De(!0,!0)},[a]);const nt=te.useCallback(fe=>{var Ne;(Ne=f.current)==null||Ne.updateCells(fe)},[]);te.useEffect(()=>{var Ne,Kt,En,ln;if(!bt&&!J)return;const fe=i.getStringValue({id:e.id,formId:e.formId});if(fe){const A=re.map(un=>oo(un)),je=JSON.parse(fe);let $e=yt.empty(),Ot=yt.empty();(Kt=(Ne=je.selection)==null?void 0:Ne.rows)==null||Kt.forEach(un=>{$e=$e.add(un)}),(ln=(En=je.selection)==null?void 0:En.columns)==null||ln.forEach(un=>{Ot=Ot.add(A.indexOf(un))}),($e.length>0||Ot.length>0)&&Ae({rows:$e,columns:Ot,current:void 0})}},[]);const ge=te.useCallback(()=>{se!==G.current.getNumRows()&&ie(G.current.getNumRows())},[se]),Re=te.useCallback(()=>{const fe=G.current.toJson(re);let Ne=i.getStringValue({id:e.id,formId:e.formId});Ne===void 0&&(Ne=new ea(0).toJson([])),fe!==Ne&&i.setStringValue({id:e.id,formId:e.formId},fe,{fromUi:!0},o)},[re,e.id,e.formId,i,o]),{debouncedCallback:lt}=Iu(Re,cc),{exportToCsv:He}=BC(he,re,se,y),{onCellEdited:et,onPaste:wt,onRowAppended:dt,onDelete:ze,validateCell:Pt}=HC(re,e.editingMode!==ne,G,he,Ve,nt,ge,lt,De),{tooltip:_t,clearTooltip:mt,onItemHovered:Lt}=qC(re,he),{drawCell:rn,customRenderers:zt}=LC(re),Cn=h.useCallback(fe=>({...fe,hasMenu:!de}),[de]),Ut=te.useMemo(()=>re.map(fe=>Cn(zs(fe))),[re,Cn]),{columns:kt,onColumnResize:Pn}=Lb(Ut),Sn=t.dimensions.numHeaderRows>1,{minHeight:Pe,maxHeight:Ft,minWidth:gn,maxWidth:vn,rowHeight:hn,resizableSize:ot,setResizableSize:Gt}=YC(e,m,se,Sn,u,c,a),At=te.useCallback(([fe,Ne])=>({...K1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(re.length-1,0)]}),[re,m.glideTheme.textLight]),on=te.useCallback(()=>{be(),De()},[be,De]);Gh({element:e,widgetMgr:i,onFormCleared:on});const It=!de&&e.editingMode===ne&&!n,{pinColumn:$t,unpinColumn:Ge,freezeColumns:Nt}=Pb(re,de,u,m.minColumnWidth,De,k),{onColumnMoved:Bt}=_b(re,Nt,$t,Ge,j);return te.useEffect(()=>{setTimeout(()=>{var fe,Ne;if(g.current&&f.current){const Kt=(Ne=(fe=g.current)==null?void 0:fe.querySelector(".dvn-stack"))==null?void 0:Ne.getBoundingClientRect();Kt&&(R(Kt.height>g.current.clientHeight),E(Kt.width>g.current.clientWidth))}},1)},[ot,se,kt]),Hr(Tu,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:F,ref:g,onMouseDown:fe=>{if(g.current&&F){const Ne=g.current.getBoundingClientRect();I&&Ne.height-(oa+1)<fe.clientY-Ne.top&&fe.stopPropagation(),x&&Ne.width-(oa+1)<fe.clientX-Ne.left&&fe.stopPropagation()}},onBlur:fe=>{!w&&!_&&!fe.currentTarget.contains(fe.relatedTarget)&&De(!0,!0)},children:[Hr(Zh,{isFullScreen:a,disableFullscreenMode:r,locked:ce&&!bt||me||_&&w,onExpand:s,onCollapse:l,target:Tu,children:[(bt&&ce||J&&le)&&Jt(Wi,{label:"Clear selection",icon:tg,onClick:()=>{De(),mt()}}),It&&ce&&Jt(Wi,{label:"Delete row(s)",icon:ag,onClick:()=>{ze&&(ze(Dt),mt())}}),It&&!ce&&Jt(Wi,{label:"Add row",icon:Mc,onClick:()=>{dt&&(S(!0),dt(),mt())}}),!xe&&!de&&Jt(Wi,{label:"Download as CSV",icon:sg,onClick:()=>He()}),!de&&Jt(Wi,{label:"Search",icon:Rc,onClick:()=>{M?C(!1):(S(!0),C(!0)),mt()}})]}),Jt(Yh,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:ot,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Pe,maxHeight:Ft,minWidth:gn,maxWidth:vn,size:ot,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,hn],snapGap:hn/3,onResizeStop:(fe,Ne,Kt,En)=>{if(d.current){const ln=2*m.tableBorderWidth;Gt({width:d.current.size.width,height:Ft-d.current.size.height===ln?d.current.size.height+ln:d.current.size.height})}},children:Jt(N1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:kt,rows:de?1:se,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:hn,headerHeight:m.defaultHeaderHeight,getCellContent:de?At:he,onColumnResize:_?void 0:Pn,resizeIndicator:"header",freezeColumns:Nt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:_?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:J?void 0:Bt,onItemHovered:fe=>{b==null||b(fe),Lt==null||Lt(fe)},keybindings:{downFill:!0},onKeyDown:fe=>{(fe.ctrlKey||fe.metaKey)&&fe.key==="f"&&(C(Ne=>!Ne),fe.stopPropagation(),fe.preventDefault())},showSearch:M,onSearchClose:()=>{C(!1),mt()},onHeaderClicked:(fe,Ne)=>{!ae||J||(bt&&ce?De():De(!0,!0),Oe(fe,"auto"))},gridSelection:Dt,onGridSelectionChange:fe=>{(w||_)&&(Ae(fe),_t!==void 0&&mt())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:fe=>{fe.kind==="out-of-bounds"&&w?S(!1):fe.kind!=="out-of-bounds"&&!w&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...F&&{paddingBottom:I?-oa:void 0,paddingRight:x?-oa:void 0}},drawCell:rn,customRenderers:zt,imageEditorOverride:ib,headerIcons:m.headerIcons,validateCell:Pt,onHeaderMenuClick:(fe,Ne)=>{z({columnIdx:fe,headerBounds:Ne})},onPaste:!1,...bt&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:rt?"multi":"auto",rowSelect:n?"none":rt?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...J&&{columnSelect:n?"none":it?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!de&&e.editingMode!==P&&!n&&{fillHandle:!_,onCellEdited:et,onPaste:wt,onDelete:ze},...!de&&e.editingMode===ne&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:dt,onHeaderClicked:void 0}})}),_t&&_t.content&&Jt(KC,{top:_t.top,left:_t.left,content:_t.content,clearTooltip:mt}),L&&xc.createPortal(Jt(X1,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,onCloseMenu:()=>z(void 0),onSortColumn:ae?fe=>{De(!0,!0),Oe(L.columnIdx,fe,!0)}:void 0,isColumnPinned:O[L.columnIdx].isPinned,onUnpinColumn:()=>{Ge(O[L.columnIdx].id)},onPinColumn:()=>{$t(O[L.columnIdx].id)}}),document.querySelector("#portal"))]})}const QC=h.memo(jh(JC)),fS=Object.freeze(Object.defineProperty({__proto__:null,default:QC},Symbol.toStringTag,{value:"Module"}));export{pv as C,od as T,wi as a,bg as b,fS as c,vi as i,kp as m,pn as s};
|