@marimo-team/frontend 0.14.11-dev7 → 0.14.11-dev72

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 (150) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-C0P31a5y.js → ConnectedDataExplorerComponent-QNSg3r9O.js} +3 -3
  2. package/dist/assets/{ImageComparisonComponent-DXDeGx2f.js → ImageComparisonComponent-CP5Cy_nl.js} +1 -1
  3. package/dist/assets/{VegaLite-CUqFyetE.js → VegaLite-Dfe0Urmt.js} +8 -8
  4. package/dist/assets/_baseEach-Oq1b6Vj7.js +1 -0
  5. package/dist/assets/_baseMap-NO7KiGEP.js +1 -0
  6. package/dist/assets/_baseUniq-B_mvr7GI.js +1 -0
  7. package/dist/assets/{_createAggregator-SoA2y5HH.js → _createAggregator-DYHbrJKw.js} +1 -1
  8. package/dist/assets/{any-language-editor-Bw2cdBsS.js → any-language-editor-Bz6ZWwU_.js} +1 -1
  9. package/dist/assets/arc-ZB5pDULS.js +1 -0
  10. package/dist/assets/architectureDiagram-NQ2NVSRB-dvHYur4M.js +36 -0
  11. package/dist/assets/blockDiagram-PHRCVELO-DuGlfCPb.js +122 -0
  12. package/dist/assets/{c4Diagram-VJAJSXHY-BHtN7uMz.js → c4Diagram-6F6E4RAY-C1bcLnUs.js} +2 -2
  13. package/dist/assets/channel-DO4c6oXE.js +1 -0
  14. package/dist/assets/{chunk-4BMEZGHF-BO5DiwLV.js → chunk-353BL4L5-Z9QK1Sy2.js} +1 -1
  15. package/dist/assets/{chunk-D6G4REZN-CbYGlbyQ.js → chunk-67H74DCK-BfbQjnIB.js} +1 -1
  16. package/dist/assets/chunk-6OLS64BW-DwBkid2_.js +220 -0
  17. package/dist/assets/{chunk-XZIHB7SX-COKmet6t.js → chunk-AACKK3MU-EMbcCDOG.js} +1 -1
  18. package/dist/assets/chunk-BFAMUDN2-Smdd-nnU.js +1 -0
  19. package/dist/assets/chunk-E2GYISFI-CkjiRzlT.js +15 -0
  20. package/dist/assets/{chunk-A2AXSNBT-B07L-F60.js → chunk-QEP2MXWD-DXF9XFhg.js} +4 -3
  21. package/dist/assets/chunk-SKB7J2MH-amgUtKom.js +1 -0
  22. package/dist/assets/{circle-play-DSXPiHO0.js → circle-play-DXMV_zw8.js} +2 -2
  23. package/dist/assets/classDiagram-BGRH5UQR-CqrI7fcr.js +1 -0
  24. package/dist/assets/classDiagram-v2-O24JOBDK-CqrI7fcr.js +1 -0
  25. package/dist/assets/clone-DmicZLVp.js +1 -0
  26. package/dist/assets/compile-OQmqyn3d.js +10 -0
  27. package/dist/assets/dagre-FFZHY6LT-Dm7KedkK.js +4 -0
  28. package/dist/assets/data-grid-overlay-editor-0MMb3ORz.js +1 -0
  29. package/dist/assets/diagram-3EMPZRKU-D4ptO8ZX.js +24 -0
  30. package/dist/assets/diagram-5UYTHUR4-DBDXUsko.js +24 -0
  31. package/dist/assets/diagram-ZTM2IBQH-DwVHm-a7.js +43 -0
  32. package/dist/assets/edit-page-rhiVKwbK.js +148 -0
  33. package/dist/assets/{erDiagram-Q7BY3M3F-l-V_9Yws.js → erDiagram-R3QVA2FD-CF2j_ghF.js} +1 -1
  34. package/dist/assets/flowDiagram-PKI6S5ZS-J8Af8aQY.js +162 -0
  35. package/dist/assets/ganttDiagram-EK5VF46D-BvmXCoQK.js +267 -0
  36. package/dist/assets/gitGraphDiagram-GW3U2K7C-Cr7iejkN.js +65 -0
  37. package/dist/assets/glide-data-editor-DcmjcDkq.css +1 -0
  38. package/dist/assets/glide-data-editor-dRdzyJuS.js +132 -0
  39. package/dist/assets/{graph-DpLAfWzk.js → graph-DQMI2Eqq.js} +1 -1
  40. package/dist/assets/home-page-DnThjRcD.js +9 -0
  41. package/dist/assets/{index-Bz3Lb65G.js → index-8OV_Dw5k.js} +1 -1
  42. package/dist/assets/{index-CxQo8Qlm.js → index-8PMBSacA.js} +1 -1
  43. package/dist/assets/{index-DAMc4rP9.js → index-B7HBR2mZ.js} +1 -1
  44. package/dist/assets/{index-C9EbJL5c.js → index-BDA641Ri.js} +1 -1
  45. package/dist/assets/index-BEQfoZiP.js +1 -0
  46. package/dist/assets/{index-DP4HiwTU.js → index-BRkwCtw_.js} +1 -1
  47. package/dist/assets/index-BYFCOF0M.js +1 -0
  48. package/dist/assets/{index-Cs9jrmWP.js → index-BgVLJCds.js} +1 -1
  49. package/dist/assets/{index-DQwFB8dN.js → index-C1UTJg_P.js} +2 -2
  50. package/dist/assets/{index-DZWCSqpf.js → index-C75-E0Wz.js} +1 -1
  51. package/dist/assets/index-CfmtzcxT.js +1 -0
  52. package/dist/assets/index-Cj-dQTQ3.js +1 -0
  53. package/dist/assets/{index-DbunLlvf.js → index-Cn4DIfCi.js} +1 -1
  54. package/dist/assets/index-CsdFJkJw.css +1 -0
  55. package/dist/assets/index-D6n-fNiw.js +1 -0
  56. package/dist/assets/{index-Czo055fo.js → index-DMYp6bTi.js} +1 -1
  57. package/dist/assets/index-DUfE3Ygv.js +507 -0
  58. package/dist/assets/{index-Cig6xGYH.js → index-DcLIgqZD.js} +1 -1
  59. package/dist/assets/index-DntrNFd9.js +1 -0
  60. package/dist/assets/{index-CmVTfWOx.js → index-T57zmtXp.js} +1 -1
  61. package/dist/assets/{index-N67HDT2u.js → index-nJgUkZhZ.js} +1 -1
  62. package/dist/assets/infoDiagram-RLU2ROGC-6ayEwNHi.js +2 -0
  63. package/dist/assets/journeyDiagram-EWQZEKCU-CufyRuPd.js +139 -0
  64. package/dist/assets/{kanban-definition-NDS4AKOZ-Cw4Vh4wD.js → kanban-definition-ILFWEQ3N-BMVZp5Z-.js} +9 -8
  65. package/dist/assets/{layout-DodQLUx6.js → layout-D6cZFix-.js} +1 -1
  66. package/dist/assets/linear-CwIDADia.js +1 -0
  67. package/dist/assets/links-BNNDBIJj.js +17 -0
  68. package/dist/assets/loro_wasm_bg-bPYKkGLG.wasm +0 -0
  69. package/dist/assets/mermaid-Bhkvxu54.js +152 -0
  70. package/dist/assets/min-BCL-6Bwx.js +1 -0
  71. package/dist/assets/{mindmap-definition-ALO5MXBD-C0KGo_i_.js → mindmap-definition-CZNETY7S-C_MYXj4X.js} +4 -4
  72. package/dist/assets/number-overlay-editor-Df2FevAR.js +9 -0
  73. package/dist/assets/{pieDiagram-IB7DONF6-DCnELF9y.js → pieDiagram-NIOCPIFQ-Bk9T2le2.js} +1 -1
  74. package/dist/assets/{quadrantDiagram-7GDLP6J5-D0cP5ixt.js → quadrantDiagram-2OG54O6I-NgH_B06m.js} +1 -1
  75. package/dist/assets/{react-plotly-BmDAcz3M.js → react-plotly-CXOmDiE0.js} +1 -1
  76. package/dist/assets/{requirementDiagram-KVF5MWMF-BTksN04O.js → requirementDiagram-SO3GGRV7-HvEJIPC2.js} +3 -3
  77. package/dist/assets/run-page-Mq0VpxGL.js +1 -0
  78. package/dist/assets/{sankeyDiagram-QLVOVGJD-DECOJIMC.js → sankeyDiagram-4UZDY2LN-CBGiR7n-.js} +4 -4
  79. package/dist/assets/save-worker-B8gk1S9x.js +1 -0
  80. package/dist/assets/sequenceDiagram-ZIKVLSP4-C7hXviAB.js +122 -0
  81. package/dist/assets/slides-component-1Y9n5Gm1.js +1 -0
  82. package/dist/assets/sortBy-DvcUtmWI.js +1 -0
  83. package/dist/assets/stateDiagram-XX37X6EN-BDbxDzSy.js +1 -0
  84. package/dist/assets/stateDiagram-v2-GD6S3NHB-omlXEd8A.js +1 -0
  85. package/dist/assets/storage-lmv2DjR1.js +25 -0
  86. package/dist/assets/{terminal-MtCDBvKs.js → terminal-DKZoyrP7.js} +1 -1
  87. package/dist/assets/{time-BoP93jle.js → time-y8i94pyX.js} +1 -1
  88. package/dist/assets/timeline-definition-RI47OAVP-DYNkDwyx.js +61 -0
  89. package/dist/assets/tracing-DGevMtzp.js +2 -0
  90. package/dist/assets/trash-CtRVuIVX.js +6 -0
  91. package/dist/assets/treemap-FKARHQ26-BVbfYHyM.js +126 -0
  92. package/dist/assets/vega-component-DQf7Z9TU.js +1 -0
  93. package/dist/assets/worker-BYA2ASe8.js +1 -0
  94. package/dist/assets/worker-Ch6cKXnI.js +1 -0
  95. package/dist/assets/xychartDiagram-H2YORKM3-BZbRNiRy.js +7 -0
  96. package/dist/index.html +4 -2
  97. package/package.json +45 -44
  98. package/dist/assets/_baseEach-BHb51vC7.js +0 -1
  99. package/dist/assets/_baseMap--rH4lBFQ.js +0 -1
  100. package/dist/assets/_baseUniq-CABXtSlj.js +0 -1
  101. package/dist/assets/arc-CfyY4LWz.js +0 -1
  102. package/dist/assets/architectureDiagram-IEHRJDOE-rGoAHYH8.js +0 -36
  103. package/dist/assets/blockDiagram-JOT3LUYC-ZBJWq8Z_.js +0 -121
  104. package/dist/assets/channel-C96bdTqW.js +0 -1
  105. package/dist/assets/chunk-AEK57VVT-DN2-tsCz.js +0 -220
  106. package/dist/assets/chunk-RZ5BOZE2-DVex9AD8.js +0 -1
  107. package/dist/assets/classDiagram-GIVACNV2-CehC5H1T.js +0 -1
  108. package/dist/assets/classDiagram-v2-COTLJTTW-CehC5H1T.js +0 -1
  109. package/dist/assets/clone-H0gxlZXI.js +0 -1
  110. package/dist/assets/compile-DEz1Y6_F.js +0 -10
  111. package/dist/assets/dagre-OKDRZEBW-CymbL2JX.js +0 -4
  112. package/dist/assets/data-editor-CTGVBJdC.js +0 -142
  113. package/dist/assets/diagram-SSKATNLV-DY5vs_Bj.js +0 -43
  114. package/dist/assets/diagram-VNBRO52H-ZuQiOKh8.js +0 -24
  115. package/dist/assets/edit-page-DcQ6ZhfW.js +0 -144
  116. package/dist/assets/flowDiagram-4HSFHLVR-BsHIJJTe.js +0 -161
  117. package/dist/assets/ganttDiagram-APWFNJXF-2gy5YbWU.js +0 -257
  118. package/dist/assets/gitGraphDiagram-7IBYFJ6S-B_ELHLbw.js +0 -65
  119. package/dist/assets/home-page-6auHzaGk.js +0 -9
  120. package/dist/assets/index-8IZtaDUn.css +0 -1
  121. package/dist/assets/index-B-mClP__.js +0 -1
  122. package/dist/assets/index-BuqjbKw0.js +0 -1
  123. package/dist/assets/index-C9EPiaCd.js +0 -1
  124. package/dist/assets/index-DDVWq6NK.js +0 -501
  125. package/dist/assets/index-FYYNNs_X.js +0 -1
  126. package/dist/assets/index-kmp97oxc.js +0 -1
  127. package/dist/assets/infoDiagram-PH2N3AL5-BwbaSo89.js +0 -2
  128. package/dist/assets/journeyDiagram-U35MCT3I-NKSvtlZA.js +0 -138
  129. package/dist/assets/linear-B_OPGLLI.js +0 -1
  130. package/dist/assets/loro_wasm_bg-DHBNbovs.wasm +0 -0
  131. package/dist/assets/mermaid-CVRC4Ruz.js +0 -152
  132. package/dist/assets/min-VmgWsmJ_.js +0 -1
  133. package/dist/assets/radar-MK3ICKWK-D8LhkSau.js +0 -126
  134. package/dist/assets/run-page-17VQxU3e.js +0 -1
  135. package/dist/assets/save-worker-DZnx0AG9.js +0 -1
  136. package/dist/assets/sequenceDiagram-X6HHIX6F-C5eDWwoH.js +0 -122
  137. package/dist/assets/shutdown-button-QvkERkPd.js +0 -17
  138. package/dist/assets/slides-component-DchvPU9C.js +0 -1
  139. package/dist/assets/sortBy-7ke7bFD2.js +0 -1
  140. package/dist/assets/stateDiagram-DGXRK772-D6Kwy963.js +0 -1
  141. package/dist/assets/stateDiagram-v2-YXO3MK2T-Bk10XR94.js +0 -1
  142. package/dist/assets/storage-BeNhlsrY.js +0 -27
  143. package/dist/assets/timeline-definition-BDJGKUSR-T1la59d1.js +0 -61
  144. package/dist/assets/tracing-CCltm96L.js +0 -2
  145. package/dist/assets/vega-component-j1BDb2QJ.js +0 -1
  146. package/dist/assets/worker-BbdB3qWL.js +0 -1
  147. package/dist/assets/worker-CnoOKJWk.js +0 -1
  148. package/dist/assets/xychartDiagram-VJFVF3MP-CoJqer7_.js +0 -7
  149. /package/dist/assets/{shutdown-button-C1rhMrxo.css → links-C1rhMrxo.css} +0 -0
  150. /package/dist/assets/{transform-DetRMEbJ.js → transform-CDNfLgV5.js} +0 -0
@@ -0,0 +1,132 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor-0MMb3ORz.js","./index-DUfE3Ygv.js","./index-CsdFJkJw.css","./trash-CtRVuIVX.js","./number-overlay-editor-Df2FevAR.js"])))=>i.map(i=>d[i]);
2
+ var Lp=Object.defineProperty;var _p=(cr,$n,Rr)=>$n in cr?Lp(cr,$n,{enumerable:!0,configurable:!0,writable:!0,value:Rr}):cr[$n]=Rr;var ft=(cr,$n,Rr)=>_p(cr,typeof $n!="symbol"?$n+"":$n,Rr);import{gF as Ti,z as Sr,W as d,gG as Fa,aE as Go,aF as jp,b as $t,dk as Np,_ as L0,ff as _0,L as La,a as j0,j as et,dr as Bp,gH as Wp,gI as N0,gJ as $p,bt as _a,br as B0,ak as ja,gK as W0,gL as $0,gM as X0,gN as Xp,dw as Gp,dt as Yp,ds as Kp,du as Vp,V as Up,gO as qp,dE as Jp,gP as Hi,aR as Na,aM as Qp,be as Zp,eS as G0,a$ as Y0,aU as em,aV as tm,ar as nm,ap as rm,aq as om,__tla as im}from"./index-DUfE3Ygv.js";import{T as am}from"./trash-CtRVuIVX.js";let Ba,Wa,kr,$a,K0,Mr,Xa,Cn,lm=Promise.all([(()=>{try{return im}catch{}})()]).then(async()=>{var cr,$n,Rr,Ga,Ya,Ka,Va,Ua,qa,Ja,Qa,Za,el,tl,nl,rl,ol,il,al,ll,sl,cl,ul,dl,hl,fl,gl,pl,ml,vl,wl,yl,bl,xl,Cl,Sl,kl,Ml,Rl,El,Il,Tl,Hl,Ol,Pl,Dl,zl,Al,Fl,Ll,_l,jl,Nl,Bl,Wl,$l,Xl,Gl,Yl,Kl,Vl,Ul,ql,Jl,Ql,Zl,es,ts,ns,rs,os,is,as,ls,ss,cs,us,ds,hs,fs,gs,ps,ms,vs,ws,ys,bs,xs,Oi,Cs,Ss,ks,Ms,Rs,Pi,Es,Is,Ts,Hs,Os,Ps,Ds,zs,As,Fs,Ls,_s,js,Ns,Bs,Ws,$s,Xs,Gs;function Xn(){if(Ga)return Rr;Ga=1;var e=Array.isArray;return Rr=e}function Ys(){if(Ka)return Ya;Ka=1;var e=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti;return Ya=e}function Gn(){if(Ua)return Va;Ua=1;var e=Ys(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Va=n}function oo(){if(Ja)return qa;Ja=1;var e=Gn().Symbol;return qa=e}function io(){if(rl)return nl;rl=1;var e=oo(),t=function(){if(Za)return Qa;Za=1;var o=oo(),i=Object.prototype,l=i.hasOwnProperty,a=i.toString,s=o?o.toStringTag:void 0;return Qa=function(c){var h=l.call(c,s),C=c[s];try{c[s]=void 0;var y=!0}catch{}var p=a.call(c);return y&&(h?c[s]=C:delete c[s]),p}}(),n=function(){if(tl)return el;tl=1;var o=Object.prototype.toString;return el=function(i){return o.call(i)}}(),r=e?e.toStringTag:void 0;return nl=function(o){return o==null?o===void 0?"[object Undefined]":"[object Null]":r&&r in Object(o)?t(o):n(o)}}function ao(){return il?ol:(il=1,ol=function(e){return e!=null&&typeof e=="object"})}function Yo(){if(ll)return al;ll=1;var e=io(),t=ao();return al=function(n){return typeof n=="symbol"||t(n)&&e(n)=="[object Symbol]"}}function Di(){if(cl)return sl;cl=1;var e=Xn(),t=Yo(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return sl=function(o,i){if(e(o))return!1;var l=typeof o;return!(l!="number"&&l!="symbol"&&l!="boolean"&&o!=null&&!t(o))||r.test(o)||!n.test(o)||i!=null&&o in Object(i)}}function Er(){return dl?ul:(dl=1,ul=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")})}function Ks(){if(fl)return hl;fl=1;var e=io(),t=Er();return hl=function(n){if(!t(n))return!1;var r=e(n);return r=="[object Function]"||r=="[object GeneratorFunction]"||r=="[object AsyncFunction]"||r=="[object Proxy]"}}function V0(){if(vl)return ml;vl=1;var e,t=function(){if(pl)return gl;pl=1;var r=Gn()["__core-js_shared__"];return gl=r}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return ml=function(r){return!!n&&n in r}}function Vs(){if(yl)return wl;yl=1;var e=Function.prototype.toString;return wl=function(t){if(t!=null){try{return e.call(t)}catch{}try{return t+""}catch{}}return""}}function Ir(){if(Ml)return kl;Ml=1;var e=function(){if(xl)return bl;xl=1;var n=Ks(),r=V0(),o=Er(),i=Vs(),l=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,h=s.hasOwnProperty,C=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return bl=function(y){return!(!o(y)||r(y))&&(n(y)?C:l).test(i(y))}}(),t=Sl?Cl:(Sl=1,Cl=function(n,r){return n==null?void 0:n[r]});return kl=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Ko(){if(El)return Rl;El=1;var e=Ir()(Object,"create");return Rl=e}function U0(){if(jl)return _l;jl=1;var e=function(){if(Tl)return Il;Tl=1;var l=Ko();return Il=function(){this.__data__=l?l(null):{},this.size=0}}(),t=Ol?Hl:(Ol=1,Hl=function(l){var a=this.has(l)&&delete this.__data__[l];return this.size-=a?1:0,a}),n=function(){if(Dl)return Pl;Dl=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return Pl=function(s){var c=this.__data__;if(l){var h=c[s];return h==="__lodash_hash_undefined__"?void 0:h}return a.call(c,s)?c[s]:void 0}}(),r=function(){if(Al)return zl;Al=1;var l=Ko(),a=Object.prototype.hasOwnProperty;return zl=function(s){var c=this.__data__;return l?c[s]!==void 0:a.call(c,s)}}(),o=function(){if(Ll)return Fl;Ll=1;var l=Ko();return Fl=function(a,s){var c=this.__data__;return this.size+=this.has(a)?0:1,c[a]=l&&s===void 0?"__lodash_hash_undefined__":s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_l=i}function zi(){return $l?Wl:($l=1,Wl=function(e,t){return e===t||e!=e&&t!=t})}function Vo(){if(Gl)return Xl;Gl=1;var e=zi();return Xl=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function Uo(){if(ts)return es;ts=1;var e=Bl?Nl:(Bl=1,Nl=function(){this.__data__=[],this.size=0}),t=function(){if(Kl)return Yl;Kl=1;var l=Vo(),a=Array.prototype.splice;return Yl=function(s){var c=this.__data__,h=l(c,s);return!(h<0||(h==c.length-1?c.pop():a.call(c,h,1),--this.size,0))}}(),n=function(){if(Ul)return Vl;Ul=1;var l=Vo();return Vl=function(a){var s=this.__data__,c=l(s,a);return c<0?void 0:s[c][1]}}(),r=function(){if(Jl)return ql;Jl=1;var l=Vo();return ql=function(a){return l(this.__data__,a)>-1}}(),o=function(){if(Zl)return Ql;Zl=1;var l=Vo();return Ql=function(a,s){var c=this.__data__,h=l(c,a);return h<0?(++this.size,c.push([a,s])):c[h][1]=s,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,es=i}function Ai(){if(rs)return ns;rs=1;var e=Ir()(Gn(),"Map");return ns=e}function qo(){if(cs)return ss;cs=1;var e=ls?as:(ls=1,as=function(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null});return ss=function(t,n){var r=t.__data__;return e(n)?r[typeof n=="string"?"string":"hash"]:r.map}}function Fi(){if(ys)return ws;ys=1;var e=function(){if(is)return os;is=1;var l=U0(),a=Uo(),s=Ai();return os=function(){this.size=0,this.__data__={hash:new l,map:new(s||a),string:new l}}}(),t=function(){if(ds)return us;ds=1;var l=qo();return us=function(a){var s=l(this,a).delete(a);return this.size-=s?1:0,s}}(),n=function(){if(fs)return hs;fs=1;var l=qo();return hs=function(a){return l(this,a).get(a)}}(),r=function(){if(ps)return gs;ps=1;var l=qo();return gs=function(a){return l(this,a).has(a)}}(),o=function(){if(vs)return ms;vs=1;var l=qo();return ms=function(a,s){var c=l(this,a),h=c.size;return c.set(a,s),this.size+=c.size==h?0:1,this}}();function i(l){var a=-1,s=l==null?0:l.length;for(this.clear();++a<s;){var c=l[a];this.set(c[0],c[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,ws=i}function q0(){if(Cs)return Oi;Cs=1;var e=function(){if(xs)return bs;xs=1;var t=Fi();function n(r,o){if(typeof r!="function"||o!=null&&typeof o!="function")throw new TypeError("Expected a function");var i=function(){var l=arguments,a=o?o.apply(this,l):l[0],s=i.cache;if(s.has(a))return s.get(a);var c=r.apply(this,l);return i.cache=s.set(a,c)||s,c};return i.cache=new(n.Cache||t),i}return n.Cache=t,bs=n}();return Oi=function(t){var n=e(t,function(o){return r.size===500&&r.clear(),o}),r=n.cache;return n},Oi}function J0(){if(Es)return Pi;Es=1;var e=oo(),t=Rs?Ms:(Rs=1,Ms=function(l,a){for(var s=-1,c=l==null?0:l.length,h=Array(c);++s<c;)h[s]=a(l[s],s,l);return h}),n=Xn(),r=Yo(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return Pi=function l(a){if(typeof a=="string")return a;if(n(a))return t(a,l)+"";if(r(a))return i?i.call(a):"";var s=a+"";return s=="0"&&1/a==-1/0?"-0":s},Pi}function Us(){if(Os)return Hs;Os=1;var e=Xn(),t=Di(),n=function(){if(ks)return Ss;ks=1;var o=q0(),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,a=o(function(s){var c=[];return s.charCodeAt(0)===46&&c.push(""),s.replace(i,function(h,C,y,p){c.push(y?p.replace(l,"$1"):C||h)}),c});return Ss=a}(),r=function(){if(Ts)return Is;Ts=1;var o=J0();return Is=function(i){return i==null?"":o(i)}}();return Hs=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}}function Li(){if(As)return zs;As=1;var e=function(){if(Ds)return Ps;Ds=1;var l=io(),a=ao();return Ps=function(s){return a(s)&&l(s)=="[object Arguments]"}}(),t=ao(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(l){return t(l)&&r.call(l,"callee")&&!o.call(l,"callee")};return zs=i}function _i(){if(Ls)return Fs;Ls=1;var e=/^(?:0|[1-9]\d*)$/;return Fs=function(t,n){var r=typeof t;return!!(n=n??9007199254740991)&&(r=="number"||r!="symbol"&&e.test(t))&&t>-1&&t%1==0&&t<n}}function ji(){return js?_s:(js=1,_s=function(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=9007199254740991})}function Jo(){if(Bs)return Ns;Bs=1;var e=Yo();return Ns=function(t){if(typeof t=="string"||e(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}}function qs(){if($s)return Ws;$s=1;var e=Us(),t=Li(),n=Xn(),r=_i(),o=ji(),i=Jo();return Ws=function(l,a,s){for(var c=-1,h=(a=e(a,l)).length,C=!1;++c<h;){var y=i(a[c]);if(!(C=l!=null&&s(l,y)))break;l=l[y]}return C||++c!=h?C:!!(h=l==null?0:l.length)&&o(h)&&r(y,h)&&(n(l)||t(l))}}const Q0=Sr(function(){if(Gs)return Xs;Gs=1;var e=function(){if($n)return cr;$n=1;var n=Object.prototype.hasOwnProperty;return cr=function(r,o){return r!=null&&n.call(r,o)}}(),t=qs();return Xs=function(n,r){return n!=null&&t(n,r,e)}}());function Js(e="This should not happen"){throw new Error(e)}function Rn(e,t="Assertion failed"){if(!e)return Js(t)}function lo(e,t){return Js(t??"Hell froze over")}const Qs=Object.prototype.hasOwnProperty;function $r(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--&&$r(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){for(n in r=0,e)if(Qs.call(e,n)&&++r&&!Qs.call(t,n)||!(n in t)||!$r(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}const Qo=null,Ni=void 0;var pe,ur,Zo,Hn;function ei(e){return"width"in e&&typeof e.width=="number"}async function Zs(e){return typeof e=="object"?e:await e()}Mr=function(e){return e.kind!==pe.Loading&&e.kind!==pe.Bubble&&e.kind!==pe.RowID&&e.kind!==pe.Protected&&e.kind!==pe.Drilldown},kr=function(e){return e.kind===Hn.Marker||e.kind===Hn.NewRow};function so(e){if(!Mr(e)||e.kind===pe.Image)return!1;switch(e.kind){case pe.Text:case pe.Number:case pe.Markdown:case pe.Uri:case pe.Custom:case pe.Boolean:return e.readonly!==!0;default:lo(0,"A cell was passed with an invalid kind")}}$a=function(e){return Q0(e,"editor")};function Bi(e){return!e.readonly}let ec;(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"})(pe||(pe={})),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"}(ur||(ur={})),function(e){e.Triangle="triangle",e.Dots="dots"}(Zo||(Zo={})),function(e){e.NewRow="new-row",e.Marker="marker"}(Hn||(Hn={}));const Zn=class Zn{constructor(t){ft(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 Zn(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,r=function(o){if(o.length===0)return[];const i=[...o],l=[];i.sort(function(a,s){return a[0]-s[0]}),l.push([...i[0]]);for(const a of i.slice(1)){const s=l[l.length-1];s[1]<a[0]?l.push([...a]):s[1]<a[1]&&(s[1]=a[1])}return l}([...this.items,n]);return new Zn(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,l]of n.entries()){const[a,s]=l;if(a<=o&&r<=s){const c=[];a<r&&c.push([a,r]),o<s&&c.push([o,s]),n.splice(i,1,...c)}}return new Zn(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}};ft(Zn,"empty",()=>ec??(ec=new Zn([]))),ft(Zn,"fromSingleSelection",t=>Zn.empty().add(t));let yt=Zn;var tc=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[,l]=i.split("_");t[l]=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(" ")},nc=(e,t)=>{const n={};return Object.keys(e).filter((r=>o=>r.indexOf(o)===-1)(t)).forEach(r=>{n[r]=e[r]}),n},Z0=(e,t)=>{};Cn=function(e){let t="";return n=>{const r=(i,l)=>{const{as:a=e,class:s=t}=i;var c;const h=function(y,p,w){const v=nc(p,w);if(!y){const E=typeof Fa=="function"?{default:Fa}:Fa;Object.keys(v).forEach(g=>{E.default(g)||delete v[g]})}return v}(n.propsAsIs===void 0?!(typeof a=="string"&&a.indexOf("-")===-1&&(c=a[0],c.toUpperCase()!==c)):n.propsAsIs,i,["as","class"]);h.ref=l,h.className=n.atomic?tc(n.class,h.className||s):tc(h.className||s,n.class);const{vars:C}=n;if(C){const y={};for(const v in C){const E=C[v],g=E[0],b=E[1]||"",x=typeof g=="function"?g(i):g;Z0(0,n.name),y[`--${v}`]=`${x}${b}`}const p=h.style||{},w=Object.keys(p);w.length>0&&w.forEach(v=>{y[v]=p[v]}),h.style=y}return e.__wyw_meta&&e!==a?(h.as=a,d.createElement(e,h)):d.createElement(a,h)},o=d.forwardRef?d.forwardRef(r):i=>{const l=nc(i,["innerRef"]);return r(l,i.innerRef)};return o.displayName=n.name,o.__wyw_meta={className:n.class||t,extends:e},o}};const e1=Cn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var rc,oc,ic={},co={},ac={},lc={};function t1(){return rc||(rc=1,function(e,t,n){Object.defineProperty(e,"__esModule",{value:!0}),e.setHasSupportToCaptureOption=p;var r=i(t),o=i(n);function i(g){return g&&g.__esModule?g:{default:g}}var l=Object.assign||function(g){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g};function a(g,b){var x={};for(var I in g)b.indexOf(I)>=0||Object.prototype.hasOwnProperty.call(g,I)&&(x[I]=g[I]);return x}function s(g,b){if(!(g instanceof b))throw new TypeError("Cannot call a class as a function")}var c=function(){function g(b,x){for(var I=0;I<x.length;I++){var m=x[I];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(b,m.key,m)}}return function(b,x,I){return x&&g(b.prototype,x),I&&g(b,I),b}}();function h(g,b){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||typeof b!="object"&&typeof b!="function"?g:b}function C(g,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);g.prototype=Object.create(b&&b.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(g,b):g.__proto__=b)}var y=!1;function p(g){y=g}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){p(!0)}}))}catch{}function w(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return y?g:g.capture}function v(g){if("touches"in g){var b=g.touches[0];return{x:b.pageX,y:b.pageY}}return{x:g.screenX,y:g.screenY}}var E=function(g){function b(){var x;s(this,b);for(var I=arguments.length,m=Array(I),S=0;S<I;S++)m[S]=arguments[S];var R=h(this,(x=b.__proto__||Object.getPrototypeOf(b)).call.apply(x,[this].concat(m)));return R._handleSwipeStart=R._handleSwipeStart.bind(R),R._handleSwipeMove=R._handleSwipeMove.bind(R),R._handleSwipeEnd=R._handleSwipeEnd.bind(R),R._onMouseDown=R._onMouseDown.bind(R),R._onMouseMove=R._onMouseMove.bind(R),R._onMouseUp=R._onMouseUp.bind(R),R._setSwiperRef=R._setSwiperRef.bind(R),R}return C(b,g),c(b,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,w({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,w({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(x){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(x))}},{key:"_onMouseMove",value:function(x){this.mouseDown&&this._handleSwipeMove(x)}},{key:"_onMouseUp",value:function(x){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(x)}},{key:"_handleSwipeStart",value:function(x){var I=v(x),m=I.x,S=I.y;this.moveStart={x:m,y:S},this.props.onSwipeStart(x)}},{key:"_handleSwipeMove",value:function(x){if(this.moveStart){var I=v(x),m=I.x,S=I.y,R=m-this.moveStart.x,H=S-this.moveStart.y;this.moving=!0,this.props.onSwipeMove({x:R,y:H},x)&&x.cancelable&&x.preventDefault(),this.movePosition={deltaX:R,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(x){this.props.onSwipeEnd(x);var I=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-I?this.props.onSwipeLeft(1,x):this.movePosition.deltaX>I&&this.props.onSwipeRight(1,x),this.movePosition.deltaY<-I?this.props.onSwipeUp(1,x):this.movePosition.deltaY>I&&this.props.onSwipeDown(1,x)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(x){this.swiper=x,this.props.innerRef(x)}},{key:"render",value:function(){var x=this.props;x.tagName;var I=x.className,m=x.style,S=x.children;x.allowMouseEvents,x.onSwipeUp,x.onSwipeDown,x.onSwipeLeft,x.onSwipeRight,x.onSwipeStart,x.onSwipeMove,x.onSwipeEnd,x.innerRef,x.tolerance;var R=a(x,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,l({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:I,style:m},R),S)}}]),b}(t.Component);E.displayName="ReactSwipe",E.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},E.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},e.default=E}(lc,Go(),jp())),lc}function sc(){return oc||(oc=1,function(e,t){Object.defineProperty(e,"__esModule",{value:!0});var n=r(t);function r(o){return o&&o.__esModule?o:{default:o}}e.default=n.default}(ac,t1())),ac}var cc,uc,uo={},dc={exports:{}};function hc(){if(uc)return uo;uc=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.default=void 0;var e,t,n=(cc||(cc=1,t=dc,function(){var o={}.hasOwnProperty;function i(){for(var s="",c=0;c<arguments.length;c++){var h=arguments[c];h&&(s=a(s,l(h)))}return s}function l(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return i.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var c="";for(var h in s)o.call(s,h)&&s[h]&&(c=a(c,h));return c}function a(s,c){return c?s?s+" "+c:s+c:s}t.exports?(i.default=i,t.exports=i):window.classNames=i}()),(e=dc.exports)&&e.__esModule?e:{default:e}),r={ROOT:function(o){return(0,n.default)(function(i,l,a){return l in i?Object.defineProperty(i,l,{value:a,enumerable:!0,configurable:!0,writable:!0}):i[l]=a,i}({"carousel-root":!0},o||"",!!o))},CAROUSEL:function(o){return(0,n.default)({carousel:!0,"carousel-slider":o})},WRAPPER:function(o,i){return(0,n.default)({"thumbs-wrapper":!o,"slider-wrapper":o,"axis-horizontal":i==="horizontal","axis-vertical":i!=="horizontal"})},SLIDER:function(o,i){return(0,n.default)({thumbs:!o,slider:o,animated:!i})},ITEM:function(o,i,l){return(0,n.default)({thumb:!o,slide:o,selected:i,previous:l})},ARROW_PREV:function(o){return(0,n.default)({"control-arrow control-prev":!0,"control-disabled":o})},ARROW_NEXT:function(o){return(0,n.default)({"control-arrow control-next":!0,"control-disabled":o})},DOT:function(o){return(0,n.default)({dot:!0,selected:o})}};return uo.default=r,uo}var fc,ho={},ti={},gc,fo={};function Wi(){return gc?fo:(gc=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.default=void 0,fo.default=function(e,t,n){var r=e===0?e:e+t;return"translate3d"+("("+(n==="horizontal"?[r,0,0]:[0,r,0]).join(",")+")")},fo)}var pc,mc,go={};function vc(){return pc?go:(pc=1,Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0,go.default=function(){return window},go)}function wc(){if(mc)return ho;mc=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.default=void 0;var e=function(g){if(g&&g.__esModule)return g;if(g===null||s(g)!=="object"&&typeof g!="function")return{default:g};var b=a();if(b&&b.has(g))return b.get(g);var x={},I=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in g)if(Object.prototype.hasOwnProperty.call(g,m)){var S=I?Object.getOwnPropertyDescriptor(g,m):null;S&&(S.get||S.set)?Object.defineProperty(x,m,S):x[m]=g[m]}return x.default=g,b&&b.set(g,x),x}(Go()),t=l(hc()),n=(fc||(fc=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.outerWidth=void 0,ti.outerWidth=function(g){var b=g.offsetWidth,x=getComputedStyle(g);return b+(parseInt(x.marginLeft)+parseInt(x.marginRight))}),ti),r=l(Wi()),o=l(sc()),i=l(vc());function l(g){return g&&g.__esModule?g:{default:g}}function a(){if(typeof WeakMap!="function")return null;var g=new WeakMap;return a=function(){return g},g}function s(g){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},s(g)}function c(){return c=Object.assign||function(g){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var I in x)Object.prototype.hasOwnProperty.call(x,I)&&(g[I]=x[I])}return g},c.apply(this,arguments)}function h(g,b,x){return b&&function(I,m){for(var S=0;S<m.length;S++){var R=m[S];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(I,R.key,R)}}(g.prototype,b),g}function C(g,b){return C=Object.setPrototypeOf||function(x,I){return x.__proto__=I,x},C(g,b)}function y(g){var b=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var x,I=w(g);if(b){var m=w(this).constructor;x=Reflect.construct(I,arguments,m)}else x=I.apply(this,arguments);return function(S,R){return R&&(s(R)==="object"||typeof R=="function")?R:p(S)}(this,x)}}function p(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function w(g){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},w(g)}function v(g,b,x){return b in g?Object.defineProperty(g,b,{value:x,enumerable:!0,configurable:!0,writable:!0}):g[b]=x,g}var E=function(g){(function(I,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");I.prototype=Object.create(m&&m.prototype,{constructor:{value:I,writable:!0,configurable:!0}}),m&&C(I,m)})(x,g);var b=y(x);function x(I){var m;return function(S,R){if(!(S instanceof R))throw new TypeError("Cannot call a class as a function")}(this,x),v(p(m=b.call(this,I)),"itemsWrapperRef",void 0),v(p(m),"itemsListRef",void 0),v(p(m),"thumbsRef",void 0),v(p(m),"setItemsWrapperRef",function(S){m.itemsWrapperRef=S}),v(p(m),"setItemsListRef",function(S){m.itemsListRef=S}),v(p(m),"setThumbsRef",function(S,R){m.thumbsRef||(m.thumbsRef=[]),m.thumbsRef[R]=S}),v(p(m),"updateSizes",function(){if(m.props.children&&m.itemsWrapperRef&&m.thumbsRef){var S=e.Children.count(m.props.children),R=m.itemsWrapperRef.clientWidth,H=m.props.thumbWidth?m.props.thumbWidth:(0,n.outerWidth)(m.thumbsRef[0]),f=Math.floor(R/H),B=f<S,D=B?S-f:0;m.setState(function(O,T){return{itemSize:H,visibleItems:f,firstItem:B?m.getFirstItem(T.selectedItem):0,lastPosition:D,showArrows:B}})}}),v(p(m),"handleClickItem",function(S,R,H){if(!function(B){return B.hasOwnProperty("key")}(H)||H.key==="Enter"){var f=m.props.onSelectItem;typeof f=="function"&&f(S,R)}}),v(p(m),"onSwipeStart",function(){m.setState({swiping:!0})}),v(p(m),"onSwipeEnd",function(){m.setState({swiping:!1})}),v(p(m),"onSwipeMove",function(S){var R=S.x;if(!m.state.itemSize||!m.itemsWrapperRef||!m.state.visibleItems)return!1;var H=e.Children.count(m.props.children),f=-100*m.state.firstItem/m.state.visibleItems;f===0&&R>0&&(R=0),f===100*-Math.max(H-m.state.visibleItems,0)/m.state.visibleItems&&R<0&&(R=0);var B=f+100/(m.itemsWrapperRef.clientWidth/R);return m.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(D){m.itemsListRef.style[D]=(0,r.default)(B,"%",m.props.axis)}),!0}),v(p(m),"slideRight",function(S){m.moveTo(m.state.firstItem-(typeof S=="number"?S:1))}),v(p(m),"slideLeft",function(S){m.moveTo(m.state.firstItem+(typeof S=="number"?S:1))}),v(p(m),"moveTo",function(S){S=(S=S<0?0:S)>=m.state.lastPosition?m.state.lastPosition:S,m.setState({firstItem:S})}),m.state={selectedItem:I.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},m}return h(x,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(I){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==I.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(I){var m=I;return I>=this.state.lastPosition&&(m=this.state.lastPosition),I<this.state.firstItem+this.state.visibleItems&&(m=this.state.firstItem),I<this.state.firstItem&&(m=I),m}},{key:"renderItems",value:function(){var I=this;return this.props.children.map(function(m,S){var R=t.default.ITEM(!1,S===I.state.selectedItem),H={key:S,ref:function(f){return I.setThumbsRef(f,S)},className:R,onClick:I.handleClickItem.bind(I,S,I.props.children[S]),onKeyDown:I.handleClickItem.bind(I,S,I.props.children[S]),"aria-label":"".concat(I.props.labels.item," ").concat(S+1),style:{width:I.props.thumbWidth}};return e.default.createElement("li",c({},H,{role:"button",tabIndex:0}),m)})}},{key:"render",value:function(){var I=this;if(!this.props.children)return null;var m,S=e.Children.count(this.props.children)>1,R=this.state.showArrows&&this.state.firstItem>0,H=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,f=-this.state.firstItem*(this.state.itemSize||0),B=(0,r.default)(f,"px",this.props.axis),D=this.props.transitionTime+"ms";return m={WebkitTransform:B,MozTransform:B,MsTransform:B,OTransform:B,transform:B,msTransform:B,WebkitTransitionDuration:D,MozTransitionDuration:D,MsTransitionDuration:D,OTransitionDuration:D,transitionDuration:D,msTransitionDuration:D},e.default.createElement("div",{className:t.default.CAROUSEL(!1)},e.default.createElement("div",{className:t.default.WRAPPER(!1),ref:this.setItemsWrapperRef},e.default.createElement("button",{type:"button",className:t.default.ARROW_PREV(!R),onClick:function(){return I.slideRight()},"aria-label":this.props.labels.leftArrow}),S?e.default.createElement(o.default,{tagName:"ul",className:t.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:m,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):e.default.createElement("ul",{className:t.default.SLIDER(!1,this.state.swiping),ref:function(O){return I.setItemsListRef(O)},style:m},this.renderItems()),e.default.createElement("button",{type:"button",className:t.default.ARROW_NEXT(!H),onClick:function(){return I.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),x}(e.Component);return ho.default=E,v(E,"displayName","Thumbs"),v(E,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350}),ho}var yc,ni={},bc,En={};function xc(){if(bc)return En;bc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.setPosition=En.getPosition=En.isKeyboardEvent=En.defaultStatusFormatter=En.noop=void 0;var e,t=Go(),n=(e=Wi())&&e.__esModule?e:{default:e};return En.noop=function(){},En.defaultStatusFormatter=function(r,o){return"".concat(r," of ").concat(o)},En.isKeyboardEvent=function(r){return!!r&&r.hasOwnProperty("key")},En.getPosition=function(r,o){if(o.infiniteLoop&&++r,r===0)return 0;var i=t.Children.count(o.children);if(o.centerMode&&o.axis==="horizontal"){var l=-r*o.centerSlidePercentage,a=i-1;return r&&(r!==a||o.infiniteLoop)?l+=(100-o.centerSlidePercentage)/2:r===a&&(l+=100-o.centerSlidePercentage),l}return 100*-r},En.setPosition=function(r,o){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(l){i[l]=(0,n.default)(r,"%",o)}),i},En}var Cc,Sc,Fn={};function n1(){if(Sc)return co;Sc=1,Object.defineProperty(co,"__esModule",{value:!0}),co.default=void 0;var e=function(m){if(m&&m.__esModule)return m;if(m===null||h(m)!=="object"&&typeof m!="function")return{default:m};var S=c();if(S&&S.has(m))return S.get(m);var R={},H=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in m)if(Object.prototype.hasOwnProperty.call(m,f)){var B=H?Object.getOwnPropertyDescriptor(m,f):null;B&&(B.get||B.set)?Object.defineProperty(R,f,B):R[f]=m[f]}return R.default=m,S&&S.set(m,R),R}(Go()),t=s(sc()),n=s(hc()),r=s(wc()),o=s((yc||(yc=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.default=void 0,ni.default=function(){return document}),ni)),i=s(vc()),l=xc(),a=function(){if(Cc)return Fn;Cc=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.fadeAnimationHandler=Fn.slideStopSwipingHandler=Fn.slideSwipeAnimationHandler=Fn.slideAnimationHandler=void 0;var m,S=Go(),R=(m=Wi())&&m.__esModule?m:{default:m},H=xc();function f(O,T){var j=Object.keys(O);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(O);T&&(U=U.filter(function(te){return Object.getOwnPropertyDescriptor(O,te).enumerable})),j.push.apply(j,U)}return j}function B(O){for(var T=1;T<arguments.length;T++){var j=arguments[T]!=null?arguments[T]:{};T%2?f(Object(j),!0).forEach(function(U){D(O,U,j[U])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(j)):f(Object(j)).forEach(function(U){Object.defineProperty(O,U,Object.getOwnPropertyDescriptor(j,U))})}return O}function D(O,T,j){return T in O?Object.defineProperty(O,T,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[T]=j,O}return Fn.slideAnimationHandler=function(O,T){var j={},U=T.selectedItem,te=U,J=S.Children.count(O.children)-1;if(O.infiniteLoop&&(U<0||U>J))return te<0?O.centerMode&&O.centerSlidePercentage&&O.axis==="horizontal"?j.itemListStyle=(0,H.setPosition)(-(J+2)*O.centerSlidePercentage-(100-O.centerSlidePercentage)/2,O.axis):j.itemListStyle=(0,H.setPosition)(100*-(J+2),O.axis):te>J&&(j.itemListStyle=(0,H.setPosition)(0,O.axis)),j;var ce=(0,H.getPosition)(U,O),se=(0,R.default)(ce,"%",O.axis),q=O.transitionTime+"ms";return j.itemListStyle={WebkitTransform:se,msTransform:se,OTransform:se,transform:se},T.swiping||(j.itemListStyle=B(B({},j.itemListStyle),{},{WebkitTransitionDuration:q,MozTransitionDuration:q,OTransitionDuration:q,transitionDuration:q,msTransitionDuration:q})),j},Fn.slideSwipeAnimationHandler=function(O,T,j,U){var te={},J=T.axis==="horizontal",ce=S.Children.count(T.children),se=(0,H.getPosition)(j.selectedItem,T),q=T.infiniteLoop?(0,H.getPosition)(ce-1,T)-100:(0,H.getPosition)(ce-1,T),Z=J?O.x:O.y,fe=Z;se===0&&Z>0&&(fe=0),se===q&&Z<0&&(fe=0);var N=se+100/(j.itemSize/fe),K=Math.abs(Z)>T.swipeScrollTolerance;return T.infiniteLoop&&K&&(j.selectedItem===0&&N>-100?N-=100*ce:j.selectedItem===ce-1&&N<100*-ce&&(N+=100*ce)),(!T.preventMovementUntilSwipeScrollTolerance||K||j.swipeMovementStarted)&&(j.swipeMovementStarted||U({swipeMovementStarted:!0}),te.itemListStyle=(0,H.setPosition)(N,T.axis)),K&&!j.cancelClick&&U({cancelClick:!0}),te},Fn.slideStopSwipingHandler=function(O,T){var j=(0,H.getPosition)(T.selectedItem,O);return{itemListStyle:(0,H.setPosition)(j,O.axis)}},Fn.fadeAnimationHandler=function(O,T){var j=O.transitionTime+"ms",U="ease-in-out",te={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:U,msTransitionTimingFunction:U,MozTransitionTimingFunction:U,WebkitTransitionTimingFunction:U,OTransitionTimingFunction:U};return T.swiping||(te=B(B({},te),{},{WebkitTransitionDuration:j,MozTransitionDuration:j,OTransitionDuration:j,transitionDuration:j,msTransitionDuration:j})),{slideStyle:te,selectedStyle:B(B({},te),{},{opacity:1,position:"relative"}),prevStyle:B({},te)}},Fn}();function s(m){return m&&m.__esModule?m:{default:m}}function c(){if(typeof WeakMap!="function")return null;var m=new WeakMap;return c=function(){return m},m}function h(m){return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},h(m)}function C(){return C=Object.assign||function(m){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var H in R)Object.prototype.hasOwnProperty.call(R,H)&&(m[H]=R[H])}return m},C.apply(this,arguments)}function y(m,S){var R=Object.keys(m);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(m);S&&(H=H.filter(function(f){return Object.getOwnPropertyDescriptor(m,f).enumerable})),R.push.apply(R,H)}return R}function p(m){for(var S=1;S<arguments.length;S++){var R=arguments[S]!=null?arguments[S]:{};S%2?y(Object(R),!0).forEach(function(H){x(m,H,R[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(R)):y(Object(R)).forEach(function(H){Object.defineProperty(m,H,Object.getOwnPropertyDescriptor(R,H))})}return m}function w(m,S,R){return S&&function(H,f){for(var B=0;B<f.length;B++){var D=f[B];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(H,D.key,D)}}(m.prototype,S),m}function v(m,S){return v=Object.setPrototypeOf||function(R,H){return R.__proto__=H,R},v(m,S)}function E(m){var S=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}();return function(){var R,H=b(m);if(S){var f=b(this).constructor;R=Reflect.construct(H,arguments,f)}else R=H.apply(this,arguments);return function(B,D){return D&&(h(D)==="object"||typeof D=="function")?D:g(B)}(this,R)}}function g(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function b(m){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},b(m)}function x(m,S,R){return S in m?Object.defineProperty(m,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):m[S]=R,m}var I=function(m){(function(H,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");H.prototype=Object.create(f&&f.prototype,{constructor:{value:H,writable:!0,configurable:!0}}),f&&v(H,f)})(R,m);var S=E(R);function R(H){var f;(function(D,O){if(!(D instanceof O))throw new TypeError("Cannot call a class as a function")})(this,R),x(g(f=S.call(this,H)),"thumbsRef",void 0),x(g(f),"carouselWrapperRef",void 0),x(g(f),"listRef",void 0),x(g(f),"itemsRef",void 0),x(g(f),"timer",void 0),x(g(f),"animationHandler",void 0),x(g(f),"setThumbsRef",function(D){f.thumbsRef=D}),x(g(f),"setCarouselWrapperRef",function(D){f.carouselWrapperRef=D}),x(g(f),"setListRef",function(D){f.listRef=D}),x(g(f),"setItemsRef",function(D,O){f.itemsRef||(f.itemsRef=[]),f.itemsRef[O]=D}),x(g(f),"autoPlay",function(){e.Children.count(f.props.children)<=1||(f.clearAutoPlay(),f.props.autoPlay&&(f.timer=setTimeout(function(){f.increment()},f.props.interval)))}),x(g(f),"clearAutoPlay",function(){f.timer&&clearTimeout(f.timer)}),x(g(f),"resetAutoPlay",function(){f.clearAutoPlay(),f.autoPlay()}),x(g(f),"stopOnHover",function(){f.setState({isMouseEntered:!0},f.clearAutoPlay)}),x(g(f),"startOnLeave",function(){f.setState({isMouseEntered:!1},f.autoPlay)}),x(g(f),"isFocusWithinTheCarousel",function(){return!!f.carouselWrapperRef&&!((0,o.default)().activeElement!==f.carouselWrapperRef&&!f.carouselWrapperRef.contains((0,o.default)().activeElement))}),x(g(f),"navigateWithKeyboard",function(D){if(f.isFocusWithinTheCarousel()){var O=f.props.axis==="horizontal",T=O?37:38;(O?39:40)===D.keyCode?f.increment():T===D.keyCode&&f.decrement()}}),x(g(f),"updateSizes",function(){if(f.state.initialized&&f.itemsRef&&f.itemsRef.length!==0){var D=f.props.axis==="horizontal",O=f.itemsRef[0];if(O){var T=D?O.clientWidth:O.clientHeight;f.setState({itemSize:T}),f.thumbsRef&&f.thumbsRef.updateSizes()}}}),x(g(f),"setMountState",function(){f.setState({hasMount:!0}),f.updateSizes()}),x(g(f),"handleClickItem",function(D,O){e.Children.count(f.props.children)!==0&&(f.state.cancelClick?f.setState({cancelClick:!1}):(f.props.onClickItem(D,O),D!==f.state.selectedItem&&f.setState({selectedItem:D})))}),x(g(f),"handleOnChange",function(D,O){e.Children.count(f.props.children)<=1||f.props.onChange(D,O)}),x(g(f),"handleClickThumb",function(D,O){f.props.onClickThumb(D,O),f.moveTo(D)}),x(g(f),"onSwipeStart",function(D){f.setState({swiping:!0}),f.props.onSwipeStart(D)}),x(g(f),"onSwipeEnd",function(D){f.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),f.props.onSwipeEnd(D),f.clearAutoPlay(),f.state.autoPlay&&f.autoPlay()}),x(g(f),"onSwipeMove",function(D,O){f.props.onSwipeMove(O);var T=f.props.swipeAnimationHandler(D,f.props,f.state,f.setState.bind(g(f)));return f.setState(p({},T)),!!Object.keys(T).length}),x(g(f),"decrement",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem-(typeof D=="number"?D:1))}),x(g(f),"increment",function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;f.moveTo(f.state.selectedItem+(typeof D=="number"?D:1))}),x(g(f),"moveTo",function(D){if(typeof D=="number"){var O=e.Children.count(f.props.children)-1;D<0&&(D=f.props.infiniteLoop?O:0),D>O&&(D=f.props.infiniteLoop?0:O),f.selectItem({selectedItem:D}),f.state.autoPlay&&f.state.isMouseEntered===!1&&f.resetAutoPlay()}}),x(g(f),"onClickNext",function(){f.increment(1)}),x(g(f),"onClickPrev",function(){f.decrement(1)}),x(g(f),"onSwipeForward",function(){f.increment(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"onSwipeBackwards",function(){f.decrement(1),f.props.emulateTouch&&f.setState({cancelClick:!0})}),x(g(f),"changeItem",function(D){return function(O){(0,l.isKeyboardEvent)(O)&&O.key!=="Enter"||f.moveTo(D)}}),x(g(f),"selectItem",function(D){f.setState(p({previousItem:f.state.selectedItem},D),function(){f.setState(f.animationHandler(f.props,f.state))}),f.handleOnChange(D.selectedItem,e.Children.toArray(f.props.children)[D.selectedItem])}),x(g(f),"getInitialImage",function(){var D=f.props.selectedItem,O=f.itemsRef&&f.itemsRef[D];return(O&&O.getElementsByTagName("img")||[])[0]}),x(g(f),"getVariableItemHeight",function(D){var O=f.itemsRef&&f.itemsRef[D];if(f.state.hasMount&&O&&O.children.length){var T=O.children[0].getElementsByTagName("img")||[];if(T.length>0){var j=T[0];j.complete||j.addEventListener("load",function te(){f.forceUpdate(),j.removeEventListener("load",te)})}var U=(T[0]||O.children[0]).clientHeight;return U>0?U:null}return null});var B={initialized:!1,previousItem:H.selectedItem,selectedItem:H.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:H.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return f.animationHandler=typeof H.animationHandler=="function"&&H.animationHandler||H.animationHandler==="fade"&&a.fadeAnimationHandler||a.slideAnimationHandler,f.state=p(p({},B),f.animationHandler(H,B)),f}return w(R,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(H,f){H.children||!this.props.children||this.state.initialized||this.setupCarousel(),!H.autoFocus&&this.props.autoFocus&&this.forceFocus(),f.swiping&&!this.state.swiping&&this.setState(p({},this.props.stopSwipingHandler(this.props,this.state))),H.selectedItem===this.props.selectedItem&&H.centerMode===this.props.centerMode||(this.updateSizes(),this.moveTo(this.props.selectedItem)),H.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 H=this;this.bindEvents(),this.state.autoPlay&&e.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var f=H.getInitialImage();f&&!f.complete?f.addEventListener("load",H.setMountState):H.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.addEventListener("mouseenter",this.stopOnHover),H.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var H=this.carouselWrapperRef;this.props.stopOnHover&&H&&(H.removeEventListener("mouseenter",this.stopOnHover),H.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,i.default)().addEventListener("resize",this.updateSizes),(0,i.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,o.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,i.default)().removeEventListener("resize",this.updateSizes),(0,i.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var H=this.getInitialImage();H&&H.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,o.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var H;(H=this.carouselWrapperRef)===null||H===void 0||H.focus()}},{key:"renderItems",value:function(H){var f=this;return this.props.children?e.Children.map(this.props.children,function(B,D){var O=D===f.state.selectedItem,T=D===f.state.previousItem,j=O&&f.state.selectedStyle||T&&f.state.prevStyle||f.state.slideStyle||{};f.props.centerMode&&f.props.axis==="horizontal"&&(j=p(p({},j),{},{minWidth:f.props.centerSlidePercentage+"%"})),f.state.swiping&&f.state.swipeMovementStarted&&(j=p(p({},j),{},{pointerEvents:"none"}));var U={ref:function(te){return f.setItemsRef(te,D)},key:"itemKey"+D+(H?"clone":""),className:n.default.ITEM(!0,D===f.state.selectedItem,D===f.state.previousItem),onClick:f.handleClickItem.bind(f,D,B),style:j};return e.default.createElement("li",U,f.props.renderItem(B,{isSelected:D===f.state.selectedItem,isPrevious:D===f.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var H=this,f=this.props,B=f.showIndicators,D=f.labels,O=f.renderIndicator,T=f.children;return B?e.default.createElement("ul",{className:"control-dots"},e.Children.map(T,function(j,U){return O&&O(H.changeItem(U),U===H.state.selectedItem,U,D.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?e.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,e.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return this.props.showThumbs&&this.props.children&&e.Children.count(this.props.children)!==0?e.default.createElement(r.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children)):null}},{key:"render",value:function(){var H=this;if(!this.props.children||e.Children.count(this.props.children)===0)return null;var f=this.props.swipeable&&e.Children.count(this.props.children)>1,B=this.props.axis==="horizontal",D=this.props.showArrows&&e.Children.count(this.props.children)>1,O=D&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,T=D&&(this.state.selectedItem<e.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,j=this.renderItems(!0),U=j.shift(),te=j.pop(),J={className:n.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},ce={};if(B){if(J.onSwipeLeft=this.onSwipeForward,J.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var se=this.getVariableItemHeight(this.state.selectedItem);ce.height=se||"auto"}}else J.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,J.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,J.style=p(p({},J.style),{},{height:this.state.itemSize}),ce.height=this.state.itemSize;return e.default.createElement("div",{"aria-label":this.props.ariaLabel,className:n.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},e.default.createElement("div",{className:n.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,O,this.props.labels.leftArrow),e.default.createElement("div",{className:n.default.WRAPPER(!0,this.props.axis),style:ce},f?e.default.createElement(t.default,C({tagName:"ul",innerRef:this.setListRef},J,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&U):e.default.createElement("ul",{className:n.default.SLIDER(!0,this.state.swiping),ref:function(q){return H.setListRef(q)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&te,this.renderItems(),this.props.infiniteLoop&&U)),this.props.renderArrowNext(this.onClickNext,T,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),R}(e.default.Component);return co.default=I,x(I,"displayName","Carousel"),x(I,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:l.noop,onClickThumb:l.noop,onChange:l.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_PREV(!S),onClick:m})},renderArrowNext:function(m,S,R){return e.default.createElement("button",{type:"button","aria-label":R,className:n.default.ARROW_NEXT(!S),onClick:m})},renderIndicator:function(m,S,R,H){return e.default.createElement("li",{className:n.default.DOT(S),onClick:m,onKeyDown:m,value:R,key:R,role:"button",tabIndex:0,"aria-label":"".concat(H," ").concat(R+1)})},renderItem:function(m){return m},renderThumbs:function(m){var S=e.Children.map(m,function(R){var H=R;if(R.type!=="img"&&(H=e.Children.toArray(R.props.children).find(function(f){return f.type==="img"})),H)return H});return S.filter(function(R){return R}).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"),[]):S},statusFormatter:l.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:a.slideSwipeAnimationHandler,stopSwipingHandler:a.slideStopSwipingHandler}),co}var kc,Mc,r1={},Rc,Ec,Ic,Tc,Hc,Oc,Pc,Dc,$i,zc,o1=(Mc||(Mc=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return r.default}});var t=o(n1()),n=(kc||(kc=1),r1),r=o(wc());function o(i){return i&&i.__esModule?i:{default:i}}}(ic)),ic);function i1(){if(Oc)return Hc;Oc=1;var e=function(){if(Tc)return Ic;Tc=1;var n=/\s/;return Ic=function(r){for(var o=r.length;o--&&n.test(r.charAt(o)););return o}}(),t=/^\s+/;return Hc=function(n){return n&&n.slice(0,e(n)+1).replace(t,"")}}function Xi(){if(Dc)return Pc;Dc=1;var e=i1(),t=Er(),n=Yo(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;return Pc=function(a){if(typeof a=="number")return a;if(n(a))return NaN;if(t(a)){var s=typeof a.valueOf=="function"?a.valueOf():a;a=t(s)?s+"":s}if(typeof a!="string")return a===0?a:+a;a=e(a);var c=o.test(a);return c||i.test(a)?l(a.slice(2),c?2:8):r.test(a)?NaN:+a}}function Ac(){if(zc)return $i;zc=1;var e=Er(),t=function(){if(Ec)return Rc;Ec=1;var i=Gn();return Rc=function(){return i.Date.now()}}(),n=Xi(),r=Math.max,o=Math.min;return $i=function(i,l,a){var s,c,h,C,y,p,w=0,v=!1,E=!1,g=!0;if(typeof i!="function")throw new TypeError("Expected a function");function b(R){var H=s,f=c;return s=c=void 0,w=R,C=i.apply(f,H)}function x(R){var H=R-p;return p===void 0||H>=l||H<0||E&&R-w>=h}function I(){var R=t();if(x(R))return m(R);y=setTimeout(I,function(H){var f=l-(H-p);return E?o(f,h-(H-w)):f}(R))}function m(R){return y=void 0,g&&s?b(R):(s=c=void 0,C)}function S(){var R=t(),H=x(R);if(s=arguments,c=this,p=R,H){if(y===void 0)return function(f){return w=f,y=setTimeout(I,l),v?b(f):C}(p);if(E)return clearTimeout(y),y=setTimeout(I,l),b(p)}return y===void 0&&(y=setTimeout(I,l)),C}return l=n(l)||0,e(a)&&(v=!!a.leading,h=(E="maxWait"in a)?r(n(a.maxWait)||0,l):h,g="trailing"in a?!!a.trailing:g),S.cancel=function(){y!==void 0&&clearTimeout(y),w=0,s=p=c=y=void 0},S.flush=function(){return y===void 0?C:m(t())},S},$i}const Fc=Sr(Ac());function cn(e,t,n,r,o=!1){const i=d.useRef();i.current=t,d.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const l=n,a=s=>{var c;(c=i.current)==null||c.call(l,s)};return l.addEventListener(e,a,{passive:r,capture:o}),()=>{l.removeEventListener(e,a,{capture:o})}},[e,n,r,o])}function dr(e,t){return e===void 0?void 0:t}const a1=Math.PI;function Lc(e){return e*a1/180}const _c=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),jc=(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}},Nc=(e,t,n)=>Math.min(e,t-2*n),Bc=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Gi=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),d.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},l1=e=>{const t=e.fgColor??"currentColor";return d.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},s1=new RegExp("^[^A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF]*[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]");function Yi(e){return s1.test(e)?"rtl":"not-rtl"}let ri;function Ki(){if(typeof document>"u")return 0;if(ri!==void 0)return ri;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(),ri=n-r,ri}const Tr=Symbol();function c1(e){const t=d.useRef([Tr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,r]=d.useState(e),[,o]=d.useState(),i=d.useCallback(a=>{const s=t.current[0];s!==Tr&&(a=typeof a=="function"?a(s):a)===s||(s!==Tr&&o({}),r(c=>typeof a=="function"?a(s===Tr?c:s):a),t.current[0]=Tr)},[]),l=d.useCallback(()=>{t.current[0]=Tr,o({})},[]);return[t.current[0]===Tr?n:t.current[0],i,l]}function Wc(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(", ")}const u1=e=>{const{urls:t,canWrite:n,onEditClick:r,renderImage:o}=e,i=t.filter(a=>a!=="");if(i.length===0)return null;const l=i.length>1;return d.createElement(e1,{"data-testid":"GDG-default-image-overlay-editor"},d.createElement(o1.Carousel,{showArrows:l,showThumbs:!1,swipeable:l,emulateTouch:l,infiniteLoop:l},i.map(a=>{const s=(o==null?void 0:o(a))??d.createElement("img",{draggable:!1,src:a});return d.createElement("div",{className:"gdg-centering-container",key:a},s)})),n&&r&&d.createElement("button",{className:"gdg-edit-icon",onClick:r},d.createElement(Gi,null)))},d1=Cn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class h1 extends $t.PureComponent{constructor(){super(...arguments);ft(this,"targetElement",null);ft(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:r}=this;if(n===null)return;const{contents:o,createNode:i}=r,l=Np(o),a=document.createRange();a.selectNodeContents(n),a.deleteContents();let s=i==null?void 0:i(l);if(s===void 0){const h=document.createElement("template");h.innerHTML=l,s=h.content}n.append(s);const c=n.getElementsByTagName("a");for(const h of c)h.target="_blank",h.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),$t.createElement(d1,{ref:this.containerRefHook})}}const f1=Cn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),g1=Cn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),p1=Cn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let $c=0;const oi=e=>{const{placeholder:t,value:n,onKeyDown:r,highlight:o,altNewline:i,validatedSelection:l,...a}=e,{onChange:s,className:c}=a,h=d.useRef(null),C=n??"";Rn(s!==void 0,"GrowingEntry must be a controlled input area");const[y]=d.useState(()=>"input-box-"+($c=($c+1)%1e7));d.useEffect(()=>{const w=h.current;if(w===null||w.disabled)return;const v=C.toString().length;w.focus(),w.setSelectionRange(o?0:v,v)},[]),d.useLayoutEffect(()=>{var w;if(l!==void 0){const v=typeof l=="number"?[l,null]:l;(w=h.current)==null||w.setSelectionRange(v[0],v[1])}},[l]);const p=d.useCallback(w=>{w.key==="Enter"&&w.shiftKey&&i===!0||(r==null||r(w))},[i,r]);return d.createElement(p1,{className:"gdg-growing-entry"},d.createElement(g1,{className:c},C+`
3
+ `),d.createElement(f1,{...a,className:(c??"")+" gdg-input",id:y,ref:h,onKeyDown:p,value:C,placeholder:t,dir:"auto"}))},Vi={};let hr=null;function Ui(e){const t=e.toLowerCase().trim();if(Vi[t]!==void 0)return Vi[t];hr=hr||function(){const i=document.createElement("div");return i.style.opacity="0",i.style.pointerEvents="none",i.style.position="fixed",document.body.append(i),i}(),hr.style.color="#000",hr.style.color=t;const n=getComputedStyle(hr).color;hr.style.color="#fff",hr.style.color=t;const r=getComputedStyle(hr).color;if(r!==n)return[0,0,0,1];let o=r.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return o.length<4&&o.push(1),o=o.map(i=>Number.isNaN(i)?0:i),Vi[t]=o,o}function Hr(e,t){const[n,r,o]=Ui(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Xc=new Map;function Gc(e,t){const n=`${e}-${t}`,r=Xc.get(n);if(r!==void 0)return r;const o=In(e,t);return Xc.set(n,o),o}function In(e,t){if(t===void 0)return e;const[n,r,o,i]=Ui(e);if(i===1)return e;const[l,a,s,c]=Ui(t),h=i+c*(1-i);return`rgba(${(i*n+c*l*(1-i))/h}, ${(i*r+c*a*(1-i))/h}, ${(i*o+c*s*(1-i))/h}, ${h})`}var Xr=new Map,Gr=new Map,qi=new Map;function po(e,t,n,r){var o,i;let l=Gr.get(n);if(r&&l!==void 0&&l.count>2e4){let c=qi.get(n);if(c===void 0&&(c=function(C,y){var p;let w=new Map,v=0;for(let x of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let I=C.measureText(x).width;w.set(x,I),v+=I}let E=v/w.size,g=(y/E+3)/4,b=w.keys();for(let x of b)w.set(x,((p=w.get(x))!=null?p:E)*g);return w}(e,l.size),qi.set(n,c)),l.count>5e5){let C=0;for(let y of t)C+=(o=c.get(y))!=null?o:l.size;return 1.01*C}let h=e.measureText(t);return function(C,y,p,w,v){var E,g,b;let x=0,I={};for(let S of C)x+=(E=p.get(S))!=null?E:v,I[S]=((g=I[S])!=null?g:0)+1;let m=y-x;for(let S of Object.keys(I)){let R=I[S],H=(b=p.get(S))!=null?b:v,f=H+m*(H*R/x)*w/R;p.set(S,f)}}(t,h.width,c,Math.max(.05,1-l.count/2e5),l.size),Gr.set(n,{count:l.count+t.length,size:l.size}),h.width}let a=e.measureText(t),s=a.width/t.length;if(((i=l==null?void 0:l.count)!=null?i:0)>2e4)return a.width;if(l===void 0)Gr.set(n,{count:t.length,size:s});else{let c=s-l.size,h=t.length/(l.count+t.length),C=l.size+c*h;Gr.set(n,{count:l.count+t.length,size:C})}return a.width}function m1(e,t,n,r,o,i,l,a){if(t.length<=1)return t.length;if(o<n)return-1;let s=Math.floor(n/o*i),c=po(e,t.slice(0,Math.max(0,s)),r,l);if(c!==n)if(c<n){for(;c<n;)s++,c=po(e,t.slice(0,Math.max(0,s)),r,l);s--}else for(;c>n;){let h=t.lastIndexOf(" ",s-1);h>0?s=h:s--,c=po(e,t.slice(0,Math.max(0,s)),r,l)}if(t[s]!==" "){let h=0;h=t.lastIndexOf(" ",s),h>0&&(s=h)}return s}function mo(e,t){return(e??"")===(t??"")}function Yc(e,t){const[n,r]=e;return n>=t.x&&n<t.x+t.width&&r>=t.y&&r<t.y+t.height}function vo(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Kc(e){return[e.x+e.width-1,e.y+e.height-1]}function Vc(e,t,n){const r=n.x,o=n.x+n.width-1,i=n.y,l=n.y+n.height-1,[a,s]=e;if(s<i||s>l)return!1;if(t.span===void 0)return a>=r&&a<=o;const[c,h]=t.span;return c>=r&&c<=o||h>=r&&c<=o||c<r&&h>o}function Uc(e,t){let n=e;if(t!==void 0){let r=[...e];const o=n[t.src];t.src>t.dest?(r.splice(t.src,1),r.splice(t.dest,0,o)):(r.splice(t.dest+1,0,o),r.splice(t.src,1)),r=r.map((i,l)=>({...i,sticky:e[l].sticky})),n=r}return n}function Yr(e,t){let n=0;const r=Uc(e,t);for(let o=0;o<r.length;o++){const i=r[o];if(!i.sticky)break;n+=i.width}return n}function Or(e,t,n){if(typeof n=="number")return t*n;{let r=0;for(let o=e-t;o<e;o++)r+=n(o);return r}}function Ji(e,t,n,r,o){const i=Uc(e,r),l=[];for(const c of i){if(!c.sticky)break;l.push(c)}if(l.length>0)for(const c of l)n-=c.width;let a=t,s=o??0;for(;s<=n&&a<i.length;)s+=i[a].width,a++;for(let c=t;c<a;c++){const h=i[c];h.sticky||l.push(h)}return l}let ii=0,wo={};const v1=typeof window>"u";function qc(e,t,n,r){return`${e}_${r??(t==null?void 0:t.font)}_${n}`}function Kr(e,t,n,r="middle"){const o=qc(e,t,r,n);let i=wo[o];return i===void 0&&(i=t.measureText(e),wo[o]=i,ii++),ii>1e4&&(wo={},ii=0),i}function Jc(e,t){const n=qc(e,void 0,"middle",t);return wo[n]}function fr(e,t){return typeof t!="string"&&(t=t.baseFontFull),function(n,r){for(const a of Zc)if(a.key===r)return a.val;const o=Qc(n,"alphabetic"),i=Qc(n,"middle"),l=-(i.actualBoundingBoxDescent-o.actualBoundingBoxDescent)+o.actualBoundingBoxAscent/2;return Zc.push({key:r,val:l}),l}(e,t)}function Qc(e,t){e.save(),e.textBaseline=t;const n=e.measureText("ABCDEFGHIJKLMNOPQRSTUVWXYZ");return e.restore(),n}(async function(){var e;v1||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ii=0,wo={},Xr.clear(),qi.clear(),Gr.clear())})();const Zc=[];function yo(e,t,n){const{ctx:r,theme:o}=e,i=t??{},l=n??o.textDark;return l!==i.fillStyle&&(r.fillStyle=l,i.fillStyle=l),i}function eu(e,t,n,r,o,i,l,a,s){s==="right"?e.fillText(t,n+o-(a.cellHorizontalPadding+.5),r+i/2+l):s==="center"?e.fillText(t,n+o/2,r+i/2+l):e.fillText(t,n+a.cellHorizontalPadding+.5,r+i/2+l)}function tu(e,t){const n=Kr("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function w1(e,t,n,r,o,i,l,a,s,c){const h=a.baseFontFull,C=function(b,x,I,m,S){let R=`${x}_${I}_${m}px`,H=Xr.get(R);if(H!==void 0)return H;if(m<=0)return[];let f=[],B=x.split(`
4
+ `),D=Gr.get(I),O=D===void 0?x.length:m/D.size*1.5,T=S&&D!==void 0&&D.count>2e4;for(let j of B){let U=po(b,j.slice(0,Math.max(0,O)),I,T),te=Math.min(j.length,O);if(U<=m)f.push(j);else{for(;U>m;){let J=m1(b,j,m,I,U,te,T),ce=j.slice(0,Math.max(0,J));j=j.slice(ce.length),f.push(ce),U=po(b,j.slice(0,Math.max(0,O)),I,T),te=Math.min(j.length,O)}U>0&&f.push(j)}}return f=f.map((j,U)=>U===0?j.trimEnd():j.trim()),Xr.set(R,f),Xr.size>500&&Xr.delete(Xr.keys().next().value),f}(e,t,h,o-2*a.cellHorizontalPadding,c??!1),y=tu(e,h),p=a.lineHeight*y,w=y+p*(C.length-1),v=w+a.cellVerticalPadding>i;v&&(e.save(),e.rect(n,r,o,i),e.clip());const E=r+i/2-w/2;let g=Math.max(r+a.cellVerticalPadding,E);for(const b of C)if(eu(e,b,n,g,o,y,l,a,s),g+=p,g>r+i)break;v&&e.restore()}function Jn(e,t,n,r,o){const{ctx:i,rect:l,theme:a}=e,{x:s,y:c,width:h,height:C}=l;(r=r??!1)||(t=function(w,v){w.includes(`
5
+ `)&&(w=w.split(/\r?\n/,1)[0]);const E=v/4;return w.length>E&&(w=w.slice(0,E)),w}(t,h));const y=fr(i,a),p=Yi(t)==="rtl";if(n===void 0&&p&&(n="right"),p&&(i.direction="rtl"),t.length>0){let w=!1;n==="right"?(i.textAlign="right",w=!0):n!==void 0&&n!=="left"&&(i.textAlign=n,w=!0),r?w1(i,t,s,c,h,C,y,a,n,o):eu(i,t,s,c,h,C,y,a,n),w&&(i.textAlign="start"),p&&(i.direction="inherit")}}function Yn(e,t,n,r,o,i){typeof i=="number"&&(i={tl:i,tr:i,br:i,bl:i}),i={tl:Math.max(0,Math.min(i.tl,o/2,r/2)),tr:Math.max(0,Math.min(i.tr,o/2,r/2)),bl:Math.max(0,Math.min(i.bl,o/2,r/2)),br:Math.max(0,Math.min(i.br,o/2,r/2))},e.moveTo(t+i.tl,n),e.arcTo(t+r,n,t+r,n+i.tr,i.tr),e.arcTo(t+r,n+o,t+r-i.br,n+o,i.br),e.arcTo(t,n+o,t,n+o-i.bl,i.bl),e.arcTo(t,n,t+i.tl,n,i.tl)}function Qi(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w){const v={x:0,y:i+c,width:0,height:0};if(e>=p.length||t>=h||t<-2||e<0)return v;const E=i-o;if(e>=C){const g=l>e?-1:1,b=Yr(p);v.x+=b+s;for(let x=l;x!==e;x+=g)v.x+=p[g===1?x:x-1].width*g}else for(let g=0;g<e;g++)v.x+=p[g].width;if(v.width=p[e].width+1,t===-1)v.y=o,v.height=E;else if(t===-2){v.y=0,v.height=o;let g=e;const b=p[e].group,x=p[e].sticky;for(;g>0&&mo(p[g-1].group,b)&&p[g-1].sticky===x;){const m=p[g-1];v.x-=m.width,v.width+=m.width,g--}let I=e;for(;I+1<p.length&&mo(p[I+1].group,b)&&p[I+1].sticky===x;){const m=p[I+1];v.width+=m.width,I++}if(!x){const m=Yr(p),S=v.x-m;S<0&&(v.x-=S,v.width+=S),v.x+v.width>n&&(v.width=n-v.x)}}else if(t>=h-y){let g=h-t;for(v.y=r;g>0;){const b=t+g-1;v.height=typeof w=="number"?w:w(b),v.y-=v.height,g--}v.height+=1}else{const g=a>t?-1:1;if(typeof w=="number"){const b=t-a;v.y+=b*w}else for(let b=a;b!==t;b+=g)v.y+=w(b)*g;v.height=(typeof w=="number"?w:w(t))+1}return v}const Zi=1<<21;function Ln(e,t){return(t+2)*Zi+e}function nu(e){return e%Zi}function ea(e){return Math.floor(e/Zi)-2}function ta(e){return[nu(e),ea(e)]}class ru{constructor(){ft(this,"visibleWindow",{x:0,y:0,width:0,height:0});ft(this,"freezeCols",0);ft(this,"freezeRows",[]);ft(this,"isInWindow",t=>{const n=nu(t),r=ea(t),o=this.visibleWindow,i=n>=o.x&&n<=o.x+o.width||n<this.freezeCols,l=r>=o.y&&r<=o.y+o.height||this.freezeRows.includes(r);return i&&l})}setWindow(t,n,r){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&$r(this.freezeRows,r)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=r,this.clearOutOfWindow())}}class y1 extends ru{constructor(){super(...arguments);ft(this,"cache",new Map);ft(this,"setValue",(n,r)=>{this.cache.set(Ln(n[0],n[1]),r)});ft(this,"getValue",n=>this.cache.get(Ln(n[0],n[1])));ft(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class bo{constructor(t=[]){ft(this,"cells");this.cells=new Set(t.map(n=>Ln(n[0],n[1])))}add(t){this.cells.add(Ln(t[0],t[1]))}has(t){return t!==void 0&&this.cells.has(Ln(t[0],t[1]))}remove(t){this.cells.delete(Ln(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(ea(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let r=t.x;r<t.x+t.width;r++)if(this.cells.has(Ln(r,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield ta(t)}}Xa=function(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-bg-group-header":e.bgGroupHeader??e.bgHeader,"--gdg-bg-group-header-hovered":e.bgGroupHeaderHovered??e.bgHeaderHovered,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bubble-height":`${e.bubbleHeight}px`,"--gdg-bubble-padding":`${e.bubblePadding}px`,"--gdg-bubble-margin":`${e.bubbleMargin}px`,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,"--gdg-checkbox-max-size":`${e.checkboxMaxSize}px`,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}};const ou={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bubbleHeight:20,bubblePadding:6,bubbleMargin:4,bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4,checkboxMaxSize:18};function iu(){return ou}Wa=$t.createContext(ou);function Qn(e,...t){const n={...e};for(const r of t)if(r!==void 0)for(const o in r)r.hasOwnProperty(o)&&(n[o]=o==="bgCell"?In(r[o],n[o]):r[o]);return n.headerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.headerFontStyle===n.headerFontStyle||(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),n.baseFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.baseFontStyle===n.baseFontStyle||(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),n.markerFontFull!==void 0&&e.fontFamily===n.fontFamily&&e.markerFontStyle===n.markerFontStyle||(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}function au(e,t,n,r,o,i,l,a,s){let c=0;const h=o===void 0?[]:o.map(p=>{const w=function(v,E,g,b){var I;const x=b(E);return((I=x==null?void 0:x.measure)==null?void 0:I.call(x,v,E,g))??150}(e,p[r],t,s);return c=Math.max(c,w),w});if(h.length>5&&a){c=0;let p=0;for(const v of h)p+=v;const w=p/h.length;for(let v=0;v<h.length;v++)h[v]>=2*w?h[v]=0:c=Math.max(c,h[v])}const C=e.font;e.font=t.headerFontFull,c=Math.max(c,e.measureText(n.title).width+2*t.cellHorizontalPadding+(n.icon===void 0?0:28)),e.font=C;const y=Math.max(Math.ceil(i),Math.min(Math.floor(l),Math.ceil(c)));return{...n,width:y}}var lu,su,cu,uu;const On=Sr(function(){if(uu)return cu;uu=1;var e=su?lu:(su=1,lu=function(n,r,o){return n==n&&(o!==void 0&&(n=n<=o?n:o),r!==void 0&&(n=n>=r?n:r)),n}),t=Xi();return cu=function(n,r,o){return o===void 0&&(o=r,r=void 0),o!==void 0&&(o=(o=t(o))==o?o:0),r!==void 0&&(r=(r=t(r))==r?r:0),e(t(n),r,o)}}());var du,hu,fu,gu,pu,mu,vu,wu,yu,bu,xu,Cu,Su,ku,Mu,Ru,Eu,Iu,na,Tu,Hu,Ou,Pu,Du,zu,Au,Fu,Lu,_u,ju,Nu,Bu;function Wu(){if(mu)return pu;mu=1;var e=Fi(),t=hu?du:(hu=1,du=function(o){return this.__data__.set(o,"__lodash_hash_undefined__"),this}),n=gu?fu:(gu=1,fu=function(o){return this.__data__.has(o)});function r(o){var i=-1,l=o==null?0:o.length;for(this.__data__=new e;++i<l;)this.add(o[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,pu=r}function b1(){if(ku)return Su;ku=1;var e=wu?vu:(wu=1,vu=function(r,o,i,l){for(var a=r.length,s=i+(l?1:-1);l?s--:++s<a;)if(o(r[s],s,r))return s;return-1}),t=bu?yu:(bu=1,yu=function(r){return r!=r}),n=Cu?xu:(Cu=1,xu=function(r,o,i){for(var l=i-1,a=r.length;++l<a;)if(r[l]===o)return l;return-1});return Su=function(r,o,i){return o==o?n(r,o,i):e(r,t,i)}}function $u(){return Tu||(Tu=1,na=function(e,t){return e.has(t)}),na}function Xu(){if(Ou)return Hu;Ou=1;var e=Ir()(Gn(),"Set");return Hu=e}function ra(){return Au?zu:(Au=1,zu=function(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n})}function x1(){if(Lu)return Fu;Lu=1;var e=Xu(),t=Du?Pu:(Du=1,Pu=function(){}),n=ra(),r=e&&1/n(new e([,-0]))[1]==1/0?function(o){return new e(o)}:t;return Fu=r}function C1(){if(ju)return _u;ju=1;var e=Wu(),t=function(){if(Ru)return Mu;Ru=1;var l=b1();return Mu=function(a,s){return!(a==null||!a.length)&&l(a,s,0)>-1}}(),n=Iu?Eu:(Iu=1,Eu=function(l,a,s){for(var c=-1,h=l==null?0:l.length;++c<h;)if(s(a,l[c]))return!0;return!1}),r=$u(),o=x1(),i=ra();return _u=function(l,a,s){var c=-1,h=t,C=l.length,y=!0,p=[],w=p;if(s)y=!1,h=n;else if(C>=200){var v=a?null:o(l);if(v)return i(v);y=!1,h=r,w=new e}else w=a?[]:p;e:for(;++c<C;){var E=l[c],g=a?a(E):E;if(E=s||E!==0?E:0,y&&g==g){for(var b=w.length;b--;)if(w[b]===g)continue e;a&&w.push(g),p.push(E)}else h(w,g,s)||(w!==p&&w.push(g),p.push(E))}return p}}const S1=Sr(function(){if(Bu)return Nu;Bu=1;var e=C1();return Nu=function(t){return t&&t.length?e(t):[]}}());var Gu,Yu,Ku,Vu,oa,Uu,qu,Ju;function Qu(){return Yu?Gu:(Yu=1,Gu=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e})}function k1(){if(Uu)return oa;Uu=1;var e=Qu(),t=function(){if(Vu)return Ku;Vu=1;var n=oo(),r=Li(),o=Xn(),i=n?n.isConcatSpreadable:void 0;return Ku=function(l){return o(l)||r(l)||!!(i&&l&&l[i])}}();return oa=function n(r,o,i,l,a){var s=-1,c=r.length;for(i||(i=t),a||(a=[]);++s<c;){var h=r[s];o>0&&i(h)?o>1?n(h,o-1,i,l,a):e(a,h):l||(a[a.length]=h)}return a},oa}const Zu=Sr(function(){if(Ju)return qu;Ju=1;var e=k1();return qu=function(t){return t!=null&&t.length?e(t,1):[]}}());var ed,td,nd,rd,od,id,ad,ld,sd,cd,ud,dd;function ia(){if(rd)return nd;rd=1;var e=Ks(),t=ji();return nd=function(n){return n!=null&&t(n.length)&&!e(n)}}function M1(){if(cd)return sd;cd=1;var e=function(){if(td)return ed;td=1;var r=Math.ceil,o=Math.max;return ed=function(i,l,a,s){for(var c=-1,h=o(r((l-i)/(a||1)),0),C=Array(h);h--;)C[s?h:++c]=i,i+=a;return C}}(),t=function(){if(id)return od;id=1;var r=zi(),o=ia(),i=_i(),l=Er();return od=function(a,s,c){if(!l(c))return!1;var h=typeof s;return!!(h=="number"?o(c)&&i(s,c.length):h=="string"&&s in c)&&r(c[s],a)}}(),n=function(){if(ld)return ad;ld=1;var r=Xi(),o=1/0;return ad=function(i){return i?(i=r(i))===o||i===-1/0?17976931348623157e292*(i<0?-1:1):i==i?i:0:i===0?i:0}}();return sd=function(r){return function(o,i,l){return l&&typeof l!="number"&&t(o,i,l)&&(i=l=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),l=l===void 0?o<i?1:-1:n(l),e(o,i,l,r)}}}var R1=function(){if(dd)return ud;dd=1;var e=M1()();return ud=e}();const Pr=Sr(R1),Pt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',hd=e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
6
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
9
+ </svg>
10
+ `},E1={headerRowID:e=>{const t=e.fgColor,n=e.bgColor;return`
11
+ ${Pt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},headerNumber:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
12
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
13
+ <path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
14
+ </svg>`},headerCode:e=>{const t=e.fgColor,n=e.bgColor;return`
15
+ ${Pt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},headerString:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
16
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
17
+ <path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
18
+ </svg>`},headerBoolean:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
19
+ <path
20
+ d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
21
+ fill="${n}"
22
+ />
23
+ <path
24
+ fill-rule="evenodd"
25
+ clip-rule="evenodd"
26
+ d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
27
+ fill="${t}"
28
+ />
29
+ </svg>`},headerAudioUri:hd,headerVideoUri:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
30
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
31
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
32
+ </svg>`},headerEmoji:e=>{const t=e.fgColor,n=e.bgColor;return`
33
+ ${Pt}
34
+ <path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
35
+ <path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
36
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
37
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
38
+ <path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
39
+ <path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
40
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
41
+ </svg>`},headerImage:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
42
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
43
+ <path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
44
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
45
+ </svg>`},headerUri:hd,headerPhone:e=>{const t=e.fgColor,n=e.bgColor;return`
46
+ ${Pt}
47
+ <path fill="${t}" d="M3 3h14v14H3z"/>
48
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
49
+ </svg>`},headerMarkdown:e=>{const t=e.fgColor,n=e.bgColor;return`
50
+ ${Pt}
51
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
52
+ <path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
53
+ </svg>`},headerDate:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
54
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
55
+ <path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
56
+ </svg>`},headerTime:e=>{const t=e.fgColor,n=e.bgColor;return`
57
+ ${Pt}
58
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
59
+ <path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
60
+ <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
61
+ </svg>`},headerEmail:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
62
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
63
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
64
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
65
+ </svg>`},headerReference:e=>{const t=e.fgColor,n=e.bgColor;return`
66
+ ${Pt}
67
+ <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
68
+ <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
69
+ <path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
70
+ </svg>`},headerIfThenElse:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
71
+ <path fill="${t}" d="M4 3h12v14H4z"/>
72
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
73
+ </svg>`},headerSingleValue:e=>{const t=e.fgColor,n=e.bgColor;return`
74
+ ${Pt}
75
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
76
+ <path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
77
+ </svg>`},headerLookup:e=>{const t=e.fgColor,n=e.bgColor;return`
78
+ ${Pt}
79
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
80
+ <path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
81
+ </svg>`},headerTextTemplate:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
82
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
83
+ <path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
84
+ </svg>`},headerMath:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
85
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
86
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
87
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
88
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
89
+ <path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
90
+ </svg>`},headerRollup:e=>{const t=e.fgColor,n=e.bgColor;return`
91
+ ${Pt}
92
+ <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
93
+ <path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
94
+ </svg>`},headerJoinStrings:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
95
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
96
+ <path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
97
+ </svg>`},headerSplitString:e=>{const t=e.fgColor,n=e.bgColor;return`
98
+ ${Pt}
99
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
100
+ <path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
101
+ </svg>`},headerGeoDistance:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
102
+ <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
103
+ <path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
104
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
105
+ </svg>`},headerArray:e=>{const t=e.fgColor,n=e.bgColor;return`${Pt}
106
+ <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
107
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
108
+ </svg>`},rowOwnerOverlay:e=>{const t=e.fgColor;return`
109
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
110
+ <path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
111
+ </svg>`},protectedColumnOverlay:e=>{const t=e.fgColor;return`
112
+ <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
113
+ <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
114
+ </svg>
115
+ `},renameIcon:e=>{const t=e.bgColor;return`${Pt}
116
+ <path stroke="${t}" stroke-width="2" d="M12 3v14"/>
117
+ <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
118
+ <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
119
+ </svg>
120
+ `}};class I1{constructor(t,n){ft(this,"onSettled");ft(this,"spriteMap",new Map);ft(this,"headerIcons");ft(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,r,o,i,l,a,s=1){const[c,h]=function(w,v){return w==="normal"?[v.bgIconHeader,v.fgIconHeader]:w==="selected"?["white",v.accentColor]:[v.accentColor,v.bgHeader]}(n,a),C=l*Math.ceil(window.devicePixelRatio),y=`${c}_${h}_${C}_${t}`;let p=this.spriteMap.get(y);if(p===void 0){const w=this.headerIcons[t];if(w===void 0)return;p=document.createElement("canvas");const v=p.getContext("2d");if(v===null)return;const E=new Image;E.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w({fgColor:h,bgColor:c}))}`,this.spriteMap.set(y,p);const g=E.decode();if(g===void 0)return;this.inFlight++,g.then(()=>{v.drawImage(E,0,0,C,C)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else s<1&&(r.globalAlpha=s),r.drawImage(p,0,0,C,C,o,i,l,l),s<1&&(r.globalAlpha=1)}}function fd(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function ai(e,t,n,r,o,i,l,a,s){a=a??t;let c=t,h=e;const C=r-i;let y=!1;for(;c<n&&h<C;){const p=o(h);if(c+p>a&&s(c,h,p,!1,l&&h===r-1)===!0){y=!0;break}c+=p,h++}if(!y){c=n;for(let p=0;p<i;p++){h=r-1-p;const w=o(h);c-=w,s(c,h,w,!0,l&&h===r-1)}}}function gr(e,t,n,r,o,i){let l=0,a=0;const s=o+r;for(const c of e){if(i(c,c.sticky?a:l+n,s,c.sticky?0:a,t)===!0)break;l+=c.width,a+=c.sticky?c.width:0}}function gd(e,t,n,r,o){let i=0,l=0;for(let a=0;a<e.length;a++){const s=e[a];let c=a+1,h=s.width;for(s.sticky&&(l+=h);c<e.length&&mo(e[c].group,s.group)&&e[c].sticky===e[a].sticky;){const w=e[c];h+=w.width,c++,a++,w.sticky&&(l+=w.width)}const C=i+(s.sticky?0:n),y=s.sticky?0:Math.max(0,l-C),p=Math.min(h-y,t-(C+y));o([s.sourceIndex,e[c-1].sourceIndex],s.group??"",C+y,0,p,r),i+=h}}function pd(e,t,n,r,o,i,l){var y;const[a,s]=e;let c,h;const C=((y=l.find(p=>!p.sticky))==null?void 0:y.sourceIndex)??0;if(s>C){const p=Math.max(a,C);let w=t,v=r;for(let E=i.sourceIndex-1;E>=p;E--)w-=l[E].width,v+=l[E].width;for(let E=i.sourceIndex+1;E<=s;E++)v+=l[E].width;h={x:w,y:n,width:v,height:o}}if(C>a){const p=Math.min(s,C-1);let w=t,v=r;for(let E=i.sourceIndex-1;E>=a;E--)w-=l[E].width,v+=l[E].width;for(let E=i.sourceIndex+1;E<=p;E++)v+=l[E].width;c={x:w,y:n,width:v,height:o}}return[c,h]}function xo(e,t,n,r,o,i,l,a){return e<=o+l&&o<=e+n&&t<=i+a&&i<=t+r}function Dr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function md(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function T1(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function H1(e,t,n,r){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const o=t+4,i=n+4,l=-4-e.x,a=e.x+e.width-o,s=-4-e.y,c=e.y+e.height-i,h=l>0?e.x+Math.floor(l/r)*r:e.x,C=a>0?e.x+e.width-Math.floor(a/r)*r:e.x+e.width,y=s>0?e.y+Math.floor(s/r)*r:e.y;return{x:h,y,width:C-h,height:(c>0?e.y+e.height-Math.floor(c/r)*r:e.y+e.height)-y}}const O1={kind:pe.Loading,allowOverlay:!1};function vd(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v,E,g,b,x,I,m,S,R,H,f,B,D,O,T,j,U,te,J,ce){let se=(x==null?void 0:x.size)??Number.MAX_SAFE_INTEGER;const q=performance.now();let Z=T.baseFontFull;e.font=Z;const fe={ctx:e},N=[0,0],K=E>0?Or(s,E,c):0;let ne,X;const Q=fd(b);return gr(t,a,i,l,o,(ae,he,ze,$e,Ze)=>{const He=Math.max(0,$e-he),We=he+He,me=o+1,ye=ae.width-He,Me=r-o-1;if(b.length>0){let nt=!1;for(let Ke=0;Ke<b.length;Ke++){const ct=b[Ke];if(xo(We,me,ye,Me,ct.x,ct.y,ct.width,ct.height)){nt=!0;break}}if(!nt)return}const Se=()=>{e.save(),e.beginPath(),e.rect(We,me,ye,Me),e.clip()},ee=I.columns.hasIndex(ae.sourceIndex),Pe=C(ae.group??"").overrideTheme,ke=ae.themeOverride===void 0&&Pe===void 0?T:Qn(T,Pe,ae.themeOverride),Ge=ke.baseFontFull;let Re;return Ge!==Z&&(Z=Ge,e.font=Ge),Se(),ai(Ze,ze,r,s,c,E,g,Q,(nt,Ke,ct,Ee,Ae)=>{var wt,st,xt;if(Ke<0||(N[0]=ae.sourceIndex,N[1]=Ke,x!==void 0&&!x.has(N)))return;if(b.length>0){let ve=!1;for(let Ve=0;Ve<b.length;Ve++){const Ye=b[Ve];if(xo(he,nt,ae.width,ct,Ye.x,Ye.y,Ye.width,Ye.height)){ve=!0;break}}if(!ve)return}const ut=I.rows.hasIndex(Ke),dt=p.hasIndex(Ke),pt=Ke<s?h(N):O1;let Ft=he,bt=ae.width,Je=!1,Yt=!1;if(pt.span!==void 0){const[ve,Ve]=pt.span,Ye=`${Ke},${ve},${Ve},${ae.sticky}`;if(X===void 0&&(X=new Set),X.has(Ye))return void se--;{const mt=pd(pt.span,he,nt,ae.width,ct,ae,n),rt=ae.sticky?mt[0]:mt[1];if(ae.sticky||mt[0]===void 0||(Yt=!0),rt!==void 0){Ft=rt.x,bt=rt.width,X.add(Ye),e.restore(),Re=void 0,e.save(),e.beginPath();const ot=Math.max(0,$e-rt.x);e.rect(rt.x+ot,nt,rt.width-ot,ct),ne===void 0&&(ne=[]),ne.push({x:rt.x+ot,y:nt,width:rt.width-ot,height:ct}),e.clip(),Je=!0}}}const nn=y==null?void 0:y(Ke),Kt=Ae&&((wt=ae.trailingRowOptions)==null?void 0:wt.themeOverride)!==void 0?(st=ae.trailingRowOptions)==null?void 0:st.themeOverride:void 0,qt=pt.themeOverride===void 0&&nn===void 0&&Kt===void 0?ke:Qn(ke,nn,Kt,pt.themeOverride);e.beginPath();const un=function(ve,Ve,Ye){return Ye.current!==void 0&&ve[1]===Ye.current.cell[1]&&(Ve.span===void 0?Ye.current.cell[0]===ve[0]:Ye.current.cell[0]>=Ve.span[0]&&Ye.current.cell[0]<=Ve.span[1])}(N,pt,I);let jt=function(ve,Ve,Ye,mt){let rt=0;if(Ye.current===void 0)return rt;const ot=Ye.current.range;(mt||ot.height*ot.width>1)&&Vc(ve,Ve,ot)&&rt++;for(const vt of Ye.current.rangeStack)Vc(ve,Ve,vt)&&rt++;return rt}(N,pt,I,v);const Kn=pt.span!==void 0&&I.columns.some(ve=>pt.span!==void 0&&ve>=pt.span[0]&&ve<=pt.span[1]);un&&!w&&v?jt=0:un&&v&&(jt=Math.max(jt,1)),Kn&&jt++,un||(ut&&jt++,ee&&!Ae&&jt++);const vr=pt.kind===pe.Protected?qt.bgCellMedium:qt.bgCell;let Dt;if((Ee||vr!==T.bgCell)&&(Dt=In(vr,Dt)),jt>0||dt){dt&&(Dt=In(qt.bgHeader,Dt));for(let ve=0;ve<jt;ve++)Dt=In(qt.accentLight,Dt)}else if(m!==void 0){for(const ve of m)if(ve[0]===ae.sourceIndex&&ve[1]===Ke){Dt=In(qt.bgSearchResult,Dt);break}}if(S!==void 0)for(let ve=0;ve<S.length;ve++){const Ve=S[ve],Ye=Ve.range;Ve.style!=="solid-outline"&&Ye.x<=ae.sourceIndex&&ae.sourceIndex<Ye.x+Ye.width&&Ye.y<=Ke&&Ke<Ye.y+Ye.height&&(Dt=In(Ve.color,Dt))}let er=!1;if(x!==void 0){const ve=nt+1,Ve=(Ee?ve+ct-1:Math.min(ve+ct-1,r-K))-ve;(Ve!==ct-1||Ft+1<=$e)&&(er=!0,e.save(),e.beginPath(),e.rect(Ft+1,ve,bt-1,Ve),e.clip()),Dt=Dt===void 0?qt.bgCell:In(Dt,qt.bgCell)}const _n=ae.sourceIndex===n.length-1,re=Ke===s-1;let be;Dt!==void 0&&(e.fillStyle=Dt,Re!==void 0&&(Re.fillStyle=Dt),x!==void 0?e.fillRect(Ft+1,nt+1,bt-(_n?2:1),ct-(re?2:1)):e.fillRect(Ft,nt,bt,ct)),pt.style==="faded"&&(e.globalAlpha=.6);for(let ve=0;ve<f.length;ve++){const Ve=f[ve];if(Ve.item[0]===ae.sourceIndex&&Ve.item[1]===Ke){be=Ve;break}}if(bt>ce&&!Yt){const ve=qt.baseFontFull;ve!==Z&&(e.font=ve,Z=ve),Re=wd(e,pt,ae.sourceIndex,Ke,_n,re,Ft,nt,bt,ct,jt>0,qt,Dt??qt.bgCell,R,H,(be==null?void 0:be.hoverAmount)??0,B,O,q,D,Re,j,U,te,J)}return er&&e.restore(),pt.style==="faded"&&(e.globalAlpha=1),se--,Je&&(e.restore(),(xt=Re==null?void 0:Re.deprep)==null||xt.call(Re,fe),Re=void 0,Se(),Z=Ge,e.font=Ge),se<=0}),e.restore(),se<=0}),ne}const Co=[0,0],So={x:0,y:0,width:0,height:0},aa=[void 0,()=>{}];let la=!1;function P1(){la=!0}function wd(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v,E,g,b,x,I,m,S,R,H){var U,te;let f,B,D;E!==void 0&&E[0][0]===n&&E[0][1]===r&&(f=E[1][0],B=E[1][1]),Co[0]=n,Co[1]=r,So.x=l,So.y=a,So.width=s,So.height=c,aa[0]=S.getValue(Co),aa[1]=J=>S.setValue(Co,J),la=!1;const O={ctx:e,theme:C,col:n,row:r,cell:t,rect:So,highlighted:h,cellFillColor:y,hoverAmount:v,frameTime:b,hoverX:f,drawState:aa,hoverY:B,imageLoader:p,spriteManager:w,hyperWrapping:g,overrideCursor:f!==void 0?H:void 0,requestAnimationFrame:P1},T=function(J,ce,se,q,Z,fe){const{ctx:N,rect:K,theme:ne}=J;let X=Number.MAX_SAFE_INTEGER;if(ce!==void 0&&(X=se-ce,X<500)){const Q=1-X/500;N.globalAlpha=Q,N.fillStyle=ne.bgSearchResult,N.fillRect(K.x+1,K.y+1,K.width-(Z?2:1),K.height-(fe?2:1)),N.globalAlpha=1,q!==void 0&&(q.fillStyle=ne.bgSearchResult)}return X<500}(O,t.lastUpdated,b,I,o,i),j=R(t);if(j!==void 0){(I==null?void 0:I.renderer)!==j&&((U=I==null?void 0:I.deprep)==null||U.call(I,O),I=void 0);const J=(te=j.drawPrep)==null?void 0:te.call(j,O,I);x===void 0||kr(O.cell)?j.draw(O,t):x(O,()=>j.draw(O,t)),D=J===void 0?void 0:{deprep:J==null?void 0:J.deprep,fillStyle:J==null?void 0:J.fillStyle,font:J==null?void 0:J.font,renderer:j}}return(T||la)&&(m==null||m(Co)),D}function sa(e,t,n,r,o,i,l,a,s=-20,c=-20,h=void 0,C="center",y="square"){const p=Math.floor(o+l/2),w=y==="circle"?1e4:t.roundingRadius??4;let v=Nc(h??t.checkboxMaxSize,l,t.cellVerticalPadding),E=v/2;const g=jc(C,r,i,t.cellHorizontalPadding,v),b=_c(g,p,v),x=Bc(r+s,o+c,b);switch(n){case!0:e.beginPath(),Yn(e,g-v/2,p-v/2,v,v,w),y==="circle"&&(E*=.8,v*=.8),e.fillStyle=a?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(g-E+v/4.23,p-E+v/1.97),e.lineTo(g-E+v/2.42,p-E+v/1.44),e.lineTo(g-E+v/1.29,p-E+v/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break;case Qo:case!1:e.beginPath(),Yn(e,g-v/2+.5,p-v/2+.5,v-1,v-1,w),e.lineWidth=1,e.strokeStyle=x?t.textDark:t.textMedium,e.stroke();break;case Ni:e.beginPath(),Yn(e,g-v/2,p-v/2,v,v,w),e.fillStyle=x?t.textMedium:t.textLight,e.fill(),y==="circle"&&(E*=.8,v*=.8),e.beginPath(),e.moveTo(g-v/3,p),e.lineTo(g+v/3,p),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break;default:lo()}}function D1(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v,E,g,b){var f,B,D,O;const x=l+a;if(x<=0)return;e.fillStyle=C.bgHeader,e.fillRect(0,0,o,x);const I=(f=r==null?void 0:r[0])==null?void 0:f[0],m=(B=r==null?void 0:r[0])==null?void 0:B[1],S=(D=r==null?void 0:r[1])==null?void 0:D[0],R=(O=r==null?void 0:r[1])==null?void 0:O[1],H=C.headerFontFull;e.font=H,gr(t,0,i,0,x,(T,j,U,te)=>{var ae;if(E!==void 0&&!E.has([T.sourceIndex,-1]))return;const J=Math.max(0,te-j);e.save(),e.beginPath(),e.rect(j+J,a,T.width-J,l),e.clip();const ce=v(T.group??"").overrideTheme,se=T.themeOverride===void 0&&ce===void 0?C:Qn(C,ce,T.themeOverride);se.bgHeader!==C.bgHeader&&(e.fillStyle=se.bgHeader,e.fill()),se!==C&&(e.font=se.headerFontFull);const q=h.columns.hasIndex(T.sourceIndex),Z=s!==void 0||c||T.headerRowMarkerDisabled===!0,fe=!Z&&m===-1&&I===T.sourceIndex,N=Z?0:((ae=p.find(he=>he.item[0]===T.sourceIndex&&he.item[1]===-1))==null?void 0:ae.hoverAmount)??0,K=(h==null?void 0:h.current)!==void 0&&h.current.cell[0]===T.sourceIndex,ne=q?se.accentColor:K?se.bgHeaderHasFocus:se.bgHeader,X=n?a:0,Q=T.sourceIndex===0?0:1;q?(e.fillStyle=ne,e.fillRect(j+Q,X,T.width-Q,l)):(K||N>0)&&(e.beginPath(),e.rect(j+Q,X,T.width-Q,l),K&&(e.fillStyle=se.bgHeaderHasFocus,e.fill()),N>0&&(e.globalAlpha=N,e.fillStyle=se.bgHeaderHovered,e.fill(),e.globalAlpha=1)),Cd(e,j,X,T.width,l,T,q,se,fe,fe?S:void 0,fe?R:void 0,K,N,y,g,b),e.restore()}),n&&function(T,j,U,te,J,ce,se,q,Z,fe,N,K){const[X,Q]=(ce==null?void 0:ce[0])??[];let ae=0;gd(j,U,te,J,(he,ze,$e,Ze,He,We)=>{if(K!==void 0&&!K.hasItemInRectangle({x:he[0],y:-2,width:he[1]-he[0]+1,height:1}))return;T.save(),T.beginPath(),T.rect($e,Ze,He,We),T.clip();const me=N(ze),ye=(me==null?void 0:me.overrideTheme)===void 0?se:Qn(se,me.overrideTheme),Me=Q===-2&&X!==void 0&&X>=he[0]&&X<=he[1],Se=Me?ye.bgGroupHeaderHovered??ye.bgHeaderHovered:ye.bgGroupHeader??ye.bgHeader;if(Se!==se.bgHeader&&(T.fillStyle=Se,T.fill()),T.fillStyle=ye.textGroupHeader??ye.textHeader,me!==void 0){let ee=$e;if(me.icon!==void 0&&(q.drawSprite(me.icon,"normal",T,ee+8,(J-20)/2,20,ye),ee+=26),T.fillText(me.name,ee+8,J/2+fr(T,se.headerFontFull)),me.actions!==void 0&&Me){const Pe=yd({x:$e,y:Ze,width:He,height:We},me.actions);T.beginPath();const ke=Pe[0].x-10,Ge=$e+He-ke;T.rect(ke,0,Ge,J);const Re=T.createLinearGradient(ke,0,ke+Ge,0),nt=Hr(Se,0);Re.addColorStop(0,nt),Re.addColorStop(10/Ge,Se),Re.addColorStop(1,Se),T.fillStyle=Re,T.fill(),T.globalAlpha=.6;const[Ke,ct]=(ce==null?void 0:ce[1])??[-1,-1];for(let Ee=0;Ee<me.actions.length;Ee++){const Ae=me.actions[Ee],ut=Pe[Ee],dt=Dr(ut,Ke+$e,ct);dt&&(T.globalAlpha=1),q.drawSprite(Ae.icon,"normal",T,ut.x+ut.width/2-10,ut.y+ut.height/2-10,20,ye),dt&&(T.globalAlpha=.6)}T.globalAlpha=1}}$e!==0&&fe(he[0])&&(T.beginPath(),T.moveTo($e+.5,0),T.lineTo($e+.5,J),T.strokeStyle=se.borderColor,T.lineWidth=1,T.stroke()),T.restore(),ae=$e+He}),T.beginPath(),T.moveTo(ae+.5,0),T.lineTo(ae+.5,J),T.moveTo(0,J+.5),T.lineTo(U,J+.5),T.strokeStyle=se.borderColor,T.lineWidth=1,T.stroke()}(e,t,o,i,a,r,C,y,0,w,v,E)}const li=30;function yd(e,t){const n=[];let r=e.x+e.width-26*t.length;const o=e.y+e.height/2-13;for(let i=0;i<t.length;i++)n.push({x:r,y:o,width:26,height:26}),r+=26;return n}function ko(e,t,n){return n&&e!==void 0&&(e.x=t-(e.x-t)-e.width),e}function bd(e,t,n,r,o,i,l,a){var g;const s=l.cellHorizontalPadding,c=l.headerIconSize,h=function(b,x,I,m){return{x:b+I-li,y:Math.max(x,x+m/2-li/2),width:li,height:Math.min(li,m)}}(n,r,o,i);let C=n+s;const y=t.icon===void 0?void 0:{x:C,y:r+(i-c)/2,width:c,height:c},p=y===void 0||t.overlayIcon===void 0?void 0:{x:y.x+9,y:y.y+6,width:18,height:18};y!==void 0&&(C+=Math.ceil(1.3*c));const w={x:C,y:r,width:o-C,height:i};let v;if(t.indicatorIcon!==void 0){const b=e===void 0?((g=Jc(t.title,l.headerFontFull))==null?void 0:g.width)??0:Kr(t.title,e,l.headerFontFull).width;w.width=b,C+=b+s,v={x:C,y:r+(i-c)/2,width:c,height:c}}const E=n+o/2;return{menuBounds:ko(h,E,a),iconBounds:ko(y,E,a),iconOverlayBounds:ko(p,E,a),textBounds:ko(w,E,a),indicatorIconBounds:ko(v,E,a)}}function xd(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v){if(i.rowMarker!==void 0&&i.headerRowMarkerDisabled!==!0){const b=i.rowMarkerChecked;return b!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=C),sa(e,i.headerRowMarkerTheme!==void 0?Qn(a,i.headerRowMarkerTheme):a,b,t,n,r,o,!1,void 0,void 0,a.checkboxMaxSize,"center",i.rowMarker),void(b!==!0&&i.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1))}const E=l?a.textHeaderSelected:a.textHeader,g=i.hasMenu===!0&&(s||p&&l)&&v.menuBounds!==void 0;if(i.icon!==void 0&&v.iconBounds!==void 0){let b=l?"selected":"normal";i.style==="highlight"&&(b=l?"selected":"special"),y.drawSprite(i.icon,b,e,v.iconBounds.x,v.iconBounds.y,v.iconBounds.width,a),i.overlayIcon!==void 0&&v.iconOverlayBounds!==void 0&&y.drawSprite(i.overlayIcon,l?"selected":"special",e,v.iconOverlayBounds.x,v.iconOverlayBounds.y,v.iconOverlayBounds.width,a)}if(g&&r>35){const x=(w?35:r-35)/r,I=(w?.7*35:r-.7*35)/r,m=e.createLinearGradient(t,0,t+r,0),S=Hr(E,0);m.addColorStop(w?1:0,E),m.addColorStop(x,E),m.addColorStop(I,S),m.addColorStop(w?0:1,S),e.fillStyle=m}else e.fillStyle=E;if(w&&(e.textAlign="right"),v.textBounds!==void 0&&e.fillText(i.title,w?v.textBounds.x+v.textBounds.width:v.textBounds.x,n+o/2+fr(e,a.headerFontFull)),w&&(e.textAlign="left"),!(i.indicatorIcon===void 0||v.indicatorIconBounds===void 0||g&&xo(v.menuBounds.x,v.menuBounds.y,v.menuBounds.width,v.menuBounds.height,v.indicatorIconBounds.x,v.indicatorIconBounds.y,v.indicatorIconBounds.width,v.indicatorIconBounds.height))){let b=l?"selected":"normal";i.style==="highlight"&&(b=l?"selected":"special"),y.drawSprite(i.indicatorIcon,b,e,v.indicatorIconBounds.x,v.indicatorIconBounds.y,v.indicatorIconBounds.width,a)}if(g&&v.menuBounds!==void 0){const b=v.menuBounds,x=c!==void 0&&h!==void 0&&Dr(b,c+t,h+n);if(x||(e.globalAlpha=.7),i.menuIcon===void 0||i.menuIcon===Zo.Triangle){e.beginPath();const I=b.x+b.width/2-5.5,m=b.y+b.height/2-3;(function(S,R,H){const f=function(T,j){const U=j.x-T.x,te=j.y-T.y,J=Math.sqrt(U*U+te*te),ce=U/J,se=te/J;return{x:U,y:j.y-T.y,len:J,nx:ce,ny:se,ang:Math.atan2(se,ce)}};let B;const D=R.length;let O=R[D-1];for(let T=0;T<D;T++){let j=R[T%D];const U=R[(T+1)%D],te=f(j,O),J=f(j,U),ce=te.nx*J.ny-te.ny*J.nx,se=te.nx*J.nx-te.ny*-J.ny;let q=Math.asin(ce<-1?-1:ce>1?1:ce),Z=1,fe=!1;se<0?q<0?q=Math.PI+q:(q=Math.PI-q,Z=-1,fe=!0):q>0&&(Z=-1,fe=!0),B=j.radius!==void 0?j.radius:H;const N=q/2;let K,ne=Math.abs(Math.cos(N)*B/Math.sin(N));ne>Math.min(te.len/2,J.len/2)?(ne=Math.min(te.len/2,J.len/2),K=Math.abs(ne*Math.sin(N)/Math.cos(N))):K=B;let X=j.x+J.nx*ne,Q=j.y+J.ny*ne;X+=-J.ny*K*Z,Q+=J.nx*K*Z,S.arc(X,Q,K,te.ang+Math.PI/2*Z,J.ang-Math.PI/2*Z,fe),O=j,j=U}S.closePath()})(e,[{x:I,y:m},{x:I+11,y:m},{x:I+5.5,y:m+6}],1),e.fillStyle=E,e.fill()}else if(i.menuIcon===Zo.Dots)e.beginPath(),function(I,m,S){I.arc(m,S-4.375,1.25,0,2*Math.PI,!1),I.arc(m,S,1.25,0,2*Math.PI,!1),I.arc(m,S+4.375,1.25,0,2*Math.PI,!1)}(e,b.x+b.width/2,b.y+b.height/2),e.fillStyle=E,e.fill();else{const I=b.x+(b.width-a.headerIconSize)/2,m=b.y+(b.height-a.headerIconSize)/2;y.drawSprite(i.menuIcon,"normal",e,I,m,a.headerIconSize,a)}x||(e.globalAlpha=1)}}function Cd(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v){const E=Yi(i.title)==="rtl",g=bd(e,i,t,n,r,o,a,E);w!==void 0?w({ctx:e,theme:a,rect:{x:t,y:n,width:r,height:o},column:i,columnIndex:i.sourceIndex,isSelected:l,hoverAmount:y,isHovered:s,hasSelectedCell:C,spriteManager:p,menuBounds:(g==null?void 0:g.menuBounds)??{x:0,y:0,height:0,width:0},hoverX:c,hoverY:h},()=>xd(e,t,n,r,o,i,l,a,s,c,h,y,p,v,E,g)):xd(e,t,n,r,o,i,l,a,s,c,h,y,p,v,E,g)}var Sd,kd,Md,Rd,Ed,Id,Td,Hd,Od,Pd,Dd,zd;function z1(){if(Rd)return Md;Rd=1;var e=function(){if(kd)return Sd;kd=1;var t=Ir(),n=function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}}();return Sd=n}();return Md=function(t,n,r){n=="__proto__"&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}}function A1(){if(Pd)return Od;Pd=1;var e=(Hd?Td:(Hd=1,Td=function(t){return function(n,r,o){for(var i=-1,l=Object(n),a=o(n),s=a.length;s--;){var c=a[t?s:++i];if(r(l[c],c,l)===!1)break}return n}}))();return Od=e}var Ad,Fd,Ld,_d,jd,Nd,Bd,ca={exports:{}};function Wd(){return Ld||(Ld=1,function(e,t){var n=Gn(),r=Fd?Ad:(Fd=1,Ad=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,l=i&&i.exports===o?n.Buffer:void 0,a=(l?l.isBuffer:void 0)||r;e.exports=a}(ca,ca.exports)),ca.exports}var $d,Xd,Gd,Yd,Kd,Vd,Ud,qd,Jd,Qd,Zd,eh,th,nh,rh,oh,ih,ah,lh,sh,ch,uh,dh,hh,fh,gh,ph,mh,vh,wh,yh,bh,xh,Ch,Sh,kh,Mh,Rh,Eh,Ih,Th,Hh,Oh,Ph,Dh,zh,Ah,Fh,Lh,_h,jh,Nh,Bh,Wh,$h,Xh,Gh,Yh,Kh,Vh,Uh,qh,Jh,Qh,Zh,ef,tf,ua,nf,rf,of,af,lf,sf,cf,uf,df,hf,ff,gf,pf,mf,vf,wf,yf,bf,xf,Cf,Sf,kf,Mf,Rf,Ef,If,Tf,Hf,Of,Pf,Df,zf,Af,Ff,Lf,da={exports:{}};function _f(){if(Gd)return Xd;Gd=1;var e=function(){if(jd)return _d;jd=1;var i=io(),l=ji(),a=ao(),s={};return s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,_d=function(c){return a(c)&&l(c.length)&&!!s[i(c)]}}(),t=Bd?Nd:(Bd=1,Nd=function(i){return function(l){return i(l)}}),n=function(){return $d||($d=1,i=da,l=da.exports,a=Ys(),s=l&&!l.nodeType&&l,c=s&&i&&!i.nodeType&&i,h=c&&c.exports===s&&a.process,C=function(){try{return c&&c.require&&c.require("util").types||h&&h.binding&&h.binding("util")}catch{}}(),i.exports=C),da.exports;var i,l,a,s,c,h,C}(),r=n&&n.isTypedArray,o=r?t(r):e;return Xd=o}function F1(){if(Kd)return Yd;Kd=1;var e=zd?Dd:(zd=1,Dd=function(a,s){for(var c=-1,h=Array(a);++c<a;)h[c]=s(c);return h}),t=Li(),n=Xn(),r=Wd(),o=_i(),i=_f(),l=Object.prototype.hasOwnProperty;return Yd=function(a,s){var c=n(a),h=!c&&t(a),C=!c&&!h&&r(a),y=!c&&!h&&!C&&i(a),p=c||h||C||y,w=p?e(a.length,String):[],v=w.length;for(var E in a)!s&&!l.call(a,E)||p&&(E=="length"||C&&(E=="offset"||E=="parent")||y&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||o(E,v))||w.push(E);return w}}function L1(){if(Zd)return Qd;Zd=1;var e=(Jd?qd:(Jd=1,qd=function(t,n){return function(r){return t(n(r))}}))(Object.keys,Object);return Qd=e}function _1(){if(th)return eh;th=1;var e=function(){if(Ud)return Vd;Ud=1;var r=Object.prototype;return Vd=function(o){var i=o&&o.constructor;return o===(typeof i=="function"&&i.prototype||r)}}(),t=L1(),n=Object.prototype.hasOwnProperty;return eh=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&i!="constructor"&&o.push(i);return o}}function ha(){if(rh)return nh;rh=1;var e=F1(),t=_1(),n=ia();return nh=function(r){return n(r)?e(r):t(r)}}function j1(){if(ch)return sh;ch=1;var e=function(){if(ih)return oh;ih=1;var n=A1(),r=ha();return oh=function(o,i){return o&&n(o,i,r)}}(),t=function(){if(lh)return ah;lh=1;var n=ia();return ah=function(r,o){return function(i,l){if(i==null)return i;if(!n(i))return r(i,l);for(var a=i.length,s=o?a:-1,c=Object(i);(o?s--:++s<a)&&l(c[s],s,c)!==!1;);return i}}}()(e);return sh=t}function jf(){if(Sh)return Ch;Sh=1;var e=Uo(),t=function(){if(fh)return hh;fh=1;var a=Uo();return hh=function(){this.__data__=new a,this.size=0}}(),n=ph?gh:(ph=1,gh=function(a){var s=this.__data__,c=s.delete(a);return this.size=s.size,c}),r=vh?mh:(vh=1,mh=function(a){return this.__data__.get(a)}),o=yh?wh:(yh=1,wh=function(a){return this.__data__.has(a)}),i=function(){if(xh)return bh;xh=1;var a=Uo(),s=Ai(),c=Fi();return bh=function(h,C){var y=this.__data__;if(y instanceof a){var p=y.__data__;if(!s||p.length<199)return p.push([h,C]),this.size=++y.size,this;y=this.__data__=new c(p)}return y.set(h,C),this.size=y.size,this}}();function l(a){var s=this.__data__=new e(a);this.size=s.size}return l.prototype.clear=t,l.prototype.delete=n,l.prototype.get=r,l.prototype.has=o,l.prototype.set=i,Ch=l}function Nf(){if(Eh)return Rh;Eh=1;var e=Wu(),t=Mh?kh:(Mh=1,kh=function(r,o){for(var i=-1,l=r==null?0:r.length;++i<l;)if(o(r[i],i,r))return!0;return!1}),n=$u();return Rh=function(r,o,i,l,a,s){var c=1&i,h=r.length,C=o.length;if(h!=C&&!(c&&C>h))return!1;var y=s.get(r),p=s.get(o);if(y&&p)return y==o&&p==r;var w=-1,v=!0,E=2&i?new e:void 0;for(s.set(r,o),s.set(o,r);++w<h;){var g=r[w],b=o[w];if(l)var x=c?l(b,g,w,o,r,s):l(g,b,w,r,o,s);if(x!==void 0){if(x)continue;v=!1;break}if(E){if(!t(o,function(I,m){if(!n(E,m)&&(g===I||a(g,I,i,l,s)))return E.push(m)})){v=!1;break}}else if(g!==b&&!a(g,b,i,l,s)){v=!1;break}}return s.delete(r),s.delete(o),v}}function N1(){if(Dh)return Ph;Dh=1;var e=oo(),t=function(){if(Th)return Ih;Th=1;var s=Gn().Uint8Array;return Ih=s}(),n=zi(),r=Nf(),o=Oh?Hh:(Oh=1,Hh=function(s){var c=-1,h=Array(s.size);return s.forEach(function(C,y){h[++c]=[y,C]}),h}),i=ra(),l=e?e.prototype:void 0,a=l?l.valueOf:void 0;return Ph=function(s,c,h,C,y,p,w){switch(h){case"[object DataView]":if(s.byteLength!=c.byteLength||s.byteOffset!=c.byteOffset)return!1;s=s.buffer,c=c.buffer;case"[object ArrayBuffer]":return!(s.byteLength!=c.byteLength||!p(new t(s),new t(c)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+s,+c);case"[object Error]":return s.name==c.name&&s.message==c.message;case"[object RegExp]":case"[object String]":return s==c+"";case"[object Map]":var v=o;case"[object Set]":var E=1&C;if(v||(v=i),s.size!=c.size&&!E)return!1;var g=w.get(s);if(g)return g==c;C|=2,w.set(s,c);var b=r(v(s),v(c),C,y,p,w);return w.delete(s),b;case"[object Symbol]":if(a)return a.call(s)==a.call(c)}return!1}}function B1(){if(Bh)return Nh;Bh=1;var e=Lh?Fh:(Lh=1,Fh=function(o,i){for(var l=-1,a=o==null?0:o.length,s=0,c=[];++l<a;){var h=o[l];i(h,l,o)&&(c[s++]=h)}return c}),t=jh?_h:(jh=1,_h=function(){return[]}),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return Nh=r?function(o){return o==null?[]:(o=Object(o),e(r(o),function(i){return n.call(o,i)}))}:t}function W1(){if($h)return Wh;$h=1;var e=function(){if(Ah)return zh;Ah=1;var r=Qu(),o=Xn();return zh=function(i,l,a){var s=l(i);return o(i)?s:r(s,a(i))}}(),t=B1(),n=ha();return Wh=function(r){return e(r,n,t)}}function $1(){if(Zh)return Qh;Zh=1;var e=function(){if(Kh)return Yh;Kh=1;var b=Ir()(Gn(),"DataView");return Yh=b}(),t=Ai(),n=function(){if(Uh)return Vh;Uh=1;var b=Ir()(Gn(),"Promise");return Vh=b}(),r=Xu(),o=function(){if(Jh)return qh;Jh=1;var b=Ir()(Gn(),"WeakMap");return qh=b}(),i=io(),l=Vs(),a="[object Map]",s="[object Promise]",c="[object Set]",h="[object WeakMap]",C="[object DataView]",y=l(e),p=l(t),w=l(n),v=l(r),E=l(o),g=i;return(e&&g(new e(new ArrayBuffer(1)))!=C||t&&g(new t)!=a||n&&g(n.resolve())!=s||r&&g(new r)!=c||o&&g(new o)!=h)&&(g=function(b){var x=i(b),I=x=="[object Object]"?b.constructor:void 0,m=I?l(I):"";if(m)switch(m){case y:return C;case p:return a;case w:return s;case v:return c;case E:return h}return x}),Qh=g}function X1(){if(tf)return ef;tf=1;var e=jf(),t=Nf(),n=N1(),r=function(){if(Gh)return Xh;Gh=1;var y=W1(),p=Object.prototype.hasOwnProperty;return Xh=function(w,v,E,g,b,x){var I=1&E,m=y(w),S=m.length;if(S!=y(v).length&&!I)return!1;for(var R=S;R--;){var H=m[R];if(!(I?H in v:p.call(v,H)))return!1}var f=x.get(w),B=x.get(v);if(f&&B)return f==v&&B==w;var D=!0;x.set(w,v),x.set(v,w);for(var O=I;++R<S;){var T=w[H=m[R]],j=v[H];if(g)var U=I?g(j,T,H,v,w,x):g(T,j,H,w,v,x);if(!(U===void 0?T===j||b(T,j,E,g,x):U)){D=!1;break}O||(O=H=="constructor")}if(D&&!O){var te=w.constructor,J=v.constructor;te==J||!("constructor"in w)||!("constructor"in v)||typeof te=="function"&&te instanceof te&&typeof J=="function"&&J instanceof J||(D=!1)}return x.delete(w),x.delete(v),D}}(),o=$1(),i=Xn(),l=Wd(),a=_f(),s="[object Arguments]",c="[object Array]",h="[object Object]",C=Object.prototype.hasOwnProperty;return ef=function(y,p,w,v,E,g){var b=i(y),x=i(p),I=b?c:o(y),m=x?c:o(p),S=(I=I==s?h:I)==h,R=(m=m==s?h:m)==h,H=I==m;if(H&&l(y)){if(!l(p))return!1;b=!0,S=!1}if(H&&!S)return g||(g=new e),b||a(y)?t(y,p,w,v,E,g):n(y,p,I,w,v,E,g);if(!(1&w)){var f=S&&C.call(y,"__wrapped__"),B=R&&C.call(p,"__wrapped__");if(f||B){var D=f?y.value():y,O=B?p.value():p;return g||(g=new e),E(D,O,w,v,g)}}return!!H&&(g||(g=new e),r(y,p,w,v,E,g))}}function Bf(){if(nf)return ua;nf=1;var e=X1(),t=ao();return ua=function n(r,o,i,l,a){return r===o||(r==null||o==null||!t(r)&&!t(o)?r!=r&&o!=o:e(r,o,i,l,n,a))},ua}function Wf(){if(lf)return af;lf=1;var e=Er();return af=function(t){return t==t&&!e(t)}}function $f(){return df?uf:(df=1,uf=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}})}function G1(){if(ff)return hf;ff=1;var e=function(){if(of)return rf;of=1;var r=jf(),o=Bf();return rf=function(i,l,a,s){var c=a.length,h=c,C=!s;if(i==null)return!h;for(i=Object(i);c--;){var y=a[c];if(C&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++c<h;){var p=(y=a[c])[0],w=i[p],v=y[1];if(C&&y[2]){if(w===void 0&&!(p in i))return!1}else{var E=new r;if(s)var g=s(w,v,p,i,l,E);if(!(g===void 0?o(v,w,3,s,E):g))return!1}}return!0}}(),t=function(){if(cf)return sf;cf=1;var r=Wf(),o=ha();return sf=function(i){for(var l=o(i),a=l.length;a--;){var s=l[a],c=i[s];l[a]=[s,c,r(c)]}return l}}(),n=$f();return hf=function(r){var o=t(r);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(i){return i===r||e(i,r,o)}}}function Xf(){if(pf)return gf;pf=1;var e=Us(),t=Jo();return gf=function(n,r){for(var o=0,i=(r=e(r,n)).length;n!=null&&o<i;)n=n[t(r[o++])];return o&&o==i?n:void 0}}function Y1(){if(xf)return bf;xf=1;var e=yf?wf:(yf=1,wf=function(n,r){return n!=null&&r in Object(n)}),t=qs();return bf=function(n,r){return n!=null&&t(n,r,e)}}function K1(){if(Sf)return Cf;Sf=1;var e=Bf(),t=function(){if(vf)return mf;vf=1;var a=Xf();return mf=function(s,c,h){var C=s==null?void 0:a(s,c);return C===void 0?h:C}}(),n=Y1(),r=Di(),o=Wf(),i=$f(),l=Jo();return Cf=function(a,s){return r(a)&&o(s)?i(l(a),s):function(c){var h=t(c,a);return h===void 0&&h===s?n(c,a):e(s,h,3)}}}function V1(){if(Of)return Hf;Of=1;var e=Ef?Rf:(Ef=1,Rf=function(o){return function(i){return i==null?void 0:i[o]}}),t=function(){if(Tf)return If;Tf=1;var o=Xf();return If=function(i){return function(l){return o(l,i)}}}(),n=Di(),r=Jo();return Hf=function(o){return n(o)?e(r(o)):t(o)}}function U1(){if(Df)return Pf;Df=1;var e=G1(),t=K1(),n=Mf?kf:(Mf=1,kf=function(i){return i}),r=Xn(),o=V1();return Pf=function(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):o(i)}}function q1(){if(Af)return zf;Af=1;var e=Id?Ed:(Id=1,Ed=function(o,i,l,a){for(var s=-1,c=o==null?0:o.length;++s<c;){var h=o[s];i(a,h,l(h),o)}return a}),t=function(){if(dh)return uh;dh=1;var o=j1();return uh=function(i,l,a,s){return o(i,function(c,h,C){l(s,c,a(c),C)}),s}}(),n=U1(),r=Xn();return zf=function(o,i){return function(l,a){var s=r(l)?e:t,c=i?i():{};return s(l,o,n(a,2),c)}}}var J1=function(){if(Lf)return Ff;Lf=1;var e=z1(),t=q1(),n=Object.prototype.hasOwnProperty,r=t(function(o,i,l){n.call(o,l)?o[l].push(i):e(o,l,[i])});return Ff=r}();const Q1=Sr(J1),Gf=(e,t,n)=>{let r=0,o=t,i=0,l=n;if(e!==void 0&&e.length>0){r=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;for(const a of e)r=Math.min(r,a.x-1),o=Math.max(o,a.x+a.width+1),i=Math.min(i,a.y-1),l=Math.max(l,a.y+a.height+1)}return{minX:r,maxX:o,minY:i,maxY:l}};function Yf(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v,E,g=!1){if(s!==void 0){e.beginPath(),e.save(),e.rect(0,0,i,l);for(const O of s)e.rect(O.x+1,O.y+1,O.width-1,O.height-1);e.clip("evenodd")}const b=E.horizontalBorderColor??E.borderColor,x=E.borderColor,{minX:I,maxX:m,minY:S,maxY:R}=Gf(a,i,l),H=[];e.beginPath();let f=.5;for(let O=0;O<t.length;O++){const T=t[O];if(T.width===0)continue;f+=T.width;const j=T.sticky?f:f+r;j>=I&&j<=m&&p(O+1)&&H.push({x1:j,y1:Math.max(c,S),x2:j,y2:Math.min(l,R),color:x})}let B=l+.5;for(let O=v-w;O<v;O++)B-=C(O),H.push({x1:I,y1:B,x2:m,y2:B,color:b});if(g!==!0){let O=h+.5,T=n;const j=B;for(;O+o<j;){const U=O+o;if(U>=S&&U<=R-1){const te=y==null?void 0:y(T);H.push({x1:I,y1:U,x2:m,y2:U,color:(te==null?void 0:te.horizontalBorderColor)??(te==null?void 0:te.borderColor)??b})}O+=C(T),T++}}const D=Q1(H,O=>O.color);for(const O of Object.keys(D)){e.strokeStyle=O;for(const T of D[O])e.moveTo(T.x1,T.y1),e.lineTo(T.x2,T.y2);e.stroke(),e.beginPath()}s!==void 0&&e.restore()}function Kf(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v){const E=w==null?void 0:w.filter(R=>R.style!=="no-outline");if(E===void 0||E.length===0)return;const g=Yr(a),b=Or(p,y,C),x=[s,0,a.length,p-y],I=[g,0,t,n-b],m=E.map(R=>{const H=R.range,f=R.style??"dashed";return function(B,D,O,T,j){const[U,te,J,ce]=D,[se,q,Z,fe]=j,{x:N,y:K,width:ne,height:X}=B,Q=[];if(ne<=0||X<=0)return Q;const ae=N+ne,he=K+X,ze=N<U,$e=K<te,Ze=N+ne>J,He=K+X>ce,We=N>=U&&N<J||ae>U&&ae<=J||N<U&&ae>J,me=K>=te&&K<ce||he>te&&he<=ce||K<te&&he>ce;if(We&&me){const ye=Math.max(N,U),Me=Math.max(K,te),Se=Math.min(ae,J),ee=Math.min(he,ce);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:se,y:q,width:Z-se+1,height:fe-q+1}})}if(ze&&$e){const ye=N,Me=K,Se=Math.min(ae,U),ee=Math.min(he,te);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:0,y:0,width:se+1,height:q+1}})}if($e&&We){const ye=Math.max(N,U),Me=K,Se=Math.min(ae,J),ee=Math.min(he,te);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:se,y:0,width:Z-se+1,height:q+1}})}if($e&&Ze){const ye=Math.max(N,J),Me=K,Se=ae,ee=Math.min(he,te);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:Z,y:0,width:O-Z+1,height:q+1}})}if(ze&&me){const ye=N,Me=Math.max(K,te),Se=Math.min(ae,U),ee=Math.min(he,ce);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:0,y:q,width:se+1,height:fe-q+1}})}if(Ze&&me){const ye=Math.max(N,J),Me=Math.max(K,te),Se=ae,ee=Math.min(he,ce);Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:Z,y:q,width:O-Z+1,height:fe-q+1}})}if(ze&&He){const ye=N,Me=Math.max(K,ce),Se=Math.min(ae,U),ee=he;Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:0,y:fe,width:se+1,height:T-fe+1}})}if(He&&We){const ye=Math.max(N,U),Me=Math.max(K,ce),Se=Math.min(ae,J),ee=he;Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:se,y:fe,width:Z-se+1,height:T-fe+1}})}if(Ze&&He){const ye=Math.max(N,J),Me=Math.max(K,ce),Se=ae,ee=he;Q.push({rect:{x:ye,y:Me,width:Se-ye,height:ee-Me},clip:{x:Z,y:fe,width:O-Z+1,height:T-fe+1}})}return Q}(H,x,t,n,I).map(B=>{const D=B.rect,O=Qi(D.x,D.y,t,n,h,c+h,r,o,i,l,p,s,y,a,C),T=D.width===1&&D.height===1?O:Qi(D.x+D.width-1,D.y+D.height-1,t,n,h,c+h,r,o,i,l,p,s,y,a,C);return D.x+D.width>=a.length&&(T.width-=1),D.y+D.height>=p&&(T.height-=1),{color:R.color,style:f,clip:B.clip,rect:H1({x:O.x,y:O.y,width:T.x+T.width-O.x,height:T.y+T.height-O.y},t,n,8)}})}),S=()=>{e.lineWidth=1;let R=!1;for(const H of m)for(const f of H)if((f==null?void 0:f.rect)!==void 0&&xo(0,0,t,n,f.rect.x,f.rect.y,f.rect.width,f.rect.height)){const B=R,D=!T1(f.clip,f.rect);e.beginPath(),D&&(e.save(),e.rect(f.clip.x,f.clip.y,f.clip.width,f.clip.height),e.clip()),f.style!=="dashed"||R?f.style!=="solid"&&f.style!=="solid-outline"||!R||(e.setLineDash([]),R=!1):(e.setLineDash([5,3]),R=!0),e.strokeStyle=f.style==="solid-outline"?In(In(f.color,v.borderColor),v.bgCell):Hr(f.color,1),e.closePath(),e.strokeRect(f.rect.x+.5,f.rect.y+.5,f.rect.width-1,f.rect.height-1),D&&(e.restore(),R=B)}R&&e.setLineDash([])};return S(),S}function Vf(e,t,n,r,o){e.beginPath(),e.moveTo(t,n),e.lineTo(t,r),e.lineWidth=2,e.strokeStyle=o,e.stroke(),e.globalAlpha=1}function fa(e,t,n,r,o,i,l,a,s,c,h,C,y,p,w,v,E){if(h.current===void 0)return;const g=h.current.range,b=h.current.cell,x=[g.x+g.width-1,g.y+g.height-1];if(b[1]>=E&&x[1]>=E||!l.some(O=>O.sourceIndex===b[0]||O.sourceIndex===x[0]))return;const[I,m]=h.current.cell,S=y(h.current.cell),R=S.span??[I,I],H=p>0&&!(m>=E-p)?Or(E,p,C)-1:0,f=x[1];let B;if(gr(l,r,o,i,c,(O,T,j,U,te)=>{if(O.sticky&&I>O.sourceIndex)return;const J=O.sourceIndex<R[0],ce=O.sourceIndex>R[1],se=O.sourceIndex===x[0];return se||!J&&!ce?(ai(te,j,n,E,C,p,w,void 0,(q,Z,fe)=>{if(Z!==m&&Z!==f)return;let N=T,K=O.width;if(S.span!==void 0){const ne=pd(S.span,T,q,O.width,fe,O,a),X=O.sticky?ne[0]:ne[1];X!==void 0&&(N=X.x,K=X.width)}return Z===f&&se&&v&&(B=()=>{var ne;U>N&&!O.sticky&&(e.beginPath(),e.rect(U,0,t-U,n),e.clip()),e.beginPath(),e.rect(N+K-4,q+fe-4,4,4),e.fillStyle=((ne=O.themeOverride)==null?void 0:ne.accentColor)??s.accentColor,e.fill()}),B!==void 0}),B!==void 0):void 0}),B===void 0)return;const D=()=>{e.save(),e.beginPath(),e.rect(0,c,t,n-c-H),e.clip(),B==null||B(),e.restore()};return D(),D}function Uf(e,t){var _n;const{canvasCtx:n,headerCanvasCtx:r,width:o,height:i,cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mappedColumns:h,enableGroups:C,freezeColumns:y,dragAndDropState:p,theme:w,drawFocus:v,headerHeight:E,groupHeaderHeight:g,disabledRows:b,rowHeight:x,verticalBorder:I,overrideCursor:m,isResizing:S,selection:R,fillHandle:H,freezeTrailingRows:f,rows:B,getCellContent:D,getGroupDetails:O,getRowThemeOverride:T,isFocused:j,drawHeaderCallback:U,prelightCells:te,drawCellCallback:J,highlightRegions:ce,resizeCol:se,imageLoader:q,lastBlitData:Z,hoverValues:fe,hyperWrapping:N,hoverInfo:K,spriteManager:ne,maxScaleFactor:X,hasAppendRow:Q,touchMode:ae,enqueue:he,renderStateProvider:ze,getCellRenderer:$e,renderStrategy:Ze,bufferACtx:He,bufferBCtx:We,damage:me,minimumCellWidth:ye,resizeIndicator:Me}=e;if(o===0||i===0)return;const Se=Ze==="double-buffer",ee=Math.min(X,Math.ceil(window.devicePixelRatio??1)),Pe=Ze!=="direct"&&function(re,be){if(be===void 0||re.width!==be.width||re.height!==be.height||re.theme!==be.theme||re.headerHeight!==be.headerHeight||re.rowHeight!==be.rowHeight||re.rows!==be.rows||re.freezeColumns!==be.freezeColumns||re.getRowThemeOverride!==be.getRowThemeOverride||re.isFocused!==be.isFocused||re.isResizing!==be.isResizing||re.verticalBorder!==be.verticalBorder||re.getCellContent!==be.getCellContent||re.highlightRegions!==be.highlightRegions||re.selection!==be.selection||re.dragAndDropState!==be.dragAndDropState||re.prelightCells!==be.prelightCells||re.touchMode!==be.touchMode||re.maxScaleFactor!==be.maxScaleFactor)return!1;if(re.mappedColumns!==be.mappedColumns){if(re.mappedColumns.length>100||re.mappedColumns.length!==be.mappedColumns.length)return!1;let wt;for(let st=0;st<re.mappedColumns.length;st++){const xt=re.mappedColumns[st],ve=be.mappedColumns[st];if($r(xt,ve))continue;if(wt!==void 0||xt.width===ve.width)return!1;const{width:Ve,...Ye}=xt,{width:mt,...rt}=ve;if(!$r(Ye,rt))return!1;wt=st}return wt===void 0||wt}return!0}(e,t),ke=n.canvas;ke.width===o*ee&&ke.height===i*ee||(ke.width=o*ee,ke.height=i*ee,ke.style.width=o+"px",ke.style.height=i+"px");const Ge=r.canvas,Re=C?g+E:E,nt=Re+1;Ge.width===o*ee&&Ge.height===nt*ee||(Ge.width=o*ee,Ge.height=nt*ee,Ge.style.width=o+"px",Ge.style.height=nt+"px");const Ke=He.canvas,ct=We.canvas;!Se||Ke.width===o*ee&&Ke.height===i*ee||(Ke.width=o*ee,Ke.height=i*ee,Z.current!==void 0&&(Z.current.aBufferScroll=void 0)),!Se||ct.width===o*ee&&ct.height===i*ee||(ct.width=o*ee,ct.height=i*ee,Z.current!==void 0&&(Z.current.bBufferScroll=void 0));const Ee=Z.current;if(Pe===!0&&l===(Ee==null?void 0:Ee.cellXOffset)&&a===(Ee==null?void 0:Ee.cellYOffset)&&s===(Ee==null?void 0:Ee.translateX)&&c===(Ee==null?void 0:Ee.translateY))return;let Ae=null;Se&&(Ae=n);const ut=r;let dt;dt=Se?me!==void 0?(Ee==null?void 0:Ee.lastBuffer)==="b"?We:He:(Ee==null?void 0:Ee.lastBuffer)==="b"?He:We:n;const pt=dt.canvas,Ft=Se?pt===Ke?ct:Ke:ke,bt=typeof x=="number"?()=>x:x;ut.save(),dt.save(),ut.beginPath(),dt.beginPath(),ut.textBaseline="middle",dt.textBaseline="middle",ee!==1&&(ut.scale(ee,ee),dt.scale(ee,ee));const Je=Ji(h,l,o,p,s);let Yt=[];const nn=v&&((_n=R.current)==null?void 0:_n.cell[1])===a&&c===0;let Kt=!1;if(ce!==void 0){for(const re of ce)if(re.style!=="no-outline"&&re.range.y===a&&c===0){Kt=!0;break}}const qt=()=>{D1(ut,Je,C,K,o,s,E,g,p,S,R,w,ne,fe,I,O,me,U,ae),Yf(ut,Je,a,s,c,o,i,void 0,void 0,g,Re,bt,T,I,f,B,w,!0),ut.beginPath(),ut.moveTo(0,nt-.5),ut.lineTo(o,nt-.5),ut.strokeStyle=In(w.headerBottomBorderColor??w.horizontalBorderColor??w.borderColor,w.bgHeader),ut.stroke(),Kt&&Kf(ut,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,w),nn&&fa(ut,o,i,a,s,c,Je,h,w,Re,R,bt,D,f,Q,H,B)};if(me!==void 0){const re=Je[Je.length-1].sourceIndex+1,be=wt=>{vd(wt,Je,h,i,Re,s,c,a,B,bt,D,O,T,b,j,v,f,Q,Yt,me,R,te,ce,q,ne,fe,K,J,N,w,he,ze,$e,m,ye);const st=R.current;H&&v&&st!==void 0&&me.has(Kc(st.range))&&fa(wt,o,i,a,s,c,Je,h,w,Re,R,bt,D,f,Q,H,B)};return me.hasItemInRegion([{x:l,y:-2,width:re,height:2},{x:l,y:a,width:re,height:300},{x:0,y:a,width:y,height:300},{x:0,y:-2,width:y,height:2},{x:l,y:B-f,width:re,height:f,when:f>0}])&&(be(dt),Ae!==null&&(Ae.save(),Ae.scale(ee,ee),Ae.textBaseline="middle",be(Ae),Ae.restore()),me.hasHeader()&&(function(wt,st,xt,ve,Ve,Ye,mt,rt,ot){ot!==void 0&&ot.size!==0&&(wt.beginPath(),gd(st,xt,Ye,ve,(vt,Ue,it,tt,Oe,Nt)=>{ot.hasItemInRectangle({x:vt[0],y:-2,width:vt[1]-vt[0]+1,height:1})&&wt.rect(it,tt,Oe,Nt)}),gr(st,rt,Ye,mt,Ve,(vt,Ue,it,tt)=>{const Oe=Math.max(0,tt-Ue),Nt=Ue+Oe+1,gn=vt.width-Oe-1;ot.has([vt.sourceIndex,-1])&&wt.rect(Nt,ve,gn,Ve-ve)}),wt.clip())}(ut,Je,o,g,Re,s,c,a,me),qt())),dt.restore(),void ut.restore()}if(Pe===!0&&l===(Ee==null?void 0:Ee.cellXOffset)&&s===(Ee==null?void 0:Ee.translateX)&&nn===(Ee==null?void 0:Ee.mustDrawFocusOnHeader)&&Kt===(Ee==null?void 0:Ee.mustDrawHighlightRingsOnHeader)||qt(),Pe===!0){Rn(Ft!==void 0&&Ee!==void 0);const{regions:re}=function(be,wt,st,xt,ve,Ve,Ye,mt,rt,ot,vt,Ue,it,tt,Oe,Nt,gn,Zt,rn){const Bt=[];be.imageSmoothingEnabled=!1;const Xt=Math.min(ve.cellYOffset,Ye),Sn=Math.max(ve.cellYOffset,Ye);let Rt=0;if(typeof Zt=="number")Rt+=(Sn-Xt)*Zt;else for(let qe=Xt;qe<Sn;qe++)Rt+=Zt(qe);Ye>ve.cellYOffset&&(Rt=-Rt),Rt+=rt-ve.translateY;const kn=Math.min(ve.cellXOffset,Ve),pn=Math.max(ve.cellXOffset,Ve);let kt=0;for(let qe=kn;qe<pn;qe++)kt+=Nt[qe].width;Ve>ve.cellXOffset&&(kt=-kt),kt+=mt-ve.translateX;const It=Yr(gn);if(kt!==0&&Rt!==0)return{regions:[]};const Vt=ot>0?Or(it,ot,Zt):0,Et=vt-It-Math.abs(kt),Tt=Ue-tt-Vt-Math.abs(Rt)-1;if(Et>150&&Tt>150){const qe={sx:0,sy:0,sw:vt*Oe,sh:Ue*Oe,dx:0,dy:0,dw:vt*Oe,dh:Ue*Oe};if(Rt>0?(qe.sy=(tt+1)*Oe,qe.sh=Tt*Oe,qe.dy=(Rt+tt+1)*Oe,qe.dh=Tt*Oe,Bt.push({x:0,y:tt,width:vt,height:Rt+1})):Rt<0&&(qe.sy=(-Rt+tt+1)*Oe,qe.sh=Tt*Oe,qe.dy=(tt+1)*Oe,qe.dh=Tt*Oe,Bt.push({x:0,y:Ue+Rt-Vt,width:vt,height:-Rt+Vt})),kt>0?(qe.sx=It*Oe,qe.sw=Et*Oe,qe.dx=(kt+It)*Oe,qe.dw=Et*Oe,Bt.push({x:It-1,y:0,width:kt+2,height:Ue})):kt<0&&(qe.sx=(It-kt)*Oe,qe.sw=Et*Oe,qe.dx=It*Oe,qe.dw=Et*Oe,Bt.push({x:vt+kt,y:0,width:-kt,height:Ue})),be.setTransform(1,0,0,1,0,0),rn){if(It>0&&kt!==0&&Rt===0&&(xt===void 0||(st==null?void 0:st[1])!==!1)){const Jt=It*Oe,Mn=Ue*Oe;be.drawImage(wt,0,0,Jt,Mn,0,0,Jt,Mn)}if(Vt>0&&kt===0&&Rt!==0&&(xt===void 0||(st==null?void 0:st[0])!==!1)){const Jt=(Ue-Vt)*Oe,Mn=vt*Oe,mn=Vt*Oe;be.drawImage(wt,0,Jt,Mn,mn,0,Jt,Mn,mn)}}be.drawImage(wt,qe.sx,qe.sy,qe.sw,qe.sh,qe.dx,qe.dy,qe.dw,qe.dh),be.scale(Oe,Oe)}return be.imageSmoothingEnabled=!0,{regions:Bt}}(dt,Ft,Ft===Ke?Ee.aBufferScroll:Ee.bBufferScroll,Ft===Ke?Ee.bBufferScroll:Ee.aBufferScroll,Ee,l,a,s,c,f,o,i,B,Re,ee,h,Je,x,Se);Yt=re}else Pe!==!1&&(Rn(Ee!==void 0),Yt=function(re,be,wt,st,xt,ve,Ve,Ye,mt,rt){const ot=[];return be!==re.cellXOffset||wt!==re.cellYOffset||st!==re.translateX||xt!==re.translateY||gr(mt,wt,st,xt,Ye,(vt,Ue,it,tt)=>{if(vt.sourceIndex===rt){const Oe=Math.max(Ue,tt)+1;return ot.push({x:Oe,y:0,width:ve-Oe,height:Ve}),!0}}),ot}(Ee,l,a,s,c,o,i,Re,Je,Pe));(function(re,be,wt,st,xt,ve,Ve,Ye,mt){let rt=!1;for(const tt of be)if(!tt.sticky){rt=Ve(tt.sourceIndex);break}const ot=mt.horizontalBorderColor??mt.borderColor,vt=mt.borderColor,Ue=rt?Yr(be):0;let it;if(Ue!==0&&(it=Gc(vt,mt.bgCell),re.beginPath(),re.moveTo(Ue+.5,0),re.lineTo(Ue+.5,st),re.strokeStyle=it,re.stroke()),xt>0){const tt=vt===ot&&it!==void 0?it:Gc(ot,mt.bgCell),Oe=Or(ve,xt,Ye);re.beginPath(),re.moveTo(0,st-Oe+.5),re.lineTo(wt,st-Oe+.5),re.strokeStyle=tt,re.stroke()}})(dt,Je,o,i,f,B,I,bt,w);const un=Kf(dt,o,i,l,a,s,c,h,y,E,g,x,f,B,ce,w),jt=v?fa(dt,o,i,a,s,c,Je,h,w,Re,R,bt,D,f,Q,H,B):void 0;if(dt.fillStyle=w.bgCell,Yt.length>0){dt.beginPath();for(const re of Yt)dt.rect(re.x,re.y,re.width,re.height);dt.clip(),dt.fill(),dt.beginPath()}else dt.fillRect(0,0,o,i);const Kn=vd(dt,Je,h,i,Re,s,c,a,B,bt,D,O,T,b,j,v,f,Q,Yt,me,R,te,ce,q,ne,fe,K,J,N,w,he,ze,$e,m,ye);(function(re,be,wt,st,xt,ve,Ve,Ye,mt,rt,ot,vt,Ue,it,tt,Oe,Nt,gn,Zt){if(gn!==void 0||be[be.length-1]!==wt[be.length-1])return;const rn=fd(Nt);gr(be,mt,Ve,Ye,ve,(Bt,Xt,Sn,Rt,kn)=>{if(Bt!==be[be.length-1])return;Xt+=Bt.width;const pn=Math.max(Xt,Rt);pn>st||(re.save(),re.beginPath(),re.rect(pn,ve+1,1e4,xt-ve-1),re.clip(),ai(kn,Sn,xt,rt,ot,tt,Oe,rn,(kt,It,Vt,Et)=>{if(!Et&&Nt.length>0&&!Nt.some(mn=>xo(Xt,kt,1e4,Vt,mn.x,mn.y,mn.width,mn.height)))return;const Tt=Ue.hasIndex(It),qe=it.hasIndex(It);re.beginPath();const Jt=vt==null?void 0:vt(It),Mn=Jt===void 0?Zt:Qn(Zt,Jt);Mn.bgCell!==Zt.bgCell&&(re.fillStyle=Mn.bgCell,re.fillRect(Xt,kt,1e4,Vt)),qe&&(re.fillStyle=Mn.bgHeader,re.fillRect(Xt,kt,1e4,Vt)),Tt&&(re.fillStyle=Mn.accentLight,re.fillRect(Xt,kt,1e4,Vt))}),re.restore())})})(dt,Je,h,o,i,Re,s,c,a,B,bt,T,R.rows,b,f,Q,Yt,me,w),function(re,be,wt,st,xt,ve,Ve,Ye,mt,rt,ot,vt,Ue,it,tt){var Vt;const Oe=tt.bgCell,{minX:Nt,maxX:gn,minY:Zt,maxY:rn}=Gf(Ye,ve,Ve),Bt=[],Xt=Ve-Or(it,Ue,rt);let Sn=mt,Rt=wt,kn=0;for(;Sn+xt<Xt;){const Et=Sn+xt,Tt=rt(Rt);if(Et>=Zt&&Et<=rn-1){const qe=ot==null?void 0:ot(Rt),Jt=qe==null?void 0:qe.bgCell;Jt!==void 0&&Jt!==Oe&&Rt>=it-Ue&&Bt.push({x:Nt,y:Et,w:gn-Nt,h:Tt,color:Jt})}Sn+=Tt,Rt<it-Ue&&(kn=Sn),Rt++}let pn=0;const kt=Math.min(Xt,rn)-kn;if(kt>0)for(let Et=0;Et<be.length;Et++){const Tt=be[Et];if(Tt.width===0)continue;const qe=Tt.sticky?pn:pn+st,Jt=(Vt=Tt.themeOverride)==null?void 0:Vt.bgCell;Jt!==void 0&&Jt!==Oe&&qe>=Nt&&qe<=gn&&vt(Et+1)&&Bt.push({x:qe,y:kn,w:Tt.width,h:kt,color:Jt}),pn+=Tt.width}if(Bt.length===0)return;let It;re.beginPath();for(let Et=Bt.length-1;Et>=0;Et--){const Tt=Bt[Et];It===void 0?It=Tt.color:Tt.color!==It&&(re.fillStyle=It,re.fill(),re.beginPath(),It=Tt.color),re.rect(Tt.x,Tt.y,Tt.w,Tt.h)}It!==void 0&&(re.fillStyle=It,re.fill()),re.beginPath()}(dt,Je,a,s,c,o,i,Yt,Re,bt,T,I,f,B,w),Yf(dt,Je,a,s,c,o,i,Yt,Kn,g,Re,bt,T,I,f,B,w),un==null||un(),jt==null||jt(),S&&Me!=="none"&&gr(Je,0,s,0,Re,(re,be)=>re.sourceIndex===se&&(Vf(ut,be+re.width,0,Re+1,In(w.resizeIndicatorColor??w.accentLight,w.bgHeader)),Me==="full"&&Vf(dt,be+re.width,Re,i,In(w.resizeIndicatorColor??w.accentLight,w.bgCell)),!0)),Ae!==null&&(Ae.fillStyle=w.bgCell,Ae.fillRect(0,0,o,i),Ae.drawImage(dt.canvas,0,0));const vr=function(re,be,wt,st,xt,ve,Ve,Ye,mt,rt){let ot=0;return gr(re,ve,st,xt,wt,(vt,Ue,it,tt,Oe)=>(ai(Oe,it,be,Ve,Ye,mt,rt,void 0,(Nt,gn,Zt,rn)=>{rn||(ot=Math.max(gn,ot))}),!0)),ot}(Je,i,Re,s,c,a,B,bt,f,Q);q==null||q.setWindow({x:l,y:a,width:Je.length,height:vr-a},y,Array.from({length:f},(re,be)=>B-1-be));const Dt=Ee!==void 0&&(l!==Ee.cellXOffset||s!==Ee.translateX),er=Ee!==void 0&&(a!==Ee.cellYOffset||c!==Ee.translateY);Z.current={cellXOffset:l,cellYOffset:a,translateX:s,translateY:c,mustDrawFocusOnHeader:nn,mustDrawHighlightRingsOnHeader:Kt,lastBuffer:Se?pt===Ke?"a":"b":void 0,aBufferScroll:pt===Ke?[Dt,er]:Ee==null?void 0:Ee.aBufferScroll,bBufferScroll:pt===ct?[Dt,er]:Ee==null?void 0:Ee.bBufferScroll},dt.restore(),ut.restore()}function Z1(e){const t=e-1;return t*t*t+1}class eg{constructor(t){ft(this,"callback");ft(this,"currentHoveredItem");ft(this,"leavingItems",[]);ft(this,"lastAnimationTime");ft(this,"addToLeavingItems",t=>{this.leavingItems.some(n=>vo(n.item,t.item))||this.leavingItems.push(t)});ft(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(r=>vo(r.item,t));return this.leavingItems=this.leavingItems.filter(r=>r!==n),(n==null?void 0:n.hoverAmount)??0});ft(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});ft(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});ft(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:Z1(t.hoverAmount)})));ft(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const n=(t-this.lastAnimationTime)/80;for(const o of this.leavingItems)o.hoverAmount=On(o.hoverAmount-n,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=On(this.currentHoveredItem.hoverAmount+n,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});ft(this,"setHovered",t=>{var n;if(!vo((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const r=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:r}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class tg{constructor(t){ft(this,"fn");ft(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function ga(e){return new tg(e)}const ng=ga(()=>window.navigator.userAgent.includes("Firefox")),si=ga(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ci=ga(()=>window.navigator.platform.toLowerCase().startsWith("mac")),pr="header",Pn="group-header",ui="out-of-bounds";var Vr;function qf(e,t){return e===t||((e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1]))}(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Vr||(Vr={}));const rg=d.memo(d.forwardRef((e,t)=>{const{width:n,height:r,accessibilityHeight:o,columns:i,cellXOffset:l,cellYOffset:a,headerHeight:s,fillHandle:c=!1,groupHeaderHeight:h,rowHeight:C,rows:y,getCellContent:p,getRowThemeOverride:w,onHeaderMenuClick:v,onHeaderIndicatorClick:E,enableGroups:g,isFilling:b,onCanvasFocused:x,onCanvasBlur:I,isFocused:m,selection:S,freezeColumns:R,onContextMenu:H,freezeTrailingRows:f,fixedShadowX:B=!0,fixedShadowY:D=!0,drawFocusRing:O,onMouseDown:T,onMouseUp:j,onMouseMoveRaw:U,onMouseMove:te,onItemHovered:J,dragAndDropState:ce,firstColAccessible:se,onKeyDown:q,onKeyUp:Z,highlightRegions:fe,canvasRef:N,onDragStart:K,onDragEnd:ne,eventTargetRef:X,isResizing:Q,resizeColumn:ae,isDragging:he,isDraggable:ze=!1,allowResize:$e,disabledRows:Ze,hasAppendRow:He,getGroupDetails:We,theme:me,prelightCells:ye,headerIcons:Me,verticalBorder:Se,drawCell:ee,drawHeader:Pe,onCellFocused:ke,onDragOverCell:Ge,onDrop:Re,onDragLeave:nt,imageWindowLoader:Ke,smoothScrollX:ct=!1,smoothScrollY:Ee=!1,experimental:Ae,getCellRenderer:ut,resizeIndicator:dt="full"}=e,pt=e.translateX??0,Ft=e.translateY??0,bt=Math.max(R,Math.min(i.length-1,l)),Je=d.useRef(null),Yt=d.useRef((Ae==null?void 0:Ae.eventTarget)??window),nn=Yt.current,Kt=Ke,qt=d.useRef(),[un,jt]=d.useState(!1),Kn=d.useRef([]),vr=d.useRef(),[Dt,er]=d.useState(),[_n,re]=d.useState(),be=d.useRef(null),[wt,st]=d.useState(),[xt,ve]=d.useState(!1),Ve=d.useRef(xt);Ve.current=xt;const Ye=d.useMemo(()=>new I1(Me,()=>{kn.current=void 0,Vt.current()}),[Me]),mt=g?h+s:s,rt=d.useRef(-1),ot=((Ae==null?void 0:Ae.enableFirefoxRescaling)??!1)&&ng.value,vt=((Ae==null?void 0:Ae.enableSafariRescaling)??!1)&&si.value;d.useLayoutEffect(()=>{window.devicePixelRatio!==1&&(ot||vt)&&(rt.current!==-1&&jt(!0),window.clearTimeout(rt.current),rt.current=window.setTimeout(()=>{jt(!1),rt.current=-1},200))},[a,bt,pt,Ft,ot,vt]);const Ue=function(L,le){return $t.useMemo(()=>L.map((ue,xe)=>({group:ue.group,grow:ue.grow,hasMenu:ue.hasMenu,icon:ue.icon,id:ue.id,menuIcon:ue.menuIcon,overlayIcon:ue.overlayIcon,sourceIndex:xe,sticky:xe<le,indicatorIcon:ue.indicatorIcon,style:ue.style,themeOverride:ue.themeOverride,title:ue.title,trailingRowOptions:ue.trailingRowOptions,width:ue.width,growOffset:ue.growOffset,rowMarker:ue.rowMarker,rowMarkerChecked:ue.rowMarkerChecked,headerRowMarkerTheme:ue.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:ue.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:ue.headerRowMarkerDisabled})),[L,le])}(i,R),it=d.useMemo(()=>B?Yr(Ue,ce):0,[Ue,ce,B]),tt=d.useCallback((L,le,ue)=>{const xe=L.getBoundingClientRect();if(le>=Ue.length||ue>=y)return;const de=xe.width/n,z=Qi(le,ue,n,r,h,mt,bt,a,pt,Ft,y,R,f,Ue,C);return de!==1&&(z.x*=de,z.y*=de,z.width*=de,z.height*=de),z.x+=xe.x,z.y+=xe.y,z},[n,r,h,mt,bt,a,pt,Ft,y,R,f,Ue,C]),Oe=d.useCallback((L,le,ue,xe)=>{const de=L.getBoundingClientRect(),z=de.width/n,Ie=(le-de.left)/z,Fe=(ue-de.top)/z,Ne=Ji(Ue,bt,n,void 0,pt);let Mt=0,De=0;xe instanceof MouseEvent&&(Mt=xe.button,De=xe.buttons);const Le=function(je,ht,gt){let yn=0;for(const an of ht){if(je<=(an.sticky?yn:yn+(gt??0))+an.width)return an.sourceIndex;yn+=an.width}return-1}(Ie,Ne,pt),Qe=function(je,ht,gt,yn,an,ar,Ht,hn,vi,Jr){const lr=yn+an;if(gt&&je<=an)return-2;if(je<=lr)return-1;let Ao=ht;for(let Gt=0;Gt<Jr;Gt++){const Dn=ar-1-Gt;if(Ao-=typeof Ht=="number"?Ht:Ht(Dn),je>=Ao)return Dn}const Fo=ar-Jr,Ct=je-(vi??0);if(typeof Ht=="number"){const Gt=Math.floor((Ct-lr)/Ht)+hn;return Gt>=Fo?void 0:Gt}{let Gt=lr;for(let Dn=hn;Dn<Fo;Dn++){const Lo=Ht(Dn);if(Ct<=Gt+Lo)return Dn;Gt+=Lo}return}}(Fe,r,g,s,h,y,C,a,Ft,f),dn=(xe==null?void 0:xe.shiftKey)===!0,en=(xe==null?void 0:xe.ctrlKey)===!0,br=(xe==null?void 0:xe.metaKey)===!0,ir=xe!==void 0&&!(xe instanceof MouseEvent)||(xe==null?void 0:xe.pointerType)==="touch",on=[Ie<0?-1:n<Ie?1:0,Fe<mt?-1:r<Fe?1:0];let Lt;if(Le===-1||Fe<0||Ie<0||Qe===void 0||Ie>n||Fe>r){const je=Ie>n?1:Ie<0?-1:0,ht=Fe>r?1:Fe<0?-1:0;let gt=2*je,yn=2*ht;je===0&&(gt=Le===-1?Vr.EndPadding:Vr.Center),ht===0&&(yn=Qe===void 0?Vr.EndPadding:Vr.Center);let an=!1;if(Le===-1&&Qe===-1){const Ht=tt(L,Ue.length-1,-1);Rn(Ht!==void 0),an=le<Ht.x+Ht.width+5}const ar=Ie>n&&Ie<n+Ki()||Fe>r&&Fe<r+Ki();Lt={kind:ui,location:[Le!==-1?Le:Ie<0?0:Ue.length-1,Qe??y-1],region:[gt,yn],shiftKey:dn,ctrlKey:en,metaKey:br,isEdge:an,isTouch:ir,button:Mt,buttons:De,scrollEdge:on,isMaybeScrollbar:ar}}else if(Qe<=-1){let je=tt(L,Le,Qe);Rn(je!==void 0);let ht=je!==void 0&&je.x+je.width-le<=5;const gt=Le-1;le-je.x<=5&&gt>=0?(ht=!0,je=tt(L,gt,Qe),Rn(je!==void 0),Lt={kind:g&&Qe===-2?Pn:pr,location:[gt,Qe],bounds:je,group:Ue[gt].group??"",isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ir,localEventX:le-je.x,localEventY:ue-je.y,button:Mt,buttons:De,scrollEdge:on}):Lt={kind:g&&Qe===-2?Pn:pr,group:Ue[Le].group??"",location:[Le,Qe],bounds:je,isEdge:ht,shiftKey:dn,ctrlKey:en,metaKey:br,isTouch:ir,localEventX:le-je.x,localEventY:ue-je.y,button:Mt,buttons:De,scrollEdge:on}}else{const je=tt(L,Le,Qe);Rn(je!==void 0);const ht=je!==void 0&&je.x+je.width-le<5;let gt=!1;if(c&&S.current!==void 0){const yn=Kc(S.current.range),an=tt(L,yn[0],yn[1]);if(an!==void 0){const ar=an.x+an.width-2,Ht=an.y+an.height-2;gt=Math.abs(ar-le)<6&&Math.abs(Ht-ue)<6}}Lt={kind:"cell",location:[Le,Qe],bounds:je,isEdge:ht,shiftKey:dn,ctrlKey:en,isFillHandle:gt,metaKey:br,isTouch:ir,localEventX:le-je.x,localEventY:ue-je.y,button:Mt,buttons:De,scrollEdge:on}}return Lt},[n,Ue,bt,pt,r,g,s,h,y,C,a,Ft,f,tt,c,S,mt]),[Nt]=Dt??[],gn=d.useRef(()=>{}),Zt=d.useRef(Dt);Zt.current=Dt;const[rn,Bt]=d.useMemo(()=>{const L=document.createElement("canvas"),le=document.createElement("canvas");return L.style.display="none",L.style.opacity="0",L.style.position="fixed",le.style.display="none",le.style.opacity="0",le.style.position="fixed",[L.getContext("2d",{alpha:!1}),le.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>{if(rn!==null&&Bt!==null)return document.documentElement.append(rn.canvas),document.documentElement.append(Bt.canvas),()=>{rn.canvas.remove(),Bt.canvas.remove()}},[rn,Bt]);const Xt=d.useMemo(()=>new y1,[]),Sn=ot&&un?1:vt&&un?2:5,Rt=(Ae==null?void 0:Ae.disableMinimumCellWidth)===!0?1:10,kn=d.useRef(),pn=d.useRef(null),kt=d.useRef(null),It=d.useCallback(()=>{var z;const L=Je.current,le=be.current;if(L===null||le===null||(pn.current===null&&(pn.current=L.getContext("2d",{alpha:!1}),L.width=0,L.height=0),kt.current===null&&(kt.current=le.getContext("2d",{alpha:!1}),le.width=0,le.height=0),pn.current===null||kt.current===null||rn===null||Bt===null))return;let ue=!1;const xe=kn.current,de={headerCanvasCtx:kt.current,canvasCtx:pn.current,bufferACtx:rn,bufferBCtx:Bt,width:n,height:r,cellXOffset:bt,cellYOffset:a,translateX:Math.round(pt),translateY:Math.round(Ft),mappedColumns:Ue,enableGroups:g,freezeColumns:R,dragAndDropState:ce,theme:me,headerHeight:s,groupHeaderHeight:h,disabledRows:Ze??yt.empty(),rowHeight:C,verticalBorder:Se,isResizing:Q,resizeCol:ae,isFocused:m,selection:S,fillHandle:c,drawCellCallback:ee,hasAppendRow:He,overrideCursor:Ie=>{ue=!0,st(Ie)},maxScaleFactor:Sn,freezeTrailingRows:f,rows:y,drawFocus:O,getCellContent:p,getGroupDetails:We??(Ie=>({name:Ie})),getRowThemeOverride:w,drawHeaderCallback:Pe,prelightCells:ye,highlightRegions:fe,imageLoader:Kt,lastBlitData:vr,damage:qt.current,hoverValues:Kn.current,hoverInfo:Zt.current,spriteManager:Ye,scrolling:un,hyperWrapping:(Ae==null?void 0:Ae.hyperWrapping)??!1,touchMode:xt,enqueue:gn.current,renderStateProvider:Xt,renderStrategy:(Ae==null?void 0:Ae.renderStrategy)??(si.value?"double-buffer":"single-buffer"),getCellRenderer:ut,minimumCellWidth:Rt,resizeIndicator:dt};de.damage===void 0?(kn.current=de,Uf(de,xe)):Uf(de,void 0),ue||de.damage!==void 0&&!de.damage.has((z=Zt==null?void 0:Zt.current)==null?void 0:z[0])||st(void 0)},[rn,Bt,n,r,bt,a,pt,Ft,Ue,g,R,ce,me,s,h,Ze,C,Se,Q,He,ae,m,S,c,f,y,O,Sn,p,We,w,ee,Pe,ye,fe,Kt,Ye,un,Ae==null?void 0:Ae.hyperWrapping,Ae==null?void 0:Ae.renderStrategy,xt,Xt,ut,Rt,dt]),Vt=d.useRef(It);d.useLayoutEffect(()=>{It(),Vt.current=It},[It]),d.useLayoutEffect(()=>{(async()=>{var L;((L=document==null?void 0:document.fonts)==null?void 0:L.ready)!==void 0&&(await document.fonts.ready,kn.current=void 0,Vt.current())})()},[]);const Et=d.useCallback(L=>{qt.current=L,Vt.current(),qt.current=void 0},[]),Tt=function(L){const le=d.useRef([]),ue=d.useRef(0),xe=d.useRef(L);xe.current=L;const de=d.useCallback(()=>{const z=()=>{const Ie=le.current.map(ta);le.current=[],xe.current(new bo(Ie)),le.current.length>0?ue.current++:ue.current=0};window.requestAnimationFrame(ue.current>600?()=>window.requestAnimationFrame(z):z)},[]);return d.useCallback(z=>{le.current.length===0&&de();const Ie=Ln(z[0],z[1]);le.current.includes(Ie)||le.current.push(Ie)},[de])}(Et);gn.current=Tt;const qe=d.useCallback(L=>{Et(new bo(L.map(le=>le.cell)))},[Et]);Kt.setCallback(Et);const[Jt,Mn]=d.useState(!1),[mn,wr]=Nt??[],Ro=mn!==void 0&&wr===-1&&i[mn].headerRowMarkerDisabled!==!0,Ca=mn!==void 0&&wr===-2;let Eo=!1,Io=!1,zr=wt;if(zr===void 0&&mn!==void 0&&wr!==void 0&&wr>-1&&wr<y){const L=p([mn,wr],!0);Eo=L.kind===Hn.NewRow||L.kind===Hn.Marker&&L.markerKind!=="number",Io=L.kind===pe.Boolean&&Bi(L),zr=L.cursor}const Ot=he?"grabbing":(_n??!1)||Q?"col-resize":Jt||b?"crosshair":zr!==void 0?zr:Ro||Eo||Io||Ca?"pointer":"default",vn=d.useMemo(()=>({contain:"strict",display:"block",cursor:Ot}),[Ot]),gi=d.useRef("default"),To=X==null?void 0:X.current;To!=null&&gi.current!==vn.cursor&&(To.style.cursor=gi.current=vn.cursor);const tr=d.useCallback((L,le,ue,xe)=>{if(We===void 0)return;const de=We(L);if(de.actions!==void 0){const z=yd(le,de.actions);for(const[Ie,Fe]of z.entries())if(Dr(Fe,ue+le.x,xe+Fe.y))return de.actions[Ie]}},[We]),nr=d.useCallback((L,le,ue,xe)=>{const de=Ue[le];if(!he&&!Q&&!_n){const z=tt(L,le,-1);Rn(z!==void 0);const Ie=bd(void 0,de,z.x,z.y,z.width,z.height,me,Yi(de.title)==="rtl");if(de.hasMenu===!0&&Ie.menuBounds!==void 0&&Dr(Ie.menuBounds,ue,xe))return{area:"menu",bounds:Ie.menuBounds};if(de.indicatorIcon!==void 0&&Ie.indicatorIconBounds!==void 0&&Dr(Ie.indicatorIconBounds,ue,xe))return{area:"indicator",bounds:Ie.indicatorIconBounds}}},[Ue,tt,_n,he,Q,me]),qr=d.useRef(0),rr=d.useRef(),yr=d.useRef(!1),or=d.useCallback(L=>{const le=Je.current,ue=X==null?void 0:X.current;if(le===null||L.target!==le&&L.target!==ue)return;let xe,de;if(yr.current=!0,L instanceof MouseEvent?(xe=L.clientX,de=L.clientY):(xe=L.touches[0].clientX,de=L.touches[0].clientY),L.target===ue&&ue!==null){const Ie=ue.getBoundingClientRect();if(xe>Ie.right||de>Ie.bottom)return}const z=Oe(le,xe,de,L);if(rr.current=z.location,z.isTouch&&(qr.current=Date.now()),Ve.current!==z.isTouch&&ve(z.isTouch),z.kind!==pr||nr(le,z.location[0],xe,de)===void 0){if(z.kind===Pn&&tr(z.group,z.bounds,z.localEventX,z.localEventY)!==void 0)return;T==null||T(z),!z.isTouch&&ze!==!0&&ze!==z.kind&&z.button<3&&z.button!==1&&L.preventDefault()}},[X,ze,Oe,tr,nr,T]);cn("touchstart",or,nn,!1),cn("mousedown",or,nn,!1);const Ar=d.useRef(0),pi=d.useCallback(L=>{var Le,Qe;const le=Ar.current;Ar.current=Date.now();const ue=Je.current;if(yr.current=!1,j===void 0||ue===null)return;const xe=X==null?void 0:X.current,de=L.target!==ue&&L.target!==xe;let z,Ie,Fe=!0;if(L instanceof MouseEvent){if(z=L.clientX,Ie=L.clientY,Fe=L.button<3,L.pointerType==="touch")return}else z=L.changedTouches[0].clientX,Ie=L.changedTouches[0].clientY;let Ne=Oe(ue,z,Ie,L);Ne.isTouch&&qr.current!==0&&Date.now()-qr.current>500&&(Ne={...Ne,isLongTouch:!0}),le!==0&&Date.now()-le<(Ne.isTouch?1e3:500)&&(Ne={...Ne,isDoubleClick:!0}),Ve.current!==Ne.isTouch&&ve(Ne.isTouch),!de&&L.cancelable&&Fe&&L.preventDefault();const[Mt]=Ne.location,De=nr(ue,Mt,z,Ie);if(Ne.kind!==pr||De===void 0){if(Ne.kind===Pn){const dn=tr(Ne.group,Ne.bounds,Ne.localEventX,Ne.localEventY);if(dn!==void 0)return void(Ne.button===0&&dn.onClick(Ne))}j(Ne,de)}else Ne.button===0&&((Le=rr.current)==null?void 0:Le[0])===Mt&&((Qe=rr.current)==null?void 0:Qe[1])===-1||j(Ne,!0)},[j,X,Oe,nr,tr]);cn("mouseup",pi,nn,!1),cn("touchend",pi,nn,!1),cn("click",d.useCallback(L=>{var Mt,De;const le=Je.current;if(le===null)return;const ue=X==null?void 0:X.current,xe=L.target!==le&&L.target!==ue;let de,z,Ie=!0;L instanceof MouseEvent?(de=L.clientX,z=L.clientY,Ie=L.button<3):(de=L.changedTouches[0].clientX,z=L.changedTouches[0].clientY);const Fe=Oe(le,de,z,L);Ve.current!==Fe.isTouch&&ve(Fe.isTouch),!xe&&L.cancelable&&Ie&&L.preventDefault();const[Ne]=Fe.location;if(Fe.kind===pr){const Le=nr(le,Ne,de,z);Le!==void 0&&Fe.button===0&&((Mt=rr.current)==null?void 0:Mt[0])===Ne&&((De=rr.current)==null?void 0:De[1])===-1&&(Le.area==="menu"?v==null||v(Ne,Le.bounds):Le.area==="indicator"&&(E==null||E(Ne,Le.bounds)))}else if(Fe.kind===Pn){const Le=tr(Fe.group,Fe.bounds,Fe.localEventX,Fe.localEventY);Le!==void 0&&Fe.button===0&&Le.onClick(Fe)}},[X,Oe,nr,v,E,tr]),nn,!1),cn("contextmenu",d.useCallback(L=>{const le=Je.current,ue=X==null?void 0:X.current;if(le===null||L.target!==le&&L.target!==ue||H===void 0)return;const xe=Oe(le,L.clientX,L.clientY,L);H(xe,()=>{L.cancelable&&L.preventDefault()})},[X,Oe,H]),(X==null?void 0:X.current)??null,!1);const Ho=d.useCallback(L=>{qt.current=new bo(L.map(le=>le.item)),Kn.current=L,Vt.current(),qt.current=void 0},[]),Xe=d.useMemo(()=>new eg(Ho),[Ho]),Oo=d.useRef(Xe);Oo.current=Xe,d.useLayoutEffect(()=>{const L=Oo.current;if(Nt===void 0||Nt[1]<0)return void L.setHovered(Nt);const le=p(Nt,!0),ue=ut(le),xe=ue===void 0&&le.kind===pe.Custom||(ue==null?void 0:ue.needsHover)!==void 0&&(typeof ue.needsHover=="boolean"?ue.needsHover:ue.needsHover(le));L.setHovered(xe?Nt:void 0)},[p,ut,Nt]);const mi=d.useRef();cn("mousemove",d.useCallback(L=>{var Fe;const le=Je.current;if(le===null)return;const ue=X==null?void 0:X.current,xe=L.target!==le&&L.target!==ue,de=Oe(le,L.clientX,L.clientY,L);if(de.kind!=="out-of-bounds"&&xe&&!yr.current&&!de.isTouch)return;const z=(Ne,Mt)=>{er(De=>De===Ne?De:(De==null?void 0:De[0][0])!==(Ne==null?void 0:Ne[0][0])||(De==null?void 0:De[0][1])!==(Ne==null?void 0:Ne[0][1])||((De==null?void 0:De[1][0])!==(Ne==null?void 0:Ne[1][0])||(De==null?void 0:De[1][1])!==(Ne==null?void 0:Ne[1][1]))&&Mt?Ne:De)};if(qf(de,mi.current)){if(de.kind==="cell"||de.kind===pr||de.kind===Pn){let Ne=!1,Mt=!0;if(de.kind==="cell"){const Le=p(de.location);Mt=((Fe=ut(Le))==null?void 0:Fe.needsHoverPosition)??Le.kind===pe.Custom,Ne=Mt}else Ne=!0;const De=[de.location,[de.localEventX,de.localEventY]];z(De,Mt),Zt.current=De,Ne&&Et(new bo([de.location]))}}else st(void 0),J==null||J(de),z(de.kind===ui?void 0:[de.location,[de.localEventX,de.localEventY]],!0),mi.current=de;const Ie=de.location[0]>=(se?0:1);re(de.kind===pr&&de.isEdge&&Ie&&$e===!0),Mn(de.kind==="cell"&&de.isFillHandle),U==null||U(L),te(de)},[X,Oe,se,$e,U,te,J,p,ut,Et]),nn,!0);const jn=d.useCallback(L=>{const le=Je.current;if(le===null)return;let ue,xe;S.current!==void 0&&(ue=tt(le,S.current.cell[0],S.current.cell[1]),xe=S.current.cell),q==null||q({bounds:ue,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:xe})},[q,S,tt]),Sa=d.useCallback(L=>{const le=Je.current;if(le===null)return;let ue,xe;S.current!==void 0&&(ue=tt(le,S.current.cell[0],S.current.cell[1]),xe=S.current.cell),Z==null||Z({bounds:ue,stopPropagation:()=>L.stopPropagation(),preventDefault:()=>L.preventDefault(),cancel:()=>{},ctrlKey:L.ctrlKey,metaKey:L.metaKey,shiftKey:L.shiftKey,altKey:L.altKey,key:L.key,keyCode:L.keyCode,rawEvent:L,location:xe})},[Z,S,tt]),Vn=d.useCallback(L=>{if(Je.current=L,N!==void 0&&(N.current=L),Ae==null?void 0:Ae.eventTarget)Yt.current=Ae.eventTarget;else if(L===null)Yt.current=window;else{const le=L.getRootNode();le===document&&(Yt.current=window),Yt.current=le}},[N,Ae==null?void 0:Ae.eventTarget]);cn("dragstart",d.useCallback(L=>{const le=Je.current;if(le===null||ze===!1||Q)return void L.preventDefault();let ue,xe;const de=Oe(le,L.clientX,L.clientY);if(ze!==!0&&de.kind!==ze)return void L.preventDefault();let z,Ie,Fe,Ne=!1;if(K==null||K({...de,setData:(Mt,De)=>{ue=Mt,xe=De},setDragImage:(Mt,De,Le)=>{z=Mt,Ie=De,Fe=Le},preventDefault:()=>Ne=!0,defaultPrevented:()=>Ne}),Ne||ue===void 0||xe===void 0||L.dataTransfer===null)L.preventDefault();else if(L.dataTransfer.setData(ue,xe),L.dataTransfer.effectAllowed="copyLink",z!==void 0&&Ie!==void 0&&Fe!==void 0)L.dataTransfer.setDragImage(z,Ie,Fe);else{const[Mt,De]=de.location;if(De!==void 0){const Le=document.createElement("canvas"),Qe=tt(le,Mt,De);Rn(Qe!==void 0);const dn=Math.ceil(window.devicePixelRatio??1);Le.width=Qe.width*dn,Le.height=Qe.height*dn;const en=Le.getContext("2d");en!==null&&(en.scale(dn,dn),en.textBaseline="middle",De===-1?(en.font=me.headerFontFull,en.fillStyle=me.bgHeader,en.fillRect(0,0,Le.width,Le.height),Cd(en,0,0,Qe.width,Qe.height,Ue[Mt],!1,me,!1,void 0,void 0,!1,0,Ye,Pe,!1)):(en.font=me.baseFontFull,en.fillStyle=me.bgCell,en.fillRect(0,0,Le.width,Le.height),wd(en,p([Mt,De]),0,De,!1,!1,0,0,Qe.width,Qe.height,!1,me,me.bgCell,Kt,Ye,1,void 0,!1,0,void 0,void 0,void 0,Xt,ut,()=>{}))),Le.style.left="-100%",Le.style.position="absolute",Le.style.width=`${Qe.width}px`,Le.style.height=`${Qe.height}px`,document.body.append(Le),L.dataTransfer.setDragImage(Le,Qe.width/2,Qe.height/2),window.setTimeout(()=>{Le.remove()},0)}}},[ze,Q,Oe,K,tt,me,Ue,Ye,Pe,p,Kt,Xt,ut]),(X==null?void 0:X.current)??null,!1,!1);const Fr=d.useRef();cn("dragover",d.useCallback(L=>{const le=Je.current;if(Re!==void 0&&L.preventDefault(),le===null||Ge===void 0)return;const ue=Oe(le,L.clientX,L.clientY),[xe,de]=ue.location,z=xe-(se?0:1),[Ie,Fe]=Fr.current??[];Ie===z&&Fe===de||(Fr.current=[z,de],Ge([z,de],L.dataTransfer))},[se,Oe,Ge,Re]),(X==null?void 0:X.current)??null,!1,!1),cn("dragend",d.useCallback(()=>{Fr.current=void 0,ne==null||ne()},[ne]),(X==null?void 0:X.current)??null,!1,!1),cn("drop",d.useCallback(L=>{const le=Je.current;if(le===null||Re===void 0)return;L.preventDefault();const ue=Oe(le,L.clientX,L.clientY),[xe,de]=ue.location;Re([xe-(se?0:1),de],L.dataTransfer)},[se,Oe,Re]),(X==null?void 0:X.current)??null,!1,!1),cn("dragleave",d.useCallback(()=>{nt==null||nt()},[nt]),(X==null?void 0:X.current)??null,!1,!1);const Po=d.useRef(S);Po.current=S;const Lr=d.useRef(null),Do=d.useCallback(L=>{var le;Je.current!==null&&Je.current.contains(document.activeElement)&&(L===null&&Po.current.current!==void 0?(le=N==null?void 0:N.current)==null||le.focus({preventScroll:!0}):L!==null&&L.focus({preventScroll:!0}),Lr.current=L)},[N]);d.useImperativeHandle(t,()=>({focus:()=>{var le;const L=Lr.current;L!==null&&document.contains(L)?L.focus({preventScroll:!0}):(le=N==null?void 0:N.current)==null||le.focus({preventScroll:!0})},getBounds:(L,le)=>{if(N!==void 0&&N.current!==null)return tt(N.current,L??0,le??-1)},damage:qe,getMouseArgsForPosition:(L,le,ue)=>{if(N!==void 0&&N.current!==null)return Oe(N.current,L,le,ue)}}),[N,qe,tt]);const zo=d.useRef(),Un=function(L,le,ue){const[xe,de]=d.useState(L),z=d.useRef(!0);d.useEffect(()=>()=>{z.current=!1},[]);const Ie=d.useRef(Fc(Fe=>{z.current&&de(Fe)},ue));return d.useLayoutEffect(()=>{z.current&&Ie.current(()=>L())},le),xe}(()=>{var Fe,Ne,Mt;if(n<50||(Ae==null?void 0:Ae.disableAccessibilityTree)===!0)return null;let L=Ji(Ue,bt,n,ce,pt);const le=se?0:-1;se||((Fe=L[0])==null?void 0:Fe.sourceIndex)!==0||(L=L.slice(1));const[ue,xe]=((Ne=S.current)==null?void 0:Ne.cell)??[],de=(Mt=S.current)==null?void 0:Mt.range,z=L.map(De=>De.sourceIndex),Ie=Pr(a,Math.min(y,a+o));return ue===void 0||xe===void 0||z.includes(ue)&&Ie.includes(xe)||Do(null),d.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":y+1,"aria-multiselectable":"true","aria-colcount":Ue.length+le},d.createElement("thead",{role:"rowgroup"},d.createElement("tr",{role:"row","aria-rowindex":1},L.map(De=>d.createElement("th",{role:"columnheader","aria-selected":S.columns.hasIndex(De.sourceIndex),"aria-colindex":De.sourceIndex+1+le,tabIndex:-1,onFocus:Le=>{if(Le.target!==Lr.current)return ke==null?void 0:ke([De.sourceIndex,-1])},key:De.sourceIndex},De.title)))),d.createElement("tbody",{role:"rowgroup"},Ie.map(De=>d.createElement("tr",{role:"row","aria-selected":S.rows.hasIndex(De),key:De,"aria-rowindex":De+2},L.map(Le=>{const Qe=Le.sourceIndex,dn=Ln(Qe,De),en=ue===Qe&&xe===De,br=de!==void 0&&Qe>=de.x&&Qe<de.x+de.width&&De>=de.y&&De<de.y+de.height,ir=`glide-cell-${Qe}-${De}`,on=[Qe,De],Lt=p(on,!0);return d.createElement("td",{key:dn,role:"gridcell","aria-colindex":Qe+1+le,"aria-selected":br,"aria-readonly":kr(Lt)||!so(Lt),id:ir,"data-testid":ir,onClick:()=>{const je=N==null?void 0:N.current;if(je!=null)return q==null?void 0:q({bounds:tt(je,Qe,De),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:on})},onFocusCapture:je=>{var ht,gt;if(je.target!==Lr.current&&(((ht=zo.current)==null?void 0:ht[0])!==Qe||((gt=zo.current)==null?void 0:gt[1])!==De))return zo.current=on,ke==null?void 0:ke(on)},ref:en?Do:void 0,tabIndex:-1},((je,ht)=>{if(je.kind===pe.Custom)return je.copyData;const gt=ht==null?void 0:ht(je);return(gt==null?void 0:gt.getAccessibilityString(je))??""})(Lt,ut))})))))},[n,Ue,bt,ce,pt,y,a,o,S,Do,p,N,q,tt,ke],200),Nn=R!==0&&B?bt>R?1:On(-pt/100,0,1):0,wn=D?On(-(32*-a+Ft)/100,0,1):0,V=d.useMemo(()=>{if(!Nn&&!wn)return null;const L={position:"absolute",top:0,left:it,width:n-it,height:r,opacity:Nn,pointerEvents:"none",transition:ct?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},le={position:"absolute",top:mt,left:0,width:n,height:r,opacity:wn,pointerEvents:"none",transition:Ee?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return d.createElement(d.Fragment,null,Nn>0&&d.createElement("div",{id:"shadow-x",style:L}),wn>0&&d.createElement("div",{id:"shadow-y",style:le}))},[Nn,wn,it,n,ct,mt,r,Ee]),Wt=d.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return d.createElement(d.Fragment,null,d.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:jn,onKeyUp:Sa,onFocus:x,onBlur:I,ref:Vn,style:vn},Un),d.createElement("canvas",{ref:be,style:Wt}),V)}));function Mo(e,t,n,r){return On(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(r))}const og=e=>{const[t,n]=d.useState(),[r,o]=d.useState(),[i,l]=d.useState(),[a,s]=d.useState(),[c,h]=d.useState(!1),[C,y]=d.useState(),[p,w]=d.useState(),[v,E]=d.useState(),[g,b]=d.useState(!1),[x,I]=d.useState(),{onHeaderMenuClick:m,onHeaderIndicatorClick:S,getCellContent:R,onColumnMoved:H,onColumnResize:f,onColumnResizeStart:B,onColumnResizeEnd:D,gridRef:O,maxColumnWidth:T,minColumnWidth:j,onRowMoved:U,lockColumns:te,onColumnProposeMove:J,onMouseDown:ce,onMouseUp:se,onItemHovered:q,onDragStart:Z,canvasRef:fe}=e,N=(f??D??B)!==void 0,{columns:K,selection:ne}=e,X=ne.columns,Q=d.useCallback(ee=>{const[Pe,ke]=ee.location;i!==void 0&&a!==Pe&&Pe>=te?(h(!0),s(Pe)):p!==void 0&&ke!==void 0?(b(!0),E(Math.max(0,ke))):r!==void 0||c||g||(q==null||q(ee))},[i,p,a,q,te,r,c,g]),ae=H!==void 0,he=d.useCallback(ee=>{var Pe;if(ee.button===0){const[ke,Ge]=ee.location;if(ee.kind==="out-of-bounds"&&ee.isEdge&&N){const Re=(Pe=O==null?void 0:O.current)==null?void 0:Pe.getBounds(K.length-1,-1);Re!==void 0&&(n(Re.x),o(K.length-1))}else if(ee.kind==="header"&&ke>=te){const Re=fe==null?void 0:fe.current;if(ee.isEdge&&N&&Re){n(ee.bounds.x),o(ke);const nt=Re.getBoundingClientRect().width/Re.offsetWidth,Ke=ee.bounds.width/nt;B==null||B(K[ke],Ke,ke,Ke+(K[ke].growOffset??0))}else ee.kind==="header"&&ae&&(y(ee.bounds.x),l(ke))}else ee.kind==="cell"&&te>0&&ke===0&&Ge!==void 0&&U!==void 0&&(I(ee.bounds.y),w(Ge))}ce==null||ce(ee)},[ce,N,te,U,O,K,ae,B,fe]),ze=d.useCallback((ee,Pe)=>{c||g||(m==null||m(ee,Pe))},[c,g,m]),$e=d.useCallback((ee,Pe)=>{c||g||(S==null||S(ee,Pe))},[c,g,S]),Ze=d.useRef(-1),He=d.useCallback(()=>{Ze.current=-1,w(void 0),E(void 0),I(void 0),b(!1),l(void 0),s(void 0),y(void 0),h(!1),o(void 0),n(void 0)},[]),We=d.useCallback((ee,Pe)=>{if(ee.button===0){if(r!==void 0){if((X==null?void 0:X.hasIndex(r))===!0)for(const Ge of X){if(Ge===r)continue;const Re=K[Ge],nt=Mo(Re,Ze.current,j,T);f==null||f(Re,nt,Ge,nt+(Re.growOffset??0))}const ke=Mo(K[r],Ze.current,j,T);if(D==null||D(K[r],ke,r,ke+(K[r].growOffset??0)),X.hasIndex(r))for(const Ge of X){if(Ge===r)continue;const Re=K[Ge],nt=Mo(Re,Ze.current,j,T);D==null||D(Re,nt,Ge,nt+(Re.growOffset??0))}}He(),i!==void 0&&a!==void 0&&(J==null?void 0:J(i,a))!==!1&&(H==null||H(i,a)),p!==void 0&&v!==void 0&&(U==null||U(p,v))}se==null||se(ee,Pe)},[se,r,i,a,p,v,X,D,K,j,T,f,H,U,He,J]),me=d.useMemo(()=>{if(i!==void 0&&a!==void 0&&i!==a&&(J==null?void 0:J(i,a))!==!1)return{src:i,dest:a}},[i,a,J]),ye=d.useCallback(ee=>{const Pe=fe==null?void 0:fe.current;if(i!==void 0&&C!==void 0)Math.abs(ee.clientX-C)>20&&h(!0);else if(p!==void 0&&x!==void 0)Math.abs(ee.clientY-x)>20&&b(!0);else if(r!==void 0&&t!==void 0&&Pe){const ke=Pe.getBoundingClientRect().width/Pe.offsetWidth,Ge=(ee.clientX-t)/ke,Re=K[r],nt=Mo(Re,Ge,j,T);if(f==null||f(Re,nt,r,nt+(Re.growOffset??0)),Ze.current=Ge,(X==null?void 0:X.first())===r)for(const Ke of X){if(Ke===r)continue;const ct=K[Ke],Ee=Mo(ct,Ze.current,j,T);f==null||f(ct,Ee,Ke,Ee+(ct.growOffset??0))}}},[i,C,p,x,r,t,K,j,T,f,X,fe]),Me=d.useCallback((ee,Pe)=>{if(p===void 0||v===void 0)return R(ee,Pe);let[ke,Ge]=ee;return Ge===v?Ge=p:(Ge>v&&(Ge-=1),Ge>=p&&(Ge+=1)),R([ke,Ge],Pe)},[p,v,R]),Se=d.useCallback(ee=>{Z==null||Z(ee),ee.defaultPrevented()||He()},[He,Z]);return d.createElement(rg,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:r,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Me,isResizing:r!==void 0,onHeaderMenuClick:ze,onHeaderIndicatorClick:$e,isDragging:c,onItemHovered:Q,onDragStart:Se,onMouseDown:he,allowResize:N,onMouseUp:We,dragAndDropState:me,onMouseMoveRaw:ye,ref:O})},ig=Cn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[e=>e.isSafari?"scroll":"auto"]}}),ag=e=>{var ne,X;const{children:t,clientHeight:n,scrollHeight:r,scrollWidth:o,update:i,draggable:l,className:a,preventDiagonalScrolling:s=!1,paddingBottom:c=0,paddingRight:h=0,rightElement:C,rightElementProps:y,kineticScrollPerfHack:p=!1,scrollRef:w,initialSize:v}=e,E=[],g=(y==null?void 0:y.sticky)??!1,b=(y==null?void 0:y.fill)??!1,x=d.useRef(0),I=d.useRef(0),m=d.useRef(null),S=typeof window>"u"?1:window.devicePixelRatio,R=d.useRef(S);d.useEffect(()=>{if(R.current!==S){x.current=0,I.current=0,R.current=S;const Q=m.current;Q!==null&&U.current(Q.scrollLeft,Q.scrollTop)}},[S]);const H=d.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),f=d.useRef(null),B=function(Q){const[ae,he]=d.useState(!1),ze=typeof window>"u"?null:window,$e=d.useRef(0);return cn("touchstart",d.useCallback(()=>{window.clearTimeout($e.current),he(!0)},[]),ze,!0,!1),cn("touchend",d.useCallback(Ze=>{Ze.touches.length===0&&($e.current=window.setTimeout(()=>he(!1),Q))},[Q]),ze,!0,!1),ae}(200),[D,O]=d.useState(!0),T=d.useRef(0);d.useLayoutEffect(()=>{if(!D||B||H.current.lockDirection===void 0)return;const Q=m.current;if(Q===null)return;const[ae,he]=H.current.lockDirection;ae!==void 0?Q.scrollLeft=ae:he!==void 0&&(Q.scrollTop=he),H.current.lockDirection=void 0},[B,D]);const j=d.useCallback((Q,ae)=>{var ke;const he=m.current;if(he===null)return;ae=ae??he.scrollTop,Q=Q??he.scrollLeft;const ze=H.current.scrollTop,$e=H.current.scrollLeft,Ze=Q-$e,He=ae-ze;B&&Ze!==0&&He!==0&&(Math.abs(Ze)>3||Math.abs(He)>3)&&s&&H.current.lockDirection===void 0&&(H.current.lockDirection=Math.abs(Ze)<Math.abs(He)?[$e,void 0]:[void 0,ze]);const We=H.current.lockDirection;Q=(We==null?void 0:We[0])??Q,ae=(We==null?void 0:We[1])??ae,H.current.scrollLeft=Q,H.current.scrollTop=ae;const me=he.clientWidth,ye=he.clientHeight,Me=ae,Se=I.current-Me,ee=he.scrollHeight-ye;let Pe;I.current=Me,ee>0&&r>he.scrollHeight+5?Math.abs(Se)>2e3||Me===0||Me===ee?(Pe=Math.max(0,Math.min(1,Me/ee))*(r-ye),x.current=Pe):(x.current-=Se,Pe=x.current):(Pe=Me,x.current=Pe),Pe=Math.max(0,Math.min(Pe,r-ye)),x.current=Pe,We!==void 0&&(window.clearTimeout(T.current),O(!1),T.current=window.setTimeout(()=>O(!0),200)),i({x:Q,y:Pe,width:me-h,height:ye-c,paddingRight:((ke=f.current)==null?void 0:ke.clientWidth)??0})},[c,h,r,i,s,B]);((Q,ae,he)=>{const ze=d.useRef(null),$e=d.useRef(null),Ze=d.useRef(null),He=d.useRef(0),We=d.useRef(ae);We.current=ae;const me=he.current;d.useEffect(()=>{const ye=()=>{var ee,Pe;if($e.current===!1&&me!==null){const ke=[me.scrollLeft,me.scrollTop];if(((ee=Ze.current)==null?void 0:ee[0])===ke[0]&&((Pe=Ze.current)==null?void 0:Pe[1])===ke[1]){if(He.current>10)return Ze.current=null,void($e.current=null);He.current++}else He.current=0,We.current(ke[0],ke[1]),Ze.current=ke;ze.current=window.setTimeout(ye,8.333333333333334)}},Me=()=>{$e.current=!0,Ze.current=null,ze.current!==null&&(window.clearTimeout(ze.current),ze.current=null)},Se=ee=>{ee.touches.length===0&&($e.current=!1,He.current=0,ze.current=window.setTimeout(ye,8.333333333333334))};if(Q&&me!==null){const ee=me;return ee.addEventListener("touchstart",Me),ee.addEventListener("touchend",Se),()=>{ee.removeEventListener("touchstart",Me),ee.removeEventListener("touchend",Se),ze.current!==null&&window.clearTimeout(ze.current)}}},[Q,me])})(p&&si.value,j,m);const U=d.useRef(j);U.current=j;const te=d.useRef(),J=d.useRef(!1);d.useLayoutEffect(()=>{J.current?j():J.current=!0},[j,c,h]);const ce=d.useCallback(Q=>{m.current=Q,w!==void 0&&(w.current=Q)},[w]);let se=0,q=0;const Z=Math.min(r,33554400);for(E.push(d.createElement("div",{key:se++,style:{width:o,height:0}}));q<Z;){const Q=Math.min(5e6,Z-q);E.push(d.createElement("div",{key:se++,style:{width:0,height:Q}})),q+=Q}const{ref:fe,width:N,height:K}=function(Q){const ae=d.useRef(null),[he,ze]=d.useState({width:Q==null?void 0:Q[0],height:Q==null?void 0:Q[1]});return d.useLayoutEffect(()=>{const $e=new window.ResizeObserver(Ze=>{for(const He of Ze){const{width:We,height:me}=He&&He.contentRect||{};ze(ye=>ye.width===We&&ye.height===me?ye:{width:We,height:me})}});return ae.current&&$e.observe(ae.current,void 0),()=>{$e.disconnect()}},[ae.current]),{ref:ae,...he}}(v);return typeof window>"u"||((ne=te.current)==null?void 0:ne.height)===K&&((X=te.current)==null?void 0:X.width)===N||(window.setTimeout(()=>U.current(),0),te.current={width:N,height:K}),(N??0)===0||(K??0)===0?d.createElement("div",{ref:fe}):d.createElement("div",{ref:fe},d.createElement(ig,{isSafari:si.value},d.createElement("div",{className:"dvn-underlay"},t),d.createElement("div",{ref:ce,style:te.current,draggable:l,onDragStart:Q=>{l||(Q.stopPropagation(),Q.preventDefault())},className:"dvn-scroller "+(a??""),onScroll:()=>j()},d.createElement("div",{className:"dvn-scroll-inner"+(C===void 0?" dvn-hidden":"")},d.createElement("div",{className:"dvn-stack"},E),C!==void 0&&d.createElement(d.Fragment,null,!b&&d.createElement("div",{className:"dvn-spacer"}),d.createElement("div",{ref:f,style:{height:K,maxHeight:n-Math.ceil(S%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:h,flexGrow:b?1:void 0,right:g?h??0:void 0,pointerEvents:"auto"}},C))))))},lg=e=>{const{columns:t,rows:n,rowHeight:r,headerHeight:o,groupHeaderHeight:i,enableGroups:l,freezeColumns:a,experimental:s,nonGrowWidth:c,clientSize:h,className:C,onVisibleRegionChanged:y,scrollRef:p,preventDiagonalScrolling:w,rightElement:v,rightElementProps:E,overscrollX:g,overscrollY:b,initialSize:x,smoothScrollX:I=!1,smoothScrollY:m=!1,isDraggable:S}=e,{paddingRight:R,paddingBottom:H}=s??{},[f,B]=h,D=d.useRef(),O=d.useRef(),T=d.useRef(),j=d.useRef(),U=c+Math.max(0,g??0);let te=l?o+i:o;if(typeof r=="number")te+=n*r;else for(let q=0;q<n;q++)te+=r(q);b!==void 0&&(te+=b);const J=d.useRef(),ce=d.useCallback(()=>{var $e,Ze;if(J.current===void 0)return;const q={...J.current};let Z=0,fe=q.x<0?-q.x:0,N=0,K=0;q.x=q.x<0?0:q.x;let ne=0;for(let He=0;He<a;He++)ne+=t[He].width;for(const He of t){const We=Z-ne;if(q.x>=We+He.width)Z+=He.width,K++,N++;else if(q.x>We)Z+=He.width,I?fe+=We-q.x:K++,N++;else{if(!(q.x+q.width>We))break;Z+=He.width,N++}}let X=0,Q=0,ae=0;if(typeof r=="number")m?(Q=Math.floor(q.y/r),X=Q*r-q.y):Q=Math.ceil(q.y/r),ae=Math.ceil(q.height/r)+Q,X<0&&ae++;else{let He=0;for(let We=0;We<n;We++){const me=r(We),ye=He+(m?0:me/2);if(q.y>=He+me)He+=me,Q++,ae++;else if(q.y>ye)He+=me,m?X+=ye-q.y:Q++,ae++;else{if(!(q.y+q.height>me/2+He))break;He+=me,ae++}}}Q=Math.max(0,Math.min(Q,n-1)),ae=Math.max(Q,Math.min(ae,n));const he={x:K,y:Q,width:N-K,height:ae-Q},ze=D.current;ze!==void 0&&ze.y===he.y&&ze.x===he.x&&ze.height===he.height&&ze.width===he.width&&O.current===fe&&T.current===X&&q.width===(($e=j.current)==null?void 0:$e[0])&&q.height===((Ze=j.current)==null?void 0:Ze[1])||(y==null||y({x:K,y:Q,width:N-K,height:ae-Q},q.width,q.height,q.paddingRight??0,fe,X),D.current=he,O.current=fe,T.current=X,j.current=[q.width,q.height])},[t,r,n,y,a,I,m]),se=d.useCallback(q=>{J.current=q,ce()},[ce]);return d.useEffect(()=>{ce()},[ce]),d.createElement(ag,{scrollRef:p,className:C,kineticScrollPerfHack:s==null?void 0:s.kineticScrollPerfHack,preventDiagonalScrolling:w,draggable:S===!0||typeof S=="string",scrollWidth:U+(R??0),scrollHeight:te+(H??0),clientHeight:B,rightElement:v,paddingBottom:H,paddingRight:R,rightElementProps:E,update:se,initialSize:x},d.createElement(og,{eventTargetRef:p,width:f,height:B,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},sg=Cn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),cg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),ug=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),dg=d.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},d.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),hg=e=>{const{canvasRef:t,cellYOffset:n,rows:r,columns:o,searchInputRef:i,searchValue:l,searchResults:a,onSearchValueChange:s,getCellsForSelection:c,onSearchResultsChanged:h,showSearch:C=!1,onSearchClose:y}=e,[p]=d.useState(()=>"search-box-"+Math.round(1e3*Math.random())),[w,v]=d.useState(""),E=l??w,g=d.useCallback(Z=>{v(Z),s==null||s(Z)},[s]),[b,x]=d.useState(),I=d.useRef(b);I.current=b,d.useEffect(()=>{a!==void 0&&(a.length>0?x(Z=>({rowsSearched:r,results:a.length,selectedIndex:(Z==null?void 0:Z.selectedIndex)??-1})):x(void 0))},[r,a]);const m=d.useRef();m.current===void 0&&(m.current=new AbortController);const S=d.useRef(),[R,H]=d.useState([]),f=a??R,B=d.useCallback(()=>{S.current!==void 0&&(window.cancelAnimationFrame(S.current),S.current=void 0,m.current.abort())},[]),D=d.useRef(n);D.current=n;const O=d.useCallback(Z=>{const fe=new RegExp(Z.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let N=D.current,K=Math.min(10,r),ne=0;x(void 0),H([]);const X=[],Q=async()=>{var ye;if(c===void 0)return;const ae=performance.now(),he=r-ne;let ze=c({x:0,y:N,width:o.length,height:Math.min(K,he,r-N)},m.current.signal);typeof ze=="function"&&(ze=await ze());let $e=!1;for(const[Me,Se]of ze.entries())for(const[ee,Pe]of Se.entries()){let ke;switch(Pe.kind){case pe.Text:case pe.Number:ke=Pe.displayData;break;case pe.Uri:case pe.Markdown:ke=Pe.data;break;case pe.Boolean:ke=typeof Pe.data=="boolean"?Pe.data.toString():void 0;break;case pe.Image:case pe.Bubble:ke=Pe.data.join("\u{1F433}");break;case pe.Custom:ke=Pe.copyData}ke!==void 0&&fe.test(ke)&&(X.push([ee,Me+N]),$e=!0)}const Ze=performance.now();$e&&H([...X]),ne+=ze.length,Rn(ne<=r);const He=((ye=I.current)==null?void 0:ye.selectedIndex)??-1;x({results:X.length,rowsSearched:ne,selectedIndex:He}),h==null||h(X,He),N+K>=r?N=0:N+=K;const We=Ze-ae,me=10/Math.max(We,1);K=Math.ceil(K*me),ne<r&&X.length<1e3&&(S.current=window.requestAnimationFrame(Q))};B(),S.current=window.requestAnimationFrame(Q)},[B,o.length,c,h,r]),T=d.useCallback(()=>{var Z;y==null||y(),x(void 0),H([]),h==null||h([],-1),B(),(Z=t==null?void 0:t.current)==null||Z.focus()},[B,t,y,h]),j=d.useCallback(Z=>{g(Z.target.value),a===void 0&&(Z.target.value===""?(x(void 0),H([]),B()):O(Z.target.value))},[O,B,g,a]);d.useEffect(()=>{C&&i.current!==null&&(g(""),i.current.focus({preventScroll:!0}))},[C,i,g]);const U=d.useCallback(Z=>{var N;if((N=Z==null?void 0:Z.stopPropagation)==null||N.call(Z),b===void 0)return;const fe=(b.selectedIndex+1)%b.results;x({...b,selectedIndex:fe}),h==null||h(f,fe)},[b,h,f]),te=d.useCallback(Z=>{var N;if((N=Z==null?void 0:Z.stopPropagation)==null||N.call(Z),b===void 0)return;let fe=(b.selectedIndex-1)%b.results;fe<0&&(fe+=b.results),x({...b,selectedIndex:fe}),h==null||h(f,fe)},[h,f,b]),J=d.useCallback(Z=>{(Z.ctrlKey||Z.metaKey)&&Z.nativeEvent.code==="KeyF"||Z.key==="Escape"?(T(),Z.stopPropagation(),Z.preventDefault()):Z.key==="Enter"&&(Z.shiftKey?te():U())},[T,U,te]);d.useEffect(()=>()=>{B()},[B]);const[ce,se]=d.useState(!1);d.useEffect(()=>{if(!C){const Z=setTimeout(()=>se(!1),150);return()=>clearTimeout(Z)}se(!0)},[C]);const q=d.useMemo(()=>{if(!C&&!ce)return null;let Z;b!==void 0&&(Z=b.results>=1e3?"over 1000":`${b.results} result${b.results!==1?"s":""}`,b.selectedIndex>=0&&(Z=`${b.selectedIndex+1} of ${Z}`));const fe=K=>{K.stopPropagation()},N={width:`${Math.floor(((b==null?void 0:b.rowsSearched)??0)/r*100)}%`};return d.createElement(sg,{className:"gdg-search-bar"+(C?"":" out"),onMouseDown:fe,onMouseMove:fe,onMouseUp:fe,onClick:fe},d.createElement("div",{className:"gdg-search-bar-inner"},d.createElement("input",{id:p,"aria-hidden":!C,"data-testid":"search-input",ref:i,onChange:j,value:E,tabIndex:C?void 0:-1,onKeyDownCapture:J}),d.createElement("button",{type:"button","aria-label":"Previous Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:te,disabled:((b==null?void 0:b.results)??0)===0},cg),d.createElement("button",{type:"button","aria-label":"Next Result","aria-hidden":!C,tabIndex:C?void 0:-1,onClick:U,disabled:((b==null?void 0:b.results)??0)===0},ug),y!==void 0&&d.createElement("button",{type:"button","aria-label":"Close Search","aria-hidden":!C,"data-testid":"search-close-button",tabIndex:C?void 0:-1,onClick:T},dg)),b!==void 0?d.createElement(d.Fragment,null,d.createElement("div",{className:"gdg-search-status"},d.createElement("div",{"data-testid":"search-result-area"},Z)),d.createElement("div",{className:"gdg-search-progress",style:N})):d.createElement("div",{className:"gdg-search-status"},d.createElement("label",{htmlFor:p},"Type to search")))},[C,ce,b,r,p,i,j,E,J,te,U,y,T]);return d.createElement(d.Fragment,null,d.createElement(lg,{prelightCells:f,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),q)};Ba=class extends d.PureComponent{constructor(){super(...arguments);ft(this,"wrapperRef",d.createRef());ft(this,"clickOutside",t=>{if((!this.props.isOutsideClick||this.props.isOutsideClick(t))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(t.target)){let n=t.target;for(;n!==null;){if(n.classList.contains("click-outside-ignore"))return;n=n.parentElement}this.props.onClickOutside()}})}componentDidMount(){const t=this.props.customEventTarget??document;t.addEventListener("touchend",this.clickOutside,!0),t.addEventListener("mousedown",this.clickOutside,!0),t.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){const t=this.props.customEventTarget??document;t.removeEventListener("touchend",this.clickOutside,!0),t.removeEventListener("mousedown",this.clickOutside,!0),t.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:t,isOutsideClick:n,customEventTarget:r,...o}=this.props;return d.createElement("div",{...o,ref:this.wrapperRef},this.props.children)}};const fg=Cn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[e=>Math.max(16,e.targetHeight-10),"px"]}}),gg=e=>{const{bounds:t,group:n,onClose:r,canvasBounds:o,onFinish:i}=e,[l,a]=$t.useState(n);return $t.createElement(Ba,{style:{position:"absolute",left:t.x-o.left+1,top:t.y-o.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:r},$t.createElement(fg,{targetHeight:t.height,"data-testid":"group-rename-input",value:l,onBlur:r,onFocus:s=>s.target.setSelectionRange(0,l.length),onChange:s=>a(s.target.value),onKeyDown:s=>{s.key==="Enter"?i(l):s.key==="Escape"&&r()},autoFocus:!0}))};function at(e,t,n){const r=Jf(e,t);return r&&(n.didMatch=!0),r}function Jf(e,t){if(e.length===0)return!1;if(e.includes("|")){const a=e.split("|");for(const s of a)if(Jf(s,t))return!0;return!1}let n=!1,r=!1,o=!1,i=!1;const l=e.split("+");if(!function(a,s){return a===void 0?!1:a.length>1&&a.startsWith("_")?Number.parseInt(a.slice(1))===s.keyCode:a.length===1&&a>="a"&&a<="z"?a.toUpperCase().codePointAt(0)===s.keyCode:a===s.key}(l.pop(),t))return!1;if(l[0]==="any")return!0;for(const a of l)switch(a){case"ctrl":n=!0;break;case"shift":r=!0;break;case"alt":o=!0;break;case"meta":i=!0;break;case"primary":ci.value?i=!0:n=!0}return t.altKey===o&&t.ctrlKey===n&&t.shiftKey===r&&t.metaKey===i}function pg(e,t){return e.map((n,r)=>{const o=t[r];return n.map(i=>i.span!==void 0&&i.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:function(l){if(l.copyData!==void 0)return{formatted:l.copyData,rawValue:l.copyData,format:"string",doNotEscape:!0};switch(l.kind){case pe.Boolean:return{formatted:l.data===!0?"TRUE":l.data===!1?"FALSE":l.data===Ni?"INDETERMINATE":"",rawValue:l.data,format:"boolean"};case pe.Custom:return{formatted:l.copyData,rawValue:l.copyData,format:"string"};case pe.Image:case pe.Bubble:return{formatted:l.data,rawValue:l.data,format:"string-array"};case pe.Drilldown:return{formatted:l.data.map(a=>a.text),rawValue:l.data.map(a=>a.text),format:"string-array"};case pe.Text:return{formatted:l.displayData??l.data,rawValue:l.data,format:"string"};case pe.Uri:return{formatted:l.displayData??l.data,rawValue:l.data,format:"url"};case pe.Markdown:case pe.RowID:return{formatted:l.data,rawValue:l.data,format:"string"};case pe.Number:return{formatted:l.displayData,rawValue:l.data,format:"number"};case pe.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case pe.Protected:return{formatted:"************",rawValue:"",format:"string"};default:lo()}}(i))})}function Qf(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function pa(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function Zf(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function mg(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function vg(e,t){const n=pg(e,t),r=function(i){var a;const l=[];for(const s of i){const c=[];for(const h of s)h.format==="url"?c.push(((a=h.rawValue)==null?void 0:a.toString())??""):h.format==="string-array"?c.push(h.formatted.map(C=>Qf(C,!0)).join(",")):c.push(h.doNotEscape===!0?h.formatted:Qf(h.formatted,!1));l.push(c.join(" "))}return l.join(`
121
+ `)}(n),o=function(i){var a;const l=[];l.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const s of i){l.push("<tr>");for(const c of s){const h=`gdg-format="${c.format}"`;c.format==="url"?l.push(`<td ${h}><a href="${c.rawValue}">${pa(c.formatted)}</a></td>`):c.format==="string-array"?l.push(`<td ${h}><ol>${c.formatted.map((C,y)=>`<li gdg-raw-value=${Zf(c.rawValue[y])}>`+pa(C)+"</li>").join("")}</ol></td>`):l.push(`<td gdg-raw-value=${Zf(((a=c.rawValue)==null?void 0:a.toString())??"")} ${h}>${pa(c.formatted)}</td>`)}l.push("</tr>")}return l.push("</tbody></table>"),l.join("")}(n);return{textPlain:r,textHtml:o}}function e0(e){var l;const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const r=[n],o=[];let i;for(;r.length>0;){const a=r.pop();if(a===void 0)break;if(a instanceof HTMLTableElement||a.nodeName==="TBODY")r.push(...[...a.children].reverse());else if(a instanceof HTMLTableRowElement)i!==void 0&&o.push(i),i=[],r.push(...[...a.children].reverse());else if(a instanceof HTMLTableCellElement){const s=a.cloneNode(!0),c=s.children.length===1&&s.children[0].nodeName==="P"?s.children[0]:null,h=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",C=s.querySelectorAll("br");for(const w of C)w.replaceWith(`
122
+ `);const y=s.getAttribute("gdg-raw-value"),p=s.getAttribute("gdg-format")??"string";if(s.querySelector("a")!==null)i==null||i.push({rawValue:((l=s.querySelector("a"))==null?void 0:l.getAttribute("href"))??"",formatted:s.textContent??"",format:p});else if(s.querySelector("ol")!==null){const w=s.querySelectorAll("li");i==null||i.push({rawValue:[...w].map(v=>v.getAttribute("gdg-raw-value")??""),formatted:[...w].map(v=>v.textContent??""),format:"string-array"})}else if(y!==null)i==null||i.push({rawValue:mg(y),formatted:s.textContent??"",format:p});else{let w=s.textContent??"";h&&(w=w.replace(/\n(?!\n)/g,"")),i==null||i.push({rawValue:w??"",formatted:w??"",format:p})}}}return i!==void 0&&o.push(i),o}function t0(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function wg(e){let t;(function(a){a[a.None=0]="None",a[a.inString=1]="inString",a[a.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let r=[],o=0,i=t.None;e=e.replace(/\r\n/g,`
123
+ `);let l=0;for(const a of e){switch(i){case t.None:a===" "||a===`
124
+ `?(r.push(e.slice(o,l)),o=l+1,a===`
125
+ `&&(n.push(r),r=[])):a==='"'&&(i=t.inString);break;case t.inString:a==='"'&&(i=t.inStringPostQuote);break;case t.inStringPostQuote:a==='"'?i=t.inString:((a===" "||a===`
126
+ `)&&(r.push(t0(e.slice(o,l))),o=l+1,a===`
127
+ `&&(n.push(r),r=[])),i=t.None)}l++}return o<e.length&&r.push(t0(e.slice(o,e.length))),n.push(r),n.map(a=>a.map(s=>({rawValue:s,formatted:s,format:"string"})))}function n0(e,t,n){var l;const r=vg(e,t),o=a=>{var s;(s=window.navigator.clipboard)==null||s.writeText(a)},i=(a,s)=>{var c,h;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",a),(h=n==null?void 0:n.clipboardData)==null||h.setData("text/html",s)}catch{((C,y)=>{var p;return((p=window.navigator.clipboard)==null?void 0:p.write)!==void 0&&(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([C],{type:"text/plain"}),"text/html":new Blob([y],{type:"text/html"})})]),!0)})(a,s)||o(a)}};((l=window.navigator.clipboard)==null?void 0:l.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?i(r.textPlain,r.textHtml):o(r.textPlain),n==null||n.preventDefault()}function r0(e){return e!==!0}function o0(e){return typeof e=="string"?e:`${e}px`}const yg=Cn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[e=>e.innerWidth],"wmyidgi-1":[e=>e.innerHeight]}}),bg=e=>{const{inWidth:t,inHeight:n,children:r,...o}=e;return d.createElement(yg,{innerHeight:o0(n),innerWidth:o0(t),...o},r)},mr={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 lt(e,t){return e===!0?t:e===!1?"":e}function i0(e){const t=ci.value;return{activateCell:lt(e.activateCell," |Enter|shift+Enter"),clear:lt(e.clear,"any+Escape"),closeOverlay:lt(e.closeOverlay,"any+Escape"),acceptOverlayDown:lt(e.acceptOverlayDown,"Enter"),acceptOverlayUp:lt(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:lt(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:lt(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:lt(e.delete,t?"Backspace|Delete":"Delete"),downFill:lt(e.downFill,"primary+_68"),scrollToSelectedCell:lt(e.scrollToSelectedCell,"primary+Enter"),goDownCell:lt(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:lt(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:lt(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:lt(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:lt(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:lt(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:lt(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:lt(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:lt(e.goToFirstCell,"primary+Home"),goToFirstColumn:lt(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:lt(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:lt(e.goToLastCell,"primary+End"),goToLastColumn:lt(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:lt(e.goToLastRow,"primary+ArrowDown"),goToNextPage:lt(e.goToNextPage,"PageDown"),goToPreviousPage:lt(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:lt(e.rightFill,"primary+_82"),search:lt(e.search,"primary+f"),selectAll:lt(e.selectAll,"primary+a"),selectColumn:lt(e.selectColumn,"ctrl+ "),selectGrowDown:lt(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:lt(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:lt(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:lt(e.selectGrowUp,"shift+ArrowUp"),selectRow:lt(e.selectRow,"shift+ "),selectToFirstCell:lt(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:lt(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:lt(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:lt(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:lt(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:lt(e.selectToLastRow,"primary+shift+ArrowDown")}}function xg(e){const t=function(n){const r=d.useRef(n);return $r(n,r.current)||(r.current=n),r.current}(e);return $t.useMemo(()=>{if(t===void 0)return i0(mr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??mr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??mr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??mr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??mr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??mr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??mr.selectToLastCell};return i0({...mr,...n})},[t])}function Cg(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((l,a)=>t(l,r+1,[...o,a])).sort((l,a)=>l.headerIndex-a.headerIndex)),i}return e.map((n,r)=>t(n,0,[r])).sort((n,r)=>n.headerIndex-r.headerIndex)}function ma(e,t){const n=[];function r(a,s,c=!1){let h=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(h=a.subGroups[0].headerIndex-a.headerIndex),h--,n.push({rowIndex:-1,headerIndex:a.headerIndex,contentIndex:-1,skip:c,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:h}),a.subGroups)for(let C=0;C<a.subGroups.length;C++){const y=C<a.subGroups.length-1?a.subGroups[C+1].headerIndex:s;r(a.subGroups[C],y,c||a.isCollapsed)}}const o=Cg(e.groups);for(let a=0;a<o.length;a++){const s=a<o.length-1?o[a+1].headerIndex:null;r(o[a],s)}let i=0,l=0;for(const a of n)a.contentIndex=l,l+=a.rows,a.rowIndex=i,i+=a.isCollapsed?1:a.rows+1;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...c}=a;return c})}function va(e,t){if(t===void 0||ma.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const r of t){if(n===0)return{path:[...r.path,-1],originalIndex:r.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:r.rows};if(r.isCollapsed)n--;else{if(n<=r.rows)return{path:[...r.path,n-1],originalIndex:r.headerIndex+n,isGroupHeader:!1,groupIndex:n-1,contentIndex:r.contentIndex+n-1,groupRows:r.rows};n=n-r.rows-1}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function a0(e,t,n){const[r,...o]=t;return o[0]===-1?e.map((i,l)=>l===r?{...i,...n}:i):e.map((i,l)=>l===r?{...i,subGroups:a0(i.subGroups??[],o,n)}:i)}function l0(e,t){const[n,...r]=t;return r[0]===-1?e[n]:l0(e[n].subGroups??[],r)}function Sg(e,t,n,r,o){const[i,l]=d.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-t%n:0],[t,n]),a=d.useMemo(()=>({x:r.current.x,y:i,width:r.current.width??1,height:r.current.height??1,ty:l}),[r,l,i]),[s,c,h]=c1(a),C=d.useRef(o);C.current=o;const y=function(v,E){const[g]=d.useState(()=>({value:v,callback:E,facade:{get current(){return g.value},set current(b){const x=g.value;x!==b&&(g.value=b,g.callback(b,x))}}}));return g.callback=E,g.facade}(null,v=>{v!==null&&t!==void 0?v.scrollTop=t:v!==null&&e!==void 0&&(v.scrollLeft=e)}),p=(s.height??1)>1;d.useLayoutEffect(()=>{if(t!==void 0&&y.current!==null&&p){if(y.current.scrollTop===t)return;y.current.scrollTop=t,y.current.scrollTop!==t&&h(),C.current()}},[t,p,h,y]);const w=(s.width??1)>1;return d.useLayoutEffect(()=>{if(e!==void 0&&y.current!==null&&w){if(y.current.scrollLeft===e)return;y.current.scrollLeft=e,y.current.scrollLeft!==e&&h(),C.current()}},[e,w,h,y]),{visibleRegion:s,setVisibleRegion:c,scrollRef:y}}const kg=d.lazy(async()=>await L0(()=>import("./data-grid-overlay-editor-0MMb3ORz.js"),__vite__mapDeps([0,1,2,3]),import.meta.url));let Mg=0;function di(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 hi={kind:pe.Loading,allowOverlay:!1},fi={columns:yt.empty(),rows:yt.empty(),current:void 0},Rg=d.forwardRef((e,t)=>{var z0,A0,F0;const[n,r]=d.useState(fi),[o,i]=d.useState(),l=d.useRef(null),a=d.useRef(null),[s,c]=d.useState(),h=d.useRef(),C=typeof window>"u"?null:window,{imageEditorOverride:y,getRowThemeOverride:p,markdownDivCreateNode:w,width:v,height:E,columns:g,rows:b,getCellContent:x,onCellClicked:I,onCellActivated:m,onFillPattern:S,onFinishedEditing:R,coercePasteValue:H,drawHeader:f,drawCell:B,editorBloom:D,onHeaderClicked:O,onColumnProposeMove:T,rangeSelectionColumnSpanning:j=!0,spanRangeBehavior:U="default",onGroupHeaderClicked:te,onCellContextMenu:J,className:ce,onHeaderContextMenu:se,getCellsForSelection:q,onGroupHeaderContextMenu:Z,onGroupHeaderRenamed:fe,onCellEdited:N,onCellsEdited:K,onSearchResultsChanged:ne,searchResults:X,onSearchValueChange:Q,searchValue:ae,onKeyDown:he,onKeyUp:ze,keybindings:$e,editOnType:Ze=!0,onRowAppended:He,onColumnMoved:We,validateCell:me,highlightRegions:ye,rangeSelect:Me="rect",columnSelect:Se="multi",rowSelect:ee="multi",rangeSelectionBlending:Pe="exclusive",columnSelectionBlending:ke="exclusive",rowSelectionBlending:Ge="exclusive",onDelete:Re,onDragStart:nt,onMouseMove:Ke,onPaste:ct,copyHeaders:Ee=!1,freezeColumns:Ae=0,cellActivationBehavior:ut="second-click",rowSelectionMode:dt="auto",onHeaderMenuClick:pt,onHeaderIndicatorClick:Ft,getGroupDetails:bt,rowGrouping:Je,onSearchClose:Yt,onItemHovered:nn,onSelectionCleared:Kt,showSearch:qt,onVisibleRegionChanged:un,gridSelection:jt,onGridSelectionChange:Kn,minColumnWidth:vr=50,maxColumnWidth:Dt=500,maxColumnAutoWidth:er,provideEditor:_n,trailingRowOptions:re,freezeTrailingRows:be=0,allowedFillDirections:wt="orthogonal",scrollOffsetX:st,scrollOffsetY:xt,verticalBorder:ve,onDragOverCell:Ve,onDrop:Ye,onColumnResize:mt,onColumnResizeEnd:rt,onColumnResizeStart:ot,customRenderers:vt,fillHandle:Ue,experimental:it,fixedShadowX:tt,fixedShadowY:Oe,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Sn,overscrollY:Rt,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,trapFocus:It=!1,smoothScrollX:Vt,smoothScrollY:Et,scaleToRem:Tt=!1,rowHeight:qe=34,headerHeight:Jt=36,groupHeaderHeight:Mn=Jt,theme:mn,isOutsideClick:wr,renderers:Ro,resizeIndicator:Ca,scrollToActiveCell:Eo=!0,drawFocusRing:Io=!0}=e,zr=Io==="no-editor"?o===void 0:Io,Ot=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,vn=(Ot==null?void 0:Ot.kind)??e.rowMarkers??"none",gi=(Ot==null?void 0:Ot.width)??e.rowMarkerWidth,To=(Ot==null?void 0:Ot.startIndex)??e.rowMarkerStartIndex??1,tr=(Ot==null?void 0:Ot.theme)??e.rowMarkerTheme,nr=Ot==null?void 0:Ot.headerTheme,qr=Ot==null?void 0:Ot.headerAlwaysVisible,rr=ee!=="multi"||(Ot==null?void 0:Ot.headerDisabled)===!0,yr=(Ot==null?void 0:Ot.checkboxStyle)??"square",or=Math.max(vr,20),Ar=Math.max(Dt,or),pi=Math.max(er??Ar,or),Ho=d.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:Xe,rowNumberMapper:Oo,rowHeight:mi,getRowThemeOverride:jn}=function(u,M,k,P){const A=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]),G=$t.useMemo(()=>A==null?void 0:A.reduce((F,ie)=>(F[ie.rowIndex]=ie,F),{}),[A]),W=$t.useMemo(()=>A===void 0?M:A.reduce((F,ie)=>F+(ie.isCollapsed?1:ie.rows+1),0),[A,M]),_=$t.useMemo(()=>u===void 0||typeof k=="number"&&u.height===k?k:F=>G!=null&&G[F]?u.height:typeof k=="number"?k:k(F),[G,u,k]),$=$t.useCallback(F=>{if(A===void 0)return F;let ie=F;for(const oe of A){if(ie===0)return;if(ie--,!oe.isCollapsed){if(ie<oe.rows)return oe.contentIndex+ie;ie-=oe.rows}}return F},[A]),Y=dr(P??(u==null?void 0:u.themeOverride),$t.useCallback(F=>{if(u===void 0)return P==null?void 0:P(F,F,F);if(P===void 0&&(u==null?void 0:u.themeOverride)===void 0)return;const{isGroupHeader:ie,contentIndex:oe,groupIndex:ge}=va(F,A);return ie?u.themeOverride:P==null?void 0:P(F,ge,oe)},[A,P,u]));return u===void 0?{rowHeight:_,rows:M,rowNumberMapper:$,getRowThemeOverride:Y}:{rowHeight:_,rows:W,rowNumberMapper:$,getRowThemeOverride:Y}}(Je,b,qe,p),Sa=d.useMemo(()=>Number.parseFloat(Ho.fontSize),[Ho]),{rowHeight:Vn,headerHeight:Fr,groupHeaderHeight:Po,theme:Lr,overscrollX:Do,overscrollY:zo}=function({rowHeight:u,headerHeight:M,groupHeaderHeight:k,theme:P,overscrollX:A,overscrollY:G,scaleToRem:W,remSize:_}){const[$,Y,F,ie,oe,ge]=$t.useMemo(()=>{if(!W||_===16)return[u,M,k,P,A,G];const we=_/16,_e=u,Ce=iu();return[typeof _e=="number"?_e*we:Te=>Math.ceil(_e(Te)*we),Math.ceil(M*we),Math.ceil(k*we),{...P,headerIconSize:((P==null?void 0:P.headerIconSize)??Ce.headerIconSize)*we,cellHorizontalPadding:((P==null?void 0:P.cellHorizontalPadding)??Ce.cellHorizontalPadding)*we,cellVerticalPadding:((P==null?void 0:P.cellVerticalPadding)??Ce.cellVerticalPadding)*we},Math.ceil((A??0)*we),Math.ceil((G??0)*we)]},[k,M,A,G,_,u,W,P]);return{rowHeight:$,headerHeight:Y,groupHeaderHeight:F,theme:ie,overscrollX:oe,overscrollY:ge}}({groupHeaderHeight:Mn,headerHeight:Jt,overscrollX:Sn,overscrollY:Rt,remSize:Sa,rowHeight:mi,scaleToRem:Tt,theme:mn}),Un=xg($e),Nn=gi??(b>1e4?48:b>1e3?44:b>100?36:32),wn=vn!=="none",V=wn?1:0,Wt=He!==void 0,L=(re==null?void 0:re.sticky)===!0,[le,ue]=d.useState(!1),xe=qt??le,de=d.useCallback(()=>{Yt!==void 0?Yt():ue(!1)},[Yt]),z=d.useMemo(()=>jt===void 0?void 0:di(jt,V),[jt,V])??n,Ie=d.useRef();Ie.current===void 0&&(Ie.current=new AbortController),d.useEffect(()=>()=>Ie==null?void 0:Ie.current.abort(),[]);const[Fe,Ne]=function(u,M,k,P,A){const G=d.useCallback($=>{if(u===!0){const Y=[];for(let F=$.y;F<$.y+$.height;F++){const ie=[];for(let oe=$.x;oe<$.x+$.width;oe++)oe<0||F>=A?ie.push({kind:pe.Loading,allowOverlay:!1}):ie.push(M([oe,F]));Y.push(ie)}return Y}return(u==null?void 0:u($,P.signal))??[]},[P.signal,M,u,A]),W=u!==void 0?G:void 0,_=d.useCallback($=>{if(W===void 0)return[];const Y={...$,x:$.x-k};if(Y.x<0){Y.x=0,Y.width--;const F=W(Y,P.signal);return typeof F=="function"?async()=>(await F()).map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie]):F.map(ie=>[{kind:pe.Loading,allowOverlay:!1},...ie])}return W(Y,P.signal)},[P.signal,W,k]);return[u!==void 0?_:void 0,W]}(q,x,V,Ie.current,Xe),Mt=d.useCallback((u,M,k)=>{if(me===void 0)return!0;const P=[u[0]-V,u[1]];return me==null?void 0:me(P,M,k)},[V,me]),De=d.useRef(jt),Le=d.useCallback((u,M)=>{M&&(u=function(k,P,A,G,W){var Y;const _=k;if(G==="allowPartial"||k.current===void 0||P===void 0)return k;let $=!1;do{if((k==null?void 0:k.current)===void 0)break;const F=(Y=k.current)==null?void 0:Y.range,ie=[];if(F.width>2){const we=P({x:F.x,y:F.y,width:1,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we);const _e=P({x:F.x+F.width-1,y:F.y,width:1,height:F.height},W.signal);if(typeof _e=="function")return _;ie.push(..._e)}else{const we=P({x:F.x,y:F.y,width:F.width,height:F.height},W.signal);if(typeof we=="function")return _;ie.push(...we)}let oe=F.x-A,ge=F.x+F.width-1-A;for(const we of ie)for(const _e of we)_e.span!==void 0&&(oe=Math.min(_e.span[0],oe),ge=Math.max(_e.span[1],ge));oe===F.x-A&&ge===F.x+F.width-1-A?$=!0:k={current:{cell:k.current.cell??[0,0],range:{x:oe+A,y:F.y,width:ge-oe+1,height:F.height},rangeStack:k.current.rangeStack},columns:k.columns,rows:k.rows}}while(!$);return k}(u,Fe,V,U,Ie.current)),Kn!==void 0?(De.current=di(u,-V),Kn(De.current)):r(u)},[Kn,Fe,V,U]),Qe=dr(mt,d.useCallback((u,M,k,P)=>{mt==null||mt(g[k-V],M,k-V,P)},[mt,V,g])),dn=dr(rt,d.useCallback((u,M,k,P)=>{rt==null||rt(g[k-V],M,k-V,P)},[rt,V,g])),en=dr(ot,d.useCallback((u,M,k,P)=>{ot==null||ot(g[k-V],M,k-V,P)},[ot,V,g])),br=dr(f,d.useCallback((u,M)=>(f==null?void 0:f({...u,columnIndex:u.columnIndex-V},M))??!1,[f,V])),ir=dr(B,d.useCallback((u,M)=>(B==null?void 0:B({...u,col:u.col-V},M))??!1,[B,V])),on=d.useCallback(u=>{if(Re!==void 0){const M=Re(di(u,-V));return typeof M=="boolean"?M:di(M,V)}return!0},[Re,V]),[Lt,je,ht]=function(u,M,k,P,A,G,W){return[$t.useCallback((_,$,Y,F)=>{var _e;G!=="cell"&&G!=="multi-cell"||_===void 0||(_={..._,range:{x:_.cell[0],y:_.cell[1],width:1,height:1}}),!W&&_!==void 0&&_.range.width>1&&(_={..._,range:{..._.range,width:1,x:_.cell[0]}});const ie=k==="mixed"&&(Y||F==="drag"),oe=P==="mixed"&&ie,ge=A==="mixed"&&ie;let we={current:_===void 0?void 0:{..._,rangeStack:F==="drag"?((_e=u.current)==null?void 0:_e.rangeStack)??[]:[]},columns:oe?u.columns:yt.empty(),rows:ge?u.rows:yt.empty()};Y&&(G==="multi-rect"||G==="multi-cell")&&we.current!==void 0&&u.current!==void 0&&(we={...we,current:{...we.current,rangeStack:[...u.current.rangeStack,u.current.range]}}),M(we,$)},[P,u,k,G,W,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.rows,$!==void 0&&(_=_.add($)),A==="exclusive"&&_.length>0)F={current:void 0,columns:yt.empty(),rows:_};else{const ie=Y&&P==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,columns:ie?u.columns:yt.empty(),rows:_}}M(F,!1)},[P,u,k,A,M]),$t.useCallback((_,$,Y)=>{let F;if(_=_??u.columns,$!==void 0&&(_=_.add($)),P==="exclusive"&&_.length>0)F={current:void 0,rows:yt.empty(),columns:_};else{const ie=Y&&A==="mixed";F={current:Y&&k==="mixed"?u.current:void 0,rows:ie?u.rows:yt.empty(),columns:_}}M(F,!1)},[P,u,k,A,M])]}(z,Le,Pe,ke,Ge,Me,j),gt=d.useMemo(()=>Qn(iu(),Lr),[Lr]),[yn,an]=d.useState([0,0,0]),ar=d.useMemo(()=>{if(Ro===void 0)return{};const u={};for(const M of Ro)u[M.kind]=M;return u},[Ro]),Ht=d.useCallback(u=>u.kind!==pe.Custom?ar[u.kind]:vt==null?void 0:vt.find(M=>M.isMatch(u)),[vt,ar]);let{sizedColumns:hn,nonGrowWidth:vi}=function(u,M,k,P,A,G,W,_,$){const Y=d.useRef(M),F=d.useRef(k),ie=d.useRef(W);Y.current=M,F.current=k,ie.current=W;const[oe,ge]=d.useMemo(()=>{if(typeof window>"u")return[null,null];const Be=document.createElement("canvas");return Be.style.display="none",Be.style.opacity="0",Be.style.position="fixed",[Be,Be.getContext("2d",{alpha:!1})]},[]);d.useLayoutEffect(()=>(oe&&document.documentElement.append(oe),()=>{oe==null||oe.remove()}),[oe]);const we=d.useRef({}),_e=d.useRef(),[Ce,Te]=d.useState();return d.useLayoutEffect(()=>{const Be=F.current;if(Be===void 0||u.every(ei))return;let _t=Math.max(1,10-Math.floor(u.length/1e4)),Ut=0;_t<Y.current&&_t>1&&(_t--,Ut=1);const tn={x:0,y:0,width:u.length,height:Math.min(Y.current,_t)},St={x:0,y:Y.current-1,width:u.length,height:1};(async()=>{const At=Be(tn,$.signal),sn=Ut>0?Be(St,$.signal):void 0;let xn;xn=typeof At=="object"?At:await Zs(At),sn!==void 0&&(xn=typeof sn=="object"?[...xn,...sn]:[...xn,...await Zs(sn)]),_e.current=u,Te(xn)})()},[$.signal,u]),d.useMemo(()=>{let Be=u.every(ei)?u:ge===null?u.map(St=>ei(St)?St:{...St,width:150}):(ge.font=ie.current.baseFontFull,u.map((St,At)=>{if(ei(St))return St;if(we.current[St.id]!==void 0)return{...St,width:we.current[St.id]};if(Ce===void 0||_e.current!==u||St.id===void 0)return{...St,width:150};const sn=au(ge,W,St,At,Ce,A,G,!0,_);return we.current[St.id]=sn.width,sn})),_t=0,Ut=0;const tn=[];for(const[St,At]of Be.entries())_t+=At.width,At.grow!==void 0&&At.grow>0&&(Ut+=At.grow,tn.push(St));if(_t<P&&tn.length>0){const St=[...Be],At=P-_t;let sn=At;for(let xn=0;xn<tn.length;xn++){const sr=tn[xn],Xo=(Be[sr].grow??0)/Ut,Aa=xn===tn.length-1?sn:Math.min(sn,Math.floor(At*Xo));St[sr]={...Be[sr],growOffset:Aa,width:Be[sr].width+Aa},sn-=Aa}Be=St}return{sizedColumns:Be,nonGrowWidth:_t}},[P,u,ge,Ce,W,A,G,_])}(g,Xe,Ne,yn[0]-(V===0?0:Nn)-yn[2],or,pi,gt,Ht,Ie.current);vn!=="none"&&(vi+=Nn);const Jr=d.useMemo(()=>hn.some(u=>u.group!==void 0),[hn]),lr=Jr?Fr+Po:Fr,Ao=z.rows.length,Fo=vn==="none"?void 0:Ao!==0&&(Ao===Xe||void 0),Ct=d.useMemo(()=>vn==="none"?hn:[{title:"",width:Nn,icon:void 0,hasMenu:!1,style:"normal",themeOverride:tr,rowMarker:yr,rowMarkerChecked:Fo,headerRowMarkerTheme:nr,headerRowMarkerAlwaysVisible:qr,headerRowMarkerDisabled:rr},...hn],[vn,hn,Nn,tr,yr,Fo,nr,qr,rr]),Gt=d.useRef({height:1,width:1,x:0,y:0}),Dn=d.useRef(!1),{setVisibleRegion:Lo,visibleRegion:_r,scrollRef:zt}=Sg(st,xt,Vn,Gt,()=>Dn.current=!0);Gt.current=_r;const lp=_r.x+V,wi=_r.y,ln=d.useRef(null),bn=d.useCallback(u=>{var M;u===!0?(M=ln.current)==null||M.focus():window.requestAnimationFrame(()=>{var k;(k=ln.current)==null||k.focus()})},[]),fn=Wt?Xe+1:Xe,zn=d.useCallback(u=>{const M=V===0?u:u.map(P=>({...P,location:[P.location[0]-V,P.location[1]]})),k=K==null?void 0:K(M);if(k!==!0)for(const P of M)N==null||N(P.location,P.value);return k},[N,K,V]),[jr,ka]=d.useState(),yi=z.current!==void 0&&z.current.range.width*z.current.range.height>1?z.current.range:void 0,Qr=zr?(z0=z.current)==null?void 0:z0.cell:void 0,bi=Qr==null?void 0:Qr[0],xi=Qr==null?void 0:Qr[1],sp=d.useMemo(()=>{if((ye===void 0||ye.length===0)&&(yi??bi??xi??jr)===void 0)return;const u=[];if(ye!==void 0)for(const M of ye){const k=Ct.length-M.range.x-V;k>0&&u.push({color:M.color,range:{...M.range,x:M.range.x+V,width:Math.min(k,M.range.width)},style:M.style})}return jr!==void 0&&u.push({color:Hr(gt.accentColor,0),range:jr,style:"dashed"}),yi!==void 0&&u.push({color:Hr(gt.accentColor,.5),range:yi,style:"solid-outline"}),bi!==void 0&&xi!==void 0&&u.push({color:gt.accentColor,range:{x:bi,y:xi,width:1,height:1},style:"solid-outline"}),u.length>0?u:void 0},[jr,yi,bi,xi,ye,Ct.length,gt.accentColor,V]),b0=d.useRef(Ct);b0.current=Ct;const Tn=d.useCallback(([u,M],k=!1)=>{var A,G,W,_,$,Y,F;const P=Wt&&M===fn-1;if(u===0&&wn){if(P)return hi;const ie=Oo(M);return ie===void 0?hi:{kind:Hn.Marker,allowOverlay:!1,checkboxStyle:yr,checked:(z==null?void 0:z.rows.hasIndex(M))===!0,markerKind:vn==="clickable-number"?"number":vn,row:To+ie,drawHandle:Xt!==void 0,cursor:vn==="clickable-number"?"pointer":void 0}}if(P){const ie=u===V?(re==null?void 0:re.hint)??"":"",oe=b0.current[u];if(((A=oe==null?void 0:oe.trailingRowOptions)==null?void 0:A.disabled)===!0)return hi;{const ge=((G=oe==null?void 0:oe.trailingRowOptions)==null?void 0:G.hint)??ie,we=((W=oe==null?void 0:oe.trailingRowOptions)==null?void 0:W.addIcon)??(re==null?void 0:re.addIcon);return{kind:Hn.NewRow,hint:ge,allowOverlay:!1,icon:we}}}{const ie=u-V;if(k||(it==null?void 0:it.strict)===!0){const ge=Gt.current,we=ge.x>ie||ie>ge.x+ge.width||ge.y>M||M>ge.y+ge.height||M>=Ra.current,_e=ie===(($=(_=ge.extras)==null?void 0:_.selected)==null?void 0:$[0])&&M===((Y=ge.extras)==null?void 0:Y.selected[1]);let Ce=!1;if(((F=ge.extras)==null?void 0:F.freezeRegions)!==void 0){for(const Te of ge.extras.freezeRegions)if(Dr(Te,ie,M)){Ce=!0;break}}if(we&&!_e&&!Ce)return hi}let oe=x([ie,M]);return V!==0&&oe.span!==void 0&&(oe={...oe,span:[oe.span[0]+V,oe.span[1]+V]}),oe}},[Wt,fn,wn,Oo,yr,z==null?void 0:z.rows,vn,To,Xt,V,re==null?void 0:re.hint,re==null?void 0:re.addIcon,it==null?void 0:it.strict,x]),Ma=d.useCallback(u=>{let M=(bt==null?void 0:bt(u))??{name:u};return fe!==void 0&&u!==""&&(M={icon:M.icon,name:M.name,overrideTheme:M.overrideTheme,actions:[...M.actions??[],{title:"Rename",icon:"renameIcon",onClick:k=>Ia({group:M.name,bounds:k.bounds})}]}),M},[bt,fe]),Ci=d.useCallback(u=>{var _;const[M,k]=u.cell,P=Ct[M],A=(P==null?void 0:P.group)!==void 0?(_=Ma(P.group))==null?void 0:_.overrideTheme:void 0,G=P==null?void 0:P.themeOverride,W=jn==null?void 0:jn(k);i({...u,theme:Qn(gt,A,G,W,u.content.themeOverride)})},[jn,Ct,Ma,gt]),Zr=d.useCallback((u,M,k)=>{var W;if(z.current===void 0)return;const[P,A]=z.current.cell,G=Tn([P,A]);if(G.kind!==pe.Boolean&&G.allowOverlay){let _=G;if(k!==void 0)switch(_.kind){case pe.Number:{const $=function(Y,F){try{return Y()}catch{return F}}(()=>k==="-"?-0:Number.parseFloat(k),0);_={..._,data:Number.isNaN($)?0:$};break}case pe.Text:case pe.Markdown:case pe.Uri:_={..._,data:k}}Ci({target:u,content:_,initialValue:k,cell:[P,A],highlight:k===void 0,forceEditMode:k!==void 0})}else G.kind===pe.Boolean&&M&&G.readonly!==!0&&(zn([{location:z.current.cell,value:{...G,data:r0(G.data)}}]),(W=ln.current)==null||W.damage([{cell:z.current.cell}]))},[Tn,z,zn,Ci]),x0=d.useCallback((u,M)=>{var A;const k=(A=ln.current)==null?void 0:A.getBounds(u,M);if(k===void 0||zt.current===null)return;const P=Tn([u,M]);P.allowOverlay&&Ci({target:k,content:P,initialValue:void 0,highlight:!0,cell:[u,M],forceEditMode:!0})},[Tn,zt,Ci]),Qt=d.useCallback((u,M,k="both",P=0,A=0,G=void 0)=>{if(zt.current!==null){const W=ln.current,_=a.current,$=typeof u!="number"?u.unit==="cell"?u.amount:void 0:u,Y=typeof M!="number"?M.unit==="cell"?M.amount:void 0:M,F=typeof u!="number"&&u.unit==="px"?u.amount:void 0,ie=typeof M!="number"&&M.unit==="px"?M.amount:void 0;if(W!==null&&_!==null){let oe={x:0,y:0,width:0,height:0},ge=0,we=0;if(($!==void 0||Y!==void 0)&&(oe=W.getBounds(($??0)+V,Y??0)??oe,oe.width===0||oe.height===0))return;const _e=_.getBoundingClientRect(),Ce=_e.width/_.offsetWidth;if(F!==void 0&&(oe={...oe,x:F-_e.left-zt.current.scrollLeft,width:1}),ie!==void 0&&(oe={...oe,y:ie+_e.top-zt.current.scrollTop,height:1}),oe!==void 0){const Te={x:oe.x-P,y:oe.y-A,width:oe.width+2*P,height:oe.height+2*A};let Be=0;for(let Xo=0;Xo<Ae;Xo++)Be+=hn[Xo].width;let _t=0;const Ut=be+(L?1:0);Ut>0&&(_t=Or(fn,Ut,Vn));let tn=Be*Ce+_e.left+V*Nn*Ce,St=_e.right,At=_e.top+lr*Ce,sn=_e.bottom-_t*Ce;const xn=oe.width+2*P;switch(G==null?void 0:G.hAlign){case"start":St=tn+xn;break;case"end":tn=St-xn;break;case"center":tn=Math.floor((tn+St)/2)-xn/2,St=tn+xn}const sr=oe.height+2*A;switch(G==null?void 0:G.vAlign){case"start":sn=At+sr;break;case"end":At=sn-sr;break;case"center":At=Math.floor((At+sn)/2)-sr/2,sn=At+sr}tn>Te.x?ge=Te.x-tn:St<Te.x+Te.width&&(ge=Te.x+Te.width-St),At>Te.y?we=Te.y-At:sn<Te.y+Te.height&&(we=Te.y+Te.height-sn),k==="vertical"||typeof u=="number"&&u<Ae?ge=0:(k==="horizontal"||typeof M=="number"&&M>=fn-Ut)&&(we=0),ge===0&&we===0||(Ce!==1&&(ge/=Ce,we/=Ce),zt.current.scrollTo({left:ge+zt.current.scrollLeft,top:we+zt.current.scrollTop,behavior:(G==null?void 0:G.behavior)??"auto"}))}}}},[V,be,Nn,zt,lr,Ae,hn,fn,L,Vn]),C0=d.useRef(x0),S0=d.useRef(x),Ra=d.useRef(Xe);C0.current=x0,S0.current=x,Ra.current=Xe;const eo=d.useCallback(async(u,M=!0,k)=>{var Y;const P=Ct[u];if(((Y=P==null?void 0:P.trailingRowOptions)==null?void 0:Y.disabled)===!0)return;const A=He==null?void 0:He();let G,W=!0;A!==void 0&&(G=await A,G==="top"&&(W=!1),typeof G=="number"&&(W=!1));let _=0;const $=()=>{if(Ra.current<=Xe)return _<500&&window.setTimeout($,_),void(_=50+2*_);const F=typeof G=="number"?G:W?Xe:0;Ii.current(u-V,F,"both",0,0,k?{behavior:k}:void 0),Lt({cell:[u,F],range:{x:u,y:F,width:1,height:1}},!1,!1,"edit");const ie=S0.current([u-V,F]);ie.allowOverlay&&so(ie)&&ie.readonly!==!0&&M&&window.setTimeout(()=>{C0.current(u,F)},0)};$()},[Ct,He,V,Xe,Lt]),Si=d.useCallback(u=>{var k,P;const M=((P=(k=hn[u])==null?void 0:k.trailingRowOptions)==null?void 0:P.targetColumn)??(re==null?void 0:re.targetColumn);if(typeof M=="number")return M+(wn?1:0);if(typeof M=="object"){const A=g.indexOf(M);if(A>=0)return A+(wn?1:0)}},[hn,g,wn,re==null?void 0:re.targetColumn]),xr=d.useRef(),to=d.useRef(),_o=d.useCallback((u,M)=>{var A;const[k,P]=M;return Qn(gt,(A=Ct[k])==null?void 0:A.themeOverride,jn==null?void 0:jn(P),u.themeOverride)},[jn,Ct,gt]),{mapper:Nr}=function(u,M){const k=$t.useMemo(()=>u===void 0?void 0:ma(u,M),[u,M]);return{getRowGroupingForPath:l0,updateRowGroupingByPath:a0,mapper:$t.useCallback(P=>{if(typeof P=="number")return va(P,k);const A=va(P[1],k);return{...A,originalIndex:[P[0],A.originalIndex]}},[k])}}(Je,b),Bn=Je==null?void 0:Je.navigationBehavior,jo=d.useCallback(u=>{var F,ie,oe;const M=ci.value?u.metaKey:u.ctrlKey,k=M&&ee==="multi",P=M&&Se==="multi",[A,G]=u.location,W=z.columns,_=z.rows,[$,Y]=((F=z.current)==null?void 0:F.cell)??[];if(u.kind==="cell"){if(to.current=void 0,Br.current=[A,G],A===0&&wn){if(Wt===!0&&G===Xe||vn==="number"||ee==="none")return;const ge=Tn(u.location);if(ge.kind!==Hn.Marker)return;if(Xt!==void 0){const Ce=Ht(ge);Rn((Ce==null?void 0:Ce.kind)===Hn.Marker);const Te=(ie=Ce==null?void 0:Ce.onClick)==null?void 0:ie.call(Ce,{...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,theme:_o(ge,u.location),preventDefault:()=>{}});if(Te===void 0||Te.checked===ge.checked)return}i(void 0),bn();const we=_.hasIndex(G),_e=xr.current;if(ee==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&_e!==void 0&&_.hasIndex(_e)){const Ce=[Math.min(_e,G),Math.max(_e,G)+1];k||dt==="multi"?je(void 0,Ce,!0):je(yt.fromSingleSelection(Ce),void 0,k)}else ee==="multi"&&(k||u.isTouch||dt==="multi")?we?je(_.remove(G),void 0,!0):(je(void 0,G,!0),xr.current=G):we&&_.length===1?je(yt.empty(),void 0,M):(je(yt.fromSingleSelection(G),void 0,M),xr.current=G)}else if(A>=V&&Wt&&G===Xe){const ge=Si(A);eo(ge??A)}else if($!==A||Y!==G){const ge=Tn(u.location),we=Ht(ge);if((we==null?void 0:we.onSelect)!==void 0){let Te=!1;if(we.onSelect({...u,cell:ge,posX:u.localEventX,posY:u.localEventY,bounds:u.bounds,preventDefault:()=>Te=!0,theme:_o(ge,u.location)}),Te)return}if(Bn==="block"&&Nr(G).isGroupHeader)return;const _e=L&&G===Xe,Ce=L&&z!==void 0&&((oe=z.current)==null?void 0:oe.cell[1])===Xe;if(!u.shiftKey&&u.isLongTouch!==!0||$===void 0||Y===void 0||z.current===void 0||Ce)Lt({cell:[A,G],range:{x:A,y:G,width:1,height:1}},!0,M,"click"),xr.current=void 0,i(void 0),bn();else{if(_e)return;const Te=Math.min(A,$),Be=Math.max(A,$),_t=Math.min(G,Y),Ut=Math.max(G,Y);Lt({...z.current,range:{x:Te,y:_t,width:Be-Te+1,height:Ut-_t+1}},!0,M,"click"),xr.current=void 0,bn()}}}else if(u.kind==="header")if(Br.current=[A,G],i(void 0),wn&&A===0)xr.current=void 0,to.current=void 0,rr||ee!=="multi"||(_.length!==Xe?je(yt.fromSingleSelection([0,Xe]),void 0,M):je(yt.empty(),void 0,M),bn());else{const ge=to.current;if(Se==="multi"&&(u.shiftKey||u.isLongTouch===!0)&&ge!==void 0&&W.hasIndex(ge)){const we=[Math.min(ge,A),Math.max(ge,A)+1];P?ht(void 0,we,M):ht(yt.fromSingleSelection(we),void 0,M)}else P?(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(void 0,A,M),to.current=A):Se!=="none"&&(W.hasIndex(A)?ht(W.remove(A),void 0,M):ht(yt.fromSingleSelection(A),void 0,M),to.current=A);xr.current=void 0,bn()}else u.kind===Pn?Br.current=[A,G]:u.kind!==ui||u.isMaybeScrollbar||(Le(fi,!1),i(void 0),bn(),Kt==null||Kt(),xr.current=void 0,to.current=void 0)},[ee,Se,z,wn,V,Wt,Xe,vn,Tn,Xt,bn,dt,Ht,_o,je,Si,eo,Bn,Nr,L,Lt,ht,Le,Kt]),No=d.useRef(!1),Br=d.useRef(),k0=d.useRef(_r),An=d.useRef(),cp=d.useCallback(u=>{if(no.current=!1,k0.current=Gt.current,u.button!==0&&u.button!==1)return void(An.current=void 0);const M=performance.now();An.current={button:u.button,time:M,location:u.location},(u==null?void 0:u.kind)==="header"&&(No.current=!0);const k=u.kind==="cell"&&u.isFillHandle;!k&&u.kind!=="cell"&&u.isEdge||(c({previousSelection:z,fillHandle:k}),Br.current=void 0,u.isTouch||u.button!==0||k?u.isTouch||u.button!==1||(Br.current=u.location):jo(u))},[z,jo]),[Ea,Ia]=d.useState(),M0=d.useCallback(u=>{if(u.kind!==Pn||Se!=="multi")return;const M=ci.value?u.metaKey:u.ctrlKey,[k]=u.location,P=z.columns;if(k<V)return;const A=Ct[k];let G=k,W=k;for(let _=k-1;_>=V&&mo(A.group,Ct[_].group);_--)G--;for(let _=k+1;_<Ct.length&&mo(A.group,Ct[_].group);_++)W++;if(bn(),M)if(P.hasAll([G,W+1])){let _=P;for(let $=G;$<=W;$++)_=_.remove($);ht(_,void 0,M)}else ht(void 0,[G,W+1],M);else ht(yt.fromSingleSelection([G,W+1]),void 0,M)},[Se,bn,z.columns,Ct,V,ht]),no=d.useRef(!1),ki=d.useCallback(async u=>{if(Fe!==void 0&&Qe!==void 0){const M=Gt.current.y,k=Gt.current.height;let P=Fe({x:u,y:M,width:1,height:Math.min(k,Xe-M)},Ie.current.signal);typeof P!="object"&&(P=await P());const A=hn[u-V],G=document.createElement("canvas").getContext("2d",{alpha:!1});if(G!==null){G.font=gt.baseFontFull;const W=au(G,gt,A,0,P,or,Ar,!1,Ht);Qe==null||Qe(A,W.width,u,W.width)}}},[hn,Fe,Ar,gt,or,Qe,V,Xe,Ht]),[up,Ta]=d.useState(),ro=d.useCallback(async(u,M)=>{var _,$;const k=(_=u.current)==null?void 0:_.range;if(k===void 0||Fe===void 0||M.current===void 0)return;const P=M.current.range;if(S!==void 0){let Y=!1;if(S({fillDestination:{...P,x:P.x-V},patternSource:{...k,x:k.x-V},preventDefault:()=>Y=!0}),Y)return}let A=Fe(k,Ie.current.signal);typeof A!="object"&&(A=await A());const G=A,W=[];for(let Y=0;Y<P.width;Y++)for(let F=0;F<P.height;F++){const ie=[P.x+Y,P.y+F];if(Yc(ie,k))continue;const oe=G[F%k.height][Y%k.width];!kr(oe)&&so(oe)&&W.push({location:ie,value:{...oe}})}zn(W),($=ln.current)==null||$.damage(W.map(Y=>({cell:Y.location})))},[Fe,zn,S,V]),R0=d.useCallback(()=>{if(z.current===void 0||z.current.range.width<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,width:1}}};ro(u,z)},[ro,z]),E0=d.useCallback(()=>{if(z.current===void 0||z.current.range.height<=1)return;const u={...z,current:{...z.current,range:{...z.current.range,height:1}}};ro(u,z)},[ro,z]),dp=d.useCallback((u,M)=>{var F,ie;const k=s;if(c(void 0),ka(void 0),Ta(void 0),No.current=!1,M)return;if((k==null?void 0:k.fillHandle)===!0&&z.current!==void 0&&((F=k.previousSelection)==null?void 0:F.current)!==void 0){if(jr===void 0)return;const oe={...z,current:{...z.current,range:md(k.previousSelection.current.range,jr)}};return ro(k.previousSelection,oe),void Le(oe,!0)}const[P,A]=u.location,[G,W]=Br.current??[],_=()=>{no.current=!0},$=oe=>{var we,_e,Ce;const ge=oe.isTouch||G===P&&W===A;if(ge&&(I==null||I([P-V,A],{...oe,preventDefault:_})),oe.button===1)return!no.current;if(!no.current){const Te=Tn(u.location),Be=Ht(Te);if(Be!==void 0&&Be.onClick!==void 0&&ge){const Ut=Be.onClick({...oe,cell:Te,posX:oe.localEventX,posY:oe.localEventY,bounds:oe.bounds,theme:_o(Te,u.location),preventDefault:_});Ut!==void 0&&!kr(Ut)&&Mr(Ut)&&(zn([{location:oe.location,value:Ut}]),(we=ln.current)==null||we.damage([{cell:oe.location}]))}if(no.current||z.current===void 0)return!1;let _t=!1;switch(Te.activationBehaviorOverride??ut){case"double-click":case"second-click":{if(((Ce=(_e=k==null?void 0:k.previousSelection)==null?void 0:_e.current)==null?void 0:Ce.cell)===void 0)break;const[Ut,tn]=z.current.cell,[St,At]=k.previousSelection.current.cell;_t=P===Ut&&P===St&&A===tn&&A===At&&(oe.isDoubleClick===!0||ut==="second-click");break}case"single-click":_t=!0}if(_t)return m==null||m([P-V,A]),Zr(oe.bounds,!1),!0}return!1},Y=u.location[0]-V;if(u.isTouch){const oe=Gt.current,ge=k0.current;if(oe.x!==ge.x||oe.y!==ge.y)return;if(u.isLongTouch===!0){if(u.kind==="cell"&&vo((ie=z.current)==null?void 0:ie.cell,u.location))return void(J==null?void 0:J([Y,u.location[1]],{...u,preventDefault:_}));if(u.kind==="header"&&z.columns.hasIndex(P))return void(se==null?void 0:se(Y,{...u,preventDefault:_}));if(u.kind===Pn)return Y<0?void 0:void(Z==null?void 0:Z(Y,{...u,preventDefault:_}))}return void(u.kind==="cell"?$(u)||jo(u):u.kind===Pn?te==null?void 0:te(Y,{...u,preventDefault:_}):(u.kind===pr&&(O==null||O(Y,{...u,preventDefault:_})),jo(u)))}if(u.kind==="header"){if(Y<0)return;u.isEdge?u.isDoubleClick===!0&&ki(P):u.button===0&&P===G&&A===W&&(O==null||O(Y,{...u,preventDefault:_}))}if(u.kind===Pn){if(Y<0)return;u.button===0&&P===G&&A===W&&(te==null||te(Y,{...u,preventDefault:_}),no.current||M0(u))}u.kind!=="cell"||u.button!==0&&u.button!==1||$(u),Br.current=void 0},[s,z,V,jr,ro,Le,I,Tn,Ht,ut,_o,zn,m,Zr,J,se,Z,jo,te,O,ki,M0]),hp=d.useCallback(u=>{const M={...u,location:[u.location[0]-V,u.location[1]]};Ke==null||Ke(M),s!==void 0&&u.buttons===0&&(c(void 0),ka(void 0),Ta(void 0),No.current=!1),Ta(k=>{var P;return No.current?[u.scrollEdge[0],0]:u.scrollEdge[0]===(k==null?void 0:k[0])&&u.scrollEdge[1]===k[1]?k:s===void 0||(((P=An.current)==null?void 0:P.location[0])??0)<V?void 0:u.scrollEdge})},[s,Ke,V]),fp=d.useCallback((u,M)=>{pt==null||pt(u-V,M)},[pt,V]),gp=d.useCallback((u,M)=>{Ft==null||Ft(u-V,M)},[Ft,V]),qn=(A0=z==null?void 0:z.current)==null?void 0:A0.cell,pp=d.useCallback((u,M,k,P,A,G)=>{Dn.current=!1;let W=qn;W!==void 0&&(W=[W[0]-V,W[1]]);const _=Ae===0?void 0:{x:0,y:u.y,width:Ae,height:u.height},$=[];_!==void 0&&$.push(_),be>0&&($.push({x:u.x-V,y:Xe-be,width:u.width,height:be}),Ae>0&&$.push({x:0,y:Xe-be,width:Ae,height:be}));const Y={x:u.x-V,y:u.y,width:u.width,height:Wt&&u.y+u.height>=Xe?u.height-1:u.height,tx:A,ty:G,extras:{selected:W,freezeRegion:_,freezeRegions:$}};Gt.current=Y,Lo(Y),an([M,k,P]),un==null||un(Y,Y.tx,Y.ty,Y.extras)},[qn,V,Wt,Xe,Ae,be,Lo,un]),mp=dr(T,d.useCallback((u,M)=>(T==null?void 0:T(u-V,M-V))!==!1,[T,V])),vp=dr(We,d.useCallback((u,M)=>{We==null||We(u-V,M-V),Se!=="none"&&ht(yt.fromSingleSelection(M),void 0,!0)},[Se,We,V,ht])),Ha=d.useRef(!1),wp=d.useCallback(u=>{u.location[0]===0&&V>0?u.preventDefault():(nt==null||nt({...u,location:[u.location[0]-V,u.location[1]]}),u.defaultPrevented()||(Ha.current=!0),c(void 0))},[nt,V]),yp=d.useCallback(()=>{Ha.current=!1},[]),I0=Je==null?void 0:Je.selectionBehavior,Mi=d.useCallback(u=>{if(I0!=="block-spanning")return;const{isGroupHeader:M,path:k,groupRows:P}=Nr(u);if(M)return[u,u];const A=k[k.length-1];return[u-A,u+P-A-1]},[Nr,I0]),Oa=d.useRef(),Pa=d.useCallback(u=>{var M,k,P;if(!(qf(u,Oa.current)||(Oa.current=u,((M=An==null?void 0:An.current)==null?void 0:M.button)!==void 0&&An.current.button>=1))){if(u.buttons!==0&&s!==void 0&&((k=An.current)==null?void 0:k.location[0])===0&&u.location[0]===0&&V===1&&ee==="multi"&&s.previousSelection&&!s.previousSelection.rows.hasIndex(An.current.location[1])&&z.rows.hasIndex(An.current.location[1])){const A=Math.min(An.current.location[1],u.location[1]),G=Math.max(An.current.location[1],u.location[1])+1;je(yt.fromSingleSelection([A,G]),void 0,!1)}if(!(u.buttons===0||s===void 0||z.current===void 0||Ha.current||No.current||Me!=="rect"&&Me!=="multi-rect")){const[A,G]=z.current.cell;let[W,_]=u.location;if(_<0&&(_=Gt.current.y),s.fillHandle===!0&&((P=s.previousSelection)==null?void 0:P.current)!==void 0){const $=s.previousSelection.current.range;_=Math.min(_,Wt?Xe-1:Xe);const Y=function(F,ie,oe,ge){if(ge==="any")return md(F,{x:ie,y:oe,width:1,height:1});if(ge==="vertical"&&(ie=F.x),ge==="horizontal"&&(oe=F.y),Yc([ie,oe],F))return;const we=ie-F.x,_e=F.x+F.width-ie,Ce=oe-F.y+1,Te=F.y+F.height-oe,Be=Math.min(ge==="vertical"?Number.MAX_SAFE_INTEGER:we,ge==="vertical"?Number.MAX_SAFE_INTEGER:_e,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Ce,ge==="horizontal"?Number.MAX_SAFE_INTEGER:Te);return Be===Te?{x:F.x,y:F.y+F.height,width:F.width,height:oe-F.y-F.height+1}:Be===Ce?{x:F.x,y:oe,width:F.width,height:F.y-oe}:Be===_e?{x:F.x+F.width,y:F.y,width:ie-F.x-F.width+1,height:F.height}:{x:ie,y:F.y,width:F.x-ie,height:F.height}}($,W,_,wt);ka(Y)}else{if(Wt&&G===Xe)return;if(Wt&&_===Xe){if(u.kind!==ui)return;_--}W=Math.max(W,V);const $=Mi(G);_=$===void 0?_:On(_,$[0],$[1]);const Y=W-A,F=_-G,ie={x:Y>=0?A:W,y:F>=0?G:_,width:Math.abs(Y)+1,height:Math.abs(F)+1};Lt({...z.current,range:ie},!0,!1,"drag")}}nn==null||nn({...u,location:[u.location[0]-V,u.location[1]]})}},[s,V,ee,z,Me,nn,je,Wt,Xe,wt,Mi,Lt]),bp=d.useCallback(()=>{var W,_;const u=Oa.current;if(u===void 0)return;const[M,k]=u.scrollEdge;let[P,A]=u.location;const G=Gt.current;M===-1?P=((_=(W=G.extras)==null?void 0:W.freezeRegion)==null?void 0:_.x)??G.x:M===1&&(P=G.x+G.width),k===-1?A=Math.max(0,G.y):k===1&&(A=Math.min(Xe-1,G.y+G.height)),P=On(P,0,Ct.length-1),A=On(A,0,Xe-1),Pa({...u,location:[P,A]})},[Ct.length,Pa,Xe]);(function(u,M,k){const P=$t.useRef(0),[A,G]=u??[0,0];$t.useEffect(()=>{if(A===0&&G===0)return void(P.current=0);let W=!1,_=0;const $=Y=>{var F;if(!W){if(_===0)_=Y;else{const ie=Y-_;P.current=Math.min(1,P.current+ie/1300);const oe=P.current**1.618*ie*2;(F=M.current)==null||F.scrollBy(A*oe,G*oe),_=Y,k==null||k()}window.requestAnimationFrame($)}};return window.requestAnimationFrame($),()=>{W=!0}},[M,A,G,k])})(up,zt,bp);const Wn=d.useCallback(u=>{if(z.current===void 0)return;const[M,k]=u,[P,A]=z.current.cell,G=z.current.range;let W=G.x,_=G.x+G.width,$=G.y,Y=G.y+G.height;const[F,ie]=Mi(A)??[0,Xe-1],oe=ie+1;if(k!==0)switch(k){case 2:Y=oe,$=A,Qt(0,Y,"vertical");break;case-2:$=F,Y=A+1,Qt(0,$,"vertical");break;case 1:$<A?($++,Qt(0,$,"vertical")):(Y=Math.min(oe,Y+1),Qt(0,Y,"vertical"));break;case-1:Y>A+1?(Y--,Qt(0,Y,"vertical")):($=Math.max(F,$-1),Qt(0,$,"vertical"));break;default:lo()}if(M!==0)if(M===2)_=Ct.length,W=P,Qt(_-1-V,0,"horizontal");else if(M===-2)W=V,_=P+1,Qt(W-V,0,"horizontal");else{let ge=[];if(Fe!==void 0){const we=Fe({x:W,y:$,width:_-W-V,height:Y-$},Ie.current.signal);typeof we=="object"&&(ge=function(_e){return S1(Zu(Zu(_e).filter(Ce=>Ce.span!==void 0).map(Ce=>{var Te,Be;return Pr((((Te=Ce.span)==null?void 0:Te[0])??0)+1,(((Be=Ce.span)==null?void 0:Be[1])??0)+1)})))}(we))}if(M===1){let we=!1;if(W<P){if(ge.length>0){const _e=Pr(W+1,P+1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(W=_e,we=!0)}else W++,we=!0;we&&Qt(W,0,"horizontal")}we||(_=Math.min(Ct.length,_+1),Qt(_-1-V,0,"horizontal"))}else if(M===-1){let we=!1;if(_>P+1){if(ge.length>0){const _e=Pr(_-1,P,-1).find(Ce=>!ge.includes(Ce-V));_e!==void 0&&(_=_e,we=!0)}else _--,we=!0;we&&Qt(_-V,0,"horizontal")}we||(W=Math.max(V,W-1),Qt(W-V,0,"horizontal"))}else lo()}Lt({cell:z.current.cell,range:{x:W,y:$,width:_-W,height:Y-$}},!0,!1,"keyboard-select")},[Fe,Mi,z,Ct.length,V,Xe,Qt,Lt]),Da=d.useRef(Eo);Da.current=Eo;const Cr=d.useCallback((u,M,k,P)=>{const A=fn-(k?0:1);u=On(u,V,hn.length-1+V),M=On(M,0,A);const G=qn==null?void 0:qn[0],W=qn==null?void 0:qn[1];if(u===G&&M===W)return!1;if(P&&z.current!==void 0){const _=[...z.current.rangeStack];(z.current.range.width>1||z.current.range.height>1)&&_.push(z.current.range),Le({...z,current:{cell:[u,M],range:{x:u,y:M,width:1,height:1},rangeStack:_}},!0)}else Lt({cell:[u,M],range:{x:u,y:M,width:1,height:1}},!0,!1,"keyboard-nav");return h.current!==void 0&&h.current[0]===u&&h.current[1]===M&&(h.current=void 0),Da.current&&Qt(u-V,M),!0},[fn,V,hn.length,qn,z,Qt,Le,Lt]),xp=d.useCallback((u,M)=>{(o==null?void 0:o.cell)!==void 0&&u!==void 0&&Mr(u)&&(zn([{location:o.cell,value:u}]),window.requestAnimationFrame(()=>{var A;(A=ln.current)==null||A.damage([{cell:o.cell}])})),bn(!0),i(void 0);const[k,P]=M;if(z.current!==void 0&&(k!==0||P!==0)){const A=z.current.cell[1]===fn-1&&u!==void 0;Cr(On(z.current.cell[0]+k,0,Ct.length-1),On(z.current.cell[1]+P,0,fn-1),A,!1)}R==null||R(u,M)},[o==null?void 0:o.cell,bn,z,R,zn,fn,Cr,Ct.length]),Cp=d.useMemo(()=>"gdg-overlay-"+Mg++,[]),Wr=d.useCallback(u=>{var k,P,A,G;bn();const M=[];for(let W=u.x;W<u.x+u.width;W++)for(let _=u.y;_<u.y+u.height;_++){const $=x([W-V,_]);if(!$.allowOverlay&&$.kind!==pe.Boolean)continue;let Y;if($.kind===pe.Custom){const F=Ht($),ie=(k=F==null?void 0:F.provideEditor)==null?void 0:k.call(F,{...$,location:[W-V,_]});(F==null?void 0:F.onDelete)!==void 0?Y=F.onDelete($):$a(ie)&&(Y=(P=ie==null?void 0:ie.deletedValue)==null?void 0:P.call(ie,$))}else if(Mr($)&&$.allowOverlay||$.kind===pe.Boolean){const F=Ht($);Y=(A=F==null?void 0:F.onDelete)==null?void 0:A.call(F,$)}Y!==void 0&&!kr(Y)&&Mr(Y)&&M.push({location:[W,_],value:Y})}zn(M),(G=ln.current)==null||G.damage(M.map(W=>({cell:W.location})))},[bn,x,Ht,zn,V]),Bo=o!==void 0,T0=d.useCallback(u=>{var we,_e;const M=()=>{u.stopPropagation(),u.preventDefault()},k={didMatch:!1},{bounds:P}=u,A=z.columns,G=z.rows,W=Un;if(!Bo&&at(W.clear,u,k))Le(fi,!1),Kt==null||Kt();else if(!Bo&&at(W.selectAll,u,k))Le({columns:yt.empty(),rows:yt.empty(),current:{cell:((we=z.current)==null?void 0:we.cell)??[V,0],range:{x:V,y:0,width:g.length,height:Xe},rangeStack:[]}},!1);else if(at(W.search,u,k))(_e=l==null?void 0:l.current)==null||_e.focus({preventScroll:!0}),ue(!0);else if(at(W.delete,u,k)){const Ce=(on==null?void 0:on(z))??!0;if(Ce!==!1){const Te=Ce===!0?z:Ce;if(Te.current!==void 0){Wr(Te.current.range);for(const Be of Te.current.rangeStack)Wr(Be)}for(const Be of Te.rows)Wr({x:V,y:Be,width:g.length,height:1});for(const Be of Te.columns)Wr({x:Be,y:0,width:1,height:Xe})}}if(k.didMatch)return M(),!0;if(z.current===void 0)return!1;let[_,$]=z.current.cell;const[,Y]=z.current.cell;let F=!1,ie=!1;if(at(W.scrollToSelectedCell,u,k)?Ii.current(_-V,$):Se!=="none"&&at(W.selectColumn,u,k)?A.hasIndex(_)?ht(A.remove(_),void 0,!0):Se==="single"?ht(yt.fromSingleSelection(_),void 0,!0):ht(void 0,_,!0):ee!=="none"&&at(W.selectRow,u,k)?G.hasIndex($)?je(G.remove($),void 0,!0):ee==="single"?je(yt.fromSingleSelection($),void 0,!0):je(void 0,$,!0):!Bo&&P!==void 0&&at(W.activateCell,u,k)?$===Xe&&Wt?window.setTimeout(()=>{const Ce=Si(_);eo(Ce??_)},0):(m==null||m([_-V,$]),Zr(P,!0)):z.current.range.height>1&&at(W.downFill,u,k)?E0():z.current.range.width>1&&at(W.rightFill,u,k)?R0():at(W.goToNextPage,u,k)?$+=Math.max(1,Gt.current.height-4):at(W.goToPreviousPage,u,k)?$-=Math.max(1,Gt.current.height-4):at(W.goToFirstCell,u,k)?(i(void 0),$=0,_=0):at(W.goToLastCell,u,k)?(i(void 0),$=Number.MAX_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER):at(W.selectToFirstCell,u,k)?(i(void 0),Wn([-2,-2])):at(W.selectToLastCell,u,k)?(i(void 0),Wn([2,2])):Bo?(at(W.closeOverlay,u,k)&&i(void 0),at(W.acceptOverlayDown,u,k)&&(i(void 0),$++),at(W.acceptOverlayUp,u,k)&&(i(void 0),$--),at(W.acceptOverlayLeft,u,k)&&(i(void 0),_--),at(W.acceptOverlayRight,u,k)&&(i(void 0),_++)):(at(W.goDownCell,u,k)?$+=1:at(W.goUpCell,u,k)?$-=1:at(W.goRightCell,u,k)?_+=1:at(W.goLeftCell,u,k)?_-=1:at(W.goDownCellRetainSelection,u,k)?($+=1,F=!0):at(W.goUpCellRetainSelection,u,k)?($-=1,F=!0):at(W.goRightCellRetainSelection,u,k)?(_+=1,F=!0):at(W.goLeftCellRetainSelection,u,k)?(_-=1,F=!0):at(W.goToLastRow,u,k)?$=Xe-1:at(W.goToFirstRow,u,k)?$=Number.MIN_SAFE_INTEGER:at(W.goToLastColumn,u,k)?_=Number.MAX_SAFE_INTEGER:at(W.goToFirstColumn,u,k)?_=Number.MIN_SAFE_INTEGER:Me!=="rect"&&Me!=="multi-rect"||(at(W.selectGrowDown,u,k)?Wn([0,1]):at(W.selectGrowUp,u,k)?Wn([0,-1]):at(W.selectGrowRight,u,k)?Wn([1,0]):at(W.selectGrowLeft,u,k)?Wn([-1,0]):at(W.selectToLastRow,u,k)?Wn([0,2]):at(W.selectToFirstRow,u,k)?Wn([0,-2]):at(W.selectToLastColumn,u,k)?Wn([2,0]):at(W.selectToFirstColumn,u,k)&&Wn([-2,0])),ie=k.didMatch),Bn!==void 0&&Bn!=="normal"&&$!==Y){const Ce=Bn==="skip-down"||Bn==="skip"||Bn==="block",Te=$<Y;if(Te&&(Bn==="skip-up"||Bn==="skip"||Bn==="block")){for(;$>=0&&Nr($).isGroupHeader;)$--;$<0&&($=Y)}else if(!Te&&Ce){for(;$<Xe&&Nr($).isGroupHeader;)$++;$>=Xe&&($=Y)}}const oe=Cr(_,$,!1,F),ge=k.didMatch;return ge&&(oe||!ie||It)&&M(),ge},[Bn,Bo,z,Un,Se,ee,Me,V,Nr,Xe,Cr,Le,Kt,g.length,on,It,Wr,ht,je,Wt,Si,eo,m,Zr,E0,R0,Wn]),Wo=d.useCallback(u=>{let M=!1;if(he!==void 0&&he({...u,...u.location&&{location:[u.location[0]-V,u.location[1]]},cancel:()=>{M=!0}}),M||T0(u)||z.current===void 0)return;const[k,P]=z.current.cell,A=Gt.current;if(Ze&&!u.metaKey&&!u.ctrlKey&&z.current!==void 0&&u.key.length===1&&/[\p{L}\p{M}\p{N}\p{S}\p{P}]/u.test(u.key)&&u.bounds!==void 0&&so(x([k-V,Math.max(0,Math.min(P,Xe-1))]))){if((!Wt||P!==Xe)&&(A.y>P||P>A.y+A.height||A.x>k||k>A.x+A.width))return;m==null||m([k-V,P]),Zr(u.bounds,!0,u.key),u.stopPropagation(),u.preventDefault()}},[Ze,he,T0,z,x,V,Xe,Wt,m,Zr]),Sp=d.useCallback((u,M)=>{const k=u.location[0]-V;if(u.kind==="header"&&(se==null||se(k,{...u,preventDefault:M})),u.kind===Pn){if(k<0)return;Z==null||Z(k,{...u,preventDefault:M})}if(u.kind==="cell"){const[P,A]=u.location;J==null||J([k,A],{...u,preventDefault:M}),function(G,W){const[_,$]=W;if(G.columns.hasIndex(_)||G.rows.hasIndex($))return!0;if(G.current!==void 0){if(vo(G.current.cell,W))return!0;const Y=[G.current.range,...G.current.rangeStack];for(const F of Y)if(_>=F.x&&_<F.x+F.width&&$>=F.y&&$<F.y+F.height)return!0}return!1}(z,u.location)||Cr(P,A,!1,!1)}},[z,J,Z,se,V,Cr]),za=d.useCallback(async u=>{var W,_,$;if(!Un.paste)return;function M(Y,F,ie,oe){var we,_e;const ge=typeof ie=="object"?(ie==null?void 0:ie.join(`
128
+ `))??"":(ie==null?void 0:ie.toString())??"";if(!kr(Y)&&so(Y)&&Y.readonly!==!0){const Ce=H==null?void 0:H(ge,Y);if(Ce!==void 0&&Mr(Ce))return{location:F,value:Ce};const Te=Ht(Y);if(Te===void 0)return;if(Te.kind===pe.Custom){Rn(Y.kind===pe.Custom);const Be=(we=Te.onPaste)==null?void 0:we.call(Te,ge,Y.data);return Be===void 0?void 0:{location:F,value:{...Y,data:Be}}}{const Be=(_e=Te.onPaste)==null?void 0:_e.call(Te,ge,Y,{formatted:oe,formattedString:typeof oe=="string"?oe:oe==null?void 0:oe.join(`
129
+ `),rawValue:ie});return Be===void 0?void 0:(Rn(Be.kind===Y.kind),{location:F,value:Be})}}}const k=z.columns,P=z.rows,A=((W=zt.current)==null?void 0:W.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0;let G;if(z.current!==void 0?G=[z.current.range.x,z.current.range.y]:k.length===1?G=[k.first()??0,0]:P.length===1&&(G=[V,P.first()??0]),A&&G!==void 0){let Y,F;const ie="text/plain",oe="text/html";if(navigator.clipboard.read!==void 0){const Ce=await navigator.clipboard.read();for(const Te of Ce){if(Te.types.includes(oe)){const Be=await Te.getType(oe),_t=e0(await Be.text());if(_t!==void 0){Y=_t;break}}Te.types.includes(ie)&&(F=await(await Te.getType(ie)).text())}}else if(navigator.clipboard.readText!==void 0)F=await navigator.clipboard.readText();else{if(u===void 0||(u==null?void 0:u.clipboardData)===null)return;u.clipboardData.types.includes(oe)&&(Y=e0(u.clipboardData.getData(oe))),Y===void 0&&u.clipboardData.types.includes(ie)&&(F=u.clipboardData.getData(ie))}const[ge,we]=G,_e=[];do{if(ct===void 0){const Ce=M(Tn(G),G,F??(Y==null?void 0:Y.map(Te=>Te.map(Be=>Be.rawValue).join(" ")).join(" "))??"",void 0);Ce!==void 0&&_e.push(Ce);break}if(Y===void 0){if(F===void 0)return;Y=wg(F)}if(ct===!1||typeof ct=="function"&&(ct==null?void 0:ct([G[0]-V,G[1]],Y.map(Ce=>Ce.map(Te=>{var Be;return((Be=Te.rawValue)==null?void 0:Be.toString())??""}))))!==!0)return;for(const[Ce,Te]of Y.entries()){if(Ce+we>=Xe)break;for(const[Be,_t]of Te.entries()){const Ut=[Be+ge,Ce+we],[tn,St]=Ut;if(tn>=Ct.length||St>=fn)continue;const At=M(Tn(Ut),Ut,_t.rawValue,_t.formatted);At!==void 0&&_e.push(At)}}}while(!1);zn(_e),($=ln.current)==null||$.damage(_e.map(Ce=>({cell:Ce.location})))}},[H,Ht,Tn,z,Un.paste,zt,Ct.length,zn,fn,ct,V,Xe]);cn("paste",za,C,!1,!0);const $o=d.useCallback(async(u,M)=>{var W,_;if(!Un.copy)return;const k=M===!0||((W=zt.current)==null?void 0:W.contains(document.activeElement))===!0||((_=a.current)==null?void 0:_.contains(document.activeElement))===!0,P=z.columns,A=z.rows,G=($,Y)=>{n0(Ee?[Y.map(F=>({kind:pe.Text,data:g[F].title,displayData:g[F].title,allowOverlay:!1})),...$]:$,Y,u)};if(k&&Fe!==void 0){if(z.current!==void 0){let $=Fe(z.current.range,Ie.current.signal);typeof $!="object"&&($=await $()),G($,Pr(z.current.range.x-V,z.current.range.x+z.current.range.width-V))}else if(A!==void 0&&A.length>0){const $=[...A].map(Y=>{const F=Fe({x:V,y:Y,width:g.length,height:1},Ie.current.signal);return typeof F=="object"?F[0]:F().then(ie=>ie[0])});$.some(Y=>Y instanceof Promise)?G(await Promise.all($),Pr(g.length)):G($,Pr(g.length))}else if(P.length>0){const $=[],Y=[];for(const F of P){let ie=Fe({x:F,y:0,width:1,height:Xe},Ie.current.signal);typeof ie!="object"&&(ie=await ie()),$.push(ie),Y.push(F-V)}$.length===1?G($[0],Y):G($.reduce((F,ie)=>F.map((oe,ge)=>[...oe,...ie[ge]])),Y)}}},[g,Fe,z,Un.copy,V,zt,Xe,Ee]);cn("copy",$o,C,!1,!1),cn("cut",d.useCallback(async u=>{var M,k;if(Un.cut&&(((M=zt.current)==null?void 0:M.contains(document.activeElement))===!0||((k=a.current)==null?void 0:k.contains(document.activeElement))===!0)&&(await $o(u),z.current!==void 0)){let P={current:{cell:z.current.cell,range:z.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const A=on==null?void 0:on(P);if(A===!1||(P=A===!0?P:A,P.current===void 0))return;Wr(P.current.range)}},[Wr,z,Un.cut,$o,zt,on]),C,!1,!1);const kp=d.useCallback((u,M)=>{if(ne!==void 0)return V!==0&&(u=u.map(A=>[A[0]-V,A[1]])),void ne(u,M);if(u.length===0||M===-1)return;const[k,P]=u[M];h.current!==void 0&&h.current[0]===k&&h.current[1]===P||(h.current=[k,P],Cr(k,P,!1,!1))},[ne,V,Cr]),[Ri,Ei]=((F0=jt==null?void 0:jt.current)==null?void 0:F0.cell)??[],Ii=d.useRef(Qt);Ii.current=Qt,d.useLayoutEffect(()=>{var u,M,k,P;!Da.current||Dn.current||Ri===void 0||Ei===void 0||Ri===((M=(u=De.current)==null?void 0:u.current)==null?void 0:M.cell[0])&&Ei===((P=(k=De.current)==null?void 0:k.current)==null?void 0:P.cell[1])||Ii.current(Ri,Ei),Dn.current=!1},[Ri,Ei]);const H0=z.current!==void 0&&(z.current.cell[0]>=Ct.length||z.current.cell[1]>=fn);d.useLayoutEffect(()=>{H0&&Le(fi,!1)},[H0,Le]);const Mp=d.useMemo(()=>Wt===!0&&(re==null?void 0:re.tint)===!0?yt.fromSingleSelection(fn-1):yt.empty(),[fn,Wt,re==null?void 0:re.tint]),Rp=d.useCallback(u=>typeof ve=="boolean"?ve:(ve==null?void 0:ve(u-V))??!0,[V,ve]),Ep=d.useMemo(()=>{if(Ea===void 0||a.current===null)return null;const{bounds:u,group:M}=Ea,k=a.current.getBoundingClientRect();return d.createElement(gg,{bounds:u,group:M,canvasBounds:k,onClose:()=>Ia(void 0),onFinish:P=>{Ia(void 0),fe==null||fe(M,P)}})},[fe,Ea]),Ip=Math.min(Ct.length,Ae+(wn?1:0));d.useImperativeHandle(t,()=>({appendRow:(u,M)=>eo(u+V,M),updateCells:u=>{var M;return V!==0&&(u=u.map(k=>({cell:[k.cell[0]+V,k.cell[1]]}))),(M=ln.current)==null?void 0:M.damage(u)},getBounds:(u,M)=>{var k;if((a==null?void 0:a.current)!==null&&(zt==null?void 0:zt.current)!==null){if(u===void 0&&M===void 0){const P=a.current.getBoundingClientRect(),A=P.width/zt.current.clientWidth;return{x:P.x-zt.current.scrollLeft*A,y:P.y-zt.current.scrollTop*A,width:zt.current.scrollWidth*A,height:zt.current.scrollHeight*A}}return(k=ln.current)==null?void 0:k.getBounds((u??0)+V,M)}},focus:()=>{var u;return(u=ln.current)==null?void 0:u.focus()},emit:async u=>{switch(u){case"delete":Wo({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":Wo({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":Wo({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 $o(void 0,!0);break;case"paste":await za()}},scrollTo:Qt,remeasureColumns:u=>{for(const M of u)ki(M+V)},getMouseArgsForPosition:(u,M,k)=>{if((ln==null?void 0:ln.current)===null)return;const P=ln.current.getMouseArgsForPosition(u,M,k);return P!==void 0?{...P,location:[P.location[0]-V,P.location[1]]}:void 0}}),[eo,ki,zt,$o,Wo,za,V,Qt]);const[O0,P0]=qn??[],Tp=d.useCallback(u=>{const[M,k]=u;k!==-1?O0===M&&P0===k||(Lt({cell:u,range:{x:M,y:k,width:1,height:1}},!0,!1,"keyboard-nav"),Qt(M,k)):Se!=="none"&&(ht(yt.fromSingleSelection(M),void 0,!1),bn())},[Se,bn,Qt,O0,P0,Lt,ht]),[Hp,Op]=d.useState(!1),D0=d.useRef(Fc(u=>{Op(u)},5)),Pp=d.useCallback(()=>{D0.current(!0),z.current===void 0&&z.columns.length===0&&z.rows.length===0&&s===void 0&&Lt({cell:[V,wi],range:{x:V,y:wi,width:1,height:1}},!0,!1,"keyboard-select")},[wi,z,s,V,Lt]),Dp=d.useCallback(()=>{D0.current(!1)},[]),[zp,Ap]=d.useMemo(()=>{let u;const M=(it==null?void 0:it.scrollbarWidthOverride)??Ki(),k=Xe+(Wt?1:0);if(typeof Vn=="number")u=lr+k*Vn;else{let A=0;const G=Math.min(k,10);for(let W=0;W<G;W++)A+=Vn(W);A=Math.floor(A/G),u=lr+k*A}u+=M;const P=Ct.reduce((A,G)=>G.width+A,0)+M;return[`${Math.min(1e5,P)}px`,`${Math.min(1e5,u)}px`]},[Ct,it==null?void 0:it.scrollbarWidthOverride,Vn,Xe,Wt,lr]),Fp=d.useMemo(()=>Xa(gt),[gt]);return d.createElement(Wa.Provider,{value:gt},d.createElement(bg,{style:Fp,className:ce,inWidth:v??zp,inHeight:E??Ap},d.createElement(hg,{fillHandle:Ue,drawFocusRing:zr,experimental:it,fixedShadowX:tt,fixedShadowY:Oe,getRowThemeOverride:jn,headerIcons:Nt,imageWindowLoader:gn,initialSize:Zt,isDraggable:rn,onDragLeave:Bt,onRowMoved:Xt,overscrollX:Do,overscrollY:zo,preventDiagonalScrolling:kn,rightElement:pn,rightElementProps:kt,smoothScrollX:Vt,smoothScrollY:Et,className:ce,enableGroups:Jr,onCanvasFocused:Pp,onCanvasBlur:Dp,canvasRef:a,onContextMenu:Sp,theme:gt,cellXOffset:lp,cellYOffset:wi,accessibilityHeight:_r.height,onDragEnd:yp,columns:Ct,nonGrowWidth:vi,drawHeader:br,onColumnProposeMove:mp,drawCell:ir,disabledRows:Mp,freezeColumns:Ip,lockColumns:V,firstColAccessible:V===0,getCellContent:Tn,minColumnWidth:or,maxColumnWidth:Ar,searchInputRef:l,showSearch:xe,onSearchClose:de,highlightRegions:sp,getCellsForSelection:Fe,getGroupDetails:Ma,headerHeight:Fr,isFocused:Hp,groupHeaderHeight:Jr?Po:0,freezeTrailingRows:be+(Wt&&(re==null?void 0:re.sticky)===!0?1:0),hasAppendRow:Wt,onColumnResize:Qe,onColumnResizeEnd:dn,onColumnResizeStart:en,onCellFocused:Tp,onColumnMoved:vp,onDragStart:wp,onHeaderMenuClick:fp,onHeaderIndicatorClick:gp,onItemHovered:Pa,isFilling:(s==null?void 0:s.fillHandle)===!0,onMouseMove:hp,onKeyDown:Wo,onKeyUp:ze,onMouseDown:cp,onMouseUp:dp,onDragOverCell:Ve,onDrop:Ye,onSearchResultsChanged:kp,onVisibleRegionChanged:pp,clientSize:yn,rowHeight:Vn,searchResults:X,searchValue:ae,onSearchValueChange:Q,rows:fn,scrollRef:zt,selection:z,translateX:_r.tx,translateY:_r.ty,verticalBorder:Rp,gridRef:ln,getCellRenderer:Ht,resizeIndicator:Ca}),Ep,o!==void 0&&d.createElement(d.Suspense,{fallback:null},d.createElement(kg,{...o,validateCell:Mt,bloom:D,id:Cp,getCellRenderer:Ht,className:(it==null?void 0:it.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:_n,imageEditorOverride:y,onFinishEditing:xp,markdownDivCreateNode:w,isOutsideClick:wr,customEventTarget:it==null?void 0:it.eventTarget}))))});function s0(e){const{cell:t,posX:n,posY:r,bounds:o,theme:i}=e,{width:l,height:a,x:s,y:c}=o,h=t.maxSize??i.checkboxMaxSize,C=Math.floor(o.y+a/2),y=Nc(h,a,i.cellVerticalPadding),p=jc(t.contentAlign??"center",s,l,i.cellHorizontalPadding,y),w=_c(p,C,y),v=Bc(s+n,c+r,w);return Bi(t)&&v}const Eg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:pe.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>function(t,n,r,o,i){if(!r&&n===Qo)return;const{ctx:l,hoverAmount:a,theme:s,rect:c,highlighted:h,hoverX:C,hoverY:y,cell:{contentAlign:p}}=t,{x:w,y:v,width:E,height:g}=c;let b=!1;if(i>0){let x=r?1-i+i*a:.4;if(n===Qo&&(x*=a),x===0)return;x<1&&(b=!0,l.globalAlpha=x)}sa(l,s,n,w,v,E,g,h,C,y,o,p),b&&(l.globalAlpha=1)}(e,e.cell.data,Bi(e.cell),e.cell.maxSize??e.theme.checkboxMaxSize,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{s0(e)&&e.preventDefault()},onClick:e=>{if(s0(e))return{...e.cell,data:r0(e.cell.data)}},onPaste:(e,t)=>{let n=Qo;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=Ni),n===t.data?void 0:{...t,data:n}}},Ig=Cn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),Tg=e=>{const{bubbles:t}=e;return d.createElement(Ig,null,t.map((n,r)=>d.createElement("div",{key:r,className:"boe-bubble"},n)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},Hg={getAccessibilityString:e=>Wc(e.data),kind:pe.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>{const r=t.data.reduce((o,i)=>e.measureText(i).width+o+2*n.bubblePadding+n.bubbleMargin,0);return t.data.length===0?2*n.cellHorizontalPadding:r+2*n.cellHorizontalPadding-n.bubbleMargin},draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,highlighted:l}=t,{x:a,y:s,width:c,height:h}=r;let C=a+o.cellHorizontalPadding;const y=[];for(const p of n){if(C>a+c)break;const w=Kr(p,i,o.baseFontFull).width;y.push({x:C,width:w}),C+=w+2*o.bubblePadding+o.bubbleMargin}i.beginPath();for(const p of y)Yn(i,p.x,s+(h-o.bubbleHeight)/2,p.width+2*o.bubblePadding,o.bubbleHeight,o.roundingRadius??o.bubbleHeight/2);i.fillStyle=l?o.bgBubbleSelected:o.bgBubble,i.fill();for(const[p,w]of y.entries())i.beginPath(),i.fillStyle=o.textBubble,i.fillText(n[p],w.x+o.bubblePadding,s+h/2+fr(i,o))}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Tg,{bubbles:t.data})},onPaste:()=>{}},Og=Cn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),Pg=e=>{const{drilldowns:t}=e;return d.createElement(Og,null,t.map((n,r)=>d.createElement("div",{key:r,className:"doe-bubble"},n.img!==void 0&&d.createElement("img",{src:n.img}),d.createElement("div",null,n.text))))},Dg={getAccessibilityString:e=>Wc(e.data.map(t=>t.text)),kind:pe.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((r,o)=>e.measureText(o.text).width+r+2*n.bubblePadding+n.bubbleMargin+(o.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>function(t,n){const{rect:r,theme:o,ctx:i,imageLoader:l,col:a,row:s}=t,{x:c,width:h}=r,C=o.baseFontFull,y=tu(i,C),p=Math.min(r.height,Math.max(16,2*Math.ceil(y*o.lineHeight))),w=Math.floor(r.y+(r.height-p)/2),v=p-10,E=o.bubblePadding,g=o.bubbleMargin;let b=c+o.cellHorizontalPadding;const x=o.roundingRadius??6,I=function(S,R,H,f){const B=Math.ceil(window.devicePixelRatio),D=5,O=H-2*D,T=4,j=H*B,U=f+D,te=3*f,J=(te+2*D)*B,ce=`${S},${R},${B},${H}`;if(wa[ce]!==void 0)return{el:wa[ce],height:j,width:J,middleWidth:T*B,sideWidth:U*B,padding:D*B,dpr:B};const se=document.createElement("canvas"),q=se.getContext("2d");return q===null?null:(se.width=J,se.height=j,q.scale(B,B),wa[ce]=se,q.beginPath(),Yn(q,D,D,te,O,f),q.shadowColor="rgba(24, 25, 34, 0.4)",q.shadowBlur=1,q.fillStyle=S,q.fill(),q.shadowColor="rgba(24, 25, 34, 0.3)",q.shadowOffsetY=1,q.shadowBlur=5,q.fillStyle=S,q.fill(),q.shadowOffsetY=0,q.shadowBlur=0,q.shadowBlur=0,q.beginPath(),Yn(q,D+.5,D+.5,te,O,f),q.strokeStyle=R,q.lineWidth=1,q.stroke(),{el:se,height:j,width:J,sideWidth:U*B,middleWidth:f*B,padding:D*B,dpr:B})}(o.bgCell,o.drilldownBorder,p,x),m=[];for(const S of n){if(b>c+h)break;const R=Kr(S.text,i,C).width;let H=0;S.img!==void 0&&l.loadOrGetImage(S.img,a,s)!==void 0&&(H=v-8+4);const f=R+H+2*E;m.push({x:b,width:f}),b+=f+g}if(I!==null){const{el:S,height:R,middleWidth:H,sideWidth:f,width:B,dpr:D,padding:O}=I,T=f/D,j=O/D;for(const U of m){const te=Math.floor(U.x),J=Math.floor(U.width),ce=J-2*(T-j);i.imageSmoothingEnabled=!1,i.drawImage(S,0,0,f,R,te-j,w,T,p),ce>0&&i.drawImage(S,f,0,H,R,te+(T-j),w,ce,p),i.drawImage(S,B-f,0,f,R,te+J-(T-j),w,T,p),i.imageSmoothingEnabled=!0}}i.beginPath();for(const[S,R]of m.entries()){const H=n[S];let f=R.x+E;if(H.img!==void 0){const B=l.loadOrGetImage(H.img,a,s);if(B!==void 0){const D=v-8;let O=0,T=0,j=B.width,U=B.height;j>U?(O+=(j-U)/2,j=U):U>j&&(T+=(U-j)/2,U=j),i.beginPath(),Yn(i,f,w+p/2-D/2,D,D,o.roundingRadius??3),i.save(),i.clip(),i.drawImage(B,O,T,j,U,f,w+p/2-D/2,D,D),i.restore(),f+=D+4}}i.beginPath(),i.fillStyle=o.textBubble,i.fillText(H.text,f,w+p/2+fr(i,o))}}(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return d.createElement(Pg,{drilldowns:t.data})},onPaste:()=>{}},wa={},zg={getAccessibilityString:e=>e.data.join(", "),kind:pe.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>function(t,n,r,o){const{rect:i,col:l,row:a,theme:s,ctx:c,imageLoader:h}=t,{x:C,y,height:p,width:w}=i,v=p-2*s.cellVerticalPadding,E=[];let g=0;for(let x=0;x<n.length;x++){const I=n[x];if(I.length===0)continue;const m=h.loadOrGetImage(I,l,a);m!==void 0&&(E[x]=m,g+=m.width*(v/m.height)+ya)}if(g===0)return;g-=ya;let b=C+s.cellHorizontalPadding;o==="right"?b=Math.floor(C+w-s.cellHorizontalPadding-g):o==="center"&&(b=Math.floor(C+w/2-g/2));for(const x of E){if(x===void 0)continue;const I=x.width*(v/x.height);r>0&&(c.beginPath(),Yn(c,b,y+s.cellVerticalPadding,I,v,r),c.save(),c.clip()),c.drawImage(x,b,y+s.cellVerticalPadding,I,v),r>0&&c.restore(),b+=I+ya}}(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>50*t.data.length,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:r}=e,o=r??u1;return d.createElement(o,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:i=>{n({...t,data:[i]})}})},onPaste:(e,t)=>{const n=(e=e.trim()).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}}},ya=4,Ag={getAccessibilityString:()=>"",kind:pe.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:r,ctx:o,rect:i,theme:l}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let a=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(a+=Math.round(function(h,C){let y=49632*h+325176*C;return y^=y<<13,y^=y>>17,y^=y<<5,y/4294967295*2}(n,r)*t.skeletonWidthVariability));const s=l.cellHorizontalPadding;a+2*s>=i.width&&(a=i.width-2*s-1);const c=t.skeletonHeight??Math.min(18,i.height-2*l.cellVerticalPadding);Yn(o,i.x+s,i.y+(i.height-c)/2,a,c,l.roundingRadius??3),o.fillStyle=Hr(l.textDark,.1),o.fill()},onPaste:()=>{}},c0=Cn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[e=>e.targetWidth,"px"]}}),Fg=e=>{const{value:t,onChange:n,forceEditMode:r,createNode:o,targetRect:i,onFinish:l,validatedSelection:a}=e,s=t.data,c=t.readonly===!0,[h,C]=d.useState(s===""||r),y=d.useCallback(()=>{C(w=>!w)},[]),p=s?"gdg-ml-6":"";return h?d.createElement(c0,{targetWidth:i.width-20},d.createElement(oi,{autoFocus:!0,highlight:!1,validatedSelection:a,value:s,onKeyDown:w=>{w.key==="Enter"&&w.stopPropagation()},onChange:n}),d.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${p}`,onClick:()=>l(t)},d.createElement(l1,null))):d.createElement(c0,{targetWidth:i.width},d.createElement(h1,{contents:s,createNode:o}),!c&&d.createElement(d.Fragment,null,d.createElement("div",{className:"spacer"}),d.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${p}`,onClick:y},d.createElement(Gi,null))),d.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Lg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:pe.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:yo,measure:(e,t,n)=>{const r=t.data.split(`
130
+ `)[0];return e.measureText(r).width+2*n.cellHorizontalPadding},draw:e=>Jn(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:r,onFinishedEditing:o,markdownDivCreateNode:i,forceEditMode:l,validatedSelection:a}=e;return d.createElement(Fg,{onFinish:o,targetRect:r,value:n,validatedSelection:a,onChange:s=>t({...n,data:s.target.value}),forceEditMode:l,createNode:i})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},_g={getAccessibilityString:e=>e.row.toString(),kind:Hn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:function(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=jg,n.textAlign="center",i},measure:()=>44,draw:e=>function(t,n,r,o,i,l){const{ctx:a,rect:s,hoverAmount:c,theme:h}=t,{x:C,y,width:p,height:w}=s,v=r?1:o==="checkbox-visible"?.6+.4*c:c;if(o!=="number"&&v>0){a.globalAlpha=v;const E=7*(r?c:1);if(sa(a,h,r,i?C+E:C,y,i?p-E:p,w,!0,void 0,void 0,h.checkboxMaxSize,"center",l),i){a.globalAlpha=c,a.beginPath();for(const g of[3,6])for(const b of[-5,-1,3])a.rect(C+g,y+w/2+b,2,2);a.fillStyle=h.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(o==="number"||o==="both"&&!r){const E=n.toString(),g=h.markerFontFull,b=C+p/2;o==="both"&&c!==0&&(a.globalAlpha=1-c),a.fillStyle=h.textLight,a.font=g,a.fillText(E,b,y+w/2+fr(a,g)),c!==0&&(a.globalAlpha=1)}}(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:l}=t,a=n.drawHandle?7+(i-7)/2:i/2,s=l/2;if(Math.abs(r-a)<=10&&Math.abs(o-s)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function jg(e){const{ctx:t}=e;t.textAlign="start"}const Ng={getAccessibilityString:()=>"",kind:Hn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>function(t,n,r){const{ctx:o,rect:i,hoverAmount:l,theme:a,spriteManager:s}=t,{x:c,y:h,width:C,height:y}=i;o.beginPath(),o.globalAlpha=l,o.rect(c+1,h+1,C,y-2),o.fillStyle=a.bgHeaderHovered,o.fill(),o.globalAlpha=1,o.beginPath();const p=n!=="";let w=0;if(r!==void 0){const E=y-8,g=c+8/2,b=h+8/2;s.drawSprite(r,"normal",o,g,b,E,a,p?1:l),w=E}else{w=24;const v=12,E=p?v:l*v,g=p?0:(1-l)*v*.5,b=a.cellHorizontalPadding+4;E>0&&(o.moveTo(c+b+g,h+y/2),o.lineTo(c+b+g+E,h+y/2),o.moveTo(c+b+g+.5*E,h+y/2-.5*E),o.lineTo(c+b+g+.5*E,h+y/2+.5*E),o.lineWidth=2,o.strokeStyle=a.bgIconHeader,o.lineCap="round",o.stroke())}o.fillStyle=a.textMedium,o.fillText(n,w+c+a.cellHorizontalPadding+.5,h+y/2+fr(o,a)),o.beginPath()}(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function u0(e,t,n,r,o,i,l){e.textBaseline="alphabetic";const a=function(s,c,h,C,y){const p=C.cellHorizontalPadding,w=C.cellVerticalPadding;if(y)return{x:c.x+p/2,y:c.y+w/2+1,width:c.width-p,height:c.height-w-1};const v=Kr(h,s,C.baseFontFull,"alphabetic"),E=c.height-w,g=Math.min(E,2.5*v.actualBoundingBoxAscent);return{x:c.x+p/2,y:c.y+(c.height-g)/2+1,width:v.width+3*p,height:g-1}}(e,o,r,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),Yn(e,a.x,a.y,a.width,a.height,t.roundingRadius??4),e.globalAlpha=i,e.fillStyle=(n==null?void 0:n.bgColor)??Hr(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",l==null||l("text")}const Bg=d.lazy(async()=>await L0(()=>import("./number-overlay-editor-Df2FevAR.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)),Wg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:pe.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:yo,draw:e=>{const{hoverAmount:t,cell:n,ctx:r,theme:o,rect:i,overrideCursor:l}=e,{hoverEffect:a,displayData:s,hoverEffectTheme:c}=n;a===!0&&t>0&&u0(r,o,c,s,i,t,l),Jn(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return d.createElement(d.Suspense,{fallback:null},d.createElement(Bg,{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}}},$g={getAccessibilityString:()=>"",measure:()=>108,kind:pe.Protected,needsHover:!1,needsHoverPosition:!1,draw:function(e){const{ctx:t,theme:n,rect:r}=e,{x:o,y:i,height:l}=r;t.beginPath();const a=2.5;let s=o+n.cellHorizontalPadding+a;const c=i+l/2,h=Math.cos(Lc(30))*a,C=Math.sin(Lc(30))*a;for(let y=0;y<12;y++)t.moveTo(s,c-a),t.lineTo(s,c+a),t.moveTo(s+h,c-C),t.lineTo(s-h,c+C),t.moveTo(s-h,c-C),t.lineTo(s+h,c+C),s+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()},onPaste:()=>{}},Xg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:pe.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>yo(e,t,e.theme.textLight),draw:e=>Jn(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+2*n.cellHorizontalPadding,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:r,validatedSelection:o}=e;return $t.createElement(oi,{highlight:t,autoFocus:r.readonly!==!0,disabled:r.readonly!==!1,value:r.data,validatedSelection:o,onChange:i=>n({...r,data:i.target.value})})},onPaste:()=>{}},Gg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:pe.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:yo,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:r,ctx:o,rect:i,theme:l,overrideCursor:a}=e,{displayData:s,contentAlign:c,hoverEffect:h,allowWrapping:C,hoverEffectTheme:y}=t;h===!0&&n>0&&u0(o,l,y,s,i,n,a),Jn(e,s,c,C,r)},measure:(e,t,n)=>{const r=t.displayData.split(`
131
+ `,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 d.createElement(oi,{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:l=>r({...o,data:l.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Yg=Cn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Kg=e=>{const{uri:t,onChange:n,forceEditMode:r,readonly:o,validatedSelection:i,preview:l}=e,[a,s]=d.useState(!o&&(t===""||r)),c=d.useCallback(()=>{s(!0)},[]);return a?d.createElement(oi,{validatedSelection:i,highlight:!0,autoFocus:!0,value:t,onChange:n}):d.createElement(Yg,null,d.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},l),!o&&d.createElement("div",{className:"gdg-edit-icon",onClick:c},d.createElement(Gi,null)),d.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function d0(e,t,n,r){let o=n.cellHorizontalPadding;const i=t.height/2-e.actualBoundingBoxAscent/2,l=e.width,a=e.actualBoundingBoxAscent;return r==="right"?o=t.width-l-n.cellHorizontalPadding:r==="center"&&(o=t.width/2-l/2),{x:o,y:i,width:l,height:a}}function h0(e){const{cell:t,bounds:n,posX:r,posY:o,theme:i}=e,l=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const a=Jc(l,i.baseFontFull);if(a===void 0)return!1;const s=d0(a,n,i,t.contentAlign);return Dr({x:s.x-4,y:s.y-4,width:s.width+8,height:s.height+8},r,o)}const Vg={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:pe.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:yo,draw:e=>{const{cell:t,theme:n,overrideCursor:r,hoverX:o,hoverY:i,rect:l,ctx:a}=e,s=t.displayData??t.data,c=t.hoverEffect===!0;if(r!==void 0&&c&&o!==void 0&&i!==void 0){const h=d0(Kr(s,a,n.baseFontFull),l,n,t.contentAlign),{x:C,y,width:p,height:w}=h;if(o>=C-4&&o<=C-4+p+8&&i>=y-4&&i<=y-4+w+8){const v=fr(a,n.baseFontFull);r("pointer");const E=5,g=y-v;a.beginPath(),a.moveTo(l.x+C,Math.floor(l.y+g+w+E)+.5),a.lineTo(l.x+C+p,Math.floor(l.y+g+w+E)+.5),a.strokeStyle=n.linkColor,a.stroke(),a.save(),a.fillStyle=e.cellFillColor,Jn({...e,rect:{...l,x:l.x-1}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x-2}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x+1}},s,t.contentAlign),Jn({...e,rect:{...l,x:l.x+2}},s,t.contentAlign),a.restore()}}a.fillStyle=c?n.linkColor:n.textDark,Jn(e,s,t.contentAlign)},onSelect:e=>{h0(e)&&e.preventDefault()},onClick:e=>{var n;const{cell:t}=e;h0(e)&&((n=t.onClickUri)==null||n.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+2*n.cellHorizontalPadding,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:r,forceEditMode:o,validatedSelection:i}=t;return d.createElement(Kg,{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:l=>n({...r,data:l.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Ug=[_g,Ng,Eg,Hg,Dg,zg,Ag,Lg,Wg,$g,Xg,Gg,Vg];var f0,g0,qg=function(){if(g0)return f0;g0=1;var e=Ac(),t=Er();return f0=function(n,r,o){var i=!0,l=!0;if(typeof n!="function")throw new TypeError("Expected a function");return t(o)&&(i="leading"in o?!!o.leading:i,l="trailing"in o?!!o.trailing:l),e(n,r,{leading:i,maxWait:r,trailing:l})}}();const Jg=Sr(qg),ba=[];class Qg extends ru{constructor(){super(...arguments);ft(this,"imageLoaded",()=>{});ft(this,"loadedLocations",[]);ft(this,"cache",{});ft(this,"sendLoaded",Jg(()=>{this.imageLoaded(new bo(this.loadedLocations)),this.loadedLocations=[]},20));ft(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const r of n){const o=this.cache[r];let i=!1;for(let l=0;l<o.cells.length;l++){const a=o.cells[l];if(this.isInWindow(a)){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 l=!1;const a=ba.pop()??new Image;let s=!1;const c={img:void 0,cells:[Ln(r,o)],url:n,cancel:()=>{s||(s=!0,ba.length<12?ba.unshift(a):l||(a.src=""))}},h=new Promise(C=>a.addEventListener("load",()=>C(null)));requestAnimationFrame(async()=>{try{a.src=n,await h,await a.decode();const C=this.cache[i];if(C!==void 0&&!s){C.img=a;for(const y of C.cells)this.loadedLocations.push(ta(y));l=!0,this.sendLoaded()}}catch{c.cancel()}}),this.cache[i]=c}loadOrGetImage(n,r,o){const i=n,l=this.cache[i];if(l!==void 0){const a=Ln(r,o);return l.cells.includes(a)||l.cells.push(a),l.img}this.loadImage(n,r,o,i)}}const Zg=d.forwardRef((e,t)=>{const n=d.useMemo(()=>({...E1,...e.headerIcons}),[e.headerIcons]),r=d.useMemo(()=>e.renderers??Ug,[e.renderers]),o=d.useMemo(()=>e.imageWindowLoader??new Qg,[e.imageWindowLoader]);return d.createElement(Rg,{...e,renderers:r,headerIcons:n,ref:t,imageWindowLoader:o})});function ep(e){switch(e){case"string":default:return pe.Text;case"number":return pe.Number;case"boolean":return pe.Boolean}}function tp(e){switch(e){case"string":case"unknown":return ur.HeaderString;case"number":case"integer":return ur.HeaderNumber;case"boolean":return ur.HeaderBoolean;case"date":case"datetime":return ur.HeaderDate;case"time":return ur.HeaderTime;default:return _0(e),ur.HeaderString}}function p0(e){return"rowIdx"in e&&"columnId"in e&&"value"in e}function np(e){return"rowIdx"in e&&"type"in e}function rp(e){return"columnIdx"in e&&"type"in e}function op(e){return e==="light"?{lineHeight:1.25}:{lineHeight:1.25,accentColor:"#7c3aed",accentLight:"rgba(124, 58, 237, 0.15)",textDark:"#f4f4f5",textMedium:"#a1a1aa",textLight:"#71717a",textBubble:"#f4f4f5",bgIconHeader:"#a1a1aa",fgIconHeader:"#18181b",textHeader:"#d4d4d8",textHeaderSelected:"#18181b",bgCell:"#18181b",bgCellMedium:"#27272a",bgHeader:"#27272a",bgHeaderHasFocus:"#3f3f46",bgHeaderHovered:"#3f3f46",bgBubble:"#27272a",bgBubbleSelected:"#7c3aed",bgSearchResult:"#312e81",borderColor:"#27272a",drilldownBorder:"#7c3aed",linkColor:"#818cf8",headerFontStyle:"bold 14px",baseFontStyle:"13px"}}const ip=e=>{const t=j0.c(19),{currentColumnName:n,onRename:r,onCancel:o}=e,[i,l]=d.useState("");let a;t[0]!==n||t[1]!==i||t[2]!==r?(a=()=>{i.trim()&&(r(i.trim()),l(n))},t[0]=n,t[1]=i,t[2]=r,t[3]=a):a=t[3];const s=a;let c;t[4]!==s||t[5]!==o?(c=b=>{b.key==="Enter"?s():b.key==="Escape"&&o()},t[4]=s,t[5]=o,t[6]=c):c=t[6];const h=c;let C,y,p,w;t[7]===Symbol.for("react.memo_cache_sentinel")?(C=et.jsxs(N0,{children:[et.jsx($p,{className:"mr-2 h-3.5 w-3.5"}),"Rename column"]}),t[7]=C):C=t[7],t[8]===Symbol.for("react.memo_cache_sentinel")?(y=et.jsx(_a,{htmlFor:"rename-input",children:"Column name"}),t[8]=y):y=t[8],t[9]===Symbol.for("react.memo_cache_sentinel")?(p=b=>l(b.target.value),t[9]=p):p=t[9],t[10]!==h||t[11]!==i?(w=et.jsxs("div",{children:[y,et.jsx(B0,{value:i,onChange:p,placeholder:"Enter new column name",className:"mt-1",onKeyDown:h})]}),t[10]=h,t[11]=i,t[12]=w):w=t[12];const v=!i.trim();let E,g;return t[13]!==s||t[14]!==v?(E=et.jsx(ja,{onClick:s,disabled:v,size:"sm",className:"w-full",children:"Rename"}),t[13]=s,t[14]=v,t[15]=E):E=t[15],t[16]!==w||t[17]!==E?(g=et.jsxs(W0,{children:[C,et.jsx($0,{children:et.jsx(X0,{className:"w-64 p-4",children:et.jsxs("div",{className:"space-y-3",children:[w,E]})})})]}),t[16]=w,t[17]=E,t[18]=g):g=t[18],g},m0=e=>{const t=j0.c(77),{direction:n,onAdd:r,onCancel:o}=e,[i,l]=d.useState(""),[a,s]=d.useState("string");let c,h,C,y,p,w,v,E,g,b,x,I,m,S,R,H,f,B;if(t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==r||t[4]!==o){const J=["string","number","boolean","datetime"];let ce,se;t[20]!==i||t[21]!==a||t[22]!==r?(ce=()=>{i.trim()&&(r(i.trim(),a),l(""),s("string"))},t[20]=i,t[21]=a,t[22]=r,t[23]=ce):ce=t[23],w=ce,t[24]!==w||t[25]!==o?(se=ze=>{ze.key==="Enter"?w():ze.key==="Escape"&&o()},t[24]=w,t[25]=o,t[26]=se):se=t[26];const q=se;let Z;p=W0,t[27]===Symbol.for("react.memo_cache_sentinel")?(Z=et.jsx(Xp,{className:"mr-2 h-3.5 w-3.5"}),t[27]=Z):Z=t[27],t[28]!==n?(R=et.jsxs(N0,{children:[Z,"Add column to the ",n]}),t[28]=n,t[29]=R):R=t[29],y=$0,C=X0,S="w-64 p-4",I="space-y-3";const fe=`add-column-input-${n}`;let N;t[30]!==fe?(N=et.jsx(_a,{htmlFor:fe,children:"Column name"}),t[30]=fe,t[31]=N):N=t[31];const K=`add-column-input-${n}`;let ne,X;t[32]===Symbol.for("react.memo_cache_sentinel")?(ne=ze=>l(ze.target.value),t[32]=ne):ne=t[32],t[33]!==i||t[34]!==q||t[35]!==K?(X=et.jsx(B0,{id:K,value:i,onChange:ne,placeholder:"Enter column name",className:"mt-1",onKeyDown:q}),t[33]=i,t[34]=q,t[35]=K,t[36]=X):X=t[36],t[37]!==N||t[38]!==X?(m=et.jsxs("div",{children:[N,X]}),t[37]=N,t[38]=X,t[39]=m):m=t[39];const Q=`add-column-type-${n}`;t[40]!==Q?(x=et.jsx(_a,{htmlFor:Q,children:"Data type"}),t[40]=Q,t[41]=x):x=t[41],h=Gp,E=a,t[42]===Symbol.for("react.memo_cache_sentinel")?(g=ze=>s(ze),t[42]=g):g=t[42];const ae=`add-column-type-${n}`;let he;t[43]===Symbol.for("react.memo_cache_sentinel")?(he=et.jsx(Yp,{}),t[43]=he):he=t[43],t[44]!==ae?(b=et.jsx(Kp,{id:ae,className:"mt-1",children:he}),t[44]=ae,t[45]=b):b=t[45],c=Vp,v=J.map(ap),t[0]=i,t[1]=a,t[2]=n,t[3]=r,t[4]=o,t[5]=c,t[6]=h,t[7]=C,t[8]=y,t[9]=p,t[10]=w,t[11]=v,t[12]=E,t[13]=g,t[14]=b,t[15]=x,t[16]=I,t[17]=m,t[18]=S,t[19]=R}else c=t[5],h=t[6],C=t[7],y=t[8],p=t[9],w=t[10],v=t[11],E=t[12],g=t[13],b=t[14],x=t[15],I=t[16],m=t[17],S=t[18],R=t[19];t[46]!==c||t[47]!==v?(H=et.jsx(c,{children:v}),t[46]=c,t[47]=v,t[48]=H):H=t[48],t[49]!==h||t[50]!==H||t[51]!==E||t[52]!==g||t[53]!==b?(f=et.jsxs(h,{value:E,onValueChange:g,children:[b,H]}),t[49]=h,t[50]=H,t[51]=E,t[52]=g,t[53]=b,t[54]=f):f=t[54],t[55]!==f||t[56]!==x?(B=et.jsxs("div",{children:[x,f]}),t[55]=f,t[56]=x,t[57]=B):B=t[57];const D=!i.trim();let O,T,j,U,te;return t[58]!==w||t[59]!==D?(O=et.jsx(ja,{onClick:w,disabled:D,size:"sm",className:"w-full",children:"Add"}),t[58]=w,t[59]=D,t[60]=O):O=t[60],t[61]!==B||t[62]!==O||t[63]!==I||t[64]!==m?(T=et.jsxs("div",{className:I,children:[m,B,O]}),t[61]=B,t[62]=O,t[63]=I,t[64]=m,t[65]=T):T=t[65],t[66]!==C||t[67]!==T||t[68]!==S?(j=et.jsx(C,{className:S,children:T}),t[66]=C,t[67]=T,t[68]=S,t[69]=j):j=t[69],t[70]!==y||t[71]!==j?(U=et.jsx(y,{children:j}),t[70]=y,t[71]=j,t[72]=U):U=t[72],t[73]!==p||t[74]!==U||t[75]!==R?(te=et.jsxs(p,{children:[R,U]}),t[73]=p,t[74]=U,t[75]=R,t[76]=te):te=t[76],te};function ap(e){return et.jsx(Bp,{value:e,children:Wp(e)},e)}function v0(e,t){return e.map(n=>{const r=n,o=Object.keys(r);if(t<0||t>=o.length)return r;const i=o[t],{[i]:l,...a}=r;return a})}function w0(e,t){return t?e.map(n=>({...n,[t]:""})):e}function y0(e,t,n){return t&&n&&t!==n?e.map(r=>{const o=r,{[t]:i,...l}=o;return{...l,[n]:o[t]}}):e}function Ur(e){var l;const{columnFields:t,columnIdx:n,type:r,dataType:o,newColumnName:i}=e;switch(r){case"insert":{if(!i)return La.error("newName is required for insert"),t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n)];return Object.fromEntries(s)}case"remove":{if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=(l=a[n])==null?void 0:l[0];if(s){const{[s]:c,...h}=t;return h}return t}case"rename":{if(!i)return La.error("newName is required for rename"),t;if(n<0||n>=Object.keys(t).length)return t;const a=Object.entries(t),s=[...a.slice(0,n),[i,o||"string"],...a.slice(n+1)];return Object.fromEntries(s)}}}let xa;xa=({data:e,setData:t,columnFields:n,setColumnFields:r,edits:o,onAddEdits:i,onAddRows:l,onDeleteRows:a,onRenameColumn:s,onDeleteColumn:c,onAddColumn:h})=>{const{theme:C}=Up(),y=d.useRef(null),[p,w]=d.useState(),[v,E]=d.useState(!1),[g,b]=$t.useState({columns:yt.empty(),rows:yt.empty()}),[x,I]=d.useState({}),m=qp();Jp(()=>{if(o.length===0)return;const N=new Map;for(const ne of o)if(p0(ne))if(ne.rowIdx>=e.length){N.has(ne.rowIdx)||N.set(ne.rowIdx,{});const X=N.get(ne.rowIdx);X&&(X[ne.columnId]=ne.value)}else t(X=>{const Q=[...X];return Q[ne.rowIdx][ne.columnId]=ne.value,Q});else if(np(ne)&&ne.type===Hi.Remove)t(X=>X.filter((Q,ae)=>ae!==ne.rowIdx));else if(rp(ne))switch(ne.type){case Hi.Remove:t(X=>v0(X,ne.columnIdx)),r(X=>Ur({columnFields:X,columnIdx:ne.columnIdx,type:"remove"}));break;case Hi.Insert:r(X=>Ur({columnFields:X,columnIdx:ne.columnIdx,type:"insert",newColumnName:ne.newName})),t(X=>w0(X,ne.newName));break;case Hi.Rename:{const X=S[ne.columnIdx].title,Q=ne.newName;if(!X||!Q)return;r(ae=>Ur({columnFields:ae,columnIdx:ne.columnIdx,type:"rename",newColumnName:Q})),t(ae=>y0(ae,X,Q));break}}const K=[...N.entries()].sort(([ne],[X])=>ne-X).map(([,ne])=>ne);K.length>0&&t(ne=>[...ne,...K]),m()});const S=d.useMemo(()=>{const N=[];for(const[K,ne]of Object.entries(n))N.push({id:K,title:K,width:x[K],icon:tp(ne),kind:ep(ne),dataType:ne,hasMenu:!0});return N},[n,x]),R=d.useCallback(N=>{const[K,ne]=N,X=e[ne][S[K].title],Q=S[K].kind;if(Q===pe.Boolean){const ae=!!X;return{kind:pe.Boolean,allowOverlay:!1,readonly:!1,data:ae}}return Q===pe.Number&&typeof X=="number"?{kind:pe.Number,allowOverlay:!0,readonly:!1,displayData:String(X),data:X}:{kind:pe.Text,allowOverlay:!0,readonly:!1,displayData:String(X),data:String(X)}},[S,e]),H=d.useCallback((N,K)=>{const[ne,X]=N,Q=S[ne],ae=Q.title;let he=K.data;Q.dataType!=="number"&&Q.dataType!=="integer"||K.data!==void 0&&K.data!==""||(he=null),t(ze=>{const $e=[...ze];return $e[X][ae]=he,$e}),i([{rowIdx:X,columnId:ae,value:he}])},[S,i,t]),f=d.useCallback((N,K)=>{I(ne=>({...ne,[N.title]:K}))},[]),B=d.useCallback((N,K,ne)=>{const[X,Q]=N,ae=S[X].title;switch(n[ae]){case"number":case"integer":if(Number.isNaN(Number(K.data)))return!1;break;case"boolean":if(typeof K.data!="boolean")return!1}return!0},[n,S]),D=d.useCallback(N=>{if(y.current)if(Na.isMetaOrCtrl(N)&&N.key==="c")y.current.emit("copy");else{if(!Na.isMetaOrCtrl(N)||N.key!=="v")return Na.isMetaOrCtrl(N)&&N.key==="f"?(E(K=>!K),N.stopPropagation(),void N.preventDefault()):void(N.key!=="Escape"||E(!1));(function(K){const{selection:ne,data:X,setData:Q,onAddEdits:ae,columns:he}=K;if(!ne.current)return;const{range:ze}=ne.current,{x:$e,y:Ze}=ze;navigator.clipboard.readText().then(He=>{if(!He.trim())return;const We=He.split(`
132
+ `).filter(Me=>Me.trim()),me=[];for(const Me of We){const Se=Me.split(" ");me.push(Se)}if(me.length===0)return;const ye=[];for(const[Me,Se]of me.entries()){if(!Se)continue;const ee=Ze+Me;if(ee>=X.length)break;for(const[Pe,ke]of Se.entries()){if(ke===void 0)continue;const Ge=$e+Pe;if(!he||Ge>=he.length)break;let Re=ke;switch(he[Ge].dataType){case"integer":case"number":{const Ke=Number(ke);if(Number.isNaN(Ke))continue;Re=Ke;break}case"boolean":{const Ke=ke.toLowerCase();Re=Ke==="true"||Ke==="1";break}}const nt=he[Ge].title;ye.push({rowIdx:ee,columnId:nt,value:Re})}}ye.length>0&&(ae(ye),Q(Me=>{const Se=[...Me];for(const ee of ye)if(p0(ee)){const Pe=ee.rowIdx,ke=ee.columnId;if(Pe<Se.length){const Ge=Se[Pe];ke in Ge&&(Ge[ke]=ee.value)}}return Se}))}).catch(He=>{La.error("Failed to read clipboard data",He)})})({selection:g,data:e,setData:t,columns:S,onAddEdits:i})}},[S,e,i,g,t]),O=d.useCallback(()=>{const N=Object.fromEntries(S.map(K=>{const ne=K.dataType;switch(ne){case"boolean":return[K.title,!1];case"number":case"integer":return[K.title,null];case"date":case"datetime":case"time":return[K.title,new Date];case"string":case"unknown":return[K.title,""];default:return _0(ne),[K.title,""]}}));l([N]),t(K=>[...K,N])},[S,l,t]),T=Qp((N,K)=>{w({col:N,bounds:K})}),j=async()=>{if(p){const N=S[p.col].title;await rm(N),w(void 0)}};function U(N){om({title:`Column '${N}' already exists`,description:"Please enter a different column name",variant:"danger"})}const te=N=>{if(p){const K=S[p.col].title;if(n[N])return void U(N);const ne=S[p.col].dataType;s(p.col,N),r(X=>Ur({columnFields:X,columnIdx:p.col,type:"rename",dataType:ne,newColumnName:N})),t(X=>y0(X,K,N)),w(void 0)}},J=()=>{p&&(c(p.col),r(N=>Ur({columnFields:N,columnIdx:p.col,type:"remove"})),t(N=>v0(N,p.col)),w(void 0))},ce=N=>{const{direction:K,columnName:ne,dataType:X}=N;if(p){const Q=p.col+(K==="left"?0:1),ae=Math.max(0,Math.min(Q,S.length));if(n[ne])return void U(ne);h(ae,ne),r(he=>Ur({columnFields:he,columnIdx:ae,type:"insert",dataType:X,newColumnName:ne})),t(he=>w0(he,ne)),w(void 0)}},se=(p==null?void 0:p.col)===S.length-1,q=p!==void 0,Z="mr-2 h-3.5 w-3.5",fe=e.length>1e5;return et.jsxs("div",{className:"relative",children:[et.jsx(Zp,{children:et.jsx(Zg,{ref:y,getCellContent:R,columns:S,gridSelection:g,onGridSelectionChange:b,rows:e.length,overscrollX:50,smoothScrollX:!fe,smoothScrollY:!fe,validateCell:B,getCellsForSelection:!0,onPaste:!0,showSearch:v,fillHandle:!0,allowedFillDirections:"vertical",onKeyDown:D,height:e.length>10?450:void 0,width:"100%",rowMarkers:{kind:"both"},rowSelectionMode:"multi",onCellEdited:H,onColumnResize:f,onHeaderMenuClick:T,theme:op(C),trailingRowOptions:{hint:"New row",sticky:!0,tint:!0},onRowAppended:O,maxColumnAutoWidth:600,maxColumnWidth:600})}),(()=>{if(!q)return;const N=et.jsxs(et.Fragment,{children:[et.jsx(ip,{currentColumnName:S[p.col].title,onRename:te,onCancel:()=>w(void 0)}),et.jsx(G0,{}),et.jsx(m0,{direction:"left",onAdd:(K,ne)=>ce({direction:"left",columnName:K,dataType:ne}),onCancel:()=>w(void 0)}),et.jsx(m0,{direction:"right",onAdd:(K,ne)=>ce({direction:"right",columnName:K,dataType:ne}),onCancel:()=>w(void 0)}),et.jsx(G0,{}),!se&&et.jsxs(Y0,{onClick:J,className:"text-destructive focus:text-destructive",children:[et.jsx(am,{className:Z}),"Delete column"]})]});return et.jsx(em,{open:q,onOpenChange:K=>!K&&w(void 0),children:et.jsxs(tm,{style:{left:(p==null?void 0:p.bounds.x)??0,top:((p==null?void 0:p.bounds.y)??0)+((p==null?void 0:p.bounds.height)??0)},className:"fixed w-52",children:[et.jsxs(Y0,{onClick:j,children:[et.jsx(nm,{className:Z}),"Copy column name"]}),!fe&&N]})})})(),et.jsx("div",{className:"absolute bottom-1 right-2 w-26",children:et.jsx(ja,{variant:"destructive",size:"sm",disabled:g.rows.length===0,className:"right-2 h-7",onClick:()=>{const N=g.rows.toArray();a(N);let K=0;for(const ne of N){const X=ne-K;t(Q=>Q.filter((ae,he)=>he!==X)),K++}b({columns:yt.empty(),rows:yt.empty()})},children:g.rows.length<=1?"Delete row":"Delete rows"})})]})},K0=Object.freeze(Object.defineProperty({__proto__:null,GlideDataEditor:xa,default:xa},Symbol.toStringTag,{value:"Module"}))});export{Ba as C,Wa as T,lm as __tla,kr as a,$a as b,K0 as g,Mr as i,Xa as m,Cn as s};