shapewall 0.7.0 → 0.7.2
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.
- package/CHANGELOG.md +29 -0
- package/dist/agent/package-lock.json +2 -2
- package/dist/client/assets/{BoardChat-WS8mAIW6.js → BoardChat-B8ucOOc0.js} +1 -1
- package/dist/client/assets/{BuzzDialog-B-Mlr6wF.js → BuzzDialog-DwEAN6va.js} +1 -1
- package/dist/client/assets/{ChecksPanel-Dx1ZLBR6.js → ChecksPanel-m_9S0BeX.js} +1 -1
- package/dist/client/assets/{History-sXhmpcvs.js → History-C3z_y_AC.js} +1 -1
- package/dist/client/assets/{LocalSettings-CtGzz9F3.js → LocalSettings-D_tVfnsp.js} +1 -1
- package/dist/client/assets/{Management-CGHe8Wt9.js → Management-zSrx0gXl.js} +1 -1
- package/dist/client/assets/{QuickConnect-DEk84E4A.js → QuickConnect-BVLgjq9l.js} +1 -1
- package/dist/client/assets/{ShareDialog-CGGx-AYK.js → ShareDialog-CdLdd6WQ.js} +1 -1
- package/dist/client/assets/{app-update-dialog-_bVp8hnC.js → app-update-dialog-hrSzISKP.js} +1 -1
- package/dist/client/assets/{circle-x-BWoHA1QY.js → circle-x-D5MkDLJk.js} +1 -1
- package/dist/client/assets/{index-C7Ostk3K.css → index-C2_XIPRO.css} +1 -1
- package/dist/client/assets/index-t3fn6ogR.js +37 -0
- package/dist/client/assets/{play-BzQ3tRTv.js → play--xrZ7VCR.js} +1 -1
- package/dist/client/assets/{refresh-cw-BYBMyDKT.js → refresh-cw-B-npxKae.js} +1 -1
- package/dist/client/assets/{ui-CAY6myRA.js → ui-2lMx-4bc.js} +1 -1
- package/dist/client/build-info.json +1 -1
- package/dist/client/index.html +3 -3
- package/dist/client/sw.js +2 -2
- package/dist/console/assets/{LocalAccountsApp-CWRguRRL.js → LocalAccountsApp-BFGZQUvR.js} +1 -1
- package/dist/console/assets/{LocalConsole--I2SaIpr.js → LocalConsole-BF1NlOmi.js} +2 -2
- package/dist/console/assets/{LocalUsage-BmpCZ36k.js → LocalUsage-Br3Ddp7_.js} +1 -1
- package/dist/console/assets/{app-update-dialog-B8M9plaT.js → app-update-dialog-RdHZ7VTX.js} +1 -1
- package/dist/console/assets/app-version-Dt9FxRbR.js +1 -0
- package/dist/console/assets/{console-CrhTsPbz.css → console-BGRSS8Ru.css} +1 -1
- package/dist/console/assets/{console-DxapQ9oS.js → console-C6pwtJ3X.js} +3 -3
- package/dist/console/assets/{local-agents-CoqD4dSN.js → local-agents-DUtV5lSR.js} +2 -2
- package/dist/console/assets/minus-887msXez.js +1 -0
- package/dist/console/assets/{tailnet-C5Flwl_d.js → tailnet-D2fRVn68.js} +2 -2
- package/dist/console/assets/{theme-DCd0qh4l.js → theme-CPfJOmcz.js} +1 -1
- package/dist/console/assets/{ui-Bry1mnCY.js → ui-DnyJhoQU.js} +1 -1
- package/dist/console/assets/{usage-CqVjMb7m.js → usage-CLrlKCWx.js} +1 -1
- package/dist/console/assets/{usage-D1G0GgE3.js → usage-DjmUlnXL.js} +1 -1
- package/dist/console/build-info.json +1 -1
- package/dist/console/console.html +8 -8
- package/package.json +1 -1
- package/dist/client/assets/index-Bm-Xd3YN.js +0 -37
- package/dist/console/assets/app-version-muKrQqbL.js +0 -1
- package/dist/console/assets/minus-DDQ0ydcM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,At as t,C as n,D as r,Dt as i,E as a,F as o,Ft as s,It as c,J as l,Lt as u,Mt as d,Nt as f,P as p,Pt as m,Rt as h,S as g,U as _,Vt as v,Y as y,_ as b,_t as x,c as S,ct as C,d as w,g as T,h as E,j as D,kt as O,l as k,p as A,t as j,u as M,v as N,w as ee,x as P,y as F,zt as I}from"./ui-Bry1mnCY.js";import{S as L,_ as te,a as ne,b as re,d as ie,f as ae,g as R,m as oe,p as se,x as ce,y as le}from"./tailnet-C5Flwl_d.js";import{$ as z,D as ue,Et as B,F as V,G as de,L as fe,N as H,Q as U,R as pe,Tt as me,U as W,_ as G,_t as he,a as K,at as ge,b as _e,c as ve,ct as ye,dt as be,gt as xe,ht as Se,it as Ce,m as we,mt as Te,o as Ee,p as De,pt as Oe,rt as ke,u as Ae,v as je,wt as Me,x as Ne,xt as Pe,yt as Fe}from"./theme-DCd0qh4l.js";import{A as Ie,M as Le,S as Re,k as ze,v as Be,y as Ve}from"./local-agents-CoqD4dSN.js";import{A as He,B as Ue,C as We,D as Ge,E as Ke,F as qe,I as Je,L as Ye,M as Xe,N as Ze,O as Qe,P as $e,R as et,S as tt,T as nt,_ as rt,a as it,b as at,c as ot,d as st,f as ct,g as lt,h as ut,i as dt,j as ft,k as pt,l as mt,m as ht,n as gt,o as _t,p as vt,r as q,s as yt,t as bt,u as xt,v as St,w as Ct,x as J,y as wt,z as Tt}from"./usage-D1G0GgE3.js";var Et={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Et.node;var Dt=c(Et),Ot={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ot.node;var kt=c(Ot),At={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};At.node;var jt=c(At),Mt={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};Mt.node;var Nt=c(Mt),Pt={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};Pt.node;var Ft=c(Pt),It={name:`chevrons-left-right`,size:24,node:[[`path`,{d:`m9 7-5 5 5 5`,key:`j5w590`}],[`path`,{d:`m15 7 5 5-5 5`,key:`1bl6da`}]]};It.node;var Lt=c(It),Rt={name:`chevrons-right-left`,size:24,node:[[`path`,{d:`m20 17-5-5 5-5`,key:`30x0n2`}],[`path`,{d:`m4 17 5-5-5-5`,key:`16spf4`}]]};Rt.node;var zt=c(Rt),Bt={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Bt.node;var Vt=c(Bt),Ht={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Ht.node;var Ut=c(Ht),Wt={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]};Wt.node;var Gt=c(Wt),Kt={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};Kt.node;var qt=c(Kt),Jt={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Jt.node;var Yt=c(Jt),Xt={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Xt.node;var Zt=c(Xt),Qt={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Qt.node;var $t=c(Qt),en={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};en.node;var tn=c(en),nn={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};nn.node;var rn=c(nn),an={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};an.node;var on=c(an),sn={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};sn.node;var cn=c(sn),ln={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};ln.node;var un=c(ln),dn={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};dn.node;var fn=c(dn),pn={name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]};pn.node;var mn=c(pn),hn={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};hn.node;var gn=c(hn),_n={name:`rows-4`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 7.5H3`,key:`1hm9pq`}],[`path`,{d:`M21 12H3`,key:`2avoz0`}],[`path`,{d:`M21 16.5H3`,key:`n7jzkj`}]]};_n.node;var vn=c(_n),yn={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};yn.node;var bn=c(yn),xn={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};xn.node;var Sn=c(xn),Cn={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Cn.node;var wn=c(Cn),Y=v(h(),1),X=x(),Tn=Y.createContext(void 0),En=e=>{let t=Y.useContext(Tn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Dn=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(Tn.Provider,{value:e,children:t})),On={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kn=new class{#e=On;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function An(e){setTimeout(e,0)}var jn=typeof window>`u`||`Deno`in globalThis;function Mn(){}function Nn(e,t){return typeof e==`function`?e(t):e}function Pn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Fn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function In(e,t){return typeof e==`function`?e(t):e}function Ln(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==zn(o,t.options))return!1}else if(!Vn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Rn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(a))return!1}else if(!Vn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zn(e,t){return(t?.queryKeyHashFn||Bn)(e)}function Bn(e){return JSON.stringify(e,(e,t)=>Kn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Vn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Vn(e[r],t[r]))return!1;return!0}return!1}var Hn=Object.prototype.hasOwnProperty;function Un(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Gn(e)&&Gn(t);if(!r&&!(Kn(e)&&Kn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Hn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Un(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Wn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Hn.call(t,n)||e[n]!==t[n])return!1;return!0}function Gn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kn(e){if(!qn(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!qn(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function qn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Jn(e){return new Promise(t=>{kn.setTimeout(t,e)})}function Yn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Un(e,t)}function Xn(e){return e}function Zn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function Qn(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var $n=Symbol();function er(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===$n?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tr(e,t){return typeof e==`function`?e(...t):!!e}var nr=Symbol();function rr(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[nr]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var ir=()=>jn,ar=()=>ir(),or=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sr=new class extends or{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},cr=An;function lr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=cr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ur=lr(),dr=new class extends or{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function fr(e){return Math.min(1e3*2**e,3e4)}function pr(e){return(e??`online`)!==`online`||dr.isOnline()}var mr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function hr(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Mn);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new mr(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>sr.isFocused()&&(e.networkMode===`always`||dr.isOnline())&&e.canRun(),p=()=>pr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ar()?0:3),a=e.retryDelay??fr,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Jn(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var gr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pn(this.gcTime)&&(this.#e=kn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ar()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(kn.clearTimeout(this.#e),this.#e=void 0)}};function _r(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{rr(e,()=>t.signal,()=>n=!0,l[nr])},d=er(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?Qn:Zn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?yr:vr,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:vr(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function vr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function yr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function br(e,t){return t?vr(e,t)!=null:!1}function xr(e,t){return!t||!e.getPreviousPageParam?!1:yr(e,t)!=null}var Sr=class extends gr{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Tr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Tr(this.options);e.data!==void 0&&(this.setState(wr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Yn(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>In(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$n||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>In(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Fn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[nr]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=er(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?_r(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=hr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof mr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof mr){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Cr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...wr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ur.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Cr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function wr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Tr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Er=class extends or{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Or(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof In(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Wn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ar(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||In(this.options.enabled,this.#t)!==In(t.enabled,this.#t)||In(this.options.staleTime,this.#t)!==In(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||In(this.options.enabled,this.#t)!==In(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Wn(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mn)),t}#h(e){return!ar()&&In(this.options.enabled,this.#t)!==!1&&Pn(e)}#g(){this.#b();let e=In(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Fn(this.#r.dataUpdatedAt,e)+1;this.#u=kn.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return In(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=kn.setInterval(()=>{(this.options.refetchIntervalInBackground||sr.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(kn.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(kn.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Or(e,t),o=i&&Ar(e,n,t,r);(a||o)&&(l={...l,...Cr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Yn(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Yn(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:jr(e,t),refetch:this.refetch,isEnabled:In(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Wn(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();ur.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Dr(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||In(t.retryOnMount,e)!==!1)}function Or(e,t){return Dr(e,t)||e.state.data!==void 0&&kr(e,t,t.refetchOnMount)}function kr(e,t,n){if(In(t.enabled,e)!==!1&&In(t.staleTime,e)!==`static`){let r=In(n,e);return r===`always`||r!==!1&&jr(e,t)}return!1}function Ar(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&jr(e,n)}function jr(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(In(t.staleTime,e))}var Mr=class extends Er{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:br(t,n.data),hasPreviousPage:xr(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Nr=class extends gr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Pr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=hr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ur.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Pr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Fr=class extends or{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Nr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ir(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ur.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Rn(t,e))}findAll(e={}){return this.getAll().filter(t=>Rn(e,t))}notify(e){ur.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ur.batch(()=>Promise.all(e.map(e=>e.continue().catch(Mn))))}};function Ir(e){return e.options.scope?.id}var Lr=class extends or{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Wn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Bn(t.mutationKey)!==Bn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Pr();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ur.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Rr(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var zr=class extends or{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ur.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Wn(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Rr(e,n).forEach(e=>{e.destroy()}),Rr(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Un(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Er(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ur.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Br=class extends or{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??zn(r,t),a=this.get(i);return a||(a=new Sr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ur.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ln(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ln(e,t)):t}notify(e){ur.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ur.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ur.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Br,this.#t=e.mutationCache||new Fr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=sr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=dr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(In(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Nn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ur.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ur.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ur.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ur.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return ur.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ur.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(Mn)),r?Promise.resolve():t}));return Promise.all(r).then(Mn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(In(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(In(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return dr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Vn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Vn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=zn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===$n&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Hr=Y.createContext(!1),Ur=()=>Y.useContext(Hr);Hr.Provider;function Wr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gr=Y.createContext(Wr()),Kr=()=>Y.useContext(Gr),qr=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?tr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Jr=e=>{Y.useEffect(()=>{e.clearReset()},[e])},Yr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||tr(n,[e.error,r])),Xr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Zr=(e,t)=>e?.suspense&&t.isPending,Qr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $r({queries:e,...t},n){let r=En(n),i=Ur(),a=Kr(),o=t.subscribed!==!1,s=Y.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Xr(e);let t=r.getQueryCache().get(e.queryHash);qr(e,a,t)}),Jr(a);let[c]=Y.useState(()=>new zr(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine);Y.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let f=!i&&o;Y.useSyncExternalStore(Y.useCallback(e=>f?c.subscribe(ur.batchCalls(e)):Mn,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult());let p=l.some((e,t)=>Zr(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Zr(n,e)?Qr(n,new Er(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Yr({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function ei(e,t,n){let r=Ur(),i=Kr(),a=En(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Xr(o),qr(o,i,s),Jr(i);let[l]=Y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);Y.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=d?l.subscribe(ur.batchCalls(e)):Mn;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Zr(o,u))throw Qr(o,l,i);if(Yr({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ti(e,t){return ei(e,Er,t)}function ni(e,t){let n=En(t),[r]=Y.useState(()=>new Lr(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(ur.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Mn)},[r]);if(i.error&&tr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function ri(e,t){return ei(e,Mr,t)}var ii=[`model`],ai=(e,t)=>e.getAll(t).flatMap(e=>ii.includes(t)?[e]:e.split(`,`)).filter(Boolean);function oi(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=typeof r==`function`?r(ai(n,e)):r;n.delete(e);for(let r of Array.isArray(t)?t:[t])r!=null&&r!==``&&r!==!1&&n.append(e,String(r))}return n.toString()}var si=e=>t=>t.includes(e)?t.filter(t=>t!==e):[...t,e],ci=new Vr({defaultOptions:{queries:{staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!1,retry:(e,t)=>e<1&&(!t?.status||t.status>=500)}}}),li=(e,t)=>p(()=>W(e.toString(),t));function ui(){let e=de(),t=(0,Y.useMemo)(()=>new URLSearchParams(e),[e]);return{params:t,search:e,get:(0,Y.useCallback)((e,n=``)=>t.get(e)??n,[t]),list:(0,Y.useCallback)(e=>ai(t,e),[t]),set:(0,Y.useCallback)((e,t)=>{p(()=>W(oi(pe(),e),t))},[])}}var di=[`agent`,`project`,`person`,`kind`,`model`,`outcome`],fi=[`tokensMin`,`tokensMax`,`durationMin`,`durationMax`],pi=[`row`,`view`];function mi(){let e=ui(),{params:t}=e,n=(0,Y.useMemo)(()=>Ke({range:t.get(`range`)||`30d`,from:t.get(`from`),to:t.get(`to`)}),[t]),r=(0,Y.useMemo)(()=>{let e=new URLSearchParams;e.set(`from`,n.from.toISOString()),e.set(`to`,n.to.toISOString()),e.set(`prevFrom`,n.previous.from.toISOString()),e.set(`prevTo`,n.previous.to.toISOString()),e.set(`tz`,Qe());for(let n of di)for(let r of t.getAll(n).flatMap(e=>ii.includes(n)?[e]:e.split(`,`)))r&&e.append(n,r);for(let n of[...fi,`q`])t.get(n)&&e.set(n,t.get(n));return e.toString()},[t,n]),i=[...di,...fi,`q`].filter(e=>t.get(e));return{...e,period:n,query:r,active:i}}var hi=e=>()=>U.get(e);function gi(e,t,{enabled:n=!0,keep:r=!0}={}){let i=ke(e,t);return ti({queryKey:[i],queryFn:hi(i),enabled:n,placeholderData:r?Xn:void 0})}function _i(e,t,{next:n,enabled:r=!0,key:i}){return ri({queryKey:[ke(e,t(null)),...i||[]],queryFn:({pageParam:n})=>U.get(ke(e,t(n))),initialPageParam:null,getNextPageParam:e=>n(e)??void 0,enabled:r,placeholderData:Xn})}function vi(e,t){let n=En(),r=ke(e,`/views?page=${t}`),i=ti({queryKey:[r],queryFn:hi(r)}),a=()=>n.invalidateQueries({queryKey:[r]}),o=ni({mutationFn:n=>U.post(ke(e,`/views`),{page:t,...n}),onSuccess:a}),s=ni({mutationFn:t=>U.delete(ke(e,`/views/${t}`)),onSuccess:a});return{views:i.data?.views||[],loading:i.isLoading,save:o,remove:s}}var yi=`inline-flex h-9 max-w-full items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium outline-none focus-visible:outline-2 focus-visible:outline-accent`,bi=`border-line bg-surface text-fg hover:bg-surface-2`,xi=`border-accent/50 bg-accent/10 text-fg`,Si=e=>e===``?`~`:e,Ci=e=>e===`~`?``:e;function wi({period:e,onChange:t}){let[n,r]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{n&&(o(St(e.from)),c(St(new Date(e.to.getTime()-864e5))))},[n,e]);let u=e=>{t(e),r(!1)},d=a&&s&&a<=s;return(0,X.jsxs)(b,{open:n,onOpenChange:r,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,bi),"data-sw-period":!0,children:[(0,X.jsx)(Nt,{size:14,className:`text-muted`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label}),(0,X.jsx)(f,{size:13,className:`text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(N,{className:`w-64 p-1.5`,children:[(0,X.jsx)(`ul`,{role:`listbox`,"aria-label":`Period`,children:ut.map(([t,n])=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.range===t,onClick:()=>u({range:t===`30d`?null:t,from:null,to:null}),className:`flex h-9 w-full items-center justify-between rounded-md px-2.5 text-sm text-fg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-period-preset":t,children:[n,e.range===t?(0,X.jsx)(m,{size:16,strokeWidth:3,className:`text-accent`,"aria-hidden":`true`}):null]})},t))}),(0,X.jsxs)(`form`,{className:`mt-1.5 border-t border-line px-1 pt-2.5 pb-1`,onSubmit:e=>{e.preventDefault(),d&&u({range:`custom`,from:a,to:s})},children:[(0,X.jsxs)(`p`,{className:`mb-1.5 flex items-center justify-between text-xs font-medium text-fg`,children:[`Custom range`,e.range===`custom`?(0,X.jsx)(m,{size:16,strokeWidth:3,className:`text-accent`,"aria-hidden":`true`}):null]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[`From`,(0,X.jsx)(P,{type:`date`,value:a,max:s||void 0,onChange:e=>o(e.target.value),className:`mt-0.5`,"data-sw-period-from":!0})]}),(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[`To`,(0,X.jsx)(P,{type:`date`,value:s,min:a||void 0,onChange:e=>c(e.target.value),className:`mt-0.5`,"data-sw-period-to":!0})]})]}),(0,X.jsx)(l,{type:`submit`,size:`sm`,variant:`default`,disabled:!d,className:`mt-2 w-full`,"data-sw-period-apply":!0,children:`Apply`}),(0,X.jsx)(`p`,{className:`mt-1.5 text-caption text-muted`,children:`Days are in your time zone. Up to 400 days.`})]})]})]})}function Ti({id:e,label:n,options:r,values:a,onToggle:o,onChange:s}){let[c,u]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(``),h=new Set(a.map(Ci)),g=r.filter(e=>!d||e.label.toLowerCase().includes(d.toLowerCase())),_=e=>o(Si(e)),v=r.find(e=>h.has(e.key));return(0,X.jsxs)(b,{open:c,onOpenChange:u,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,h.size?xi:bi),"data-sw-filter":e,children:[(0,X.jsxs)(`span`,{className:`truncate`,children:[n,h.size?`: ${v?.label||[...h][0]||`none`}${h.size>1?` +${h.size-1}`:``}`:``]}),(0,X.jsx)(f,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(N,{className:`w-64 p-1.5`,children:[r.length>8?(0,X.jsx)(P,{icon:se,value:d,onChange:e=>p(e.target.value),placeholder:`Find ${n.toLowerCase()}`,"aria-label":`Find ${n.toLowerCase()}`,className:`mb-1`}):null,(0,X.jsxs)(`ul`,{className:`max-h-64 overflow-y-auto`,role:`listbox`,"aria-label":n,"aria-multiselectable":`true`,children:[g.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":h.has(e.key),onClick:()=>_(e.key),className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-filter-option":Si(e.key),children:[(0,X.jsx)(`span`,{className:i(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border`,h.has(e.key)?`border-accent bg-accent text-accent-fg`:`border-line-strong bg-surface`),"aria-hidden":`true`,children:h.has(e.key)?(0,X.jsx)(m,{size:12,strokeWidth:3}):null}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate`,children:e.label}),e.hint?(0,X.jsx)(`span`,{className:`block truncate text-caption text-muted`,children:e.hint}):null]}),e.calls===void 0?null:(0,X.jsx)(`span`,{className:`tabular text-xs text-muted`,children:J(e.calls)})]})},e.key)),g.length?null:(0,X.jsx)(`li`,{className:`px-2 py-3 text-center text-xs text-muted`,children:`Nothing matches.`})]}),h.size?(0,X.jsx)(`div`,{className:`mt-1 border-t border-line pt-1`,children:(0,X.jsxs)(l,{size:`sm`,variant:`ghost`,className:`w-full justify-start`,onClick:()=>s([]),children:[(0,X.jsx)(t,{size:13,"aria-hidden":`true`}),` Clear`]})}):null]})]})}function Ei({get:e,set:t}){let[n,r]=(0,Y.useState)(!1),a=()=>({tokensMin:e(`tokensMin`),tokensMax:e(`tokensMax`),durationMin:e(`durationMin`)?String(Number(e(`durationMin`))/1e3):``,durationMax:e(`durationMax`)?String(Number(e(`durationMax`))/1e3):``}),[o,s]=(0,Y.useState)(a);(0,Y.useEffect)(()=>{n&&s(a())},[n]);let c=fi.filter(t=>e(t)).length,u=(e,t=1)=>e!==``&&Number.isFinite(Number(e))&&Number(e)>=0?String(Math.round(Number(e)*t)):null,d=e=>{e.preventDefault(),t({tokensMin:u(o.tokensMin),tokensMax:u(o.tokensMax),durationMin:u(o.durationMin,1e3),durationMax:u(o.durationMax,1e3)}),r(!1)},f=(e,t)=>(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[t,(0,X.jsx)(P,{type:`number`,min:`0`,inputMode:`numeric`,value:o[e],onChange:t=>s({...o,[e]:t.target.value}),className:`mt-0.5`,"data-sw-range":e})]});return(0,X.jsxs)(b,{open:n,onOpenChange:r,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,c?xi:bi),"data-sw-filter":`ranges`,children:[(0,X.jsx)(bn,{size:14,className:`text-muted`,"aria-hidden":`true`}),`Ranges`,c?`: ${c}`:``]})}),(0,X.jsx)(N,{className:`w-64 p-3`,children:(0,X.jsxs)(`form`,{onSubmit:d,className:`space-y-3`,children:[(0,X.jsxs)(`fieldset`,{children:[(0,X.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-fg`,children:`Tokens (input plus output)`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[f(`tokensMin`,`At least`),f(`tokensMax`,`At most`)]})]}),(0,X.jsxs)(`fieldset`,{children:[(0,X.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-fg`,children:`Duration, in seconds`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[f(`durationMin`,`At least`),f(`durationMax`,`At most`)]})]}),(0,X.jsx)(`p`,{className:`text-caption text-muted`,children:`A range leaves out turns that did not report the number.`}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(l,{type:`submit`,size:`sm`,variant:`default`,className:`flex-1`,"data-sw-range-apply":!0,children:`Apply`}),c?(0,X.jsx)(l,{size:`sm`,variant:`ghost`,onClick:()=>{t(Object.fromEntries(fi.map(e=>[e,null]))),r(!1)},children:`Clear`}):null]})]})})]})}function Di({value:e,onChange:t}){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>r(e),[e]),(0,Y.useEffect)(()=>{if(n.trim()===e)return;let r=window.setTimeout(()=>t(n.trim()),350);return()=>window.clearTimeout(r)},[n,e,t]),(0,X.jsx)(P,{icon:se,value:n,onChange:e=>r(e.target.value),placeholder:`Search ids`,"aria-label":`Search by an id: a turn, an agent, a project, a board or a comment number`,maxLength:80,wrapperClassName:`w-full sm:w-44`,className:`h-9`,"data-sw-usage-search":!0})}function Oi(e){return(0,Y.useMemo)(()=>{let t=t=>e?.[t]||[];return{agent:t(`agent`).map(e=>({key:e.key,label:e.label,hint:e.machine||null,calls:e.calls})),project:t(`project`).map(e=>({key:e.key,label:e.label,calls:e.calls})),person:t(`person`).map(e=>({key:e.key,label:e.label,hint:e.handle?`@${e.handle}`:null,calls:e.calls})),model:t(`model`).map(e=>({key:e.key,label:e.label,calls:e.calls})),kind:Tt.map(e=>({key:e,label:Ze[e],calls:t(`kind`).find(t=>t.key===e)?.calls})),outcome:qe.map(e=>({key:e,label:Je[e],calls:t(`outcome`).find(t=>t.key===e)?.calls}))}},[e])}function ki({filter:e,options:n,children:r}){let{period:i,get:a,list:s,set:c,active:u}=e,d=Oi(n),f=o(`(max-width: 639px)`),p=(e,t)=>d[e].find(e=>e.key===Ci(t))?.label||(t===`~`?`None`:t),m=[];for(let e of di)for(let t of s(e))m.push({id:`${e}:${t}`,text:`${Xe[e]}: ${p(e,t)}`,clear:()=>c({[e]:e=>e.filter(e=>e!==t)},{push:!0})});for(let e of fi)if(a(e)){let t=e.startsWith(`duration`),n=`${t?`Duration`:`Tokens`} ${e.endsWith(`Min`)?`at least`:`at most`} ${t?`${Number(a(e))/1e3} s`:J(Number(a(e)),{exact:!0})}`;m.push({id:e,text:n,clear:()=>c({[e]:null},{push:!0})})}return a(`q`)&&m.push({id:`q`,text:`Id contains "${a(`q`)}"`,clear:()=>c({q:null},{push:!0})}),(0,X.jsxs)(`div`,{className:`mb-4 print:hidden`,"data-sw-usage-filters":!0,children:[(0,X.jsxs)(`div`,{className:`sw-scroll-x -mx-3 flex items-center gap-1.5 overflow-x-auto px-3 pb-1 sm:mx-0 sm:flex-wrap sm:overflow-visible sm:px-0 sm:pb-0 [&>*]:shrink-0`,children:[(0,X.jsx)(wi,{period:i,onChange:e=>c(e,{push:!0})}),di.map(e=>(0,X.jsx)(Ti,{id:e,label:Xe[e],options:d[e],values:s(e),onToggle:t=>c({[e]:si(t)},{push:!0}),onChange:t=>c({[e]:t},{push:!0})},e)),(0,X.jsx)(Ei,{get:a,set:e=>c(e,{push:!0})}),f?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Di,{value:a(`q`),onChange:e=>c({q:e||null})}),(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:r})]})]}),f?(0,X.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,X.jsx)(Di,{value:a(`q`),onChange:e=>c({q:e||null})}),(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:r})]}):null,m.length?(0,X.jsxs)(`ul`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,"aria-label":`Filters in effect`,"data-sw-usage-chips":!0,children:[m.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:e.clear,className:`inline-flex h-7 max-w-[16rem] items-center gap-1 rounded-full border border-line bg-surface-2 pr-1.5 pl-2.5 text-xs text-fg outline-none hover:border-line-strong focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":`Remove the filter ${e.text}`,"data-sw-chip":e.id,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.text}),(0,X.jsx)(t,{size:12,className:`shrink-0 text-muted`,"aria-hidden":`true`})]})},e.id)),(0,X.jsx)(`li`,{children:(0,X.jsx)(l,{size:`xs`,variant:`ghost`,onClick:()=>c(Object.fromEntries(u.map(e=>[e,null])),{push:!0}),"data-sw-usage-clear":!0,children:`Clear all`})})]}):null]})}function Ai({workspaceId:t,page:o,search:s,onOpen:c,layout:u=null}){let{views:d,save:p,remove:h}=vi(t,o),g=H(),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(!0),E=(0,Y.useMemo)(()=>new URLSearchParams(s).get(`view`),[s]),O=(0,Y.useMemo)(()=>{let e=new URLSearchParams(s);for(let t of pi)e.delete(t);return e.toString()},[s]),k=d.find(e=>e.query===O&&(!E||e.id===E))||d.find(e=>e.query===O),A=e=>e.hasLayout?`${e.query}${e.query?`&`:``}view=${e.id}`:e.query;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(n,{open:v,onOpenChange:y,children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,k?xi:bi),"data-sw-views":!0,children:[(0,X.jsx)(jt,{size:14,className:`text-muted`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-w-[9rem] truncate`,children:k?k.name:`Views`}),(0,X.jsx)(f,{size:13,className:`text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(ee,{className:`w-64`,children:[(0,X.jsx)(r,{children:`Your saved views`}),d.length?d.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsxs)(a,{className:`min-w-0 flex-1`,onSelect:()=>c(A(e)),"data-sw-view":e.name,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.name}),e.hasLayout?(0,X.jsx)(ze,{size:13,"aria-label":`Carries a layout`,"data-sw-view-has-layout":!0}):null,k?.id===e.id?(0,X.jsx)(m,{size:14,className:`ml-auto text-accent`,"aria-hidden":`true`}):null]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Delete the view ${e.name}`,onClick:()=>h.mutate(e.id),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted outline-none hover:bg-surface-2 hover:text-bad focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-view-delete":e.name,children:(0,X.jsx)(Ve,{size:13,"aria-hidden":`true`})})]},e.id)):(0,X.jsx)(`p`,{className:`px-2.5 pb-1.5 text-xs text-muted`,children:`None yet. Set the filters you want, then save them here.`}),(0,X.jsx)(e,{}),(0,X.jsxs)(a,{onSelect:()=>x(!0),"data-sw-view-save":!0,children:[(0,X.jsx)(jt,{size:14,"aria-hidden":`true`}),` Save this view`]}),(0,X.jsxs)(a,{onSelect:async()=>{try{let e=_?`#${fe()}`:``,t=E||(k?.hasLayout?k.id:null),n=[O,t?`view=${t}`:``].filter(Boolean).join(`&`);await navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}${e}${n?`?${n}`:``}`),g(t?`Link copied. It carries the filters and the layout, not your access.`:`Link copied. It carries the filters, not your access.`)}catch{g(`This browser did not allow copying`,`bad`)}},"data-sw-view-link":!0,children:[(0,X.jsx)(R,{size:14,"aria-hidden":`true`}),` Copy a link to this view`]})]})]}),b?(0,X.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();try{await p.mutateAsync({name:S,query:O,layout:w&&u?u:null}),g(w&&u?`Saved the view "${S.trim()}" with this layout`:`Saved the view "${S.trim()}"`),x(!1),C(``),T(!0)}catch(e){g(e.message,`bad`)}},className:`flex flex-wrap items-center gap-1.5`,"data-sw-view-form":!0,children:[(0,X.jsx)(P,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),placeholder:`Name this view`,"aria-label":`Name this view`,maxLength:60,className:`h-9`,wrapperClassName:`w-40`,onKeyDown:e=>e.key===`Escape`?x(!1):null}),u?(0,X.jsxs)(`label`,{className:`inline-flex h-9 cursor-pointer items-center gap-1.5 text-xs text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>T(e.target.checked),className:`h-4 w-4 accent-[var(--accent)]`,"data-sw-view-with-layout":!0}),`Include this layout`]}):null,(0,X.jsx)(l,{type:`submit`,size:`md`,variant:`default`,className:`h-9`,disabled:!S.trim()||p.isPending,children:`Save`}),(0,X.jsx)(l,{size:`md`,variant:`ghost`,className:`h-9`,onClick:()=>x(!1),children:`Cancel`})]}):null]})}function ji(e){return Mi(e)||typeof e==`function`||Ni(e)}function Mi(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ni(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function Pi(e,t){return e==null?null:ji(e)?Y.createElement(e,t):e}function Fi(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?Pi(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:Pi(n.cell,t.getContext())}return`header`in e&&e.header?Pi(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?Pi(e.footer.column.columnDef.footer,e.footer.getContext()):null}function Ii({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Li(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Ri=[],zi=0,{link:Bi,unlink:Vi,propagate:Hi,checkDirty:Ui,shallowPropagate:Wi}=Ii({update(e){return e._update()},notify(e){Ri[Ki++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Xi(e))}}),Gi=0,Ki=0,qi,Ji=0;function Yi(e){try{++Ji,e()}finally{--Ji||Zi()}}function Xi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Vi(n,e)}function Zi(){if(!(Ji>0)){for(;Gi<Ki;){let e=Ri[Gi];Ri[Gi++]=void 0,e.notify()}Gi=0,Ki=0}}function Qi(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return qi!==void 0&&Bi(i,qi,zi),i._snapshot},subscribe(e){let t=Li(e),n={current:!1},r=$i(()=>{i.get(),n.current?(qi=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=qi,o=t?.compare??Object.is;if(n)qi=i,++zi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{qi=a,n&&(i.flags&=-5),Xi(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Ui(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Wi(e)}}else e&32&&(i.flags=e&-33);return qi!==void 0&&Bi(i,qi,zi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Hi(e),Wi(e),Zi())}},i}function $i(e){let t=()=>{let t=qi;qi=n,++zi,n.depsTail=void 0,n.flags=6;try{return e()}finally{qi=t,n.flags&=-5,Xi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Ui(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Xi(this)}};return t(),n}function ea(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=ta(e);if(n.length!==ta(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function ta(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var na=pt();function ra(e,t){return e===t}function ia(e,t=e=>e,n){let r=n?.compare??ra,i=(0,Y.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,Y.useCallback)(()=>e.get(),[e]);return(0,na.useSyncExternalStoreWithSelector)(i,a,a,t,r)}function aa(e){let t=ia(e.source,e.selector,{compare:ea});return typeof e.children==`function`?e.children(t):e.children}function oa(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function sa(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return a&&i(o,t)||(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function ca(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{n&&t(r,e)||i(e)})}}function la(){return sa({createAtom:Qi,batch:Yi})}function ua(e,t){return typeof e==`function`?e(t):e}function da(e){if(Array.isArray(e))return e.map(da);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?fa():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:da(e[i]),writable:!0})}return n}return e}function fa(){return Object.create(null)}function pa(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ma(e,t){return n=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>ua(n,e))}}function ha(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ga(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var _a=3;function va(e,t){return ya(e,t,_a)}function ya(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!ha(e)||!ha(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=ga(e),i=ga(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e<r.length;e++){let i=r[e];if(!Object.prototype.propertyIsEnumerable.call(t,i)||!ya(a[i],o[i],n-1))return!1}return!0}function ba(e,t,n,r=va){let i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,a=e.options[i];a&&a(e=>{let t=ua(n,e);return r(e,t)?e:t})}function xa(e){return e instanceof Function}function Sa(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var Ca=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u&&(o=l,a?.(),s=e(...l??[]),r?.(s)),s}};function wa(e){let t=!1;return()=>{t?e():t=!0}}function Ta({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o={onAfterUpdate:r?()=>{let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))}:void 0};return Ca({...a,...o})}function Ea(e,t=`_`){let[n,r]=e.replace(t,` `).split(` `);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function Da(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=Ea(r);t[n]=a?Ta({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function Oa(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=Ea(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=Ta({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function Z(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function ka(e){return e.row.getValue(e.column.id)}function Aa(e){return e.getValue()??e.table.options.renderFallbackValue}function ja(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var Ma={assignCellPrototype:(e,t)=>{Oa(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>ka(e)},cell_renderValue:{fn:e=>Aa(e)},cell_getContext:{fn:e=>ja(e),memoDeps:e=>[e]}})}};function Na(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function Pa(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0){if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey]}if(!s)throw Error();let l=Na(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function Fa(e){return e.getIsVisible?.()??!0}function Ia(e){return e.getVisibleLeafColumns?.()??e.getAllLeafColumns()}function La(e){return e.getVisibleCells?.()??e.getAllCells()}function Ra(e){return e.getVisibleCellsByColumnId?.()??e.getAllCellsByColumnId()}function za(e,t){let n=e,r=t;return n.getOrderColumnsFn?.()(r)??n._orderGroupedColumns?.(r)??t}function Ba(e,t,n,r){return e._orderByColumnPinning?.(t,n,r)??t}function Va(e,t){return e.getPinnedVisibleLeafColumns?.(t)??(t&&t!==`center`?[]:Ia(e))}function Ha(e,t){return e._expandRows?.(t)??t}function Ua(e){e.autoResetExpanded?.()}function Wa(e){e.autoResetPageIndex?.()}function Ga(e){e.autoResetSorting?.()}function Ka(e){e.autoResetCellSelection?.()}function qa(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function Ja(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return za(e.table,t)}return[e]}function Ya(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Xa(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=Pa(e,o,r,n),c=o;s.columns=c.columns?Xa(e,c.columns,s,r+1):[],i[a]=s}return i}function Za(e){return Xa(e,e.options.columns)}function Qa(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function $a(e){let t=fa(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function eo(e){return za(e,e.getAllColumns().flatMap(e=>e.getLeafColumns()))}function to(e){let t=fa(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function no(e,t){return e.getAllFlatColumnsById()[t]}var ro={assignColumnPrototype:(e,t)=>{Oa(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>qa(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>Ja(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{Da(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>Ya(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>Za(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>Qa(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>$a(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>eo(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>to(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>no(e,t)}})}};function io(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function ao(e,t,n){let r=io(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function oo(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];Fa(i)&&i.columns.length&&(n=Math.max(n,oo(i.columns,t+1)))}return n}function so(e,t){return e?`${e}_${t}`:String(t)}function co(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function lo(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function uo(e,t,n,r,i,a){let o={depth:t,id:so(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=ao(n,u,{id:co(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(lo(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&uo(s,t-1,n,r,i,a)}function fo(e){for(let t=0;t<e.length;t++){let n=e[t];if(!Fa(n.column))continue;let r=0;if(n.subHeaders.length){fo(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];Fa(t.column)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function po(e,t,n,r){let i=oo(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=ao(n,t[e],{depth:i,index:e}));return uo(s,i-1,n,r,a,o),a.reverse(),fo(a[0]?.headers??[]),a}function mo(e,t){for(let n=0;n<e.subHeaders.length;n++)mo(e.subHeaders[n],t);t.push(e)}function ho(e){let t=[];return mo(e,t),t}function go(e){return{column:e.column,header:e,table:e.column.table}}function _o(e){return po(e.getAllColumns(),Ba(e,Ia(e),e=>e.id),e)}function vo(e){return[...e.getHeaderGroups()].reverse()}function yo(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function bo(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}var xo={assignHeaderPrototype:(e,t)=>{Oa(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>ho(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>go(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{Da(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>_o(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>vo(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>yo(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>bo(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function So(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}var Co=(e,t,n,r,i,a,o)=>{let s=So(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=fa(),c._valuesCache=fa(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c};function wo(){return e=>Ta({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>Eo(e,e.options.data),onAfterUpdate:wa(()=>{Ua(e),Wa(e),Ga(e),Ka(e)})})}function To(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=Co(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=To(e,t,c.originalSubRows,r+1,c)))}return a}function Eo(e,t){let n={rows:[],flatRows:[],rowsById:fa()};return n.rows=To(e,n,t),n}function Do(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??wo()(e)),e._rowModels.coreRowModel()}function Oo(e){return e.getCoreRowModel()}function ko(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function Ao(e){return e.getFilteredRowModel()}function jo(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function Mo(e){return e.getGroupedRowModel()}function No(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Po(e){return e.getSortedRowModel()}function Fo(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function Io(e){return e.getExpandedRowModel()}function Lo(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function Ro(e){return e.getPaginatedRowModel()}var zo={constructTableAPIs:e=>{Da(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>Do(e)},table_getPreFilteredRowModel:{fn:()=>Oo(e)},table_getFilteredRowModel:{fn:()=>ko(e)},table_getPreGroupedRowModel:{fn:()=>Ao(e)},table_getGroupedRowModel:{fn:()=>jo(e)},table_getPreSortedRowModel:{fn:()=>Mo(e)},table_getSortedRowModel:{fn:()=>No(e)},table_getPreExpandedRowModel:{fn:()=>Po(e)},table_getExpandedRowModel:{fn:()=>Fo(e)},table_getPrePaginatedRowModel:{fn:()=>Io(e)},table_getPaginatedRowModel:{fn:()=>Lo(e)},table_getRowModel:{fn:()=>Ro(e)}})}};function Bo(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function Vo(e,t,n){let r=Bo(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function Ho(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function Uo(e){let t=e.getPrePaginatedRowModel(),n=e.options.paginateExpandedRows===!1?Ha(e,t).rows:t.rows;for(let e=0;e<n.length;e++)n[e]._displayIndexCache=e;return n}function Wo(e,t){if(pa(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function Go(e,t){if(pa(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Ko(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function qo(e){return Sa(e.subRows,e=>e.subRows)}function Jo(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function Yo(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function Xo(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function Zo(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=Vo(a,e,e.table),n.set(a,o)),r[i]=o}return r}function Qo(e){let t=fa(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function $o(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function es(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}var ts={assignRowPrototype:(e,t)=>{Oa(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>Ho(e)},row_getAllCellsByColumnId:{fn:e=>Qo(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>Zo(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>qo(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>Yo(e)},row_getParentRows:{fn:e=>Xo(e)},row_getUniqueValues:{fn:(e,t)=>Go(e,t)},row_getValue:{fn:(e,t)=>Wo(e,t)},row_renderValue:{fn:(e,t)=>Ko(e,t)}})},constructTableAPIs:e=>{Da(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>Uo(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>$o(t,e,n,r)},table_getRow:{fn:(t,n)=>es(e,t,n)},table_getMaxSubRowDepth:{fn:()=>Jo(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function ns(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function rs(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{ns(e,t,n),e._reactivity.commit?.()})}function is(e){let t=da(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function as(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function os(e,t,n){let r=as(e,ua(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&rs(e,r.state??null)}var ss={coreCellsFeature:Ma,coreColumnsFeature:ro,coreHeadersFeature:xo,coreRowModelsFeature:zo,coreRowsFeature:ts,coreTablesFeature:{constructTableAPIs:e=>{Da(`coreTablesFeature`,e,{table_reset:{fn:()=>is(e)},table_setOptions:{fn:t=>os(e,t)}})}}};function cs(e){return e}function ls(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),da(t)}function us(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...ss,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=ls(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&pa(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}ns(v),v.store=oa(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:ea,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}function ds(){return[]}function fs(e){let t=e=>{let t=fa();for(let n=0;n<e.length;n++)t[e[n].id]=n;return t};return{all:t(Va(e)),center:t(Va(e,`center`)),start:t(Va(e,`start`)),end:t(Va(e,`end`))}}function ps(e,t){return Z(e.table,`getColumnIndexes`,fs)[t===`start`?`start`:t===`end`?`end`:t===`center`?`center`:`all`][e.id]??-1}function ms(e,t){return Va(e.table,t)[0]?.id===e.id}function hs(e,t){let n=Va(e.table,t);return n[n.length-1]?.id===e.id}function gs(e,t){ba(e,`columnOrder`,t)}function _s(e,t){gs(e,t?[]:da(e.initialState.columnOrder??[]))}function vs(e){let t=e.atoms.columnOrder?.get();return n=>{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];e.set(r.id,r)}for(let n=0;n<t.length;n++){let i=t[n],a=e.get(i);a&&(r.push(a),e.delete(i))}for(let t=0;t<n.length;t++){let i=n[t];e.has(i.id)&&r.push(i)}}return ys(e,r)}}function ys(e,t){let n=e.atoms.grouping?.get()??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;let i=t.filter(e=>!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;e<t.length;e++){let n=t[e];a.set(n.id,n)}let o=[];for(let e=0;e<n.length;e++){let t=a.get(n[e]);t&&o.push(t)}return[...o,...i]}var bs={getInitialState:e=>({columnOrder:ds(),...e}),getDefaultTableOptions:e=>({onColumnOrderChange:ma(`columnOrder`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnOrderingFeature`,e,t,{column_getIndex:{fn:(e,t)=>ps(e,t)},column_getIsFirstColumn:{fn:(e,t)=>ms(e,t)},column_getIsLastColumn:{fn:(e,t)=>hs(e,t)}})},constructTableAPIs:e=>{Da(`columnOrderingFeature`,e,{table_getColumnIndexes:{fn:()=>fs(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnOrder:{fn:t=>gs(e,t)},table_resetColumnOrder:{fn:t=>_s(e,t)},table_getOrderColumnsFn:{fn:()=>vs(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]}})}};function xs(){return{start:[],end:[]}}function Ss(e,t){let n=e.getLeafColumns(),r=[];for(let e=0;e<n.length;e++){let t=n[e].id;t&&r.push(t)}ks(e.table,e=>t===`end`?{start:e.start.filter(e=>!r.includes(e)),end:[...e.end.filter(e=>!r.includes(e)),...r]}:t===`start`?{start:[...e.start.filter(e=>!r.includes(e)),...r],end:e.end.filter(e=>!r.includes(e))}:{start:e.start.filter(e=>!r.includes(e)),end:e.end.filter(e=>!r.includes(e))})}function Cs(e){return e.getLeafColumns().some(t=>(t.columnDef.enablePinning??!0)&&(e.table.options.enableColumnPinning??!0))}function ws(e){let t=e.getLeafColumns(),{start:n,end:r}=e.table.atoms.columnPinning?.get()??xs();for(let e=0;e<t.length;e++)if(n.includes(t[e].id))return`start`;for(let e=0;e<t.length;e++)if(r.includes(t[e].id))return`end`;return!1}function Ts(e){let t=ws(e);return t?e.table.atoms.columnPinning?.get()?.[t].indexOf(e.id)??-1:0}function Es(e){let t=La(e),{start:n,end:r}=e.table.atoms.columnPinning?.get()??xs();if(!n.length&&!r.length)return t;let i=[...n,...r];return t.filter(e=>!i.includes(e.column.id))}function Ds(e){let{start:t}=e.table.atoms.columnPinning?.get()??xs();if(!t.length)return[];let n=Ra(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`start`,r.push(i))}return r}function Os(e){let{end:t}=e.table.atoms.columnPinning?.get()??xs();if(!t.length)return[];let n=Ra(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`end`,r.push(i))}return r}function ks(e,t){ba(e,`columnPinning`,t)}function As(e,t){ks(e,t?xs():da(e.initialState.columnPinning??xs()))}function js(e,t){let n=e.atoms.columnPinning?.get();return t?!!n?.[t].length:!!(n?.start.length||n?.end.length)}function Ms(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{start:r}=e.atoms.columnPinning?.get()??xs(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&Fa(t)&&i.push(t)}return po(t,i,e,`start`)}function Ns(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{end:r}=e.atoms.columnPinning?.get()??xs(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&Fa(t)&&i.push(t)}return po(t,i,e,`end`)}function Ps(e){let t=e.getAllColumns(),n=Ia(e),{start:r,end:i}=e.atoms.columnPinning?.get()??xs();if(r.length||i.length){let e=[...r,...i];n=n.filter(t=>!e.includes(t.id))}return po(t,n,e,`center`)}function Fs(e){return[...Z(e,`getStartHeaderGroups`,Ms)].reverse()}function Is(e){return[...Z(e,`getEndHeaderGroups`,Ns)].reverse()}function Ls(e){return[...Z(e,`getCenterHeaderGroups`,Ps)].reverse()}function Rs(e){let t=Z(e,`getStartHeaderGroups`,Ms),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function zs(e){let t=Z(e,`getEndHeaderGroups`,Ns),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Bs(e){let t=Z(e,`getCenterHeaderGroups`,Ps),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Vs(e){return Z(e,`getStartFlatHeaders`,Rs).filter(e=>!e.subHeaders.length)}function Hs(e){return Z(e,`getEndFlatHeaders`,zs).filter(e=>!e.subHeaders.length)}function Us(e){return Z(e,`getCenterFlatHeaders`,Bs).filter(e=>!e.subHeaders.length)}function Ws(e){let{start:t}=e.atoms.columnPinning?.get()??xs(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Gs(e){let{end:t}=e.atoms.columnPinning?.get()??xs(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Ks(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??xs();if(!t.length&&!n.length)return e.getAllLeafColumns();let r=[...t,...n];return e.getAllLeafColumns().filter(e=>!r.includes(e.id))}function qs(e,t){return t?t===`start`?Z(e,`getStartLeafColumns`,Ws):t===`end`?Z(e,`getEndLeafColumns`,Gs):Z(e,`getCenterLeafColumns`,Ks):e.getAllLeafColumns()}function Js(e){return Z(e,`getStartLeafColumns`,Ws).filter(e=>Fa(e))}function Ys(e){return Z(e,`getEndLeafColumns`,Gs).filter(e=>Fa(e))}function Xs(e){return Z(e,`getCenterLeafColumns`,Ks).filter(e=>Fa(e))}function Zs(e,t){return t?t===`start`?Z(e,`getStartVisibleLeafColumns`,Js):t===`end`?Z(e,`getEndVisibleLeafColumns`,Ys):Z(e,`getCenterVisibleLeafColumns`,Xs):Ia(e)}function Qs(e,t,n,r){let i=e.atoms.columnPinning?.get();if(!i||!i.start.length&&!i.end.length)return t;let{start:a,end:o}=i,s=r?.();if(!s){s=fa();for(let e=0;e<t.length;e++)s[n(t[e])]=t[e]}let c=[];for(let e=0;e<a.length;e++){let t=s[a[e]];t&&c.push(t)}for(let e=0;e<t.length;e++){let r=n(t[e]);!a.includes(r)&&!o.includes(r)&&c.push(t[e])}for(let e=0;e<o.length;e++){let t=s[o[e]];t&&c.push(t)}return c}var $s={getInitialState:e=>({columnPinning:{...xs(),...e.columnPinning},...e}),getDefaultTableOptions:e=>({onColumnPinningChange:ma(`columnPinning`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnPinningFeature`,e,t,{column_pin:{fn:(e,t)=>Ss(e,t)},column_getCanPin:{fn:e=>Cs(e)},column_getPinnedIndex:{fn:e=>Ts(e)},column_getIsPinned:{fn:e=>ws(e)}})},assignRowPrototype:(e,t)=>{Oa(`columnPinningFeature`,e,t,{row_getCenterVisibleCells:{fn:e=>Es(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get(),e.table.atoms.columnVisibility?.get()]},row_getStartVisibleCells:{fn:e=>Ds(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.start,e.table.atoms.columnVisibility?.get()]},row_getEndVisibleCells:{fn:e=>Os(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.end,e.table.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{Da(`columnPinningFeature`,e,{table_setColumnPinning:{fn:t=>ks(e,t)},table_resetColumnPinning:{fn:t=>As(e,t)},table_getIsSomeColumnsPinned:{fn:t=>js(e,t)},table__orderByColumnPinning:{fn:(t,n,r)=>Qs(e,t,n,r)},table_getStartHeaderGroups:{fn:()=>Ms(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get()?.start,e.atoms.columnOrder?.get()]},table_getCenterHeaderGroups:{fn:()=>Ps(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get()]},table_getEndHeaderGroups:{fn:()=>Ns(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get()?.end,e.atoms.columnOrder?.get()]},table_getStartFooterGroups:{fn:()=>Fs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getCenterFooterGroups:{fn:()=>Ls(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getEndFooterGroups:{fn:()=>Is(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getStartFlatHeaders:{fn:()=>Rs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getEndFlatHeaders:{fn:()=>zs(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getCenterFlatHeaders:{fn:()=>Bs(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getStartLeafHeaders:{fn:()=>Vs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getEndLeafHeaders:{fn:()=>Hs(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getCenterLeafHeaders:{fn:()=>Us(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getStartLeafColumns:{fn:()=>Ws(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndLeafColumns:{fn:()=>Gs(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterLeafColumns:{fn:()=>Ks(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedLeafColumns:{fn:t=>qs(e,t)},table_getStartVisibleLeafColumns:{fn:()=>Js(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterVisibleLeafColumns:{fn:()=>Xs(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndVisibleLeafColumns:{fn:()=>Ys(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedVisibleLeafColumns:{fn:t=>Zs(e,t)}})}};function ec(){return fa()}function tc(){return{size:150,minSize:20,maxSize:2**53-1}}function nc(e){let t=tc(),n=e.table.atoms.columnSizing?.get(),r=n&&pa(n,e.id)?n[e.id]:void 0;return Math.min(Math.max(e.columnDef.minSize??t.minSize,r??e.columnDef.size??t.size),e.columnDef.maxSize??t.maxSize)}function rc(e){let t=fa(),n=fa(),r=Array(e.length),i=0;for(let n=0;n<e.length;n++){let a=e[n],o=Z(a,`getSize`,nc);r[n]=o,t[a.id]=i,i+=o}let a=0;for(let t=e.length-1;t>=0;t--)n[e[t].id]=a,a+=r[t];return{starts:t,afters:n}}function ic(e){return{all:rc(Va(e)),center:rc(Va(e,`center`)),start:rc(Va(e,`start`)),end:rc(Va(e,`end`))}}function ac(e){return e===`start`?`start`:e===`end`?`end`:e===`center`?`center`:`all`}function oc(e,t){return Z(e.table,`getColumnOffsets`,ic)[ac(t)].starts[e.id]??0}function sc(e,t){return Z(e.table,`getColumnOffsets`,ic)[ac(t)].afters[e.id]??0}function cc(e){fc(e.table,t=>{let n=fa(),r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];a!==e.id&&(n[a]=t[a])}return n})}function lc(e){if(!e.subHeaders.length)return nc(e.column);let t=0;for(let n=0;n<e.subHeaders.length;n++)t+=lc(e.subHeaders[n]);return t}function uc(e){return lc(e)}function dc(e){if(e.index>0){let t=e.headerGroup?.headers[e.index-1];if(t)return Z(t,`getStart`,dc)+Z(t,`getSize`,uc)}return 0}function fc(e,t){e.options.onColumnSizingChange?.(t)}function pc(e,t){fc(e,t?fa():Object.assign(fa(),da(e.initialState.columnSizing??{})))}function mc(e){let t=0;for(let n=0;n<e.length;n++)t+=Z(e[n],`getSize`,nc);return t}function hc(e){return e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+uc(t),0)??0}function gc(e){return mc(Va(e,`start`))}function _c(e){return mc(Va(e,`center`))}function vc(e){return mc(Va(e,`end`))}var yc={getInitialState:e=>({columnSizing:ec(),...e}),getDefaultColumnDef:()=>tc(),getDefaultTableOptions:e=>({onColumnSizingChange:ma(`columnSizing`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnSizingFeature`,e,t,{column_getSize:{fn:e=>nc(e),memoDeps:e=>[t.options.columns,t.atoms.columnSizing?.get()?.[e.id]]},column_getStart:{fn:(e,t)=>oc(e,t)},column_getAfter:{fn:(e,t)=>sc(e,t)},column_resetSize:{fn:e=>cc(e)}})},assignHeaderPrototype:(e,t)=>{Oa(`columnSizingFeature`,e,t,{header_getSize:{fn:e=>uc(e),memoDeps:e=>[t.options.columns,e.column.columns.length>0?t.atoms.columnSizing?.get():t.atoms.columnSizing?.get()?.[e.column.id]]},header_getStart:{fn:e=>dc(e),memoDeps:()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode]}})},constructTableAPIs:e=>{Da(`columnSizingFeature`,e,{table_getColumnOffsets:{fn:()=>ic(e),memoDeps:()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnSizing:{fn:t=>fc(e,t)},table_resetColumnSizing:{fn:t=>pc(e,t)},table_getTotalSize:{fn:()=>hc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getStartTotalSize:{fn:()=>gc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getCenterTotalSize:{fn:()=>_c(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getEndTotalSize:{fn:()=>vc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]}})}};function bc(){return fa()}function xc(e,t){Cc(e)&&kc(e.table,n=>{let r=Object.assign(fa(),n),i=t??!Z(e,`getIsVisible`,Sc),a=e.getLeafColumns();for(let e=0;e<a.length;e++){let t=a[e];Cc(t)&&(r[t.id]=i)}return r})}function Sc(e){let t=e.table.atoms.columnVisibility?.get();if(!t)return!0;let n=e.columns;return n.length?n.some(e=>Z(e,`getIsVisible`,Sc)):(pa(t,e.id)?t[e.id]:void 0)??!0}function Cc(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function wc(e){return t=>{xc(e,t.target.checked)}}function Tc(e){let t=e.getAllCells(),n=[];for(let e=0;e<t.length;e++){let r=t[e];Z(r.column,`getIsVisible`,Sc)&&n.push(r)}return Ba(e.table,n,e=>e.column.id,()=>Z(e,`getVisibleCellsByColumnId`,Ec))}function Ec(e){let t=fa(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];Z(r.column,`getIsVisible`,Sc)&&(t[r.column.id]=r)}return t}function Dc(e){return e.getAllFlatColumns().filter(e=>Z(e,`getIsVisible`,Sc))}function Oc(e){return e.getAllLeafColumns().filter(e=>Z(e,`getIsVisible`,Sc))}function kc(e,t){ba(e,`columnVisibility`,t)}function Ac(e,t){kc(e,t?fa():Object.assign(fa(),da(e.initialState.columnVisibility??{})))}function jc(e,t){t??=!Mc(e);let n=fa(),r=e.getAllLeafColumns();for(let e=0;e<r.length;e++){let i=r[e];n[i.id]=t||!Cc(i)}kc(e,n)}function Mc(e){return!e.getAllLeafColumns().some(e=>!Z(e,`getIsVisible`,Sc))}function Nc(e){return e.getAllLeafColumns().some(e=>Z(e,`getIsVisible`,Sc))}function Pc(e){return t=>{jc(e,t.target.checked)}}var Fc={getInitialState:e=>({columnVisibility:bc(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:ma(`columnVisibility`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnVisibilityFeature`,e,t,{column_getIsVisible:{fn:e=>Sc(e),memoDeps:e=>[t.options.columns,t.atoms.columnVisibility?.get(),e.columns]},column_getCanHide:{fn:e=>Cc(e)},column_getToggleVisibilityHandler:{fn:e=>wc(e)},column_toggleVisibility:{fn:(e,t)=>xc(e,t)}})},assignRowPrototype:(e,t)=>{Oa(`columnVisibilityFeature`,e,t,{row_getVisibleCells:{fn:e=>Tc(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get()]},row_getVisibleCellsByColumnId:{fn:e=>Ec(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{Da(`columnVisibilityFeature`,e,{table_getVisibleFlatColumns:{fn:()=>Dc(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getVisibleLeafColumns:{fn:()=>Oc(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_setColumnVisibility:{fn:t=>kc(e,t)},table_resetColumnVisibility:{fn:t=>Ac(e,t)},table_toggleAllColumnsVisible:{fn:t=>jc(e,t)},table_getIsAllColumnsVisible:{fn:()=>Mc(e)},table_getIsSomeColumnsVisible:{fn:()=>Nc(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>Pc(e)}})}},Ic=/([0-9]+)/gm;function Lc(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var Rc=Lc({sort:(e,t)=>zc(e,t)});function zc(e,t){return e===t?0:e>t?1:-1}function Bc(){return[]}function Vc(e,t){ba(e,`sorting`,t)}function Hc(e,t){Vc(e,t?[]:da(e.initialState.sorting??[]))}function Uc(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Hc(e)}function Wc(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t<n.length;t++){let a=n[t].getValue(e.id);if(Object.prototype.toString.call(a)===`[object Date]`){r=`datetime`;break}if(typeof a==`string`&&(i=!0,a.split(Ic).length>1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return Rc}function Gc(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){let r=t[n].getValue(e.id);if(r!=null)return typeof r==`string`?`asc`:`desc`}return`desc`}function Kc(e){let t=e.table._rowModelFns.sortFns;return xa(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn===`auto`?Wc(e):t?.[e.columnDef.sortFn]??Rc}function qc(e,t,n){let r=Yc(e,n&&Zc(e)),i=t!==void 0;Vc(e.table,a=>{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&Zc(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function Jc(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Gc(e)===`desc`?`desc`:`asc`}function Yc(e,t){let n=Jc(e),r=Qc(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function Xc(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function Zc(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Qc(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function $c(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function el(e){Vc(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function tl(e){let t=Xc(e);return n=>{t&&qc(e,void 0,Zc(e)?e.table.options.isMultiSortEvent?.(n):!1)}}var nl={getInitialState(e){return{sorting:Bc(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:ma(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){Oa(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>Wc(e)},column_getAutoSortDir:{fn:e=>Gc(e)},column_getSortFn:{fn:e=>Kc(e)},column_toggleSorting:{fn:(e,t,n)=>qc(e,t,n)},column_getFirstSortDir:{fn:e=>Jc(e)},column_getNextSortingOrder:{fn:(e,t)=>Yc(e,t)},column_getCanSort:{fn:e=>Xc(e)},column_getCanMultiSort:{fn:e=>Zc(e)},column_getIsSorted:{fn:e=>Qc(e)},column_getSortIndex:{fn:e=>$c(e)},column_clearSorting:{fn:e=>el(e)},column_getToggleSortingHandler:{fn:e=>tl(e)}})},constructTableAPIs(e){Da(`rowSortingFeature`,e,{table_autoResetSorting:{fn:()=>Uc(e)},table_setSorting:{fn:t=>Vc(e,t)},table_resetSorting:{fn:t=>Hc(e,t)}})}},rl=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function il(e,t){let[{table:n,rootSource:r}]=(0,Y.useState)(()=>{let t=us({...e,features:{coreReactivityFeature:la(),...e.features}});return t.Subscribe=(e=>aa({...e,source:e.source??t.store})),t.FlexRender=Fi,{table:t,rootSource:ca(t.store,ea)}}),i=n;os(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=ia(r,t,{compare:ea});return rl(()=>{r.markCommitted(o),rs(i,a??null,ea)}),(0,Y.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}var al=v(u(),1);function ol(e){return typeof e==`object`?e.key:e}function sl(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function cl(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function ll(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var ul=(e,t)=>Math.abs(e-t)<1.01,dl=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function fl({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var pl=e=>e===`smooth`||e===`smoothFinishing`;function ml({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!pl(n.phase)&&!ul(t,n.lastTargetOffset)&&!ul(t,r())&&e!==`clampedEcho`}var hl=40;function gl(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<hl;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<hl;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function _l(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<hl;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var vl,yl=()=>{if(vl!==void 0)return vl;if(typeof navigator>`u`)return vl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return vl=!0;let e=navigator.maxTouchPoints;return vl=navigator.platform===`MacIntel`&&e!==void 0&&e>0},bl,xl=()=>bl===void 0?bl=yl()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):bl,Sl=()=>!yl()||xl(),Cl={capture:!0,passive:!0},wl=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Cl),e.addEventListener(`touchend`,n,Cl),e.addEventListener(`touchcancel`,n,Cl),()=>{e.removeEventListener(`touchstart`,t,Cl),e.removeEventListener(`touchend`,n,Cl),e.removeEventListener(`touchcancel`,n,Cl),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Tl=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},El=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Dl=e=>e,Ol=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},kl=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Tl(n)),!r.ResizeObserver)return()=>{};let a=El(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Tl(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Al={passive:!0},jl=typeof window>`u`||`onscrollend`in window,Ml=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&jl,o=0,s=a?null:dl(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Al),a&&r.addEventListener(`scrollend`,u,Al),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Nl=(e,t)=>Ml(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Pl=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Fl=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},Il=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,Ll=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function Rl(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var zl=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new wl({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&_l(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=!1,r=!1,i=new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=El(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Dl,rangeExtractor:Ol,onChange:()=>{},measureElement:Pl,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>ol(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Rl(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=cl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:ml({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||gl(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?Ll(this.scrollState)&&!ul(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>fl({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=Il(t,e.index!=null&&ul(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(yl()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=cl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=cl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=sl(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=cl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=Hl(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=cl(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!Ll(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!Ll(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!Ll(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=cl(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return ll(t[Bl(0,t.length-1,r?e=>n[e*2]:e=>ll(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(yl()&&this._iosGesture.dragging())&&e!==null&&!ul(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&ul(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=Ll(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Sl()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:Il(n,e.index!=null&&ul(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},Bl=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Vl(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Hl(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Vl(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Bl(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Ul=typeof document<`u`?Y.useLayoutEffect:Y.useEffect;function Wl({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=Y.useReducer(e=>e+1,0)[1],a=Y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=Y.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,al.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=Y.useState(()=>{let e=new zl(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),Ul(()=>d._didMount(),[]),Ul(()=>(s(d),d._willUpdate())),Ul(()=>{l(d)}),d}function Gl(e){return Wl({observeElementRect:kl,observeElementOffset:Nl,scrollToFn:Fl,...e})}var Kl=cs({columnVisibilityFeature:Fc,columnOrderingFeature:bs,columnPinningFeature:$s,columnSizingFeature:yc,rowSortingFeature:nl}),ql=[],Jl=e=>Math.min(640,Math.max(64,Math.round(e)));function Yl(e,{cols:t,pin:n,widths:r=null,defaults:i}){let a=new Set(e.map(e=>e.id)),o=(t?t.split(`,`):i.shown).filter(e=>a.has(e));for(let t of e)t.always&&!o.includes(t.id)&&o.unshift(t.id);let s=e.map(e=>e.id).filter(e=>!o.includes(e));return{order:[...o,...s],hidden:s,pinned:(n==null?i.pinned:n.split(`,`)).filter(e=>o.includes(e)),sizes:Object.fromEntries(String(r||``).split(`,`).map(e=>e.split(`:`)).filter(([e,t])=>a.has(e)&&Number.isFinite(Number(t))&&Number(t)>0).map(([e,t])=>[e,Jl(Number(t))]))}}var Xl=(e,t)=>{let n=e.order.filter(t=>!e.hidden.includes(t)),r=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);return{cols:r(n,t.shown)?null:n.join(`,`),pin:r(e.pinned,t.pinned)?null:e.pinned.join(`,`)||`none`,w:Object.entries(e.sizes||{}).map(([e,t])=>`${e}:${t}`).join(`,`)||null}};function Zl({label:e,columns:t,items:n,rowKey:r,layout:a,onLayout:s,sort:c=null,onSort:u=null,dense:p=!1,onOpen:m,openId:h=null,onToggleGroup:g=null,onMore:_=null,hasMore:v=!1,loadingMore:y=!1,card:b,footer:x=null,busy:C=!1}){let w=o(`(max-width: 639px)`),T=(0,Y.useRef)(null),[E,D]=(0,Y.useState)(0),[O,k]=(0,Y.useState)(null),[A,j]=(0,Y.useState)(null),[M,N]=(0,Y.useState)(null),ee=O?{...a.sizes,[O.id]:O.width}:a.sizes||{},P=w?84:p?34:44,F=il({features:Kl,columns:(0,Y.useMemo)(()=>t.map(e=>({id:e.id,accessorFn:e=>e,header:e.header,size:e.width,enableSorting:!!e.sort,enableHiding:!e.always,meta:e})),[t]),data:ql,manualSorting:!0,enableSortingRemoval:!1,state:{columnOrder:a.order,columnVisibility:Object.fromEntries(a.hidden.map(e=>[e,!1])),columnPinning:{start:a.pinned,end:[]},columnSizing:ee,sorting:c?[{id:t.find(e=>e.sort===c.id)?.id||``,desc:c.dir===`desc`}]:[]},onColumnOrderChange:e=>s({...a,order:typeof e==`function`?e(a.order):e}),onColumnVisibilityChange:e=>{let t=Object.fromEntries(a.hidden.map(e=>[e,!1])),n=typeof e==`function`?e(t):e,r=Object.keys(n).filter(e=>n[e]===!1);s({...a,hidden:r,pinned:a.pinned.filter(e=>!r.includes(e))})},onColumnSizingChange:e=>s({...a,sizes:typeof e==`function`?e(a.sizes||{}):e}),onColumnPinningChange:e=>{let t=typeof e==`function`?e({start:a.pinned,end:[]}):e;s({...a,pinned:t.start||t.left||[]})},onSortingChange:e=>{let n=c?[{id:t.find(e=>e.sort===c.id)?.id||``,desc:c.dir===`desc`}]:[],r=(typeof e==`function`?e(n):e)[0],i=t.find(e=>e.id===r?.id);i?.sort&&u?.({id:i.sort,dir:r.desc?`desc`:`asc`})}}),I=F.getVisibleLeafColumns(),L=[...I.filter(e=>e.getIsPinned()),...I.filter(e=>!e.getIsPinned())],te=[],ne=0;for(let e of L)te.push(ne),ne+=e.getSize();let re=ne,ie=L.filter(e=>e.getIsPinned()).length-1,ae=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.clientX,r=t.getSize(),i=r,o=e=>{i=Jl(r+e.clientX-n),k({id:t.id,width:i})},s=()=>{window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),k(null),i!==r&&F.setColumnSizing({...a.sizes||{},[t.id]:i})};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s),k({id:t.id,width:i})},R=e=>{let t=A;if(j(null),N(null),!t||t===e)return;let n=a.order.filter(e=>e!==t),r=n.indexOf(e),i=a.order.indexOf(t)<a.order.indexOf(e);n.splice(i?r+1:r,0,t),F.setColumnOrder(n)},oe=Gl({count:n.length,getScrollElement:()=>T.current,estimateSize:()=>P,overscan:12});(0,Y.useEffect)(()=>{oe.measure()},[P]);let se=oe.getVirtualItems(),ce=se.at(-1)?.index??0;(0,Y.useEffect)(()=>{v&&!y&&n.length&&ce>=n.length-15&&_?.()},[v,y,n.length,ce,_]),(0,Y.useEffect)(()=>{E>n.length-1&&D(Math.max(0,n.length-1))},[n.length,E]);let le=(0,Y.useCallback)(e=>{e&&(e.type===`row`?m?.(e.row):e.type===`group`?g?.(e.group.key):e.type===`more`&&e.load?.())},[m,g]),z=e=>{let t=Math.min(Math.max(e,0),n.length-1);D(t),oe.scrollToIndex(t,{align:`auto`})},ue=e=>{if(e.target!==e.currentTarget&&e.target.closest(`button, a, input, [role="menuitem"]`))return;let t=n[E],r={ArrowDown:()=>z(E+1),ArrowUp:()=>z(E-1),Home:()=>z(0),End:()=>z(n.length-1),PageDown:()=>z(E+10),PageUp:()=>z(E-10),Enter:()=>le(t)," ":()=>le(t),ArrowRight:()=>t?.type===`group`&&!t.open?g?.(t.group.key):null,ArrowLeft:()=>t?.type===`group`&&t.open?g?.(t.group.key):null};r[e.key]&&(e.preventDefault(),r[e.key]())},B=e=>`sw-grid-row-${e}`,V=(e,t)=>e.type===`row`?r(e.row):`${e.type}:${e.group?.key??t}`;if(w)return(0,X.jsxs)(`div`,{className:i(`transition-opacity`,C&&`opacity-60`),"data-sw-grid":`cards`,children:[(0,X.jsx)(`ul`,{"aria-label":e,className:`divide-y divide-line`,children:n.map((e,t)=>(0,X.jsx)(`li`,{children:e.type===`row`?(0,X.jsx)(`button`,{type:`button`,onClick:()=>m?.(e.row),className:`block w-full px-4 py-3 text-left outline-none active:bg-surface-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-row":r(e.row),children:b(e.row)}):e.type===`group`?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>g?.(e.group.key),"aria-expanded":e.open,className:`flex min-h-11 w-full items-center gap-2 bg-surface-2 px-4 py-2 text-left text-sm font-medium text-fg outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-group":e.group.key,children:[e.open?(0,X.jsx)(f,{size:15,"aria-hidden":`true`}):(0,X.jsx)(d,{size:15,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.group.label}),(0,X.jsx)(`span`,{className:`tabular text-xs font-normal text-muted`,children:e.summary})]}):(0,X.jsx)(`div`,{className:`px-4 py-2`,children:(0,X.jsxs)(l,{size:`touch`,variant:`secondary`,className:`w-full`,onClick:e.load,disabled:e.busy,children:[e.busy?(0,X.jsx)(S,{}):null,` Show more`]})})},V(e,t)))}),v?(0,X.jsx)(`div`,{className:`border-t border-line p-3`,children:(0,X.jsxs)(l,{size:`touch`,variant:`secondary`,className:`w-full`,onClick:_,disabled:y,"data-sw-grid-more":!0,children:[y?(0,X.jsx)(S,{}):null,` Show more`]})}):null,x]});let de=F.getHeaderGroups()[0]?.headers||[],fe=new Map(de.map(e=>[e.column.id,e]));return(0,X.jsxs)(`div`,{className:i(`transition-opacity`,C&&`opacity-60`),"data-sw-grid":`table`,children:[(0,X.jsx)(`div`,{ref:T,role:`grid`,"aria-label":e,"aria-rowcount":n.length+1,"aria-colcount":L.length,"aria-activedescendant":n.length?B(E):void 0,tabIndex:0,onKeyDown:ue,className:`group/grid relative max-h-[min(72vh,720px)] min-h-[220px] overflow-auto outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-scroll":!0,children:(0,X.jsxs)(`div`,{style:{width:re,minWidth:`100%`},children:[(0,X.jsx)(`div`,{role:`row`,"aria-rowindex":1,className:`sticky top-0 z-20 flex border-b border-line bg-surface-2`,children:L.map((e,t)=>{let n=e.columnDef.meta,r=e.getIsSorted(),o=!!e.getIsPinned();return(0,X.jsxs)(`div`,{role:`columnheader`,"aria-colindex":t+1,"aria-sort":r?r===`desc`?`descending`:`ascending`:e.getCanSort()?`none`:void 0,style:{width:e.getSize(),flex:t===L.length-1?`1 0 auto`:`0 0 auto`,...o?{left:te[t]}:{}},className:i(`group/header relative flex h-9 items-center gap-0.5 bg-surface-2 pr-1 pl-3 text-xs font-medium text-muted`,o&&`sticky z-10`,o&&t===ie&&`border-r border-line`,n.align===`right`&&`justify-end`,A===e.id&&`opacity-50`,M===e.id&&A!==e.id&&`bg-accent/15 shadow-[inset_2px_0_0_var(--accent)]`),draggable:!O,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id),j(e.id)},onDragOver:t=>{A&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,M!==e.id&&N(e.id))},onDrop:t=>{t.preventDefault(),R(e.id)},onDragEnd:()=>{j(null),N(null)},"data-sw-grid-header":e.id,children:[e.getCanSort()?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>e.toggleSorting(!r||r!==`desc`),className:i(`inline-flex min-w-0 items-center gap-1 rounded px-1 py-1 outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent`,r&&`text-fg`),title:`Sort by ${n.title||n.header}`,"data-sw-grid-sort":e.id,children:[(0,X.jsx)(`span`,{className:`truncate`,children:n.header}),r===`desc`?(0,X.jsx)(Dt,{size:12,"aria-hidden":`true`}):r===`asc`?(0,X.jsx)(kt,{size:12,"aria-hidden":`true`}):null]}):(0,X.jsx)(`span`,{className:`truncate px-1`,children:n.header}),(0,X.jsx)(Ql,{column:e,meta:n,index:a.order.indexOf(e.id),layout:a,onLayout:s,canHide:fe.get(e.id)?.column.getCanHide()!==!1,onWidth:t=>F.setColumnSizing({...a.sizes||{},[e.id]:Jl(t)}),onResetWidth:()=>F.setColumnSizing(Object.fromEntries(Object.entries(a.sizes||{}).filter(([t])=>t!==e.id)))}),(0,X.jsx)(`span`,{"aria-hidden":`true`,onPointerDown:t=>ae(t,e),onDoubleClick:()=>F.setColumnSizing(Object.fromEntries(Object.entries(a.sizes||{}).filter(([t])=>t!==e.id))),draggable:!1,className:i(`absolute inset-y-0 -right-1 z-10 w-2 cursor-col-resize touch-none select-none after:absolute after:inset-y-1.5 after:left-1/2 after:w-px after:bg-line-strong after:opacity-0 group-hover/header:after:opacity-100`,O?.id===e.id&&`after:w-0.5 after:bg-accent after:opacity-100`),"data-sw-grid-resize":e.id})]},e.id)})}),(0,X.jsx)(`div`,{style:{height:oe.getTotalSize(),position:`relative`},children:se.map(e=>{let t=n[e.index];if(!t)return null;let a=e.index===E,o={position:`absolute`,top:0,left:0,width:`100%`,height:e.size,transform:`translateY(${e.start}px)`};if(t.type===`more`)return(0,X.jsx)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,style:o,className:`flex items-center border-b border-line/60 pl-10`,children:(0,X.jsxs)(l,{size:`xs`,variant:`ghost`,onClick:t.load,disabled:t.busy,tabIndex:-1,"data-sw-grid-group-more":t.group?.key,children:[t.busy?(0,X.jsx)(S,{}):null,` Show more of `,t.group?.label]})},V(t,e.index));if(t.type===`group`){let n=L.findIndex((e,t)=>t>0&&e.columnDef.meta.subtotal),r=n<0?L.length:n,s=L.slice(0,r).reduce((e,t)=>e+t.getSize(),0);return(0,X.jsxs)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,"aria-expanded":t.open,"aria-selected":a,style:o,onClick:()=>{D(e.index),g?.(t.group.key)},className:i(`flex cursor-pointer items-center border-b border-line bg-surface-2/70 text-xs font-medium text-fg hover:bg-surface-2`,a&&`group-focus-visible/grid:outline-2 group-focus-visible/grid:-outline-offset-2 group-focus-visible/grid:outline-accent`),"data-sw-grid-group":t.group.key,children:[(0,X.jsxs)(`div`,{role:`gridcell`,style:{width:s,flex:`0 0 auto`},className:`sticky left-0 z-10 flex items-center gap-1.5 pl-3`,children:[t.open?(0,X.jsx)(f,{size:14,"aria-hidden":`true`}):(0,X.jsx)(d,{size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate`,children:t.group.label}),(0,X.jsx)(`span`,{className:`tabular font-normal text-muted`,children:t.summary})]}),L.slice(r).map((e,n)=>(0,X.jsx)(`div`,{role:`gridcell`,style:{width:e.getSize(),flex:r+n===L.length-1?`1 0 auto`:`0 0 auto`},className:i(`tabular truncate px-3`,e.columnDef.meta.align===`right`&&`text-right`),children:e.columnDef.meta.subtotal?.(t.group)??``},e.id))]},V(t,e.index))}let s=r(t.row);return(0,X.jsx)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,"aria-selected":a,style:o,onClick:()=>{D(e.index),m?.(t.row)},className:i(`group/row flex cursor-pointer border-b border-line/60 text-xs text-fg hover:bg-surface-2`,h===s&&`bg-accent/8`,a&&`group-focus-visible/grid:outline-2 group-focus-visible/grid:-outline-offset-2 group-focus-visible/grid:outline-accent`),"data-sw-grid-row":s,children:L.map((e,n)=>{let r=e.columnDef.meta,a=!!e.getIsPinned();return(0,X.jsx)(`div`,{role:`gridcell`,"aria-colindex":n+1,style:{width:e.getSize(),flex:n===L.length-1?`1 0 auto`:`0 0 auto`,...a?{left:te[n]}:{}},className:i(`flex min-w-0 items-center px-3`,r.align===`right`&&`tabular justify-end`,a&&`sticky z-10 bg-surface group-hover/row:bg-surface-2`,a&&h===s&&`bg-[color-mix(in_srgb,var(--accent)_8%,var(--surface))]`,a&&n===ie&&`border-r border-line`,t.depth&&n===0&&`pl-8`),"data-sw-grid-cell":e.id,children:(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:r.cell(t.row)})},e.id)})},s)})})]})}),x]})}function Ql({column:t,meta:r,index:i,layout:o,onLayout:s,canHide:c,onWidth:l,onResetWidth:u}){let d=!!t.getIsPinned(),f=o.order.filter(e=>!o.hidden.includes(e)),p=f.indexOf(t.id),m=e=>{let n=f[p+e];if(!n)return;let r=[...o.order],i=r.indexOf(t.id),a=r.indexOf(n);r[i]=n,r[a]=t.id,s({...o,order:r})};return(0,X.jsxs)(n,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`${r.title||r.header}: column options`,className:`inline-flex h-6 w-5 shrink-0 items-center justify-center rounded text-faint opacity-0 outline-none hover:bg-surface hover:text-fg focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-accent data-[state=open]:opacity-100 [[role=columnheader]:hover_&]:opacity-100`,"data-sw-grid-menu":t.id,children:(0,X.jsx)(qt,{size:13,"aria-hidden":`true`})})}),(0,X.jsxs)(ee,{align:`start`,className:`w-48`,children:[t.getCanSort()?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(a,{onSelect:()=>t.toggleSorting(!1),children:[(0,X.jsx)(kt,{size:14,"aria-hidden":`true`}),` Sort ascending`]}),(0,X.jsxs)(a,{onSelect:()=>t.toggleSorting(!0),children:[(0,X.jsx)(Dt,{size:14,"aria-hidden":`true`}),` Sort descending`]}),(0,X.jsx)(e,{})]}):null,(0,X.jsxs)(a,{onSelect:()=>t.pin(!d&&`start`),"data-sw-grid-pin":t.id,children:[d?(0,X.jsx)(un,{size:14,"aria-hidden":`true`}):(0,X.jsx)(fn,{size:14,"aria-hidden":`true`}),` `,d?`Unpin`:`Pin to the left`]}),(0,X.jsxs)(a,{disabled:p<=0,onSelect:()=>m(-1),children:[(0,X.jsx)(ce,{size:14,"aria-hidden":`true`}),` Move left`]}),(0,X.jsxs)(a,{disabled:p<0||p>=f.length-1,onSelect:()=>m(1),children:[(0,X.jsx)(re,{size:14,"aria-hidden":`true`}),` Move right`]}),(0,X.jsx)(e,{}),(0,X.jsxs)(a,{disabled:t.getSize()>=640,onSelect:()=>l(t.getSize()+32),"data-sw-grid-wider":t.id,children:[(0,X.jsx)(Lt,{size:14,"aria-hidden":`true`}),` Wider`]}),(0,X.jsxs)(a,{disabled:t.getSize()<=64,onSelect:()=>l(t.getSize()-32),"data-sw-grid-narrower":t.id,children:[(0,X.jsx)(zt,{size:14,"aria-hidden":`true`}),` Narrower`]}),o.sizes?.[t.id]?(0,X.jsxs)(a,{onSelect:u,children:[(0,X.jsx)(Re,{size:14,"aria-hidden":`true`}),` Its usual width`]}):null,c&&!r.always?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e,{}),(0,X.jsxs)(a,{onSelect:()=>t.toggleVisibility(!1),"data-sw-grid-hide":t.id,children:[(0,X.jsx)(Yt,{size:14,"aria-hidden":`true`}),` Hide this column`]})]}):null,(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Column `,i+1]})]})]})}function $l({columns:e,layout:t,onLayout:n,onReset:r}){let i=new Map(e.map(e=>[e.id,e])),a=e=>{let r=t.hidden.includes(e)?t.hidden.filter(t=>t!==e):[...t.hidden,e],i=[...t.order.filter(e=>!r.includes(e)),...t.order.filter(e=>r.includes(e))];n({...t,order:i,hidden:r,pinned:t.pinned.filter(e=>!r.includes(e))})},o=(e,r)=>{let i=[...t.order],a=i.indexOf(e),o=a+r;o<0||o>=i.length||([i[a],i[o]]=[i[o],i[a]],n({...t,order:i}))},s=e=>n({...t,pinned:t.pinned.includes(e)?t.pinned.filter(t=>t!==e):[...t.pinned,e]});return(0,X.jsxs)(b,{history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(l,{size:`sm`,variant:`secondary`,className:`h-9`,"data-sw-grid-columns":!0,children:[(0,X.jsx)(Gt,{size:14,"aria-hidden":`true`}),` Columns`]})}),(0,X.jsxs)(N,{align:`end`,className:`w-72 p-1.5`,children:[(0,X.jsx)(`ul`,{className:`max-h-80 overflow-y-auto`,"aria-label":`Columns`,children:t.order.map((e,n)=>{let r=i.get(e);if(!r)return null;let c=!t.hidden.includes(e);return(0,X.jsxs)(`li`,{className:`flex items-center gap-0.5 rounded-md px-1 hover:bg-surface-2`,children:[(0,X.jsxs)(`label`,{className:`flex min-h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:c,disabled:r.always,onChange:()=>a(e),className:`h-4 w-4 accent-[var(--accent)]`,"data-sw-grid-column":e}),(0,X.jsx)(`span`,{className:`truncate`,children:r.title||r.header})]}),(0,X.jsx)(y,{label:t.pinned.includes(e)?`Unpin ${r.header}`:`Pin ${r.header} to the left`,size:`icon-xs`,disabled:!c,onClick:()=>s(e),children:t.pinned.includes(e)?(0,X.jsx)(fn,{size:13,className:`text-accent`,"aria-hidden":`true`}):(0,X.jsx)(fn,{size:13,"aria-hidden":`true`})}),(0,X.jsx)(y,{label:`Move ${r.header} up`,size:`icon-xs`,disabled:n===0,onClick:()=>o(e,-1),children:(0,X.jsx)(kt,{size:13,"aria-hidden":`true`})}),(0,X.jsx)(y,{label:`Move ${r.header} down`,size:`icon-xs`,disabled:n===t.order.length-1,onClick:()=>o(e,1),children:(0,X.jsx)(Dt,{size:13,"aria-hidden":`true`})})]},e)})}),(0,X.jsx)(`div`,{className:`mt-1 border-t border-line pt-1`,children:(0,X.jsxs)(l,{size:`sm`,variant:`ghost`,className:`w-full justify-start`,onClick:r,"data-sw-grid-columns-reset":!0,children:[(0,X.jsx)(Re,{size:13,"aria-hidden":`true`}),` Back to the usual columns`]})})]})]})}function eu(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function tu(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function nu(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=eu(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=tu(r,u,s[0]),f=tu(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function ru(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=eu(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=ou(d,0,s-r),f=ou(f,0,l-i),{x:d,y:f}}function iu(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=eu(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function au(e,t,n){let{margin:r,rowHeight:i}=e,a=eu(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function ou(e,t,n){return Math.max(Math.min(e,n),t)}function su(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function cu(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0&&su(r,t))return r}}function lu(e,t){return e.filter(e=>su(e,t))}function uu(e,t){return t===`horizontal`?fu(e):t===`vertical`||t===`wrap`?du(e):[...e]}function du(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function fu(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function pu(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=r.y+r.h;e>t&&(t=e)}}return t}function mu(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0&&r.i===t)return r}}function hu(e){return e.filter(e=>e.static===!0)}function gu(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function _u(e){let t=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(t[n]=gu(r))}return t}function vu(e,t){let n=Array(e.length);for(let r=0;r<e.length;r++){let i=e[r];i!==void 0&&(t.i===i.i?n[r]=t:n[r]=i)}return n}function yu(e,t,n){let r=mu(e,t);return r?(r=n(gu(r)),[vu(e,r),r]):[[...e],null]}function bu(e,t){let n=hu(e);for(let r=0;r<e.length;r++){let i=e[r];if(i!==void 0){if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=pu(n)),!i.static)n.push(i);else for(;cu(n,i);)i.y++}}return e}function xu(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=uu(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=lu(d,t),p=f.length>0;if(p&&c)return _u(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;e<f.length;e++){let n=f[e];n!==void 0&&(n.moved||(m=n.static?Su(m,n,t,i,o):Su(m,t,n,i,o)))}return m}function Su(e,t,n,r,i,a){let o=i===`horizontal`||i===`wrap`,s=i===`vertical`,c=t.static;if(r){r=!1;let a={x:o?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:`-1`},l=cu(e,a),u=l!==void 0&&l.y+l.h>t.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return xu(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return xu(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return xu(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:xu(e,n,l,u,r,c,i)}function Cu(e,t,n){return Math.max(t,Math.min(n,e))}var wu=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:Cu(t,0,Math.max(0,r-e.w)),y:Cu(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:Cu(t,1,Math.max(1,o)),h:Cu(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:Cu(t,e.minW??1,e.maxW??1/0),h:Cu(n,e.minH??1,e.maxH??1/0)}}}];function Tu(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function Eu(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function Du({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Ou({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function ku(e){return e*100+`%`}function Au(e,t,n,r){return e+n>r?t:n}function ju(e,t,n){return e<0?t:n}function Mu(e){return Math.max(0,e)}function Nu(e){return Math.max(0,e)}var Pu=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:ju(o,e.height,i),top:Nu(o)}},Fu=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Au(e.left,e.width,o,n),left:Mu(i)}},Iu=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Nu(r),left:0}:{height:i,width:a,top:Nu(r),left:o}},Lu=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:ju(r,e.height,a),top:Nu(r)}},Ru={n:Pu,ne:(e,t,n)=>Pu(e,Fu(e,t,n)),e:Fu,se:(e,t,n)=>Lu(e,Fu(e,t,n)),s:Lu,sw:(e,t,n)=>Lu(e,Iu(e,t)),w:Iu,nw:(e,t,n)=>Pu(e,Iu(e,t))};function zu(e,t,n,r){let i=Ru[e];return i?i(t,{...t,...n},r):n}var Bu={type:`transform`,scale:1,calcStyle(e){return Du(e)}},Vu={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Hu={enabled:!0,bounded:!1,threshold:3},Uu={enabled:!0,handles:[`se`]},Wu={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function Gu(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??hu(e).length>0;for(let i=o+1;i<e.length;i++){let o=e[i];if(o!==void 0&&!o.static){if(!s&&o.y>t.y+t.h)break;su(t,o)&&Gu(e,o,n+t[a],r,s)}}t[r]=n}function Ku(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!cu(e,t);)t.y--;let i;for(;(i=cu(e,t))!==void 0;)Gu(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function qu(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!cu(e,t);)t.x--;let i;for(;(i=cu(e,t))!==void 0;)if(Gu(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!cu(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Ju={type:`vertical`,allowOverlap:!1,compact(e,t){let n=hu(e),r=pu(n),i=du(e),a=Array(e.length);for(let t=0;t<i.length;t++){let o=i[t];if(o===void 0)continue;let s=gu(o);s.static||(s=Ku(n,s,i,r),r=Math.max(r,s.y+s.h),n.push(s));let c=e.indexOf(o);a[c]=s,s.moved=!1}return a}},Yu={type:`horizontal`,allowOverlap:!1,compact(e,t){let n=hu(e),r=fu(e),i=Array(e.length);for(let a=0;a<r.length;a++){let o=r[a];if(o===void 0)continue;let s=gu(o);s.static||(s=qu(n,s,t,r),n.push(s));let c=e.indexOf(o);i[c]=s,s.moved=!1}return i}},Xu={type:null,allowOverlap:!1,compact(e,t){return _u(e)}},Zu={...Ju,allowOverlap:!0,compact(e,t){return _u(e)}},Qu={...Yu,allowOverlap:!0,compact(e,t){return _u(e)}},$u={...Xu,allowOverlap:!0};function ed(e,t=!1,n=!1){let r;return r=t?e===`vertical`?Zu:e===`horizontal`?Qu:$u:e===`vertical`?Ju:e===`horizontal`?Yu:Xu,n?{...r,preventCollision:n}:r}function td(e){return Object.keys(e).sort((t,n)=>e[t]-e[n])}function nd(e,t){let n=td(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;i<n.length;i++){let a=n[i];a!==void 0&&t>e[a]&&(r=a)}return r}function rd(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function id(e,t,n,r,i,a){let o=e[n];if(o)return _u(o);let s=e[r],c=td(t),l=c.slice(c.indexOf(n));for(let t=0;t<l.length;t++){let n=l[t];if(n===void 0)continue;let r=e[n];if(r){s=r;break}}let u=bu(_u(s||[]),{cols:i});return(typeof a==`object`&&a?a:ed(a)).compact(u,i)}function ad(e,t){if(Array.isArray(e))return e;let n=e,r=n[t];if(r!==void 0)return r;let i=Object.keys(n);for(let e of i){let t=n[e];if(t!==void 0)return t}return[10,10]}var od=I(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(n,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),sd=I(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),cd=I(((e,t)=>{var n=sd();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),ld=I(((e,t)=>{t.exports=cd()()})),Q=v(ld(),1);function ud(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function dd(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function fd(e){return typeof e==`number`&&!isNaN(e)}function pd(e){return parseInt(e,10)}function md(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var hd=[`Moz`,`Webkit`,`O`,`ms`];function gd(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<hd.length;n++)if(_d(e,hd[n])in t)return hd[n];return``}function _d(e,t){return t?`${t}${vd(e)}`:e}function vd(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var yd=gd(),bd=``;function xd(e,t){bd||=ud([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return dd(e[t])})??``;let n=e[bd];return dd(n)?!!n.call(e,t):!1}function Sd(e,t,n){let r=e;do{if(xd(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Cd(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function wd(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function Td(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=pd(n.borderTopWidth),t+=pd(n.borderBottomWidth),t}function Ed(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=pd(n.borderLeftWidth),t+=pd(n.borderRightWidth),t}function Dd(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=pd(n.paddingTop),t-=pd(n.paddingBottom),t}function Od(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=pd(n.paddingLeft),t-=pd(n.paddingRight),t}function kd(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function Ad(e,t){let n=Md(e,t,`px`);return{[_d(`transform`,yd)]:n}}function jd(e,t){return Md(e,t,``)}function Md({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function Nd(e,t){return e.targetTouches&&ud(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&ud(e.changedTouches,e=>t===e.identifier)}function Pd(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Fd(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function Id(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Fd();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1
|
+
import{A as e,At as t,C as n,D as r,Dt as i,E as a,F as o,Ft as s,It as c,J as l,Lt as u,Mt as d,Nt as f,P as p,Pt as m,Rt as h,S as g,U as _,Vt as v,Y as y,_ as b,_t as x,c as S,ct as C,d as w,g as T,h as E,j as D,kt as O,l as k,p as A,t as j,u as M,v as N,w as ee,x as P,y as F,zt as I}from"./ui-DnyJhoQU.js";import{S as L,_ as te,a as ne,b as re,d as ie,f as ae,g as R,m as oe,p as se,x as ce,y as le}from"./tailnet-D2fRVn68.js";import{$ as z,D as ue,Et as B,F as V,G as de,L as fe,N as H,Q as U,R as pe,Tt as me,U as W,_ as G,_t as he,a as K,at as ge,b as _e,c as ve,ct as ye,dt as be,gt as xe,ht as Se,it as Ce,m as we,mt as Te,o as Ee,p as De,pt as Oe,rt as ke,u as Ae,v as je,wt as Me,x as Ne,xt as Pe,yt as Fe}from"./theme-CPfJOmcz.js";import{A as Ie,M as Le,S as Re,k as ze,v as Be,y as Ve}from"./local-agents-DUtV5lSR.js";import{A as He,B as Ue,C as We,D as Ge,E as Ke,F as qe,I as Je,L as Ye,M as Xe,N as Ze,O as Qe,P as $e,R as et,S as tt,T as nt,_ as rt,a as it,b as at,c as ot,d as st,f as ct,g as lt,h as ut,i as dt,j as ft,k as pt,l as mt,m as ht,n as gt,o as _t,p as vt,r as q,s as yt,t as bt,u as xt,v as St,w as Ct,x as J,y as wt,z as Tt}from"./usage-DjmUlnXL.js";var Et={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Et.node;var Dt=c(Et),Ot={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ot.node;var kt=c(Ot),At={name:`bookmark`,size:24,node:[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]};At.node;var jt=c(At),Mt={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};Mt.node;var Nt=c(Mt),Pt={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};Pt.node;var Ft=c(Pt),It={name:`chevrons-left-right`,size:24,node:[[`path`,{d:`m9 7-5 5 5 5`,key:`j5w590`}],[`path`,{d:`m15 7 5 5-5 5`,key:`1bl6da`}]]};It.node;var Lt=c(It),Rt={name:`chevrons-right-left`,size:24,node:[[`path`,{d:`m20 17-5-5 5-5`,key:`30x0n2`}],[`path`,{d:`m4 17 5-5-5-5`,key:`16spf4`}]]};Rt.node;var zt=c(Rt),Bt={name:`circle-dollar-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};Bt.node;var Vt=c(Bt),Ht={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};Ht.node;var Ut=c(Ht),Wt={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]};Wt.node;var Gt=c(Wt),Kt={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};Kt.node;var qt=c(Kt),Jt={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Jt.node;var Yt=c(Jt),Xt={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};Xt.node;var Zt=c(Xt),Qt={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Qt.node;var $t=c(Qt),en={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};en.node;var tn=c(en),nn={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};nn.node;var rn=c(nn),an={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};an.node;var on=c(an),sn={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};sn.node;var cn=c(sn),ln={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};ln.node;var un=c(ln),dn={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};dn.node;var fn=c(dn),pn={name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]};pn.node;var mn=c(pn),hn={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};hn.node;var gn=c(hn),_n={name:`rows-4`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 7.5H3`,key:`1hm9pq`}],[`path`,{d:`M21 12H3`,key:`2avoz0`}],[`path`,{d:`M21 16.5H3`,key:`n7jzkj`}]]};_n.node;var vn=c(_n),yn={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};yn.node;var bn=c(yn),xn={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};xn.node;var Sn=c(xn),Cn={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Cn.node;var wn=c(Cn),Y=v(h(),1),X=x(),Tn=Y.createContext(void 0),En=e=>{let t=Y.useContext(Tn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Dn=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(Tn.Provider,{value:e,children:t})),On={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kn=new class{#e=On;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function An(e){setTimeout(e,0)}var jn=typeof window>`u`||`Deno`in globalThis;function Mn(){}function Nn(e,t){return typeof e==`function`?e(t):e}function Pn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Fn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function In(e,t){return typeof e==`function`?e(t):e}function Ln(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==zn(o,t.options))return!1}else if(!Vn(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Rn(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Bn(t.options.mutationKey)!==Bn(a))return!1}else if(!Vn(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zn(e,t){return(t?.queryKeyHashFn||Bn)(e)}function Bn(e){return JSON.stringify(e,(e,t)=>Kn(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Vn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Vn(e[r],t[r]))return!1;return!0}return!1}var Hn=Object.prototype.hasOwnProperty;function Un(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Gn(e)&&Gn(t);if(!r&&!(Kn(e)&&Kn(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Hn.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Un(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Wn(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n of Object.keys(e))if(!Hn.call(t,n)||e[n]!==t[n])return!1;return!0}function Gn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kn(e){if(!qn(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!qn(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function qn(e){return Object.prototype.toString.call(e)===`[object Object]`}function Jn(e){return new Promise(t=>{kn.setTimeout(t,e)})}function Yn(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Un(e,t)}function Xn(e){return e}function Zn(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(-n):r}function Qn(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,n):r}var $n=Symbol();function er(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===$n?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function tr(e,t){return typeof e==`function`?e(...t):!!e}var nr=Symbol();function rr(e,t,n,r){let i=!1,a;return Object.defineProperties(e,{[nr]:{value:r},signal:{enumerable:!0,get:()=>(a??=t(),i||(i=!0,a.aborted?n():a.addEventListener(`abort`,n,{once:!0})),a)}}),e}var ir=()=>jn,ar=()=>ir(),or=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sr=new class extends or{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},cr=An;function lr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=cr,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ur=lr(),dr=new class extends or{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function fr(e){return Math.min(1e3*2**e,3e4)}function pr(e){return(e??`online`)!==`online`||dr.isOnline()}var mr=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function hr(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Mn);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new mr(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>sr.isFocused()&&(e.networkMode===`always`||dr.isOnline())&&e.canRun(),p=()=>pr(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(ar()?0:3),a=e.retryDelay??fr,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),Jn(o).then(()=>c()||f()?void 0:g(f)).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var gr=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pn(this.gcTime)&&(this.#e=kn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ar()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(kn.clearTimeout(this.#e),this.#e=void 0)}};function _r(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=t,u=e=>{rr(e,()=>t.signal,()=>n=!0,l[nr])},d=er(t.options,t.fetchOptions),f=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return u(e),e})(),o=await d(a),{maxPages:s}=t.options,c=i?Qn:Zn;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?yr:vr,n={pages:a,pageParams:o};s=await f(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]===void 0?r.initialPageParam:o[0]:vr(r,s);if(c>0&&e==null)break;s=await f(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function vr(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function yr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function br(e,t){return t?vr(e,t)!=null:!1}function xr(e,t){return!t||!e.getPreviousPageParam?!1:yr(e,t)!=null}var Sr=class extends gr{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e){super(),this.#c=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Tr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Tr(this.options);e.data!==void 0&&(this.setState(wr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Yn(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Mn).catch(Mn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>In(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===$n||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data!==void 0&&this.getObserversCount()>0&&this.observers.some(e=>In(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Fn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperties(e,{[nr]:{value:n.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,n.signal)}})},i=()=>{let e=er(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#c=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?_r(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=hr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof mr&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),s=(async()=>{try{let e=await o.promise;if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof mr){if(e.silent){if(this.#a!==o&&this.#o)return this.#o;throw e}if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=s,o.start(),s}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Cr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...wr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ur.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Cr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function wr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Tr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Er=class extends or{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Or(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof In(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Wn(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ar(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||In(this.options.enabled,this.#t)!==In(t.enabled,this.#t)||In(this.options.staleTime,this.#t)!==In(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||In(this.options.enabled,this.#t)!==In(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Wn(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch(t).then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Mn)),t}#h(e){return!ar()&&In(this.options.enabled,this.#t)!==!1&&Pn(e)}#g(){this.#b();let e=In(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Fn(this.#r.dataUpdatedAt,e)+1;this.#u=kn.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return In(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=kn.setInterval(()=>{(this.options.refetchIntervalInBackground||sr.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(kn.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(kn.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Or(e,t),o=i&&Ar(e,n,t,r);(a||o)&&(l={...l,...Cr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Yn(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Yn(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=i?.error===f?i.errorUpdatedAt:Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:jr(e,t),refetch:this.refetch,isEnabled:In(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Wn(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(let t of n??this.#p)if(this.#r[t]!==e[t])return!0;return!1})();ur.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Dr(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||In(t.retryOnMount,e)!==!1)}function Or(e,t){return Dr(e,t)||e.state.data!==void 0&&kr(e,t,t.refetchOnMount)}function kr(e,t,n){if(In(t.enabled,e)!==!1&&In(t.staleTime,e)!==`static`){let r=In(n,e);return r===`always`||r!==!1&&jr(e,t)}return!1}function Ar(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&jr(e,n)}function jr(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(In(t.staleTime,e))}var Mr=class extends Er{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:br(t,n.data),hasPreviousPage:xr(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Nr=class extends gr{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Pr(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=hr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}this.state.isPaused&&r.canStart()&&t();let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ur.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Pr(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Fr=class extends or{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Nr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ir(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ir(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ur.batch(()=>{let e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(e=>{this.notify({type:`removed`,mutation:e})})})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Rn(t,e))}findAll(e={}){return this.getAll().filter(t=>Rn(e,t))}notify(e){ur.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ur.batch(()=>Promise.all(e.map(e=>e.continue().catch(Mn))))}};function Ir(e){return e.options.scope?.id}var Lr=class extends or{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Wn(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Bn(t.mutationKey)!==Bn(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Pr();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ur.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Rr(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var zr=class extends or{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ur.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Wn(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Rr(e,n).forEach(e=>{e.destroy()}),Rr(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Un(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Er(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ur.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Br=class extends or{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??zn(r,t),a=this.get(i);return a||(a=new Sr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ur.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ln(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ln(e,t)):t}notify(e){ur.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ur.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ur.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Br,this.#t=e.mutationCache||new Fr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=sr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=dr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(In(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Nn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ur.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ur.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ur.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ur.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Mn).catch(Mn)}invalidateQueries(e,t={}){return ur.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ur.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n),r=e.state.fetchStatus===`paused`;return(!n.throwOnError||r)&&(t=t.catch(Mn)),r?Promise.resolve():t}));return Promise.all(r).then(Mn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(In(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(In(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mn).catch(Mn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mn).catch(Mn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return dr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Bn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Vn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Bn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Vn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=zn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===$n&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Hr=Y.createContext(!1),Ur=()=>Y.useContext(Hr);Hr.Provider;function Wr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gr=Y.createContext(Wr()),Kr=()=>Y.useContext(Gr),qr=(e,t,n)=>{let r=n?.state.status===`error`&&typeof e.throwOnError==`function`?tr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Jr=e=>{Y.useEffect(()=>{e.clearReset()},[e])},Yr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||tr(n,[e.error,r])),Xr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Zr=(e,t)=>e?.suspense&&t.isPending,Qr=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $r({queries:e,...t},n){let r=En(n),i=Ur(),a=Kr(),o=t.subscribed!==!1,s=Y.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Xr(e);let t=r.getQueryCache().get(e.queryHash);qr(e,a,t)}),Jr(a);let[c]=Y.useState(()=>new zr(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine);Y.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let f=!i&&o;Y.useSyncExternalStore(Y.useCallback(e=>f?c.subscribe(ur.batchCalls(e)):Mn,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult());let p=l.some((e,t)=>Zr(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Zr(n,e)?Qr(n,new Er(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Yr({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function ei(e,t,n){let r=Ur(),i=Kr(),a=En(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Xr(o),qr(o,i,s),Jr(i);let[l]=Y.useState(()=>new t(a,o)),u=l.getOptimisticResult(o);Y.useEffect(()=>{l.setOptions(o)},[o,l]);let d=!r&&c;if(Y.useSyncExternalStore(Y.useCallback(e=>{let t=d?l.subscribe(ur.batchCalls(e)):Mn;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Zr(o,u))throw Qr(o,l,i);if(Yr({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ti(e,t){return ei(e,Er,t)}function ni(e,t){let n=En(t),[r]=Y.useState(()=>new Lr(n,e));Y.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Y.useSyncExternalStore(Y.useCallback(e=>r.subscribe(ur.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Y.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Mn)},[r]);if(i.error&&tr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function ri(e,t){return ei(e,Mr,t)}var ii=[`model`],ai=(e,t)=>e.getAll(t).flatMap(e=>ii.includes(t)?[e]:e.split(`,`)).filter(Boolean);function oi(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=typeof r==`function`?r(ai(n,e)):r;n.delete(e);for(let r of Array.isArray(t)?t:[t])r!=null&&r!==``&&r!==!1&&n.append(e,String(r))}return n.toString()}var si=e=>t=>t.includes(e)?t.filter(t=>t!==e):[...t,e],ci=new Vr({defaultOptions:{queries:{staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!1,retry:(e,t)=>e<1&&(!t?.status||t.status>=500)}}}),li=(e,t)=>p(()=>W(e.toString(),t));function ui(){let e=de(),t=(0,Y.useMemo)(()=>new URLSearchParams(e),[e]);return{params:t,search:e,get:(0,Y.useCallback)((e,n=``)=>t.get(e)??n,[t]),list:(0,Y.useCallback)(e=>ai(t,e),[t]),set:(0,Y.useCallback)((e,t)=>{p(()=>W(oi(pe(),e),t))},[])}}var di=[`agent`,`project`,`person`,`kind`,`model`,`outcome`],fi=[`tokensMin`,`tokensMax`,`durationMin`,`durationMax`],pi=[`row`,`view`];function mi(){let e=ui(),{params:t}=e,n=(0,Y.useMemo)(()=>Ke({range:t.get(`range`)||`30d`,from:t.get(`from`),to:t.get(`to`)}),[t]),r=(0,Y.useMemo)(()=>{let e=new URLSearchParams;e.set(`from`,n.from.toISOString()),e.set(`to`,n.to.toISOString()),e.set(`prevFrom`,n.previous.from.toISOString()),e.set(`prevTo`,n.previous.to.toISOString()),e.set(`tz`,Qe());for(let n of di)for(let r of t.getAll(n).flatMap(e=>ii.includes(n)?[e]:e.split(`,`)))r&&e.append(n,r);for(let n of[...fi,`q`])t.get(n)&&e.set(n,t.get(n));return e.toString()},[t,n]),i=[...di,...fi,`q`].filter(e=>t.get(e));return{...e,period:n,query:r,active:i}}var hi=e=>()=>U.get(e);function gi(e,t,{enabled:n=!0,keep:r=!0}={}){let i=ke(e,t);return ti({queryKey:[i],queryFn:hi(i),enabled:n,placeholderData:r?Xn:void 0})}function _i(e,t,{next:n,enabled:r=!0,key:i}){return ri({queryKey:[ke(e,t(null)),...i||[]],queryFn:({pageParam:n})=>U.get(ke(e,t(n))),initialPageParam:null,getNextPageParam:e=>n(e)??void 0,enabled:r,placeholderData:Xn})}function vi(e,t){let n=En(),r=ke(e,`/views?page=${t}`),i=ti({queryKey:[r],queryFn:hi(r)}),a=()=>n.invalidateQueries({queryKey:[r]}),o=ni({mutationFn:n=>U.post(ke(e,`/views`),{page:t,...n}),onSuccess:a}),s=ni({mutationFn:t=>U.delete(ke(e,`/views/${t}`)),onSuccess:a});return{views:i.data?.views||[],loading:i.isLoading,save:o,remove:s}}var yi=`inline-flex h-9 max-w-full items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium outline-none focus-visible:outline-2 focus-visible:outline-accent`,bi=`border-line bg-surface text-fg hover:bg-surface-2`,xi=`border-accent/50 bg-accent/10 text-fg`,Si=e=>e===``?`~`:e,Ci=e=>e===`~`?``:e;function wi({period:e,onChange:t}){let[n,r]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),[s,c]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{n&&(o(St(e.from)),c(St(new Date(e.to.getTime()-864e5))))},[n,e]);let u=e=>{t(e),r(!1)},d=a&&s&&a<=s;return(0,X.jsxs)(b,{open:n,onOpenChange:r,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,bi),"data-sw-period":!0,children:[(0,X.jsx)(Nt,{size:14,className:`text-muted`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label}),(0,X.jsx)(f,{size:13,className:`text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(N,{className:`w-64 p-1.5`,children:[(0,X.jsx)(`ul`,{role:`listbox`,"aria-label":`Period`,children:ut.map(([t,n])=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":e.range===t,onClick:()=>u({range:t===`30d`?null:t,from:null,to:null}),className:`flex h-9 w-full items-center justify-between rounded-md px-2.5 text-sm text-fg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-period-preset":t,children:[n,e.range===t?(0,X.jsx)(m,{size:16,strokeWidth:3,className:`text-accent`,"aria-hidden":`true`}):null]})},t))}),(0,X.jsxs)(`form`,{className:`mt-1.5 border-t border-line px-1 pt-2.5 pb-1`,onSubmit:e=>{e.preventDefault(),d&&u({range:`custom`,from:a,to:s})},children:[(0,X.jsxs)(`p`,{className:`mb-1.5 flex items-center justify-between text-xs font-medium text-fg`,children:[`Custom range`,e.range===`custom`?(0,X.jsx)(m,{size:16,strokeWidth:3,className:`text-accent`,"aria-hidden":`true`}):null]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[`From`,(0,X.jsx)(P,{type:`date`,value:a,max:s||void 0,onChange:e=>o(e.target.value),className:`mt-0.5`,"data-sw-period-from":!0})]}),(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[`To`,(0,X.jsx)(P,{type:`date`,value:s,min:a||void 0,onChange:e=>c(e.target.value),className:`mt-0.5`,"data-sw-period-to":!0})]})]}),(0,X.jsx)(l,{type:`submit`,size:`sm`,variant:`default`,disabled:!d,className:`mt-2 w-full`,"data-sw-period-apply":!0,children:`Apply`}),(0,X.jsx)(`p`,{className:`mt-1.5 text-caption text-muted`,children:`Days are in your time zone. Up to 400 days.`})]})]})]})}function Ti({id:e,label:n,options:r,values:a,onToggle:o,onChange:s}){let[c,u]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(``),h=new Set(a.map(Ci)),g=r.filter(e=>!d||e.label.toLowerCase().includes(d.toLowerCase())),_=e=>o(Si(e)),v=r.find(e=>h.has(e.key));return(0,X.jsxs)(b,{open:c,onOpenChange:u,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,h.size?xi:bi),"data-sw-filter":e,children:[(0,X.jsxs)(`span`,{className:`truncate`,children:[n,h.size?`: ${v?.label||[...h][0]||`none`}${h.size>1?` +${h.size-1}`:``}`:``]}),(0,X.jsx)(f,{size:13,className:`shrink-0 text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(N,{className:`w-64 p-1.5`,children:[r.length>8?(0,X.jsx)(P,{icon:se,value:d,onChange:e=>p(e.target.value),placeholder:`Find ${n.toLowerCase()}`,"aria-label":`Find ${n.toLowerCase()}`,className:`mb-1`}):null,(0,X.jsxs)(`ul`,{className:`max-h-64 overflow-y-auto`,role:`listbox`,"aria-label":n,"aria-multiselectable":`true`,children:[g.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":h.has(e.key),onClick:()=>_(e.key),className:`flex min-h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-filter-option":Si(e.key),children:[(0,X.jsx)(`span`,{className:i(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border`,h.has(e.key)?`border-accent bg-accent text-accent-fg`:`border-line-strong bg-surface`),"aria-hidden":`true`,children:h.has(e.key)?(0,X.jsx)(m,{size:12,strokeWidth:3}):null}),(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block truncate`,children:e.label}),e.hint?(0,X.jsx)(`span`,{className:`block truncate text-caption text-muted`,children:e.hint}):null]}),e.calls===void 0?null:(0,X.jsx)(`span`,{className:`tabular text-xs text-muted`,children:J(e.calls)})]})},e.key)),g.length?null:(0,X.jsx)(`li`,{className:`px-2 py-3 text-center text-xs text-muted`,children:`Nothing matches.`})]}),h.size?(0,X.jsx)(`div`,{className:`mt-1 border-t border-line pt-1`,children:(0,X.jsxs)(l,{size:`sm`,variant:`ghost`,className:`w-full justify-start`,onClick:()=>s([]),children:[(0,X.jsx)(t,{size:13,"aria-hidden":`true`}),` Clear`]})}):null]})]})}function Ei({get:e,set:t}){let[n,r]=(0,Y.useState)(!1),a=()=>({tokensMin:e(`tokensMin`),tokensMax:e(`tokensMax`),durationMin:e(`durationMin`)?String(Number(e(`durationMin`))/1e3):``,durationMax:e(`durationMax`)?String(Number(e(`durationMax`))/1e3):``}),[o,s]=(0,Y.useState)(a);(0,Y.useEffect)(()=>{n&&s(a())},[n]);let c=fi.filter(t=>e(t)).length,u=(e,t=1)=>e!==``&&Number.isFinite(Number(e))&&Number(e)>=0?String(Math.round(Number(e)*t)):null,d=e=>{e.preventDefault(),t({tokensMin:u(o.tokensMin),tokensMax:u(o.tokensMax),durationMin:u(o.durationMin,1e3),durationMax:u(o.durationMax,1e3)}),r(!1)},f=(e,t)=>(0,X.jsxs)(`label`,{className:`text-caption text-muted`,children:[t,(0,X.jsx)(P,{type:`number`,min:`0`,inputMode:`numeric`,value:o[e],onChange:t=>s({...o,[e]:t.target.value}),className:`mt-0.5`,"data-sw-range":e})]});return(0,X.jsxs)(b,{open:n,onOpenChange:r,history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,c?xi:bi),"data-sw-filter":`ranges`,children:[(0,X.jsx)(bn,{size:14,className:`text-muted`,"aria-hidden":`true`}),`Ranges`,c?`: ${c}`:``]})}),(0,X.jsx)(N,{className:`w-64 p-3`,children:(0,X.jsxs)(`form`,{onSubmit:d,className:`space-y-3`,children:[(0,X.jsxs)(`fieldset`,{children:[(0,X.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-fg`,children:`Tokens (input plus output)`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[f(`tokensMin`,`At least`),f(`tokensMax`,`At most`)]})]}),(0,X.jsxs)(`fieldset`,{children:[(0,X.jsx)(`legend`,{className:`mb-1 text-xs font-medium text-fg`,children:`Duration, in seconds`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[f(`durationMin`,`At least`),f(`durationMax`,`At most`)]})]}),(0,X.jsx)(`p`,{className:`text-caption text-muted`,children:`A range leaves out turns that did not report the number.`}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsx)(l,{type:`submit`,size:`sm`,variant:`default`,className:`flex-1`,"data-sw-range-apply":!0,children:`Apply`}),c?(0,X.jsx)(l,{size:`sm`,variant:`ghost`,onClick:()=>{t(Object.fromEntries(fi.map(e=>[e,null]))),r(!1)},children:`Clear`}):null]})]})})]})}function Di({value:e,onChange:t}){let[n,r]=(0,Y.useState)(e);return(0,Y.useEffect)(()=>r(e),[e]),(0,Y.useEffect)(()=>{if(n.trim()===e)return;let r=window.setTimeout(()=>t(n.trim()),350);return()=>window.clearTimeout(r)},[n,e,t]),(0,X.jsx)(P,{icon:se,value:n,onChange:e=>r(e.target.value),placeholder:`Search ids`,"aria-label":`Search by an id: a turn, an agent, a project, a board or a comment number`,maxLength:80,wrapperClassName:`w-full sm:w-44`,className:`h-9`,"data-sw-usage-search":!0})}function Oi(e){return(0,Y.useMemo)(()=>{let t=t=>e?.[t]||[];return{agent:t(`agent`).map(e=>({key:e.key,label:e.label,hint:e.machine||null,calls:e.calls})),project:t(`project`).map(e=>({key:e.key,label:e.label,calls:e.calls})),person:t(`person`).map(e=>({key:e.key,label:e.label,hint:e.handle?`@${e.handle}`:null,calls:e.calls})),model:t(`model`).map(e=>({key:e.key,label:e.label,calls:e.calls})),kind:Tt.map(e=>({key:e,label:Ze[e],calls:t(`kind`).find(t=>t.key===e)?.calls})),outcome:qe.map(e=>({key:e,label:Je[e],calls:t(`outcome`).find(t=>t.key===e)?.calls}))}},[e])}function ki({filter:e,options:n,children:r}){let{period:i,get:a,list:s,set:c,active:u}=e,d=Oi(n),f=o(`(max-width: 639px)`),p=(e,t)=>d[e].find(e=>e.key===Ci(t))?.label||(t===`~`?`None`:t),m=[];for(let e of di)for(let t of s(e))m.push({id:`${e}:${t}`,text:`${Xe[e]}: ${p(e,t)}`,clear:()=>c({[e]:e=>e.filter(e=>e!==t)},{push:!0})});for(let e of fi)if(a(e)){let t=e.startsWith(`duration`),n=`${t?`Duration`:`Tokens`} ${e.endsWith(`Min`)?`at least`:`at most`} ${t?`${Number(a(e))/1e3} s`:J(Number(a(e)),{exact:!0})}`;m.push({id:e,text:n,clear:()=>c({[e]:null},{push:!0})})}return a(`q`)&&m.push({id:`q`,text:`Id contains "${a(`q`)}"`,clear:()=>c({q:null},{push:!0})}),(0,X.jsxs)(`div`,{className:`mb-4 print:hidden`,"data-sw-usage-filters":!0,children:[(0,X.jsxs)(`div`,{className:`sw-scroll-x -mx-3 flex items-center gap-1.5 overflow-x-auto px-3 pb-1 sm:mx-0 sm:flex-wrap sm:overflow-visible sm:px-0 sm:pb-0 [&>*]:shrink-0`,children:[(0,X.jsx)(wi,{period:i,onChange:e=>c(e,{push:!0})}),di.map(e=>(0,X.jsx)(Ti,{id:e,label:Xe[e],options:d[e],values:s(e),onToggle:t=>c({[e]:si(t)},{push:!0}),onChange:t=>c({[e]:t},{push:!0})},e)),(0,X.jsx)(Ei,{get:a,set:e=>c(e,{push:!0})}),f?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Di,{value:a(`q`),onChange:e=>c({q:e||null})}),(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:r})]})]}),f?(0,X.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,X.jsx)(Di,{value:a(`q`),onChange:e=>c({q:e||null})}),(0,X.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:r})]}):null,m.length?(0,X.jsxs)(`ul`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,"aria-label":`Filters in effect`,"data-sw-usage-chips":!0,children:[m.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:e.clear,className:`inline-flex h-7 max-w-[16rem] items-center gap-1 rounded-full border border-line bg-surface-2 pr-1.5 pl-2.5 text-xs text-fg outline-none hover:border-line-strong focus-visible:outline-2 focus-visible:outline-accent`,"aria-label":`Remove the filter ${e.text}`,"data-sw-chip":e.id,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.text}),(0,X.jsx)(t,{size:12,className:`shrink-0 text-muted`,"aria-hidden":`true`})]})},e.id)),(0,X.jsx)(`li`,{children:(0,X.jsx)(l,{size:`xs`,variant:`ghost`,onClick:()=>c(Object.fromEntries(u.map(e=>[e,null])),{push:!0}),"data-sw-usage-clear":!0,children:`Clear all`})})]}):null]})}function Ai({workspaceId:t,page:o,search:s,onOpen:c,layout:u=null}){let{views:d,save:p,remove:h}=vi(t,o),g=H(),[v,y]=(0,Y.useState)(!1),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(``),[w,T]=(0,Y.useState)(!0),E=(0,Y.useMemo)(()=>new URLSearchParams(s).get(`view`),[s]),O=(0,Y.useMemo)(()=>{let e=new URLSearchParams(s);for(let t of pi)e.delete(t);return e.toString()},[s]),k=d.find(e=>e.query===O&&(!E||e.id===E))||d.find(e=>e.query===O),A=e=>e.hasLayout?`${e.query}${e.query?`&`:``}view=${e.id}`:e.query;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(n,{open:v,onOpenChange:y,children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:i(yi,k?xi:bi),"data-sw-views":!0,children:[(0,X.jsx)(jt,{size:14,className:`text-muted`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`max-w-[9rem] truncate`,children:k?k.name:`Views`}),(0,X.jsx)(f,{size:13,className:`text-muted`,"aria-hidden":`true`})]})}),(0,X.jsxs)(ee,{className:`w-64`,children:[(0,X.jsx)(r,{children:`Your saved views`}),d.length?d.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsxs)(a,{className:`min-w-0 flex-1`,onSelect:()=>c(A(e)),"data-sw-view":e.name,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.name}),e.hasLayout?(0,X.jsx)(ze,{size:13,"aria-label":`Carries a layout`,"data-sw-view-has-layout":!0}):null,k?.id===e.id?(0,X.jsx)(m,{size:14,className:`ml-auto text-accent`,"aria-hidden":`true`}):null]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Delete the view ${e.name}`,onClick:()=>h.mutate(e.id),className:`inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted outline-none hover:bg-surface-2 hover:text-bad focus-visible:outline-2 focus-visible:outline-accent`,"data-sw-view-delete":e.name,children:(0,X.jsx)(Ve,{size:13,"aria-hidden":`true`})})]},e.id)):(0,X.jsx)(`p`,{className:`px-2.5 pb-1.5 text-xs text-muted`,children:`None yet. Set the filters you want, then save them here.`}),(0,X.jsx)(e,{}),(0,X.jsxs)(a,{onSelect:()=>x(!0),"data-sw-view-save":!0,children:[(0,X.jsx)(jt,{size:14,"aria-hidden":`true`}),` Save this view`]}),(0,X.jsxs)(a,{onSelect:async()=>{try{let e=_?`#${fe()}`:``,t=E||(k?.hasLayout?k.id:null),n=[O,t?`view=${t}`:``].filter(Boolean).join(`&`);await navigator.clipboard.writeText(`${window.location.origin}${window.location.pathname}${e}${n?`?${n}`:``}`),g(t?`Link copied. It carries the filters and the layout, not your access.`:`Link copied. It carries the filters, not your access.`)}catch{g(`This browser did not allow copying`,`bad`)}},"data-sw-view-link":!0,children:[(0,X.jsx)(R,{size:14,"aria-hidden":`true`}),` Copy a link to this view`]})]})]}),b?(0,X.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault();try{await p.mutateAsync({name:S,query:O,layout:w&&u?u:null}),g(w&&u?`Saved the view "${S.trim()}" with this layout`:`Saved the view "${S.trim()}"`),x(!1),C(``),T(!0)}catch(e){g(e.message,`bad`)}},className:`flex flex-wrap items-center gap-1.5`,"data-sw-view-form":!0,children:[(0,X.jsx)(P,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),placeholder:`Name this view`,"aria-label":`Name this view`,maxLength:60,className:`h-9`,wrapperClassName:`w-40`,onKeyDown:e=>e.key===`Escape`?x(!1):null}),u?(0,X.jsxs)(`label`,{className:`inline-flex h-9 cursor-pointer items-center gap-1.5 text-xs text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>T(e.target.checked),className:`h-4 w-4 accent-[var(--accent)]`,"data-sw-view-with-layout":!0}),`Include this layout`]}):null,(0,X.jsx)(l,{type:`submit`,size:`md`,variant:`default`,className:`h-9`,disabled:!S.trim()||p.isPending,children:`Save`}),(0,X.jsx)(l,{size:`md`,variant:`ghost`,className:`h-9`,onClick:()=>x(!1),children:`Cancel`})]}):null]})}function ji(e){return Mi(e)||typeof e==`function`||Ni(e)}function Mi(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Ni(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function Pi(e,t){return e==null?null:ji(e)?Y.createElement(e,t):e}function Fi(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?Pi(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:Pi(n.cell,t.getContext())}return`header`in e&&e.header?Pi(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?Pi(e.footer.column.columnDef.footer,e.footer.getContext()):null}function Ii({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Li(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Ri=[],zi=0,{link:Bi,unlink:Vi,propagate:Hi,checkDirty:Ui,shallowPropagate:Wi}=Ii({update(e){return e._update()},notify(e){Ri[Ki++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Xi(e))}}),Gi=0,Ki=0,qi,Ji=0;function Yi(e){try{++Ji,e()}finally{--Ji||Zi()}}function Xi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Vi(n,e)}function Zi(){if(!(Ji>0)){for(;Gi<Ki;){let e=Ri[Gi];Ri[Gi++]=void 0,e.notify()}Gi=0,Ki=0}}function Qi(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return qi!==void 0&&Bi(i,qi,zi),i._snapshot},subscribe(e){let t=Li(e),n={current:!1},r=$i(()=>{i.get(),n.current?(qi=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=qi,o=t?.compare??Object.is;if(n)qi=i,++zi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{qi=a,n&&(i.flags&=-5),Xi(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&Ui(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Wi(e)}}else e&32&&(i.flags=e&-33);return qi!==void 0&&Bi(i,qi,zi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Hi(e),Wi(e),Zi())}},i}function $i(e){let t=()=>{let t=qi;qi=n,++zi,n.depsTail=void 0,n.flags=6;try{return e()}finally{qi=t,n.flags&=-5,Xi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&Ui(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,Xi(this)}};return t(),n}function ea(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=ta(e);if(n.length!==ta(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function ta(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var na=pt();function ra(e,t){return e===t}function ia(e,t=e=>e,n){let r=n?.compare??ra,i=(0,Y.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,Y.useCallback)(()=>e.get(),[e]);return(0,na.useSyncExternalStoreWithSelector)(i,a,a,t,r)}function aa(e){let t=ia(e.source,e.selector,{compare:ea});return typeof e.children==`function`?e.children(t):e.children}function oa(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function sa(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return a&&i(o,t)||(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function ca(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{n&&t(r,e)||i(e)})}}function la(){return sa({createAtom:Qi,batch:Yi})}function ua(e,t){return typeof e==`function`?e(t):e}function da(e){if(Array.isArray(e))return e.map(da);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?fa():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:da(e[i]),writable:!0})}return n}return e}function fa(){return Object.create(null)}function pa(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ma(e,t){return n=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>ua(n,e))}}function ha(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ga(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var _a=3;function va(e,t){return ya(e,t,_a)}function ya(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!ha(e)||!ha(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=ga(e),i=ga(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e<r.length;e++){let i=r[e];if(!Object.prototype.propertyIsEnumerable.call(t,i)||!ya(a[i],o[i],n-1))return!1}return!0}function ba(e,t,n,r=va){let i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,a=e.options[i];a&&a(e=>{let t=ua(n,e);return r(e,t)?e:t})}function xa(e){return e instanceof Function}function Sa(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var Ca=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u&&(o=l,a?.(),s=e(...l??[]),r?.(s)),s}};function wa(e){let t=!1;return()=>{t?e():t=!0}}function Ta({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o={onAfterUpdate:r?()=>{let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))}:void 0};return Ca({...a,...o})}function Ea(e,t=`_`){let[n,r]=e.replace(t,` `).split(` `);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function Da(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=Ea(r);t[n]=a?Ta({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function Oa(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=Ea(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=Ta({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function Z(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function ka(e){return e.row.getValue(e.column.id)}function Aa(e){return e.getValue()??e.table.options.renderFallbackValue}function ja(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var Ma={assignCellPrototype:(e,t)=>{Oa(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>ka(e)},cell_renderValue:{fn:e=>Aa(e)},cell_getContext:{fn:e=>ja(e),memoDeps:e=>[e]}})}};function Na(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function Pa(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0){if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey]}if(!s)throw Error();let l=Na(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function Fa(e){return e.getIsVisible?.()??!0}function Ia(e){return e.getVisibleLeafColumns?.()??e.getAllLeafColumns()}function La(e){return e.getVisibleCells?.()??e.getAllCells()}function Ra(e){return e.getVisibleCellsByColumnId?.()??e.getAllCellsByColumnId()}function za(e,t){let n=e,r=t;return n.getOrderColumnsFn?.()(r)??n._orderGroupedColumns?.(r)??t}function Ba(e,t,n,r){return e._orderByColumnPinning?.(t,n,r)??t}function Va(e,t){return e.getPinnedVisibleLeafColumns?.(t)??(t&&t!==`center`?[]:Ia(e))}function Ha(e,t){return e._expandRows?.(t)??t}function Ua(e){e.autoResetExpanded?.()}function Wa(e){e.autoResetPageIndex?.()}function Ga(e){e.autoResetSorting?.()}function Ka(e){e.autoResetCellSelection?.()}function qa(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function Ja(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return za(e.table,t)}return[e]}function Ya(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Xa(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=Pa(e,o,r,n),c=o;s.columns=c.columns?Xa(e,c.columns,s,r+1):[],i[a]=s}return i}function Za(e){return Xa(e,e.options.columns)}function Qa(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function $a(e){let t=fa(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function eo(e){return za(e,e.getAllColumns().flatMap(e=>e.getLeafColumns()))}function to(e){let t=fa(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function no(e,t){return e.getAllFlatColumnsById()[t]}var ro={assignColumnPrototype:(e,t)=>{Oa(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>qa(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>Ja(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{Da(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>Ya(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>Za(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>Qa(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>$a(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>eo(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>to(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>no(e,t)}})}};function io(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function ao(e,t,n){let r=io(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function oo(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];Fa(i)&&i.columns.length&&(n=Math.max(n,oo(i.columns,t+1)))}return n}function so(e,t){return e?`${e}_${t}`:String(t)}function co(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function lo(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function uo(e,t,n,r,i,a){let o={depth:t,id:so(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=ao(n,u,{id:co(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(lo(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&uo(s,t-1,n,r,i,a)}function fo(e){for(let t=0;t<e.length;t++){let n=e[t];if(!Fa(n.column))continue;let r=0;if(n.subHeaders.length){fo(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];Fa(t.column)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function po(e,t,n,r){let i=oo(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=ao(n,t[e],{depth:i,index:e}));return uo(s,i-1,n,r,a,o),a.reverse(),fo(a[0]?.headers??[]),a}function mo(e,t){for(let n=0;n<e.subHeaders.length;n++)mo(e.subHeaders[n],t);t.push(e)}function ho(e){let t=[];return mo(e,t),t}function go(e){return{column:e.column,header:e,table:e.column.table}}function _o(e){return po(e.getAllColumns(),Ba(e,Ia(e),e=>e.id),e)}function vo(e){return[...e.getHeaderGroups()].reverse()}function yo(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function bo(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}var xo={assignHeaderPrototype:(e,t)=>{Oa(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>ho(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>go(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{Da(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>_o(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>vo(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>yo(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>bo(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function So(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}var Co=(e,t,n,r,i,a,o)=>{let s=So(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=fa(),c._valuesCache=fa(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c};function wo(){return e=>Ta({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>Eo(e,e.options.data),onAfterUpdate:wa(()=>{Ua(e),Wa(e),Ga(e),Ka(e)})})}function To(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=Co(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=To(e,t,c.originalSubRows,r+1,c)))}return a}function Eo(e,t){let n={rows:[],flatRows:[],rowsById:fa()};return n.rows=To(e,n,t),n}function Do(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??wo()(e)),e._rowModels.coreRowModel()}function Oo(e){return e.getCoreRowModel()}function ko(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function Ao(e){return e.getFilteredRowModel()}function jo(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function Mo(e){return e.getGroupedRowModel()}function No(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Po(e){return e.getSortedRowModel()}function Fo(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function Io(e){return e.getExpandedRowModel()}function Lo(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function Ro(e){return e.getPaginatedRowModel()}var zo={constructTableAPIs:e=>{Da(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>Do(e)},table_getPreFilteredRowModel:{fn:()=>Oo(e)},table_getFilteredRowModel:{fn:()=>ko(e)},table_getPreGroupedRowModel:{fn:()=>Ao(e)},table_getGroupedRowModel:{fn:()=>jo(e)},table_getPreSortedRowModel:{fn:()=>Mo(e)},table_getSortedRowModel:{fn:()=>No(e)},table_getPreExpandedRowModel:{fn:()=>Po(e)},table_getExpandedRowModel:{fn:()=>Fo(e)},table_getPrePaginatedRowModel:{fn:()=>Io(e)},table_getPaginatedRowModel:{fn:()=>Lo(e)},table_getRowModel:{fn:()=>Ro(e)}})}};function Bo(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function Vo(e,t,n){let r=Bo(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function Ho(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function Uo(e){let t=e.getPrePaginatedRowModel(),n=e.options.paginateExpandedRows===!1?Ha(e,t).rows:t.rows;for(let e=0;e<n.length;e++)n[e]._displayIndexCache=e;return n}function Wo(e,t){if(pa(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function Go(e,t){if(pa(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Ko(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function qo(e){return Sa(e.subRows,e=>e.subRows)}function Jo(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function Yo(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function Xo(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function Zo(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=Vo(a,e,e.table),n.set(a,o)),r[i]=o}return r}function Qo(e){let t=fa(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function $o(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function es(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}var ts={assignRowPrototype:(e,t)=>{Oa(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>Ho(e)},row_getAllCellsByColumnId:{fn:e=>Qo(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>Zo(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>qo(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>Yo(e)},row_getParentRows:{fn:e=>Xo(e)},row_getUniqueValues:{fn:(e,t)=>Go(e,t)},row_getValue:{fn:(e,t)=>Wo(e,t)},row_renderValue:{fn:(e,t)=>Ko(e,t)}})},constructTableAPIs:e=>{Da(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>Uo(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>$o(t,e,n,r)},table_getRow:{fn:(t,n)=>es(e,t,n)},table_getMaxSubRowDepth:{fn:()=>Jo(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function ns(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function rs(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{ns(e,t,n),e._reactivity.commit?.()})}function is(e){let t=da(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function as(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function os(e,t,n){let r=as(e,ua(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&rs(e,r.state??null)}var ss={coreCellsFeature:Ma,coreColumnsFeature:ro,coreHeadersFeature:xo,coreRowModelsFeature:zo,coreRowsFeature:ts,coreTablesFeature:{constructTableAPIs:e=>{Da(`coreTablesFeature`,e,{table_reset:{fn:()=>is(e)},table_setOptions:{fn:t=>os(e,t)}})}}};function cs(e){return e}function ls(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),da(t)}function us(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...ss,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=ls(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&pa(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}ns(v),v.store=oa(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:ea,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}function ds(){return[]}function fs(e){let t=e=>{let t=fa();for(let n=0;n<e.length;n++)t[e[n].id]=n;return t};return{all:t(Va(e)),center:t(Va(e,`center`)),start:t(Va(e,`start`)),end:t(Va(e,`end`))}}function ps(e,t){return Z(e.table,`getColumnIndexes`,fs)[t===`start`?`start`:t===`end`?`end`:t===`center`?`center`:`all`][e.id]??-1}function ms(e,t){return Va(e.table,t)[0]?.id===e.id}function hs(e,t){let n=Va(e.table,t);return n[n.length-1]?.id===e.id}function gs(e,t){ba(e,`columnOrder`,t)}function _s(e,t){gs(e,t?[]:da(e.initialState.columnOrder??[]))}function vs(e){let t=e.atoms.columnOrder?.get();return n=>{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];e.set(r.id,r)}for(let n=0;n<t.length;n++){let i=t[n],a=e.get(i);a&&(r.push(a),e.delete(i))}for(let t=0;t<n.length;t++){let i=n[t];e.has(i.id)&&r.push(i)}}return ys(e,r)}}function ys(e,t){let n=e.atoms.grouping?.get()??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;let i=t.filter(e=>!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;e<t.length;e++){let n=t[e];a.set(n.id,n)}let o=[];for(let e=0;e<n.length;e++){let t=a.get(n[e]);t&&o.push(t)}return[...o,...i]}var bs={getInitialState:e=>({columnOrder:ds(),...e}),getDefaultTableOptions:e=>({onColumnOrderChange:ma(`columnOrder`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnOrderingFeature`,e,t,{column_getIndex:{fn:(e,t)=>ps(e,t)},column_getIsFirstColumn:{fn:(e,t)=>ms(e,t)},column_getIsLastColumn:{fn:(e,t)=>hs(e,t)}})},constructTableAPIs:e=>{Da(`columnOrderingFeature`,e,{table_getColumnIndexes:{fn:()=>fs(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnOrder:{fn:t=>gs(e,t)},table_resetColumnOrder:{fn:t=>_s(e,t)},table_getOrderColumnsFn:{fn:()=>vs(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]}})}};function xs(){return{start:[],end:[]}}function Ss(e,t){let n=e.getLeafColumns(),r=[];for(let e=0;e<n.length;e++){let t=n[e].id;t&&r.push(t)}ks(e.table,e=>t===`end`?{start:e.start.filter(e=>!r.includes(e)),end:[...e.end.filter(e=>!r.includes(e)),...r]}:t===`start`?{start:[...e.start.filter(e=>!r.includes(e)),...r],end:e.end.filter(e=>!r.includes(e))}:{start:e.start.filter(e=>!r.includes(e)),end:e.end.filter(e=>!r.includes(e))})}function Cs(e){return e.getLeafColumns().some(t=>(t.columnDef.enablePinning??!0)&&(e.table.options.enableColumnPinning??!0))}function ws(e){let t=e.getLeafColumns(),{start:n,end:r}=e.table.atoms.columnPinning?.get()??xs();for(let e=0;e<t.length;e++)if(n.includes(t[e].id))return`start`;for(let e=0;e<t.length;e++)if(r.includes(t[e].id))return`end`;return!1}function Ts(e){let t=ws(e);return t?e.table.atoms.columnPinning?.get()?.[t].indexOf(e.id)??-1:0}function Es(e){let t=La(e),{start:n,end:r}=e.table.atoms.columnPinning?.get()??xs();if(!n.length&&!r.length)return t;let i=[...n,...r];return t.filter(e=>!i.includes(e.column.id))}function Ds(e){let{start:t}=e.table.atoms.columnPinning?.get()??xs();if(!t.length)return[];let n=Ra(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`start`,r.push(i))}return r}function Os(e){let{end:t}=e.table.atoms.columnPinning?.get()??xs();if(!t.length)return[];let n=Ra(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`end`,r.push(i))}return r}function ks(e,t){ba(e,`columnPinning`,t)}function As(e,t){ks(e,t?xs():da(e.initialState.columnPinning??xs()))}function js(e,t){let n=e.atoms.columnPinning?.get();return t?!!n?.[t].length:!!(n?.start.length||n?.end.length)}function Ms(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{start:r}=e.atoms.columnPinning?.get()??xs(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&Fa(t)&&i.push(t)}return po(t,i,e,`start`)}function Ns(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{end:r}=e.atoms.columnPinning?.get()??xs(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&Fa(t)&&i.push(t)}return po(t,i,e,`end`)}function Ps(e){let t=e.getAllColumns(),n=Ia(e),{start:r,end:i}=e.atoms.columnPinning?.get()??xs();if(r.length||i.length){let e=[...r,...i];n=n.filter(t=>!e.includes(t.id))}return po(t,n,e,`center`)}function Fs(e){return[...Z(e,`getStartHeaderGroups`,Ms)].reverse()}function Is(e){return[...Z(e,`getEndHeaderGroups`,Ns)].reverse()}function Ls(e){return[...Z(e,`getCenterHeaderGroups`,Ps)].reverse()}function Rs(e){let t=Z(e,`getStartHeaderGroups`,Ms),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function zs(e){let t=Z(e,`getEndHeaderGroups`,Ns),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Bs(e){let t=Z(e,`getCenterHeaderGroups`,Ps),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Vs(e){return Z(e,`getStartFlatHeaders`,Rs).filter(e=>!e.subHeaders.length)}function Hs(e){return Z(e,`getEndFlatHeaders`,zs).filter(e=>!e.subHeaders.length)}function Us(e){return Z(e,`getCenterFlatHeaders`,Bs).filter(e=>!e.subHeaders.length)}function Ws(e){let{start:t}=e.atoms.columnPinning?.get()??xs(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Gs(e){let{end:t}=e.atoms.columnPinning?.get()??xs(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Ks(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??xs();if(!t.length&&!n.length)return e.getAllLeafColumns();let r=[...t,...n];return e.getAllLeafColumns().filter(e=>!r.includes(e.id))}function qs(e,t){return t?t===`start`?Z(e,`getStartLeafColumns`,Ws):t===`end`?Z(e,`getEndLeafColumns`,Gs):Z(e,`getCenterLeafColumns`,Ks):e.getAllLeafColumns()}function Js(e){return Z(e,`getStartLeafColumns`,Ws).filter(e=>Fa(e))}function Ys(e){return Z(e,`getEndLeafColumns`,Gs).filter(e=>Fa(e))}function Xs(e){return Z(e,`getCenterLeafColumns`,Ks).filter(e=>Fa(e))}function Zs(e,t){return t?t===`start`?Z(e,`getStartVisibleLeafColumns`,Js):t===`end`?Z(e,`getEndVisibleLeafColumns`,Ys):Z(e,`getCenterVisibleLeafColumns`,Xs):Ia(e)}function Qs(e,t,n,r){let i=e.atoms.columnPinning?.get();if(!i||!i.start.length&&!i.end.length)return t;let{start:a,end:o}=i,s=r?.();if(!s){s=fa();for(let e=0;e<t.length;e++)s[n(t[e])]=t[e]}let c=[];for(let e=0;e<a.length;e++){let t=s[a[e]];t&&c.push(t)}for(let e=0;e<t.length;e++){let r=n(t[e]);!a.includes(r)&&!o.includes(r)&&c.push(t[e])}for(let e=0;e<o.length;e++){let t=s[o[e]];t&&c.push(t)}return c}var $s={getInitialState:e=>({columnPinning:{...xs(),...e.columnPinning},...e}),getDefaultTableOptions:e=>({onColumnPinningChange:ma(`columnPinning`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnPinningFeature`,e,t,{column_pin:{fn:(e,t)=>Ss(e,t)},column_getCanPin:{fn:e=>Cs(e)},column_getPinnedIndex:{fn:e=>Ts(e)},column_getIsPinned:{fn:e=>ws(e)}})},assignRowPrototype:(e,t)=>{Oa(`columnPinningFeature`,e,t,{row_getCenterVisibleCells:{fn:e=>Es(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get(),e.table.atoms.columnVisibility?.get()]},row_getStartVisibleCells:{fn:e=>Ds(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.start,e.table.atoms.columnVisibility?.get()]},row_getEndVisibleCells:{fn:e=>Os(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.end,e.table.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{Da(`columnPinningFeature`,e,{table_setColumnPinning:{fn:t=>ks(e,t)},table_resetColumnPinning:{fn:t=>As(e,t)},table_getIsSomeColumnsPinned:{fn:t=>js(e,t)},table__orderByColumnPinning:{fn:(t,n,r)=>Qs(e,t,n,r)},table_getStartHeaderGroups:{fn:()=>Ms(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get()?.start,e.atoms.columnOrder?.get()]},table_getCenterHeaderGroups:{fn:()=>Ps(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get()]},table_getEndHeaderGroups:{fn:()=>Ns(e),memoDeps:()=>[e.getAllColumns(),Ia(e),e.atoms.columnPinning?.get()?.end,e.atoms.columnOrder?.get()]},table_getStartFooterGroups:{fn:()=>Fs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getCenterFooterGroups:{fn:()=>Ls(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getEndFooterGroups:{fn:()=>Is(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getStartFlatHeaders:{fn:()=>Rs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getEndFlatHeaders:{fn:()=>zs(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getCenterFlatHeaders:{fn:()=>Bs(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getStartLeafHeaders:{fn:()=>Vs(e),memoDeps:()=>[Z(e,`getStartHeaderGroups`,Ms)]},table_getEndLeafHeaders:{fn:()=>Hs(e),memoDeps:()=>[Z(e,`getEndHeaderGroups`,Ns)]},table_getCenterLeafHeaders:{fn:()=>Us(e),memoDeps:()=>[Z(e,`getCenterHeaderGroups`,Ps)]},table_getStartLeafColumns:{fn:()=>Ws(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndLeafColumns:{fn:()=>Gs(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterLeafColumns:{fn:()=>Ks(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedLeafColumns:{fn:t=>qs(e,t)},table_getStartVisibleLeafColumns:{fn:()=>Js(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterVisibleLeafColumns:{fn:()=>Xs(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndVisibleLeafColumns:{fn:()=>Ys(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedVisibleLeafColumns:{fn:t=>Zs(e,t)}})}};function ec(){return fa()}function tc(){return{size:150,minSize:20,maxSize:2**53-1}}function nc(e){let t=tc(),n=e.table.atoms.columnSizing?.get(),r=n&&pa(n,e.id)?n[e.id]:void 0;return Math.min(Math.max(e.columnDef.minSize??t.minSize,r??e.columnDef.size??t.size),e.columnDef.maxSize??t.maxSize)}function rc(e){let t=fa(),n=fa(),r=Array(e.length),i=0;for(let n=0;n<e.length;n++){let a=e[n],o=Z(a,`getSize`,nc);r[n]=o,t[a.id]=i,i+=o}let a=0;for(let t=e.length-1;t>=0;t--)n[e[t].id]=a,a+=r[t];return{starts:t,afters:n}}function ic(e){return{all:rc(Va(e)),center:rc(Va(e,`center`)),start:rc(Va(e,`start`)),end:rc(Va(e,`end`))}}function ac(e){return e===`start`?`start`:e===`end`?`end`:e===`center`?`center`:`all`}function oc(e,t){return Z(e.table,`getColumnOffsets`,ic)[ac(t)].starts[e.id]??0}function sc(e,t){return Z(e.table,`getColumnOffsets`,ic)[ac(t)].afters[e.id]??0}function cc(e){fc(e.table,t=>{let n=fa(),r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];a!==e.id&&(n[a]=t[a])}return n})}function lc(e){if(!e.subHeaders.length)return nc(e.column);let t=0;for(let n=0;n<e.subHeaders.length;n++)t+=lc(e.subHeaders[n]);return t}function uc(e){return lc(e)}function dc(e){if(e.index>0){let t=e.headerGroup?.headers[e.index-1];if(t)return Z(t,`getStart`,dc)+Z(t,`getSize`,uc)}return 0}function fc(e,t){e.options.onColumnSizingChange?.(t)}function pc(e,t){fc(e,t?fa():Object.assign(fa(),da(e.initialState.columnSizing??{})))}function mc(e){let t=0;for(let n=0;n<e.length;n++)t+=Z(e[n],`getSize`,nc);return t}function hc(e){return e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+uc(t),0)??0}function gc(e){return mc(Va(e,`start`))}function _c(e){return mc(Va(e,`center`))}function vc(e){return mc(Va(e,`end`))}var yc={getInitialState:e=>({columnSizing:ec(),...e}),getDefaultColumnDef:()=>tc(),getDefaultTableOptions:e=>({onColumnSizingChange:ma(`columnSizing`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnSizingFeature`,e,t,{column_getSize:{fn:e=>nc(e),memoDeps:e=>[t.options.columns,t.atoms.columnSizing?.get()?.[e.id]]},column_getStart:{fn:(e,t)=>oc(e,t)},column_getAfter:{fn:(e,t)=>sc(e,t)},column_resetSize:{fn:e=>cc(e)}})},assignHeaderPrototype:(e,t)=>{Oa(`columnSizingFeature`,e,t,{header_getSize:{fn:e=>uc(e),memoDeps:e=>[t.options.columns,e.column.columns.length>0?t.atoms.columnSizing?.get():t.atoms.columnSizing?.get()?.[e.column.id]]},header_getStart:{fn:e=>dc(e),memoDeps:()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode]}})},constructTableAPIs:e=>{Da(`columnSizingFeature`,e,{table_getColumnOffsets:{fn:()=>ic(e),memoDeps:()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnSizing:{fn:t=>fc(e,t)},table_resetColumnSizing:{fn:t=>pc(e,t)},table_getTotalSize:{fn:()=>hc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getStartTotalSize:{fn:()=>gc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getCenterTotalSize:{fn:()=>_c(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getEndTotalSize:{fn:()=>vc(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]}})}};function bc(){return fa()}function xc(e,t){Cc(e)&&kc(e.table,n=>{let r=Object.assign(fa(),n),i=t??!Z(e,`getIsVisible`,Sc),a=e.getLeafColumns();for(let e=0;e<a.length;e++){let t=a[e];Cc(t)&&(r[t.id]=i)}return r})}function Sc(e){let t=e.table.atoms.columnVisibility?.get();if(!t)return!0;let n=e.columns;return n.length?n.some(e=>Z(e,`getIsVisible`,Sc)):(pa(t,e.id)?t[e.id]:void 0)??!0}function Cc(e){return(e.columnDef.enableHiding??!0)&&(e.table.options.enableHiding??!0)}function wc(e){return t=>{xc(e,t.target.checked)}}function Tc(e){let t=e.getAllCells(),n=[];for(let e=0;e<t.length;e++){let r=t[e];Z(r.column,`getIsVisible`,Sc)&&n.push(r)}return Ba(e.table,n,e=>e.column.id,()=>Z(e,`getVisibleCellsByColumnId`,Ec))}function Ec(e){let t=fa(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];Z(r.column,`getIsVisible`,Sc)&&(t[r.column.id]=r)}return t}function Dc(e){return e.getAllFlatColumns().filter(e=>Z(e,`getIsVisible`,Sc))}function Oc(e){return e.getAllLeafColumns().filter(e=>Z(e,`getIsVisible`,Sc))}function kc(e,t){ba(e,`columnVisibility`,t)}function Ac(e,t){kc(e,t?fa():Object.assign(fa(),da(e.initialState.columnVisibility??{})))}function jc(e,t){t??=!Mc(e);let n=fa(),r=e.getAllLeafColumns();for(let e=0;e<r.length;e++){let i=r[e];n[i.id]=t||!Cc(i)}kc(e,n)}function Mc(e){return!e.getAllLeafColumns().some(e=>!Z(e,`getIsVisible`,Sc))}function Nc(e){return e.getAllLeafColumns().some(e=>Z(e,`getIsVisible`,Sc))}function Pc(e){return t=>{jc(e,t.target.checked)}}var Fc={getInitialState:e=>({columnVisibility:bc(),...e}),getDefaultTableOptions:e=>({onColumnVisibilityChange:ma(`columnVisibility`,e)}),assignColumnPrototype:(e,t)=>{Oa(`columnVisibilityFeature`,e,t,{column_getIsVisible:{fn:e=>Sc(e),memoDeps:e=>[t.options.columns,t.atoms.columnVisibility?.get(),e.columns]},column_getCanHide:{fn:e=>Cc(e)},column_getToggleVisibilityHandler:{fn:e=>wc(e)},column_toggleVisibility:{fn:(e,t)=>xc(e,t)}})},assignRowPrototype:(e,t)=>{Oa(`columnVisibilityFeature`,e,t,{row_getVisibleCells:{fn:e=>Tc(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get()]},row_getVisibleCellsByColumnId:{fn:e=>Ec(e),memoDeps:e=>[e.getAllCells(),t.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{Da(`columnVisibilityFeature`,e,{table_getVisibleFlatColumns:{fn:()=>Dc(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getVisibleLeafColumns:{fn:()=>Oc(e),memoDeps:()=>[e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_setColumnVisibility:{fn:t=>kc(e,t)},table_resetColumnVisibility:{fn:t=>Ac(e,t)},table_toggleAllColumnsVisible:{fn:t=>jc(e,t)},table_getIsAllColumnsVisible:{fn:()=>Mc(e)},table_getIsSomeColumnsVisible:{fn:()=>Nc(e)},table_getToggleAllColumnsVisibilityHandler:{fn:()=>Pc(e)}})}},Ic=/([0-9]+)/gm;function Lc(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var Rc=Lc({sort:(e,t)=>zc(e,t)});function zc(e,t){return e===t?0:e>t?1:-1}function Bc(){return[]}function Vc(e,t){ba(e,`sorting`,t)}function Hc(e,t){Vc(e,t?[]:da(e.initialState.sorting??[]))}function Uc(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Hc(e)}function Wc(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t<n.length;t++){let a=n[t].getValue(e.id);if(Object.prototype.toString.call(a)===`[object Date]`){r=`datetime`;break}if(typeof a==`string`&&(i=!0,a.split(Ic).length>1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return Rc}function Gc(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){let r=t[n].getValue(e.id);if(r!=null)return typeof r==`string`?`asc`:`desc`}return`desc`}function Kc(e){let t=e.table._rowModelFns.sortFns;return xa(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn===`auto`?Wc(e):t?.[e.columnDef.sortFn]??Rc}function qc(e,t,n){let r=Yc(e,n&&Zc(e)),i=t!==void 0;Vc(e.table,a=>{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&Zc(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function Jc(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Gc(e)===`desc`?`desc`:`asc`}function Yc(e,t){let n=Jc(e),r=Qc(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function Xc(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function Zc(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Qc(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function $c(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function el(e){Vc(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function tl(e){let t=Xc(e);return n=>{t&&qc(e,void 0,Zc(e)?e.table.options.isMultiSortEvent?.(n):!1)}}var nl={getInitialState(e){return{sorting:Bc(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:ma(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){Oa(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>Wc(e)},column_getAutoSortDir:{fn:e=>Gc(e)},column_getSortFn:{fn:e=>Kc(e)},column_toggleSorting:{fn:(e,t,n)=>qc(e,t,n)},column_getFirstSortDir:{fn:e=>Jc(e)},column_getNextSortingOrder:{fn:(e,t)=>Yc(e,t)},column_getCanSort:{fn:e=>Xc(e)},column_getCanMultiSort:{fn:e=>Zc(e)},column_getIsSorted:{fn:e=>Qc(e)},column_getSortIndex:{fn:e=>$c(e)},column_clearSorting:{fn:e=>el(e)},column_getToggleSortingHandler:{fn:e=>tl(e)}})},constructTableAPIs(e){Da(`rowSortingFeature`,e,{table_autoResetSorting:{fn:()=>Uc(e)},table_setSorting:{fn:t=>Vc(e,t)},table_resetSorting:{fn:t=>Hc(e,t)}})}},rl=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function il(e,t){let[{table:n,rootSource:r}]=(0,Y.useState)(()=>{let t=us({...e,features:{coreReactivityFeature:la(),...e.features}});return t.Subscribe=(e=>aa({...e,source:e.source??t.store})),t.FlexRender=Fi,{table:t,rootSource:ca(t.store,ea)}}),i=n;os(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=ia(r,t,{compare:ea});return rl(()=>{r.markCommitted(o),rs(i,a??null,ea)}),(0,Y.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}var al=v(u(),1);function ol(e){return typeof e==`object`?e.key:e}function sl(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function cl(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function ll(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var ul=(e,t)=>Math.abs(e-t)<1.01,dl=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function fl({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var pl=e=>e===`smooth`||e===`smoothFinishing`;function ml({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!pl(n.phase)&&!ul(t,n.lastTargetOffset)&&!ul(t,r())&&e!==`clampedEcho`}var hl=40;function gl(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<hl;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<hl;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function _l(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<hl;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var vl,yl=()=>{if(vl!==void 0)return vl;if(typeof navigator>`u`)return vl=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return vl=!0;let e=navigator.maxTouchPoints;return vl=navigator.platform===`MacIntel`&&e!==void 0&&e>0},bl,xl=()=>bl===void 0?bl=yl()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):bl,Sl=()=>!yl()||xl(),Cl={capture:!0,passive:!0},wl=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Cl),e.addEventListener(`touchend`,n,Cl),e.addEventListener(`touchcancel`,n,Cl),()=>{e.removeEventListener(`touchstart`,t,Cl),e.removeEventListener(`touchend`,n,Cl),e.removeEventListener(`touchcancel`,n,Cl),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Tl=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},El=e=>{let t=new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Dl=e=>e,Ol=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},kl=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Tl(n)),!r.ResizeObserver)return()=>{};let a=El(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Tl(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Al={passive:!0},jl=typeof window>`u`||`onscrollend`in window,Ml=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&jl,o=0,s=a?null:dl(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Al),a&&r.addEventListener(`scrollend`,u,Al),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Nl=(e,t)=>Ml(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Pl=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Fl=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},Il=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,Ll=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function Rl(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var zl=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new wl({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&_l(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=null,n=!1,r=!1,i=new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=El(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Dl,rangeExtractor:Ol,onChange:()=>{},measureElement:Pl,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>ol(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Rl(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=cl(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:ml({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||gl(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?Ll(this.scrollState)&&!ul(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>fl({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=Il(t,e.index!=null&&ul(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(yl()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=cl(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=cl(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=sl(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=cl(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=Hl(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=cl(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!Ll(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!Ll(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!Ll(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=cl(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return ll(t[Bl(0,t.length-1,r?e=>n[e*2]:e=>ll(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(yl()&&this._iosGesture.dragging())&&e!==null&&!ul(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&ul(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=Ll(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Sl()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:Il(n,e.index!=null&&ul(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},Bl=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function Vl(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function Hl(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=Vl(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=Bl(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Ul=typeof document<`u`?Y.useLayoutEffect:Y.useEffect;function Wl({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=Y.useReducer(e=>e+1,0)[1],a=Y.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=Y.useRef(!1),s=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}},c=(e,t,n)=>{let r=a.current,i=!!e.options.horizontal,o=t.start-e.options.scrollMargin;r.lastPositions.get(n)!==o&&(r.lastPositions.set(n,o),r.mode===`transform`?n.style.transform=i?`translate3d(${o}px, 0, 0)`:`translate3d(0, ${o}px, 0)`:n.style[i?`left`:`top`]=`${o}px`)},l=e=>{let t=a.current;if(t.enabled&&t.container){s(e);for(let t of e.getVirtualItems()){let n=e.elementsCache.get(t.key);n&&c(e,t,n)}}},u={...r,onChange:(t,n)=>{var s;let c=a.current,u=!0;if(c.enabled){l(t);let e=t.range,n=c.prevRange;u=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,u&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}u&&(e&&n&&!o.current?(0,al.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[d]=Y.useState(()=>{let e=new zl(u),t=e.measureElement;return e.measureElement=n=>{o.current=!0;try{t(n)}finally{o.current=!1}let r=a.current;if(n!==null&&r.enabled&&r.container){let t=e.measurementsCache[e.indexFromElement(n)];t&&c(e,t,n)}},Object.assign(e,{containerRef:t=>{let n=a.current;n.container=t,n.lastSize=null,t!==null&&l(e)}})});return d.setOptions(u),Ul(()=>d._didMount(),[]),Ul(()=>(s(d),d._willUpdate())),Ul(()=>{l(d)}),d}function Gl(e){return Wl({observeElementRect:kl,observeElementOffset:Nl,scrollToFn:Fl,...e})}var Kl=cs({columnVisibilityFeature:Fc,columnOrderingFeature:bs,columnPinningFeature:$s,columnSizingFeature:yc,rowSortingFeature:nl}),ql=[],Jl=e=>Math.min(640,Math.max(64,Math.round(e)));function Yl(e,{cols:t,pin:n,widths:r=null,defaults:i}){let a=new Set(e.map(e=>e.id)),o=(t?t.split(`,`):i.shown).filter(e=>a.has(e));for(let t of e)t.always&&!o.includes(t.id)&&o.unshift(t.id);let s=e.map(e=>e.id).filter(e=>!o.includes(e));return{order:[...o,...s],hidden:s,pinned:(n==null?i.pinned:n.split(`,`)).filter(e=>o.includes(e)),sizes:Object.fromEntries(String(r||``).split(`,`).map(e=>e.split(`:`)).filter(([e,t])=>a.has(e)&&Number.isFinite(Number(t))&&Number(t)>0).map(([e,t])=>[e,Jl(Number(t))]))}}var Xl=(e,t)=>{let n=e.order.filter(t=>!e.hidden.includes(t)),r=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);return{cols:r(n,t.shown)?null:n.join(`,`),pin:r(e.pinned,t.pinned)?null:e.pinned.join(`,`)||`none`,w:Object.entries(e.sizes||{}).map(([e,t])=>`${e}:${t}`).join(`,`)||null}};function Zl({label:e,columns:t,items:n,rowKey:r,layout:a,onLayout:s,sort:c=null,onSort:u=null,dense:p=!1,onOpen:m,openId:h=null,onToggleGroup:g=null,onMore:_=null,hasMore:v=!1,loadingMore:y=!1,card:b,footer:x=null,busy:C=!1}){let w=o(`(max-width: 639px)`),T=(0,Y.useRef)(null),[E,D]=(0,Y.useState)(0),[O,k]=(0,Y.useState)(null),[A,j]=(0,Y.useState)(null),[M,N]=(0,Y.useState)(null),ee=O?{...a.sizes,[O.id]:O.width}:a.sizes||{},P=w?84:p?34:44,F=il({features:Kl,columns:(0,Y.useMemo)(()=>t.map(e=>({id:e.id,accessorFn:e=>e,header:e.header,size:e.width,enableSorting:!!e.sort,enableHiding:!e.always,meta:e})),[t]),data:ql,manualSorting:!0,enableSortingRemoval:!1,state:{columnOrder:a.order,columnVisibility:Object.fromEntries(a.hidden.map(e=>[e,!1])),columnPinning:{start:a.pinned,end:[]},columnSizing:ee,sorting:c?[{id:t.find(e=>e.sort===c.id)?.id||``,desc:c.dir===`desc`}]:[]},onColumnOrderChange:e=>s({...a,order:typeof e==`function`?e(a.order):e}),onColumnVisibilityChange:e=>{let t=Object.fromEntries(a.hidden.map(e=>[e,!1])),n=typeof e==`function`?e(t):e,r=Object.keys(n).filter(e=>n[e]===!1);s({...a,hidden:r,pinned:a.pinned.filter(e=>!r.includes(e))})},onColumnSizingChange:e=>s({...a,sizes:typeof e==`function`?e(a.sizes||{}):e}),onColumnPinningChange:e=>{let t=typeof e==`function`?e({start:a.pinned,end:[]}):e;s({...a,pinned:t.start||t.left||[]})},onSortingChange:e=>{let n=c?[{id:t.find(e=>e.sort===c.id)?.id||``,desc:c.dir===`desc`}]:[],r=(typeof e==`function`?e(n):e)[0],i=t.find(e=>e.id===r?.id);i?.sort&&u?.({id:i.sort,dir:r.desc?`desc`:`asc`})}}),I=F.getVisibleLeafColumns(),L=[...I.filter(e=>e.getIsPinned()),...I.filter(e=>!e.getIsPinned())],te=[],ne=0;for(let e of L)te.push(ne),ne+=e.getSize();let re=ne,ie=L.filter(e=>e.getIsPinned()).length-1,ae=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.clientX,r=t.getSize(),i=r,o=e=>{i=Jl(r+e.clientX-n),k({id:t.id,width:i})},s=()=>{window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),k(null),i!==r&&F.setColumnSizing({...a.sizes||{},[t.id]:i})};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s),k({id:t.id,width:i})},R=e=>{let t=A;if(j(null),N(null),!t||t===e)return;let n=a.order.filter(e=>e!==t),r=n.indexOf(e),i=a.order.indexOf(t)<a.order.indexOf(e);n.splice(i?r+1:r,0,t),F.setColumnOrder(n)},oe=Gl({count:n.length,getScrollElement:()=>T.current,estimateSize:()=>P,overscan:12});(0,Y.useEffect)(()=>{oe.measure()},[P]);let se=oe.getVirtualItems(),ce=se.at(-1)?.index??0;(0,Y.useEffect)(()=>{v&&!y&&n.length&&ce>=n.length-15&&_?.()},[v,y,n.length,ce,_]),(0,Y.useEffect)(()=>{E>n.length-1&&D(Math.max(0,n.length-1))},[n.length,E]);let le=(0,Y.useCallback)(e=>{e&&(e.type===`row`?m?.(e.row):e.type===`group`?g?.(e.group.key):e.type===`more`&&e.load?.())},[m,g]),z=e=>{let t=Math.min(Math.max(e,0),n.length-1);D(t),oe.scrollToIndex(t,{align:`auto`})},ue=e=>{if(e.target!==e.currentTarget&&e.target.closest(`button, a, input, [role="menuitem"]`))return;let t=n[E],r={ArrowDown:()=>z(E+1),ArrowUp:()=>z(E-1),Home:()=>z(0),End:()=>z(n.length-1),PageDown:()=>z(E+10),PageUp:()=>z(E-10),Enter:()=>le(t)," ":()=>le(t),ArrowRight:()=>t?.type===`group`&&!t.open?g?.(t.group.key):null,ArrowLeft:()=>t?.type===`group`&&t.open?g?.(t.group.key):null};r[e.key]&&(e.preventDefault(),r[e.key]())},B=e=>`sw-grid-row-${e}`,V=(e,t)=>e.type===`row`?r(e.row):`${e.type}:${e.group?.key??t}`;if(w)return(0,X.jsxs)(`div`,{className:i(`transition-opacity`,C&&`opacity-60`),"data-sw-grid":`cards`,children:[(0,X.jsx)(`ul`,{"aria-label":e,className:`divide-y divide-line`,children:n.map((e,t)=>(0,X.jsx)(`li`,{children:e.type===`row`?(0,X.jsx)(`button`,{type:`button`,onClick:()=>m?.(e.row),className:`block w-full px-4 py-3 text-left outline-none active:bg-surface-2 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-row":r(e.row),children:b(e.row)}):e.type===`group`?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>g?.(e.group.key),"aria-expanded":e.open,className:`flex min-h-11 w-full items-center gap-2 bg-surface-2 px-4 py-2 text-left text-sm font-medium text-fg outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-group":e.group.key,children:[e.open?(0,X.jsx)(f,{size:15,"aria-hidden":`true`}):(0,X.jsx)(d,{size:15,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.group.label}),(0,X.jsx)(`span`,{className:`tabular text-xs font-normal text-muted`,children:e.summary})]}):(0,X.jsx)(`div`,{className:`px-4 py-2`,children:(0,X.jsxs)(l,{size:`touch`,variant:`secondary`,className:`w-full`,onClick:e.load,disabled:e.busy,children:[e.busy?(0,X.jsx)(S,{}):null,` Show more`]})})},V(e,t)))}),v?(0,X.jsx)(`div`,{className:`border-t border-line p-3`,children:(0,X.jsxs)(l,{size:`touch`,variant:`secondary`,className:`w-full`,onClick:_,disabled:y,"data-sw-grid-more":!0,children:[y?(0,X.jsx)(S,{}):null,` Show more`]})}):null,x]});let de=F.getHeaderGroups()[0]?.headers||[],fe=new Map(de.map(e=>[e.column.id,e]));return(0,X.jsxs)(`div`,{className:i(`transition-opacity`,C&&`opacity-60`),"data-sw-grid":`table`,children:[(0,X.jsx)(`div`,{ref:T,role:`grid`,"aria-label":e,"aria-rowcount":n.length+1,"aria-colcount":L.length,"aria-activedescendant":n.length?B(E):void 0,tabIndex:0,onKeyDown:ue,className:`group/grid relative max-h-[min(72vh,720px)] min-h-[220px] overflow-auto outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent`,"data-sw-grid-scroll":!0,children:(0,X.jsxs)(`div`,{style:{width:re,minWidth:`100%`},children:[(0,X.jsx)(`div`,{role:`row`,"aria-rowindex":1,className:`sticky top-0 z-20 flex border-b border-line bg-surface-2`,children:L.map((e,t)=>{let n=e.columnDef.meta,r=e.getIsSorted(),o=!!e.getIsPinned();return(0,X.jsxs)(`div`,{role:`columnheader`,"aria-colindex":t+1,"aria-sort":r?r===`desc`?`descending`:`ascending`:e.getCanSort()?`none`:void 0,style:{width:e.getSize(),flex:t===L.length-1?`1 0 auto`:`0 0 auto`,...o?{left:te[t]}:{}},className:i(`group/header relative flex h-9 items-center gap-0.5 bg-surface-2 pr-1 pl-3 text-xs font-medium text-muted`,o&&`sticky z-10`,o&&t===ie&&`border-r border-line`,n.align===`right`&&`justify-end`,A===e.id&&`opacity-50`,M===e.id&&A!==e.id&&`bg-accent/15 shadow-[inset_2px_0_0_var(--accent)]`),draggable:!O,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,e.id),j(e.id)},onDragOver:t=>{A&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,M!==e.id&&N(e.id))},onDrop:t=>{t.preventDefault(),R(e.id)},onDragEnd:()=>{j(null),N(null)},"data-sw-grid-header":e.id,children:[e.getCanSort()?(0,X.jsxs)(`button`,{type:`button`,onClick:()=>e.toggleSorting(!r||r!==`desc`),className:i(`inline-flex min-w-0 items-center gap-1 rounded px-1 py-1 outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent`,r&&`text-fg`),title:`Sort by ${n.title||n.header}`,"data-sw-grid-sort":e.id,children:[(0,X.jsx)(`span`,{className:`truncate`,children:n.header}),r===`desc`?(0,X.jsx)(Dt,{size:12,"aria-hidden":`true`}):r===`asc`?(0,X.jsx)(kt,{size:12,"aria-hidden":`true`}):null]}):(0,X.jsx)(`span`,{className:`truncate px-1`,children:n.header}),(0,X.jsx)(Ql,{column:e,meta:n,index:a.order.indexOf(e.id),layout:a,onLayout:s,canHide:fe.get(e.id)?.column.getCanHide()!==!1,onWidth:t=>F.setColumnSizing({...a.sizes||{},[e.id]:Jl(t)}),onResetWidth:()=>F.setColumnSizing(Object.fromEntries(Object.entries(a.sizes||{}).filter(([t])=>t!==e.id)))}),(0,X.jsx)(`span`,{"aria-hidden":`true`,onPointerDown:t=>ae(t,e),onDoubleClick:()=>F.setColumnSizing(Object.fromEntries(Object.entries(a.sizes||{}).filter(([t])=>t!==e.id))),draggable:!1,className:i(`absolute inset-y-0 -right-1 z-10 w-2 cursor-col-resize touch-none select-none after:absolute after:inset-y-1.5 after:left-1/2 after:w-px after:bg-line-strong after:opacity-0 group-hover/header:after:opacity-100`,O?.id===e.id&&`after:w-0.5 after:bg-accent after:opacity-100`),"data-sw-grid-resize":e.id})]},e.id)})}),(0,X.jsx)(`div`,{style:{height:oe.getTotalSize(),position:`relative`},children:se.map(e=>{let t=n[e.index];if(!t)return null;let a=e.index===E,o={position:`absolute`,top:0,left:0,width:`100%`,height:e.size,transform:`translateY(${e.start}px)`};if(t.type===`more`)return(0,X.jsx)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,style:o,className:`flex items-center border-b border-line/60 pl-10`,children:(0,X.jsxs)(l,{size:`xs`,variant:`ghost`,onClick:t.load,disabled:t.busy,tabIndex:-1,"data-sw-grid-group-more":t.group?.key,children:[t.busy?(0,X.jsx)(S,{}):null,` Show more of `,t.group?.label]})},V(t,e.index));if(t.type===`group`){let n=L.findIndex((e,t)=>t>0&&e.columnDef.meta.subtotal),r=n<0?L.length:n,s=L.slice(0,r).reduce((e,t)=>e+t.getSize(),0);return(0,X.jsxs)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,"aria-expanded":t.open,"aria-selected":a,style:o,onClick:()=>{D(e.index),g?.(t.group.key)},className:i(`flex cursor-pointer items-center border-b border-line bg-surface-2/70 text-xs font-medium text-fg hover:bg-surface-2`,a&&`group-focus-visible/grid:outline-2 group-focus-visible/grid:-outline-offset-2 group-focus-visible/grid:outline-accent`),"data-sw-grid-group":t.group.key,children:[(0,X.jsxs)(`div`,{role:`gridcell`,style:{width:s,flex:`0 0 auto`},className:`sticky left-0 z-10 flex items-center gap-1.5 pl-3`,children:[t.open?(0,X.jsx)(f,{size:14,"aria-hidden":`true`}):(0,X.jsx)(d,{size:14,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate`,children:t.group.label}),(0,X.jsx)(`span`,{className:`tabular font-normal text-muted`,children:t.summary})]}),L.slice(r).map((e,n)=>(0,X.jsx)(`div`,{role:`gridcell`,style:{width:e.getSize(),flex:r+n===L.length-1?`1 0 auto`:`0 0 auto`},className:i(`tabular truncate px-3`,e.columnDef.meta.align===`right`&&`text-right`),children:e.columnDef.meta.subtotal?.(t.group)??``},e.id))]},V(t,e.index))}let s=r(t.row);return(0,X.jsx)(`div`,{id:B(e.index),role:`row`,"aria-rowindex":e.index+2,"aria-selected":a,style:o,onClick:()=>{D(e.index),m?.(t.row)},className:i(`group/row flex cursor-pointer border-b border-line/60 text-xs text-fg hover:bg-surface-2`,h===s&&`bg-accent/8`,a&&`group-focus-visible/grid:outline-2 group-focus-visible/grid:-outline-offset-2 group-focus-visible/grid:outline-accent`),"data-sw-grid-row":s,children:L.map((e,n)=>{let r=e.columnDef.meta,a=!!e.getIsPinned();return(0,X.jsx)(`div`,{role:`gridcell`,"aria-colindex":n+1,style:{width:e.getSize(),flex:n===L.length-1?`1 0 auto`:`0 0 auto`,...a?{left:te[n]}:{}},className:i(`flex min-w-0 items-center px-3`,r.align===`right`&&`tabular justify-end`,a&&`sticky z-10 bg-surface group-hover/row:bg-surface-2`,a&&h===s&&`bg-[color-mix(in_srgb,var(--accent)_8%,var(--surface))]`,a&&n===ie&&`border-r border-line`,t.depth&&n===0&&`pl-8`),"data-sw-grid-cell":e.id,children:(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:r.cell(t.row)})},e.id)})},s)})})]})}),x]})}function Ql({column:t,meta:r,index:i,layout:o,onLayout:s,canHide:c,onWidth:l,onResetWidth:u}){let d=!!t.getIsPinned(),f=o.order.filter(e=>!o.hidden.includes(e)),p=f.indexOf(t.id),m=e=>{let n=f[p+e];if(!n)return;let r=[...o.order],i=r.indexOf(t.id),a=r.indexOf(n);r[i]=n,r[a]=t.id,s({...o,order:r})};return(0,X.jsxs)(n,{children:[(0,X.jsx)(D,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,"aria-label":`${r.title||r.header}: column options`,className:`inline-flex h-6 w-5 shrink-0 items-center justify-center rounded text-faint opacity-0 outline-none hover:bg-surface hover:text-fg focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-accent data-[state=open]:opacity-100 [[role=columnheader]:hover_&]:opacity-100`,"data-sw-grid-menu":t.id,children:(0,X.jsx)(qt,{size:13,"aria-hidden":`true`})})}),(0,X.jsxs)(ee,{align:`start`,className:`w-48`,children:[t.getCanSort()?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(a,{onSelect:()=>t.toggleSorting(!1),children:[(0,X.jsx)(kt,{size:14,"aria-hidden":`true`}),` Sort ascending`]}),(0,X.jsxs)(a,{onSelect:()=>t.toggleSorting(!0),children:[(0,X.jsx)(Dt,{size:14,"aria-hidden":`true`}),` Sort descending`]}),(0,X.jsx)(e,{})]}):null,(0,X.jsxs)(a,{onSelect:()=>t.pin(!d&&`start`),"data-sw-grid-pin":t.id,children:[d?(0,X.jsx)(un,{size:14,"aria-hidden":`true`}):(0,X.jsx)(fn,{size:14,"aria-hidden":`true`}),` `,d?`Unpin`:`Pin to the left`]}),(0,X.jsxs)(a,{disabled:p<=0,onSelect:()=>m(-1),children:[(0,X.jsx)(ce,{size:14,"aria-hidden":`true`}),` Move left`]}),(0,X.jsxs)(a,{disabled:p<0||p>=f.length-1,onSelect:()=>m(1),children:[(0,X.jsx)(re,{size:14,"aria-hidden":`true`}),` Move right`]}),(0,X.jsx)(e,{}),(0,X.jsxs)(a,{disabled:t.getSize()>=640,onSelect:()=>l(t.getSize()+32),"data-sw-grid-wider":t.id,children:[(0,X.jsx)(Lt,{size:14,"aria-hidden":`true`}),` Wider`]}),(0,X.jsxs)(a,{disabled:t.getSize()<=64,onSelect:()=>l(t.getSize()-32),"data-sw-grid-narrower":t.id,children:[(0,X.jsx)(zt,{size:14,"aria-hidden":`true`}),` Narrower`]}),o.sizes?.[t.id]?(0,X.jsxs)(a,{onSelect:u,children:[(0,X.jsx)(Re,{size:14,"aria-hidden":`true`}),` Its usual width`]}):null,c&&!r.always?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(e,{}),(0,X.jsxs)(a,{onSelect:()=>t.toggleVisibility(!1),"data-sw-grid-hide":t.id,children:[(0,X.jsx)(Yt,{size:14,"aria-hidden":`true`}),` Hide this column`]})]}):null,(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Column `,i+1]})]})]})}function $l({columns:e,layout:t,onLayout:n,onReset:r}){let i=new Map(e.map(e=>[e.id,e])),a=e=>{let r=t.hidden.includes(e)?t.hidden.filter(t=>t!==e):[...t.hidden,e],i=[...t.order.filter(e=>!r.includes(e)),...t.order.filter(e=>r.includes(e))];n({...t,order:i,hidden:r,pinned:t.pinned.filter(e=>!r.includes(e))})},o=(e,r)=>{let i=[...t.order],a=i.indexOf(e),o=a+r;o<0||o>=i.length||([i[a],i[o]]=[i[o],i[a]],n({...t,order:i}))},s=e=>n({...t,pinned:t.pinned.includes(e)?t.pinned.filter(t=>t!==e):[...t.pinned,e]});return(0,X.jsxs)(b,{history:!1,children:[(0,X.jsx)(F,{asChild:!0,children:(0,X.jsxs)(l,{size:`sm`,variant:`secondary`,className:`h-9`,"data-sw-grid-columns":!0,children:[(0,X.jsx)(Gt,{size:14,"aria-hidden":`true`}),` Columns`]})}),(0,X.jsxs)(N,{align:`end`,className:`w-72 p-1.5`,children:[(0,X.jsx)(`ul`,{className:`max-h-80 overflow-y-auto`,"aria-label":`Columns`,children:t.order.map((e,n)=>{let r=i.get(e);if(!r)return null;let c=!t.hidden.includes(e);return(0,X.jsxs)(`li`,{className:`flex items-center gap-0.5 rounded-md px-1 hover:bg-surface-2`,children:[(0,X.jsxs)(`label`,{className:`flex min-h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 text-sm text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:c,disabled:r.always,onChange:()=>a(e),className:`h-4 w-4 accent-[var(--accent)]`,"data-sw-grid-column":e}),(0,X.jsx)(`span`,{className:`truncate`,children:r.title||r.header})]}),(0,X.jsx)(y,{label:t.pinned.includes(e)?`Unpin ${r.header}`:`Pin ${r.header} to the left`,size:`icon-xs`,disabled:!c,onClick:()=>s(e),children:t.pinned.includes(e)?(0,X.jsx)(fn,{size:13,className:`text-accent`,"aria-hidden":`true`}):(0,X.jsx)(fn,{size:13,"aria-hidden":`true`})}),(0,X.jsx)(y,{label:`Move ${r.header} up`,size:`icon-xs`,disabled:n===0,onClick:()=>o(e,-1),children:(0,X.jsx)(kt,{size:13,"aria-hidden":`true`})}),(0,X.jsx)(y,{label:`Move ${r.header} down`,size:`icon-xs`,disabled:n===t.order.length-1,onClick:()=>o(e,1),children:(0,X.jsx)(Dt,{size:13,"aria-hidden":`true`})})]},e)})}),(0,X.jsx)(`div`,{className:`mt-1 border-t border-line pt-1`,children:(0,X.jsxs)(l,{size:`sm`,variant:`ghost`,className:`w-full justify-start`,onClick:r,"data-sw-grid-columns-reset":!0,children:[(0,X.jsx)(Re,{size:13,"aria-hidden":`true`}),` Back to the usual columns`]})})]})]})}function eu(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function tu(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function nu(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=eu(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=tu(r,u,s[0]),f=tu(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function ru(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=eu(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=ou(d,0,s-r),f=ou(f,0,l-i),{x:d,y:f}}function iu(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=eu(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function au(e,t,n){let{margin:r,rowHeight:i}=e,a=eu(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function ou(e,t,n){return Math.max(Math.min(e,n),t)}function su(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function cu(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0&&su(r,t))return r}}function lu(e,t){return e.filter(e=>su(e,t))}function uu(e,t){return t===`horizontal`?fu(e):t===`vertical`||t===`wrap`?du(e):[...e]}function du(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function fu(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function pu(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=r.y+r.h;e>t&&(t=e)}}return t}function mu(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0&&r.i===t)return r}}function hu(e){return e.filter(e=>e.static===!0)}function gu(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function _u(e){let t=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(t[n]=gu(r))}return t}function vu(e,t){let n=Array(e.length);for(let r=0;r<e.length;r++){let i=e[r];i!==void 0&&(t.i===i.i?n[r]=t:n[r]=i)}return n}function yu(e,t,n){let r=mu(e,t);return r?(r=n(gu(r)),[vu(e,r),r]):[[...e],null]}function bu(e,t){let n=hu(e);for(let r=0;r<e.length;r++){let i=e[r];if(i!==void 0){if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=pu(n)),!i.static)n.push(i);else for(;cu(n,i);)i.y++}}return e}function xu(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=uu(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=lu(d,t),p=f.length>0;if(p&&c)return _u(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;e<f.length;e++){let n=f[e];n!==void 0&&(n.moved||(m=n.static?Su(m,n,t,i,o):Su(m,t,n,i,o)))}return m}function Su(e,t,n,r,i,a){let o=i===`horizontal`||i===`wrap`,s=i===`vertical`,c=t.static;if(r){r=!1;let a={x:o?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:`-1`},l=cu(e,a),u=l!==void 0&&l.y+l.h>t.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return xu(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return xu(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return xu(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:xu(e,n,l,u,r,c,i)}function Cu(e,t,n){return Math.max(t,Math.min(n,e))}var wu=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:Cu(t,0,Math.max(0,r-e.w)),y:Cu(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:Cu(t,1,Math.max(1,o)),h:Cu(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:Cu(t,e.minW??1,e.maxW??1/0),h:Cu(n,e.minH??1,e.maxH??1/0)}}}];function Tu(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function Eu(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function Du({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Ou({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function ku(e){return e*100+`%`}function Au(e,t,n,r){return e+n>r?t:n}function ju(e,t,n){return e<0?t:n}function Mu(e){return Math.max(0,e)}function Nu(e){return Math.max(0,e)}var Pu=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:ju(o,e.height,i),top:Nu(o)}},Fu=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Au(e.left,e.width,o,n),left:Mu(i)}},Iu=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Nu(r),left:0}:{height:i,width:a,top:Nu(r),left:o}},Lu=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:ju(r,e.height,a),top:Nu(r)}},Ru={n:Pu,ne:(e,t,n)=>Pu(e,Fu(e,t,n)),e:Fu,se:(e,t,n)=>Lu(e,Fu(e,t,n)),s:Lu,sw:(e,t,n)=>Lu(e,Iu(e,t)),w:Iu,nw:(e,t,n)=>Pu(e,Iu(e,t))};function zu(e,t,n,r){let i=Ru[e];return i?i(t,{...t,...n},r):n}var Bu={type:`transform`,scale:1,calcStyle(e){return Du(e)}},Vu={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Hu={enabled:!0,bounded:!1,threshold:3},Uu={enabled:!0,handles:[`se`]},Wu={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function Gu(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??hu(e).length>0;for(let i=o+1;i<e.length;i++){let o=e[i];if(o!==void 0&&!o.static){if(!s&&o.y>t.y+t.h)break;su(t,o)&&Gu(e,o,n+t[a],r,s)}}t[r]=n}function Ku(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!cu(e,t);)t.y--;let i;for(;(i=cu(e,t))!==void 0;)Gu(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function qu(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!cu(e,t);)t.x--;let i;for(;(i=cu(e,t))!==void 0;)if(Gu(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!cu(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Ju={type:`vertical`,allowOverlap:!1,compact(e,t){let n=hu(e),r=pu(n),i=du(e),a=Array(e.length);for(let t=0;t<i.length;t++){let o=i[t];if(o===void 0)continue;let s=gu(o);s.static||(s=Ku(n,s,i,r),r=Math.max(r,s.y+s.h),n.push(s));let c=e.indexOf(o);a[c]=s,s.moved=!1}return a}},Yu={type:`horizontal`,allowOverlap:!1,compact(e,t){let n=hu(e),r=fu(e),i=Array(e.length);for(let a=0;a<r.length;a++){let o=r[a];if(o===void 0)continue;let s=gu(o);s.static||(s=qu(n,s,t,r),n.push(s));let c=e.indexOf(o);i[c]=s,s.moved=!1}return i}},Xu={type:null,allowOverlap:!1,compact(e,t){return _u(e)}},Zu={...Ju,allowOverlap:!0,compact(e,t){return _u(e)}},Qu={...Yu,allowOverlap:!0,compact(e,t){return _u(e)}},$u={...Xu,allowOverlap:!0};function ed(e,t=!1,n=!1){let r;return r=t?e===`vertical`?Zu:e===`horizontal`?Qu:$u:e===`vertical`?Ju:e===`horizontal`?Yu:Xu,n?{...r,preventCollision:n}:r}function td(e){return Object.keys(e).sort((t,n)=>e[t]-e[n])}function nd(e,t){let n=td(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;i<n.length;i++){let a=n[i];a!==void 0&&t>e[a]&&(r=a)}return r}function rd(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function id(e,t,n,r,i,a){let o=e[n];if(o)return _u(o);let s=e[r],c=td(t),l=c.slice(c.indexOf(n));for(let t=0;t<l.length;t++){let n=l[t];if(n===void 0)continue;let r=e[n];if(r){s=r;break}}let u=bu(_u(s||[]),{cols:i});return(typeof a==`object`&&a?a:ed(a)).compact(u,i)}function ad(e,t){if(Array.isArray(e))return e;let n=e,r=n[t];if(r!==void 0)return r;let i=Object.keys(n);for(let e of i){let t=n[e];if(t!==void 0)return t}return[10,10]}var od=I(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(n,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),sd=I(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),cd=I(((e,t)=>{var n=sd();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),ld=I(((e,t)=>{t.exports=cd()()})),Q=v(ld(),1);function ud(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function dd(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function fd(e){return typeof e==`number`&&!isNaN(e)}function pd(e){return parseInt(e,10)}function md(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var hd=[`Moz`,`Webkit`,`O`,`ms`];function gd(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<hd.length;n++)if(_d(e,hd[n])in t)return hd[n];return``}function _d(e,t){return t?`${t}${vd(e)}`:e}function vd(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var yd=gd(),bd=``;function xd(e,t){bd||=ud([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return dd(e[t])})??``;let n=e[bd];return dd(n)?!!n.call(e,t):!1}function Sd(e,t,n){let r=e;do{if(xd(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Cd(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function wd(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function Td(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=pd(n.borderTopWidth),t+=pd(n.borderBottomWidth),t}function Ed(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=pd(n.borderLeftWidth),t+=pd(n.borderRightWidth),t}function Dd(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=pd(n.paddingTop),t-=pd(n.paddingBottom),t}function Od(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=pd(n.paddingLeft),t-=pd(n.paddingRight),t}function kd(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function Ad(e,t){let n=Md(e,t,`px`);return{[_d(`transform`,yd)]:n}}function jd(e,t){return Md(e,t,``)}function Md({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function Nd(e,t){return e.targetTouches&&ud(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&ud(e.changedTouches,e=>t===e.identifier)}function Pd(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Fd(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function Id(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Fd();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
2
2
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
3
3
|
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&zd(e.body,`react-draggable-transparent-selection`)}function Ld(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{Rd(e)}):Rd(e)}function Rd(e){if(e)try{e.body&&Bd(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function zd(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Bd(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Vd(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Jd(r);let i=Yd(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+pd(s.paddingLeft)+pd(o.marginLeft),top:-i.offsetTop+pd(s.paddingTop)+pd(o.marginTop),right:Od(a)-Ed(i)-i.offsetLeft+pd(s.paddingRight)-pd(o.marginRight),bottom:Dd(a)-Td(i)-i.offsetTop+pd(s.paddingBottom)-pd(o.marginBottom)}}return fd(r.right)&&(t=Math.min(t,r.right)),fd(r.bottom)&&(n=Math.min(n,r.bottom)),fd(r.left)&&(t=Math.max(t,r.left)),fd(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Hd(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ud(e){return e.props.axis===`both`||e.props.axis===`x`}function Wd(e){return e.props.axis===`both`||e.props.axis===`y`}function Gd(e,t,n){let r=typeof t==`number`?Nd(e,t):null;if(typeof t==`number`&&!r)return null;let i=Yd(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return kd(r||e,a,n.props.scale)}function Kd(e,t,n){let r=!fd(e.lastX),i=Yd(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function qd(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Jd(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Yd(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var Xd=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Zd={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Qd=Zd.mouse,$d=class extends Y.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!Sd(e.target,this.props.handle,t)||this.props.cancel&&Sd(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=Pd(e);this.touchIdentifier=r;let i=Gd(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Kd(this,a,o);Xd(`DraggableCore: handleDragStart: %j`,s),Xd(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&Id(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,Cd(n,Qd.move,this.handleDrag),Cd(n,Qd.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Gd(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Hd(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Kd(this,n,r);if(Xd(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1)try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}else this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Gd(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Hd(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Kd(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Ld(a.ownerDocument),Xd(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Xd(`DraggableCore: Removing handlers`),wd(a.ownerDocument,Qd.move,this.handleDrag),wd(a.ownerDocument,Qd.stop,this.handleDragStop))},this.onMouseDown=e=>(Qd=Zd.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Qd=Zd.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Qd=Zd.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Qd=Zd.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&Cd(e,Zd.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;wd(t,Zd.mouse.move,this.handleDrag),wd(t,Zd.touch.move,this.handleDrag),wd(t,Zd.mouse.stop,this.handleDragStop),wd(t,Zd.touch.stop,this.handleDragStop),wd(e,Zd.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Ld(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=al.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Xd(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return Y.cloneElement(Y.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};$d.displayName=`DraggableCore`,$d.propTypes={allowAnyClick:Q.default.bool,allowMobileScroll:Q.default.bool,children:Q.default.node.isRequired,disabled:Q.default.bool,enableUserSelectHack:Q.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:Q.default.arrayOf(Q.default.number),handle:Q.default.string,cancel:Q.default.string,nodeRef:Q.default.object,nonce:Q.default.string,onStart:Q.default.func,onDrag:Q.default.func,onStop:Q.default.func,onMouseDown:Q.default.func,scale:Q.default.number,className:md,style:md,transform:md},$d.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var ef=class extends Y.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Xd(`Draggable: onDragStart: %j`,t),this.props.onStart(e,qd(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Xd(`Draggable: onDrag: %j`,t);let n=qd(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Vd(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,qd(this,t))===!1)return!1;Xd(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Xd(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=al.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:Ud(this)&&p?this.state.x:m.x,y:Wd(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=jd(h,c):d=Ad(h,c);let g=Y.Children.only(n),_=O(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return Y.createElement($d,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},Y.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};ef.displayName=`Draggable`,ef.propTypes={...$d.propTypes,axis:Q.default.oneOf([`both`,`x`,`y`,`none`]),bounds:Q.default.oneOfType([Q.default.shape({left:Q.default.number,right:Q.default.number,top:Q.default.number,bottom:Q.default.number}),Q.default.string,Q.default.oneOf([!1])]),defaultClassName:Q.default.string,defaultClassNameDragging:Q.default.string,defaultClassNameDragged:Q.default.string,defaultPosition:Q.default.shape({x:Q.default.number,y:Q.default.number}),positionOffset:Q.default.shape({x:Q.default.oneOfType([Q.default.number,Q.default.string]),y:Q.default.oneOfType([Q.default.number,Q.default.string])}),position:Q.default.shape({x:Q.default.number,y:Q.default.number}),className:md,style:md,transform:md},ef.defaultProps={...$d.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var tf=I(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=` `),i+=r)}else for(r in e)e[r]&&(i&&(i+=` `),i+=r)}return i}function r(){for(var e,t,r=0,i=``,a=arguments.length;r<a;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=` `),i+=t);return i}t.exports=r,t.exports.clsx=r})),nf=I(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},d=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>l(r({},`__esModule`,{value:!0}),e),p={};c(p,{DraggableCore:()=>ve,default:()=>ye}),t.exports=f(p);var m=d(h()),g=d(ld()),_=d(u()),v=tf();function y(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function b(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function x(e){return typeof e==`number`&&!isNaN(e)}function S(e){return parseInt(e,10)}function C(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var w=[`Moz`,`Webkit`,`O`,`ms`];function T(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<w.length;n++)if(E(e,w[n])in t)return w[n];return``}function E(e,t){return t?`${t}${D(e)}`:e}function D(e){let t=``,n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]===`-`?n=!0:t+=e[r];return t}var O=T(),k=``;function A(e,t){k||=y([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return b(e[t])})??``;let n=e[k];return b(n)?!!n.call(e,t):!1}function j(e,t,n){let r=e;do{if(A(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function M(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function N(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function ee(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=S(n.borderTopWidth),t+=S(n.borderBottomWidth),t}function P(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=S(n.borderLeftWidth),t+=S(n.borderRightWidth),t}function F(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=S(n.paddingTop),t-=S(n.paddingBottom),t}function I(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=S(n.paddingLeft),t-=S(n.paddingRight),t}function L(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function te(e,t){let n=re(e,t,`px`);return{[E(`transform`,O)]:n}}function ne(e,t){return re(e,t,``)}function re({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function ie(e,t){return e.targetTouches&&y(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&y(e.changedTouches,e=>t===e.identifier)}function ae(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function R(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function oe(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??R();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
4
4
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|