streamlit-nightly 1.42.3.dev20250223__py2.py3-none-any.whl → 1.42.3.dev20250224__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/dataframe_util.py +6 -1
- streamlit/elements/bokeh_chart.py +6 -0
- streamlit/elements/markdown.py +2 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.B1kyp21I.js → FileDownload.esm.Db6P60XC.js} +1 -1
- streamlit/static/static/js/FileHelper.LHDgAkEu.js +5 -0
- streamlit/static/static/js/{FormClearHelper.CEl0YyS3.js → FormClearHelper.BkPbs0OF.js} +1 -1
- streamlit/static/static/js/{Hooks.B_-0sclb.js → Hooks.CW1Ujj-E.js} +1 -1
- streamlit/static/static/js/{InputInstructions.M8GsfWtP.js → InputInstructions.CHpHVupe.js} +1 -1
- streamlit/static/static/js/{ProgressBar.DDliFXvs.js → ProgressBar.CSZV-k_M.js} +2 -2
- streamlit/static/static/js/{RenderInPortalIfExists.DON5no2j.js → RenderInPortalIfExists.CrI9B0Qh.js} +1 -1
- streamlit/static/static/js/{Toolbar.DGwjBtCI.js → Toolbar.CfNF-56q.js} +1 -1
- streamlit/static/static/js/{base-input.Dz6cKnV_.js → base-input.BBFJwxWO.js} +4 -4
- streamlit/static/static/js/{createSuper.bXxYJzro.js → createSuper.rz8EjYR0.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.BrHDbHOn.js → data-grid-overlay-editor.DUagmDpG.js} +1 -1
- streamlit/static/static/js/{downloader.BUh1naKp.js → downloader.DEY2_Oao.js} +1 -1
- streamlit/static/static/js/{es6.C8XVTTHj.js → es6.Cbt8Qb0v.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DGWt48-l.js → iframeResizer.contentWindow.DlY1zPt7.js} +1 -1
- streamlit/static/static/js/{index.6zGrdP7S.js → index.7HEH_7fJ.js} +15 -15
- streamlit/static/static/js/{index.DvUg88R_.js → index.8pg9ijwI.js} +1 -1
- streamlit/static/static/js/{index.jSEMrPEJ.js → index.B5Q1lb1E.js} +1 -1
- streamlit/static/static/js/{index.DgCaLwAb.js → index.BFFhpOhV.js} +1 -1
- streamlit/static/static/js/{index.DU4gaNU_.js → index.BcIDRdbw.js} +1 -1
- streamlit/static/static/js/index.Bhf5i-o4.js +1 -0
- streamlit/static/static/js/{index.DcA_kXA1.js → index.BtBNIxWC.js} +2 -2
- streamlit/static/static/js/{index.BhKdTR4z.js → index.Bv1JbhEf.js} +1 -1
- streamlit/static/static/js/index.C29vTftb.js +3865 -0
- streamlit/static/static/js/{index.94WymsOx.js → index.C3FZ8TOb.js} +3 -3
- streamlit/static/static/js/index.C41AtD-D.js +1 -0
- streamlit/static/static/js/{index.C5zcxetk.js → index.C9kvqGu0.js} +1 -1
- streamlit/static/static/js/{index.DO1Rv491.js → index.CIDueoC2.js} +1 -1
- streamlit/static/static/js/{index.C2skmlN3.js → index.CUFUpykP.js} +2 -2
- streamlit/static/static/js/index.CUWXxL_C.js +1 -0
- streamlit/static/static/js/{index.BBotNZr-.js → index.CUepHEom.js} +1 -1
- streamlit/static/static/js/index.C_SUbLL7.js +1 -0
- streamlit/static/static/js/index.CdiPATR3.js +197 -0
- streamlit/static/static/js/index.CgZ_3VRU.js +1 -0
- streamlit/static/static/js/{index.BiCX2JZK.js → index.CjN5S59O.js} +1 -1
- streamlit/static/static/js/{index.B66JaJi3.js → index.Con6tiNg.js} +1 -1
- streamlit/static/static/js/{index.D-4pSvTG.js → index.D1sfL1bE.js} +1 -1
- streamlit/static/static/js/{index.CNDCHhth.js → index.D2PC_wwi.js} +1 -1
- streamlit/static/static/js/index.D8mp5ppE.js +201 -0
- streamlit/static/static/js/{index.C2VChsA1.js → index.DEz7mrAp.js} +1 -1
- streamlit/static/static/js/{index.BrXMfzqp.js → index.DPZJrrNj.js} +1 -1
- streamlit/static/static/js/{index.DB9G9YYY.js → index.Df3vkO_v.js} +1 -1
- streamlit/static/static/js/{index.BXFE-6NA.js → index.DuUcgXrv.js} +1 -1
- streamlit/static/static/js/{index.lCzpOFcS.js → index.DxvQWdtj.js} +1 -1
- streamlit/static/static/js/{index.D_tVZ0u0.js → index.DymllY6d.js} +2 -2
- streamlit/static/static/js/{index.Da7VTJGp.js → index.G1PSqufB.js} +2 -2
- streamlit/static/static/js/{index.B1Y_k9Fh.js → index.I2Ij_yHL.js} +1 -1
- streamlit/static/static/js/{index.NifETEVc.js → index.InwDjRN5.js} +1 -1
- streamlit/static/static/js/{index.iYzAfcLx.js → index.LmMDdxLh.js} +1 -1
- streamlit/static/static/js/{index.C9nK-VoQ.js → index.LypQPPkP.js} +3 -3
- streamlit/static/static/js/index.RDHMaPCV.js +1 -0
- streamlit/static/static/js/index.jj20zRA4.js +1 -0
- streamlit/static/static/js/{input.DqK048_c.js → input.QeLiGsyn.js} +2 -2
- streamlit/static/static/js/{memory.BYwXutbg.js → memory.0fYVo8Wx.js} +1 -1
- streamlit/static/static/js/{mergeWith.CwfhUp-s.js → mergeWith.AOqADio_.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.B-1TJraW.js → number-overlay-editor.DAvAckzz.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.CCjgmGB4.js → possibleConstructorReturn.C4RsC1R8.js} +1 -1
- streamlit/static/static/js/{sandbox.CzVH3fBX.js → sandbox.DT2p3KTe.js} +1 -1
- streamlit/static/static/js/{textarea.D47OO5VD.js → textarea.DQh9RYKV.js} +2 -2
- streamlit/static/static/js/{timepicker.Dq2FqiYO.js → timepicker.Br_cR0hi.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.7OyX1dIj.js → toConsumableArray.CzYSWELu.js} +1 -1
- streamlit/static/static/js/{uniqueId.naIyoATl.js → uniqueId.BdUnRe3-.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DH0ClB0l.js → useBasicWidgetState.6R32QW2v.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.3GZT2mEx.js → useOnInputChange.C4OiWI1_.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.BLeP_b5i.js +1 -0
- streamlit/user_info.py +8 -2
- {streamlit_nightly-1.42.3.dev20250223.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.42.3.dev20250223.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/RECORD +75 -75
- streamlit/static/static/js/FileDropzone.uWzTac7M.js +0 -5
- streamlit/static/static/js/index.BUnE-2Mi.js +0 -201
- streamlit/static/static/js/index.BxBwZJQr.js +0 -1
- streamlit/static/static/js/index.CNYNhiEk.js +0 -1
- streamlit/static/static/js/index.CUKOkOB2.js +0 -197
- streamlit/static/static/js/index.Ceuq3IzZ.js +0 -1
- streamlit/static/static/js/index.ChSsIvr7.js +0 -3865
- streamlit/static/static/js/index.DKFH0WYB.js +0 -1
- streamlit/static/static/js/index.DQT0NMTW.js +0 -1
- streamlit/static/static/js/index.DiXeiIyQ.js +0 -1
- streamlit/static/static/js/index.Dl_RyApM.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.HzikaPlG.js +0 -1
- {streamlit_nightly-1.42.3.dev20250223.data → streamlit_nightly-1.42.3.dev20250224.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.42.3.dev20250223.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.42.3.dev20250223.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.42.3.dev20250223.dist-info → streamlit_nightly-1.42.3.dev20250224.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,197 @@
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DUagmDpG.js","./index.7HEH_7fJ.js","../css/index.DpJG_94W.css","./FormClearHelper.BkPbs0OF.js","./withFullScreenWrapper.BLeP_b5i.js","./Toolbar.CfNF-56q.js","./mergeWith.AOqADio_.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CzYSWELu.js","./possibleConstructorReturn.C4RsC1R8.js","./createSuper.rz8EjYR0.js","./FileDownload.esm.Db6P60XC.js","./number-overlay-editor.DAvAckzz.js","./es6.Cbt8Qb0v.js"])))=>i.map(i=>d[i]);
|
2
|
+
var oh=Object.defineProperty;var ah=(e,t,n)=>t in e?oh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ct=(e,t,n)=>ah(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as kc,_ as tt,c as sh,g as vr,R as ae,i as $a,d as so,e as lh,f as uh,h as ch,l as Mc,m as Rc,o as dh,p as Ec,q as fh,s as hh,t as gh,u as mh,v as ph,w as vh,a as sr,x as Ds,n as vi,y as lo,j as wt,F as Ic,z as Os,T as bh,A as Ps,B as Bn,D as Ir,C as _s,G as Nn,H as Tc,I as wh,J as yh,K as Be,L as Dc,M as vt,N as Yi,O as Br,Q as Na,S as Ch,U as Sh,V as xh,W as Tl,X as kh,Y as Oc,Z as Mh,$ as Rh,a0 as vs,a1 as Pc,a2 as _c,a3 as Eh,a4 as Ih,a5 as Th,a6 as Dh,a7 as Oh,a8 as Ph,a9 as _h,aa as Lh,ab as Fh,ac as Ah,ad as Lc,ae as Hh,af as zh,ag as Vh,ah as $h,ai as Nh,aj as Bh,ak as Wh,al as Uh,am as qh,an as Yh,ao as Xh,ap as jh,aq as Un,ar as Ls,as as Xi,at as br,au as Ne,av as Gh,b as Fc,aw as Ac,k as Kh,ax as Ba,ay as Zh,az as Jh,aA as Wa,aB as Qh,aC as eg,aD as tg,aE as ng}from"./index.7HEH_7fJ.js";import{u as rg}from"./FormClearHelper.BkPbs0OF.js";import{w as ig,u as og,E as ag}from"./withFullScreenWrapper.BLeP_b5i.js";import{T as sg,a as _i}from"./Toolbar.CfNF-56q.js";import{m as lg}from"./mergeWith.AOqADio_.js";import{s as ug}from"./sprintf.D7DtBTRn.js";import{c as cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as gr,a as Fs,C as dg}from"./toConsumableArray.CzYSWELu.js";import{_ as fg,a as hg,b as gg}from"./possibleConstructorReturn.C4RsC1R8.js";import{_ as mg}from"./createSuper.rz8EjYR0.js";import{D as pg,F as vg}from"./FileDownload.esm.Db6P60XC.js";var Hc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(kc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Hc.displayName="Add";var zc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(kc,tt({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.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"}))});zc.displayName="Search";function Vc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return Vc(t)}function to(e,t){return Vc(t??"Hell froze over")}function bg(e,t){try{return e()}catch{return t}}const Dl=Object.prototype.hasOwnProperty;function mi(e,t){let n,r;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((r=e.length)===t.length)for(;r--&&mi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Dl.call(e,n)&&++r&&!Dl.call(t,n)||!(n in t)||!mi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ua,Ol;function wg(){if(Ol)return Ua;Ol=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ua=n,Ua}var qa,Pl;function yg(){if(Pl)return qa;Pl=1;var e=wg(),t=sh();function n(r,i){return r!=null&&t(r,i,e)}return qa=n,qa}var Cg=yg();const Sg=vr(Cg),ea=null,As=void 0;var te;(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"})(te||(te={}));var _l;(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"})(_l||(_l={}));var ta;(function(e){e.Triangle="triangle",e.Dots="dots"})(ta||(ta={}));function _o(e){return"width"in e&&typeof e.width=="number"}async function Ll(e){return typeof e=="object"?e:await e()}function ui(e){return!(e.kind===te.Loading||e.kind===te.Bubble||e.kind===te.RowID||e.kind===te.Protected||e.kind===te.Drilldown)}function di(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function ji(e){if(!ui(e)||e.kind===te.Image)return!1;if(e.kind===te.Text||e.kind===te.Number||e.kind===te.Markdown||e.kind===te.Uri||e.kind===te.Custom||e.kind===te.Boolean)return e.readonly!==!0;to(e,"A cell was passed with an invalid kind")}function xg(e){return Sg(e,"editor")}function Hs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function kg(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Fl;const hr=class hr{constructor(t){ct(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new hr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=kg([...this.items,n]);return new hr(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],i=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[l,s]=a;if(l<=i&&r<=s){const u=[];l<r&&u.push([l,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new hr(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[r,i]=this.items[n];if(t>=r&&t<i)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 r=t.items[n],i=this.items[n];if(r[0]!==i[0]||r[1]!==i[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let i=n;i<r;i++)t.push(i);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};ct(hr,"empty",()=>Fl??(Fl=new hr([]))),ct(hr,"fromSingleSelection",t=>hr.empty().add(t));let mt=hr;var Mg=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(l=>{if(l.startsWith("atm_")){const[,s]=l.split("_");n[s]=l}else r.push(l)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Al=Mg,Rg=e=>e.toUpperCase()===e,Eg=e=>t=>e.indexOf(t)===-1,$c=(e,t)=>{const n={};return Object.keys(e).filter(Eg(t)).forEach(r=>{n[r]=e[r]}),n};function Ig(e,t,n){const r=$c(t,n);if(!e){const i=typeof $a=="function"?{default:$a}:$a;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var Tg=(e,t)=>{};function Dg(e){let t="";return n=>{const r=(o,a)=>{const{as:l=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!Rg(l[0])):n.propsAsIs,c=Ig(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Al(n.class,c.className||s):Al(c.className||s,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const v=d[p],w=v[0],b=v[1]||"",M=typeof w=="function"?w(o):w;Tg(M,n.name),f[`--${p}`]=`${M}${b}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==l?(c.as=l,ae.createElement(e,c)):ae.createElement(l,c)},i=ae.forwardRef?ae.forwardRef(r):o=>{const a=$c(o,["innerRef"]);return r(a,o.innerRef)};return i.displayName=n.name,i.__linaria={className:n.class||t,extends:e},i}}var pn=Dg;const Og=pn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ya={},Li={},Lo={},Fo={},Hl;function Pg(){return Hl||(Hl=1,function(e){(function(t,n){n(e,so(),lh())})(Fo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=a(n),o=a(r);function a(b){return b&&b.__esModule?b:{default:b}}var l=Object.assign||function(b){for(var M=1;M<arguments.length;M++){var O=arguments[M];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(b[S]=O[S])}return b};function s(b,M){var O={};for(var S in b)M.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(b,S)&&(O[S]=b[S]);return O}function u(b,M){if(!(b instanceof M))throw new TypeError("Cannot call a class as a function")}var c=function(){function b(M,O){for(var S=0;S<O.length;S++){var R=O[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(M,R.key,R)}}return function(M,O,S){return O&&b(M.prototype,O),S&&b(M,S),M}}();function d(b,M){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:b}function f(b,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);b.prototype=Object.create(M&&M.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(b,M):b.__proto__=M)}var h=!1;function m(b){h=b}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?b:b.capture}function v(b){if("touches"in b){var M=b.touches[0],O=M.pageX,S=M.pageY;return{x:O,y:S}}var R=b.screenX,_=b.screenY;return{x:R,y:_}}var w=function(b){f(M,b);function M(){var O;u(this,M);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=d(this,(O=M.__proto__||Object.getPrototypeOf(M)).call.apply(O,[this].concat(R)));return E._handleSwipeStart=E._handleSwipeStart.bind(E),E._handleSwipeMove=E._handleSwipeMove.bind(E),E._handleSwipeEnd=E._handleSwipeEnd.bind(E),E._onMouseDown=E._onMouseDown.bind(E),E._onMouseMove=E._onMouseMove.bind(E),E._onMouseUp=E._onMouseUp.bind(E),E._setSwiperRef=E._setSwiperRef.bind(E),E}return c(M,[{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(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var R=v(S),_=R.x,E=R.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var R=v(S),_=R.x,E=R.y,x=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:x,deltaY:L}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var R=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-R?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>R&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-R?this.props.onSwipeUp(1,S):this.movePosition.deltaY>R&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var R=S.className,_=S.style,E=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var x=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},x),E)}}]),M}(n.Component);w.displayName="ReactSwipe",w.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},w.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=w})}(Fo)),Fo}var zl;function Nc(){return zl||(zl=1,function(e){(function(t,n){n(e,Pg())})(Lo,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=i(n);function i(o){return o&&o.__esModule?o:{default:o}}t.default=r.default})}(Lo)),Lo}var Fi={},Vl;function Bc(){if(Vl)return Fi;Vl=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=void 0;var e=t(uh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,a){return o in i?Object.defineProperty(i,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[o]=a,i}var r={ROOT:function(o){return(0,e.default)(n({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,e.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,a){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":a==="horizontal","axis-vertical":a!=="horizontal"})},SLIDER:function(o,a){return(0,e.default)({thumbs:!o,slider:o,animated:!a})},ITEM:function(o,a,l){return(0,e.default)({thumb:!o,slide:o,selected:a,previous:l})},ARROW_PREV:function(o){return(0,e.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,e.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,e.default)({dot:!0,selected:o})}};return Fi.default=r,Fi}var Ai={},Hi={},$l;function _g(){if($l)return Hi;$l=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Hi.outerWidth=e,Hi}var zi={},Nl;function zs(){if(Nl)return zi;Nl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,a=i==="horizontal"?[o,0,0]:[0,o,0],l="translate3d",s="("+a.join(",")+")";return l+s};return zi.default=e,zi}var Vi={},Bl;function Wc(){if(Bl)return Vi;Bl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(){return window};return Vi.default=e,Vi}var Wl;function Uc(){if(Wl)return Ai;Wl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.default=void 0;var e=s(so()),t=a(Bc()),n=_g(),r=a(zs()),i=a(Nc()),o=a(Wc());function a(E){return E&&E.__esModule?E:{default:E}}function l(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return l=function(){return E},E}function s(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var x=l();if(x&&x.has(E))return x.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(L,C,I):L[C]=E[C]}return L.default=E,x&&x.set(E,L),L}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(L){return typeof L}:u=function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},u(E)}function c(){return c=Object.assign||function(E){for(var x=1;x<arguments.length;x++){var L=arguments[x];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,x){if(!(E instanceof x))throw new TypeError("Cannot call a class as a function")}function f(E,x){for(var L=0;L<x.length;L++){var D=x[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,x,L){return x&&f(E.prototype,x),E}function m(E,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(x&&x.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),x&&p(E,x)}function p(E,x){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,x)}function v(E){var x=M();return function(){var D=O(E),C;if(x){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,x){return x&&(u(x)==="object"||typeof x=="function")?x:b(E)}function b(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function M(){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 O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(L){return L.__proto__||Object.getPrototypeOf(L)},O(E)}function S(E,x,L){return x in E?Object.defineProperty(E,x,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[x]=L,E}var R=function(x){return x.hasOwnProperty("key")},_=function(E){m(L,E);var x=v(L);function L(D){var C;return d(this,L),C=x.call(this,D),S(b(C),"itemsWrapperRef",void 0),S(b(C),"itemsListRef",void 0),S(b(C),"thumbsRef",void 0),S(b(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),S(b(C),"setItemsListRef",function(I){C.itemsListRef=I}),S(b(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),S(b(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,k=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),V=Math.floor(T/k),N=V<I,U=N?I-V:0;C.setState(function(oe,ee){return{itemSize:k,visibleItems:V,firstItem:N?C.getFirstItem(ee.selectedItem):0,lastPosition:U,showArrows:N}})}}),S(b(C),"handleClickItem",function(I,T,k){if(!R(k)||k.key==="Enter"){var V=C.props.onSelectItem;typeof V=="function"&&V(I,T)}}),S(b(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(b(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(b(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var k=0,V=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,U=Math.max(V-C.state.visibleItems,0),oe=-U*100/C.state.visibleItems;N===k&&T>0&&(T=0),N===oe&&T<0&&(T=0);var ee=C.itemsWrapperRef.clientWidth,j=N+100/(ee/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(ne){C.itemsListRef.style[ne]=(0,r.default)(j,"%",C.props.axis)}),!0}),S(b(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),S(b(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),S(b(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(L,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var k=t.default.ITEM(!1,T===C.state.selectedItem),V={key:T,ref:function(U){return C.setThumbsRef(U,T)},className:k,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},V,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,k=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,V={},N=-this.state.firstItem*(this.state.itemSize||0),U=(0,r.default)(N,"px",this.props.axis),oe=this.props.transitionTime+"ms";return V={WebkitTransform:U,MozTransform:U,MsTransform:U,OTransform:U,transform:U,msTransform:U,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:V,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(j){return C.setItemsListRef(j)},style:V},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!k),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return Ai.default=_,S(_,"displayName","Thumbs"),S(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Ai}var $i={},Ul;function Lg(){if(Ul)return $i;Ul=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=function(){return document};return $i.default=e,$i}var Pn={},ql;function qc(){if(ql)return Pn;ql=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.setPosition=Pn.getPosition=Pn.isKeyboardEvent=Pn.defaultStatusFormatter=Pn.noop=void 0;var e=so(),t=n(zs());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Pn.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Pn.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Pn.isKeyboardEvent=o;var a=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var d=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var f=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?f+=(100-c.centerSlidePercentage)/2:u===h&&(f+=100-c.centerSlidePercentage),f}return-u*100};Pn.getPosition=a;var l=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(f){d[f]=(0,t.default)(u,"%",c)}),d};return Pn.setPosition=l,Pn}var er={},Yl;function Fg(){if(Yl)return er;Yl=1,Object.defineProperty(er,"__esModule",{value:!0}),er.fadeAnimationHandler=er.slideStopSwipingHandler=er.slideSwipeAnimationHandler=er.slideAnimationHandler=void 0;var e=so(),t=r(zs()),n=qc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,f){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);f&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var f=1;f<arguments.length;f++){var h=arguments[f]!=null?arguments[f]:{};f%2?i(Object(h),!0).forEach(function(m){a(d,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(d,m,Object.getOwnPropertyDescriptor(h,m))})}return d}function a(d,f,h){return f in d?Object.defineProperty(d,f,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[f]=h,d}var l=function(f,h){var m={},p=h.selectedItem,v=p,w=e.Children.count(f.children)-1,b=f.infiniteLoop&&(p<0||p>w);if(b)return v<0?f.centerMode&&f.centerSlidePercentage&&f.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*f.centerSlidePercentage-(100-f.centerSlidePercentage)/2,f.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,f.axis):v>w&&(m.itemListStyle=(0,n.setPosition)(0,f.axis)),m;var M=(0,n.getPosition)(p,f),O=(0,t.default)(M,"%",f.axis),S=f.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:S,MozTransitionDuration:S,OTransitionDuration:S,transitionDuration:S,msTransitionDuration:S})),m};er.slideAnimationHandler=l;var s=function(f,h,m,p){var v={},w=h.axis==="horizontal",b=e.Children.count(h.children),M=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(b-1,h)-100:(0,n.getPosition)(b-1,h),R=w?f.x:f.y,_=R;O===M&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),x=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&x&&(m.selectedItem===0&&E>-100?E-=b*100:m.selectedItem===b-1&&E<-b*100&&(E+=b*100)),(!h.preventMovementUntilSwipeScrollTolerance||x||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),v.itemListStyle=(0,n.setPosition)(E,h.axis)),x&&!m.cancelClick&&p({cancelClick:!0}),v};er.slideSwipeAnimationHandler=s;var u=function(f,h){var m=(0,n.getPosition)(h.selectedItem,f),p=(0,n.setPosition)(m,f.axis);return{itemListStyle:p}};er.slideStopSwipingHandler=u;var c=function(f,h){var m=f.transitionTime+"ms",p="ease-in-out",v={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:p,msTransitionTimingFunction:p,MozTransitionTimingFunction:p,WebkitTransitionTimingFunction:p,OTransitionTimingFunction:p};return h.swiping||(v=o(o({},v),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:v,selectedStyle:o(o({},v),{},{opacity:1,position:"relative"}),prevStyle:o({},v)}};return er.fadeAnimationHandler=c,er}var Xl;function Ag(){if(Xl)return Li;Xl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=c(so()),t=s(Nc()),n=s(Bc()),r=s(Uc()),i=s(Lg()),o=s(Wc()),a=qc(),l=Fg();function s(D){return D&&D.__esModule?D:{default:D}}function u(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return u=function(){return D},D}function c(D){if(D&&D.__esModule)return D;if(D===null||d(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in D)if(Object.prototype.hasOwnProperty.call(D,k)){var V=T?Object.getOwnPropertyDescriptor(D,k):null;V&&(V.get||V.set)?Object.defineProperty(I,k,V):I[k]=D[k]}return I.default=D,C&&C.set(D,I),I}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(I){return typeof I}:d=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},d(D)}function f(){return f=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},f.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(k){return Object.getOwnPropertyDescriptor(D,k).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){x(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function v(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function w(D,C,I){return C&&v(D.prototype,C),D}function b(D,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(C&&C.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),C&&M(D,C)}function M(D,C){return M=Object.setPrototypeOf||function(T,k){return T.__proto__=k,T},M(D,C)}function O(D){var C=_();return function(){var T=E(D),k;if(C){var V=E(this).constructor;k=Reflect.construct(T,arguments,V)}else k=T.apply(this,arguments);return S(this,k)}}function S(D,C){return C&&(d(C)==="object"||typeof C=="function")?C:R(D)}function R(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){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 E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function x(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var L=function(D){b(I,D);var C=O(I);function I(T){var k;p(this,I),k=C.call(this,T),x(R(k),"thumbsRef",void 0),x(R(k),"carouselWrapperRef",void 0),x(R(k),"listRef",void 0),x(R(k),"itemsRef",void 0),x(R(k),"timer",void 0),x(R(k),"animationHandler",void 0),x(R(k),"setThumbsRef",function(N){k.thumbsRef=N}),x(R(k),"setCarouselWrapperRef",function(N){k.carouselWrapperRef=N}),x(R(k),"setListRef",function(N){k.listRef=N}),x(R(k),"setItemsRef",function(N,U){k.itemsRef||(k.itemsRef=[]),k.itemsRef[U]=N}),x(R(k),"autoPlay",function(){e.Children.count(k.props.children)<=1||(k.clearAutoPlay(),k.props.autoPlay&&(k.timer=setTimeout(function(){k.increment()},k.props.interval)))}),x(R(k),"clearAutoPlay",function(){k.timer&&clearTimeout(k.timer)}),x(R(k),"resetAutoPlay",function(){k.clearAutoPlay(),k.autoPlay()}),x(R(k),"stopOnHover",function(){k.setState({isMouseEntered:!0},k.clearAutoPlay)}),x(R(k),"startOnLeave",function(){k.setState({isMouseEntered:!1},k.autoPlay)}),x(R(k),"isFocusWithinTheCarousel",function(){return k.carouselWrapperRef?!!((0,i.default)().activeElement===k.carouselWrapperRef||k.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),x(R(k),"navigateWithKeyboard",function(N){if(k.isFocusWithinTheCarousel()){var U=k.props.axis,oe=U==="horizontal",ee={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},j=oe?ee.ArrowRight:ee.ArrowDown,ne=oe?ee.ArrowLeft:ee.ArrowUp;j===N.keyCode?k.increment():ne===N.keyCode&&k.decrement()}}),x(R(k),"updateSizes",function(){if(!(!k.state.initialized||!k.itemsRef||k.itemsRef.length===0)){var N=k.props.axis==="horizontal",U=k.itemsRef[0];if(U){var oe=N?U.clientWidth:U.clientHeight;k.setState({itemSize:oe}),k.thumbsRef&&k.thumbsRef.updateSizes()}}}),x(R(k),"setMountState",function(){k.setState({hasMount:!0}),k.updateSizes()}),x(R(k),"handleClickItem",function(N,U){if(e.Children.count(k.props.children)!==0){if(k.state.cancelClick){k.setState({cancelClick:!1});return}k.props.onClickItem(N,U),N!==k.state.selectedItem&&k.setState({selectedItem:N})}}),x(R(k),"handleOnChange",function(N,U){e.Children.count(k.props.children)<=1||k.props.onChange(N,U)}),x(R(k),"handleClickThumb",function(N,U){k.props.onClickThumb(N,U),k.moveTo(N)}),x(R(k),"onSwipeStart",function(N){k.setState({swiping:!0}),k.props.onSwipeStart(N)}),x(R(k),"onSwipeEnd",function(N){k.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),k.props.onSwipeEnd(N),k.clearAutoPlay(),k.state.autoPlay&&k.autoPlay()}),x(R(k),"onSwipeMove",function(N,U){k.props.onSwipeMove(U);var oe=k.props.swipeAnimationHandler(N,k.props,k.state,k.setState.bind(R(k)));return k.setState(m({},oe)),!!Object.keys(oe).length}),x(R(k),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem-(typeof N=="number"?N:1))}),x(R(k),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;k.moveTo(k.state.selectedItem+(typeof N=="number"?N:1))}),x(R(k),"moveTo",function(N){if(typeof N=="number"){var U=e.Children.count(k.props.children)-1;N<0&&(N=k.props.infiniteLoop?U:0),N>U&&(N=k.props.infiniteLoop?0:U),k.selectItem({selectedItem:N}),k.state.autoPlay&&k.state.isMouseEntered===!1&&k.resetAutoPlay()}}),x(R(k),"onClickNext",function(){k.increment(1)}),x(R(k),"onClickPrev",function(){k.decrement(1)}),x(R(k),"onSwipeForward",function(){k.increment(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"onSwipeBackwards",function(){k.decrement(1),k.props.emulateTouch&&k.setState({cancelClick:!0})}),x(R(k),"changeItem",function(N){return function(U){(!(0,a.isKeyboardEvent)(U)||U.key==="Enter")&&k.moveTo(N)}}),x(R(k),"selectItem",function(N){k.setState(m({previousItem:k.state.selectedItem},N),function(){k.setState(k.animationHandler(k.props,k.state))}),k.handleOnChange(N.selectedItem,e.Children.toArray(k.props.children)[N.selectedItem])}),x(R(k),"getInitialImage",function(){var N=k.props.selectedItem,U=k.itemsRef&&k.itemsRef[N],oe=U&&U.getElementsByTagName("img")||[];return oe[0]}),x(R(k),"getVariableItemHeight",function(N){var U=k.itemsRef&&k.itemsRef[N];if(k.state.hasMount&&U&&U.children.length){var oe=U.children[0].getElementsByTagName("img")||[];if(oe.length>0){var ee=oe[0];if(!ee.complete){var j=function ue(){k.forceUpdate(),ee.removeEventListener("load",ue)};ee.addEventListener("load",j)}}var ne=oe[0]||U.children[0],ie=ne.clientHeight;return ie>0?ie:null}return null});var V={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return k.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&l.fadeAnimationHandler||l.slideAnimationHandler,k.state=m(m({},V),k.animationHandler(T,V)),k}return w(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(k,V){!k.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!k.autoFocus&&this.props.autoFocus&&this.forceFocus(),V.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(k.selectedItem!==this.props.selectedItem||k.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),k.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 k=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var V=k.getInitialImage();V&&!V.complete?V.addEventListener("load",k.setMountState):k.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.addEventListener("mouseenter",this.stopOnHover),k.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var k=this.carouselWrapperRef;this.props.stopOnHover&&k&&(k.removeEventListener("mouseenter",this.stopOnHover),k.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,i.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var k=this.getInitialImage();k&&k.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var k;(k=this.carouselWrapperRef)===null||k===void 0||k.focus()}},{key:"renderItems",value:function(k){var V=this;return this.props.children?e.Children.map(this.props.children,function(N,U){var oe=U===V.state.selectedItem,ee=U===V.state.previousItem,j=oe&&V.state.selectedStyle||ee&&V.state.prevStyle||V.state.slideStyle||{};V.props.centerMode&&V.props.axis==="horizontal"&&(j=m(m({},j),{},{minWidth:V.props.centerSlidePercentage+"%"})),V.state.swiping&&V.state.swipeMovementStarted&&(j=m(m({},j),{},{pointerEvents:"none"}));var ne={ref:function(ue){return V.setItemsRef(ue,U)},key:"itemKey"+U+(k?"clone":""),className:n.default.ITEM(!0,U===V.state.selectedItem,U===V.state.previousItem),onClick:V.handleClickItem.bind(V,U,N),style:j};return e.default.createElement("li",ne,V.props.renderItem(N,{isSelected:U===V.state.selectedItem,isPrevious:U===V.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var k=this,V=this.props,N=V.showIndicators,U=V.labels,oe=V.renderIndicator,ee=V.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(ee,function(j,ne){return oe&&oe(k.changeItem(ne),ne===k.state.selectedItem,ne,U.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||e.Children.count(this.props.children)===0?null:e.default.createElement(r.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 k=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var V=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",U=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=U&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,ee=U&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),ne=j.shift(),ie=j.pop(),ue={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},he={};if(N){if(ue.onSwipeLeft=this.onSwipeForward,ue.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var J=this.getVariableItemHeight(this.state.selectedItem);he.height=J||"auto"}}else ue.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,ue.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,ue.style=m(m({},ue.style),{},{height:this.state.itemSize}),he.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:he},V?e.default.createElement(t.default,f({tagName:"ul",innerRef:this.setListRef},ue,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ne):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return k.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&ne)),this.props.renderArrowNext(this.onClickNext,ee,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return Li.default=L,x(L,"displayName","Carousel"),x(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:a.noop,onClickThumb:a.noop,onChange:a.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,k){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(k," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var k=T;if(T.type!=="img"&&(k=e.Children.toArray(T.props.children).find(function(V){return V.type==="img"})),!!k)return k});return I.filter(function(T){return T}).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"),[]):I},statusFormatter:a.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:l.slideSwipeAnimationHandler,stopSwipingHandler:l.slideStopSwipingHandler}),Li}var jl={},Gl;function Hg(){return Gl||(Gl=1),jl}var Kl;function zg(){return Kl||(Kl=1,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 r.default}});var t=i(Ag()),n=Hg(),r=i(Uc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ya)),Ya}var Vg=zg(),Xa,Zl;function $g(){if(Zl)return Xa;Zl=1;var e=ch(),t=function(){return e.Date.now()};return Xa=t,Xa}var ja,Jl;function Yc(){if(Jl)return ja;Jl=1;var e=Mc(),t=$g(),n=Rc(),r="Expected a function",i=Math.max,o=Math.min;function a(l,s,u){var c,d,f,h,m,p,v=0,w=!1,b=!1,M=!0;if(typeof l!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,b="maxWait"in u,f=b?i(n(u.maxWait)||0,s):f,M="trailing"in u?!!u.trailing:M);function O(I){var T=c,k=d;return c=d=void 0,v=I,h=l.apply(k,T),h}function S(I){return v=I,m=setTimeout(E,s),w?O(I):h}function R(I){var T=I-p,k=I-v,V=s-T;return b?o(V,f-k):V}function _(I){var T=I-p,k=I-v;return p===void 0||T>=s||T<0||b&&k>=f}function E(){var I=t();if(_(I))return x(I);m=setTimeout(E,R(I))}function x(I){return m=void 0,M&&c?O(I):(c=d=void 0,h)}function L(){m!==void 0&&clearTimeout(m),v=0,c=p=d=m=void 0}function D(){return m===void 0?h:x(t())}function C(){var I=t(),T=_(I);if(c=arguments,d=this,p=I,T){if(m===void 0)return S(p);if(b)return clearTimeout(m),m=setTimeout(E,s),O(p)}return m===void 0&&(m=setTimeout(E,s)),h}return C.cancel=L,C.flush=D,C}return ja=a,ja}var Ng=Yc();const Xc=vr(Ng);function mn(e,t,n,r,i=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var u;(u=o.current)==null||u.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:i}),()=>{a.removeEventListener(e,l,{capture:i})}},[e,n,r,i])}function Wr(e,t){return e===void 0?void 0:t}const Bg=Math.PI;function Ql(e){return e*Bg/180}const jc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Gc=(e,t,n,r,i)=>{switch(e){case"left":return Math.floor(t)+r+i/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-i/2}},Kc=(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,Vs=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.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"}),g.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"}))},Wg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Ug(e,t,n){const[r,i]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(Xc(l=>{o.current&&i(l)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),r}const qg="֑-߿יִ-﷽ﹰ-ﻼ",Yg="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Xg=new RegExp("^[^"+Yg+"]*["+qg+"]");function $s(e){return Xg.test(e)?"rtl":"not-rtl"}let Ao;function bs(){if(typeof document>"u")return 0;if(Ao!==void 0)return Ao;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 r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Ao=n-r,Ao}const $r=Symbol();function jg(e){const t=g.useRef([$r,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=g.useState(e),[,i]=g.useState(),o=g.useCallback(l=>{const s=t.current[0];s!==$r&&(l=typeof l=="function"?l(s):l,l===s)||(s!==$r&&i({}),r(u=>typeof l=="function"?l(s===$r?u:s):l),t.current[0]=$r)},[]),a=g.useCallback(()=>{t.current[0]=$r,i({})},[]);return[t.current[0]===$r?n:t.current[0],o,a]}function Jc(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Gg(e){const t=g.useRef(e);return mi(e,t.current)||(t.current=e),t.current}const Kg=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(l=>l!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Og,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(Vg.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(l=>{const s=(i==null?void 0:i(l))??g.createElement("img",{draggable:!1,src:l});return g.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&g.createElement("button",{className:"gdg-edit-icon",onClick:r},g.createElement(Vs,null)))};function Qc(){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 Xr=Qc();function Zg(e){Xr=e}const ed=/[&<>"']/,Jg=new RegExp(ed.source,"g"),td=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Qg=new RegExp(td.source,"g"),em={"&":"&","<":"<",">":">",'"':""","'":"'"},eu=e=>em[e];function yn(e,t){if(t){if(ed.test(e))return e.replace(Jg,eu)}else if(td.test(e))return e.replace(Qg,eu);return e}const tm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function nd(e){return e.replace(tm,(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 nm=/(^|[^\[])\^/g;function Bt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(nm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const rm=/[^\w:]/g,im=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function tu(e,t,n){if(e){let r;try{r=decodeURIComponent(nd(n)).replace(rm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!im.test(n)&&(n=lm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ho={},om=/^[^:]+:\/*[^/]*$/,am=/^([^:]+:)[\s\S]*$/,sm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function lm(e,t){Ho[" "+e]||(om.test(e)?Ho[" "+e]=e+"/":Ho[" "+e]=Go(e,"/",!0)),e=Ho[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(am,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(sm,"$1")+t:e+t}const na={exec:function(){}};function nu(e,t){const n=e.replace(/\|/g,(o,a,l)=>{let s=!1,u=a;for(;--u>=0&&l[u]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function Go(e,t,n){const r=e.length;if(r===0)return"";let i=0;for(;i<r;){const o=e.charAt(r-i-1);if(o===t&&!n)i++;else if(o!==t&&n)i++;else break}return e.slice(0,r-i)}function um(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,i=0;for(;i<n;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return-1}function cm(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 ru(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function iu(e,t,n,r){const i=t.href,o=t.title?yn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:i,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:i,title:o,text:yn(a)}}function dm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
3
|
+
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
|
4
|
+
`)}class Ns{constructor(t){this.options=t||Xr}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 r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Go(r,`
|
5
|
+
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=dm(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=Go(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}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 r=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(r);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:o,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,i,o,a,l,s,u,c,d,f,h,m,p=n[1].trim();const v=p.length>1,w={type:"list",raw:"",ordered:v,start:v?+p.slice(0,-1):"",loose:!1,items:[]};p=v?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=v?p:"[*+-]");const b=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),c=n[2].split(`
|
6
|
+
`,1)[0].replace(/^\t+/,O=>" ".repeat(3*O.length)),d=t.split(`
|
7
|
+
`,1)[0],this.options.pedantic?(a=2,h=c.trimLeft()):(a=n[2].search(/[^ ]/),a=a>4?1:a,h=c.slice(a),a+=n[1].length),s=!1,!c&&/^ *$/.test(d)&&(r+=d+`
|
8
|
+
`,t=t.substring(d.length+1),m=!0),!m){const O=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),_=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;t&&(f=t.split(`
|
9
|
+
`,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||_.test(d)||O.test(d)||S.test(t)));){if(d.search(/[^ ]/)>=a||!d.trim())h+=`
|
10
|
+
`+d.slice(a);else{if(s||c.search(/[^ ]/)>=4||R.test(c)||_.test(c)||S.test(c))break;h+=`
|
11
|
+
`+d}!s&&!d.trim()&&(s=!0),r+=f+`
|
12
|
+
`,t=t.substring(f.length+1),c=d.slice(a)}}w.loose||(u?w.loose=!0:/\n *\n *$/.test(r)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h),i&&(o=i[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),w.items.push({type:"list_item",raw:r,task:!!i,checked:o,loose:!1,text:h}),w.raw+=r}w.items[w.items.length-1].raw=r.trimRight(),w.items[w.items.length-1].text=h.trimRight(),w.raw=w.raw.trimRight();const M=w.items.length;for(l=0;l<M;l++)if(this.lexer.state.top=!1,w.items[l].tokens=this.lexer.blockTokens(w.items[l].text,[]),!w.loose){const O=w.items[l].tokens.filter(R=>R.type==="space"),S=O.length>0&&O.some(R=>/\n.*\n/.test(R.raw));w.loose=S}if(w.loose)for(l=0;l<M;l++)w.items[l].loose=!0;return w}}html(t){const n=this.rules.block.html.exec(t);if(n){const r={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):yn(n[0]);r.type="paragraph",r.text=i,r.tokens=this.lexer.inline(i)}return r}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const r={type:"table",header:nu(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
13
|
+
`):[]};if(r.header.length===r.align.length){r.raw=n[0];let i=r.align.length,o,a,l,s;for(o=0;o<i;o++)/^ *-+: *$/.test(r.align[o])?r.align[o]="right":/^ *:-+: *$/.test(r.align[o])?r.align[o]="center":/^ *:-+ *$/.test(r.align[o])?r.align[o]="left":r.align[o]=null;for(i=r.rows.length,o=0;o<i;o++)r.rows[o]=nu(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,a=0;a<i;a++)r.header[a].tokens=this.lexer.inline(r.header[a].text);for(i=r.rows.length,a=0;a<i;a++)for(s=r.rows[a],l=0;l<s.length;l++)s[l].tokens=this.lexer.inline(s[l].text);return r}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
|
14
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:yn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):yn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const a=Go(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=um(n[2],"()");if(a>-1){const s=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,s).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],o=a[3])}else o=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(r)?i=i.slice(1):i=i.slice(1,-1)),iu(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return iu(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&r.match(/[\p{L}\p{N}]/u))return;const o=i[1]||i[2]||"";if(!o||o&&(r===""||this.rules.inline.punctuation.exec(r))){const a=i[0].length-1;let l,s,u=a,c=0;const d=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+a);(i=d.exec(n))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(s=l.length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);const f=t.slice(0,a+i.index+(i[0].length-l.length)+s);if(Math.min(a,s)%2){const m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const i=/[^ ]/.test(r),o=/^ /.test(r)&&/ $/.test(r);return i&&o&&(r=r.substring(1,r.length-1)),r=yn(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const r=this.rules.inline.autolink.exec(t);if(r){let i,o;return r[2]==="@"?(i=yn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=yn(r[1]),o=i),{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let r;if(r=this.rules.inline.url.exec(t)){let i,o;if(r[2]==="@")i=yn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(a!==r[0]);i=yn(r[0]),r[1]==="www."?o="http://"+r[0]:o=r[0]}return{type:"link",raw:r[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const r=this.rules.inline.text.exec(t);if(r){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):yn(r[0]):r[0]:i=yn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Xe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:na,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Xe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Xe.def=Bt(Xe.def).replace("label",Xe._label).replace("title",Xe._title).getRegex();Xe.bullet=/(?:[*+-]|\d{1,9}[.)])/;Xe.listItemStart=Bt(/^( *)(bull) */).replace("bull",Xe.bullet).getRegex();Xe.list=Bt(Xe.list).replace(/bull/g,Xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Xe.def.source+")").getRegex();Xe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Xe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Xe.html=Bt(Xe.html,"i").replace("comment",Xe._comment).replace("tag",Xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Xe.paragraph=Bt(Xe._paragraph).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.blockquote=Bt(Xe.blockquote).replace("paragraph",Xe.paragraph).getRegex();Xe.normal={...Xe};Xe.gfm={...Xe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Xe.gfm.table=Bt(Xe.gfm.table).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.gfm.paragraph=Bt(Xe._paragraph).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Xe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.pedantic={...Xe.normal,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:na,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(Xe.normal._paragraph).replace("hr",Xe.hr).replace("heading",` *#{1,6} *[^
|
15
|
+
]`).replace("lheading",Xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:na,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:na,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Ie._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Ie.punctuation=Bt(Ie.punctuation).replace(/punctuation/g,Ie._punctuation).getRegex();Ie.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Ie.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Ie._comment=Bt(Xe._comment).replace("(?:-->|$)","-->").getRegex();Ie.emStrong.lDelim=Bt(Ie.emStrong.lDelim).replace(/punct/g,Ie._punctuation).getRegex();Ie.emStrong.rDelimAst=Bt(Ie.emStrong.rDelimAst,"g").replace(/punct/g,Ie._punctuation).getRegex();Ie.emStrong.rDelimUnd=Bt(Ie.emStrong.rDelimUnd,"g").replace(/punct/g,Ie._punctuation).getRegex();Ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Ie._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Ie.autolink=Bt(Ie.autolink).replace("scheme",Ie._scheme).replace("email",Ie._email).getRegex();Ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Ie.tag=Bt(Ie.tag).replace("comment",Ie._comment).replace("attribute",Ie._attribute).getRegex();Ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Ie._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Ie.link=Bt(Ie.link).replace("label",Ie._label).replace("href",Ie._href).replace("title",Ie._title).getRegex();Ie.reflink=Bt(Ie.reflink).replace("label",Ie._label).replace("ref",Xe._label).getRegex();Ie.nolink=Bt(Ie.nolink).replace("ref",Xe._label).getRegex();Ie.reflinkSearch=Bt(Ie.reflinkSearch,"g").replace("reflink",Ie.reflink).replace("nolink",Ie.nolink).getRegex();Ie.normal={...Ie};Ie.pedantic={...Ie.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",Ie._label).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ie._label).getRegex()};Ie.gfm={...Ie.normal,escape:Bt(Ie.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Ie.gfm.url=Bt(Ie.gfm.url,"i").replace("email",Ie.gfm._extended_email).getRegex();Ie.breaks={...Ie.gfm,br:Bt(Ie.br).replace("{2,}","*").getRegex(),text:Bt(Ie.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function fm(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ou(e){let t="",n,r;const i=e.length;for(n=0;n<i;n++)r=e.charCodeAt(n),Math.random()>.5&&(r="x"+r.toString(16)),t+="&#"+r+";";return t}class Dr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Xr,this.options.tokenizer=this.options.tokenizer||new Ns,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Xe.normal,inline:Ie.normal};this.options.pedantic?(n.block=Xe.pedantic,n.inline=Ie.pedantic):this.options.gfm&&(n.block=Xe.gfm,this.options.breaks?n.inline=Ie.breaks:n.inline=Ie.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xe,inline:Ie}}static lex(t,n){return new Dr(n).lex(t)}static lexInline(t,n){return new Dr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
|
16
|
+
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(l,s,u)=>s+" ".repeat(u.length));let r,i,o,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(r=l.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
17
|
+
`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
18
|
+
`+r.raw,i.text+=`
|
19
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
20
|
+
`+r.raw,i.text+=`
|
21
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let l=1/0;const s=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},s),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(o=t.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],a&&i.type==="paragraph"?(i.raw+=`
|
22
|
+
`+r.raw,i.text+=`
|
23
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),a=o.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
|
24
|
+
`+r.raw,i.text+=`
|
25
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(t){const l="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,i,o,a=t,l,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+ru("a",l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+ru("a",l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,l.index+l[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(r=c.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),i=n[n.length-1],i&&r.type==="text"&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,a,u)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t,ou)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,ou))){t=t.substring(r.raw.length),n.push(r);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(h){f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,fm)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(u=r.raw.slice(-1)),s=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=r.raw,i.text+=r.text):n.push(r);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Bs{constructor(t){this.options=t||Xr}code(t,n,r){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,i);o!=null&&o!==t&&(r=!0,t=o)}return t=t.replace(/\n$/,"")+`
|
26
|
+
`,i?'<pre><code class="'+this.options.langPrefix+yn(i)+'">'+(r?t:yn(t,!0))+`</code></pre>
|
27
|
+
`:"<pre><code>"+(r?t:yn(t,!0))+`</code></pre>
|
28
|
+
`}blockquote(t){return`<blockquote>
|
29
|
+
${t}</blockquote>
|
30
|
+
`}html(t){return t}heading(t,n,r,i){if(this.options.headerIds){const o=this.options.headerPrefix+i.slug(r);return`<h${n} id="${o}">${t}</h${n}>
|
31
|
+
`}return`<h${n}>${t}</h${n}>
|
32
|
+
`}hr(){return this.options.xhtml?`<hr/>
|
33
|
+
`:`<hr>
|
34
|
+
`}list(t,n,r){const i=n?"ol":"ul",o=n&&r!==1?' start="'+r+'"':"";return"<"+i+o+`>
|
35
|
+
`+t+"</"+i+`>
|
36
|
+
`}listitem(t){return`<li>${t}</li>
|
37
|
+
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
|
38
|
+
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
39
|
+
<thead>
|
40
|
+
`+t+`</thead>
|
41
|
+
`+n+`</table>
|
42
|
+
`}tablerow(t){return`<tr>
|
43
|
+
${t}</tr>
|
44
|
+
`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+`</${r}>
|
45
|
+
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,r){if(t=tu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(t,n,r){if(t=tu(this.options.sanitize,this.options.baseUrl,t),t===null)return r;let i=`<img src="${t}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class rd{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,r){return""+r}image(t,n,r){return""+r}br(){return""}}class id{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let r=t,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[t];do i++,r=t+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[t]=i,this.seen[r]=0),r}slug(t,n={}){const r=this.serialize(t);return this.getNextSafeSlug(r,n.dryrun)}}class Or{constructor(t){this.options=t||Xr,this.options.renderer=this.options.renderer||new Bs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rd,this.slugger=new id}static parse(t,n){return new Or(n).parse(t)}static parseInline(t,n){return new Or(n).parseInline(t)}parse(t,n=!0){let r="",i,o,a,l,s,u,c,d,f,h,m,p,v,w,b,M,O,S,R;const _=t.length;for(i=0;i<_;i++){if(h=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(R=this.options.extensions.renderers[h.type].call({parser:this},h),R!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){r+=R||"";continue}switch(h.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(h.tokens),h.depth,nd(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",l=h.header.length,o=0;o<l;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),f="",l=h.rows.length,o=0;o<l;o++){for(u=h.rows[o],c="",s=u.length,a=0;a<s;a++)c+=this.renderer.tablecell(this.parseInline(u[a].tokens),{header:!1,align:h.align[a]});f+=this.renderer.tablerow(c)}r+=this.renderer.table(d,f);continue}case"blockquote":{f=this.parse(h.tokens),r+=this.renderer.blockquote(f);continue}case"list":{for(m=h.ordered,p=h.start,v=h.loose,l=h.items.length,f="",o=0;o<l;o++)b=h.items[o],M=b.checked,O=b.task,w="",b.task&&(S=this.renderer.checkbox(M),v?b.tokens.length>0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=S+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=S+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:S}):w+=S),w+=this.parse(b.tokens,v),f+=this.renderer.listitem(w,O,M);r+=this.renderer.list(f,m,p);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(f=h.tokens?this.parseInline(h.tokens):h.text;i+1<_&&t[i+1].type==="text";)h=t[++i],f+=`
|
46
|
+
`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(f):f;continue}default:{const E='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(E);return}else throw new Error(E)}}}return r}parseInline(t,n){n=n||this.renderer;let r="",i,o,a;const l=t.length;for(i=0;i<l;i++){if(o=t[i],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))){r+=a||"";continue}switch(o.type){case"escape":{r+=n.text(o.text);break}case"html":{r+=n.html(o.text);break}case"link":{r+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{r+=n.image(o.href,o.title,o.text);break}case"strong":{r+=n.strong(this.parseInline(o.tokens,n));break}case"em":{r+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{r+=n.codespan(o.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(o.tokens,n));break}case"text":{r+=n.text(o.text);break}default:{const s='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(s);return}else throw new Error(s)}}}return r}}class ra{constructor(t){this.options=t||Xr}preprocess(t){return t}postprocess(t){return t}}ct(ra,"passThroughHooks",new Set(["preprocess","postprocess"]));function hm(e,t,n){return r=>{if(r.message+=`
|
47
|
+
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+yn(r.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(r);if(n){n(r);return}throw r}}function od(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Qe.defaults,...o};const a=hm(r.silent,r.async,i);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(cm(r),r.hooks&&(r.hooks.options=r),i){const l=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(d){return a(d)}const u=function(d){let f;if(!d)try{r.walkTokens&&Qe.walkTokens(s,r.walkTokens),f=t(s,r),r.hooks&&(f=r.hooks.postprocess(f))}catch(h){d=h}return r.highlight=l,d?a(d):i(null,f)};if(!l||l.length<3||(delete r.highlight,!s.length))return u();let c=0;Qe.walkTokens(s,function(d){d.type==="code"&&(c++,setTimeout(()=>{l(d.text,d.lang,function(f,h){if(f)return u(f);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(l=>e(l,r)).then(l=>r.walkTokens?Promise.all(Qe.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>t(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(a);try{r.hooks&&(n=r.hooks.preprocess(n));const l=e(n,r);r.walkTokens&&Qe.walkTokens(l,r.walkTokens);let s=t(l,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(l){return a(l)}}}function Qe(e,t,n){return od(Dr.lex,Or.parse)(e,t,n)}Qe.options=Qe.setOptions=function(e){return Qe.defaults={...Qe.defaults,...e},Zg(Qe.defaults),Qe};Qe.getDefaults=Qc;Qe.defaults=Xr;Qe.use=function(...e){const t=Qe.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Qe.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=Qe.defaults.renderer||new Bs;for(const o in n.renderer){const a=i[o];i[o]=(...l)=>{let s=n.renderer[o].apply(i,l);return s===!1&&(s=a.apply(i,l)),s}}r.renderer=i}if(n.tokenizer){const i=Qe.defaults.tokenizer||new Ns;for(const o in n.tokenizer){const a=i[o];i[o]=(...l)=>{let s=n.tokenizer[o].apply(i,l);return s===!1&&(s=a.apply(i,l)),s}}r.tokenizer=i}if(n.hooks){const i=Qe.defaults.hooks||new ra;for(const o in n.hooks){const a=i[o];ra.passThroughHooks.has(o)?i[o]=l=>{if(Qe.defaults.async)return Promise.resolve(n.hooks[o].call(i,l)).then(u=>a.call(i,u));const s=n.hooks[o].call(i,l);return a.call(i,s)}:i[o]=(...l)=>{let s=n.hooks[o].apply(i,l);return s===!1&&(s=a.apply(i,l)),s}}r.hooks=i}if(n.walkTokens){const i=Qe.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(n.walkTokens.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}Qe.setOptions(r)})};Qe.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Qe,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Qe.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Qe.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Qe.walkTokens(r.items,t));break}default:Qe.defaults.extensions&&Qe.defaults.extensions.childTokens&&Qe.defaults.extensions.childTokens[r.type]?Qe.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Qe.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Qe.walkTokens(r.tokens,t)))}return n};Qe.parseInline=od(Dr.lexInline,Or.parseInline);Qe.Parser=Or;Qe.parser=Or.parse;Qe.Renderer=Bs;Qe.TextRenderer=rd;Qe.Lexer=Dr;Qe.lexer=Dr.lex;Qe.Tokenizer=Ns;Qe.Slugger=id;Qe.Hooks=ra;Qe.parse=Qe;Qe.options;Qe.setOptions;Qe.use;Qe.walkTokens;Qe.parseInline;Or.parse;Dr.lex;const gm=pn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class mm extends ae.PureComponent{constructor(){super(...arguments);ct(this,"targetElement",null);ct(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:i,createNode:o}=r,a=Qe(i),l=document.createRange();l.selectNodeContents(n),l.deleteContents();let s=o==null?void 0:o(a);if(s===void 0){const c=document.createElement("template");c.innerHTML=a,s=c.content}n.append(s);const u=n.getElementsByTagName("a");for(const c of u)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),ae.createElement(gm,{ref:this.containerRefHook})}}const pm=pn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),vm=pn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),bm=pn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let au=0;const jr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:a,...l}=e,{onChange:s,className:u}=l,c=g.useRef(null),d=n??"";_n(s!==void 0,"GrowingEntry must be a controlled input area");const[f]=g.useState(()=>"input-box-"+(au=(au+1)%1e7));g.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(i?0:p,p)},[]),g.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 h=g.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||r==null||r(m)},[o,r]);return g.createElement(bm,{className:"gdg-growing-entry"},g.createElement(vm,{className:u},d+`
|
48
|
+
`),g.createElement(pm,{...l,className:(u??"")+" gdg-input",id:f,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Ga={};let Rr=null;function wm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function ia(e){const t=e.toLowerCase().trim();if(Ga[t]!==void 0)return Ga[t];Rr=Rr||wm(),Rr.style.color="#000",Rr.style.color=t;const n=getComputedStyle(Rr).color;Rr.style.color="#fff",Rr.style.color=t;const r=getComputedStyle(Rr).color;if(r!==n)return[0,0,0,1];let i=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return i.length<4&&i.push(1),i=i.map(o=>Number.isNaN(o)?0:o),Ga[t]=i,i}function Yr(e,t){const[n,r,i]=ia(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const su=new Map;function lu(e,t){const n=`${e}-${t}`,r=su.get(n);if(r!==void 0)return r;const i=Ln(e,t);return su.set(n,i),i}function Ln(e,t){if(t===void 0)return e;const[n,r,i,o]=ia(e);if(o===1)return e;const[a,l,s,u]=ia(t),c=o+u*(1-o),d=(o*n+u*a*(1-o))/c,f=(o*r+u*l*(1-o))/c,h=(o*i+u*s*(1-o))/c;return`rgba(${d}, ${f}, ${h}, ${c})`}var ci=new Map,fi=new Map,ws=new Map;function ym(){ci.clear(),ws.clear(),fi.clear()}function Cm(e,t,n,r,i){var o,a,l;let s=0,u={};for(let d of e)s+=(o=n.get(d))!=null?o:i,u[d]=((a=u[d])!=null?a:0)+1;let c=t-s;for(let d of Object.keys(u)){let f=u[d],h=(l=n.get(d))!=null?l:i,m=h*f/s,p=c*m*r/f,v=h+p;n.set(d,v)}}function Sm(e,t){var n;let r=new Map,i=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;r.set(u,c),i+=c}let o=i/r.size,a=3,l=(t/o+a)/(a+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:o)*l);return r}function Ki(e,t,n,r){var i,o;let a=fi.get(n);if(r&&a!==void 0&&a.count>2e4){let u=ws.get(n);if(u===void 0&&(u=Sm(e,a.size),ws.set(n,u)),a.count>5e5){let d=0;for(let f of t)d+=(i=u.get(f))!=null?i:a.size;return d*1.01}let c=e.measureText(t);return Cm(t,c.width,u,Math.max(.05,1-a.count/2e5),a.size),fi.set(n,{count:a.count+t.length,size:a.size}),c.width}let l=e.measureText(t),s=l.width/t.length;if(((o=a==null?void 0:a.count)!=null?o:0)>2e4)return l.width;if(a===void 0)fi.set(n,{count:t.length,size:s});else{let u=s-a.size,c=t.length/(a.count+t.length),d=a.size+u*c;fi.set(n,{count:a.count+t.length,size:d})}return l.width}function xm(e,t,n,r,i,o,a,l){if(t.length<=1)return t.length;if(i<n)return-1;let s=Math.floor(n/i*o),u=Ki(e,t.slice(0,Math.max(0,s)),r,a);if(u!==n)if(u<n){for(;u<n;)s++,u=Ki(e,t.slice(0,Math.max(0,s)),r,a);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=Ki(e,t.slice(0,Math.max(0,s)),r,a)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function km(e,t,n,r,i,o){let a=`${t}_${n}_${r}px`,l=ci.get(a);if(l!==void 0)return l;if(r<=0)return[];let s=[],u=t.split(`
|
49
|
+
`),c=fi.get(n),d=c===void 0?t.length:r/c.size*1.5,f=i&&c!==void 0&&c.count>2e4;for(let h of u){let m=Ki(e,h.slice(0,Math.max(0,d)),n,f),p=Math.min(h.length,d);if(m<=r)s.push(h);else{for(;m>r;){let v=xm(e,h,r,n,m,p,f),w=h.slice(0,Math.max(0,v));h=h.slice(w.length),s.push(w),m=Ki(e,h.slice(0,Math.max(0,d)),n,f),p=Math.min(h.length,d)}m>0&&s.push(h)}}return s=s.map((h,m)=>m===0?h.trimEnd():h.trim()),ci.set(a,s),ci.size>500&&ci.delete(ci.keys().next().value),s}function Mm(e,t){return ae.useMemo(()=>e.map((n,r)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:r,sticky:r<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 Rm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(Zi(e.current.cell,t))return!0;const i=[e.current.range,...e.current.rangeStack];for(const o of i)if(n>=o.x&&n<o.x+o.width&&r>=o.y&&r<o.y+o.height)return!0}return!1}function no(e,t){return(e??"")===(t??"")}function Em(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 ad(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function Zi(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 sd(e){return[e.x+e.width-1,e.y+e.height-1]}function uu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,a=n.y+n.height-1,[l,s]=e;if(s<o||s>a)return!1;if(t.span===void 0)return l>=r&&l<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Im(e,t,n,r){let i=0;if(n.current===void 0)return i;const o=n.current.range;(r||o.height*o.width>1)&&uu(e,t,o)&&i++;for(const a of n.current.rangeStack)uu(e,t,a)&&i++;return i}function ld(e,t){let n=e;if(t!==void 0){let r=[...e];const i=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,i)):(r.splice(t.dest+1,0,i),r.splice(t.src,1)),r=r.map((o,a)=>({...o,sticky:e[a].sticky})),n=r}return n}function pi(e,t){let n=0;const r=ld(e,t);for(let i=0;i<r.length;i++){const o=r[i];if(o.sticky)n+=o.width;else break}return n}function Gr(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let i=e-t;i<e;i++)r+=n(i);return r}}function ys(e,t,n,r,i){const o=ld(e,r),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 l=t,s=i??0;for(;s<=n&&l<o.length;)s+=o[l].width,l++;for(let u=t;u<l;u++){const c=o[u];c.sticky||a.push(c)}return a}function Tm(e,t,n){let r=0;for(const i of t){const o=i.sticky?r:r+(n??0);if(e<=o+i.width)return i.sourceIndex;r+=i.width}return-1}function Dm(e,t,n,r,i,o,a,l,s,u){const c=r+i;if(n&&e<=i)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,v=typeof a=="number"?a:a(p);if(d-=v,e>=d)return p}const f=o-u,h=e-(s??0);if(typeof a=="number"){const m=Math.floor((h-c)/a)+l;return m>=f?void 0:m}else{let m=c;for(let p=l;p<f;p++){const v=a(p);if(h<=m+v)return p;m+=v}return}}let Ko=0,Ji={};const Om=typeof window>"u";async function Pm(){var e;Om||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,Ko=0,Ji={},ym())}Pm();function ud(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function Kr(e,t,n,r="middle"){const i=ud(e,t,r,n);let o=Ji[i];return o===void 0&&(o=t.measureText(e),Ji[i]=o,Ko++),Ko>1e4&&(Ji={},Ko=0),o}function cd(e,t){const n=ud(e,void 0,"middle",t);return Ji[n]}function cr(e,t){return typeof t!="string"&&(t=t.baseFontFull),_m(e,t)}function cu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const du=[];function _m(e,t){for(const o of du)if(o.key===t)return o.val;const n=cu(e,"alphabetic"),i=-(cu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return du.push({key:t,val:i}),i}function Lm(e,t,n,r,i,o){const{ctx:a,rect:l,theme:s}=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=s.bgSearchResult,a.fillRect(l.x+1,l.y+1,l.width-(i?2:1),l.height-(o?2:1)),a.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function uo(e,t,n){const{ctx:r,theme:i}=e,o=t??{},a=n??i.textDark;return a!==o.fillStyle&&(r.fillStyle=a,o.fillStyle=a),o}function Ws(e,t,n){const{rect:r,ctx:i,theme:o}=e;i.fillStyle=o.textDark,lr({ctx:i,rect:r,theme:o},t,n)}function dd(e,t,n,r,i,o,a,l,s){s==="right"?e.fillText(t,n+i-(l.cellHorizontalPadding+.5),r+o/2+a):s==="center"?e.fillText(t,n+i/2,r+o/2+a):e.fillText(t,n+l.cellHorizontalPadding+.5,r+o/2+a)}function fd(e,t){const n=Kr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Fm(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 Am(e,t,n,r,i,o,a,l,s,u){const c=l.baseFontFull,d=km(e,t,c,i-l.cellHorizontalPadding*2,u??!1),f=fd(e,c),h=l.lineHeight*f,m=f+h*(d.length-1),p=m+l.cellVerticalPadding>o;p&&(e.save(),e.rect(n,r,i,o),e.clip());const v=r+o/2-m/2;let w=Math.max(r+l.cellVerticalPadding,v);for(const b of d)if(dd(e,b,n,w,i,f,a,l,s),w+=h,w>r+o)break;p&&e.restore()}function lr(e,t,n,r,i){const{ctx:o,rect:a,theme:l}=e,{x:s,y:u,width:c,height:d}=a;r=r??!1,r||(t=Fm(t,c));const f=cr(o,l),h=$s(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(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),r?Am(o,t,s,u,c,d,f,l,n,i):dd(o,t,s,u,c,d,f,l,n),m&&(o.textAlign="start"),h&&(o.direction="inherit")}}function ur(e,t,n,r,i,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,i/2,r/2)),tr:Math.max(0,Math.min(o.tr,i/2,r/2)),bl:Math.max(0,Math.min(o.bl,i/2,r/2)),br:Math.max(0,Math.min(o.br,i/2,r/2))},e.moveTo(t+o.tl,n),e.arcTo(t+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Hm(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 zm(e,t,n){const r=function(l,s){const u=s.x-l.x,c=s.y-l.y,d=Math.sqrt(u*u+c*c),f=u/d,h=c/d;return{x:u,y:s.y-l.y,len:d,nx:f,ny:h,ang:Math.atan2(h,f)}};let i;const o=t.length;let a=t[o-1];for(let l=0;l<o;l++){let s=t[l%o];const u=t[(l+1)%o],c=r(s,a),d=r(s,u),f=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(f<-1?-1:f>1?1:f),p=1,v=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,v=!0):m>0&&(p=-1,v=!0),i=s.radius!==void 0?s.radius:n;const w=m/2;let b=Math.abs(Math.cos(w)*i/Math.sin(w)),M;b>Math.min(c.len/2,d.len/2)?(b=Math.min(c.len/2,d.len/2),M=Math.abs(b*Math.sin(w)/Math.cos(w))):M=i;let O=s.x+d.nx*b,S=s.y+d.ny*b;O+=-d.ny*M*p,S+=d.nx*M*p,e.arc(O,S,M,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,v),a=s,s=u}e.closePath()}function Cs(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m){const p={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return p;const v=o-i;if(e>=d){const w=a>e?-1:1,b=pi(h);p.x+=b+s;for(let M=a;M!==e;M+=w)p.x+=h[w===1?M:M-1].width*w}else for(let w=0;w<e;w++)p.x+=h[w].width;if(p.width=h[e].width+1,t===-1)p.y=i,p.height=v;else if(t===-2){p.y=0,p.height=i;let w=e;const b=h[e].group,M=h[e].sticky;for(;w>0&&no(h[w-1].group,b)&&h[w-1].sticky===M;){const S=h[w-1];p.x-=S.width,p.width+=S.width,w--}let O=e;for(;O+1<h.length&&no(h[O+1].group,b)&&h[O+1].sticky===M;){const S=h[O+1];p.width+=S.width,O++}if(!M){const S=pi(h),R=p.x-S;R<0&&(p.x-=R,p.width+=R),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-f){let w=c-t;for(p.y=r;w>0;){const b=t+w-1;p.height=typeof m=="number"?m:m(b),p.y-=p.height,w--}p.height+=1}else{const w=l>t?-1:1;if(typeof m=="number"){const b=t-l;p.y+=b*m}else for(let b=l;b!==t;b+=w)p.y+=m(b)*w;p.height=(typeof m=="number"?m:m(t))+1}return p}const Us=1<<21;function tr(e,t){return(t+2)*Us+e}function hd(e){return e%Us}function qs(e){return Math.floor(e/Us)-2}function Ys(e){const t=hd(e),n=qs(e);return[t,n]}class gd{constructor(){ct(this,"visibleWindow",{x:0,y:0,width:0,height:0});ct(this,"freezeCols",0);ct(this,"freezeRows",[]);ct(this,"isInWindow",t=>{const n=hd(t),r=qs(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,a=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&a})}setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&mi(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Vm extends gd{constructor(){super(...arguments);ct(this,"cache",new Map);ct(this,"setValue",(n,r)=>{this.cache.set(tr(n[0],n[1]),r)});ct(this,"getValue",n=>this.cache.get(tr(n[0],n[1])));ct(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class Qi{constructor(t=[]){ct(this,"cells");this.cells=new Set(t.map(n=>tr(n[0],n[1])))}add(t){this.cells.add(tr(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(tr(t[0],t[1]))}remove(t){this.cells.delete(tr(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(qs(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(tr(r,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 Ys(t)}}function $m(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 md={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 pd(){return md}const vd=ae.createContext(md);function Nm(){return ae.useContext(vd)}function mr(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const i in r)r.hasOwnProperty(i)&&(i==="bgCell"?n[i]=Ln(r[i],n[i]):n[i]=r[i]);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 Ss=150;function Bm(e,t,n,r){var o;const i=r(t);return((o=i==null?void 0:i.measure)==null?void 0:o.call(i,e,t,n))??Ss}function bd(e,t,n,r,i,o,a,l,s){let u=0;const c=i===void 0?[]:i.map(f=>{const h=Bm(e,f[r],t,s);return u=Math.max(u,h),h});if(c.length>5&&l){u=0;let f=0;for(const m of c)f+=m;const h=f/c.length;for(let m=0;m<c.length;m++)c[m]>=h*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 Wm(e,t,n,r,i,o,a,l,s){const u=g.useRef(t),c=g.useRef(n),d=g.useRef(a);u.current=t,c.current=n,d.current=a;const[f,h]=g.useMemo(()=>{if(typeof window>"u")return[null,null];const b=document.createElement("canvas");return b.style.display="none",b.style.opacity="0",b.style.position="fixed",[b,b.getContext("2d",{alpha:!1})]},[]);g.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f==null||f.remove()}),[f]);const m=g.useRef({}),p=g.useRef(),[v,w]=g.useState();return g.useLayoutEffect(()=>{const b=c.current;if(b===void 0||e.every(_o))return;let M=Math.max(1,10-Math.floor(e.length/1e4)),O=0;M<u.current&&M>1&&(M--,O=1);const S={x:0,y:0,width:e.length,height:Math.min(u.current,M)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const E=b(S,s.signal),x=O>0?b(R,s.signal):void 0;let L;typeof E=="object"?L=E:L=await Ll(E),x!==void 0&&(typeof x=="object"?L=[...L,...x]:L=[...L,...await Ll(x)]),p.current=e,w(L)})()},[s.signal,e]),g.useMemo(()=>{let M=e.every(_o)?e:h===null?e.map(_=>_o(_)?_:{..._,width:Ss}):(h.font=d.current.baseFontFull,e.map((_,E)=>{if(_o(_))return _;if(m.current[_.id]!==void 0)return{..._,width:m.current[_.id]};if(v===void 0||p.current!==e||_.id===void 0)return{..._,width:Ss};const x=bd(h,a,_,E,v,i,o,!0,l);return m.current[_.id]=x.width,x})),O=0,S=0;const R=[];for(const[_,E]of M.entries())O+=E.width,E.grow!==void 0&&E.grow>0&&(S+=E.grow,R.push(_));if(O<r&&R.length>0){const _=[...M],E=r-O;let x=E;for(let L=0;L<R.length;L++){const D=R[L],C=(M[D].grow??0)/S,I=L===R.length-1?x:Math.min(x,Math.floor(E*C));_[D]={...M[D],growOffset:I,width:M[D].width+I},x-=I}M=_}return{sizedColumns:M,nonGrowWidth:O}},[r,e,h,v,a,i,o,l])}var Ka,fu;function Um(){if(fu)return Ka;fu=1;function e(t,n,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),n!==void 0&&(t=t>=n?t:n)),t}return Ka=e,Ka}var Za,hu;function qm(){if(hu)return Za;hu=1;var e=Um(),t=Rc();function n(r,i,o){return o===void 0&&(o=i,i=void 0),o!==void 0&&(o=t(o),o=o===o?o:0),i!==void 0&&(i=t(i),i=i===i?i:0),e(t(r),i,o)}return Za=n,Za}var Ym=qm();const Wn=vr(Ym);var Ja,gu;function Xm(){if(gu)return Ja;gu=1;function e(){}return Ja=e,Ja}var Qa,mu;function jm(){if(mu)return Qa;mu=1;var e=dh(),t=Xm(),n=Ec(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return Qa=i,Qa}var es,pu;function Gm(){if(pu)return es;pu=1;var e=fh(),t=hh(),n=mh(),r=gh(),i=jm(),o=Ec(),a=200;function l(s,u,c){var d=-1,f=t,h=s.length,m=!0,p=[],v=p;if(c)m=!1,f=n;else if(h>=a){var w=u?null:i(s);if(w)return o(w);m=!1,f=r,v=new e}else v=u?[]:p;e:for(;++d<h;){var b=s[d],M=u?u(b):b;if(b=c||b!==0?b:0,m&&M===M){for(var O=v.length;O--;)if(v[O]===M)continue e;u&&v.push(M),p.push(b)}else f(v,M,c)||(v!==p&&v.push(M),p.push(b))}return p}return es=l,es}var ts,vu;function Km(){if(vu)return ts;vu=1;var e=Gm();function t(n){return n&&n.length?e(n):[]}return ts=t,ts}var Zm=Km();const Jm=vr(Zm);var Qm=ph();const bu=vr(Qm),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',ep=e=>{const t=e.fgColor,n=e.bgColor;return`
|
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>`},tp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
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>`},np=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
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}"/>
|
54
|
+
<path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
|
55
|
+
</svg>`},rp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
56
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
57
|
+
<path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
|
58
|
+
</svg>`},ip=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
59
|
+
<path
|
60
|
+
d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
|
61
|
+
fill="${n}"
|
62
|
+
/>
|
63
|
+
<path
|
64
|
+
fill-rule="evenodd"
|
65
|
+
clip-rule="evenodd"
|
66
|
+
d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
|
67
|
+
fill="${t}"
|
68
|
+
/>
|
69
|
+
</svg>`},wd=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
70
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
71
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
|
72
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
|
73
|
+
</svg>
|
74
|
+
`},op=e=>{const t=e.bgColor;return`${Yt}
|
75
|
+
<path stroke="${t}" stroke-width="2" d="M12 3v14"/>
|
76
|
+
<path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
|
77
|
+
<path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
|
78
|
+
</svg>
|
79
|
+
`},ap=wd,sp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
80
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
81
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
|
82
|
+
</svg>`},lp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
83
|
+
${Yt}
|
84
|
+
<path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
|
85
|
+
<path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
|
86
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
87
|
+
<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}"/>
|
88
|
+
<path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
|
89
|
+
<path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
|
90
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
|
91
|
+
</svg>`},up=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
92
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
93
|
+
<path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
|
94
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
|
95
|
+
</svg>`},cp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
96
|
+
${Yt}
|
97
|
+
<path fill="${t}" d="M3 3h14v14H3z"/>
|
98
|
+
<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 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
|
99
|
+
</svg>`},dp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
100
|
+
${Yt}
|
101
|
+
<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}"/>
|
102
|
+
<path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
|
103
|
+
</svg>`},fp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
104
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
105
|
+
<path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
|
106
|
+
</svg>`},hp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
107
|
+
${Yt}
|
108
|
+
<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}"/>
|
109
|
+
<path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
|
110
|
+
<path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
|
111
|
+
</svg>`},gp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
112
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
113
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
|
114
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
|
115
|
+
</svg>`},mp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
116
|
+
${Yt}
|
117
|
+
<rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
|
118
|
+
<rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
|
119
|
+
<path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
|
120
|
+
</svg>`},pp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
121
|
+
<path fill="${t}" d="M4 3h12v14H4z"/>
|
122
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
|
123
|
+
</svg>`},vp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
124
|
+
${Yt}
|
125
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
126
|
+
<path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
|
127
|
+
</svg>`},bp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
128
|
+
${Yt}
|
129
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
130
|
+
<path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
|
131
|
+
</svg>`},wp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
132
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
133
|
+
<path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
|
134
|
+
</svg>`},yp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
135
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
136
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
|
137
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
|
138
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
|
139
|
+
<path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
|
140
|
+
</svg>`},Cp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
141
|
+
${Yt}
|
142
|
+
<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}"/>
|
143
|
+
<path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
|
144
|
+
</svg>`},Sp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
145
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
146
|
+
<path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
|
147
|
+
</svg>`},xp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
148
|
+
${Yt}
|
149
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
150
|
+
<path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
|
151
|
+
</svg>`},kp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
152
|
+
<path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
|
153
|
+
<path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
|
154
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
|
155
|
+
</svg>`},Mp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
|
156
|
+
<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
|
157
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
|
158
|
+
</svg>`},Rp=e=>{const t=e.fgColor;return`
|
159
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
160
|
+
<path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
|
161
|
+
</svg>`},Ep=e=>{const t=e.fgColor;return`
|
162
|
+
<svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
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
|
+
</svg>
|
165
|
+
`},Ip={headerRowID:ep,headerNumber:np,headerCode:tp,headerString:rp,headerBoolean:ip,headerAudioUri:ap,headerVideoUri:sp,headerEmoji:lp,headerImage:up,headerUri:wd,headerPhone:cp,headerMarkdown:dp,headerDate:fp,headerTime:hp,headerEmail:gp,headerReference:mp,headerIfThenElse:pp,headerSingleValue:vp,headerLookup:bp,headerTextTemplate:wp,headerMath:yp,headerRollup:Cp,headerJoinStrings:Sp,headerSplitString:xp,headerGeoDistance:kp,headerArray:Mp,rowOwnerOverlay:Rp,protectedColumnOverlay:Ep,renameIcon:op};function Tp(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Dp{constructor(t,n){ct(this,"onSettled");ct(this,"spriteMap",new Map);ct(this,"headerIcons");ct(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,a,l,s=1){const[u,c]=Tp(n,l),d=a*Math.ceil(window.devicePixelRatio),f=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(f);if(h===void 0){const m=this.headerIcons[t];if(m===void 0)return;h=document.createElement("canvas");const p=h.getContext("2d");if(p===null)return;const v=new Image;v.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(f,h);const w=v.decode();if(w===void 0)return;this.inFlight++,w.then(()=>{p.drawImage(v,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(h,0,0,d,d,i,o,a,a),s<1&&(r.globalAlpha=1)}}function yd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function va(e,t,n,r,i,o,a,l,s){l=l??t;let u=t,c=e;const d=r-o;let f=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>l&&s(u,c,h,!1,a&&c===r-1)===!0){f=!0;break}u+=h,c++}if(!f){u=n;for(let h=0;h<o;h++){c=r-1-h;const m=i(c);u-=m,s(u,c,m,!0,a&&c===r-1)}}}function Pr(e,t,n,r,i,o){let a=0,l=0;const s=i+r;for(const u of e){const c=u.sticky?l:a+n;if(o(u,c,s,u.sticky?0:l,t)===!0)break;a+=u.width,l+=u.sticky?u.width:0}}function Cd(e,t,n,r,i){let o=0,a=0;for(let l=0;l<e.length;l++){const s=e[l];let u=l+1,c=s.width;for(s.sticky&&(a+=c);u<e.length&&no(e[u].group,s.group)&&e[u].sticky===e[l].sticky;){const p=e[u];c+=p.width,u++,l++,p.sticky&&(a+=p.width)}const d=s.sticky?0:n,f=o+d,h=s.sticky?0:Math.max(0,a-f),m=Math.min(c-h,t-(f+h));i([s.sourceIndex,e[u-1].sourceIndex],s.group??"",f+h,0,m,r),o+=c}}function Sd(e,t,n,r,i,o,a){var f;const[l,s]=e;let u,c;const d=((f=a.find(h=>!h.sticky))==null?void 0:f.sourceIndex)??0;if(s>d){const h=Math.max(l,d);let m=t,p=r;for(let v=o.sourceIndex-1;v>=h;v--)m-=a[v].width,p+=a[v].width;for(let v=o.sourceIndex+1;v<=s;v++)p+=a[v].width;c={x:m,y:n,width:p,height:i}}if(d>l){const h=Math.min(s,d-1);let m=t,p=r;for(let v=o.sourceIndex-1;v>=l;v--)m-=a[v].width,p+=a[v].width;for(let v=o.sourceIndex+1;v<=h;v++)p+=a[v].width;u={x:m,y:n,width:p,height:i}}return[u,c]}function Op(e,t,n,r){if(r==="any")return xd(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),ad([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,a=n-e.y+1,l=e.y+e.height-n,s=Math.min(r==="vertical"?Number.MAX_SAFE_INTEGER:i,r==="vertical"?Number.MAX_SAFE_INTEGER:o,r==="horizontal"?Number.MAX_SAFE_INTEGER:a,r==="horizontal"?Number.MAX_SAFE_INTEGER:l);return s===l?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===a?{x:e.x,y:n,width:e.width,height:e.y-n}:s===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 ro(e,t,n,r,i,o,a,l){return e<=i+a&&i<=e+n&&t<=o+l&&o<=t+r}function qr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function xd(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),i=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-r;return{x:n,y:r,width:i,height:o}}function Pp(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 _p(e,t,n,r){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 i=-4,o=-4,a=t+4,l=n+4,s=i-e.x,u=e.x+e.width-a,c=o-e.y,d=e.y+e.height-l,f=s>0?e.x+Math.floor(s/r)*r:e.x,h=u>0?e.x+e.width-Math.floor(u/r)*r:e.x+e.width,m=c>0?e.y+Math.floor(c/r)*r:e.y,p=d>0?e.y+e.height-Math.floor(d/r)*r:e.y+e.height;return{x:f,y:m,width:h-f,height:p-m}}function Lp(e,t,n,r,i){const[o,a,l,s]=t,[u,c,d,f]=i,{x:h,y:m,width:p,height:v}=e,w=[];if(p<=0||v<=0)return w;const b=h+p,M=m+v,O=h<o,S=m<a,R=h+p>l,_=m+v>s,E=h>=o&&h<l||b>o&&b<=l||h<o&&b>l,x=m>=a&&m<s||M>a&&M<=s||m<a&&M>s;if(E&&x){const D=Math.max(h,o),C=Math.max(m,a),I=Math.min(b,l),T=Math.min(M,s);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:c,width:d-u+1,height:f-c+1}})}if(O&&S){const D=h,C=m,I=Math.min(b,o),T=Math.min(M,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:0,width:u+1,height:c+1}})}if(S&&E){const D=Math.max(h,o),C=m,I=Math.min(b,l),T=Math.min(M,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(S&&R){const D=Math.max(h,l),C=m,I=b,T=Math.min(M,a);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(O&&x){const D=h,C=Math.max(m,a),I=Math.min(b,o),T=Math.min(M,s);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:c,width:u+1,height:f-c+1}})}if(R&&x){const D=Math.max(h,l),C=Math.max(m,a),I=b,T=Math.min(M,s);w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:c,width:n-d+1,height:f-c+1}})}if(O&&_){const D=h,C=Math.max(m,s),I=Math.min(b,o),T=M;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:0,y:f,width:u+1,height:r-f+1}})}if(_&&E){const D=Math.max(h,o),C=Math.max(m,s),I=Math.min(b,l),T=M;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:u,y:f,width:d-u+1,height:r-f+1}})}if(R&&_){const D=Math.max(h,l),C=Math.max(m,s),I=b,T=M;w.push({rect:{x:D,y:C,width:I-D,height:T-C},clip:{x:d,y:f,width:n-d+1,height:r-f+1}})}return w}const Fp={kind:te.Loading,allowOverlay:!1};function wu(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w,b,M,O,S,R,_,E,x,L,D,C,I,T,k,V,N,U){let oe=(M==null?void 0:M.size)??Number.MAX_SAFE_INTEGER;const ee=performance.now();let j=I.baseFontFull;e.font=j;const ne={ctx:e},ie=[0,0],ue=v>0?Gr(s,v,u):0;let he,J;const H=yd(b);return Pr(t,l,o,a,i,(P,q,fe,ge,Ve)=>{const pe=Math.max(0,ge-q),je=q+pe,Me=i+1,Pt=P.width-pe,Rt=r-i-1;if(b.length>0){let $e=!1;for(let Oe=0;Oe<b.length;Oe++){const nt=b[Oe];if(ro(je,Me,Pt,Rt,nt.x,nt.y,nt.width,nt.height)){$e=!0;break}}if(!$e)return}const et=()=>{e.save(),e.beginPath(),e.rect(je,Me,Pt,Rt),e.clip()},le=O.columns.hasIndex(P.sourceIndex),Ge=d(P.group??"").overrideTheme,be=P.themeOverride===void 0&&Ge===void 0?I:mr(I,Ge,P.themeOverride),ce=be.baseFontFull;ce!==j&&(j=ce,e.font=ce),et();let ve;return va(Ve,fe,r,s,u,v,w,H,($e,Oe,nt,me,Ee)=>{var hn,gn,bn;if(Oe<0||(ie[0]=P.sourceIndex,ie[1]=Oe,M!==void 0&&!M.has(ie)))return;if(b.length>0){let st=!1;for(let zt=0;zt<b.length;zt++){const Ot=b[zt];if(ro(q,$e,P.width,nt,Ot.x,Ot.y,Ot.width,Ot.height)){st=!0;break}}if(!st)return}const at=O.rows.hasIndex(Oe),He=h.hasIndex(Oe),rt=Oe<s?c(ie):Fp;let bt=q,ht=P.width,ze=!1,Tt=!1;if(rt.span!==void 0){const[st,zt]=rt.span,Ot=`${Oe},${st},${zt},${P.sticky}`;if(J===void 0&&(J=new Set),J.has(Ot)){oe--;return}else{const nn=Sd(rt.span,q,$e,P.width,nt,P,n),Dt=P.sticky?nn[0]:nn[1];if(!P.sticky&&nn[0]!==void 0&&(Tt=!0),Dt!==void 0){bt=Dt.x,ht=Dt.width,J.add(Ot),e.restore(),ve=void 0,e.save(),e.beginPath();const Vt=Math.max(0,ge-Dt.x);e.rect(Dt.x+Vt,$e,Dt.width-Vt,nt),he===void 0&&(he=[]),he.push({x:Dt.x+Vt,y:$e,width:Dt.width-Vt,height:nt}),e.clip(),ze=!0}}}const Xt=f==null?void 0:f(Oe),pt=Ee&&((hn=P.trailingRowOptions)==null?void 0:hn.themeOverride)!==void 0?(gn=P.trailingRowOptions)==null?void 0:gn.themeOverride:void 0,Et=rt.themeOverride===void 0&&Xt===void 0&&pt===void 0?be:mr(be,Xt,pt,rt.themeOverride);e.beginPath();const Kt=Em(ie,rt,O);let Ft=Im(ie,rt,O,p);const xn=rt.span!==void 0&&O.columns.some(st=>rt.span!==void 0&&st>=rt.span[0]&&st<=rt.span[1]);Kt&&!m&&p?Ft=0:Kt&&p&&(Ft=Math.max(Ft,1)),xn&&Ft++,Kt||(at&&Ft++,le&&!Ee&&Ft++);const Wt=rt.kind===te.Protected?Et.bgCellMedium:Et.bgCell;let xt;if((me||Wt!==I.bgCell)&&(xt=Ln(Wt,xt)),Ft>0||He){He&&(xt=Ln(Et.bgHeader,xt));for(let st=0;st<Ft;st++)xt=Ln(Et.accentLight,xt)}else if(S!==void 0){for(const st of S)if(st[0]===P.sourceIndex&&st[1]===Oe){xt=Ln(Et.bgSearchResult,xt);break}}if(R!==void 0)for(let st=0;st<R.length;st++){const zt=R[st],Ot=zt.range;zt.style!=="solid-outline"&&Ot.x<=P.sourceIndex&&P.sourceIndex<Ot.x+Ot.width&&Ot.y<=Oe&&Oe<Ot.y+Ot.height&&(xt=Ln(zt.color,xt))}let In=!1;if(M!==void 0){const st=$e+1,Ot=(me?st+nt-1:Math.min(st+nt-1,r-ue))-st;(Ot!==nt-1||bt+1<=ge)&&(In=!0,e.save(),e.beginPath(),e.rect(bt+1,st,ht-1,Ot),e.clip()),xt=xt===void 0?Et.bgCell:Ln(xt,Et.bgCell)}const vn=P.sourceIndex===n.length-1,Pe=Oe===s-1;xt!==void 0&&(e.fillStyle=xt,ve!==void 0&&(ve.fillStyle=xt),M!==void 0?e.fillRect(bt+1,$e+1,ht-(vn?2:1),nt-(Pe?2:1)):e.fillRect(bt,$e,ht,nt)),rt.style==="faded"&&(e.globalAlpha=.6);let At;for(let st=0;st<x.length;st++){const zt=x[st];if(zt.item[0]===P.sourceIndex&&zt.item[1]===Oe){At=zt;break}}if(ht>U&&!Tt){const st=Et.baseFontFull;st!==j&&(e.font=st,j=st),ve=kd(e,rt,P.sourceIndex,Oe,vn,Pe,bt,$e,ht,nt,Ft>0,Et,xt??Et.bgCell,_,E,(At==null?void 0:At.hoverAmount)??0,L,C,ee,D,ve,T,k,V,N)}return In&&e.restore(),rt.style==="faded"&&(e.globalAlpha=1),oe--,ze&&(e.restore(),(bn=ve==null?void 0:ve.deprep)==null||bn.call(ve,ne),ve=void 0,et(),j=ce,e.font=ce),oe<=0}),e.restore(),oe<=0}),he}const Ni=[0,0],Bi={x:0,y:0,width:0,height:0},ns=[void 0,()=>{}];let xs=!1;function Ap(){xs=!0}function kd(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w,b,M,O,S,R,_,E){var k,V;let x,L;v!==void 0&&v[0][0]===n&&v[0][1]===r&&(x=v[1][0],L=v[1][1]);let D;Ni[0]=n,Ni[1]=r,Bi.x=a,Bi.y=l,Bi.width=s,Bi.height=u,ns[0]=R.getValue(Ni),ns[1]=N=>R.setValue(Ni,N),xs=!1;const C={ctx:e,theme:d,col:n,row:r,cell:t,rect:Bi,highlighted:c,cellFillColor:f,hoverAmount:p,frameTime:b,hoverX:x,drawState:ns,hoverY:L,imageLoader:h,spriteManager:m,hyperWrapping:w,overrideCursor:x!==void 0?E:void 0,requestAnimationFrame:Ap},I=Lm(C,t.lastUpdated,b,O,i,o),T=_(t);if(T!==void 0){(O==null?void 0:O.renderer)!==T&&((k=O==null?void 0:O.deprep)==null||k.call(O,C),O=void 0);const N=(V=T.drawPrep)==null?void 0:V.call(T,C,O);M!==void 0&&!di(C.cell)?M(C,()=>T.draw(C,t)):T.draw(C,t),D=N===void 0?void 0:{deprep:N==null?void 0:N.deprep,fillStyle:N==null?void 0:N.fillStyle,font:N==null?void 0:N.font,renderer:T}}return(I||xs)&&(S==null||S(Ni)),D}function Xs(e,t,n,r,i,o,a,l,s=-20,u=-20,c=32,d="center",f="square"){const h=Math.floor(i+a/2),m=f==="circle"?1e4:t.roundingRadius??4;let p=Kc(c,a,t.cellVerticalPadding),v=p/2;const w=Gc(d,r,o,t.cellHorizontalPadding,p),b=jc(w,h,p),M=Zc(r+s,i+u,b);switch(n){case!0:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),f==="circle"&&(v*=.8,p*=.8),e.fillStyle=l?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(w-v+p/4.23,h-v+p/1.97),e.lineTo(w-v+p/2.42,h-v+p/1.44),e.lineTo(w-v+p/1.29,h-v+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ea:case!1:{e.beginPath(),ur(e,w-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=M?t.textDark:t.textMedium,e.stroke();break}case As:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),e.fillStyle=M?t.textMedium:t.textLight,e.fill(),f==="circle"&&(v*=.8,p*=.8),e.beginPath(),e.moveTo(w-p/3,h),e.lineTo(w+p/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:to()}}function Hp(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w,b){var x,L,D,C;const M=a+l;if(M<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,M);const O=(x=r==null?void 0:r[0])==null?void 0:x[0],S=(L=r==null?void 0:r[0])==null?void 0:L[1],R=(D=r==null?void 0:r[1])==null?void 0:D[0],_=(C=r==null?void 0:r[1])==null?void 0:C[1],E=d.headerFontFull;e.font=E,Pr(t,0,o,0,M,(I,T,k,V)=>{var P;if(v!==void 0&&!v.has([I.sourceIndex,-1]))return;const N=Math.max(0,V-T);e.save(),e.beginPath(),e.rect(T+N,l,I.width-N,a),e.clip();const U=p(I.group??"").overrideTheme,oe=I.themeOverride===void 0&&U===void 0?d:mr(d,U,I.themeOverride);oe.bgHeader!==d.bgHeader&&(e.fillStyle=oe.bgHeader,e.fill()),oe!==d&&(e.font=oe.baseFontFull);const ee=c.columns.hasIndex(I.sourceIndex),j=s!==void 0||u,ne=!j&&S===-1&&O===I.sourceIndex,ie=j?0:((P=h.find(q=>q.item[0]===I.sourceIndex&&q.item[1]===-1))==null?void 0:P.hoverAmount)??0,ue=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===I.sourceIndex,he=ee?oe.accentColor:ue?oe.bgHeaderHasFocus:oe.bgHeader,J=n?l:0,H=I.sourceIndex===0?0:1;ee?(e.fillStyle=he,e.fillRect(T+H,J,I.width-H,a)):(ue||ie>0)&&(e.beginPath(),e.rect(T+H,J,I.width-H,a),ue&&(e.fillStyle=oe.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=oe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Ed(e,T,J,I.width,a,I,ee,oe,ne,ne?R:void 0,ne?_:void 0,ue,ie,f,w,b),e.restore()}),n&&zp(e,t,i,o,l,r,d,f,h,m,p,v)}function zp(e,t,n,r,i,o,a,l,s,u,c,d){const[h,m]=(o==null?void 0:o[0])??[];let p=0;Cd(t,n,r,i,(v,w,b,M,O,S)=>{if(d!==void 0&&!d.hasItemInRectangle({x:v[0],y:-2,width:v[1]-v[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(b,M,O,S),e.clip();const R=c(w),_=(R==null?void 0:R.overrideTheme)===void 0?a:mr(a,R.overrideTheme),E=m===-2&&h!==void 0&&h>=v[0]&&h<=v[1],x=E?_.bgHeaderHovered:_.bgHeader;if(x!==a.bgHeader&&(e.fillStyle=x,e.fill()),e.fillStyle=_.textGroupHeader??_.textHeader,R!==void 0){let L=b;if(R.icon!==void 0&&(l.drawSprite(R.icon,"normal",e,L+8,(i-20)/2,20,_),L+=26),e.fillText(R.name,L+8,i/2+cr(e,a.headerFontFull)),R.actions!==void 0&&E){const D=Md({x:b,y:M,width:O,height:S},R.actions);e.beginPath();const C=D[0].x-10,I=b+O-C;e.rect(C,0,I,i);const T=e.createLinearGradient(C,0,C+I,0),k=Yr(x,0);T.addColorStop(0,k),T.addColorStop(10/I,x),T.addColorStop(1,x),e.fillStyle=T,e.fill(),e.globalAlpha=.6;const[V,N]=(o==null?void 0:o[1])??[-1,-1];for(let U=0;U<R.actions.length;U++){const oe=R.actions[U],ee=D[U],j=qr(ee,V+b,N);j&&(e.globalAlpha=1),l.drawSprite(oe.icon,"normal",e,ee.x+ee.width/2-10,ee.y+ee.height/2-10,20,_),j&&(e.globalAlpha=.6)}e.globalAlpha=1}}b!==0&&u(v[0])&&(e.beginPath(),e.moveTo(b+.5,0),e.lineTo(b+.5,i),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=b+O}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,i),e.moveTo(0,i+.5),e.lineTo(n,i+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const zo=30;function Vp(e,t,n,r,i){return{x:e+n-zo,y:Math.max(t,t+r/2-zo/2),width:zo,height:Math.min(zo,r)}}function Md(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,a=26;for(let l=0;l<t.length;l++)n.push({x:r,y:i,width:a,height:o}),r+=26;return n}function Wi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Rd(e,t,n,r,i,o,a,l){var w;const s=a.cellHorizontalPadding,u=a.headerIconSize,c=Vp(n,r,i,o);let d=n+s;const f=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=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:r,width:i-d,height:o};let p;if(t.indicatorIcon!==void 0){const b=e===void 0?((w=cd(t.title,a.headerFontFull))==null?void 0:w.width)??0:Kr(t.title,e,a.headerFontFull).width;m.width=b,d+=b+s,p={x:d,y:r+(o-u)/2,width:u,height:u}}const v=n+i/2;return{menuBounds:Wi(c,v,l),iconBounds:Wi(f,v,l),iconOverlayBounds:Wi(h,v,l),textBounds:Wi(m,v,l),indicatorIconBounds:Wi(p,v,l)}}function yu(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const b=o.rowMarkerChecked;b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const M=o.headerRowMarkerTheme!==void 0?mr(l,o.headerRowMarkerTheme):l;Xs(e,M,b,t,n,r,i,!1,void 0,void 0,18,"center",o.rowMarker),b!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const v=a?l.textHeaderSelected:l.textHeader,w=o.hasMenu===!0&&(s||h&&a)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let b=a?"selected":"normal";o.style==="highlight"&&(b=a?"selected":"special"),f.drawSprite(o.icon,b,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,l),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,l)}if(w&&r>35){const M=m?35:r-35,O=m?35*.7:r-35*.7,S=M/r,R=O/r,_=e.createLinearGradient(t,0,t+r,0),E=Yr(v,0);_.addColorStop(m?1:0,v),_.addColorStop(S,v),_.addColorStop(R,E),_.addColorStop(m?0:1,E),e.fillStyle=_}else e.fillStyle=v;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+i/2+cr(e,l.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!w||!ro(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 b=a?"selected":"normal";o.style==="highlight"&&(b=a?"selected":"special"),f.drawSprite(o.indicatorIcon,b,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,l)}if(w&&p.menuBounds!==void 0){const b=p.menuBounds,M=u!==void 0&&c!==void 0&&qr(b,u+t,c+n);if(M||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===ta.Triangle){e.beginPath();const O=b.x+b.width/2-5.5,S=b.y+b.height/2-3;zm(e,[{x:O,y:S},{x:O+11,y:S},{x:O+5.5,y:S+6}],1),e.fillStyle=v,e.fill()}else if(o.menuIcon===ta.Dots){e.beginPath();const O=b.x+b.width/2,S=b.y+b.height/2;Hm(e,O,S),e.fillStyle=v,e.fill()}else{const O=b.x+(b.width-l.headerIconSize)/2,S=b.y+(b.height-l.headerIconSize)/2;f.drawSprite(o.menuIcon,"normal",e,O,S,l.headerIconSize,l)}M||(e.globalAlpha=1)}}function Ed(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p){const v=$s(o.title)==="rtl",w=Rd(e,o,t,n,r,i,l,v);m!==void 0?m({ctx:e,theme:l,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:a,hoverAmount:f,isHovered:s,hasSelectedCell:d,spriteManager:h,menuBounds:(w==null?void 0:w.menuBounds)??{x:0,y:0,height:0,width:0}},()=>yu(e,t,n,r,i,o,a,l,s,u,c,f,h,p,v,w)):yu(e,t,n,r,i,o,a,l,s,u,c,f,h,p,v,w)}function $p(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w,b){if(w!==void 0||t[t.length-1]!==n[t.length-1])return;const M=yd(v);Pr(t,s,a,l,o,(O,S,R,_,E)=>{if(O!==t[t.length-1])return;S+=O.width;const x=Math.max(S,_);x>r||(e.save(),e.beginPath(),e.rect(x,o+1,1e4,i-o-1),e.clip(),va(E,R,i,u,c,m,p,M,(L,D,C,I)=>{if(!I&&v.length>0&&!v.some(U=>ro(S,L,1e4,C,U.x,U.y,U.width,U.height)))return;const T=f.hasIndex(D),k=h.hasIndex(D);e.beginPath();const V=d==null?void 0:d(D),N=V===void 0?b:mr(b,V);N.bgCell!==b.bgCell&&(e.fillStyle=N.bgCell,e.fillRect(S,L,1e4,C)),k&&(e.fillStyle=N.bgHeader,e.fillRect(S,L,1e4,C)),T&&(e.fillStyle=N.accentLight,e.fillRect(S,L,1e4,C))}),e.restore())})}function Np(e,t,n,r,i,o,a,l,s){let u=!1;for(const m of t)if(!m.sticky){u=a(m.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,d=s.borderColor,f=u?pi(t):0;let h;if(f!==0&&(h=lu(d,s.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,r),e.strokeStyle=h,e.stroke()),i>0){const m=d===c&&h!==void 0?h:lu(c,s.bgCell),p=Gr(o,i,l);e.beginPath(),e.moveTo(0,r-p+.5),e.lineTo(n,r-p+.5),e.strokeStyle=m,e.stroke()}}const Id=(e,t,n)=>{let r=0,i=t,o=0,a=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const l of e)r=Math.min(r,l.x-1),i=Math.max(i,l.x+l.width+1),o=Math.min(o,l.y-1),a=Math.max(a,l.y+l.height+1)}return{minX:r,maxX:i,minY:o,maxY:a}};function Bp(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m){var C;const p=m.bgCell,{minX:v,maxX:w,minY:b,maxY:M}=Id(l,o,a),O=[],S=a-Gr(h,f,u);let R=s,_=n,E=0;for(;R+i<S;){const I=R+i,T=u(_);if(I>=b&&I<=M-1){const k=c==null?void 0:c(_),V=k==null?void 0:k.bgCell;V!==void 0&&V!==p&&_>=h-f&&O.push({x:v,y:I,w:w-v,h:T,color:V})}R+=T,_<h-f&&(E=R),_++}let x=0;const L=Math.min(S,M)-E;if(L>0)for(let I=0;I<t.length;I++){const T=t[I];if(T.width===0)continue;const k=T.sticky?x:x+r,V=(C=T.themeOverride)==null?void 0:C.bgCell;V!==void 0&&V!==p&&k>=v&&k<=w&&d(I+1)&&O.push({x:k,y:E,w:T.width,h:L,color:V}),x+=T.width}if(O.length===0)return;let D;e.beginPath();for(let I=O.length-1;I>=0;I--){const T=O[I];D===void 0?D=T.color:T.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=T.color),e.rect(T.x,T.y,T.w,T.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function Cu(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,a);for(const C of s)e.rect(C.x+1,C.y+1,C.width-1,C.height-1);e.clip("evenodd")}const b=v.horizontalBorderColor??v.borderColor,M=v.borderColor,{minX:O,maxX:S,minY:R,maxY:_}=Id(l,o,a),E=[];e.beginPath();let x=.5;for(let C=0;C<t.length;C++){const I=t[C];if(I.width===0)continue;x+=I.width;const T=I.sticky?x:x+r;T>=O&&T<=S&&h(C+1)&&E.push({x1:T,y1:Math.max(u,R),x2:T,y2:Math.min(a,_),color:M})}let L=a+.5;for(let C=p-m;C<p;C++){const I=d(C);L-=I,E.push({x1:O,y1:L,x2:S,y2:L,color:b})}if(w!==!0){let C=c+.5,I=n;const T=L;for(;C+i<T;){const k=C+i;if(k>=R&&k<=_-1){const V=f==null?void 0:f(I);E.push({x1:O,y1:k,x2:S,y2:k,color:(V==null?void 0:V.horizontalBorderColor)??(V==null?void 0:V.borderColor)??b})}C+=d(I),I++}}const D=vh(E,C=>C.color);for(const C of Object.keys(D)){e.strokeStyle=C;for(const I of D[C])e.moveTo(I.x1,I.y1),e.lineTo(I.x2,I.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function Wp(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v,w,b){const M=[];e.imageSmoothingEnabled=!1;const O=Math.min(i.cellYOffset,a),S=Math.max(i.cellYOffset,a);let R=0;if(typeof w=="number")R+=(S-O)*w;else for(let T=O;T<S;T++)R+=w(T);a>i.cellYOffset&&(R=-R),R+=s-i.translateY;const _=Math.min(i.cellXOffset,o),E=Math.max(i.cellXOffset,o);let x=0;for(let T=_;T<E;T++)x+=p[T].width;o>i.cellXOffset&&(x=-x),x+=l-i.translateX;const L=pi(v);if(x!==0&&R!==0)return{regions:[]};const D=u>0?Gr(f,u,w):0,C=c-L-Math.abs(x),I=d-h-D-Math.abs(R)-1;if(C>150&&I>150){const T={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(R>0?(T.sy=(h+1)*m,T.sh=I*m,T.dy=(R+h+1)*m,T.dh=I*m,M.push({x:0,y:h,width:c,height:R+1})):R<0&&(T.sy=(-R+h+1)*m,T.sh=I*m,T.dy=(h+1)*m,T.dh=I*m,M.push({x:0,y:d+R-D,width:c,height:-R+D})),x>0?(T.sx=L*m,T.sw=C*m,T.dx=(x+L)*m,T.dw=C*m,M.push({x:L-1,y:0,width:x+2,height:d})):x<0&&(T.sx=(L-x)*m,T.sw=C*m,T.dx=L*m,T.dw=C*m,M.push({x:c+x,y:0,width:-x,height:d})),e.setTransform(1,0,0,1,0,0),b){if(L>0&&x!==0&&R===0&&(r===void 0||(n==null?void 0:n[1])!==!1)){const k=L*m,V=d*m;e.drawImage(t,0,0,k,V,0,0,k,V)}if(D>0&&x===0&&R!==0&&(r===void 0||(n==null?void 0:n[0])!==!1)){const k=(d-D)*m,V=c*m,N=D*m;e.drawImage(t,0,k,V,N,0,k,V,N)}}e.drawImage(t,T.sx,T.sy,T.sw,T.sh,T.dx,T.dy,T.dw,T.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:M}}function Up(e,t,n,r,i,o,a,l,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Pr(s,n,r,i,l,(d,f,h,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 qp(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 r=0;r<e.mappedColumns.length;r++){const i=e.mappedColumns[r],o=t.mappedColumns[r];if(mi(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:a,...l}=i,{width:s,...u}=o;if(!mi(l,u))return!1;n=r}return n===void 0?!0:n}return!0}function Su(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p){const v=m==null?void 0:m.filter(_=>_.style!=="no-outline");if(v===void 0||v.length===0)return;const w=pi(l),b=Gr(h,f,d),M=[s,0,l.length,h-f],O=[w,0,t,n-b],S=v.map(_=>{const E=_.range,x=_.style??"dashed";return Lp(E,M,t,n,O).map(L=>{const D=L.rect,C=Cs(D.x,D.y,t,n,c,u+c,r,i,o,a,h,s,f,l,d),I=D.width===1&&D.height===1?C:Cs(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,a,h,s,f,l,d);return D.x+D.width>=l.length&&(I.width-=1),D.y+D.height>=h&&(I.height-=1),{color:_.color,style:x,clip:L.clip,rect:_p({x:C.x,y:C.y,width:I.x+I.width-C.x,height:I.y+I.height-C.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let _=!1;for(const E of S)for(const x of E)if((x==null?void 0:x.rect)!==void 0&&ro(0,0,t,n,x.rect.x,x.rect.y,x.rect.width,x.rect.height)){const L=_,D=!Pp(x.clip,x.rect);D&&(e.save(),e.rect(x.clip.x,x.clip.y,x.clip.width,x.clip.height),e.clip()),x.style==="dashed"&&!_?(e.setLineDash([5,3]),_=!0):(x.style==="solid"||x.style==="solid-outline")&&_&&(e.setLineDash([]),_=!1),e.strokeStyle=x.style==="solid-outline"?Ln(Ln(x.color,p.borderColor),p.bgCell):Yr(x.color,1),e.strokeRect(x.rect.x+.5,x.rect.y+.5,x.rect.width-1,x.rect.height-1),D&&(e.restore(),_=L)}_&&e.setLineDash([])};return R(),R}function xu(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=i,e.stroke(),e.globalAlpha=1}function rs(e,t,n,r,i,o,a,l,s,u,c,d,f,h,m,p,v){if(c.current===void 0)return;const w=c.current.range,b=c.current.cell,M=[w.x+w.width-1,w.y+w.height-1];if(b[1]>=v&&M[1]>=v||!a.some(T=>T.sourceIndex===b[0]||T.sourceIndex===M[0]))return;const[S,R]=c.current.cell,_=f(c.current.cell),E=_.span??[S,S],x=R>=v-h,L=h>0&&!x?Gr(v,h,d)-1:0,D=M[1];let C;if(Pr(a,r,i,o,u,(T,k,V,N,U)=>{if(T.sticky&&S>T.sourceIndex)return;const oe=T.sourceIndex<E[0],ee=T.sourceIndex>E[1],j=T.sourceIndex===M[0];if(!(!j&&(oe||ee)))return va(U,V,n,v,d,h,m,void 0,(ne,ie,ue)=>{if(ie!==R&&ie!==D)return;let he=k,J=T.width;if(_.span!==void 0){const P=Sd(_.span,k,ne,T.width,ue,T,l),q=T.sticky?P[0]:P[1];q!==void 0&&(he=q.x,J=q.width)}return ie===D&&j&&p&&(C=()=>{var P;N>he&&!T.sticky&&(e.beginPath(),e.rect(N,0,t-N,n),e.clip()),e.beginPath(),e.rect(he+J-4,ne+ue-4,4,4),e.fillStyle=((P=T.themeOverride)==null?void 0:P.accentColor)??s.accentColor,e.fill()}),C!==void 0}),C!==void 0}),C===void 0)return;const I=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-L),e.clip(),C==null||C(),e.restore()};return I(),I}function Yp(e,t,n,r,i,o,a,l,s){s===void 0||s.size===0||(e.beginPath(),Cd(t,n,o,r,(u,c,d,f,h,m)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,f,h,m)}),Pr(t,l,o,a,i,(u,c,d,f)=>{const h=Math.max(0,f-c),m=c+h+1,p=u.width-h-1;s.has([u.sourceIndex,-1])&&e.rect(m,r,p,i-r)}),e.clip())}function Xp(e,t,n,r,i,o,a,l,s,u){let c=0;return Pr(e,o,r,i,n,(d,f,h,m,p)=>(va(p,h,t,a,l,s,u,void 0,(v,w,b,M)=>{M||(c=Math.max(w,c))}),!0)),c}function ku(e,t){var vn;const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:a,cellYOffset:l,translateX:s,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:f,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:v,groupHeaderHeight:w,disabledRows:b,rowHeight:M,verticalBorder:O,overrideCursor:S,isResizing:R,selection:_,fillHandle:E,freezeTrailingRows:x,rows:L,getCellContent:D,getGroupDetails:C,getRowThemeOverride:I,isFocused:T,drawHeaderCallback:k,prelightCells:V,drawCellCallback:N,highlightRegions:U,resizeCol:oe,imageLoader:ee,lastBlitData:j,hoverValues:ne,hyperWrapping:ie,hoverInfo:ue,spriteManager:he,maxScaleFactor:J,hasAppendRow:H,touchMode:P,enqueue:q,renderStateProvider:fe,getCellRenderer:ge,renderStrategy:Ve,bufferACtx:pe,bufferBCtx:je,damage:Me,minimumCellWidth:Pt,resizeIndicator:Rt}=e;if(i===0||o===0)return;const et=Ve==="double-buffer",le=Math.min(J,Math.ceil(window.devicePixelRatio??1)),Ge=Ve!=="direct"&&qp(e,t),be=n.canvas;(be.width!==i*le||be.height!==o*le)&&(be.width=i*le,be.height=o*le,be.style.width=i+"px",be.style.height=o+"px");const ce=r.canvas,ve=d?w+v:v,$e=ve+1;(ce.width!==i*le||ce.height!==$e*le)&&(ce.width=i*le,ce.height=$e*le,ce.style.width=i+"px",ce.style.height=$e+"px");const Oe=pe.canvas,nt=je.canvas;et&&(Oe.width!==i*le||Oe.height!==o*le)&&(Oe.width=i*le,Oe.height=o*le,j.current!==void 0&&(j.current.aBufferScroll=void 0)),et&&(nt.width!==i*le||nt.height!==o*le)&&(nt.width=i*le,nt.height=o*le,j.current!==void 0&&(j.current.bBufferScroll=void 0));const me=j.current;if(Ge===!0&&a===(me==null?void 0:me.cellXOffset)&&l===(me==null?void 0:me.cellYOffset)&&s===(me==null?void 0:me.translateX)&&u===(me==null?void 0:me.translateY))return;let Ee=null;et&&(Ee=n);const at=r;let He;et?Me!==void 0?He=(me==null?void 0:me.lastBuffer)==="b"?je:pe:He=(me==null?void 0:me.lastBuffer)==="b"?pe:je:He=n;const rt=He.canvas,bt=et?rt===Oe?nt:Oe:be,ht=typeof M=="number"?()=>M:M;at.save(),He.save(),at.beginPath(),He.beginPath(),at.textBaseline="middle",He.textBaseline="middle",le!==1&&(at.scale(le,le),He.scale(le,le));const ze=ys(c,a,i,h,s);let Tt=[];const Xt=p&&((vn=_.current)==null?void 0:vn.cell[1])===l&&u===0;let pt=!1;if(U!==void 0){for(const Pe of U)if(Pe.style!=="no-outline"&&Pe.range.y===l&&u===0){pt=!0;break}}const Et=()=>{Hp(at,ze,d,ue,i,s,v,w,h,R,_,m,he,ne,O,C,Me,k,P),Cu(at,ze,l,s,u,i,o,void 0,void 0,w,ve,ht,I,O,x,L,m,!0),at.beginPath(),at.moveTo(0,$e-.5),at.lineTo(i,$e-.5),at.strokeStyle=Ln(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),at.stroke(),pt&&Su(at,i,o,a,l,s,u,c,f,v,w,M,x,L,U,m),Xt&&rs(at,i,o,l,s,u,ze,c,m,ve,_,ht,D,x,H,E,L)};if(Me!==void 0){const Pe=ze[ze.length-1].sourceIndex+1,At=Me.hasItemInRegion([{x:a,y:-2,width:Pe,height:2},{x:a,y:l,width:Pe,height:300},{x:0,y:l,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:a,y:L-x,width:Pe,height:x,when:x>0}]),hn=gn=>{wu(gn,ze,c,o,ve,s,u,l,L,ht,D,C,I,b,T,p,x,H,Tt,Me,_,V,U,ee,he,ne,ue,N,ie,m,q,fe,ge,S,Pt);const bn=_.current;E&&p&&bn!==void 0&&Me.has(sd(bn.range))&&rs(gn,i,o,l,s,u,ze,c,m,ve,_,ht,D,x,H,E,L)};At&&(hn(He),Ee!==null&&(Ee.save(),Ee.scale(le,le),Ee.textBaseline="middle",hn(Ee),Ee.restore()),Me.hasHeader()&&(Yp(at,ze,i,w,ve,s,u,l,Me),Et())),He.restore(),at.restore();return}if((Ge!==!0||a!==(me==null?void 0:me.cellXOffset)||s!==(me==null?void 0:me.translateX)||Xt!==(me==null?void 0:me.mustDrawFocusOnHeader)||pt!==(me==null?void 0:me.mustDrawHighlightRingsOnHeader))&&Et(),Ge===!0){_n(bt!==void 0&&me!==void 0);const{regions:Pe}=Wp(He,bt,bt===Oe?me.aBufferScroll:me.bBufferScroll,bt===Oe?me.bBufferScroll:me.aBufferScroll,me,a,l,s,u,x,i,o,L,ve,le,c,ze,M,et);Tt=Pe}else Ge!==!1&&(_n(me!==void 0),Tt=Up(me,a,l,s,u,i,o,ve,ze,Ge));Np(He,ze,i,o,x,L,O,ht,m);const Kt=Su(He,i,o,a,l,s,u,c,f,v,w,M,x,L,U,m),Ft=p?rs(He,i,o,l,s,u,ze,c,m,ve,_,ht,D,x,H,E,L):void 0;if(He.fillStyle=m.bgCell,Tt.length>0){He.beginPath();for(const Pe of Tt)He.rect(Pe.x,Pe.y,Pe.width,Pe.height);He.clip(),He.fill(),He.beginPath()}else He.fillRect(0,0,i,o);const xn=wu(He,ze,c,o,ve,s,u,l,L,ht,D,C,I,b,T,p,x,H,Tt,Me,_,V,U,ee,he,ne,ue,N,ie,m,q,fe,ge,S,Pt);$p(He,ze,c,i,o,ve,s,u,l,L,ht,I,_.rows,b,x,H,Tt,Me,m),Bp(He,ze,l,s,u,i,o,Tt,ve,ht,I,O,x,L,m),Cu(He,ze,l,s,u,i,o,Tt,xn,w,ve,ht,I,O,x,L,m),Kt==null||Kt(),Ft==null||Ft(),R&&Rt!=="none"&&Pr(ze,0,s,0,ve,(Pe,At)=>Pe.sourceIndex===oe?(xu(at,At+Pe.width,0,ve+1,Ln(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),Rt==="full"&&xu(He,At+Pe.width,ve,o,Ln(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),Ee!==null&&(Ee.fillStyle=m.bgCell,Ee.fillRect(0,0,i,o),Ee.drawImage(He.canvas,0,0));const Wt=Xp(ze,o,ve,s,u,l,L,ht,x,H);ee==null||ee.setWindow({x:a,y:l,width:ze.length,height:Wt-l},f,Array.from({length:x},(Pe,At)=>L-1-At));const xt=me!==void 0&&(a!==me.cellXOffset||s!==me.translateX),In=me!==void 0&&(l!==me.cellYOffset||u!==me.translateY);j.current={cellXOffset:a,cellYOffset:l,translateX:s,translateY:u,mustDrawFocusOnHeader:Xt,mustDrawHighlightRingsOnHeader:pt,lastBuffer:et?rt===Oe?"a":"b":void 0,aBufferScroll:rt===Oe?[xt,In]:me==null?void 0:me.aBufferScroll,bBufferScroll:rt===nt?[xt,In]:me==null?void 0:me.bBufferScroll},He.restore(),at.restore()}const jp=80;function Gp(e){const t=e-1;return t*t*t+1}class Kp{constructor(t){ct(this,"callback");ct(this,"currentHoveredItem");ct(this,"leavingItems",[]);ct(this,"lastAnimationTime");ct(this,"addToLeavingItems",t=>{this.leavingItems.some(r=>Zi(r.item,t.item))||this.leavingItems.push(t)});ct(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>Zi(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});ct(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ct(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ct(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Gp(t.hoverAmount)})));ct(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/jp;for(const o of this.leavingItems)o.hoverAmount=Wn(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Wn(this.currentHoveredItem.hoverAmount+r,0,1));const i=this.getAnimatingItems();this.callback(i),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ct(this,"setHovered",t=>{var n;if(!Zi((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const r=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class Zp{constructor(t){ct(this,"fn");ct(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function js(e){return new Zp(e)}const Jp=js(()=>window.navigator.userAgent.includes("Firefox")),oa=js(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),aa=js(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function Qp(e){const t=g.useRef([]),n=g.useRef(0),r=g.useRef(e);r.current=e;const i=g.useCallback(()=>{const o=()=>window.requestAnimationFrame(a),a=()=>{const l=t.current.map(Ys);t.current=[],r.current(new Qi(l)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:a)},[]);return g.useCallback(o=>{t.current.length===0&&i();const a=tr(o[0],o[1]);t.current.includes(a)||t.current.push(a)},[i])}const Tr="header",qn="group-header",sa="out-of-bounds";var hi;(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"})(hi||(hi={}));function Td(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 Mu=6,e0=(e,t)=>{if(e.kind===te.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},t0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:a,cellYOffset:l,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:f,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:v,enableGroups:w,isFilling:b,onCanvasFocused:M,onCanvasBlur:O,isFocused:S,selection:R,freezeColumns:_,onContextMenu:E,freezeTrailingRows:x,fixedShadowX:L=!0,fixedShadowY:D=!0,drawFocusRing:C,onMouseDown:I,onMouseUp:T,onMouseMoveRaw:k,onMouseMove:V,onItemHovered:N,dragAndDropState:U,firstColAccessible:oe,onKeyDown:ee,onKeyUp:j,highlightRegions:ne,canvasRef:ie,onDragStart:ue,onDragEnd:he,eventTargetRef:J,isResizing:H,resizeColumn:P,isDragging:q,isDraggable:fe=!1,allowResize:ge,disabledRows:Ve,hasAppendRow:pe,getGroupDetails:je,theme:Me,prelightCells:Pt,headerIcons:Rt,verticalBorder:et,drawCell:le,drawHeader:Ge,onCellFocused:be,onDragOverCell:ce,onDrop:ve,onDragLeave:$e,imageWindowLoader:Oe,smoothScrollX:nt=!1,smoothScrollY:me=!1,experimental:Ee,getCellRenderer:at,resizeIndicator:He="full"}=e,rt=e.translateX??0,bt=e.translateY??0,ht=Math.max(_,Math.min(o.length-1,a)),ze=g.useRef(null),Tt=g.useRef(window),Xt=Tt.current,pt=Oe,Et=g.useRef(),[Kt,Ft]=g.useState(!1),xn=g.useRef([]),Wt=g.useRef(),[xt,In]=g.useState(),[vn,Pe]=g.useState(),At=g.useRef(null),[hn,gn]=g.useState(),[bn,st]=g.useState(!1),zt=g.useRef(bn);zt.current=bn;const Ot=g.useMemo(()=>new Dp(Rt,()=>{sn.current=void 0,Fn.current()}),[Rt]),nn=w?c+s:s,Dt=g.useRef(-1),Vt=((Ee==null?void 0:Ee.enableFirefoxRescaling)??!1)&&Jp.value,Ke=((Ee==null?void 0:Ee.enableSafariRescaling)??!1)&&oa.value;g.useLayoutEffect(()=>{window.devicePixelRatio===1||!Vt&&!Ke||(Dt.current!==-1&&Ft(!0),window.clearTimeout(Dt.current),Dt.current=window.setTimeout(()=>{Ft(!1),Dt.current=-1},200))},[l,ht,rt,bt,Vt,Ke]);const $t=Mm(o,_),Ht=L?pi($t,U):0,Nt=g.useCallback(($,se,Se)=>{const xe=$.getBoundingClientRect();if(se>=$t.length||Se>=f)return;const de=xe.width/n,Re=Cs(se,Se,n,r,c,nn,ht,l,rt,bt,f,_,x,$t,d);return de!==1&&(Re.x*=de,Re.y*=de,Re.width*=de,Re.height*=de),Re.x+=xe.x,Re.y+=xe.y,Re},[n,r,c,nn,ht,l,rt,bt,f,_,x,$t,d]),Ut=g.useCallback(($,se,Se,xe)=>{const de=$.getBoundingClientRect(),Re=de.width/n,it=(se-de.left)/Re,ot=(Se-de.top)/Re,Te=5,kt=ys($t,ht,n,void 0,rt);let ke=0,Je=0;xe instanceof MouseEvent&&(ke=xe.button,Je=xe.buttons);const Ue=Tm(it,kt,rt),ft=Dm(ot,r,w,s,c,f,d,l,bt,x),ln=(xe==null?void 0:xe.shiftKey)===!0,Mn=(xe==null?void 0:xe.ctrlKey)===!0,Ct=(xe==null?void 0:xe.metaKey)===!0,Zt=xe!==void 0&&!(xe instanceof MouseEvent)||(xe==null?void 0:xe.pointerType)==="touch",Gn=[it<0?-1:n<it?1:0,ot<nn?-1:r<ot?1:0];let Cn;if(Ue===-1||ot<0||it<0||ft===void 0||it>n||ot>r){const It=it>n?1:it<0?-1:0,Rn=ot>r?1:ot<0?-1:0;let Dn=It*2,St=Rn*2;It===0&&(Dn=Ue===-1?hi.EndPadding:hi.Center),Rn===0&&(St=ft===void 0?hi.EndPadding:hi.Center);let en=!1;if(Ue===-1&&ft===-1){const xr=Nt($,$t.length-1,-1);_n(xr!==void 0),en=se<xr.x+xr.width+Te}const Sr=it>n&&it<n+bs()||ot>r&&ot<r+bs();Cn={kind:sa,location:[Ue!==-1?Ue:it<0?0:$t.length-1,ft??f-1],region:[Dn,St],shiftKey:ln,ctrlKey:Mn,metaKey:Ct,isEdge:en,isTouch:Zt,button:ke,buttons:Je,scrollEdge:Gn,isMaybeScrollbar:Sr}}else if(ft<=-1){let It=Nt($,Ue,ft);_n(It!==void 0);let Rn=It!==void 0&&It.x+It.width-se<=Te;const Dn=Ue-1;se-It.x<=Te&&Dn>=0?(Rn=!0,It=Nt($,Dn,ft),_n(It!==void 0),Cn={kind:w&&ft===-2?qn:Tr,location:[Dn,ft],bounds:It,group:$t[Dn].group??"",isEdge:Rn,shiftKey:ln,ctrlKey:Mn,metaKey:Ct,isTouch:Zt,localEventX:se-It.x,localEventY:Se-It.y,button:ke,buttons:Je,scrollEdge:Gn}):Cn={kind:w&&ft===-2?qn:Tr,group:$t[Ue].group??"",location:[Ue,ft],bounds:It,isEdge:Rn,shiftKey:ln,ctrlKey:Mn,metaKey:Ct,isTouch:Zt,localEventX:se-It.x,localEventY:Se-It.y,button:ke,buttons:Je,scrollEdge:Gn}}else{const It=Nt($,Ue,ft);_n(It!==void 0);const Rn=It!==void 0&&It.x+It.width-se<Te;let Dn=!1;if(u&&R.current!==void 0){const St=sd(R.current.range),en=Nt($,St[0],St[1]);if(en!==void 0){const Sr=en.x+en.width-2,xr=en.y+en.height-2;Dn=Math.abs(Sr-se)<Mu&&Math.abs(xr-Se)<Mu}}Cn={kind:"cell",location:[Ue,ft],bounds:It,isEdge:Rn,shiftKey:ln,ctrlKey:Mn,isFillHandle:Dn,metaKey:Ct,isTouch:Zt,localEventX:se-It.x,localEventY:Se-It.y,button:ke,buttons:Je,scrollEdge:Gn}}return Cn},[n,$t,ht,rt,r,w,s,c,f,d,l,bt,x,Nt,u,R,nn]),[Ce]=xt??[],dt=g.useRef(()=>{}),rn=g.useRef(xt);rn.current=xt;const[z,_e]=g.useMemo(()=>{const $=document.createElement("canvas"),se=document.createElement("canvas");return $.style.display="none",$.style.opacity="0",$.style.position="fixed",se.style.display="none",se.style.opacity="0",se.style.position="fixed",[$.getContext("2d",{alpha:!1}),se.getContext("2d",{alpha:!1})]},[]);g.useLayoutEffect(()=>{if(!(z===null||_e===null))return document.documentElement.append(z.canvas),document.documentElement.append(_e.canvas),()=>{z.canvas.remove(),_e.canvas.remove()}},[z,_e]);const We=g.useMemo(()=>new Vm,[]),_t=Vt&&Kt?1:Ke&&Kt?2:5,dn=(Ee==null?void 0:Ee.disableMinimumCellWidth)===!0?1:10,sn=g.useRef(),fn=g.useRef(null),Tn=g.useRef(null),Jt=g.useCallback(()=>{var it;const $=ze.current,se=At.current;if($===null||se===null||(fn.current===null&&(fn.current=$.getContext("2d",{alpha:!1}),$.width=0,$.height=0),Tn.current===null&&(Tn.current=se.getContext("2d",{alpha:!1}),se.width=0,se.height=0),fn.current===null||Tn.current===null||z===null||_e===null))return;let Se=!1;const xe=ot=>{Se=!0,gn(ot)},de=sn.current,Re={headerCanvasCtx:Tn.current,canvasCtx:fn.current,bufferACtx:z,bufferBCtx:_e,width:n,height:r,cellXOffset:ht,cellYOffset:l,translateX:Math.round(rt),translateY:Math.round(bt),mappedColumns:$t,enableGroups:w,freezeColumns:_,dragAndDropState:U,theme:Me,headerHeight:s,groupHeaderHeight:c,disabledRows:Ve??mt.empty(),rowHeight:d,verticalBorder:et,isResizing:H,resizeCol:P,isFocused:S,selection:R,fillHandle:u,drawCellCallback:le,hasAppendRow:pe,overrideCursor:xe,maxScaleFactor:_t,freezeTrailingRows:x,rows:f,drawFocus:C,getCellContent:h,getGroupDetails:je??(ot=>({name:ot})),getRowThemeOverride:m,drawHeaderCallback:Ge,prelightCells:Pt,highlightRegions:ne,imageLoader:pt,lastBlitData:Wt,damage:Et.current,hoverValues:xn.current,hoverInfo:rn.current,spriteManager:Ot,scrolling:Kt,hyperWrapping:(Ee==null?void 0:Ee.hyperWrapping)??!1,touchMode:bn,enqueue:dt.current,renderStateProvider:We,renderStrategy:(Ee==null?void 0:Ee.renderStrategy)??(oa.value?"double-buffer":"single-buffer"),getCellRenderer:at,minimumCellWidth:dn,resizeIndicator:He};Re.damage===void 0?(sn.current=Re,ku(Re,de)):ku(Re,void 0),!Se&&(Re.damage===void 0||Re.damage.has((it=rn==null?void 0:rn.current)==null?void 0:it[0]))&&gn(void 0)},[z,_e,n,r,ht,l,rt,bt,$t,w,_,U,Me,s,c,Ve,d,et,H,pe,P,S,R,u,x,f,C,_t,h,je,m,le,Ge,Pt,ne,pt,Ot,Kt,Ee==null?void 0:Ee.hyperWrapping,Ee==null?void 0:Ee.renderStrategy,bn,We,at,dn,He]),Fn=g.useRef(Jt);g.useLayoutEffect(()=>{Jt(),Fn.current=Jt},[Jt]),g.useLayoutEffect(()=>{(async()=>{var se;((se=document==null?void 0:document.fonts)==null?void 0:se.ready)!==void 0&&(await document.fonts.ready,sn.current=void 0,Fn.current())})()},[]);const Xn=g.useCallback($=>{Et.current=$,Fn.current(),Et.current=void 0},[]),Ca=Qp(Xn);dt.current=Ca;const fo=g.useCallback($=>{Xn(new Qi($.map(se=>se.cell)))},[Xn]);pt.setCallback(Xn);const[ho,Sa]=g.useState(!1),[Zr,wr]=Ce??[],bi=Zr!==void 0&&wr===-1,xa=Zr!==void 0&&wr===-2;let wi=!1,yi=!1,_r=hn;if(_r===void 0&&Zr!==void 0&&wr!==void 0&&wr>-1&&wr<f){const $=h([Zr,wr],!0);wi=$.kind===Yn.NewRow||$.kind===Yn.Marker&&$.markerKind!=="number",yi=$.kind===te.Boolean&&Hs($),_r=$.cursor}const kn=q?"grabbing":(vn??!1)||H?"col-resize":ho||b?"crosshair":_r!==void 0?_r:bi||wi||yi||xa?"pointer":"default",Ci=g.useMemo(()=>({contain:"strict",display:"block",cursor:kn}),[kn]),Si=g.useRef("default"),Jr=J==null?void 0:J.current;Jr!=null&&Si.current!==Ci.cursor&&(Jr.style.cursor=Si.current=Ci.cursor);const dr=g.useCallback(($,se,Se,xe)=>{if(je===void 0)return;const de=je($);if(de.actions!==void 0){const Re=Md(se,de.actions);for(const[it,ot]of Re.entries())if(qr(ot,Se+se.x,xe+ot.y))return de.actions[it]}},[je]),fr=g.useCallback(($,se,Se,xe)=>{const de=$t[se];if(!q&&!H&&!(vn??!1)){const Re=Nt($,se,-1);_n(Re!==void 0);const it=Rd(void 0,de,Re.x,Re.y,Re.width,Re.height,Me,$s(de.title)==="rtl");if(de.hasMenu===!0&&it.menuBounds!==void 0&&qr(it.menuBounds,Se,xe))return{area:"menu",bounds:it.menuBounds};if(de.indicatorIcon!==void 0&&it.indicatorIconBounds!==void 0&&qr(it.indicatorIconBounds,Se,xe))return{area:"indicator",bounds:it.indicatorIconBounds}}},[$t,Nt,vn,q,H,Me]),Qr=g.useRef(0),nr=g.useRef(),rr=g.useRef(!1),Lr=g.useCallback($=>{const se=ze.current,Se=J==null?void 0:J.current;if(se===null||$.target!==se&&$.target!==Se)return;rr.current=!0;let xe,de;if($ instanceof MouseEvent?(xe=$.clientX,de=$.clientY):(xe=$.touches[0].clientX,de=$.touches[0].clientY),$.target===Se&&Se!==null){const it=Se.getBoundingClientRect();if(xe>it.right||de>it.bottom)return}const Re=Ut(se,xe,de,$);nr.current=Re.location,Re.isTouch&&(Qr.current=Date.now()),zt.current!==Re.isTouch&&st(Re.isTouch),!(Re.kind===Tr&&fr(se,Re.location[0],xe,de)!==void 0)&&(Re.kind===qn&&dr(Re.group,Re.bounds,Re.localEventX,Re.localEventY)!==void 0||(I==null||I(Re),!Re.isTouch&&fe!==!0&&fe!==Re.kind&&Re.button<3&&Re.button!==1&&$.preventDefault()))},[J,fe,Ut,dr,fr,I]);mn("touchstart",Lr,Xt,!1),mn("mousedown",Lr,Xt,!1);const go=g.useRef(0),xi=g.useCallback($=>{var Je,Ue;const se=go.current;go.current=Date.now();const Se=ze.current;if(rr.current=!1,T===void 0||Se===null)return;const xe=J==null?void 0:J.current,de=$.target!==Se&&$.target!==xe;let Re,it,ot=!0;if($ instanceof MouseEvent){if(Re=$.clientX,it=$.clientY,ot=$.button<3,$.pointerType==="touch")return}else Re=$.changedTouches[0].clientX,it=$.changedTouches[0].clientY;let Te=Ut(Se,Re,it,$);Te.isTouch&&Qr.current!==0&&Date.now()-Qr.current>500&&(Te={...Te,isLongTouch:!0}),se!==0&&Date.now()-se<(Te.isTouch?1e3:500)&&(Te={...Te,isDoubleClick:!0}),zt.current!==Te.isTouch&&st(Te.isTouch),!de&&$.cancelable&&ot&&$.preventDefault();const[kt]=Te.location,ke=fr(Se,kt,Re,it);if(Te.kind===Tr&&ke!==void 0){(Te.button!==0||((Je=nr.current)==null?void 0:Je[0])!==kt||((Ue=nr.current)==null?void 0:Ue[1])!==-1)&&T(Te,!0);return}else if(Te.kind===qn){const ft=dr(Te.group,Te.bounds,Te.localEventX,Te.localEventY);if(ft!==void 0){Te.button===0&&ft.onClick(Te);return}}T(Te,de)},[T,J,Ut,fr,dr]);mn("mouseup",xi,Xt,!1),mn("touchend",xi,Xt,!1);const Ze=g.useCallback($=>{var kt,ke;const se=ze.current;if(se===null)return;const Se=J==null?void 0:J.current,xe=$.target!==se&&$.target!==Se;let de,Re,it=!0;$ instanceof MouseEvent?(de=$.clientX,Re=$.clientY,it=$.button<3):(de=$.changedTouches[0].clientX,Re=$.changedTouches[0].clientY);const ot=Ut(se,de,Re,$);zt.current!==ot.isTouch&&st(ot.isTouch),!xe&&$.cancelable&&it&&$.preventDefault();const[Te]=ot.location;if(ot.kind===Tr){const Je=fr(se,Te,de,Re);Je!==void 0&&ot.button===0&&((kt=nr.current)==null?void 0:kt[0])===Te&&((ke=nr.current)==null?void 0:ke[1])===-1&&(Je.area==="menu"?p==null||p(Te,Je.bounds):Je.area==="indicator"&&(v==null||v(Te,Je.bounds)))}else if(ot.kind===qn){const Je=dr(ot.group,ot.bounds,ot.localEventX,ot.localEventY);Je!==void 0&&ot.button===0&&Je.onClick(ot)}},[J,Ut,fr,p,v,dr]);mn("click",Ze,Xt,!1);const mo=g.useCallback($=>{const se=ze.current,Se=J==null?void 0:J.current;if(se===null||$.target!==se&&$.target!==Se||E===void 0)return;const xe=Ut(se,$.clientX,$.clientY,$);E(xe,()=>{$.cancelable&&$.preventDefault()})},[J,Ut,E]);mn("contextmenu",mo,(J==null?void 0:J.current)??null,!1);const po=g.useCallback($=>{Et.current=new Qi($.map(se=>se.item)),xn.current=$,Fn.current(),Et.current=void 0},[]),An=g.useMemo(()=>new Kp(po),[po]),vo=g.useRef(An);vo.current=An,g.useLayoutEffect(()=>{const $=vo.current;if(Ce===void 0||Ce[1]<0){$.setHovered(Ce);return}const se=h(Ce,!0),Se=at(se),xe=Se===void 0&&se.kind===te.Custom||(Se==null?void 0:Se.needsHover)!==void 0&&(typeof Se.needsHover=="boolean"?Se.needsHover:Se.needsHover(se));$.setHovered(xe?Ce:void 0)},[h,at,Ce]);const jn=g.useRef(),ki=g.useCallback($=>{var ot;const se=ze.current;if(se===null)return;const Se=J==null?void 0:J.current,xe=$.target!==se&&$.target!==Se,de=Ut(se,$.clientX,$.clientY,$);if(de.kind!=="out-of-bounds"&&xe&&!rr.current&&!de.isTouch)return;const Re=(Te,kt)=>{In(ke=>ke===Te||(ke==null?void 0:ke[0][0])===(Te==null?void 0:Te[0][0])&&(ke==null?void 0:ke[0][1])===(Te==null?void 0:Te[0][1])&&((ke==null?void 0:ke[1][0])===(Te==null?void 0:Te[1][0])&&(ke==null?void 0:ke[1][1])===(Te==null?void 0:Te[1][1])||!kt)?ke:Te)};if(!Td(de,jn.current))gn(void 0),N==null||N(de),Re(de.kind===sa?void 0:[de.location,[de.localEventX,de.localEventY]],!0),jn.current=de;else if(de.kind==="cell"||de.kind===Tr||de.kind===qn){let Te=!1,kt=!0;if(de.kind==="cell"){const Je=h(de.location);kt=((ot=at(Je))==null?void 0:ot.needsHoverPosition)??Je.kind===te.Custom,Te=kt}else Te=!0;const ke=[de.location,[de.localEventX,de.localEventY]];Re(ke,kt),rn.current=ke,Te&&Xn(new Qi([de.location]))}const it=de.location[0]>=(oe?0:1);Pe(de.kind===Tr&&de.isEdge&&it&&ge===!0),Sa(de.kind==="cell"&&de.isFillHandle),k==null||k($),V(de)},[J,Ut,oe,ge,k,V,N,h,at,Xn]);mn("mousemove",ki,Xt,!0);const bo=g.useCallback($=>{const se=ze.current;if(se===null)return;let Se,xe;R.current!==void 0&&(Se=Nt(se,R.current.cell[0],R.current.cell[1]),xe=R.current.cell),ee==null||ee({bounds:Se,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:xe})},[ee,R,Nt]),wo=g.useCallback($=>{const se=ze.current;if(se===null)return;let Se,xe;R.current!==void 0&&(Se=Nt(se,R.current.cell[0],R.current.cell[1]),xe=R.current.cell),j==null||j({bounds:Se,stopPropagation:()=>$.stopPropagation(),preventDefault:()=>$.preventDefault(),cancel:()=>{},ctrlKey:$.ctrlKey,metaKey:$.metaKey,shiftKey:$.shiftKey,altKey:$.altKey,key:$.key,keyCode:$.keyCode,rawEvent:$,location:xe})},[j,R,Nt]),ka=g.useCallback($=>{if(ze.current=$,ie!==void 0&&(ie.current=$),$===null)Tt.current=window;else{const se=$.getRootNode();se===document&&(Tt.current=window),Tt.current=se}},[ie]),Ma=g.useCallback($=>{const se=ze.current;if(se===null||fe===!1||H){$.preventDefault();return}let Se,xe;const de=Ut(se,$.clientX,$.clientY);if(fe!==!0&&de.kind!==fe){$.preventDefault();return}const Re=(Je,Ue)=>{Se=Je,xe=Ue};let it,ot,Te;const kt=(Je,Ue,ft)=>{it=Je,ot=Ue,Te=ft};let ke=!1;if(ue==null||ue({...de,setData:Re,setDragImage:kt,preventDefault:()=>ke=!0,defaultPrevented:()=>ke}),!ke&&Se!==void 0&&xe!==void 0&&$.dataTransfer!==null)if($.dataTransfer.setData(Se,xe),$.dataTransfer.effectAllowed="copyLink",it!==void 0&&ot!==void 0&&Te!==void 0)$.dataTransfer.setDragImage(it,ot,Te);else{const[Je,Ue]=de.location;if(Ue!==void 0){const ft=document.createElement("canvas"),ln=Nt(se,Je,Ue);_n(ln!==void 0);const Mn=Math.ceil(window.devicePixelRatio??1);ft.width=ln.width*Mn,ft.height=ln.height*Mn;const Ct=ft.getContext("2d");Ct!==null&&(Ct.scale(Mn,Mn),Ct.textBaseline="middle",Ue===-1?(Ct.font=Me.headerFontFull,Ct.fillStyle=Me.bgHeader,Ct.fillRect(0,0,ft.width,ft.height),Ed(Ct,0,0,ln.width,ln.height,$t[Je],!1,Me,!1,void 0,void 0,!1,0,Ot,Ge,!1)):(Ct.font=Me.baseFontFull,Ct.fillStyle=Me.bgCell,Ct.fillRect(0,0,ft.width,ft.height),kd(Ct,h([Je,Ue]),0,Ue,!1,!1,0,0,ln.width,ln.height,!1,Me,Me.bgCell,pt,Ot,1,void 0,!1,0,void 0,void 0,void 0,We,at,()=>{}))),ft.style.left="-100%",ft.style.position="absolute",ft.style.width=`${ln.width}px`,ft.style.height=`${ln.height}px`,document.body.append(ft),$.dataTransfer.setDragImage(ft,ln.width/2,ln.height/2),window.setTimeout(()=>{ft.remove()},0)}}else $.preventDefault()},[fe,H,Ut,ue,Nt,Me,$t,Ot,Ge,h,pt,We,at]);mn("dragstart",Ma,(J==null?void 0:J.current)??null,!1,!1);const Hn=g.useRef(),yr=g.useCallback($=>{const se=ze.current;if(ve!==void 0&&$.preventDefault(),se===null||ce===void 0)return;const Se=Ut(se,$.clientX,$.clientY),[xe,de]=Se.location,Re=xe-(oe?0:1),[it,ot]=Hn.current??[];(it!==Re||ot!==de)&&(Hn.current=[Re,de],ce([Re,de],$.dataTransfer))},[oe,Ut,ce,ve]);mn("dragover",yr,(J==null?void 0:J.current)??null,!1,!1);const zn=g.useCallback(()=>{Hn.current=void 0,he==null||he()},[he]);mn("dragend",zn,(J==null?void 0:J.current)??null,!1,!1);const Y=g.useCallback($=>{const se=ze.current;if(se===null||ve===void 0)return;$.preventDefault();const Se=Ut(se,$.clientX,$.clientY),[xe,de]=Se.location,Re=xe-(oe?0:1);ve([Re,de],$.dataTransfer)},[oe,Ut,ve]);mn("drop",Y,(J==null?void 0:J.current)??null,!1,!1);const Gt=g.useCallback(()=>{$e==null||$e()},[$e]);mn("dragleave",Gt,(J==null?void 0:J.current)??null,!1,!1);const Cr=g.useRef(R);Cr.current=R;const ei=g.useRef(null),ti=g.useCallback($=>{var se;ze.current===null||!ze.current.contains(document.activeElement)||($===null&&Cr.current.current!==void 0?(se=ie==null?void 0:ie.current)==null||se.focus({preventScroll:!0}):$!==null&&$.focus({preventScroll:!0}),ei.current=$)},[ie]);g.useImperativeHandle(t,()=>({focus:()=>{var se;const $=ei.current;$===null||!document.contains($)?(se=ie==null?void 0:ie.current)==null||se.focus({preventScroll:!0}):$.focus({preventScroll:!0})},getBounds:($,se)=>{if(!(ie===void 0||ie.current===null))return Nt(ie.current,$??0,se??-1)},damage:fo}),[ie,fo,Nt]);const Mi=g.useRef(),Ra=Ug(()=>{var ot,Te,kt;if(n<50||(Ee==null?void 0:Ee.disableAccessibilityTree)===!0)return null;let $=ys($t,ht,n,U,rt);const se=oe?0:-1;!oe&&((ot=$[0])==null?void 0:ot.sourceIndex)===0&&($=$.slice(1));const[Se,xe]=((Te=R.current)==null?void 0:Te.cell)??[],de=(kt=R.current)==null?void 0:kt.range,Re=$.map(ke=>ke.sourceIndex),it=sr(l,Math.min(f,l+i));return Se!==void 0&&xe!==void 0&&!(Re.includes(Se)&&it.includes(xe))&&ti(null),g.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":f+1,"aria-multiselectable":"true","aria-colcount":$t.length+se},g.createElement("thead",{role:"rowgroup"},g.createElement("tr",{role:"row","aria-rowindex":1},$.map(ke=>g.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(ke.sourceIndex),"aria-colindex":ke.sourceIndex+1+se,tabIndex:-1,onFocus:Je=>{if(Je.target!==ei.current)return be==null?void 0:be([ke.sourceIndex,-1])},key:ke.sourceIndex},ke.title)))),g.createElement("tbody",{role:"rowgroup"},it.map(ke=>g.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(ke),key:ke,"aria-rowindex":ke+2},$.map(Je=>{const Ue=Je.sourceIndex,ft=tr(Ue,ke),ln=Se===Ue&&xe===ke,Mn=de!==void 0&&Ue>=de.x&&Ue<de.x+de.width&&ke>=de.y&&ke<de.y+de.height,Ct=`glide-cell-${Ue}-${ke}`,Zt=[Ue,ke],Gn=h(Zt,!0);return g.createElement("td",{key:ft,role:"gridcell","aria-colindex":Ue+1+se,"aria-selected":Mn,"aria-readonly":di(Gn)||!ji(Gn),id:Ct,"data-testid":Ct,onClick:()=>{const Cn=ie==null?void 0:ie.current;if(Cn!=null)return ee==null?void 0:ee({bounds:Nt(Cn,Ue,ke),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Zt})},onFocusCapture:Cn=>{var It,Rn;if(!(Cn.target===ei.current||((It=Mi.current)==null?void 0:It[0])===Ue&&((Rn=Mi.current)==null?void 0:Rn[1])===ke))return Mi.current=Zt,be==null?void 0:be(Zt)},ref:ln?ti:void 0,tabIndex:-1},e0(Gn,at))})))))},[n,$t,ht,U,rt,f,l,i,R,ti,h,ie,ee,Nt,be],200),Ri=_===0||!L?0:ht>_?1:Wn(-rt/100,0,1),G=-l*32+bt,un=D?Wn(-G/100,0,1):0,cn=g.useMemo(()=>{if(!Ri&&!un)return null;const $={position:"absolute",top:0,left:Ht,width:n-Ht,height:r,opacity:Ri,pointerEvents:"none",transition:nt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},se={position:"absolute",top:nn,left:0,width:n,height:r,opacity:un,pointerEvents:"none",transition:me?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return g.createElement(g.Fragment,null,Ri>0&&g.createElement("div",{id:"shadow-x",style:$}),un>0&&g.createElement("div",{id:"shadow-y",style:se}))},[Ri,un,Ht,n,nt,nn,r,me]),Ea=g.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return g.createElement(g.Fragment,null,g.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:bo,onKeyUp:wo,onFocus:M,onBlur:O,ref:ka,style:Ci},Ra),g.createElement("canvas",{ref:At,style:Ea}),cn)},n0=g.memo(g.forwardRef(t0));function Ui(e,t,n,r){return Wn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const r0=e=>{const[t,n]=g.useState(),[r,i]=g.useState(),[o,a]=g.useState(),[l,s]=g.useState(),[u,c]=g.useState(!1),[d,f]=g.useState(),[h,m]=g.useState(),[p,v]=g.useState(),[w,b]=g.useState(!1),[M,O]=g.useState(),{onHeaderMenuClick:S,onHeaderIndicatorClick:R,getCellContent:_,onColumnMoved:E,onColumnResize:x,onColumnResizeStart:L,onColumnResizeEnd:D,gridRef:C,maxColumnWidth:I,minColumnWidth:T,onRowMoved:k,lockColumns:V,onColumnProposeMove:N,onMouseDown:U,onMouseUp:oe,onItemHovered:ee,onDragStart:j,canvasRef:ne}=e,ie=(x??D??L)!==void 0,{columns:ue,selection:he}=e,J=he.columns,H=g.useCallback(le=>{const[Ge,be]=le.location;o!==void 0&&l!==Ge&&Ge>=V?(c(!0),s(Ge)):h!==void 0&&be!==void 0?(b(!0),v(Math.max(0,be))):r===void 0&&!u&&!w&&(ee==null||ee(le))},[o,h,l,ee,V,r,u,w]),P=E!==void 0,q=g.useCallback(le=>{var Ge;if(le.button===0){const[be,ce]=le.location;if(le.kind==="out-of-bounds"&&le.isEdge&&ie){const ve=(Ge=C==null?void 0:C.current)==null?void 0:Ge.getBounds(ue.length-1,-1);ve!==void 0&&(n(ve.x),i(ue.length-1))}else if(le.kind==="header"&&be>=V){const ve=ne==null?void 0:ne.current;if(le.isEdge&&ie&&ve){n(le.bounds.x),i(be);const Oe=ve.getBoundingClientRect().width/ve.offsetWidth,nt=le.bounds.width/Oe;L==null||L(ue[be],nt,be,nt+(ue[be].growOffset??0))}else le.kind==="header"&&P&&(f(le.bounds.x),a(be))}else le.kind==="cell"&&V>0&&be===0&&ce!==void 0&&k!==void 0&&(O(le.bounds.y),m(ce))}U==null||U(le)},[U,ie,V,k,C,ue,P,L,ne]),fe=g.useCallback((le,Ge)=>{u||w||S==null||S(le,Ge)},[u,w,S]),ge=g.useCallback((le,Ge)=>{u||w||R==null||R(le,Ge)},[u,w,R]),Ve=g.useRef(-1),pe=g.useCallback(()=>{Ve.current=-1,m(void 0),v(void 0),O(void 0),b(!1),a(void 0),s(void 0),f(void 0),c(!1),i(void 0),n(void 0)},[]),je=g.useCallback((le,Ge)=>{if(le.button===0){if(r!==void 0){if((J==null?void 0:J.hasIndex(r))===!0)for(const ce of J){if(ce===r)continue;const ve=ue[ce],$e=Ui(ve,Ve.current,T,I);x==null||x(ve,$e,ce,$e+(ve.growOffset??0))}const be=Ui(ue[r],Ve.current,T,I);if(D==null||D(ue[r],be,r,be+(ue[r].growOffset??0)),J.hasIndex(r))for(const ce of J){if(ce===r)continue;const ve=ue[ce],$e=Ui(ve,Ve.current,T,I);D==null||D(ve,$e,ce,$e+(ve.growOffset??0))}}pe(),o!==void 0&&l!==void 0&&(E==null||E(o,l)),h!==void 0&&p!==void 0&&(k==null||k(h,p))}oe==null||oe(le,Ge)},[oe,r,o,l,h,p,J,D,ue,T,I,x,E,k,pe]),Me=g.useMemo(()=>{if(!(o===void 0||l===void 0)&&o!==l&&(N==null?void 0:N(o,l))!==!1)return{src:o,dest:l}},[o,l,N]),Pt=g.useCallback(le=>{const Ge=ne==null?void 0:ne.current;if(o!==void 0&&d!==void 0)Math.abs(le.clientX-d)>20&&c(!0);else if(h!==void 0&&M!==void 0)Math.abs(le.clientY-M)>20&&b(!0);else if(r!==void 0&&t!==void 0&&Ge){const ce=Ge.getBoundingClientRect().width/Ge.offsetWidth,ve=(le.clientX-t)/ce,$e=ue[r],Oe=Ui($e,ve,T,I);if(x==null||x($e,Oe,r,Oe+($e.growOffset??0)),Ve.current=ve,(J==null?void 0:J.first())===r)for(const nt of J){if(nt===r)continue;const me=ue[nt],Ee=Ui(me,Ve.current,T,I);x==null||x(me,Ee,nt,Ee+(me.growOffset??0))}}},[o,d,h,M,r,t,ue,T,I,x,J,ne]),Rt=g.useCallback((le,Ge)=>{if(h===void 0||p===void 0)return _(le,Ge);let[be,ce]=le;return ce===p?ce=h:(ce>p&&(ce-=1),ce>=h&&(ce+=1)),_([be,ce],Ge)},[h,p,_]),et=g.useCallback(le=>{j==null||j(le),le.defaultPrevented()||pe()},[pe,j]);return g.createElement(n0,{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:r,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:Rt,isResizing:r!==void 0,onHeaderMenuClick:fe,onHeaderIndicatorClick:ge,isDragging:u,onItemHovered:H,onDragStart:et,onMouseDown:q,allowResize:ie,onMouseUp:je,dragAndDropState:Me,onMouseMoveRaw:Pt,ref:C})};function i0(e){const t=g.useRef(null),[n,r]=g.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return g.useLayoutEffect(()=>{const i=a=>{for(const l of a){const{width:s,height:u}=l&&l.contentRect||{};r(c=>c.width===s&&c.height===u?c:{width:s,height:u})}},o=new window.ResizeObserver(i);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const o0=(e,t,n)=>{const r=g.useRef(null),i=g.useRef(null),o=g.useRef(null),a=g.useRef(0),l=g.useRef(t);l.current=t;const s=n.current;g.useEffect(()=>{const u=()=>{var f,h;if(i.current===!1&&s!==null){const m=[s.scrollLeft,s.scrollTop];if(((f=o.current)==null?void 0:f[0])===m[0]&&((h=o.current)==null?void 0:h[1])===m[1])if(a.current>10){o.current=null,i.current=null;return}else a.current++;else a.current=0,l.current(m[0],m[1]),o.current=m;r.current=window.setTimeout(u,8.333333333333334)}},c=()=>{i.current=!0,o.current=null,r.current!==null&&(window.clearTimeout(r.current),r.current=null)},d=f=>{f.touches.length===0&&(i.current=!1,a.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const f=s;return f.addEventListener("touchstart",c),f.addEventListener("touchend",d),()=>{f.removeEventListener("touchstart",c),f.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},a0=()=>e=>e.isSafari?"scroll":"auto",s0=pn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[a0()]}});function l0(e){const[t,n]=g.useState(!1),r=typeof window>"u"?null:window,i=g.useRef(0);return mn("touchstart",g.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),mn("touchend",g.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const u0=e=>{var ie,ue;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:a,className:l,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,v=[],w=(f==null?void 0:f.sticky)??!1,b=(f==null?void 0:f.fill)??!1,M=g.useRef(0),O=g.useRef(0),S=g.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,_=g.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),E=g.useRef(null),x=l0(200),[L,D]=g.useState(!0),C=g.useRef(0);g.useLayoutEffect(()=>{if(!L||x||_.current.lockDirection===void 0)return;const he=S.current;if(he===null)return;const[J,H]=_.current.lockDirection;J!==void 0?he.scrollLeft=J:H!==void 0&&(he.scrollTop=H),_.current.lockDirection=void 0},[x,L]);const I=g.useCallback((he,J)=>{var et;const H=S.current;if(H===null)return;J=J??H.scrollTop,he=he??H.scrollLeft;const P=_.current.scrollTop,q=_.current.scrollLeft,fe=he-q,ge=J-P;x&&fe!==0&&ge!==0&&(Math.abs(fe)>3||Math.abs(ge)>3)&&s&&_.current.lockDirection===void 0&&(_.current.lockDirection=Math.abs(fe)<Math.abs(ge)?[q,void 0]:[void 0,P]);const Ve=_.current.lockDirection;he=(Ve==null?void 0:Ve[0])??he,J=(Ve==null?void 0:Ve[1])??J,_.current.scrollLeft=he,_.current.scrollTop=J;const pe=H.clientWidth,je=H.clientHeight,Me=J,Pt=O.current-Me,Rt=H.scrollHeight-je;if(O.current=Me,Rt>0&&(Math.abs(Pt)>2e3||Me===0||Me===Rt)&&r>H.scrollHeight+5){const le=Me/Rt,Ge=(r-je)*le;M.current=Ge-Me}Ve!==void 0&&(window.clearTimeout(C.current),D(!1),C.current=window.setTimeout(()=>D(!0),200)),o({x:he,y:Me+M.current,width:pe-c,height:je-u,paddingRight:((et=E.current)==null?void 0:et.clientWidth)??0})},[u,c,r,o,s,x]);o0(h&&oa.value,I,S);const T=g.useRef(I);T.current=I;const k=g.useRef(),V=g.useRef(!1);g.useLayoutEffect(()=>{V.current?I():V.current=!0},[I,u,c]);const N=g.useCallback(he=>{S.current=he,m!==void 0&&(m.current=he)},[m]);let U=0,oe=0;for(v.push(g.createElement("div",{key:U++,style:{width:i,height:0}}));oe<r;){const he=Math.min(5e6,r-oe);v.push(g.createElement("div",{key:U++,style:{width:0,height:he}})),oe+=he}const{ref:ee,width:j,height:ne}=i0(p);return typeof window<"u"&&(((ie=k.current)==null?void 0:ie.height)!==ne||((ue=k.current)==null?void 0:ue.width)!==j)&&(window.setTimeout(()=>T.current(),0),k.current={width:j,height:ne}),(j??0)===0||(ne??0)===0?g.createElement("div",{ref:ee}):g.createElement("div",{ref:ee},g.createElement(s0,{isSafari:oa.value},g.createElement("div",{className:"dvn-underlay"},t),g.createElement("div",{ref:N,style:k.current,draggable:a,onDragStart:he=>{a||(he.stopPropagation(),he.preventDefault())},className:"dvn-scroller "+(l??""),onScroll:()=>I()},g.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},g.createElement("div",{className:"dvn-stack"},v),d!==void 0&&g.createElement(g.Fragment,null,!b&&g.createElement("div",{className:"dvn-spacer"}),g.createElement("div",{ref:E,style:{height:ne,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:b?1:void 0,right:w?c??0:void 0,pointerEvents:"auto"}},d))))))},c0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:a,freezeColumns:l,experimental:s,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:f,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:v,overscrollX:w,overscrollY:b,initialSize:M,smoothScrollX:O=!1,smoothScrollY:S=!1,isDraggable:R}=e,{paddingRight:_,paddingBottom:E}=s??{},[x,L]=c,D=g.useRef(),C=g.useRef(),I=g.useRef(),T=g.useRef(),k=u+Math.max(0,w??0);let V=a?i+o:i;if(typeof r=="number")V+=n*r;else for(let ee=0;ee<n;ee++)V+=r(ee);b!==void 0&&(V+=b);const N=g.useRef(),U=g.useCallback(()=>{var ge,Ve;if(N.current===void 0)return;const ee={...N.current};let j=0,ne=ee.x<0?-ee.x:0,ie=0,ue=0;ee.x=ee.x<0?0:ee.x;let he=0;for(let pe=0;pe<l;pe++)he+=t[pe].width;for(const pe of t){const je=j-he;if(ee.x>=je+pe.width)j+=pe.width,ue++,ie++;else if(ee.x>je)j+=pe.width,O?ne+=je-ee.x:ue++,ie++;else if(ee.x+ee.width>je)j+=pe.width,ie++;else break}let J=0,H=0,P=0;if(typeof r=="number")S?(H=Math.floor(ee.y/r),J=H*r-ee.y):H=Math.ceil(ee.y/r),P=Math.ceil(ee.height/r)+H,J<0&&P++;else{let pe=0;for(let je=0;je<n;je++){const Me=r(je),Pt=pe+(S?0:Me/2);if(ee.y>=pe+Me)pe+=Me,H++,P++;else if(ee.y>Pt)pe+=Me,S?J+=Pt-ee.y:H++,P++;else if(ee.y+ee.height>Me/2+pe)pe+=Me,P++;else break}}const q={x:ue,y:H,width:ie-ue,height:P-H},fe=D.current;(fe===void 0||fe.y!==q.y||fe.x!==q.x||fe.height!==q.height||fe.width!==q.width||C.current!==ne||I.current!==J||ee.width!==((ge=T.current)==null?void 0:ge[0])||ee.height!==((Ve=T.current)==null?void 0:Ve[1]))&&(f==null||f({x:ue,y:H,width:ie-ue,height:P-H},ee.width,ee.height,ee.paddingRight??0,ne,J),D.current=q,C.current=ne,I.current=J,T.current=[ee.width,ee.height])},[t,r,n,f,l,O,S]),oe=g.useCallback(ee=>{N.current=ee,U()},[U]);return g.useEffect(()=>{U()},[U]),g.createElement(u0,{scrollRef:h,className:d,kineticScrollPerfHack:s==null?void 0:s.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:R===!0||typeof R=="string",scrollWidth:k+(_??0),scrollHeight:V+(E??0),clientHeight:L,rightElement:p,paddingBottom:E,paddingRight:_,rightElementProps:v,update:oe,initialSize:M},g.createElement(r0,{eventTargetRef:h,width:x,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}))},d0=pn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),f0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),h0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),g0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),m0=10,p0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:a,searchResults:l,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:f}=e,[h]=g.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=g.useState(""),v=a??m,w=g.useCallback(j=>{p(j),s==null||s(j)},[s]),[b,M]=g.useState(),O=g.useRef(b);O.current=b,g.useEffect(()=>{l!==void 0&&(l.length>0?M(j=>({rowsSearched:r,results:l.length,selectedIndex:(j==null?void 0:j.selectedIndex)??-1})):M(void 0))},[r,l]);const S=g.useRef();S.current===void 0&&(S.current=new AbortController);const R=g.useRef(),[_,E]=g.useState([]),x=l??_,L=g.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,S.current.abort())},[]),D=g.useRef(n);D.current=n;const C=g.useCallback(j=>{const ne=new RegExp(j.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ie=D.current,ue=Math.min(10,r),he=0;M(void 0),E([]);const J=[],H=async()=>{var Rt;if(u===void 0)return;const P=performance.now(),q=r-he;let fe=u({x:0,y:ie,width:i.length,height:Math.min(ue,q,r-ie)},S.current.signal);typeof fe=="function"&&(fe=await fe());let ge=!1;for(const[et,le]of fe.entries())for(const[Ge,be]of le.entries()){let ce;switch(be.kind){case te.Text:case te.Number:ce=be.displayData;break;case te.Uri:case te.Markdown:ce=be.data;break;case te.Boolean:ce=typeof be.data=="boolean"?be.data.toString():void 0;break;case te.Image:case te.Bubble:ce=be.data.join("🐳");break;case te.Custom:ce=be.copyData;break}ce!==void 0&&ne.test(ce)&&(J.push([Ge,et+ie]),ge=!0)}const Ve=performance.now();ge&&E([...J]),he+=fe.length,_n(he<=r);const pe=((Rt=O.current)==null?void 0:Rt.selectedIndex)??-1;M({results:J.length,rowsSearched:he,selectedIndex:pe}),c==null||c(J,pe),ie+ue>=r?ie=0:ie+=ue;const je=Ve-P,Me=Math.max(je,1),Pt=m0/Me;ue=Math.ceil(ue*Pt),he<r&&J.length<1e3&&(R.current=window.requestAnimationFrame(H))};L(),R.current=window.requestAnimationFrame(H)},[L,i.length,u,c,r]),I=g.useCallback(()=>{var j;f==null||f(),M(void 0),E([]),c==null||c([],-1),L(),(j=t==null?void 0:t.current)==null||j.focus()},[L,t,f,c]),T=g.useCallback(j=>{w(j.target.value),l===void 0&&(j.target.value===""?(M(void 0),E([]),L()):C(j.target.value))},[C,L,w,l]);g.useEffect(()=>{d&&o.current!==null&&(w(""),o.current.focus({preventScroll:!0}))},[d,o,w]);const k=g.useCallback(j=>{var ie;if((ie=j==null?void 0:j.stopPropagation)==null||ie.call(j),b===void 0)return;const ne=(b.selectedIndex+1)%b.results;M({...b,selectedIndex:ne}),c==null||c(x,ne)},[b,c,x]),V=g.useCallback(j=>{var ie;if((ie=j==null?void 0:j.stopPropagation)==null||ie.call(j),b===void 0)return;let ne=(b.selectedIndex-1)%b.results;ne<0&&(ne+=b.results),M({...b,selectedIndex:ne}),c==null||c(x,ne)},[c,x,b]),N=g.useCallback(j=>{(j.ctrlKey||j.metaKey)&&j.nativeEvent.code==="KeyF"||j.key==="Escape"?(I(),j.stopPropagation(),j.preventDefault()):j.key==="Enter"&&(j.shiftKey?V():k())},[I,k,V]);g.useEffect(()=>()=>{L()},[L]);const[U,oe]=g.useState(!1);g.useEffect(()=>{if(d)oe(!0);else{const j=setTimeout(()=>oe(!1),150);return()=>clearTimeout(j)}},[d]);const ee=g.useMemo(()=>{if(!d&&!U)return null;let j;b!==void 0&&(j=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(j=`${b.selectedIndex+1} of ${j}`));const ne=he=>{he.stopPropagation()},ue={width:`${Math.floor(((b==null?void 0:b.rowsSearched)??0)/r*100)}%`};return g.createElement(d0,{className:d?"":"out",onMouseDown:ne,onMouseMove:ne,onMouseUp:ne,onClick:ne},g.createElement("div",{className:"gdg-search-bar-inner"},g.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:T,value:v,tabIndex:d?void 0:-1,onKeyDownCapture:N}),g.createElement("button",{"aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:V,disabled:((b==null?void 0:b.results)??0)===0},f0),g.createElement("button",{"aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:k,disabled:((b==null?void 0:b.results)??0)===0},h0),f!==void 0&&g.createElement("button",{"aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:I},g0)),b!==void 0?g.createElement(g.Fragment,null,g.createElement("div",{className:"gdg-search-status"},g.createElement("div",{"data-testid":"search-result-area"},j)),g.createElement("div",{className:"gdg-search-progress",style:ue})):g.createElement("div",{className:"gdg-search-status"},g.createElement("label",{htmlFor:h},"Type to search")))},[d,U,b,r,h,o,T,v,N,V,k,f,I]);return g.createElement(g.Fragment,null,g.createElement(c0,{prelightCells:x,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}),ee)};class v0 extends g.PureComponent{constructor(){super(...arguments);ct(this,"wrapperRef",g.createRef());ct(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let r=n.target;for(;r!==null;){if(r.classList.contains("click-outside-ignore"))return;r=r.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:r,...i}=this.props;return g.createElement("div",{...i,ref:this.wrapperRef},this.props.children)}}const b0=()=>e=>Math.max(16,e.targetHeight-10),w0=pn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[b0(),"px"]}}),y0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[a,l]=ae.useState(n);return ae.createElement(v0,{style:{position:"absolute",left:t.x-i.left+1,top:t.y-i.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},ae.createElement(w0,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,a.length),onChange:s=>l(s.target.value),onKeyDown:s=>{s.key==="Enter"?o(a):s.key==="Escape"&&r()},autoFocus:!0}))};function C0(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 lt(e,t,n){const r=Dd(e,t);return r&&(n.didMatch=!0),r}function Dd(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(Dd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const a=e.split("+"),l=a.pop();if(!C0(l,t))return!1;if(a[0]==="any")return!0;for(const s of a)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":aa.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function S0(e,t,n,r,i,o,a){const l=ae.useCallback((c,d,f,h)=>{var M;(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||h==="drag"),p=r==="mixed"&&m,v=i==="mixed"&&m;let w={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?((M=e.current)==null?void 0:M.rangeStack)??[]:[]},columns:p?e.columns:mt.empty(),rows:v?e.rows:mt.empty()};f&&(o==="multi-rect"||o==="multi-cell")&&w.current!==void 0&&e.current!==void 0&&(w={...w,current:{...w.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(w,d)},[r,e,n,o,a,i,t]),s=ae.useCallback((c,d,f)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:mt.empty(),rows:c};else{const m=f&&n==="mixed",p=f&&r==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:mt.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=ae.useCallback((c,d,f)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:mt.empty(),columns:c};else{const m=f&&n==="mixed",p=f&&i==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:mt.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[l,s,u]}function x0(e,t,n,r,i){const o=g.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const f=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?f.push({kind:te.Loading,allowOverlay:!1}):f.push(t([h,d]));c.push(f)}return c}return(e==null?void 0:e(u,r.signal))??[]},[r.signal,t,e,i]),a=e!==void 0?o:void 0,l=g.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,r.signal);return typeof d=="function"?async()=>(await d()).map(f=>[{kind:te.Loading,allowOverlay:!1},...f]):d.map(f=>[{kind:te.Loading,allowOverlay:!1},...f])}return a(c,r.signal)},[r.signal,a,n]);return[e!==void 0?l:void 0,a]}function k0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case te.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===As?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case te.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case te.Image:case te.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case te.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case te.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case te.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case te.Markdown:case te.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case te.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case te.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case te.Protected:return{formatted:"************",rawValue:"",format:"string"};default:to()}}function M0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(a=>a.span!==void 0&&a.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:k0(a))})}function Ru(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function R0(e){var n;const t=[];for(const r of e){const i=[];for(const o of r)o.format==="url"?i.push(((n=o.rawValue)==null?void 0:n.toString())??""):o.format==="string-array"?i.push(o.formatted.map(a=>Ru(a,!0)).join(",")):i.push(Ru(o.formatted,!1));t.push(i.join(" "))}return t.join(`
|
166
|
+
`)}function is(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Eu(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function E0(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function I0(e){var n;const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const r of e){t.push("<tr>");for(const i of r){const o=`gdg-format="${i.format}"`;i.format==="url"?t.push(`<td ${o}><a href="${i.rawValue}">${is(i.formatted)}</a></td>`):i.format==="string-array"?t.push(`<td ${o}><ol>${i.formatted.map((a,l)=>`<li gdg-raw-value=${Eu(i.rawValue[l])}>`+is(a)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Eu(((n=i.rawValue)==null?void 0:n.toString())??"")} ${o}>${is(i.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function T0(e,t){const n=M0(e,t),r=R0(n),i=I0(n);return{textPlain:r,textHtml:i}}function Iu(e){var a;const t=document.createElement("html");t.innerHTML=e.replace(/ /g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],i=[];let o;for(;r.length>0;){const l=r.pop();if(l===void 0)break;if(l instanceof HTMLTableElement||l.nodeName==="TBODY")r.push(...[...l.children].reverse());else if(l instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...l.children].reverse());else if(l instanceof HTMLTableCellElement){const s=l.cloneNode(!0),c=s.children.length===1&&s.children[0].nodeName==="P"?s.children[0]:null,d=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",f=s.querySelectorAll("br");for(const p of f)p.replaceWith(`
|
167
|
+
`);const h=s.getAttribute("gdg-raw-value"),m=s.getAttribute("gdg-format")??"string";if(s.querySelector("a")!==null)o==null||o.push({rawValue:((a=s.querySelector("a"))==null?void 0:a.getAttribute("href"))??"",formatted:s.textContent??"",format:m});else if(s.querySelector("ol")!==null){const p=s.querySelectorAll("li");o==null||o.push({rawValue:[...p].map(v=>v.getAttribute("gdg-raw-value")??""),formatted:[...p].map(v=>v.textContent??""),format:"string-array"})}else if(h!==null)o==null||o.push({rawValue:E0(h),formatted:s.textContent??"",format:m});else{let p=s.textContent??"";d&&(p=p.replace(/\n(?!\n)/g,"")),o==null||o.push({rawValue:p??"",formatted:p??"",format:m})}}}return o!==void 0&&i.push(o),i}function D0(e,t,n,r,i){var l;const o=e;if(r==="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 s=(l=e.current)==null?void 0:l.range,u=[];if(s.width>2){const f=t({x:s.x,y:s.y,width:1,height:s.height},i.signal);if(typeof f=="function")return o;u.push(...f);const h=t({x:s.x+s.width-1,y:s.y,width:1,height:s.height},i.signal);if(typeof h=="function")return o;u.push(...h)}else{const f=t({x:s.x,y:s.y,width:s.width,height:s.height},i.signal);if(typeof f=="function")return o;u.push(...f)}let c=s.x-n,d=s.x+s.width-1-n;for(const f of u)for(const h of f)h.span!==void 0&&(c=Math.min(h.span[0],c),d=Math.max(h.span[1],d));c===s.x-n&&d===s.x+s.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:s.y,width:d-c+1,height:s.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function Tu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function O0(e){let t;(function(l){l[l.None=0]="None",l[l.inString=1]="inString",l[l.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
|
168
|
+
`);let a=0;for(const l of e){switch(o){case t.None:l===" "||l===`
|
169
|
+
`?(r.push(e.slice(i,a)),i=a+1,l===`
|
170
|
+
`&&(n.push(r),r=[])):l==='"'&&(o=t.inString);break;case t.inString:l==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?o=t.inString:((l===" "||l===`
|
171
|
+
`)&&(r.push(Tu(e.slice(i,a))),i=a+1,l===`
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}a++}return i<e.length&&r.push(Tu(e.slice(i,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Du(e,t,n){var l;const r=T0(e,t),i=s=>{var u;(u=window.navigator.clipboard)==null||u.writeText(s)},o=(s,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([s],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(s,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",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(s,u)||i(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Od(e){return e!==!0}function Ou(e){return typeof e=="string"?e:`${e}px`}const P0=()=>e=>e.innerWidth,_0=()=>e=>e.innerHeight,L0=pn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[P0()],"wmyidgi-1":[_0()]}}),F0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return g.createElement(L0,{innerHeight:Ou(n),innerWidth:Ou(t),...i},r)},A0=2,H0=1300;function z0(e,t,n){const r=ae.useRef(0),[i,o]=e??[0,0];ae.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let a=!1,l=0;const s=u=>{var c;if(!a){if(l===0)l=u;else{const d=u-l;r.current=Math.min(1,r.current+d/H0);const f=r.current**1.618*d*A0;(c=t.current)==null||c.scrollBy(i*f,o*f),l=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,i,o,n])}function V0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:a,remSize:l}){const[s,u,c,d,f,h]=ae.useMemo(()=>{if(!a||l===16)return[e,t,n,r,i,o];const m=l/16,p=e,v=pd();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??v.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??v.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??v.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,l,e,a,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Er={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 ut(e,t){return e===!0?t:e===!1?"":e}function Pu(e){const t=aa.value;return{activateCell:ut(e.activateCell," |Enter|shift+Enter"),clear:ut(e.clear,"any+Escape"),closeOverlay:ut(e.closeOverlay,"any+Escape"),acceptOverlayDown:ut(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ut(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ut(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ut(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ut(e.delete,t?"Backspace|Delete":"Delete"),downFill:ut(e.downFill,"primary+_68"),scrollToSelectedCell:ut(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ut(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ut(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ut(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ut(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ut(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ut(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ut(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ut(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ut(e.goToFirstCell,"primary+Home"),goToFirstColumn:ut(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ut(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ut(e.goToLastCell,"primary+End"),goToLastColumn:ut(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ut(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ut(e.goToNextPage,"PageDown"),goToPreviousPage:ut(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ut(e.rightFill,"primary+_82"),search:ut(e.search,"primary+f"),selectAll:ut(e.selectAll,"primary+a"),selectColumn:ut(e.selectColumn,"ctrl+ "),selectGrowDown:ut(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ut(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ut(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ut(e.selectGrowUp,"shift+ArrowUp"),selectRow:ut(e.selectRow,"shift+ "),selectToFirstCell:ut(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ut(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ut(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ut(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ut(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ut(e.selectToLastRow,"primary+shift+ArrowDown")}}function $0(e){const t=Gg(e);return ae.useMemo(()=>{if(t===void 0)return Pu(Er);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Er.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Er.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Er.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Er.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Er.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Er.selectToLastCell};return Pu({...Er,...n})},[t])}function N0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const a={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(a.subGroups=r.subGroups.map((l,s)=>t(l,i+1,[...o,s])).sort((l,s)=>l.headerIndex-s.headerIndex)),a}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Gs(e,t){const n=[];function r(a,l,s=!1){let u=l!==null?l-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:s,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:l;r(a.subGroups[c],d,s||a.isCollapsed)}}const i=N0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}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:l,...s}=a;return s})}function la(e,t){if(t===void 0||Gs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function B0(e,t,n,r){const i=ae.useMemo(()=>e===void 0?void 0:Gs(e,t),[e,t]),o=ae.useMemo(()=>i===void 0?t:i.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[i,t]),a=ae.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=la(u,i);return c?e.height:typeof n=="number"?n:n(u)},[i,e,n]),l=ae.useCallback(u=>{if(i===void 0)return u;let c=u;for(const d of i){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[i]),s=Wr(r??(e==null?void 0:e.themeOverride),ae.useCallback(u=>{if(e===void 0)return r==null?void 0:r(u,u,u);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=la(u,i);return c?e.themeOverride:r==null?void 0:r(u,f,d)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:o,rowNumberMapper:l,getRowThemeOverride:s}}function W0(e,t){const n=ae.useMemo(()=>e===void 0?void 0:Gs(e,t),[e,t]);return{getRowGroupingForPath:_d,updateRowGroupingByPath:Pd,mapper:ae.useCallback(r=>{if(typeof r=="number")return la(r,n);const i=la(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Pd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,a)=>a===r?{...o,...n}:o):e.map((o,a)=>a===r?{...o,subGroups:Pd(o.subGroups??[],i,n)}:o)}function _d(e,t){const[n,...r]=t;return r[0]===-1?e[n]:_d(e[n].subGroups??[],r)}function U0(e,t){const[n]=g.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}));return n.callback=t,n.facade}function q0(e,t,n,r,i){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),l=g.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,o]),[s,u,c]=jg(l),d=g.useRef(i);d.current=i;const f=U0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(s.width??1)>1;return g.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:s,setVisibleRegion:u,scrollRef:f}}const Y0=g.lazy(async()=>await Ds(()=>import("./data-grid-overlay-editor.DUagmDpG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let X0=0;function j0(e){return Jm(bu(bu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return sr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Vo(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 $o={kind:te.Loading,allowOverlay:!1},No={columns:mt.empty(),rows:mt.empty(),current:void 0},G0=(e,t)=>{var Rl,El,Il;const[n,r]=g.useState(No),[i,o]=g.useState(),a=g.useRef(null),l=g.useRef(null),[s,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:v,columns:w,rows:b,getCellContent:M,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:x,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:k="default",onGroupHeaderClicked:V,onCellContextMenu:N,className:U,onHeaderContextMenu:oe,getCellsForSelection:ee,onGroupHeaderContextMenu:j,onGroupHeaderRenamed:ne,onCellEdited:ie,onCellsEdited:ue,onSearchResultsChanged:he,searchResults:J,onSearchValueChange:H,searchValue:P,onKeyDown:q,onKeyUp:fe,keybindings:ge,editOnType:Ve=!0,onRowAppended:pe,onColumnMoved:je,validateCell:Me,highlightRegions:Pt,rangeSelect:Rt="rect",columnSelect:et="multi",rowSelect:le="multi",rangeSelectionBlending:Ge="exclusive",columnSelectionBlending:be="exclusive",rowSelectionBlending:ce="exclusive",onDelete:ve,onDragStart:$e,onMouseMove:Oe,onPaste:nt,copyHeaders:me=!1,freezeColumns:Ee=0,cellActivationBehavior:at="second-click",rowSelectionMode:He="auto",onHeaderMenuClick:rt,onHeaderIndicatorClick:bt,getGroupDetails:ht,rowGrouping:ze,onSearchClose:Tt,onItemHovered:Xt,onSelectionCleared:pt,showSearch:Et,onVisibleRegionChanged:Kt,gridSelection:Ft,onGridSelectionChange:xn,minColumnWidth:Wt=50,maxColumnWidth:xt=500,maxColumnAutoWidth:In,provideEditor:vn,trailingRowOptions:Pe,freezeTrailingRows:At=0,allowedFillDirections:hn="orthogonal",scrollOffsetX:gn,scrollOffsetY:bn,verticalBorder:st,onDragOverCell:zt,onDrop:Ot,onColumnResize:nn,onColumnResizeEnd:Dt,onColumnResizeStart:Vt,customRenderers:Ke,fillHandle:$t,experimental:Ht,fixedShadowX:Nt,fixedShadowY:Ut,headerIcons:Ce,imageWindowLoader:dt,initialSize:rn,isDraggable:z,onDragLeave:_e,onRowMoved:We,overscrollX:_t,overscrollY:dn,preventDiagonalScrolling:sn,rightElement:fn,rightElementProps:Tn,trapFocus:Jt=!1,smoothScrollX:Fn,smoothScrollY:Xn,scaleToRem:Ca=!1,rowHeight:fo=34,headerHeight:ho=36,groupHeaderHeight:Sa=ho,theme:Zr,isOutsideClick:wr,renderers:bi,resizeIndicator:xa,scrollToActiveCell:wi=!0,drawFocusRing:yi=!0}=e,_r=yi==="no-editor"?i===void 0:yi,Qt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(Qt==null?void 0:Qt.kind)??e.rowMarkers??"none",Ci=(Qt==null?void 0:Qt.width)??e.rowMarkerWidth,Si=(Qt==null?void 0:Qt.startIndex)??e.rowMarkerStartIndex??1,Jr=(Qt==null?void 0:Qt.theme)??e.rowMarkerTheme,dr=Qt==null?void 0:Qt.headerTheme,fr=Qt==null?void 0:Qt.headerAlwaysVisible,Qr=le!=="multi",nr=(Qt==null?void 0:Qt.checkboxStyle)??"square",rr=Math.max(Wt,20),Lr=Math.max(xt,rr),go=Math.max(In??Lr,rr),xi=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ze,rowNumberMapper:mo,rowHeight:po,getRowThemeOverride:An}=B0(ze,b,fo,h),vo=g.useMemo(()=>Number.parseFloat(xi.fontSize),[xi]),{rowHeight:jn,headerHeight:ki,groupHeaderHeight:bo,theme:wo,overscrollX:ka,overscrollY:Ma}=V0({groupHeaderHeight:Sa,headerHeight:ho,overscrollX:_t,overscrollY:dn,remSize:vo,rowHeight:po,scaleToRem:Ca,theme:Zr}),Hn=$0(ge),yr=Ci??(b>1e4?48:b>1e3?44:b>100?36:32),zn=kn!=="none",Y=zn?1:0,Gt=pe!==void 0,Cr=(Pe==null?void 0:Pe.sticky)===!0,[ei,ti]=g.useState(!1),Mi=Et??ei,Ra=g.useCallback(()=>{Tt!==void 0?Tt():ti(!1)},[Tt]),G=g.useMemo(()=>Ft===void 0?void 0:Vo(Ft,Y),[Ft,Y])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Ea]=x0(ee,M,Y,un.current,Ze),$=g.useCallback((y,A,F)=>{if(Me===void 0)return!0;const W=[y[0]-Y,y[1]];return Me==null?void 0:Me(W,A,F)},[Y,Me]),se=g.useRef(Ft),Se=g.useCallback((y,A)=>{A&&(y=D0(y,cn,Y,k,un.current)),xn!==void 0?(se.current=Vo(y,-Y),xn(se.current)):r(y)},[xn,cn,Y,k]),xe=Wr(nn,g.useCallback((y,A,F,W)=>{nn==null||nn(w[F-Y],A,F-Y,W)},[nn,Y,w])),de=Wr(Dt,g.useCallback((y,A,F,W)=>{Dt==null||Dt(w[F-Y],A,F-Y,W)},[Dt,Y,w])),Re=Wr(Vt,g.useCallback((y,A,F,W)=>{Vt==null||Vt(w[F-Y],A,F-Y,W)},[Vt,Y,w])),it=Wr(x,g.useCallback((y,A)=>(x==null?void 0:x({...y,columnIndex:y.columnIndex-Y},A))??!1,[x,Y])),ot=Wr(L,g.useCallback((y,A)=>(L==null?void 0:L({...y,col:y.col-Y},A))??!1,[L,Y])),Te=g.useCallback(y=>{if(ve!==void 0){const A=ve(Vo(y,-Y));return typeof A=="boolean"?A:Vo(A,Y)}return!0},[ve,Y]),[kt,ke,Je]=S0(G,Se,Ge,be,ce,Rt,T),Ue=g.useMemo(()=>mr(pd(),wo),[wo]),[ft,ln]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(bi===void 0)return{};const y={};for(const A of bi)y[A.kind]=A;return y},[bi]),Ct=g.useCallback(y=>y.kind!==te.Custom?Mn[y.kind]:Ke==null?void 0:Ke.find(A=>A.isMatch(y)),[Ke,Mn]);let{sizedColumns:Zt,nonGrowWidth:Gn}=Wm(w,Ze,Ea,ft[0]-(Y===0?0:yr)-ft[2],rr,go,Ue,Ct,un.current);kn!=="none"&&(Gn+=yr);const Cn=g.useMemo(()=>Zt.some(y=>y.group!==void 0),[Zt]),It=Cn?ki+bo:ki,Rn=G.rows.length,Dn=kn==="none"?void 0:Rn===0?!1:Rn===Ze?!0:void 0,St=g.useMemo(()=>kn==="none"?Zt:[{title:"",width:yr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Jr,rowMarker:nr,rowMarkerChecked:Dn,headerRowMarkerTheme:dr,headerRowMarkerAlwaysVisible:fr,headerRowMarkerDisabled:Qr},...Zt],[kn,Zt,yr,Jr,nr,Dn,dr,fr,Qr]),en=g.useRef({height:1,width:1,x:0,y:0}),Sr=g.useRef(!1),{setVisibleRegion:xr,visibleRegion:Fr,scrollRef:qt}=q0(gn,bn,jn,en,()=>Sr.current=!0);en.current=Fr;const Tf=Fr.x+Y,yo=Fr.y,En=g.useRef(null),Sn=g.useCallback(y=>{var A;y===!0?(A=En.current)==null||A.focus():window.requestAnimationFrame(()=>{var F;(F=En.current)==null||F.focus()})},[]),wn=Gt?Ze+1:Ze,Vn=g.useCallback(y=>{const A=Y===0?y:y.map(W=>({...W,location:[W.location[0]-Y,W.location[1]]})),F=ue==null?void 0:ue(A);if(F!==!0)for(const W of A)ie==null||ie(W.location,W.value);return F},[ie,ue,Y]),[Ar,Ia]=g.useState(),Co=G.current!==void 0&&G.current.range.width*G.current.range.height>1?G.current.range:void 0,ni=_r?(Rl=G.current)==null?void 0:Rl.cell:void 0,So=ni==null?void 0:ni[0],xo=ni==null?void 0:ni[1],Df=g.useMemo(()=>{if((Pt===void 0||Pt.length===0)&&(Co??So??xo??Ar)===void 0)return;const y=[];if(Pt!==void 0)for(const A of Pt){const F=St.length-A.range.x-Y;F>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+Y,width:Math.min(F,A.range.width)},style:A.style})}return Ar!==void 0&&y.push({color:Yr(Ue.accentColor,0),range:Ar,style:"dashed"}),Co!==void 0&&y.push({color:Yr(Ue.accentColor,.5),range:Co,style:"solid-outline"}),So!==void 0&&xo!==void 0&&y.push({color:Ue.accentColor,range:{x:So,y:xo,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Ar,Co,So,xo,Pt,St.length,Ue.accentColor,Y]),fl=g.useRef(St);fl.current=St;const On=g.useCallback(([y,A],F=!1)=>{var Z,X,K,Q,re,we,Le;const W=Gt&&A===wn-1;if(y===0&&zn){if(W)return $o;const ye=mo(A);return ye===void 0?$o:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:nr,checked:(G==null?void 0:G.rows.hasIndex(A))===!0,markerKind:kn==="clickable-number"?"number":kn,row:Si+ye,drawHandle:We!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(W){const Ae=y===Y?(Pe==null?void 0:Pe.hint)??"":"",De=fl.current[y];if(((Z=De==null?void 0:De.trailingRowOptions)==null?void 0:Z.disabled)===!0)return $o;{const gt=((X=De==null?void 0:De.trailingRowOptions)==null?void 0:X.hint)??Ae,qe=((K=De==null?void 0:De.trailingRowOptions)==null?void 0:K.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Yn.NewRow,hint:gt,allowOverlay:!1,icon:qe}}}else{const ye=y-Y;if(F||(Ht==null?void 0:Ht.strict)===!0){const De=en.current,gt=De.x>ye||ye>De.x+De.width||De.y>A||A>De.y+De.height||A>=Da.current,qe=ye===((re=(Q=De.extras)==null?void 0:Q.selected)==null?void 0:re[0])&&A===((we=De.extras)==null?void 0:we.selected[1]);let Fe=!1;if(((Le=De.extras)==null?void 0:Le.freezeRegions)!==void 0){for(const Mt of De.extras.freezeRegions)if(qr(Mt,ye,A)){Fe=!0;break}}if(gt&&!qe&&!Fe)return $o}let Ae=M([ye,A]);return Y!==0&&Ae.span!==void 0&&(Ae={...Ae,span:[Ae.span[0]+Y,Ae.span[1]+Y]}),Ae}},[Gt,wn,zn,mo,nr,G==null?void 0:G.rows,kn,Si,We,Y,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Ht==null?void 0:Ht.strict,M]),Ta=g.useCallback(y=>{let A=(ht==null?void 0:ht(y))??{name:y};return ne!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:F=>Pa({group:A.name,bounds:F.bounds})}]}),A},[ht,ne]),ko=g.useCallback(y=>{var K;const[A,F]=y.cell,W=St[A],B=(W==null?void 0:W.group)!==void 0?(K=Ta(W.group))==null?void 0:K.overrideTheme:void 0,Z=W==null?void 0:W.themeOverride,X=An==null?void 0:An(F);o({...y,theme:mr(Ue,B,Z,X,y.content.themeOverride)})},[An,St,Ta,Ue]),ri=g.useCallback((y,A,F)=>{var X;if(G.current===void 0)return;const[W,B]=G.current.cell,Z=On([W,B]);if(Z.kind!==te.Boolean&&Z.allowOverlay){let K=Z;if(F!==void 0)switch(K.kind){case te.Number:{const Q=bg(()=>F==="-"?-0:Number.parseFloat(F),0);K={...K,data:Number.isNaN(Q)?0:Q};break}case te.Text:case te.Markdown:case te.Uri:K={...K,data:F};break}ko({target:y,content:K,initialValue:F,cell:[W,B],highlight:F===void 0,forceEditMode:F!==void 0})}else Z.kind===te.Boolean&&A&&Z.readonly!==!0&&(Vn([{location:G.current.cell,value:{...Z,data:Od(Z.data)}}]),(X=En.current)==null||X.damage([{cell:G.current.cell}]))},[On,G,Vn,ko]),hl=g.useCallback((y,A)=>{var B;const F=(B=En.current)==null?void 0:B.getBounds(y,A);if(F===void 0||qt.current===null)return;const W=On([y,A]);W.allowOverlay&&ko({target:F,content:W,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[On,qt,ko]),on=g.useCallback((y,A,F="both",W=0,B=0,Z=void 0)=>{if(qt.current!==null){const X=En.current,K=l.current,Q=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,re=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,we=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Le=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(X!==null&&K!==null){let ye={x:0,y:0,width:0,height:0},Ae=0,De=0;if((Q!==void 0||re!==void 0)&&(ye=X.getBounds((Q??0)+Y,re??0)??ye,ye.width===0||ye.height===0))return;const gt=K.getBoundingClientRect(),qe=gt.width/K.offsetWidth;if(we!==void 0&&(ye={...ye,x:we-gt.left-qt.current.scrollLeft,width:1}),Le!==void 0&&(ye={...ye,y:Le+gt.top-qt.current.scrollTop,height:1}),ye!==void 0){const Fe={x:ye.x-W,y:ye.y-B,width:ye.width+2*W,height:ye.height+2*B};let Mt=0;for(let Va=0;Va<Ee;Va++)Mt+=Zt[Va].width;let jt=0;const an=At+(Cr?1:0);an>0&&(jt=Gr(wn,an,jn));let Jn=Mt*qe+gt.left+Y*yr*qe,or=gt.right,Qn=gt.top+It*qe,ar=gt.bottom-jt*qe;const Oo=ye.width+W*2;switch(Z==null?void 0:Z.hAlign){case"start":or=Jn+Oo;break;case"end":Jn=or-Oo;break;case"center":Jn=Math.floor((Jn+or)/2)-Oo/2,or=Jn+Oo;break}const Po=ye.height+B*2;switch(Z==null?void 0:Z.vAlign){case"start":ar=Qn+Po;break;case"end":Qn=ar-Po;break;case"center":Qn=Math.floor((Qn+ar)/2)-Po/2,ar=Qn+Po;break}Jn>Fe.x?Ae=Fe.x-Jn:or<Fe.x+Fe.width&&(Ae=Fe.x+Fe.width-or),Qn>Fe.y?De=Fe.y-Qn:ar<Fe.y+Fe.height&&(De=Fe.y+Fe.height-ar),F==="vertical"||typeof y=="number"&&y<Ee?Ae=0:(F==="horizontal"||typeof A=="number"&&A>=wn-an)&&(De=0),(Ae!==0||De!==0)&&(qe!==1&&(Ae/=qe,De/=qe),qt.current.scrollTo(Ae+qt.current.scrollLeft,De+qt.current.scrollTop))}}}},[Y,At,yr,qt,It,Ee,Zt,wn,Cr,jn]),gl=g.useRef(hl),ml=g.useRef(M),Da=g.useRef(Ze);gl.current=hl,ml.current=M,Da.current=Ze;const ii=g.useCallback(async(y,A=!0)=>{var Q;const F=St[y];if(((Q=F==null?void 0:F.trailingRowOptions)==null?void 0:Q.disabled)===!0)return;const W=pe==null?void 0:pe();let B,Z=!0;W!==void 0&&(B=await W,B==="top"&&(Z=!1),typeof B=="number"&&(Z=!1));let X=0;const K=()=>{if(Da.current<=Ze){X<500&&window.setTimeout(K,X),X=50+X*2;return}const re=typeof B=="number"?B:Z?Ze:0;Do.current(y-Y,re),kt({cell:[y,re],range:{x:y,y:re,width:1,height:1}},!1,!1,"edit");const we=ml.current([y-Y,re]);we.allowOverlay&&ji(we)&&we.readonly!==!0&&A&&window.setTimeout(()=>{gl.current(y,re)},0)};K()},[St,pe,Y,Ze,kt]),Mo=g.useCallback(y=>{var F,W;const A=((W=(F=Zt[y])==null?void 0:F.trailingRowOptions)==null?void 0:W.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof A=="number")return A+(zn?1:0);if(typeof A=="object"){const B=w.indexOf(A);if(B>=0)return B+(zn?1:0)}},[Zt,w,zn,Pe==null?void 0:Pe.targetColumn]),kr=g.useRef(),oi=g.useRef(),Ei=g.useCallback((y,A)=>{var B;const[F,W]=A;return mr(Ue,(B=St[F])==null?void 0:B.themeOverride,An==null?void 0:An(W),y.themeOverride)},[An,St,Ue]),{mapper:Hr}=W0(ze,b),Kn=ze==null?void 0:ze.navigationBehavior,Ii=g.useCallback(y=>{var we,Le,ye;const A=aa.value?y.metaKey:y.ctrlKey,F=A&&le==="multi",W=A&&et==="multi",[B,Z]=y.location,X=G.columns,K=G.rows,[Q,re]=((we=G.current)==null?void 0:we.cell)??[];if(y.kind==="cell"){if(oi.current=void 0,zr.current=[B,Z],B===0&&zn){if(Gt===!0&&Z===Ze||kn==="number"||le==="none")return;const Ae=On(y.location);if(Ae.kind!==Yn.Marker)return;if(We!==void 0){const qe=Ct(Ae);_n((qe==null?void 0:qe.kind)===Yn.Marker);const Fe=(Le=qe==null?void 0:qe.onClick)==null?void 0:Le.call(qe,{...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Ei(Ae,y.location),preventDefault:()=>{}});if(Fe===void 0||Fe.checked===Ae.checked)return}o(void 0),Sn();const De=K.hasIndex(Z),gt=kr.current;if(le==="multi"&&(y.shiftKey||y.isLongTouch===!0)&>!==void 0&&K.hasIndex(gt)){const qe=[Math.min(gt,Z),Math.max(gt,Z)+1];F||He==="multi"?ke(void 0,qe,!0):ke(mt.fromSingleSelection(qe),void 0,F)}else le==="multi"&&(F||y.isTouch||He==="multi")?De?ke(K.remove(Z),void 0,!0):(ke(void 0,Z,!0),kr.current=Z):De&&K.length===1?ke(mt.empty(),void 0,A):(ke(mt.fromSingleSelection(Z),void 0,A),kr.current=Z)}else if(B>=Y&&Gt&&Z===Ze){const Ae=Mo(B);ii(Ae??B)}else if(Q!==B||re!==Z){const Ae=On(y.location),De=Ct(Ae);if((De==null?void 0:De.onSelect)!==void 0){let Fe=!1;if(De.onSelect({...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Fe=!0,theme:Ei(Ae,y.location)}),Fe)return}if(Kn==="block"&&Hr(Z).isGroupHeader)return;const gt=Cr&&Z===Ze,qe=Cr&&G!==void 0&&((ye=G.current)==null?void 0:ye.cell[1])===Ze;if((y.shiftKey||y.isLongTouch===!0)&&Q!==void 0&&re!==void 0&&G.current!==void 0&&!qe){if(gt)return;const Fe=Math.min(B,Q),Mt=Math.max(B,Q),jt=Math.min(Z,re),an=Math.max(Z,re);kt({...G.current,range:{x:Fe,y:jt,width:Mt-Fe+1,height:an-jt+1}},!0,A,"click"),kr.current=void 0,Sn()}else kt({cell:[B,Z],range:{x:B,y:Z,width:1,height:1}},!0,A,"click"),kr.current=void 0,o(void 0),Sn()}}else if(y.kind==="header")if(zr.current=[B,Z],o(void 0),zn&&B===0)kr.current=void 0,oi.current=void 0,le==="multi"&&(K.length!==Ze?ke(mt.fromSingleSelection([0,Ze]),void 0,A):ke(mt.empty(),void 0,A),Sn());else{const Ae=oi.current;if(et==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Ae!==void 0&&X.hasIndex(Ae)){const De=[Math.min(Ae,B),Math.max(Ae,B)+1];W?Je(void 0,De,A):Je(mt.fromSingleSelection(De),void 0,A)}else W?(X.hasIndex(B)?Je(X.remove(B),void 0,A):Je(void 0,B,A),oi.current=B):et!=="none"&&(Je(mt.fromSingleSelection(B),void 0,A),oi.current=B);kr.current=void 0,Sn()}else y.kind===qn?zr.current=[B,Z]:y.kind===sa&&!y.isMaybeScrollbar&&(Se(No,!1),o(void 0),Sn(),pt==null||pt(),kr.current=void 0,oi.current=void 0)},[le,et,G,zn,Y,Gt,Ze,kn,On,We,Sn,He,Ct,Ei,ke,Mo,ii,Kn,Hr,Cr,kt,Je,Se,pt]),Ti=g.useRef(!1),zr=g.useRef(),pl=g.useRef(Fr),$n=g.useRef(),Of=g.useCallback(y=>{if(ai.current=!1,pl.current=en.current,y.button!==0&&y.button!==1){$n.current=void 0;return}const A=performance.now();$n.current={button:y.button,time:A,location:y.location},(y==null?void 0:y.kind)==="header"&&(Ti.current=!0);const F=y.kind==="cell"&&y.isFillHandle;!F&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:G,fillHandle:F}),zr.current=void 0,!y.isTouch&&y.button===0&&!F?Ii(y):!y.isTouch&&y.button===1&&(zr.current=y.location))},[G,Ii]),[Oa,Pa]=g.useState(),vl=g.useCallback(y=>{if(y.kind!==qn||et!=="multi")return;const A=aa.value?y.metaKey:y.ctrlKey,[F]=y.location,W=G.columns;if(F<Y)return;const B=St[F];let Z=F,X=F;for(let K=F-1;K>=Y&&no(B.group,St[K].group);K--)Z--;for(let K=F+1;K<St.length&&no(B.group,St[K].group);K++)X++;if(Sn(),A)if(W.hasAll([Z,X+1])){let K=W;for(let Q=Z;Q<=X;Q++)K=K.remove(Q);Je(K,void 0,A)}else Je(void 0,[Z,X+1],A);else Je(mt.fromSingleSelection([Z,X+1]),void 0,A)},[et,Sn,G.columns,St,Y,Je]),ai=g.useRef(!1),Ro=g.useCallback(async y=>{if(cn!==void 0&&xe!==void 0){const A=en.current.y,F=en.current.height;let W=cn({x:y,y:A,width:1,height:Math.min(F,Ze-A)},un.current.signal);typeof W!="object"&&(W=await W());const B=Zt[y-Y],X=document.createElement("canvas").getContext("2d",{alpha:!1});if(X!==null){X.font=Ue.baseFontFull;const K=bd(X,Ue,B,0,W,rr,Lr,!1,Ct);xe==null||xe(B,K.width,y,K.width)}}},[Zt,cn,Lr,Ue,rr,xe,Y,Ze,Ct]),[Pf,_a]=g.useState(),si=g.useCallback(async(y,A)=>{var K,Q;const F=(K=y.current)==null?void 0:K.range;if(F===void 0||cn===void 0||A.current===void 0)return;const W=A.current.range;if(R!==void 0){let re=!1;if(R({fillDestination:{...W,x:W.x-Y},patternSource:{...F,x:F.x-Y},preventDefault:()=>re=!0}),re)return}let B=cn(F,un.current.signal);typeof B!="object"&&(B=await B());const Z=B,X=[];for(let re=0;re<W.width;re++)for(let we=0;we<W.height;we++){const Le=[W.x+re,W.y+we];if(ad(Le,F))continue;const ye=Z[we%F.height][re%F.width];di(ye)||!ji(ye)||X.push({location:Le,value:{...ye}})}Vn(X),(Q=En.current)==null||Q.damage(X.map(re=>({cell:re.location})))},[cn,Vn,R,Y]),bl=g.useCallback(()=>{if(G.current===void 0||G.current.range.width<=1)return;const y={...G,current:{...G.current,range:{...G.current.range,width:1}}};si(y,G)},[si,G]),wl=g.useCallback(()=>{if(G.current===void 0||G.current.range.height<=1)return;const y={...G,current:{...G.current,range:{...G.current.range,height:1}}};si(y,G)},[si,G]),_f=g.useCallback((y,A)=>{var we,Le;const F=s;if(u(void 0),Ia(void 0),_a(void 0),Ti.current=!1,A)return;if((F==null?void 0:F.fillHandle)===!0&&G.current!==void 0&&((we=F.previousSelection)==null?void 0:we.current)!==void 0){if(Ar===void 0)return;const ye={...G,current:{...G.current,range:xd(F.previousSelection.current.range,Ar)}};si(F.previousSelection,ye),Se(ye,!0);return}const[W,B]=y.location,[Z,X]=zr.current??[],K=()=>{ai.current=!0},Q=ye=>{var De,gt,qe;const Ae=ye.isTouch||Z===W&&X===B;if(Ae&&(O==null||O([W-Y,B],{...ye,preventDefault:K})),ye.button===1)return!ai.current;if(!ai.current){const Fe=On(y.location),Mt=Ct(Fe);if(Mt!==void 0&&Mt.onClick!==void 0&&Ae){const an=Mt.onClick({...ye,cell:Fe,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Ei(Fe,y.location),preventDefault:K});an!==void 0&&!di(an)&&ui(an)&&(Vn([{location:ye.location,value:an}]),(De=En.current)==null||De.damage([{cell:ye.location}]))}if(ai.current||G.current===void 0)return!1;let jt=!1;switch(Fe.activationBehaviorOverride??at){case"double-click":case"second-click":{if(((qe=(gt=F==null?void 0:F.previousSelection)==null?void 0:gt.current)==null?void 0:qe.cell)===void 0)break;const[an,Jn]=G.current.cell,[or,Qn]=F.previousSelection.current.cell;jt=W===an&&W===or&&B===Jn&&B===Qn&&(ye.isDoubleClick===!0||at==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return S==null||S([W-Y,B]),ri(ye.bounds,!1),!0}return!1},re=y.location[0]-Y;if(y.isTouch){const ye=en.current,Ae=pl.current;if(ye.x!==Ae.x||ye.y!==Ae.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Zi((Le=G.current)==null?void 0:Le.cell,y.location)){N==null||N([re,y.location[1]],{...y,preventDefault:K});return}else if(y.kind==="header"&&G.columns.hasIndex(W)){oe==null||oe(re,{...y,preventDefault:K});return}else if(y.kind===qn){if(re<0)return;j==null||j(re,{...y,preventDefault:K});return}}y.kind==="cell"?Q(y)||Ii(y):y.kind===qn?V==null||V(re,{...y,preventDefault:K}):(y.kind===Tr&&(C==null||C(re,{...y,preventDefault:K})),Ii(y));return}if(y.kind==="header"){if(re<0)return;y.isEdge?y.isDoubleClick===!0&&Ro(W):y.button===0&&W===Z&&B===X&&(C==null||C(re,{...y,preventDefault:K}))}if(y.kind===qn){if(re<0)return;y.button===0&&W===Z&&B===X&&(V==null||V(re,{...y,preventDefault:K}),ai.current||vl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&Q(y),zr.current=void 0},[s,G,Y,Ar,si,Se,O,On,Ct,at,Ei,Vn,S,ri,N,oe,j,Ii,V,C,Ro,vl]),Lf=g.useCallback(y=>{const A={...y,location:[y.location[0]-Y,y.location[1]]};Oe==null||Oe(A),s!==void 0&&y.buttons===0&&(u(void 0),Ia(void 0),_a(void 0),Ti.current=!1),_a(F=>{var W;return Ti.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(F==null?void 0:F[0])&&y.scrollEdge[1]===F[1]?F:s===void 0||(((W=$n.current)==null?void 0:W.location[0])??0)<Y?void 0:y.scrollEdge})},[s,Oe,Y]),Ff=g.useCallback((y,A)=>{rt==null||rt(y-Y,A)},[rt,Y]),Af=g.useCallback((y,A)=>{bt==null||bt(y-Y,A)},[bt,Y]),ir=(El=G==null?void 0:G.current)==null?void 0:El.cell,Hf=g.useCallback((y,A,F,W,B,Z)=>{Sr.current=!1;let X=ir;X!==void 0&&(X=[X[0]-Y,X[1]]);const K=Ee===0?void 0:{x:0,y:y.y,width:Ee,height:y.height},Q=[];K!==void 0&&Q.push(K),At>0&&(Q.push({x:y.x-Y,y:Ze-At,width:y.width,height:At}),Ee>0&&Q.push({x:0,y:Ze-At,width:Ee,height:At}));const re={x:y.x-Y,y:y.y,width:y.width,height:Gt&&y.y+y.height>=Ze?y.height-1:y.height,tx:B,ty:Z,extras:{selected:X,freezeRegion:K,freezeRegions:Q}};en.current=re,xr(re),ln([A,F,W]),Kt==null||Kt(re,re.tx,re.ty,re.extras)},[ir,Y,Gt,Ze,Ee,At,xr,Kt]),zf=Wr(je,g.useCallback((y,A)=>{je==null||je(y-Y,A-Y),et!=="none"&&Je(mt.fromSingleSelection(A),void 0,!0)},[et,je,Y,Je])),La=g.useRef(!1),Vf=g.useCallback(y=>{if(y.location[0]===0&&Y>0){y.preventDefault();return}$e==null||$e({...y,location:[y.location[0]-Y,y.location[1]]}),y.defaultPrevented()||(La.current=!0),u(void 0)},[$e,Y]),$f=g.useCallback(()=>{La.current=!1},[]),yl=ze==null?void 0:ze.selectionBehavior,Eo=g.useCallback(y=>{if(yl!=="block-spanning")return;const{isGroupHeader:A,path:F,groupRows:W}=Hr(y);if(A)return[y,y];const B=F[F.length-1],Z=y-B,X=y+W-B-1;return[Z,X]},[Hr,yl]),Fa=g.useRef(),Aa=g.useCallback(y=>{var A,F,W;if(!Td(y,Fa.current)&&(Fa.current=y,!(((A=$n==null?void 0:$n.current)==null?void 0:A.button)!==void 0&&$n.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((F=$n.current)==null?void 0:F.location[0])===0&&y.location[0]===0&&Y===1&&le==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex($n.current.location[1])&&G.rows.hasIndex($n.current.location[1])){const B=Math.min($n.current.location[1],y.location[1]),Z=Math.max($n.current.location[1],y.location[1])+1;ke(mt.fromSingleSelection([B,Z]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&G.current!==void 0&&!La.current&&!Ti.current&&(Rt==="rect"||Rt==="multi-rect")){const[B,Z]=G.current.cell;let[X,K]=y.location;if(K<0&&(K=en.current.y),s.fillHandle===!0&&((W=s.previousSelection)==null?void 0:W.current)!==void 0){const Q=s.previousSelection.current.range;K=Math.min(K,Gt?Ze-1:Ze);const re=Op(Q,X,K,hn);Ia(re)}else{if(Gt&&Z===Ze)return;if(Gt&&K===Ze)if(y.kind===sa)K--;else return;X=Math.max(X,Y);const we=Eo(Z);K=we===void 0?K:Wn(K,we[0],we[1]);const Le=X-B,ye=K-Z,Ae={x:Le>=0?B:X,y:ye>=0?Z:K,width:Math.abs(Le)+1,height:Math.abs(ye)+1};kt({...G.current,range:Ae},!0,!1,"drag")}}Xt==null||Xt({...y,location:[y.location[0]-Y,y.location[1]]})}},[s,Y,le,G,Rt,Xt,ke,Gt,Ze,hn,Eo,kt]),Nf=g.useCallback(()=>{var X,K;const y=Fa.current;if(y===void 0)return;const[A,F]=y.scrollEdge;let[W,B]=y.location;const Z=en.current;A===-1?W=((K=(X=Z.extras)==null?void 0:X.freezeRegion)==null?void 0:K.x)??Z.x:A===1&&(W=Z.x+Z.width),F===-1?B=Math.max(0,Z.y):F===1&&(B=Math.min(Ze-1,Z.y+Z.height)),W=Wn(W,0,St.length-1),B=Wn(B,0,Ze-1),Aa({...y,location:[W,B]})},[St.length,Aa,Ze]);z0(Pf,qt,Nf);const Zn=g.useCallback(y=>{if(G.current===void 0)return;const[A,F]=y,[W,B]=G.current.cell,Z=G.current.range;let X=Z.x,K=Z.x+Z.width,Q=Z.y,re=Z.y+Z.height;const[we,Le]=Eo(B)??[0,Ze-1],ye=Le+1;if(F!==0)switch(F){case 2:{re=ye,Q=B,on(0,re,"vertical");break}case-2:{Q=we,re=B+1,on(0,Q,"vertical");break}case 1:{Q<B?(Q++,on(0,Q,"vertical")):(re=Math.min(ye,re+1),on(0,re,"vertical"));break}case-1:{re>B+1?(re--,on(0,re,"vertical")):(Q=Math.max(we,Q-1),on(0,Q,"vertical"));break}default:to()}if(A!==0)if(A===2)K=St.length,X=W,on(K-1-Y,0,"horizontal");else if(A===-2)X=Y,K=W+1,on(X-Y,0,"horizontal");else{let Ae=[];if(cn!==void 0){const De=cn({x:X,y:Q,width:K-X-Y,height:re-Q},un.current.signal);typeof De=="object"&&(Ae=j0(De))}if(A===1){let De=!1;if(X<W){if(Ae.length>0){const gt=sr(X+1,W+1).find(qe=>!Ae.includes(qe-Y));gt!==void 0&&(X=gt,De=!0)}else X++,De=!0;De&&on(X,0,"horizontal")}De||(K=Math.min(St.length,K+1),on(K-1-Y,0,"horizontal"))}else if(A===-1){let De=!1;if(K>W+1){if(Ae.length>0){const gt=sr(K-1,W,-1).find(qe=>!Ae.includes(qe-Y));gt!==void 0&&(K=gt,De=!0)}else K--,De=!0;De&&on(K-Y,0,"horizontal")}De||(X=Math.max(Y,X-1),on(X-Y,0,"horizontal"))}else to()}kt({cell:G.current.cell,range:{x:X,y:Q,width:K-X,height:re-Q}},!0,!1,"keyboard-select")},[cn,Eo,G,St.length,Y,Ze,on,kt]),Ha=g.useRef(wi);Ha.current=wi;const Mr=g.useCallback((y,A,F,W)=>{const B=wn-(F?0:1);y=Wn(y,Y,Zt.length-1+Y),A=Wn(A,0,B);const Z=ir==null?void 0:ir[0],X=ir==null?void 0:ir[1];if(y===Z&&A===X)return!1;if(W&&G.current!==void 0){const K=[...G.current.rangeStack];(G.current.range.width>1||G.current.range.height>1)&&K.push(G.current.range),Se({...G,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:K}},!0)}else kt({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),Ha.current&&on(y-Y,A),!0},[wn,Y,Zt.length,ir,G,on,Se,kt]),Bf=g.useCallback((y,A)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&ui(y)&&(Vn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var B;(B=En.current)==null||B.damage([{cell:i.cell}])})),Sn(!0),o(void 0);const[F,W]=A;if(G.current!==void 0&&(F!==0||W!==0)){const B=G.current.cell[1]===wn-1&&y!==void 0;Mr(Wn(G.current.cell[0]+F,0,St.length-1),Wn(G.current.cell[1]+W,0,wn-1),B,!1)}_==null||_(y,A)},[i==null?void 0:i.cell,Sn,G,_,Vn,wn,Mr,St.length]),Wf=g.useMemo(()=>`gdg-overlay-${X0++}`,[]),Vr=g.useCallback(y=>{var F,W,B,Z;Sn();const A=[];for(let X=y.x;X<y.x+y.width;X++)for(let K=y.y;K<y.y+y.height;K++){const Q=M([X-Y,K]);if(!Q.allowOverlay&&Q.kind!==te.Boolean)continue;let re;if(Q.kind===te.Custom){const we=Ct(Q),Le=(F=we==null?void 0:we.provideEditor)==null?void 0:F.call(we,Q);(we==null?void 0:we.onDelete)!==void 0?re=we.onDelete(Q):xg(Le)&&(re=(W=Le==null?void 0:Le.deletedValue)==null?void 0:W.call(Le,Q))}else if(ui(Q)&&Q.allowOverlay||Q.kind===te.Boolean){const we=Ct(Q);re=(B=we==null?void 0:we.onDelete)==null?void 0:B.call(we,Q)}re!==void 0&&!di(re)&&ui(re)&&A.push({location:[X,K],value:re})}Vn(A),(Z=En.current)==null||Z.damage(A.map(X=>({cell:X.location})))},[Sn,M,Ct,Vn,Y]),Di=i!==void 0,Cl=g.useCallback(y=>{var gt,qe;const A=()=>{y.stopPropagation(),y.preventDefault()},F={didMatch:!1},{bounds:W}=y,B=G.columns,Z=G.rows,X=Hn;if(!Di&<(X.clear,y,F))Se(No,!1),pt==null||pt();else if(!Di&<(X.selectAll,y,F))Se({columns:mt.empty(),rows:mt.empty(),current:{cell:((gt=G.current)==null?void 0:gt.cell)??[Y,0],range:{x:Y,y:0,width:w.length,height:Ze},rangeStack:[]}},!1);else if(lt(X.search,y,F))(qe=a==null?void 0:a.current)==null||qe.focus({preventScroll:!0}),ti(!0);else if(lt(X.delete,y,F)){const Fe=(Te==null?void 0:Te(G))??!0;if(Fe!==!1){const Mt=Fe===!0?G:Fe;if(Mt.current!==void 0){Vr(Mt.current.range);for(const jt of Mt.current.rangeStack)Vr(jt)}for(const jt of Mt.rows)Vr({x:Y,y:jt,width:w.length,height:1});for(const jt of Mt.columns)Vr({x:jt,y:0,width:1,height:Ze})}}if(F.didMatch)return A(),!0;if(G.current===void 0)return!1;let[K,Q]=G.current.cell;const[,re]=G.current.cell;let we=!1,Le=!1;if(lt(X.scrollToSelectedCell,y,F)?Do.current(K-Y,Q):et!=="none"&<(X.selectColumn,y,F)?B.hasIndex(K)?Je(B.remove(K),void 0,!0):et==="single"?Je(mt.fromSingleSelection(K),void 0,!0):Je(void 0,K,!0):le!=="none"&<(X.selectRow,y,F)?Z.hasIndex(Q)?ke(Z.remove(Q),void 0,!0):le==="single"?ke(mt.fromSingleSelection(Q),void 0,!0):ke(void 0,Q,!0):!Di&&W!==void 0&<(X.activateCell,y,F)?Q===Ze&&Gt?window.setTimeout(()=>{const Fe=Mo(K);ii(Fe??K)},0):(S==null||S([K-Y,Q]),ri(W,!0)):G.current.range.height>1&<(X.downFill,y,F)?wl():G.current.range.width>1&<(X.rightFill,y,F)?bl():lt(X.goToNextPage,y,F)?Q+=Math.max(1,en.current.height-4):lt(X.goToPreviousPage,y,F)?Q-=Math.max(1,en.current.height-4):lt(X.goToFirstCell,y,F)?(o(void 0),Q=0,K=0):lt(X.goToLastCell,y,F)?(o(void 0),Q=Number.MAX_SAFE_INTEGER,K=Number.MAX_SAFE_INTEGER):lt(X.selectToFirstCell,y,F)?(o(void 0),Zn([-2,-2])):lt(X.selectToLastCell,y,F)?(o(void 0),Zn([2,2])):Di?(lt(X.closeOverlay,y,F)&&o(void 0),lt(X.acceptOverlayDown,y,F)&&(o(void 0),Q++),lt(X.acceptOverlayUp,y,F)&&(o(void 0),Q--),lt(X.acceptOverlayLeft,y,F)&&(o(void 0),K--),lt(X.acceptOverlayRight,y,F)&&(o(void 0),K++)):(lt(X.goDownCell,y,F)?Q+=1:lt(X.goUpCell,y,F)?Q-=1:lt(X.goRightCell,y,F)?K+=1:lt(X.goLeftCell,y,F)?K-=1:lt(X.goDownCellRetainSelection,y,F)?(Q+=1,we=!0):lt(X.goUpCellRetainSelection,y,F)?(Q-=1,we=!0):lt(X.goRightCellRetainSelection,y,F)?(K+=1,we=!0):lt(X.goLeftCellRetainSelection,y,F)?(K-=1,we=!0):lt(X.goToLastRow,y,F)?Q=Ze-1:lt(X.goToFirstRow,y,F)?Q=Number.MIN_SAFE_INTEGER:lt(X.goToLastColumn,y,F)?K=Number.MAX_SAFE_INTEGER:lt(X.goToFirstColumn,y,F)?K=Number.MIN_SAFE_INTEGER:(Rt==="rect"||Rt==="multi-rect")&&(lt(X.selectGrowDown,y,F)?Zn([0,1]):lt(X.selectGrowUp,y,F)?Zn([0,-1]):lt(X.selectGrowRight,y,F)?Zn([1,0]):lt(X.selectGrowLeft,y,F)?Zn([-1,0]):lt(X.selectToLastRow,y,F)?Zn([0,2]):lt(X.selectToFirstRow,y,F)?Zn([0,-2]):lt(X.selectToLastColumn,y,F)?Zn([2,0]):lt(X.selectToFirstColumn,y,F)&&Zn([-2,0])),Le=F.didMatch),Kn!==void 0&&Kn!=="normal"&&Q!==re){const Fe=Kn==="skip-up"||Kn==="skip"||Kn==="block",Mt=Kn==="skip-down"||Kn==="skip"||Kn==="block",jt=Q<re;if(jt&&Fe){for(;Q>=0&&Hr(Q).isGroupHeader;)Q--;Q<0&&(Q=re)}else if(!jt&&Mt){for(;Q<Ze&&Hr(Q).isGroupHeader;)Q++;Q>=Ze&&(Q=re)}}const Ae=Mr(K,Q,!1,we),De=F.didMatch;return De&&(Ae||!Le||Jt)&&A(),De},[Kn,Di,G,Hn,et,le,Rt,Y,Hr,Ze,Mr,Se,pt,w.length,Te,Jt,Vr,Je,ke,Gt,Mo,ii,S,ri,wl,bl,Zn]),Oi=g.useCallback(y=>{let A=!1;if(q!==void 0&&q({...y,cancel:()=>{A=!0}}),A||Cl(y)||G.current===void 0)return;const[F,W]=G.current.cell,B=en.current;if(Ve&&!y.metaKey&&!y.ctrlKey&&G.current!==void 0&&y.key.length===1&&/[ -~]/g.test(y.key)&&y.bounds!==void 0&&ji(M([F-Y,Math.max(0,Math.min(W,Ze-1))]))){if((!Gt||W!==Ze)&&(B.y>W||W>B.y+B.height||B.x>F||F>B.x+B.width))return;ri(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Ve,q,Cl,G,M,Y,Ze,Gt,ri]),Uf=g.useCallback((y,A)=>{const F=y.location[0]-Y;if(y.kind==="header"&&(oe==null||oe(F,{...y,preventDefault:A})),y.kind===qn){if(F<0)return;j==null||j(F,{...y,preventDefault:A})}if(y.kind==="cell"){const[W,B]=y.location;N==null||N([F,B],{...y,preventDefault:A}),Rm(G,y.location)||Mr(W,B,!1,!1)}},[G,N,j,oe,Y,Mr]),za=g.useCallback(async y=>{var X,K,Q;if(!Hn.paste)return;function A(re,we,Le,ye){var De,gt;const Ae=typeof Le=="object"?(Le==null?void 0:Le.join(`
|
173
|
+
`))??"":(Le==null?void 0:Le.toString())??"";if(!di(re)&&ji(re)&&re.readonly!==!0){const qe=E==null?void 0:E(Ae,re);if(qe!==void 0&&ui(qe))return{location:we,value:qe};const Fe=Ct(re);if(Fe===void 0)return;if(Fe.kind===te.Custom){_n(re.kind===te.Custom);const Mt=(De=Fe.onPaste)==null?void 0:De.call(Fe,Ae,re.data);return Mt===void 0?void 0:{location:we,value:{...re,data:Mt}}}else{const Mt=(gt=Fe.onPaste)==null?void 0:gt.call(Fe,Ae,re,{formatted:ye,formattedString:typeof ye=="string"?ye:ye==null?void 0:ye.join(`
|
174
|
+
`),rawValue:Le});return Mt===void 0?void 0:(_n(Mt.kind===re.kind),{location:we,value:Mt})}}}const F=G.columns,W=G.rows,B=((X=qt.current)==null?void 0:X.contains(document.activeElement))===!0||((K=l.current)==null?void 0:K.contains(document.activeElement))===!0;let Z;if(G.current!==void 0?Z=[G.current.range.x,G.current.range.y]:F.length===1?Z=[F.first()??0,0]:W.length===1&&(Z=[Y,W.first()??0]),B&&Z!==void 0){let re,we;const Le="text/plain",ye="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Fe of qe){if(Fe.types.includes(ye)){const jt=await(await Fe.getType(ye)).text(),an=Iu(jt);if(an!==void 0){re=an;break}}Fe.types.includes(Le)&&(we=await(await Fe.getType(Le)).text())}}else if(navigator.clipboard.readText!==void 0)we=await navigator.clipboard.readText();else if(y!==void 0&&(y==null?void 0:y.clipboardData)!==null){if(y.clipboardData.types.includes(ye)){const qe=y.clipboardData.getData(ye);re=Iu(qe)}re===void 0&&y.clipboardData.types.includes(Le)&&(we=y.clipboardData.getData(Le))}else return;const[Ae,De]=Z,gt=[];do{if(nt===void 0){const qe=On(Z),Fe=we??(re==null?void 0:re.map(jt=>jt.map(an=>an.rawValue).join(" ")).join(" "))??"",Mt=A(qe,Z,Fe,void 0);Mt!==void 0&>.push(Mt);break}if(re===void 0){if(we===void 0)return;re=O0(we)}if(nt===!1||typeof nt=="function"&&(nt==null?void 0:nt([Z[0]-Y,Z[1]],re.map(qe=>qe.map(Fe=>{var Mt;return((Mt=Fe.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[qe,Fe]of re.entries()){if(qe+De>=Ze)break;for(const[Mt,jt]of Fe.entries()){const an=[Mt+Ae,qe+De],[Jn,or]=an;if(Jn>=St.length||or>=wn)continue;const Qn=On(an),ar=A(Qn,an,jt.rawValue,jt.formatted);ar!==void 0&>.push(ar)}}}while(!1);Vn(gt),(Q=En.current)==null||Q.damage(gt.map(qe=>({cell:qe.location})))}},[E,Ct,On,G,Hn.paste,qt,St.length,Vn,wn,nt,Y,Ze]);mn("paste",za,d,!1,!0);const Pi=g.useCallback(async(y,A)=>{var X,K;if(!Hn.copy)return;const F=A===!0||((X=qt.current)==null?void 0:X.contains(document.activeElement))===!0||((K=l.current)==null?void 0:K.contains(document.activeElement))===!0,W=G.columns,B=G.rows,Z=(Q,re)=>{if(!me)Du(Q,re,y);else{const we=re.map(Le=>({kind:te.Text,data:w[Le].title,displayData:w[Le].title,allowOverlay:!1}));Du([we,...Q],re,y)}};if(F&&cn!==void 0){if(G.current!==void 0){let Q=cn(G.current.range,un.current.signal);typeof Q!="object"&&(Q=await Q()),Z(Q,sr(G.current.range.x-Y,G.current.range.x+G.current.range.width-Y))}else if(B!==void 0&&B.length>0){const re=[...B].map(we=>{const Le=cn({x:Y,y:we,width:w.length,height:1},un.current.signal);return typeof Le=="object"?Le[0]:Le().then(ye=>ye[0])});if(re.some(we=>we instanceof Promise)){const we=await Promise.all(re);Z(we,sr(w.length))}else Z(re,sr(w.length))}else if(W.length>0){const Q=[],re=[];for(const we of W){let Le=cn({x:we,y:0,width:1,height:Ze},un.current.signal);typeof Le!="object"&&(Le=await Le()),Q.push(Le),re.push(we-Y)}if(Q.length===1)Z(Q[0],re);else{const we=Q.reduce((Le,ye)=>Le.map((Ae,De)=>[...Ae,...ye[De]]));Z(we,re)}}}},[w,cn,G,Hn.copy,Y,qt,Ze,me]);mn("copy",Pi,d,!1,!1);const qf=g.useCallback(async y=>{var F,W;if(!(!Hn.cut||!(((F=qt.current)==null?void 0:F.contains(document.activeElement))===!0||((W=l.current)==null?void 0:W.contains(document.activeElement))===!0))&&(await Pi(y),G.current!==void 0)){let B={current:{cell:G.current.cell,range:G.current.range,rangeStack:[]},rows:mt.empty(),columns:mt.empty()};const Z=Te==null?void 0:Te(B);if(Z===!1||(B=Z===!0?B:Z,B.current===void 0))return;Vr(B.current.range)}},[Vr,G,Hn.cut,Pi,qt,Te]);mn("cut",qf,d,!1,!1);const Yf=g.useCallback((y,A)=>{if(he!==void 0){Y!==0&&(y=y.map(B=>[B[0]-Y,B[1]])),he(y,A);return}if(y.length===0||A===-1)return;const[F,W]=y[A];c.current!==void 0&&c.current[0]===F&&c.current[1]===W||(c.current=[F,W],Mr(F,W,!1,!1))},[he,Y,Mr]),[Io,To]=((Il=Ft==null?void 0:Ft.current)==null?void 0:Il.cell)??[],Do=g.useRef(on);Do.current=on,g.useLayoutEffect(()=>{var y,A,F,W;Ha.current&&!Sr.current&&Io!==void 0&&To!==void 0&&(Io!==((A=(y=se.current)==null?void 0:y.current)==null?void 0:A.cell[0])||To!==((W=(F=se.current)==null?void 0:F.current)==null?void 0:W.cell[1]))&&Do.current(Io,To),Sr.current=!1},[Io,To]);const Sl=G.current!==void 0&&(G.current.cell[0]>=St.length||G.current.cell[1]>=wn);g.useLayoutEffect(()=>{Sl&&Se(No,!1)},[Sl,Se]);const Xf=g.useMemo(()=>Gt===!0&&(Pe==null?void 0:Pe.tint)===!0?mt.fromSingleSelection(wn-1):mt.empty(),[wn,Gt,Pe==null?void 0:Pe.tint]),jf=g.useCallback(y=>typeof st=="boolean"?st:(st==null?void 0:st(y-Y))??!0,[Y,st]),Gf=g.useMemo(()=>{if(Oa===void 0||l.current===null)return null;const{bounds:y,group:A}=Oa,F=l.current.getBoundingClientRect();return g.createElement(y0,{bounds:y,group:A,canvasBounds:F,onClose:()=>Pa(void 0),onFinish:W=>{Pa(void 0),ne==null||ne(A,W)}})},[ne,Oa]),Kf=Math.min(St.length,Ee+(zn?1:0));g.useImperativeHandle(t,()=>({appendRow:(y,A)=>ii(y+Y,A),updateCells:y=>{var A;return Y!==0&&(y=y.map(F=>({cell:[F.cell[0]+Y,F.cell[1]]}))),(A=En.current)==null?void 0:A.damage(y)},getBounds:(y,A)=>{var F;if(!((l==null?void 0:l.current)===null||(qt==null?void 0:qt.current)===null)){if(y===void 0&&A===void 0){const W=l.current.getBoundingClientRect(),B=W.width/qt.current.clientWidth;return{x:W.x-qt.current.scrollLeft*B,y:W.y-qt.current.scrollTop*B,width:qt.current.scrollWidth*B,height:qt.current.scrollHeight*B}}return(F=En.current)==null?void 0:F.getBounds((y??0)+Y,A)}},focus:()=>{var y;return(y=En.current)==null?void 0:y.focus()},emit:async y=>{switch(y){case"delete":Oi({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":Oi({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":Oi({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 Pi(void 0,!0);break;case"paste":await za();break}},scrollTo:on,remeasureColumns:y=>{for(const A of y)Ro(A+Y)}}),[ii,Ro,qt,Pi,Oi,za,Y,on]);const[xl,kl]=ir??[],Zf=g.useCallback(y=>{const[A,F]=y;if(F===-1){et!=="none"&&(Je(mt.fromSingleSelection(A),void 0,!1),Sn());return}xl===A&&kl===F||(kt({cell:y,range:{x:A,y:F,width:1,height:1}},!0,!1,"keyboard-nav"),on(A,F))},[et,Sn,on,xl,kl,kt,Je]),[Jf,Qf]=g.useState(!1),Ml=g.useRef(Xc(y=>{Qf(y)},5)),eh=g.useCallback(()=>{Ml.current(!0),G.current===void 0&&G.columns.length===0&&G.rows.length===0&&s===void 0&&kt({cell:[Y,yo],range:{x:Y,y:yo,width:1,height:1}},!0,!1,"keyboard-select")},[yo,G,s,Y,kt]),th=g.useCallback(()=>{Ml.current(!1)},[]),[nh,rh]=g.useMemo(()=>{let y;const A=(Ht==null?void 0:Ht.scrollbarWidthOverride)??bs(),F=Ze+(Gt?1:0);if(typeof jn=="number")y=It+F*jn;else{let B=0;const Z=Math.min(F,10);for(let X=0;X<Z;X++)B+=jn(X);B=Math.floor(B/Z),y=It+F*B}y+=A;const W=St.reduce((B,Z)=>Z.width+B,0)+A;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,y)}px`]},[St,Ht==null?void 0:Ht.scrollbarWidthOverride,jn,Ze,Gt,It]),ih=g.useMemo(()=>$m(Ue),[Ue]);return g.createElement(vd.Provider,{value:Ue},g.createElement(F0,{style:ih,className:U,inWidth:p??nh,inHeight:v??rh},g.createElement(p0,{fillHandle:$t,drawFocusRing:_r,experimental:Ht,fixedShadowX:Nt,fixedShadowY:Ut,getRowThemeOverride:An,headerIcons:Ce,imageWindowLoader:dt,initialSize:rn,isDraggable:z,onDragLeave:_e,onRowMoved:We,overscrollX:ka,overscrollY:Ma,preventDiagonalScrolling:sn,rightElement:fn,rightElementProps:Tn,smoothScrollX:Fn,smoothScrollY:Xn,className:U,enableGroups:Cn,onCanvasFocused:eh,onCanvasBlur:th,canvasRef:l,onContextMenu:Uf,theme:Ue,cellXOffset:Tf,cellYOffset:yo,accessibilityHeight:Fr.height,onDragEnd:$f,columns:St,nonGrowWidth:Gn,drawHeader:it,onColumnProposeMove:I,drawCell:ot,disabledRows:Xf,freezeColumns:Kf,lockColumns:Y,firstColAccessible:Y===0,getCellContent:On,minColumnWidth:rr,maxColumnWidth:Lr,searchInputRef:a,showSearch:Mi,onSearchClose:Ra,highlightRegions:Df,getCellsForSelection:cn,getGroupDetails:Ta,headerHeight:ki,isFocused:Jf,groupHeaderHeight:Cn?bo:0,freezeTrailingRows:At+(Gt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:Gt,onColumnResize:xe,onColumnResizeEnd:de,onColumnResizeStart:Re,onCellFocused:Zf,onColumnMoved:zf,onDragStart:Vf,onHeaderMenuClick:Ff,onHeaderIndicatorClick:Af,onItemHovered:Aa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:Lf,onKeyDown:Oi,onKeyUp:fe,onMouseDown:Of,onMouseUp:_f,onDragOverCell:zt,onDrop:Ot,onSearchResultsChanged:Yf,onVisibleRegionChanged:Hf,clientSize:ft,rowHeight:jn,searchResults:J,searchValue:P,onSearchValueChange:H,rows:wn,scrollRef:qt,selection:G,translateX:Fr.tx,translateY:Fr.ty,verticalBorder:jf,gridRef:En,getCellRenderer:Ct,resizeIndicator:xa}),Gf,i!==void 0&&g.createElement(g.Suspense,{fallback:null},g.createElement(Y0,{...i,validateCell:$,bloom:D,id:Wf,getCellRenderer:Ct,className:(Ht==null?void 0:Ht.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:vn,imageEditorOverride:f,onFinishEditing:Bf,markdownDivCreateNode:m,isOutsideClick:wr}))))},K0=g.forwardRef(G0),Ld=20;function _u(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:a,height:l,x:s,y:u}=i,c=t.maxSize??Ld,d=Math.floor(i.y+l/2),f=Kc(c,l,o.cellVerticalPadding),h=Gc(t.contentAlign??"center",s,a,o.cellHorizontalPadding,f),m=jc(h,d,f),p=Zc(s+n,u+r,m);return Hs(t)&&p}const Z0={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:te.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>J0(e,e.cell.data,Hs(e.cell),e.cell.maxSize??Ld,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{_u(e)&&e.preventDefault()},onClick:e=>{if(_u(e))return{...e.cell,data:Od(e.cell.data)}},onPaste:(e,t)=>{let n=ea;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=As),n===t.data?void 0:{...t,data:n}}};function J0(e,t,n,r,i){if(!n&&t===ea)return;const{ctx:o,hoverAmount:a,theme:l,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:h,y:m,width:p,height:v}=s;let w=!1;if(i>0){let b=n?1-i+i*a:.4;if(t===ea&&(b*=a),b===0)return;b<1&&(w=!0,o.globalAlpha=b)}Xs(o,l,t,h,m,p,v,u,c,d,r,f),w&&(o.globalAlpha=1)}const Q0=pn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),ev=e=>{const{bubbles:t}=e;return g.createElement(Q0,null,t.map((n,r)=>g.createElement("div",{key:r,className:"boe-bubble"},n)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},tv={getAccessibilityString:e=>Jc(e.data),kind:te.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i).width+r+20,0)+2*n.cellHorizontalPadding-4,draw:e=>rv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(ev,{bubbles:t.data})},onPaste:()=>{}},nv=4;function rv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:a,y:l,width:s,height:u}=n,c=20,d=8,f=nv;let h=a+r.cellHorizontalPadding;const m=[];for(const p of t){if(h>a+s)break;const v=Kr(p,i,r.baseFontFull).width;m.push({x:h,width:v}),h+=v+d*2+f}i.beginPath();for(const p of m)ur(i,p.x,l+(u-c)/2,p.width+d*2,c,r.roundingRadius??c/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[p,v]of m.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[p],v.x+d,l+u/2+cr(i,r))}const iv=pn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),ov=e=>{const{drilldowns:t}=e;return g.createElement(iv,null,t.map((n,r)=>g.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&g.createElement("img",{src:n.img}),g.createElement("div",null,n.text))))},av={getAccessibilityString:e=>Jc(e.data.map(t=>t.text)),kind:te.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+20+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>uv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(ov,{drilldowns:t.data})},onPaste:()=>{}},sv=4,os={};function lv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,l=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,f=`${e},${t},${i},${n}`;if(os[f]!==void 0)return{el:os[f],height:s,width:d,middleWidth:l*i,sideWidth:u*i,padding:o*i,dpr:i};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=s,m.scale(i,i),os[f]=h,m.beginPath(),ur(m,o,o,c,a,r),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(),ur(m,o+.5,o+.5,c,a,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:s,width:d,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function uv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:a,row:l}=e,{x:s,width:u}=n,c=r.baseFontFull,d=fd(i,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,v=sv;let w=s+r.cellHorizontalPadding;const b=r.roundingRadius??6,M=lv(r.bgCell,r.drilldownBorder,f,b),O=[];for(const S of t){if(w>s+u)break;const _=Kr(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,a,l)!==void 0&&(E=m-8+4);const x=_+E+p*2;O.push({x:w,width:x}),w+=x+v}if(M!==null){const{el:S,height:R,middleWidth:_,sideWidth:E,width:x,dpr:L,padding:D}=M,C=E/L,I=D/L;for(const T of O){const k=Math.floor(T.x),V=Math.floor(T.width),N=V-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,R,k-I,h,C,f),N>0&&i.drawImage(S,E,0,_,R,k+(C-I),h,N,f),i.drawImage(S,x-E,0,E,R,k+V-(C-I),h,C,f),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of O.entries()){const _=t[S];let E=R.x+p;if(_.img!==void 0){const x=o.loadOrGetImage(_.img,a,l);if(x!==void 0){const L=m-8;let D=0,C=0,I=x.width,T=x.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),ur(i,E,h+f/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(x,D,C,I,T,E,h+f/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+f/2+cr(i,r))}}const cv={getAccessibilityString:e=>e.data.join(", "),kind:te.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>dv(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:r}=e,i=r??Kg;return g.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},as=4;function dv(e,t,n,r){const{rect:i,col:o,row:a,theme:l,ctx:s,imageLoader:u}=e,{x:c,y:d,height:f,width:h}=i,m=f-l.cellVerticalPadding*2,p=[];let v=0;for(let b=0;b<t.length;b++){const M=t[b];if(M.length===0)continue;const O=u.loadOrGetImage(M,o,a);if(O!==void 0){p[b]=O;const S=O.width*(m/O.height);v+=S+as}}if(v===0)return;v-=as;let w=c+l.cellHorizontalPadding;r==="right"?w=Math.floor(c+h-l.cellHorizontalPadding-v):r==="center"&&(w=Math.floor(c+h/2-v/2));for(const b of p){if(b===void 0)continue;const M=b.width*(m/b.height);n>0&&(s.beginPath(),ur(s,w,d+l.cellVerticalPadding,M,m,n),s.save(),s.clip()),s.drawImage(b,w,d+l.cellVerticalPadding,M,m),n>0&&s.restore(),w+=M+as}}function fv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const hv={getAccessibilityString:()=>"",kind:te.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(fv(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=o.width&&(l=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);ur(i,o.x+s,o.y+(o.height-u)/2,l,u,a.roundingRadius??3),i.fillStyle=Yr(a.textDark,.1),i.fill()},onPaste:()=>{}},gv=()=>e=>e.targetWidth,Lu=pn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[gv(),"px"]}}),mv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:a,validatedSelection:l}=e,s=t.data,u=t.readonly===!0,[c,d]=g.useState(s===""||r),f=g.useCallback(()=>{d(m=>!m)},[]),h=s?"gdg-ml-6":"";return c?g.createElement(Lu,{targetWidth:o.width-20},g.createElement(jr,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),g.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>a(t)},g.createElement(Wg,null))):g.createElement(Lu,{targetWidth:o.width},g.createElement(mm,{contents:s,createNode:i}),!u&&g.createElement(g.Fragment,null,g.createElement("div",{className:"spacer"}),g.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:f},g.createElement(Vs,null))),g.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},pv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:uo,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>lr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:i,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:l}=e;return g.createElement(mv,{onFinish:i,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},vv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:bv,measure:()=>44,draw:e=>yv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:i}=e,{width:o,height:a}=t,l=n.drawHandle?7+(o-7)/2:o/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function bv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==i&&(n.font=i,o.font=i),o.deprep=wv,n.textAlign="center",o}function wv(e){const{ctx:t}=e;t.textAlign="start"}function yv(e,t,n,r,i,o){const{ctx:a,rect:l,hoverAmount:s,theme:u}=e,{x:c,y:d,width:f,height:h}=l,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?s:1);if(Xs(a,u,n,i?c+p:c,d,i?f-p:f,h,!0,void 0,void 0,18,"center",o),i){a.globalAlpha=s,a.beginPath();for(const v of[3,6])for(const w of[-5,-1,3])a.rect(c+v,d+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),v=u.markerFontFull,w=c+f/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=u.textLight,a.font=v,a.fillText(p,w,d+h/2+cr(a,v)),s!==0&&(a.globalAlpha=1)}}const Cv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Sv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Sv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:a,spriteManager:l}=e,{x:s,y:u,width:c,height:d}=i;r.beginPath(),r.globalAlpha=o,r.rect(s+1,u+1,c,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,v=s+8/2,w=u+8/2;l.drawSprite(n,"normal",r,v,w,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,v=f?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+v,u+d/2),r.lineTo(s+w+v+p,u+d/2),r.moveTo(s+w+v+p*.5,u+d/2-p*.5),r.lineTo(s+w+v+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,h+s+a.cellHorizontalPadding+.5,u+d/2+cr(r,a)),r.beginPath()}function Fd(e,t,n,r,i,o,a){e.textBaseline="alphabetic";const l=xv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),ur(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Yr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function xv(e,t,n,r,i){const o=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const l=Kr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,u=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:l.width+o*3,height:u-1}}const kv=g.lazy(async()=>await Ds(()=>import("./number-overlay-editor.DAvAckzz.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),Mv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:uo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:u}=n;l===!0&&t>0&&Fd(r,i,u,s,o,t,a),lr(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:r,validatedSelection:i}=e;return g.createElement(g.Suspense,{fallback:null},g.createElement(kv,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:i,onChange:o=>n({...r,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},Rv={getAccessibilityString:()=>"",measure:()=>108,kind:te.Protected,needsHover:!1,needsHoverPosition:!1,draw:Ev,onPaste:()=>{}};function Ev(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:a}=r;t.beginPath();const l=2.5;let s=i+n.cellHorizontalPadding+l;const u=o+a/2,c=Math.cos(Ql(30))*l,d=Math.sin(Ql(30))*l;for(let f=0;f<12;f++)t.moveTo(s,u-l),t.lineTo(s,u+l),t.moveTo(s+c,u-d),t.lineTo(s-c,u+d),t.moveTo(s-c,u-d),t.lineTo(s+c,u+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Iv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>uo(e,t,e.theme.textLight),draw:e=>lr(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:r,validatedSelection:i}=e;return ae.createElement(jr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},Tv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:uo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&Fd(i,a,f,s,o,n,l),lr(e,s,u,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
176
|
+
`,t.allowWrapping===!0?void 0:1);let i=0;for(const o of r)i=Math.max(i,e.measureText(o).width);return i+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:i,validatedSelection:o}=t;return g.createElement(jr,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:i.readonly!==!0,disabled:i.readonly===!0,altNewline:!0,value:i.data,validatedSelection:o,onChange:a=>r({...i,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Dv=pn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Ov=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:a}=e,[l,s]=g.useState(!i&&(t===""||r)),u=g.useCallback(()=>{s(!0)},[]);return l?g.createElement(jr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):g.createElement(Dv,null,g.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!i&&g.createElement("div",{className:"gdg-edit-icon",onClick:u},g.createElement(Vs,null)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ad(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?i=t.width-a-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-a/2),{x:i,y:o,width:a,height:l}}function Fu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=cd(a,o.baseFontFull);if(l===void 0)return!1;const s=Ad(l,n,o,t.contentAlign);return qr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Pv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:te.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:uo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:a,ctx:l}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=Kr(s,l,n.baseFontFull),d=Ad(c,a,n,t.contentAlign),{x:f,y:h,width:m,height:p}=d;if(i>=f-4&&i<=f-4+m+8&&o>=h-4&&o<=h-4+p+8){const v=cr(l,n.baseFontFull);r("pointer");const w=5,b=h-v;l.beginPath(),l.moveTo(a.x+f,Math.floor(a.y+b+p+w)+.5),l.lineTo(a.x+f+m,Math.floor(a.y+b+p+w)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,lr({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),lr({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=u?n.linkColor:n.textDark,lr(e,s,t.contentAlign)},onSelect:e=>{Fu(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;Fu(e)&&((r=t.onClickUri)==null||r.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:r,forceEditMode:i,validatedSelection:o}=t;return g.createElement(Ov,{forceEditMode:r.readonly!==!0&&(i||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:o,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},_v=[vv,Cv,Z0,tv,av,cv,hv,pv,Mv,Rv,Iv,Tv,Pv];var ss,Au;function Lv(){if(Au)return ss;Au=1;var e=Yc(),t=Mc(),n="Expected a function";function r(i,o,a){var l=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(a)&&(l="leading"in a?!!a.leading:l,s="trailing"in a?!!a.trailing:s),e(i,o,{leading:l,maxWait:o,trailing:s})}return ss=r,ss}var Fv=Lv();const Av=vr(Fv),ls=[];class Hv extends gd{constructor(){super(...arguments);ct(this,"imageLoaded",()=>{});ct(this,"loadedLocations",[]);ct(this,"cache",{});ct(this,"sendLoaded",Av(()=>{this.imageLoaded(new Qi(this.loadedLocations)),this.loadedLocations=[]},20));ct(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let a=0;a<i.cells.length;a++){const l=i.cells[a];if(this.isInWindow(l)){o=!0;break}}o?i.cells=i.cells.filter(this.isInWindow):(i.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,i,o){let a=!1;const l=ls.pop()??new Image;let s=!1;const u={img:void 0,cells:[tr(r,i)],url:n,cancel:()=>{s||(s=!0,ls.length<12?ls.unshift(l):a||(l.src=""))}},c=new Promise(d=>l.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{l.src=n,await c,await l.decode();const d=this.cache[o];if(d!==void 0&&!s){d.img=l;for(const f of d.cells)this.loadedLocations.push(Ys(f));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,a=this.cache[o];if(a!==void 0){const l=tr(r,i);return a.cells.includes(l)||a.cells.push(l),a.img}else this.loadImage(n,r,i,o)}}const zv=(e,t)=>{const n=g.useMemo(()=>({...Ip,...e.headerIcons}),[e.headerIcons]),r=g.useMemo(()=>e.imageWindowLoader??new Hv,[e.imageWindowLoader]);return g.createElement(K0,{...e,renderers:_v,headerIcons:n,ref:t,imageWindowLoader:r})},Vv=g.forwardRef(zv);function Hu(e,t){const n=g.useRef(null),r=g.useRef(),i=g.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return g.useEffect(()=>i,[i]),{debouncedCallback:g.useCallback((...a)=>{r.current=a,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const zu=vi("div",{target:"etfhowj0"})(({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"}})),Hd=vi("div",{target:"etfhowj1"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Ur=vi("div",{target:"etfhowj2"})(({theme:e,isActive:t,hasSubmenu:n})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,paddingTop:e.spacing.twoXS,paddingBottom:e.spacing.twoXS,cursor:"pointer",backgroundColor:t?e.colors.darkenedBgMix15:void 0,"&:hover":{backgroundColor:e.colors.darkenedBgMix15},minWidth:e.sizes.minMenuWidth,...n&&{justifyContent:"space-between","& > :first-of-type":{display:"flex",alignItems:"center",gap:e.spacing.sm}}})),$v=vi("div",{target:"etfhowj3"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Vu=[{format:"",label:"Automatic",icon:":material/123:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"plain",label:"Plain",icon:":material/speed_1_75:"},{format:"compact",label:"Compact",icon:":material/1k:"},{format:"dollar",label:"Dollar",icon:":material/attach_money:"},{format:"euro",label:"Euro",icon:":material/euro:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Nv={number:Vu,progress:Vu,datetime:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"},{format:"calendar",label:"Calendar",icon:":material/today:"}],date:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"},{format:"distance",label:"Distance",icon:":material/search_activity:"}],time:[{format:"",label:"Automatic",icon:":material/schedule:"},{format:"localized",label:"Localized",icon:":material/translate:"}]};function Bv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:a}){const l=lo(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=l,f=Nv[e]||[];return f.length===0?wt(Ic,{}):wt(_s,{triggerType:bh.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:wt(Hd,{role:"menu",children:f.map(h=>Bn(Ur,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:Os.right,showArrow:!1,popoverMargin:2,overrides:{Body:{props:{"data-testid":"stDataFrameColumnFormattingMenu"},style:{borderTopLeftRadius:c.default,borderTopRightRadius:c.default,borderBottomLeftRadius:c.default,borderBottomRightRadius:c.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:Ps(l)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:u.sm,fontWeight:d.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:a})}const Wv=g.memo(Bv);function Uv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:a,columnKind:l,onChangeFormat:s,onAutosize:u}){const c=lo(),[d,f]=g.useState(!1),{colors:h,fontSizes:m,radii:p,fontWeights:v}=c;g.useEffect(()=>{function b(O){O.preventDefault()}const M=()=>{document.removeEventListener("wheel",b),document.removeEventListener("touchmove",b)};return document.addEventListener("wheel",b,{passive:!1}),document.addEventListener("touchmove",b,{passive:!1}),()=>{M()}},[]);const w=ae.useCallback(()=>{o()},[o]);return wt(_s,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Bn(Hd,{children:[a&&Bn(Ic,{children:[Bn(Ur,{onClick:()=>{a("asc"),w()},role:"menuitem",children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Bn(Ur,{onClick:()=>{a("desc"),w()},role:"menuitem",children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),wt($v,{})]}),s&&wt(Wv,{columnKind:l,isOpen:d,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onChangeFormat:s,onCloseMenu:w,children:Bn(Ur,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),isActive:d,hasSubmenu:!0,children:[Bn("div",{children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),u&&Bn(Ur,{onClick:()=>{u(),w()},children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/fit_width:"}),"Autosize"]}),n&&Bn(Ur,{onClick:()=>{i(),w()},children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Bn(Ur,{onClick:()=>{r(),w()},children:[wt(Ir,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]})]}),placement:Os.bottomRight,accessibilityType:Tc.menu,showArrow:!1,popoverMargin:Nn("0.375rem"),onClickOutside:d?void 0:w,onEsc:w,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${c.sizes.borderWidth} solid ${c.colors.borderColor}`,backgroundColor:Ps(c)?h.bgColor:h.secondaryBg,color:h.bodyText,fontSize:m.sm,fontWeight:v.normal,borderTopLeftRadius:p.default,borderTopRightRadius:p.default,borderBottomLeftRadius:p.default,borderBottomRightRadius:p.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:wt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const qv=g.memo(Uv);var Yv=wh();const Xv=vr(Yv);var Zo={exports:{}};/*! Moment Duration Format v2.2.2
|
177
|
+
* https://github.com/jsmreese/moment-duration-format
|
178
|
+
* Date: 2018-02-16
|
179
|
+
*
|
180
|
+
* Duration format plugin function for the Moment.js library
|
181
|
+
* http://momentjs.com/
|
182
|
+
*
|
183
|
+
* Copyright 2018 John Madhavan-Reese
|
184
|
+
* Released under the MIT license
|
185
|
+
*/var jv=Zo.exports,$u;function Gv(){return $u||($u=1,function(e,t){(function(n,r){try{e.exports=r(yh)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(jv,function(n){var r=!1,i=!1,o=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(H,P){return P.length>H.length?!1:H.indexOf(P)!==-1}function c(H){for(var P="";H;)P+="0",H-=1;return P}function d(H){for(var P=H.split("").reverse(),q=0,fe=!0;fe&&q<P.length;)q?P[q]==="9"?P[q]="0":(P[q]=(parseInt(P[q],10)+1).toString(),fe=!1):(parseInt(P[q],10)<5&&(fe=!1),P[q]="0"),q+=1;return fe&&P.push("1"),P.reverse().join("")}function f(H,P){var q=_(k(P).sort(),function(ge){return ge+":"+P[ge]}).join(","),fe=H+"+"+q;return f.cache[fe]||(f.cache[fe]=Intl.NumberFormat(H,P)),f.cache[fe]}f.cache={};function h(H,P,q){var fe=P.useToLocaleString,ge=P.useGrouping,Ve=ge&&P.grouping.slice(),pe=P.maximumSignificantDigits,je=P.minimumIntegerDigits||1,Me=P.fractionDigits||0,Pt=P.groupingSeparator,Rt=P.decimalSeparator;if(fe&&q){var et={minimumIntegerDigits:je,useGrouping:ge};if(Me&&(et.maximumFractionDigits=Me,et.minimumFractionDigits=Me),pe&&H>0&&(et.maximumSignificantDigits=pe),o){if(!a){var le=T({},P);le.useGrouping=!1,le.decimalSeparator=".",H=parseFloat(h(H,le),10)}return f(q,et).format(H)}else{if(!i){var le=T({},P);le.useGrouping=!1,le.decimalSeparator=".",H=parseFloat(h(H,le),10)}return H.toLocaleString(q,et)}}var Ge;pe?Ge=H.toPrecision(pe+1):Ge=H.toFixed(Me+1);var be,ce,ve,$e=Ge.split("e");ve=$e[1]||"",$e=$e[0].split("."),ce=$e[1]||"",be=$e[0]||"";var Oe=be.length,nt=ce.length,me=Oe+nt,Ee=be+ce;(pe&&me===pe+1||!pe&&nt===Me+1)&&(Ee=d(Ee),Ee.length===me+1&&(Oe=Oe+1),nt&&(Ee=Ee.slice(0,-1)),be=Ee.slice(0,Oe),ce=Ee.slice(Oe)),pe&&(ce=ce.replace(/0*$/,""));var at=parseInt(ve,10);at>0?ce.length<=at?(ce=ce+c(at-ce.length),be=be+ce,ce=""):(be=be+ce.slice(0,at),ce=ce.slice(at)):at<0&&(ce=c(Math.abs(at)-be.length)+be+ce,be="0"),pe||(ce=ce.slice(0,Me),ce.length<Me&&(ce=ce+c(Me-ce.length)),be.length<je&&(be=c(je-be.length)+be));var He="";if(ge){$e=be;for(var rt;$e.length;)Ve.length&&(rt=Ve.shift()),He&&(He=Pt+He),He=$e.slice(-rt)+He,$e=$e.slice(0,-rt)}else He=be;return ce&&(He=He+Rt+ce),He}function m(H,P){return H.label.length>P.label.length?-1:H.label.length<P.label.length?1:0}function p(H,P){var q=[];return R(k(P),function(fe){if(fe.slice(0,15)==="_durationLabels"){var ge=fe.slice(15).toLowerCase();R(k(P[fe]),function(Ve){Ve.slice(0,1)===H&&q.push({type:ge,key:Ve,label:P[fe][Ve]})})}}),q}function v(H,P,q){return P===1&&q===null?H:H+H}var w={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:v};function b(H){return Object.prototype.toString.call(H)==="[object Array]"}function M(H){return Object.prototype.toString.call(H)==="[object Object]"}function O(H,P){for(var q=H.length;q-=1;)if(P(H[q]))return H[q]}function S(H,P){var q=0,fe=H&&H.length||0,ge;for(typeof P!="function"&&(ge=P,P=function(Ve){return Ve===ge});q<fe;){if(P(H[q]))return H[q];q+=1}}function R(H,P){var q=0,fe=H.length;if(!(!H||!fe))for(;q<fe;){if(P(H[q],q)===!1)return;q+=1}}function _(H,P){var q=0,fe=H.length,ge=[];if(!H||!fe)return ge;for(;q<fe;)ge[q]=P(H[q],q),q+=1;return ge}function E(H,P){return _(H,function(q){return q[P]})}function x(H){var P=[];return R(H,function(q){q&&P.push(q)}),P}function L(H){var P=[];return R(H,function(q){S(P,q)||P.push(q)}),P}function D(H,P){var q=[];return R(H,function(fe){R(P,function(ge){fe===ge&&q.push(fe)})}),L(q)}function C(H,P){var q=[];return R(H,function(fe,ge){if(!P(fe))return q=H.slice(ge),!1}),q}function I(H,P){var q=H.slice().reverse();return C(q,P).reverse()}function T(H,P){for(var q in P)P.hasOwnProperty(q)&&(H[q]=P[q]);return H}function k(H){var P=[];for(var q in H)H.hasOwnProperty(q)&&P.push(q);return P}function V(H,P){var q=0,fe=H.length;if(!H||!fe)return!1;for(;q<fe;){if(P(H[q],q)===!0)return!0;q+=1}return!1}function N(H){var P=[];return R(H,function(q){P=P.concat(q)}),P}function U(){var H=0;try{H.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function oe(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function ee(H){var P=!0;return P=P&&H(1,"en",{minimumIntegerDigits:1})==="1",P=P&&H(1,"en",{minimumIntegerDigits:2})==="01",P=P&&H(1,"en",{minimumIntegerDigits:3})==="001",!(!P||(P=P&&H(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",P=P&&H(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",P=P&&H(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",P=P&&H(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!P)||(P=P&&H(99.99,"en",{maximumSignificantDigits:1})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:2})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:3})==="100",P=P&&H(99.99,"en",{maximumSignificantDigits:4})==="99.99",P=P&&H(99.99,"en",{maximumSignificantDigits:5})==="99.99",!P)||(P=P&&H(1e3,"en",{useGrouping:!0})==="1,000",P=P&&H(1e3,"en",{useGrouping:!1})==="1000",!P))}function j(){var H=[].slice.call(arguments),P={},q;if(R(H,function(pe,je){if(!je){if(!b(pe))throw"Expected array as the first argument to durationsFormat.";q=pe}if(typeof pe=="string"||typeof pe=="function"){P.template=pe;return}if(typeof pe=="number"){P.precision=pe;return}M(pe)&&T(P,pe)}),!q||!q.length)return[];P.returnMomentTypes=!0;var fe=_(q,function(pe){return pe.format(P)}),ge=D(l,L(E(N(fe),"type"))),Ve=P.largest;return Ve&&(ge=ge.slice(0,Ve)),P.returnMomentTypes=!1,P.outputTypes=ge,_(q,function(pe){return pe.format(P)})}function ne(){var H=[].slice.call(arguments),P=T({},this.format.defaults),q=this.asMilliseconds(),fe=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(q=0,fe=0);var ge=q<0,Ve=n.duration(Math.abs(q),"milliseconds"),pe=n.duration(Math.abs(fe),"months");R(H,function(z){if(typeof z=="string"||typeof z=="function"){P.template=z;return}if(typeof z=="number"){P.precision=z;return}M(z)&&T(P,z)});var je={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Me={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=l;var Pt=function(z){return S(l,function(_e){return Me[_e].test(z)})},Rt=new RegExp(_(l,function(z){return Me[z].source}).join("|"),"g");P.duration=this;var et=typeof P.template=="function"?P.template.apply(P):P.template,le=P.outputTypes,Ge=P.returnMomentTypes,be=P.largest,ce=[];le||(b(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&R(P.stopTrim.match(Rt),function(z){var _e=Pt(z);_e==="escape"||_e==="general"||ce.push(_e)}));var ve=n.localeData();ve||(ve={}),R(k(w),function(z){if(typeof w[z]=="function"){ve[z]||(ve[z]=w[z]);return}ve["_"+z]||(ve["_"+z]=w[z])}),R(k(ve._durationTimeTemplates),function(z){et=et.replace("_"+z+"_",ve._durationTimeTemplates[z])});var $e=P.userLocale||n.locale(),Oe=P.useLeftUnits,nt=P.usePlural,me=P.precision,Ee=P.forceLength,at=P.useGrouping,He=P.trunc,rt=P.useSignificantDigits&&me>0,bt=rt?P.precision:0,ht=bt,ze=P.minValue,Tt=!1,Xt=P.maxValue,pt=!1,Et=P.useToLocaleString,Kt=P.groupingSeparator,Ft=P.decimalSeparator,xn=P.grouping;Et=Et&&(r||o);var Wt=P.trim;b(Wt)&&(Wt=Wt.join(" ")),Wt===null&&(be||Xt||rt)&&(Wt="all"),(Wt===null||Wt===!0||Wt==="left"||Wt==="right")&&(Wt="large"),Wt===!1&&(Wt="");var xt=function(z){return z.test(Wt)},In=/large/,vn=/small/,Pe=/both/,At=/mid/,hn=/^all|[^sm]all/,gn=/final/,bn=be>0||V([In,Pe,hn],xt),st=V([vn,Pe,hn],xt),zt=V([At,hn],xt),Ot=V([gn,hn],xt),nn=_(et.match(Rt),function(z,_e){var We=Pt(z);return z.slice(0,1)==="*"&&(z=z.slice(1),We!=="escape"&&We!=="general"&&ce.push(We)),{index:_e,length:z.length,text:"",token:We==="escape"?z.replace(Me.escape,"$1"):z,type:We==="escape"||We==="general"?null:We}}),Dt={index:0,length:0,token:"",text:"",type:null},Vt=[];Oe&&nn.reverse(),R(nn,function(z){if(z.type){(Dt.type||Dt.text)&&Vt.push(Dt),Dt=z;return}Oe?Dt.text=z.token+Dt.text:Dt.text+=z.token}),(Dt.type||Dt.text)&&Vt.push(Dt),Oe&&Vt.reverse();var Ke=D(l,L(x(E(Vt,"type"))));if(!Ke.length)return E(Vt,"text").join("");Ke=_(Ke,function(z,_e){var We=_e+1===Ke.length,_t=!_e,dn;z==="years"||z==="months"?dn=pe.as(z):dn=Ve.as(z);var sn=Math.floor(dn),fn=dn-sn,Tn=S(Vt,function(Jt){return z===Jt.type});return _t&&Xt&&dn>Xt&&(pt=!0),We&&ze&&Math.abs(P.duration.as(z))<ze&&(Tt=!0),_t&&Ee===null&&Tn.length>1&&(Ee=!0),Ve.subtract(sn,z),pe.subtract(sn,z),{rawValue:dn,wholeValue:sn,decimalValue:We?fn:0,isSmallest:We,isLargest:_t,type:z,tokenLength:Tn.length}});var $t=He?Math.floor:Math.round,Ht=function(z,_e){var We=Math.pow(10,_e);return $t(z*We)/We},Nt=!1,Ut=!1,Ce=function(z,_e){var We={useGrouping:at,groupingSeparator:Kt,decimalSeparator:Ft,grouping:xn,useToLocaleString:Et};return rt&&(bt<=0?(z.rawValue=0,z.wholeValue=0,z.decimalValue=0):(We.maximumSignificantDigits=bt,z.significantDigits=bt)),pt&&!Ut&&(z.isLargest?(z.wholeValue=Xt,z.decimalValue=0):(z.wholeValue=0,z.decimalValue=0)),Tt&&!Ut&&(z.isSmallest?(z.wholeValue=ze,z.decimalValue=0):(z.wholeValue=0,z.decimalValue=0)),z.isSmallest||z.significantDigits&&z.significantDigits-z.wholeValue.toString().length<=0?me<0?z.value=Ht(z.wholeValue,me):me===0?z.value=$t(z.wholeValue+z.decimalValue):rt?(He?z.value=Ht(z.rawValue,bt-z.wholeValue.toString().length):z.value=z.rawValue,z.wholeValue&&(bt-=z.wholeValue.toString().length)):(We.fractionDigits=me,He?z.value=z.wholeValue+Ht(z.decimalValue,me):z.value=z.wholeValue+z.decimalValue):rt&&z.wholeValue?(z.value=Math.round(Ht(z.wholeValue,z.significantDigits-z.wholeValue.toString().length)),bt-=z.wholeValue.toString().length):z.value=z.wholeValue,z.tokenLength>1&&(Ee||Nt)&&(We.minimumIntegerDigits=z.tokenLength,Ut&&We.maximumSignificantDigits<z.tokenLength&&delete We.maximumSignificantDigits),!Nt&&(z.value>0||Wt===""||S(ce,z.type)||S(le,z.type))&&(Nt=!0),z.formattedValue=h(z.value,We,$e),We.useGrouping=!1,We.decimalSeparator=".",z.formattedValueEn=h(z.value,We,"en"),z.tokenLength===2&&z.type==="milliseconds"&&(z.formattedValueMS=h(z.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),z};if(Ke=_(Ke,Ce),Ke=x(Ke),Ke.length>1){var dt=function(z){return S(Ke,function(_e){return _e.type===z})},rn=function(z){var _e=dt(z.type);_e&&R(z.targets,function(We){var _t=dt(We.type);_t&&parseInt(_e.formattedValueEn,10)===We.value&&(_e.rawValue=0,_e.wholeValue=0,_e.decimalValue=0,_t.rawValue+=1,_t.wholeValue+=1,_t.decimalValue=0,_t.formattedValueEn=_t.wholeValue.toString(),Ut=!0)})};R(s,rn)}return Ut&&(Nt=!1,bt=ht,Ke=_(Ke,Ce),Ke=x(Ke)),le&&!(pt&&!P.trim)?(Ke=_(Ke,function(z){return S(le,function(_e){return z.type===_e})?z:null}),Ke=x(Ke)):(bn&&(Ke=C(Ke,function(z){return!z.isSmallest&&!z.wholeValue&&!S(ce,z.type)})),be&&Ke.length&&(Ke=Ke.slice(0,be)),st&&Ke.length>1&&(Ke=I(Ke,function(z){return!z.wholeValue&&!S(ce,z.type)&&!z.isLargest})),zt&&(Ke=_(Ke,function(z,_e){return _e>0&&_e<Ke.length-1&&!z.wholeValue?null:z}),Ke=x(Ke)),Ot&&Ke.length===1&&!Ke[0].wholeValue&&!(!He&&Ke[0].isSmallest&&Ke[0].rawValue<ze)&&(Ke=[])),Ge?Ke:(R(Vt,function(z){var _e=je[z.type],We=S(Ke,function(Jt){return Jt.type===z.type});if(!(!_e||!We)){var _t=We.formattedValueEn.split(".");_t[0]=parseInt(_t[0],10),_t[1]?_t[1]=parseFloat("0."+_t[1],10):_t[1]=null;var dn=ve.durationPluralKey(_e,_t[0],_t[1]),sn=p(_e,ve),fn=!1,Tn={};R(ve._durationLabelTypes,function(Jt){var Fn=S(sn,function(Xn){return Xn.type===Jt.type&&Xn.key===dn});Fn&&(Tn[Fn.type]=Fn.label,u(z.text,Jt.string)&&(z.text=z.text.replace(Jt.string,Fn.label),fn=!0))}),nt&&!fn&&(sn.sort(m),R(sn,function(Jt){if(Tn[Jt.type]===Jt.label)return u(z.text,Jt.label)?!1:void 0;if(u(z.text,Jt.label))return z.text=z.text.replace(Jt.label,Tn[Jt.type]),!1}))}}),Vt=_(Vt,function(z){if(!z.type)return z.text;var _e=S(Ke,function(_t){return _t.type===z.type});if(!_e)return"";var We="";return Oe&&(We+=z.text),(ge&&pt||!ge&&Tt)&&(We+="< ",pt=!1,Tt=!1),(ge&&Tt||!ge&&pt)&&(We+="> ",pt=!1,Tt=!1),ge&&(_e.value>0||Wt===""||S(ce,_e.type)||S(le,_e.type))&&(We+="-",ge=!1),z.type==="milliseconds"&&_e.formattedValueMS?We+=_e.formattedValueMS:We+=_e.formattedValue,Oe||(We+=z.text),We}),Vt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ie(){var H=this.duration,P=function(Ve){return H._data[Ve]},q=S(this.types,P),fe=O(this.types,P);switch(q){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(q===fe)return"d __";case"weeks":return q===fe?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(q===fe)return"M __";case"years":return q===fe?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ue(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=j,H.duration.fn.format=ne,H.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ie,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},H.updateLocale("en",w)}var he=function(H,P,q){return H.toLocaleString(P,q)};r=U()&&ee(he),i=r&&oe(he);var J=function(H,P,q){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,q).format(H)};return o=ee(J),a=o&&oe(J),ue(n),ue})}(Zo)),Zo.exports}Gv();const Kv=["true","t","yes","y","on","1"],Zv=["false","f","no","n","off","0"];function Lt(e,t=""){return{kind:te.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function gi(e){return e.hasOwnProperty("isError")&&e.isError}function Jv(e){return e.hasOwnProperty("tooltip")&&e.tooltip!==""}function ba(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function ks(e=!1){return e?{kind:te.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:te.Loading,allowOverlay:!1}}function Qv(e,t){const n=t?"faded":"normal";return{kind:te.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Ms(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function co(e,t){return Be(e)?t||{}:Be(t)?e||{}:Dc(e,t)}function zd(e){if(Be(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:yt(n)):[yt(t)]}catch{return[yt(e)]}}function e1(e){return e&&e.startsWith("{")&&e.endsWith("}")}function yt(e){try{try{return Xv(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Vd(e){if(Be(e))return null;if(typeof e=="boolean")return e;const t=yt(e).toLowerCase().trim();if(t==="")return null;if(Kv.includes(t))return!0;if(Zv.includes(t))return!1}function io(e){if(Be(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=Yi.unformat(e.trim());if(vt(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function ua(e){if(Be(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return yt(e)}}function t1(e){if(e===0||Math.abs(e)>=1e-4)return 4;const n=e.toExponential().split("e");return Math.abs(parseInt(n[1],10))}function ca(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Be(t)||t===""?vt(n)?(n===0&&(e=Math.round(e)),Yi(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):Yi(e).format({thousandSeparated:!1,mantissa:t1(e),trimMantissa:!0}):t==="plain"?Yi(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?new Intl.NumberFormat().format(e):t==="percent"?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}).format(e):t==="dollar"?new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",maximumFractionDigits:2}).format(e):t==="euro"?new Intl.NumberFormat(void 0,{style:"currency",currency:"EUR",maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):t==="accounting"?Yi(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:2,trimMantissa:!1}):ug.sprintf(t,e)}function Nu(e,t,n="datetime"){return t==="localized"?new Intl.DateTimeFormat(void 0,{dateStyle:n==="time"?void 0:"medium",timeStyle:n==="date"?void 0:"medium"}).format(e.toDate()):t==="distance"?e.fromNow():t==="calendar"?e.calendar():t==="iso8601"?n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString():e.format(t)}function Bo(e){if(Be(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const r=Br.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Br.utc(e);if(n.isValid())return n.toDate();const r=Br.utc(e,[Br.HTML5_FMT.TIME_MS,Br.HTML5_FMT.TIME_SECONDS,Br.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function $d(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function n1(e,t){return t===0?Math.trunc(e):Math.trunc(e*10**t)/10**t}const r1=new RegExp(/(\r\n|\n|\r)/gm);function oo(e){return e.indexOf(`
|
186
|
+
`)!==-1?e.replace(r1," "):e}function i1(e,t){if(Be(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const o1=vi("div",{target:"e20fwh30"})(({theme:e})=>({overflowY:"auto",padding:e.spacing.sm,".react-json-view .copy-icon svg":{fontSize:"0.9em !important",marginRight:`${e.spacing.threeXS} !important`,verticalAlign:"middle !important"}})),Nd=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?Na.parse(e):Na.parse(Na.stringify(e))}catch{n=void 0}return Be(n)?wt(jr,{highlight:!0,autoFocus:!1,disabled:!0,value:ua(e)??"",onChange:()=>{}}):wt(o1,{"data-testid":"stJsonColumnViewer",children:wt(Ch,{src:n,collapsed:2,theme:Sh(t.bgCell)>.5?"rjv-default":"monokai",displayDataTypes:!1,displayObjectSize:!1,name:!1,enableClipboard:!0,style:{fontFamily:t.fontFamily,fontSize:t.baseFontStyle,backgroundColor:t.bgCell,whiteSpace:"pre-wrap"}})})},a1=e=>{const t=e.theme,n=e.value.data;return wt(Nd,{jsonValue:n.value||n.displayValue,theme:t})},s1=e=>{const t=e.theme,n=e.value;return wt(Nd,{jsonValue:n.data,theme:t})},l1={kind:te.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return Ws(e,r??ua(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??ua(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:a1})},u1="line_chart",c1="area_chart",d1="bar_chart";function Ks(e,t,n){const r=co({y_min:0,y_max:1},t.columnTypeOptions),i={kind:te.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[r.y_min,r.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(o){if(Be(r.y_min)||Be(r.y_max)||Number.isNaN(r.y_min)||Number.isNaN(r.y_max)||r.y_min>=r.y_max)return Lt("Invalid min/max y-axis configuration",`The y_min (${r.y_min}) and y_max (${r.y_max}) configuration options must be valid numbers.`);if(Be(o))return ks();const a=zd(o),l=[];let s=[];if(a.length===0)return ks();let u=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER;for(let d=0;d<a.length;d++){const f=io(a[d]);if(Number.isNaN(f)||Be(f))return Lt(yt(a),`The value cannot be interpreted as a numeric array. ${yt(f)} is not a number.`);f>u&&(u=f),f<c&&(c=f),l.push(f)}return l.length>0&&(u>r.y_max||c<r.y_min)?s=l.map(d=>u-c===0?u>(r.y_max||1)?r.y_max||1:r.y_min||0:((r.y_max||1)-(r.y_min||0))*((d-c)/(u-c))+(r.y_min||0)):s=l,{...i,copyData:l.join(","),data:{...i.data,values:s,displayValues:l.map(d=>ca(d))},isMissingValue:Be(o)}},getCellValue(o){var a,l;return o.kind===te.Loading||((a=o.data)==null?void 0:a.values)===void 0?null:(l=o.data)==null?void 0:l.values}}}function Bd(e){return Ks(u1,e,"line")}Bd.isEditableType=!1;function Wd(e){return Ks(d1,e,"bar")}Wd.isEditableType=!1;function Ud(e){return Ks(c1,e,"area")}Ud.isEditableType=!1;function Zs(e){const t={kind:te.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(n){let r=null;return r=Vd(n),r===void 0?Lt(yt(n),"The value cannot be interpreted as boolean."):{...t,data:r,isMissingValue:Be(r)}},getCellValue(n){return n.data===void 0?null:n.data}}}Zs.isEditableType=!0;function Bu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function Js(e,t,n,r,i,o,a){var h,m;const l=co({format:n,step:r,timezone:a},t.columnTypeOptions);let s;if(vt(l.timezone))try{s=((h=Bu(Tl(),l.timezone))==null?void 0:h.utcOffset())||void 0}catch{}let u;vt(l.min_value)&&(u=Bo(l.min_value)||void 0);let c;vt(l.max_value)&&(c=Bo(l.max_value)||void 0);const d={kind:te.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:((m=l.step)==null?void 0:m.toString())||"1",format:i,min:u,max:c}},f=p=>{const v=Bo(p);return v===null?!t.isRequired:!(v===void 0||vt(u)&&o(v)<o(u)||vt(c)&&o(v)>o(c))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(p,v){if(v===!0){const S=f(p);if(S===!1)return Lt(yt(p),"Invalid input.");S instanceof Date&&(p=S)}const w=Bo(p);let b="",M="",O=s;if(w===void 0)return Lt(yt(p),"The value cannot be interpreted as a datetime object.");if(w!==null){let S=Tl.utc(w);if(!S.isValid())return Lt(yt(w),`Invalid moment date. This should never happen. Please report this bug.
|
187
|
+
Error: ${S.toString()}`);if(l.timezone){try{S=Bu(S,l.timezone)}catch(R){return Lt(S.toISOString(),`Failed to adjust to the provided timezone: ${l.timezone}.
|
188
|
+
Error: ${R}`)}O=S.utcOffset()}try{M=Nu(S,l.format||n,e)}catch(R){return Lt(S.toISOString(),`Failed to format the date for rendering with: ${l.format}.
|
189
|
+
Error: ${R}`)}b=Nu(S,n,e)}return{...d,copyData:b,isMissingValue:Be(w),data:{...d.data,date:w,displayDate:M,timezoneOffset:O}}},getCellValue(p){var v;return Be((v=p==null?void 0:p.data)==null?void 0:v.date)?null:o(p.data.date)}}}function Qs(e){var i,o,a;let t="YYYY-MM-DD HH:mm:ss";((i=e.columnTypeOptions)==null?void 0:i.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=xh(e.arrowType),r=vt(n)||vt((a=e==null?void 0:e.columnTypeOptions)==null?void 0:a.timezone);return Js("datetime",e,r?t+"Z":t,1,"datetime-local",l=>r?l.toISOString():l.toISOString().replace("Z",""),n)}Qs.isEditableType=!0;function el(e){var n,r;let t="HH:mm:ss";return((n=e.columnTypeOptions)==null?void 0:n.step)>=60?t="HH:mm":((r=e.columnTypeOptions)==null?void 0:r.step)<1&&(t="HH:mm:ss.SSS"),Js("time",e,t,1,"time",i=>i.toISOString().split("T")[1].replace("Z",""))}el.isEditableType=!0;function tl(e){return Js("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}tl.isEditableType=!0;function qd(e){const t={kind:te.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const r=vt(n)?[yt(n)]:[];return{...t,data:r,isMissingValue:!vt(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}qd.isEditableType=!1;function Yd(e){const t={kind:te.Custom,allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal",copyData:"",data:{kind:"json-cell",value:""}};return{...e,kind:"json",sortMode:"default",isEditable:!1,getCell(n){try{const r=vt(n)?oo(ua(n)):"";return{...t,copyData:r,isMissingValue:Be(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return Lt(yt(n),`The value cannot be interpreted as a JSON string. Error: ${r}`)}},getCellValue(n){var r;return((r=n.data)==null?void 0:r.value)??null}}}Yd.isEditableType=!1;function Xd(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
|
+
Error: ${a}`}let r;if(!Be(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{r=new RegExp(t.display_text,"us")}catch{r=void 0}const i={kind:te.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},o=a=>{if(Be(a))return!e.isRequired;const l=yt(a);return!(t.max_chars&&l.length>t.max_chars||n instanceof RegExp&&n.test(l)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:o,getCell(a,l){if(Be(a))return{...i,data:null,isMissingValue:!0,onClickUri:()=>{}};const s=a;if(typeof n=="string")return Lt(yt(s),n);if(l&&o(s)===!1)return Lt(yt(s),"Invalid input.");let u="";return s&&(r!==void 0?u=i1(r,s):u=t.display_text||s),{...i,data:s,displayData:u,isMissingValue:Be(s),onClickUri:c=>{window.open(s.startsWith("www.")?`https://${s}`:s,"_blank","noopener,noreferrer"),c.preventDefault()},copyData:s}},getCellValue(a){return Be(a.data)?null:a.data}}}Xd.isEditableType=!0;function nl(e){const t={kind:te.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const r=Be(n)?[]:zd(n);return{...t,data:r,isMissingValue:Be(n),copyData:Be(n)?"":yt(r.map(i=>typeof i=="string"&&i.includes(",")?i.replace(/,/g," "):i))}},getCellValue(n){return Be(n.data)||ba(n)?null:n.data}}}nl.isEditableType=!1;function rl(e){const t=co({step:Oc(e.arrowType)?1:void 0,min_value:kh(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Mh(e.arrowType)||Rh(e.arrowType)),r=Be(t.min_value)||t.min_value<0,i=vt(t.step)&&!Number.isNaN(t.step)?$d(t.step):void 0,o={kind:te.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||n?"left":"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:i,thousandSeparator:""},a=l=>{let s=io(l);if(Be(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return vt(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),vt(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",validateInput:a,getCell(l,s){if(s===!0){const d=a(l);if(d===!1)return Lt(yt(l),"Invalid input.");typeof d=="number"&&(l=d)}let u=io(l),c="";if(vt(u)){if(Number.isNaN(u))return Lt(yt(l),"The value cannot be interpreted as a number.");if(vt(i)&&(u=n1(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return Lt(yt(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=vs(u,e.arrowType):c=ca(u,t.format,i)}catch(d){return Lt(yt(u),vt(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:Be(u),copyData:Be(u)?"":yt(u)}},getCellValue(l){return l.data===void 0?null:l.data}}}rl.isEditableType=!0;function ao(e){const t={kind:te.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const r=vt(n)?yt(n):null,i=vt(r)?oo(r):"";return{...t,data:r,displayData:i,isMissingValue:Be(n)}}catch(r){return Lt(yt(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}ao.isEditableType=!1;function jd(e){const t=Oc(e.arrowType),n=co({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let r;try{r=ca(n.max_value,n.format)}catch{r=yt(n.max_value)}const i=Be(n.step)||Number.isNaN(n.step)?void 0:$d(n.step),o={kind:te.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:r,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(a){if(Be(a))return ks();if(Be(n.min_value)||Be(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return Lt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(Be(n.step)||Number.isNaN(n.step))return Lt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const l=io(a);if(Number.isNaN(l)||Be(l))return Lt(yt(a),"The value cannot be interpreted as a number.");if(Number.isInteger(l)&&!Number.isSafeInteger(l))return Lt(yt(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let s="";try{s=ca(l,n.format,i)}catch(c){return Lt(yt(l),vt(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,l));return{...o,isMissingValue:Be(a),copyData:String(l),data:{...o.data,value:u,label:s}}},getCellValue(a){var l,s;return a.kind===te.Loading||((l=a.data)==null?void 0:l.value)===void 0?null:(s=a.data)==null?void 0:s.value}}}jd.isEditableType=!1;function il(e){let t="string";const n=co({options:Pc(e.arrowType)?[!0,!1]:e.arrowType.categoricalOptions??[]},e.columnTypeOptions),r=new Set(n.options.map(o=>typeof o));r.size===1&&(r.has("number")||r.has("bigint")?t="number":r.has("boolean")&&(t="boolean"));const i={kind:te.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=>yt(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,a){let l=null;return vt(o)&&o!==""&&(l=yt(o)),a&&!i.data.allowedValues.includes(l)?Lt(yt(l),"The value is not part of the allowed options."):{...i,isMissingValue:l===null,copyData:l||"",data:{...i.data,value:l}}},getCellValue(o){var a,l,s,u,c;return Be((a=o.data)==null?void 0:a.value)||((l=o.data)==null?void 0:l.value)===""?null:t==="number"?io((s=o.data)==null?void 0:s.value)??null:t==="boolean"?Vd((u=o.data)==null?void 0:u.value)??null:(c=o.data)==null?void 0:c.value}}}il.isEditableType=!0;function ol(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 r={kind:te.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Be(o))return!e.isRequired;let a=yt(o),l=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),l=!0),n instanceof RegExp&&n.test(a)===!1?!1:l?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:i,getCell(o,a){if(typeof n=="string")return Lt(yt(o),n);if(a){const l=i(o);if(l===!1)return Lt(yt(o),"Invalid input.");typeof l=="string"&&(o=l)}try{const l=vt(o)?yt(o):null,s=vt(l)?oo(l):"";return{...r,isMissingValue:Be(l),data:l,displayData:s}}catch(l){return Lt("Incompatible value",`The value cannot be interpreted as string. Error: ${l}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ol.isEditableType=!0;const Wu=vi("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),f1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?wt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:wt(Wu,{src:t})}):wt(Wu,{src:t})},Uu=new Map(Object.entries({object:ao,text:ol,checkbox:Zs,selectbox:il,list:nl,number:rl,link:Xd,datetime:Qs,date:tl,time:el,line_chart:Bd,bar_chart:Wd,area_chart:Ud,image:qd,progress:jd,json:Yd})),h1=[l1];var g1=_c();const m1=vr(g1);var us,qu;function p1(){if(qu)return us;qu=1;var e=Eh(),t=Ih(),n=Th(),r=_c(),i=Dh(),o=Oh(),a=Ph(),l=_h(),s="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function f(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||l(h)||n(h)))return!h.length;var m=t(h);if(m==s||m==u)return!h.size;if(a(h))return!e(h).length;for(var p in h)if(d.call(h,p))return!1;return!0}return us=f,us}var v1=p1();const b1=vr(v1);function Yu(e,t,n){const r=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const i=r.exec(n);if(i)return i[1].trim()}function w1(e,t,n){const r={},i=Yu(t,"color",n);i&&(r.textDark=i);const o=Yu(t,"background-color",n);return o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F"),r?{...e,themeOverride:r}:e}function y1(e){return $h(e)||Nh(e)?ol:Bh(e)?Qs:Lc(e)?el:Wh(e)?tl:Uh(e)||qh(e)?ao:Pc(e)?Zs:Yh(e)?rl:Xh(e)?il:jh(e)?nl:ao}function Gd(e){const t=e.length>0?e[e.length-1]:"",n=e.length>1?e.slice(0,-1).filter(r=>r!=="").join(" / "):void 0;return{title:t,group:n}}function al(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function C1(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=Gd(n),o=e.columnTypes[t];let a=!0;return Vh(o)&&(a=!1),al({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:a,arrowType:o,isIndex:!0,isPinned:!0})}function S1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=Gd(n),o=e.columnTypes[t];return al({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function Kd(){return al({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:Ah.INDEX,arrowField:new Lh("",new Fh,!0),pandasType:void 0}})}function x1(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(Kd()),t;for(let o=0;o<r;o++)t.push(C1(e,o));for(let o=0;o<i;o++)t.push(S1(e,o+r));return t}function k1(e,t,n,r=void 0){var o,a,l,s,u,c;let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(vt(t.content)?oo(vs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&vt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;Lc(e.arrowType)&&vt((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?d=Hh(t.content,t.field):d=Br.utc(Number(t.content)).toDate(),i=e.getCell(d)}else if(zh(e.arrowType)){const d=Be(t.content)?null:vs(t.content,t.contentType);i=e.getCell(d)}else i=e.getCell(t.content);if(gi(i))return i;if(!e.isEditable){if(n&&vt(n==null?void 0:n.displayContent)){const d=oo(n.displayContent);i.kind===te.Text?i={...i,displayData:d}:i.kind===te.Number&&Be((l=e.columnTypeOptions)==null?void 0:l.format)?i={...i,displayData:d}:i.kind===te.Uri&&Be((s=e.columnTypeOptions)==null?void 0:s.display_text)?i={...i,displayData:d}:i.kind===te.Custom&&((u=i.data)==null?void 0:u.kind)==="date-picker-cell"&&Be((c=e.columnTypeOptions)==null?void 0:c.format)&&(i={...i,data:{...i.data,displayDate:d}})}r&&(n!=null&&n.cssId)&&(i=w1(i,n.cssId,r))}return i}const Jo="_index",Xu="_pos:",ju={small:75,medium:200,large:400},Zd=Ls.getLogger("useColumnLoader");function M1(e){if(!Be(e)){if(typeof e=="number")return e;if(e in ju)return ju[e]}}const Wo=(e,t)=>lg(e,t,(r,i)=>{if(m1(i))return i});function R1(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(Jo)&&(n=Wo(n,t.get(Jo)??{})),t.has(`${Xu}${e.indexNumber}`)&&(n=Wo(n,t.get(`${Xu}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==Jo&&(n=Wo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Wo(n,t.get(e.id)??{})),b1(n)?e:Dc({...e},{title:n.label,width:M1(n.width),isEditable:vt(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 E1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return Zd.error(t),new Map}}function I1(e){var r;const t=(r=e.columnTypeOptions)==null?void 0:r.type;let n;return vt(t)&&(Uu.has(t)?n=Uu.get(t):Zd.warn(`Unknown column type configured in column configuration: ${t}`)),Be(n)&&(n=y1(e.arrowType)),n}function T1(e,t,n,r){const i=lo(),o=ae.useMemo(()=>E1(e.columns),[e.columns]),[a,l]=ae.useState(o);ae.useEffect(()=>{l(o)},[o]);const s=e.useContainerWidth||vt(e.width)&&e.width>0,u=vt(e.rowHeight)&&e.rowHeight>Nn("4rem");return{columns:ae.useMemo(()=>{const d=x1(t).map(p=>{let v={...p,...R1(p,a),isStretched:s,isWrappingAllowed:u};const w=I1(v);return(e.editingMode===Un.EditingMode.READ_ONLY||n||w.isEditableType===!1)&&(v={...v,isEditable:!1}),e.editingMode!==Un.EditingMode.READ_ONLY&&v.isEditable==!0&&(v={...v,icon:"editable"},v.isRequired&&e.editingMode===Un.EditingMode.DYNAMIC&&(v={...v,isHidden:!1})),w(v,i)}).filter(p=>!p.isHidden),f=[],h=[];r!=null&&r.length?(d.forEach(p=>{p.isIndex&&!r.includes(p.name)&&!r.includes(p.id)&&p.isPinned!==!1&&f.push(p)}),r.forEach(p=>{const v=d.find(w=>w.name===p||w.id===p);v&&(v.isPinned?f.push(v):h.push(v))})):d.forEach(p=>{p.isPinned?f.push(p):h.push(p)});const m=[...f,...h];return m.length>0?m:[ao(Kd())]},[t,a,u,s,n,e.editingMode,r,i]),setColumnConfigMapping:l}}function eo(e){return e.isIndex?Jo:Be(e.name)?"":e.name}class Uo{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 r={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,l)=>{const s={};o.forEach((u,c,d)=>{const f=n.get(c);f&&(s[eo(f)]=f.getCellValue(u))}),r.edited_rows[a]=s}),this.addedRows.forEach(o=>{const a={};let l=!1;o.forEach((s,u,c)=>{const d=n.get(u);if(d){const f=d.getCellValue(s);d.isRequired&&d.isEditable&&ba(s)&&(l=!0),vt(f)&&(a[eo(d)]=f)}}),l||r.added_rows.push(a)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(a=>{i.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(eo(a),a)}),Object.keys(r.edited_rows).forEach(a=>{const l=Number(a),s=r.edited_rows[a];Object.keys(s).forEach(u=>{var f;const c=s[u],d=o.get(u);if(d){const h=d.getCell(c);h&&(this.editedCells.has(l)||this.editedCells.set(l,new Map),(f=this.editedCells.get(l))==null||f.set(d.indexNumber,h))}})}),r.added_rows.forEach(a=>{const l=new Map;n.forEach(s=>{l.set(s.indexNumber,s.getCell(null))}),Object.keys(a).forEach(s=>{const u=a[s],c=o.get(s);if(c){const d=c.getCell(u);d&&l.set(c.indexNumber,d)}}),this.addedRows.push(l)}),this.deletedRows=r.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const r=this.editedCells.get(n);if(r!==void 0)return r.get(t)}setCell(t,n,r){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,r)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,r)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,r)=>r-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Be(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,r)=>n-r)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let r=0;r<this.deletedRows.length&&!(this.deletedRows[r]>n);r++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}const Rs=({columnId:e,columnConfigMapping:t,updatedProps:n})=>{const r=new Map(t),i=r.get(e),o={...i||{},...n||{}};return(i!=null&&i.type_config||n!=null&&n.type_config)&&(o.type_config={...(i==null?void 0:i.type_config)||{},...(n==null?void 0:n.type_config)||{}}),r.set(e,o),r};function D1(e){return{changeColumnFormat:ae.useCallback((n,r)=>{e(i=>Rs({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function O1(e,t,n,r,i,o){const a=ae.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),l=t||a?0:e.filter(c=>c.isPinned).length,s=ae.useCallback(c=>{o(d=>Rs({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:ae.useCallback(c=>{o(d=>Rs({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:s,freezeColumns:l}}function P1(e,t,n,r,i){return{onColumnMoved:ae.useCallback((a,l)=>{const s=[...e],[u]=s.splice(a,1);s.splice(l,0,u),l<t&&!u.isPinned?n(u.id):l>=t&&u.isPinned&&r(u.id),i(s.map(c=>c.id))},[e,t,n,r,i])}}function _1(e){const[t,n]=g.useState(()=>new Map),r=ae.useCallback((o,a,l,s)=>{o.id&&n(new Map(t).set(o.id,s))},[t]);return{columns:ae.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:r}}function L1(e){var t,n;switch(e.kind){case te.Number:return((t=e.data)==null?void 0:t.toString())??"";case te.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case te.Markdown:case te.RowID:case te.Text:case te.Uri:return e.data??"";case te.Bubble:case te.Image:return e.data.join("");case te.Drilldown:return e.data.map(r=>r.text).join("");case te.Protected:case te.Loading:return"";case te.Custom:return e.copyData}}function Gu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function F1(e,t){return e=Gu(e),t=Gu(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 A1(e,t){return e>t?1:e===t?0:-1}function H1(e){const{sort:t,rows:n,getCellContent:r}=e;let i=t===void 0?void 0:e.columns.findIndex(u=>t.column===u||u.id!==void 0&&t.column.id===u.id);i===-1&&(i=void 0);const o=(t==null?void 0:t.direction)??"asc",a=g.useMemo(()=>{if(i===void 0)return;const u=new Array(n),c=[i,0];for(let f=0;f<n;f++)c[1]=f,u[f]=L1(r(c));let d;return(t==null?void 0:t.mode)==="raw"?d=sr(n).sort((f,h)=>A1(u[f],u[h])):(t==null?void 0:t.mode)==="smart"?d=sr(n).sort((f,h)=>F1(u[f],u[h])):d=sr(n).sort((f,h)=>u[f].localeCompare(u[h])),o==="desc"&&d.reverse(),d},[r,n,t==null?void 0:t.mode,o,i]),l=g.useCallback(u=>a===void 0?u:a[u],[a]),s=g.useCallback(([u,c])=>a===void 0?r([u,c]):(c=a[c],r([u,c])),[r,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:l}:{getOriginalIndex:l,getCellContent:s}}function z1(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 V1(e,t,n){const[r,i]=ae.useState(),{getCellContent:o,getOriginalIndex:a}=H1({columns:t.map(u=>Ms(u)),getCellContent:n,rows:e,sort:r}),l=ae.useMemo(()=>z1(t,r),[t,r]),s=ae.useCallback((u,c,d)=>{const f=l[u];let h;c==="auto"?(h="asc",r&&r.column.id===f.id&&(r.direction==="asc"?h="desc":h=void 0)):h=c,h===void 0||d&&h===(r==null?void 0:r.direction)?i(void 0):i({column:Ms(f),direction:h,mode:f.sortMode})},[r,l]);return{columns:l,sortColumn:s,getOriginalIndex:a,getCellContent:o}}function $1(){return{provideEditor:g.useCallback(t=>{if(t.kind===te.Text&&t.readonly&&e1(t.data))return{editor:s1}},[])}}const N1={kind:te.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:r,rect:i,hoverAmount:o,hoverX:a}=e;let{values:l,yAxis:s,color:u,graphKind:c="area",displayValues:d,hideAxis:f}=t.data;const[h,m]=s;if(l.length===0)return!0;l=l.map(R=>Math.min(1,Math.max(0,(R-h)/(m-h))));const p=r.cellHorizontalPadding,v=p+i.x,w=i.y+3,b=i.height-6,M=i.width-p*2,O=m-h,S=m<=0?w:h>=0?w+b:w+b*(m/O);if(!f&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(v,S),n.lineTo(v+M,S),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,_=(l.length-1)*R,E=(M-_)/l.length;let x=v;for(const L of l){const D=w+b-L*b;n.moveTo(x,S),n.lineTo(x+E,S),n.lineTo(x+E,D),n.lineTo(x,D),x+=E+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{l.length===1&&(l=[l[0],l[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(l.length-1),_=l.map((x,L)=>({x:v+R*L,y:w+b-x*b}));n.moveTo(_[0].x,_[0].y);let E=0;if(_.length>2)for(E=1;E<_.length-2;E++){const x=(_[E].x+_[E+1].x)/2,L=(_[E].y+_[E+1].y)/2;n.quadraticCurveTo(_[E].x,_[E].y,x,L)}if(n.quadraticCurveTo(_[E].x,_[E].y,_[E+1].x,_[E+1].y),n.strokeStyle=u??r.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(i.x+i.width-p,S),n.lineTo(i.x+p,S),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const x=n.createLinearGradient(0,w,0,w+b*1.4);x.addColorStop(0,u??r.accentColor);const[L,D,C]=ia(u??r.accentColor);x.addColorStop(1,`rgba(${L}, ${D}, ${C}, 0)`),n.fillStyle=x,n.fill(),n.globalAlpha=1}if(a!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const x=Math.min(l.length-1,Math.max(0,Math.round((a-p)/R)));n.moveTo(v+x*R,i.y+1),n.lineTo(v+x*R,i.y+i.height),n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.save(),n.font=`8px ${r.fontFamily}`,n.fillStyle=r.textMedium,n.textBaseline="top",n.fillText(d[x],v,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Ku(e,t,n,r,i,o){if(!(r<=0||i<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,r,i);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,i/2,r/2),tr:Math.min(o.tr,i/2,r/2),bl:Math.min(o.bl,i/2,r/2),br:Math.min(o.br,i/2,r/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+r,n,t+r,n+o.tr,o.tr),e.arcTo(t+r,n+i,t+r-o.br,n+i,o.br),e.arcTo(t,n+i,t,n+i-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function Zu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zu(Object(n),!0).forEach(function(r){Xi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var B1=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function W1(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,l=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,h=e.value,m=br(e,B1),p=g.useState(l!==void 0?l:n),v=gr(p,2),w=v[0],b=v[1],M=g.useState(s!==void 0?s:i),O=gr(M,2),S=O[0],R=O[1],_=g.useState(h!==void 0?h:a),E=gr(_,2),x=E[0],L=E[1],D=g.useCallback(function(U,oe){typeof u=="function"&&u(U,oe),L(U)},[u]),C=g.useCallback(function(U,oe){var ee;typeof c=="function"&&(ee=c(U,oe)),b(ee!==void 0?ee:U)},[c]),I=g.useCallback(function(){typeof f=="function"&&f(),R(!0)},[f]),T=g.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),k=l!==void 0?l:w,V=s!==void 0?s:S,N=h!==void 0?h:x;return Ye(Ye({},m),{},{inputValue:k,menuIsOpen:V,onChange:D,onInputChange:C,onMenuClose:T,onMenuOpen:I,value:N})}function U1(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const q1=Math.min,Y1=Math.max,da=Math.round,qo=Math.floor,fa=e=>({x:e,y:e});function X1(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function wa(){return typeof window<"u"}function Jd(e){return ef(e)?(e.nodeName||"").toLowerCase():"#document"}function pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qd(e){var t;return(t=(ef(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ef(e){return wa()?e instanceof Node||e instanceof pr(e).Node:!1}function j1(e){return wa()?e instanceof Element||e instanceof pr(e).Element:!1}function sl(e){return wa()?e instanceof HTMLElement||e instanceof pr(e).HTMLElement:!1}function Ju(e){return!wa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pr(e).ShadowRoot}function tf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ll(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function G1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function K1(e){return["html","body","#document"].includes(Jd(e))}function ll(e){return pr(e).getComputedStyle(e)}function Z1(e){if(Jd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ju(e)&&e.host||Qd(e);return Ju(t)?t.host:t}function nf(e){const t=Z1(e);return K1(t)?e.ownerDocument?e.ownerDocument.body:e.body:sl(t)&&tf(t)?t:nf(t)}function ha(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=nf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=pr(i);if(o){const l=Es(a);return t.concat(a,a.visualViewport||[],tf(i)?i:[],l&&n?ha(l):[])}return t.concat(i,ha(i,[],n))}function Es(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function J1(e){const t=ll(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sl(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,l=da(n)!==o||da(r)!==a;return l&&(n=o,r=a),{width:n,height:r,$:l}}function ul(e){return j1(e)?e:e.contextElement}function Qu(e){const t=ul(e);if(!sl(t))return fa(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=J1(t);let a=(o?da(n.width):n.width)/r,l=(o?da(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Q1=fa(0);function eb(e){const t=pr(e);return!G1()||!t.visualViewport?Q1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tb(e,t,n){return!1}function ec(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=ul(e);let a=fa(1);t&&(a=Qu(e));const l=tb()?eb(o):fa(0);let s=(i.left+l.x)/a.x,u=(i.top+l.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(o){const f=pr(o),h=r;let m=f,p=Es(m);for(;p&&r&&h!==m;){const v=Qu(p),w=p.getBoundingClientRect(),b=ll(p),M=w.left+(p.clientLeft+parseFloat(b.paddingLeft))*v.x,O=w.top+(p.clientTop+parseFloat(b.paddingTop))*v.y;s*=v.x,u*=v.y,c*=v.x,d*=v.y,s+=M,u+=O,m=pr(p),p=Es(m)}}return X1({width:c,height:d,x:s,y:u})}function nb(e,t){let n=null,r;const i=Qd(e);function o(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,s){l===void 0&&(l=!1),s===void 0&&(s=1),o();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(l||t(),!d||!f)return;const h=qo(c),m=qo(i.clientWidth-(u+d)),p=qo(i.clientHeight-(c+f)),v=qo(u),b={rootMargin:-h+"px "+-m+"px "+-p+"px "+-v+"px",threshold:Y1(0,q1(1,s))||1};let M=!0;function O(S){const R=S[0].intersectionRatio;if(R!==s){if(!M)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M=!1}try{n=new IntersectionObserver(O,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,b)}n.observe(e)}return a(!0),o}function rb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=ul(e),c=i||o?[...u?ha(u):[],...ha(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=u&&l?nb(u,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var M;(M=h)==null||M.observe(t)})),n()}),u&&!s&&h.observe(u),h.observe(t));let m,p=s?ec(e):null;s&&v();function v(){const w=ec(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,m=requestAnimationFrame(v)}return n(),()=>{var w;c.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,s&&cancelAnimationFrame(m)}}var Is=g.useLayoutEffect,ib=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ga=function(){};function ob(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function ab(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(ob(e,a)));return o.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var tc=function(t){return mb(t)?t.filter(Boolean):Gh(t)==="object"&&t!==null?[t]:[]},rf=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=br(t,ib);return Ye({},n)},tn=function(t,n,r){var i=t.cx,o=t.getStyles,a=t.getClassNames,l=t.className;return{css:o(n,t),className:i(r??{},a(n,t),l)}};function ya(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function sb(e){return ya(e)?window.innerHeight:e.clientHeight}function of(e){return ya(e)?window.pageYOffset:e.scrollTop}function ma(e,t){if(ya(e)){window.scrollTo(0,t);return}e.scrollTop=t}function lb(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function ub(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function Yo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ga,i=of(e),o=t-i,a=10,l=0;function s(){l+=a;var u=ub(l,i,o,n);ma(e,u),l<n?window.requestAnimationFrame(s):r(e)}s()}function nc(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ma(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ma(e,Math.max(t.offsetTop-i,0))}function cb(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 rc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function db(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var af=!1,fb={get passive(){return af=!0}},Xo=typeof window<"u"?window:{};Xo.addEventListener&&Xo.removeEventListener&&(Xo.addEventListener("p",ga,fb),Xo.removeEventListener("p",ga,!1));var hb=af;function gb(e){return e!=null}function mb(e){return Array.isArray(e)}function jo(e,t,n){return e?t:n}var pb=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(a){var l=gr(a,1),s=l[0];return!r.includes(s)});return o.reduce(function(a,l){var s=gr(l,2),u=s[0],c=s[1];return a[u]=c,a},{})},vb=["children","innerProps"],bb=["children","innerProps"];function wb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,s=lb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),d=c.height,f=n.getBoundingClientRect(),h=f.bottom,m=f.height,p=f.top,v=n.offsetParent.getBoundingClientRect(),w=v.top,b=a?window.innerHeight:sb(s),M=of(s),O=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),R=w-S,_=b-p,E=R+M,x=d-M-p,L=h-b+M+O,D=M+p-S,C=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:t};if(x>=m&&!a)return o&&Yo(s,L,C),{placement:"bottom",maxHeight:t};if(!a&&x>=r||a&&_>=r){o&&Yo(s,L,C);var I=a?_-O:x-O;return{placement:"bottom",maxHeight:I}}if(i==="auto"||a){var T=t,k=a?R:E;return k>=r&&(T=Math.min(k-O-l,t)),{placement:"top",maxHeight:T}}if(i==="bottom")return o&&ma(s,L),{placement:"bottom",maxHeight:t};break;case"top":if(R>=m)return{placement:"top",maxHeight:t};if(E>=m&&!a)return o&&Yo(s,D,C),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&R>=r){var V=t;return(!a&&E>=r||a&&R>=r)&&(V=a?R-S:E-S),o&&Yo(s,D,C),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function yb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var sf=function(t){return t==="auto"?"bottom":t},Cb=function(t,n){var r,i=t.placement,o=t.theme,a=o.borderRadius,l=o.spacing,s=o.colors;return Ye((r={label:"menu"},Xi(r,yb(i),"100%"),Xi(r,"position","absolute"),Xi(r,"width","100%"),Xi(r,"zIndex",1),r),n?{}:{backgroundColor:s.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},lf=g.createContext(null),Sb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,l=t.menuShouldScrollIntoView,s=t.theme,u=g.useContext(lf)||{},c=u.setPortalPlacement,d=g.useRef(null),f=g.useState(i),h=gr(f,2),m=h[0],p=h[1],v=g.useState(null),w=gr(v,2),b=w[0],M=w[1],O=s.spacing.controlHeight;return Is(function(){var S=d.current;if(S){var R=a==="fixed",_=l&&!R,E=wb({maxHeight:i,menuEl:S,minHeight:r,placement:o,shouldScroll:_,isFixedPosition:R,controlHeight:O});p(E.maxHeight),M(E.placement),c==null||c(E.placement)}},[i,o,a,l,r,c,O]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:b||sf(o),maxHeight:m})})},xb=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return Ne("div",tt({},tn(t,"menu",{menu:!0}),{ref:r},i),n)},kb=xb,Mb=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return Ye({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},Rb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return Ne("div",tt({},tn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},uf=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return Ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},Eb=uf,Ib=uf,Tb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=br(t,vb);return Ne("div",tt({},tn(Ye(Ye({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Db=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=br(t,bb);return Ne("div",tt({},tn(Ye(Ye({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},Ob=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},Pb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,a=t.menuPlacement,l=t.menuPosition,s=g.useRef(null),u=g.useRef(null),c=g.useState(sf(a)),d=gr(c,2),f=d[0],h=d[1],m=g.useMemo(function(){return{setPortalPlacement:h}},[]),p=g.useState(null),v=gr(p,2),w=v[0],b=v[1],M=g.useCallback(function(){if(i){var _=cb(i),E=l==="fixed"?0:window.pageYOffset,x=_[f]+E;(x!==(w==null?void 0:w.offset)||_.left!==(w==null?void 0:w.rect.left)||_.width!==(w==null?void 0:w.rect.width))&&b({offset:x,rect:_})}},[i,l,f,w==null?void 0:w.offset,w==null?void 0:w.rect.left,w==null?void 0:w.rect.width]);Is(function(){M()},[M]);var O=g.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&s.current&&(u.current=rb(i,s.current,M,{elementResize:"ResizeObserver"in window}))},[i,M]);Is(function(){O()},[O]);var S=g.useCallback(function(_){s.current=_,O()},[O]);if(!n&&l!=="fixed"||!w)return null;var R=Ne("div",tt({ref:S},tn(Ye(Ye({},t),{},{offset:w.offset,position:l,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Ne(lf.Provider,{value:m},n?Fc.createPortal(R,n):R)},_b=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Lb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return Ne("div",tt({},tn(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Fb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},Ab=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return Ne("div",tt({},tn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},Hb=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zb=function(t){var n=t.children,r=t.innerProps;return Ne("div",tt({},tn(t,"indicatorsContainer",{indicators:!0}),r),n)},ic,Vb=["size"],$b=["innerProps","isRtl","size"],Nb={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},cf=function(t){var n=t.size,r=br(t,Vb);return Ne("svg",tt({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Nb},r))},cl=function(t){return Ne(cf,tt({size:20},t),Ne("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"}))},df=function(t){return Ne(cf,tt({size:20},t),Ne("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"}))},ff=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},Bb=ff,Wb=function(t){var n=t.children,r=t.innerProps;return Ne("div",tt({},tn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Ne(df,null))},Ub=ff,qb=function(t){var n=t.children,r=t.innerProps;return Ne("div",tt({},tn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Ne(cl,null))},Yb=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},Xb=function(t){var n=t.innerProps;return Ne("span",tt({},n,tn(t,"indicatorSeparator",{"indicator-separator":!0})))},jb=Kh(ic||(ic=U1([`
|
192
|
+
0%, 80%, 100% { opacity: 0; }
|
193
|
+
40% { opacity: 1; }
|
194
|
+
`]))),Gb=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},cs=function(t){var n=t.delay,r=t.offset;return Ne("span",{css:Ac({animation:"".concat(jb," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Kb=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=br(t,$b);return Ne("div",tt({},tn(Ye(Ye({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ne(cs,{delay:0,offset:r}),Ne(cs,{delay:160,offset:!0}),Ne(cs,{delay:320,offset:!r}))},Zb=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,s=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:s.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},Jb=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return Ne("div",tt({ref:o},tn(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},Qb=Jb,ew=["data"],tw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},nw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Ne("div",tt({},tn(t,"group",{group:!0}),s),Ne(a,tt({},l,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),Ne("div",null,n))},rw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Ye({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},iw=function(t){var n=rf(t);n.data;var r=br(n,ew);return Ne("div",tt({},tn(t,"groupHeading",{"group-heading":!0}),r))},ow=nw,aw=["innerRef","isDisabled","isHidden","inputClassName"],sw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return Ye(Ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},lw),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},hf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},lw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},hf)},uw=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},hf)},cw=function(t){var n=t.cx,r=t.value,i=rf(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,s=i.inputClassName,u=br(i,aw);return Ne("div",tt({},tn(t,"input",{"input-container":!0}),{"data-value":r||""}),Ne("input",tt({className:n({input:!0},s),ref:o,style:uw(l),disabled:a},u)))},dw=cw,fw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},hw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},gw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},gf=function(t){var n=t.children,r=t.innerProps;return Ne("div",r,n)},mw=gf,pw=gf;function vw(e){var t=e.children,n=e.innerProps;return Ne("div",tt({role:"button"},n),t||Ne(cl,{size:14}))}var bw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return Ne(u,{data:i,innerProps:Ye(Ye({},tn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:s},Ne(c,{data:i,innerProps:Ye({},tn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),Ne(d,{data:i,innerProps:Ye(Ye({},tn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:s}))},ww=bw,yw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,s=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?s.primary:i?s.primary25:"transparent",color:r?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Cw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return Ne("div",tt({},tn(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},Sw=Cw,xw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},kw=function(t){var n=t.children,r=t.innerProps;return Ne("div",tt({},tn(t,"placeholder",{placeholder:!0}),r),n)},Mw=kw,Rw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Ew=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return Ne("div",tt({},tn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Iw=Ew,mf={ClearIndicator:qb,Control:Qb,DropdownIndicator:Wb,DownChevron:df,CrossIcon:cl,Group:ow,GroupHeading:iw,IndicatorsContainer:zb,IndicatorSeparator:Xb,Input:dw,LoadingIndicator:Kb,Menu:kb,MenuList:Rb,MenuPortal:Pb,LoadingMessage:Db,NoOptionsMessage:Tb,MultiValue:ww,MultiValueContainer:mw,MultiValueLabel:pw,MultiValueRemove:vw,Option:Sw,Placeholder:Mw,SelectContainer:Lb,SingleValue:Iw,ValueContainer:Ab},Tw=function(t){return Ye(Ye({},mf),t.components)},oc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Dw(e,t){return!!(e===t||oc(e)&&oc(t))}function Ow(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Dw(e[n],t[n]))return!1;return!0}function Pw(e,t){t===void 0&&(t=Ow);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}var _w={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"},Lw=function(t){return Ne("span",tt({css:_w},t))},ac=Lw,Fw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=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(i?", 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(r?" 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,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", 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(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,v){return p&&p.length?"".concat(p.indexOf(v)+1," of ").concat(p.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&c){var f=s?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(a).concat(h,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Aw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,f=s.getOptionLabel,h=s.inputValue,m=s.isMulti,p=s.isOptionDisabled,v=s.isSearchable,w=s.menuIsOpen,b=s.options,M=s.screenReaderStatus,O=s.tabSelectsValue,S=s.isLoading,R=s["aria-label"],_=s["aria-live"],E=g.useMemo(function(){return Ye(Ye({},Fw),d||{})},[d]),x=g.useMemo(function(){var k="";if(n&&E.onChange){var V=n.option,N=n.options,U=n.removedValue,oe=n.removedValues,ee=n.value,j=function(P){return Array.isArray(P)?null:P},ne=U||V||j(ee),ie=ne?f(ne):"",ue=N||oe||void 0,he=ue?ue.map(f):[],J=Ye({isDisabled:ne&&p(ne,l),label:ie,labels:he},n);k=E.onChange(J)}return k},[n,E,p,l,f]),L=g.useMemo(function(){var k="",V=r||i,N=!!(r&&l&&l.includes(r));if(V&&E.onFocus){var U={focused:V,label:f(V),isDisabled:p(V,l),isSelected:N,options:o,context:V===r?"menu":"value",selectValue:l,isAppleDevice:c};k=E.onFocus(U)}return k},[r,i,f,p,E,o,l,c]),D=g.useMemo(function(){var k="";if(w&&b.length&&!S&&E.onFilter){var V=M({count:o.length});k=E.onFilter({inputValue:h,resultsMessage:V})}return k},[o,h,w,E,b,M,S]),C=(n==null?void 0:n.action)==="initial-input-focus",I=g.useMemo(function(){var k="";if(E.guidance){var V=i?"value":w?"menu":"input";k=E.guidance({"aria-label":R,context:V,isDisabled:r&&p(r,l),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:C})}return k},[R,r,i,m,p,v,w,E,l,O,C]),T=Ne(g.Fragment,null,Ne("span",{id:"aria-selection"},x),Ne("span",{id:"aria-focused"},L),Ne("span",{id:"aria-results"},D),Ne("span",{id:"aria-guidance"},I));return Ne(g.Fragment,null,Ne(ac,{id:u},C&&T),Ne(ac,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!C&&T))},Hw=Aw,Ts=[{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źẑżžẓẕƶȥɀⱬꝣ"}],zw=new RegExp("["+Ts.map(function(e){return e.letters}).join("")+"]","g"),pf={};for(var ds=0;ds<Ts.length;ds++)for(var fs=Ts[ds],hs=0;hs<fs.letters.length;hs++)pf[fs.letters[hs]]=fs.base;var vf=function(t){return t.replace(zw,function(n){return pf[n]})},Vw=Pw(vf),sc=function(t){return t.replace(/^\s+|\s+$/g,"")},$w=function(t){return"".concat(t.label," ").concat(t.value)},Nw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:$w,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,s=i.trim,u=i.matchFrom,c=s?sc(r):r,d=s?sc(l(n)):l(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=Vw(c),d=vf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},Bw=["innerRef"];function Ww(e){var t=e.innerRef,n=br(e,Bw),r=pb(n,"onExited","in","enter","exit","appear");return Ne("input",tt({ref:t},r,{css:Ac({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 Uw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function qw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=g.useRef(!1),l=g.useRef(!1),s=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(v,w){if(u.current!==null){var b=u.current,M=b.scrollTop,O=b.scrollHeight,S=b.clientHeight,R=u.current,_=w>0,E=O-S-M,x=!1;E>w&&a.current&&(r&&r(v),a.current=!1),_&&l.current&&(o&&o(v),l.current=!1),_&&w>E?(n&&!a.current&&n(v),R.scrollTop=O,x=!0,a.current=!0):!_&&-w>M&&(i&&!l.current&&i(v),R.scrollTop=0,x=!0,l.current=!0),x&&Uw(v)}},[n,r,i,o]),d=g.useCallback(function(v){c(v,v.deltaY)},[c]),f=g.useCallback(function(v){s.current=v.changedTouches[0].clientY},[]),h=g.useCallback(function(v){var w=s.current-v.changedTouches[0].clientY;c(v,w)},[c]),m=g.useCallback(function(v){if(v){var w=hb?{passive:!1}:!1;v.addEventListener("wheel",d,w),v.addEventListener("touchstart",f,w),v.addEventListener("touchmove",h,w)}},[h,f,d]),p=g.useCallback(function(v){v&&(v.removeEventListener("wheel",d,!1),v.removeEventListener("touchstart",f,!1),v.removeEventListener("touchmove",h,!1))},[h,f,d]);return g.useEffect(function(){if(t){var v=u.current;return m(v),function(){p(v)}}},[t,m,p]),function(v){u.current=v}}var lc=["boxSizing","height","overflow","paddingRight","position"],uc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function cc(e){e.preventDefault()}function dc(e){e.stopPropagation()}function fc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function hc(){return"ontouchstart"in window||navigator.maxTouchPoints}var gc=!!(typeof window<"u"&&window.document&&window.document.createElement),qi=0,li={capture:!1,passive:!1};function Yw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=g.useRef({}),o=g.useRef(null),a=g.useCallback(function(s){if(gc){var u=document.body,c=u&&u.style;if(r&&lc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&qi<1){var d=parseInt(i.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(uc).forEach(function(m){var p=uc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&hc()&&(u.addEventListener("touchmove",cc,li),s&&(s.addEventListener("touchstart",fc,li),s.addEventListener("touchmove",dc,li))),qi+=1}},[r]),l=g.useCallback(function(s){if(gc){var u=document.body,c=u&&u.style;qi=Math.max(qi-1,0),r&&qi<1&&lc.forEach(function(d){var f=i.current[d];c&&(c[d]=f)}),u&&hc()&&(u.removeEventListener("touchmove",cc,li),s&&(s.removeEventListener("touchstart",fc,li),s.removeEventListener("touchmove",dc,li)))}},[r]);return g.useEffect(function(){if(t){var s=o.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){o.current=s}}var Xw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},jw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Gw(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,u=qw({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),c=Yw({isEnabled:n}),d=function(h){u(h),c(h)};return Ne(g.Fragment,null,n&&Ne("div",{onClick:Xw,css:jw}),t(d))}var Kw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Zw=function(t){var n=t.name,r=t.onFocus;return Ne("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:Kw,value:"",onChange:function(){}})},Jw=Zw;function dl(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 Qw(){return dl(/^iPhone/i)}function bf(){return dl(/^Mac/i)}function ey(){return dl(/^iPad/i)||bf()&&navigator.maxTouchPoints>1}function ty(){return Qw()||ey()}function ny(){return bf()||ty()}var ry=function(t){return t.label},iy=function(t){return t.label},oy=function(t){return t.value},ay=function(t){return!!t.isDisabled},sy={clearIndicator:Ub,container:_b,control:Zb,dropdownIndicator:Bb,group:tw,groupHeading:rw,indicatorsContainer:Hb,indicatorSeparator:Yb,input:sw,loadingIndicator:Gb,loadingMessage:Ib,menu:Cb,menuList:Mb,menuPortal:Ob,multiValue:fw,multiValueLabel:hw,multiValueRemove:gw,noOptionsMessage:Eb,option:yw,placeholder:xw,singleValue:Rw,valueContainer:Fb},ly={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%)"},uy=4,wf=4,cy=38,dy=wf*2,fy={baseUnit:wf,controlHeight:cy,menuGutter:dy},gs={borderRadius:uy,colors:ly,spacing:fy},hy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rc(),captureMenuScroll:!rc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Nw(),formatGroupLabel:ry,getOptionLabel:iy,getOptionValue:oy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ay,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!db(),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 mc(e,t,n,r){var i=Sf(e,t,n),o=xf(e,t,n),a=Cf(e,t),l=pa(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function Qo(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return mc(e,a,t,l)}).filter(function(a){return vc(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=mc(e,n,t,r);return vc(e,o)?o:void 0}).filter(gb)}function yf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Fs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function pc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Fs(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function gy(e,t){return yf(Qo(e,t))}function vc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!Mf(e)||!o)&&kf(e,{label:a,value:l,data:i},r)}function my(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function py(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ms=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},Cf=function(t,n){return t.getOptionLabel(n)},pa=function(t,n){return t.getOptionValue(n)};function Sf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function xf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=pa(e,t);return n.some(function(i){return pa(e,i)===r})}function kf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Mf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},vy=1,Rf=function(e){fg(n,e);var t=mg(n);function n(r){var i;if(gg(this,n),i=t.call(this,r),i.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:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=ny(),i.controlRef=null,i.getControlRef=function(s){i.controlRef=s},i.focusedOptionRef=null,i.getFocusedOptionRef=function(s){i.focusedOptionRef=s},i.menuListRef=null,i.getMenuListRef=function(s){i.menuListRef=s},i.inputRef=null,i.getInputRef=function(s){i.inputRef=s},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(s,u){var c=i.props,d=c.onChange,f=c.name;u.name=f,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(s,{action:u,option:c})},i.selectOption=function(s){var u=i.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(s,h),p=i.isOptionDisabled(s,h);if(m){var v=i.getOptionValue(s);i.setValue(h.filter(function(w){return i.getOptionValue(w)!==v}),"deselect-option",s)}else if(!p)d?i.setValue([].concat(Fs(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:f});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),f=c.filter(function(m){return i.getOptionValue(m)!==d}),h=jo(u,f,f[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(jo(i.props.isMulti,[],null),{action:"clear",removedValues:s})},i.popValue=function(){var s=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=jo(s,d,d[0]||null);c&&i.onChange(f,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return ms(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return pc(Qo(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];return ab.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return Cf(i.props,s)},i.getOptionValue=function(s){return pa(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=sy[s](u,c);d.boxSizing="border-box";var f=i.props.styles[s];return f?f(d,u):d},i.getClassNames=function(s,u){var c,d;return(c=(d=i.props.classNames)[s])===null||c===void 0?void 0:c.call(d,u)},i.getElementId=function(s){return"".concat(i.state.instancePrefix,"-").concat(s)},i.getComponents=function(){return Tw(i.props)},i.buildCategorizedOptions=function(){return Qo(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return yf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(s,u){i.setState({ariaSelection:Ye({value:s},u)})},i.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(s){i.blockOptionHover=!1},i.onControlMouseDown=function(s){if(!s.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},i.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),s.preventDefault()}},i.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(i.clearValue(),s.preventDefault(),i.openAfterFocus=!1,s.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(s){typeof i.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&ya(s.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(s)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(s){var u=s.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(s){var u=s.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-i.initialTouchX),f=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||f>h}},i.onTouchEnd=function(s){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(s.target)&&i.menuListRef&&!i.menuListRef.contains(s.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(s){i.userIsDragging||i.onControlMouseDown(s)},i.onClearIndicatorTouchEnd=function(s){i.userIsDragging||i.onClearIndicatorMouseDown(s)},i.onDropdownIndicatorTouchEnd=function(s){i.userIsDragging||i.onDropdownIndicatorMouseDown(s)},i.handleInputChange=function(s){var u=i.props.inputValue,c=s.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(s){i.props.onFocus&&i.props.onFocus(s),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(s){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(s),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(s){if(!(i.blockOptionHover||i.state.focusedOption===s)){var u=i.getFocusableOptions(),c=u.indexOf(s);i.setState({focusedOption:s,focusedOptionId:c>-1?i.getFocusedOptionId(s):null})}},i.shouldHideSelectedOptions=function(){return Mf(i.props)},i.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),i.focus()},i.onKeyDown=function(s){var u=i.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,v=u.menuIsOpen,w=u.onKeyDown,b=u.tabSelectsValue,M=u.openMenuOnFocus,O=i.state,S=O.focusedOption,R=O.focusedValue,_=O.selectValue;if(!p&&!(typeof w=="function"&&(w(s),s.defaultPrevented))){switch(i.blockOptionHover=!0,s.key){case"ArrowLeft":if(!c||h)return;i.focusValue("previous");break;case"ArrowRight":if(!c||h)return;i.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(R)i.removeValue(R);else{if(!d)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||s.shiftKey||!v||!b||!S||M&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(s.keyCode===229)break;if(v){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&f&&i.clearValue();break;case" ":if(h)return;if(!v){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":v?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":v?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!v)return;i.focusOption("pageup");break;case"PageDown":if(!v)return;i.focusOption("pagedown");break;case"Home":if(!v)return;i.focusOption("first");break;case"End":if(!v)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++vy),i.state.selectValue=tc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=ms(o,a[l])}return i}return hg(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&&nc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,s=this.state.isFocused;(s&&!a&&i.isDisabled||s&&l&&!i.menuIsOpen)&&this.focusInput(),s&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(nc(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(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,s=a.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(s&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=a.indexOf(l);l||(s=-1);var u=a.length-1,c=-1;if(a.length){switch(i){case"previous":s===0?c=0:s===-1?c=u:c=s-1;break;case"next":s>-1&&s<u&&(c=s+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var s=0,u=l.indexOf(a);a||(u=-1),i==="up"?s=u>0?u-1:l.length-1:i==="down"?s=(u+1)%l.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>l.length-1&&(s=l.length-1)):i==="last"&&(s=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(gs):Ye(Ye({},gs),this.props.theme):gs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:s,hasValue:p,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return Sf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return xf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return kf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{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 i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,f=i.required,h=this.getComponents(),m=h.Input,p=this.state,v=p.inputIsHidden,w=p.ariaSelection,b=this.commonProps,M=l||this.getElementId("input"),O=Ye(Ye(Ye({"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()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?g.createElement(m,tt({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:M,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},O)):g.createElement(Ww,tt({id:M,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ga,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,v=h.isMulti,w=h.inputValue,b=h.placeholder,M=this.state,O=M.selectValue,S=M.focusedValue,R=M.isFocused;if(!this.hasValue()||!m)return w?null:g.createElement(d,tt({},f,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),b);if(v)return O.map(function(E,x){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return g.createElement(a,tt({},f,{components:{Container:l,Label:s,Remove:u},isFocused:L,isDisabled:p,key:D,index:x,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(w)return null;var _=O[0];return g.createElement(c,tt({},f,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||s||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,s=l.isDisabled,u=l.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return g.createElement(a,tt({},l,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,tt({},a,{innerProps:u,isDisabled:l,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,v=this.props,w=v.captureMenuScroll,b=v.inputValue,M=v.isLoading,O=v.loadingMessage,S=v.minMenuHeight,R=v.maxMenuHeight,_=v.menuIsOpen,E=v.menuPlacement,x=v.menuPosition,L=v.menuPortalTarget,D=v.menuShouldBlockScroll,C=v.menuShouldScrollIntoView,I=v.noOptionsMessage,T=v.onMenuScrollToTop,k=v.onMenuScrollToBottom;if(!_)return null;var V=function(ie,ue){var he=ie.type,J=ie.data,H=ie.isDisabled,P=ie.isSelected,q=ie.label,fe=ie.value,ge=p===J,Ve=H?void 0:function(){return i.onOptionHover(J)},pe=H?void 0:function(){return i.selectOption(J)},je="".concat(i.getElementId("option"),"-").concat(ue),Me={id:je,onClick:pe,onMouseMove:Ve,onMouseOver:Ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return g.createElement(h,tt({},m,{innerProps:Me,data:J,isDisabled:H,isSelected:P,key:je,label:q,type:he,value:fe,isFocused:ge,innerRef:ge?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ie.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(ne){if(ne.type==="group"){var ie=ne.data,ue=ne.options,he=ne.index,J="".concat(i.getElementId("group"),"-").concat(he),H="".concat(J,"-heading");return g.createElement(a,tt({},m,{key:J,data:ie,options:ue,Heading:l,headingProps:{id:H,data:ne.data},label:i.formatGroupLabel(ne.data)}),ne.options.map(function(P){return V(P,"".concat(he,"-").concat(P.index))}))}else if(ne.type==="option")return V(ne,"".concat(ne.index))});else if(M){var U=O({inputValue:b});if(U===null)return null;N=g.createElement(d,m,U)}else{var oe=I({inputValue:b});if(oe===null)return null;N=g.createElement(f,m,oe)}var ee={minMenuHeight:S,maxMenuHeight:R,menuPlacement:E,menuPosition:x,menuShouldScrollIntoView:C},j=g.createElement(Sb,tt({},m,ee),function(ne){var ie=ne.ref,ue=ne.placerProps,he=ue.placement,J=ue.maxHeight;return g.createElement(s,tt({},m,ee,{innerRef:ie,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:M,placement:he}),g.createElement(Gw,{captureEnabled:w,onTopArrive:T,onBottomArrive:k,lockEnabled:D},function(H){return g.createElement(u,tt({},m,{innerRef:function(q){i.getMenuListRef(q),H(q)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:M,maxHeight:J,focusedOption:p}),N)}))});return L||x==="fixed"?g.createElement(c,tt({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:x}),j):j}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!l)return g.createElement(Jw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(s)if(a){var f=d.map(function(p){return i.getOptionValue(p)}).join(a);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,v){return g.createElement("input",{key:"i-".concat(v),name:u,type:"hidden",value:i.getOptionValue(p)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return g.createElement(Hw,tt({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return g.createElement(l,tt({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(o,tt({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),g.createElement(s,tt({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(a,tt({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,v=i.inputValue,w=i.isMulti,b=tc(m),M={};if(a&&(m!==a.value||h!==a.options||p!==a.menuIsOpen||v!==a.inputValue)){var O=p?gy(i,b):[],S=p?pc(Qo(i,b),"".concat(f,"-option")):[],R=l?my(o,b):null,_=py(o,O),E=ms(S,_);M={selectValue:b,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:R,clearFocusValueOnUpdate:!1}}var x=s!=null&&i!==a?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&d;return c&&!D&&(L={value:jo(w,b,b[0]||null),options:b,action:"initial-input-focus"},D=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Ye(Ye(Ye({},M),x),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(g.Component);Rf.defaultProps=hy;var by=g.forwardRef(function(e,t){var n=W1(e);return g.createElement(Rf,tt({ref:t},n))}),wy=by;const yy=e=>{const{Menu:t}=mf,{children:n,...r}=e;return g.createElement(t,{...r},n)},Cy=pn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Sy=pn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),xy=pn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),ky=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[a,l]=g.useState(o),[s,u]=g.useState(r??""),c=Nm(),d=g.useMemo(()=>i.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[i]);return t.readonly?g.createElement(xy,null,g.createElement(jr,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):g.createElement(Cy,null,g.createElement(wy,{className:"glide-select",inputValue:s,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:h})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"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=>g.createElement(Sy,null,g.createElement(yy,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(l(f.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:f.value}}))}}))},My={kind:te.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),l=typeof a=="string"?a:(a==null?void 0:a.label)??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,i.x+r.cellHorizontalPadding,i.y+i.height/2+cr(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:ky,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Nr=6,Ry={marginRight:8},Ey={display:"flex",alignItems:"center",flexGrow:1},Iy={kind:te.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:a,value:l,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,f=a-o,h=(l-o)/f;n.save();let m=0;s!==void 0&&(n.font=`12px ${r.fontFamily}`,m=Kr(u??s,n,`12px ${r.fontFamily}`).width+r.cellHorizontalPadding);const p=i.width-r.cellHorizontalPadding*2-m;if(p>=Nr){const v=n.createLinearGradient(c,d,c+p,d);v.addColorStop(0,r.accentColor),v.addColorStop(h,r.accentColor),v.addColorStop(h,r.bgBubble),v.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=v,Ku(n,c,d-Nr/2,p,Nr,Nr/2),n.fill(),n.beginPath(),Ku(n,c+.5,d-Nr/2+.5,p-1,Nr-1,(Nr-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,i.x+i.width-r.cellHorizontalPadding,d+cr(n,`12px ${r.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return g.createElement("label",{style:Ey},g.createElement("input",{style:Ry,type:"range",value:r,min:i,max:o,step:a,onChange:l,disabled:n}),r)},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}}},Ty=pn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ps=(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}`)}},Dy=e=>{const t=e.value.data,{format:n,displayDate:r}=t,i=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ps(n,t.min):t.min,a=t.max instanceof Date?ps(n,t.max):t.max;let l=t.date;const s=t.timezoneOffset?t.timezoneOffset*60*1e3:0;s&&l&&(l=new Date(l.getTime()+s));const u=ps(n,l);return e.value.readonly?ae.createElement(jr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):ae.createElement(Ty,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:i,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-s)}})}})},Oy={kind:te.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Ws(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Dy}),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)}}},Py="None";function bc(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 _y=e=>{const{cell:t,theme:n,ctx:r}=e;Ws({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Py,t.contentAlign),r.fillStyle=n.textDark};function Ly(e){const t=ae.useCallback((r,i)=>{const{cell:o,theme:a,ctx:l,rect:s}=r,u=r.col;if(gi(o))bc(l,s,a);else if(ba(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():_y(r),c.isRequired&&c.isEditable&&bc(l,s,a);return}i()},[e]),n=ae.useMemo(()=>[N1,My,Iy,Oy,...h1],[]);return{drawCell:t,customRenderers:n}}function Fy(){const e=lo();return ae.useMemo(()=>{const n={editable:i=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${i.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:Ba(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:Ba(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:`${Nn(e.fontSizes.sm)}px`,baseFontStyle:`${Nn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:Ba(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Nn(e.spacing.sm)),cellVerticalPadding:Math.round(Nn("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(Nn("25rem")),minColumnWidth:Math.round(Nn("3.125rem")),maxColumnWidth:Math.round(Nn("62.5rem")),maxColumnAutoWidth:Math.round(Nn("31.25rem")),defaultRowHeight:Math.round(Nn("2.1875rem")),defaultHeaderHeight:Math.round(Nn("2.1875rem")),bgRowHovered:Zh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Ay=Ls.getLogger("useDataEditor");function Hy(e,t,n,r,i,o,a,l,s){const u=ae.useCallback(([p,v],w)=>{const b=e[p];if(!b.isEditable)return;const M=b.indexNumber,O=n.current.getOriginalRowIndex(i(v)),S=r([p,v]),R=b.getCellValue(S),_=b.getCellValue(w);if(!gi(S)&&_===R)return;const E=b.getCell(_,!0);gi(E)?Ay.warn(`Not applying the cell edit since it causes this error:
|
195
|
+
${E.data}`):(n.current.setCell(M,O,{...E,lastUpdated:performance.now()}),l())},[e,n,i,r,l]),c=ae.useCallback(()=>{if(t)return;const p=new Map;e.forEach(v=>{p.set(v.indexNumber,v.getCell(v.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=ae.useCallback(()=>{t||(c(),l())},[c,l,t]),f=ae.useCallback(p=>{var v;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),a(),s(),l(),!1}if((v=p.current)!=null&&v.range){const w=[],b=p.current.range;for(let M=b.y;M<b.y+b.height;M++)for(let O=b.x;O<b.x+b.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(w.push({cell:[O,M]}),u([O,M],S.getCell(null)))}return w.length>0&&(l(),o(w)),!1}return!0},[e,n,t,o,i,l,u,s,a]),h=ae.useCallback((p,v)=>{const[w,b]=p,M=[];for(let O=0;O<v.length;O++){const S=v[O];if(O+b>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<S.length;R++){const _=S[R],E=O+b,x=R+w;if(x>=e.length)break;const L=e[x];if(L.isEditable){const D=L.getCell(_,!0);if(vt(D)&&!gi(D)){const C=L.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=L.getCellValue(r([x,E]));L.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),M.push({cell:[x,E]}))}}}M.length>0&&(l(),o(M))}return!1},[e,n,t,i,r,c,l,o]),m=ae.useCallback((p,v)=>{const w=p[0];if(w>=e.length)return!0;const b=e[w];if(b.validateInput){const M=b.validateInput(b.getCellValue(v));return M===!0||M===!1?M:b.getCell(M)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:f,validateCell:m}}const Ef=",",Gi='"',zy='"',If=`
|
196
|
+
`,Vy="\uFEFF",$y=new RegExp(`[${[Ef,Gi,If].join("")}]`),wc=Ls.getLogger("useDataExporter");function yc(e){return e.map(t=>Ny(t)).join(Ef)+If}function Ny(e){if(Be(e))return"";const t=yt(e);return $y.test(t)?`${Gi}${t.replace(new RegExp(Gi,"g"),zy+Gi)}${Gi}`:t}async function Cc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Vy));const o=n.map(a=>a.name);await e.write(i.encode(yc(o)));for(let a=0;a<r;a++){const l=[];n.forEach((s,u,c)=>{l.push(s.getCellValue(t([u,a])))}),await e.write(i.encode(yc(l)))}await e.close()}function By(e,t,n,r){return{exportToCsv:ae.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Ds(()=>import("./es6.Cbt8Qb0v.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 Cc(u,e,t,n)}catch(l){if(l instanceof Error&&l.name==="AbortError")return;try{wc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",l);let s="";const u=new WritableStream({write:async h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Cc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=cg({enforceDownloadInNewTab:r,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(s){wc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function Wy(e,t,n,r){return{getCellContent:ae.useCallback(([o,a])=>{var d;if(o>t.length-1)return Lt("Column index out of bounds","This error should never happen. Please report this bug.");if(a>n-1)return Lt("Row index out of bounds","This error should never happen. Please report this bug.");const l=t[o],s=l.indexNumber,u=r.current.getOriginalRowIndex(a),c=r.current.isAddedRow(u);if(l.isEditable||c){const f=r.current.getCell(s,u);if(vt(f))return{...l.getCell(l.getCellValue(f),!1),lastUpdated:f.lastUpdated};if(c)return Lt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${s}; row=${u}`)}try{const f=e.getCell(u,s),h=Jh(e,u,s);return k1(l,f,h,(d=e.styler)==null?void 0:d.cssStyles)}catch(f){return Lt("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
+
Error: ${f}`)}},[t,n,e,r])}}function Uy(e){const[t,n]=ae.useState(void 0),r=ae.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:ae.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function qy(e,t,n,r,i){const[o,a]=ae.useState({columns:mt.empty(),rows:mt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,h=o.current!==void 0,m=ae.useCallback(v=>{const w=!Wa(v.rows.toArray(),o.rows.toArray()),b=!Wa(v.columns.toArray(),o.columns.toArray()),M=!Wa(v.current,o.current);let O=l&&w||u&&b,S=v;if((l||u)&&v.current!==void 0&&M&&(S={...v,rows:o.rows,columns:o.columns},O=!1),w&&v.rows.length>0&&b&&v.columns.length===0&&(S={...S,columns:o.columns},O=!0),b&&v.columns.length>0&&w&&v.rows.length===0&&(S={...S,rows:o.rows},O=!0),b&&S.columns.length>=0){let R=S.columns;r.forEach((_,E)=>{_.isIndex&&(R=R.remove(E))}),R.length<S.columns.length&&(S={...S,columns:R})}a(S),O&&i(S)},[o,l,u,i,r]),p=ae.useCallback((v=!1,w=!1)=>{const b={columns:w?o.columns:mt.empty(),rows:v?o.rows:mt.empty(),current:void 0};a(b),(!v&&l||!w&&u)&&i(b)},[o,l,u,i]);return{gridSelection:o,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Yy(e,t,n,r,i,o,a){const l=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+l+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Un.EditingMode.DYNAMIC?1:0,d=n+c;let f=Math.max(d*l+u*t.defaultHeaderHeight+2*t.tableBorderWidth,s),h=Math.min(f,t.defaultTableHeight);e.height&&(h=Math.max(e.height,s),f=Math.max(e.height,f)),o&&(h=Math.min(h,o),f=Math.min(f,o),e.height||(h=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let v,w=p;e.useContainerWidth?v=p:e.width&&(v=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[b,M]=ae.useState({width:v||"100%",height:h});return ae.useLayoutEffect(()=>{e.useContainerWidth&&b.width==="100%"&&M(O=>({...O,width:p}))},[p]),ae.useLayoutEffect(()=>{M(O=>({...O,width:v||"100%"}))},[v]),ae.useLayoutEffect(()=>{M(O=>({...O,height:h}))},[h,n]),ae.useLayoutEffect(()=>{if(a){const O=e.useContainerWidth||vt(e.width)&&e.width>0;M({width:O?w:"100%",height:f})}else M({width:v||"100%",height:h})},[a]),{minHeight:s,maxHeight:f,minWidth:m,maxWidth:w,rowHeight:l,resizableSize:b,setResizableSize:M}}const Xy=600,jy="⚠️ Please fill out this cell.";function Gy(e,t,n=[]){const[r,i]=ae.useState(),o=ae.useRef(null),a=ae.useCallback(s=>{if(clearTimeout(o.current),o.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const u=s.location[0],c=s.location[1];let d;if(u<0||u>=e.length||n.includes(c))return;const f=e[u];if(s.kind==="header"&&vt(f))d=f.help;else if(s.kind==="cell"){const h=t([u,c]);gi(h)?d=h.errorDetails:f.isRequired&&f.isEditable&&ba(h)?d=jy:Jv(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},Xy))}},[e,t,i,o,n]),l=ae.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:l,onItemHovered:a}}function Ky({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=ae.useState(!0),a=lo(),{colors:l,fontSizes:s,radii:u,fontWeights:c}=a,d=ae.useCallback(()=>{o(!1),r()},[r,o]);return wt(_s,{content:wt(Qh,{"data-testid":"stDataFrameTooltipContent",children:wt(eg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:Os.top,accessibilityType:Tc.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:Ps(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:wt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const Sc=150,Zy=15e4,xc=6;function Jy({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:a,expand:l,collapse:s,width:u,height:c}=og(ag),d=ae.useRef(null),f=ae.useRef(null),h=ae.useRef(null),m=Fy(),{getRowThemeOverride:p,onItemHovered:v}=Uy(m),{libConfig:{enforceDownloadInNewTab:w=!1}}=ae.useContext(tg),[b,M]=ae.useState(!0),[O,S]=ae.useState(!1),[R,_]=ae.useState(!1),[E,x]=ae.useState(!1),[L,D]=ae.useState(),C=ae.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),I=ae.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Be(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:T,DYNAMIC:k}=Un.EditingMode,V=t.dimensions,N=Math.max(0,V.numDataRows),U=N===0&&!(e.editingMode===k&&V.numDataColumns>0),oe=N>Zy,ee=!oe&&!U&&e.editingMode!==k,j=!U&&e.editingMode===k&&!n,ne=ae.useRef(new Uo(N)),[ie,ue]=ae.useState(ne.current.getNumRows());ae.useEffect(()=>{ne.current=new Uo(N),ue(ne.current.getNumRows())},[N]);const he=ae.useCallback(()=>{ne.current=new Uo(N),ue(ne.current.getNumRows())},[N]),[J,H]=ae.useState(e.columnOrder),{columns:P,setColumnConfigMapping:q}=T1(e,t,n,J);ae.useEffect(()=>{if(e.editingMode===T)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});Ce&&(ne.current.fromJson(Ce,P),ue(ne.current.getNumRows()))},[]);const{getCellContent:fe}=Wy(t,P,ie,ne),{columns:ge,sortColumn:Ve,getOriginalIndex:pe,getCellContent:je}=V1(N,P,fe),Me=ae.useCallback(Ce=>{const dt={selection:{rows:[],columns:[]}};dt.selection.rows=Ce.rows.toArray().map(_e=>pe(_e)),dt.selection.columns=Ce.columns.toArray().map(_e=>eo(ge[_e]));const rn=JSON.stringify(dt),z=r.getStringValue({id:e.id,formId:e.formId});(z===void 0||z!==rn)&&r.setStringValue({id:e.id,formId:e.formId},rn,{fromUi:!0},o)},[ge,e.id,e.formId,r,o,pe]),{debouncedCallback:Pt}=Hu(Me,Sc),{gridSelection:Rt,isRowSelectionActivated:et,isMultiRowSelectionActivated:le,isColumnSelectionActivated:Ge,isMultiColumnSelectionActivated:be,isRowSelected:ce,isColumnSelected:ve,isCellSelected:$e,clearSelection:Oe,processSelectionChange:nt}=qy(e,U,n,ge,Pt);ae.useEffect(()=>{Oe(!0,!0)},[a]);const me=ae.useCallback(Ce=>{var dt;(dt=f.current)==null||dt.updateCells(Ce)},[]);ae.useEffect(()=>{var dt,rn,z,_e;if(!et&&!Ge)return;const Ce=r.getStringValue({id:e.id,formId:e.formId});if(Ce){const We=ge.map(fn=>eo(fn)),_t=JSON.parse(Ce);let dn=mt.empty(),sn=mt.empty();(rn=(dt=_t.selection)==null?void 0:dt.rows)==null||rn.forEach(fn=>{dn=dn.add(fn)}),(_e=(z=_t.selection)==null?void 0:z.columns)==null||_e.forEach(fn=>{sn=sn.add(We.indexOf(fn))}),(dn.length>0||sn.length>0)&&nt({rows:dn,columns:sn,current:void 0})}},[]);const Ee=ae.useCallback(()=>{ie!==ne.current.getNumRows()&&ue(ne.current.getNumRows())},[ie]),at=ae.useCallback(()=>{const Ce=ne.current.toJson(ge);let dt=r.getStringValue({id:e.id,formId:e.formId});dt===void 0&&(dt=new Uo(0).toJson([])),Ce!==dt&&r.setStringValue({id:e.id,formId:e.formId},Ce,{fromUi:!0},o)},[ge,e.id,e.formId,r,o]),{debouncedCallback:He}=Hu(at,Sc),{exportToCsv:rt}=By(je,ge,ie,w),{onCellEdited:bt,onPaste:ht,onRowAppended:ze,onDelete:Tt,validateCell:Xt}=Hy(ge,e.editingMode!==k,ne,je,pe,me,Ee,He,Oe),{tooltip:pt,clearTooltip:Et,onItemHovered:Kt}=Gy(ge,je,j?[ie]:[]),{drawCell:Ft,customRenderers:xn}=Ly(ge),{provideEditor:Wt}=$1(),xt=g.useCallback(Ce=>({...Ce,hasMenu:!U}),[U]),In=ae.useMemo(()=>ge.map(Ce=>xt(Ms(Ce))),[ge,xt]),{columns:vn,onColumnResize:Pe}=_1(In),At=t.dimensions.numHeaderRows>1,{minHeight:hn,maxHeight:gn,minWidth:bn,maxWidth:st,rowHeight:zt,resizableSize:Ot,setResizableSize:nn}=Yy(e,m,ie,At,u||0,c,a),Dt=ae.useCallback(([Ce,dt])=>({...Qv(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(ge.length-1,0)]}),[ge,m.glideTheme.textLight]),Vt=ae.useCallback(()=>{he(),Oe()},[he,Oe]);rg({element:e,widgetMgr:r,onFormCleared:Vt});const{pinColumn:Ke,unpinColumn:$t,freezeColumns:Ht}=O1(ge,U,u||0,m.minColumnWidth,Oe,q),{changeColumnFormat:Nt}=D1(q),{onColumnMoved:Ut}=P1(ge,Ht,Ke,$t,H);return ae.useEffect(()=>{setTimeout(()=>{var Ce,dt;if(h.current&&f.current){const rn=(dt=(Ce=h.current)==null?void 0:Ce.querySelector(".dvn-stack"))==null?void 0:dt.getBoundingClientRect();rn&&(_(rn.height>h.current.clientHeight),x(rn.width>h.current.clientWidth))}},1)},[Ot,ie,vn]),Bn(zu,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:I,ref:h,onMouseDown:Ce=>{if(h.current&&I){const dt=h.current.getBoundingClientRect();E&&dt.height-(xc+1)<Ce.clientY-dt.top&&Ce.stopPropagation(),R&&dt.width-(xc+1)<Ce.clientX-dt.left&&Ce.stopPropagation()}},onBlur:Ce=>{!b&&!C&&!Ce.currentTarget.contains(Ce.relatedTarget)&&Oe(!0,!0)},children:[Bn(sg,{isFullScreen:a,disableFullscreenMode:i,locked:ce&&!et||$e||C&&b,onExpand:l,onCollapse:s,target:zu,children:[(et&&ce||Ge&&ve)&&wt(_i,{label:"Clear selection",icon:dg,onClick:()=>{Oe(),Et()}}),j&&ce&&wt(_i,{label:"Delete row(s)",icon:pg,onClick:()=>{Tt&&(Tt(Rt),Et())}}),j&&!ce&&wt(_i,{label:"Add row",icon:Hc,onClick:()=>{var Ce;ze&&(M(!0),ze(),Et(),(Ce=f.current)==null||Ce.scrollTo(0,ie,"vertical"))}}),!oe&&!U&&wt(_i,{label:"Download as CSV",icon:vg,onClick:()=>rt()}),!U&&wt(_i,{label:"Search",icon:zc,onClick:()=>{O?S(!1):(M(!0),S(!0)),Et()}})]}),wt(ng,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Ot,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:hn,maxHeight:gn,minWidth:bn,maxWidth:st,size:Ot,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,zt],snapGap:zt/3,onResizeStop:(Ce,dt,rn,z)=>{if(d.current){const _e=2*m.tableBorderWidth;nn({width:d.current.size.width,height:gn-d.current.size.height===_e?d.current.size.height+_e:d.current.size.height})}},children:wt(Vv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:vn,rows:U?1:ie,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:zt,headerHeight:m.defaultHeaderHeight,getCellContent:U?Dt:je,onColumnResize:C?void 0:Pe,resizeIndicator:"header",freezeColumns:Ht,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:C?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ge?void 0:Ut,onItemHovered:Ce=>{v==null||v(Ce),Kt==null||Kt(Ce)},keybindings:{downFill:!0},onKeyDown:Ce=>{(Ce.ctrlKey||Ce.metaKey)&&Ce.key==="f"&&(S(dt=>!dt),Ce.stopPropagation(),Ce.preventDefault())},showSearch:O,onSearchClose:()=>{S(!1),Et()},onHeaderClicked:(Ce,dt)=>{!ee||Ge||(et&&ce?Oe():Oe(!0,!0),Ve(Ce,"auto"))},gridSelection:Rt,onGridSelectionChange:Ce=>{(b||C)&&(nt(Ce),pt!==void 0&&Et())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:Ce=>{Ce.kind==="out-of-bounds"&&b?M(!1):Ce.kind!=="out-of-bounds"&&!b&&M(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...I&&{paddingBottom:E?-6:void 0,paddingRight:R?-6:void 0}},provideEditor:Wt,drawCell:Ft,customRenderers:xn,imageEditorOverride:f1,headerIcons:m.headerIcons,validateCell:Xt,onHeaderMenuClick:(Ce,dt)=>{D({columnIdx:Ce,headerBounds:dt})},onPaste:!1,...et&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:le?"multi":"auto",rowSelect:n?"none":le?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Ge&&{columnSelect:n?"none":be?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!U&&e.editingMode!==T&&!n&&{fillHandle:!C,onCellEdited:bt,onPaste:ht,onDelete:Tt},...!U&&e.editingMode===k&&{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:ze,onHeaderClicked:void 0}})}),pt&&pt.content&&wt(Ky,{top:pt.top,left:pt.left,content:pt.content,clearTooltip:Et}),L&&Fc.createPortal(wt(qv,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,columnKind:P[L.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:ee?Ce=>{Oe(!0,!0),Ve(L.columnIdx,Ce,!0)}:void 0,isColumnPinned:P[L.columnIdx].isPinned,onUnpinColumn:()=>{$t(P[L.columnIdx].id)},onPinColumn:()=>{Ke(P[L.columnIdx].id)},onChangeFormat:Ce=>{Nt(P[L.columnIdx].id,Ce),setTimeout(()=>{var dt;(dt=f.current)==null||dt.remeasureColumns(mt.fromSingleSelection(L.columnIdx))},100)},onAutosize:()=>{var Ce;(Ce=f.current)==null||Ce.remeasureColumns(mt.fromSingleSelection(L.columnIdx))}}),document.querySelector("#portal"))]})}const Qy=ig(Jy),eC=g.memo(Qy),hC=Object.freeze(Object.defineProperty({__proto__:null,default:eC},Symbol.toStringTag,{value:"Module"}));export{v0 as C,vd as T,di as a,xg as b,hC as c,ui as i,$m as m,pn as s};
|