streamlit-nightly 1.46.2.dev20250702__py3-none-any.whl → 1.46.2.dev20250704__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/auth_util.py +1 -1
- streamlit/elements/lib/column_types.py +9 -0
- streamlit/errors.py +6 -0
- streamlit/runtime/secrets.py +7 -2
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +214 -214
- streamlit/static/static/js/{ErrorOutline.esm.MhIoYdvl.js → ErrorOutline.esm.Dl5aYA7P.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.MFVQ8TeX.js → FileDownload.esm.b9aAtFUL.js} +1 -1
- streamlit/static/static/js/{FileHelper.4MaelLoM.js → FileHelper.CZ-fo3AT.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.B0jg0hVR.js → FormClearHelper.X_JAWIDE.js} +1 -1
- streamlit/static/static/js/{Hooks.BRUa3Uwi.js → Hooks.DgDu8WWe.js} +1 -1
- streamlit/static/static/js/{InputInstructions.DIDrjUfW.js → InputInstructions.DRcWCO4-.js} +1 -1
- streamlit/static/static/js/{ProgressBar.D5j4Grse.js → ProgressBar.TfYA4ywP.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.DSEpNV6C.js → RenderInPortalIfExists.DdXJh4rR.js} +1 -1
- streamlit/static/static/js/{Toolbar.CQcJmHso.js → Toolbar.Vgf9NeBF.js} +1 -1
- streamlit/static/static/js/{base-input.BnnSlzQu.js → base-input.DVejzOG3.js} +1 -1
- streamlit/static/static/js/{checkbox.C3U3kKA7.js → checkbox.CHzUs1FT.js} +1 -1
- streamlit/static/static/js/{createSuper.Cy5MeyJ7.js → createSuper.DtVUSUG3.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DfB1NFlz.js → data-grid-overlay-editor.0g3IWOH4.js} +1 -1
- streamlit/static/static/js/{downloader.DJTt16dd.js → downloader.C1bmi7_d.js} +1 -1
- streamlit/static/static/js/{es6.wyhZ4wJk.js → es6.DB9CkkEz.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.DFyVP9Ig.js → iframeResizer.contentWindow.BUdo9Eut.js} +1 -1
- streamlit/static/static/js/{index.Dr7_LGVT.js → index.B7_hmluD.js} +1 -1
- streamlit/static/static/js/{index.B-X33K52.js → index.BFvFGupf.js} +1 -1
- streamlit/static/static/js/{index.CG52VtIR.js → index.BGQkiO_L.js} +1 -1
- streamlit/static/static/js/{index.CvEUwmm2.js → index.BLe8vNj1.js} +1 -1
- streamlit/static/static/js/{index.DJzsQdj5.js → index.BPv94ryA.js} +1 -1
- streamlit/static/static/js/{index.DT8f2xQ9.js → index.BSU3uPDy.js} +1 -1
- streamlit/static/static/js/{index.C2ZYRKqZ.js → index.BYDy3exs.js} +1 -1
- streamlit/static/static/js/{index.B22EHN7-.js → index.Bxl-lvf7.js} +1 -1
- streamlit/static/static/js/{index.Cipw6ZXy.js → index.Bz1rmVZY.js} +1 -1
- streamlit/static/static/js/{index.DyTIPa0F.js → index.C6lv7LZF.js} +1 -1
- streamlit/static/static/js/{index.DynUmaAG.js → index.CL2tKcqp.js} +1 -1
- streamlit/static/static/js/{index.Cx59kXcb.js → index.CUgLUHzz.js} +1 -1
- streamlit/static/static/js/{index.BMd4yctQ.js → index.Ca71cNwT.js} +1 -1
- streamlit/static/static/js/{index.lQYpmexK.js → index.ChFrryup.js} +1 -1
- streamlit/static/static/js/{index.DLQQdwIj.js → index.CsowBPbe.js} +1 -1
- streamlit/static/static/js/{index.DsdPm0SS.js → index.D9G9SbyS.js} +1 -1
- streamlit/static/static/js/{index.DEc9e9_6.js → index.D9lVoZ0g.js} +1 -1
- streamlit/static/static/js/{index.gMS0zlRZ.js → index.D9m0XlZY.js} +1 -1
- streamlit/static/static/js/{index.DtbQuv3u.js → index.DBSP2Mzg.js} +1 -1
- streamlit/static/static/js/{index.B465_5qO.js → index.DJFU0ONs.js} +1 -1
- streamlit/static/static/js/{index.C4H2pObU.js → index.DJM4CJwf.js} +1 -1
- streamlit/static/static/js/{index.Do1oo2Dl.js → index.DQtc0wgD.js} +1 -1
- streamlit/static/static/js/{index.DzC4L_Us.js → index.DYOc3lvA.js} +1 -1
- streamlit/static/static/js/index.DkDMkGP_.js +197 -0
- streamlit/static/static/js/{index.C_ub2Pfc.js → index.DlvTB7Ab.js} +1 -1
- streamlit/static/static/js/{index.BHoorvVC.js → index.Dmsp2dPx.js} +64 -64
- streamlit/static/static/js/index.MJ13AaAl.js +1 -0
- streamlit/static/static/js/{index.z241Yt9a.js → index.Vqz4Rf-H.js} +1 -1
- streamlit/static/static/js/{index.BNiT2b3M.js → index.WCZtB2fX.js} +1 -1
- streamlit/static/static/js/{index.Dsil7y_J.js → index.ZDNW54LS.js} +1 -1
- streamlit/static/static/js/{index.D-doFAXM.js → index.bBcPxeDg.js} +1 -1
- streamlit/static/static/js/{index.CLg6_EPb.js → index.ffsleSUc.js} +1 -1
- streamlit/static/static/js/{index.UFChjuC3.js → index.fnZJbfUF.js} +1 -1
- streamlit/static/static/js/{index.CDk53kDT.js → index.lM0dtLa7.js} +1 -1
- streamlit/static/static/js/{index.CDhJdsJ-.js → index.pxx1WhzW.js} +1 -1
- streamlit/static/static/js/{index.DcEV00Pn.js → index.rSXfDs8E.js} +1 -1
- streamlit/static/static/js/{index.BSHRz8-s.js → index.zmzbyDg-.js} +1 -1
- streamlit/static/static/js/{input.C8HOZnEd.js → input.zZ5PCHhH.js} +1 -1
- streamlit/static/static/js/{memory.8fc2LDiK.js → memory.BGxwio87.js} +1 -1
- streamlit/static/static/js/{mergeWith.xmxP-tqn.js → mergeWith.CAjjDs4h.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DtoLRumH.js → number-overlay-editor.D6O6Urda.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.DqUCGXEg.js → possibleConstructorReturn.Bv3kil8b.js} +1 -1
- streamlit/static/static/js/{sandbox.de7mpc93.js → sandbox.DqowwceX.js} +1 -1
- streamlit/static/static/js/{textarea.9dU6cbLz.js → textarea.mjUutfC5.js} +1 -1
- streamlit/static/static/js/{timepicker.DANyzCwb.js → timepicker.D5asOTRg.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.Bja4AaDo.js → toConsumableArray.CbOloveN.js} +1 -1
- streamlit/static/static/js/{uniqueId.q5r0gCRd.js → uniqueId.DldNV5wM.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.B0oxOutH.js → useBasicWidgetState.DILnXvLY.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.XxzVJXCy.js → useOnInputChange.Bpbev6mM.js} +1 -1
- streamlit/static/static/js/withFullScreenWrapper.Dgyv-A2q.js +1 -0
- streamlit/watcher/event_based_path_watcher.py +76 -44
- streamlit/watcher/local_sources_watcher.py +22 -19
- streamlit/watcher/polling_path_watcher.py +29 -18
- streamlit/watcher/util.py +7 -8
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250704.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250704.dist-info}/RECORD +82 -82
- streamlit/static/static/js/index.DFtXcE7L.js +0 -197
- streamlit/static/static/js/index.DRodAgy0.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.eXXoswSf.js +0 -1
- {streamlit_nightly-1.46.2.dev20250702.data → streamlit_nightly-1.46.2.dev20250704.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250704.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250704.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250702.dist-info → streamlit_nightly-1.46.2.dev20250704.dist-info}/top_level.txt +0 -0
@@ -1,197 +0,0 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.DfB1NFlz.js","./index.BHoorvVC.js","../css/index.CJVRHjQZ.css","./FormClearHelper.B0jg0hVR.js","./withFullScreenWrapper.eXXoswSf.js","./Toolbar.CQcJmHso.js","./checkbox.C3U3kKA7.js","./mergeWith.xmxP-tqn.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.Bja4AaDo.js","./possibleConstructorReturn.DqUCGXEg.js","./createSuper.Cy5MeyJ7.js","./FileDownload.esm.MFVQ8TeX.js","./number-overlay-editor.DtoLRumH.js","./es6.wyhZ4wJk.js"])))=>i.map(i=>d[i]);
|
2
|
-
var ch=Object.defineProperty;var dh=(e,t,n)=>t in e?ch(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>dh(e,typeof t!="symbol"?t+"":t,n);import{r as f,E as Ls,_ as Ke,c as fh,g as br,i as Ua,d as ho,e as hh,f as gh,h as mh,m as Tc,n as Dc,R as Ut,o as ph,p as Oc,q as vh,t as bh,u as wh,v as yh,w as Ch,x as Sh,a as _r,y as Fs,s as Si,z as Zr,j as lt,F as Pc,A as wa,T as _c,B as ya,C as Fn,D as hr,G as Ca,H as mn,I as Lc,J as hi,K as xh,L as kh,M as Xe,N as Fc,O as ft,Q as Ki,S as Gr,U as qa,V as Mh,W as Rh,X as Eh,Y as Pl,Z as Ih,$ as Th,a0 as Dh,a1 as Oh,a2 as Ac,a3 as Ph,a4 as _h,a5 as Cs,a6 as Hc,a7 as zc,a8 as Lh,a9 as Fh,aa as Ah,ab as Hh,ac as zh,ad as Vh,ae as $h,af as Nh,ag as Bh,ah as Vc,ai as Wh,aj as Uh,ak as qh,al as Yh,am as Xh,an as Gh,ao as jh,ap as Kh,aq as Zh,ar as Jh,as as Qh,at as eg,au as tg,av as ng,aw as En,l as As,ax as Zi,ay as wr,az as $e,aA as rg,b as $c,aB as Nc,k as ig,aC as og,aD as ag,aE as Ya,aF as sg,aG as lg,aH as ug,aI as cg,aJ as dg}from"./index.BHoorvVC.js";import{u as fg}from"./FormClearHelper.B0jg0hVR.js";import{w as hg,E as gg}from"./withFullScreenWrapper.eXXoswSf.js";import{T as mg,a as di}from"./Toolbar.CQcJmHso.js";import{L as pg,S as vg,a as bg}from"./checkbox.C3U3kKA7.js";import{m as wg}from"./mergeWith.xmxP-tqn.js";import{s as yg}from"./sprintf.D7DtBTRn.js";import{c as Cg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as mr,a as Hs,C as Sg}from"./toConsumableArray.Bja4AaDo.js";import{_ as xg,a as kg,b as Mg}from"./possibleConstructorReturn.DqUCGXEg.js";import{_ as Rg}from"./createSuper.Cy5MeyJ7.js";import{D as Eg,F as Ig}from"./FileDownload.esm.MFVQ8TeX.js";var Bc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Bc.displayName="Add";var Wc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.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"}))});Wc.displayName="Search";var Uc=f.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return f.createElement(Ls,Ke({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),f.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),f.createElement("path",{d:"M12 6a9.77 9.77 0 018.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5A9.77 9.77 0 0112 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5a2.5 2.5 0 010 5 2.5 2.5 0 010-5m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"}))});Uc.displayName="Visibility";var Xa,_l;function Tg(){if(_l)return Xa;_l=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Xa=n,Xa}var Ga,Ll;function Dg(){if(Ll)return Ga;Ll=1;var e=Tg(),t=fh();function n(r,i){return r!=null&&t(r,i,e)}return Ga=n,Ga}var Og=Dg();const Pg=br(Og);function qc(e="This should not happen"){throw new Error(e)}function An(e,t="Assertion failed"){if(!e)return qc(t)}function oo(e,t){return qc(t??"Hell froze over")}function _g(e,t){try{return e()}catch{return t}}const Fl=Object.prototype.hasOwnProperty;function yi(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--&&yi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Fl.call(e,n)&&++r&&!Fl.call(t,n)||!(n in t)||!yi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ra=null,zs=void 0;var ee;(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"})(ee||(ee={}));var Al;(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"})(Al||(Al={}));var ia;(function(e){e.Triangle="triangle",e.Dots="dots"})(ia||(ia={}));function Ao(e){return"width"in e&&typeof e.width=="number"}async function Hl(e){return typeof e=="object"?e:await e()}function gi(e){return!(e.kind===ee.Loading||e.kind===ee.Bubble||e.kind===ee.RowID||e.kind===ee.Protected||e.kind===ee.Drilldown)}function pi(e){return e.kind===Yn.Marker||e.kind===Yn.NewRow}function Ji(e){if(!gi(e)||e.kind===ee.Image)return!1;switch(e.kind){case ee.Text:case ee.Number:case ee.Markdown:case ee.Uri:case ee.Custom:case ee.Boolean:return e.readonly!==!0;default:oo(e,"A cell was passed with an invalid kind")}}function Lg(e){return Pg(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Yn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Yn||(Yn={}));function Fg(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 zl;const gr=class gr{constructor(t){dt(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 gr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Fg([...this.items,n]);return new gr(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,l]of n.entries()){const[a,s]=l;if(a<=i&&r<=s){const u=[];a<r&&u.push([a,r]),i<s&&u.push([i,s]),n.splice(o,1,...u)}}return new gr(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}};dt(gr,"empty",()=>zl??(zl=new gr([]))),dt(gr,"fromSingleSelection",t=>gr.empty().add(t));let vt=gr;var Ag=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,s]=a.split("_");n[s]=a}else r.push(a)})});const i=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.push(n[o]);return i.push(...r),i.join(" ")},Vl=Ag,Hg=e=>e.toUpperCase()===e,zg=e=>t=>e.indexOf(t)===-1,Yc=(e,t)=>{const n={};return Object.keys(e).filter(zg(t)).forEach(r=>{n[r]=e[r]}),n};function Vg(e,t,n){const r=Yc(t,n);if(!e){const i=typeof Ua=="function"?{default:Ua}:Ua;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var $g=(e,t)=>{};function Ng(e){let t="";return n=>{const r=(o,l)=>{const{as:a=e,class:s=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Hg(a[0])):n.propsAsIs,c=Vg(u,o,["as","class"]);c.ref=l,c.className=n.atomic?Vl(n.class,c.className||s):Vl(c.className||s,n.class);const{vars:d}=n;if(d){const g={};for(const p in d){const b=d[p],w=b[0],v=b[1]||"",x=typeof w=="function"?w(o):w;$g(x,n.name),g[`--${p}`]=`${x}${v}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{g[p]=h[p]}),c.style=g}return e.__wyw_meta&&e!==a?(c.as=a,f.createElement(e,c)):f.createElement(a,c)},i=f.forwardRef?f.forwardRef(r):o=>{const l=Yc(o,["innerRef"]);return r(l,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var vn=Ng;const Bg=vn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ja={},zi={},Ho={},zo={},$l;function Wg(){return $l||($l=1,function(e){(function(t,n){n(e,ho(),hh())})(zo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=l(n),o=l(r);function l(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(v[S]=O[S])}return v};function s(v,x){var O={};for(var S in v)x.indexOf(S)>=0||Object.prototype.hasOwnProperty.call(v,S)&&(O[S]=v[S]);return O}function u(v,x){if(!(v instanceof x))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(x,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(x,R.key,R)}}return function(x,O,S){return O&&v(x.prototype,O),S&&v(x,S),x}}();function d(v,x){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:v}function g(v,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);v.prototype=Object.create(x&&x.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(v,x):v.__proto__=x)}var h=!1;function m(v){h=v}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?v:v.capture}function b(v){if("touches"in v){var x=v.touches[0],O=x.pageX,S=x.pageY;return{x:O,y:S}}var R=v.screenX,_=v.screenY;return{x:R,y:_}}var w=function(v){g(x,v);function x(){var O;u(this,x);for(var S=arguments.length,R=Array(S),_=0;_<S;_++)R[_]=arguments[_];var E=d(this,(O=x.__proto__||Object.getPrototypeOf(x)).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(x,[{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=b(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=b(S),_=R.x,E=R.y,k=_-this.moveStart.x,L=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:L},S);D&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:k,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 k=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return i.default.createElement(this.props.tagName,a({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:R,style:_},k),E)}}]),x}(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})}(zo)),zo}var Nl;function Xc(){return Nl||(Nl=1,function(e){(function(t,n){n(e,Wg())})(Ho,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})}(Ho)),Ho}var Vi={},Bl;function Gc(){if(Bl)return Vi;Bl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=t(gh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,l){return o in i?Object.defineProperty(i,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[o]=l,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,l){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":l==="horizontal","axis-vertical":l!=="horizontal"})},SLIDER:function(o,l){return(0,e.default)({thumbs:!o,slider:o,animated:!l})},ITEM:function(o,l,a){return(0,e.default)({thumb:!o,slide:o,selected:l,previous:a})},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 Vi.default=r,Vi}var $i={},Ni={},Wl;function Ug(){if(Wl)return Ni;Wl=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Ni.outerWidth=e,Ni}var Bi={},Ul;function $s(){if(Ul)return Bi;Ul=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,l=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",s="("+l.join(",")+")";return a+s};return Bi.default=e,Bi}var Wi={},ql;function jc(){if(ql)return Wi;ql=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=void 0;var e=function(){return window};return Wi.default=e,Wi}var Yl;function Kc(){if(Yl)return $i;Yl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.default=void 0;var e=s(ho()),t=l(Gc()),n=Ug(),r=l($s()),i=l(Xc()),o=l(jc());function l(E){return E&&E.__esModule?E:{default:E}}function a(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return a=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 k=a();if(k&&k.has(E))return k.get(E);var L={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var T=D?Object.getOwnPropertyDescriptor(E,C):null;T&&(T.get||T.set)?Object.defineProperty(L,C,T):L[C]=E[C]}return L.default=E,k&&k.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 k=1;k<arguments.length;k++){var L=arguments[k];for(var D in L)Object.prototype.hasOwnProperty.call(L,D)&&(E[D]=L[D])}return E},c.apply(this,arguments)}function d(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var L=0;L<k.length;L++){var D=k[L];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,L){return k&&g(E.prototype,k),E}function m(E,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(k&&k.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),k&&p(E,k)}function p(E,k){return p=Object.setPrototypeOf||function(D,C){return D.__proto__=C,D},p(E,k)}function b(E){var k=x();return function(){var D=O(E),C;if(k){var T=O(this).constructor;C=Reflect.construct(D,arguments,T)}else C=D.apply(this,arguments);return w(this,C)}}function w(E,k){return k&&(u(k)==="object"||typeof k=="function")?k:v(E)}function v(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function x(){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,k,L){return k in E?Object.defineProperty(E,k,{value:L,enumerable:!0,configurable:!0,writable:!0}):E[k]=L,E}var R=function(k){return k.hasOwnProperty("key")},_=function(E){m(L,E);var k=b(L);function L(D){var C;return d(this,L),C=k.call(this,D),S(v(C),"itemsWrapperRef",void 0),S(v(C),"itemsListRef",void 0),S(v(C),"thumbsRef",void 0),S(v(C),"setItemsWrapperRef",function(T){C.itemsWrapperRef=T}),S(v(C),"setItemsListRef",function(T){C.itemsListRef=T}),S(v(C),"setThumbsRef",function(T,I){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[I]=T}),S(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var T=e.Children.count(C.props.children),I=C.itemsWrapperRef.clientWidth,M=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),z=Math.floor(I/M),N=z<T,X=N?T-z:0;C.setState(function(ne,G){return{itemSize:M,visibleItems:z,firstItem:N?C.getFirstItem(G.selectedItem):0,lastPosition:X,showArrows:N}})}}),S(v(C),"handleClickItem",function(T,I,M){if(!R(M)||M.key==="Enter"){var z=C.props.onSelectItem;typeof z=="function"&&z(T,I)}}),S(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),S(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),S(v(C),"onSwipeMove",function(T){var I=T.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var M=0,z=e.Children.count(C.props.children),N=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max(z-C.state.visibleItems,0),ne=-X*100/C.state.visibleItems;N===M&&I>0&&(I=0),N===ne&&I<0&&(I=0);var G=C.itemsWrapperRef.clientWidth,J=N+100/(G/I);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(le){C.itemsListRef.style[le]=(0,r.default)(J,"%",C.props.axis)}),!0}),S(v(C),"slideRight",function(T){C.moveTo(C.state.firstItem-(typeof T=="number"?T:1))}),S(v(C),"slideLeft",function(T){C.moveTo(C.state.firstItem+(typeof T=="number"?T:1))}),S(v(C),"moveTo",function(T){T=T<0?0:T,T=T>=C.state.lastPosition?C.state.lastPosition:T,C.setState({firstItem:T})}),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 T=C;return C>=this.state.lastPosition&&(T=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(T=this.state.firstItem),C<this.state.firstItem&&(T=C),T}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(T,I){var M=t.default.ITEM(!1,I===C.state.selectedItem),z={key:I,ref:function(X){return C.setThumbsRef(X,I)},className:M,onClick:C.handleClickItem.bind(C,I,C.props.children[I]),onKeyDown:C.handleClickItem.bind(C,I,C.props.children[I]),"aria-label":"".concat(C.props.labels.item," ").concat(I+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},z,{role:"button",tabIndex:0}),T)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var T=e.Children.count(this.props.children)>1,I=this.state.showArrows&&this.state.firstItem>0,M=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,z={},N=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(N,"px",this.props.axis),ne=this.props.transitionTime+"ms";return z={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:ne,MozTransitionDuration:ne,MsTransitionDuration:ne,OTransitionDuration:ne,transitionDuration:ne,msTransitionDuration:ne},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(!I),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),T?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:z,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:z},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!M),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),L}(e.Component);return $i.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}),$i}var Ui={},Xl;function qg(){if(Xl)return Ui;Xl=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=void 0;var e=function(){return document};return Ui.default=e,Ui}var Ln={},Gl;function Zc(){if(Gl)return Ln;Gl=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.setPosition=Ln.getPosition=Ln.isKeyboardEvent=Ln.defaultStatusFormatter=Ln.noop=void 0;var e=ho(),t=n($s());function n(s){return s&&s.__esModule?s:{default:s}}var r=function(){};Ln.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};Ln.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};Ln.isKeyboardEvent=o;var l=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 g=-u*c.centerSlidePercentage,h=d-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};Ln.getPosition=l;var a=function(u,c){var d={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){d[g]=(0,t.default)(u,"%",c)}),d};return Ln.setPosition=a,Ln}var er={},jl;function Yg(){if(jl)return er;jl=1,Object.defineProperty(er,"__esModule",{value:!0}),er.fadeAnimationHandler=er.slideStopSwipingHandler=er.slideSwipeAnimationHandler=er.slideAnimationHandler=void 0;var e=ho(),t=r($s()),n=Zc();function r(d){return d&&d.__esModule?d:{default:d}}function i(d,g){var h=Object.keys(d);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(d);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(d,p).enumerable})),h.push.apply(h,m)}return h}function o(d){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){l(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 l(d,g,h){return g in d?Object.defineProperty(d,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):d[g]=h,d}var a=function(g,h){var m={},p=h.selectedItem,b=p,w=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>w);if(v)return b<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(w+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(w+2)*100,g.axis):b>w&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var x=(0,n.getPosition)(p,g),O=(0,t.default)(x,"%",g.axis),S=g.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=a;var s=function(g,h,m,p){var b={},w=h.axis==="horizontal",v=e.Children.count(h.children),x=0,O=(0,n.getPosition)(m.selectedItem,h),S=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),R=w?g.x:g.y,_=R;O===x&&R>0&&(_=0),O===S&&R<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(R)>h.swipeScrollTolerance;return h.infiniteLoop&&k&&(m.selectedItem===0&&E>-100?E-=v*100:m.selectedItem===v-1&&E<-v*100&&(E+=v*100)),(!h.preventMovementUntilSwipeScrollTolerance||k||m.swipeMovementStarted)&&(m.swipeMovementStarted||p({swipeMovementStarted:!0}),b.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),b};er.slideSwipeAnimationHandler=s;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};er.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",b={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||(b=o(o({},b),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:b,selectedStyle:o(o({},b),{},{opacity:1,position:"relative"}),prevStyle:o({},b)}};return er.fadeAnimationHandler=c,er}var Kl;function Xg(){if(Kl)return zi;Kl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=c(ho()),t=s(Xc()),n=s(Gc()),r=s(Kc()),i=s(qg()),o=s(jc()),l=Zc(),a=Yg();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 T={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var M in D)if(Object.prototype.hasOwnProperty.call(D,M)){var z=I?Object.getOwnPropertyDescriptor(D,M):null;z&&(z.get||z.set)?Object.defineProperty(T,M,z):T[M]=D[M]}return T.default=D,C&&C.set(D,T),T}function d(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(T){return typeof T}:d=function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},d(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var T=arguments[C];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(D[I]=T[I])}return D},g.apply(this,arguments)}function h(D,C){var T=Object.keys(D);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(D);C&&(I=I.filter(function(M){return Object.getOwnPropertyDescriptor(D,M).enumerable})),T.push.apply(T,I)}return T}function m(D){for(var C=1;C<arguments.length;C++){var T=arguments[C]!=null?arguments[C]:{};C%2?h(Object(T),!0).forEach(function(I){k(D,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(T)):h(Object(T)).forEach(function(I){Object.defineProperty(D,I,Object.getOwnPropertyDescriptor(T,I))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function b(D,C){for(var T=0;T<C.length;T++){var I=C[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(D,I.key,I)}}function w(D,C,T){return C&&b(D.prototype,C),D}function v(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&&x(D,C)}function x(D,C){return x=Object.setPrototypeOf||function(I,M){return I.__proto__=M,I},x(D,C)}function O(D){var C=_();return function(){var I=E(D),M;if(C){var z=E(this).constructor;M=Reflect.construct(I,arguments,z)}else M=I.apply(this,arguments);return S(this,M)}}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(T){return T.__proto__||Object.getPrototypeOf(T)},E(D)}function k(D,C,T){return C in D?Object.defineProperty(D,C,{value:T,enumerable:!0,configurable:!0,writable:!0}):D[C]=T,D}var L=function(D){v(T,D);var C=O(T);function T(I){var M;p(this,T),M=C.call(this,I),k(R(M),"thumbsRef",void 0),k(R(M),"carouselWrapperRef",void 0),k(R(M),"listRef",void 0),k(R(M),"itemsRef",void 0),k(R(M),"timer",void 0),k(R(M),"animationHandler",void 0),k(R(M),"setThumbsRef",function(N){M.thumbsRef=N}),k(R(M),"setCarouselWrapperRef",function(N){M.carouselWrapperRef=N}),k(R(M),"setListRef",function(N){M.listRef=N}),k(R(M),"setItemsRef",function(N,X){M.itemsRef||(M.itemsRef=[]),M.itemsRef[X]=N}),k(R(M),"autoPlay",function(){e.Children.count(M.props.children)<=1||(M.clearAutoPlay(),M.props.autoPlay&&(M.timer=setTimeout(function(){M.increment()},M.props.interval)))}),k(R(M),"clearAutoPlay",function(){M.timer&&clearTimeout(M.timer)}),k(R(M),"resetAutoPlay",function(){M.clearAutoPlay(),M.autoPlay()}),k(R(M),"stopOnHover",function(){M.setState({isMouseEntered:!0},M.clearAutoPlay)}),k(R(M),"startOnLeave",function(){M.setState({isMouseEntered:!1},M.autoPlay)}),k(R(M),"isFocusWithinTheCarousel",function(){return M.carouselWrapperRef?!!((0,i.default)().activeElement===M.carouselWrapperRef||M.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(R(M),"navigateWithKeyboard",function(N){if(M.isFocusWithinTheCarousel()){var X=M.props.axis,ne=X==="horizontal",G={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},J=ne?G.ArrowRight:G.ArrowDown,le=ne?G.ArrowLeft:G.ArrowUp;J===N.keyCode?M.increment():le===N.keyCode&&M.decrement()}}),k(R(M),"updateSizes",function(){if(!(!M.state.initialized||!M.itemsRef||M.itemsRef.length===0)){var N=M.props.axis==="horizontal",X=M.itemsRef[0];if(X){var ne=N?X.clientWidth:X.clientHeight;M.setState({itemSize:ne}),M.thumbsRef&&M.thumbsRef.updateSizes()}}}),k(R(M),"setMountState",function(){M.setState({hasMount:!0}),M.updateSizes()}),k(R(M),"handleClickItem",function(N,X){if(e.Children.count(M.props.children)!==0){if(M.state.cancelClick){M.setState({cancelClick:!1});return}M.props.onClickItem(N,X),N!==M.state.selectedItem&&M.setState({selectedItem:N})}}),k(R(M),"handleOnChange",function(N,X){e.Children.count(M.props.children)<=1||M.props.onChange(N,X)}),k(R(M),"handleClickThumb",function(N,X){M.props.onClickThumb(N,X),M.moveTo(N)}),k(R(M),"onSwipeStart",function(N){M.setState({swiping:!0}),M.props.onSwipeStart(N)}),k(R(M),"onSwipeEnd",function(N){M.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),M.props.onSwipeEnd(N),M.clearAutoPlay(),M.state.autoPlay&&M.autoPlay()}),k(R(M),"onSwipeMove",function(N,X){M.props.onSwipeMove(X);var ne=M.props.swipeAnimationHandler(N,M.props,M.state,M.setState.bind(R(M)));return M.setState(m({},ne)),!!Object.keys(ne).length}),k(R(M),"decrement",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem-(typeof N=="number"?N:1))}),k(R(M),"increment",function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;M.moveTo(M.state.selectedItem+(typeof N=="number"?N:1))}),k(R(M),"moveTo",function(N){if(typeof N=="number"){var X=e.Children.count(M.props.children)-1;N<0&&(N=M.props.infiniteLoop?X:0),N>X&&(N=M.props.infiniteLoop?0:X),M.selectItem({selectedItem:N}),M.state.autoPlay&&M.state.isMouseEntered===!1&&M.resetAutoPlay()}}),k(R(M),"onClickNext",function(){M.increment(1)}),k(R(M),"onClickPrev",function(){M.decrement(1)}),k(R(M),"onSwipeForward",function(){M.increment(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),k(R(M),"onSwipeBackwards",function(){M.decrement(1),M.props.emulateTouch&&M.setState({cancelClick:!0})}),k(R(M),"changeItem",function(N){return function(X){(!(0,l.isKeyboardEvent)(X)||X.key==="Enter")&&M.moveTo(N)}}),k(R(M),"selectItem",function(N){M.setState(m({previousItem:M.state.selectedItem},N),function(){M.setState(M.animationHandler(M.props,M.state))}),M.handleOnChange(N.selectedItem,e.Children.toArray(M.props.children)[N.selectedItem])}),k(R(M),"getInitialImage",function(){var N=M.props.selectedItem,X=M.itemsRef&&M.itemsRef[N],ne=X&&X.getElementsByTagName("img")||[];return ne[0]}),k(R(M),"getVariableItemHeight",function(N){var X=M.itemsRef&&M.itemsRef[N];if(M.state.hasMount&&X&&X.children.length){var ne=X.children[0].getElementsByTagName("img")||[];if(ne.length>0){var G=ne[0];if(!G.complete){var J=function se(){M.forceUpdate(),G.removeEventListener("load",se)};G.addEventListener("load",J)}}var le=ne[0]||X.children[0],ie=le.clientHeight;return ie>0?ie:null}return null});var z={initialized:!1,previousItem:I.selectedItem,selectedItem:I.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:I.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return M.animationHandler=typeof I.animationHandler=="function"&&I.animationHandler||I.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,M.state=m(m({},z),M.animationHandler(I,z)),M}return w(T,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(M,z){!M.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!M.autoFocus&&this.props.autoFocus&&this.forceFocus(),z.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(M.selectedItem!==this.props.selectedItem||M.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),M.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 M=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 z=M.getInitialImage();z&&!z.complete?z.addEventListener("load",M.setMountState):M.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.addEventListener("mouseenter",this.stopOnHover),M.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var M=this.carouselWrapperRef;this.props.stopOnHover&&M&&(M.removeEventListener("mouseenter",this.stopOnHover),M.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 M=this.getInitialImage();M&&M.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var M;(M=this.carouselWrapperRef)===null||M===void 0||M.focus()}},{key:"renderItems",value:function(M){var z=this;return this.props.children?e.Children.map(this.props.children,function(N,X){var ne=X===z.state.selectedItem,G=X===z.state.previousItem,J=ne&&z.state.selectedStyle||G&&z.state.prevStyle||z.state.slideStyle||{};z.props.centerMode&&z.props.axis==="horizontal"&&(J=m(m({},J),{},{minWidth:z.props.centerSlidePercentage+"%"})),z.state.swiping&&z.state.swipeMovementStarted&&(J=m(m({},J),{},{pointerEvents:"none"}));var le={ref:function(se){return z.setItemsRef(se,X)},key:"itemKey"+X+(M?"clone":""),className:n.default.ITEM(!0,X===z.state.selectedItem,X===z.state.previousItem),onClick:z.handleClickItem.bind(z,X,N),style:J};return e.default.createElement("li",le,z.props.renderItem(N,{isSelected:X===z.state.selectedItem,isPrevious:X===z.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var M=this,z=this.props,N=z.showIndicators,X=z.labels,ne=z.renderIndicator,G=z.children;return N?e.default.createElement("ul",{className:"control-dots"},e.Children.map(G,function(J,le){return ne&&ne(M.changeItem(le),le===M.state.selectedItem,le,X.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 M=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var z=this.props.swipeable&&e.Children.count(this.props.children)>1,N=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,ne=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,G=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,J=this.renderItems(!0),le=J.shift(),ie=J.pop(),se={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},Me={};if(N){if(se.onSwipeLeft=this.onSwipeForward,se.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var te=this.getVariableItemHeight(this.state.selectedItem);Me.height=te||"auto"}}else se.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,se.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,se.style=m(m({},se.style),{},{height:this.state.itemSize}),Me.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,ne,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:Me},z?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},se,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&le):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return M.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ie,this.renderItems(),this.props.infiniteLoop&&le)),this.props.renderArrowNext(this.onClickNext,G,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),T}(e.default.Component);return zi.default=L,k(L,"displayName","Carousel"),k(L,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,T,I){return e.default.createElement("button",{type:"button","aria-label":I,className:n.default.ARROW_PREV(!T),onClick:C})},renderArrowNext:function(C,T,I){return e.default.createElement("button",{type:"button","aria-label":I,className:n.default.ARROW_NEXT(!T),onClick:C})},renderIndicator:function(C,T,I,M){return e.default.createElement("li",{className:n.default.DOT(T),onClick:C,onKeyDown:C,value:I,key:I,role:"button",tabIndex:0,"aria-label":"".concat(M," ").concat(I+1)})},renderItem:function(C){return C},renderThumbs:function(C){var T=e.Children.map(C,function(I){var M=I;if(I.type!=="img"&&(M=e.Children.toArray(I.props.children).find(function(z){return z.type==="img"})),!!M)return M});return T.filter(function(I){return I}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):T},statusFormatter:l.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:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),zi}var Zl={},Jl;function Gg(){return Jl||(Jl=1),Zl}var Ql;function jg(){return Ql||(Ql=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(Xg()),n=Gg(),r=i(Kc());function i(o){return o&&o.__esModule?o:{default:o}}}(ja)),ja}var Kg=jg(),Ka,eu;function Zg(){if(eu)return Ka;eu=1;var e=mh(),t=function(){return e.Date.now()};return Ka=t,Ka}var Za,tu;function Jc(){if(tu)return Za;tu=1;var e=Tc(),t=Zg(),n=Dc(),r="Expected a function",i=Math.max,o=Math.min;function l(a,s,u){var c,d,g,h,m,p,b=0,w=!1,v=!1,x=!0;if(typeof a!="function")throw new TypeError(r);s=n(s)||0,e(u)&&(w=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,s):g,x="trailing"in u?!!u.trailing:x);function O(T){var I=c,M=d;return c=d=void 0,b=T,h=a.apply(M,I),h}function S(T){return b=T,m=setTimeout(E,s),w?O(T):h}function R(T){var I=T-p,M=T-b,z=s-I;return v?o(z,g-M):z}function _(T){var I=T-p,M=T-b;return p===void 0||I>=s||I<0||v&&M>=g}function E(){var T=t();if(_(T))return k(T);m=setTimeout(E,R(T))}function k(T){return m=void 0,x&&c?O(T):(c=d=void 0,h)}function L(){m!==void 0&&clearTimeout(m),b=0,c=p=d=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var T=t(),I=_(T);if(c=arguments,d=this,p=T,I){if(m===void 0)return S(p);if(v)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 Za=l,Za}var Jg=Jc();const Qc=br(Jg);function pn(e,t,n,r,i=!1){const o=f.useRef();o.current=t,f.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var u;(u=o.current)==null||u.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:i}),()=>{l.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function Dr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function nu(e){return e*Qg/180}const ed=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),td=(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}},nd=(e,t,n)=>Math.min(e,t-n*2),rd=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ns=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.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"}),f.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[r,i]=f.useState(e),o=f.useRef(!0);f.useEffect(()=>()=>{o.current=!1},[]);const l=f.useRef(Qc(a=>{o.current&&i(a)},n));return f.useLayoutEffect(()=>{o.current&&l.current(()=>e())},t),r}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Bs(e){return im.test(e)?"rtl":"not-rtl"}let Vo;function Ss(){if(typeof document>"u")return 0;if(Vo!==void 0)return Vo;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(),Vo=n-r,Vo}const Yr=Symbol();function om(e){const t=f.useRef([Yr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=f.useState(e),[,i]=f.useState(),o=f.useCallback(a=>{const s=t.current[0];s!==Yr&&(a=typeof a=="function"?a(s):a,a===s)||(s!==Yr&&i({}),r(u=>typeof a=="function"?a(s===Yr?u:s):a),t.current[0]=Yr)},[]),l=f.useCallback(()=>{t.current[0]=Yr,i({})},[]);return[t.current[0]===Yr?n:t.current[0],o,l]}function id(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 am(e){const t=f.useRef(e);return yi(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const l=o.length>1;return f.createElement(Bg,{"data-testid":"GDG-default-image-overlay-editor"},f.createElement(Kg.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},o.map(a=>{const s=(i==null?void 0:i(a))??f.createElement("img",{draggable:!1,src:a});return f.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&f.createElement("button",{className:"gdg-edit-icon",onClick:r},f.createElement(Ns,null)))};function od(){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 Jr=od();function lm(e){Jr=e}const ad=/[&<>"']/,um=new RegExp(ad.source,"g"),sd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(sd.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=e=>dm[e];function Cn(e,t){if(t){if(ad.test(e))return e.replace(um,ru)}else if(sd.test(e))return e.replace(cm,ru);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ld(e){return e.replace(fm,(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 hm=/(^|[^\[])\^/g;function Nt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(hm,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(e,t,n){if(e){let r;try{r=decodeURIComponent(ld(n)).replace(gm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const $o={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){$o[" "+e]||(pm.test(e)?$o[" "+e]=e+"/":$o[" "+e]=Jo(e,"/",!0)),e=$o[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const oa={exec:function(){}};function ou(e,t){const n=e.replace(/\|/g,(o,l,a)=>{let s=!1,u=l;for(;--u>=0&&a[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 Jo(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 ym(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 au(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function su(e,t,n,r){const i=t.href,o=t.title?Cn(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:Cn(l)}}function Sm(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[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
|
4
|
-
`)}class Ws{constructor(t){this.options=t||Jr}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:Jo(r,`
|
5
|
-
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=Sm(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=Jo(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,l,a,s,u,c,d,g,h,m,p=n[1].trim();const b=p.length>1,w={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const v=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=v.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?(l=2,h=c.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,h=c.slice(l),l+=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,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),_=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;t&&(g=t.split(`
|
9
|
-
`,1)[0],d=g,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(d)||_.test(d)||O.test(d)||S.test(t)));){if(d.search(/[^ ]/)>=l||!d.trim())h+=`
|
10
|
-
`+d.slice(l);else{if(s||c.search(/[^ ]/)>=4||R.test(c)||_.test(c)||S.test(c))break;h+=`
|
11
|
-
`+d}!s&&!d.trim()&&(s=!0),r+=g+`
|
12
|
-
`,t=t.substring(g.length+1),c=d.slice(l)}}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 x=w.items.length;for(a=0;a<x;a++)if(this.lexer.state.top=!1,w.items[a].tokens=this.lexer.blockTokens(w.items[a].text,[]),!w.loose){const O=w.items[a].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(a=0;a<x;a++)w.items[a].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]):Cn(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:ou(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,l,a,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]=ou(r.rows[o],r.header.length).map(u=>({text:u}));for(i=r.header.length,l=0;l<i;l++)r.header[l].tokens=this.lexer.inline(r.header[l].text);for(i=r.rows.length,l=0;l<i;l++)for(s=r.rows[l],a=0;a<s.length;a++)s[a].tokens=this.lexer.inline(s[a].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:Cn(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]):Cn(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 l=Jo(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=ym(n[2],"()");if(l>-1){const s=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,s).trim(),n[3]=""}}let i=n[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[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)),su(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 su(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 l=i[0].length-1;let a,s,u=l,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+l);(i=d.exec(n))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=a.length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&l%3&&!((l+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);const g=t.slice(0,l+i.index+(i[0].length-a.length)+s);if(Math.min(l,s)%2){const m=g.slice(1,-1);return{type:"em",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}const h=g.slice(2,-2);return{type:"strong",raw:g,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=Cn(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=Cn(this.options.mangle?n(r[1]):r[1]),o="mailto:"+i):(i=Cn(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=Cn(this.options.mangle?n(r[0]):r[0]),o="mailto:"+i;else{let l;do l=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(l!==r[0]);i=Cn(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]):Cn(r[0]):r[0]:i=Cn(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}}}}const Ge={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:oa,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ge._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Ge._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Ge.def=Nt(Ge.def).replace("label",Ge._label).replace("title",Ge._title).getRegex();Ge.bullet=/(?:[*+-]|\d{1,9}[.)])/;Ge.listItemStart=Nt(/^( *)(bull) */).replace("bull",Ge.bullet).getRegex();Ge.list=Nt(Ge.list).replace(/bull/g,Ge.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ge.def.source+")").getRegex();Ge._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";Ge._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Ge.html=Nt(Ge.html,"i").replace("comment",Ge._comment).replace("tag",Ge._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Ge.paragraph=Nt(Ge._paragraph).replace("hr",Ge.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",Ge._tag).getRegex();Ge.blockquote=Nt(Ge.blockquote).replace("paragraph",Ge.paragraph).getRegex();Ge.normal={...Ge};Ge.gfm={...Ge.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Ge.gfm.table=Nt(Ge.gfm.table).replace("hr",Ge.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",Ge._tag).getRegex();Ge.gfm.paragraph=Nt(Ge._paragraph).replace("hr",Ge.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ge.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",Ge._tag).getRegex();Ge.pedantic={...Ge.normal,html:Nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ge._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:oa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Nt(Ge.normal._paragraph).replace("hr",Ge.hr).replace("heading",` *#{1,6} *[^
|
15
|
-
]`).replace("lheading",Ge.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Re={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:oa,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:oa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Re._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Re.punctuation=Nt(Re.punctuation).replace(/punctuation/g,Re._punctuation).getRegex();Re.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Re.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Re._comment=Nt(Ge._comment).replace("(?:-->|$)","-->").getRegex();Re.emStrong.lDelim=Nt(Re.emStrong.lDelim).replace(/punct/g,Re._punctuation).getRegex();Re.emStrong.rDelimAst=Nt(Re.emStrong.rDelimAst,"g").replace(/punct/g,Re._punctuation).getRegex();Re.emStrong.rDelimUnd=Nt(Re.emStrong.rDelimUnd,"g").replace(/punct/g,Re._punctuation).getRegex();Re._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Re._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Re._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])?)+(?![-_])/;Re.autolink=Nt(Re.autolink).replace("scheme",Re._scheme).replace("email",Re._email).getRegex();Re._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Re.tag=Nt(Re.tag).replace("comment",Re._comment).replace("attribute",Re._attribute).getRegex();Re._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Re._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Re._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Re.link=Nt(Re.link).replace("label",Re._label).replace("href",Re._href).replace("title",Re._title).getRegex();Re.reflink=Nt(Re.reflink).replace("label",Re._label).replace("ref",Ge._label).getRegex();Re.nolink=Nt(Re.nolink).replace("ref",Ge._label).getRegex();Re.reflinkSearch=Nt(Re.reflinkSearch,"g").replace("reflink",Re.reflink).replace("nolink",Re.nolink).getRegex();Re.normal={...Re};Re.pedantic={...Re.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:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Re._label).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re._label).getRegex()};Re.gfm={...Re.normal,escape:Nt(Re.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.!#$%&'*+\/=?_`{\|}~-]+@)))/};Re.gfm.url=Nt(Re.gfm.url,"i").replace("email",Re.gfm._extended_email).getRegex();Re.breaks={...Re.gfm,br:Nt(Re.br).replace("{2,}","*").getRegex(),text:Nt(Re.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function xm(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 lu(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 Lr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jr,this.options.tokenizer=this.options.tokenizer||new Ws,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:Ge.normal,inline:Re.normal};this.options.pedantic?(n.block=Ge.pedantic,n.inline=Re.pedantic):this.options.gfm&&(n.block=Ge.gfm,this.options.breaks?n.inline=Re.breaks:n.inline=Re.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ge,inline:Re}}static lex(t,n){return new Lr(n).lex(t)}static lexInline(t,n){return new Lr(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,(a,s,u)=>s+" ".repeat(u.length));let r,i,o,l;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.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 a=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&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=t.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){i=n[n.length-1],l&&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),l=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 a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}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,l=t,a,s,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+au("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,a.index+a[0].length-2)+"++"+l.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,l,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,lu)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t,lu))){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 g;this.options.extensions.startInline.forEach(function(h){g=h.call({lexer:this},d),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(r=this.tokenizer.inlineText(o,xm)){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 Us{constructor(t){this.options=t||Jr}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+Cn(i)+'">'+(r?t:Cn(t,!0))+`</code></pre>
|
27
|
-
`:"<pre><code>"+(r?t:Cn(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=iu(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=iu(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 ud{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 cd{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 Fr{constructor(t){this.options=t||Jr,this.options.renderer=this.options.renderer||new Us,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ud,this.slugger=new cd}static parse(t,n){return new Fr(n).parse(t)}static parseInline(t,n){return new Fr(n).parseInline(t)}parse(t,n=!0){let r="",i,o,l,a,s,u,c,d,g,h,m,p,b,w,v,x,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,ld(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="",a=h.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),g="",a=h.rows.length,o=0;o<a;o++){for(u=h.rows[o],c="",s=u.length,l=0;l<s;l++)c+=this.renderer.tablecell(this.parseInline(u[l].tokens),{header:!1,align:h.align[l]});g+=this.renderer.tablerow(c)}r+=this.renderer.table(d,g);continue}case"blockquote":{g=this.parse(h.tokens),r+=this.renderer.blockquote(g);continue}case"list":{for(m=h.ordered,p=h.start,b=h.loose,a=h.items.length,g="",o=0;o<a;o++)v=h.items[o],x=v.checked,O=v.task,w="",v.task&&(S=this.renderer.checkbox(x),b?v.tokens.length>0&&v.tokens[0].type==="paragraph"?(v.tokens[0].text=S+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&v.tokens[0].tokens[0].type==="text"&&(v.tokens[0].tokens[0].text=S+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:S}):w+=S),w+=this.parse(v.tokens,b),g+=this.renderer.listitem(w,O,x);r+=this.renderer.list(g,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(g=h.tokens?this.parseInline(h.tokens):h.text;i+1<_&&t[i+1].type==="text";)h=t[++i],g+=`
|
46
|
-
`+(h.tokens?this.parseInline(h.tokens):h.text);r+=n?this.renderer.paragraph(g):g;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,l;const a=t.length;for(i=0;i<a;i++){if(o=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(l=this.options.extensions.renderers[o.type].call({parser:this},o),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){r+=l||"";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 aa{constructor(t){this.options=t||Jr}preprocess(t){return t}postprocess(t){return t}}dt(aa,"passThroughHooks",new Set(["preprocess","postprocess"]));function km(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>"+Cn(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 dd(e,t){return(n,r,i)=>{typeof r=="function"&&(i=r,r=null);const o={...r};r={...Ze.defaults,...o};const l=km(r.silent,r.async,i);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(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 a=r.highlight;let s;try{r.hooks&&(n=r.hooks.preprocess(n)),s=e(n,r)}catch(d){return l(d)}const u=function(d){let g;if(!d)try{r.walkTokens&&Ze.walkTokens(s,r.walkTokens),g=t(s,r),r.hooks&&(g=r.hooks.postprocess(g))}catch(h){d=h}return r.highlight=a,d?l(d):i(null,g)};if(!a||a.length<3||(delete r.highlight,!s.length))return u();let c=0;Ze.walkTokens(s,function(d){d.type==="code"&&(c++,setTimeout(()=>{a(d.text,d.lang,function(g,h){if(g)return u(g);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(a=>e(a,r)).then(a=>r.walkTokens?Promise.all(Ze.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>t(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));const a=e(n,r);r.walkTokens&&Ze.walkTokens(a,r.walkTokens);let s=t(a,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(a){return l(a)}}}function Ze(e,t,n){return dd(Lr.lex,Fr.parse)(e,t,n)}Ze.options=Ze.setOptions=function(e){return Ze.defaults={...Ze.defaults,...e},lm(Ze.defaults),Ze};Ze.getDefaults=od;Ze.defaults=Jr;Ze.use=function(...e){const t=Ze.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const r={...n};if(r.async=Ze.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(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=o.apply(this,l)),a}: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=Ze.defaults.renderer||new Us;for(const o in n.renderer){const l=i[o];i[o]=(...a)=>{let s=n.renderer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.renderer=i}if(n.tokenizer){const i=Ze.defaults.tokenizer||new Ws;for(const o in n.tokenizer){const l=i[o];i[o]=(...a)=>{let s=n.tokenizer[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.tokenizer=i}if(n.hooks){const i=Ze.defaults.hooks||new aa;for(const o in n.hooks){const l=i[o];aa.passThroughHooks.has(o)?i[o]=a=>{if(Ze.defaults.async)return Promise.resolve(n.hooks[o].call(i,a)).then(u=>l.call(i,u));const s=n.hooks[o].call(i,a);return l.call(i,s)}:i[o]=(...a)=>{let s=n.hooks[o].apply(i,a);return s===!1&&(s=l.apply(i,a)),s}}r.hooks=i}if(n.walkTokens){const i=Ze.defaults.walkTokens;r.walkTokens=function(o){let l=[];return l.push(n.walkTokens.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}Ze.setOptions(r)})};Ze.walkTokens=function(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(Ze,r)),r.type){case"table":{for(const i of r.header)n=n.concat(Ze.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(Ze.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ze.walkTokens(r.items,t));break}default:Ze.defaults.extensions&&Ze.defaults.extensions.childTokens&&Ze.defaults.extensions.childTokens[r.type]?Ze.defaults.extensions.childTokens[r.type].forEach(function(i){n=n.concat(Ze.walkTokens(r[i],t))}):r.tokens&&(n=n.concat(Ze.walkTokens(r.tokens,t)))}return n};Ze.parseInline=dd(Lr.lexInline,Fr.parseInline);Ze.Parser=Fr;Ze.parser=Fr.parse;Ze.Renderer=Us;Ze.TextRenderer=ud;Ze.Lexer=Lr;Ze.lexer=Lr.lex;Ze.Tokenizer=Ws;Ze.Slugger=cd;Ze.Hooks=aa;Ze.parse=Ze;Ze.options;Ze.setOptions;Ze.use;Ze.walkTokens;Ze.parseInline;Fr.parse;Lr.lex;const Mm=vn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class Rm extends Ut.PureComponent{constructor(){super(...arguments);dt(this,"targetElement",null);dt(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,l=Ze(i),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=o==null?void 0:o(l);if(s===void 0){const c=document.createElement("template");c.innerHTML=l,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(),Ut.createElement(Mm,{ref:this.containerRefHook})}}const Em=vn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),Im=vn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),Tm=vn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let uu=0;const Qr=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:i,altNewline:o,validatedSelection:l,...a}=e,{onChange:s,className:u}=a,c=f.useRef(null),d=n??"";An(s!==void 0,"GrowingEntry must be a controlled input area");const[g]=f.useState(()=>"input-box-"+(uu=(uu+1)%1e7));f.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(i?0:p,p)},[]),f.useLayoutEffect(()=>{var m;if(l!==void 0){const p=typeof l=="number"?[l,null]:l;(m=c.current)==null||m.setSelectionRange(p[0],p[1])}},[l]);const h=f.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||r==null||r(m)},[o,r]);return f.createElement(Tm,{className:"gdg-growing-entry"},f.createElement(Im,{className:u},d+`
|
48
|
-
`),f.createElement(Em,{...a,className:(u??"")+" gdg-input",id:g,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},Ja={};let Ir=null;function Dm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function sa(e){const t=e.toLowerCase().trim();if(Ja[t]!==void 0)return Ja[t];Ir=Ir||Dm(),Ir.style.color="#000",Ir.style.color=t;const n=getComputedStyle(Ir).color;Ir.style.color="#fff",Ir.style.color=t;const r=getComputedStyle(Ir).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),Ja[t]=i,i}function Kr(e,t){const[n,r,i]=sa(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const cu=new Map;function du(e,t){const n=`${e}-${t}`,r=cu.get(n);if(r!==void 0)return r;const i=Hn(e,t);return cu.set(n,i),i}function Hn(e,t){if(t===void 0)return e;const[n,r,i,o]=sa(e);if(o===1)return e;const[l,a,s,u]=sa(t),c=o+u*(1-o),d=(o*n+u*l*(1-o))/c,g=(o*r+u*a*(1-o))/c,h=(o*i+u*s*(1-o))/c;return`rgba(${d}, ${g}, ${h}, ${c})`}var mi=new Map,vi=new Map,xs=new Map;function Om(){mi.clear(),xs.clear(),vi.clear()}function Pm(e,t,n,r,i){var o,l,a;let s=0,u={};for(let d of e)s+=(o=n.get(d))!=null?o:i,u[d]=((l=u[d])!=null?l:0)+1;let c=t-s;for(let d of Object.keys(u)){let g=u[d],h=(a=n.get(d))!=null?a:i,m=h*g/s,p=c*m*r/g,b=h+p;n.set(d,b)}}function _m(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,l=3,a=(t/o+l)/(l+1),s=r.keys();for(let u of s)r.set(u,((n=r.get(u))!=null?n:o)*a);return r}function eo(e,t,n,r){var i,o;let l=vi.get(n);if(r&&l!==void 0&&l.count>2e4){let u=xs.get(n);if(u===void 0&&(u=_m(e,l.size),xs.set(n,u)),l.count>5e5){let d=0;for(let g of t)d+=(i=u.get(g))!=null?i:l.size;return d*1.01}let c=e.measureText(t);return Pm(t,c.width,u,Math.max(.05,1-l.count/2e5),l.size),vi.set(n,{count:l.count+t.length,size:l.size}),c.width}let a=e.measureText(t),s=a.width/t.length;if(((o=l==null?void 0:l.count)!=null?o:0)>2e4)return a.width;if(l===void 0)vi.set(n,{count:t.length,size:s});else{let u=s-l.size,c=t.length/(l.count+t.length),d=l.size+u*c;vi.set(n,{count:l.count+t.length,size:d})}return a.width}function Lm(e,t,n,r,i,o,l,a){if(t.length<=1)return t.length;if(i<n)return-1;let s=Math.floor(n/i*o),u=eo(e,t.slice(0,Math.max(0,s)),r,l);if(u!==n)if(u<n){for(;u<n;)s++,u=eo(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;u>n;){let c=t.lastIndexOf(" ",s-1);c>0?s=c:s--,u=eo(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let c=0;c=t.lastIndexOf(" ",s),c>0&&(s=c)}return s}function Fm(e,t,n,r,i,o){let l=`${t}_${n}_${r}px`,a=mi.get(l);if(a!==void 0)return a;if(r<=0)return[];let s=[],u=t.split(`
|
49
|
-
`),c=vi.get(n),d=c===void 0?t.length:r/c.size*1.5,g=i&&c!==void 0&&c.count>2e4;for(let h of u){let m=eo(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d);if(m<=r)s.push(h);else{for(;m>r;){let b=Lm(e,h,r,n,m,p,g),w=h.slice(0,Math.max(0,b));h=h.slice(w.length),s.push(w),m=eo(e,h.slice(0,Math.max(0,d)),n,g),p=Math.min(h.length,d)}m>0&&s.push(h)}}return s=s.map((h,m)=>m===0?h.trimEnd():h.trim()),mi.set(l,s),mi.size>500&&mi.delete(mi.keys().next().value),s}function Am(e,t){return Ut.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 Hm(e,t){const[n,r]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(r))return!0;if(e.current!==void 0){if(to(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 ao(e,t){return(e??"")===(t??"")}function zm(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 fd(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function to(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 hd(e){return[e.x+e.width-1,e.y+e.height-1]}function fu(e,t,n){const r=n.x,i=n.x+n.width-1,o=n.y,l=n.y+n.height-1,[a,s]=e;if(s<o||s>l)return!1;if(t.span===void 0)return a>=r&&a<=i;const[u,c]=t.span;return u>=r&&u<=i||c>=r&&u<=i||u<r&&c>i}function Vm(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)&&fu(e,t,o)&&i++;for(const l of n.current.rangeStack)fu(e,t,l)&&i++;return i}function gd(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,l)=>({...o,sticky:e[l].sticky})),n=r}return n}function Ci(e,t){let n=0;const r=gd(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 ei(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 ks(e,t,n,r,i){const o=gd(e,r),l=[];for(const u of o)if(u.sticky)l.push(u);else break;if(l.length>0)for(const u of l)n-=u.width;let a=t,s=i??0;for(;s<=n&&a<o.length;)s+=o[a].width,a++;for(let u=t;u<a;u++){const c=o[u];c.sticky||l.push(c)}return l}function $m(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 Nm(e,t,n,r,i,o,l,a,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,b=typeof l=="number"?l:l(p);if(d-=b,e>=d)return p}const g=o-u,h=e-(s??0);if(typeof l=="number"){const m=Math.floor((h-c)/l)+a;return m>=g?void 0:m}else{let m=c;for(let p=a;p<g;p++){const b=l(p);if(h<=m+b)return p;m+=b}return}}let Qo=0,no={};const Bm=typeof window>"u";async function Wm(){var e;Bm||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,Qo=0,no={},Om())}Wm();function md(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function ti(e,t,n,r="middle"){const i=md(e,t,r,n);let o=no[i];return o===void 0&&(o=t.measureText(e),no[i]=o,Qo++),Qo>1e4&&(no={},Qo=0),o}function pd(e,t){const n=md(e,void 0,"middle",t);return no[n]}function cr(e,t){return typeof t!="string"&&(t=t.baseFontFull),Um(e,t)}function hu(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const r=e.measureText(n);return e.restore(),r}const gu=[];function Um(e,t){for(const o of gu)if(o.key===t)return o.val;const n=hu(e,"alphabetic"),i=-(hu(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return gu.push({key:t,val:i}),i}function qm(e,t,n,r,i,o){const{ctx:l,rect:a,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;l.globalAlpha=d,l.fillStyle=s.bgSearchResult,l.fillRect(a.x+1,a.y+1,a.width-(i?2:1),a.height-(o?2:1)),l.globalAlpha=1,r!==void 0&&(r.fillStyle=s.bgSearchResult)}return u<c}function go(e,t,n){const{ctx:r,theme:i}=e,o=t??{},l=n??i.textDark;return l!==o.fillStyle&&(r.fillStyle=l,o.fillStyle=l),o}function qs(e,t,n,r,i){const{rect:o,ctx:l,theme:a}=e;l.fillStyle=a.textDark,lr({ctx:l,rect:o,theme:a},t,n,r,i)}function vd(e,t,n,r,i,o,l,a,s){s==="right"?e.fillText(t,n+i-(a.cellHorizontalPadding+.5),r+o/2+l):s==="center"?e.fillText(t,n+i/2,r+o/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+o/2+l)}function Ys(e,t){const n=ti("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Ym(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 Xm(e,t,n,r,i,o,l,a,s,u){const c=a.baseFontFull,d=Fm(e,t,c,i-a.cellHorizontalPadding*2,u??!1),g=Ys(e,c),h=a.lineHeight*g,m=g+h*(d.length-1),p=m+a.cellVerticalPadding>o;p&&(e.save(),e.rect(n,r,i,o),e.clip());const b=r+o/2-m/2;let w=Math.max(r+a.cellVerticalPadding,b);for(const v of d)if(vd(e,v,n,w,i,g,l,a,s),w+=h,w>r+o)break;p&&e.restore()}function lr(e,t,n,r,i){const{ctx:o,rect:l,theme:a}=e,{x:s,y:u,width:c,height:d}=l;r=r??!1,r||(t=Ym(t,c));const g=cr(o,a),h=Bs(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?Xm(o,t,s,u,c,d,g,a,n,i):vd(o,t,s,u,c,d,g,a,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 Gm(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 jm(e,t,n){const r=function(a,s){const u=s.x-a.x,c=s.y-a.y,d=Math.sqrt(u*u+c*c),g=u/d,h=c/d;return{x:u,y:s.y-a.y,len:d,nx:g,ny:h,ang:Math.atan2(h,g)}};let i;const o=t.length;let l=t[o-1];for(let a=0;a<o;a++){let s=t[a%o];const u=t[(a+1)%o],c=r(s,l),d=r(s,u),g=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(g<-1?-1:g>1?1:g),p=1,b=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,b=!0):m>0&&(p=-1,b=!0),i=s.radius!==void 0?s.radius:n;const w=m/2;let v=Math.abs(Math.cos(w)*i/Math.sin(w)),x;v>Math.min(c.len/2,d.len/2)?(v=Math.min(c.len/2,d.len/2),x=Math.abs(v*Math.sin(w)/Math.cos(w))):x=i;let O=s.x+d.nx*v,S=s.y+d.ny*v;O+=-d.ny*x*p,S+=d.nx*x*p,e.arc(O,S,x,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,b),l=s,s=u}e.closePath()}function Ms(e,t,n,r,i,o,l,a,s,u,c,d,g,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 b=o-i;if(e>=d){const w=l>e?-1:1,v=Ci(h);p.x+=v+s;for(let x=l;x!==e;x+=w)p.x+=h[w===1?x:x-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=b;else if(t===-2){p.y=0,p.height=i;let w=e;const v=h[e].group,x=h[e].sticky;for(;w>0&&ao(h[w-1].group,v)&&h[w-1].sticky===x;){const S=h[w-1];p.x-=S.width,p.width+=S.width,w--}let O=e;for(;O+1<h.length&&ao(h[O+1].group,v)&&h[O+1].sticky===x;){const S=h[O+1];p.width+=S.width,O++}if(!x){const S=Ci(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-g){let w=c-t;for(p.y=r;w>0;){const v=t+w-1;p.height=typeof m=="number"?m:m(v),p.y-=p.height,w--}p.height+=1}else{const w=a>t?-1:1;if(typeof m=="number"){const v=t-a;p.y+=v*m}else for(let v=a;v!==t;v+=w)p.y+=m(v)*w;p.height=(typeof m=="number"?m:m(t))+1}return p}const Xs=1<<21;function tr(e,t){return(t+2)*Xs+e}function bd(e){return e%Xs}function Gs(e){return Math.floor(e/Xs)-2}function js(e){const t=bd(e),n=Gs(e);return[t,n]}class wd{constructor(){dt(this,"visibleWindow",{x:0,y:0,width:0,height:0});dt(this,"freezeCols",0);dt(this,"freezeRows",[]);dt(this,"isInWindow",t=>{const n=bd(t),r=Gs(t),i=this.visibleWindow,o=n>=i.x&&n<=i.x+i.width||n<this.freezeCols,l=r>=i.y&&r<=i.y+i.height||this.freezeRows.includes(r);return o&&l})}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&&yi(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class Km extends wd{constructor(){super(...arguments);dt(this,"cache",new Map);dt(this,"setValue",(n,r)=>{this.cache.set(tr(n[0],n[1]),r)});dt(this,"getValue",n=>this.cache.get(tr(n[0],n[1])));dt(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class ro{constructor(t=[]){dt(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(Gs(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 js(t)}}function Zm(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-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--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-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--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,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...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 yd={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",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,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,checkboxMaxSize:18};function Cd(){return yd}const Sd=Ut.createContext(yd);function Jm(){return Ut.useContext(Sd)}function pr(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]=Hn(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 Rs=150;function Qm(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))??Rs}function xd(e,t,n,r,i,o,l,a,s){let u=0;const c=i===void 0?[]:i.map(h=>{const m=Qm(e,h[r],t,s);return u=Math.max(u,m),m});if(c.length>5&&a){u=0;let h=0;for(const p of c)h+=p;const m=h/c.length;for(let p=0;p<c.length;p++)c[p]>=m*2?c[p]=0:u=Math.max(u,c[p])}const d=e.font;e.font=t.headerFontFull,u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28)),e.font=d;const g=Math.max(Math.ceil(o),Math.min(Math.floor(l),Math.ceil(u)));return{...n,width:g}}function ep(e,t,n,r,i,o,l,a,s){const u=f.useRef(t),c=f.useRef(n),d=f.useRef(l);u.current=t,c.current=n,d.current=l;const[g,h]=f.useMemo(()=>{if(typeof window>"u")return[null,null];const v=document.createElement("canvas");return v.style.display="none",v.style.opacity="0",v.style.position="fixed",[v,v.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>(g&&document.documentElement.append(g),()=>{g==null||g.remove()}),[g]);const m=f.useRef({}),p=f.useRef(),[b,w]=f.useState();return f.useLayoutEffect(()=>{const v=c.current;if(v===void 0||e.every(Ao))return;let x=Math.max(1,10-Math.floor(e.length/1e4)),O=0;x<u.current&&x>1&&(x--,O=1);const S={x:0,y:0,width:e.length,height:Math.min(u.current,x)},R={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const E=v(S,s.signal),k=O>0?v(R,s.signal):void 0;let L;typeof E=="object"?L=E:L=await Hl(E),k!==void 0&&(typeof k=="object"?L=[...L,...k]:L=[...L,...await Hl(k)]),p.current=e,w(L)})()},[s.signal,e]),f.useMemo(()=>{let x=e.every(Ao)?e:h===null?e.map(_=>Ao(_)?_:{..._,width:Rs}):(h.font=d.current.baseFontFull,e.map((_,E)=>{if(Ao(_))return _;if(m.current[_.id]!==void 0)return{..._,width:m.current[_.id]};if(b===void 0||p.current!==e||_.id===void 0)return{..._,width:Rs};const k=xd(h,l,_,E,b,i,o,!0,a);return m.current[_.id]=k.width,k})),O=0,S=0;const R=[];for(const[_,E]of x.entries())O+=E.width,E.grow!==void 0&&E.grow>0&&(S+=E.grow,R.push(_));if(O<r&&R.length>0){const _=[...x],E=r-O;let k=E;for(let L=0;L<R.length;L++){const D=R[L],C=(x[D].grow??0)/S,T=L===R.length-1?k:Math.min(k,Math.floor(E*C));_[D]={...x[D],growOffset:T,width:x[D].width+T},k-=T}x=_}return{sizedColumns:x,nonGrowWidth:O}},[r,e,h,b,l,i,o,a])}var Qa,mu;function tp(){if(mu)return Qa;mu=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 Qa=e,Qa}var es,pu;function np(){if(pu)return es;pu=1;var e=tp(),t=Dc();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 es=n,es}var rp=np();const Un=br(rp);var ts,vu;function ip(){if(vu)return ts;vu=1;function e(){}return ts=e,ts}var ns,bu;function op(){if(bu)return ns;bu=1;var e=ph(),t=ip(),n=Oc(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return ns=i,ns}var rs,wu;function ap(){if(wu)return rs;wu=1;var e=vh(),t=bh(),n=yh(),r=wh(),i=op(),o=Oc(),l=200;function a(s,u,c){var d=-1,g=t,h=s.length,m=!0,p=[],b=p;if(c)m=!1,g=n;else if(h>=l){var w=u?null:i(s);if(w)return o(w);m=!1,g=r,b=new e}else b=u?[]:p;e:for(;++d<h;){var v=s[d],x=u?u(v):v;if(v=c||v!==0?v:0,m&&x===x){for(var O=b.length;O--;)if(b[O]===x)continue e;u&&b.push(x),p.push(v)}else g(b,x,c)||(b!==p&&b.push(x),p.push(v))}return p}return rs=a,rs}var is,yu;function sp(){if(yu)return is;yu=1;var e=ap();function t(n){return n&&n.length?e(n):[]}return is=t,is}var lp=sp();const up=br(lp);var cp=Ch();const Cu=br(cp),qt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',dp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
51
|
-
${qt}<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>`},fp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
52
|
-
${qt}<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>`},hp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},gp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},mp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},kd=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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
|
-
`},pp=e=>{const t=e.bgColor;return`${qt}
|
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
|
-
`},vp=kd,bp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},wp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
83
|
-
${qt}
|
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>`},yp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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
|
-
${qt}
|
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>`},Sp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
100
|
-
${qt}
|
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>`},xp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},kp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
107
|
-
${qt}
|
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>`},Mp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Rp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
116
|
-
${qt}
|
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>`},Ep=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Ip=e=>{const t=e.fgColor,n=e.bgColor;return`
|
124
|
-
${qt}
|
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>`},Tp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
128
|
-
${qt}
|
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>`},Dp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Op=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Pp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
141
|
-
${qt}
|
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>`},_p=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Lp=e=>{const t=e.fgColor,n=e.bgColor;return`
|
148
|
-
${qt}
|
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>`},Fp=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Ap=e=>{const t=e.fgColor,n=e.bgColor;return`${qt}
|
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>`},Hp=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>`},zp=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
|
-
`},Vp={headerRowID:dp,headerNumber:hp,headerCode:fp,headerString:gp,headerBoolean:mp,headerAudioUri:vp,headerVideoUri:bp,headerEmoji:wp,headerImage:yp,headerUri:kd,headerPhone:Cp,headerMarkdown:Sp,headerDate:xp,headerTime:kp,headerEmail:Mp,headerReference:Rp,headerIfThenElse:Ep,headerSingleValue:Ip,headerLookup:Tp,headerTextTemplate:Dp,headerMath:Op,headerRollup:Pp,headerJoinStrings:_p,headerSplitString:Lp,headerGeoDistance:Fp,headerArray:Ap,rowOwnerOverlay:Hp,protectedColumnOverlay:zp,renameIcon:pp};function $p(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Np{constructor(t,n){dt(this,"onSettled");dt(this,"spriteMap",new Map);dt(this,"headerIcons");dt(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,i,o,l,a,s=1){const[u,c]=$p(n,a),d=l*Math.ceil(window.devicePixelRatio),g=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(g);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 b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(g,h);const w=b.decode();if(w===void 0)return;this.inFlight++,w.then(()=>{p.drawImage(b,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,l,l),s<1&&(r.globalAlpha=1)}}function Md(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Sa(e,t,n,r,i,o,l,a,s){a=a??t;let u=t,c=e;const d=r-o;let g=!1;for(;u<n&&c<d;){const h=i(c);if(u+h>a&&s(u,c,h,!1,l&&c===r-1)===!0){g=!0;break}u+=h,c++}if(!g){u=n;for(let h=0;h<o;h++){c=r-1-h;const m=i(c);u-=m,s(u,c,m,!0,l&&c===r-1)}}}function Ar(e,t,n,r,i,o){let l=0,a=0;const s=i+r;for(const u of e){const c=u.sticky?a:l+n;if(o(u,c,s,u.sticky?0:a,t)===!0)break;l+=u.width,a+=u.sticky?u.width:0}}function Rd(e,t,n,r,i){let o=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let u=a+1,c=s.width;for(s.sticky&&(l+=c);u<e.length&&ao(e[u].group,s.group)&&e[u].sticky===e[a].sticky;){const p=e[u];c+=p.width,u++,a++,p.sticky&&(l+=p.width)}const d=s.sticky?0:n,g=o+d,h=s.sticky?0:Math.max(0,l-g),m=Math.min(c-h,t-(g+h));i([s.sourceIndex,e[u-1].sourceIndex],s.group??"",g+h,0,m,r),o+=c}}function Ed(e,t,n,r,i,o,l){var g;const[a,s]=e;let u,c;const d=((g=l.find(h=>!h.sticky))==null?void 0:g.sourceIndex)??0;if(s>d){const h=Math.max(a,d);let m=t,p=r;for(let b=o.sourceIndex-1;b>=h;b--)m-=l[b].width,p+=l[b].width;for(let b=o.sourceIndex+1;b<=s;b++)p+=l[b].width;c={x:m,y:n,width:p,height:i}}if(d>a){const h=Math.min(s,d-1);let m=t,p=r;for(let b=o.sourceIndex-1;b>=a;b--)m-=l[b].width,p+=l[b].width;for(let b=o.sourceIndex+1;b<=h;b++)p+=l[b].width;u={x:m,y:n,width:p,height:i}}return[u,c]}function Bp(e,t,n,r){if(r==="any")return Id(e,{x:t,y:n,width:1,height:1});if(r==="vertical"&&(t=e.x),r==="horizontal"&&(n=e.y),fd([t,n],e))return;const i=t-e.x,o=e.x+e.width-t,l=n-e.y+1,a=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:l,r==="horizontal"?Number.MAX_SAFE_INTEGER:a);return s===a?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:s===l?{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 so(e,t,n,r,i,o,l,a){return e<=i+l&&i<=e+n&&t<=o+a&&o<=t+r}function jr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Id(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 Wp(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 Up(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,l=t+4,a=n+4,s=i-e.x,u=e.x+e.width-l,c=o-e.y,d=e.y+e.height-a,g=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:g,y:m,width:h-g,height:p-m}}function qp(e,t,n,r,i){const[o,l,a,s]=t,[u,c,d,g]=i,{x:h,y:m,width:p,height:b}=e,w=[];if(p<=0||b<=0)return w;const v=h+p,x=m+b,O=h<o,S=m<l,R=h+p>a,_=m+b>s,E=h>=o&&h<a||v>o&&v<=a||h<o&&v>a,k=m>=l&&m<s||x>l&&x<=s||m<l&&x>s;if(E&&k){const D=Math.max(h,o),C=Math.max(m,l),T=Math.min(v,a),I=Math.min(x,s);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:u,y:c,width:d-u+1,height:g-c+1}})}if(O&&S){const D=h,C=m,T=Math.min(v,o),I=Math.min(x,l);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:0,y:0,width:u+1,height:c+1}})}if(S&&E){const D=Math.max(h,o),C=m,T=Math.min(v,a),I=Math.min(x,l);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(S&&R){const D=Math.max(h,a),C=m,T=v,I=Math.min(x,l);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(O&&k){const D=h,C=Math.max(m,l),T=Math.min(v,o),I=Math.min(x,s);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:0,y:c,width:u+1,height:g-c+1}})}if(R&&k){const D=Math.max(h,a),C=Math.max(m,l),T=v,I=Math.min(x,s);w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:d,y:c,width:n-d+1,height:g-c+1}})}if(O&&_){const D=h,C=Math.max(m,s),T=Math.min(v,o),I=x;w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:0,y:g,width:u+1,height:r-g+1}})}if(_&&E){const D=Math.max(h,o),C=Math.max(m,s),T=Math.min(v,a),I=x;w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:u,y:g,width:d-u+1,height:r-g+1}})}if(R&&_){const D=Math.max(h,a),C=Math.max(m,s),T=v,I=x;w.push({rect:{x:D,y:C,width:T-D,height:I-C},clip:{x:d,y:g,width:n-d+1,height:r-g+1}})}return w}const Yp={kind:ee.Loading,allowOverlay:!1};function Su(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w,v,x,O,S,R,_,E,k,L,D,C,T,I,M,z,N,X){let ne=(x==null?void 0:x.size)??Number.MAX_SAFE_INTEGER;const G=performance.now();let J=T.baseFontFull;e.font=J;const le={ctx:e},ie=[0,0],se=b>0?ei(s,b,u):0;let Me,te;const H=Md(v);return Ar(t,a,o,l,i,(P,B,ce,De,Je)=>{const be=Math.max(0,De-B),Ce=B+be,Te=i+1,yt=P.width-be,gt=r-i-1;if(v.length>0){let ze=!1;for(let _e=0;_e<v.length;_e++){const tt=v[_e];if(so(Ce,Te,yt,gt,tt.x,tt.y,tt.width,tt.height)){ze=!0;break}}if(!ze)return}const rt=()=>{e.save(),e.beginPath(),e.rect(Ce,Te,yt,gt),e.clip()},ae=O.columns.hasIndex(P.sourceIndex),Fe=d(P.group??"").overrideTheme,he=P.themeOverride===void 0&&Fe===void 0?T:pr(T,Fe,P.themeOverride),de=he.baseFontFull;de!==J&&(J=de,e.font=de),rt();let ge;return Sa(Je,ce,r,s,u,b,w,H,(ze,_e,tt,pe,ue)=>{var hn,gn,bn;if(_e<0||(ie[0]=P.sourceIndex,ie[1]=_e,x!==void 0&&!x.has(ie)))return;if(v.length>0){let at=!1;for(let Xt=0;Xt<v.length;Xt++){const Ot=v[Xt];if(so(B,ze,P.width,tt,Ot.x,Ot.y,Ot.width,Ot.height)){at=!0;break}}if(!at)return}const it=O.rows.hasIndex(_e),He=h.hasIndex(_e),et=_e<s?c(ie):Yp;let bt=B,mt=P.width,Ve=!1,Dt=!1;if(et.span!==void 0){const[at,Xt]=et.span,Ot=`${_e},${at},${Xt},${P.sticky}`;if(te===void 0&&(te=new Set),te.has(Ot)){ne--;return}else{const rn=Ed(et.span,B,ze,P.width,tt,P,n),Tt=P.sticky?rn[0]:rn[1];if(!P.sticky&&rn[0]!==void 0&&(Dt=!0),Tt!==void 0){bt=Tt.x,mt=Tt.width,te.add(Ot),e.restore(),ge=void 0,e.save(),e.beginPath();const Ft=Math.max(0,De-Tt.x);e.rect(Tt.x+Ft,ze,Tt.width-Ft,tt),Me===void 0&&(Me=[]),Me.push({x:Tt.x+Ft,y:ze,width:Tt.width-Ft,height:tt}),e.clip(),Ve=!0}}}const Yt=g==null?void 0:g(_e),kt=ue&&((hn=P.trailingRowOptions)==null?void 0:hn.themeOverride)!==void 0?(gn=P.trailingRowOptions)==null?void 0:gn.themeOverride:void 0,_t=et.themeOverride===void 0&&Yt===void 0&&kt===void 0?he:pr(he,Yt,kt,et.themeOverride);e.beginPath();const nn=zm(ie,et,O);let Ht=Vm(ie,et,O,p);const ln=et.span!==void 0&&O.columns.some(at=>et.span!==void 0&&at>=et.span[0]&&at<=et.span[1]);nn&&!m&&p?Ht=0:nn&&p&&(Ht=Math.max(Ht,1)),ln&&Ht++,nn||(it&&Ht++,ae&&!ue&&Ht++);const It=et.kind===ee.Protected?_t.bgCellMedium:_t.bgCell;let Ct;if((pe||It!==T.bgCell)&&(Ct=Hn(It,Ct)),Ht>0||He){He&&(Ct=Hn(_t.bgHeader,Ct));for(let at=0;at<Ht;at++)Ct=Hn(_t.accentLight,Ct)}else if(S!==void 0){for(const at of S)if(at[0]===P.sourceIndex&&at[1]===_e){Ct=Hn(_t.bgSearchResult,Ct);break}}if(R!==void 0)for(let at=0;at<R.length;at++){const Xt=R[at],Ot=Xt.range;Xt.style!=="solid-outline"&&Ot.x<=P.sourceIndex&&P.sourceIndex<Ot.x+Ot.width&&Ot.y<=_e&&_e<Ot.y+Ot.height&&(Ct=Hn(Xt.color,Ct))}let On=!1;if(x!==void 0){const at=ze+1,Ot=(pe?at+tt-1:Math.min(at+tt-1,r-se))-at;(Ot!==tt-1||bt+1<=De)&&(On=!0,e.save(),e.beginPath(),e.rect(bt+1,at,mt-1,Ot),e.clip()),Ct=Ct===void 0?_t.bgCell:Hn(Ct,_t.bgCell)}const Sn=P.sourceIndex===n.length-1,Pe=_e===s-1;Ct!==void 0&&(e.fillStyle=Ct,ge!==void 0&&(ge.fillStyle=Ct),x!==void 0?e.fillRect(bt+1,ze+1,mt-(Sn?2:1),tt-(Pe?2:1)):e.fillRect(bt,ze,mt,tt)),et.style==="faded"&&(e.globalAlpha=.6);let Lt;for(let at=0;at<k.length;at++){const Xt=k[at];if(Xt.item[0]===P.sourceIndex&&Xt.item[1]===_e){Lt=Xt;break}}if(mt>X&&!Dt){const at=_t.baseFontFull;at!==J&&(e.font=at,J=at),ge=Td(e,et,P.sourceIndex,_e,Sn,Pe,bt,ze,mt,tt,Ht>0,_t,Ct??_t.bgCell,_,E,(Lt==null?void 0:Lt.hoverAmount)??0,L,C,G,D,ge,I,M,z,N)}return On&&e.restore(),et.style==="faded"&&(e.globalAlpha=1),ne--,Ve&&(e.restore(),(bn=ge==null?void 0:ge.deprep)==null||bn.call(ge,le),ge=void 0,rt(),J=de,e.font=de),ne<=0}),e.restore(),ne<=0}),Me}const qi=[0,0],Yi={x:0,y:0,width:0,height:0},os=[void 0,()=>{}];let Es=!1;function Xp(){Es=!0}function Td(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w,v,x,O,S,R,_,E){var M,z;let k,L;b!==void 0&&b[0][0]===n&&b[0][1]===r&&(k=b[1][0],L=b[1][1]);let D;qi[0]=n,qi[1]=r,Yi.x=l,Yi.y=a,Yi.width=s,Yi.height=u,os[0]=R.getValue(qi),os[1]=N=>R.setValue(qi,N),Es=!1;const C={ctx:e,theme:d,col:n,row:r,cell:t,rect:Yi,highlighted:c,cellFillColor:g,hoverAmount:p,frameTime:v,hoverX:k,drawState:os,hoverY:L,imageLoader:h,spriteManager:m,hyperWrapping:w,overrideCursor:k!==void 0?E:void 0,requestAnimationFrame:Xp},T=qm(C,t.lastUpdated,v,O,i,o),I=_(t);if(I!==void 0){(O==null?void 0:O.renderer)!==I&&((M=O==null?void 0:O.deprep)==null||M.call(O,C),O=void 0);const N=(z=I.drawPrep)==null?void 0:z.call(I,C,O);x!==void 0&&!pi(C.cell)?x(C,()=>I.draw(C,t)):I.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:I}}return(T||Es)&&(S==null||S(qi)),D}function Ks(e,t,n,r,i,o,l,a,s=-20,u=-20,c=void 0,d="center",g="square"){const h=Math.floor(i+l/2),m=g==="circle"?1e4:t.roundingRadius??4;let p=nd(c??t.checkboxMaxSize,l,t.cellVerticalPadding),b=p/2;const w=td(d,r,o,t.cellHorizontalPadding,p),v=ed(w,h,p),x=rd(r+s,i+u,v);switch(n){case!0:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),g==="circle"&&(b*=.8,p*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(w-b+p/4.23,h-b+p/1.97),e.lineTo(w-b+p/2.42,h-b+p/1.44),e.lineTo(w-b+p/1.29,h-b+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case ra:case!1:{e.beginPath(),ur(e,w-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break}case zs:{e.beginPath(),ur(e,w-p/2,h-p/2,p,p,m),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),g==="circle"&&(b*=.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:oo()}}function Gp(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w,v){var k,L,D,C;const x=l+a;if(x<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,i,x);const O=(k=r==null?void 0:r[0])==null?void 0:k[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,Ar(t,0,o,0,x,(T,I,M,z)=>{var P;if(b!==void 0&&!b.has([T.sourceIndex,-1]))return;const N=Math.max(0,z-I);e.save(),e.beginPath(),e.rect(I+N,a,T.width-N,l),e.clip();const X=p(T.group??"").overrideTheme,ne=T.themeOverride===void 0&&X===void 0?d:pr(d,X,T.themeOverride);ne.bgHeader!==d.bgHeader&&(e.fillStyle=ne.bgHeader,e.fill()),ne!==d&&(e.font=ne.headerFontFull);const G=c.columns.hasIndex(T.sourceIndex),J=s!==void 0||u||T.headerRowMarkerDisabled===!0,le=!J&&S===-1&&O===T.sourceIndex,ie=J?0:((P=h.find(B=>B.item[0]===T.sourceIndex&&B.item[1]===-1))==null?void 0:P.hoverAmount)??0,se=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===T.sourceIndex,Me=G?ne.accentColor:se?ne.bgHeaderHasFocus:ne.bgHeader,te=n?a:0,H=T.sourceIndex===0?0:1;G?(e.fillStyle=Me,e.fillRect(I+H,te,T.width-H,l)):(se||ie>0)&&(e.beginPath(),e.rect(I+H,te,T.width-H,l),se&&(e.fillStyle=ne.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=ne.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Pd(e,I,te,T.width,l,T,G,ne,le,le?R:void 0,le?_:void 0,se,ie,g,w,v),e.restore()}),n&&jp(e,t,i,o,a,r,d,g,h,m,p,b)}function jp(e,t,n,r,i,o,l,a,s,u,c,d){const[h,m]=(o==null?void 0:o[0])??[];let p=0;Rd(t,n,r,i,(b,w,v,x,O,S)=>{if(d!==void 0&&!d.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(v,x,O,S),e.clip();const R=c(w),_=(R==null?void 0:R.overrideTheme)===void 0?l:pr(l,R.overrideTheme),E=m===-2&&h!==void 0&&h>=b[0]&&h<=b[1],k=E?_.bgGroupHeaderHovered??_.bgHeaderHovered:_.bgGroupHeader??_.bgHeader;if(k!==l.bgHeader&&(e.fillStyle=k,e.fill()),e.fillStyle=_.textGroupHeader??_.textHeader,R!==void 0){let L=v;if(R.icon!==void 0&&(a.drawSprite(R.icon,"normal",e,L+8,(i-20)/2,20,_),L+=26),e.fillText(R.name,L+8,i/2+cr(e,l.headerFontFull)),R.actions!==void 0&&E){const D=Dd({x:v,y:x,width:O,height:S},R.actions);e.beginPath();const C=D[0].x-10,T=v+O-C;e.rect(C,0,T,i);const I=e.createLinearGradient(C,0,C+T,0),M=Kr(k,0);I.addColorStop(0,M),I.addColorStop(10/T,k),I.addColorStop(1,k),e.fillStyle=I,e.fill(),e.globalAlpha=.6;const[z,N]=(o==null?void 0:o[1])??[-1,-1];for(let X=0;X<R.actions.length;X++){const ne=R.actions[X],G=D[X],J=jr(G,z+v,N);J&&(e.globalAlpha=1),a.drawSprite(ne.icon,"normal",e,G.x+G.width/2-10,G.y+G.height/2-10,20,_),J&&(e.globalAlpha=.6)}e.globalAlpha=1}}v!==0&&u(b[0])&&(e.beginPath(),e.moveTo(v+.5,0),e.lineTo(v+.5,i),e.strokeStyle=l.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=v+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=l.borderColor,e.lineWidth=1,e.stroke()}const No=30;function Kp(e,t,n,r,i){return{x:e+n-No,y:Math.max(t,t+r/2-No/2),width:No,height:Math.min(No,r)}}function Dd(e,t){const n=[];let r=e.x+e.width-26*t.length;const i=e.y+e.height/2-13,o=26,l=26;for(let a=0;a<t.length;a++)n.push({x:r,y:i,width:l,height:o}),r+=26;return n}function Xi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function Od(e,t,n,r,i,o,l,a){var w;const s=l.cellHorizontalPadding,u=l.headerIconSize,c=Kp(n,r,i,o);let d=n+s;const g=t.icon===void 0?void 0:{x:d,y:r+(o-u)/2,width:u,height:u},h=g===void 0||t.overlayIcon===void 0?void 0:{x:g.x+9,y:g.y+6,width:18,height:18};g!==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 v=e===void 0?((w=pd(t.title,l.headerFontFull))==null?void 0:w.width)??0:ti(t.title,e,l.headerFontFull).width;m.width=v,d+=v+s,p={x:d,y:r+(o-u)/2,width:u,height:u}}const b=n+i/2;return{menuBounds:Xi(c,b,a),iconBounds:Xi(g,b,a),iconOverlayBounds:Xi(h,b,a),textBounds:Xi(m,b,a),indicatorIconBounds:Xi(p,b,a)}}function xu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const v=o.rowMarkerChecked;v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const x=o.headerRowMarkerTheme!==void 0?pr(a,o.headerRowMarkerTheme):a;Ks(e,x,v,t,n,r,i,!1,void 0,void 0,a.checkboxMaxSize,"center",o.rowMarker),v!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=l?a.textHeaderSelected:a.textHeader,w=o.hasMenu===!0&&(s||h&&l)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let v=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.icon,v,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,a),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&g.drawSprite(o.overlayIcon,l?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,a)}if(w&&r>35){const x=m?35:r-35,O=m?35*.7:r-35*.7,S=x/r,R=O/r,_=e.createLinearGradient(t,0,t+r,0),E=Kr(b,0);_.addColorStop(m?1:0,b),_.addColorStop(S,b),_.addColorStop(R,E),_.addColorStop(m?0:1,E),e.fillStyle=_}else e.fillStyle=b;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+i/2+cr(e,a.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!w||!so(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 v=l?"selected":"normal";o.style==="highlight"&&(v=l?"selected":"special"),g.drawSprite(o.indicatorIcon,v,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,a)}if(w&&p.menuBounds!==void 0){const v=p.menuBounds,x=u!==void 0&&c!==void 0&&jr(v,u+t,c+n);if(x||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===ia.Triangle){e.beginPath();const O=v.x+v.width/2-5.5,S=v.y+v.height/2-3;jm(e,[{x:O,y:S},{x:O+11,y:S},{x:O+5.5,y:S+6}],1),e.fillStyle=b,e.fill()}else if(o.menuIcon===ia.Dots){e.beginPath();const O=v.x+v.width/2,S=v.y+v.height/2;Gm(e,O,S),e.fillStyle=b,e.fill()}else{const O=v.x+(v.width-a.headerIconSize)/2,S=v.y+(v.height-a.headerIconSize)/2;g.drawSprite(o.menuIcon,"normal",e,O,S,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function Pd(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p){const b=Bs(o.title)==="rtl",w=Od(e,o,t,n,r,i,a,b);m!==void 0?m({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:i},column:o,columnIndex:o.sourceIndex,isSelected:l,hoverAmount:g,isHovered:s,hasSelectedCell:d,spriteManager:h,menuBounds:(w==null?void 0:w.menuBounds)??{x:0,y:0,height:0,width:0},hoverX:u,hoverY:c},()=>xu(e,t,n,r,i,o,l,a,s,u,c,g,h,p,b,w)):xu(e,t,n,r,i,o,l,a,s,u,c,g,h,p,b,w)}function Zp(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w,v){if(w!==void 0||t[t.length-1]!==n[t.length-1])return;const x=Md(b);Ar(t,s,l,a,o,(O,S,R,_,E)=>{if(O!==t[t.length-1])return;S+=O.width;const k=Math.max(S,_);k>r||(e.save(),e.beginPath(),e.rect(k,o+1,1e4,i-o-1),e.clip(),Sa(E,R,i,u,c,m,p,x,(L,D,C,T)=>{if(!T&&b.length>0&&!b.some(X=>so(S,L,1e4,C,X.x,X.y,X.width,X.height)))return;const I=g.hasIndex(D),M=h.hasIndex(D);e.beginPath();const z=d==null?void 0:d(D),N=z===void 0?v:pr(v,z);N.bgCell!==v.bgCell&&(e.fillStyle=N.bgCell,e.fillRect(S,L,1e4,C)),M&&(e.fillStyle=N.bgHeader,e.fillRect(S,L,1e4,C)),I&&(e.fillStyle=N.accentLight,e.fillRect(S,L,1e4,C))}),e.restore())})}function Jp(e,t,n,r,i,o,l,a,s){let u=!1;for(const m of t)if(!m.sticky){u=l(m.sourceIndex);break}const c=s.horizontalBorderColor??s.borderColor,d=s.borderColor,g=u?Ci(t):0;let h;if(g!==0&&(h=du(d,s.bgCell),e.beginPath(),e.moveTo(g+.5,0),e.lineTo(g+.5,r),e.strokeStyle=h,e.stroke()),i>0){const m=d===c&&h!==void 0?h:du(c,s.bgCell),p=ei(o,i,a);e.beginPath(),e.moveTo(0,r-p+.5),e.lineTo(n,r-p+.5),e.strokeStyle=m,e.stroke()}}const _d=(e,t,n)=>{let r=0,i=t,o=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),i=Math.max(i,a.x+a.width+1),o=Math.min(o,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:i,minY:o,maxY:l}};function Qp(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m){var C;const p=m.bgCell,{minX:b,maxX:w,minY:v,maxY:x}=_d(a,o,l),O=[],S=l-ei(h,g,u);let R=s,_=n,E=0;for(;R+i<S;){const T=R+i,I=u(_);if(T>=v&&T<=x-1){const M=c==null?void 0:c(_),z=M==null?void 0:M.bgCell;z!==void 0&&z!==p&&_>=h-g&&O.push({x:b,y:T,w:w-b,h:I,color:z})}R+=I,_<h-g&&(E=R),_++}let k=0;const L=Math.min(S,x)-E;if(L>0)for(let T=0;T<t.length;T++){const I=t[T];if(I.width===0)continue;const M=I.sticky?k:k+r,z=(C=I.themeOverride)==null?void 0:C.bgCell;z!==void 0&&z!==p&&M>=b&&M<=w&&d(T+1)&&O.push({x:M,y:E,w:I.width,h:L,color:z}),k+=I.width}if(O.length===0)return;let D;e.beginPath();for(let T=O.length-1;T>=0;T--){const I=O[T];D===void 0?D=I.color:I.color!==D&&(e.fillStyle=D,e.fill(),e.beginPath(),D=I.color),e.rect(I.x,I.y,I.w,I.h)}D!==void 0&&(e.fillStyle=D,e.fill()),e.beginPath()}function ku(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,l);for(const C of s)e.rect(C.x+1,C.y+1,C.width-1,C.height-1);e.clip("evenodd")}const v=b.horizontalBorderColor??b.borderColor,x=b.borderColor,{minX:O,maxX:S,minY:R,maxY:_}=_d(a,o,l),E=[];e.beginPath();let k=.5;for(let C=0;C<t.length;C++){const T=t[C];if(T.width===0)continue;k+=T.width;const I=T.sticky?k:k+r;I>=O&&I<=S&&h(C+1)&&E.push({x1:I,y1:Math.max(u,R),x2:I,y2:Math.min(l,_),color:x})}let L=l+.5;for(let C=p-m;C<p;C++){const T=d(C);L-=T,E.push({x1:O,y1:L,x2:S,y2:L,color:v})}if(w!==!0){let C=c+.5,T=n;const I=L;for(;C+i<I;){const M=C+i;if(M>=R&&M<=_-1){const z=g==null?void 0:g(T);E.push({x1:O,y1:M,x2:S,y2:M,color:(z==null?void 0:z.horizontalBorderColor)??(z==null?void 0:z.borderColor)??v})}C+=d(T),T++}}const D=Sh(E,C=>C.color);for(const C of Object.keys(D)){e.strokeStyle=C;for(const T of D[C])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function e0(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b,w,v){const x=[];e.imageSmoothingEnabled=!1;const O=Math.min(i.cellYOffset,l),S=Math.max(i.cellYOffset,l);let R=0;if(typeof w=="number")R+=(S-O)*w;else for(let I=O;I<S;I++)R+=w(I);l>i.cellYOffset&&(R=-R),R+=s-i.translateY;const _=Math.min(i.cellXOffset,o),E=Math.max(i.cellXOffset,o);let k=0;for(let I=_;I<E;I++)k+=p[I].width;o>i.cellXOffset&&(k=-k),k+=a-i.translateX;const L=Ci(b);if(k!==0&&R!==0)return{regions:[]};const D=u>0?ei(g,u,w):0,C=c-L-Math.abs(k),T=d-h-D-Math.abs(R)-1;if(C>150&&T>150){const I={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(R>0?(I.sy=(h+1)*m,I.sh=T*m,I.dy=(R+h+1)*m,I.dh=T*m,x.push({x:0,y:h,width:c,height:R+1})):R<0&&(I.sy=(-R+h+1)*m,I.sh=T*m,I.dy=(h+1)*m,I.dh=T*m,x.push({x:0,y:d+R-D,width:c,height:-R+D})),k>0?(I.sx=L*m,I.sw=C*m,I.dx=(k+L)*m,I.dw=C*m,x.push({x:L-1,y:0,width:k+2,height:d})):k<0&&(I.sx=(L-k)*m,I.sw=C*m,I.dx=L*m,I.dw=C*m,x.push({x:c+k,y:0,width:-k,height:d})),e.setTransform(1,0,0,1,0,0),v){if(L>0&&k!==0&&R===0&&(r===void 0||(n==null?void 0:n[1])!==!1)){const M=L*m,z=d*m;e.drawImage(t,0,0,M,z,0,0,M,z)}if(D>0&&k===0&&R!==0&&(r===void 0||(n==null?void 0:n[0])!==!1)){const M=(d-D)*m,z=c*m,N=D*m;e.drawImage(t,0,M,z,N,0,M,z,N)}}e.drawImage(t,I.sx,I.sy,I.sw,I.sh,I.dx,I.dy,I.dw,I.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:x}}function t0(e,t,n,r,i,o,l,a,s,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||r!==e.translateX||i!==e.translateY||Ar(s,n,r,i,a,(d,g,h,m)=>{if(d.sourceIndex===u){const p=Math.max(g,m)+1;return c.push({x:p,y:0,width:o-p,height:l}),!0}}),c}function n0(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(yi(i,o))continue;if(n!==void 0||i.width===o.width)return!1;const{width:l,...a}=i,{width:s,...u}=o;if(!yi(a,u))return!1;n=r}return n===void 0?!0:n}return!0}function Mu(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p){const b=m==null?void 0:m.filter(_=>_.style!=="no-outline");if(b===void 0||b.length===0)return;const w=Ci(a),v=ei(h,g,d),x=[s,0,a.length,h-g],O=[w,0,t,n-v],S=b.map(_=>{const E=_.range,k=_.style??"dashed";return qp(E,x,t,n,O).map(L=>{const D=L.rect,C=Ms(D.x,D.y,t,n,c,u+c,r,i,o,l,h,s,g,a,d),T=D.width===1&&D.height===1?C:Ms(D.x+D.width-1,D.y+D.height-1,t,n,c,u+c,r,i,o,l,h,s,g,a,d);return D.x+D.width>=a.length&&(T.width-=1),D.y+D.height>=h&&(T.height-=1),{color:_.color,style:k,clip:L.clip,rect:Up({x:C.x,y:C.y,width:T.x+T.width-C.x,height:T.y+T.height-C.y},t,n,8)}})}),R=()=>{e.lineWidth=1;let _=!1;for(const E of S)for(const k of E)if((k==null?void 0:k.rect)!==void 0&&so(0,0,t,n,k.rect.x,k.rect.y,k.rect.width,k.rect.height)){const L=_,D=!Wp(k.clip,k.rect);e.beginPath(),D&&(e.save(),e.rect(k.clip.x,k.clip.y,k.clip.width,k.clip.height),e.clip()),k.style==="dashed"&&!_?(e.setLineDash([5,3]),_=!0):(k.style==="solid"||k.style==="solid-outline")&&_&&(e.setLineDash([]),_=!1),e.strokeStyle=k.style==="solid-outline"?Hn(Hn(k.color,p.borderColor),p.bgCell):Kr(k.color,1),e.closePath(),e.strokeRect(k.rect.x+.5,k.rect.y+.5,k.rect.width-1,k.rect.height-1),D&&(e.restore(),_=L)}_&&e.setLineDash([])};return R(),R}function Ru(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 as(e,t,n,r,i,o,l,a,s,u,c,d,g,h,m,p,b){if(c.current===void 0)return;const w=c.current.range,v=c.current.cell,x=[w.x+w.width-1,w.y+w.height-1];if(v[1]>=b&&x[1]>=b||!l.some(I=>I.sourceIndex===v[0]||I.sourceIndex===x[0]))return;const[S,R]=c.current.cell,_=g(c.current.cell),E=_.span??[S,S],k=R>=b-h,L=h>0&&!k?ei(b,h,d)-1:0,D=x[1];let C;if(Ar(l,r,i,o,u,(I,M,z,N,X)=>{if(I.sticky&&S>I.sourceIndex)return;const ne=I.sourceIndex<E[0],G=I.sourceIndex>E[1],J=I.sourceIndex===x[0];if(!(!J&&(ne||G)))return Sa(X,z,n,b,d,h,m,void 0,(le,ie,se)=>{if(ie!==R&&ie!==D)return;let Me=M,te=I.width;if(_.span!==void 0){const P=Ed(_.span,M,le,I.width,se,I,a),B=I.sticky?P[0]:P[1];B!==void 0&&(Me=B.x,te=B.width)}return ie===D&&J&&p&&(C=()=>{var P;N>Me&&!I.sticky&&(e.beginPath(),e.rect(N,0,t-N,n),e.clip()),e.beginPath(),e.rect(Me+te-4,le+se-4,4,4),e.fillStyle=((P=I.themeOverride)==null?void 0:P.accentColor)??s.accentColor,e.fill()}),C!==void 0}),C!==void 0}),C===void 0)return;const T=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-L),e.clip(),C==null||C(),e.restore()};return T(),T}function r0(e,t,n,r,i,o,l,a,s){s===void 0||s.size===0||(e.beginPath(),Rd(t,n,o,r,(u,c,d,g,h,m)=>{s.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,g,h,m)}),Ar(t,a,o,l,i,(u,c,d,g)=>{const h=Math.max(0,g-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 i0(e,t,n,r,i,o,l,a,s,u){let c=0;return Ar(e,o,r,i,n,(d,g,h,m,p)=>(Sa(p,h,t,l,a,s,u,void 0,(b,w,v,x)=>{x||(c=Math.max(w,c))}),!0)),c}function Eu(e,t){var Sn;const{canvasCtx:n,headerCanvasCtx:r,width:i,height:o,cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:g,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:b,groupHeaderHeight:w,disabledRows:v,rowHeight:x,verticalBorder:O,overrideCursor:S,isResizing:R,selection:_,fillHandle:E,freezeTrailingRows:k,rows:L,getCellContent:D,getGroupDetails:C,getRowThemeOverride:T,isFocused:I,drawHeaderCallback:M,prelightCells:z,drawCellCallback:N,highlightRegions:X,resizeCol:ne,imageLoader:G,lastBlitData:J,hoverValues:le,hyperWrapping:ie,hoverInfo:se,spriteManager:Me,maxScaleFactor:te,hasAppendRow:H,touchMode:P,enqueue:B,renderStateProvider:ce,getCellRenderer:De,renderStrategy:Je,bufferACtx:be,bufferBCtx:Ce,damage:Te,minimumCellWidth:yt,resizeIndicator:gt}=e;if(i===0||o===0)return;const rt=Je==="double-buffer",ae=Math.min(te,Math.ceil(window.devicePixelRatio??1)),Fe=Je!=="direct"&&n0(e,t),he=n.canvas;(he.width!==i*ae||he.height!==o*ae)&&(he.width=i*ae,he.height=o*ae,he.style.width=i+"px",he.style.height=o+"px");const de=r.canvas,ge=d?w+b:b,ze=ge+1;(de.width!==i*ae||de.height!==ze*ae)&&(de.width=i*ae,de.height=ze*ae,de.style.width=i+"px",de.style.height=ze+"px");const _e=be.canvas,tt=Ce.canvas;rt&&(_e.width!==i*ae||_e.height!==o*ae)&&(_e.width=i*ae,_e.height=o*ae,J.current!==void 0&&(J.current.aBufferScroll=void 0)),rt&&(tt.width!==i*ae||tt.height!==o*ae)&&(tt.width=i*ae,tt.height=o*ae,J.current!==void 0&&(J.current.bBufferScroll=void 0));const pe=J.current;if(Fe===!0&&l===(pe==null?void 0:pe.cellXOffset)&&a===(pe==null?void 0:pe.cellYOffset)&&s===(pe==null?void 0:pe.translateX)&&u===(pe==null?void 0:pe.translateY))return;let ue=null;rt&&(ue=n);const it=r;let He;rt?Te!==void 0?He=(pe==null?void 0:pe.lastBuffer)==="b"?Ce:be:He=(pe==null?void 0:pe.lastBuffer)==="b"?be:Ce:He=n;const et=He.canvas,bt=rt?et===_e?tt:_e:he,mt=typeof x=="number"?()=>x:x;it.save(),He.save(),it.beginPath(),He.beginPath(),it.textBaseline="middle",He.textBaseline="middle",ae!==1&&(it.scale(ae,ae),He.scale(ae,ae));const Ve=ks(c,l,i,h,s);let Dt=[];const Yt=p&&((Sn=_.current)==null?void 0:Sn.cell[1])===a&&u===0;let kt=!1;if(X!==void 0){for(const Pe of X)if(Pe.style!=="no-outline"&&Pe.range.y===a&&u===0){kt=!0;break}}const _t=()=>{Gp(it,Ve,d,se,i,s,b,w,h,R,_,m,Me,le,O,C,Te,M,P),ku(it,Ve,a,s,u,i,o,void 0,void 0,w,ge,mt,T,O,k,L,m,!0),it.beginPath(),it.moveTo(0,ze-.5),it.lineTo(i,ze-.5),it.strokeStyle=Hn(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),it.stroke(),kt&&Mu(it,i,o,l,a,s,u,c,g,b,w,x,k,L,X,m),Yt&&as(it,i,o,a,s,u,Ve,c,m,ge,_,mt,D,k,H,E,L)};if(Te!==void 0){const Pe=Ve[Ve.length-1].sourceIndex+1,Lt=Te.hasItemInRegion([{x:l,y:-2,width:Pe,height:2},{x:l,y:a,width:Pe,height:300},{x:0,y:a,width:g,height:300},{x:0,y:-2,width:g,height:2},{x:l,y:L-k,width:Pe,height:k,when:k>0}]),hn=gn=>{Su(gn,Ve,c,o,ge,s,u,a,L,mt,D,C,T,v,I,p,k,H,Dt,Te,_,z,X,G,Me,le,se,N,ie,m,B,ce,De,S,yt);const bn=_.current;E&&p&&bn!==void 0&&Te.has(hd(bn.range))&&as(gn,i,o,a,s,u,Ve,c,m,ge,_,mt,D,k,H,E,L)};Lt&&(hn(He),ue!==null&&(ue.save(),ue.scale(ae,ae),ue.textBaseline="middle",hn(ue),ue.restore()),Te.hasHeader()&&(r0(it,Ve,i,w,ge,s,u,a,Te),_t())),He.restore(),it.restore();return}if((Fe!==!0||l!==(pe==null?void 0:pe.cellXOffset)||s!==(pe==null?void 0:pe.translateX)||Yt!==(pe==null?void 0:pe.mustDrawFocusOnHeader)||kt!==(pe==null?void 0:pe.mustDrawHighlightRingsOnHeader))&&_t(),Fe===!0){An(bt!==void 0&&pe!==void 0);const{regions:Pe}=e0(He,bt,bt===_e?pe.aBufferScroll:pe.bBufferScroll,bt===_e?pe.bBufferScroll:pe.aBufferScroll,pe,l,a,s,u,k,i,o,L,ge,ae,c,Ve,x,rt);Dt=Pe}else Fe!==!1&&(An(pe!==void 0),Dt=t0(pe,l,a,s,u,i,o,ge,Ve,Fe));Jp(He,Ve,i,o,k,L,O,mt,m);const nn=Mu(He,i,o,l,a,s,u,c,g,b,w,x,k,L,X,m),Ht=p?as(He,i,o,a,s,u,Ve,c,m,ge,_,mt,D,k,H,E,L):void 0;if(He.fillStyle=m.bgCell,Dt.length>0){He.beginPath();for(const Pe of Dt)He.rect(Pe.x,Pe.y,Pe.width,Pe.height);He.clip(),He.fill(),He.beginPath()}else He.fillRect(0,0,i,o);const ln=Su(He,Ve,c,o,ge,s,u,a,L,mt,D,C,T,v,I,p,k,H,Dt,Te,_,z,X,G,Me,le,se,N,ie,m,B,ce,De,S,yt);Zp(He,Ve,c,i,o,ge,s,u,a,L,mt,T,_.rows,v,k,H,Dt,Te,m),Qp(He,Ve,a,s,u,i,o,Dt,ge,mt,T,O,k,L,m),ku(He,Ve,a,s,u,i,o,Dt,ln,w,ge,mt,T,O,k,L,m),nn==null||nn(),Ht==null||Ht(),R&>!=="none"&&Ar(Ve,0,s,0,ge,(Pe,Lt)=>Pe.sourceIndex===ne?(Ru(it,Lt+Pe.width,0,ge+1,Hn(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),gt==="full"&&Ru(He,Lt+Pe.width,ge,o,Hn(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),ue!==null&&(ue.fillStyle=m.bgCell,ue.fillRect(0,0,i,o),ue.drawImage(He.canvas,0,0));const It=i0(Ve,o,ge,s,u,a,L,mt,k,H);G==null||G.setWindow({x:l,y:a,width:Ve.length,height:It-a},g,Array.from({length:k},(Pe,Lt)=>L-1-Lt));const Ct=pe!==void 0&&(l!==pe.cellXOffset||s!==pe.translateX),On=pe!==void 0&&(a!==pe.cellYOffset||u!==pe.translateY);J.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:u,mustDrawFocusOnHeader:Yt,mustDrawHighlightRingsOnHeader:kt,lastBuffer:rt?et===_e?"a":"b":void 0,aBufferScroll:et===_e?[Ct,On]:pe==null?void 0:pe.aBufferScroll,bBufferScroll:et===tt?[Ct,On]:pe==null?void 0:pe.bBufferScroll},He.restore(),it.restore()}const o0=80;function a0(e){const t=e-1;return t*t*t+1}class s0{constructor(t){dt(this,"callback");dt(this,"currentHoveredItem");dt(this,"leavingItems",[]);dt(this,"lastAnimationTime");dt(this,"addToLeavingItems",t=>{this.leavingItems.some(r=>to(r.item,t.item))||this.leavingItems.push(t)});dt(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>to(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});dt(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});dt(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});dt(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:a0(t.hoverAmount)})));dt(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const r=(t-this.lastAnimationTime)/o0;for(const o of this.leavingItems)o.hoverAmount=Un(o.hoverAmount-r,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Un(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});dt(this,"setHovered",t=>{var n;if(!to((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 l0{constructor(t){dt(this,"fn");dt(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Zs(e){return new l0(e)}const u0=Zs(()=>window.navigator.userAgent.includes("Firefox")),la=Zs(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ua=Zs(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function c0(e){const t=f.useRef([]),n=f.useRef(0),r=f.useRef(e);r.current=e;const i=f.useCallback(()=>{const o=()=>window.requestAnimationFrame(l),l=()=>{const a=t.current.map(js);t.current=[],r.current(new ro(a)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:l)},[]);return f.useCallback(o=>{t.current.length===0&&i();const l=tr(o[0],o[1]);t.current.includes(l)||t.current.push(l)},[i])}const Or="header",qn="group-header",ca="out-of-bounds";var bi;(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"})(bi||(bi={}));function Ld(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 Iu=6,d0=(e,t)=>{if(e.kind===ee.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},f0=(e,t)=>{const{width:n,height:r,accessibilityHeight:i,columns:o,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:g,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:b,enableGroups:w,isFilling:v,onCanvasFocused:x,onCanvasBlur:O,isFocused:S,selection:R,freezeColumns:_,onContextMenu:E,freezeTrailingRows:k,fixedShadowX:L=!0,fixedShadowY:D=!0,drawFocusRing:C,onMouseDown:T,onMouseUp:I,onMouseMoveRaw:M,onMouseMove:z,onItemHovered:N,dragAndDropState:X,firstColAccessible:ne,onKeyDown:G,onKeyUp:J,highlightRegions:le,canvasRef:ie,onDragStart:se,onDragEnd:Me,eventTargetRef:te,isResizing:H,resizeColumn:P,isDragging:B,isDraggable:ce=!1,allowResize:De,disabledRows:Je,hasAppendRow:be,getGroupDetails:Ce,theme:Te,prelightCells:yt,headerIcons:gt,verticalBorder:rt,drawCell:ae,drawHeader:Fe,onCellFocused:he,onDragOverCell:de,onDrop:ge,onDragLeave:ze,imageWindowLoader:_e,smoothScrollX:tt=!1,smoothScrollY:pe=!1,experimental:ue,getCellRenderer:it,resizeIndicator:He="full"}=e,et=e.translateX??0,bt=e.translateY??0,mt=Math.max(_,Math.min(o.length-1,l)),Ve=f.useRef(null),Dt=f.useRef((ue==null?void 0:ue.eventTarget)??window),Yt=Dt.current,kt=_e,_t=f.useRef(),[nn,Ht]=f.useState(!1),ln=f.useRef([]),It=f.useRef(),[Ct,On]=f.useState(),[Sn,Pe]=f.useState(),Lt=f.useRef(null),[hn,gn]=f.useState(),[bn,at]=f.useState(!1),Xt=f.useRef(bn);Xt.current=bn;const Ot=f.useMemo(()=>new Np(gt,()=>{Bt.current=void 0,kn.current()}),[gt]),rn=w?c+s:s,Tt=f.useRef(-1),Ft=((ue==null?void 0:ue.enableFirefoxRescaling)??!1)&&u0.value,Ne=((ue==null?void 0:ue.enableSafariRescaling)??!1)&&la.value;f.useLayoutEffect(()=>{window.devicePixelRatio===1||!Ft&&!Ne||(Tt.current!==-1&&Ht(!0),window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{Ht(!1),Tt.current=-1},200))},[a,mt,et,bt,Ft,Ne]);const Vt=Am(o,_),Pt=f.useMemo(()=>L?Ci(Vt,X):0,[Vt,X,L]),$t=f.useCallback((V,oe,we)=>{const Se=V.getBoundingClientRect();if(oe>=Vt.length||we>=g)return;const me=Se.width/n,ke=Ms(oe,we,n,r,c,rn,mt,a,et,bt,g,_,k,Vt,d);return me!==1&&(ke.x*=me,ke.y*=me,ke.width*=me,ke.height*=me),ke.x+=Se.x,ke.y+=Se.y,ke},[n,r,c,rn,mt,a,et,bt,g,_,k,Vt,d]),zt=f.useCallback((V,oe,we,Se)=>{const me=V.getBoundingClientRect(),ke=me.width/n,nt=(oe-me.left)/ke,ot=(we-me.top)/ke,Ee=5,Mt=ks(Vt,mt,n,void 0,et);let xe=0,We=0;Se instanceof MouseEvent&&(xe=Se.button,We=Se.buttons);const Ue=$m(nt,Mt,et),ht=Nm(ot,r,w,s,c,g,d,a,bt,k),sn=(Se==null?void 0:Se.shiftKey)===!0,Tn=(Se==null?void 0:Se.ctrlKey)===!0,St=(Se==null?void 0:Se.metaKey)===!0,Qt=Se!==void 0&&!(Se instanceof MouseEvent)||(Se==null?void 0:Se.pointerType)==="touch",jn=[nt<0?-1:n<nt?1:0,ot<rn?-1:r<ot?1:0];let Mn;if(Ue===-1||ot<0||nt<0||ht===void 0||nt>n||ot>r){const Et=nt>n?1:nt<0?-1:0,Dn=ot>r?1:ot<0?-1:0;let Pn=Et*2,xt=Dn*2;Et===0&&(Pn=Ue===-1?bi.EndPadding:bi.Center),Dn===0&&(xt=ht===void 0?bi.EndPadding:bi.Center);let en=!1;if(Ue===-1&&ht===-1){const Mr=$t(V,Vt.length-1,-1);An(Mr!==void 0),en=oe<Mr.x+Mr.width+Ee}const kr=nt>n&&nt<n+Ss()||ot>r&&ot<r+Ss();Mn={kind:ca,location:[Ue!==-1?Ue:nt<0?0:Vt.length-1,ht??g-1],region:[Pn,xt],shiftKey:sn,ctrlKey:Tn,metaKey:St,isEdge:en,isTouch:Qt,button:xe,buttons:We,scrollEdge:jn,isMaybeScrollbar:kr}}else if(ht<=-1){let Et=$t(V,Ue,ht);An(Et!==void 0);let Dn=Et!==void 0&&Et.x+Et.width-oe<=Ee;const Pn=Ue-1;oe-Et.x<=Ee&&Pn>=0?(Dn=!0,Et=$t(V,Pn,ht),An(Et!==void 0),Mn={kind:w&&ht===-2?qn:Or,location:[Pn,ht],bounds:Et,group:Vt[Pn].group??"",isEdge:Dn,shiftKey:sn,ctrlKey:Tn,metaKey:St,isTouch:Qt,localEventX:oe-Et.x,localEventY:we-Et.y,button:xe,buttons:We,scrollEdge:jn}):Mn={kind:w&&ht===-2?qn:Or,group:Vt[Ue].group??"",location:[Ue,ht],bounds:Et,isEdge:Dn,shiftKey:sn,ctrlKey:Tn,metaKey:St,isTouch:Qt,localEventX:oe-Et.x,localEventY:we-Et.y,button:xe,buttons:We,scrollEdge:jn}}else{const Et=$t(V,Ue,ht);An(Et!==void 0);const Dn=Et!==void 0&&Et.x+Et.width-oe<Ee;let Pn=!1;if(u&&R.current!==void 0){const xt=hd(R.current.range),en=$t(V,xt[0],xt[1]);if(en!==void 0){const kr=en.x+en.width-2,Mr=en.y+en.height-2;Pn=Math.abs(kr-oe)<Iu&&Math.abs(Mr-we)<Iu}}Mn={kind:"cell",location:[Ue,ht],bounds:Et,isEdge:Dn,shiftKey:sn,ctrlKey:Tn,isFillHandle:Pn,metaKey:St,isTouch:Qt,localEventX:oe-Et.x,localEventY:we-Et.y,button:xe,buttons:We,scrollEdge:jn}}return Mn},[n,Vt,mt,et,r,w,s,c,g,d,a,bt,k,$t,u,R,rn]),[xn]=Ct??[],nr=f.useRef(()=>{}),zn=f.useRef(Ct);zn.current=Ct;const[$,Qe]=f.useMemo(()=>{const V=document.createElement("canvas"),oe=document.createElement("canvas");return V.style.display="none",V.style.opacity="0",V.style.position="fixed",oe.style.display="none",oe.style.opacity="0",oe.style.position="fixed",[V.getContext("2d",{alpha:!1}),oe.getContext("2d",{alpha:!1})]},[]);f.useLayoutEffect(()=>{if(!($===null||Qe===null))return document.documentElement.append($.canvas),document.documentElement.append(Qe.canvas),()=>{$.canvas.remove(),Qe.canvas.remove()}},[$,Qe]);const Be=f.useMemo(()=>new Km,[]),fe=Ft&&nn?1:Ne&&nn?2:5,st=(ue==null?void 0:ue.disableMinimumCellWidth)===!0?1:10,Bt=f.useRef(),dn=f.useRef(null),Jt=f.useRef(null),Kt=f.useCallback(()=>{var nt;const V=Ve.current,oe=Lt.current;if(V===null||oe===null||(dn.current===null&&(dn.current=V.getContext("2d",{alpha:!1}),V.width=0,V.height=0),Jt.current===null&&(Jt.current=oe.getContext("2d",{alpha:!1}),oe.width=0,oe.height=0),dn.current===null||Jt.current===null||$===null||Qe===null))return;let we=!1;const Se=ot=>{we=!0,gn(ot)},me=Bt.current,ke={headerCanvasCtx:Jt.current,canvasCtx:dn.current,bufferACtx:$,bufferBCtx:Qe,width:n,height:r,cellXOffset:mt,cellYOffset:a,translateX:Math.round(et),translateY:Math.round(bt),mappedColumns:Vt,enableGroups:w,freezeColumns:_,dragAndDropState:X,theme:Te,headerHeight:s,groupHeaderHeight:c,disabledRows:Je??vt.empty(),rowHeight:d,verticalBorder:rt,isResizing:H,resizeCol:P,isFocused:S,selection:R,fillHandle:u,drawCellCallback:ae,hasAppendRow:be,overrideCursor:Se,maxScaleFactor:fe,freezeTrailingRows:k,rows:g,drawFocus:C,getCellContent:h,getGroupDetails:Ce??(ot=>({name:ot})),getRowThemeOverride:m,drawHeaderCallback:Fe,prelightCells:yt,highlightRegions:le,imageLoader:kt,lastBlitData:It,damage:_t.current,hoverValues:ln.current,hoverInfo:zn.current,spriteManager:Ot,scrolling:nn,hyperWrapping:(ue==null?void 0:ue.hyperWrapping)??!1,touchMode:bn,enqueue:nr.current,renderStateProvider:Be,renderStrategy:(ue==null?void 0:ue.renderStrategy)??(la.value?"double-buffer":"single-buffer"),getCellRenderer:it,minimumCellWidth:st,resizeIndicator:He};ke.damage===void 0?(Bt.current=ke,Eu(ke,me)):Eu(ke,void 0),!we&&(ke.damage===void 0||ke.damage.has((nt=zn==null?void 0:zn.current)==null?void 0:nt[0]))&&gn(void 0)},[$,Qe,n,r,mt,a,et,bt,Vt,w,_,X,Te,s,c,Je,d,rt,H,be,P,S,R,u,k,g,C,fe,h,Ce,m,ae,Fe,yt,le,kt,Ot,nn,ue==null?void 0:ue.hyperWrapping,ue==null?void 0:ue.renderStrategy,bn,Be,it,st,He]),kn=f.useRef(Kt);f.useLayoutEffect(()=>{Kt(),kn.current=Kt},[Kt]),f.useLayoutEffect(()=>{(async()=>{var oe;((oe=document==null?void 0:document.fonts)==null?void 0:oe.ready)!==void 0&&(await document.fonts.ready,Bt.current=void 0,kn.current())})()},[]);const wn=f.useCallback(V=>{_t.current=V,kn.current(),_t.current=void 0},[]),yr=c0(wn);nr.current=yr;const Xn=f.useCallback(V=>{wn(new ro(V.map(oe=>oe.cell)))},[wn]);kt.setCallback(wn);const[po,Ra]=f.useState(!1),[Hr,Cr]=xn??[],xi=Hr!==void 0&&Cr===-1&&o[Hr].headerRowMarkerDisabled!==!0,Ea=Hr!==void 0&&Cr===-2;let ki=!1,Mi=!1,zr=hn;if(zr===void 0&&Hr!==void 0&&Cr!==void 0&&Cr>-1&&Cr<g){const V=h([Hr,Cr],!0);ki=V.kind===Yn.NewRow||V.kind===Yn.Marker&&V.markerKind!=="number",Mi=V.kind===ee.Boolean&&Vs(V),zr=V.cursor}const In=B?"grabbing":(Sn??!1)||H?"col-resize":po||v?"crosshair":zr!==void 0?zr:xi||ki||Mi||Ea?"pointer":"default",Ri=f.useMemo(()=>({contain:"strict",display:"block",cursor:In}),[In]),Ei=f.useRef("default"),ni=te==null?void 0:te.current;ni!=null&&Ei.current!==Ri.cursor&&(ni.style.cursor=Ei.current=Ri.cursor);const dr=f.useCallback((V,oe,we,Se)=>{if(Ce===void 0)return;const me=Ce(V);if(me.actions!==void 0){const ke=Dd(oe,me.actions);for(const[nt,ot]of ke.entries())if(jr(ot,we+oe.x,Se+ot.y))return me.actions[nt]}},[Ce]),fr=f.useCallback((V,oe,we,Se)=>{const me=Vt[oe];if(!B&&!H&&!(Sn??!1)){const ke=$t(V,oe,-1);An(ke!==void 0);const nt=Od(void 0,me,ke.x,ke.y,ke.width,ke.height,Te,Bs(me.title)==="rtl");if(me.hasMenu===!0&&nt.menuBounds!==void 0&&jr(nt.menuBounds,we,Se))return{area:"menu",bounds:nt.menuBounds};if(me.indicatorIcon!==void 0&&nt.indicatorIconBounds!==void 0&&jr(nt.indicatorIconBounds,we,Se))return{area:"indicator",bounds:nt.indicatorIconBounds}}},[Vt,$t,Sn,B,H,Te]),Vr=f.useRef(0),rr=f.useRef(),ir=f.useRef(!1),$r=f.useCallback(V=>{const oe=Ve.current,we=te==null?void 0:te.current;if(oe===null||V.target!==oe&&V.target!==we)return;ir.current=!0;let Se,me;if(V instanceof MouseEvent?(Se=V.clientX,me=V.clientY):(Se=V.touches[0].clientX,me=V.touches[0].clientY),V.target===we&&we!==null){const nt=we.getBoundingClientRect();if(Se>nt.right||me>nt.bottom)return}const ke=zt(oe,Se,me,V);rr.current=ke.location,ke.isTouch&&(Vr.current=Date.now()),Xt.current!==ke.isTouch&&at(ke.isTouch),!(ke.kind===Or&&fr(oe,ke.location[0],Se,me)!==void 0)&&(ke.kind===qn&&dr(ke.group,ke.bounds,ke.localEventX,ke.localEventY)!==void 0||(T==null||T(ke),!ke.isTouch&&ce!==!0&&ce!==ke.kind&&ke.button<3&&ke.button!==1&&V.preventDefault()))},[te,ce,zt,dr,fr,T]);pn("touchstart",$r,Yt,!1),pn("mousedown",$r,Yt,!1);const vo=f.useRef(0),Ii=f.useCallback(V=>{var We,Ue;const oe=vo.current;vo.current=Date.now();const we=Ve.current;if(ir.current=!1,I===void 0||we===null)return;const Se=te==null?void 0:te.current,me=V.target!==we&&V.target!==Se;let ke,nt,ot=!0;if(V instanceof MouseEvent){if(ke=V.clientX,nt=V.clientY,ot=V.button<3,V.pointerType==="touch")return}else ke=V.changedTouches[0].clientX,nt=V.changedTouches[0].clientY;let Ee=zt(we,ke,nt,V);Ee.isTouch&&Vr.current!==0&&Date.now()-Vr.current>500&&(Ee={...Ee,isLongTouch:!0}),oe!==0&&Date.now()-oe<(Ee.isTouch?1e3:500)&&(Ee={...Ee,isDoubleClick:!0}),Xt.current!==Ee.isTouch&&at(Ee.isTouch),!me&&V.cancelable&&ot&&V.preventDefault();const[Mt]=Ee.location,xe=fr(we,Mt,ke,nt);if(Ee.kind===Or&&xe!==void 0){(Ee.button!==0||((We=rr.current)==null?void 0:We[0])!==Mt||((Ue=rr.current)==null?void 0:Ue[1])!==-1)&&I(Ee,!0);return}else if(Ee.kind===qn){const ht=dr(Ee.group,Ee.bounds,Ee.localEventX,Ee.localEventY);if(ht!==void 0){Ee.button===0&&ht.onClick(Ee);return}}I(Ee,me)},[I,te,zt,fr,dr]);pn("mouseup",Ii,Yt,!1),pn("touchend",Ii,Yt,!1);const je=f.useCallback(V=>{var Mt,xe;const oe=Ve.current;if(oe===null)return;const we=te==null?void 0:te.current,Se=V.target!==oe&&V.target!==we;let me,ke,nt=!0;V instanceof MouseEvent?(me=V.clientX,ke=V.clientY,nt=V.button<3):(me=V.changedTouches[0].clientX,ke=V.changedTouches[0].clientY);const ot=zt(oe,me,ke,V);Xt.current!==ot.isTouch&&at(ot.isTouch),!Se&&V.cancelable&&nt&&V.preventDefault();const[Ee]=ot.location;if(ot.kind===Or){const We=fr(oe,Ee,me,ke);We!==void 0&&ot.button===0&&((Mt=rr.current)==null?void 0:Mt[0])===Ee&&((xe=rr.current)==null?void 0:xe[1])===-1&&(We.area==="menu"?p==null||p(Ee,We.bounds):We.area==="indicator"&&(b==null||b(Ee,We.bounds)))}else if(ot.kind===qn){const We=dr(ot.group,ot.bounds,ot.localEventX,ot.localEventY);We!==void 0&&ot.button===0&&We.onClick(ot)}},[te,zt,fr,p,b,dr]);pn("click",je,Yt,!1);const bo=f.useCallback(V=>{const oe=Ve.current,we=te==null?void 0:te.current;if(oe===null||V.target!==oe&&V.target!==we||E===void 0)return;const Se=zt(oe,V.clientX,V.clientY,V);E(Se,()=>{V.cancelable&&V.preventDefault()})},[te,zt,E]);pn("contextmenu",bo,(te==null?void 0:te.current)??null,!1);const wo=f.useCallback(V=>{_t.current=new ro(V.map(oe=>oe.item)),ln.current=V,kn.current(),_t.current=void 0},[]),Vn=f.useMemo(()=>new s0(wo),[wo]),yo=f.useRef(Vn);yo.current=Vn,f.useLayoutEffect(()=>{const V=yo.current;if(xn===void 0||xn[1]<0){V.setHovered(xn);return}const oe=h(xn,!0),we=it(oe),Se=we===void 0&&oe.kind===ee.Custom||(we==null?void 0:we.needsHover)!==void 0&&(typeof we.needsHover=="boolean"?we.needsHover:we.needsHover(oe));V.setHovered(Se?xn:void 0)},[h,it,xn]);const Gn=f.useRef(),Ti=f.useCallback(V=>{var ot;const oe=Ve.current;if(oe===null)return;const we=te==null?void 0:te.current,Se=V.target!==oe&&V.target!==we,me=zt(oe,V.clientX,V.clientY,V);if(me.kind!=="out-of-bounds"&&Se&&!ir.current&&!me.isTouch)return;const ke=(Ee,Mt)=>{On(xe=>xe===Ee||(xe==null?void 0:xe[0][0])===(Ee==null?void 0:Ee[0][0])&&(xe==null?void 0:xe[0][1])===(Ee==null?void 0:Ee[0][1])&&((xe==null?void 0:xe[1][0])===(Ee==null?void 0:Ee[1][0])&&(xe==null?void 0:xe[1][1])===(Ee==null?void 0:Ee[1][1])||!Mt)?xe:Ee)};if(!Ld(me,Gn.current))gn(void 0),N==null||N(me),ke(me.kind===ca?void 0:[me.location,[me.localEventX,me.localEventY]],!0),Gn.current=me;else if(me.kind==="cell"||me.kind===Or||me.kind===qn){let Ee=!1,Mt=!0;if(me.kind==="cell"){const We=h(me.location);Mt=((ot=it(We))==null?void 0:ot.needsHoverPosition)??We.kind===ee.Custom,Ee=Mt}else Ee=!0;const xe=[me.location,[me.localEventX,me.localEventY]];ke(xe,Mt),zn.current=xe,Ee&&wn(new ro([me.location]))}const nt=me.location[0]>=(ne?0:1);Pe(me.kind===Or&&me.isEdge&&nt&&De===!0),Ra(me.kind==="cell"&&me.isFillHandle),M==null||M(V),z(me)},[te,zt,ne,De,M,z,N,h,it,wn]);pn("mousemove",Ti,Yt,!0);const Co=f.useCallback(V=>{const oe=Ve.current;if(oe===null)return;let we,Se;R.current!==void 0&&(we=$t(oe,R.current.cell[0],R.current.cell[1]),Se=R.current.cell),G==null||G({bounds:we,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Se})},[G,R,$t]),So=f.useCallback(V=>{const oe=Ve.current;if(oe===null)return;let we,Se;R.current!==void 0&&(we=$t(oe,R.current.cell[0],R.current.cell[1]),Se=R.current.cell),J==null||J({bounds:we,stopPropagation:()=>V.stopPropagation(),preventDefault:()=>V.preventDefault(),cancel:()=>{},ctrlKey:V.ctrlKey,metaKey:V.metaKey,shiftKey:V.shiftKey,altKey:V.altKey,key:V.key,keyCode:V.keyCode,rawEvent:V,location:Se})},[J,R,$t]),Ia=f.useCallback(V=>{if(Ve.current=V,ie!==void 0&&(ie.current=V),ue!=null&&ue.eventTarget)Dt.current=ue.eventTarget;else if(V===null)Dt.current=window;else{const oe=V.getRootNode();oe===document&&(Dt.current=window),Dt.current=oe}},[ie,ue==null?void 0:ue.eventTarget]),Ta=f.useCallback(V=>{const oe=Ve.current;if(oe===null||ce===!1||H){V.preventDefault();return}let we,Se;const me=zt(oe,V.clientX,V.clientY);if(ce!==!0&&me.kind!==ce){V.preventDefault();return}const ke=(We,Ue)=>{we=We,Se=Ue};let nt,ot,Ee;const Mt=(We,Ue,ht)=>{nt=We,ot=Ue,Ee=ht};let xe=!1;if(se==null||se({...me,setData:ke,setDragImage:Mt,preventDefault:()=>xe=!0,defaultPrevented:()=>xe}),!xe&&we!==void 0&&Se!==void 0&&V.dataTransfer!==null)if(V.dataTransfer.setData(we,Se),V.dataTransfer.effectAllowed="copyLink",nt!==void 0&&ot!==void 0&&Ee!==void 0)V.dataTransfer.setDragImage(nt,ot,Ee);else{const[We,Ue]=me.location;if(Ue!==void 0){const ht=document.createElement("canvas"),sn=$t(oe,We,Ue);An(sn!==void 0);const Tn=Math.ceil(window.devicePixelRatio??1);ht.width=sn.width*Tn,ht.height=sn.height*Tn;const St=ht.getContext("2d");St!==null&&(St.scale(Tn,Tn),St.textBaseline="middle",Ue===-1?(St.font=Te.headerFontFull,St.fillStyle=Te.bgHeader,St.fillRect(0,0,ht.width,ht.height),Pd(St,0,0,sn.width,sn.height,Vt[We],!1,Te,!1,void 0,void 0,!1,0,Ot,Fe,!1)):(St.font=Te.baseFontFull,St.fillStyle=Te.bgCell,St.fillRect(0,0,ht.width,ht.height),Td(St,h([We,Ue]),0,Ue,!1,!1,0,0,sn.width,sn.height,!1,Te,Te.bgCell,kt,Ot,1,void 0,!1,0,void 0,void 0,void 0,Be,it,()=>{}))),ht.style.left="-100%",ht.style.position="absolute",ht.style.width=`${sn.width}px`,ht.style.height=`${sn.height}px`,document.body.append(ht),V.dataTransfer.setDragImage(ht,sn.width/2,sn.height/2),window.setTimeout(()=>{ht.remove()},0)}}else V.preventDefault()},[ce,H,zt,se,$t,Te,Vt,Ot,Fe,h,kt,Be,it]);pn("dragstart",Ta,(te==null?void 0:te.current)??null,!1,!1);const $n=f.useRef(),Sr=f.useCallback(V=>{const oe=Ve.current;if(ge!==void 0&&V.preventDefault(),oe===null||de===void 0)return;const we=zt(oe,V.clientX,V.clientY),[Se,me]=we.location,ke=Se-(ne?0:1),[nt,ot]=$n.current??[];(nt!==ke||ot!==me)&&($n.current=[ke,me],de([ke,me],V.dataTransfer))},[ne,zt,de,ge]);pn("dragover",Sr,(te==null?void 0:te.current)??null,!1,!1);const Nn=f.useCallback(()=>{$n.current=void 0,Me==null||Me()},[Me]);pn("dragend",Nn,(te==null?void 0:te.current)??null,!1,!1);const U=f.useCallback(V=>{const oe=Ve.current;if(oe===null||ge===void 0)return;V.preventDefault();const we=zt(oe,V.clientX,V.clientY),[Se,me]=we.location,ke=Se-(ne?0:1);ge([ke,me],V.dataTransfer)},[ne,zt,ge]);pn("drop",U,(te==null?void 0:te.current)??null,!1,!1);const Zt=f.useCallback(()=>{ze==null||ze()},[ze]);pn("dragleave",Zt,(te==null?void 0:te.current)??null,!1,!1);const xr=f.useRef(R);xr.current=R;const ri=f.useRef(null),ii=f.useCallback(V=>{var oe;Ve.current===null||!Ve.current.contains(document.activeElement)||(V===null&&xr.current.current!==void 0?(oe=ie==null?void 0:ie.current)==null||oe.focus({preventScroll:!0}):V!==null&&V.focus({preventScroll:!0}),ri.current=V)},[ie]);f.useImperativeHandle(t,()=>({focus:()=>{var oe;const V=ri.current;V===null||!document.contains(V)?(oe=ie==null?void 0:ie.current)==null||oe.focus({preventScroll:!0}):V.focus({preventScroll:!0})},getBounds:(V,oe)=>{if(!(ie===void 0||ie.current===null))return $t(ie.current,V??0,oe??-1)},damage:Xn,getMouseArgsForPosition:(V,oe,we)=>{if(!(ie===void 0||ie.current===null))return zt(ie.current,V,oe,we)}}),[ie,Xn,$t]);const Di=f.useRef(),Da=tm(()=>{var ot,Ee,Mt;if(n<50||(ue==null?void 0:ue.disableAccessibilityTree)===!0)return null;let V=ks(Vt,mt,n,X,et);const oe=ne?0:-1;!ne&&((ot=V[0])==null?void 0:ot.sourceIndex)===0&&(V=V.slice(1));const[we,Se]=((Ee=R.current)==null?void 0:Ee.cell)??[],me=(Mt=R.current)==null?void 0:Mt.range,ke=V.map(xe=>xe.sourceIndex),nt=_r(a,Math.min(g,a+i));return we!==void 0&&Se!==void 0&&!(ke.includes(we)&&nt.includes(Se))&&ii(null),f.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":g+1,"aria-multiselectable":"true","aria-colcount":Vt.length+oe},f.createElement("thead",{role:"rowgroup"},f.createElement("tr",{role:"row","aria-rowindex":1},V.map(xe=>f.createElement("th",{role:"columnheader","aria-selected":R.columns.hasIndex(xe.sourceIndex),"aria-colindex":xe.sourceIndex+1+oe,tabIndex:-1,onFocus:We=>{if(We.target!==ri.current)return he==null?void 0:he([xe.sourceIndex,-1])},key:xe.sourceIndex},xe.title)))),f.createElement("tbody",{role:"rowgroup"},nt.map(xe=>f.createElement("tr",{role:"row","aria-selected":R.rows.hasIndex(xe),key:xe,"aria-rowindex":xe+2},V.map(We=>{const Ue=We.sourceIndex,ht=tr(Ue,xe),sn=we===Ue&&Se===xe,Tn=me!==void 0&&Ue>=me.x&&Ue<me.x+me.width&&xe>=me.y&&xe<me.y+me.height,St=`glide-cell-${Ue}-${xe}`,Qt=[Ue,xe],jn=h(Qt,!0);return f.createElement("td",{key:ht,role:"gridcell","aria-colindex":Ue+1+oe,"aria-selected":Tn,"aria-readonly":pi(jn)||!Ji(jn),id:St,"data-testid":St,onClick:()=>{const Mn=ie==null?void 0:ie.current;if(Mn!=null)return G==null?void 0:G({bounds:$t(Mn,Ue,xe),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Qt})},onFocusCapture:Mn=>{var Et,Dn;if(!(Mn.target===ri.current||((Et=Di.current)==null?void 0:Et[0])===Ue&&((Dn=Di.current)==null?void 0:Dn[1])===xe))return Di.current=Qt,he==null?void 0:he(Qt)},ref:sn?ii:void 0,tabIndex:-1},d0(jn,it))})))))},[n,Vt,mt,X,et,g,a,i,R,ii,h,ie,G,$t,he],200),Oi=_===0||!L?0:mt>_?1:Un(-et/100,0,1),K=-a*32+bt,un=D?Un(-K/100,0,1):0,cn=f.useMemo(()=>{if(!Oi&&!un)return null;const V={position:"absolute",top:0,left:Pt,width:n-Pt,height:r,opacity:Oi,pointerEvents:"none",transition:tt?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},oe={position:"absolute",top:rn,left:0,width:n,height:r,opacity:un,pointerEvents:"none",transition:pe?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return f.createElement(f.Fragment,null,Oi>0&&f.createElement("div",{id:"shadow-x",style:V}),un>0&&f.createElement("div",{id:"shadow-y",style:oe}))},[Oi,un,Pt,n,tt,rn,r,pe]),Oa=f.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return f.createElement(f.Fragment,null,f.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:Co,onKeyUp:So,onFocus:x,onBlur:O,ref:Ia,style:Ri},Da),f.createElement("canvas",{ref:Lt,style:Oa}),cn)},h0=f.memo(f.forwardRef(f0));function Gi(e,t,n,r){return Un(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const g0=e=>{const[t,n]=f.useState(),[r,i]=f.useState(),[o,l]=f.useState(),[a,s]=f.useState(),[u,c]=f.useState(!1),[d,g]=f.useState(),[h,m]=f.useState(),[p,b]=f.useState(),[w,v]=f.useState(!1),[x,O]=f.useState(),{onHeaderMenuClick:S,onHeaderIndicatorClick:R,getCellContent:_,onColumnMoved:E,onColumnResize:k,onColumnResizeStart:L,onColumnResizeEnd:D,gridRef:C,maxColumnWidth:T,minColumnWidth:I,onRowMoved:M,lockColumns:z,onColumnProposeMove:N,onMouseDown:X,onMouseUp:ne,onItemHovered:G,onDragStart:J,canvasRef:le}=e,ie=(k??D??L)!==void 0,{columns:se,selection:Me}=e,te=Me.columns,H=f.useCallback(ae=>{const[Fe,he]=ae.location;o!==void 0&&a!==Fe&&Fe>=z?(c(!0),s(Fe)):h!==void 0&&he!==void 0?(v(!0),b(Math.max(0,he))):r===void 0&&!u&&!w&&(G==null||G(ae))},[o,h,a,G,z,r,u,w]),P=E!==void 0,B=f.useCallback(ae=>{var Fe;if(ae.button===0){const[he,de]=ae.location;if(ae.kind==="out-of-bounds"&&ae.isEdge&&ie){const ge=(Fe=C==null?void 0:C.current)==null?void 0:Fe.getBounds(se.length-1,-1);ge!==void 0&&(n(ge.x),i(se.length-1))}else if(ae.kind==="header"&&he>=z){const ge=le==null?void 0:le.current;if(ae.isEdge&&ie&&ge){n(ae.bounds.x),i(he);const _e=ge.getBoundingClientRect().width/ge.offsetWidth,tt=ae.bounds.width/_e;L==null||L(se[he],tt,he,tt+(se[he].growOffset??0))}else ae.kind==="header"&&P&&(g(ae.bounds.x),l(he))}else ae.kind==="cell"&&z>0&&he===0&&de!==void 0&&M!==void 0&&(O(ae.bounds.y),m(de))}X==null||X(ae)},[X,ie,z,M,C,se,P,L,le]),ce=f.useCallback((ae,Fe)=>{u||w||S==null||S(ae,Fe)},[u,w,S]),De=f.useCallback((ae,Fe)=>{u||w||R==null||R(ae,Fe)},[u,w,R]),Je=f.useRef(-1),be=f.useCallback(()=>{Je.current=-1,m(void 0),b(void 0),O(void 0),v(!1),l(void 0),s(void 0),g(void 0),c(!1),i(void 0),n(void 0)},[]),Ce=f.useCallback((ae,Fe)=>{if(ae.button===0){if(r!==void 0){if((te==null?void 0:te.hasIndex(r))===!0)for(const de of te){if(de===r)continue;const ge=se[de],ze=Gi(ge,Je.current,I,T);k==null||k(ge,ze,de,ze+(ge.growOffset??0))}const he=Gi(se[r],Je.current,I,T);if(D==null||D(se[r],he,r,he+(se[r].growOffset??0)),te.hasIndex(r))for(const de of te){if(de===r)continue;const ge=se[de],ze=Gi(ge,Je.current,I,T);D==null||D(ge,ze,de,ze+(ge.growOffset??0))}}be(),o!==void 0&&a!==void 0&&(N==null?void 0:N(o,a))!==!1&&(E==null||E(o,a)),h!==void 0&&p!==void 0&&(M==null||M(h,p))}ne==null||ne(ae,Fe)},[ne,r,o,a,h,p,te,D,se,I,T,k,E,M,be,N]),Te=f.useMemo(()=>{if(!(o===void 0||a===void 0)&&o!==a&&(N==null?void 0:N(o,a))!==!1)return{src:o,dest:a}},[o,a,N]),yt=f.useCallback(ae=>{const Fe=le==null?void 0:le.current;if(o!==void 0&&d!==void 0)Math.abs(ae.clientX-d)>20&&c(!0);else if(h!==void 0&&x!==void 0)Math.abs(ae.clientY-x)>20&&v(!0);else if(r!==void 0&&t!==void 0&&Fe){const de=Fe.getBoundingClientRect().width/Fe.offsetWidth,ge=(ae.clientX-t)/de,ze=se[r],_e=Gi(ze,ge,I,T);if(k==null||k(ze,_e,r,_e+(ze.growOffset??0)),Je.current=ge,(te==null?void 0:te.first())===r)for(const tt of te){if(tt===r)continue;const pe=se[tt],ue=Gi(pe,Je.current,I,T);k==null||k(pe,ue,tt,ue+(pe.growOffset??0))}}},[o,d,h,x,r,t,se,I,T,k,te,le]),gt=f.useCallback((ae,Fe)=>{if(h===void 0||p===void 0)return _(ae,Fe);let[he,de]=ae;return de===p?de=h:(de>p&&(de-=1),de>=h&&(de+=1)),_([he,de],Fe)},[h,p,_]),rt=f.useCallback(ae=>{J==null||J(ae),ae.defaultPrevented()||be()},[be,J]);return f.createElement(h0,{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:gt,isResizing:r!==void 0,onHeaderMenuClick:ce,onHeaderIndicatorClick:De,isDragging:u,onItemHovered:H,onDragStart:rt,onMouseDown:B,allowResize:ie,onMouseUp:Ce,dragAndDropState:Te,onMouseMoveRaw:yt,ref:C})};function m0(e){const t=f.useRef(null),[n,r]=f.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return f.useLayoutEffect(()=>{const i=l=>{for(const a of l){const{width:s,height:u}=a&&a.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 p0=(e,t,n)=>{const r=f.useRef(null),i=f.useRef(null),o=f.useRef(null),l=f.useRef(0),a=f.useRef(t);a.current=t;const s=n.current;f.useEffect(()=>{const u=()=>{var g,h;if(i.current===!1&&s!==null){const m=[s.scrollLeft,s.scrollTop];if(((g=o.current)==null?void 0:g[0])===m[0]&&((h=o.current)==null?void 0:h[1])===m[1])if(l.current>10){o.current=null,i.current=null;return}else l.current++;else l.current=0,a.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=g=>{g.touches.length===0&&(i.current=!1,l.current=0,r.current=window.setTimeout(u,8.333333333333334))};if(e&&s!==null){const g=s;return g.addEventListener("touchstart",c),g.addEventListener("touchend",d),()=>{g.removeEventListener("touchstart",c),g.removeEventListener("touchend",d),r.current!==null&&window.clearTimeout(r.current)}}},[e,s])},v0=()=>e=>e.isSafari?"scroll":"auto",b0=vn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[v0()]}}),w0=33554400,y0=5e6;function C0(e){const[t,n]=f.useState(!1),r=typeof window>"u"?null:window,i=f.useRef(0);return pn("touchstart",f.useCallback(()=>{window.clearTimeout(i.current),n(!0)},[]),r,!0,!1),pn("touchend",f.useCallback(o=>{o.touches.length===0&&(i.current=window.setTimeout(()=>n(!1),e))},[e]),r,!0,!1),t}const S0=e=>{var Me,te;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:i,update:o,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:g,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,b=[],w=(g==null?void 0:g.sticky)??!1,v=(g==null?void 0:g.fill)??!1,x=f.useRef(0),O=f.useRef(0),S=f.useRef(null),R=typeof window>"u"?1:window.devicePixelRatio,_=f.useRef(R);f.useEffect(()=>{if(_.current!==R){x.current=0,O.current=0,_.current=R;const H=S.current;H!==null&&M.current(H.scrollLeft,H.scrollTop)}},[R]);const E=f.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),k=f.useRef(null),L=C0(200),[D,C]=f.useState(!0),T=f.useRef(0);f.useLayoutEffect(()=>{if(!D||L||E.current.lockDirection===void 0)return;const H=S.current;if(H===null)return;const[P,B]=E.current.lockDirection;P!==void 0?H.scrollLeft=P:B!==void 0&&(H.scrollTop=B),E.current.lockDirection=void 0},[L,D]);const I=f.useCallback((H,P)=>{var he;const B=S.current;if(B===null)return;P=P??B.scrollTop,H=H??B.scrollLeft;const ce=E.current.scrollTop,De=E.current.scrollLeft,Je=H-De,be=P-ce;L&&Je!==0&&be!==0&&(Math.abs(Je)>3||Math.abs(be)>3)&&s&&E.current.lockDirection===void 0&&(E.current.lockDirection=Math.abs(Je)<Math.abs(be)?[De,void 0]:[void 0,ce]);const Ce=E.current.lockDirection;H=(Ce==null?void 0:Ce[0])??H,P=(Ce==null?void 0:Ce[1])??P,E.current.scrollLeft=H,E.current.scrollTop=P;const Te=B.clientWidth,yt=B.clientHeight,gt=P,rt=O.current-gt,ae=B.scrollHeight-yt;O.current=gt;let Fe;if(ae>0&&r>B.scrollHeight+5)if(Math.abs(rt)>2e3||gt===0||gt===ae){const de=Math.max(0,Math.min(1,gt/ae)),ge=r-yt;Fe=de*ge,x.current=Fe}else x.current-=rt,Fe=x.current;else Fe=gt,x.current=Fe;Fe=Math.max(0,Math.min(Fe,r-yt)),x.current=Fe,Ce!==void 0&&(window.clearTimeout(T.current),C(!1),T.current=window.setTimeout(()=>C(!0),200)),o({x:H,y:Fe,width:Te-c,height:yt-u,paddingRight:((he=k.current)==null?void 0:he.clientWidth)??0})},[u,c,r,o,s,L]);p0(h&&la.value,I,S);const M=f.useRef(I);M.current=I;const z=f.useRef(),N=f.useRef(!1);f.useLayoutEffect(()=>{N.current?I():N.current=!0},[I,u,c]);const X=f.useCallback(H=>{S.current=H,m!==void 0&&(m.current=H)},[m]);let ne=0,G=0;const J=Math.min(r,w0);for(b.push(f.createElement("div",{key:ne++,style:{width:i,height:0}}));G<J;){const H=Math.min(y0,J-G);b.push(f.createElement("div",{key:ne++,style:{width:0,height:H}})),G+=H}const{ref:le,width:ie,height:se}=m0(p);return typeof window<"u"&&(((Me=z.current)==null?void 0:Me.height)!==se||((te=z.current)==null?void 0:te.width)!==ie)&&(window.setTimeout(()=>M.current(),0),z.current={width:ie,height:se}),(ie??0)===0||(se??0)===0?f.createElement("div",{ref:le}):f.createElement("div",{ref:le},f.createElement(b0,{isSafari:la.value},f.createElement("div",{className:"dvn-underlay"},t),f.createElement("div",{ref:X,style:z.current,draggable:l,onDragStart:H=>{l||(H.stopPropagation(),H.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>I()},f.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},f.createElement("div",{className:"dvn-stack"},b),d!==void 0&&f.createElement(f.Fragment,null,!v&&f.createElement("div",{className:"dvn-spacer"}),f.createElement("div",{ref:k,style:{height:se,maxHeight:n-Math.ceil(R%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:v?1:void 0,right:w?c??0:void 0,pointerEvents:"auto"}},d))))))},x0=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:i,groupHeaderHeight:o,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:g,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:b,overscrollX:w,overscrollY:v,initialSize:x,smoothScrollX:O=!1,smoothScrollY:S=!1,isDraggable:R}=e,{paddingRight:_,paddingBottom:E}=s??{},[k,L]=c,D=f.useRef(),C=f.useRef(),T=f.useRef(),I=f.useRef(),M=u+Math.max(0,w??0);let z=l?i+o:i;if(typeof r=="number")z+=n*r;else for(let G=0;G<n;G++)z+=r(G);v!==void 0&&(z+=v);const N=f.useRef(),X=f.useCallback(()=>{var De,Je;if(N.current===void 0)return;const G={...N.current};let J=0,le=G.x<0?-G.x:0,ie=0,se=0;G.x=G.x<0?0:G.x;let Me=0;for(let be=0;be<a;be++)Me+=t[be].width;for(const be of t){const Ce=J-Me;if(G.x>=Ce+be.width)J+=be.width,se++,ie++;else if(G.x>Ce)J+=be.width,O?le+=Ce-G.x:se++,ie++;else if(G.x+G.width>Ce)J+=be.width,ie++;else break}let te=0,H=0,P=0;if(typeof r=="number")S?(H=Math.floor(G.y/r),te=H*r-G.y):H=Math.ceil(G.y/r),P=Math.ceil(G.height/r)+H,te<0&&P++;else{let be=0;for(let Ce=0;Ce<n;Ce++){const Te=r(Ce),yt=be+(S?0:Te/2);if(G.y>=be+Te)be+=Te,H++,P++;else if(G.y>yt)be+=Te,S?te+=yt-G.y:H++,P++;else if(G.y+G.height>Te/2+be)be+=Te,P++;else break}}H=Math.max(0,Math.min(H,n-1)),P=Math.max(H,Math.min(P,n));const B={x:se,y:H,width:ie-se,height:P-H},ce=D.current;(ce===void 0||ce.y!==B.y||ce.x!==B.x||ce.height!==B.height||ce.width!==B.width||C.current!==le||T.current!==te||G.width!==((De=I.current)==null?void 0:De[0])||G.height!==((Je=I.current)==null?void 0:Je[1]))&&(g==null||g({x:se,y:H,width:ie-se,height:P-H},G.width,G.height,G.paddingRight??0,le,te),D.current=B,C.current=le,T.current=te,I.current=[G.width,G.height])},[t,r,n,g,a,O,S]),ne=f.useCallback(G=>{N.current=G,X()},[X]);return f.useEffect(()=>{X()},[X]),f.createElement(S0,{scrollRef:h,className:d,kineticScrollPerfHack:s==null?void 0:s.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:R===!0||typeof R=="string",scrollWidth:M+(_??0),scrollHeight:z+(E??0),clientHeight:L,rightElement:p,paddingBottom:E,paddingRight:_,rightElementProps:b,update:ne,initialSize:x},f.createElement(g0,{eventTargetRef:h,width:k,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}))},k0=vn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),M0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),R0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),E0=f.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},f.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),I0=10,T0=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:i,searchInputRef:o,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:g}=e,[h]=f.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=f.useState(""),b=l??m,w=f.useCallback(J=>{p(J),s==null||s(J)},[s]),[v,x]=f.useState(),O=f.useRef(v);O.current=v,f.useEffect(()=>{a!==void 0&&(a.length>0?x(J=>({rowsSearched:r,results:a.length,selectedIndex:(J==null?void 0:J.selectedIndex)??-1})):x(void 0))},[r,a]);const S=f.useRef();S.current===void 0&&(S.current=new AbortController);const R=f.useRef(),[_,E]=f.useState([]),k=a??_,L=f.useCallback(()=>{R.current!==void 0&&(window.cancelAnimationFrame(R.current),R.current=void 0,S.current.abort())},[]),D=f.useRef(n);D.current=n;const C=f.useCallback(J=>{const le=new RegExp(J.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ie=D.current,se=Math.min(10,r),Me=0;x(void 0),E([]);const te=[],H=async()=>{var gt;if(u===void 0)return;const P=performance.now(),B=r-Me;let ce=u({x:0,y:ie,width:i.length,height:Math.min(se,B,r-ie)},S.current.signal);typeof ce=="function"&&(ce=await ce());let De=!1;for(const[rt,ae]of ce.entries())for(const[Fe,he]of ae.entries()){let de;switch(he.kind){case ee.Text:case ee.Number:de=he.displayData;break;case ee.Uri:case ee.Markdown:de=he.data;break;case ee.Boolean:de=typeof he.data=="boolean"?he.data.toString():void 0;break;case ee.Image:case ee.Bubble:de=he.data.join("🐳");break;case ee.Custom:de=he.copyData;break}de!==void 0&&le.test(de)&&(te.push([Fe,rt+ie]),De=!0)}const Je=performance.now();De&&E([...te]),Me+=ce.length,An(Me<=r);const be=((gt=O.current)==null?void 0:gt.selectedIndex)??-1;x({results:te.length,rowsSearched:Me,selectedIndex:be}),c==null||c(te,be),ie+se>=r?ie=0:ie+=se;const Ce=Je-P,Te=Math.max(Ce,1),yt=I0/Te;se=Math.ceil(se*yt),Me<r&&te.length<1e3&&(R.current=window.requestAnimationFrame(H))};L(),R.current=window.requestAnimationFrame(H)},[L,i.length,u,c,r]),T=f.useCallback(()=>{var J;g==null||g(),x(void 0),E([]),c==null||c([],-1),L(),(J=t==null?void 0:t.current)==null||J.focus()},[L,t,g,c]),I=f.useCallback(J=>{w(J.target.value),a===void 0&&(J.target.value===""?(x(void 0),E([]),L()):C(J.target.value))},[C,L,w,a]);f.useEffect(()=>{d&&o.current!==null&&(w(""),o.current.focus({preventScroll:!0}))},[d,o,w]);const M=f.useCallback(J=>{var ie;if((ie=J==null?void 0:J.stopPropagation)==null||ie.call(J),v===void 0)return;const le=(v.selectedIndex+1)%v.results;x({...v,selectedIndex:le}),c==null||c(k,le)},[v,c,k]),z=f.useCallback(J=>{var ie;if((ie=J==null?void 0:J.stopPropagation)==null||ie.call(J),v===void 0)return;let le=(v.selectedIndex-1)%v.results;le<0&&(le+=v.results),x({...v,selectedIndex:le}),c==null||c(k,le)},[c,k,v]),N=f.useCallback(J=>{(J.ctrlKey||J.metaKey)&&J.nativeEvent.code==="KeyF"||J.key==="Escape"?(T(),J.stopPropagation(),J.preventDefault()):J.key==="Enter"&&(J.shiftKey?z():M())},[T,M,z]);f.useEffect(()=>()=>{L()},[L]);const[X,ne]=f.useState(!1);f.useEffect(()=>{if(d)ne(!0);else{const J=setTimeout(()=>ne(!1),150);return()=>clearTimeout(J)}},[d]);const G=f.useMemo(()=>{if(!d&&!X)return null;let J;v!==void 0&&(J=v.results>=1e3?"over 1000":`${v.results} result${v.results!==1?"s":""}`,v.selectedIndex>=0&&(J=`${v.selectedIndex+1} of ${J}`));const le=Me=>{Me.stopPropagation()},se={width:`${Math.floor(((v==null?void 0:v.rowsSearched)??0)/r*100)}%`};return f.createElement(k0,{className:"gdg-search-bar"+(d?"":" out"),onMouseDown:le,onMouseMove:le,onMouseUp:le,onClick:le},f.createElement("div",{className:"gdg-search-bar-inner"},f.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:I,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:N}),f.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:z,disabled:((v==null?void 0:v.results)??0)===0},M0),f.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:M,disabled:((v==null?void 0:v.results)??0)===0},R0),g!==void 0&&f.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:T},E0)),v!==void 0?f.createElement(f.Fragment,null,f.createElement("div",{className:"gdg-search-status"},f.createElement("div",{"data-testid":"search-result-area"},J)),f.createElement("div",{className:"gdg-search-progress",style:se})):f.createElement("div",{className:"gdg-search-status"},f.createElement("label",{htmlFor:h},"Type to search")))},[d,X,v,r,h,o,I,b,N,z,M,g,T]);return f.createElement(f.Fragment,null,f.createElement(x0,{prelightCells:k,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}),G)};class D0 extends f.PureComponent{constructor(){super(...arguments);dt(this,"wrapperRef",f.createRef());dt(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(){const n=this.props.customEventTarget??document;n.addEventListener("touchend",this.clickOutside,!0),n.addEventListener("mousedown",this.clickOutside,!0),n.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const n=this.props.customEventTarget??document;n.removeEventListener("touchend",this.clickOutside,!0),n.removeEventListener("mousedown",this.clickOutside,!0),n.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:r,customEventTarget:i,...o}=this.props;return f.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}}const O0=()=>e=>Math.max(16,e.targetHeight-10),P0=vn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[O0(),"px"]}}),_0=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:i,onFinish:o}=e,[l,a]=Ut.useState(n);return Ut.createElement(D0,{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},Ut.createElement(P0,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?o(l):s.key==="Escape"&&r()},autoFocus:!0}))};function L0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function ut(e,t,n){const r=Fd(e,t);return r&&(n.didMatch=!0),r}function Fd(e,t){if(e.length===0)return!1;if(e.includes("|")){const s=e.split("|");for(const u of s)if(Fd(u,t))return!0;return!1}let n=!1,r=!1,i=!1,o=!1;const l=e.split("+"),a=l.pop();if(!L0(a,t))return!1;if(l[0]==="any")return!0;for(const s of l)switch(s){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":i=!0;break;case"meta":o=!0;break;case"primary":ua.value?o=!0:n=!0;break}return t.altKey===i&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===o}function F0(e,t,n,r,i,o,l){const a=Ut.useCallback((c,d,g,h)=>{var x;(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!l&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(g||h==="drag"),p=r==="mixed"&&m,b=i==="mixed"&&m;let w={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?((x=e.current)==null?void 0:x.rangeStack)??[]:[]},columns:p?e.columns:vt.empty(),rows:b?e.rows:vt.empty()};g&&(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,l,i,t]),s=Ut.useCallback((c,d,g)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,columns:vt.empty(),rows:c};else{const m=g&&n==="mixed",p=g&&r==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:vt.empty(),rows:c}}t(h,!1)},[r,e,n,i,t]),u=Ut.useCallback((c,d,g)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,rows:vt.empty(),columns:c};else{const m=g&&n==="mixed",p=g&&i==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:vt.empty(),columns:c}}t(h,!1)},[r,e,n,i,t]);return[a,s,u]}function A0(e,t,n,r,i){const o=f.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const g=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=i?g.push({kind:ee.Loading,allowOverlay:!1}):g.push(t([h,d]));c.push(g)}return c}return(e==null?void 0:e(u,r.signal))??[]},[r.signal,t,e,i]),l=e!==void 0?o:void 0,a=f.useCallback(u=>{if(l===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=l(c,r.signal);return typeof d=="function"?async()=>(await d()).map(g=>[{kind:ee.Loading,allowOverlay:!1},...g]):d.map(g=>[{kind:ee.Loading,allowOverlay:!1},...g])}return l(c,r.signal)},[r.signal,l,n]);return[e!==void 0?a:void 0,l]}function H0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string",doNotEscape:!0};switch(e.kind){case ee.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===zs?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case ee.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case ee.Image:case ee.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case ee.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case ee.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case ee.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case ee.Markdown:case ee.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case ee.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case ee.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case ee.Protected:return{formatted:"************",rawValue:"",format:"string"};default:oo()}}function z0(e,t){return e.map((r,i)=>{const o=t[i];return r.map(l=>l.span!==void 0&&l.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:H0(l))})}function Tu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function V0(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(l=>Tu(l,!0)).join(",")):i.push(o.doNotEscape===!0?o.formatted:Tu(o.formatted,!1));t.push(i.join(" "))}return t.join(`
|
166
|
-
`)}function ss(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Du(e){return'"'+e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")+'"'}function $0(e){return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function N0(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}">${ss(i.formatted)}</a></td>`):i.format==="string-array"?t.push(`<td ${o}><ol>${i.formatted.map((l,a)=>`<li gdg-raw-value=${Du(i.rawValue[a])}>`+ss(l)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${Du(((n=i.rawValue)==null?void 0:n.toString())??"")} ${o}>${ss(i.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function B0(e,t){const n=z0(e,t),r=V0(n),i=N0(n);return{textPlain:r,textHtml:i}}function Ou(e){var l;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 a=r.pop();if(a===void 0)break;if(a instanceof HTMLTableElement||a.nodeName==="TBODY")r.push(...[...a.children].reverse());else if(a instanceof HTMLTableRowElement)o!==void 0&&i.push(o),o=[],r.push(...[...a.children].reverse());else if(a instanceof HTMLTableCellElement){const s=a.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",g=s.querySelectorAll("br");for(const p of g)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:((l=s.querySelector("a"))==null?void 0:l.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(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...p].map(b=>b.textContent??""),format:"string-array"})}else if(h!==null)o==null||o.push({rawValue:$0(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 W0(e,t,n,r,i){var a;const o=e;if(r==="allowPartial"||e.current===void 0||t===void 0)return e;let l=!1;do{if((e==null?void 0:e.current)===void 0)break;const s=(a=e.current)==null?void 0:a.range,u=[];if(s.width>2){const g=t({x:s.x,y:s.y,width:1,height:s.height},i.signal);if(typeof g=="function")return o;u.push(...g);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 g=t({x:s.x,y:s.y,width:s.width,height:s.height},i.signal);if(typeof g=="function")return o;u.push(...g)}let c=s.x-n,d=s.x+s.width-1-n;for(const g of u)for(const h of g)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?l=!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(!l);return e}function Pu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function U0(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],i=0,o=t.None;e=e.replace(/\r\n/g,`
|
168
|
-
`);let l=0;for(const a of e){switch(o){case t.None:a===" "||a===`
|
169
|
-
`?(r.push(e.slice(i,l)),i=l+1,a===`
|
170
|
-
`&&(n.push(r),r=[])):a==='"'&&(o=t.inString);break;case t.inString:a==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?o=t.inString:((a===" "||a===`
|
171
|
-
`)&&(r.push(Pu(e.slice(i,l))),i=l+1,a===`
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}l++}return i<e.length&&r.push(Pu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function _u(e,t,n){var a;const r=B0(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)},l=(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)}};((a=window.navigator.clipboard)==null?void 0:a.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?l(r.textPlain,r.textHtml):i(r.textPlain),n==null||n.preventDefault()}function Ad(e){return e!==!0}function Lu(e){return typeof e=="string"?e:`${e}px`}const q0=()=>e=>e.innerWidth,Y0=()=>e=>e.innerHeight,X0=vn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[q0()],"wmyidgi-1":[Y0()]}}),G0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return f.createElement(X0,{innerHeight:Lu(n),innerWidth:Lu(t),...i},r)},j0=2,K0=1300;function Z0(e,t,n){const r=Ut.useRef(0),[i,o]=e??[0,0];Ut.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let l=!1,a=0;const s=u=>{var c;if(!l){if(a===0)a=u;else{const d=u-a;r.current=Math.min(1,r.current+d/K0);const g=r.current**1.618*d*j0;(c=t.current)==null||c.scrollBy(i*g,o*g),a=u,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{l=!0}},[t,i,o,n])}function J0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:l,remSize:a}){const[s,u,c,d,g,h]=Ut.useMemo(()=>{if(!l||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,b=Cd();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)??b.headerIconSize)*m,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,l,r]);return{rowHeight:s,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:g,overscrollY:h}}const Tr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function Fu(e){const t=ua.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function Q0(e){const t=am(e);return Ut.useMemo(()=>{if(t===void 0)return Fu(Tr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Tr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Tr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Tr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Tr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Tr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Tr.selectToLastCell};return Fu({...Tr,...n})},[t])}function ev(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const l={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(l.subGroups=r.subGroups.map((a,s)=>t(a,i+1,[...o,s])).sort((a,s)=>a.headerIndex-s.headerIndex)),l}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Js(e,t){const n=[];function r(a,s,u=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:u,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let d=0;d<a.subGroups.length;d++){const g=d<a.subGroups.length-1?a.subGroups[d+1].headerIndex:s;r(a.subGroups[d],g,u||a.isCollapsed)}}const i=ev(e.groups);for(let a=0;a<i.length;a++){const s=a<i.length-1?i[a+1].headerIndex:null;r(i[a],s)}let o=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...u}=a;return u})}function Is(e,t){if(t===void 0||Js.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(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function tv(e,t,n,r){const i=Ut.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]),o=Ut.useMemo(()=>i==null?void 0:i.reduce((c,d)=>(c[d.rowIndex]=d,c),{}),[i]),l=Ut.useMemo(()=>i===void 0?t:i.reduce((c,d)=>c+(d.isCollapsed?1:d.rows+1),0),[i,t]),a=Ut.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o!=null&&o[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),s=Ut.useCallback(c=>{if(i===void 0)return c;let d=c;for(const g of i){if(d===0)return;if(d--,!g.isCollapsed){if(d<g.rows)return g.contentIndex+d;d-=g.rows}}return c},[i]),u=Dr(r??(e==null?void 0:e.themeOverride),Ut.useCallback(c=>{if(e===void 0)return r==null?void 0:r(c,c,c);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:d,contentIndex:g,groupIndex:h}=Is(c,i);return d?e.themeOverride:r==null?void 0:r(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:u}:{rowHeight:a,rows:l,rowNumberMapper:s,getRowThemeOverride:u}}function nv(e,t){const n=Ut.useMemo(()=>e===void 0?void 0:Js(e,t),[e,t]);return{getRowGroupingForPath:zd,updateRowGroupingByPath:Hd,mapper:Ut.useCallback(r=>{if(typeof r=="number")return Is(r,n);const i=Is(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Hd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,l)=>l===r?{...o,...n}:o):e.map((o,l)=>l===r?{...o,subGroups:Hd(o.subGroups??[],i,n)}:o)}function zd(e,t){const[n,...r]=t;return r[0]===-1?e[n]:zd(e[n].subGroups??[],r)}function rv(e,t){const[n]=f.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 iv(e,t,n,r,i){const[o,l]=f.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=f.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,o]),[s,u,c]=om(a),d=f.useRef(i);d.current=i;const g=rv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(s.height??1)>1;f.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),d.current()}},[t,h,c,g]);const m=(s.width??1)>1;return f.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,g]),{visibleRegion:s,setVisibleRegion:u,scrollRef:g}}const ov=f.lazy(async()=>await Fs(()=>import("./data-grid-overlay-editor.DfB1NFlz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let av=0;function sv(e){return up(Cu(Cu(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return _r((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Bo(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 Wo={kind:ee.Loading,allowOverlay:!1},Uo={columns:vt.empty(),rows:vt.empty(),current:void 0},lv=(e,t)=>{var Tl,Dl,Ol;const[n,r]=f.useState(Uo),[i,o]=f.useState(),l=f.useRef(null),a=f.useRef(null),[s,u]=f.useState(),c=f.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:b,columns:w,rows:v,getCellContent:x,onCellClicked:O,onCellActivated:S,onFillPattern:R,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:L,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:T,rangeSelectionColumnSpanning:I=!0,spanRangeBehavior:M="default",onGroupHeaderClicked:z,onCellContextMenu:N,className:X,onHeaderContextMenu:ne,getCellsForSelection:G,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:le,onCellEdited:ie,onCellsEdited:se,onSearchResultsChanged:Me,searchResults:te,onSearchValueChange:H,searchValue:P,onKeyDown:B,onKeyUp:ce,keybindings:De,editOnType:Je=!0,onRowAppended:be,onColumnMoved:Ce,validateCell:Te,highlightRegions:yt,rangeSelect:gt="rect",columnSelect:rt="multi",rowSelect:ae="multi",rangeSelectionBlending:Fe="exclusive",columnSelectionBlending:he="exclusive",rowSelectionBlending:de="exclusive",onDelete:ge,onDragStart:ze,onMouseMove:_e,onPaste:tt,copyHeaders:pe=!1,freezeColumns:ue=0,cellActivationBehavior:it="second-click",rowSelectionMode:He="auto",onHeaderMenuClick:et,onHeaderIndicatorClick:bt,getGroupDetails:mt,rowGrouping:Ve,onSearchClose:Dt,onItemHovered:Yt,onSelectionCleared:kt,showSearch:_t,onVisibleRegionChanged:nn,gridSelection:Ht,onGridSelectionChange:ln,minColumnWidth:It=50,maxColumnWidth:Ct=500,maxColumnAutoWidth:On,provideEditor:Sn,trailingRowOptions:Pe,freezeTrailingRows:Lt=0,allowedFillDirections:hn="orthogonal",scrollOffsetX:gn,scrollOffsetY:bn,verticalBorder:at,onDragOverCell:Xt,onDrop:Ot,onColumnResize:rn,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Ne,fillHandle:Vt,experimental:Pt,fixedShadowX:$t,fixedShadowY:zt,headerIcons:xn,imageWindowLoader:nr,initialSize:zn,isDraggable:$,onDragLeave:Qe,onRowMoved:Be,overscrollX:fe,overscrollY:st,preventDiagonalScrolling:Bt,rightElement:dn,rightElementProps:Jt,trapFocus:Kt=!1,smoothScrollX:kn,smoothScrollY:wn,scaleToRem:yr=!1,rowHeight:Xn=34,headerHeight:po=36,groupHeaderHeight:Ra=po,theme:Hr,isOutsideClick:Cr,renderers:xi,resizeIndicator:Ea,scrollToActiveCell:ki=!0,drawFocusRing:Mi=!0}=e,zr=Mi==="no-editor"?i===void 0:Mi,Gt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,In=(Gt==null?void 0:Gt.kind)??e.rowMarkers??"none",Ri=(Gt==null?void 0:Gt.width)??e.rowMarkerWidth,Ei=(Gt==null?void 0:Gt.startIndex)??e.rowMarkerStartIndex??1,ni=(Gt==null?void 0:Gt.theme)??e.rowMarkerTheme,dr=Gt==null?void 0:Gt.headerTheme,fr=Gt==null?void 0:Gt.headerAlwaysVisible,Vr=ae!=="multi"||(Gt==null?void 0:Gt.headerDisabled)===!0,rr=(Gt==null?void 0:Gt.checkboxStyle)??"square",ir=Math.max(It,20),$r=Math.max(Ct,ir),vo=Math.max(On??$r,ir),Ii=f.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:bo,rowHeight:wo,getRowThemeOverride:Vn}=tv(Ve,v,Xn,h),yo=f.useMemo(()=>Number.parseFloat(Ii.fontSize),[Ii]),{rowHeight:Gn,headerHeight:Ti,groupHeaderHeight:Co,theme:So,overscrollX:Ia,overscrollY:Ta}=J0({groupHeaderHeight:Ra,headerHeight:po,overscrollX:fe,overscrollY:st,remSize:yo,rowHeight:wo,scaleToRem:yr,theme:Hr}),$n=Q0(De),Sr=Ri??(v>1e4?48:v>1e3?44:v>100?36:32),Nn=In!=="none",U=Nn?1:0,Zt=be!==void 0,xr=(Pe==null?void 0:Pe.sticky)===!0,[ri,ii]=f.useState(!1),Di=_t??ri,Da=f.useCallback(()=>{Dt!==void 0?Dt():ii(!1)},[Dt]),K=f.useMemo(()=>Ht===void 0?void 0:Bo(Ht,U),[Ht,U])??n,un=f.useRef();un.current===void 0&&(un.current=new AbortController),f.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Oa]=A0(G,x,U,un.current,je),V=f.useCallback((y,F,A)=>{if(Te===void 0)return!0;const W=[y[0]-U,y[1]];return Te==null?void 0:Te(W,F,A)},[U,Te]),oe=f.useRef(Ht),we=f.useCallback((y,F)=>{F&&(y=W0(y,cn,U,M,un.current)),ln!==void 0?(oe.current=Bo(y,-U),ln(oe.current)):r(y)},[ln,cn,U,M]),Se=Dr(rn,f.useCallback((y,F,A,W)=>{rn==null||rn(w[A-U],F,A-U,W)},[rn,U,w])),me=Dr(Tt,f.useCallback((y,F,A,W)=>{Tt==null||Tt(w[A-U],F,A-U,W)},[Tt,U,w])),ke=Dr(Ft,f.useCallback((y,F,A,W)=>{Ft==null||Ft(w[A-U],F,A-U,W)},[Ft,U,w])),nt=Dr(k,f.useCallback((y,F)=>(k==null?void 0:k({...y,columnIndex:y.columnIndex-U},F))??!1,[k,U])),ot=Dr(L,f.useCallback((y,F)=>(L==null?void 0:L({...y,col:y.col-U},F))??!1,[L,U])),Ee=f.useCallback(y=>{if(ge!==void 0){const F=ge(Bo(y,-U));return typeof F=="boolean"?F:Bo(F,U)}return!0},[ge,U]),[Mt,xe,We]=F0(K,we,Fe,he,de,gt,I),Ue=f.useMemo(()=>pr(Cd(),So),[So]),[ht,sn]=f.useState([0,0,0]),Tn=f.useMemo(()=>{if(xi===void 0)return{};const y={};for(const F of xi)y[F.kind]=F;return y},[xi]),St=f.useCallback(y=>y.kind!==ee.Custom?Tn[y.kind]:Ne==null?void 0:Ne.find(F=>F.isMatch(y)),[Ne,Tn]);let{sizedColumns:Qt,nonGrowWidth:jn}=ep(w,je,Oa,ht[0]-(U===0?0:Sr)-ht[2],ir,vo,Ue,St,un.current);In!=="none"&&(jn+=Sr);const Mn=f.useMemo(()=>Qt.some(y=>y.group!==void 0),[Qt]),Et=Mn?Ti+Co:Ti,Dn=K.rows.length,Pn=In==="none"?void 0:Dn===0?!1:Dn===je?!0:void 0,xt=f.useMemo(()=>In==="none"?Qt:[{title:"",width:Sr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ni,rowMarker:rr,rowMarkerChecked:Pn,headerRowMarkerTheme:dr,headerRowMarkerAlwaysVisible:fr,headerRowMarkerDisabled:Vr},...Qt],[In,Qt,Sr,ni,rr,Pn,dr,fr,Vr]),en=f.useRef({height:1,width:1,x:0,y:0}),kr=f.useRef(!1),{setVisibleRegion:Mr,visibleRegion:Nr,scrollRef:Wt}=iv(gn,bn,Gn,en,()=>kr.current=!0);en.current=Nr;const _f=Nr.x+U,xo=Nr.y,fn=f.useRef(null),Rn=f.useCallback(y=>{var F;y===!0?(F=fn.current)==null||F.focus():window.requestAnimationFrame(()=>{var A;(A=fn.current)==null||A.focus()})},[]),yn=Zt?je+1:je,Bn=f.useCallback(y=>{const F=U===0?y:y.map(W=>({...W,location:[W.location[0]-U,W.location[1]]})),A=se==null?void 0:se(F);if(A!==!0)for(const W of F)ie==null||ie(W.location,W.value);return A},[ie,se,U]),[Br,Pa]=f.useState(),ko=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,oi=zr?(Tl=K.current)==null?void 0:Tl.cell:void 0,Mo=oi==null?void 0:oi[0],Ro=oi==null?void 0:oi[1],Lf=f.useMemo(()=>{if((yt===void 0||yt.length===0)&&(ko??Mo??Ro??Br)===void 0)return;const y=[];if(yt!==void 0)for(const F of yt){const A=xt.length-F.range.x-U;A>0&&y.push({color:F.color,range:{...F.range,x:F.range.x+U,width:Math.min(A,F.range.width)},style:F.style})}return Br!==void 0&&y.push({color:Kr(Ue.accentColor,0),range:Br,style:"dashed"}),ko!==void 0&&y.push({color:Kr(Ue.accentColor,.5),range:ko,style:"solid-outline"}),Mo!==void 0&&Ro!==void 0&&y.push({color:Ue.accentColor,range:{x:Mo,y:Ro,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Br,ko,Mo,Ro,yt,xt.length,Ue.accentColor,U]),ml=f.useRef(xt);ml.current=xt;const _n=f.useCallback(([y,F],A=!1)=>{var Z,Y,j,Q,re,ve,Oe;const W=Zt&&F===yn-1;if(y===0&&Nn){if(W)return Wo;const ye=bo(F);return ye===void 0?Wo:{kind:Yn.Marker,allowOverlay:!1,checkboxStyle:rr,checked:(K==null?void 0:K.rows.hasIndex(F))===!0,markerKind:In==="clickable-number"?"number":In,row:Ei+ye,drawHandle:Be!==void 0,cursor:In==="clickable-number"?"pointer":void 0}}else if(W){const Ae=y===U?(Pe==null?void 0:Pe.hint)??"":"",Ie=ml.current[y];if(((Z=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:Z.disabled)===!0)return Wo;{const pt=((Y=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:Y.hint)??Ae,qe=((j=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:j.addIcon)??(Pe==null?void 0:Pe.addIcon);return{kind:Yn.NewRow,hint:pt,allowOverlay:!1,icon:qe}}}else{const ye=y-U;if(A||(Pt==null?void 0:Pt.strict)===!0){const Ie=en.current,pt=Ie.x>ye||ye>Ie.x+Ie.width||Ie.y>F||F>Ie.y+Ie.height||F>=La.current,qe=ye===((re=(Q=Ie.extras)==null?void 0:Q.selected)==null?void 0:re[0])&&F===((ve=Ie.extras)==null?void 0:ve.selected[1]);let Le=!1;if(((Oe=Ie.extras)==null?void 0:Oe.freezeRegions)!==void 0){for(const Rt of Ie.extras.freezeRegions)if(jr(Rt,ye,F)){Le=!0;break}}if(pt&&!qe&&!Le)return Wo}let Ae=x([ye,F]);return U!==0&&Ae.span!==void 0&&(Ae={...Ae,span:[Ae.span[0]+U,Ae.span[1]+U]}),Ae}},[Zt,yn,Nn,bo,rr,K==null?void 0:K.rows,In,Ei,Be,U,Pe==null?void 0:Pe.hint,Pe==null?void 0:Pe.addIcon,Pt==null?void 0:Pt.strict,x]),_a=f.useCallback(y=>{let F=(mt==null?void 0:mt(y))??{name:y};return le!==void 0&&y!==""&&(F={icon:F.icon,name:F.name,overrideTheme:F.overrideTheme,actions:[...F.actions??[],{title:"Rename",icon:"renameIcon",onClick:A=>Aa({group:F.name,bounds:A.bounds})}]}),F},[mt,le]),Eo=f.useCallback(y=>{var j;const[F,A]=y.cell,W=xt[F],q=(W==null?void 0:W.group)!==void 0?(j=_a(W.group))==null?void 0:j.overrideTheme:void 0,Z=W==null?void 0:W.themeOverride,Y=Vn==null?void 0:Vn(A);o({...y,theme:pr(Ue,q,Z,Y,y.content.themeOverride)})},[Vn,xt,_a,Ue]),ai=f.useCallback((y,F,A)=>{var Y;if(K.current===void 0)return;const[W,q]=K.current.cell,Z=_n([W,q]);if(Z.kind!==ee.Boolean&&Z.allowOverlay){let j=Z;if(A!==void 0)switch(j.kind){case ee.Number:{const Q=_g(()=>A==="-"?-0:Number.parseFloat(A),0);j={...j,data:Number.isNaN(Q)?0:Q};break}case ee.Text:case ee.Markdown:case ee.Uri:j={...j,data:A};break}Eo({target:y,content:j,initialValue:A,cell:[W,q],highlight:A===void 0,forceEditMode:A!==void 0})}else Z.kind===ee.Boolean&&F&&Z.readonly!==!0&&(Bn([{location:K.current.cell,value:{...Z,data:Ad(Z.data)}}]),(Y=fn.current)==null||Y.damage([{cell:K.current.cell}]))},[_n,K,Bn,Eo]),pl=f.useCallback((y,F)=>{var q;const A=(q=fn.current)==null?void 0:q.getBounds(y,F);if(A===void 0||Wt.current===null)return;const W=_n([y,F]);W.allowOverlay&&Eo({target:A,content:W,initialValue:void 0,highlight:!0,cell:[y,F],forceEditMode:!0})},[_n,Wt,Eo]),on=f.useCallback((y,F,A="both",W=0,q=0,Z=void 0)=>{if(Wt.current!==null){const Y=fn.current,j=a.current,Q=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,re=typeof F!="number"?F.unit==="cell"?F.amount:void 0:F,ve=typeof y!="number"&&y.unit==="px"?y.amount:void 0,Oe=typeof F!="number"&&F.unit==="px"?F.amount:void 0;if(Y!==null&&j!==null){let ye={x:0,y:0,width:0,height:0},Ae=0,Ie=0;if((Q!==void 0||re!==void 0)&&(ye=Y.getBounds((Q??0)+U,re??0)??ye,ye.width===0||ye.height===0))return;const pt=j.getBoundingClientRect(),qe=pt.width/j.offsetWidth;if(ve!==void 0&&(ye={...ye,x:ve-pt.left-Wt.current.scrollLeft,width:1}),Oe!==void 0&&(ye={...ye,y:Oe+pt.top-Wt.current.scrollTop,height:1}),ye!==void 0){const Le={x:ye.x-W,y:ye.y-q,width:ye.width+2*W,height:ye.height+2*q};let Rt=0;for(let Wa=0;Wa<ue;Wa++)Rt+=Qt[Wa].width;let jt=0;const an=Lt+(xr?1:0);an>0&&(jt=ei(yn,an,Gn));let Jn=Rt*qe+pt.left+U*Sr*qe,ar=pt.right,Qn=pt.top+Et*qe,sr=pt.bottom-jt*qe;const Lo=ye.width+W*2;switch(Z==null?void 0:Z.hAlign){case"start":ar=Jn+Lo;break;case"end":Jn=ar-Lo;break;case"center":Jn=Math.floor((Jn+ar)/2)-Lo/2,ar=Jn+Lo;break}const Fo=ye.height+q*2;switch(Z==null?void 0:Z.vAlign){case"start":sr=Qn+Fo;break;case"end":Qn=sr-Fo;break;case"center":Qn=Math.floor((Qn+sr)/2)-Fo/2,sr=Qn+Fo;break}Jn>Le.x?Ae=Le.x-Jn:ar<Le.x+Le.width&&(Ae=Le.x+Le.width-ar),Qn>Le.y?Ie=Le.y-Qn:sr<Le.y+Le.height&&(Ie=Le.y+Le.height-sr),A==="vertical"||typeof y=="number"&&y<ue?Ae=0:(A==="horizontal"||typeof F=="number"&&F>=yn-an)&&(Ie=0),(Ae!==0||Ie!==0)&&(qe!==1&&(Ae/=qe,Ie/=qe),Wt.current.scrollTo({left:Ae+Wt.current.scrollLeft,top:Ie+Wt.current.scrollTop,behavior:(Z==null?void 0:Z.behavior)??"auto"}))}}}},[U,Lt,Sr,Wt,Et,ue,Qt,yn,xr,Gn]),vl=f.useRef(pl),bl=f.useRef(x),La=f.useRef(je);vl.current=pl,bl.current=x,La.current=je;const si=f.useCallback(async(y,F=!0,A)=>{var re;const W=xt[y];if(((re=W==null?void 0:W.trailingRowOptions)==null?void 0:re.disabled)===!0)return;const q=be==null?void 0:be();let Z,Y=!0;q!==void 0&&(Z=await q,Z==="top"&&(Y=!1),typeof Z=="number"&&(Y=!1));let j=0;const Q=()=>{if(La.current<=je){j<500&&window.setTimeout(Q,j),j=50+j*2;return}const ve=typeof Z=="number"?Z:Y?je:0;_o.current(y-U,ve,"both",0,0,A?{behavior:A}:void 0),Mt({cell:[y,ve],range:{x:y,y:ve,width:1,height:1}},!1,!1,"edit");const Oe=bl.current([y-U,ve]);Oe.allowOverlay&&Ji(Oe)&&Oe.readonly!==!0&&F&&window.setTimeout(()=>{vl.current(y,ve)},0)};Q()},[xt,be,U,je,Mt]),Io=f.useCallback(y=>{var A,W;const F=((W=(A=Qt[y])==null?void 0:A.trailingRowOptions)==null?void 0:W.targetColumn)??(Pe==null?void 0:Pe.targetColumn);if(typeof F=="number")return F+(Nn?1:0);if(typeof F=="object"){const q=w.indexOf(F);if(q>=0)return q+(Nn?1:0)}},[Qt,w,Nn,Pe==null?void 0:Pe.targetColumn]),Rr=f.useRef(),li=f.useRef(),Pi=f.useCallback((y,F)=>{var q;const[A,W]=F;return pr(Ue,(q=xt[A])==null?void 0:q.themeOverride,Vn==null?void 0:Vn(W),y.themeOverride)},[Vn,xt,Ue]),{mapper:Wr}=nv(Ve,v),Kn=Ve==null?void 0:Ve.navigationBehavior,_i=f.useCallback(y=>{var ve,Oe,ye;const F=ua.value?y.metaKey:y.ctrlKey,A=F&&ae==="multi",W=F&&rt==="multi",[q,Z]=y.location,Y=K.columns,j=K.rows,[Q,re]=((ve=K.current)==null?void 0:ve.cell)??[];if(y.kind==="cell"){if(li.current=void 0,Ur.current=[q,Z],q===0&&Nn){if(Zt===!0&&Z===je||In==="number"||ae==="none")return;const Ae=_n(y.location);if(Ae.kind!==Yn.Marker)return;if(Be!==void 0){const qe=St(Ae);An((qe==null?void 0:qe.kind)===Yn.Marker);const Le=(Oe=qe==null?void 0:qe.onClick)==null?void 0:Oe.call(qe,{...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Pi(Ae,y.location),preventDefault:()=>{}});if(Le===void 0||Le.checked===Ae.checked)return}o(void 0),Rn();const Ie=j.hasIndex(Z),pt=Rr.current;if(ae==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&pt!==void 0&&j.hasIndex(pt)){const qe=[Math.min(pt,Z),Math.max(pt,Z)+1];A||He==="multi"?xe(void 0,qe,!0):xe(vt.fromSingleSelection(qe),void 0,A)}else ae==="multi"&&(A||y.isTouch||He==="multi")?Ie?xe(j.remove(Z),void 0,!0):(xe(void 0,Z,!0),Rr.current=Z):Ie&&j.length===1?xe(vt.empty(),void 0,F):(xe(vt.fromSingleSelection(Z),void 0,F),Rr.current=Z)}else if(q>=U&&Zt&&Z===je){const Ae=Io(q);si(Ae??q)}else if(Q!==q||re!==Z){const Ae=_n(y.location),Ie=St(Ae);if((Ie==null?void 0:Ie.onSelect)!==void 0){let Le=!1;if(Ie.onSelect({...y,cell:Ae,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Le=!0,theme:Pi(Ae,y.location)}),Le)return}if(Kn==="block"&&Wr(Z).isGroupHeader)return;const pt=xr&&Z===je,qe=xr&&K!==void 0&&((ye=K.current)==null?void 0:ye.cell[1])===je;if((y.shiftKey||y.isLongTouch===!0)&&Q!==void 0&&re!==void 0&&K.current!==void 0&&!qe){if(pt)return;const Le=Math.min(q,Q),Rt=Math.max(q,Q),jt=Math.min(Z,re),an=Math.max(Z,re);Mt({...K.current,range:{x:Le,y:jt,width:Rt-Le+1,height:an-jt+1}},!0,F,"click"),Rr.current=void 0,Rn()}else Mt({cell:[q,Z],range:{x:q,y:Z,width:1,height:1}},!0,F,"click"),Rr.current=void 0,o(void 0),Rn()}}else if(y.kind==="header")if(Ur.current=[q,Z],o(void 0),Nn&&q===0)Rr.current=void 0,li.current=void 0,!Vr&&ae==="multi"&&(j.length!==je?xe(vt.fromSingleSelection([0,je]),void 0,F):xe(vt.empty(),void 0,F),Rn());else{const Ae=li.current;if(rt==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&Ae!==void 0&&Y.hasIndex(Ae)){const Ie=[Math.min(Ae,q),Math.max(Ae,q)+1];W?We(void 0,Ie,F):We(vt.fromSingleSelection(Ie),void 0,F)}else W?(Y.hasIndex(q)?We(Y.remove(q),void 0,F):We(void 0,q,F),li.current=q):rt!=="none"&&(Y.hasIndex(q)?We(Y.remove(q),void 0,F):We(vt.fromSingleSelection(q),void 0,F),li.current=q);Rr.current=void 0,Rn()}else y.kind===qn?Ur.current=[q,Z]:y.kind===ca&&!y.isMaybeScrollbar&&(we(Uo,!1),o(void 0),Rn(),kt==null||kt(),Rr.current=void 0,li.current=void 0)},[ae,rt,K,Nn,U,Zt,je,In,_n,Be,Rn,He,St,Pi,xe,Io,si,Kn,Wr,xr,Mt,We,we,kt]),Li=f.useRef(!1),Ur=f.useRef(),wl=f.useRef(Nr),Wn=f.useRef(),Ff=f.useCallback(y=>{if(ui.current=!1,wl.current=en.current,y.button!==0&&y.button!==1){Wn.current=void 0;return}const F=performance.now();Wn.current={button:y.button,time:F,location:y.location},(y==null?void 0:y.kind)==="header"&&(Li.current=!0);const A=y.kind==="cell"&&y.isFillHandle;!A&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:A}),Ur.current=void 0,!y.isTouch&&y.button===0&&!A?_i(y):!y.isTouch&&y.button===1&&(Ur.current=y.location))},[K,_i]),[Fa,Aa]=f.useState(),yl=f.useCallback(y=>{if(y.kind!==qn||rt!=="multi")return;const F=ua.value?y.metaKey:y.ctrlKey,[A]=y.location,W=K.columns;if(A<U)return;const q=xt[A];let Z=A,Y=A;for(let j=A-1;j>=U&&ao(q.group,xt[j].group);j--)Z--;for(let j=A+1;j<xt.length&&ao(q.group,xt[j].group);j++)Y++;if(Rn(),F)if(W.hasAll([Z,Y+1])){let j=W;for(let Q=Z;Q<=Y;Q++)j=j.remove(Q);We(j,void 0,F)}else We(void 0,[Z,Y+1],F);else We(vt.fromSingleSelection([Z,Y+1]),void 0,F)},[rt,Rn,K.columns,xt,U,We]),ui=f.useRef(!1),To=f.useCallback(async y=>{if(cn!==void 0&&Se!==void 0){const F=en.current.y,A=en.current.height;let W=cn({x:y,y:F,width:1,height:Math.min(A,je-F)},un.current.signal);typeof W!="object"&&(W=await W());const q=Qt[y-U],Y=document.createElement("canvas").getContext("2d",{alpha:!1});if(Y!==null){Y.font=Ue.baseFontFull;const j=xd(Y,Ue,q,0,W,ir,$r,!1,St);Se==null||Se(q,j.width,y,j.width)}}},[Qt,cn,$r,Ue,ir,Se,U,je,St]),[Af,Ha]=f.useState(),ci=f.useCallback(async(y,F)=>{var j,Q;const A=(j=y.current)==null?void 0:j.range;if(A===void 0||cn===void 0||F.current===void 0)return;const W=F.current.range;if(R!==void 0){let re=!1;if(R({fillDestination:{...W,x:W.x-U},patternSource:{...A,x:A.x-U},preventDefault:()=>re=!0}),re)return}let q=cn(A,un.current.signal);typeof q!="object"&&(q=await q());const Z=q,Y=[];for(let re=0;re<W.width;re++)for(let ve=0;ve<W.height;ve++){const Oe=[W.x+re,W.y+ve];if(fd(Oe,A))continue;const ye=Z[ve%A.height][re%A.width];pi(ye)||!Ji(ye)||Y.push({location:Oe,value:{...ye}})}Bn(Y),(Q=fn.current)==null||Q.damage(Y.map(re=>({cell:re.location})))},[cn,Bn,R,U]),Cl=f.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};ci(y,K)},[ci,K]),Sl=f.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};ci(y,K)},[ci,K]),Hf=f.useCallback((y,F)=>{var ve,Oe;const A=s;if(u(void 0),Pa(void 0),Ha(void 0),Li.current=!1,F)return;if((A==null?void 0:A.fillHandle)===!0&&K.current!==void 0&&((ve=A.previousSelection)==null?void 0:ve.current)!==void 0){if(Br===void 0)return;const ye={...K,current:{...K.current,range:Id(A.previousSelection.current.range,Br)}};ci(A.previousSelection,ye),we(ye,!0);return}const[W,q]=y.location,[Z,Y]=Ur.current??[],j=()=>{ui.current=!0},Q=ye=>{var Ie,pt,qe;const Ae=ye.isTouch||Z===W&&Y===q;if(Ae&&(O==null||O([W-U,q],{...ye,preventDefault:j})),ye.button===1)return!ui.current;if(!ui.current){const Le=_n(y.location),Rt=St(Le);if(Rt!==void 0&&Rt.onClick!==void 0&&Ae){const an=Rt.onClick({...ye,cell:Le,posX:ye.localEventX,posY:ye.localEventY,bounds:ye.bounds,theme:Pi(Le,y.location),preventDefault:j});an!==void 0&&!pi(an)&&gi(an)&&(Bn([{location:ye.location,value:an}]),(Ie=fn.current)==null||Ie.damage([{cell:ye.location}]))}if(ui.current||K.current===void 0)return!1;let jt=!1;switch(Le.activationBehaviorOverride??it){case"double-click":case"second-click":{if(((qe=(pt=A==null?void 0:A.previousSelection)==null?void 0:pt.current)==null?void 0:qe.cell)===void 0)break;const[an,Jn]=K.current.cell,[ar,Qn]=A.previousSelection.current.cell;jt=W===an&&W===ar&&q===Jn&&q===Qn&&(ye.isDoubleClick===!0||it==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return S==null||S([W-U,q]),ai(ye.bounds,!1),!0}return!1},re=y.location[0]-U;if(y.isTouch){const ye=en.current,Ae=wl.current;if(ye.x!==Ae.x||ye.y!==Ae.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&to((Oe=K.current)==null?void 0:Oe.cell,y.location)){N==null||N([re,y.location[1]],{...y,preventDefault:j});return}else if(y.kind==="header"&&K.columns.hasIndex(W)){ne==null||ne(re,{...y,preventDefault:j});return}else if(y.kind===qn){if(re<0)return;J==null||J(re,{...y,preventDefault:j});return}}y.kind==="cell"?Q(y)||_i(y):y.kind===qn?z==null||z(re,{...y,preventDefault:j}):(y.kind===Or&&(C==null||C(re,{...y,preventDefault:j})),_i(y));return}if(y.kind==="header"){if(re<0)return;y.isEdge?y.isDoubleClick===!0&&To(W):y.button===0&&W===Z&&q===Y&&(C==null||C(re,{...y,preventDefault:j}))}if(y.kind===qn){if(re<0)return;y.button===0&&W===Z&&q===Y&&(z==null||z(re,{...y,preventDefault:j}),ui.current||yl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&Q(y),Ur.current=void 0},[s,K,U,Br,ci,we,O,_n,St,it,Pi,Bn,S,ai,N,ne,J,_i,z,C,To,yl]),zf=f.useCallback(y=>{const F={...y,location:[y.location[0]-U,y.location[1]]};_e==null||_e(F),s!==void 0&&y.buttons===0&&(u(void 0),Pa(void 0),Ha(void 0),Li.current=!1),Ha(A=>{var W;return Li.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===(A==null?void 0:A[0])&&y.scrollEdge[1]===A[1]?A:s===void 0||(((W=Wn.current)==null?void 0:W.location[0])??0)<U?void 0:y.scrollEdge})},[s,_e,U]),Vf=f.useCallback((y,F)=>{et==null||et(y-U,F)},[et,U]),$f=f.useCallback((y,F)=>{bt==null||bt(y-U,F)},[bt,U]),or=(Dl=K==null?void 0:K.current)==null?void 0:Dl.cell,Nf=f.useCallback((y,F,A,W,q,Z)=>{kr.current=!1;let Y=or;Y!==void 0&&(Y=[Y[0]-U,Y[1]]);const j=ue===0?void 0:{x:0,y:y.y,width:ue,height:y.height},Q=[];j!==void 0&&Q.push(j),Lt>0&&(Q.push({x:y.x-U,y:je-Lt,width:y.width,height:Lt}),ue>0&&Q.push({x:0,y:je-Lt,width:ue,height:Lt}));const re={x:y.x-U,y:y.y,width:y.width,height:Zt&&y.y+y.height>=je?y.height-1:y.height,tx:q,ty:Z,extras:{selected:Y,freezeRegion:j,freezeRegions:Q}};en.current=re,Mr(re),sn([F,A,W]),nn==null||nn(re,re.tx,re.ty,re.extras)},[or,U,Zt,je,ue,Lt,Mr,nn]),Bf=Dr(T,f.useCallback((y,F)=>(T==null?void 0:T(y-U,F-U))!==!1,[T,U])),Wf=Dr(Ce,f.useCallback((y,F)=>{Ce==null||Ce(y-U,F-U),rt!=="none"&&We(vt.fromSingleSelection(F),void 0,!0)},[rt,Ce,U,We])),za=f.useRef(!1),Uf=f.useCallback(y=>{if(y.location[0]===0&&U>0){y.preventDefault();return}ze==null||ze({...y,location:[y.location[0]-U,y.location[1]]}),y.defaultPrevented()||(za.current=!0),u(void 0)},[ze,U]),qf=f.useCallback(()=>{za.current=!1},[]),xl=Ve==null?void 0:Ve.selectionBehavior,Do=f.useCallback(y=>{if(xl!=="block-spanning")return;const{isGroupHeader:F,path:A,groupRows:W}=Wr(y);if(F)return[y,y];const q=A[A.length-1],Z=y-q,Y=y+W-q-1;return[Z,Y]},[Wr,xl]),Va=f.useRef(),$a=f.useCallback(y=>{var F,A,W;if(!Ld(y,Va.current)&&(Va.current=y,!(((F=Wn==null?void 0:Wn.current)==null?void 0:F.button)!==void 0&&Wn.current.button>=1))){if(y.buttons!==0&&s!==void 0&&((A=Wn.current)==null?void 0:A.location[0])===0&&y.location[0]===0&&U===1&&ae==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(Wn.current.location[1])&&K.rows.hasIndex(Wn.current.location[1])){const q=Math.min(Wn.current.location[1],y.location[1]),Z=Math.max(Wn.current.location[1],y.location[1])+1;xe(vt.fromSingleSelection([q,Z]),void 0,!1)}if(y.buttons!==0&&s!==void 0&&K.current!==void 0&&!za.current&&!Li.current&&(gt==="rect"||gt==="multi-rect")){const[q,Z]=K.current.cell;let[Y,j]=y.location;if(j<0&&(j=en.current.y),s.fillHandle===!0&&((W=s.previousSelection)==null?void 0:W.current)!==void 0){const Q=s.previousSelection.current.range;j=Math.min(j,Zt?je-1:je);const re=Bp(Q,Y,j,hn);Pa(re)}else{if(Zt&&Z===je)return;if(Zt&&j===je)if(y.kind===ca)j--;else return;Y=Math.max(Y,U);const ve=Do(Z);j=ve===void 0?j:Un(j,ve[0],ve[1]);const Oe=Y-q,ye=j-Z,Ae={x:Oe>=0?q:Y,y:ye>=0?Z:j,width:Math.abs(Oe)+1,height:Math.abs(ye)+1};Mt({...K.current,range:Ae},!0,!1,"drag")}}Yt==null||Yt({...y,location:[y.location[0]-U,y.location[1]]})}},[s,U,ae,K,gt,Yt,xe,Zt,je,hn,Do,Mt]),Yf=f.useCallback(()=>{var Y,j;const y=Va.current;if(y===void 0)return;const[F,A]=y.scrollEdge;let[W,q]=y.location;const Z=en.current;F===-1?W=((j=(Y=Z.extras)==null?void 0:Y.freezeRegion)==null?void 0:j.x)??Z.x:F===1&&(W=Z.x+Z.width),A===-1?q=Math.max(0,Z.y):A===1&&(q=Math.min(je-1,Z.y+Z.height)),W=Un(W,0,xt.length-1),q=Un(q,0,je-1),$a({...y,location:[W,q]})},[xt.length,$a,je]);Z0(Af,Wt,Yf);const Zn=f.useCallback(y=>{if(K.current===void 0)return;const[F,A]=y,[W,q]=K.current.cell,Z=K.current.range;let Y=Z.x,j=Z.x+Z.width,Q=Z.y,re=Z.y+Z.height;const[ve,Oe]=Do(q)??[0,je-1],ye=Oe+1;if(A!==0)switch(A){case 2:{re=ye,Q=q,on(0,re,"vertical");break}case-2:{Q=ve,re=q+1,on(0,Q,"vertical");break}case 1:{Q<q?(Q++,on(0,Q,"vertical")):(re=Math.min(ye,re+1),on(0,re,"vertical"));break}case-1:{re>q+1?(re--,on(0,re,"vertical")):(Q=Math.max(ve,Q-1),on(0,Q,"vertical"));break}default:oo()}if(F!==0)if(F===2)j=xt.length,Y=W,on(j-1-U,0,"horizontal");else if(F===-2)Y=U,j=W+1,on(Y-U,0,"horizontal");else{let Ae=[];if(cn!==void 0){const Ie=cn({x:Y,y:Q,width:j-Y-U,height:re-Q},un.current.signal);typeof Ie=="object"&&(Ae=sv(Ie))}if(F===1){let Ie=!1;if(Y<W){if(Ae.length>0){const pt=_r(Y+1,W+1).find(qe=>!Ae.includes(qe-U));pt!==void 0&&(Y=pt,Ie=!0)}else Y++,Ie=!0;Ie&&on(Y,0,"horizontal")}Ie||(j=Math.min(xt.length,j+1),on(j-1-U,0,"horizontal"))}else if(F===-1){let Ie=!1;if(j>W+1){if(Ae.length>0){const pt=_r(j-1,W,-1).find(qe=>!Ae.includes(qe-U));pt!==void 0&&(j=pt,Ie=!0)}else j--,Ie=!0;Ie&&on(j-U,0,"horizontal")}Ie||(Y=Math.max(U,Y-1),on(Y-U,0,"horizontal"))}else oo()}Mt({cell:K.current.cell,range:{x:Y,y:Q,width:j-Y,height:re-Q}},!0,!1,"keyboard-select")},[cn,Do,K,xt.length,U,je,on,Mt]),Na=f.useRef(ki);Na.current=ki;const Er=f.useCallback((y,F,A,W)=>{const q=yn-(A?0:1);y=Un(y,U,Qt.length-1+U),F=Un(F,0,q);const Z=or==null?void 0:or[0],Y=or==null?void 0:or[1];if(y===Z&&F===Y)return!1;if(W&&K.current!==void 0){const j=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&j.push(K.current.range),we({...K,current:{cell:[y,F],range:{x:y,y:F,width:1,height:1},rangeStack:j}},!0)}else Mt({cell:[y,F],range:{x:y,y:F,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===F&&(c.current=void 0),Na.current&&on(y-U,F),!0},[yn,U,Qt.length,or,K,on,we,Mt]),Xf=f.useCallback((y,F)=>{(i==null?void 0:i.cell)!==void 0&&y!==void 0&&gi(y)&&(Bn([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{var q;(q=fn.current)==null||q.damage([{cell:i.cell}])})),Rn(!0),o(void 0);const[A,W]=F;if(K.current!==void 0&&(A!==0||W!==0)){const q=K.current.cell[1]===yn-1&&y!==void 0;Er(Un(K.current.cell[0]+A,0,xt.length-1),Un(K.current.cell[1]+W,0,yn-1),q,!1)}_==null||_(y,F)},[i==null?void 0:i.cell,Rn,K,_,Bn,yn,Er,xt.length]),Gf=f.useMemo(()=>`gdg-overlay-${av++}`,[]),qr=f.useCallback(y=>{var A,W,q,Z;Rn();const F=[];for(let Y=y.x;Y<y.x+y.width;Y++)for(let j=y.y;j<y.y+y.height;j++){const Q=x([Y-U,j]);if(!Q.allowOverlay&&Q.kind!==ee.Boolean)continue;let re;if(Q.kind===ee.Custom){const ve=St(Q),Oe=(A=ve==null?void 0:ve.provideEditor)==null?void 0:A.call(ve,{...Q,location:[Y-U,j]});(ve==null?void 0:ve.onDelete)!==void 0?re=ve.onDelete(Q):Lg(Oe)&&(re=(W=Oe==null?void 0:Oe.deletedValue)==null?void 0:W.call(Oe,Q))}else if(gi(Q)&&Q.allowOverlay||Q.kind===ee.Boolean){const ve=St(Q);re=(q=ve==null?void 0:ve.onDelete)==null?void 0:q.call(ve,Q)}re!==void 0&&!pi(re)&&gi(re)&&F.push({location:[Y,j],value:re})}Bn(F),(Z=fn.current)==null||Z.damage(F.map(Y=>({cell:Y.location})))},[Rn,x,St,Bn,U]),Fi=i!==void 0,kl=f.useCallback(y=>{var pt,qe;const F=()=>{y.stopPropagation(),y.preventDefault()},A={didMatch:!1},{bounds:W}=y,q=K.columns,Z=K.rows,Y=$n;if(!Fi&&ut(Y.clear,y,A))we(Uo,!1),kt==null||kt();else if(!Fi&&ut(Y.selectAll,y,A))we({columns:vt.empty(),rows:vt.empty(),current:{cell:((pt=K.current)==null?void 0:pt.cell)??[U,0],range:{x:U,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(Y.search,y,A))(qe=l==null?void 0:l.current)==null||qe.focus({preventScroll:!0}),ii(!0);else if(ut(Y.delete,y,A)){const Le=(Ee==null?void 0:Ee(K))??!0;if(Le!==!1){const Rt=Le===!0?K:Le;if(Rt.current!==void 0){qr(Rt.current.range);for(const jt of Rt.current.rangeStack)qr(jt)}for(const jt of Rt.rows)qr({x:U,y:jt,width:w.length,height:1});for(const jt of Rt.columns)qr({x:jt,y:0,width:1,height:je})}}if(A.didMatch)return F(),!0;if(K.current===void 0)return!1;let[j,Q]=K.current.cell;const[,re]=K.current.cell;let ve=!1,Oe=!1;if(ut(Y.scrollToSelectedCell,y,A)?_o.current(j-U,Q):rt!=="none"&&ut(Y.selectColumn,y,A)?q.hasIndex(j)?We(q.remove(j),void 0,!0):rt==="single"?We(vt.fromSingleSelection(j),void 0,!0):We(void 0,j,!0):ae!=="none"&&ut(Y.selectRow,y,A)?Z.hasIndex(Q)?xe(Z.remove(Q),void 0,!0):ae==="single"?xe(vt.fromSingleSelection(Q),void 0,!0):xe(void 0,Q,!0):!Fi&&W!==void 0&&ut(Y.activateCell,y,A)?Q===je&&Zt?window.setTimeout(()=>{const Le=Io(j);si(Le??j)},0):(S==null||S([j-U,Q]),ai(W,!0)):K.current.range.height>1&&ut(Y.downFill,y,A)?Sl():K.current.range.width>1&&ut(Y.rightFill,y,A)?Cl():ut(Y.goToNextPage,y,A)?Q+=Math.max(1,en.current.height-4):ut(Y.goToPreviousPage,y,A)?Q-=Math.max(1,en.current.height-4):ut(Y.goToFirstCell,y,A)?(o(void 0),Q=0,j=0):ut(Y.goToLastCell,y,A)?(o(void 0),Q=Number.MAX_SAFE_INTEGER,j=Number.MAX_SAFE_INTEGER):ut(Y.selectToFirstCell,y,A)?(o(void 0),Zn([-2,-2])):ut(Y.selectToLastCell,y,A)?(o(void 0),Zn([2,2])):Fi?(ut(Y.closeOverlay,y,A)&&o(void 0),ut(Y.acceptOverlayDown,y,A)&&(o(void 0),Q++),ut(Y.acceptOverlayUp,y,A)&&(o(void 0),Q--),ut(Y.acceptOverlayLeft,y,A)&&(o(void 0),j--),ut(Y.acceptOverlayRight,y,A)&&(o(void 0),j++)):(ut(Y.goDownCell,y,A)?Q+=1:ut(Y.goUpCell,y,A)?Q-=1:ut(Y.goRightCell,y,A)?j+=1:ut(Y.goLeftCell,y,A)?j-=1:ut(Y.goDownCellRetainSelection,y,A)?(Q+=1,ve=!0):ut(Y.goUpCellRetainSelection,y,A)?(Q-=1,ve=!0):ut(Y.goRightCellRetainSelection,y,A)?(j+=1,ve=!0):ut(Y.goLeftCellRetainSelection,y,A)?(j-=1,ve=!0):ut(Y.goToLastRow,y,A)?Q=je-1:ut(Y.goToFirstRow,y,A)?Q=Number.MIN_SAFE_INTEGER:ut(Y.goToLastColumn,y,A)?j=Number.MAX_SAFE_INTEGER:ut(Y.goToFirstColumn,y,A)?j=Number.MIN_SAFE_INTEGER:(gt==="rect"||gt==="multi-rect")&&(ut(Y.selectGrowDown,y,A)?Zn([0,1]):ut(Y.selectGrowUp,y,A)?Zn([0,-1]):ut(Y.selectGrowRight,y,A)?Zn([1,0]):ut(Y.selectGrowLeft,y,A)?Zn([-1,0]):ut(Y.selectToLastRow,y,A)?Zn([0,2]):ut(Y.selectToFirstRow,y,A)?Zn([0,-2]):ut(Y.selectToLastColumn,y,A)?Zn([2,0]):ut(Y.selectToFirstColumn,y,A)&&Zn([-2,0])),Oe=A.didMatch),Kn!==void 0&&Kn!=="normal"&&Q!==re){const Le=Kn==="skip-up"||Kn==="skip"||Kn==="block",Rt=Kn==="skip-down"||Kn==="skip"||Kn==="block",jt=Q<re;if(jt&&Le){for(;Q>=0&&Wr(Q).isGroupHeader;)Q--;Q<0&&(Q=re)}else if(!jt&&Rt){for(;Q<je&&Wr(Q).isGroupHeader;)Q++;Q>=je&&(Q=re)}}const Ae=Er(j,Q,!1,ve),Ie=A.didMatch;return Ie&&(Ae||!Oe||Kt)&&F(),Ie},[Kn,Fi,K,$n,rt,ae,gt,U,Wr,je,Er,we,kt,w.length,Ee,Kt,qr,We,xe,Zt,Io,si,S,ai,Sl,Cl,Zn]),Ai=f.useCallback(y=>{let F=!1;if(B!==void 0&&B({...y,...y.location&&{location:[y.location[0]-U,y.location[1]]},cancel:()=>{F=!0}}),F||kl(y)||K.current===void 0)return;const[A,W]=K.current.cell,q=en.current;if(Je&&!y.metaKey&&!y.ctrlKey&&K.current!==void 0&&y.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(y.key)&&y.bounds!==void 0&&Ji(x([A-U,Math.max(0,Math.min(W,je-1))]))){if((!Zt||W!==je)&&(q.y>W||W>q.y+q.height||q.x>A||A>q.x+q.width))return;S==null||S([A-U,W]),ai(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[Je,B,kl,K,x,U,je,Zt,S,ai]),jf=f.useCallback((y,F)=>{const A=y.location[0]-U;if(y.kind==="header"&&(ne==null||ne(A,{...y,preventDefault:F})),y.kind===qn){if(A<0)return;J==null||J(A,{...y,preventDefault:F})}if(y.kind==="cell"){const[W,q]=y.location;N==null||N([A,q],{...y,preventDefault:F}),Hm(K,y.location)||Er(W,q,!1,!1)}},[K,N,J,ne,U,Er]),Ba=f.useCallback(async y=>{var Y,j,Q;if(!$n.paste)return;function F(re,ve,Oe,ye){var Ie,pt;const Ae=typeof Oe=="object"?(Oe==null?void 0:Oe.join(`
|
173
|
-
`))??"":(Oe==null?void 0:Oe.toString())??"";if(!pi(re)&&Ji(re)&&re.readonly!==!0){const qe=E==null?void 0:E(Ae,re);if(qe!==void 0&&gi(qe))return{location:ve,value:qe};const Le=St(re);if(Le===void 0)return;if(Le.kind===ee.Custom){An(re.kind===ee.Custom);const Rt=(Ie=Le.onPaste)==null?void 0:Ie.call(Le,Ae,re.data);return Rt===void 0?void 0:{location:ve,value:{...re,data:Rt}}}else{const Rt=(pt=Le.onPaste)==null?void 0:pt.call(Le,Ae,re,{formatted:ye,formattedString:typeof ye=="string"?ye:ye==null?void 0:ye.join(`
|
174
|
-
`),rawValue:Oe});return Rt===void 0?void 0:(An(Rt.kind===re.kind),{location:ve,value:Rt})}}}const A=K.columns,W=K.rows,q=((Y=Wt.current)==null?void 0:Y.contains(document.activeElement))===!0||((j=a.current)==null?void 0:j.contains(document.activeElement))===!0;let Z;if(K.current!==void 0?Z=[K.current.range.x,K.current.range.y]:A.length===1?Z=[A.first()??0,0]:W.length===1&&(Z=[U,W.first()??0]),q&&Z!==void 0){let re,ve;const Oe="text/plain",ye="text/html";if(navigator.clipboard.read!==void 0){const qe=await navigator.clipboard.read();for(const Le of qe){if(Le.types.includes(ye)){const jt=await(await Le.getType(ye)).text(),an=Ou(jt);if(an!==void 0){re=an;break}}Le.types.includes(Oe)&&(ve=await(await Le.getType(Oe)).text())}}else if(navigator.clipboard.readText!==void 0)ve=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=Ou(qe)}re===void 0&&y.clipboardData.types.includes(Oe)&&(ve=y.clipboardData.getData(Oe))}else return;const[Ae,Ie]=Z,pt=[];do{if(tt===void 0){const qe=_n(Z),Le=ve??(re==null?void 0:re.map(jt=>jt.map(an=>an.rawValue).join(" ")).join(" "))??"",Rt=F(qe,Z,Le,void 0);Rt!==void 0&&pt.push(Rt);break}if(re===void 0){if(ve===void 0)return;re=U0(ve)}if(tt===!1||typeof tt=="function"&&(tt==null?void 0:tt([Z[0]-U,Z[1]],re.map(qe=>qe.map(Le=>{var Rt;return((Rt=Le.rawValue)==null?void 0:Rt.toString())??""}))))!==!0)return;for(const[qe,Le]of re.entries()){if(qe+Ie>=je)break;for(const[Rt,jt]of Le.entries()){const an=[Rt+Ae,qe+Ie],[Jn,ar]=an;if(Jn>=xt.length||ar>=yn)continue;const Qn=_n(an),sr=F(Qn,an,jt.rawValue,jt.formatted);sr!==void 0&&pt.push(sr)}}}while(!1);Bn(pt),(Q=fn.current)==null||Q.damage(pt.map(qe=>({cell:qe.location})))}},[E,St,_n,K,$n.paste,Wt,xt.length,Bn,yn,tt,U,je]);pn("paste",Ba,d,!1,!0);const Hi=f.useCallback(async(y,F)=>{var Y,j;if(!$n.copy)return;const A=F===!0||((Y=Wt.current)==null?void 0:Y.contains(document.activeElement))===!0||((j=a.current)==null?void 0:j.contains(document.activeElement))===!0,W=K.columns,q=K.rows,Z=(Q,re)=>{if(!pe)_u(Q,re,y);else{const ve=re.map(Oe=>({kind:ee.Text,data:w[Oe].title,displayData:w[Oe].title,allowOverlay:!1}));_u([ve,...Q],re,y)}};if(A&&cn!==void 0){if(K.current!==void 0){let Q=cn(K.current.range,un.current.signal);typeof Q!="object"&&(Q=await Q()),Z(Q,_r(K.current.range.x-U,K.current.range.x+K.current.range.width-U))}else if(q!==void 0&&q.length>0){const re=[...q].map(ve=>{const Oe=cn({x:U,y:ve,width:w.length,height:1},un.current.signal);return typeof Oe=="object"?Oe[0]:Oe().then(ye=>ye[0])});if(re.some(ve=>ve instanceof Promise)){const ve=await Promise.all(re);Z(ve,_r(w.length))}else Z(re,_r(w.length))}else if(W.length>0){const Q=[],re=[];for(const ve of W){let Oe=cn({x:ve,y:0,width:1,height:je},un.current.signal);typeof Oe!="object"&&(Oe=await Oe()),Q.push(Oe),re.push(ve-U)}if(Q.length===1)Z(Q[0],re);else{const ve=Q.reduce((Oe,ye)=>Oe.map((Ae,Ie)=>[...Ae,...ye[Ie]]));Z(ve,re)}}}},[w,cn,K,$n.copy,U,Wt,je,pe]);pn("copy",Hi,d,!1,!1);const Kf=f.useCallback(async y=>{var A,W;if(!(!$n.cut||!(((A=Wt.current)==null?void 0:A.contains(document.activeElement))===!0||((W=a.current)==null?void 0:W.contains(document.activeElement))===!0))&&(await Hi(y),K.current!==void 0)){let q={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:vt.empty(),columns:vt.empty()};const Z=Ee==null?void 0:Ee(q);if(Z===!1||(q=Z===!0?q:Z,q.current===void 0))return;qr(q.current.range)}},[qr,K,$n.cut,Hi,Wt,Ee]);pn("cut",Kf,d,!1,!1);const Zf=f.useCallback((y,F)=>{if(Me!==void 0){U!==0&&(y=y.map(q=>[q[0]-U,q[1]])),Me(y,F);return}if(y.length===0||F===-1)return;const[A,W]=y[F];c.current!==void 0&&c.current[0]===A&&c.current[1]===W||(c.current=[A,W],Er(A,W,!1,!1))},[Me,U,Er]),[Oo,Po]=((Ol=Ht==null?void 0:Ht.current)==null?void 0:Ol.cell)??[],_o=f.useRef(on);_o.current=on,f.useLayoutEffect(()=>{var y,F,A,W;Na.current&&!kr.current&&Oo!==void 0&&Po!==void 0&&(Oo!==((F=(y=oe.current)==null?void 0:y.current)==null?void 0:F.cell[0])||Po!==((W=(A=oe.current)==null?void 0:A.current)==null?void 0:W.cell[1]))&&_o.current(Oo,Po),kr.current=!1},[Oo,Po]);const Ml=K.current!==void 0&&(K.current.cell[0]>=xt.length||K.current.cell[1]>=yn);f.useLayoutEffect(()=>{Ml&&we(Uo,!1)},[Ml,we]);const Jf=f.useMemo(()=>Zt===!0&&(Pe==null?void 0:Pe.tint)===!0?vt.fromSingleSelection(yn-1):vt.empty(),[yn,Zt,Pe==null?void 0:Pe.tint]),Qf=f.useCallback(y=>typeof at=="boolean"?at:(at==null?void 0:at(y-U))??!0,[U,at]),eh=f.useMemo(()=>{if(Fa===void 0||a.current===null)return null;const{bounds:y,group:F}=Fa,A=a.current.getBoundingClientRect();return f.createElement(_0,{bounds:y,group:F,canvasBounds:A,onClose:()=>Aa(void 0),onFinish:W=>{Aa(void 0),le==null||le(F,W)}})},[le,Fa]),th=Math.min(xt.length,ue+(Nn?1:0));f.useImperativeHandle(t,()=>({appendRow:(y,F)=>si(y+U,F),updateCells:y=>{var F;return U!==0&&(y=y.map(A=>({cell:[A.cell[0]+U,A.cell[1]]}))),(F=fn.current)==null?void 0:F.damage(y)},getBounds:(y,F)=>{var A;if(!((a==null?void 0:a.current)===null||(Wt==null?void 0:Wt.current)===null)){if(y===void 0&&F===void 0){const W=a.current.getBoundingClientRect(),q=W.width/Wt.current.clientWidth;return{x:W.x-Wt.current.scrollLeft*q,y:W.y-Wt.current.scrollTop*q,width:Wt.current.scrollWidth*q,height:Wt.current.scrollHeight*q}}return(A=fn.current)==null?void 0:A.getBounds((y??0)+U,F)}},focus:()=>{var y;return(y=fn.current)==null?void 0:y.focus()},emit:async y=>{switch(y){case"delete":Ai({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":Ai({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":Ai({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 Hi(void 0,!0);break;case"paste":await Ba();break}},scrollTo:on,remeasureColumns:y=>{for(const F of y)To(F+U)},getMouseArgsForPosition:(y,F,A)=>{if((fn==null?void 0:fn.current)===null)return;const W=fn.current.getMouseArgsForPosition(y,F,A);if(W!==void 0)return{...W,location:[W.location[0]-U,W.location[1]]}}}),[si,To,Wt,Hi,Ai,Ba,U,on]);const[Rl,El]=or??[],nh=f.useCallback(y=>{const[F,A]=y;if(A===-1){rt!=="none"&&(We(vt.fromSingleSelection(F),void 0,!1),Rn());return}Rl===F&&El===A||(Mt({cell:y,range:{x:F,y:A,width:1,height:1}},!0,!1,"keyboard-nav"),on(F,A))},[rt,Rn,on,Rl,El,Mt,We]),[rh,ih]=f.useState(!1),Il=f.useRef(Qc(y=>{ih(y)},5)),oh=f.useCallback(()=>{Il.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&s===void 0&&Mt({cell:[U,xo],range:{x:U,y:xo,width:1,height:1}},!0,!1,"keyboard-select")},[xo,K,s,U,Mt]),ah=f.useCallback(()=>{Il.current(!1)},[]),[sh,lh]=f.useMemo(()=>{let y;const F=(Pt==null?void 0:Pt.scrollbarWidthOverride)??Ss(),A=je+(Zt?1:0);if(typeof Gn=="number")y=Et+A*Gn;else{let q=0;const Z=Math.min(A,10);for(let Y=0;Y<Z;Y++)q+=Gn(Y);q=Math.floor(q/Z),y=Et+A*q}y+=F;const W=xt.reduce((q,Z)=>Z.width+q,0)+F;return[`${Math.min(1e5,W)}px`,`${Math.min(1e5,y)}px`]},[xt,Pt==null?void 0:Pt.scrollbarWidthOverride,Gn,je,Zt,Et]),uh=f.useMemo(()=>Zm(Ue),[Ue]);return f.createElement(Sd.Provider,{value:Ue},f.createElement(G0,{style:uh,className:X,inWidth:p??sh,inHeight:b??lh},f.createElement(T0,{fillHandle:Vt,drawFocusRing:zr,experimental:Pt,fixedShadowX:$t,fixedShadowY:zt,getRowThemeOverride:Vn,headerIcons:xn,imageWindowLoader:nr,initialSize:zn,isDraggable:$,onDragLeave:Qe,onRowMoved:Be,overscrollX:Ia,overscrollY:Ta,preventDiagonalScrolling:Bt,rightElement:dn,rightElementProps:Jt,smoothScrollX:kn,smoothScrollY:wn,className:X,enableGroups:Mn,onCanvasFocused:oh,onCanvasBlur:ah,canvasRef:a,onContextMenu:jf,theme:Ue,cellXOffset:_f,cellYOffset:xo,accessibilityHeight:Nr.height,onDragEnd:qf,columns:xt,nonGrowWidth:jn,drawHeader:nt,onColumnProposeMove:Bf,drawCell:ot,disabledRows:Jf,freezeColumns:th,lockColumns:U,firstColAccessible:U===0,getCellContent:_n,minColumnWidth:ir,maxColumnWidth:$r,searchInputRef:l,showSearch:Di,onSearchClose:Da,highlightRegions:Lf,getCellsForSelection:cn,getGroupDetails:_a,headerHeight:Ti,isFocused:rh,groupHeaderHeight:Mn?Co:0,freezeTrailingRows:Lt+(Zt&&(Pe==null?void 0:Pe.sticky)===!0?1:0),hasAppendRow:Zt,onColumnResize:Se,onColumnResizeEnd:me,onColumnResizeStart:ke,onCellFocused:nh,onColumnMoved:Wf,onDragStart:Uf,onHeaderMenuClick:Vf,onHeaderIndicatorClick:$f,onItemHovered:$a,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:zf,onKeyDown:Ai,onKeyUp:ce,onMouseDown:Ff,onMouseUp:Hf,onDragOverCell:Xt,onDrop:Ot,onSearchResultsChanged:Zf,onVisibleRegionChanged:Nf,clientSize:ht,rowHeight:Gn,searchResults:te,searchValue:P,onSearchValueChange:H,rows:yn,scrollRef:Wt,selection:K,translateX:Nr.tx,translateY:Nr.ty,verticalBorder:Qf,gridRef:fn,getCellRenderer:St,resizeIndicator:Ea}),eh,i!==void 0&&f.createElement(f.Suspense,{fallback:null},f.createElement(ov,{...i,validateCell:V,bloom:D,id:Gf,getCellRenderer:St,className:(Pt==null?void 0:Pt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:Sn,imageEditorOverride:g,onFinishEditing:Xf,markdownDivCreateNode:m,isOutsideClick:Cr,customEventTarget:Pt==null?void 0:Pt.eventTarget}))))},uv=f.forwardRef(lv);function Au(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:l,height:a,x:s,y:u}=i,c=t.maxSize??o.checkboxMaxSize,d=Math.floor(i.y+a/2),g=nd(c,a,o.cellVerticalPadding),h=td(t.contentAlign??"center",s,l,o.cellHorizontalPadding,g),m=ed(h,d,g),p=rd(s+n,u+r,m);return Vs(t)&&p}const cv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:ee.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>dv(e,e.cell.data,Vs(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Au(e)&&e.preventDefault()},onClick:e=>{if(Au(e))return{...e.cell,data:Ad(e.cell.data)}},onPaste:(e,t)=>{let n=ra;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=zs),n===t.data?void 0:{...t,data:n}}};function dv(e,t,n,r,i){if(!n&&t===ra)return;const{ctx:o,hoverAmount:l,theme:a,rect:s,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:b}=s;let w=!1;if(i>0){let v=n?1-i+i*l:.4;if(t===ra&&(v*=l),v===0)return;v<1&&(w=!0,o.globalAlpha=v)}Ks(o,a,t,h,m,p,b,u,c,d,r,g),w&&(o.globalAlpha=1)}const fv=vn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),hv=e=>{const{bubbles:t}=e;return f.createElement(fv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"boe-bubble"},n)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},gv={getAccessibilityString:e=>id(e.data),kind:ee.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((i,o)=>e.measureText(o).width+i+n.bubblePadding*2+n.bubbleMargin,0);return t.data.length===0?n.cellHorizontalPadding*2:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>mv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(hv,{bubbles:t.data})},onPaste:()=>{}};function mv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:l,y:a,width:s,height:u}=n;let c=l+r.cellHorizontalPadding;const d=[];for(const g of t){if(c>l+s)break;const h=ti(g,i,r.baseFontFull).width;d.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of d)ur(i,g.x,a+(u-r.bubbleHeight)/2,g.width+r.bubblePadding*2,r.bubbleHeight,r.roundingRadius??r.bubbleHeight/2);i.fillStyle=o?r.bgBubbleSelected:r.bgBubble,i.fill();for(const[g,h]of d.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+cr(i,r))}const pv=vn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),vv=e=>{const{drilldowns:t}=e;return f.createElement(pv,null,t.map((n,r)=>f.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&f.createElement("img",{src:n.img}),f.createElement("div",null,n.text))))},bv={getAccessibilityString:e=>id(e.data.map(t=>t.text)),kind:ee.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,i)=>e.measureText(i.text).width+r+n.bubblePadding*2+n.bubbleMargin+(i.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>yv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return f.createElement(vv,{drilldowns:t.data})},onPaste:()=>{}},ls={};function wv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,l=n-o*2,a=4,s=n*i,u=r+o,c=r*3,d=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(ls[g]!==void 0)return{el:ls[g],height:s,width:d,middleWidth:a*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),ls[g]=h,m.beginPath(),ur(m,o,o,c,l,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,l,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 yv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:l,row:a}=e,{x:s,width:u}=n,c=r.baseFontFull,d=Ys(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,b=r.bubbleMargin;let w=s+r.cellHorizontalPadding;const v=r.roundingRadius??6,x=wv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const S of t){if(w>s+u)break;const _=ti(S.text,i,c).width;let E=0;S.img!==void 0&&o.loadOrGetImage(S.img,l,a)!==void 0&&(E=m-8+4);const k=_+E+p*2;O.push({x:w,width:k}),w+=k+b}if(x!==null){const{el:S,height:R,middleWidth:_,sideWidth:E,width:k,dpr:L,padding:D}=x,C=E/L,T=D/L;for(const I of O){const M=Math.floor(I.x),z=Math.floor(I.width),N=z-(C-T)*2;i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,E,R,M-T,h,C,g),N>0&&i.drawImage(S,E,0,_,R,M+(C-T),h,N,g),i.drawImage(S,k-E,0,E,R,M+z-(C-T),h,C,g),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 k=o.loadOrGetImage(_.img,l,a);if(k!==void 0){const L=m-8;let D=0,C=0,T=k.width,I=k.height;T>I?(D+=(T-I)/2,T=I):I>T&&(C+=(I-T)/2,I=T),i.beginPath(),ur(i,E,h+g/2-L/2,L,L,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,T,I,E,h+g/2-L/2,L,L),i.restore(),E+=L+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+cr(i,r))}}const Cv={getAccessibilityString:e=>e.data.join(", "),kind:ee.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Sv(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??sm;return f.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}}},us=4;function Sv(e,t,n,r){const{rect:i,col:o,row:l,theme:a,ctx:s,imageLoader:u}=e,{x:c,y:d,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let b=0;for(let v=0;v<t.length;v++){const x=t[v];if(x.length===0)continue;const O=u.loadOrGetImage(x,o,l);if(O!==void 0){p[v]=O;const S=O.width*(m/O.height);b+=S+us}}if(b===0)return;b-=us;let w=c+a.cellHorizontalPadding;r==="right"?w=Math.floor(c+h-a.cellHorizontalPadding-b):r==="center"&&(w=Math.floor(c+h/2-b/2));for(const v of p){if(v===void 0)continue;const x=v.width*(m/v.height);n>0&&(s.beginPath(),ur(s,w,d+a.cellVerticalPadding,x,m,n),s.save(),s.clip()),s.drawImage(v,w,d+a.cellVerticalPadding,x,m),n>0&&s.restore(),w+=x+us}}function xv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const kv={getAccessibilityString:()=>"",kind:ee.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(xv(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+s*2>=o.width&&(a=o.width-s*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*l.cellVerticalPadding);ur(i,o.x+s,o.y+(o.height-u)/2,a,u,l.roundingRadius??3),i.fillStyle=Kr(l.textDark,.1),i.fill()},onPaste:()=>{}},Mv=()=>e=>e.targetWidth,Hu=vn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Mv(),"px"]}}),Rv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:l,validatedSelection:a}=e,s=t.data,u=t.readonly===!0,[c,d]=f.useState(s===""||r),g=f.useCallback(()=>{d(m=>!m)},[]),h=s?"gdg-ml-6":"";return c?f.createElement(Hu,{targetWidth:o.width-20},f.createElement(Qr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),f.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>l(t)},f.createElement(em,null))):f.createElement(Hu,{targetWidth:o.width},f.createElement(Rm,{contents:s,createNode:i}),!u&&f.createElement(f.Fragment,null,f.createElement("div",{className:"spacer"}),f.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},f.createElement(Ns,null))),f.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ee.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:go,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:l,validatedSelection:a}=e;return f.createElement(Rv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Iv={getAccessibilityString:e=>e.row.toString(),kind:Yn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Tv,measure:()=>44,draw:e=>Ov(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:l}=t,a=n.drawHandle?7+(o-7)/2:o/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(i-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Tv(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=Dv,n.textAlign="center",o}function Dv(e){const{ctx:t}=e;t.textAlign="start"}function Ov(e,t,n,r,i,o){const{ctx:l,rect:a,hoverAmount:s,theme:u}=e,{x:c,y:d,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&m>0){l.globalAlpha=m;const p=7*(n?s:1);if(Ks(l,u,n,i?c+p:c,d,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){l.globalAlpha=s,l.beginPath();for(const b of[3,6])for(const w of[-5,-1,3])l.rect(c+b,d+h/2+w,2,2);l.fillStyle=u.textLight,l.fill(),l.beginPath()}l.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),b=u.markerFontFull,w=c+g/2;r==="both"&&s!==0&&(l.globalAlpha=1-s),l.fillStyle=u.textLight,l.font=b,l.fillText(p,w,d+h/2+cr(l,b)),s!==0&&(l.globalAlpha=1)}}const Pv={getAccessibilityString:()=>"",kind:Yn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>_v(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function _v(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:l,spriteManager:a}=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=l.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=d-8,b=s+8/2,w=u+8/2;a.drawSprite(n,"normal",r,b,w,p,l,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,b=g?0:(1-o)*m*.5,w=l.cellHorizontalPadding+4;p>0&&(r.moveTo(s+w+b,u+d/2),r.lineTo(s+w+b+p,u+d/2),r.moveTo(s+w+b+p*.5,u+d/2-p*.5),r.lineTo(s+w+b+p*.5,u+d/2+p*.5),r.lineWidth=2,r.strokeStyle=l.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=l.textMedium,r.fillText(t,h+s+l.cellHorizontalPadding+.5,u+d/2+cr(r,l)),r.beginPath()}function Vd(e,t,n,r,i,o,l){e.textBaseline="alphabetic";const a=Lv(e,i,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),ur(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??Kr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}function Lv(e,t,n,r,i){const o=r.cellHorizontalPadding,l=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+l/2+1,width:t.width-o,height:t.height-l-1};const a=ti(n,e,r.baseFontFull,"alphabetic"),s=t.height-l,u=Math.min(s,a.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:a.width+o*3,height:u-1}}const Fv=f.lazy(async()=>await Fs(()=>import("./number-overlay-editor.DtoLRumH.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Av={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ee.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:go,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:u}=n;a===!0&&t>0&&Vd(r,i,u,s,o,t,l),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 f.createElement(f.Suspense,{fallback:null},f.createElement(Fv,{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}}},Hv={getAccessibilityString:()=>"",measure:()=>108,kind:ee.Protected,needsHover:!1,needsHoverPosition:!1,draw:zv,onPaste:()=>{}};function zv(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:l}=r;t.beginPath();const a=2.5;let s=i+n.cellHorizontalPadding+a;const u=o+l/2,c=Math.cos(nu(30))*a,d=Math.sin(nu(30))*a;for(let g=0;g<12;g++)t.moveTo(s,u-a),t.lineTo(s,u+a),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 Vv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ee.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>go(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 Ut.createElement(Qr,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:i,onChange:o=>n({...r,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ee.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:go,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:g}=t;c===!0&&n>0&&Vd(i,l,g,s,o,n,a),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 f.createElement(Qr,{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:l=>r({...i,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Nv=vn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Bv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:l}=e,[a,s]=f.useState(!i&&(t===""||r)),u=f.useCallback(()=>{s(!0)},[]);return a?f.createElement(Qr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):f.createElement(Nv,null,f.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!i&&f.createElement("div",{className:"gdg-edit-icon",onClick:u},f.createElement(Ns,null)),f.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function $d(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-l-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-l/2),{x:i,y:o,width:l,height:a}}function zu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=pd(l,o.baseFontFull);if(a===void 0)return!1;const s=$d(a,n,o,t.contentAlign);return jr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,i)}const Wv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:ee.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:go,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:l,ctx:a}=e,s=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=ti(s,a,n.baseFontFull),d=$d(c,l,n,t.contentAlign),{x:g,y:h,width:m,height:p}=d;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const b=cr(a,n.baseFontFull);r("pointer");const w=5,v=h-b;a.beginPath(),a.moveTo(l.x+g,Math.floor(l.y+v+p+w)+.5),a.lineTo(l.x+g+m,Math.floor(l.y+v+p+w)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,lr({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),lr({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),lr({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),lr({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,lr(e,s,t.contentAlign)},onSelect:e=>{zu(e)&&e.preventDefault()},onClick:e=>{var r;const{cell:t}=e;zu(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 f.createElement(Bv,{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:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Uv=[Iv,Pv,cv,gv,bv,Cv,kv,Ev,Av,Hv,Vv,$v,Wv];var cs,Vu;function qv(){if(Vu)return cs;Vu=1;var e=Jc(),t=Tc(),n="Expected a function";function r(i,o,l){var a=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return t(l)&&(a="leading"in l?!!l.leading:a,s="trailing"in l?!!l.trailing:s),e(i,o,{leading:a,maxWait:o,trailing:s})}return cs=r,cs}var Yv=qv();const Xv=br(Yv),ds=[];class Gv extends wd{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",Xv(()=>{this.imageLoaded(new ro(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const i=this.cache[r];let o=!1;for(let l=0;l<i.cells.length;l++){const a=i.cells[l];if(this.isInWindow(a)){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 l=!1;const a=ds.pop()??new Image;let s=!1;const u={img:void 0,cells:[tr(r,i)],url:n,cancel:()=>{s||(s=!0,ds.length<12?ds.unshift(a):l||(a.src=""))}},c=new Promise(d=>a.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{a.src=n,await c,await a.decode();const d=this.cache[o];if(d!==void 0&&!s){d.img=a;for(const g of d.cells)this.loadedLocations.push(js(g));l=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,r,i){const o=n,l=this.cache[o];if(l!==void 0){const a=tr(r,i);return l.cells.includes(a)||l.cells.push(a),l.img}else this.loadImage(n,r,i,o)}}const jv=(e,t)=>{const n=f.useMemo(()=>({...Vp,...e.headerIcons}),[e.headerIcons]),r=f.useMemo(()=>e.renderers??Uv,[e.renderers]),i=f.useMemo(()=>e.imageWindowLoader??new Gv,[e.imageWindowLoader]);return f.createElement(uv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Kv=f.forwardRef(jv);function $u(e,t){const n=f.useRef(null),r=f.useRef(),i=f.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return f.useEffect(()=>i,[i]),{debouncedCallback:f.useCallback((...l)=>{r.current=l,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Nd=Si("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),Pr=Si("div",{target:"ee4nolw1"})(({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}}})),Zv=Si("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Nu=[{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:"yen",label:"Yen",icon:":material/currency_yen:"},{format:"percent",label:"Percent",icon:":material/percent:"},{format:"scientific",label:"Scientific",icon:":material/experiment:"},{format:"accounting",label:"Accounting",icon:":material/finance_chip:"}],Jv={number:Nu,progress:Nu,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 Qv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:l}){const a=Zr(),{colors:s,fontSizes:u,radii:c,fontWeights:d}=a,g=Jv[e]||[];return g.length===0?lt(Pc,{}):lt(Ca,{triggerType:_c.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:lt(Nd,{role:"menu",children:g.map(h=>Fn(Pr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:wa.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:`${a.sizes.borderWidth} solid ${a.colors.borderColor}`}},Inner:{style:{backgroundColor:ya(a)?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:l})}const e1=f.memo(Qv);function t1({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:l,onHideColumn:a,columnKind:s,onChangeFormat:u,onAutosize:c}){const d=Zr(),[g,h]=f.useState(!1),{colors:m,fontSizes:p,radii:b,fontWeights:w}=d;f.useEffect(()=>{function x(O){O.preventDefault()}return document.addEventListener("wheel",x,{passive:!1}),document.addEventListener("touchmove",x,{passive:!1}),()=>{document.removeEventListener("wheel",x),document.removeEventListener("touchmove",x)}},[]);const v=f.useCallback(()=>{o()},[o]);return lt(Ca,{autoFocus:!0,"aria-label":"Dataframe column menu",content:Fn(Nd,{children:[l&&Fn(Pc,{children:[Fn(Pr,{onClick:()=>{l("asc"),v()},role:"menuitem",children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),Fn(Pr,{onClick:()=>{l("desc"),v()},role:"menuitem",children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),lt(Zv,{})]}),u&<(e1,{columnKind:s,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:Fn(Pr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[Fn("div",{children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&Fn(Pr,{onClick:()=>{c(),v()},children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&Fn(Pr,{onClick:()=>{i(),v()},children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&Fn(Pr,{onClick:()=>{r(),v()},children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&Fn(Pr,{onClick:()=>{a(),v()},children:[lt(hr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:wa.bottomRight,accessibilityType:Lc.menu,showArrow:!1,popoverMargin:mn("0.375rem"),onClickOutside:g?void 0:v,onEsc:v,overrides:{Body:{props:{"data-testid":"stDataFrameColumnMenu"},style:{paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{border:`${d.sizes.borderWidth} solid ${d.colors.borderColor}`,backgroundColor:ya(d)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:w.normal,borderTopLeftRadius:b.default,borderTopRightRadius:b.default,borderBottomLeftRadius:b.default,borderBottomRightRadius:b.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:lt("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const n1=f.memo(t1),r1="(index)",i1=({label:e,initialValue:t,onChange:n})=>{const r=Zr();return lt(bg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:vg.default,labelPlacement:pg.right,overrides:{Root:{style:({$isFocusVisible:i})=>({marginBottom:r.spacing.none,marginTop:r.spacing.none,paddingLeft:r.spacing.md,paddingRight:r.spacing.md,paddingTop:r.spacing.twoXS,paddingBottom:r.spacing.twoXS,backgroundColor:i?r.colors.darkenedBgMix25:"",display:"flex",alignItems:"start"})},Checkmark:{style:({$isFocusVisible:i,$checked:o})=>{const l=o?r.colors.primary:r.colors.fadedText40;return{outline:0,width:r.sizes.checkbox,height:r.sizes.checkbox,marginTop:r.spacing.twoXS,marginLeft:0,marginBottom:0,boxShadow:i&&o?`0 0 0 0.2rem ${hi(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:l,borderRightColor:l,borderTopColor:l,borderBottomColor:l}}},Label:{style:{lineHeight:r.lineHeights.small,paddingLeft:r.spacing.sm,position:"relative",color:r.colors.bodyText,fontSize:r.fontSizes.sm,fontWeight:r.fontWeights.normal}}},children:e})},o1=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:l,onClose:a})=>{const s=Zr();return lt(Ca,{triggerType:_c.click,placement:wa.bottomRight,autoFocus:!0,focusLock:!0,content:()=>lt("div",{style:{paddingTop:s.spacing.sm,paddingBottom:s.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return lt(i1,{label:!u.title&&u.isIndex?r1:u.title,initialValue:!(u.isHidden===!0||c),onChange:d=>{d?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:l,onClickOutside:a,onClick:()=>l?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:s.radii.default,borderTopRightRadius:s.radii.default,borderBottomLeftRadius:s.radii.default,borderBottomRightRadius:s.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${s.sizes.borderWidth} solid ${s.colors.borderColor}`}},Inner:{style:{backgroundColor:ya(s)?s.colors.bgColor:s.colors.secondaryBg,color:s.colors.bodyText,fontSize:s.fontSizes.sm,fontWeight:s.fontWeights.normal,minWidth:s.sizes.minMenuWidth,maxWidth:`calc(${s.sizes.minMenuWidth} * 2)`,maxHeight:s.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:lt("div",{children:o})})},a1=f.memo(o1);var s1=xh();const l1=br(s1);var ea={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 u1=ea.exports,Bu;function c1(){return Bu||(Bu=1,function(e,t){(function(n,r){try{e.exports=r(kh)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(u1,function(n){var r=!1,i=!1,o=!1,l=!1,a="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(),B=0,ce=!0;ce&&B<P.length;)B?P[B]==="9"?P[B]="0":(P[B]=(parseInt(P[B],10)+1).toString(),ce=!1):(parseInt(P[B],10)<5&&(ce=!1),P[B]="0"),B+=1;return ce&&P.push("1"),P.reverse().join("")}function g(H,P){var B=_(M(P).sort(),function(De){return De+":"+P[De]}).join(","),ce=H+"+"+B;return g.cache[ce]||(g.cache[ce]=Intl.NumberFormat(H,P)),g.cache[ce]}g.cache={};function h(H,P,B){var ce=P.useToLocaleString,De=P.useGrouping,Je=De&&P.grouping.slice(),be=P.maximumSignificantDigits,Ce=P.minimumIntegerDigits||1,Te=P.fractionDigits||0,yt=P.groupingSeparator,gt=P.decimalSeparator;if(ce&&B){var rt={minimumIntegerDigits:Ce,useGrouping:De};if(Te&&(rt.maximumFractionDigits=Te,rt.minimumFractionDigits=Te),be&&H>0&&(rt.maximumSignificantDigits=be),o){if(!l){var ae=I({},P);ae.useGrouping=!1,ae.decimalSeparator=".",H=parseFloat(h(H,ae),10)}return g(B,rt).format(H)}else{if(!i){var ae=I({},P);ae.useGrouping=!1,ae.decimalSeparator=".",H=parseFloat(h(H,ae),10)}return H.toLocaleString(B,rt)}}var Fe;be?Fe=H.toPrecision(be+1):Fe=H.toFixed(Te+1);var he,de,ge,ze=Fe.split("e");ge=ze[1]||"",ze=ze[0].split("."),de=ze[1]||"",he=ze[0]||"";var _e=he.length,tt=de.length,pe=_e+tt,ue=he+de;(be&&pe===be+1||!be&&tt===Te+1)&&(ue=d(ue),ue.length===pe+1&&(_e=_e+1),tt&&(ue=ue.slice(0,-1)),he=ue.slice(0,_e),de=ue.slice(_e)),be&&(de=de.replace(/0*$/,""));var it=parseInt(ge,10);it>0?de.length<=it?(de=de+c(it-de.length),he=he+de,de=""):(he=he+de.slice(0,it),de=de.slice(it)):it<0&&(de=c(Math.abs(it)-he.length)+he+de,he="0"),be||(de=de.slice(0,Te),de.length<Te&&(de=de+c(Te-de.length)),he.length<Ce&&(he=c(Ce-he.length)+he));var He="";if(De){ze=he;for(var et;ze.length;)Je.length&&(et=Je.shift()),He&&(He=yt+He),He=ze.slice(-et)+He,ze=ze.slice(0,-et)}else He=he;return de&&(He=He+gt+de),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 B=[];return R(M(P),function(ce){if(ce.slice(0,15)==="_durationLabels"){var De=ce.slice(15).toLowerCase();R(M(P[ce]),function(Je){Je.slice(0,1)===H&&B.push({type:De,key:Je,label:P[ce][Je]})})}}),B}function b(H,P,B){return P===1&&B===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:b};function v(H){return Object.prototype.toString.call(H)==="[object Array]"}function x(H){return Object.prototype.toString.call(H)==="[object Object]"}function O(H,P){for(var B=H.length;B-=1;)if(P(H[B]))return H[B]}function S(H,P){var B=0,ce=H&&H.length||0,De;for(typeof P!="function"&&(De=P,P=function(Je){return Je===De});B<ce;){if(P(H[B]))return H[B];B+=1}}function R(H,P){var B=0,ce=H.length;if(!(!H||!ce))for(;B<ce;){if(P(H[B],B)===!1)return;B+=1}}function _(H,P){var B=0,ce=H.length,De=[];if(!H||!ce)return De;for(;B<ce;)De[B]=P(H[B],B),B+=1;return De}function E(H,P){return _(H,function(B){return B[P]})}function k(H){var P=[];return R(H,function(B){B&&P.push(B)}),P}function L(H){var P=[];return R(H,function(B){S(P,B)||P.push(B)}),P}function D(H,P){var B=[];return R(H,function(ce){R(P,function(De){ce===De&&B.push(ce)})}),L(B)}function C(H,P){var B=[];return R(H,function(ce,De){if(!P(ce))return B=H.slice(De),!1}),B}function T(H,P){var B=H.slice().reverse();return C(B,P).reverse()}function I(H,P){for(var B in P)P.hasOwnProperty(B)&&(H[B]=P[B]);return H}function M(H){var P=[];for(var B in H)H.hasOwnProperty(B)&&P.push(B);return P}function z(H,P){var B=0,ce=H.length;if(!H||!ce)return!1;for(;B<ce;){if(P(H[B],B)===!0)return!0;B+=1}return!1}function N(H){var P=[];return R(H,function(B){P=P.concat(B)}),P}function X(){var H=0;try{H.toLocaleString("i")}catch(P){return P.name==="RangeError"}return!1}function ne(H){return H(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function G(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={},B;if(R(H,function(be,Ce){if(!Ce){if(!v(be))throw"Expected array as the first argument to durationsFormat.";B=be}if(typeof be=="string"||typeof be=="function"){P.template=be;return}if(typeof be=="number"){P.precision=be;return}x(be)&&I(P,be)}),!B||!B.length)return[];P.returnMomentTypes=!0;var ce=_(B,function(be){return be.format(P)}),De=D(a,L(E(N(ce),"type"))),Je=P.largest;return Je&&(De=De.slice(0,Je)),P.returnMomentTypes=!1,P.outputTypes=De,_(B,function(be){return be.format(P)})}function le(){var H=[].slice.call(arguments),P=I({},this.format.defaults),B=this.asMilliseconds(),ce=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(B=0,ce=0);var De=B<0,Je=n.duration(Math.abs(B),"milliseconds"),be=n.duration(Math.abs(ce),"months");R(H,function($){if(typeof $=="string"||typeof $=="function"){P.template=$;return}if(typeof $=="number"){P.precision=$;return}x($)&&I(P,$)});var Ce={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},Te={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};P.types=a;var yt=function($){return S(a,function(Qe){return Te[Qe].test($)})},gt=new RegExp(_(a,function($){return Te[$].source}).join("|"),"g");P.duration=this;var rt=typeof P.template=="function"?P.template.apply(P):P.template,ae=P.outputTypes,Fe=P.returnMomentTypes,he=P.largest,de=[];ae||(v(P.stopTrim)&&(P.stopTrim=P.stopTrim.join("")),P.stopTrim&&R(P.stopTrim.match(gt),function($){var Qe=yt($);Qe==="escape"||Qe==="general"||de.push(Qe)}));var ge=n.localeData();ge||(ge={}),R(M(w),function($){if(typeof w[$]=="function"){ge[$]||(ge[$]=w[$]);return}ge["_"+$]||(ge["_"+$]=w[$])}),R(M(ge._durationTimeTemplates),function($){rt=rt.replace("_"+$+"_",ge._durationTimeTemplates[$])});var ze=P.userLocale||n.locale(),_e=P.useLeftUnits,tt=P.usePlural,pe=P.precision,ue=P.forceLength,it=P.useGrouping,He=P.trunc,et=P.useSignificantDigits&&pe>0,bt=et?P.precision:0,mt=bt,Ve=P.minValue,Dt=!1,Yt=P.maxValue,kt=!1,_t=P.useToLocaleString,nn=P.groupingSeparator,Ht=P.decimalSeparator,ln=P.grouping;_t=_t&&(r||o);var It=P.trim;v(It)&&(It=It.join(" ")),It===null&&(he||Yt||et)&&(It="all"),(It===null||It===!0||It==="left"||It==="right")&&(It="large"),It===!1&&(It="");var Ct=function($){return $.test(It)},On=/large/,Sn=/small/,Pe=/both/,Lt=/mid/,hn=/^all|[^sm]all/,gn=/final/,bn=he>0||z([On,Pe,hn],Ct),at=z([Sn,Pe,hn],Ct),Xt=z([Lt,hn],Ct),Ot=z([gn,hn],Ct),rn=_(rt.match(gt),function($,Qe){var Be=yt($);return $.slice(0,1)==="*"&&($=$.slice(1),Be!=="escape"&&Be!=="general"&&de.push(Be)),{index:Qe,length:$.length,text:"",token:Be==="escape"?$.replace(Te.escape,"$1"):$,type:Be==="escape"||Be==="general"?null:Be}}),Tt={index:0,length:0,token:"",text:"",type:null},Ft=[];_e&&rn.reverse(),R(rn,function($){if($.type){(Tt.type||Tt.text)&&Ft.push(Tt),Tt=$;return}_e?Tt.text=$.token+Tt.text:Tt.text+=$.token}),(Tt.type||Tt.text)&&Ft.push(Tt),_e&&Ft.reverse();var Ne=D(a,L(k(E(Ft,"type"))));if(!Ne.length)return E(Ft,"text").join("");Ne=_(Ne,function($,Qe){var Be=Qe+1===Ne.length,fe=!Qe,st;$==="years"||$==="months"?st=be.as($):st=Je.as($);var Bt=Math.floor(st),dn=st-Bt,Jt=S(Ft,function(Kt){return $===Kt.type});return fe&&Yt&&st>Yt&&(kt=!0),Be&&Ve&&Math.abs(P.duration.as($))<Ve&&(Dt=!0),fe&&ue===null&&Jt.length>1&&(ue=!0),Je.subtract(Bt,$),be.subtract(Bt,$),{rawValue:st,wholeValue:Bt,decimalValue:Be?dn:0,isSmallest:Be,isLargest:fe,type:$,tokenLength:Jt.length}});var Vt=He?Math.floor:Math.round,Pt=function($,Qe){var Be=Math.pow(10,Qe);return Vt($*Be)/Be},$t=!1,zt=!1,xn=function($,Qe){var Be={useGrouping:it,groupingSeparator:nn,decimalSeparator:Ht,grouping:ln,useToLocaleString:_t};return et&&(bt<=0?($.rawValue=0,$.wholeValue=0,$.decimalValue=0):(Be.maximumSignificantDigits=bt,$.significantDigits=bt)),kt&&!zt&&($.isLargest?($.wholeValue=Yt,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),Dt&&!zt&&($.isSmallest?($.wholeValue=Ve,$.decimalValue=0):($.wholeValue=0,$.decimalValue=0)),$.isSmallest||$.significantDigits&&$.significantDigits-$.wholeValue.toString().length<=0?pe<0?$.value=Pt($.wholeValue,pe):pe===0?$.value=Vt($.wholeValue+$.decimalValue):et?(He?$.value=Pt($.rawValue,bt-$.wholeValue.toString().length):$.value=$.rawValue,$.wholeValue&&(bt-=$.wholeValue.toString().length)):(Be.fractionDigits=pe,He?$.value=$.wholeValue+Pt($.decimalValue,pe):$.value=$.wholeValue+$.decimalValue):et&&$.wholeValue?($.value=Math.round(Pt($.wholeValue,$.significantDigits-$.wholeValue.toString().length)),bt-=$.wholeValue.toString().length):$.value=$.wholeValue,$.tokenLength>1&&(ue||$t)&&(Be.minimumIntegerDigits=$.tokenLength,zt&&Be.maximumSignificantDigits<$.tokenLength&&delete Be.maximumSignificantDigits),!$t&&($.value>0||It===""||S(de,$.type)||S(ae,$.type))&&($t=!0),$.formattedValue=h($.value,Be,ze),Be.useGrouping=!1,Be.decimalSeparator=".",$.formattedValueEn=h($.value,Be,"en"),$.tokenLength===2&&$.type==="milliseconds"&&($.formattedValueMS=h($.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),$};if(Ne=_(Ne,xn),Ne=k(Ne),Ne.length>1){var nr=function($){return S(Ne,function(Qe){return Qe.type===$})},zn=function($){var Qe=nr($.type);Qe&&R($.targets,function(Be){var fe=nr(Be.type);fe&&parseInt(Qe.formattedValueEn,10)===Be.value&&(Qe.rawValue=0,Qe.wholeValue=0,Qe.decimalValue=0,fe.rawValue+=1,fe.wholeValue+=1,fe.decimalValue=0,fe.formattedValueEn=fe.wholeValue.toString(),zt=!0)})};R(s,zn)}return zt&&($t=!1,bt=mt,Ne=_(Ne,xn),Ne=k(Ne)),ae&&!(kt&&!P.trim)?(Ne=_(Ne,function($){return S(ae,function(Qe){return $.type===Qe})?$:null}),Ne=k(Ne)):(bn&&(Ne=C(Ne,function($){return!$.isSmallest&&!$.wholeValue&&!S(de,$.type)})),he&&Ne.length&&(Ne=Ne.slice(0,he)),at&&Ne.length>1&&(Ne=T(Ne,function($){return!$.wholeValue&&!S(de,$.type)&&!$.isLargest})),Xt&&(Ne=_(Ne,function($,Qe){return Qe>0&&Qe<Ne.length-1&&!$.wholeValue?null:$}),Ne=k(Ne)),Ot&&Ne.length===1&&!Ne[0].wholeValue&&!(!He&&Ne[0].isSmallest&&Ne[0].rawValue<Ve)&&(Ne=[])),Fe?Ne:(R(Ft,function($){var Qe=Ce[$.type],Be=S(Ne,function(Kt){return Kt.type===$.type});if(!(!Qe||!Be)){var fe=Be.formattedValueEn.split(".");fe[0]=parseInt(fe[0],10),fe[1]?fe[1]=parseFloat("0."+fe[1],10):fe[1]=null;var st=ge.durationPluralKey(Qe,fe[0],fe[1]),Bt=p(Qe,ge),dn=!1,Jt={};R(ge._durationLabelTypes,function(Kt){var kn=S(Bt,function(wn){return wn.type===Kt.type&&wn.key===st});kn&&(Jt[kn.type]=kn.label,u($.text,Kt.string)&&($.text=$.text.replace(Kt.string,kn.label),dn=!0))}),tt&&!dn&&(Bt.sort(m),R(Bt,function(Kt){if(Jt[Kt.type]===Kt.label)return u($.text,Kt.label)?!1:void 0;if(u($.text,Kt.label))return $.text=$.text.replace(Kt.label,Jt[Kt.type]),!1}))}}),Ft=_(Ft,function($){if(!$.type)return $.text;var Qe=S(Ne,function(fe){return fe.type===$.type});if(!Qe)return"";var Be="";return _e&&(Be+=$.text),(De&&kt||!De&&Dt)&&(Be+="< ",kt=!1,Dt=!1),(De&&Dt||!De&&kt)&&(Be+="> ",kt=!1,Dt=!1),De&&(Qe.value>0||It===""||S(de,Qe.type)||S(ae,Qe.type))&&(Be+="-",De=!1),$.type==="milliseconds"&&Qe.formattedValueMS?Be+=Qe.formattedValueMS:Be+=Qe.formattedValue,_e||(Be+=$.text),Be}),Ft.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ie(){var H=this.duration,P=function(Je){return H._data[Je]},B=S(this.types,P),ce=O(this.types,P);switch(B){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(B===ce)return"d __";case"weeks":return B===ce?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(B===ce)return"M __";case"years":return B===ce?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function se(H){if(!H)throw"Moment Duration Format init cannot find moment instance.";H.duration.format=J,H.duration.fn.format=le,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 Me=function(H,P,B){return H.toLocaleString(P,B)};r=X()&&G(Me),i=r&&ne(Me);var te=function(H,P,B){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(P,B).format(H)};return o=G(te),l=o&&ne(te),se(n),se})}(ea)),ea.exports}c1();const d1=["true","t","yes","y","on","1"],f1=["false","f","no","n","off","0"];function At(e,t=""){return{kind:ee.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function wi(e){return Object.hasOwn(e,"isError")&&e.isError}function h1(e){return Object.hasOwn(e,"tooltip")&&e.tooltip!==""}function xa(e){return Object.hasOwn(e,"isMissingValue")&&e.isMissingValue}function Ts(e=!1){return e?{kind:ee.Loading,allowOverlay:!1,isMissingValue:!0,copyData:""}:{kind:ee.Loading,allowOverlay:!1,copyData:""}}function g1(e,t){const n=t?"faded":"normal";return{kind:ee.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Ds(e){return{id:e.id,title:e.title,hasMenu:!1,menuIcon:"dots",themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&!e.isPinned&&{grow:1},...e.width&&{width:e.width}}}function mo(e,t){return Xe(e)?t||{}:Xe(t)?e||{}:Fc(e,t)}function Bd(e){if(Xe(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:wt(n)):[wt(t)]}catch{return[wt(e)]}}function m1(e){return e&&e.startsWith("{")&&e.endsWith("}")}function wt(e){try{try{return l1(e)}catch{return JSON.stringify(e,(n,r)=>typeof r=="bigint"?Number(r):r)}}catch{return`[${typeof e}]`}}function Wd(e){if(Xe(e))return null;if(typeof e=="boolean")return e;const t=wt(e).toLowerCase().trim();if(t==="")return null;if(d1.includes(t))return!0;if(f1.includes(t))return!1}function lo(e){if(Xe(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=Ki.unformat(e.trim());if(ft(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function da(e){if(Xe(e))return"";if(typeof e=="string")return e;try{return JSON.stringify(e,(t,n)=>typeof n=="bigint"?Number(n):n)}catch{return wt(e)}}function p1(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 Xr(e,t={}){const n=navigator.languages;try{return new Intl.NumberFormat(n,t).format(e)}catch(r){if(r instanceof RangeError)return new Intl.NumberFormat(void 0,t).format(e);throw r}}function fa(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Xe(t)||t===""?ft(n)?(n===0&&(e=Math.round(e)),Ki(e).format({thousandSeparated:!1,mantissa:n,trimMantissa:!1})):Ki(e).format({thousandSeparated:!1,mantissa:p1(e),trimMantissa:!0}):t==="plain"?Ki(e).format({thousandSeparated:!1,mantissa:20,trimMantissa:!0}):t==="localized"?Xr(e,{minimumFractionDigits:n??void 0,maximumFractionDigits:n??void 0}):t==="percent"?Xr(e,{style:"percent",minimumFractionDigits:ft(n)?Math.max(n-2,0):0,maximumFractionDigits:ft(n)?Math.max(n-2,0):2}):t==="dollar"?Xr(e,{style:"currency",currency:"USD",currencyDisplay:"narrowSymbol",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="euro"?Xr(e,{style:"currency",currency:"EUR",minimumFractionDigits:n??2,maximumFractionDigits:n??2}):t==="yen"?Xr(e,{style:"currency",currency:"JPY",minimumFractionDigits:n??0,maximumFractionDigits:n??0}):["compact","scientific","engineering"].includes(t)?Xr(e,{notation:t}):t==="accounting"?Ki(e).format({thousandSeparated:!0,negative:"parenthesis",mantissa:n??2,trimMantissa:!1}):t==="bytes"?Xr(e,{notation:"compact",style:"unit",unit:"byte",unitDisplay:"narrow",maximumFractionDigits:1}).replace("BB","GB"):yg.sprintf(t,e)}function Wu(e,t,n="datetime"){if(t==="localized"){const r=navigator.languages,i=n==="time"?void 0:"medium",o=n==="date"?void 0:"medium";try{return new Intl.DateTimeFormat(r,{dateStyle:i,timeStyle:o}).format(e.toDate())}catch(l){if(l instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:i,timeStyle:o}).format(e.toDate());throw l}}else{if(t==="distance")return e.fromNow();if(t==="calendar")return e.calendar();if(t==="iso8601")return n==="date"?e.format("YYYY-MM-DD"):n==="time"?e.format("HH:mm:ss.SSS[Z]"):e.toISOString()}return e.format(t)}function qo(e){if(Xe(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=Gr.unix(n).utc();if(r.isValid())return r.toDate()}if(typeof e=="string"){const n=Gr.utc(e);if(n.isValid())return n.toDate();const r=Gr.utc(e,[Gr.HTML5_FMT.TIME_MS,Gr.HTML5_FMT.TIME_SECONDS,Gr.HTML5_FMT.TIME]);if(r.isValid())return r.toDate()}}catch{return}}function Ud(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 v1(e,t){if(!Number.isFinite(e))return e;if(t<=0)return Math.trunc(e);const n=10**t,r=e*n,i=Number.EPSILON*Math.abs(r)*10;return Math.trunc(r+Math.sign(r)*i)/n}const b1=new RegExp(/(\r\n|\n|\r)/gm);function uo(e){return e.indexOf(`
|
186
|
-
`)!==-1?e.replace(b1," "):e}function w1(e,t){if(Xe(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 y1=Si("div",{target:"e48kivf0"})(({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"}})),qd=({jsonValue:e,theme:t})=>{let n;if(e)try{n=typeof e=="string"?qa.parse(e):qa.parse(qa.stringify(e))}catch{n=void 0}return Xe(n)?lt(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:da(e)??"",onChange:()=>{}}):lt(y1,{"data-testid":"stJsonColumnViewer",children:lt(Mh,{src:n,collapsed:2,theme:Rh(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"}})})},C1=e=>{const t=e.theme,n=e.value.data;return lt(qd,{jsonValue:n.value||n.displayValue,theme:t})},S1=e=>{const t=e.theme,n=e.value;return lt(qd,{jsonValue:n.data,theme:t})},x1={kind:ee.Custom,isMatch:e=>e.data.kind==="json-cell",draw:(e,t)=>{const{value:n,displayValue:r}=t.data;return qs(e,r??da(n)??"",t.contentAlign),!0},measure:(e,t,n)=>{const{value:r,displayValue:i}=t.data,o=i??da(r)??"";return(o?e.measureText(o).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:C1})},k1="line_chart",M1="area_chart",R1="bar_chart";function Qs(e,t,n){const r=mo({y_min:null,y_max:null},t.columnTypeOptions),i={kind:ee.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[r.y_min??0,r.y_max??1]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(o){if(Xe(o))return Ts();const l=Bd(o),a=[];let s=[];if(l.length===0)return Ts();let u=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER;for(let h=0;h<l.length;h++){const m=lo(l[h]);if(Number.isNaN(m)||Xe(m))return At(wt(l),`The value cannot be interpreted as a numeric array. ${wt(m)} is not a number.`);m>u&&(u=m),m<c&&(c=m),a.push(m)}let d,g;if(l.length===1){let h;u<=0?h=u===0?1:0:h=u,d=r.y_max??h,g=r.y_min??(u>=0?0:u)}else d=r.y_max??u,g=r.y_min??c;return Xe(g)||Xe(d)||Number.isNaN(g)||Number.isNaN(d)||g>=d?At("Invalid min/max y-axis configuration",`The y_min (${g}) and y_max (${d}) configuration options must be valid numbers.`):(a.length>0&&(u>d||c<g)?s=a.map(h=>u-c===0?u>(d||1)?d:g:(d-g)*((h-c)/(u-c))+g):s=a,{...i,copyData:a.join(","),data:{...i.data,values:s,displayValues:a.map(h=>fa(h)),yAxis:[g,d]},isMissingValue:Xe(o)})},getCellValue(o){var l,a;return o.kind===ee.Loading||((l=o.data)==null?void 0:l.values)===void 0?null:(a=o.data)==null?void 0:a.values}}}function Yd(e){return Qs(k1,e,"line")}Yd.isEditableType=!1;function Xd(e){return Qs(R1,e,"bar")}Xd.isEditableType=!1;function Gd(e){return Qs(M1,e,"area")}Gd.isEditableType=!1;function el(e){const t={kind:ee.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=Wd(n),r===void 0?At(wt(n),"The value cannot be interpreted as boolean."):{...t,data:r,isMissingValue:Xe(r)}},getCellValue(n){return n.data===void 0?null:n.data}}}el.isEditableType=!0;function Uu(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function tl(e,t,n,r,i,o,l){var h,m;const a=mo({format:n,step:r,timezone:l},t.columnTypeOptions);let s;if(ft(a.timezone))try{s=((h=Uu(Pl(),a.timezone))==null?void 0:h.utcOffset())||void 0}catch{}let u;ft(a.min_value)&&(u=qo(a.min_value)||void 0);let c;ft(a.max_value)&&(c=qo(a.max_value)||void 0);const d={kind:ee.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=a.step)==null?void 0:m.toString())||"1",format:i,min:u,max:c}},g=p=>{const b=qo(p);return b===null?!t.isRequired:!(b===void 0||ft(u)&&o(b)<o(u)||ft(c)&&o(b)>o(c))};return{...t,kind:e,sortMode:"default",validateInput:g,getCell(p,b){if(b===!0){const S=g(p);if(S===!1)return At(wt(p),"Invalid input.");S instanceof Date&&(p=S)}const w=qo(p);let v="",x="",O=s;if(w===void 0)return At(wt(p),"The value cannot be interpreted as a datetime object.");if(w!==null){let S=Pl.utc(w);if(!S.isValid())return At(wt(w),`Invalid moment date. This should never happen. Please report this bug.
|
187
|
-
Error: ${S.toString()}`);if(a.timezone){try{S=Uu(S,a.timezone)}catch(R){return At(S.toISOString(),`Failed to adjust to the provided timezone: ${a.timezone}.
|
188
|
-
Error: ${R}`)}O=S.utcOffset()}try{x=Wu(S,a.format||n,e)}catch(R){return At(S.toISOString(),`Failed to format the date for rendering with: ${a.format}.
|
189
|
-
Error: ${R}`)}v=Wu(S,n,e)}return{...d,copyData:v,isMissingValue:Xe(w),data:{...d.data,date:w,displayDate:x,timezoneOffset:O}}},getCellValue(p){var b;return Xe((b=p==null?void 0:p.data)==null?void 0:b.date)?null:o(p.data.date)}}}function nl(e){var i,o,l;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=Eh(e.arrowType),r=ft(n)||ft((l=e==null?void 0:e.columnTypeOptions)==null?void 0:l.timezone);return tl("datetime",e,r?t+"Z":t,1,"datetime-local",a=>r?a.toISOString():a.toISOString().replace("Z",""),n)}nl.isEditableType=!0;function rl(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"),tl("time",e,t,1,"time",i=>i.toISOString().split("T")[1].replace("Z",""))}rl.isEditableType=!0;function il(e){return tl("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}il.isEditableType=!0;function jd(e){const t={kind:ee.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=ft(n)?[wt(n)]:[];return{...t,data:r,isMissingValue:!ft(n),displayData:r}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}jd.isEditableType=!1;function Kd(e){const t={kind:ee.Custom,allowOverlay:!0,contentAlign: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=ft(n)?uo(da(n)):"";return{...t,copyData:r,isMissingValue:Xe(n),data:{...t.data,value:n,displayValue:r}}}catch(r){return At(wt(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}}}Kd.isEditableType=!1;function Zd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(s){n=`Invalid validate regex: ${t.validate}.
|
190
|
-
Error: ${s}`}let r=!1,i=t.display_text,o;if(!Xe(i)){if(i.startsWith(":material/")&&Ih(i))i=Th(i).icon,r=!0;else if(i.includes("(")&&i.includes(")"))try{o=new RegExp(i,"us")}catch{o=void 0}}const l={kind:ee.Uri,readonly:!e.isEditable,allowOverlay:!r,contentAlign:e.contentAlignment??(r?"center":void 0),style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:"",...r&&{themeOverride:{fontFamily:Dh.iconFont,linkColor:void 0}}},a=s=>{if(Xe(s))return!e.isRequired;const u=wt(s);return!(t.max_chars&&u.length>t.max_chars||n instanceof RegExp&&n.test(u)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:a,getCell(s,u){if(Xe(s))return{...l,data:null,isMissingValue:!0,onClickUri:()=>{},themeOverride:void 0};const c=s;if(typeof n=="string")return At(wt(c),n);if(u&&a(c)===!1)return At(wt(c),"Invalid input.");let d="";return c&&(o!==void 0?d=w1(o,c):d=i||c),{...l,data:c,displayData:d,isMissingValue:Xe(c),onClickUri:g=>{window.open(c.startsWith("www.")?`https://${c}`:c,"_blank","noopener,noreferrer"),g.preventDefault()},copyData:c}},getCellValue(s){return Xe(s.data)?null:s.data}}}Zd.isEditableType=!0;function ol(e){const t={kind:ee.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const r=Xe(n)?[]:Bd(n);return{...t,data:r,isMissingValue:Xe(n),copyData:Xe(n)?"":wt(r.map(i=>typeof i=="string"&&i.includes(",")?i.replace(/,/g," "):i))}},getCellValue(n){return Xe(n.data)||xa(n)?null:n.data}}}ol.isEditableType=!1;function al(e){const t=mo({step:Ac(e.arrowType)?1:void 0,min_value:Oh(e.arrowType)?0:void 0},e.columnTypeOptions),n=!t.format&&(Ph(e.arrowType)||_h(e.arrowType)),r=Xe(t.min_value)||t.min_value<0,i=ft(t.step)&&!Number.isNaN(t.step)?Ud(t.step):void 0,o={kind:ee.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:""},l=a=>{let s=lo(a);if(Xe(s))return!e.isRequired;if(Number.isNaN(s))return!1;let u=!1;return ft(t.max_value)&&s>t.max_value&&(s=t.max_value,u=!0),ft(t.min_value)&&s<t.min_value?!1:u?s:!0};return{...e,kind:"number",sortMode:"smart",validateInput:l,getCell(a,s){if(s===!0){const d=l(a);if(d===!1)return At(wt(a),"Invalid input.");typeof d=="number"&&(a=d)}let u=lo(a),c="";if(ft(u)){if(Number.isNaN(u))return At(wt(a),"The value cannot be interpreted as a number.");if(ft(i)&&(u=v1(u,i)),Number.isInteger(u)&&!Number.isSafeInteger(u))return At(wt(a),"The value is larger than the maximum supported integer values in number columns (2^53).");try{n?c=Cs(u,e.arrowType):c=fa(u,t.format,i)}catch(d){return At(wt(u),ft(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:Xe(u),copyData:Xe(u)?"":wt(u)}},getCellValue(a){return a.data===void 0?null:a.data}}}al.isEditableType=!0;function co(e){const t={kind:ee.Text,data:"",displayData:"",allowOverlay:!0,contentAlign: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=ft(n)?wt(n):null,i=ft(r)?uo(r):"";return{...t,data:r,displayData:i,isMissingValue:Xe(n)}}catch(r){return At(wt(n),`The value cannot be interpreted as a string. Error: ${r}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}co.isEditableType=!1;function Jd(e){const t=Ac(e.arrowType),n=mo({min_value:0,max_value:t?100:1,format:t?"%3d%%":"percent",step:t?1:void 0},e.columnTypeOptions);let r;try{r=fa(n.max_value,n.format)}catch{r=wt(n.max_value)}const i=Xe(n.step)||Number.isNaN(n.step)?void 0:Ud(n.step),o={kind:ee.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,readonly:!0,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step??.01,value:n.min_value,label:String(n.min_value),measureLabel:r}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(l){if(Xe(l))return Ts();if(Xe(n.min_value)||Xe(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return At("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(ft(n.step)&&Number.isNaN(n.step))return At("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const a=lo(l);if(Number.isNaN(a)||Xe(a))return At(wt(l),"The value cannot be interpreted as a number.");if(Number.isInteger(a)&&!Number.isSafeInteger(a))return At(wt(l),"The value is larger than the maximum supported integer values in number columns (2^53).");let s="";try{s=fa(a,n.format,i)}catch(c){return At(wt(a),ft(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,a));return{...o,isMissingValue:Xe(l),copyData:String(a),data:{...o.data,value:u,label:s}}},getCellValue(l){var a,s;return l.kind===ee.Loading||((a=l.data)==null?void 0:a.value)===void 0?null:(s=l.data)==null?void 0:s.value}}}Jd.isEditableType=!1;function sl(e){let t="string";const n=mo({options:Hc(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:ee.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=>wt(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,l){let a=null;return ft(o)&&o!==""&&(a=wt(o)),l&&!i.data.allowedValues.includes(a)?At(wt(a),"The value is not part of the allowed options."):{...i,isMissingValue:a===null,copyData:a||"",data:{...i.data,value:a}}},getCellValue(o){var l,a,s,u,c;return Xe((l=o.data)==null?void 0:l.value)||((a=o.data)==null?void 0:a.value)===""?null:t==="number"?lo((s=o.data)==null?void 0:s.value)??null:t==="boolean"?Wd((u=o.data)==null?void 0:u.value)??null:(c=o.data)==null?void 0:c.value}}}sl.isEditableType=!0;function ll(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:ee.Text,data:"",displayData:"",allowOverlay:!0,contentAlign:e.contentAlignment,allowWrapping:e.isWrappingAllowed,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},i=o=>{if(Xe(o))return!e.isRequired;let l=wt(o),a=!1;return t.max_chars&&l.length>t.max_chars&&(l=l.slice(0,t.max_chars),a=!0),n instanceof RegExp&&n.test(l)===!1?!1:a?l:!0};return{...e,kind:"text",sortMode:"default",validateInput:i,getCell(o,l){if(typeof n=="string")return At(wt(o),n);if(l){const a=i(o);if(a===!1)return At(wt(o),"Invalid input.");typeof a=="string"&&(o=a)}try{const a=ft(o)?wt(o):null,s=ft(a)?uo(a):"";return{...r,isMissingValue:Xe(a),data:a,displayData:s}}catch(a){return At("Incompatible value",`The value cannot be interpreted as string. Error: ${a}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ll.isEditableType=!0;const qu=Si("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),E1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?lt("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:lt(qu,{src:t})}):lt(qu,{src:t})},Yu=new Map(Object.entries({object:co,text:ll,checkbox:el,selectbox:sl,list:ol,number:al,link:Zd,datetime:nl,date:il,time:rl,line_chart:Yd,bar_chart:Xd,area_chart:Gd,image:jd,progress:Jd,json:Kd})),I1=[x1];var T1=zc();const D1=br(T1);var fs,Xu;function O1(){if(Xu)return fs;Xu=1;var e=Lh(),t=Fh(),n=Ah(),r=zc(),i=Hh(),o=zh(),l=Vh(),a=$h(),s="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function g(h){if(h==null)return!0;if(i(h)&&(r(h)||typeof h=="string"||typeof h.splice=="function"||o(h)||a(h)||n(h)))return!h.length;var m=t(h);if(m==s||m==u)return!h.size;if(l(h))return!e(h).length;for(var p in h)if(d.call(h,p))return!1;return!0}return fs=g,fs}var P1=O1();const _1=br(P1);function hs(e,t,n){if(!n.includes(t))return;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 L1(e,t,n){const r={};if(!n.includes(t))return e;const i=hs(t,"color",n);i&&(r.textDark=i,e.kind===ee.Bubble&&(r.textBubble=i),e.kind===ee.Uri&&(r.linkColor=i));const o=hs(t,"background-color",n);o&&(r.bgCell=o),o==="yellow"&&i===void 0&&(r.textDark="#31333F");const l=hs(t,"font-weight",n);return l&&(r.baseFontStyle=`${l} ${tg.sm}`),r?{...e,themeOverride:r}:e}function F1(e){return Yh(e)||Xh(e)?ll:Gh(e)?nl:Vc(e)?rl:jh(e)?il:Kh(e)||Zh(e)?co:Hc(e)?el:Jh(e)?al:Qh(e)?sl:eg(e)?ol:co}function Qd(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 ul(e){return{group:void 0,isEditable:!1,isIndex:!1,isPinned:!1,isHidden:!1,isStretched:!1,...e}}function A1(e,t){const n=e.columnNames.map(a=>a[t]),{title:r,group:i}=Qd(n),o=e.columnTypes[t];let l=!0;return qh(o)&&(l=!1),ul({id:`_index-${t}`,indexNumber:t,name:r,title:r,group:i,isEditable:l,arrowType:o,isIndex:!0,isPinned:!0})}function H1(e,t){const n=e.columnNames.map(l=>l[t]),{title:r,group:i}=Qd(n),o=e.columnTypes[t];return ul({id:`_column-${r}-${t}`,indexNumber:t,name:r,isEditable:!0,title:r,arrowType:o,group:i})}function ef(){return ul({id:"_empty-index",indexNumber:0,title:"",name:"",isEditable:!1,isIndex:!0,isPinned:!0,arrowType:{type:ng.INDEX,arrowField:new Nh("",new Bh,!0),pandasType:void 0}})}function Gu(e){const t=[],{dimensions:n}=e,r=n.numIndexColumns,i=n.numDataColumns;if(r===0&&i===0)return t.push(ef()),t;for(let o=0;o<r;o++)t.push(A1(e,o));for(let o=0;o<i;o++)t.push(H1(e,o+r));return t}function z1(e,t,n,r=void 0){var o,l,a,s,u,c;let i;if(e.kind==="object"||e.kind==="json")i=e.getCell(ft(t.content)?uo(Cs(t.content,t.contentType)):null);else if(["time","date","datetime"].includes(e.kind)&&ft(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;Vc(t.contentType)&&ft((l=(o=t.field)==null?void 0:o.type)==null?void 0:l.unit)?d=Wh(t.content,t.field):d=Gr.utc(Number(t.content)).toDate(),i=e.getCell(d)}else if(Uh(t.contentType)){const d=Xe(t.content)?null:Cs(t.content,t.contentType);i=e.getCell(d)}else i=e.getCell(t.content);if(wi(i))return i;if(!e.isEditable){if(n&&ft(n==null?void 0:n.displayContent)){const d=uo(n.displayContent);i.kind===ee.Text?i={...i,displayData:d}:i.kind===ee.Number&&Xe((a=e.columnTypeOptions)==null?void 0:a.format)?i={...i,displayData:d}:i.kind===ee.Uri&&Xe((s=e.columnTypeOptions)==null?void 0:s.display_text)?i={...i,displayData:d}:i.kind===ee.Custom&&((u=i.data)==null?void 0:u.kind)==="date-picker-cell"&&Xe((c=e.columnTypeOptions)==null?void 0:c.format)&&(i={...i,data:{...i.data,displayDate:d}})}r&&(n!=null&&n.cssId)&&(i=L1(i,n.cssId,r))}return i}const ta="_index",ju="_pos:",Ku={small:75,medium:200,large:400},tf=As.getLogger("useColumnLoader");function V1(e){if(!Xe(e)){if(typeof e=="number")return e;if(e in Ku)return Ku[e]}}const Yo=(e,t)=>wg(e,t,(r,i)=>{if(D1(i))return i});function Zu(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(ta)&&(n=Yo(n,t.get(ta)??{})),t.has(`${ju}${e.indexNumber}`)&&(n=Yo(n,t.get(`${ju}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==ta&&(n=Yo(n,t.get(e.name)??{})),t.has(e.id)&&(n=Yo(n,t.get(e.id)??{})),_1(n)?e:Fc({...e},{title:n.label,width:V1(n.width),isEditable:ft(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 $1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return tf.error(t),new Map}}function Ju(e){var r;const t=(r=e.columnTypeOptions)==null?void 0:r.type;let n;return ft(t)&&(Yu.has(t)?n=Yu.get(t):tf.warn(`Unknown column type configured in column configuration: ${t}`)),Xe(n)&&(n=F1(e.arrowType)),n}function N1(e,t,n,r){const i=Zr(),o=f.useMemo(()=>$1(e.columns),[e.columns]),[l,a]=f.useState(o);f.useEffect(()=>{a(o)},[o]);const s=e.useContainerWidth||ft(e.width)&&e.width>0,u=ft(e.rowHeight)&&e.rowHeight>mn("4rem"),c=f.useMemo(()=>Gu(t).map(g=>{let h={...g,...Zu(g,l),isStretched:s};const m=Ju(h);return(e.editingMode===En.EditingMode.READ_ONLY||n||m.isEditableType===!1)&&(h={...h,isEditable:!1}),e.editingMode!==En.EditingMode.READ_ONLY&&h.isEditable==!0&&(h={...h,icon:"editable"},h.isRequired&&e.editingMode===En.EditingMode.DYNAMIC&&(h={...h,isHidden:!1})),m(h,i)}),[t,l,s,e.editingMode,n,i]);return{columns:f.useMemo(()=>{const g=Gu(t).map(b=>{let w={...b,...Zu(b,l),isStretched:s,isWrappingAllowed:u};const v=Ju(w);return(e.editingMode===En.EditingMode.READ_ONLY||n||v.isEditableType===!1)&&(w={...w,isEditable:!1}),e.editingMode!==En.EditingMode.READ_ONLY&&w.isEditable==!0&&(w={...w,icon:"editable"},w.isRequired&&e.editingMode===En.EditingMode.DYNAMIC&&(w={...w,isHidden:!1})),v(w,i)}).filter(b=>!b.isHidden),h=[],m=[];r!=null&&r.length?(g.forEach(b=>{b.isIndex&&!r.includes(b.name)&&!r.includes(b.id)&&b.isPinned!==!1&&h.push(b)}),r.forEach(b=>{const w=g.find(v=>v.name===b||v.id===b);w&&(w.isPinned?h.push(w):m.push(w))})):g.forEach(b=>{b.isPinned?h.push(b):m.push(b)});const p=[...h,...m];return p.length>0?p:[co(ef())]},[t,l,u,s,n,e.editingMode,r,i]),allColumns:c,setColumnConfigMapping:a}}function io(e){return e.isIndex?ta:Xe(e.name)?"":e.name}class Xo{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,l,a)=>{const s={};o.forEach((u,c)=>{const d=n.get(c);d&&(s[io(d)]=d.getCellValue(u))}),r.edited_rows[l]=s}),this.addedRows.forEach(o=>{const l={};let a=!1;o.forEach((s,u,c)=>{const d=n.get(u);if(d){const g=d.getCellValue(s);d.isRequired&&d.isEditable&&xa(s)&&(a=!0),ft(g)&&(l[io(d)]=g)}}),a||r.added_rows.push(l)}),r.deleted_rows=this.deletedRows,JSON.stringify(r,(o,l)=>l===void 0?null:l)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const r=JSON.parse(t),i=new Map;n.forEach(l=>{i.set(l.indexNumber,l)});const o=new Map;n.forEach(l=>{o.set(io(l),l)}),Object.keys(r.edited_rows).forEach(l=>{const a=Number(l),s=r.edited_rows[l];Object.keys(s).forEach(u=>{var g;const c=s[u],d=o.get(u);if(d){const h=d.getCell(c);h&&(this.editedCells.has(a)||this.editedCells.set(a,new Map),(g=this.editedCells.get(a))==null||g.set(d.indexNumber,h))}})}),r.added_rows.forEach(l=>{const a=new Map;n.forEach(s=>{a.set(s.indexNumber,s.getCell(null))}),Object.keys(l).forEach(s=>{const u=l[s],c=o.get(s);if(c){const d=c.getCell(u);d&&a.set(c.indexNumber,d)}}),this.addedRows.push(a)}),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(!(Xe(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 fo=({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 B1(e){return{changeColumnFormat:f.useCallback((n,r)=>{e(i=>fo({columnId:n,columnConfigMapping:i,updatedProps:{type_config:{format:r}}}))},[e])}}function W1(e,t,n,r,i,o){const l=f.useMemo(()=>e.filter(c=>c.isPinned).reduce((c,d)=>c+(d.width??r*2),0)>n*.6,[e,n,r]),a=t||l?0:e.filter(c=>c.isPinned).length,s=f.useCallback(c=>{o(d=>fo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!1}})),i(!0,!1)},[i,o]);return{pinColumn:f.useCallback(c=>{o(d=>fo({columnId:c,columnConfigMapping:d,updatedProps:{pinned:!0}})),i(!0,!1)},[i,o]),unpinColumn:s,freezeColumns:a}}function U1(e,t,n,r,i){return{onColumnMoved:f.useCallback((l,a)=>{const s=[...e],[u]=s.splice(l,1);s.splice(a,0,u),a<t&&!u.isPinned?n(u.id):a>=t&&u.isPinned&&r(u.id),i(s.map(c=>c.id))},[e,t,n,r,i])}}function q1(e){const[t,n]=f.useState(()=>new Map),r=f.useCallback((o,l,a,s)=>{o.id&&n(new Map(t).set(o.id,s))},[t]);return{columns:f.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 Y1(e){var t,n;switch(e.kind){case ee.Number:return((t=e.data)==null?void 0:t.toString())??"";case ee.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case ee.Markdown:case ee.RowID:case ee.Text:case ee.Uri:return e.data??"";case ee.Bubble:case ee.Image:return e.data.join("");case ee.Drilldown:return e.data.map(r=>r.text).join("");case ee.Protected:case ee.Loading:return"";case ee.Custom:return e.copyData}}function Qu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function X1(e,t){return e=Qu(e),t=Qu(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 G1(e,t){return e>t?1:e===t?0:-1}function j1(e){const{sort:t,rows:n,getCellContent:r}=e,i=f.useMemo(()=>t===void 0?[]:Array.isArray(t)?t:[t],[t]),o=f.useMemo(()=>i.map(u=>{const c=e.columns.findIndex(d=>u.column===d||d.id!==void 0&&u.column.id===d.id);return c===-1?void 0:c}),[i,e.columns]),l=f.useMemo(()=>{const u=i.map((d,g)=>({sort:d,col:o[g]})).filter(d=>d.col!==void 0);if(u.length===0)return;const c=u.map(()=>new Array(n));for(let d=0;d<u.length;d++){const{col:g}=u[d],h=[g,0];for(let m=0;m<n;m++)h[1]=m,c[d][m]=Y1(r(h))}return _r(n).sort((d,g)=>{for(let h=0;h<u.length;h++){const{sort:m}=u[h],p=c[h][d],b=c[h][g];let w;if(m.mode==="raw"?w=G1(p,b):m.mode==="smart"?w=X1(p,b):w=p.localeCompare(b),w!==0)return(m.direction??"asc")==="desc"&&(w=-w),w}return 0})},[r,n,i,o]),a=f.useCallback(u=>l===void 0?u:l[u],[l]),s=f.useCallback(([u,c])=>l===void 0?r([u,c]):(c=l[c],r([u,c])),[r,l]);return l===void 0?{getCellContent:e.getCellContent,getOriginalIndex:a}:{getOriginalIndex:a,getCellContent:s}}function K1(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 Z1(e,t,n){const[r,i]=f.useState(),{getCellContent:o,getOriginalIndex:l}=j1({columns:t.map(u=>Ds(u)),getCellContent:n,rows:e,sort:r}),a=f.useMemo(()=>K1(t,r),[t,r]),s=f.useCallback((u,c,d)=>{const g=a[u];let h;c==="auto"?(h="asc",r&&r.column.id===g.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:Ds(g),direction:h,mode:g.sortMode})},[r,a]);return{columns:a,sortColumn:s,getOriginalIndex:l,getCellContent:o}}function J1(e,t){const n=f.useCallback(i=>{t(o=>fo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!0}})),e(!0,!1)},[e,t]),r=f.useCallback(i=>{t(o=>fo({columnId:i,columnConfigMapping:o,updatedProps:{hidden:!1}})),e(!0,!1)},[e,t]);return{hideColumn:n,showColumn:r}}function Q1(){return{provideEditor:f.useCallback(t=>{if(t.kind===ee.Text&&t.readonly&&m1(t.data))return{editor:S1}},[])}}const eb={kind:ee.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:l}=e;let{values:a,yAxis:s,color:u,graphKind:c="area",displayValues:d,hideAxis:g}=t.data;const[h,m]=s;if(a.length===0)return!0;a=a.map(R=>Math.min(1,Math.max(0,(R-h)/(m-h))));const p=r.cellHorizontalPadding,b=p+i.x,w=i.y+3,v=i.height-6,x=i.width-p*2,O=m-h,S=m<=0?w:h>=0?w+v:w+v*(m/O);if(!g&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(b,S),n.lineTo(b+x,S),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=r.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const R=2,_=(a.length-1)*R,E=(x-_)/a.length;let k=b;for(const L of a){const D=w+v-L*v;n.moveTo(k,S),n.lineTo(k+E,S),n.lineTo(k+E,D),n.lineTo(k,D),k+=E+R}n.fillStyle=t.data.color??r.accentColor,n.fill()}else{a.length===1&&(a=[a[0],a[0]],d&&(d=[d[0],d[0]])),n.beginPath();const R=(i.width-16)/(a.length-1),_=a.map((k,L)=>({x:b+R*L,y:w+v-k*v}));n.moveTo(_[0].x,_[0].y);let E=0;if(_.length>2)for(E=1;E<_.length-2;E++){const k=(_[E].x+_[E+1].x)/2,L=(_[E].y+_[E+1].y)/2;n.quadraticCurveTo(_[E].x,_[E].y,k,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 k=n.createLinearGradient(0,w,0,w+v*1.4);k.addColorStop(0,u??r.accentColor);const[L,D,C]=sa(u??r.accentColor);k.addColorStop(1,`rgba(${L}, ${D}, ${C}, 0)`),n.fillStyle=k,n.fill(),n.globalAlpha=1}if(l!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const k=Math.min(a.length-1,Math.max(0,Math.round((l-p)/R)));n.moveTo(b+k*R,i.y+1),n.lineTo(b+k*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[k],b,i.y+r.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function ec(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 tc(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?tc(Object(n),!0).forEach(function(r){Zi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var tb=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function nb(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,l=o===void 0?null:o,a=e.inputValue,s=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,g=e.onMenuOpen,h=e.value,m=wr(e,tb),p=f.useState(a!==void 0?a:n),b=mr(p,2),w=b[0],v=b[1],x=f.useState(s!==void 0?s:i),O=mr(x,2),S=O[0],R=O[1],_=f.useState(h!==void 0?h:l),E=mr(_,2),k=E[0],L=E[1],D=f.useCallback(function(X,ne){typeof u=="function"&&u(X,ne),L(X)},[u]),C=f.useCallback(function(X,ne){var G;typeof c=="function"&&(G=c(X,ne)),v(G!==void 0?G:X)},[c]),T=f.useCallback(function(){typeof g=="function"&&g(),R(!0)},[g]),I=f.useCallback(function(){typeof d=="function"&&d(),R(!1)},[d]),M=a!==void 0?a:w,z=s!==void 0?s:S,N=h!==void 0?h:k;return Ye(Ye({},m),{},{inputValue:M,menuIsOpen:z,onChange:D,onInputChange:C,onMenuClose:I,onMenuOpen:T,value:N})}function rb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const ib=Math.min,ob=Math.max,ha=Math.round,Go=Math.floor,ga=e=>({x:e,y:e});function ab(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 ka(){return typeof window<"u"}function nf(e){return of(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rf(e){var t;return(t=(of(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function of(e){return ka()?e instanceof Node||e instanceof vr(e).Node:!1}function sb(e){return ka()?e instanceof Element||e instanceof vr(e).Element:!1}function cl(e){return ka()?e instanceof HTMLElement||e instanceof vr(e).HTMLElement:!1}function nc(e){return!ka()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function af(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=dl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function lb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ub(e){return["html","body","#document"].includes(nf(e))}function dl(e){return vr(e).getComputedStyle(e)}function cb(e){if(nf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nc(e)&&e.host||rf(e);return nc(t)?t.host:t}function sf(e){const t=cb(e);return ub(t)?e.ownerDocument?e.ownerDocument.body:e.body:cl(t)&&af(t)?t:sf(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=sf(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=vr(i);if(o){const a=Os(l);return t.concat(l,l.visualViewport||[],af(i)?i:[],a&&n?ma(a):[])}return t.concat(i,ma(i,[],n))}function Os(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function db(e){const t=dl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=cl(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=ha(n)!==o||ha(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function fl(e){return sb(e)?e:e.contextElement}function rc(e){const t=fl(e);if(!cl(t))return ga(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=db(t);let l=(o?ha(n.width):n.width)/r,a=(o?ha(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const fb=ga(0);function hb(e){const t=vr(e);return!lb()||!t.visualViewport?fb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gb(e,t,n){return!1}function ic(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=fl(e);let l=ga(1);t&&(l=rc(e));const a=gb()?hb(o):ga(0);let s=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const g=vr(o),h=r;let m=g,p=Os(m);for(;p&&r&&h!==m;){const b=rc(p),w=p.getBoundingClientRect(),v=dl(p),x=w.left+(p.clientLeft+parseFloat(v.paddingLeft))*b.x,O=w.top+(p.clientTop+parseFloat(v.paddingTop))*b.y;s*=b.x,u*=b.y,c*=b.x,d*=b.y,s+=x,u+=O,m=vr(p),p=Os(m)}}return ab({width:c,height:d,x:s,y:u})}function mb(e,t){let n=null,r;const i=rf(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),o();const{left:u,top:c,width:d,height:g}=e.getBoundingClientRect();if(a||t(),!d||!g)return;const h=Go(c),m=Go(i.clientWidth-(u+d)),p=Go(i.clientHeight-(c+g)),b=Go(u),v={rootMargin:-h+"px "+-m+"px "+-p+"px "+-b+"px",threshold:ob(0,ib(1,s))||1};let x=!0;function O(S){const R=S[0].intersectionRatio;if(R!==s){if(!x)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(O,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,v)}n.observe(e)}return l(!0),o}function pb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,u=fl(e),c=i||o?[...u?ma(u):[],...ma(t)]:[];c.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=u&&a?mb(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(w=>{let[v]=w;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!s&&h.observe(u),h.observe(t));let m,p=s?ic(e):null;s&&b();function b(){const w=ic(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,m=requestAnimationFrame(b)}return n(),()=>{var w;c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,s&&cancelAnimationFrame(m)}}var Ps=f.useLayoutEffect,vb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],pa=function(){};function bb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function wb(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 l in t)t.hasOwnProperty(l)&&t[l]&&o.push("".concat(bb(e,l)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var oc=function(t){return Ib(t)?t.filter(Boolean):rg(t)==="object"&&t!==null?[t]:[]},lf=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=wr(t,vb);return Ye({},n)},tn=function(t,n,r){var i=t.cx,o=t.getStyles,l=t.getClassNames,a=t.className;return{css:o(n,t),className:i(r??{},l(n,t),a)}};function Ma(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function yb(e){return Ma(e)?window.innerHeight:e.clientHeight}function uf(e){return Ma(e)?window.pageYOffset:e.scrollTop}function va(e,t){if(Ma(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Cb(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 Sb(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function jo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:pa,i=uf(e),o=t-i,l=10,a=0;function s(){a+=l;var u=Sb(a,i,o,n);va(e,u),a<n?window.requestAnimationFrame(s):r(e)}s()}function ac(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?va(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&va(e,Math.max(t.offsetTop-i,0))}function xb(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 sc(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function kb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var cf=!1,Mb={get passive(){return cf=!0}},Ko=typeof window<"u"?window:{};Ko.addEventListener&&Ko.removeEventListener&&(Ko.addEventListener("p",pa,Mb),Ko.removeEventListener("p",pa,!1));var Rb=cf;function Eb(e){return e!=null}function Ib(e){return Array.isArray(e)}function Zo(e,t,n){return e?t:n}var Tb=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(l){var a=mr(l,1),s=a[0];return!r.includes(s)});return o.reduce(function(l,a){var s=mr(a,2),u=s[0],c=s[1];return l[u]=c,l},{})},Db=["children","innerProps"],Ob=["children","innerProps"];function Pb(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,l=e.isFixedPosition,a=e.controlHeight,s=Cb(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=s.getBoundingClientRect(),d=c.height,g=n.getBoundingClientRect(),h=g.bottom,m=g.height,p=g.top,b=n.offsetParent.getBoundingClientRect(),w=b.top,v=l?window.innerHeight:yb(s),x=uf(s),O=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),R=w-S,_=v-p,E=R+x,k=d-x-p,L=h-v+x+O,D=x+p-S,C=160;switch(i){case"auto":case"bottom":if(_>=m)return{placement:"bottom",maxHeight:t};if(k>=m&&!l)return o&&jo(s,L,C),{placement:"bottom",maxHeight:t};if(!l&&k>=r||l&&_>=r){o&&jo(s,L,C);var T=l?_-O:k-O;return{placement:"bottom",maxHeight:T}}if(i==="auto"||l){var I=t,M=l?R:E;return M>=r&&(I=Math.min(M-O-a,t)),{placement:"top",maxHeight:I}}if(i==="bottom")return o&&va(s,L),{placement:"bottom",maxHeight:t};break;case"top":if(R>=m)return{placement:"top",maxHeight:t};if(E>=m&&!l)return o&&jo(s,D,C),{placement:"top",maxHeight:t};if(!l&&E>=r||l&&R>=r){var z=t;return(!l&&E>=r||l&&R>=r)&&(z=l?R-S:E-S),o&&jo(s,D,C),{placement:"top",maxHeight:z}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function _b(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var df=function(t){return t==="auto"?"bottom":t},Lb=function(t,n){var r,i=t.placement,o=t.theme,l=o.borderRadius,a=o.spacing,s=o.colors;return Ye((r={label:"menu"},Zi(r,_b(i),"100%"),Zi(r,"position","absolute"),Zi(r,"width","100%"),Zi(r,"zIndex",1),r),n?{}:{backgroundColor:s.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},ff=f.createContext(null),Fb=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,l=t.menuPosition,a=t.menuShouldScrollIntoView,s=t.theme,u=f.useContext(ff)||{},c=u.setPortalPlacement,d=f.useRef(null),g=f.useState(i),h=mr(g,2),m=h[0],p=h[1],b=f.useState(null),w=mr(b,2),v=w[0],x=w[1],O=s.spacing.controlHeight;return Ps(function(){var S=d.current;if(S){var R=l==="fixed",_=a&&!R,E=Pb({maxHeight:i,menuEl:S,minHeight:r,placement:o,shouldScroll:_,isFixedPosition:R,controlHeight:O});p(E.maxHeight),x(E.placement),c==null||c(E.placement)}},[i,o,l,a,r,c,O]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:v||df(o),maxHeight:m})})},Ab=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return $e("div",Ke({},tn(t,"menu",{menu:!0}),{ref:r},i),n)},Hb=Ab,zb=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})},Vb=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return $e("div",Ke({},tn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},hf=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")})},$b=hf,Nb=hf,Bb=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=wr(t,Db);return $e("div",Ke({},tn(Ye(Ye({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},Wb=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=wr(t,Ob);return $e("div",Ke({},tn(Ye(Ye({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},Ub=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}},qb=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,l=t.menuPlacement,a=t.menuPosition,s=f.useRef(null),u=f.useRef(null),c=f.useState(df(l)),d=mr(c,2),g=d[0],h=d[1],m=f.useMemo(function(){return{setPortalPlacement:h}},[]),p=f.useState(null),b=mr(p,2),w=b[0],v=b[1],x=f.useCallback(function(){if(i){var _=xb(i),E=a==="fixed"?0:window.pageYOffset,k=_[g]+E;(k!==(w==null?void 0:w.offset)||_.left!==(w==null?void 0:w.rect.left)||_.width!==(w==null?void 0:w.rect.width))&&v({offset:k,rect:_})}},[i,a,g,w==null?void 0:w.offset,w==null?void 0:w.rect.left,w==null?void 0:w.rect.width]);Ps(function(){x()},[x]);var O=f.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&s.current&&(u.current=pb(i,s.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);Ps(function(){O()},[O]);var S=f.useCallback(function(_){s.current=_,O()},[O]);if(!n&&a!=="fixed"||!w)return null;var R=$e("div",Ke({ref:S},tn(Ye(Ye({},t),{},{offset:w.offset,position:a,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),r);return $e(ff.Provider,{value:m},n?$c.createPortal(R,n):R)},Yb=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Xb=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return $e("div",Ke({},tn(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},Gb=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,l=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:i&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},jb=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return $e("div",Ke({},tn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},Kb=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Zb=function(t){var n=t.children,r=t.innerProps;return $e("div",Ke({},tn(t,"indicatorsContainer",{indicators:!0}),r),n)},lc,Jb=["size"],Qb=["innerProps","isRtl","size"],ew={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},gf=function(t){var n=t.size,r=wr(t,Jb);return $e("svg",Ke({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ew},r))},hl=function(t){return $e(gf,Ke({size:20},t),$e("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"}))},mf=function(t){return $e(gf,Ke({size:20},t),$e("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"}))},pf=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:o*2,":hover":{color:r?l.neutral80:l.neutral40}})},tw=pf,nw=function(t){var n=t.children,r=t.innerProps;return $e("div",Ke({},tn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||$e(mf,null))},rw=pf,iw=function(t){var n=t.children,r=t.innerProps;return $e("div",Ke({},tn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||$e(hl,null))},ow=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,l=i.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:o*2,marginTop:o*2})},aw=function(t){var n=t.innerProps;return $e("span",Ke({},n,tn(t,"indicatorSeparator",{"indicator-separator":!0})))},sw=ig(lc||(lc=rb([`
|
192
|
-
0%, 80%, 100% { opacity: 0; }
|
193
|
-
40% { opacity: 1; }
|
194
|
-
`]))),lw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,l=o.colors,a=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?l.neutral60:l.neutral20,padding:a*2})},gs=function(t){var n=t.delay,r=t.offset;return $e("span",{css:Nc({animation:"".concat(sw," 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"},"","")})},uw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,l=wr(t,Qb);return $e("div",Ke({},tn(Ye(Ye({},l),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),$e(gs,{delay:0,offset:r}),$e(gs,{delay:160,offset:!0}),$e(gs,{delay:320,offset:!r}))},cw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,l=o.colors,a=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?l.neutral5:l.neutral0,borderColor:r?l.neutral10:i?l.primary:l.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:i?l.primary:l.neutral30}})},dw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,l=t.innerProps,a=t.menuIsOpen;return $e("div",Ke({ref:o},tn(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),l,{"aria-disabled":r||void 0}),n)},fw=dw,hw=["data"],gw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},mw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,l=t.Heading,a=t.headingProps,s=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return $e("div",Ke({},tn(t,"group",{group:!0}),s),$e(l,Ke({},a,{selectProps:d,theme:c,getStyles:i,getClassNames:o,cx:r}),u),$e("div",null,n))},pw=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"})},vw=function(t){var n=lf(t);n.data;var r=wr(n,hw);return $e("div",Ke({},tn(t,"groupHeading",{"group-heading":!0}),r))},bw=mw,ww=["innerRef","isDisabled","isHidden","inputClassName"],yw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,l=o.spacing,a=o.colors;return Ye(Ye({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},Cw),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:a.neutral80})},vf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Cw={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"},vf)},Sw=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},vf)},xw=function(t){var n=t.cx,r=t.value,i=lf(t),o=i.innerRef,l=i.isDisabled,a=i.isHidden,s=i.inputClassName,u=wr(i,ww);return $e("div",Ke({},tn(t,"input",{"input-container":!0}),{"data-value":r||""}),$e("input",Ke({className:n({input:!0},s),ref:o,style:Sw(a),disabled:l},u)))},kw=xw,Mw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},Rw=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,l=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Ew=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,l=r.colors,a=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?l.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},bf=function(t){var n=t.children,r=t.innerProps;return $e("div",r,n)},Iw=bf,Tw=bf;function Dw(e){var t=e.children,n=e.innerProps;return $e("div",Ke({role:"button"},n),t||$e(hl,{size:14}))}var Ow=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,l=t.isDisabled,a=t.removeProps,s=t.selectProps,u=r.Container,c=r.Label,d=r.Remove;return $e(u,{data:i,innerProps:Ye(Ye({},tn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:s},$e(c,{data:i,innerProps:Ye({},tn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},n),$e(d,{data:i,innerProps:Ye(Ye({},tn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:s}))},Pw=Ow,_w=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.theme,a=l.spacing,s=l.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(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?s.primary:s.primary50}})},Lw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,l=t.innerRef,a=t.innerProps;return $e("div",Ke({},tn(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:l,"aria-disabled":r},a),n)},Fw=Lw,Aw=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})},Hw=function(t){var n=t.children,r=t.innerProps;return $e("div",Ke({},tn(t,"placeholder",{placeholder:!0}),r),n)},zw=Hw,Vw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,l=i.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},$w=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return $e("div",Ke({},tn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Nw=$w,wf={ClearIndicator:iw,Control:fw,DropdownIndicator:nw,DownChevron:mf,CrossIcon:hl,Group:bw,GroupHeading:vw,IndicatorsContainer:Zb,IndicatorSeparator:aw,Input:kw,LoadingIndicator:uw,Menu:Hb,MenuList:Vb,MenuPortal:qb,LoadingMessage:Wb,NoOptionsMessage:Bb,MultiValue:Pw,MultiValueContainer:Iw,MultiValueLabel:Tw,MultiValueRemove:Dw,Option:Fw,Placeholder:zw,SelectContainer:Xb,SingleValue:Nw,ValueContainer:jb},Bw=function(t){return Ye(Ye({},wf),t.components)},uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Ww(e,t){return!!(e===t||uc(e)&&uc(t))}function Uw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Ww(e[n],t[n]))return!1;return!0}function qw(e,t){t===void 0&&(t=Uw);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 l=e.apply(this,i);return n={lastResult:l,lastArgs:i,lastThis:this},l}return r.clear=function(){n=null},r}var Yw={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"},Xw=function(t){return $e("span",Ke({css:Yw},t))},cc=Xw,Gw={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,l=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 l?"".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,l=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 l?"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,l=o===void 0?"":o,a=t.selectValue,s=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(l," focused, ").concat(d(a,r),".");if(n==="menu"&&c){var g=s?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(l).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:"",".")}},jw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,l=t.isFocused,a=t.selectValue,s=t.selectProps,u=t.id,c=t.isAppleDevice,d=s.ariaLiveMessages,g=s.getOptionLabel,h=s.inputValue,m=s.isMulti,p=s.isOptionDisabled,b=s.isSearchable,w=s.menuIsOpen,v=s.options,x=s.screenReaderStatus,O=s.tabSelectsValue,S=s.isLoading,R=s["aria-label"],_=s["aria-live"],E=f.useMemo(function(){return Ye(Ye({},Gw),d||{})},[d]),k=f.useMemo(function(){var M="";if(n&&E.onChange){var z=n.option,N=n.options,X=n.removedValue,ne=n.removedValues,G=n.value,J=function(P){return Array.isArray(P)?null:P},le=X||z||J(G),ie=le?g(le):"",se=N||ne||void 0,Me=se?se.map(g):[],te=Ye({isDisabled:le&&p(le,a),label:ie,labels:Me},n);M=E.onChange(te)}return M},[n,E,p,a,g]),L=f.useMemo(function(){var M="",z=r||i,N=!!(r&&a&&a.includes(r));if(z&&E.onFocus){var X={focused:z,label:g(z),isDisabled:p(z,a),isSelected:N,options:o,context:z===r?"menu":"value",selectValue:a,isAppleDevice:c};M=E.onFocus(X)}return M},[r,i,g,p,E,o,a,c]),D=f.useMemo(function(){var M="";if(w&&v.length&&!S&&E.onFilter){var z=x({count:o.length});M=E.onFilter({inputValue:h,resultsMessage:z})}return M},[o,h,w,E,v,x,S]),C=(n==null?void 0:n.action)==="initial-input-focus",T=f.useMemo(function(){var M="";if(E.guidance){var z=i?"value":w?"menu":"input";M=E.guidance({"aria-label":R,context:z,isDisabled:r&&p(r,a),isMulti:m,isSearchable:b,tabSelectsValue:O,isInitialFocus:C})}return M},[R,r,i,m,p,b,w,E,a,O,C]),I=$e(f.Fragment,null,$e("span",{id:"aria-selection"},k),$e("span",{id:"aria-focused"},L),$e("span",{id:"aria-results"},D),$e("span",{id:"aria-guidance"},T));return $e(f.Fragment,null,$e(cc,{id:u},C&&I),$e(cc,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!C&&I))},Kw=jw,_s=[{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("["+_s.map(function(e){return e.letters}).join("")+"]","g"),yf={};for(var ms=0;ms<_s.length;ms++)for(var ps=_s[ms],vs=0;vs<ps.letters.length;vs++)yf[ps.letters[vs]]=ps.base;var Cf=function(t){return t.replace(Zw,function(n){return yf[n]})},Jw=qw(Cf),dc=function(t){return t.replace(/^\s+|\s+$/g,"")},Qw=function(t){return"".concat(t.label," ").concat(t.value)},ey=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:Qw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,l=i.ignoreAccents,a=i.stringify,s=i.trim,u=i.matchFrom,c=s?dc(r):r,d=s?dc(a(n)):a(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),l&&(c=Jw(c),d=Cf(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},ty=["innerRef"];function ny(e){var t=e.innerRef,n=wr(e,ty),r=Tb(n,"onExited","in","enter","exit","appear");return $e("input",Ke({ref:t},r,{css:Nc({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 ry=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function iy(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,l=f.useRef(!1),a=f.useRef(!1),s=f.useRef(0),u=f.useRef(null),c=f.useCallback(function(b,w){if(u.current!==null){var v=u.current,x=v.scrollTop,O=v.scrollHeight,S=v.clientHeight,R=u.current,_=w>0,E=O-S-x,k=!1;E>w&&l.current&&(r&&r(b),l.current=!1),_&&a.current&&(o&&o(b),a.current=!1),_&&w>E?(n&&!l.current&&n(b),R.scrollTop=O,k=!0,l.current=!0):!_&&-w>x&&(i&&!a.current&&i(b),R.scrollTop=0,k=!0,a.current=!0),k&&ry(b)}},[n,r,i,o]),d=f.useCallback(function(b){c(b,b.deltaY)},[c]),g=f.useCallback(function(b){s.current=b.changedTouches[0].clientY},[]),h=f.useCallback(function(b){var w=s.current-b.changedTouches[0].clientY;c(b,w)},[c]),m=f.useCallback(function(b){if(b){var w=Rb?{passive:!1}:!1;b.addEventListener("wheel",d,w),b.addEventListener("touchstart",g,w),b.addEventListener("touchmove",h,w)}},[h,g,d]),p=f.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",g,!1),b.removeEventListener("touchmove",h,!1))},[h,g,d]);return f.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var fc=["boxSizing","height","overflow","paddingRight","position"],hc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function gc(e){e.cancelable&&e.preventDefault()}function mc(e){e.stopPropagation()}function pc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function vc(){return"ontouchstart"in window||navigator.maxTouchPoints}var bc=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,fi={capture:!1,passive:!1};function oy(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=f.useRef({}),o=f.useRef(null),l=f.useCallback(function(s){if(bc){var u=document.body,c=u&&u.style;if(r&&fc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&ji<1){var d=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+d||0;Object.keys(hc).forEach(function(m){var p=hc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&vc()&&(u.addEventListener("touchmove",gc,fi),s&&(s.addEventListener("touchstart",pc,fi),s.addEventListener("touchmove",mc,fi))),ji+=1}},[r]),a=f.useCallback(function(s){if(bc){var u=document.body,c=u&&u.style;ji=Math.max(ji-1,0),r&&ji<1&&fc.forEach(function(d){var g=i.current[d];c&&(c[d]=g)}),u&&vc()&&(u.removeEventListener("touchmove",gc,fi),s&&(s.removeEventListener("touchstart",pc,fi),s.removeEventListener("touchmove",mc,fi)))}},[r]);return f.useEffect(function(){if(t){var s=o.current;return l(s),function(){a(s)}}},[t,l,a]),function(s){o.current=s}}var ay=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},sy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ly(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,l=e.onBottomLeave,a=e.onTopArrive,s=e.onTopLeave,u=iy({isEnabled:i,onBottomArrive:o,onBottomLeave:l,onTopArrive:a,onTopLeave:s}),c=oy({isEnabled:n}),d=function(h){u(h),c(h)};return $e(f.Fragment,null,n&&$e("div",{onClick:ay,css:sy}),t(d))}var uy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},cy=function(t){var n=t.name,r=t.onFocus;return $e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:uy,value:"",onChange:function(){}})},dy=cy;function gl(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 fy(){return gl(/^iPhone/i)}function Sf(){return gl(/^Mac/i)}function hy(){return gl(/^iPad/i)||Sf()&&navigator.maxTouchPoints>1}function gy(){return fy()||hy()}function my(){return Sf()||gy()}var py=function(t){return t.label},vy=function(t){return t.label},by=function(t){return t.value},wy=function(t){return!!t.isDisabled},yy={clearIndicator:rw,container:Yb,control:cw,dropdownIndicator:tw,group:gw,groupHeading:pw,indicatorsContainer:Kb,indicatorSeparator:ow,input:yw,loadingIndicator:lw,loadingMessage:Nb,menu:Lb,menuList:zb,menuPortal:Ub,multiValue:Mw,multiValueLabel:Rw,multiValueRemove:Ew,noOptionsMessage:$b,option:_w,placeholder:Aw,singleValue:Vw,valueContainer:Gb},Cy={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%)"},Sy=4,xf=4,xy=38,ky=xf*2,My={baseUnit:xf,controlHeight:xy,menuGutter:ky},bs={borderRadius:Sy,colors:Cy,spacing:My},Ry={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sc(),captureMenuScroll:!sc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:ey(),formatGroupLabel:py,getOptionLabel:vy,getOptionValue:by,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:wy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!kb(),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 wc(e,t,n,r){var i=Rf(e,t,n),o=Ef(e,t,n),l=Mf(e,t),a=ba(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:l,value:a,index:r}}function na(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(l,a){return wc(e,l,t,a)}).filter(function(l){return Cc(e,l)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=wc(e,n,t,r);return Cc(e,o)?o:void 0}).filter(Eb)}function kf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Hs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function yc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Hs(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 Ey(e,t){return kf(na(e,t))}function Cc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,l=t.label,a=t.value;return(!Tf(e)||!o)&&If(e,{label:l,value:a,data:i},r)}function Iy(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 Ty(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=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},Mf=function(t,n){return t.getOptionLabel(n)},ba=function(t,n){return t.getOptionValue(n)};function Rf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Ef(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ba(e,t);return n.some(function(i){return ba(e,i)===r})}function If(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Tf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},Dy=1,Df=function(e){xg(n,e);var t=Rg(n);function n(r){var i;if(Mg(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=my(),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,g=c.name;u.name=g,i.ariaOnChange(s,u),d(s,u)},i.setValue=function(s,u,c){var d=i.props,g=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(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,g=u.name,h=i.state.selectValue,m=d&&i.isOptionSelected(s,h),p=i.isOptionDisabled(s,h);if(m){var b=i.getOptionValue(s);i.setValue(h.filter(function(w){return i.getOptionValue(w)!==b}),"deselect-option",s)}else if(!p)d?i.setValue([].concat(Hs(h),[s]),"select-option",s):i.setValue(s,"select-option");else{i.ariaOnChange(s,{action:"select-option",option:s,name:g});return}c&&i.blurInput()},i.removeValue=function(s){var u=i.props.isMulti,c=i.state.selectValue,d=i.getOptionValue(s),g=c.filter(function(m){return i.getOptionValue(m)!==d}),h=Zo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:s}),i.focusInput()},i.clearValue=function(){var s=i.state.selectValue;i.onChange(Zo(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),g=Zo(s,d,d[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(s){return ws(i.state.focusableOptionsWithIds,s)},i.getFocusableOptionsWithIds=function(){return yc(na(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 wb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(s){return Mf(i.props,s)},i.getOptionValue=function(s){return ba(i.props,s)},i.getStyles=function(s,u){var c=i.props.unstyled,d=yy[s](u,c);d.boxSizing="border-box";var g=i.props.styles[s];return g?g(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 Bw(i.props)},i.buildCategorizedOptions=function(){return na(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return kf(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&&Ma(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),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=d>h||g>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 Tf(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,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,w=u.onKeyDown,v=u.tabSelectsValue,x=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||!b||!v||!S||x&&i.isOptionSelected(S,_))return;i.selectOption(S);break;case"Enter":if(s.keyCode===229)break;if(b){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!b){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}s.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++Dy),i.state.selectValue=oc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),l=i.buildFocusableOptions(),a=l.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=l[a],i.state.focusedOptionId=ws(o,l[a])}return i}return kg(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&&ac(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,l=o.isDisabled,a=o.menuIsOpen,s=this.state.isFocused;(s&&!l&&i.isDisabled||s&&a&&!i.menuIsOpen)&&this.focusInput(),s&&l&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!s&&!l&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ac(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,l=this.state,a=l.selectValue,s=l.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[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,l=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var s=l.indexOf(a);a||(s=-1);var u=l.length-1,c=-1;if(l.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:l[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,l=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var s=0,u=a.indexOf(l);l||(u=-1),i==="up"?s=u>0?u-1:a.length-1:i==="down"?s=(u+1)%a.length:i==="pageup"?(s=u-o,s<0&&(s=0)):i==="pagedown"?(s=u+o,s>a.length-1&&(s=a.length-1)):i==="last"&&(s=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[s],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[s])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Ye(Ye({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,l=this.getStyles,a=this.getClassNames,s=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,g=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:l,getClassNames:a,getValue:s,hasValue:p,isMulti:g,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,l=i.isMulti;return o===void 0?l:o}},{key:"isOptionDisabled",value:function(i,o){return Rf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Ef(this.props,i,o)}},{key:"filterOption",value:function(i,o){return If(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:l,selectValue:a})}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,l=i.isSearchable,a=i.inputId,s=i.inputValue,u=i.tabIndex,c=i.form,d=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,b=p.inputIsHidden,w=p.ariaSelection,v=this.commonProps,x=a||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":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!l&&{"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 l?f.createElement(m,Ke({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:s},O)):f.createElement(ny,Ke({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:pa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),l=o.MultiValue,a=o.MultiValueContainer,s=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,b=h.isMulti,w=h.inputValue,v=h.placeholder,x=this.state,O=x.selectValue,S=x.focusedValue,R=x.isFocused;if(!this.hasValue()||!m)return w?null:f.createElement(d,Ke({},g,{key:"placeholder",isDisabled:p,isFocused:R,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return O.map(function(E,k){var L=E===S,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return f.createElement(l,Ke({},g,{components:{Container:a,Label:s,Remove:u},isFocused:L,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(T){T.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(w)return null;var _=O[0];return f.createElement(c,Ke({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.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 f.createElement(o,Ke({},l,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,l=this.commonProps,a=this.props,s=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return f.createElement(o,Ke({},l,{innerProps:d,isDisabled:s,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,l=i.IndicatorSeparator;if(!o||!l)return null;var a=this.commonProps,s=this.props.isDisabled,u=this.state.isFocused;return f.createElement(l,Ke({},a,{isDisabled:s,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var l=this.commonProps,a=this.props.isDisabled,s=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(o,Ke({},l,{innerProps:u,isDisabled:a,isFocused:s}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),l=o.Group,a=o.GroupHeading,s=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,w=b.captureMenuScroll,v=b.inputValue,x=b.isLoading,O=b.loadingMessage,S=b.minMenuHeight,R=b.maxMenuHeight,_=b.menuIsOpen,E=b.menuPlacement,k=b.menuPosition,L=b.menuPortalTarget,D=b.menuShouldBlockScroll,C=b.menuShouldScrollIntoView,T=b.noOptionsMessage,I=b.onMenuScrollToTop,M=b.onMenuScrollToBottom;if(!_)return null;var z=function(ie,se){var Me=ie.type,te=ie.data,H=ie.isDisabled,P=ie.isSelected,B=ie.label,ce=ie.value,De=p===te,Je=H?void 0:function(){return i.onOptionHover(te)},be=H?void 0:function(){return i.selectOption(te)},Ce="".concat(i.getElementId("option"),"-").concat(se),Te={id:Ce,onClick:be,onMouseMove:Je,onMouseOver:Je,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return f.createElement(h,Ke({},m,{innerProps:Te,data:te,isDisabled:H,isSelected:P,key:Ce,label:B,type:Me,value:ce,isFocused:De,innerRef:De?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ie.data,"menu"))},N;if(this.hasOptions())N=this.getCategorizedOptions().map(function(le){if(le.type==="group"){var ie=le.data,se=le.options,Me=le.index,te="".concat(i.getElementId("group"),"-").concat(Me),H="".concat(te,"-heading");return f.createElement(l,Ke({},m,{key:te,data:ie,options:se,Heading:a,headingProps:{id:H,data:le.data},label:i.formatGroupLabel(le.data)}),le.options.map(function(P){return z(P,"".concat(Me,"-").concat(P.index))}))}else if(le.type==="option")return z(le,"".concat(le.index))});else if(x){var X=O({inputValue:v});if(X===null)return null;N=f.createElement(d,m,X)}else{var ne=T({inputValue:v});if(ne===null)return null;N=f.createElement(g,m,ne)}var G={minMenuHeight:S,maxMenuHeight:R,menuPlacement:E,menuPosition:k,menuShouldScrollIntoView:C},J=f.createElement(Fb,Ke({},m,G),function(le){var ie=le.ref,se=le.placerProps,Me=se.placement,te=se.maxHeight;return f.createElement(s,Ke({},m,G,{innerRef:ie,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:Me}),f.createElement(ly,{captureEnabled:w,onTopArrive:I,onBottomArrive:M,lockEnabled:D},function(H){return f.createElement(u,Ke({},m,{innerRef:function(B){i.getMenuListRef(B),H(B)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:te,focusedOption:p}),N)}))});return L||k==="fixed"?f.createElement(c,Ke({},m,{appendTo:L,controlElement:this.controlRef,menuPlacement:E,menuPosition:k}),J):J}},{key:"renderFormField",value:function(){var i=this,o=this.props,l=o.delimiter,a=o.isDisabled,s=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!a)return f.createElement(dy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(s)if(l){var g=d.map(function(p){return i.getOptionValue(p)}).join(l);return f.createElement("input",{name:u,type:"hidden",value:g})}else{var h=d.length>0?d.map(function(p,b){return f.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(p)})}):f.createElement("input",{name:u,type:"hidden",value:""});return f.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return f.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,l=o.ariaSelection,a=o.focusedOption,s=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return f.createElement(Kw,Ke({},i,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:a,focusedValue:s,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,l=i.IndicatorsContainer,a=i.SelectContainer,s=i.ValueContainer,u=this.props,c=u.className,d=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return f.createElement(a,Ke({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),f.createElement(o,Ke({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),f.createElement(s,Ke({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(l,Ke({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var l=o.prevProps,a=o.clearFocusValueOnUpdate,s=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,b=i.inputValue,w=i.isMulti,v=oc(m),x={};if(l&&(m!==l.value||h!==l.options||p!==l.menuIsOpen||b!==l.inputValue)){var O=p?Ey(i,v):[],S=p?yc(na(i,v),"".concat(g,"-option")):[],R=a?Iy(o,v):null,_=Ty(o,O),E=ws(S,_);x={selectValue:v,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:S,focusedValue:R,clearFocusValueOnUpdate:!1}}var k=s!=null&&i!==l?{inputIsHidden:s,inputIsHiddenAfterUpdate:void 0}:{},L=u,D=c&&d;return c&&!D&&(L={value:Zo(w,v,v[0]||null),options:v,action:"initial-input-focus"},D=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(L=null),Ye(Ye(Ye({},x),k),{},{prevProps:i,ariaSelection:L,prevWasFocused:D})}}]),n}(f.Component);Df.defaultProps=Ry;var Oy=f.forwardRef(function(e,t){var n=nb(e);return f.createElement(Df,Ke({ref:t},n))}),Py=Oy;const _y=e=>{const{Menu:t}=wf,{children:n,...r}=e;return f.createElement(t,{...r},n)},Ly=vn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Fy=vn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Ay=vn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Hy=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[l,a]=f.useState(o),[s,u]=f.useState(r??""),c=Jm(),d=f.useMemo(()=>i.map(g=>typeof g=="string"||g===null||g===void 0?{value:g,label:(g==null?void 0:g.toString())??""}:g),[i]);return t.readonly?f.createElement(Ay,null,f.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:l??"",onChange:()=>{}})):f.createElement(Ly,null,f.createElement(Py,{className:"glide-select",inputValue:s,onInputChange:u,menuPlacement:"auto",value:d.find(g=>g.value===l),styles:{control:g=>({...g,border:0,boxShadow:"none"}),option:(g,{isFocused:h})=>({...g,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...g[":active"],color:c.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:g=>({...g,colors:{...g.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:g=>f.createElement(Fy,null,f.createElement(_y,{className:"click-outside-ignore",...g}))},options:d,onChange:async g=>{g!==null&&(a(g.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:g.value}}))}}))},zy={kind:ee.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,l=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===o:s.value===o),a=typeof l=="string"?l:(l==null?void 0:l.label)??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,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:Hy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.some(n=>n==null?!1:typeof n=="string"?n===e:n.value===e)?e:t.value})};function Vy(e,t){const n=/(\d+\.?\d*)\s*(px|rem|em|%|pt)/,r=e.match(n);if(r){const i=parseFloat(r[1]),o=r[2],l=i*t;return e.replace(n,`${Number(l.toPrecision(3))}${o}`)}return e}const $y={marginRight:8},Ny={display:"flex",alignItems:"center",flexGrow:1},By={kind:ee.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:l,value:a,label:s,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,d=i.y+i.height/2,g=l-o,h=(a-o)/g,m=`${Vy(r.baseFontStyle,.9)} ${r.fontFamily}`,b=Ys(n,m)/2;n.save();let w=0;s!==void 0&&(n.font=m,w=ti(u??s,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-w;if(v>=b){const x=n.createLinearGradient(c,d,c+v,d);x.addColorStop(0,r.accentColor),x.addColorStop(h,r.accentColor),x.addColorStop(h,r.bgBubble),x.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=x,ec(n,c,d-b/2,v,b,b/2),n.fill(),n.beginPath(),ec(n,c+.5,d-b/2+.5,v-1,b-1,(b-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,m))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),i=t.min.toString(),o=t.max.toString(),l=t.step.toString(),a=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return f.createElement("label",{style:Ny},f.createElement("input",{style:$y,type:"range",value:r,min:i,max:o,step:l,onChange:a,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}}},Wy=vn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(e,t,n)=>{if(t==null)return"";n&&(t=new Date(t.getTime()+n));const r=t.toISOString();switch(e){case"date":return r.split("T")[0];case"datetime-local":return r.replace("Z","");case"time":return r.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Uy=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.timezoneOffset?t.timezoneOffset*60*1e3:0,l=t.min instanceof Date?ys(n,t.min,o):t.min,a=t.max instanceof Date?ys(n,t.max,o):t.max,s=ys(n,t.date,o);return e.value.readonly?Ut.createElement(Qr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Ut.createElement(Wy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:s,min:l,max:a,step:i,autoFocus:!0,onChange:u=>{isNaN(u.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(u.target.valueAsNumber-o)}})}})},qy={kind:ee.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return qs(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Uy}),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)}}},Yy="None";function Sc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-n.cellHorizontalPadding,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+n.cellHorizontalPadding),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Xy=e=>{const{cell:t,theme:n,ctx:r}=e;qs({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Yy,t.contentAlign),r.fillStyle=n.textDark};function Gy(e){const t=f.useCallback((r,i)=>{const{cell:o,theme:l,ctx:a,rect:s}=r,u=r.col;if(wi(o))Sc(a,s,l);else if(xa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Xy(r),c.isRequired&&c.isEditable&&Sc(a,s,l);return}i()},[e]),n=f.useMemo(()=>[eb,zy,By,qy,...I1],[]);return{drawCell:t,customRenderers:n}}function jy(){const e=Zr();return f.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:hi(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:hi(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:hi(e.colors.darkenedBgMix100,.9),bgHeaderHovered:hi(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(mn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${mn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${mn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:hi(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(mn(e.spacing.sm)),cellVerticalPadding:Math.round(mn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(mn("1.25rem")),bubblePadding:Math.round(mn(e.spacing.sm)),bubbleMargin:Math.round(mn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(mn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(mn("25rem")),minColumnWidth:Math.round(mn("3.125rem")),maxColumnWidth:Math.round(mn("62.5rem")),maxColumnAutoWidth:Math.round(mn("31.25rem")),defaultRowHeight:Math.round(mn("2.1875rem")),defaultHeaderHeight:Math.round(mn("2.1875rem")),bgRowHovered:og(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Ky=As.getLogger("useDataEditor");function Zy(e,t,n,r,i,o,l,a,s){const u=f.useCallback(([p,b],w)=>{const v=e[p];if(!v.isEditable)return;const x=v.indexNumber,O=n.current.getOriginalRowIndex(i(b)),S=r([p,b]),R=v.getCellValue(S),_=v.getCellValue(w);if(!wi(S)&&_===R)return;const E=v.getCell(_,!0);wi(E)?Ky.warn(`Not applying the cell edit since it causes this error:
|
195
|
-
${E.data}`):(n.current.setCell(x,O,{...E,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=f.useCallback(()=>{if(t)return;const p=new Map;e.forEach(b=>{p.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(p),l()},[e,n,t,l]),d=f.useCallback(()=>{t||(c(),a())},[c,a,t]),g=f.useCallback(p=>{var b;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(v=>n.current.getOriginalRowIndex(i(v)));return n.current.deleteRows(w),l(),s(),a(),!1}if((b=p.current)!=null&&b.range){const w=[],v=p.current.range;for(let x=v.y;x<v.y+v.height;x++)for(let O=v.x;O<v.x+v.width;O++){const S=e[O];S.isEditable&&!S.isRequired&&(w.push({cell:[O,x]}),u([O,x],S.getCell(null)))}return w.length>0&&(a(),o(w)),!1}return!0},[e,n,t,o,i,a,u,s,l]),h=f.useCallback((p,b)=>{const[w,v]=p,x=[];for(let O=0;O<b.length;O++){const S=b[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let R=0;R<S.length;R++){const _=S[R],E=O+v,k=R+w;if(k>=e.length)break;const L=e[k];if(L.isEditable){const D=L.getCell(_,!0);if(ft(D)&&!wi(D)){const C=L.indexNumber,T=n.current.getOriginalRowIndex(i(E)),I=L.getCellValue(r([k,E]));L.getCellValue(D)!==I&&(n.current.setCell(C,T,{...D,lastUpdated:performance.now()}),x.push({cell:[k,E]}))}}}x.length>0&&(a(),o(x))}return!1},[e,n,t,i,r,c,a,o]),m=f.useCallback((p,b)=>{const w=p[0];if(w>=e.length)return!0;const v=e[w];if(v.validateInput){const x=v.validateInput(v.getCellValue(b));return x===!0||x===!1?x:v.getCell(x)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:g,validateCell:m}}const Of=",",Qi='"',Jy='"',Pf=`
|
196
|
-
`,Qy="\uFEFF",eC=new RegExp(`[${[Of,Qi,Pf].join("")}]`),xc=As.getLogger("useDataExporter");function kc(e){return e.map(t=>tC(t)).join(Of)+Pf}function tC(e){if(Xe(e))return"";const t=wt(e);return eC.test(t)?`${Qi}${t.replace(new RegExp(Qi,"g"),Jy+Qi)}${Qi}`:t}async function Mc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Qy));const o=n.map(l=>l.name);await e.write(i.encode(kc(o)));for(let l=0;l<r;l++){const a=[];n.forEach((s,u,c)=>{a.push(s.getCellValue(t([u,l])))}),await e.write(i.encode(kc(a)))}await e.close()}function nC(e,t,n,r){return{exportToCsv:f.useCallback(async()=>{const l=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await Fs(()=>import("./es6.wyhZ4wJk.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:l,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Mc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{xc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let s="";const u=new WritableStream({write:h=>{s+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Mc(u.getWriter(),e,t,n);const c=new Blob([s],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),g=Cg({enforceDownloadInNewTab:r,url:d,filename:l});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}catch(s){xc.error("Failed to export data as CSV",s)}}},[t,n,e,r])}}function rC(e,t,n,r){return{getCellContent:f.useCallback(([o,l])=>{var a;if(o>t.length-1)return At("Column index out of bounds","This error should never happen. Please report this bug.");if(l>n-1)return At("Row index out of bounds","This error should never happen. Please report this bug.");try{const s=t[o],u=s.indexNumber,c=r.current.getOriginalRowIndex(l),d=r.current.isAddedRow(c);if(s.isEditable||d){const m=r.current.getCell(u,c);if(ft(m))return{...s.getCell(s.getCellValue(m),!1),lastUpdated:m.lastUpdated};if(d)return At("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${u}; row=${c}`)}const g=e.getCell(c,u),h=ag(e,c,u);return z1(s,g,h,(a=e.styler)==null?void 0:a.cssStyles)}catch(s){return At("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
-
Error: ${s}`)}},[t,n,e,r])}}function iC(e){const[t,n]=f.useState(void 0),r=f.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,l]=o.location;n(l)}},[n]);return{getRowThemeOverride:f.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function oC(e,t,n,r,i){const[o,l]=f.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(En.SelectionMode.MULTI_ROW)||e.selectionMode.includes(En.SelectionMode.SINGLE_ROW)),s=a&&e.selectionMode.includes(En.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(En.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(En.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(En.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=f.useCallback(b=>{const w=!Ya(b.rows.toArray(),o.rows.toArray()),v=!Ya(b.columns.toArray(),o.columns.toArray()),x=!Ya(b.current,o.current);let O=a&&w||u&&v,S=b;if((a||u)&&b.current!==void 0&&x&&(S={...b,rows:o.rows,columns:o.columns},O=!1),w&&b.rows.length>0&&v&&b.columns.length===0&&(S={...S,columns:o.columns},O=!0),v&&b.columns.length>0&&w&&b.rows.length===0&&(S={...S,rows:o.rows},O=!0),v&&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})}l(S),O&&i(S)},[o,a,u,i,r]),p=f.useCallback((b=!1,w=!1)=>{const v={columns:w?o.columns:vt.empty(),rows:b?o.rows:vt.empty(),current:void 0};l(v),(!b&&a||!w&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:s,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function aC(e,t,n,r,i,o,l){const a=e.rowHeight??t.defaultRowHeight,s=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===En.EditingMode.DYNAMIC?1:0,d=n+c;let g=Math.max(d*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,s),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,s),g=Math.max(e.height,g)),o&&(h=Math.min(h,o),g=Math.min(g,o),e.height||(h=g));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(i,m);let b,w=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[v,x]=f.useState({width:b||"100%",height:h});return f.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&x(O=>({...O,width:p}))},[p]),f.useLayoutEffect(()=>{x(O=>({...O,width:b||"100%"}))},[b]),f.useLayoutEffect(()=>{x(O=>({...O,height:h}))},[h,n]),f.useLayoutEffect(()=>{if(l){const O=e.useContainerWidth||ft(e.width)&&e.width>0;x({width:O?w:"100%",height:g})}else x({width:b||"100%",height:h})},[l]),{minHeight:s,maxHeight:g,minWidth:m,maxWidth:w,rowHeight:a,resizableSize:v,setResizableSize:x}}const sC=600,lC="⚠️ Please fill out this cell.";function uC(e,t,n=[]){const[r,i]=f.useState(),o=f.useRef(null),l=f.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 g=e[u];if(s.kind==="header"&&ft(g))d=g.help;else if(s.kind==="cell"){const h=t([u,c]);wi(h)?d=h.errorDetails:g.isRequired&&g.isEditable&&xa(h)?d=lC:h1(h)&&(d=h.tooltip)}d&&(o.current=setTimeout(()=>{d&&i({content:d,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},sC))}},[e,t,i,o,n]),a=f.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:l}}function cC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=f.useState(!0),l=Zr(),{colors:a,fontSizes:s,radii:u,fontWeights:c}=l,d=f.useCallback(()=>{o(!1),r()},[r,o]);return lt(Ca,{content:lt(sg,{"data-testid":"stDataFrameTooltipContent",children:lt(lg,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:wa.top,accessibilityType:Lc.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:ya(l)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:s.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:lt("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const dC=f.memo(cC),Rc=Si("div",{target:"e1u61huh0"})(({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"},"& .gdg-search-bar":{maxWidth:"19rem",width:"80%",minWidth:"6rem",top:t.spacing.sm,right:t.spacing.sm,padding:t.spacing.sm,borderRadius:t.radii.default,"& .gdg-search-status":{paddingTop:t.spacing.twoXS,fontSize:t.fontSizes.twoSm},"& .gdg-search-progress":{display:"none"},"& input":{width:"100%"},"& button":{width:t.iconSizes.xl,height:t.iconSizes.xl,"& .button-icon":{width:t.iconSizes.base,height:t.iconSizes.base}}}})),Ec=150,fC=15e4,Ic=6;function hC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:l,expand:a,collapse:s,width:u,height:c}=ug(gg),d=f.useRef(null),g=f.useRef(null),h=f.useRef(null),m=jy(),{getRowThemeOverride:p,onItemHovered:b}=iC(m),{libConfig:{enforceDownloadInNewTab:w=!1}}=f.useContext(cg),[v,x]=f.useState(!0),[O,S]=f.useState(!1),[R,_]=f.useState(!1),[E,k]=f.useState(!1),[L,D]=f.useState(),[C,T]=f.useState(!1),I=f.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),M=f.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Xe(e.editingMode)&&(e.editingMode=En.EditingMode.READ_ONLY);const{READ_ONLY:z,DYNAMIC:N}=En.EditingMode,X=t.dimensions,ne=Math.max(0,X.numDataRows),G=ne===0&&!(e.editingMode===N&&X.numDataColumns>0),J=ne>fC,le=!J&&!G&&e.editingMode!==N,ie=!G&&e.editingMode===N&&!n,se=f.useRef(new Xo(ne)),[Me,te]=f.useState(se.current.getNumRows());f.useEffect(()=>{se.current=new Xo(ne),te(se.current.getNumRows())},[ne]);const H=f.useCallback(()=>{se.current=new Xo(ne),te(se.current.getNumRows())},[ne]),[P,B]=f.useState(e.columnOrder);f.useEffect(()=>{B(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ce,allColumns:De,setColumnConfigMapping:Je}=N1(e,t,n,P);f.useEffect(()=>{if(e.editingMode===z)return;const fe=r.getStringValue({id:e.id,formId:e.formId});fe&&(se.current.fromJson(fe,ce),te(se.current.getNumRows()))},[]);const{getCellContent:be}=rC(t,ce,Me,se),{columns:Ce,sortColumn:Te,getOriginalIndex:yt,getCellContent:gt}=Z1(ne,ce,be),rt=f.useCallback(fe=>{const st={selection:{rows:[],columns:[]}};st.selection.rows=fe.rows.toArray().map(Jt=>yt(Jt)),st.selection.columns=fe.columns.toArray().map(Jt=>io(Ce[Jt]));const Bt=JSON.stringify(st),dn=r.getStringValue({id:e.id,formId:e.formId});(dn===void 0||dn!==Bt)&&r.setStringValue({id:e.id,formId:e.formId},Bt,{fromUi:!0},o)},[Ce,e.id,e.formId,r,o,yt]),{debouncedCallback:ae}=$u(rt,Ec),{gridSelection:Fe,isRowSelectionActivated:he,isMultiRowSelectionActivated:de,isColumnSelectionActivated:ge,isMultiColumnSelectionActivated:ze,isRowSelected:_e,isColumnSelected:tt,isCellSelected:pe,clearSelection:ue,processSelectionChange:it}=oC(e,G,n,Ce,ae);f.useEffect(()=>{ue(!0,!0)},[l]);const He=f.useCallback(fe=>{var st;(st=g.current)==null||st.updateCells(fe)},[]);f.useEffect(()=>{var st,Bt,dn,Jt;if(!he&&!ge)return;const fe=r.getStringValue({id:e.id,formId:e.formId});if(fe){const Kt=Ce.map(Xn=>io(Xn)),kn=JSON.parse(fe);let wn=vt.empty(),yr=vt.empty();(Bt=(st=kn.selection)==null?void 0:st.rows)==null||Bt.forEach(Xn=>{wn=wn.add(Xn)}),(Jt=(dn=kn.selection)==null?void 0:dn.columns)==null||Jt.forEach(Xn=>{yr=yr.add(Kt.indexOf(Xn))}),(wn.length>0||yr.length>0)&&it({rows:wn,columns:yr,current:void 0})}},[]);const et=f.useCallback(()=>{Me!==se.current.getNumRows()&&te(se.current.getNumRows())},[Me]),bt=f.useCallback(()=>{const fe=se.current.toJson(Ce);let st=r.getStringValue({id:e.id,formId:e.formId});st===void 0&&(st=new Xo(0).toJson([])),fe!==st&&r.setStringValue({id:e.id,formId:e.formId},fe,{fromUi:!0},o)},[Ce,e.id,e.formId,r,o]),{debouncedCallback:mt}=$u(bt,Ec),{exportToCsv:Ve}=nC(gt,Ce,Me,w),{onCellEdited:Dt,onPaste:Yt,onRowAppended:kt,onDelete:_t,validateCell:nn}=Zy(Ce,e.editingMode!==N,se,gt,yt,He,et,mt,ue),Ht=f.useMemo(()=>G?[0]:ie?[Me]:[],[G,ie,Me]),{tooltip:ln,clearTooltip:It,onItemHovered:Ct}=uC(Ce,gt,Ht),{drawCell:On,customRenderers:Sn}=Gy(Ce),{provideEditor:Pe}=Q1(),Lt=f.useCallback(fe=>({...fe,hasMenu:!G}),[G]),hn=f.useMemo(()=>Ce.map(fe=>Lt(Ds(fe))),[Ce,Lt]),{columns:gn,onColumnResize:bn}=q1(hn),at=t.dimensions.numHeaderRows>1,{minHeight:Xt,maxHeight:Ot,minWidth:rn,maxWidth:Tt,rowHeight:Ft,resizableSize:Ne,setResizableSize:Vt}=aC(e,m,Me,at,u||0,c,l),Pt=f.useCallback(([fe,st])=>({...g1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Ce.length-1,0)]}),[Ce,m.glideTheme.textLight]),$t=f.useCallback(()=>{H(),ue()},[H,ue]);fg({element:e,widgetMgr:r,onFormCleared:$t});const{pinColumn:zt,unpinColumn:xn,freezeColumns:nr}=W1(Ce,G,u||0,m.minColumnWidth,ue,Je),{changeColumnFormat:zn}=B1(Je),{hideColumn:$,showColumn:Qe}=J1(ue,Je),{onColumnMoved:Be}=U1(Ce,nr,zt,xn,B);return f.useEffect(()=>{setTimeout(()=>{var fe,st;if(h.current&&g.current){const Bt=(st=(fe=h.current)==null?void 0:fe.querySelector(".dvn-stack"))==null?void 0:st.getBoundingClientRect();Bt&&(_(Bt.height>h.current.clientHeight),k(Bt.width>h.current.clientWidth))}},1)},[Ne,Me,gn]),f.useEffect(()=>{De.length==Ce.length&&T(!1)},[De.length,Ce.length]),Fn(Rc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:M,ref:h,onMouseDown:fe=>{if(h.current&&M){const st=h.current.getBoundingClientRect();E&&st.height-(Ic+1)<fe.clientY-st.top&&fe.stopPropagation(),R&&st.width-(Ic+1)<fe.clientX-st.left&&fe.stopPropagation()}},onBlur:fe=>{!v&&!I&&!fe.currentTarget.contains(fe.relatedTarget)&&ue(!0,!0)},children:[Fn(mg,{isFullScreen:l,disableFullscreenMode:i,locked:_e&&!he||pe||I&&v||C,onExpand:a,onCollapse:s,target:Rc,children:[(he&&_e||ge&&tt)&<(di,{label:"Clear selection",icon:Sg,onClick:()=>{ue(),It()}}),ie&&_e&<(di,{label:"Delete row(s)",icon:Eg,onClick:()=>{_t&&(_t(Fe),It())}}),ie&&!_e&<(di,{label:"Add row",icon:Bc,onClick:()=>{var fe;kt&&(x(!0),kt(),It(),(fe=g.current)==null||fe.scrollTo(0,Me,"vertical"))}}),!G&&De.length>Ce.length&<(a1,{columns:De,columnOrder:P,setColumnOrder:B,hideColumn:$,showColumn:Qe,isOpen:C,onClose:()=>T(!1),children:lt(di,{label:"Show/hide columns",icon:Uc,onClick:()=>T(!0)})}),!J&&!G&<(di,{label:"Download as CSV",icon:Ig,onClick:()=>Ve()}),!G&<(di,{label:"Search",icon:Wc,onClick:()=>{O?S(!1):(x(!0),S(!0)),It()}})]}),lt(dg,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Ne,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Xt,maxHeight:Ot,minWidth:rn,maxWidth:Tt,size:Ne,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Ft],snapGap:Ft/3,onResizeStop:(fe,st,Bt,dn)=>{if(d.current){const Jt=2*m.tableBorderWidth;Vt({width:d.current.size.width,height:Ot-d.current.size.height===Jt?d.current.size.height+Jt:d.current.size.height})}},children:lt(Kv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:gn,rows:G?1:Me,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Ft,headerHeight:m.defaultHeaderHeight,getCellContent:G?Pt:gt,onColumnResize:I?void 0:bn,resizeIndicator:"header",freezeColumns:nr,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:I?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:ge?void 0:Be,onItemHovered:fe=>{b==null||b(fe),Ct==null||Ct(fe)},keybindings:{downFill:!0},onKeyDown:fe=>{(fe.ctrlKey||fe.metaKey)&&fe.key==="f"&&(S(st=>!st),fe.stopPropagation(),fe.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{S(!1),It()},onHeaderClicked:(fe,st)=>{!le||ge||(O&&S(!1),he&&_e?ue():ue(!0,!0),Te(fe,"auto"))},gridSelection:Fe,onGridSelectionChange:fe=>{(v||I)&&(it(fe),ln!==void 0&&It())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:fe=>{fe.kind==="out-of-bounds"&&v?x(!1):fe.kind!=="out-of-bounds"&&!v&&x(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...M&&{paddingBottom:E?-6:void 0,paddingRight:R?-6:void 0}},provideEditor:Pe,drawCell:On,customRenderers:Sn,imageEditorOverride:E1,headerIcons:m.headerIcons,validateCell:nn,onHeaderMenuClick:(fe,st)=>{D({columnIdx:fe,headerBounds:st})},onPaste:!1,...he&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:de?"multi":"auto",rowSelect:n?"none":de?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...ge&&{columnSelect:n?"none":ze?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!G&&e.editingMode!==z&&!n&&{fillHandle:!I,onCellEdited:Dt,onPaste:Yt,onDelete:_t},...!G&&e.editingMode===N&&{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:kt,onHeaderClicked:void 0}})}),ln&&ln.content&<(dC,{top:ln.top,left:ln.left,content:ln.content,clearTooltip:It}),L&&$c.createPortal(lt(n1,{top:L.headerBounds.y+L.headerBounds.height,left:L.headerBounds.x+L.headerBounds.width,columnKind:ce[L.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:le?fe=>{O&&S(!1),ue(!(he&&_e),!0),Te(L.columnIdx,fe,!0)}:void 0,isColumnPinned:ce[L.columnIdx].isPinned,onUnpinColumn:()=>{xn(ce[L.columnIdx].id)},onPinColumn:()=>{zt(ce[L.columnIdx].id)},onHideColumn:()=>{$(ce[L.columnIdx].id)},onChangeFormat:fe=>{zn(ce[L.columnIdx].id,fe),setTimeout(()=>{var st;(st=g.current)==null||st.remeasureColumns(vt.fromSingleSelection(L.columnIdx))},100)},onAutosize:()=>{var fe;(fe=g.current)==null||fe.remeasureColumns(vt.fromSingleSelection(L.columnIdx))}}),document.querySelector("#portal"))]})}const gC=hg(hC),mC=f.memo(gC),TC=Object.freeze(Object.defineProperty({__proto__:null,default:mC},Symbol.toStringTag,{value:"Module"}));export{D0 as C,Sd as T,pi as a,Lg as b,TC as c,gi as i,Zm as m,vn as s};
|