streamlit-nightly 1.41.2.dev20250108__py2.py3-none-any.whl → 1.41.2.dev20250109__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/proto/ForwardMsg_pb2.py +3 -1
- streamlit/proto/ForwardMsg_pb2.pyi +23 -0
- streamlit/runtime/app_session.py +0 -2
- streamlit/runtime/forward_msg_queue.py +32 -4
- streamlit/runtime/fragment.py +1 -1
- streamlit/runtime/scriptrunner/exec_code.py +33 -0
- streamlit/runtime/scriptrunner/script_runner.py +4 -2
- streamlit/runtime/scriptrunner_utils/script_requests.py +1 -0
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{FileDownload.esm.CXWFIN7B.js → FileDownload.esm.C6kraHI_.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.dauERNYc.js → FormClearHelper.Tmz_sTQ8.js} +1 -1
- streamlit/static/static/js/{Hooks.CqBCxxzg.js → Hooks.ChcK58kV.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Dm8zppD9.js → InputInstructions.CWlmC2Qh.js} +1 -1
- streamlit/static/static/js/{ProgressBar.CQTs8xxT.js → ProgressBar.C2LLZx-o.js} +1 -1
- streamlit/static/static/js/{RenderInPortalIfExists.BIVWPcSk.js → RenderInPortalIfExists.BFB9tinI.js} +1 -1
- streamlit/static/static/js/{Toolbar.D_9Mp69H.js → Toolbar.DVKl5Ty9.js} +1 -1
- streamlit/static/static/js/{base-input.JrivAGt5.js → base-input.C7heAUz7.js} +1 -1
- streamlit/static/static/js/{createSuper.BLkfEjg8.js → createSuper.BGkH3lYW.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.4d_NBoKr.js → data-grid-overlay-editor.Cuw9mHAA.js} +1 -1
- streamlit/static/static/js/{downloader.i394ggfM.js → downloader.Dt0tCM6a.js} +1 -1
- streamlit/static/static/js/{es6.BPf5kpFH.js → es6.DEWLLkEJ.js} +2 -2
- streamlit/static/static/js/{getPrototypeOf.DcAVjrh9.js → getPrototypeOf.BobjvJFE.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.YDN8GVx9.js → iframeResizer.contentWindow.Cb2nEQV3.js} +1 -1
- streamlit/static/static/js/{index.D1CJOG3s.js → index.2xRq6cMk.js} +1 -1
- streamlit/static/static/js/{index.CAZAG6f3.js → index.3dqlv1Xq.js} +1 -1
- streamlit/static/static/js/{index.57g5CAPC.js → index.4hESrvbj.js} +1 -1
- streamlit/static/static/js/{index.DgOwxLz5.js → index.8LNY4OIb.js} +1 -1
- streamlit/static/static/js/{index.DWU1GWqY.js → index.B59J81FK.js} +1 -1
- streamlit/static/static/js/{index.B3dyGG7q.js → index.BAlqqBcw.js} +1 -1
- streamlit/static/static/js/{index.g_BxiUns.js → index.BBm-I8-2.js} +1 -1
- streamlit/static/static/js/{index.BOBIcAmK.js → index.BEEgvyV0.js} +1 -1
- streamlit/static/static/js/{index.kc3Ycvjj.js → index.BSITpAz8.js} +7 -7
- streamlit/static/static/js/{index.HktO7F0v.js → index.BU-BMiNz.js} +1 -1
- streamlit/static/static/js/{index.Bj7LBigw.js → index.BbullfwT.js} +7 -7
- streamlit/static/static/js/{index.Df7nX4KF.js → index.BhvVhqgM.js} +1 -1
- streamlit/static/static/js/{index.V5OLP0n7.js → index.Bo2RO7c-.js} +1 -1
- streamlit/static/static/js/{index.B_o9A-oO.js → index.BwUNY-jU.js} +1 -1
- streamlit/static/static/js/{index.DxsOgtLc.js → index.C4ggakh6.js} +1 -1
- streamlit/static/static/js/{index.YfuWGKrN.js → index.C6zLaEWH.js} +1 -1
- streamlit/static/static/js/{index.C4muCvfN.js → index.CJKd6KIo.js} +1 -1
- streamlit/static/static/js/{index.DmHQeMtj.js → index.CJrSPe9e.js} +1 -1
- streamlit/static/static/js/{index.DsKBnIk-.js → index.CKpkbBQ4.js} +2 -2
- streamlit/static/static/js/{index.Dz6VQ3qN.js → index.CKyzSK7k.js} +1 -1
- streamlit/static/static/js/{index.D7EG5vd0.js → index.CWzMR4Qn.js} +1 -1
- streamlit/static/static/js/{index.PriAkdhw.js → index.Caaf3Sch.js} +1 -1
- streamlit/static/static/js/{index.DalTq5GL.js → index.CdNirCmM.js} +1 -1
- streamlit/static/static/js/{index.BidgRpd5.js → index.CksJdg_n.js} +1 -1
- streamlit/static/static/js/{index.CJlBME-_.js → index.Cq6-Dj2J.js} +1 -1
- streamlit/static/static/js/{index.SKaK1lYU.js → index.CsnZSzHc.js} +1 -1
- streamlit/static/static/js/{index.B6GM885g.js → index.D2_ysKuQ.js} +1 -1
- streamlit/static/static/js/{index.DE-FOSSU.js → index.DA-jgmvJ.js} +1 -1
- streamlit/static/static/js/{index.D_bHPQ8s.js → index.DSOFf22B.js} +1 -1
- streamlit/static/static/js/{index.D1qR2sOA.js → index.DTQeyNXN.js} +1 -1
- streamlit/static/static/js/{index.BB2p9KgS.js → index.De91xhMb.js} +1 -1
- streamlit/static/static/js/{index.CMAjN-j5.js → index.DeX4c3dx.js} +1 -1
- streamlit/static/static/js/{index.DyNkf5tM.js → index.IRVXqVyf.js} +1 -1
- streamlit/static/static/js/{index.CSmBE6cg.js → index.b1jbiVGt.js} +1 -1
- streamlit/static/static/js/{index.BfABFd7-.js → index.bQJeNN28.js} +1 -1
- streamlit/static/static/js/{index.CgkfCbvP.js → index.kz_FxQ30.js} +1 -1
- streamlit/static/static/js/{index.C-TBipT2.js → index.n7L72_oq.js} +1 -1
- streamlit/static/static/js/{input.CqdNsSbL.js → input.qSadM7Tx.js} +1 -1
- streamlit/static/static/js/{memory.Bkvk-eRa.js → memory.CROZv0Mn.js} +1 -1
- streamlit/static/static/js/{mergeWith.DtsbyD6H.js → mergeWith.CO-Rv2Zo.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.CR4D4kK1.js → number-overlay-editor.BRQhYKOF.js} +1 -1
- streamlit/static/static/js/{sandbox.C5M8yw5Z.js → sandbox.CZKLDBgs.js} +1 -1
- streamlit/static/static/js/{slicedToArray.BL5-s74J.js → slicedToArray.D36w_Bc8.js} +1 -1
- streamlit/static/static/js/{textarea.DrGlWUDC.js → textarea.DvzSPS_8.js} +1 -1
- streamlit/static/static/js/{timepicker.Bdf2lGHx.js → timepicker.FNAmrJ96.js} +1 -1
- streamlit/static/static/js/{uniqueId.LGvQ35eR.js → uniqueId.BNjI9ROI.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.TTzKcGCs.js → useBasicWidgetState.B8IH-5cn.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.ChvkrwHU.js → useOnInputChange.B1QB2TNw.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.ChQqb1TZ.js → withFullScreenWrapper.BT91IT4-.js} +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250109.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250109.dist-info}/RECORD +78 -80
- streamlit/vendor/ipython/__init__.py +0 -0
- streamlit/vendor/ipython/modified_sys_path.py +0 -67
- {streamlit_nightly-1.41.2.dev20250108.data → streamlit_nightly-1.41.2.dev20250109.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250109.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250109.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.41.2.dev20250108.dist-info → streamlit_nightly-1.41.2.dev20250109.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.
|
2
|
-
var Lf=Object.defineProperty;var Ff=(e,t,n)=>t in e?Lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>Ff(e,typeof t!="symbol"?t+"":t,n);import{r as h,E as ac,_ as et,g as Mi,c as Af,R as ne,i as es,p as Hf,d as Hs,e as zf,f as $f,h as sc,t as lc,l as Vf,m as uc,o as Nf,q as Bf,s as Wf,u as Uf,v as Yf,a as dr,w as zs,x as Ll,y as Xf,z as Gf,A as Ze,B as cc,C as Cs,D as bt,G as Hr,H as jf,I as qf,J as Fl,K as co,L as dc,M as Kf,N as fc,j as kn,n as hc,O as Zf,Q as Jf,S as Qf,T as eh,U as th,V as nh,W as rh,X as ih,Y as Al,Z as oh,$ as ah,a0 as $s,a1 as Xn,a2 as gc,a3 as sh,a4 as qi,a5 as kr,k as lh,a6 as uh,a7 as Ve,b as ch,a8 as mc,a9 as Vs,aa as ts,ab as Pr,ac as dh,ad as pc,ae as ns,af as fh,ag as hh,ah as gh,ai as mh,aj as ph,ak as vh,al as bh,am as Hl,an as wh}from"./index.kc3Ycvjj.js";import{u as yh}from"./FormClearHelper.dauERNYc.js";import{w as Ch,u as Sh,E as xh}from"./withFullScreenWrapper.ChQqb1TZ.js";import{T as kh,a as Wi}from"./Toolbar.D_9Mp69H.js";import{m as Mh}from"./mergeWith.DtsbyD6H.js";import{s as Rh}from"./sprintf.C-r3gIuM.js";import{c as Eh}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Cr,C as Ih}from"./slicedToArray.BL5-s74J.js";import{_ as Th,a as Dh,b as Oh}from"./getPrototypeOf.DcAVjrh9.js";import{_ as Ph}from"./createSuper.BLkfEjg8.js";import{D as _h,F as Lh}from"./FileDownload.esm.CXWFIN7B.js";var vc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(ac,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});vc.displayName="Add";var bc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(ac,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});bc.displayName="Search";function wc(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return wc(t)}function ao(e,t){return wc(t??"Hell froze over")}function Fh(e,t){try{return e()}catch{return t}}const zl=Object.prototype.hasOwnProperty;function xi(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&xi(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(zl.call(e,n)&&++i&&!zl.call(t,n)||!(n in t)||!xi(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var Ah=Object.prototype,Hh=Ah.hasOwnProperty;function zh(e,t){return e!=null&&Hh.call(e,t)}var $h=zh,Vh=$h,Nh=Af;function Bh(e,t){return e!=null&&Nh(e,t,Vh)}var Wh=Bh;const Uh=Mi(Wh),sa=null,Ns=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 $l;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})($l||($l={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function Vl(e){return typeof e=="object"?e:await e()}function pi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function bi(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Ki(e){if(!pi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function Yh(e){return Uh(e,"editor")}function Bs(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));function Xh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let Nl;const wr=class wr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new wr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=Xh([...this.items,n]);return new wr(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const c=[];s<i&&c.push([s,i]),r<l&&c.push([r,l]),n.splice(o,1,...c)}}return new wr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};dt(wr,"empty",()=>Nl??(Nl=new wr([]))),dt(wr,"fromSingleSelection",t=>wr.empty().add(t));let vt=wr;var Gh=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Bl=Gh,jh=e=>e.toUpperCase()===e,qh=e=>t=>e.indexOf(t)===-1,yc=(e,t)=>{const n={};return Object.keys(e).filter(qh(t)).forEach(i=>{n[i]=e[i]}),n};function Kh(e,t,n){const i=yc(t,n);if(!e){const r=typeof es=="function"?{default:es}:es;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var Zh=(e,t)=>{};function Jh(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,c=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!jh(s[0])):n.propsAsIs,u=Kh(c,o,["as","class"]);u.ref=a,u.className=n.atomic?Bl(n.class,u.className||l):Bl(u.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],y=b[0],w=b[1]||"",S=typeof y=="function"?y(o):y;Zh(S,n.name),f[`--${p}`]=`${S}${w}`}const g=u.style||{},m=Object.keys(g);m.length>0&&m.forEach(p=>{f[p]=g[p]}),u.style=f}return e.__linaria&&e!==s?(u.as=s,ne.createElement(e,u)):ne.createElement(s,u)},r=ne.forwardRef?ne.forwardRef(i):o=>{const a=yc(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var dn=Jh;const Qh=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Cc={},Ea={},Ws={},rs={},Wl;function eg(){return Wl||(Wl=1,function(e){(function(t,n){n(e,h,Hf)})(Hs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(w){return w&&w.__esModule?w:{default:w}}var s=Object.assign||function(w){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(w[C]=M[C])}return w};function l(w,S){var M={};for(var C in w)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(M[C]=w[C]);return M}function c(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&w(S.prototype,M),C&&w(S,C),S}}();function d(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function f(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var g=!1;function m(w){g=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return g?w:w.capture}function b(w){if("touches"in w){var S=w.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=w.screenX,R=w.screenY;return{x,y:R}}var y=function(w){f(S,w);function S(){var M;c(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return u(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,H=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:H},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(rs)),rs}(function(e){(function(t,n){n(e,eg())})(Hs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(Ws);var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var _r=tg(zf);function tg(e){return e&&e.__esModule?e:{default:e}}function ng(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rg={ROOT:function(t){return(0,_r.default)(ng({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};fo.default=rg;var ho={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.outerWidth=void 0;var ig=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Ia.outerWidth=ig;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var og=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=og;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var ag=function(){return window};go.default=ag;Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var rr=ug(h),jr=Ta(fo),sg=Ia,Ul=Ta(Ri),lg=Ta(Ws),Vo=Ta(go);function Ta(e){return e&&e.__esModule?e:{default:e}}function Sc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Sc=function(){return e},e}function ug(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=Sc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function Ss(){return Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ss.apply(this,arguments)}function cg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fg(e,t,n){return t&&dg(e.prototype,t),e}function hg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xs(e,t)}function xs(e,t){return xs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},xs(e,t)}function gg(e){var t=pg();return function(){var i=ua(e),r;if(t){var o=ua(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return mg(this,r)}}function mg(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:xn(e)}function xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pg(){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 ua(e){return ua=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ua(e)}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vg=function(t){return t.hasOwnProperty("key")},Us=function(e){hg(n,e);var t=gg(n);function n(i){var r;return cg(this,n),r=t.call(this,i),mn(xn(r),"itemsWrapperRef",void 0),mn(xn(r),"itemsListRef",void 0),mn(xn(r),"thumbsRef",void 0),mn(xn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),mn(xn(r),"setItemsListRef",function(o){r.itemsListRef=o}),mn(xn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),mn(xn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=rr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,sg.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),c=l<o,u=c?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:c?r.getFirstItem(f.selectedItem):0,lastPosition:u,showArrows:c}})}}),mn(xn(r),"handleClickItem",function(o,a,s){if(!vg(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),mn(xn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),mn(xn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),mn(xn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=rr.Children.count(r.props.children),c=-(r.state.firstItem*100)/r.state.visibleItems,u=Math.max(l-r.state.visibleItems,0),d=-u*100/r.state.visibleItems;c===s&&a>0&&(a=0),c===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,g=c+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,Ul.default)(g,"%",r.props.axis)}),!0}),mn(xn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),mn(xn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),mn(xn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return fg(n,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,Vo.default)().addEventListener("resize",this.updateSizes),(0,Vo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Vo.default)().removeEventListener("resize",this.updateSizes),(0,Vo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(u){return r.setThumbsRef(u,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return rr.default.createElement("li",Ss({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=rr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},c=-this.state.firstItem*(this.state.itemSize||0),u=(0,Ul.default)(c,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:u,MozTransform:u,MsTransform:u,OTransform:u,transform:u,msTransform:u,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},rr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},rr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},rr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?rr.default.createElement(lg.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):rr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(g){return r.setItemsListRef(g)},style:l},this.renderItems()),rr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(rr.Component);ho.default=Us;mn(Us,"displayName","Thumbs");mn(Us,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.default=void 0;var bg=function(){return document};Da.default=bg;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.setPosition=Hn.getPosition=Hn.isKeyboardEvent=Hn.defaultStatusFormatter=Hn.noop=void 0;var wg=h,yg=Cg(Ri);function Cg(e){return e&&e.__esModule?e:{default:e}}var Sg=function(){};Hn.noop=Sg;var xg=function(t,n){return"".concat(t," of ").concat(n)};Hn.defaultStatusFormatter=xg;var kg=function(t){return t?t.hasOwnProperty("key"):!1};Hn.isKeyboardEvent=kg;var Mg=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=wg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};Hn.getPosition=Mg;var Rg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,yg.default)(t,"%",n)}),i};Hn.setPosition=Rg;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.fadeAnimationHandler=hr.slideStopSwipingHandler=hr.slideSwipeAnimationHandler=hr.slideAnimationHandler=void 0;var xc=h,Eg=Ig(Ri),gr=Hn;function Ig(e){return e&&e.__esModule?e:{default:e}}function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yl(Object(n),!0).forEach(function(i){Tg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Tg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dg=function(t,n){var i={},r=n.selectedItem,o=r,a=xc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,gr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,gr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,gr.setPosition)(0,t.axis)),i;var l=(0,gr.getPosition)(r,t),c=(0,Eg.default)(l,"%",t.axis),u=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:c,msTransform:c,OTransform:c,transform:c},n.swiping||(i.itemListStyle=Jr(Jr({},i.itemListStyle),{},{WebkitTransitionDuration:u,MozTransitionDuration:u,OTransitionDuration:u,transitionDuration:u,msTransitionDuration:u})),i};hr.slideAnimationHandler=Dg;var Og=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=xc.Children.count(n.children),l=0,c=(0,gr.getPosition)(i.selectedItem,n),u=n.infiniteLoop?(0,gr.getPosition)(s-1,n)-100:(0,gr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;c===l&&d>0&&(f=0),c===u&&d<0&&(f=0);var g=c+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&g>-100?g-=s*100:i.selectedItem===s-1&&g<-s*100&&(g+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,gr.setPosition)(g,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};hr.slideSwipeAnimationHandler=Og;var Pg=function(t,n){var i=(0,gr.getPosition)(n.selectedItem,t),r=(0,gr.setPosition)(i,t.axis);return{itemListStyle:r}};hr.slideStopSwipingHandler=Pg;var _g=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return n.swiping||(o=Jr(Jr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Jr(Jr({},o),{},{opacity:1,position:"relative"}),prevStyle:Jr({},o)}};hr.fadeAnimationHandler=_g;Object.defineProperty(Ea,"__esModule",{value:!0});Ea.default=void 0;var At=Ag(h),Lg=mo(Ws),yr=mo(fo),Fg=mo(ho),No=mo(Da),Bo=mo(go),Zi=Hn,ca=hr;function mo(e){return e&&e.__esModule?e:{default:e}}function kc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return kc=function(){return e},e}function Ag(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=kc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function ks(){return ks=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ks.apply(this,arguments)}function Xl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xl(Object(n),!0).forEach(function(i){ht(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Hg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $g(e,t,n){return t&&zg(e.prototype,t),e}function Vg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ms(e,t)}function Ms(e,t){return Ms=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ms(e,t)}function Ng(e){var t=Wg();return function(){var i=da(e),r;if(t){var o=da(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Bg(this,r)}}function Bg(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:mt(e)}function mt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function da(e){return da=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},da(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ys=function(e){Vg(n,e);var t=Ng(n);function n(i){var r;Hg(this,n),r=t.call(this,i),ht(mt(r),"thumbsRef",void 0),ht(mt(r),"carouselWrapperRef",void 0),ht(mt(r),"listRef",void 0),ht(mt(r),"itemsRef",void 0),ht(mt(r),"timer",void 0),ht(mt(r),"animationHandler",void 0),ht(mt(r),"setThumbsRef",function(a){r.thumbsRef=a}),ht(mt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),ht(mt(r),"setListRef",function(a){r.listRef=a}),ht(mt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),ht(mt(r),"autoPlay",function(){At.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),ht(mt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),ht(mt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),ht(mt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),ht(mt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),ht(mt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,No.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,No.default)().activeElement)):!1}),ht(mt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",c={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},u=l?c.ArrowRight:c.ArrowDown,d=l?c.ArrowLeft:c.ArrowUp;u===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),ht(mt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),ht(mt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),ht(mt(r),"handleClickItem",function(a,s){if(At.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),ht(mt(r),"handleOnChange",function(a,s){At.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),ht(mt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),ht(mt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),ht(mt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),ht(mt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(mt(r)));return r.setState(ir({},l)),!!Object.keys(l).length}),ht(mt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),ht(mt(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),ht(mt(r),"moveTo",function(a){if(typeof a=="number"){var s=At.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),ht(mt(r),"onClickNext",function(){r.increment(1)}),ht(mt(r),"onClickPrev",function(){r.decrement(1)}),ht(mt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(mt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(mt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),ht(mt(r),"selectItem",function(a){r.setState(ir({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,At.Children.toArray(r.props.children)[a.selectedItem])}),ht(mt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),ht(mt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var c=l[0];if(!c.complete){var u=function g(){r.forceUpdate(),c.removeEventListener("load",g)};c.addEventListener("load",u)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ca.fadeAnimationHandler||ca.slideAnimationHandler,r.state=ir(ir({},o),r.animationHandler(i,o)),r}return $g(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(ir({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&At.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,No.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,No.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var o=this;return this.props.children?At.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,c=s===o.state.previousItem,u=l&&o.state.selectedStyle||c&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(u=ir(ir({},u),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(u=ir(ir({},u),{},{pointerEvents:"none"}));var d={ref:function(g){return o.setItemsRef(g,s)},key:"itemKey"+s+(r?"clone":""),className:yr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:u};return At.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,c=o.children;return a?At.default.createElement("ul",{className:"control-dots"},At.Children.map(c,function(u,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?At.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,At.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||At.Children.count(this.props.children)===0?null:At.default.createElement(Fg.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||At.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&At.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&At.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=s&&(this.state.selectedItem<At.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,u=this.renderItems(!0),d=u.shift(),f=u.pop(),g={className:yr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(g.onSwipeLeft=this.onSwipeForward,g.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else g.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,g.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,g.style=ir(ir({},g.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return At.default.createElement("div",{"aria-label":this.props.ariaLabel,className:yr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},At.default.createElement("div",{className:yr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),At.default.createElement("div",{className:yr.default.WRAPPER(!0,this.props.axis),style:m},o?At.default.createElement(Lg.default,ks({tagName:"ul",innerRef:this.setListRef},g,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):At.default.createElement("ul",{className:yr.default.SLIDER(!0,this.state.swiping),ref:function(y){return r.setListRef(y)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,c,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(At.default.Component);Ea.default=Ys;ht(Ys,"displayName","Carousel");ht(Ys,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return At.default.createElement("li",{className:yr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=At.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=At.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ca.slideSwipeAnimationHandler,stopSwipingHandler:ca.slideStopSwipingHandler});var Ug={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Ea),n=Ug,i=r(ho);function r(o){return o&&o.__esModule?o:{default:o}}})(Cc);var Yg=$f,Xg=function(){return Yg.Date.now()},Gg=Xg,jg=sc,is=Gg,Gl=lc,qg="Expected a function",Kg=Math.max,Zg=Math.min;function Jg(e,t,n){var i,r,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(qg);t=Gl(t)||0,jg(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Kg(Gl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function g(x){var R=i,I=r;return i=r=void 0,c=x,a=e.apply(I,R),a}function m(x){return c=x,s=setTimeout(y,t),u?g(x):a}function p(x){var R=x-l,I=x-c,E=t-R;return d?Zg(E,o-I):E}function b(x){var R=x-l,I=x-c;return l===void 0||R>=t||R<0||d&&I>=o}function y(){var x=is();if(b(x))return w(x);s=setTimeout(y,p(x))}function w(x){return s=void 0,f&&i?g(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),c=0,i=l=r=s=void 0}function M(){return s===void 0?a:w(is())}function C(){var x=is(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(y,t),g(l)}return s===void 0&&(s=setTimeout(y,t)),a}return C.cancel=S,C.flush=M,C}var Mc=Jg;const Rc=Mi(Mc);function cn(e,t,n,i,r=!1){const o=h.useRef();o.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var c;(c=o.current)==null||c.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Zr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function jl(e){return e*Qg/180}const Ec=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ic=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Tc=(e,t,n)=>Math.min(e,t-n*2),Dc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Xs=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),h.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[i,r]=h.useState(e),o=h.useRef(!0);h.useEffect(()=>()=>{o.current=!1},[]);const a=h.useRef(Rc(s=>{o.current&&r(s)},n));return h.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Gs(e){return im.test(e)?"rtl":"not-rtl"}let Wo;function Rs(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Wo=n-i,Wo}const qr=Symbol();function om(e){const t=h.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=h.useState(e),[,r]=h.useState(),o=h.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(c=>typeof s=="function"?s(l===qr?c:l):s),t.current[0]=qr)},[]),a=h.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function Oc(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function am(e){const t=h.useRef(e);return xi(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return h.createElement(Qh,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(Cc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??h.createElement("img",{draggable:!1,src:s});return h.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&h.createElement("button",{className:"gdg-edit-icon",onClick:i},h.createElement(Xs,null)))};function Pc(){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 ti=Pc();function lm(e){ti=e}const _c=/[&<>"']/,um=new RegExp(_c.source,"g"),Lc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(Lc.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ql=e=>dm[e];function pn(e,t){if(t){if(_c.test(e))return e.replace(um,ql)}else if(Lc.test(e))return e.replace(cm,ql);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Fc(e){return e.replace(fm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const hm=/(^|[^\[])\^/g;function Vt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(hm,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Kl(e,t,n){if(e){let i;try{i=decodeURIComponent(Fc(n)).replace(gm,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){Uo[" "+e]||(pm.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=ra(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const fa={exec:function(){}};function Zl(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function ra(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function ym(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function Cm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Jl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Ql(e,t,n,i){const r=t.href,o=t.title?pn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:pn(a)}}function Sm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.Cuw9mHAA.js","./index.BSITpAz8.js","../css/index.ZIJkhegp.css","./FormClearHelper.Tmz_sTQ8.js","./withFullScreenWrapper.BT91IT4-.js","./Toolbar.DVKl5Ty9.js","./mergeWith.CO-Rv2Zo.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.D36w_Bc8.js","./getPrototypeOf.BobjvJFE.js","./createSuper.BGkH3lYW.js","./FileDownload.esm.C6kraHI_.js","./number-overlay-editor.BRQhYKOF.js","./es6.DEWLLkEJ.js"])))=>i.map(i=>d[i]);
|
2
|
+
var Lf=Object.defineProperty;var Ff=(e,t,n)=>t in e?Lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>Ff(e,typeof t!="symbol"?t+"":t,n);import{r as h,E as ac,_ as et,g as Mi,c as Af,R as ne,i as es,p as Hf,d as Hs,e as zf,f as $f,h as sc,t as lc,l as Vf,m as uc,o as Nf,q as Bf,s as Wf,u as Uf,v as Yf,a as dr,w as zs,x as Ll,y as Xf,z as Gf,A as Ze,B as cc,C as Cs,D as bt,G as Hr,H as jf,I as qf,J as Fl,K as co,L as dc,M as Kf,N as fc,j as kn,n as hc,O as Zf,Q as Jf,S as Qf,T as eh,U as th,V as nh,W as rh,X as ih,Y as Al,Z as oh,$ as ah,a0 as $s,a1 as Xn,a2 as gc,a3 as sh,a4 as qi,a5 as kr,k as lh,a6 as uh,a7 as Ve,b as ch,a8 as mc,a9 as Vs,aa as ts,ab as Pr,ac as dh,ad as pc,ae as ns,af as fh,ag as hh,ah as gh,ai as mh,aj as ph,ak as vh,al as bh,am as Hl,an as wh}from"./index.BSITpAz8.js";import{u as yh}from"./FormClearHelper.Tmz_sTQ8.js";import{w as Ch,u as Sh,E as xh}from"./withFullScreenWrapper.BT91IT4-.js";import{T as kh,a as Wi}from"./Toolbar.DVKl5Ty9.js";import{m as Mh}from"./mergeWith.CO-Rv2Zo.js";import{s as Rh}from"./sprintf.C-r3gIuM.js";import{c as Eh}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Cr,C as Ih}from"./slicedToArray.D36w_Bc8.js";import{_ as Th,a as Dh,b as Oh}from"./getPrototypeOf.BobjvJFE.js";import{_ as Ph}from"./createSuper.BGkH3lYW.js";import{D as _h,F as Lh}from"./FileDownload.esm.C6kraHI_.js";var vc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(ac,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});vc.displayName="Add";var bc=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(ac,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),h.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),h.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});bc.displayName="Search";function wc(e="This should not happen"){throw new Error(e)}function Fn(e,t="Assertion failed"){if(!e)return wc(t)}function ao(e,t){return wc(t??"Hell froze over")}function Fh(e,t){try{return e()}catch{return t}}const zl=Object.prototype.hasOwnProperty;function xi(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&xi(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(zl.call(e,n)&&++i&&!zl.call(t,n)||!(n in t)||!xi(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var Ah=Object.prototype,Hh=Ah.hasOwnProperty;function zh(e,t){return e!=null&&Hh.call(e,t)}var $h=zh,Vh=$h,Nh=Af;function Bh(e,t){return e!=null&&Nh(e,t,Vh)}var Wh=Bh;const Uh=Mi(Wh),sa=null,Ns=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 $l;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})($l||($l={}));var la;(function(e){e.Triangle="triangle",e.Dots="dots"})(la||(la={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function Vl(e){return typeof e=="object"?e:await e()}function pi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function bi(e){return e.kind===jn.Marker||e.kind===jn.NewRow}function Ki(e){if(!pi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function Yh(e){return Uh(e,"editor")}function Bs(e){return!(e.readonly??!1)}var jn;(function(e){e.NewRow="new-row",e.Marker="marker"})(jn||(jn={}));function Xh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let Nl;const wr=class wr{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new wr(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=Xh([...this.items,n]);return new wr(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const c=[];s<i&&c.push([s,i]),r<l&&c.push([r,l]),n.splice(o,1,...c)}}return new wr(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};dt(wr,"empty",()=>Nl??(Nl=new wr([]))),dt(wr,"fromSingleSelection",t=>wr.empty().add(t));let vt=wr;var Gh=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Bl=Gh,jh=e=>e.toUpperCase()===e,qh=e=>t=>e.indexOf(t)===-1,yc=(e,t)=>{const n={};return Object.keys(e).filter(qh(t)).forEach(i=>{n[i]=e[i]}),n};function Kh(e,t,n){const i=yc(t,n);if(!e){const r=typeof es=="function"?{default:es}:es;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var Zh=(e,t)=>{};function Jh(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,c=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!jh(s[0])):n.propsAsIs,u=Kh(c,o,["as","class"]);u.ref=a,u.className=n.atomic?Bl(n.class,u.className||l):Bl(u.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],y=b[0],w=b[1]||"",S=typeof y=="function"?y(o):y;Zh(S,n.name),f[`--${p}`]=`${S}${w}`}const g=u.style||{},m=Object.keys(g);m.length>0&&m.forEach(p=>{f[p]=g[p]}),u.style=f}return e.__linaria&&e!==s?(u.as=s,ne.createElement(e,u)):ne.createElement(s,u)},r=ne.forwardRef?ne.forwardRef(i):o=>{const a=yc(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var dn=Jh;const Qh=dn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var Cc={},Ea={},Ws={},rs={},Wl;function eg(){return Wl||(Wl=1,function(e){(function(t,n){n(e,h,Hf)})(Hs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(w){return w&&w.__esModule?w:{default:w}}var s=Object.assign||function(w){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(w[C]=M[C])}return w};function l(w,S){var M={};for(var C in w)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(M[C]=w[C]);return M}function c(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&w(S.prototype,M),C&&w(S,C),S}}();function d(w,S){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:w}function f(w,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);w.prototype=Object.create(S&&S.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(w,S):w.__proto__=S)}var g=!1;function m(w){g=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return g?w:w.capture}function b(w){if("touches"in w){var S=w.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=w.screenX,R=w.screenY;return{x,y:R}}var y=function(w){f(S,w);function S(){var M;c(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return u(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,H=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:H},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(rs)),rs}(function(e){(function(t,n){n(e,eg())})(Hs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(Ws);var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var _r=tg(zf);function tg(e){return e&&e.__esModule?e:{default:e}}function ng(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rg={ROOT:function(t){return(0,_r.default)(ng({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};fo.default=rg;var ho={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.outerWidth=void 0;var ig=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Ia.outerWidth=ig;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var og=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=og;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var ag=function(){return window};go.default=ag;Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var rr=ug(h),jr=Ta(fo),sg=Ia,Ul=Ta(Ri),lg=Ta(Ws),Vo=Ta(go);function Ta(e){return e&&e.__esModule?e:{default:e}}function Sc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Sc=function(){return e},e}function ug(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=Sc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function Ss(){return Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ss.apply(this,arguments)}function cg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fg(e,t,n){return t&&dg(e.prototype,t),e}function hg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xs(e,t)}function xs(e,t){return xs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},xs(e,t)}function gg(e){var t=pg();return function(){var i=ua(e),r;if(t){var o=ua(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return mg(this,r)}}function mg(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:xn(e)}function xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pg(){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 ua(e){return ua=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ua(e)}function mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vg=function(t){return t.hasOwnProperty("key")},Us=function(e){hg(n,e);var t=gg(n);function n(i){var r;return cg(this,n),r=t.call(this,i),mn(xn(r),"itemsWrapperRef",void 0),mn(xn(r),"itemsListRef",void 0),mn(xn(r),"thumbsRef",void 0),mn(xn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),mn(xn(r),"setItemsListRef",function(o){r.itemsListRef=o}),mn(xn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),mn(xn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=rr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,sg.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),c=l<o,u=c?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:c?r.getFirstItem(f.selectedItem):0,lastPosition:u,showArrows:c}})}}),mn(xn(r),"handleClickItem",function(o,a,s){if(!vg(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),mn(xn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),mn(xn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),mn(xn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=rr.Children.count(r.props.children),c=-(r.state.firstItem*100)/r.state.visibleItems,u=Math.max(l-r.state.visibleItems,0),d=-u*100/r.state.visibleItems;c===s&&a>0&&(a=0),c===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,g=c+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,Ul.default)(g,"%",r.props.axis)}),!0}),mn(xn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),mn(xn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),mn(xn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return fg(n,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,Vo.default)().addEventListener("resize",this.updateSizes),(0,Vo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Vo.default)().removeEventListener("resize",this.updateSizes),(0,Vo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(u){return r.setThumbsRef(u,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return rr.default.createElement("li",Ss({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=rr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},c=-this.state.firstItem*(this.state.itemSize||0),u=(0,Ul.default)(c,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:u,MozTransform:u,MsTransform:u,OTransform:u,transform:u,msTransform:u,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},rr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},rr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},rr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?rr.default.createElement(lg.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):rr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(g){return r.setItemsListRef(g)},style:l},this.renderItems()),rr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(rr.Component);ho.default=Us;mn(Us,"displayName","Thumbs");mn(Us,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.default=void 0;var bg=function(){return document};Da.default=bg;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.setPosition=Hn.getPosition=Hn.isKeyboardEvent=Hn.defaultStatusFormatter=Hn.noop=void 0;var wg=h,yg=Cg(Ri);function Cg(e){return e&&e.__esModule?e:{default:e}}var Sg=function(){};Hn.noop=Sg;var xg=function(t,n){return"".concat(t," of ").concat(n)};Hn.defaultStatusFormatter=xg;var kg=function(t){return t?t.hasOwnProperty("key"):!1};Hn.isKeyboardEvent=kg;var Mg=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=wg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};Hn.getPosition=Mg;var Rg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,yg.default)(t,"%",n)}),i};Hn.setPosition=Rg;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.fadeAnimationHandler=hr.slideStopSwipingHandler=hr.slideSwipeAnimationHandler=hr.slideAnimationHandler=void 0;var xc=h,Eg=Ig(Ri),gr=Hn;function Ig(e){return e&&e.__esModule?e:{default:e}}function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yl(Object(n),!0).forEach(function(i){Tg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Tg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Dg=function(t,n){var i={},r=n.selectedItem,o=r,a=xc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,gr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,gr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,gr.setPosition)(0,t.axis)),i;var l=(0,gr.getPosition)(r,t),c=(0,Eg.default)(l,"%",t.axis),u=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:c,msTransform:c,OTransform:c,transform:c},n.swiping||(i.itemListStyle=Jr(Jr({},i.itemListStyle),{},{WebkitTransitionDuration:u,MozTransitionDuration:u,OTransitionDuration:u,transitionDuration:u,msTransitionDuration:u})),i};hr.slideAnimationHandler=Dg;var Og=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=xc.Children.count(n.children),l=0,c=(0,gr.getPosition)(i.selectedItem,n),u=n.infiniteLoop?(0,gr.getPosition)(s-1,n)-100:(0,gr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;c===l&&d>0&&(f=0),c===u&&d<0&&(f=0);var g=c+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&g>-100?g-=s*100:i.selectedItem===s-1&&g<-s*100&&(g+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,gr.setPosition)(g,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};hr.slideSwipeAnimationHandler=Og;var Pg=function(t,n){var i=(0,gr.getPosition)(n.selectedItem,t),r=(0,gr.setPosition)(i,t.axis);return{itemListStyle:r}};hr.slideStopSwipingHandler=Pg;var _g=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return n.swiping||(o=Jr(Jr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Jr(Jr({},o),{},{opacity:1,position:"relative"}),prevStyle:Jr({},o)}};hr.fadeAnimationHandler=_g;Object.defineProperty(Ea,"__esModule",{value:!0});Ea.default=void 0;var At=Ag(h),Lg=mo(Ws),yr=mo(fo),Fg=mo(ho),No=mo(Da),Bo=mo(go),Zi=Hn,ca=hr;function mo(e){return e&&e.__esModule?e:{default:e}}function kc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return kc=function(){return e},e}function Ag(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=kc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function ks(){return ks=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ks.apply(this,arguments)}function Xl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xl(Object(n),!0).forEach(function(i){ht(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Hg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function $g(e,t,n){return t&&zg(e.prototype,t),e}function Vg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ms(e,t)}function Ms(e,t){return Ms=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ms(e,t)}function Ng(e){var t=Wg();return function(){var i=da(e),r;if(t){var o=da(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Bg(this,r)}}function Bg(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:mt(e)}function mt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function da(e){return da=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},da(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ys=function(e){Vg(n,e);var t=Ng(n);function n(i){var r;Hg(this,n),r=t.call(this,i),ht(mt(r),"thumbsRef",void 0),ht(mt(r),"carouselWrapperRef",void 0),ht(mt(r),"listRef",void 0),ht(mt(r),"itemsRef",void 0),ht(mt(r),"timer",void 0),ht(mt(r),"animationHandler",void 0),ht(mt(r),"setThumbsRef",function(a){r.thumbsRef=a}),ht(mt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),ht(mt(r),"setListRef",function(a){r.listRef=a}),ht(mt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),ht(mt(r),"autoPlay",function(){At.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),ht(mt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),ht(mt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),ht(mt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),ht(mt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),ht(mt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,No.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,No.default)().activeElement)):!1}),ht(mt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",c={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},u=l?c.ArrowRight:c.ArrowDown,d=l?c.ArrowLeft:c.ArrowUp;u===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),ht(mt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),ht(mt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),ht(mt(r),"handleClickItem",function(a,s){if(At.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),ht(mt(r),"handleOnChange",function(a,s){At.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),ht(mt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),ht(mt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),ht(mt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),ht(mt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(mt(r)));return r.setState(ir({},l)),!!Object.keys(l).length}),ht(mt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),ht(mt(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),ht(mt(r),"moveTo",function(a){if(typeof a=="number"){var s=At.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),ht(mt(r),"onClickNext",function(){r.increment(1)}),ht(mt(r),"onClickPrev",function(){r.decrement(1)}),ht(mt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(mt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(mt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),ht(mt(r),"selectItem",function(a){r.setState(ir({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,At.Children.toArray(r.props.children)[a.selectedItem])}),ht(mt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),ht(mt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var c=l[0];if(!c.complete){var u=function g(){r.forceUpdate(),c.removeEventListener("load",g)};c.addEventListener("load",u)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ca.fadeAnimationHandler||ca.slideAnimationHandler,r.state=ir(ir({},o),r.animationHandler(i,o)),r}return $g(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(ir({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&At.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,No.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,No.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var o=this;return this.props.children?At.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,c=s===o.state.previousItem,u=l&&o.state.selectedStyle||c&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(u=ir(ir({},u),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(u=ir(ir({},u),{},{pointerEvents:"none"}));var d={ref:function(g){return o.setItemsRef(g,s)},key:"itemKey"+s+(r?"clone":""),className:yr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:u};return At.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,c=o.children;return a?At.default.createElement("ul",{className:"control-dots"},At.Children.map(c,function(u,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?At.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,At.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||At.Children.count(this.props.children)===0?null:At.default.createElement(Fg.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||At.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&At.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&At.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,c=s&&(this.state.selectedItem<At.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,u=this.renderItems(!0),d=u.shift(),f=u.pop(),g={className:yr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(g.onSwipeLeft=this.onSwipeForward,g.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else g.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,g.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,g.style=ir(ir({},g.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return At.default.createElement("div",{"aria-label":this.props.ariaLabel,className:yr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},At.default.createElement("div",{className:yr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),At.default.createElement("div",{className:yr.default.WRAPPER(!0,this.props.axis),style:m},o?At.default.createElement(Lg.default,ks({tagName:"ul",innerRef:this.setListRef},g,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):At.default.createElement("ul",{className:yr.default.SLIDER(!0,this.state.swiping),ref:function(y){return r.setListRef(y)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,c,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(At.default.Component);Ea.default=Ys;ht(Ys,"displayName","Carousel");ht(Ys,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return At.default.createElement("li",{className:yr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=At.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=At.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ca.slideSwipeAnimationHandler,stopSwipingHandler:ca.slideStopSwipingHandler});var Ug={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Ea),n=Ug,i=r(ho);function r(o){return o&&o.__esModule?o:{default:o}}})(Cc);var Yg=$f,Xg=function(){return Yg.Date.now()},Gg=Xg,jg=sc,is=Gg,Gl=lc,qg="Expected a function",Kg=Math.max,Zg=Math.min;function Jg(e,t,n){var i,r,o,a,s,l,c=0,u=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(qg);t=Gl(t)||0,jg(n)&&(u=!!n.leading,d="maxWait"in n,o=d?Kg(Gl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function g(x){var R=i,I=r;return i=r=void 0,c=x,a=e.apply(I,R),a}function m(x){return c=x,s=setTimeout(y,t),u?g(x):a}function p(x){var R=x-l,I=x-c,E=t-R;return d?Zg(E,o-I):E}function b(x){var R=x-l,I=x-c;return l===void 0||R>=t||R<0||d&&I>=o}function y(){var x=is();if(b(x))return w(x);s=setTimeout(y,p(x))}function w(x){return s=void 0,f&&i?g(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),c=0,i=l=r=s=void 0}function M(){return s===void 0?a:w(is())}function C(){var x=is(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(y,t),g(l)}return s===void 0&&(s=setTimeout(y,t)),a}return C.cancel=S,C.flush=M,C}var Mc=Jg;const Rc=Mi(Mc);function cn(e,t,n,i,r=!1){const o=h.useRef();o.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var c;(c=o.current)==null||c.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Zr(e,t){return e===void 0?void 0:t}const Qg=Math.PI;function jl(e){return e*Qg/180}const Ec=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Ic=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Tc=(e,t,n)=>Math.min(e,t-n*2),Dc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Xs=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),h.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},em=e=>{const t=e.fgColor??"currentColor";return h.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function tm(e,t,n){const[i,r]=h.useState(e),o=h.useRef(!0);h.useEffect(()=>()=>{o.current=!1},[]);const a=h.useRef(Rc(s=>{o.current&&r(s)},n));return h.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const nm="֑-߿יִ-﷽ﹰ-ﻼ",rm="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",im=new RegExp("^[^"+rm+"]*["+nm+"]");function Gs(e){return im.test(e)?"rtl":"not-rtl"}let Wo;function Rs(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Wo=n-i,Wo}const qr=Symbol();function om(e){const t=h.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=h.useState(e),[,r]=h.useState(),o=h.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(c=>typeof s=="function"?s(l===qr?c:l):s),t.current[0]=qr)},[]),a=h.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function Oc(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function am(e){const t=h.useRef(e);return xi(e,t.current)||(t.current=e),t.current}const sm=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return h.createElement(Qh,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(Cc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??h.createElement("img",{draggable:!1,src:s});return h.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&h.createElement("button",{className:"gdg-edit-icon",onClick:i},h.createElement(Xs,null)))};function Pc(){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 ti=Pc();function lm(e){ti=e}const _c=/[&<>"']/,um=new RegExp(_c.source,"g"),Lc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cm=new RegExp(Lc.source,"g"),dm={"&":"&","<":"<",">":">",'"':""","'":"'"},ql=e=>dm[e];function pn(e,t){if(t){if(_c.test(e))return e.replace(um,ql)}else if(Lc.test(e))return e.replace(cm,ql);return e}const fm=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Fc(e){return e.replace(fm,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const hm=/(^|[^\[])\^/g;function Vt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(hm,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const gm=/[^\w:]/g,mm=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Kl(e,t,n){if(e){let i;try{i=decodeURIComponent(Fc(n)).replace(gm,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!mm.test(n)&&(n=wm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},pm=/^[^:]+:\/*[^/]*$/,vm=/^([^:]+:)[\s\S]*$/,bm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function wm(e,t){Uo[" "+e]||(pm.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=ra(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(vm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(bm,"$1")+t:e+t}const fa={exec:function(){}};function Zl(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function ra(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function ym(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function Cm(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Jl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Ql(e,t,n,i){const r=t.href,o=t.title?pn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:pn(a)}}function Sm(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
|
3
3
|
`).map(r=>{const o=r.match(/^\s+/);if(o===null)return r;const[a]=o;return a.length>=i.length?r.slice(i.length):r}).join(`
|
4
4
|
`)}class js{constructor(t){this.options=t||ti}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:ra(i,`
|
5
5
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=Sm(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=ra(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:o,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,o,a,s,l,c,u,d,f,g,m,p=n[1].trim();const b=p.length>1,y={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const w=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=w.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),u=n[2].split(`
|
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
|
|
169
169
|
`?(i.push(e.slice(r,a)),r=a+1,s===`
|
170
170
|
`&&(n.push(i),i=[])):s==='"'&&(o=t.inString);break;case t.inString:s==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?o=t.inString:((s===" "||s===`
|
171
171
|
`)&&(i.push(vu(e.slice(r,a))),r=a+1,s===`
|
172
|
-
`&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(vu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function bu(e,t,n){var s;const i=tv(e,t),r=l=>{var c;(c=window.navigator.clipboard)==null||c.writeText(l)},o=(l,c)=>{var u;return((u=window.navigator.clipboard)==null?void 0:u.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})]),!0)},a=(l,c)=>{var u,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(u=n==null?void 0:n.clipboardData)==null||u.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",c)}catch{o(l,c)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function dd(e){return e!==!0}function wu(e){return typeof e=="string"?e:`${e}px`}const iv=()=>e=>e.innerWidth,ov=()=>e=>e.innerHeight,av=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[iv()],"wmyidgi-1":[ov()]}}),sv=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return h.createElement(av,{innerHeight:wu(n),innerWidth:wu(t),...r},i)},lv=2,uv=1300;function cv(e,t,n){const i=ne.useRef(0),[r,o]=e??[0,0];ne.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=c=>{var u;if(!a){if(s===0)s=c;else{const d=c-s;i.current=Math.min(1,i.current+d/uv);const f=i.current**1.618*d*lv;(u=t.current)==null||u.scrollBy(r*f,o*f),s=c,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function dv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,c,u,d,f,g]=ne.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=Kc();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:c,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:g}}const Fr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function yu(e){const t=pa.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function fv(e){const t=am(e);return ne.useMemo(()=>{if(t===void 0)return yu(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return yu({...Fr,...n})},[t])}function hv(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function tl(e,t){const n=[];function i(a,s,l=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let u=0;u<a.subGroups.length;u++){const d=u<a.subGroups.length-1?a.subGroups[u+1].headerIndex:s;i(a.subGroups[u],d,l||a.isCollapsed)}}const r=hv(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function ba(e,t){if(t===void 0||tl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function gv(e,t,n,i){const r=ne.useMemo(()=>e===void 0?void 0:tl(e,t),[e,t]),o=ne.useMemo(()=>r===void 0?t:r.reduce((c,u)=>c+(u.isCollapsed?1:u.rows+1),0),[r,t]),a=ne.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>{const{isGroupHeader:u}=ba(c,r);return u?e.height:typeof n=="number"?n:n(c)},[r,e,n]),s=ne.useCallback(c=>{if(r===void 0)return c;let u=c;for(const d of r){if(u===0)return;if(u--,!d.isCollapsed){if(u<d.rows)return d.contentIndex+u;u-=d.rows}}return c},[r]),l=Zr(i??(e==null?void 0:e.themeOverride),ne.useCallback(c=>{if(e===void 0)return i==null?void 0:i(c,c,c);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:d,groupIndex:f}=ba(c,r);return u?e.themeOverride:i==null?void 0:i(c,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function mv(e,t){const n=ne.useMemo(()=>e===void 0?void 0:tl(e,t),[e,t]);return{getRowGroupingForPath:hd,updateRowGroupingByPath:fd,mapper:ne.useCallback(i=>{if(typeof i=="number")return ba(i,n);const r=ba(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function fd(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:fd(o.subGroups??[],r,n)}:o)}function hd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:hd(e[n].subGroups??[],i)}function pv(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function vv(e,t,n,i,r){const[o,a]=h.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=h.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,c,u]=om(s),d=h.useRef(r);d.current=r;const f=pv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),g=(l.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&g){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&u(),d.current()}},[t,g,u,f]);const m=(l.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&u(),d.current()}},[e,m,u,f]),{visibleRegion:l,setVisibleRegion:c,scrollRef:f}}const bv=h.lazy(async()=>await zs(()=>import("./data-grid-overlay-editor.4d_NBoKr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let wv=0;function yv(e){return Mp(Ll(Ll(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return dr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function Xo(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 Go={kind:Z.Loading,allowOverlay:!1},jo={columns:vt.empty(),rows:vt.empty(),current:void 0},Cv=(e,t)=>{var Ol,Pl,_l;const[n,i]=h.useState(jo),[r,o]=h.useState(),a=h.useRef(null),s=h.useRef(null),[l,c]=h.useState(),u=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:g,markdownDivCreateNode:m,width:p,height:b,columns:y,rows:w,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:H,editorBloom:z,onHeaderClicked:L,onColumnProposeMove:F,rangeSelectionColumnSpanning:P=!0,spanRangeBehavior:Q="default",onGroupHeaderClicked:q,onCellContextMenu:ae,className:de,onHeaderContextMenu:me,getCellsForSelection:re,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:le,onCellEdited:ie,onCellsEdited:pe,onSearchResultsChanged:ye,searchResults:G,onSearchValueChange:O,searchValue:k,onKeyDown:V,onKeyUp:se,keybindings:Pe,editOnType:Ne=!0,onRowAppended:ve,onColumnMoved:Be,validateCell:xe,highlightRegions:xt,rangeSelect:Tt="rect",columnSelect:Je="multi",rowSelect:te="multi",rangeSelectionBlending:rt="exclusive",columnSelectionBlending:ue="exclusive",rowSelectionBlending:oe="exclusive",onDelete:ge,onDragStart:$e,onMouseMove:ze,onPaste:tt,copyHeaders:fe=!1,freezeColumns:Ee=0,cellActivationBehavior:st="second-click",rowSelectionMode:Le="auto",onHeaderMenuClick:Ge,onHeaderIndicatorClick:pt,getGroupDetails:lt,rowGrouping:_e,onSearchClose:Dt,onItemHovered:Xt,onSelectionCleared:Ot,showSearch:$t,onVisibleRegionChanged:Zt,gridSelection:Ht,onGridSelectionChange:Mn,minColumnWidth:Nt=50,maxColumnWidth:kt=500,maxColumnAutoWidth:Dn,provideEditor:vn,trailingRowOptions:Oe,freezeTrailingRows:Lt=0,allowedFillDirections:un="orthogonal",scrollOffsetX:fn,scrollOffsetY:hn,verticalBorder:ot,onDragOverCell:Gt,onDrop:Ft,onColumnResize:Jt,onColumnResizeEnd:Pt,onColumnResizeStart:Se,customRenderers:he,fillHandle:wt,experimental:_t,fixedShadowX:yt,fixedShadowY:Bt,headerIcons:bn,imageWindowLoader:zn,initialSize:wn,isDraggable:_,onDragLeave:nt,onRowMoved:Qe,overscrollX:Wt,overscrollY:On,preventDiagonalScrolling:yn,rightElement:qn,rightElementProps:Pn,trapFocus:Qt=!1,smoothScrollX:$n,smoothScrollY:Kn,scaleToRem:Fa=!1,rowHeight:bo=34,headerHeight:wo=36,groupHeaderHeight:Aa=wo,theme:ii,isOutsideClick:Mr,renderers:Ii,resizeIndicator:Ha,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,oi=(en==null?void 0:en.theme)??e.rowMarkerTheme,vr=en==null?void 0:en.headerTheme,br=en==null?void 0:en.headerAlwaysVisible,ai=te!=="multi",ar=(en==null?void 0:en.checkboxStyle)??"square",sr=Math.max(Nt,20),Br=Math.max(kt,sr),yo=Math.max(Dn??Br,sr),_i=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:Co,rowHeight:So,getRowThemeOverride:Vn}=gv(_e,w,bo,g),xo=h.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:Zn,headerHeight:Li,groupHeaderHeight:ko,theme:Mo,overscrollX:za,overscrollY:$a}=dv({groupHeaderHeight:Aa,headerHeight:wo,overscrollX:Wt,overscrollY:On,remSize:xo,rowHeight:So,scaleToRem:Fa,theme:ii}),Nn=fv(Pe),Rr=Oi??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=Rn!=="none",B=Bn?1:0,qt=ve!==void 0,Er=(Oe==null?void 0:Oe.sticky)===!0,[si,li]=h.useState(!1),Fi=$t??si,Va=h.useCallback(()=>{Dt!==void 0?Dt():li(!1)},[Dt]),U=h.useMemo(()=>Ht===void 0?void 0:Xo(Ht,B),[Ht,B])??n,sn=h.useRef();sn.current===void 0&&(sn.current=new AbortController),h.useEffect(()=>()=>sn==null?void 0:sn.current.abort(),[]);const[ln,Na]=q0(re,S,B,sn.current,je),A=h.useCallback((v,D,T)=>{if(xe===void 0)return!0;const N=[v[0]-B,v[1]];return xe==null?void 0:xe(N,D,T)},[B,xe]),ee=h.useRef(Ht),Ce=h.useCallback((v,D)=>{D&&(v=nv(v,ln,B,Q,sn.current)),Mn!==void 0?(ee.current=Xo(v,-B),Mn(ee.current)):i(v)},[Mn,ln,B,Q]),ke=Zr(Jt,h.useCallback((v,D,T,N)=>{Jt==null||Jt(y[T-B],D,T-B,N)},[Jt,B,y])),ce=Zr(Pt,h.useCallback((v,D,T,N)=>{Pt==null||Pt(y[T-B],D,T-B,N)},[Pt,B,y])),Re=Zr(Se,h.useCallback((v,D,T,N)=>{Se==null||Se(y[T-B],D,T-B,N)},[Se,B,y])),it=Zr(E,h.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),at=Zr(H,h.useCallback((v,D)=>(H==null?void 0:H({...v,col:v.col-B},D))??!1,[H,B])),Te=h.useCallback(v=>{if(ge!==void 0){const D=ge(Xo(v,-B));return typeof D=="boolean"?D:Xo(D,B)}return!0},[ge,B]),[Mt,Me,qe]=j0(U,Ce,rt,ue,oe,Tt,P),We=h.useMemo(()=>Sr(Kc(),Mo),[Mo]),[ft,an]=h.useState([0,0,0]),En=h.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),Ct=h.useCallback(v=>v.kind!==Z.Custom?En[v.kind]:he==null?void 0:he.find(D=>D.isMatch(v)),[he,En]);let{sizedColumns:Kt,nonGrowWidth:Jn}=ep(y,je,Na,ft[0]-(B===0?0:Rr)-ft[2],sr,yo,We,Ct,sn.current);Rn!=="none"&&(Jn+=Rr);const Cn=h.useMemo(()=>Kt.some(v=>v.group!==void 0),[Kt]),It=Cn?Li+ko:Li,In=U.rows.length,_n=Rn==="none"?void 0:In===0?!1:In===je?!0:void 0,St=h.useMemo(()=>Rn==="none"?Kt:[{title:"",width:Rr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:oi,rowMarker:ar,rowMarkerChecked:_n,headerRowMarkerTheme:vr,headerRowMarkerAlwaysVisible:br,headerRowMarkerDisabled:ai},...Kt],[Rn,Kt,Rr,oi,ar,_n,vr,br,ai]),tn=h.useRef({height:1,width:1,x:0,y:0}),Ir=h.useRef(!1),{setVisibleRegion:Tr,visibleRegion:Wr,scrollRef:Ut}=vv(fn,hn,Zn,tn,()=>Ir.current=!0);tn.current=Wr;const rf=Wr.x+B,Ro=Wr.y,Tn=h.useRef(null),Sn=h.useCallback(v=>{var D;v===!0?(D=Tn.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=Tn.current)==null||T.focus()})},[]),gn=qt?je+1:je,Wn=h.useCallback(v=>{const D=B===0?v:v.map(N=>({...N,location:[N.location[0]-B,N.location[1]]})),T=pe==null?void 0:pe(D);if(T!==!0)for(const N of D)ie==null||ie(N.location,N.value);return T},[ie,pe,B]),[Ur,Ba]=h.useState(),Eo=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ui=Nr?(Ol=U.current)==null?void 0:Ol.cell:void 0,Io=ui==null?void 0:ui[0],To=ui==null?void 0:ui[1],of=h.useMemo(()=>{if((xt===void 0||xt.length===0)&&(Eo??Io??To??Ur)===void 0)return;const v=[];if(xt!==void 0)for(const D of xt){const T=St.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ei(We.accentColor,0),range:Ur,style:"dashed"}),Eo!==void 0&&v.push({color:ei(We.accentColor,.5),range:Eo,style:"solid-outline"}),Io!==void 0&&To!==void 0&&v.push({color:We.accentColor,range:{x:Io,y:To,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Eo,Io,To,xt,St.length,We.accentColor,B]),vl=h.useRef(St);vl.current=St;const Ln=h.useCallback(([v,D],T=!1)=>{var X,W,Y,j,K,be,Fe;const N=qt&&D===gn-1;if(v===0&&Bn){if(N)return Go;const we=Co(D);return we===void 0?Go:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ar,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Pi+we,drawHandle:Qe!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(N){const He=v===B?(Oe==null?void 0:Oe.hint)??"":"",De=vl.current[v];if(((X=De==null?void 0:De.trailingRowOptions)==null?void 0:X.disabled)===!0)return Go;{const gt=((W=De==null?void 0:De.trailingRowOptions)==null?void 0:W.hint)??He,Ue=((Y=De==null?void 0:De.trailingRowOptions)==null?void 0:Y.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:jn.NewRow,hint:gt,allowOverlay:!1,icon:Ue}}}else{const we=v-B;if(T||(_t==null?void 0:_t.strict)===!0){const De=tn.current,gt=De.x>we||we>De.x+De.width||De.y>D||D>De.y+De.height||D>=Ua.current,Ue=we===((K=(j=De.extras)==null?void 0:j.selected)==null?void 0:K[0])&&D===((be=De.extras)==null?void 0:be.selected[1]);let Ae=!1;if(((Fe=De.extras)==null?void 0:Fe.freezeRegions)!==void 0){for(const Rt of De.extras.freezeRegions)if(Qr(Rt,we,D)){Ae=!0;break}}if(gt&&!Ue&&!Ae)return Go}let He=S([we,D]);return B!==0&&He.span!==void 0&&(He={...He,span:[He.span[0]+B,He.span[1]+B]}),He}},[qt,gn,Bn,Co,ar,U==null?void 0:U.rows,Rn,Pi,Qe,B,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,_t==null?void 0:_t.strict,S]),Wa=h.useCallback(v=>{let D=(lt==null?void 0:lt(v))??{name:v};return le!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Xa({group:D.name,bounds:T.bounds})}]}),D},[lt,le]),Do=h.useCallback(v=>{var Y;const[D,T]=v.cell,N=St[D],$=(N==null?void 0:N.group)!==void 0?(Y=Wa(N.group))==null?void 0:Y.overrideTheme:void 0,X=N==null?void 0:N.themeOverride,W=Vn==null?void 0:Vn(T);o({...v,theme:Sr(We,$,X,W,v.content.themeOverride)})},[Vn,St,Wa,We]),ci=h.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[N,$]=U.current.cell,X=Ln([N,$]);if(X.kind!==Z.Boolean&&X.allowOverlay){let Y=X;if(T!==void 0)switch(Y.kind){case Z.Number:{const j=Fh(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(j)?0:j};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Do({target:v,content:Y,initialValue:T,cell:[N,$],highlight:T===void 0,forceEditMode:T!==void 0})}else X.kind===Z.Boolean&&D&&X.readonly!==!0&&(Wn([{location:U.current.cell,value:{...X,data:dd(X.data)}}]),(W=Tn.current)==null||W.damage([{cell:U.current.cell}]))},[Ln,U,Wn,Do]),bl=h.useCallback((v,D)=>{var $;const T=($=Tn.current)==null?void 0:$.getBounds(v,D);if(T===void 0||Ut.current===null)return;const N=Ln([v,D]);N.allowOverlay&&Do({target:T,content:N,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Ln,Ut,Do]),rn=h.useCallback((v,D,T="both",N=0,$=0,X=void 0)=>{if(Ut.current!==null){const W=Tn.current,Y=s.current,j=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,be=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Fe=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&Y!==null){let we={x:0,y:0,width:0,height:0},He=0,De=0;if((j!==void 0||K!==void 0)&&(we=W.getBounds((j??0)+B,K??0)??we,we.width===0||we.height===0))return;const gt=Y.getBoundingClientRect(),Ue=gt.width/Y.offsetWidth;if(be!==void 0&&(we={...we,x:be-gt.left-Ut.current.scrollLeft,width:1}),Fe!==void 0&&(we={...we,y:Fe+gt.top-Ut.current.scrollTop,height:1}),we!==void 0){const Ae={x:we.x-N,y:we.y-$,width:we.width+2*N,height:we.height+2*$};let Rt=0;for(let Qa=0;Qa<Ee;Qa++)Rt+=Kt[Qa].width;let jt=0;const on=Lt+(Er?1:0);on>0&&(jt=ni(gn,on,Zn));let tr=Rt*Ue+gt.left+B*Rr*Ue,ur=gt.right,nr=gt.top+It*Ue,cr=gt.bottom-jt*Ue;const Ho=we.width+N*2;switch(X==null?void 0:X.hAlign){case"start":ur=tr+Ho;break;case"end":tr=ur-Ho;break;case"center":tr=Math.floor((tr+ur)/2)-Ho/2,ur=tr+Ho;break}const zo=we.height+$*2;switch(X==null?void 0:X.vAlign){case"start":cr=nr+zo;break;case"end":nr=cr-zo;break;case"center":nr=Math.floor((nr+cr)/2)-zo/2,cr=nr+zo;break}tr>Ae.x?He=Ae.x-tr:ur<Ae.x+Ae.width&&(He=Ae.x+Ae.width-ur),nr>Ae.y?De=Ae.y-nr:cr<Ae.y+Ae.height&&(De=Ae.y+Ae.height-cr),T==="vertical"||typeof v=="number"&&v<Ee?He=0:(T==="horizontal"||typeof D=="number"&&D>=gn-on)&&(De=0),(He!==0||De!==0)&&(Ue!==1&&(He/=Ue,De/=Ue),Ut.current.scrollTo(He+Ut.current.scrollLeft,De+Ut.current.scrollTop))}}}},[B,Lt,Rr,Ut,It,Ee,Kt,gn,Er,Zn]),wl=h.useRef(bl),yl=h.useRef(S),Ua=h.useRef(je);wl.current=bl,yl.current=S,Ua.current=je;const di=h.useCallback(async(v,D=!0)=>{var j;const T=St[v];if(((j=T==null?void 0:T.trailingRowOptions)==null?void 0:j.disabled)===!0)return;const N=ve==null?void 0:ve();let $,X=!0;N!==void 0&&($=await N,$==="top"&&(X=!1),typeof $=="number"&&(X=!1));let W=0;const Y=()=>{if(Ua.current<=je){W<500&&window.setTimeout(Y,W),W=50+W*2;return}const K=typeof $=="number"?$:X?je:0;Ao.current(v-B,K),Mt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const be=yl.current([v-B,K]);be.allowOverlay&&Ki(be)&&be.readonly!==!0&&D&&window.setTimeout(()=>{wl.current(v,K)},0)};Y()},[St,ve,B,je,Mt]),Oo=h.useCallback(v=>{var T,N;const D=((N=(T=Kt[v])==null?void 0:T.trailingRowOptions)==null?void 0:N.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof D=="number")return D+(Bn?1:0);if(typeof D=="object"){const $=y.indexOf(D);if($>=0)return $+(Bn?1:0)}},[Kt,y,Bn,Oe==null?void 0:Oe.targetColumn]),Dr=h.useRef(),fi=h.useRef(),Hi=h.useCallback((v,D)=>{var $;const[T,N]=D;return Sr(We,($=St[T])==null?void 0:$.themeOverride,Vn==null?void 0:Vn(N),v.themeOverride)},[Vn,St,We]),{mapper:Yr}=mv(_e,w),Qn=_e==null?void 0:_e.navigationBehavior,zi=h.useCallback(v=>{var be,Fe,we;const D=pa.value?v.metaKey:v.ctrlKey,T=D&&te==="multi",N=D&&Je==="multi",[$,X]=v.location,W=U.columns,Y=U.rows,[j,K]=((be=U.current)==null?void 0:be.cell)??[];if(v.kind==="cell"){if(fi.current=void 0,Xr.current=[$,X],$===0&&Bn){if(qt===!0&&X===je||Rn==="number"||te==="none")return;const He=Ln(v.location);if(He.kind!==jn.Marker)return;if(Qe!==void 0){const Ue=Ct(He);Fn((Ue==null?void 0:Ue.kind)===jn.Marker);const Ae=(Fe=Ue==null?void 0:Ue.onClick)==null?void 0:Fe.call(Ue,{...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(He,v.location),preventDefault:()=>{}});if(Ae===void 0||Ae.checked===He.checked)return}o(void 0),Sn();const De=Y.hasIndex(X),gt=Dr.current;if(te==="multi"&&(v.shiftKey||v.isLongTouch===!0)&>!==void 0&&Y.hasIndex(gt)){const Ue=[Math.min(gt,X),Math.max(gt,X)+1];T||Le==="multi"?Me(void 0,Ue,!0):Me(vt.fromSingleSelection(Ue),void 0,T)}else te==="multi"&&(T||v.isTouch||Le==="multi")?De?Me(Y.remove(X),void 0,!0):(Me(void 0,X,!0),Dr.current=X):De&&Y.length===1?Me(vt.empty(),void 0,D):(Me(vt.fromSingleSelection(X),void 0,D),Dr.current=X)}else if($>=B&&qt&&X===je){const He=Oo($);di(He??$)}else if(j!==$||K!==X){const He=Ln(v.location),De=Ct(He);if((De==null?void 0:De.onSelect)!==void 0){let Ae=!1;if(De.onSelect({...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Ae=!0,theme:Hi(He,v.location)}),Ae)return}if(Qn==="block"&&Yr(X).isGroupHeader)return;const gt=Er&&X===je,Ue=Er&&U!==void 0&&((we=U.current)==null?void 0:we.cell[1])===je;if((v.shiftKey||v.isLongTouch===!0)&&j!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(gt)return;const Ae=Math.min($,j),Rt=Math.max($,j),jt=Math.min(X,K),on=Math.max(X,K);Mt({...U.current,range:{x:Ae,y:jt,width:Rt-Ae+1,height:on-jt+1}},!0,D,"click"),Dr.current=void 0,Sn()}else Mt({cell:[$,X],range:{x:$,y:X,width:1,height:1}},!0,D,"click"),Dr.current=void 0,o(void 0),Sn()}}else if(v.kind==="header")if(Xr.current=[$,X],o(void 0),Bn&&$===0)Dr.current=void 0,fi.current=void 0,te==="multi"&&(Y.length!==je?Me(vt.fromSingleSelection([0,je]),void 0,D):Me(vt.empty(),void 0,D),Sn());else{const He=fi.current;if(Je==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&He!==void 0&&W.hasIndex(He)){const De=[Math.min(He,$),Math.max(He,$)+1];N?qe(void 0,De,D):qe(vt.fromSingleSelection(De),void 0,D)}else N?(W.hasIndex($)?qe(W.remove($),void 0,D):qe(void 0,$,D),fi.current=$):Je!=="none"&&(qe(vt.fromSingleSelection($),void 0,D),fi.current=$);Dr.current=void 0,Sn()}else v.kind===Gn?Xr.current=[$,X]:v.kind===va&&!v.isMaybeScrollbar&&(Ce(jo,!1),o(void 0),Sn(),Ot==null||Ot(),Dr.current=void 0,fi.current=void 0)},[te,Je,U,Bn,B,qt,je,Rn,Ln,Qe,Sn,Le,Ct,Hi,Me,Oo,di,Qn,Yr,Er,Mt,qe,Ce,Ot]),$i=h.useRef(!1),Xr=h.useRef(),Cl=h.useRef(Wr),Un=h.useRef(),af=h.useCallback(v=>{if(hi.current=!1,Cl.current=tn.current,v.button!==0&&v.button!==1){Un.current=void 0;return}const D=performance.now();Un.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:U,fillHandle:T}),Xr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Xr.current=v.location))},[U,zi]),[Ya,Xa]=h.useState(),Sl=h.useCallback(v=>{if(v.kind!==Gn||Je!=="multi")return;const D=pa.value?v.metaKey:v.ctrlKey,[T]=v.location,N=U.columns;if(T<B)return;const $=St[T];let X=T,W=T;for(let Y=T-1;Y>=B&&so($.group,St[Y].group);Y--)X--;for(let Y=T+1;Y<St.length&&so($.group,St[Y].group);Y++)W++;if(Sn(),D)if(N.hasAll([X,W+1])){let Y=N;for(let j=X;j<=W;j++)Y=Y.remove(j);qe(Y,void 0,D)}else qe(void 0,[X,W+1],D);else qe(vt.fromSingleSelection([X,W+1]),void 0,D)},[Je,Sn,U.columns,St,B,qe]),hi=h.useRef(!1),Po=h.useCallback(async v=>{if(ln!==void 0&&ke!==void 0){const D=tn.current.y,T=tn.current.height;let N=ln({x:v,y:D,width:1,height:Math.min(T,je-D)},sn.current.signal);typeof N!="object"&&(N=await N());const $=Kt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const Y=Jc(W,We,$,0,N,sr,Br,!1,Ct);ke==null||ke($,Y.width,v,Y.width)}}},[Kt,ln,Br,We,sr,ke,B,je,Ct]),[sf,Ga]=h.useState(),gi=h.useCallback(async(v,D)=>{var Y,j;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||ln===void 0||D.current===void 0)return;const N=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...N,x:N.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let $=ln(T,sn.current.signal);typeof $!="object"&&($=await $());const X=$,W=[];for(let K=0;K<N.width;K++)for(let be=0;be<N.height;be++){const Fe=[N.x+K,N.y+be];if($c(Fe,T))continue;const we=X[be%T.height][K%T.width];bi(we)||!Ki(we)||W.push({location:Fe,value:{...we}})}Wn(W),(j=Tn.current)==null||j.damage(W.map(K=>({cell:K.location})))},[ln,Wn,x,B]),xl=h.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};gi(v,U)},[gi,U]),kl=h.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};gi(v,U)},[gi,U]),lf=h.useCallback((v,D)=>{var be,Fe;const T=l;if(c(void 0),Ba(void 0),Ga(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((be=T.previousSelection)==null?void 0:be.current)!==void 0){if(Ur===void 0)return;const we={...U,current:{...U.current,range:rd(T.previousSelection.current.range,Ur)}};gi(T.previousSelection,we),Ce(we,!0);return}const[N,$]=v.location,[X,W]=Xr.current??[],Y=()=>{hi.current=!0},j=we=>{var De,gt,Ue;const He=we.isTouch||X===N&&W===$;if(He&&(M==null||M([N-B,$],{...we,preventDefault:Y})),we.button===1)return!hi.current;if(!hi.current){const Ae=Ln(v.location),Rt=Ct(Ae);if(Rt!==void 0&&Rt.onClick!==void 0&&He){const on=Rt.onClick({...we,cell:Ae,posX:we.localEventX,posY:we.localEventY,bounds:we.bounds,theme:Hi(Ae,v.location),preventDefault:Y});on!==void 0&&!bi(on)&&pi(on)&&(Wn([{location:we.location,value:on}]),(De=Tn.current)==null||De.damage([{cell:we.location}]))}if(hi.current||U.current===void 0)return!1;let jt=!1;switch(Ae.activationBehaviorOverride??st){case"double-click":case"second-click":{if(((Ue=(gt=T==null?void 0:T.previousSelection)==null?void 0:gt.current)==null?void 0:Ue.cell)===void 0)break;const[on,tr]=U.current.cell,[ur,nr]=T.previousSelection.current.cell;jt=N===on&&N===ur&&$===tr&&$===nr&&(we.isDoubleClick===!0||st==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return C==null||C([N-B,$]),ci(we.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const we=tn.current,He=Cl.current;if(we.x!==He.x||we.y!==He.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((Fe=U.current)==null?void 0:Fe.cell,v.location)){ae==null||ae([K,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(N)){me==null||me(K,{...v,preventDefault:Y});return}else if(v.kind===Gn){if(K<0)return;J==null||J(K,{...v,preventDefault:Y});return}}v.kind==="cell"?j(v)||zi(v):v.kind===Gn?q==null||q(K,{...v,preventDefault:Y}):(v.kind===Ar&&(L==null||L(K,{...v,preventDefault:Y})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&Po(N):v.button===0&&N===X&&$===W&&(L==null||L(K,{...v,preventDefault:Y}))}if(v.kind===Gn){if(K<0)return;v.button===0&&N===X&&$===W&&(q==null||q(K,{...v,preventDefault:Y}),hi.current||Sl(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&j(v),Xr.current=void 0},[l,U,B,Ur,gi,Ce,M,Ln,Ct,st,Hi,Wn,C,ci,ae,me,J,zi,q,L,Po,Sl]),uf=h.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};ze==null||ze(D),l!==void 0&&v.buttons===0&&(c(void 0),Ba(void 0),Ga(void 0),$i.current=!1),Ga(T=>{var N;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((N=Un.current)==null?void 0:N.location[0])??0)<B?void 0:v.scrollEdge})},[l,ze,B]),cf=h.useCallback((v,D)=>{Ge==null||Ge(v-B,D)},[Ge,B]),df=h.useCallback((v,D)=>{pt==null||pt(v-B,D)},[pt,B]),lr=(Pl=U==null?void 0:U.current)==null?void 0:Pl.cell,ff=h.useCallback((v,D,T,N,$,X)=>{Ir.current=!1;let W=lr;W!==void 0&&(W=[W[0]-B,W[1]]);const Y=Ee===0?void 0:{x:0,y:v.y,width:Ee,height:v.height},j=[];Y!==void 0&&j.push(Y),Lt>0&&(j.push({x:v.x-B,y:je-Lt,width:v.width,height:Lt}),Ee>0&&j.push({x:0,y:je-Lt,width:Ee,height:Lt}));const K={x:v.x-B,y:v.y,width:v.width,height:qt&&v.y+v.height>=je?v.height-1:v.height,tx:$,ty:X,extras:{selected:W,freezeRegion:Y,freezeRegions:j}};tn.current=K,Tr(K),an([D,T,N]),Zt==null||Zt(K,K.tx,K.ty,K.extras)},[lr,B,qt,je,Ee,Lt,Tr,Zt]),hf=Zr(Be,h.useCallback((v,D)=>{Be==null||Be(v-B,D-B),Je!=="none"&&qe(vt.fromSingleSelection(D),void 0,!0)},[Je,Be,B,qe])),ja=h.useRef(!1),gf=h.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}$e==null||$e({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(ja.current=!0),c(void 0)},[$e,B]),mf=h.useCallback(()=>{ja.current=!1},[]),Ml=_e==null?void 0:_e.selectionBehavior,_o=h.useCallback(v=>{if(Ml!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:N}=Yr(v);if(D)return[v,v];const $=T[T.length-1],X=v-$,W=v+N-$-1;return[X,W]},[Yr,Ml]),qa=h.useRef(),Ka=h.useCallback(v=>{var D,T,N;if(!ud(v,qa.current)&&(qa.current=v,!(((D=Un==null?void 0:Un.current)==null?void 0:D.button)!==void 0&&Un.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Un.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&te==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Un.current.location[1])&&U.rows.hasIndex(Un.current.location[1])){const $=Math.min(Un.current.location[1],v.location[1]),X=Math.max(Un.current.location[1],v.location[1])+1;Me(vt.fromSingleSelection([$,X]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!ja.current&&!$i.current&&(Tt==="rect"||Tt==="multi-rect")){const[$,X]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=tn.current.y),l.fillHandle===!0&&((N=l.previousSelection)==null?void 0:N.current)!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,qt?je-1:je);const K=r0(j,W,Y,un);Ba(K)}else{if(qt&&X===je)return;if(qt&&Y===je)if(v.kind===va)Y--;else return;W=Math.max(W,B);const be=_o(X);Y=be===void 0?Y:Yn(Y,be[0],be[1]);const Fe=W-$,we=Y-X,He={x:Fe>=0?$:W,y:we>=0?X:Y,width:Math.abs(Fe)+1,height:Math.abs(we)+1};Mt({...U.current,range:He},!0,!1,"drag")}}Xt==null||Xt({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,te,U,Tt,Xt,Me,qt,je,un,_o,Mt]),pf=h.useCallback(()=>{var W,Y;const v=qa.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[N,$]=v.location;const X=tn.current;D===-1?N=((Y=(W=X.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??X.x:D===1&&(N=X.x+X.width),T===-1?$=Math.max(0,X.y):T===1&&($=Math.min(je-1,X.y+X.height)),N=Yn(N,0,St.length-1),$=Yn($,0,je-1),Ka({...v,location:[N,$]})},[St.length,Ka,je]);cv(sf,Ut,pf);const er=h.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[N,$]=U.current.cell,X=U.current.range;let W=X.x,Y=X.x+X.width,j=X.y,K=X.y+X.height;const[be,Fe]=_o($)??[0,je-1],we=Fe+1;if(T!==0)switch(T){case 2:{K=we,j=$,rn(0,K,"vertical");break}case-2:{j=be,K=$+1,rn(0,j,"vertical");break}case 1:{j<$?(j++,rn(0,j,"vertical")):(K=Math.min(we,K+1),rn(0,K,"vertical"));break}case-1:{K>$+1?(K--,rn(0,K,"vertical")):(j=Math.max(be,j-1),rn(0,j,"vertical"));break}default:ao()}if(D!==0)if(D===2)Y=St.length,W=N,rn(Y-1-B,0,"horizontal");else if(D===-2)W=B,Y=N+1,rn(W-B,0,"horizontal");else{let He=[];if(ln!==void 0){const De=ln({x:W,y:j,width:Y-W-B,height:K-j},sn.current.signal);typeof De=="object"&&(He=yv(De))}if(D===1){let De=!1;if(W<N){if(He.length>0){const gt=dr(W+1,N+1).find(Ue=>!He.includes(Ue-B));gt!==void 0&&(W=gt,De=!0)}else W++,De=!0;De&&rn(W,0,"horizontal")}De||(Y=Math.min(St.length,Y+1),rn(Y-1-B,0,"horizontal"))}else if(D===-1){let De=!1;if(Y>N+1){if(He.length>0){const gt=dr(Y-1,N,-1).find(Ue=>!He.includes(Ue-B));gt!==void 0&&(Y=gt,De=!0)}else Y--,De=!0;De&&rn(Y-B,0,"horizontal")}De||(W=Math.max(B,W-1),rn(W-B,0,"horizontal"))}else ao()}Mt({cell:U.current.cell,range:{x:W,y:j,width:Y-W,height:K-j}},!0,!1,"keyboard-select")},[ln,_o,U,St.length,B,je,rn,Mt]),Za=h.useRef(Ti);Za.current=Ti;const Or=h.useCallback((v,D,T,N)=>{const $=gn-(T?0:1);v=Yn(v,B,Kt.length-1+B),D=Yn(D,0,$);const X=lr==null?void 0:lr[0],W=lr==null?void 0:lr[1];if(v===X&&D===W)return!1;if(N&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),Ce({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:Y}},!0)}else Mt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===D&&(u.current=void 0),Za.current&&rn(v-B,D),!0},[gn,B,Kt.length,lr,U,rn,Ce,Mt]),vf=h.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&pi(v)&&(Wn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var $;($=Tn.current)==null||$.damage([{cell:r.cell}])})),Sn(!0),o(void 0);const[T,N]=D;if(U.current!==void 0&&(T!==0||N!==0)){const $=U.current.cell[1]===gn-1&&v!==void 0;Or(Yn(U.current.cell[0]+T,0,St.length-1),Yn(U.current.cell[1]+N,0,gn-1),$,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Sn,U,R,Wn,gn,Or,St.length]),bf=h.useMemo(()=>`gdg-overlay-${wv++}`,[]),Gr=h.useCallback(v=>{var T,N,$,X;Sn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let Y=v.y;Y<v.y+v.height;Y++){const j=S([W-B,Y]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const be=Ct(j),Fe=(T=be==null?void 0:be.provideEditor)==null?void 0:T.call(be,j);(be==null?void 0:be.onDelete)!==void 0?K=be.onDelete(j):Yh(Fe)&&(K=(N=Fe==null?void 0:Fe.deletedValue)==null?void 0:N.call(Fe,j))}else if(pi(j)&&j.allowOverlay||j.kind===Z.Boolean){const be=Ct(j);K=($=be==null?void 0:be.onDelete)==null?void 0:$.call(be,j)}K!==void 0&&!bi(K)&&pi(K)&&D.push({location:[W,Y],value:K})}Wn(D),(X=Tn.current)==null||X.damage(D.map(W=>({cell:W.location})))},[Sn,S,Ct,Wn,B]),Vi=r!==void 0,Rl=h.useCallback(v=>{var gt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:N}=v,$=U.columns,X=U.rows,W=Nn;if(!Vi&&ut(W.clear,v,T))Ce(jo,!1),Ot==null||Ot();else if(!Vi&&ut(W.selectAll,v,T))Ce({columns:vt.empty(),rows:vt.empty(),current:{cell:((gt=U.current)==null?void 0:gt.cell)??[B,0],range:{x:B,y:0,width:y.length,height:je},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),li(!0);else if(ut(W.delete,v,T)){const Ae=(Te==null?void 0:Te(U))??!0;if(Ae!==!1){const Rt=Ae===!0?U:Ae;if(Rt.current!==void 0){Gr(Rt.current.range);for(const jt of Rt.current.rangeStack)Gr(jt)}for(const jt of Rt.rows)Gr({x:B,y:jt,width:y.length,height:1});for(const jt of Rt.columns)Gr({x:jt,y:0,width:1,height:je})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[Y,j]=U.current.cell;const[,K]=U.current.cell;let be=!1,Fe=!1;if(ut(W.scrollToSelectedCell,v,T)?Ao.current(Y-B,j):Je!=="none"&&ut(W.selectColumn,v,T)?$.hasIndex(Y)?qe($.remove(Y),void 0,!0):Je==="single"?qe(vt.fromSingleSelection(Y),void 0,!0):qe(void 0,Y,!0):te!=="none"&&ut(W.selectRow,v,T)?X.hasIndex(j)?Me(X.remove(j),void 0,!0):te==="single"?Me(vt.fromSingleSelection(j),void 0,!0):Me(void 0,j,!0):!Vi&&N!==void 0&&ut(W.activateCell,v,T)?j===je&&qt?window.setTimeout(()=>{const Ae=Oo(Y);di(Ae??Y)},0):(C==null||C([Y-B,j]),ci(N,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?kl():U.current.range.width>1&&ut(W.rightFill,v,T)?xl():ut(W.goToNextPage,v,T)?j+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?j-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),j=0,Y=0):ut(W.goToLastCell,v,T)?(o(void 0),j=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),er([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),er([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),j++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),j--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),Y--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),Y++)):(ut(W.goDownCell,v,T)?j+=1:ut(W.goUpCell,v,T)?j-=1:ut(W.goRightCell,v,T)?Y+=1:ut(W.goLeftCell,v,T)?Y-=1:ut(W.goDownCellRetainSelection,v,T)?(j+=1,be=!0):ut(W.goUpCellRetainSelection,v,T)?(j-=1,be=!0):ut(W.goRightCellRetainSelection,v,T)?(Y+=1,be=!0):ut(W.goLeftCellRetainSelection,v,T)?(Y-=1,be=!0):ut(W.goToLastRow,v,T)?j=je-1:ut(W.goToFirstRow,v,T)?j=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(Tt==="rect"||Tt==="multi-rect")&&(ut(W.selectGrowDown,v,T)?er([0,1]):ut(W.selectGrowUp,v,T)?er([0,-1]):ut(W.selectGrowRight,v,T)?er([1,0]):ut(W.selectGrowLeft,v,T)?er([-1,0]):ut(W.selectToLastRow,v,T)?er([0,2]):ut(W.selectToFirstRow,v,T)?er([0,-2]):ut(W.selectToLastColumn,v,T)?er([2,0]):ut(W.selectToFirstColumn,v,T)&&er([-2,0])),Fe=T.didMatch),Qn!==void 0&&Qn!=="normal"&&j!==K){const Ae=Qn==="skip-up"||Qn==="skip"||Qn==="block",Rt=Qn==="skip-down"||Qn==="skip"||Qn==="block",jt=j<K;if(jt&&Ae){for(;j>=0&&Yr(j).isGroupHeader;)j--;j<0&&(j=K)}else if(!jt&&Rt){for(;j<je&&Yr(j).isGroupHeader;)j++;j>=je&&(j=K)}}const He=Or(Y,j,!1,be),De=T.didMatch;return De&&(He||!Fe||Qt)&&D(),De},[Qn,Vi,U,Nn,Je,te,Tt,B,Yr,je,Or,Ce,Ot,y.length,Te,Qt,Gr,qe,Me,qt,Oo,di,C,ci,kl,xl,er]),Ni=h.useCallback(v=>{let D=!1;if(V!==void 0&&V({...v,cancel:()=>{D=!0}}),D||Rl(v)||U.current===void 0)return;const[T,N]=U.current.cell,$=tn.current;if(Ne&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(N,je-1))]))){if((!qt||N!==je)&&($.y>N||N>$.y+$.height||$.x>T||T>$.x+$.width))return;ci(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ne,V,Rl,U,S,B,je,qt,ci]),wf=h.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(me==null||me(T,{...v,preventDefault:D})),v.kind===Gn){if(T<0)return;J==null||J(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[N,$]=v.location;ae==null||ae([T,$],{...v,preventDefault:D}),Hm(U,v.location)||Or(N,$,!1,!1)}},[U,ae,J,me,B,Or]),Ja=h.useCallback(async v=>{var W,Y,j;if(!Nn.paste)return;function D(K,be,Fe,we){var De,gt;const He=typeof Fe=="object"?(Fe==null?void 0:Fe.join(`
|
172
|
+
`&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(vu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function bu(e,t,n){var s;const i=tv(e,t),r=l=>{var c;(c=window.navigator.clipboard)==null||c.writeText(l)},o=(l,c)=>{var u;return((u=window.navigator.clipboard)==null?void 0:u.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})]),!0)},a=(l,c)=>{var u,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(u=n==null?void 0:n.clipboardData)==null||u.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",c)}catch{o(l,c)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function dd(e){return e!==!0}function wu(e){return typeof e=="string"?e:`${e}px`}const iv=()=>e=>e.innerWidth,ov=()=>e=>e.innerHeight,av=dn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[iv()],"wmyidgi-1":[ov()]}}),sv=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return h.createElement(av,{innerHeight:wu(n),innerWidth:wu(t),...r},i)},lv=2,uv=1300;function cv(e,t,n){const i=ne.useRef(0),[r,o]=e??[0,0];ne.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=c=>{var u;if(!a){if(s===0)s=c;else{const d=c-s;i.current=Math.min(1,i.current+d/uv);const f=i.current**1.618*d*lv;(u=t.current)==null||u.scrollBy(r*f,o*f),s=c,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function dv({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,c,u,d,f,g]=ne.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=Kc();return[typeof p=="number"?p*m:y=>Math.ceil(p(y)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:c,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:g}}const Fr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function yu(e){const t=pa.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function fv(e){const t=am(e);return ne.useMemo(()=>{if(t===void 0)return yu(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return yu({...Fr,...n})},[t])}function hv(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function tl(e,t){const n=[];function i(a,s,l=!1){let c=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:c}),a.subGroups)for(let u=0;u<a.subGroups.length;u++){const d=u<a.subGroups.length-1?a.subGroups[u+1].headerIndex:s;i(a.subGroups[u],d,l||a.isCollapsed)}}const r=hv(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function ba(e,t){if(t===void 0||tl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function gv(e,t,n,i){const r=ne.useMemo(()=>e===void 0?void 0:tl(e,t),[e,t]),o=ne.useMemo(()=>r===void 0?t:r.reduce((c,u)=>c+(u.isCollapsed?1:u.rows+1),0),[r,t]),a=ne.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>{const{isGroupHeader:u}=ba(c,r);return u?e.height:typeof n=="number"?n:n(c)},[r,e,n]),s=ne.useCallback(c=>{if(r===void 0)return c;let u=c;for(const d of r){if(u===0)return;if(u--,!d.isCollapsed){if(u<d.rows)return d.contentIndex+u;u-=d.rows}}return c},[r]),l=Zr(i??(e==null?void 0:e.themeOverride),ne.useCallback(c=>{if(e===void 0)return i==null?void 0:i(c,c,c);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:d,groupIndex:f}=ba(c,r);return u?e.themeOverride:i==null?void 0:i(c,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function mv(e,t){const n=ne.useMemo(()=>e===void 0?void 0:tl(e,t),[e,t]);return{getRowGroupingForPath:hd,updateRowGroupingByPath:fd,mapper:ne.useCallback(i=>{if(typeof i=="number")return ba(i,n);const r=ba(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function fd(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:fd(o.subGroups??[],r,n)}:o)}function hd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:hd(e[n].subGroups??[],i)}function pv(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function vv(e,t,n,i,r){const[o,a]=h.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=h.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,c,u]=om(s),d=h.useRef(r);d.current=r;const f=pv(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),g=(l.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&g){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&u(),d.current()}},[t,g,u,f]);const m=(l.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&u(),d.current()}},[e,m,u,f]),{visibleRegion:l,setVisibleRegion:c,scrollRef:f}}const bv=h.lazy(async()=>await zs(()=>import("./data-grid-overlay-editor.Cuw9mHAA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url));let wv=0;function yv(e){return Mp(Ll(Ll(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return dr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function Xo(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 Go={kind:Z.Loading,allowOverlay:!1},jo={columns:vt.empty(),rows:vt.empty(),current:void 0},Cv=(e,t)=>{var Ol,Pl,_l;const[n,i]=h.useState(jo),[r,o]=h.useState(),a=h.useRef(null),s=h.useRef(null),[l,c]=h.useState(),u=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:g,markdownDivCreateNode:m,width:p,height:b,columns:y,rows:w,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:H,editorBloom:z,onHeaderClicked:L,onColumnProposeMove:F,rangeSelectionColumnSpanning:P=!0,spanRangeBehavior:Q="default",onGroupHeaderClicked:q,onCellContextMenu:ae,className:de,onHeaderContextMenu:me,getCellsForSelection:re,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:le,onCellEdited:ie,onCellsEdited:pe,onSearchResultsChanged:ye,searchResults:G,onSearchValueChange:O,searchValue:k,onKeyDown:V,onKeyUp:se,keybindings:Pe,editOnType:Ne=!0,onRowAppended:ve,onColumnMoved:Be,validateCell:xe,highlightRegions:xt,rangeSelect:Tt="rect",columnSelect:Je="multi",rowSelect:te="multi",rangeSelectionBlending:rt="exclusive",columnSelectionBlending:ue="exclusive",rowSelectionBlending:oe="exclusive",onDelete:ge,onDragStart:$e,onMouseMove:ze,onPaste:tt,copyHeaders:fe=!1,freezeColumns:Ee=0,cellActivationBehavior:st="second-click",rowSelectionMode:Le="auto",onHeaderMenuClick:Ge,onHeaderIndicatorClick:pt,getGroupDetails:lt,rowGrouping:_e,onSearchClose:Dt,onItemHovered:Xt,onSelectionCleared:Ot,showSearch:$t,onVisibleRegionChanged:Zt,gridSelection:Ht,onGridSelectionChange:Mn,minColumnWidth:Nt=50,maxColumnWidth:kt=500,maxColumnAutoWidth:Dn,provideEditor:vn,trailingRowOptions:Oe,freezeTrailingRows:Lt=0,allowedFillDirections:un="orthogonal",scrollOffsetX:fn,scrollOffsetY:hn,verticalBorder:ot,onDragOverCell:Gt,onDrop:Ft,onColumnResize:Jt,onColumnResizeEnd:Pt,onColumnResizeStart:Se,customRenderers:he,fillHandle:wt,experimental:_t,fixedShadowX:yt,fixedShadowY:Bt,headerIcons:bn,imageWindowLoader:zn,initialSize:wn,isDraggable:_,onDragLeave:nt,onRowMoved:Qe,overscrollX:Wt,overscrollY:On,preventDiagonalScrolling:yn,rightElement:qn,rightElementProps:Pn,trapFocus:Qt=!1,smoothScrollX:$n,smoothScrollY:Kn,scaleToRem:Fa=!1,rowHeight:bo=34,headerHeight:wo=36,groupHeaderHeight:Aa=wo,theme:ii,isOutsideClick:Mr,renderers:Ii,resizeIndicator:Ha,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,Rn=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,oi=(en==null?void 0:en.theme)??e.rowMarkerTheme,vr=en==null?void 0:en.headerTheme,br=en==null?void 0:en.headerAlwaysVisible,ai=te!=="multi",ar=(en==null?void 0:en.checkboxStyle)??"square",sr=Math.max(Nt,20),Br=Math.max(kt,sr),yo=Math.max(Dn??Br,sr),_i=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:Co,rowHeight:So,getRowThemeOverride:Vn}=gv(_e,w,bo,g),xo=h.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:Zn,headerHeight:Li,groupHeaderHeight:ko,theme:Mo,overscrollX:za,overscrollY:$a}=dv({groupHeaderHeight:Aa,headerHeight:wo,overscrollX:Wt,overscrollY:On,remSize:xo,rowHeight:So,scaleToRem:Fa,theme:ii}),Nn=fv(Pe),Rr=Oi??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=Rn!=="none",B=Bn?1:0,qt=ve!==void 0,Er=(Oe==null?void 0:Oe.sticky)===!0,[si,li]=h.useState(!1),Fi=$t??si,Va=h.useCallback(()=>{Dt!==void 0?Dt():li(!1)},[Dt]),U=h.useMemo(()=>Ht===void 0?void 0:Xo(Ht,B),[Ht,B])??n,sn=h.useRef();sn.current===void 0&&(sn.current=new AbortController),h.useEffect(()=>()=>sn==null?void 0:sn.current.abort(),[]);const[ln,Na]=q0(re,S,B,sn.current,je),A=h.useCallback((v,D,T)=>{if(xe===void 0)return!0;const N=[v[0]-B,v[1]];return xe==null?void 0:xe(N,D,T)},[B,xe]),ee=h.useRef(Ht),Ce=h.useCallback((v,D)=>{D&&(v=nv(v,ln,B,Q,sn.current)),Mn!==void 0?(ee.current=Xo(v,-B),Mn(ee.current)):i(v)},[Mn,ln,B,Q]),ke=Zr(Jt,h.useCallback((v,D,T,N)=>{Jt==null||Jt(y[T-B],D,T-B,N)},[Jt,B,y])),ce=Zr(Pt,h.useCallback((v,D,T,N)=>{Pt==null||Pt(y[T-B],D,T-B,N)},[Pt,B,y])),Re=Zr(Se,h.useCallback((v,D,T,N)=>{Se==null||Se(y[T-B],D,T-B,N)},[Se,B,y])),it=Zr(E,h.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),at=Zr(H,h.useCallback((v,D)=>(H==null?void 0:H({...v,col:v.col-B},D))??!1,[H,B])),Te=h.useCallback(v=>{if(ge!==void 0){const D=ge(Xo(v,-B));return typeof D=="boolean"?D:Xo(D,B)}return!0},[ge,B]),[Mt,Me,qe]=j0(U,Ce,rt,ue,oe,Tt,P),We=h.useMemo(()=>Sr(Kc(),Mo),[Mo]),[ft,an]=h.useState([0,0,0]),En=h.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),Ct=h.useCallback(v=>v.kind!==Z.Custom?En[v.kind]:he==null?void 0:he.find(D=>D.isMatch(v)),[he,En]);let{sizedColumns:Kt,nonGrowWidth:Jn}=ep(y,je,Na,ft[0]-(B===0?0:Rr)-ft[2],sr,yo,We,Ct,sn.current);Rn!=="none"&&(Jn+=Rr);const Cn=h.useMemo(()=>Kt.some(v=>v.group!==void 0),[Kt]),It=Cn?Li+ko:Li,In=U.rows.length,_n=Rn==="none"?void 0:In===0?!1:In===je?!0:void 0,St=h.useMemo(()=>Rn==="none"?Kt:[{title:"",width:Rr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:oi,rowMarker:ar,rowMarkerChecked:_n,headerRowMarkerTheme:vr,headerRowMarkerAlwaysVisible:br,headerRowMarkerDisabled:ai},...Kt],[Rn,Kt,Rr,oi,ar,_n,vr,br,ai]),tn=h.useRef({height:1,width:1,x:0,y:0}),Ir=h.useRef(!1),{setVisibleRegion:Tr,visibleRegion:Wr,scrollRef:Ut}=vv(fn,hn,Zn,tn,()=>Ir.current=!0);tn.current=Wr;const rf=Wr.x+B,Ro=Wr.y,Tn=h.useRef(null),Sn=h.useCallback(v=>{var D;v===!0?(D=Tn.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=Tn.current)==null||T.focus()})},[]),gn=qt?je+1:je,Wn=h.useCallback(v=>{const D=B===0?v:v.map(N=>({...N,location:[N.location[0]-B,N.location[1]]})),T=pe==null?void 0:pe(D);if(T!==!0)for(const N of D)ie==null||ie(N.location,N.value);return T},[ie,pe,B]),[Ur,Ba]=h.useState(),Eo=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ui=Nr?(Ol=U.current)==null?void 0:Ol.cell:void 0,Io=ui==null?void 0:ui[0],To=ui==null?void 0:ui[1],of=h.useMemo(()=>{if((xt===void 0||xt.length===0)&&(Eo??Io??To??Ur)===void 0)return;const v=[];if(xt!==void 0)for(const D of xt){const T=St.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ei(We.accentColor,0),range:Ur,style:"dashed"}),Eo!==void 0&&v.push({color:ei(We.accentColor,.5),range:Eo,style:"solid-outline"}),Io!==void 0&&To!==void 0&&v.push({color:We.accentColor,range:{x:Io,y:To,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Eo,Io,To,xt,St.length,We.accentColor,B]),vl=h.useRef(St);vl.current=St;const Ln=h.useCallback(([v,D],T=!1)=>{var X,W,Y,j,K,be,Fe;const N=qt&&D===gn-1;if(v===0&&Bn){if(N)return Go;const we=Co(D);return we===void 0?Go:{kind:jn.Marker,allowOverlay:!1,checkboxStyle:ar,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:Rn==="clickable-number"?"number":Rn,row:Pi+we,drawHandle:Qe!==void 0,cursor:Rn==="clickable-number"?"pointer":void 0}}else if(N){const He=v===B?(Oe==null?void 0:Oe.hint)??"":"",De=vl.current[v];if(((X=De==null?void 0:De.trailingRowOptions)==null?void 0:X.disabled)===!0)return Go;{const gt=((W=De==null?void 0:De.trailingRowOptions)==null?void 0:W.hint)??He,Ue=((Y=De==null?void 0:De.trailingRowOptions)==null?void 0:Y.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:jn.NewRow,hint:gt,allowOverlay:!1,icon:Ue}}}else{const we=v-B;if(T||(_t==null?void 0:_t.strict)===!0){const De=tn.current,gt=De.x>we||we>De.x+De.width||De.y>D||D>De.y+De.height||D>=Ua.current,Ue=we===((K=(j=De.extras)==null?void 0:j.selected)==null?void 0:K[0])&&D===((be=De.extras)==null?void 0:be.selected[1]);let Ae=!1;if(((Fe=De.extras)==null?void 0:Fe.freezeRegions)!==void 0){for(const Rt of De.extras.freezeRegions)if(Qr(Rt,we,D)){Ae=!0;break}}if(gt&&!Ue&&!Ae)return Go}let He=S([we,D]);return B!==0&&He.span!==void 0&&(He={...He,span:[He.span[0]+B,He.span[1]+B]}),He}},[qt,gn,Bn,Co,ar,U==null?void 0:U.rows,Rn,Pi,Qe,B,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,_t==null?void 0:_t.strict,S]),Wa=h.useCallback(v=>{let D=(lt==null?void 0:lt(v))??{name:v};return le!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Xa({group:D.name,bounds:T.bounds})}]}),D},[lt,le]),Do=h.useCallback(v=>{var Y;const[D,T]=v.cell,N=St[D],$=(N==null?void 0:N.group)!==void 0?(Y=Wa(N.group))==null?void 0:Y.overrideTheme:void 0,X=N==null?void 0:N.themeOverride,W=Vn==null?void 0:Vn(T);o({...v,theme:Sr(We,$,X,W,v.content.themeOverride)})},[Vn,St,Wa,We]),ci=h.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[N,$]=U.current.cell,X=Ln([N,$]);if(X.kind!==Z.Boolean&&X.allowOverlay){let Y=X;if(T!==void 0)switch(Y.kind){case Z.Number:{const j=Fh(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(j)?0:j};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Do({target:v,content:Y,initialValue:T,cell:[N,$],highlight:T===void 0,forceEditMode:T!==void 0})}else X.kind===Z.Boolean&&D&&X.readonly!==!0&&(Wn([{location:U.current.cell,value:{...X,data:dd(X.data)}}]),(W=Tn.current)==null||W.damage([{cell:U.current.cell}]))},[Ln,U,Wn,Do]),bl=h.useCallback((v,D)=>{var $;const T=($=Tn.current)==null?void 0:$.getBounds(v,D);if(T===void 0||Ut.current===null)return;const N=Ln([v,D]);N.allowOverlay&&Do({target:T,content:N,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Ln,Ut,Do]),rn=h.useCallback((v,D,T="both",N=0,$=0,X=void 0)=>{if(Ut.current!==null){const W=Tn.current,Y=s.current,j=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,be=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Fe=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&Y!==null){let we={x:0,y:0,width:0,height:0},He=0,De=0;if((j!==void 0||K!==void 0)&&(we=W.getBounds((j??0)+B,K??0)??we,we.width===0||we.height===0))return;const gt=Y.getBoundingClientRect(),Ue=gt.width/Y.offsetWidth;if(be!==void 0&&(we={...we,x:be-gt.left-Ut.current.scrollLeft,width:1}),Fe!==void 0&&(we={...we,y:Fe+gt.top-Ut.current.scrollTop,height:1}),we!==void 0){const Ae={x:we.x-N,y:we.y-$,width:we.width+2*N,height:we.height+2*$};let Rt=0;for(let Qa=0;Qa<Ee;Qa++)Rt+=Kt[Qa].width;let jt=0;const on=Lt+(Er?1:0);on>0&&(jt=ni(gn,on,Zn));let tr=Rt*Ue+gt.left+B*Rr*Ue,ur=gt.right,nr=gt.top+It*Ue,cr=gt.bottom-jt*Ue;const Ho=we.width+N*2;switch(X==null?void 0:X.hAlign){case"start":ur=tr+Ho;break;case"end":tr=ur-Ho;break;case"center":tr=Math.floor((tr+ur)/2)-Ho/2,ur=tr+Ho;break}const zo=we.height+$*2;switch(X==null?void 0:X.vAlign){case"start":cr=nr+zo;break;case"end":nr=cr-zo;break;case"center":nr=Math.floor((nr+cr)/2)-zo/2,cr=nr+zo;break}tr>Ae.x?He=Ae.x-tr:ur<Ae.x+Ae.width&&(He=Ae.x+Ae.width-ur),nr>Ae.y?De=Ae.y-nr:cr<Ae.y+Ae.height&&(De=Ae.y+Ae.height-cr),T==="vertical"||typeof v=="number"&&v<Ee?He=0:(T==="horizontal"||typeof D=="number"&&D>=gn-on)&&(De=0),(He!==0||De!==0)&&(Ue!==1&&(He/=Ue,De/=Ue),Ut.current.scrollTo(He+Ut.current.scrollLeft,De+Ut.current.scrollTop))}}}},[B,Lt,Rr,Ut,It,Ee,Kt,gn,Er,Zn]),wl=h.useRef(bl),yl=h.useRef(S),Ua=h.useRef(je);wl.current=bl,yl.current=S,Ua.current=je;const di=h.useCallback(async(v,D=!0)=>{var j;const T=St[v];if(((j=T==null?void 0:T.trailingRowOptions)==null?void 0:j.disabled)===!0)return;const N=ve==null?void 0:ve();let $,X=!0;N!==void 0&&($=await N,$==="top"&&(X=!1),typeof $=="number"&&(X=!1));let W=0;const Y=()=>{if(Ua.current<=je){W<500&&window.setTimeout(Y,W),W=50+W*2;return}const K=typeof $=="number"?$:X?je:0;Ao.current(v-B,K),Mt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const be=yl.current([v-B,K]);be.allowOverlay&&Ki(be)&&be.readonly!==!0&&D&&window.setTimeout(()=>{wl.current(v,K)},0)};Y()},[St,ve,B,je,Mt]),Oo=h.useCallback(v=>{var T,N;const D=((N=(T=Kt[v])==null?void 0:T.trailingRowOptions)==null?void 0:N.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof D=="number")return D+(Bn?1:0);if(typeof D=="object"){const $=y.indexOf(D);if($>=0)return $+(Bn?1:0)}},[Kt,y,Bn,Oe==null?void 0:Oe.targetColumn]),Dr=h.useRef(),fi=h.useRef(),Hi=h.useCallback((v,D)=>{var $;const[T,N]=D;return Sr(We,($=St[T])==null?void 0:$.themeOverride,Vn==null?void 0:Vn(N),v.themeOverride)},[Vn,St,We]),{mapper:Yr}=mv(_e,w),Qn=_e==null?void 0:_e.navigationBehavior,zi=h.useCallback(v=>{var be,Fe,we;const D=pa.value?v.metaKey:v.ctrlKey,T=D&&te==="multi",N=D&&Je==="multi",[$,X]=v.location,W=U.columns,Y=U.rows,[j,K]=((be=U.current)==null?void 0:be.cell)??[];if(v.kind==="cell"){if(fi.current=void 0,Xr.current=[$,X],$===0&&Bn){if(qt===!0&&X===je||Rn==="number"||te==="none")return;const He=Ln(v.location);if(He.kind!==jn.Marker)return;if(Qe!==void 0){const Ue=Ct(He);Fn((Ue==null?void 0:Ue.kind)===jn.Marker);const Ae=(Fe=Ue==null?void 0:Ue.onClick)==null?void 0:Fe.call(Ue,{...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(He,v.location),preventDefault:()=>{}});if(Ae===void 0||Ae.checked===He.checked)return}o(void 0),Sn();const De=Y.hasIndex(X),gt=Dr.current;if(te==="multi"&&(v.shiftKey||v.isLongTouch===!0)&>!==void 0&&Y.hasIndex(gt)){const Ue=[Math.min(gt,X),Math.max(gt,X)+1];T||Le==="multi"?Me(void 0,Ue,!0):Me(vt.fromSingleSelection(Ue),void 0,T)}else te==="multi"&&(T||v.isTouch||Le==="multi")?De?Me(Y.remove(X),void 0,!0):(Me(void 0,X,!0),Dr.current=X):De&&Y.length===1?Me(vt.empty(),void 0,D):(Me(vt.fromSingleSelection(X),void 0,D),Dr.current=X)}else if($>=B&&qt&&X===je){const He=Oo($);di(He??$)}else if(j!==$||K!==X){const He=Ln(v.location),De=Ct(He);if((De==null?void 0:De.onSelect)!==void 0){let Ae=!1;if(De.onSelect({...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Ae=!0,theme:Hi(He,v.location)}),Ae)return}if(Qn==="block"&&Yr(X).isGroupHeader)return;const gt=Er&&X===je,Ue=Er&&U!==void 0&&((we=U.current)==null?void 0:we.cell[1])===je;if((v.shiftKey||v.isLongTouch===!0)&&j!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(gt)return;const Ae=Math.min($,j),Rt=Math.max($,j),jt=Math.min(X,K),on=Math.max(X,K);Mt({...U.current,range:{x:Ae,y:jt,width:Rt-Ae+1,height:on-jt+1}},!0,D,"click"),Dr.current=void 0,Sn()}else Mt({cell:[$,X],range:{x:$,y:X,width:1,height:1}},!0,D,"click"),Dr.current=void 0,o(void 0),Sn()}}else if(v.kind==="header")if(Xr.current=[$,X],o(void 0),Bn&&$===0)Dr.current=void 0,fi.current=void 0,te==="multi"&&(Y.length!==je?Me(vt.fromSingleSelection([0,je]),void 0,D):Me(vt.empty(),void 0,D),Sn());else{const He=fi.current;if(Je==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&He!==void 0&&W.hasIndex(He)){const De=[Math.min(He,$),Math.max(He,$)+1];N?qe(void 0,De,D):qe(vt.fromSingleSelection(De),void 0,D)}else N?(W.hasIndex($)?qe(W.remove($),void 0,D):qe(void 0,$,D),fi.current=$):Je!=="none"&&(qe(vt.fromSingleSelection($),void 0,D),fi.current=$);Dr.current=void 0,Sn()}else v.kind===Gn?Xr.current=[$,X]:v.kind===va&&!v.isMaybeScrollbar&&(Ce(jo,!1),o(void 0),Sn(),Ot==null||Ot(),Dr.current=void 0,fi.current=void 0)},[te,Je,U,Bn,B,qt,je,Rn,Ln,Qe,Sn,Le,Ct,Hi,Me,Oo,di,Qn,Yr,Er,Mt,qe,Ce,Ot]),$i=h.useRef(!1),Xr=h.useRef(),Cl=h.useRef(Wr),Un=h.useRef(),af=h.useCallback(v=>{if(hi.current=!1,Cl.current=tn.current,v.button!==0&&v.button!==1){Un.current=void 0;return}const D=performance.now();Un.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:U,fillHandle:T}),Xr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Xr.current=v.location))},[U,zi]),[Ya,Xa]=h.useState(),Sl=h.useCallback(v=>{if(v.kind!==Gn||Je!=="multi")return;const D=pa.value?v.metaKey:v.ctrlKey,[T]=v.location,N=U.columns;if(T<B)return;const $=St[T];let X=T,W=T;for(let Y=T-1;Y>=B&&so($.group,St[Y].group);Y--)X--;for(let Y=T+1;Y<St.length&&so($.group,St[Y].group);Y++)W++;if(Sn(),D)if(N.hasAll([X,W+1])){let Y=N;for(let j=X;j<=W;j++)Y=Y.remove(j);qe(Y,void 0,D)}else qe(void 0,[X,W+1],D);else qe(vt.fromSingleSelection([X,W+1]),void 0,D)},[Je,Sn,U.columns,St,B,qe]),hi=h.useRef(!1),Po=h.useCallback(async v=>{if(ln!==void 0&&ke!==void 0){const D=tn.current.y,T=tn.current.height;let N=ln({x:v,y:D,width:1,height:Math.min(T,je-D)},sn.current.signal);typeof N!="object"&&(N=await N());const $=Kt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const Y=Jc(W,We,$,0,N,sr,Br,!1,Ct);ke==null||ke($,Y.width,v,Y.width)}}},[Kt,ln,Br,We,sr,ke,B,je,Ct]),[sf,Ga]=h.useState(),gi=h.useCallback(async(v,D)=>{var Y,j;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||ln===void 0||D.current===void 0)return;const N=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...N,x:N.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let $=ln(T,sn.current.signal);typeof $!="object"&&($=await $());const X=$,W=[];for(let K=0;K<N.width;K++)for(let be=0;be<N.height;be++){const Fe=[N.x+K,N.y+be];if($c(Fe,T))continue;const we=X[be%T.height][K%T.width];bi(we)||!Ki(we)||W.push({location:Fe,value:{...we}})}Wn(W),(j=Tn.current)==null||j.damage(W.map(K=>({cell:K.location})))},[ln,Wn,x,B]),xl=h.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};gi(v,U)},[gi,U]),kl=h.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};gi(v,U)},[gi,U]),lf=h.useCallback((v,D)=>{var be,Fe;const T=l;if(c(void 0),Ba(void 0),Ga(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((be=T.previousSelection)==null?void 0:be.current)!==void 0){if(Ur===void 0)return;const we={...U,current:{...U.current,range:rd(T.previousSelection.current.range,Ur)}};gi(T.previousSelection,we),Ce(we,!0);return}const[N,$]=v.location,[X,W]=Xr.current??[],Y=()=>{hi.current=!0},j=we=>{var De,gt,Ue;const He=we.isTouch||X===N&&W===$;if(He&&(M==null||M([N-B,$],{...we,preventDefault:Y})),we.button===1)return!hi.current;if(!hi.current){const Ae=Ln(v.location),Rt=Ct(Ae);if(Rt!==void 0&&Rt.onClick!==void 0&&He){const on=Rt.onClick({...we,cell:Ae,posX:we.localEventX,posY:we.localEventY,bounds:we.bounds,theme:Hi(Ae,v.location),preventDefault:Y});on!==void 0&&!bi(on)&&pi(on)&&(Wn([{location:we.location,value:on}]),(De=Tn.current)==null||De.damage([{cell:we.location}]))}if(hi.current||U.current===void 0)return!1;let jt=!1;switch(Ae.activationBehaviorOverride??st){case"double-click":case"second-click":{if(((Ue=(gt=T==null?void 0:T.previousSelection)==null?void 0:gt.current)==null?void 0:Ue.cell)===void 0)break;const[on,tr]=U.current.cell,[ur,nr]=T.previousSelection.current.cell;jt=N===on&&N===ur&&$===tr&&$===nr&&(we.isDoubleClick===!0||st==="second-click");break}case"single-click":{jt=!0;break}}if(jt)return C==null||C([N-B,$]),ci(we.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const we=tn.current,He=Cl.current;if(we.x!==He.x||we.y!==He.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((Fe=U.current)==null?void 0:Fe.cell,v.location)){ae==null||ae([K,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(N)){me==null||me(K,{...v,preventDefault:Y});return}else if(v.kind===Gn){if(K<0)return;J==null||J(K,{...v,preventDefault:Y});return}}v.kind==="cell"?j(v)||zi(v):v.kind===Gn?q==null||q(K,{...v,preventDefault:Y}):(v.kind===Ar&&(L==null||L(K,{...v,preventDefault:Y})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&Po(N):v.button===0&&N===X&&$===W&&(L==null||L(K,{...v,preventDefault:Y}))}if(v.kind===Gn){if(K<0)return;v.button===0&&N===X&&$===W&&(q==null||q(K,{...v,preventDefault:Y}),hi.current||Sl(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&j(v),Xr.current=void 0},[l,U,B,Ur,gi,Ce,M,Ln,Ct,st,Hi,Wn,C,ci,ae,me,J,zi,q,L,Po,Sl]),uf=h.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};ze==null||ze(D),l!==void 0&&v.buttons===0&&(c(void 0),Ba(void 0),Ga(void 0),$i.current=!1),Ga(T=>{var N;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((N=Un.current)==null?void 0:N.location[0])??0)<B?void 0:v.scrollEdge})},[l,ze,B]),cf=h.useCallback((v,D)=>{Ge==null||Ge(v-B,D)},[Ge,B]),df=h.useCallback((v,D)=>{pt==null||pt(v-B,D)},[pt,B]),lr=(Pl=U==null?void 0:U.current)==null?void 0:Pl.cell,ff=h.useCallback((v,D,T,N,$,X)=>{Ir.current=!1;let W=lr;W!==void 0&&(W=[W[0]-B,W[1]]);const Y=Ee===0?void 0:{x:0,y:v.y,width:Ee,height:v.height},j=[];Y!==void 0&&j.push(Y),Lt>0&&(j.push({x:v.x-B,y:je-Lt,width:v.width,height:Lt}),Ee>0&&j.push({x:0,y:je-Lt,width:Ee,height:Lt}));const K={x:v.x-B,y:v.y,width:v.width,height:qt&&v.y+v.height>=je?v.height-1:v.height,tx:$,ty:X,extras:{selected:W,freezeRegion:Y,freezeRegions:j}};tn.current=K,Tr(K),an([D,T,N]),Zt==null||Zt(K,K.tx,K.ty,K.extras)},[lr,B,qt,je,Ee,Lt,Tr,Zt]),hf=Zr(Be,h.useCallback((v,D)=>{Be==null||Be(v-B,D-B),Je!=="none"&&qe(vt.fromSingleSelection(D),void 0,!0)},[Je,Be,B,qe])),ja=h.useRef(!1),gf=h.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}$e==null||$e({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(ja.current=!0),c(void 0)},[$e,B]),mf=h.useCallback(()=>{ja.current=!1},[]),Ml=_e==null?void 0:_e.selectionBehavior,_o=h.useCallback(v=>{if(Ml!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:N}=Yr(v);if(D)return[v,v];const $=T[T.length-1],X=v-$,W=v+N-$-1;return[X,W]},[Yr,Ml]),qa=h.useRef(),Ka=h.useCallback(v=>{var D,T,N;if(!ud(v,qa.current)&&(qa.current=v,!(((D=Un==null?void 0:Un.current)==null?void 0:D.button)!==void 0&&Un.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Un.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&te==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Un.current.location[1])&&U.rows.hasIndex(Un.current.location[1])){const $=Math.min(Un.current.location[1],v.location[1]),X=Math.max(Un.current.location[1],v.location[1])+1;Me(vt.fromSingleSelection([$,X]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!ja.current&&!$i.current&&(Tt==="rect"||Tt==="multi-rect")){const[$,X]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=tn.current.y),l.fillHandle===!0&&((N=l.previousSelection)==null?void 0:N.current)!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,qt?je-1:je);const K=r0(j,W,Y,un);Ba(K)}else{if(qt&&X===je)return;if(qt&&Y===je)if(v.kind===va)Y--;else return;W=Math.max(W,B);const be=_o(X);Y=be===void 0?Y:Yn(Y,be[0],be[1]);const Fe=W-$,we=Y-X,He={x:Fe>=0?$:W,y:we>=0?X:Y,width:Math.abs(Fe)+1,height:Math.abs(we)+1};Mt({...U.current,range:He},!0,!1,"drag")}}Xt==null||Xt({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,te,U,Tt,Xt,Me,qt,je,un,_o,Mt]),pf=h.useCallback(()=>{var W,Y;const v=qa.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[N,$]=v.location;const X=tn.current;D===-1?N=((Y=(W=X.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??X.x:D===1&&(N=X.x+X.width),T===-1?$=Math.max(0,X.y):T===1&&($=Math.min(je-1,X.y+X.height)),N=Yn(N,0,St.length-1),$=Yn($,0,je-1),Ka({...v,location:[N,$]})},[St.length,Ka,je]);cv(sf,Ut,pf);const er=h.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[N,$]=U.current.cell,X=U.current.range;let W=X.x,Y=X.x+X.width,j=X.y,K=X.y+X.height;const[be,Fe]=_o($)??[0,je-1],we=Fe+1;if(T!==0)switch(T){case 2:{K=we,j=$,rn(0,K,"vertical");break}case-2:{j=be,K=$+1,rn(0,j,"vertical");break}case 1:{j<$?(j++,rn(0,j,"vertical")):(K=Math.min(we,K+1),rn(0,K,"vertical"));break}case-1:{K>$+1?(K--,rn(0,K,"vertical")):(j=Math.max(be,j-1),rn(0,j,"vertical"));break}default:ao()}if(D!==0)if(D===2)Y=St.length,W=N,rn(Y-1-B,0,"horizontal");else if(D===-2)W=B,Y=N+1,rn(W-B,0,"horizontal");else{let He=[];if(ln!==void 0){const De=ln({x:W,y:j,width:Y-W-B,height:K-j},sn.current.signal);typeof De=="object"&&(He=yv(De))}if(D===1){let De=!1;if(W<N){if(He.length>0){const gt=dr(W+1,N+1).find(Ue=>!He.includes(Ue-B));gt!==void 0&&(W=gt,De=!0)}else W++,De=!0;De&&rn(W,0,"horizontal")}De||(Y=Math.min(St.length,Y+1),rn(Y-1-B,0,"horizontal"))}else if(D===-1){let De=!1;if(Y>N+1){if(He.length>0){const gt=dr(Y-1,N,-1).find(Ue=>!He.includes(Ue-B));gt!==void 0&&(Y=gt,De=!0)}else Y--,De=!0;De&&rn(Y-B,0,"horizontal")}De||(W=Math.max(B,W-1),rn(W-B,0,"horizontal"))}else ao()}Mt({cell:U.current.cell,range:{x:W,y:j,width:Y-W,height:K-j}},!0,!1,"keyboard-select")},[ln,_o,U,St.length,B,je,rn,Mt]),Za=h.useRef(Ti);Za.current=Ti;const Or=h.useCallback((v,D,T,N)=>{const $=gn-(T?0:1);v=Yn(v,B,Kt.length-1+B),D=Yn(D,0,$);const X=lr==null?void 0:lr[0],W=lr==null?void 0:lr[1];if(v===X&&D===W)return!1;if(N&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),Ce({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:Y}},!0)}else Mt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===D&&(u.current=void 0),Za.current&&rn(v-B,D),!0},[gn,B,Kt.length,lr,U,rn,Ce,Mt]),vf=h.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&pi(v)&&(Wn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var $;($=Tn.current)==null||$.damage([{cell:r.cell}])})),Sn(!0),o(void 0);const[T,N]=D;if(U.current!==void 0&&(T!==0||N!==0)){const $=U.current.cell[1]===gn-1&&v!==void 0;Or(Yn(U.current.cell[0]+T,0,St.length-1),Yn(U.current.cell[1]+N,0,gn-1),$,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Sn,U,R,Wn,gn,Or,St.length]),bf=h.useMemo(()=>`gdg-overlay-${wv++}`,[]),Gr=h.useCallback(v=>{var T,N,$,X;Sn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let Y=v.y;Y<v.y+v.height;Y++){const j=S([W-B,Y]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const be=Ct(j),Fe=(T=be==null?void 0:be.provideEditor)==null?void 0:T.call(be,j);(be==null?void 0:be.onDelete)!==void 0?K=be.onDelete(j):Yh(Fe)&&(K=(N=Fe==null?void 0:Fe.deletedValue)==null?void 0:N.call(Fe,j))}else if(pi(j)&&j.allowOverlay||j.kind===Z.Boolean){const be=Ct(j);K=($=be==null?void 0:be.onDelete)==null?void 0:$.call(be,j)}K!==void 0&&!bi(K)&&pi(K)&&D.push({location:[W,Y],value:K})}Wn(D),(X=Tn.current)==null||X.damage(D.map(W=>({cell:W.location})))},[Sn,S,Ct,Wn,B]),Vi=r!==void 0,Rl=h.useCallback(v=>{var gt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:N}=v,$=U.columns,X=U.rows,W=Nn;if(!Vi&&ut(W.clear,v,T))Ce(jo,!1),Ot==null||Ot();else if(!Vi&&ut(W.selectAll,v,T))Ce({columns:vt.empty(),rows:vt.empty(),current:{cell:((gt=U.current)==null?void 0:gt.cell)??[B,0],range:{x:B,y:0,width:y.length,height:je},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),li(!0);else if(ut(W.delete,v,T)){const Ae=(Te==null?void 0:Te(U))??!0;if(Ae!==!1){const Rt=Ae===!0?U:Ae;if(Rt.current!==void 0){Gr(Rt.current.range);for(const jt of Rt.current.rangeStack)Gr(jt)}for(const jt of Rt.rows)Gr({x:B,y:jt,width:y.length,height:1});for(const jt of Rt.columns)Gr({x:jt,y:0,width:1,height:je})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[Y,j]=U.current.cell;const[,K]=U.current.cell;let be=!1,Fe=!1;if(ut(W.scrollToSelectedCell,v,T)?Ao.current(Y-B,j):Je!=="none"&&ut(W.selectColumn,v,T)?$.hasIndex(Y)?qe($.remove(Y),void 0,!0):Je==="single"?qe(vt.fromSingleSelection(Y),void 0,!0):qe(void 0,Y,!0):te!=="none"&&ut(W.selectRow,v,T)?X.hasIndex(j)?Me(X.remove(j),void 0,!0):te==="single"?Me(vt.fromSingleSelection(j),void 0,!0):Me(void 0,j,!0):!Vi&&N!==void 0&&ut(W.activateCell,v,T)?j===je&&qt?window.setTimeout(()=>{const Ae=Oo(Y);di(Ae??Y)},0):(C==null||C([Y-B,j]),ci(N,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?kl():U.current.range.width>1&&ut(W.rightFill,v,T)?xl():ut(W.goToNextPage,v,T)?j+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?j-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),j=0,Y=0):ut(W.goToLastCell,v,T)?(o(void 0),j=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),er([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),er([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),j++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),j--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),Y--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),Y++)):(ut(W.goDownCell,v,T)?j+=1:ut(W.goUpCell,v,T)?j-=1:ut(W.goRightCell,v,T)?Y+=1:ut(W.goLeftCell,v,T)?Y-=1:ut(W.goDownCellRetainSelection,v,T)?(j+=1,be=!0):ut(W.goUpCellRetainSelection,v,T)?(j-=1,be=!0):ut(W.goRightCellRetainSelection,v,T)?(Y+=1,be=!0):ut(W.goLeftCellRetainSelection,v,T)?(Y-=1,be=!0):ut(W.goToLastRow,v,T)?j=je-1:ut(W.goToFirstRow,v,T)?j=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(Tt==="rect"||Tt==="multi-rect")&&(ut(W.selectGrowDown,v,T)?er([0,1]):ut(W.selectGrowUp,v,T)?er([0,-1]):ut(W.selectGrowRight,v,T)?er([1,0]):ut(W.selectGrowLeft,v,T)?er([-1,0]):ut(W.selectToLastRow,v,T)?er([0,2]):ut(W.selectToFirstRow,v,T)?er([0,-2]):ut(W.selectToLastColumn,v,T)?er([2,0]):ut(W.selectToFirstColumn,v,T)&&er([-2,0])),Fe=T.didMatch),Qn!==void 0&&Qn!=="normal"&&j!==K){const Ae=Qn==="skip-up"||Qn==="skip"||Qn==="block",Rt=Qn==="skip-down"||Qn==="skip"||Qn==="block",jt=j<K;if(jt&&Ae){for(;j>=0&&Yr(j).isGroupHeader;)j--;j<0&&(j=K)}else if(!jt&&Rt){for(;j<je&&Yr(j).isGroupHeader;)j++;j>=je&&(j=K)}}const He=Or(Y,j,!1,be),De=T.didMatch;return De&&(He||!Fe||Qt)&&D(),De},[Qn,Vi,U,Nn,Je,te,Tt,B,Yr,je,Or,Ce,Ot,y.length,Te,Qt,Gr,qe,Me,qt,Oo,di,C,ci,kl,xl,er]),Ni=h.useCallback(v=>{let D=!1;if(V!==void 0&&V({...v,cancel:()=>{D=!0}}),D||Rl(v)||U.current===void 0)return;const[T,N]=U.current.cell,$=tn.current;if(Ne&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(N,je-1))]))){if((!qt||N!==je)&&($.y>N||N>$.y+$.height||$.x>T||T>$.x+$.width))return;ci(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ne,V,Rl,U,S,B,je,qt,ci]),wf=h.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(me==null||me(T,{...v,preventDefault:D})),v.kind===Gn){if(T<0)return;J==null||J(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[N,$]=v.location;ae==null||ae([T,$],{...v,preventDefault:D}),Hm(U,v.location)||Or(N,$,!1,!1)}},[U,ae,J,me,B,Or]),Ja=h.useCallback(async v=>{var W,Y,j;if(!Nn.paste)return;function D(K,be,Fe,we){var De,gt;const He=typeof Fe=="object"?(Fe==null?void 0:Fe.join(`
|
173
173
|
`))??"":(Fe==null?void 0:Fe.toString())??"";if(!bi(K)&&Ki(K)&&K.readonly!==!0){const Ue=I==null?void 0:I(He,K);if(Ue!==void 0&&pi(Ue))return{location:be,value:Ue};const Ae=Ct(K);if(Ae===void 0)return;if(Ae.kind===Z.Custom){Fn(K.kind===Z.Custom);const Rt=(De=Ae.onPaste)==null?void 0:De.call(Ae,He,K.data);return Rt===void 0?void 0:{location:be,value:{...K,data:Rt}}}else{const Rt=(gt=Ae.onPaste)==null?void 0:gt.call(Ae,He,K,{formatted:we,formattedString:typeof we=="string"?we:we==null?void 0:we.join(`
|
174
174
|
`),rawValue:Fe});return Rt===void 0?void 0:(Fn(Rt.kind===K.kind),{location:be,value:Rt})}}}const T=U.columns,N=U.rows,$=((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0;let X;if(U.current!==void 0?X=[U.current.range.x,U.current.range.y]:T.length===1?X=[T.first()??0,0]:N.length===1&&(X=[B,N.first()??0]),$&&X!==void 0){let K,be;const Fe="text/plain",we="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const Ae of Ue){if(Ae.types.includes(we)){const jt=await(await Ae.getType(we)).text(),on=pu(jt);if(on!==void 0){K=on;break}}Ae.types.includes(Fe)&&(be=await(await Ae.getType(Fe)).text())}}else if(navigator.clipboard.readText!==void 0)be=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(we)){const Ue=v.clipboardData.getData(we);K=pu(Ue)}K===void 0&&v.clipboardData.types.includes(Fe)&&(be=v.clipboardData.getData(Fe))}else return;const[He,De]=X,gt=[];do{if(tt===void 0){const Ue=Ln(X),Ae=be??(K==null?void 0:K.map(jt=>jt.map(on=>on.rawValue).join(" ")).join(" "))??"",Rt=D(Ue,X,Ae,void 0);Rt!==void 0&>.push(Rt);break}if(K===void 0){if(be===void 0)return;K=rv(be)}if(tt===!1||typeof tt=="function"&&(tt==null?void 0:tt([X[0]-B,X[1]],K.map(Ue=>Ue.map(Ae=>{var Rt;return((Rt=Ae.rawValue)==null?void 0:Rt.toString())??""}))))!==!0)return;for(const[Ue,Ae]of K.entries()){if(Ue+De>=je)break;for(const[Rt,jt]of Ae.entries()){const on=[Rt+He,Ue+De],[tr,ur]=on;if(tr>=St.length||ur>=gn)continue;const nr=Ln(on),cr=D(nr,on,jt.rawValue,jt.formatted);cr!==void 0&>.push(cr)}}}while(!1);Wn(gt),(j=Tn.current)==null||j.damage(gt.map(Ue=>({cell:Ue.location})))}},[I,Ct,Ln,U,Nn.paste,Ut,St.length,Wn,gn,tt,B,je]);cn("paste",Ja,d,!1,!0);const Bi=h.useCallback(async(v,D)=>{var W,Y;if(!Nn.copy)return;const T=D===!0||((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0,N=U.columns,$=U.rows,X=(j,K)=>{if(!fe)bu(j,K,v);else{const be=K.map(Fe=>({kind:Z.Text,data:y[Fe].title,displayData:y[Fe].title,allowOverlay:!1}));bu([be,...j],K,v)}};if(T&&ln!==void 0){if(U.current!==void 0){let j=ln(U.current.range,sn.current.signal);typeof j!="object"&&(j=await j()),X(j,dr(U.current.range.x-B,U.current.range.x+U.current.range.width-B))}else if($!==void 0&&$.length>0){const K=[...$].map(be=>{const Fe=ln({x:B,y:be,width:y.length,height:1},sn.current.signal);return typeof Fe=="object"?Fe[0]:Fe().then(we=>we[0])});if(K.some(be=>be instanceof Promise)){const be=await Promise.all(K);X(be,dr(y.length))}else X(K,dr(y.length))}else if(N.length>0){const j=[],K=[];for(const be of N){let Fe=ln({x:be,y:0,width:1,height:je},sn.current.signal);typeof Fe!="object"&&(Fe=await Fe()),j.push(Fe),K.push(be-B)}if(j.length===1)X(j[0],K);else{const be=j.reduce((Fe,we)=>Fe.map((He,De)=>[...He,...we[De]]));X(be,K)}}}},[y,ln,U,Nn.copy,B,Ut,je,fe]);cn("copy",Bi,d,!1,!1);const yf=h.useCallback(async v=>{var T,N;if(!(!Nn.cut||!(((T=Ut.current)==null?void 0:T.contains(document.activeElement))===!0||((N=s.current)==null?void 0:N.contains(document.activeElement))===!0))&&(await Bi(v),U.current!==void 0)){let $={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:vt.empty(),columns:vt.empty()};const X=Te==null?void 0:Te($);if(X===!1||($=X===!0?$:X,$.current===void 0))return;Gr($.current.range)}},[Gr,U,Nn.cut,Bi,Ut,Te]);cn("cut",yf,d,!1,!1);const Cf=h.useCallback((v,D)=>{if(ye!==void 0){B!==0&&(v=v.map($=>[$[0]-B,$[1]])),ye(v,D);return}if(v.length===0||D===-1)return;const[T,N]=v[D];u.current!==void 0&&u.current[0]===T&&u.current[1]===N||(u.current=[T,N],Or(T,N,!1,!1))},[ye,B,Or]),[Lo,Fo]=((_l=Ht==null?void 0:Ht.current)==null?void 0:_l.cell)??[],Ao=h.useRef(rn);Ao.current=rn,h.useLayoutEffect(()=>{var v,D,T,N;Za.current&&!Ir.current&&Lo!==void 0&&Fo!==void 0&&(Lo!==((D=(v=ee.current)==null?void 0:v.current)==null?void 0:D.cell[0])||Fo!==((N=(T=ee.current)==null?void 0:T.current)==null?void 0:N.cell[1]))&&Ao.current(Lo,Fo),Ir.current=!1},[Lo,Fo]);const El=U.current!==void 0&&(U.current.cell[0]>=St.length||U.current.cell[1]>=gn);h.useLayoutEffect(()=>{El&&Ce(jo,!1)},[El,Ce]);const Sf=h.useMemo(()=>qt===!0&&(Oe==null?void 0:Oe.tint)===!0?vt.fromSingleSelection(gn-1):vt.empty(),[gn,qt,Oe==null?void 0:Oe.tint]),xf=h.useCallback(v=>typeof ot=="boolean"?ot:(ot==null?void 0:ot(v-B))??!0,[B,ot]),kf=h.useMemo(()=>{if(Ya===void 0||s.current===null)return null;const{bounds:v,group:D}=Ya,T=s.current.getBoundingClientRect();return h.createElement(X0,{bounds:v,group:D,canvasBounds:T,onClose:()=>Xa(void 0),onFinish:N=>{Xa(void 0),le==null||le(D,N)}})},[le,Ya]),Mf=Math.min(St.length,Ee+(Bn?1:0));h.useImperativeHandle(t,()=>({appendRow:(v,D)=>di(v+B,D),updateCells:v=>{var D;return B!==0&&(v=v.map(T=>({cell:[T.cell[0]+B,T.cell[1]]}))),(D=Tn.current)==null?void 0:D.damage(v)},getBounds:(v,D)=>{var T;if(!((s==null?void 0:s.current)===null||(Ut==null?void 0:Ut.current)===null)){if(v===void 0&&D===void 0){const N=s.current.getBoundingClientRect(),$=N.width/Ut.current.clientWidth;return{x:N.x-Ut.current.scrollLeft*$,y:N.y-Ut.current.scrollTop*$,width:Ut.current.scrollWidth*$,height:Ut.current.scrollHeight*$}}return(T=Tn.current)==null?void 0:T.getBounds((v??0)+B,D)}},focus:()=>{var v;return(v=Tn.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Bi(void 0,!0);break;case"paste":await Ja();break}},scrollTo:rn,remeasureColumns:v=>{for(const D of v)Po(D+B)}}),[di,Po,Ut,Bi,Ni,Ja,B,rn]);const[Il,Tl]=lr??[],Rf=h.useCallback(v=>{const[D,T]=v;if(T===-1){Je!=="none"&&(qe(vt.fromSingleSelection(D),void 0,!1),Sn());return}Il===D&&Tl===T||(Mt({cell:v,range:{x:D,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),rn(D,T))},[Je,Sn,rn,Il,Tl,Mt,qe]),[Ef,If]=h.useState(!1),Dl=h.useRef(Rc(v=>{If(v)},5)),Tf=h.useCallback(()=>{Dl.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&l===void 0&&Mt({cell:[B,Ro],range:{x:B,y:Ro,width:1,height:1}},!0,!1,"keyboard-select")},[Ro,U,l,B,Mt]),Df=h.useCallback(()=>{Dl.current(!1)},[]),[Of,Pf]=h.useMemo(()=>{let v;const D=(_t==null?void 0:_t.scrollbarWidthOverride)??Rs(),T=je+(qt?1:0);if(typeof Zn=="number")v=It+T*Zn;else{let $=0;const X=Math.min(T,10);for(let W=0;W<X;W++)$+=Zn(W);$=Math.floor($/X),v=It+T*$}v+=D;const N=St.reduce(($,X)=>X.width+$,0)+D;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,v)}px`]},[St,_t==null?void 0:_t.scrollbarWidthOverride,Zn,je,qt,It]),_f=h.useMemo(()=>Zm(We),[We]);return h.createElement(Zc.Provider,{value:We},h.createElement(sv,{style:_f,className:de,inWidth:p??Of,inHeight:b??Pf},h.createElement(B0,{fillHandle:wt,drawFocusRing:Nr,experimental:_t,fixedShadowX:yt,fixedShadowY:Bt,getRowThemeOverride:Vn,headerIcons:bn,imageWindowLoader:zn,initialSize:wn,isDraggable:_,onDragLeave:nt,onRowMoved:Qe,overscrollX:za,overscrollY:$a,preventDiagonalScrolling:yn,rightElement:qn,rightElementProps:Pn,smoothScrollX:$n,smoothScrollY:Kn,className:de,enableGroups:Cn,onCanvasFocused:Tf,onCanvasBlur:Df,canvasRef:s,onContextMenu:wf,theme:We,cellXOffset:rf,cellYOffset:Ro,accessibilityHeight:Wr.height,onDragEnd:mf,columns:St,nonGrowWidth:Jn,drawHeader:it,onColumnProposeMove:F,drawCell:at,disabledRows:Sf,freezeColumns:Mf,lockColumns:B,firstColAccessible:B===0,getCellContent:Ln,minColumnWidth:sr,maxColumnWidth:Br,searchInputRef:a,showSearch:Fi,onSearchClose:Va,highlightRegions:of,getCellsForSelection:ln,getGroupDetails:Wa,headerHeight:Li,isFocused:Ef,groupHeaderHeight:Cn?ko:0,freezeTrailingRows:Lt+(qt&&(Oe==null?void 0:Oe.sticky)===!0?1:0),hasAppendRow:qt,onColumnResize:ke,onColumnResizeEnd:ce,onColumnResizeStart:Re,onCellFocused:Rf,onColumnMoved:hf,onDragStart:gf,onHeaderMenuClick:cf,onHeaderIndicatorClick:df,onItemHovered:Ka,isFilling:(l==null?void 0:l.fillHandle)===!0,onMouseMove:uf,onKeyDown:Ni,onKeyUp:se,onMouseDown:af,onMouseUp:lf,onDragOverCell:Gt,onDrop:Ft,onSearchResultsChanged:Cf,onVisibleRegionChanged:ff,clientSize:ft,rowHeight:Zn,searchResults:G,searchValue:k,onSearchValueChange:O,rows:gn,scrollRef:Ut,selection:U,translateX:Wr.tx,translateY:Wr.ty,verticalBorder:xf,gridRef:Tn,getCellRenderer:Ct,resizeIndicator:Ha}),kf,r!==void 0&&h.createElement(h.Suspense,{fallback:null},h.createElement(bv,{...r,validateCell:A,bloom:z,id:bf,getCellRenderer:Ct,className:(_t==null?void 0:_t.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:vn,imageEditorOverride:f,onFinishEditing:vf,markdownDivCreateNode:m,isOutsideClick:Mr}))))},Sv=h.forwardRef(Cv),gd=20;function Cu(e){const{cell:t,posX:n,posY:i,bounds:r,theme:o}=e,{width:a,height:s,x:l,y:c}=r,u=t.maxSize??gd,d=Math.floor(r.y+s/2),f=Tc(u,s,o.cellVerticalPadding),g=Ic(t.contentAlign??"center",l,a,o.cellHorizontalPadding,f),m=Ec(g,d,f),p=Dc(l+n,c+i,m);return Bs(t)&&p}const xv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>kv(e,e.cell.data,Bs(e.cell),e.cell.maxSize??gd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Cu(e)&&e.preventDefault()},onClick:e=>{if(Cu(e))return{...e.cell,data:dd(e.cell.data)}},onPaste:(e,t)=>{let n=sa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ns),n===t.data?void 0:{...t,data:n}}};function kv(e,t,n,i,r){if(!n&&t===sa)return;const{ctx:o,hoverAmount:a,theme:s,rect:l,highlighted:c,hoverX:u,hoverY:d,cell:{contentAlign:f}}=e,{x:g,y:m,width:p,height:b}=l;let y=!1;if(r>0){let w=n?1-r+r*a:.4;if(t===sa&&(w*=a),w===0)return;w<1&&(y=!0,o.globalAlpha=w)}Qs(o,s,t,g,m,p,b,c,u,d,i,f),y&&(o.globalAlpha=1)}const Mv=dn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Rv=e=>{const{bubbles:t}=e;return h.createElement(Mv,null,t.map((n,i)=>h.createElement("div",{key:i,className:"boe-bubble"},n)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Ev={getAccessibilityString:e=>Oc(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r).width+i+20,0)+2*n.cellHorizontalPadding-4,draw:e=>Tv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(Rv,{bubbles:t.data})},onPaste:()=>{}},Iv=4;function Tv(e,t){const{rect:n,theme:i,ctx:r,highlighted:o}=e,{x:a,y:s,width:l,height:c}=n,u=20,d=8,f=Iv;let g=a+i.cellHorizontalPadding;const m=[];for(const p of t){if(g>a+l)break;const b=ri(p,r,i.baseFontFull).width;m.push({x:g,width:b}),g+=b+d*2+f}r.beginPath();for(const p of m)mr(r,p.x,s+(c-u)/2,p.width+d*2,u,i.roundingRadius??u/2);r.fillStyle=o?i.bgBubbleSelected:i.bgBubble,r.fill();for(const[p,b]of m.entries())r.beginPath(),r.fillStyle=i.textBubble,r.fillText(t[p],b.x+d,s+c/2+pr(r,i))}const Dv=dn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Ov=e=>{const{drilldowns:t}=e;return h.createElement(Dv,null,t.map((n,i)=>h.createElement("div",{key:i,className:"doe-bubble"},n.img!==void 0&&h.createElement("img",{src:n.img}),h.createElement("div",null,n.text))))},Pv={getAccessibilityString:e=>Oc(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r.text).width+i+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Fv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(Ov,{drilldowns:t.data})},onPaste:()=>{}},_v=4,ds={};function Lv(e,t,n,i){const r=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,s=4,l=n*r,c=i+o,u=i*3,d=(u+o*2)*r,f=`${e},${t},${r},${n}`;if(ds[f]!==void 0)return{el:ds[f],height:l,width:d,middleWidth:s*r,sideWidth:c*r,padding:o*r,dpr:r};const g=document.createElement("canvas"),m=g.getContext("2d");return m===null?null:(g.width=d,g.height=l,m.scale(r,r),ds[f]=g,m.beginPath(),mr(m,o,o,u,a,i),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),mr(m,o+.5,o+.5,u,a,i),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:g,height:l,width:d,sideWidth:c*r,middleWidth:i*r,padding:o*r,dpr:r})}function Fv(e,t){const{rect:n,theme:i,ctx:r,imageLoader:o,col:a,row:s}=e,{x:l,width:c}=n,u=i.baseFontFull,d=Xc(r,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*i.lineHeight)*2)),g=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,b=_v;let y=l+i.cellHorizontalPadding;const w=i.roundingRadius??6,S=Lv(i.bgCell,i.drilldownBorder,f,w),M=[];for(const C of t){if(y>l+c)break;const R=ri(C.text,r,u).width;let I=0;C.img!==void 0&&o.loadOrGetImage(C.img,a,s)!==void 0&&(I=m-8+4);const E=R+I+p*2;M.push({x:y,width:E}),y+=E+b}if(S!==null){const{el:C,height:x,middleWidth:R,sideWidth:I,width:E,dpr:H,padding:z}=S,L=I/H,F=z/H;for(const P of M){const Q=Math.floor(P.x),q=Math.floor(P.width),ae=q-(L-F)*2;r.imageSmoothingEnabled=!1,r.drawImage(C,0,0,I,x,Q-F,g,L,f),ae>0&&r.drawImage(C,I,0,R,x,Q+(L-F),g,ae,f),r.drawImage(C,E-I,0,I,x,Q+q-(L-F),g,L,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[C,x]of M.entries()){const R=t[C];let I=x.x+p;if(R.img!==void 0){const E=o.loadOrGetImage(R.img,a,s);if(E!==void 0){const H=m-8;let z=0,L=0,F=E.width,P=E.height;F>P?(z+=(F-P)/2,F=P):P>F&&(L+=(P-F)/2,P=F),r.beginPath(),mr(r,I,g+f/2-H/2,H,H,i.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,z,L,F,P,I,g+f/2-H/2,H,H),r.restore(),I+=H+4}}r.beginPath(),r.fillStyle=i.textBubble,r.fillText(R.text,I,g+f/2+pr(r,i))}}const Av={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Hv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:i}=e,r=i??sm;return h.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const i=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(i.length===t.data.length&&i.every((r,o)=>r===t.data[o])))return{...t,data:i}}},fs=4;function Hv(e,t,n,i){const{rect:r,col:o,row:a,theme:s,ctx:l,imageLoader:c}=e,{x:u,y:d,height:f,width:g}=r,m=f-s.cellVerticalPadding*2,p=[];let b=0;for(let w=0;w<t.length;w++){const S=t[w];if(S.length===0)continue;const M=c.loadOrGetImage(S,o,a);if(M!==void 0){p[w]=M;const C=M.width*(m/M.height);b+=C+fs}}if(b===0)return;b-=fs;let y=u+s.cellHorizontalPadding;i==="right"?y=Math.floor(u+g-s.cellHorizontalPadding-b):i==="center"&&(y=Math.floor(u+g/2-b/2));for(const w of p){if(w===void 0)continue;const S=w.width*(m/w.height);n>0&&(l.beginPath(),mr(l,y,d+s.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(w,y,d+s.cellVerticalPadding,S,m),n>0&&l.restore(),y+=S+fs}}function zv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const $v={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:i,ctx:r,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(zv(n,i)*t.skeletonWidthVariability));const l=a.cellHorizontalPadding;s+l*2>=o.width&&(s=o.width-l*2-1);const c=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);mr(r,o.x+l,o.y+(o.height-c)/2,s,c,a.roundingRadius??3),r.fillStyle=ei(a.textDark,.1),r.fill()},onPaste:()=>{}},Vv=()=>e=>e.targetWidth,Su=dn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[Vv(),"px"]}}),Nv=e=>{const{value:t,onChange:n,forceEditMode:i,createNode:r,targetRect:o,onFinish:a,validatedSelection:s}=e,l=t.data,c=t.readonly===!0,[u,d]=h.useState(l===""||i),f=h.useCallback(()=>{d(m=>!m)},[]),g=l?"gdg-ml-6":"";return u?h.createElement(Su,{targetWidth:o.width-20},h.createElement(Ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),h.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${g}`,onClick:()=>a(t)},h.createElement(em,null))):h.createElement(Su,{targetWidth:o.width},h.createElement(Rm,{contents:l,createNode:r}),!c&&h.createElement(h.Fragment,null,h.createElement("div",{className:"spacer"}),h.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${g}`,onClick:f},h.createElement(Xs,null))),h.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Bv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:po,measure:(e,t,n)=>{const i=t.data.split(`
|
175
|
-
`)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>fr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return h.createElement(Nv,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Wv={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Uv,measure:()=>44,draw:e=>Xv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Uv(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=Yv,n.textAlign="center",o}function Yv(e){const{ctx:t}=e;t.textAlign="start"}function Xv(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:c}=e,{x:u,y:d,width:f,height:g}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(Qs(a,c,n,r?u+p:u,d,r?f-p:f,g,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])a.rect(u+b,d+g/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=c.markerFontFull,y=u+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=c.textLight,a.font=b,a.fillText(p,y,d+g/2+pr(a,b)),l!==0&&(a.globalAlpha=1)}}const Gv={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>jv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function jv(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:c,width:u,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,c+1,u,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let g=0;if(n!==void 0){const p=d-8,b=l+8/2,y=c+8/2;s.drawSprite(n,"normal",i,b,y,p,a,f?1:o),g=p}else{g=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,y=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+y+b,c+d/2),i.lineTo(l+y+b+p,c+d/2),i.moveTo(l+y+b+p*.5,c+d/2-p*.5),i.lineTo(l+y+b+p*.5,c+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,g+l+a.cellHorizontalPadding+.5,c+d/2+pr(i,a)),i.beginPath()}function md(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=qv(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),mr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ei(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function qv(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ri(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,c=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-c)/2+1,width:s.width+o*3,height:c-1}}const Kv=h.lazy(async()=>await zs(()=>import("./number-overlay-editor.
|
175
|
+
`)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>fr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return h.createElement(Nv,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Wv={getAccessibilityString:e=>e.row.toString(),kind:jn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Uv,measure:()=>44,draw:e=>Xv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Uv(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=Yv,n.textAlign="center",o}function Yv(e){const{ctx:t}=e;t.textAlign="start"}function Xv(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:c}=e,{x:u,y:d,width:f,height:g}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(Qs(a,c,n,r?u+p:u,d,r?f-p:f,g,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])a.rect(u+b,d+g/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=c.markerFontFull,y=u+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=c.textLight,a.font=b,a.fillText(p,y,d+g/2+pr(a,b)),l!==0&&(a.globalAlpha=1)}}const Gv={getAccessibilityString:()=>"",kind:jn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>jv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function jv(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:c,width:u,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,c+1,u,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let g=0;if(n!==void 0){const p=d-8,b=l+8/2,y=c+8/2;s.drawSprite(n,"normal",i,b,y,p,a,f?1:o),g=p}else{g=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,y=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+y+b,c+d/2),i.lineTo(l+y+b+p,c+d/2),i.moveTo(l+y+b+p*.5,c+d/2-p*.5),i.lineTo(l+y+b+p*.5,c+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,g+l+a.cellHorizontalPadding+.5,c+d/2+pr(i,a)),i.beginPath()}function md(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=qv(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),mr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ei(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function qv(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ri(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,c=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-c)/2+1,width:s.width+o*3,height:c-1}}const Kv=h.lazy(async()=>await zs(()=>import("./number-overlay-editor.BRQhYKOF.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url)),Zv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:po,draw:e=>{const{hoverAmount:t,cell:n,ctx:i,theme:r,rect:o,overrideCursor:a}=e,{hoverEffect:s,displayData:l,hoverEffectTheme:c}=n;s===!0&&t>0&&md(i,r,c,l,o,t,a),fr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return h.createElement(h.Suspense,{fallback:null},h.createElement(Kv,{highlight:t,disabled:i.readonly===!0,value:i.data,fixedDecimals:i.fixedDecimals,allowNegative:i.allowNegative,thousandSeparator:i.thousandSeparator,decimalSeparator:i.decimalSeparator,validatedSelection:r,onChange:o=>n({...i,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const i=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(i)||t.data===i))return{...t,data:i,displayData:n.formattedString??t.displayData}}},Jv={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Qv,onPaste:()=>{}};function Qv(e){const{ctx:t,theme:n,rect:i}=e,{x:r,y:o,height:a}=i;t.beginPath();const s=2.5;let l=r+n.cellHorizontalPadding+s;const c=o+a/2,u=Math.cos(jl(30))*s,d=Math.sin(jl(30))*s;for(let f=0;f<12;f++)t.moveTo(l,c-s),t.lineTo(l,c+s),t.moveTo(l+u,c-d),t.lineTo(l-u,c+d),t.moveTo(l-u,c-d),t.lineTo(l+u,c+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const e1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>po(e,t,e.theme.textLight),draw:e=>fr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return ne.createElement(Ei,{highlight:t,autoFocus:i.readonly!==!0,disabled:i.readonly!==!1,value:i.data,validatedSelection:r,onChange:o=>n({...i,data:o.target.value})})},onPaste:()=>{}},t1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:po,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:i,ctx:r,rect:o,theme:a,overrideCursor:s}=e,{displayData:l,contentAlign:c,hoverEffect:u,allowWrapping:d,hoverEffectTheme:f}=t;u===!0&&n>0&&md(r,a,f,l,o,n,s),fr(e,l,c,d,i)},measure:(e,t,n)=>{const i=t.displayData.split(`
|
176
176
|
`,t.allowWrapping===!0?void 0:1);let r=0;for(const o of i)r=Math.max(r,e.measureText(o).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:i,value:r,validatedSelection:o}=t;return h.createElement(Ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:o,onChange:a=>i({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},n1=dn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),r1=e=>{const{uri:t,onChange:n,forceEditMode:i,readonly:r,validatedSelection:o,preview:a}=e,[s,l]=h.useState(!r&&(t===""||i)),c=h.useCallback(()=>{l(!0)},[]);return s?h.createElement(Ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):h.createElement(n1,null,h.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&h.createElement("div",{className:"gdg-edit-icon",onClick:c},h.createElement(Xs,null)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function pd(e,t,n,i){let r=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return i==="right"?r=t.width-a-n.cellHorizontalPadding:i==="center"&&(r=t.width/2-a/2),{x:r,y:o,width:a,height:s}}function xu(e){const{cell:t,bounds:n,posX:i,posY:r,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Wc(a,o.baseFontFull);if(s===void 0)return!1;const l=pd(s,n,o,t.contentAlign);return Qr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},i,r)}const i1={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:po,draw:e=>{const{cell:t,theme:n,overrideCursor:i,hoverX:r,hoverY:o,rect:a,ctx:s}=e,l=t.displayData??t.data,c=t.hoverEffect===!0;if(i!==void 0&&c&&r!==void 0&&o!==void 0){const u=ri(l,s,n.baseFontFull),d=pd(u,a,n,t.contentAlign),{x:f,y:g,width:m,height:p}=d;if(r>=f-4&&r<=f-4+m+8&&o>=g-4&&o<=g-4+p+8){const b=pr(s,n.baseFontFull);i("pointer");const y=5,w=g-b;s.beginPath(),s.moveTo(a.x+f,Math.floor(a.y+w+p+y)+.5),s.lineTo(a.x+f+m,Math.floor(a.y+w+p+y)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,fr({...e,rect:{...a,x:a.x-1}},l,t.contentAlign),fr({...e,rect:{...a,x:a.x-2}},l,t.contentAlign),fr({...e,rect:{...a,x:a.x+1}},l,t.contentAlign),fr({...e,rect:{...a,x:a.x+2}},l,t.contentAlign),s.restore()}}s.fillStyle=c?n.linkColor:n.textDark,fr(e,l,t.contentAlign)},onSelect:e=>{xu(e)&&e.preventDefault()},onClick:e=>{var i;const{cell:t}=e;xu(e)&&((i=t.onClickUri)==null||i.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:i,forceEditMode:r,validatedSelection:o}=t;return h.createElement(r1,{forceEditMode:i.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:i.data,preview:i.displayData??i.data,validatedSelection:o,readonly:i.readonly===!0,onChange:a=>n({...i,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},o1=[Wv,Gv,xv,Ev,Pv,Av,$v,Bv,Zv,Jv,e1,t1,i1];var a1=Mc,s1=sc,l1="Expected a function";function u1(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(l1);return s1(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),a1(e,t,{leading:i,maxWait:t,trailing:r})}var c1=u1;const d1=Mi(c1),hs=[];class f1 extends jc{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",d1(()=>{this.imageLoaded(new io(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const i of n){const r=this.cache[i];let o=!1;for(let a=0;a<r.cells.length;a++){const s=r.cells[a];if(this.isInWindow(s)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[i])}})}setCallback(n){this.imageLoaded=n}loadImage(n,i,r,o){let a=!1;const s=hs.pop()??new Image;let l=!1;const c={img:void 0,cells:[or(i,r)],url:n,cancel:()=>{l||(l=!0,hs.length<12?hs.unshift(s):a||(s.src=""))}},u=new Promise(d=>s.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{s.src=n,await u,await s.decode();const d=this.cache[o];if(d!==void 0&&!l){d.img=s;for(const f of d.cells)this.loadedLocations.push(Js(f));a=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[o]=c}loadOrGetImage(n,i,r){const o=n,a=this.cache[o];if(a!==void 0){const s=or(i,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,i,r,o)}}const h1=(e,t)=>{const n=h.useMemo(()=>({...e0,...e.headerIcons}),[e.headerIcons]),i=h.useMemo(()=>e.imageWindowLoader??new f1,[e.imageWindowLoader]);return h.createElement(Sv,{...e,renderers:o1,headerIcons:n,ref:t,imageWindowLoader:i})},g1=h.forwardRef(h1);function ku(e,t){const n=h.useRef(null),i=h.useRef(),r=h.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return h.useEffect(()=>r,[r]),{debouncedCallback:h.useCallback((...a)=>{i.current=a,r(),n.current=setTimeout(()=>{i.current&&(e(...i.current),i.current=void 0)},t)},[e,t,r]),cancel:r}}var m1={exports:{}};/*! Moment Duration Format v2.2.2
|
177
177
|
* https://github.com/jsmreese/moment-duration-format
|
178
178
|
* Date: 2018-02-16
|
@@ -188,10 +188,10 @@ Error: ${C.toString()}`);if(s.timezone){try{C=Ru(C,s.timezone)}catch(x){return z
|
|
188
188
|
Error: ${x}`)}M=C.utcOffset()}try{S=Mu(C,s.format||n)}catch(x){return zt(C.toISOString(),`Failed to format the date for rendering with: ${s.format}.
|
189
189
|
Error: ${x}`)}w=Mu(C,n)}return{...d,copyData:w,isMissingValue:Ze(y),data:{...d.data,date:y,displayDate:S,timezoneOffset:M}}},getCellValue(p){var b;return Ze((b=p==null?void 0:p.data)==null?void 0:b.date)?null:o(p.data.date)}}}function ol(e){var r,o,a;let t="YYYY-MM-DD HH:mm:ss";((r=e.columnTypeOptions)==null?void 0:r.step)>=60?t="YYYY-MM-DD HH:mm":((o=e.columnTypeOptions)==null?void 0:o.step)<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=qf(e.arrowType),i=bt(n)||bt((a=e==null?void 0:e.columnTypeOptions)==null?void 0:a.timezone);return il("datetime",e,i?t+"Z":t,1,"datetime-local",s=>i?s.toISOString():s.toISOString().replace("Z",""),n)}ol.isEditableType=!0;function al(e){var n,i;let t="HH:mm:ss";return((n=e.columnTypeOptions)==null?void 0:n.step)>=60?t="HH:mm":((i=e.columnTypeOptions)==null?void 0:i.step)<1&&(t="HH:mm:ss.SSS"),il("time",e,t,1,"time",r=>r.toISOString().split("T")[1].replace("Z",""))}al.isEditableType=!0;function sl(e){return il("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}sl.isEditableType=!0;function xd(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const i=bt(n)?[Et(n)]:[];return{...t,data:i,isMissingValue:!bt(n),displayData:i}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}xd.isEditableType=!1;function kd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.
|
190
190
|
Error: ${a}`}let i;if(!Ze(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch{i=void 0}const r={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},o=a=>{if(Ze(a))return!e.isRequired;const s=Et(a);return!(t.max_chars&&s.length>t.max_chars||n instanceof RegExp&&n.test(s)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:o,getCell(a,s){if(Ze(a))return{...r,data:null,isMissingValue:!0,onClickUri:()=>{}};const l=a;if(typeof n=="string")return zt(Et(l),n);if(s&&o(l)===!1)return zt(Et(l),"Invalid input.");let c="";return l&&(i!==void 0?c=x1(i,l):c=t.display_text||l),{...r,data:l,displayData:c,isMissingValue:Ze(l),onClickUri:u=>{window.open(l.startsWith("www.")?`https://${l}`:l,"_blank","noopener,noreferrer"),u.preventDefault()},copyData:l}},getCellValue(a){return Ze(a.data)?null:a.data}}}kd.isEditableType=!0;function ll(e){const t={kind:Z.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const i=Ze(n)?[]:vd(n);return{...t,data:i,isMissingValue:Ze(n),copyData:Ze(n)?"":Et(i.map(r=>typeof r=="string"&&r.includes(",")?r.replace(/,/g," "):r))}},getCellValue(n){return Ze(n.data)||Pa(n)?null:n.data}}}ll.isEditableType=!1;function ul(e){const t=co(e.arrowType);let n;t==="timedelta64[ns]"?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=vo({step:dc(e.arrowType)?1:void 0,min_value:Kf(e.arrowType)?0:void 0,format:n},e.columnTypeOptions),r=Ze(i.min_value)||i.min_value<0,o=bt(i.step)&&!Number.isNaN(i.step)?wd(i.step):void 0,a={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},s=l=>{let c=uo(l);if(Ze(c))return!e.isRequired;if(Number.isNaN(c))return!1;let u=!1;return bt(i.max_value)&&c>i.max_value&&(c=i.max_value,u=!0),bt(i.min_value)&&c<i.min_value?!1:u?c:!0};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(l,c){if(c===!0){const f=s(l);if(f===!1)return zt(Et(l),"Invalid input.");typeof f=="number"&&(l=f)}let u=uo(l),d="";if(bt(u)){if(Number.isNaN(u))return zt(Et(l),"The value cannot be interpreted as a number.");if(bt(o)&&(u=C1(u,o)),Number.isInteger(u)&&!Number.isSafeInteger(u))return zt(Et(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{d=wa(u,i.format,o)}catch(f){return zt(Et(u),bt(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${f}`:`Failed to format the number. Error: ${f}`)}}return{...a,data:u,displayData:d,isMissingValue:Ze(u),copyData:Ze(u)?"":Et(u)}},getCellValue(l){return l.data===void 0?null:l.data}}}ul.isEditableType=!0;function Si(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const i=bt(n)?Et(n):null,r=bt(i)?ya(i):"";return{...t,data:i,displayData:r,isMissingValue:Ze(n)}}catch(i){return zt(Et(n),`The value cannot be interpreted as a string. Error: ${i}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}Si.isEditableType=!1;function Md(e){const t=dc(e.arrowType),n=vo({min_value:0,max_value:t?100:1,step:t?1:.01,format:t?"%3d%%":"percent"},e.columnTypeOptions);let i;try{i=wa(n.max_value,n.format)}catch{i=Et(n.max_value)}const r=Ze(n.step)||Number.isNaN(n.step)?void 0:wd(n.step),o={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:n.min_value,max:n.max_value,step:n.step,value:n.min_value,label:String(n.min_value),measureLabel:i,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(a){if(Ze(a))return Ps();if(Ze(n.min_value)||Ze(n.max_value)||Number.isNaN(n.min_value)||Number.isNaN(n.max_value)||n.min_value>=n.max_value)return zt("Invalid min/max parameters",`The min_value (${n.min_value}) and max_value (${n.max_value}) parameters must be valid numbers.`);if(Ze(n.step)||Number.isNaN(n.step))return zt("Invalid step parameter",`The step parameter (${n.step}) must be a valid number.`);const s=uo(a);if(Number.isNaN(s)||Ze(s))return zt(Et(a),"The value cannot be interpreted as a number.");if(Number.isInteger(s)&&!Number.isSafeInteger(s))return zt(Et(a),"The value is larger than the maximum supported integer values in number columns (2^53).");let l="";try{l=wa(s,n.format,r)}catch(u){return zt(Et(s),bt(n.format)?`Failed to format the number based on the provided format configuration: (${n.format}). Error: ${u}`:`Failed to format the number. Error: ${u}`)}const c=Math.min(n.max_value,Math.max(n.min_value,s));return{...o,isMissingValue:Ze(a),copyData:String(s),data:{...o.data,value:c,label:l}}},getCellValue(a){var s,l;return a.kind===Z.Loading||((s=a.data)==null?void 0:s.value)===void 0?null:(l=a.data)==null?void 0:l.value}}}Md.isEditableType=!1;function cl(e){let t="string";const n=vo({options:fc(e.arrowType)?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map(o=>typeof o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const r={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...n.options.filter(o=>o!==null&&o!=="").map(o=>Et(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,a){let s=null;return bt(o)&&o!==""&&(s=Et(o)),a&&!r.data.allowedValues.includes(s)?zt(Et(s),"The value is not part of the allowed options."):{...r,isMissingValue:s===null,copyData:s||"",data:{...r.data,value:s}}},getCellValue(o){var a,s,l,c,u;return Ze((a=o.data)==null?void 0:a.value)||((s=o.data)==null?void 0:s.value)===""?null:t==="number"?uo((l=o.data)==null?void 0:l.value)??null:t==="boolean"?bd((c=o.data)==null?void 0:c.value)??null:(u=o.data)==null?void 0:u.value}}}cl.isEditableType=!0;function dl(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
|
191
|
-
Error: ${o}`}const i={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=o=>{if(Ze(o))return!e.isRequired;let a=Et(o),s=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(a)===!1?!1:s?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(o,a){if(typeof n=="string")return zt(Et(o),n);if(a){const s=r(o);if(s===!1)return zt(Et(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=bt(o)?Et(o):null,l=bt(s)?ya(s):"";return{...i,isMissingValue:Ze(s),data:s,displayData:l}}catch(s){return zt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}dl.isEditableType=!0;const Eu=hc("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),E1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?kn("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:kn(Eu,{src:t})}):kn(Eu,{src:t})},Iu=new Map(Object.entries({object:Si,text:dl,checkbox:rl,selectbox:cl,list:ll,number:ul,link:kd,datetime:ol,date:sl,time:al,line_chart:yd,bar_chart:Cd,area_chart:Sd,image:xd,progress:Md})),I1=[];var T1=Zf,D1=Jf,O1=Qf,P1=eh,_1=th,L1=nh,F1=rh,A1=ih,H1="[object Map]",z1="[object Set]",$1=Object.prototype,V1=$1.hasOwnProperty;function N1(e){if(e==null)return!0;if(_1(e)&&(P1(e)||typeof e=="string"||typeof e.splice=="function"||L1(e)||A1(e)||O1(e)))return!e.length;var t=D1(e);if(t==H1||t==z1)return!e.size;if(F1(e))return!T1(e).length;for(var n in e)if(V1.call(e,n))return!1;return!0}var B1=N1;const W1=Mi(B1);function Tu(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=i.exec(n);if(r)return r[1].trim()}function U1(e,t,n){const i={},r=Tu(t,"color",n);r&&(i.textDark=r);const o=Tu(t,"background-color",n);return o&&(i.bgCell=o),o==="yellow"&&r===void 0&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}function Y1(e){let t=e?co(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty","large_string[pyarrow]"].includes(t)?dl:["datetime","datetimetz"].includes(t)?ol:t==="time"?al:t==="date"?sl:["object","bytes"].includes(t)?Si:fc(e)?rl:ah(e)?ul:t==="categorical"?cl:t.startsWith("list")?ll:Si):Si}function X1(e,t){const n=e.types.index[t],i=e.indexNames[t];let r=!0;return co(n)==="range"&&(r=!1),{id:`_index-${t}`,name:i,title:i,isEditable:r,arrowType:n,isIndex:!0,isPinned:!0,isHidden:!1}}function G1(e,t){const n=e.columns.map(s=>s[t]),i=n.length>0?n[n.length-1]:"",r=n.length>1?n.slice(0,-1).filter(s=>s!=="").join(" / "):void 0;let o=e.types.data[t];Ze(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"});let a;if(co(o)==="categorical"){const s=e.getCategoricalOptions(t);bt(s)&&(a={options:s})}return{id:`_column-${i}-${t}`,name:i,title:i,isEditable:!0,arrowType:o,columnTypeOptions:a,isIndex:!1,isPinned:!1,isHidden:!1,group:r}}function Rd(){return{id:"_empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0,isPinned:!0}}function j1(e){const t=[],{dimensions:n}=e,i=n.headerColumns,r=n.dataColumns;if(i===0&&r===0)return t.push(Rd()),t;for(let o=0;o<i;o++){const a={...X1(e,o),indexNumber:o};t.push(a)}for(let o=0;o<r;o++){const a={...G1(e,o),indexNumber:o+i};t.push(a)}return t}function q1(e,t,n=void 0){var o,a,s,l,c,u;const i=e.arrowType?co(e.arrowType):null;let r;if(e.kind==="object")r=e.getCell(bt(t.content)?ya(Al(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&bt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;i==="time"&&bt((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?d=oh(t.content,t.field):d=Hr.utc(Number(t.content)).toDate(),r=e.getCell(d)}else if(i==="decimal"){const d=Ze(t.content)?null:Al(t.content,t.contentType,t.field);r=e.getCell(d)}else r=e.getCell(t.content);if(Ci(r))return r;if(!e.isEditable){if(bt(t.displayContent)){const d=ya(t.displayContent);r.kind===Z.Text?r={...r,displayData:d}:r.kind===Z.Number&&Ze((s=e.columnTypeOptions)==null?void 0:s.format)?r={...r,displayData:d}:r.kind===Z.Uri&&Ze((l=e.columnTypeOptions)==null?void 0:l.display_text)?r={...r,displayData:d}:r.kind===Z.Custom&&((c=r.data)==null?void 0:c.kind)==="date-picker-cell"&&Ze((u=e.columnTypeOptions)==null?void 0:u.format)&&(r={...r,data:{...r.data,displayDate:d}})}n&&t.cssId&&(r=U1(r,t.cssId,n))}return r}const oa="_index",Du="_pos:",Ou={small:75,medium:200,large:400};function K1(e){if(!Ze(e)){if(typeof e=="number")return e;if(e in Ou)return Ou[e]}}const Ko=(e,t)=>Mh(e,t,(i,r)=>{if(sh(r))return r});function Z1(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(oa)&&(n=Ko(n,t.get(oa)??{})),t.has(`${Du}${e.indexNumber}`)&&(n=Ko(n,t.get(`${Du}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==oa&&(n=Ko(n,t.get(e.name)??{})),t.has(e.id)&&(n=Ko(n,t.get(e.id)??{})),W1(n)?e:cc({...e},{title:n.label,width:K1(n.width),isEditable:bt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function J1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return gc(t),new Map}}function Q1(e){var i;const t=(i=e.columnTypeOptions)==null?void 0:i.type;let n;return bt(t)&&Iu.has(t)&&(n=Iu.get(t)),Ze(n)&&(n=Y1(e.arrowType)),n}function eb(e,t,n,i){const r=$s(),o=ne.useMemo(()=>J1(e.columns),[e.columns]),[a,s]=ne.useState(o);ne.useEffect(()=>{s(o)},[o]);const l=e.useContainerWidth||bt(e.width)&&e.width>0;return{columns:ne.useMemo(()=>{const u=j1(t).map(m=>{let p={...m,...Z1(m,a),isStretched:l};const b=Q1(p);return(e.editingMode===Xn.EditingMode.READ_ONLY||n||b.isEditableType===!1)&&(p={...p,isEditable:!1}),e.editingMode!==Xn.EditingMode.READ_ONLY&&p.isEditable==!0&&(p={...p,icon:"editable"},p.isRequired&&e.editingMode===Xn.EditingMode.DYNAMIC&&(p={...p,isHidden:!1})),b(p,r)}).filter(m=>!m.isHidden),d=[],f=[];i!=null&&i.length?(u.forEach(m=>{m.isIndex&&!i.includes(m.name)&&!i.includes(m.id)&&m.isPinned!==!1&&d.push(m)}),i.forEach(m=>{const p=u.find(b=>b.name===m||b.id===m);p&&(p.isPinned?d.push(p):f.push(p))})):u.forEach(m=>{m.isPinned?d.push(m):f.push(m)});const g=[...d,...f];return g.length>0?g:[Si(Rd())]},[t,a,l,n,e.editingMode,i,r]),setColumnConfigMapping:s}}function oo(e){return e.isIndex?oa:Ze(e.name)?"":e.name}class Zo{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const i={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,s)=>{const l={};o.forEach((c,u,d)=>{const f=n.get(u);f&&(l[oo(f)]=f.getCellValue(c))}),i.edited_rows[a]=l}),this.addedRows.forEach(o=>{const a={};let s=!1;o.forEach((l,c,u)=>{const d=n.get(c);if(d){const f=d.getCellValue(l);d.isRequired&&d.isEditable&&Pa(l)&&(s=!0),bt(f)&&(a[oo(d)]=f)}}),s||i.added_rows.push(a)}),i.deleted_rows=this.deletedRows,JSON.stringify(i,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const i=JSON.parse(t),r=new Map;n.forEach(a=>{r.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(oo(a),a)}),Object.keys(i.edited_rows).forEach(a=>{const s=Number(a),l=i.edited_rows[a];Object.keys(l).forEach(c=>{var f;const u=l[c],d=o.get(c);if(d){const g=d.getCell(u);g&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(f=this.editedCells.get(s))==null||f.set(d.indexNumber,g))}})}),i.added_rows.forEach(a=>{const s=new Map;n.forEach(l=>{s.set(l.indexNumber,l.getCell(null))}),Object.keys(a).forEach(l=>{const c=a[l],u=o.get(l);if(u){const d=u.getCell(c);d&&s.set(u.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=i.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const i=this.editedCells.get(n);if(i!==void 0)return i.get(t)}setCell(t,n,i){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,i)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,i)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,i)=>i-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ze(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,i)=>n-i)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let i=0;i<this.deletedRows.length&&!(this.deletedRows[i]>n);i++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}function tb(e,t,n,i,r,o){const a=ne.useMemo(()=>e.filter(u=>u.isPinned).reduce((u,d)=>u+(d.width??i*2),0)>n*.6,[e,n,i]),s=t||a?0:e.filter(u=>u.isPinned).length,l=ne.useCallback(u=>{o(d=>{const f=new Map(d),g=f.get(u);return f.set(u,{...g||{},pinned:!1}),f}),r(!0,!1)},[r,o]);return{pinColumn:ne.useCallback(u=>{o(d=>{const f=new Map(d),g=f.get(u);return f.set(u,{...g||{},pinned:!0}),f}),r(!0,!1)},[r,o]),unpinColumn:l,freezeColumns:s}}function nb(e,t,n,i,r){return{onColumnMoved:ne.useCallback((a,s)=>{const l=[...e],[c]=l.splice(a,1);l.splice(s,0,c),s<t&&!c.isPinned?n(c.id):s>=t&&c.isPinned&&i(c.id),r(l.map(u=>u.id))},[e,t,n,i,r])}}function rb(e){const[t,n]=h.useState(()=>new Map),i=ne.useCallback((o,a,s,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:ne.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:i}}function ib(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(i=>i.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Pu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function ob(e,t){return e=Pu(e),t=Pu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function ab(e,t){return e>t?1:e===t?0:-1}function sb(e){const{sort:t,rows:n,getCellContent:i}=e;let r=t===void 0?void 0:e.columns.findIndex(c=>t.column===c||c.id!==void 0&&t.column.id===c.id);r===-1&&(r=void 0);const o=(t==null?void 0:t.direction)??"asc",a=h.useMemo(()=>{if(r===void 0)return;const c=new Array(n),u=[r,0];for(let f=0;f<n;f++)u[1]=f,c[f]=ib(i(u));let d;return(t==null?void 0:t.mode)==="raw"?d=dr(n).sort((f,g)=>ab(c[f],c[g])):(t==null?void 0:t.mode)==="smart"?d=dr(n).sort((f,g)=>ob(c[f],c[g])):d=dr(n).sort((f,g)=>c[f].localeCompare(c[g])),o==="desc"&&d.reverse(),d},[i,n,t==null?void 0:t.mode,o,r]),s=h.useCallback(c=>a===void 0?c:a[c],[a]),l=h.useCallback(([c,u])=>a===void 0?i([c,u]):(u=a[u],i([c,u])),[i,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:l}}function lb(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function ub(e,t,n){const[i,r]=ne.useState(),{getCellContent:o,getOriginalIndex:a}=sb({columns:t.map(c=>_s(c)),getCellContent:n,rows:e,sort:i}),s=ne.useMemo(()=>lb(t,i),[t,i]),l=ne.useCallback(c=>{let u="asc";const d=s[c];if(i&&i.column.id===d.id)if(i.direction==="asc")u="desc";else{r(void 0);return}r({column:_s(d),direction:u,mode:d.sortMode})},[i,s]);return{columns:s,sortColumn:l,getOriginalIndex:a,getCellContent:o}}const cb={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:i,rect:r,hoverAmount:o,hoverX:a}=e;let{values:s,yAxis:l,color:c,graphKind:u="area",displayValues:d,hideAxis:f}=t.data;const[g,m]=l;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-g)/(m-g))));const p=i.cellHorizontalPadding,b=p+r.x,y=r.y+3,w=r.height-6,S=r.width-p*2,M=m-g,C=m<=0?y:g>=0?y+w:y+w*(m/M);if(!f&&g<=0&&m>=0&&(n.beginPath(),n.moveTo(b,C),n.lineTo(b+S,C),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.globalAlpha=1),u==="bar"){n.beginPath();const x=2,R=(s.length-1)*x,I=(S-R)/s.length;let E=b;for(const H of s){const z=y+w-H*w;n.moveTo(E,C),n.lineTo(E+I,C),n.lineTo(E+I,z),n.lineTo(E,z),E+=I+x}n.fillStyle=t.data.color??i.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),R=s.map((E,H)=>({x:b+x*H,y:y+w-E*w}));n.moveTo(R[0].x,R[0].y);let I=0;if(R.length>2)for(I=1;I<R.length-2;I++){const E=(R[I].x+R[I+1].x)/2,H=(R[I].y+R[I+1].y)/2;n.quadraticCurveTo(R[I].x,R[I].y,E,H)}if(n.quadraticCurveTo(R[I].x,R[I].y,R[I+1].x,R[I+1].y),n.strokeStyle=c??i.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(r.x+r.width-p,C),n.lineTo(r.x+p,C),n.closePath(),u==="area"){n.globalAlpha=.2+.2*o;const E=n.createLinearGradient(0,y,0,y+w*1.4);E.addColorStop(0,c??i.accentColor);const[H,z,L]=ga(c??i.accentColor);E.addColorStop(1,`rgba(${H}, ${z}, ${L}, 0)`),n.fillStyle=E,n.fill(),n.globalAlpha=1}if(a!==void 0&&(u==="line"||u==="area")&&d!==void 0){n.beginPath();const E=Math.min(s.length-1,Math.max(0,Math.round((a-p)/x)));n.moveTo(b+E*x,r.y+1),n.lineTo(b+E*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.save(),n.font=`8px ${i.fontFamily}`,n.fillStyle=i.textMedium,n.textBaseline="top",n.fillText(d[E],b,r.y+i.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function _u(e,t,n,i,r,o){if(!(i<=0||r<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,i,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,i/2),tr:Math.min(o.tr,r/2,i/2),bl:Math.min(o.bl,r/2,i/2),br:Math.min(o.br,r/2,i/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lu(Object(n),!0).forEach(function(i){qi(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}var db=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fb(e){var t=e.defaultInputValue,n=t===void 0?"":t,i=e.defaultMenuIsOpen,r=i===void 0?!1:i,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=kr(e,db),p=h.useState(s!==void 0?s:n),b=Cr(p,2),y=b[0],w=b[1],S=h.useState(l!==void 0?l:r),M=Cr(S,2),C=M[0],x=M[1],R=h.useState(g!==void 0?g:a),I=Cr(R,2),E=I[0],H=I[1],z=h.useCallback(function(de,me){typeof c=="function"&&c(de,me),H(de)},[c]),L=h.useCallback(function(de,me){var re;typeof u=="function"&&(re=u(de,me)),w(re!==void 0?re:de)},[u]),F=h.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),P=h.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),Q=s!==void 0?s:y,q=l!==void 0?l:C,ae=g!==void 0?g:E;return Ye(Ye({},m),{},{inputValue:Q,menuIsOpen:q,onChange:z,onInputChange:L,onMenuClose:P,onMenuOpen:F,value:ae})}function hb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const gb=Math.min,mb=Math.max,Ca=Math.round,Jo=Math.floor,Sa=e=>({x:e,y:e});function pb(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function _a(){return typeof window<"u"}function Ed(e){return Td(e)?(e.nodeName||"").toLowerCase():"#document"}function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Id(e){var t;return(t=(Td(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Td(e){return _a()?e instanceof Node||e instanceof xr(e).Node:!1}function vb(e){return _a()?e instanceof Element||e instanceof xr(e).Element:!1}function fl(e){return _a()?e instanceof HTMLElement||e instanceof xr(e).HTMLElement:!1}function Fu(e){return!_a()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xr(e).ShadowRoot}function Dd(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=hl(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function bb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wb(e){return["html","body","#document"].includes(Ed(e))}function hl(e){return xr(e).getComputedStyle(e)}function yb(e){if(Ed(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fu(e)&&e.host||Id(e);return Fu(t)?t.host:t}function Od(e){const t=yb(e);return wb(t)?e.ownerDocument?e.ownerDocument.body:e.body:fl(t)&&Dd(t)?t:Od(t)}function xa(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Od(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=xr(r);if(o){const s=Ls(a);return t.concat(a,a.visualViewport||[],Dd(r)?r:[],s&&n?xa(s):[])}return t.concat(r,xa(r,[],n))}function Ls(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cb(e){const t=hl(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=fl(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=Ca(n)!==o||Ca(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function gl(e){return vb(e)?e:e.contextElement}function Au(e){const t=gl(e);if(!fl(t))return Sa(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Cb(t);let a=(o?Ca(n.width):n.width)/i,s=(o?Ca(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Sb=Sa(0);function xb(e){const t=xr(e);return!bb()||!t.visualViewport?Sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kb(e,t,n){return!1}function Hu(e,t,n,i){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),o=gl(e);let a=Sa(1);t&&(a=Au(e));const s=kb()?xb(o):Sa(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){const f=xr(o),g=i;let m=f,p=Ls(m);for(;p&&i&&g!==m;){const b=Au(p),y=p.getBoundingClientRect(),w=hl(p),S=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*b.x,M=y.top+(p.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=S,c+=M,m=xr(p),p=Ls(m)}}return pb({width:u,height:d,x:l,y:c})}function Mb(e,t){let n=null,i;const r=Id(e);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const g=Jo(u),m=Jo(r.clientWidth-(c+d)),p=Jo(r.clientHeight-(u+f)),b=Jo(c),w={rootMargin:-g+"px "+-m+"px "+-p+"px "+-b+"px",threshold:mb(0,gb(1,l))||1};let S=!0;function M(C){const x=C[0].intersectionRatio;if(x!==l){if(!S)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(M,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,w)}n.observe(e)}return a(!0),o}function Rb(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=gl(e),u=r||o?[...c?xa(c):[],...xa(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=c&&s?Mb(c,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let m,p=l?Hu(e):null;l&&b();function b(){const y=Hu(e);p&&(y.x!==p.x||y.y!==p.y||y.width!==p.width||y.height!==p.height)&&n(),p=y,m=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Fs=h.useLayoutEffect,Eb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ka=function(){};function Ib(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Tb(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=[].concat(i);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(Ib(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var zu=function(t){return zb(t)?t.filter(Boolean):uh(t)==="object"&&t!==null?[t]:[]},Pd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=kr(t,Eb);return Ye({},n)},nn=function(t,n,i){var r=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:r(i??{},a(n,t),s)}};function La(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Db(e){return La(e)?window.innerHeight:e.clientHeight}function _d(e){return La(e)?window.pageYOffset:e.scrollTop}function Ma(e,t){if(La(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Ob(e){var t=getComputedStyle(e),n=t.position==="absolute",i=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&i.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function Pb(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Qo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ka,r=_d(e),o=t-r,a=10,s=0;function l(){s+=a;var c=Pb(s,r,o,n);Ma(e,c),s<n?window.requestAnimationFrame(l):i(e)}l()}function $u(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.offsetHeight/3;i.bottom+r>n.bottom?Ma(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r<n.top&&Ma(e,Math.max(t.offsetTop-r,0))}function _b(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Vu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Lb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ld=!1,Fb={get passive(){return Ld=!0}},ea=typeof window<"u"?window:{};ea.addEventListener&&ea.removeEventListener&&(ea.addEventListener("p",ka,Fb),ea.removeEventListener("p",ka,!1));var Ab=Ld;function Hb(e){return e!=null}function zb(e){return Array.isArray(e)}function ta(e,t,n){return e?t:n}var $b=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var s=Cr(a,1),l=s[0];return!i.includes(l)});return o.reduce(function(a,s){var l=Cr(s,2),c=l[0],u=l[1];return a[c]=u,a},{})},Vb=["children","innerProps"],Nb=["children","innerProps"];function Bb(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=Ob(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,w=a?window.innerHeight:Db(l),S=_d(l),M=parseInt(getComputedStyle(n).marginBottom,10),C=parseInt(getComputedStyle(n).marginTop,10),x=y-C,R=w-p,I=x+S,E=d-S-p,H=g-w+S+M,z=S+p-C,L=160;switch(r){case"auto":case"bottom":if(R>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&Qo(l,H,L),{placement:"bottom",maxHeight:t};if(!a&&E>=i||a&&R>=i){o&&Qo(l,H,L);var F=a?R-M:E-M;return{placement:"bottom",maxHeight:F}}if(r==="auto"||a){var P=t,Q=a?x:I;return Q>=i&&(P=Math.min(Q-M-s,t)),{placement:"top",maxHeight:P}}if(r==="bottom")return o&&Ma(l,H),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!a)return o&&Qo(l,z,L),{placement:"top",maxHeight:t};if(!a&&I>=i||a&&x>=i){var q=t;return(!a&&I>=i||a&&x>=i)&&(q=a?x-C:I-C),o&&Qo(l,z,L),{placement:"top",maxHeight:q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function Wb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Fd=function(t){return t==="auto"?"bottom":t},Ub=function(t,n){var i,r=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return Ye((i={label:"menu"},qi(i,Wb(r),"100%"),qi(i,"position","absolute"),qi(i,"width","100%"),qi(i,"zIndex",1),i),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Ad=h.createContext(null),Yb=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,c=h.useContext(Ad)||{},u=c.setPortalPlacement,d=h.useRef(null),f=h.useState(r),g=Cr(f,2),m=g[0],p=g[1],b=h.useState(null),y=Cr(b,2),w=y[0],S=y[1],M=l.spacing.controlHeight;return Fs(function(){var C=d.current;if(C){var x=a==="fixed",R=s&&!x,I=Bb({maxHeight:r,menuEl:C,minHeight:i,placement:o,shouldScroll:R,isFixedPosition:x,controlHeight:M});p(I.maxHeight),S(I.placement),u==null||u(I.placement)}},[r,o,a,s,i,u,M]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:w||Fd(o),maxHeight:m})})},Xb=function(t){var n=t.children,i=t.innerRef,r=t.innerProps;return Ve("div",et({},nn(t,"menu",{menu:!0}),{ref:i},r),n)},Gb=Xb,jb=function(t,n){var i=t.maxHeight,r=t.theme.spacing.baseUnit;return Ye({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},qb=function(t){var n=t.children,i=t.innerProps,r=t.innerRef,o=t.isMulti;return Ve("div",et({},nn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),n)},Hd=function(t,n){var i=t.theme,r=i.spacing.baseUnit,o=i.colors;return Ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Kb=Hd,Zb=Hd,Jb=function(t){var n=t.children,i=n===void 0?"No options":n,r=t.innerProps,o=kr(t,Vb);return Ve("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Qb=function(t){var n=t.children,i=n===void 0?"Loading...":n,r=t.innerProps,o=kr(t,Nb);return Ve("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},ew=function(t){var n=t.rect,i=t.offset,r=t.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},tw=function(t){var n=t.appendTo,i=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=h.useRef(null),c=h.useRef(null),u=h.useState(Fd(a)),d=Cr(u,2),f=d[0],g=d[1],m=h.useMemo(function(){return{setPortalPlacement:g}},[]),p=h.useState(null),b=Cr(p,2),y=b[0],w=b[1],S=h.useCallback(function(){if(r){var R=_b(r),I=s==="fixed"?0:window.pageYOffset,E=R[f]+I;(E!==(y==null?void 0:y.offset)||R.left!==(y==null?void 0:y.rect.left)||R.width!==(y==null?void 0:y.rect.width))&&w({offset:E,rect:R})}},[r,s,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);Fs(function(){S()},[S]);var M=h.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=Rb(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);Fs(function(){M()},[M]);var C=h.useCallback(function(R){l.current=R,M()},[M]);if(!n&&s!=="fixed"||!y)return null;var x=Ve("div",et({ref:C},nn(Ye(Ye({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Ve(Ad.Provider,{value:m},n?ch.createPortal(x,n):x)},nw=function(t){var n=t.isDisabled,i=t.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},rw=function(t){var n=t.children,i=t.innerProps,r=t.isDisabled,o=t.isRtl;return Ve("div",et({},nn(t,"container",{"--is-disabled":r,"--is-rtl":o}),i),n)},iw=function(t,n){var i=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},ow=function(t){var n=t.children,i=t.innerProps,r=t.isMulti,o=t.hasValue;return Ve("div",et({},nn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),n)},aw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},sw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"indicatorsContainer",{indicators:!0}),i),n)},Nu,lw=["size"],uw=["innerProps","isRtl","size"],cw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},zd=function(t){var n=t.size,i=kr(t,lw);return Ve("svg",et({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:cw},i))},ml=function(t){return Ve(zd,et({size:20},t),Ve("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},$d=function(t){return Ve(zd,et({size:20},t),Ve("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Vd=function(t,n){var i=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?a.neutral60:a.neutral20,padding:o*2,":hover":{color:i?a.neutral80:a.neutral40}})},dw=Vd,fw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||Ve($d,null))},hw=Vd,gw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||Ve(ml,null))},mw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},pw=function(t){var n=t.innerProps;return Ve("span",et({},n,nn(t,"indicatorSeparator",{"indicator-separator":!0})))},vw=lh(Nu||(Nu=hb([`
|
191
|
+
Error: ${o}`}const i={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=o=>{if(Ze(o))return!e.isRequired;let a=Et(o),s=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(a)===!1?!1:s?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(o,a){if(typeof n=="string")return zt(Et(o),n);if(a){const s=r(o);if(s===!1)return zt(Et(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=bt(o)?Et(o):null,l=bt(s)?ya(s):"";return{...i,isMissingValue:Ze(s),data:s,displayData:l}}catch(s){return zt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}dl.isEditableType=!0;const Eu=hc("img",{target:"e17fx5ar0"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),E1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?kn("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:kn(Eu,{src:t})}):kn(Eu,{src:t})},Iu=new Map(Object.entries({object:Si,text:dl,checkbox:rl,selectbox:cl,list:ll,number:ul,link:kd,datetime:ol,date:sl,time:al,line_chart:yd,bar_chart:Cd,area_chart:Sd,image:xd,progress:Md})),I1=[];var T1=Zf,D1=Jf,O1=Qf,P1=eh,_1=th,L1=nh,F1=rh,A1=ih,H1="[object Map]",z1="[object Set]",$1=Object.prototype,V1=$1.hasOwnProperty;function N1(e){if(e==null)return!0;if(_1(e)&&(P1(e)||typeof e=="string"||typeof e.splice=="function"||L1(e)||A1(e)||O1(e)))return!e.length;var t=D1(e);if(t==H1||t==z1)return!e.size;if(F1(e))return!T1(e).length;for(var n in e)if(V1.call(e,n))return!1;return!0}var B1=N1;const W1=Mi(B1);function Tu(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=i.exec(n);if(r)return r[1].trim()}function U1(e,t,n){const i={},r=Tu(t,"color",n);r&&(i.textDark=r);const o=Tu(t,"background-color",n);return o&&(i.bgCell=o),o==="yellow"&&r===void 0&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}function Y1(e){let t=e?co(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty","large_string[pyarrow]"].includes(t)?dl:["datetime","datetimetz"].includes(t)?ol:t==="time"?al:t==="date"?sl:["object","bytes"].includes(t)?Si:fc(e)?rl:ah(e)?ul:t==="categorical"?cl:t.startsWith("list")?ll:Si):Si}function X1(e,t){const n=e.columnTypes.index[t],i=e.indexNames[t];let r=!0;return co(n)==="range"&&(r=!1),{id:`_index-${t}`,name:i,title:i,isEditable:r,arrowType:n,isIndex:!0,isPinned:!0,isHidden:!1}}function G1(e,t){const n=e.columnNames.map(s=>s[t]),i=n.length>0?n[n.length-1]:"",r=n.length>1?n.slice(0,-1).filter(s=>s!=="").join(" / "):void 0;let o=e.columnTypes.data[t];Ze(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"});let a;if(co(o)==="categorical"){const s=e.getCategoricalOptions(t);bt(s)&&(a={options:s})}return{id:`_column-${i}-${t}`,name:i,title:i,isEditable:!0,arrowType:o,columnTypeOptions:a,isIndex:!1,isPinned:!1,isHidden:!1,group:r}}function Rd(){return{id:"_empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0,isPinned:!0}}function j1(e){const t=[],{dimensions:n}=e,i=n.indexColumns,r=n.dataColumns;if(i===0&&r===0)return t.push(Rd()),t;for(let o=0;o<i;o++){const a={...X1(e,o),indexNumber:o};t.push(a)}for(let o=0;o<r;o++){const a={...G1(e,o),indexNumber:o+i};t.push(a)}return t}function q1(e,t,n=void 0){var o,a,s,l,c,u;const i=e.arrowType?co(e.arrowType):null;let r;if(e.kind==="object")r=e.getCell(bt(t.content)?ya(Al(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&bt(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let d;i==="time"&&bt((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?d=oh(t.content,t.field):d=Hr.utc(Number(t.content)).toDate(),r=e.getCell(d)}else if(i==="decimal"){const d=Ze(t.content)?null:Al(t.content,t.contentType,t.field);r=e.getCell(d)}else r=e.getCell(t.content);if(Ci(r))return r;if(!e.isEditable){if(bt(t.displayContent)){const d=ya(t.displayContent);r.kind===Z.Text?r={...r,displayData:d}:r.kind===Z.Number&&Ze((s=e.columnTypeOptions)==null?void 0:s.format)?r={...r,displayData:d}:r.kind===Z.Uri&&Ze((l=e.columnTypeOptions)==null?void 0:l.display_text)?r={...r,displayData:d}:r.kind===Z.Custom&&((c=r.data)==null?void 0:c.kind)==="date-picker-cell"&&Ze((u=e.columnTypeOptions)==null?void 0:u.format)&&(r={...r,data:{...r.data,displayDate:d}})}n&&t.cssId&&(r=U1(r,t.cssId,n))}return r}const oa="_index",Du="_pos:",Ou={small:75,medium:200,large:400};function K1(e){if(!Ze(e)){if(typeof e=="number")return e;if(e in Ou)return Ou[e]}}const Ko=(e,t)=>Mh(e,t,(i,r)=>{if(sh(r))return r});function Z1(e,t){if(!t)return e;let n={};return e.isIndex&&t.has(oa)&&(n=Ko(n,t.get(oa)??{})),t.has(`${Du}${e.indexNumber}`)&&(n=Ko(n,t.get(`${Du}${e.indexNumber}`)??{})),t.has(e.name)&&e.name!==oa&&(n=Ko(n,t.get(e.name)??{})),t.has(e.id)&&(n=Ko(n,t.get(e.id)??{})),W1(n)?e:cc({...e},{title:n.label,width:K1(n.width),isEditable:bt(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help})}function J1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return gc(t),new Map}}function Q1(e){var i;const t=(i=e.columnTypeOptions)==null?void 0:i.type;let n;return bt(t)&&Iu.has(t)&&(n=Iu.get(t)),Ze(n)&&(n=Y1(e.arrowType)),n}function eb(e,t,n,i){const r=$s(),o=ne.useMemo(()=>J1(e.columns),[e.columns]),[a,s]=ne.useState(o);ne.useEffect(()=>{s(o)},[o]);const l=e.useContainerWidth||bt(e.width)&&e.width>0;return{columns:ne.useMemo(()=>{const u=j1(t).map(m=>{let p={...m,...Z1(m,a),isStretched:l};const b=Q1(p);return(e.editingMode===Xn.EditingMode.READ_ONLY||n||b.isEditableType===!1)&&(p={...p,isEditable:!1}),e.editingMode!==Xn.EditingMode.READ_ONLY&&p.isEditable==!0&&(p={...p,icon:"editable"},p.isRequired&&e.editingMode===Xn.EditingMode.DYNAMIC&&(p={...p,isHidden:!1})),b(p,r)}).filter(m=>!m.isHidden),d=[],f=[];i!=null&&i.length?(u.forEach(m=>{m.isIndex&&!i.includes(m.name)&&!i.includes(m.id)&&m.isPinned!==!1&&d.push(m)}),i.forEach(m=>{const p=u.find(b=>b.name===m||b.id===m);p&&(p.isPinned?d.push(p):f.push(p))})):u.forEach(m=>{m.isPinned?d.push(m):f.push(m)});const g=[...d,...f];return g.length>0?g:[Si(Rd())]},[t,a,l,n,e.editingMode,i,r]),setColumnConfigMapping:s}}function oo(e){return e.isIndex?oa:Ze(e.name)?"":e.name}class Zo{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const i={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,s)=>{const l={};o.forEach((c,u,d)=>{const f=n.get(u);f&&(l[oo(f)]=f.getCellValue(c))}),i.edited_rows[a]=l}),this.addedRows.forEach(o=>{const a={};let s=!1;o.forEach((l,c,u)=>{const d=n.get(c);if(d){const f=d.getCellValue(l);d.isRequired&&d.isEditable&&Pa(l)&&(s=!0),bt(f)&&(a[oo(d)]=f)}}),s||i.added_rows.push(a)}),i.deleted_rows=this.deletedRows,JSON.stringify(i,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const i=JSON.parse(t),r=new Map;n.forEach(a=>{r.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(oo(a),a)}),Object.keys(i.edited_rows).forEach(a=>{const s=Number(a),l=i.edited_rows[a];Object.keys(l).forEach(c=>{var f;const u=l[c],d=o.get(c);if(d){const g=d.getCell(u);g&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(f=this.editedCells.get(s))==null||f.set(d.indexNumber,g))}})}),i.added_rows.forEach(a=>{const s=new Map;n.forEach(l=>{s.set(l.indexNumber,l.getCell(null))}),Object.keys(a).forEach(l=>{const c=a[l],u=o.get(l);if(u){const d=u.getCell(c);d&&s.set(u.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=i.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const i=this.editedCells.get(n);if(i!==void 0)return i.get(t)}setCell(t,n,i){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,i)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,i)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,i)=>i-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ze(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,i)=>n-i)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let i=0;i<this.deletedRows.length&&!(this.deletedRows[i]>n);i++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}function tb(e,t,n,i,r,o){const a=ne.useMemo(()=>e.filter(u=>u.isPinned).reduce((u,d)=>u+(d.width??i*2),0)>n*.6,[e,n,i]),s=t||a?0:e.filter(u=>u.isPinned).length,l=ne.useCallback(u=>{o(d=>{const f=new Map(d),g=f.get(u);return f.set(u,{...g||{},pinned:!1}),f}),r(!0,!1)},[r,o]);return{pinColumn:ne.useCallback(u=>{o(d=>{const f=new Map(d),g=f.get(u);return f.set(u,{...g||{},pinned:!0}),f}),r(!0,!1)},[r,o]),unpinColumn:l,freezeColumns:s}}function nb(e,t,n,i,r){return{onColumnMoved:ne.useCallback((a,s)=>{const l=[...e],[c]=l.splice(a,1);l.splice(s,0,c),s<t&&!c.isPinned?n(c.id):s>=t&&c.isPinned&&i(c.id),r(l.map(u=>u.id))},[e,t,n,i,r])}}function rb(e){const[t,n]=h.useState(()=>new Map),i=ne.useCallback((o,a,s,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:ne.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:i}}function ib(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(i=>i.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Pu(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function ob(e,t){return e=Pu(e),t=Pu(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function ab(e,t){return e>t?1:e===t?0:-1}function sb(e){const{sort:t,rows:n,getCellContent:i}=e;let r=t===void 0?void 0:e.columns.findIndex(c=>t.column===c||c.id!==void 0&&t.column.id===c.id);r===-1&&(r=void 0);const o=(t==null?void 0:t.direction)??"asc",a=h.useMemo(()=>{if(r===void 0)return;const c=new Array(n),u=[r,0];for(let f=0;f<n;f++)u[1]=f,c[f]=ib(i(u));let d;return(t==null?void 0:t.mode)==="raw"?d=dr(n).sort((f,g)=>ab(c[f],c[g])):(t==null?void 0:t.mode)==="smart"?d=dr(n).sort((f,g)=>ob(c[f],c[g])):d=dr(n).sort((f,g)=>c[f].localeCompare(c[g])),o==="desc"&&d.reverse(),d},[i,n,t==null?void 0:t.mode,o,r]),s=h.useCallback(c=>a===void 0?c:a[c],[a]),l=h.useCallback(([c,u])=>a===void 0?i([c,u]):(u=a[u],i([c,u])),[i,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:l}}function lb(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function ub(e,t,n){const[i,r]=ne.useState(),{getCellContent:o,getOriginalIndex:a}=sb({columns:t.map(c=>_s(c)),getCellContent:n,rows:e,sort:i}),s=ne.useMemo(()=>lb(t,i),[t,i]),l=ne.useCallback(c=>{let u="asc";const d=s[c];if(i&&i.column.id===d.id)if(i.direction==="asc")u="desc";else{r(void 0);return}r({column:_s(d),direction:u,mode:d.sortMode})},[i,s]);return{columns:s,sortColumn:l,getOriginalIndex:a,getCellContent:o}}const cb={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:i,rect:r,hoverAmount:o,hoverX:a}=e;let{values:s,yAxis:l,color:c,graphKind:u="area",displayValues:d,hideAxis:f}=t.data;const[g,m]=l;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-g)/(m-g))));const p=i.cellHorizontalPadding,b=p+r.x,y=r.y+3,w=r.height-6,S=r.width-p*2,M=m-g,C=m<=0?y:g>=0?y+w:y+w*(m/M);if(!f&&g<=0&&m>=0&&(n.beginPath(),n.moveTo(b,C),n.lineTo(b+S,C),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.globalAlpha=1),u==="bar"){n.beginPath();const x=2,R=(s.length-1)*x,I=(S-R)/s.length;let E=b;for(const H of s){const z=y+w-H*w;n.moveTo(E,C),n.lineTo(E+I,C),n.lineTo(E+I,z),n.lineTo(E,z),E+=I+x}n.fillStyle=t.data.color??i.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),R=s.map((E,H)=>({x:b+x*H,y:y+w-E*w}));n.moveTo(R[0].x,R[0].y);let I=0;if(R.length>2)for(I=1;I<R.length-2;I++){const E=(R[I].x+R[I+1].x)/2,H=(R[I].y+R[I+1].y)/2;n.quadraticCurveTo(R[I].x,R[I].y,E,H)}if(n.quadraticCurveTo(R[I].x,R[I].y,R[I+1].x,R[I+1].y),n.strokeStyle=c??i.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(r.x+r.width-p,C),n.lineTo(r.x+p,C),n.closePath(),u==="area"){n.globalAlpha=.2+.2*o;const E=n.createLinearGradient(0,y,0,y+w*1.4);E.addColorStop(0,c??i.accentColor);const[H,z,L]=ga(c??i.accentColor);E.addColorStop(1,`rgba(${H}, ${z}, ${L}, 0)`),n.fillStyle=E,n.fill(),n.globalAlpha=1}if(a!==void 0&&(u==="line"||u==="area")&&d!==void 0){n.beginPath();const E=Math.min(s.length-1,Math.max(0,Math.round((a-p)/x)));n.moveTo(b+E*x,r.y+1),n.lineTo(b+E*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.save(),n.font=`8px ${i.fontFamily}`,n.fillStyle=i.textMedium,n.textBaseline="top",n.fillText(d[E],b,r.y+i.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function _u(e,t,n,i,r,o){if(!(i<=0||r<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,i,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,i/2),tr:Math.min(o.tr,r/2,i/2),bl:Math.min(o.bl,r/2,i/2),br:Math.min(o.br,r/2,i/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lu(Object(n),!0).forEach(function(i){qi(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}var db=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function fb(e){var t=e.defaultInputValue,n=t===void 0?"":t,i=e.defaultMenuIsOpen,r=i===void 0?!1:i,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,c=e.onChange,u=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,g=e.value,m=kr(e,db),p=h.useState(s!==void 0?s:n),b=Cr(p,2),y=b[0],w=b[1],S=h.useState(l!==void 0?l:r),M=Cr(S,2),C=M[0],x=M[1],R=h.useState(g!==void 0?g:a),I=Cr(R,2),E=I[0],H=I[1],z=h.useCallback(function(de,me){typeof c=="function"&&c(de,me),H(de)},[c]),L=h.useCallback(function(de,me){var re;typeof u=="function"&&(re=u(de,me)),w(re!==void 0?re:de)},[u]),F=h.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),P=h.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),Q=s!==void 0?s:y,q=l!==void 0?l:C,ae=g!==void 0?g:E;return Ye(Ye({},m),{},{inputValue:Q,menuIsOpen:q,onChange:z,onInputChange:L,onMenuClose:P,onMenuOpen:F,value:ae})}function hb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const gb=Math.min,mb=Math.max,Ca=Math.round,Jo=Math.floor,Sa=e=>({x:e,y:e});function pb(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function _a(){return typeof window<"u"}function Ed(e){return Td(e)?(e.nodeName||"").toLowerCase():"#document"}function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Id(e){var t;return(t=(Td(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Td(e){return _a()?e instanceof Node||e instanceof xr(e).Node:!1}function vb(e){return _a()?e instanceof Element||e instanceof xr(e).Element:!1}function fl(e){return _a()?e instanceof HTMLElement||e instanceof xr(e).HTMLElement:!1}function Fu(e){return!_a()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xr(e).ShadowRoot}function Dd(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=hl(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function bb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wb(e){return["html","body","#document"].includes(Ed(e))}function hl(e){return xr(e).getComputedStyle(e)}function yb(e){if(Ed(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fu(e)&&e.host||Id(e);return Fu(t)?t.host:t}function Od(e){const t=yb(e);return wb(t)?e.ownerDocument?e.ownerDocument.body:e.body:fl(t)&&Dd(t)?t:Od(t)}function xa(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Od(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=xr(r);if(o){const s=Ls(a);return t.concat(a,a.visualViewport||[],Dd(r)?r:[],s&&n?xa(s):[])}return t.concat(r,xa(r,[],n))}function Ls(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cb(e){const t=hl(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=fl(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=Ca(n)!==o||Ca(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function gl(e){return vb(e)?e:e.contextElement}function Au(e){const t=gl(e);if(!fl(t))return Sa(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=Cb(t);let a=(o?Ca(n.width):n.width)/i,s=(o?Ca(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Sb=Sa(0);function xb(e){const t=xr(e);return!bb()||!t.visualViewport?Sb:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kb(e,t,n){return!1}function Hu(e,t,n,i){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),o=gl(e);let a=Sa(1);t&&(a=Au(e));const s=kb()?xb(o):Sa(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(o){const f=xr(o),g=i;let m=f,p=Ls(m);for(;p&&i&&g!==m;){const b=Au(p),y=p.getBoundingClientRect(),w=hl(p),S=y.left+(p.clientLeft+parseFloat(w.paddingLeft))*b.x,M=y.top+(p.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=S,c+=M,m=xr(p),p=Ls(m)}}return pb({width:u,height:d,x:l,y:c})}function Mb(e,t){let n=null,i;const r=Id(e);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const g=Jo(u),m=Jo(r.clientWidth-(c+d)),p=Jo(r.clientHeight-(u+f)),b=Jo(c),w={rootMargin:-g+"px "+-m+"px "+-p+"px "+-b+"px",threshold:mb(0,gb(1,l))||1};let S=!0;function M(C){const x=C[0].intersectionRatio;if(x!==l){if(!S)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(M,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,w)}n.observe(e)}return a(!0),o}function Rb(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=gl(e),u=r||o?[...c?xa(c):[],...xa(t)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const d=c&&s?Mb(c,n):null;let f=-1,g=null;a&&(g=new ResizeObserver(y=>{let[w]=y;w&&w.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let m,p=l?Hu(e):null;l&&b();function b(){const y=Hu(e);p&&(y.x!==p.x||y.y!==p.y||y.width!==p.width||y.height!==p.height)&&n(),p=y,m=requestAnimationFrame(b)}return n(),()=>{var y;u.forEach(w=>{r&&w.removeEventListener("scroll",n),o&&w.removeEventListener("resize",n)}),d==null||d(),(y=g)==null||y.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Fs=h.useLayoutEffect,Eb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ka=function(){};function Ib(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Tb(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=[].concat(i);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(Ib(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var zu=function(t){return zb(t)?t.filter(Boolean):uh(t)==="object"&&t!==null?[t]:[]},Pd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=kr(t,Eb);return Ye({},n)},nn=function(t,n,i){var r=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:r(i??{},a(n,t),s)}};function La(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Db(e){return La(e)?window.innerHeight:e.clientHeight}function _d(e){return La(e)?window.pageYOffset:e.scrollTop}function Ma(e,t){if(La(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Ob(e){var t=getComputedStyle(e),n=t.position==="absolute",i=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&i.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function Pb(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Qo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ka,r=_d(e),o=t-r,a=10,s=0;function l(){s+=a;var c=Pb(s,r,o,n);Ma(e,c),s<n?window.requestAnimationFrame(l):i(e)}l()}function $u(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.offsetHeight/3;i.bottom+r>n.bottom?Ma(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r<n.top&&Ma(e,Math.max(t.offsetTop-r,0))}function _b(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Vu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Lb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ld=!1,Fb={get passive(){return Ld=!0}},ea=typeof window<"u"?window:{};ea.addEventListener&&ea.removeEventListener&&(ea.addEventListener("p",ka,Fb),ea.removeEventListener("p",ka,!1));var Ab=Ld;function Hb(e){return e!=null}function zb(e){return Array.isArray(e)}function ta(e,t,n){return e?t:n}var $b=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var s=Cr(a,1),l=s[0];return!i.includes(l)});return o.reduce(function(a,s){var l=Cr(s,2),c=l[0],u=l[1];return a[c]=u,a},{})},Vb=["children","innerProps"],Nb=["children","innerProps"];function Bb(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=Ob(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,b=n.offsetParent.getBoundingClientRect(),y=b.top,w=a?window.innerHeight:Db(l),S=_d(l),M=parseInt(getComputedStyle(n).marginBottom,10),C=parseInt(getComputedStyle(n).marginTop,10),x=y-C,R=w-p,I=x+S,E=d-S-p,H=g-w+S+M,z=S+p-C,L=160;switch(r){case"auto":case"bottom":if(R>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&Qo(l,H,L),{placement:"bottom",maxHeight:t};if(!a&&E>=i||a&&R>=i){o&&Qo(l,H,L);var F=a?R-M:E-M;return{placement:"bottom",maxHeight:F}}if(r==="auto"||a){var P=t,Q=a?x:I;return Q>=i&&(P=Math.min(Q-M-s,t)),{placement:"top",maxHeight:P}}if(r==="bottom")return o&&Ma(l,H),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!a)return o&&Qo(l,z,L),{placement:"top",maxHeight:t};if(!a&&I>=i||a&&x>=i){var q=t;return(!a&&I>=i||a&&x>=i)&&(q=a?x-C:I-C),o&&Qo(l,z,L),{placement:"top",maxHeight:q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function Wb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Fd=function(t){return t==="auto"?"bottom":t},Ub=function(t,n){var i,r=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return Ye((i={label:"menu"},qi(i,Wb(r),"100%"),qi(i,"position","absolute"),qi(i,"width","100%"),qi(i,"zIndex",1),i),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Ad=h.createContext(null),Yb=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,c=h.useContext(Ad)||{},u=c.setPortalPlacement,d=h.useRef(null),f=h.useState(r),g=Cr(f,2),m=g[0],p=g[1],b=h.useState(null),y=Cr(b,2),w=y[0],S=y[1],M=l.spacing.controlHeight;return Fs(function(){var C=d.current;if(C){var x=a==="fixed",R=s&&!x,I=Bb({maxHeight:r,menuEl:C,minHeight:i,placement:o,shouldScroll:R,isFixedPosition:x,controlHeight:M});p(I.maxHeight),S(I.placement),u==null||u(I.placement)}},[r,o,a,s,i,u,M]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:w||Fd(o),maxHeight:m})})},Xb=function(t){var n=t.children,i=t.innerRef,r=t.innerProps;return Ve("div",et({},nn(t,"menu",{menu:!0}),{ref:i},r),n)},Gb=Xb,jb=function(t,n){var i=t.maxHeight,r=t.theme.spacing.baseUnit;return Ye({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},qb=function(t){var n=t.children,i=t.innerProps,r=t.innerRef,o=t.isMulti;return Ve("div",et({},nn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),n)},Hd=function(t,n){var i=t.theme,r=i.spacing.baseUnit,o=i.colors;return Ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Kb=Hd,Zb=Hd,Jb=function(t){var n=t.children,i=n===void 0?"No options":n,r=t.innerProps,o=kr(t,Vb);return Ve("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Qb=function(t){var n=t.children,i=n===void 0?"Loading...":n,r=t.innerProps,o=kr(t,Nb);return Ve("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},ew=function(t){var n=t.rect,i=t.offset,r=t.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},tw=function(t){var n=t.appendTo,i=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=h.useRef(null),c=h.useRef(null),u=h.useState(Fd(a)),d=Cr(u,2),f=d[0],g=d[1],m=h.useMemo(function(){return{setPortalPlacement:g}},[]),p=h.useState(null),b=Cr(p,2),y=b[0],w=b[1],S=h.useCallback(function(){if(r){var R=_b(r),I=s==="fixed"?0:window.pageYOffset,E=R[f]+I;(E!==(y==null?void 0:y.offset)||R.left!==(y==null?void 0:y.rect.left)||R.width!==(y==null?void 0:y.rect.width))&&w({offset:E,rect:R})}},[r,s,f,y==null?void 0:y.offset,y==null?void 0:y.rect.left,y==null?void 0:y.rect.width]);Fs(function(){S()},[S]);var M=h.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=Rb(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);Fs(function(){M()},[M]);var C=h.useCallback(function(R){l.current=R,M()},[M]);if(!n&&s!=="fixed"||!y)return null;var x=Ve("div",et({ref:C},nn(Ye(Ye({},t),{},{offset:y.offset,position:s,rect:y.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Ve(Ad.Provider,{value:m},n?ch.createPortal(x,n):x)},nw=function(t){var n=t.isDisabled,i=t.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},rw=function(t){var n=t.children,i=t.innerProps,r=t.isDisabled,o=t.isRtl;return Ve("div",et({},nn(t,"container",{"--is-disabled":r,"--is-rtl":o}),i),n)},iw=function(t,n){var i=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},ow=function(t){var n=t.children,i=t.innerProps,r=t.isMulti,o=t.hasValue;return Ve("div",et({},nn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),n)},aw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},sw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"indicatorsContainer",{indicators:!0}),i),n)},Nu,lw=["size"],uw=["innerProps","isRtl","size"],cw={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},zd=function(t){var n=t.size,i=kr(t,lw);return Ve("svg",et({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:cw},i))},ml=function(t){return Ve(zd,et({size:20},t),Ve("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},$d=function(t){return Ve(zd,et({size:20},t),Ve("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Vd=function(t,n){var i=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?a.neutral60:a.neutral20,padding:o*2,":hover":{color:i?a.neutral80:a.neutral40}})},dw=Vd,fw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||Ve($d,null))},hw=Vd,gw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||Ve(ml,null))},mw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},pw=function(t){var n=t.innerProps;return Ve("span",et({},n,nn(t,"indicatorSeparator",{"indicator-separator":!0})))},vw=lh(Nu||(Nu=hb([`
|
192
192
|
0%, 80%, 100% { opacity: 0; }
|
193
193
|
40% { opacity: 1; }
|
194
194
|
`]))),bw=function(t,n){var i=t.isFocused,r=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?a.neutral60:a.neutral20,padding:s*2})},gs=function(t){var n=t.delay,i=t.offset;return Ve("span",{css:mc({animation:"".concat(vw," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},ww=function(t){var n=t.innerProps,i=t.isRtl,r=t.size,o=r===void 0?4:r,a=kr(t,uw);return Ve("div",et({},nn(Ye(Ye({},a),{},{innerProps:n,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ve(gs,{delay:0,offset:i}),Ve(gs,{delay:160,offset:!0}),Ve(gs,{delay:320,offset:!i}))},yw=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?a.neutral5:a.neutral0,borderColor:i?a.neutral10:r?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Cw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return Ve("div",et({ref:o},nn(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":s}),a,{"aria-disabled":i||void 0}),n)},Sw=Cw,xw=["data"],kw=function(t,n){var i=t.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},Mw=function(t){var n=t.children,i=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,c=t.label,u=t.theme,d=t.selectProps;return Ve("div",et({},nn(t,"group",{group:!0}),l),Ve(a,et({},s,{selectProps:d,theme:u,getStyles:r,getClassNames:o,cx:i}),c),Ve("div",null,n))},Rw=function(t,n){var i=t.theme,r=i.colors,o=i.spacing;return Ye({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},Ew=function(t){var n=Pd(t);n.data;var i=kr(n,xw);return Ve("div",et({},nn(t,"groupHeading",{"group-heading":!0}),i))},Iw=Mw,Tw=["innerRef","isDisabled","isHidden","inputClassName"],Dw=function(t,n){var i=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,s=o.colors;return Ye(Ye({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},Ow),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},Nd={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Ow={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Nd)},Pw=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Nd)},_w=function(t){var n=t.cx,i=t.value,r=Pd(t),o=r.innerRef,a=r.isDisabled,s=r.isHidden,l=r.inputClassName,c=kr(r,Tw);return Ve("div",et({},nn(t,"input",{"input-container":!0}),{"data-value":i||""}),Ve("input",et({className:n({input:!0},l),ref:o,style:Pw(s),disabled:a},c)))},Lw=_w,Fw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Aw=function(t,n){var i=t.theme,r=i.borderRadius,o=i.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Hw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors,s=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Bd=function(t){var n=t.children,i=t.innerProps;return Ve("div",i,n)},zw=Bd,$w=Bd;function Vw(e){var t=e.children,n=e.innerProps;return Ve("div",et({role:"button"},n),t||Ve(ml,{size:14}))}var Nw=function(t){var n=t.children,i=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,c=i.Container,u=i.Label,d=i.Remove;return Ve(c,{data:r,innerProps:Ye(Ye({},nn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},Ve(u,{data:r,innerProps:Ye({},nn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ve(d,{data:r,innerProps:Ye(Ye({},nn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},Bw=Nw,Ww=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},Uw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return Ve("div",et({},nn(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":i},s),n)},Yw=Uw,Xw=function(t,n){var i=t.theme,r=i.spacing,o=i.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Gw=function(t){var n=t.children,i=t.innerProps;return Ve("div",et({},nn(t,"placeholder",{placeholder:!0}),i),n)},jw=Gw,qw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Kw=function(t){var n=t.children,i=t.isDisabled,r=t.innerProps;return Ve("div",et({},nn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},Zw=Kw,Wd={ClearIndicator:gw,Control:Sw,DropdownIndicator:fw,DownChevron:$d,CrossIcon:ml,Group:Iw,GroupHeading:Ew,IndicatorsContainer:sw,IndicatorSeparator:pw,Input:Lw,LoadingIndicator:ww,Menu:Gb,MenuList:qb,MenuPortal:tw,LoadingMessage:Qb,NoOptionsMessage:Jb,MultiValue:Bw,MultiValueContainer:zw,MultiValueLabel:$w,MultiValueRemove:Vw,Option:Yw,Placeholder:jw,SelectContainer:rw,SingleValue:Zw,ValueContainer:ow},Jw=function(t){return Ye(Ye({},Wd),t.components)},Bu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Qw(e,t){return!!(e===t||Bu(e)&&Bu(t))}function ey(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Qw(e[n],t[n]))return!1;return!0}function ty(e,t){t===void 0&&(t=ey);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return i.clear=function(){n=null},i}var ny={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"},ry=function(t){return Ve("span",et({css:ny},t))},Wu=ry,iy={guidance:function(t){var n=t.isSearchable,i=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,i=t.label,r=i===void 0?"":i,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,i=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,c=t.isSelected,u=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(d(s,i),".");if(n==="menu"&&u){var f=l?" disabled":"",g="".concat(c?" selected":"").concat(f);return"".concat(a).concat(g,", ").concat(d(r,i),".")}return""},onFilter:function(t){var n=t.inputValue,i=t.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},oy=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,u=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,b=l.isSearchable,y=l.menuIsOpen,w=l.options,S=l.screenReaderStatus,M=l.tabSelectsValue,C=l.isLoading,x=l["aria-label"],R=l["aria-live"],I=h.useMemo(function(){return Ye(Ye({},iy),d||{})},[d]),E=h.useMemo(function(){var Q="";if(n&&I.onChange){var q=n.option,ae=n.options,de=n.removedValue,me=n.removedValues,re=n.value,J=function(k){return Array.isArray(k)?null:k},le=de||q||J(re),ie=le?f(le):"",pe=ae||me||void 0,ye=pe?pe.map(f):[],G=Ye({isDisabled:le&&p(le,s),label:ie,labels:ye},n);Q=I.onChange(G)}return Q},[n,I,p,s,f]),H=h.useMemo(function(){var Q="",q=i||r,ae=!!(i&&s&&s.includes(i));if(q&&I.onFocus){var de={focused:q,label:f(q),isDisabled:p(q,s),isSelected:ae,options:o,context:q===i?"menu":"value",selectValue:s,isAppleDevice:u};Q=I.onFocus(de)}return Q},[i,r,f,p,I,o,s,u]),z=h.useMemo(function(){var Q="";if(y&&w.length&&!C&&I.onFilter){var q=S({count:o.length});Q=I.onFilter({inputValue:g,resultsMessage:q})}return Q},[o,g,y,I,w,S,C]),L=(n==null?void 0:n.action)==="initial-input-focus",F=h.useMemo(function(){var Q="";if(I.guidance){var q=r?"value":y?"menu":"input";Q=I.guidance({"aria-label":x,context:q,isDisabled:i&&p(i,s),isMulti:m,isSearchable:b,tabSelectsValue:M,isInitialFocus:L})}return Q},[x,i,r,m,p,b,y,I,s,M,L]),P=Ve(h.Fragment,null,Ve("span",{id:"aria-selection"},E),Ve("span",{id:"aria-focused"},H),Ve("span",{id:"aria-results"},z),Ve("span",{id:"aria-guidance"},F));return Ve(h.Fragment,null,Ve(Wu,{id:c},L&&P),Ve(Wu,{"aria-live":R,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!L&&P))},ay=oy,As=[{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źẑżžẓẕƶȥɀⱬꝣ"}],sy=new RegExp("["+As.map(function(e){return e.letters}).join("")+"]","g"),Ud={};for(var ms=0;ms<As.length;ms++)for(var ps=As[ms],vs=0;vs<ps.letters.length;vs++)Ud[ps.letters[vs]]=ps.base;var Yd=function(t){return t.replace(sy,function(n){return Ud[n]})},ly=ty(Yd),Uu=function(t){return t.replace(/^\s+|\s+$/g,"")},uy=function(t){return"".concat(t.label," ").concat(t.value)},cy=function(t){return function(n,i){if(n.data.__isNew__)return!0;var r=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:uy,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,s=r.stringify,l=r.trim,c=r.matchFrom,u=l?Uu(i):i,d=l?Uu(s(n)):s(n);return o&&(u=u.toLowerCase(),d=d.toLowerCase()),a&&(u=ly(u),d=Yd(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},dy=["innerRef"];function fy(e){var t=e.innerRef,n=kr(e,dy),i=$b(n,"onExited","in","enter","exit","appear");return Ve("input",et({ref:t},i,{css:mc({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 hy=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function gy(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=h.useRef(!1),s=h.useRef(!1),l=h.useRef(0),c=h.useRef(null),u=h.useCallback(function(b,y){if(c.current!==null){var w=c.current,S=w.scrollTop,M=w.scrollHeight,C=w.clientHeight,x=c.current,R=y>0,I=M-C-S,E=!1;I>y&&a.current&&(i&&i(b),a.current=!1),R&&s.current&&(o&&o(b),s.current=!1),R&&y>I?(n&&!a.current&&n(b),x.scrollTop=M,E=!0,a.current=!0):!R&&-y>S&&(r&&!s.current&&r(b),x.scrollTop=0,E=!0,s.current=!0),E&&hy(b)}},[n,i,r,o]),d=h.useCallback(function(b){u(b,b.deltaY)},[u]),f=h.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),g=h.useCallback(function(b){var y=l.current-b.changedTouches[0].clientY;u(b,y)},[u]),m=h.useCallback(function(b){if(b){var y=Ab?{passive:!1}:!1;b.addEventListener("wheel",d,y),b.addEventListener("touchstart",f,y),b.addEventListener("touchmove",g,y)}},[g,f,d]),p=h.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",g,!1))},[g,f,d]);return h.useEffect(function(){if(t){var b=c.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){c.current=b}}var Yu=["boxSizing","height","overflow","paddingRight","position"],Xu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Gu(e){e.preventDefault()}function ju(e){e.stopPropagation()}function qu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Ku(){return"ontouchstart"in window||navigator.maxTouchPoints}var Zu=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,mi={capture:!1,passive:!1};function my(e){var t=e.isEnabled,n=e.accountForScrollbars,i=n===void 0?!0:n,r=h.useRef({}),o=h.useRef(null),a=h.useCallback(function(l){if(Zu){var c=document.body,u=c&&c.style;if(i&&Yu.forEach(function(m){var p=u&&u[m];r.current[m]=p}),i&&ji<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+d||0;Object.keys(Xu).forEach(function(m){var p=Xu[m];u&&(u[m]=p)}),u&&(u.paddingRight="".concat(g,"px"))}c&&Ku()&&(c.addEventListener("touchmove",Gu,mi),l&&(l.addEventListener("touchstart",qu,mi),l.addEventListener("touchmove",ju,mi))),ji+=1}},[i]),s=h.useCallback(function(l){if(Zu){var c=document.body,u=c&&c.style;ji=Math.max(ji-1,0),i&&ji<1&&Yu.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Ku()&&(c.removeEventListener("touchmove",Gu,mi),l&&(l.removeEventListener("touchstart",qu,mi),l.removeEventListener("touchmove",ju,mi)))}},[i]);return h.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var py=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},vy={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function by(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,r=i===void 0?!0:i,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,c=gy({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),u=my({isEnabled:n}),d=function(g){c(g),u(g)};return Ve(h.Fragment,null,n&&Ve("div",{onClick:py,css:vy}),t(d))}var wy={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},yy=function(t){var n=t.name,i=t.onFocus;return Ve("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:wy,value:"",onChange:function(){}})},Cy=yy;function pl(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 Sy(){return pl(/^iPhone/i)}function Xd(){return pl(/^Mac/i)}function xy(){return pl(/^iPad/i)||Xd()&&navigator.maxTouchPoints>1}function ky(){return Sy()||xy()}function My(){return Xd()||ky()}var Ry=function(t){return t.label},Ey=function(t){return t.label},Iy=function(t){return t.value},Ty=function(t){return!!t.isDisabled},Dy={clearIndicator:hw,container:nw,control:yw,dropdownIndicator:dw,group:kw,groupHeading:Rw,indicatorsContainer:aw,indicatorSeparator:mw,input:Dw,loadingIndicator:bw,loadingMessage:Zb,menu:Ub,menuList:jb,menuPortal:ew,multiValue:Fw,multiValueLabel:Aw,multiValueRemove:Hw,noOptionsMessage:Kb,option:Ww,placeholder:Xw,singleValue:qw,valueContainer:iw},Oy={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%)"},Py=4,Gd=4,_y=38,Ly=Gd*2,Fy={baseUnit:Gd,controlHeight:_y,menuGutter:Ly},bs={borderRadius:Py,colors:Oy,spacing:Fy},Ay={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Vu(),captureMenuScroll:!Vu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:cy(),formatGroupLabel:Ry,getOptionLabel:Ey,getOptionValue:Iy,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Ty,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Lb(),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 Ju(e,t,n,i){var r=Kd(e,t,n),o=Zd(e,t,n),a=qd(e,t),s=Ra(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:s,index:i}}function aa(e,t){return e.options.map(function(n,i){if("options"in n){var r=n.options.map(function(a,s){return Ju(e,a,t,s)}).filter(function(a){return ec(e,a)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=Ju(e,n,t,i);return ec(e,o)?o:void 0}).filter(Hb)}function jd(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Vs(n.options.map(function(i){return i.data}))):t.push(n.data),t},[])}function Qu(e,t){return e.reduce(function(n,i){return i.type==="group"?n.push.apply(n,Vs(i.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(t,"-").concat(i.index)}),n},[])}function Hy(e,t){return jd(aa(e,t))}function ec(e,t){var n=e.inputValue,i=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,s=t.value;return(!Qd(e)||!o)&&Jd(e,{label:a,value:s,data:r},i)}function zy(e,t){var n=e.focusedValue,i=e.selectValue,r=i.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function $y(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var ws=function(t,n){var i,r=(i=t.find(function(o){return o.data===n}))===null||i===void 0?void 0:i.id;return r||null},qd=function(t,n){return t.getOptionLabel(n)},Ra=function(t,n){return t.getOptionValue(n)};function Kd(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Zd(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var i=Ra(e,t);return n.some(function(r){return Ra(e,r)===i})}function Jd(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Qd=function(t){var n=t.hideSelectedOptions,i=t.isMulti;return n===void 0?i:n},Vy=1,ef=function(e){Th(n,e);var t=Ph(n);function n(i){var r;if(Dh(this,n),r=t.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=My(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(l,c),d(l,c)},r.setValue=function(l,c,u){var d=r.props,f=d.closeMenuOnSelect,g=d.isMulti,m=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:u})},r.selectOption=function(l){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,g=r.state.selectValue,m=d&&r.isOptionSelected(l,g),p=r.isOptionDisabled(l,g);if(m){var b=r.getOptionValue(l);r.setValue(g.filter(function(y){return r.getOptionValue(y)!==b}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(Vs(g),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}u&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(l),f=u.filter(function(m){return r.getOptionValue(m)!==d}),g=ta(c,f,f[0]||null);r.onChange(g,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(ta(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=ta(l,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(l){return ws(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Qu(aa(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return Tb.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(l){return qd(r.props,l)},r.getOptionValue=function(l){return Ra(r.props,l)},r.getStyles=function(l,c){var u=r.props.unstyled,d=Dy[l](c,u);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,c):d},r.getClassNames=function(l,c){var u,d;return(u=(d=r.props.classNames)[l])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Jw(r.props)},r.buildCategorizedOptions=function(){return aa(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return jd(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,c){r.setState({ariaSelection:Ye({value:l},c)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&La(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var c=l.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var c=l.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),g=5;r.userIsDragging=d>g||f>g}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,u=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),u=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:u>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return Qd(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,g=c.inputValue,m=c.isClearable,p=c.isDisabled,b=c.menuIsOpen,y=c.onKeyDown,w=c.tabSelectsValue,S=c.openMenuOnFocus,M=r.state,C=M.focusedOption,x=M.focusedValue,R=M.selectValue;if(!p&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!u||g)return;r.focusValue("previous");break;case"ArrowRight":if(!u||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(x)r.removeValue(x);else{if(!d)return;u?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!w||!C||S&&r.isOptionSelected(C,R))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(b){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(g)return;if(!b){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++Vy),r.state.selectValue=zu(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),s=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[s],r.state.focusedOptionId=ws(o,a[s])}return r}return Oh(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&&$u(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&s&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&($u(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(s[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var c=a.length-1,u=-1;if(a.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:a[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,c=s.indexOf(a);a||(c=-1),r==="up"?l=c>0?c-1:s.length-1:r==="down"?l=(c+1)%s.length:r==="pageup"?(l=c-o,l<0&&(l=0)):r==="pagedown"?(l=c+o,l>s.length-1&&(l=s.length-1)):r==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(bs):Ye(Ye({},bs),this.props.theme):bs}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,g=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return Kd(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Zd(this.props,r,o)}},{key:"filterOption",value:function(r,o){return Jd(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,s=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,g=this.getComponents(),m=g.Input,p=this.state,b=p.inputIsHidden,y=p.ariaSelection,w=this.commonProps,S=s||this.getElementId("input"),M=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(y==null?void 0:y.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?h.createElement(m,et({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},M)):h.createElement(fy,et({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ka,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:u,value:""},M))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,u=o.SingleValue,d=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,b=g.isMulti,y=g.inputValue,w=g.placeholder,S=this.state,M=S.selectValue,C=S.focusedValue,x=S.isFocused;if(!this.hasValue()||!m)return y?null:h.createElement(d,et({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return M.map(function(I,E){var H=I===C,z="".concat(r.getOptionLabel(I),"-").concat(r.getOptionValue(I));return h.createElement(a,et({},f,{components:{Container:s,Label:l,Remove:c},isFocused:H,isDisabled:p,key:z,index:E,removeProps:{onClick:function(){return r.removeValue(I)},onTouchEnd:function(){return r.removeValue(I)},onMouseDown:function(F){F.preventDefault()}},data:I}),r.formatOptionLabel(I,"value"))});if(y)return null;var R=M[0];return h.createElement(u,et({},f,{data:R,isDisabled:p}),this.formatOptionLabel(R,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,c=s.isLoading,u=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,et({},a,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,c=s.isLoading,u=this.state.isFocused;if(!o||!c)return null;var d={"aria-hidden":"true"};return h.createElement(o,et({},a,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return h.createElement(a,et({},s,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,et({},a,{innerProps:c,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,c=o.MenuList,u=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,y=b.captureMenuScroll,w=b.inputValue,S=b.isLoading,M=b.loadingMessage,C=b.minMenuHeight,x=b.maxMenuHeight,R=b.menuIsOpen,I=b.menuPlacement,E=b.menuPosition,H=b.menuPortalTarget,z=b.menuShouldBlockScroll,L=b.menuShouldScrollIntoView,F=b.noOptionsMessage,P=b.onMenuScrollToTop,Q=b.onMenuScrollToBottom;if(!R)return null;var q=function(ie,pe){var ye=ie.type,G=ie.data,O=ie.isDisabled,k=ie.isSelected,V=ie.label,se=ie.value,Pe=p===G,Ne=O?void 0:function(){return r.onOptionHover(G)},ve=O?void 0:function(){return r.selectOption(G)},Be="".concat(r.getElementId("option"),"-").concat(pe),xe={id:Be,onClick:ve,onMouseMove:Ne,onMouseOver:Ne,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:k};return h.createElement(g,et({},m,{innerProps:xe,data:G,isDisabled:O,isSelected:k,key:Be,label:V,type:ye,value:se,isFocused:Pe,innerRef:Pe?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(ie.data,"menu"))},ae;if(this.hasOptions())ae=this.getCategorizedOptions().map(function(le){if(le.type==="group"){var ie=le.data,pe=le.options,ye=le.index,G="".concat(r.getElementId("group"),"-").concat(ye),O="".concat(G,"-heading");return h.createElement(a,et({},m,{key:G,data:ie,options:pe,Heading:s,headingProps:{id:O,data:le.data},label:r.formatGroupLabel(le.data)}),le.options.map(function(k){return q(k,"".concat(ye,"-").concat(k.index))}))}else if(le.type==="option")return q(le,"".concat(le.index))});else if(S){var de=M({inputValue:w});if(de===null)return null;ae=h.createElement(d,m,de)}else{var me=F({inputValue:w});if(me===null)return null;ae=h.createElement(f,m,me)}var re={minMenuHeight:C,maxMenuHeight:x,menuPlacement:I,menuPosition:E,menuShouldScrollIntoView:L},J=h.createElement(Yb,et({},m,re),function(le){var ie=le.ref,pe=le.placerProps,ye=pe.placement,G=pe.maxHeight;return h.createElement(l,et({},m,re,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:ye}),h.createElement(by,{captureEnabled:y,onTopArrive:P,onBottomArrive:Q,lockEnabled:z},function(O){return h.createElement(c,et({},m,{innerRef:function(V){r.getMenuListRef(V),O(V)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:G,focusedOption:p}),ae)}))});return H||E==="fixed"?h.createElement(u,et({},m,{appendTo:H,controlElement:this.controlRef,menuPlacement:I,menuPosition:E}),J):J}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,c=o.name,u=o.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!s)return h.createElement(Cy,{name:c,onFocus:this.onValueInputFocus});if(!(!c||s))if(l)if(a){var f=d.map(function(p){return r.getOptionValue(p)}).join(a);return h.createElement("input",{name:c,type:"hidden",value:f})}else{var g=d.length>0?d.map(function(p,b){return h.createElement("input",{key:"i-".concat(b),name:c,type:"hidden",value:r.getOptionValue(p)})}):h.createElement("input",{name:c,type:"hidden",value:""});return h.createElement("div",null,g)}else{var m=d[0]?this.getOptionValue(d[0]):"";return h.createElement("input",{name:c,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,c=o.isFocused,u=o.selectValue,d=this.getFocusableOptions();return h.createElement(ay,et({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,s=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,g=c.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return h.createElement(s,et({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),h.createElement(o,et({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),h.createElement(l,et({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),h.createElement(a,et({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,u=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,g=r.options,m=r.value,p=r.menuIsOpen,b=r.inputValue,y=r.isMulti,w=zu(m),S={};if(a&&(m!==a.value||g!==a.options||p!==a.menuIsOpen||b!==a.inputValue)){var M=p?Hy(r,w):[],C=p?Qu(aa(r,w),"".concat(f,"-option")):[],x=s?zy(o,w):null,R=$y(o,M),I=ws(C,R);S={selectValue:w,focusedOption:R,focusedOptionId:I,focusableOptionsWithIds:C,focusedValue:x,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},H=c,z=u&&d;return u&&!z&&(H={value:ta(y,w,w[0]||null),options:w,action:"initial-input-focus"},z=!d),(c==null?void 0:c.action)==="initial-input-focus"&&(H=null),Ye(Ye(Ye({},S),E),{},{prevProps:r,ariaSelection:H,prevWasFocused:z})}}]),n}(h.Component);ef.defaultProps=Ay;var Ny=h.forwardRef(function(e,t){var n=fb(e);return h.createElement(ef,et({ref:t},n))}),By=Ny;const Wy=e=>{const{Menu:t}=Wd,{children:n,...i}=e;return h.createElement(t,{...i},n)},Uy=dn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Yy=dn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Xy=dn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),Gy=e=>{const{value:t,onFinishedEditing:n,initialValue:i}=e,{allowedValues:r,value:o}=t.data,[a,s]=h.useState(o),[l,c]=h.useState(i??""),u=Jm(),d=h.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?h.createElement(Xy,null,h.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):h.createElement(Uy,null,h.createElement(By,{className:"glide-select",inputValue:l,onInputChange:c,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:g})=>({...f,fontSize:u.editorFontSize,fontFamily:u.fontFamily,cursor:g?"pointer":void 0,paddingLeft:u.cellHorizontalPadding,paddingRight:u.cellHorizontalPadding,":active":{...f[":active"],color:u.accentFg},":empty::after":{content:'" "',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:u.bgCell,neutral5:u.bgCell,neutral10:u.bgCell,neutral20:u.bgCellMedium,neutral30:u.bgCellMedium,neutral40:u.bgCellMedium,neutral50:u.textLight,neutral60:u.textMedium,neutral70:u.textMedium,neutral80:u.textDark,neutral90:u.textDark,neutral100:u.textDark,primary:u.accentColor,primary75:u.accentColor,primary50:u.accentColor,primary25:u.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>h.createElement(Yy,null,h.createElement(Wy,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(g=>window.requestAnimationFrame(g)),n({...t,data:{...t.data,value:f.value}}))}}))},jy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{value:o}=t.data,a=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),s=typeof a=="string"?a:(a==null?void 0:a.label)??"";return s&&(n.fillStyle=i.textDark,n.fillText(s,r.x+i.cellHorizontalPadding,r.y+r.height/2+pr(n,i))),!0},measure:(e,t,n)=>{const{value:i}=t.data;return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Gy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Kr=6,qy={marginRight:8},Ky={display:"flex",alignItems:"center",flexGrow:1},Zy={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{min:o,max:a,value:s,label:l,measureLabel:c}=t.data,u=r.x+i.cellHorizontalPadding,d=r.y+r.height/2,f=a-o,g=(s-o)/f;n.save();let m=0;l!==void 0&&(n.font=`12px ${i.fontFamily}`,m=ri(c??l,n,`12px ${i.fontFamily}`).width+i.cellHorizontalPadding);const p=r.width-i.cellHorizontalPadding*2-m;if(p>=Kr){const b=n.createLinearGradient(u,d,u+p,d);b.addColorStop(0,i.accentColor),b.addColorStop(g,i.accentColor),b.addColorStop(g,i.bgBubble),b.addColorStop(1,i.bgBubble),n.beginPath(),n.fillStyle=b,_u(n,u,d-Kr/2,p,Kr,Kr/2),n.fill(),n.beginPath(),_u(n,u+.5,d-Kr/2+.5,p-1,Kr-1,(Kr-1)/2),n.strokeStyle=i.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=i.textDark,n.fillText(l,r.x+r.width-i.cellHorizontalPadding,d+pr(n,`12px ${i.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,i=t.value.toString(),r=t.min.toString(),o=t.max.toString(),a=t.step.toString(),s=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return h.createElement("label",{style:Ky},h.createElement("input",{style:qy,type:"range",value:i,min:r,max:o,step:a,onChange:s,disabled:n}),i)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},Jy=dn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ys=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Qy=e=>{const t=e.value.data,{format:n,displayDate:i}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ys(n,t.min):t.min,a=t.max instanceof Date?ys(n,t.max):t.max;let s=t.date;const l=t.timezoneOffset?t.timezoneOffset*60*1e3:0;l&&s&&(s=new Date(s.getTime()+l));const c=ys(n,s);return e.value.readonly?ne.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:i??"",onChange:()=>{}}):ne.createElement(Jy,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:c,min:o,max:a,step:r,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-l)}})}})},eC={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Uc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:i}=t.data;return e.measureText(i).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Qy}),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)}}},tC="None";function tc(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const nC=e=>{const{cell:t,theme:n,ctx:i}=e;Uc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},tC,t.contentAlign),i.fillStyle=n.textDark};function rC(e){const t=ne.useCallback((i,r)=>{const{cell:o,theme:a,ctx:s,rect:l}=i,c=i.col;if(Ci(o))tc(s,l,a);else if(Pa(o)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?r():nC(i),u.isRequired&&u.isEditable&&tc(s,l,a);return}r()},[e]),n=ne.useMemo(()=>[cb,jy,Zy,eC,...I1],[]);return{drawCell:t,customRenderers:n}}function iC(){const e=$s();return ne.useMemo(()=>{const n={editable:r=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${r.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:ts(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:ts(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${e.fontSizes.sm}`,baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:ts(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Pr(e.spacing.sm)),cellVerticalPadding:Math.round(Pr("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(Pr("25rem")),minColumnWidth:Math.round(Pr("3.125rem")),maxColumnWidth:Math.round(Pr("62.5rem")),maxColumnAutoWidth:Math.round(Pr("31.25rem")),defaultRowHeight:Math.round(Pr("2.1875rem")),defaultHeaderHeight:Math.round(Pr("2.1875rem")),bgRowHovered:dh(e.colors.bgColor,e.colors.secondaryBg,.3),headerIcons:n}},[e])}function oC(e,t,n,i,r,o,a,s,l){const c=ne.useCallback(([p,b],y)=>{const w=e[p];if(!w.isEditable)return;const S=w.indexNumber,M=n.current.getOriginalRowIndex(r(b)),C=i([p,b]),x=w.getCellValue(C),R=w.getCellValue(y);if(!Ci(C)&&R===x)return;const I=w.getCell(R,!0);Ci(I)?pc(`Not applying the cell edit since it causes this error:
|
195
195
|
${I.data}`):(n.current.setCell(S,M,{...I,lastUpdated:performance.now()}),s())},[e,n,r,i,s]),u=ne.useCallback(()=>{if(t)return;const p=new Map;e.forEach(b=>{p.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=ne.useCallback(()=>{t||(u(),s())},[u,s,t]),f=ne.useCallback(p=>{var b;if(p.rows.length>0){if(t)return!0;const y=p.rows.toArray().map(w=>n.current.getOriginalRowIndex(r(w)));return n.current.deleteRows(y),a(),l(),s(),!1}if((b=p.current)!=null&&b.range){const y=[],w=p.current.range;for(let S=w.y;S<w.y+w.height;S++)for(let M=w.x;M<w.x+w.width;M++){const C=e[M];C.isEditable&&!C.isRequired&&(y.push({cell:[M,S]}),c([M,S],C.getCell(null)))}return y.length>0&&(s(),o(y)),!1}return!0},[e,n,t,o,r,s,c,l,a]),g=ne.useCallback((p,b)=>{const[y,w]=p,S=[];for(let M=0;M<b.length;M++){const C=b[M];if(M+w>=n.current.getNumRows()){if(t)break;u()}for(let x=0;x<C.length;x++){const R=C[x],I=M+w,E=x+y;if(E>=e.length)break;const H=e[E];if(H.isEditable){const z=H.getCell(R,!0);if(bt(z)&&!Ci(z)){const L=H.indexNumber,F=n.current.getOriginalRowIndex(r(I)),P=H.getCellValue(i([E,I]));H.getCellValue(z)!==P&&(n.current.setCell(L,F,{...z,lastUpdated:performance.now()}),S.push({cell:[E,I]}))}}}S.length>0&&(s(),o(S))}return!1},[e,n,t,r,i,u,s,o]),m=ne.useCallback((p,b)=>{const y=p[0];if(y>=e.length)return!0;const w=e[y];if(w.validateInput){const S=w.validateInput(w.getCellValue(b));return S===!0||S===!1?S:w.getCell(S)}return!0},[e]);return{onCellEdited:c,onPaste:g,onRowAppended:d,onDelete:f,validateCell:m}}const tf=",",Ji='"',aC='"',nf=`
|
196
|
-
`,sC="\uFEFF",lC=new RegExp(`[${[tf,Ji,nf].join("")}]`);function nc(e){return e.map(t=>uC(t)).join(tf)+nf}function uC(e){if(Ze(e))return"";const t=Et(e);return lC.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),aC+Ji)}${Ji}`:t}async function rc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode(sC));const o=n.map(a=>a.name);await e.write(r.encode(nc(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,c,u)=>{s.push(l.getCellValue(t([c,a])))}),await e.write(r.encode(nc(s)))}await e.close()}function cC(e,t,n,i){return{exportToCsv:ne.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const c=await(await(await zs(()=>import("./es6.
|
197
|
-
Error: ${f}`)}},[t,n,e,i,r])}}function fC(e){const[t,n]=ne.useState(void 0),i=ne.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:ne.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:i}}function hC(e,t,n,i,r){const[o,a]=ne.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Xn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Xn.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Xn.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(Xn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Xn.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(Xn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,g=o.current!==void 0,m=ne.useCallback(b=>{const y=!ns(b.rows.toArray(),o.rows.toArray()),w=!ns(b.columns.toArray(),o.columns.toArray()),S=!ns(b.current,o.current);let M=s&&y||c&&w,C=b;if((s||c)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),w&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,c,r,i]),p=ne.useCallback((b=!1,y=!1)=>{const w={columns:y?o.columns:vt.empty(),rows:b?o.rows:vt.empty(),current:void 0};a(w),(!b&&s||!y&&c)&&r(w)},[o,s,c,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:d,isColumnSelected:f,isCellSelected:g,clearSelection:p,processSelectionChange:m}}function gC(e,t,n,i,r,o,a){const s=t.defaultRowHeight,l=t.defaultHeaderHeight+s+2*t.tableBorderWidth,c=i?2:1,u=e.editingMode===Xn.EditingMode.DYNAMIC?1:0,d=n+u;let f=Math.max(d*s+c*t.defaultHeaderHeight+2*t.tableBorderWidth,l),g=Math.min(f,t.defaultTableHeight);e.height&&(g=Math.max(e.height,l),f=Math.max(e.height,f)),o&&(g=Math.min(g,o),f=Math.min(f,o),e.height||(g=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(r,m);let b,y=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),y=Math.min(Math.max(e.width,y),p));const[w,S]=ne.useState({width:b||"100%",height:g});return ne.useLayoutEffect(()=>{e.useContainerWidth&&w.width==="100%"&&S(M=>({...M,width:p}))},[p]),ne.useLayoutEffect(()=>{S(M=>({...M,width:b||"100%"}))},[b]),ne.useLayoutEffect(()=>{S(M=>({...M,height:g}))},[g,n]),ne.useLayoutEffect(()=>{if(a){const M=e.useContainerWidth||bt(e.width)&&e.width>0;S({width:M?y:"100%",height:f})}else S({width:b||"100%",height:g})},[a]),{minHeight:l,maxHeight:f,minWidth:m,maxWidth:y,rowHeight:s,resizableSize:w,setResizableSize:S}}const mC=600,pC="⚠️ Please fill out this cell.";function vC(e,t){const[n,i]=ne.useState(),r=ne.useRef(null),o=ne.useCallback(s=>{if(clearTimeout(r.current),r.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const l=s.location[0],c=s.location[1];let u;if(l<0||l>=e.length)return;const d=e[l];if(s.kind==="header"&&bt(d))u=d.help;else if(s.kind==="cell"){const f=t([l,c]);Ci(f)?u=f.errorDetails:d.isRequired&&d.isEditable&&Pa(f)?u=pC:b1(f)&&(u=f.tooltip)}u&&(r.current=setTimeout(()=>{u&&i({content:u,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},mC))}},[e,t,i,r]),a=ne.useCallback(()=>{i(void 0)},[i]);return{tooltip:n,clearTooltip:a,onItemHovered:o}}function bC({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=ne.useState(!0),a=$s(),{colors:s,fontSizes:l,radii:c,fontWeights:u}=a,d=ne.useCallback(()=>{o(!1),i()},[i,o]);return kn(vh,{content:kn(fh,{"data-testid":"stDataFrameTooltipContent",children:kn(hh,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:gh.top,accessibilityType:mh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{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"}},Inner:{style:{backgroundColor:ph(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:kn("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const ic=hc("div",{target:"ekup9rd0"})(({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"}})),oc=150,wC=15e4,na=6;function yC({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:c,height:u}=Sh(xh),d=ne.useRef(null),f=ne.useRef(null),g=ne.useRef(null),m=iC(),{getRowThemeOverride:p,onItemHovered:b}=fC(m),{libConfig:{enforceDownloadInNewTab:y=!1}}=ne.useContext(bh),[w,S]=ne.useState(!0),[M,C]=ne.useState(!1),[x,R]=ne.useState(!1),[I,E]=ne.useState(!1),H=ne.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),z=ne.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ze(e.editingMode)&&(e.editingMode=Xn.EditingMode.READ_ONLY);const{READ_ONLY:L,DYNAMIC:F}=Xn.EditingMode,P=t.dimensions,Q=Math.max(0,P.dataRows),q=Q===0&&!(e.editingMode===F&&P.dataColumns>0),ae=Q>wC,de=ne.useRef(new Zo(Q)),[me,re]=ne.useState(de.current.getNumRows());ne.useEffect(()=>{de.current=new Zo(Q),re(de.current.getNumRows())},[Q]);const J=ne.useCallback(()=>{de.current=new Zo(Q),re(de.current.getNumRows())},[Q]),[le,ie]=ne.useState(e.columnOrder),{columns:pe,setColumnConfigMapping:ye}=eb(e,t,n,le);ne.useEffect(()=>{if(e.editingMode===L)return;const Se=i.getStringValue({id:e.id,formId:e.formId});Se&&(de.current.fromJson(Se,pe),re(de.current.getNumRows()))},[]);const{getCellContent:G}=dC(t,pe,me,de),{columns:O,sortColumn:k,getOriginalIndex:V,getCellContent:se}=ub(Q,pe,G),Pe=ne.useCallback(Se=>{const he={selection:{rows:[],columns:[]}};he.selection.rows=Se.rows.toArray().map(yt=>V(yt)),he.selection.columns=Se.columns.toArray().map(yt=>oo(O[yt]));const wt=JSON.stringify(he),_t=i.getStringValue({id:e.id,formId:e.formId});(_t===void 0||_t!==wt)&&i.setStringValue({id:e.id,formId:e.formId},wt,{fromUi:!0},o)},[O,e.id,e.formId,i,o,V]),{debouncedCallback:Ne}=ku(Pe,oc),{gridSelection:ve,isRowSelectionActivated:Be,isMultiRowSelectionActivated:xe,isColumnSelectionActivated:xt,isMultiColumnSelectionActivated:Tt,isRowSelected:Je,isColumnSelected:te,isCellSelected:rt,clearSelection:ue,processSelectionChange:oe}=hC(e,q,n,O,Ne);ne.useEffect(()=>{ue(!0,!0)},[a]);const ge=ne.useCallback(Se=>{var he;(he=f.current)==null||he.updateCells(Se)},[]);ne.useEffect(()=>{var he,wt,_t,yt;if(!Be&&!xt)return;const Se=i.getStringValue({id:e.id,formId:e.formId});if(Se){const Bt=O.map(_=>oo(_)),bn=JSON.parse(Se);let zn=vt.empty(),wn=vt.empty();(wt=(he=bn.selection)==null?void 0:he.rows)==null||wt.forEach(_=>{zn=zn.add(_)}),(yt=(_t=bn.selection)==null?void 0:_t.columns)==null||yt.forEach(_=>{wn=wn.add(Bt.indexOf(_))}),(zn.length>0||wn.length>0)&&oe({rows:zn,columns:wn,current:void 0})}},[]);const $e=ne.useCallback(()=>{me!==de.current.getNumRows()&&re(de.current.getNumRows())},[me]),ze=ne.useCallback(()=>{const Se=de.current.toJson(O);let he=i.getStringValue({id:e.id,formId:e.formId});he===void 0&&(he=new Zo(0).toJson([])),Se!==he&&i.setStringValue({id:e.id,formId:e.formId},Se,{fromUi:!0},o)},[O,e.id,e.formId,i,o]),{debouncedCallback:tt}=ku(ze,oc),{exportToCsv:fe}=cC(se,O,me,y),{onCellEdited:Ee,onPaste:st,onRowAppended:Le,onDelete:Ge,validateCell:pt}=oC(O,e.editingMode!==F,de,se,V,ge,$e,tt,ue),{tooltip:lt,clearTooltip:_e,onItemHovered:Dt}=vC(O,se),{drawCell:Xt,customRenderers:Ot}=rC(O),$t=ne.useMemo(()=>O.map(Se=>_s(Se)),[O]),{columns:Zt,onColumnResize:Ht}=rb($t),Mn=t.columns.length>1,{minHeight:Nt,maxHeight:kt,minWidth:Dn,maxWidth:vn,rowHeight:Oe,resizableSize:Lt,setResizableSize:un}=gC(e,m,me,Mn,c,u,a),fn=ne.useCallback(([Se,he])=>({...w1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(O.length-1,0)]}),[O,m.glideTheme.textLight]),hn=ne.useCallback(()=>{J(),ue()},[J,ue]);yh({element:e,widgetMgr:i,onFormCleared:hn});const ot=!q&&e.editingMode===F&&!n,{pinColumn:Gt,unpinColumn:Ft,freezeColumns:Jt}=tb(O,q,c,m.minColumnWidth,ue,ye),{onColumnMoved:Pt}=nb(O,Jt,Gt,Ft,ie);return ne.useEffect(()=>{setTimeout(()=>{var Se,he;if(g.current&&f.current){const wt=(he=(Se=g.current)==null?void 0:Se.querySelector(".dvn-stack"))==null?void 0:he.getBoundingClientRect();wt&&(R(wt.height>g.current.clientHeight),E(wt.width>g.current.clientWidth))}},1)},[Lt,me,Zt]),Hl(ic,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:z,ref:g,onMouseDown:Se=>{if(g.current&&z){const he=g.current.getBoundingClientRect();I&&he.height-(na+1)<Se.clientY-he.top&&Se.stopPropagation(),x&&he.width-(na+1)<Se.clientX-he.left&&Se.stopPropagation()}},onBlur:Se=>{!w&&!H&&!Se.currentTarget.contains(Se.relatedTarget)&&ue(!0,!0)},children:[Hl(kh,{isFullScreen:a,disableFullscreenMode:r,locked:Je&&!Be||rt||H&&w,onExpand:s,onCollapse:l,target:ic,children:[(Be&&Je||xt&&te)&&kn(Wi,{label:"Clear selection",icon:Ih,onClick:()=>{ue(),_e()}}),ot&&Je&&kn(Wi,{label:"Delete row(s)",icon:_h,onClick:()=>{Ge&&(Ge(ve),_e())}}),ot&&!Je&&kn(Wi,{label:"Add row",icon:vc,onClick:()=>{Le&&(S(!0),Le(),_e())}}),!ae&&!q&&kn(Wi,{label:"Download as CSV",icon:Lh,onClick:()=>fe()}),!q&&kn(Wi,{label:"Search",icon:bc,onClick:()=>{M?C(!1):(S(!0),C(!0)),_e()}})]}),kn(wh,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Lt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Nt,maxHeight:kt,minWidth:Dn,maxWidth:vn,size:Lt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Oe],snapGap:Oe/3,onResizeStop:(Se,he,wt,_t)=>{if(d.current){const yt=2*m.tableBorderWidth;un({width:d.current.size.width,height:kt-d.current.size.height===yt?d.current.size.height+yt:d.current.size.height})}},children:kn(g1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:Zt,rows:q?1:me,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Oe,headerHeight:m.defaultHeaderHeight,getCellContent:q?fn:se,onColumnResize:H?void 0:Ht,resizeIndicator:"header",freezeColumns:Jt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:H?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:xt?void 0:Pt,onItemHovered:Se=>{b==null||b(Se),Dt==null||Dt(Se)},keybindings:{downFill:!0},onKeyDown:Se=>{(Se.ctrlKey||Se.metaKey)&&Se.key==="f"&&(C(he=>!he),Se.stopPropagation(),Se.preventDefault())},showSearch:M,onSearchClose:()=>{C(!1),_e()},onHeaderClicked:(Se,he)=>{q||ae||xt||(Be&&Je&&ue(),k(Se))},gridSelection:ve,onGridSelectionChange:Se=>{(w||H)&&(oe(Se),lt!==void 0&&_e())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:Se=>{Se.kind==="out-of-bounds"&&w?S(!1):Se.kind!=="out-of-bounds"&&!w&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...z&&{paddingBottom:I?-na:void 0,paddingRight:x?-na:void 0}},drawCell:Xt,customRenderers:Ot,imageEditorOverride:E1,headerIcons:m.headerIcons,validateCell:pt,onPaste:!1,...Be&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:xe?"multi":"auto",rowSelect:n?"none":xe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...xt&&{columnSelect:n?"none":Tt?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!q&&e.editingMode!==L&&!n&&{fillHandle:!H,onCellEdited:Ee,onPaste:st,onDelete:Ge},...!q&&e.editingMode===F&&{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:Le,onHeaderClicked:void 0}})}),lt&<.content&&kn(bC,{top:lt.top,left:lt.left,content:lt.content,clearTooltip:_e})]})}const CC=Ch(yC),LC=Object.freeze(Object.defineProperty({__proto__:null,default:CC},Symbol.toStringTag,{value:"Module"}));export{W0 as C,Zc as T,bi as a,Yh as b,LC as c,pi as i,Zm as m,dn as s};
|
196
|
+
`,sC="\uFEFF",lC=new RegExp(`[${[tf,Ji,nf].join("")}]`);function nc(e){return e.map(t=>uC(t)).join(tf)+nf}function uC(e){if(Ze(e))return"";const t=Et(e);return lC.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),aC+Ji)}${Ji}`:t}async function rc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode(sC));const o=n.map(a=>a.name);await e.write(r.encode(nc(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,c,u)=>{s.push(l.getCellValue(t([c,a])))}),await e.write(r.encode(nc(s)))}await e.close()}function cC(e,t,n,i){return{exportToCsv:ne.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const c=await(await(await zs(()=>import("./es6.DEWLLkEJ.js").then(u=>u.a),__vite__mapDeps([14,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await rc(c,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{pc("Failed to export data as CSV with FileSystem API, trying fallback method",s);let l="";const c=new WritableStream({write:async g=>{l+=new TextDecoder("utf-8").decode(g)},close:async()=>{}});await rc(c.getWriter(),e,t,n);const u=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(u),f=Eh({enforceDownloadInNewTab:i,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(l){gc("Failed to export data as CSV",l)}}},[t,n,e,i])}}function dC(e,t,n,i){const r=e.dimensions.headerRows;return{getCellContent:ne.useCallback(([a,s])=>{if(a>t.length-1)return zt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return zt("Row index out of bounds","This error should never happen. Please report this bug.");const l=t[a],c=l.indexNumber,u=i.current.getOriginalRowIndex(s),d=i.current.isAddedRow(u);if(l.isEditable||d){const f=i.current.getCell(c,u);if(bt(f))return f;if(d)return zt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${c}; row=${u}`)}try{const f=e.getCell(u+r,c);return q1(l,f,e.cssStyles)}catch(f){return zt("Error during cell creation",`This error should never happen. Please report this bug.
|
197
|
+
Error: ${f}`)}},[t,n,e,i,r])}}function fC(e){const[t,n]=ne.useState(void 0),i=ne.useCallback(o=>{if(o.kind!=="cell")n(void 0);else{const[,a]=o.location;n(a)}},[n]);return{getRowThemeOverride:ne.useCallback(o=>{if(o===t)return{bgCell:e.bgRowHovered,bgCellMedium:e.bgRowHovered}},[e.bgRowHovered,t]),onItemHovered:i}}function hC(e,t,n,i,r){const[o,a]=ne.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Xn.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Xn.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Xn.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(Xn.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Xn.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(Xn.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,g=o.current!==void 0,m=ne.useCallback(b=>{const y=!ns(b.rows.toArray(),o.rows.toArray()),w=!ns(b.columns.toArray(),o.columns.toArray()),S=!ns(b.current,o.current);let M=s&&y||c&&w,C=b;if((s||c)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),w&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,c,r,i]),p=ne.useCallback((b=!1,y=!1)=>{const w={columns:y?o.columns:vt.empty(),rows:b?o.rows:vt.empty(),current:void 0};a(w),(!b&&s||!y&&c)&&r(w)},[o,s,c,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:d,isColumnSelected:f,isCellSelected:g,clearSelection:p,processSelectionChange:m}}function gC(e,t,n,i,r,o,a){const s=t.defaultRowHeight,l=t.defaultHeaderHeight+s+2*t.tableBorderWidth,c=i?2:1,u=e.editingMode===Xn.EditingMode.DYNAMIC?1:0,d=n+u;let f=Math.max(d*s+c*t.defaultHeaderHeight+2*t.tableBorderWidth,l),g=Math.min(f,t.defaultTableHeight);e.height&&(g=Math.max(e.height,l),f=Math.max(e.height,f)),o&&(g=Math.min(g,o),f=Math.min(f,o),e.height||(g=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(r,m);let b,y=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),y=Math.min(Math.max(e.width,y),p));const[w,S]=ne.useState({width:b||"100%",height:g});return ne.useLayoutEffect(()=>{e.useContainerWidth&&w.width==="100%"&&S(M=>({...M,width:p}))},[p]),ne.useLayoutEffect(()=>{S(M=>({...M,width:b||"100%"}))},[b]),ne.useLayoutEffect(()=>{S(M=>({...M,height:g}))},[g,n]),ne.useLayoutEffect(()=>{if(a){const M=e.useContainerWidth||bt(e.width)&&e.width>0;S({width:M?y:"100%",height:f})}else S({width:b||"100%",height:g})},[a]),{minHeight:l,maxHeight:f,minWidth:m,maxWidth:y,rowHeight:s,resizableSize:w,setResizableSize:S}}const mC=600,pC="⚠️ Please fill out this cell.";function vC(e,t){const[n,i]=ne.useState(),r=ne.useRef(null),o=ne.useCallback(s=>{if(clearTimeout(r.current),r.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const l=s.location[0],c=s.location[1];let u;if(l<0||l>=e.length)return;const d=e[l];if(s.kind==="header"&&bt(d))u=d.help;else if(s.kind==="cell"){const f=t([l,c]);Ci(f)?u=f.errorDetails:d.isRequired&&d.isEditable&&Pa(f)?u=pC:b1(f)&&(u=f.tooltip)}u&&(r.current=setTimeout(()=>{u&&i({content:u,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},mC))}},[e,t,i,r]),a=ne.useCallback(()=>{i(void 0)},[i]);return{tooltip:n,clearTooltip:a,onItemHovered:o}}function bC({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=ne.useState(!0),a=$s(),{colors:s,fontSizes:l,radii:c,fontWeights:u}=a,d=ne.useCallback(()=>{o(!1),i()},[i,o]);return kn(vh,{content:kn(fh,{"data-testid":"stDataFrameTooltipContent",children:kn(hh,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:gh.top,accessibilityType:mh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{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"}},Inner:{style:{backgroundColor:ph(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:kn("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const ic=hc("div",{target:"ekup9rd0"})(({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"}})),oc=150,wC=15e4,na=6;function yC({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:c,height:u}=Sh(xh),d=ne.useRef(null),f=ne.useRef(null),g=ne.useRef(null),m=iC(),{getRowThemeOverride:p,onItemHovered:b}=fC(m),{libConfig:{enforceDownloadInNewTab:y=!1}}=ne.useContext(bh),[w,S]=ne.useState(!0),[M,C]=ne.useState(!1),[x,R]=ne.useState(!1),[I,E]=ne.useState(!1),H=ne.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),z=ne.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ze(e.editingMode)&&(e.editingMode=Xn.EditingMode.READ_ONLY);const{READ_ONLY:L,DYNAMIC:F}=Xn.EditingMode,P=t.dimensions,Q=Math.max(0,P.dataRows),q=Q===0&&!(e.editingMode===F&&P.dataColumns>0),ae=Q>wC,de=ne.useRef(new Zo(Q)),[me,re]=ne.useState(de.current.getNumRows());ne.useEffect(()=>{de.current=new Zo(Q),re(de.current.getNumRows())},[Q]);const J=ne.useCallback(()=>{de.current=new Zo(Q),re(de.current.getNumRows())},[Q]),[le,ie]=ne.useState(e.columnOrder),{columns:pe,setColumnConfigMapping:ye}=eb(e,t,n,le);ne.useEffect(()=>{if(e.editingMode===L)return;const Se=i.getStringValue({id:e.id,formId:e.formId});Se&&(de.current.fromJson(Se,pe),re(de.current.getNumRows()))},[]);const{getCellContent:G}=dC(t,pe,me,de),{columns:O,sortColumn:k,getOriginalIndex:V,getCellContent:se}=ub(Q,pe,G),Pe=ne.useCallback(Se=>{const he={selection:{rows:[],columns:[]}};he.selection.rows=Se.rows.toArray().map(yt=>V(yt)),he.selection.columns=Se.columns.toArray().map(yt=>oo(O[yt]));const wt=JSON.stringify(he),_t=i.getStringValue({id:e.id,formId:e.formId});(_t===void 0||_t!==wt)&&i.setStringValue({id:e.id,formId:e.formId},wt,{fromUi:!0},o)},[O,e.id,e.formId,i,o,V]),{debouncedCallback:Ne}=ku(Pe,oc),{gridSelection:ve,isRowSelectionActivated:Be,isMultiRowSelectionActivated:xe,isColumnSelectionActivated:xt,isMultiColumnSelectionActivated:Tt,isRowSelected:Je,isColumnSelected:te,isCellSelected:rt,clearSelection:ue,processSelectionChange:oe}=hC(e,q,n,O,Ne);ne.useEffect(()=>{ue(!0,!0)},[a]);const ge=ne.useCallback(Se=>{var he;(he=f.current)==null||he.updateCells(Se)},[]);ne.useEffect(()=>{var he,wt,_t,yt;if(!Be&&!xt)return;const Se=i.getStringValue({id:e.id,formId:e.formId});if(Se){const Bt=O.map(_=>oo(_)),bn=JSON.parse(Se);let zn=vt.empty(),wn=vt.empty();(wt=(he=bn.selection)==null?void 0:he.rows)==null||wt.forEach(_=>{zn=zn.add(_)}),(yt=(_t=bn.selection)==null?void 0:_t.columns)==null||yt.forEach(_=>{wn=wn.add(Bt.indexOf(_))}),(zn.length>0||wn.length>0)&&oe({rows:zn,columns:wn,current:void 0})}},[]);const $e=ne.useCallback(()=>{me!==de.current.getNumRows()&&re(de.current.getNumRows())},[me]),ze=ne.useCallback(()=>{const Se=de.current.toJson(O);let he=i.getStringValue({id:e.id,formId:e.formId});he===void 0&&(he=new Zo(0).toJson([])),Se!==he&&i.setStringValue({id:e.id,formId:e.formId},Se,{fromUi:!0},o)},[O,e.id,e.formId,i,o]),{debouncedCallback:tt}=ku(ze,oc),{exportToCsv:fe}=cC(se,O,me,y),{onCellEdited:Ee,onPaste:st,onRowAppended:Le,onDelete:Ge,validateCell:pt}=oC(O,e.editingMode!==F,de,se,V,ge,$e,tt,ue),{tooltip:lt,clearTooltip:_e,onItemHovered:Dt}=vC(O,se),{drawCell:Xt,customRenderers:Ot}=rC(O),$t=ne.useMemo(()=>O.map(Se=>_s(Se)),[O]),{columns:Zt,onColumnResize:Ht}=rb($t),Mn=t.dimensions.headerRows>1,{minHeight:Nt,maxHeight:kt,minWidth:Dn,maxWidth:vn,rowHeight:Oe,resizableSize:Lt,setResizableSize:un}=gC(e,m,me,Mn,c,u,a),fn=ne.useCallback(([Se,he])=>({...w1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(O.length-1,0)]}),[O,m.glideTheme.textLight]),hn=ne.useCallback(()=>{J(),ue()},[J,ue]);yh({element:e,widgetMgr:i,onFormCleared:hn});const ot=!q&&e.editingMode===F&&!n,{pinColumn:Gt,unpinColumn:Ft,freezeColumns:Jt}=tb(O,q,c,m.minColumnWidth,ue,ye),{onColumnMoved:Pt}=nb(O,Jt,Gt,Ft,ie);return ne.useEffect(()=>{setTimeout(()=>{var Se,he;if(g.current&&f.current){const wt=(he=(Se=g.current)==null?void 0:Se.querySelector(".dvn-stack"))==null?void 0:he.getBoundingClientRect();wt&&(R(wt.height>g.current.clientHeight),E(wt.width>g.current.clientWidth))}},1)},[Lt,me,Zt]),Hl(ic,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:z,ref:g,onMouseDown:Se=>{if(g.current&&z){const he=g.current.getBoundingClientRect();I&&he.height-(na+1)<Se.clientY-he.top&&Se.stopPropagation(),x&&he.width-(na+1)<Se.clientX-he.left&&Se.stopPropagation()}},onBlur:Se=>{!w&&!H&&!Se.currentTarget.contains(Se.relatedTarget)&&ue(!0,!0)},children:[Hl(kh,{isFullScreen:a,disableFullscreenMode:r,locked:Je&&!Be||rt||H&&w,onExpand:s,onCollapse:l,target:ic,children:[(Be&&Je||xt&&te)&&kn(Wi,{label:"Clear selection",icon:Ih,onClick:()=>{ue(),_e()}}),ot&&Je&&kn(Wi,{label:"Delete row(s)",icon:_h,onClick:()=>{Ge&&(Ge(ve),_e())}}),ot&&!Je&&kn(Wi,{label:"Add row",icon:vc,onClick:()=>{Le&&(S(!0),Le(),_e())}}),!ae&&!q&&kn(Wi,{label:"Download as CSV",icon:Lh,onClick:()=>fe()}),!q&&kn(Wi,{label:"Search",icon:bc,onClick:()=>{M?C(!1):(S(!0),C(!0)),_e()}})]}),kn(wh,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Lt,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Nt,maxHeight:kt,minWidth:Dn,maxWidth:vn,size:Lt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Oe],snapGap:Oe/3,onResizeStop:(Se,he,wt,_t)=>{if(d.current){const yt=2*m.tableBorderWidth;un({width:d.current.size.width,height:kt-d.current.size.height===yt?d.current.size.height+yt:d.current.size.height})}},children:kn(g1,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:Zt,rows:q?1:me,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:Oe,headerHeight:m.defaultHeaderHeight,getCellContent:q?fn:se,onColumnResize:H?void 0:Ht,resizeIndicator:"header",freezeColumns:Jt,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:H?"cell":"rect",columnSelect:"none",rowSelect:"none",onColumnMoved:xt?void 0:Pt,onItemHovered:Se=>{b==null||b(Se),Dt==null||Dt(Se)},keybindings:{downFill:!0},onKeyDown:Se=>{(Se.ctrlKey||Se.metaKey)&&Se.key==="f"&&(C(he=>!he),Se.stopPropagation(),Se.preventDefault())},showSearch:M,onSearchClose:()=>{C(!1),_e()},onHeaderClicked:(Se,he)=>{q||ae||xt||(Be&&Je&&ue(),k(Se))},gridSelection:ve,onGridSelectionChange:Se=>{(w||H)&&(oe(Se),lt!==void 0&&_e())},theme:m.glideTheme,getRowThemeOverride:p,onMouseMove:Se=>{Se.kind==="out-of-bounds"&&w?S(!1):Se.kind!=="out-of-bounds"&&!w&&S(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...z&&{paddingBottom:I?-na:void 0,paddingRight:x?-na:void 0}},drawCell:Xt,customRenderers:Ot,imageEditorOverride:E1,headerIcons:m.headerIcons,validateCell:pt,onPaste:!1,...Be&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:xe?"multi":"auto",rowSelect:n?"none":xe?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...xt&&{columnSelect:n?"none":Tt?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!q&&e.editingMode!==L&&!n&&{fillHandle:!H,onCellEdited:Ee,onPaste:st,onDelete:Ge},...!q&&e.editingMode===F&&{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:Le,onHeaderClicked:void 0}})}),lt&<.content&&kn(bC,{top:lt.top,left:lt.left,content:lt.content,clearTooltip:_e})]})}const CC=Ch(yC),LC=Object.freeze(Object.defineProperty({__proto__:null,default:CC},Symbol.toStringTag,{value:"Module"}));export{W0 as C,Zc as T,bi as a,Yh as b,LC as c,pi as i,Zm as m,dn as s};
|