@stlite/desktop 0.78.1 → 0.79.0

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.
Files changed (69) hide show
  1. package/bin/dump_artifacts.js +17 -17
  2. package/build/assets/{FileDownload.esm-D2QqHv2c.js → FileDownload.esm-CUqgQU-j.js} +1 -1
  3. package/build/assets/{FormClearHelper-DliGOSkq.js → FormClearHelper-DmeZ2QuQ.js} +1 -1
  4. package/build/assets/{Hooks-Daeq69Zu.js → Hooks-CBIuRW4z.js} +1 -1
  5. package/build/assets/{InputInstructions-BQD8A2_u.js → InputInstructions-iKTPb-Lc.js} +1 -1
  6. package/build/assets/{ProgressBar-DuGylkeS.js → ProgressBar-Dfr9f8u1.js} +1 -1
  7. package/build/assets/{RenderInPortalIfExists-HKy5CC9C.js → RenderInPortalIfExists-CxeJAxCs.js} +1 -1
  8. package/build/assets/{Toolbar-B9grKd8p.js → Toolbar-CG7W1D-O.js} +1 -1
  9. package/build/assets/{base-input-DJ1o9wy-.js → base-input-DoV-1XUt.js} +1 -1
  10. package/build/assets/{createSuper-BCtrEkDw.js → createSuper-CvaFdVoD.js} +1 -1
  11. package/build/assets/{data-grid-overlay-editor-SiNLnLoA.js → data-grid-overlay-editor-CCUG7ReD.js} +1 -1
  12. package/build/assets/{downloader-y7WtJrbZ.js → downloader-B6rOwzu2.js} +1 -1
  13. package/build/assets/{es6-ChzZtMws.js → es6-CTcMcfqp.js} +2 -2
  14. package/build/assets/{getPrototypeOf-jxUzvEiF.js → getPrototypeOf-CFHg57KG.js} +1 -1
  15. package/build/assets/{iframeResizer.contentWindow-VeTSZzxi.js → iframeResizer.contentWindow-DLNn1A7T.js} +1 -1
  16. package/build/assets/{index-Di0b5deS.js → index-0aipcnh6.js} +1 -1
  17. package/build/assets/{index-NW5mgelH.js → index-6rnmC53g.js} +1 -1
  18. package/build/assets/{index-C-G07XIn.js → index-BHysWwrh.js} +1 -1
  19. package/build/assets/{index-lR3NBV82.js → index-BTHCcLIl.js} +1 -1
  20. package/build/assets/{index-B7GLWddS.js → index-BhkIHxDp.js} +1 -1
  21. package/build/assets/{index-JLaGWCy4.js → index-Bp04iQqW.js} +1 -1
  22. package/build/assets/{index-CSRB3KZi.js → index-BpeIvyJQ.js} +1 -1
  23. package/build/assets/{index-CFVMKjCp.js → index-BrRb8POj.js} +1 -1
  24. package/build/assets/{index-C9Os1Tio.js → index-ByOIN0Gm.js} +1 -1
  25. package/build/assets/{index-z2lXC7XI.js → index-BzTZZCvL.js} +4 -4
  26. package/build/assets/{index-Cxp-1GAt.js → index-C4j64dI5.js} +1 -1
  27. package/build/assets/{index-C5VxAqHf.js → index-CGhw9Sdf.js} +1 -1
  28. package/build/assets/{index-GTNwQsph.js → index-CIL1eIZN.js} +1 -1
  29. package/build/assets/{index-Dh5Ef2Om.js → index-CIs9EQe5.js} +1 -1
  30. package/build/assets/{index-CQ8B9Pyu.js → index-CSyyBx79.js} +1 -1
  31. package/build/assets/{index-DXHAdPWu.js → index-CW4i_Lge.js} +1 -1
  32. package/build/assets/{index-UrV00MOE.js → index-CWiqZgRl.js} +1 -1
  33. package/build/assets/{index-CxF9whAo.js → index-CoKgwXo8.js} +1 -1
  34. package/build/assets/{index-CvKkwQxq.js → index-Cua9_98i.js} +1 -1
  35. package/build/assets/{index-BYdd9282.js → index-D-lzdDJ5.js} +1 -1
  36. package/build/assets/{index-j3NobT-r.js → index-D9QNa8Xs.js} +1 -1
  37. package/build/assets/{index-Bia2Aiul.js → index-DHFNQm8n.js} +1 -1
  38. package/build/assets/{index-CnPYErGb.js → index-DURajqPC.js} +1 -1
  39. package/build/assets/{index-DYrQR0Ux.js → index-Df9nIm6O.js} +1 -1
  40. package/build/assets/{index-Dkd6yjmr.js → index-DjQcVgxO.js} +1 -1
  41. package/build/assets/{index-Bsw1C-zM.js → index-DqxtC9MD.js} +1 -1
  42. package/build/assets/{index-CGRaMNW7.js → index-DtrE1h0V.js} +1 -1
  43. package/build/assets/{index-ByZKQf5p.js → index-Dwt05210.js} +1 -1
  44. package/build/assets/{index-Do74AQgb.js → index-N6IvabtE.js} +1 -1
  45. package/build/assets/{index-BqYxHJ94.js → index-OR2HlVVN.js} +1 -1
  46. package/build/assets/{index-B2k4Ofkz.js → index-P_LN9wWJ.js} +1 -1
  47. package/build/assets/{index-Bh9EjD0o.js → index-RhMZ16-Y.js} +1 -1
  48. package/build/assets/{index-C_q5O89K.js → index-fudEipDa.js} +1 -1
  49. package/build/assets/{index-CS3mWYPw.js → index-hsTwnoRn.js} +1 -1
  50. package/build/assets/{index-BCDKFsnk.js → index-qMuFpOqI.js} +1 -1
  51. package/build/assets/{index-DMBd-bc-.js → index-steA8SlM.js} +5 -5
  52. package/build/assets/{index-CpzAXWaZ.js → index-xGO_nKX1.js} +1 -1
  53. package/build/assets/{input-Dhep7xP0.js → input-BrXgmYe9.js} +1 -1
  54. package/build/assets/{memory-BqTZFgXm.js → memory-Bf74T19z.js} +1 -1
  55. package/build/assets/{number-overlay-editor-BywJqzaW.js → number-overlay-editor-20er5Sp-.js} +1 -1
  56. package/build/assets/{sandbox-DmnKum9A.js → sandbox-CV8SMiuv.js} +1 -1
  57. package/build/assets/{slicedToArray-DkF8JK54.js → slicedToArray-tqzlNjPF.js} +1 -1
  58. package/build/assets/{textarea-CCmBHfjM.js → textarea-DMefjquC.js} +1 -1
  59. package/build/assets/{timepicker-DWOLsPBU.js → timepicker-D5Qmkk9Q.js} +1 -1
  60. package/build/assets/{uniqueId-C3qA3EXY.js → uniqueId-IQr2jcrE.js} +1 -1
  61. package/build/assets/{useBasicWidgetState-CDQNZkN8.js → useBasicWidgetState-Cqy4gnzY.js} +1 -1
  62. package/build/assets/{useOnInputChange-FEZNS9DP.js → useOnInputChange-BD_aeagL.js} +1 -1
  63. package/build/assets/{withFullScreenWrapper-dTVQmtO5.js → withFullScreenWrapper-DIS3bwns.js} +1 -1
  64. package/build/assets/worker-B1MO5Shr.js +216 -0
  65. package/build/electron/worker.js +109 -10
  66. package/build/index.html +1 -1
  67. package/package.json +4 -4
  68. package/wheels/streamlit-1.41.0-cp312-none-any.whl +0 -0
  69. package/build/assets/worker-CLbVOjel.js +0 -117
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-SiNLnLoA.js","assets/index-z2lXC7XI.js","assets/index.O26j_t8G.css","assets/FormClearHelper-DliGOSkq.js","assets/withFullScreenWrapper-dTVQmtO5.js","assets/Toolbar-B9grKd8p.js","assets/sprintf-C-r3gIuM.js","assets/createDownloadLinkElement-DZMwyjvU.js","assets/slicedToArray-DkF8JK54.js","assets/getPrototypeOf-jxUzvEiF.js","assets/createSuper-BCtrEkDw.js","assets/FileDownload.esm-D2QqHv2c.js","assets/number-overlay-editor-BywJqzaW.js","assets/es6-ChzZtMws.js"])))=>i.map(i=>d[i]);
2
- var Zw=Object.defineProperty;var Jw=(Rr,nr,Ur)=>nr in Rr?Zw(Rr,nr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Rr[nr]=Ur;var dt=(Rr,nr,Ur)=>Jw(Rr,typeof nr!="symbol"?nr+"":nr,Ur);import{r as h,E as Nd,_ as Ze,g as mi,d as Qw,R as oe,i as ls,p as ey,e as ss,f as ty,h as ny,l as $d,t as Bd,m as ry,n as Wd,o as oy,q as iy,s as ay,v as ly,w as sy,a as pr,x as cs,y as jd,z as cy,A as uy,B as Xe,C as Ud,D as Yd,F as wt,G as kr,H as dy,I as Gd,J as uo,j as pn,c as Xd,K as Kd,L as hy,M as us,N as Un,O as qd,Q as ds,S as Br,T as Zd,U as vi,V as Sr,k as fy,W as py,X as $e,Y as Jd,b as gy,Z as hs,$ as fs,a0 as my,a1 as vy,a2 as by,a3 as wy,a4 as yy,a5 as xy,a6 as Cy,a7 as Qd,a8 as ky,__tla as Sy}from"./index-z2lXC7XI.js";import{u as My}from"./FormClearHelper-DliGOSkq.js";import{w as Ry,u as Ey,E as Iy}from"./withFullScreenWrapper-dTVQmtO5.js";import{T as Ty,a as bi}from"./Toolbar-B9grKd8p.js";import{s as Oy}from"./sprintf-C-r3gIuM.js";import{c as Dy}from"./createDownloadLinkElement-DZMwyjvU.js";import{_ as Mr,C as Hy}from"./slicedToArray-DkF8JK54.js";import{_ as Py,a as zy,b as Fy}from"./getPrototypeOf-jxUzvEiF.js";import{_ as Ly}from"./createSuper-BCtrEkDw.js";import{D as Ay,F as Vy}from"./FileDownload.esm-D2QqHv2c.js";let ps,Fa,Wr,gs,eh,jr,ms,un,_y=Promise.all([(()=>{try{return Sy}catch{}})()]).then(async()=>{var Rr=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Nd,Ze({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"}))});Rr.displayName="Add";var nr=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Nd,Ze({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"}))});nr.displayName="Search";function Ur(e="This should not happen"){throw new Error(e)}function Tn(e,t="Assertion failed"){if(!e)return Ur(t)}function Ho(e,t){return Ur(t??"Hell froze over")}function th(e,t){try{return e()}catch{return t}}const vs=Object.prototype.hasOwnProperty;function ho(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ho(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(vs.call(e,n)&&++r&&!vs.call(t,n)||!(n in t)||!ho(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var nh=Object.prototype,rh=nh.hasOwnProperty;function oh(e,t){return e!=null&&rh.call(e,t)}var ih=oh,ah=ih,lh=Qw;function sh(e,t){return e!=null&&lh(e,t,ah)}var ch=sh;const uh=mi(ch),wi=null,La=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 bs;(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"})(bs||(bs={}));var yi;(function(e){e.Triangle="triangle",e.Dots="dots"})(yi||(yi={}));function xi(e){return"width"in e&&typeof e.width=="number"}async function ws(e){return typeof e=="object"?e:await e()}jr=function(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)},Wr=function(e){return e.kind===Ln.Marker||e.kind===Ln.NewRow};function Po(e){if(!jr(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;Ho(e,"A cell was passed with an invalid kind")}gs=function(e){return uh(e,"editor")};function Aa(e){return!(e.readonly??!1)}var Ln;(function(e){e.NewRow="new-row",e.Marker="marker"})(Ln||(Ln={}));function dh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let ys;const br=class br{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new br(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=dh([...this.items,n]);return new br(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new br(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};dt(br,"empty",()=>ys??(ys=new br([]))),dt(br,"fromSingleSelection",t=>br.empty().add(t));let vt=br;var hh=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},xs=hh,fh=e=>e.toUpperCase()===e,ph=e=>t=>e.indexOf(t)===-1,Cs=(e,t)=>{const n={};return Object.keys(e).filter(ph(t)).forEach(r=>{n[r]=e[r]}),n};function gh(e,t,n){const r=Cs(t,n);if(!e){const o=typeof ls=="function"?{default:ls}:ls;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var mh=(e,t)=>{};function vh(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!fh(l[0])):n.propsAsIs,u=gh(c,i,["as","class"]);u.ref=a,u.className=n.atomic?xs(n.class,u.className||s):xs(u.className||s,n.class);const{vars:d}=n;if(d){const f={};for(const m in d){const b=d[m],y=b[0],w=b[1]||"",k=typeof y=="function"?y(i):y;mh(k,n.name),f[`--${m}`]=`${k}${w}`}const p=u.style||{},g=Object.keys(p);g.length>0&&g.forEach(m=>{f[m]=p[m]}),u.style=f}return e.__linaria&&e!==l?(u.as=l,oe.createElement(e,u)):oe.createElement(l,u)},o=oe.forwardRef?oe.forwardRef(r):i=>{const a=Cs(i,["innerRef"]);return r(a,i.innerRef)};return o.displayName=n.name,o.__linaria={className:n.class||t,extends:e},o}}un=vh;const bh=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ks={},Ci={},Va={},Ss={},Ms;function wh(){return Ms||(Ms=1,function(e){(function(t,n){n(e,h,ey)})(ss,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=g;var o=a(n),i=a(r);function a(w){return w&&w.__esModule?w:{default:w}}var l=Object.assign||function(w){for(var k=1;k<arguments.length;k++){var S=arguments[k];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(w[C]=S[C])}return w};function s(w,k){var S={};for(var C in w)k.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(S[C]=w[C]);return S}function c(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(k,S){for(var C=0;C<S.length;C++){var x=S[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}return function(k,S,C){return S&&w(k.prototype,S),C&&w(k,C),k}}();function d(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:w}function f(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}var p=!1;function g(w){p=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){g(!0)}}))}catch{}function m(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return p?w:w.capture}function b(w){if("touches"in w){var k=w.touches[0],S=k.pageX,C=k.pageY;return{x:S,y:C}}var x=w.screenX,M=w.screenY;return{x,y:M}}var y=function(w){f(k,w);function k(){var S;c(this,k);for(var C=arguments.length,x=Array(C),M=0;M<C;M++)x[M]=arguments[M];var O=d(this,(S=k.__proto__||Object.getPrototypeOf(k)).call.apply(S,[this].concat(x)));return O._handleSwipeStart=O._handleSwipeStart.bind(O),O._handleSwipeMove=O._handleSwipeMove.bind(O),O._handleSwipeEnd=O._handleSwipeEnd.bind(O),O._onMouseDown=O._onMouseDown.bind(O),O._onMouseMove=O._onMouseMove.bind(O),O._onMouseUp=O._onMouseUp.bind(O),O._setSwiperRef=O._setSwiperRef.bind(O),O}return u(k,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var C=b(S),x=C.x,M=C.y;this.moveStart={x,y:M},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var C=b(S),x=C.x,M=C.y,O=x-this.moveStart.x,E=M-this.moveStart.y;this.moving=!0;var H=this.props.onSwipeMove({x:O,y:E},S);H&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:O,deltaY:E}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var C=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-C?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>C&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-C?this.props.onSwipeUp(1,S):this.movePosition.deltaY>C&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var C=S.className,x=S.style,M=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var O=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:C,style:x},O),M)}}]),k}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(Ss)),Ss}(function(e){(function(t,n){n(e,wh())})(ss,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(Va);var zo={};Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var Er=yh(ty);function yh(e){return e&&e.__esModule?e:{default:e}}function xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ch={ROOT:function(e){return(0,Er.default)(xh({"carousel-root":!0},e||"",!!e))},CAROUSEL:function(e){return(0,Er.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,t){return(0,Er.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":t==="horizontal","axis-vertical":t!=="horizontal"})},SLIDER:function(e,t){return(0,Er.default)({thumbs:!e,slider:e,animated:!t})},ITEM:function(e,t,n){return(0,Er.default)({thumb:!e,slide:e,selected:t,previous:n})},ARROW_PREV:function(e){return(0,Er.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,Er.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,Er.default)({dot:!0,selected:e})}};zo.default=Ch;var Fo={},ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.outerWidth=void 0;var kh=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t};ki.outerWidth=kh;var fo={};Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0;var Sh=function(e,t,n){var r=e===0?e:e+t,o=n==="horizontal"?[r,0,0]:[0,r,0],i="translate3d",a="("+o.join(",")+")";return i+a};fo.default=Sh;var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=void 0;var Mh=function(){return window};Lo.default=Mh,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=void 0;var Yn=Ih(h),Yr=Mi(zo),Rh=ki,Rs=Mi(fo),Eh=Mi(Va),Si=Mi(Lo);function Mi(e){return e&&e.__esModule?e:{default:e}}function Es(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Es=function(){return e},e}function Ih(e){if(e&&e.__esModule)return e;if(e===null||Ao(e)!=="object"&&typeof e!="function")return{default:e};var t=Es();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function Ao(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ao=function(t){return typeof t}:Ao=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(e)}function _a(){return _a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_a.apply(this,arguments)}function Th(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dh(e,t,n){return Oh(e.prototype,t),e}function Hh(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&&Na(e,t)}function Na(e,t){return Na=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Na(e,t)}function Ph(e){var t=Fh();return function(){var n=Ri(e),r;if(t){var o=Ri(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zh(this,r)}}function zh(e,t){return t&&(Ao(t)==="object"||typeof t=="function")?t:bn(e)}function bn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fh(){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 Ri(e){return Ri=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ri(e)}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lh=function(e){return e.hasOwnProperty("key")},$a=function(e){Hh(n,e);var t=Ph(n);function n(r){var o;return Th(this,n),o=t.call(this,r),gn(bn(o),"itemsWrapperRef",void 0),gn(bn(o),"itemsListRef",void 0),gn(bn(o),"thumbsRef",void 0),gn(bn(o),"setItemsWrapperRef",function(i){o.itemsWrapperRef=i}),gn(bn(o),"setItemsListRef",function(i){o.itemsListRef=i}),gn(bn(o),"setThumbsRef",function(i,a){o.thumbsRef||(o.thumbsRef=[]),o.thumbsRef[a]=i}),gn(bn(o),"updateSizes",function(){if(!(!o.props.children||!o.itemsWrapperRef||!o.thumbsRef)){var i=Yn.Children.count(o.props.children),a=o.itemsWrapperRef.clientWidth,l=o.props.thumbWidth?o.props.thumbWidth:(0,Rh.outerWidth)(o.thumbsRef[0]),s=Math.floor(a/l),c=s<i,u=c?i-s:0;o.setState(function(d,f){return{itemSize:l,visibleItems:s,firstItem:c?o.getFirstItem(f.selectedItem):0,lastPosition:u,showArrows:c}})}}),gn(bn(o),"handleClickItem",function(i,a,l){if(!Lh(l)||l.key==="Enter"){var s=o.props.onSelectItem;typeof s=="function"&&s(i,a)}}),gn(bn(o),"onSwipeStart",function(){o.setState({swiping:!0})}),gn(bn(o),"onSwipeEnd",function(){o.setState({swiping:!1})}),gn(bn(o),"onSwipeMove",function(i){var a=i.x;if(!o.state.itemSize||!o.itemsWrapperRef||!o.state.visibleItems)return!1;var l=0,s=Yn.Children.count(o.props.children),c=-(o.state.firstItem*100)/o.state.visibleItems,u=Math.max(s-o.state.visibleItems,0),d=-u*100/o.state.visibleItems;c===l&&a>0&&(a=0),c===d&&a<0&&(a=0);var f=o.itemsWrapperRef.clientWidth,p=c+100/(f/a);return o.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){o.itemsListRef.style[g]=(0,Rs.default)(p,"%",o.props.axis)}),!0}),gn(bn(o),"slideRight",function(i){o.moveTo(o.state.firstItem-(typeof i=="number"?i:1))}),gn(bn(o),"slideLeft",function(i){o.moveTo(o.state.firstItem+(typeof i=="number"?i:1))}),gn(bn(o),"moveTo",function(i){i=i<0?0:i,i=i>=o.state.lastPosition?o.state.lastPosition:i,o.setState({firstItem:i})}),o.state={selectedItem:r.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},o}return Dh(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,Si.default)().addEventListener("resize",this.updateSizes),(0,Si.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Si.default)().removeEventListener("resize",this.updateSizes),(0,Si.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,i){var a=Yr.default.ITEM(!1,i===r.state.selectedItem),l={key:i,ref:function(s){return r.setThumbsRef(s,i)},className:a,onClick:r.handleClickItem.bind(r,i,r.props.children[i]),onKeyDown:r.handleClickItem.bind(r,i,r.props.children[i]),"aria-label":"".concat(r.props.labels.item," ").concat(i+1),style:{width:r.props.thumbWidth}};return Yn.default.createElement("li",_a({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=Yn.Children.count(this.props.children)>1,i=this.state.showArrows&&this.state.firstItem>0,a=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},s=-this.state.firstItem*(this.state.itemSize||0),c=(0,Rs.default)(s,"px",this.props.axis),u=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:u,MozTransitionDuration:u,MsTransitionDuration:u,OTransitionDuration:u,transitionDuration:u,msTransitionDuration:u},Yn.default.createElement("div",{className:Yr.default.CAROUSEL(!1)},Yn.default.createElement("div",{className:Yr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},Yn.default.createElement("button",{type:"button",className:Yr.default.ARROW_PREV(!i),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?Yn.default.createElement(Eh.default,{tagName:"ul",className:Yr.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()):Yn.default.createElement("ul",{className:Yr.default.SLIDER(!1,this.state.swiping),ref:function(d){return r.setItemsListRef(d)},style:l},this.renderItems()),Yn.default.createElement("button",{type:"button",className:Yr.default.ARROW_NEXT(!a),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(Yn.Component);Fo.default=$a,gn($a,"displayName","Thumbs"),gn($a,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.default=void 0;var Ah=function(){return document};Ei.default=Ah;var On={};Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var Vh=h,_h=Nh(fo);function Nh(e){return e.__esModule?e:{default:e}}var $h=function(){};On.noop=$h;var Bh=function(e,t){return"".concat(e," of ").concat(t)};On.defaultStatusFormatter=Bh;var Wh=function(e){return e?e.hasOwnProperty("key"):!1};On.isKeyboardEvent=Wh;var jh=function(e,t){if(t.infiniteLoop&&++e,e===0)return 0;var n=Vh.Children.count(t.children);if(t.centerMode&&t.axis==="horizontal"){var r=-e*t.centerSlidePercentage,o=n-1;return e&&(e!==o||t.infiniteLoop)?r+=(100-t.centerSlidePercentage)/2:e===o&&(r+=100-t.centerSlidePercentage),r}return-e*100};On.getPosition=jh;var Uh=function(e,t){var n={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){n[r]=(0,_h.default)(e,"%",t)}),n};On.setPosition=Uh;var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.fadeAnimationHandler=rr.slideStopSwipingHandler=rr.slideSwipeAnimationHandler=rr.slideAnimationHandler=void 0;var Is=h,Yh=Gh(fo),or=On;function Gh(e){return e.__esModule?e:{default:e}}function Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ts(Object(n),!0).forEach(function(r){Xh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kh=function(e,t){var n={},r=t.selectedItem,o=r,i=Is.Children.count(e.children)-1,a=e.infiniteLoop&&(r<0||r>i);if(a)return o<0?e.centerMode&&e.centerSlidePercentage&&e.axis==="horizontal"?n.itemListStyle=(0,or.setPosition)(-(i+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):n.itemListStyle=(0,or.setPosition)(-(i+2)*100,e.axis):o>i&&(n.itemListStyle=(0,or.setPosition)(0,e.axis)),n;var l=(0,or.getPosition)(r,e),s=(0,Yh.default)(l,"%",e.axis),c=e.transitionTime+"ms";return n.itemListStyle={WebkitTransform:s,msTransform:s,OTransform:s,transform:s},t.swiping||(n.itemListStyle=Gr(Gr({},n.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),n};rr.slideAnimationHandler=Kh;var qh=function(e,t,n,r){var o={},i=t.axis==="horizontal",a=Is.Children.count(t.children),l=0,s=(0,or.getPosition)(n.selectedItem,t),c=t.infiniteLoop?(0,or.getPosition)(a-1,t)-100:(0,or.getPosition)(a-1,t),u=i?e.x:e.y,d=u;s===l&&u>0&&(d=0),s===c&&u<0&&(d=0);var f=s+100/(n.itemSize/d),p=Math.abs(u)>t.swipeScrollTolerance;return t.infiniteLoop&&p&&(n.selectedItem===0&&f>-100?f-=a*100:n.selectedItem===a-1&&f<-a*100&&(f+=a*100)),(!t.preventMovementUntilSwipeScrollTolerance||p||n.swipeMovementStarted)&&(n.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,or.setPosition)(f,t.axis)),p&&!n.cancelClick&&r({cancelClick:!0}),o};rr.slideSwipeAnimationHandler=qh;var Zh=function(e,t){var n=(0,or.getPosition)(t.selectedItem,e),r=(0,or.setPosition)(n,e.axis);return{itemListStyle:r}};rr.slideStopSwipingHandler=Zh;var Jh=function(e,t){var n=e.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 t.swiping||(o=Gr(Gr({},o),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:o,selectedStyle:Gr(Gr({},o),{},{opacity:1,position:"relative"}),prevStyle:Gr({},o)}};rr.fadeAnimationHandler=Jh,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.default=void 0;var zt=tf(h),Qh=_o(Va),gr=_o(zo),ef=_o(Fo),Ii=_o(Ei),Ti=_o(Lo),Vo=On,Oi=rr;function _o(e){return e&&e.__esModule?e:{default:e}}function Os(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Os=function(){return e},e}function tf(e){if(e&&e.__esModule)return e;if(e===null||No(e)!=="object"&&typeof e!="function")return{default:e};var t=Os();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function No(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?No=function(t){return typeof t}:No=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function Ba(){return Ba=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ba.apply(this,arguments)}function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ds(Object(n),!0).forEach(function(r){ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function of(e,t,n){return rf(e.prototype,t),e}function af(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&&Wa(e,t)}function Wa(e,t){return Wa=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Wa(e,t)}function lf(e){var t=cf();return function(){var n=Di(e),r;if(t){var o=Di(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sf(this,r)}}function sf(e,t){return t&&(No(t)==="object"||typeof t=="function")?t:pt(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cf(){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 Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Di(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 ja=function(e){af(n,e);var t=lf(n);function n(r){var o;nf(this,n),o=t.call(this,r),ht(pt(o),"thumbsRef",void 0),ht(pt(o),"carouselWrapperRef",void 0),ht(pt(o),"listRef",void 0),ht(pt(o),"itemsRef",void 0),ht(pt(o),"timer",void 0),ht(pt(o),"animationHandler",void 0),ht(pt(o),"setThumbsRef",function(a){o.thumbsRef=a}),ht(pt(o),"setCarouselWrapperRef",function(a){o.carouselWrapperRef=a}),ht(pt(o),"setListRef",function(a){o.listRef=a}),ht(pt(o),"setItemsRef",function(a,l){o.itemsRef||(o.itemsRef=[]),o.itemsRef[l]=a}),ht(pt(o),"autoPlay",function(){zt.Children.count(o.props.children)<=1||(o.clearAutoPlay(),o.props.autoPlay&&(o.timer=setTimeout(function(){o.increment()},o.props.interval)))}),ht(pt(o),"clearAutoPlay",function(){o.timer&&clearTimeout(o.timer)}),ht(pt(o),"resetAutoPlay",function(){o.clearAutoPlay(),o.autoPlay()}),ht(pt(o),"stopOnHover",function(){o.setState({isMouseEntered:!0},o.clearAutoPlay)}),ht(pt(o),"startOnLeave",function(){o.setState({isMouseEntered:!1},o.autoPlay)}),ht(pt(o),"isFocusWithinTheCarousel",function(){return o.carouselWrapperRef?!!((0,Ii.default)().activeElement===o.carouselWrapperRef||o.carouselWrapperRef.contains((0,Ii.default)().activeElement)):!1}),ht(pt(o),"navigateWithKeyboard",function(a){if(o.isFocusWithinTheCarousel()){var l=o.props.axis,s=l==="horizontal",c={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},u=s?c.ArrowRight:c.ArrowDown,d=s?c.ArrowLeft:c.ArrowUp;u===a.keyCode?o.increment():d===a.keyCode&&o.decrement()}}),ht(pt(o),"updateSizes",function(){if(!(!o.state.initialized||!o.itemsRef||o.itemsRef.length===0)){var a=o.props.axis==="horizontal",l=o.itemsRef[0];if(l){var s=a?l.clientWidth:l.clientHeight;o.setState({itemSize:s}),o.thumbsRef&&o.thumbsRef.updateSizes()}}}),ht(pt(o),"setMountState",function(){o.setState({hasMount:!0}),o.updateSizes()}),ht(pt(o),"handleClickItem",function(a,l){if(zt.Children.count(o.props.children)!==0){if(o.state.cancelClick){o.setState({cancelClick:!1});return}o.props.onClickItem(a,l),a!==o.state.selectedItem&&o.setState({selectedItem:a})}}),ht(pt(o),"handleOnChange",function(a,l){zt.Children.count(o.props.children)<=1||o.props.onChange(a,l)}),ht(pt(o),"handleClickThumb",function(a,l){o.props.onClickThumb(a,l),o.moveTo(a)}),ht(pt(o),"onSwipeStart",function(a){o.setState({swiping:!0}),o.props.onSwipeStart(a)}),ht(pt(o),"onSwipeEnd",function(a){o.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),o.props.onSwipeEnd(a),o.clearAutoPlay(),o.state.autoPlay&&o.autoPlay()}),ht(pt(o),"onSwipeMove",function(a,l){o.props.onSwipeMove(l);var s=o.props.swipeAnimationHandler(a,o.props,o.state,o.setState.bind(pt(o)));return o.setState(Gn({},s)),!!Object.keys(s).length}),ht(pt(o),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;o.moveTo(o.state.selectedItem-(typeof a=="number"?a:1))}),ht(pt(o),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;o.moveTo(o.state.selectedItem+(typeof a=="number"?a:1))}),ht(pt(o),"moveTo",function(a){if(typeof a=="number"){var l=zt.Children.count(o.props.children)-1;a<0&&(a=o.props.infiniteLoop?l:0),a>l&&(a=o.props.infiniteLoop?0:l),o.selectItem({selectedItem:a}),o.state.autoPlay&&o.state.isMouseEntered===!1&&o.resetAutoPlay()}}),ht(pt(o),"onClickNext",function(){o.increment(1)}),ht(pt(o),"onClickPrev",function(){o.decrement(1)}),ht(pt(o),"onSwipeForward",function(){o.increment(1),o.props.emulateTouch&&o.setState({cancelClick:!0})}),ht(pt(o),"onSwipeBackwards",function(){o.decrement(1),o.props.emulateTouch&&o.setState({cancelClick:!0})}),ht(pt(o),"changeItem",function(a){return function(l){(!(0,Vo.isKeyboardEvent)(l)||l.key==="Enter")&&o.moveTo(a)}}),ht(pt(o),"selectItem",function(a){o.setState(Gn({previousItem:o.state.selectedItem},a),function(){o.setState(o.animationHandler(o.props,o.state))}),o.handleOnChange(a.selectedItem,zt.Children.toArray(o.props.children)[a.selectedItem])}),ht(pt(o),"getInitialImage",function(){var a=o.props.selectedItem,l=o.itemsRef&&o.itemsRef[a],s=l&&l.getElementsByTagName("img")||[];return s[0]}),ht(pt(o),"getVariableItemHeight",function(a){var l=o.itemsRef&&o.itemsRef[a];if(o.state.hasMount&&l&&l.children.length){var s=l.children[0].getElementsByTagName("img")||[];if(s.length>0){var c=s[0];if(!c.complete){var u=function p(){o.forceUpdate(),c.removeEventListener("load",p)};c.addEventListener("load",u)}}var d=s[0]||l.children[0],f=d.clientHeight;return f>0?f:null}return null});var i={initialized:!1,previousItem:r.selectedItem,selectedItem:r.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:r.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return o.animationHandler=typeof r.animationHandler=="function"&&r.animationHandler||r.animationHandler==="fade"&&Oi.fadeAnimationHandler||Oi.slideAnimationHandler,o.state=Gn(Gn({},i),o.animationHandler(r,i)),o}return of(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(Gn({},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&&zt.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,Ti.default)().addEventListener("resize",this.updateSizes),(0,Ti.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Ii.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Ti.default)().removeEventListener("resize",this.updateSizes),(0,Ti.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Ii.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?zt.Children.map(this.props.children,function(i,a){var l=a===o.state.selectedItem,s=a===o.state.previousItem,c=l&&o.state.selectedStyle||s&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=Gn(Gn({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=Gn(Gn({},c),{},{pointerEvents:"none"}));var u={ref:function(d){return o.setItemsRef(d,a)},key:"itemKey"+a+(r?"clone":""),className:gr.default.ITEM(!0,a===o.state.selectedItem,a===o.state.previousItem),onClick:o.handleClickItem.bind(o,a,i),style:c};return zt.default.createElement("li",u,o.props.renderItem(i,{isSelected:a===o.state.selectedItem,isPrevious:a===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,i=o.showIndicators,a=o.labels,l=o.renderIndicator,s=o.children;return i?zt.default.createElement("ul",{className:"control-dots"},zt.Children.map(s,function(c,u){return l&&l(r.changeItem(u),u===r.state.selectedItem,u,a.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?zt.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,zt.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||zt.Children.count(this.props.children)===0?null:zt.default.createElement(ef.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||zt.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&zt.Children.count(this.props.children)>1,i=this.props.axis==="horizontal",a=this.props.showArrows&&zt.Children.count(this.props.children)>1,l=a&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,s=a&&(this.state.selectedItem<zt.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),u=c.shift(),d=c.pop(),f={className:gr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},p={};if(i){if(f.onSwipeLeft=this.onSwipeForward,f.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var g=this.getVariableItemHeight(this.state.selectedItem);p.height=g||"auto"}}else f.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,f.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,f.style=Gn(Gn({},f.style),{},{height:this.state.itemSize}),p.height=this.state.itemSize;return zt.default.createElement("div",{"aria-label":this.props.ariaLabel,className:gr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},zt.default.createElement("div",{className:gr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),zt.default.createElement("div",{className:gr.default.WRAPPER(!0,this.props.axis),style:p},o?zt.default.createElement(Qh.default,Ba({tagName:"ul",innerRef:this.setListRef},f,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u):zt.default.createElement("ul",{className:gr.default.SLIDER(!0,this.state.swiping),ref:function(m){return r.setListRef(m)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u)),this.props.renderArrowNext(this.onClickNext,s,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(zt.default.Component);Ci.default=ja,ht(ja,"displayName","Carousel"),ht(ja,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Vo.noop,onClickThumb:Vo.noop,onChange:Vo.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(e,t,n){return zt.default.createElement("button",{type:"button","aria-label":n,className:gr.default.ARROW_PREV(!t),onClick:e})},renderArrowNext:function(e,t,n){return zt.default.createElement("button",{type:"button","aria-label":n,className:gr.default.ARROW_NEXT(!t),onClick:e})},renderIndicator:function(e,t,n,r){return zt.default.createElement("li",{className:gr.default.DOT(t),onClick:e,onKeyDown:e,value:n,key:n,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(n+1)})},renderItem:function(e){return e},renderThumbs:function(e){var t=zt.Children.map(e,function(n){var r=n;if(n.type!=="img"&&(r=zt.Children.toArray(n.props.children).find(function(o){return o.type==="img"})),!!r)return r});return t.filter(function(n){return n}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):t},statusFormatter:Vo.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:Oi.slideSwipeAnimationHandler,stopSwipingHandler:Oi.slideStopSwipingHandler});var uf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(Ci),n=uf,r=o(Fo);function o(i){return i&&i.__esModule?i:{default:i}}})(ks);var df=ny,hf=function(){return df.Date.now()},ff=hf,pf=$d,Ua=ff,Hs=Bd,gf="Expected a function",mf=Math.max,vf=Math.min;function bf(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(gf);t=Hs(t)||0,pf(n)&&(u=!!n.leading,d="maxWait"in n,i=d?mf(Hs(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function p(x){var M=r,O=o;return r=o=void 0,c=x,a=e.apply(O,M),a}function g(x){return c=x,l=setTimeout(y,t),u?p(x):a}function m(x){var M=x-s,O=x-c,E=t-M;return d?vf(E,i-O):E}function b(x){var M=x-s,O=x-c;return s===void 0||M>=t||M<0||d&&O>=i}function y(){var x=Ua();if(b(x))return w(x);l=setTimeout(y,m(x))}function w(x){return l=void 0,f&&r?p(x):(r=o=void 0,a)}function k(){l!==void 0&&clearTimeout(l),c=0,r=s=o=l=void 0}function S(){return l===void 0?a:w(Ua())}function C(){var x=Ua(),M=b(x);if(r=arguments,o=this,s=x,M){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(y,t),p(s)}return l===void 0&&(l=setTimeout(y,t)),a}return C.cancel=k,C.flush=S,C}var Ps=bf;const zs=mi(Ps);function hn(e,t,n,r,o=!1){const i=h.useRef();i.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var c;(c=i.current)==null||c.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Xr(e,t){return e===void 0?void 0:t}const wf=Math.PI;function Fs(e){return e*wf/180}const Ls=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),As=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Vs=(e,t,n)=>Math.min(e,t-n*2),_s=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ya=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"}))},yf=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 xf(e,t,n){const[r,o]=h.useState(e),i=h.useRef(!0);h.useEffect(()=>()=>{i.current=!1},[]);const a=h.useRef(zs(l=>{i.current&&o(l)},n));return h.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const Cf="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",kf="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Sf=new RegExp("^[^"+kf+"]*["+Cf+"]");function Ga(e){return Sf.test(e)?"rtl":"not-rtl"}let Hi;function Xa(){if(typeof document>"u")return 0;if(Hi!==void 0)return Hi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Hi=n-r,Hi}const Kr=Symbol();function Mf(e){const t=h.useRef([Kr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=h.useState(e),[,o]=h.useState(),i=h.useCallback(l=>{const s=t.current[0];s!==Kr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Kr&&o({}),r(c=>typeof l=="function"?l(s===Kr?c:s):l),t.current[0]=Kr)},[]),a=h.useCallback(()=>{t.current[0]=Kr,o({})},[]);return[t.current[0]===Kr?n:t.current[0],i,a]}function Ns(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Rf(e){const t=h.useRef(e);return ho(e,t.current)||(t.current=e),t.current}const Ef=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return h.createElement(bh,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(ks.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=(o==null?void 0:o(l))??h.createElement("img",{draggable:!1,src:l});return h.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&h.createElement("button",{className:"gdg-edit-icon",onClick:r},h.createElement(Ya,null)))};function $s(){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 qr=$s();function If(e){qr=e}const Bs=/[&<>"']/,Tf=new RegExp(Bs.source,"g"),Ws=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Of=new RegExp(Ws.source,"g"),Df={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},js=e=>Df[e];function mn(e,t){if(t){if(Bs.test(e))return e.replace(Tf,js)}else if(Ws.test(e))return e.replace(Of,js);return e}const Hf=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Us(e){return e.replace(Hf,(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 Pf=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(Pf,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const zf=/[^\w:]/g,Ff=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ys(e,t,n){if(e){let r;try{r=decodeURIComponent(Us(n)).replace(zf,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ff.test(n)&&(n=_f(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Pi={},Lf=/^[^:]+:\/*[^/]*$/,Af=/^([^:]+:)[\s\S]*$/,Vf=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _f(e,t){Pi[" "+e]||(Lf.test(e)?Pi[" "+e]=e+"/":Pi[" "+e]=Fi(e,"/",!0)),e=Pi[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Af,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Vf,"$1")+t:e+t}const zi={exec:function(){}};function Gs(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Fi(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function Nf(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function $f(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 Xs(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Ks(e,t,n,r){const o=t.href,i=t.title?mn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:mn(a)}}function Bf(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/data-grid-overlay-editor-CCUG7ReD.js","assets/index-BzTZZCvL.js","assets/index.O26j_t8G.css","assets/FormClearHelper-DmeZ2QuQ.js","assets/withFullScreenWrapper-DIS3bwns.js","assets/Toolbar-CG7W1D-O.js","assets/sprintf-C-r3gIuM.js","assets/createDownloadLinkElement-DZMwyjvU.js","assets/slicedToArray-tqzlNjPF.js","assets/getPrototypeOf-CFHg57KG.js","assets/createSuper-CvaFdVoD.js","assets/FileDownload.esm-CUqgQU-j.js","assets/number-overlay-editor-20er5Sp-.js","assets/es6-CTcMcfqp.js"])))=>i.map(i=>d[i]);
2
+ var Zw=Object.defineProperty;var Jw=(Rr,nr,Ur)=>nr in Rr?Zw(Rr,nr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Rr[nr]=Ur;var dt=(Rr,nr,Ur)=>Jw(Rr,typeof nr!="symbol"?nr+"":nr,Ur);import{r as h,E as Nd,_ as Ze,g as mi,d as Qw,R as oe,i as ls,p as ey,e as ss,f as ty,h as ny,l as $d,t as Bd,m as ry,n as Wd,o as oy,q as iy,s as ay,v as ly,w as sy,a as pr,x as cs,y as jd,z as cy,A as uy,B as Xe,C as Ud,D as Yd,F as wt,G as kr,H as dy,I as Gd,J as uo,j as pn,c as Xd,K as Kd,L as hy,M as us,N as Un,O as qd,Q as ds,S as Br,T as Zd,U as vi,V as Sr,k as fy,W as py,X as $e,Y as Jd,b as gy,Z as hs,$ as fs,a0 as my,a1 as vy,a2 as by,a3 as wy,a4 as yy,a5 as xy,a6 as Cy,a7 as Qd,a8 as ky,__tla as Sy}from"./index-BzTZZCvL.js";import{u as My}from"./FormClearHelper-DmeZ2QuQ.js";import{w as Ry,u as Ey,E as Iy}from"./withFullScreenWrapper-DIS3bwns.js";import{T as Ty,a as bi}from"./Toolbar-CG7W1D-O.js";import{s as Oy}from"./sprintf-C-r3gIuM.js";import{c as Dy}from"./createDownloadLinkElement-DZMwyjvU.js";import{_ as Mr,C as Hy}from"./slicedToArray-tqzlNjPF.js";import{_ as Py,a as zy,b as Fy}from"./getPrototypeOf-CFHg57KG.js";import{_ as Ly}from"./createSuper-CvaFdVoD.js";import{D as Ay,F as Vy}from"./FileDownload.esm-CUqgQU-j.js";let ps,Fa,Wr,gs,eh,jr,ms,un,_y=Promise.all([(()=>{try{return Sy}catch{}})()]).then(async()=>{var Rr=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Nd,Ze({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"}))});Rr.displayName="Add";var nr=h.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return h.createElement(Nd,Ze({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"}))});nr.displayName="Search";function Ur(e="This should not happen"){throw new Error(e)}function Tn(e,t="Assertion failed"){if(!e)return Ur(t)}function Ho(e,t){return Ur(t??"Hell froze over")}function th(e,t){try{return e()}catch{return t}}const vs=Object.prototype.hasOwnProperty;function ho(e,t){let n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ho(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(vs.call(e,n)&&++r&&!vs.call(t,n)||!(n in t)||!ho(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var nh=Object.prototype,rh=nh.hasOwnProperty;function oh(e,t){return e!=null&&rh.call(e,t)}var ih=oh,ah=ih,lh=Qw;function sh(e,t){return e!=null&&lh(e,t,ah)}var ch=sh;const uh=mi(ch),wi=null,La=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 bs;(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"})(bs||(bs={}));var yi;(function(e){e.Triangle="triangle",e.Dots="dots"})(yi||(yi={}));function xi(e){return"width"in e&&typeof e.width=="number"}async function ws(e){return typeof e=="object"?e:await e()}jr=function(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)},Wr=function(e){return e.kind===Ln.Marker||e.kind===Ln.NewRow};function Po(e){if(!jr(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;Ho(e,"A cell was passed with an invalid kind")}gs=function(e){return uh(e,"editor")};function Aa(e){return!(e.readonly??!1)}var Ln;(function(e){e.NewRow="new-row",e.Marker="marker"})(Ln||(Ln={}));function dh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(r,o){return r[0]-o[0]}),n.push([...t[0]]);for(const r of t.slice(1)){const o=n[n.length-1];o[1]<r[0]?n.push([...r]):o[1]<r[1]&&(o[1]=r[1])}return n}let ys;const br=class br{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(r=>[r[0]+t,r[1]+t]);return new br(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=dh([...this.items,n]);return new br(r)}remove(t){const n=[...this.items],r=typeof t=="number"?t:t[0],o=typeof t=="number"?t+1:t[1];for(const[i,a]of n.entries()){const[l,s]=a;if(l<=o&&r<=s){const c=[];l<r&&c.push([l,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new br(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[r,o]=this.items[n];if(t>=r&&t<o)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const r=t.items[n],o=this.items[n];if(r[0]!==o[0]||r[1]!==o[1])return!1}return!0}toArray(){const t=[];for(const[n,r]of this.items)for(let o=n;o<r;o++)t.push(o);return t}get length(){let t=0;for(const[n,r]of this.items)t+=r-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let r=t;r<n;r++)yield r}};dt(br,"empty",()=>ys??(ys=new br([]))),dt(br,"fromSingleSelection",t=>br.empty().add(t));let vt=br;var hh=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),t={},n=[];e.forEach(o=>{(o?o.split(" "):[]).forEach(i=>{if(i.startsWith("atm_")){const[,a]=i.split("_");t[a]=i}else n.push(i)})});const r=[];for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&r.push(t[o]);return r.push(...n),r.join(" ")},xs=hh,fh=e=>e.toUpperCase()===e,ph=e=>t=>e.indexOf(t)===-1,Cs=(e,t)=>{const n={};return Object.keys(e).filter(ph(t)).forEach(r=>{n[r]=e[r]}),n};function gh(e,t,n){const r=Cs(t,n);if(!e){const o=typeof ls=="function"?{default:ls}:ls;Object.keys(r).forEach(i=>{o.default(i)||delete r[i]})}return r}var mh=(e,t)=>{};function vh(e){let t="";return n=>{const r=(i,a)=>{const{as:l=e,class:s=t}=i,c=n.propsAsIs===void 0?!(typeof l=="string"&&l.indexOf("-")===-1&&!fh(l[0])):n.propsAsIs,u=gh(c,i,["as","class"]);u.ref=a,u.className=n.atomic?xs(n.class,u.className||s):xs(u.className||s,n.class);const{vars:d}=n;if(d){const f={};for(const m in d){const b=d[m],y=b[0],w=b[1]||"",k=typeof y=="function"?y(i):y;mh(k,n.name),f[`--${m}`]=`${k}${w}`}const p=u.style||{},g=Object.keys(p);g.length>0&&g.forEach(m=>{f[m]=p[m]}),u.style=f}return e.__linaria&&e!==l?(u.as=l,oe.createElement(e,u)):oe.createElement(l,u)},o=oe.forwardRef?oe.forwardRef(r):i=>{const a=Cs(i,["innerRef"]);return r(a,i.innerRef)};return o.displayName=n.name,o.__linaria={className:n.class||t,extends:e},o}}un=vh;const bh=un("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var ks={},Ci={},Va={},Ss={},Ms;function wh(){return Ms||(Ms=1,function(e){(function(t,n){n(e,h,ey)})(ss,function(t,n,r){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=g;var o=a(n),i=a(r);function a(w){return w&&w.__esModule?w:{default:w}}var l=Object.assign||function(w){for(var k=1;k<arguments.length;k++){var S=arguments[k];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(w[C]=S[C])}return w};function s(w,k){var S={};for(var C in w)k.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(w,C)&&(S[C]=w[C]);return S}function c(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}var u=function(){function w(k,S){for(var C=0;C<S.length;C++){var x=S[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(k,x.key,x)}}return function(k,S,C){return S&&w(k.prototype,S),C&&w(k,C),k}}();function d(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:w}function f(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}var p=!1;function g(w){p=w}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){g(!0)}}))}catch{}function m(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return p?w:w.capture}function b(w){if("touches"in w){var k=w.touches[0],S=k.pageX,C=k.pageY;return{x:S,y:C}}var x=w.screenX,M=w.screenY;return{x,y:M}}var y=function(w){f(k,w);function k(){var S;c(this,k);for(var C=arguments.length,x=Array(C),M=0;M<C;M++)x[M]=arguments[M];var O=d(this,(S=k.__proto__||Object.getPrototypeOf(k)).call.apply(S,[this].concat(x)));return O._handleSwipeStart=O._handleSwipeStart.bind(O),O._handleSwipeMove=O._handleSwipeMove.bind(O),O._handleSwipeEnd=O._handleSwipeEnd.bind(O),O._onMouseDown=O._onMouseDown.bind(O),O._onMouseMove=O._onMouseMove.bind(O),O._onMouseUp=O._onMouseUp.bind(O),O._setSwiperRef=O._setSwiperRef.bind(O),O}return u(k,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,m({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(S){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(S))}},{key:"_onMouseMove",value:function(S){this.mouseDown&&this._handleSwipeMove(S)}},{key:"_onMouseUp",value:function(S){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(S)}},{key:"_handleSwipeStart",value:function(S){var C=b(S),x=C.x,M=C.y;this.moveStart={x,y:M},this.props.onSwipeStart(S)}},{key:"_handleSwipeMove",value:function(S){if(this.moveStart){var C=b(S),x=C.x,M=C.y,O=x-this.moveStart.x,E=M-this.moveStart.y;this.moving=!0;var H=this.props.onSwipeMove({x:O,y:E},S);H&&S.cancelable&&S.preventDefault(),this.movePosition={deltaX:O,deltaY:E}}}},{key:"_handleSwipeEnd",value:function(S){this.props.onSwipeEnd(S);var C=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-C?this.props.onSwipeLeft(1,S):this.movePosition.deltaX>C&&this.props.onSwipeRight(1,S),this.movePosition.deltaY<-C?this.props.onSwipeUp(1,S):this.movePosition.deltaY>C&&this.props.onSwipeDown(1,S)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(S){this.swiper=S,this.props.innerRef(S)}},{key:"render",value:function(){var S=this.props;S.tagName;var C=S.className,x=S.style,M=S.children;S.allowMouseEvents,S.onSwipeUp,S.onSwipeDown,S.onSwipeLeft,S.onSwipeRight,S.onSwipeStart,S.onSwipeMove,S.onSwipeEnd,S.innerRef,S.tolerance;var O=s(S,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return o.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:C,style:x},O),M)}}]),k}(n.Component);y.displayName="ReactSwipe",y.propTypes={tagName:i.default.string,className:i.default.string,style:i.default.object,children:i.default.node,allowMouseEvents:i.default.bool,onSwipeUp:i.default.func,onSwipeDown:i.default.func,onSwipeLeft:i.default.func,onSwipeRight:i.default.func,onSwipeStart:i.default.func,onSwipeMove:i.default.func,onSwipeEnd:i.default.func,innerRef:i.default.func,tolerance:i.default.number.isRequired},y.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=y})}(Ss)),Ss}(function(e){(function(t,n){n(e,wh())})(ss,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default})})(Va);var zo={};Object.defineProperty(zo,"__esModule",{value:!0}),zo.default=void 0;var Er=yh(ty);function yh(e){return e&&e.__esModule?e:{default:e}}function xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ch={ROOT:function(e){return(0,Er.default)(xh({"carousel-root":!0},e||"",!!e))},CAROUSEL:function(e){return(0,Er.default)({carousel:!0,"carousel-slider":e})},WRAPPER:function(e,t){return(0,Er.default)({"thumbs-wrapper":!e,"slider-wrapper":e,"axis-horizontal":t==="horizontal","axis-vertical":t!=="horizontal"})},SLIDER:function(e,t){return(0,Er.default)({thumbs:!e,slider:e,animated:!t})},ITEM:function(e,t,n){return(0,Er.default)({thumb:!e,slide:e,selected:t,previous:n})},ARROW_PREV:function(e){return(0,Er.default)({"control-arrow control-prev":!0,"control-disabled":e})},ARROW_NEXT:function(e){return(0,Er.default)({"control-arrow control-next":!0,"control-disabled":e})},DOT:function(e){return(0,Er.default)({dot:!0,selected:e})}};zo.default=Ch;var Fo={},ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.outerWidth=void 0;var kh=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseInt(n.marginLeft)+parseInt(n.marginRight),t};ki.outerWidth=kh;var fo={};Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0;var Sh=function(e,t,n){var r=e===0?e:e+t,o=n==="horizontal"?[r,0,0]:[0,r,0],i="translate3d",a="("+o.join(",")+")";return i+a};fo.default=Sh;var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.default=void 0;var Mh=function(){return window};Lo.default=Mh,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.default=void 0;var Yn=Ih(h),Yr=Mi(zo),Rh=ki,Rs=Mi(fo),Eh=Mi(Va),Si=Mi(Lo);function Mi(e){return e&&e.__esModule?e:{default:e}}function Es(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Es=function(){return e},e}function Ih(e){if(e&&e.__esModule)return e;if(e===null||Ao(e)!=="object"&&typeof e!="function")return{default:e};var t=Es();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function Ao(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ao=function(t){return typeof t}:Ao=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ao(e)}function _a(){return _a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_a.apply(this,arguments)}function Th(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dh(e,t,n){return Oh(e.prototype,t),e}function Hh(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&&Na(e,t)}function Na(e,t){return Na=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Na(e,t)}function Ph(e){var t=Fh();return function(){var n=Ri(e),r;if(t){var o=Ri(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return zh(this,r)}}function zh(e,t){return t&&(Ao(t)==="object"||typeof t=="function")?t:bn(e)}function bn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fh(){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 Ri(e){return Ri=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ri(e)}function gn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lh=function(e){return e.hasOwnProperty("key")},$a=function(e){Hh(n,e);var t=Ph(n);function n(r){var o;return Th(this,n),o=t.call(this,r),gn(bn(o),"itemsWrapperRef",void 0),gn(bn(o),"itemsListRef",void 0),gn(bn(o),"thumbsRef",void 0),gn(bn(o),"setItemsWrapperRef",function(i){o.itemsWrapperRef=i}),gn(bn(o),"setItemsListRef",function(i){o.itemsListRef=i}),gn(bn(o),"setThumbsRef",function(i,a){o.thumbsRef||(o.thumbsRef=[]),o.thumbsRef[a]=i}),gn(bn(o),"updateSizes",function(){if(!(!o.props.children||!o.itemsWrapperRef||!o.thumbsRef)){var i=Yn.Children.count(o.props.children),a=o.itemsWrapperRef.clientWidth,l=o.props.thumbWidth?o.props.thumbWidth:(0,Rh.outerWidth)(o.thumbsRef[0]),s=Math.floor(a/l),c=s<i,u=c?i-s:0;o.setState(function(d,f){return{itemSize:l,visibleItems:s,firstItem:c?o.getFirstItem(f.selectedItem):0,lastPosition:u,showArrows:c}})}}),gn(bn(o),"handleClickItem",function(i,a,l){if(!Lh(l)||l.key==="Enter"){var s=o.props.onSelectItem;typeof s=="function"&&s(i,a)}}),gn(bn(o),"onSwipeStart",function(){o.setState({swiping:!0})}),gn(bn(o),"onSwipeEnd",function(){o.setState({swiping:!1})}),gn(bn(o),"onSwipeMove",function(i){var a=i.x;if(!o.state.itemSize||!o.itemsWrapperRef||!o.state.visibleItems)return!1;var l=0,s=Yn.Children.count(o.props.children),c=-(o.state.firstItem*100)/o.state.visibleItems,u=Math.max(s-o.state.visibleItems,0),d=-u*100/o.state.visibleItems;c===l&&a>0&&(a=0),c===d&&a<0&&(a=0);var f=o.itemsWrapperRef.clientWidth,p=c+100/(f/a);return o.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(g){o.itemsListRef.style[g]=(0,Rs.default)(p,"%",o.props.axis)}),!0}),gn(bn(o),"slideRight",function(i){o.moveTo(o.state.firstItem-(typeof i=="number"?i:1))}),gn(bn(o),"slideLeft",function(i){o.moveTo(o.state.firstItem+(typeof i=="number"?i:1))}),gn(bn(o),"moveTo",function(i){i=i<0?0:i,i=i>=o.state.lastPosition?o.state.lastPosition:i,o.setState({firstItem:i})}),o.state={selectedItem:r.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},o}return Dh(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,Si.default)().addEventListener("resize",this.updateSizes),(0,Si.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Si.default)().removeEventListener("resize",this.updateSizes),(0,Si.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,i){var a=Yr.default.ITEM(!1,i===r.state.selectedItem),l={key:i,ref:function(s){return r.setThumbsRef(s,i)},className:a,onClick:r.handleClickItem.bind(r,i,r.props.children[i]),onKeyDown:r.handleClickItem.bind(r,i,r.props.children[i]),"aria-label":"".concat(r.props.labels.item," ").concat(i+1),style:{width:r.props.thumbWidth}};return Yn.default.createElement("li",_a({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=Yn.Children.count(this.props.children)>1,i=this.state.showArrows&&this.state.firstItem>0,a=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},s=-this.state.firstItem*(this.state.itemSize||0),c=(0,Rs.default)(s,"px",this.props.axis),u=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:u,MozTransitionDuration:u,MsTransitionDuration:u,OTransitionDuration:u,transitionDuration:u,msTransitionDuration:u},Yn.default.createElement("div",{className:Yr.default.CAROUSEL(!1)},Yn.default.createElement("div",{className:Yr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},Yn.default.createElement("button",{type:"button",className:Yr.default.ARROW_PREV(!i),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?Yn.default.createElement(Eh.default,{tagName:"ul",className:Yr.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()):Yn.default.createElement("ul",{className:Yr.default.SLIDER(!1,this.state.swiping),ref:function(d){return r.setItemsListRef(d)},style:l},this.renderItems()),Yn.default.createElement("button",{type:"button",className:Yr.default.ARROW_NEXT(!a),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(Yn.Component);Fo.default=$a,gn($a,"displayName","Thumbs"),gn($a,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.default=void 0;var Ah=function(){return document};Ei.default=Ah;var On={};Object.defineProperty(On,"__esModule",{value:!0}),On.setPosition=On.getPosition=On.isKeyboardEvent=On.defaultStatusFormatter=On.noop=void 0;var Vh=h,_h=Nh(fo);function Nh(e){return e.__esModule?e:{default:e}}var $h=function(){};On.noop=$h;var Bh=function(e,t){return"".concat(e," of ").concat(t)};On.defaultStatusFormatter=Bh;var Wh=function(e){return e?e.hasOwnProperty("key"):!1};On.isKeyboardEvent=Wh;var jh=function(e,t){if(t.infiniteLoop&&++e,e===0)return 0;var n=Vh.Children.count(t.children);if(t.centerMode&&t.axis==="horizontal"){var r=-e*t.centerSlidePercentage,o=n-1;return e&&(e!==o||t.infiniteLoop)?r+=(100-t.centerSlidePercentage)/2:e===o&&(r+=100-t.centerSlidePercentage),r}return-e*100};On.getPosition=jh;var Uh=function(e,t){var n={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){n[r]=(0,_h.default)(e,"%",t)}),n};On.setPosition=Uh;var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.fadeAnimationHandler=rr.slideStopSwipingHandler=rr.slideSwipeAnimationHandler=rr.slideAnimationHandler=void 0;var Is=h,Yh=Gh(fo),or=On;function Gh(e){return e.__esModule?e:{default:e}}function Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ts(Object(n),!0).forEach(function(r){Xh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kh=function(e,t){var n={},r=t.selectedItem,o=r,i=Is.Children.count(e.children)-1,a=e.infiniteLoop&&(r<0||r>i);if(a)return o<0?e.centerMode&&e.centerSlidePercentage&&e.axis==="horizontal"?n.itemListStyle=(0,or.setPosition)(-(i+2)*e.centerSlidePercentage-(100-e.centerSlidePercentage)/2,e.axis):n.itemListStyle=(0,or.setPosition)(-(i+2)*100,e.axis):o>i&&(n.itemListStyle=(0,or.setPosition)(0,e.axis)),n;var l=(0,or.getPosition)(r,e),s=(0,Yh.default)(l,"%",e.axis),c=e.transitionTime+"ms";return n.itemListStyle={WebkitTransform:s,msTransform:s,OTransform:s,transform:s},t.swiping||(n.itemListStyle=Gr(Gr({},n.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),n};rr.slideAnimationHandler=Kh;var qh=function(e,t,n,r){var o={},i=t.axis==="horizontal",a=Is.Children.count(t.children),l=0,s=(0,or.getPosition)(n.selectedItem,t),c=t.infiniteLoop?(0,or.getPosition)(a-1,t)-100:(0,or.getPosition)(a-1,t),u=i?e.x:e.y,d=u;s===l&&u>0&&(d=0),s===c&&u<0&&(d=0);var f=s+100/(n.itemSize/d),p=Math.abs(u)>t.swipeScrollTolerance;return t.infiniteLoop&&p&&(n.selectedItem===0&&f>-100?f-=a*100:n.selectedItem===a-1&&f<-a*100&&(f+=a*100)),(!t.preventMovementUntilSwipeScrollTolerance||p||n.swipeMovementStarted)&&(n.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,or.setPosition)(f,t.axis)),p&&!n.cancelClick&&r({cancelClick:!0}),o};rr.slideSwipeAnimationHandler=qh;var Zh=function(e,t){var n=(0,or.getPosition)(t.selectedItem,e),r=(0,or.setPosition)(n,e.axis);return{itemListStyle:r}};rr.slideStopSwipingHandler=Zh;var Jh=function(e,t){var n=e.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 t.swiping||(o=Gr(Gr({},o),{},{WebkitTransitionDuration:n,MozTransitionDuration:n,OTransitionDuration:n,transitionDuration:n,msTransitionDuration:n})),{slideStyle:o,selectedStyle:Gr(Gr({},o),{},{opacity:1,position:"relative"}),prevStyle:Gr({},o)}};rr.fadeAnimationHandler=Jh,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.default=void 0;var zt=tf(h),Qh=_o(Va),gr=_o(zo),ef=_o(Fo),Ii=_o(Ei),Ti=_o(Lo),Vo=On,Oi=rr;function _o(e){return e&&e.__esModule?e:{default:e}}function Os(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Os=function(){return e},e}function tf(e){if(e&&e.__esModule)return e;if(e===null||No(e)!=="object"&&typeof e!="function")return{default:e};var t=Os();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function No(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?No=function(t){return typeof t}:No=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}function Ba(){return Ba=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ba.apply(this,arguments)}function Ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ds(Object(n),!0).forEach(function(r){ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ds(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function of(e,t,n){return rf(e.prototype,t),e}function af(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&&Wa(e,t)}function Wa(e,t){return Wa=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n},Wa(e,t)}function lf(e){var t=cf();return function(){var n=Di(e),r;if(t){var o=Di(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return sf(this,r)}}function sf(e,t){return t&&(No(t)==="object"||typeof t=="function")?t:pt(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cf(){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 Di(e){return Di=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Di(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 ja=function(e){af(n,e);var t=lf(n);function n(r){var o;nf(this,n),o=t.call(this,r),ht(pt(o),"thumbsRef",void 0),ht(pt(o),"carouselWrapperRef",void 0),ht(pt(o),"listRef",void 0),ht(pt(o),"itemsRef",void 0),ht(pt(o),"timer",void 0),ht(pt(o),"animationHandler",void 0),ht(pt(o),"setThumbsRef",function(a){o.thumbsRef=a}),ht(pt(o),"setCarouselWrapperRef",function(a){o.carouselWrapperRef=a}),ht(pt(o),"setListRef",function(a){o.listRef=a}),ht(pt(o),"setItemsRef",function(a,l){o.itemsRef||(o.itemsRef=[]),o.itemsRef[l]=a}),ht(pt(o),"autoPlay",function(){zt.Children.count(o.props.children)<=1||(o.clearAutoPlay(),o.props.autoPlay&&(o.timer=setTimeout(function(){o.increment()},o.props.interval)))}),ht(pt(o),"clearAutoPlay",function(){o.timer&&clearTimeout(o.timer)}),ht(pt(o),"resetAutoPlay",function(){o.clearAutoPlay(),o.autoPlay()}),ht(pt(o),"stopOnHover",function(){o.setState({isMouseEntered:!0},o.clearAutoPlay)}),ht(pt(o),"startOnLeave",function(){o.setState({isMouseEntered:!1},o.autoPlay)}),ht(pt(o),"isFocusWithinTheCarousel",function(){return o.carouselWrapperRef?!!((0,Ii.default)().activeElement===o.carouselWrapperRef||o.carouselWrapperRef.contains((0,Ii.default)().activeElement)):!1}),ht(pt(o),"navigateWithKeyboard",function(a){if(o.isFocusWithinTheCarousel()){var l=o.props.axis,s=l==="horizontal",c={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},u=s?c.ArrowRight:c.ArrowDown,d=s?c.ArrowLeft:c.ArrowUp;u===a.keyCode?o.increment():d===a.keyCode&&o.decrement()}}),ht(pt(o),"updateSizes",function(){if(!(!o.state.initialized||!o.itemsRef||o.itemsRef.length===0)){var a=o.props.axis==="horizontal",l=o.itemsRef[0];if(l){var s=a?l.clientWidth:l.clientHeight;o.setState({itemSize:s}),o.thumbsRef&&o.thumbsRef.updateSizes()}}}),ht(pt(o),"setMountState",function(){o.setState({hasMount:!0}),o.updateSizes()}),ht(pt(o),"handleClickItem",function(a,l){if(zt.Children.count(o.props.children)!==0){if(o.state.cancelClick){o.setState({cancelClick:!1});return}o.props.onClickItem(a,l),a!==o.state.selectedItem&&o.setState({selectedItem:a})}}),ht(pt(o),"handleOnChange",function(a,l){zt.Children.count(o.props.children)<=1||o.props.onChange(a,l)}),ht(pt(o),"handleClickThumb",function(a,l){o.props.onClickThumb(a,l),o.moveTo(a)}),ht(pt(o),"onSwipeStart",function(a){o.setState({swiping:!0}),o.props.onSwipeStart(a)}),ht(pt(o),"onSwipeEnd",function(a){o.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),o.props.onSwipeEnd(a),o.clearAutoPlay(),o.state.autoPlay&&o.autoPlay()}),ht(pt(o),"onSwipeMove",function(a,l){o.props.onSwipeMove(l);var s=o.props.swipeAnimationHandler(a,o.props,o.state,o.setState.bind(pt(o)));return o.setState(Gn({},s)),!!Object.keys(s).length}),ht(pt(o),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;o.moveTo(o.state.selectedItem-(typeof a=="number"?a:1))}),ht(pt(o),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;o.moveTo(o.state.selectedItem+(typeof a=="number"?a:1))}),ht(pt(o),"moveTo",function(a){if(typeof a=="number"){var l=zt.Children.count(o.props.children)-1;a<0&&(a=o.props.infiniteLoop?l:0),a>l&&(a=o.props.infiniteLoop?0:l),o.selectItem({selectedItem:a}),o.state.autoPlay&&o.state.isMouseEntered===!1&&o.resetAutoPlay()}}),ht(pt(o),"onClickNext",function(){o.increment(1)}),ht(pt(o),"onClickPrev",function(){o.decrement(1)}),ht(pt(o),"onSwipeForward",function(){o.increment(1),o.props.emulateTouch&&o.setState({cancelClick:!0})}),ht(pt(o),"onSwipeBackwards",function(){o.decrement(1),o.props.emulateTouch&&o.setState({cancelClick:!0})}),ht(pt(o),"changeItem",function(a){return function(l){(!(0,Vo.isKeyboardEvent)(l)||l.key==="Enter")&&o.moveTo(a)}}),ht(pt(o),"selectItem",function(a){o.setState(Gn({previousItem:o.state.selectedItem},a),function(){o.setState(o.animationHandler(o.props,o.state))}),o.handleOnChange(a.selectedItem,zt.Children.toArray(o.props.children)[a.selectedItem])}),ht(pt(o),"getInitialImage",function(){var a=o.props.selectedItem,l=o.itemsRef&&o.itemsRef[a],s=l&&l.getElementsByTagName("img")||[];return s[0]}),ht(pt(o),"getVariableItemHeight",function(a){var l=o.itemsRef&&o.itemsRef[a];if(o.state.hasMount&&l&&l.children.length){var s=l.children[0].getElementsByTagName("img")||[];if(s.length>0){var c=s[0];if(!c.complete){var u=function p(){o.forceUpdate(),c.removeEventListener("load",p)};c.addEventListener("load",u)}}var d=s[0]||l.children[0],f=d.clientHeight;return f>0?f:null}return null});var i={initialized:!1,previousItem:r.selectedItem,selectedItem:r.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:r.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return o.animationHandler=typeof r.animationHandler=="function"&&r.animationHandler||r.animationHandler==="fade"&&Oi.fadeAnimationHandler||Oi.slideAnimationHandler,o.state=Gn(Gn({},i),o.animationHandler(r,i)),o}return of(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(Gn({},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&&zt.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,Ti.default)().addEventListener("resize",this.updateSizes),(0,Ti.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,Ii.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Ti.default)().removeEventListener("resize",this.updateSizes),(0,Ti.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,Ii.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?zt.Children.map(this.props.children,function(i,a){var l=a===o.state.selectedItem,s=a===o.state.previousItem,c=l&&o.state.selectedStyle||s&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=Gn(Gn({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=Gn(Gn({},c),{},{pointerEvents:"none"}));var u={ref:function(d){return o.setItemsRef(d,a)},key:"itemKey"+a+(r?"clone":""),className:gr.default.ITEM(!0,a===o.state.selectedItem,a===o.state.previousItem),onClick:o.handleClickItem.bind(o,a,i),style:c};return zt.default.createElement("li",u,o.props.renderItem(i,{isSelected:a===o.state.selectedItem,isPrevious:a===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,i=o.showIndicators,a=o.labels,l=o.renderIndicator,s=o.children;return i?zt.default.createElement("ul",{className:"control-dots"},zt.Children.map(s,function(c,u){return l&&l(r.changeItem(u),u===r.state.selectedItem,u,a.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?zt.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,zt.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||zt.Children.count(this.props.children)===0?null:zt.default.createElement(ef.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||zt.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&zt.Children.count(this.props.children)>1,i=this.props.axis==="horizontal",a=this.props.showArrows&&zt.Children.count(this.props.children)>1,l=a&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,s=a&&(this.state.selectedItem<zt.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),u=c.shift(),d=c.pop(),f={className:gr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},p={};if(i){if(f.onSwipeLeft=this.onSwipeForward,f.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var g=this.getVariableItemHeight(this.state.selectedItem);p.height=g||"auto"}}else f.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,f.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,f.style=Gn(Gn({},f.style),{},{height:this.state.itemSize}),p.height=this.state.itemSize;return zt.default.createElement("div",{"aria-label":this.props.ariaLabel,className:gr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},zt.default.createElement("div",{className:gr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),zt.default.createElement("div",{className:gr.default.WRAPPER(!0,this.props.axis),style:p},o?zt.default.createElement(Qh.default,Ba({tagName:"ul",innerRef:this.setListRef},f,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u):zt.default.createElement("ul",{className:gr.default.SLIDER(!0,this.state.swiping),ref:function(m){return r.setListRef(m)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&d,this.renderItems(),this.props.infiniteLoop&&u)),this.props.renderArrowNext(this.onClickNext,s,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(zt.default.Component);Ci.default=ja,ht(ja,"displayName","Carousel"),ht(ja,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Vo.noop,onClickThumb:Vo.noop,onChange:Vo.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(e,t,n){return zt.default.createElement("button",{type:"button","aria-label":n,className:gr.default.ARROW_PREV(!t),onClick:e})},renderArrowNext:function(e,t,n){return zt.default.createElement("button",{type:"button","aria-label":n,className:gr.default.ARROW_NEXT(!t),onClick:e})},renderIndicator:function(e,t,n,r){return zt.default.createElement("li",{className:gr.default.DOT(t),onClick:e,onKeyDown:e,value:n,key:n,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(n+1)})},renderItem:function(e){return e},renderThumbs:function(e){var t=zt.Children.map(e,function(n){var r=n;if(n.type!=="img"&&(r=zt.Children.toArray(n.props.children).find(function(o){return o.type==="img"})),!!r)return r});return t.filter(function(n){return n}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):t},statusFormatter:Vo.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:Oi.slideSwipeAnimationHandler,stopSwipingHandler:Oi.slideStopSwipingHandler});var uf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(Ci),n=uf,r=o(Fo);function o(i){return i&&i.__esModule?i:{default:i}}})(ks);var df=ny,hf=function(){return df.Date.now()},ff=hf,pf=$d,Ua=ff,Hs=Bd,gf="Expected a function",mf=Math.max,vf=Math.min;function bf(e,t,n){var r,o,i,a,l,s,c=0,u=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(gf);t=Hs(t)||0,pf(n)&&(u=!!n.leading,d="maxWait"in n,i=d?mf(Hs(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function p(x){var M=r,O=o;return r=o=void 0,c=x,a=e.apply(O,M),a}function g(x){return c=x,l=setTimeout(y,t),u?p(x):a}function m(x){var M=x-s,O=x-c,E=t-M;return d?vf(E,i-O):E}function b(x){var M=x-s,O=x-c;return s===void 0||M>=t||M<0||d&&O>=i}function y(){var x=Ua();if(b(x))return w(x);l=setTimeout(y,m(x))}function w(x){return l=void 0,f&&r?p(x):(r=o=void 0,a)}function k(){l!==void 0&&clearTimeout(l),c=0,r=s=o=l=void 0}function S(){return l===void 0?a:w(Ua())}function C(){var x=Ua(),M=b(x);if(r=arguments,o=this,s=x,M){if(l===void 0)return g(s);if(d)return clearTimeout(l),l=setTimeout(y,t),p(s)}return l===void 0&&(l=setTimeout(y,t)),a}return C.cancel=k,C.flush=S,C}var Ps=bf;const zs=mi(Ps);function hn(e,t,n,r,o=!1){const i=h.useRef();i.current=t,h.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,l=s=>{var c;(c=i.current)==null||c.call(a,s)};return a.addEventListener(e,l,{passive:r,capture:o}),()=>{a.removeEventListener(e,l,{capture:o})}},[e,n,r,o])}function Xr(e,t){return e===void 0?void 0:t}const wf=Math.PI;function Fs(e){return e*wf/180}const Ls=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),As=(e,t,n,r,o)=>{switch(e){case"left":return Math.floor(t)+r+o/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-r-o/2}},Vs=(e,t,n)=>Math.min(e,t-n*2),_s=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Ya=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"}))},yf=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 xf(e,t,n){const[r,o]=h.useState(e),i=h.useRef(!0);h.useEffect(()=>()=>{i.current=!1},[]);const a=h.useRef(zs(l=>{i.current&&o(l)},n));return h.useLayoutEffect(()=>{i.current&&a.current(()=>e())},t),r}const Cf="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",kf="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Sf=new RegExp("^[^"+kf+"]*["+Cf+"]");function Ga(e){return Sf.test(e)?"rtl":"not-rtl"}let Hi;function Xa(){if(typeof document>"u")return 0;if(Hi!==void 0)return Hi;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),Hi=n-r,Hi}const Kr=Symbol();function Mf(e){const t=h.useRef([Kr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=h.useState(e),[,o]=h.useState(),i=h.useCallback(l=>{const s=t.current[0];s!==Kr&&(l=typeof l=="function"?l(s):l,l===s)||(s!==Kr&&o({}),r(c=>typeof l=="function"?l(s===Kr?c:s):l),t.current[0]=Kr)},[]),a=h.useCallback(()=>{t.current[0]=Kr,o({})},[]);return[t.current[0]===Kr?n:t.current[0],i,a]}function Ns(e){if(e.length===0)return"";let t=0,n=0;for(const r of e){if(n+=r.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Rf(e){const t=h.useRef(e);return ho(e,t.current)||(t.current=e),t.current}const Ef=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(l=>l!=="");if(i.length===0)return null;const a=i.length>1;return h.createElement(bh,{"data-testid":"GDG-default-image-overlay-editor"},h.createElement(ks.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},i.map(l=>{const s=(o==null?void 0:o(l))??h.createElement("img",{draggable:!1,src:l});return h.createElement("div",{className:"gdg-centering-container",key:l},s)})),n&&r&&h.createElement("button",{className:"gdg-edit-icon",onClick:r},h.createElement(Ya,null)))};function $s(){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 qr=$s();function If(e){qr=e}const Bs=/[&<>"']/,Tf=new RegExp(Bs.source,"g"),Ws=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Of=new RegExp(Ws.source,"g"),Df={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},js=e=>Df[e];function mn(e,t){if(t){if(Bs.test(e))return e.replace(Tf,js)}else if(Ws.test(e))return e.replace(Of,js);return e}const Hf=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Us(e){return e.replace(Hf,(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 Pf=/(^|[^\[])\^/g;function Lt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(Pf,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const zf=/[^\w:]/g,Ff=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ys(e,t,n){if(e){let r;try{r=decodeURIComponent(Us(n)).replace(zf,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!Ff.test(n)&&(n=_f(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Pi={},Lf=/^[^:]+:\/*[^/]*$/,Af=/^([^:]+:)[\s\S]*$/,Vf=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _f(e,t){Pi[" "+e]||(Lf.test(e)?Pi[" "+e]=e+"/":Pi[" "+e]=Fi(e,"/",!0)),e=Pi[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Af,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Vf,"$1")+t:e+t}const zi={exec:function(){}};function Gs(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let s=!1,c=a;for(;--c>=0&&l[c]==="\\";)s=!s;return s?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function Fi(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function Nf(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function $f(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 Xs(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Ks(e,t,n,r){const o=t.href,i=t.title?mn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:mn(a)}}function Bf(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
3
3
  `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
4
4
  `)}class Ka{constructor(t){this.options=t||qr}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Fi(r,`
5
5
  `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=Bf(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=Fi(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,o,i,a,l,s,c,u,d,f,p,g,m=n[1].trim();const b=m.length>1,y={type:"list",raw:"",ordered:b,start:b?+m.slice(0,-1):"",loose:!1,items:[]};m=b?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=b?m:"[*+-]");const w=new RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(g=!1,!(!(n=w.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),u=n[2].split(`
@@ -169,10 +169,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An err
169
169
  `?(r.push(e.slice(o,a)),o=a+1,l===`
170
170
  `&&(n.push(r),r=[])):l==='"'&&(i=t.inString);break;case t.inString:l==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:l==='"'?i=t.inString:((l===" "||l===`
171
171
  `)&&(r.push($c(e.slice(o,a))),o=a+1,l===`
172
- `&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push($c(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Bc(e,t,n){var l;const r=wg(e,t),o=s=>{var c;(c=window.navigator.clipboard)==null||c.writeText(s)},i=(s,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([s],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})]),!0)},a=(s,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",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",c)}catch{i(s,c)||o(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function Wc(e){return e!==!0}function jc(e){return typeof e=="string"?e:`${e}px`}const Cg=()=>e=>e.innerWidth,kg=()=>e=>e.innerHeight,Sg=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Cg()],"wmyidgi-1":[kg()]}}),Mg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return h.createElement(Sg,{innerHeight:jc(n),innerWidth:jc(t),...o},r)},Rg=2,Eg=1300;function Ig(e,t,n){const r=oe.useRef(0),[o,i]=e??[0,0];oe.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{var u;if(!a){if(l===0)l=c;else{const d=c-l;r.current=Math.min(1,r.current+d/Eg);const f=r.current**1.618*d*Rg;(u=t.current)==null||u.scrollBy(o*f,i*f),l=c,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Tg({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,d,f,p]=oe.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const g=l/16,m=e,b=vc();return[typeof m=="number"?m*g:y=>Math.ceil(m(y)*g),Math.ceil(t*g),Math.ceil(n*g),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??b.headerIconSize)*g,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??b.cellHorizontalPadding)*g,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??b.cellVerticalPadding)*g},Math.ceil((o??0)*g),Math.ceil((i??0)*g)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}const Pr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ut(e,t){return e===!0?t:e===!1?"":e}function Uc(e){const t=Bi.value;return{activateCell:ut(e.activateCell," |Enter|shift+Enter"),clear:ut(e.clear,"any+Escape"),closeOverlay:ut(e.closeOverlay,"any+Escape"),acceptOverlayDown:ut(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ut(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ut(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ut(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ut(e.delete,t?"Backspace|Delete":"Delete"),downFill:ut(e.downFill,"primary+_68"),scrollToSelectedCell:ut(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ut(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ut(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ut(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ut(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ut(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ut(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ut(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ut(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ut(e.goToFirstCell,"primary+Home"),goToFirstColumn:ut(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ut(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ut(e.goToLastCell,"primary+End"),goToLastColumn:ut(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ut(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ut(e.goToNextPage,"PageDown"),goToPreviousPage:ut(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ut(e.rightFill,"primary+_82"),search:ut(e.search,"primary+f"),selectAll:ut(e.selectAll,"primary+a"),selectColumn:ut(e.selectColumn,"ctrl+ "),selectGrowDown:ut(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ut(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ut(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ut(e.selectGrowUp,"shift+ArrowUp"),selectRow:ut(e.selectRow,"shift+ "),selectToFirstCell:ut(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ut(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ut(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ut(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ut(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ut(e.selectToLastRow,"primary+shift+ArrowDown")}}function Og(e){const t=Rf(e);return oe.useMemo(()=>{if(t===void 0)return Uc(Pr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Pr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Pr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Pr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Pr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Pr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Pr.selectToLastCell};return Uc({...Pr,...n})},[t])}function Dg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function fl(e,t){const n=[];function r(a,l,s=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,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:l;r(a.subGroups[u],d,s||a.isCollapsed)}}const o=Dg(e.groups);for(let a=0;a<o.length;a++){const l=a<o.length-1?o[a+1].headerIndex:null;r(o[a],l)}let i=0;for(const a of n)a.contentIndex=i,i+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function ji(e,t){if(t===void 0||fl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Hg(e,t,n,r){const o=oe.useMemo(()=>e===void 0?void 0:fl(e,t),[e,t]),i=oe.useMemo(()=>o===void 0?t:o.reduce((c,u)=>c+(u.isCollapsed?1:u.rows+1),0),[o,t]),a=oe.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>{const{isGroupHeader:u}=ji(c,o);return u?e.height:typeof n=="number"?n:n(c)},[o,e,n]),l=oe.useCallback(c=>{if(o===void 0)return c;let u=c;for(const d of o){if(u===0)return;if(u--,!d.isCollapsed){if(u<d.rows)return d.contentIndex+u;u-=d.rows}}return c},[o]),s=Xr(r??(e==null?void 0:e.themeOverride),oe.useCallback(c=>{if(e===void 0)return r==null?void 0:r(c,c,c);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:d,groupIndex:f}=ji(c,o);return u?e.themeOverride:r==null?void 0:r(c,f,d)},[o,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:i,rowNumberMapper:l,getRowThemeOverride:s}}function Pg(e,t){const n=oe.useMemo(()=>e===void 0?void 0:fl(e,t),[e,t]);return{getRowGroupingForPath:Gc,updateRowGroupingByPath:Yc,mapper:oe.useCallback(r=>{if(typeof r=="number")return ji(r,n);const o=ji(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function Yc(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:Yc(i.subGroups??[],o,n)}:i)}function Gc(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Gc(e[n].subGroups??[],r)}function zg(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Fg(e,t,n,r,o){const[i,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]),l=h.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Mf(l),d=h.useRef(o);d.current=o;const f=zg(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),p=(s.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&p){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&u(),d.current()}},[t,p,u,f]);const g=(s.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&g){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&u(),d.current()}},[e,g,u,f]),{visibleRegion:s,setVisibleRegion:c,scrollRef:f}}const Lg=h.lazy(async()=>await cs(()=>import("./data-grid-overlay-editor-SiNLnLoA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));let Ag=0;function Vg(e){return jp(jd(jd(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return pr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Ui(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 Yi={kind:Z.Loading,allowOverlay:!1},Gi={columns:vt.empty(),rows:vt.empty(),current:void 0},_g=(e,t)=>{var Ad,Vd,_d;const[n,r]=h.useState(Gi),[o,i]=h.useState(),a=h.useRef(null),l=h.useRef(null),[s,c]=h.useState(),u=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:p,markdownDivCreateNode:g,width:m,height:b,columns:y,rows:w,getCellContent:k,onCellClicked:S,onCellActivated:C,onFillPattern:x,onFinishedEditing:M,coercePasteValue:O,drawHeader:E,drawCell:H,editorBloom:A,onHeaderClicked:V,onColumnProposeMove:P,rangeSelectionColumnSpanning:L=!0,spanRangeBehavior:Q="default",onGroupHeaderClicked:J,onCellContextMenu:ne,className:Ee,onHeaderContextMenu:me,getCellsForSelection:re,onGroupHeaderContextMenu:j,onGroupHeaderRenamed:ie,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:ge,searchResults:K,onSearchValueChange:D,searchValue:R,onKeyDown:B,onKeyUp:ce,keybindings:Oe,editOnType:Ve=!0,onRowAppended:ve,onColumnMoved:at,validateCell:be,highlightRegions:Ot,rangeSelect:It="rect",columnSelect:rt="multi",rowSelect:ee="multi",rangeSelectionBlending:nt="exclusive",columnSelectionBlending:we="exclusive",rowSelectionBlending:le="exclusive",onDelete:he,onDragStart:Le,onMouseMove:Pe,onPaste:Ke,copyHeaders:ue=!1,freezeColumns:Ie=0,cellActivationBehavior:lt="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:Je,onHeaderIndicatorClick:mt,getGroupDetails:gt,rowGrouping:_e,onSearchClose:Ht,onItemHovered:$t,onSelectionCleared:Tt,showSearch:At,onVisibleRegionChanged:Qt,gridSelection:Pt,onGridSelectionChange:kn,minColumnWidth:Bt=50,maxColumnWidth:Rt=500,maxColumnAutoWidth:Sn,provideEditor:wn,trailingRowOptions:De,freezeTrailingRows:pe=0,allowedFillDirections:st="orthogonal",scrollOffsetX:Xt,scrollOffsetY:on,verticalBorder:Ne,onDragOverCell:Vt,onDrop:_t,onColumnResize:Kt,onColumnResizeEnd:yt,onColumnResizeStart:Dt,customRenderers:Qe,fillHandle:qt,experimental:Ut,fixedShadowX:Yt,fixedShadowY:Zt,headerIcons:_n,imageWindowLoader:no,initialSize:sr,isDraggable:F,onDragLeave:et,onRowMoved:qe,overscrollX:Wt,overscrollY:Hn,preventDiagonalScrolling:yn,rightElement:Kn,rightElementProps:Pn,trapFocus:nn=!1,smoothScrollX:Nn,smoothScrollY:qn,scaleToRem:Wl=!1,rowHeight:fa=34,headerHeight:pa=36,groupHeaderHeight:jl=pa,theme:Co,isOutsideClick:zr,renderers:ni,resizeIndicator:Ul,scrollToActiveCell:ri=!0,drawFocusRing:oi=!0}=e,ro=oi==="no-editor"?o===void 0:oi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",ga=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,ii=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,wr=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,yr=Jt==null?void 0:Jt.headerTheme,ko=Jt==null?void 0:Jt.headerAlwaysVisible,Fr=ee!=="multi",Lr=(Jt==null?void 0:Jt.checkboxStyle)??"square",xr=Math.max(Bt,20),oo=Math.max(Rt,xr),ma=Math.max(Sn??oo,xr),va=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ue,rowNumberMapper:ai,rowHeight:ba,getRowThemeOverride:$n}=Hg(_e,w,fa,p),wa=h.useMemo(()=>Number.parseFloat(va.fontSize),[va]),{rowHeight:cr,headerHeight:li,groupHeaderHeight:ya,theme:xa,overscrollX:Yl,overscrollY:si}=Tg({groupHeaderHeight:jl,headerHeight:pa,overscrollX:Wt,overscrollY:Hn,remSize:wa,rowHeight:ba,scaleToRem:Wl,theme:Co}),ur=Og(Oe),Ar=ga??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=xn!=="none",$=Bn?1:0,Gt=ve!==void 0,dr=(De==null?void 0:De.sticky)===!0,[ci,So]=h.useState(!1),Gl=At??ci,Mo=h.useCallback(()=>{Ht!==void 0?Ht():So(!1)},[Ht]),U=h.useMemo(()=>Pt===void 0?void 0:Ui(Pt,$),[Pt,$])??n,sn=h.useRef();sn.current===void 0&&(sn.current=new AbortController),h.useEffect(()=>()=>sn==null?void 0:sn.current.abort(),[]);const[cn,Xl]=fg(re,k,$,sn.current,Ue),z=h.useCallback((v,I,T)=>{if(be===void 0)return!0;const _=[v[0]-$,v[1]];return be==null?void 0:be(_,I,T)},[$,be]),te=h.useRef(Pt),ye=h.useCallback((v,I)=>{I&&(v=yg(v,cn,$,Q,sn.current)),kn!==void 0?(te.current=Ui(v,-$),kn(te.current)):r(v)},[kn,cn,$,Q]),xe=Xr(Kt,h.useCallback((v,I,T,_)=>{Kt==null||Kt(y[T-$],I,T-$,_)},[Kt,$,y])),de=Xr(yt,h.useCallback((v,I,T,_)=>{yt==null||yt(y[T-$],I,T-$,_)},[yt,$,y])),ke=Xr(Dt,h.useCallback((v,I,T,_)=>{Dt==null||Dt(y[T-$],I,T-$,_)},[Dt,$,y])),ot=Xr(E,h.useCallback((v,I)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-$},I))??!1,[E,$])),it=Xr(H,h.useCallback((v,I)=>(H==null?void 0:H({...v,col:v.col-$},I))??!1,[H,$])),Me=h.useCallback(v=>{if(he!==void 0){const I=he(Ui(v,-$));return typeof I=="boolean"?I:Ui(I,$)}return!0},[he,$]),[St,Ce,Ye]=hg(U,ye,nt,we,le,It,L),Ge=h.useMemo(()=>mr(vc(),xa),[xa]),[ft,ln]=h.useState([0,0,0]),Mn=h.useMemo(()=>{if(ni===void 0)return{};const v={};for(const I of ni)v[I.kind]=I;return v},[ni]),xt=h.useCallback(v=>v.kind!==Z.Custom?Mn[v.kind]:Qe==null?void 0:Qe.find(I=>I.isMatch(v)),[Qe,Mn]);let{sizedColumns:en,nonGrowWidth:Zn}=wp(y,Ue,Xl,ft[0]-($===0?0:Ar)-ft[2],xr,ma,Ge,xt,sn.current);xn!=="none"&&(Zn+=Ar);const Rn=h.useMemo(()=>en.some(v=>v.group!==void 0),[en]),Et=Rn?li+ya:li,En=U.rows.length,zn=xn==="none"?void 0:En===0?!1:En===Ue?!0:void 0,Ct=h.useMemo(()=>xn==="none"?en:[{title:"",width:Ar,icon:void 0,hasMenu:!1,style:"normal",themeOverride:wr,rowMarker:Lr,rowMarkerChecked:zn,headerRowMarkerTheme:yr,headerRowMarkerAlwaysVisible:ko,headerRowMarkerDisabled:Fr},...en],[xn,en,Ar,wr,Lr,zn,yr,ko,Fr]),rn=h.useRef({height:1,width:1,x:0,y:0}),Vr=h.useRef(!1),{setVisibleRegion:_r,visibleRegion:io,scrollRef:jt}=Fg(Xt,on,cr,rn,()=>Vr.current=!0);rn.current=io;const xw=io.x+$,Ca=io.y,In=h.useRef(null),Cn=h.useCallback(v=>{var I;v===!0?(I=In.current)==null||I.focus():window.requestAnimationFrame(()=>{var T;(T=In.current)==null||T.focus()})},[]),vn=Gt?Ue+1:Ue,Wn=h.useCallback(v=>{const I=$===0?v:v.map(_=>({..._,location:[_.location[0]-$,_.location[1]]})),T=fe==null?void 0:fe(I);if(T!==!0)for(const _ of I)ae==null||ae(_.location,_.value);return T},[ae,fe,$]),[ao,Kl]=h.useState(),ka=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,Ro=ro?(Ad=U.current)==null?void 0:Ad.cell:void 0,Sa=Ro==null?void 0:Ro[0],Ma=Ro==null?void 0:Ro[1],Cw=h.useMemo(()=>{if((Ot===void 0||Ot.length===0)&&(ka??Sa??Ma??ao)===void 0)return;const v=[];if(Ot!==void 0)for(const I of Ot){const T=Ct.length-I.range.x-$;T>0&&v.push({color:I.color,range:{...I.range,x:I.range.x+$,width:Math.min(T,I.range.width)},style:I.style})}return ao!==void 0&&v.push({color:Zr(Ge.accentColor,0),range:ao,style:"dashed"}),ka!==void 0&&v.push({color:Zr(Ge.accentColor,.5),range:ka,style:"solid-outline"}),Sa!==void 0&&Ma!==void 0&&v.push({color:Ge.accentColor,range:{x:Sa,y:Ma,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[ao,ka,Sa,Ma,Ot,Ct.length,Ge.accentColor,$]),kd=h.useRef(Ct);kd.current=Ct;const Fn=h.useCallback(([v,I],T=!1)=>{var N,G,W,Y,q,X,Te;const _=Gt&&I===vn-1;if(v===0&&Bn){if(_)return Yi;const Re=ai(I);return Re===void 0?Yi:{kind:Ln.Marker,allowOverlay:!1,checkboxStyle:Lr,checked:(U==null?void 0:U.rows.hasIndex(I))===!0,markerKind:xn==="clickable-number"?"number":xn,row:ii+Re,drawHandle:qe!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if(_){const Re=v===$?(De==null?void 0:De.hint)??"":"",se=kd.current[v];if(((N=se==null?void 0:se.trailingRowOptions)==null?void 0:N.disabled)===!0)return Yi;{const He=((G=se==null?void 0:se.trailingRowOptions)==null?void 0:G.hint)??Re,tt=((W=se==null?void 0:se.trailingRowOptions)==null?void 0:W.addIcon)??(De==null?void 0:De.addIcon);return{kind:Ln.NewRow,hint:He,allowOverlay:!1,icon:tt}}}else{const Re=v-$;if(T||(Ut==null?void 0:Ut.strict)===!0){const He=rn.current,tt=He.x>Re||Re>He.x+He.width||He.y>I||I>He.y+He.height||I>=Zl.current,bt=Re===((q=(Y=He.extras)==null?void 0:Y.selected)==null?void 0:q[0])&&I===((X=He.extras)==null?void 0:X.selected[1]);let ze=!1;if(((Te=He.extras)==null?void 0:Te.freezeRegions)!==void 0){for(const Fe of He.extras.freezeRegions)if(eo(Fe,Re,I)){ze=!0;break}}if(tt&&!bt&&!ze)return Yi}let se=k([Re,I]);return $!==0&&se.span!==void 0&&(se={...se,span:[se.span[0]+$,se.span[1]+$]}),se}},[Gt,vn,Bn,ai,Lr,U==null?void 0:U.rows,xn,ii,qe,$,De==null?void 0:De.hint,De==null?void 0:De.addIcon,Ut==null?void 0:Ut.strict,k]),ql=h.useCallback(v=>{let I=(gt==null?void 0:gt(v))??{name:v};return ie!==void 0&&v!==""&&(I={icon:I.icon,name:I.name,overrideTheme:I.overrideTheme,actions:[...I.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ql({group:I.name,bounds:T.bounds})}]}),I},[gt,ie]),Ra=h.useCallback(v=>{var Y;const[I,T]=v.cell,_=Ct[I],N=(_==null?void 0:_.group)!==void 0?(Y=ql(_.group))==null?void 0:Y.overrideTheme:void 0,G=_==null?void 0:_.themeOverride,W=$n==null?void 0:$n(T);i({...v,theme:mr(Ge,N,G,W,v.content.themeOverride)})},[$n,Ct,ql,Ge]),Eo=h.useCallback((v,I,T)=>{var W;if(U.current===void 0)return;const[_,N]=U.current.cell,G=Fn([_,N]);if(G.kind!==Z.Boolean&&G.allowOverlay){let Y=G;if(T!==void 0)switch(Y.kind){case Z.Number:{const q=th(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(q)?0:q};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Ra({target:v,content:Y,initialValue:T,cell:[_,N],highlight:T===void 0,forceEditMode:T!==void 0})}else G.kind===Z.Boolean&&I&&G.readonly!==!0&&(Wn([{location:U.current.cell,value:{...G,data:Wc(G.data)}}]),(W=In.current)==null||W.damage([{cell:U.current.cell}]))},[Fn,U,Wn,Ra]),Sd=h.useCallback((v,I)=>{var N;const T=(N=In.current)==null?void 0:N.getBounds(v,I);if(T===void 0||jt.current===null)return;const _=Fn([v,I]);_.allowOverlay&&Ra({target:T,content:_,initialValue:void 0,highlight:!0,cell:[v,I],forceEditMode:!0})},[Fn,jt,Ra]),an=h.useCallback((v,I,T="both",_=0,N=0,G=void 0)=>{if(jt.current!==null){const W=In.current,Y=l.current,q=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,X=typeof I!="number"?I.unit==="cell"?I.amount:void 0:I,Te=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Re=typeof I!="number"&&I.unit==="px"?I.amount:void 0;if(W!==null&&Y!==null){let se={x:0,y:0,width:0,height:0},He=0,tt=0;if((q!==void 0||X!==void 0)&&(se=W.getBounds((q??0)+$,X??0)??se,se.width===0||se.height===0))return;const bt=Y.getBoundingClientRect(),ze=bt.width/Y.offsetWidth;if(Te!==void 0&&(se={...se,x:Te-bt.left-jt.current.scrollLeft,width:1}),Re!==void 0&&(se={...se,y:Re+bt.top-jt.current.scrollTop,height:1}),se!==void 0){const Fe={x:se.x-_,y:se.y-N,width:se.width+2*_,height:se.height+2*N};let Mt=0;for(let as=0;as<Ie;as++)Mt+=en[as].width;let fn=0;const dn=pe+(dr?1:0);dn>0&&(fn=Jr(vn,dn,cr));let er=Mt*ze+bt.left+$*Ar*ze,fr=bt.right,tr=bt.top+Et*ze,Cr=bt.bottom-fn*ze;const Pa=se.width+_*2;switch(G==null?void 0:G.hAlign){case"start":fr=er+Pa;break;case"end":er=fr-Pa;break;case"center":er=Math.floor((er+fr)/2)-Pa/2,fr=er+Pa;break}const za=se.height+N*2;switch(G==null?void 0:G.vAlign){case"start":Cr=tr+za;break;case"end":tr=Cr-za;break;case"center":tr=Math.floor((tr+Cr)/2)-za/2,Cr=tr+za;break}er>Fe.x?He=Fe.x-er:fr<Fe.x+Fe.width&&(He=Fe.x+Fe.width-fr),tr>Fe.y?tt=Fe.y-tr:Cr<Fe.y+Fe.height&&(tt=Fe.y+Fe.height-Cr),T==="vertical"||typeof v=="number"&&v<Ie?He=0:(T==="horizontal"||typeof I=="number"&&I>=vn-dn)&&(tt=0),(He!==0||tt!==0)&&(ze!==1&&(He/=ze,tt/=ze),jt.current.scrollTo(He+jt.current.scrollLeft,tt+jt.current.scrollTop))}}}},[$,pe,Ar,jt,Et,Ie,en,vn,dr,cr]),Md=h.useRef(Sd),Rd=h.useRef(k),Zl=h.useRef(Ue);Md.current=Sd,Rd.current=k,Zl.current=Ue;const Io=h.useCallback(async(v,I=!0)=>{var Y,q;if(((q=(Y=Ct[v])==null?void 0:Y.trailingRowOptions)==null?void 0:q.disabled)===!0)return;const T=ve==null?void 0:ve();let _,N=!0;T!==void 0&&(_=await T,_==="top"&&(N=!1),typeof _=="number"&&(N=!1));let G=0;const W=()=>{if(Zl.current<=Ue){G<500&&window.setTimeout(W,G),G=50+G*2;return}const X=typeof _=="number"?_:N?Ue:0;Ha.current(v-$,X),St({cell:[v,X],range:{x:v,y:X,width:1,height:1}},!1,!1,"edit");const Te=Rd.current([v-$,X]);Te.allowOverlay&&Po(Te)&&Te.readonly!==!0&&I&&window.setTimeout(()=>{Md.current(v,X)},0)};W()},[Ct,ve,$,Ue,St]),Ea=h.useCallback(v=>{var T,_;const I=((_=(T=en[v])==null?void 0:T.trailingRowOptions)==null?void 0:_.targetColumn)??(De==null?void 0:De.targetColumn);if(typeof I=="number")return I+(Bn?1:0);if(typeof I=="object"){const N=y.indexOf(I);if(N>=0)return N+(Bn?1:0)}},[en,y,Bn,De==null?void 0:De.targetColumn]),Nr=h.useRef(),To=h.useRef(),ui=h.useCallback((v,I)=>{var N;const[T,_]=I;return mr(Ge,(N=Ct[T])==null?void 0:N.themeOverride,$n==null?void 0:$n(_),v.themeOverride)},[$n,Ct,Ge]),{mapper:lo}=Pg(_e,w),Jn=_e==null?void 0:_e.navigationBehavior,di=h.useCallback(v=>{var Te,Re,se;const I=Bi.value?v.metaKey:v.ctrlKey,T=I&&ee==="multi",_=I&&rt==="multi",[N,G]=v.location,W=U.columns,Y=U.rows,[q,X]=((Te=U.current)==null?void 0:Te.cell)??[];if(v.kind==="cell"){if(To.current=void 0,so.current=[N,G],N===0&&Bn){if(Gt===!0&&G===Ue||xn==="number"||ee==="none")return;const He=Fn(v.location);if(He.kind!==Ln.Marker)return;if(qe!==void 0){const ze=xt(He);Tn((ze==null?void 0:ze.kind)===Ln.Marker);const Fe=(Re=ze==null?void 0:ze.onClick)==null?void 0:Re.call(ze,{...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:ui(He,v.location),preventDefault:()=>{}});if(Fe===void 0||Fe.checked===He.checked)return}i(void 0),Cn();const tt=Y.hasIndex(G),bt=Nr.current;if(ee==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&bt!==void 0&&Y.hasIndex(bt)){const ze=[Math.min(bt,G),Math.max(bt,G)+1];T||Ae==="multi"?Ce(void 0,ze,!0):Ce(vt.fromSingleSelection(ze),void 0,T)}else ee==="multi"&&(T||v.isTouch||Ae==="multi")?tt?Ce(Y.remove(G),void 0,!0):(Ce(void 0,G,!0),Nr.current=G):tt&&Y.length===1?Ce(vt.empty(),void 0,I):(Ce(vt.fromSingleSelection(G),void 0,I),Nr.current=G)}else if(N>=$&&Gt&&G===Ue){const He=Ea(N);Io(He??N)}else if(q!==N||X!==G){const He=Fn(v.location),tt=xt(He);if((tt==null?void 0:tt.onSelect)!==void 0){let Fe=!1;if(tt.onSelect({...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Fe=!0,theme:ui(He,v.location)}),Fe)return}if(Jn==="block"&&lo(G).isGroupHeader)return;const bt=dr&&G===Ue,ze=dr&&U!==void 0&&((se=U.current)==null?void 0:se.cell[1])===Ue;if((v.shiftKey||v.isLongTouch===!0)&&q!==void 0&&X!==void 0&&U.current!==void 0&&!ze){if(bt)return;const Fe=Math.min(N,q),Mt=Math.max(N,q),fn=Math.min(G,X),dn=Math.max(G,X);St({...U.current,range:{x:Fe,y:fn,width:Mt-Fe+1,height:dn-fn+1}},!0,I,"click"),Nr.current=void 0,Cn()}else St({cell:[N,G],range:{x:N,y:G,width:1,height:1}},!0,I,"click"),Nr.current=void 0,i(void 0),Cn()}}else if(v.kind==="header")if(so.current=[N,G],i(void 0),Bn&&N===0)Nr.current=void 0,To.current=void 0,ee==="multi"&&(Y.length!==Ue?Ce(vt.fromSingleSelection([0,Ue]),void 0,I):Ce(vt.empty(),void 0,I),Cn());else{const He=To.current;if(rt==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&He!==void 0&&W.hasIndex(He)){const tt=[Math.min(He,N),Math.max(He,N)+1];_?Ye(void 0,tt,I):Ye(vt.fromSingleSelection(tt),void 0,I)}else _?(W.hasIndex(N)?Ye(W.remove(N),void 0,I):Ye(void 0,N,I),To.current=N):rt!=="none"&&(Ye(vt.fromSingleSelection(N),void 0,I),To.current=N);Nr.current=void 0,Cn()}else v.kind===Vn?so.current=[N,G]:v.kind===Wi&&!v.isMaybeScrollbar&&(ye(Gi,!1),i(void 0),Cn(),Tt==null||Tt(),Nr.current=void 0,To.current=void 0)},[ee,rt,U,Bn,$,Gt,Ue,xn,Fn,qe,Cn,Ae,xt,ui,Ce,Ea,Io,Jn,lo,dr,St,Ye,ye,Tt]),hi=h.useRef(!1),so=h.useRef(),Ed=h.useRef(io),jn=h.useRef(),kw=h.useCallback(v=>{if(Oo.current=!1,Ed.current=rn.current,v.button!==0&&v.button!==1){jn.current=void 0;return}const I=performance.now();jn.current={button:v.button,time:I,location:v.location},(v==null?void 0:v.kind)==="header"&&(hi.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:U,fillHandle:T}),so.current=void 0,!v.isTouch&&v.button===0&&!T?di(v):!v.isTouch&&v.button===1&&(so.current=v.location))},[U,di]),[Jl,Ql]=h.useState(),Id=h.useCallback(v=>{if(v.kind!==Vn||rt!=="multi")return;const I=Bi.value?v.metaKey:v.ctrlKey,[T]=v.location,_=U.columns;if(T<$)return;const N=Ct[T];let G=T,W=T;for(let Y=T-1;Y>=$&&Bo(N.group,Ct[Y].group);Y--)G--;for(let Y=T+1;Y<Ct.length&&Bo(N.group,Ct[Y].group);Y++)W++;if(Cn(),I)if(_.hasAll([G,W+1])){let Y=_;for(let q=G;q<=W;q++)Y=Y.remove(q);Ye(Y,void 0,I)}else Ye(void 0,[G,W+1],I);else Ye(vt.fromSingleSelection([G,W+1]),void 0,I)},[rt,Cn,U.columns,Ct,$,Ye]),Oo=h.useRef(!1),Ia=h.useCallback(async v=>{if(cn!==void 0&&xe!==void 0){const I=rn.current.y,T=rn.current.height;let _=cn({x:v,y:I,width:1,height:Math.min(T,Ue-I)},sn.current.signal);typeof _!="object"&&(_=await _());const N=en[v-$],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=Ge.baseFontFull;const W=bc(G,Ge,N,0,_,xr,oo,!1,xt);xe==null||xe(N,W.width,v,W.width)}}},[en,cn,oo,Ge,xr,xe,$,Ue,xt]),[Sw,es]=h.useState(),Do=h.useCallback(async(v,I)=>{var Y,q;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||cn===void 0||I.current===void 0)return;const _=I.current.range;if(x!==void 0){let X=!1;if(x({fillDestination:{..._,x:_.x-$},patternSource:{...T,x:T.x-$},preventDefault:()=>X=!0}),X)return}let N=cn(T,sn.current.signal);typeof N!="object"&&(N=await N());const G=N,W=[];for(let X=0;X<_.width;X++)for(let Te=0;Te<_.height;Te++){const Re=[_.x+X,_.y+Te];if(rc(Re,T))continue;const se=G[Te%T.height][X%T.width];Wr(se)||!Po(se)||W.push({location:Re,value:{...se}})}Wn(W),(q=In.current)==null||q.damage(W.map(X=>({cell:X.location})))},[cn,Wn,x,$]),Td=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}}};Do(v,U)},[Do,U]),Od=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}}};Do(v,U)},[Do,U]),Mw=h.useCallback((v,I)=>{var Te,Re;const T=s;if(c(void 0),Kl(void 0),es(void 0),hi.current=!1,I)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((Te=T.previousSelection)==null?void 0:Te.current)!==void 0){if(ao===void 0)return;const se={...U,current:{...U.current,range:kc(T.previousSelection.current.range,ao)}};Do(T.previousSelection,se),ye(se,!0);return}const[_,N]=v.location,[G,W]=so.current??[],Y=()=>{Oo.current=!0},q=se=>{var tt,bt,ze;const He=se.isTouch||G===_&&W===N;if(He&&(S==null||S([_-$,N],{...se,preventDefault:Y})),se.button===1)return!Oo.current;if(!Oo.current){const Fe=Fn(v.location),Mt=xt(Fe);if(Mt!==void 0&&Mt.onClick!==void 0&&He){const dn=Mt.onClick({...se,cell:Fe,posX:se.localEventX,posY:se.localEventY,bounds:se.bounds,theme:ui(Fe,v.location),preventDefault:Y});dn!==void 0&&!Wr(dn)&&jr(dn)&&(Wn([{location:se.location,value:dn}]),(tt=In.current)==null||tt.damage([{cell:se.location}]))}if(Oo.current||U.current===void 0)return!1;let fn=!1;switch(Fe.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((ze=(bt=T==null?void 0:T.previousSelection)==null?void 0:bt.current)==null?void 0:ze.cell)===void 0)break;const[dn,er]=U.current.cell,[fr,tr]=T.previousSelection.current.cell;fn=_===dn&&_===fr&&N===er&&N===tr&&(se.isDoubleClick===!0||lt==="second-click");break}case"single-click":{fn=!0;break}}if(fn)return C==null||C([_-$,N]),Eo(se.bounds,!1),!0}return!1},X=v.location[0]-$;if(v.isTouch){const se=rn.current,He=Ed.current;if(se.x!==He.x||se.y!==He.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&Wo((Re=U.current)==null?void 0:Re.cell,v.location)){ne==null||ne([X,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(_)){me==null||me(X,{...v,preventDefault:Y});return}else if(v.kind===Vn){if(X<0)return;j==null||j(X,{...v,preventDefault:Y});return}}v.kind==="cell"?q(v)||di(v):v.kind===Vn?J==null||J(X,{...v,preventDefault:Y}):(v.kind===Hr&&(V==null||V(X,{...v,preventDefault:Y})),di(v));return}if(v.kind==="header"){if(X<0)return;v.isEdge?v.isDoubleClick===!0&&Ia(_):v.button===0&&_===G&&N===W&&(V==null||V(X,{...v,preventDefault:Y}))}if(v.kind===Vn){if(X<0)return;v.button===0&&_===G&&N===W&&(J==null||J(X,{...v,preventDefault:Y}),Oo.current||Id(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&q(v),so.current=void 0},[s,U,$,ao,Do,ye,S,Fn,xt,lt,ui,Wn,C,Eo,ne,me,j,di,J,V,Ia,Id]),Rw=h.useCallback(v=>{const I={...v,location:[v.location[0]-$,v.location[1]]};Pe==null||Pe(I),s!==void 0&&v.buttons===0&&(c(void 0),Kl(void 0),es(void 0),hi.current=!1),es(T=>{var _;return hi.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:s===void 0||(((_=jn.current)==null?void 0:_.location[0])??0)<$?void 0:v.scrollEdge})},[s,Pe,$]),Ew=h.useCallback((v,I)=>{Je==null||Je(v-$,I)},[Je,$]),Iw=h.useCallback((v,I)=>{mt==null||mt(v-$,I)},[mt,$]),hr=(Vd=U==null?void 0:U.current)==null?void 0:Vd.cell,Tw=h.useCallback((v,I,T,_,N,G)=>{Vr.current=!1;let W=hr;W!==void 0&&(W=[W[0]-$,W[1]]);const Y=Ie===0?void 0:{x:0,y:v.y,width:Ie,height:v.height},q=[];Y!==void 0&&q.push(Y),pe>0&&(q.push({x:v.x-$,y:Ue-pe,width:v.width,height:pe}),Ie>0&&q.push({x:0,y:Ue-pe,width:Ie,height:pe}));const X={x:v.x-$,y:v.y,width:v.width,height:Gt&&v.y+v.height>=Ue?v.height-1:v.height,tx:N,ty:G,extras:{selected:W,freezeRegion:Y,freezeRegions:q}};rn.current=X,_r(X),ln([I,T,_]),Qt==null||Qt(X,X.tx,X.ty,X.extras)},[hr,$,Gt,Ue,Ie,pe,_r,Qt]),Ow=Xr(at,h.useCallback((v,I)=>{at==null||at(v-$,I-$),rt!=="none"&&Ye(vt.fromSingleSelection(I),void 0,!0)},[rt,at,$,Ye])),ts=h.useRef(!1),Dw=h.useCallback(v=>{if(v.location[0]===0&&$>0){v.preventDefault();return}Le==null||Le({...v,location:[v.location[0]-$,v.location[1]]}),v.defaultPrevented()||(ts.current=!0),c(void 0)},[Le,$]),Hw=h.useCallback(()=>{ts.current=!1},[]),Dd=_e==null?void 0:_e.selectionBehavior,Ta=h.useCallback(v=>{if(Dd!=="block-spanning")return;const{isGroupHeader:I,path:T,groupRows:_}=lo(v);if(I)return[v,v];const N=T[T.length-1],G=v-N,W=v+_-N-1;return[G,W]},[lo,Dd]),ns=h.useRef(),rs=h.useCallback(v=>{var I,T,_;if(!Fc(v,ns.current)&&(ns.current=v,!(((I=jn==null?void 0:jn.current)==null?void 0:I.button)!==void 0&&jn.current.button>=1))){if(v.buttons!==0&&s!==void 0&&((T=jn.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&$===1&&ee==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(jn.current.location[1])&&U.rows.hasIndex(jn.current.location[1])){const N=Math.min(jn.current.location[1],v.location[1]),G=Math.max(jn.current.location[1],v.location[1])+1;Ce(vt.fromSingleSelection([N,G]),void 0,!1)}if(v.buttons!==0&&s!==void 0&&U.current!==void 0&&!ts.current&&!hi.current&&(It==="rect"||It==="multi-rect")){const[N,G]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=rn.current.y),s.fillHandle===!0&&((_=s.previousSelection)==null?void 0:_.current)!==void 0){const q=s.previousSelection.current.range;Y=Math.min(Y,Gt?Ue-1:Ue);const X=C0(q,W,Y,st);Kl(X)}else{if(Gt&&G===Ue)return;if(Gt&&Y===Ue)if(v.kind===Wi)Y--;else return;W=Math.max(W,$);const q=Ta(G);Y=q===void 0?Y:An(Y,q[0],q[1]);const X=W-N,Te=Y-G,Re={x:X>=0?N:W,y:Te>=0?G:Y,width:Math.abs(X)+1,height:Math.abs(Te)+1};St({...U.current,range:Re},!0,!1,"drag")}}$t==null||$t({...v,location:[v.location[0]-$,v.location[1]]})}},[s,$,ee,U,It,$t,Ce,Gt,Ue,st,Ta,St]),Pw=h.useCallback(()=>{var W,Y;const v=ns.current;if(v===void 0)return;const[I,T]=v.scrollEdge;let[_,N]=v.location;const G=rn.current;I===-1?_=((Y=(W=G.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??G.x:I===1&&(_=G.x+G.width),T===-1?N=Math.max(0,G.y):T===1&&(N=Math.min(Ue-1,G.y+G.height)),_=An(_,0,Ct.length-1),N=An(N,0,Ue-1),rs({...v,location:[_,N]})},[Ct.length,rs,Ue]);Ig(Sw,jt,Pw);const Qn=h.useCallback(v=>{if(U.current===void 0)return;const[I,T]=v,[_,N]=U.current.cell,G=U.current.range;let W=G.x,Y=G.x+G.width,q=G.y,X=G.y+G.height;const[Te,Re]=Ta(N)??[0,Ue-1],se=Re+1;if(T!==0)switch(T){case 2:{X=se,q=N,an(0,X,"vertical");break}case-2:{q=Te,X=N+1,an(0,q,"vertical");break}case 1:{q<N?(q++,an(0,q,"vertical")):(X=Math.min(se,X+1),an(0,X,"vertical"));break}case-1:{X>N+1?(X--,an(0,X,"vertical")):(q=Math.max(Te,q-1),an(0,q,"vertical"));break}default:Ho()}if(I!==0)if(I===2)Y=Ct.length,W=_,an(Y-1-$,0,"horizontal");else if(I===-2)W=$,Y=_+1,an(W-$,0,"horizontal");else{let He=[];if(cn!==void 0){const tt=cn({x:W,y:q,width:Y-W-$,height:X-q},sn.current.signal);typeof tt=="object"&&(He=Vg(tt))}if(I===1){let tt=!1;if(W<_){if(He.length>0){const bt=pr(W+1,_+1).find(ze=>!He.includes(ze-$));bt!==void 0&&(W=bt,tt=!0)}else W++,tt=!0;tt&&an(W,0,"horizontal")}tt||(Y=Math.min(Ct.length,Y+1),an(Y-1-$,0,"horizontal"))}else if(I===-1){let tt=!1;if(Y>_+1){if(He.length>0){const bt=pr(Y-1,_,-1).find(ze=>!He.includes(ze-$));bt!==void 0&&(Y=bt,tt=!0)}else Y--,tt=!0;tt&&an(Y-$,0,"horizontal")}tt||(W=Math.max($,W-1),an(W-$,0,"horizontal"))}else Ho()}St({cell:U.current.cell,range:{x:W,y:q,width:Y-W,height:X-q}},!0,!1,"keyboard-select")},[cn,Ta,U,Ct.length,$,Ue,an,St]),os=h.useRef(ri);os.current=ri;const $r=h.useCallback((v,I,T,_)=>{const N=vn-(T?0:1);v=An(v,$,en.length-1+$),I=An(I,0,N);const G=hr==null?void 0:hr[0],W=hr==null?void 0:hr[1];if(v===G&&I===W)return!1;if(_&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),ye({...U,current:{cell:[v,I],range:{x:v,y:I,width:1,height:1},rangeStack:Y}},!0)}else St({cell:[v,I],range:{x:v,y:I,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===I&&(u.current=void 0),os.current&&an(v-$,I),!0},[vn,$,en.length,hr,U,an,ye,St]),zw=h.useCallback((v,I)=>{(o==null?void 0:o.cell)!==void 0&&v!==void 0&&jr(v)&&(Wn([{location:o.cell,value:v}]),window.requestAnimationFrame(()=>{var N;(N=In.current)==null||N.damage([{cell:o.cell}])})),Cn(!0),i(void 0);const[T,_]=I;if(U.current!==void 0&&(T!==0||_!==0)){const N=U.current.cell[1]===vn-1&&v!==void 0;$r(An(U.current.cell[0]+T,0,Ct.length-1),An(U.current.cell[1]+_,0,vn-1),N,!1)}M==null||M(v,I)},[o==null?void 0:o.cell,Cn,U,M,Wn,vn,$r,Ct.length]),Fw=h.useMemo(()=>`gdg-overlay-${Ag++}`,[]),co=h.useCallback(v=>{var T,_,N,G,W;Cn();const I=[];for(let Y=v.x;Y<v.x+v.width;Y++)for(let q=v.y;q<v.y+v.height;q++){const X=k([Y-$,q]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let Te;if(X.kind===Z.Custom){const Re=xt(X),se=(T=Re==null?void 0:Re.provideEditor)==null?void 0:T.call(Re,X);(Re==null?void 0:Re.onDelete)!==void 0?Te=Re.onDelete(X):gs(se)&&(Te=(_=se==null?void 0:se.deletedValue)==null?void 0:_.call(se,X))}else(jr(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(Te=(G=(N=xt(X))==null?void 0:N.onDelete)==null?void 0:G.call(N,X));Te!==void 0&&!Wr(Te)&&jr(Te)&&I.push({location:[Y,q],value:Te})}Wn(I),(W=In.current)==null||W.damage(I.map(Y=>({cell:Y.location})))},[Cn,k,xt,Wn,$]),fi=o!==void 0,Hd=h.useCallback(v=>{var tt,bt;const I=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:_}=v,N=U.columns,G=U.rows,W=ur;if(!fi&&ct(W.clear,v,T))ye(Gi,!1),Tt==null||Tt();else if(!fi&&ct(W.selectAll,v,T))ye({columns:vt.empty(),rows:vt.empty(),current:{cell:((tt=U.current)==null?void 0:tt.cell)??[$,0],range:{x:$,y:0,width:y.length,height:Ue},rangeStack:[]}},!1);else if(ct(W.search,v,T))(bt=a==null?void 0:a.current)==null||bt.focus({preventScroll:!0}),So(!0);else if(ct(W.delete,v,T)){const ze=(Me==null?void 0:Me(U))??!0;if(ze!==!1){const Fe=ze===!0?U:ze;if(Fe.current!==void 0){co(Fe.current.range);for(const Mt of Fe.current.rangeStack)co(Mt)}for(const Mt of Fe.rows)co({x:$,y:Mt,width:y.length,height:1});for(const Mt of Fe.columns)co({x:Mt,y:0,width:1,height:Ue})}}if(T.didMatch)return I(),!0;if(U.current===void 0)return!1;let[Y,q]=U.current.cell;const[,X]=U.current.cell;let Te=!1,Re=!1;if(ct(W.scrollToSelectedCell,v,T)?Ha.current(Y-$,q):rt!=="none"&&ct(W.selectColumn,v,T)?N.hasIndex(Y)?Ye(N.remove(Y),void 0,!0):rt==="single"?Ye(vt.fromSingleSelection(Y),void 0,!0):Ye(void 0,Y,!0):ee!=="none"&&ct(W.selectRow,v,T)?G.hasIndex(q)?Ce(G.remove(q),void 0,!0):ee==="single"?Ce(vt.fromSingleSelection(q),void 0,!0):Ce(void 0,q,!0):!fi&&_!==void 0&&ct(W.activateCell,v,T)?q===Ue&&Gt?window.setTimeout(()=>{const ze=Ea(Y);Io(ze??Y)},0):(C==null||C([Y-$,q]),Eo(_,!0)):U.current.range.height>1&&ct(W.downFill,v,T)?Od():U.current.range.width>1&&ct(W.rightFill,v,T)?Td():ct(W.goToNextPage,v,T)?q+=Math.max(1,rn.current.height-4):ct(W.goToPreviousPage,v,T)?q-=Math.max(1,rn.current.height-4):ct(W.goToFirstCell,v,T)?(i(void 0),q=0,Y=0):ct(W.goToLastCell,v,T)?(i(void 0),q=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ct(W.selectToFirstCell,v,T)?(i(void 0),Qn([-2,-2])):ct(W.selectToLastCell,v,T)?(i(void 0),Qn([2,2])):fi?(ct(W.closeOverlay,v,T)&&i(void 0),ct(W.acceptOverlayDown,v,T)&&(i(void 0),q++),ct(W.acceptOverlayUp,v,T)&&(i(void 0),q--),ct(W.acceptOverlayLeft,v,T)&&(i(void 0),Y--),ct(W.acceptOverlayRight,v,T)&&(i(void 0),Y++)):(ct(W.goDownCell,v,T)?q+=1:ct(W.goUpCell,v,T)?q-=1:ct(W.goRightCell,v,T)?Y+=1:ct(W.goLeftCell,v,T)?Y-=1:ct(W.goDownCellRetainSelection,v,T)?(q+=1,Te=!0):ct(W.goUpCellRetainSelection,v,T)?(q-=1,Te=!0):ct(W.goRightCellRetainSelection,v,T)?(Y+=1,Te=!0):ct(W.goLeftCellRetainSelection,v,T)?(Y-=1,Te=!0):ct(W.goToLastRow,v,T)?q=Ue-1:ct(W.goToFirstRow,v,T)?q=Number.MIN_SAFE_INTEGER:ct(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ct(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(It==="rect"||It==="multi-rect")&&(ct(W.selectGrowDown,v,T)?Qn([0,1]):ct(W.selectGrowUp,v,T)?Qn([0,-1]):ct(W.selectGrowRight,v,T)?Qn([1,0]):ct(W.selectGrowLeft,v,T)?Qn([-1,0]):ct(W.selectToLastRow,v,T)?Qn([0,2]):ct(W.selectToFirstRow,v,T)?Qn([0,-2]):ct(W.selectToLastColumn,v,T)?Qn([2,0]):ct(W.selectToFirstColumn,v,T)&&Qn([-2,0])),Re=T.didMatch),Jn!==void 0&&Jn!=="normal"&&q!==X){const ze=Jn==="skip-up"||Jn==="skip"||Jn==="block",Fe=Jn==="skip-down"||Jn==="skip"||Jn==="block",Mt=q<X;if(Mt&&ze){for(;q>=0&&lo(q).isGroupHeader;)q--;q<0&&(q=X)}else if(!Mt&&Fe){for(;q<Ue&&lo(q).isGroupHeader;)q++;q>=Ue&&(q=X)}}const se=$r(Y,q,!1,Te),He=T.didMatch;return He&&(se||!Re||nn)&&I(),He},[Jn,fi,U,ur,rt,ee,It,$,lo,Ue,$r,ye,Tt,y.length,Me,nn,co,Ye,Ce,Gt,Ea,Io,C,Eo,Od,Td,Qn]),pi=h.useCallback(v=>{let I=!1;if(B!==void 0&&B({...v,cancel:()=>{I=!0}}),I||Hd(v)||U.current===void 0)return;const[T,_]=U.current.cell,N=rn.current;if(Ve&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Po(k([T-$,Math.max(0,Math.min(_,Ue-1))]))){if((!Gt||_!==Ue)&&(N.y>_||_>N.y+N.height||N.x>T||T>N.x+N.width))return;Eo(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ve,B,Hd,U,k,$,Ue,Gt,Eo]),Lw=h.useCallback((v,I)=>{const T=v.location[0]-$;if(v.kind==="header"&&(me==null||me(T,{...v,preventDefault:I})),v.kind===Vn){if(T<0)return;j==null||j(T,{...v,preventDefault:I})}if(v.kind==="cell"){const[_,N]=v.location;ne==null||ne([T,N],{...v,preventDefault:I}),rp(U,v.location)||$r(_,N,!1,!1)}},[U,ne,j,me,$,$r]),is=h.useCallback(async v=>{var W,Y,q;if(!ur.paste)return;function I(X,Te,Re,se){var tt,bt;const He=typeof Re=="object"?(Re==null?void 0:Re.join(`
172
+ `&&(n.push(r),r=[])),i=t.None);break}a++}return o<e.length&&r.push($c(e.slice(o,e.length))),n.push(r),n.map(l=>l.map(s=>({rawValue:s,formatted:s,format:"string"})))}function Bc(e,t,n){var l;const r=wg(e,t),o=s=>{var c;(c=window.navigator.clipboard)==null||c.writeText(s)},i=(s,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([s],{type:"text/plain"}),"text/html":new Blob([c],{type:"text/html"})})]),!0)},a=(s,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",s),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",c)}catch{i(s,c)||o(s)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function Wc(e){return e!==!0}function jc(e){return typeof e=="string"?e:`${e}px`}const Cg=()=>e=>e.innerWidth,kg=()=>e=>e.innerHeight,Sg=un("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[Cg()],"wmyidgi-1":[kg()]}}),Mg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return h.createElement(Sg,{innerHeight:jc(n),innerWidth:jc(t),...o},r)},Rg=2,Eg=1300;function Ig(e,t,n){const r=oe.useRef(0),[o,i]=e??[0,0];oe.useEffect(()=>{if(o===0&&i===0){r.current=0;return}let a=!1,l=0;const s=c=>{var u;if(!a){if(l===0)l=c;else{const d=c-l;r.current=Math.min(1,r.current+d/Eg);const f=r.current**1.618*d*Rg;(u=t.current)==null||u.scrollBy(o*f,i*f),l=c,n==null||n()}window.requestAnimationFrame(s)}};return window.requestAnimationFrame(s),()=>{a=!0}},[t,o,i,n])}function Tg({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:r,overscrollX:o,overscrollY:i,scaleToRem:a,remSize:l}){const[s,c,u,d,f,p]=oe.useMemo(()=>{if(!a||l===16)return[e,t,n,r,o,i];const g=l/16,m=e,b=vc();return[typeof m=="number"?m*g:y=>Math.ceil(m(y)*g),Math.ceil(t*g),Math.ceil(n*g),{...r,headerIconSize:((r==null?void 0:r.headerIconSize)??b.headerIconSize)*g,cellHorizontalPadding:((r==null?void 0:r.cellHorizontalPadding)??b.cellHorizontalPadding)*g,cellVerticalPadding:((r==null?void 0:r.cellVerticalPadding)??b.cellVerticalPadding)*g},Math.ceil((o??0)*g),Math.ceil((i??0)*g)]},[n,t,o,i,l,e,a,r]);return{rowHeight:s,headerHeight:c,groupHeaderHeight:u,theme:d,overscrollX:f,overscrollY:p}}const Pr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ut(e,t){return e===!0?t:e===!1?"":e}function Uc(e){const t=Bi.value;return{activateCell:ut(e.activateCell," |Enter|shift+Enter"),clear:ut(e.clear,"any+Escape"),closeOverlay:ut(e.closeOverlay,"any+Escape"),acceptOverlayDown:ut(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ut(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ut(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ut(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ut(e.delete,t?"Backspace|Delete":"Delete"),downFill:ut(e.downFill,"primary+_68"),scrollToSelectedCell:ut(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ut(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ut(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ut(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ut(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ut(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ut(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ut(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ut(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ut(e.goToFirstCell,"primary+Home"),goToFirstColumn:ut(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ut(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ut(e.goToLastCell,"primary+End"),goToLastColumn:ut(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ut(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ut(e.goToNextPage,"PageDown"),goToPreviousPage:ut(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ut(e.rightFill,"primary+_82"),search:ut(e.search,"primary+f"),selectAll:ut(e.selectAll,"primary+a"),selectColumn:ut(e.selectColumn,"ctrl+ "),selectGrowDown:ut(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ut(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ut(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ut(e.selectGrowUp,"shift+ArrowUp"),selectRow:ut(e.selectRow,"shift+ "),selectToFirstCell:ut(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ut(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ut(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ut(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ut(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ut(e.selectToLastRow,"primary+shift+ArrowDown")}}function Og(e){const t=Rf(e);return oe.useMemo(()=>{if(t===void 0)return Uc(Pr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Pr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Pr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Pr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Pr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Pr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Pr.selectToLastCell};return Uc({...Pr,...n})},[t])}function Dg(e){function t(n,r,o){if(typeof n=="number")return{headerIndex:n,isCollapsed:!1,depth:r,path:o};const i={headerIndex:n.headerIndex,isCollapsed:n.isCollapsed,depth:r,path:o};return n.subGroups!==void 0&&(i.subGroups=n.subGroups.map((a,l)=>t(a,r+1,[...o,l])).sort((a,l)=>a.headerIndex-l.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function fl(e,t){const n=[];function r(a,l,s=!1){let c=l!==null?l-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(c=a.subGroups[0].headerIndex-a.headerIndex),c--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:s,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:l;r(a.subGroups[u],d,s||a.isCollapsed)}}const o=Dg(e.groups);for(let a=0;a<o.length;a++){const l=a<o.length-1?o[a+1].headerIndex:null;r(o[a],l)}let i=0;for(const a of n)a.contentIndex=i,i+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:l,...s}=a;return s})}function ji(e,t){if(t===void 0||fl.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(n--,!r.isCollapsed){if(n<r.rows)return{path:[...r.path,n],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:r.contentIndex+n,groupRows:r.rows};n-=r.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function Hg(e,t,n,r){const o=oe.useMemo(()=>e===void 0?void 0:fl(e,t),[e,t]),i=oe.useMemo(()=>o===void 0?t:o.reduce((c,u)=>c+(u.isCollapsed?1:u.rows+1),0),[o,t]),a=oe.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:c=>{const{isGroupHeader:u}=ji(c,o);return u?e.height:typeof n=="number"?n:n(c)},[o,e,n]),l=oe.useCallback(c=>{if(o===void 0)return c;let u=c;for(const d of o){if(u===0)return;if(u--,!d.isCollapsed){if(u<d.rows)return d.contentIndex+u;u-=d.rows}}return c},[o]),s=Xr(r??(e==null?void 0:e.themeOverride),oe.useCallback(c=>{if(e===void 0)return r==null?void 0:r(c,c,c);if(r===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:u,contentIndex:d,groupIndex:f}=ji(c,o);return u?e.themeOverride:r==null?void 0:r(c,f,d)},[o,r,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:l,getRowThemeOverride:s}:{rowHeight:a,rows:i,rowNumberMapper:l,getRowThemeOverride:s}}function Pg(e,t){const n=oe.useMemo(()=>e===void 0?void 0:fl(e,t),[e,t]);return{getRowGroupingForPath:Gc,updateRowGroupingByPath:Yc,mapper:oe.useCallback(r=>{if(typeof r=="number")return ji(r,n);const o=ji(r[1],n);return{...o,originalIndex:[r[0],o.originalIndex]}},[n])}}function Yc(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,a)=>a===r?{...i,...n}:i):e.map((i,a)=>a===r?{...i,subGroups:Yc(i.subGroups??[],o,n)}:i)}function Gc(e,t){const[n,...r]=t;return r[0]===-1?e[n]:Gc(e[n].subGroups??[],r)}function zg(e,t){const[n]=h.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(r){const o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}));return n.callback=t,n.facade}function Fg(e,t,n,r,o){const[i,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]),l=h.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:a}),[r,a,i]),[s,c,u]=Mf(l),d=h.useRef(o);d.current=o;const f=zg(null,m=>{m!==null&&t!==void 0?m.scrollTop=t:m!==null&&e!==void 0&&(m.scrollLeft=e)}),p=(s.height??1)>1;h.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&p){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&u(),d.current()}},[t,p,u,f]);const g=(s.width??1)>1;return h.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&g){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&u(),d.current()}},[e,g,u,f]),{visibleRegion:s,setVisibleRegion:c,scrollRef:f}}const Lg=h.lazy(async()=>await cs(()=>import("./data-grid-overlay-editor-CCUG7ReD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])));let Ag=0;function Vg(e){return jp(jd(jd(e).filter(t=>t.span!==void 0).map(t=>{var n,r;return pr((((n=t.span)==null?void 0:n[0])??0)+1,(((r=t.span)==null?void 0:r[1])??0)+1)})))}function Ui(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 Yi={kind:Z.Loading,allowOverlay:!1},Gi={columns:vt.empty(),rows:vt.empty(),current:void 0},_g=(e,t)=>{var Ad,Vd,_d;const[n,r]=h.useState(Gi),[o,i]=h.useState(),a=h.useRef(null),l=h.useRef(null),[s,c]=h.useState(),u=h.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:p,markdownDivCreateNode:g,width:m,height:b,columns:y,rows:w,getCellContent:k,onCellClicked:S,onCellActivated:C,onFillPattern:x,onFinishedEditing:M,coercePasteValue:O,drawHeader:E,drawCell:H,editorBloom:A,onHeaderClicked:V,onColumnProposeMove:P,rangeSelectionColumnSpanning:L=!0,spanRangeBehavior:Q="default",onGroupHeaderClicked:J,onCellContextMenu:ne,className:Ee,onHeaderContextMenu:me,getCellsForSelection:re,onGroupHeaderContextMenu:j,onGroupHeaderRenamed:ie,onCellEdited:ae,onCellsEdited:fe,onSearchResultsChanged:ge,searchResults:K,onSearchValueChange:D,searchValue:R,onKeyDown:B,onKeyUp:ce,keybindings:Oe,editOnType:Ve=!0,onRowAppended:ve,onColumnMoved:at,validateCell:be,highlightRegions:Ot,rangeSelect:It="rect",columnSelect:rt="multi",rowSelect:ee="multi",rangeSelectionBlending:nt="exclusive",columnSelectionBlending:we="exclusive",rowSelectionBlending:le="exclusive",onDelete:he,onDragStart:Le,onMouseMove:Pe,onPaste:Ke,copyHeaders:ue=!1,freezeColumns:Ie=0,cellActivationBehavior:lt="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:Je,onHeaderIndicatorClick:mt,getGroupDetails:gt,rowGrouping:_e,onSearchClose:Ht,onItemHovered:$t,onSelectionCleared:Tt,showSearch:At,onVisibleRegionChanged:Qt,gridSelection:Pt,onGridSelectionChange:kn,minColumnWidth:Bt=50,maxColumnWidth:Rt=500,maxColumnAutoWidth:Sn,provideEditor:wn,trailingRowOptions:De,freezeTrailingRows:pe=0,allowedFillDirections:st="orthogonal",scrollOffsetX:Xt,scrollOffsetY:on,verticalBorder:Ne,onDragOverCell:Vt,onDrop:_t,onColumnResize:Kt,onColumnResizeEnd:yt,onColumnResizeStart:Dt,customRenderers:Qe,fillHandle:qt,experimental:Ut,fixedShadowX:Yt,fixedShadowY:Zt,headerIcons:_n,imageWindowLoader:no,initialSize:sr,isDraggable:F,onDragLeave:et,onRowMoved:qe,overscrollX:Wt,overscrollY:Hn,preventDiagonalScrolling:yn,rightElement:Kn,rightElementProps:Pn,trapFocus:nn=!1,smoothScrollX:Nn,smoothScrollY:qn,scaleToRem:Wl=!1,rowHeight:fa=34,headerHeight:pa=36,groupHeaderHeight:jl=pa,theme:Co,isOutsideClick:zr,renderers:ni,resizeIndicator:Ul,scrollToActiveCell:ri=!0,drawFocusRing:oi=!0}=e,ro=oi==="no-editor"?o===void 0:oi,Jt=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,xn=(Jt==null?void 0:Jt.kind)??e.rowMarkers??"none",ga=(Jt==null?void 0:Jt.width)??e.rowMarkerWidth,ii=(Jt==null?void 0:Jt.startIndex)??e.rowMarkerStartIndex??1,wr=(Jt==null?void 0:Jt.theme)??e.rowMarkerTheme,yr=Jt==null?void 0:Jt.headerTheme,ko=Jt==null?void 0:Jt.headerAlwaysVisible,Fr=ee!=="multi",Lr=(Jt==null?void 0:Jt.checkboxStyle)??"square",xr=Math.max(Bt,20),oo=Math.max(Rt,xr),ma=Math.max(Sn??oo,xr),va=h.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Ue,rowNumberMapper:ai,rowHeight:ba,getRowThemeOverride:$n}=Hg(_e,w,fa,p),wa=h.useMemo(()=>Number.parseFloat(va.fontSize),[va]),{rowHeight:cr,headerHeight:li,groupHeaderHeight:ya,theme:xa,overscrollX:Yl,overscrollY:si}=Tg({groupHeaderHeight:jl,headerHeight:pa,overscrollX:Wt,overscrollY:Hn,remSize:wa,rowHeight:ba,scaleToRem:Wl,theme:Co}),ur=Og(Oe),Ar=ga??(w>1e4?48:w>1e3?44:w>100?36:32),Bn=xn!=="none",$=Bn?1:0,Gt=ve!==void 0,dr=(De==null?void 0:De.sticky)===!0,[ci,So]=h.useState(!1),Gl=At??ci,Mo=h.useCallback(()=>{Ht!==void 0?Ht():So(!1)},[Ht]),U=h.useMemo(()=>Pt===void 0?void 0:Ui(Pt,$),[Pt,$])??n,sn=h.useRef();sn.current===void 0&&(sn.current=new AbortController),h.useEffect(()=>()=>sn==null?void 0:sn.current.abort(),[]);const[cn,Xl]=fg(re,k,$,sn.current,Ue),z=h.useCallback((v,I,T)=>{if(be===void 0)return!0;const _=[v[0]-$,v[1]];return be==null?void 0:be(_,I,T)},[$,be]),te=h.useRef(Pt),ye=h.useCallback((v,I)=>{I&&(v=yg(v,cn,$,Q,sn.current)),kn!==void 0?(te.current=Ui(v,-$),kn(te.current)):r(v)},[kn,cn,$,Q]),xe=Xr(Kt,h.useCallback((v,I,T,_)=>{Kt==null||Kt(y[T-$],I,T-$,_)},[Kt,$,y])),de=Xr(yt,h.useCallback((v,I,T,_)=>{yt==null||yt(y[T-$],I,T-$,_)},[yt,$,y])),ke=Xr(Dt,h.useCallback((v,I,T,_)=>{Dt==null||Dt(y[T-$],I,T-$,_)},[Dt,$,y])),ot=Xr(E,h.useCallback((v,I)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-$},I))??!1,[E,$])),it=Xr(H,h.useCallback((v,I)=>(H==null?void 0:H({...v,col:v.col-$},I))??!1,[H,$])),Me=h.useCallback(v=>{if(he!==void 0){const I=he(Ui(v,-$));return typeof I=="boolean"?I:Ui(I,$)}return!0},[he,$]),[St,Ce,Ye]=hg(U,ye,nt,we,le,It,L),Ge=h.useMemo(()=>mr(vc(),xa),[xa]),[ft,ln]=h.useState([0,0,0]),Mn=h.useMemo(()=>{if(ni===void 0)return{};const v={};for(const I of ni)v[I.kind]=I;return v},[ni]),xt=h.useCallback(v=>v.kind!==Z.Custom?Mn[v.kind]:Qe==null?void 0:Qe.find(I=>I.isMatch(v)),[Qe,Mn]);let{sizedColumns:en,nonGrowWidth:Zn}=wp(y,Ue,Xl,ft[0]-($===0?0:Ar)-ft[2],xr,ma,Ge,xt,sn.current);xn!=="none"&&(Zn+=Ar);const Rn=h.useMemo(()=>en.some(v=>v.group!==void 0),[en]),Et=Rn?li+ya:li,En=U.rows.length,zn=xn==="none"?void 0:En===0?!1:En===Ue?!0:void 0,Ct=h.useMemo(()=>xn==="none"?en:[{title:"",width:Ar,icon:void 0,hasMenu:!1,style:"normal",themeOverride:wr,rowMarker:Lr,rowMarkerChecked:zn,headerRowMarkerTheme:yr,headerRowMarkerAlwaysVisible:ko,headerRowMarkerDisabled:Fr},...en],[xn,en,Ar,wr,Lr,zn,yr,ko,Fr]),rn=h.useRef({height:1,width:1,x:0,y:0}),Vr=h.useRef(!1),{setVisibleRegion:_r,visibleRegion:io,scrollRef:jt}=Fg(Xt,on,cr,rn,()=>Vr.current=!0);rn.current=io;const xw=io.x+$,Ca=io.y,In=h.useRef(null),Cn=h.useCallback(v=>{var I;v===!0?(I=In.current)==null||I.focus():window.requestAnimationFrame(()=>{var T;(T=In.current)==null||T.focus()})},[]),vn=Gt?Ue+1:Ue,Wn=h.useCallback(v=>{const I=$===0?v:v.map(_=>({..._,location:[_.location[0]-$,_.location[1]]})),T=fe==null?void 0:fe(I);if(T!==!0)for(const _ of I)ae==null||ae(_.location,_.value);return T},[ae,fe,$]),[ao,Kl]=h.useState(),ka=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,Ro=ro?(Ad=U.current)==null?void 0:Ad.cell:void 0,Sa=Ro==null?void 0:Ro[0],Ma=Ro==null?void 0:Ro[1],Cw=h.useMemo(()=>{if((Ot===void 0||Ot.length===0)&&(ka??Sa??Ma??ao)===void 0)return;const v=[];if(Ot!==void 0)for(const I of Ot){const T=Ct.length-I.range.x-$;T>0&&v.push({color:I.color,range:{...I.range,x:I.range.x+$,width:Math.min(T,I.range.width)},style:I.style})}return ao!==void 0&&v.push({color:Zr(Ge.accentColor,0),range:ao,style:"dashed"}),ka!==void 0&&v.push({color:Zr(Ge.accentColor,.5),range:ka,style:"solid-outline"}),Sa!==void 0&&Ma!==void 0&&v.push({color:Ge.accentColor,range:{x:Sa,y:Ma,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[ao,ka,Sa,Ma,Ot,Ct.length,Ge.accentColor,$]),kd=h.useRef(Ct);kd.current=Ct;const Fn=h.useCallback(([v,I],T=!1)=>{var N,G,W,Y,q,X,Te;const _=Gt&&I===vn-1;if(v===0&&Bn){if(_)return Yi;const Re=ai(I);return Re===void 0?Yi:{kind:Ln.Marker,allowOverlay:!1,checkboxStyle:Lr,checked:(U==null?void 0:U.rows.hasIndex(I))===!0,markerKind:xn==="clickable-number"?"number":xn,row:ii+Re,drawHandle:qe!==void 0,cursor:xn==="clickable-number"?"pointer":void 0}}else if(_){const Re=v===$?(De==null?void 0:De.hint)??"":"",se=kd.current[v];if(((N=se==null?void 0:se.trailingRowOptions)==null?void 0:N.disabled)===!0)return Yi;{const He=((G=se==null?void 0:se.trailingRowOptions)==null?void 0:G.hint)??Re,tt=((W=se==null?void 0:se.trailingRowOptions)==null?void 0:W.addIcon)??(De==null?void 0:De.addIcon);return{kind:Ln.NewRow,hint:He,allowOverlay:!1,icon:tt}}}else{const Re=v-$;if(T||(Ut==null?void 0:Ut.strict)===!0){const He=rn.current,tt=He.x>Re||Re>He.x+He.width||He.y>I||I>He.y+He.height||I>=Zl.current,bt=Re===((q=(Y=He.extras)==null?void 0:Y.selected)==null?void 0:q[0])&&I===((X=He.extras)==null?void 0:X.selected[1]);let ze=!1;if(((Te=He.extras)==null?void 0:Te.freezeRegions)!==void 0){for(const Fe of He.extras.freezeRegions)if(eo(Fe,Re,I)){ze=!0;break}}if(tt&&!bt&&!ze)return Yi}let se=k([Re,I]);return $!==0&&se.span!==void 0&&(se={...se,span:[se.span[0]+$,se.span[1]+$]}),se}},[Gt,vn,Bn,ai,Lr,U==null?void 0:U.rows,xn,ii,qe,$,De==null?void 0:De.hint,De==null?void 0:De.addIcon,Ut==null?void 0:Ut.strict,k]),ql=h.useCallback(v=>{let I=(gt==null?void 0:gt(v))??{name:v};return ie!==void 0&&v!==""&&(I={icon:I.icon,name:I.name,overrideTheme:I.overrideTheme,actions:[...I.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ql({group:I.name,bounds:T.bounds})}]}),I},[gt,ie]),Ra=h.useCallback(v=>{var Y;const[I,T]=v.cell,_=Ct[I],N=(_==null?void 0:_.group)!==void 0?(Y=ql(_.group))==null?void 0:Y.overrideTheme:void 0,G=_==null?void 0:_.themeOverride,W=$n==null?void 0:$n(T);i({...v,theme:mr(Ge,N,G,W,v.content.themeOverride)})},[$n,Ct,ql,Ge]),Eo=h.useCallback((v,I,T)=>{var W;if(U.current===void 0)return;const[_,N]=U.current.cell,G=Fn([_,N]);if(G.kind!==Z.Boolean&&G.allowOverlay){let Y=G;if(T!==void 0)switch(Y.kind){case Z.Number:{const q=th(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(q)?0:q};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Ra({target:v,content:Y,initialValue:T,cell:[_,N],highlight:T===void 0,forceEditMode:T!==void 0})}else G.kind===Z.Boolean&&I&&G.readonly!==!0&&(Wn([{location:U.current.cell,value:{...G,data:Wc(G.data)}}]),(W=In.current)==null||W.damage([{cell:U.current.cell}]))},[Fn,U,Wn,Ra]),Sd=h.useCallback((v,I)=>{var N;const T=(N=In.current)==null?void 0:N.getBounds(v,I);if(T===void 0||jt.current===null)return;const _=Fn([v,I]);_.allowOverlay&&Ra({target:T,content:_,initialValue:void 0,highlight:!0,cell:[v,I],forceEditMode:!0})},[Fn,jt,Ra]),an=h.useCallback((v,I,T="both",_=0,N=0,G=void 0)=>{if(jt.current!==null){const W=In.current,Y=l.current,q=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,X=typeof I!="number"?I.unit==="cell"?I.amount:void 0:I,Te=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Re=typeof I!="number"&&I.unit==="px"?I.amount:void 0;if(W!==null&&Y!==null){let se={x:0,y:0,width:0,height:0},He=0,tt=0;if((q!==void 0||X!==void 0)&&(se=W.getBounds((q??0)+$,X??0)??se,se.width===0||se.height===0))return;const bt=Y.getBoundingClientRect(),ze=bt.width/Y.offsetWidth;if(Te!==void 0&&(se={...se,x:Te-bt.left-jt.current.scrollLeft,width:1}),Re!==void 0&&(se={...se,y:Re+bt.top-jt.current.scrollTop,height:1}),se!==void 0){const Fe={x:se.x-_,y:se.y-N,width:se.width+2*_,height:se.height+2*N};let Mt=0;for(let as=0;as<Ie;as++)Mt+=en[as].width;let fn=0;const dn=pe+(dr?1:0);dn>0&&(fn=Jr(vn,dn,cr));let er=Mt*ze+bt.left+$*Ar*ze,fr=bt.right,tr=bt.top+Et*ze,Cr=bt.bottom-fn*ze;const Pa=se.width+_*2;switch(G==null?void 0:G.hAlign){case"start":fr=er+Pa;break;case"end":er=fr-Pa;break;case"center":er=Math.floor((er+fr)/2)-Pa/2,fr=er+Pa;break}const za=se.height+N*2;switch(G==null?void 0:G.vAlign){case"start":Cr=tr+za;break;case"end":tr=Cr-za;break;case"center":tr=Math.floor((tr+Cr)/2)-za/2,Cr=tr+za;break}er>Fe.x?He=Fe.x-er:fr<Fe.x+Fe.width&&(He=Fe.x+Fe.width-fr),tr>Fe.y?tt=Fe.y-tr:Cr<Fe.y+Fe.height&&(tt=Fe.y+Fe.height-Cr),T==="vertical"||typeof v=="number"&&v<Ie?He=0:(T==="horizontal"||typeof I=="number"&&I>=vn-dn)&&(tt=0),(He!==0||tt!==0)&&(ze!==1&&(He/=ze,tt/=ze),jt.current.scrollTo(He+jt.current.scrollLeft,tt+jt.current.scrollTop))}}}},[$,pe,Ar,jt,Et,Ie,en,vn,dr,cr]),Md=h.useRef(Sd),Rd=h.useRef(k),Zl=h.useRef(Ue);Md.current=Sd,Rd.current=k,Zl.current=Ue;const Io=h.useCallback(async(v,I=!0)=>{var Y,q;if(((q=(Y=Ct[v])==null?void 0:Y.trailingRowOptions)==null?void 0:q.disabled)===!0)return;const T=ve==null?void 0:ve();let _,N=!0;T!==void 0&&(_=await T,_==="top"&&(N=!1),typeof _=="number"&&(N=!1));let G=0;const W=()=>{if(Zl.current<=Ue){G<500&&window.setTimeout(W,G),G=50+G*2;return}const X=typeof _=="number"?_:N?Ue:0;Ha.current(v-$,X),St({cell:[v,X],range:{x:v,y:X,width:1,height:1}},!1,!1,"edit");const Te=Rd.current([v-$,X]);Te.allowOverlay&&Po(Te)&&Te.readonly!==!0&&I&&window.setTimeout(()=>{Md.current(v,X)},0)};W()},[Ct,ve,$,Ue,St]),Ea=h.useCallback(v=>{var T,_;const I=((_=(T=en[v])==null?void 0:T.trailingRowOptions)==null?void 0:_.targetColumn)??(De==null?void 0:De.targetColumn);if(typeof I=="number")return I+(Bn?1:0);if(typeof I=="object"){const N=y.indexOf(I);if(N>=0)return N+(Bn?1:0)}},[en,y,Bn,De==null?void 0:De.targetColumn]),Nr=h.useRef(),To=h.useRef(),ui=h.useCallback((v,I)=>{var N;const[T,_]=I;return mr(Ge,(N=Ct[T])==null?void 0:N.themeOverride,$n==null?void 0:$n(_),v.themeOverride)},[$n,Ct,Ge]),{mapper:lo}=Pg(_e,w),Jn=_e==null?void 0:_e.navigationBehavior,di=h.useCallback(v=>{var Te,Re,se;const I=Bi.value?v.metaKey:v.ctrlKey,T=I&&ee==="multi",_=I&&rt==="multi",[N,G]=v.location,W=U.columns,Y=U.rows,[q,X]=((Te=U.current)==null?void 0:Te.cell)??[];if(v.kind==="cell"){if(To.current=void 0,so.current=[N,G],N===0&&Bn){if(Gt===!0&&G===Ue||xn==="number"||ee==="none")return;const He=Fn(v.location);if(He.kind!==Ln.Marker)return;if(qe!==void 0){const ze=xt(He);Tn((ze==null?void 0:ze.kind)===Ln.Marker);const Fe=(Re=ze==null?void 0:ze.onClick)==null?void 0:Re.call(ze,{...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:ui(He,v.location),preventDefault:()=>{}});if(Fe===void 0||Fe.checked===He.checked)return}i(void 0),Cn();const tt=Y.hasIndex(G),bt=Nr.current;if(ee==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&bt!==void 0&&Y.hasIndex(bt)){const ze=[Math.min(bt,G),Math.max(bt,G)+1];T||Ae==="multi"?Ce(void 0,ze,!0):Ce(vt.fromSingleSelection(ze),void 0,T)}else ee==="multi"&&(T||v.isTouch||Ae==="multi")?tt?Ce(Y.remove(G),void 0,!0):(Ce(void 0,G,!0),Nr.current=G):tt&&Y.length===1?Ce(vt.empty(),void 0,I):(Ce(vt.fromSingleSelection(G),void 0,I),Nr.current=G)}else if(N>=$&&Gt&&G===Ue){const He=Ea(N);Io(He??N)}else if(q!==N||X!==G){const He=Fn(v.location),tt=xt(He);if((tt==null?void 0:tt.onSelect)!==void 0){let Fe=!1;if(tt.onSelect({...v,cell:He,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>Fe=!0,theme:ui(He,v.location)}),Fe)return}if(Jn==="block"&&lo(G).isGroupHeader)return;const bt=dr&&G===Ue,ze=dr&&U!==void 0&&((se=U.current)==null?void 0:se.cell[1])===Ue;if((v.shiftKey||v.isLongTouch===!0)&&q!==void 0&&X!==void 0&&U.current!==void 0&&!ze){if(bt)return;const Fe=Math.min(N,q),Mt=Math.max(N,q),fn=Math.min(G,X),dn=Math.max(G,X);St({...U.current,range:{x:Fe,y:fn,width:Mt-Fe+1,height:dn-fn+1}},!0,I,"click"),Nr.current=void 0,Cn()}else St({cell:[N,G],range:{x:N,y:G,width:1,height:1}},!0,I,"click"),Nr.current=void 0,i(void 0),Cn()}}else if(v.kind==="header")if(so.current=[N,G],i(void 0),Bn&&N===0)Nr.current=void 0,To.current=void 0,ee==="multi"&&(Y.length!==Ue?Ce(vt.fromSingleSelection([0,Ue]),void 0,I):Ce(vt.empty(),void 0,I),Cn());else{const He=To.current;if(rt==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&He!==void 0&&W.hasIndex(He)){const tt=[Math.min(He,N),Math.max(He,N)+1];_?Ye(void 0,tt,I):Ye(vt.fromSingleSelection(tt),void 0,I)}else _?(W.hasIndex(N)?Ye(W.remove(N),void 0,I):Ye(void 0,N,I),To.current=N):rt!=="none"&&(Ye(vt.fromSingleSelection(N),void 0,I),To.current=N);Nr.current=void 0,Cn()}else v.kind===Vn?so.current=[N,G]:v.kind===Wi&&!v.isMaybeScrollbar&&(ye(Gi,!1),i(void 0),Cn(),Tt==null||Tt(),Nr.current=void 0,To.current=void 0)},[ee,rt,U,Bn,$,Gt,Ue,xn,Fn,qe,Cn,Ae,xt,ui,Ce,Ea,Io,Jn,lo,dr,St,Ye,ye,Tt]),hi=h.useRef(!1),so=h.useRef(),Ed=h.useRef(io),jn=h.useRef(),kw=h.useCallback(v=>{if(Oo.current=!1,Ed.current=rn.current,v.button!==0&&v.button!==1){jn.current=void 0;return}const I=performance.now();jn.current={button:v.button,time:I,location:v.location},(v==null?void 0:v.kind)==="header"&&(hi.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(c({previousSelection:U,fillHandle:T}),so.current=void 0,!v.isTouch&&v.button===0&&!T?di(v):!v.isTouch&&v.button===1&&(so.current=v.location))},[U,di]),[Jl,Ql]=h.useState(),Id=h.useCallback(v=>{if(v.kind!==Vn||rt!=="multi")return;const I=Bi.value?v.metaKey:v.ctrlKey,[T]=v.location,_=U.columns;if(T<$)return;const N=Ct[T];let G=T,W=T;for(let Y=T-1;Y>=$&&Bo(N.group,Ct[Y].group);Y--)G--;for(let Y=T+1;Y<Ct.length&&Bo(N.group,Ct[Y].group);Y++)W++;if(Cn(),I)if(_.hasAll([G,W+1])){let Y=_;for(let q=G;q<=W;q++)Y=Y.remove(q);Ye(Y,void 0,I)}else Ye(void 0,[G,W+1],I);else Ye(vt.fromSingleSelection([G,W+1]),void 0,I)},[rt,Cn,U.columns,Ct,$,Ye]),Oo=h.useRef(!1),Ia=h.useCallback(async v=>{if(cn!==void 0&&xe!==void 0){const I=rn.current.y,T=rn.current.height;let _=cn({x:v,y:I,width:1,height:Math.min(T,Ue-I)},sn.current.signal);typeof _!="object"&&(_=await _());const N=en[v-$],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=Ge.baseFontFull;const W=bc(G,Ge,N,0,_,xr,oo,!1,xt);xe==null||xe(N,W.width,v,W.width)}}},[en,cn,oo,Ge,xr,xe,$,Ue,xt]),[Sw,es]=h.useState(),Do=h.useCallback(async(v,I)=>{var Y,q;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||cn===void 0||I.current===void 0)return;const _=I.current.range;if(x!==void 0){let X=!1;if(x({fillDestination:{..._,x:_.x-$},patternSource:{...T,x:T.x-$},preventDefault:()=>X=!0}),X)return}let N=cn(T,sn.current.signal);typeof N!="object"&&(N=await N());const G=N,W=[];for(let X=0;X<_.width;X++)for(let Te=0;Te<_.height;Te++){const Re=[_.x+X,_.y+Te];if(rc(Re,T))continue;const se=G[Te%T.height][X%T.width];Wr(se)||!Po(se)||W.push({location:Re,value:{...se}})}Wn(W),(q=In.current)==null||q.damage(W.map(X=>({cell:X.location})))},[cn,Wn,x,$]),Td=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}}};Do(v,U)},[Do,U]),Od=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}}};Do(v,U)},[Do,U]),Mw=h.useCallback((v,I)=>{var Te,Re;const T=s;if(c(void 0),Kl(void 0),es(void 0),hi.current=!1,I)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((Te=T.previousSelection)==null?void 0:Te.current)!==void 0){if(ao===void 0)return;const se={...U,current:{...U.current,range:kc(T.previousSelection.current.range,ao)}};Do(T.previousSelection,se),ye(se,!0);return}const[_,N]=v.location,[G,W]=so.current??[],Y=()=>{Oo.current=!0},q=se=>{var tt,bt,ze;const He=se.isTouch||G===_&&W===N;if(He&&(S==null||S([_-$,N],{...se,preventDefault:Y})),se.button===1)return!Oo.current;if(!Oo.current){const Fe=Fn(v.location),Mt=xt(Fe);if(Mt!==void 0&&Mt.onClick!==void 0&&He){const dn=Mt.onClick({...se,cell:Fe,posX:se.localEventX,posY:se.localEventY,bounds:se.bounds,theme:ui(Fe,v.location),preventDefault:Y});dn!==void 0&&!Wr(dn)&&jr(dn)&&(Wn([{location:se.location,value:dn}]),(tt=In.current)==null||tt.damage([{cell:se.location}]))}if(Oo.current||U.current===void 0)return!1;let fn=!1;switch(Fe.activationBehaviorOverride??lt){case"double-click":case"second-click":{if(((ze=(bt=T==null?void 0:T.previousSelection)==null?void 0:bt.current)==null?void 0:ze.cell)===void 0)break;const[dn,er]=U.current.cell,[fr,tr]=T.previousSelection.current.cell;fn=_===dn&&_===fr&&N===er&&N===tr&&(se.isDoubleClick===!0||lt==="second-click");break}case"single-click":{fn=!0;break}}if(fn)return C==null||C([_-$,N]),Eo(se.bounds,!1),!0}return!1},X=v.location[0]-$;if(v.isTouch){const se=rn.current,He=Ed.current;if(se.x!==He.x||se.y!==He.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&Wo((Re=U.current)==null?void 0:Re.cell,v.location)){ne==null||ne([X,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(_)){me==null||me(X,{...v,preventDefault:Y});return}else if(v.kind===Vn){if(X<0)return;j==null||j(X,{...v,preventDefault:Y});return}}v.kind==="cell"?q(v)||di(v):v.kind===Vn?J==null||J(X,{...v,preventDefault:Y}):(v.kind===Hr&&(V==null||V(X,{...v,preventDefault:Y})),di(v));return}if(v.kind==="header"){if(X<0)return;v.isEdge?v.isDoubleClick===!0&&Ia(_):v.button===0&&_===G&&N===W&&(V==null||V(X,{...v,preventDefault:Y}))}if(v.kind===Vn){if(X<0)return;v.button===0&&_===G&&N===W&&(J==null||J(X,{...v,preventDefault:Y}),Oo.current||Id(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&q(v),so.current=void 0},[s,U,$,ao,Do,ye,S,Fn,xt,lt,ui,Wn,C,Eo,ne,me,j,di,J,V,Ia,Id]),Rw=h.useCallback(v=>{const I={...v,location:[v.location[0]-$,v.location[1]]};Pe==null||Pe(I),s!==void 0&&v.buttons===0&&(c(void 0),Kl(void 0),es(void 0),hi.current=!1),es(T=>{var _;return hi.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:s===void 0||(((_=jn.current)==null?void 0:_.location[0])??0)<$?void 0:v.scrollEdge})},[s,Pe,$]),Ew=h.useCallback((v,I)=>{Je==null||Je(v-$,I)},[Je,$]),Iw=h.useCallback((v,I)=>{mt==null||mt(v-$,I)},[mt,$]),hr=(Vd=U==null?void 0:U.current)==null?void 0:Vd.cell,Tw=h.useCallback((v,I,T,_,N,G)=>{Vr.current=!1;let W=hr;W!==void 0&&(W=[W[0]-$,W[1]]);const Y=Ie===0?void 0:{x:0,y:v.y,width:Ie,height:v.height},q=[];Y!==void 0&&q.push(Y),pe>0&&(q.push({x:v.x-$,y:Ue-pe,width:v.width,height:pe}),Ie>0&&q.push({x:0,y:Ue-pe,width:Ie,height:pe}));const X={x:v.x-$,y:v.y,width:v.width,height:Gt&&v.y+v.height>=Ue?v.height-1:v.height,tx:N,ty:G,extras:{selected:W,freezeRegion:Y,freezeRegions:q}};rn.current=X,_r(X),ln([I,T,_]),Qt==null||Qt(X,X.tx,X.ty,X.extras)},[hr,$,Gt,Ue,Ie,pe,_r,Qt]),Ow=Xr(at,h.useCallback((v,I)=>{at==null||at(v-$,I-$),rt!=="none"&&Ye(vt.fromSingleSelection(I),void 0,!0)},[rt,at,$,Ye])),ts=h.useRef(!1),Dw=h.useCallback(v=>{if(v.location[0]===0&&$>0){v.preventDefault();return}Le==null||Le({...v,location:[v.location[0]-$,v.location[1]]}),v.defaultPrevented()||(ts.current=!0),c(void 0)},[Le,$]),Hw=h.useCallback(()=>{ts.current=!1},[]),Dd=_e==null?void 0:_e.selectionBehavior,Ta=h.useCallback(v=>{if(Dd!=="block-spanning")return;const{isGroupHeader:I,path:T,groupRows:_}=lo(v);if(I)return[v,v];const N=T[T.length-1],G=v-N,W=v+_-N-1;return[G,W]},[lo,Dd]),ns=h.useRef(),rs=h.useCallback(v=>{var I,T,_;if(!Fc(v,ns.current)&&(ns.current=v,!(((I=jn==null?void 0:jn.current)==null?void 0:I.button)!==void 0&&jn.current.button>=1))){if(v.buttons!==0&&s!==void 0&&((T=jn.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&$===1&&ee==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(jn.current.location[1])&&U.rows.hasIndex(jn.current.location[1])){const N=Math.min(jn.current.location[1],v.location[1]),G=Math.max(jn.current.location[1],v.location[1])+1;Ce(vt.fromSingleSelection([N,G]),void 0,!1)}if(v.buttons!==0&&s!==void 0&&U.current!==void 0&&!ts.current&&!hi.current&&(It==="rect"||It==="multi-rect")){const[N,G]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=rn.current.y),s.fillHandle===!0&&((_=s.previousSelection)==null?void 0:_.current)!==void 0){const q=s.previousSelection.current.range;Y=Math.min(Y,Gt?Ue-1:Ue);const X=C0(q,W,Y,st);Kl(X)}else{if(Gt&&G===Ue)return;if(Gt&&Y===Ue)if(v.kind===Wi)Y--;else return;W=Math.max(W,$);const q=Ta(G);Y=q===void 0?Y:An(Y,q[0],q[1]);const X=W-N,Te=Y-G,Re={x:X>=0?N:W,y:Te>=0?G:Y,width:Math.abs(X)+1,height:Math.abs(Te)+1};St({...U.current,range:Re},!0,!1,"drag")}}$t==null||$t({...v,location:[v.location[0]-$,v.location[1]]})}},[s,$,ee,U,It,$t,Ce,Gt,Ue,st,Ta,St]),Pw=h.useCallback(()=>{var W,Y;const v=ns.current;if(v===void 0)return;const[I,T]=v.scrollEdge;let[_,N]=v.location;const G=rn.current;I===-1?_=((Y=(W=G.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??G.x:I===1&&(_=G.x+G.width),T===-1?N=Math.max(0,G.y):T===1&&(N=Math.min(Ue-1,G.y+G.height)),_=An(_,0,Ct.length-1),N=An(N,0,Ue-1),rs({...v,location:[_,N]})},[Ct.length,rs,Ue]);Ig(Sw,jt,Pw);const Qn=h.useCallback(v=>{if(U.current===void 0)return;const[I,T]=v,[_,N]=U.current.cell,G=U.current.range;let W=G.x,Y=G.x+G.width,q=G.y,X=G.y+G.height;const[Te,Re]=Ta(N)??[0,Ue-1],se=Re+1;if(T!==0)switch(T){case 2:{X=se,q=N,an(0,X,"vertical");break}case-2:{q=Te,X=N+1,an(0,q,"vertical");break}case 1:{q<N?(q++,an(0,q,"vertical")):(X=Math.min(se,X+1),an(0,X,"vertical"));break}case-1:{X>N+1?(X--,an(0,X,"vertical")):(q=Math.max(Te,q-1),an(0,q,"vertical"));break}default:Ho()}if(I!==0)if(I===2)Y=Ct.length,W=_,an(Y-1-$,0,"horizontal");else if(I===-2)W=$,Y=_+1,an(W-$,0,"horizontal");else{let He=[];if(cn!==void 0){const tt=cn({x:W,y:q,width:Y-W-$,height:X-q},sn.current.signal);typeof tt=="object"&&(He=Vg(tt))}if(I===1){let tt=!1;if(W<_){if(He.length>0){const bt=pr(W+1,_+1).find(ze=>!He.includes(ze-$));bt!==void 0&&(W=bt,tt=!0)}else W++,tt=!0;tt&&an(W,0,"horizontal")}tt||(Y=Math.min(Ct.length,Y+1),an(Y-1-$,0,"horizontal"))}else if(I===-1){let tt=!1;if(Y>_+1){if(He.length>0){const bt=pr(Y-1,_,-1).find(ze=>!He.includes(ze-$));bt!==void 0&&(Y=bt,tt=!0)}else Y--,tt=!0;tt&&an(Y-$,0,"horizontal")}tt||(W=Math.max($,W-1),an(W-$,0,"horizontal"))}else Ho()}St({cell:U.current.cell,range:{x:W,y:q,width:Y-W,height:X-q}},!0,!1,"keyboard-select")},[cn,Ta,U,Ct.length,$,Ue,an,St]),os=h.useRef(ri);os.current=ri;const $r=h.useCallback((v,I,T,_)=>{const N=vn-(T?0:1);v=An(v,$,en.length-1+$),I=An(I,0,N);const G=hr==null?void 0:hr[0],W=hr==null?void 0:hr[1];if(v===G&&I===W)return!1;if(_&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),ye({...U,current:{cell:[v,I],range:{x:v,y:I,width:1,height:1},rangeStack:Y}},!0)}else St({cell:[v,I],range:{x:v,y:I,width:1,height:1}},!0,!1,"keyboard-nav");return u.current!==void 0&&u.current[0]===v&&u.current[1]===I&&(u.current=void 0),os.current&&an(v-$,I),!0},[vn,$,en.length,hr,U,an,ye,St]),zw=h.useCallback((v,I)=>{(o==null?void 0:o.cell)!==void 0&&v!==void 0&&jr(v)&&(Wn([{location:o.cell,value:v}]),window.requestAnimationFrame(()=>{var N;(N=In.current)==null||N.damage([{cell:o.cell}])})),Cn(!0),i(void 0);const[T,_]=I;if(U.current!==void 0&&(T!==0||_!==0)){const N=U.current.cell[1]===vn-1&&v!==void 0;$r(An(U.current.cell[0]+T,0,Ct.length-1),An(U.current.cell[1]+_,0,vn-1),N,!1)}M==null||M(v,I)},[o==null?void 0:o.cell,Cn,U,M,Wn,vn,$r,Ct.length]),Fw=h.useMemo(()=>`gdg-overlay-${Ag++}`,[]),co=h.useCallback(v=>{var T,_,N,G,W;Cn();const I=[];for(let Y=v.x;Y<v.x+v.width;Y++)for(let q=v.y;q<v.y+v.height;q++){const X=k([Y-$,q]);if(!X.allowOverlay&&X.kind!==Z.Boolean)continue;let Te;if(X.kind===Z.Custom){const Re=xt(X),se=(T=Re==null?void 0:Re.provideEditor)==null?void 0:T.call(Re,X);(Re==null?void 0:Re.onDelete)!==void 0?Te=Re.onDelete(X):gs(se)&&(Te=(_=se==null?void 0:se.deletedValue)==null?void 0:_.call(se,X))}else(jr(X)&&X.allowOverlay||X.kind===Z.Boolean)&&(Te=(G=(N=xt(X))==null?void 0:N.onDelete)==null?void 0:G.call(N,X));Te!==void 0&&!Wr(Te)&&jr(Te)&&I.push({location:[Y,q],value:Te})}Wn(I),(W=In.current)==null||W.damage(I.map(Y=>({cell:Y.location})))},[Cn,k,xt,Wn,$]),fi=o!==void 0,Hd=h.useCallback(v=>{var tt,bt;const I=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:_}=v,N=U.columns,G=U.rows,W=ur;if(!fi&&ct(W.clear,v,T))ye(Gi,!1),Tt==null||Tt();else if(!fi&&ct(W.selectAll,v,T))ye({columns:vt.empty(),rows:vt.empty(),current:{cell:((tt=U.current)==null?void 0:tt.cell)??[$,0],range:{x:$,y:0,width:y.length,height:Ue},rangeStack:[]}},!1);else if(ct(W.search,v,T))(bt=a==null?void 0:a.current)==null||bt.focus({preventScroll:!0}),So(!0);else if(ct(W.delete,v,T)){const ze=(Me==null?void 0:Me(U))??!0;if(ze!==!1){const Fe=ze===!0?U:ze;if(Fe.current!==void 0){co(Fe.current.range);for(const Mt of Fe.current.rangeStack)co(Mt)}for(const Mt of Fe.rows)co({x:$,y:Mt,width:y.length,height:1});for(const Mt of Fe.columns)co({x:Mt,y:0,width:1,height:Ue})}}if(T.didMatch)return I(),!0;if(U.current===void 0)return!1;let[Y,q]=U.current.cell;const[,X]=U.current.cell;let Te=!1,Re=!1;if(ct(W.scrollToSelectedCell,v,T)?Ha.current(Y-$,q):rt!=="none"&&ct(W.selectColumn,v,T)?N.hasIndex(Y)?Ye(N.remove(Y),void 0,!0):rt==="single"?Ye(vt.fromSingleSelection(Y),void 0,!0):Ye(void 0,Y,!0):ee!=="none"&&ct(W.selectRow,v,T)?G.hasIndex(q)?Ce(G.remove(q),void 0,!0):ee==="single"?Ce(vt.fromSingleSelection(q),void 0,!0):Ce(void 0,q,!0):!fi&&_!==void 0&&ct(W.activateCell,v,T)?q===Ue&&Gt?window.setTimeout(()=>{const ze=Ea(Y);Io(ze??Y)},0):(C==null||C([Y-$,q]),Eo(_,!0)):U.current.range.height>1&&ct(W.downFill,v,T)?Od():U.current.range.width>1&&ct(W.rightFill,v,T)?Td():ct(W.goToNextPage,v,T)?q+=Math.max(1,rn.current.height-4):ct(W.goToPreviousPage,v,T)?q-=Math.max(1,rn.current.height-4):ct(W.goToFirstCell,v,T)?(i(void 0),q=0,Y=0):ct(W.goToLastCell,v,T)?(i(void 0),q=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ct(W.selectToFirstCell,v,T)?(i(void 0),Qn([-2,-2])):ct(W.selectToLastCell,v,T)?(i(void 0),Qn([2,2])):fi?(ct(W.closeOverlay,v,T)&&i(void 0),ct(W.acceptOverlayDown,v,T)&&(i(void 0),q++),ct(W.acceptOverlayUp,v,T)&&(i(void 0),q--),ct(W.acceptOverlayLeft,v,T)&&(i(void 0),Y--),ct(W.acceptOverlayRight,v,T)&&(i(void 0),Y++)):(ct(W.goDownCell,v,T)?q+=1:ct(W.goUpCell,v,T)?q-=1:ct(W.goRightCell,v,T)?Y+=1:ct(W.goLeftCell,v,T)?Y-=1:ct(W.goDownCellRetainSelection,v,T)?(q+=1,Te=!0):ct(W.goUpCellRetainSelection,v,T)?(q-=1,Te=!0):ct(W.goRightCellRetainSelection,v,T)?(Y+=1,Te=!0):ct(W.goLeftCellRetainSelection,v,T)?(Y-=1,Te=!0):ct(W.goToLastRow,v,T)?q=Ue-1:ct(W.goToFirstRow,v,T)?q=Number.MIN_SAFE_INTEGER:ct(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ct(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(It==="rect"||It==="multi-rect")&&(ct(W.selectGrowDown,v,T)?Qn([0,1]):ct(W.selectGrowUp,v,T)?Qn([0,-1]):ct(W.selectGrowRight,v,T)?Qn([1,0]):ct(W.selectGrowLeft,v,T)?Qn([-1,0]):ct(W.selectToLastRow,v,T)?Qn([0,2]):ct(W.selectToFirstRow,v,T)?Qn([0,-2]):ct(W.selectToLastColumn,v,T)?Qn([2,0]):ct(W.selectToFirstColumn,v,T)&&Qn([-2,0])),Re=T.didMatch),Jn!==void 0&&Jn!=="normal"&&q!==X){const ze=Jn==="skip-up"||Jn==="skip"||Jn==="block",Fe=Jn==="skip-down"||Jn==="skip"||Jn==="block",Mt=q<X;if(Mt&&ze){for(;q>=0&&lo(q).isGroupHeader;)q--;q<0&&(q=X)}else if(!Mt&&Fe){for(;q<Ue&&lo(q).isGroupHeader;)q++;q>=Ue&&(q=X)}}const se=$r(Y,q,!1,Te),He=T.didMatch;return He&&(se||!Re||nn)&&I(),He},[Jn,fi,U,ur,rt,ee,It,$,lo,Ue,$r,ye,Tt,y.length,Me,nn,co,Ye,Ce,Gt,Ea,Io,C,Eo,Od,Td,Qn]),pi=h.useCallback(v=>{let I=!1;if(B!==void 0&&B({...v,cancel:()=>{I=!0}}),I||Hd(v)||U.current===void 0)return;const[T,_]=U.current.cell,N=rn.current;if(Ve&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Po(k([T-$,Math.max(0,Math.min(_,Ue-1))]))){if((!Gt||_!==Ue)&&(N.y>_||_>N.y+N.height||N.x>T||T>N.x+N.width))return;Eo(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Ve,B,Hd,U,k,$,Ue,Gt,Eo]),Lw=h.useCallback((v,I)=>{const T=v.location[0]-$;if(v.kind==="header"&&(me==null||me(T,{...v,preventDefault:I})),v.kind===Vn){if(T<0)return;j==null||j(T,{...v,preventDefault:I})}if(v.kind==="cell"){const[_,N]=v.location;ne==null||ne([T,N],{...v,preventDefault:I}),rp(U,v.location)||$r(_,N,!1,!1)}},[U,ne,j,me,$,$r]),is=h.useCallback(async v=>{var W,Y,q;if(!ur.paste)return;function I(X,Te,Re,se){var tt,bt;const He=typeof Re=="object"?(Re==null?void 0:Re.join(`
173
173
  `))??"":(Re==null?void 0:Re.toString())??"";if(!Wr(X)&&Po(X)&&X.readonly!==!0){const ze=O==null?void 0:O(He,X);if(ze!==void 0&&jr(ze))return{location:Te,value:ze};const Fe=xt(X);if(Fe===void 0)return;if(Fe.kind===Z.Custom){Tn(X.kind===Z.Custom);const Mt=(tt=Fe.onPaste)==null?void 0:tt.call(Fe,He,X.data);return Mt===void 0?void 0:{location:Te,value:{...X,data:Mt}}}else{const Mt=(bt=Fe.onPaste)==null?void 0:bt.call(Fe,He,X,{formatted:se,formattedString:typeof se=="string"?se:se==null?void 0:se.join(`
174
174
  `),rawValue:Re});return Mt===void 0?void 0:(Tn(Mt.kind===X.kind),{location:Te,value:Mt})}}}const T=U.columns,_=U.rows,N=((W=jt.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=l.current)==null?void 0:Y.contains(document.activeElement))===!0;let G;if(U.current!==void 0?G=[U.current.range.x,U.current.range.y]:T.length===1?G=[T.first()??0,0]:_.length===1&&(G=[$,_.first()??0]),N&&G!==void 0){let X,Te;const Re="text/plain",se="text/html";if(navigator.clipboard.read!==void 0){const ze=await navigator.clipboard.read();for(const Fe of ze){if(Fe.types.includes(se)){const Mt=await(await Fe.getType(se)).text(),fn=Nc(Mt);if(fn!==void 0){X=fn;break}}Fe.types.includes(Re)&&(Te=await(await Fe.getType(Re)).text())}}else if(navigator.clipboard.readText!==void 0)Te=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(se)){const ze=v.clipboardData.getData(se);X=Nc(ze)}X===void 0&&v.clipboardData.types.includes(Re)&&(Te=v.clipboardData.getData(Re))}else return;const[He,tt]=G,bt=[];do{if(Ke===void 0){const ze=Fn(G),Fe=Te??(X==null?void 0:X.map(fn=>fn.map(dn=>dn.rawValue).join(" ")).join(" "))??"",Mt=I(ze,G,Fe,void 0);Mt!==void 0&&bt.push(Mt);break}if(X===void 0){if(Te===void 0)return;X=xg(Te)}if(Ke===!1||typeof Ke=="function"&&(Ke==null?void 0:Ke([G[0]-$,G[1]],X.map(ze=>ze.map(Fe=>{var Mt;return((Mt=Fe.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[ze,Fe]of X.entries()){if(ze+tt>=Ue)break;for(const[Mt,fn]of Fe.entries()){const dn=[Mt+He,ze+tt],[er,fr]=dn;if(er>=Ct.length||fr>=vn)continue;const tr=Fn(dn),Cr=I(tr,dn,fn.rawValue,fn.formatted);Cr!==void 0&&bt.push(Cr)}}}while(!1);Wn(bt),(q=In.current)==null||q.damage(bt.map(ze=>({cell:ze.location})))}},[O,xt,Fn,U,ur.paste,jt,Ct.length,Wn,vn,Ke,$,Ue]);hn("paste",is,d,!1,!0);const gi=h.useCallback(async(v,I)=>{var W,Y;if(!ur.copy)return;const T=I===!0||((W=jt.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=l.current)==null?void 0:Y.contains(document.activeElement))===!0,_=U.columns,N=U.rows,G=(q,X)=>{if(!ue)Bc(q,X,v);else{const Te=X.map(Re=>({kind:Z.Text,data:y[Re].title,displayData:y[Re].title,allowOverlay:!1}));Bc([Te,...q],X,v)}};if(T&&cn!==void 0){if(U.current!==void 0){let q=cn(U.current.range,sn.current.signal);typeof q!="object"&&(q=await q()),G(q,pr(U.current.range.x-$,U.current.range.x+U.current.range.width-$))}else if(N!==void 0&&N.length>0){const q=[...N].map(X=>{const Te=cn({x:$,y:X,width:y.length,height:1},sn.current.signal);return typeof Te=="object"?Te[0]:Te().then(Re=>Re[0])});if(q.some(X=>X instanceof Promise)){const X=await Promise.all(q);G(X,pr(y.length))}else G(q,pr(y.length))}else if(_.length>0){const q=[],X=[];for(const Te of _){let Re=cn({x:Te,y:0,width:1,height:Ue},sn.current.signal);typeof Re!="object"&&(Re=await Re()),q.push(Re),X.push(Te-$)}if(q.length===1)G(q[0],X);else{const Te=q.reduce((Re,se)=>Re.map((He,tt)=>[...He,...se[tt]]));G(Te,X)}}}},[y,cn,U,ur.copy,$,jt,Ue,ue]);hn("copy",gi,d,!1,!1);const Aw=h.useCallback(async v=>{var I,T;if(!(!ur.cut||!(((I=jt.current)==null?void 0:I.contains(document.activeElement))===!0||((T=l.current)==null?void 0:T.contains(document.activeElement))===!0))&&(await gi(v),U.current!==void 0)){let _={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:vt.empty(),columns:vt.empty()};const N=Me==null?void 0:Me(_);if(N===!1||(_=N===!0?_:N,_.current===void 0))return;co(_.current.range)}},[co,U,ur.cut,gi,jt,Me]);hn("cut",Aw,d,!1,!1);const Vw=h.useCallback((v,I)=>{if(ge!==void 0){$!==0&&(v=v.map(N=>[N[0]-$,N[1]])),ge(v,I);return}if(v.length===0||I===-1)return;const[T,_]=v[I];u.current!==void 0&&u.current[0]===T&&u.current[1]===_||(u.current=[T,_],$r(T,_,!1,!1))},[ge,$,$r]),[Oa,Da]=((_d=Pt==null?void 0:Pt.current)==null?void 0:_d.cell)??[],Ha=h.useRef(an);Ha.current=an,h.useLayoutEffect(()=>{var v,I,T,_;os.current&&!Vr.current&&Oa!==void 0&&Da!==void 0&&(Oa!==((I=(v=te.current)==null?void 0:v.current)==null?void 0:I.cell[0])||Da!==((_=(T=te.current)==null?void 0:T.current)==null?void 0:_.cell[1]))&&Ha.current(Oa,Da),Vr.current=!1},[Oa,Da]);const Pd=U.current!==void 0&&(U.current.cell[0]>=Ct.length||U.current.cell[1]>=vn);h.useLayoutEffect(()=>{Pd&&ye(Gi,!1)},[Pd,ye]);const _w=h.useMemo(()=>Gt===!0&&(De==null?void 0:De.tint)===!0?vt.fromSingleSelection(vn-1):vt.empty(),[vn,Gt,De==null?void 0:De.tint]),Nw=h.useCallback(v=>typeof Ne=="boolean"?Ne:(Ne==null?void 0:Ne(v-$))??!0,[$,Ne]),$w=h.useMemo(()=>{if(Jl===void 0||l.current===null)return null;const{bounds:v,group:I}=Jl,T=l.current.getBoundingClientRect();return h.createElement(ug,{bounds:v,group:I,canvasBounds:T,onClose:()=>Ql(void 0),onFinish:_=>{Ql(void 0),ie==null||ie(I,_)}})},[ie,Jl]),Bw=Math.min(Ct.length,Ie+(Bn?1:0));h.useImperativeHandle(t,()=>({appendRow:(v,I)=>Io(v+$,I),updateCells:v=>{var I;return $!==0&&(v=v.map(T=>({cell:[T.cell[0]+$,T.cell[1]]}))),(I=In.current)==null?void 0:I.damage(v)},getBounds:(v,I)=>{var T;if(!((l==null?void 0:l.current)===null||(jt==null?void 0:jt.current)===null)){if(v===void 0&&I===void 0){const _=l.current.getBoundingClientRect(),N=_.width/jt.current.clientWidth;return{x:_.x-jt.current.scrollLeft*N,y:_.y-jt.current.scrollTop*N,width:jt.current.scrollWidth*N,height:jt.current.scrollHeight*N}}return(T=In.current)==null?void 0:T.getBounds((v??0)+$,I)}},focus:()=>{var v;return(v=In.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":pi({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":pi({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":pi({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 gi(void 0,!0);break;case"paste":await is();break}},scrollTo:an,remeasureColumns:v=>{for(const I of v)Ia(I+$)}}),[Io,Ia,jt,gi,pi,is,$,an]);const[zd,Fd]=hr??[],Ww=h.useCallback(v=>{const[I,T]=v;if(T===-1){rt!=="none"&&(Ye(vt.fromSingleSelection(I),void 0,!1),Cn());return}zd===I&&Fd===T||(St({cell:v,range:{x:I,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),an(I,T))},[rt,Cn,an,zd,Fd,St,Ye]),[jw,Uw]=h.useState(!1),Ld=h.useRef(zs(v=>{Uw(v)},5)),Yw=h.useCallback(()=>{Ld.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&s===void 0&&St({cell:[$,Ca],range:{x:$,y:Ca,width:1,height:1}},!0,!1,"keyboard-select")},[Ca,U,s,$,St]),Gw=h.useCallback(()=>{Ld.current(!1)},[]),[Xw,Kw]=h.useMemo(()=>{let v;const I=(Ut==null?void 0:Ut.scrollbarWidthOverride)??Xa(),T=Ue+(Gt?1:0);if(typeof cr=="number")v=Et+T*cr;else{let N=0;const G=Math.min(T,10);for(let W=0;W<G;W++)N+=cr(W);N=Math.floor(N/G),v=Et+T*N}v+=I;const _=Ct.reduce((N,G)=>G.width+N,0)+I;return[`${Math.min(1e5,_)}px`,`${Math.min(1e5,v)}px`]},[Ct,Ut==null?void 0:Ut.scrollbarWidthOverride,cr,Ue,Gt,Et]),qw=h.useMemo(()=>ms(Ge),[Ge]);return h.createElement(Fa.Provider,{value:Ge},h.createElement(Mg,{style:qw,className:Ee,inWidth:m??Xw,inHeight:b??Kw},h.createElement(lg,{fillHandle:qt,drawFocusRing:ro,experimental:Ut,fixedShadowX:Yt,fixedShadowY:Zt,getRowThemeOverride:$n,headerIcons:_n,imageWindowLoader:no,initialSize:sr,isDraggable:F,onDragLeave:et,onRowMoved:qe,overscrollX:Yl,overscrollY:si,preventDiagonalScrolling:yn,rightElement:Kn,rightElementProps:Pn,smoothScrollX:Nn,smoothScrollY:qn,className:Ee,enableGroups:Rn,onCanvasFocused:Yw,onCanvasBlur:Gw,canvasRef:l,onContextMenu:Lw,theme:Ge,cellXOffset:xw,cellYOffset:Ca,accessibilityHeight:io.height,onDragEnd:Hw,columns:Ct,nonGrowWidth:Zn,drawHeader:ot,onColumnProposeMove:P,drawCell:it,disabledRows:_w,freezeColumns:Bw,lockColumns:$,firstColAccessible:$===0,getCellContent:Fn,minColumnWidth:xr,maxColumnWidth:oo,searchInputRef:a,showSearch:Gl,onSearchClose:Mo,highlightRegions:Cw,getCellsForSelection:cn,getGroupDetails:ql,headerHeight:li,isFocused:jw,groupHeaderHeight:Rn?ya:0,freezeTrailingRows:pe+(Gt&&(De==null?void 0:De.sticky)===!0?1:0),hasAppendRow:Gt,onColumnResize:xe,onColumnResizeEnd:de,onColumnResizeStart:ke,onCellFocused:Ww,onColumnMoved:Ow,onDragStart:Dw,onHeaderMenuClick:Ew,onHeaderIndicatorClick:Iw,onItemHovered:rs,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:Rw,onKeyDown:pi,onKeyUp:ce,onMouseDown:kw,onMouseUp:Mw,onDragOverCell:Vt,onDrop:_t,onSearchResultsChanged:Vw,onVisibleRegionChanged:Tw,clientSize:ft,rowHeight:cr,searchResults:K,searchValue:R,onSearchValueChange:D,rows:vn,scrollRef:jt,selection:U,translateX:io.tx,translateY:io.ty,verticalBorder:Nw,gridRef:In,getCellRenderer:xt,resizeIndicator:Ul}),$w,o!==void 0&&h.createElement(h.Suspense,{fallback:null},h.createElement(Lg,{...o,validateCell:z,bloom:A,id:Fw,getCellRenderer:xt,className:(Ut==null?void 0:Ut.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:wn,imageEditorOverride:f,onFinishEditing:zw,markdownDivCreateNode:g,isOutsideClick:zr}))))},Ng=h.forwardRef(_g),Xc=20;function Kc(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:a,height:l,x:s,y:c}=o,u=t.maxSize??Xc,d=Math.floor(o.y+l/2),f=Vs(u,l,i.cellVerticalPadding),p=As(t.contentAlign??"center",s,a,i.cellHorizontalPadding,f),g=Ls(p,d,f),m=_s(s+n,c+r,g);return Aa(t)&&m}const $g={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=>Bg(e,e.cell.data,Aa(e.cell),e.cell.maxSize??Xc,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{Kc(e)&&e.preventDefault()},onClick:e=>{if(Kc(e))return{...e.cell,data:Wc(e.cell.data)}},onPaste:(e,t)=>{let n=wi;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=La),n===t.data?void 0:{...t,data:n}}};function Bg(e,t,n,r,o){if(!n&&t===wi)return;const{ctx:i,hoverAmount:a,theme:l,rect:s,highlighted:c,hoverX:u,hoverY:d,cell:{contentAlign:f}}=e,{x:p,y:g,width:m,height:b}=s;let y=!1;if(o>0){let w=n?1-o+o*a:.4;if(t===wi&&(w*=a),w===0)return;w<1&&(y=!0,i.globalAlpha=w)}cl(i,l,t,p,g,m,b,c,u,d,r,f),y&&(i.globalAlpha=1)}const Wg=un("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),jg=e=>{const{bubbles:t}=e;return h.createElement(Wg,null,t.map((n,r)=>h.createElement("div",{key:r,className:"boe-bubble"},n)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Ug={getAccessibilityString:e=>Ns(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o).width+r+20,0)+2*n.cellHorizontalPadding-4,draw:e=>Gg(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(jg,{bubbles:t.data})},onPaste:()=>{}},Yg=4;function Gg(e,t){const{rect:n,theme:r,ctx:o,highlighted:i}=e,{x:a,y:l,width:s,height:c}=n,u=20,d=8,f=Yg;let p=a+r.cellHorizontalPadding;const g=[];for(const m of t){if(p>a+s)break;const b=Qr(m,o,r.baseFontFull).width;g.push({x:p,width:b}),p+=b+d*2+f}o.beginPath();for(const m of g)lr(o,m.x,l+(c-u)/2,m.width+d*2,u,r.roundingRadius??u/2);o.fillStyle=i?r.bgBubbleSelected:r.bgBubble,o.fill();for(const[m,b]of g.entries())o.beginPath(),o.fillStyle=r.textBubble,o.fillText(t[m],b.x+d,l+c/2+ir(o,r))}const Xg=un("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Kg=e=>{const{drilldowns:t}=e;return h.createElement(Xg,null,t.map((n,r)=>h.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&h.createElement("img",{src:n.img}),h.createElement("div",null,n.text))))},qg={getAccessibilityString:e=>Ns(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+20+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>Qg(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return h.createElement(Kg,{drilldowns:t.data})},onPaste:()=>{}},Zg=4,pl={};function Jg(e,t,n,r){const o=Math.ceil(window.devicePixelRatio),i=5,a=n-i*2,l=4,s=n*o,c=r+i,u=r*3,d=(u+i*2)*o,f=`${e},${t},${o},${n}`;if(pl[f]!==void 0)return{el:pl[f],height:s,width:d,middleWidth:l*o,sideWidth:c*o,padding:i*o,dpr:o};const p=document.createElement("canvas"),g=p.getContext("2d");return g===null?null:(p.width=d,p.height=s,g.scale(o,o),pl[f]=p,g.beginPath(),lr(g,i,i,u,a,r),g.shadowColor="rgba(24, 25, 34, 0.4)",g.shadowBlur=1,g.fillStyle=e,g.fill(),g.shadowColor="rgba(24, 25, 34, 0.3)",g.shadowOffsetY=1,g.shadowBlur=5,g.fillStyle=e,g.fill(),g.shadowOffsetY=0,g.shadowBlur=0,g.shadowBlur=0,g.beginPath(),lr(g,i+.5,i+.5,u,a,r),g.strokeStyle=t,g.lineWidth=1,g.stroke(),{el:p,height:s,width:d,sideWidth:c*o,middleWidth:r*o,padding:i*o,dpr:o})}function Qg(e,t){const{rect:n,theme:r,ctx:o,imageLoader:i,col:a,row:l}=e,{x:s,width:c}=n,u=r.baseFontFull,d=fc(o,u),f=Math.min(n.height,Math.max(16,Math.ceil(d*r.lineHeight)*2)),p=Math.floor(n.y+(n.height-f)/2),g=f-10,m=8,b=Zg;let y=s+r.cellHorizontalPadding;const w=r.roundingRadius??6,k=Jg(r.bgCell,r.drilldownBorder,f,w),S=[];for(const C of t){if(y>s+c)break;const x=Qr(C.text,o,u).width;let M=0;C.img!==void 0&&i.loadOrGetImage(C.img,a,l)!==void 0&&(M=g-8+4);const O=x+M+m*2;S.push({x:y,width:O}),y+=O+b}if(k!==null){const{el:C,height:x,middleWidth:M,sideWidth:O,width:E,dpr:H,padding:A}=k,V=O/H,P=A/H;for(const L of S){const Q=Math.floor(L.x),J=Math.floor(L.width),ne=J-(V-P)*2;o.imageSmoothingEnabled=!1,o.drawImage(C,0,0,O,x,Q-P,p,V,f),ne>0&&o.drawImage(C,O,0,M,x,Q+(V-P),p,ne,f),o.drawImage(C,E-O,0,O,x,Q+J-(V-P),p,V,f),o.imageSmoothingEnabled=!0}}o.beginPath();for(const[C,x]of S.entries()){const M=t[C];let O=x.x+m;if(M.img!==void 0){const E=i.loadOrGetImage(M.img,a,l);if(E!==void 0){const H=g-8;let A=0,V=0,P=E.width,L=E.height;P>L?(A+=(P-L)/2,P=L):L>P&&(V+=(L-P)/2,L=P),o.beginPath(),lr(o,O,p+f/2-H/2,H,H,r.roundingRadius??3),o.save(),o.clip(),o.drawImage(E,A,V,P,L,O,p+f/2-H/2,H,H),o.restore(),O+=H+4}}o.beginPath(),o.fillStyle=r.textBubble,o.fillText(M.text,O,p+f/2+ir(o,r))}}const em={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>tm(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??Ef;return h.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{e=e.trim();const n=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(n.length===t.data.length&&n.every((r,o)=>r===t.data[o])))return{...t,data:n}}},gl=4;function tm(e,t,n,r){const{rect:o,col:i,row:a,theme:l,ctx:s,imageLoader:c}=e,{x:u,y:d,height:f,width:p}=o,g=f-l.cellVerticalPadding*2,m=[];let b=0;for(let w=0;w<t.length;w++){const k=t[w];if(k.length===0)continue;const S=c.loadOrGetImage(k,i,a);if(S!==void 0){m[w]=S;const C=S.width*(g/S.height);b+=C+gl}}if(b===0)return;b-=gl;let y=u+l.cellHorizontalPadding;r==="right"?y=Math.floor(u+p-l.cellHorizontalPadding-b):r==="center"&&(y=Math.floor(u+p/2-b/2));for(const w of m){if(w===void 0)continue;const k=w.width*(g/w.height);n>0&&(s.beginPath(),lr(s,y,d+l.cellVerticalPadding,k,g,n),s.save(),s.clip()),s.drawImage(w,y,d+l.cellVerticalPadding,k,g),n>0&&s.restore(),y+=k+gl}}function nm(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const rm={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let l=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(l+=Math.round(nm(n,r)*t.skeletonWidthVariability));const s=a.cellHorizontalPadding;l+s*2>=i.width&&(l=i.width-s*2-1);const c=t.skeletonHeight??Math.min(18,i.height-2*a.cellVerticalPadding);lr(o,i.x+s,i.y+(i.height-c)/2,l,c,a.roundingRadius??3),o.fillStyle=Zr(a.textDark,.1),o.fill()},onPaste:()=>{}},om=()=>e=>e.targetWidth,qc=un("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[om(),"px"]}}),im=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:a,validatedSelection:l}=e,s=t.data,c=t.readonly===!0,[u,d]=h.useState(s===""||r),f=h.useCallback(()=>{d(g=>!g)},[]),p=s?"gdg-ml-6":"";return u?h.createElement(qc,{targetWidth:i.width-20},h.createElement(po,{autoFocus:!0,highlight:!1,validatedSelection:l,value:s,onKeyDown:g=>{g.key==="Enter"&&g.stopPropagation()},onChange:n}),h.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>a(t)},h.createElement(yf,null))):h.createElement(qc,{targetWidth:i.width},h.createElement(Yf,{contents:s,createNode:o}),!c&&h.createElement(h.Fragment,null,h.createElement("div",{className:"spacer"}),h.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:f},h.createElement(Ya,null))),h.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},am={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:Uo,measure:(e,t,n)=>{const r=t.data.split(`
175
- `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return h.createElement(im,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},lm={getAccessibilityString:e=>e.row.toString(),kind:Ln.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:sm,measure:()=>44,draw:e=>um(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function sm(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=cm,n.textAlign="center",i}function cm(e){const{ctx:t}=e;t.textAlign="start"}function um(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:d,width:f,height:p}=l,g=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&g>0){a.globalAlpha=g;const m=7*(n?s:1);if(cl(a,c,n,o?u+m:u,d,o?f-m:f,p,!0,void 0,void 0,18,"center",i),o){a.globalAlpha=s,a.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])a.rect(u+b,d+p/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),b=c.markerFontFull,y=u+f/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=b,a.fillText(m,y,d+p/2+ir(a,b)),s!==0&&(a.globalAlpha=1)}}const dm={getAccessibilityString:()=>"",kind:Ln.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>hm(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function hm(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:d}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const f=t!=="";let p=0;if(n!==void 0){const g=d-8,m=s+8/2,b=c+8/2;l.drawSprite(n,"normal",r,m,b,g,a,f?1:i),p=g}else{p=24;const g=12,m=f?g:i*g,b=f?0:(1-i)*g*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+b,c+d/2),r.lineTo(s+y+b+m,c+d/2),r.moveTo(s+y+b+m*.5,c+d/2-m*.5),r.lineTo(s+y+b+m*.5,c+d/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,p+s+a.cellHorizontalPadding+.5,c+d/2+ir(r,a)),r.beginPath()}function Zc(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=fm(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),lr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function fm(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Qr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const pm=h.lazy(async()=>await cs(()=>import("./number-overlay-editor-BywJqzaW.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),gm={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:Uo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Zc(r,o,c,s,i,t,a),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return h.createElement(h.Suspense,{fallback:null},h.createElement(pm,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},mm={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:vm,onPaste:()=>{}};function vm(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const c=i+a/2,u=Math.cos(Fs(30))*l,d=Math.sin(Fs(30))*l;for(let f=0;f<12;f++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-d),t.lineTo(s-u,c+d),t.moveTo(s-u,c-d),t.lineTo(s+u,c+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const bm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Uo(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return oe.createElement(po,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},wm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Uo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:d,hoverEffectTheme:f}=t;u===!0&&n>0&&Zc(o,a,f,s,i,n,l),ar(e,s,c,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
175
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>ar(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:a,validatedSelection:l}=e;return h.createElement(im,{onFinish:o,targetRect:r,value:n,validatedSelection:l,onChange:s=>t({...n,data:s.target.value}),forceEditMode:a,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},lm={getAccessibilityString:e=>e.row.toString(),kind:Ln.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:sm,measure:()=>44,draw:e=>um(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:r,posY:o}=e,{width:i,height:a}=t,l=n.drawHandle?7+(i-7)/2:i/2,s=a/2;if(Math.abs(r-l)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function sm(e,t){const{ctx:n,theme:r}=e,o=r.markerFontFull,i=t??{};return(i==null?void 0:i.font)!==o&&(n.font=o,i.font=o),i.deprep=cm,n.textAlign="center",i}function cm(e){const{ctx:t}=e;t.textAlign="start"}function um(e,t,n,r,o,i){const{ctx:a,rect:l,hoverAmount:s,theme:c}=e,{x:u,y:d,width:f,height:p}=l,g=n?1:r==="checkbox-visible"?.6+.4*s:s;if(r!=="number"&&g>0){a.globalAlpha=g;const m=7*(n?s:1);if(cl(a,c,n,o?u+m:u,d,o?f-m:f,p,!0,void 0,void 0,18,"center",i),o){a.globalAlpha=s,a.beginPath();for(const b of[3,6])for(const y of[-5,-1,3])a.rect(u+b,d+p/2+y,2,2);a.fillStyle=c.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(r==="number"||r==="both"&&!n){const m=t.toString(),b=c.markerFontFull,y=u+f/2;r==="both"&&s!==0&&(a.globalAlpha=1-s),a.fillStyle=c.textLight,a.font=b,a.fillText(m,y,d+p/2+ir(a,b)),s!==0&&(a.globalAlpha=1)}}const dm={getAccessibilityString:()=>"",kind:Ln.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>hm(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function hm(e,t,n){const{ctx:r,rect:o,hoverAmount:i,theme:a,spriteManager:l}=e,{x:s,y:c,width:u,height:d}=o;r.beginPath(),r.globalAlpha=i,r.rect(s+1,c+1,u,d-2),r.fillStyle=a.bgHeaderHovered,r.fill(),r.globalAlpha=1,r.beginPath();const f=t!=="";let p=0;if(n!==void 0){const g=d-8,m=s+8/2,b=c+8/2;l.drawSprite(n,"normal",r,m,b,g,a,f?1:i),p=g}else{p=24;const g=12,m=f?g:i*g,b=f?0:(1-i)*g*.5,y=a.cellHorizontalPadding+4;m>0&&(r.moveTo(s+y+b,c+d/2),r.lineTo(s+y+b+m,c+d/2),r.moveTo(s+y+b+m*.5,c+d/2-m*.5),r.lineTo(s+y+b+m*.5,c+d/2+m*.5),r.lineWidth=2,r.strokeStyle=a.bgIconHeader,r.lineCap="round",r.stroke())}r.fillStyle=a.textMedium,r.fillText(t,p+s+a.cellHorizontalPadding+.5,c+d/2+ir(r,a)),r.beginPath()}function Zc(e,t,n,r,o,i,a){e.textBaseline="alphabetic";const l=fm(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),lr(e,l.x,l.y,l.width,l.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Zr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function fm(e,t,n,r,o){const i=r.cellHorizontalPadding,a=r.cellVerticalPadding;if(o)return{x:t.x+i/2,y:t.y+a/2+1,width:t.width-i,height:t.height-a-1};const l=Qr(n,e,r.baseFontFull,"alphabetic"),s=t.height-a,c=Math.min(s,l.actualBoundingBoxAscent*2.5);return{x:t.x+i/2,y:t.y+(t.height-c)/2+1,width:l.width+i*3,height:c-1}}const pm=h.lazy(async()=>await cs(()=>import("./number-overlay-editor-20er5Sp-.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),gm={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:Uo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:a}=e,{hoverEffect:l,displayData:s,hoverEffectTheme:c}=n;l===!0&&t>0&&Zc(r,o,c,s,i,t,a),ar(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return h.createElement(h.Suspense,{fallback:null},h.createElement(pm,{highlight:t,disabled:r.readonly===!0,value:r.data,fixedDecimals:r.fixedDecimals,allowNegative:r.allowNegative,thousandSeparator:r.thousandSeparator,decimalSeparator:r.decimalSeparator,validatedSelection:o,onChange:i=>n({...r,data:Number.isNaN(i.floatValue??0)?0:i.floatValue})}))},onPaste:(e,t,n)=>{const r=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(r)||t.data===r))return{...t,data:r,displayData:n.formattedString??t.displayData}}},mm={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:vm,onPaste:()=>{}};function vm(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:a}=r;t.beginPath();const l=2.5;let s=o+n.cellHorizontalPadding+l;const c=i+a/2,u=Math.cos(Fs(30))*l,d=Math.sin(Fs(30))*l;for(let f=0;f<12;f++)t.moveTo(s,c-l),t.lineTo(s,c+l),t.moveTo(s+u,c-d),t.lineTo(s-u,c+d),t.moveTo(s-u,c-d),t.lineTo(s+u,c+d),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const bm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>Uo(e,t,e.theme.textLight),draw:e=>ar(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return oe.createElement(po,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},wm={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:Uo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:a,overrideCursor:l}=e,{displayData:s,contentAlign:c,hoverEffect:u,allowWrapping:d,hoverEffectTheme:f}=t;u===!0&&n>0&&Zc(o,a,f,s,i,n,l),ar(e,s,c,d,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
176
176
  `,t.allowWrapping===!0?void 0:1);let o=0;for(const i of r)o=Math.max(o,e.measureText(i).width);return o+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:r,value:o,validatedSelection:i}=t;return h.createElement(po,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:o.readonly!==!0,disabled:o.readonly===!0,altNewline:!0,value:o.data,validatedSelection:i,onChange:a=>r({...o,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},ym=un("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),xm=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:a}=e,[l,s]=h.useState(!o&&(t===""||r)),c=h.useCallback(()=>{s(!0)},[]);return l?h.createElement(po,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):h.createElement(ym,null,h.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!o&&h.createElement("div",{className:"gdg-edit-icon",onClick:c},h.createElement(Ya,null)),h.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function Jc(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,l=e.actualBoundingBoxAscent;return r==="right"?o=t.width-a-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-a/2),{x:o,y:i,width:a,height:l}}function Qc(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const l=sc(a,i.baseFontFull);if(l===void 0)return!1;const s=Jc(l,n,i,t.contentAlign);return eo({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const Cm={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:Uo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:a,ctx:l}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const u=Qr(s,l,n.baseFontFull),d=Jc(u,a,n,t.contentAlign),{x:f,y:p,width:g,height:m}=d;if(o>=f-4&&o<=f-4+g+8&&i>=p-4&&i<=p-4+m+8){const b=ir(l,n.baseFontFull);r("pointer");const y=5,w=p-b;l.beginPath(),l.moveTo(a.x+f,Math.floor(a.y+w+m+y)+.5),l.lineTo(a.x+f+g,Math.floor(a.y+w+m+y)+.5),l.strokeStyle=n.linkColor,l.stroke(),l.save(),l.fillStyle=e.cellFillColor,ar({...e,rect:{...a,x:a.x-1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x-2}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+1}},s,t.contentAlign),ar({...e,rect:{...a,x:a.x+2}},s,t.contentAlign),l.restore()}}l.fillStyle=c?n.linkColor:n.textDark,ar(e,s,t.contentAlign)},onSelect:e=>{Qc(e)&&e.preventDefault()},onClick:e=>{var n;const{cell:t}=e;Qc(e)&&((n=t.onClickUri)==null||n.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return h.createElement(xm,{forceEditMode:r.readonly!==!0&&(o||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:r.data,preview:r.displayData??r.data,validatedSelection:i,readonly:r.readonly===!0,onChange:a=>n({...r,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},km=[lm,dm,$g,Ug,qg,em,rm,am,gm,mm,bm,wm,Cm];var Sm=Ps,Mm=$d,Rm="Expected a function";function Em(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Rm);return Mm(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Sm(e,t,{leading:r,maxWait:t,trailing:o})}var Im=Em;const Tm=mi(Im),ml=[];class Om extends gc{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",Tm(()=>{this.imageLoaded(new Yo(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const o=this.cache[r];let i=!1;for(let a=0;a<o.cells.length;a++){const l=o.cells[a];if(this.isInWindow(l)){i=!0;break}}i?o.cells=o.cells.filter(this.isInWindow):(o.cancel(),delete this.cache[r])}})}setCallback(n){this.imageLoaded=n}loadImage(n,r,o,i){let a=!1;const l=ml.pop()??new Image;let s=!1;const c={img:void 0,cells:[Xn(r,o)],url:n,cancel:()=>{s||(s=!0,ml.length<12?ml.unshift(l):a||(l.src=""))}},u=new Promise(d=>l.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{l.src=n,await u,await l.decode();const d=this.cache[i];if(d!==void 0&&!s){d.img=l;for(const f of d.cells)this.loadedLocations.push(rl(f));a=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[i]=c}loadOrGetImage(n,r,o){const i=n,a=this.cache[i];if(a!==void 0){const l=Xn(r,o);return a.cells.includes(l)||a.cells.push(l),a.img}else this.loadImage(n,r,o,i)}}const Dm=(e,t)=>{const n=h.useMemo(()=>({...w0,...e.headerIcons}),[e.headerIcons]),r=h.useMemo(()=>e.imageWindowLoader??new Om,[e.imageWindowLoader]);return h.createElement(Ng,{...e,renderers:km,headerIcons:n,ref:t,imageWindowLoader:r})},Hm=h.forwardRef(Dm);var Pm={exports:{}};(function(e,t){(function(n,r){try{e.exports=r(cy)}catch{e.exports=r}n&&(n.momentDurationFormatSetup=n.moment?r(n.moment):r)})(ss,function(n){var r=!1,o=!1,i=!1,a=!1,l="escape years months weeks days hours minutes seconds milliseconds general".split(" "),s=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function c(D,R){return R.length>D.length?!1:D.indexOf(R)!==-1}function u(D){for(var R="";D;)R+="0",D-=1;return R}function d(D){for(var R=D.split("").reverse(),B=0,ce=!0;ce&&B<R.length;)B?R[B]==="9"?R[B]="0":(R[B]=(parseInt(R[B],10)+1).toString(),ce=!1):(parseInt(R[B],10)<5&&(ce=!1),R[B]="0"),B+=1;return ce&&R.push("1"),R.reverse().join("")}function f(D,R){var B=M(Q(R).sort(),function(Oe){return Oe+":"+R[Oe]}).join(","),ce=D+"+"+B;return f.cache[ce]||(f.cache[ce]=Intl.NumberFormat(D,R)),f.cache[ce]}f.cache={};function p(D,R,B){var ce=R.useToLocaleString,Oe=R.useGrouping,Ve=Oe&&R.grouping.slice(),ve=R.maximumSignificantDigits,at=R.minimumIntegerDigits||1,be=R.fractionDigits||0,Ot=R.groupingSeparator,It=R.decimalSeparator;if(ce&&B){var rt={minimumIntegerDigits:at,useGrouping:Oe};if(be&&(rt.maximumFractionDigits=be,rt.minimumFractionDigits=be),ve&&D>0&&(rt.maximumSignificantDigits=ve),i){if(!a){var ee=L({},R);ee.useGrouping=!1,ee.decimalSeparator=".",D=parseFloat(p(D,ee),10)}return f(B,rt).format(D)}else{if(!o){var ee=L({},R);ee.useGrouping=!1,ee.decimalSeparator=".",D=parseFloat(p(D,ee),10)}return D.toLocaleString(B,rt)}}var nt;ve?nt=D.toPrecision(ve+1):nt=D.toFixed(be+1);var we,le,he,Le=nt.split("e");he=Le[1]||"",Le=Le[0].split("."),le=Le[1]||"",we=Le[0]||"";var Pe=we.length,Ke=le.length,ue=Pe+Ke,Ie=we+le;(ve&&ue===ve+1||!ve&&Ke===be+1)&&(Ie=d(Ie),Ie.length===ue+1&&(Pe=Pe+1),Ke&&(Ie=Ie.slice(0,-1)),we=Ie.slice(0,Pe),le=Ie.slice(Pe)),ve&&(le=le.replace(/0*$/,""));var lt=parseInt(he,10);lt>0?le.length<=lt?(le=le+u(lt-le.length),we=we+le,le=""):(we=we+le.slice(0,lt),le=le.slice(lt)):lt<0&&(le=u(Math.abs(lt)-we.length)+we+le,we="0"),ve||(le=le.slice(0,be),le.length<be&&(le=le+u(be-le.length)),we.length<at&&(we=u(at-we.length)+we));var Ae="";if(Oe){Le=we;for(var Je;Le.length;)Ve.length&&(Je=Ve.shift()),Ae&&(Ae=Ot+Ae),Ae=Le.slice(-Je)+Ae,Le=Le.slice(0,-Je)}else Ae=we;return le&&(Ae=Ae+It+le),Ae}function g(D,R){return D.label.length>R.label.length?-1:D.label.length<R.label.length?1:0}function m(D,R){var B=[];return x(Q(R),function(ce){if(ce.slice(0,15)==="_durationLabels"){var Oe=ce.slice(15).toLowerCase();x(Q(R[ce]),function(Ve){Ve.slice(0,1)===D&&B.push({type:Oe,key:Ve,label:R[ce][Ve]})})}}),B}function b(D,R,B){return R===1&&B===null?D:D+D}var y={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:b};function w(D){return Object.prototype.toString.call(D)==="[object Array]"}function k(D){return Object.prototype.toString.call(D)==="[object Object]"}function S(D,R){for(var B=D.length;B-=1;)if(R(D[B]))return D[B]}function C(D,R){var B=0,ce=D&&D.length||0,Oe;for(typeof R!="function"&&(Oe=R,R=function(Ve){return Ve===Oe});B<ce;){if(R(D[B]))return D[B];B+=1}}function x(D,R){var B=0,ce=D.length;if(!(!D||!ce))for(;B<ce;){if(R(D[B],B)===!1)return;B+=1}}function M(D,R){var B=0,ce=D.length,Oe=[];if(!D||!ce)return Oe;for(;B<ce;)Oe[B]=R(D[B],B),B+=1;return Oe}function O(D,R){return M(D,function(B){return B[R]})}function E(D){var R=[];return x(D,function(B){B&&R.push(B)}),R}function H(D){var R=[];return x(D,function(B){C(R,B)||R.push(B)}),R}function A(D,R){var B=[];return x(D,function(ce){x(R,function(Oe){ce===Oe&&B.push(ce)})}),H(B)}function V(D,R){var B=[];return x(D,function(ce,Oe){if(!R(ce))return B=D.slice(Oe),!1}),B}function P(D,R){var B=D.slice().reverse();return V(B,R).reverse()}function L(D,R){for(var B in R)R.hasOwnProperty(B)&&(D[B]=R[B]);return D}function Q(D){var R=[];for(var B in D)D.hasOwnProperty(B)&&R.push(B);return R}function J(D,R){var B=0,ce=D.length;if(!D||!ce)return!1;for(;B<ce;){if(R(D[B],B)===!0)return!0;B+=1}return!1}function ne(D){var R=[];return x(D,function(B){R=R.concat(B)}),R}function Ee(){var D=0;try{D.toLocaleString("i")}catch(R){return R.name==="RangeError"}return!1}function me(D){return D(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function re(D){var R=!0;return R=R&&D(1,"en",{minimumIntegerDigits:1})==="1",R=R&&D(1,"en",{minimumIntegerDigits:2})==="01",R=R&&D(1,"en",{minimumIntegerDigits:3})==="001",!(!R||(R=R&&D(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",R=R&&D(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",R=R&&D(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",R=R&&D(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!R)||(R=R&&D(99.99,"en",{maximumSignificantDigits:1})==="100",R=R&&D(99.99,"en",{maximumSignificantDigits:2})==="100",R=R&&D(99.99,"en",{maximumSignificantDigits:3})==="100",R=R&&D(99.99,"en",{maximumSignificantDigits:4})==="99.99",R=R&&D(99.99,"en",{maximumSignificantDigits:5})==="99.99",!R)||(R=R&&D(1e3,"en",{useGrouping:!0})==="1,000",R=R&&D(1e3,"en",{useGrouping:!1})==="1000",!R))}function j(){var D=[].slice.call(arguments),R={},B;if(x(D,function(ve,at){if(!at){if(!w(ve))throw"Expected array as the first argument to durationsFormat.";B=ve}if(typeof ve=="string"||typeof ve=="function"){R.template=ve;return}if(typeof ve=="number"){R.precision=ve;return}k(ve)&&L(R,ve)}),!B||!B.length)return[];R.returnMomentTypes=!0;var ce=M(B,function(ve){return ve.format(R)}),Oe=A(l,H(O(ne(ce),"type"))),Ve=R.largest;return Ve&&(Oe=Oe.slice(0,Ve)),R.returnMomentTypes=!1,R.outputTypes=Oe,M(B,function(ve){return ve.format(R)})}function ie(){var D=[].slice.call(arguments),R=L({},this.format.defaults),B=this.asMilliseconds(),ce=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&(B=0,ce=0);var Oe=B<0,Ve=n.duration(Math.abs(B),"milliseconds"),ve=n.duration(Math.abs(ce),"months");x(D,function(F){if(typeof F=="string"||typeof F=="function"){R.template=F;return}if(typeof F=="number"){R.precision=F;return}k(F)&&L(R,F)});var at={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},be={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};R.types=l;var Ot=function(F){return C(l,function(et){return be[et].test(F)})},It=new RegExp(M(l,function(F){return be[F].source}).join("|"),"g");R.duration=this;var rt=typeof R.template=="function"?R.template.apply(R):R.template,ee=R.outputTypes,nt=R.returnMomentTypes,we=R.largest,le=[];ee||(w(R.stopTrim)&&(R.stopTrim=R.stopTrim.join("")),R.stopTrim&&x(R.stopTrim.match(It),function(F){var et=Ot(F);et==="escape"||et==="general"||le.push(et)}));var he=n.localeData();he||(he={}),x(Q(y),function(F){if(typeof y[F]=="function"){he[F]||(he[F]=y[F]);return}he["_"+F]||(he["_"+F]=y[F])}),x(Q(he._durationTimeTemplates),function(F){rt=rt.replace("_"+F+"_",he._durationTimeTemplates[F])});var Le=R.userLocale||n.locale(),Pe=R.useLeftUnits,Ke=R.usePlural,ue=R.precision,Ie=R.forceLength,lt=R.useGrouping,Ae=R.trunc,Je=R.useSignificantDigits&&ue>0,mt=Je?R.precision:0,gt=mt,_e=R.minValue,Ht=!1,$t=R.maxValue,Tt=!1,At=R.useToLocaleString,Qt=R.groupingSeparator,Pt=R.decimalSeparator,kn=R.grouping;At=At&&(r||i);var Bt=R.trim;w(Bt)&&(Bt=Bt.join(" ")),Bt===null&&(we||$t||Je)&&(Bt="all"),(Bt===null||Bt===!0||Bt==="left"||Bt==="right")&&(Bt="large"),Bt===!1&&(Bt="");var Rt=function(F){return F.test(Bt)},Sn=/large/,wn=/small/,De=/both/,pe=/mid/,st=/^all|[^sm]all/,Xt=/final/,on=we>0||J([Sn,De,st],Rt),Ne=J([wn,De,st],Rt),Vt=J([pe,st],Rt),_t=J([Xt,st],Rt),Kt=M(rt.match(It),function(F,et){var qe=Ot(F);return F.slice(0,1)==="*"&&(F=F.slice(1),qe!=="escape"&&qe!=="general"&&le.push(qe)),{index:et,length:F.length,text:"",token:qe==="escape"?F.replace(be.escape,"$1"):F,type:qe==="escape"||qe==="general"?null:qe}}),yt={index:0,length:0,token:"",text:"",type:null},Dt=[];Pe&&Kt.reverse(),x(Kt,function(F){if(F.type){(yt.type||yt.text)&&Dt.push(yt),yt=F;return}Pe?yt.text=F.token+yt.text:yt.text+=F.token}),(yt.type||yt.text)&&Dt.push(yt),Pe&&Dt.reverse();var Qe=A(l,H(E(O(Dt,"type"))));if(!Qe.length)return O(Dt,"text").join("");Qe=M(Qe,function(F,et){var qe=et+1===Qe.length,Wt=!et,Hn;F==="years"||F==="months"?Hn=ve.as(F):Hn=Ve.as(F);var yn=Math.floor(Hn),Kn=Hn-yn,Pn=C(Dt,function(nn){return F===nn.type});return Wt&&$t&&Hn>$t&&(Tt=!0),qe&&_e&&Math.abs(R.duration.as(F))<_e&&(Ht=!0),Wt&&Ie===null&&Pn.length>1&&(Ie=!0),Ve.subtract(yn,F),ve.subtract(yn,F),{rawValue:Hn,wholeValue:yn,decimalValue:qe?Kn:0,isSmallest:qe,isLargest:Wt,type:F,tokenLength:Pn.length}});var qt=Ae?Math.floor:Math.round,Ut=function(F,et){var qe=Math.pow(10,et);return qt(F*qe)/qe},Yt=!1,Zt=!1,_n=function(F,et){var qe={useGrouping:lt,groupingSeparator:Qt,decimalSeparator:Pt,grouping:kn,useToLocaleString:At};return Je&&(mt<=0?(F.rawValue=0,F.wholeValue=0,F.decimalValue=0):(qe.maximumSignificantDigits=mt,F.significantDigits=mt)),Tt&&!Zt&&(F.isLargest?(F.wholeValue=$t,F.decimalValue=0):(F.wholeValue=0,F.decimalValue=0)),Ht&&!Zt&&(F.isSmallest?(F.wholeValue=_e,F.decimalValue=0):(F.wholeValue=0,F.decimalValue=0)),F.isSmallest||F.significantDigits&&F.significantDigits-F.wholeValue.toString().length<=0?ue<0?F.value=Ut(F.wholeValue,ue):ue===0?F.value=qt(F.wholeValue+F.decimalValue):Je?(Ae?F.value=Ut(F.rawValue,mt-F.wholeValue.toString().length):F.value=F.rawValue,F.wholeValue&&(mt-=F.wholeValue.toString().length)):(qe.fractionDigits=ue,Ae?F.value=F.wholeValue+Ut(F.decimalValue,ue):F.value=F.wholeValue+F.decimalValue):Je&&F.wholeValue?(F.value=Math.round(Ut(F.wholeValue,F.significantDigits-F.wholeValue.toString().length)),mt-=F.wholeValue.toString().length):F.value=F.wholeValue,F.tokenLength>1&&(Ie||Yt)&&(qe.minimumIntegerDigits=F.tokenLength,Zt&&qe.maximumSignificantDigits<F.tokenLength&&delete qe.maximumSignificantDigits),!Yt&&(F.value>0||Bt===""||C(le,F.type)||C(ee,F.type))&&(Yt=!0),F.formattedValue=p(F.value,qe,Le),qe.useGrouping=!1,qe.decimalSeparator=".",F.formattedValueEn=p(F.value,qe,"en"),F.tokenLength===2&&F.type==="milliseconds"&&(F.formattedValueMS=p(F.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),F};if(Qe=M(Qe,_n),Qe=E(Qe),Qe.length>1){var no=function(F){return C(Qe,function(et){return et.type===F})},sr=function(F){var et=no(F.type);et&&x(F.targets,function(qe){var Wt=no(qe.type);Wt&&parseInt(et.formattedValueEn,10)===qe.value&&(et.rawValue=0,et.wholeValue=0,et.decimalValue=0,Wt.rawValue+=1,Wt.wholeValue+=1,Wt.decimalValue=0,Wt.formattedValueEn=Wt.wholeValue.toString(),Zt=!0)})};x(s,sr)}return Zt&&(Yt=!1,mt=gt,Qe=M(Qe,_n),Qe=E(Qe)),ee&&!(Tt&&!R.trim)?(Qe=M(Qe,function(F){return C(ee,function(et){return F.type===et})?F:null}),Qe=E(Qe)):(on&&(Qe=V(Qe,function(F){return!F.isSmallest&&!F.wholeValue&&!C(le,F.type)})),we&&Qe.length&&(Qe=Qe.slice(0,we)),Ne&&Qe.length>1&&(Qe=P(Qe,function(F){return!F.wholeValue&&!C(le,F.type)&&!F.isLargest})),Vt&&(Qe=M(Qe,function(F,et){return et>0&&et<Qe.length-1&&!F.wholeValue?null:F}),Qe=E(Qe)),_t&&Qe.length===1&&!Qe[0].wholeValue&&!(!Ae&&Qe[0].isSmallest&&Qe[0].rawValue<_e)&&(Qe=[])),nt?Qe:(x(Dt,function(F){var et=at[F.type],qe=C(Qe,function(nn){return nn.type===F.type});if(!(!et||!qe)){var Wt=qe.formattedValueEn.split(".");Wt[0]=parseInt(Wt[0],10),Wt[1]?Wt[1]=parseFloat("0."+Wt[1],10):Wt[1]=null;var Hn=he.durationPluralKey(et,Wt[0],Wt[1]),yn=m(et,he),Kn=!1,Pn={};x(he._durationLabelTypes,function(nn){var Nn=C(yn,function(qn){return qn.type===nn.type&&qn.key===Hn});Nn&&(Pn[Nn.type]=Nn.label,c(F.text,nn.string)&&(F.text=F.text.replace(nn.string,Nn.label),Kn=!0))}),Ke&&!Kn&&(yn.sort(g),x(yn,function(nn){if(Pn[nn.type]===nn.label)return c(F.text,nn.label)?!1:void 0;if(c(F.text,nn.label))return F.text=F.text.replace(nn.label,Pn[nn.type]),!1}))}}),Dt=M(Dt,function(F){if(!F.type)return F.text;var et=C(Qe,function(Wt){return Wt.type===F.type});if(!et)return"";var qe="";return Pe&&(qe+=F.text),(Oe&&Tt||!Oe&&Ht)&&(qe+="< ",Tt=!1,Ht=!1),(Oe&&Ht||!Oe&&Tt)&&(qe+="> ",Tt=!1,Ht=!1),Oe&&(et.value>0||Bt===""||C(le,et.type)||C(ee,et.type))&&(qe+="-",Oe=!1),F.type==="milliseconds"&&et.formattedValueMS?qe+=et.formattedValueMS:qe+=et.formattedValue,Pe||(qe+=F.text),qe}),Dt.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ae(){var D=this.duration,R=function(Oe){return D._data[Oe]},B=C(this.types,R),ce=S(this.types,R);switch(B){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if(B===ce)return"d __";case"weeks":return B===ce?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if(B===ce)return"M __";case"years":return B===ce?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function fe(D){if(!D)throw"Moment Duration Format init cannot find moment instance.";D.duration.format=j,D.duration.fn.format=ie,D.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ae,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},D.updateLocale("en",y)}var ge=function(D,R,B){return D.toLocaleString(R,B)};r=Ee()&&re(ge),o=r&&me(ge);var K=function(D,R,B){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(R,B).format(D)};return i=re(K),a=i&&me(K),fe(n),fe})})(Pm);const zm=["true","t","yes","y","on","1"],Fm=["false","f","no","n","off","0"];function Ft(e,t=""){return e=`\u26A0\uFE0F ${e}`,{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e+(t?`
177
177
 
178
178
  ${t}
@@ -188,4 +188,4 @@ Error: ${d}`)}},[t,n,e,r,o])}}function i1(e,t,n,r,o,i,a){const l=t.defaultRowHei
188
188
  0%, 80%, 100% { opacity: 0; }
189
189
  40% { opacity: 1; }
190
190
  `]))),Mv=function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return We({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},zl=function(e){var t=e.delay,n=e.offset;return $e("span",{css:Jd({animation:"".concat(Sv," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Rv=function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=r===void 0?4:r,i=Sr(e,mv);return $e("div",Ze({},tn(We(We({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),$e(zl,{delay:0,offset:n}),$e(zl,{delay:160,offset:!0}),$e(zl,{delay:320,offset:!n}))},Ev=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return We({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},Iv=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return $e("div",Ze({ref:o},tn(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},Tv=Iv,Ov=["data"],Dv=function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},Hv=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return $e("div",Ze({},tn(e,"group",{group:!0}),l),$e(i,Ze({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),s),$e("div",null,t))},Pv=function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return We({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},zv=function(e){var t=Ou(e);t.data;var n=Sr(t,Ov);return $e("div",Ze({},tn(e,"groupHeading",{"group-heading":!0}),n))},Fv=Hv,Lv=["innerRef","isDisabled","isHidden","inputClassName"],Av=function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return We(We({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Vv),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},Bu={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Vv={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":We({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Bu)},_v=function(e){return We({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Bu)},Nv=function(e){var t=e.cx,n=e.value,r=Ou(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,s=Sr(r,Lv);return $e("div",Ze({},tn(e,"input",{"input-container":!0}),{"data-value":n||""}),$e("input",Ze({className:t({input:!0},l),ref:o,style:_v(a),disabled:i},s)))},$v=Nv,Bv=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return We({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Wv=function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return We({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},jv=function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return We({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Wu=function(e){var t=e.children,n=e.innerProps;return $e("div",n,t)},Uv=Wu,Yv=Wu;function Gv(e){var t=e.children,n=e.innerProps;return $e("div",Ze({role:"button"},n),t||$e(Pl,{size:14}))}var Xv=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return $e(s,{data:r,innerProps:We(We({},tn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},$e(c,{data:r,innerProps:We({},tn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),$e(u,{data:r,innerProps:We(We({},tn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},Kv=Xv,qv=function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return We({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:o?l.primary:l.primary50}})},Zv=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return $e("div",Ze({},tn(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},Jv=Zv,Qv=function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return We({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},eb=function(e){var t=e.children,n=e.innerProps;return $e("div",Ze({},tn(e,"placeholder",{placeholder:!0}),n),t)},tb=eb,nb=function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return We({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},rb=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return $e("div",Ze({},tn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ob=rb,ju={ClearIndicator:xv,Control:Tv,DropdownIndicator:wv,DownChevron:Nu,CrossIcon:Pl,Group:Fv,GroupHeading:zv,IndicatorsContainer:pv,IndicatorSeparator:kv,Input:$v,LoadingIndicator:Rv,Menu:ev,MenuList:nv,MenuPortal:sv,LoadingMessage:av,NoOptionsMessage:iv,MultiValue:Kv,MultiValueContainer:Uv,MultiValueLabel:Yv,MultiValueRemove:Gv,Option:Jv,Placeholder:tb,SelectContainer:uv,SingleValue:ob,ValueContainer:hv},ib=function(e){return We(We({},ju),e.components)},Uu=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function ab(e,t){return!!(e===t||Uu(e)&&Uu(t))}function lb(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ab(e[n],t[n]))return!1;return!0}function sb(e,t){t===void 0&&(t=lb);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}for(var cb={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"},ub=function(e){return $e("span",Ze({css:cb},e))},Yu=ub,db={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.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 i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" 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(e){var t=e.action,n=e.label,r=n===void 0?"":n,o=e.labels,i=e.isDisabled;switch(t){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 i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(t==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if(t==="menu"&&c){var d=l?" disabled":"",f="".concat(s?" selected":"").concat(d);return"".concat(i).concat(f,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},hb=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,s=e.id,c=e.isAppleDevice,u=l.ariaLiveMessages,d=l.getOptionLabel,f=l.inputValue,p=l.isMulti,g=l.isOptionDisabled,m=l.isSearchable,b=l.menuIsOpen,y=l.options,w=l.screenReaderStatus,k=l.tabSelectsValue,S=l.isLoading,C=l["aria-label"],x=l["aria-live"],M=h.useMemo(function(){return We(We({},db),u||{})},[u]),O=h.useMemo(function(){var L="";if(t&&M.onChange){var Q=t.option,J=t.options,ne=t.removedValue,Ee=t.removedValues,me=t.value,re=function(K){return Array.isArray(K)?null:K},j=ne||Q||re(me),ie=j?d(j):"",ae=J||Ee||void 0,fe=ae?ae.map(d):[],ge=We({isDisabled:j&&g(j,a),label:ie,labels:fe},t);L=M.onChange(ge)}return L},[t,M,g,a,d]),E=h.useMemo(function(){var L="",Q=n||r,J=!!(n&&a&&a.includes(n));if(Q&&M.onFocus){var ne={focused:Q,label:d(Q),isDisabled:g(Q,a),isSelected:J,options:o,context:Q===n?"menu":"value",selectValue:a,isAppleDevice:c};L=M.onFocus(ne)}return L},[n,r,d,g,M,o,a,c]),H=h.useMemo(function(){var L="";if(b&&y.length&&!S&&M.onFilter){var Q=w({count:o.length});L=M.onFilter({inputValue:f,resultsMessage:Q})}return L},[o,f,b,M,y,w,S]),A=(t==null?void 0:t.action)==="initial-input-focus",V=h.useMemo(function(){var L="";if(M.guidance){var Q=r?"value":b?"menu":"input";L=M.guidance({"aria-label":C,context:Q,isDisabled:n&&g(n,a),isMulti:p,isSearchable:m,tabSelectsValue:k,isInitialFocus:A})}return L},[C,n,r,p,g,m,b,M,a,k,A]),P=$e(h.Fragment,null,$e("span",{id:"aria-selection"},O),$e("span",{id:"aria-focused"},E),$e("span",{id:"aria-results"},H),$e("span",{id:"aria-guidance"},V));return $e(h.Fragment,null,$e(Yu,{id:s},A&&P),$e(Yu,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!A&&P))},fb=hb,Fl=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],pb=new RegExp("["+Fl.map(function(e){return e.letters}).join("")+"]","g"),Gu={},Ll=0;Ll<Fl.length;Ll++)for(var Al=Fl[Ll],Vl=0;Vl<Al.letters.length;Vl++)Gu[Al.letters[Vl]]=Al.base;var Xu=function(e){return e.replace(pb,function(t){return Gu[t]})},gb=sb(Xu),Ku=function(e){return e.replace(/^\s+|\s+$/g,"")},mb=function(e){return"".concat(e.label," ").concat(e.value)},vb=function(e){return function(t,n){if(t.data.__isNew__)return!0;var r=We({ignoreCase:!0,ignoreAccents:!0,stringify:mb,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,s=r.matchFrom,c=l?Ku(n):n,u=l?Ku(a(t)):a(t);return o&&(c=c.toLowerCase(),u=u.toLowerCase()),i&&(c=gb(c),u=Xu(u)),s==="start"?u.substr(0,c.length)===c:u.indexOf(c)>-1}},bb=["innerRef"];function wb(e){var t=e.innerRef,n=Sr(e,bb),r=Y1(n,"onExited","in","enter","exit","appear");return $e("input",Ze({ref:t},r,{css:Jd({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 yb=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function xb(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,o=e.onTopArrive,i=e.onTopLeave,a=h.useRef(!1),l=h.useRef(!1),s=h.useRef(0),c=h.useRef(null),u=h.useCallback(function(b,y){if(c.current!==null){var w=c.current,k=w.scrollTop,S=w.scrollHeight,C=w.clientHeight,x=c.current,M=y>0,O=S-C-k,E=!1;O>y&&a.current&&(r&&r(b),a.current=!1),M&&l.current&&(i&&i(b),l.current=!1),M&&y>O?(n&&!a.current&&n(b),x.scrollTop=S,E=!0,a.current=!0):!M&&-y>k&&(o&&!l.current&&o(b),x.scrollTop=0,E=!0,l.current=!0),E&&yb(b)}},[n,r,o,i]),d=h.useCallback(function(b){u(b,b.deltaY)},[u]),f=h.useCallback(function(b){s.current=b.changedTouches[0].clientY},[]),p=h.useCallback(function(b){var y=s.current-b.changedTouches[0].clientY;u(b,y)},[u]),g=h.useCallback(function(b){if(b){var y=W1?{passive:!1}:!1;b.addEventListener("wheel",d,y),b.addEventListener("touchstart",f,y),b.addEventListener("touchmove",p,y)}},[p,f,d]),m=h.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",p,!1))},[p,f,d]);return h.useEffect(function(){if(t){var b=c.current;return g(b),function(){m(b)}}},[t,g,m]),function(b){c.current=b}}var qu=["boxSizing","height","overflow","paddingRight","position"],Zu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Ju(e){e.preventDefault()}function Qu(e){e.stopPropagation()}function ed(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function td(){return"ontouchstart"in window||navigator.maxTouchPoints}var nd=!!(typeof window<"u"&&window.document&&window.document.createElement),ei=0,xo={capture:!1,passive:!1};function Cb(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,o=h.useRef({}),i=h.useRef(null),a=h.useCallback(function(s){if(nd){var c=document.body,u=c&&c.style;if(r&&qu.forEach(function(g){var m=u&&u[g];o.current[g]=m}),r&&ei<1){var d=parseInt(o.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,p=window.innerWidth-f+d||0;Object.keys(Zu).forEach(function(g){var m=Zu[g];u&&(u[g]=m)}),u&&(u.paddingRight="".concat(p,"px"))}c&&td()&&(c.addEventListener("touchmove",Ju,xo),s&&(s.addEventListener("touchstart",ed,xo),s.addEventListener("touchmove",Qu,xo))),ei+=1}},[r]),l=h.useCallback(function(s){if(nd){var c=document.body,u=c&&c.style;ei=Math.max(ei-1,0),r&&ei<1&&qu.forEach(function(d){var f=o.current[d];u&&(u[d]=f)}),c&&td()&&(c.removeEventListener("touchmove",Ju,xo),s&&(s.removeEventListener("touchstart",ed,xo),s.removeEventListener("touchmove",Qu,xo)))}},[r]);return h.useEffect(function(){if(t){var s=i.current;return a(s),function(){l(s)}}},[t,a,l]),function(s){i.current=s}}var kb=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},Sb={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Mb(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,o=r===void 0?!0:r,i=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,s=e.onTopLeave,c=xb({isEnabled:o,onBottomArrive:i,onBottomLeave:a,onTopArrive:l,onTopLeave:s}),u=Cb({isEnabled:n}),d=function(f){c(f),u(f)};return $e(h.Fragment,null,n&&$e("div",{onClick:kb,css:Sb}),t(d))}var Rb={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Eb=function(e){var t=e.name,n=e.onFocus;return $e("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:Rb,value:"",onChange:function(){}})},Ib=Eb;function _l(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 Tb(){return _l(/^iPhone/i)}function rd(){return _l(/^Mac/i)}function Ob(){return _l(/^iPad/i)||rd()&&navigator.maxTouchPoints>1}function Db(){return Tb()||Ob()}function Hb(){return rd()||Db()}var Pb=function(e){return e.label},zb=function(e){return e.label},Fb=function(e){return e.value},Lb=function(e){return!!e.isDisabled},Ab={clearIndicator:yv,container:cv,control:Ev,dropdownIndicator:bv,group:Dv,groupHeading:Pv,indicatorsContainer:fv,indicatorSeparator:Cv,input:Av,loadingIndicator:Mv,loadingMessage:ov,menu:Z1,menuList:tv,menuPortal:lv,multiValue:Bv,multiValueLabel:Wv,multiValueRemove:jv,noOptionsMessage:rv,option:qv,placeholder:Qv,singleValue:nb,valueContainer:dv},Vb={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%)"},_b=4,od=4,Nb=38,$b=od*2,Bb={baseUnit:od,controlHeight:Nb,menuGutter:$b},Nl={borderRadius:_b,colors:Vb,spacing:Bb},Wb={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Pu(),captureMenuScroll:!Pu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:vb(),formatGroupLabel:Pb,getOptionLabel:zb,getOptionValue:Fb,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Lb,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!$1(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function id(e,t,n,r){var o=ud(e,t,n),i=dd(e,t,n),a=cd(e,t),l=ha(e,t);return{type:"option",data:t,isDisabled:o,isSelected:i,label:a,value:l,index:r}}function da(e,t){return e.options.map(function(n,r){if("options"in n){var o=n.options.map(function(a,l){return id(e,a,t,l)}).filter(function(a){return sd(e,a)});return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=id(e,n,t,r);return sd(e,i)?i:void 0}).filter(j1)}function ad(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,hs(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function ld(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,hs(r.options.map(function(o){return{data:o.data,id:"".concat(t,"-").concat(r.index,"-").concat(o.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function jb(e,t){return ad(da(e,t))}function sd(e,t){var n=e.inputValue,r=n===void 0?"":n,o=t.data,i=t.isSelected,a=t.label,l=t.value;return(!fd(e)||!i)&&hd(e,{label:a,value:l,data:o},r)}function Ub(e,t){var n=e.focusedValue,r=e.selectValue,o=r.indexOf(n);if(o>-1){var i=t.indexOf(n);if(i>-1)return n;if(o<t.length)return t[o]}return null}function Yb(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var $l=function(e,t){var n,r=(n=e.find(function(o){return o.data===t}))===null||n===void 0?void 0:n.id;return r||null},cd=function(e,t){return e.getOptionLabel(t)},ha=function(e,t){return e.getOptionValue(t)};function ud(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function dd(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ha(e,t);return n.some(function(o){return ha(e,o)===r})}function hd(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var fd=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return t===void 0?n:t},Gb=1,pd=function(e){Py(n,e);var t=Ly(n);function n(r){var o;if(zy(this,n),o=t.call(this,r),o.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:""},o.blockOptionHover=!1,o.isComposing=!1,o.commonProps=void 0,o.initialTouchX=0,o.initialTouchY=0,o.openAfterFocus=!1,o.scrollToFocusedOptionOnUpdate=!1,o.userIsDragging=void 0,o.isAppleDevice=Hb(),o.controlRef=null,o.getControlRef=function(s){o.controlRef=s},o.focusedOptionRef=null,o.getFocusedOptionRef=function(s){o.focusedOptionRef=s},o.menuListRef=null,o.getMenuListRef=function(s){o.menuListRef=s},o.inputRef=null,o.getInputRef=function(s){o.inputRef=s},o.focus=o.focusInput,o.blur=o.blurInput,o.onChange=function(s,c){var u=o.props,d=u.onChange,f=u.name;c.name=f,o.ariaOnChange(s,c),d(s,c)},o.setValue=function(s,c,u){var d=o.props,f=d.closeMenuOnSelect,p=d.isMulti,g=d.inputValue;o.onInputChange("",{action:"set-value",prevInputValue:g}),f&&(o.setState({inputIsHiddenAfterUpdate:!p}),o.onMenuClose()),o.setState({clearFocusValueOnUpdate:!0}),o.onChange(s,{action:c,option:u})},o.selectOption=function(s){var c=o.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,p=o.state.selectValue,g=d&&o.isOptionSelected(s,p),m=o.isOptionDisabled(s,p);if(g){var b=o.getOptionValue(s);o.setValue(p.filter(function(y){return o.getOptionValue(y)!==b}),"deselect-option",s)}else if(!m)d?o.setValue([].concat(hs(p),[s]),"select-option",s):o.setValue(s,"select-option");else{o.ariaOnChange(s,{action:"select-option",option:s,name:f});return}u&&o.blurInput()},o.removeValue=function(s){var c=o.props.isMulti,u=o.state.selectValue,d=o.getOptionValue(s),f=u.filter(function(g){return o.getOptionValue(g)!==d}),p=ua(c,f,f[0]||null);o.onChange(p,{action:"remove-value",removedValue:s}),o.focusInput()},o.clearValue=function(){var s=o.state.selectValue;o.onChange(ua(o.props.isMulti,[],null),{action:"clear",removedValues:s})},o.popValue=function(){var s=o.props.isMulti,c=o.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=ua(s,d,d[0]||null);o.onChange(f,{action:"pop-value",removedValue:u})},o.getFocusedOptionId=function(s){return $l(o.state.focusableOptionsWithIds,s)},o.getFocusableOptionsWithIds=function(){return ld(da(o.props,o.state.selectValue),o.getElementId("option"))},o.getValue=function(){return o.state.selectValue},o.cx=function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return L1.apply(void 0,[o.props.classNamePrefix].concat(c))},o.getOptionLabel=function(s){return cd(o.props,s)},o.getOptionValue=function(s){return ha(o.props,s)},o.getStyles=function(s,c){var u=o.props.unstyled,d=Ab[s](c,u);d.boxSizing="border-box";var f=o.props.styles[s];return f?f(d,c):d},o.getClassNames=function(s,c){var u,d;return(u=(d=o.props.classNames)[s])===null||u===void 0?void 0:u.call(d,c)},o.getElementId=function(s){return"".concat(o.state.instancePrefix,"-").concat(s)},o.getComponents=function(){return ib(o.props)},o.buildCategorizedOptions=function(){return da(o.props,o.state.selectValue)},o.getCategorizedOptions=function(){return o.props.menuIsOpen?o.buildCategorizedOptions():[]},o.buildFocusableOptions=function(){return ad(o.buildCategorizedOptions())},o.getFocusableOptions=function(){return o.props.menuIsOpen?o.buildFocusableOptions():[]},o.ariaOnChange=function(s,c){o.setState({ariaSelection:We({value:s},c)})},o.onMenuMouseDown=function(s){s.button===0&&(s.stopPropagation(),s.preventDefault(),o.focusInput())},o.onMenuMouseMove=function(s){o.blockOptionHover=!1},o.onControlMouseDown=function(s){if(!s.defaultPrevented){var c=o.props.openMenuOnClick;o.state.isFocused?o.props.menuIsOpen?s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&o.onMenuClose():c&&o.openMenu("first"):(c&&(o.openAfterFocus=!0),o.focusInput()),s.target.tagName!=="INPUT"&&s.target.tagName!=="TEXTAREA"&&s.preventDefault()}},o.onDropdownIndicatorMouseDown=function(s){if(!(s&&s.type==="mousedown"&&s.button!==0)&&!o.props.isDisabled){var c=o.props,u=c.isMulti,d=c.menuIsOpen;o.focusInput(),d?(o.setState({inputIsHiddenAfterUpdate:!u}),o.onMenuClose()):o.openMenu("first"),s.preventDefault()}},o.onClearIndicatorMouseDown=function(s){s&&s.type==="mousedown"&&s.button!==0||(o.clearValue(),s.preventDefault(),o.openAfterFocus=!1,s.type==="touchend"?o.focusInput():setTimeout(function(){return o.focusInput()}))},o.onScroll=function(s){typeof o.props.closeMenuOnScroll=="boolean"?s.target instanceof HTMLElement&&aa(s.target)&&o.props.onMenuClose():typeof o.props.closeMenuOnScroll=="function"&&o.props.closeMenuOnScroll(s)&&o.props.onMenuClose()},o.onCompositionStart=function(){o.isComposing=!0},o.onCompositionEnd=function(){o.isComposing=!1},o.onTouchStart=function(s){var c=s.touches,u=c&&c.item(0);u&&(o.initialTouchX=u.clientX,o.initialTouchY=u.clientY,o.userIsDragging=!1)},o.onTouchMove=function(s){var c=s.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-o.initialTouchX),f=Math.abs(u.clientY-o.initialTouchY),p=5;o.userIsDragging=d>p||f>p}},o.onTouchEnd=function(s){o.userIsDragging||(o.controlRef&&!o.controlRef.contains(s.target)&&o.menuListRef&&!o.menuListRef.contains(s.target)&&o.blurInput(),o.initialTouchX=0,o.initialTouchY=0)},o.onControlTouchEnd=function(s){o.userIsDragging||o.onControlMouseDown(s)},o.onClearIndicatorTouchEnd=function(s){o.userIsDragging||o.onClearIndicatorMouseDown(s)},o.onDropdownIndicatorTouchEnd=function(s){o.userIsDragging||o.onDropdownIndicatorMouseDown(s)},o.handleInputChange=function(s){var c=o.props.inputValue,u=s.currentTarget.value;o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange(u,{action:"input-change",prevInputValue:c}),o.props.menuIsOpen||o.onMenuOpen()},o.onInputFocus=function(s){o.props.onFocus&&o.props.onFocus(s),o.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(o.openAfterFocus||o.props.openMenuOnFocus)&&o.openMenu("first"),o.openAfterFocus=!1},o.onInputBlur=function(s){var c=o.props.inputValue;if(o.menuListRef&&o.menuListRef.contains(document.activeElement)){o.inputRef.focus();return}o.props.onBlur&&o.props.onBlur(s),o.onInputChange("",{action:"input-blur",prevInputValue:c}),o.onMenuClose(),o.setState({focusedValue:null,isFocused:!1})},o.onOptionHover=function(s){if(!(o.blockOptionHover||o.state.focusedOption===s)){var c=o.getFocusableOptions(),u=c.indexOf(s);o.setState({focusedOption:s,focusedOptionId:u>-1?o.getFocusedOptionId(s):null})}},o.shouldHideSelectedOptions=function(){return fd(o.props)},o.onValueInputFocus=function(s){s.preventDefault(),s.stopPropagation(),o.focus()},o.onKeyDown=function(s){var c=o.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,p=c.inputValue,g=c.isClearable,m=c.isDisabled,b=c.menuIsOpen,y=c.onKeyDown,w=c.tabSelectsValue,k=c.openMenuOnFocus,S=o.state,C=S.focusedOption,x=S.focusedValue,M=S.selectValue;if(!m&&!(typeof y=="function"&&(y(s),s.defaultPrevented))){switch(o.blockOptionHover=!0,s.key){case"ArrowLeft":if(!u||p)return;o.focusValue("previous");break;case"ArrowRight":if(!u||p)return;o.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(x)o.removeValue(x);else{if(!d)return;u?o.popValue():g&&o.clearValue()}break;case"Tab":if(o.isComposing||s.shiftKey||!b||!w||!C||k&&o.isOptionSelected(C,M))return;o.selectOption(C);break;case"Enter":if(s.keyCode===229)break;if(b){if(!C||o.isComposing)return;o.selectOption(C);break}return;case"Escape":b?(o.setState({inputIsHiddenAfterUpdate:!1}),o.onInputChange("",{action:"menu-close",prevInputValue:p}),o.onMenuClose()):g&&f&&o.clearValue();break;case" ":if(p)return;if(!b){o.openMenu("first");break}if(!C)return;o.selectOption(C);break;case"ArrowUp":b?o.focusOption("up"):o.openMenu("last");break;case"ArrowDown":b?o.focusOption("down"):o.openMenu("first");break;case"PageUp":if(!b)return;o.focusOption("pageup");break;case"PageDown":if(!b)return;o.focusOption("pagedown");break;case"Home":if(!b)return;o.focusOption("first");break;case"End":if(!b)return;o.focusOption("last");break;default:return}s.preventDefault()}},o.state.instancePrefix="react-select-"+(o.props.instanceId||++Gb),o.state.selectValue=Tu(r.value),r.menuIsOpen&&o.state.selectValue.length){var i=o.getFocusableOptionsWithIds(),a=o.buildFocusableOptions(),l=a.indexOf(o.state.selectValue[0]);o.state.focusableOptionsWithIds=i,o.state.focusedOption=a[l],o.state.focusedOptionId=$l(i,a[l])}return o}return Fy(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&&Hu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Hu(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,i=this.state,a=i.selectValue,l=i.isFocused,s=this.buildFocusableOptions(),c=r==="first"?0:s.length-1;if(!this.props.isMulti){var u=s.indexOf(a[0]);u>-1&&(c=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:s[c],focusedOptionId:this.getFocusedOptionId(s[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var s=i.length-1,c=-1;if(i.length){switch(r){case"previous":l===0?c=0:l===-1?c=s:c=l-1;break;case"next":l>-1&&l<s&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:i[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,s=a.indexOf(i);i||(s=-1),r==="up"?l=s>0?s-1:a.length-1:r==="down"?l=(s+1)%a.length:r==="pageup"?(l=s-o,l<0&&(l=0)):r==="pagedown"?(l=s+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Nl):We(We({},Nl),this.props.theme):Nl}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,s=this.selectOption,c=this.setValue,u=this.props,d=u.isMulti,f=u.isRtl,p=u.options,g=this.hasValue();return{clearValue:r,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:g,isMulti:d,isRtl:f,options:p,selectOption:s,selectProps:u,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,i=r.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(r,o){return ud(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return dd(this.props,r,o)}},{key:"filterOption",value:function(r,o){return hd(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:i,selectValue:a})}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,i=r.isSearchable,a=r.inputId,l=r.inputValue,s=r.tabIndex,c=r.form,u=r.menuIsOpen,d=r.required,f=this.getComponents(),p=f.Input,g=this.state,m=g.inputIsHidden,b=g.ariaSelection,y=this.commonProps,w=a||this.getElementId("input"),k=We(We(We({"aria-autocomplete":"list","aria-expanded":u,"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":d,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?(b==null?void 0:b.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?h.createElement(p,Ze({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:w,innerRef:this.getInputRef,isDisabled:o,isHidden:m,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:s,form:c,type:"text",value:l},k)):h.createElement(wb,Ze({id:w,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ia,onFocus:this.onInputFocus,disabled:o,tabIndex:s,inputMode:"none",form:c,value:""},k))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,s=o.MultiValueRemove,c=o.SingleValue,u=o.Placeholder,d=this.commonProps,f=this.props,p=f.controlShouldRenderValue,g=f.isDisabled,m=f.isMulti,b=f.inputValue,y=f.placeholder,w=this.state,k=w.selectValue,S=w.focusedValue,C=w.isFocused;if(!this.hasValue()||!p)return b?null:h.createElement(u,Ze({},d,{key:"placeholder",isDisabled:g,isFocused:C,innerProps:{id:this.getElementId("placeholder")}}),y);if(m)return k.map(function(M,O){var E=M===S,H="".concat(r.getOptionLabel(M),"-").concat(r.getOptionValue(M));return h.createElement(i,Ze({},d,{components:{Container:a,Label:l,Remove:s},isFocused:E,isDisabled:g,key:H,index:O,removeProps:{onClick:function(){return r.removeValue(M)},onTouchEnd:function(){return r.removeValue(M)},onMouseDown:function(A){A.preventDefault()}},data:M}),r.formatOptionLabel(M,"value"))});if(b)return null;var x=k[0];return h.createElement(c,Ze({},d,{data:x,isDisabled:g}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||s)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Ze({},i,{innerProps:u,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,s=a.isLoading,c=this.state.isFocused;if(!o||!s)return null;var u={"aria-hidden":"true"};return h.createElement(o,Ze({},i,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,i=r.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,s=this.state.isFocused;return h.createElement(i,Ze({},a,{isDisabled:l,isFocused:s}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,s={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return h.createElement(o,Ze({},i,{innerProps:s,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,s=o.MenuList,c=o.MenuPortal,u=o.LoadingMessage,d=o.NoOptionsMessage,f=o.Option,p=this.commonProps,g=this.state.focusedOption,m=this.props,b=m.captureMenuScroll,y=m.inputValue,w=m.isLoading,k=m.loadingMessage,S=m.minMenuHeight,C=m.maxMenuHeight,x=m.menuIsOpen,M=m.menuPlacement,O=m.menuPosition,E=m.menuPortalTarget,H=m.menuShouldBlockScroll,A=m.menuShouldScrollIntoView,V=m.noOptionsMessage,P=m.onMenuScrollToTop,L=m.onMenuScrollToBottom;if(!x)return null;var Q=function(j,ie){var ae=j.type,fe=j.data,ge=j.isDisabled,K=j.isSelected,D=j.label,R=j.value,B=g===fe,ce=ge?void 0:function(){return r.onOptionHover(fe)},Oe=ge?void 0:function(){return r.selectOption(fe)},Ve="".concat(r.getElementId("option"),"-").concat(ie),ve={id:Ve,onClick:Oe,onMouseMove:ce,onMouseOver:ce,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:K};return h.createElement(f,Ze({},p,{innerProps:ve,data:fe,isDisabled:ge,isSelected:K,key:Ve,label:D,type:ae,value:R,isFocused:B,innerRef:B?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(j.data,"menu"))},J;if(this.hasOptions())J=this.getCategorizedOptions().map(function(j){if(j.type==="group"){var ie=j.data,ae=j.options,fe=j.index,ge="".concat(r.getElementId("group"),"-").concat(fe),K="".concat(ge,"-heading");return h.createElement(i,Ze({},p,{key:ge,data:ie,options:ae,Heading:a,headingProps:{id:K,data:j.data},label:r.formatGroupLabel(j.data)}),j.options.map(function(D){return Q(D,"".concat(fe,"-").concat(D.index))}))}else if(j.type==="option")return Q(j,"".concat(j.index))});else if(w){var ne=k({inputValue:y});if(ne===null)return null;J=h.createElement(u,p,ne)}else{var Ee=V({inputValue:y});if(Ee===null)return null;J=h.createElement(d,p,Ee)}var me={minMenuHeight:S,maxMenuHeight:C,menuPlacement:M,menuPosition:O,menuShouldScrollIntoView:A},re=h.createElement(J1,Ze({},p,me),function(j){var ie=j.ref,ae=j.placerProps,fe=ae.placement,ge=ae.maxHeight;return h.createElement(l,Ze({},p,me,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:w,placement:fe}),h.createElement(Mb,{captureEnabled:b,onTopArrive:P,onBottomArrive:L,lockEnabled:H},function(K){return h.createElement(s,Ze({},p,{innerRef:function(D){r.getMenuListRef(D),K(D)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:r.getElementId("listbox")},isLoading:w,maxHeight:ge,focusedOption:g}),J)}))});return E||O==="fixed"?h.createElement(c,Ze({},p,{appendTo:E,controlElement:this.controlRef,menuPlacement:M,menuPosition:O}),re):re}},{key:"renderFormField",value:function(){var r=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,s=o.name,c=o.required,u=this.state.selectValue;if(c&&!this.hasValue()&&!a)return h.createElement(Ib,{name:s,onFocus:this.onValueInputFocus});if(!(!s||a))if(l)if(i){var d=u.map(function(g){return r.getOptionValue(g)}).join(i);return h.createElement("input",{name:s,type:"hidden",value:d})}else{var f=u.length>0?u.map(function(g,m){return h.createElement("input",{key:"i-".concat(m),name:s,type:"hidden",value:r.getOptionValue(g)})}):h.createElement("input",{name:s,type:"hidden",value:""});return h.createElement("div",null,f)}else{var p=u[0]?this.getOptionValue(u[0]):"";return h.createElement("input",{name:s,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,s=o.isFocused,c=o.selectValue,u=this.getFocusableOptions();return h.createElement(fb,Ze({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:s,selectValue:c,focusableOptions:u,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,s=this.props,c=s.className,u=s.id,d=s.isDisabled,f=s.menuIsOpen,p=this.state.isFocused,g=this.commonProps=this.getCommonProps();return h.createElement(a,Ze({},g,{className:c,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:d,isFocused:p}),this.renderLiveRegion(),h.createElement(o,Ze({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:d,isFocused:p,menuIsOpen:f}),h.createElement(l,Ze({},g,{isDisabled:d}),this.renderPlaceholderOrValue(),this.renderInput()),h.createElement(i,Ze({},g,{isDisabled:d}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,s=o.ariaSelection,c=o.isFocused,u=o.prevWasFocused,d=o.instancePrefix,f=r.options,p=r.value,g=r.menuIsOpen,m=r.inputValue,b=r.isMulti,y=Tu(p),w={};if(i&&(p!==i.value||f!==i.options||g!==i.menuIsOpen||m!==i.inputValue)){var k=g?jb(r,y):[],S=g?ld(da(r,y),"".concat(d,"-option")):[],C=a?Ub(o,y):null,x=Yb(o,k),M=$l(S,x);w={selectValue:y,focusedOption:x,focusedOptionId:M,focusableOptionsWithIds:S,focusedValue:C,clearFocusValueOnUpdate:!1}}var O=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},E=s,H=c&&u;return c&&!H&&(E={value:ua(b,y,y[0]||null),options:y,action:"initial-input-focus"},H=!u),(s==null?void 0:s.action)==="initial-input-focus"&&(E=null),We(We(We({},w),O),{},{prevProps:r,ariaSelection:E,prevWasFocused:H})}}]),n}(h.Component);pd.defaultProps=Wb;var Xb=h.forwardRef(function(e,t){var n=w1(e);return h.createElement(pd,Ze({ref:t},n))}),Kb=Xb;const qb=e=>{const{Menu:t}=ju,{children:n,...r}=e;return h.createElement(t,{...r},n)},Zb=un("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),Jb=un("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),Qb=un("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),ew=e=>{const{value:t,onFinishedEditing:n,initialValue:r}=e,{allowedValues:o,value:i}=t.data,[a,l]=h.useState(i),[s,c]=h.useState(r??""),u=vp(),d=h.useMemo(()=>o.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[o]);return t.readonly?h.createElement(Qb,null,h.createElement(po,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):h.createElement(Zb,null,h.createElement(Kb,{className:"glide-select",inputValue:s,onInputChange:c,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:p})=>({...f,fontSize:u.editorFontSize,fontFamily:u.fontFamily,cursor:p?"pointer":void 0,paddingLeft:u.cellHorizontalPadding,paddingRight:u.cellHorizontalPadding,":active":{...f[":active"],color:u.accentFg},":empty::after":{content:'"&nbsp;"',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(Jb,null,h.createElement(qb,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(l(f.value),await new Promise(p=>window.requestAnimationFrame(p)),n({...t,data:{...t.data,value:f.value}}))}}))},tw={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{value:i}=t.data,a=t.data.allowedValues.find(s=>typeof s=="string"||s===null||s===void 0?s===i:s.value===i),l=typeof a=="string"?a:(a==null?void 0:a.label)??"";return l&&(n.fillStyle=r.textDark,n.fillText(l,o.x+r.cellHorizontalPadding,o.y+o.height/2+ir(n,r))),!0},measure:(e,t,n)=>{const{value:r}=t.data;return(r?e.measureText(r).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:ew,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},to=6,nw={marginRight:8},rw={display:"flex",alignItems:"center",flexGrow:1},ow={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:r,rect:o}=e,{min:i,max:a,value:l,label:s,measureLabel:c}=t.data,u=o.x+r.cellHorizontalPadding,d=o.y+o.height/2,f=a-i,p=(l-i)/f;n.save();let g=0;s!==void 0&&(n.font=`12px ${r.fontFamily}`,g=Qr(c??s,n,`12px ${r.fontFamily}`).width+r.cellHorizontalPadding);const m=o.width-r.cellHorizontalPadding*2-g;if(m>=to){const b=n.createLinearGradient(u,d,u+m,d);b.addColorStop(0,r.accentColor),b.addColorStop(p,r.accentColor),b.addColorStop(p,r.bgBubble),b.addColorStop(1,r.bgBubble),n.beginPath(),n.fillStyle=b,wu(n,u,d-to/2,m,to,to/2),n.fill(),n.beginPath(),wu(n,u+.5,d-to/2+.5,m-1,to-1,(to-1)/2),n.strokeStyle=r.accentLight,n.lineWidth=1,n.stroke()}return s!==void 0&&(n.textAlign="right",n.fillStyle=r.textDark,n.fillText(s,o.x+o.width-r.cellHorizontalPadding,d+ir(n,`12px ${r.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,r=t.value.toString(),o=t.min.toString(),i=t.max.toString(),a=t.step.toString(),l=s=>{e.onChange({...e.value,data:{...t,value:Number(s.target.value)}})};return h.createElement("label",{style:rw},h.createElement("input",{style:nw,type:"range",value:r,min:o,max:i,step:a,onChange:l,disabled:n}),r)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},iw=un("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),Bl=(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}`)}},aw=e=>{const t=e.value.data,{format:n,displayDate:r}=t,o=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,i=t.min instanceof Date?Bl(n,t.min):t.min,a=t.max instanceof Date?Bl(n,t.max):t.max;let l=t.date;const s=t.timezoneOffset?t.timezoneOffset*60*1e3:0;s&&l&&(l=new Date(l.getTime()+s));const c=Bl(n,l);return e.value.readonly?oe.createElement(po,{highlight:!0,autoFocus:!1,disabled:!0,value:r??"",onChange:()=>{}}):oe.createElement(iw,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:c,min:i,max:a,step:o,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-s)}})}})},lw={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return dc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:r}=t.data;return e.measureText(r).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:aw}),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)}}},sw="None";function cw(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 uw=e=>{const{cell:t,theme:n,ctx:r}=e;dc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},sw,t.contentAlign),r.fillStyle=n.textDark};function dw(e){const t=oe.useCallback((r,o)=>{const{cell:i,theme:a,ctx:l,rect:s}=r,c=r.col;if(Ki(i)&&c<e.length){const u=e[c];["checkbox","line_chart","bar_chart","progress"].includes(u.kind)?o():uw(r),u.isRequired&&u.isEditable&&cw(l,s,a);return}o()},[e]),n=oe.useMemo(()=>[v1,tw,ow,lw,...Um],[]);return{drawCell:t,customRenderers:n}}const gd=",",ti='"',hw='"',md=`
191
- `,fw="\uFEFF",pw=new RegExp(`[${[gd,ti,md].join("")}]`);function vd(e){return e.map(t=>gw(t)).join(gd)+md}function gw(e){if(Xe(e))return"";const t=kt(e);return pw.test(t)?`${ti}${t.replace(new RegExp(ti,"g"),hw+ti)}${ti}`:t}async function bd(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(fw));const i=n.map(a=>a.name);await e.write(o.encode(vd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(vd(l)))}await e.close()}function mw(e,t,n,r){return{exportToCsv:oe.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await cs(()=>import("./es6-ChzZtMws.js").then(async a=>(await a.__tla,a)).then(a=>a.a),__vite__mapDeps([13,1,2]))).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await bd(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{Zd("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:async d=>{a+=new TextDecoder("utf-8").decode(d)},close:async()=>{}});await bd(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=Dy({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){qd("Failed to export data as CSV",a)}}},[t,n,e,r])}}function vw(e,t,n,r,o){const[i,a]=oe.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=i.rows.length>0,f=i.columns.length>0,p=i.current!==void 0,g=oe.useCallback(b=>{const y=!fs(b.rows.toArray(),i.rows.toArray()),w=!fs(b.columns.toArray(),i.columns.toArray()),k=!fs(b.current,i.current);let S=l&&y||c&&w,C=b;if((l||c)&&b.current!==void 0&&k&&(C={...b,rows:i.rows,columns:i.columns},S=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:i.columns},S=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:i.rows},S=!0),w&&C.columns.length>=0){let x=C.columns;r.forEach((M,O)=>{M.isIndex&&(x=x.remove(O))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),S&&o(C)},[i,l,c,o,r]),m=oe.useCallback((b=!1,y=!1)=>{const w={columns:y?i.columns:vt.empty(),rows:b?i.rows:vt.empty(),current:void 0};a(w),(!b&&l||!y&&c)&&o(w)},[i,l,c,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:d,isColumnSelected:f,isCellSelected:p,clearSelection:m,processSelectionChange:g}}function bw({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=oe.useState(!0),a=us(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,d=oe.useCallback(()=>{i(!1),r()},[r,i]);return pn.jsx(my,{content:pn.jsx(vy,{"data-testid":"stDataFrameTooltipContent",children:pn.jsx(by,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:wy.top,accessibilityType:yy.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:xy(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:pn.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const wd=Xd("div",{target:"e1w7nams0"})(({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"}}),""),yd=150,ww=15e4,xd=6;function yw({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i}){const{expanded:a,expand:l,collapse:s,width:c,height:u}=Ey(Iy),d=oe.useRef(null),f=oe.useRef(null),p=oe.useRef(null),g=r1(),{libConfig:{enforceDownloadInNewTab:m=!1}}=oe.useContext(Cy),[b,y]=oe.useState(!0),[w,k]=oe.useState(!1),[S,C]=oe.useState(!1),[x,M]=oe.useState(!1),O=oe.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),E=oe.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Xe(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:H,DYNAMIC:A}=Un.EditingMode,V=t.dimensions,P=Math.max(0,V.dataRows),L=P===0&&!(e.editingMode===A&&V.dataColumns>0),Q=P>ww,J=oe.useRef(new ea(P)),[ne,Ee]=oe.useState(J.current.getNumRows());oe.useEffect(()=>{J.current=new ea(P),Ee(J.current.getNumRows())},[P]);const me=oe.useCallback(()=>{J.current=new ea(P),Ee(J.current.getNumRows())},[P]),{columns:re}=n1(e,t,n);oe.useEffect(()=>{if(e.editingMode===H)return;const pe=r.getStringValue({id:e.id,formId:e.formId});pe&&(J.current.fromJson(pe,re),Ee(J.current.getNumRows()))},[]);const{getCellContent:j}=o1(t,re,ne,J),{columns:ie,sortColumn:ae,getOriginalIndex:fe,getCellContent:ge}=f1(P,re,j),K=oe.useCallback(Qd(yd,pe=>{const st={selection:{rows:[],columns:[]}};st.selection.rows=pe.rows.toArray().map(Ne=>fe(Ne)),st.selection.columns=pe.columns.toArray().map(Ne=>yo(ie[Ne]));const Xt=JSON.stringify(st),on=r.getStringValue({id:e.id,formId:e.formId});(on===void 0||on!==Xt)&&r.setStringValue({id:e.id,formId:e.formId},Xt,{fromUi:!0},i)}),[e.id,e.formId,r,i,fe,yo]),{gridSelection:D,isRowSelectionActivated:R,isMultiRowSelectionActivated:B,isColumnSelectionActivated:ce,isMultiColumnSelectionActivated:Oe,isRowSelected:Ve,isColumnSelected:ve,isCellSelected:at,clearSelection:be,processSelectionChange:Ot}=vw(e,L,n,ie,K);oe.useEffect(()=>{be(!0,!0)},[a]);const It=oe.useCallback(pe=>{var st;(st=f.current)==null||st.updateCells(pe)},[]);oe.useEffect(()=>{var st,Xt,on,Ne;if(!R&&!ce)return;const pe=r.getStringValue({id:e.id,formId:e.formId});if(pe){const Vt=ie.map(Dt=>yo(Dt)),_t=JSON.parse(pe);let Kt=vt.empty(),yt=vt.empty();(Xt=(st=_t.selection)==null?void 0:st.rows)==null||Xt.forEach(Dt=>{Kt=Kt.add(Dt)}),(Ne=(on=_t.selection)==null?void 0:on.columns)==null||Ne.forEach(Dt=>{yt=yt.add(Vt.indexOf(Dt))}),(Kt.length>0||yt.length>0)&&Ot({rows:Kt,columns:yt,current:void 0})}},[]);const rt=oe.useCallback(()=>{ne!==J.current.getNumRows()&&Ee(J.current.getNumRows())},[ne]),ee=oe.useCallback(Qd(yd,()=>{const pe=J.current.toJson(ie);let st=r.getStringValue({id:e.id,formId:e.formId});st===void 0&&(st=new ea(0).toJson([])),pe!==st&&r.setStringValue({id:e.id,formId:e.formId},pe,{fromUi:!0},i)}),[e.id,e.formId,r,i,ie,J.current]),{exportToCsv:nt}=mw(ge,ie,ne,m),{onCellEdited:we,onPaste:le,onRowAppended:he,onDelete:Le,validateCell:Pe}=a1(ie,e.editingMode!==A,J,ge,fe,It,rt,ee,be),{tooltip:Ke,clearTooltip:ue,onItemHovered:Ie}=m1(ie,ge),{drawCell:lt,customRenderers:Ae}=dw(ie),Je=oe.useMemo(()=>ie.map(pe=>bl(pe)),[ie]),{columns:mt,onColumnResize:gt}=l1(Je),_e=t.columns.length>1,{minHeight:Ht,maxHeight:$t,minWidth:Tt,maxWidth:At,rowHeight:Qt,resizableSize:Pt,setResizableSize:kn}=i1(e,g,ne,_e,c,u,a),Bt=oe.useCallback(([pe,st])=>({...Am(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:g.glideTheme.textLight},span:[0,Math.max(ie.length-1,0)]}),[ie,g.glideTheme.textLight]),Rt=oe.useCallback(()=>{me(),be()},[me,be]);My({element:e,widgetMgr:r,onFormCleared:Rt});const Sn=!L&&e.editingMode===A&&!n,wn=h.useMemo(()=>ie.filter(pe=>pe.isPinned).reduce((pe,st)=>pe+(st.width??g.minColumnWidth*2),0)>c*.6,[ie,c,g.minColumnWidth]),De=L||wn?0:ie.filter(pe=>pe.isPinned).length;return oe.useEffect(()=>{setTimeout(()=>{var pe,st;if(p.current&&f.current){const Xt=(st=(pe=p.current)==null?void 0:pe.querySelector(".dvn-stack"))==null?void 0:st.getBoundingClientRect();Xt&&(C(Xt.height>p.current.clientHeight),M(Xt.width>p.current.clientWidth))}},1)},[Pt,ne,mt]),pn.jsxs(wd,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:E,ref:p,onMouseDown:pe=>{if(p.current&&E){const st=p.current.getBoundingClientRect();x&&st.height-(xd+1)<pe.clientY-st.top&&pe.stopPropagation(),S&&st.width-(xd+1)<pe.clientX-st.left&&pe.stopPropagation()}},onBlur:pe=>{!b&&!O&&!pe.currentTarget.contains(pe.relatedTarget)&&be(!0,!0)},children:[pn.jsxs(Ty,{isFullScreen:a,disableFullscreenMode:o,locked:Ve&&!R||at||O&&b,onExpand:l,onCollapse:s,target:wd,children:[(R&&Ve||ce&&ve)&&pn.jsx(bi,{label:"Clear selection",icon:Hy,onClick:()=>{be(),ue()}}),Sn&&Ve&&pn.jsx(bi,{label:"Delete row(s)",icon:Ay,onClick:()=>{Le&&(Le(D),ue())}}),Sn&&!Ve&&pn.jsx(bi,{label:"Add row",icon:Rr,onClick:()=>{he&&(y(!0),he(),ue())}}),!Q&&!L&&pn.jsx(bi,{label:"Download as CSV",icon:Vy,onClick:()=>nt()}),!L&&pn.jsx(bi,{label:"Search",icon:nr,onClick:()=>{w?k(!1):(y(!0),k(!0)),ue()}})]}),pn.jsx(ky,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Pt,style:{border:`${g.tableBorderWidth}px solid ${g.glideTheme.borderColor}`,borderRadius:`${g.tableBorderRadius}`},minHeight:Ht,maxHeight:$t,minWidth:Tt,maxWidth:At,size:Pt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Qt],snapGap:Qt/3,onResizeStop:(pe,st,Xt,on)=>{if(d.current){const Ne=2*g.tableBorderWidth;kn({width:d.current.size.width,height:$t-d.current.size.height===Ne?d.current.size.height+Ne:d.current.size.height})}},children:pn.jsx(Hm,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:mt,rows:L?1:ne,minColumnWidth:g.minColumnWidth,maxColumnWidth:g.maxColumnWidth,maxColumnAutoWidth:g.maxColumnAutoWidth,rowHeight:Qt,headerHeight:g.defaultHeaderHeight,getCellContent:L?Bt:ge,onColumnResize:O?void 0:gt,resizeIndicator:"header",freezeColumns:De,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:O?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ie,keybindings:{downFill:!0},onKeyDown:pe=>{(pe.ctrlKey||pe.metaKey)&&pe.key==="f"&&(k(st=>!st),pe.stopPropagation(),pe.preventDefault())},showSearch:w,onSearchClose:()=>{k(!1),ue()},onHeaderClicked:(pe,st)=>{L||Q||ce||(R&&Ve&&be(),ae(pe))},gridSelection:D,onGridSelectionChange:pe=>{(b||O)&&(Ot(pe),Ke!==void 0&&ue())},theme:g.glideTheme,onMouseMove:pe=>{pe.kind==="out-of-bounds"&&b?y(!1):pe.kind!=="out-of-bounds"&&!b&&y(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...E&&{paddingBottom:x?-6:void 0,paddingRight:S?-6:void 0}},drawCell:lt,customRenderers:Ae,imageEditorOverride:jm,headerIcons:g.headerIcons,validateCell:Pe,onPaste:!1,...R&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:B?"multi":"auto",rowSelect:n?"none":B?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...ce&&{columnSelect:n?"none":Oe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!L&&e.editingMode!==H&&!n&&{fillHandle:!O,onCellEdited:we,onPaste:le,onDelete:Le},...!L&&e.editingMode===A&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:he,onHeaderClicked:void 0}})}),Ke&&Ke.content&&pn.jsx(bw,{top:Ke.top,left:Ke.left,content:Ke.content,clearTooltip:ue})]})}let Cd;Cd=Ry(yw),eh=Object.freeze(Object.defineProperty({__proto__:null,default:Cd},Symbol.toStringTag,{value:"Module"}))});export{ps as C,Fa as T,_y as __tla,Wr as a,gs as b,eh as c,jr as i,ms as m,un as s};
191
+ `,fw="\uFEFF",pw=new RegExp(`[${[gd,ti,md].join("")}]`);function vd(e){return e.map(t=>gw(t)).join(gd)+md}function gw(e){if(Xe(e))return"";const t=kt(e);return pw.test(t)?`${ti}${t.replace(new RegExp(ti,"g"),hw+ti)}${ti}`:t}async function bd(e,t,n,r){const o=new TextEncoder;await e.write(o.encode(fw));const i=n.map(a=>a.name);await e.write(o.encode(vd(i)));for(let a=0;a<r;a++){const l=[];n.forEach((s,c,u)=>{l.push(s.getCellValue(t([c,a])))}),await e.write(o.encode(vd(l)))}await e.close()}function mw(e,t,n,r){return{exportToCsv:oe.useCallback(async()=>{const o=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const i=await(await(await cs(()=>import("./es6-CTcMcfqp.js").then(async a=>(await a.__tla,a)).then(a=>a.a),__vite__mapDeps([13,1,2]))).showSaveFilePicker({suggestedName:o,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await bd(i,e,t,n)}catch(i){if(i instanceof Error&&i.name==="AbortError")return;try{Zd("Failed to export data as CSV with FileSystem API, trying fallback method",i);let a="";const l=new WritableStream({write:async d=>{a+=new TextDecoder("utf-8").decode(d)},close:async()=>{}});await bd(l.getWriter(),e,t,n);const s=new Blob([a],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(s),u=Dy({enforceDownloadInNewTab:r,url:c,filename:o});u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c)}catch(a){qd("Failed to export data as CSV",a)}}},[t,n,e,r])}}function vw(e,t,n,r,o){const[i,a]=oe.useState({columns:vt.empty(),rows:vt.empty(),current:void 0}),l=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),s=l&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),c=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),u=c&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=i.rows.length>0,f=i.columns.length>0,p=i.current!==void 0,g=oe.useCallback(b=>{const y=!fs(b.rows.toArray(),i.rows.toArray()),w=!fs(b.columns.toArray(),i.columns.toArray()),k=!fs(b.current,i.current);let S=l&&y||c&&w,C=b;if((l||c)&&b.current!==void 0&&k&&(C={...b,rows:i.rows,columns:i.columns},S=!1),y&&b.rows.length>0&&w&&b.columns.length===0&&(C={...C,columns:i.columns},S=!0),w&&b.columns.length>0&&y&&b.rows.length===0&&(C={...C,rows:i.rows},S=!0),w&&C.columns.length>=0){let x=C.columns;r.forEach((M,O)=>{M.isIndex&&(x=x.remove(O))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),S&&o(C)},[i,l,c,o,r]),m=oe.useCallback((b=!1,y=!1)=>{const w={columns:y?i.columns:vt.empty(),rows:b?i.rows:vt.empty(),current:void 0};a(w),(!b&&l||!y&&c)&&o(w)},[i,l,c,o]);return{gridSelection:i,isRowSelectionActivated:l,isMultiRowSelectionActivated:s,isColumnSelectionActivated:c,isMultiColumnSelectionActivated:u,isRowSelected:d,isColumnSelected:f,isCellSelected:p,clearSelection:m,processSelectionChange:g}}function bw({top:e,left:t,content:n,clearTooltip:r}){const[o,i]=oe.useState(!0),a=us(),{colors:l,fontSizes:s,radii:c,fontWeights:u}=a,d=oe.useCallback(()=>{i(!1),r()},[r,i]);return pn.jsx(my,{content:pn.jsx(vy,{"data-testid":"stDataFrameTooltipContent",children:pn.jsx(by,{style:{fontSize:s.sm},source:n,allowHTML:!1})}),placement:wy.top,accessibilityType:yy.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:xy(a)?l.bgColor:l.secondaryBg,color:l.bodyText,fontSize:s.sm,fontWeight:u.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:o,children:pn.jsx("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const wd=Xd("div",{target:"e1w7nams0"})(({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"}}),""),yd=150,ww=15e4,xd=6;function yw({element:e,data:t,disabled:n,widgetMgr:r,disableFullscreenMode:o,fragmentId:i}){const{expanded:a,expand:l,collapse:s,width:c,height:u}=Ey(Iy),d=oe.useRef(null),f=oe.useRef(null),p=oe.useRef(null),g=r1(),{libConfig:{enforceDownloadInNewTab:m=!1}}=oe.useContext(Cy),[b,y]=oe.useState(!0),[w,k]=oe.useState(!1),[S,C]=oe.useState(!1),[x,M]=oe.useState(!1),O=oe.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),E=oe.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Xe(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:H,DYNAMIC:A}=Un.EditingMode,V=t.dimensions,P=Math.max(0,V.dataRows),L=P===0&&!(e.editingMode===A&&V.dataColumns>0),Q=P>ww,J=oe.useRef(new ea(P)),[ne,Ee]=oe.useState(J.current.getNumRows());oe.useEffect(()=>{J.current=new ea(P),Ee(J.current.getNumRows())},[P]);const me=oe.useCallback(()=>{J.current=new ea(P),Ee(J.current.getNumRows())},[P]),{columns:re}=n1(e,t,n);oe.useEffect(()=>{if(e.editingMode===H)return;const pe=r.getStringValue({id:e.id,formId:e.formId});pe&&(J.current.fromJson(pe,re),Ee(J.current.getNumRows()))},[]);const{getCellContent:j}=o1(t,re,ne,J),{columns:ie,sortColumn:ae,getOriginalIndex:fe,getCellContent:ge}=f1(P,re,j),K=oe.useCallback(Qd(yd,pe=>{const st={selection:{rows:[],columns:[]}};st.selection.rows=pe.rows.toArray().map(Ne=>fe(Ne)),st.selection.columns=pe.columns.toArray().map(Ne=>yo(ie[Ne]));const Xt=JSON.stringify(st),on=r.getStringValue({id:e.id,formId:e.formId});(on===void 0||on!==Xt)&&r.setStringValue({id:e.id,formId:e.formId},Xt,{fromUi:!0},i)}),[e.id,e.formId,r,i,fe,yo]),{gridSelection:D,isRowSelectionActivated:R,isMultiRowSelectionActivated:B,isColumnSelectionActivated:ce,isMultiColumnSelectionActivated:Oe,isRowSelected:Ve,isColumnSelected:ve,isCellSelected:at,clearSelection:be,processSelectionChange:Ot}=vw(e,L,n,ie,K);oe.useEffect(()=>{be(!0,!0)},[a]);const It=oe.useCallback(pe=>{var st;(st=f.current)==null||st.updateCells(pe)},[]);oe.useEffect(()=>{var st,Xt,on,Ne;if(!R&&!ce)return;const pe=r.getStringValue({id:e.id,formId:e.formId});if(pe){const Vt=ie.map(Dt=>yo(Dt)),_t=JSON.parse(pe);let Kt=vt.empty(),yt=vt.empty();(Xt=(st=_t.selection)==null?void 0:st.rows)==null||Xt.forEach(Dt=>{Kt=Kt.add(Dt)}),(Ne=(on=_t.selection)==null?void 0:on.columns)==null||Ne.forEach(Dt=>{yt=yt.add(Vt.indexOf(Dt))}),(Kt.length>0||yt.length>0)&&Ot({rows:Kt,columns:yt,current:void 0})}},[]);const rt=oe.useCallback(()=>{ne!==J.current.getNumRows()&&Ee(J.current.getNumRows())},[ne]),ee=oe.useCallback(Qd(yd,()=>{const pe=J.current.toJson(ie);let st=r.getStringValue({id:e.id,formId:e.formId});st===void 0&&(st=new ea(0).toJson([])),pe!==st&&r.setStringValue({id:e.id,formId:e.formId},pe,{fromUi:!0},i)}),[e.id,e.formId,r,i,ie,J.current]),{exportToCsv:nt}=mw(ge,ie,ne,m),{onCellEdited:we,onPaste:le,onRowAppended:he,onDelete:Le,validateCell:Pe}=a1(ie,e.editingMode!==A,J,ge,fe,It,rt,ee,be),{tooltip:Ke,clearTooltip:ue,onItemHovered:Ie}=m1(ie,ge),{drawCell:lt,customRenderers:Ae}=dw(ie),Je=oe.useMemo(()=>ie.map(pe=>bl(pe)),[ie]),{columns:mt,onColumnResize:gt}=l1(Je),_e=t.columns.length>1,{minHeight:Ht,maxHeight:$t,minWidth:Tt,maxWidth:At,rowHeight:Qt,resizableSize:Pt,setResizableSize:kn}=i1(e,g,ne,_e,c,u,a),Bt=oe.useCallback(([pe,st])=>({...Am(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:g.glideTheme.textLight},span:[0,Math.max(ie.length-1,0)]}),[ie,g.glideTheme.textLight]),Rt=oe.useCallback(()=>{me(),be()},[me,be]);My({element:e,widgetMgr:r,onFormCleared:Rt});const Sn=!L&&e.editingMode===A&&!n,wn=h.useMemo(()=>ie.filter(pe=>pe.isPinned).reduce((pe,st)=>pe+(st.width??g.minColumnWidth*2),0)>c*.6,[ie,c,g.minColumnWidth]),De=L||wn?0:ie.filter(pe=>pe.isPinned).length;return oe.useEffect(()=>{setTimeout(()=>{var pe,st;if(p.current&&f.current){const Xt=(st=(pe=p.current)==null?void 0:pe.querySelector(".dvn-stack"))==null?void 0:st.getBoundingClientRect();Xt&&(C(Xt.height>p.current.clientHeight),M(Xt.width>p.current.clientWidth))}},1)},[Pt,ne,mt]),pn.jsxs(wd,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:E,ref:p,onMouseDown:pe=>{if(p.current&&E){const st=p.current.getBoundingClientRect();x&&st.height-(xd+1)<pe.clientY-st.top&&pe.stopPropagation(),S&&st.width-(xd+1)<pe.clientX-st.left&&pe.stopPropagation()}},onBlur:pe=>{!b&&!O&&!pe.currentTarget.contains(pe.relatedTarget)&&be(!0,!0)},children:[pn.jsxs(Ty,{isFullScreen:a,disableFullscreenMode:o,locked:Ve&&!R||at||O&&b,onExpand:l,onCollapse:s,target:wd,children:[(R&&Ve||ce&&ve)&&pn.jsx(bi,{label:"Clear selection",icon:Hy,onClick:()=>{be(),ue()}}),Sn&&Ve&&pn.jsx(bi,{label:"Delete row(s)",icon:Ay,onClick:()=>{Le&&(Le(D),ue())}}),Sn&&!Ve&&pn.jsx(bi,{label:"Add row",icon:Rr,onClick:()=>{he&&(y(!0),he(),ue())}}),!Q&&!L&&pn.jsx(bi,{label:"Download as CSV",icon:Vy,onClick:()=>nt()}),!L&&pn.jsx(bi,{label:"Search",icon:nr,onClick:()=>{w?k(!1):(y(!0),k(!0)),ue()}})]}),pn.jsx(ky,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:Pt,style:{border:`${g.tableBorderWidth}px solid ${g.glideTheme.borderColor}`,borderRadius:`${g.tableBorderRadius}`},minHeight:Ht,maxHeight:$t,minWidth:Tt,maxWidth:At,size:Pt,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,Qt],snapGap:Qt/3,onResizeStop:(pe,st,Xt,on)=>{if(d.current){const Ne=2*g.tableBorderWidth;kn({width:d.current.size.width,height:$t-d.current.size.height===Ne?d.current.size.height+Ne:d.current.size.height})}},children:pn.jsx(Hm,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:mt,rows:L?1:ne,minColumnWidth:g.minColumnWidth,maxColumnWidth:g.maxColumnWidth,maxColumnAutoWidth:g.maxColumnAutoWidth,rowHeight:Qt,headerHeight:g.defaultHeaderHeight,getCellContent:L?Bt:ge,onColumnResize:O?void 0:gt,resizeIndicator:"header",freezeColumns:De,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:O?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ie,keybindings:{downFill:!0},onKeyDown:pe=>{(pe.ctrlKey||pe.metaKey)&&pe.key==="f"&&(k(st=>!st),pe.stopPropagation(),pe.preventDefault())},showSearch:w,onSearchClose:()=>{k(!1),ue()},onHeaderClicked:(pe,st)=>{L||Q||ce||(R&&Ve&&be(),ae(pe))},gridSelection:D,onGridSelectionChange:pe=>{(b||O)&&(Ot(pe),Ke!==void 0&&ue())},theme:g.glideTheme,onMouseMove:pe=>{pe.kind==="out-of-bounds"&&b?y(!1):pe.kind!=="out-of-bounds"&&!b&&y(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...E&&{paddingBottom:x?-6:void 0,paddingRight:S?-6:void 0}},drawCell:lt,customRenderers:Ae,imageEditorOverride:jm,headerIcons:g.headerIcons,validateCell:Pe,onPaste:!1,...R&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:B?"multi":"auto",rowSelect:n?"none":B?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...ce&&{columnSelect:n?"none":Oe?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!L&&e.editingMode!==H&&!n&&{fillHandle:!O,onCellEdited:we,onPaste:le,onDelete:Le},...!L&&e.editingMode===A&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:g.glideTheme.bgHeader,bgCellMedium:g.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:he,onHeaderClicked:void 0}})}),Ke&&Ke.content&&pn.jsx(bw,{top:Ke.top,left:Ke.left,content:Ke.content,clearTooltip:ue})]})}let Cd;Cd=Ry(yw),eh=Object.freeze(Object.defineProperty({__proto__:null,default:Cd},Symbol.toStringTag,{value:"Module"}))});export{ps as C,Fa as T,_y as __tla,Wr as a,gs as b,eh as c,jr as i,ms as m,un as s};