streamlit-nightly 1.46.2.dev20250709__py3-none-any.whl → 1.46.2.dev20250711__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/elements/layouts.py +38 -17
- streamlit/elements/widgets/chat.py +1 -5
- streamlit/proto/Block_pb2.py +33 -31
- streamlit/proto/Block_pb2.pyi +3 -1
- streamlit/runtime/state/safe_session_state.py +8 -0
- streamlit/runtime/state/session_state.py +6 -0
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +218 -218
- streamlit/static/static/js/{ErrorOutline.esm.CQd6KUc-.js → ErrorOutline.esm.nBKunzHW.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.DViLqD3l.js → FileDownload.esm.D_aXSOoU.js} +1 -1
- streamlit/static/static/js/{FileHelper.C4kAiX-d.js → FileHelper.BJb-Mp_F.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.3-U9496x.js → FormClearHelper.2JlkoWHt.js} +1 -1
- streamlit/static/static/js/{Hooks.rP-qI29F.js → Hooks.B1F_uNU0.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BbLQarVh.js → InputInstructions.ChHwWL4t.js} +1 -1
- streamlit/static/static/js/{ProgressBar.XjFCBQue.js → ProgressBar.DY5EziOM.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BjvT0tcH.js → RenderInPortalIfExists.BaaagBxu.js} +1 -1
- streamlit/static/static/js/{Toolbar.CI7e539m.js → Toolbar.B5w8znWm.js} +1 -1
- streamlit/static/static/js/{base-input.BwJuQKxC.js → base-input.Dj5Hdt9f.js} +1 -1
- streamlit/static/static/js/{checkbox.YcCb7In-.js → checkbox.CFsoAFuC.js} +1 -1
- streamlit/static/static/js/{createSuper.fMnDQXwy.js → createSuper.D4Dz25Nw.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DispNmCy.js → data-grid-overlay-editor.qkFp1znp.js} +1 -1
- streamlit/static/static/js/{downloader._vfB-j-e.js → downloader.z9ZnG7_l.js} +1 -1
- streamlit/static/static/js/{es6.DIYMfE-r.js → es6.k96zpXRu.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.CXpyzNXN.js → iframeResizer.contentWindow.BICf7ZEG.js} +1 -1
- streamlit/static/static/js/{index.E56AjTPB.js → index.9xm7RJwM.js} +1 -1
- streamlit/static/static/js/{index.DfriPCJP.js → index.AEOnkk1b.js} +1 -1
- streamlit/static/static/js/{index.Dy7h795S.js → index.ANyBXmx0.js} +1 -1
- streamlit/static/static/js/{index.5oEU0Akm.js → index.B9UNSCvC.js} +1 -1
- streamlit/static/static/js/{index.ColMLoRT.js → index.BOh9qyV-.js} +1 -1
- streamlit/static/static/js/{index.Bqhfg7Oa.js → index.BPFkLBAZ.js} +1 -1
- streamlit/static/static/js/{index.Dga_qPJ0.js → index.BX2G46un.js} +1 -1
- streamlit/static/static/js/{index.D958aGV_.js → index.B_scCzPb.js} +5 -5
- streamlit/static/static/js/{index.BqJEh5EN.js → index.BrBcucX6.js} +1 -1
- streamlit/static/static/js/{index.BdEa6sZz.js → index.BtEjeuF0.js} +1 -1
- streamlit/static/static/js/{index.Chkl1asR.js → index.C-TmYhWS.js} +1 -1
- streamlit/static/static/js/{index.D4qwHqKM.js → index.C5g-H5NK.js} +1 -1
- streamlit/static/static/js/{index.c5gLd5mL.js → index.C6dAEAvM.js} +1 -1
- streamlit/static/static/js/{index.Cfv4QyQX.js → index.CLetLomk.js} +1 -1
- streamlit/static/static/js/{index.BNjHNjlf.js → index.CNFjY9vd.js} +1 -1
- streamlit/static/static/js/{index.Dgd7wAuk.js → index.CVlABXnR.js} +1 -1
- streamlit/static/static/js/{index.4cT3qV4n.js → index.CVwfPgJb.js} +1 -1
- streamlit/static/static/js/{index.D2-Y5_wx.js → index.Ca0NjIq6.js} +1 -1
- streamlit/static/static/js/{index.BIsGWvbq.js → index.CiIyRUPP.js} +1 -1
- streamlit/static/static/js/{index.DG9Ir4m4.js → index.Co3yifkX.js} +1 -1
- streamlit/static/static/js/{index.CQayRGxD.js → index.CoFIYjLT.js} +1 -1
- streamlit/static/static/js/{index.BgUl4InR.js → index.Cu2aS7PE.js} +1 -1
- streamlit/static/static/js/{index.BJLFstQK.js → index.Cw5wCOZJ.js} +1 -1
- streamlit/static/static/js/{index.BYrFjIUs.js → index.DAwvRh5i.js} +1 -1
- streamlit/static/static/js/{index.DQXpaPor.js → index.DIUWCb0U.js} +1 -1
- streamlit/static/static/js/{index.Jr-tvRTy.js → index.DM5MUilm.js} +1 -1
- streamlit/static/static/js/{index.Cx24fujh.js → index.DSLNMk6r.js} +1 -1
- streamlit/static/static/js/{index.D9GxqhKH.js → index.DemRLecV.js} +1 -1
- streamlit/static/static/js/{index.atasR7_f.js → index.DgDUf7u7.js} +1 -1
- streamlit/static/static/js/{index.Bo8tNSYW.js → index.Dguvirr2.js} +1 -1
- streamlit/static/static/js/{index.B1xRrJhO.js → index.Djt_wOzM.js} +1 -1
- streamlit/static/static/js/{index.BIU1Hwtm.js → index.DomTjdOI.js} +110 -136
- streamlit/static/static/js/{index.D8bLiwaV.js → index.GafbWues.js} +1 -1
- streamlit/static/static/js/index.I8jbtihw.js +73 -0
- streamlit/static/static/js/{index.LbtilNNP.js → index.QPRFBZaK.js} +1 -1
- streamlit/static/static/js/{index.BQVB466_.js → index.fKQteDc9.js} +1 -1
- streamlit/static/static/js/{index.D1VFO1GM.js → index.xyuBiBdK.js} +1 -1
- streamlit/static/static/js/{input.Dudaq2DP.js → input.CdCd7Vsx.js} +1 -1
- streamlit/static/static/js/{memory.DIuUp1Sn.js → memory.DBq7wzyd.js} +1 -1
- streamlit/static/static/js/{mergeWith.D9D0WgL_.js → mergeWith.DUn_nLa3.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.DUBtvgiU.js → number-overlay-editor.efE_o5de.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.ql9j_wzC.js → possibleConstructorReturn.DvoUmvy8.js} +1 -1
- streamlit/static/static/js/{sandbox.D_vlGgEg.js → sandbox.DzwlbTah.js} +1 -1
- streamlit/static/static/js/{timepicker.DtFPFwb0.js → timepicker.DVmIwrqO.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.DMsseOni.js → toConsumableArray.CXsrrX5k.js} +1 -1
- streamlit/static/static/js/{uniqueId.BkUMU8CT.js → uniqueId.BLI04V-q.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.Cp78gjjh.js → useBasicWidgetState.DN8AXUhc.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.CHkjh73V.js → useOnInputChange.BkCJpFf6.js} +1 -1
- streamlit/static/static/js/{useTextInputAutoExpand.CE_GiZ0L.js → useTextInputAutoExpand.D2t63Ou1.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CplO1PK6.js → withFullScreenWrapper.B-UO29lk.js} +1 -1
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250711.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250711.dist-info}/RECORD +80 -80
- streamlit/static/static/js/index.CUirymUQ.js +0 -73
- {streamlit_nightly-1.46.2.dev20250709.data → streamlit_nightly-1.46.2.dev20250711.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250711.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250711.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.2.dev20250709.dist-info → streamlit_nightly-1.46.2.dev20250711.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.
|
2
|
-
import{r as d,E as Ps,_ as Ne,c as oh,g as ar,i as $a,d as so,e as ah,f as sh,h as lh,m as kc,n as Mc,R as Nt,o as uh,p as Rc,q as ch,t as dh,u as fh,v as hh,w as gh,x as mh,a as Cr,y as _s,s as mi,z as $r,j as Qe,F as Ec,A as ma,T as Ic,B as pa,C as In,D as nr,G as va,H as cn,I as Tc,J as ai,K as ph,L as vh,M as Ae,N as Dc,O as st,Q as qi,S as zr,U as Ba,V as bh,W as wh,X as yh,Y as Il,Z as Ch,$ as Sh,a0 as xh,a1 as kh,a2 as Oc,a3 as Mh,a4 as Rh,a5 as bs,a6 as Pc,a7 as _c,a8 as Eh,a9 as Ih,aa as Th,ab as Dh,ac as Oh,ad as Ph,ae as _h,af as Fh,ag as Lh,ah as Fc,ai as Ah,aj as Hh,ak as zh,al as Vh,am as Nh,an as $h,ao as Bh,ap as Wh,aq as Uh,ar as qh,as as Gh,at as Yh,au as Xh,av as jh,aw as Cn,l as Fs,ax as Gi,ay as sr,az as _e,aA as Kh,b as Lc,aB as Ac,k as Zh,aC as Jh,aD as Qh,aE as Wa,aF as eg,aG as tg,aH as ng,aI as rg,aJ as ig}from"./index.BIU1Hwtm.js";import{u as og}from"./FormClearHelper.3-U9496x.js";import{w as ag,E as sg}from"./withFullScreenWrapper.CplO1PK6.js";import{T as lg,a as ii}from"./Toolbar.CI7e539m.js";import{L as ug,S as cg,a as dg}from"./checkbox.YcCb7In-.js";import{m as fg}from"./mergeWith.D9D0WgL_.js";import{s as hg}from"./sprintf.D7DtBTRn.js";import{c as gg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as rr,a as Ls,C as mg}from"./toConsumableArray.DMsseOni.js";import{_ as pg,a as vg,b as bg}from"./possibleConstructorReturn.ql9j_wzC.js";import{_ as wg}from"./createSuper.fMnDQXwy.js";import{D as yg,F as Cg}from"./FileDownload.esm.DViLqD3l.js";var Hc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Hc.displayName="Add";var zc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});zc.displayName="Search";var Vc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Vc.displayName="Visibility";var Ua,Tl;function Sg(){if(Tl)return Ua;Tl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ua=n,Ua}var qa,Dl;function xg(){if(Dl)return qa;Dl=1;var e=Sg(),t=oh();function n(r,i){return r!=null&&t(r,i,e)}return qa=n,qa}var kg=xg();const Mg=ar(kg);function Nc(e="This should not happen"){throw new Error(e)}function Tn(e,t="Assertion failed"){if(!e)return Nc(t)}function eo(e,t){return Nc(t??"Hell froze over")}function Rg(e,t){try{return e()}catch{return t}}const Ol=Object.prototype.hasOwnProperty;function hi(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--&&hi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ol.call(e,n)&&++r&&!Ol.call(t,n)||!(n in t)||!hi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ea=null,As=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Pl;(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"})(Pl||(Pl={}));var ta;(function(e){e.Triangle="triangle",e.Dots="dots"})(ta||(ta={}));function Po(e){return"width"in e&&typeof e.width=="number"}async function _l(e){return typeof e=="object"?e:await e()}function si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function ui(e){return e.kind===An.Marker||e.kind===An.NewRow}function Yi(e){if(!si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:eo(e,"A cell was passed with an invalid kind")}}function Eg(e){return Mg(e,"editor")}function Hs(e){return!(e.readonly??!1)}var An;(function(e){e.NewRow="new-row",e.Marker="marker"})(An||(An={}));function Ig(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Fl;class rt{items;constructor(t){this.items=t}static empty=()=>Fl??(Fl=new rt([]));static fromSingleSelection=t=>rt.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new rt(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ig([...this.items,n]);return new rt(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,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new rt(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}}var Tg=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[,l]=a.split("_");n[l]=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(" ")},Ll=Tg,Dg=e=>e.toUpperCase()===e,Og=e=>t=>e.indexOf(t)===-1,$c=(e,t)=>{const n={};return Object.keys(e).filter(Og(t)).forEach(r=>{n[r]=e[r]}),n};function Pg(e,t,n){const r=$c(t,n);if(!e){const i=typeof $a=="function"?{default:$a}:$a;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var _g=(e,t)=>{};function Fg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Dg(a[0])):n.propsAsIs,c=Pg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Ll(n.class,c.className||l):Ll(c.className||l,n.class);const{vars:f}=n;if(f){const g={};for(const p in f){const w=f[p],b=w[0],v=w[1]||"",S=typeof b=="function"?b(o):b;_g(S,n.name),g[`--${p}`]=`${S}${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,d.createElement(e,c)):d.createElement(a,c)},i=d.forwardRef?d.forwardRef(r):o=>{const s=$c(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var fn=Fg;const Lg=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ga={},_i={},_o={},Fo={},Al;function Ag(){return Al||(Al=1,function(e){(function(t,n){n(e,so(),ah())})(Fo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(v[R]=O[R])}return v};function l(v,S){var O={};for(var R in v)S.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(v,R)&&(O[R]=v[R]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}return function(S,O,R){return O&&v(S.prototype,O),R&&v(S,R),S}}();function f(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}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 w(v){if("touches"in v){var S=v.touches[0],O=S.pageX,R=S.pageY;return{x:O,y:R}}var M=v.screenX,_=v.screenY;return{x:M,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var E=f(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(M)));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(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=w(R),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=w(R),_=M.x,E=M.y,k=_-this.moveStart.x,F=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,E=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["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:M,style:_},k),E)}}]),S}(n.Component);b.displayName="ReactSwipe",b.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},b.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=b})}(Fo)),Fo}var Hl;function Bc(){return Hl||(Hl=1,function(e){(function(t,n){n(e,Ag())})(_o,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})}(_o)),_o}var Fi={},zl;function Wc(){if(zl)return Fi;zl=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=void 0;var e=t(sh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,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,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,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 Fi.default=r,Fi}var Li={},Ai={},Vl;function Hg(){if(Vl)return Ai;Vl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Ai.outerWidth=e,Ai}var Hi={},Nl;function zs(){if(Nl)return Hi;Nl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Hi.default=e,Hi}var zi={},$l;function Uc(){if($l)return zi;$l=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=function(){return window};return zi.default=e,zi}var Bl;function qc(){if(Bl)return Li;Bl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=l(so()),t=s(Wc()),n=Hg(),r=s(zs()),i=s(Bc()),o=s(Uc());function s(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 l(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 F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(F,C,I):F[C]=E[C]}return F.default=E,k&&k.set(E,F),F}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(E[D]=F[D])}return E},c.apply(this,arguments)}function f(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,F){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 w(E){var k=S();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return b(this,C)}}function b(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 S(){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(F){return F.__proto__||Object.getPrototypeOf(F)},O(E)}function R(E,k,F){return k in E?Object.defineProperty(E,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[k]=F,E}var M=function(k){return k.hasOwnProperty("key")},_=function(E){m(F,E);var k=w(F);function F(D){var C;return f(this,F),C=k.call(this,D),R(v(C),"itemsWrapperRef",void 0),R(v(C),"itemsListRef",void 0),R(v(C),"thumbsRef",void 0),R(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),R(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),R(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),R(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),$=Math.floor(T/x),q=$<I,X=q?I-$:0;C.setState(function(oe,Q){return{itemSize:x,visibleItems:$,firstItem:q?C.getFirstItem(Q.selectedItem):0,lastPosition:X,showArrows:q}})}}),R(v(C),"handleClickItem",function(I,T,x){if(!M(x)||x.key==="Enter"){var $=C.props.onSelectItem;typeof $=="function"&&$(I,T)}}),R(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,$=e.Children.count(C.props.children),q=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max($-C.state.visibleItems,0),oe=-X*100/C.state.visibleItems;q===x&&T>0&&(T=0),q===oe&&T<0&&(T=0);var Q=C.itemsWrapperRef.clientWidth,J=q+100/(Q/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(J,"%",C.props.axis)}),!0}),R(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),R(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),R(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),$={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},q=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(q,"px",this.props.axis),oe=this.props.transitionTime+"ms";return $={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:$,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:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Li.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Li}var Vi={},Wl;function zg(){if(Wl)return Vi;Wl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(){return document};return Vi.default=e,Vi}var En={},Ul;function Gc(){if(Ul)return En;Ul=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e=so(),t=n(zs());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};En.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};En.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};En.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};En.getPosition=s;var a=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return En.setPosition=a,En}var Bn={},ql;function Vg(){if(ql)return Bn;ql=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.fadeAnimationHandler=Bn.slideStopSwipingHandler=Bn.slideSwipeAnimationHandler=Bn.slideAnimationHandler=void 0;var e=so(),t=r(zs()),n=Gc();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(f,p).enumerable})),h.push.apply(h,m)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(f,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(h,m))})}return f}function s(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var a=function(g,h){var m={},p=h.selectedItem,w=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return w<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):w>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};Bn.slideAnimationHandler=a;var l=function(g,h,m,p){var w={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),M=b?g.x:g.y,_=M;O===S&&M>0&&(_=0),O===R&&M<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(M)>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}),w.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),w};Bn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Bn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",w={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||(w=o(o({},w),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:w,selectedStyle:o(o({},w),{},{opacity:1,position:"relative"}),prevStyle:o({},w)}};return Bn.fadeAnimationHandler=c,Bn}var Gl;function Ng(){if(Gl)return _i;Gl=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var e=c(so()),t=l(Bc()),n=l(Wc()),r=l(qc()),i=l(zg()),o=l(Uc()),s=Gc(),a=Vg();function l(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||f(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var $=T?Object.getOwnPropertyDescriptor(D,x):null;$&&($.get||$.set)?Object.defineProperty(I,x,$):I[x]=D[x]}return I.default=D,C&&C.set(D,I),I}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(I){return typeof I}:f=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},f(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function w(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,I){return C&&w(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&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=E(D),x;if(C){var $=E(this).constructor;x=Reflect.construct(T,arguments,$)}else x=T.apply(this,arguments);return R(this,x)}}function R(D,C){return C&&(f(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var F=function(D){v(I,D);var C=O(I);function I(T){var x;p(this,I),x=C.call(this,T),k(M(x),"thumbsRef",void 0),k(M(x),"carouselWrapperRef",void 0),k(M(x),"listRef",void 0),k(M(x),"itemsRef",void 0),k(M(x),"timer",void 0),k(M(x),"animationHandler",void 0),k(M(x),"setThumbsRef",function(q){x.thumbsRef=q}),k(M(x),"setCarouselWrapperRef",function(q){x.carouselWrapperRef=q}),k(M(x),"setListRef",function(q){x.listRef=q}),k(M(x),"setItemsRef",function(q,X){x.itemsRef||(x.itemsRef=[]),x.itemsRef[X]=q}),k(M(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(M(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(M(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(M(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(M(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(M(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(x),"navigateWithKeyboard",function(q){if(x.isFocusWithinTheCarousel()){var X=x.props.axis,oe=X==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},J=oe?Q.ArrowRight:Q.ArrowDown,te=oe?Q.ArrowLeft:Q.ArrowUp;J===q.keyCode?x.increment():te===q.keyCode&&x.decrement()}}),k(M(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var q=x.props.axis==="horizontal",X=x.itemsRef[0];if(X){var oe=q?X.clientWidth:X.clientHeight;x.setState({itemSize:oe}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(M(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(M(x),"handleClickItem",function(q,X){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(q,X),q!==x.state.selectedItem&&x.setState({selectedItem:q})}}),k(M(x),"handleOnChange",function(q,X){e.Children.count(x.props.children)<=1||x.props.onChange(q,X)}),k(M(x),"handleClickThumb",function(q,X){x.props.onClickThumb(q,X),x.moveTo(q)}),k(M(x),"onSwipeStart",function(q){x.setState({swiping:!0}),x.props.onSwipeStart(q)}),k(M(x),"onSwipeEnd",function(q){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(q),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(M(x),"onSwipeMove",function(q,X){x.props.onSwipeMove(X);var oe=x.props.swipeAnimationHandler(q,x.props,x.state,x.setState.bind(M(x)));return x.setState(m({},oe)),!!Object.keys(oe).length}),k(M(x),"decrement",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof q=="number"?q:1))}),k(M(x),"increment",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof q=="number"?q:1))}),k(M(x),"moveTo",function(q){if(typeof q=="number"){var X=e.Children.count(x.props.children)-1;q<0&&(q=x.props.infiniteLoop?X:0),q>X&&(q=x.props.infiniteLoop?0:X),x.selectItem({selectedItem:q}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(M(x),"onClickNext",function(){x.increment(1)}),k(M(x),"onClickPrev",function(){x.decrement(1)}),k(M(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"changeItem",function(q){return function(X){(!(0,s.isKeyboardEvent)(X)||X.key==="Enter")&&x.moveTo(q)}}),k(M(x),"selectItem",function(q){x.setState(m({previousItem:x.state.selectedItem},q),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(q.selectedItem,e.Children.toArray(x.props.children)[q.selectedItem])}),k(M(x),"getInitialImage",function(){var q=x.props.selectedItem,X=x.itemsRef&&x.itemsRef[q],oe=X&&X.getElementsByTagName("img")||[];return oe[0]}),k(M(x),"getVariableItemHeight",function(q){var X=x.itemsRef&&x.itemsRef[q];if(x.state.hasMount&&X&&X.children.length){var oe=X.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var J=function le(){x.forceUpdate(),Q.removeEventListener("load",le)};Q.addEventListener("load",J)}}var te=oe[0]||X.children[0],ae=te.clientHeight;return ae>0?ae:null}return null});var $={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},$),x.animationHandler(T,$)),x}return b(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,$){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 $=x.getInitialImage();$&&!$.complete?$.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.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 x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var $=this;return this.props.children?e.Children.map(this.props.children,function(q,X){var oe=X===$.state.selectedItem,Q=X===$.state.previousItem,J=oe&&$.state.selectedStyle||Q&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(J=m(m({},J),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(J=m(m({},J),{},{pointerEvents:"none"}));var te={ref:function(le){return $.setItemsRef(le,X)},key:"itemKey"+X+(x?"clone":""),className:n.default.ITEM(!0,X===$.state.selectedItem,X===$.state.previousItem),onClick:$.handleClickItem.bind($,X,q),style:J};return e.default.createElement("li",te,$.props.renderItem(q,{isSelected:X===$.state.selectedItem,isPrevious:X===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,$=this.props,q=$.showIndicators,X=$.labels,oe=$.renderIndicator,Q=$.children;return q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(J,te){return oe&&oe(x.changeItem(te),te===x.state.selectedItem,te,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 x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var $=this.props.swipeable&&e.Children.count(this.props.children)>1,q=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,J=this.renderItems(!0),te=J.shift(),ae=J.pop(),le={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},fe={};if(q){if(le.onSwipeLeft=this.onSwipeForward,le.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else le.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,le.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,le.style=m(m({},le.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},le,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return _i.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,x){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function($){return $.type==="img"})),!!x)return x});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:s.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}),_i}var Yl={},Xl;function $g(){return Xl||(Xl=1),Yl}var jl;function Bg(){return jl||(jl=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(Ng()),n=$g(),r=i(qc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ga)),Ga}var Wg=Bg(),Ya,Kl;function Ug(){if(Kl)return Ya;Kl=1;var e=lh(),t=function(){return e.Date.now()};return Ya=t,Ya}var Xa,Zl;function Yc(){if(Zl)return Xa;Zl=1;var e=kc(),t=Ug(),n=Mc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,f,g,h,m,p,w=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(I){var T=c,x=f;return c=f=void 0,w=I,h=a.apply(x,T),h}function R(I){return w=I,m=setTimeout(E,l),b?O(I):h}function M(I){var T=I-p,x=I-w,$=l-T;return v?o($,g-x):$}function _(I){var T=I-p,x=I-w;return p===void 0||T>=l||T<0||v&&x>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,M(I))}function k(I){return m=void 0,S&&c?O(I):(c=f=void 0,h)}function F(){m!==void 0&&clearTimeout(m),w=0,c=p=f=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,f=this,p=I,T){if(m===void 0)return R(p);if(v)return clearTimeout(m),m=setTimeout(E,l),O(p)}return m===void 0&&(m=setTimeout(E,l)),h}return C.cancel=F,C.flush=D,C}return Xa=s,Xa}var qg=Yc();const Xc=ar(qg);function dn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function br(e,t){return e===void 0?void 0:t}const Gg=Math.PI;function Jl(e){return e*Gg/180}const jc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Kc=(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}},Zc=(e,t,n)=>Math.min(e,t-n*2),Jc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vs=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.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"}),d.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"}))},Yg=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Xg(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const s=d.useRef(Xc(a=>{o.current&&i(a)},n));return d.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const jg="֑-߿יִ-﷽ﹰ-ﻼ",Kg="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Zg=new RegExp("^[^"+Kg+"]*["+jg+"]");function Ns(e){return Zg.test(e)?"rtl":"not-rtl"}let Lo;function ws(){if(typeof document>"u")return 0;if(Lo!==void 0)return Lo;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(),Lo=n-r,Lo}const Ar=Symbol();function Jg(e){const t=d.useRef([Ar,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(a=>{const l=t.current[0];l!==Ar&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ar&&i({}),r(u=>typeof a=="function"?a(l===Ar?u:l):a),t.current[0]=Ar)},[]),s=d.useCallback(()=>{t.current[0]=Ar,i({})},[]);return[t.current[0]===Ar?n:t.current[0],o,s]}function Qc(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 Qg(e){const t=d.useRef(e);return hi(e,t.current)||(t.current=e),t.current}const em=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return d.createElement(Lg,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Wg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Vs,null)))};function ed(){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 Br=ed();function tm(e){Br=e}const td=/[&<>"']/,nm=new RegExp(td.source,"g"),nd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,rm=new RegExp(nd.source,"g"),im={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql=e=>im[e];function vn(e,t){if(t){if(td.test(e))return e.replace(nm,Ql)}else if(nd.test(e))return e.replace(rm,Ql);return e}const om=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function rd(e){return e.replace(om,(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 am=/(^|[^\[])\^/g;function Ht(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(am,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const sm=/[^\w:]/g,lm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function eu(e,t,n){if(e){let r;try{r=decodeURIComponent(rd(n)).replace(sm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!lm.test(n)&&(n=fm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ao={},um=/^[^:]+:\/*[^/]*$/,cm=/^([^:]+:)[\s\S]*$/,dm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function fm(e,t){Ao[" "+e]||(um.test(e)?Ao[" "+e]=e+"/":Ao[" "+e]=jo(e,"/",!0)),e=Ao[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(cm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(dm,"$1")+t:e+t}const na={exec:function(){}};function tu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),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 hm(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 gm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function nu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ru(e,t,n,r){const i=t.href,o=t.title?vn(t.title):null,s=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:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:vn(s)}}function mm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.qkFp1znp.js","./index.DomTjdOI.js","../css/index.CJVRHjQZ.css","./FormClearHelper.2JlkoWHt.js","./withFullScreenWrapper.B-UO29lk.js","./Toolbar.B5w8znWm.js","./checkbox.CFsoAFuC.js","./mergeWith.DUn_nLa3.js","./sprintf.D7DtBTRn.js","./createDownloadLinkElement.DZMwyjvU.js","./toConsumableArray.CXsrrX5k.js","./possibleConstructorReturn.DvoUmvy8.js","./createSuper.D4Dz25Nw.js","./FileDownload.esm.D_aXSOoU.js","./number-overlay-editor.efE_o5de.js","./es6.k96zpXRu.js"])))=>i.map(i=>d[i]);
|
2
|
+
import{r as d,E as Ps,_ as Ne,c as oh,g as ar,i as $a,d as so,e as ah,f as sh,h as lh,m as kc,n as Mc,R as Nt,o as uh,p as Rc,q as ch,t as dh,u as fh,v as hh,w as gh,x as mh,a as Cr,y as _s,s as mi,z as $r,j as Qe,F as Ec,A as ma,T as Ic,B as pa,C as In,D as nr,G as va,H as cn,I as Tc,J as ai,K as ph,L as vh,M as Ae,N as Dc,O as st,Q as qi,S as zr,U as Ba,V as bh,W as wh,X as yh,Y as Il,Z as Ch,$ as Sh,a0 as xh,a1 as kh,a2 as Oc,a3 as Mh,a4 as Rh,a5 as bs,a6 as Pc,a7 as _c,a8 as Eh,a9 as Ih,aa as Th,ab as Dh,ac as Oh,ad as Ph,ae as _h,af as Fh,ag as Lh,ah as Fc,ai as Ah,aj as Hh,ak as zh,al as Vh,am as Nh,an as $h,ao as Bh,ap as Wh,aq as Uh,ar as qh,as as Gh,at as Yh,au as Xh,av as jh,aw as Cn,l as Fs,ax as Gi,ay as sr,az as _e,aA as Kh,b as Lc,aB as Ac,k as Zh,aC as Jh,aD as Qh,aE as Wa,aF as eg,aG as tg,aH as ng,aI as rg,aJ as ig}from"./index.DomTjdOI.js";import{u as og}from"./FormClearHelper.2JlkoWHt.js";import{w as ag,E as sg}from"./withFullScreenWrapper.B-UO29lk.js";import{T as lg,a as ii}from"./Toolbar.B5w8znWm.js";import{L as ug,S as cg,a as dg}from"./checkbox.CFsoAFuC.js";import{m as fg}from"./mergeWith.DUn_nLa3.js";import{s as hg}from"./sprintf.D7DtBTRn.js";import{c as gg}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as rr,a as Ls,C as mg}from"./toConsumableArray.CXsrrX5k.js";import{_ as pg,a as vg,b as bg}from"./possibleConstructorReturn.DvoUmvy8.js";import{_ as wg}from"./createSuper.D4Dz25Nw.js";import{D as yg,F as Cg}from"./FileDownload.esm.D_aXSOoU.js";var Hc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});Hc.displayName="Add";var zc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});zc.displayName="Search";var Vc=d.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return d.createElement(Ps,Ne({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),d.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),d.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"}))});Vc.displayName="Visibility";var Ua,Tl;function Sg(){if(Tl)return Ua;Tl=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return Ua=n,Ua}var qa,Dl;function xg(){if(Dl)return qa;Dl=1;var e=Sg(),t=oh();function n(r,i){return r!=null&&t(r,i,e)}return qa=n,qa}var kg=xg();const Mg=ar(kg);function Nc(e="This should not happen"){throw new Error(e)}function Tn(e,t="Assertion failed"){if(!e)return Nc(t)}function eo(e,t){return Nc(t??"Hell froze over")}function Rg(e,t){try{return e()}catch{return t}}const Ol=Object.prototype.hasOwnProperty;function hi(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--&&hi(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ol.call(e,n)&&++r&&!Ol.call(t,n)||!(n in t)||!hi(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const ea=null,As=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Pl;(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"})(Pl||(Pl={}));var ta;(function(e){e.Triangle="triangle",e.Dots="dots"})(ta||(ta={}));function Po(e){return"width"in e&&typeof e.width=="number"}async function _l(e){return typeof e=="object"?e:await e()}function si(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function ui(e){return e.kind===An.Marker||e.kind===An.NewRow}function Yi(e){if(!si(e)||e.kind===Z.Image)return!1;switch(e.kind){case Z.Text:case Z.Number:case Z.Markdown:case Z.Uri:case Z.Custom:case Z.Boolean:return e.readonly!==!0;default:eo(e,"A cell was passed with an invalid kind")}}function Eg(e){return Mg(e,"editor")}function Hs(e){return!(e.readonly??!1)}var An;(function(e){e.NewRow="new-row",e.Marker="marker"})(An||(An={}));function Ig(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,i){return r[0]-i[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const i=n[n.length-1];i[1]<r[0]?n.push([...r]):i[1]<r[1]&&(i[1]=r[1])}return n}let Fl;class rt{items;constructor(t){this.items=t}static empty=()=>Fl??(Fl=new rt([]));static fromSingleSelection=t=>rt.empty().add(t);offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new rt(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=Ig([...this.items,n]);return new rt(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,s]of n.entries()){const[a,l]=s;if(a<=i&&r<=l){const u=[];a<r&&u.push([a,r]),i<l&&u.push([i,l]),n.splice(o,1,...u)}}return new rt(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}}var Tg=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[,l]=a.split("_");n[l]=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(" ")},Ll=Tg,Dg=e=>e.toUpperCase()===e,Og=e=>t=>e.indexOf(t)===-1,$c=(e,t)=>{const n={};return Object.keys(e).filter(Og(t)).forEach(r=>{n[r]=e[r]}),n};function Pg(e,t,n){const r=$c(t,n);if(!e){const i=typeof $a=="function"?{default:$a}:$a;Object.keys(r).forEach(o=>{i.default(o)||delete r[o]})}return r}var _g=(e,t)=>{};function Fg(e){let t="";return n=>{const r=(o,s)=>{const{as:a=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&!Dg(a[0])):n.propsAsIs,c=Pg(u,o,["as","class"]);c.ref=s,c.className=n.atomic?Ll(n.class,c.className||l):Ll(c.className||l,n.class);const{vars:f}=n;if(f){const g={};for(const p in f){const w=f[p],b=w[0],v=w[1]||"",S=typeof b=="function"?b(o):b;_g(S,n.name),g[`--${p}`]=`${S}${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,d.createElement(e,c)):d.createElement(a,c)},i=d.forwardRef?d.forwardRef(r):o=>{const s=$c(o,["innerRef"]);return r(s,o.innerRef)};return i.displayName=n.name,i.__wyw_meta={className:n.class||t,extends:e},i}}var fn=Fg;const Lg=fn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Ga={},_i={},_o={},Fo={},Al;function Ag(){return Al||(Al=1,function(e){(function(t,n){n(e,so(),ah())})(Fo,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var i=s(n),o=s(r);function s(v){return v&&v.__esModule?v:{default:v}}var a=Object.assign||function(v){for(var S=1;S<arguments.length;S++){var O=arguments[S];for(var R in O)Object.prototype.hasOwnProperty.call(O,R)&&(v[R]=O[R])}return v};function l(v,S){var O={};for(var R in v)S.indexOf(R)>=0||Object.prototype.hasOwnProperty.call(v,R)&&(O[R]=v[R]);return O}function u(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function v(S,O){for(var R=0;R<O.length;R++){var M=O[R];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}return function(S,O,R){return O&&v(S.prototype,O),R&&v(S,R),S}}();function f(v,S){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:v}function g(v,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);v.prototype=Object.create(S&&S.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(v,S):v.__proto__=S)}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 w(v){if("touches"in v){var S=v.touches[0],O=S.pageX,R=S.pageY;return{x:O,y:R}}var M=v.screenX,_=v.screenY;return{x:M,y:_}}var b=function(v){g(S,v);function S(){var O;u(this,S);for(var R=arguments.length,M=Array(R),_=0;_<R;_++)M[_]=arguments[_];var E=f(this,(O=S.__proto__||Object.getPrototypeOf(S)).call.apply(O,[this].concat(M)));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(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(R){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(R))}},{key:"_onMouseMove",value:function(R){this.mouseDown&&this._handleSwipeMove(R)}},{key:"_onMouseUp",value:function(R){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(R)}},{key:"_handleSwipeStart",value:function(R){var M=w(R),_=M.x,E=M.y;this.moveStart={x:_,y:E},this.props.onSwipeStart(R)}},{key:"_handleSwipeMove",value:function(R){if(this.moveStart){var M=w(R),_=M.x,E=M.y,k=_-this.moveStart.x,F=E-this.moveStart.y;this.moving=!0;var D=this.props.onSwipeMove({x:k,y:F},R);D&&R.cancelable&&R.preventDefault(),this.movePosition={deltaX:k,deltaY:F}}}},{key:"_handleSwipeEnd",value:function(R){this.props.onSwipeEnd(R);var M=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-M?this.props.onSwipeLeft(1,R):this.movePosition.deltaX>M&&this.props.onSwipeRight(1,R),this.movePosition.deltaY<-M?this.props.onSwipeUp(1,R):this.movePosition.deltaY>M&&this.props.onSwipeDown(1,R)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(R){this.swiper=R,this.props.innerRef(R)}},{key:"render",value:function(){var R=this.props;R.tagName;var M=R.className,_=R.style,E=R.children;R.allowMouseEvents,R.onSwipeUp,R.onSwipeDown,R.onSwipeLeft,R.onSwipeRight,R.onSwipeStart,R.onSwipeMove,R.onSwipeEnd,R.innerRef,R.tolerance;var k=l(R,["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:M,style:_},k),E)}}]),S}(n.Component);b.displayName="ReactSwipe",b.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},b.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=b})}(Fo)),Fo}var Hl;function Bc(){return Hl||(Hl=1,function(e){(function(t,n){n(e,Ag())})(_o,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})}(_o)),_o}var Fi={},zl;function Wc(){if(zl)return Fi;zl=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=void 0;var e=t(sh());function t(i){return i&&i.__esModule?i:{default:i}}function n(i,o,s){return o in i?Object.defineProperty(i,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[o]=s,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,s){return(0,e.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":s==="horizontal","axis-vertical":s!=="horizontal"})},SLIDER:function(o,s){return(0,e.default)({thumbs:!o,slider:o,animated:!s})},ITEM:function(o,s,a){return(0,e.default)({thumb:!o,slide:o,selected:s,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 Fi.default=r,Fi}var Li={},Ai={},Vl;function Hg(){if(Vl)return Ai;Vl=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.outerWidth=void 0;var e=function(n){var r=n.offsetWidth,i=getComputedStyle(n);return r+=parseInt(i.marginLeft)+parseInt(i.marginRight),r};return Ai.outerWidth=e,Ai}var Hi={},Nl;function zs(){if(Nl)return Hi;Nl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=void 0;var e=function(n,r,i){var o=n===0?n:n+r,s=i==="horizontal"?[o,0,0]:[0,o,0],a="translate3d",l="("+s.join(",")+")";return a+l};return Hi.default=e,Hi}var zi={},$l;function Uc(){if($l)return zi;$l=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=void 0;var e=function(){return window};return zi.default=e,zi}var Bl;function qc(){if(Bl)return Li;Bl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default=void 0;var e=l(so()),t=s(Wc()),n=Hg(),r=s(zs()),i=s(Bc()),o=s(Uc());function s(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 l(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 F={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in E)if(Object.prototype.hasOwnProperty.call(E,C)){var I=D?Object.getOwnPropertyDescriptor(E,C):null;I&&(I.get||I.set)?Object.defineProperty(F,C,I):F[C]=E[C]}return F.default=E,k&&k.set(E,F),F}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(F){return typeof F}:u=function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},u(E)}function c(){return c=Object.assign||function(E){for(var k=1;k<arguments.length;k++){var F=arguments[k];for(var D in F)Object.prototype.hasOwnProperty.call(F,D)&&(E[D]=F[D])}return E},c.apply(this,arguments)}function f(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")}function g(E,k){for(var F=0;F<k.length;F++){var D=k[F];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(E,D.key,D)}}function h(E,k,F){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 w(E){var k=S();return function(){var D=O(E),C;if(k){var I=O(this).constructor;C=Reflect.construct(D,arguments,I)}else C=D.apply(this,arguments);return b(this,C)}}function b(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 S(){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(F){return F.__proto__||Object.getPrototypeOf(F)},O(E)}function R(E,k,F){return k in E?Object.defineProperty(E,k,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[k]=F,E}var M=function(k){return k.hasOwnProperty("key")},_=function(E){m(F,E);var k=w(F);function F(D){var C;return f(this,F),C=k.call(this,D),R(v(C),"itemsWrapperRef",void 0),R(v(C),"itemsListRef",void 0),R(v(C),"thumbsRef",void 0),R(v(C),"setItemsWrapperRef",function(I){C.itemsWrapperRef=I}),R(v(C),"setItemsListRef",function(I){C.itemsListRef=I}),R(v(C),"setThumbsRef",function(I,T){C.thumbsRef||(C.thumbsRef=[]),C.thumbsRef[T]=I}),R(v(C),"updateSizes",function(){if(!(!C.props.children||!C.itemsWrapperRef||!C.thumbsRef)){var I=e.Children.count(C.props.children),T=C.itemsWrapperRef.clientWidth,x=C.props.thumbWidth?C.props.thumbWidth:(0,n.outerWidth)(C.thumbsRef[0]),$=Math.floor(T/x),q=$<I,X=q?I-$:0;C.setState(function(oe,Q){return{itemSize:x,visibleItems:$,firstItem:q?C.getFirstItem(Q.selectedItem):0,lastPosition:X,showArrows:q}})}}),R(v(C),"handleClickItem",function(I,T,x){if(!M(x)||x.key==="Enter"){var $=C.props.onSelectItem;typeof $=="function"&&$(I,T)}}),R(v(C),"onSwipeStart",function(){C.setState({swiping:!0})}),R(v(C),"onSwipeEnd",function(){C.setState({swiping:!1})}),R(v(C),"onSwipeMove",function(I){var T=I.x;if(!C.state.itemSize||!C.itemsWrapperRef||!C.state.visibleItems)return!1;var x=0,$=e.Children.count(C.props.children),q=-(C.state.firstItem*100)/C.state.visibleItems,X=Math.max($-C.state.visibleItems,0),oe=-X*100/C.state.visibleItems;q===x&&T>0&&(T=0),q===oe&&T<0&&(T=0);var Q=C.itemsWrapperRef.clientWidth,J=q+100/(Q/T);return C.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(te){C.itemsListRef.style[te]=(0,r.default)(J,"%",C.props.axis)}),!0}),R(v(C),"slideRight",function(I){C.moveTo(C.state.firstItem-(typeof I=="number"?I:1))}),R(v(C),"slideLeft",function(I){C.moveTo(C.state.firstItem+(typeof I=="number"?I:1))}),R(v(C),"moveTo",function(I){I=I<0?0:I,I=I>=C.state.lastPosition?C.state.lastPosition:I,C.setState({firstItem:I})}),C.state={selectedItem:D.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},C}return h(F,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(C){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==C.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,o.default)().addEventListener("resize",this.updateSizes),(0,o.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,o.default)().removeEventListener("resize",this.updateSizes),(0,o.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(C){var I=C;return C>=this.state.lastPosition&&(I=this.state.lastPosition),C<this.state.firstItem+this.state.visibleItems&&(I=this.state.firstItem),C<this.state.firstItem&&(I=C),I}},{key:"renderItems",value:function(){var C=this;return this.props.children.map(function(I,T){var x=t.default.ITEM(!1,T===C.state.selectedItem),$={key:T,ref:function(X){return C.setThumbsRef(X,T)},className:x,onClick:C.handleClickItem.bind(C,T,C.props.children[T]),onKeyDown:C.handleClickItem.bind(C,T,C.props.children[T]),"aria-label":"".concat(C.props.labels.item," ").concat(T+1),style:{width:C.props.thumbWidth}};return e.default.createElement("li",c({},$,{role:"button",tabIndex:0}),I)})}},{key:"render",value:function(){var C=this;if(!this.props.children)return null;var I=e.Children.count(this.props.children)>1,T=this.state.showArrows&&this.state.firstItem>0,x=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,$={},q=-this.state.firstItem*(this.state.itemSize||0),X=(0,r.default)(q,"px",this.props.axis),oe=this.props.transitionTime+"ms";return $={WebkitTransform:X,MozTransform:X,MsTransform:X,OTransform:X,transform:X,msTransform:X,WebkitTransitionDuration:oe,MozTransitionDuration:oe,MsTransitionDuration:oe,OTransitionDuration:oe,transitionDuration:oe,msTransitionDuration:oe},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!T),onClick:function(){return C.slideRight()},"aria-label":this.props.labels.leftArrow}),I?e.default.createElement(i.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:$,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:$},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!x),onClick:function(){return C.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),F}(e.Component);return Li.default=_,R(_,"displayName","Thumbs"),R(_,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),Li}var Vi={},Wl;function zg(){if(Wl)return Vi;Wl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.default=void 0;var e=function(){return document};return Vi.default=e,Vi}var En={},Ul;function Gc(){if(Ul)return En;Ul=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e=so(),t=n(zs());function n(l){return l&&l.__esModule?l:{default:l}}var r=function(){};En.noop=r;var i=function(u,c){return"".concat(u," of ").concat(c)};En.defaultStatusFormatter=i;var o=function(u){return u?u.hasOwnProperty("key"):!1};En.isKeyboardEvent=o;var s=function(u,c){if(c.infiniteLoop&&++u,u===0)return 0;var f=e.Children.count(c.children);if(c.centerMode&&c.axis==="horizontal"){var g=-u*c.centerSlidePercentage,h=f-1;return u&&(u!==h||c.infiniteLoop)?g+=(100-c.centerSlidePercentage)/2:u===h&&(g+=100-c.centerSlidePercentage),g}return-u*100};En.getPosition=s;var a=function(u,c){var f={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){f[g]=(0,t.default)(u,"%",c)}),f};return En.setPosition=a,En}var Bn={},ql;function Vg(){if(ql)return Bn;ql=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.fadeAnimationHandler=Bn.slideStopSwipingHandler=Bn.slideSwipeAnimationHandler=Bn.slideAnimationHandler=void 0;var e=so(),t=r(zs()),n=Gc();function r(f){return f&&f.__esModule?f:{default:f}}function i(f,g){var h=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);g&&(m=m.filter(function(p){return Object.getOwnPropertyDescriptor(f,p).enumerable})),h.push.apply(h,m)}return h}function o(f){for(var g=1;g<arguments.length;g++){var h=arguments[g]!=null?arguments[g]:{};g%2?i(Object(h),!0).forEach(function(m){s(f,m,h[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):i(Object(h)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(h,m))})}return f}function s(f,g,h){return g in f?Object.defineProperty(f,g,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[g]=h,f}var a=function(g,h){var m={},p=h.selectedItem,w=p,b=e.Children.count(g.children)-1,v=g.infiniteLoop&&(p<0||p>b);if(v)return w<0?g.centerMode&&g.centerSlidePercentage&&g.axis==="horizontal"?m.itemListStyle=(0,n.setPosition)(-(b+2)*g.centerSlidePercentage-(100-g.centerSlidePercentage)/2,g.axis):m.itemListStyle=(0,n.setPosition)(-(b+2)*100,g.axis):w>b&&(m.itemListStyle=(0,n.setPosition)(0,g.axis)),m;var S=(0,n.getPosition)(p,g),O=(0,t.default)(S,"%",g.axis),R=g.transitionTime+"ms";return m.itemListStyle={WebkitTransform:O,msTransform:O,OTransform:O,transform:O},h.swiping||(m.itemListStyle=o(o({},m.itemListStyle),{},{WebkitTransitionDuration:R,MozTransitionDuration:R,OTransitionDuration:R,transitionDuration:R,msTransitionDuration:R})),m};Bn.slideAnimationHandler=a;var l=function(g,h,m,p){var w={},b=h.axis==="horizontal",v=e.Children.count(h.children),S=0,O=(0,n.getPosition)(m.selectedItem,h),R=h.infiniteLoop?(0,n.getPosition)(v-1,h)-100:(0,n.getPosition)(v-1,h),M=b?g.x:g.y,_=M;O===S&&M>0&&(_=0),O===R&&M<0&&(_=0);var E=O+100/(m.itemSize/_),k=Math.abs(M)>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}),w.itemListStyle=(0,n.setPosition)(E,h.axis)),k&&!m.cancelClick&&p({cancelClick:!0}),w};Bn.slideSwipeAnimationHandler=l;var u=function(g,h){var m=(0,n.getPosition)(h.selectedItem,g),p=(0,n.setPosition)(m,g.axis);return{itemListStyle:p}};Bn.slideStopSwipingHandler=u;var c=function(g,h){var m=g.transitionTime+"ms",p="ease-in-out",w={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||(w=o(o({},w),{},{WebkitTransitionDuration:m,MozTransitionDuration:m,OTransitionDuration:m,transitionDuration:m,msTransitionDuration:m})),{slideStyle:w,selectedStyle:o(o({},w),{},{opacity:1,position:"relative"}),prevStyle:o({},w)}};return Bn.fadeAnimationHandler=c,Bn}var Gl;function Ng(){if(Gl)return _i;Gl=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.default=void 0;var e=c(so()),t=l(Bc()),n=l(Wc()),r=l(qc()),i=l(zg()),o=l(Uc()),s=Gc(),a=Vg();function l(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||f(D)!=="object"&&typeof D!="function")return{default:D};var C=u();if(C&&C.has(D))return C.get(D);var I={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in D)if(Object.prototype.hasOwnProperty.call(D,x)){var $=T?Object.getOwnPropertyDescriptor(D,x):null;$&&($.get||$.set)?Object.defineProperty(I,x,$):I[x]=D[x]}return I.default=D,C&&C.set(D,I),I}function f(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?f=function(I){return typeof I}:f=function(I){return I&&typeof Symbol=="function"&&I.constructor===Symbol&&I!==Symbol.prototype?"symbol":typeof I},f(D)}function g(){return g=Object.assign||function(D){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var T in I)Object.prototype.hasOwnProperty.call(I,T)&&(D[T]=I[T])}return D},g.apply(this,arguments)}function h(D,C){var I=Object.keys(D);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(D);C&&(T=T.filter(function(x){return Object.getOwnPropertyDescriptor(D,x).enumerable})),I.push.apply(I,T)}return I}function m(D){for(var C=1;C<arguments.length;C++){var I=arguments[C]!=null?arguments[C]:{};C%2?h(Object(I),!0).forEach(function(T){k(D,T,I[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(I)):h(Object(I)).forEach(function(T){Object.defineProperty(D,T,Object.getOwnPropertyDescriptor(I,T))})}return D}function p(D,C){if(!(D instanceof C))throw new TypeError("Cannot call a class as a function")}function w(D,C){for(var I=0;I<C.length;I++){var T=C[I];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(D,T.key,T)}}function b(D,C,I){return C&&w(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&&S(D,C)}function S(D,C){return S=Object.setPrototypeOf||function(T,x){return T.__proto__=x,T},S(D,C)}function O(D){var C=_();return function(){var T=E(D),x;if(C){var $=E(this).constructor;x=Reflect.construct(T,arguments,$)}else x=T.apply(this,arguments);return R(this,x)}}function R(D,C){return C&&(f(C)==="object"||typeof C=="function")?C:M(D)}function M(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function _(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function E(D){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(I){return I.__proto__||Object.getPrototypeOf(I)},E(D)}function k(D,C,I){return C in D?Object.defineProperty(D,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[C]=I,D}var F=function(D){v(I,D);var C=O(I);function I(T){var x;p(this,I),x=C.call(this,T),k(M(x),"thumbsRef",void 0),k(M(x),"carouselWrapperRef",void 0),k(M(x),"listRef",void 0),k(M(x),"itemsRef",void 0),k(M(x),"timer",void 0),k(M(x),"animationHandler",void 0),k(M(x),"setThumbsRef",function(q){x.thumbsRef=q}),k(M(x),"setCarouselWrapperRef",function(q){x.carouselWrapperRef=q}),k(M(x),"setListRef",function(q){x.listRef=q}),k(M(x),"setItemsRef",function(q,X){x.itemsRef||(x.itemsRef=[]),x.itemsRef[X]=q}),k(M(x),"autoPlay",function(){e.Children.count(x.props.children)<=1||(x.clearAutoPlay(),x.props.autoPlay&&(x.timer=setTimeout(function(){x.increment()},x.props.interval)))}),k(M(x),"clearAutoPlay",function(){x.timer&&clearTimeout(x.timer)}),k(M(x),"resetAutoPlay",function(){x.clearAutoPlay(),x.autoPlay()}),k(M(x),"stopOnHover",function(){x.setState({isMouseEntered:!0},x.clearAutoPlay)}),k(M(x),"startOnLeave",function(){x.setState({isMouseEntered:!1},x.autoPlay)}),k(M(x),"isFocusWithinTheCarousel",function(){return x.carouselWrapperRef?!!((0,i.default)().activeElement===x.carouselWrapperRef||x.carouselWrapperRef.contains((0,i.default)().activeElement)):!1}),k(M(x),"navigateWithKeyboard",function(q){if(x.isFocusWithinTheCarousel()){var X=x.props.axis,oe=X==="horizontal",Q={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},J=oe?Q.ArrowRight:Q.ArrowDown,te=oe?Q.ArrowLeft:Q.ArrowUp;J===q.keyCode?x.increment():te===q.keyCode&&x.decrement()}}),k(M(x),"updateSizes",function(){if(!(!x.state.initialized||!x.itemsRef||x.itemsRef.length===0)){var q=x.props.axis==="horizontal",X=x.itemsRef[0];if(X){var oe=q?X.clientWidth:X.clientHeight;x.setState({itemSize:oe}),x.thumbsRef&&x.thumbsRef.updateSizes()}}}),k(M(x),"setMountState",function(){x.setState({hasMount:!0}),x.updateSizes()}),k(M(x),"handleClickItem",function(q,X){if(e.Children.count(x.props.children)!==0){if(x.state.cancelClick){x.setState({cancelClick:!1});return}x.props.onClickItem(q,X),q!==x.state.selectedItem&&x.setState({selectedItem:q})}}),k(M(x),"handleOnChange",function(q,X){e.Children.count(x.props.children)<=1||x.props.onChange(q,X)}),k(M(x),"handleClickThumb",function(q,X){x.props.onClickThumb(q,X),x.moveTo(q)}),k(M(x),"onSwipeStart",function(q){x.setState({swiping:!0}),x.props.onSwipeStart(q)}),k(M(x),"onSwipeEnd",function(q){x.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),x.props.onSwipeEnd(q),x.clearAutoPlay(),x.state.autoPlay&&x.autoPlay()}),k(M(x),"onSwipeMove",function(q,X){x.props.onSwipeMove(X);var oe=x.props.swipeAnimationHandler(q,x.props,x.state,x.setState.bind(M(x)));return x.setState(m({},oe)),!!Object.keys(oe).length}),k(M(x),"decrement",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem-(typeof q=="number"?q:1))}),k(M(x),"increment",function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;x.moveTo(x.state.selectedItem+(typeof q=="number"?q:1))}),k(M(x),"moveTo",function(q){if(typeof q=="number"){var X=e.Children.count(x.props.children)-1;q<0&&(q=x.props.infiniteLoop?X:0),q>X&&(q=x.props.infiniteLoop?0:X),x.selectItem({selectedItem:q}),x.state.autoPlay&&x.state.isMouseEntered===!1&&x.resetAutoPlay()}}),k(M(x),"onClickNext",function(){x.increment(1)}),k(M(x),"onClickPrev",function(){x.decrement(1)}),k(M(x),"onSwipeForward",function(){x.increment(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"onSwipeBackwards",function(){x.decrement(1),x.props.emulateTouch&&x.setState({cancelClick:!0})}),k(M(x),"changeItem",function(q){return function(X){(!(0,s.isKeyboardEvent)(X)||X.key==="Enter")&&x.moveTo(q)}}),k(M(x),"selectItem",function(q){x.setState(m({previousItem:x.state.selectedItem},q),function(){x.setState(x.animationHandler(x.props,x.state))}),x.handleOnChange(q.selectedItem,e.Children.toArray(x.props.children)[q.selectedItem])}),k(M(x),"getInitialImage",function(){var q=x.props.selectedItem,X=x.itemsRef&&x.itemsRef[q],oe=X&&X.getElementsByTagName("img")||[];return oe[0]}),k(M(x),"getVariableItemHeight",function(q){var X=x.itemsRef&&x.itemsRef[q];if(x.state.hasMount&&X&&X.children.length){var oe=X.children[0].getElementsByTagName("img")||[];if(oe.length>0){var Q=oe[0];if(!Q.complete){var J=function le(){x.forceUpdate(),Q.removeEventListener("load",le)};Q.addEventListener("load",J)}}var te=oe[0]||X.children[0],ae=te.clientHeight;return ae>0?ae:null}return null});var $={initialized:!1,previousItem:T.selectedItem,selectedItem:T.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:T.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return x.animationHandler=typeof T.animationHandler=="function"&&T.animationHandler||T.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,x.state=m(m({},$),x.animationHandler(T,$)),x}return b(I,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(x,$){!x.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!x.autoFocus&&this.props.autoFocus&&this.forceFocus(),$.swiping&&!this.state.swiping&&this.setState(m({},this.props.stopSwipingHandler(this.props,this.state))),(x.selectedItem!==this.props.selectedItem||x.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),x.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 x=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 $=x.getInitialImage();$&&!$.complete?$.addEventListener("load",x.setMountState):x.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.addEventListener("mouseenter",this.stopOnHover),x.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var x=this.carouselWrapperRef;this.props.stopOnHover&&x&&(x.removeEventListener("mouseenter",this.stopOnHover),x.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 x=this.getInitialImage();x&&x.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,i.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var x;(x=this.carouselWrapperRef)===null||x===void 0||x.focus()}},{key:"renderItems",value:function(x){var $=this;return this.props.children?e.Children.map(this.props.children,function(q,X){var oe=X===$.state.selectedItem,Q=X===$.state.previousItem,J=oe&&$.state.selectedStyle||Q&&$.state.prevStyle||$.state.slideStyle||{};$.props.centerMode&&$.props.axis==="horizontal"&&(J=m(m({},J),{},{minWidth:$.props.centerSlidePercentage+"%"})),$.state.swiping&&$.state.swipeMovementStarted&&(J=m(m({},J),{},{pointerEvents:"none"}));var te={ref:function(le){return $.setItemsRef(le,X)},key:"itemKey"+X+(x?"clone":""),className:n.default.ITEM(!0,X===$.state.selectedItem,X===$.state.previousItem),onClick:$.handleClickItem.bind($,X,q),style:J};return e.default.createElement("li",te,$.props.renderItem(q,{isSelected:X===$.state.selectedItem,isPrevious:X===$.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var x=this,$=this.props,q=$.showIndicators,X=$.labels,oe=$.renderIndicator,Q=$.children;return q?e.default.createElement("ul",{className:"control-dots"},e.Children.map(Q,function(J,te){return oe&&oe(x.changeItem(te),te===x.state.selectedItem,te,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 x=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var $=this.props.swipeable&&e.Children.count(this.props.children)>1,q=this.props.axis==="horizontal",X=this.props.showArrows&&e.Children.count(this.props.children)>1,oe=X&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,Q=X&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,J=this.renderItems(!0),te=J.shift(),ae=J.pop(),le={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},fe={};if(q){if(le.onSwipeLeft=this.onSwipeForward,le.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var re=this.getVariableItemHeight(this.state.selectedItem);fe.height=re||"auto"}}else le.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,le.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,le.style=m(m({},le.style),{},{height:this.state.itemSize}),fe.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,oe,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:fe},$?e.default.createElement(t.default,g({tagName:"ul",innerRef:this.setListRef},le,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&te):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(P){return x.setListRef(P)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&ae,this.renderItems(),this.props.infiniteLoop&&te)),this.props.renderArrowNext(this.onClickNext,Q,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),I}(e.default.Component);return _i.default=F,k(F,"displayName","Carousel"),k(F,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:s.noop,onClickThumb:s.noop,onChange:s.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_PREV(!I),onClick:C})},renderArrowNext:function(C,I,T){return e.default.createElement("button",{type:"button","aria-label":T,className:n.default.ARROW_NEXT(!I),onClick:C})},renderIndicator:function(C,I,T,x){return e.default.createElement("li",{className:n.default.DOT(I),onClick:C,onKeyDown:C,value:T,key:T,role:"button",tabIndex:0,"aria-label":"".concat(x," ").concat(T+1)})},renderItem:function(C){return C},renderThumbs:function(C){var I=e.Children.map(C,function(T){var x=T;if(T.type!=="img"&&(x=e.Children.toArray(T.props.children).find(function($){return $.type==="img"})),!!x)return x});return I.filter(function(T){return T}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):I},statusFormatter:s.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}),_i}var Yl={},Xl;function $g(){return Xl||(Xl=1),Yl}var jl;function Bg(){return jl||(jl=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(Ng()),n=$g(),r=i(qc());function i(o){return o&&o.__esModule?o:{default:o}}}(Ga)),Ga}var Wg=Bg(),Ya,Kl;function Ug(){if(Kl)return Ya;Kl=1;var e=lh(),t=function(){return e.Date.now()};return Ya=t,Ya}var Xa,Zl;function Yc(){if(Zl)return Xa;Zl=1;var e=kc(),t=Ug(),n=Mc(),r="Expected a function",i=Math.max,o=Math.min;function s(a,l,u){var c,f,g,h,m,p,w=0,b=!1,v=!1,S=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(u)&&(b=!!u.leading,v="maxWait"in u,g=v?i(n(u.maxWait)||0,l):g,S="trailing"in u?!!u.trailing:S);function O(I){var T=c,x=f;return c=f=void 0,w=I,h=a.apply(x,T),h}function R(I){return w=I,m=setTimeout(E,l),b?O(I):h}function M(I){var T=I-p,x=I-w,$=l-T;return v?o($,g-x):$}function _(I){var T=I-p,x=I-w;return p===void 0||T>=l||T<0||v&&x>=g}function E(){var I=t();if(_(I))return k(I);m=setTimeout(E,M(I))}function k(I){return m=void 0,S&&c?O(I):(c=f=void 0,h)}function F(){m!==void 0&&clearTimeout(m),w=0,c=p=f=m=void 0}function D(){return m===void 0?h:k(t())}function C(){var I=t(),T=_(I);if(c=arguments,f=this,p=I,T){if(m===void 0)return R(p);if(v)return clearTimeout(m),m=setTimeout(E,l),O(p)}return m===void 0&&(m=setTimeout(E,l)),h}return C.cancel=F,C.flush=D,C}return Xa=s,Xa}var qg=Yc();const Xc=ar(qg);function dn(e,t,n,r,i=!1){const o=d.useRef();o.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const s=n,a=l=>{o.current?.call(s,l)};return s.addEventListener(e,a,{passive:r,capture:i}),()=>{s.removeEventListener(e,a,{capture:i})}},[e,n,r,i])}function br(e,t){return e===void 0?void 0:t}const Gg=Math.PI;function Jl(e){return e*Gg/180}const jc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Kc=(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}},Zc=(e,t,n)=>Math.min(e,t-n*2),Jc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Vs=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.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"}),d.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"}))},Yg=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function Xg(e,t,n){const[r,i]=d.useState(e),o=d.useRef(!0);d.useEffect(()=>()=>{o.current=!1},[]);const s=d.useRef(Xc(a=>{o.current&&i(a)},n));return d.useLayoutEffect(()=>{o.current&&s.current(()=>e())},t),r}const jg="֑-߿יִ-﷽ﹰ-ﻼ",Kg="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Zg=new RegExp("^[^"+Kg+"]*["+jg+"]");function Ns(e){return Zg.test(e)?"rtl":"not-rtl"}let Lo;function ws(){if(typeof document>"u")return 0;if(Lo!==void 0)return Lo;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(),Lo=n-r,Lo}const Ar=Symbol();function Jg(e){const t=d.useRef([Ar,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,i]=d.useState(),o=d.useCallback(a=>{const l=t.current[0];l!==Ar&&(a=typeof a=="function"?a(l):a,a===l)||(l!==Ar&&i({}),r(u=>typeof a=="function"?a(l===Ar?u:l):a),t.current[0]=Ar)},[]),s=d.useCallback(()=>{t.current[0]=Ar,i({})},[]);return[t.current[0]===Ar?n:t.current[0],o,s]}function Qc(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 Qg(e){const t=d.useRef(e);return hi(e,t.current)||(t.current=e),t.current}const em=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:i}=e,o=t.filter(a=>a!=="");if(o.length===0)return null;const s=o.length>1;return d.createElement(Lg,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(Wg.Carousel,{showArrows:s,showThumbs:!1,swipeable:s,emulateTouch:s,infiniteLoop:s},o.map(a=>{const l=i?.(a)??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},l)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Vs,null)))};function ed(){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 Br=ed();function tm(e){Br=e}const td=/[&<>"']/,nm=new RegExp(td.source,"g"),nd=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,rm=new RegExp(nd.source,"g"),im={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql=e=>im[e];function vn(e,t){if(t){if(td.test(e))return e.replace(nm,Ql)}else if(nd.test(e))return e.replace(rm,Ql);return e}const om=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function rd(e){return e.replace(om,(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 am=/(^|[^\[])\^/g;function Ht(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,i)=>(i=i.source||i,i=i.replace(am,"$1"),e=e.replace(r,i),n),getRegex:()=>new RegExp(e,t)};return n}const sm=/[^\w:]/g,lm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function eu(e,t,n){if(e){let r;try{r=decodeURIComponent(rd(n)).replace(sm,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!lm.test(n)&&(n=fm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Ao={},um=/^[^:]+:\/*[^/]*$/,cm=/^([^:]+:)[\s\S]*$/,dm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function fm(e,t){Ao[" "+e]||(um.test(e)?Ao[" "+e]=e+"/":Ao[" "+e]=jo(e,"/",!0)),e=Ao[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(cm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(dm,"$1")+t:e+t}const na={exec:function(){}};function tu(e,t){const n=e.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),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 hm(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 gm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function nu(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function ru(e,t,n,r){const i=t.href,o=t.title?vn(t.title):null,s=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:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:i,title:o,text:vn(s)}}function mm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
3
3
|
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[s]=o;return s.length>=r.length?i.slice(r.length):i}).join(`
|
4
4
|
`)}class $s{constructor(t){this.options=t||Br}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
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],i=mm(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,s,a,l,u,c,f,g,h,m,p=n[1].trim();const w=p.length>1,b={type:"list",raw:"",ordered:w,start:w?+p.slice(0,-1):"",loose:!1,items:[]};p=w?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=w?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(`
|
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
169
169
|
`?(r.push(e.slice(i,s)),i=s+1,a===`
|
170
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
171
|
`)&&(r.push(Iu(e.slice(i,s))),i=s+1,a===`
|
172
|
-
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Iu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Tu(e,t,n){const r=L0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Od(e){return e!==!0}function Du(e){return typeof e=="string"?e:`${e}px`}const z0=()=>e=>e.innerWidth,V0=()=>e=>e.innerHeight,N0=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[z0()],"wmyidgi-1":[V0()]}}),$0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(N0,{innerHeight:Du(n),innerWidth:Du(t),...i},r)},B0=2,W0=1300;function U0(e,t,n){const r=Nt.useRef(0),[i,o]=e??[0,0];Nt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/W0);const f=r.current**1.618*c*B0;t.current?.scrollBy(i*f,o*f),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,f,g,h]=Nt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,w=pd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const vr={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 ot(e,t){return e===!0?t:e===!1?"":e}function Ou(e){const t=oa.value;return{activateCell:ot(e.activateCell," |Enter|shift+Enter"),clear:ot(e.clear,"any+Escape"),closeOverlay:ot(e.closeOverlay,"any+Escape"),acceptOverlayDown:ot(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ot(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ot(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ot(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ot(e.delete,t?"Backspace|Delete":"Delete"),downFill:ot(e.downFill,"primary+_68"),scrollToSelectedCell:ot(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ot(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ot(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ot(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ot(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ot(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ot(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ot(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ot(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ot(e.goToFirstCell,"primary+Home"),goToFirstColumn:ot(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ot(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ot(e.goToLastCell,"primary+End"),goToLastColumn:ot(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ot(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ot(e.goToNextPage,"PageDown"),goToPreviousPage:ot(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ot(e.rightFill,"primary+_82"),search:ot(e.search,"primary+f"),selectAll:ot(e.selectAll,"primary+a"),selectColumn:ot(e.selectColumn,"ctrl+ "),selectGrowDown:ot(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ot(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ot(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ot(e.selectGrowUp,"shift+ArrowUp"),selectRow:ot(e.selectRow,"shift+ "),selectToFirstCell:ot(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ot(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ot(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ot(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ot(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ot(e.selectToLastRow,"primary+shift+ArrowDown")}}function G0(e){const t=Qg(e);return Nt.useMemo(()=>{if(t===void 0)return Ou(vr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??vr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??vr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??vr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??vr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??vr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??vr.selectToLastCell};return Ou({...vr,...n})},[t])}function Y0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Ks(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-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 f=0;f<a.subGroups.length;f++){const g=f<a.subGroups.length-1?a.subGroups[f+1].headerIndex:l;r(a.subGroups[f],g,u||a.isCollapsed)}}const i=Y0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Rs(e,t){if(t===void 0||Ks.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 X0(e,t,n,r){const i=Nt.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]),o=Nt.useMemo(()=>i?.reduce((c,f)=>(c[f.rowIndex]=f,c),{}),[i]),s=Nt.useMemo(()=>i===void 0?t:i.reduce((c,f)=>c+(f.isCollapsed?1:f.rows+1),0),[i,t]),a=Nt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Nt.useCallback(c=>{if(i===void 0)return c;let f=c;for(const g of i){if(f===0)return;if(f--,!g.isCollapsed){if(f<g.rows)return g.contentIndex+f;f-=g.rows}}return c},[i]),u=br(r??e?.themeOverride,Nt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:f,contentIndex:g,groupIndex:h}=Rs(c,i);return f?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function j0(e,t){const n=Nt.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]);return{getRowGroupingForPath:_d,updateRowGroupingByPath:Pd,mapper:Nt.useCallback(r=>{if(typeof r=="number")return Rs(r,n);const i=Rs(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Pd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Pd(o.subGroups??[],i,n)}:o)}function _d(e,t){const[n,...r]=t;return r[0]===-1?e[n]:_d(e[n].subGroups??[],r)}function K0(e,t){const[n]=d.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 Z0(e,t,n,r,i){const[o,s]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=Jg(a),f=d.useRef(i);f.current=i;const g=K0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const m=(l.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),f.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const J0=d.lazy(async()=>await _s(()=>import("./data-grid-overlay-editor.DispNmCy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let Q0=0;function ev(e){return np(vu(vu(e).filter(t=>t.span!==void 0).map(t=>Cr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function zo(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 Vo={kind:Z.Loading,allowOverlay:!1},No={columns:rt.empty(),rows:rt.empty(),current:void 0},tv=(e,t)=>{const[n,r]=d.useState(No),[i,o]=d.useState(),s=d.useRef(null),a=d.useRef(null),[l,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:w,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:$,onCellContextMenu:q,className:X,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:te,onCellEdited:ae,onCellsEdited:le,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:G,onKeyUp:ue,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnMoved:et,validateCell:Re,highlightRegions:Xe,rangeSelect:yt="rect",columnSelect:De="multi",rowSelect:ne="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:xe="exclusive",rowSelectionBlending:ce="exclusive",onDelete:pe,onDragStart:ze,onMouseMove:Ie,onPaste:tt,copyHeaders:Te=!1,freezeColumns:Oe=0,cellActivationBehavior:Je="second-click",rowSelectionMode:ye="auto",onHeaderMenuClick:qe,onHeaderIndicatorClick:pt,getGroupDetails:ft,rowGrouping:We,onSearchClose:xt,onItemHovered:qt,onSelectionCleared:Tt,showSearch:_t,onVisibleRegionChanged:tn,gridSelection:zt,onGridSelectionChange:Sn,minColumnWidth:Vt=50,maxColumnWidth:ut=500,maxColumnAutoWidth:nn,provideEditor:Ct,trailingRowOptions:Ft,freezeTrailingRows:Yt=0,allowedFillDirections:je="orthogonal",scrollOffsetX:Dt,scrollOffsetY:Ot,verticalBorder:ln,onDragOverCell:rn,onDrop:hn,onColumnResize:bn,onColumnResizeEnd:Xt,onColumnResizeStart:Jt,customRenderers:Ge,fillHandle:Et,experimental:Qt,fixedShadowX:Lt,fixedShadowY:At,headerIcons:xn,imageWindowLoader:Un,initialSize:Hn,isDraggable:N,onDragLeave:Be,onRowMoved:Pe,overscrollX:Pt,overscrollY:wn,preventDiagonalScrolling:ge,rightElement:bt,rightElementProps:en,trapFocus:kt=!1,smoothScrollX:Bt,smoothScrollY:an,scaleToRem:Sa=!1,rowHeight:co=34,headerHeight:fo=36,groupHeaderHeight:xa=fo,theme:Mr,isOutsideClick:lr,renderers:pi,resizeIndicator:ka,scrollToActiveCell:vi=!0,drawFocusRing:bi=!0}=e,Rr=bi==="no-editor"?i===void 0:bi,Jn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=Jn?.kind??e.rowMarkers??"none",wi=Jn?.width??e.rowMarkerWidth,yi=Jn?.startIndex??e.rowMarkerStartIndex??1,Gr=Jn?.theme??e.rowMarkerTheme,Qn=Jn?.headerTheme,er=Jn?.headerAlwaysVisible,Er=ne!=="multi"||Jn?.headerDisabled===!0,qn=Jn?.checkboxStyle??"square",Gn=Math.max(Vt,20),Ir=Math.max(ut,Gn),ho=Math.max(nn??Ir,Gn),Ci=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ve,rowNumberMapper:go,rowHeight:mo,getRowThemeOverride:ur}=X0(We,v,co,h),po=d.useMemo(()=>Number.parseFloat(Ci.fontSize),[Ci]),{rowHeight:zn,headerHeight:Si,groupHeaderHeight:vo,theme:bo,overscrollX:Ma,overscrollY:Ra}=q0({groupHeaderHeight:xa,headerHeight:fo,overscrollX:Pt,overscrollY:wn,remSize:po,rowHeight:mo,scaleToRem:Sa,theme:Mr}),On=G0(he),cr=wi??(v>1e4?48:v>1e3?44:v>100?36:32),Pn=kn!=="none",B=Pn?1:0,Wt=Se!==void 0,dr=Ft?.sticky===!0,[Yr,Xr]=d.useState(!1),xi=_t??Yr,Ea=d.useCallback(()=>{xt!==void 0?xt():Xr(!1)},[xt]),K=d.useMemo(()=>zt===void 0?void 0:zo(zt,B),[zt,B])??n,un=d.useRef();un.current===void 0&&(un.current=new AbortController),d.useEffect(()=>()=>un?.current.abort(),[]);const[on,Ia]=T0(Q,S,B,un.current,Ve),V=d.useCallback((y,A,L)=>{if(Re===void 0)return!0;const U=[y[0]-B,y[1]];return Re?.(U,A,L)},[B,Re]),ie=d.useRef(zt),me=d.useCallback((y,A)=>{A&&(y=A0(y,on,B,x,un.current)),Sn!==void 0?(ie.current=zo(y,-B),Sn(ie.current)):r(y)},[Sn,on,B,x]),Me=br(bn,d.useCallback((y,A,L,U)=>{bn?.(b[L-B],A,L-B,U)},[bn,B,b])),de=br(Xt,d.useCallback((y,A,L,U)=>{Xt?.(b[L-B],A,L-B,U)},[Xt,B,b])),be=br(Jt,d.useCallback((y,A,L,U)=>{Jt?.(b[L-B],A,L-B,U)},[Jt,B,b])),Ye=br(k,d.useCallback((y,A)=>k?.({...y,columnIndex:y.columnIndex-B},A)??!1,[k,B])),we=br(F,d.useCallback((y,A)=>F?.({...y,col:y.col-B},A)??!1,[F,B])),Ue=d.useCallback(y=>{if(pe!==void 0){const A=pe(zo(y,-B));return typeof A=="boolean"?A:zo(A,B)}return!0},[pe,B]),[Fe,St,lt]=I0(K,me,Ee,xe,ce,yt,T),at=d.useMemo(()=>ir(pd(),bo),[bo]),[dt,Gt]=d.useState([0,0,0]),gn=d.useMemo(()=>{if(pi===void 0)return{};const y={};for(const A of pi)y[A.kind]=A;return y},[pi]),ct=d.useCallback(y=>y.kind!==Z.Custom?gn[y.kind]:Ge?.find(A=>A.isMatch(y)),[Ge,gn]);let{sizedColumns:sn,nonGrowWidth:Tr}=Ym(b,Ve,Ia,dt[0]-(B===0?0:cr)-dt[2],Gn,ho,at,ct,un.current);kn!=="none"&&(Tr+=cr);const tr=d.useMemo(()=>sn.some(y=>y.group!==void 0),[sn]),Rt=tr?Si+vo:Si,Vn=K.rows.length,Mn=kn==="none"?void 0:Vn===0?!1:Vn===Ve?!0:void 0,mt=d.useMemo(()=>kn==="none"?sn:[{title:"",width:cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Gr,rowMarker:qn,rowMarkerChecked:Mn,headerRowMarkerTheme:Qn,headerRowMarkerAlwaysVisible:er,headerRowMarkerDisabled:Er},...sn],[kn,sn,cr,Gr,qn,Mn,Qn,er,Er]),jt=d.useRef({height:1,width:1,x:0,y:0}),fr=d.useRef(!1),{setVisibleRegion:hr,visibleRegion:Dr,scrollRef:Ut}=Z0(Dt,Ot,zn,jt,()=>fr.current=!0);jt.current=Dr;const If=Dr.x+B,wo=Dr.y,mn=d.useRef(null),yn=d.useCallback(y=>{y===!0?mn.current?.focus():window.requestAnimationFrame(()=>{mn.current?.focus()})},[]),pn=Wt?Ve+1:Ve,_n=d.useCallback(y=>{const A=B===0?y:y.map(U=>({...U,location:[U.location[0]-B,U.location[1]]})),L=le?.(A);if(L!==!0)for(const U of A)ae?.(U.location,U.value);return L},[ae,le,B]),[Or,Ta]=d.useState(),yo=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,hl=Rr?K.current?.cell:void 0,Co=hl?.[0],So=hl?.[1],Tf=d.useMemo(()=>{if((Xe===void 0||Xe.length===0)&&(yo??Co??So??Or)===void 0)return;const y=[];if(Xe!==void 0)for(const A of Xe){const L=mt.length-A.range.x-B;L>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+B,width:Math.min(L,A.range.width)},style:A.style})}return Or!==void 0&&y.push({color:Nr(at.accentColor,0),range:Or,style:"dashed"}),yo!==void 0&&y.push({color:Nr(at.accentColor,.5),range:yo,style:"solid-outline"}),Co!==void 0&&So!==void 0&&y.push({color:at.accentColor,range:{x:Co,y:So,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Or,yo,Co,So,Xe,mt.length,at.accentColor,B]),gl=d.useRef(mt);gl.current=mt;const Rn=d.useCallback(([y,A],L=!1)=>{const U=Wt&&A===pn-1;if(y===0&&Pn){if(U)return Vo;const j=go(A);return j===void 0?Vo:{kind:An.Marker,allowOverlay:!1,checkboxStyle:qn,checked:K?.rows.hasIndex(A)===!0,markerKind:kn==="clickable-number"?"number":kn,row:yi+j,drawHandle:Pe!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(U){const z=y===B?Ft?.hint??"":"",W=gl.current[y];if(W?.trailingRowOptions?.disabled===!0)return Vo;{const ee=W?.trailingRowOptions?.hint??z,se=W?.trailingRowOptions?.addIcon??Ft?.addIcon;return{kind:An.NewRow,hint:ee,allowOverlay:!1,icon:se}}}else{const j=y-B;if(L||Qt?.strict===!0){const W=jt.current,ee=W.x>j||j>W.x+W.width||W.y>A||A>W.y+W.height||A>=Oa.current,se=j===W.extras?.selected?.[0]&&A===W.extras?.selected[1];let ve=!1;if(W.extras?.freezeRegions!==void 0){for(const wt of W.extras.freezeRegions)if(Vr(wt,j,A)){ve=!0;break}}if(ee&&!se&&!ve)return Vo}let z=S([j,A]);return B!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+B,z.span[1]+B]}),z}},[Wt,pn,Pn,go,qn,K?.rows,kn,yi,Pe,B,Ft?.hint,Ft?.addIcon,Qt?.strict,S]),Da=d.useCallback(y=>{let A=ft?.(y)??{name:y};return te!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>_a({group:A.name,bounds:L.bounds})}]}),A},[ft,te]),xo=d.useCallback(y=>{const[A,L]=y.cell,U=mt[A],Y=U?.group!==void 0?Da(U.group)?.overrideTheme:void 0,j=U?.themeOverride,z=ur?.(L);o({...y,theme:ir(at,Y,j,z,y.content.themeOverride)})},[ur,mt,Da,at]),jr=d.useCallback((y,A,L)=>{if(K.current===void 0)return;const[U,Y]=K.current.cell,j=Rn([U,Y]);if(j.kind!==Z.Boolean&&j.allowOverlay){let z=j;if(L!==void 0)switch(z.kind){case Z.Number:{const W=Rg(()=>L==="-"?-0:Number.parseFloat(L),0);z={...z,data:Number.isNaN(W)?0:W};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:L};break}xo({target:y,content:z,initialValue:L,cell:[U,Y],highlight:L===void 0,forceEditMode:L!==void 0})}else j.kind===Z.Boolean&&A&&j.readonly!==!0&&(_n([{location:K.current.cell,value:{...j,data:Od(j.data)}}]),mn.current?.damage([{cell:K.current.cell}]))},[Rn,K,_n,xo]),ml=d.useCallback((y,A)=>{const L=mn.current?.getBounds(y,A);if(L===void 0||Ut.current===null)return;const U=Rn([y,A]);U.allowOverlay&&xo({target:L,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[Rn,Ut,xo]),Zt=d.useCallback((y,A,L="both",U=0,Y=0,j=void 0)=>{if(Ut.current!==null){const z=mn.current,W=a.current,ee=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,se=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ve=typeof y!="number"&&y.unit==="px"?y.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&W!==null){let nt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((ee!==void 0||se!==void 0)&&(nt=z.getBounds((ee??0)+B,se??0)??nt,nt.width===0||nt.height===0))return;const ht=W.getBoundingClientRect(),Mt=ht.width/W.offsetWidth;if(ve!==void 0&&(nt={...nt,x:ve-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(nt={...nt,y:wt+ht.top-Ut.current.scrollTop,height:1}),nt!==void 0){const vt={x:nt.x-U,y:nt.y-Y,width:nt.width+2*U,height:nt.height+2*Y};let ti=0;for(let Na=0;Na<Oe;Na++)ti+=sn[Na].width;let Oi=0;const Pi=Yt+(dr?1:0);Pi>0&&(Oi=Ur(pn,Pi,zn));let Xn=ti*Mt+ht.left+B*cr*Mt,ni=ht.right,Lr=ht.top+Rt*Mt,ri=ht.bottom-Oi*Mt;const Do=nt.width+U*2;switch(j?.hAlign){case"start":ni=Xn+Do;break;case"end":Xn=ni-Do;break;case"center":Xn=Math.floor((Xn+ni)/2)-Do/2,ni=Xn+Do;break}const Oo=nt.height+Y*2;switch(j?.vAlign){case"start":ri=Lr+Oo;break;case"end":Lr=ri-Oo;break;case"center":Lr=Math.floor((Lr+ri)/2)-Oo/2,ri=Lr+Oo;break}Xn>vt.x?Ke=vt.x-Xn:ni<vt.x+vt.width&&(Ke=vt.x+vt.width-ni),Lr>vt.y?Ze=vt.y-Lr:ri<vt.y+vt.height&&(Ze=vt.y+vt.height-ri),L==="vertical"||typeof y=="number"&&y<Oe?Ke=0:(L==="horizontal"||typeof A=="number"&&A>=pn-Pi)&&(Ze=0),(Ke!==0||Ze!==0)&&(Mt!==1&&(Ke/=Mt,Ze/=Mt),Ut.current.scrollTo({left:Ke+Ut.current.scrollLeft,top:Ze+Ut.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[B,Yt,cr,Ut,Rt,Oe,sn,pn,dr,zn]),pl=d.useRef(ml),vl=d.useRef(S),Oa=d.useRef(Ve);pl.current=ml,vl.current=S,Oa.current=Ve;const Kr=d.useCallback(async(y,A=!0,L)=>{if(mt[y]?.trailingRowOptions?.disabled===!0)return;const Y=Se?.();let j,z=!0;Y!==void 0&&(j=await Y,j==="top"&&(z=!1),typeof j=="number"&&(z=!1));let W=0;const ee=()=>{if(Oa.current<=Ve){W<500&&window.setTimeout(ee,W),W=50+W*2;return}const se=typeof j=="number"?j:z?Ve:0;To.current(y-B,se,"both",0,0,L?{behavior:L}:void 0),Fe({cell:[y,se],range:{x:y,y:se,width:1,height:1}},!1,!1,"edit");const ve=vl.current([y-B,se]);ve.allowOverlay&&Yi(ve)&&ve.readonly!==!0&&A&&window.setTimeout(()=>{pl.current(y,se)},0)};ee()},[mt,Se,B,Ve,Fe]),ko=d.useCallback(y=>{const A=sn[y]?.trailingRowOptions?.targetColumn??Ft?.targetColumn;if(typeof A=="number")return A+(Pn?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(Pn?1:0)}},[sn,b,Pn,Ft?.targetColumn]),gr=d.useRef(),Zr=d.useRef(),Mi=d.useCallback((y,A)=>{const[L,U]=A;return ir(at,mt[L]?.themeOverride,ur?.(U),y.themeOverride)},[ur,mt,at]),{mapper:Pr}=j0(We,v),Nn=We?.navigationBehavior,Ri=d.useCallback(y=>{const A=oa.value?y.metaKey:y.ctrlKey,L=A&&ne==="multi",U=A&&De==="multi",[Y,j]=y.location,z=K.columns,W=K.rows,[ee,se]=K.current?.cell??[];if(y.kind==="cell"){if(Zr.current=void 0,_r.current=[Y,j],Y===0&&Pn){if(Wt===!0&&j===Ve||kn==="number"||ne==="none")return;const ve=Rn(y.location);if(ve.kind!==An.Marker)return;if(Pe!==void 0){const Ke=ct(ve);Tn(Ke?.kind===An.Marker);const Ze=Ke?.onClick?.({...y,cell:ve,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Mi(ve,y.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===ve.checked)return}o(void 0),yn();const wt=W.hasIndex(j),nt=gr.current;if(ne==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&nt!==void 0&&W.hasIndex(nt)){const Ke=[Math.min(nt,j),Math.max(nt,j)+1];L||ye==="multi"?St(void 0,Ke,!0):St(rt.fromSingleSelection(Ke),void 0,L)}else ne==="multi"&&(L||y.isTouch||ye==="multi")?wt?St(W.remove(j),void 0,!0):(St(void 0,j,!0),gr.current=j):wt&&W.length===1?St(rt.empty(),void 0,A):(St(rt.fromSingleSelection(j),void 0,A),gr.current=j)}else if(Y>=B&&Wt&&j===Ve){const ve=ko(Y);Kr(ve??Y)}else if(ee!==Y||se!==j){const ve=Rn(y.location),wt=ct(ve);if(wt?.onSelect!==void 0){let Ze=!1;if(wt.onSelect({...y,cell:ve,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ze=!0,theme:Mi(ve,y.location)}),Ze)return}if(Nn==="block"&&Pr(j).isGroupHeader)return;const nt=dr&&j===Ve,Ke=dr&&K!==void 0&&K.current?.cell[1]===Ve;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&se!==void 0&&K.current!==void 0&&!Ke){if(nt)return;const Ze=Math.min(Y,ee),ht=Math.max(Y,ee),Mt=Math.min(j,se),vt=Math.max(j,se);Fe({...K.current,range:{x:Ze,y:Mt,width:ht-Ze+1,height:vt-Mt+1}},!0,A,"click"),gr.current=void 0,yn()}else Fe({cell:[Y,j],range:{x:Y,y:j,width:1,height:1}},!0,A,"click"),gr.current=void 0,o(void 0),yn()}}else if(y.kind==="header")if(_r.current=[Y,j],o(void 0),Pn&&Y===0)gr.current=void 0,Zr.current=void 0,!Er&&ne==="multi"&&(W.length!==Ve?St(rt.fromSingleSelection([0,Ve]),void 0,A):St(rt.empty(),void 0,A),yn());else{const ve=Zr.current;if(De==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&ve!==void 0&&z.hasIndex(ve)){const wt=[Math.min(ve,Y),Math.max(ve,Y)+1];U?lt(void 0,wt,A):lt(rt.fromSingleSelection(wt),void 0,A)}else U?(z.hasIndex(Y)?lt(z.remove(Y),void 0,A):lt(void 0,Y,A),Zr.current=Y):De!=="none"&&(z.hasIndex(Y)?lt(z.remove(Y),void 0,A):lt(rt.fromSingleSelection(Y),void 0,A),Zr.current=Y);gr.current=void 0,yn()}else y.kind===Ln?_r.current=[Y,j]:y.kind===aa&&!y.isMaybeScrollbar&&(me(No,!1),o(void 0),yn(),Tt?.(),gr.current=void 0,Zr.current=void 0)},[ne,De,K,Pn,B,Wt,Ve,kn,Rn,Pe,yn,ye,ct,Mi,St,ko,Kr,Nn,Pr,dr,Fe,lt,me,Tt]),Ei=d.useRef(!1),_r=d.useRef(),bl=d.useRef(Dr),Yn=d.useRef(),Df=d.useCallback(y=>{if(Jr.current=!1,bl.current=jt.current,y.button!==0&&y.button!==1){Yn.current=void 0;return}const A=performance.now();Yn.current={button:y.button,time:A,location:y.location},y?.kind==="header"&&(Ei.current=!0);const L=y.kind==="cell"&&y.isFillHandle;!L&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:L}),_r.current=void 0,!y.isTouch&&y.button===0&&!L?Ri(y):!y.isTouch&&y.button===1&&(_r.current=y.location))},[K,Ri]),[Pa,_a]=d.useState(),wl=d.useCallback(y=>{if(y.kind!==Ln||De!=="multi")return;const A=oa.value?y.metaKey:y.ctrlKey,[L]=y.location,U=K.columns;if(L<B)return;const Y=mt[L];let j=L,z=L;for(let W=L-1;W>=B&&to(Y.group,mt[W].group);W--)j--;for(let W=L+1;W<mt.length&&to(Y.group,mt[W].group);W++)z++;if(yn(),A)if(U.hasAll([j,z+1])){let W=U;for(let ee=j;ee<=z;ee++)W=W.remove(ee);lt(W,void 0,A)}else lt(void 0,[j,z+1],A);else lt(rt.fromSingleSelection([j,z+1]),void 0,A)},[De,yn,K.columns,mt,B,lt]),Jr=d.useRef(!1),Mo=d.useCallback(async y=>{if(on!==void 0&&Me!==void 0){const A=jt.current.y,L=jt.current.height;let U=on({x:y,y:A,width:1,height:Math.min(L,Ve-A)},un.current.signal);typeof U!="object"&&(U=await U());const Y=sn[y-B],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=at.baseFontFull;const W=bd(z,at,Y,0,U,Gn,Ir,!1,ct);Me?.(Y,W.width,y,W.width)}}},[sn,on,Ir,at,Gn,Me,B,Ve,ct]),[Of,Fa]=d.useState(),Qr=d.useCallback(async(y,A)=>{const L=y.current?.range;if(L===void 0||on===void 0||A.current===void 0)return;const U=A.current.range;if(M!==void 0){let W=!1;if(M({fillDestination:{...U,x:U.x-B},patternSource:{...L,x:L.x-B},preventDefault:()=>W=!0}),W)return}let Y=on(L,un.current.signal);typeof Y!="object"&&(Y=await Y());const j=Y,z=[];for(let W=0;W<U.width;W++)for(let ee=0;ee<U.height;ee++){const se=[U.x+W,U.y+ee];if(sd(se,L))continue;const ve=j[ee%L.height][W%L.width];ui(ve)||!Yi(ve)||z.push({location:se,value:{...ve}})}_n(z),mn.current?.damage(z.map(W=>({cell:W.location})))},[on,_n,M,B]),yl=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};Qr(y,K)},[Qr,K]),Cl=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};Qr(y,K)},[Qr,K]),Pf=d.useCallback((y,A)=>{const L=l;if(u(void 0),Ta(void 0),Fa(void 0),Ei.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Or===void 0)return;const ve={...K,current:{...K.current,range:xd(L.previousSelection.current.range,Or)}};Qr(L.previousSelection,ve),me(ve,!0);return}const[U,Y]=y.location,[j,z]=_r.current??[],W=()=>{Jr.current=!0},ee=ve=>{const wt=ve.isTouch||j===U&&z===Y;if(wt&&O?.([U-B,Y],{...ve,preventDefault:W}),ve.button===1)return!Jr.current;if(!Jr.current){const nt=Rn(y.location),Ke=ct(nt);if(Ke!==void 0&&Ke.onClick!==void 0&&wt){const ht=Ke.onClick({...ve,cell:nt,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Mi(nt,y.location),preventDefault:W});ht!==void 0&&!ui(ht)&&si(ht)&&(_n([{location:ve.location,value:ht}]),mn.current?.damage([{cell:ve.location}]))}if(Jr.current||K.current===void 0)return!1;let Ze=!1;switch(nt.activationBehaviorOverride??Je){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,Mt]=K.current.cell,[vt,ti]=L.previousSelection.current.cell;Ze=U===ht&&U===vt&&Y===Mt&&Y===ti&&(ve.isDoubleClick===!0||Je==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze)return R?.([U-B,Y]),jr(ve.bounds,!1),!0}return!1},se=y.location[0]-B;if(y.isTouch){const ve=jt.current,wt=bl.current;if(ve.x!==wt.x||ve.y!==wt.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Ki(K.current?.cell,y.location)){q?.([se,y.location[1]],{...y,preventDefault:W});return}else if(y.kind==="header"&&K.columns.hasIndex(U)){oe?.(se,{...y,preventDefault:W});return}else if(y.kind===Ln){if(se<0)return;J?.(se,{...y,preventDefault:W});return}}y.kind==="cell"?ee(y)||Ri(y):y.kind===Ln?$?.(se,{...y,preventDefault:W}):(y.kind===wr&&C?.(se,{...y,preventDefault:W}),Ri(y));return}if(y.kind==="header"){if(se<0)return;y.isEdge?y.isDoubleClick===!0&&Mo(U):y.button===0&&U===j&&Y===z&&C?.(se,{...y,preventDefault:W})}if(y.kind===Ln){if(se<0)return;y.button===0&&U===j&&Y===z&&($?.(se,{...y,preventDefault:W}),Jr.current||wl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),_r.current=void 0},[l,K,B,Or,Qr,me,O,Rn,ct,Je,Mi,_n,R,jr,q,oe,J,Ri,$,C,Mo,wl]),_f=d.useCallback(y=>{const A={...y,location:[y.location[0]-B,y.location[1]]};Ie?.(A),l!==void 0&&y.buttons===0&&(u(void 0),Ta(void 0),Fa(void 0),Ei.current=!1),Fa(L=>Ei.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===L?.[0]&&y.scrollEdge[1]===L[1]?L:l===void 0||(Yn.current?.location[0]??0)<B?void 0:y.scrollEdge)},[l,Ie,B]),Ff=d.useCallback((y,A)=>{qe?.(y-B,A)},[qe,B]),Lf=d.useCallback((y,A)=>{pt?.(y-B,A)},[pt,B]),ei=K?.current?.cell,Af=d.useCallback((y,A,L,U,Y,j)=>{fr.current=!1;let z=ei;z!==void 0&&(z=[z[0]-B,z[1]]);const W=Oe===0?void 0:{x:0,y:y.y,width:Oe,height:y.height},ee=[];W!==void 0&&ee.push(W),Yt>0&&(ee.push({x:y.x-B,y:Ve-Yt,width:y.width,height:Yt}),Oe>0&&ee.push({x:0,y:Ve-Yt,width:Oe,height:Yt}));const se={x:y.x-B,y:y.y,width:y.width,height:Wt&&y.y+y.height>=Ve?y.height-1:y.height,tx:Y,ty:j,extras:{selected:z,freezeRegion:W,freezeRegions:ee}};jt.current=se,hr(se),Gt([A,L,U]),tn?.(se,se.tx,se.ty,se.extras)},[ei,B,Wt,Ve,Oe,Yt,hr,tn]),Hf=br(I,d.useCallback((y,A)=>I?.(y-B,A-B)!==!1,[I,B])),zf=br(et,d.useCallback((y,A)=>{et?.(y-B,A-B),De!=="none"&<(rt.fromSingleSelection(A),void 0,!0)},[De,et,B,lt])),La=d.useRef(!1),Vf=d.useCallback(y=>{if(y.location[0]===0&&B>0){y.preventDefault();return}ze?.({...y,location:[y.location[0]-B,y.location[1]]}),y.defaultPrevented()||(La.current=!0),u(void 0)},[ze,B]),Nf=d.useCallback(()=>{La.current=!1},[]),Sl=We?.selectionBehavior,Ro=d.useCallback(y=>{if(Sl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:U}=Pr(y);if(A)return[y,y];const Y=L[L.length-1],j=y-Y,z=y+U-Y-1;return[j,z]},[Pr,Sl]),Aa=d.useRef(),Ha=d.useCallback(y=>{if(!Td(y,Aa.current)&&(Aa.current=y,!(Yn?.current?.button!==void 0&&Yn.current.button>=1))){if(y.buttons!==0&&l!==void 0&&Yn.current?.location[0]===0&&y.location[0]===0&&B===1&&ne==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Yn.current.location[1])&&K.rows.hasIndex(Yn.current.location[1])){const A=Math.min(Yn.current.location[1],y.location[1]),L=Math.max(Yn.current.location[1],y.location[1])+1;St(rt.fromSingleSelection([A,L]),void 0,!1)}if(y.buttons!==0&&l!==void 0&&K.current!==void 0&&!La.current&&!Ei.current&&(yt==="rect"||yt==="multi-rect")){const[A,L]=K.current.cell;let[U,Y]=y.location;if(Y<0&&(Y=jt.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,Wt?Ve-1:Ve);const z=Lp(j,U,Y,je);Ta(z)}else{if(Wt&&L===Ve)return;if(Wt&&Y===Ve)if(y.kind===aa)Y--;else return;U=Math.max(U,B);const W=Ro(L);Y=W===void 0?Y:Fn(Y,W[0],W[1]);const ee=U-A,se=Y-L,ve={x:ee>=0?A:U,y:se>=0?L:Y,width:Math.abs(ee)+1,height:Math.abs(se)+1};Fe({...K.current,range:ve},!0,!1,"drag")}}qt?.({...y,location:[y.location[0]-B,y.location[1]]})}},[l,B,ne,K,yt,qt,St,Wt,Ve,je,Ro,Fe]),$f=d.useCallback(()=>{const y=Aa.current;if(y===void 0)return;const[A,L]=y.scrollEdge;let[U,Y]=y.location;const j=jt.current;A===-1?U=j.extras?.freezeRegion?.x??j.x:A===1&&(U=j.x+j.width),L===-1?Y=Math.max(0,j.y):L===1&&(Y=Math.min(Ve-1,j.y+j.height)),U=Fn(U,0,mt.length-1),Y=Fn(Y,0,Ve-1),Ha({...y,location:[U,Y]})},[mt.length,Ha,Ve]);U0(Of,Ut,$f);const $n=d.useCallback(y=>{if(K.current===void 0)return;const[A,L]=y,[U,Y]=K.current.cell,j=K.current.range;let z=j.x,W=j.x+j.width,ee=j.y,se=j.y+j.height;const[ve,wt]=Ro(Y)??[0,Ve-1],nt=wt+1;if(L!==0)switch(L){case 2:{se=nt,ee=Y,Zt(0,se,"vertical");break}case-2:{ee=ve,se=Y+1,Zt(0,ee,"vertical");break}case 1:{ee<Y?(ee++,Zt(0,ee,"vertical")):(se=Math.min(nt,se+1),Zt(0,se,"vertical"));break}case-1:{se>Y+1?(se--,Zt(0,se,"vertical")):(ee=Math.max(ve,ee-1),Zt(0,ee,"vertical"));break}default:eo()}if(A!==0)if(A===2)W=mt.length,z=U,Zt(W-1-B,0,"horizontal");else if(A===-2)z=B,W=U+1,Zt(z-B,0,"horizontal");else{let Ke=[];if(on!==void 0){const Ze=on({x:z,y:ee,width:W-z-B,height:se-ee},un.current.signal);typeof Ze=="object"&&(Ke=ev(Ze))}if(A===1){let Ze=!1;if(z<U){if(Ke.length>0){const ht=Cr(z+1,U+1).find(Mt=>!Ke.includes(Mt-B));ht!==void 0&&(z=ht,Ze=!0)}else z++,Ze=!0;Ze&&Zt(z,0,"horizontal")}Ze||(W=Math.min(mt.length,W+1),Zt(W-1-B,0,"horizontal"))}else if(A===-1){let Ze=!1;if(W>U+1){if(Ke.length>0){const ht=Cr(W-1,U,-1).find(Mt=>!Ke.includes(Mt-B));ht!==void 0&&(W=ht,Ze=!0)}else W--,Ze=!0;Ze&&Zt(W-B,0,"horizontal")}Ze||(z=Math.max(B,z-1),Zt(z-B,0,"horizontal"))}else eo()}Fe({cell:K.current.cell,range:{x:z,y:ee,width:W-z,height:se-ee}},!0,!1,"keyboard-select")},[on,Ro,K,mt.length,B,Ve,Zt,Fe]),za=d.useRef(vi);za.current=vi;const mr=d.useCallback((y,A,L,U)=>{const Y=pn-(L?0:1);y=Fn(y,B,sn.length-1+B),A=Fn(A,0,Y);const j=ei?.[0],z=ei?.[1];if(y===j&&A===z)return!1;if(U&&K.current!==void 0){const W=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&W.push(K.current.range),me({...K,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:W}},!0)}else Fe({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),za.current&&Zt(y-B,A),!0},[pn,B,sn.length,ei,K,Zt,me,Fe]),Bf=d.useCallback((y,A)=>{i?.cell!==void 0&&y!==void 0&&si(y)&&(_n([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{mn.current?.damage([{cell:i.cell}])})),yn(!0),o(void 0);const[L,U]=A;if(K.current!==void 0&&(L!==0||U!==0)){const Y=K.current.cell[1]===pn-1&&y!==void 0;mr(Fn(K.current.cell[0]+L,0,mt.length-1),Fn(K.current.cell[1]+U,0,pn-1),Y,!1)}_?.(y,A)},[i?.cell,yn,K,_,_n,pn,mr,mt.length]),Wf=d.useMemo(()=>`gdg-overlay-${Q0++}`,[]),Fr=d.useCallback(y=>{yn();const A=[];for(let L=y.x;L<y.x+y.width;L++)for(let U=y.y;U<y.y+y.height;U++){const Y=S([L-B,U]);if(!Y.allowOverlay&&Y.kind!==Z.Boolean)continue;let j;if(Y.kind===Z.Custom){const z=ct(Y),W=z?.provideEditor?.({...Y,location:[L-B,U]});z?.onDelete!==void 0?j=z.onDelete(Y):Eg(W)&&(j=W?.deletedValue?.(Y))}else(si(Y)&&Y.allowOverlay||Y.kind===Z.Boolean)&&(j=ct(Y)?.onDelete?.(Y));j!==void 0&&!ui(j)&&si(j)&&A.push({location:[L,U],value:j})}_n(A),mn.current?.damage(A.map(L=>({cell:L.location})))},[yn,S,ct,_n,B]),Ii=i!==void 0,xl=d.useCallback(y=>{const A=()=>{y.stopPropagation(),y.preventDefault()},L={didMatch:!1},{bounds:U}=y,Y=K.columns,j=K.rows,z=On;if(!Ii&&it(z.clear,y,L))me(No,!1),Tt?.();else if(!Ii&&it(z.selectAll,y,L))me({columns:rt.empty(),rows:rt.empty(),current:{cell:K.current?.cell??[B,0],range:{x:B,y:0,width:b.length,height:Ve},rangeStack:[]}},!1);else if(it(z.search,y,L))s?.current?.focus({preventScroll:!0}),Xr(!0);else if(it(z.delete,y,L)){const ht=Ue?.(K)??!0;if(ht!==!1){const Mt=ht===!0?K:ht;if(Mt.current!==void 0){Fr(Mt.current.range);for(const vt of Mt.current.rangeStack)Fr(vt)}for(const vt of Mt.rows)Fr({x:B,y:vt,width:b.length,height:1});for(const vt of Mt.columns)Fr({x:vt,y:0,width:1,height:Ve})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[W,ee]=K.current.cell;const[,se]=K.current.cell;let ve=!1,wt=!1;if(it(z.scrollToSelectedCell,y,L)?To.current(W-B,ee):De!=="none"&&it(z.selectColumn,y,L)?Y.hasIndex(W)?lt(Y.remove(W),void 0,!0):De==="single"?lt(rt.fromSingleSelection(W),void 0,!0):lt(void 0,W,!0):ne!=="none"&&it(z.selectRow,y,L)?j.hasIndex(ee)?St(j.remove(ee),void 0,!0):ne==="single"?St(rt.fromSingleSelection(ee),void 0,!0):St(void 0,ee,!0):!Ii&&U!==void 0&&it(z.activateCell,y,L)?ee===Ve&&Wt?window.setTimeout(()=>{const ht=ko(W);Kr(ht??W)},0):(R?.([W-B,ee]),jr(U,!0)):K.current.range.height>1&&it(z.downFill,y,L)?Cl():K.current.range.width>1&&it(z.rightFill,y,L)?yl():it(z.goToNextPage,y,L)?ee+=Math.max(1,jt.current.height-4):it(z.goToPreviousPage,y,L)?ee-=Math.max(1,jt.current.height-4):it(z.goToFirstCell,y,L)?(o(void 0),ee=0,W=0):it(z.goToLastCell,y,L)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):it(z.selectToFirstCell,y,L)?(o(void 0),$n([-2,-2])):it(z.selectToLastCell,y,L)?(o(void 0),$n([2,2])):Ii?(it(z.closeOverlay,y,L)&&o(void 0),it(z.acceptOverlayDown,y,L)&&(o(void 0),ee++),it(z.acceptOverlayUp,y,L)&&(o(void 0),ee--),it(z.acceptOverlayLeft,y,L)&&(o(void 0),W--),it(z.acceptOverlayRight,y,L)&&(o(void 0),W++)):(it(z.goDownCell,y,L)?ee+=1:it(z.goUpCell,y,L)?ee-=1:it(z.goRightCell,y,L)?W+=1:it(z.goLeftCell,y,L)?W-=1:it(z.goDownCellRetainSelection,y,L)?(ee+=1,ve=!0):it(z.goUpCellRetainSelection,y,L)?(ee-=1,ve=!0):it(z.goRightCellRetainSelection,y,L)?(W+=1,ve=!0):it(z.goLeftCellRetainSelection,y,L)?(W-=1,ve=!0):it(z.goToLastRow,y,L)?ee=Ve-1:it(z.goToFirstRow,y,L)?ee=Number.MIN_SAFE_INTEGER:it(z.goToLastColumn,y,L)?W=Number.MAX_SAFE_INTEGER:it(z.goToFirstColumn,y,L)?W=Number.MIN_SAFE_INTEGER:(yt==="rect"||yt==="multi-rect")&&(it(z.selectGrowDown,y,L)?$n([0,1]):it(z.selectGrowUp,y,L)?$n([0,-1]):it(z.selectGrowRight,y,L)?$n([1,0]):it(z.selectGrowLeft,y,L)?$n([-1,0]):it(z.selectToLastRow,y,L)?$n([0,2]):it(z.selectToFirstRow,y,L)?$n([0,-2]):it(z.selectToLastColumn,y,L)?$n([2,0]):it(z.selectToFirstColumn,y,L)&&$n([-2,0])),wt=L.didMatch),Nn!==void 0&&Nn!=="normal"&&ee!==se){const ht=Nn==="skip-up"||Nn==="skip"||Nn==="block",Mt=Nn==="skip-down"||Nn==="skip"||Nn==="block",vt=ee<se;if(vt&&ht){for(;ee>=0&&Pr(ee).isGroupHeader;)ee--;ee<0&&(ee=se)}else if(!vt&&Mt){for(;ee<Ve&&Pr(ee).isGroupHeader;)ee++;ee>=Ve&&(ee=se)}}const Ke=mr(W,ee,!1,ve),Ze=L.didMatch;return Ze&&(Ke||!wt||kt)&&A(),Ze},[Nn,Ii,K,On,De,ne,yt,B,Pr,Ve,mr,me,Tt,b.length,Ue,kt,Fr,lt,St,Wt,ko,Kr,R,jr,Cl,yl,$n]),Ti=d.useCallback(y=>{let A=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-B,y.location[1]]},cancel:()=>{A=!0}}),A||xl(y)||K.current===void 0)return;const[L,U]=K.current.cell,Y=jt.current;if(ke&&!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&&Yi(S([L-B,Math.max(0,Math.min(U,Ve-1))]))){if((!Wt||U!==Ve)&&(Y.y>U||U>Y.y+Y.height||Y.x>L||L>Y.x+Y.width))return;R?.([L-B,U]),jr(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[ke,G,xl,K,S,B,Ve,Wt,R,jr]),Uf=d.useCallback((y,A)=>{const L=y.location[0]-B;if(y.kind==="header"&&oe?.(L,{...y,preventDefault:A}),y.kind===Ln){if(L<0)return;J?.(L,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,Y]=y.location;q?.([L,Y],{...y,preventDefault:A}),Dm(K,y.location)||mr(U,Y,!1,!1)}},[K,q,J,oe,B,mr]),Va=d.useCallback(async y=>{if(!On.paste)return;function A(z,W,ee,se){const ve=typeof ee=="object"?ee?.join(`
|
172
|
+
`&&(n.push(r),r=[])),o=t.None);break}s++}return i<e.length&&r.push(Iu(e.slice(i,e.length))),n.push(r),n.map(a=>a.map(l=>({rawValue:l,formatted:l,format:"string"})))}function Tu(e,t,n){const r=L0(e,t),i=a=>{window.navigator.clipboard?.writeText(a)},o=(a,l)=>window.navigator.clipboard?.write===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([l],{type:"text/html"})})]),!0),s=(a,l)=>{try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");n?.clipboardData?.setData("text/plain",a),n?.clipboardData?.setData("text/html",l)}catch{o(a,l)||i(a)}};window.navigator.clipboard?.write!==void 0||n?.clipboardData!==void 0?s(r.textPlain,r.textHtml):i(r.textPlain),n?.preventDefault()}function Od(e){return e!==!0}function Du(e){return typeof e=="string"?e:`${e}px`}const z0=()=>e=>e.innerWidth,V0=()=>e=>e.innerHeight,N0=fn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[z0()],"wmyidgi-1":[V0()]}}),$0=e=>{const{inWidth:t,inHeight:n,children:r,...i}=e;return d.createElement(N0,{innerHeight:Du(n),innerWidth:Du(t),...i},r)},B0=2,W0=1300;function U0(e,t,n){const r=Nt.useRef(0),[i,o]=e??[0,0];Nt.useEffect(()=>{if(i===0&&o===0){r.current=0;return}let s=!1,a=0;const l=u=>{if(!s){if(a===0)a=u;else{const c=u-a;r.current=Math.min(1,r.current+c/W0);const f=r.current**1.618*c*B0;t.current?.scrollBy(i*f,o*f),a=u,n?.()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{s=!0}},[t,i,o,n])}function q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:i,overscrollY:o,scaleToRem:s,remSize:a}){const[l,u,c,f,g,h]=Nt.useMemo(()=>{if(!s||a===16)return[e,t,n,r,i,o];const m=a/16,p=e,w=pd();return[typeof p=="number"?p*m:b=>Math.ceil(p(b)*m),Math.ceil(t*m),Math.ceil(n*m),{...r,headerIconSize:(r?.headerIconSize??w.headerIconSize)*m,cellHorizontalPadding:(r?.cellHorizontalPadding??w.cellHorizontalPadding)*m,cellVerticalPadding:(r?.cellVerticalPadding??w.cellVerticalPadding)*m},Math.ceil((i??0)*m),Math.ceil((o??0)*m)]},[n,t,i,o,a,e,s,r]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:f,overscrollX:g,overscrollY:h}}const vr={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 ot(e,t){return e===!0?t:e===!1?"":e}function Ou(e){const t=oa.value;return{activateCell:ot(e.activateCell," |Enter|shift+Enter"),clear:ot(e.clear,"any+Escape"),closeOverlay:ot(e.closeOverlay,"any+Escape"),acceptOverlayDown:ot(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ot(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ot(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ot(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ot(e.delete,t?"Backspace|Delete":"Delete"),downFill:ot(e.downFill,"primary+_68"),scrollToSelectedCell:ot(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ot(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ot(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ot(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ot(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ot(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ot(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ot(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ot(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ot(e.goToFirstCell,"primary+Home"),goToFirstColumn:ot(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ot(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ot(e.goToLastCell,"primary+End"),goToLastColumn:ot(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ot(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ot(e.goToNextPage,"PageDown"),goToPreviousPage:ot(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ot(e.rightFill,"primary+_82"),search:ot(e.search,"primary+f"),selectAll:ot(e.selectAll,"primary+a"),selectColumn:ot(e.selectColumn,"ctrl+ "),selectGrowDown:ot(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ot(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ot(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ot(e.selectGrowUp,"shift+ArrowUp"),selectRow:ot(e.selectRow,"shift+ "),selectToFirstCell:ot(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ot(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ot(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ot(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ot(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ot(e.selectToLastRow,"primary+shift+ArrowDown")}}function G0(e){const t=Qg(e);return Nt.useMemo(()=>{if(t===void 0)return Ou(vr);const n={...t,goToNextPage:t?.goToNextPage??t?.pageDown??vr.goToNextPage,goToPreviousPage:t?.goToPreviousPage??t?.pageUp??vr.goToPreviousPage,goToFirstCell:t?.goToFirstCell??t?.first??vr.goToFirstCell,goToLastCell:t?.goToLastCell??t?.last??vr.goToLastCell,selectToFirstCell:t?.selectToFirstCell??t?.first??vr.selectToFirstCell,selectToLastCell:t?.selectToLastCell??t?.last??vr.selectToLastCell};return Ou({...vr,...n})},[t])}function Y0(e){function t(r,i,o){if(typeof r=="number")return{headerIndex:r,isCollapsed:!1,depth:i,path:o};const s={headerIndex:r.headerIndex,isCollapsed:r.isCollapsed,depth:i,path:o};return r.subGroups!==void 0&&(s.subGroups=r.subGroups.map((a,l)=>t(a,i+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),s}return e.map((r,i)=>t(r,0,[i])).sort((r,i)=>r.headerIndex-i.headerIndex)}function Ks(e,t){const n=[];function r(a,l,u=!1){let c=l!==null?l-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 f=0;f<a.subGroups.length;f++){const g=f<a.subGroups.length-1?a.subGroups[f+1].headerIndex:l;r(a.subGroups[f],g,u||a.isCollapsed)}}const i=Y0(e.groups);for(let a=0;a<i.length;a++){const l=a<i.length-1?i[a+1].headerIndex:null;r(i[a],l)}let o=0,s=0;for(const a of n)a.contentIndex=s,s+=a.rows,a.rowIndex=o,o+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...u}=a;return u})}function Rs(e,t){if(t===void 0||Ks.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 X0(e,t,n,r){const i=Nt.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]),o=Nt.useMemo(()=>i?.reduce((c,f)=>(c[f.rowIndex]=f,c),{}),[i]),s=Nt.useMemo(()=>i===void 0?t:i.reduce((c,f)=>c+(f.isCollapsed?1:f.rows+1),0),[i,t]),a=Nt.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>o?.[c]?e.height:typeof n=="number"?n:n(c),[o,e,n]),l=Nt.useCallback(c=>{if(i===void 0)return c;let f=c;for(const g of i){if(f===0)return;if(f--,!g.isCollapsed){if(f<g.rows)return g.contentIndex+f;f-=g.rows}}return c},[i]),u=br(r??e?.themeOverride,Nt.useCallback(c=>{if(e===void 0)return r?.(c,c,c);if(r===void 0&&e?.themeOverride===void 0)return;const{isGroupHeader:f,contentIndex:g,groupIndex:h}=Rs(c,i);return f?e.themeOverride:r?.(c,h,g)},[i,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:u}:{rowHeight:a,rows:s,rowNumberMapper:l,getRowThemeOverride:u}}function j0(e,t){const n=Nt.useMemo(()=>e===void 0?void 0:Ks(e,t),[e,t]);return{getRowGroupingForPath:_d,updateRowGroupingByPath:Pd,mapper:Nt.useCallback(r=>{if(typeof r=="number")return Rs(r,n);const i=Rs(r[1],n);return{...i,originalIndex:[r[0],i.originalIndex]}},[n])}}function Pd(e,t,n){const[r,...i]=t;return i[0]===-1?e.map((o,s)=>s===r?{...o,...n}:o):e.map((o,s)=>s===r?{...o,subGroups:Pd(o.subGroups??[],i,n)}:o)}function _d(e,t){const[n,...r]=t;return r[0]===-1?e[n]:_d(e[n].subGroups??[],r)}function K0(e,t){const[n]=d.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 Z0(e,t,n,r,i){const[o,s]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:o,width:r.current.width??1,height:r.current.height??1,ty:s}),[r,s,o]),[l,u,c]=Jg(a),f=d.useRef(i);f.current=i;const g=K0(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&g.current!==null&&h){if(g.current.scrollTop===t)return;g.current.scrollTop=t,g.current.scrollTop!==t&&c(),f.current()}},[t,h,c,g]);const m=(l.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&g.current!==null&&m){if(g.current.scrollLeft===e)return;g.current.scrollLeft=e,g.current.scrollLeft!==e&&c(),f.current()}},[e,m,c,g]),{visibleRegion:l,setVisibleRegion:u,scrollRef:g}}const J0=d.lazy(async()=>await _s(()=>import("./data-grid-overlay-editor.qkFp1znp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url));let Q0=0;function ev(e){return np(vu(vu(e).filter(t=>t.span!==void 0).map(t=>Cr((t.span?.[0]??0)+1,(t.span?.[1]??0)+1))))}function zo(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 Vo={kind:Z.Loading,allowOverlay:!1},No={columns:rt.empty(),rows:rt.empty(),current:void 0},tv=(e,t)=>{const[n,r]=d.useState(No),[i,o]=d.useState(),s=d.useRef(null),a=d.useRef(null),[l,u]=d.useState(),c=d.useRef(),f=typeof window>"u"?null:window,{imageEditorOverride:g,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:w,columns:b,rows:v,getCellContent:S,onCellClicked:O,onCellActivated:R,onFillPattern:M,onFinishedEditing:_,coercePasteValue:E,drawHeader:k,drawCell:F,editorBloom:D,onHeaderClicked:C,onColumnProposeMove:I,rangeSelectionColumnSpanning:T=!0,spanRangeBehavior:x="default",onGroupHeaderClicked:$,onCellContextMenu:q,className:X,onHeaderContextMenu:oe,getCellsForSelection:Q,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:te,onCellEdited:ae,onCellsEdited:le,onSearchResultsChanged:fe,searchResults:re,onSearchValueChange:H,searchValue:P,onKeyDown:G,onKeyUp:ue,keybindings:he,editOnType:ke=!0,onRowAppended:Se,onColumnMoved:et,validateCell:Re,highlightRegions:Xe,rangeSelect:yt="rect",columnSelect:De="multi",rowSelect:ne="multi",rangeSelectionBlending:Ee="exclusive",columnSelectionBlending:xe="exclusive",rowSelectionBlending:ce="exclusive",onDelete:pe,onDragStart:ze,onMouseMove:Ie,onPaste:tt,copyHeaders:Te=!1,freezeColumns:Oe=0,cellActivationBehavior:Je="second-click",rowSelectionMode:ye="auto",onHeaderMenuClick:qe,onHeaderIndicatorClick:pt,getGroupDetails:ft,rowGrouping:We,onSearchClose:xt,onItemHovered:qt,onSelectionCleared:Tt,showSearch:_t,onVisibleRegionChanged:tn,gridSelection:zt,onGridSelectionChange:Sn,minColumnWidth:Vt=50,maxColumnWidth:ut=500,maxColumnAutoWidth:nn,provideEditor:Ct,trailingRowOptions:Ft,freezeTrailingRows:Yt=0,allowedFillDirections:je="orthogonal",scrollOffsetX:Dt,scrollOffsetY:Ot,verticalBorder:ln,onDragOverCell:rn,onDrop:hn,onColumnResize:bn,onColumnResizeEnd:Xt,onColumnResizeStart:Jt,customRenderers:Ge,fillHandle:Et,experimental:Qt,fixedShadowX:Lt,fixedShadowY:At,headerIcons:xn,imageWindowLoader:Un,initialSize:Hn,isDraggable:N,onDragLeave:Be,onRowMoved:Pe,overscrollX:Pt,overscrollY:wn,preventDiagonalScrolling:ge,rightElement:bt,rightElementProps:en,trapFocus:kt=!1,smoothScrollX:Bt,smoothScrollY:an,scaleToRem:Sa=!1,rowHeight:co=34,headerHeight:fo=36,groupHeaderHeight:xa=fo,theme:Mr,isOutsideClick:lr,renderers:pi,resizeIndicator:ka,scrollToActiveCell:vi=!0,drawFocusRing:bi=!0}=e,Rr=bi==="no-editor"?i===void 0:bi,Jn=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=Jn?.kind??e.rowMarkers??"none",wi=Jn?.width??e.rowMarkerWidth,yi=Jn?.startIndex??e.rowMarkerStartIndex??1,Gr=Jn?.theme??e.rowMarkerTheme,Qn=Jn?.headerTheme,er=Jn?.headerAlwaysVisible,Er=ne!=="multi"||Jn?.headerDisabled===!0,qn=Jn?.checkboxStyle??"square",Gn=Math.max(Vt,20),Ir=Math.max(ut,Gn),ho=Math.max(nn??Ir,Gn),Ci=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ve,rowNumberMapper:go,rowHeight:mo,getRowThemeOverride:ur}=X0(We,v,co,h),po=d.useMemo(()=>Number.parseFloat(Ci.fontSize),[Ci]),{rowHeight:zn,headerHeight:Si,groupHeaderHeight:vo,theme:bo,overscrollX:Ma,overscrollY:Ra}=q0({groupHeaderHeight:xa,headerHeight:fo,overscrollX:Pt,overscrollY:wn,remSize:po,rowHeight:mo,scaleToRem:Sa,theme:Mr}),On=G0(he),cr=wi??(v>1e4?48:v>1e3?44:v>100?36:32),Pn=kn!=="none",B=Pn?1:0,Wt=Se!==void 0,dr=Ft?.sticky===!0,[Yr,Xr]=d.useState(!1),xi=_t??Yr,Ea=d.useCallback(()=>{xt!==void 0?xt():Xr(!1)},[xt]),K=d.useMemo(()=>zt===void 0?void 0:zo(zt,B),[zt,B])??n,un=d.useRef();un.current===void 0&&(un.current=new AbortController),d.useEffect(()=>()=>un?.current.abort(),[]);const[on,Ia]=T0(Q,S,B,un.current,Ve),V=d.useCallback((y,A,L)=>{if(Re===void 0)return!0;const U=[y[0]-B,y[1]];return Re?.(U,A,L)},[B,Re]),ie=d.useRef(zt),me=d.useCallback((y,A)=>{A&&(y=A0(y,on,B,x,un.current)),Sn!==void 0?(ie.current=zo(y,-B),Sn(ie.current)):r(y)},[Sn,on,B,x]),Me=br(bn,d.useCallback((y,A,L,U)=>{bn?.(b[L-B],A,L-B,U)},[bn,B,b])),de=br(Xt,d.useCallback((y,A,L,U)=>{Xt?.(b[L-B],A,L-B,U)},[Xt,B,b])),be=br(Jt,d.useCallback((y,A,L,U)=>{Jt?.(b[L-B],A,L-B,U)},[Jt,B,b])),Ye=br(k,d.useCallback((y,A)=>k?.({...y,columnIndex:y.columnIndex-B},A)??!1,[k,B])),we=br(F,d.useCallback((y,A)=>F?.({...y,col:y.col-B},A)??!1,[F,B])),Ue=d.useCallback(y=>{if(pe!==void 0){const A=pe(zo(y,-B));return typeof A=="boolean"?A:zo(A,B)}return!0},[pe,B]),[Fe,St,lt]=I0(K,me,Ee,xe,ce,yt,T),at=d.useMemo(()=>ir(pd(),bo),[bo]),[dt,Gt]=d.useState([0,0,0]),gn=d.useMemo(()=>{if(pi===void 0)return{};const y={};for(const A of pi)y[A.kind]=A;return y},[pi]),ct=d.useCallback(y=>y.kind!==Z.Custom?gn[y.kind]:Ge?.find(A=>A.isMatch(y)),[Ge,gn]);let{sizedColumns:sn,nonGrowWidth:Tr}=Ym(b,Ve,Ia,dt[0]-(B===0?0:cr)-dt[2],Gn,ho,at,ct,un.current);kn!=="none"&&(Tr+=cr);const tr=d.useMemo(()=>sn.some(y=>y.group!==void 0),[sn]),Rt=tr?Si+vo:Si,Vn=K.rows.length,Mn=kn==="none"?void 0:Vn===0?!1:Vn===Ve?!0:void 0,mt=d.useMemo(()=>kn==="none"?sn:[{title:"",width:cr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:Gr,rowMarker:qn,rowMarkerChecked:Mn,headerRowMarkerTheme:Qn,headerRowMarkerAlwaysVisible:er,headerRowMarkerDisabled:Er},...sn],[kn,sn,cr,Gr,qn,Mn,Qn,er,Er]),jt=d.useRef({height:1,width:1,x:0,y:0}),fr=d.useRef(!1),{setVisibleRegion:hr,visibleRegion:Dr,scrollRef:Ut}=Z0(Dt,Ot,zn,jt,()=>fr.current=!0);jt.current=Dr;const If=Dr.x+B,wo=Dr.y,mn=d.useRef(null),yn=d.useCallback(y=>{y===!0?mn.current?.focus():window.requestAnimationFrame(()=>{mn.current?.focus()})},[]),pn=Wt?Ve+1:Ve,_n=d.useCallback(y=>{const A=B===0?y:y.map(U=>({...U,location:[U.location[0]-B,U.location[1]]})),L=le?.(A);if(L!==!0)for(const U of A)ae?.(U.location,U.value);return L},[ae,le,B]),[Or,Ta]=d.useState(),yo=K.current!==void 0&&K.current.range.width*K.current.range.height>1?K.current.range:void 0,hl=Rr?K.current?.cell:void 0,Co=hl?.[0],So=hl?.[1],Tf=d.useMemo(()=>{if((Xe===void 0||Xe.length===0)&&(yo??Co??So??Or)===void 0)return;const y=[];if(Xe!==void 0)for(const A of Xe){const L=mt.length-A.range.x-B;L>0&&y.push({color:A.color,range:{...A.range,x:A.range.x+B,width:Math.min(L,A.range.width)},style:A.style})}return Or!==void 0&&y.push({color:Nr(at.accentColor,0),range:Or,style:"dashed"}),yo!==void 0&&y.push({color:Nr(at.accentColor,.5),range:yo,style:"solid-outline"}),Co!==void 0&&So!==void 0&&y.push({color:at.accentColor,range:{x:Co,y:So,width:1,height:1},style:"solid-outline"}),y.length>0?y:void 0},[Or,yo,Co,So,Xe,mt.length,at.accentColor,B]),gl=d.useRef(mt);gl.current=mt;const Rn=d.useCallback(([y,A],L=!1)=>{const U=Wt&&A===pn-1;if(y===0&&Pn){if(U)return Vo;const j=go(A);return j===void 0?Vo:{kind:An.Marker,allowOverlay:!1,checkboxStyle:qn,checked:K?.rows.hasIndex(A)===!0,markerKind:kn==="clickable-number"?"number":kn,row:yi+j,drawHandle:Pe!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(U){const z=y===B?Ft?.hint??"":"",W=gl.current[y];if(W?.trailingRowOptions?.disabled===!0)return Vo;{const ee=W?.trailingRowOptions?.hint??z,se=W?.trailingRowOptions?.addIcon??Ft?.addIcon;return{kind:An.NewRow,hint:ee,allowOverlay:!1,icon:se}}}else{const j=y-B;if(L||Qt?.strict===!0){const W=jt.current,ee=W.x>j||j>W.x+W.width||W.y>A||A>W.y+W.height||A>=Oa.current,se=j===W.extras?.selected?.[0]&&A===W.extras?.selected[1];let ve=!1;if(W.extras?.freezeRegions!==void 0){for(const wt of W.extras.freezeRegions)if(Vr(wt,j,A)){ve=!0;break}}if(ee&&!se&&!ve)return Vo}let z=S([j,A]);return B!==0&&z.span!==void 0&&(z={...z,span:[z.span[0]+B,z.span[1]+B]}),z}},[Wt,pn,Pn,go,qn,K?.rows,kn,yi,Pe,B,Ft?.hint,Ft?.addIcon,Qt?.strict,S]),Da=d.useCallback(y=>{let A=ft?.(y)??{name:y};return te!==void 0&&y!==""&&(A={icon:A.icon,name:A.name,overrideTheme:A.overrideTheme,actions:[...A.actions??[],{title:"Rename",icon:"renameIcon",onClick:L=>_a({group:A.name,bounds:L.bounds})}]}),A},[ft,te]),xo=d.useCallback(y=>{const[A,L]=y.cell,U=mt[A],Y=U?.group!==void 0?Da(U.group)?.overrideTheme:void 0,j=U?.themeOverride,z=ur?.(L);o({...y,theme:ir(at,Y,j,z,y.content.themeOverride)})},[ur,mt,Da,at]),jr=d.useCallback((y,A,L)=>{if(K.current===void 0)return;const[U,Y]=K.current.cell,j=Rn([U,Y]);if(j.kind!==Z.Boolean&&j.allowOverlay){let z=j;if(L!==void 0)switch(z.kind){case Z.Number:{const W=Rg(()=>L==="-"?-0:Number.parseFloat(L),0);z={...z,data:Number.isNaN(W)?0:W};break}case Z.Text:case Z.Markdown:case Z.Uri:z={...z,data:L};break}xo({target:y,content:z,initialValue:L,cell:[U,Y],highlight:L===void 0,forceEditMode:L!==void 0})}else j.kind===Z.Boolean&&A&&j.readonly!==!0&&(_n([{location:K.current.cell,value:{...j,data:Od(j.data)}}]),mn.current?.damage([{cell:K.current.cell}]))},[Rn,K,_n,xo]),ml=d.useCallback((y,A)=>{const L=mn.current?.getBounds(y,A);if(L===void 0||Ut.current===null)return;const U=Rn([y,A]);U.allowOverlay&&xo({target:L,content:U,initialValue:void 0,highlight:!0,cell:[y,A],forceEditMode:!0})},[Rn,Ut,xo]),Zt=d.useCallback((y,A,L="both",U=0,Y=0,j=void 0)=>{if(Ut.current!==null){const z=mn.current,W=a.current,ee=typeof y!="number"?y.unit==="cell"?y.amount:void 0:y,se=typeof A!="number"?A.unit==="cell"?A.amount:void 0:A,ve=typeof y!="number"&&y.unit==="px"?y.amount:void 0,wt=typeof A!="number"&&A.unit==="px"?A.amount:void 0;if(z!==null&&W!==null){let nt={x:0,y:0,width:0,height:0},Ke=0,Ze=0;if((ee!==void 0||se!==void 0)&&(nt=z.getBounds((ee??0)+B,se??0)??nt,nt.width===0||nt.height===0))return;const ht=W.getBoundingClientRect(),Mt=ht.width/W.offsetWidth;if(ve!==void 0&&(nt={...nt,x:ve-ht.left-Ut.current.scrollLeft,width:1}),wt!==void 0&&(nt={...nt,y:wt+ht.top-Ut.current.scrollTop,height:1}),nt!==void 0){const vt={x:nt.x-U,y:nt.y-Y,width:nt.width+2*U,height:nt.height+2*Y};let ti=0;for(let Na=0;Na<Oe;Na++)ti+=sn[Na].width;let Oi=0;const Pi=Yt+(dr?1:0);Pi>0&&(Oi=Ur(pn,Pi,zn));let Xn=ti*Mt+ht.left+B*cr*Mt,ni=ht.right,Lr=ht.top+Rt*Mt,ri=ht.bottom-Oi*Mt;const Do=nt.width+U*2;switch(j?.hAlign){case"start":ni=Xn+Do;break;case"end":Xn=ni-Do;break;case"center":Xn=Math.floor((Xn+ni)/2)-Do/2,ni=Xn+Do;break}const Oo=nt.height+Y*2;switch(j?.vAlign){case"start":ri=Lr+Oo;break;case"end":Lr=ri-Oo;break;case"center":Lr=Math.floor((Lr+ri)/2)-Oo/2,ri=Lr+Oo;break}Xn>vt.x?Ke=vt.x-Xn:ni<vt.x+vt.width&&(Ke=vt.x+vt.width-ni),Lr>vt.y?Ze=vt.y-Lr:ri<vt.y+vt.height&&(Ze=vt.y+vt.height-ri),L==="vertical"||typeof y=="number"&&y<Oe?Ke=0:(L==="horizontal"||typeof A=="number"&&A>=pn-Pi)&&(Ze=0),(Ke!==0||Ze!==0)&&(Mt!==1&&(Ke/=Mt,Ze/=Mt),Ut.current.scrollTo({left:Ke+Ut.current.scrollLeft,top:Ze+Ut.current.scrollTop,behavior:j?.behavior??"auto"}))}}}},[B,Yt,cr,Ut,Rt,Oe,sn,pn,dr,zn]),pl=d.useRef(ml),vl=d.useRef(S),Oa=d.useRef(Ve);pl.current=ml,vl.current=S,Oa.current=Ve;const Kr=d.useCallback(async(y,A=!0,L)=>{if(mt[y]?.trailingRowOptions?.disabled===!0)return;const Y=Se?.();let j,z=!0;Y!==void 0&&(j=await Y,j==="top"&&(z=!1),typeof j=="number"&&(z=!1));let W=0;const ee=()=>{if(Oa.current<=Ve){W<500&&window.setTimeout(ee,W),W=50+W*2;return}const se=typeof j=="number"?j:z?Ve:0;To.current(y-B,se,"both",0,0,L?{behavior:L}:void 0),Fe({cell:[y,se],range:{x:y,y:se,width:1,height:1}},!1,!1,"edit");const ve=vl.current([y-B,se]);ve.allowOverlay&&Yi(ve)&&ve.readonly!==!0&&A&&window.setTimeout(()=>{pl.current(y,se)},0)};ee()},[mt,Se,B,Ve,Fe]),ko=d.useCallback(y=>{const A=sn[y]?.trailingRowOptions?.targetColumn??Ft?.targetColumn;if(typeof A=="number")return A+(Pn?1:0);if(typeof A=="object"){const L=b.indexOf(A);if(L>=0)return L+(Pn?1:0)}},[sn,b,Pn,Ft?.targetColumn]),gr=d.useRef(),Zr=d.useRef(),Mi=d.useCallback((y,A)=>{const[L,U]=A;return ir(at,mt[L]?.themeOverride,ur?.(U),y.themeOverride)},[ur,mt,at]),{mapper:Pr}=j0(We,v),Nn=We?.navigationBehavior,Ri=d.useCallback(y=>{const A=oa.value?y.metaKey:y.ctrlKey,L=A&&ne==="multi",U=A&&De==="multi",[Y,j]=y.location,z=K.columns,W=K.rows,[ee,se]=K.current?.cell??[];if(y.kind==="cell"){if(Zr.current=void 0,_r.current=[Y,j],Y===0&&Pn){if(Wt===!0&&j===Ve||kn==="number"||ne==="none")return;const ve=Rn(y.location);if(ve.kind!==An.Marker)return;if(Pe!==void 0){const Ke=ct(ve);Tn(Ke?.kind===An.Marker);const Ze=Ke?.onClick?.({...y,cell:ve,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,theme:Mi(ve,y.location),preventDefault:()=>{}});if(Ze===void 0||Ze.checked===ve.checked)return}o(void 0),yn();const wt=W.hasIndex(j),nt=gr.current;if(ne==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&nt!==void 0&&W.hasIndex(nt)){const Ke=[Math.min(nt,j),Math.max(nt,j)+1];L||ye==="multi"?St(void 0,Ke,!0):St(rt.fromSingleSelection(Ke),void 0,L)}else ne==="multi"&&(L||y.isTouch||ye==="multi")?wt?St(W.remove(j),void 0,!0):(St(void 0,j,!0),gr.current=j):wt&&W.length===1?St(rt.empty(),void 0,A):(St(rt.fromSingleSelection(j),void 0,A),gr.current=j)}else if(Y>=B&&Wt&&j===Ve){const ve=ko(Y);Kr(ve??Y)}else if(ee!==Y||se!==j){const ve=Rn(y.location),wt=ct(ve);if(wt?.onSelect!==void 0){let Ze=!1;if(wt.onSelect({...y,cell:ve,posX:y.localEventX,posY:y.localEventY,bounds:y.bounds,preventDefault:()=>Ze=!0,theme:Mi(ve,y.location)}),Ze)return}if(Nn==="block"&&Pr(j).isGroupHeader)return;const nt=dr&&j===Ve,Ke=dr&&K!==void 0&&K.current?.cell[1]===Ve;if((y.shiftKey||y.isLongTouch===!0)&&ee!==void 0&&se!==void 0&&K.current!==void 0&&!Ke){if(nt)return;const Ze=Math.min(Y,ee),ht=Math.max(Y,ee),Mt=Math.min(j,se),vt=Math.max(j,se);Fe({...K.current,range:{x:Ze,y:Mt,width:ht-Ze+1,height:vt-Mt+1}},!0,A,"click"),gr.current=void 0,yn()}else Fe({cell:[Y,j],range:{x:Y,y:j,width:1,height:1}},!0,A,"click"),gr.current=void 0,o(void 0),yn()}}else if(y.kind==="header")if(_r.current=[Y,j],o(void 0),Pn&&Y===0)gr.current=void 0,Zr.current=void 0,!Er&&ne==="multi"&&(W.length!==Ve?St(rt.fromSingleSelection([0,Ve]),void 0,A):St(rt.empty(),void 0,A),yn());else{const ve=Zr.current;if(De==="multi"&&(y.shiftKey||y.isLongTouch===!0)&&ve!==void 0&&z.hasIndex(ve)){const wt=[Math.min(ve,Y),Math.max(ve,Y)+1];U?lt(void 0,wt,A):lt(rt.fromSingleSelection(wt),void 0,A)}else U?(z.hasIndex(Y)?lt(z.remove(Y),void 0,A):lt(void 0,Y,A),Zr.current=Y):De!=="none"&&(z.hasIndex(Y)?lt(z.remove(Y),void 0,A):lt(rt.fromSingleSelection(Y),void 0,A),Zr.current=Y);gr.current=void 0,yn()}else y.kind===Ln?_r.current=[Y,j]:y.kind===aa&&!y.isMaybeScrollbar&&(me(No,!1),o(void 0),yn(),Tt?.(),gr.current=void 0,Zr.current=void 0)},[ne,De,K,Pn,B,Wt,Ve,kn,Rn,Pe,yn,ye,ct,Mi,St,ko,Kr,Nn,Pr,dr,Fe,lt,me,Tt]),Ei=d.useRef(!1),_r=d.useRef(),bl=d.useRef(Dr),Yn=d.useRef(),Df=d.useCallback(y=>{if(Jr.current=!1,bl.current=jt.current,y.button!==0&&y.button!==1){Yn.current=void 0;return}const A=performance.now();Yn.current={button:y.button,time:A,location:y.location},y?.kind==="header"&&(Ei.current=!0);const L=y.kind==="cell"&&y.isFillHandle;!L&&y.kind!=="cell"&&y.isEdge||(u({previousSelection:K,fillHandle:L}),_r.current=void 0,!y.isTouch&&y.button===0&&!L?Ri(y):!y.isTouch&&y.button===1&&(_r.current=y.location))},[K,Ri]),[Pa,_a]=d.useState(),wl=d.useCallback(y=>{if(y.kind!==Ln||De!=="multi")return;const A=oa.value?y.metaKey:y.ctrlKey,[L]=y.location,U=K.columns;if(L<B)return;const Y=mt[L];let j=L,z=L;for(let W=L-1;W>=B&&to(Y.group,mt[W].group);W--)j--;for(let W=L+1;W<mt.length&&to(Y.group,mt[W].group);W++)z++;if(yn(),A)if(U.hasAll([j,z+1])){let W=U;for(let ee=j;ee<=z;ee++)W=W.remove(ee);lt(W,void 0,A)}else lt(void 0,[j,z+1],A);else lt(rt.fromSingleSelection([j,z+1]),void 0,A)},[De,yn,K.columns,mt,B,lt]),Jr=d.useRef(!1),Mo=d.useCallback(async y=>{if(on!==void 0&&Me!==void 0){const A=jt.current.y,L=jt.current.height;let U=on({x:y,y:A,width:1,height:Math.min(L,Ve-A)},un.current.signal);typeof U!="object"&&(U=await U());const Y=sn[y-B],z=document.createElement("canvas").getContext("2d",{alpha:!1});if(z!==null){z.font=at.baseFontFull;const W=bd(z,at,Y,0,U,Gn,Ir,!1,ct);Me?.(Y,W.width,y,W.width)}}},[sn,on,Ir,at,Gn,Me,B,Ve,ct]),[Of,Fa]=d.useState(),Qr=d.useCallback(async(y,A)=>{const L=y.current?.range;if(L===void 0||on===void 0||A.current===void 0)return;const U=A.current.range;if(M!==void 0){let W=!1;if(M({fillDestination:{...U,x:U.x-B},patternSource:{...L,x:L.x-B},preventDefault:()=>W=!0}),W)return}let Y=on(L,un.current.signal);typeof Y!="object"&&(Y=await Y());const j=Y,z=[];for(let W=0;W<U.width;W++)for(let ee=0;ee<U.height;ee++){const se=[U.x+W,U.y+ee];if(sd(se,L))continue;const ve=j[ee%L.height][W%L.width];ui(ve)||!Yi(ve)||z.push({location:se,value:{...ve}})}_n(z),mn.current?.damage(z.map(W=>({cell:W.location})))},[on,_n,M,B]),yl=d.useCallback(()=>{if(K.current===void 0||K.current.range.width<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,width:1}}};Qr(y,K)},[Qr,K]),Cl=d.useCallback(()=>{if(K.current===void 0||K.current.range.height<=1)return;const y={...K,current:{...K.current,range:{...K.current.range,height:1}}};Qr(y,K)},[Qr,K]),Pf=d.useCallback((y,A)=>{const L=l;if(u(void 0),Ta(void 0),Fa(void 0),Ei.current=!1,A)return;if(L?.fillHandle===!0&&K.current!==void 0&&L.previousSelection?.current!==void 0){if(Or===void 0)return;const ve={...K,current:{...K.current,range:xd(L.previousSelection.current.range,Or)}};Qr(L.previousSelection,ve),me(ve,!0);return}const[U,Y]=y.location,[j,z]=_r.current??[],W=()=>{Jr.current=!0},ee=ve=>{const wt=ve.isTouch||j===U&&z===Y;if(wt&&O?.([U-B,Y],{...ve,preventDefault:W}),ve.button===1)return!Jr.current;if(!Jr.current){const nt=Rn(y.location),Ke=ct(nt);if(Ke!==void 0&&Ke.onClick!==void 0&&wt){const ht=Ke.onClick({...ve,cell:nt,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Mi(nt,y.location),preventDefault:W});ht!==void 0&&!ui(ht)&&si(ht)&&(_n([{location:ve.location,value:ht}]),mn.current?.damage([{cell:ve.location}]))}if(Jr.current||K.current===void 0)return!1;let Ze=!1;switch(nt.activationBehaviorOverride??Je){case"double-click":case"second-click":{if(L?.previousSelection?.current?.cell===void 0)break;const[ht,Mt]=K.current.cell,[vt,ti]=L.previousSelection.current.cell;Ze=U===ht&&U===vt&&Y===Mt&&Y===ti&&(ve.isDoubleClick===!0||Je==="second-click");break}case"single-click":{Ze=!0;break}}if(Ze)return R?.([U-B,Y]),jr(ve.bounds,!1),!0}return!1},se=y.location[0]-B;if(y.isTouch){const ve=jt.current,wt=bl.current;if(ve.x!==wt.x||ve.y!==wt.y)return;if(y.isLongTouch===!0){if(y.kind==="cell"&&Ki(K.current?.cell,y.location)){q?.([se,y.location[1]],{...y,preventDefault:W});return}else if(y.kind==="header"&&K.columns.hasIndex(U)){oe?.(se,{...y,preventDefault:W});return}else if(y.kind===Ln){if(se<0)return;J?.(se,{...y,preventDefault:W});return}}y.kind==="cell"?ee(y)||Ri(y):y.kind===Ln?$?.(se,{...y,preventDefault:W}):(y.kind===wr&&C?.(se,{...y,preventDefault:W}),Ri(y));return}if(y.kind==="header"){if(se<0)return;y.isEdge?y.isDoubleClick===!0&&Mo(U):y.button===0&&U===j&&Y===z&&C?.(se,{...y,preventDefault:W})}if(y.kind===Ln){if(se<0)return;y.button===0&&U===j&&Y===z&&($?.(se,{...y,preventDefault:W}),Jr.current||wl(y))}y.kind==="cell"&&(y.button===0||y.button===1)&&ee(y),_r.current=void 0},[l,K,B,Or,Qr,me,O,Rn,ct,Je,Mi,_n,R,jr,q,oe,J,Ri,$,C,Mo,wl]),_f=d.useCallback(y=>{const A={...y,location:[y.location[0]-B,y.location[1]]};Ie?.(A),l!==void 0&&y.buttons===0&&(u(void 0),Ta(void 0),Fa(void 0),Ei.current=!1),Fa(L=>Ei.current?[y.scrollEdge[0],0]:y.scrollEdge[0]===L?.[0]&&y.scrollEdge[1]===L[1]?L:l===void 0||(Yn.current?.location[0]??0)<B?void 0:y.scrollEdge)},[l,Ie,B]),Ff=d.useCallback((y,A)=>{qe?.(y-B,A)},[qe,B]),Lf=d.useCallback((y,A)=>{pt?.(y-B,A)},[pt,B]),ei=K?.current?.cell,Af=d.useCallback((y,A,L,U,Y,j)=>{fr.current=!1;let z=ei;z!==void 0&&(z=[z[0]-B,z[1]]);const W=Oe===0?void 0:{x:0,y:y.y,width:Oe,height:y.height},ee=[];W!==void 0&&ee.push(W),Yt>0&&(ee.push({x:y.x-B,y:Ve-Yt,width:y.width,height:Yt}),Oe>0&&ee.push({x:0,y:Ve-Yt,width:Oe,height:Yt}));const se={x:y.x-B,y:y.y,width:y.width,height:Wt&&y.y+y.height>=Ve?y.height-1:y.height,tx:Y,ty:j,extras:{selected:z,freezeRegion:W,freezeRegions:ee}};jt.current=se,hr(se),Gt([A,L,U]),tn?.(se,se.tx,se.ty,se.extras)},[ei,B,Wt,Ve,Oe,Yt,hr,tn]),Hf=br(I,d.useCallback((y,A)=>I?.(y-B,A-B)!==!1,[I,B])),zf=br(et,d.useCallback((y,A)=>{et?.(y-B,A-B),De!=="none"&<(rt.fromSingleSelection(A),void 0,!0)},[De,et,B,lt])),La=d.useRef(!1),Vf=d.useCallback(y=>{if(y.location[0]===0&&B>0){y.preventDefault();return}ze?.({...y,location:[y.location[0]-B,y.location[1]]}),y.defaultPrevented()||(La.current=!0),u(void 0)},[ze,B]),Nf=d.useCallback(()=>{La.current=!1},[]),Sl=We?.selectionBehavior,Ro=d.useCallback(y=>{if(Sl!=="block-spanning")return;const{isGroupHeader:A,path:L,groupRows:U}=Pr(y);if(A)return[y,y];const Y=L[L.length-1],j=y-Y,z=y+U-Y-1;return[j,z]},[Pr,Sl]),Aa=d.useRef(),Ha=d.useCallback(y=>{if(!Td(y,Aa.current)&&(Aa.current=y,!(Yn?.current?.button!==void 0&&Yn.current.button>=1))){if(y.buttons!==0&&l!==void 0&&Yn.current?.location[0]===0&&y.location[0]===0&&B===1&&ne==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Yn.current.location[1])&&K.rows.hasIndex(Yn.current.location[1])){const A=Math.min(Yn.current.location[1],y.location[1]),L=Math.max(Yn.current.location[1],y.location[1])+1;St(rt.fromSingleSelection([A,L]),void 0,!1)}if(y.buttons!==0&&l!==void 0&&K.current!==void 0&&!La.current&&!Ei.current&&(yt==="rect"||yt==="multi-rect")){const[A,L]=K.current.cell;let[U,Y]=y.location;if(Y<0&&(Y=jt.current.y),l.fillHandle===!0&&l.previousSelection?.current!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,Wt?Ve-1:Ve);const z=Lp(j,U,Y,je);Ta(z)}else{if(Wt&&L===Ve)return;if(Wt&&Y===Ve)if(y.kind===aa)Y--;else return;U=Math.max(U,B);const W=Ro(L);Y=W===void 0?Y:Fn(Y,W[0],W[1]);const ee=U-A,se=Y-L,ve={x:ee>=0?A:U,y:se>=0?L:Y,width:Math.abs(ee)+1,height:Math.abs(se)+1};Fe({...K.current,range:ve},!0,!1,"drag")}}qt?.({...y,location:[y.location[0]-B,y.location[1]]})}},[l,B,ne,K,yt,qt,St,Wt,Ve,je,Ro,Fe]),$f=d.useCallback(()=>{const y=Aa.current;if(y===void 0)return;const[A,L]=y.scrollEdge;let[U,Y]=y.location;const j=jt.current;A===-1?U=j.extras?.freezeRegion?.x??j.x:A===1&&(U=j.x+j.width),L===-1?Y=Math.max(0,j.y):L===1&&(Y=Math.min(Ve-1,j.y+j.height)),U=Fn(U,0,mt.length-1),Y=Fn(Y,0,Ve-1),Ha({...y,location:[U,Y]})},[mt.length,Ha,Ve]);U0(Of,Ut,$f);const $n=d.useCallback(y=>{if(K.current===void 0)return;const[A,L]=y,[U,Y]=K.current.cell,j=K.current.range;let z=j.x,W=j.x+j.width,ee=j.y,se=j.y+j.height;const[ve,wt]=Ro(Y)??[0,Ve-1],nt=wt+1;if(L!==0)switch(L){case 2:{se=nt,ee=Y,Zt(0,se,"vertical");break}case-2:{ee=ve,se=Y+1,Zt(0,ee,"vertical");break}case 1:{ee<Y?(ee++,Zt(0,ee,"vertical")):(se=Math.min(nt,se+1),Zt(0,se,"vertical"));break}case-1:{se>Y+1?(se--,Zt(0,se,"vertical")):(ee=Math.max(ve,ee-1),Zt(0,ee,"vertical"));break}default:eo()}if(A!==0)if(A===2)W=mt.length,z=U,Zt(W-1-B,0,"horizontal");else if(A===-2)z=B,W=U+1,Zt(z-B,0,"horizontal");else{let Ke=[];if(on!==void 0){const Ze=on({x:z,y:ee,width:W-z-B,height:se-ee},un.current.signal);typeof Ze=="object"&&(Ke=ev(Ze))}if(A===1){let Ze=!1;if(z<U){if(Ke.length>0){const ht=Cr(z+1,U+1).find(Mt=>!Ke.includes(Mt-B));ht!==void 0&&(z=ht,Ze=!0)}else z++,Ze=!0;Ze&&Zt(z,0,"horizontal")}Ze||(W=Math.min(mt.length,W+1),Zt(W-1-B,0,"horizontal"))}else if(A===-1){let Ze=!1;if(W>U+1){if(Ke.length>0){const ht=Cr(W-1,U,-1).find(Mt=>!Ke.includes(Mt-B));ht!==void 0&&(W=ht,Ze=!0)}else W--,Ze=!0;Ze&&Zt(W-B,0,"horizontal")}Ze||(z=Math.max(B,z-1),Zt(z-B,0,"horizontal"))}else eo()}Fe({cell:K.current.cell,range:{x:z,y:ee,width:W-z,height:se-ee}},!0,!1,"keyboard-select")},[on,Ro,K,mt.length,B,Ve,Zt,Fe]),za=d.useRef(vi);za.current=vi;const mr=d.useCallback((y,A,L,U)=>{const Y=pn-(L?0:1);y=Fn(y,B,sn.length-1+B),A=Fn(A,0,Y);const j=ei?.[0],z=ei?.[1];if(y===j&&A===z)return!1;if(U&&K.current!==void 0){const W=[...K.current.rangeStack];(K.current.range.width>1||K.current.range.height>1)&&W.push(K.current.range),me({...K,current:{cell:[y,A],range:{x:y,y:A,width:1,height:1},rangeStack:W}},!0)}else Fe({cell:[y,A],range:{x:y,y:A,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===y&&c.current[1]===A&&(c.current=void 0),za.current&&Zt(y-B,A),!0},[pn,B,sn.length,ei,K,Zt,me,Fe]),Bf=d.useCallback((y,A)=>{i?.cell!==void 0&&y!==void 0&&si(y)&&(_n([{location:i.cell,value:y}]),window.requestAnimationFrame(()=>{mn.current?.damage([{cell:i.cell}])})),yn(!0),o(void 0);const[L,U]=A;if(K.current!==void 0&&(L!==0||U!==0)){const Y=K.current.cell[1]===pn-1&&y!==void 0;mr(Fn(K.current.cell[0]+L,0,mt.length-1),Fn(K.current.cell[1]+U,0,pn-1),Y,!1)}_?.(y,A)},[i?.cell,yn,K,_,_n,pn,mr,mt.length]),Wf=d.useMemo(()=>`gdg-overlay-${Q0++}`,[]),Fr=d.useCallback(y=>{yn();const A=[];for(let L=y.x;L<y.x+y.width;L++)for(let U=y.y;U<y.y+y.height;U++){const Y=S([L-B,U]);if(!Y.allowOverlay&&Y.kind!==Z.Boolean)continue;let j;if(Y.kind===Z.Custom){const z=ct(Y),W=z?.provideEditor?.({...Y,location:[L-B,U]});z?.onDelete!==void 0?j=z.onDelete(Y):Eg(W)&&(j=W?.deletedValue?.(Y))}else(si(Y)&&Y.allowOverlay||Y.kind===Z.Boolean)&&(j=ct(Y)?.onDelete?.(Y));j!==void 0&&!ui(j)&&si(j)&&A.push({location:[L,U],value:j})}_n(A),mn.current?.damage(A.map(L=>({cell:L.location})))},[yn,S,ct,_n,B]),Ii=i!==void 0,xl=d.useCallback(y=>{const A=()=>{y.stopPropagation(),y.preventDefault()},L={didMatch:!1},{bounds:U}=y,Y=K.columns,j=K.rows,z=On;if(!Ii&&it(z.clear,y,L))me(No,!1),Tt?.();else if(!Ii&&it(z.selectAll,y,L))me({columns:rt.empty(),rows:rt.empty(),current:{cell:K.current?.cell??[B,0],range:{x:B,y:0,width:b.length,height:Ve},rangeStack:[]}},!1);else if(it(z.search,y,L))s?.current?.focus({preventScroll:!0}),Xr(!0);else if(it(z.delete,y,L)){const ht=Ue?.(K)??!0;if(ht!==!1){const Mt=ht===!0?K:ht;if(Mt.current!==void 0){Fr(Mt.current.range);for(const vt of Mt.current.rangeStack)Fr(vt)}for(const vt of Mt.rows)Fr({x:B,y:vt,width:b.length,height:1});for(const vt of Mt.columns)Fr({x:vt,y:0,width:1,height:Ve})}}if(L.didMatch)return A(),!0;if(K.current===void 0)return!1;let[W,ee]=K.current.cell;const[,se]=K.current.cell;let ve=!1,wt=!1;if(it(z.scrollToSelectedCell,y,L)?To.current(W-B,ee):De!=="none"&&it(z.selectColumn,y,L)?Y.hasIndex(W)?lt(Y.remove(W),void 0,!0):De==="single"?lt(rt.fromSingleSelection(W),void 0,!0):lt(void 0,W,!0):ne!=="none"&&it(z.selectRow,y,L)?j.hasIndex(ee)?St(j.remove(ee),void 0,!0):ne==="single"?St(rt.fromSingleSelection(ee),void 0,!0):St(void 0,ee,!0):!Ii&&U!==void 0&&it(z.activateCell,y,L)?ee===Ve&&Wt?window.setTimeout(()=>{const ht=ko(W);Kr(ht??W)},0):(R?.([W-B,ee]),jr(U,!0)):K.current.range.height>1&&it(z.downFill,y,L)?Cl():K.current.range.width>1&&it(z.rightFill,y,L)?yl():it(z.goToNextPage,y,L)?ee+=Math.max(1,jt.current.height-4):it(z.goToPreviousPage,y,L)?ee-=Math.max(1,jt.current.height-4):it(z.goToFirstCell,y,L)?(o(void 0),ee=0,W=0):it(z.goToLastCell,y,L)?(o(void 0),ee=Number.MAX_SAFE_INTEGER,W=Number.MAX_SAFE_INTEGER):it(z.selectToFirstCell,y,L)?(o(void 0),$n([-2,-2])):it(z.selectToLastCell,y,L)?(o(void 0),$n([2,2])):Ii?(it(z.closeOverlay,y,L)&&o(void 0),it(z.acceptOverlayDown,y,L)&&(o(void 0),ee++),it(z.acceptOverlayUp,y,L)&&(o(void 0),ee--),it(z.acceptOverlayLeft,y,L)&&(o(void 0),W--),it(z.acceptOverlayRight,y,L)&&(o(void 0),W++)):(it(z.goDownCell,y,L)?ee+=1:it(z.goUpCell,y,L)?ee-=1:it(z.goRightCell,y,L)?W+=1:it(z.goLeftCell,y,L)?W-=1:it(z.goDownCellRetainSelection,y,L)?(ee+=1,ve=!0):it(z.goUpCellRetainSelection,y,L)?(ee-=1,ve=!0):it(z.goRightCellRetainSelection,y,L)?(W+=1,ve=!0):it(z.goLeftCellRetainSelection,y,L)?(W-=1,ve=!0):it(z.goToLastRow,y,L)?ee=Ve-1:it(z.goToFirstRow,y,L)?ee=Number.MIN_SAFE_INTEGER:it(z.goToLastColumn,y,L)?W=Number.MAX_SAFE_INTEGER:it(z.goToFirstColumn,y,L)?W=Number.MIN_SAFE_INTEGER:(yt==="rect"||yt==="multi-rect")&&(it(z.selectGrowDown,y,L)?$n([0,1]):it(z.selectGrowUp,y,L)?$n([0,-1]):it(z.selectGrowRight,y,L)?$n([1,0]):it(z.selectGrowLeft,y,L)?$n([-1,0]):it(z.selectToLastRow,y,L)?$n([0,2]):it(z.selectToFirstRow,y,L)?$n([0,-2]):it(z.selectToLastColumn,y,L)?$n([2,0]):it(z.selectToFirstColumn,y,L)&&$n([-2,0])),wt=L.didMatch),Nn!==void 0&&Nn!=="normal"&&ee!==se){const ht=Nn==="skip-up"||Nn==="skip"||Nn==="block",Mt=Nn==="skip-down"||Nn==="skip"||Nn==="block",vt=ee<se;if(vt&&ht){for(;ee>=0&&Pr(ee).isGroupHeader;)ee--;ee<0&&(ee=se)}else if(!vt&&Mt){for(;ee<Ve&&Pr(ee).isGroupHeader;)ee++;ee>=Ve&&(ee=se)}}const Ke=mr(W,ee,!1,ve),Ze=L.didMatch;return Ze&&(Ke||!wt||kt)&&A(),Ze},[Nn,Ii,K,On,De,ne,yt,B,Pr,Ve,mr,me,Tt,b.length,Ue,kt,Fr,lt,St,Wt,ko,Kr,R,jr,Cl,yl,$n]),Ti=d.useCallback(y=>{let A=!1;if(G!==void 0&&G({...y,...y.location&&{location:[y.location[0]-B,y.location[1]]},cancel:()=>{A=!0}}),A||xl(y)||K.current===void 0)return;const[L,U]=K.current.cell,Y=jt.current;if(ke&&!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&&Yi(S([L-B,Math.max(0,Math.min(U,Ve-1))]))){if((!Wt||U!==Ve)&&(Y.y>U||U>Y.y+Y.height||Y.x>L||L>Y.x+Y.width))return;R?.([L-B,U]),jr(y.bounds,!0,y.key),y.stopPropagation(),y.preventDefault()}},[ke,G,xl,K,S,B,Ve,Wt,R,jr]),Uf=d.useCallback((y,A)=>{const L=y.location[0]-B;if(y.kind==="header"&&oe?.(L,{...y,preventDefault:A}),y.kind===Ln){if(L<0)return;J?.(L,{...y,preventDefault:A})}if(y.kind==="cell"){const[U,Y]=y.location;q?.([L,Y],{...y,preventDefault:A}),Dm(K,y.location)||mr(U,Y,!1,!1)}},[K,q,J,oe,B,mr]),Va=d.useCallback(async y=>{if(!On.paste)return;function A(z,W,ee,se){const ve=typeof ee=="object"?ee?.join(`
|
173
173
|
`)??"":ee?.toString()??"";if(!ui(z)&&Yi(z)&&z.readonly!==!0){const wt=E?.(ve,z);if(wt!==void 0&&si(wt))return{location:W,value:wt};const nt=ct(z);if(nt===void 0)return;if(nt.kind===Z.Custom){Tn(z.kind===Z.Custom);const Ke=nt.onPaste?.(ve,z.data);return Ke===void 0?void 0:{location:W,value:{...z,data:Ke}}}else{const Ke=nt.onPaste?.(ve,z,{formatted:se,formattedString:typeof se=="string"?se:se?.join(`
|
174
174
|
`),rawValue:ee});return Ke===void 0?void 0:(Tn(Ke.kind===z.kind),{location:W,value:Ke})}}}const L=K.columns,U=K.rows,Y=Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0;let j;if(K.current!==void 0?j=[K.current.range.x,K.current.range.y]:L.length===1?j=[L.first()??0,0]:U.length===1&&(j=[B,U.first()??0]),Y&&j!==void 0){let z,W;const ee="text/plain",se="text/html";if(navigator.clipboard.read!==void 0){const Ke=await navigator.clipboard.read();for(const Ze of Ke){if(Ze.types.includes(se)){const Mt=await(await Ze.getType(se)).text(),vt=Eu(Mt);if(vt!==void 0){z=vt;break}}Ze.types.includes(ee)&&(W=await(await Ze.getType(ee)).text())}}else if(navigator.clipboard.readText!==void 0)W=await navigator.clipboard.readText();else if(y!==void 0&&y?.clipboardData!==null){if(y.clipboardData.types.includes(se)){const Ke=y.clipboardData.getData(se);z=Eu(Ke)}z===void 0&&y.clipboardData.types.includes(ee)&&(W=y.clipboardData.getData(ee))}else return;const[ve,wt]=j,nt=[];do{if(tt===void 0){const Ke=Rn(j),Ze=W??z?.map(Mt=>Mt.map(vt=>vt.rawValue).join(" ")).join(" ")??"",ht=A(Ke,j,Ze,void 0);ht!==void 0&&nt.push(ht);break}if(z===void 0){if(W===void 0)return;z=H0(W)}if(tt===!1||typeof tt=="function"&&tt?.([j[0]-B,j[1]],z.map(Ke=>Ke.map(Ze=>Ze.rawValue?.toString()??"")))!==!0)return;for(const[Ke,Ze]of z.entries()){if(Ke+wt>=Ve)break;for(const[ht,Mt]of Ze.entries()){const vt=[ht+ve,Ke+wt],[ti,Oi]=vt;if(ti>=mt.length||Oi>=pn)continue;const Pi=Rn(vt),Xn=A(Pi,vt,Mt.rawValue,Mt.formatted);Xn!==void 0&&nt.push(Xn)}}}while(!1);_n(nt),mn.current?.damage(nt.map(Ke=>({cell:Ke.location})))}},[E,ct,Rn,K,On.paste,Ut,mt.length,_n,pn,tt,B,Ve]);dn("paste",Va,f,!1,!0);const Di=d.useCallback(async(y,A)=>{if(!On.copy)return;const L=A===!0||Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0,U=K.columns,Y=K.rows,j=(z,W)=>{if(!Te)Tu(z,W,y);else{const ee=W.map(se=>({kind:Z.Text,data:b[se].title,displayData:b[se].title,allowOverlay:!1}));Tu([ee,...z],W,y)}};if(L&&on!==void 0){if(K.current!==void 0){let z=on(K.current.range,un.current.signal);typeof z!="object"&&(z=await z()),j(z,Cr(K.current.range.x-B,K.current.range.x+K.current.range.width-B))}else if(Y!==void 0&&Y.length>0){const W=[...Y].map(ee=>{const se=on({x:B,y:ee,width:b.length,height:1},un.current.signal);return typeof se=="object"?se[0]:se().then(ve=>ve[0])});if(W.some(ee=>ee instanceof Promise)){const ee=await Promise.all(W);j(ee,Cr(b.length))}else j(W,Cr(b.length))}else if(U.length>0){const z=[],W=[];for(const ee of U){let se=on({x:ee,y:0,width:1,height:Ve},un.current.signal);typeof se!="object"&&(se=await se()),z.push(se),W.push(ee-B)}if(z.length===1)j(z[0],W);else{const ee=z.reduce((se,ve)=>se.map((wt,nt)=>[...wt,...ve[nt]]));j(ee,W)}}}},[b,on,K,On.copy,B,Ut,Ve,Te]);dn("copy",Di,f,!1,!1);const qf=d.useCallback(async y=>{if(!(!On.cut||!(Ut.current?.contains(document.activeElement)===!0||a.current?.contains(document.activeElement)===!0))&&(await Di(y),K.current!==void 0)){let L={current:{cell:K.current.cell,range:K.current.range,rangeStack:[]},rows:rt.empty(),columns:rt.empty()};const U=Ue?.(L);if(U===!1||(L=U===!0?L:U,L.current===void 0))return;Fr(L.current.range)}},[Fr,K,On.cut,Di,Ut,Ue]);dn("cut",qf,f,!1,!1);const Gf=d.useCallback((y,A)=>{if(fe!==void 0){B!==0&&(y=y.map(Y=>[Y[0]-B,Y[1]])),fe(y,A);return}if(y.length===0||A===-1)return;const[L,U]=y[A];c.current!==void 0&&c.current[0]===L&&c.current[1]===U||(c.current=[L,U],mr(L,U,!1,!1))},[fe,B,mr]),[Eo,Io]=zt?.current?.cell??[],To=d.useRef(Zt);To.current=Zt,d.useLayoutEffect(()=>{za.current&&!fr.current&&Eo!==void 0&&Io!==void 0&&(Eo!==ie.current?.current?.cell[0]||Io!==ie.current?.current?.cell[1])&&To.current(Eo,Io),fr.current=!1},[Eo,Io]);const kl=K.current!==void 0&&(K.current.cell[0]>=mt.length||K.current.cell[1]>=pn);d.useLayoutEffect(()=>{kl&&me(No,!1)},[kl,me]);const Yf=d.useMemo(()=>Wt===!0&&Ft?.tint===!0?rt.fromSingleSelection(pn-1):rt.empty(),[pn,Wt,Ft?.tint]),Xf=d.useCallback(y=>typeof ln=="boolean"?ln:ln?.(y-B)??!0,[B,ln]),jf=d.useMemo(()=>{if(Pa===void 0||a.current===null)return null;const{bounds:y,group:A}=Pa,L=a.current.getBoundingClientRect();return d.createElement(R0,{bounds:y,group:A,canvasBounds:L,onClose:()=>_a(void 0),onFinish:U=>{_a(void 0),te?.(A,U)}})},[te,Pa]),Kf=Math.min(mt.length,Oe+(Pn?1:0));d.useImperativeHandle(t,()=>({appendRow:(y,A)=>Kr(y+B,A),updateCells:y=>(B!==0&&(y=y.map(A=>({cell:[A.cell[0]+B,A.cell[1]]}))),mn.current?.damage(y)),getBounds:(y,A)=>{if(!(a?.current===null||Ut?.current===null)){if(y===void 0&&A===void 0){const L=a.current.getBoundingClientRect(),U=L.width/Ut.current.clientWidth;return{x:L.x-Ut.current.scrollLeft*U,y:L.y-Ut.current.scrollTop*U,width:Ut.current.scrollWidth*U,height:Ut.current.scrollHeight*U}}return mn.current?.getBounds((y??0)+B,A)}},focus:()=>mn.current?.focus(),emit:async y=>{switch(y){case"delete":Ti({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":Ti({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":Ti({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 Di(void 0,!0);break;case"paste":await Va();break}},scrollTo:Zt,remeasureColumns:y=>{for(const A of y)Mo(A+B)},getMouseArgsForPosition:(y,A,L)=>{if(mn?.current===null)return;const U=mn.current.getMouseArgsForPosition(y,A,L);if(U!==void 0)return{...U,location:[U.location[0]-B,U.location[1]]}}}),[Kr,Mo,Ut,Di,Ti,Va,B,Zt]);const[Ml,Rl]=ei??[],Zf=d.useCallback(y=>{const[A,L]=y;if(L===-1){De!=="none"&&(lt(rt.fromSingleSelection(A),void 0,!1),yn());return}Ml===A&&Rl===L||(Fe({cell:y,range:{x:A,y:L,width:1,height:1}},!0,!1,"keyboard-nav"),Zt(A,L))},[De,yn,Zt,Ml,Rl,Fe,lt]),[Jf,Qf]=d.useState(!1),El=d.useRef(Xc(y=>{Qf(y)},5)),eh=d.useCallback(()=>{El.current(!0),K.current===void 0&&K.columns.length===0&&K.rows.length===0&&l===void 0&&Fe({cell:[B,wo],range:{x:B,y:wo,width:1,height:1}},!0,!1,"keyboard-select")},[wo,K,l,B,Fe]),th=d.useCallback(()=>{El.current(!1)},[]),[nh,rh]=d.useMemo(()=>{let y;const A=Qt?.scrollbarWidthOverride??ws(),L=Ve+(Wt?1:0);if(typeof zn=="number")y=Rt+L*zn;else{let Y=0;const j=Math.min(L,10);for(let z=0;z<j;z++)Y+=zn(z);Y=Math.floor(Y/j),y=Rt+L*Y}y+=A;const U=mt.reduce((Y,j)=>j.width+Y,0)+A;return[`${Math.min(1e5,U)}px`,`${Math.min(1e5,y)}px`]},[mt,Qt?.scrollbarWidthOverride,zn,Ve,Wt,Rt]),ih=d.useMemo(()=>Um(at),[at]);return d.createElement(vd.Provider,{value:at},d.createElement($0,{style:ih,className:X,inWidth:p??nh,inHeight:w??rh},d.createElement(S0,{fillHandle:Et,drawFocusRing:Rr,experimental:Qt,fixedShadowX:Lt,fixedShadowY:At,getRowThemeOverride:ur,headerIcons:xn,imageWindowLoader:Un,initialSize:Hn,isDraggable:N,onDragLeave:Be,onRowMoved:Pe,overscrollX:Ma,overscrollY:Ra,preventDiagonalScrolling:ge,rightElement:bt,rightElementProps:en,smoothScrollX:Bt,smoothScrollY:an,className:X,enableGroups:tr,onCanvasFocused:eh,onCanvasBlur:th,canvasRef:a,onContextMenu:Uf,theme:at,cellXOffset:If,cellYOffset:wo,accessibilityHeight:Dr.height,onDragEnd:Nf,columns:mt,nonGrowWidth:Tr,drawHeader:Ye,onColumnProposeMove:Hf,drawCell:we,disabledRows:Yf,freezeColumns:Kf,lockColumns:B,firstColAccessible:B===0,getCellContent:Rn,minColumnWidth:Gn,maxColumnWidth:Ir,searchInputRef:s,showSearch:xi,onSearchClose:Ea,highlightRegions:Tf,getCellsForSelection:on,getGroupDetails:Da,headerHeight:Si,isFocused:Jf,groupHeaderHeight:tr?vo:0,freezeTrailingRows:Yt+(Wt&&Ft?.sticky===!0?1:0),hasAppendRow:Wt,onColumnResize:Me,onColumnResizeEnd:de,onColumnResizeStart:be,onCellFocused:Zf,onColumnMoved:zf,onDragStart:Vf,onHeaderMenuClick:Ff,onHeaderIndicatorClick:Lf,onItemHovered:Ha,isFilling:l?.fillHandle===!0,onMouseMove:_f,onKeyDown:Ti,onKeyUp:ue,onMouseDown:Df,onMouseUp:Pf,onDragOverCell:rn,onDrop:hn,onSearchResultsChanged:Gf,onVisibleRegionChanged:Af,clientSize:dt,rowHeight:zn,searchResults:re,searchValue:P,onSearchValueChange:H,rows:pn,scrollRef:Ut,selection:K,translateX:Dr.tx,translateY:Dr.ty,verticalBorder:Xf,gridRef:mn,getCellRenderer:ct,resizeIndicator:ka}),jf,i!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(J0,{...i,validateCell:V,bloom:D,id:Wf,getCellRenderer:ct,className:Qt?.isSubGrid===!0?"click-outside-ignore":void 0,provideEditor:Ct,imageEditorOverride:g,onFinishEditing:Bf,markdownDivCreateNode:m,isOutsideClick:lr,customEventTarget:Qt?.eventTarget}))))},nv=d.forwardRef(tv);function Pu(e){const{cell:t,posX:n,posY:r,bounds:i,theme:o}=e,{width:s,height:a,x:l,y:u}=i,c=t.maxSize??o.checkboxMaxSize,f=Math.floor(i.y+a/2),g=Zc(c,a,o.cellVerticalPadding),h=Kc(t.contentAlign??"center",l,s,o.cellHorizontalPadding,g),m=jc(h,f,g),p=Jc(l+n,u+r,m);return Hs(t)&&p}const rv={getAccessibilityString:e=>e.data?.toString()??"false",kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>iv(e,e.cell.data,Hs(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Pu(e)&&e.preventDefault()},onClick:e=>{if(Pu(e))return{...e.cell,data:Od(e.cell.data)}},onPaste:(e,t)=>{let n=ea;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=As),n===t.data?void 0:{...t,data:n}}};function iv(e,t,n,r,i){if(!n&&t===ea)return;const{ctx:o,hoverAmount:s,theme:a,rect:l,highlighted:u,hoverX:c,hoverY:f,cell:{contentAlign:g}}=e,{x:h,y:m,width:p,height:w}=l;let b=!1;if(i>0){let v=n?1-i+i*s:.4;if(t===ea&&(v*=s),v===0)return;v<1&&(b=!0,o.globalAlpha=v)}Xs(o,a,t,h,m,p,w,u,c,f,r,g),b&&(o.globalAlpha=1)}const ov=fn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),av=e=>{const{bubbles:t}=e;return d.createElement(ov,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},sv={getAccessibilityString:e=>Qc(e.data),kind:Z.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=>lv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(av,{bubbles:t.data})},onPaste:()=>{}};function lv(e,t){const{rect:n,theme:r,ctx:i,highlighted:o}=e,{x:s,y:a,width:l,height:u}=n;let c=s+r.cellHorizontalPadding;const f=[];for(const g of t){if(c>s+l)break;const h=qr(g,i,r.baseFontFull).width;f.push({x:c,width:h}),c+=h+r.bubblePadding*2+r.bubbleMargin}i.beginPath();for(const g of f)Kn(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 f.entries())i.beginPath(),i.fillStyle=r.textBubble,i.fillText(t[g],h.x+r.bubblePadding,a+u/2+Zn(i,r))}const uv=fn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),cv=e=>{const{drilldowns:t}=e;return d.createElement(uv,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},dv={getAccessibilityString:e=>Qc(e.data.map(t=>t.text)),kind:Z.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=>hv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(cv,{drilldowns:t.data})},onPaste:()=>{}},os={};function fv(e,t,n,r){const i=Math.ceil(window.devicePixelRatio),o=5,s=n-o*2,a=4,l=n*i,u=r+o,c=r*3,f=(c+o*2)*i,g=`${e},${t},${i},${n}`;if(os[g]!==void 0)return{el:os[g],height:l,width:f,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=f,h.height=l,m.scale(i,i),os[g]=h,m.beginPath(),Kn(m,o,o,c,s,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(),Kn(m,o+.5,o+.5,c,s,r),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:f,sideWidth:u*i,middleWidth:r*i,padding:o*i,dpr:i})}function hv(e,t){const{rect:n,theme:r,ctx:i,imageLoader:o,col:s,row:a}=e,{x:l,width:u}=n,c=r.baseFontFull,f=Us(i,c),g=Math.min(n.height,Math.max(16,Math.ceil(f*r.lineHeight)*2)),h=Math.floor(n.y+(n.height-g)/2),m=g-10,p=r.bubblePadding,w=r.bubbleMargin;let b=l+r.cellHorizontalPadding;const v=r.roundingRadius??6,S=fv(r.bgCell,r.drilldownBorder,g,v),O=[];for(const R of t){if(b>l+u)break;const _=qr(R.text,i,c).width;let E=0;R.img!==void 0&&o.loadOrGetImage(R.img,s,a)!==void 0&&(E=m-8+4);const k=_+E+p*2;O.push({x:b,width:k}),b+=k+w}if(S!==null){const{el:R,height:M,middleWidth:_,sideWidth:E,width:k,dpr:F,padding:D}=S,C=E/F,I=D/F;for(const T of O){const x=Math.floor(T.x),$=Math.floor(T.width),q=$-(C-I)*2;i.imageSmoothingEnabled=!1,i.drawImage(R,0,0,E,M,x-I,h,C,g),q>0&&i.drawImage(R,E,0,_,M,x+(C-I),h,q,g),i.drawImage(R,k-E,0,E,M,x+$-(C-I),h,C,g),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[R,M]of O.entries()){const _=t[R];let E=M.x+p;if(_.img!==void 0){const k=o.loadOrGetImage(_.img,s,a);if(k!==void 0){const F=m-8;let D=0,C=0,I=k.width,T=k.height;I>T?(D+=(I-T)/2,I=T):T>I&&(C+=(T-I)/2,T=I),i.beginPath(),Kn(i,E,h+g/2-F/2,F,F,r.roundingRadius??3),i.save(),i.clip(),i.drawImage(k,D,C,I,T,E,h+g/2-F/2,F,F),i.restore(),E+=F+4}}i.beginPath(),i.fillStyle=r.textBubble,i.fillText(_.text,E,h+g/2+Zn(i,r))}}const gv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>mv(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??em;return d.createElement(i,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const r=e.split(",").map(i=>{try{return new URL(i),i}catch{return}}).filter(i=>i!==void 0);if(!(r.length===t.data.length&&r.every((i,o)=>i===t.data[o])))return{...t,data:r}}},as=4;function mv(e,t,n,r){const{rect:i,col:o,row:s,theme:a,ctx:l,imageLoader:u}=e,{x:c,y:f,height:g,width:h}=i,m=g-a.cellVerticalPadding*2,p=[];let w=0;for(let v=0;v<t.length;v++){const S=t[v];if(S.length===0)continue;const O=u.loadOrGetImage(S,o,s);if(O!==void 0){p[v]=O;const R=O.width*(m/O.height);w+=R+as}}if(w===0)return;w-=as;let b=c+a.cellHorizontalPadding;r==="right"?b=Math.floor(c+h-a.cellHorizontalPadding-w):r==="center"&&(b=Math.floor(c+h/2-w/2));for(const v of p){if(v===void 0)continue;const S=v.width*(m/v.height);n>0&&(l.beginPath(),Kn(l,b,f+a.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(v,b,f+a.cellVerticalPadding,S,m),n>0&&l.restore(),b+=S+as}}function pv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const vv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:i,rect:o,theme:s}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(pv(n,r)*t.skeletonWidthVariability));const l=s.cellHorizontalPadding;a+l*2>=o.width&&(a=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*s.cellVerticalPadding);Kn(i,o.x+l,o.y+(o.height-u)/2,a,u,s.roundingRadius??3),i.fillStyle=Nr(s.textDark,.1),i.fill()},onPaste:()=>{}},bv=()=>e=>e.targetWidth,_u=fn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[bv(),"px"]}}),wv=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:i,targetRect:o,onFinish:s,validatedSelection:a}=e,l=t.data,u=t.readonly===!0,[c,f]=d.useState(l===""||r),g=d.useCallback(()=>{f(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?d.createElement(_u,{targetWidth:o.width-20},d.createElement(Wr,{autoFocus:!0,highlight:!1,validatedSelection:a,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>s(t)},d.createElement(Yg,null))):d.createElement(_u,{targetWidth:o.width},d.createElement(wm,{contents:l,createNode:i}),!u&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:g},d.createElement(Vs,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},yv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:lo,measure:(e,t,n)=>{const r=t.data.split(`
|
175
|
-
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>jn(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:s,validatedSelection:a}=e;return d.createElement(wv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Cv={getAccessibilityString:e=>e.row.toString(),kind:An.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Sv,measure:()=>44,draw:e=>kv(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:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Sv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=xv,n.textAlign="center",o}function xv(e){const{ctx:t}=e;t.textAlign="start"}function kv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:f,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Xs(s,u,n,i?c+p:c,f,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const w of[3,6])for(const b of[-5,-1,3])s.rect(c+w,f+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),w=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=w,s.fillText(p,b,f+h/2+Zn(s,w)),l!==0&&(s.globalAlpha=1)}}const Mv={getAccessibilityString:()=>"",kind:An.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Rv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Rv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,f-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=f-8,w=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,w,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,w=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+w,u+f/2),r.lineTo(l+b+w+p,u+f/2),r.moveTo(l+b+w+p*.5,u+f/2-p*.5),r.lineTo(l+b+w+p*.5,u+f/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+f/2+Zn(r,s)),r.beginPath()}function Fd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Ev(e,i,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Ev(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=qr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,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 Iv=d.lazy(async()=>await _s(()=>import("./number-overlay-editor.
|
175
|
+
`)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>jn(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:s,validatedSelection:a}=e;return d.createElement(wv,{onFinish:i,targetRect:r,value:n,validatedSelection:a,onChange:l=>t({...n,data:l.target.value}),forceEditMode:s,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Cv={getAccessibilityString:e=>e.row.toString(),kind:An.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Sv,measure:()=>44,draw:e=>kv(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:s}=t,a=n.drawHandle?7+(o-7)/2:o/2,l=s/2;if(Math.abs(r-a)<=10&&Math.abs(i-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Sv(e,t){const{ctx:n,theme:r}=e,i=r.markerFontFull,o=t??{};return o?.font!==i&&(n.font=i,o.font=i),o.deprep=xv,n.textAlign="center",o}function xv(e){const{ctx:t}=e;t.textAlign="start"}function kv(e,t,n,r,i,o){const{ctx:s,rect:a,hoverAmount:l,theme:u}=e,{x:c,y:f,width:g,height:h}=a,m=n?1:r==="checkbox-visible"?.6+.4*l:l;if(r!=="number"&&m>0){s.globalAlpha=m;const p=7*(n?l:1);if(Xs(s,u,n,i?c+p:c,f,i?g-p:g,h,!0,void 0,void 0,u.checkboxMaxSize,"center",o),i){s.globalAlpha=l,s.beginPath();for(const w of[3,6])for(const b of[-5,-1,3])s.rect(c+w,f+h/2+b,2,2);s.fillStyle=u.textLight,s.fill(),s.beginPath()}s.globalAlpha=1}if(r==="number"||r==="both"&&!n){const p=t.toString(),w=u.markerFontFull,b=c+g/2;r==="both"&&l!==0&&(s.globalAlpha=1-l),s.fillStyle=u.textLight,s.font=w,s.fillText(p,b,f+h/2+Zn(s,w)),l!==0&&(s.globalAlpha=1)}}const Mv={getAccessibilityString:()=>"",kind:An.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Rv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Rv(e,t,n){const{ctx:r,rect:i,hoverAmount:o,theme:s,spriteManager:a}=e,{x:l,y:u,width:c,height:f}=i;r.beginPath(),r.globalAlpha=o,r.rect(l+1,u+1,c,f-2),r.fillStyle=s.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const g=t!=="";let h=0;if(n!==void 0){const p=f-8,w=l+8/2,b=u+8/2;a.drawSprite(n,"normal",r,w,b,p,s,g?1:o),h=p}else{h=24;const m=12,p=g?m:o*m,w=g?0:(1-o)*m*.5,b=s.cellHorizontalPadding+4;p>0&&(r.moveTo(l+b+w,u+f/2),r.lineTo(l+b+w+p,u+f/2),r.moveTo(l+b+w+p*.5,u+f/2-p*.5),r.lineTo(l+b+w+p*.5,u+f/2+p*.5),r.lineWidth=2,r.strokeStyle=s.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=s.textMedium,r.fillText(t,h+l+s.cellHorizontalPadding+.5,u+f/2+Zn(r,s)),r.beginPath()}function Fd(e,t,n,r,i,o,s){e.textBaseline="alphabetic";const a=Ev(e,i,r,t,n?.fullSize??!1);e.beginPath(),Kn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=n?.bgColor??Nr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",s?.("text")}function Ev(e,t,n,r,i){const o=r.cellHorizontalPadding,s=r.cellVerticalPadding;if(i)return{x:t.x+o/2,y:t.y+s/2+1,width:t.width-o,height:t.height-s-1};const a=qr(n,e,r.baseFontFull,"alphabetic"),l=t.height-s,u=Math.min(l,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 Iv=d.lazy(async()=>await _s(()=>import("./number-overlay-editor.efE_o5de.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)),Tv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:lo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:i,rect:o,overrideCursor:s}=e,{hoverEffect:a,displayData:l,hoverEffectTheme:u}=n;a===!0&&t>0&&Fd(r,i,u,l,o,t,s),jn(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 d.createElement(d.Suspense,{fallback:null},d.createElement(Iv,{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}}},Dv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Ov,onPaste:()=>{}};function Ov(e){const{ctx:t,theme:n,rect:r}=e,{x:i,y:o,height:s}=r;t.beginPath();const a=2.5;let l=i+n.cellHorizontalPadding+a;const u=o+s/2,c=Math.cos(Jl(30))*a,f=Math.sin(Jl(30))*a;for(let g=0;g<12;g++)t.moveTo(l,u-a),t.lineTo(l,u+a),t.moveTo(l+c,u-f),t.lineTo(l-c,u+f),t.moveTo(l-c,u-f),t.lineTo(l+c,u+f),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const Pv={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>lo(e,t,e.theme.textLight),draw:e=>jn(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 Nt.createElement(Wr,{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=>e.data?.toString()??"",kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:lo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:i,rect:o,theme:s,overrideCursor:a}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:f,hoverEffectTheme:g}=t;c===!0&&n>0&&Fd(i,s,g,l,o,n,a),jn(e,l,u,f,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
|
176
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 d.createElement(Wr,{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:s=>r({...i,data:s.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Fv=fn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Lv=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:i,validatedSelection:o,preview:s}=e,[a,l]=d.useState(!i&&(t===""||r)),u=d.useCallback(()=>{l(!0)},[]);return a?d.createElement(Wr,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Fv,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},s),!i&&d.createElement("div",{className:"gdg-edit-icon",onClick:u},d.createElement(Vs,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Ld(e,t,n,r){let i=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,s=e.width,a=e.actualBoundingBoxAscent;return r==="right"?i=t.width-s-n.cellHorizontalPadding:r==="center"&&(i=t.width/2-s/2),{x:i,y:o,width:s,height:a}}function Fu(e){const{cell:t,bounds:n,posX:r,posY:i,theme:o}=e,s=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=dd(s,o.baseFontFull);if(a===void 0)return!1;const l=Ld(a,n,o,t.contentAlign);return Vr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},r,i)}const Av={getAccessibilityString:e=>e.data?.toString()??"",kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:lo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:i,hoverY:o,rect:s,ctx:a}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(r!==void 0&&u&&i!==void 0&&o!==void 0){const c=qr(l,a,n.baseFontFull),f=Ld(c,s,n,t.contentAlign),{x:g,y:h,width:m,height:p}=f;if(i>=g-4&&i<=g-4+m+8&&o>=h-4&&o<=h-4+p+8){const w=Zn(a,n.baseFontFull);r("pointer");const b=5,v=h-w;a.beginPath(),a.moveTo(s.x+g,Math.floor(s.y+v+p+b)+.5),a.lineTo(s.x+g+m,Math.floor(s.y+v+p+b)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,jn({...e,rect:{...s,x:s.x-1}},l,t.contentAlign),jn({...e,rect:{...s,x:s.x-2}},l,t.contentAlign),jn({...e,rect:{...s,x:s.x+1}},l,t.contentAlign),jn({...e,rect:{...s,x:s.x+2}},l,t.contentAlign),a.restore()}}a.fillStyle=u?n.linkColor:n.textDark,jn(e,l,t.contentAlign)},onSelect:e=>{Fu(e)&&e.preventDefault()},onClick:e=>{const{cell:t}=e;Fu(e)&&t.onClickUri?.(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 d.createElement(Lv,{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:s=>n({...r,data:s.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Hv=[Cv,Mv,rv,sv,dv,gv,vv,yv,Tv,Dv,Pv,_v,Av];var ss,Lu;function zv(){if(Lu)return ss;Lu=1;var e=Yc(),t=kc(),n="Expected a function";function r(i,o,s){var a=!0,l=!0;if(typeof i!="function")throw new TypeError(n);return t(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),e(i,o,{leading:a,maxWait:o,trailing:l})}return ss=r,ss}var Vv=zv();const Nv=ar(Vv),ls=[];class $v extends gd{imageLoaded=()=>{};loadedLocations=[];cache={};setCallback(t){this.imageLoaded=t}sendLoaded=Nv(()=>{this.imageLoaded(new Ji(this.loadedLocations)),this.loadedLocations=[]},20);clearOutOfWindow=()=>{const t=Object.keys(this.cache);for(const n of t){const r=this.cache[n];let i=!1;for(let o=0;o<r.cells.length;o++){const s=r.cells[o];if(this.isInWindow(s)){i=!0;break}}i?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[n])}};loadImage(t,n,r,i){let o=!1;const s=ls.pop()??new Image;let a=!1;const l={img:void 0,cells:[Wn(n,r)],url:t,cancel:()=>{a||(a=!0,ls.length<12?ls.unshift(s):o||(s.src=""))}},u=new Promise(c=>s.addEventListener("load",()=>c(null)));requestAnimationFrame(async()=>{try{s.src=t,await u,await s.decode();const c=this.cache[i];if(c!==void 0&&!a){c.img=s;for(const f of c.cells)this.loadedLocations.push(Ys(f));o=!0,this.sendLoaded()}}catch{l.cancel()}}),this.cache[i]=l}loadOrGetImage(t,n,r){const i=t,o=this.cache[i];if(o!==void 0){const s=Wn(n,r);return o.cells.includes(s)||o.cells.push(s),o.img}else this.loadImage(t,n,r,i)}}const Bv=(e,t)=>{const n=d.useMemo(()=>({...Pp,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Hv,[e.renderers]),i=d.useMemo(()=>e.imageWindowLoader??new $v,[e.imageWindowLoader]);return d.createElement(nv,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:i})},Wv=d.forwardRef(Bv);function Au(e,t){const n=d.useRef(null),r=d.useRef(),i=d.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return d.useEffect(()=>i,[i]),{debouncedCallback:d.useCallback((...s)=>{r.current=s,i(),n.current=setTimeout(()=>{r.current&&(e(...r.current),r.current=void 0)},t)},[e,t,i]),cancel:i}}const Ad=mi("div",{target:"ee4nolw0"})(({theme:e})=>({paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs})),yr=mi("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}}})),Uv=mi("div",{target:"ee4nolw2"})(({theme:e})=>({height:e.sizes.borderWidth,backgroundColor:e.colors.borderColor,marginTop:e.spacing.xs,marginBottom:e.spacing.xs})),Hu=[{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:"}],qv={number:Hu,progress:Hu,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 Gv({columnKind:e,isOpen:t,onMouseEnter:n,onMouseLeave:r,onChangeFormat:i,onCloseMenu:o,children:s}){const a=$r(),{colors:l,fontSizes:u,radii:c,fontWeights:f}=a,g=qv[e]||[];return g.length===0?Qe(Ec,{}):Qe(va,{triggerType:Ic.hover,returnFocus:!0,autoFocus:!0,focusLock:!0,isOpen:t,onMouseEnter:n,onMouseLeave:r,ignoreBoundary:!0,content:Qe(Ad,{role:"menu",children:g.map(h=>In(yr,{onClick:()=>{i(h.format),o()},role:"menuitem",children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:h.icon}),h.label]},h.format))}),placement:ma.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:pa(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:u.sm,fontWeight:f.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:s})}const Yv=d.memo(Gv);function Xv({top:e,left:t,isColumnPinned:n,onPinColumn:r,onUnpinColumn:i,onCloseMenu:o,onSortColumn:s,onHideColumn:a,columnKind:l,onChangeFormat:u,onAutosize:c}){const f=$r(),[g,h]=d.useState(!1),{colors:m,fontSizes:p,radii:w,fontWeights:b}=f;d.useEffect(()=>{function S(O){O.preventDefault()}return document.addEventListener("wheel",S,{passive:!1}),document.addEventListener("touchmove",S,{passive:!1}),()=>{document.removeEventListener("wheel",S),document.removeEventListener("touchmove",S)}},[]);const v=d.useCallback(()=>{o()},[o]);return Qe(va,{autoFocus:!0,"aria-label":"Dataframe column menu",content:In(Ad,{children:[s&&In(Ec,{children:[In(yr,{onClick:()=>{s("asc"),v()},role:"menuitem",children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_upward:"}),"Sort ascending"]}),In(yr,{onClick:()=>{s("desc"),v()},role:"menuitem",children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrow_downward:"}),"Sort descending"]}),Qe(Uv,{})]}),u&&Qe(Yv,{columnKind:l,isOpen:g,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onChangeFormat:u,onCloseMenu:v,children:In(yr,{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),isActive:g,hasSubmenu:!0,children:[In("div",{children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/format_list_numbered:"}),"Format"]}),Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/chevron_right:"})]})}),c&&In(yr,{onClick:()=>{c(),v()},children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/arrows_outward:"}),"Autosize"]}),n&&In(yr,{onClick:()=>{i(),v()},children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep_off:"}),"Unpin column"]}),!n&&In(yr,{onClick:()=>{r(),v()},children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/keep:"}),"Pin column"]}),a&&In(yr,{onClick:()=>{a(),v()},children:[Qe(nr,{size:"base",margin:"0",color:"inherit",iconValue:":material/visibility_off:"}),"Hide column"]})]}),placement:ma.bottomRight,accessibilityType:Tc.menu,showArrow:!1,popoverMargin:cn("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:`${f.sizes.borderWidth} solid ${f.colors.borderColor}`,backgroundColor:pa(f)?m.bgColor:m.secondaryBg,color:m.bodyText,fontSize:p.sm,fontWeight:b.normal,borderTopLeftRadius:w.default,borderTopRightRadius:w.default,borderBottomLeftRadius:w.default,borderBottomRightRadius:w.default,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:!0,children:Qe("div",{"data-testid":"stDataFrameColumnMenuTarget",style:{position:"fixed",top:e,left:t,visibility:"hidden",transform:"unset"}})})}const jv=d.memo(Xv),Kv="(index)",Zv=({label:e,initialValue:t,onChange:n})=>{const r=$r();return Qe(dg,{checked:t,onChange:i=>{n(i.target.checked)},"aria-label":e,checkmarkType:cg.default,labelPlacement:ug.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 s=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 ${ai(r.colors.primary,.5)}`:"",borderLeftWidth:r.sizes.borderWidth,borderRightWidth:r.sizes.borderWidth,borderTopWidth:r.sizes.borderWidth,borderBottomWidth:r.sizes.borderWidth,borderLeftColor:s,borderRightColor:s,borderTopColor:s,borderBottomColor:s}}},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})},Jv=({columns:e,columnOrder:t,setColumnOrder:n,hideColumn:r,showColumn:i,children:o,isOpen:s,onClose:a})=>{const l=$r();return Qe(va,{triggerType:Ic.click,placement:ma.bottomRight,autoFocus:!0,focusLock:!0,content:()=>Qe("div",{style:{paddingTop:l.spacing.sm,paddingBottom:l.spacing.sm},children:e.map(u=>{const c=t.length&&!u.isIndex?!t.includes(u.id)&&!t.includes(u.name):!1;return Qe(Zv,{label:!u.title&&u.isIndex?Kv:u.title,initialValue:!(u.isHidden===!0||c),onChange:f=>{f?(i(u.id),c&&n(g=>[...g,u.id])):r(u.id)}},u.id)})}),isOpen:s,onClickOutside:a,onClick:()=>s?a():void 0,onEsc:a,ignoreBoundary:!1,overrides:{Body:{props:{"data-testid":"stDataFrameColumnVisibilityMenu"},style:{borderTopLeftRadius:l.radii.default,borderTopRightRadius:l.radii.default,borderBottomLeftRadius:l.radii.default,borderBottomRightRadius:l.radii.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent",border:`${l.sizes.borderWidth} solid ${l.colors.borderColor}`}},Inner:{style:{backgroundColor:pa(l)?l.colors.bgColor:l.colors.secondaryBg,color:l.colors.bodyText,fontSize:l.fontSizes.sm,fontWeight:l.fontWeights.normal,minWidth:l.sizes.minMenuWidth,maxWidth:`calc(${l.sizes.minMenuWidth} * 2)`,maxHeight:l.sizes.maxDropdownHeight,overflow:"auto",paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},children:Qe("div",{children:o})})},Qv=d.memo(Jv);var e1=ph();const t1=ar(e1);var Zo={exports:{}};/*! Moment Duration Format v2.2.2
|
177
177
|
* https://github.com/jsmreese/moment-duration-format
|
178
178
|
* Date: 2018-02-16
|
@@ -193,5 +193,5 @@ Error: ${o}`}const r={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,content
|
|
193
193
|
40% { opacity: 1; }
|
194
194
|
`]))),tw=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,s=o.colors,a=o.spacing.baseUnit;return Le({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?s.neutral60:s.neutral20,padding:a*2})},ds=function(t){var n=t.delay,r=t.offset;return _e("span",{css:Ac({animation:"".concat(ew," 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"},"","")})},nw=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,s=sr(t,Gb);return _e("div",Ne({},Kt(Le(Le({},s),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),_e(ds,{delay:0,offset:r}),_e(ds,{delay:160,offset:!0}),_e(ds,{delay:320,offset:!r}))},rw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Le({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?s.neutral5:s.neutral0,borderColor:r?s.neutral10:i?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:i?s.primary:s.neutral30}})},iw=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return _e("div",Ne({ref:o},Kt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":a}),s,{"aria-disabled":r||void 0}),n)},ow=iw,aw=["data"],sw=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},lw=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return _e("div",Ne({},Kt(t,"group",{group:!0}),l),_e(s,Ne({},a,{selectProps:f,theme:c,getStyles:i,getClassNames:o,cx:r}),u),_e("div",null,n))},uw=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return Le({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"})},cw=function(t){var n=nf(t);n.data;var r=sr(n,aw);return _e("div",Ne({},Kt(t,"groupHeading",{"group-heading":!0}),r))},dw=lw,fw=["innerRef","isDisabled","isHidden","inputClassName"],hw=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,s=o.spacing,a=o.colors;return Le(Le({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},gw),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},ff={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},gw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Le({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ff)},mw=function(t){return Le({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},ff)},pw=function(t){var n=t.cx,r=t.value,i=nf(t),o=i.innerRef,s=i.isDisabled,a=i.isHidden,l=i.inputClassName,u=sr(i,fw);return _e("div",Ne({},Kt(t,"input",{"input-container":!0}),{"data-value":r||""}),_e("input",Ne({className:n({input:!0},l),ref:o,style:mw(a),disabled:s},u)))},vw=pw,bw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors;return Le({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},ww=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,s=t.cropWithEllipsis;return Le({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},yw=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,s=r.colors,a=t.isFocused;return Le({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},hf=function(t){var n=t.children,r=t.innerProps;return _e("div",r,n)},Cw=hf,Sw=hf;function xw(e){var t=e.children,n=e.innerProps;return _e("div",Ne({role:"button"},n),t||_e(dl,{size:14}))}var kw=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,u=r.Container,c=r.Label,f=r.Remove;return _e(u,{data:i,innerProps:Le(Le({},Kt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},_e(c,{data:i,innerProps:Le({},Kt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),_e(f,{data:i,innerProps:Le(Le({},Kt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},Mw=kw,Rw=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return Le({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},Ew=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,s=t.innerRef,a=t.innerProps;return _e("div",Ne({},Kt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:s,"aria-disabled":r},a),n)},Iw=Ew,Tw=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return Le({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},Dw=function(t){var n=t.children,r=t.innerProps;return _e("div",Ne({},Kt(t,"placeholder",{placeholder:!0}),r),n)},Ow=Dw,Pw=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,s=i.colors;return Le({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?s.neutral40:s.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",Ne({},Kt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},Fw=_w,gf={ClearIndicator:Zb,Control:ow,DropdownIndicator:jb,DownChevron:cf,CrossIcon:dl,Group:dw,GroupHeading:cw,IndicatorsContainer:Ub,IndicatorSeparator:Qb,Input:vw,LoadingIndicator:nw,Menu:Db,MenuList:Pb,MenuPortal:zb,LoadingMessage:Ab,NoOptionsMessage:Lb,MultiValue:Mw,MultiValueContainer:Cw,MultiValueLabel:Sw,MultiValueRemove:xw,Option:Iw,Placeholder:Ow,SelectContainer:Nb,SingleValue:Fw,ValueContainer:Bb},Lw=function(t){return Le(Le({},gf),t.components)},oc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Aw(e,t){return!!(e===t||oc(e)&&oc(t))}function Hw(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Aw(e[n],t[n]))return!1;return!0}function zw(e,t){t===void 0&&(t=Hw);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 s=e.apply(this,i);return n={lastResult:s,lastArgs:i,lastThis:this},s}return r.clear=function(){n=null},r}var Vw={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"},Nw=function(t){return _e("span",Ne({css:Vw},t))},ac=Nw,$w={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,s=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 s?"".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,s=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 s?"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,s=o===void 0?"":o,a=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,f=function(p,w){return p&&p.length?"".concat(p.indexOf(w)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(f(a,r),".");if(n==="menu"&&c){var g=l?" disabled":"",h="".concat(u?" selected":"").concat(g);return"".concat(s).concat(h,", ").concat(f(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},Bw=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,f=l.ariaLiveMessages,g=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,w=l.isSearchable,b=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,O=l.tabSelectsValue,R=l.isLoading,M=l["aria-label"],_=l["aria-live"],E=d.useMemo(function(){return Le(Le({},$w),f||{})},[f]),k=d.useMemo(function(){var x="";if(n&&E.onChange){var $=n.option,q=n.options,X=n.removedValue,oe=n.removedValues,Q=n.value,J=function(P){return Array.isArray(P)?null:P},te=X||$||J(Q),ae=te?g(te):"",le=q||oe||void 0,fe=le?le.map(g):[],re=Le({isDisabled:te&&p(te,a),label:ae,labels:fe},n);x=E.onChange(re)}return x},[n,E,p,a,g]),F=d.useMemo(function(){var x="",$=r||i,q=!!(r&&a&&a.includes(r));if($&&E.onFocus){var X={focused:$,label:g($),isDisabled:p($,a),isSelected:q,options:o,context:$===r?"menu":"value",selectValue:a,isAppleDevice:c};x=E.onFocus(X)}return x},[r,i,g,p,E,o,a,c]),D=d.useMemo(function(){var x="";if(b&&v.length&&!R&&E.onFilter){var $=S({count:o.length});x=E.onFilter({inputValue:h,resultsMessage:$})}return x},[o,h,b,E,v,S,R]),C=n?.action==="initial-input-focus",I=d.useMemo(function(){var x="";if(E.guidance){var $=i?"value":b?"menu":"input";x=E.guidance({"aria-label":M,context:$,isDisabled:r&&p(r,a),isMulti:m,isSearchable:w,tabSelectsValue:O,isInitialFocus:C})}return x},[M,r,i,m,p,w,b,E,a,O,C]),T=_e(d.Fragment,null,_e("span",{id:"aria-selection"},k),_e("span",{id:"aria-focused"},F),_e("span",{id:"aria-results"},D),_e("span",{id:"aria-guidance"},I));return _e(d.Fragment,null,_e(ac,{id:u},C&&T),_e(ac,{"aria-live":_,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!C&&T))},Ww=Bw,Os=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Uw=new RegExp("["+Os.map(function(e){return e.letters}).join("")+"]","g"),mf={};for(var fs=0;fs<Os.length;fs++)for(var hs=Os[fs],gs=0;gs<hs.letters.length;gs++)mf[hs.letters[gs]]=hs.base;var pf=function(t){return t.replace(Uw,function(n){return mf[n]})},qw=zw(pf),sc=function(t){return t.replace(/^\s+|\s+$/g,"")},Gw=function(t){return"".concat(t.label," ").concat(t.value)},Yw=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=Le({ignoreCase:!0,ignoreAccents:!0,stringify:Gw,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,s=i.ignoreAccents,a=i.stringify,l=i.trim,u=i.matchFrom,c=l?sc(r):r,f=l?sc(a(n)):a(n);return o&&(c=c.toLowerCase(),f=f.toLowerCase()),s&&(c=qw(c),f=pf(f)),u==="start"?f.substr(0,c.length)===c:f.indexOf(c)>-1}},Xw=["innerRef"];function jw(e){var t=e.innerRef,n=sr(e,Xw),r=Sb(n,"onExited","in","enter","exit","appear");return _e("input",Ne({ref:t},r,{css:Ac({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Kw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Zw(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,s=d.useRef(!1),a=d.useRef(!1),l=d.useRef(0),u=d.useRef(null),c=d.useCallback(function(w,b){if(u.current!==null){var v=u.current,S=v.scrollTop,O=v.scrollHeight,R=v.clientHeight,M=u.current,_=b>0,E=O-R-S,k=!1;E>b&&s.current&&(r&&r(w),s.current=!1),_&&a.current&&(o&&o(w),a.current=!1),_&&b>E?(n&&!s.current&&n(w),M.scrollTop=O,k=!0,s.current=!0):!_&&-b>S&&(i&&!a.current&&i(w),M.scrollTop=0,k=!0,a.current=!0),k&&Kw(w)}},[n,r,i,o]),f=d.useCallback(function(w){c(w,w.deltaY)},[c]),g=d.useCallback(function(w){l.current=w.changedTouches[0].clientY},[]),h=d.useCallback(function(w){var b=l.current-w.changedTouches[0].clientY;c(w,b)},[c]),m=d.useCallback(function(w){if(w){var b=wb?{passive:!1}:!1;w.addEventListener("wheel",f,b),w.addEventListener("touchstart",g,b),w.addEventListener("touchmove",h,b)}},[h,g,f]),p=d.useCallback(function(w){w&&(w.removeEventListener("wheel",f,!1),w.removeEventListener("touchstart",g,!1),w.removeEventListener("touchmove",h,!1))},[h,g,f]);return d.useEffect(function(){if(t){var w=u.current;return m(w),function(){p(w)}}},[t,m,p]),function(w){u.current=w}}var lc=["boxSizing","height","overflow","paddingRight","position"],uc={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function cc(e){e.cancelable&&e.preventDefault()}function dc(e){e.stopPropagation()}function fc(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function hc(){return"ontouchstart"in window||navigator.maxTouchPoints}var gc=!!(typeof window<"u"&&window.document&&window.document.createElement),Ui=0,oi={capture:!1,passive:!1};function Jw(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=d.useRef({}),o=d.useRef(null),s=d.useCallback(function(l){if(gc){var u=document.body,c=u&&u.style;if(r&&lc.forEach(function(m){var p=c&&c[m];i.current[m]=p}),r&&Ui<1){var f=parseInt(i.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,h=window.innerWidth-g+f||0;Object.keys(uc).forEach(function(m){var p=uc[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&hc()&&(u.addEventListener("touchmove",cc,oi),l&&(l.addEventListener("touchstart",fc,oi),l.addEventListener("touchmove",dc,oi))),Ui+=1}},[r]),a=d.useCallback(function(l){if(gc){var u=document.body,c=u&&u.style;Ui=Math.max(Ui-1,0),r&&Ui<1&&lc.forEach(function(f){var g=i.current[f];c&&(c[f]=g)}),u&&hc()&&(u.removeEventListener("touchmove",cc,oi),l&&(l.removeEventListener("touchstart",fc,oi),l.removeEventListener("touchmove",dc,oi)))}},[r]);return d.useEffect(function(){if(t){var l=o.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){o.current=l}}var Qw=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},ey={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ty(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,u=Zw({isEnabled:i,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),c=Jw({isEnabled:n}),f=function(h){u(h),c(h)};return _e(d.Fragment,null,n&&_e("div",{onClick:Qw,css:ey}),t(f))}var ny={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},ry=function(t){var n=t.name,r=t.onFocus;return _e("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ny,value:"",onChange:function(){}})},iy=ry;function fl(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 oy(){return fl(/^iPhone/i)}function vf(){return fl(/^Mac/i)}function ay(){return fl(/^iPad/i)||vf()&&navigator.maxTouchPoints>1}function sy(){return oy()||ay()}function ly(){return vf()||sy()}var uy=function(t){return t.label},cy=function(t){return t.label},dy=function(t){return t.value},fy=function(t){return!!t.isDisabled},hy={clearIndicator:Kb,container:Vb,control:rw,dropdownIndicator:Xb,group:sw,groupHeading:uw,indicatorsContainer:Wb,indicatorSeparator:Jb,input:hw,loadingIndicator:tw,loadingMessage:Fb,menu:Eb,menuList:Ob,menuPortal:Hb,multiValue:bw,multiValueLabel:ww,multiValueRemove:yw,noOptionsMessage:_b,option:Rw,placeholder:Tw,singleValue:Pw,valueContainer:$b},gy={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%)"},my=4,bf=4,py=38,vy=bf*2,by={baseUnit:bf,controlHeight:py,menuGutter:vy},ms={borderRadius:my,colors:gy,spacing:by},wy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:rc(),captureMenuScroll:!rc(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Yw(),formatGroupLabel:uy,getOptionLabel:cy,getOptionValue:dy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:fy,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!vb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function mc(e,t,n,r){var i=Cf(e,t,n),o=Sf(e,t,n),s=yf(e,t),a=ga(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:s,value:a,index:r}}function Qo(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(s,a){return mc(e,s,t,a)}).filter(function(s){return vc(e,s)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=mc(e,n,t,r);return vc(e,o)?o:void 0}).filter(yb)}function wf(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ls(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function pc(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Ls(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 yy(e,t){return wf(Qo(e,t))}function vc(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,s=t.label,a=t.value;return(!kf(e)||!o)&&xf(e,{label:s,value:a,data:i},r)}function Cy(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 Sy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ps=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},yf=function(t,n){return t.getOptionLabel(n)},ga=function(t,n){return t.getOptionValue(n)};function Cf(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Sf(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ga(e,t);return n.some(function(i){return ga(e,i)===r})}function xf(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var kf=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},xy=1,Mf=function(e){pg(n,e);var t=wg(n);function n(r){var i;if(bg(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=ly(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,u){var c=i.props,f=c.onChange,g=c.name;u.name=g,i.ariaOnChange(l,u),f(l,u)},i.setValue=function(l,u,c){var f=i.props,g=f.closeMenuOnSelect,h=f.isMulti,m=f.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),g&&(i.setState({inputIsHiddenAfterUpdate:!h}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:u,option:c})},i.selectOption=function(l){var u=i.props,c=u.blurInputOnSelect,f=u.isMulti,g=u.name,h=i.state.selectValue,m=f&&i.isOptionSelected(l,h),p=i.isOptionDisabled(l,h);if(m){var w=i.getOptionValue(l);i.setValue(h.filter(function(b){return i.getOptionValue(b)!==w}),"deselect-option",l)}else if(!p)f?i.setValue([].concat(Ls(h),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:g});return}c&&i.blurInput()},i.removeValue=function(l){var u=i.props.isMulti,c=i.state.selectValue,f=i.getOptionValue(l),g=c.filter(function(m){return i.getOptionValue(m)!==f}),h=Yo(u,g,g[0]||null);i.onChange(h,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(Yo(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,u=i.state.selectValue,c=u[u.length-1],f=u.slice(0,u.length-1),g=Yo(l,f,f[0]||null);c&&i.onChange(g,{action:"pop-value",removedValue:c})},i.getFocusedOptionId=function(l){return ps(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return pc(Qo(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return fb.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(l){return yf(i.props,l)},i.getOptionValue=function(l){return ga(i.props,l)},i.getStyles=function(l,u){var c=i.props.unstyled,f=hy[l](u,c);f.boxSizing="border-box";var g=i.props.styles[l];return g?g(f,u):f},i.getClassNames=function(l,u){var c,f;return(c=(f=i.props.classNames)[l])===null||c===void 0?void 0:c.call(f,u)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return Lw(i.props)},i.buildCategorizedOptions=function(){return Qo(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return wf(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,u){i.setState({ariaSelection:Le({value:l},u)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var u=i.props,c=u.isMulti,f=u.menuIsOpen;i.focusInput(),f?(i.setState({inputIsHiddenAfterUpdate:!c}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Ca(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(i.initialTouchX=c.clientX,i.initialTouchY=c.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var f=Math.abs(c.clientX-i.initialTouchX),g=Math.abs(c.clientY-i.initialTouchY),h=5;i.userIsDragging=f>h||g>h}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var u=i.props.inputValue,c=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(c,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var u=i.getFocusableOptions(),c=u.indexOf(l);i.setState({focusedOption:l,focusedOptionId:c>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return kf(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var u=i.props,c=u.isMulti,f=u.backspaceRemovesValue,g=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,w=u.menuIsOpen,b=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,O=i.state,R=O.focusedOption,M=O.focusedValue,_=O.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.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(M)i.removeValue(M);else{if(!f)return;c?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!w||!v||!R||S&&i.isOptionSelected(R,_))return;i.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(w){if(!R||i.isComposing)return;i.selectOption(R);break}return;case"Escape":w?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:h}),i.onMenuClose()):m&&g&&i.clearValue();break;case" ":if(h)return;if(!w){i.openMenu("first");break}if(!R)return;i.selectOption(R);break;case"ArrowUp":w?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":w?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!w)return;i.focusOption("pageup");break;case"PageDown":if(!w)return;i.focusOption("pagedown");break;case"Home":if(!w)return;i.focusOption("first");break;case"End":if(!w)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++xy),i.state.selectValue=tc(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),s=i.buildFocusableOptions(),a=s.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=s[a],i.state.focusedOptionId=ps(o,s[a])}return i}return vg(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&nc(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&i.isDisabled||l&&a&&!i.menuIsOpen)&&this.focusInput(),l&&s&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(nc(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,u=this.buildFocusableOptions(),c=i==="first"?0:u.length-1;if(!this.props.isMulti){var f=u.indexOf(a[0]);f>-1&&(c=f)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var u=s.length-1,c=-1;if(s.length){switch(i){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:s[c]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(s);s||(u=-1),i==="up"?l=u>0?u-1:a.length-1:i==="down"?l=(u+1)%a.length:i==="pageup"?(l=u-o,l<0&&(l=0)):i==="pagedown"?(l=u+o,l>a.length-1&&(l=a.length-1)):i==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(ms):Le(Le({},ms),this.props.theme):ms}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,f=this.props,g=f.isMulti,h=f.isRtl,m=f.options,p=this.hasValue();return{clearValue:i,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:p,isMulti:g,isRtl:h,options:m,selectOption:u,selectProps:f,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,s=i.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(i,o){return Cf(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return Sf(this.props,i,o)}},{key:"filterOption",value:function(i,o){return xf(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:s,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,s=i.isSearchable,a=i.inputId,l=i.inputValue,u=i.tabIndex,c=i.form,f=i.menuIsOpen,g=i.required,h=this.getComponents(),m=h.Input,p=this.state,w=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,S=a||this.getElementId("input"),O=Le(Le(Le({"aria-autocomplete":"list","aria-expanded":f,"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||""},f&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?d.createElement(m,Ne({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:w,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},O)):d.createElement(jw,Ne({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:fa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},O))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,f=o.Placeholder,g=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,w=h.isMulti,b=h.inputValue,v=h.placeholder,S=this.state,O=S.selectValue,R=S.focusedValue,M=S.isFocused;if(!this.hasValue()||!m)return b?null:d.createElement(f,Ne({},g,{key:"placeholder",isDisabled:p,isFocused:M,innerProps:{id:this.getElementId("placeholder")}}),v);if(w)return O.map(function(E,k){var F=E===R,D="".concat(i.getOptionLabel(E),"-").concat(i.getOptionValue(E));return d.createElement(s,Ne({},g,{components:{Container:a,Label:l,Remove:u},isFocused:F,isDisabled:p,key:D,index:k,removeProps:{onClick:function(){return i.removeValue(E)},onTouchEnd:function(){return i.removeValue(E)},onMouseDown:function(I){I.preventDefault()}},data:E}),i.formatOptionLabel(E,"value"))});if(b)return null;var _=O[0];return d.createElement(c,Ne({},g,{data:_,isDisabled:p}),this.formatOptionLabel(_,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ne({},s,{innerProps:f,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,c=this.state.isFocused;if(!o||!u)return null;var f={"aria-hidden":"true"};return d.createElement(o,Ne({},s,{innerProps:f,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,s=i.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return d.createElement(s,Ne({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return d.createElement(o,Ne({},s,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,f=o.LoadingMessage,g=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,w=this.props,b=w.captureMenuScroll,v=w.inputValue,S=w.isLoading,O=w.loadingMessage,R=w.minMenuHeight,M=w.maxMenuHeight,_=w.menuIsOpen,E=w.menuPlacement,k=w.menuPosition,F=w.menuPortalTarget,D=w.menuShouldBlockScroll,C=w.menuShouldScrollIntoView,I=w.noOptionsMessage,T=w.onMenuScrollToTop,x=w.onMenuScrollToBottom;if(!_)return null;var $=function(ae,le){var fe=ae.type,re=ae.data,H=ae.isDisabled,P=ae.isSelected,G=ae.label,ue=ae.value,he=p===re,ke=H?void 0:function(){return i.onOptionHover(re)},Se=H?void 0:function(){return i.selectOption(re)},et="".concat(i.getElementId("option"),"-").concat(le),Re={id:et,onClick:Se,onMouseMove:ke,onMouseOver:ke,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:P};return d.createElement(h,Ne({},m,{innerProps:Re,data:re,isDisabled:H,isSelected:P,key:et,label:G,type:fe,value:ue,isFocused:he,innerRef:he?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(ae.data,"menu"))},q;if(this.hasOptions())q=this.getCategorizedOptions().map(function(te){if(te.type==="group"){var ae=te.data,le=te.options,fe=te.index,re="".concat(i.getElementId("group"),"-").concat(fe),H="".concat(re,"-heading");return d.createElement(s,Ne({},m,{key:re,data:ae,options:le,Heading:a,headingProps:{id:H,data:te.data},label:i.formatGroupLabel(te.data)}),te.options.map(function(P){return $(P,"".concat(fe,"-").concat(P.index))}))}else if(te.type==="option")return $(te,"".concat(te.index))});else if(S){var X=O({inputValue:v});if(X===null)return null;q=d.createElement(f,m,X)}else{var oe=I({inputValue:v});if(oe===null)return null;q=d.createElement(g,m,oe)}var Q={minMenuHeight:R,maxMenuHeight:M,menuPlacement:E,menuPosition:k,menuShouldScrollIntoView:C},J=d.createElement(Ib,Ne({},m,Q),function(te){var ae=te.ref,le=te.placerProps,fe=le.placement,re=le.maxHeight;return d.createElement(l,Ne({},m,Q,{innerRef:ae,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:S,placement:fe}),d.createElement(ty,{captureEnabled:b,onTopArrive:T,onBottomArrive:x,lockEnabled:D},function(H){return d.createElement(u,Ne({},m,{innerRef:function(G){i.getMenuListRef(G),H(G)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:S,maxHeight:re,focusedOption:p}),q)}))});return F||k==="fixed"?d.createElement(c,Ne({},m,{appendTo:F,controlElement:this.controlRef,menuPlacement:E,menuPosition:k}),J):J}},{key:"renderFormField",value:function(){var i=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,f=this.state.selectValue;if(c&&!this.hasValue()&&!a)return d.createElement(iy,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(s){var g=f.map(function(p){return i.getOptionValue(p)}).join(s);return d.createElement("input",{name:u,type:"hidden",value:g})}else{var h=f.length>0?f.map(function(p,w){return d.createElement("input",{key:"i-".concat(w),name:u,type:"hidden",value:i.getOptionValue(p)})}):d.createElement("input",{name:u,type:"hidden",value:""});return d.createElement("div",null,h)}else{var m=f[0]?this.getOptionValue(f[0]):"";return d.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,f=this.getFocusableOptions();return d.createElement(Ww,Ne({},i,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,s=i.IndicatorsContainer,a=i.SelectContainer,l=i.ValueContainer,u=this.props,c=u.className,f=u.id,g=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return d.createElement(a,Ne({},p,{className:c,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:m}),this.renderLiveRegion(),d.createElement(o,Ne({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:m,menuIsOpen:h}),d.createElement(l,Ne({},p,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),d.createElement(s,Ne({},p,{isDisabled:g}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,f=o.prevWasFocused,g=o.instancePrefix,h=i.options,m=i.value,p=i.menuIsOpen,w=i.inputValue,b=i.isMulti,v=tc(m),S={};if(s&&(m!==s.value||h!==s.options||p!==s.menuIsOpen||w!==s.inputValue)){var O=p?yy(i,v):[],R=p?pc(Qo(i,v),"".concat(g,"-option")):[],M=a?Cy(o,v):null,_=Sy(o,O),E=ps(R,_);S={selectValue:v,focusedOption:_,focusedOptionId:E,focusableOptionsWithIds:R,focusedValue:M,clearFocusValueOnUpdate:!1}}var k=l!=null&&i!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},F=u,D=c&&f;return c&&!D&&(F={value:Yo(b,v,v[0]||null),options:v,action:"initial-input-focus"},D=!f),u?.action==="initial-input-focus"&&(F=null),Le(Le(Le({},S),k),{},{prevProps:i,ariaSelection:F,prevWasFocused:D})}}]),n}(d.Component);Mf.defaultProps=wy;var ky=d.forwardRef(function(e,t){var n=j1(e);return d.createElement(Mf,Ne({ref:t},n))}),My=ky;const Ry=e=>{const{Menu:t}=gf,{children:n,...r}=e;return d.createElement(t,{...r},n)},Ey=fn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Iy=fn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Ty=fn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Dy=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:i,value:o}=t.data,[s,a]=d.useState(o),[l,u]=d.useState(r??""),c=qm(),f=d.useMemo(()=>i.map(g=>typeof g=="string"||g===null||g===void 0?{value:g,label:g?.toString()??""}:g),[i]);return t.readonly?d.createElement(Ty,null,d.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:s??"",onChange:()=>{}})):d.createElement(Ey,null,d.createElement(My,{className:"glide-select",inputValue:l,onInputChange:u,menuPlacement:"auto",value:f.find(g=>g.value===s),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=>d.createElement(Iy,null,d.createElement(Ry,{className:"click-outside-ignore",...g}))},options:f,onChange:async g=>{g!==null&&(a(g.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:g.value}}))}}))},Oy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{value:o}=t.data,s=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),a=typeof s=="string"?s:s?.label??"";return a&&(n.fillStyle=r.textDark,n.fillText(a,i.x+r.cellHorizontalPadding,i.y+i.height/2+Zn(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Dy,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 Py(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],s=i*t;return e.replace(n,`${Number(s.toPrecision(3))}${o}`)}return e}const _y={marginRight:8},Fy={display:"flex",alignItems:"center",flexGrow:1},Ly={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:i}=e,{min:o,max:s,value:a,label:l,measureLabel:u}=t.data,c=i.x+r.cellHorizontalPadding,f=i.y+i.height/2,g=s-o,h=(a-o)/g,m=`${Py(r.baseFontStyle,.9)} ${r.fontFamily}`,w=Us(n,m)/2;n.save();let b=0;l!==void 0&&(n.font=m,b=qr(u??l,n,m).width+r.cellHorizontalPadding);const v=i.width-r.cellHorizontalPadding*2-b;if(v>=w){const S=n.createLinearGradient(c,f,c+v,f);S.addColorStop(0,r.accentColor),S.addColorStop(h,r.accentColor),S.addColorStop(h,r.bgBubble),S.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=S,Ku(n,c,f-w/2,v,w,w/2),n.fill(),n.beginPath(),Ku(n,c+.5,f-w/2+.5,v-1,w-1,(w-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(l,i.x+i.width-r.cellHorizontalPadding,f+Zn(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(),s=t.step.toString(),a=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return d.createElement("label",{style:Fy},d.createElement("input",{style:_y,type:"range",value:r,min:i,max:o,step:s,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}}},Ay=fn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),vs=(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}`)}},Hy=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,s=t.min instanceof Date?vs(n,t.min,o):t.min,a=t.max instanceof Date?vs(n,t.max,o):t.max,l=vs(n,t.date,o);return e.value.readonly?Nt.createElement(Wr,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):Nt.createElement(Ay,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:l,min:s,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)}})}})},zy={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Ws(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Hy}),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)}}},Vy="None";function bc(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 Ny=e=>{const{cell:t,theme:n,ctx:r}=e;Ws({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`}},Vy,t.contentAlign),r.fillStyle=n.textDark};function $y(e){const t=d.useCallback((r,i)=>{const{cell:o,theme:s,ctx:a,rect:l}=r,u=r.col;if(fi(o))bc(a,l,s);else if(wa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?i():Ny(r),c.isRequired&&c.isEditable&&bc(a,l,s);return}i()},[e]),n=d.useMemo(()=>[Y1,Oy,Ly,zy,...C1],[]);return{drawCell:t,customRenderers:n}}function By(){const e=$r();return d.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:ai(e.colors.primary,.9),borderColor:e.colors.dataframeBorderColor,horizontalBorderColor:e.colors.dataframeBorderColor,fontFamily:e.genericFonts.bodyFont,bgSearchResult:ai(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.dataframeHeaderBackgroundColor,bgHeaderHasFocus:ai(e.colors.darkenedBgMix100,.9),bgHeaderHovered:ai(e.colors.darkenedBgMix100,.9),textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerIconSize:Math.round(cn("1.125rem")),headerFontStyle:`${e.fontWeights.normal} ${cn(e.fontSizes.sm)}px`,baseFontStyle:`${e.fontWeights.normal} ${cn(e.fontSizes.sm)}px`,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:ai(e.colors.bodyText,.2),textLight:e.colors.fadedText40,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(cn(e.spacing.sm)),cellVerticalPadding:Math.round(cn("0.1875rem")),textBubble:e.colors.fadedText60,bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,bubbleHeight:Math.round(cn("1.25rem")),bubblePadding:Math.round(cn(e.spacing.sm)),bubbleMargin:Math.round(cn(e.spacing.twoXS)),linkColor:e.colors.link,drilldownBorder:e.colors.darkenedBgMix25,checkboxMaxSize:Math.round(cn(e.sizes.checkbox))},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(cn("25rem")),minColumnWidth:Math.round(cn("3.125rem")),maxColumnWidth:Math.round(cn("62.5rem")),maxColumnAutoWidth:Math.round(cn("31.25rem")),defaultRowHeight:Math.round(cn("2.1875rem")),defaultHeaderHeight:Math.round(cn("2.1875rem")),bgRowHovered:Jh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}const Wy=Fs.getLogger("useDataEditor");function Uy(e,t,n,r,i,o,s,a,l){const u=d.useCallback(([p,w],b)=>{const v=e[p];if(!v.isEditable)return;const S=v.indexNumber,O=n.current.getOriginalRowIndex(i(w)),R=r([p,w]),M=v.getCellValue(R),_=v.getCellValue(b);if(!fi(R)&&_===M)return;const E=v.getCell(_,!0);fi(E)?Wy.warn(`Not applying the cell edit since it causes this error:
|
195
195
|
${E.data}`):(n.current.setCell(S,O,{...E,lastUpdated:performance.now()}),a())},[e,n,i,r,a]),c=d.useCallback(()=>{if(t)return;const p=new Map;e.forEach(w=>{p.set(w.indexNumber,w.getCell(w.defaultValue))}),n.current.addRow(p),s()},[e,n,t,s]),f=d.useCallback(()=>{t||(c(),a())},[c,a,t]),g=d.useCallback(p=>{if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(b=>n.current.getOriginalRowIndex(i(b)));return n.current.deleteRows(w),s(),l(),a(),!1}if(p.current?.range){const w=[],b=p.current.range;for(let v=b.y;v<b.y+b.height;v++)for(let S=b.x;S<b.x+b.width;S++){const O=e[S];O.isEditable&&!O.isRequired&&(w.push({cell:[S,v]}),u([S,v],O.getCell(null)))}return w.length>0&&(a(),o(w)),!1}return!0},[e,n,t,o,i,a,u,l,s]),h=d.useCallback((p,w)=>{const[b,v]=p,S=[];for(let O=0;O<w.length;O++){const R=w[O];if(O+v>=n.current.getNumRows()){if(t)break;c()}for(let M=0;M<R.length;M++){const _=R[M],E=O+v,k=M+b;if(k>=e.length)break;const F=e[k];if(F.isEditable){const D=F.getCell(_,!0);if(st(D)&&!fi(D)){const C=F.indexNumber,I=n.current.getOriginalRowIndex(i(E)),T=F.getCellValue(r([k,E]));F.getCellValue(D)!==T&&(n.current.setCell(C,I,{...D,lastUpdated:performance.now()}),S.push({cell:[k,E]}))}}}S.length>0&&(a(),o(S))}return!1},[e,n,t,i,r,c,a,o]),m=d.useCallback((p,w)=>{const b=p[0];if(b>=e.length)return!0;const v=e[b];if(v.validateInput){const S=v.validateInput(v.getCellValue(w));return S===!0||S===!1?S:v.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:f,onDelete:g,validateCell:m}}const Rf=",",Xi='"',qy='"',Ef=`
|
196
|
-
`,Gy="\uFEFF",Yy=new RegExp(`[${[Rf,Xi,Ef].join("")}]`),wc=Fs.getLogger("useDataExporter");function yc(e){return e.map(t=>Xy(t)).join(Rf)+Ef}function Xy(e){if(Ae(e))return"";const t=gt(e);return Yy.test(t)?`${Xi}${t.replace(new RegExp(Xi,"g"),qy+Xi)}${Xi}`:t}async function Cc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(s=>s.name);await e.write(i.encode(yc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(yc(a)))}await e.close()}function jy(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await _s(()=>import("./es6.
|
196
|
+
`,Gy="\uFEFF",Yy=new RegExp(`[${[Rf,Xi,Ef].join("")}]`),wc=Fs.getLogger("useDataExporter");function yc(e){return e.map(t=>Xy(t)).join(Rf)+Ef}function Xy(e){if(Ae(e))return"";const t=gt(e);return Yy.test(t)?`${Xi}${t.replace(new RegExp(Xi,"g"),qy+Xi)}${Xi}`:t}async function Cc(e,t,n,r){const i=new TextEncoder;await e.write(i.encode(Gy));const o=n.map(s=>s.name);await e.write(i.encode(yc(o)));for(let s=0;s<r;s++){const a=[];n.forEach((l,u,c)=>{a.push(l.getCellValue(t([u,s])))}),await e.write(i.encode(yc(a)))}await e.close()}function jy(e,t,n,r){return{exportToCsv:d.useCallback(async()=>{const s=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await _s(()=>import("./es6.k96zpXRu.js").then(c=>c.a),__vite__mapDeps([15,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:s,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await Cc(u,e,t,n)}catch(a){if(a instanceof Error&&a.name==="AbortError")return;try{wc.warn("Failed to export data as CSV with FileSystem API, trying fallback method",a);let l="";const u=new WritableStream({write:h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await Cc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),f=URL.createObjectURL(c),g=gg({enforceDownloadInNewTab:r,url:f,filename:s});g.style.display="none",document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f)}catch(l){wc.error("Failed to export data as CSV",l)}}},[t,n,e,r])}}function Ky(e,t,n,r){return{getCellContent:d.useCallback(([o,s])=>{if(o>t.length-1)return It("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return It("Row index out of bounds","This error should never happen. Please report this bug.");try{const a=t[o],l=a.indexNumber,u=r.current.getOriginalRowIndex(s),c=r.current.isAddedRow(u);if(a.isEditable||c){const h=r.current.getCell(l,u);if(st(h))return{...a.getCell(a.getCellValue(h),!1),lastUpdated:h.lastUpdated};if(c)return It("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${l}; row=${u}`)}const f=e.getCell(u,l),g=Qh(e,u,l);return O1(a,f,g,e.styler?.cssStyles)}catch(a){return It("Error during cell creation",`This error should never happen. Please report this bug.
|
197
197
|
Error: ${a}`)}},[t,n,e,r])}}function Zy(e){const[t,n]=d.useState(void 0),r=d.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,s]=o.location;n(s)}},[n]);return{getRowThemeOverride:d.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:r}}function Jy(e,t,n,r,i){const[o,s]=d.useState({columns:rt.empty(),rows:rt.empty(),current:void 0}),a=!t&&!n&&(e.selectionMode.includes(Cn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Cn.SelectionMode.SINGLE_ROW)),l=a&&e.selectionMode.includes(Cn.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Cn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Cn.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Cn.SelectionMode.MULTI_COLUMN),f=o.rows.length>0,g=o.columns.length>0,h=o.current!==void 0,m=d.useCallback(w=>{const b=!Wa(w.rows.toArray(),o.rows.toArray()),v=!Wa(w.columns.toArray(),o.columns.toArray()),S=!Wa(w.current,o.current);let O=a&&b||u&&v,R=w;if((a||u)&&w.current!==void 0&&S&&(R={...w,rows:o.rows,columns:o.columns},O=!1),b&&w.rows.length>0&&v&&w.columns.length===0&&(R={...R,columns:o.columns},O=!0),v&&w.columns.length>0&&b&&w.rows.length===0&&(R={...R,rows:o.rows},O=!0),v&&R.columns.length>=0){let M=R.columns;r.forEach((_,E)=>{_.isIndex&&(M=M.remove(E))}),M.length<R.columns.length&&(R={...R,columns:M})}s(R),O&&i(R)},[o,a,u,i,r]),p=d.useCallback((w=!1,b=!1)=>{const v={columns:b?o.columns:rt.empty(),rows:w?o.rows:rt.empty(),current:void 0};s(v),(!w&&a||!b&&u)&&i(v)},[o,a,u,i]);return{gridSelection:o,isRowSelectionActivated:a,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:f,isColumnSelected:g,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Qy(e,t,n,r,i,o,s){const a=e.rowHeight??t.defaultRowHeight,l=t.defaultHeaderHeight+a+2*t.tableBorderWidth,u=r?2:1,c=e.editingMode===Cn.EditingMode.DYNAMIC?1:0,f=n+c;let g=Math.max(f*a+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(g,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),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 w,b=p;e.useContainerWidth?w=p:e.width&&(w=Math.min(Math.max(e.width,m),p),b=Math.min(Math.max(e.width,b),p));const[v,S]=d.useState({width:w||"100%",height:h});return d.useLayoutEffect(()=>{e.useContainerWidth&&v.width==="100%"&&S(O=>({...O,width:p}))},[p]),d.useLayoutEffect(()=>{S(O=>({...O,width:w||"100%"}))},[w]),d.useLayoutEffect(()=>{S(O=>({...O,height:h}))},[h,n]),d.useLayoutEffect(()=>{if(s){const O=e.useContainerWidth||st(e.width)&&e.width>0;S({width:O?b:"100%",height:g})}else S({width:w||"100%",height:h})},[s]),{minHeight:l,maxHeight:g,minWidth:m,maxWidth:b,rowHeight:a,resizableSize:v,setResizableSize:S}}const eC=600,tC="⚠️ Please fill out this cell.";function nC(e,t,n=[]){const[r,i]=d.useState(),o=d.useRef(null),s=d.useCallback(l=>{if(clearTimeout(o.current),o.current=0,i(void 0),(l.kind==="header"||l.kind==="cell")&&l.location){const u=l.location[0],c=l.location[1];let f;if(u<0||u>=e.length||n.includes(c))return;const g=e[u];if(l.kind==="header"&&st(g))f=g.help;else if(l.kind==="cell"){const h=t([u,c]);fi(h)?f=h.errorDetails:g.isRequired&&g.isEditable&&wa(h)?f=tC:a1(h)&&(f=h.tooltip)}f&&(o.current=setTimeout(()=>{f&&i({content:f,left:l.bounds.x+l.bounds.width/2,top:l.bounds.y})},eC))}},[e,t,i,o,n]),a=d.useCallback(()=>{i(void 0)},[i]);return{tooltip:r,clearTooltip:a,onItemHovered:s}}function rC({top:e,left:t,content:n,clearTooltip:r}){const[i,o]=d.useState(!0),s=$r(),{colors:a,fontSizes:l,radii:u,fontWeights:c}=s,f=d.useCallback(()=>{o(!1),r()},[r,o]);return Qe(va,{content:Qe(eg,{"data-testid":"stDataFrameTooltipContent",children:Qe(tg,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:ma.top,accessibilityType:Tc.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:f,onEsc:f,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:pa(s)?a.bgColor:a.secondaryBg,color:a.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:i,children:Qe("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const iC=d.memo(rC),Sc=mi("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}}}})),xc=150,oC=15e4,Xo=6;function aC({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:i,fragmentId:o}){const{expanded:s,expand:a,collapse:l,width:u,height:c}=ng(sg),f=d.useRef(null),g=d.useRef(null),h=d.useRef(null),m=By(),{getRowThemeOverride:p,onItemHovered:w}=Zy(m),{libConfig:{enforceDownloadInNewTab:b=!1}}=d.useContext(rg),[v,S]=d.useState(!0),[O,R]=d.useState(!1),[M,_]=d.useState(!1),[E,k]=d.useState(!1),[F,D]=d.useState(),[C,I]=d.useState(!1),T=d.useCallback(()=>I(ge=>!ge),[]),x=d.useCallback(()=>I(!1),[]),$=d.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),q=d.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ae(e.editingMode)&&(e.editingMode=Cn.EditingMode.READ_ONLY);const{READ_ONLY:X,DYNAMIC:oe}=Cn.EditingMode,Q=t.dimensions,J=Math.max(0,Q.numDataRows),te=J===0&&!(e.editingMode===oe&&Q.numDataColumns>0),ae=J>oC,le=!ae&&!te&&e.editingMode!==oe,fe=!te&&e.editingMode===oe&&!n,re=d.useRef(new Wo(J)),[H,P]=d.useState(re.current.getNumRows());d.useEffect(()=>{re.current=new Wo(J),P(re.current.getNumRows())},[J]);const G=d.useCallback(()=>{re.current=new Wo(J),P(re.current.getNumRows())},[J]),[ue,he]=d.useState(e.columnOrder);d.useEffect(()=>{he(e.columnOrder)},[e.columnOrder.join(",")]);const{columns:ke,allColumns:Se,setColumnConfigMapping:et}=F1(e,t,n,ue);d.useEffect(()=>{if(e.editingMode===X)return;const ge=r.getStringValue({id:e.id,formId:e.formId});ge&&(re.current.fromJson(ge,ke),P(re.current.getNumRows()))},[]);const{getCellContent:Re}=Ky(t,ke,H,re),{columns:Xe,sortColumn:yt,getOriginalIndex:De,getCellContent:ne}=U1(J,ke,Re),Ee=d.useCallback(ge=>{const bt={selection:{rows:[],columns:[]}};bt.selection.rows=ge.rows.toArray().map(Bt=>De(Bt)),bt.selection.columns=ge.columns.toArray().map(Bt=>Qi(Xe[Bt]));const en=JSON.stringify(bt),kt=r.getStringValue({id:e.id,formId:e.formId});(kt===void 0||kt!==en)&&r.setStringValue({id:e.id,formId:e.formId},en,{fromUi:!0},o)},[Xe,e.id,e.formId,r,o,De]),{debouncedCallback:xe}=Au(Ee,xc),{gridSelection:ce,isRowSelectionActivated:pe,isMultiRowSelectionActivated:ze,isColumnSelectionActivated:Ie,isMultiColumnSelectionActivated:tt,isRowSelected:Te,isColumnSelected:Oe,isCellSelected:Je,clearSelection:ye,processSelectionChange:qe}=Jy(e,te,n,Xe,xe);d.useEffect(()=>{ye(!0,!0)},[s]);const pt=d.useCallback(ge=>{g.current?.updateCells(ge)},[]);d.useEffect(()=>{if(!pe&&!Ie)return;const ge=r.getStringValue({id:e.id,formId:e.formId});if(ge){const bt=Xe.map(an=>Qi(an)),en=JSON.parse(ge);let kt=rt.empty(),Bt=rt.empty();en.selection?.rows?.forEach(an=>{kt=kt.add(an)}),en.selection?.columns?.forEach(an=>{Bt=Bt.add(bt.indexOf(an))}),(kt.length>0||Bt.length>0)&&qe({rows:kt,columns:Bt,current:void 0})}},[]);const ft=d.useCallback(()=>{H!==re.current.getNumRows()&&P(re.current.getNumRows())},[H]),We=d.useCallback(()=>{const ge=re.current.toJson(Xe);let bt=r.getStringValue({id:e.id,formId:e.formId});bt===void 0&&(bt=new Wo(0).toJson([])),ge!==bt&&r.setStringValue({id:e.id,formId:e.formId},ge,{fromUi:!0},o)},[Xe,e.id,e.formId,r,o]),{debouncedCallback:xt}=Au(We,xc),{exportToCsv:qt}=jy(ne,Xe,H,b),{onCellEdited:Tt,onPaste:_t,onRowAppended:tn,onDelete:zt,validateCell:Sn}=Uy(Xe,e.editingMode!==oe,re,ne,De,pt,ft,xt,ye),Vt=d.useMemo(()=>te?[0]:fe?[H]:[],[te,fe,H]),{tooltip:ut,clearTooltip:nn,onItemHovered:Ct}=nC(Xe,ne,Vt),{drawCell:Ft,customRenderers:Yt}=$y(Xe),{provideEditor:je}=G1(),Dt=d.useCallback(ge=>({...ge,hasMenu:!te}),[te]),Ot=d.useMemo(()=>Xe.map(ge=>Dt(Is(ge))),[Xe,Dt]),{columns:ln,onColumnResize:rn}=z1(Ot),hn=t.dimensions.numHeaderRows>1,{minHeight:bn,maxHeight:Xt,minWidth:Jt,maxWidth:Ge,rowHeight:Et,resizableSize:Qt,setResizableSize:Lt}=Qy(e,m,H,hn,u||0,c,s),At=d.useCallback(([ge,bt])=>({...s1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(Xe.length-1,0)]}),[Xe,m.glideTheme.textLight]),xn=d.useCallback(()=>{G(),ye()},[G,ye]);og({element:e,widgetMgr:r,onFormCleared:xn});const{pinColumn:Un,unpinColumn:Hn,freezeColumns:N}=A1(Xe,te,u||0,m.minColumnWidth,ye,et),{changeColumnFormat:Be}=L1(et),{hideColumn:Pe,showColumn:Pt}=q1(ye,et),{onColumnMoved:wn}=H1(Xe,N,Un,Hn,he);return d.useEffect(()=>{setTimeout(()=>{if(h.current&&g.current){const ge=h.current?.querySelector(".dvn-stack")?.getBoundingClientRect();ge&&(_(ge.height>h.current.clientHeight),k(ge.width>h.current.clientWidth))}},1)},[Qt,H,ln]),d.useEffect(()=>{Se.length==Xe.length&&I(!1)},[Se.length,Xe.length]),In(Sc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:q,ref:h,onMouseDown:ge=>{if(h.current&&q){const bt=h.current.getBoundingClientRect();E&&bt.height-(Xo+1)<ge.clientY-bt.top&&ge.stopPropagation(),M&&bt.width-(Xo+1)<ge.clientX-bt.left&&ge.stopPropagation()}},onBlur:ge=>{!v&&!$&&!ge.currentTarget.contains(ge.relatedTarget)&&ye(!0,!0)},children:[In(lg,{isFullScreen:s,disableFullscreenMode:i,locked:Te&&!pe||Je||$&&v||C,onExpand:a,onCollapse:l,target:Sc,children:[(pe&&Te||Ie&&Oe)&&Qe(ii,{label:"Clear selection",icon:mg,onClick:()=>{ye(),nn()}}),fe&&Te&&Qe(ii,{label:"Delete row(s)",icon:yg,onClick:()=>{zt&&(zt(ce),nn())}}),fe&&!Te&&Qe(ii,{label:"Add row",icon:Hc,onClick:()=>{tn&&(S(!0),tn(),nn(),g.current?.scrollTo(0,H,"vertical"))}}),!te&&Se.length>Xe.length&&Qe(Qv,{columns:Se,columnOrder:ue,setColumnOrder:he,hideColumn:Pe,showColumn:Pt,isOpen:C,onClose:x,children:Qe(ii,{label:"Show/hide columns",icon:Vc,onClick:T})}),!ae&&!te&&Qe(ii,{label:"Download as CSV",icon:Cg,onClick:qt}),!te&&Qe(ii,{label:"Search",icon:zc,onClick:()=>{O?R(!1):(S(!0),R(!0)),nn()}})]}),Qe(ig,{"data-testid":"stDataFrameResizable",ref:f,defaultSize:Qt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:bn,maxHeight:Xt,minWidth:Jt,maxWidth:Ge,size:Qt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Et],snapGap:Et/3,onResizeStop:(ge,bt,en,kt)=>{if(f.current){const Bt=2*m.tableBorderWidth;Lt({width:f.current.size.width,height:Xt-f.current.size.height===Bt?f.current.size.height+Bt:f.current.size.height})}},children:Qe(Wv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:g,columns:ln,rows:te?1:H,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Et,headerHeight:m.defaultHeaderHeight,getCellContent:te?At:ne,onColumnResize:$?void 0:rn,resizeIndicator:"header",freezeColumns:N,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:$?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:Ie?void 0:wn,onItemHovered:ge=>{w?.(ge),Ct?.(ge)},keybindings:{downFill:!0},onKeyDown:ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="f"&&(R(bt=>!bt),ge.stopPropagation(),ge.preventDefault())},showSearch:O,searchResults:O?void 0:[],onSearchClose:()=>{R(!1),nn()},onHeaderClicked:(ge,bt)=>{!le||Ie||(O&&R(!1),pe&&Te?ye():ye(!0,!0),yt(ge,"auto"))},gridSelection:ce,onGridSelectionChange:ge=>{(v||$)&&(qe(ge),ut!==void 0&&nn())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:ge=>{ge.kind==="out-of-bounds"&&v?S(!1):ge.kind!=="out-of-bounds"&&!v&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...q&&{paddingBottom:E?-Xo:void 0,paddingRight:M?-Xo:void 0}},provideEditor:je,drawCell:Ft,customRenderers:Yt,imageEditorOverride:y1,headerIcons:m.headerIcons,validateCell:Sn,onHeaderMenuClick:(ge,bt)=>{D({columnIdx:ge,headerBounds:bt})},onPaste:!1,...pe&&{rowMarkers:{kind:"checkbox-visible",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader,textMedium:m.glideTheme.textLight}},rowSelectionMode:ze?"multi":"auto",rowSelect:n?"none":ze?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Ie&&{columnSelect:n?"none":tt?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!te&&e.editingMode!==X&&!n&&{fillHandle:!$,onCellEdited:Tt,onPaste:_t,onDelete:zt},...!te&&e.editingMode===oe&&{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:tn,onHeaderClicked:void 0}})}),ut&&ut.content&&Qe(iC,{top:ut.top,left:ut.left,content:ut.content,clearTooltip:nn}),F&&Lc.createPortal(Qe(jv,{top:F.headerBounds.y+F.headerBounds.height,left:F.headerBounds.x+F.headerBounds.width,columnKind:ke[F.columnIdx].kind,onCloseMenu:()=>D(void 0),onSortColumn:le?ge=>{O&&R(!1),ye(!(pe&&Te),!0),yt(F.columnIdx,ge,!0)}:void 0,isColumnPinned:ke[F.columnIdx].isPinned,onUnpinColumn:()=>{Hn(ke[F.columnIdx].id)},onPinColumn:()=>{Un(ke[F.columnIdx].id)},onHideColumn:()=>{Pe(ke[F.columnIdx].id)},onChangeFormat:ge=>{Be(ke[F.columnIdx].id,ge),setTimeout(()=>{g.current?.remeasureColumns(rt.fromSingleSelection(F.columnIdx))},100)},onAutosize:()=>{g.current?.remeasureColumns(rt.fromSingleSelection(F.columnIdx))}}),document.querySelector("#portal"))]})}const sC=ag(aC),lC=d.memo(sC),CC=Object.freeze(Object.defineProperty({__proto__:null,default:lC},Symbol.toStringTag,{value:"Module"}));export{x0 as C,vd as T,ui as a,Eg as b,CC as c,si as i,Um as m,fn as s};
|