@deepagents/devtool 7.9.0 → 7.10.1

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.
@@ -0,0 +1,12 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./chat-Bcq_Wic7.js","./preload-helper-DtyrgAzE.js","./runtime-data-khm-r79m.js","./chunk-YOKDWASO--mimiz6j.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,d as t,i as n,o as r,r as i,t as a}from"./preload-helper-DtyrgAzE.js";import{$ as o,$n as s,An as c,Ar as l,At as u,B as d,Bn as f,Br as p,Bt as m,Cn as h,Cr as g,Ct as _,D as v,Dn as y,Dr as b,Dt as x,En as S,Er as C,Et as w,Fn as T,Fr as E,G as D,Gn as O,Gr as k,H as A,Hn as j,Hr as M,Ht as N,I as P,In as F,Ir as I,It as L,J as R,Jn as z,Jr as B,Jt as V,K as H,Kn as U,Kr as ee,L as te,Ln as W,Lr as G,Lt as ne,Mn as re,Mr as ie,Mt as ae,Nn as oe,Nr as K,Nt as se,Ot as ce,Pn as le,Pr as ue,Pt as de,Q as fe,Qn as pe,Qr as me,R as he,Rn as ge,Rr as _e,Rt as ve,S as ye,Sn as be,Sr as xe,St as Se,T as Ce,Tn as q,Tr as we,Tt as Te,U as Ee,Un as De,Ur as Oe,Ut as ke,V as Ae,Vn as je,Vr as Me,Vt as Ne,W as Pe,Wn as Fe,Wr as Ie,X as Le,Xr as Re,Yn as ze,Yr as Be,Z as Ve,Zr as J,_i as He,_n as Ue,_r as We,_t as Ge,a as Ke,ai as qe,an as Je,ar as Ye,at as Xe,bn as Ze,br as Y,bt as Qe,c as $e,ci as et,cn as tt,cr as nt,ct as rt,d as it,di as at,dn as ot,dr as st,dt as ct,en as lt,er as ut,et as dt,f as ft,fi as pt,fn as mt,fr as ht,ft as gt,gi as _t,gn as vt,gr as yt,gt as bt,h as xt,hi as St,hn as Ct,hr as wt,ht as Tt,i as Et,ii as Dt,in as Ot,ir as kt,it as At,j as jt,jn as Mt,jr as Nt,jt as Pt,k as Ft,kn as It,kr as Lt,kt as Rt,l as zt,li as Bt,ln as Vt,lr as Ht,lt as Ut,mi as Wt,mn as Gt,mr as Kt,mt as qt,n as Jt,ni as Yt,nr as Xt,nt as Zt,o as Qt,oi as $t,on as en,or as tn,ot as nn,pi as rn,pn as X,pr as an,pt as on,q as sn,qn as cn,qr as ln,r as un,ri as dn,rn as fn,rr as pn,rt as mn,s as hn,si as gn,sn as _n,sr as vn,st as yn,t as bn,ti as xn,tn as Sn,tr as Cn,tt as wn,u as Tn,ui as En,un as Dn,ur as On,ut as kn,v as An,vi as jn,vr as Mn,vt as Nn,w as Pn,wn as Fn,wr as In,wt as Ln,x as Rn,xn as zn,xr as Bn,xt as Vn,yn as Hn,yr as Un,yt as Wn,z as Gn,zn as Kn,zr as qn,zt as Jn}from"./runtime-data-khm-r79m.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Yn=class extends jn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Dt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Zn(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qn(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qn(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof En(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!pt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&$n(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||at(this.options.staleTime,this.#t)!==at(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||En(this.options.enabled,this.#t)!==En(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return tr(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(et)),t}#g(){this.#b();let e=at(this.options.staleTime,this.#t);if(qe.isServer()||this.#r.isStale||!gn(e))return;let t=St(this.#r.dataUpdatedAt,e)+1;this.#d=_t.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(qe.isServer()||En(this.options.enabled,this.#t)===!1||!gn(this.#p)||this.#p===0)&&(this.#f=_t.setInterval(()=>{(this.options.refetchIntervalInBackground||He.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(_t.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(_t.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Zn(e,t),o=i&&$n(e,n,t,r);(a||o)&&(l={...l,...Yt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Bt(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Bt(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:er(e,t),refetch:this.refetch,promise:this.#o,isEnabled:En(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Dt();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!pt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){dn.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Xn(e,t){return En(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&En(t.retryOnMount,e)===!1)}function Zn(e,t){return Xn(e,t)||e.state.data!==void 0&&Qn(e,t,t.refetchOnMount)}function Qn(e,t,n){if(En(t.enabled,e)!==!1&&at(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&er(e,t)}return!1}function $n(e,t,n,r){return(e!==t||En(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&er(e,n)}function er(e,t){return En(t.enabled,e)!==!1&&e.isStaleByTime(at(t.staleTime,e))}function tr(e,t){return!pt(e.getCurrentResult(),t)}var nr=class extends jn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),pt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&$t(t.mutationKey)!==$t(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??xn();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){dn.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Z=t(e(),1),Q=n(),rr=Z.createContext(void 0),ir=e=>{let t=Z.useContext(rr);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},ar=({client:e,children:t})=>(Z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Q.jsx)(rr.Provider,{value:e,children:t})),or=Z.createContext(!1),sr=()=>Z.useContext(or);or.Provider;function cr(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var lr=Z.createContext(cr()),ur=()=>Z.useContext(lr),dr=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?rn(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},fr=e=>{Z.useEffect(()=>{e.clearReset()},[e])},pr=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||rn(n,[e.error,r])),mr=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},hr=(e,t)=>e.isLoading&&e.isFetching&&!t,gr=(e,t)=>e?.suspense&&t.isPending,_r=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function vr(e,t,n){let r=sr(),i=ur(),a=ir(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,mr(o),dr(o,i,s),fr(i);let l=!a.getQueryCache().get(o.queryHash),[u]=Z.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(Z.useSyncExternalStore(Z.useCallback(e=>{let t=f?u.subscribe(dn.batchCalls(e)):et;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),Z.useEffect(()=>{u.setOptions(o)},[o,u]),gr(o,d))throw _r(o,u,i);if(pr({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!qe.isServer()&&hr(d,r)&&(l?_r(o,u,i):s?.promise)?.catch(et).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function yr(e,t){return vr(e,Yn,t)}function br(e,t){let n=ir(t),[r]=Z.useState(()=>new nr(n,e));Z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Z.useSyncExternalStore(Z.useCallback(e=>r.subscribe(dn.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Z.useCallback((e,t)=>{r.mutate(e,t).catch(et)},[r]);if(i.error&&rn(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var xr={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};xr.node;var Sr=Re(xr),Cr={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Cr.node;var wr=Re(Cr),Tr={name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M17 15.5v1.7l1 .625`,key:`100ewj`}],[`path`,{d:`M21 8.936V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h3.935`,key:`g2sirp`}],[`path`,{d:`M3 9h9.873`,key:`7y8bi6`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`17`,cy:`17`,r:`5`,key:`1op1d2`}]]};Tr.node;var Er=Re(Tr),Dr={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Dr.node;var Or=Re(Dr),kr={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};kr.node;var Ar=Re(kr),jr={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};jr.node;var Mr=Re(jr),Nr={name:`file-clock`,size:24,node:[[`path`,{d:`M14 2v5a1 1 0 001 1h5`,key:`9v5fu7`}],[`path`,{d:`M14.5 22H18a2 2 0 002-2V8a2.4 2.4 0 00-.706-1.706l-3.588-3.588A2.4 2.4 0 0014 2H6a2 2 0 00-2 2v4.512`,key:`1udmio`}],[`path`,{d:`M7 15.5v1.7l1 .625`,key:`cwgthf`}],[`circle`,{cx:`7`,cy:`17`,r:`5`,key:`1gmidx`}]]};Nr.node;var Pr=Re(Nr),Fr={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};Fr.node;var Ir=Re(Fr),Lr={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};Lr.node;var Rr=Re(Lr),zr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};zr.node;var Br=Re(zr),Vr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Vr.node;var Hr=Re(Vr),Ur={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Ur.node;var Wr=Re(Ur),Gr={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Gr.node;var Kr=Re(Gr),qr={name:`square-function`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]],aliases:[`function-square`]};qr.node;var Jr=Re(qr),Yr={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};Yr.node;var Xr=Re(Yr);function Zr(e){return e?.ownerDocument||document}function Qr(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:$r,platform:ei,maxTouchPoints:ti}=Qr(),ni=$r.toLowerCase(),ri=ei.toLowerCase(),ii=/^i(os$|p)/.test(ri)||ri===`macintel`&&ti>1,ai=`android`,oi=ri===ai||ni.includes(ai),si=!ii&&ri.startsWith(`mac`);ri.startsWith(`win`),!oi&&/^(linux|chrome os)/.test(ri);var ci=si||ii,li=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!li&&ni.includes(`firefox`),!li&&ni.includes(`chrom`);var ui=ci,di=/jsdom|happydom/.test(ni),fi={},pi={},mi=``;function hi(e,t){return Fe(e)?e:t}function gi(e,t,n){return/hidden|clip/.test(e.getComputedStyle(hi(t,n)).overflowY)}function _i(e){if(typeof document>`u`)return!1;let t=Zr(e);return ge(t).innerWidth-t.documentElement.clientWidth>0}function vi(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Zr(e),n=t.documentElement,r=t.body,i=hi(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function yi(e){let t=Zr(e),n=t.documentElement,r=t.body,i=hi(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function bi(e){let t=Zr(e),n=t.documentElement,r=t.body,i=ge(n),a=0,o=0,s=!1,c=ut.create();if(li&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,fi={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},mi=n.style.scrollBehavior,pi={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=hi(n,r);if(s=vi(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,fi),Object.assign(r.style,pi),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=mi)}function d(){u(),c.request(l)}l();let f=q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var xi=new class{lockCount=0;restore=null;timeoutLock=h.create();timeoutUnlock=h.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Zr(e),n=t.documentElement,r=t.body,i=ge(n);if(gi(i,n,r)){let t=new i.MutationObserver(()=>{gi(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ii||!_i(e);this.restore=a?yi(e):bi(e)}};function Si(e=!0,t=null){K(()=>{if(e)return xi.acquire(t)},[e,t])}function Ci(e){e.preventDefault(),e.stopPropagation()}function wi(e){return`nativeEvent`in e}function Ti(e){return e.pointerType===``&&e.isTrusted?!0:oi&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ei(e){return di?!1:!oi&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(oi||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Di(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Oi(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ki=`data-base-ui-focusable`,Ai=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ji=`ArrowLeft`,Mi=`ArrowRight`,Ni=`ArrowUp`,Pi=`ArrowDown`,Fi=`data-open`,Ii=`data-closed`,Li=`data-anchor-hidden`,Ri=`data-popup-open`,zi=`data-pressed`,Bi={[Ri]:``},Vi={[Ri]:``,[zi]:``},Hi={[Fi]:``},Ui={[Ii]:``},Wi={[Li]:``},Gi={open(e){return e?Bi:null}},Ki={open(e){return e?Vi:null}},qi={open(e){return e?Hi:Ui},anchorHidden(e){return e?Wi:null}},Ji={...qi,...ze},Yi=`data-trigger-disabled`;function Xi(e,t){if(!f(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Yi);for(let[,e]of t.entries())if(X(e,n))return!e.hasAttribute(Yi);return!1}function Zi(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Qi(e){return e.matches(`html,body`)}function $i(e){return je(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ea(e){return mt(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ai}`)!=null}function ta(e){return e?e.getAttribute(`role`)===`combobox`&&$i(e):!1}function na(e){if(!e||di)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ra(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ia(e,t){return t!=null&&!Di(t)?0:typeof e==`function`?e():e}function aa(e,t,n){let r=ia(e,n);return typeof r==`number`?r:r?.[t]}function oa(e){return typeof e==`function`?e():e}function sa(e,t){return t||e===`click`||e===`mousedown`}function ca(e){return e?.includes(`mouse`)&&e!==`mousedown`}var la=Z.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new h,currentIdRef:{current:null},currentContextRef:{current:null}});function ua(e,t){e.current=t.current}function da(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=Z.useContext(la),[d,f]=Z.useState(!1),p=Z.useRef(n);return K(()=>{p.current=n},[n]),K(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),K(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:aa(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,Y(ht))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),K(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,ua(a,s),u.clear()}},[c,i,a,r,s,u]),Z.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function fa(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var pa=Z.forwardRef(function(e,t){let[n,r]=Z.useState();K(()=>{ui&&li&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Q.jsx)(`span`,{...e,ref:t,style:Vt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),ma=Math.min,ha=Math.max,ga=Math.round,_a=Math.floor,va=e=>({x:e,y:e}),ya={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ba(e,t,n){return ha(e,ma(t,n))}function xa(e,t){return typeof e==`function`?e(t):e}function Sa(e){return e.split(`-`)[0]}function Ca(e){return e.split(`-`)[1]}function wa(e){return e===`x`?`y`:`x`}function Ta(e){return e===`y`?`height`:`width`}function Ea(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Da(e){return wa(Ea(e))}function Oa(e,t,n){n===void 0&&(n=!1);let r=Ca(e),i=Da(e),a=Ta(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=La(o)),[o,La(o)]}function ka(e){let t=La(e);return[Aa(e),t,Aa(t)]}function Aa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ja=[`left`,`right`],Ma=[`right`,`left`],Na=[`top`,`bottom`],Pa=[`bottom`,`top`];function Fa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ma:ja:t?ja:Ma;case`left`:case`right`:return t?Na:Pa;default:return[]}}function Ia(e,t,n,r){let i=Ca(e),a=Fa(Sa(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Aa)))),a}function La(e){let t=Sa(e);return ya[t]+e.slice(t.length)}function Ra(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function za(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ra(e)}function Ba(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Va=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ha(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return O(n)?n.host:null}function Ua(e){for(let t of Array.from(e.children))if(le(t)===`summary`)return t;return null}function Wa(e,t){let n=Ua(t);return!!n&&(e===n||X(n,e))}function Ga(e){let t=e?le(e):``;return e!=null&&e.matches(Va)&&(t!==`summary`||e.parentElement!=null&&le(e.parentElement)===`details`&&Ua(e.parentElement)===e)&&(t!==`details`||Ua(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Ka(e){if(!Ga(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ha(t)){let n=t!==e,r=le(t)===`slot`;if(t.hasAttribute(`inert`)||n&&le(t)===`details`&&!t.open&&!Wa(e,t)||t.hasAttribute(`hidden`)||!r&&!qa(t,n))return!1}return!0}function qa(e,t){let n=c(e);return t?n.display!==`none`:en(e,n)}function Ja(e){let t=e.tabIndex;if(t<0){let t=le(e);if(t===`details`||t===`audio`||t===`video`||je(e)&&e.isContentEditable)return 0}return t}function Ya(e){if(le(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Xa(e,t){let n=Ya(e);if(!n)return!0;let r=t.find(e=>{let t=Ya(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Ya(e);return t?.name===n.name&&t.form===n.form})===n}function Za(e){if(je(e)&&le(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return je(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Qa(e,t){Za(e).forEach(e=>{Ga(e)&&t.push(e),Qa(e,t)})}function $(e,t,n){Za(e).forEach(e=>{je(e)&&e.matches(t)&&n.push(e),$(e,t,n)})}function $a(e){return Ka(e)&&Ja(e)>=0}function eo(e){let t=[];return Qa(e,t),t.filter(Ka)}function to(e){let t=eo(e);return t.filter(e=>Ja(e)>=0&&Xa(e,t))}function no(e,t){let n=to(e),r=n.length;if(r===0)return;let i=ot(Zr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function ro(e){return no(Zr(e).body,1)||e}function io(e){return no(Zr(e).body,-1)||e}function ao(e,t,n){if(!e)return null;let r=[];Qa(Zr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Ka);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!X(n,o)&&$a(o)&&Xa(o,a))return o}return r[i]}function oo(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function so(e){to(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function co(e){let t=[];$(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function lo(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...lo(e,t.id,n)])}function uo(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function fo(e){return`data-base-ui-${e}`}var po=0;function mo(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(po);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),I;let o=requestAnimationFrame(a);return po=o,()=>{po===o&&(cancelAnimationFrame(o),po=0)}}var ho=`data-base-ui-inert`,go=new WeakMap,_o=new WeakSet,vo=new WeakMap,yo=0;function bo(e){return e?O(e)?e.host:bo(e.parentNode):null}var xo=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=bo(t);return e.contains(n)?n:null}).filter(e=>e!=null),So=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Co=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{le(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function wo(e,t,n,{mark:r=!0}){let i=xo(t,e),a=r?Co(t,So(i),new Set(i)):[],o=[],s=[];if(n){let e=xo(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Co(t,So(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(go.get(e)||0)+1;go.set(e,r),o.push(e),r===1&&n&&_o.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(vo.get(e)||0)+1;vo.set(e,t),s.push(e),t===1&&e.setAttribute(ho,``)}),yo+=1,()=>{o.forEach(e=>{let t=(go.get(e)||0)-1;go.set(e,t),t||(_o.has(e)||e.removeAttribute(`aria-hidden`),_o.delete(e))}),r&&s.forEach(e=>{let t=(vo.get(e)||0)-1;vo.set(e,t),t||e.removeAttribute(ho)}),--yo,yo||(go=new WeakMap,_o=new WeakSet,vo=new WeakMap)}}function To(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Zr(e[0]).body;return wo(e,i,n,{mark:r})}var Eo={style:{transition:`none`}},Do={fallbackAxisSide:`none`},Oo={fallbackAxisSide:`end`},ko={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ao=t(i(),1),jo=Z.createContext(null),Mo=()=>Z.useContext(jo),No=fo(`portal`);function Po(e={}){let{ref:t,container:n,componentProps:r=E,elementProps:i}=e,a=g(),o=Mo()?.portalNode,[s,c]=Z.useState(null),[l,u]=Z.useState(null),d=G(e=>{e!==null&&u(e)}),f=Z.useRef(null);K(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(De(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=C(`div`,r,{ref:[t,d],props:[{id:a,[No]:``},i]}),m=s&&p?Ao.createPortal(p,s):null;return{node:l,nodeId:Z.isValidElement(p)?p.props.id:void 0,subtree:m}}var Fo=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Po({container:o,ref:t,componentProps:e,elementProps:c}),f=Z.useRef(null),p=Z.useRef(null),m=Z.useRef(null),h=Z.useRef(null),[g,_]=Z.useState(null),v=Z.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;Z.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&oo(e)&&(e.type===`focusin`?v.current&&=(co(l),!1):(so(l),v.current=!0))}return fa(q(l,`focusin`,e,!0),q(l,`focusout`,e,!0))},[l,y]),K(()=>{!l||b!==!0||!v.current||(co(l),v.current=!1)},[b,l]);let S=Z.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Q.jsxs)(Z.Fragment,{children:[d,(0,Q.jsxs)(jo.Provider,{value:S,children:[x&&l&&(0,Q.jsx)(pa,{"data-type":`outside`,ref:f,onFocus:e=>{oo(e,l)?m.current?.focus():io(g?g.domReference:null)?.focus()}}),x&&l&&(0,Q.jsx)(`span`,{role:s,"aria-owns":u,style:ko}),l&&Ao.createPortal(a,l),x&&l&&(0,Q.jsx)(pa,{"data-type":`outside`,ref:p,onFocus:e=>{oo(e,l)?h.current?.focus():(ro(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Y(`focus-out`,e.nativeEvent)))}})]})]})});function Io(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Lo=class{nodesRef={current:[]};events=Io();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Ro=Z.createContext(null),zo=Z.createContext(null),Bo=()=>Z.useContext(Ro)?.id||null,Vo=e=>{let t=Z.useContext(zo);return e??t};function Ho(e){let t=g(),n=Vo(e),r=Bo();return K(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Uo(e){let{children:t,id:n}=e,r=Bo();return(0,Q.jsx)(Ro.Provider,{value:Z.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Wo(e){let{children:t,externalTree:n}=e,r=_e(()=>n??new Lo).current;return(0,Q.jsx)(zo.Provider,{value:r,children:t})}function Go(e,t){let n=ge(Gt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Ti(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ko=20,qo=[];function Jo(){qo=qo.filter(e=>e.deref()?.isConnected)}function Yo(e){Jo(),e&&le(e)!==`body`&&(qo.push(new WeakRef(e)),qo.length>Ko&&(qo=qo.slice(-20)))}function Xo(){return Jo(),qo[qo.length-1]?.deref()}function Zo(e){return e?$a(e)?e:to(e)[0]||e:null}function Qo(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=eo(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return $a(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function $o(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=G(()=>x.current.floatingContext?.nodeId),C=i===!1,w=ta(v)&&C,T=be(i),E=be(a),D=be(o),O=be(d),k=be(_),A=Vo(h),j=Mo(),M=Z.useRef(!1),N=Z.useRef(!1),P=Z.useRef(!1),F=Z.useRef(null),I=Z.useRef(``),L=Z.useRef(``),R=Z.useRef(null),z=Z.useRef(null),B=l(R,m,j?.beforeInsideRef),V=l(z,j?.afterInsideRef),H=Fn(),U=Fn(),ee=Cn(),te=j!=null,W=ra(y),ne=G((e=W)=>e?to(e):[]),re=G(()=>g?.().filter(e=>e!=null)??[]);Z.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&X(W,ot(Zr(W)))&&ne().length===0&&!w&&Ci(e)}return q(Zr(W),`keydown`,e)},[r,W,c,w,ne]),Z.useEffect(()=>{if(r||!_)return;let e=Zr(W);function t(){P.current=!1}function n(e){let t=Gt(e),n=re(),r=X(y,t)||X(v,t)||X(j?.portalNode,t)||n.some(e=>e===t||X(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,mt(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,U.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return fa(q(e,`pointerdown`,n,!0),q(e,`pointerup`,t,!0),q(e,`pointercancel`,t,!0),q(e,`keydown`,i,!0),t)},[r,y,v,W,_,j,U,re]),Z.useEffect(()=>{if(r||!u)return;let e=Zr(W);function n(){N.current=!0,U.start(0,()=>{N.current=!1})}function i(e){let t=Gt(e);$a(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Gt(n);c&&r==null&&a!=null&&X(y,a)&&Yo(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=re(),d=r?.hasAttribute(fo(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,zn(p),zn(f)].includes(r),m=!(X(v,r)||X(y,r)||X(r,y)||X(j?.portalNode,r)||u.some(e=>e===r||X(e,r))||l.hasMatchingElement(e=>X(e,r))||d||A&&(lo(A.nodesRef.current,o).find(e=>X(e.context?.elements.floating,r)||X(e.context?.elements.domReference,r))||uo(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,ra(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&W&&Qo(W),s&&i!==v&&!en(a)&&ot(e)===e.body){if(je(W)&&(W.focus(),s===`popup`)){ee.request(()=>{W.focus()});return}let e=ne(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;je(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!c)&&r&&m&&!N.current&&(w||r!==Xo())&&(M.current=!0,t.setOpen(!1,Y(vn,n)))})}function o(){P.current||(x.current.insideReactTree=!0,H.start(0,()=>{x.current.insideReactTree=!1}))}let l=je(v)?v:null;if(!(!y&&!l))return fa(l&&q(l,`focusout`,a),l&&q(l,`pointerdown`,n),y&&q(y,`focusin`,i),y&&q(y,`focusout`,a),y&&j&&q(y,`focusout`,o,!0))},[r,v,y,W,c,A,j,t,u,s,ne,w,S,x,H,U,ee,f,p,re]),Z.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${fo(`portal`)}]`)||[]),t=(A?uo(A.nodesRef.current,S()):[]).find(e=>ta(e.context?.elements.domReference||null))?.context?.elements.domReference,n=To([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...re(),t,zn(p),zn(f),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=To([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,f,p,re]),K(()=>{if(!_||r||!je(W))return;I.current=``,L.current=``;let e=Zr(W),t=ot(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||X(W,t))return;let i=null,a=()=>(i??=ne(W),i[0]||W),o;o=r===!0||r===null?a():zn(r),o||=a();let s=X(W,ot(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Ti(c);mo(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=ot(e);return!(t!==o&&X(W,t))}})})},[r,_,W,ne,T,O,k,x]);let ie=Z.useRef(null);K(()=>{if(r||!W){ie.current=null;return}ie.current&&=(ie.current.cancelled=!0,null);let e=Zr(W),t=ot(e),n=O.current==null;Yo(t);function i(e){if(e.open||(I.current=Go(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(fo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`)if(e.nested)M.current=!1;else if(Ti(e.nativeEvent)||Ei(e.nativeEvent))M.current=!1;else{let e=!1;Zr(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&le(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Xo()||null,typeof i==`boolean`?s:zn(i)||s||null}return()=>{b.off(`openchange`,i);let t=ot(e),n=re(),r=X(y,t)||n.some(e=>e===t||X(e,t))||A&&lo(A.nodesRef.current,S(),!1).some(e=>X(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};ie.current=l,queueMicrotask(()=>{ie.current===l&&(ie.current=null);let n=Zo(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&je(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,W,E,D,O,b,A,v,S,re]),K(()=>{if(!li||_||!y)return;let e=ot(Zr(y));!je(e)||!$i(e)||X(y,e)&&e.blur()},[_,y]),K(()=>{if(!(r||!j))return j.setFocusManagerState({modal:c,closeOnFocusOut:u,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,u,v]),K(()=>{if(!(r||!W))return Qo(W),()=>{queueMicrotask(Jo)}},[r,W]);let ae=!r&&(!c||!w)&&(te||c);return(0,Q.jsxs)(Z.Fragment,{children:[ae&&(0,Q.jsx)(pa,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=ne();mo(e[e.length-1])}else j?.portalNode&&(M.current=!1,oo(e,j.portalNode)?ro(v)?.focus():zn(p??j.beforeOutsideRef)?.focus())}}),n,ae&&(0,Q.jsx)(pa,{"data-type":`inside`,ref:V,onFocus:e=>{c?mo(ne()[0]):j?.portalNode&&(u&&(M.current=!0),oo(e,j.portalNode)?io(v)?.focus():zn(f??j.afterOutsideRef)?.focus())}})]})}function es(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Mn}=t,l=e.context.dataRef,u=Z.useRef(void 0),d=Cn(),f=Fn(),p=Z.useMemo(()=>{function t(t,n,r,i){let a=Y(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=Di(e.pointerType,!0)&&Ei(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Di(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Gt(s),p=$i(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}Di(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return Z.useMemo(()=>n?{reference:p}:E,[n,p])}function ts(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function ns(e){return e!=null&&e.clientX!=null}function rs(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=Z.useRef(!1),l=Z.useRef(null),[u,d]=Z.useState(),[f,p]=Z.useState([]),m=G(t=>{e.set(`positionReference`,t)}),h=G((t,n,i)=>{c.current||s.current.openEvent&&!ns(s.current.openEvent)||e.set(`positionReference`,ts(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=G(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=Di(u)?a:i;Z.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=ge(a);function r(t){let n=Gt(t);X(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||ns(s.current.openEvent)?l.current=q(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),Z.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),Z.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),Z.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=Z.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return Z.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function is(){return!1}function as(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function os(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=is,bubbles:s,externalTree:l}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:p,events:m}=e.context,g=Vo(l),_=G(typeof i==`function`?i:()=>!1),v=typeof i==`function`?_:i,y=v!==!1,b=G(()=>a),{escapeKey:x,outsidePress:S}=as(s),C=Z.useRef(!1),w=Z.useRef(!1),T=Z.useRef(!1),E=Z.useRef(!1),D=Z.useRef(!1),k=Z.useRef(``),A=Z.useRef(null),M=Fn(),N=Fn(),P=Fn(),F=G(()=>{N.clear(),p.current.insideReactTree=!1}),I=G(e=>{let t=p.current.floatingContext?.nodeId;return(g?lo(g.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),L=G(t=>Zi(t,e.select(`floatingElement`))||Zi(t,e.select(`domReferenceElement`))),R=G(t=>{o()&&e.setOpen(!1,Y(Mn,t.nativeEvent))}),z=G(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=wi(t)?t.nativeEvent:t;if(D.current||i.isComposing||!x&&I(`__escapeKeyBubbles`))return;let a=Y(tn,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!x&&!a.isPropagationAllowed&&t.stopPropagation()}),B=G(()=>{p.current.insideReactTree=!0,N.start(0,F)}),V=G(t=>{if(!u||!n||t.button!==0)return;let r=Gt(t.nativeEvent);X(e.select(`floatingElement`),r)&&(C.current||(C.current=!0,w.current=!1))}),H=G(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});Z.useEffect(()=>{function e(e){e.open||(E.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),Z.useEffect(()=>F,[F]),Z.useEffect(()=>{if(!u||!n)return u||(E.current=!1,D.current=!1,k.current=``,A.current=null),F;p.current.__escapeKeyBubbles=x,p.current.__outsidePressBubbles=S;let t=new h,i=Zr(d);function a(){P.clear(),D.current=!0}function o(){D.current=!0,P.start(li?5:0,()=>{D.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function l(){C.current=!1,w.current=!1}function m(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=b(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function _(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function N(e){let t=p.current.floatingContext?.nodeId,n=g&&lo(g.nodesRef.current,t).some(t=>Zi(e,t.context?.elements.floating));return L(e)||n}function R(n){if(_(n)){n.type!==`click`&&!L(n)&&(t.clear(),T.current=!1),F();return}if(p.current.insideReactTree){F();return}let r=Gt(n),i=`[${fo(`inert`)}]`,a=f(r)?r.getRootNode():null,o=Array.from((O(a)?a:Zr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>X(e,r))))return;let l=f(r)?r:null;for(;l&&!j(l);){let e=W(l);if(j(e)||!f(e))break;l=e}if(!(o.length&&f(r)&&!Qi(r)&&!X(r,e.select(`floatingElement`))&&o.every(e=>!X(l,e)))){if(je(r)&&!(`touches`in n)){let e=j(r),t=c(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,l=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,u=t.direction===`rtl`,d=l&&(u?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),f=s&&n.offsetY>r.clientHeight;if(d||f)return}if(!N(n)){if(m()===`intentional`){if(n.detail!==0&&!Ti(n)&&!E.current)return;if(T.current){t.clear(),T.current=!1;return}}typeof v==`function`&&!v(n)||I(`__outsidePressBubbles`)||(e.setOpen(!1,Y(an,n)),F())}}}function B(t){m()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||L(t)||R(t)}function V(t){if(m()!==`sloppy`||!e.select(`open`)||!n||L(t))return;let r=t.touches[0];r&&(A.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function H(e,t){let n=Gt(e);if(!n)return;let r=q(n,e.type,()=>{t(e),r()})}function U(e){k.current=`touch`,H(e,V)}function ee(e){M.clear(),e.type===`pointerdown`&&(e.button===0&&(E.current=!0),k.current=e.pointerType),!(e.type===`mousedown`&&A.current&&!A.current.dismissOnMouseDown)&&H(e,e=>{e.type===`pointerdown`?B(e):R(e)})}function te(e){if(e.type===`pointercancel`&&(E.current=!1),!C.current)return;let n=w.current;if(l(),m()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!N(e)){if(n){s();return}typeof v==`function`&&!v(e)||(t.clear(),T.current=!0,F())}}}function G(e){if(m()!==`sloppy`||!A.current||L(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-A.current.startX),r=Math.abs(t.clientY-A.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(A.current.dismissOnTouchEnd=!0),i>10&&(R(e),M.clear(),A.current=null)}function ne(e){H(e,G)}function re(e){m()!==`sloppy`||!A.current||L(e)||(A.current.dismissOnTouchEnd&&R(e),M.clear(),A.current=null)}function ie(e){H(e,re)}let ae=fa(r&&fa(q(i,`keydown`,z),q(i,`compositionstart`,a),q(i,`compositionend`,o)),y&&fa(q(i,`click`,ee,!0),q(i,`pointerdown`,ee,!0),q(i,`pointerup`,te,!0),q(i,`pointercancel`,te,!0),q(i,`mousedown`,ee,!0),q(i,`mouseup`,te,!0),q(i,`touchstart`,U,{capture:!0,passive:!0}),q(i,`touchmove`,ne,{capture:!0,passive:!0}),q(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{ae(),t.clear(),l(),T.current=!1}},[p,d,r,y,v,u,n,x,S,z,F,b,I,L,g,e,M,P]);let U=Z.useMemo(()=>({onKeyDown:z,onPointerDown:R,onClick:R}),[z,R]),ee=Z.useMemo(()=>({onKeyDown:z,onPointerDown:H,onMouseDown:H,onClickCapture:B,onMouseDownCapture(e){B(),V(e)},onPointerDownCapture(e){B(),V(e)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[z,B,V,H]);return Z.useMemo(()=>n?{reference:U,floating:ee,trigger:U}:{},[n,U,ee])}function ss(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),K(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};f(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function cs(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,c=G(i),{mounted:l,setMounted:u,transitionStatus:d}=s(t,!1,!1,o),f=!t&&r;K(()=>{t&&c(!1)},[t,c]);let p=Z.useRef(l),m=Z.useRef(!1),h=In(),g=()=>{p.current=!1,u(!1),a()};K(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=G(()=>{if(p.current){if(t){m.current=!0,h();return}g()}});return Hn({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var ls={tabIndex:-1,[ki]:``};function us(e){return t=>t!==`touch`||e.current}function ds(e,t=!1){let n=g(),r=Bo()!=null,i=_e(()=>e(n,r)).current;return ss({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function fs({handle:e,store:t}){return K(()=>e.attachStore(t),[e,t]),null}function ps(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function ms(e,t){let n=Z.useRef(null);return G(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ps(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ps(t))})}function hs(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function gs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function _s(e,t,n,r={}){let i=n.reason,a=i===We,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=gs(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=hs(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Ao.flushSync(l):l()}function vs(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=ms(e,n),o=G(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=G(e=>{a(e),e&&o(e)});return K(()=>(s(t.current),()=>s(null)),[s,t,n,e]),K(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function ys(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Z.useRef(null),i=e.useState(`open`);K(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Y(ht);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function bs(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=cs({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return _e(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function xs(e,t){e.useSyncedValues(t),K(()=>()=>{e.update({activeTriggerProps:E,inactiveTriggerProps:E,popupProps:E})},[e])}function Ss(e,t){K(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),K(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Cs=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ws=[],Ts=void 0;function Es(){return Ts}function Ds(e){ws.push(e)}function Os(e){let t=(t,n)=>{let r=_e(As).current,i;try{Ts=r;for(let e of ws)e.before(r);i=e(t,n);for(let e of ws)e.after(r);r.didInitialize=!0}finally{Ts=void 0}return i};return t.displayName=e.displayName||e.name,t}function ks(e){return Z.forwardRef(Os(e))}function As(){return{didInitialize:!1}}var js=Sn(),Ms=lt(),Ns=Lt(19)?Is:Ls;function Ps(e,t,n,r,i){return Ns(e,t,n,r,i)}function Fs(e,t,n,r,i){let a=Z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,js.useSyncExternalStore)(e.subscribe,a,a)}Ds({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,js.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Is(e,t,n,r,i){let a=Es();if(!a)return Fs(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Ls(e,t,n,r,i){return(0,Ms.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Rs=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Ps(this,e,t,n,r)}},zs=class extends Rs{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Z.useDebugValue(e);let n=this;K(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;K(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;K(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){Z.useDebugValue(e);let n=this,r=t!==void 0;K(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return Z.useDebugValue(e),Ps(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Z.useDebugValue(e);let n=G(t??I);this.context[e]=n}useStateSetter(e){let t=Z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Bs={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Vs=class extends zs{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Io(),nested:n,triggerElements:i},Bs),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Oi(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Hs(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Vs({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:E,inactiveTriggerProps:E,popupProps:E}}var Us=e=>e.triggerIdProp??e.activeTriggerId,Ws=e=>e.openProp??e.open,Gs=e=>(e.popupElement?.id??e.floatingId)||void 0;function Ks(e,t){return t!==void 0&&Ws(e)&&Us(e)===t}function qs(e,t){return Ks(e,t)?!0:t!==void 0&&Ws(e)&&Us(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Js={open:Ws,mounted:e=>e.mounted,transitionStatus:e=>Ws(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Us,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Gs,isTriggerActive:(e,t)=>t!==void 0&&Us(e)===t,isOpenedByTrigger:(e,t)=>Ks(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Us(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>qs(e,t)?Gs(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ys(e){return(0,js.useSyncExternalStore)(Z.useCallback(t=>e===void 0?I:e.subscribeStore(t),[e]),Z.useCallback(()=>e===void 0?void 0:e.store,[e]),()=>e?.serverStore)}function Xs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=g(),a=Bo()!=null,o=_e(()=>new Vs({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Cs,floatingId:i,syncOnly:!1,nested:a})).current;return K(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=f(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Zs=si&&li;function Qs(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=Z.useRef(!1),s=Z.useRef(null),c=Z.useRef(!0),l=Fn();Z.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=ge(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&je(t)&&t===ot(Zr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return fa(q(r,`blur`,i),Zs&&q(r,`keydown`,a,!0),Zs&&q(r,`pointerdown`,l,!0))},[e,n]),Z.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);f(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=Z.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Gt(n.nativeEvent);if(f(a)){if(Zs&&!n.relatedTarget){if(!c.current&&!$i(a))return}else if(!na(a))return}let u=Xi(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:p}=n;if(e.select(`open`)&&u||!r){e.setOpen(!0,Y(yt,d,p));return}l.start(r,()=>{o.current||e.setOpen(!0,Y(yt,d,p))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=f(r)&&r.hasAttribute(fo(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=ot(Zr(t));!r&&n===t||X(a.current.floatingContext?.refs.floating.current,n)||X(t,n)||o||Xi(r??n,e.context.triggerElements)||e.setOpen(!1,Y(yt,i))})}}},[a,r,e,l]);return Z.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var $s=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new h;restTimeout=new h;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ec=new WeakMap;function tc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ec.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ec.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function nc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ec.get(n);a&&a!==e&&tc(a),tc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ec.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function rc(e){let t=e.context.dataRef.current,n=_e(()=>t.hoverInteractionState??$s.create()).current;return t.hoverInteractionState||=n,Xt(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ic(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=Vo(),u=Bo(),d=rc(e),p=Fn(),m=G(()=>sa(c.current.openEvent?.type,d.interactedInside)),h=G(()=>ca(c.current.openEvent?.type)),g=G(()=>{tc(d)});K(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,g())},[a,d,g]),Z.useEffect(()=>g,[g]),K(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&h()&&f(s)&&o){let e=s,t=o,n=Zr(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??mt(e,`[data-rootownerid]`)??n.body;return nc(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,a,s,o,d,h,l,u,g]),Z.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&lo(l.nodesRef.current,u).length>0)}function a(t){let n=aa(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Y(We,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Gt(e);if(!ea(t)){d.interactedInside=!1;return}d.interactedInside=mt(t,`[aria-haspopup]`)!=null}function _(){d.openChangeTimeout.clear(),p.clear(),l?.events.off(`floating.closed`,y),g()}function v(n){if(t()&&l){l.events.on(`floating.closed`,y);return}if(Xi(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&f(o)&&lo(l.nodesRef.current,r,!1).some(e=>X(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}g(),h()&&!m()&&a(n)}}function y(n){!l||!u||t()||p.start(0,()=>{l.events.off(`floating.closed`,y),e.setOpen(!1,Y(We,n)),l.events.emit(`floating.closed`,n)})}let b=o;return fa(b&&q(b,`mouseenter`,_),b&&q(b,`mouseleave`,v),b&&q(b,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,y)})},[n,o,e,c,r,i,h,m,g,d,l,u,p])}var ac={current:null};function oc(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ac,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:p,shouldOpen:m,guardStaleOpen:h=!1}=t,{dataRef:g,events:_}=e.context,v=Vo(l),y=rc(e),b=Z.useRef(!1),x=be(i),S=be(r),C=be(o),w=be(n),T=be(m),E=be(p),D=G(()=>sa(g.current.openEvent?.type,y.interactedInside)),O=G(()=>T.current?.()!==!1),k=G((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!X(t,n);if(!f(r))return!1;let a=r;return i.hasMatchingElement(e=>X(e,a))&&(!t||!X(t,a))}),A=G(()=>{y.handler&&=(Zr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),j=G(()=>{tc(y)});return u&&(y.handleCloseOptions=i?.__options),Z.useEffect(()=>A,[A]),Z.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===We,A(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,A]),Z.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=aa(S.current,`close`,y.pointerType);r?y.openChangeTimeout.start(r,()=>{e.setOpen(!1,Y(We,t)),v?.events.emit(`floating.closed`,t)}):n&&(y.openChangeTimeout.clear(),e.setOpen(!1,Y(We,t)),v?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!f(r))return;function i(t){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Di(y.pointerType))return;let n=oa(C.current),r=aa(S.current,`open`,y.pointerType),i=Gt(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(f(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(X(t,i)){c=t;break}}f(o)&&f(s)&&!e.context.triggerElements.hasElement(o)&&X(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,p=!u&&d&&b.current,m=!l&&f(c)&&f(s)&&X(s,c)&&p,h=n>0&&!r,g=l&&(u||p)||m,_=!u||l;if(g){O()&&e.setOpen(!0,Y(We,t,c));return}h||(r?y.openChangeTimeout.start(r,()=>{_&&O()&&e.setOpen(!0,Y(We,t,c))}):_&&O()&&e.setOpen(!0,Y(We,t,c)))}function o(n){if(D()){j();return}A();let r=Zr(e.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let i=g.current.floatingContext??d?.();if(!Xi(n.relatedTarget,e.context.triggerElements)){if(x.current&&i){e.select(`open`)||y.openChangeTimeout.clear();let a=c.current;y.handler=x.current({...i,tree:v,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,y.handler),y.handler(n);return}(y.pointerType!==`touch`||!X(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){X(r,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let p=h?q(r,`mouseout`,l):void 0;return s?fa(q(r,`mousemove`,i,{once:!0}),q(r,`mouseenter`,i),q(r,`mouseleave`,o),p):fa(q(r,`mouseenter`,i),q(r,`mouseleave`,o),p)},[A,j,g,S,e,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,h]),Z.useMemo(()=>{if(!n)return;function t(e){y.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!Di(y.pointerType))return;if(o&&s&&y.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=y.handleCloseOptions?.getScope?.()??r.ownerDocument.body;nc(y,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=oa(C.current);if(o&&!s||c===0||!s&&y.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;y.restTimeout.clear();function l(){if(y.restTimeoutPending=!1,D())return;let t=e.select(`open`);!y.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,Y(We,n,r))}y.pointerType===`touch`?Ao.flushSync(()=>{l()}):s&&o?l():(y.restTimeoutPending=!0,y.restTimeout.start(c,l))}}},[n,y,D,k,a,e,C,O])}function sc(e){return li&&e.movementX===0&&e.movementY===0}function cc(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function lc(e,t){return cc(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function uc(e,t,n){return cc(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function dc(e,t,n){return cc(t,n?e===ji:e===Mi,e===Pi)}function fc(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:cc(t,n?e===Mi:e===ji,e===Ni)}function pc(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=ra(E),A=ta(D),j=be(k),M=Bo(),N=Vo(x),P=Z.useRef(f),F=Z.useRef(o??-1),I=Z.useRef(null),L=Z.useRef(!0),R=G(e=>{i(F.current===-1?null:F.current,e)}),z=Z.useRef(!!E),B=Z.useRef(T),V=Z.useRef(!1),H=Z.useRef(!1),U=Z.useRef(null),ee=be(h),te=be(T),W=be(o),ne=be(b),re=Cn(),ie=Cn(),ae=G(()=>{re.cancel();function e(e){d||(U.current=mo(e,{sync:V.current,preventScroll:!0}))}let t=n.current[F.current],r=H.current;t&&e(t),(V.current?e=>e():e=>re.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),de&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});K(()=>{O.current.orientation=g},[O,g]),K(()=>{T||(I.current=null),(!T||f!==`auto`)&&(P.current=f)},[T,f]),K(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(H.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),K(()=>{if(a){if(!T){V.current=!1;return}if(E)if(r==null){if(V.current=!1,W.current!=null)return;if(z.current&&(F.current=-1,ae()),(!B.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ie.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||uc(I.current,_,u)||l?Ot(n):fn(n),I.current=null,R())};t()}}else _n(n.current,r)||(F.current=r,ae(),H.current=!1)}},[a,T,E,r,W,l,n,_,u,R,ae,ie]),K(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=ot(Zr(D??t??null)),r=e.some(e=>e.context&&X(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),K(()=>{B.current=T,z.current=!!E});let oe=r!=null,se=G(e=>{if(!te.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ce=G(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),le=G(()=>Ot(n,ee.current)),ue=G(t=>{if(L.current=!1,V.current=!0,t.which===229||!te.current&&t.currentTarget===j.current)return;if(l&&fc(t.key,g,u,w)){lc(t.key,ce())||Ci(t),e.setOpen(!1,Y(st,t.nativeEvent));let n=S?.current??D;je(n)&&n.focus();return}r!=null&&r!==F.current&&!_n(n.current,r)&&(F.current=r);let i=F.current,a=Ot(n,h),o=fn(n,h);if(A||(t.key===`Home`&&(Ci(t),F.current=a,R(t)),t.key===`End`&&(Ci(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(lc(t.key,g)){Ci(t);let e=ot(t.currentTarget.ownerDocument);if(T&&!d&&X(t.currentTarget,e)&&!n.current.some(t=>t!=null&&X(t,e))){F.current=uc(t.key,g,u)?a:o,R(t),r===F.current&&ae();return}let{index:l,wrapped:f}=Je(n.current,i,{decrement:!uc(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(V.current=!1),F.current=l,R(t)}}),de=Z.useMemo(()=>({onFocus(e){V.current=!0,se(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){sc(e)||(V.current=!0,H.current=!1,p&&se(e))},onPointerLeave(e){if(!te.current||!L.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ne.current&&(U.current?.(),U.current=null,F.current=-1,R(e),!d)){let e=j.current,t=ot(Zr(e));e&&X(e,t)&&e.focus({preventScroll:!0})}}}),[se,te,j,p,n,R,ne,d]),fe=Z.useMemo(()=>d&&T&&oe&&{"aria-activedescendant":`${y}-${r}`},[d,T,oe,y,r]),pe=Z.useMemo(()=>({...A?{}:fe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=Gt(t.nativeEvent);if(n&&!X(j.current,n))return;Ci(t);let r=Y(vn,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&je(i)&&i.focus();return}ue(t)},onPointerMove(e){sc(e)||(L.current=!0)}}),[fe,ue,j,A,e,T,d,D,S]),me=Z.useMemo(()=>{function t(t){e.setOpen(!0,Y(st,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Ti(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&Ei(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=dc(n.key,ce(),u),o=lc(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||$i(n.currentTarget)))return ue(n);if(!(!r&&!m&&i)){if(s){let e=lc(n.key,ce());I.current=l&&e?null:n.key}if(l){a&&(Ci(n),r?(F.current=le(),R(n),d&&j.current?.focus()):t(n));return}o&&(W.current!=null&&(F.current=W.current),Ci(n),!r&&m?t(n):ue(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[ue,f,le,l,R,e,m,g,_,ce,u,W,d,j]),he=Z.useMemo(()=>({...fe,...me}),[fe,me]);return Z.useMemo(()=>a?{reference:he,floating:pe,item:de,trigger:me}:{},[a,he,pe,me,de])}function mc(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=G(s),f=e.useState(`open`),p=Fn(),m=Z.useRef(``),h=Z.useRef(u??i??-1),g=Z.useRef(null),_=G(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!en(n)||n?.matches(`:disabled`)?!1:o==null||!tt(ue,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!s(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Ci(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Ci(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=G(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);X(r,n)||X(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});K(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=Z.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Z.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var hc=.1,gc=hc*hc,_c=.5;function vc(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function yc(e,t,n,r,i,a,o,s,c,l){let u=!1;return vc(e,t,n,r,i,a)&&(u=!u),vc(e,t,i,a,o,s)&&(u=!u),vc(e,t,o,s,c,l)&&(u=!u),vc(e,t,c,l,n,r)&&(u=!u),u}function bc(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function xc(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Sc(e={}){let{blockPointerEvents:t=!1}=e,n=new h,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,p=typeof performance<`u`?performance.now():0;function m(e,t){let n=performance.now(),r=n-p;if(u===null||d===null||r===0)return u=e,d=t,p=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*gc;return u=e,d=t,p=n,o<s}function h(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:p}=r,g=Gt(r),_=r.type===`mouseleave`,v=X(u,g),y=X(a,g);if(v&&(l=!0,!_))return;if(y&&(l=!1,!_)){l=!0;return}if(_&&f(r.relatedTarget)&&X(u,r.relatedTarget))return;function b(){return!!(s&&lo(s.nodesRef.current,o).length>0)}function x(){b()||h()}if(b())return;let S=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(c===`top`&&t>=S.bottom-1||c===`bottom`&&t<=S.top+1||c===`left`&&e>=S.right-1||c===`right`&&e<=S.left+1){x();return}let M=!1;switch(c){case`top`:M=xc(d,p,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=xc(d,p,O,C.top+1,k,S.bottom-1);break;case`left`:M=xc(d,p,C.right-1,j,S.left+1,A);break;case`right`:M=xc(d,p,S.right-1,j,C.left+1,A);break;default:}if(M)return;if(l&&!bc(d,p,S)){x();return}if(!_&&m(d,p)){x();return}let N=!1;switch(c){case`top`:{let n=E?_c/2:_c*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+_c+1,o=w||E?C.bottom-_c:C.top,s=w?E?C.bottom-_c:C.top:C.bottom-_c;N=yc(d,p,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?_c/2:_c*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-_c,o=w||E?C.top+_c:C.bottom,s=w?E?C.top+_c:C.bottom:C.top+_c;N=yc(d,p,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?_c/2:_c*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+_c+1,o=T||D?C.right-_c:C.left,s=T?D?C.right-_c:C.left:C.right-_c;N=yc(d,p,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?_c/2:_c*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-_c,o=T||D?C.left+_c:C.right,s=T?D?C.left+_c:C.right:C.left+_c;N=yc(d,p,a,r,a,i,o,C.top,s,C.bottom);break}default:}N?l||n.start(40,x):x()}};return r.__options={...e,blockPointerEvents:t},r}function Cc(e,t,n){let{reference:r,floating:i}=e,a=Ea(t),o=Da(t),s=Ta(o),c=Sa(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ca(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function wc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xa(t,e),p=za(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ba(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Ba(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Tc=50,Ec=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Cc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Tc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Cc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Dc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Sa(r),_=Ea(o),v=Sa(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[La(o)]:ka(o)),x=p!==`none`;!d&&x&&b.push(...Ia(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Oa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Ea(t))||T.every(e=>Ea(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ea(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Oc=new Set([`left`,`top`]);async function kc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Sa(n),s=Ca(n),c=Ea(n)===`y`,l=Oc.has(o)?-1:1,u=a&&c?-1:1,d=xa(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ac=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await kc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},jc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xa(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ea(i),p=wa(f),m=u[p],h=u[f],g=(e,t)=>ba(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Mc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xa(e,t),u={x:n,y:r},d=Ea(i),f=wa(d),p=u[f],m=u[d],h=xa(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Oc.has(Sa(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Nc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xa(e,t),c=await i.detectOverflow(t,s),l=Sa(n),u=Ca(n),d=Ea(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ma(p-c[m],g),y=ma(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ha(c.left,c.right):S=p-2*ha(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Pc(e){let t=c(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=je(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ga(n)!==a||ga(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Fc(e){return f(e)?e:e.contextElement}function Ic(e){let t=Fc(e);if(!je(t))return va(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Pc(t),o=(a?ga(n.width):n.width)/r,s=(a?ga(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Lc=va(0);function Rc(e){let t=ge(e);return!z()||!t.visualViewport?Lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ge(e)}function Bc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Fc(e),o=va(1);t&&(r?f(r)&&(o=Ic(r)):o=Ic(e));let s=zc(a,n,r)?Rc(a):va(0),l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,p=i.height/o.y;if(a&&r){let e=ge(a),t=f(r)?ge(r):r,n=e,i=oe(n);for(;i&&t!==n;){let e=Ic(i),t=i.getBoundingClientRect(),r=c(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,p*=e.y,l+=a,u+=o,n=ge(i),i=oe(n)}}return Ba({width:d,height:p,x:l,y:u})}function Vc(e,t){let n=T(e).scrollLeft;return t?t.left+n:Bc(re(e)).left+n}function Hc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Vc(e,n),y:n.top+t.scrollTop}}function Uc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=re(r),s=t?cn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=va(1),u=va(0),d=je(r);if((d||!a)&&((le(r)!==`body`||Fe(o))&&(c=T(r)),d)){let e=Bc(r);l=Ic(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Hc(o,c):va(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Wc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Gc(e){let t=T(e),n=e.ownerDocument.body,r=ha(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ha(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Vc(e),o=-t.scrollTop;return c(n).direction===`rtl`&&(a+=ha(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Kc=25;function qc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ge(e),a=re(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!z()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Vc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Kc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Jc(e,t){let n=Bc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ic(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Yc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=qc(e,n,t);else if(t===`document`)r=Gc(re(e));else if(f(t))r=Jc(t,n);else{let n=Rc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ba(r)}function Xc(e,t){let n=t.get(e);if(n)return n;let r=F(e,[],!1).filter(e=>f(e)&&le(e)!==`body`),i=null,a=c(e).position===`fixed`,o=a?W(e):e;for(;f(o)&&!j(o);){let e=c(o),t=Kn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=W(o)}return t.set(e,r),r}function Zc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?cn(t)?[]:Xc(t,this._c):[].concat(n),r],o=Yc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Yc(t,a[e],i);s=ha(n.top,s),c=ma(n.right,c),l=ma(n.bottom,l),u=ha(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qc(e){let{width:t,height:n}=Pc(e);return{width:t,height:n}}function $c(e,t,n){let r=je(t),i=re(t),a=n===`fixed`,o=Bc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=va(0);if((r||!a)&&((le(t)!==`body`||Fe(i))&&(s=T(t)),r)){let e=Bc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Vc(i));let l=i&&!r&&!a?Hc(i,s):va(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function el(e){return c(e).position===`static`}function tl(e,t){if(!je(e)||c(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return re(e)===n&&(n=n.ownerDocument.body),n}function nl(e,t){let n=ge(e);if(cn(e))return n;if(!je(e)){let t=W(e);for(;t&&!j(t);){if(f(t)&&!el(t))return t;t=W(t)}return n}let r=tl(e,t);for(;r&&U(r)&&el(r);)r=tl(r,t);return r&&j(r)&&el(r)&&!Kn(r)?n:r||Mt(e)||n}var rl=async function(e){let t=this.getOffsetParent||nl,n=this.getDimensions,r=await n(e.floating);return{reference:$c(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function il(e){return c(e).direction===`rtl`}var al={convertOffsetParentRelativeRectToViewportRelativeRect:Uc,getDocumentElement:re,getClippingRect:Zc,getOffsetParent:nl,getElementRects:rl,getClientRects:Wc,getDimensions:Qc,getScale:Ic,isElement:f,isRTL:il};function ol(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sl(e,t,n){let r=null,i,a=re(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_a(d),h=_a(a.clientWidth-(u+f)),g=_a(a.clientHeight-(d+p)),_=_a(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ha(0,ma(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!ol(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=ge(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function cl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Fc(e),u=i||a?[...l?F(l):[],...t?F(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?sl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Bc(e):null;c&&g();function g(){let t=Bc(e);h&&!ol(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ll=Ac,ul=jc,dl=Dc,fl=Nc,pl=Mc,ml=(e,t,n)=>{let r=new Map,i=n??{},a={...al,...i.platform,_c:r};return Ec(e,t,{...i,platform:a})},hl=typeof document<`u`?Z.useLayoutEffect:function(){};function gl(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,i;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(!gl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!gl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function _l(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vl(e,t){let n=_l(e);return Math.round(t*n)/n}function yl(e){let t=Z.useRef(e);return hl(()=>{t.current=e}),t}function bl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Z.useState(r);gl(f,r)||p(r);let[m,h]=Z.useState(null),[g,_]=Z.useState(null),v=Z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Z.useRef(null),C=Z.useRef(null),w=Z.useRef(u),T=c!=null,E=yl(c),D=yl(i),O=yl(l),k=Z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ml(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!gl(w.current,t)&&(w.current=t,Ao.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);hl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Z.useRef(!1);hl(()=>(A.current=!0,()=>{A.current=!1}),[]),hl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=vl(M.floating,u.x),r=vl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,..._l(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var xl=(e,t)=>{let n=ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sl=(e,t)=>{let n=ul(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cl=(e,t)=>({fn:pl(e).fn,options:[e,t]}),wl=(e,t)=>{let n=dl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tl=(e,t)=>{let n=fl(e);return{name:n.name,fn:n.fn,options:[e,t]}};function El({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=Z.useState(0),[d,f]=Z.useState(0),p=l===0,m=os(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Gt(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||X(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return Si(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{!e.select(`open`)&&!e.select(`mounted`)||(u(t),f(n))}),K(()=>{!r&&!i&&(u(0),f(0))},[r,i]),K(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),xs(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Dl=Z.createContext(void 0);function Ol(e){let t=Z.useContext(Dl);if(!e&&t===void 0)throw Error(Nt(27));return t}var kl={...Js,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Al=class extends zs{constructor(e,t,n){let r=new Cs,i=jl(e,r,t,n);super(i,Ml(r),kl)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(hs(this.state,e,t.trigger)))}};function jl(e,t,n,r=!1){return{...Hs(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Ml(e){return{popupRef:Z.createRef(),backdropRef:Z.createRef(),internalBackdropRef:Z.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Nl(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Ol(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=ds((e,t)=>new Al({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);Ss(b,x),ys(b);let{forceUnmount:w}=bs(x,b);Z.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,Y(nt))}),[w,b]);let T=x||S||u!=null;return(0,Q.jsxs)(Dl.Provider,{value:b,children:[u&&(0,Q.jsx)(fs,{handle:u,store:b}),T&&(0,Q.jsx)(El,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var Pl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Ol(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return C(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Ji,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Fl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Ol(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=S({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Y(kt,e.nativeEvent))}return C(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Il=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ol(),c=xe(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),C(`p`,e,{ref:t,props:[{id:c},o]})}),Ll=Z.createContext(void 0);function Rl(){let e=Z.useContext(Ll);if(e===void 0)throw Error(Nt(26));return e}var zl=`--nested-dialogs`,Bl=`data-nested-dialog-open`,Vl={...qi,...ze,nestedDialogOpen(e){return e?{[Bl]:``}:null}},Hl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Ol(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Rl(),Hn({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let w=o===void 0?us(c.context.popupRef):o,T=g>0,E=c.useStateSetter(`popupElement`),D=C(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:T},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ls,hidden:!m,onKeyDown(e){V.has(e.key)&&e.stopPropagation()},style:{[zl]:g}},s],ref:[t,c.context.popupRef,E],stateAttributesMapping:Vl});return(0,Q.jsx)($o,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:w,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:D})});function Ul(e){return Lt(19)?e:e?`true`:void 0}var Wl=Z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Gl=Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Ol(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(Ll.Provider,{value:n,children:(0,Q.jsxs)(Fo,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(Wl,{ref:i.context.internalBackdropRef,inert:Ul(!s)}),e.children]})}):null}),Kl=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ol(),c=xe(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),C(`h2`,e,{ref:t,props:[{id:c},o]})});function ql(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Jl(e,t){let{onClick:n,onPointerDown:r}=ql(G((n,r)=>{(typeof e==`function`?e():e)||t(r||(ii?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Yl(e){let[t,n]=Z.useState(null),r=Jl(e,n);return ke(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Xl=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=de(),{clearErrors:w,elementRef:T,submitCountRef:E}=Pt(),D=g||s,O=h??a,k={...m,disabled:D},{labelId:A}=u(),j=Rt({id:i}),M=o!==void 0,N=o==null?void 0:String(o),P=G(()=>S.inputRef.current?.value);ae(S.inputRef,j,N,P,!D,a),K(()=>{let e=N??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[N,l,S.inputRef,b]),ke(N,()=>{N!==void 0&&(w(O),v(N!==(y.initialValue??``)),S.change(N))});let F=Z.useRef(null),I=se(D,F),R=Fn();return C(`input`,e,{ref:[t,F],state:k,props:[{id:j,disabled:D,name:O,ref:S.inputRef,"aria-labelledby":A,autoFocus:d,...M?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=Y(ht,e.nativeEvent);c?.(t,n),!M&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(w(O),S.change(t)))},onFocus(){I(!0)},onBlur(e){if(_(!0),I(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),M&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){_(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===T.current&&!e.defaultPrevented){let t=e.currentTarget,n=E.current;R.start(0,()=>{E.current===n&&S.commit(t.value)})}else S.commit(t)}}},p,e=>S.getValidationProps(D,e)],stateAttributesMapping:L})}),Zl=Z.forwardRef(function(e,t){return(0,Q.jsx)(Xl,{ref:t,...e})});function Ql({className:e,type:t,...n}){return(0,Q.jsx)(Zl,{type:t,"data-slot":`input`,className:J(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function $l(e){let t=Z.useRef(!0);t.current&&(t.current=!1,e())}function eu(e){return e==null?ht:e.type.startsWith(`key`)?On:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Kt:ht}function tu(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var nu=(e,t)=>Object.is(e,t);function ru(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function iu(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!tu(e,t,(e,t)=>ru(e,t,n)):e!==t}function au(e,t,n){return e?e.some(e=>e!==void 0&&ru(t,e,n)):!1}function ou(e,t,n){return e?e.findIndex(e=>e!==void 0&&ru(e,t,n)):-1}function su(e,t){if(t!==nu)return n=>au(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function cu(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(su(t,n)):ou(e,t,n);return i===-1?null:i}function lu(e,t,n,r,i,a){return au(r,t,i)?a!=null&&e>a&&au(r,n[a],i)?a:e:e===a?cu(n,r,i,!0):a}function uu(e,t,n){return e.filter(e=>!ru(t,e,n))}function du(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function fu(e){return du(e?.[0])}function pu(e){return fu(e)?e.flatMap(e=>e.items):e}function mu(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(fu(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function hu(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return x(e)}function gu(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?x(e.value):x(e)}function _u(e,t,n){function r(){return hu(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=pu(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function vu(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,Q.jsx)(Z.Fragment,{children:_u(r,t,n)},i)),e),[])}var yu=5;function bu(e,t){let n=xu(t);return e.clientX>=n.left-yu&&e.clientX<=n.right+yu&&e.clientY>=n.top-yu&&e.clientY<=n.bottom+yu}function xu(e){let t=e.getBoundingClientRect(),n=ge(e);if(di)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Su(e,t){return e??t}function Cu(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=Z.useState(null),d=Z.useRef(null),p=Vo(n),m=Z.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=bl({...e,elements:{...m,...l&&{reference:l}}}),g=Z.useCallback(e=>{let t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=Z.useMemo(()=>({...h.refs,setPositionReference:g,domReference:d}),[h.refs,g]),v=Z.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),y=Z.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,s,c]);return K(()=>{o&&(d.current=o)},[o]),K(()=>{r.context.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),Z.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var wu=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xa(e,t)||{};if(l==null)return{};let d=za(u),f={x:n,y:r},p=Da(i),m=Ta(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=ba(D,k,O),j=!c.arrow&&Ca(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Tu=(e,t)=>{let{name:n,fn:r}=wu(e);return{name:n,fn:r,options:[e,t]}},Eu={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Du={sideX:`left`,sideY:`top`},Ou=`--available-width`,ku=`--available-height`,Au=`--anchor-width`,ju=`--anchor-height`,Mu=`--transform-origin`,Nu=Ou,Pu=ku;function Fu(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Iu(e,t,n){let{rects:r,placement:i}=e;return{side:Fu(t,Sa(i),n),align:Ca(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Lu(e){return Ru(e,Cu)}function Ru(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=v?.crossAxis??!1,O=v?.rootBoundary,k=typeof n==`function`?n:void 0,A=G(k),j=k?A:n,M=be(n),N=be(g),P=w()===`rtl`,[F,I]=Z.useState(null);!g&&F!==null&&I(null);let L=x===`placement`,R=F?Sa(F):null,z=F&&L?Ca(F)||`center`:null,B=R||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],V=z||o,H=V===`center`?B:`${B}-${V}`,U=l;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let ee=+(i===`bottom`),te=+(i===`top`),W=+(i===`right`),ne=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:U},ie=Z.useRef(null),ae=be(a),oe=be(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(xl(e=>{let t=Iu(e,i,P),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,P,i]));let ue=T===`none`&&C!==`shift`,de=!ue&&(u||D||C===`shift`),fe=C===`none`?null:wl({...re,padding:{top:U.top+1+ee,right:U.right+1+ne,bottom:U.bottom+1+te,left:U.left+1+W},mainAxis:!D&&C===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),pe=ue?null:Sl({...re,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:u||D?void 0:Cl(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Ea(Sa(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[re,u,D,O,U,T]);C===`shift`||T===`shift`||V===`center`?le.push(pe,fe):le.push(fe,pe),le.push(Tl({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(Nu,`${t}px`),i.setProperty(Pu,`${n}px`);let a=ge(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Au,`${u}px`),i.setProperty(ju,`${d}px`)}}),Tu(e=>({element:ie.current||Zr(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Sa(r),u=Ca(r),d=Ea(l)===`y`,f=ie.current,p=typeof a==`function`?a(Iu(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Mu,d?`${m} ${h}`:`${h} ${m}`),{}}},Eu,b),K(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=Z.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:_e,x:ve,y:ye,middlewareData:xe,update:Se,placement:Ce,context:q,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:H,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>cl(...e,me),nodeId:y,externalTree:S}),{sideX:Ee,sideY:De}=xe.adaptiveOrigin||Du,Oe=we?r:`fixed`,ke=Z.useMemo(()=>{let e;return e=we?b?{position:Oe,[Ee]:ve,[De]:ye}:{...Te,position:Oe}:{position:Oe,top:0,left:0},e[Nu]=`100vw`,e[Pu]=`100vh`,we||(e.opacity=0),e},[b,Oe,Ee,ve,De,ye,Te,we]),Ae=Z.useRef(null);K(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(zu(t)?t.current:t)||null;n!==Ae.current&&(he.setPositionReference(n),Ae.current=n)},[g,he,j,M]),Z.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&zu(e)&&e.current!==Ae.current&&(he.setPositionReference(e.current),Ae.current=e.current)},[g,he,j,M]),Z.useEffect(()=>{if(m&&g&&_e.reference&&_e.floating)return cl(_e.reference,_e.floating,Se,me)},[m,g,_e,Se,me]);let je=Sa(Ce),Me=Fu(i,je,P),Ne=Ca(Ce)||`center`,Pe=!!xe.hide?.referenceHidden;K(()=>{x&&g&&we&&(je!==B||L&&Ne!==V)&&I(Ce)},[x,L,g,we,Ce,je,Ne,B,V]);let Fe=Z.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Ie=xe.arrow?.centerOffset!==0;return Z.useMemo(()=>({positionerStyles:ke,arrowStyles:Fe,arrowRef:ie,arrowUncentered:Ie,side:Me,align:Ne,physicalSide:je,anchorHidden:Pe,refs:he,context:q,isPositioned:we,update:Se}),[ke,Fe,ie,Ie,Me,Ne,je,Pe,he,q,we,Se])}function zu(e){return e!=null&&`current`in e}function Bu(e){return e===`starting`?Eo:E}function Vu(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),C(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Bu(r),i],stateAttributesMapping:qi})}var Hu=20;function Uu(e,t,n,r){let[i,a]=Z.useState(!1);K(()=>{if(!e||!t||n==null){a(!1);return}let r=Zr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Hu)},[e,t,n]),Si(e&&(!t||i),r)}var Wu=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...c}=e,l=Z.useRef(null),{transitionStatus:u,setMounted:d}=s(o),f=C(`span`,e,{ref:[t,l],state:{selected:o,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},c],stateAttributesMapping:ze});return Hn({batch:!0,enabled:!o,open:o,ref:l,onComplete(){o||d(!1)}}),f})),Gu=Z.createContext(void 0);function Ku(e=!0){let t=Z.useContext(Gu);if(t===void 0&&!e)throw Error(Nt(25));return t}var qu=Z.createContext(void 0);function Ju(e){let t=Z.useContext(qu);if(t===void 0&&!e)throw Error(Nt(33));return t}var Yu=Z.createContext(void 0);function Xu(e){let t=Z.useContext(Yu);if(t===void 0&&!e)throw Error(Nt(36));return t}var Zu=Z.createContext(null);function Qu(e=`root`){let t=Z.useContext(Zu),n=Z.useContext(Yu);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var $u={visible:!0,ref:null};function ed(){return $u}function td(e,t,n=`root`){let r=Qu(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??ed)({label:e.label,children:e.children,render:e.render}),a=l(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function nd(e){e.preventDefault()}function rd(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Xu(),u=Ku(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return Z.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?nd:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Ht})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!si&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&y(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var id={type:`regular-item`};function ad(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:u}=e,d=Z.useRef(null),{getButtonProps:f,buttonRef:p}=S({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=rd({closeOnClick:t,highlighted:r,id:i,nodeId:u,store:a,typingRef:o,itemRef:d,itemMetadata:c}),h=Z.useCallback(e=>b(m,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,f),[m,f,c]),g=l(d,p);return Z.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var od=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Xu(),f=pe({guess:!0,label:a}),p=xe(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=ad({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:id});return C(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),sd=Z.forwardRef(function(e,t){let n=td(e,t);return n.visible?(0,Q.jsx)(od,{...e,ref:n.ref}):null}),cd=Z.createContext(void 0);function ld(e){let t=Z.useContext(cd);if(t===void 0&&!e)throw Error(Nt(69));return t}var ud=Z.createContext(void 0);function dd(){return Z.useContext(ud)}function fd(e,t){let n=we(e.render);if(Z.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function pd(e,t,n){let r=fd(e,t),i=r===t?void 0:r;return[r,Z.useCallback(e=>n?.(e?i:void 0),[i,n])]}function md(e,t,n){let r=we(e.render),i=Z.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var hd=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Xu(),m=dd(),{side:h,align:g}=Ju(),_=ld(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=pd(e,u,d),R=md(e,w,P),z=T.type===`menu`?m:void 0,B=T.type===`context-menu`,H=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(H=()=>l.state.activeIndex===null&&F),Hn({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),Z.useEffect(()=>{function e(e){l.setOpen(!1,Y(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),ic(O,{enabled:j&&!M&&!B&&T.type!==`menubar`,closeDelay:A});let U=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:ee,handleFocus:te}=(Z.useContext(Zu)?.useParentHandoff??_d)(l,T,v,f),W=C(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:T.type===`menu`,instant:S},ref:[t,l.context.popupRef,U,L],stateAttributesMapping:Ji,props:[b,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":R},onKeyDown(e){z?.onPopupKeyDown?.(e),_&&V.has(e.key)&&e.stopPropagation()},onFocus:te},Bu(y),c,{"data-rootownerid":D}]}),G=T.type===void 0||B;(w||T.type===`menubar`&&E!==`outside-press`)&&(G=!0);let ne=z?.getReturnElement??ee;return(0,Q.jsx)($o,{context:O,openInteractionType:N,modal:B,disabled:!x,returnFocus:a??ne??G,explicitReturnFocus:a===void 0&&ne?!1:void 0,initialFocus:H,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:W})}),gd={parentVirtualFocusRef:void 0,handleFocus:void 0};function _d(){return gd}var vd=Z.forwardRef(function(e,t){return(0,Q.jsx)(Qu()?.Popup??hd,{...e,ref:t})}),yd=Z.createContext(void 0);function bd(){let e=Z.useContext(yd);if(e===void 0)throw Error(Nt(32));return e}var xd=Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Xu();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Q.jsx)(yd.Provider,{value:n,children:(0,Q.jsx)(Fo,{ref:t,...r,portalOwnerRole:o})})});function Sd(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=Z.useRef(null),o=Z.useRef(null),s=Ze(r);K(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),K(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Cd=Z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Do,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=Xu(),x=bd(),S=Ku(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,B=c,V=l,H=s,U=h;C.type===`context-menu`&&(z=n??C.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let ee=o,te=H;C.type===`menu`?(ee??=`inline-end`,te??=`start`,U=e.collisionAvoidance??Oo):C.type===`menubar`&&(ee??=C.context.orientation===`vertical`?`inline-end`:`bottom`,te??=`start`);let W=C.type===`context-menu`,G=Lu({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ee,sideOffset:B,align:te,alignOffset:V,arrowPadding:W?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:U,shift:W?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});Z.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Y(wt)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),Z.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Y(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ne=Fn();Z.useEffect(()=>{D||ne.clear()},[D,ne]),Z.useEffect(()=>{function e(e){if(!(!D||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ne.isStarted()||ne.start(e,()=>{v.setOpen(!1,Y(wt))}):v.setOpen(!1,Y(wt))}else ne.clear()}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ne]),Z.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),Sd({store:v,domReference:R,positionerElement:M,open:D});let re={open:D,side:G.side,align:G.align,anchorHidden:G.anchorHidden,nested:C.type===`menu`,instant:N},ae=C.type===`menubar`&&C.context.modal;Uu(D&&(ae||O&&F!==`trigger-hover`),k===`touch`,M,A);let oe=Vu(e,re,{styles:G.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),K=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),se=null;return C.type===`menubar`?se=C.context.contentElement:C.type===void 0&&(se=A),(0,Q.jsxs)(qu.Provider,{value:G,children:[K&&(0,Q.jsx)(Wl,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:Ul(!D),cutout:se}),(0,Q.jsx)(Uo,{id:I,children:(0,Q.jsx)(ie,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:oe})})]})}),wd=Z.createContext(null);function Td(e){let t=Z.useContext(wd);if(t===null&&!e)throw Error(Nt(5));return t}var Ed={...Js,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=Js.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>li&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!Js.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Dd=class extends zs{constructor(e,t,n=!1){let r=new Cs,i=kd(r,t,n,e);super(i,Od(r),Ed),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Od(e){return{positionerRef:Z.createRef(),popupRef:Z.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Z.createRef(),beforeTriggerFocusGuardRef:Z.createRef(),beforeContentFocusGuardRef:Z.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function kd(e,t,n=!1,r){return{...Hs(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:E,inputProps:E,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Lo,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:E,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Ad=Z.createContext(null);function jd(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Md(e,t){return e===`list-navigation`||jd(e,t)}var Nd=Os(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:x=!0,resetOnPointerLeave:S=!0}=e,C=Ku(!0),T=Xu(!0),D=Td(!0),O=T?.store,k=T?.virtualFocus??!1,A=Z.useMemo(()=>_&&O?{type:`menu`,store:O}:D?{type:`menubar`,context:D}:C&&!O?{type:`context-menu`,context:C}:{type:void 0},[C,O,D,_]),j=xe(),M=xe(),[N,P]=Z.useState(void 0),F=(N??M)||void 0,I=Bo(),L=A.type===`menu`?A.store:void 0,R=(n??o)&&L?.state.transitionStatus===`starting`,z=_e(()=>R?L?.state.instantType:void 0).current,B=_e(()=>{let e=new Dd({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:A,disabled:s,highlightItemOnHover:g,modal:A.type===void 0?c:void 0,rootId:j,instantType:z},F,I!=null);return e.context.virtualFocusRef=y,e}).current;B.useControlledProp(`openProp`,n),B.useControlledProp(`triggerIdProp`,m),B.useContextCallback(`onOpenChangeComplete`,i);let V=B.useState(`floatingTreeRoot`),H=Ho(V),U=B.useState(`open`),ee=B.useState(`activeTriggerElement`),te=B.useState(`positionerElement`),W=B.useState(`hoverEnabled`),ne=B.useState(`disabled`),re=B.useState(`lastOpenChangeReason`),ie=B.useState(`parent`),ae=B.useState(`activeIndex`),oe=B.useState(`keyboardOpen`),se=B.useState(`payload`),ce=B.useState(`floatingParentNodeId`),le=Z.useRef(null),de=Z.useRef(ie.type!==`context-menu`),fe=Fn(),pe=Z.useRef(!0),me=Fn(),he=ce!=null,{openMethod:ge,triggerProps:ve}=Yl(U);B.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ie.type===void 0?c:void 0,openMethod:ge,rootId:j}),ys(B);let{forceUnmount:ye,transitionStatus:be}=bs(U,B,()=>{B.set(`allowMouseEnter`,!1)},R),Se=Ze(B.context.popupRef);Z.useEffect(()=>{if(z===void 0)return;let e=()=>{B.state.instantType===z&&B.set(`instantType`,void 0)};if(!U){e();return}if(be!==void 0)return;if(B.context.popupRef.current==null){e();return}let t=new AbortController;return Se(e,t.signal),()=>{t.abort()}},[z,U,be,Se,B]),K(()=>{C&&!T?B.update({parent:{type:`context-menu`,context:C},floatingNodeId:H,floatingParentNodeId:I}):(T||!B.select(`activeTriggerElement`))&&B.update({floatingNodeId:H,floatingParentNodeId:I})},[C,T,H,I,ee,B]),Z.useEffect(()=>{if(U||(le.current=null),ie.type===`context-menu`){if(!U){fe.clear(),de.current=!1;return}fe.start(500,()=>{de.current=!0})}},[fe,U,ie.type]),K(()=>{!U&&!W&&B.set(`hoverEnabled`,!0)},[U,W,B]);let Ce=G((e,t)=>{let n=t.reason;if(!e&&!B.select(`open`)||U===e&&t.trigger===ee&&re===n)return;let i=gs(t);if(!e&&t.trigger==null&&(t.trigger=ee??void 0),r?.(e,t),t.isCanceled)return;B.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!pe.current)return;e&&n===`trigger-focus`?(pe.current=!1,me.start(300,()=>{pe.current=!0})):(pe.current=!0,me.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=hs(B.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Md(n,a),ie.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?s.instantType=`group`:jd(n,a)?s.instantType=`click`:o?s.instantType=`dismiss`:s.instantType=void 0,B.update(s)}),q=ss({popupStore:B,floatingRootContext:B.state.floatingRootContext,floatingId:F,nested:I!=null,onOpenChange:Ce}),we=q.context.events;K(()=>{let e=({open:e,eventDetails:t})=>Ce(e,t);return we.on(`setOpen`,e),()=>{we?.off(`setOpen`,e)}},[we,Ce]),K(()=>B.subscribeToParentMenu(),[B]);let Te=Z.useCallback(()=>{B.setOpen(!1,Y(nt))},[B]);Z.useImperativeHandle(d,()=>({unmount:ye,close:Te}),[ye,Te]);let Ee;ie.type===`context-menu`&&(Ee=ie.context),Z.useImperativeHandle(Ee?.positionerRef,()=>te,[te]),Z.useImperativeHandle(Ee?.actionsRef,()=>({setOpen:Ce}),[Ce]);let De=os(q,{enabled:!ne,bubbles:{escapeKey:f&&ie.type===`menu`},outsidePress(){return ie.type!==`context-menu`||le.current?.type===`contextmenu`||de.current},externalTree:he?V:void 0}),Oe=w(),ke=pc(q,{enabled:!ne,listRef:B.context.itemDomElements,activeIndex:ae,virtual:v,nested:ie.type===`menubar`||!v&&ie.type!==void 0,parentOrientation:ie.type===`menubar`?ie.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?oe:void 0,allowEscape:v&&l&&x,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Oe===`rtl`,disabledIndices:ue,onNavigate(e,t){B.setActiveIndex(e,eu(t),t?.nativeEvent)},openOnArrowKeyDown:ie.type!==`context-menu`&&!(v&&_),externalTree:!v&&he?V:void 0,nestedReturnFocusRef:L?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:S}),Ae=Z.useCallback(e=>{B.context.typingRef.current=e},[B]),je=mc(q,{enabled:!ne&&!v,listRef:B.context.itemLabels,elementsRef:B.context.itemDomElements,activeIndex:ae,resetMs:500,onMatch:(e,t)=>{U&&e!==ae&&B.setActiveIndex(e,On,t.nativeEvent)},onTyping:Ae}),Me=G(a),Ne=Z.useRef(-1),Pe=G(()=>{let e=B.state.activeIndex,t=e===null?void 0:B.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ne.current===n&&B.context.reportedItem===t)return;Ne.current=n,B.context.reportedItem=t,v&&B.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=B.context;B.context.highlightReason=ht,B.context.highlightEvent=void 0,a&&Me(t,Bn(r,i,{label:t===void 0?void 0:B.context.itemLabels.current[n]??void 0}))});K(()=>{Pe()},[ae,Pe]);let Fe=Z.useMemo(()=>{if(!v)return ke.reference;if(!ke.trigger)return E;let{onFocus:e,...t}=ke.trigger;return t},[v,ke.reference,ke.trigger]);B.useSyncedValue(`inputProps`,v?ke.reference??E:E);let Ie=Z.useMemo(()=>{let e=b(je.reference,Fe,De.reference,{onMouseMove(){B.set(`allowMouseEnter`,!0)}},ve);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=U,e},[B,je.reference,Fe,De.reference,ve,U]),Le=Z.useMemo(()=>{let e=b(ke.trigger,De.trigger,ve);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[ke.trigger,De.trigger,ve]);_e(()=>(B.update({inactiveTriggerProps:Le}),null)),xs(B,{floatingRootContext:q,activeTriggerProps:Ie,inactiveTriggerProps:Le,popupProps:Z.useMemo(()=>b(ls,{onMouseMove(){B.set(`allowMouseEnter`,!0),ie.type===`menu`&&B.set(`hoverEnabled`,!1)},onClick(){B.select(`hoverEnabled`)&&B.set(`hoverEnabled`,!1)},onKeyDown(e){let t=B.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},je.floating,ke.floating,De.floating),[ie.type,B,je.floating,ke.floating,De.floating]),itemProps:ke.item??E});let Re=Z.useMemo(()=>({store:B,parent:A,orientation:u,loopFocus:l,allowEscape:x,defaultFloatingId:M,setRenderedFloatingId:P,virtualFocus:v,parentVirtualFocus:k,syncHighlightedItem:Pe}),[B,A,u,l,x,M,v,k,Pe]),ze=typeof t==`function`?t({payload:se}):t,Be=(0,Q.jsxs)(Yu.Provider,{value:Re,children:[p&&(0,Q.jsx)(fs,{handle:p,store:B}),ze]});return(ie.type===void 0||ie.type===`context-menu`)&&(Be=(0,Q.jsx)(Wo,{externalTree:V,children:Be})),Be});function Pd(e){let t=Z.useContext(Ad);if(t===null)return(0,Q.jsx)(Nd,{...e});let n=t.Root;return(0,Q.jsx)(Ad.Provider,{value:null,children:(0,Q.jsx)(n,{...t.options,...e})})}function Fd(e){if(je(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!j(e))return Fd(W(e))}function Id(e,t){function n(n,r,i){let a=n.currentTarget;Ao.flushSync(()=>{e.setOpen(!1,Y(vn,n.nativeEvent,a))}),ao(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&oo(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Ld(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Z.useRef(!1);return Z.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Zr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:E,[t,n,r])}var Rd=ks(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=Xu(!0),h=Ys(d)??m?.store;if(!h)throw Error(Nt(85));let g=xe(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),x=h.useState(`triggerControlsId`,g),w=Z.useRef(null),T=Bd(),D=It(!0),O=Vo(),k=Z.useMemo(()=>O??new Lo,[O]),{registerTrigger:A,isMountedByThisTrigger:j}=vs(g,w,h,{payload:f,closeDelay:u,parent:T,floatingTreeRoot:k,floatingNodeId:Ho(k),floatingParentNodeId:Bo(),keyboardEventRelay:D?.relayKeyboardEvent}),M=T.type===`menubar`,N=h.useState(`disabled`),P=a||N||M&&T.context.disabled,{getButtonProps:F,buttonRef:I}=S({disabled:P,native:o});Z.useEffect(()=>{!y&&T.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,T.type]);let L=Z.useRef(null),R=Fn(),z=G(e=>{if(!L.current)return;R.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;X(L.current,t)||X(h.select(`positionerElement`),t)||t===L.current||t!=null&&Fd(t)===h.select(`rootId`)||bu(e,L.current)||k.events.emit(`close`,{domEvent:e,reason:pn})});Z.useEffect(()=>{let e=Zr(L.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,z,{once:!0}),()=>{e.removeEventListener(`mouseup`,z)}},[y,z,h]);let B=M&&T.context.hasSubmenuOpen,V=oc(v,{enabled:(c??B)&&!P&&(!M||B&&!j),handleClose:Sc({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:T.type===void 0?l:void 0,delay:{close:u},triggerElementRef:w,externalTree:k,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),H=zd(y,h.select(`lastOpenChangeReason`)),U=es(v,{enabled:!P,event:y&&M?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0&&H}),ee=Qs(v,{enabled:!P&&B}),te=Ld({open:y,enabled:M,mouseDownAction:`open`}),W=Z.useMemo(()=>b(ee.reference,U.reference),[ee.reference,U.reference]),ne=h.useState(`triggerProps`,j),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=Id(h,w),oe={disabled:P,open:y},K=[L,t,I,A,w],se=[W,V??E,ne,{"aria-haspopup":`menu`,"aria-controls":x,id:g,onMouseDown:e=>{h.select(`open`)||(R.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Zr(e.currentTarget).addEventListener(`mouseup`,z,{once:!0}))}},re,M?{role:`menuitem`}:{},te,p,F],ce=C(`button`,e,{enabled:!M,stateAttributesMapping:Ki,state:oe,ref:K,props:se});return M?(0,Q.jsx)(Te,{tag:`button`,render:n,className:r,style:i,state:oe,refs:K,props:se,stateAttributesMapping:Ki}):y?(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(pa,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ie},`${g}-pre-focus-guard`),(0,Q.jsx)(Z.Fragment,{children:ce},g),(0,Q.jsx)(pa,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,Q.jsx)(Z.Fragment,{children:ce},g)});function zd(e,t){let n=Fn(),[r,i]=Z.useState(!1);return K(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Bd(){let e=Td(!0);return Z.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function Vd(e){let[t,n]=Z.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Hd=Z.createContext(void 0),Ud={disableStyleElements:!1};function Wd(){return Z.useContext(Hd)??Ud}var Gd=Os(function(e){return Nl(`dialog`,e)});function Kd(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var qd=Z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Po({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,Q.jsxs)(Z.Fragment,{children:[l,c&&Ao.createPortal(n,c)]})}),Jd=`base-ui-disable-scrollbar`,Yd={className:Jd,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:Jd,precedence:`base-ui:low`,children:`.${Jd}{scrollbar-width:none}.${Jd}::-webkit-scrollbar{display:none}`})}};function Xd(e,t){return Math.max(0,e-t)}function Zd(e,t){if(t<=0)return 0;let n=Kd(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var Qd=Z.createContext(void 0),$d=Z.createContext(void 0);function ef(){let e=Z.useContext(Qd);if(e===void 0)throw Error(Nt(60));return e}function tf(){let e=Z.useContext($d);if(e===void 0)throw Error(Nt(61));return e}var nf={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:gu(t,r)!==``},hasNullItemLabel:(e,t)=>t?mu(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>ru(t,e,n)):ru(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function rf(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:u,autoComplete:d,disabled:f=!1,readOnly:p=!1,required:m=!1,modal:h=!0,actionsRef:g,inputRef:_,onOpenChangeComplete:v,items:y,multiple:x=!1,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w=nu,highlightItemOnHover:T=!0,children:D}=e,{clearErrors:O}=Pt(),{setDirty:k,setTouched:A,setFocused:j,validityData:M,setFilled:N,name:P,disabled:F,validation:L,validationMode:R}=de(),z=Rt({id:t}),B=F||f,V=P??c,[H,U]=qn({controlled:n,default:x?r??ue:r,name:`Select`,state:`value`}),[ee,te]=qn({controlled:a,default:o,name:`Select`,state:`open`}),W=Z.useRef([]),ne=Z.useRef([]),re=Z.useRef(null),ie=Z.useRef(null),oe=Z.useRef(0),se=Z.useRef(null),ce=Z.useRef([]),le=Z.useRef(!1),fe=Z.useRef(null),pe=Z.useRef(null),me=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),he=Z.useRef(!1),ge=Z.useRef(H),{openMethod:ve,triggerProps:ye}=Yl(ee),xe=_e(()=>new zs({id:z,labelId:void 0,modal:h,multiple:x,disabled:B,readOnly:p,required:m,highlightItemOnHover:T,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,value:H,open:ee,mounted:ee,transitionStatus:void 0,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:E,triggerProps:E,itemRoot:{props:E,multiple:x,disabled:B,readOnly:p,isItemEqualToValue:w},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:I,setOpen:I,handleScrollArrowVisibility:I,onOpenChangeComplete:I,listRef:W,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:oe,valueRef:se,valuesRef:ce,labelsRef:ne,typingRef:le,selectionRef:me,firstItemTextRef:fe,selectedItemTextRef:pe,alignItemWithTriggerActiveRef:he,initialValueRef:ge},nf)).current,[Se,Ce]=Z.useState(!1),{mounted:q,transitionStatus:we,forceUnmount:Te}=cs({open:ee,ref:re,preventUnmountOnClose:Se,setPreventUnmountOnClose:Ce,onUnmount(){xe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)}}),Ee=xe.useState(`activeIndex`),De=xe.useState(`selectedIndex`),Oe=xe.useState(`triggerElement`),Ae=xe.useState(`positionerElement`),je=Vd(ve),Me=ve??je,Ne=Z.useMemo(()=>x?``:gu(H,C),[x,H,C]),Pe=Z.useMemo(()=>x&&Array.isArray(H)?H.map(e=>gu(e,C)):gu(H,C),[x,H,C]);ae(be(Oe),z,H,G(()=>Pe),!B,c);let Fe=x?Array.isArray(H)&&H.length>0:H!=null&&Ne!==``;K(()=>{N(Fe)},[Fe,N]),K(function(){let e=cu(ce.current,H,w,x);e===null&&(pe.current=null),!ee&&xe.set(`selectedIndex`,e)},[x,ee,H,w,xe]),ke(H,()=>{O(V),k(iu(H,M.initialValue,w)),L.change(H)});let Ie=G((e,t)=>{let n=t,r=gs(n);s?.(e,n),!t.isCanceled&&(e||Ce(r()),te(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(A(!0),j(!1),R===`onBlur`&&L.commit(H)))});Z.useImperativeHandle(g,()=>({unmount:Te,close:()=>{xe.state.open&&Ie(!1,Y(nt))}}),[Te,Ie,xe]);let Le=G((e,t)=>{i?.(e,t),!t.isCanceled&&U(e)}),Re=G(e=>{let t=Xd(e.scrollHeight,e.clientHeight),n=Zd(e.scrollTop,t),r=n>0,i=n<t;xe.set(`scrollUpArrowVisible`,r),xe.set(`scrollDownArrowVisible`,i)}),ze=Xs({open:ee,onOpenChange:Ie,elements:{reference:Oe,floating:Ae}}),Be=es(ze,{enabled:!B,event:`mousedown`}),Ve=os(ze),J=pc(ze,{enabled:!B,listRef:W,activeIndex:Ee,selectedIndex:De,disabledIndices:ue,onNavigate(e){e===null&&!ee||xe.set(`activeIndex`,e)},focusItemOnHover:T}),He=mc(ze,{enabled:!B&&(ee||!p&&!x),listRef:ne,activeIndex:Ee,selectedIndex:De,disabledIndices:e=>Ln(W.current[e]),onMatch(e){ee?xe.set(`activeIndex`,e):Le(ce.current[e],Y(ht))},onTyping(e){le.current=e}}),Ue=Z.useMemo(()=>b(He.reference,J.reference,Ve.reference,Be.reference,ye),[Be.reference,He.reference,J.reference,Ve.reference,ye]),We=Z.useMemo(()=>b(ls,He.floating,J.floating,Ve.floating),[He.floating,J.floating,Ve.floating]),Ge=J.item??E,Ke=Z.useMemo(()=>({props:Ge,multiple:x,disabled:B,readOnly:p,isItemEqualToValue:w}),[Ge,x,B,p,w]);xe.useContextCallback(`setValue`,Le),xe.useContextCallback(`setOpen`,Ie),xe.useContextCallback(`handleScrollArrowVisibility`,Re),xe.useContextCallback(`onOpenChangeComplete`,v),$l(()=>{xe.update({popupProps:We,triggerProps:Ue,itemRoot:Ke})}),xe.useSyncedValues({id:z,modal:h,multiple:x,disabled:B,readOnly:p,required:m,highlightItemOnHover:T,value:H,open:ee,mounted:q,transitionStatus:we,popupProps:We,triggerProps:Ue,itemRoot:Ke,items:y,itemToStringLabel:S,itemToStringValue:C,isItemEqualToValue:w,openMethod:Me});let qe=l(_,L.inputRef),Je=x?void 0:V,Ye=Z.useMemo(()=>!x||!Array.isArray(H)||!V?null:H.map(e=>{let t=gu(e,C);return(0,Q.jsx)(`input`,{type:`hidden`,form:u,name:V,value:t,disabled:B},t)}),[x,H,u,V,C,B]);return(0,Q.jsxs)(Qd.Provider,{value:xe,children:[(0,Q.jsx)($d.Provider,{value:ze,children:D}),(0,Q.jsx)(`input`,{...L.getValidationProps(B,{onFocus(){xe.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||B||p)return;let t=e.currentTarget.value,n=Y(ht,e.nativeEvent);function r(){if(x)return;let e=t.toLowerCase(),r=ce.current.findIndex(t=>gu(t,C).toLowerCase()===e||hu(t,S).toLowerCase()===e);r===-1&&(r=ce.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=ce.current[r];i!=null&&Le(i,n)}xe.set(`forceMount`,!0),queueMicrotask(r)}}),id:z&&Je==null?`${z}-hidden-input`:void 0,form:u,name:Je,autoComplete:d,value:Ne,disabled:B,required:m&&!(x&&Fe),readOnly:p,ref:qe,style:V?Dn:Vt,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ye]})}var af=`data-popup-side`,of=400,sf={...Ki,...L,popupSide:e=>e?{[af]:e}:null,value:()=>null},cf=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:d,validation:f,state:p,disabled:m}=de(),{labelId:h}=u(),g=ef(),_=g.useState(`readOnly`),v=g.useState(`required`),y=g.useState(`disabled`),x=m||y||a,w=g.useState(`open`),T=g.useState(`mounted`),E=g.useState(`value`),D=g.useState(`triggerProps`),O=g.useState(`positionerElement`),k=g.useState(`listElement`),A=g.useState(`popupSide`),j=g.useState(`id`),M=g.useState(`labelId`),N=g.useState(`hasSelectedValue`),P=T&&O?A:null,F=i??j,I=Su(h,M);Rt({id:i});let L=be(O),R=Z.useRef(null),z=se(x,R),{getButtonProps:B,buttonRef:V}=S({disabled:x,native:o}),H=g.useStateSetter(`triggerElement`),U=Fn(),ee=Fn(),te=Fn();Z.useEffect(()=>{if(w)return te.start(of,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{te.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},ee.clear()},[w,g,ee,te]);let W=b(D,{id:F,role:`combobox`,"aria-expanded":w,"aria-haspopup":`listbox`,"aria-controls":w?k?.id??ra(O)?.id:void 0,"aria-labelledby":I,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:x?-1:0,onFocus(e){z(!0),w&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,Y(ht,e.nativeEvent)),U.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){X(O,e.relatedTarget)||(l(!0),z(!1),d===`onBlur`&&f.commit(E))},onMouseDown(e){if(w)return;let t=Zr(e.currentTarget);function n(e){if(!R.current)return;let t=e.target;X(R.current,t)||X(L.current,t)||bu(e,R.current)||g.context.setOpen(!1,Y(pn,e))}ee.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,B),G=f.getValidationProps(x,W);G.role=`combobox`;let ne={...p,open:w,disabled:x,value:E,readOnly:_,popupSide:P,placeholder:!N};return C(`button`,e,{ref:[t,R,V,H],state:ne,stateAttributesMapping:sf,props:G})}),lf={value:()=>null},uf=Z.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=ef(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?vu(l,u,d):_u(l,u,d)),C(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:lf})}),df=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return C(`span`,e,{state:{open:ef().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Gi})}),ff=Z.forwardRef(function(e,t){let n=ef(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Q.jsx)(Fo,{ref:t,...e}):null}),pf=Z.createContext(void 0);function mf(){let e=Z.useContext(pf);if(!e)throw Error(Nt(59));return e}function hf(e,t){e&&Object.assign(e.style,t)}var gf={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},_f={position:`fixed`},vf=Z.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=Do,style:_,...v}=e,y=ef(),b=tf(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=Z.useRef(null),j=Z.useRef(null),[M,N]=Z.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),Z.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),Uu((P||C)&&x,T===`touch`,E,D);let F=Lu({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?_f:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};K(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=Vu(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=Z.useRef(0),V=G(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=Y(ht);if(t!==0&&!y.state.multiple&&w!==null&&ou(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&ou(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>ou(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};hf(E,e),hf(y.context.popupRef.current,e)}}),H=Z.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,Q.jsx)(ie,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:V,children:(0,Q.jsxs)(pf.Provider,{value:H,children:[S&&C&&(0,Q.jsx)(Wl,{inert:Ul(!x),cutout:D}),z]})})}),yf=`--transform-origin`,bf={...qi,...ze},xf=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=ef(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=tf(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=mf(),_=ld(!0)!=null,v=w(),{nonce:y,disableStyleElements:b}=Wd(),x=s.useState(`id`),S=s.useState(`open`),T=s.useState(`openMethod`),E=s.useState(`mounted`),D=s.useState(`popupProps`),O=s.useState(`transitionStatus`),k=s.useState(`triggerElement`),A=s.useState(`positionerElement`),j=s.useState(`listElement`),M=Z.useRef(!1),N=Z.useRef(!1),P=Z.useRef({}),F=Cn(),I=G(e=>{if(!A||!s.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=wf(A),i=Tf(A.getBoundingClientRect().height,`y`,r),a=Zr(A),o=ge(A),c=o.getComputedStyle(A),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Sf(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Cf(e),g=null,_=e=>{A.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=Kd(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(M.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=Kd(g,0,Cf(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),s.context.handleScrollArrowVisibility(e)});Z.useImperativeHandle(s.context.scrollHandlerRef,()=>I,[I]),Hn({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let L={open:S,transitionStatus:O,side:f,align:p};K(()=>{!A||!s.context.popupRef.current||Object.keys(P.current).length||(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[s,A]),K(()=>{S||m||(N.current=!1,M.current=!1,hf(A,P.current))},[S,m,A]),K(()=>{let e=s.context.popupRef.current;if(!S||!k||!A||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(yf),!m){F.request(()=>s.context.handleScrollArrowVisibility(j||e));return}let t=Of(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=ge(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=Zr(k),c=wf(k),l=Ef(k.getBoundingClientRect(),c),d=Ef(A.getBoundingClientRect(),c),f=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Sf(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=Ef(n.getBoundingClientRect(),c);T=Ef(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let O=w+D+y+h,N=Math.min(S,O),F=S-_-y,I=O-N,L=C-5;A.style.left=`${Kd(E,5,L-d.width)}px`,A.style.height=`${N}px`,A.style.maxHeight=`none`,A.style.marginTop=`${_}px`,A.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=Cf(p),z=I>=R-1;z&&(N=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(N)+1<Math.min(m,b),V=(r.visualViewport?.scale??1)!==1&&li;if(B||V){hf(A,P.current),g(!1);return}let H=Math.max(b,N);if(z){let e=Math.max(0,S-O);A.style.top=d.height>=F?`0`:`${e}px`,A.style.height=`${N}px`,p.scrollTop=Cf(p)}else A.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=Kd(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(yf,`50% ${i}%`)}(H===S||N>=x)&&(M.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,A,k,m,g,F,j,u,v,h]),Z.useEffect(()=>{if(!m||!A||!S)return;let e=ge(A);function t(e){s.context.setOpen(!1,Y(Un,e))}return q(e,`resize`,t)},[s,m,A,S]);let R={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&V.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...m&&{style:j?{height:`100%`}:gf},className:!j&&m?Yd.className:void 0},z=C(`div`,e,{ref:[t,s.context.popupRef],state:L,stateAttributesMapping:bf,props:[D,R,Bu(O),o]});return(0,Q.jsxs)(Z.Fragment,{children:[!b&&Yd.getElement(y),(0,Q.jsx)($o,{context:d,modal:!1,disabled:!E,openInteractionType:T,returnFocus:a,restoreFocus:!0,children:z})]})});function Sf(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Cf(e){return Xd(e.scrollHeight,e.clientHeight)}function wf(e){return al.getScale(e)}function Tf(e,t,n){return e/n[t]}function Ef(e,t){return Ba({x:Tf(e.x,`x`,t),y:Tf(e.y,`y`,t),width:Tf(e.width,`x`,t),height:Tf(e.height,`y`,t)})}var Df=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Of(e){let{style:t}=e,n={};for(let[e,r]of Df)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Df){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var kf=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=ef(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=mf(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:gf},className:u&&d!==`touch`?Yd.className:void 0};return C(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),Af=Z.createContext(void 0);function jf(){let e=Z.useContext(Af);if(!e)throw Error(Nt(57));return e}var Mf=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Z.useRef(null),d=pe({guess:!0,label:o,textRef:u}),f=ef(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),w=f.useState(`isSelectedByFocus`,d.index),T=d.index,E=Z.useRef(null);K(()=>{let e=f.context.valuesRef.current;return e[T]=a,()=>{delete e[T]}},[T,a,f]),K(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=lu(T,a,f.context.valuesRef.current,e,_,t),r=n===T,T===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&ru(a,e,_),r&&(n=T)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[T,m,_,f,a]);let D=Z.useRef(`mouse`),O=Z.useRef(!1),{getButtonProps:k,buttonRef:A}=S({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),j={disabled:v,selected:x,highlighted:y};function M(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?uu(n,a,_):[...n,a];f.context.setValue(r,Y(Ht,e))}else f.context.setValue(a,Y(Ht,e)),f.context.setOpen(!1,Y(Ht,e))}function N(){f.context.selectionRef.current.dragY=0}let P={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,T),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=D.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Ti(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!O.current;O.current=!1,!(v||i)&&M(e.nativeEvent)},onPointerEnter(e){D.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){D.current=e.pointerType,O.current=!0,N()},onMouseUp(){if(N(),v||D.current===`touch`||O.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(O.current=!0,E.current?.click(),O.current=!1)}},F=C(`div`,e,{ref:[A,t,d.ref,E],state:j,props:[p,P,l,k]}),I=Z.useMemo(()=>({selected:x,index:T,textRef:u,selectedByFocus:w}),[x,T,u,w]);return(0,Q.jsx)(Af.Provider,{value:I,children:F})})),Nf=Z.forwardRef(function(e,t){let{selected:n}=jf();return e.keepMounted||n?(0,Q.jsx)(Wu,{...e,selected:n,ref:t}):null}),Pf=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=jf(),a=ef(),{render:o,className:s,style:c,...l}=e;return C(`div`,e,{ref:[Z.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),Ff=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...c}=e,l=a===`up`,u=ef(),{side:d,scrollDownArrowRef:f,scrollUpArrowRef:p}=mf(),m=l?`scrollUpArrowVisible`:`scrollDownArrowVisible`,h=u.useState(m),g=u.useState(`openMethod`),_=h&&g!==`touch`,v=Fn(),y=l?p:f,{mounted:b,transitionStatus:x,setMounted:S}=s(_);K(()=>(u.context.scrollArrowsMountedCountRef.current+=1,u.set(`hasScrollArrows`,!0),()=>{u.context.scrollArrowsMountedCountRef.current=Math.max(0,u.context.scrollArrowsMountedCountRef.current-1),u.context.scrollArrowsMountedCountRef.current===0&&u.set(`hasScrollArrows`,!1)}),[u]),Hn({open:_,ref:y,onComplete(){_||S(!1)}});let w=C(`div`,e,{ref:[t,y],state:{direction:a,visible:_,side:d,transitionStatus:x},props:[{"aria-hidden":!0,children:l?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||v.isStarted())return;u.set(`activeIndex`,null);function t(){let e=u.state.listElement??u.context.popupRef.current;if(!e)return;u.set(`activeIndex`,null),u.context.handleScrollArrowVisibility(e);let n=Xd(e.scrollHeight,e.clientHeight),r=Zd(e.scrollTop,n),i=r===(l?0:n),a=u.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i){v.clear();return}if(a.length>0){let t=y.current?.offsetHeight||0;e.scrollTop=If(a,l,r,e.clientHeight,t,n)}v.start(40,t)}v.start(40,t)},onMouseLeave(){v.clear()}},c],stateAttributesMapping:ze});return b||o?w:null});function If(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?Zd(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?Zd(l.offsetTop+l.offsetHeight-r+i,a):a}var Lf=Z.forwardRef(function(e,t){return(0,Q.jsx)(Ff,{...e,ref:t,direction:`down`})}),Rf=Z.forwardRef(function(e,t){return(0,Q.jsx)(Ff,{...e,ref:t,direction:`up`})}),zf=Z.createContext(void 0),Bf=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Z.useState(),c=Z.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=C(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,Q.jsx)(zf.Provider,{value:c,children:l})}),Vf=Z.createContext(void 0);function Hf(e){let t=Z.useContext(Vf);if(t===void 0&&!e)throw Error(Nt(72));return t}var Uf={...Js,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Wf=class extends zs{constructor(e,t,n){let r=new Cs;super(Gf(e,r,t,n),Kf(r),Uf)}setOpen=(e,t)=>{_s(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Y(Mn,e))}};function Gf(e,t,n,r=!1){return{...Hs(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Kf(e){return{popupRef:Z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var qf=Os(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=ds((e,t)=>new Wf({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),ys(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=bs(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=Z.useRef(null);K(()=>{m&&t&&p.setOpen(!1,Y(Ye))},[m,t,p]),K(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),K(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),Z.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,Y(nt))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,Q.jsxs)(Vf.Provider,{value:p,children:[l&&(0,Q.jsx)(fs,{handle:l,store:p}),T&&(0,Q.jsx)(Jf,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Jf({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=os(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=rs(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=Z.useMemo(()=>b(a.reference,i.reference),[a.reference,i.reference]);return xs(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??E}),null}var Yf=Z.createContext(void 0);function Xf(){return Z.useContext(Yf)}var Zf=`data-base-ui-tooltip-trigger`;function Qf(e){let t=Gt(e);return f(t)?t:null}var $f=ks(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=Hf(!0),m=Ys(a)??p;if(!m)throw Error(Nt(82));let h=xe(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=Z.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=vs(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),w=Xf(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=da(v,{open:_}),k=rc(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=be(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=Z.useRef(!1),I=Fn(),L=Z.useRef(void 0);function R(){return O&&T.current!=null?0:c??w??600}function z(e){let t=y.current;if(!t||!e)return!1;let n=mt(e,`[${Zf}]`);return n!==null&&n!==t&&X(t,n)}function B(e){let t=z(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=oc(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Sc():null,restMs:R,delay(){return u==null&&O?{close:aa(E.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=Qs(v,{enabled:!j}).reference,U=e=>{let t=F.current,n=Qf(e),r=B(n),i=y.current,a=i&&n&&X(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,Y(We,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Di(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,Y(We,e,i))},n=R();n===0?(I.clear(),t()):I.start(n,t)}},ee=m.useState(`appliedTriggerProps`,S||N!==`none`);return C(`button`,e,{state:{open:_},ref:[t,x,y],props:[V,H,ee,{onMouseOver(e){U(e.nativeEvent)},onFocus(e){z(Qf(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Yi]:j?``:void 0,[Zf]:j?void 0:``},f],stateAttributesMapping:Gi})}),ep=Z.createContext(void 0);function tp(){let e=Z.useContext(ep);if(e===void 0)throw Error(Nt(70));return e}var np=Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Hf().useState(`mounted`)||n?(0,Q.jsx)(ep.Provider,{value:n,children:(0,Q.jsx)(qd,{ref:t,...r})}):null}),rp=Z.createContext(void 0);function ip(){let e=Z.useContext(rp);if(e===void 0)throw Error(Nt(71));return e}var ap=Z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Oo,style:g,..._}=e,v=Hf(),y=tp(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=Lu({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=Vu(e,Z.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,Q.jsx)(rp.Provider,{value:D,children:O})}),op=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Hf(),{side:s,align:c}=ip(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Hn({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),ic(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return C(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[ls,f,Bu(d),a],stateAttributesMapping:Ji})}),sp=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Hf(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=ip();return C(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:qi})});function cp({...e}){return(0,Q.jsx)(Gd,{"data-slot":`dialog`,...e})}function lp({...e}){return(0,Q.jsx)(Gl,{"data-slot":`dialog-portal`,...e})}function up({className:e,...t}){return(0,Q.jsx)(Pl,{"data-slot":`dialog-overlay`,className:J(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function dp({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Q.jsxs)(lp,{children:[(0,Q.jsx)(up,{}),(0,Q.jsxs)(Hl,{"data-slot":`dialog-content`,className:J(`fixed top-1/2 start-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Q.jsxs)(Fl,{"data-slot":`dialog-close`,render:(0,Q.jsx)(Ct,{variant:`ghost`,className:`absolute top-2 end-2`,size:`icon-sm`}),children:[(0,Q.jsx)(p,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function fp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:J(`flex flex-col gap-2`,e),...t})}function pp({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:J(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)(Fl,{render:(0,Q.jsx)(Ct,{variant:`outline`}),children:`Close`})]})}function mp({className:e,...t}){return(0,Q.jsx)(Kl,{"data-slot":`dialog-title`,className:J(`text-base leading-none font-medium`,e),...t})}function hp({...e}){return(0,Q.jsx)(Pd,{"data-slot":`dropdown-menu`,...e})}function gp({...e}){return(0,Q.jsx)(Rd,{"data-slot":`dropdown-menu-trigger`,...e})}function _p({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,Q.jsx)(xd,{children:(0,Q.jsx)(Cd,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,Q.jsx)(vd,{"data-slot":`dropdown-menu-content`,className:J(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function vp({className:e,inset:t,variant:n=`default`,...r}){return(0,Q.jsx)(sd,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:J(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function yp({className:e,...t}){return(0,Q.jsx)(ne,{"data-slot":`dropdown-menu-separator`,className:J(`-mx-1 my-1 h-px bg-border`,e),...t})}function bp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty`,className:J(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function xp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-header`,className:J(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var Sp=Ue(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function Cp({className:e,variant:t=`default`,...n}){return(0,Q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:J(Sp({variant:t,className:e})),...n})}function wp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-title`,className:J(`text-sm font-medium tracking-tight`,e),...t})}function Tp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-description`,className:J(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var Ep=Ue(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Dp({className:e,orientation:t=`vertical`,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:J(Ep({orientation:t}),e),...n})}function Op({className:e,...t}){return(0,Q.jsx)(_,{"data-slot":`field-label`,className:J(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function kp({className:e,...t}){return(0,Q.jsx)(`p`,{"data-slot":`field-description`,className:J(`text-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var Ap=rf;function jp({className:e,...t}){return(0,Q.jsx)(Bf,{"data-slot":`select-group`,className:J(`scroll-my-1 p-1`,e),...t})}function Mp({className:e,...t}){return(0,Q.jsx)(uf,{"data-slot":`select-value`,className:J(`flex flex-1 text-start`,e),...t})}function Np({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(cf,{"data-slot":`select-trigger`,"data-size":t,className:J(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pe-2 ps-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Q.jsx)(df,{render:(0,Q.jsx)(ee,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Pp({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(ff,{children:(0,Q.jsx)(vf,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(xf,{"data-slot":`select-content`,"data-align-trigger":o,className:J(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(Ip,{}),(0,Q.jsx)(kf,{children:t}),(0,Q.jsx)(Lp,{})]})})})}function Fp({className:e,children:t,...n}){return(0,Q.jsxs)(Mf,{"data-slot":`select-item`,className:J(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Pf,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(Nf,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute end-2 flex size-4 items-center justify-center`}),children:(0,Q.jsx)(ln,{className:`pointer-events-none`})})]})}function Ip({className:e,...t}){return(0,Q.jsx)(Rf,{"data-slot":`select-scroll-up-button`,className:J(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(Or,{})})}function Lp({className:e,...t}){return(0,Q.jsx)(Lf,{"data-slot":`select-scroll-down-button`,className:J(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(ee,{})})}function Rp({...e}){return(0,Q.jsx)(Gd,{"data-slot":`sheet`,...e})}function zp({...e}){return(0,Q.jsx)(Gl,{"data-slot":`sheet-portal`,...e})}function Bp({className:e,...t}){return(0,Q.jsx)(Pl,{"data-slot":`sheet-overlay`,className:J(`fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function Vp({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,Q.jsxs)(zp,{children:[(0,Q.jsx)(Bp,{}),(0,Q.jsxs)(Hl,{"data-slot":`sheet-content`,"data-side":n,className:J(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-e data-[side=left]:data-ending-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-ending-style:-translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] rtl:data-[side=left]:data-starting-style:-translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-s data-[side=right]:data-ending-style:translate-x-[2.5rem] rtl:data-[side=right]:data-ending-style:-translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] rtl:data-[side=right]:data-starting-style:-translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,Q.jsxs)(Fl,{"data-slot":`sheet-close`,render:(0,Q.jsx)(Ct,{variant:`ghost`,className:`absolute top-3 end-3`,size:`icon-sm`}),children:[(0,Q.jsx)(p,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Hp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sheet-header`,className:J(`flex flex-col gap-0.5 p-4`,e),...t})}function Up({className:e,...t}){return(0,Q.jsx)(Kl,{"data-slot":`sheet-title`,className:J(`text-base font-medium text-foreground`,e),...t})}function Wp({className:e,...t}){return(0,Q.jsx)(Il,{"data-slot":`sheet-description`,className:J(`text-sm text-muted-foreground`,e),...t})}function Gp({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`skeleton`,className:J(`animate-pulse rounded-md bg-muted`,e),...t})}function Kp({...e}){return(0,Q.jsx)(qf,{"data-slot":`tooltip`,...e})}function qp({...e}){return(0,Q.jsx)($f,{"data-slot":`tooltip-trigger`,...e})}function Jp({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,Q.jsx)(np,{children:(0,Q.jsx)(ap,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Q.jsxs)(op,{"data-slot":`tooltip-content`,className:J(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pe-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,Q.jsx)(sp,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-start-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-end-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Yp=768;function Xp(){let[e,t]=Z.useState(void 0);return Z.useEffect(()=>{let e=window.matchMedia(`(max-width: ${Yp-1}px)`),n=()=>{t(window.innerWidth<Yp)};return e.addEventListener(`change`,n),t(window.innerWidth<Yp),()=>e.removeEventListener(`change`,n)},[]),!!e}var Zp=`sidebar_state`,Qp=3600*24*7,$p=`16rem`,em=`18rem`,tm=`3rem`,nm=`b`,rm=Z.createContext(null);function im(){let e=Z.useContext(rm);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function am({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=Xp(),[c,l]=Z.useState(!1),[u,d]=Z.useState(e),f=t??u,p=Z.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${Zp}=${t}; path=/; max-age=${Qp}`},[n,f]),m=Z.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);Z.useEffect(()=>{let e=e=>{e.key===nm&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=Z.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,Q.jsx)(rm.Provider,{value:g,children:(0,Q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":$p,"--sidebar-width-icon":tm,...i},className:J(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function om({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=im();return n===`none`?(0,Q.jsx)(`div`,{"data-slot":`sidebar`,className:J(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,Q.jsx)(Rp,{open:l,onOpenChange:u,...o,children:(0,Q.jsxs)(Vp,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":em},side:e,children:[(0,Q.jsxs)(Hp,{className:`sr-only`,children:[(0,Q.jsx)(Up,{children:`Sidebar`}),(0,Q.jsx)(Wp,{children:`Displays the mobile sidebar.`})]}),(0,Q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,Q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,Q.jsx)(`div`,{"data-slot":`sidebar-gap`,className:J(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,Q.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:J(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-e group-data-[side=right]:border-s`,r),...o,children:(0,Q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function sm({className:e,onClick:t,...n}){let{toggleSidebar:r}=im();return(0,Q.jsxs)(Ct,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:J(e),onClick:e=>{t?.(e),r()},...n,children:[(0,Q.jsx)(Rr,{className:`rtl:rotate-180`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function cm({className:e,...t}){return(0,Q.jsx)(`main`,{"data-slot":`sidebar-inset`,className:J(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2`,e),...t})}function lm({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:J(`flex flex-col gap-2 p-2`,e),...t})}function um({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:J(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function dm({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:J(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function fm({className:e,render:t,...n}){return Jn({defaultTagName:`div`,props:b({className:J(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function pm({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:J(`w-full text-sm`,e),...t})}function mm({className:e,...t}){return(0,Q.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:J(`flex w-full min-w-0 flex-col gap-0`,e),...t})}function hm({className:e,...t}){return(0,Q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:J(`group/menu-item relative`,e),...t})}var gm=Ue(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-start text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pe-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function _m({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=im(),l=Jn({defaultTagName:`button`,props:b({className:J(gm({variant:n,size:r}),a)},o),render:i?(0,Q.jsx)(qp,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,Q.jsxs)(Kp,{children:[l,(0,Q.jsx)(Jp,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}var vm=`sidebar_state`,ym=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),bm=r(((e,t)=>{t.exports=ym()})),xm=r((t=>{var n=bm(),r=e(),a=i();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var P=Array.isArray,F=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},R=[],z=-1;function B(e){return{current:e}}function V(e){0>z||(e.current=R[z],R[z]=null,z--)}function H(e,t){z++,R[z]=e.current,e.current=t}var U=B(null),ee=B(null),te=B(null),W=B(null);function G(e,t){switch(H(te,t),H(ee,e),H(U,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bd(t),e=Vd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}V(U),H(U,e)}function ne(){V(U),V(ee),V(te)}function re(e){e.memoizedState!==null&&H(W,e);var t=U.current,n=Vd(t,e.type);t!==n&&(H(ee,e),H(U,n))}function ie(e){ee.current===e&&(V(U),V(ee)),W.current===e&&(V(W),Zf._currentValue=L)}var ae,oe;function K(e){if(ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ae=t&&t[1]||``,oe=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+ae+e+oe}var se=!1;function ce(e,t){if(!e||se)return``;se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?K(n):``}function le(e,t){switch(e.tag){case 26:case 27:case 5:return K(e.type);case 16:return K(`Lazy`);case 13:return e.child!==t&&t!==null?K(`Suspense Fallback`):K(`Suspense`);case 19:return K(`SuspenseList`);case 0:case 15:return ce(e.type,!1);case 11:return ce(e.type.render,!1);case 1:return ce(e.type,!0);case 31:return K(`Activity`);default:return``}}function ue(e){try{var t=``,n=null;do t+=le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var de=Object.prototype.hasOwnProperty,fe=n.unstable_scheduleCallback,pe=n.unstable_cancelCallback,me=n.unstable_shouldYield,he=n.unstable_requestPaint,ge=n.unstable_now,_e=n.unstable_getCurrentPriorityLevel,ve=n.unstable_ImmediatePriority,ye=n.unstable_UserBlockingPriority,be=n.unstable_NormalPriority,xe=n.unstable_LowPriority,Se=n.unstable_IdlePriority,Ce=n.log,q=n.unstable_setDisableYieldValue,we=null,Te=null;function Ee(e){if(typeof Ce==`function`&&q(e),Te&&typeof Te.setStrictMode==`function`)try{Te.setStrictMode(we,e)}catch{}}var De=Math.clz32?Math.clz32:Ae,Oe=Math.log,ke=Math.LN2;function Ae(e){return e>>>=0,e===0?32:31-(Oe(e)/ke|0)|0}var je=256,Me=262144,Ne=4194304;function Pe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Pe(n))):i=Pe(o):i=Pe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Pe(n))):i=Pe(o)):i=Pe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ie(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Le(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Re(){var e=Ne;return Ne<<=1,!(Ne&62914560)&&(Ne=4194304),e}function ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Be(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ve(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-De(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&J(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function J(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-De(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function He(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-De(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ue(e,t){var n=t&-t;return n=n&42?1:We(n),(n&(e.suspendedLanes|t))===0?n:0}function We(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ge(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ke(){var e=I.p;return e===0?(e=window.event,e===void 0?32:pp(e.type)):e}function qe(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var Je=Math.random().toString(36).slice(2),Ye=`__reactFiber$`+Je,Xe=`__reactProps$`+Je,Ze=`__reactContainer$`+Je,Y=`__reactEvents$`+Je,Qe=`__reactListeners$`+Je,$e=`__reactHandles$`+Je,et=`__reactResources$`+Je,tt=`__reactMarker$`+Je;function nt(e){delete e[Ye],delete e[Xe],delete e[Y],delete e[Qe],delete e[$e]}function rt(e){var t=e[Ye];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ze]||n[Ye]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=uf(e);e!==null;){if(n=e[Ye])return n;e=uf(e)}return t}e=n,n=e.parentNode}return null}function it(e){if(e=e[Ye]||e[Ze]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function at(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ot(e){var t=e[et];return t||=e[et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function st(e){e[tt]=!0}var ct=new Set,lt={};function ut(e,t){dt(e,t),dt(e+`Capture`,t)}function dt(e,t){for(lt[e]=t,e=0;e<t.length;e++)ct.add(t[e])}var ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),pt={},mt={};function ht(e){return de.call(mt,e)?!0:de.call(pt,e)?!1:ft.test(e)?mt[e]=!0:(pt[e]=!0,!1)}function gt(e,t,n){if(ht(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function _t(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function yt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function bt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function xt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function St(e){if(!e._valueTracker){var t=bt(e)?`checked`:`value`;e._valueTracker=xt(e,t,``+e[t])}}function Ct(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=bt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function wt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Tt=/[\n"\\]/g;function Et(e){return e.replace(Tt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Dt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+yt(t)):e.value!==``+yt(t)&&(e.value=``+yt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):kt(e,o,yt(n)):kt(e,o,yt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+yt(s):e.removeAttribute(`name`)}function Ot(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){St(e);return}n=n==null?``:``+yt(n),t=t==null?n:``+yt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),St(e)}function kt(e,t,n){t===`number`&&wt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function At(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+yt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function jt(e,t,n){if(t!=null&&(t=``+yt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+yt(n)}function Mt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(P(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=yt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),St(e)}function Nt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ft(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Pt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function It(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Ft(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Ft(e,a,t[a])}function Lt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Rt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bt(e){return zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Vt(){}var Ht=null;function Ut(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wt=null,Gt=null;function Kt(e){var t=it(e);if(t&&(e=t.stateNode)){var n=e[Xe]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Dt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Et(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Xe]||null;if(!i)throw Error(o(90));Dt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ct(r)}break a;case`textarea`:jt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&At(e,!!n.multiple,t,!1)}}}var qt=!1;function Jt(e,t,n){if(qt)return e(t,n);qt=!0;try{return e(t)}finally{if(qt=!1,(Wt!==null||Gt!==null)&&(gu(),Wt&&(t=Wt,e=Gt,Gt=Wt=null,Kt(t),e)))for(t=0;t<e.length;t++)Kt(e[t])}}function Yt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Xe]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var Xt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Zt=!1;if(Xt)try{var Qt={};Object.defineProperty(Qt,"passive",{get:function(){Zt=!0}}),window.addEventListener(`test`,Qt,Qt),window.removeEventListener(`test`,Qt,Qt)}catch{Zt=!1}var $t=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t=en,n=t.length,r,i=`value`in $t?$t.value:$t.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return tn=i.slice(e,1<r?1-r:void 0)}function rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function X(){return!0}function an(){return!1}function on(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?X:an,this.isPropagationStopped=an,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=X)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=X)},persist:function(){},isPersistent:X}),t}var sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=on(sn),ln=m({},sn,{view:0,detail:0}),un=on(ln),dn,fn,pn,mn=m({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==pn&&(pn&&e.type===`mousemove`?(dn=e.screenX-pn.screenX,fn=e.screenY-pn.screenY):fn=dn=0,pn=e),dn)},movementY:function(e){return`movementY`in e?e.movementY:fn}}),hn=on(mn),gn=on(m({},mn,{dataTransfer:0})),_n=on(m({},ln,{relatedTarget:0})),vn=on(m({},sn,{animationName:0,elapsedTime:0,pseudoElement:0})),yn=on(m({},sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),bn=on(m({},sn,{data:0})),xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Sn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Cn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cn[e])?!!t[e]:!1}function Tn(){return wn}var En=on(m({},ln,{key:function(e){if(e.key){var t=xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Sn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tn,charCode:function(e){return e.type===`keypress`?rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Dn=on(m({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),On=on(m({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tn})),kn=on(m({},sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=on(m({},mn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),jn=on(m({},sn,{newState:0,oldState:0})),Mn=[9,13,27,32],Nn=Xt&&`CompositionEvent`in window,Pn=null;Xt&&`documentMode`in document&&(Pn=document.documentMode);var Fn=Xt&&`TextEvent`in window&&!Pn,In=Xt&&(!Nn||Pn&&8<Pn&&11>=Pn),Ln=` `,Rn=!1;function zn(e,t){switch(e){case`keyup`:return Mn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Bn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Vn=!1;function Hn(e,t){switch(e){case`compositionend`:return Bn(t);case`keypress`:return t.which===32?(Rn=!0,Ln):null;case`textInput`:return e=t.data,e===Ln&&Rn?null:e;default:return null}}function Un(e,t){if(Vn)return e===`compositionend`||!Nn&&zn(e,t)?(e=nn(),tn=en=$t=null,Vn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return In&&t.locale!==`ko`?null:t.data;default:return null}}var Wn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Gn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Wn[e.type]:t===`textarea`}function Kn(e,t,n,r){Wt?Gt?Gt.push(r):Gt=[r]:Wt=r,t=wd(t,`onChange`),0<t.length&&(n=new cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var qn=null,Jn=null;function Yn(e){gd(e,0)}function Xn(e){if(Ct(at(e)))return e}function Zn(e,t){if(e===`change`)return t}var Qn=!1;if(Xt){var $n;if(Xt){var er=`oninput`in document;if(!er){var tr=document.createElement(`div`);tr.setAttribute(`oninput`,`return;`),er=typeof tr.oninput==`function`}$n=er}else $n=!1;Qn=$n&&(!document.documentMode||9<document.documentMode)}function nr(){qn&&(qn.detachEvent(`onpropertychange`,Z),Jn=qn=null)}function Z(e){if(e.propertyName===`value`&&Xn(Jn)){var t=[];Kn(t,Jn,e,Ut(e)),Jt(Yn,t)}}function Q(e,t,n){e===`focusin`?(nr(),qn=t,Jn=n,qn.attachEvent(`onpropertychange`,Z)):e===`focusout`&&nr()}function rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Xn(Jn)}function ir(e,t){if(e===`click`)return Xn(t)}function ar(e,t){if(e===`input`||e===`change`)return Xn(t)}function or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var sr=typeof Object.is==`function`?Object.is:or;function cr(e,t){if(sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!de.call(t,i)||!sr(e[i],t[i]))return!1}return!0}function lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ur(e,t){var n=lr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=lr(n)}}function dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=wt(e.document)}return t}function pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var mr=Xt&&`documentMode`in document&&11>=document.documentMode,hr=null,gr=null,_r=null,vr=!1;function yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vr||hr==null||hr!==wt(r)||(r=hr,`selectionStart`in r&&pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_r&&cr(_r,r)||(_r=r,r=wd(gr,`onSelect`),0<r.length&&(t=new cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function br(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var xr={animationend:br(`Animation`,`AnimationEnd`),animationiteration:br(`Animation`,`AnimationIteration`),animationstart:br(`Animation`,`AnimationStart`),transitionrun:br(`Transition`,`TransitionRun`),transitionstart:br(`Transition`,`TransitionStart`),transitioncancel:br(`Transition`,`TransitionCancel`),transitionend:br(`Transition`,`TransitionEnd`)},Sr={},Cr={};Xt&&(Cr=document.createElement(`div`).style,`AnimationEvent`in window||(delete xr.animationend.animation,delete xr.animationiteration.animation,delete xr.animationstart.animation),`TransitionEvent`in window||delete xr.transitionend.transition);function wr(e){if(Sr[e])return Sr[e];if(!xr[e])return e;var t=xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Cr)return Sr[e]=t[n];return e}var Tr=wr(`animationend`),Er=wr(`animationiteration`),Dr=wr(`animationstart`),Or=wr(`transitionrun`),kr=wr(`transitionstart`),Ar=wr(`transitioncancel`),jr=wr(`transitionend`),Mr=new Map,Nr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Nr.push(`scrollEnd`);function Pr(e,t){Mr.set(e,t),ut(t,[e])}var Fr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ir=[],Lr=0,Rr=0;function zr(){for(var e=Lr,t=Rr=Lr=0;t<e;){var n=Ir[t];Ir[t++]=null;var r=Ir[t];Ir[t++]=null;var i=Ir[t];Ir[t++]=null;var a=Ir[t];if(Ir[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ur(n,i,a)}}function Br(e,t,n,r){Ir[Lr++]=e,Ir[Lr++]=t,Ir[Lr++]=n,Ir[Lr++]=r,Rr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Vr(e,t,n,r){return Br(e,t,n,r),Wr(e)}function Hr(e,t){return Br(e,null,null,t),Wr(e)}function Ur(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-De(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Wr(e){if(50<su)throw su=0,cu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gr={};function Kr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(e,t,n,r){return new Kr(e,t,n,r)}function Jr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yr(e,t){var n=e.alternate;return n===null?(n=qr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Xr(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zr(e,t,n,r,i,a){var s=0;if(r=e,typeof e==`function`)Jr(e)&&(s=1);else if(typeof e==`string`)s=Hf(e,n,U.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=qr(31,n,t,i),e.elementType=O,e.lanes=a,e;case v:return Qr(n.children,i,a,t);case y:s=8,i|=24;break;case b:return e=qr(12,n,t,i|2),e.elementType=b,e.lanes=a,e;case w:return e=qr(13,n,t,i),e.elementType=w,e.lanes=a,e;case T:return e=qr(19,n,t,i),e.elementType=T,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=qr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Qr(e,t,n,r){return e=qr(7,e,r,t),e.lanes=n,e}function $r(e,t,n){return e=qr(6,e,null,t),e.lanes=n,e}function ei(e){var t=qr(18,null,null,0);return t.stateNode=e,t}function ti(e,t,n){return t=qr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ni=new WeakMap;function ri(e,t){if(typeof e==`object`&&e){var n=ni.get(e);return n===void 0?(t={value:e,source:t,stack:ue(t)},ni.set(e,t),t):n}return{value:e,source:t,stack:ue(t)}}var ii=[],ai=0,oi=null,si=0,ci=[],li=0,ui=null,di=1,fi=``;function pi(e,t){ii[ai++]=si,ii[ai++]=oi,oi=e,si=t}function mi(e,t,n){ci[li++]=di,ci[li++]=fi,ci[li++]=ui,ui=e;var r=di;e=fi;var i=32-De(r)-1;r&=~(1<<i),n+=1;var a=32-De(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,di=1<<32-De(t)+i|n<<i|r,fi=a+e}else di=1<<a|n<<i|r,fi=e}function hi(e){e.return!==null&&(pi(e,1),mi(e,1,0))}function gi(e){for(;e===oi;)oi=ii[--ai],ii[ai]=null,si=ii[--ai],ii[ai]=null;for(;e===ui;)ui=ci[--li],ci[li]=null,fi=ci[--li],ci[li]=null,di=ci[--li],ci[li]=null}function _i(e,t){ci[li++]=di,ci[li++]=fi,ci[li++]=ui,di=t.id,fi=t.overflow,ui=e}var vi=null,yi=null,bi=!1,xi=null,Si=!1,Ci=Error(o(519));function wi(e){throw Ai(ri(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ci}function Ti(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ye]=e,t[Xe]=r,n){case`dialog`:_d(`cancel`,t),_d(`close`,t);break;case`iframe`:case`object`:case`embed`:_d(`load`,t);break;case`video`:case`audio`:for(n=0;n<md.length;n++)_d(md[n],t);break;case`source`:_d(`error`,t);break;case`img`:case`image`:case`link`:_d(`error`,t),_d(`load`,t);break;case`details`:_d(`toggle`,t);break;case`input`:_d(`invalid`,t),Ot(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:_d(`invalid`,t);break;case`textarea`:_d(`invalid`,t),Mt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ad(t.textContent,n)?(r.popover!=null&&(_d(`beforetoggle`,t),_d(`toggle`,t)),r.onScroll!=null&&_d(`scroll`,t),r.onScrollEnd!=null&&_d(`scrollend`,t),r.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||wi(e,!0)}function Ei(e){for(vi=e.return;vi;)switch(vi.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:vi=vi.return}}function Di(e){if(e!==vi)return!1;if(!bi)return Ei(e),bi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Hd(e.type,e.memoizedProps)),n=!n),n&&yi&&wi(e),Ei(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));yi=lf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));yi=lf(e)}else t===27?(t=yi,Xd(e.type)?(e=cf,cf=null,yi=e):yi=t):yi=vi?sf(e.stateNode.nextSibling):null;return!0}function Oi(){yi=vi=null,bi=!1}function ki(){var e=xi;return e!==null&&(ql===null?ql=e:ql.push.apply(ql,e),xi=null),e}function Ai(e){xi===null?xi=[e]:xi.push(e)}var ji=B(null),Mi=null,Ni=null;function Pi(e,t,n){H(ji,t._currentValue),t._currentValue=n}function Fi(e){e._currentValue=ji.current,V(ji)}function Ii(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Li(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ii(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ii(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ri(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;sr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===W.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Zf]:e.push(Zf))}i=i.return}e!==null&&Li(t,e,n,r),t.flags|=262144}function zi(e){for(e=e.firstContext;e!==null;){if(!sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bi(e){Mi=e,Ni=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vi(e){return Ui(Mi,e)}function Hi(e,t){return Mi===null&&Bi(e),Ui(e,t)}function Ui(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ni===null){if(e===null)throw Error(o(308));Ni=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ni=Ni.next=t;return n}var Wi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Gi=n.unstable_scheduleCallback,Ki=n.unstable_NormalPriority,qi={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ji(){return{controller:new Wi,data:new Map,refCount:0}}function Yi(e){e.refCount--,e.refCount===0&&Gi(Ki,function(){e.controller.abort()})}var Xi=null,Zi=0,Qi=0,$i=null;function ea(e,t){if(Xi===null){var n=Xi=[];Zi=0,Qi=cd(),$i={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Zi++,t.then(ta,ta),t}function ta(){if(--Zi===0&&Xi!==null){$i!==null&&($i.status=`fulfilled`);var e=Xi;Xi=null,Qi=0,$i=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function na(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ra=F.S;F.S=function(e,t){Xl=ge(),typeof t==`object`&&t&&typeof t.then==`function`&&ea(e,t),ra!==null&&ra(e,t)};var ia=B(null);function aa(){var e=ia.current;return e===null?jl.pooledCache:e}function oa(e,t){t===null?H(ia,ia.current):H(ia,t.pool)}function sa(){var e=aa();return e===null?null:{parent:qi._currentValue,pool:e}}var ca=Error(o(460)),la=Error(o(474)),ua=Error(o(542)),da={then:function(){}};function fa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function pa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Vt,Vt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,_a(e),e;default:if(typeof t.status==`string`)t.then(Vt,Vt);else{if(e=jl,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,_a(e),e}throw ha=t,ca}}function ma(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ha=e,ca):e}}var ha=null;function ga(){if(ha===null)throw Error(o(459));var e=ha;return ha=null,e}function _a(e){if(e===ca||e===ua)throw Error(o(483))}var va=null,ya=0;function ba(e){var t=ya;return ya+=1,va===null&&(va=[]),pa(va,e,t)}function xa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Sa(e,t){throw t.$$typeof===h?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ca(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Yr(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=$r(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&ma(a)===t.type)?(t=i(t,n.props),xa(t,n),t.return=e,t):(t=Zr(n.type,n.key,n.props,null,e.mode,r),xa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ti(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Qr(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=$r(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=Zr(t.type,t.key,t.props,null,e.mode,n),xa(n,t),n.return=e,n;case _:return t=ti(t,e.mode,n),t.return=e,t;case D:return t=ma(t),f(e,t,n)}if(P(t)||j(t))return t=Qr(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ba(t),n);if(t.$$typeof===S)return f(e,Hi(e,t),n);Sa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=ma(n),p(e,t,n,r)}if(P(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ba(n),r);if(n.$$typeof===S)return p(e,t,Hi(e,n),r);Sa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=ma(r),m(e,t,n,r,i)}if(P(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ba(r),i);if(r.$$typeof===S)return m(e,t,n,Hi(t,r),i);Sa(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),bi&&pi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return bi&&pi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),bi&&pi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),bi&&pi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return bi&&pi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),bi&&pi(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===v&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case g:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&ma(l)===r.type){n(e,r.sibling),c=i(r,a.props),xa(c,a),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}a.type===v?(c=Qr(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=Zr(a.type,a.key,a.props,null,e.mode,c),xa(c,a),c.return=e,e=c)}return s(e);case _:a:{for(l=a.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ti(a,e.mode,c),c.return=e,e=c}return s(e);case D:return a=ma(a),b(e,r,a,c)}if(P(a))return h(e,r,a,c);if(j(a)){if(l=j(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),y(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,ba(a),c);if(a.$$typeof===S)return b(e,r,Hi(e,a),c);Sa(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=$r(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ya=0;var i=b(e,t,n,r);return va=null,i}catch(t){if(t===ca||t===ua)throw t;var a=qr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var wa=Ca(!0),Ta=Ca(!1),Ea=!1;function Da(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Al&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Wr(e),Ur(e,null,n),t}return Br(e,r,t,n),Wr(e)}function ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,He(e,n)}}function Ma(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Na=!1;function Pa(){if(Na){var e=$i;if(e!==null)throw e}}function Fa(e,t,n,r){Na=!1;var i=e.updateQueue;Ea=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Nl&f)===f:(r&f)===f){f!==0&&f===Qi&&(Na=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ea=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Vl|=o,e.lanes=o,e.memoizedState=d}}function Ia(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function La(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ia(n[e],t)}var Ra=B(null),za=B(0);function Ba(e,t){e=zl,H(za,e),H(Ra,t),zl=e|t.baseLanes}function Va(){H(za,zl),H(Ra,Ra.current)}function Ha(){zl=za.current,V(Ra),V(za)}var Ua=B(null),Wa=null;function Ga(e){var t=e.alternate;H(Xa,Xa.current&1),H(Ua,e),Wa===null&&(t===null||Ra.current!==null||t.memoizedState!==null)&&(Wa=e)}function Ka(e){H(Xa,Xa.current),H(Ua,e),Wa===null&&(Wa=e)}function qa(e){e.tag===22?(H(Xa,Xa.current),H(Ua,e),Wa===null&&(Wa=e)):Ja(e)}function Ja(){H(Xa,Xa.current),H(Ua,Ua.current)}function Ya(e){V(Ua),Wa===e&&(Wa=null),V(Xa)}var Xa=B(0);function Za(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||rf(n)||af(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qa=0,$=null,$a=null,eo=null,to=!1,no=!1,ro=!1,io=0,ao=0,oo=null,so=0;function co(){throw Error(o(321))}function lo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sr(e[n],t[n]))return!1;return!0}function uo(e,t,n,r,i,a){return Qa=a,$=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Os:ks,ro=!1,a=n(r,i),ro=!1,no&&(a=po(t,n,r,i)),fo(e),a}function fo(e){F.H=Ds;var t=$a!==null&&$a.next!==null;if(Qa=0,eo=$a=$=null,to=!1,ao=0,oo=null,t)throw Error(o(300));e===null||Ks||(e=e.dependencies,e!==null&&zi(e)&&(Ks=!0))}function po(e,t,n,r){$=e;var i=0;do{if(no&&(oo=null),ao=0,no=!1,25<=i)throw Error(o(301));if(i+=1,eo=$a=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}F.H=As,a=t(n,r)}while(no);return a}function mo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?xo(t):t,e=e.useState()[0],($a===null?null:$a.memoizedState)!==e&&($.flags|=1024),t}function ho(){var e=io!==0;return io=0,e}function go(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function _o(e){if(to){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}to=!1}Qa=0,eo=$a=$=null,no=!1,ao=io=0,oo=null}function vo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return eo===null?$.memoizedState=eo=e:eo=eo.next=e,eo}function yo(){if($a===null){var e=$.alternate;e=e===null?null:e.memoizedState}else e=$a.next;var t=eo===null?$.memoizedState:eo.next;if(t!==null)eo=t,$a=e;else{if(e===null)throw $.alternate===null?Error(o(467)):Error(o(310));$a=e,e={memoizedState:$a.memoizedState,baseState:$a.baseState,baseQueue:$a.baseQueue,queue:$a.queue,next:null},eo===null?$.memoizedState=eo=e:eo=eo.next=e}return eo}function bo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=ao;return ao+=1,oo===null&&(oo=[]),e=pa(oo,e,t),t=$,(eo===null?t.memoizedState:eo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Os:ks),e}function So(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return xo(e);if(e.$$typeof===S)return Vi(e)}throw Error(o(438,String(e)))}function Co(e){var t=null,n=$.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=$.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=bo(),$.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function wo(e,t){return typeof t==`function`?t(e):t}function To(e){return Eo(yo(),$a,e)}function Eo(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Qa&f)===f:(Nl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Qi&&(d=!0);else if((Qa&p)===p){u=u.next,p===Qi&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,$.lanes|=p,Vl|=p;f=u.action,ro&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,$.lanes|=f,Vl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!sr(a,e.memoizedState)&&(Ks=!0,d&&(n=$i,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Do(e){var t=yo(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);sr(a,t.memoizedState)||(Ks=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Oo(e,t,n){var r=$,i=yo(),a=bi;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!sr(($a||i).memoizedState,n);if(s&&(i.memoizedState=n,Ks=!0),i=i.queue,$o(jo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||eo!==null&&eo.memoizedState.tag&1){if(r.flags|=2048,Jo(9,{destroy:void 0},Ao.bind(null,r,i,n,t),null),jl===null)throw Error(o(349));a||Qa&127||ko(r,t,n)}return n}function ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$.updateQueue,t===null?(t=bo(),$.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ao(e,t,n,r){t.value=n,t.getSnapshot=r,Mo(t)&&No(e)}function jo(e,t,n){return n(function(){Mo(t)&&No(e)})}function Mo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sr(e,n)}catch{return!0}}function No(e){var t=Hr(e,2);t!==null&&du(t,e,2)}function Po(e){var t=vo();if(typeof e==`function`){var n=e;if(e=n(),ro){Ee(!0);try{n()}finally{Ee(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wo,lastRenderedState:e},t}function Fo(e,t,n,r){return e.baseState=n,Eo(e,$a,typeof r==`function`?r:wo)}function Io(e,t,n,r,i){if(ws(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};F.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Lo(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Lo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ro(e,t,s)}catch(n){Bo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ro(e,t,a)}catch(n){Bo(e,t,n)}}function Ro(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){zo(e,t,n)},function(n){return Bo(e,t,n)}):zo(e,t,n)}function zo(e,t,n){t.status=`fulfilled`,t.value=n,Vo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Lo(e,n)))}function Bo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Vo(t),t=t.next;while(t!==r)}e.action=null}function Vo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ho(e,t){return t}function Uo(e,t){if(bi){var n=jl.formState;if(n!==null){a:{var r=$;if(bi){if(yi){b:{for(var i=yi,a=Si;i.nodeType!==8;){if(!a){i=null;break b}if(i=sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){yi=sf(i.nextSibling),r=i.data===`F!`;break a}}wi(r)}r=!1}r&&(t=n[0])}}return n=vo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:t},n.queue=r,n=xs.bind(null,$,r),r.dispatch=n,r=Po(!1),a=Cs.bind(null,$,!1,r.queue),r=vo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Io.bind(null,$,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wo(e){return Go(yo(),$a,e)}function Go(e,t,n){if(t=Eo(e,t,Ho)[0],e=To(wo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=xo(t)}catch(e){throw e===ca?ua:e}else r=t;t=yo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&($.flags|=2048,Jo(9,{destroy:void 0},Ko.bind(null,i,n),null)),[r,a,e]}function Ko(e,t){e.action=t}function qo(e){var t=yo(),n=$a;if(n!==null)return Go(t,n,e);yo(),t=t.memoizedState,n=yo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Jo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=$.updateQueue,t===null&&(t=bo(),$.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Yo(){return yo().memoizedState}function Xo(e,t,n,r){var i=vo();$.flags|=e,i.memoizedState=Jo(1|t,{destroy:void 0},n,r===void 0?null:r)}function Zo(e,t,n,r){var i=yo();r=r===void 0?null:r;var a=i.memoizedState.inst;$a!==null&&r!==null&&lo(r,$a.memoizedState.deps)?i.memoizedState=Jo(t,a,n,r):($.flags|=e,i.memoizedState=Jo(1|t,a,n,r))}function Qo(e,t){Xo(8390656,8,e,t)}function $o(e,t){Zo(2048,8,e,t)}function es(e){$.flags|=4;var t=$.updateQueue;if(t===null)t=bo(),$.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ts(e){var t=yo().memoizedState;return es({ref:t,nextImpl:e}),function(){if(Al&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function ns(e,t){return Zo(4,2,e,t)}function rs(e,t){return Zo(4,4,e,t)}function is(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function as(e,t,n){n=n==null?null:n.concat([e]),Zo(4,4,is.bind(null,t,e),n)}function os(){}function ss(e,t){var n=yo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&lo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cs(e,t){var n=yo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&lo(t,r[1]))return r[0];if(r=e(),ro){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r}function ls(e,t,n){return n===void 0||Qa&1073741824&&!(Nl&261930)?e.memoizedState=t:(e.memoizedState=n,e=uu(),$.lanes|=e,Vl|=e,n)}function us(e,t,n,r){return sr(n,t)?n:Ra.current===null?!(Qa&42)||Qa&1073741824&&!(Nl&261930)?(Ks=!0,e.memoizedState=n):(e=uu(),$.lanes|=e,Vl|=e,t):(e=ls(e,n,r),sr(e,t)||(Ks=!0),e)}function ds(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Cs(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ss(e,t,na(c,r),lu(e)):Ss(e,t,r,lu(e))}catch(n){Ss(e,t,{then:function(){},status:`rejected`,reason:n},lu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function fs(){}function ps(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=ms(e).queue;ds(e,i,t,L,n===null?fs:function(){return hs(e),n(r)})}function ms(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wo,lastRenderedState:L},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hs(e){var t=ms(e);t.next===null&&(t=e.alternate.memoizedState),Ss(e,t.next.queue,{},lu())}function gs(){return Vi(Zf)}function _s(){return yo().memoizedState}function vs(){return yo().memoizedState}function ys(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=lu();e=ka(n);var r=Aa(t,e,n);r!==null&&(du(r,t,n),ja(r,t,n)),t={cache:Ji()},e.payload=t;return}t=t.return}}function bs(e,t,n){var r=lu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ws(e)?Ts(t,n):(n=Vr(e,t,n,r),n!==null&&(du(n,e,r),Es(n,t,r)))}function xs(e,t,n){Ss(e,t,n,lu())}function Ss(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ws(e))Ts(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,sr(s,o))return Br(e,t,i,0),jl===null&&zr(),!1}catch{}if(n=Vr(e,t,i,r),n!==null)return du(n,e,r),Es(n,t,r),!0}return!1}function Cs(e,t,n,r){if(r={lane:2,revertLane:cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ws(e)){if(t)throw Error(o(479))}else t=Vr(e,n,r,2),t!==null&&du(t,e,2)}function ws(e){var t=e.alternate;return e===$||t!==null&&t===$}function Ts(e,t){no=to=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Es(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,He(e,n)}}var Ds={readContext:Vi,use:So,useCallback:co,useContext:co,useEffect:co,useImperativeHandle:co,useLayoutEffect:co,useInsertionEffect:co,useMemo:co,useReducer:co,useRef:co,useState:co,useDebugValue:co,useDeferredValue:co,useTransition:co,useSyncExternalStore:co,useId:co,useHostTransitionStatus:co,useFormState:co,useActionState:co,useOptimistic:co,useMemoCache:co,useCacheRefresh:co};Ds.useEffectEvent=co;var Os={readContext:Vi,use:So,useCallback:function(e,t){return vo().memoizedState=[e,t===void 0?null:t],e},useContext:Vi,useEffect:Qo,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Xo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xo(4194308,4,e,t)},useInsertionEffect:function(e,t){Xo(4,2,e,t)},useMemo:function(e,t){var n=vo();t=t===void 0?null:t;var r=e();if(ro){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=vo();if(n!==void 0){var i=n(t);if(ro){Ee(!0);try{n(t)}finally{Ee(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=bs.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=vo();return e={current:e},t.memoizedState=e},useState:function(e){e=Po(e);var t=e.queue,n=xs.bind(null,$,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:os,useDeferredValue:function(e,t){return ls(vo(),e,t)},useTransition:function(){var e=Po(!1);return e=ds.bind(null,$,e.queue,!0,!1),vo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=$,i=vo();if(bi){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),jl===null)throw Error(o(349));Nl&127||ko(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Qo(jo.bind(null,r,a,e),[e]),r.flags|=2048,Jo(9,{destroy:void 0},Ao.bind(null,r,a,n,t),null),n},useId:function(){var e=vo(),t=jl.identifierPrefix;if(bi){var n=fi,r=di;n=(r&~(1<<32-De(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=io++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=so++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:gs,useFormState:Uo,useActionState:Uo,useOptimistic:function(e){var t=vo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Cs.bind(null,$,!0,n),n.dispatch=t,[e,t]},useMemoCache:Co,useCacheRefresh:function(){return vo().memoizedState=ys.bind(null,$)},useEffectEvent:function(e){var t=vo(),n={impl:e};return t.memoizedState=n,function(){if(Al&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},ks={readContext:Vi,use:So,useCallback:ss,useContext:Vi,useEffect:$o,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:To,useRef:Yo,useState:function(){return To(wo)},useDebugValue:os,useDeferredValue:function(e,t){return us(yo(),$a.memoizedState,e,t)},useTransition:function(){var e=To(wo)[0],t=yo().memoizedState;return[typeof e==`boolean`?e:xo(e),t]},useSyncExternalStore:Oo,useId:_s,useHostTransitionStatus:gs,useFormState:Wo,useActionState:Wo,useOptimistic:function(e,t){return Fo(yo(),$a,e,t)},useMemoCache:Co,useCacheRefresh:vs};ks.useEffectEvent=ts;var As={readContext:Vi,use:So,useCallback:ss,useContext:Vi,useEffect:$o,useImperativeHandle:as,useInsertionEffect:ns,useLayoutEffect:rs,useMemo:cs,useReducer:Do,useRef:Yo,useState:function(){return Do(wo)},useDebugValue:os,useDeferredValue:function(e,t){var n=yo();return $a===null?ls(n,e,t):us(n,$a.memoizedState,e,t)},useTransition:function(){var e=Do(wo)[0],t=yo().memoizedState;return[typeof e==`boolean`?e:xo(e),t]},useSyncExternalStore:Oo,useId:_s,useHostTransitionStatus:gs,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){var n=yo();return $a===null?(n.baseState=e,[e,n.queue.dispatch]):Fo(n,$a,e,t)},useMemoCache:Co,useCacheRefresh:vs};As.useEffectEvent=ts;function js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ms={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=lu(),i=ka(r);i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(du(t,e,r),ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=lu(),i=ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(du(t,e,r),ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=lu(),r=ka(n);r.tag=2,t!=null&&(r.callback=t),t=Aa(e,r,n),t!==null&&(du(t,e,n),ja(t,e,n))}};function Ns(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!cr(n,r)||!cr(i,a):!0}function Ps(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ms.enqueueReplaceState(t,t.state,null)}function Fs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Is(e){Fr(e)}function Ls(e){console.error(e)}function Rs(e){Fr(e)}function zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Bs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Vs(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){zs(e,t)},n}function Hs(e){return e=ka(e),e.tag=3,e}function Us(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Bs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Bs(t,n,r),typeof i!=`function`&&($l===null?$l=new Set([this]):$l.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ws(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ri(t,n,i,!0),n=Ua.current,n!==null){switch(n.tag){case 31:case 13:return Wa===null?Cu():n.alternate===null&&Bl===0&&(Bl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Hu(e,r,i)),!1;case 22:return n.flags|=65536,r===da?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Hu(e,r,i)),!1}throw Error(o(435,n.tag))}return Hu(e,r,i),Cu(),!1}if(bi)return t=Ua.current,t===null?(r!==Ci&&(t=Error(o(423),{cause:r}),Ai(ri(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=ri(r,n),i=Vs(e.stateNode,r,i),Ma(e,i),Bl!==4&&(Bl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ci&&(e=Error(o(422),{cause:r}),Ai(ri(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=ri(a,n),Kl===null?Kl=[a]:Kl.push(a),Bl!==4&&(Bl=2),t===null)return!0;r=ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Vs(n.stateNode,r,e),Ma(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&($l===null||!$l.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Hs(i),Us(i,e,n,r),Ma(n,i),!1}n=n.return}while(n!==null);return!1}var Gs=Error(o(461)),Ks=!1;function qs(e,t,n,r){t.child=e===null?Ta(t,null,n,r):wa(t,e.child,n,r)}function Js(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Bi(t),r=uo(e,t,n,o,a,i),s=ho(),e!==null&&!Ks?(go(e,t,i),vc(e,t,i)):(bi&&s&&hi(t),t.flags|=1,qs(e,t,r,i),t.child)}function Ys(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Jr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Xs(e,t,a,r,i)):(e=Zr(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!yc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?cr:n,n(o,r)&&e.ref===t.ref)return vc(e,t,i)}return t.flags|=1,e=Yr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Xs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(cr(a,r)&&e.ref===t.ref)if(Ks=!1,t.pendingProps=r=a,yc(e,i))e.flags&131072&&(Ks=!0);else return t.lanes=e.lanes,vc(e,t,i)}return ic(e,t,n,r,i)}function Zs(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return $s(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&oa(t,a===null?null:a.cachePool),a===null?Va():Ba(t,a),qa(t);else return r=t.lanes=536870912,$s(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&oa(t,null),Va(),Ja(t)):(oa(t,a.cachePool),Ba(t,a),Ja(t),t.memoizedState=null);return qs(e,t,i,n),t.child}function Qs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $s(e,t,n,r,i){var a=aa();return a=a===null?null:{parent:qi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&oa(t,null),Va(),qa(t),e!==null&&Ri(e,t,r,!0),t.childLanes=i,null}function ec(e,t){return t=pc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tc(e,t,n){return wa(t,e.child,null,n),e=ec(t,t.pendingProps),e.flags|=2,Ya(t),t.memoizedState=null,e}function nc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(bi){if(r.mode===`hidden`)return e=ec(t,r),t.lanes=536870912,Qs(null,e);if(Ka(t),(e=yi)?(e=nf(e,Si),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui===null?null:{id:di,overflow:fi},retryLane:536870912,hydrationErrors:null},n=ei(e),n.return=t,t.child=n,vi=t,yi=null)):e=null,e===null)throw wi(t);return t.lanes=536870912,null}return ec(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Ka(t),i)if(t.flags&256)t.flags&=-257,t=tc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Ks||Ri(e,t,n,!1),i=(n&e.childLanes)!==0,Ks||i){if(r=jl,r!==null&&(s=Ue(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Hr(e,s),du(r,e,s),Gs;Cu(),t=tc(e,t,n)}else e=a.treeContext,yi=sf(s.nextSibling),vi=t,bi=!0,xi=null,Si=!1,e!==null&&_i(t,e),t=ec(t,r),t.flags|=4096;return t}return e=Yr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ic(e,t,n,r,i){return Bi(t),n=uo(e,t,n,r,void 0,i),r=ho(),e!==null&&!Ks?(go(e,t,i),vc(e,t,i)):(bi&&r&&hi(t),t.flags|=1,qs(e,t,n,i),t.child)}function ac(e,t,n,r,i,a){return Bi(t),t.updateQueue=null,n=po(t,r,n,i),fo(e),r=ho(),e!==null&&!Ks?(go(e,t,a),vc(e,t,a)):(bi&&r&&hi(t),t.flags|=1,qs(e,t,n,a),t.child)}function oc(e,t,n,r,i){if(Bi(t),t.stateNode===null){var a=Gr,o=n.contextType;typeof o==`object`&&o&&(a=Vi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ms,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Da(t),o=n.contextType,a.context=typeof o==`object`&&o?Vi(o):Gr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(js(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ms.enqueueReplaceState(a,a.state,null),Fa(t,r,a,i),Pa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Fs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Gr,typeof u==`object`&&u&&(o=Vi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ps(t,a,r,o),Ea=!1;var f=t.memoizedState;a.state=f,Fa(t,r,a,i),Pa(),l=t.memoizedState,s||f!==l||Ea?(typeof d==`function`&&(js(t,n,d,r),l=t.memoizedState),(c=Ea||Ns(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Oa(e,t),o=t.memoizedProps,u=Fs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Gr,typeof l==`object`&&l&&(c=Vi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ps(t,a,r,c),Ea=!1,f=t.memoizedState,a.state=f,Fa(t,r,a,i),Pa();var p=t.memoizedState;o!==d||f!==p||Ea||e!==null&&e.dependencies!==null&&zi(e.dependencies)?(typeof s==`function`&&(js(t,n,s,r),p=t.memoizedState),(u=Ea||Ns(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,rc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=wa(t,e.child,null,i),t.child=wa(t,null,n,i)):qs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=vc(e,t,i),e}function sc(e,t,n,r){return Oi(),t.flags|=256,qs(e,t,n,r),t.child}var cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lc(e){return{baseLanes:e,cachePool:sa()}}function uc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Wl),e}function dc(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!=0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(Xa.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(bi){if(i?Ga(t):Ja(t),(e=yi)?(e=nf(e,Si),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ui===null?null:{id:di,overflow:fi},retryLane:536870912,hydrationErrors:null},n=ei(e),n.return=t,t.child=n,vi=t,yi=null)):e=null,e===null)throw wi(t);return af(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(Ja(t),i=t.mode,c=pc({mode:`hidden`,children:c},i),r=Qr(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=lc(n),r.childLanes=uc(e,s,n),t.memoizedState=cc,Qs(null,r)):(Ga(t),fc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?(Ga(t),t.flags&=-257,t=mc(e,t,n)):t.memoizedState===null?(Ja(t),c=r.fallback,i=t.mode,r=pc({mode:`visible`,children:r.children},i),c=Qr(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,wa(t,e.child,null,n),r=t.child,r.memoizedState=lc(n),r.childLanes=uc(e,s,n),t.memoizedState=cc,t=Qs(null,r)):(Ja(t),t.child=e.child,t.flags|=128,t=null);else if(Ga(t),af(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(o(419)),r.stack=``,r.digest=s,Ai({value:r,source:null,stack:null}),t=mc(e,t,n)}else if(Ks||Ri(e,t,n,!1),s=(n&e.childLanes)!==0,Ks||s){if(s=jl,s!==null&&(r=Ue(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Hr(e,r),du(s,e,r),Gs;rf(c)||Cu(),t=mc(e,t,n)}else rf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,yi=sf(c.nextSibling),vi=t,bi=!0,xi=null,Si=!1,e!==null&&_i(t,e),t=fc(t,r.children),t.flags|=4096);return t}return i?(Ja(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=Yr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Qr(c,i,n,null),c.flags|=2):c=Yr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,Qs(null,r),r=t.child,c=e.child.memoizedState,c===null?c=lc(n):(i=c.cachePool,i===null?i=sa():(l=qi._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=uc(e,s,n),t.memoizedState=cc,Qs(e.child,r)):(Ga(t),n=e.child,e=n.sibling,n=Yr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function fc(e,t){return t=pc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function pc(e,t){return e=qr(22,e,null,t),e.lanes=0,e}function mc(e,t,n){return wa(t,e.child,null,n),e=fc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ii(e.return,t,n)}function gc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function _c(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Xa.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,H(Xa,o),qs(e,t,r,n),r=bi?si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hc(e,n,t);else if(e.tag===19)hc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Za(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),gc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Za(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}gc(t,!0,n,null,a,r);break;case`together`:gc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function vc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ri(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Yr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&zi(e))):!0}function bc(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),Pi(t,qi,e.memoizedState.cache),Oi();break;case 27:case 5:re(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:Pi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ka(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ga(t),e=vc(e,t,n),e===null?null:e.sibling):dc(e,t,n):(Ga(t),t.flags|=128,null);Ga(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ri(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return _c(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),H(Xa,Xa.current),r)break;return null;case 22:return t.lanes=0,Zs(e,t,n,t.pendingProps);case 24:Pi(t,qi,e.memoizedState.cache)}return vc(e,t,n)}function xc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ks=!0;else{if(!yc(e,n)&&!(t.flags&128))return Ks=!1,bc(e,t,n);Ks=!!(e.flags&131072)}else Ks=!1,bi&&t.flags&1048576&&mi(t,si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ma(t.elementType),t.type=e,typeof e==`function`)Jr(e)?(r=Fs(e,r),t.tag=1,t=oc(null,t,e,r,n)):(t.tag=0,t=ic(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=Js(null,t,e,r,n);break a}else if(i===E){t.tag=14,t=Ys(null,t,e,r,n);break a}}throw t=N(e)||e,Error(o(306,t,``))}}return t;case 0:return ic(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Fs(r,t.pendingProps),oc(e,t,r,i,n);case 3:a:{if(G(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Oa(e,t),Fa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Pi(t,qi,r),r!==a.cache&&Li(t,[qi],n,!0),Pa(),r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=sc(e,t,r,n);break a}else if(r!==i){i=ri(Error(o(424)),t),Ai(i),t=sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(yi=sf(e.firstChild),vi=t,bi=!0,xi=null,Si=!0,n=Ta(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Oi(),r===i){t=vc(e,t,n);break a}qs(e,t,r,n)}t=t.child}return t;case 26:return rc(e,t),e===null?(n=Of(t.type,null,t.pendingProps,null))?t.memoizedState=n:bi||(n=t.type,e=t.pendingProps,r=zd(te.current).createElement(n),r[Ye]=t,r[Xe]=e,Nd(r,n,e),st(r),t.stateNode=r):t.memoizedState=Of(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return re(t),e===null&&bi&&(r=t.stateNode=df(t.type,t.pendingProps,te.current),vi=t,Si=!0,i=yi,Xd(t.type)?(cf=i,yi=sf(r.firstChild)):yi=i),qs(e,t,t.pendingProps.children,n),rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&bi&&((i=r=yi)&&(r=ef(r,t.type,t.pendingProps,Si),r===null?i=!1:(t.stateNode=r,vi=t,yi=sf(r.firstChild),Si=!1,i=!0)),i||wi(t)),re(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Hd(i,a)?r=null:s!==null&&Hd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=uo(e,t,mo,null,null,n),Zf._currentValue=i),rc(e,t),qs(e,t,r,n),t.child;case 6:return e===null&&bi&&((e=n=yi)&&(n=tf(n,t.pendingProps,Si),n===null?e=!1:(t.stateNode=n,vi=t,yi=null,e=!0)),e||wi(t)),null;case 13:return dc(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wa(t,null,r,n):qs(e,t,r,n),t.child;case 11:return Js(e,t,t.type,t.pendingProps,n);case 7:return qs(e,t,t.pendingProps,n),t.child;case 8:return qs(e,t,t.pendingProps.children,n),t.child;case 12:return qs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Pi(t,t.type,r.value),qs(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Bi(t),i=Vi(i),r=r(i),t.flags|=1,qs(e,t,r,n),t.child;case 14:return Ys(e,t,t.type,t.pendingProps,n);case 15:return Xs(e,t,t.type,t.pendingProps,n);case 19:return _c(e,t,n);case 31:return nc(e,t,n);case 22:return Zs(e,t,n,t.pendingProps);case 24:return Bi(t),r=Vi(qi),e===null?(i=aa(),i===null&&(i=jl,a=Ji(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Da(t),Pi(t,qi,i)):((e.lanes&n)!==0&&(Oa(e,t),Fa(t,null,null,n),Pa()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Pi(t,qi,r),r!==i.cache&&Li(t,[qi],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Pi(t,qi,r))),qs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Sc(e){e.flags|=4}function Cc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(bu())e.flags|=8192;else throw ha=da,la}else e.flags&=-16777217}function wc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Uf(t))if(bu())e.flags|=8192;else throw ha=da,la}function Tc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Re(),e.lanes|=t,Gl|=t)}function Ec(e,t){if(!bi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Dc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Oc(e,t,n){var r=t.pendingProps;switch(gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dc(t),null;case 1:return Dc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Fi(qi),ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Di(t)?Sc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ki())),Dc(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Sc(t),a===null?(Dc(t),Cc(t,i,null,r,n)):(Dc(t),wc(t,a))):a?a===e.memoizedState?(Dc(t),t.flags&=-16777217):(Sc(t),Dc(t),wc(t,a)):(e=e.memoizedProps,e!==r&&Sc(t),Dc(t),Cc(t,i,e,r,n)),null;case 27:if(ie(t),n=te.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Dc(t),null}e=U.current,Di(t)?Ti(t,e):(e=df(i,r,n),t.stateNode=e,Sc(t))}return Dc(t),null;case 5:if(ie(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Dc(t),null}if(a=U.current,Di(t))Ti(t,a);else{var s=zd(te.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[Ye]=t,a[Xe]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(Nd(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Sc(t)}}return Dc(t),Cc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Sc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=te.current,Di(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=vi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ye]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ad(e.nodeValue,n)),e||wi(t,!0)}else e=zd(e).createTextNode(r),e[Ye]=t,t.stateNode=e}return Dc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Di(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[Ye]=t}else Oi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dc(t),e=!1}else n=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ya(t),t):(Ya(t),null);if(t.flags&128)throw Error(o(558))}return Dc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Di(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[Ye]=t}else Oi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dc(t),i=!1}else i=ki(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ya(t),t):(Ya(t),null)}return Ya(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Tc(t,t.updateQueue),Dc(t),null);case 4:return ne(),e===null&&bd(t.stateNode.containerInfo),Dc(t),null;case 10:return Fi(t.type),Dc(t),null;case 19:if(V(Xa),r=t.memoizedState,r===null)return Dc(t),null;if(i=(t.flags&128)!=0,a=r.rendering,a===null)if(i)Ec(r,!1);else{if(Bl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Za(e),a!==null){for(t.flags|=128,Ec(r,!1),e=a.updateQueue,t.updateQueue=e,Tc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Xr(n,e),n=n.sibling;return H(Xa,Xa.current&1|2),bi&&pi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ge()>Zl&&(t.flags|=128,i=!0,Ec(r,!1),t.lanes=4194304)}else{if(!i)if(e=Za(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Tc(t,e),Ec(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!bi)return Dc(t),null}else 2*ge()-r.renderingStartTime>Zl&&n!==536870912&&(t.flags|=128,i=!0,Ec(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(Dc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ge(),e.sibling=null,n=Xa.current,H(Xa,i?n&1|2:n&1),bi&&pi(t,r.treeForkCount),e);case 22:case 23:return Ya(t),Ha(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Dc(t),t.subtreeFlags&6&&(t.flags|=8192)):Dc(t),n=t.updateQueue,n!==null&&Tc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&V(ia),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Fi(qi),Dc(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function kc(e,t){switch(gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fi(qi),ne(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ie(t),null;case 31:if(t.memoizedState!==null){if(Ya(t),t.alternate===null)throw Error(o(340));Oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ya(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Oi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(Xa),null;case 4:return ne(),null;case 10:return Fi(t.type),null;case 22:case 23:return Ya(t),Ha(),e!==null&&V(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fi(qi),null;case 25:return null;default:return null}}function Ac(e,t){switch(gi(t),t.tag){case 3:Fi(qi),ne();break;case 26:case 27:case 5:ie(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&Ya(t);break;case 13:Ya(t);break;case 19:V(Xa);break;case 10:Fi(t.type);break;case 22:case 23:Ya(t),Ha(),e!==null&&V(ia);break;case 24:Fi(qi)}}function jc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Vu(t,t.return,e)}}function Mc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Vu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Vu(t,t.return,e)}}function Nc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{La(t,n)}catch(t){Vu(e,e.return,t)}}}function Pc(e,t,n){n.props=Fs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Vu(e,t,n)}}function Fc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Vu(e,t,n)}}function Ic(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Vu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Vu(e,t,n)}else n.current=null}function Lc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Vu(e,e.return,t)}}function Rc(e,t,n){try{var r=e.stateNode;Pd(r,e.type,n,t),r[Xe]=t}catch(t){Vu(e,e.return,t)}}function zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xd(e.type)||e.tag===4}function Bc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vt));else if(r!==4&&(r===27&&Xd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Vc(e,t,n),e=e.sibling;e!==null;)Vc(e,t,n),e=e.sibling}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Xd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Uc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Nd(t,r,n),t[Ye]=e,t[Xe]=n}catch(t){Vu(e,e.return,t)}}var Wc=!1,Gc=!1,Kc=!1,qc=typeof WeakSet==`function`?WeakSet:Set,Jc=null;function Yc(e,t){if(e=e.containerInfo,Ld=op,e=fr(e),pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==a||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===a&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Rd={focusedElem:e,selectionRange:n},op=!1,Jc=t;Jc!==null;)if(t=Jc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Jc=e;else for(;Jc!==null;){switch(t=Jc,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var h=Fs(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Vu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)$d(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:$d(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Jc=e;break}Jc=t.return}}function Xc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:dl(e,n),r&4&&jc(5,n);break;case 1:if(dl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Vu(n,n.return,e)}else{var i=Fs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Vu(n,n.return,e)}}r&64&&Nc(n),r&512&&Fc(n,n.return);break;case 3:if(dl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{La(e,t)}catch(e){Vu(n,n.return,e)}}break;case 27:t===null&&r&4&&Uc(n);case 26:case 5:dl(e,n),t===null&&r&4&&Lc(n),r&512&&Fc(n,n.return);break;case 12:dl(e,n);break;case 31:dl(e,n),r&4&&nl(e,n);break;case 13:dl(e,n),r&4&&rl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Gu.bind(null,n),of(e,n))));break;case 22:if(r=n.memoizedState!==null||Wc,!r){t=t!==null&&t.memoizedState!==null||Gc,i=Wc;var a=Gc;Wc=r,(Gc=t)&&!a?pl(e,n,(n.subtreeFlags&8772)!=0):dl(e,n),Wc=i,Gc=a}break;case 30:break;default:dl(e,n)}}function Zc(e){var t=e.alternate;t!==null&&(e.alternate=null,Zc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qc=null,$c=!1;function el(e,t,n){for(n=n.child;n!==null;)tl(e,t,n),n=n.sibling}function tl(e,t,n){if(Te&&typeof Te.onCommitFiberUnmount==`function`)try{Te.onCommitFiberUnmount(we,n)}catch{}switch(n.tag){case 26:Gc||Ic(n,t),el(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Gc||Ic(n,t);var r=Qc,i=$c;Xd(n.type)&&(Qc=n.stateNode,$c=!1),el(e,t,n),ff(n.stateNode),Qc=r,$c=i;break;case 5:Gc||Ic(n,t);case 6:if(r=Qc,i=$c,Qc=null,el(e,t,n),Qc=r,$c=i,Qc!==null)if($c)try{(Qc.nodeType===9?Qc.body:Qc.nodeName===`HTML`?Qc.ownerDocument.body:Qc).removeChild(n.stateNode)}catch(e){Vu(n,t,e)}else try{Qc.removeChild(n.stateNode)}catch(e){Vu(n,t,e)}break;case 18:Qc!==null&&($c?(e=Qc,Zd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Mp(e)):Zd(Qc,n.stateNode));break;case 4:r=Qc,i=$c,Qc=n.stateNode.containerInfo,$c=!0,el(e,t,n),Qc=r,$c=i;break;case 0:case 11:case 14:case 15:Mc(2,n,t),Gc||Mc(4,n,t),el(e,t,n);break;case 1:Gc||(Ic(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Pc(n,t,r)),el(e,t,n);break;case 21:el(e,t,n);break;case 22:Gc=(r=Gc)||n.memoizedState!==null,el(e,t,n),Gc=r;break;default:el(e,t,n)}}function nl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Mp(e)}catch(e){Vu(t,t.return,e)}}}function rl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Mp(e)}catch(e){Vu(t,t.return,e)}}function il(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new qc),t;default:throw Error(o(435,e.tag))}}function al(e,t){var n=il(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ku.bind(null,e,t);t.then(r,r)}})}function ol(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Xd(c.type)){Qc=c.stateNode,$c=!1;break a}break;case 5:Qc=c.stateNode,$c=!1;break a;case 3:case 4:Qc=c.stateNode.containerInfo,$c=!0;break a}c=c.return}if(Qc===null)throw Error(o(160));tl(a,s,i),Qc=null,$c=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cl(t,e),t=t.sibling}var sl=null;function cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ol(t,e),ll(e),r&4&&(Mc(3,e,e.return),jc(3,e),Mc(5,e,e.return));break;case 1:ol(t,e),ll(e),r&512&&(Gc||n===null||Ic(n,n.return)),r&64&&Wc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=sl;if(ol(t,e),ll(e),r&512&&(Gc||n===null||Ic(n,n.return)),r&4){var a=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[tt]||a[Ye]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Nd(a,r,n),a[Ye]=e,st(a),r=a;break a;case`link`:var s=Bf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}a=i.createElement(r),Nd(a,r,n),i.head.appendChild(a);break;case`meta`:if(s=Bf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}a=i.createElement(r),Nd(a,r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[Ye]=e,st(a),r=a}e.stateNode=r}else Vf(i,e.type,e.stateNode);else e.stateNode=Ff(i,r,e.memoizedProps);else a===r?r===null&&e.stateNode!==null&&Rc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Vf(i,e.type,e.stateNode):Ff(i,r,e.memoizedProps))}break;case 27:ol(t,e),ll(e),r&512&&(Gc||n===null||Ic(n,n.return)),n!==null&&r&4&&Rc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ol(t,e),ll(e),r&512&&(Gc||n===null||Ic(n,n.return)),e.flags&32){i=e.stateNode;try{Nt(i,``)}catch(t){Vu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Rc(e,i,n===null?i:n.memoizedProps)),r&1024&&(Kc=!0);break;case 6:if(ol(t,e),ll(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Vu(e,e.return,t)}}break;case 3:if(zf=null,i=sl,sl=hf(t.containerInfo),ol(t,e),sl=i,ll(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Mp(t.containerInfo)}catch(t){Vu(e,e.return,t)}Kc&&(Kc=!1,ul(e));break;case 4:r=sl,sl=hf(e.stateNode.containerInfo),ol(t,e),ll(e),sl=r;break;case 12:ol(t,e),ll(e);break;case 31:ol(t,e),ll(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,al(e,r)));break;case 13:ol(t,e),ll(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Yl=ge()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,al(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Wc,d=Gc;if(Wc=u||i,Gc=d||l,ol(t,e),Gc=d,Wc=u,ll(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Wc||Gc||fl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Vu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Vu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?Qd(m,!0):Qd(l.stateNode,!1)}catch(e){Vu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,al(e,n))));break;case 19:ol(t,e),ll(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,al(e,r)));break;case 30:break;case 21:break;default:ol(t,e),ll(e)}}function ll(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(zc(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode;Hc(e,Bc(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Nt(a,``),n.flags&=-33),Hc(e,Bc(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Vc(e,Bc(e),s);break;default:throw Error(o(161))}}catch(t){Vu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ul(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ul(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xc(e,t.alternate,t),t=t.sibling}function fl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Mc(4,t,t.return),fl(t);break;case 1:Ic(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Pc(t,t.return,n),fl(t);break;case 27:ff(t.stateNode);case 26:case 5:Ic(t,t.return),fl(t);break;case 22:t.memoizedState===null&&fl(t);break;case 30:fl(t);break;default:fl(t)}e=e.sibling}}function pl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:pl(i,a,n),jc(4,a);break;case 1:if(pl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Vu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ia(c[i],s)}catch(e){Vu(r,r.return,e)}}n&&o&64&&Nc(a),Fc(a,a.return);break;case 27:Uc(a);case 26:case 5:pl(i,a,n),n&&r===null&&o&4&&Lc(a),Fc(a,a.return);break;case 12:pl(i,a,n);break;case 31:pl(i,a,n),n&&o&4&&nl(i,a);break;case 13:pl(i,a,n),n&&o&4&&rl(i,a);break;case 22:a.memoizedState===null&&pl(i,a,n),Fc(a,a.return);break;case 30:break;default:pl(i,a,n)}t=t.sibling}}function ml(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Yi(n))}function hl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yi(e))}function gl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_l(e,t,n,r),t=t.sibling}function _l(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:gl(e,t,n,r),i&2048&&jc(9,t);break;case 1:gl(e,t,n,r);break;case 3:gl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yi(e)));break;case 12:if(i&2048){gl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Vu(t,t.return,e)}}else gl(e,t,n,r);break;case 31:gl(e,t,n,r);break;case 13:gl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?gl(e,t,n,r):(a._visibility|=2,vl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?gl(e,t,n,r):yl(e,t),i&2048&&ml(o,t);break;case 24:gl(e,t,n,r),i&2048&&hl(t.alternate,t);break;default:gl(e,t,n,r)}}function vl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:vl(a,o,s,c,i),jc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,vl(a,o,s,c,i)):u._visibility&2?vl(a,o,s,c,i):yl(a,o),i&&l&2048&&ml(o.alternate,o);break;case 24:vl(a,o,s,c,i),i&&l&2048&&hl(o.alternate,o);break;default:vl(a,o,s,c,i)}t=t.sibling}}function yl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:yl(n,r),i&2048&&ml(r.alternate,r);break;case 24:yl(n,r),i&2048&&hl(r.alternate,r);break;default:yl(n,r)}t=t.sibling}}var bl=8192;function xl(e,t,n){if(e.subtreeFlags&bl)for(e=e.child;e!==null;)Sl(e,t,n),e=e.sibling}function Sl(e,t,n){switch(e.tag){case 26:xl(e,t,n),e.flags&bl&&e.memoizedState!==null&&Wf(n,sl,e.memoizedState,e.memoizedProps);break;case 5:xl(e,t,n);break;case 3:case 4:var r=sl;sl=hf(e.stateNode.containerInfo),xl(e,t,n),sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=bl,bl=16777216,xl(e,t,n),bl=r):xl(e,t,n));break;default:xl(e,t,n)}}function Cl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jc=r,Dl(r,e)}Cl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tl(e),e=e.sibling}function Tl(e){switch(e.tag){case 0:case 11:case 15:wl(e),e.flags&2048&&Mc(9,e,e.return);break;case 3:wl(e);break;case 12:wl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,El(e)):wl(e);break;default:wl(e)}}function El(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Jc=r,Dl(r,e)}Cl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mc(8,t,t.return),El(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,El(t));break;default:El(t)}e=e.sibling}}function Dl(e,t){for(;Jc!==null;){var n=Jc;switch(n.tag){case 0:case 11:case 15:Mc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Yi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Jc=r;else a:for(n=e;Jc!==null;){r=Jc;var i=r.sibling,a=r.return;if(Zc(r),r===n){Jc=null;break a}if(i!==null){i.return=a,Jc=i;break a}Jc=a}}}var Ol={getCacheForType:function(e){var t=Vi(qi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Vi(qi).controller.signal}},kl=typeof WeakMap==`function`?WeakMap:Map,Al=0,jl=null,Ml=null,Nl=0,Pl=0,Fl=null,Il=!1,Ll=!1,Rl=!1,zl=0,Bl=0,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=null,ql=null,Jl=!1,Yl=0,Xl=0,Zl=1/0,Ql=null,$l=null,eu=0,tu=null,nu=null,ru=0,iu=0,au=null,ou=null,su=0,cu=null;function lu(){return Al&2&&Nl!==0?Nl&-Nl:F.T===null?Ke():cd()}function uu(){if(Wl===0)if(!(Nl&536870912)||bi){var e=Me;Me<<=1,!(Me&3932160)&&(Me=262144),Wl=e}else Wl=536870912;return e=Ua.current,e!==null&&(e.flags|=32),Wl}function du(e,t,n){(e===jl&&(Pl===2||Pl===9)||e.cancelPendingCommit!==null)&&(vu(e,0),hu(e,Nl,Wl,!1)),Be(e,n),(!(Al&2)||e!==jl)&&(e===jl&&(!(Al&2)&&(Hl|=n),Bl===4&&hu(e,Nl,Wl,!1)),ed(e))}function fu(e,t,n){if(Al&6)throw Error(o(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ie(e,t),i=r?Eu(e,t):wu(e,t,!0),a=r;do{if(i===0){Ll&&!r&&hu(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!mu(n)){i=wu(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Kl;var l=c.current.memoizedState.isDehydrated;if(l&&(vu(c,s).flags|=256),s=wu(c,s,!1),s!==2){if(Rl&&!l){c.errorRecoveryDisabledLanes|=a,Hl|=a,i=4;break a}a=ql,ql=i,a!==null&&(ql===null?ql=a:ql.push.apply(ql,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){vu(e,0),hu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:hu(r,t,Wl,!Il);break a;case 2:ql=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Yl+300-ge(),10<i)){if(hu(r,t,Wl,!Il),Fe(r,0,!0)!==0)break a;ru=t,r.timeoutHandle=Gd(pu.bind(null,r,n,ql,Ql,Jl,t,Wl,Hl,Gl,Il,a,`Throttled`,-0,0),i);break a}pu(r,n,ql,Ql,Jl,t,Wl,Hl,Gl,Il,a,null,-0,0)}}break}while(1);ed(e)}function pu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},Sl(t,a,d);var m=(a&62914560)===a?Yl-ge():(a&4194048)===a?Xl-ge():0;if(m=Kf(d,m),m!==null){ru=a,e.cancelPendingCommit=m(Nu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),hu(e,a,o,!l);return}}Nu(e,t,a,n,r,i,o,s,c)}function mu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function hu(e,t,n,r){t&=~Ul,t&=~Hl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-De(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&J(e,n,t)}function gu(){return Al&6?!0:(td(0,!1),!1)}function _u(){if(Ml!==null){if(Pl===0)var e=Ml.return;else e=Ml,Ni=Mi=null,_o(e),va=null,ya=0,e=Ml;for(;e!==null;)Ac(e.alternate,e),e=e.return;Ml=null}}function vu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Kd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ru=0,_u(),jl=e,Ml=n=Yr(e.current,null),Nl=t,Pl=0,Fl=null,Il=!1,Ll=Ie(e,t),Rl=!1,Gl=Wl=Ul=Hl=Vl=Bl=0,ql=Kl=null,Jl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-De(r),a=1<<i;t|=e[i],r&=~a}return zl=t,zr(),n}function yu(e,t){$=null,F.H=Ds,t===ca||t===ua?(t=ga(),Pl=3):t===la?(t=ga(),Pl=4):Pl=t===Gs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Fl=t,Ml===null&&(Bl=1,zs(e,ri(t,e.current)))}function bu(){var e=Ua.current;return e===null?!0:(Nl&4194048)===Nl?Wa===null:(Nl&62914560)===Nl||Nl&536870912?e===Wa:!1}function xu(){var e=F.H;return F.H=Ds,e===null?Ds:e}function Su(){var e=F.A;return F.A=Ol,e}function Cu(){Bl=4,Il||(Nl&4194048)!==Nl&&Ua.current!==null||(Ll=!0),!(Vl&134217727)&&!(Hl&134217727)||jl===null||hu(jl,Nl,Wl,!1)}function wu(e,t,n){var r=Al;Al|=2;var i=xu(),a=Su();(jl!==e||Nl!==t)&&(Ql=null,vu(e,t)),t=!1;var o=Bl;a:do try{if(Pl!==0&&Ml!==null){var s=Ml,c=Fl;switch(Pl){case 8:_u(),o=6;break a;case 3:case 2:case 9:case 6:Ua.current===null&&(t=!0);var l=Pl;if(Pl=0,Fl=null,Au(e,s,c,l),n&&Ll){o=0;break a}break;default:l=Pl,Pl=0,Fl=null,Au(e,s,c,l)}}Tu(),o=Bl;break}catch(t){yu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ni=Mi=null,Al=r,F.H=i,F.A=a,Ml===null&&(jl=null,Nl=0,zr()),o}function Tu(){for(;Ml!==null;)Ou(Ml)}function Eu(e,t){var n=Al;Al|=2;var r=xu(),i=Su();jl!==e||Nl!==t?(Ql=null,Zl=ge()+500,vu(e,t)):Ll=Ie(e,t);a:do try{if(Pl!==0&&Ml!==null){t=Ml;var a=Fl;b:switch(Pl){case 1:Pl=0,Fl=null,Au(e,t,a,1);break;case 2:case 9:if(fa(a)){Pl=0,Fl=null,ku(t);break}t=function(){Pl!==2&&Pl!==9||jl!==e||(Pl=7),ed(e)},a.then(t,t);break a;case 3:Pl=7;break a;case 4:Pl=5;break a;case 7:fa(a)?(Pl=0,Fl=null,ku(t)):(Pl=0,Fl=null,Au(e,t,a,7));break;case 5:var s=null;switch(Ml.tag){case 26:s=Ml.memoizedState;case 5:case 27:var c=Ml;if(s?Uf(s):c.stateNode.complete){Pl=0,Fl=null;var l=c.sibling;if(l!==null)Ml=l;else{var u=c.return;u===null?Ml=null:(Ml=u,ju(u))}break b}}Pl=0,Fl=null,Au(e,t,a,5);break;case 6:Pl=0,Fl=null,Au(e,t,a,6);break;case 8:_u(),Bl=6;break a;default:throw Error(o(462))}}Du();break}catch(t){yu(e,t)}while(1);return Ni=Mi=null,F.H=r,F.A=i,Al=n,Ml===null?(jl=null,Nl=0,zr(),Bl):0}function Du(){for(;Ml!==null&&!me();)Ou(Ml)}function Ou(e){var t=xc(e.alternate,e,zl);e.memoizedProps=e.pendingProps,t===null?ju(e):Ml=t}function ku(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ac(n,t,t.pendingProps,t.type,void 0,Nl);break;case 11:t=ac(n,t,t.pendingProps,t.type.render,t.ref,Nl);break;case 5:_o(t);default:Ac(n,t),t=Ml=Xr(t,zl),t=xc(n,t,zl)}e.memoizedProps=e.pendingProps,t===null?ju(e):Ml=t}function Au(e,t,n,r){Ni=Mi=null,_o(t),va=null,ya=0;var i=t.return;try{if(Ws(e,i,t,n,Nl)){Bl=1,zs(e,ri(n,e.current)),Ml=null;return}}catch(t){if(i!==null)throw Ml=i,t;Bl=1,zs(e,ri(n,e.current)),Ml=null;return}t.flags&32768?(bi||r===1?e=!0:Ll||Nl&536870912?e=!1:(Il=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),Mu(t,e)):ju(t)}function ju(e){var t=e;do{if(t.flags&32768){Mu(t,Il);return}e=t.return;var n=Oc(t.alternate,t,zl);if(n!==null){Ml=n;return}if(t=t.sibling,t!==null){Ml=t;return}Ml=t=e}while(t!==null);Bl===0&&(Bl=5)}function Mu(e,t){do{var n=kc(e.alternate,e);if(n!==null){n.flags&=32767,Ml=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ml=e;return}Ml=e=n}while(e!==null);Bl=6,Ml=null}function Nu(e,t,n,r,i,a,s,c,l){e.cancelPendingCommit=null;do Ru();while(eu!==0);if(Al&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(a=t.lanes|t.childLanes,a|=Rr,Ve(e,n,a,s,c,l),e===jl&&(Ml=jl=null,Nl=0),nu=t,tu=e,ru=n,iu=a,au=i,ou=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,qu(be,function(){return zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,s=Al,Al|=4;try{Yc(e,t,n)}finally{Al=s,I.p=i,F.T=r}}eu=1,Pu(),Fu(),Iu()}}function Pu(){if(eu===1){eu=0;var e=tu,t=nu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Al;Al|=4;try{cl(t,e);var a=Rd,o=fr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&dr(s.ownerDocument.documentElement,s)){if(c!==null&&pr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=ur(s,h),v=ur(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}op=!!Ld,Rd=Ld=null}finally{Al=i,I.p=r,F.T=n}}e.current=t,eu=2}}function Fu(){if(eu===2){eu=0;var e=tu,t=nu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Al;Al|=4;try{Xc(e,t.alternate,t)}finally{Al=i,I.p=r,F.T=n}}eu=3}}function Iu(){if(eu===4||eu===3){eu=0,he();var e=tu,t=nu,n=ru,r=ou;t.subtreeFlags&10256||t.flags&10256?eu=5:(eu=0,nu=tu=null,Lu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&($l=null),Ge(n),t=t.stateNode,Te&&typeof Te.onCommitFiberRoot==`function`)try{Te.onCommitFiberRoot(we,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}ru&3&&Ru(),ed(e),i=e.pendingLanes,n&261930&&i&42?e===cu?su++:(su=0,cu=e):su=0,td(0,!1)}}function Lu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yi(t)))}function Ru(){return Pu(),Fu(),Iu(),zu()}function zu(){if(eu!==5)return!1;var e=tu,t=iu;iu=0;var n=Ge(ru),r=F.T,i=I.p;try{I.p=32>n?32:n,F.T=null,n=au,au=null;var a=tu,s=ru;if(eu=0,nu=tu=null,ru=0,Al&6)throw Error(o(331));var c=Al;if(Al|=4,Tl(a.current),_l(a,a.current,s,n),Al=c,td(0,!1),Te&&typeof Te.onPostCommitFiberRoot==`function`)try{Te.onPostCommitFiberRoot(we,a)}catch{}return!0}finally{I.p=i,F.T=r,Lu(e,t)}}function Bu(e,t,n){t=ri(n,t),t=Vs(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(Be(e,2),ed(e))}function Vu(e,t,n){if(e.tag===3)Bu(e,e,n);else for(;t!==null;){if(t.tag===3){Bu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&($l===null||!$l.has(r))){e=ri(n,e),n=Hs(2),r=Aa(t,n,2),r!==null&&(Us(n,r,t,e),Be(r,2),ed(r));break}}t=t.return}}function Hu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Rl=!0,i.add(n),e=Uu.bind(null,e,t,n),t.then(e,e))}function Uu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,jl===e&&(Nl&n)===n&&(Bl===4||Bl===3&&(Nl&62914560)===Nl&&300>ge()-Yl?!(Al&2)&&vu(e,0):Ul|=n,Gl===Nl&&(Gl=0)),ed(e)}function Wu(e,t){t===0&&(t=Re()),e=Hr(e,t),e!==null&&(Be(e,t),ed(e))}function Gu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wu(e,n)}function Ku(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Wu(e,n)}function qu(e,t){return fe(e,t)}var Ju=null,Yu=null,Xu=!1,Zu=!1,Qu=!1,$u=0;function ed(e){e!==Yu&&e.next===null&&(Yu===null?Ju=Yu=e:Yu=Yu.next=e),Zu=!0,Xu||(Xu=!0,sd())}function td(e,t){if(!Qu&&Zu){Qu=!0;do for(var n=!1,r=Ju;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-De(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,od(r,a))}else a=Nl,a=Fe(r,r===jl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ie(r,a)||(n=!0,od(r,a));r=r.next}while(n);Qu=!1}}function nd(){rd()}function rd(){Zu=Xu=!1;var e=0;$u!==0&&Wd()&&(e=$u);for(var t=ge(),n=null,r=Ju;r!==null;){var i=r.next,a=id(r,t);a===0?(r.next=null,n===null?Ju=i:n.next=i,i===null&&(Yu=n)):(n=r,(e!==0||a&3)&&(Zu=!0)),r=i}eu!==0&&eu!==5||td(e,!1),$u!==0&&($u=0)}function id(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-De(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Le(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=jl,n=Nl,n=Fe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Pl===2||Pl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ie(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&pe(r),Ge(n)){case 2:case 8:n=ye;break;case 32:n=be;break;case 268435456:n=Se;break;default:n=be}return r=ad.bind(null,e),n=fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&pe(r),e.callbackPriority=2,e.callbackNode=null,2}function ad(e,t){if(eu!==0&&eu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ru()&&e.callbackNode!==n)return null;var r=Nl;return r=Fe(e,e===jl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(fu(e,r,t),id(e,ge()),e.callbackNode!=null&&e.callbackNode===n?ad.bind(null,e):null)}function od(e,t){if(Ru())return null;fu(e,t,!0)}function sd(){Jd(function(){Al&6?fe(ve,nd):rd()})}function cd(){if($u===0){var e=Qi;e===0&&(e=je,je<<=1,!(je&261888)&&(je=256)),$u=e}return $u}function ld(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Bt(``+e)}function ud(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function dd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=ld((i[Xe]||null).action),o=r.submitter;o&&(t=(t=o[Xe]||null)?ld(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if($u!==0){var e=o?ud(i,o):new FormData(i);ps(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?ud(i,o):new FormData(i),ps(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var fd=0;fd<Nr.length;fd++){var pd=Nr[fd];Pr(pd.toLowerCase(),`on`+(pd[0].toUpperCase()+pd.slice(1)))}Pr(Tr,`onAnimationEnd`),Pr(Er,`onAnimationIteration`),Pr(Dr,`onAnimationStart`),Pr(`dblclick`,`onDoubleClick`),Pr(`focusin`,`onFocus`),Pr(`focusout`,`onBlur`),Pr(Or,`onTransitionRun`),Pr(kr,`onTransitionStart`),Pr(Ar,`onTransitionCancel`),Pr(jr,`onTransitionEnd`),dt(`onMouseEnter`,[`mouseout`,`mouseover`]),dt(`onMouseLeave`,[`mouseout`,`mouseover`]),dt(`onPointerEnter`,[`pointerout`,`pointerover`]),dt(`onPointerLeave`,[`pointerout`,`pointerover`]),ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var md=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),hd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(md));function gd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Fr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Fr(e)}i.currentTarget=null,a=c}}}}function _d(e,t){var n=t[Y];n===void 0&&(n=t[Y]=new Set);var r=e+`__bubble`;n.has(r)||(xd(t,e,2,!1),n.add(r))}function vd(e,t,n){var r=0;t&&(r|=4),xd(n,e,r,t)}var yd=`_reactListening`+Math.random().toString(36).slice(2);function bd(e){if(!e[yd]){e[yd]=!0,ct.forEach(function(t){t!==`selectionchange`&&(hd.has(t)||vd(t,!1,e),vd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yd]||(t[yd]=!0,vd(`selectionchange`,!1,t))}}function xd(e,t,n,r){switch(pp(t)){case 2:var i=sp;break;case 8:i=cp;break;default:i=lp}n=i.bind(null,t,n,e),i=void 0,!Zt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Sd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=rt(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Jt(function(){var r=a,i=Ut(n),o=[];a:{var s=Mr.get(e);if(s!==void 0){var l=cn,u=e;switch(e){case`keypress`:if(rn(n)===0)break a;case`keydown`:case`keyup`:l=En;break;case`focusin`:u=`focus`,l=_n;break;case`focusout`:u=`blur`,l=_n;break;case`beforeblur`:case`afterblur`:l=_n;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=hn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=On;break;case Tr:case Er:case Dr:l=vn;break;case jr:l=kn;break;case`scroll`:case`scrollend`:l=un;break;case`wheel`:l=An;break;case`copy`:case`cut`:case`paste`:l=yn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Dn;break;case`toggle`:case`beforetoggle`:l=jn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Yt(m,p),g!=null&&d.push(Cd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==Ht&&(u=n.relatedTarget||n.fromElement)&&(rt(u)||u[Ze]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?rt(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=hn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Dn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:at(l),h=u==null?s:at(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,rt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Td,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Ed(o,s,l,d,!1),u!==null&&f!==null&&Ed(o,f,u,d,!0)}}a:{if(s=r?at(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=Zn;else if(Gn(s))if(Qn)v=ar;else{v=rr;var y=Q}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Lt(r.elementType)&&(v=Zn):v=ir;if(v&&=v(e,r)){Kn(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&kt(s,`number`,s.value)}switch(y=r?at(r):window,e){case`focusin`:(Gn(y)||y.contentEditable===`true`)&&(hr=y,gr=r,_r=null);break;case`focusout`:_r=gr=hr=null;break;case`mousedown`:vr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:vr=!1,yr(o,n,i);break;case`selectionchange`:if(mr)break;case`keydown`:case`keyup`:yr(o,n,i)}var b;if(Nn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Vn?zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(In&&n.locale!==`ko`&&(Vn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Vn&&(b=nn()):($t=i,en=`value`in $t?$t.value:$t.textContent,Vn=!0)),y=wd(r,x),0<y.length&&(x=new bn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Bn(n),b!==null&&(x.data=b)))),(b=Fn?Hn(e,n):Un(e,n))&&(x=wd(r,`onBeforeInput`),0<x.length&&(y=new bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),dd(o,e,r,n,i)}gd(o,t)})}function Cd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Yt(e,n),i!=null&&r.unshift(Cd(e,i,a)),i=Yt(e,t),i!=null&&r.push(Cd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Td(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Ed(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Yt(n,a),l!=null&&o.unshift(Cd(n,l,c))):i||(l=Yt(n,a),l!=null&&o.push(Cd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Dd=/\r\n?/g,Od=/\u0000|\uFFFD/g;function kd(e){return(typeof e==`string`?e:``+e).replace(Dd,`
10
+ `).replace(Od,``)}function Ad(e,t){return t=kd(t),kd(e)===t}function jd(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Nt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Nt(e,``+r);break;case`className`:_t(e,`class`,r);break;case`tabIndex`:_t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:_t(e,n,r);break;case`style`:It(e,r,a);break;case`data`:if(t!==`object`){_t(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof a==`function`&&(n===`formAction`?(t!==`input`&&jd(e,t,`name`,i.name,i,null),jd(e,t,`formEncType`,i.formEncType,i,null),jd(e,t,`formMethod`,i.formMethod,i,null),jd(e,t,`formTarget`,i.formTarget,i,null)):(jd(e,t,`encType`,i.encType,i,null),jd(e,t,`method`,i.method,i,null),jd(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`onScroll`:r!=null&&_d(`scroll`,e);break;case`onScrollEnd`:r!=null&&_d(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Bt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:_d(`beforetoggle`,e),_d(`toggle`,e),gt(e,`popover`,r);break;case`xlinkActuate`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:gt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Rt.get(n)||n,gt(e,n,r))}}function Md(e,t,n,r,i,a){switch(n){case`style`:It(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Nt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Nt(e,``+r);break;case`onScroll`:r!=null&&_d(`scroll`,e);break;case`onScrollEnd`:r!=null&&_d(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!lt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[Xe]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):gt(e,n,r)}}}function Nd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:_d(`error`,e),_d(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:jd(e,t,a,s,n,null)}}i&&jd(e,t,`srcSet`,n.srcSet,n,null),r&&jd(e,t,`src`,n.src,n,null);return;case`input`:_d(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:jd(e,t,r,d,n,null)}}Ot(e,a,c,l,u,s,i,!1);return;case`select`:for(i in _d(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:jd(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&At(e,!!r,n,!0):At(e,!!r,t,!1);return;case`textarea`:for(s in _d(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:jd(e,t,s,c,n,null)}Mt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:jd(e,t,l,r,n,null)}return;case`dialog`:_d(`beforetoggle`,e),_d(`toggle`,e),_d(`cancel`,e),_d(`close`,e);break;case`iframe`:case`object`:_d(`load`,e);break;case`video`:case`audio`:for(r=0;r<md.length;r++)_d(md[r],e);break;case`image`:_d(`error`,e),_d(`load`,e);break;case`details`:_d(`toggle`,e);break;case`embed`:case`source`:case`link`:_d(`error`,e),_d(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:jd(e,t,u,r,n,null)}return;default:if(Lt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Md(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&jd(e,t,c,r,n,null))}function Pd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||jd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&jd(e,t,p,m,r,f)}}Dt(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||jd(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&jd(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?At(e,!!n,n?[]:``,!1):At(e,!!n,t,!0)):At(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:jd(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&jd(e,t,s,i,r,a)}jt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:jd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:jd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&jd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:jd(e,t,u,p,r,m)}return;default:if(Lt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Md(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Md(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&jd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||jd(e,t,f,p,r,m)}function Fd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Id(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Fd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Fd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Ld=null,Rd=null;function zd(e){return e.nodeType===9?e:e.ownerDocument}function Bd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Vd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Hd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ud=null;function Wd(){var e=window.event;return e&&e.type===`popstate`?e===Ud?!1:(Ud=e,!0):(Ud=null,!1)}var Gd=typeof setTimeout==`function`?setTimeout:void 0,Kd=typeof clearTimeout==`function`?clearTimeout:void 0,qd=typeof Promise==`function`?Promise:void 0,Jd=typeof queueMicrotask==`function`?queueMicrotask:qd===void 0?Gd:function(e){return qd.resolve(null).then(e).catch(Yd)};function Yd(e){setTimeout(function(){throw e})}function Xd(e){return e===`head`}function Zd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Mp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ff(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ff(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[tt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ff(e.ownerDocument.body);n=i}while(n);Mp(t)}function Qd(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function $d(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:$d(n),nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ef(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[tt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=sf(e.nextSibling),e===null)break}return null}function tf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=sf(e.nextSibling),e===null))return null;return e}function nf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=sf(e.nextSibling),e===null))return null;return e}function rf(e){return e.data===`$?`||e.data===`$~`}function af(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function of(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function sf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var cf=null;function lf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function uf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function df(e,t,n){switch(t=zd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function ff(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nt(e)}var pf=new Map,mf=new Set;function hf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gf=I.d;I.d={f:_f,r:vf,D:xf,C:Sf,L:Cf,m:wf,X:Ef,S:Tf,M:Df};function _f(){var e=gf.f(),t=gu();return e||t}function vf(e){var t=it(e);t!==null&&t.tag===5&&t.type===`form`?hs(t):gf.r(e)}var yf=typeof document>`u`?null:document;function bf(e,t,n){var r=yf;if(r&&typeof t==`string`&&t){var i=Et(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),mf.has(i)||(mf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Nd(t,`link`,e),st(t),r.head.appendChild(t)))}}function xf(e){gf.D(e),bf(`dns-prefetch`,e,null)}function Sf(e,t){gf.C(e,t),bf(`preconnect`,e,t)}function Cf(e,t,n){gf.L(e,t,n);var r=yf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Et(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Et(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Et(n.imageSizes)+`"]`)):i+=`[href="`+Et(e)+`"]`;var a=i;switch(t){case`style`:a=kf(e);break;case`script`:a=Nf(e)}pf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),pf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Af(a))||t===`script`&&r.querySelector(Pf(a))||(t=r.createElement(`link`),Nd(t,`link`,e),st(t),r.head.appendChild(t)))}}function wf(e,t){gf.m(e,t);var n=yf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Et(r)+`"][href="`+Et(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Nf(e)}if(!pf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),pf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Pf(a)))return}r=n.createElement(`link`),Nd(r,`link`,e),st(r),n.head.appendChild(r)}}}function Tf(e,t,n){gf.S(e,t,n);var r=yf;if(r&&e){var i=ot(r).hoistableStyles,a=kf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Af(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=pf.get(a))&&Lf(e,n);var c=o=r.createElement(`link`);st(c),Nd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,If(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ef(e,t){gf.X(e,t);var n=yf;if(n&&e){var r=ot(n).hoistableScripts,i=Nf(e),a=r.get(i);a||(a=n.querySelector(Pf(i)),a||(e=m({src:e,async:!0},t),(t=pf.get(i))&&Rf(e,t),a=n.createElement(`script`),st(a),Nd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Df(e,t){gf.M(e,t);var n=yf;if(n&&e){var r=ot(n).hoistableScripts,i=Nf(e),a=r.get(i);a||(a=n.querySelector(Pf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=pf.get(i))&&Rf(e,t),a=n.createElement(`script`),st(a),Nd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t,n,r){var i=(i=te.current)?hf(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=kf(n.href),n=ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=kf(n.href);var a=ot(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Af(e)))&&!a._p&&(s.instance=a,s.state.loading=5),pf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pf.set(e,n),a||Mf(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Nf(n),n=ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function kf(e){return`href="`+Et(e)+`"`}function Af(e){return`link[rel="stylesheet"][`+e+`]`}function jf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Mf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Nd(t,`link`,n),st(t),e.head.appendChild(t))}function Nf(e){return`[src="`+Et(e)+`"]`}function Pf(e){return`script[async]`+e}function Ff(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Et(n.href)+`"]`);if(r)return t.instance=r,st(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),st(r),Nd(r,`style`,i),If(r,n.precedence,e),t.instance=r;case`stylesheet`:i=kf(n.href);var a=e.querySelector(Af(i));if(a)return t.state.loading|=4,t.instance=a,st(a),a;r=jf(n),(i=pf.get(i))&&Lf(r,i),a=(e.ownerDocument||e).createElement(`link`),st(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Nd(a,`link`,r),t.state.loading|=4,If(a,n.precedence,e),t.instance=a;case`script`:return a=Nf(n.src),(i=e.querySelector(Pf(a)))?(t.instance=i,st(i),i):(r=n,(i=pf.get(a))&&(r=m({},n),Rf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),st(i),Nd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,If(r,n.precedence,e));return t.instance}function If(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Lf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var zf=null;function Bf(e,t,n){if(zf===null){var r=new Map,i=zf=new Map;i.set(n,r)}else i=zf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[tt]||a[Ye]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Vf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Hf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Uf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Wf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=kf(r.href),a=t.querySelector(Af(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,st(a);return}a=t.ownerDocument||t,r=jf(r),(i=pf.get(i))&&Lf(r,i),a=a.createElement(`link`),st(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Nd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Gf=0;function Kf(e,t){return e.stylesheets&&e.count===0&&Yf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Yf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Gf===0&&(Gf=62500*Id());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Yf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Gf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jf=null;function Yf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jf=new Map,t.forEach(Xf,e),Jf=null,qf.call(e))}function Xf(e,t){if(!(t.state.loading&4)){var n=Jf.get(e);if(n)var r=n.get(null);else{n=new Map,Jf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=qf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Zf={$$typeof:S,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function Qf(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ze(0),this.hiddenUpdates=ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function $f(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Qf(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=qr(3,null,null,t),e.current=a,a.stateNode=e,t=Ji(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Da(a),e}function ep(e){return e?(e=Gr,e):Gr}function tp(e,t,n,r,i,a){i=ep(i),r.context===null?r.context=i:r.pendingContext=i,r=ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Aa(e,r,t),n!==null&&(du(n,e,t),ja(n,e,t))}function np(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function rp(e,t){np(e,t),(e=e.alternate)&&np(e,t)}function ip(e){if(e.tag===13||e.tag===31){var t=Hr(e,67108864);t!==null&&du(t,e,67108864),rp(e,67108864)}}function ap(e){if(e.tag===13||e.tag===31){var t=lu();t=We(t);var n=Hr(e,t);n!==null&&du(n,e,t),rp(e,t)}}var op=!0;function sp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,lp(e,t,n,r)}finally{I.p=a,F.T=i}}function cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,lp(e,t,n,r)}finally{I.p=a,F.T=i}}function lp(e,t,n,r){if(op){var i=up(r);if(i===null)Sd(e,t,r,dp,n),Sp(e,r);else if(wp(i,e,t,n,r))r.stopPropagation();else if(Sp(e,r),t&4&&-1<xp.indexOf(e)){for(;i!==null;){var a=it(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Pe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-De(o);s.entanglements[1]|=c,o&=~c}ed(a),!(Al&6)&&(Zl=ge()+500,td(0,!1))}}break;case 31:case 13:s=Hr(a,2),s!==null&&du(s,a,2),gu(),rp(a,2)}if(a=up(r),a===null&&Sd(e,t,r,dp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Sd(e,t,r,null,n)}}function up(e){return e=Ut(e),fp(e)}var dp=null;function fp(e){if(dp=null,e=rt(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return dp=e,null}function pp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(_e()){case ve:return 2;case ye:return 8;case be:case xe:return 32;case Se:return 268435456;default:return 32}default:return 32}}var mp=!1,hp=null,gp=null,_p=null,vp=new Map,yp=new Map,bp=[],xp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Sp(e,t){switch(e){case`focusin`:case`focusout`:hp=null;break;case`dragenter`:case`dragleave`:gp=null;break;case`mouseover`:case`mouseout`:_p=null;break;case`pointerover`:case`pointerout`:vp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:yp.delete(t.pointerId)}}function Cp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=it(t),t!==null&&ip(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function wp(e,t,n,r,i){switch(t){case`focusin`:return hp=Cp(hp,e,t,n,r,i),!0;case`dragenter`:return gp=Cp(gp,e,t,n,r,i),!0;case`mouseover`:return _p=Cp(_p,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return vp.set(a,Cp(vp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,yp.set(a,Cp(yp.get(a)||null,e,t,n,r,i)),!0}return!1}function Tp(e){var t=rt(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,qe(e.priority,function(){ap(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,qe(e.priority,function(){ap(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ep(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=up(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ht=r,n.target.dispatchEvent(r),Ht=null}else return t=it(n),t!==null&&ip(t),e.blockedOn=n,!1;t.shift()}return!0}function Dp(e,t,n){Ep(e)&&n.delete(t)}function Op(){mp=!1,hp!==null&&Ep(hp)&&(hp=null),gp!==null&&Ep(gp)&&(gp=null),_p!==null&&Ep(_p)&&(_p=null),vp.forEach(Dp),yp.forEach(Dp)}function kp(e,t){e.blockedOn===t&&(e.blockedOn=null,mp||(mp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Op)))}var Ap=null;function jp(e){Ap!==e&&(Ap=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ap===e&&(Ap=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(fp(r||n)===null)continue;break}var a=it(n);a!==null&&(e.splice(t,3),t-=3,ps(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Mp(e){function t(t){return kp(t,e)}hp!==null&&kp(hp,e),gp!==null&&kp(gp,e),_p!==null&&kp(_p,e),vp.forEach(t),yp.forEach(t);for(var n=0;n<bp.length;n++){var r=bp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<bp.length&&(n=bp[0],n.blockedOn===null);)Tp(n),n.blockedOn===null&&bp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Xe]||null;if(typeof a==`function`)o||jp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Xe]||null)s=o.formAction;else if(fp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),jp(n)}}}function Np(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Pp(e){this._internalRoot=e}Fp.prototype.render=Pp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;tp(n,lu(),e,t,null,null)},Fp.prototype.unmount=Pp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;tp(e.current,2,null,e,null,null),gu(),t[Ze]=null}};function Fp(e){this._internalRoot=e}Fp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ke();e={blockedOn:null,target:e,priority:t};for(var n=0;n<bp.length&&t!==0&&t<bp[n].priority;n++);bp.splice(n,0,e),n===0&&Tp(e)}};var Ip=r.version;if(Ip!==`19.2.8`)throw Error(o(527,Ip,`19.2.8`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Lp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Rp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rp.isDisabled&&Rp.supportsFiber)try{we=Rp.inject(Lp),Te=Rp}catch{}}t.createRoot=function(e,t){if(!s(e))throw Error(o(299));var n=!1,r=``,i=Is,a=Ls,c=Rs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=$f(e,1,!1,null,null,n,r,null,i,a,c,Np),e[Ze]=t.current,bd(e),new Pp(t)}})),Sm=r(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=xm()})),Cm={};function wm(e,t){!e&&!Cm[t]&&(Cm[t]=!0,console.warn(t))}var Tm=[`HydrateFallback`,`hydrateFallbackElement`],Em=class{status=`pending`;promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Dm({router:e,flushSync:t,onError:n,useTransitions:r}){r=mn()||r;let[i,a]=Z.useState(e.state),[o,s]=(0,Z.useOptimistic)(i),[c,l]=Z.useState(),[u,d]=Z.useState({isTransitioning:!1}),[f,p]=Z.useState(),[m,h]=Z.useState(),[g,_]=Z.useState(),v=Z.useRef(new Map),y=Z.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Ut(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),wm(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(wm(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):Z.startTransition(()=>{r===!0&&s(e=>Om(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);Z.useLayoutEffect(()=>e.subscribe(y),[e,y]),Z.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Em)},[u]),Z.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):Z.startTransition(()=>{r===!0&&s(e=>Om(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),Z.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),Z.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=Z.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=Z.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return Z.createElement(Z.Fragment,null,Z.createElement(Le.Provider,{value:S},Z.createElement(Ve.Provider,{value:o},Z.createElement(fe.Provider,{value:v.current},Z.createElement(Zt.Provider,{value:u},Z.createElement(Mm,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},Z.createElement(km,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Om(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var km=Z.memo(Am);function Am({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return R(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function jm(e){return Ee(e.context)}function Mm({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:s}){Wn(!te(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let c=e.replace(/^\/*/,`/`),l=Z.useMemo(()=>({basename:c,navigator:i,static:a,useTransitions:s,future:{}}),[c,i,a,s]);typeof n==`string`&&(n=Qe(n));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=Z.useMemo(()=>{let e=bt(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,mask:h},navigationType:r}},[c,u,d,f,p,m,r,h]);return Vn(g!=null,`<Router basename="${c}"> is not able to match the URL "${u}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:Z.createElement(dt.Provider,{value:l},Z.createElement(o.Provider,{children:t,value:g}))}Z.Component;var Nm=`application/x-www-form-urlencoded`;function Pm(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Fm(e){return Pm(e)&&e.tagName.toLowerCase()===`button`}function Im(e){return Pm(e)&&e.tagName.toLowerCase()===`form`}function Lm(e){return Pm(e)&&e.tagName.toLowerCase()===`input`}function Rm(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zm(e,t){return e.button===0&&(!t||t===`_self`)&&!Rm(e)}var Bm=null;function Vm(){if(Bm===null)try{new FormData(document.createElement(`form`),0),Bm=!1}catch{Bm=!0}return Bm}var Hm=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Um(e){return e!=null&&!Hm.has(e)?(Vn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nm}"`),null):e}function Wm(e,t){let n,r,i,a,o;if(Im(e)){let o=e.getAttribute(`action`);r=o?bt(o,t):null,n=e.getAttribute(`method`)||`get`,i=Um(e.getAttribute(`enctype`))||Nm,a=new FormData(e)}else if(Fm(e)||Lm(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?bt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=Um(e.getAttribute(`formenctype`))||Um(o.getAttribute(`enctype`))||Nm,a=new FormData(o,e),!Vm()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Pm(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=Nm,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function Gm(e,t){if(e===!1||e==null)throw Error(t)}var Km={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},qm=/[&><\u2028\u2029]/g;function Jm(e){return e.replace(qm,e=>Km[e])}function Ym(e,t){let n=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n.pathname.endsWith(`/`)?n.pathname=`${n.pathname}_.${t}`:n.pathname=`${n.pathname}.${t}`,n}async function Xm(e,t){if(e.id in t)return t[e.id];try{let n=await a(()=>import(e.module),[],import.meta.url);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Zm(e){return e!=null&&typeof e.page==`string`}function Qm(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function $m(e,t,n){return ih((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Xm(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Qm).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function eh(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function th(e,t,{includeHydrateFallback:n}={}){return nh(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function nh(e){return[...new Set(e)]}function rh(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ih(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Zm(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(rh(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ah(){let e=Z.useContext(Le);return Gm(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function oh(){let e=Z.useContext(Ve);return Gm(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var sh=Z.createContext(void 0);sh.displayName=`FrameworkContext`;function ch(){let e=Z.useContext(sh);return Gm(e,`You must render this element inside a <HydratedRouter> element`),e}function lh(e,t){let n=Z.useContext(sh),[r,i]=Z.useState(!1),[a,o]=Z.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=Z.useRef(null);Z.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),Z.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:uh(s,p),onBlur:uh(c,m),onMouseEnter:uh(l,p),onMouseLeave:uh(u,m),onTouchStart:uh(d,p)}]:[a,f,{}]:[!1,f,{}]}function uh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dh({page:e,...t}){let n=mn(),{nonce:r}=ch(),{router:i}=ah(),a=Z.useMemo(()=>gt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?Z.createElement(ph,{page:e,matches:a,...t}):Z.createElement(mh,{page:e,matches:a,...t})):null}function fh(e){let{manifest:t,routeModules:n}=ch(),[r,i]=Z.useState([]);return Z.useEffect(()=>{let r=!1;return $m(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function ph({page:e,matches:t,...n}){let r=Gn(),i=Z.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ym(e,`rsc`),i=!1,a=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?i=!0:a.push(e.route.id);return i&&a.length>0&&n.searchParams.set(`_routes`,a.join(`,`)),[n.pathname+n.search]},[e,r,t]);return Z.createElement(Z.Fragment,null,i.map(e=>Z.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function mh({page:e,matches:t,...n}){let r=Gn(),{manifest:i,routeModules:a}=ch(),{loaderData:o,matches:s}=oh(),c=Z.useMemo(()=>eh(e,t,s,i,r,`data`),[e,t,s,i,r]),l=Z.useMemo(()=>eh(e,t,s,i,r,`assets`),[e,t,s,i,r]),u=Z.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,s=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];!t||!t.hasLoader||(!c.some(t=>t.route.id===e.route.id)&&e.route.id in o&&a[e.route.id]?.shouldRevalidate||t.hasClientLoader?s=!0:n.add(e.route.id))}),n.size===0)return[];let l=Ym(e,`data`);return s&&n.size>0&&l.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[l.pathname+l.search]},[o,r,i,c,t,e,a]),d=Z.useMemo(()=>th(l,i),[l,i]),f=fh(l);return Z.createElement(Z.Fragment,null,u.map(e=>Z.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),d.map(e=>Z.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),f.map(({key:e,link:t})=>Z.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function hh(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var gh=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{gh&&(window.__reactRouterVersion=`8.2.0`)}catch{}function _h(e,t){return At({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:Ge({window:t?.window}),hydrationData:t?.hydrationData||vh(),routes:e,mapRouteProperties:yn,hydrationRouteProperties:Tm,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function vh(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:yh(e.errors)}),e}function yh(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Xe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&nn.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function bh({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=Z.useState({action:n.action,location:n.location}),o=Z.useCallback(e=>{r===!1?a(e):Z.startTransition(()=>a(e))},[r]);return Z.useLayoutEffect(()=>n.listen(o),[n,o]),Z.createElement(Mm,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}bh.displayName=`unstable_HistoryRouter`;var xh=Z.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=Z.useContext(dt),v=typeof l==`string`&&Se.test(l),y=on(l,h);l=y.to;let b=P(l,{relative:r}),x=Gn(),S=null;if(o){let e=Tt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:kn([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=lh(n,p),E=Oh(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=Z.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:hh(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?Z.createElement(Z.Fragment,null,k,Z.createElement(dh,{page:b})):k});xh.displayName=`Link`;var Sh=Z.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=D(a,{relative:c.relative}),d=Gn(),f=Z.useContext(Ve),{navigator:p,basename:m}=Z.useContext(dt),h=f!=null&&Rh(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=bt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return Z.createElement(xh,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Sh.displayName=`NavLink`;var Ch=Z.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=Z.useContext(dt),g=jh(),_=Mh(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Se.test(s);return Z.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?Z.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ch.displayName=`Form`;function wh({getKey:e,storageKey:t,...n}){let r=Z.useContext(sh),{basename:i}=Z.useContext(dt),a=Gn(),o=d();Ih({getKey:e,storageKey:t});let s=Z.useMemo(()=>{if(!r||!e)return null;let t=Fh(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),Z.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Jm(JSON.stringify(t||Nh))}, ${Jm(JSON.stringify(s))})`}})}wh.displayName=`ScrollRestoration`;function Th(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Eh(e){let t=Z.useContext(Le);return Wn(t,Th(e)),t}function Dh(e){let t=Z.useContext(Ve);return Wn(t,Th(e)),t}function Oh(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Ae(),d=Gn(),f=D(e,{relative:o});return Z.useCallback(p=>{if(zm(p,t)){p.preventDefault();let t=n===void 0?Nn(d)===Nn(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?Z.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var kh=0,Ah=()=>`__${String(++kh)}__`;function jh(){let{router:e}=Eh(`useSubmit`),{basename:t}=Z.useContext(dt),n=sn(),r=e.fetch,i=e.navigate;return Z.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Wm(e,t);a.navigate===!1?await r(a.fetcherKey||Ah(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Mh(e,{relative:t}={}){let{basename:n}=Z.useContext(dt),r=Z.useContext(wn);Wn(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...D(e||`.`,{relative:t})},o=Gn();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:kn([n,a.pathname])),Nn(a)}var Nh=`react-router-scroll-positions`,Ph={};function Fh(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:bt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ih({getKey:e,storageKey:t}={}){let{router:n}=Eh(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Dh(`useScrollRestoration`),{basename:a}=Z.useContext(dt),o=Gn(),s=d(),c=A();Z.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Lh(Z.useCallback(()=>{if(c.state===`idle`){let t=Fh(o,s,a,e);Ph[t]=window.scrollY}try{sessionStorage.setItem(t||Nh,JSON.stringify(Ph))}catch(e){Vn(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(Z.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Nh);e&&(Ph=JSON.parse(e))}catch{}},[t]),Z.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ph,()=>window.scrollY,e?(t,n)=>Fh(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),Z.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Vn(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Lh(e,t){let{capture:n}=t||{};Z.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Rh(e,{relative:t}={}){let n=Z.useContext(Zt);Wn(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Eh(`useViewTransitionState`),i=D(e,{relative:t});if(!n.isTransitioning)return!1;let a=bt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=bt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ct(i.pathname,o)!=null||ct(i.pathname,a)!=null}var zh=Sm();function Bh(){return(0,Q.jsxs)(om,{collapsible:`offcanvas`,variant:`inset`,children:[(0,Q.jsx)(lm,{children:(0,Q.jsxs)(`div`,{className:`flex h-8 items-center justify-between gap-2 px-2`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-semibold`,children:`Zukhruf Devtool`}),(0,Q.jsx)(sm,{"aria-label":`Collapse sidebar`,title:`Collapse sidebar`})]})}),(0,Q.jsxs)(um,{children:[(0,Q.jsx)(Hh,{}),(0,Q.jsx)(Uh,{})]})]})}function Vh({iconOnly:e=!1}){let t=Ae(),n=()=>{t(`/chat?chatId=${encodeURIComponent(crypto.randomUUID())}`)};return e?(0,Q.jsx)(Ct,{"aria-label":`New chat`,className:`size-7`,size:`icon`,title:`New chat`,type:`button`,variant:`ghost`,onClick:n,children:(0,Q.jsx)(Xr,{className:`size-4`})}):(0,Q.jsx)(hm,{children:(0,Q.jsxs)(_m,{onClick:n,tooltip:`New chat`,children:[(0,Q.jsx)(Xr,{}),(0,Q.jsx)(`span`,{children:`New Chat`})]})})}function Hh(){let{discovery:e}=he();return(0,Q.jsx)(`nav`,{"aria-label":`Devtool views`,children:(0,Q.jsx)(dm,{children:(0,Q.jsx)(pm,{children:(0,Q.jsxs)(mm,{children:[(0,Q.jsx)(Vh,{}),(0,Q.jsx)(hm,{children:(0,Q.jsxs)(_m,{render:(0,Q.jsx)(Sh,{to:`/history`}),children:[(0,Q.jsx)(Wr,{}),(0,Q.jsx)(`span`,{children:`History`})]})}),e?.capabilities.schedules?(0,Q.jsx)(hm,{children:(0,Q.jsxs)(_m,{render:(0,Q.jsx)(Sh,{to:`/scheduled/tasks`}),children:[(0,Q.jsx)(Er,{}),(0,Q.jsx)(`span`,{children:`Scheduled`})]})}):null]})})})})}function Uh(){let e=Ae(),{discovery:t,history:n,historyError:r}=he(),i=Wh(d().at(-1)?.loaderData),a=(0,Z.useCallback)(t=>{e(rt(`/chat/:sessionId`,{sessionId:t.chatId}))},[e]);return(0,Q.jsxs)(dm,{children:[(0,Q.jsxs)(fm,{children:[(0,Q.jsx)(`span`,{children:`Runs`}),(0,Q.jsx)(`span`,{className:`ml-auto font-mono`,children:n.length})]}),(0,Q.jsx)(pm,{children:(0,Q.jsx)(Ke.Root,{activeChatId:i,onSelect:a,children:r&&n.length===0?(0,Q.jsx)(Ke.Empty,{children:`Runs unavailable`}):n.length===0?(0,Q.jsx)(Ke.Empty,{children:`No conversations yet`}):n.map(e=>{let n=i===e.chatId;return(0,Q.jsxs)(Ke.Item,{className:J(`hover:bg-accent flex items-center rounded-lg transition-colors`,n&&`bg-accent`),children:[(0,Q.jsxs)(Ke.ItemTrigger,{history:e,className:`min-w-0 flex-1 hover:bg-transparent`,children:[(0,Q.jsx)(un,{chatId:e.chatId,status:e.status}),(0,Q.jsx)(`span`,{className:`text-foreground truncate`,title:e.title??e.chatId,children:e.title??e.chatId})]}),t?.capabilities.traces?(0,Q.jsx)(Sh,{"aria-label":`View traces for ${e.title??e.chatId}`,title:`View traces`,to:rt(`/history/:userId/:chatId/traces`,{chatId:e.chatId,userId:e.userId}),className:({isActive:e})=>J(`text-muted-foreground hover:text-foreground focus-visible:ring-ring inline-flex size-8 shrink-0 items-center justify-center rounded-lg focus-visible:ring-2 focus-visible:outline-none`,e&&`text-foreground`),children:(0,Q.jsx)(Ir,{"aria-hidden":`true`,className:`size-3.5`})}):null]},`${e.userId}:${e.chatId}`)})})})]})}function Wh(e){if(typeof e!=`object`||!e)return;let t=`conversation`in e?e.conversation:void 0;return typeof t==`object`&&t&&`chatId`in t&&typeof t.chatId==`string`?t.chatId:`chatId`in e&&typeof e.chatId==`string`?e.chatId:void 0}function Gh({request:e}){return bn(e.signal)}function Kh(){let e=document.cookie.split(`; `).find(e=>e.startsWith(`${vm}=`));return!e||e.split(`=`)[1]===`true`}function qh(){let[e]=(0,Z.useState)(Kh),{discovery:t,history:n}=he(),{revalidate:r}=H(),i=(0,Z.useCallback)(e=>{if(e.type===`ready`){r(),Jt.invalidateQueries({queryKey:[`schedules`]});return}if(e.resource===`schedule-task`||e.resource===`schedule-run`){Jt.invalidateQueries({predicate:({queryKey:t})=>t[0]===`schedules`&&(e.resource===`schedule-task`?t[1]===`tasks`:t[1]!==`tasks`)});return}Tn(e)&&(e.child||(e.status.type!==`active`||!n.some(({chatId:t})=>t===e.id))&&r())},[n,r]);return(0,Q.jsx)(Qt,{href:t?.capabilities.events.href,onEvent:i,history:n,children:(0,Q.jsxs)(am,{defaultOpen:e,className:`h-screen min-h-0`,style:{"--sidebar-width":`18rem`},children:[(0,Q.jsx)(Bh,{}),(0,Q.jsxs)(cm,{className:`min-h-0`,children:[(0,Q.jsx)(Jh,{}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:(0,Q.jsx)(jm,{})})]})]})})}function Jh(){let{isMobile:e,state:t}=im();return(0,Q.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-1 px-2`,children:[e||t===`collapsed`?(0,Q.jsx)(sm,{"aria-label":`Open sidebar`,title:`Open sidebar`}):null,t===`collapsed`?(0,Q.jsx)(Vh,{iconOnly:!0}):null]})}async function Yh({params:e,request:t}){let n=await bn(t.signal);return{...n,conversation:n.history.find(({chatId:t,userId:n})=>t===e.chatId&&n===e.userId)??n.history[0]}}function Xh(){let{conversation:e}=he();return e?(0,Q.jsx)(Zh,{conversation:e}):null}function Zh({conversation:e}){let t=it(e.chatId,e.status);return(0,Q.jsxs)(`div`,{className:`max-w-2xl p-8`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-6 border-b pb-5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground mb-1 text-xs font-medium`,children:`Conversation`}),(0,Q.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight`,children:e.title??e.chatId})]}),(0,Q.jsx)(hn,{status:$e(t)})]}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[7rem_1fr] gap-x-5 gap-y-3 py-5 text-sm`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`User`}),(0,Q.jsx)(`dd`,{className:`font-mono text-xs`,children:e.userId}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Chat`}),(0,Q.jsx)(`dd`,{className:`truncate font-mono text-xs`,children:e.chatId}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Messages`}),(0,Q.jsx)(`dd`,{children:e.messageCount}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Updated`}),(0,Q.jsx)(`dd`,{children:zt(e.updatedAt)})]}),(0,Q.jsx)(Et,{treeId:e.chatId,snapshot:e.children})]})}var Qh=t(r(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`cronstrue`,[],r):typeof e==`object`?e.cronstrue=r():n.cronstrue=r()})(globalThis,()=>(()=>{var e={949(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CronParser=void 0;var r=n(515);t.CronParser=function(){function e(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.expression=e,this.dayOfWeekStartIndexZero=t,this.monthStartIndexZero=n}return e.prototype.parse=function(){var e,t=this.expression??``;if(t===`@reboot`)return e=[`@reboot`,``,``,``,``,``,``],e;if(t.startsWith(`@`)){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.parseSpecial=function(e){var t={"@yearly":`0 0 1 1 *`,"@annually":`0 0 1 1 *`,"@monthly":`0 0 1 * *`,"@weekly":`0 0 * * 0`,"@daily":`0 0 * * *`,"@midnight":`0 0 * * *`,"@hourly":`0 * * * *`,"@reboot":`@reboot`}[e];if(!t)throw Error(`Unknown special expression.`);return t},e.prototype.extractParts=function(e){if(!this.expression)throw Error(`cron expression is empty`);for(var t=e.trim().split(/[ ]+/),n=0;n<t.length;n++)if(t[n].includes(`,`)){var r=t[n].split(`,`).map(function(e){return e.trim()}).filter(function(e){return e!==``}).map(function(e){return isNaN(Number(e))?e:Number(e)}).filter(function(e){return e!==null&&e!==``});r.length===0&&r.push(`*`),r.sort(function(e,t){return e!==null&&t!==null?e-t:0}),t[n]=r.map(function(e){return e===null?``:e.toString()}).join(`,`)}if(t.length<5)throw Error(`Expression has only ${t.length} part${t.length==1?``:`s`}. At least 5 parts are required.`);if(t.length==5)t.unshift(``),t.push(``);else if(t.length==6)/\d{4}$/.test(t[5])||t[4]==`?`||t[2]==`?`?t.unshift(``):t.push(``);else if(t.length>7)throw Error(`Expression has ${t.length} parts; too many!`);return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace(`?`,`*`),e[5]=e[5].replace(`?`,`*`),e[2]=e[2].replace(`?`,`*`),e[0].indexOf(`0/`)==0&&(e[0]=e[0].replace(`0/`,`*/`)),e[1].indexOf(`0/`)==0&&(e[1]=e[1].replace(`0/`,`*/`)),e[2].indexOf(`0/`)==0&&(e[2]=e[2].replace(`0/`,`*/`)),e[3].indexOf(`1/`)==0&&(e[3]=e[3].replace(`1/`,`*/`)),e[4].indexOf(`1/`)==0&&(e[4]=e[4].replace(`1/`,`*/`)),e[6].indexOf(`1/`)==0&&(e[6]=e[6].replace(`1/`,`*/`)),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,function(e){var n=e.replace(/\D/,``),r=n;return t.dayOfWeekStartIndexZero?n==`7`&&(r=`0`):r=(parseInt(n)-1).toString(),e.replace(n,r)}),e[5]==`L`&&(e[5]=`6`),e[3]==`?`&&(e[3]=`*`),e[3].indexOf(`W`)>-1&&(e[3].indexOf(`,`)>-1||e[3].indexOf(`-`)>-1))throw Error(`The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.`);var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in n)e[5]=e[5].replace(new RegExp(r,`gi`),n[r].toString());e[4]=e[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(e){var n=e.replace(/\D/,``),r=n;return t.monthStartIndexZero&&(r=(parseInt(n)+1).toString()),e.replace(n,r)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)e[4]=e[4].replace(new RegExp(a,`gi`),i[a].toString());e[0]==`0`&&(e[0]=``),!/\*|\-|\,|\//.test(e[2])&&(/\*|\//.test(e[1])||/\*|\//.test(e[0]))&&(e[2]+=`-${e[2]}`);for(var o=0;o<e.length;o++)if(e[o].indexOf(`,`)!=-1&&(e[o]=e[o].split(`,`).filter(function(e){return e!==``}).join(`,`)||`*`),e[o]==`*/1`&&(e[o]=`*`),e[o].indexOf(`/`)>-1&&!/^\*|\-|\,/.test(e[o])){var s=null;switch(o){case 4:s=`12`;break;case 5:s=`6`;break;case 6:s=`9999`;break;default:s=null;break}if(s!==null){var c=e[o].split(`/`);e[o]=`${c[0]}-${s}/${c[1]}`}}},e.prototype.validate=function(e){var t=`0-9,\\-*/`;this.validateOnlyExpectedCharactersFound(e[0],t),this.validateOnlyExpectedCharactersFound(e[1],t),this.validateOnlyExpectedCharactersFound(e[2],t),this.validateOnlyExpectedCharactersFound(e[3],`0-9,\\-*/LW`),this.validateOnlyExpectedCharactersFound(e[4],t),this.validateOnlyExpectedCharactersFound(e[5],`0-9,\\-*/L#`),this.validateOnlyExpectedCharactersFound(e[6],t),this.validateAnyRanges(e)},e.prototype.validateAnyRanges=function(e){r.default.secondRange(e[0]),r.default.minuteRange(e[1]),r.default.hourRange(e[2]),r.default.dayOfMonthRange(e[3]),r.default.monthRange(e[4],this.monthStartIndexZero),r.default.dayOfWeekRange(e[5],this.dayOfWeekStartIndexZero)},e.prototype.validateOnlyExpectedCharactersFound=function(e,t){var n=e.match(RegExp(`[^${t}]+`,`gi`));if(n&&n.length)throw Error(`Expression contains invalid values: '${n.toString()}'`)},e}()},333(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionDescriptor=void 0;var r=n(823),i=n(949);t.ExpressionDescriptor=function(){function e(t,n){if(this.expression=t,this.options=n,this.expressionParts=[,,,,,],!this.options.locale&&e.defaultLocale&&(this.options.locale=e.defaultLocale),!e.locales[this.options.locale]){var r=Object.keys(e.locales)[0];console.warn(`Locale '${this.options.locale}' could not be found; falling back to '${r}'.`),this.options.locale=r}this.i18n=e.locales[this.options.locale],n.use24HourTimeFormat===void 0&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return e.toString=function(t,n){var r=n===void 0?{}:n,i=r.throwExceptionOnParseError,a=i===void 0||i,o=r.verbose,s=o!==void 0&&o,c=r.dayOfWeekStartIndexZero,l=c===void 0||c,u=r.monthStartIndexZero,d=u!==void 0&&u,f=r.use24HourTimeFormat,p=r.trimHoursLeadingZero,m=p!==void 0&&p,h=r.locale,g=h===void 0?null:h,_=r.logicalAndDayFields,v={throwExceptionOnParseError:a,verbose:s,dayOfWeekStartIndexZero:l,monthStartIndexZero:d,use24HourTimeFormat:f,trimHoursLeadingZero:m,locale:g,logicalAndDayFields:_!==void 0&&_};return v.tzOffset&&console.warn(`'tzOffset' option has been deprecated and is no longer supported.`),new e(t,v).getFullDescription()},e.initialize=function(t,n){n===void 0&&(n=`en`),e.specialCharacters=[`/`,`-`,`,`,`*`],e.defaultLocale=n,t.load(e.locales)},e.prototype.getFullDescription=function(){var e,t=``;try{var n=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=n.parse(),this.expressionParts[0]===`@reboot`)return(e=this.i18n).atReboot?.call(e)||`Run once, at startup`;var r=this.getTimeOfDayDescription(),a=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),c=this.getYearDescription();t+=r+a+s+o+c,t=this.transformVerbosity(t,!!this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(e){if(!this.options.throwExceptionOnParseError)t=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw`${e}`}return t},e.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],a=``;if(!r.StringUtilities.containsAny(n,e.specialCharacters)&&!r.StringUtilities.containsAny(i,e.specialCharacters)&&!r.StringUtilities.containsAny(t,e.specialCharacters))a+=this.i18n.atSpace()+this.formatTime(i,n,t);else if(!t&&n.indexOf(`-`)>-1&&!(n.indexOf(`,`)>-1)&&!(n.indexOf(`/`)>-1)&&!r.StringUtilities.containsAny(i,e.specialCharacters)){var o=n.split(`-`);a+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(i,o[0],``),this.formatTime(i,o[1],``))}else if(!t&&i.indexOf(`,`)>-1&&i.indexOf(`-`)==-1&&i.indexOf(`/`)==-1&&!r.StringUtilities.containsAny(n,e.specialCharacters)){var s=i.split(`,`);a+=this.i18n.at();for(var c=0;c<s.length;c++)a&&(a+=` `),a+=this.formatTime(s[c],n,``),c<s.length-2&&(a+=`,`),c==s.length-2&&(a+=this.i18n.spaceAnd())}else{var l=this.getSecondsDescription(),u=this.getMinutesDescription(),d=this.getHoursDescription();if(a+=l,a&&u&&(a+=`, `),a+=u,u===d)return a;a&&d&&(a+=`, `),a+=d}return a},e.prototype.getSecondsDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Seconds(t),t)},function(t){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(t){return t==`0`?``:parseInt(t)<20?e.i18n.atX0SecondsPastTheMinute(t):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(t)})},e.prototype.getMinutesDescription=function(){var e=this,t=this.expressionParts[0],n=this.expressionParts[2];return this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Minutes(t),t)},function(t){return e.i18n.minutesX0ThroughX1PastTheHour()},function(r){var i;try{return r==`0`&&n.indexOf(`/`)==-1&&t==``?e.i18n.everyHour():r==`0`?(i=e.i18n).onTheHour?.call(i)||e.i18n.atX0MinutesPastTheHour(r):parseInt(r)<20?e.i18n.atX0MinutesPastTheHour(r):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(r)}catch{return e.i18n.atX0MinutesPastTheHour(r)}})},e.prototype.getHoursDescription=function(){var e=this,t=this.expressionParts[2],n=0,i=[];t.split(`/`)[0].split(`,`).forEach(function(e){var t=e.split(`-`);t.length===2&&i.push({value:t[1],index:n+1}),n+=t.length});var a=0;return this.getSegmentDescription(t,this.i18n.everyHour(),function(t){var n=i.find(function(e){return e.value===t&&e.index===a})&&e.expressionParts[1]!==`0`;return a++,n?e.formatTime(t,`59`,``):e.formatTime(t,`0`,``)},function(t){return r.StringUtilities.format(e.i18n.everyX0Hours(t),t)},function(t){return e.i18n.betweenX0AndX1()},function(t){return e.i18n.atX0()})},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n=this.expressionParts[5]==`*`?``:this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,r){var i=n;n.indexOf(`#`)>-1?i=n.substring(0,n.indexOf(`#`)):n.indexOf(`L`)>-1&&(i=i.replace(`L`,``));var a=parseInt(i),o=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(r)[a]:t[a];if(n.indexOf(`#`)>-1){var s=null,c=n.substring(n.indexOf(`#`)+1),l=n.substring(0,n.indexOf(`#`));switch(c){case`1`:s=e.i18n.first(l);break;case`2`:s=e.i18n.second(l);break;case`3`:s=e.i18n.third(l);break;case`4`:s=e.i18n.fourth(l);break;case`5`:s=e.i18n.fifth(l);break}o=s+` `+o}return o},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(t),t)},function(t){var n=t.substring(0,t.indexOf(`-`));return e.expressionParts[3]==`*`?e.i18n.commaX0ThroughX1(n):e.i18n.commaAndX0ThroughX1(n)},function(t){var n=null;if(t.indexOf(`#`)>-1){var r=t.substring(t.indexOf(`#`)+1),i=t.substring(0,t.indexOf(`#`));n=e.i18n.commaOnThe(r,i).trim()+e.i18n.spaceX0OfTheMonth()}else n=t.indexOf(`L`)>-1?e.i18n.commaOnTheLastX0OfTheMonth(t.replace(`L`,``)):e.expressionParts[3]==`*`||e.options.logicalAndDayFields?e.i18n.commaOnlyOnX0(t):e.i18n.commaAndOnX0();return n}),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear();return this.getSegmentDescription(this.expressionParts[4],``,function(n,r){return r&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(r)[parseInt(n)-1]:t[parseInt(n)-1]},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0Months(t),t)},function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()})},e.prototype.getDayOfMonthDescription=function(){var e=this,t=null,n=this.expressionParts[3];switch(n){case`L`:t=this.i18n.commaOnTheLastDayOfTheMonth();break;case`WL`:case`LW`:t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var a=parseInt(i[0].replace(`W`,``)),o=a==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),a.toString());t=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}else{var s=n.match(/L-(\d{1,2})/);if(s){var c=s[1];t=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(c),c);break}else if(n==`*`&&this.expressionParts[5]!=`*`)return``;else t=this.getSegmentDescription(n,this.i18n.commaEveryDay(),function(t){return t==`L`?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),t):t},function(t){return t==`1`?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(t)},function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(t)},function(t){return e.i18n.commaOnDayX0OfTheMonth(t)});break}}return t},e.prototype.getYearDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[6],``,function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e},function(t){return r.StringUtilities.format(e.i18n.commaEveryX0Years(t),t)},function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()})},e.prototype.getSegmentDescription=function(e,t,n,i,a,o){var s=null,c=e.indexOf(`/`)>-1,l=e.indexOf(`-`)>-1,u=e.indexOf(`,`)>-1;if(!e)s=``;else if(e===`*`)s=t;else if(!c&&!l&&!u)s=r.StringUtilities.format(o(e),n(e));else if(u){for(var d=e.split(`,`),f=``,p=this.i18n.spaceAnd(),m=0;m<d.length;m++)if(m>0&&d.length>2&&(f+=`,`,m<d.length-1&&(f+=` `)),m>0&&d.length>1&&(m==d.length-1||d.length==2)&&(f+=p==`,`&&d.length>2?` `:`${p} `),d[m].indexOf(`/`)>-1||d[m].indexOf(`-`)>-1){var h=d[m].indexOf(`-`)>-1&&d[m].indexOf(`/`)==-1,g=this.getSegmentDescription(d[m],t,n,i,h?this.i18n.commaX0ThroughX1:a,o);h&&(g=g.replace(`, `,``)),f+=g}else if(!c)f+=n(d[m]);else{var _=this.getSegmentDescription(d[m],t,n,i,a,o);_&&_.startsWith(`, `)&&(_=_.substring(2)),f+=_}s=c?f:r.StringUtilities.format(o(e),f)}else if(c){var d=e.split(`/`);if(s=r.StringUtilities.format(i(d[1]),d[1]),d[0].indexOf(`-`)>-1){var v=this.generateRangeSegmentDescription(d[0],a,n);v.indexOf(`, `)!=0&&(s+=`, `),s+=v}else if(d[0].indexOf(`*`)==-1){var y=r.StringUtilities.format(o(d[0]),n(d[0]));y=y.replace(`, `,``),s+=r.StringUtilities.format(this.i18n.commaStartingX0(),y)}}else l&&(s=this.generateRangeSegmentDescription(e,a,n));return s},e.prototype.generateRangeSegmentDescription=function(e,t,n){var i=``,a=e.split(`-`),o=n(a[0],1),s=n(a[1],2),c=t(e);return i+=r.StringUtilities.format(c,o,s),i},e.prototype.formatTime=function(e,t,n){var r=0,i=0,a=parseInt(e)+r,o=parseInt(t)+i;o>=60?(o-=60,a+=1):o<0&&(o+=60,--a),a>=24?a-=24:a<0&&(a=24+a);var s=``,c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),s=c?`${this.getPeriod(a)} `:` ${this.getPeriod(a)}`,a>12&&(a-=12),a===0&&(a=12));var l=``;n&&(l=`:${(`00`+n).substring(n.length)}`);var u=a.toString(),d=(`00`+u).substring(u.length),f=o.toString(),p=(`00`+f).substring(f.length),m=this.options.trimHoursLeadingZero?u:d;return`${c?s:``}${m}:${p}${l}${c?``:s}`},e.prototype.transformVerbosity=function(e,t){if(!t&&(e=e.replace(RegExp(`, ${this.i18n.everyMinute()}`,`g`),``),e=e.replace(RegExp(`, ${this.i18n.everyHour()}`,`g`),``),e=e.replace(new RegExp(this.i18n.commaEveryDay(),`g`),``),e=e.replace(/\, ?$/,``),this.i18n.conciseVerbosityReplacements))for(var n=0,r=Object.entries(this.i18n.conciseVerbosityReplacements());n<r.length;n++){var i=r[n],a=i[0],o=i[1];e=e.replace(new RegExp(a,`g`),o)}return e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||`PM`:this.i18n.am&&this.i18n.am()||`AM`},e.locales={},e}()},747(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.enLocaleLoader=void 0;var r=n(486);t.enLocaleLoader=function(){function e(){}return e.prototype.load=function(e){e.en=new r.en},e}()},486(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0,t.en=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return`An error occurred when generating the expression description. Check the cron expression syntax.`},e.prototype.everyMinute=function(){return`every minute`},e.prototype.everyHour=function(){return`every hour`},e.prototype.atSpace=function(){return`At `},e.prototype.everyMinuteBetweenX0AndX1=function(){return`Every minute between %s and %s`},e.prototype.at=function(){return`At`},e.prototype.spaceAnd=function(){return` and`},e.prototype.everySecond=function(){return`every second`},e.prototype.everyX0Seconds=function(){return`every %s seconds`},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return`seconds %s through %s past the minute`},e.prototype.atX0SecondsPastTheMinute=function(){return`at %s seconds past the minute`},e.prototype.everyX0Minutes=function(){return`every %s minutes`},e.prototype.minutesX0ThroughX1PastTheHour=function(){return`minutes %s through %s past the hour`},e.prototype.atX0MinutesPastTheHour=function(){return`at %s minutes past the hour`},e.prototype.everyX0Hours=function(){return`every %s hours`},e.prototype.betweenX0AndX1=function(){return`between %s and %s`},e.prototype.atX0=function(){return`at %s`},e.prototype.commaEveryDay=function(){return`, every day`},e.prototype.commaEveryX0DaysOfTheWeek=function(){return`, every %s days of the week`},e.prototype.commaX0ThroughX1=function(){return`, %s through %s`},e.prototype.commaAndX0ThroughX1=function(){return`, %s through %s`},e.prototype.first=function(){return`first`},e.prototype.second=function(){return`second`},e.prototype.third=function(){return`third`},e.prototype.fourth=function(){return`fourth`},e.prototype.fifth=function(){return`fifth`},e.prototype.commaOnThe=function(){return`, on the `},e.prototype.spaceX0OfTheMonth=function(){return` %s of the month`},e.prototype.lastDay=function(){return`the last day`},e.prototype.commaOnTheLastX0OfTheMonth=function(){return`, on the last %s of the month`},e.prototype.commaOnlyOnX0=function(){return`, only on %s`},e.prototype.commaAndOnX0=function(){return`, and on %s`},e.prototype.commaEveryX0Months=function(){return`, every %s months`},e.prototype.commaOnlyInX0=function(){return`, only in %s`},e.prototype.commaOnTheLastDayOfTheMonth=function(){return`, on the last day of the month`},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return`, on the last weekday of the month`},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return`, %s days before the last day of the month`},e.prototype.firstWeekday=function(){return`first weekday`},e.prototype.weekdayNearestDayX0=function(){return`weekday nearest day %s`},e.prototype.commaOnTheX0OfTheMonth=function(){return`, on the %s of the month`},e.prototype.commaEveryX0Days=function(){return`, every %s days in a month`},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return`, between day %s and %s of the month`},e.prototype.commaOnDayX0OfTheMonth=function(){return`, on day %s of the month`},e.prototype.commaEveryHour=function(){return`, every hour`},e.prototype.commaEveryX0Years=function(){return`, every %s years`},e.prototype.commaStartingX0=function(){return`, starting %s`},e.prototype.daysOfTheWeek=function(){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},e.prototype.monthsOfTheYear=function(){return[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},e.prototype.atReboot=function(){return`Run once, at startup`},e.prototype.onTheHour=function(){return`on the hour`},e}()},515(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){if(!e)throw Error(t)}t.default=function(){function e(){}return e.secondRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`seconds part must be >= 0 and <= 59`)}},e.minuteRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`minutes part must be >= 0 and <= 59`)}},e.hourRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=23,`hours part must be >= 0 and <= 23`)}},e.dayOfMonthRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=1&&i<=31,`DOM part must be >= 1 and <= 31`)}},e.monthRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=1&&a<=12,t?`month part must be >= 0 and <= 11`:`month part must be >= 1 and <= 12`)}},e.dayOfWeekRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=0&&a<=6,t?`DOW part must be >= 0 and <= 6`:`DOW part must be >= 1 and <= 7`)}},e}()},823(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtilities=void 0,t.StringUtilities=function(){function e(){}return e.format=function(e){var t=[...arguments].slice(1);return e.replace(/%s/g,function(e){return t.shift()})},e.containsAny=function(e,t){return t.some(function(t){return e.indexOf(t)>-1})},e}()}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0;var t=n(333),i=n(747);t.ExpressionDescriptor.initialize(new i.enLocaleLoader),e.default=t.ExpressionDescriptor,e.toString=t.ExpressionDescriptor.toString})(),r})())}))(),1),$h=An(`kind`,[Ce({kind:Rn(`new-conversation`)}),Ce({kind:Rn(`existing-conversation`),chatId:Ft()})]),eg=Ce({id:Ft(),name:Ft(),prompt:Ft(),recurrence:Ft(),timezone:Ft(),target:$h,status:ft([`active`,`paused`,`completed`,`archived`]),nextRunAt:Pn().nullable(),createdAt:Pn(),updatedAt:Pn(),archivedAt:Pn().nullable()}),tg=Ce({id:Ft(),taskId:Ft(),trigger:ft([`scheduled`,`manual`]),occurrenceAt:Pn(),prompt:Ft(),target:$h,status:ft([`dispatching`,`running`,`completed`,`failed`,`cancelled`]),reviewStatus:ft([`pending_review`,`reviewed`,`archived`]).nullable(),conversation:Ce({chatId:Ft(),turnId:Ft()}).nullable(),startedAt:Pn().nullable(),finishedAt:Pn().nullable(),error:Ft().nullable(),createdAt:Pn(),updatedAt:Pn()}),ng=Ce({error:Ft()});function rg(e){return yr({queryKey:[`schedules`,`tasks`,e],queryFn:e?({signal:t})=>lg(`${e}/tasks`,{signal:t},xt(eg)):Wt})}function ig(e){return yr({queryKey:[`schedules`,`inbox`,e],queryFn:e?({signal:t})=>lg(`${e}/runs/inbox`,{signal:t},xt(tg)):Wt})}function ag(e,t){return yr({queryKey:[`schedules`,`task-runs`,e,t],queryFn:e&&t?({signal:n})=>lg(`${e}/tasks/${t}/runs`,{signal:n},xt(tg)):Wt})}function og(e,t){return yr({queryKey:[`schedules`,`run`,e,t],queryFn:e&&t?({signal:n})=>lg(`${e}/runs/${t}`,{signal:n},tg):Wt})}function sg(e){return br({mutationFn:async t=>{if(!e)throw Error(`Scheduled tasks are unavailable`);return cg(e,t)},onSettled:()=>Jt.invalidateQueries({queryKey:[`schedules`]})})}async function cg(e,t){switch(t.kind){case`create`:return ug(`${e}/tasks`,{body:t.definition,idempotencyKey:t.idempotencyKey,method:`POST`},eg);case`update`:return ug(`${e}/tasks/${t.taskId}`,{body:t.definition,method:`PATCH`},eg);case`pause`:case`resume`:case`archive`:return ug(`${e}/tasks/${t.taskId}/${t.kind}`,{method:`POST`},eg);case`run`:return ug(`${e}/tasks/${t.taskId}/run`,{idempotencyKey:t.idempotencyKey,method:`POST`},tg);case`purge`:await dg(`${e}/tasks/${t.taskId}`,{method:`DELETE`});return;case`cancel`:case`review`:return ug(`${e}/runs/${t.runId}/${t.kind}`,{method:`POST`},tg)}}async function lg(e,t,n){let r=await fetch(e,t);if(!r.ok)throw await fg(r);return n.parse(await r.json())}async function ug(e,t,n){let r=await dg(e,t);return n.parse(await r.json())}async function dg(e,t){let n=new Headers;t.body&&n.set(`content-type`,`application/json`),t.idempotencyKey&&n.set(`idempotency-key`,t.idempotencyKey);let r=await fetch(e,{body:t.body?JSON.stringify(t.body):void 0,headers:n,method:t.method});if(!r.ok)throw await fg(r);return r}async function fg(e){let t=ng.safeParse(await e.json().catch(()=>void 0));return Error(t.success?t.data.error:`Request failed: ${e.status}`)}var pg=[`all`,`active`,`paused`,`completed`,`archived`];async function mg({request:e}){let t=await bn(e.signal);return{...t,conversation:t.history[0]}}function hg(){let e=he().discovery?.capabilities.schedules?.href;return e?(0,Q.jsx)(gg,{href:e}):null}function gg({href:e}){let{runId:t,taskId:n}=Pe(),r=Gn().pathname.startsWith(`/scheduled/review`),[i,a]=(0,Z.useState)(`all`),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(!1),u=rg(e),d=ig(e),f=sg(e),p=u.data??[],h=d.data??[],g=p.filter(e=>i===`all`||e.status===i).filter(e=>Gg(e.name,o)),_=h.filter(e=>Gg(zg(p,e.taskId),o)),v=u.isError||d.isError;return(0,Q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-col border-r`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 px-4 pt-3 pb-2`,children:[(0,Q.jsxs)(wg,{active:r,to:`/scheduled/review`,children:[`Needs review`,h.length>0?(0,Q.jsx)(ve,{className:`ml-1.5`,variant:`secondary`,children:h.length}):null]}),(0,Q.jsx)(`span`,{className:`bg-border mx-1 h-4 w-px`}),pg.map(e=>(0,Q.jsx)(wg,{active:!r&&i===e,to:`/scheduled/tasks`,onClick:()=>a(e),children:qg(e)},e)),(0,Q.jsxs)(Ct,{className:`ml-auto shrink-0`,size:`sm`,onClick:()=>l(!0),children:[`Create `,(0,Q.jsx)(ee,{})]})]}),(0,Q.jsx)(`div`,{className:`px-4 pb-2`,children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(Kr,{className:`text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2`}),(0,Q.jsx)(Ql,{className:`rounded-full pl-9`,placeholder:r?`Search runs`:`Search scheduled tasks`,value:o,onChange:e=>s(e.target.value)})]})}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto px-2 pb-6`,children:v?(0,Q.jsx)(`p`,{className:`text-muted-foreground px-2 py-6 text-sm`,children:`Scheduled tasks unavailable.`}):(r?d:u).isPending?(0,Q.jsx)(Pg,{}):r?_.length===0?(0,Q.jsx)(Fg,{}):_.map(e=>(0,Q.jsx)(Cg,{to:`/scheduled/review/${e.id}`,selected:t===e.id,icon:(0,Q.jsx)(Mg,{status:e.status}),title:zg(p,e.taskId),subtitle:`${qg(e.status)} · ${Jg(e.finishedAt??e.occurrenceAt)}`},e.id)):g.length===0?(0,Q.jsx)(Ig,{onCreate:()=>l(!0)}):g.map(e=>(0,Q.jsx)(Cg,{to:`/scheduled/tasks/${e.id}`,selected:n===e.id,icon:(0,Q.jsx)(jg,{status:e.status}),title:e.name,subtitle:Bg(e)},e.id))})]}),(0,Q.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[f.isError?(0,Q.jsx)(`div`,{className:`px-6 pt-4`,children:(0,Q.jsxs)(m,{variant:`destructive`,children:[(0,Q.jsx)(N,{children:`Action failed`}),(0,Q.jsx)(Ne,{children:f.error.message})]})}):null,t?(0,Q.jsx)(vg,{href:e,runId:t,command:f}):n?(0,Q.jsx)(_g,{href:e,taskId:n,tasks:p,command:f}):(0,Q.jsx)(`p`,{className:`text-muted-foreground p-8 text-sm`,children:r?`Select a run.`:`Select a scheduled task.`})]}),(0,Q.jsx)(bg,{open:c,command:f,onClose:()=>l(!1)})]})}function _g({href:e,taskId:t,tasks:n,command:r}){let i=Ae(),{history:a}=he(),o=ag(e,t),s=n.find(({id:e})=>e===t);if(!s)return(0,Q.jsx)(`p`,{className:`text-muted-foreground p-8 text-sm`,children:`This scheduled task is no longer available.`});let c=Ug(s.recurrence),l=s.status===`archived`,u=a.map(e=>({value:e.chatId,label:e.title??e.chatId})),d=e=>r.mutate({kind:`update`,taskId:t,definition:e});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto px-6 pt-4 pb-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(Ag,{status:s.status}),(0,Q.jsx)(yg,{task:s,command:r,onPurged:()=>void i(`/scheduled/tasks`)}),(0,Q.jsx)(Ct,{className:`size-8 rounded-full`,size:`icon`,variant:`ghost`,"aria-label":s.status===`paused`?`Resume task`:`Pause task`,disabled:l||s.status===`completed`,onClick:()=>r.mutate({kind:s.status===`paused`?`resume`:`pause`,taskId:t}),children:s.status===`paused`?(0,Q.jsx)(Hr,{}):(0,Q.jsx)(Br,{})}),(0,Q.jsx)(Ct,{className:`size-8`,size:`icon`,variant:`ghost`,"aria-label":`Close`,onClick:()=>void i(`/scheduled/tasks`),children:(0,Q.jsx)(p,{})})]}),(0,Q.jsx)(`h2`,{className:`mt-1 mb-5 text-2xl`,children:s.name}),(0,Q.jsx)(Sg,{"aria-label":`Prompt`,disabled:l,value:s.prompt,onCommit:e=>d({prompt:e})}),(0,Q.jsx)(Eg,{children:`Details`}),(0,Q.jsxs)(Tg,{children:[(0,Q.jsx)(Dg,{label:`Name`,children:(0,Q.jsx)(xg,{"aria-label":`Name`,disabled:l,value:s.name,onCommit:e=>d({name:e})})}),(0,Q.jsx)(Dg,{label:`Runs in`,children:(0,Q.jsxs)(Ap,{items:Og,disabled:l,value:s.target.kind,onValueChange:e=>{let[t]=a;d({target:e===`new-conversation`||!t?{kind:`new-conversation`}:{kind:`existing-conversation`,chatId:t.chatId}})},children:[(0,Q.jsx)(kg,{"aria-label":`Runs in`,children:(0,Q.jsx)(Mp,{})}),(0,Q.jsx)(Pp,{children:(0,Q.jsx)(jp,{children:Og.map(e=>(0,Q.jsx)(Fp,{value:e.value,disabled:e.value===`existing-conversation`&&a.length===0,children:e.label},e.value))})})]})}),s.target.kind===`existing-conversation`?(0,Q.jsx)(Dg,{label:`Chat`,children:(0,Q.jsxs)(Ap,{items:u,disabled:l,value:s.target.chatId,onValueChange:e=>{e!==null&&d({target:{kind:`existing-conversation`,chatId:e}})},children:[(0,Q.jsx)(kg,{"aria-label":`Chat`,children:(0,Q.jsx)(Mp,{})}),(0,Q.jsx)(Pp,{children:(0,Q.jsx)(jp,{children:u.map(e=>(0,Q.jsx)(Fp,{value:e.value,children:e.label},e.value))})})]})}):null]}),(0,Q.jsx)(Eg,{children:`Frequency`}),(0,Q.jsxs)(Tg,{children:[(0,Q.jsx)(Dg,{label:`Repeat`,children:c?(0,Q.jsx)(xg,{"aria-label":`Cron expression`,className:`w-52 text-right font-mono`,disabled:l,value:s.recurrence,onCommit:e=>d({recurrence:e})}):(0,Q.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:s.recurrence.split(`
11
+ `).at(-1)})}),(0,Q.jsx)(Dg,{label:`Reads as`,children:(0,Q.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:Hg(s.recurrence)})}),(0,Q.jsx)(Dg,{label:`Timezone`,children:(0,Q.jsx)(xg,{"aria-label":`Timezone`,className:`w-52 text-right`,disabled:l,value:s.timezone,onCommit:e=>d({timezone:e})})}),(0,Q.jsx)(Dg,{label:`Next run`,children:(0,Q.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:s.nextRunAt?Jg(s.nextRunAt):`—`})})]}),(0,Q.jsxs)(`div`,{className:`mt-8 mb-2 flex items-center`,children:[(0,Q.jsx)(Eg,{className:`mt-0 mb-0`,children:`Previous runs`}),(0,Q.jsx)(`span`,{className:`text-muted-foreground ml-auto text-xs`,children:o.data?.length??0})]}),o.isPending?(0,Q.jsx)(Gp,{className:`h-10 w-full`}):o.isError?(0,Q.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`Previous runs unavailable.`}):o.data.length?(0,Q.jsx)(`ul`,{children:o.data.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsxs)(Sh,{to:`/scheduled/tasks/${t}/runs/${e.id}`,className:`hover:bg-accent flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left`,children:[(0,Q.jsx)(Pr,{className:`text-muted-foreground size-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-sm`,children:s.name}),(0,Q.jsx)(Mg,{status:e.status}),e.reviewStatus===`pending_review`?(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full bg-sky-500`,title:`Pending review`}):null,(0,Q.jsx)(`span`,{className:`text-muted-foreground w-16 text-right text-xs`,children:Xg(e.finishedAt??e.occurrenceAt)})]})},e.id))}):(0,Q.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No runs yet.`})]}),(0,Q.jsx)(`div`,{className:`flex justify-end border-t px-6 py-3`,children:(0,Q.jsxs)(Ct,{variant:`outline`,disabled:s.target.kind!==`existing-conversation`,onClick:()=>{s.target.kind===`existing-conversation`&&i(`/chat/${encodeURIComponent(s.target.chatId)}`)},children:[`Open chat `,(0,Q.jsx)(Mr,{})]})})]})}function vg({href:e,runId:t,command:n}){let r=Ae(),{taskId:i}=Pe(),a=rg(e),o=og(e,t),s=i?`/scheduled/tasks/${i}`:`/scheduled/review`;if(o.isPending)return(0,Q.jsx)(Ng,{});if(o.isError||!o.data)return(0,Q.jsx)(`p`,{className:`text-muted-foreground p-8 text-sm`,children:`This run is no longer available.`});let c=o.data,l=Wg(c.status);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto px-6 pt-4 pb-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(Ag,{status:c.status}),(0,Q.jsxs)(hp,{children:[(0,Q.jsx)(gp,{render:(0,Q.jsx)(Ct,{className:`ml-auto size-8`,size:`icon`,variant:`ghost`,"aria-label":`Run actions`,children:(0,Q.jsx)(Ar,{})})}),(0,Q.jsxs)(_p,{align:`end`,children:[(0,Q.jsxs)(vp,{disabled:l,onClick:()=>n.mutate({kind:`cancel`,runId:t}),children:[(0,Q.jsx)(Be,{}),` Cancel run`]}),(0,Q.jsxs)(vp,{disabled:c.reviewStatus!==`pending_review`,onClick:()=>n.mutate({kind:`review`,runId:t}),children:[(0,Q.jsx)(ln,{}),` Mark reviewed`]})]})]}),(0,Q.jsx)(Ct,{className:`size-8`,size:`icon`,variant:`ghost`,"aria-label":`Close`,onClick:()=>void r(s),children:(0,Q.jsx)(p,{})})]}),(0,Q.jsx)(`h2`,{className:`mt-1 mb-5 text-2xl`,children:zg(a.data??[],c.taskId)}),(0,Q.jsx)(`div`,{className:`bg-muted/40 text-muted-foreground rounded-xl px-4 py-3 text-base`,children:c.prompt}),(0,Q.jsx)(Eg,{children:`Details`}),(0,Q.jsxs)(Tg,{children:[(0,Q.jsx)(Dg,{label:`Trigger`,children:c.trigger}),(0,Q.jsx)(Dg,{label:`Occurrence`,children:Yg(c.occurrenceAt)}),(0,Q.jsx)(Dg,{label:`Started`,children:c.startedAt?Yg(c.startedAt):`—`}),(0,Q.jsx)(Dg,{label:`Finished`,children:c.finishedAt?Yg(c.finishedAt):`—`}),(0,Q.jsx)(Dg,{label:`Review`,children:Vg(c.reviewStatus)})]}),(0,Q.jsx)(Eg,{children:`Conversation`}),(0,Q.jsxs)(Tg,{children:[(0,Q.jsx)(Dg,{label:`Runs in`,children:c.target.kind===`new-conversation`?`New chat`:`Existing chat`}),(0,Q.jsx)(Dg,{label:`Chat`,children:(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:c.conversation?Kg(c.conversation.chatId):`—`})}),(0,Q.jsx)(Dg,{label:`Turn`,children:(0,Q.jsx)(`span`,{className:`font-mono text-xs`,children:c.conversation?Kg(c.conversation.turnId):`—`})})]}),c.error?(0,Q.jsxs)(m,{className:`mt-6`,variant:`destructive`,children:[(0,Q.jsx)(N,{children:`Run failed`}),(0,Q.jsx)(Ne,{children:c.error})]}):null,c.conversation?null:(0,Q.jsx)(`p`,{className:`text-muted-foreground mt-6 text-sm`,children:`Cancelled before dispatch, so no conversation exists.`})]}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2 border-t px-6 py-3`,children:[c.reviewStatus===`pending_review`?(0,Q.jsxs)(Ct,{variant:`ghost`,onClick:()=>n.mutate({kind:`review`,runId:t}),children:[(0,Q.jsx)(ln,{}),` Mark reviewed`]}):null,(0,Q.jsxs)(Ct,{variant:`outline`,disabled:!c.conversation,onClick:()=>{c.conversation&&r(`/chat/${encodeURIComponent(c.conversation.chatId)}`)},children:[`Open chat `,(0,Q.jsx)(Mr,{})]})]})]})}function yg({task:e,command:t,onPurged:n}){let r=e.status===`archived`,[i,a]=(0,Z.useState)(()=>crypto.randomUUID());return(0,Q.jsxs)(hp,{children:[(0,Q.jsx)(gp,{render:(0,Q.jsx)(Ct,{className:`ml-auto size-8`,size:`icon`,variant:`ghost`,"aria-label":`Task actions`,children:(0,Q.jsx)(Ar,{})})}),(0,Q.jsxs)(_p,{align:`end`,children:[(0,Q.jsxs)(vp,{disabled:r,onClick:()=>t.mutate({kind:`run`,taskId:e.id,idempotencyKey:i},{onSuccess:()=>a(crypto.randomUUID())}),children:[(0,Q.jsx)(Hr,{}),` Run now`]}),(0,Q.jsx)(yp,{}),(0,Q.jsxs)(vp,{disabled:r,onClick:()=>t.mutate({kind:`archive`,taskId:e.id}),children:[(0,Q.jsx)(Sr,{}),` Archive`]}),(0,Q.jsxs)(vp,{disabled:!r,onClick:()=>t.mutate({kind:`purge`,taskId:e.id},{onSuccess:n}),children:[(0,Q.jsx)(Me,{className:`text-destructive`}),(0,Q.jsx)(`span`,{className:`text-destructive`,children:`Delete`})]})]})]})}function bg({open:e,command:t,onClose:n}){let r=Ae(),{history:i}=he(),[a,o]=(0,Z.useState)(()=>Lg(Rg())),s=a.definition,c=[{value:`new-conversation`,label:`New chat for every run`},...i.map(e=>({value:e.chatId,label:e.title??e.chatId}))],l=e=>o(t=>Lg({...t.definition,...e}));return(0,Q.jsx)(cp,{open:e,onOpenChange:e=>{e||(o(Lg(Rg())),n())},children:(0,Q.jsxs)(dp,{className:`sm:max-w-xl`,children:[(0,Q.jsx)(fp,{children:(0,Q.jsx)(mp,{children:`New scheduled task`})}),(0,Q.jsxs)(`div`,{className:`grid gap-4`,children:[(0,Q.jsxs)(Dp,{children:[(0,Q.jsx)(Op,{htmlFor:`schedule-name`,children:`Name`}),(0,Q.jsx)(Ql,{id:`schedule-name`,value:s.name,onChange:e=>l({name:e.target.value})})]}),(0,Q.jsxs)(Dp,{children:[(0,Q.jsx)(Op,{htmlFor:`schedule-prompt`,children:`Prompt`}),(0,Q.jsx)(ce,{id:`schedule-prompt`,rows:3,value:s.prompt,onChange:e=>l({prompt:e.target.value})})]}),(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,Q.jsxs)(Dp,{children:[(0,Q.jsx)(Op,{htmlFor:`schedule-cron`,children:`Repeat`}),(0,Q.jsx)(Ql,{id:`schedule-cron`,className:`font-mono`,value:s.recurrence,onChange:e=>l({recurrence:e.target.value})}),(0,Q.jsx)(kp,{children:Hg(s.recurrence)})]}),(0,Q.jsxs)(Dp,{children:[(0,Q.jsx)(Op,{htmlFor:`schedule-timezone`,children:`Timezone`}),(0,Q.jsx)(Ql,{id:`schedule-timezone`,value:s.timezone,onChange:e=>l({timezone:e.target.value})}),(0,Q.jsx)(kp,{children:`IANA identifier.`})]})]}),(0,Q.jsxs)(Dp,{children:[(0,Q.jsx)(Op,{htmlFor:`schedule-target`,children:`Runs in`}),(0,Q.jsxs)(Ap,{id:`schedule-target`,items:c,value:s.target.kind===`new-conversation`?`new-conversation`:s.target.chatId,onValueChange:e=>{e!==null&&l({target:e===`new-conversation`?{kind:`new-conversation`}:{kind:`existing-conversation`,chatId:e}})},children:[(0,Q.jsx)(Np,{className:`w-full`,children:(0,Q.jsx)(Mp,{})}),(0,Q.jsx)(Pp,{children:(0,Q.jsx)(jp,{children:c.map(e=>(0,Q.jsx)(Fp,{value:e.value,children:e.label},e.value))})})]})]})]}),(0,Q.jsxs)(pp,{children:[(0,Q.jsx)(Ct,{variant:`ghost`,onClick:n,children:`Cancel`}),(0,Q.jsx)(Ct,{disabled:!s.name.trim()||!s.prompt.trim(),onClick:()=>t.mutate({kind:`create`,definition:s,idempotencyKey:a.idempotencyKey},{onSuccess:e=>{o(Lg(Rg())),n(),e&&`status`in e&&r(`/scheduled/tasks/${e.id}`)}}),children:`Create`})]})]})})}function xg({value:e,onCommit:t,className:n,...r}){let[i,a]=(0,Z.useState)(e),[o,s]=(0,Z.useState)(!1);return(0,Q.jsx)(Ql,{...r,className:J(`h-8 border-0 bg-transparent shadow-none`,n),value:o?i:e,onChange:e=>a(e.target.value),onFocus:()=>{a(e),s(!0)},onBlur:()=>{s(!1),i.trim()&&i!==e&&t(i.trim())}})}function Sg({value:e,onCommit:t,...n}){let[r,i]=(0,Z.useState)(e),[a,o]=(0,Z.useState)(!1);return(0,Q.jsx)(ce,{...n,className:`bg-muted/40 min-h-24 rounded-xl border-0 text-base`,value:a?r:e,onChange:e=>i(e.target.value),onFocus:()=>{i(e),o(!0)},onBlur:()=>{o(!1),r.trim()&&r!==e&&t(r.trim())}})}function Cg({to:e,selected:t,icon:n,title:r,subtitle:i}){return(0,Q.jsxs)(Sh,{to:e,"aria-current":t?`true`:void 0,className:J(`hover:bg-accent/60 flex w-full items-start gap-3 rounded-xl px-3 py-2.5 text-left`,t&&`bg-accent hover:bg-accent`),children:[(0,Q.jsx)(`span`,{className:`mt-0.5`,children:n}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block truncate text-sm`,children:r}),(0,Q.jsx)(`span`,{className:`text-muted-foreground block truncate text-xs`,children:i})]})]})}function wg({active:e,to:t,onClick:n,children:r}){return(0,Q.jsx)(Sh,{to:t,onClick:n,className:J(vt({size:`sm`,variant:`ghost`}),`text-muted-foreground hover:text-foreground shrink-0 rounded-full px-2.5 font-normal`,e&&`text-foreground font-medium`),children:r})}function Tg({children:e}){return(0,Q.jsx)(`div`,{className:`bg-muted/40 divide-border/60 divide-y rounded-xl`,children:e})}function Eg({className:e,children:t}){return(0,Q.jsx)(`p`,{className:J(`text-muted-foreground mt-6 mb-2 text-sm`,e),children:t})}function Dg({label:e,children:t}){return(0,Q.jsxs)(`div`,{className:`flex min-h-11 items-center justify-between gap-4 px-4 py-1`,children:[(0,Q.jsx)(`span`,{className:`shrink-0 text-sm`,children:e}),(0,Q.jsx)(`span`,{className:`flex min-w-0 items-center justify-end text-sm`,children:t})]})}var Og=[{value:`new-conversation`,label:`New chat`},{value:`existing-conversation`,label:`Existing chat`}];function kg(e){return(0,Q.jsx)(Np,{...e,className:`w-auto border-0 bg-transparent shadow-none dark:bg-transparent`})}function Ag({status:e}){return(0,Q.jsx)(`span`,{className:J(`text-sm`,e===`active`||e===`completed`?`text-emerald-700`:e===`failed`?`text-destructive`:e===`running`||e===`dispatching`?`text-sky-700`:`text-muted-foreground`),children:qg(e)})}function jg({status:e}){return e===`paused`?(0,Q.jsx)(Br,{className:`size-4 shrink-0 text-amber-600`}):e===`archived`?(0,Q.jsx)(Sr,{className:`text-muted-foreground size-4 shrink-0`}):(0,Q.jsx)(Oe,{className:J(`size-4 shrink-0`,e===`active`?`text-muted-foreground`:`text-muted-foreground/50`)})}function Mg({status:e}){return(0,Q.jsx)(Oe,{className:J(`size-4 shrink-0`,e===`completed`?`text-emerald-600`:e===`failed`?`text-destructive`:e===`cancelled`?`text-muted-foreground`:`text-sky-600`)})}function Ng(){return(0,Q.jsxs)(`div`,{className:`space-y-4 p-6`,children:[(0,Q.jsx)(Gp,{className:`h-7 w-48`}),(0,Q.jsx)(Gp,{className:`h-24 w-full rounded-xl`}),(0,Q.jsx)(Gp,{className:`h-24 w-full rounded-xl`})]})}function Pg(){return(0,Q.jsx)(`div`,{className:`grid gap-2 px-1 py-2`,children:[0,1,2,3].map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 px-2 py-2`,children:[(0,Q.jsx)(Gp,{className:`mt-0.5 size-4 rounded-full`}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,Q.jsx)(Gp,{className:`h-4 w-40`}),(0,Q.jsx)(Gp,{className:`h-3 w-56`})]})]},e))})}function Fg(){return(0,Q.jsx)(bp,{className:`mt-10`,children:(0,Q.jsxs)(xp,{children:[(0,Q.jsx)(Cp,{variant:`icon`,children:(0,Q.jsx)(ln,{})}),(0,Q.jsx)(wp,{children:`Nothing to review`}),(0,Q.jsx)(Tp,{children:`Finished runs wait here until you mark them reviewed.`})]})})}function Ig({onCreate:e}){return(0,Q.jsxs)(bp,{className:`mt-10`,children:[(0,Q.jsxs)(xp,{children:[(0,Q.jsx)(Cp,{variant:`icon`,children:(0,Q.jsx)(Er,{})}),(0,Q.jsx)(wp,{children:`No scheduled tasks`}),(0,Q.jsx)(Tp,{children:`Create one with a five-field cron expression and a timezone.`})]}),(0,Q.jsx)(Ct,{size:`sm`,onClick:e,children:`Create`})]})}function Lg(e){return{definition:e,idempotencyKey:crypto.randomUUID()}}function Rg(){return{name:``,prompt:``,recurrence:`0 9 * * 1`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,target:{kind:`new-conversation`}}}function zg(e,t){return e.find(({id:e})=>e===t)?.name??`Purged task`}function Bg(e){let t=Hg(e.recurrence);return e.status===`archived`?`${t} · Archived`:e.status===`paused`?`${t} · Paused`:e.nextRunAt?`${t} · Next run ${Jg(e.nextRunAt)}`:`${t} · No further runs`}function Vg(e){return e===`pending_review`?`Pending review`:e===`reviewed`?`Reviewed`:e===`archived`?`Archived`:`Not reviewable yet`}function Hg(e){if(!Ug(e))return e.split(`
12
+ `).at(-1)?.replace(`RRULE:`,``)??e;try{return Qh.default.toString(e,{verbose:!1})}catch{return`Invalid cron expression`}}function Ug(e){return!e.includes(`DTSTART`)}function Wg(e){return e===`completed`||e===`failed`||e===`cancelled`}function Gg(e,t){return e.toLowerCase().includes(t.trim().toLowerCase())}function Kg(e){return e.slice(0,8)}function qg(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Jg(e){let t=e-Date.now(),n=new Intl.RelativeTimeFormat(void 0,{numeric:`auto`});for(let[e,r]of[[`day`,864e5],[`hour`,36e5],[`minute`,6e4]])if(Math.abs(t)>=r)return n.format(Math.round(t/r),e);return n.format(Math.round(t/6e4),`minute`)}function Yg(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Xg(e){let t=Date.now()-e;return t>=2592e6?`${Math.round(t/2592e6)}mo`:t>=864e5?`${Math.round(t/864e5)}d`:t>=36e5?`${Math.round(t/36e5)}h`:`${Math.max(1,Math.round(t/6e4))}m`}var Zg=ft([`recorded`,`not-recorded`]),Qg=ft([`running`,`completed`,`failed`,`cancelled`]),$g=Ce({id:Ft(),startedAt:Ft().nullable(),endedAt:Ft().nullable(),status:ft([`queued`,`running`,`completed`,`failed`,`cancelled`])}),e_=ye({id:Ft(),parentId:Ft().nullable(),startedAt:Ft(),endedAt:Ft().nullable(),status:Qg,type:Ft(),name:Ft(),input:jt().optional(),output:jt().optional(),usage:jt().optional(),error:jt().optional(),data:v(Ft(),jt())}),t_=$g.extend({recording:Ce({inputs:Zg,outputs:Zg}),spans:xt(e_)});function n_({conversation:e,href:t,traceId:n,onTraceId:r}){let[i,a]=(0,Z.useState)([]),[o,s]=(0,Z.useState)(),[c,l]=(0,Z.useState)(),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!0);(0,Z.useEffect)(()=>{let i=new AbortController,o=async()=>{try{let o=await fetch(u_(t,e),{signal:i.signal});if(!o.ok)throw Error(`Trace request failed: ${o.status}`);let s=xt($g).parse(await o.json());a(s),d(!1),p(!1),s.length>0&&!s.some(({id:e})=>e===n)&&r(s[0].id,!0)}catch{i.signal.aborted||(d(!0),p(!1))}};o();let s=window.setInterval(()=>void o(),3e3);return()=>{i.abort(),window.clearInterval(s)}},[e,t,r,n]),(0,Z.useEffect)(()=>{if(!n)return;let r=new AbortController,i=async()=>{try{let i=await fetch(d_(t,e,n),{signal:r.signal});if(!i.ok)throw Error(`Trace detail failed: ${i.status}`);let a=t_.parse(await i.json());s(a),l(e=>a.spans.some(({id:t})=>t===e)?e:a.spans[0]?.id),d(!1)}catch{r.signal.aborted||d(!0)}};i();let a=window.setInterval(()=>void i(),3e3);return()=>{r.abort(),window.clearInterval(a)}},[e,t,n]);let m=o?.id===n?o:void 0,h=i.map((e,t)=>({value:e.id,label:`${t===0?`Latest · `:``}${e.startedAt?zt(e.startedAt):`Starting`} · ${f_(e)} · ${h_(e.status)}`})),g=m?.spans.find(({id:e})=>e===c);return(0,Q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[auto_auto_minmax(0,1fr)]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-6 border-b px-6 py-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-base font-semibold tracking-tight`,children:e.title??e.chatId}),(0,Q.jsxs)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:[`Traces · `,i.length,` `,i.length===1?`turn`:`turns`]})]}),(0,Q.jsx)(hn,{status:m?.status??$e(e.status)})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-6 py-3`,children:[(0,Q.jsx)(`label`,{htmlFor:`trace-selector`,className:`text-muted-foreground text-xs font-medium`,children:`Trace`}),(0,Q.jsxs)(Ap,{id:`trace-selector`,items:h,value:n??null,disabled:i.length===0,onValueChange:e=>{e!==null&&r(e,!1)},children:[(0,Q.jsx)(Np,{className:`max-w-xl min-w-0 flex-1 font-mono text-xs`,children:(0,Q.jsx)(Mp,{})}),(0,Q.jsx)(Pp,{children:(0,Q.jsx)(jp,{children:h.map(e=>(0,Q.jsx)(Fp,{value:e.value,className:`font-mono text-xs`,children:e.label},e.value))})})]})]}),f?(0,Q.jsx)(s_,{icon:(0,Q.jsx)(M,{className:`size-4 animate-spin`}),children:`Loading traces`}):u?(0,Q.jsx)(s_,{icon:(0,Q.jsx)(Ie,{className:`text-destructive size-4`}),children:`Traces unavailable`}):i.length===0?(0,Q.jsx)(s_,{icon:(0,Q.jsx)(B,{className:`size-4`}),children:`No traces recorded for this conversation yet`}):m&&m.spans.length>0?(0,Q.jsxs)(`div`,{className:`grid min-h-0 grid-cols-[minmax(32rem,1fr)_22rem]`,children:[(0,Q.jsx)(r_,{trace:m,selectedSpanId:c,onSelectSpan:l}),(0,Q.jsx)(i_,{trace:m,span:g},g?.id)]}):m?(0,Q.jsx)(s_,{icon:(0,Q.jsx)(M,{className:`size-4 animate-spin`}),children:`Trace starting`}):(0,Q.jsx)(s_,{icon:(0,Q.jsx)(M,{className:`size-4 animate-spin`}),children:`Loading trace`})]})}function r_({trace:e,selectedSpanId:t,onSelectSpan:n}){let r=Math.min(...e.spans.map(({startedAt:e})=>Date.parse(e))),i=Math.max(r+1,...e.spans.map(({endedAt:t})=>Date.parse(t??e.startedAt??e.spans[0].startedAt))),a=i-r,o=(0,Z.useMemo)(()=>l_(e.spans),[e.spans]);return(0,Q.jsx)(`section`,{className:`min-h-0 overflow-auto`,"aria-label":`Trace waterfall`,children:(0,Q.jsxs)(`div`,{className:`min-w-[46rem]`,children:[(0,Q.jsxs)(`div`,{className:`text-muted-foreground bg-background sticky top-0 z-10 grid grid-cols-[16rem_minmax(30rem,1fr)] border-b text-[0.6875rem]`,children:[(0,Q.jsx)(`span`,{className:`px-4 py-2 font-medium`,children:`SPAN`}),(0,Q.jsx)(`div`,{className:`relative mr-5 h-8 font-mono`,children:Array.from({length:5},(e,t)=>(0,Q.jsx)(`span`,{className:`absolute top-2 -translate-x-1/2`,style:{left:`${t*25}%`},children:m_(a*t/4)},t))})]}),e.spans.map(e=>{let s=Date.parse(e.startedAt),c=e.endedAt?Date.parse(e.endedAt):Math.max(s,i),l=(s-r)/a*100,u=Math.max((c-s)/a*100,.8),d=t===e.id;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":d,onClick:()=>n(e.id),className:J(`hover:bg-muted/60 grid w-full grid-cols-[16rem_minmax(30rem,1fr)] border-b text-left transition-colors`,d&&`bg-muted`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 px-4 py-3 text-xs`,style:{paddingLeft:`${16+(o.get(e.id)??0)*18}px`},children:[c_(e),(0,Q.jsxs)(`span`,{className:`truncate`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground capitalize`,children:e.type}),` `,`· `,e.name]})]}),(0,Q.jsx)(`span`,{className:`relative my-3 mr-5 h-4`,children:(0,Q.jsx)(`span`,{className:J(`bg-foreground/75 absolute top-1 h-2 rounded-sm`,e.status===`running`&&`trace-running`,e.status===`failed`&&`bg-destructive`),style:{left:`${l}%`,width:`${u}%`}})})]},e.id)})]})})}function i_({trace:e,span:t}){let[n,r]=(0,Z.useState)(`overview`);return t?(0,Q.jsxs)(`aside`,{className:`bg-background grid min-h-0 grid-rows-[auto_auto_minmax(0,1fr)] border-l`,children:[(0,Q.jsxs)(`div`,{className:`border-b p-5`,children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground mb-1 text-[0.6875rem] font-semibold tracking-[0.12em] uppercase`,children:t.type}),(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:t.name}),(0,Q.jsx)(`p`,{className:`text-muted-foreground mt-1 font-mono text-xs`,children:p_(t)})]}),(0,Q.jsx)(`div`,{className:`flex gap-1 border-b px-3 pt-2`,role:`tablist`,children:[`overview`,`input`,`output`,`raw`].map(e=>(0,Q.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":n===e,onClick:()=>r(e),className:J(`text-muted-foreground border-b-2 border-transparent px-2 py-2 text-xs capitalize`,n===e&&`text-foreground border-foreground`),children:e},e))}),(0,Q.jsx)(`div`,{className:`min-h-0 overflow-auto p-5 text-xs`,children:n===`overview`?(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[5.5rem_1fr] gap-x-3 gap-y-3`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Status`}),(0,Q.jsx)(`dd`,{className:`capitalize`,children:t.status}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Started`}),(0,Q.jsx)(`dd`,{children:zt(t.startedAt)}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Duration`}),(0,Q.jsx)(`dd`,{children:p_(t)}),t.usage===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Usage`}),(0,Q.jsx)(`dd`,{className:`font-mono`,children:g_(t.usage)})]}),t.error===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-destructive`,children:`Error`}),(0,Q.jsx)(`dd`,{className:`text-destructive break-words`,children:g_(t.error)})]})]}):n===`raw`?(0,Q.jsx)(o_,{value:t}):(0,Q.jsx)(a_,{state:n===`input`?e.recording.inputs:e.recording.outputs,value:n===`input`?t.input:t.output,kind:n})})]}):(0,Q.jsx)(`aside`,{className:`text-muted-foreground border-l p-5 text-sm`,children:`Select a span to inspect it.`})}function a_({state:e,value:t,kind:n}){return e===`not-recorded`?(0,Q.jsxs)(`p`,{className:`text-muted-foreground`,children:[h_(n),` not recorded.`]}):t===void 0?(0,Q.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No `,n,` was emitted for this span.`]}):(0,Q.jsx)(o_,{value:t})}function o_({value:e}){return(0,Q.jsx)(`pre`,{className:`font-mono text-[0.6875rem] leading-5 break-words whitespace-pre-wrap`,children:JSON.stringify(e,null,2)})}function s_({icon:e,children:t}){return(0,Q.jsxs)(`div`,{className:`text-muted-foreground flex min-h-0 items-center justify-center gap-2 p-8 text-sm`,children:[e,t]})}function c_(e){let t=J(`text-muted-foreground size-3.5 shrink-0`,e.status===`failed`&&`text-destructive`);switch(e.type){case`agent`:return(0,Q.jsx)(wr,{className:t,"aria-hidden":`true`});case`function`:return(0,Q.jsx)(Jr,{className:t,"aria-hidden":`true`});default:return(0,Q.jsx)(k,{className:t,"aria-hidden":`true`})}}function l_(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map,r=e=>{let i=n.get(e.id);if(i!==void 0)return i;let a=e.parentId?t.get(e.parentId):void 0,o=a?r(a)+1:0;return n.set(e.id,o),o};for(let t of e)r(t);return n}function u_(e,t){return`${e}/${encodeURIComponent(t.chatId)}`}function d_(e,t,n){return`${u_(e,t)}/${encodeURIComponent(n)}`}function f_(e){if(!e.startedAt)return`—`;if(!e.endedAt)return`Running`;let t=Date.parse(e.startedAt);return m_(Date.parse(e.endedAt)-t)}function p_(e){return e.endedAt?m_(Date.parse(e.endedAt)-Date.parse(e.startedAt)):`Running`}function m_(e){return e<1e3?`${Math.max(0,Math.round(e))}ms`:`${(e/1e3).toFixed(e<1e4?2:1)}s`}function h_(e){return e.charAt(0).toUpperCase()+e.slice(1)}function g_(e){return typeof e==`string`?e:JSON.stringify(e)}async function __({params:e,request:t}){let n=await bn(t.signal);return{...n,conversation:n.history.find(({chatId:t,userId:n})=>t===e.chatId&&n===e.userId)??n.history[0]}}function v_(){let{conversation:e,discovery:t}=he(),n=t?.capabilities.traces?.href;return e&&n?(0,Q.jsx)(y_,{conversation:e,href:n}):e?(0,Q.jsx)(Zh,{conversation:e}):null}function y_({conversation:e,href:t}){let{traceId:n}=Pe(),r=Ae();return(0,Q.jsx)(n_,{conversation:e,href:t,traceId:n,onTraceId:(0,Z.useCallback)((t,n)=>{r(rt(`/history/:userId/:chatId/traces/:traceId`,{chatId:e.chatId,traceId:t,userId:e.userId}),{replace:n})},[e.chatId,e.userId,r])})}var b_=_h([{id:`app`,Component:qh,HydrateFallback:()=>null,loader:Gh,children:[{index:!0,loader:()=>qt(`/history`)},{path:`chat/:sessionId?`,lazy:()=>a(()=>import(`./chat-Bcq_Wic7.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)},{path:`history/:userId?/:chatId?`,Component:Xh,loader:Yh},{path:`history/:userId/:chatId/traces/:traceId?`,Component:v_,loader:__},{path:`scheduled`,loader:()=>qt(`/scheduled/tasks`)},{path:`scheduled/tasks/:taskId?`,Component:hg,loader:mg},{path:`scheduled/tasks/:taskId/runs/:runId`,Component:hg,loader:mg},{path:`scheduled/review/:runId?`,Component:hg,loader:mg}]}],{basename:new URL(document.baseURI).pathname.replace(/\/$/,``)}),x_=document.getElementById(`root`);if(!x_)throw Error(`The DevTool page has no #root element.`);(0,zh.createRoot)(x_).render((0,Q.jsx)(Z.StrictMode,{children:(0,Q.jsx)(me,{clock:globalThis,children:(0,Q.jsx)(ar,{client:Jt,children:(0,Q.jsx)(Dm,{router:b_})})})}));