@llmindset/hf-mcp-server 0.2.41 → 0.2.43
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/dist/server/gradio-endpoint-connector.d.ts +2 -8
- package/dist/server/gradio-endpoint-connector.d.ts.map +1 -1
- package/dist/server/gradio-endpoint-connector.js +79 -221
- package/dist/server/gradio-endpoint-connector.js.map +1 -1
- package/dist/server/mcp-proxy.d.ts.map +1 -1
- package/dist/server/mcp-proxy.js +4 -4
- package/dist/server/mcp-proxy.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +90 -2
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/utils/gradio-result-processor.d.ts +9 -0
- package/dist/server/utils/gradio-result-processor.d.ts.map +1 -0
- package/dist/server/utils/gradio-result-processor.js +53 -0
- package/dist/server/utils/gradio-result-processor.js.map +1 -0
- package/dist/server/utils/gradio-tool-caller.d.ts +20 -0
- package/dist/server/utils/gradio-tool-caller.d.ts.map +1 -0
- package/dist/server/utils/gradio-tool-caller.js +91 -0
- package/dist/server/utils/gradio-tool-caller.js.map +1 -0
- package/dist/server/utils/gradio-utils.d.ts.map +1 -1
- package/dist/server/utils/gradio-utils.js +2 -2
- package/dist/server/utils/gradio-utils.js.map +1 -1
- package/dist/server/utils/query-logger.d.ts +1 -0
- package/dist/server/utils/query-logger.d.ts.map +1 -1
- package/dist/server/utils/query-logger.js +1 -0
- package/dist/server/utils/query-logger.js.map +1 -1
- package/dist/server/utils/tool-selection-strategy.d.ts.map +1 -1
- package/dist/server/utils/tool-selection-strategy.js.map +1 -1
- package/dist/shared/bouquet-presets.d.ts.map +1 -1
- package/dist/shared/bouquet-presets.js +5 -1
- package/dist/shared/bouquet-presets.js.map +1 -1
- package/dist/web/assets/main-BTa3PJAr.js +197 -0
- package/dist/web/index.html +1 -1
- package/dist/web/mcp-welcome.html +46 -46
- package/package.json +2 -2
- package/dist/web/assets/main-C7vQ9_hk.js +0 -197
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import{r as Oc,a as h,R as He,j as l,b as Ji,g as Fc,c as Dc,d as $c}from"./index-BBRBgpfp.js";var Rr={exports:{}},Er={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* use-sync-external-store-shim.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Es;function Lc(){if(Es)return Er;Es=1;var e=Oc();function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(g,m){var f=m(),v=r({inst:{value:f,getSnapshot:m}}),p=v[0].inst,y=v[1];return s(function(){p.value=f,p.getSnapshot=m,c(p)&&y({inst:p})},[g,f,m]),o(function(){return c(p)&&y({inst:p}),g(function(){c(p)&&y({inst:p})})},[g]),i(f),f}function c(g){var m=g.getSnapshot;g=g.value;try{var f=m();return!n(g,f)}catch{return!0}}function u(g,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Er.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Er}var ks;function Vc(){return ks||(ks=1,Rr.exports=Lc()),Rr.exports}var zc=Vc();const Qi=0,ea=1,ta=2,Ms=3;var Ns=Object.prototype.hasOwnProperty;function ro(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ro(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ns.call(e,n)&&++r&&!Ns.call(t,n)||!(n in t)||!ro(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const rt=new WeakMap,yt=()=>{},Re=yt(),oo=Object,ie=e=>e===Re,Ge=e=>typeof e=="function",St=(e,t)=>({...e,...t}),na=e=>Ge(e.then),kr={},An={},Go="undefined",Rn=typeof window!=Go,so=typeof document!=Go,Hc=Rn&&"Deno"in window,Gc=()=>Rn&&typeof window.requestAnimationFrame!=Go,ra=(e,t)=>{const n=rt.get(e);return[()=>!ie(t)&&e.get(t)||kr,r=>{if(!ie(t)){const o=e.get(t);t in An||(An[t]=o),n[5](t,St(o,r),o||kr)}},n[6],()=>!ie(t)&&t in An?An[t]:!ie(t)&&e.get(t)||kr]};let io=!0;const Uc=()=>io,[ao,lo]=Rn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[yt,yt],Bc=()=>{const e=so&&document.visibilityState;return ie(e)||e!=="hidden"},Wc=e=>(so&&document.addEventListener("visibilitychange",e),ao("focus",e),()=>{so&&document.removeEventListener("visibilitychange",e),lo("focus",e)}),qc=e=>{const t=()=>{io=!0,e()},n=()=>{io=!1};return ao("online",t),ao("offline",n),()=>{lo("online",t),lo("offline",n)}},Zc={isOnline:Uc,isVisible:Bc},Kc={initFocus:Wc,initReconnect:qc},As=!He.useId,hn=!Rn||Hc,Xc=e=>Gc()?window.requestAnimationFrame(e):setTimeout(e,1),Mr=hn?h.useEffect:h.useLayoutEffect,Nr=typeof navigator<"u"&&navigator.connection,Ts=!hn&&Nr&&(["slow-2g","2g"].includes(Nr.effectiveType)||Nr.saveData),Tn=new WeakMap,Yc=e=>oo.prototype.toString.call(e),Ar=(e,t)=>e===`[object ${t}]`;let Jc=0;const co=e=>{const t=typeof e,n=Yc(e),r=Ar(n,"Date"),o=Ar(n,"RegExp"),s=Ar(n,"Object");let i,a;if(oo(e)===e&&!r&&!o){if(i=Tn.get(e),i)return i;if(i=++Jc+"~",Tn.set(e,i),Array.isArray(e)){for(i="@",a=0;a<e.length;a++)i+=co(e[a])+",";Tn.set(e,i)}if(s){i="#";const c=oo.keys(e).sort();for(;!ie(a=c.pop());)ie(e[a])||(i+=a+":"+co(e[a])+",");Tn.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Uo=e=>{if(Ge(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?co(e):"",[e,t]};let Qc=0;const uo=()=>++Qc;async function oa(...e){const[t,n,r,o]=e,s=St({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=s.populateCache;const a=s.rollbackOnError;let c=s.optimisticData;const u=m=>typeof a=="function"?a(m):a!==!1,d=s.throwOnError;if(Ge(n)){const m=n,f=[],v=t.keys();for(const p of v)!/^\$(inf|sub)\$/.test(p)&&m(t.get(p)._k)&&f.push(p);return Promise.all(f.map(g))}return g(n);async function g(m){const[f]=Uo(m);if(!f)return;const[v,p]=ra(t,f),[y,x,b,w]=rt.get(t),S=()=>{const A=y[f];return(Ge(s.revalidate)?s.revalidate(v().data,m):s.revalidate!==!1)&&(delete b[f],delete w[f],A&&A[0])?A[0](ta).then(()=>v().data):v().data};if(e.length<3)return S();let C=r,N,E=!1;const _=uo();x[f]=[_,0];const j=!ie(c),L=v(),K=L.data,U=L._c,Z=ie(U)?K:U;if(j&&(c=Ge(c)?c(Z,K):c,p({data:c,_c:Z})),Ge(C))try{C=C(Z)}catch(A){N=A,E=!0}if(C&&na(C))if(C=await C.catch(A=>{N=A,E=!0}),_!==x[f][0]){if(E)throw N;return C}else E&&j&&u(N)&&(i=!0,p({data:Z,_c:Re}));if(i&&!E)if(Ge(i)){const A=i(C,Z);p({data:A,error:Re,_c:Re})}else p({data:C,error:Re,_c:Re});if(x[f][1]=uo(),Promise.resolve(S()).then(()=>{p({_c:Re})}),E){if(d)throw N;return}return C}}const js=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},eu=(e,t)=>{if(!rt.has(e)){const n=St(Kc,t),r=Object.create(null),o=oa.bind(Re,e);let s=yt;const i=Object.create(null),a=(d,g)=>{const m=i[d]||[];return i[d]=m,m.push(g),()=>m.splice(m.indexOf(g),1)},c=(d,g,m)=>{e.set(d,g);const f=i[d];if(f)for(const v of f)v(g,m)},u=()=>{if(!rt.has(e)&&(rt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),o,c,a]),!hn)){const d=n.initFocus(setTimeout.bind(Re,js.bind(Re,r,Qi))),g=n.initReconnect(setTimeout.bind(Re,js.bind(Re,r,ea)));s=()=>{d&&d(),g&&g(),rt.delete(e)}}};return u(),[e,o,u,s]}return[e,rt.get(e)[4]]},tu=(e,t,n,r,o)=>{const s=n.errorRetryCount,i=o.retryCount,a=~~((Math.random()+.5)*(1<<(i<8?i:8)))*n.errorRetryInterval;!ie(s)&&i>s||setTimeout(r,a,o)},nu=ro,[sa,Bn]=eu(new Map),ru=St({onLoadingSlow:yt,onSuccess:yt,onError:yt,onErrorRetry:tu,onDiscarded:yt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ts?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Ts?5e3:3e3,compare:nu,isPaused:()=>!1,cache:sa,mutate:Bn,fallback:{}},Zc),ou=(e,t)=>{const n=St(e,t);if(t){const{use:r,fallback:o}=e,{use:s,fallback:i}=t;r&&s&&(n.use=r.concat(s)),o&&i&&(n.fallback=St(o,i))}return n},su=h.createContext({}),iu="$inf$",ia=Rn&&window.__SWR_DEVTOOLS_USE__,au=ia?window.__SWR_DEVTOOLS_USE__:[],lu=()=>{ia&&(window.__SWR_DEVTOOLS_REACT__=He)},cu=e=>Ge(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],uu=()=>{const e=h.useContext(su);return h.useMemo(()=>St(ru,e),[e])},du=e=>(t,n,r)=>e(t,n&&((...s)=>{const[i]=Uo(t),[,,,a]=rt.get(sa);if(i.startsWith(iu))return n(...s);const c=a[i];return ie(c)?n(...s):(delete a[i],c)}),r),fu=au.concat(du),mu=e=>function(...n){const r=uu(),[o,s,i]=cu(n),a=ou(r,i);let c=e;const{use:u}=a,d=(u||[]).concat(fu);for(let g=d.length;g--;)c=d[g](c);return c(o,s||a.fetcher||null,a)},gu=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};lu();const Tr=He.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),jr={dedupe:!0},Is=Promise.resolve(Re),pu=(e,t,n)=>{const{cache:r,compare:o,suspense:s,fallbackData:i,revalidateOnMount:a,revalidateIfStale:c,refreshInterval:u,refreshWhenHidden:d,refreshWhenOffline:g,keepPreviousData:m}=n,[f,v,p,y]=rt.get(r),[x,b]=Uo(e),w=h.useRef(!1),S=h.useRef(!1),C=h.useRef(x),N=h.useRef(t),E=h.useRef(n),_=()=>E.current,j=()=>_().isVisible()&&_().isOnline(),[L,K,U,Z]=ra(r,x),A=h.useRef({}).current,te=ie(i)?ie(n.fallback)?Re:n.fallback[x]:i,I=(re,ue)=>{for(const he in A){const le=he;if(le==="data"){if(!o(re[le],ue[le])&&(!ie(re[le])||!o(be,ue[le])))return!1}else if(ue[le]!==re[le])return!1}return!0},Q=h.useMemo(()=>{const re=!x||!t?!1:ie(a)?_().isPaused()||s?!1:c!==!1:a,ue=ke=>{const Qe=St(ke);return delete Qe._k,re?{isValidating:!0,isLoading:!0,...Qe}:Qe},he=L(),le=Z(),Ae=ue(he),pt=he===le?Ae:ue(le);let ge=Ae;return[()=>{const ke=ue(L());return I(ke,ge)?(ge.data=ke.data,ge.isLoading=ke.isLoading,ge.isValidating=ke.isValidating,ge.error=ke.error,ge):(ge=ke,ke)},()=>pt]},[r,x]),R=zc.useSyncExternalStore(h.useCallback(re=>U(x,(ue,he)=>{I(he,ue)||re()}),[r,x]),Q[0],Q[1]),k=!w.current,z=f[x]&&f[x].length>0,V=R.data,ee=ie(V)?te&&na(te)?Tr(te):te:V,se=R.error,ce=h.useRef(ee),be=m?ie(V)?ie(ce.current)?ee:ce.current:V:ee,_e=z&&!ie(se)?!1:k&&!ie(a)?a:_().isPaused()?!1:s?ie(ee)?!1:c:ie(ee)||c,ne=!!(x&&t&&k&&_e),ze=ie(R.isValidating)?ne:R.isValidating,xe=ie(R.isLoading)?ne:R.isLoading,Se=h.useCallback(async re=>{const ue=N.current;if(!x||!ue||S.current||_().isPaused())return!1;let he,le,Ae=!0;const pt=re||{},ge=!p[x]||!pt.dedupe,ke=()=>As?!S.current&&x===C.current&&w.current:x===C.current,Qe={isValidating:!1,isLoading:!1},Ss=()=>{K(Qe)},Cs=()=>{const Pe=p[x];Pe&&Pe[1]===le&&delete p[x]},Rs={isValidating:!0};ie(L().data)&&(Rs.isLoading=!0);try{if(ge&&(K(Rs),n.loadingTimeout&&ie(L().data)&&setTimeout(()=>{Ae&&ke()&&_().onLoadingSlow(x,n)},n.loadingTimeout),p[x]=[ue(b),uo()]),[he,le]=p[x],he=await he,ge&&setTimeout(Cs,n.dedupingInterval),!p[x]||p[x][1]!==le)return ge&&ke()&&_().onDiscarded(x),!1;Qe.error=Re;const Pe=v[x];if(!ie(Pe)&&(le<=Pe[0]||le<=Pe[1]||Pe[1]===0))return Ss(),ge&&ke()&&_().onDiscarded(x),!1;const et=L().data;Qe.data=o(et,he)?et:he,ge&&ke()&&_().onSuccess(he,x,n)}catch(Pe){Cs();const et=_(),{shouldRetryOnError:Sr}=et;et.isPaused()||(Qe.error=Pe,ge&&ke()&&(et.onError(Pe,x,et),(Sr===!0||Ge(Sr)&&Sr(Pe))&&(!_().revalidateOnFocus||!_().revalidateOnReconnect||j())&&et.onErrorRetry(Pe,x,et,Pc=>{const Cr=f[x];Cr&&Cr[0]&&Cr[0](Ms,Pc)},{retryCount:(pt.retryCount||0)+1,dedupe:!0})))}return Ae=!1,Ss(),!0},[x,r]),Je=h.useCallback((...re)=>oa(r,C.current,...re),[]);if(Mr(()=>{N.current=t,E.current=n,ie(V)||(ce.current=V)}),Mr(()=>{if(!x)return;const re=Se.bind(Re,jr);let ue=0;_().revalidateOnFocus&&(ue=Date.now()+_().focusThrottleInterval);const le=gu(x,f,(Ae,pt={})=>{if(Ae==Qi){const ge=Date.now();_().revalidateOnFocus&&ge>ue&&j()&&(ue=ge+_().focusThrottleInterval,re())}else if(Ae==ea)_().revalidateOnReconnect&&j()&&re();else{if(Ae==ta)return Se();if(Ae==Ms)return Se(pt)}});return S.current=!1,C.current=x,w.current=!0,K({_k:b}),_e&&(p[x]||(ie(ee)||hn?re():Xc(re))),()=>{S.current=!0,le()}},[x]),Mr(()=>{let re;function ue(){const le=Ge(u)?u(L().data):u;le&&re!==-1&&(re=setTimeout(he,le))}function he(){!L().error&&(d||_().isVisible())&&(g||_().isOnline())?Se(jr).then(ue):ue()}return ue(),()=>{re&&(clearTimeout(re),re=-1)}},[u,d,g,x]),h.useDebugValue(be),s){const re=x&&ie(ee);if(!As&&hn&&re)throw new Error("Fallback data is required when using Suspense in SSR.");re&&(N.current=t,E.current=n,S.current=!1);const ue=y[x],he=!ie(ue)&&re?Je(ue):Is;if(Tr(he),!ie(se)&&re)throw se;const le=re?Se(jr):Is;!ie(be)&&re&&(le.status="fulfilled",le.value=!0),Tr(le)}return{mutate:Je,get data(){return A.data=!0,be},get error(){return A.error=!0,se},get isValidating(){return A.isValidating=!0,ze},get isLoading(){return A.isLoading=!0,xe}}},mn=mu(pu);function aa(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=aa(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function la(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=aa(e))&&(r&&(r+=" "),r+=t);return r}const Bo="-",hu=e=>{const t=xu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Bo);return a[0]===""&&a.length!==1&&a.shift(),ca(a,t)||vu(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},ca=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?ca(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Bo);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},Ps=/^\[(.+)\]$/,vu=e=>{if(Ps.test(e)){const t=Ps.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},xu=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)fo(n[o],r,o,t);return r},fo=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Os(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(yu(o)){fo(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{fo(i,Os(t,s),n,r)})})},Os=(e,t)=>{let n=e;return t.split(Bo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},yu=e=>e.isThemeGetter,wu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},mo="!",go=":",bu=go.length,_u=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;for(let v=0;v<o.length;v++){let p=o[v];if(i===0&&a===0){if(p===go){s.push(o.slice(c,v)),c=v+bu;continue}if(p==="/"){u=v;continue}}p==="["?i++:p==="]"?i--:p==="("?a++:p===")"&&a--}const d=s.length===0?o:o.substring(c),g=Su(d),m=g!==d,f=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:f}};if(t){const o=t+go,s=r;r=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Su=e=>e.endsWith(mo)?e.substring(0,e.length-1):e.startsWith(mo)?e.substring(1):e,Cu=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const o=[];let s=[];return r.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Ru=e=>({cache:wu(e.cacheSize),parseClassName:_u(e),sortModifiers:Cu(e),...hu(e)}),Eu=/\s+/,ku=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Eu);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:g,modifiers:m,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:p}=n(d);if(g){c=d+(c.length>0?" "+c:c);continue}let y=!!p,x=r(y?v.substring(0,p):v);if(!x){if(!y){c=d+(c.length>0?" "+c:c);continue}if(x=r(v),!x){c=d+(c.length>0?" "+c:c);continue}y=!1}const b=s(m).join(":"),w=f?b+mo:b,S=w+x;if(i.includes(S))continue;i.push(S);const C=o(x,y);for(let N=0;N<C.length;++N){const E=C[N];i.push(w+E)}c=d+(c.length>0?" "+c:c)}return c};function Mu(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ua(t))&&(r&&(r+=" "),r+=n);return r}const ua=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ua(e[r]))&&(n&&(n+=" "),n+=t);return n};function Nu(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((d,g)=>g(d),e());return n=Ru(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const d=ku(c,n);return o(c,d),d}return function(){return s(Mu.apply(null,arguments))}}const ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},da=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Au=/^\d+\/\d+$/,Tu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ju=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Iu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Pu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ou=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zt=e=>Au.test(e),Y=e=>!!e&&!Number.isNaN(Number(e)),ht=e=>!!e&&Number.isInteger(Number(e)),Ir=e=>e.endsWith("%")&&Y(e.slice(0,-1)),tt=e=>Tu.test(e),Fu=()=>!0,Du=e=>ju.test(e)&&!Iu.test(e),ma=()=>!1,$u=e=>Pu.test(e),Lu=e=>Ou.test(e),Vu=e=>!P(e)&&!O(e),zu=e=>rn(e,ha,ma),P=e=>da.test(e),At=e=>rn(e,va,Du),Pr=e=>rn(e,Wu,Y),Fs=e=>rn(e,ga,ma),Hu=e=>rn(e,pa,Lu),jn=e=>rn(e,xa,$u),O=e=>fa.test(e),cn=e=>on(e,va),Gu=e=>on(e,qu),Ds=e=>on(e,ga),Uu=e=>on(e,ha),Bu=e=>on(e,pa),In=e=>on(e,xa,!0),rn=(e,t,n)=>{const r=da.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},on=(e,t,n=!1)=>{const r=fa.exec(e);return r?r[1]?t(r[1]):n:!1},ga=e=>e==="position"||e==="percentage",pa=e=>e==="image"||e==="url",ha=e=>e==="length"||e==="size"||e==="bg-size",va=e=>e==="length",Wu=e=>e==="number",qu=e=>e==="family-name",xa=e=>e==="shadow",Zu=()=>{const e=ye("color"),t=ye("font"),n=ye("text"),r=ye("font-weight"),o=ye("tracking"),s=ye("leading"),i=ye("breakpoint"),a=ye("container"),c=ye("spacing"),u=ye("radius"),d=ye("shadow"),g=ye("inset-shadow"),m=ye("text-shadow"),f=ye("drop-shadow"),v=ye("blur"),p=ye("perspective"),y=ye("aspect"),x=ye("ease"),b=ye("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),O,P],N=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],_=()=>[O,P,c],j=()=>[zt,"full","auto",..._()],L=()=>[ht,"none","subgrid",O,P],K=()=>["auto",{span:["full",ht,O,P]},ht,O,P],U=()=>[ht,"auto",O,P],Z=()=>["auto","min","max","fr",O,P],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",..._()],Q=()=>[zt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],R=()=>[e,O,P],k=()=>[...S(),Ds,Fs,{position:[O,P]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Uu,zu,{size:[O,P]}],ee=()=>[Ir,cn,At],se=()=>["","none","full",u,O,P],ce=()=>["",Y,cn,At],be=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Y,Ir,Ds,Fs],ze=()=>["","none",v,O,P],xe=()=>["none",Y,O,P],Se=()=>["none",Y,O,P],Je=()=>[Y,O,P],gt=()=>[zt,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tt],breakpoint:[tt],color:[Fu],container:[tt],"drop-shadow":[tt],ease:["in","out","in-out"],font:[Vu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tt],shadow:[tt],spacing:["px",Y],text:[tt],"text-shadow":[tt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zt,P,O,y]}],container:["container"],columns:[{columns:[Y,P,O,a]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{start:j()}],end:[{end:j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[ht,"auto",O,P]}],basis:[{basis:[zt,"full","auto",a,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Y,zt,"auto","initial","none",P]}],grow:[{grow:["",Y,O,P]}],shrink:[{shrink:["",Y,O,P]}],order:[{order:[ht,"first","last","none",O,P]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[a,"screen",...Q()]}],"min-w":[{"min-w":[a,"screen","none",...Q()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,cn,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,O,Pr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ir,P]}],"font-family":[{font:[Gu,P,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,O,P]}],"line-clamp":[{"line-clamp":[Y,"none",O,Pr]}],leading:[{leading:[s,..._()]}],"list-image":[{"list-image":["none",O,P]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",O,P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Y,"from-font","auto",O,At]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Y,"auto",O,P]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",O,P]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",O,P]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ht,O,P],radial:["",O,P],conic:[ht,O,P]},Bu,Hu]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Y,O,P]}],"outline-w":[{outline:["",Y,cn,At]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",d,In,jn]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",g,In,jn]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Y,At]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",m,In,jn]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Y,O,P]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Y]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[O,P]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Y]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",O,P]}],filter:[{filter:["","none",O,P]}],blur:[{blur:ze()}],brightness:[{brightness:[Y,O,P]}],contrast:[{contrast:[Y,O,P]}],"drop-shadow":[{"drop-shadow":["","none",f,In,jn]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Y,O,P]}],"hue-rotate":[{"hue-rotate":[Y,O,P]}],invert:[{invert:["",Y,O,P]}],saturate:[{saturate:[Y,O,P]}],sepia:[{sepia:["",Y,O,P]}],"backdrop-filter":[{"backdrop-filter":["","none",O,P]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[Y,O,P]}],"backdrop-contrast":[{"backdrop-contrast":[Y,O,P]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Y,O,P]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Y,O,P]}],"backdrop-invert":[{"backdrop-invert":["",Y,O,P]}],"backdrop-opacity":[{"backdrop-opacity":[Y,O,P]}],"backdrop-saturate":[{"backdrop-saturate":[Y,O,P]}],"backdrop-sepia":[{"backdrop-sepia":["",Y,O,P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",O,P]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Y,"initial",O,P]}],ease:[{ease:["linear","initial",x,O,P]}],delay:[{delay:[Y,O,P]}],animate:[{animate:["none",b,O,P]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,O,P]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Je()}],"skew-x":[{"skew-x":Je()}],"skew-y":[{"skew-y":Je()}],transform:[{transform:[O,P,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:gt()}],"translate-x":[{"translate-x":gt()}],"translate-y":[{"translate-y":gt()}],"translate-z":[{"translate-z":gt()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",O,P]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",O,P]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Y,cn,At,Pr]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ku=Nu(Zu);function de(...e){return Ku(la(e))}function st({className:e,...t}){return l.jsx("div",{"data-slot":"card",className:de("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function it({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:de("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function at({className:e,...t}){return l.jsx("div",{"data-slot":"card-title",className:de("leading-none font-semibold",e),...t})}function Ft({className:e,...t}){return l.jsx("div",{"data-slot":"card-description",className:de("text-muted-foreground text-sm",e),...t})}function lt({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:de("px-6",e),...t})}function $s(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function lr(...e){return t=>{let n=!1;const r=e.map(o=>{const s=$s(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():$s(e[o],null)}}}}function Ee(...e){return h.useCallback(lr(...e),e)}function Dt(e,t=[]){let n=[];function r(s,i){const a=h.createContext(i),c=n.length;n=[...n,i];const u=g=>{var x;const{scope:m,children:f,...v}=g,p=((x=m==null?void 0:m[e])==null?void 0:x[c])||a,y=h.useMemo(()=>v,Object.values(v));return l.jsx(p.Provider,{value:y,children:f})};u.displayName=s+"Provider";function d(g,m){var p;const f=((p=m==null?void 0:m[e])==null?void 0:p[c])||a,v=h.useContext(f);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>h.createContext(i));return function(a){const c=(a==null?void 0:a[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Xu(o,...t)]}function Xu(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const g=c(s)[`__scope${u}`];return{...a,...g}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function J(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var Ct=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Yu=Ji[" useInsertionEffect ".trim().toString()]||Ct;function cr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Ju({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=h.useRef(e!==void 0);h.useEffect(()=>{const g=d.current;g!==a&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=h.useCallback(d=>{var g;if(a){const m=Qu(d)?d(e):d;m!==e&&((g=i.current)==null||g.call(i,m))}else s(d)},[a,e,s,i]);return[c,u]}function Ju({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),o=h.useRef(n),s=h.useRef(t);return Yu(()=>{s.current=t},[t]),h.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function Qu(e){return typeof e=="function"}function ed(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function ya(e){const[t,n]=h.useState(void 0);return Ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function td(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var $t=e=>{const{present:t,children:n}=e,r=nd(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=Ee(r.ref,rd(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null};$t.displayName="Presence";function nd(e){const[t,n]=h.useState(),r=h.useRef(null),o=h.useRef(e),s=h.useRef("none"),i=e?"mounted":"unmounted",[a,c]=td(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Pn(r.current);s.current=a==="mounted"?u:"none"},[a]),Ct(()=>{const u=r.current,d=o.current;if(d!==e){const m=s.current,f=Pn(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&m!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Ct(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,g=f=>{const p=Pn(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&p&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=f=>{f.target===t&&(s.current=Pn(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Pn(e){return(e==null?void 0:e.animationName)||"none"}function rd(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wo=Dc();const od=Fc(Wo);function vn(e){const t=sd(e),n=h.forwardRef((r,o)=>{const{children:s,...i}=r,a=h.Children.toArray(s),c=a.find(ad);if(c){const u=c.props.children,d=a.map(g=>g===c?h.Children.count(u)>1?h.Children.only(null):h.isValidElement(u)?u.props.children:null:g);return l.jsx(t,{...i,ref:o,children:h.isValidElement(u)?h.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var wa=vn("Slot");function sd(e){const t=h.forwardRef((n,r)=>{const{children:o,...s}=n;if(h.isValidElement(o)){const i=cd(o),a=ld(s,o.props);return o.type!==h.Fragment&&(a.ref=r?lr(r,i):i),h.cloneElement(o,a)}return h.Children.count(o)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var id=Symbol("radix.slottable");function ad(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===id}function ld(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function cd(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ud=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fe=ud.reduce((e,t)=>{const n=vn(`Primitive.${t}`),r=h.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ba(e,t){e&&Wo.flushSync(()=>e.dispatchEvent(t))}var ur="Checkbox",[dd]=Dt(ur),[fd,qo]=dd(ur);function md(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:g}=e,[m,f]=cr({prop:n,defaultProp:o??!1,onChange:c,caller:ur}),[v,p]=h.useState(null),[y,x]=h.useState(null),b=h.useRef(!1),w=v?!!i||!!v.closest("form"):!0,S={checked:m,disabled:s,setChecked:f,control:v,setControl:p,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:bt(o)?!1:o,isFormControl:w,bubbleInput:y,setBubbleInput:x};return l.jsx(fd,{scope:t,...S,children:gd(g)?g(S):r})}var _a="CheckboxTrigger",Sa=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:c,required:u,setControl:d,setChecked:g,hasConsumerStoppedPropagationRef:m,isFormControl:f,bubbleInput:v}=qo(_a,e),p=Ee(o,d),y=h.useRef(c);return h.useEffect(()=>{const x=s==null?void 0:s.form;if(x){const b=()=>g(y.current);return x.addEventListener("reset",b),()=>x.removeEventListener("reset",b)}},[s,g]),l.jsx(fe.button,{type:"button",role:"checkbox","aria-checked":bt(c)?"mixed":c,"aria-required":u,"data-state":Na(c),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:p,onKeyDown:J(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:J(n,x=>{g(b=>bt(b)?!0:!b),v&&f&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});Sa.displayName=_a;var Ca=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:c,onCheckedChange:u,form:d,...g}=e;return l.jsx(md,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(Sa,{...g,ref:t,__scopeCheckbox:n}),m&&l.jsx(Ma,{__scopeCheckbox:n})]})})});Ca.displayName=ur;var Ra="CheckboxIndicator",Ea=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=qo(Ra,n);return l.jsx($t,{present:r||bt(s.checked)||s.checked===!0,children:l.jsx(fe.span,{"data-state":Na(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Ea.displayName=Ra;var ka="CheckboxBubbleInput",Ma=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:c,name:u,value:d,form:g,bubbleInput:m,setBubbleInput:f}=qo(ka,e),v=Ee(n,f),p=ed(s),y=ya(r);h.useEffect(()=>{const b=m;if(!b)return;const w=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(w,"checked").set,N=!o.current;if(p!==s&&C){const E=new Event("click",{bubbles:N});b.indeterminate=bt(s),C.call(b,bt(s)?!1:s),b.dispatchEvent(E)}},[m,p,s,o]);const x=h.useRef(bt(s)?!1:s);return l.jsx(fe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:a,disabled:c,name:u,value:d,form:g,...t,tabIndex:-1,ref:v,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ma.displayName=ka;function gd(e){return typeof e=="function"}function bt(e){return e==="indeterminate"}function Na(e){return bt(e)?"indeterminate":e?"checked":"unchecked"}/**
|
|
10
|
-
* @license lucide-react v0.507.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/const pd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hd=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ls=e=>{const t=hd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Aa=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),vd=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
15
|
-
* @license lucide-react v0.507.0 - ISC
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the ISC license.
|
|
18
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var xd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
20
|
-
* @license lucide-react v0.507.0 - ISC
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the ISC license.
|
|
23
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
-
*/const yd=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>h.createElement("svg",{ref:c,...xd,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Aa("lucide",o),...!s&&!vd(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>h.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
|
|
25
|
-
* @license lucide-react v0.507.0 - ISC
|
|
26
|
-
*
|
|
27
|
-
* This source code is licensed under the ISC license.
|
|
28
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/const Ve=(e,t)=>{const n=h.forwardRef(({className:r,...o},s)=>h.createElement(yd,{ref:s,iconNode:t,className:Aa(`lucide-${pd(Ls(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Ls(e),n};/**
|
|
30
|
-
* @license lucide-react v0.507.0 - ISC
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the ISC license.
|
|
33
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/const wd=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],bd=Ve("activity",wd);/**
|
|
35
|
-
* @license lucide-react v0.507.0 - ISC
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the ISC license.
|
|
38
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/const _d=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ta=Ve("check",_d);/**
|
|
40
|
-
* @license lucide-react v0.507.0 - ISC
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the ISC license.
|
|
43
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/const Sd=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ja=Ve("chevron-down",Sd);/**
|
|
45
|
-
* @license lucide-react v0.507.0 - ISC
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the ISC license.
|
|
48
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/const Cd=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Rd=Ve("chevron-up",Cd);/**
|
|
50
|
-
* @license lucide-react v0.507.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const Ed=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],kd=Ve("clock",Ed);/**
|
|
55
|
-
* @license lucide-react v0.507.0 - ISC
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the ISC license.
|
|
58
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/const Md=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Nd=Ve("copy",Md);/**
|
|
60
|
-
* @license lucide-react v0.507.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the ISC license.
|
|
63
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const Ad=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Td=Ve("globe",Ad);/**
|
|
65
|
-
* @license lucide-react v0.507.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const jd=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Id=Ve("settings",jd);/**
|
|
70
|
-
* @license lucide-react v0.507.0 - ISC
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the ISC license.
|
|
73
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/const Pd=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ia=Ve("triangle-alert",Pd);/**
|
|
75
|
-
* @license lucide-react v0.507.0 - ISC
|
|
76
|
-
*
|
|
77
|
-
* This source code is licensed under the ISC license.
|
|
78
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
-
*/const Od=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Pa=Ve("wifi-off",Od);/**
|
|
80
|
-
* @license lucide-react v0.507.0 - ISC
|
|
81
|
-
*
|
|
82
|
-
* This source code is licensed under the ISC license.
|
|
83
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
-
*/const Fd=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Oa=Ve("wifi",Fd);function Zo({className:e,...t}){return l.jsx(Ca,{"data-slot":"checkbox",className:de("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(Ea,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:l.jsx(Ta,{className:"size-3.5"})})})}function Dd({id:e,label:t,description:n,isEnabled:r,onToggle:o}){return l.jsx("div",{children:l.jsxs("div",{className:"items-top flex space-x-2",children:[l.jsx(Zo,{id:e,checked:r,onCheckedChange:s=>o(s===!0)}),l.jsxs("div",{className:"grid gap-1.5 leading-none",children:[l.jsx("label",{htmlFor:e,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:t}),l.jsx("p",{className:"text-sm text-muted-foreground",children:n})]})]})})}function Vs({title:e,description:t,tools:n,onToolToggle:r}){return l.jsxs(st,{className:"w-full",children:[l.jsxs(it,{children:[l.jsx(at,{children:e}),l.jsx(Ft,{children:t})]}),l.jsx(lt,{children:l.jsx("div",{className:"grid grid-cols-2 gap-6 mb-6",children:Object.entries(n).map(([o,s])=>l.jsx(Dd,{id:s.id,label:s.label,description:s.description,isEnabled:s.settings.enabled,onToggle:i=>{r(s.id,i)}},o))})})]})}function po({className:e,type:t,...n}){return l.jsx("input",{type:t,"data-slot":"input",className:de("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var $d="Label",Fa=h.forwardRef((e,t)=>l.jsx(fe.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Fa.displayName=$d;var Ld=Fa;function Vd({className:e,...t}){return l.jsx(Ld,{"data-slot":"label",className:de("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function zd({spaceNames:e,spaceSubdomains:t,enabledSpaces:n,onSpaceToolToggle:r,onSpaceToolNameChange:o,onSpaceToolSubdomainChange:s}){const i=[0,1,2];return l.jsxs(st,{className:"w-full",children:[l.jsxs(it,{children:[l.jsx(at,{children:"🚀 Gradio Spaces"}),l.jsxs(Ft,{children:["Configure up to 3 Gradio spaces for remote tool access. Edit the name and subdomain fields.",l.jsx("span",{className:"font-semibold",children:" Note: Changes may require reconnecting your MCP client."})]})]}),l.jsx(lt,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center space-x-3 pb-2 border-b",children:[l.jsx("div",{className:"w-6"})," ",l.jsx("div",{className:"text-sm font-medium min-w-[80px]",children:"Space"}),l.jsx("div",{className:"flex-1 text-sm font-medium",children:"Name"}),l.jsx("div",{className:"flex-1 text-sm font-medium",children:"Subdomain"})]}),i.map(a=>l.jsxs("div",{className:"flex items-center space-x-3",children:[l.jsx(Zo,{id:`space-tool-${a}`,checked:n[a]||!1,onCheckedChange:c=>r(a,c===!0)}),l.jsx(Vd,{htmlFor:`space-tool-${a}`,className:"text-sm font-medium min-w-[80px]",children:a+1}),l.jsx(po,{placeholder:"username/space-name",value:e[a]||"",onChange:c=>o(a,c.target.value),className:"flex-1 text-sm"}),l.jsx(po,{placeholder:"username-space-name",value:t[a]||"",onChange:c=>s(a,c.target.value),className:"flex-1 text-sm"})]},a))]})})]})}const zs=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hs=la,Ko=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Hs(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],g=s==null?void 0:s[u];if(d===null)return null;const m=zs(d)||zs(g);return o[u][m]}),a=n&&Object.entries(n).reduce((u,d)=>{let[g,m]=d;return m===void 0||(u[g]=m),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:g,className:m,...f}=d;return Object.entries(f).every(v=>{let[p,y]=v;return Array.isArray(y)?y.includes({...s,...a}[p]):{...s,...a}[p]===y})?[...u,g,m]:u},[]);return Hs(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Hd=Ko("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Gd({className:e,variant:t,...n}){return l.jsx("div",{"data-slot":"alert",role:"alert",className:de(Hd({variant:t}),e),...n})}function Ud({className:e,...t}){return l.jsx("div",{"data-slot":"alert-title",className:de("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Bd({className:e,...t}){return l.jsx("div",{"data-slot":"alert-description",className:de("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}const Wd=Ko("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-green-100 text-green-800 [a&]:hover:bg-green-100/90"}},defaultVariants:{variant:"default"}});function Tt({className:e,variant:t,asChild:n=!1,...r}){const o=n?wa:"span";return l.jsx(o,{"data-slot":"badge",className:de(Wd({variant:t}),e),...r})}var qd="Separator",Gs="horizontal",Zd=["horizontal","vertical"],Da=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=Gs,...o}=e,s=Kd(r)?r:Gs,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(fe.div,{"data-orientation":s,...a,...o,ref:t})});Da.displayName=qd;function Kd(e){return Zd.includes(e)}var Xd=Da;function It({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return l.jsx(Xd,{"data-slot":"separator",decorative:n,orientation:t,className:de("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}/**
|
|
85
|
-
* table-core
|
|
86
|
-
*
|
|
87
|
-
* Copyright (c) TanStack
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the MIT license found in the
|
|
90
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
91
|
-
*
|
|
92
|
-
* @license MIT
|
|
93
|
-
*/function wt(e,t){return typeof e=="function"?e(t):e}function Ie(e,t){return n=>{t.setState(r=>({...r,[e]:wt(n,r[e])}))}}function dr(e){return e instanceof Function}function Yd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Jd(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function H(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const a=e(s);if(!(a.length!==r.length||a.some((d,g)=>r[g]!==d)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-i)*100)/100,g=Math.round((Date.now()-u)*100)/100,m=g/16,f=(v,p)=>{for(v=String(v);v.length<p;)v=" "+v;return v};console.info(`%c⏱ ${f(g,5)} /${f(d,5)} ms`,`
|
|
94
|
-
font-size: .6rem;
|
|
95
|
-
font-weight: bold;
|
|
96
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function G(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function Qd(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:H(()=>[e,n,t,s],(i,a,c,u)=>({table:i,column:a,row:c,cell:u,getValue:u.getValue,renderValue:u.renderValue}),G(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function ef(e,t,n,r){var o,s;const a={...e._getDefaultColumnDef(),...t},c=a.accessorKey;let u=(o=(s=a.id)!=null?s:c?typeof String.prototype.replaceAll=="function"?c.replaceAll(".","_"):c.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:c&&(c.includes(".")?d=m=>{let f=m;for(const p of c.split(".")){var v;f=(v=f)==null?void 0:v[p]}return f}:d=m=>m[a.accessorKey]),!u)throw new Error;let g={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:H(()=>[!0],()=>{var m;return[g,...(m=g.columns)==null?void 0:m.flatMap(f=>f.getFlatColumns())]},G(e.options,"debugColumns")),getLeafColumns:H(()=>[e._getOrderColumnsFn()],m=>{var f;if((f=g.columns)!=null&&f.length){let v=g.columns.flatMap(p=>p.getLeafColumns());return m(v)}return[g]},G(e.options,"debugColumns"))};for(const m of e._features)m.createColumn==null||m.createColumn(g,e);return g}const Ce="debugHeaders";function Us(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],a=c=>{c.subHeaders&&c.subHeaders.length&&c.subHeaders.map(a),i.push(c)};return a(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const tf={createTable:e=>{e.getHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const a=(s=r==null?void 0:r.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?s:[],c=(i=o==null?void 0:o.map(g=>n.find(m=>m.id===g)).filter(Boolean))!=null?i:[],u=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return On(t,[...a,...u,...c],e)},G(e.options,Ce)),e.getCenterHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),On(t,n,e,"center")),G(e.options,Ce)),e.getLeftHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return On(t,s,e,"left")},G(e.options,Ce)),e.getRightHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(a=>a.id===i)).filter(Boolean))!=null?o:[];return On(t,s,e,"right")},G(e.options,Ce)),e.getFooterGroups=H(()=>[e.getHeaderGroups()],t=>[...t].reverse(),G(e.options,Ce)),e.getLeftFooterGroups=H(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),G(e.options,Ce)),e.getCenterFooterGroups=H(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),G(e.options,Ce)),e.getRightFooterGroups=H(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),G(e.options,Ce)),e.getFlatHeaders=H(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),G(e.options,Ce)),e.getLeftFlatHeaders=H(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),G(e.options,Ce)),e.getCenterFlatHeaders=H(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),G(e.options,Ce)),e.getRightFlatHeaders=H(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),G(e.options,Ce)),e.getCenterLeafHeaders=H(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),G(e.options,Ce)),e.getLeftLeafHeaders=H(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),G(e.options,Ce)),e.getRightLeafHeaders=H(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),G(e.options,Ce)),e.getLeafHeaders=H(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,a,c,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(a=n[0])==null?void 0:a.headers)!=null?i:[],...(c=(u=r[0])==null?void 0:u.headers)!=null?c:[]].map(d=>d.getLeafHeaders()).flat()},G(e.options,Ce))}};function On(e,t,n,r){var o,s;let i=0;const a=function(m,f){f===void 0&&(f=1),i=Math.max(i,f),m.filter(v=>v.getIsVisible()).forEach(v=>{var p;(p=v.columns)!=null&&p.length&&a(v.columns,f+1)},0)};a(e);let c=[];const u=(m,f)=>{const v={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];m.forEach(y=>{const x=[...p].reverse()[0],b=y.column.depth===v.depth;let w,S=!1;if(b&&y.column.parent?w=y.column.parent:(w=y.column,S=!0),x&&(x==null?void 0:x.column)===w)x.subHeaders.push(y);else{const C=Us(n,w,{id:[r,f,w.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${p.filter(N=>N.column===w).length}`:void 0,depth:f,index:p.length});C.subHeaders.push(y),p.push(C)}v.headers.push(y),y.headerGroup=v}),c.push(v),f>0&&u(p,f-1)},d=t.map((m,f)=>Us(n,m,{depth:i,index:f}));u(d,i-1),c.reverse();const g=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let p=0,y=0,x=[0];v.subHeaders&&v.subHeaders.length?(x=[],g(v.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:C}=w;p+=S,x.push(C)})):p=1;const b=Math.min(...x);return y=y+b,v.colSpan=p,v.rowSpan=y,{colSpan:p,rowSpan:y}});return g((o=(s=c[0])==null?void 0:s.headers)!=null?o:[]),c}const Xo=(e,t,n,r,o,s,i)=>{let a={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:c=>{if(a._valuesCache.hasOwnProperty(c))return a._valuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return a._valuesCache[c]=u.accessorFn(a.original,r),a._valuesCache[c]},getUniqueValues:c=>{if(a._uniqueValuesCache.hasOwnProperty(c))return a._uniqueValuesCache[c];const u=e.getColumn(c);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[c]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[c]):(a._uniqueValuesCache[c]=[a.getValue(c)],a._uniqueValuesCache[c])},renderValue:c=>{var u;return(u=a.getValue(c))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Jd(a.subRows,c=>c.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let c=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;c.push(d),u=d}return c.reverse()},getAllCells:H(()=>[e.getAllLeafColumns()],c=>c.map(u=>Qd(e,a,u,u.id)),G(e.options,"debugRows")),_getAllCellsByColumnId:H(()=>[a.getAllCells()],c=>c.reduce((u,d)=>(u[d.column.id]=d,u),{}),G(e.options,"debugRows"))};for(let c=0;c<e._features.length;c++){const u=e._features[c];u==null||u.createRow==null||u.createRow(a,e)}return a},nf={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},$a=(e,t,n)=>{var r,o;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(s))};$a.autoRemove=e=>De(e);const La=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};La.autoRemove=e=>De(e);const Va=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};Va.autoRemove=e=>De(e);const za=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};za.autoRemove=e=>De(e);const Ha=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Ha.autoRemove=e=>De(e)||!(e!=null&&e.length);const Ga=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Ga.autoRemove=e=>De(e)||!(e!=null&&e.length);const Ua=(e,t,n)=>e.getValue(t)===n;Ua.autoRemove=e=>De(e);const Ba=(e,t,n)=>e.getValue(t)==n;Ba.autoRemove=e=>De(e);const Yo=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Yo.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const a=s;s=i,i=a}return[s,i]};Yo.autoRemove=e=>De(e)||De(e[0])&&De(e[1]);const nt={includesString:$a,includesStringSensitive:La,equalsString:Va,arrIncludes:za,arrIncludesAll:Ha,arrIncludesSome:Ga,equals:Ua,weakEquals:Ba,inNumberRange:Yo};function De(e){return e==null||e===""}const rf={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ie("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?nt.includesString:typeof r=="number"?nt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?nt.equals:Array.isArray(r)?nt.arrIncludes:nt.weakEquals},e.getFilterFn=()=>{var n,r;return dr(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:nt[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(d=>d.id===e.id),i=wt(n,s?s.value:void 0);if(Bs(o,i,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const c={id:e.id,value:i};if(s){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?c:d))!=null?u:[]}return r!=null&&r.length?[...r,c]:[c]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=wt(t,o))==null?void 0:s.filter(i=>{const a=n.find(c=>c.id===i.id);if(a){const c=a.getFilterFn();if(Bs(c,i.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Bs(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const of=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),sf=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},af=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},lf=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o<i&&(o=i)))}),[r,o]},cf=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},uf=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!Yd(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},df=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),ff=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,mf=(e,t)=>t.length,Or={sum:of,min:sf,max:af,extent:lf,mean:cf,median:uf,unique:df,uniqueCount:ff,count:mf},gf={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ie("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Or.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Or.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return dr(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Or[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function pf(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const hf={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ie("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=H(n=>[gn(t,n)],n=>n.findIndex(r=>r.id===e.id),G(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=gn(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=gn(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=H(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],a=[...o];for(;a.length&&i.length;){const c=i.shift(),u=a.findIndex(d=>d.id===c);u>-1&&s.push(a.splice(u,1)[0])}s=[...s,...a]}return pf(s,n,r)},G(e.options,"debugTable"))}},Fr=()=>({left:[],right:[]}),vf={getInitialState:e=>({columnPinning:Fr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ie("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var a,c;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((c=o==null?void 0:o.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},G(t.options,"debugRows")),e.getLeftVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),G(t.options,"debugRows")),e.getRightVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),G(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Fr():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Fr())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),G(e.options,"debugColumns")),e.getRightLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),G(e.options,"debugColumns")),e.getCenterLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},G(e.options,"debugColumns"))}};function xf(e){return e||(typeof document<"u"?document:null)}const Fn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Dr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),yf={getDefaultColumnDef:()=>Fn,getInitialState:e=>({columnSizing:{},columnSizingInfo:Dr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ie("columnSizing",e),onColumnSizingInfoChange:Ie("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Fn.minSize,(r=s??e.columnDef.size)!=null?r:Fn.size),(o=e.columnDef.maxSize)!=null?o:Fn.maxSize)},e.getStart=H(n=>[n,gn(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),G(t.options,"debugColumns")),e.getAfter=H(n=>[n,gn(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),G(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),$r(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],c=$r(s)?Math.round(s.touches[0].clientX):s.clientX,u={},d=(x,b)=>{typeof b=="number"&&(t.setColumnSizingInfo(w=>{var S,C;const N=t.options.columnResizeDirection==="rtl"?-1:1,E=(b-((S=w==null?void 0:w.startOffset)!=null?S:0))*N,_=Math.max(E/((C=w==null?void 0:w.startSize)!=null?C:0),-.999999);return w.columnSizingStart.forEach(j=>{let[L,K]=j;u[L]=Math.round(Math.max(K+K*_,0)*100)/100}),{...w,deltaOffset:E,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(w=>({...w,...u})))},g=x=>d("move",x),m=x=>{d("end",x),t.setColumnSizingInfo(b=>({...b,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=xf(n),v={moveHandler:x=>g(x.clientX),upHandler:x=>{f==null||f.removeEventListener("mousemove",v.moveHandler),f==null||f.removeEventListener("mouseup",v.upHandler),m(x.clientX)}},p={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),g(x.touches[0].clientX),!1),upHandler:x=>{var b;f==null||f.removeEventListener("touchmove",p.moveHandler),f==null||f.removeEventListener("touchend",p.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),m((b=x.touches[0])==null?void 0:b.clientX)}},y=wf()?{passive:!1}:!1;$r(s)?(f==null||f.addEventListener("touchmove",p.moveHandler,y),f==null||f.addEventListener("touchend",p.upHandler,y)):(f==null||f.addEventListener("mousemove",v.moveHandler,y),f==null||f.addEventListener("mouseup",v.upHandler,y)),t.setColumnSizingInfo(x=>({...x,startOffset:c,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Dr():(n=e.initialState.columnSizingInfo)!=null?n:Dr())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Dn=null;function wf(){if(typeof Dn=="boolean")return Dn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Dn=e,Dn}function $r(e){return e.type==="touchstart"}const bf={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ie("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=H(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),G(t.options,"debugRows")),e.getVisibleCells=H(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],G(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>H(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),G(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function gn(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const _f={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Sf={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ie("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>nt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return dr(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:nt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Cf={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ie("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{i[a]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:a,...c}=i;return c}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},ho=0,vo=10,Lr=()=>({pageIndex:ho,pageSize:vo}),Rf={getInitialState:e=>({...e,pagination:{...Lr(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ie("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>wt(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Lr():(o=e.initialState.pagination)!=null?o:Lr())},e.setPageIndex=r=>{e.setPagination(o=>{let s=wt(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?ho:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:ho)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?vo:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:vo)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,wt(r,o.pageSize)),i=o.pageSize*o.pageIndex,a=Math.floor(i/s);return{...o,pageIndex:a,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=wt(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=H(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},G(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Vr=()=>({top:[],bottom:[]}),Ef={getInitialState:e=>({rowPinning:Vr(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ie("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(c=>{let{id:u}=c;return u}):[],i=o?e.getParentRows().map(c=>{let{id:u}=c;return u}):[],a=new Set([...i,e.id,...s]);t.setRowPinning(c=>{var u,d;if(n==="bottom"){var g,m;return{top:((g=c==null?void 0:c.top)!=null?g:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((m=c==null?void 0:c.bottom)!=null?m:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var f,v;return{top:[...((f=c==null?void 0:c.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((v=c==null?void 0:c.bottom)!=null?v:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=c==null?void 0:c.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((d=c==null?void 0:c.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(a=>r==null?void 0:r.includes(a)),i=n.some(a=>o==null?void 0:o.includes(a));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:a}=i;return a});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Vr():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Vr())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const a=e.getRow(i,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(i=>t.find(a=>a.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),G(e.options,"debugRows")),e.getBottomRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),G(e.options,"debugRows")),e.getCenterRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},G(e.options,"debugRows"))}},kf={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ie("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{xo(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=H(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?zr(e,n):{rows:[],flatRows:[],rowsById:{}},G(e.options,"debugTable")),e.getFilteredSelectedRowModel=H(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?zr(e,n):{rows:[],flatRows:[],rowsById:{}},G(e.options,"debugTable")),e.getGroupedSelectedRowModel=H(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?zr(e,n):{rows:[],flatRows:[],rowsById:{}},G(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const a={...s};return xo(a,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Jo(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return yo(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return yo(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},xo=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(a=>xo(e,a.id,n,r,o))};function zr(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,a){return i.map(c=>{var u;const d=Jo(c,n);if(d&&(r.push(c),o[c.id]=c),(u=c.subRows)!=null&&u.length&&(c={...c,subRows:s(c.subRows)}),d)return c}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Jo(e,t){var n;return(n=t[e.id])!=null?n:!1}function yo(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Jo(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const a=yo(i,t);a==="all"?s=!0:(a==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const wo=/([0-9]+)/gm,Mf=(e,t,n)=>Wa(Rt(e.getValue(n)).toLowerCase(),Rt(t.getValue(n)).toLowerCase()),Nf=(e,t,n)=>Wa(Rt(e.getValue(n)),Rt(t.getValue(n))),Af=(e,t,n)=>Qo(Rt(e.getValue(n)).toLowerCase(),Rt(t.getValue(n)).toLowerCase()),Tf=(e,t,n)=>Qo(Rt(e.getValue(n)),Rt(t.getValue(n))),jf=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},If=(e,t,n)=>Qo(e.getValue(n),t.getValue(n));function Qo(e,t){return e===t?0:e>t?1:-1}function Rt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Wa(e,t){const n=e.split(wo).filter(Boolean),r=t.split(wo).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),a=parseInt(s,10),c=[i,a].sort();if(isNaN(c[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(c[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}const un={alphanumeric:Mf,alphanumericCaseSensitive:Nf,text:Af,textCaseSensitive:Tf,datetime:jf,basic:If},Pf={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ie("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return un.datetime;if(typeof s=="string"&&(r=!0,s.split(wo).length>1))return un.alphanumeric}return r?un.text:un.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return dr(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:un[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const a=i==null?void 0:i.find(f=>f.id===e.id),c=i==null?void 0:i.findIndex(f=>f.id===e.id);let u=[],d,g=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":i!=null&&i.length&&c!==i.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(s||o||(d="remove")),d==="add"){var m;u=[...i,{id:e.id,desc:g}],u.splice(0,u.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=i.map(f=>f.id===e.id?{...f,desc:g}:f):d==="remove"?u=i.filter(f=>f.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Of=[tf,bf,hf,vf,nf,rf,_f,Sf,Pf,gf,Cf,Rf,Ef,kf,yf];function Ff(e){var t,n;const r=[...Of,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((m,f)=>Object.assign(m,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),i=m=>o.options.mergeOptions?o.options.mergeOptions(s,m):{...s,...m};let c={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(m=>{var f;c=(f=m.getInitialState==null?void 0:m.getInitialState(c))!=null?f:c});const u=[];let d=!1;const g={_features:r,options:{...s,...e},initialState:c,_queue:m=>{u.push(m),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:m=>{const f=wt(m,o.options);o.options=i(f)},getState:()=>o.options.state,setState:m=>{o.options.onStateChange==null||o.options.onStateChange(m)},_getRowId:(m,f,v)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(m,f,v))!=null?p:`${v?[v.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(m,f)=>{let v=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[m];if(!v&&(v=o.getCoreRowModel().rowsById[m],!v))throw new Error;return v},_getDefaultColumnDef:H(()=>[o.options.defaultColumn],m=>{var f;return m=(f=m)!=null?f:{},{header:v=>{const p=v.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:v=>{var p,y;return(p=(y=v.renderValue())==null||y.toString==null?void 0:y.toString())!=null?p:null},...o._features.reduce((v,p)=>Object.assign(v,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...m}},G(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:H(()=>[o._getColumnDefs()],m=>{const f=function(v,p,y){return y===void 0&&(y=0),v.map(x=>{const b=ef(o,x,y,p),w=x;return b.columns=w.columns?f(w.columns,b,y+1):[],b})};return f(m)},G(e,"debugColumns")),getAllFlatColumns:H(()=>[o.getAllColumns()],m=>m.flatMap(f=>f.getFlatColumns()),G(e,"debugColumns")),_getAllFlatColumnsById:H(()=>[o.getAllFlatColumns()],m=>m.reduce((f,v)=>(f[v.id]=v,f),{}),G(e,"debugColumns")),getAllLeafColumns:H(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(m,f)=>{let v=m.flatMap(p=>p.getLeafColumns());return f(v)},G(e,"debugColumns")),getColumn:m=>o._getAllFlatColumnsById()[m]};Object.assign(o,g);for(let m=0;m<o._features.length;m++){const f=o._features[m];f==null||f.createTable==null||f.createTable(o)}return o}function Df(){return e=>H(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const a=[];for(let u=0;u<o.length;u++){const d=Xo(e,e._getRowId(o[u],u,i),o[u],u,s,void 0,i==null?void 0:i.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var c;d.originalSubRows=e.options.getSubRows(o[u],u),(c=d.originalSubRows)!=null&&c.length&&(d.subRows=r(d.originalSubRows,s+1,d))}}return a};return n.rows=r(t),n},G(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function $f(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Lf(e,t,n){return n.options.filterFromLeafRows?Vf(e,t,n):zf(e,t,n)}function Vf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const d=[];for(let m=0;m<c.length;m++){var g;let f=c[m];const v=Xo(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(v.columnFilters=f.columnFilters,(g=f.subRows)!=null&&g.length&&u<i){if(v.subRows=a(f.subRows,u+1),f=v,t(f)&&!v.subRows.length){d.push(f),s[f.id]=f,o.push(f);continue}if(t(f)||v.subRows.length){d.push(f),s[f.id]=f,o.push(f);continue}}else f=v,t(f)&&(d.push(f),s[f.id]=f,o.push(f))}return d};return{rows:a(e),flatRows:o,rowsById:s}}function zf(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(c,u){u===void 0&&(u=0);const d=[];for(let m=0;m<c.length;m++){let f=c[m];if(t(f)){var g;if((g=f.subRows)!=null&&g.length&&u<i){const p=Xo(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);p.subRows=a(f.subRows,u+1),f=p}d.push(f),o.push(f),s[f.id]=f}}return d};return{rows:a(e),flatRows:o,rowsById:s}}function Hf(){return e=>H(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}const o=[],s=[];(n??[]).forEach(m=>{var f;const v=e.getColumn(m.id);if(!v)return;const p=v.getFilterFn();p&&o.push({id:m.id,filterFn:p,resolvedValue:(f=p.resolveFilterValue==null?void 0:p.resolveFilterValue(m.value))!=null?f:m.value})});const i=(n??[]).map(m=>m.id),a=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());r&&a&&c.length&&(i.push("__global__"),c.forEach(m=>{var f;s.push({id:m.id,filterFn:a,resolvedValue:(f=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?f:r})}));let u,d;for(let m=0;m<t.flatRows.length;m++){const f=t.flatRows[m];if(f.columnFilters={},o.length)for(let v=0;v<o.length;v++){u=o[v];const p=u.id;f.columnFilters[p]=u.filterFn(f,p,u.resolvedValue,y=>{f.columnFiltersMeta[p]=y})}if(s.length){for(let v=0;v<s.length;v++){d=s[v];const p=d.id;if(d.filterFn(f,p,d.resolvedValue,y=>{f.columnFiltersMeta[p]=y})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const g=m=>{for(let f=0;f<i.length;f++)if(m.columnFilters[i[f]]===!1)return!1;return!0};return Lf(t.rows,g,e)},G(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Gf(e){return t=>H(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:s}=n;let{rows:i,flatRows:a,rowsById:c}=r;const u=o*s,d=u+o;i=i.slice(u,d);let g;t.options.paginateExpandedRows?g={rows:i,flatRows:a,rowsById:c}:g=$f({rows:i,flatRows:a,rowsById:c}),g.flatRows=[];const m=f=>{g.flatRows.push(f),f.subRows.length&&f.subRows.forEach(m)};return g.rows.forEach(m),g},G(t.options,"debugTable"))}function Uf(){return e=>H(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(c=>{var u;return(u=e.getColumn(c.id))==null?void 0:u.getCanSort()}),i={};s.forEach(c=>{const u=e.getColumn(c.id);u&&(i[c.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=c=>{const u=c.map(d=>({...d}));return u.sort((d,g)=>{for(let f=0;f<s.length;f+=1){var m;const v=s[f],p=i[v.id],y=p.sortUndefined,x=(m=v==null?void 0:v.desc)!=null?m:!1;let b=0;if(y){const w=d.getValue(v.id),S=g.getValue(v.id),C=w===void 0,N=S===void 0;if(C||N){if(y==="first")return C?-1:1;if(y==="last")return C?1:-1;b=C&&N?0:C?y:-y}}if(b===0&&(b=p.sortingFn(d,g,v.id)),b!==0)return x&&(b*=-1),p.invertSorting&&(b*=-1),b}return d.index-g.index}),u.forEach(d=>{var g;o.push(d),(g=d.subRows)!=null&&g.length&&(d.subRows=a(d.subRows))}),u};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},G(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
97
|
-
* react-table
|
|
98
|
-
*
|
|
99
|
-
* Copyright (c) TanStack
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the MIT license found in the
|
|
102
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
103
|
-
*
|
|
104
|
-
* @license MIT
|
|
105
|
-
*/function Ws(e,t){return e?Bf(e)?h.createElement(e,t):e:null}function Bf(e){return Wf(e)||typeof e=="function"||qf(e)}function Wf(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function qf(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Zf(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:Ff(t)})),[r,o]=h.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}const Kf=Ko("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",xl:"h-12 rounded-md px-8 text-base",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),jt=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?wa:"button";return l.jsx(i,{className:de(Kf({variant:t,size:n,className:e})),ref:s,...o})});jt.displayName="Button";function qa(e){const t=e+"CollectionProvider",[n,r]=Dt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=p=>{const{scope:y,children:x}=p,b=He.useRef(null),w=He.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:w,collectionRef:b,children:x})};i.displayName=t;const a=e+"CollectionSlot",c=vn(a),u=He.forwardRef((p,y)=>{const{scope:x,children:b}=p,w=s(a,x),S=Ee(y,w.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",g="data-radix-collection-item",m=vn(d),f=He.forwardRef((p,y)=>{const{scope:x,children:b,...w}=p,S=He.useRef(null),C=Ee(y,S),N=s(d,x);return He.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),l.jsx(m,{[g]:"",ref:C,children:b})});f.displayName=d;function v(p){const y=s(e+"CollectionConsumer",p);return He.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${g}]`));return Array.from(y.itemMap.values()).sort((N,E)=>w.indexOf(N.ref.current)-w.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,ItemSlot:f},v,r]}var Xf=h.createContext(void 0);function es(e){const t=h.useContext(Xf);return e||t||"ltr"}function ct(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Yf(e,t=globalThis==null?void 0:globalThis.document){const n=ct(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Jf="DismissableLayer",bo="dismissableLayer.update",Qf="dismissableLayer.pointerDownOutside",em="dismissableLayer.focusOutside",qs,Za=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ka=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=h.useContext(Za),[d,g]=h.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=h.useState({}),v=Ee(t,E=>g(E)),p=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=p.indexOf(y),b=d?p.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=x,C=rm(E=>{const _=E.target,j=[...u.branches].some(L=>L.contains(_));!S||j||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},m),N=om(E=>{const _=E.target;[...u.branches].some(L=>L.contains(_))||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},m);return Yf(E=>{b===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},m),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(qs=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Zs(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=qs)}},[d,m,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Zs())},[d,u]),h.useEffect(()=>{const E=()=>f({});return document.addEventListener(bo,E),()=>document.removeEventListener(bo,E)},[]),l.jsx(fe.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:J(e.onFocusCapture,N.onFocusCapture),onBlurCapture:J(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,C.onPointerDownCapture)})});Ka.displayName=Jf;var tm="DismissableLayerBranch",nm=h.forwardRef((e,t)=>{const n=h.useContext(Za),r=h.useRef(null),o=Ee(t,r);return h.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(fe.div,{...e,ref:o})});nm.displayName=tm;function rm(e,t=globalThis==null?void 0:globalThis.document){const n=ct(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Xa(Qf,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function om(e,t=globalThis==null?void 0:globalThis.document){const n=ct(e),r=h.useRef(!1);return h.useEffect(()=>{const o=s=>{s.target&&!r.current&&Xa(em,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zs(){const e=new CustomEvent(bo);document.dispatchEvent(e)}function Xa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ba(o,s):o.dispatchEvent(s)}var Hr=0;function sm(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ks()),document.body.insertAdjacentElement("beforeend",e[1]??Ks()),Hr++,()=>{Hr===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hr--}},[])}function Ks(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Gr="focusScope.autoFocusOnMount",Ur="focusScope.autoFocusOnUnmount",Xs={bubbles:!1,cancelable:!0},im="FocusScope",Ya=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=h.useState(null),u=ct(o),d=ct(s),g=h.useRef(null),m=Ee(t,p=>c(p)),f=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let p=function(w){if(f.paused||!a)return;const S=w.target;a.contains(S)?g.current=S:vt(g.current,{select:!0})},y=function(w){if(f.paused||!a)return;const S=w.relatedTarget;S!==null&&(a.contains(S)||vt(g.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&vt(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",y);const b=new MutationObserver(x);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,f.paused]),h.useEffect(()=>{if(a){Js.add(f);const p=document.activeElement;if(!a.contains(p)){const x=new CustomEvent(Gr,Xs);a.addEventListener(Gr,u),a.dispatchEvent(x),x.defaultPrevented||(am(fm(Ja(a)),{select:!0}),document.activeElement===p&&vt(a))}return()=>{a.removeEventListener(Gr,u),setTimeout(()=>{const x=new CustomEvent(Ur,Xs);a.addEventListener(Ur,d),a.dispatchEvent(x),x.defaultPrevented||vt(p??document.body,{select:!0}),a.removeEventListener(Ur,d),Js.remove(f)},0)}}},[a,u,d,f]);const v=h.useCallback(p=>{if(!n&&!r||f.paused)return;const y=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,x=document.activeElement;if(y&&x){const b=p.currentTarget,[w,S]=lm(b);w&&S?!p.shiftKey&&x===S?(p.preventDefault(),n&&vt(w,{select:!0})):p.shiftKey&&x===w&&(p.preventDefault(),n&&vt(S,{select:!0})):x===b&&p.preventDefault()}},[n,r,f.paused]);return l.jsx(fe.div,{tabIndex:-1,...i,ref:m,onKeyDown:v})});Ya.displayName=im;function am(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vt(r,{select:t}),document.activeElement!==n)return}function lm(e){const t=Ja(e),n=Ys(t,e),r=Ys(t.reverse(),e);return[n,r]}function Ja(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ys(e,t){for(const n of e)if(!cm(n,{upTo:t}))return n}function cm(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function um(e){return e instanceof HTMLInputElement&&"select"in e}function vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&um(e)&&t&&e.select()}}var Js=dm();function dm(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Qs(e,t),e.unshift(t)},remove(t){var n;e=Qs(e,t),(n=e[0])==null||n.resume()}}}function Qs(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fm(e){return e.filter(t=>t.tagName!=="A")}var mm=Ji[" useId ".trim().toString()]||(()=>{}),gm=0;function Kn(e){const[t,n]=h.useState(mm());return Ct(()=>{n(r=>r??String(gm++))},[e]),e||(t?`radix-${t}`:"")}const pm=["top","right","bottom","left"],Et=Math.min,Te=Math.max,Xn=Math.round,$n=Math.floor,We=e=>({x:e,y:e}),hm={left:"right",right:"left",bottom:"top",top:"bottom"},vm={start:"end",end:"start"};function _o(e,t,n){return Te(e,Et(t,n))}function ut(e,t){return typeof e=="function"?e(t):e}function dt(e){return e.split("-")[0]}function sn(e){return e.split("-")[1]}function ts(e){return e==="x"?"y":"x"}function ns(e){return e==="y"?"height":"width"}const xm=new Set(["top","bottom"]);function Be(e){return xm.has(dt(e))?"y":"x"}function rs(e){return ts(Be(e))}function ym(e,t,n){n===void 0&&(n=!1);const r=sn(e),o=rs(e),s=ns(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Yn(i)),[i,Yn(i)]}function wm(e){const t=Yn(e);return[So(e),t,So(t)]}function So(e){return e.replace(/start|end/g,t=>vm[t])}const ei=["left","right"],ti=["right","left"],bm=["top","bottom"],_m=["bottom","top"];function Sm(e,t,n){switch(e){case"top":case"bottom":return n?t?ti:ei:t?ei:ti;case"left":case"right":return t?bm:_m;default:return[]}}function Cm(e,t,n,r){const o=sn(e);let s=Sm(dt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(So)))),s}function Yn(e){return e.replace(/left|right|bottom|top/g,t=>hm[t])}function Rm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Qa(e){return typeof e!="number"?Rm(e):{top:e,right:e,bottom:e,left:e}}function Jn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ni(e,t,n){let{reference:r,floating:o}=e;const s=Be(t),i=rs(t),a=ns(i),c=dt(t),u=s==="y",d=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:g};break;case"left":f={x:r.x-o.width,y:g};break;default:f={x:r.x,y:r.y}}switch(sn(t)){case"start":f[i]-=m*(n&&u?-1:1);break;case"end":f[i]+=m*(n&&u?-1:1);break}return f}const Em=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:g}=ni(u,r,c),m=r,f={},v=0;for(let p=0;p<a.length;p++){const{name:y,fn:x}=a[p],{x:b,y:w,data:S,reset:C}=await x({x:d,y:g,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:u,platform:i,elements:{reference:e,floating:t}});d=b??d,g=w??g,f={...f,[y]:{...f[y],...S}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:g}=ni(u,m,c)),p=-1)}return{x:d,y:g,placement:m,strategy:o,middlewareData:f}};async function xn(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:m=!1,padding:f=0}=ut(t,e),v=Qa(f),y=a[m?g==="floating"?"reference":"floating":g],x=Jn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=g==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Jn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(x.top-C.top+v.top)/S.y,bottom:(C.bottom-x.bottom+v.bottom)/S.y,left:(x.left-C.left+v.left)/S.x,right:(C.right-x.right+v.right)/S.x}}const km=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=ut(e,t)||{};if(u==null)return{};const g=Qa(d),m={x:n,y:r},f=rs(o),v=ns(f),p=await i.getDimensions(u),y=f==="y",x=y?"top":"left",b=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=s.reference[v]+s.reference[f]-m[f]-s.floating[v],C=m[f]-s.reference[f],N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=N?N[w]:0;(!E||!await(i.isElement==null?void 0:i.isElement(N)))&&(E=a.floating[w]||s.floating[v]);const _=S/2-C/2,j=E/2-p[v]/2-1,L=Et(g[x],j),K=Et(g[b],j),U=L,Z=E-p[v]-K,A=E/2-p[v]/2+_,te=_o(U,A,Z),I=!c.arrow&&sn(o)!=null&&A!==te&&s.reference[v]/2-(A<U?L:K)-p[v]/2<0,Q=I?A<U?A-U:A-Z:0;return{[f]:m[f]+Q,data:{[f]:te,centerOffset:A-te-Q,...I&&{alignmentOffset:Q}},reset:I}}}),Mm=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...y}=ut(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=dt(o),b=Be(a),w=dt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=m||(w||!p?[Yn(a)]:wm(a)),N=v!=="none";!m&&N&&C.push(...Cm(a,p,v,S));const E=[a,...C],_=await xn(t,y),j=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&j.push(_[x]),g){const A=ym(o,i,S);j.push(_[A[0]],_[A[1]])}if(L=[...L,{placement:o,overflows:j}],!j.every(A=>A<=0)){var K,U;const A=(((K=s.flip)==null?void 0:K.index)||0)+1,te=E[A];if(te&&(!(g==="alignment"?b!==Be(te):!1)||L.every(R=>Be(R.placement)===b?R.overflows[0]>0:!0)))return{data:{index:A,overflows:L},reset:{placement:te}};let I=(U=L.filter(Q=>Q.overflows[0]<=0).sort((Q,R)=>Q.overflows[1]-R.overflows[1])[0])==null?void 0:U.placement;if(!I)switch(f){case"bestFit":{var Z;const Q=(Z=L.filter(R=>{if(N){const k=Be(R.placement);return k===b||k==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(k=>k>0).reduce((k,z)=>k+z,0)]).sort((R,k)=>R[1]-k[1])[0])==null?void 0:Z[0];Q&&(I=Q);break}case"initialPlacement":I=a;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function ri(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oi(e){return pm.some(t=>e[t]>=0)}const Nm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ut(e,t);switch(r){case"referenceHidden":{const s=await xn(t,{...o,elementContext:"reference"}),i=ri(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:oi(i)}}}case"escaped":{const s=await xn(t,{...o,altBoundary:!0}),i=ri(s,n.floating);return{data:{escapedOffsets:i,escaped:oi(i)}}}default:return{}}}}},el=new Set(["left","top"]);async function Am(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=dt(n),a=sn(n),c=Be(n)==="y",u=el.has(i)?-1:1,d=s&&c?-1:1,g=ut(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),c?{x:f*d,y:m*u}:{x:m*u,y:f*d}}const Tm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Am(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},jm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...c}=ut(e,t),u={x:n,y:r},d=await xn(t,c),g=Be(dt(o)),m=ts(g);let f=u[m],v=u[g];if(s){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",b=f+d[y],w=f-d[x];f=_o(b,f,w)}if(i){const y=g==="y"?"top":"left",x=g==="y"?"bottom":"right",b=v+d[y],w=v-d[x];v=_o(b,v,w)}const p=a.fn({...t,[m]:f,[g]:v});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[m]:s,[g]:i}}}}}},Im=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=ut(e,t),d={x:n,y:r},g=Be(o),m=ts(g);let f=d[m],v=d[g];const p=ut(a,t),y=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=m==="y"?"height":"width",S=s.reference[m]-s.floating[w]+y.mainAxis,C=s.reference[m]+s.reference[w]-y.mainAxis;f<S?f=S:f>C&&(f=C)}if(u){var x,b;const w=m==="y"?"width":"height",S=el.has(dt(o)),C=s.reference[g]-s.floating[w]+(S&&((x=i.offset)==null?void 0:x[g])||0)+(S?0:y.crossAxis),N=s.reference[g]+s.reference[w]+(S?0:((b=i.offset)==null?void 0:b[g])||0)-(S?y.crossAxis:0);v<C?v=C:v>N&&(v=N)}return{[m]:f,[g]:v}}}},Pm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=ut(e,t),d=await xn(t,u),g=dt(o),m=sn(o),f=Be(o)==="y",{width:v,height:p}=s.floating;let y,x;g==="top"||g==="bottom"?(y=g,x=m===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(x=g,y=m==="end"?"top":"bottom");const b=p-d.top-d.bottom,w=v-d.left-d.right,S=Et(p-d[y],b),C=Et(v-d[x],w),N=!t.middlewareData.shift;let E=S,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=b),N&&!m){const L=Te(d.left,0),K=Te(d.right,0),U=Te(d.top,0),Z=Te(d.bottom,0);f?_=v-2*(L!==0||K!==0?L+K:Te(d.left,d.right)):E=p-2*(U!==0||Z!==0?U+Z:Te(d.top,d.bottom))}await c({...t,availableWidth:_,availableHeight:E});const j=await i.getDimensions(a.floating);return v!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<"u"}function an(e){return tl(e)?(e.nodeName||"").toLowerCase():"#document"}function je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xe(e){var t;return(t=(tl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tl(e){return fr()?e instanceof Node||e instanceof je(e).Node:!1}function $e(e){return fr()?e instanceof Element||e instanceof je(e).Element:!1}function Ze(e){return fr()?e instanceof HTMLElement||e instanceof je(e).HTMLElement:!1}function si(e){return!fr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof je(e).ShadowRoot}const Om=new Set(["inline","contents"]);function En(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Le(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Om.has(o)}const Fm=new Set(["table","td","th"]);function Dm(e){return Fm.has(an(e))}const $m=[":popover-open",":modal"];function mr(e){return $m.some(t=>{try{return e.matches(t)}catch{return!1}})}const Lm=["transform","translate","scale","rotate","perspective"],Vm=["transform","translate","scale","rotate","perspective","filter"],zm=["paint","layout","strict","content"];function os(e){const t=ss(),n=$e(e)?Le(e):e;return Lm.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Vm.some(r=>(n.willChange||"").includes(r))||zm.some(r=>(n.contain||"").includes(r))}function Hm(e){let t=kt(e);for(;Ze(t)&&!Xt(t);){if(os(t))return t;if(mr(t))return null;t=kt(t)}return null}function ss(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Gm=new Set(["html","body","#document"]);function Xt(e){return Gm.has(an(e))}function Le(e){return je(e).getComputedStyle(e)}function gr(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(an(e)==="html")return e;const t=e.assignedSlot||e.parentNode||si(e)&&e.host||Xe(e);return si(t)?t.host:t}function nl(e){const t=kt(e);return Xt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&En(t)?t:nl(t)}function yn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=nl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=je(o);if(s){const a=Co(i);return t.concat(i,i.visualViewport||[],En(o)?o:[],a&&n?yn(a):[])}return t.concat(o,yn(o,[],n))}function Co(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rl(e){const t=Le(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Xn(n)!==s||Xn(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function is(e){return $e(e)?e:e.contextElement}function Zt(e){const t=is(e);if(!Ze(t))return We(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=rl(t);let i=(s?Xn(n.width):n.width)/r,a=(s?Xn(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Um=We(0);function ol(e){const t=je(e);return!ss()||!t.visualViewport?Um:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==je(e)?!1:t}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=is(e);let i=We(1);t&&(r?$e(r)&&(i=Zt(r)):i=Zt(e));const a=Bm(s,n,r)?ol(s):We(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,g=o.height/i.y;if(s){const m=je(s),f=r&&$e(r)?je(r):r;let v=m,p=Co(v);for(;p&&r&&f!==v;){const y=Zt(p),x=p.getBoundingClientRect(),b=Le(p),w=x.left+(p.clientLeft+parseFloat(b.paddingLeft))*y.x,S=x.top+(p.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,g*=y.y,c+=w,u+=S,v=je(p),p=Co(v)}}return Jn({width:d,height:g,x:c,y:u})}function pr(e,t){const n=gr(e).scrollLeft;return t?t.left+n:Pt(Xe(e)).left+n}function sl(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Wm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Xe(r),a=t?mr(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=We(1);const d=We(0),g=Ze(r);if((g||!g&&!s)&&((an(r)!=="body"||En(i))&&(c=gr(r)),Ze(r))){const f=Pt(r);u=Zt(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const m=i&&!g&&!s?sl(i,c):We(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+m.x,y:n.y*u.y-c.scrollTop*u.y+d.y+m.y}}function qm(e){return Array.from(e.getClientRects())}function Zm(e){const t=Xe(e),n=gr(e),r=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+pr(e);const a=-n.scrollTop;return Le(r).direction==="rtl"&&(i+=Te(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const ii=25;function Km(e,t){const n=je(e),r=Xe(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=ss();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=pr(r);if(u<=0){const d=r.ownerDocument,g=d.body,m=getComputedStyle(g),f=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(r.clientWidth-g.clientWidth-f);v<=ii&&(s-=v)}else u<=ii&&(s+=u);return{width:s,height:i,x:a,y:c}}const Xm=new Set(["absolute","fixed"]);function Ym(e,t){const n=Pt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?Zt(e):We(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function ai(e,t,n){let r;if(t==="viewport")r=Km(e,n);else if(t==="document")r=Zm(Xe(e));else if($e(t))r=Ym(t,n);else{const o=ol(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Jn(r)}function il(e,t){const n=kt(e);return n===t||!$e(n)||Xt(n)?!1:Le(n).position==="fixed"||il(n,t)}function Jm(e,t){const n=t.get(e);if(n)return n;let r=yn(e,[],!1).filter(a=>$e(a)&&an(a)!=="body"),o=null;const s=Le(e).position==="fixed";let i=s?kt(e):e;for(;$e(i)&&!Xt(i);){const a=Le(i),c=os(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&Xm.has(o.position)||En(i)&&!c&&il(e,i))?r=r.filter(d=>d!==i):o=a,i=kt(i)}return t.set(e,r),r}function Qm(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?mr(t)?[]:Jm(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,d)=>{const g=ai(t,d,o);return u.top=Te(g.top,u.top),u.right=Et(g.right,u.right),u.bottom=Et(g.bottom,u.bottom),u.left=Te(g.left,u.left),u},ai(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eg(e){const{width:t,height:n}=rl(e);return{width:t,height:n}}function tg(e,t,n){const r=Ze(t),o=Xe(t),s=n==="fixed",i=Pt(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=We(0);function u(){c.x=pr(o)}if(r||!r&&!s)if((an(t)!=="body"||En(o))&&(a=gr(t)),r){const f=Pt(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?sl(o,a):We(0),g=i.left+a.scrollLeft-c.x-d.x,m=i.top+a.scrollTop-c.y-d.y;return{x:g,y:m,width:i.width,height:i.height}}function Br(e){return Le(e).position==="static"}function li(e,t){if(!Ze(e)||Le(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Xe(e)===n&&(n=n.ownerDocument.body),n}function al(e,t){const n=je(e);if(mr(e))return n;if(!Ze(e)){let o=kt(e);for(;o&&!Xt(o);){if($e(o)&&!Br(o))return o;o=kt(o)}return n}let r=li(e,t);for(;r&&Dm(r)&&Br(r);)r=li(r,t);return r&&Xt(r)&&Br(r)&&!os(r)?n:r||Hm(e)||n}const ng=async function(e){const t=this.getOffsetParent||al,n=this.getDimensions,r=await n(e.floating);return{reference:tg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rg(e){return Le(e).direction==="rtl"}const og={convertOffsetParentRelativeRectToViewportRelativeRect:Wm,getDocumentElement:Xe,getClippingRect:Qm,getOffsetParent:al,getElementRects:ng,getClientRects:qm,getDimensions:eg,getScale:Zt,isElement:$e,isRTL:rg};function ll(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sg(e,t){let n=null,r;const o=Xe(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:g,width:m,height:f}=u;if(a||t(),!m||!f)return;const v=$n(g),p=$n(o.clientWidth-(d+m)),y=$n(o.clientHeight-(g+f)),x=$n(d),w={rootMargin:-v+"px "+-p+"px "+-y+"px "+-x+"px",threshold:Te(0,Et(1,c))||1};let S=!0;function C(N){const E=N[0].intersectionRatio;if(E!==c){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!ll(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return i(!0),s}function ig(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=is(e),d=o||s?[...u?yn(u):[],...yn(t)]:[];d.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const g=u&&a?sg(u,n):null;let m=-1,f=null;i&&(f=new ResizeObserver(x=>{let[b]=x;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let v,p=c?Pt(e):null;c&&y();function y(){const x=Pt(e);p&&!ll(p,x)&&n(),p=x,v=requestAnimationFrame(y)}return n(),()=>{var x;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),g==null||g(),(x=f)==null||x.disconnect(),f=null,c&&cancelAnimationFrame(v)}}const ag=Tm,lg=jm,cg=Mm,ug=Pm,dg=Nm,ci=km,fg=Im,mg=(e,t,n)=>{const r=new Map,o={platform:og,...n},s={...o.platform,_c:r};return Em(e,t,{...o,platform:s})};var gg=typeof document<"u",pg=function(){},Wn=gg?h.useLayoutEffect:pg;function Qn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Qn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cl(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ui(e,t){const n=cl(e);return Math.round(t*n)/n}function Wr(e){const t=h.useRef(e);return Wn(()=>{t.current=e}),t}function hg(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=h.useState(r);Qn(m,r)||f(r);const[v,p]=h.useState(null),[y,x]=h.useState(null),b=h.useCallback(R=>{R!==N.current&&(N.current=R,p(R))},[]),w=h.useCallback(R=>{R!==E.current&&(E.current=R,x(R))},[]),S=s||v,C=i||y,N=h.useRef(null),E=h.useRef(null),_=h.useRef(d),j=c!=null,L=Wr(c),K=Wr(o),U=Wr(u),Z=h.useCallback(()=>{if(!N.current||!E.current)return;const R={placement:t,strategy:n,middleware:m};K.current&&(R.platform=K.current),mg(N.current,E.current,R).then(k=>{const z={...k,isPositioned:U.current!==!1};A.current&&!Qn(_.current,z)&&(_.current=z,Wo.flushSync(()=>{g(z)}))})},[m,t,n,K,U]);Wn(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,g(R=>({...R,isPositioned:!1})))},[u]);const A=h.useRef(!1);Wn(()=>(A.current=!0,()=>{A.current=!1}),[]),Wn(()=>{if(S&&(N.current=S),C&&(E.current=C),S&&C){if(L.current)return L.current(S,C,Z);Z()}},[S,C,Z,L,j]);const te=h.useMemo(()=>({reference:N,floating:E,setReference:b,setFloating:w}),[b,w]),I=h.useMemo(()=>({reference:S,floating:C}),[S,C]),Q=h.useMemo(()=>{const R={position:n,left:0,top:0};if(!I.floating)return R;const k=ui(I.floating,d.x),z=ui(I.floating,d.y);return a?{...R,transform:"translate("+k+"px, "+z+"px)",...cl(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:z}},[n,a,I.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:Z,refs:te,elements:I,floatingStyles:Q}),[d,Z,te,I,Q])}const vg=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ci({element:r.current,padding:o}).fn(n):{}:r?ci({element:r,padding:o}).fn(n):{}}}},xg=(e,t)=>({...ag(e),options:[e,t]}),yg=(e,t)=>({...lg(e),options:[e,t]}),wg=(e,t)=>({...fg(e),options:[e,t]}),bg=(e,t)=>({...cg(e),options:[e,t]}),_g=(e,t)=>({...ug(e),options:[e,t]}),Sg=(e,t)=>({...dg(e),options:[e,t]}),Cg=(e,t)=>({...vg(e),options:[e,t]});var Rg="Arrow",ul=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(fe.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});ul.displayName=Rg;var Eg=ul,as="Popper",[dl,fl]=Dt(as),[kg,ml]=dl(as),gl=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return l.jsx(kg,{scope:t,anchor:r,onAnchorChange:o,children:n})};gl.displayName=as;var pl="PopperAnchor",hl=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ml(pl,n),i=h.useRef(null),a=Ee(t,i),c=h.useRef(null);return h.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(fe.div,{...o,ref:a})});hl.displayName=pl;var ls="PopperContent",[Mg,Ng]=dl(ls),vl=h.forwardRef((e,t)=>{var ne,ze,xe,Se,Je,gt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:v,...p}=e,y=ml(ls,n),[x,b]=h.useState(null),w=Ee(t,re=>b(re)),[S,C]=h.useState(null),N=ya(S),E=(N==null?void 0:N.width)??0,_=(N==null?void 0:N.height)??0,j=r+(s!=="center"?"-"+s:""),L=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},K=Array.isArray(u)?u:[u],U=K.length>0,Z={padding:L,boundary:K.filter(Tg),altBoundary:U},{refs:A,floatingStyles:te,placement:I,isPositioned:Q,middlewareData:R}=hg({strategy:"fixed",placement:j,whileElementsMounted:(...re)=>ig(...re,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[xg({mainAxis:o+_,alignmentAxis:i}),c&&yg({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?wg():void 0,...Z}),c&&bg({...Z}),_g({...Z,apply:({elements:re,rects:ue,availableWidth:he,availableHeight:le})=>{const{width:Ae,height:pt}=ue.reference,ge=re.floating.style;ge.setProperty("--radix-popper-available-width",`${he}px`),ge.setProperty("--radix-popper-available-height",`${le}px`),ge.setProperty("--radix-popper-anchor-width",`${Ae}px`),ge.setProperty("--radix-popper-anchor-height",`${pt}px`)}}),S&&Cg({element:S,padding:a}),jg({arrowWidth:E,arrowHeight:_}),m&&Sg({strategy:"referenceHidden",...Z})]}),[k,z]=wl(I),V=ct(v);Ct(()=>{Q&&(V==null||V())},[Q,V]);const ee=(ne=R.arrow)==null?void 0:ne.x,se=(ze=R.arrow)==null?void 0:ze.y,ce=((xe=R.arrow)==null?void 0:xe.centerOffset)!==0,[be,_e]=h.useState();return Ct(()=>{x&&_e(window.getComputedStyle(x).zIndex)},[x]),l.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:Q?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(Se=R.transformOrigin)==null?void 0:Se.x,(Je=R.transformOrigin)==null?void 0:Je.y].join(" "),...((gt=R.hide)==null?void 0:gt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Mg,{scope:n,placedSide:k,onArrowChange:C,arrowX:ee,arrowY:se,shouldHideArrow:ce,children:l.jsx(fe.div,{"data-side":k,"data-align":z,...p,ref:w,style:{...p.style,animation:Q?void 0:"none"}})})})});vl.displayName=ls;var xl="PopperArrow",Ag={top:"bottom",right:"left",bottom:"top",left:"right"},yl=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Ng(xl,r),i=Ag[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(Eg,{...o,ref:n,style:{...o.style,display:"block"}})})});yl.displayName=xl;function Tg(e){return e!==null}var jg=e=>({name:"transformOrigin",options:e,fn(t){var y,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=wl(n),g={start:"0%",center:"50%",end:"100%"}[d],m=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,f=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let v="",p="";return u==="bottom"?(v=i?g:`${m}px`,p=`${-c}px`):u==="top"?(v=i?g:`${m}px`,p=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,p=i?g:`${f}px`):u==="left"&&(v=`${r.floating.width+c}px`,p=i?g:`${f}px`),{data:{x:v,y:p}}}});function wl(e){const[t,n="center"]=e.split("-");return[t,n]}var Ig=gl,Pg=hl,Og=vl,Fg=yl,Dg="Portal",bl=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=h.useState(!1);Ct(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?od.createPortal(l.jsx(fe.div,{...r,ref:t}),i):null});bl.displayName=Dg;var qr="rovingFocusGroup.onEntryFocus",$g={bubbles:!1,cancelable:!0},kn="RovingFocusGroup",[Ro,_l,Lg]=qa(kn),[Vg,hr]=Dt(kn,[Lg]),[zg,Hg]=Vg(kn),Sl=h.forwardRef((e,t)=>l.jsx(Ro.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Ro.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Gg,{...e,ref:t})})}));Sl.displayName=kn;var Gg=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...g}=e,m=h.useRef(null),f=Ee(t,m),v=es(s),[p,y]=cr({prop:i,defaultProp:a??null,onChange:c,caller:kn}),[x,b]=h.useState(!1),w=ct(u),S=_l(n),C=h.useRef(!1),[N,E]=h.useState(0);return h.useEffect(()=>{const _=m.current;if(_)return _.addEventListener(qr,w),()=>_.removeEventListener(qr,w)},[w]),l.jsx(zg,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:p,onItemFocus:h.useCallback(_=>y(_),[y]),onItemShiftTab:h.useCallback(()=>b(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(_=>_+1),[]),onFocusableItemRemove:h.useCallback(()=>E(_=>_-1),[]),children:l.jsx(fe.div,{tabIndex:x||N===0?-1:0,"data-orientation":r,...g,ref:f,style:{outline:"none",...e.style},onMouseDown:J(e.onMouseDown,()=>{C.current=!0}),onFocus:J(e.onFocus,_=>{const j=!C.current;if(_.target===_.currentTarget&&j&&!x){const L=new CustomEvent(qr,$g);if(_.currentTarget.dispatchEvent(L),!L.defaultPrevented){const K=S().filter(I=>I.focusable),U=K.find(I=>I.active),Z=K.find(I=>I.id===p),te=[U,Z,...K].filter(Boolean).map(I=>I.ref.current);El(te,d)}}C.current=!1}),onBlur:J(e.onBlur,()=>b(!1))})})}),Cl="RovingFocusGroupItem",Rl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Kn(),u=s||c,d=Hg(Cl,n),g=d.currentTabStopId===u,m=_l(n),{onFocusableItemAdd:f,onFocusableItemRemove:v,currentTabStopId:p}=d;return h.useEffect(()=>{if(r)return f(),()=>v()},[r,f,v]),l.jsx(Ro.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(fe.span,{tabIndex:g?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:J(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:J(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:J(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=Wg(y,d.orientation,d.dir);if(x!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(y.currentTarget);w=d.loop?qg(w,S+1):w.slice(S+1)}setTimeout(()=>El(w))}}),children:typeof i=="function"?i({isCurrentTabStop:g,hasTabStop:p!=null}):i})})});Rl.displayName=Cl;var Ug={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bg(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Wg(e,t,n){const r=Bg(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ug[r]}function El(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kl=Sl,Ml=Rl,Zg=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ht=new WeakMap,Ln=new WeakMap,Vn={},Zr=0,Nl=function(e){return e&&(e.host||Nl(e.parentNode))},Kg=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Nl(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Xg=function(e,t,n,r){var o=Kg(t,Array.isArray(e)?e:[e]);Vn[n]||(Vn[n]=new WeakMap);var s=Vn[n],i=[],a=new Set,c=new Set(o),u=function(g){!g||a.has(g)||(a.add(g),u(g.parentNode))};o.forEach(u);var d=function(g){!g||c.has(g)||Array.prototype.forEach.call(g.children,function(m){if(a.has(m))d(m);else try{var f=m.getAttribute(r),v=f!==null&&f!=="false",p=(Ht.get(m)||0)+1,y=(s.get(m)||0)+1;Ht.set(m,p),s.set(m,y),i.push(m),p===1&&v&&Ln.set(m,!0),y===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return d(t),a.clear(),Zr++,function(){i.forEach(function(g){var m=Ht.get(g)-1,f=s.get(g)-1;Ht.set(g,m),s.set(g,f),m||(Ln.has(g)||g.removeAttribute(r),Ln.delete(g)),f||g.removeAttribute(n)}),Zr--,Zr||(Ht=new WeakMap,Ht=new WeakMap,Ln=new WeakMap,Vn={})}},Yg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Zg(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Xg(r,o,n,"aria-hidden")):function(){return null}},Ue=function(){return Ue=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ue.apply(this,arguments)};function Al(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Jg(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var qn="right-scroll-bar-position",Zn="width-before-scroll-bar",Qg="with-scroll-bars-hidden",ep="--removed-body-scroll-bar-size";function Kr(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tp(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var np=typeof window<"u"?h.useLayoutEffect:h.useEffect,di=new WeakMap;function rp(e,t){var n=tp(null,function(r){return e.forEach(function(o){return Kr(o,r)})});return np(function(){var r=di.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Kr(a,null)}),s.forEach(function(a){o.has(a)||Kr(a,i)})}di.set(n,e)},[e]),n}function op(e){return e}function sp(e,t){t===void 0&&(t=op);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function ip(e){e===void 0&&(e={});var t=sp(null);return t.options=Ue({async:!0,ssr:!1},e),t}var Tl=function(e){var t=e.sideCar,n=Al(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Ue({},n))};Tl.isSideCarExport=!0;function ap(e,t){return e.useMedium(t),Tl}var jl=ip(),Xr=function(){},vr=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Xr,onWheelCapture:Xr,onTouchMoveCapture:Xr}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,g=e.shards,m=e.sideCar,f=e.noRelative,v=e.noIsolation,p=e.inert,y=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,S=Al(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=m,N=rp([n,t]),E=Ue(Ue({},S),o);return h.createElement(h.Fragment,null,d&&h.createElement(C,{sideCar:jl,removeScrollBar:u,shards:g,noRelative:f,noIsolation:v,inert:p,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:w}),i?h.cloneElement(h.Children.only(a),Ue(Ue({},E),{ref:N})):h.createElement(b,Ue({},E,{className:c,ref:N}),a))});vr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vr.classNames={fullWidth:Zn,zeroRight:qn};var lp=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cp(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lp();return t&&e.setAttribute("nonce",t),e}function up(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dp(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fp=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cp())&&(up(t,n),dp(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mp=function(){var e=fp();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Il=function(){var e=mp(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},gp={left:0,top:0,right:0,gap:0},Yr=function(e){return parseInt(e||"",10)||0},pp=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Yr(n),Yr(r),Yr(o)]},hp=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gp;var t=pp(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vp=Il(),Kt="data-scroll-locked",xp=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
106
|
-
.`.concat(Qg,` {
|
|
107
|
-
overflow: hidden `).concat(r,`;
|
|
108
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
109
|
-
}
|
|
110
|
-
body[`).concat(Kt,`] {
|
|
111
|
-
overflow: hidden `).concat(r,`;
|
|
112
|
-
overscroll-behavior: contain;
|
|
113
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
114
|
-
padding-left: `.concat(o,`px;
|
|
115
|
-
padding-top: `).concat(s,`px;
|
|
116
|
-
padding-right: `).concat(i,`px;
|
|
117
|
-
margin-left:0;
|
|
118
|
-
margin-top:0;
|
|
119
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
120
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.`).concat(qn,` {
|
|
124
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.`).concat(Zn,` {
|
|
128
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.`).concat(qn," .").concat(qn,` {
|
|
132
|
-
right: 0 `).concat(r,`;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.`).concat(Zn," .").concat(Zn,` {
|
|
136
|
-
margin-right: 0 `).concat(r,`;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
body[`).concat(Kt,`] {
|
|
140
|
-
`).concat(ep,": ").concat(a,`px;
|
|
141
|
-
}
|
|
142
|
-
`)},fi=function(){var e=parseInt(document.body.getAttribute(Kt)||"0",10);return isFinite(e)?e:0},yp=function(){h.useEffect(function(){return document.body.setAttribute(Kt,(fi()+1).toString()),function(){var e=fi()-1;e<=0?document.body.removeAttribute(Kt):document.body.setAttribute(Kt,e.toString())}},[])},wp=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;yp();var s=h.useMemo(function(){return hp(o)},[o]);return h.createElement(vp,{styles:xp(s,!t,o,n?"":"!important")})},Eo=!1;if(typeof window<"u")try{var zn=Object.defineProperty({},"passive",{get:function(){return Eo=!0,!0}});window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Eo=!1}var Gt=Eo?{passive:!1}:!1,bp=function(e){return e.tagName==="TEXTAREA"},Pl=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bp(e)&&n[t]==="visible")},_p=function(e){return Pl(e,"overflowY")},Sp=function(e){return Pl(e,"overflowX")},mi=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ol(e,r);if(o){var s=Fl(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Cp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Rp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ol=function(e,t){return e==="v"?_p(t):Sp(t)},Fl=function(e,t){return e==="v"?Cp(t):Rp(t)},Ep=function(e,t){return e==="h"&&t==="rtl"?-1:1},kp=function(e,t,n,r,o){var s=Ep(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,g=0,m=0;do{if(!a)break;var f=Fl(e,a),v=f[0],p=f[1],y=f[2],x=p-y-s*v;(v||x)&&Ol(e,a)&&(g+=x,m+=v);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(g)<1||!d&&Math.abs(m)<1)&&(u=!0),u},Hn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gi=function(e){return[e.deltaX,e.deltaY]},pi=function(e){return e&&"current"in e?e.current:e},Mp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Np=function(e){return`
|
|
143
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
144
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
145
|
-
`)},Ap=0,Ut=[];function Tp(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Ap++)[0],s=h.useState(Il)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=Jg([e.lockRef.current],(e.shards||[]).map(pi),!0).filter(Boolean);return p.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(p,y){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var x=Hn(p),b=n.current,w="deltaX"in p?p.deltaX:b[0]-x[0],S="deltaY"in p?p.deltaY:b[1]-x[1],C,N=p.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in p&&E==="h"&&N.type==="range")return!1;var _=mi(E,N);if(!_)return!0;if(_?C=E:(C=E==="v"?"h":"v",_=mi(E,N)),!_)return!1;if(!r.current&&"changedTouches"in p&&(w||S)&&(r.current=C),!C)return!0;var j=r.current||C;return kp(j,y,p,j==="h"?w:S)},[]),c=h.useCallback(function(p){var y=p;if(!(!Ut.length||Ut[Ut.length-1]!==s)){var x="deltaY"in y?gi(y):Hn(y),b=t.current.filter(function(C){return C.name===y.type&&(C.target===y.target||y.target===C.shadowParent)&&Mp(C.delta,x)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var w=(i.current.shards||[]).map(pi).filter(Boolean).filter(function(C){return C.contains(y.target)}),S=w.length>0?a(y,w[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=h.useCallback(function(p,y,x,b){var w={name:p,delta:y,target:x,should:b,shadowParent:jp(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=h.useCallback(function(p){n.current=Hn(p),r.current=void 0},[]),g=h.useCallback(function(p){u(p.type,gi(p),p.target,a(p,e.lockRef.current))},[]),m=h.useCallback(function(p){u(p.type,Hn(p),p.target,a(p,e.lockRef.current))},[]);h.useEffect(function(){return Ut.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Gt),document.addEventListener("touchmove",c,Gt),document.addEventListener("touchstart",d,Gt),function(){Ut=Ut.filter(function(p){return p!==s}),document.removeEventListener("wheel",c,Gt),document.removeEventListener("touchmove",c,Gt),document.removeEventListener("touchstart",d,Gt)}},[]);var f=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Np(o)}):null,f?h.createElement(wp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jp(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ip=ap(jl,Tp);var Dl=h.forwardRef(function(e,t){return h.createElement(vr,Ue({},e,{ref:t,sideCar:Ip}))});Dl.classNames=vr.classNames;var ko=["Enter"," "],Pp=["ArrowDown","PageUp","Home"],$l=["ArrowUp","PageDown","End"],Op=[...Pp,...$l],Fp={ltr:[...ko,"ArrowRight"],rtl:[...ko,"ArrowLeft"]},Dp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mn="Menu",[wn,$p,Lp]=qa(Mn),[Lt,Ll]=Dt(Mn,[Lp,fl,hr]),xr=fl(),Vl=hr(),[Vp,Vt]=Lt(Mn),[zp,Nn]=Lt(Mn),zl=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=xr(t),[c,u]=h.useState(null),d=h.useRef(!1),g=ct(s),m=es(o);return h.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),l.jsx(Ig,{...a,children:l.jsx(Vp,{scope:t,open:n,onOpenChange:g,content:c,onContentChange:u,children:l.jsx(zp,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:d,dir:m,modal:i,children:r})})})};zl.displayName=Mn;var Hp="MenuAnchor",cs=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=xr(n);return l.jsx(Pg,{...o,...r,ref:t})});cs.displayName=Hp;var us="MenuPortal",[Gp,Hl]=Lt(us,{forceMount:void 0}),Gl=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Vt(us,t);return l.jsx(Gp,{scope:t,forceMount:n,children:l.jsx($t,{present:n||s.open,children:l.jsx(bl,{asChild:!0,container:o,children:r})})})};Gl.displayName=us;var Oe="MenuContent",[Up,ds]=Lt(Oe),Ul=h.forwardRef((e,t)=>{const n=Hl(Oe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vt(Oe,e.__scopeMenu),i=Nn(Oe,e.__scopeMenu);return l.jsx(wn.Provider,{scope:e.__scopeMenu,children:l.jsx($t,{present:r||s.open,children:l.jsx(wn.Slot,{scope:e.__scopeMenu,children:i.modal?l.jsx(Bp,{...o,ref:t}):l.jsx(Wp,{...o,ref:t})})})})}),Bp=h.forwardRef((e,t)=>{const n=Vt(Oe,e.__scopeMenu),r=h.useRef(null),o=Ee(t,r);return h.useEffect(()=>{const s=r.current;if(s)return Yg(s)},[]),l.jsx(fs,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:J(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Wp=h.forwardRef((e,t)=>{const n=Vt(Oe,e.__scopeMenu);return l.jsx(fs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qp=vn("MenuContent.ScrollLock"),fs=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,onDismiss:f,disableOutsideScroll:v,...p}=e,y=Vt(Oe,n),x=Nn(Oe,n),b=xr(n),w=Vl(n),S=$p(n),[C,N]=h.useState(null),E=h.useRef(null),_=Ee(t,E,y.onContentChange),j=h.useRef(0),L=h.useRef(""),K=h.useRef(0),U=h.useRef(null),Z=h.useRef("right"),A=h.useRef(0),te=v?Dl:h.Fragment,I=v?{as:qp,allowPinchZoom:!0}:void 0,Q=k=>{var ne,ze;const z=L.current+k,V=S().filter(xe=>!xe.disabled),ee=document.activeElement,se=(ne=V.find(xe=>xe.ref.current===ee))==null?void 0:ne.textValue,ce=V.map(xe=>xe.textValue),be=sh(ce,z,se),_e=(ze=V.find(xe=>xe.textValue===be))==null?void 0:ze.ref.current;(function xe(Se){L.current=Se,window.clearTimeout(j.current),Se!==""&&(j.current=window.setTimeout(()=>xe(""),1e3))})(z),_e&&setTimeout(()=>_e.focus())};h.useEffect(()=>()=>window.clearTimeout(j.current),[]),sm();const R=h.useCallback(k=>{var V,ee;return Z.current===((V=U.current)==null?void 0:V.side)&&ah(k,(ee=U.current)==null?void 0:ee.area)},[]);return l.jsx(Up,{scope:n,searchRef:L,onItemEnter:h.useCallback(k=>{R(k)&&k.preventDefault()},[R]),onItemLeave:h.useCallback(k=>{var z;R(k)||((z=E.current)==null||z.focus(),N(null))},[R]),onTriggerLeave:h.useCallback(k=>{R(k)&&k.preventDefault()},[R]),pointerGraceTimerRef:K,onPointerGraceIntentChange:h.useCallback(k=>{U.current=k},[]),children:l.jsx(te,{...I,children:l.jsx(Ya,{asChild:!0,trapped:o,onMountAutoFocus:J(s,k=>{var z;k.preventDefault(),(z=E.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:l.jsx(Ka,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:g,onInteractOutside:m,onDismiss:f,children:l.jsx(kl,{asChild:!0,...w,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:J(c,k=>{x.isUsingKeyboardRef.current||k.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(Og,{role:"menu","aria-orientation":"vertical","data-state":ic(y.open),"data-radix-menu-content":"",dir:x.dir,...b,...p,ref:_,style:{outline:"none",...p.style},onKeyDown:J(p.onKeyDown,k=>{const V=k.target.closest("[data-radix-menu-content]")===k.currentTarget,ee=k.ctrlKey||k.altKey||k.metaKey,se=k.key.length===1;V&&(k.key==="Tab"&&k.preventDefault(),!ee&&se&&Q(k.key));const ce=E.current;if(k.target!==ce||!Op.includes(k.key))return;k.preventDefault();const _e=S().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);$l.includes(k.key)&&_e.reverse(),rh(_e)}),onBlur:J(e.onBlur,k=>{k.currentTarget.contains(k.target)||(window.clearTimeout(j.current),L.current="")}),onPointerMove:J(e.onPointerMove,bn(k=>{const z=k.target,V=A.current!==k.clientX;if(k.currentTarget.contains(z)&&V){const ee=k.clientX>A.current?"right":"left";Z.current=ee,A.current=k.clientX}}))})})})})})})});Ul.displayName=Oe;var Zp="MenuGroup",ms=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{role:"group",...r,ref:t})});ms.displayName=Zp;var Kp="MenuLabel",Bl=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{...r,ref:t})});Bl.displayName=Kp;var er="MenuItem",hi="menu.itemSelect",yr=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=h.useRef(null),i=Nn(er,e.__scopeMenu),a=ds(er,e.__scopeMenu),c=Ee(t,s),u=h.useRef(!1),d=()=>{const g=s.current;if(!n&&g){const m=new CustomEvent(hi,{bubbles:!0,cancelable:!0});g.addEventListener(hi,f=>r==null?void 0:r(f),{once:!0}),ba(g,m),m.defaultPrevented?u.current=!1:i.onClose()}};return l.jsx(Wl,{...o,ref:c,disabled:n,onClick:J(e.onClick,d),onPointerDown:g=>{var m;(m=e.onPointerDown)==null||m.call(e,g),u.current=!0},onPointerUp:J(e.onPointerUp,g=>{var m;u.current||(m=g.currentTarget)==null||m.click()}),onKeyDown:J(e.onKeyDown,g=>{const m=a.searchRef.current!=="";n||m&&g.key===" "||ko.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});yr.displayName=er;var Wl=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=ds(er,n),a=Vl(n),c=h.useRef(null),u=Ee(t,c),[d,g]=h.useState(!1),[m,f]=h.useState("");return h.useEffect(()=>{const v=c.current;v&&f((v.textContent??"").trim())},[s.children]),l.jsx(wn.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:l.jsx(Ml,{asChild:!0,...a,focusable:!r,children:l.jsx(fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:J(e.onPointerMove,bn(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:J(e.onPointerLeave,bn(v=>i.onItemLeave(v))),onFocus:J(e.onFocus,()=>g(!0)),onBlur:J(e.onBlur,()=>g(!1))})})})}),Xp="MenuCheckboxItem",ql=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return l.jsx(Jl,{scope:e.__scopeMenu,checked:n,children:l.jsx(yr,{role:"menuitemcheckbox","aria-checked":tr(n)?"mixed":n,...o,ref:t,"data-state":ps(n),onSelect:J(o.onSelect,()=>r==null?void 0:r(tr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ql.displayName=Xp;var Zl="MenuRadioGroup",[Yp,Jp]=Lt(Zl,{value:void 0,onValueChange:()=>{}}),Kl=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=ct(r);return l.jsx(Yp,{scope:e.__scopeMenu,value:n,onValueChange:s,children:l.jsx(ms,{...o,ref:t})})});Kl.displayName=Zl;var Xl="MenuRadioItem",Yl=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=Jp(Xl,e.__scopeMenu),s=n===o.value;return l.jsx(Jl,{scope:e.__scopeMenu,checked:s,children:l.jsx(yr,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":ps(s),onSelect:J(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Yl.displayName=Xl;var gs="MenuItemIndicator",[Jl,Qp]=Lt(gs,{checked:!1}),Ql=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Qp(gs,n);return l.jsx($t,{present:r||tr(s.checked)||s.checked===!0,children:l.jsx(fe.span,{...o,ref:t,"data-state":ps(s.checked)})})});Ql.displayName=gs;var eh="MenuSeparator",ec=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return l.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});ec.displayName=eh;var th="MenuArrow",tc=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=xr(n);return l.jsx(Fg,{...o,...r,ref:t})});tc.displayName=th;var nh="MenuSub",[Ex,nc]=Lt(nh),dn="MenuSubTrigger",rc=h.forwardRef((e,t)=>{const n=Vt(dn,e.__scopeMenu),r=Nn(dn,e.__scopeMenu),o=nc(dn,e.__scopeMenu),s=ds(dn,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const g=a.current;return()=>{window.clearTimeout(g),c(null)}},[a,c]),l.jsx(cs,{asChild:!0,...u,children:l.jsx(Wl,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":ic(n.open),...e,ref:lr(t,o.onTriggerChange),onClick:g=>{var m;(m=e.onClick)==null||m.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:J(e.onPointerMove,bn(g=>{s.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:J(e.onPointerLeave,bn(g=>{var f,v;d();const m=(f=n.content)==null?void 0:f.getBoundingClientRect();if(m){const p=(v=n.content)==null?void 0:v.dataset.side,y=p==="right",x=y?-5:5,b=m[y?"left":"right"],w=m[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:b,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x:b,y:m.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(g),g.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:J(e.onKeyDown,g=>{var f;const m=s.searchRef.current!=="";e.disabled||m&&g.key===" "||Fp[r.dir].includes(g.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),g.preventDefault())})})})});rc.displayName=dn;var oc="MenuSubContent",sc=h.forwardRef((e,t)=>{const n=Hl(Oe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Vt(Oe,e.__scopeMenu),i=Nn(Oe,e.__scopeMenu),a=nc(oc,e.__scopeMenu),c=h.useRef(null),u=Ee(t,c);return l.jsx(wn.Provider,{scope:e.__scopeMenu,children:l.jsx($t,{present:r||s.open,children:l.jsx(wn.Slot,{scope:e.__scopeMenu,children:l.jsx(fs,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var g;i.isUsingKeyboardRef.current&&((g=c.current)==null||g.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:J(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:J(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:J(e.onKeyDown,d=>{var f;const g=d.currentTarget.contains(d.target),m=Dp[i.dir].includes(d.key);g&&m&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),d.preventDefault())})})})})})});sc.displayName=oc;function ic(e){return e?"open":"closed"}function tr(e){return e==="indeterminate"}function ps(e){return tr(e)?"indeterminate":e?"checked":"unchecked"}function rh(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function oh(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sh(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=oh(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function ih(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,g=c.x,m=c.y;d>r!=m>r&&n<(g-u)*(r-d)/(m-d)+u&&(o=!o)}return o}function ah(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ih(n,t)}function bn(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lh=zl,ch=cs,uh=Gl,dh=Ul,fh=ms,mh=Bl,gh=yr,ph=ql,hh=Kl,vh=Yl,xh=Ql,yh=ec,wh=tc,bh=rc,_h=sc,wr="DropdownMenu",[Sh]=Dt(wr,[Ll]),Ne=Ll(),[Ch,ac]=Sh(wr),lc=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=Ne(t),u=h.useRef(null),[d,g]=cr({prop:o,defaultProp:s??!1,onChange:i,caller:wr});return l.jsx(Ch,{scope:t,triggerId:Kn(),triggerRef:u,contentId:Kn(),open:d,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(m=>!m),[g]),modal:a,children:l.jsx(lh,{...c,open:d,onOpenChange:g,dir:r,modal:a,children:n})})};lc.displayName=wr;var cc="DropdownMenuTrigger",uc=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=ac(cc,n),i=Ne(n);return l.jsx(ch,{asChild:!0,...i,children:l.jsx(fe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:lr(t,s.triggerRef),onPointerDown:J(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:J(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});uc.displayName=cc;var Rh="DropdownMenuPortal",dc=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ne(t);return l.jsx(uh,{...r,...n})};dc.displayName=Rh;var fc="DropdownMenuContent",mc=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ac(fc,n),s=Ne(n),i=h.useRef(!1);return l.jsx(dh,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:J(e.onCloseAutoFocus,a=>{var c;i.current||(c=o.triggerRef.current)==null||c.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:J(e.onInteractOutside,a=>{const c=a.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!o.modal||d)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mc.displayName=fc;var Eh="DropdownMenuGroup",kh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(fh,{...o,...r,ref:t})});kh.displayName=Eh;var Mh="DropdownMenuLabel",Nh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(mh,{...o,...r,ref:t})});Nh.displayName=Mh;var Ah="DropdownMenuItem",Th=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(gh,{...o,...r,ref:t})});Th.displayName=Ah;var jh="DropdownMenuCheckboxItem",gc=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(ph,{...o,...r,ref:t})});gc.displayName=jh;var Ih="DropdownMenuRadioGroup",Ph=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(hh,{...o,...r,ref:t})});Ph.displayName=Ih;var Oh="DropdownMenuRadioItem",Fh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(vh,{...o,...r,ref:t})});Fh.displayName=Oh;var Dh="DropdownMenuItemIndicator",pc=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(xh,{...o,...r,ref:t})});pc.displayName=Dh;var $h="DropdownMenuSeparator",Lh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(yh,{...o,...r,ref:t})});Lh.displayName=$h;var Vh="DropdownMenuArrow",zh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(wh,{...o,...r,ref:t})});zh.displayName=Vh;var Hh="DropdownMenuSubTrigger",Gh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(bh,{...o,...r,ref:t})});Gh.displayName=Hh;var Uh="DropdownMenuSubContent",Bh=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ne(n);return l.jsx(_h,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Bh.displayName=Uh;var Wh=lc,qh=uc,Zh=dc,Kh=mc,Xh=gc,Yh=pc;function Jh({...e}){return l.jsx(Wh,{"data-slot":"dropdown-menu",...e})}function Qh({...e}){return l.jsx(qh,{"data-slot":"dropdown-menu-trigger",...e})}function ev({className:e,sideOffset:t=4,...n}){return l.jsx(Zh,{children:l.jsx(Kh,{"data-slot":"dropdown-menu-content",sideOffset:t,className:de("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function tv({className:e,children:t,checked:n,...r}){return l.jsxs(Xh,{"data-slot":"dropdown-menu-checkbox-item",className:de("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[l.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:l.jsx(Yh,{children:l.jsx(Ta,{className:"size-4"})})}),t]})}function hs({className:e,...t}){return l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:l.jsx("table",{"data-slot":"table",className:de("w-full caption-bottom text-sm",e),...t})})}function nv({className:e,...t}){return l.jsx("thead",{"data-slot":"table-header",className:de("[&_tr]:border-b",e),...t})}function vs({className:e,...t}){return l.jsx("tbody",{"data-slot":"table-body",className:de("[&_tr:last-child]:border-0",e),...t})}function we({className:e,...t}){return l.jsx("tr",{"data-slot":"table-row",className:de("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function rv({className:e,...t}){return l.jsx("th",{"data-slot":"table-head",className:de("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function $({className:e,...t}){return l.jsx("td",{"data-slot":"table-cell",className:de("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function br({columns:e,data:t,searchColumn:n,searchPlaceholder:r="Filter...",defaultColumnVisibility:o={},pageSize:s=25,defaultSorting:i=[]}){var y,x;const[a,c]=h.useState(i),[u,d]=h.useState([]),[g,m]=h.useState(o),[f,v]=h.useState({}),p=Zf({data:t,columns:e,onSortingChange:c,onColumnFiltersChange:d,getCoreRowModel:Df(),getPaginationRowModel:Gf(),getSortedRowModel:Uf(),getFilteredRowModel:Hf(),onColumnVisibilityChange:m,onRowSelectionChange:v,initialState:{pagination:{pageSize:s}},state:{sorting:a,columnFilters:u,columnVisibility:g,rowSelection:f}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("div",{className:"flex items-center py-4",children:[n&&l.jsx(po,{placeholder:r,value:((y=p.getColumn(n))==null?void 0:y.getFilterValue())??"",onChange:b=>{var w;return(w=p.getColumn(n))==null?void 0:w.setFilterValue(b.target.value)},className:"max-w-sm"}),l.jsxs(Jh,{children:[l.jsx(Qh,{asChild:!0,children:l.jsxs(jt,{variant:"outline",className:"ml-auto",children:["Columns ",l.jsx(ja,{className:"ml-2 h-4 w-4"})]})}),l.jsx(ev,{align:"end",children:p.getAllColumns().filter(b=>b.getCanHide()).map(b=>l.jsx(tv,{className:"capitalize",checked:b.getIsVisible(),onCheckedChange:w=>b.toggleVisibility(!!w),children:b.id},b.id))})]})]}),l.jsx("div",{className:"rounded-md border",children:l.jsxs(hs,{children:[l.jsx(nv,{children:p.getHeaderGroups().map(b=>l.jsx(we,{children:b.headers.map(w=>l.jsx(rv,{children:w.isPlaceholder?null:Ws(w.column.columnDef.header,w.getContext())},w.id))},b.id))}),l.jsx(vs,{children:(x=p.getRowModel().rows)!=null&&x.length?p.getRowModel().rows.map(b=>l.jsx(we,{"data-state":b.getIsSelected()&&"selected",children:b.getVisibleCells().map(w=>l.jsx($,{children:Ws(w.column.columnDef.cell,w.getContext())},w.id))},b.id)):l.jsx(we,{children:l.jsx($,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})}),l.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[l.jsxs("div",{className:"text-muted-foreground flex-1 text-sm",children:[p.getFilteredRowModel().rows.length," row(s) total."]}),l.jsxs("div",{className:"space-x-2",children:[l.jsx(jt,{variant:"outline",size:"sm",onClick:()=>p.previousPage(),disabled:!p.getCanPreviousPage(),children:"Previous"}),l.jsx(jt,{variant:"outline",size:"sm",onClick:()=>p.nextPage(),disabled:!p.getCanNextPage(),children:"Next"})]})]})]})}function me(e,t="left"){return({column:n})=>{const r=t==="right"?"justify-end":t==="center"?"justify-center":"justify-start",o=n.getIsSorted();return l.jsx("div",{className:`flex ${r}`,children:l.jsxs(jt,{variant:"ghost",onClick:()=>n.toggleSorting(n.getIsSorted()==="asc"),className:`${t==="right"?"ml-auto":""} hover:bg-muted/50 h-auto p-0 font-medium text-sm`,children:[e,o==="asc"&&l.jsx(Rd,{className:"ml-1 h-3 w-3 text-muted-foreground"}),o==="desc"&&l.jsx(ja,{className:"ml-1 h-3 w-3 text-muted-foreground"})]})})}}const ov=300*1e3;function hc(e){const[t,n]=h.useState(new Map),r=h.useRef();return h.useEffect(()=>{const s=new Date().toISOString(),i=new Set(e.map(a=>a.id));n(a=>{const c=new Map(a);return e.forEach(u=>{c.set(u.id,{...u,lastSeenAt:s,disconnectedAt:void 0})}),c.forEach((u,d)=>{!i.has(d)&&!u.disconnectedAt&&c.set(d,{...u,isConnected:!1,connectionStatus:"Disconnected",disconnectedAt:s,lastActivity:u.lastActivity||s})}),c})},[e]),h.useEffect(()=>{const s=()=>{const i=Date.now();n(a=>{const c=new Map(a);return c.forEach((u,d)=>{if(u.disconnectedAt){const g=new Date(u.disconnectedAt).getTime();i-g>ov&&c.delete(d)}}),c})};return s(),r.current=setInterval(s,3e4),()=>{r.current&&clearInterval(r.current)}},[]),Array.from(t.values()).sort((s,i)=>s.isConnected!==i.isConnected?s.isConnected?-1:1:new Date(i.lastActivity).getTime()-new Date(s.lastActivity).getTime())}function vi(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function sv(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function iv(e){return e.length<=12?e:`${e.slice(0,5)}...${e.slice(-5)}`}function av(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function lv({metrics:e}){const t=e.sessions||[],n=hc(t),r=()=>[{accessorKey:"clientInfo",header:me("Client"),cell:({row:o})=>{const s=o.original,i=s.clientInfo?`${av(s.clientInfo.name)}@${s.clientInfo.version}`:"unknown";return l.jsx("div",{className:"font-mono text-sm",title:s.clientInfo?`${s.clientInfo.name}@${s.clientInfo.version}`:"unknown",children:i})}},{accessorKey:"id",header:me("Session ID"),cell:({row:o})=>l.jsx("div",{className:"font-mono text-sm",title:o.getValue("id"),children:iv(o.getValue("id"))})},{accessorKey:"isConnected",header:me("Status"),cell:({row:o})=>{const s=o.original;return l.jsxs(Tt,{variant:s.isConnected?"success":"secondary",className:"gap-1",children:[s.isConnected?l.jsx(Oa,{className:"h-3 w-3"}):l.jsx(Pa,{className:"h-3 w-3"}),s.isConnected?"Connected":"Disconnected"]})}},{accessorKey:"connectedAt",header:me("Connected"),cell:({row:o})=>l.jsx("div",{className:"text-sm",children:vi(o.getValue("connectedAt"))})},{accessorKey:"requestCount",header:me("Requests","right"),cell:({row:o})=>l.jsx("div",{className:"text-right font-mono text-sm",children:o.getValue("requestCount")})},{accessorKey:"lastActivity",header:me("Last Activity"),cell:({row:o})=>l.jsx("div",{className:"text-sm",children:vi(o.getValue("lastActivity"))})}];return l.jsxs(st,{children:[l.jsxs(it,{children:[l.jsx(at,{children:"📊 Transport Metrics"}),l.jsx(Ft,{children:"Real-time connection and performance metrics for STDIO transport"})]}),l.jsxs(lt,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsx("p",{className:"text-sm font-mono",children:"STDIO"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:sv(e.uptimeSeconds)})]})]}),l.jsxs(l.Fragment,{children:[l.jsx(It,{}),l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3",children:["Sessions (",n.filter(o=>o.isConnected).length," active,"," ",n.filter(o=>!o.isConnected).length," disconnected)"]}),l.jsx(br,{columns:r(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]})]})]})}function xi(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function cv(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function Gn(e){return e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:`${Math.round(e/6e4)}m`}function uv(e){return e.length<=12?e:`${e.slice(0,5)}...${e.slice(-5)}`}function dv(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function fv({metrics:e}){const t=e.sessions||[],n=hc(t),r={sse:"Server-Sent Events",streamableHttp:"Streamable HTTP"},o=()=>[{accessorKey:"clientInfo",header:me("Client"),cell:({row:s})=>{const i=s.original,a=i.clientInfo?`${dv(i.clientInfo.name)}@${i.clientInfo.version}`:"unknown";return l.jsx("div",{className:"font-mono text-sm",title:i.clientInfo?`${i.clientInfo.name}@${i.clientInfo.version}`:"unknown",children:a})}},{accessorKey:"id",header:me("Session ID"),cell:({row:s})=>l.jsx("div",{className:"font-mono text-sm",title:s.getValue("id"),children:uv(s.getValue("id"))})},{accessorKey:"connectionStatus",header:me("Status"),cell:({row:s})=>{const i=s.original,a=i.connectionStatus||(i.isConnected?"Connected":"Disconnected");return a==="Connected"?l.jsxs(Tt,{variant:"success",className:"gap-1",children:[l.jsx(Oa,{className:"h-3 w-3"}),"Connected"]}):a==="Distressed"?l.jsxs(Tt,{variant:"destructive",className:"gap-1",children:[l.jsx(Ia,{className:"h-3 w-3"}),"Distressed ",i.pingFailures?`(${i.pingFailures} failed)`:""]}):l.jsxs(Tt,{variant:"secondary",className:"gap-1",children:[l.jsx(Pa,{className:"h-3 w-3"}),"Disconnected"]})}},{accessorKey:"connectedAt",header:me("Connected"),cell:({row:s})=>l.jsx("div",{className:"text-sm",children:xi(s.getValue("connectedAt"))})},{accessorKey:"requestCount",header:me("Requests","right"),cell:({row:s})=>l.jsx("div",{className:"text-right font-mono text-sm",children:s.getValue("requestCount")})},{accessorKey:"lastActivity",header:me("Last Activity"),cell:({row:s})=>l.jsx("div",{className:"text-sm",children:xi(s.getValue("lastActivity"))})}];return l.jsxs(st,{children:[l.jsxs(it,{children:[l.jsx(at,{children:"📊 Transport Metrics"}),l.jsxs(Ft,{children:["Real-time connection and performance metrics for"," ",r[e.transport]||e.transport," transport"]})]}),l.jsxs(lt,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsx("p",{className:"text-sm font-mono",children:r[e.transport]||e.transport})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:cv(e.uptimeSeconds)})]})]}),e.configuration&&l.jsx(l.Fragment,{children:l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Configuration"}),l.jsx("div",{className:"grid grid-cols-1 gap-2",children:e.pings&&l.jsx("div",{className:"text-xs text-muted-foreground bg-muted/30 p-2 rounded",children:e.pings.sent>0&&l.jsxs("p",{children:[l.jsx("span",{className:"font-medium",children:"Ping Status:"})," ",e.pings.successful,"/",e.pings.sent," successful (",e.pings.sent>0?Math.round(e.pings.successful/e.pings.sent*100):0,"%)"]})})}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["SSE connections checked every ",Gn(e.configuration.heartbeatInterval||3e4),", sessions swept every ",Gn(e.configuration.staleCheckInterval),", removed after"," ",Gn(e.configuration.staleTimeout)," inactive",e.configuration.pingEnabled&&e.configuration.pingInterval&&`, pings sent every ${Gn(e.configuration.pingInterval)}`,e.configuration.pingEnabled&&`, marked distressed after ${e.configuration.pingFailureThreshold||1} failed ping${(e.configuration.pingFailureThreshold||1)!==1?"s":""}`]})]})}),l.jsx(It,{}),l.jsx("div",{children:l.jsx(hs,{children:l.jsxs(vs,{children:[l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Active Connections"}),l.jsx($,{className:"text-sm font-mono",children:e.connections.active}),l.jsx($,{className:"font-medium text-sm",children:"Cleaned Sessions"}),l.jsx($,{className:"text-sm font-mono",children:e.connections.cleaned??0})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Total Connections"}),l.jsx($,{className:"text-sm font-mono",children:e.connections.total}),l.jsx($,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),l.jsxs($,{className:"text-sm font-mono",children:[e.requests.averagePerMinute,"/",e.requests.last3Hours,"/",e.requests.lastHour]})]}),e.sessionLifecycle&&l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),l.jsxs($,{className:"text-sm font-mono",colSpan:3,children:[e.sessionLifecycle.created,"/",e.sessionLifecycle.resumedFailed,"/",e.sessionLifecycle.deleted]})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Client Errors (4xx)"}),l.jsx($,{className:"text-sm font-mono",children:e.errors.expected}),l.jsx($,{className:"font-medium text-sm",children:"Server Errors (5xx)"}),l.jsx($,{className:"text-sm font-mono",children:e.errors.unexpected})]}),e.pings&&l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Pings Sent"}),l.jsx($,{className:"text-sm font-mono",children:e.pings.sent}),l.jsx($,{className:"font-medium text-sm",children:"Ping Success Rate"}),l.jsx($,{className:"text-sm font-mono",children:e.pings.sent>0?`${Math.round(e.pings.successful/e.pings.sent*100)}%`:"-"})]}),e.apiMetrics&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Anonymous Users"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.anonymous}),l.jsx($,{className:"font-medium text-sm",children:"Authenticated Users"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.authenticated})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"401 Unauthorized Users"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.unauthorized}),l.jsx($,{className:"font-medium text-sm",children:"403 Forbidden Users"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.forbidden})]})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),l.jsx($,{className:"text-sm font-mono",children:e.gradioMetrics?`${e.gradioMetrics.success}/${e.gradioMetrics.failure}`:"0/0"}),l.jsx($,{className:"font-medium text-sm",children:"-"}),l.jsx($,{className:"text-sm font-mono",children:"-"})]})]})})}),l.jsxs(l.Fragment,{children:[l.jsx(It,{}),l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-3",children:["Sessions (",n.filter(s=>s.isConnected).length," active,"," ",n.filter(s=>!s.isConnected).length," disconnected)"]}),l.jsx(br,{columns:o(),data:n,searchColumn:"id",searchPlaceholder:"Filter sessions...",pageSize:10,defaultSorting:[{id:"lastActivity",desc:!0}]})]})]})]})]})}function yi(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime(),o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function mv(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}function gv(e){const t=new Date,n=new Date(e),r=t.getTime()-n.getTime();return Math.floor(r/6e4)<5}function pv(e){return e.length<=42?e:`${e.slice(0,35)}.....${e.slice(-5)}`}function hv({metrics:e}){const t=e.clients,n=()=>[{accessorKey:"name",header:me("Client"),cell:({row:r})=>{const o=r.original,s=`${pv(o.name)}@${o.version}`;return l.jsxs("div",{children:[l.jsx("p",{className:"font-medium font-mono text-sm",title:`${o.name}@${o.version}`,children:s}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["First seen ",yi(o.firstSeen)]})]})}},{accessorKey:"requestCount",header:me("Initializations","right"),cell:({row:r})=>l.jsx("div",{className:"text-right font-mono text-sm",children:r.getValue("requestCount")})},{accessorKey:"isConnected",header:me("Status"),cell:({row:r})=>{const o=r.original;return l.jsx("div",{children:gv(o.lastSeen)?l.jsxs(Tt,{variant:"success",className:"gap-1",children:[l.jsx(bd,{className:"h-3 w-3"}),"Recent"]}):l.jsxs(Tt,{variant:"secondary",className:"gap-1",children:[l.jsx(kd,{className:"h-3 w-3"}),"Idle"]})})}},{accessorKey:"lastSeen",header:me("Last Seen","right"),cell:({row:r})=>l.jsx("div",{className:"text-right text-sm",children:yi(r.getValue("lastSeen"))})}];return l.jsxs(st,{children:[l.jsxs(it,{children:[l.jsx(at,{children:"📊 Transport Metrics"}),l.jsx(Ft,{children:"Real-time connection and performance metrics for Stateless HTTP JSON transport"})]}),l.jsxs(lt,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Transport Type"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-sm font-mono",children:"Stateless HTTP JSON"}),l.jsx(Tt,{variant:"secondary",children:e.sessionLifecycle?"analytics":"stateless"})]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Uptime"}),l.jsx("p",{className:"text-sm font-mono",children:mv(e.uptimeSeconds)})]})]}),l.jsx(It,{}),l.jsx("div",{children:l.jsx(hs,{children:l.jsxs(vs,{children:[l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Request Count (MCP)"}),l.jsx($,{className:"text-sm font-mono",children:e.connections.total}),l.jsx($,{className:"font-medium text-sm",children:"Requests per Minute (tot/3hr/hr)"}),l.jsxs($,{className:"text-sm font-mono",children:[e.requests.averagePerMinute,"/",e.requests.last3Hours,"/",e.requests.lastHour]})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Client Errors (4xx)"}),l.jsx($,{className:"text-sm font-mono",children:e.errors.expected}),l.jsx($,{className:"font-medium text-sm",children:"Server Errors (5xx)"}),l.jsx($,{className:"text-sm font-mono",children:e.errors.unexpected})]}),(e.staticPageHits200!==void 0||e.staticPageHits405!==void 0)&&l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Td,{className:"h-3 w-3"}),"hf.co/mcp (200/405)"]})}),l.jsxs($,{className:"text-sm font-mono",children:[e.staticPageHits200||0,"/",e.staticPageHits405||0]}),l.jsx($,{className:"font-medium text-sm",children:l.jsx("div",{className:"flex items-center gap-1",children:"Auth Status (Anon/Auth/401)"})}),l.jsxs($,{className:"text-sm font-mono",children:[e.connections.anonymous,"/",e.connections.authenticated,"/",e.connections.unauthorized||0]})]}),e.apiMetrics&&l.jsxs(l.Fragment,{children:[l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Tool API - Anonymous"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.anonymous}),l.jsx($,{className:"font-medium text-sm",children:"Tool API - Authenticated"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.authenticated})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Tool API - 401 Unauthorized"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.unauthorized}),l.jsx($,{className:"font-medium text-sm",children:"Tool API - 403 Forbidden"}),l.jsx($,{className:"text-sm font-mono",children:e.apiMetrics.forbidden})]})]}),l.jsxs(we,{children:[l.jsx($,{className:"font-medium text-sm",children:"Gradio Success/Fail"}),l.jsx($,{className:"text-sm font-mono",children:e.gradioMetrics?`${e.gradioMetrics.success}/${e.gradioMetrics.failure}`:"0/0"}),e.sessionLifecycle?l.jsxs(l.Fragment,{children:[l.jsx($,{className:"font-medium text-sm",children:"Sessions New/Res-fail/Del"}),l.jsxs($,{className:"text-sm font-mono",children:[e.sessionLifecycle.created,"/",e.sessionLifecycle.resumedFailed,"/",e.sessionLifecycle.deleted]})]}):l.jsxs(l.Fragment,{children:[l.jsx($,{className:"font-medium text-sm",children:"-"}),l.jsx($,{className:"text-sm font-mono",children:"-"})]})]})]})})}),l.jsxs(l.Fragment,{children:[l.jsx(It,{}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"Client Identities"}),l.jsx(br,{columns:n(),data:t,searchColumn:"name",searchPlaceholder:"Filter clients...",pageSize:50,defaultSorting:[{id:"lastSeen",desc:!0}]})]})]})]})]})}const vv=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function xv(){const{data:e,error:t}=mn("/api/transport-metrics",vv,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});return t?l.jsxs(st,{children:[l.jsx(it,{children:l.jsx(at,{children:"📊 Transport Metrics"})}),l.jsx(lt,{children:l.jsxs(Gd,{variant:"destructive",children:[l.jsx(Ia,{className:"h-4 w-4"}),l.jsx(Ud,{children:"Error Loading Metrics"}),l.jsxs(Bd,{children:["Failed to load transport metrics: ",t.message]})]})})]}):e?e.transport==="stdio"?l.jsx(lv,{metrics:e}):e.isStateless?l.jsx(hv,{metrics:e}):l.jsx(fv,{metrics:e}):l.jsxs(st,{children:[l.jsx(it,{children:l.jsx(at,{children:"📊 Transport Metrics"})}),l.jsx(lt,{children:l.jsxs("div",{className:"animate-pulse space-y-2",children:[l.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"}),l.jsx("div",{className:"h-4 bg-gray-200 rounded w-2/3"})]})})]})}const yv=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function wv(){const[e,t]=h.useState(!1),{data:n,error:r}=mn("/api/transport-metrics",yv,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0}),o=!n&&!r,s=(n==null?void 0:n.transport)==="stdio",i=((n==null?void 0:n.methods)||[]).map(m=>{let f=m.errors,v,p;if(m.method.startsWith("tools/call:")&&(n!=null&&n.gradioMetrics)){const b=m.method.replace("tools/call:",""),w=n.gradioMetrics.byTool;w[b]&&(v=w[b].success,p=w[b].failure,f+=p)}const y=m.count>0?f/m.count*100:0;return{method:m.method,count:m.count,errors:f,errorRate:y,averageResponseTime:m.averageResponseTime,lastCalled:m.lastCalled,gradioSuccess:v,gradioFailure:p}}),a=e?i.filter(m=>m.method.startsWith("tools/call")||m.method.startsWith("prompts/get")):i,c=i.reduce((m,f)=>m+f.count,0),u=i.filter(m=>m.method.startsWith("tools/call")).reduce((m,f)=>m+f.count,0),d=i.filter(m=>m.method.startsWith("prompts/get")).reduce((m,f)=>m+f.count,0),g=[{accessorKey:"method",header:me("Method"),cell:({row:m})=>{const f=m.getValue("method");return l.jsx("div",{className:"font-mono text-sm",children:f==="tools/call"?l.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call"}):f.startsWith("tools/call:")?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:"tools/call:"}),l.jsx("span",{className:"text-green-600 dark:text-green-400",children:f.replace("tools/call:","")})]}):f==="prompts/get"?l.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get"}):f.startsWith("prompts/get:")?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"text-purple-600 dark:text-purple-400",children:"prompts/get:"}),l.jsx("span",{className:"text-orange-600 dark:text-orange-400",children:f.replace("prompts/get:","")})]}):f})}},{accessorKey:"count",header:me("Calls","right"),cell:({row:m})=>l.jsx("div",{className:"text-right font-mono",children:m.getValue("count").toLocaleString()})},{accessorKey:"errors",header:me("Errors","right"),cell:({row:m})=>{const f=m.getValue("errors");return l.jsx("div",{className:"text-right font-mono",children:f>0?l.jsx("span",{className:"text-red-600 dark:text-red-400",children:f}):"0"})}},{accessorKey:"gradioMetrics",header:me("Success/Failure","right"),cell:({row:m})=>{const f=m.original;return f.gradioSuccess!==void 0&&f.gradioFailure!==void 0?l.jsxs("div",{className:"text-right font-mono text-sm",children:[l.jsx("span",{className:"text-green-600 dark:text-green-400",children:f.gradioSuccess}),l.jsx("span",{className:"text-muted-foreground",children:"/"}),l.jsx("span",{className:"text-red-600 dark:text-red-400",children:f.gradioFailure})]}):l.jsx("div",{className:"text-right text-muted-foreground",children:"—"})}},{accessorKey:"errorRate",header:me("Error Rate","right"),cell:({row:m})=>{const f=m.getValue("errorRate");return l.jsx("div",{className:"text-right font-mono",children:f>0?l.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[f.toFixed(1),"%"]}):"0%"})}},{accessorKey:"averageResponseTime",header:me("Avg Response","right"),cell:({row:m})=>{const f=m.getValue("averageResponseTime");return l.jsx("div",{className:"text-right font-mono",children:f?`${f.toFixed(0)}ms`:"—"})}},{accessorKey:"lastCalled",header:me("Last Called","right"),cell:({row:m})=>l.jsx("div",{className:"text-right text-sm text-muted-foreground",children:new Date(m.getValue("lastCalled")).toLocaleTimeString()})}];return l.jsxs(st,{children:[l.jsxs(it,{children:[l.jsx(at,{children:"HTTP JSON Transport Statistics"}),l.jsxs(Ft,{children:["MCP method call statistics and performance metrics",s?" (Empty in STDIO mode)":n!=null&&n.isStateless?"":" (Response times not available in stateful modes)"]})]}),l.jsxs(lt,{children:[o&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading metrics..."})}),r&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsxs("div",{className:"text-sm text-destructive",children:["Error loading metrics: ",r.message]})}),s&&l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:"Method tracking is not available in STDIO mode. This data is only collected for HTTP-based transports."})}),n&&!s&&l.jsxs("div",{className:"space-y-4",children:[i.length>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",a.length," method",a.length!==1?"s":""," tracked since"," ",new Date(n.startupTime).toLocaleString()]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"text-sm font-medium",children:["Total MCP Calls: ",l.jsx("span",{className:"font-mono",children:c.toLocaleString()})]}),l.jsxs("div",{className:"text-sm font-medium",children:["Tool Calls: ",l.jsx("span",{className:"font-mono",children:u.toLocaleString()})]}),l.jsxs("div",{className:"text-sm font-medium",children:["Prompt Calls: ",l.jsx("span",{className:"font-mono",children:d.toLocaleString()})]})]})]}),i.length>0&&l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Zo,{id:"tool-prompt-calls-filter",checked:e,onCheckedChange:m=>t(!!m)}),l.jsx("label",{htmlFor:"tool-prompt-calls-filter",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"Show only Tools/Prompts"})]}),a.length===0?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:e?"No tool or prompt calls recorded yet.":"No method calls recorded yet."})}):l.jsx(br,{columns:g,data:a,searchColumn:"method",searchPlaceholder:"Filter methods...",pageSize:50,defaultColumnVisibility:{method:!0,count:!0,errors:!1,gradioMetrics:!1,errorRate:!0,averageResponseTime:n.transport==="streamableHttpJson",lastCalled:!0},defaultSorting:[{id:"count",desc:!0}]})]})]})]})}function wi(e){return e.transport==="stdio"?e.defaultHfTokenSet&&e.hfTokenMasked?{text:e.hfTokenMasked,isWarning:!1}:{text:"Warning: No token set",isWarning:!0}:e.defaultHfTokenSet?{text:`⚠️ Using ${e.hfTokenMasked||"token"} as default`,isWarning:!0}:{text:"Using Authorization Headers",isWarning:!1}}function bv({isLoading:e,error:t,transportInfo:n}){const r=()=>{switch(n.transport){case"stdio":return"STDIO";case"sse":return"SSE";case"streamableHttp":case"streamableHttpJson":return"Streamable HTTP";default:return"Unknown"}},o=()=>{switch(n.transport){case"sse":return"/sse";case"streamableHttp":case"streamableHttpJson":return"/mcp";case"stdio":return"stdin/stdout";default:return"unknown"}},s=()=>n.transport==="streamableHttpJson"||n.transport==="streamableHttp"&&n.jsonResponseEnabled===!0,i=()=>s()?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-green-100 text-green-800 text-[10px] rounded-sm whitespace-nowrap",children:"JSON (stateless)"}):n.transport==="streamableHttp"?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-blue-100 text-blue-800 text-[10px] rounded-sm whitespace-nowrap",children:"Session Based"}):n.transport==="sse"?l.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 bg-purple-100 text-purple-800 text-[10px] rounded-sm whitespace-nowrap",children:"Event Stream"}):null;if(e)return l.jsx("div",{className:"text-center text-xs text-muted-foreground py-2",children:"Loading connection information..."});if(t)return l.jsxs("div",{className:"text-center text-xs text-destructive py-2",children:["Error: ",t]});const a=n.port||3e3,c=n.transport!=="stdio";return l.jsx("div",{className:"fixed bottom-0 left-0 w-full bg-muted/50 border-t border-border py-2 px-4",children:l.jsxs("div",{className:"max-w-[700px] mx-auto flex justify-between items-center text-xs",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:"Using"}),l.jsx("span",{className:"font-medium text-primary",children:r()}),n.transport==="stdio"&&l.jsxs("span",{className:"text-muted-foreground flex items-center",children:["Client Info :",n.stdioClient?l.jsx("span",{className:"ml-2 flex items-center",children:l.jsxs("span",{className:"ml-1 font-medium text-green-700",children:[n.stdioClient.name," ",n.stdioClient.version]})}):l.jsx("span",{className:"ml-2 text-muted-foreground",children:" (disconnected) "})]}),c&&l.jsxs("span",{className:"text-muted-foreground flex items-center",children:["on port ",l.jsx("span",{className:"font-mono mx-1",children:a}),"at ",l.jsx("span",{className:"font-mono mx-1",children:o()}),i()]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-muted-foreground",children:" Default HF Token:"}),l.jsx("span",{className:`font-mono ${wi(n).isWarning?"text-red-500":""}`,children:wi(n).text})]})]})})}var _r="Tabs",[_v]=Dt(_r,[hr]),vc=hr(),[Sv,xs]=_v(_r),xc=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=es(a),[g,m]=cr({prop:r,onChange:o,defaultProp:s??"",caller:_r});return l.jsx(Sv,{scope:n,baseId:Kn(),value:g,onValueChange:m,orientation:i,dir:d,activationMode:c,children:l.jsx(fe.div,{dir:d,"data-orientation":i,...u,ref:t})})});xc.displayName=_r;var yc="TabsList",wc=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=xs(yc,n),i=vc(n);return l.jsx(kl,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(fe.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});wc.displayName=yc;var bc="TabsTrigger",_c=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=xs(bc,n),a=vc(n),c=Rc(i.baseId,r),u=Ec(i.baseId,r),d=r===i.value;return l.jsx(Ml,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(fe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:J(e.onMouseDown,g=>{!o&&g.button===0&&g.ctrlKey===!1?i.onValueChange(r):g.preventDefault()}),onKeyDown:J(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&i.onValueChange(r)}),onFocus:J(e.onFocus,()=>{const g=i.activationMode!=="manual";!d&&!o&&g&&i.onValueChange(r)})})})});_c.displayName=bc;var Sc="TabsContent",Cc=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=xs(Sc,n),c=Rc(a.baseId,r),u=Ec(a.baseId,r),d=r===a.value,g=h.useRef(d);return h.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),l.jsx($t,{present:o||d,children:({present:m})=>l.jsx(fe.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});Cc.displayName=Sc;function Rc(e,t){return`${e}-trigger-${t}`}function Ec(e,t){return`${e}-content-${t}`}var Cv=xc,Rv=wc,Ev=_c,kv=Cc;function Mv({className:e,...t}){return l.jsx(Cv,{"data-slot":"tabs",className:de("flex flex-col gap-2",e),...t})}function Nv({className:e,...t}){return l.jsx(Rv,{"data-slot":"tabs-list",className:de("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Bt({className:e,...t}){return l.jsx(Ev,{"data-slot":"tabs-trigger",className:de("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Wt({className:e,...t}){return l.jsx(kv,{"data-slot":"tabs-content",className:de("flex-1 outline-none",e),...t})}const bi="ALLOW_README_INCLUDE",_i="NO_GRADIO_IMAGE_CONTENT";var ae;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ae||(ae={}));var Si;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Si||(Si={}));const F=ae.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),xt=e=>{switch(typeof e){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(e)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(e)?F.array:e===null?F.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?F.promise:typeof Map<"u"&&e instanceof Map?F.map:typeof Set<"u"&&e instanceof Set?F.set:typeof Date<"u"&&e instanceof Date?F.date:F.object;default:return F.unknown}},M=ae.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ft extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){const u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),r}static assert(t){if(!(t instanceof ft))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ae.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ft.create=e=>new ft(e);const Mo=(e,t)=>{let n;switch(e.code){case M.invalid_type:e.received===F.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case M.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ae.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:n=`Unrecognized key(s) in object: ${ae.joinValues(e.keys,", ")}`;break;case M.invalid_union:n="Invalid input";break;case M.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ae.joinValues(e.options)}`;break;case M.invalid_enum_value:n=`Invalid enum value. Expected ${ae.joinValues(e.options)}, received '${e.received}'`;break;case M.invalid_arguments:n="Invalid function arguments";break;case M.invalid_return_type:n="Invalid function return type";break;case M.invalid_date:n="Invalid date";break;case M.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ae.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case M.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case M.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case M.custom:n="Invalid input";break;case M.invalid_intersection_types:n="Intersection results could not be merged";break;case M.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case M.not_finite:n="Number must be finite";break;default:n=t.defaultError,ae.assertNever(e)}return{message:n}};let Av=Mo;function Tv(){return Av}const jv=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const c=r.filter(u=>!!u).slice().reverse();for(const u of c)a=u(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function T(e,t){const n=Tv(),r=jv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Mo?void 0:Mo].filter(o=>!!o)});e.common.issues.push(r)}class Me{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return q;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return Me.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return q;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const q=Object.freeze({status:"aborted"}),fn=e=>({status:"dirty",value:e}),Fe=e=>({status:"valid",value:e}),Ci=e=>e.status==="aborted",Ri=e=>e.status==="dirty",Yt=e=>e.status==="valid",nr=e=>typeof Promise<"u"&&e instanceof Promise;var D;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(D||(D={}));class Ke{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ei=(e,t)=>{if(Yt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ft(e.common.issues);return this._error=n,this._error}}};function X(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}class oe{get description(){return this._def.description}_getType(t){return xt(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Me,ctx:{common:t.parent.common,data:t.data,parsedType:xt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(nr(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xt(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Ei(r,o)}"~validate"(t){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xt(t)};if(!this["~standard"].async)try{const s=this._parseSync({data:t,path:[],parent:n});return Yt(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(o=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(s=>Yt(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:xt(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(nr(o)?o:Promise.resolve(o));return Ei(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:M.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new en({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return _t.create(this,this._def)}nullable(){return tn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qe.create(this)}promise(){return ar.create(this,this._def)}or(t){return or.create([this,t],this._def)}and(t){return sr.create(this,t,this._def)}transform(t){return new en({...X(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new jo({...X(this._def),innerType:this,defaultValue:n,typeName:W.ZodDefault})}brand(){return new tx({typeName:W.ZodBranded,type:this,...X(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Io({...X(this._def),innerType:this,catchValue:n,typeName:W.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ys.create(this,t)}readonly(){return Po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Iv=/^c[^\s-]{8,}$/i,Pv=/^[0-9a-z]+$/,Ov=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Dv=/^[a-z0-9_-]{21}$/i,$v=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Lv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Vv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Jr;const Hv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Gv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Uv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Bv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,kc="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Zv=new RegExp(`^${kc}$`);function Mc(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Kv(e){return new RegExp(`^${Mc(e)}$`)}function Xv(e){let t=`${kc}T${Mc(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Yv(e,t){return!!((t==="v4"||!t)&&Hv.test(e)||(t==="v6"||!t)&&Uv.test(e))}function Jv(e,t){if(!$v.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Qv(e,t){return!!((t==="v4"||!t)&&Gv.test(e)||(t==="v6"||!t)&&Bv.test(e))}class ot extends oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==F.string){const s=this._getOrReturnCtx(t);return T(s,{code:M.invalid_type,expected:F.string,received:s.parsedType}),q}const r=new Me;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),T(o,{code:M.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),T(o,{code:M.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?T(o,{code:M.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:M.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Vv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"email",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Jr||(Jr=new RegExp(zv,"u")),Jr.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"emoji",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Fv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"uuid",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Dv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"nanoid",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Iv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"cuid",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Pv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"cuid2",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Ov.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"ulid",code:M.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),T(o,{validation:"url",code:M.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"regex",code:M.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Xv(s).test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Zv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Kv(s).test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{code:M.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?Lv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"duration",code:M.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Yv(t.data,s.version)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"ip",code:M.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?Jv(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"jwt",code:M.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Qv(t.data,s.version)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"cidr",code:M.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Wv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"base64",code:M.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?qv.test(t.data)||(o=this._getOrReturnCtx(t,o),T(o,{validation:"base64url",code:M.invalid_string,message:s.message}),r.dirty()):ae.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:M.invalid_string,...D.errToObj(r)})}_addCheck(t){return new ot({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...D.errToObj(t)})}url(t){return this._addCheck({kind:"url",...D.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...D.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...D.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...D.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...D.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...D.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...D.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...D.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...D.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...D.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...D.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...D.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...D.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...D.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...D.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...D.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...D.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...D.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...D.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...D.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...D.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...D.errToObj(n)})}nonempty(t){return this.min(1,D.errToObj(t))}trim(){return new ot({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ot({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ot({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ot.create=e=>new ot({checks:[],typeName:W.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...X(e)});function ex(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}class Jt extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==F.number){const s=this._getOrReturnCtx(t);return T(s,{code:M.invalid_type,expected:F.number,received:s.parsedType}),q}let r;const o=new Me;for(const s of this._def.checks)s.kind==="int"?ae.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:M.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?ex(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),T(r,{code:M.not_finite,message:s.message}),o.dirty()):ae.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,D.toString(n))}gt(t,n){return this.setLimit("min",t,!1,D.toString(n))}lte(t,n){return this.setLimit("max",t,!0,D.toString(n))}lt(t,n){return this.setLimit("max",t,!1,D.toString(n))}setLimit(t,n,r,o){return new Jt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:D.toString(o)}]})}_addCheck(t){return new Jt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:D.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:D.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ae.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Jt.create=e=>new Jt({checks:[],typeName:W.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...X(e)});class _n extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==F.bigint)return this._getInvalidInput(t);let r;const o=new Me;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),T(r,{code:M.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ae.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return T(n,{code:M.invalid_type,expected:F.bigint,received:n.parsedType}),q}gte(t,n){return this.setLimit("min",t,!0,D.toString(n))}gt(t,n){return this.setLimit("min",t,!1,D.toString(n))}lte(t,n){return this.setLimit("max",t,!0,D.toString(n))}lt(t,n){return this.setLimit("max",t,!1,D.toString(n))}setLimit(t,n,r,o){return new _n({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:D.toString(o)}]})}_addCheck(t){return new _n({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:D.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}_n.create=e=>new _n({checks:[],typeName:W.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...X(e)});class No extends oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==F.boolean){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.boolean,received:r.parsedType}),q}return Fe(t.data)}}No.create=e=>new No({typeName:W.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...X(e)});class rr extends oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==F.date){const s=this._getOrReturnCtx(t);return T(s,{code:M.invalid_type,expected:F.date,received:s.parsedType}),q}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return T(s,{code:M.invalid_date}),q}const r=new Me;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),T(o,{code:M.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),T(o,{code:M.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ae.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new rr({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:D.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:D.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}rr.create=e=>new rr({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:W.ZodDate,...X(e)});class ki extends oe{_parse(t){if(this._getType(t)!==F.symbol){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.symbol,received:r.parsedType}),q}return Fe(t.data)}}ki.create=e=>new ki({typeName:W.ZodSymbol,...X(e)});class Mi extends oe{_parse(t){if(this._getType(t)!==F.undefined){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.undefined,received:r.parsedType}),q}return Fe(t.data)}}Mi.create=e=>new Mi({typeName:W.ZodUndefined,...X(e)});class Ni extends oe{_parse(t){if(this._getType(t)!==F.null){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.null,received:r.parsedType}),q}return Fe(t.data)}}Ni.create=e=>new Ni({typeName:W.ZodNull,...X(e)});class Ao extends oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Fe(t.data)}}Ao.create=e=>new Ao({typeName:W.ZodAny,...X(e)});class Ai extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fe(t.data)}}Ai.create=e=>new Ai({typeName:W.ZodUnknown,...X(e)});class Mt extends oe{_parse(t){const n=this._getOrReturnCtx(t);return T(n,{code:M.invalid_type,expected:F.never,received:n.parsedType}),q}}Mt.create=e=>new Mt({typeName:W.ZodNever,...X(e)});class Ti extends oe{_parse(t){if(this._getType(t)!==F.undefined){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.void,received:r.parsedType}),q}return Fe(t.data)}}Ti.create=e=>new Ti({typeName:W.ZodVoid,...X(e)});class qe extends oe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==F.array)return T(n,{code:M.invalid_type,expected:F.array,received:n.parsedType}),q;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(T(n,{code:i?M.too_big:M.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(T(n,{code:M.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(T(n,{code:M.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Ke(n,i,n.path,a)))).then(i=>Me.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new Ke(n,i,n.path,a)));return Me.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new qe({...this._def,minLength:{value:t,message:D.toString(n)}})}max(t,n){return new qe({...this._def,maxLength:{value:t,message:D.toString(n)}})}length(t,n){return new qe({...this._def,exactLength:{value:t,message:D.toString(n)}})}nonempty(t){return this.min(1,t)}}qe.create=(e,t)=>new qe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...X(t)});function qt(e){if(e instanceof ve){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=_t.create(qt(r))}return new ve({...e._def,shape:()=>t})}else return e instanceof qe?new qe({...e._def,type:qt(e.element)}):e instanceof _t?_t.create(qt(e.unwrap())):e instanceof tn?tn.create(qt(e.unwrap())):e instanceof Ot?Ot.create(e.items.map(t=>qt(t))):e}class ve extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ae.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==F.object){const u=this._getOrReturnCtx(t);return T(u,{code:M.invalid_type,expected:F.object,received:u.parsedType}),q}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Mt&&this._def.unknownKeys==="strip"))for(const u in o.data)i.includes(u)||a.push(u);const c=[];for(const u of i){const d=s[u],g=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new Ke(o,g,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Mt){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(T(o,{code:M.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const g=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new Ke(o,g,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const g=await d.key,m=await d.value;u.push({key:g,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Me.mergeObjectSync(r,u)):Me.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return D.errToObj,new ve({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,i;const o=((i=(s=this._def).errorMap)==null?void 0:i.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:D.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(t){return new ve({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ve({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:W.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ve({...this._def,catchall:t})}pick(t){const n={};for(const r of ae.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ve({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ae.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new ve({...this._def,shape:()=>n})}deepPartial(){return qt(this)}partial(t){const n={};for(const r of ae.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}return new ve({...this._def,shape:()=>n})}required(t){const n={};for(const r of ae.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof _t;)s=s._def.innerType;n[r]=s}return new ve({...this._def,shape:()=>n})}keyof(){return Nc(ae.objectKeys(this.shape))}}ve.create=(e,t)=>new ve({shape:()=>e,unknownKeys:"strip",catchall:Mt.create(),typeName:W.ZodObject,...X(t)});ve.strictCreate=(e,t)=>new ve({shape:()=>e,unknownKeys:"strict",catchall:Mt.create(),typeName:W.ZodObject,...X(t)});ve.lazycreate=(e,t)=>new ve({shape:e,unknownKeys:"strip",catchall:Mt.create(),typeName:W.ZodObject,...X(t)});class or extends oe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new ft(a.ctx.common.issues));return T(n,{code:M.invalid_union,unionErrors:i}),q}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const c of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(c=>new ft(c));return T(n,{code:M.invalid_union,unionErrors:a}),q}}get options(){return this._def.options}}or.create=(e,t)=>new or({options:e,typeName:W.ZodUnion,...X(t)});function To(e,t){const n=xt(e),r=xt(t);if(e===t)return{valid:!0,data:e};if(n===F.object&&r===F.object){const o=ae.objectKeys(t),s=ae.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const c=To(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===F.array&&r===F.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],c=To(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===F.date&&r===F.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class sr extends oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(Ci(s)||Ci(i))return q;const a=To(s.value,i.value);return a.valid?((Ri(s)||Ri(i))&&n.dirty(),{status:n.value,value:a.data}):(T(r,{code:M.invalid_intersection_types}),q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}sr.create=(e,t,n)=>new sr({left:e,right:t,typeName:W.ZodIntersection,...X(n)});class Ot extends oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==F.array)return T(r,{code:M.invalid_type,expected:F.array,received:r.parsedType}),q;if(r.data.length<this._def.items.length)return T(r,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&r.data.length>this._def.items.length&&(T(r,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Ke(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>Me.mergeArray(n,i)):Me.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Ot({...this._def,rest:t})}}Ot.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ot({items:e,typeName:W.ZodTuple,rest:null,...X(t)})};class ir extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==F.object)return T(r,{code:M.invalid_type,expected:F.object,received:r.parsedType}),q;const o=[],s=this._def.keyType,i=this._def.valueType;for(const a in r.data)o.push({key:s._parse(new Ke(r,a,r.path,a)),value:i._parse(new Ke(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Me.mergeObjectAsync(n,o):Me.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof oe?new ir({keyType:t,valueType:n,typeName:W.ZodRecord,...X(r)}):new ir({keyType:ot.create(),valueType:t,typeName:W.ZodRecord,...X(n)})}}class ji extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==F.map)return T(r,{code:M.invalid_type,expected:F.map,received:r.parsedType}),q;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:o._parse(new Ke(r,a,r.path,[u,"key"])),value:s._parse(new Ke(r,c,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of i){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return q;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of i){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return q;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}ji.create=(e,t,n)=>new ji({valueType:t,keyType:e,typeName:W.ZodMap,...X(n)});class Sn extends oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==F.set)return T(r,{code:M.invalid_type,expected:F.set,received:r.parsedType}),q;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(T(r,{code:M.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(T(r,{code:M.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(c){const u=new Set;for(const d of c){if(d.status==="aborted")return q;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((c,u)=>s._parse(new Ke(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,n){return new Sn({...this._def,minSize:{value:t,message:D.toString(n)}})}max(t,n){return new Sn({...this._def,maxSize:{value:t,message:D.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Sn.create=(e,t)=>new Sn({valueType:e,minSize:null,maxSize:null,typeName:W.ZodSet,...X(t)});class Ii extends oe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ii.create=(e,t)=>new Ii({getter:e,typeName:W.ZodLazy,...X(t)});class Pi extends oe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return T(n,{received:n.data,code:M.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}}Pi.create=(e,t)=>new Pi({value:e,typeName:W.ZodLiteral,...X(t)});function Nc(e,t){return new Qt({values:e,typeName:W.ZodEnum,...X(t)})}class Qt extends oe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return T(n,{expected:ae.joinValues(r),received:n.parsedType,code:M.invalid_type}),q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return T(n,{received:n.data,code:M.invalid_enum_value,options:r}),q}return Fe(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Qt.create(t,{...this._def,...n})}exclude(t,n=this._def){return Qt.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Qt.create=Nc;class Oi extends oe{_parse(t){const n=ae.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==F.string&&r.parsedType!==F.number){const o=ae.objectValues(n);return T(r,{expected:ae.joinValues(o),received:r.parsedType,code:M.invalid_type}),q}if(this._cache||(this._cache=new Set(ae.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=ae.objectValues(n);return T(r,{received:r.data,code:M.invalid_enum_value,options:o}),q}return Fe(t.data)}get enum(){return this._def.values}}Oi.create=(e,t)=>new Oi({values:e,typeName:W.ZodNativeEnum,...X(t)});class ar extends oe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==F.promise&&n.common.async===!1)return T(n,{code:M.invalid_type,expected:F.promise,received:n.parsedType}),q;const r=n.parsedType===F.promise?n.data:Promise.resolve(n.data);return Fe(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ar.create=(e,t)=>new ar({type:e,typeName:W.ZodPromise,...X(t)});class en extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{T(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return q;const c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?q:c.status==="dirty"||n.value==="dirty"?fn(c.value):c});{if(n.value==="aborted")return q;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?q:a.status==="dirty"||n.value==="dirty"?fn(a.value):a}}if(o.type==="refinement"){const i=a=>{const c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?q:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?q:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Yt(i))return q;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Yt(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):q);ae.assertNever(o)}}en.create=(e,t,n)=>new en({schema:e,typeName:W.ZodEffects,effect:t,...X(n)});en.createWithPreprocess=(e,t,n)=>new en({schema:t,effect:{type:"preprocess",transform:e},typeName:W.ZodEffects,...X(n)});class _t extends oe{_parse(t){return this._getType(t)===F.undefined?Fe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_t.create=(e,t)=>new _t({innerType:e,typeName:W.ZodOptional,...X(t)});class tn extends oe{_parse(t){return this._getType(t)===F.null?Fe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}tn.create=(e,t)=>new tn({innerType:e,typeName:W.ZodNullable,...X(t)});class jo extends oe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===F.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}jo.create=(e,t)=>new jo({innerType:e,typeName:W.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...X(t)});class Io extends oe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return nr(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Io.create=(e,t)=>new Io({innerType:e,typeName:W.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...X(t)});class Fi extends oe{_parse(t){if(this._getType(t)!==F.nan){const r=this._getOrReturnCtx(t);return T(r,{code:M.invalid_type,expected:F.nan,received:r.parsedType}),q}return{status:"valid",value:t.data}}}Fi.create=e=>new Fi({typeName:W.ZodNaN,...X(e)});class tx extends oe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ys extends oe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?q:s.status==="dirty"?(n.dirty(),fn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?q:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new ys({in:t,out:n,typeName:W.ZodPipeline})}}class Po extends oe{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Yt(o)&&(o.value=Object.freeze(o.value)),o);return nr(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Po.create=(e,t)=>new Po({innerType:e,typeName:W.ZodReadonly,...X(t)});var W;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(W||(W={}));const B=ot.create,ln=Jt.create,Ye=No.create,nx=Ao.create;Mt.create;const nn=qe.create,pe=ve.create,Ac=or.create;sr.create;Ot.create;const Cn=ir.create,mt=Qt.create;ar.create;_t.create;tn.create;const rx=10,Oo={name:"space_search",description:"Find Hugging Face Spaces using semantic search. Include links to the Space when presenting the results.",schema:pe({query:B().min(1,"Query is required").max(100,"Query too long").describe("Semantic Search Query"),limit:ln().optional().default(rx).describe("Number of results to return"),mcp:Ye().optional().default(!1).describe("Only return MCP Server enabled Spaces")}),annotations:{title:"Hugging Face Space Search"}},Fo={name:"model_search",description:"Find Machine Learning models hosted on Hugging Face. Returns comprehensive information about matching models including downloads, likes, tags, and direct links. Include links to the models in your response",schema:pe({query:B().optional().describe('Search term. Leave blank and specify "sort" and "limit" to get e.g. "Top 20 trending models", "Top 10 most recent models" etc" '),author:B().optional().describe("Organization or user who created the model (e.g., 'google', 'meta-llama', 'microsoft')"),task:B().optional().describe("Model task type (e.g., 'text-generation', 'image-classification', 'translation')"),library:B().optional().describe("Framework the model uses (e.g., 'transformers', 'diffusers', 'timm')"),sort:mt(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads , likes, createdAt, lastModified"),limit:ln().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Model Search"}};new Promise(e=>{});var Qr=65536;ox();function ox(){try{return new Uint32Array(Qr)}catch{const t=new Array(Qr);for(let n=0;n<Qr;n++)t[n]=0;return t}}const sx={name:"model_details",schema:pe({model_id:B().min(1,"Model ID is required").describe("The Model ID in author/model format (e.g., microsoft/DialoGPT-large)")})};pe({model_id:B().min(5,"Model ID is required").max(50).describe("The Model ID in author/model format (e.g. 'openai/gpt-oss-120b')")});const Do={name:"paper_search",description:"Find Machine Learning research papers on the Hugging Face hub. Include 'Link to paper' When presenting the results. Consider whether tabulating results matches user intent.",schema:pe({query:B().min(3,"Supply at least one search term").max(200,"Query too long").describe("Semantic Search query"),results_limit:ln().optional().default(12).describe("Number of results to return"),concise_only:Ye().optional().default(!1).describe("Return a 2 sentence summary of the abstract. Use for broad search terms which may return a lot of results. Check with User if unsure.")}),annotations:{title:"Paper Search"}},$o={name:"dataset_search",description:"Find Datasets hosted on the Hugging Face hub. Returns comprehensive information about matching datasets including downloads, likes, tags, and direct links. Include links to the datasets in your response",schema:pe({query:B().optional().describe('Search term. Leave blank and specify "sort" and "limit" to get e.g. "Top 20 trending datasets", "Top 10 most recent datasets" etc" '),author:B().optional().describe("Organization or user who created the dataset (e.g., 'google', 'facebook', 'allenai')"),tags:nn(B()).optional().describe("Tags to filter datasets (e.g., ['language:en', 'size_categories:1M<n<10M', 'task_categories:text-classification'])"),sort:mt(["trendingScore","downloads","likes","createdAt","lastModified"]).optional().describe("Sort order: trendingScore, downloads, likes, createdAt, lastModified"),limit:ln().min(1).max(100).optional().default(20).describe("Maximum number of results to return")}),annotations:{title:"Dataset Search"}},ix={name:"dataset_details",schema:pe({dataset_id:B().min(5,"Dataset ID is required").describe("The Dataset ID (e.g. Anthropic/hh-rlhf, squad)")})};pe({dataset_id:B().min(3,"Dataset ID is required").max(100).describe("The Dataset ID (e.g. 'Anthropic/hh-rlhf', 'squad')")});const Lo={name:"hub_repo_details",description:"Get details for one or more Hugging Face repos (model, dataset, or space). Auto-detects type unless specified.",schema:pe({repo_ids:nn(B().min(1)).min(1,"Provide at least one id").max(10,"Provide at most 10 repo ids").describe("Repo IDs for (models|dataset/space) - usually in author/name format (e.g. openai/gpt-oss-120b)"),repo_type:mt(["model","dataset","space"]).optional().describe("Specify lookup type; otherwise auto-detects"),include_readme:Ye().default(!1).describe("Include README from the repo")}),annotations:{title:"Hub Repo Details"}},Tc={name:"duplicate_space",schema:pe({sourceSpaceId:B().min(1).describe("Space ID to copy (e.g., 'username/space-name')"),newSpaceId:B().optional().describe("Name for the new space (optional, defaults to source space-name)"),hardware:mt(["freecpu","zerogpu"]).optional().describe('Either "freecpu" or "zerogpu" (defaults based on source). Both options are in the free tier.'),private:Ye().optional().default(!0).describe("Check with User whether the new space should be public or private.")}),annotations:{title:"Duplicate Hugging Face Space"}};pe({username:B().optional().describe("Username to get spaces for (defaults to authenticated user)")});const jc={name:"space_files",schema:pe({spaceName:B().optional().describe('Space identifier in format "username/spacename"'),fileType:mt(["all","image","audio"]).optional().default("all").describe("Filter files by type: all (default), image, or audio files only")}),annotations:{title:"Space Files List"}};pe({fileType:mt(["all","image","audio","text"]).optional().default("all").describe("Filter by type")});pe({});pe({user_id:B().min(3,"User ID must be at least 3 characters long").describe('Hugging Face user ID or URL (e.g., "evalstate" or "hf.co/evalstate")').max(60).describe("Maximum length is 30 characters")});pe({paper_id:B().min(1,"Paper ID is required").describe('arXiv paper ID in various formats (e.g., "2502.16161", "arxiv:2502.16161", or full URL)').max(60).describe("Maximum length is 100 characters")});var ws=typeof window<"u"?window:{};function ax(){var e=ws.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch{}return t}function lx(){var e=function(){};return cx()?e.prototype.parseFromString=function(t){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(t),n.close(),n}:e.prototype.parseFromString=function(t){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(t),n.close(),n},e}function cx(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{ws.ActiveXObject&&(e=!0)}return e}ax()?ws.DOMParser:lx();const Vo={name:"hf_doc_fetch",description:"Fetch a document from the Hugging Face or Gradio documentation library. For large documents, use offset to get subsequent chunks.",schema:pe({doc_url:B().max(200,"Query too long").describe("Documentation URL (Hugging Face or Gradio)"),offset:ln().min(0).optional().describe("Token offset for large documents (use the offset from truncation message)")}),annotations:{title:"Fetch a document from the Hugging Face documentation library"}},zo={name:"hf_doc_search",description:"Search and Discover Hugging Face Product and Library documentation. Send an empty query to discover structure and navigation instructions. You MUST consult this tool for the most up-to-date information when using Hugging Face libraries. Combine with the Product filter to focus results.",schema:pe({query:B().max(200,"Query too long").superRefine((e,t)=>{const n=e.trim();n.length!==0&&n.length<3&&t.addIssue({code:M.too_small,type:"string",minimum:3,inclusive:!0,message:"Supply at least one search term"})}).describe("Start with an empty query for structure, endpoint discovery and navigation tips. Use semantic queries for targetted searches."),product:B().optional().describe("Filter by Product. Supply when known for focused results")}),annotations:{title:"Hugging Face Documentation Search"}};pe({space_id:B().min(1).describe("Space ID in 'username/repo' format")});var Un={},eo,Di;function ux(){return Di||(Di=1,eo=function(t){return t.map(function(n){return n===""?"''":n&&typeof n=="object"?n.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(n)&&!/'/.test(n)?"'"+n.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(n)?'"'+n.replace(/(["\\$`!])/g,"\\$1")+'"':String(n).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}),eo}var to,$i;function dx(){if($i)return to;$i=1;for(var e="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",t=new RegExp("^"+e+"$"),n="|&;()<> \\t",r='"((\\\\"|[^"])*?)"',o="'((\\\\'|[^'])*?)'",s=/^#$/,i="'",a='"',c="$",u="",d=4294967296,g=0;g<4;g++)u+=(d*Math.random()).toString(16);var m=new RegExp("^"+u);function f(y,x){for(var b=x.lastIndex,w=[],S;S=x.exec(y);)w.push(S),x.lastIndex===S.index&&(x.lastIndex+=1);return x.lastIndex=b,w}function v(y,x,b){var w=typeof y=="function"?y(b):y[b];return typeof w>"u"&&b!=""?w="":typeof w>"u"&&(w="$"),typeof w=="object"?x+u+JSON.stringify(w)+u:x+w}function p(y,x,b){b||(b={});var w=b.escape||"\\",S="(\\"+w+`['"`+n+`]|[^\\s'"`+n+"])+",C=new RegExp(["("+e+")","("+S+"|"+r+"|"+o+")+"].join("|"),"g"),N=f(y,C);if(N.length===0)return[];x||(x={});var E=!1;return N.map(function(_){var j=_[0];if(!j||E)return;if(t.test(j))return{op:j};var L=!1,K=!1,U="",Z=!1,A;function te(){A+=1;var R,k,z=j.charAt(A);if(z==="{"){if(A+=1,j.charAt(A)==="}")throw new Error("Bad substitution: "+j.slice(A-2,A+1));if(R=j.indexOf("}",A),R<0)throw new Error("Bad substitution: "+j.slice(A));k=j.slice(A,R),A=R}else if(/[*@#?$!_-]/.test(z))k=z,A+=1;else{var V=j.slice(A);R=V.match(/[^\w\d_]/),R?(k=V.slice(0,R.index),A+=R.index-1):(k=V,A=j.length)}return v(x,"",k)}for(A=0;A<j.length;A++){var I=j.charAt(A);if(Z=Z||!L&&(I==="*"||I==="?"),K)U+=I,K=!1;else if(L)I===L?L=!1:L==i?U+=I:I===w?(A+=1,I=j.charAt(A),I===a||I===w||I===c?U+=I:U+=w+I):I===c?U+=te():U+=I;else if(I===a||I===i)L=I;else{if(t.test(I))return{op:j};if(s.test(I)){E=!0;var Q={comment:y.slice(_.index+A+1)};return U.length?[U,Q]:[Q]}else I===w?K=!0:I===c?U+=te():U+=I}}return Z?{op:"glob",pattern:U}:U}).reduce(function(_,j){return typeof j>"u"?_:_.concat(j)},[])}return to=function(x,b,w){var S=p(x,b,w);return typeof b!="function"?S:S.reduce(function(C,N){if(typeof N=="object")return C.concat(N);var E=N.split(RegExp("("+u+".*?"+u+")","g"));return E.length===1?C.concat(E[0]):C.concat(E.filter(Boolean).map(function(_){return m.test(_)?JSON.parse(_.split(u)[1]):_}))},[])},to}var Li;function fx(){return Li||(Li=1,Un.quote=ux(),Un.parse=dx()),Un}fx();const mx=1e4,Vi=mx/1e3,Ic=["cpu-basic","cpu-upgrade","cpu-performance","cpu-xl"],bs=["sprx8","zero-a10g","t4-small","t4-medium","l4x1","l4x4","l40sx1","l40sx4","l40sx8","a10g-small","a10g-large","a10g-largex2","a10g-largex4","a100-large","h100","h100x8"],_s=["inf2x6"],Ho=[...Ic,...bs,..._s],Nt=pe({namespace:B().optional().describe("Target namespace (username or organization). Defaults to current user.")}),gx=Nt.extend({image:B().describe('Docker image or HF Space URL (e.g., "python:3.12" or "hf.co/spaces/user/space")').optional().default("python:3.12"),command:Ac([B(),nn(B())]).describe('Command to execute. Array format recommended (e.g., ["python", "script.py"]). String format is parsed with POSIX shell semantics (quotes, escaping). For multiline scripts, use array with newlines in arguments.'),flavor:mt(Ho).optional().default("cpu-basic").describe(`Hardware flavor. Options: ${Ho.join(", ")}`),env:Cn(B()).optional().describe("Environment variables as key-value pairs"),secrets:Cn(B()).optional().describe("Secrets as key-value pairs. Use HF_TOKEN=$HF_TOKEN to include your token"),timeout:B().optional().describe('Max duration (e.g., "5m", "2h", "30s"). Default: 30m').default("30m"),detach:Ye().optional().default(!1).describe("If true, return immediately with job ID. If false (default), tail logs for up to 10 seconds.")}),px=Nt.extend({script:B().describe("Python script: local file path, URL, or inline code. UV will handle dependencies automatically."),with_deps:nn(B()).optional().describe("Additional package dependencies"),script_args:nn(B()).optional().describe("Arguments to pass to the script"),python:B().optional().describe('Python interpreter version (e.g., "3.12")'),flavor:mt(Ho).optional().default("cpu-basic").describe("Hardware flavor"),env:Cn(B()).optional().describe("Environment variables as key-value pairs"),secrets:Cn(B()).optional().describe("Secrets as key-value pairs. Use HF_TOKEN=$HF_TOKEN to include your token"),timeout:B().optional().default("30m").describe("Max duration"),detach:Ye().optional().default(!1).describe("If true, return immediately with job ID. If false (default), tail logs for up to 10 seconds.")});Nt.extend({all:Ye().optional().default(!1).describe("Show all jobs (default: only running)"),status:B().optional().describe('Filter by status ("RUNNING", "COMPLETED", "CANCELED", "ERROR", "DELETED")')});Nt.extend({job_id:B().describe("Job ID to fetch logs from"),tail:ln().optional().default(20).describe("Number of lines to return (default: 20)")});Nt.extend({job_id:Ac([B(),nn(B())]).describe("Job ID(s) to inspect")});Nt.extend({job_id:B().describe("Job ID to cancel")});gx.extend({schedule:B().describe("Schedule: cron expression or shorthand (@hourly, @daily, @weekly, @monthly, @yearly)"),suspend:Ye().optional().default(!1).describe("Create in suspended state")});px.extend({schedule:B().describe("Schedule: cron expression or shorthand"),suspend:Ye().optional().default(!1).describe("Create in suspended state")});Nt.extend({all:Ye().optional().default(!1).describe("Show all scheduled jobs (default: hide suspended)")});Nt.extend({scheduled_job_id:B().describe("Scheduled job ID")});const zi=["run","uv","ps","logs","inspect","cancel","scheduled run","scheduled uv","scheduled ps","scheduled inspect","scheduled delete","scheduled suspend","scheduled resume"],hx={run:`{
|
|
146
|
-
"operation": "run",
|
|
147
|
-
"args": {
|
|
148
|
-
"image": "python:3.12",
|
|
149
|
-
"command": ["python", "-c", "print('Hello from HF Jobs!')"],
|
|
150
|
-
"flavor": "cpu-basic"
|
|
151
|
-
}
|
|
152
|
-
}`,uv:`{
|
|
153
|
-
"operation": "uv",
|
|
154
|
-
"args": {
|
|
155
|
-
"script": "import random\\nprint(42 + random.randint(1, 5))"
|
|
156
|
-
}
|
|
157
|
-
}`,ps:'{"operation": "ps"}',logs:`{
|
|
158
|
-
"operation": "logs",
|
|
159
|
-
"args": {"job_id": "your-job-id"}
|
|
160
|
-
}`,inspect:`{
|
|
161
|
-
"operation": "inspect",
|
|
162
|
-
"args": {"job_id": "your-job-id"}
|
|
163
|
-
}`,cancel:`{
|
|
164
|
-
"operation": "cancel",
|
|
165
|
-
"args": {"job_id": "your-job-id"}
|
|
166
|
-
}`,"scheduled run":`{
|
|
167
|
-
"operation": "scheduled run",
|
|
168
|
-
"args": {
|
|
169
|
-
"schedule": "@hourly",
|
|
170
|
-
"image": "python:3.12",
|
|
171
|
-
"command": ["python", "backup.py"]
|
|
172
|
-
}
|
|
173
|
-
}`,"scheduled uv":`{
|
|
174
|
-
"operation": "scheduled uv",
|
|
175
|
-
"args": {
|
|
176
|
-
"schedule": "0 9 * * 1-5",
|
|
177
|
-
"script": "import datetime\\nprint('daily check', datetime.datetime.utcnow())"
|
|
178
|
-
}
|
|
179
|
-
}`,"scheduled ps":'{"operation": "scheduled ps"}',"scheduled inspect":`{
|
|
180
|
-
"operation": "scheduled inspect",
|
|
181
|
-
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
182
|
-
}`,"scheduled delete":`{
|
|
183
|
-
"operation": "scheduled delete",
|
|
184
|
-
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
185
|
-
}`,"scheduled suspend":`{
|
|
186
|
-
"operation": "scheduled suspend",
|
|
187
|
-
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
188
|
-
}`,"scheduled resume":`{
|
|
189
|
-
"operation": "scheduled resume",
|
|
190
|
-
"args": {"scheduled_job_id": "your-scheduled-job-id"}
|
|
191
|
-
}`},vx=Ic.join(", "),xx=bs.join(", "),yx=_s.join(", "),wx=[`**CPU:** ${vx}`,bs.length?`**GPU:** ${xx}`:void 0,_s.length?`**Specialized:** ${yx}`:void 0].filter(e=>!!e).join(`
|
|
192
|
-
`);function bx(e){const t=hx[e];if(t)return`Call this tool with:
|
|
193
|
-
\`\`\`json
|
|
194
|
-
${t}
|
|
195
|
-
\`\`\``}function Hi(e,t){const n=bx(t);return n?`### ${e}
|
|
196
|
-
${n}
|
|
197
|
-
`:""}`${Hi("Run a simple job","run")}${Hi("Run a Python script with UV","uv")}${wx}${Vi}${Vi}`;pe({operation:mt(zi).optional().describe(`Operation to execute. Valid values: ${zi.map(e=>`"${e}"`).join(", ")}`),args:Cn(nx()).optional().describe("Operation-specific arguments as a JSON object")});const Gi=Oo.name,Ui=Fo.name,_x=sx.name,Bi=Do.name,Wi=$o.name,Sx=ix.name,pn=Lo.name,qi=Tc.name,Zi=jc.name,Ki=zo.name,Xi=Vo.name;function Yi(e){const t=new Set,n=[];let r=!1;for(const o of e){if(o===_x||o===Sx){r=!0;continue}t.has(o)||(t.add(o),n.push(o))}return r&&!t.has(pn)&&(t.add(pn),n.push(pn)),n}const no=e=>fetch(e).then(t=>{if(!t.ok)throw new Error(`Failed to fetch: ${t.status}`);return t.json()});function Cx(){var _,j,L,K,U,Z,A,te,I,Q,R;const{data:e,error:t}=mn("/api/transport",no,{refreshInterval:3e3,revalidateOnFocus:!0,revalidateOnReconnect:!0});mn("/api/sessions",no,{refreshInterval:3e3,revalidateOnFocus:!0});const{data:n}=mn("/api/settings",no),r=((_=n==null?void 0:n.builtInTools)==null?void 0:_.includes(bi))??!1,o=((j=n==null?void 0:n.builtInTools)==null?void 0:j.includes(_i))??!1,[s,i]=h.useState(["","",""]),[a,c]=h.useState(["","",""]),[u,d]=h.useState([!1,!1,!1]),[g,m]=h.useState(!1);h.useEffect(()=>{if(n!=null&&n.spaceTools&&!g){const k=["","",""],z=["","",""],V=[!1,!1,!1];n.spaceTools.forEach((ee,se)=>{se<3&&(k[se]=ee.name,z[se]=ee.subdomain,V[se]=!0)}),i(k),c(z),d(V),m(!0)}},[n,g]);const f=!e&&!t,v=t?t.message:null,p=async(k,z)=>{try{const V=n||{builtInTools:[]},ee=Yi(V.builtInTools),se=z?[...ee.filter(ne=>ne!==k),k]:ee.filter(ne=>ne!==k),ce=Yi(se),be={...V,builtInTools:ce};Bn("/api/settings",be,!1);const _e=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({builtInTools:ce})});if(!_e.ok)throw new Error(`Failed to update tool settings: ${_e.status}`);Bn("/api/settings"),console.log(`${k} is now ${z?"enabled":"disabled"}`)}catch(V){console.error("Error updating tool settings:",V),alert(`Error updating ${k}: ${V instanceof Error?V.message:"Unknown error"}`),Bn("/api/settings")}},y=async(k,z)=>{const V=[...u];V[k]=z,d(V),await w(V)},x=async(k,z)=>{const V=[...s];V[k]=z,i(V),u[k]&&await w(u)},b=async(k,z)=>{const V=[...a];V[k]=z,c(V),u[k]&&await w(u)},w=async k=>{try{const z=[];for(let ee=0;ee<3;ee++)k[ee]&&s[ee]&&a[ee]&&z.push({_id:`space-${ee}`,name:s[ee],subdomain:a[ee],emoji:"🔧"});const V=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({spaceTools:z})});if(!V.ok)throw new Error(`Failed to update space tools: ${V.status}`)}catch(z){console.error("Error updating space tools:",z)}},S=async()=>{const k="https://huggingface.co/mcp";try{await navigator.clipboard.writeText(k)}catch(z){console.error("Failed to copy URL:",z)}},C=()=>{window.open("https://huggingface.co/settings/mcp","_blank")},N={paper_search:{id:Bi,label:Do.annotations.title,description:Do.description,settings:{enabled:((L=n==null?void 0:n.builtInTools)==null?void 0:L.includes(Bi))??!0}},space_search:{id:Gi,label:Oo.annotations.title,description:Oo.description,settings:{enabled:((K=n==null?void 0:n.builtInTools)==null?void 0:K.includes(Gi))??!0}},model_search:{id:Ui,label:Fo.annotations.title,description:Fo.description,settings:{enabled:((U=n==null?void 0:n.builtInTools)==null?void 0:U.includes(Ui))??!0}},dataset_search:{id:Wi,label:$o.annotations.title,description:$o.description,settings:{enabled:((Z=n==null?void 0:n.builtInTools)==null?void 0:Z.includes(Wi))??!0}},hub_repo_details:{id:pn,label:Lo.annotations.title,description:Lo.description,settings:{enabled:((A=n==null?void 0:n.builtInTools)==null?void 0:A.includes(pn))??!0}},include_readme:{id:bi,label:"Allow README Include (flag)",description:"Allows hub_repo_details to attach README content when the tool request explicitly opts in. Requires reconnect to take effect.",settings:{enabled:r}},doc_semantic_search:{id:Ki,label:zo.annotations.title,description:zo.description,settings:{enabled:((te=n==null?void 0:n.builtInTools)==null?void 0:te.includes(Ki))??!0}},doc_fetch:{id:Xi,label:Vo.annotations.title,description:Vo.description,settings:{enabled:((I=n==null?void 0:n.builtInTools)==null?void 0:I.includes(Xi))??!0}}},E={duplicate_space:{id:qi,label:Tc.annotations.title,description:"Duplicate a Hugging Face Space to your account.",settings:{enabled:((Q=n==null?void 0:n.builtInTools)==null?void 0:Q.includes(qi))??!0}},space_files:{id:Zi,label:jc.annotations.title,description:"List all files in a static Hugging Face Space with download URLs.",settings:{enabled:((R=n==null?void 0:n.builtInTools)==null?void 0:R.includes(Zi))??!0}},no_gradio_images:{id:_i,label:"Disable Gradio Images (flag)",description:"Strips image responses from Gradio spaces. Mirrors the 'no_image_content' URL parameter and requires reconnect to take effect.",settings:{enabled:o}}};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"min-h-screen p-4 sm:p-8 pb-20",children:l.jsx("div",{className:"max-w-4xl mx-auto",children:l.jsxs(Mv,{defaultValue:"metrics",className:"w-full",children:[l.jsxs(Nv,{className:"mb-6 w-full overflow-x-auto flex-nowrap",children:[l.jsx(Bt,{value:"metrics",className:"whitespace-nowrap",children:"📊 Metrics"}),l.jsx(Bt,{value:"mcp",className:"whitespace-nowrap",children:"🔧 MCP"}),!(e!=null&&e.externalApiMode)&&l.jsx(Bt,{value:"search",className:"whitespace-nowrap",children:"🔍 Search"}),!(e!=null&&e.externalApiMode)&&l.jsx(Bt,{value:"spaces",className:"whitespace-nowrap",children:"🚀 Spaces"}),!(e!=null&&e.externalApiMode)&&l.jsx(Bt,{value:"gradio",className:"whitespace-nowrap",children:"🚀 Gradio"}),l.jsx(Bt,{value:"home",className:"whitespace-nowrap",children:"🏠 Home"})]}),l.jsx(Wt,{value:"metrics",className:"mt-0",children:l.jsx(xv,{})}),l.jsx(Wt,{value:"mcp",className:"mt-0",children:l.jsx(wv,{})}),!(e!=null&&e.externalApiMode)&&l.jsx(Wt,{value:"search",className:"mt-0",children:l.jsx(Vs,{title:"🤗 Hugging Face Search Tools (MCP)",description:"Find and use Hugging Face and Community content.",tools:N,onToolToggle:p})}),!(e!=null&&e.externalApiMode)&&l.jsx(Wt,{value:"spaces",className:"mt-0",children:l.jsx(Vs,{title:"🤗 Hugging Face Space Tools (MCP)",description:"Manage and duplicate Hugging Face Spaces.",tools:E,onToolToggle:p})}),!(e!=null&&e.externalApiMode)&&l.jsx(Wt,{value:"gradio",className:"mt-0",children:l.jsx(zd,{spaceNames:s,spaceSubdomains:a,enabledSpaces:u,onSpaceToolToggle:y,onSpaceToolNameChange:x,onSpaceToolSubdomainChange:b})}),l.jsx(Wt,{value:"home",className:"mt-0",children:l.jsxs(st,{children:[l.jsxs(it,{children:[l.jsx(at,{children:"🤗 HF MCP Server"}),l.jsx(Ft,{children:"Connect with AI assistants through the Model Context Protocol"})]}),l.jsxs(lt,{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground mb-3",children:"What's MCP?"}),l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external data sources and tools. This HF MCP Server provides access to Hugging Face's ecosystem of models, datasets, and Spaces, allowing AI assistants to search, analyze, and interact with ML resources directly."})]}),l.jsx(It,{}),l.jsx("div",{className:"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-start space-x-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"Tool Management Scope"}),((e==null?void 0:e.externalApiMode)||(e==null?void 0:e.transport)!=="stdio"&&!(e!=null&&e.externalApiMode))&&l.jsx("p",{className:"text-sm text-blue-700 dark:text-blue-300 leading-relaxed",children:e!=null&&e.externalApiMode?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"External API Mode:"})," Tools are managed by an external API. Tool Selection Tabs are not available."]}):l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"Shared Mode:"})," Tool toggles in this interface affect"," ",l.jsx("strong",{children:"all connected MCP server instances"})," and control tool availability for all connected Hosts."]})})]})]})}),l.jsx(It,{}),l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs(jt,{size:"xl",onClick:S,className:"w-full transition-all duration-200 active:bg-green-500 active:border-green-500 touch-manipulation",children:[l.jsx(Nd,{className:"mr-2 h-5 w-5"}),"Copy MCP URL"]}),l.jsxs(jt,{size:"xl",variant:"outline",onClick:C,className:"w-full touch-manipulation",children:[l.jsx(Id,{className:"mr-2 h-5 w-5"}),"Go to Settings"]})]})]})]})})]})})}),l.jsx(bv,{isLoading:f,error:v,transportInfo:e||{transport:"unknown"}})]})}$c.createRoot(document.getElementById("root")).render(l.jsx(h.StrictMode,{children:l.jsx(Cx,{})}));
|