@jean2/client 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/SessionContent-BPrza9X5.js +9 -0
- package/dist/assets/{SessionMenuButton-BQgLoVBs.js → SessionMenuButton-B1uASsIZ.js} +3 -3
- package/dist/assets/_serverId-DfaxBHQQ.js +11 -0
- package/dist/assets/_sessionId-Ce-dKO7D.js +1 -0
- package/dist/assets/_sessionId-HyxD5THT.js +1 -0
- package/dist/assets/alert--ylHisOx.js +31 -0
- package/dist/assets/badge-D9JlXycT.js +1 -0
- package/dist/assets/http-namespace-CAzyfpbt.js +1 -0
- package/dist/assets/{index-ClGd9Hzj.js → index-DzlY5WuB.js} +3 -3
- package/dist/assets/index-pIWtxkTI.css +2 -0
- package/dist/assets/overview-GmLBhh8H.js +1 -0
- package/dist/assets/{popover-D3zF08_g.js → popover-B_1W6FO-.js} +1 -1
- package/dist/assets/switch-DXLDmxh6.js +1 -0
- package/dist/assets/workspace-B45MpkP1.js +1 -0
- package/dist/index.html +3 -3
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/SessionContent-D_iXMVdA.js +0 -9
- package/dist/assets/_serverId-DA_laFNU.js +0 -11
- package/dist/assets/_sessionId-BQ2Y70Im.js +0 -1
- package/dist/assets/_sessionId-cGj1IHAP.js +0 -1
- package/dist/assets/alert-BsV_fzAT.js +0 -31
- package/dist/assets/badge-rLirH4Qz.js +0 -1
- package/dist/assets/http-namespace-CqSEyQlV.js +0 -1
- package/dist/assets/index-BsdM9bLP.css +0 -2
- package/dist/assets/overview-CXMkI2gp.js +0 -1
- package/dist/assets/switch-CbPMcC7k.js +0 -1
- package/dist/assets/workspace-DAso8-D3.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t,r as n,t as r}from"./jsx-runtime-CoWo_Ex4.js";import{t as i}from"./react-dom-lAXwbrYv.js";import{A as a,C as o,E as s,O as c,S as l,T as u,_ as d,a as f,b as p,d as m,f as h,h as g,j as _,k as v,l as y,n as b,p as x,s as S,t as C,w}from"./serverDataStore-CvTJtC_B.js";import{t as T}from"./createLucideIcon-Cev6Iqjf.js";import{A as E,C as ee,D,E as O,F as k,I as A,L as j,M,N as te,O as N,P as ne,R as P,S as re,T as ie,b as ae,j as oe,k as se,l as ce,u as F,w as le,x as ue,y as de}from"./dialog-CpPDW758.js";var fe=class extends _{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=h(),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),me(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return he(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return he(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 o(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&&!u(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ge(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(t.enabled,this.#t)||w(this.options.staleTime,this.#t)!==w(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||o(this.options.enabled,this.#t)!==o(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 ve(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(p)),t}#g(){this.#b();let e=w(this.options.staleTime,this.#t);if(x.isServer()||this.#r.isStale||!d(e))return;let t=c(this.#r.dataUpdatedAt,e)+1;this.#d=v.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,!(x.isServer()||o(this.options.enabled,this.#t)===!1||!d(this.#p)||this.#p===0)&&(this.#f=v.setInterval(()=>{(this.options.refetchIntervalInBackground||a.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(v.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(v.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&me(e,t),o=i&&ge(e,n,t,r);(a||o)&&(d={...d,...y(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:g,status:_}=d;p=d.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=i.data,v=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(_=`success`,p=l(i?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===a?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=l(i?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,g=Date.now(),_=`error`);let b=d.fetchStatus===`fetching`,x=_===`pending`,S=_===`error`,C=x&&b,w=p!==void 0,T={status:_,fetchStatus:d.fetchStatus,isPending:x,isSuccess:_===`success`,isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!w,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:S&&w,isStale:_e(e,t),refetch:this.refetch,promise:this.#o,isEnabled:o(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=T.data!==void 0,r=T.status===`error`&&!t,i=e=>{r?e.reject(T.error):t&&e.resolve(T.data)},a=()=>{i(this.#o=T.promise=h())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||T.data!==o.value)&&a();break;case`rejected`:(!r||T.error!==o.reason)&&a();break}}return T}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),!u(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){m.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function pe(e,t){return o(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&o(t.retryOnMount,e)===!1)}function me(e,t){return pe(e,t)||e.state.data!==void 0&&he(e,t,t.refetchOnMount)}function he(e,t,n){if(o(t.enabled,e)!==!1&&w(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&_e(e,t)}return!1}function ge(e,t,n,r){return(e!==t||o(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&_e(e,n)}function _e(e,t){return o(t.enabled,e)!==!1&&e.isStaleByTime(w(t.staleTime,e))}function ve(e,t){return!u(e.getCurrentResult(),t)}var ye=class extends _{#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),u(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&g(t.mutationKey)!==g(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??S();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){m.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)})})}},I=r(),L=t(n(),1),be=L.createContext(!1),xe=()=>L.useContext(be);be.Provider;function Se(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ce=L.createContext(Se()),we=()=>L.useContext(Ce),Te=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?s(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ee=e=>{L.useEffect(()=>{e.clearReset()},[e])},De=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||s(n,[e.error,r])),Oe=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))}},ke=(e,t)=>e.isLoading&&e.isFetching&&!t,Ae=(e,t)=>e?.suspense&&t.isPending,je=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Me(e,t,n){let r=xe(),i=we(),a=f(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Oe(o),Te(o,i,s),Ee(i);let c=!a.getQueryCache().get(o.queryHash),[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(m.batchCalls(e)):p;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),Ae(o,u))throw je(o,l,i);if(De({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!x.isServer()&&ke(u,r)&&(c?je(o,l,i):s?.promise)?.catch(p).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function R(e,t){return Me(e,fe,t)}function z(e,t){let n=f(t),[r]=L.useState(()=>new ye(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);let i=L.useSyncExternalStore(L.useCallback(e=>r.subscribe(m.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=L.useCallback((e,t)=>{r.mutate(e,t).catch(p)},[r]);if(i.error&&s(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Ne(e){return Math.max(220,Math.min(512,e))}var Pe={SESSIONS:`jean2_sessions_panel_width`,FILES:`jean2_files_panel_width`},Fe=`jean2_draft_`,Ie=720*60*60*1e3;function Le(){try{for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);if(!(!t||!t.startsWith(`jean2_draft_`)))try{let e=localStorage.getItem(t);if(!e)continue;let n=JSON.parse(e);Date.now()-n.updatedAt>2592e6&&localStorage.removeItem(t)}catch{localStorage.removeItem(t)}}}catch{}}var Re=T(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ze=T(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Be=T(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ve=T(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),He=T(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ue=T(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),We=T(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ge=T(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ke=t(i(),1),qe=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Je=`VisuallyHidden`,Ye=L.forwardRef((e,t)=>(0,I.jsx)(M.span,{...e,ref:t,style:{...qe,...e.style}}));Ye.displayName=Je;var Xe=Ye;function Ze(e){let t=e+`CollectionProvider`,[n,r]=oe(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=L.useRef(null),a=L.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=k(s),l=L.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,I.jsx)(c,{ref:P(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=k(u),p=L.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=L.useRef(null),s=P(t,o),c=a(u,n);return L.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return L.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Qe=`Collapsible`,[$e,et]=oe(Qe),[tt,nt]=$e(Qe),rt=L.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=N({prop:r,defaultProp:i??!1,onChange:o,caller:Qe});return(0,I.jsx)(tt,{scope:n,disabled:a,contentId:O(),open:c,onOpenToggle:L.useCallback(()=>l(e=>!e),[l]),children:(0,I.jsx)(M.div,{"data-state":lt(c),"data-disabled":a?``:void 0,...s,ref:t})})});rt.displayName=Qe;var it=`CollapsibleTrigger`,at=L.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=nt(it,n);return(0,I.jsx)(M.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":lt(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:E(e.onClick,i.onOpenToggle)})});at.displayName=it;var ot=`CollapsibleContent`,st=L.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=nt(ot,e.__scopeCollapsible);return(0,I.jsx)(D,{present:n||i.open,children:({present:e})=>(0,I.jsx)(ct,{...r,ref:t,present:e})})});st.displayName=ot;var ct=L.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=nt(ot,n),[s,c]=L.useState(r),l=L.useRef(null),u=P(t,l),d=L.useRef(0),f=d.current,p=L.useRef(0),m=p.current,h=o.open||s,g=L.useRef(h),_=L.useRef(void 0);return L.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),se(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,I.jsx)(M.div,{"data-state":lt(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function lt(e){return e?`open`:`closed`}var ut=rt,dt=L.createContext(void 0);function ft(e){let t=L.useContext(dt);return e||t||`ltr`}function pt(e){let t=L.useRef({value:e,previous:e});return L.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function mt(e){let[t,n]=L.useState(void 0);return se(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var ht=[`top`,`right`,`bottom`,`left`],gt=Math.min,B=Math.max,_t=Math.round,vt=Math.floor,V=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return B(e,gt(t,n))}function H(e,t){return typeof e==`function`?e(t):e}function U(e){return e.split(`-`)[0]}function xt(e){return e.split(`-`)[1]}function St(e){return e===`x`?`y`:`x`}function Ct(e){return e===`y`?`height`:`width`}function W(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function wt(e){return St(W(e))}function Tt(e,t,n){n===void 0&&(n=!1);let r=xt(e),i=wt(e),a=Ct(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Pt(o)),[o,Pt(o)]}function Et(e){let t=Pt(e);return[Dt(e),t,Dt(t)]}function Dt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ot=[`left`,`right`],kt=[`right`,`left`],At=[`top`,`bottom`],jt=[`bottom`,`top`];function Mt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?kt:Ot:t?Ot:kt;case`left`:case`right`:return t?At:jt;default:return[]}}function Nt(e,t,n,r){let i=xt(e),a=Mt(U(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Dt)))),a}function Pt(e){let t=U(e);return yt[t]+e.slice(t.length)}function Ft(e){return{top:0,right:0,bottom:0,left:0,...e}}function It(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ft(e)}function Lt(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}}function Rt(e,t,n){let{reference:r,floating:i}=e,a=W(t),o=wt(t),s=Ct(o),c=U(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}}switch(xt(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function zt(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}=H(t,e),p=It(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Lt(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=Lt(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 Bt=50,Vt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:zt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Rt(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<Bt&&(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}=Rt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ht=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}=H(e,t)||{};if(l==null)return{};let d=It(u),f={x:n,y:r},p=wt(i),m=Ct(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=gt(d[_],T),ee=gt(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,A=bt(D,k,O),j=!c.arrow&&xt(i)!=null&&k!==A&&a.reference[m]/2-(k<D?E:ee)-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}}}),Ut=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}=H(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=U(r),_=W(o),v=U(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Pt(o)]:Et(o)),x=p!==`none`;!d&&x&&b.push(...Nt(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=Tt(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`&&_!==W(t))||T.every(e=>W(e.placement)===_?e.overflows[0]>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=W(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{}}}};function Wt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Gt(e){return ht.some(t=>e[t]>=0)}var Kt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=H(e,t);switch(i){case`referenceHidden`:{let e=Wt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Gt(e)}}}case`escaped`:{let e=Wt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Gt(e)}}}default:return{}}}}},qt=new Set([`left`,`top`]);async function Jt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=U(n),s=xt(n),c=W(n)===`y`,l=qt.has(o)?-1:1,u=a&&c?-1:1,d=H(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 Yt=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 Jt(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}}}}},Xt=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}=H(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=W(U(i)),p=St(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=bt(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=bt(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Zt=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}=H(e,t),u={x:n,y:r},d=W(i),f=St(d),p=u[f],m=u[d],h=H(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=qt.has(U(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}}}},Qt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=H(e,t),u=await o.detectOverflow(t,l),d=U(i),f=xt(i),p=W(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=gt(h-u[g],v),x=gt(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=B(u.left,0),t=B(u.right,0),n=B(u.top,0),r=B(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:B(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:B(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function $t(){return typeof window<`u`}function en(e){return tn(e)?(e.nodeName||``).toLowerCase():`#document`}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function K(e){return((tn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function tn(e){return $t()?e instanceof Node||e instanceof G(e).Node:!1}function q(e){return $t()?e instanceof Element||e instanceof G(e).Element:!1}function J(e){return $t()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function nn(e){return!$t()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function rn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function an(e){return/^(table|td|th)$/.test(en(e))}function on(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var sn=/transform|translate|scale|rotate|perspective|filter/,cn=/paint|layout|strict|content/,ln=e=>!!e&&e!==`none`,un;function dn(e){let t=q(e)?Y(e):e;return ln(t.transform)||ln(t.translate)||ln(t.scale)||ln(t.rotate)||ln(t.perspective)||!pn()&&(ln(t.backdropFilter)||ln(t.filter))||sn.test(t.willChange||``)||cn.test(t.contain||``)}function fn(e){let t=gn(e);for(;J(t)&&!mn(t);){if(dn(t))return t;if(on(t))return null;t=gn(t)}return null}function pn(){return un??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),un}function mn(e){return/^(html|body|#document)$/.test(en(e))}function Y(e){return G(e).getComputedStyle(e)}function hn(e){return q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gn(e){if(en(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||nn(e)&&e.host||K(e);return nn(t)?t.host:t}function _n(e){let t=gn(e);return mn(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&rn(t)?t:_n(t)}function vn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_n(e),i=r===e.ownerDocument?.body,a=G(r);if(i){let e=yn(a);return t.concat(a,a.visualViewport||[],rn(r)?r:[],e&&n?vn(e):[])}else return t.concat(r,vn(r,[],n))}function yn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bn(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=J(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=_t(n)!==a||_t(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function xn(e){return q(e)?e:e.contextElement}function Sn(e){let t=xn(e);if(!J(t))return V(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=bn(t),o=(a?_t(n.width):n.width)/r,s=(a?_t(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Cn=V(0);function wn(e){let t=G(e);return!pn()||!t.visualViewport?Cn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Tn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G(e)?!1:t}function En(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=xn(e),o=V(1);t&&(r?q(r)&&(o=Sn(r)):o=Sn(e));let s=Tn(a,n,r)?wn(a):V(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=G(a),t=r&&q(r)?G(r):r,n=e,i=yn(n);for(;i&&r&&t!==n;){let e=Sn(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=G(i),i=yn(n)}}return Lt({width:u,height:d,x:c,y:l})}function Dn(e,t){let n=hn(e).scrollLeft;return t?t.left+n:En(K(e)).left+n}function On(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Dn(e,n),y:n.top+t.scrollTop}}function kn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=K(r),s=t?on(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=V(1),u=V(0),d=J(r);if((d||!d&&!a)&&((en(r)!==`body`||rn(o))&&(c=hn(r)),d)){let e=En(r);l=Sn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?On(o,c):V(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 An(e){return Array.from(e.getClientRects())}function jn(e){let t=K(e),n=hn(e),r=e.ownerDocument.body,i=B(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=B(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Dn(e),s=-n.scrollTop;return Y(r).direction===`rtl`&&(o+=B(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Mn=25;function Nn(e,t){let n=G(e),r=K(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=pn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Dn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Mn&&(a-=o)}else l<=Mn&&(a+=l);return{width:a,height:o,x:s,y:c}}function Pn(e,t){let n=En(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=J(e)?Sn(e):V(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Fn(e,t,n){let r;if(t===`viewport`)r=Nn(e,n);else if(t===`document`)r=jn(K(e));else if(q(t))r=Pn(t,n);else{let n=wn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Lt(r)}function In(e,t){let n=gn(e);return n===t||!q(n)||mn(n)?!1:Y(n).position===`fixed`||In(n,t)}function Ln(e,t){let n=t.get(e);if(n)return n;let r=vn(e,[],!1).filter(e=>q(e)&&en(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?gn(e):e;for(;q(o)&&!mn(o);){let t=Y(o),n=dn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||rn(o)&&!n&&In(e,o))?r=r.filter(e=>e!==o):i=t,o=gn(o)}return t.set(e,r),r}function Rn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?on(t)?[]:Ln(t,this._c):[].concat(n),r],o=Fn(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=Fn(t,a[e],i);s=B(n.top,s),c=gt(n.right,c),l=gt(n.bottom,l),u=B(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function zn(e){let{width:t,height:n}=bn(e);return{width:t,height:n}}function Bn(e,t,n){let r=J(t),i=K(t),a=n===`fixed`,o=En(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=V(0);function l(){c.x=Dn(i)}if(r||!r&&!a)if((en(t)!==`body`||rn(i))&&(s=hn(t)),r){let e=En(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?On(i,s):V(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Vn(e){return Y(e).position===`static`}function Hn(e,t){if(!J(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return K(e)===n&&(n=n.ownerDocument.body),n}function Un(e,t){let n=G(e);if(on(e))return n;if(!J(e)){let t=gn(e);for(;t&&!mn(t);){if(q(t)&&!Vn(t))return t;t=gn(t)}return n}let r=Hn(e,t);for(;r&&an(r)&&Vn(r);)r=Hn(r,t);return r&&mn(r)&&Vn(r)&&!dn(r)?n:r||fn(e)||n}var Wn=async function(e){let t=this.getOffsetParent||Un,n=this.getDimensions,r=await n(e.floating);return{reference:Bn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Gn(e){return Y(e).direction===`rtl`}var Kn={convertOffsetParentRelativeRectToViewportRelativeRect:kn,getDocumentElement:K,getClippingRect:Rn,getOffsetParent:Un,getElementRects:Wn,getClientRects:An,getDimensions:zn,getScale:Sn,isElement:q,isRTL:Gn};function qn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jn(e,t){let n=null,r,i=K(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=vt(d),h=vt(i.clientWidth-(u+f)),g=vt(i.clientHeight-(d+p)),_=vt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:B(0,gt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!qn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Yn(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=xn(e),u=i||a?[...l?vn(l):[],...t?vn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Jn(l,n):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?En(e):null;c&&g();function g(){let t=En(e);h&&!qn(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 Xn=Yt,Zn=Xt,Qn=Ut,$n=Qt,er=Kt,tr=Ht,nr=Zt,rr=(e,t,n)=>{let r=new Map,i={platform:Kn,...n},a={...i.platform,_c:r};return Vt(e,t,{...i,platform:a})},ir=typeof document<`u`?L.useLayoutEffect:function(){};function ar(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(!ar(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)&&!ar(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function or(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sr(e,t){let n=or(e);return Math.round(t*n)/n}function cr(e){let t=L.useRef(e);return ir(()=>{t.current=e}),t}function lr(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]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=L.useState(r);ar(f,r)||p(r);let[m,h]=L.useState(null),[g,_]=L.useState(null),v=L.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=L.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=L.useRef(null),C=L.useRef(null),w=L.useRef(u),T=c!=null,E=cr(c),ee=cr(i),D=cr(l),O=L.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),rr(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!ar(w.current,t)&&(w.current=t,Ke.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);ir(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=L.useRef(!1);ir(()=>(k.current=!0,()=>{k.current=!1}),[]),ir(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let A=L.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=L.useMemo(()=>({reference:b,floating:x}),[b,x]),M=L.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=sr(j.floating,u.x),r=sr(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...or(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return L.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:M}),[u,O,A,j,M])}var ur=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:tr({element:r.current,padding:i}).fn(n):r?tr({element:r,padding:i}).fn(n):{}}}},dr=(e,t)=>{let n=Xn(e);return{name:n.name,fn:n.fn,options:[e,t]}},fr=(e,t)=>{let n=Zn(e);return{name:n.name,fn:n.fn,options:[e,t]}},pr=(e,t)=>({fn:nr(e).fn,options:[e,t]}),mr=(e,t)=>{let n=Qn(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},_r=(e,t)=>{let n=ur(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=`Arrow`,yr=L.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(M.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});yr.displayName=vr;var br=yr,xr=`Popper`,[Sr,Cr]=oe(xr),[wr,Tr]=Sr(xr),Er=e=>{let{__scopePopper:t,children:n}=e,[r,i]=L.useState(null);return(0,I.jsx)(wr,{scope:t,anchor:r,onAnchorChange:i,children:n})};Er.displayName=xr;var Dr=`PopperAnchor`,Or=L.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Tr(Dr,n),o=L.useRef(null),s=P(t,o),c=L.useRef(null);return L.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(M.div,{...i,ref:s})});Or.displayName=Dr;var kr=`PopperContent`,[Ar,jr]=Sr(kr),Mr=L.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Tr(kr,n),[_,v]=L.useState(null),y=P(t,e=>v(e)),[b,x]=L.useState(null),S=mt(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],D=ee.length>0,O={padding:E,boundary:ee.filter(Ir),altBoundary:D},{refs:k,floatingStyles:A,placement:j,isPositioned:te,middlewareData:N}=lr({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Yn(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[dr({mainAxis:i+w,alignmentAxis:o}),c&&fr({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?pr():void 0,...O}),c&&mr({...O}),hr({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&_r({element:b,padding:s}),Lr({arrowWidth:C,arrowHeight:w}),f&&gr({strategy:`referenceHidden`,...O})]}),[ne,re]=Rr(j),ae=ie(m);se(()=>{te&&ae?.()},[te,ae]);let oe=N.arrow?.x,ce=N.arrow?.y,F=N.arrow?.centerOffset!==0,[le,ue]=L.useState();return se(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,I.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:te?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(Ar,{scope:n,placedSide:ne,onArrowChange:x,arrowX:oe,arrowY:ce,shouldHideArrow:F,children:(0,I.jsx)(M.div,{"data-side":ne,"data-align":re,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});Mr.displayName=kr;var Nr=`PopperArrow`,Pr={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Fr=L.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=jr(Nr,n),a=Pr[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,I.jsx)(br,{...r,ref:t,style:{...r.style,display:`block`}})})});Fr.displayName=Nr;function Ir(e){return e!==null}var Lr=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Rr(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Rr(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var zr=Er,Br=Or,Vr=Mr,Hr=Fr,Ur=`rovingFocusGroup.onEntryFocus`,Wr={bubbles:!1,cancelable:!0},Gr=`RovingFocusGroup`,[Kr,qr,Jr]=Ze(Gr),[Yr,Xr]=oe(Gr,[Jr]),[Zr,Qr]=Yr(Gr),$r=L.forwardRef((e,t)=>(0,I.jsx)(Kr.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(Kr.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(ei,{...e,ref:t})})}));$r.displayName=Gr;var ei=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=L.useRef(null),p=P(t,f),m=ft(a),[h,g]=N({prop:o,defaultProp:s??null,onChange:c,caller:Gr}),[_,v]=L.useState(!1),y=ie(l),b=qr(n),x=L.useRef(!1),[S,C]=L.useState(0);return L.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Ur,y),()=>e.removeEventListener(Ur,y)},[y]),(0,I.jsx)(Zr,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:L.useCallback(e=>g(e),[g]),onItemShiftTab:L.useCallback(()=>v(!0),[]),onFocusableItemAdd:L.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:L.useCallback(()=>C(e=>e-1),[]),children:(0,I.jsx)(M.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:E(e.onMouseDown,()=>{x.current=!0}),onFocus:E(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Ur,Wr);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);oi([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:E(e.onBlur,()=>v(!1))})})}),ti=`RovingFocusGroupItem`,ni=L.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=O(),l=a||c,u=Qr(ti,n),d=u.currentTabStopId===l,f=qr(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return L.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(Kr.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(M.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:E(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:E(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:E(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ai(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?si(n,r+1):n.slice(r+1)}setTimeout(()=>oi(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});ni.displayName=ti;var ri={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function ii(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ai(e,t,n){let r=ii(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ri[r]}function oi(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function si(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ci=$r,li=ni,ui=[`Enter`,` `],di=[`ArrowDown`,`PageUp`,`Home`],fi=[`ArrowUp`,`PageDown`,`End`],pi=[...di,...fi],mi={ltr:[...ui,`ArrowRight`],rtl:[...ui,`ArrowLeft`]},hi={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},gi=`Menu`,[_i,vi,yi]=Ze(gi),[bi,xi]=oe(gi,[yi,Cr,Xr]),Si=Cr(),Ci=Xr(),[wi,Ti]=bi(gi),[Ei,Di]=bi(gi),Oi=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Si(t),[c,l]=L.useState(null),u=L.useRef(!1),d=ie(a),f=ft(i);return L.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,I.jsx)(zr,{...s,children:(0,I.jsx)(wi,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(Ei,{scope:t,onClose:L.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Oi.displayName=gi;var ki=`MenuAnchor`,Ai=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Si(n);return(0,I.jsx)(Br,{...i,...r,ref:t})});Ai.displayName=ki;var ji=`MenuPortal`,[Mi,Ni]=bi(ji,{forceMount:void 0}),Pi=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ti(ji,t);return(0,I.jsx)(Mi,{scope:t,forceMount:n,children:(0,I.jsx)(D,{present:n||a.open,children:(0,I.jsx)(re,{asChild:!0,container:i,children:r})})})};Pi.displayName=ji;var X=`MenuContent`,[Fi,Ii]=bi(X),Li=L.forwardRef((e,t)=>{let n=Ni(X,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ti(X,e.__scopeMenu),o=Di(X,e.__scopeMenu);return(0,I.jsx)(_i.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(D,{present:r||a.open,children:(0,I.jsx)(_i.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(Ri,{...i,ref:t}):(0,I.jsx)(zi,{...i,ref:t})})})})}),Ri=L.forwardRef((e,t)=>{let n=Ti(X,e.__scopeMenu),r=L.useRef(null),i=P(t,r);return L.useEffect(()=>{let e=r.current;if(e)return de(e)},[]),(0,I.jsx)(Vi,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:E(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zi=L.forwardRef((e,t)=>{let n=Ti(X,e.__scopeMenu);return(0,I.jsx)(Vi,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Bi=k(`MenuContent.ScrollLock`),Vi=L.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ti(X,n),_=Di(X,n),v=Si(n),y=Ci(n),b=vi(n),[x,S]=L.useState(null),C=L.useRef(null),w=P(t,C,g.onContentChange),T=L.useRef(0),D=L.useRef(``),O=L.useRef(0),k=L.useRef(null),A=L.useRef(`right`),j=L.useRef(0),M=m?ae:L.Fragment,te=m?{as:Bi,allowPinchZoom:!0}:void 0,N=e=>{let t=D.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Ta(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};L.useEffect(()=>()=>window.clearTimeout(T.current),[]),ue();let ne=L.useCallback(e=>A.current===k.current?.side&&Da(e,k.current?.area),[]);return(0,I.jsx)(Fi,{scope:n,searchRef:D,onItemEnter:L.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),onItemLeave:L.useCallback(e=>{ne(e)||(C.current?.focus(),S(null))},[ne]),onTriggerLeave:L.useCallback(e=>{ne(e)&&e.preventDefault()},[ne]),pointerGraceTimerRef:O,onPointerGraceIntentChange:L.useCallback(e=>{k.current=e},[]),children:(0,I.jsx)(M,{...te,children:(0,I.jsx)(ee,{asChild:!0,trapped:i,onMountAutoFocus:E(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(le,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(ci,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:E(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(Vr,{role:`menu`,"aria-orientation":`vertical`,"data-state":ba(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:E(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!pi.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);fi.includes(e.key)&&a.reverse(),Ca(a)}),onBlur:E(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),D.current=``)}),onPointerMove:E(e.onPointerMove,Oa(e=>{let t=e.target,n=j.current!==e.clientX;e.currentTarget.contains(t)&&n&&(A.current=e.clientX>j.current?`right`:`left`,j.current=e.clientX)}))})})})})})})});Li.displayName=X;var Hi=`MenuGroup`,Ui=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(M.div,{role:`group`,...r,ref:t})});Ui.displayName=Hi;var Wi=`MenuLabel`,Gi=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(M.div,{...r,ref:t})});Gi.displayName=Wi;var Ki=`MenuItem`,qi=`menu.itemSelect`,Ji=L.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=L.useRef(null),o=Di(Ki,e.__scopeMenu),s=Ii(Ki,e.__scopeMenu),c=P(t,a),l=L.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(qi,{bubbles:!0,cancelable:!0});e.addEventListener(qi,e=>r?.(e),{once:!0}),te(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)(Yi,{...i,ref:c,disabled:n,onClick:E(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:E(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:E(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ui.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Ji.displayName=Ki;var Yi=L.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ii(Ki,n),s=Ci(n),c=L.useRef(null),l=P(t,c),[u,d]=L.useState(!1),[f,p]=L.useState(``);return L.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(_i.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(li,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(M.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:E(e.onPointerMove,Oa(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:E(e.onPointerLeave,Oa(e=>o.onItemLeave(e))),onFocus:E(e.onFocus,()=>d(!0)),onBlur:E(e.onBlur,()=>d(!1))})})})}),Xi=`MenuCheckboxItem`,Zi=L.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(aa,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)(Ji,{role:`menuitemcheckbox`,"aria-checked":xa(n)?`mixed`:n,...i,ref:t,"data-state":Sa(n),onSelect:E(i.onSelect,()=>r?.(xa(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Zi.displayName=Xi;var Qi=`MenuRadioGroup`,[$i,ea]=bi(Qi,{value:void 0,onValueChange:()=>{}}),ta=L.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=ie(r);return(0,I.jsx)($i,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(Ui,{...i,ref:t})})});ta.displayName=Qi;var na=`MenuRadioItem`,ra=L.forwardRef((e,t)=>{let{value:n,...r}=e,i=ea(na,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(aa,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(Ji,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Sa(a),onSelect:E(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ra.displayName=na;var ia=`MenuItemIndicator`,[aa,oa]=bi(ia,{checked:!1}),sa=L.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=oa(ia,n);return(0,I.jsx)(D,{present:r||xa(a.checked)||a.checked===!0,children:(0,I.jsx)(M.span,{...i,ref:t,"data-state":Sa(a.checked)})})});sa.displayName=ia;var ca=`MenuSeparator`,la=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(M.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});la.displayName=ca;var ua=`MenuArrow`,da=L.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Si(n);return(0,I.jsx)(Hr,{...i,...r,ref:t})});da.displayName=ua;var fa=`MenuSub`,[pa,ma]=bi(fa),ha=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ti(fa,t),o=Si(t),[s,c]=L.useState(null),[l,u]=L.useState(null),d=ie(i);return L.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,I.jsx)(zr,{...o,children:(0,I.jsx)(wi,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,I.jsx)(pa,{scope:t,contentId:O(),triggerId:O(),trigger:s,onTriggerChange:c,children:n})})})};ha.displayName=fa;var ga=`MenuSubTrigger`,_a=L.forwardRef((e,t)=>{let n=Ti(ga,e.__scopeMenu),r=Di(ga,e.__scopeMenu),i=ma(ga,e.__scopeMenu),a=Ii(ga,e.__scopeMenu),o=L.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=L.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return L.useEffect(()=>u,[u]),L.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,I.jsx)(Ai,{asChild:!0,...l,children:(0,I.jsx)(Yi,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":ba(n.open),...e,ref:j(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:E(e.onPointerMove,Oa(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:E(e.onPointerLeave,Oa(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:E(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||mi[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});_a.displayName=ga;var va=`MenuSubContent`,ya=L.forwardRef((e,t)=>{let n=Ni(X,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ti(X,e.__scopeMenu),o=Di(X,e.__scopeMenu),s=ma(va,e.__scopeMenu),c=L.useRef(null),l=P(t,c);return(0,I.jsx)(_i.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(D,{present:r||a.open,children:(0,I.jsx)(_i.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(Vi,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:E(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:E(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:E(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=hi[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});ya.displayName=va;function ba(e){return e?`open`:`closed`}function xa(e){return e===`indeterminate`}function Sa(e){return xa(e)?`indeterminate`:e?`checked`:`unchecked`}function Ca(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wa(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ta(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=wa(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ea(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Da(e,t){return t?Ea({x:e.clientX,y:e.clientY},t):!1}function Oa(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ka=Oi,Aa=Ai,ja=Pi,Ma=Li,Na=Ui,Pa=Gi,Fa=Ji,Ia=Zi,La=ta,Ra=ra,za=sa,Ba=la,Va=da,Ha=_a,Ua=ya,Wa=`DropdownMenu`,[Ga,Ka]=oe(Wa,[xi]),Z=xi(),[qa,Ja]=Ga(Wa),Ya=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Z(t),l=L.useRef(null),[u,d]=N({prop:i,defaultProp:a??!1,onChange:o,caller:Wa});return(0,I.jsx)(qa,{scope:t,triggerId:O(),triggerRef:l,contentId:O(),open:u,onOpenChange:d,onOpenToggle:L.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(ka,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Ya.displayName=Wa;var Xa=`DropdownMenuTrigger`,Za=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Ja(Xa,n),o=Z(n);return(0,I.jsx)(Aa,{asChild:!0,...o,children:(0,I.jsx)(M.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:j(t,a.triggerRef),onPointerDown:E(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:E(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Za.displayName=Xa;var Qa=`DropdownMenuPortal`,$a=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Z(t);return(0,I.jsx)(ja,{...r,...n})};$a.displayName=Qa;var eo=`DropdownMenuContent`,to=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ja(eo,n),a=Z(n),o=L.useRef(!1);return(0,I.jsx)(Ma,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:E(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:E(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});to.displayName=eo;var no=`DropdownMenuGroup`,ro=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Na,{...i,...r,ref:t})});ro.displayName=no;var io=`DropdownMenuLabel`,ao=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Pa,{...i,...r,ref:t})});ao.displayName=io;var oo=`DropdownMenuItem`,so=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Fa,{...i,...r,ref:t})});so.displayName=oo;var co=`DropdownMenuCheckboxItem`,lo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Ia,{...i,...r,ref:t})});lo.displayName=co;var uo=`DropdownMenuRadioGroup`,fo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(La,{...i,...r,ref:t})});fo.displayName=uo;var po=`DropdownMenuRadioItem`,mo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Ra,{...i,...r,ref:t})});mo.displayName=po;var ho=`DropdownMenuItemIndicator`,go=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(za,{...i,...r,ref:t})});go.displayName=ho;var _o=`DropdownMenuSeparator`,vo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Ba,{...i,...r,ref:t})});vo.displayName=_o;var yo=`DropdownMenuArrow`,bo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Va,{...i,...r,ref:t})});bo.displayName=yo;var xo=`DropdownMenuSubTrigger`,So=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Ha,{...i,...r,ref:t})});So.displayName=xo;var Co=`DropdownMenuSubContent`,wo=L.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Z(n);return(0,I.jsx)(Ua,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});wo.displayName=Co;var To=Ya,Eo=Za,Do=$a,Oo=to,ko=ao,Ao=so,jo=lo,Mo=go,No=vo,Po=`Separator`,Fo=`horizontal`,Io=[`horizontal`,`vertical`],Lo=L.forwardRef((e,t)=>{let{decorative:n,orientation:r=Fo,...i}=e,a=Ro(r)?r:Fo,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,I.jsx)(M.div,{"data-orientation":a,...o,...i,ref:t})});Lo.displayName=Po;function Ro(e){return Io.includes(e)}var zo=Lo,[Bo,Vo]=oe(`Tooltip`,[Cr]),Ho=Cr(),Uo=`TooltipProvider`,Wo=700,Go=`tooltip.open`,[Ko,qo]=Bo(Uo),Jo=e=>{let{__scopeTooltip:t,delayDuration:n=Wo,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=L.useRef(!0),s=L.useRef(!1),c=L.useRef(0);return L.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Ko,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:L.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:L.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:L.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Jo.displayName=Uo;var Yo=`Tooltip`,[Xo,Zo]=Bo(Yo),Qo=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=qo(Yo,e.__scopeTooltip),l=Ho(t),[u,d]=L.useState(null),f=O(),p=L.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=L.useRef(!1),[_,v]=N({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Go))):c.onClose(),a?.(e)},caller:Yo}),y=L.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=L.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=L.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return L.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,I.jsx)(zr,{...l,children:(0,I.jsx)(Xo,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:L.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:L.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};Qo.displayName=Yo;var $o=`TooltipTrigger`,es=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Zo($o,n),a=qo($o,n),o=Ho(n),s=P(t,L.useRef(null),i.onTriggerChange),c=L.useRef(!1),l=L.useRef(!1),u=L.useCallback(()=>c.current=!1,[]);return L.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Br,{asChild:!0,...o,children:(0,I.jsx)(M.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:E(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:E(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:E(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:E(e.onBlur,i.onClose),onClick:E(e.onClick,i.onClose)})})});es.displayName=$o;var ts=`TooltipPortal`,[ns,rs]=Bo(ts,{forceMount:void 0}),is=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Zo(ts,t);return(0,I.jsx)(ns,{scope:t,forceMount:n,children:(0,I.jsx)(D,{present:n||a.open,children:(0,I.jsx)(re,{asChild:!0,container:i,children:r})})})};is.displayName=ts;var as=`TooltipContent`,os=L.forwardRef((e,t)=>{let n=rs(as,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Zo(as,e.__scopeTooltip);return(0,I.jsx)(D,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(ds,{side:i,...a,ref:t}):(0,I.jsx)(ss,{side:i,...a,ref:t})})}),ss=L.forwardRef((e,t)=>{let n=Zo(as,e.__scopeTooltip),r=qo(as,e.__scopeTooltip),i=L.useRef(null),a=P(t,i),[o,s]=L.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=L.useCallback(()=>{s(null),d(!1)},[d]),p=L.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=hs(r,ms(r,n.getBoundingClientRect())),a=gs(t.getBoundingClientRect());s(vs([...i,...a])),d(!0)},[d]);return L.useEffect(()=>()=>f(),[f]),L.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),L.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!_s(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(ds,{...e,ref:a})}),[cs,ls]=Bo(Yo,{isInside:!1}),us=A(`TooltipContent`),ds=L.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Zo(as,n),l=Ho(n),{onClose:u}=c;return L.useEffect(()=>(document.addEventListener(Go,u),()=>document.removeEventListener(Go,u)),[u]),L.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,I.jsx)(le,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(Vr,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,I.jsx)(us,{children:r}),(0,I.jsx)(cs,{scope:n,isInside:!0,children:(0,I.jsx)(Xe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});os.displayName=as;var fs=`TooltipArrow`,ps=L.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Ho(n);return ls(fs,n).isInside?null:(0,I.jsx)(Hr,{...i,...r,ref:t})});ps.displayName=fs;function ms(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function hs(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function gs(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function _s(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function vs(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ys(t)}function ys(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var bs=Jo,xs=Qo,Ss=es,Cs=is,ws=os,Ts=ps,Q=e(),Es={promptTokens:0,completionTokens:0,totalTokens:0},Ds=b((e,t)=>({currentSession:null,setCurrentSession:t=>e({currentSession:t}),clearActiveSession:()=>e({currentSession:null}),sessions:[],setSessions:t=>e(e=>({sessions:typeof t==`function`?t(e.sessions):t})),addSessionToFront:t=>e(e=>({sessions:[t,...e.sessions]})),updateSession:t=>e(e=>({sessions:e.sessions.map(e=>e.id===t.id?t:e)})),removeSessionById:t=>e(e=>({sessions:e.sessions.filter(e=>e.id!==t)})),clearSessions:()=>e({sessions:[]}),sessionUsage:{...Es},currentModel:`gpt-4o`,selectedVariant:null,compactionSuccess:!1,setSessionUsage:t=>e({sessionUsage:t}),setCurrentModel:t=>e({currentModel:t}),setSelectedVariant:t=>e({selectedVariant:t}),setCompactionSuccess:t=>e({compactionSuccess:t}),clearChatSession:()=>e({sessionUsage:{...Es},currentModel:`gpt-4o`,selectedVariant:null,compactionSuccess:!1}),messagesBySession:{},partsBySession:{},setMessagesBySession:t=>e(e=>({messagesBySession:typeof t==`function`?t(e.messagesBySession):t})),setPartsBySession:t=>e(e=>({partsBySession:typeof t==`function`?t(e.partsBySession):t})),getMessagesBySessionKeysCount:()=>Object.keys(t().messagesBySession).length,queuedMessages:{},clearQueuedMessages:()=>e({queuedMessages:{}}),setQueuedMessagesForSession:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:n}})),addQueuedMessage:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:[...e.queuedMessages[t]||[],n]}})),removeQueuedMessageById:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:(e.queuedMessages[t]||[]).filter(e=>e.id!==n)}})),removeQueuedMessagesByIds:(t,n)=>e(e=>({queuedMessages:{...e.queuedMessages,[t]:(e.queuedMessages[t]||[]).filter(e=>!n.includes(e.id))}})),navigationIntent:{mode:`follow`},setNavigationIntent:t=>e({navigationIntent:t}),clearTargetMessageIntent:()=>e(e=>({navigationIntent:e.navigationIntent.mode===`target-message`?{mode:`free`}:e.navigationIntent}))}));function Os(){let e=Ds.getState();e.clearSessions(),e.clearActiveSession(),e.clearChatSession(),e.clearQueuedMessages(),e.setMessagesBySession({}),e.setPartsBySession({}),e.setNavigationIntent({mode:`follow`})}var ks=(0,L.createContext)(null),As=()=>{let e=(0,L.useContext)(ks);if(e===null)throw Error(`useViewRefs must be used within a ViewRefsProvider`);return e},js=(0,L.createContext)(null);function Ms(){let e=(0,L.useContext)(js);if(!e)throw Error(`useSessionManager must be used within a SessionManagerContext.Provider`);return e}var Ns=b((e,t)=>({pendingRequests:[],handlers:new Map,timedOutRequestIds:new Set,addPendingRequest:t=>e(e=>t.ask.type===`permission`&&t.requestId&&e.timedOutRequestIds.has(t.requestId)?e:{pendingRequests:[...t.ask.type===`permission`&&t.requestId?e.pendingRequests.filter(e=>!(e.ask.type===`permission`&&e.requestId===t.requestId)):e.pendingRequests.filter(e=>e.toolCallId!==t.toolCallId),t]}),removePendingRequest:t=>e(e=>({pendingRequests:e.pendingRequests.filter(e=>e.toolCallId!==t)})),removePendingPermissionRequest:(t,n)=>e(e=>{let r=new Set(e.timedOutRequestIds);r.add(t);let i=e.pendingRequests.findIndex(e=>e.ask.type===`permission`&&e.requestId===t);return i===-1?n?{timedOutRequestIds:r,pendingRequests:e.pendingRequests.filter(e=>e.toolCallId!==n)}:{timedOutRequestIds:r}:{timedOutRequestIds:r,pendingRequests:e.pendingRequests.filter((e,t)=>t!==i)}}),replacePendingPermissionRequests:t=>e(e=>{let n=e.pendingRequests.filter(e=>e.ask.type!==`permission`);return{timedOutRequestIds:new Set,pendingRequests:[...n,...t]}}),clearPendingRequests:()=>e({pendingRequests:[],timedOutRequestIds:new Set}),clearPendingRequestsBySessionId:t=>e(e=>({pendingRequests:e.pendingRequests.filter(e=>e.sessionId!==t&&e.originSessionId!==t)})),registerHandler:(t,n)=>{e(e=>{let r=new Map(e.handlers),i=r.get(t)??[];return r.set(t,[...i,n]),{handlers:r}})},unregisterHandler:(t,n)=>{e(e=>{let r=new Map(e.handlers),i=r.get(t);return i&&r.set(t,i.filter(e=>e!==n)),{handlers:r}})},getHandlers:e=>t().handlers.get(e)??[]})),Ps=`jean2_sound_chat_finish_enabled`,Fs=`jean2_sound_permission_enabled`,Is=(e,t)=>{if(typeof window>`u`)return t;let n=localStorage.getItem(e);return n===null?t:n===`true`},Ls=`jean2_auto_approve_severity`;function Rs(){if(typeof window>`u`)return{};try{let e=localStorage.getItem(Ls);return e?JSON.parse(e):{}}catch{return{}}}function zs(e){typeof window<`u`&&localStorage.setItem(Ls,JSON.stringify(e))}var Bs=b(e=>({showSettings:!1,showConfiguration:!1,showTools:!1,showMCPDialog:!1,showWorkspacePermissions:!1,setShowSettings:t=>e({showSettings:t}),setShowConfiguration:t=>e({showConfiguration:t}),setShowTools:t=>e({showTools:t}),setShowMCPDialog:t=>e({showMCPDialog:t}),setShowWorkspacePermissions:t=>e({showWorkspacePermissions:t}),chatFinishSoundEnabled:Is(Ps,!0),permissionSoundEnabled:Is(Fs,!0),setChatFinishSoundEnabled:t=>{typeof window<`u`&&localStorage.setItem(Ps,String(t)),e({chatFinishSoundEnabled:t})},setPermissionSoundEnabled:t=>{typeof window<`u`&&localStorage.setItem(Fs,String(t)),e({permissionSoundEnabled:t})},filePreviewTarget:null,openFilePreview:t=>e({filePreviewTarget:t}),closeFilePreview:()=>e({filePreviewTarget:null}),autoApproveBySession:Rs(),setAutoApproveMaxSeverity:(t,n)=>e(e=>{let r={...e.autoApproveBySession};return r[t]=n,zs(r),{autoApproveBySession:r}}),getAutoApproveMaxSeverity:e=>Bs.getState().autoApproveBySession[e]??null})),Vs=b(e=>({connected:!1,authError:null,connectionTimedOut:!1,retryCount:0,nextRetryIn:0,streamingSessionIds:new Set,interruptedSessions:new Set,setConnected:t=>e({connected:t}),setAuthError:t=>e({authError:t}),setConnectionTimedOut:t=>e({connectionTimedOut:t}),setRetryCount:t=>e(e=>({retryCount:typeof t==`function`?t(e.retryCount):t})),setNextRetryIn:t=>e(e=>({nextRetryIn:typeof t==`function`?t(e.nextRetryIn):t})),resetConnection:()=>e({connected:!1,authError:null,connectionTimedOut:!1,retryCount:0,nextRetryIn:0,streamingSessionIds:new Set,interruptedSessions:new Set}),clearStreamingSessions:()=>e({streamingSessionIds:new Set}),addStreamingSession:t=>e(e=>{if(e.streamingSessionIds.has(t))return e;let n=new Set(e.streamingSessionIds);return n.add(t),{streamingSessionIds:n}}),removeStreamingSession:t=>e(e=>{if(!e.streamingSessionIds.has(t))return e;let n=new Set(e.streamingSessionIds);return n.delete(t),{streamingSessionIds:n}}),replaceStreamingSessions:t=>e({streamingSessionIds:t instanceof Set?t:new Set(t)}),addInterruptedSession:t=>e(e=>{if(e.interruptedSessions.has(t))return e;let n=new Set(e.interruptedSessions);return n.add(t),{interruptedSessions:n}}),removeInterruptedSession:t=>e(e=>{if(!e.interruptedSessions.has(t))return e;let n=new Set(e.interruptedSessions);return n.delete(t),{interruptedSessions:n}}),clearInterruptedSessions:()=>e({interruptedSessions:new Set})})),$={sessions:{all:[`sessions`],byWorkspace:e=>[`sessions`,`workspace`,e],grouped:(e,t)=>[`sessions`,`grouped`,{workspaceIds:[...e].sort(),status:t}]},tools:{all:[`tools`],envVars:[`tools`,`envVars`]},config:{models:[`config`,`models`],preconfigs:[`config`,`preconfigs`],prompts:[`config`,`prompts`],providers:{all:[`providers`],credentials:[`providers`,`credentials`]},responseFormats:[`config`,`responseFormats`]},mcp:{status:e=>[`mcp`,`status`,e]},files:{browse:(e,t,n)=>[`files`,`browse`,e,t??`.`,n],browseFs:e=>[`files`,`browseFs`,e],drives:[`files`,`drives`],parent:e=>[`files`,`parent`,e],preview:(e,t)=>[`files`,`preview`,e,t]},serverInfo:[`serverInfo`],pinnedMessages:{byWorkspace:e=>[`pinnedMessages`,`workspace`,e]}},Hs=640,Us=1280;function Ws(){let e=(0,Q.c)(2),[t,n]=L.useState(Gs),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${Hs-1}px)`),t=()=>{n(window.innerWidth<Hs)};return e.addEventListener(`change`,t),n(window.innerWidth<Hs),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),L.useEffect(r,i),t}function Gs(){return typeof window<`u`?window.innerWidth<Hs:!1}function Ks(){let e=(0,Q.c)(2),[t,n]=L.useState(qs),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${Us-1}px)`),t=()=>{n(window.innerWidth<Us)};return e.addEventListener(`change`,t),n(window.innerWidth<Us),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),L.useEffect(r,i),t}function qs(){return typeof window<`u`?window.innerWidth<Us:!1}function Js(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=F(`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`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,I.jsx)(`input`,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function Ys(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=F(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,I.jsx)(zo,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function Xs(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,I.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Zs(e){let t=(0,Q.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({delayDuration:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?0:r,a;return t[3]!==i||t[4]!==n?(a=(0,I.jsx)(bs,{"data-slot":`tooltip-provider`,delayDuration:i,...n}),t[3]=i,t[4]=n,t[5]=a):a=t[5],a}function Qs(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(xs,{"data-slot":`tooltip`,...n}),t[2]=n,t[3]=r),r}function $s(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(Ss,{"data-slot":`tooltip-trigger`,...n}),t[2]=n,t[3]=r),r}function ec(e){let t=(0,Q.c)(16),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,sideOffset:a,showArrow:o,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?0:a,c=o===void 0?!0:o,l;t[6]===r?l=t[7]:(l=F(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **: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`,r),t[6]=r,t[7]=l);let u;t[8]===c?u=t[9]:(u=c&&(0,I.jsx)(Ts,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`}),t[8]=c,t[9]=u);let d;return t[10]!==n||t[11]!==i||t[12]!==s||t[13]!==l||t[14]!==u?(d=(0,I.jsx)(Cs,{children:(0,I.jsxs)(ws,{"data-slot":`tooltip-content`,sideOffset:s,className:l,...i,children:[n,u]})}),t[10]=n,t[11]=i,t[12]=s,t[13]=l,t[14]=u,t[15]=d):d=t[15],d}function tc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(To,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function nc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(Eo,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function rc(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=F(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden 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`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,I.jsx)(Do,{children:(0,I.jsx)(Oo,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ic(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=F(`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 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-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`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,I.jsx)(Ao,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function ac(e){let t=(0,Q.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=F(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,I.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,I.jsx)(Mo,{children:(0,I.jsx)(Re,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,I.jsxs)(jo,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function oc(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=F(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,I.jsx)(ko,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function sc(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=F(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,I.jsx)(No,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(ut,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function lc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(at,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function uc(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,I.jsx)(st,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function dc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function fc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.tools.listEnvVars(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function pc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{key:n,value:r}=t;return e.http.tools.setEnvVar(n,{value:r})},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function mc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.tools.clearEnvVar(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.tools.envVars})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function hc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.models.get(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}async function gc(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>e.runtimeStatus?.usable);C.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData($.config.models,n)}function _c(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.createProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function vc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.updateProvider(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function yc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.deleteProvider(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function bc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,body:r}=t;return e.http.config.models.createModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function xc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r,body:i}=t;return e.http.config.models.updateModel(n,r,i)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Sc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{providerId:n,modelId:r}=t;return e.http.config.models.deleteModel(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Cc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.setDefaults(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function wc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.models.sync(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&gc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Tc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.preconfigs.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}async function Ec(e,t){let n=await e.http.preconfigs.list();C.getState().updatePreconfigs(n.preconfigs),t.setQueryData($.config.preconfigs,n)}function Dc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Ec(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Oc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.preconfigs.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Ec(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function kc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.preconfigs.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&Ec(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Ac(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.config.prompts.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}async function jc(e,t){let n=await e.http.config.prompts.list();C.getState().updatePrompts(n.prompts),t.setQueryData($.config.prompts,n)}function Mc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.create(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&jc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Nc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{name:n,body:r}=t;return e.http.config.prompts.update(n,r)},t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&jc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Pc(e){let t=(0,Q.c)(8),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.config.prompts.delete(t),t[0]=e,t[1]=r);let i;t[2]!==n||t[3]!==e?(i=()=>{e&&jc(e,n)},t[2]=n,t[3]=e,t[4]=i):i=t[4];let a;return t[5]!==r||t[6]!==i?(a={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=a):a=t[7],z(a)}function Fc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function Ic(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.providers.listCredentials(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function Lc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.connect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Rc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.disconnect(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.all})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function zc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{provider:n,body:r}=t;return e.http.providers.setCredential(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Bc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.providers.clearCredential(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.providers.credentials})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Vc(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=$.mcp.status(t??``),n[0]=t,n[1]=r);let i;n[2]!==e||n[3]!==t?(i=()=>e.http.mcp.getStatus(t),n[2]=e,n[3]=t,n[4]=i):i=n[4];let a=!!e&&!!t,o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,queryFn:i,enabled:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],R(o)}function Hc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.connect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:$.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Uc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.disconnect(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=(e,t)=>{let{workspaceId:r}=t;n.invalidateQueries({queryKey:$.mcp.status(r)})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Wc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n={mutationFn:t=>{let{workspaceId:n,name:r}=t;return e.http.mcp.startAuth(n,r)}},t[0]=e,t[1]=n),z(n)}function Gc(e,t,n,r,i){let a=(0,Q.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=$.files.browse(t??``,n,r),a[0]=r,a[1]=n,a[2]=t,a[3]=o):o=a[3];let s;a[4]!==r||a[5]!==n||a[6]!==e||a[7]!==t?(s=()=>e.http.files.browse(t,n,r),a[4]=r,a[5]=n,a[6]=e,a[7]=t,a[8]=s):s=a[8];let c=!!e&&!!t&&(i??!0),l;return a[9]!==o||a[10]!==s||a[11]!==c?(l={queryKey:o,queryFn:s,enabled:c},a[9]=o,a[10]=s,a[11]=c,a[12]=l):l=a[12],R(l)}function Kc(e,t,n){let r=(0,Q.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=$.files.browseFs(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.browseFs(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],R(c)}function qc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.files.drives(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function Jc(e,t,n){let r=(0,Q.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=$.files.parent(t),r[0]=t,r[1]=a);let o;r[2]!==t||r[3]!==e?(o=()=>e.http.files.parent(t),r[2]=t,r[3]=e,r[4]=o):o=r[4];let s=!!e&&i,c;return r[5]!==a||r[6]!==o||r[7]!==s?(c={queryKey:a,queryFn:o,enabled:s},r[5]=a,r[6]=o,r[7]=s,r[8]=c):c=r[8],R(c)}function Yc(e,t,n,r){let i=(0,Q.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=$.files.preview(t??``,n??``),i[0]=n,i[1]=t,i[2]=o):o=i[2];let s;i[3]!==n||i[4]!==e||i[5]!==t?(s=()=>e.http.files.preview(t,n),i[3]=n,i[4]=e,i[5]=t,i[6]=s):s=i[6];let c=!!e&&!!t&&!!n&&a,l;return i[7]!==o||i[8]!==s||i[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},i[7]=o,i[8]=s,i[9]=c,i[10]=l):l=i[10],R(l)}function Xc(e){let t=(0,Q.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.http.responseFormats.list(),t[0]=e,t[1]=n);let r=!!e,i;return t[2]!==n||t[3]!==r?(i={queryKey:$.config.responseFormats,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],R(i)}function Zc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.responseFormats.create(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function Qc(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>{let{id:n,body:r}=t;return e.http.responseFormats.update(n,r)},t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function $c(e){let t=(0,Q.c)(7),n=f(),r;t[0]===e?r=t[1]:(r=t=>e.http.responseFormats.delete(t),t[0]=e,t[1]=r);let i;t[2]===n?i=t[3]:(i=()=>{n.invalidateQueries({queryKey:$.config.responseFormats})},t[2]=n,t[3]=i);let a;return t[4]!==r||t[5]!==i?(a={mutationFn:r,onSuccess:i},t[4]=r,t[5]=i,t[6]=a):a=t[6],z(a)}function el(e,t){let n=(0,Q.c)(9),r;n[0]===t?r=n[1]:(r=t?$.pinnedMessages.byWorkspace(t):[`pinnedMessages`,`workspace`,`none`],n[0]=t,n[1]=r);let i=!!e&&!!t,a;n[2]!==e||n[3]!==t?(a=async()=>{if(!e||!t)throw Error(`Not connected`);return(await e.http.workspaces.listPinnedMessages(t)).pinnedMessages},n[2]=e,n[3]=t,n[4]=a):a=n[4];let o;return n[5]!==r||n[6]!==i||n[7]!==a?(o={queryKey:r,enabled:i,queryFn:a},n[5]=r,n[6]=i,n[7]=a,n[8]=o):o=n[8],R(o)}function tl(e,t){let n=(0,Q.c)(9),r=f(),i;n[0]!==e||n[1]!==t?(i=async n=>{if(!e||!t)throw Error(`Not connected`);return e.http.workspaces.pinMessage(t,n)},n[0]=e,n[1]=t,n[2]=i):i=n[2];let a;n[3]!==r||n[4]!==t?(a=()=>{t&&r.invalidateQueries({queryKey:$.pinnedMessages.byWorkspace(t)})},n[3]=r,n[4]=t,n[5]=a):a=n[5];let o;return n[6]!==i||n[7]!==a?(o={mutationFn:i,onSuccess:a},n[6]=i,n[7]=a,n[8]=o):o=n[8],z(o)}function nl(e,t){let n=(0,Q.c)(9),r=f(),i;n[0]!==e||n[1]!==t?(i=async n=>{let{messageId:r}=n;if(!e||!t)throw Error(`Not connected`);return e.http.workspaces.unpinMessage(t,r)},n[0]=e,n[1]=t,n[2]=i):i=n[2];let a;n[3]!==r||n[4]!==t?(a=()=>{t&&r.invalidateQueries({queryKey:$.pinnedMessages.byWorkspace(t)})},n[3]=r,n[4]=t,n[5]=a):a=n[5];let o;return n[6]!==i||n[7]!==a?(o={mutationFn:i,onSuccess:a},n[6]=i,n[7]=a,n[8]=o):o=n[8],z(o)}var rl=ce(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function il(e){let t=(0,Q.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,asChild:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a!==void 0&&a?ne:`span`,c;t[5]!==n||t[6]!==o?(c=F(rl({variant:o}),n),t[5]=n,t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==s||t[9]!==r||t[10]!==c||t[11]!==o?(l=(0,I.jsx)(s,{"data-slot":`badge`,"data-variant":o,className:c,...r}),t[8]=s,t[9]=r,t[10]=c,t[11]=o,t[12]=l):l=t[12],l}export{sc as $,Tc as A,ft as At,vc as B,Re as Bt,zc as C,Br as Ct,Nc as D,Cr as Dt,Ac as E,zr as Et,yc as F,Ue as Ft,cc as G,Le as Gt,fc as H,Ie as Ht,hc as I,He as It,tc as J,uc as K,R as Kt,Cc as L,Ve as Lt,bc as M,qe as Mt,_c as N,Ge as Nt,Dc as O,mt as Ot,Sc as P,We as Pt,oc as Q,wc as R,Be as Rt,Fc as S,Xr as St,Pc as T,Vr as Tt,pc as U,Pe as Ut,mc as V,Fe as Vt,dc as W,Ne as Wt,rc as X,ac as Y,ic as Z,Vc as _,As as _t,Zc as a,Xs as at,Rc as b,li as bt,Qc as c,Ks as ct,qc as d,Vs as dt,nc as et,Jc as f,Bs as ft,Wc as g,ks as gt,Uc as h,Ms as ht,nl as i,$s as it,Oc as j,Ze as jt,kc as k,pt as kt,Kc as l,Ws as lt,Hc as m,js as mt,tl as n,ec as nt,$c as o,Ys as ot,Yc as p,Ns as pt,lc as q,el as r,Zs as rt,Xc as s,Js as st,il as t,Qs as tt,Gc as u,$ as ut,Bc as v,Os as vt,Mc as w,Hr as wt,Ic as x,ci as xt,Lc as y,Ds as yt,xc as z,ze as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./jsx-runtime-CoWo_Ex4.js";import{A as n,D as r,b as i,c as a,d as o,g as s,h as c,i as l,j as u,m as d,o as f,u as p,v as m,w as h,x as g,y as _}from"./serverDataStore-CvTJtC_B.js";import{a as v}from"./Match-BqRw2YHq.js";var y=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new f({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=b(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=b(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){o.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>m(t,e))}findAll(e={}){return this.getAll().filter(t=>m(e,t))}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function b(e){return e.options.scope?.id}var x=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??s(r,t),o=this.get(i);return o||(o=new a({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){o.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>_(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>_(e,t)):t}notify(e){o.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},S=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new x,this.#t=e.mutationCache||new y,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(h(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=d(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return o.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;o.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return o.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=o.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(i).catch(i)}invalidateQueries(e,t={}){return o.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=o.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(h(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return p.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(c(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(c(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=s(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===r&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},C=e(),w=t(),T=new S({defaultOptions:{queries:{staleTime:3e4,gcTime:5*6e4,retry:2,refetchOnWindowFocus:!1}}});function E(e){let t=(0,C.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,w.jsx)(l,{client:T,children:n}),t[0]=n,t[1]=r),r}function D(e){return v({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}var O=class{constructor(e){this.http=e}async list(e){return this.http.get(`/sessions`,{params:e?.status?{status:e.status}:void 0,signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/sessions`,n,{signal:t})}async get(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/sessions/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/sessions/${encodeURIComponent(e)}`,{signal:t?.signal})}async listMessages(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/messages`,{signal:t?.signal})}async listGrouped(e){let t={workspaceIds:e.workspaceIds.join(`,`)};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/sessions/grouped`,{params:t,signal:e.signal})}async listByWorkspace(e){let t={};return e.status&&(t.status=e.status),e.rootOnly&&(t.rootOnly=`true`),this.http.get(`/workspaces/${encodeURIComponent(e.workspaceId)}/sessions`,{params:t,signal:e.signal})}},k=class{constructor(e){this.http=e}async list(e){return this.http.get(`/workspaces`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/workspaces`,n,{signal:t})}async get(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.patch(`/workspaces/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/workspaces/${encodeURIComponent(e)}`,{signal:t?.signal})}async listSessions(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/sessions`,{signal:t?.signal})}async listPinnedMessages(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,{signal:t?.signal})}async pinMessage(e,t,n){return this.http.post(`/workspaces/${encodeURIComponent(e)}/pinned-messages`,t,{signal:n?.signal})}async unpinMessage(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/pinned-messages/${encodeURIComponent(t)}`,{signal:n?.signal})}},A=class{constructor(e){this.http=e}async list(e){return this.http.get(`/models`,{signal:e?.signal})}},j=class{constructor(e){this.http=e}async list(e){return this.http.get(`/tools`,{signal:e?.signal})}async get(e,t){return this.http.get(`/tools/${encodeURIComponent(e)}`,{signal:t?.signal})}async listEnvVars(e){return this.http.get(`/tools/env`,{signal:e?.signal})}async setEnvVar(e,t,n){return this.http.put(`/tools/env/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearEnvVar(e,t){return this.http.delete(`/tools/env/${encodeURIComponent(e)}`,{signal:t?.signal})}},M=class{constructor(e){this.http=e}async list(e){return this.http.get(`/providers`,{signal:e?.signal})}async getStatus(e,t){return this.http.get(`/providers/${encodeURIComponent(e)}/status`,{signal:t?.signal})}async connect(e,t){return this.http.post(`/providers/${encodeURIComponent(e)}/connect`,void 0,{signal:t?.signal})}async disconnect(e,t){return this.http.delete(`/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async listCredentials(e){return this.http.get(`/config/providers`,{signal:e?.signal})}async setCredential(e,t,n){return this.http.put(`/config/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async clearCredential(e,t){return this.http.delete(`/config/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}},N=class{constructor(e){this.http=e}async list(e){return this.http.get(`/preconfigs`,{signal:e?.signal})}async create(e){let{signal:t,...n}=e??{};return this.http.post(`/preconfigs`,n,{signal:t})}async get(e,t){return this.http.get(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/preconfigs/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/preconfigs/${encodeURIComponent(e)}`,{signal:t?.signal})}},P=class{constructor(e){this.http=e}async list(e){return this.http.get(`/prompts`,{signal:e?.signal})}},F=class{constructor(e){this.http=e}async browse(e,t,n){let r={};return t!==void 0&&(r.path=t),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),n?.limit!==void 0&&(r.limit=String(n.limit)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:Object.keys(r).length>0?r:void 0,signal:n?.signal})}async search(e,t,n){let r={search:t};return n?.limit!==void 0&&(r.limit=String(n.limit)),n?.showHidden!==void 0&&(r.showHidden=String(n.showHidden)),this.http.get(`/workspaces/${encodeURIComponent(e)}/files`,{params:r,signal:n?.signal})}async preview(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/file-preview`,{params:{path:t},signal:n?.signal})}async browseFs(e,t){return this.http.get(`/fs/browse`,{params:e===void 0?void 0:{path:e},signal:t?.signal})}async parent(e,t){return this.http.get(`/fs/parent`,{params:{path:e},signal:t?.signal})}async drives(e){return this.http.get(`/fs/drives`,{signal:e?.signal})}},I=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/sessions/${encodeURIComponent(e)}/attachments`,{signal:t?.signal})}async upload(e,t,n){let r=new FormData;r.append(`file`,t);let{signal:i}=n??{};return this.http.post(`/sessions/${encodeURIComponent(e)}/attachments`,r,{signal:i})}getUrl(e,t,n){return`/api/sessions/${encodeURIComponent(e)}/attachments/${encodeURIComponent(t)}/content?key=${encodeURIComponent(n)}`}},L=class{constructor(e){this.http=e}async list(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals`,{signal:t?.signal})}async create(e,t){let{signal:n,body:r}=t??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/terminals`,r??{},{signal:n})}async get(e,t,n){return this.http.get(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}async delete(e,t,n){return this.http.delete(`/workspaces/${encodeURIComponent(e)}/terminals/${encodeURIComponent(t)}`,{signal:n?.signal})}},R=class{constructor(e){this.http=e}async getStatus(e,t){return this.http.get(`/workspaces/${encodeURIComponent(e)}/mcp/status`,{signal:t?.signal})}async connect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/connect`,{name:t},{signal:r})}async disconnect(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/disconnect`,{name:t},{signal:r})}async startAuth(e,t,n){let{signal:r}=n??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth`,{name:t},{signal:r})}async finishAuth(e,t,n,r){let{signal:i}=r??{};return this.http.post(`/workspaces/${encodeURIComponent(e)}/mcp/auth/callback`,{name:t,code:n},{signal:i})}},z=class{constructor(e){this.http=e}async get(e){return this.http.get(`/config/models`,{signal:e?.signal})}async createProvider(e,t){return this.http.post(`/config/models/providers`,e,{signal:t?.signal})}async updateProvider(e,t,n){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async deleteProvider(e,t){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}`,{signal:t?.signal})}async createModel(e,t,n){return this.http.post(`/config/models/providers/${encodeURIComponent(e)}/models`,t,{signal:n?.signal})}async updateModel(e,t,n,r){return this.http.put(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,n,{signal:r?.signal})}async deleteModel(e,t,n){return this.http.delete(`/config/models/providers/${encodeURIComponent(e)}/models/${encodeURIComponent(t)}`,{signal:n?.signal})}async setDefaults(e,t){return this.http.put(`/config/models/defaults`,e,{signal:t?.signal})}async sync(e=`merge`,t){return this.http.post(`/config/models/sync`,{mode:e},{signal:t?.signal})}},B=class{constructor(e){this.http=e}async list(e){return this.http.get(`/config/prompts`,{signal:e?.signal})}async get(e,t){return this.http.get(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e,t){return this.http.post(`/config/prompts`,e,{signal:t?.signal})}async update(e,t,n){return this.http.put(`/config/prompts/${encodeURIComponent(e)}`,t,{signal:n?.signal})}async delete(e,t){return this.http.delete(`/config/prompts/${encodeURIComponent(e)}`,{signal:t?.signal})}},V=class{models;prompts;constructor(e){this.models=new z(e),this.prompts=new B(e)}},H=class{constructor(e){this.http=e}async list(e){return this.http.get(`/response-formats`,{signal:e?.signal})}async get(e,t){return this.http.get(`/response-formats/${encodeURIComponent(e)}`,{signal:t?.signal})}async create(e){return this.http.post(`/response-formats`,e)}async update(e,t){return this.http.put(`/response-formats/${encodeURIComponent(e)}`,t)}async delete(e){return this.http.delete(`/response-formats/${encodeURIComponent(e)}`)}},U=class{sessions;workspaces;models;tools;providers;preconfigs;prompts;files;attachments;terminals;mcp;config;responseFormats;constructor(e){this.sessions=new O(e),this.workspaces=new k(e),this.models=new A(e),this.tools=new j(e),this.providers=new M(e),this.preconfigs=new N(e),this.prompts=new P(e),this.files=new F(e),this.attachments=new I(e),this.terminals=new L(e),this.mcp=new R(e),this.config=new V(e),this.responseFormats=new H(e)}async loadAll(e){let[t,n,r,i,a]=await Promise.all([this.workspaces.list(e),this.preconfigs.list(e),this.prompts.list(e),this.models.list(e),this.providers.list(e)]);return{workspaces:t.workspaces,preconfigs:n.preconfigs,prompts:r.prompts,models:i.models,defaultModel:i.defaultModel,defaultProvider:i.defaultProvider,providers:a.providers}}};export{T as i,D as n,E as r,U as t};
|