@jean2/client 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +15 -59
  2. package/dist/apple-touch-icon.png +0 -0
  3. package/dist/assets/ServerContext-DwL_fyZz.js +1 -0
  4. package/dist/assets/SessionContent-BtiY3mu_.js +11 -0
  5. package/dist/assets/SessionMenuButton-bQK4n-kR.js +9 -0
  6. package/dist/assets/SessionMenuButton-kHJ-D0s7.css +1 -0
  7. package/dist/assets/{ThemeProvider-Da23NPAS.js → ThemeProvider-ewislekS.js} +1 -1
  8. package/dist/assets/{_serverId-DXVl_AFQ.js → _serverId-C48-o6-u.js} +1 -1
  9. package/dist/assets/_serverId-D3aDURKI.js +11 -0
  10. package/dist/assets/_sessionId-CGhGqBYc.js +1 -0
  11. package/dist/assets/_sessionId-CvDJrnJN.js +1 -0
  12. package/dist/assets/add-server-CP5wqpVh.js +1 -0
  13. package/dist/assets/alert-DgtoQIaS.js +31 -0
  14. package/dist/assets/{archive-pL5uw9sg.js → archive-CJqmerPG.js} +1 -1
  15. package/dist/assets/arrow-left-CVfrLbQ4.js +1 -0
  16. package/dist/assets/badge-D8GOF5_2.js +1 -0
  17. package/dist/assets/button-BCE1SnDM.js +45 -0
  18. package/dist/assets/{confirmation-dialog-CFCxzDEX.js → confirmation-dialog-jz6z4bio.js} +1 -1
  19. package/dist/assets/{dialog-BNCh4KEM.js → dialog-B-f8lUpV.js} +1 -1
  20. package/dist/assets/http-namespace-DWmi6fC5.js +1 -0
  21. package/dist/assets/index-BtLxCr26.css +2 -0
  22. package/dist/assets/index-DJCUk1OY.js +10 -0
  23. package/dist/assets/mutation-BEKt1T6j.js +1 -0
  24. package/dist/assets/overview-dKJbdHqg.js +1 -0
  25. package/dist/assets/platform-C9rqh4_A.js +1 -0
  26. package/dist/assets/popover-CVyjoKPS.js +1 -0
  27. package/dist/assets/queries-BTzP-7g4.js +1 -0
  28. package/dist/assets/{react-dom-DHWV5rS5.js → react-dom-CZubyneS.js} +1 -1
  29. package/dist/assets/{refresh-cw-BYRFQSBp.js → refresh-cw-DJ3pEikS.js} +1 -1
  30. package/dist/assets/routes-g7_8LIaN.js +1 -0
  31. package/dist/assets/sidebar-lTmDketj.js +1 -0
  32. package/dist/assets/{triangle-alert-Bil68MLf.js → triangle-alert-C32xrDjH.js} +1 -1
  33. package/dist/assets/useNavigate-D0TSLH_-.js +1 -0
  34. package/dist/assets/workspace-CQqKn4Z3.js +1 -0
  35. package/dist/favicon.ico +0 -0
  36. package/dist/icon-192.png +0 -0
  37. package/dist/icon-512.png +0 -0
  38. package/dist/index.html +14 -15
  39. package/dist/manifest.webmanifest +1 -0
  40. package/dist/registerSW.js +1 -0
  41. package/dist/sw.js +1 -0
  42. package/dist/workbox-6829fd8d.js +1 -0
  43. package/package.json +1 -1
  44. package/dist/assets/ServerContext-Dy9T5Mj8.js +0 -1
  45. package/dist/assets/SessionContent-DMPPyidM.js +0 -11
  46. package/dist/assets/SessionMenuButton-B9RQW_iM.css +0 -1
  47. package/dist/assets/SessionMenuButton-DtN_qfRb.js +0 -9
  48. package/dist/assets/_serverId-BOWHyoan.js +0 -12
  49. package/dist/assets/_sessionId-BfVgqUBK.js +0 -1
  50. package/dist/assets/_sessionId-Bp7Qrc4O.js +0 -1
  51. package/dist/assets/add-server-BU3oc_j3.js +0 -1
  52. package/dist/assets/alert-BsN6ZzaK.js +0 -31
  53. package/dist/assets/arrow-left-DSvwF2mY.js +0 -1
  54. package/dist/assets/badge-Cjebg6Sp.js +0 -1
  55. package/dist/assets/button--1wnt03c.js +0 -45
  56. package/dist/assets/classPrivateFieldGet2-BGlEuFdn.js +0 -1
  57. package/dist/assets/core-BYcrozIP.js +0 -1
  58. package/dist/assets/dist-js-s36UjyQ4.js +0 -1
  59. package/dist/assets/event-Crr43Eih.js +0 -1
  60. package/dist/assets/index-Db3JxRbZ.js +0 -10
  61. package/dist/assets/index-DzEyMPKG.css +0 -2
  62. package/dist/assets/mutation-D4xtepYQ.js +0 -1
  63. package/dist/assets/overview-DbKX71kj.js +0 -1
  64. package/dist/assets/platform-cRBZ7eSy.js +0 -1
  65. package/dist/assets/popover-C8mm1NWm.js +0 -1
  66. package/dist/assets/preload-helper-D844vhe4.js +0 -1
  67. package/dist/assets/queries-C0JoQFZb.js +0 -1
  68. package/dist/assets/routes-Ck6V8B0w.js +0 -1
  69. package/dist/assets/sidebar-BqQ-fUFc.js +0 -1
  70. package/dist/assets/src-BALdofIU.js +0 -1
  71. package/dist/assets/useNavigate-Ckup4lZi.js +0 -1
  72. package/dist/assets/workspace-BzFUmInc.js +0 -1
  73. /package/dist/assets/{createLucideIcon-CuVT3KNW.js → createLucideIcon-mdFRYmiK.js} +0 -0
  74. /package/dist/assets/{overview-C91MPxfo.js → overview-B_ZDrH1J.js} +0 -0
  75. /package/dist/assets/{useRouter-C67ywEA3.js → useRouter-C_VHQC31.js} +0 -0
  76. /package/dist/assets/{workspace-84xYPx6s.js → workspace-_n12Hx4o.js} +0 -0
@@ -0,0 +1 @@
1
+ import{i as e,n as t,o as n,r}from"./compiler-runtime-DZXZ41-q.js";import{f as i}from"./ServerContext-DwL_fyZz.js";import{t as a}from"./useRouter-C_VHQC31.js";var o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},s=new class extends o{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){return typeof e==`function`?e(t):e}function v(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==b(o,t.options))return!1}else if(!S(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function y(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(x(t.options.mutationKey)!==x(a))return!1}else if(!S(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function b(e,t){return(t?.queryKeyHashFn||x)(e)}function x(e){return JSON.stringify(e,(e,t)=>T(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function S(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>S(e[n],t[n])):!1}var C=Object.prototype.hasOwnProperty;function w(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(T(e)&&T(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:C.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=w(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ee(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function T(e){if(!ne(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ne(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ne(e){return Object.prototype.toString.call(e)===`[object Object]`}function re(e){return new Promise(t=>{l.setTimeout(t,e)})}function ie(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:w(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var se=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var de=(()=>{let e=()=>d;return{isServer(){return e()},setIsServer(t){e=t}}})();function fe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var pe=u;function me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var he=me(),ge=new class extends o{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _e(e){return Math.min(1e3*2**e,3e4)}function ve(e){return(e??`online`)===`online`?ge.isOnline():!0}var ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function be(e){let t=!1,n=0,r,i=fe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ye(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>s.isFocused()&&(e.networkMode===`always`||ge.isOnline())&&e.canRun(),d=()=>ve(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||u())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(de.isServer()?0:3),o=e.retryDelay??_e,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),re(s).then(()=>u()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?h():m().then(h),i)}}var xe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(de.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function Se(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ue(e,()=>t.signal,()=>n=!0)},u=ce(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?oe:ae;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?we:Ce,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ce(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ce(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function we(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Te=class extends xe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Oe(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Oe(this.options);e.data!==void 0&&(this.setState(De(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ie(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>_(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>g(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ce(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Se(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=be({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ye&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ye){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ee(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...De(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),he.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ee(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ve(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function De(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Oe(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var E=n(r(),1),D=t(),ke=E.createContext(void 0),Ae=e=>{let t=E.useContext(ke);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},je=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,D.jsx)(ke.Provider,{value:e,children:t}));function O(e){return e[e.length-1]}function Me(e){return typeof e==`function`}function k(e,t){return Me(e)?e(t):e}var Ne=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Fe=()=>Object.create(null),A=(e,t)=>j(e,t,Fe);function j(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=Re(e)&&Re(i);if(!a&&!(M(e)&&M(i)))return i;let o=a?e:Ie(e);if(!o)return i;let s=a?i:Ie(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Ne.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=j(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Ie(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!Pe.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!Pe.call(e,t))return!1;r.push(t)}return r}function M(e){if(!Le(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Le(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Le(e){return Object.prototype.toString.call(e)===`[object Object]`}function Re(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!N(e[r],t[r],n))return!1;return!0}if(M(e)&&M(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!N(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!N(e[o],t[o],n)))return!1;return i===a}return!1}function P(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function ze(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function Be(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Ve(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function He(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Ve(t)}var Ue=[`http:`,`https:`,`mailto:`,`tel:`];function We(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ge(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=He(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=He(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ke(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function qe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function F(){throw Error(`Invariant failed`)}function I(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var L=4,Je=5;function Ye(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Xe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Ye(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Ze(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Xe(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=z(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=z(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=$e(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=$e(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=$e(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=z(n.fullPath??n.from);e.kind=Je,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=z(n.fullPath??n.from);e.kind=L,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Ze(e,t,r,s,i,a,o)}function Qe(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function R(e){if(e.pathless)for(let t of e.pathless)R(t);if(e.static)for(let t of e.static.values())R(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())R(t);if(e.dynamic?.length){e.dynamic.sort(Qe);for(let t of e.dynamic)R(t)}if(e.optional?.length){e.optional.sort(Qe);for(let t of e.optional)R(t)}if(e.wildcard?.length){e.wildcard.sort(Qe);for(let t of e.wildcard)R(t)}}function z(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function $e(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function et(e,t){let n=z(`/`),r=new Uint16Array(6);for(let t of e)Ze(!1,r,t,1,n,0);R(n),t.masksTree=n,t.flatCache=I(1e3)}function tt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ot(e,t.masksTree);return t.flatCache.set(e,r),r}function nt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=z(`/`),Ze(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ot(r,o,n)}function rt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ot(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ct(a.route)),t.matchCache.set(r,a),a}function it(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function at(e,t=!1,n){let r=z(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Ze(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&F(),a[e.id]=e,s!==0&&e.path){let t=it(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),R(r),{processedTree:{segmentTree:r,singleCache:I(1e3),matchCache:I(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ot(e,t,n=!1){let r=e.split(`/`),i=ut(e,r,t,n);if(!i)return null;let[a]=st(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function st(e,t,n){let r=lt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===L)break;if(u.kind===Je){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ct(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function lt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function ut(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!O(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!dt(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==L&&B(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&B(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(dt(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;B(u,n)&&(u=n)}}if(i.wildcard&&B(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!dt(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return B(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function dt(e,t,n){try{let[r,i]=st(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function B(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===L)>(e.node.kind===L)||t.node.kind===L==(e.node.kind===L)&&t.depth>e.depth))):!0}function ft(e){return pt(e.filter(e=>e!==void 0).join(`/`))}function pt(e){return e.replace(/\/{2,}/g,`/`)}function mt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function V(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ht(e){return V(mt(e))}function gt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function _t(e,t,n){return gt(e,n)===gt(t,n)}function vt({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&O(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(O(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Xe(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=pt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function yt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function bt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>St(e,n)).join(`/`):St(r,n):r}function xt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Xe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=bt(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=bt(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=bt(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function St(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function H(e){return!!e?.isNotFound}function Ct(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var wt=`tsr-scroll-restoration-v1_3`;function Tt(){let e=Ct();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);M(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=k(e,t)||t},persist:()=>{try{e.setItem(wt,JSON.stringify(t))}catch{}}}}var Et=Tt(),Dt=e=>e.state.__TSR_key||e.href;function Ot(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var kt=!1,U=`window`,At=`data-scroll-restoration-id`;function jt(e,t){if(!Et)return;let n=Et;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,kt=!1;let r=e.options.getScrollRestorationKey||Dt,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(kt||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(U,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===U)n=U;else if(e.isConnected){let t=e.getAttribute(At);n=t?`[${At}="${t}"]`:Ot(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.state??e.stores.location.state)),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){kt=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!M(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===U)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===U)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{kt=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function Mt(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Nt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Pt(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Nt(r):Array.isArray(t)?t.push(Nt(r)):n[e]=[t,Nt(r)]}return n}var Ft=Lt(JSON.parse),It=Rt(JSON.stringify,JSON.parse);function Lt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Pt(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Rt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Mt(e,r);return t?`?${t}`:``}}var zt=`__root__`;function Bt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function W(e){return e instanceof Response&&!!e.options}function Vt(e){return{input:({url:t})=>{for(let n of e)t=Ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Wt(e[n],t);return t}}}function Ht(e){let t=ht(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=ft([`/`,t,e.pathname]),e)}}function Ut(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Wt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Gt(e){let t=e;return{get state(){return t},setState(e){t=e(t)}}}function Kt(e){return{get state(){return e()}}}function qt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Jt(o,_.state)),x=r(()=>Jt(s,v.state)),S=r(()=>Jt(c,y.state)),C=r(()=>_.state[0]),w=r(()=>_.state.some(e=>o.get(e)?.state.status===`pending`)),ee=r(()=>({locationHref:p.state.href,resolvedLocationHref:m.state?.href,status:l.state})),te=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),T=I(64);function ne(e){let t=T.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),T.set(e,t)),t}let re={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:w,matchRouteReactivity:ee,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:te,getMatchStoreByRouteId:ne,setActiveMatches:ie,setPendingMatches:ae,setCachedMatches:oe};ie(e.matches),a?.(re);function ie(e){Yt(e,o,_,n,i)}function ae(e){Yt(e,s,v,n,i)}function oe(e){Yt(e,c,y,n,i)}return re}function Jt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}return n}function Yt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.state!==n&&e.setState(()=>n)}qe(n.state,a)||n.setState(()=>a)})}var Xt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Zt=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),Qt=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),G=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},$t=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},K=(e,t,n)=>{if(!(!W(n)&&!H(n)))throw W(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:W(n)?`redirected`:r.status===`pending`?`success`:r.status,context:G(e,t.index),isFetching:!1,error:n})),H(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),W(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},en=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},tn=(e,t,n)=>{let r=G(e,n);e.updateMatch(t,e=>({...e,context:r}))},q=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,K(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,K(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!W(n)&&!H(n)&&(e.serialError??=n)},nn=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Qt(e,t)&&(n.options.loader||n.options.beforeLoad||pn(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Xt(e)},i);r._nonReactive.pendingTimeout=t}},rn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;nn(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&K(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},an=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=P(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&q(e,n,o,`PARSE_PARAMS`),s&&q(e,n,s,`VALIDATE_SEARCH`),nn(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=P();let f={...G(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Qt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(W(r)||H(r))&&(u(),q(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),Be(y))return u(),y.catch(t=>{q(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),q(e,n,t,`BEFORE_LOAD`)}v(y)},on=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>an(e,n,t,i),s=()=>{if(en(e,n))return;let t=rn(e,n,i);return Be(t)?t.then(o):o()};return a()},sn=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},cn=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=G(e,r),d=Qt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},ln=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{J(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(cn(e,t,n,r,i)),l=!!s&&Be(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;K(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:G(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:G(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,H(t)&&await i.options.notFoundComponent?.preload?.(),K(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,K(e,e.router.getMatch(n),t)}!W(o)&&!H(o)&&await J(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:G(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),K(e,r,t)}},un=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(cn(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await ln(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){W(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await ln(e,t,i,n,d):tn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(en(e,i)){if(!e.router.getMatch(i))return e.matches[n];tn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.state[n],s=(o&&e.router.stores.activeMatchStoresById.get(o)||null)?.routeId===a?o:e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===a)?.id,l=Qt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&K(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.activeMatchStoresById.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=P(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function dn(e){let t=e,n=[];Zt(t.router)&&Xt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=on(t,e);Be(n)&&await n}catch(e){if(W(e))throw e;if(H(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?$t(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(un(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(W(e))throw e;H(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=$t(t,l);e===void 0&&F();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await J(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await J(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=sn(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Xt(t);if(Be(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function fn(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function J(e,t=mn){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===mn?(()=>{if(e._componentsPromise===void 0){let t=fn(e,mn);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():fn(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function pn(e){for(let t of mn)if(e.options[t]?.preload)return!0;return!1}var mn=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],Y=`__TSR_index`,hn=`popstate`,gn=`beforeunload`;function _n(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=X(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[Y];i=vn(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[Y];i=vn(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[Y]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function vn(e,t){t||={};let n=Sn();return{...t,key:n,__TSR_key:n,[Y]:e}}function yn(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>X(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Sn();t.history.replaceState({[Y]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=X(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[Y]-l.state[Y],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=_n({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(gn,S,{capture:!0}),t.removeEventListener(hn,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(gn,S,{capture:!0}),t.addEventListener(hn,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function bn(e){let t=e?.window??(typeof document<`u`?window:void 0);return yn({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return X(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function xn(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function X(e,t){let n=xn(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Sn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[Y]:0,key:a,__TSR_key:a}}}function Sn(){return(Math.random()+1).toString(36).substring(7)}function Cn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var wn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=yt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=yn()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=I(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=qt(Dn(this.latestLocation),e),jt(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=ht(o);t&&t!==`/`&&e.push(Ht({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Vt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=at(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&et(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:Ge(e).path,external:!1,searchStr:o,search:A(t?.search,i),hash:Ge(r.slice(1)).path,state:j(t?.state,a)}}let o=new URL(i,this.origin),s=Ut(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Ge(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:A(t?.search,c),hash:Ge(s.hash.slice(1)).path,state:j(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>vt({base:e,to:pt(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>kn({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{if(this.stores.pendingMatchStoresById.has(e))return;let t=this.stores.activeMatchStoresById.get(e)?.state;t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,k(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:Ge(xt({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,On(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=An({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=A(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?k(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?k(t.state,n.state):{};_=j(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Wt(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=Ke(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=tt(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,k(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=N(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=V(this.latestLocation.href)===V(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=P(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=X(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Ut(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(We(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.state??this.stores.location.state;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=Cn(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await dn({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){W(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):H(e)&&(n=e);let r=t?t.status:n?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>r),this.stores.redirect.setState(()=>t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.setState(()=>a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof t.types==`function`?t.types(Cn(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>this.stores.cachedMatchStoresById.get(e)?.state??this.stores.pendingMatchStoresById.get(e)?.state??this.stores.activeMatchStoresById.get(e)?.state,this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&We(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=J,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),i=new Set([...r,...this.stores.cachedMatchesId.state]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...a])}try{return n=await dn({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(W(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});H(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.state!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,a=nt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!N(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?N(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??It,parseSearch:e.parseSearch??Ft,protocolAllowlist:e.protocolAllowlist??Ue}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:V(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?Mn(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&u.set(e.routeId,e.state);for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=On(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof Tn||(r=new Tn(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=xt({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{Nn(r,_,a,x)}catch(e){if(S=H(e)||W(e)?e:new En(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:A(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||pn(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?A(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:P()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?j(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let ee=this.getParentContext(s);w.context={...ee,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?A(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=O(t),a={...e.search};for(let e of t)try{Object.assign(a,On(e.options.validateSearch,a))}catch{}let o=O(this.stores.matchesId.state),s=o&&this.stores.activeMatchStoresById.get(o)?.state,c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{Nn(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},Tn=class extends Error{},En=class extends Error{};function Dn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function On(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Tn(`Async validation not supported`);if(n.issues)throw new Tn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function kn({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=V(e),a,o,s=rt(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function An({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return jn(n)(e,t,r??!1)}function jn(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...On(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:k(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Mn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return zt}function Nn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}function Pn(e){let t=e.errorComponent??In;return(0,D.jsx)(Fn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?E.createElement(t,{error:n,reset:r}):e.children})}var Fn=class extends E.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function In({error:e}){let[t,n]=E.useState(!1);return(0,D.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,D.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,D.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,D.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,D.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,D.jsx)(`div`,{children:(0,D.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,D.jsx)(`code`,{children:e.message}):null})}):null]})}function Ln({children:e,fallback:t=null}){return Rn()?(0,D.jsx)(E.Fragment,{children:e}):(0,D.jsx)(E.Fragment,{children:t})}function Rn(){return E.useSyncExternalStore(zn,()=>!0,()=>!1)}function zn(){return()=>{}}var Bn=E.createContext(void 0),Vn=E.createContext(void 0),Hn=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Un=e(((e,t)=>{t.exports=Hn()})),Wn=e((e=>{var t=r(),n=Un();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Gn=e(((e,t)=>{t.exports=Wn()}))();function Kn(e,t){return e===t}function Z(e,t,n=Kn){let r=(0,E.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,E.useCallback)(()=>e?.get(),[e]);return(0,Gn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var qn={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function Jn(e){let t=a(),n=E.useContext(e.from?Vn:Bn),r=e.from??n,i=r?e.from?t.stores.getMatchStoreByRouteId(r):t.stores.activeMatchStoresById.get(r):void 0,o=E.useRef(void 0);return Z(i??qn,n=>{if((e.shouldThrow??!0)&&!n&&F(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=j(o.current,r);return o.current=e,e}return r})}function Yn(e){return Jn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Xn(e){let t=a(),n=`not-found-${Z(t.stores.location,e=>e.pathname)}-${Z(t.stores.status,e=>e)}`;return(0,D.jsx)(Pn,{getResetKey:()=>n,onCatch:(t,n)=>{if(H(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(H(t))return e.fallback?.(t);throw t},children:e.children})}function Zn(){return(0,D.jsx)(`p`,{children:`Not Found`})}function Q(e){return(0,D.jsx)(D.Fragment,{children:e.children})}function Qn(e,t,n){return t.options.notFoundComponent?(0,D.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,D.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,D.jsx)(Zn,{})}var $n=E.memo(function({matchId:e}){let t=a(),n=t.stores.activeMatchStoresById.get(e);n||F();let r=Z(t.stores.loadedAt,e=>e),i=Z(n,e=>e);return(0,D.jsx)(er,{router:t,matchId:e,resetKey:r,matchState:E.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function er({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,D.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?E.Suspense:Q,f=s?Pn:Q,p=l?Xn:Q;return(0,D.jsxs)(i.isRoot?i.options.shellComponent??Q:Q,{children:[(0,D.jsx)(Bn.Provider,{value:t,children:(0,D.jsx)(d,{fallback:o,children:(0,D.jsx)(f,{getResetKey:()=>n,errorComponent:s||In,onCatch:(e,t)=>{if(H(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,D.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return E.createElement(l,e)},children:u||r._displayPending?(0,D.jsx)(Ln,{fallback:o,children:(0,D.jsx)(nr,{matchId:t})}):(0,D.jsx)(nr,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(tr,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function tr({resetKey:e}){let t=a(),n=E.useRef(void 0);return i(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Cn(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var nr=E.memo(function({matchId:e}){let t=a(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.activeMatchStoresById.get(e);r||F();let i=Z(r,e=>e),o=i.routeId,s=t.routesById[o],c=E.useMemo(()=>{let e=(t.routesById[o].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:o,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[o,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=E.useMemo(()=>{let e=s.options.component??t.options.defaultComponent;return e?(0,D.jsx)(e,{},c):(0,D.jsx)(rr,{})},[c,s.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=s.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=P();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return H(i.error)||F(),Qn(t,s,i.error);if(i.status===`redirected`)throw W(i.error)||F(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return l}),rr=E.memo(function(){let e=a(),t=E.useContext(Bn),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=Z(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=Z(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let o=n?e.routesById[n]:void 0,s=e.options.defaultPendingComponent?(0,D.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return o||F(),Qn(e,o,void 0);if(!i)return null;let c=(0,D.jsx)($n,{matchId:i});return n===`__root__`?(0,D.jsx)(E.Suspense,{fallback:s,children:c}):c}),$=null;function ir(){return $||(typeof window>`u`?($=`unknown`,$):window.__JEAN2_ELECTRON__?($=`electron`,$):($=`web`,$))}function ar(){return ir()===`electron`}function or(){return typeof navigator>`u`?!1:/Win/i.test(navigator.platform||navigator.userAgent)}export{ee as $,ze as A,fe as B,gt as C,N as D,F as E,Ee as F,m as G,p as H,xe as I,f as J,y as K,be as L,je as M,Ae as N,k as O,Te as P,g as Q,ge as R,ft as S,V as T,x as U,de as V,b as W,ie as X,S as Y,_ as Z,Gt as _,rr as a,o as at,zt as b,Jn as c,Rn as d,le as et,Pn as f,bn as g,Cn as h,$n as i,s as it,j,We as k,Z as l,wn as m,ar as n,h as nt,Q as o,In as p,v as q,or as r,l as rt,Yn as s,ir as t,se as tt,Bn as u,Kt as v,mt as w,_t as x,Bt as y,he as z};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{F as i,I as a,J as o,L as s,R as c,z as l}from"./badge-D8GOF5_2.js";import{t as u}from"./createLucideIcon-mdFRYmiK.js";import{A as d,C as f,O as p,T as m,_ as h,b as g,c as _,f as v,g as y,h as ee,j as b,l as x,m as S,n as C,o as w,p as te,r as T,u as E,w as D,x as O,y as k}from"./button-BCE1SnDM.js";import"./dialog-B-f8lUpV.js";var A=u(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),j=u(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),M=t(n(),1),N=e(),P=`Popover`,[F,ne]=D(P,[l]),I=l(),[re,L]=F(P),ie=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=I(t),l=M.useRef(null),[u,d]=M.useState(!1),[f,p]=O({prop:r,defaultProp:i??!1,onChange:a,caller:P});return(0,N.jsx)(c,{...s,children:(0,N.jsx)(re,{scope:t,contentId:k(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:M.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:M.useCallback(()=>d(!0),[]),onCustomAnchorRemove:M.useCallback(()=>d(!1),[]),modal:o,children:n})})};ie.displayName=P;var ae=`PopoverAnchor`,oe=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=L(ae,n),o=I(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=a;return M.useEffect(()=>(s(),()=>c()),[s,c]),(0,N.jsx)(i,{...o,...r,ref:t})});oe.displayName=ae;var se=`PopoverTrigger`,ce=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,a=L(se,n),o=I(n),s=b(t,a.triggerRef),c=(0,N.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":xe(a.open),...r,ref:s,onClick:f(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,N.jsx)(i,{asChild:!0,...o,children:c})});ce.displayName=se;var R=`PopoverPortal`,[le,ue]=F(R,{forceMount:void 0}),de=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=L(R,t);return(0,N.jsx)(le,{scope:t,forceMount:n,children:(0,N.jsx)(g,{present:n||a.open,children:(0,N.jsx)(ee,{asChild:!0,container:i,children:r})})})};de.displayName=R;var z=`PopoverContent`,fe=M.forwardRef((e,t)=>{let n=ue(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=L(z,e.__scopePopover);return(0,N.jsx)(g,{present:r||a.open,children:a.modal?(0,N.jsx)(me,{...i,ref:t}):(0,N.jsx)(he,{...i,ref:t})})});fe.displayName=z;var pe=p(`PopoverContent.RemoveScroll`),me=M.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),r=M.useRef(null),i=b(t,r),a=M.useRef(!1);return M.useEffect(()=>{let e=r.current;if(e)return v(e)},[]),(0,N.jsx)(te,{as:pe,allowPinchZoom:!0,children:(0,N.jsx)(ge,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:f(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),he=M.forwardRef((e,t)=>{let n=L(z,e.__scopePopover),r=M.useRef(!1),i=M.useRef(!1);return(0,N.jsx)(ge,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ge=M.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=L(z,n),m=I(n);return S(),(0,N.jsx)(y,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,N.jsx)(h,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:(0,N.jsx)(s,{"data-state":xe(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),_e=`PopoverClose`,ve=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=L(_e,n);return(0,N.jsx)(m.button,{type:`button`,...r,ref:t,onClick:f(e.onClick,()=>i.onOpenChange(!1))})});ve.displayName=_e;var ye=`PopoverArrow`,be=M.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=I(n);return(0,N.jsx)(a,{...i,...r,ref:t})});be.displayName=ye;function xe(e){return e?`open`:`closed`}var Se=ie,Ce=oe,we=ce,Te=de,Ee=fe,B=r(),De=1,Oe=.9,ke=.8,Ae=.17,V=.1,H=.999,je=.9999,Me=.99,Ne=/[\\\/_+.#"@\[\(\{&]/,Pe=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,Ie=/[\s-]/g;function Le(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?De:Me;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Le(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=De:Ne.test(e.charAt(l-1))?(d*=ke,p=e.slice(i,l-1).match(Pe),p&&i>0&&(d*=H**+p.length)):Fe.test(e.charAt(l-1))?(d*=Oe,m=e.slice(i,l-1).match(Ie),m&&i>0&&(d*=H**+m.length)):(d*=Ae,i>0&&(d*=H**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=je)),(d<V&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Le(e,t,n,r,l+1,a+2,o),f*V>d&&(d=f*V)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Re(e){return e.toLowerCase().replace(Ie,` `)}function ze(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Le(e,t,Re(e),Re(t),0,0,{})}var U=`[cmdk-group=""]`,W=`[cmdk-group-items=""]`,Be=`[cmdk-group-heading=""]`,Ve=`[cmdk-item=""]`,He=`${Ve}:not([aria-disabled="true"])`,G=`cmdk-item-select`,K=`data-value`,Ue=(e,t,n)=>ze(e,t,n),We=M.createContext(void 0),q=()=>M.useContext(We),Ge=M.createContext(void 0),J=()=>M.useContext(Ge),Ke=M.createContext(void 0),qe=M.forwardRef((e,t)=>{let n=Z(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Z(()=>new Set),i=Z(()=>new Map),a=Z(()=>new Map),o=Z(()=>new Set),s=it(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=k(),ee=k(),b=k(),x=M.useRef(null),S=ot();X(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),X(()=>{S(6,O)},[]);let C=M.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),T(),S(1,E);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,O),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=M.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,te(t,r)),S(2,()=>{T(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),T(),n.current.value||E(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{D(),t?.getAttribute(`id`)===e&&E(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:b,labelId:ee,listInnerRef:x}),[]);function te(e,t){let r=s.current?.filter??Ue;return e?r(e,n.current.search,t):0}function T(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(W);t?t.appendChild(e.parentElement===t?e:e.closest(`${W} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${W} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${U}[${K}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function E(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=te(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function O(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(U)?.querySelector(Be))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Ve}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(He)||[])}function N(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(K))}function P(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(K))}function F(e){let t=A()?.closest(U),n;for(;t&&!n;)t=e>0?nt(t,U):rt(t,U),n=t?.querySelector(He);n?C.setState(`value`,n.getAttribute(K)):P(e)}let ne=()=>N(j().length-1),I=e=>{e.preventDefault(),e.metaKey?ne():e.altKey?F(1):P(1)},re=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return M.createElement(m.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:_&&e.ctrlKey&&re(e);break;case`ArrowUp`:re(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ne();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(G);t.dispatchEvent(e)}}}}},M.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:ct},c),$(e,e=>M.createElement(Ge.Provider,{value:C},M.createElement(We.Provider,{value:w},e))))}),Je=M.forwardRef((e,t)=>{let n=k(),r=M.useRef(null),i=M.useContext(Ke),a=q(),o=it(e),s=o.current?.forceMount??i?.forceMount;X(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=at(n,r,[e.value,e.children,r],e.keywords),l=J(),u=Q(e=>e.value&&e.value===c.current),f=Q(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);M.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(G,p),()=>t.removeEventListener(G,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;h(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function h(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:g,value:_,onSelect:v,forceMount:y,keywords:ee,...b}=e;return M.createElement(m.div,{ref:d(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!g,"aria-selected":!!u,"data-disabled":!!g,"data-selected":!!u,onPointerMove:g||a.getDisablePointerSelection()?void 0:h,onClick:g?void 0:p},e.children)}),Ye=M.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=k(),s=M.useRef(null),c=M.useRef(null),l=k(),u=q(),f=Q(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);X(()=>u.group(o),[]),at(o,s,[e.value,e.heading,c]);let p=M.useMemo(()=>({id:o,forceMount:i}),[i]);return M.createElement(m.div,{ref:d(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&M.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),$(e,e=>M.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},M.createElement(Ke.Provider,{value:p},e))))}),Xe=M.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=M.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:M.createElement(m.div,{ref:d(i,t),...r,"cmdk-separator":``,role:`separator`})}),Ze=M.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=J(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=q();return M.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),M.createElement(m.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Qe=M.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=M.useRef(null),o=M.useRef(null),s=Q(e=>e.selectedItemId),c=q();return M.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),M.createElement(m.div,{ref:d(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},$(e,e=>M.createElement(`div`,{ref:d(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),$e=M.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return M.createElement(E,{open:n,onOpenChange:r},M.createElement(x,{container:o},M.createElement(_,{"cmdk-overlay":``,className:i}),M.createElement(w,{"aria-label":e.label,"cmdk-dialog":``,className:a},M.createElement(qe,{ref:t,...s}))))}),et=M.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?M.createElement(m.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),tt=M.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return M.createElement(m.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>M.createElement(`div`,{"aria-hidden":!0},e)))}),Y=Object.assign(qe,{List:Qe,Item:Je,Input:Ze,Group:Ye,Separator:Xe,Dialog:$e,Empty:et,Loading:tt});function nt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function rt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function it(e){let t=M.useRef(e);return X(()=>{t.current=e}),t}var X=typeof window>`u`?M.useEffect:M.useLayoutEffect;function Z(e){let t=M.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=J(),n=()=>e(t.snapshot());return M.useSyncExternalStore(t.subscribe,n,n)}function at(e,t,n,r=[]){let i=M.useRef(),a=q();return X(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K,s),i.current=s}),i}var ot=()=>{let[e,t]=M.useState(),n=Z(()=>new Map);return X(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function st(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&M.isValidElement(t)?M.cloneElement(st(t),{ref:t.ref},n(t.props.children)):n(t)}var ct={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function lt(e){let t=(0,B.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=T(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 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[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(`textarea`,{"data-slot":`textarea`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ut(e){let t=(0,B.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=T(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var dt=C(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function ft(e){let t=(0,B.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=T(dt({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,N.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:pt,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function pt(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}C(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function mt(e){let t=(0,B.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=T(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ht(e){let t=(0,B.c)(11),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=T(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7];let o;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,N.jsx)(ft,{children:(0,N.jsx)(j,{className:`size-4 shrink-0 opacity-50`})}),t[8]=o):o=t[8];let s;return t[9]===a?s=t[10]:(s=(0,N.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,N.jsxs)(ut,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[a,o]})}),t[9]=a,t[10]=s),s}function gt(e){let t=(0,B.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=T(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function _t(e){let t=(0,B.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=T(`py-6 text-center text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function vt(e){let t=(0,B.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=T(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yt(e){let t=(0,B.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=T(`-mx-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,N.jsx)(Y.Separator,{"data-slot":`command-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bt(e){let t=(0,B.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCheck:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?!0:a,c;t[5]===r?c=t[6]:(c=T(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,r),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=s&&(0,N.jsx)(o,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`}),t[7]=s,t[8]=l);let u;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,N.jsxs)(Y.Item,{"data-slot":`command-item`,className:c,...i,children:[n,l]}),t[9]=n,t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function xt(e){let t=(0,B.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,N.jsx)(Se,{"data-slot":`popover`,...n}),t[2]=n,t[3]=r),r}function St(e){let t=(0,B.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,N.jsx)(we,{"data-slot":`popover-trigger`,...n}),t[2]=n,t[3]=r),r}function Ct(e){let t=(0,B.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?`center`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=T(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden 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-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,N.jsx)(Te,{children:(0,N.jsx)(Ee,{"data-slot":`popover-content`,align:o,sideOffset:s,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function wt(e){let t=(0,B.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,N.jsx)(Ce,{"data-slot":`popover-anchor`,...n}),t[2]=n,t[3]=r),r}export{mt as a,ht as c,yt as d,lt as f,St as i,bt as l,A as m,wt as n,_t as o,j as p,Ct as r,vt as s,xt as t,gt as u};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{$ as i,J as a,N as o,U as s,at as c,et as l,z as u}from"./platform-C9rqh4_A.js";import{A as d,S as f}from"./sidebar-lTmDketj.js";import{n as p}from"./mutation-BEKt1T6j.js";import{O as m,V as ee}from"./badge-D8GOF5_2.js";import{t as h}from"./createLucideIcon-mdFRYmiK.js";import{C as g,S as _,T as v,b as y,j as b,r as x,v as S,w as C}from"./button-BCE1SnDM.js";var w=class extends c{#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),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&s(t.mutationKey)!==s(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??p();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){u.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)})})}},T=t(n(),1);function E(e,t){let n=o(t),[r]=T.useState(()=>new w(n,e));T.useEffect(()=>{r.setOptions(e)},[r,e]);let i=T.useSyncExternalStore(T.useCallback(e=>r.subscribe(u.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=T.useCallback((e,t)=>{r.mutate(e,t).catch(a)},[r]);if(i.error&&l(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var D=h(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]);function O(e,[t,n]){return Math.min(n,Math.max(t,e))}var k=e();function A(e,t){return T.useReducer((e,n)=>t[e][n]??e,e)}var j=`ScrollArea`,[M,te]=C(j),[ne,N]=M(j),P=T.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=T.useState(null),[l,u]=T.useState(null),[d,f]=T.useState(null),[p,m]=T.useState(null),[h,g]=T.useState(null),[_,y]=T.useState(0),[x,S]=T.useState(0),[C,w]=T.useState(!1),[E,D]=T.useState(!1),O=b(t,e=>c(e)),A=ee(i);return(0,k.jsx)(ne,{scope:n,type:r,dir:A,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:w,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:E,onScrollbarYEnabledChange:D,onCornerWidthChange:y,onCornerHeightChange:S,children:(0,k.jsx)(v.div,{dir:A,...o,ref:O,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":x+`px`,...e.style}})})});P.displayName=j;var F=`ScrollAreaViewport`,I=T.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=N(F,n),s=b(t,T.useRef(null),o.onViewportChange);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,k.jsx)(v.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,k.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});I.displayName=F;var L=`ScrollAreaScrollbar`,R=T.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=N(L,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return T.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,k.jsx)(re,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,k.jsx)(ie,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,k.jsx)(z,{...r,ref:t,forceMount:n}):i.type===`always`?(0,k.jsx)(B,{...r,ref:t}):null});R.displayName=L;var re=T.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=N(L,e.__scopeScrollArea),[a,o]=T.useState(!1);return T.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,k.jsx)(y,{present:n||a,children:(0,k.jsx)(z,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),ie=T.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=N(L,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=J(()=>c(`SCROLL_END`),100),[s,c]=A(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return T.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),T.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,k.jsx)(y,{present:n||s!==`hidden`,children:(0,k.jsx)(B,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:g(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:g(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),z=T.forwardRef((e,t)=>{let n=N(L,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=T.useState(!1),s=e.orientation===`horizontal`,c=J(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Y(n.viewport,c),Y(n.content,c),(0,k.jsx)(y,{present:r||a,children:(0,k.jsx)(B,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),B=T.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=N(L,e.__scopeScrollArea),a=T.useRef(null),o=T.useRef(0),[s,c]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=de(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return fe(e,o.current,s,t)}return n===`horizontal`?(0,k.jsx)(ae,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=pe(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,k.jsx)(oe,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=pe(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),ae=T.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=N(L,e.__scopeScrollArea),[o,s]=T.useState(),c=T.useRef(null),l=b(t,c,a.onScrollbarXChange);return T.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,k.jsx)(H,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),he(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:K(o.paddingLeft),paddingEnd:K(o.paddingRight)}})}})}),oe=T.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=N(L,e.__scopeScrollArea),[o,s]=T.useState(),c=T.useRef(null),l=b(t,c,a.onScrollbarYChange);return T.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,k.jsx)(H,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":q(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),he(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:K(o.paddingTop),paddingEnd:K(o.paddingBottom)}})}})}),[se,V]=M(L),H=T.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=N(L,n),[m,ee]=T.useState(null),h=b(t,e=>ee(e)),_=T.useRef(null),y=T.useRef(``),x=p.viewport,C=r.content-r.viewport,w=S(u),E=S(c),D=J(d,10);function O(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return T.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&w(e,C)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[x,m,C,w]),T.useEffect(E,[r,E]),Y(m,D),Y(p.content,D),(0,k.jsx)(se,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:S(a),onThumbPointerUp:S(o),onThumbPositionChange:E,onThumbPointerDown:S(s),children:(0,k.jsx)(v.div,{...f,ref:h,style:{position:`absolute`,...f.style},onPointerDown:g(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),O(e))}),onPointerMove:g(e.onPointerMove,O),onPointerUp:g(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),U=`ScrollAreaThumb`,W=T.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=V(U,e.__scopeScrollArea);return(0,k.jsx)(y,{present:n||i.hasThumb,children:(0,k.jsx)(ce,{ref:t,...r})})}),ce=T.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=N(U,n),o=V(U,n),{onThumbPositionChange:s}=o,c=b(t,e=>o.onThumbChange(e)),l=T.useRef(void 0),u=J(()=>{l.current&&=(l.current(),void 0)},100);return T.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=ge(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,k.jsx)(v.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:g(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:g(e.onPointerUp,o.onThumbPointerUp)})});W.displayName=U;var G=`ScrollAreaCorner`,le=T.forwardRef((e,t)=>{let n=N(G,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,k.jsx)(ue,{...e,ref:t}):null});le.displayName=G;var ue=T.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=N(G,n),[a,o]=T.useState(0),[s,c]=T.useState(0),l=!!(a&&s);return Y(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Y(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,k.jsx)(v.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function K(e){return e?parseInt(e,10):0}function de(e,t){let n=e/t;return isNaN(n)?0:n}function q(e){let t=de(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function fe(e,t,n,r=`ltr`){let i=q(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return me([c,l],d)(e)}function pe(e,t,n=`ltr`){let r=q(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=O(e,n===`ltr`?[0,o]:[o*-1,0]);return me([0,o],[0,s])(c)}function me(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function he(e,t){return e>0&&e<t}var ge=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function J(e,t){let n=S(e),r=T.useRef(0);return T.useEffect(()=>()=>window.clearTimeout(r.current),[]),T.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Y(e,t){let n=S(t);_(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var _e=P,ve=I,ye=le,X=r(),be=T.forwardRef((e,t)=>{let n=(0,X.c)(16),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:i,children:r,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===i?o=n[5]:(o=x(`relative overflow-hidden`,i),n[4]=i,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={WebkitOverflowScrolling:`touch`},n[6]=s):s=n[6];let c;n[7]!==r||n[8]!==t?(c=(0,k.jsx)(ve,{ref:t,"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] outline-none`,style:s,children:r}),n[7]=r,n[8]=t,n[9]=c):c=n[9];let l,u;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,k.jsx)(xe,{}),u=(0,k.jsx)(ye,{}),n[10]=l,n[11]=u):(l=n[10],u=n[11]);let d;return n[12]!==a||n[13]!==o||n[14]!==c?(d=(0,k.jsxs)(_e,{"data-slot":`scroll-area`,className:o,...a,children:[c,l,u]}),n[12]=a,n[13]=o,n[14]=c,n[15]=d):d=n[15],d});be.displayName=`ScrollArea`;function xe(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=x(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,n),t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,k.jsx)(W,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`}),t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==o?(c=(0,k.jsx)(R,{"data-slot":`scroll-area-scrollbar`,"data-orientation":a,orientation:a,className:o,...r,children:s}),t[7]=a,t[8]=r,t[9]=o,t[10]=c):c=t[10],c}function Se(e){let t=(0,X.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:f.tools.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}function Ce(e){let t=(0,X.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:f.tools.envVars,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}function we(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Te(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Ee(e){let t=(0,X.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:f.config.models,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}async function Z(e,t){let n=await e.http.config.models.get(),r=n.providers.flatMap(e=>e.models).filter(e=>e.runtimeStatus?.usable);m.getState().updateModels(r,n.defaultModel,n.defaultProvider),t.setQueryData(f.config.models,n)}function De(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Oe(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function ke(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Ae(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function je(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Me(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Ne(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Pe(e){let t=(0,X.c)(8),n=o(),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&&Z(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],E(a)}function Fe(e){let t=(0,X.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:f.config.preconfigs,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}async function Q(e,t){let n=await e.http.preconfigs.list();m.getState().updatePreconfigs(n.preconfigs),t.setQueryData(f.config.preconfigs,n)}function Ie(e){let t=(0,X.c)(8),n=o(),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&&Q(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],E(a)}function Le(e){let t=(0,X.c)(8),n=o(),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&&Q(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],E(a)}function Re(e){let t=(0,X.c)(8),n=o(),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&&Q(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],E(a)}function ze(e){let t=(0,X.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:f.config.prompts,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}async function $(e,t){let n=await e.http.config.prompts.list();m.getState().updatePrompts(n.prompts),t.setQueryData(f.config.prompts,n)}function Be(e){let t=(0,X.c)(8),n=o(),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&&$(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],E(a)}function Ve(e){let t=(0,X.c)(8),n=o(),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&&$(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],E(a)}function He(e){let t=(0,X.c)(8),n=o(),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&&$(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],E(a)}function Ue(e){let t=(0,X.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:f.config.providers.all,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}function We(e){let t=(0,X.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:f.config.providers.credentials,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}function Ge(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Ke(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function qe(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Je(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Ye(e,t){let n=(0,X.c)(9),r;n[0]===t?r=n[1]:(r=f.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],d(o)}function Xe(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Ze(e){let t=(0,X.c)(7),n=o(),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:f.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],E(a)}function Qe(e){let t=(0,X.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),E(n)}function $e(e,t,n,r,i){let a=(0,X.c)(13),o;a[0]!==r||a[1]!==n||a[2]!==t?(o=f.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],d(l)}function et(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=f.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],d(c)}function tt(e){let t=(0,X.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:f.files.drives,queryFn:n,enabled:r},t[2]=n,t[3]=r,t[4]=i):i=t[4],d(i)}function nt(e,t,n){let r=(0,X.c)(9),i=n===void 0?!0:n,a;r[0]===t?a=r[1]:(a=f.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],d(c)}function rt(e,t,n,r){let i=(0,X.c)(11),a=r===void 0?!0:r,o;i[0]!==n||i[1]!==t?(o=f.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],d(l)}export{Pe as A,Le as C,ke as D,Me as E,we as F,Se as I,be as L,Oe as M,Te as N,Ee as O,Ce as P,D as R,Fe as S,De as T,He as _,rt as a,Ie as b,Qe as c,Ge as d,Ke as f,Be as g,qe as h,nt as i,je as j,Ne as k,Ye as l,Ue as m,$e as n,Xe as o,We as p,tt as r,Ze as s,et as t,Je as u,ze as v,Ae as w,Re as x,Ve as y};
@@ -1 +1 @@
1
- import{i as e,r as t}from"./compiler-runtime-DZXZ41-q.js";var n=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t==null&&a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),r=e(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
1
+ import{i as e,r as t}from"./compiler-runtime-DZXZ41-q.js";var n=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),r=e(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-CuVT3KNW.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-mdFRYmiK.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{n as i}from"./ServerContext-DwL_fyZz.js";import{t as a}from"./useNavigate-D0TSLH_-.js";import{F as o,N as s,P as c}from"./button-BCE1SnDM.js";import{t as l}from"./refresh-cw-DJ3pEikS.js";import{t as u}from"./confirmation-dialog-jz6z4bio.js";var d=r(),f=t(n(),1);async function p(e,t){try{let n=e.url.startsWith(`https`)?`https`:`http`,r=e.url.replace(/^https?:\/\//,``);return(await fetch(`${n}://${r}/api/info`,{signal:t})).ok?`online`:`offline`}catch{return`offline`}}function m(e){let[t,n]=(0,f.useState)({}),[r,i]=(0,f.useState)(!1),a=(0,f.useCallback)(()=>{if(e.length===0)return;let t=new AbortController;i(!0);let r={};for(let t of e)r[t.id]=`checking`;n(r);let a=e.length;for(let r of e)p(r,t.signal).then(e=>{n(t=>({...t,[r.id]:e})),a--,a===0&&i(!1)});return()=>t.abort()},[e]);return(0,f.useEffect)(()=>a(),[a]),{statuses:t,isChecking:r,refresh:a}}var h=e();function g(e){let t=(0,d.c)(3),{status:n}=e;if(n===`checking`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-muted-foreground/40 animate-pulse`}),t[0]=e):e=t[0],e}if(n===`online`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-green-500`}),t[1]=e):e=t[1],e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,h.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-destructive`}),t[2]=r):r=t[2],r}function _(){let e=(0,d.c)(42),t=a(),{servers:n,removeServer:r}=i(),[p,_]=(0,f.useState)(null),{statuses:v,isChecking:y,refresh:b}=m(n),x;e[0]===t?x=e[1]:(x=e=>{t({to:`/server/$serverId`,params:{serverId:e.id}})},e[0]=t,e[1]=x);let S=x,C;e[2]!==p||e[3]!==r?(C=()=>{p&&(r(p.id),_(null))},e[2]=p,e[3]=r,e[4]=C):C=e[4];let w=C,T;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,h.jsx)(`h1`,{className:`text-2xl font-bold text-foreground`,children:`Select a Server`}),e[5]=T):T=e[5];let E=`w-4 h-4 ${y?`animate-spin`:``}`,D;e[6]===E?D=e[7]:(D=(0,h.jsx)(l,{className:E}),e[6]=E,e[7]=D);let O;e[8]!==y||e[9]!==b||e[10]!==D?(O=(0,h.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[T,(0,h.jsx)(`button`,{onClick:b,disabled:y,className:`p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-50 transition-colors`,title:`Refresh server status`,children:D})]}),e[8]=y,e[9]=b,e[10]=D,e[11]=O):O=e[11];let k;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,h.jsx)(`p`,{className:`text-muted-foreground mt-1`,children:`Choose a saved server or add a new one`}),e[12]=k):k=e[12];let A;e[13]===O?A=e[14]:(A=(0,h.jsxs)(`div`,{className:`px-6 pt-6 pb-4 text-center border-b border-border`,children:[O,k]}),e[13]=O,e[14]=A);let j;if(e[15]!==S||e[16]!==n||e[17]!==v){let t;e[19]!==S||e[20]!==v?(t=e=>(0,h.jsxs)(`div`,{className:`group w-full flex items-center gap-4 p-4 bg-background border border-input rounded-lg hover:bg-accent hover:border-ring transition-colors`,children:[(0,h.jsxs)(`button`,{onClick:()=>S(e),className:`flex items-center gap-4 flex-1 min-w-0 text-left`,children:[(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg shrink-0`,children:(0,h.jsx)(c,{className:`w-5 h-5 text-primary`})}),(0,h.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`p`,{className:`font-medium text-foreground truncate`,children:e.name}),(0,h.jsx)(g,{status:v[e.id]??`checking`})]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:e.url})]})]}),(0,h.jsx)(`button`,{onClick:t=>{t.stopPropagation(),_(e)},className:`p-2 rounded-md opacity-0 group-hover:opacity-100 hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all shrink-0`,title:`Remove server`,children:(0,h.jsx)(s,{className:`w-4 h-4`})})]},e.id),e[19]=S,e[20]=v,e[21]=t):t=e[21],j=n.map(t),e[15]=S,e[16]=n,e[17]=v,e[18]=j}else j=e[18];let M;e[22]===t?M=e[23]:(M=()=>t({to:`/add-server`}),e[22]=t,e[23]=M);let N;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,h.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg`,children:(0,h.jsx)(o,{className:`w-5 h-5 text-primary`})}),e[24]=N):N=e[24];let P;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,h.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,h.jsx)(`p`,{className:`font-medium text-muted-foreground`,children:`Add a Server`})}),e[25]=P):P=e[25];let F;e[26]===M?F=e[27]:(F=(0,h.jsxs)(`button`,{onClick:M,className:`w-full flex items-center gap-4 p-4 bg-background border border-dashed border-input rounded-lg hover:bg-accent hover:border-ring transition-colors text-left`,children:[N,P]}),e[26]=M,e[27]=F);let I;e[28]!==F||e[29]!==j?(I=(0,h.jsxs)(`div`,{className:`p-6 space-y-4`,children:[j,F]}),e[28]=F,e[29]=j,e[30]=I):I=e[30];let L;e[31]!==I||e[32]!==A?(L=(0,h.jsxs)(`div`,{className:`bg-card border border-border rounded-xl shadow-2xl overflow-hidden`,children:[A,I]}),e[31]=I,e[32]=A,e[33]=L):L=e[33];let R=p!==null,z;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{e||_(null)},e[34]=z):z=e[34];let B=`Remove "${p?.name??``}" from your saved servers?`,V;e[35]!==w||e[36]!==R||e[37]!==B?(V=(0,h.jsx)(u,{open:R,onOpenChange:z,title:`Remove Server`,description:B,confirmLabel:`Remove`,onConfirm:w,variant:`destructive`}),e[35]=w,e[36]=R,e[37]=B,e[38]=V):V=e[38];let H;return e[39]!==L||e[40]!==V?(H=(0,h.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4`,children:(0,h.jsxs)(`div`,{className:`w-full max-w-2xl`,children:[L,V]})}),e[39]=L,e[40]=V,e[41]=H):H=e[41],H}export{_ as component};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{$ as i,B as a,F as o,G as s,J as c,N as l,Q as u,V as d,X as f,Z as p,at as m,et as h,it as g,n as _,nt as v,rt as y,z as b}from"./platform-C9rqh4_A.js";import{Q as x,Z as S,_ as C,b as w,f as T,h as E,j as D,p as O}from"./badge-D8GOF5_2.js";import{t as k}from"./createLucideIcon-mdFRYmiK.js";import{D as A,M as j,a as M,c as N,d as P,l as ee,n as te,o as ne,r as F,s as re,t as ie,u as ae}from"./button-BCE1SnDM.js";var oe=class extends m{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=a(),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),I(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return L(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return L(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 p(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&&!i(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&R(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||p(this.options.enabled,this.#t)!==p(t.enabled,this.#t)||u(this.options.staleTime,this.#t)!==u(t.staleTime,this.#t))&&this.#g();let a=this.#_();r&&(this.#t!==n||p(this.options.enabled,this.#t)!==p(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ce(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(c)),t}#g(){this.#b();let e=u(this.options.staleTime,this.#t);if(d.isServer()||this.#r.isStale||!s(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=y.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,!(d.isServer()||p(this.options.enabled,this.#t)===!1||!s(this.#p)||this.#p===0)&&(this.#f=y.setInterval(()=>{(this.options.refetchIntervalInBackground||g.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(y.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(y.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,s=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},m=!1,h;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&I(e,t),s=i&&R(e,n,t,r);(a||s)&&(d={...d,...o(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:g,errorUpdatedAt:_,status:v}=d;h=d.data;let y=!1;if(t.placeholderData!==void 0&&h===void 0&&v===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=i.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(v=`success`,h=f(i?.data,e,t),m=!0)}if(t.select&&h!==void 0&&!y)if(i&&h===s?.data&&t.select===this.#c)h=this.#l;else try{this.#c=t.select,h=t.select(h),h=f(i?.data,h,t),this.#l=h,this.#s=null}catch(e){this.#s=e}this.#s&&(g=this.#s,h=this.#l,_=Date.now(),v=`error`);let b=d.fetchStatus===`fetching`,x=v===`pending`,S=v===`error`,C=x&&b,w=h!==void 0,T={status:v,fetchStatus:d.fetchStatus,isPending:x,isSuccess:v===`success`,isError:S,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:_,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:S&&!w,isPaused:d.fetchStatus===`paused`,isPlaceholderData:m,isRefetchError:S&&w,isStale:z(e,t),refetch:this.refetch,promise:this.#o,isEnabled:p(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)},o=()=>{i(this.#o=T.promise=a())},s=this.#o;switch(s.status){case`pending`:e.queryHash===n.queryHash&&i(s);break;case`fulfilled`:(r||T.data!==s.value)&&o();break;case`rejected`:(!r||T.error!==s.reason)&&o();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),!i(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){b.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function se(e,t){return p(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&p(t.retryOnMount,e)===!1)}function I(e,t){return se(e,t)||e.state.data!==void 0&&L(e,t,t.refetchOnMount)}function L(e,t,n){if(p(t.enabled,e)!==!1&&u(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&z(e,t)}return!1}function R(e,t,n,r){return(e!==t||p(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&z(e,n)}function z(e,t){return p(t.enabled,e)!==!1&&e.isStaleByTime(u(t.staleTime,e))}function ce(e,t){return!i(e.getCurrentResult(),t)}var B=e(),V=t(n(),1),H=V.createContext(!1),le=()=>V.useContext(H);H.Provider;function ue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var de=V.createContext(ue()),fe=()=>V.useContext(de),pe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?h(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},me=e=>{V.useEffect(()=>{e.clearReset()},[e])},he=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||h(n,[e.error,r])),ge=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))}},_e=(e,t)=>e.isLoading&&e.isFetching&&!t,ve=(e,t)=>e?.suspense&&t.isPending,U=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ye(e,t,n){let r=le(),i=fe(),a=l(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,ge(o),pe(o,i,s),me(i);let u=!a.getQueryCache().get(o.queryHash),[f]=V.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(V.useSyncExternalStore(V.useCallback(e=>{let t=m?f.subscribe(b.batchCalls(e)):c;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),V.useEffect(()=>{f.setOptions(o)},[o,f]),ve(o,p))throw U(o,f,i);if(he({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!d.isServer()&&_e(p,r)&&(u?U(o,f,i):s?.promise)?.catch(c).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function be(e,t){return ye(e,oe,t)}var xe=k(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Se=k(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ce=k(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),we=k(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Te=5e3,Ee=D(e=>({completionState:new Map,setCompletion:(t,n)=>e(e=>{let r=new Map(e.completionState);return r.set(t,n),{completionState:r}}),clearCompletion:t=>e(e=>{let n=new Map(e.completionState);return n.delete(t),{completionState:n}}),clearAllCompletions:()=>e({completionState:new Map})})),De=e=>t=>t.completionState.get(e),Oe=Te,ke={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`]}},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`]},W=r();function G(e){return x(e)}function Ae(e){if(typeof window>`u`)return e;try{let t=localStorage.getItem(S.SESSIONS);if(t===null)return e;let n=JSON.parse(t);return typeof n.width!=`number`||isNaN(n.width)?e:G(n.width)}catch{return e}}function je(e){if(!(typeof window>`u`))try{let t=G(e);localStorage.setItem(S.SESSIONS,JSON.stringify({width:t}))}catch(e){console.warn(`Error saving sessions panel width:`,e)}}function Me(e){if(typeof window>`u`)return e;try{let t=localStorage.getItem(S.FILES);if(t===null)return e;let n=JSON.parse(t);return typeof n.width!=`number`||isNaN(n.width)?e:G(n.width)}catch{return e}}function Ne(e){if(!(typeof window>`u`))try{let t=G(e);localStorage.setItem(S.FILES,JSON.stringify({width:t}))}catch(e){console.warn(`Error saving files panel width:`,e)}}var Pe=()=>Ae(256),Fe=()=>Me(256),K=D(e=>({showFilesPanel:!1,showTerminalPanel:!1,sessionsPanelWidth:Pe(),filesPanelWidth:Fe(),setShowFilesPanel:t=>e({showFilesPanel:t}),setShowTerminalPanel:t=>e({showTerminalPanel:t}),setSessionsPanelWidth:t=>{let n=x(t);je(n),e({sessionsPanelWidth:n})},setFilesPanelWidth:t=>{let n=x(t);Ne(n),e({filesPanelWidth:n})}}));function q(e){let t=(0,W.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,B.jsx)(ae,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function Ie(e){let t=(0,W.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,B.jsx)(ee,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function Le(e){let t=(0,W.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(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(N,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function J(e){let t=(0,W.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,side:o,showCloseButton:s,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=o===void 0?`right`:o,l=s===void 0?!0:s,u;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,B.jsx)(Le,{}),t[7]=u):u=t[7];let d;t[8]===r?d=t[9]:(d=F(`fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,r),t[8]=r,t[9]=d);let f=_()?`90px`:`0px`,p;t[10]===c?p=t[11]:(p=c===`left`||c===`right`?{top:`calc(env(safe-area-inset-top, 0px) + ${f})`,height:`calc(100dvh - env(safe-area-inset-top, 0px) - ${f})`}:c===`top`?{top:`calc(env(safe-area-inset-top, 0px) + ${f})`}:c===`bottom`?{bottom:`env(safe-area-inset-bottom, 0px)`}:void 0,t[10]=c,t[11]=p);let m=p,h;t[12]!==m||t[13]!==a?(h=m?{...m,...a}:a,t[12]=m,t[13]=a,t[14]=h):h=t[14];let g=h,v;t[15]===l?v=t[16]:(v=l&&(0,B.jsx)(M,{"data-slot":`sheet-close`,asChild:!0,children:(0,B.jsxs)(ie,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,B.jsx)(j,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[15]=l,t[16]=v);let y;return t[17]!==n||t[18]!==i||t[19]!==c||t[20]!==d||t[21]!==g||t[22]!==v?(y=(0,B.jsxs)(Ie,{children:[u,(0,B.jsxs)(ne,{"data-slot":`sheet-content`,"data-side":c,className:d,style:g,...i,children:[n,v]})]}),t[17]=n,t[18]=i,t[19]=c,t[20]=d,t[21]=g,t[22]=v,t[23]=y):y=t[23],y}function Y(e){let t=(0,W.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(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function X(e){let t=(0,W.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(`text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(P,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Re(e){let t=(0,W.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(`text-sm text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(re,{"data-slot":`sheet-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ze=`sidebar_state`,Be=3600*24*7,Ve=`16rem`,He=`18rem`,Ue=`3rem`,Z=V.createContext(null);function Q(){let e=V.useContext(Z);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function We(e){let t=(0,W.c)(35),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({defaultOpen:l,open:i,onOpenChange:s,className:r,style:c,children:n,panelId:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=l===void 0?!0:l,d=w(),[f,p]=V.useState(!1),[m,h]=V.useState(u),g=i??m,_;t[9]!==g||t[10]!==s?(_=e=>{let t=typeof e==`function`?e(g):e;s?s(t):h(t),document.cookie=`${ze}=${t}; path=/; max-age=${Be}`},t[9]=g,t[10]=s,t[11]=_):_=t[11];let v=_,y;t[12]!==d||t[13]!==v?(y=()=>d?p(Ke):v(Ge),t[12]=d,t[13]=v,t[14]=y):y=t[14];let b=y,x=g?`expanded`:`collapsed`,S;t[15]!==d||t[16]!==g||t[17]!==f||t[18]!==v||t[19]!==x||t[20]!==b?(S={state:x,open:g,setOpen:v,isMobile:d,openMobile:f,setOpenMobile:p,toggleSidebar:b},t[15]=d,t[16]=g,t[17]=f,t[18]=v,t[19]=x,t[20]=b,t[21]=S):S=t[21];let C=S,T;t[22]===c?T=t[23]:(T={"--sidebar-width":Ve,"--sidebar-width-icon":Ue,...c},t[22]=c,t[23]=T);let E=T,D;t[24]===r?D=t[25]:(D=F(`overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar`,r),t[24]=r,t[25]=D);let O;t[26]!==n||t[27]!==a||t[28]!==o||t[29]!==E||t[30]!==D?(O=(0,B.jsx)(`div`,{"data-slot":`sidebar-wrapper`,"data-panel-id":a,style:E,className:D,...o,children:n}),t[26]=n,t[27]=a,t[28]=o,t[29]=E,t[30]=D,t[31]=O):O=t[31];let k;return t[32]!==C||t[33]!==O?(k=(0,B.jsx)(Z.Provider,{value:C,children:O}),t[32]=C,t[33]=O,t[34]=k):k=t[34],k}function Ge(e){return!e}function Ke(e){return!e}function qe(e){let t=(0,W.c)(54),n,r,i,a,o,s,c,l;if(t[0]!==e){let{side:u,variant:d,collapsible:f,className:p,children:m,dir:h,isOpen:g,onOpenChange:_,...v}=e;s=u,c=d,l=f,r=p,n=m,i=h,a=g,o=v,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];let u=s===void 0?`left`:s,d=c===void 0?`sidebar`:c,f=l===void 0?`offcanvas`:l,{isMobile:p,state:m,openMobile:h,setOpenMobile:g}=Q(),_=a===void 0?void 0:a,v=_===void 0?m:_?`expanded`:`collapsed`;if(f===`none`){let e;t[9]===r?e=t[10]:(e=F(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[9]=r,t[10]=e);let i;return t[11]!==n||t[12]!==o||t[13]!==e?(i=(0,B.jsx)(`div`,{"data-slot":`sidebar`,className:e,...o,children:n}),t[11]=n,t[12]=o,t[13]=e,t[14]=i):i=t[14],i}if(p){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e={"--sidebar-width":He},t[15]=e):e=t[15];let r;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,B.jsxs)(Y,{className:`sr-only`,children:[(0,B.jsx)(X,{children:`Sidebar`}),(0,B.jsx)(Re,{children:`Displays the mobile sidebar.`})]}),t[16]=r):r=t[16];let a;t[17]===n?a=t[18]:(a=(0,B.jsx)(`div`,{className:`flex h-full w-full flex-col p-2`,children:n}),t[17]=n,t[18]=a);let s;t[19]!==i||t[20]!==u||t[21]!==a?(s=(0,B.jsxs)(J,{dir:i,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:e,side:u,children:[r,a]}),t[19]=i,t[20]=u,t[21]=a,t[22]=s):s=t[22];let c;return t[23]!==h||t[24]!==o||t[25]!==g||t[26]!==s?(c=(0,B.jsx)(q,{open:h,onOpenChange:g,...o,children:s}),t[23]=h,t[24]=o,t[25]=g,t[26]=s,t[27]=c):c=t[27],c}let y=v===`collapsed`?f:``,b=_!==void 0&&!_&&`w-0`,x=d===`floating`||d===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,S;t[28]!==b||t[29]!==x?(S=F(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,b,`group-data-[side=right]:rotate-180`,x),t[28]=b,t[29]=x,t[30]=S):S=t[30];let C;t[31]===S?C=t[32]:(C=(0,B.jsx)(`div`,{"data-slot":`sidebar-gap`,className:S}),t[31]=S,t[32]=C);let w=u===`left`&&_!==void 0&&!_&&`left-[calc(var(--sidebar-width)*-1)]`,T=u===`right`&&_!==void 0&&!_&&`right-[calc(var(--sidebar-width)*-1)]`,E=d===`floating`||d===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,D;t[33]!==r||t[34]!==T||t[35]!==E||t[36]!==w?(D=F(`fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,w,T,E,r),t[33]=r,t[34]=T,t[35]=E,t[36]=w,t[37]=D):D=t[37];let O;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(O={top:`calc(var(--header-height, 0px) + env(safe-area-inset-top, 0px))`,height:`calc(100dvh - var(--header-height, 0px) - env(safe-area-inset-top, 0px))`},t[38]=O):O=t[38];let k;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(k={paddingBottom:`env(safe-area-inset-bottom, 0px)`},t[39]=k):k=t[39];let A;t[40]===n?A=t[41]:(A=(0,B.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,style:k,children:n}),t[40]=n,t[41]=A);let j;t[42]!==o||t[43]!==u||t[44]!==D||t[45]!==A?(j=(0,B.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":u,className:D,style:O,...o,children:A}),t[42]=o,t[43]=u,t[44]=D,t[45]=A,t[46]=j):j=t[46];let M;return t[47]!==v||t[48]!==u||t[49]!==j||t[50]!==y||t[51]!==C||t[52]!==d?(M=(0,B.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":v,"data-collapsible":y,"data-variant":d,"data-side":u,"data-slot":`sidebar`,children:[C,j]}),t[47]=v,t[48]=u,t[49]=j,t[50]=y,t[51]=C,t[52]=d,t[53]=M):M=t[53],M}function Je(e){let t=(0,W.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(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ye(e){let t=(0,W.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-2 w-auto bg-sidebar-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(C,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Xe=V.forwardRef((e,t)=>{let n=(0,W.c)(9),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=F(`no-scrollbar flex min-h-0 min-w-0 w-full flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==t||n[7]!==a?(o=(0,B.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:a,ref:t,...i}),n[5]=i,n[6]=t,n[7]=a,n[8]=o):o=n[8],o});function Ze(e){let t=(0,W.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(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qe(e){let t=(0,W.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?A:`div`,o;t[4]===n?o=t[5]:(o=F(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,B.jsx)(a,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function $e(e){let t=(0,W.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(`w-full text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function et(e){let t=(0,W.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(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tt(e){let t=(0,W.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(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var nt=te(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function rt(e){let t=(0,W.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?A:`button`,{isMobile:m,state:h}=Q(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=F(nt({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==g?(_=(0,B.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:g,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=g,t[17]=_):_=t[17];let v=_;if(!c)return v;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let y;t[20]===v?y=t[21]:(y=(0,B.jsx)(E,{asChild:!0,children:v}),t[20]=v,t[21]=y);let b=h!==`collapsed`||m,x;t[22]!==b||t[23]!==c?(x=(0,B.jsx)(O,{side:`right`,align:`center`,hidden:b,...c}),t[22]=b,t[23]=c,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,B.jsxs)(T,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function it(e){let t=(0,W.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,asChild:i,showOnHover:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?!1:i,s=a===void 0?!1:a,c=o?A:`button`,l=s&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,u;t[5]!==n||t[6]!==l?(u=F(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,l,n),t[5]=n,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==r||t[10]!==u?(d=(0,B.jsx)(c,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:u,...r}),t[8]=c,t[9]=r,t[10]=u,t[11]=d):d=t[11],d}function at(e){let t=(0,W.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(`ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,B.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,W.c)(29),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({side:a,panelId:r,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=w(),s=K(lt),c=K(ct),l=K(st),u=K(ot),d=r===`sessions`?s:l,f=r===`sessions`?c:u,[p,m]=V.useState(!1),h=V.useRef(!1),g=V.useRef(0),_=V.useRef(0),v=V.useRef(0),y=V.useRef(null),b=V.useRef(null),S;t[5]!==o||t[6]!==r?(S=e=>{if(o)return;e.preventDefault(),e.stopPropagation(),h.current=!0,m(!0),g.current=e.clientX,_.current=v.current,document.body.style.cursor=`ew-resize`,document.body.style.userSelect=`none`;let t=document.querySelector(`[data-panel-id="${r}"]`);y.current=t,t&&(b.current=t.style.getPropertyValue(`--sidebar-width`)||null,t.classList.add(`no-transition`))},t[5]=o,t[6]=r,t[7]=S):S=t[7];let C=S,T,E;t[8]===d?(T=t[9],E=t[10]):(T=()=>{v.current=d},E=[d],t[8]=d,t[9]=T,t[10]=E),V.useEffect(T,E);let D,O;if(t[11]!==r||t[12]!==f||t[13]!==a?(D=()=>{let e=e=>{if(!h.current)return;let t=a===`left`?e.clientX-g.current:g.current-e.clientX,n=x(_.current+t);v.current=n;let i=y.current||document.querySelector(`[data-panel-id="${r}"]`);i&&(i.style.setProperty(`--sidebar-width`,`${Math.round(n)}px`),y.current=i);let o=document.querySelector(`[data-panel-gap="${r}"]`);o&&(o.style.width=`${Math.round(n)}px`)},t=()=>{if(!h.current)return;h.current=!1,m(!1),document.body.style.cursor=``,document.body.style.userSelect=``;let e=y.current||document.querySelector(`[data-panel-id="${r}"]`);e&&(e.classList.remove(`no-transition`),b.current===null?e.style.removeProperty(`--sidebar-width`):e.style.setProperty(`--sidebar-width`,b.current));let t=document.querySelector(`[data-panel-gap="${r}"]`);t&&(t.classList.add(`no-transition`),t.style.width=`${Math.round(v.current)}px`,requestAnimationFrame(()=>{t?.classList.remove(`no-transition`)})),f(Math.round(v.current))};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},O=[f,a,r],t[11]=r,t[12]=f,t[13]=a,t[14]=D,t[15]=O):(D=t[14],O=t[15]),V.useEffect(D,O),o)return null;let k=a===`left`?`absolute top-0 right-0`:`absolute top-0 left-0`,A;t[16]!==n||t[17]!==k?(A=F(`z-30 flex h-full w-2 cursor-ew-resize items-center justify-center group/sidebar-resize`,k,n),t[16]=n,t[17]=k,t[18]=A):A=t[18];let j=p?`bg-primary`:`group-active/sidebar-resize:bg-primary`,M;t[19]===j?M=t[20]:(M=F(`h-8 w-0.5 rounded-full transition-colors duration-100`,`bg-transparent group-hover/sidebar-resize:bg-border`,j),t[19]=j,t[20]=M);let N;t[21]===M?N=t[22]:(N=(0,B.jsx)(`div`,{className:M}),t[21]=M,t[22]=N);let P;return t[23]!==C||t[24]!==r||t[25]!==i||t[26]!==A||t[27]!==N?(P=(0,B.jsx)(`div`,{"data-slot":`panel-resize-handle`,"data-panel-id":r,className:A,onMouseDown:C,...i,children:N}),t[23]=C,t[24]=r,t[25]=i,t[26]=A,t[27]=N,t[28]=P):P=t[28],P}function ot(e){return e.setFilesPanelWidth}function st(e){return e.filesPanelWidth}function ct(e){return e.setSessionsPanelWidth}function lt(e){return e.sessionsPanelWidth}function ut(e){let t=(0,W.c)(6),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;return t[3]!==n||t[4]!==r?(i=(0,B.jsx)($,{side:`left`,panelId:`sessions`,className:n,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}export{be as A,Oe as C,Ce as D,we as E,Se as O,ke as S,Ee as T,q as _,Ze as a,X as b,Je as c,rt as d,tt as f,Q as g,Ye as h,Xe as i,xe as k,et as l,We as m,ut as n,$e as o,at as p,qe as r,Qe as s,$ as t,it as u,J as v,De as w,K as x,Y as y};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-CuVT3KNW.js";var t=e(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),n=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),r=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),i=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t as i,r as n,n as r,i as t};
1
+ import{t as e}from"./createLucideIcon-mdFRYmiK.js";var t=e(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),n=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),r=e(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),i=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t as i,r as n,n as r,i as t};
@@ -0,0 +1 @@
1
+ import{o as e,r as t}from"./compiler-runtime-DZXZ41-q.js";import{t as n}from"./useRouter-C_VHQC31.js";var r=e(t(),1);function i(e){let t=n();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{i as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-DZXZ41-q.js";import{a as i}from"./platform-C9rqh4_A.js";import{A as a,D as o,S as s,a as c,c as l,d as u,f as d,k as f,l as p,o as m,s as h}from"./sidebar-lTmDketj.js";import{L as g,R as _,i as v,r as y,t as b}from"./queries-BTzP-7g4.js";import{A as x,D as S,J as C,T as w,U as ee,W as T,a as te,c as ne,d as re,i as E,n as D,q as ie,r as O,s as ae,t as k,v as A}from"./badge-D8GOF5_2.js";import{t as j}from"./createLucideIcon-mdFRYmiK.js";import{t as M}from"./archive-CJqmerPG.js";import{a as oe,i as N,n as P,o as F,r as I,s as L,t as R}from"./SessionMenuButton-bQK4n-kR.js";import{a as z,c as B,d as V,i as H,l as U,m as W,o as G,p as K,r as q,s as J,t as Y,u as se}from"./popover-CVyjoKPS.js";import{F as ce,M as le,N as ue,r as de,t as fe}from"./button-BCE1SnDM.js";import{a as pe,o as me,r as he,s as ge,t as _e}from"./dialog-B-f8lUpV.js";import{t as ve}from"./confirmation-dialog-jz6z4bio.js";var ye=j(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),be=j(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),xe=r(),X=t(n(),1);function Se(e){let t=(0,xe.c)(20),{sdkClient:n,workspaceId:r,connected:i}=e,o=x(Z),c;t[0]===r?c=t[1]:(c=s.sessions.byWorkspace(r??``),t[0]=r,t[1]=c);let l;t[2]!==n||t[3]!==r?(l=()=>n.http.sessions.listByWorkspace({workspaceId:r}),t[2]=n,t[3]=r,t[4]=l):l=t[4];let u=!!n&&i&&!!r,d;t[5]!==c||t[6]!==l||t[7]!==u?(d={queryKey:c,queryFn:l,enabled:u,staleTime:1e4},t[5]=c,t[6]=l,t[7]=u,t[8]=d):d=t[8];let{isLoading:f,error:p,data:m}=a(d),h,g;t[9]!==o||t[10]!==r?(h=()=>{r||o([])},g=[r,o],t[9]=o,t[10]=r,t[11]=h,t[12]=g):(h=t[11],g=t[12]),(0,X.useEffect)(h,g);let _,v;t[13]!==m||t[14]!==o?(_=()=>{m?.sessions&&o(m.sessions)},v=[m,o],t[13]=m,t[14]=o,t[15]=_,t[16]=v):(_=t[15],v=t[16]),(0,X.useEffect)(_,v);let y=p?.message??null,b;return t[17]!==f||t[18]!==y?(b={isLoading:f,error:y},t[17]=f,t[18]=y,t[19]=b):b=t[19],b}function Z(e){return e.setSessions}function Ce(...e){return e.map((e,t)=>t===0?e.replace(/\/+$/,``):e.replace(/^\/+|\/+$/g,``)).filter(Boolean).join(`/`)}var Q=e();function we(e){let t=(0,xe.c)(83),{open:n,onOpenChange:r,onSelect:i,initialPath:a,title:o,sdkClient:s}=e,c=o===void 0?`Select Folder`:o,[l,u]=(0,X.useState)(a||``),[d,f]=(0,X.useState)(a||``),[p,m]=(0,X.useState)(0),[h,_]=(0,X.useState)(``),[x,S]=(0,X.useState)(!1),[w,te]=(0,X.useState)(!1),ne=(0,X.useRef)(null),re=(0,X.useRef)(null),{data:E,isLoading:D,error:ie,refetch:O}=b(s,d,n),{data:ae}=y(s),{error:k,refetch:j}=v(s,l,!1),M;t[0]===ae?.drives?M=t[1]:(M=ae?.drives??[],t[0]=ae?.drives,t[1]=M);let oe=M,N=E?.files?.filter(Oe)??[],P=E?.isRoot??!1,F=D||w,I=ie||k,L;t[2]===h?L=t[3]:(L=e=>e.name.toLowerCase().includes(h.toLowerCase()),t[2]=h,t[3]=L);let R=N.filter(L),z=R[p]??null,B;t[4]===l?B=t[5]:(B=e=>Ce(l,e.name),t[4]=l,t[5]=B);let V=B,H=z?V(z):l,U=!z,W;t[6]!==P||t[7]!==j||t[8]!==s?(W=()=>{!s||P||(te(!0),j().then(e=>{e.data&&(u(e.data.currentPath),f(e.data.currentPath),m(0),_(``)),te(!1)}).catch(()=>{te(!1)}))},t[6]=P,t[7]=j,t[8]=s,t[9]=W):W=t[9];let G=W,q;t[10]===V?q=t[11]:(q=e=>{let t=V(e);u(t),f(t),m(0),_(``),S(!1)},t[10]=V,t[11]=q);let J=q,Y=()=>{H&&(i(H),r(!1))},se=e=>{if(R.length!==0)bb85:switch(e.key){case`ArrowDown`:e.preventDefault(),m(e=>Math.min(e+1,R.length-1));break bb85;case`ArrowRight`:R[p]&&(e.preventDefault(),J(R[p]));break bb85;case`ArrowUp`:e.preventDefault(),m(De);break bb85;case`Enter`:e.preventDefault(),Y();break bb85;case`Escape`:h&&(e.preventDefault(),_(``))}},ce,le;t[12]!==a||t[13]!==n?(ce=()=>{if(n){let e=a||``;u(e),f(e),m(0),_(``)}},le=[n,a],t[12]=a,t[13]=n,t[14]=ce,t[15]=le):(ce=t[14],le=t[15]),(0,X.useEffect)(ce,le);let ue;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>{m(0)},t[16]=ue):ue=t[16];let ve;t[17]===h?ve=t[18]:(ve=[h],t[17]=h,t[18]=ve),(0,X.useEffect)(ue,ve),(0,X.useEffect)(()=>{if(re.current&&R.length>0){let e=re.current.children[p];e&&e.scrollIntoView({block:`nearest`})}},[p,R.length]);let Se,Z;t[19]===n?(Se=t[20],Z=t[21]):(Se=()=>{n&&setTimeout(()=>ne.current?.focus(),100)},Z=[n],t[19]=n,t[20]=Se,t[21]=Z),(0,X.useEffect)(Se,Z);let we;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(we=()=>{S(!1)},t[22]=we):we=t[22];let ke;t[23]===l?ke=t[24]:(ke=[l],t[23]=l,t[24]=ke),(0,X.useEffect)(we,ke);let Ae=Ee,je=_e,Me=he,$;t[25]===c?$=t[26]:($=(0,Q.jsx)(me,{children:(0,Q.jsx)(ge,{children:c})}),t[25]=c,t[26]=$);let Ne=F||!l||P,Pe;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Q.jsx)(ye,{className:`w-4 h-4`}),t[27]=Pe):Pe=t[27];let Fe;t[28]!==G||t[29]!==Ne?(Fe=(0,Q.jsx)(fe,{variant:`ghost`,size:`icon`,className:`h-7 w-7 flex-shrink-0`,onClick:G,disabled:Ne,children:Pe}),t[28]=G,t[29]=Ne,t[30]=Fe):Fe=t[30];let Ie;t[31]!==l||t[32]!==oe||t[33]!==F||t[34]!==x?(Ie=oe.length>1&&(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(fe,{variant:`ghost`,size:`icon`,className:`h-7 w-7 flex-shrink-0`,onClick:()=>S(Te),disabled:F,children:(0,Q.jsx)(be,{className:`w-4 h-4`})}),x&&(0,Q.jsx)(`div`,{className:`absolute top-full left-0 mt-1 bg-popover border rounded-md shadow-md z-50 min-w-[120px]`,children:oe.map(e=>(0,Q.jsxs)(`button`,{onClick:()=>{u(e),f(e),S(!1),m(0),_(``)},className:de(`flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-muted`,l===e&&`bg-primary/20 text-primary font-medium`),children:[(0,Q.jsx)(T,{className:`w-3.5 h-3.5 text-amber-500`}),e]},e))})]}),t[31]=l,t[32]=oe,t[33]=F,t[34]=x,t[35]=Ie):Ie=t[35];let Le=z?(0,Q.jsx)(`span`,{className:`text-primary`,children:Ae(V(z),45)}):Ae(l)||`Home`,Re;t[36]!==Le||t[37]!==H?(Re=(0,Q.jsx)(`span`,{className:`flex-1 text-sm font-mono truncate`,title:H,children:Le}),t[36]=Le,t[37]=H,t[38]=Re):Re=t[38];let ze;t[39]!==Fe||t[40]!==Ie||t[41]!==Re?(ze=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 p-2 bg-muted rounded-md`,children:[Fe,Ie,Re]}),t[39]=Fe,t[40]=Ie,t[41]=Re,t[42]=ze):ze=t[42];let Be;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(Be=(0,Q.jsx)(K,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground`}),t[43]=Be):Be=t[43];let Ve;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=e=>_(e.target.value),t[44]=Ve):Ve=t[44];let He;t[45]===h?He=t[46]:(He=(0,Q.jsxs)(`div`,{className:`relative`,children:[Be,(0,Q.jsx)(A,{ref:ne,placeholder:`Filter folders...`,value:h,onChange:Ve,className:`pl-8`})]}),t[45]=h,t[46]=He);let Ue;t[47]!==l||t[48]!==I||t[49]!==R||t[50]!==J||t[51]!==F||t[52]!==O||t[53]!==h||t[54]!==p?(Ue=(0,Q.jsx)(g,{className:`h-64 border rounded-md`,children:F?(0,Q.jsxs)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground`,children:[(0,Q.jsx)(ee,{className:`w-4 h-4 animate-spin mr-2`}),`Loading...`]}):I?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`text-destructive`,children:I.message}),(0,Q.jsx)(fe,{variant:`ghost`,size:`sm`,onClick:()=>{f(l),O()},className:`mt-2`,children:`Retry`})]}):R.length===0?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:[(0,Q.jsx)(T,{className:`w-8 h-8 mb-2 opacity-50`}),h?`No matching folders`:`No folders in this directory`]}):(0,Q.jsx)(`div`,{className:`p-1`,ref:re,children:R.map((e,t)=>(0,Q.jsxs)(`button`,{onClick:()=>m(t),onDoubleClick:()=>J(e),className:de(`flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left`,`hover:bg-muted`,t===p&&`bg-primary/20 text-primary font-medium ring-1 ring-primary/50`),children:[(0,Q.jsx)(T,{className:`w-4 h-4 text-amber-500 flex-shrink-0`}),(0,Q.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),t===p&&(0,Q.jsx)(C,{className:`w-4 h-4 text-primary`})]},e.path))})}),t[47]=l,t[48]=I,t[49]=R,t[50]=J,t[51]=F,t[52]=O,t[53]=h,t[54]=p,t[55]=Ue):Ue=t[55];let We;t[56]===I?We=t[57]:(We=I&&(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,children:I.message}),t[56]=I,t[57]=We);let Ge;t[58]!==ze||t[59]!==He||t[60]!==Ue||t[61]!==We?(Ge=(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[ze,He,Ue,We]}),t[58]=ze,t[59]=He,t[60]=Ue,t[61]=We,t[62]=Ge):Ge=t[62];let Ke;t[63]===r?Ke=t[64]:(Ke=(0,Q.jsx)(fe,{variant:`outline`,onClick:()=>r(!1),children:`Cancel`}),t[63]=r,t[64]=Ke);let qe=!H||F,Je=U?`Use This Folder`:`Add Selected Folder`,Ye;t[65]!==Y||t[66]!==qe||t[67]!==Je?(Ye=(0,Q.jsx)(fe,{onClick:Y,disabled:qe,children:Je}),t[65]=Y,t[66]=qe,t[67]=Je,t[68]=Ye):Ye=t[68];let Xe;t[69]!==Ke||t[70]!==Ye?(Xe=(0,Q.jsxs)(pe,{children:[Ke,Ye]}),t[69]=Ke,t[70]=Ye,t[71]=Xe):Xe=t[71];let Ze;t[72]!==Me||t[73]!==se||t[74]!==$||t[75]!==Ge||t[76]!==Xe?(Ze=(0,Q.jsxs)(Me,{className:`sm:max-w-lg`,onKeyDown:se,children:[$,Ge,Xe]}),t[72]=Me,t[73]=se,t[74]=$,t[75]=Ge,t[76]=Xe,t[77]=Ze):Ze=t[77];let Qe;return t[78]!==je||t[79]!==r||t[80]!==n||t[81]!==Ze?(Qe=(0,Q.jsx)(je,{open:n,onOpenChange:r,children:Ze}),t[78]=je,t[79]=r,t[80]=n,t[81]=Ze,t[82]=Qe):Qe=t[82],Qe}function Te(e){return!e}function Ee(e,t){let n=t===void 0?50:t;if(e.length<=n)return e;let r=e.split(/[/\\]/);return r.length<=2?e:`.../`+r.slice(-2).join(`/`)}function De(e){return Math.max(e-1,0)}function Oe(e){return e.type===`directory`}function ke(e){let t=(0,xe.c)(67),{workspaces:n,activeWorkspace:r,onSelectWorkspace:i,onCreateVirtualWorkspace:a,onCreatePhysicalWorkspace:s,isWorkspaceFavorited:c,onToggleFavorite:l,onDeleteWorkspace:u,onRenameWorkspace:d,sdkClient:p}=e,[m,h]=(0,X.useState)(!1),[g,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(null),[x,S]=(0,X.useState)(null),[w,ee]=(0,X.useState)(``),E=(0,X.useRef)(null),D,ie;t[0]===x?(D=t[1],ie=t[2]):(D=()=>{x&&E.current&&(E.current.focus(),E.current.select())},ie=[x],t[0]=x,t[1]=D,t[2]=ie),(0,X.useEffect)(D,ie);let O;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{ee(e.name),S(e.id)},t[3]=O):O=t[3];let k=O,A;t[4]!==d||t[5]!==w||t[6]!==x?(A=()=>{let e=w.trim();e&&x&&d(x,e),S(null)},t[4]=d,t[5]=w,t[6]=x,t[7]=A):A=t[7];let j=A,M;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>{S(null)},t[8]=M):M=t[8];let oe=M,N;t[9]===r?.isVirtual?N=t[10]:(N=r?.isVirtual?(0,Q.jsx)(L,{className:`size-4 flex-shrink-0 text-muted-foreground`}):(0,Q.jsx)(T,{className:`size-4 flex-shrink-0 text-muted-foreground`}),t[9]=r?.isVirtual,t[10]=N);let P=r?.name||`Select workspace`,F;t[11]===P?F=t[12]:(F=(0,Q.jsx)(`span`,{className:`truncate`,children:P}),t[11]=P,t[12]=F);let I;t[13]!==N||t[14]!==F?(I=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 overflow-hidden`,children:[N,F]}),t[13]=N,t[14]=F,t[15]=I):I=t[15];let R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(W,{className:`ml-auto size-4 shrink-0 opacity-50`}),t[16]=R):R=t[16];let K;t[17]!==m||t[18]!==I?(K=(0,Q.jsx)(H,{asChild:!0,children:(0,Q.jsxs)(fe,{variant:`outline`,role:`combobox`,"aria-expanded":m,"aria-label":`Select workspace`,className:`w-full justify-between h-9`,children:[I,R]})}),t[17]=m,t[18]=I,t[19]=K):K=t[19];let le;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Q.jsx)(B,{placeholder:`Search workspace...`}),t[20]=le):le=t[20];let pe;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Q.jsx)(G,{children:`No workspace found.`}),t[21]=pe):pe=t[21];let me;t[22]!==r?.id||t[23]!==j||t[24]!==c||t[25]!==i||t[26]!==l||t[27]!==w||t[28]!==x||t[29]!==n?(me=n.map(e=>(0,Q.jsxs)(U,{showCheck:!1,onSelect:()=>{x!==e.id&&(i(e),h(!1))},children:[(0,Q.jsx)(`div`,{className:`flex-1 min-w-0 flex items-center gap-2`,children:x===e.id?(0,Q.jsx)(`input`,{ref:E,type:`text`,value:w,onChange:e=>ee(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),j()):e.key===`Escape`?(e.preventDefault(),oe()):[`ArrowUp`,`ArrowDown`].includes(e.key)&&e.stopPropagation()},onBlur:j,onClick:je,className:`flex-1 min-w-0 h-6 px-1 text-sm bg-background border border-input rounded focus:outline-none focus:ring-2 focus:ring-ring`}):(0,Q.jsxs)(Q.Fragment,{children:[e.isVirtual?(0,Q.jsx)(L,{className:`size-4 flex-shrink-0 text-muted-foreground`}):(0,Q.jsx)(T,{className:`size-4 flex-shrink-0 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.name})]})}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{className:`p-1 rounded hover:bg-secondary transition-colors`,onClick:t=>{t.stopPropagation(),l(e.id,e.name)},title:c(e.id)?`Remove from favorites`:`Add to favorites`,children:c(e.id)?(0,Q.jsx)(_,{className:`size-4 fill-primary text-primary`}):(0,Q.jsx)(_,{className:`size-4 text-muted-foreground`})}),(0,Q.jsx)(C,{className:de(`size-4`,r?.id===e.id?`opacity-100`:`opacity-0`)}),(0,Q.jsxs)(te,{children:[(0,Q.jsx)(re,{asChild:!0,children:(0,Q.jsxs)(`button`,{className:`p-1 rounded hover:bg-secondary transition-colors`,onClick:Ae,children:[(0,Q.jsx)(f,{className:`size-4`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Workspace actions`})]})}),(0,Q.jsxs)(ae,{align:`end`,children:[(0,Q.jsxs)(ne,{onClick:t=>{t.stopPropagation(),k(e)},children:[(0,Q.jsx)(o,{className:`size-4`}),`Rename`]}),(0,Q.jsxs)(ne,{onClick:t=>{t.stopPropagation(),b(e)},className:`text-destructive focus:text-destructive`,children:[(0,Q.jsx)(ue,{className:`size-4`}),`Delete`]})]})]})]})]},e.id)),t[22]=r?.id,t[23]=j,t[24]=c,t[25]=i,t[26]=l,t[27]=w,t[28]=x,t[29]=n,t[30]=me):me=t[30];let he;t[31]===me?he=t[32]:(he=(0,Q.jsx)(J,{heading:`Workspaces`,children:me}),t[31]=me,t[32]=he);let ge;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Q.jsx)(V,{}),t[33]=ge):ge=t[33];let _e;t[34]===a?_e=t[35]:(_e=()=>{a(),h(!1)},t[34]=a,t[35]=_e);let ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Q.jsx)(ce,{className:`size-4`,"data-icon":`inline-start`}),t[36]=ye):ye=t[36];let be;t[37]===_e?be=t[38]:(be=(0,Q.jsxs)(U,{onSelect:_e,children:[ye,`Create virtual workspace`]}),t[37]=_e,t[38]=be);let Se;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Q.jsxs)(U,{onSelect:()=>{h(!1),v(!0)},children:[(0,Q.jsx)(T,{className:`size-4`,"data-icon":`inline-start`}),`Add existing folder`]}),t[39]=Se):Se=t[39];let Z;t[40]===be?Z=t[41]:(Z=(0,Q.jsxs)(J,{children:[be,Se]}),t[40]=be,t[41]=Z);let Ce;t[42]!==he||t[43]!==Z?(Ce=(0,Q.jsx)(q,{className:`w-[240px] p-0 max-h-[80vh]`,children:(0,Q.jsxs)(z,{children:[le,(0,Q.jsxs)(se,{className:`max-h-[50vh] overflow-y-auto`,children:[pe,he,ge,Z]})]})}),t[42]=he,t[43]=Z,t[44]=Ce):Ce=t[44];let Te;t[45]!==m||t[46]!==K||t[47]!==Ce?(Te=(0,Q.jsxs)(Y,{open:m,onOpenChange:h,children:[K,Ce]}),t[45]=m,t[46]=K,t[47]=Ce,t[48]=Te):Te=t[48];let Ee;t[49]===s?Ee=t[50]:(Ee=e=>{s(e),v(!1)},t[49]=s,t[50]=Ee);let De;t[51]!==p||t[52]!==g||t[53]!==Ee?(De=(0,Q.jsx)(we,{open:g,onOpenChange:v,onSelect:Ee,title:`Select Workspace Folder`,sdkClient:p}),t[51]=p,t[52]=g,t[53]=Ee,t[54]=De):De=t[54];let Oe=y!==null,ke;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(ke=e=>!e&&b(null),t[55]=ke):ke=t[55];let Me=y?`Are you sure you want to delete "${y.name}"? This will permanently remove the workspace and all associated Jean data, including sessions, messages, and temporary files. The actual files in "${y.name}" on disk will not be deleted.`:``,$;t[56]!==u||t[57]!==y?($=()=>{y&&(u(y.id),b(null))},t[56]=u,t[57]=y,t[58]=$):$=t[58];let Ne;t[59]!==Oe||t[60]!==Me||t[61]!==$?(Ne=(0,Q.jsx)(ve,{open:Oe,onOpenChange:ke,title:`Delete Workspace`,description:Me,confirmLabel:`Delete`,variant:`destructive`,onConfirm:$}),t[59]=Oe,t[60]=Me,t[61]=$,t[62]=Ne):Ne=t[62];let Pe;return t[63]!==Te||t[64]!==De||t[65]!==Ne?(Pe=(0,Q.jsxs)(Q.Fragment,{children:[Te,De,Ne]}),t[63]=Te,t[64]=De,t[65]=Ne,t[66]=Pe):Pe=t[66],Pe}function Ae(e){return e.stopPropagation()}function je(e){return e.stopPropagation()}function Me(e){let t=(0,xe.c)(56),{activeSessions:n,archivedSessions:r,childrenMap:i,sessionDerivedValues:a,currentSessionId:o,onResumeSession:s,onCloseSession:l,onReopenSession:u,onDeleteSession:d,onRenameSession:g,onBulkCloseSessions:_,onBulkDeleteSessions:v}=e,[y,b]=(0,X.useState)(!1),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[0]=x):x=t[0];let[S,C]=(0,X.useState)(x),[w,ee]=(0,X.useState)(!1),T;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[1]=T):T=t[1];let A=T,j;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{b(Ie),C(new Set)},t[2]=j):j=t[2];let oe=j,N;t[3]===n?N=t[4]:(N=()=>{C(new Set(n.map(Fe)))},t[3]=n,t[4]=N);let P=N,I;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{C(new Set)},t[5]=I):I=t[5];let L=I,z;t[6]!==_||t[7]!==S?(z=()=>{S.size>0&&(_(S),C(new Set),b(!1))},t[6]=_,t[7]=S,t[8]=z):z=t[8];let B=z,V;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>{b(!1),C(new Set)},t[9]=V):V=t[9];let H=V,U;t[10]!==r||t[11]!==v?(U=()=>{let e=new Set(r.map(Pe));e.size>0&&v(e),ee(!1)},t[10]=r,t[11]=v,t[12]=U):U=t[12];let W=U,G,K;t[13]===y?(G=t[14],K=t[15]):(K=()=>{if(!y)return;let e=e=>{e.key===`Escape`&&H()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},G=[y,H],t[13]=y,t[14]=G,t[15]=K),(0,X.useEffect)(K,G);let q;t[16]!==n||t[17]!==i||t[18]!==o||t[19]!==l||t[20]!==d||t[21]!==g||t[22]!==u||t[23]!==s||t[24]!==P||t[25]!==S||t[26]!==y||t[27]!==a?(q=(0,Q.jsx)(D,{defaultOpen:!0,className:`group/collapsible`,children:(0,Q.jsxs)(c,{children:[(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(ie,{className:`size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90`}),`Active`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[y&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:S.size>0?(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),S.size===n.length?L():P()},className:`hover:underline cursor-pointer`,children:S.size===n.length?`Deselect all`:`Select all`}):(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),P()},className:`hover:underline cursor-pointer`,children:`Select all`})}),(0,Q.jsx)(k,{variant:`secondary`,children:n.length}),(0,Q.jsxs)(te,{children:[(0,Q.jsx)(re,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,onClick:Ne,className:`p-1 rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground transition-colors`,title:`Session actions`,children:(0,Q.jsx)(f,{className:`size-4`})})}),(0,Q.jsx)(ae,{align:`end`,className:`min-w-48`,children:y?(0,Q.jsxs)(ne,{onClick:e=>{e.stopPropagation(),H()},children:[(0,Q.jsx)(le,{className:`size-4`}),`Cancel selection`]}):(0,Q.jsxs)(ne,{onClick:e=>{e.stopPropagation(),oe()},children:[(0,Q.jsx)(F,{className:`size-4`}),`Select to archive`]})})]})]})]})})}),(0,Q.jsx)(O,{children:(0,Q.jsx)(m,{children:(0,Q.jsx)(p,{children:n.map(e=>(0,Q.jsx)(R,{session:e,childrenMap:i,sessionDerivedValues:a,isActive:o===e.id,currentSessionId:o,onResumeSession:s,onCloseSession:l,onReopenSession:u,onDeleteSession:d,onRename:g,selectionMode:y,selected:S.has(e.id),onToggleSelect:A},e.id))})})})]})}),t[16]=n,t[17]=i,t[18]=o,t[19]=l,t[20]=d,t[21]=g,t[22]=u,t[23]=s,t[24]=P,t[25]=S,t[26]=y,t[27]=a,t[28]=q):q=t[28];let J;t[29]!==r||t[30]!==i||t[31]!==o||t[32]!==l||t[33]!==d||t[34]!==g||t[35]!==u||t[36]!==s||t[37]!==a?(J=r.length>0&&(0,Q.jsx)(D,{defaultOpen:!0,className:`group/collapsible`,children:(0,Q.jsxs)(c,{children:[(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(ie,{className:`size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90`}),`Archived`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(k,{variant:`secondary`,children:r.length}),(0,Q.jsxs)(te,{children:[(0,Q.jsx)(re,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,onClick:$,className:`p-1 rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground transition-colors`,title:`Archived actions`,children:(0,Q.jsx)(f,{className:`size-4`})})}),(0,Q.jsx)(ae,{align:`end`,className:`min-w-48`,children:(0,Q.jsxs)(ne,{onClick:e=>{e.stopPropagation(),ee(!0)},className:`text-destructive focus:text-destructive`,children:[(0,Q.jsx)(ue,{className:`size-4`}),`Delete all`]})})]})]})]})})}),(0,Q.jsx)(O,{children:(0,Q.jsx)(m,{children:(0,Q.jsx)(p,{children:r.map(e=>(0,Q.jsx)(R,{session:e,childrenMap:i,sessionDerivedValues:a,isActive:o===e.id,currentSessionId:o,onResumeSession:s,onCloseSession:l,onReopenSession:u,onDeleteSession:d,onRename:g},e.id))})})})]})}),t[29]=r,t[30]=i,t[31]=o,t[32]=l,t[33]=d,t[34]=g,t[35]=u,t[36]=s,t[37]=a,t[38]=J):J=t[38];let Y;t[39]!==n.length||t[40]!==r.length?(Y=n.length===0&&r.length===0&&(0,Q.jsxs)(`div`,{className:`p-4 text-center text-sm text-muted-foreground`,children:[`No sessions yet.`,(0,Q.jsx)(`br`,{}),`Start a new chat to begin.`]}),t[39]=n.length,t[40]=r.length,t[41]=Y):Y=t[41];let se;t[42]!==B||t[43]!==S.size||t[44]!==y?(se=y&&S.size>0&&(0,Q.jsxs)(`div`,{className:`sticky bottom-0 bg-sidebar border-t px-2 py-1.5 flex items-center justify-between gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate min-w-0`,children:[S.size,` selected`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,Q.jsx)(fe,{variant:`outline`,size:`icon`,onClick:B,title:`Archive`,className:`size-7`,children:(0,Q.jsx)(M,{className:`size-4`})}),(0,Q.jsx)(fe,{variant:`ghost`,size:`icon`,onClick:H,title:`Cancel`,className:`size-7`,children:(0,Q.jsx)(le,{className:`size-4`})})]})]}),t[42]=B,t[43]=S.size,t[44]=y,t[45]=se):se=t[45];let ce=`This will permanently delete ${r.length} archived session${r.length===1?``:`s`}. This action cannot be undone.`,de;t[46]!==w||t[47]!==W||t[48]!==ce?(de=(0,Q.jsx)(ve,{open:w,onOpenChange:ee,title:`Delete all archived sessions?`,description:ce,confirmLabel:`Delete all`,variant:`destructive`,onConfirm:W}),t[46]=w,t[47]=W,t[48]=ce,t[49]=de):de=t[49];let pe;return t[50]!==q||t[51]!==J||t[52]!==Y||t[53]!==se||t[54]!==de?(pe=(0,Q.jsxs)(Q.Fragment,{children:[q,J,Y,se,de]}),t[50]=q,t[51]=J,t[52]=Y,t[53]=se,t[54]=de,t[55]=pe):pe=t[55],pe}function $(e){return e.stopPropagation()}function Ne(e){return e.stopPropagation()}function Pe(e){return e.id}function Fe(e){return e.id}function Ie(e){return!e}function Le(){let e=(0,xe.c)(61),t=w(),n=P(),{sidebarRef:r,chatInputRef:a,terminalPanelRef:o}=S(),{sdkClient:s,primaryPreconfigs:c,createSession:f,resumeSession:m,closeSession:h,reopenSession:g,permanentlyDeleteSession:_,handleRenameSession:v,selectWorkspace:y,handleCreateVirtualWorkspace:b,handleCreatePhysicalWorkspace:x,deleteWorkspace:C,renameWorkspace:ee}=t,T=n.activeWorkspace?.id??null,te;e[0]!==s||e[1]!==n.connected||e[2]!==T?(te={sdkClient:s,workspaceId:T,connected:n.connected},e[0]=s,e[1]=n.connected,e[2]=T,e[3]=te):te=e[3],Se(te);let ne=n.activeSessions,re=n.archivedSessions,E;e[4]!==C||e[5]!==x||e[6]!==b||e[7]!==ee||e[8]!==s||e[9]!==y||e[10]!==n.activeWorkspace||e[11]!==n.handleToggleWorkspaceFavorite||e[12]!==n.isWorkspaceFavorited||e[13]!==n.workspaces?(E=(0,Q.jsx)(`div`,{className:`p-2 space-y-2`,children:(0,Q.jsx)(ke,{workspaces:n.workspaces,activeWorkspace:n.activeWorkspace,onSelectWorkspace:y,onCreateVirtualWorkspace:b,onCreatePhysicalWorkspace:x,isWorkspaceFavorited:n.isWorkspaceFavorited,onToggleFavorite:n.handleToggleWorkspaceFavorite,onDeleteWorkspace:C,onRenameWorkspace:ee,sdkClient:s})}),e[4]=C,e[5]=x,e[6]=b,e[7]=ee,e[8]=s,e[9]=y,e[10]=n.activeWorkspace,e[11]=n.handleToggleWorkspaceFavorite,e[12]=n.isWorkspaceFavorited,e[13]=n.workspaces,e[14]=E):E=e[14];let D;e[15]!==f||e[16]!==c[0]?.id?(D=()=>f(c[0]?.id),e[15]=f,e[16]=c[0]?.id,e[17]=D):D=e[17];let ie=!n.connected,O,ae;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(ce,{className:`size-4`,"data-icon":`inline-start`}),ae=(0,Q.jsx)(`span`,{children:`New Chat`}),e[18]=O,e[19]=ae):(O=e[18],ae=e[19]);let k;e[20]!==D||e[21]!==ie?(k=(0,Q.jsx)(p,{children:(0,Q.jsx)(d,{children:(0,Q.jsxs)(u,{onClick:D,disabled:ie,className:`w-full`,children:[O,ae]})})}),e[20]=D,e[21]=ie,e[22]=k):k=e[22];let A;e[23]!==E||e[24]!==k?(A=(0,Q.jsxs)(l,{children:[E,k]}),e[23]=E,e[24]=k,e[25]=A):A=e[25];let j=A,M;e[26]===h?M=e[27]:(M=e=>{e.forEach(e=>h(e))},e[26]=h,e[27]=M);let F=M,L;e[28]===_?L=e[29]:(L=e=>{e.forEach(e=>_(e))},e[28]=_,e[29]=L);let R=L,z;e[30]!==ne||e[31]!==re||e[32]!==h||e[33]!==F||e[34]!==R||e[35]!==v||e[36]!==_||e[37]!==g||e[38]!==m||e[39]!==n.childrenMap||e[40]!==n.currentSessionId||e[41]!==n.sessionDerivedValues?(z=(0,Q.jsx)(Me,{activeSessions:ne,archivedSessions:re,childrenMap:n.childrenMap,sessionDerivedValues:n.sessionDerivedValues,currentSessionId:n.currentSessionId,onResumeSession:m,onCloseSession:h,onReopenSession:g,onDeleteSession:_,onRenameSession:v,onBulkCloseSessions:F,onBulkDeleteSessions:R}),e[30]=ne,e[31]=re,e[32]=h,e[33]=F,e[34]=R,e[35]=v,e[36]=_,e[37]=g,e[38]=m,e[39]=n.childrenMap,e[40]=n.currentSessionId,e[41]=n.sessionDerivedValues,e[42]=z):z=e[42];let B=z,V;e[43]!==a||e[44]!==n.currentSessionId?(V=()=>{n.currentSessionId&&a.current?.focus()},e[43]=a,e[44]=n.currentSessionId,e[45]=V):V=e[45];let H;e[46]!==B||e[47]!==n.currentSessionId||e[48]!==j||e[49]!==r||e[50]!==V?(H=(0,Q.jsx)(oe,{ref:r,header:j,currentSessionId:n.currentSessionId,onEscape:V,children:B}),e[46]=B,e[47]=n.currentSessionId,e[48]=j,e[49]=r,e[50]=V,e[51]=H):H=e[51];let U;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(U={paddingTop:`0.5rem`,paddingBottom:`0.5rem`},e[52]=U):U=e[52];let W,G;e[53]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(N,{}),G=(0,Q.jsx)(i,{}),e[53]=W,e[54]=G):(W=e[53],G=e[54]);let K;e[55]!==s||e[56]!==o?(K=(0,Q.jsx)(`main`,{className:`flex-1 flex flex-col overflow-hidden min-h-0 p-2`,style:U,children:(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden min-h-0 rounded-xl bg-background shadow-sm ring-1 ring-border`,children:[W,G,(0,Q.jsx)(I,{sdkClient:s,terminalPanelRef:o})]})}),e[55]=s,e[56]=o,e[57]=K):K=e[57];let q;return e[58]!==H||e[59]!==K?(q=(0,Q.jsxs)(Q.Fragment,{children:[H,K]}),e[58]=H,e[59]=K,e[60]=q):q=e[60],q}var Re=Le;export{Re as component};
Binary file
Binary file
Binary file